opencode-quota-gui 1.3.1 → 1.3.2

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 (155) hide show
  1. package/README.md +16 -12
  2. package/dist/contracts/build-identity.js +1 -1
  3. package/dist/contracts/card-order.d.ts +2 -0
  4. package/dist/contracts/card-order.js +2 -2
  5. package/dist/contracts/card-visibility.d.ts +2 -1
  6. package/dist/contracts/card-visibility.js +2 -1
  7. package/dist/contracts/dashboard.d.ts +87 -5
  8. package/dist/contracts/dashboard.js +10 -0
  9. package/dist/contracts/dto-guards.d.ts +4 -0
  10. package/dist/contracts/dto-guards.js +29 -7
  11. package/dist/contracts/guards.js +3 -1
  12. package/dist/contracts/identity.d.ts +37 -5
  13. package/dist/contracts/identity.js +43 -0
  14. package/dist/contracts/provider-auto-resume.d.ts +9 -0
  15. package/dist/contracts/provider-auto-resume.js +24 -0
  16. package/dist/contracts/provider-failure.d.ts +22 -0
  17. package/dist/contracts/provider-failure.js +25 -1
  18. package/dist/contracts/row-order.d.ts +13 -0
  19. package/dist/contracts/row-order.js +34 -0
  20. package/dist/contracts/row-visibility.d.ts +53 -0
  21. package/dist/contracts/row-visibility.js +130 -0
  22. package/dist/data/modelsdev-pricing.min.json +1 -1
  23. package/dist/data/modelsdev-temporal.min.json +3 -634
  24. package/dist/gui/aggregation.d.ts +29 -1
  25. package/dist/gui/aggregation.js +157 -4
  26. package/dist/gui/analytics-bridge.d.ts +8 -9
  27. package/dist/gui/analytics-bridge.js +197 -54
  28. package/dist/gui/analytics-engine.d.ts +7 -15
  29. package/dist/gui/analytics-engine.js +246 -106
  30. package/dist/gui/analytics-model.d.ts +7 -0
  31. package/dist/gui/analytics-model.js +75 -9
  32. package/dist/gui/analytics-pricing-upkeep.d.ts +21 -0
  33. package/dist/gui/analytics-pricing-upkeep.js +23 -0
  34. package/dist/gui/analytics-protocol.d.ts +17 -7
  35. package/dist/gui/analytics-protocol.js +1 -0
  36. package/dist/gui/analytics-service.d.ts +10 -0
  37. package/dist/gui/analytics-service.js +30 -9
  38. package/dist/gui/analytics-state.d.ts +30 -5
  39. package/dist/gui/analytics-state.js +46 -7
  40. package/dist/gui/analytics-worker-runtime.d.ts +5 -0
  41. package/dist/gui/analytics-worker-runtime.js +9 -1
  42. package/dist/gui/analytics-worker.js +11 -0
  43. package/dist/gui/config.d.ts +2 -2
  44. package/dist/gui/config.js +46 -5
  45. package/dist/gui/identity.d.ts +6 -20
  46. package/dist/gui/identity.js +6 -54
  47. package/dist/gui/primary-quota-windows.js +55 -34
  48. package/dist/gui/provider-cards.d.ts +12 -8
  49. package/dist/gui/provider-cards.js +12 -53
  50. package/dist/gui/quota-notification-detector.d.ts +25 -2
  51. package/dist/gui/quota-notification-detector.js +60 -5
  52. package/dist/gui/quota-notification-observer.d.ts +1 -1
  53. package/dist/gui/quota-notification-observer.js +5 -1
  54. package/dist/gui/quota-observation.d.ts +4 -0
  55. package/dist/gui/quota-observation.js +18 -0
  56. package/dist/gui/rpc.js +3 -0
  57. package/dist/gui/server.js +6 -1
  58. package/dist/gui/snapshot-service.d.ts +3 -17
  59. package/dist/gui/snapshot-service.js +159 -9
  60. package/dist/gui/sources.js +84 -11
  61. package/dist/gui/temporal-status.d.ts +3 -2
  62. package/dist/gui/temporal-status.js +10 -6
  63. package/dist/gui-experimental.cjs +228 -228
  64. package/dist/lib/accounting-format.d.ts +8 -0
  65. package/dist/lib/accounting-format.js +12 -2
  66. package/dist/lib/anthropic-api-auth.d.ts +7 -0
  67. package/dist/lib/anthropic-api-auth.js +27 -0
  68. package/dist/lib/anthropic-api-rate-limits.d.ts +47 -0
  69. package/dist/lib/anthropic-api-rate-limits.js +92 -0
  70. package/dist/lib/anthropic-oauth-throttle.d.ts +76 -0
  71. package/dist/lib/anthropic-oauth-throttle.js +379 -0
  72. package/dist/lib/anthropic.d.ts +22 -4
  73. package/dist/lib/anthropic.js +498 -180
  74. package/dist/lib/cache-observer-ingestion.js +27 -0
  75. package/dist/lib/cache-observer.d.ts +3 -0
  76. package/dist/lib/cache-observer.js +9 -3
  77. package/dist/lib/cli-show.d.ts +5 -0
  78. package/dist/lib/cli-show.js +16 -5
  79. package/dist/lib/cli-status.js +3 -6
  80. package/dist/lib/config.d.ts +1 -1
  81. package/dist/lib/config.js +64 -2
  82. package/dist/lib/dashboard-visibility.d.ts +5 -0
  83. package/dist/lib/dashboard-visibility.js +11 -10
  84. package/dist/lib/display-sanitize.js +1 -0
  85. package/dist/lib/entries.d.ts +10 -1
  86. package/dist/lib/entries.js +4 -0
  87. package/dist/lib/grouped-entry-normalization.js +1 -1
  88. package/dist/lib/maintainer-announcements.js +2 -2
  89. package/dist/lib/modelsdev-pricing.d.ts +74 -2
  90. package/dist/lib/modelsdev-pricing.js +457 -63
  91. package/dist/lib/modelsdev-temporal.d.ts +6 -0
  92. package/dist/lib/modelsdev-temporal.js +16 -2
  93. package/dist/lib/opencode-config-providers.js +2 -2
  94. package/dist/lib/opencode-storage.d.ts +20 -0
  95. package/dist/lib/opencode-storage.js +89 -2
  96. package/dist/lib/opencode-version-core.d.ts +7 -0
  97. package/dist/lib/opencode-version-core.js +10 -0
  98. package/dist/lib/opencode-warming-refresh.d.ts +19 -0
  99. package/dist/lib/opencode-warming-refresh.js +95 -0
  100. package/dist/lib/provider-metadata.d.ts +11 -3
  101. package/dist/lib/provider-metadata.js +20 -2
  102. package/dist/lib/provider-registration.d.ts +342 -3
  103. package/dist/lib/provider-registration.js +409 -27
  104. package/dist/lib/quota-auto-resume.d.ts +74 -0
  105. package/dist/lib/quota-auto-resume.js +539 -0
  106. package/dist/lib/quota-command-format.js +22 -9
  107. package/dist/lib/quota-identity.d.ts +64 -0
  108. package/dist/lib/quota-identity.js +111 -0
  109. package/dist/lib/quota-providers.js +2 -2
  110. package/dist/lib/quota-render-data.js +2 -2
  111. package/dist/lib/quota-reset-notifications.js +11 -155
  112. package/dist/lib/quota-retry-wait.d.ts +106 -5
  113. package/dist/lib/quota-retry-wait.js +301 -34
  114. package/dist/lib/quota-runtime-context.js +1 -0
  115. package/dist/lib/quota-state-codec.d.ts +2 -0
  116. package/dist/lib/quota-state-codec.js +14 -1
  117. package/dist/lib/quota-state.d.ts +1 -1
  118. package/dist/lib/quota-state.js +60 -28
  119. package/dist/lib/quota-stats.d.ts +26 -0
  120. package/dist/lib/quota-stats.js +19 -1
  121. package/dist/lib/quota-surface-data.js +18 -3
  122. package/dist/lib/quota-telemetry.js +2 -2
  123. package/dist/lib/resolved-auth-identity.d.ts +19 -0
  124. package/dist/lib/resolved-auth-identity.js +44 -0
  125. package/dist/lib/state-file-lock.d.ts +26 -0
  126. package/dist/lib/state-file-lock.js +205 -0
  127. package/dist/lib/toast-format-grouped.js +7 -4
  128. package/dist/lib/tui-compact-format.js +29 -16
  129. package/dist/lib/types.d.ts +20 -0
  130. package/dist/lib/types.js +4 -1
  131. package/dist/plugin.js +67 -1
  132. package/dist/providers/alibaba-coding-plan.js +21 -3
  133. package/dist/providers/alibaba-token-plan.js +9 -5
  134. package/dist/providers/anthropic.d.ts +6 -2
  135. package/dist/providers/anthropic.js +123 -14
  136. package/dist/providers/chutes.js +2 -0
  137. package/dist/providers/claude-agent.js +24 -5
  138. package/dist/providers/copilot.js +5 -4
  139. package/dist/providers/glm-coding-plan-provider.js +30 -23
  140. package/dist/providers/ollama-cloud.js +10 -0
  141. package/dist/providers/openai.js +24 -23
  142. package/dist/providers/opencode-go.js +7 -6
  143. package/dist/providers/opencode-zen.js +1 -1
  144. package/dist/providers/result-helpers.d.ts +4 -2
  145. package/dist/providers/result-helpers.js +5 -1
  146. package/dist/providers/synthetic.js +4 -0
  147. package/dist/providers/xai.js +9 -8
  148. package/dist/rpc.d.ts +8 -0
  149. package/dist/rpc.js +15 -2
  150. package/dist/ui/assets/{index-BcueIm3Z.css → index-6_g1FHs-.css} +1 -1
  151. package/dist/ui/assets/index-sZnGUuML.js +10 -0
  152. package/dist/ui/assets/{popover-4bFSvRZ7.js → popover-C4ZLYe9E.js} +1 -1
  153. package/dist/ui/index.html +2 -2
  154. package/package.json +3 -3
  155. package/dist/ui/assets/index-C6qRSoh8.js +0 -10
@@ -0,0 +1,10 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/popover-C4ZLYe9E.js","assets/popover-mkHTmNjv.css"])))=>i.map(i=>d[i]);
2
+ var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=he,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p=null,m=null,h=null,g=null,_=null,v=0;function y(e,t){let n=h,r=p,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>ye(o)));p=o,h=null;try{return pe(s,!0)}finally{h=n,p=r}}function b(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[se.bind(n),e=>(typeof e==`function`&&(e=m&&m.running&&m.sources.has(n)?e(n.tValue):e(n.value)),ce(n,e))]}function x(e,t,n){le(de(e,t,!1,u))}function S(e,t,n){l=ge;let r=de(e,t,!1,u),i=oe&&A(oe);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),_?_.push(r):le(r)}function C(e,t,n){n=n?Object.assign({},s,n):s;let r=de(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,le(r),se.bind(r)}function w(e){return pe(e,!1)}function T(e){if(h===null)return e();let t=h;h=null;try{return e()}finally{h=t}}function E(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function D(e){S(()=>T(e))}function O(e){return p===null||(p.cleanups===null?p.cleanups=[e]:p.cleanups.push(e)),e}function k(){return h}function ee(){return p}function te(e,t){let n=p,r=h;p=e,h=null;try{return pe(t,!0)}catch(e){Ce(e)}finally{p=n,h=r}}var[ne,re]=b(!1);function ie(e,t){let n=Symbol(`context`);return{id:n,Provider:Te(n),defaultValue:e}}function A(e){let t;return p&&p.context&&(t=p.context[e.id])!==void 0?t:e.defaultValue}function ae(e){let t=C(e),n=C(()=>we(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var oe;function se(){let e=m&&m.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)le(this);else{let e=g;g=null,pe(()=>_e(this),!1),g=e}}if(h){let e=this.observers?this.observers.length:0;h.sources?(h.sources.push(this),h.sourceSlots.push(e)):(h.sources=[this],h.sourceSlots=[e]),this.observers?(this.observers.push(h),this.observerSlots.push(h.sources.length-1)):(this.observers=[h],this.observerSlots=[h.sources.length-1])}return e&&m.sources.has(this)?this.tValue:this.value}function ce(e,t,n){let r=m&&m.running&&m.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(m){let r=m.running;(r||!n&&m.sources.has(e))&&(m.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&pe(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=m&&m.running;r&&m.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?g.push(n):_.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(g.length>1e6)throw g=[],Error()},!1)}return t}function le(e){if(!e.fn)return;ye(e);let t=v;ue(e,m&&m.running&&m.sources.has(e)?e.tValue:e.value,t),m&&!m.running&&m.sources.has(e)&&queueMicrotask(()=>{pe(()=>{m&&(m.running=!0),h=p=e,ue(e,e.tValue,t),h=p=null},!1)})}function ue(e,t,n){let r,i=p,a=h;h=p=e;try{r=e.fn(t)}catch(t){return e.pure&&(m&&m.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(ye),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(ye),e.owned=null)),e.updatedAt=n+1,Ce(t)}finally{h=a,p=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ce(e,r,!0):m&&m.running&&e.pure?(m.sources.has(e)||(e.value=r),m.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function de(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:p,context:p?p.context:null,pure:n};return m&&m.running&&(a.state=0,a.tState=r),p===null||p!==f&&(m&&m.running&&p.pure?p.tOwned?p.tOwned.push(a):p.tOwned=[a]:p.owned?p.owned.push(a):p.owned=[a]),a}function fe(e){let t=m&&m.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return _e(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<v);){if(t&&m.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(m.disposed.has(t))return}if((t?e.tState:e.state)===u)le(e);else if((t?e.tState:e.state)===d){let t=g;g=null,pe(()=>_e(e,n[0]),!1),g=t}}}function pe(e,t){if(g)return e();let n=!1;t||(g=[]),_?n=!0:_=[],v++;try{let t=e();return me(n),t}catch(e){n||(_=null),g=null,Ce(e)}}function me(e){if(g&&=(he(g),null),e)return;let t;if(m){if(!m.promises.size&&!m.queue.size){let e=m.sources,n=m.disposed;_.push.apply(_,m.effects),t=m.resolve;for(let e of _)`tState`in e&&(e.state=e.tState),delete e.tState;m=null,pe(()=>{for(let e of n)ye(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)ye(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}re(!1)},!1)}else if(m.running){m.running=!1,m.effects.push.apply(m.effects,_),_=null,re(!0);return}}let n=_;_=null,n.length&&pe(()=>l(n),!1),t&&t()}function he(e){for(let t=0;t<e.length;t++)fe(e[t])}function ge(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:fe(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)fe(t[r])}function _e(e,t){let n=m&&m.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<v)&&fe(i):e===d&&_e(i,t)}}}function ve(e){let t=m&&m.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?g.push(r):_.push(r),r.observers&&ve(r))}}function ye(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ye(e.tOwned[t]);delete e.tOwned}if(m&&m.running&&e.pure)be(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)ye(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}m&&m.running?e.tState=0:e.state=0}function be(e,t){if(t||(e.tState=0,m.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)be(e.owned[t])}function xe(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function Se(e,t,n){try{for(let n of t)n(e)}catch(e){Ce(e,n&&n.owner||null)}}function Ce(e,t=p){let n=c&&t&&t.context&&t.context[c],r=xe(e);if(!n)throw r;_?_.push({fn(){Se(r,n,t)},state:u}):Se(r,n,t)}function we(e){if(typeof e==`function`&&!e.length)return we(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=we(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Te(e,t){return function(t){let n;return x(()=>n=T(()=>(p.context={...p.context,[e]:t.value},ae(()=>t.children))),void 0),n}}var Ee=Symbol(`fallback`);function De(e){for(let t=0;t<e.length;t++)e[t]()}function Oe(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return O(()=>De(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,b;if(u===0)s!==0&&(De(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ee],i[0]=y(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=y(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)b=l[f],d=e.get(b),t[f]=d===void 0?-1:d,e.set(b,f);for(d=g;d<=_;d++)b=r[d],f=e.get(b),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(b,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=y(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=b(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function j(e,t){return T(()=>e(t||{}))}function ke(){return!0}var Ae={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:ke,deleteProperty:ke,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ke,deleteProperty:ke}},ownKeys(e){return e.keys()}};function je(e){return(e=typeof e==`function`?e():e)?e:{}}function Me(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function M(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,C(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=je(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in je(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(je(e[n])));return[...new Set(t)]}},Ae);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Me.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function N(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},Ae));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ae)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}var Ne=0;function Pe(){return e.context?e.getNextContextId():`cl-${Ne++}`}var Fe=e=>`Stale read from <${e}>.`;function P(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return C(Oe(()=>e.each,e.children,t||void 0))}function F(e){let t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(e,t)=>!e==!t});return C(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Fe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Ie(e){let t=ae(()=>e.children),n=C(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=C(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:C(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return C(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Fe(`Match`);return i()})):o},void 0,void 0)}function Le(e){return e}var Re=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),ze=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Be=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Ve=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function He(e,t){let n=Ve[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ue=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),We=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Ge={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},I=e=>C(()=>e());function Ke(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var qe=`_$DX_DELEGATE`;function Je(e,t,n,r={}){let i;return y(r=>{i=r,t===document?e():B(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function L(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Ye(e,t=window.document){let n=t[qe]||(t[qe]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ut))}}function R(e,t,n){ot(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Xe(e,t,n,r){ot(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ze(e,t,n){ot(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function Qe(e,t){ot(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function $e(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function et(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(ct(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(ct(e,i,!0),n[i]=o)}return n}function tt(e,t,n){if(!t)return n?R(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function z(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function nt(e,t={},n,r){let i={};return r||x(()=>i.children=dt(e,t.children,i.children)),x(()=>typeof t.ref==`function`&&rt(t.ref,e)),x(()=>it(e,t,n,!0,i,!0)),i}function rt(e,t,n){return T(()=>e(t,n))}function B(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return dt(e,t,r,n);x(r=>dt(e,t(),r,n),r)}function it(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=lt(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||dt(e,t.children);continue}let s=t[o];i[o]=lt(e,o,s,i[o],n,a,t)}}function at(t){let n,r;return!ot()||!(n=e.registry.get(r=ht()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function ot(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function st(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function ct(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function lt(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return tt(e,n,r);if(t===`classList`)return et(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ue.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&($e(e,i,n,a),a&&Ye([i]))}else if(t.slice(0,5)===`attr:`)R(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)Ze(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=ze.has(t))||!i&&((u=He(t,e.tagName))||(c=Re.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(ot(e))return n;t===`class`||t===`className`?Qe(e,n):s&&!c&&!l?e[st(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Ge[t.split(`:`)[0]];r?Xe(e,r,t,n):R(e,Be[t]||t,n)}return n}function ut(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0),t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}function dt(e,t,n,r,i){let a=ot(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=mt(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=mt(e,n,r)}else if(o===`function`)return x(()=>{let i=t();for(;typeof i==`function`;)i=i();n=dt(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return x(()=>n=dt(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=mt(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Ke(e,n,o):(n&&mt(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=mt(e,n,r,t);mt(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function mt(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function ht(){return e.getNextContextId()}var gt=`http://www.w3.org/2000/svg`;function _t(e,t=!1,n=void 0){return t?document.createElementNS(gt,e):document.createElement(e,{is:n})}function vt(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=ee(),o,s=!!e.context;return S(()=>{s&&(ee().user=s=!1),o||=te(a,()=>C(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=b(!1);y(n=>B(e,()=>t()?n():o(),null)),O(()=>n(!0))}else{let i=_t(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),B(a,o),e.appendChild(i),t.ref&&t.ref(i),O(()=>e.removeChild(i))}},void 0,{render:!s}),r}function yt(t,n){let r=C(t);return C(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=We.has(t),i=e.context?at():_t(t,r,T(()=>n.is));return nt(i,n,r),i}})}function bt(e){let[,t]=N(e,[`component`]);return yt(()=>e.component,t)}function xt(e){return(...t)=>{for(let n of e)n&&n(...t)}}var V=e=>typeof e==`function`&&!e.length?e():e;function St(e,...t){return typeof e==`function`?e(...t):e}var Ct=O,wt=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Tt(e){let t={},n;for(;n=wt.exec(e);)t[n[1]]=n[2];return t}function Et(e,t){if(typeof e==`string`){if(typeof t==`string`)return`${e};${t}`;e=Tt(e)}else typeof t==`string`&&(t=Tt(t));return{...e,...t}}function Dt(...e){return xt(e)}function Ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kt(e){return Object.prototype.toString.call(e)===`[object String]`}function At(e){return typeof e==`function`}function jt(e){return t=>`${e()}-${t}`}function Mt(e,t){return e?e===t||e.contains(t):!1}function Nt(e,t=!1){let{activeElement:n}=Ft(e);if(!n?.nodeName)return null;if(It(n)&&n.contentDocument)return Nt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Ft(n).getElementById(e);if(t)return t}}return n}function Pt(e){return Ft(e).defaultView||window}function Ft(e){return e?e.ownerDocument||e:document}function It(e){return e.tagName===`IFRAME`}var Lt=(e=>(e.Escape=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`,e.Space=` `,e.ArrowDown=`ArrowDown`,e.ArrowLeft=`ArrowLeft`,e.ArrowRight=`ArrowRight`,e.ArrowUp=`ArrowUp`,e.End=`End`,e.Home=`Home`,e.PageDown=`PageDown`,e.PageUp=`PageUp`,e))(Lt||{});function Rt(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function zt(){return Rt(/^Mac/i)}function Bt(e,t){return t&&(At(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Vt(e){return t=>{for(let n of e)Bt(t,n)}}function Ht(e){return zt()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ut(e){if(e){if(Gt())e.focus({preventScroll:!0});else{let t=Kt(e);e.focus(),qt(t)}}}var Wt=null;function Gt(){if(Wt==null){Wt=!1;try{document.createElement(`div`).focus({get preventScroll(){return Wt=!0,!0}})}catch{}}return Wt}function Kt(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function qt(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Jt=[`input:not([type='hidden']):not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`[tabindex]`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable='false'])`],Yt=[...Jt,`[tabindex]:not([tabindex="-1"]):not([disabled])`],Xt=`${Jt.join(`:not([hidden]),`)},[tabindex]:not([disabled]):not([hidden])`;Yt.join(`:not([hidden]):not([tabindex="-1"]),`);function Zt(e,t){let n=Array.from(e.querySelectorAll(Xt)).filter(Qt);return t&&Qt(e)&&n.unshift(e),n.forEach((e,t)=>{if(It(e)&&e.contentDocument){let r=e.contentDocument.body,i=Zt(r,!1);n.splice(t,1,...i)}}),n}function Qt(e){return $t(e)&&!en(e)}function $t(e){return e.matches(Xt)&&tn(e)}function en(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function tn(e,t){return e.nodeName!==`#comment`&&nn(e)&&rn(e,t)&&(!e.parentElement||tn(e.parentElement,e))}function nn(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r=t!==`none`&&n!==`hidden`&&n!==`collapse`;if(r){if(!e.ownerDocument.defaultView)return r;let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:i}=t(e);r=n!==`none`&&i!==`hidden`&&i!==`collapse`}return r}function rn(e,t){return!e.hasAttribute(`hidden`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function an(){}function on(e){return[e.clientX,e.clientY]}function sn(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=a,o=0,s=e-1;o<e;s=o++){let[a,c]=t[o],[l,u]=t[s],[,d]=t[s===0?e-1:s-1]||[0,0],f=(c-u)*(n-a)-(a-l)*(r-c);if(u<c){if(r>=u&&r<c){if(f===0)return!0;f>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(c<u){if(r>c&&r<=u){if(f===0)return!0;f<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r===c&&(n>=l&&n<=a||n>=a&&n<=l))return!0}return i}function cn(e,t){return M(e,t)}var ln=new Map,un=new Set;function dn(){if(typeof window>`u`||document.body===null)return;let e=e=>{if(!e.target)return;let n=ln.get(e.target);n||(n=new Set,ln.set(e.target,n),e.target.addEventListener(`transitioncancel`,t)),n.add(e.propertyName)},t=e=>{if(!e.target)return;let n=ln.get(e.target);if(n&&(n.delete(e.propertyName),n.size===0&&(e.target.removeEventListener(`transitioncancel`,t),ln.delete(e.target)),ln.size===0)){for(let e of un)e();un.clear()}};document.body.addEventListener(`transitionrun`,e),document.body.addEventListener(`transitionend`,t)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,dn):dn());var fn={border:`0`,clip:`rect(0 0 0 0)`,"clip-path":`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,"white-space":`nowrap`};function pn(e,t){let[n,r]=b(mn(t?.()));return S(()=>{r(e()?.tagName.toLowerCase()||mn(t?.()))}),n}function mn(e){return kt(e)?e:void 0}function hn(e){let[t,n]=N(e,[`as`]);if(!t.as)throw Error("[kobalte]: Polymorphic is missing the required `as` prop.");return j(bt,M(n,{get component(){return t.as}}))}var gn=Object.defineProperty,_n=(e,t)=>{for(var n in t)gn(e,n,{get:t[n],enumerable:!0})};_n({},{Button:()=>xn,Root:()=>bn});var vn=[`button`,`color`,`file`,`image`,`reset`,`submit`];function yn(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?vn.indexOf(e.type)!==-1:!1}function bn(e){let t,[n,r]=N(cn({type:`button`},e),[`ref`,`type`,`disabled`]),i=pn(()=>t,()=>`button`),a=C(()=>{let e=i();return e!=null&&yn({tagName:e,type:n.type})}),o=C(()=>i()===`input`),s=C(()=>i()===`a`&&t?.getAttribute(`href`)!=null);return j(hn,M({as:`button`,ref(e){var r=Dt(e=>t=e,n.ref);typeof r==`function`&&r(e)},get type(){return I(()=>!!(a()||o()))()?n.type:void 0},get role(){return!a()&&!s()?`button`:void 0},get tabIndex(){return!a()&&!s()&&!n.disabled?0:void 0},get disabled(){return I(()=>!!(a()||o()))()?n.disabled:void 0},get"aria-disabled"(){return!a()&&!o()&&n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?``:void 0}},r))}var xn=bn,Sn={"align-right":`<path d="M12.292 6.04167L16.2503 9.99998L12.292 13.9583M2.91699 9.99998H15.6253M17.0837 3.75V16.25" stroke="currentColor" stroke-linecap="square"/>`,"arrow-up":`<path fill-rule="evenodd" clip-rule="evenodd" d="M9.99991 2.24121L16.0921 8.33343L15.2083 9.21731L10.6249 4.63397V17.5001H9.37492V4.63398L4.7916 9.21731L3.90771 8.33343L9.99991 2.24121Z" fill="currentColor"/>`,"arrow-left":`<path d="M8.33464 4.58398L2.91797 10.0007L8.33464 15.4173M3.33464 10.0007H17.0846" stroke="currentColor" stroke-linecap="square"/>`,"arrow-right":`<path d="M11.6654 4.58398L17.082 10.0007L11.6654 15.4173M16.6654 10.0007H2.91536" stroke="currentColor" stroke-linecap="square"/>`,archive:`<path d="M16.8747 6.24935H17.3747V5.74935H16.8747V6.24935ZM16.8747 16.8743V17.3743H17.3747V16.8743H16.8747ZM3.12467 16.8743H2.62467V17.3743H3.12467V16.8743ZM3.12467 6.24935V5.74935H2.62467V6.24935H3.12467ZM2.08301 2.91602V2.41602H1.58301V2.91602H2.08301ZM17.9163 2.91602H18.4163V2.41602H17.9163V2.91602ZM17.9163 6.24935V6.74935H18.4163V6.24935H17.9163ZM2.08301 6.24935H1.58301V6.74935H2.08301V6.24935ZM8.33301 9.08268H7.83301V10.0827H8.33301V9.58268V9.08268ZM11.6663 10.0827H12.1663V9.08268H11.6663V9.58268V10.0827ZM16.8747 6.24935H16.3747V16.8743H16.8747H17.3747V6.24935H16.8747ZM16.8747 16.8743V16.3743H3.12467V16.8743V17.3743H16.8747V16.8743ZM3.12467 16.8743H3.62467V6.24935H3.12467H2.62467V16.8743H3.12467ZM3.12467 6.24935V6.74935H16.8747V6.24935V5.74935H3.12467V6.24935ZM2.08301 2.91602V3.41602H17.9163V2.91602V2.41602H2.08301V2.91602ZM17.9163 2.91602H17.4163V6.24935H17.9163H18.4163V2.91602H17.9163ZM17.9163 6.24935V5.74935H2.08301V6.24935V6.74935H17.9163V6.24935ZM2.08301 6.24935H2.58301V2.91602H2.08301H1.58301V6.24935H2.08301ZM8.33301 9.58268V10.0827H11.6663V9.58268V9.08268H8.33301V9.58268Z" fill="currentColor"/>`,"bubble-5":`<path d="M18.3327 9.99935C18.3327 5.57227 15.0919 2.91602 9.99935 2.91602C4.90676 2.91602 1.66602 5.57227 1.66602 9.99935C1.66602 11.1487 2.45505 13.1006 2.57637 13.3939C2.58707 13.4197 2.59766 13.4434 2.60729 13.4697C2.69121 13.6987 3.04209 14.9354 1.66602 16.7674C3.51787 17.6528 5.48453 16.1973 5.48453 16.1973C6.84518 16.9193 8.46417 17.0827 9.99935 17.0827C15.0919 17.0827 18.3327 14.4264 18.3327 9.99935Z" stroke="currentColor" stroke-linecap="square"/>`,prompt:`<path d="M14.5841 12.0807H17.9193V2.91406H5.6276V6.2474M14.5859 6.2474H2.08594V15.4141H5.0026V17.4974L8.7526 15.4141H14.5859V6.2474Z" stroke="currentColor" stroke-linecap="square"/>`,brain:`<path d="M13.332 8.7487C11.4911 8.7487 9.9987 7.25631 9.9987 5.41536M6.66536 11.2487C8.50631 11.2487 9.9987 12.7411 9.9987 14.582M9.9987 2.78209L9.9987 17.0658M16.004 15.0475C17.1255 14.5876 17.9154 13.4849 17.9154 12.1978C17.9154 11.3363 17.5615 10.5575 16.9913 9.9987C17.5615 9.43991 17.9154 8.66108 17.9154 7.79962C17.9154 6.21199 16.7136 4.90504 15.1702 4.73878C14.7858 3.21216 13.4039 2.08203 11.758 2.08203C11.1171 2.08203 10.5162 2.25337 9.9987 2.55275C9.48117 2.25337 8.88032 2.08203 8.23944 2.08203C6.59353 2.08203 5.21157 3.21216 4.82722 4.73878C3.28377 4.90504 2.08203 6.21199 2.08203 7.79962C2.08203 8.66108 2.43585 9.43991 3.00609 9.9987C2.43585 10.5575 2.08203 11.3363 2.08203 12.1978C2.08203 13.4849 2.87191 14.5876 3.99339 15.0475C4.46688 16.7033 5.9917 17.9154 7.79962 17.9154C8.61335 17.9154 9.36972 17.6698 9.9987 17.2488C10.6277 17.6698 11.384 17.9154 12.1978 17.9154C14.0057 17.9154 15.5305 16.7033 16.004 15.0475Z" stroke="currentColor"/>`,fork:`<path d="M2.91602 7.91406L2.91602 2.91406H7.91602M12.0827 2.91406H17.0827L17.0827 7.91406M9.99935 9.9974L9.99935 17.0807M9.99935 9.9974L3.33268 3.33073M9.99935 9.9974L16.666 3.33073" stroke="currentColor" stroke-linecap="square"/>`,"workspace-isolated":`<g transform="translate(2 2)"><path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/></g>`,"bullet-list":`<path d="M9.58329 13.7497H17.0833M9.58329 6.24967H17.0833M6.24996 6.24967C6.24996 7.17015 5.50377 7.91634 4.58329 7.91634C3.66282 7.91634 2.91663 7.17015 2.91663 6.24967C2.91663 5.3292 3.66282 4.58301 4.58329 4.58301C5.50377 4.58301 6.24996 5.3292 6.24996 6.24967ZM6.24996 13.7497C6.24996 14.6701 5.50377 15.4163 4.58329 15.4163C3.66282 15.4163 2.91663 14.6701 2.91663 13.7497C2.91663 12.8292 3.66282 12.083 4.58329 12.083C5.50377 12.083 6.24996 12.8292 6.24996 13.7497Z" stroke="currentColor" stroke-linecap="square"/>`,"check-small":`<path d="M6.5 11.4412L8.97059 13.5L13.5 6.5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-down":`<path d="M6.6665 8.33325L9.99984 11.6666L13.3332 8.33325" stroke="currentColor" stroke-linecap="square"/>`,"chevron-left":`<path d="M12 15L7 10L12 5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-right":`<path d="M8 15L13 10L8 5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-grabber-vertical":`<path d="M6.66675 12.4998L10.0001 15.8332L13.3334 12.4998M6.66675 7.49984L10.0001 4.1665L13.3334 7.49984" stroke="currentColor" stroke-linecap="square"/>`,"chevron-double-right":`<path d="M11.6654 13.3346L14.9987 10.0013L11.6654 6.66797M5.83203 13.3346L9.16536 10.0013L5.83203 6.66797" stroke="currentColor" stroke-linecap="square"/>`,"circle-x":`<path fill-rule="evenodd" clip-rule="evenodd" d="M1.6665 10.0003C1.6665 5.39795 5.39746 1.66699 9.99984 1.66699C14.6022 1.66699 18.3332 5.39795 18.3332 10.0003C18.3332 14.6027 14.6022 18.3337 9.99984 18.3337C5.39746 18.3337 1.6665 14.6027 1.6665 10.0003ZM7.49984 6.91107L6.91058 7.50033L9.41058 10.0003L6.91058 12.5003L7.49984 13.0896L9.99984 10.5896L12.4998 13.0896L13.0891 12.5003L10.5891 10.0003L13.0891 7.50033L12.4998 6.91107L9.99984 9.41107L7.49984 6.91107Z" fill="currentColor"/>`,close:`<path d="M3.75 3.75L16.25 16.25M16.25 3.75L3.75 16.25" stroke="currentColor" stroke-linecap="square"/>`,"close-small":`<path d="M6 6L14 14M14 6L6 14" stroke="currentColor" stroke-linecap="square"/>`,checklist:`<path d="M9.58342 13.7498H17.0834M9.58342 6.24984H17.0834M2.91675 6.6665L4.58341 7.9165L7.08341 4.1665M2.91675 14.1665L4.58341 15.4165L7.08341 11.6665" stroke="currentColor" stroke-linecap="square"/>`,console:`<path d="M3.75 5.4165L8.33333 9.99984L3.75 14.5832M10.4167 14.5832H16.25" stroke="currentColor" stroke-linecap="square"/>`,terminal:`<path d="M6.5 8L8.64286 10L6.5 12M10.9286 12H13.5M2 18H18V2H2V18Z" stroke="currentColor" stroke-linecap="square"/>`,"terminal-active":`<path d="M2 18H18V2H2V18Z" fill="currentColor" fill-opacity="0.1"/>
3
+ <path d="M6.5 8L8.64286 10L6.5 12M10.9286 12H13.5M2 18H18V2H2V18Z" stroke="currentColor" stroke-linecap="square"/>`,review:`<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,"review-active":`<path d="M18 18V2L2 2L2 18H18Z" fill="currentColor" fill-opacity="0.1"/>
4
+ <path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,expand:`<path d="M4.58301 10.4163V15.4163H9.58301M10.4163 4.58301H15.4163V9.58301" stroke="currentColor" stroke-linecap="square"/>`,collapse:`<path d="M16.666 8.33398H11.666V3.33398" stroke="currentColor" stroke-linecap="square"/><path d="M8.33398 16.666V11.666H3.33398" stroke="currentColor" stroke-linecap="square"/>`,code:`<path d="M8.7513 7.5013L6.2513 10.0013L8.7513 12.5013M11.2513 7.5013L13.7513 10.0013L11.2513 12.5013M2.91797 2.91797H17.0846V17.0846H2.91797V2.91797Z" stroke="currentColor"/>`,"code-lines":`<path d="M2.08325 3.75H11.2499M14.5833 3.75H17.9166M2.08325 10L7.08325 10M10.4166 10L17.9166 10M2.08325 16.25L8.74992 16.25M12.0833 16.25L17.9166 16.25" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,"circle-ban-sign":`<path d="M15.3675 4.63087L4.55742 15.441M17.9163 9.9987C17.9163 14.371 14.3719 17.9154 9.99967 17.9154C7.81355 17.9154 5.83438 17.0293 4.40175 15.5966C2.96911 14.164 2.08301 12.1848 2.08301 9.9987C2.08301 5.62644 5.62742 2.08203 9.99967 2.08203C12.1858 2.08203 14.165 2.96813 15.5976 4.40077C17.0302 5.8334 17.9163 7.81257 17.9163 9.9987Z" stroke="currentColor" stroke-linecap="round"/>`,"edit-small-2":`<path d="M17.0834 17.0833V17.5833H17.5834V17.0833H17.0834ZM2.91675 17.0833H2.41675V17.5833H2.91675V17.0833ZM2.91675 2.91659V2.41659H2.41675V2.91659H2.91675ZM9.58341 3.41659H10.0834V2.41659H9.58341V2.91659V3.41659ZM17.5834 10.4166V9.91659H16.5834V10.4166H17.0834H17.5834ZM10.4167 7.08325L10.0632 6.7297L9.91675 6.87615V7.08325H10.4167ZM10.4167 9.58325H9.91675V10.0833H10.4167V9.58325ZM12.9167 9.58325V10.0833H13.1239L13.2703 9.93681L12.9167 9.58325ZM15.4167 2.08325L15.7703 1.7297L15.4167 1.37615L15.0632 1.7297L15.4167 2.08325ZM17.9167 4.58325L18.2703 4.93681L18.6239 4.58325L18.2703 4.2297L17.9167 4.58325ZM17.0834 17.0833V16.5833H2.91675V17.0833V17.5833H17.0834V17.0833ZM2.91675 17.0833H3.41675V2.91659H2.91675H2.41675V17.0833H2.91675ZM2.91675 2.91659V3.41659H9.58341V2.91659V2.41659H2.91675V2.91659ZM17.0834 10.4166H16.5834V17.0833H17.0834H17.5834V10.4166H17.0834ZM10.4167 7.08325H9.91675V9.58325H10.4167H10.9167V7.08325H10.4167ZM10.4167 9.58325V10.0833H12.9167V9.58325V9.08325H10.4167V9.58325ZM10.4167 7.08325L10.7703 7.43681L15.7703 2.43681L15.4167 2.08325L15.0632 1.7297L10.0632 6.7297L10.4167 7.08325ZM15.4167 2.08325L15.0632 2.43681L17.5632 4.93681L17.9167 4.58325L18.2703 4.2297L15.7703 1.7297L15.4167 2.08325ZM17.9167 4.58325L17.5632 4.2297L12.5632 9.2297L12.9167 9.58325L13.2703 9.93681L18.2703 4.93681L17.9167 4.58325Z" fill="currentColor"/>`,eye:`<path d="M10 4.58325C5.83333 4.58325 2.5 9.99992 2.5 9.99992C2.5 9.99992 5.83333 15.4166 10 15.4166C14.1667 15.4166 17.5 9.99992 17.5 9.99992C17.5 9.99992 14.1667 4.58325 10 4.58325Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`,enter:`<path d="M5.83333 15.8334L2.5 12.5L5.83333 9.16671M3.33333 12.5H17.9167V4.58337H10" stroke="currentColor" stroke-linecap="square"/>`,folder:`<path d="M2.08301 2.91675V16.2501H17.9163V5.41675H9.99967L8.33301 2.91675H2.08301Z" stroke="currentColor" stroke-linecap="round"/>`,"file-tree":`<path d="M18 18V5H9.5L7.5 2H2L2 18H5M18 18H5M18 18V8.5H5V18" stroke="currentColor" stroke-linecap="square"/>`,"file-tree-active":`<path d="M2 2L2 18H5L6.5 8.5H18V5H9.5L7.5 2H2Z" fill="currentColor" fill-opacity="0.1"/>
5
+ <path d="M5 18H18L19.5 8.5H18M5 18H2L2 2H7.5L9.5 5H18V8.5M5 18L6.5 8.5H18" stroke="currentColor" stroke-linecap="square"/>`,"magnifying-glass":`<path d="M13 13L10.6418 10.6418M11.9552 7.47761C11.9552 9.95053 9.95053 11.9552 7.47761 11.9552C5.0047 11.9552 3 9.95053 3 7.47761C3 5.0047 5.0047 3 7.47761 3C9.95053 3 11.9552 5.0047 11.9552 7.47761Z" stroke="currentColor" stroke-linecap="square" vector-effect="non-scaling-stroke"/>`,"plus-small":`<path d="M9.99984 5.41699V10.0003M9.99984 10.0003V14.5837M9.99984 10.0003H5.4165M9.99984 10.0003H14.5832" stroke="currentColor" stroke-linecap="square"/>`,plus:`<path d="M9.9987 2.20703V9.9987M9.9987 9.9987V17.7904M9.9987 9.9987H2.20703M9.9987 9.9987H17.7904" stroke="currentColor" stroke-linecap="square"/>`,"new-session":`<path d="M12 2H2V18H18V8M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" stroke="currentColor"/>`,"new-session-active":`<path d="M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" fill="currentColor" fill-opacity="0.1"/>
6
+ <path d="M12 2H2V18H18V8M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" stroke="currentColor"/>`,"pencil-line":`<path d="M9.58301 17.9166H17.9163M17.9163 5.83325L14.1663 2.08325L2.08301 14.1666V17.9166H5.83301L17.9163 5.83325Z" stroke="currentColor" stroke-linecap="square"/>`,mcp:`<g><path d="M0.972656 9.37176L9.5214 1.60019C10.7018 0.527151 12.6155 0.527151 13.7957 1.60019C14.9761 2.67321 14.9761 4.41295 13.7957 5.48599L7.3397 11.3552" stroke="currentColor" stroke-linecap="round"/><path d="M7.42871 11.2747L13.7957 5.48643C14.9761 4.41338 16.8898 4.41338 18.0702 5.48643L18.1147 5.52688C19.2951 6.59993 19.2951 8.33966 18.1147 9.4127L10.3831 16.4414C9.98966 16.7991 9.98966 17.379 10.3831 17.7366L11.9707 19.1799" stroke="currentColor" stroke-linecap="round"/><path d="M11.6587 3.54346L5.33619 9.29119C4.15584 10.3642 4.15584 12.1039 5.33619 13.177C6.51649 14.25 8.43019 14.25 9.61054 13.177L15.9331 7.42923" stroke="currentColor" stroke-linecap="round"/></g>`,glasses:`<path d="M0.416626 7.91667H1.66663M19.5833 7.91667H18.3333M11.866 7.57987C11.3165 7.26398 10.6793 7.08333 9.99996 7.08333C9.32061 7.08333 8.68344 7.26398 8.13389 7.57987M8.74996 10C8.74996 12.0711 7.07103 13.75 4.99996 13.75C2.92889 13.75 1.24996 12.0711 1.24996 10C1.24996 7.92893 2.92889 6.25 4.99996 6.25C7.07103 6.25 8.74996 7.92893 8.74996 10ZM18.75 10C18.75 12.0711 17.071 13.75 15 13.75C12.9289 13.75 11.25 12.0711 11.25 10C11.25 7.92893 12.9289 6.25 15 6.25C17.071 6.25 18.75 7.92893 18.75 10Z" stroke="currentColor" stroke-linecap="square"/>`,"magnifying-glass-menu":`<path d="M2.08325 10.0002H4.58325M2.08325 5.41683H5.41659M2.08325 14.5835H5.41659M16.4583 13.9585L18.7499 16.2502M17.9166 10.0002C17.9166 12.9917 15.4915 15.4168 12.4999 15.4168C9.50838 15.4168 7.08325 12.9917 7.08325 10.0002C7.08325 7.00862 9.50838 4.5835 12.4999 4.5835C15.4915 4.5835 17.9166 7.00862 17.9166 10.0002Z" stroke="currentColor" stroke-linecap="square"/>`,"window-cursor":`<path d="M17.5 10.4167V3.75H2.5V17.0833H10.4166M17.9166 13.5897L11.6666 11.6667L13.5897 17.9167L15.032 15.0321L17.9166 13.5897Z" stroke="currentColor" stroke-linecap="square"/><path d="M5.41675 6.125C5.71576 6.12518 5.95777 6.36795 5.95777 6.66699C5.95759 6.96589 5.71565 7.20783 5.41675 7.20801C5.11771 7.20801 4.87494 6.966 4.87476 6.66699C4.87476 6.36784 5.1176 6.125 5.41675 6.125ZM8.33276 6.125C8.63191 6.125 8.87476 6.36784 8.87476 6.66699C8.87458 6.966 8.63181 7.20801 8.33276 7.20801C8.03386 7.20783 7.79192 6.96589 7.79175 6.66699C7.79175 6.36795 8.03376 6.12518 8.33276 6.125ZM11.2498 6.125C11.5489 6.125 11.7917 6.36784 11.7917 6.66699C11.7916 6.966 11.5488 7.20801 11.2498 7.20801C10.9507 7.20801 10.7079 6.966 10.7078 6.66699C10.7078 6.36784 10.9506 6.125 11.2498 6.125Z" fill="currentColor" stroke="currentColor" stroke-width="0.25" stroke-linecap="square"/>`,task:`<path d="M9.99992 2.0835V17.9168M7.08325 3.75016H2.08325V16.2502H7.08325M12.9166 16.2502H17.9166V3.75016H12.9166" stroke="currentColor" stroke-linecap="square"/>`,subagent:`<path d="M4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5V11.5C12 11.7761 11.7761 12 11.5 12H4.5C4.22386 12 4 11.7761 4 11.5V4.5Z" fill="currentColor"/><path d="M14.5 1C14.7761 1 15 1.22386 15 1.5V14.5C15 14.7761 14.7761 15 14.5 15H1.5C1.22386 15 1 14.7761 1 14.5V1.5C1 1.22386 1.22386 1 1.5 1H14.5ZM2 14H14V2H2V14Z" fill="currentColor"/>`,stop:`<rect x="5" y="5" width="10" height="10" fill="currentColor"/>`,status:`<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,"status-active":`<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/>
7
+ <path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/>
8
+ <path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,sidebar:`<path d="M7.86667 2H5.2H2V18H5.2H7.86667M7.86667 2H18V18H7.86667M7.86667 2V18" stroke="currentColor"/>`,"sidebar-active":`<path d="M2 2V18H5.2H7.86667V2H5.2H2Z" fill="currentColor" fill-opacity="0.1"/>
9
+ <path d="M7.86667 2H5.2H2V18H5.2H7.86667M7.86667 2H18V18H7.86667M7.86667 2V18" stroke="currentColor"/>`,"layout-left":`<path d="M2.91675 2.91699L2.91675 2.41699L2.41675 2.41699L2.41675 2.91699L2.91675 2.91699ZM17.0834 2.91699L17.5834 2.91699L17.5834 2.41699L17.0834 2.41699L17.0834 2.91699ZM17.0834 17.0837L17.0834 17.5837L17.5834 17.5837L17.5834 17.0837L17.0834 17.0837ZM2.91675 17.0837L2.41675 17.0837L2.41675 17.5837L2.91675 17.5837L2.91675 17.0837ZM7.41674 17.0837L7.41674 17.5837L8.41674 17.5837L8.41674 17.0837L7.91674 17.0837L7.41674 17.0837ZM8.41674 2.91699L8.41674 2.41699L7.41674 2.41699L7.41674 2.91699L7.91674 2.91699L8.41674 2.91699ZM2.91675 2.91699L2.91675 3.41699L17.0834 3.41699L17.0834 2.91699L17.0834 2.41699L2.91675 2.41699L2.91675 2.91699ZM17.0834 2.91699L16.5834 2.91699L16.5834 17.0837L17.0834 17.0837L17.5834 17.0837L17.5834 2.91699L17.0834 2.91699ZM17.0834 17.0837L17.0834 16.5837L2.91675 16.5837L2.91675 17.0837L2.91675 17.5837L17.0834 17.5837L17.0834 17.0837ZM2.91675 17.0837L3.41675 17.0837L3.41675 2.91699L2.91675 2.91699L2.41675 2.91699L2.41675 17.0837L2.91675 17.0837ZM7.91674 17.0837L8.41674 17.0837L8.41674 2.91699L7.91674 2.91699L7.41674 2.91699L7.41674 17.0837L7.91674 17.0837Z" fill="currentColor"/>`,"layout-left-partial":`<path d="M2.91732 2.91602L7.91732 2.91602L7.91732 17.0827H2.91732L2.91732 2.91602Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M2.91732 2.91602L7.91732 2.91602M17.084 2.91602L17.084 17.0827M17.084 2.91602L7.91732 2.91602M17.084 17.0827L2.91732 17.0827M17.084 17.0827L7.91732 17.0827M2.91732 17.0827H7.91732M7.91732 17.0827L7.91732 2.91602" stroke="currentColor" stroke-linecap="square"/>`,"layout-left-full":`<path d="M2.91732 2.91602L7.91732 2.91602L7.91732 17.0827H2.91732L2.91732 2.91602Z" fill="currentColor"/><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M2.91732 2.91602L7.91732 2.91602M17.084 2.91602L17.084 17.0827M17.084 2.91602L7.91732 2.91602M17.084 17.0827L2.91732 17.0827M17.084 17.0827L7.91732 17.0827M2.91732 17.0827H7.91732M7.91732 17.0827L7.91732 2.91602" stroke="currentColor" stroke-linecap="square"/>`,"layout-right":`<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,"layout-right-partial":`<path d="M17.082 17.0807L6.9987 17.0807V2.91406H17.082V17.0807Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor" />`,"layout-right-full":`<path d="M17.082 17.0807L6.9987 17.0807V2.91406H17.082V17.0807Z" fill="currentColor" /><path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor" />`,"square-arrow-top-right":`<path d="M7.91675 2.9165H2.91675V17.0832H17.0834V12.0832M12.0834 2.9165H17.0834V7.9165M9.58342 10.4165L16.6667 3.33317" stroke="currentColor" stroke-linecap="square"/>`,"open-file":`<path d="M7.91602 2.91406H2.91602V17.0807H17.0827V12.0807M12.0827 2.91406H17.0827V7.91406M9.58268 10.4141L16.666 3.33073" stroke="currentColor" stroke-linecap="square"/>`,"speech-bubble":`<path d="M18.3334 10.0003C18.3334 5.57324 15.0927 2.91699 10.0001 2.91699C4.90749 2.91699 1.66675 5.57324 1.66675 10.0003C1.66675 11.1497 2.45578 13.1016 2.5771 13.3949C2.5878 13.4207 2.59839 13.4444 2.60802 13.4706C2.69194 13.6996 3.04282 14.9364 1.66675 16.7684C3.5186 17.6538 5.48526 16.1982 5.48526 16.1982C6.84592 16.9202 8.46491 17.0837 10.0001 17.0837C15.0927 17.0837 18.3334 14.4274 18.3334 10.0003Z" stroke="currentColor" stroke-linecap="square"/>`,comment:`<path d="M16.25 3.75H3.75V16.25L6.875 14.4643H16.25V3.75Z" stroke="currentColor" stroke-linecap="square"/>`,"folder-add-left":`<path d="M2.08333 9.58268V2.91602H8.33333L10 5.41602H17.9167V16.2493H8.75M3.75 12.0827V14.5827M3.75 14.5827V17.0827M3.75 14.5827H1.25M3.75 14.5827H6.25" stroke="currentColor" stroke-linecap="square"/>`,github:`<path d="M10.0001 1.62549C14.6042 1.62549 18.3334 5.35465 18.3334 9.95882C18.333 11.7049 17.785 13.4068 16.7666 14.8251C15.7482 16.2434 14.3107 17.3066 12.6563 17.8651C12.2397 17.9484 12.0834 17.688 12.0834 17.4692C12.0834 17.188 12.0938 16.2922 12.0938 15.1776C12.0938 14.3963 11.8334 13.8963 11.5313 13.6359C13.3855 13.4276 15.3334 12.7192 15.3334 9.52132C15.3334 8.60465 15.0105 7.86507 14.4792 7.28174C14.5626 7.0734 14.8542 6.21924 14.3959 5.0734C14.3959 5.0734 13.698 4.84424 12.1042 5.92757C11.4376 5.74007 10.7292 5.64632 10.0209 5.64632C9.31258 5.64632 8.60425 5.74007 7.93758 5.92757C6.34383 4.85465 5.64592 5.0734 5.64592 5.0734C5.18758 6.21924 5.47925 7.0734 5.56258 7.28174C5.03133 7.86507 4.70842 8.61507 4.70842 9.52132C4.70842 12.7088 6.64592 13.4276 8.50008 13.6359C8.2605 13.8442 8.04175 14.2088 7.96883 14.7505C7.48967 14.9692 6.29175 15.3234 5.54175 14.063C5.3855 13.813 4.91675 13.1984 4.2605 13.2088C3.56258 13.2192 3.97925 13.6047 4.27092 13.7609C4.62508 13.9588 5.03133 14.6984 5.12508 14.938C5.29175 15.4067 5.83342 16.3026 7.92717 15.9172C7.92717 16.6151 7.93758 17.2713 7.93758 17.4692C7.93758 17.688 7.78133 17.938 7.36467 17.8651C5.70491 17.3126 4.26126 16.2515 3.23851 14.8324C2.21576 13.4133 1.66583 11.7081 1.66675 9.95882C1.66675 5.35465 5.39592 1.62549 10.0001 1.62549Z" fill="currentColor"/>`,discord:`<path d="M16.0742 4.45014C14.9244 3.92097 13.7106 3.54556 12.4638 3.3335C12.2932 3.64011 12.1388 3.95557 12.0013 4.27856C10.6732 4.07738 9.32261 4.07738 7.99451 4.27856C7.85694 3.9556 7.70257 3.64014 7.53203 3.3335C6.28441 3.54735 5.06981 3.92365 3.91889 4.45291C1.63401 7.85128 1.01462 11.1652 1.32431 14.4322C2.6624 15.426 4.16009 16.1819 5.7523 16.6668C6.11082 16.1821 6.42806 15.6678 6.70066 15.1295C6.18289 14.9351 5.68315 14.6953 5.20723 14.4128C5.33249 14.3215 5.45499 14.2274 5.57336 14.136C6.95819 14.7907 8.46965 15.1302 9.99997 15.1302C11.5303 15.1302 13.0418 14.7907 14.4266 14.136C14.5463 14.2343 14.6688 14.3284 14.7927 14.4128C14.3159 14.6957 13.8152 14.9361 13.2965 15.1309C13.5688 15.669 13.8861 16.1828 14.2449 16.6668C15.8385 16.1838 17.3373 15.4283 18.6756 14.4335C19.039 10.645 18.0549 7.36145 16.0742 4.45014ZM7.09294 12.423C6.22992 12.423 5.51693 11.6357 5.51693 10.6671C5.51693 9.69852 6.20514 8.90427 7.09019 8.90427C7.97524 8.90427 8.68272 9.69852 8.66758 10.6671C8.65244 11.6357 7.97248 12.423 7.09294 12.423ZM12.907 12.423C12.0426 12.423 11.3324 11.6357 11.3324 10.6671C11.3324 9.69852 12.0206 8.90427 12.907 8.90427C13.7934 8.90427 14.4954 9.69852 14.4803 10.6671C14.4651 11.6357 13.7865 12.423 12.907 12.423Z" fill="currentColor"/>`,"layout-bottom":`<path d="M2.91699 17.0832L2.41699 17.0832L2.41699 17.5832L2.91699 17.5832L2.91699 17.0832ZM2.91699 2.91653L2.91699 2.41653L2.41699 2.41653L2.41699 2.91653L2.91699 2.91653ZM17.0837 2.91653L17.5837 2.91653L17.5837 2.41653L17.0837 2.41653L17.0837 2.91653ZM17.0837 17.0832L17.5837 17.0832L17.5837 17.5832L17.0837 17.5832L17.0837 17.0832ZM17.0837 12.5827L17.5837 12.5827L17.5837 11.5827L17.0837 11.5827L17.0837 12.0827L17.0837 12.5827ZM2.91699 11.5827L2.41699 11.5827L2.41699 12.5827L2.91699 12.5827L2.91699 12.0827L2.91699 11.5827ZM2.91699 17.0832L3.41699 17.0832L3.41699 2.91653L2.91699 2.91653L2.41699 2.91653L2.41699 17.0832L2.91699 17.0832ZM2.91699 2.91653L2.91699 3.41653L17.0837 3.41653L17.0837 2.91653L17.0837 2.41653L2.91699 2.41653L2.91699 2.91653ZM17.0837 2.91653L16.5837 2.91653L16.5837 17.0832L17.0837 17.0832L17.5837 17.0832L17.5837 2.91653L17.0837 2.91653ZM17.0837 17.0832L17.0837 16.5832L2.91699 16.5832L2.91699 17.0832L2.91699 17.5832L17.0837 17.5832L17.0837 17.0832ZM17.0837 12.0827L17.0837 11.5827L2.91699 11.5827L2.91699 12.0827L2.91699 12.5827L17.0837 12.5827L17.0837 12.0827Z" fill="currentColor"/>`,"layout-bottom-partial":`<path d="M2.91732 12.0827L17.084 12.0827L17.084 17.0827H2.91732L2.91732 12.0827Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M17.084 2.91602L17.084 17.0827M17.084 17.0827L2.91732 17.0827M2.91732 12.0827L17.084 12.0827" stroke="currentColor" stroke-linecap="square"/>`,"layout-bottom-full":`<path d="M2.91732 12.0827L17.084 12.0827L17.084 17.0827H2.91732L2.91732 12.0827Z" fill="currentColor"/><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M17.084 2.91602L17.084 17.0827M17.084 17.0827L2.91732 17.0827M2.91732 12.0827L17.084 12.0827" stroke="currentColor" stroke-linecap="square"/>`,"dot-grid":`<path d="M2.08398 9.16602H3.75065V10.8327H2.08398V9.16602Z" fill="currentColor"/><path d="M10.834 9.16602H9.16732V10.8327H10.834V9.16602Z" fill="currentColor"/><path d="M16.2507 9.16602H17.9173V10.8327H16.2507V9.16602Z" fill="currentColor"/><path d="M2.08398 9.16602H3.75065V10.8327H2.08398V9.16602Z" stroke="currentColor"/><path d="M10.834 9.16602H9.16732V10.8327H10.834V9.16602Z" stroke="currentColor"/><path d="M16.2507 9.16602H17.9173V10.8327H16.2507V9.16602Z" stroke="currentColor"/>`,"circle-check":`<path d="M12.4987 7.91732L8.7487 12.5007L7.08203 10.834M17.9154 10.0007C17.9154 14.3729 14.371 17.9173 9.9987 17.9173C5.62644 17.9173 2.08203 14.3729 2.08203 10.0007C2.08203 5.6284 5.62644 2.08398 9.9987 2.08398C14.371 2.08398 17.9154 5.6284 17.9154 10.0007Z" stroke="currentColor" stroke-linecap="square"/>`,copy:`<path d="M6.2513 6.24935V2.91602H17.0846V13.7493H13.7513M13.7513 6.24935V17.0827H2.91797V6.24935H13.7513Z" stroke="currentColor" stroke-linecap="round"/>`,check:`<path d="M5 11.9657L8.37838 14.7529L15 5.83398" stroke="currentColor" stroke-linecap="square"/>`,photo:`<path d="M16.6665 16.6666L11.6665 11.6666L9.99984 13.3333L6.6665 9.99996L3.08317 13.5833M2.9165 2.91663H17.0832V17.0833H2.9165V2.91663ZM13.3332 7.49996C13.3332 8.30537 12.6803 8.95829 11.8748 8.95829C11.0694 8.95829 10.4165 8.30537 10.4165 7.49996C10.4165 6.69454 11.0694 6.04163 11.8748 6.04163C12.6803 6.04163 13.3332 6.69454 13.3332 7.49996Z" stroke="currentColor" stroke-linecap="square"/>`,share:`<path d="M10.0013 12.0846L10.0013 3.33464M13.7513 6.66797L10.0013 2.91797L6.2513 6.66797M17.0846 10.418V17.0846H2.91797V10.418" stroke="currentColor" stroke-linecap="square"/>`,shield:`<path d="M7.49935 9.3737L9.16602 11.0404L12.4994 7.70703M9.99935 2.08203L17.0827 4.3737V9.92565C17.0827 14.0694 13.3327 16.2487 9.99935 18.047C6.66602 16.2487 2.91602 14.0694 2.91602 9.92565V4.3737L9.99935 2.08203Z" stroke="currentColor" stroke-linecap="square"/>`,download:`<path d="M13.9583 10.6257L10 14.584L6.04167 10.6257M10 2.08398V13.959M16.25 17.9173H3.75" stroke="currentColor" stroke-linecap="square"/>`,menu:`<path d="M2.5 5H17.5M2.5 10H17.5M2.5 15H17.5" stroke="currentColor" stroke-linecap="square"/>`,server:`<rect x="3.35547" y="1.92969" width="13.2857" height="16.1429" stroke="currentColor"/><rect x="3.35547" y="11.9297" width="13.2857" height="6.14286" stroke="currentColor"/><rect x="12.8555" y="14.2852" width="1.42857" height="1.42857" fill="currentColor"/><rect x="10" y="14.2852" width="1.42857" height="1.42857" fill="currentColor"/>`,branch:`<path d="M14.2036 7.19987L14.2079 6.69989L13.2079 6.69132L13.2036 7.1913L13.7036 7.19559L14.2036 7.19987ZM8.14804 5.09032H7.64804C7.64804 5.75797 7.06861 6.34471 6.29619 6.34471V6.84471V7.34471C7.56926 7.34471 8.64804 6.36051 8.64804 5.09032H8.14804ZM6.29619 6.84471V6.34471C5.52376 6.34471 4.94434 5.75797 4.94434 5.09032H4.44434H3.94434C3.94434 6.36051 5.02311 7.34471 6.29619 7.34471V6.84471ZM4.44434 5.09032H4.94434C4.94434 4.42267 5.52376 3.83594 6.29619 3.83594V3.33594V2.83594C5.02311 2.83594 3.94434 3.82013 3.94434 5.09032H4.44434ZM6.29619 3.33594V3.83594C7.06861 3.83594 7.64804 4.42267 7.64804 5.09032H8.14804H8.64804C8.64804 3.82013 7.56926 2.83594 6.29619 2.83594V3.33594ZM8.14804 14.9149H7.64804C7.64804 15.5825 7.06861 16.1693 6.29619 16.1693V16.6693V17.1693C7.56926 17.1693 8.64804 16.1851 8.64804 14.9149H8.14804ZM6.29619 16.6693V16.1693C5.52376 16.1693 4.94434 15.5825 4.94434 14.9149H4.44434H3.94434C3.94434 16.1851 5.02311 17.1693 6.29619 17.1693V16.6693ZM4.44434 14.9149H4.94434C4.94434 14.2472 5.52376 13.6605 6.29619 13.6605V13.1605V12.6605C5.02311 12.6605 3.94434 13.6447 3.94434 14.9149H4.44434ZM6.29619 13.1605V13.6605C7.06861 13.6605 7.64804 14.2472 7.64804 14.9149H8.14804H8.64804C8.64804 13.6447 7.56926 12.6605 6.29619 12.6605V13.1605ZM15.5554 5.09032H15.0554C15.0554 5.75797 14.476 6.34471 13.7036 6.34471V6.84471V7.34471C14.9767 7.34471 16.0554 6.36051 16.0554 5.09032H15.5554ZM13.7036 6.84471V6.34471C12.9312 6.34471 12.3517 5.75797 12.3517 5.09032H11.8517H11.3517C11.3517 6.36051 12.4305 7.34471 13.7036 7.34471V6.84471ZM11.8517 5.09032H12.3517C12.3517 4.42267 12.9312 3.83594 13.7036 3.83594V3.33594V2.83594C12.4305 2.83594 11.3517 3.82013 11.3517 5.09032H11.8517ZM13.7036 3.33594V3.83594C14.476 3.83594 15.0554 4.42267 15.0554 5.09032H15.5554H16.0554C16.0554 3.82013 14.9767 2.83594 13.7036 2.83594V3.33594ZM13.7036 7.19559L13.2036 7.1913L13.1544 12.9277L13.6544 12.932L14.1544 12.9363L14.2036 7.19987L13.7036 7.19559ZM6.29619 6.84471H5.79619V13.1605H6.29619H6.79619V6.84471H6.29619ZM11.6545 14.9149V14.4149H8.14804V14.9149V15.4149H11.6545V14.9149ZM13.6544 12.932L13.1544 12.9277C13.1474 13.7511 12.4779 14.4149 11.6545 14.4149V14.9149V15.4149C13.0269 15.4149 14.1426 14.3086 14.1544 12.9363L13.6544 12.932Z" fill="currentColor"/>`,edit:`<path d="M17.0832 17.0807V17.5807H17.5832V17.0807H17.0832ZM2.9165 17.0807H2.4165V17.5807H2.9165V17.0807ZM2.9165 2.91406V2.41406H2.4165V2.91406H2.9165ZM9.58317 3.41406H10.0832V2.41406H9.58317V2.91406V3.41406ZM17.5832 10.4141V9.91406H16.5832V10.4141H17.0832H17.5832ZM6.24984 11.2474L5.89628 10.8938L5.74984 11.0403V11.2474H6.24984ZM6.24984 13.7474H5.74984V14.2474H6.24984V13.7474ZM8.74984 13.7474V14.2474H8.95694L9.10339 14.101L8.74984 13.7474ZM15.2082 2.28906L15.5617 1.93551L15.2082 1.58196L14.8546 1.93551L15.2082 2.28906ZM17.7082 4.78906L18.0617 5.14262L18.4153 4.78906L18.0617 4.43551L17.7082 4.78906ZM17.0832 17.0807V16.5807H2.9165V17.0807V17.5807H17.0832V17.0807ZM2.9165 17.0807H3.4165V2.91406H2.9165H2.4165V17.0807H2.9165ZM2.9165 2.91406V3.41406H9.58317V2.91406V2.41406H2.9165V2.91406ZM17.0832 10.4141H16.5832V17.0807H17.0832H17.5832V10.4141H17.0832ZM6.24984 11.2474H5.74984V13.7474H6.24984H6.74984V11.2474H6.24984ZM6.24984 13.7474V14.2474H8.74984V13.7474V13.2474H6.24984V13.7474ZM6.24984 11.2474L6.60339 11.6009L15.5617 2.64262L15.2082 2.28906L14.8546 1.93551L5.89628 10.8938L6.24984 11.2474ZM15.2082 2.28906L14.8546 2.64262L17.3546 5.14262L17.7082 4.78906L18.0617 4.43551L15.5617 1.93551L15.2082 2.28906ZM17.7082 4.78906L17.3546 4.43551L8.39628 13.3938L8.74984 13.7474L9.10339 14.101L18.0617 5.14262L17.7082 4.78906Z" fill="currentColor"/>`,help:`<path d="M7.91683 7.91927V6.2526H12.0835V8.7526L10.0002 10.0026V12.0859M10.0002 13.7526V13.7609M17.9168 10.0026C17.9168 14.3749 14.3724 17.9193 10.0002 17.9193C5.62791 17.9193 2.0835 14.3749 2.0835 10.0026C2.0835 5.63035 5.62791 2.08594 10.0002 2.08594C14.3724 2.08594 17.9168 5.63035 17.9168 10.0026Z" stroke="currentColor" stroke-linecap="square"/>`,"settings-gear":`<path d="M7.62516 4.46094L5.05225 3.86719L3.86475 5.05469L4.4585 7.6276L2.0835 9.21094V10.7943L4.4585 12.3776L3.86475 14.9505L5.05225 16.138L7.62516 15.5443L9.2085 17.9193H10.7918L12.3752 15.5443L14.9481 16.138L16.1356 14.9505L15.5418 12.3776L17.9168 10.7943V9.21094L15.5418 7.6276L16.1356 5.05469L14.9481 3.86719L12.3752 4.46094L10.7918 2.08594H9.2085L7.62516 4.46094Z" stroke="currentColor"/><path d="M12.5002 10.0026C12.5002 11.3833 11.3809 12.5026 10.0002 12.5026C8.61945 12.5026 7.50016 11.3833 7.50016 10.0026C7.50016 8.62189 8.61945 7.5026 10.0002 7.5026C11.3809 7.5026 12.5002 8.62189 12.5002 10.0026Z" stroke="currentColor"/>`,dash:`<rect x="5" y="9.5" width="10" height="1" fill="currentColor"/>`,"cloud-upload":`<path d="M12.0833 16.25H15C17.0711 16.25 18.75 14.5711 18.75 12.5C18.75 10.5649 17.2843 8.97217 15.4025 8.77133C15.2 6.13103 12.8586 4.08333 10 4.08333C7.71532 4.08333 5.76101 5.49781 4.96501 7.49881C2.84892 7.90461 1.25 9.76559 1.25 11.6667C1.25 13.9813 3.30203 16.25 5.83333 16.25H7.91667M10 16.25V10.4167M12.0833 11.875L10 9.79167L7.91667 11.875" stroke="currentColor" stroke-linecap="square"/>`,trash:`<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`,sliders:`<path d="M11.7778 4.66797H14.4444M11.7778 4.66797C11.7778 5.77254 10.8823 6.66797 9.77776 6.66797C8.67319 6.66797 7.77776 5.77254 7.77776 4.66797M11.7778 4.66797C11.7778 3.5634 10.8823 2.66797 9.77776 2.66797C8.67319 2.66797 7.77776 3.5634 7.77776 4.66797M1.55554 4.66797H7.77776M4.22221 11.3346H1.55554M4.22221 11.3346C4.22221 12.4392 5.11764 13.3346 6.22221 13.3346C7.32678 13.3346 8.22221 12.4392 8.22221 11.3346M4.22221 11.3346C4.22221 10.2301 5.11764 9.33464 6.22221 9.33464C7.32678 9.33464 8.22221 10.2301 8.22221 11.3346M14.4444 11.3346H8.22221" stroke="currentColor"/>`,keyboard:`<path d="M5.125 7.375V4.375H14.875V2.875M8.3125 13.9375H11.6875M8.125 13.9375H11.875M2.125 7.375H17.875V17.125H2.125V7.375ZM5.5 10.375H5.125V10.75H5.5V10.375ZM8.5 10.375H8.125V10.75H8.5V10.375ZM11.875 10.375H11.5V10.75H11.875V10.375ZM14.875 10.375H14.5V10.75H14.875V10.375ZM14.875 13.75H14.5V14.125H14.875V13.75ZM5.5 13.75H5.125V14.125H5.5V13.75Z" stroke="currentColor" stroke-linecap="square"/>`,selector:`<path d="M6.66626 12.5033L9.99959 15.8366L13.3329 12.5033M6.66626 7.50326L9.99959 4.16992L13.3329 7.50326" stroke="currentColor" stroke-linecap="square"/>`,"arrow-down-to-line":`<path d="M15.2083 11.6667L10 16.875L4.79167 11.6667M10 16.25V3.125" stroke="currentColor" stroke-width="1.25" stroke-linecap="square"/>`,warning:`<path d="M10 7.91667V11.6667M10 13.7417V13.75M10 2.5L1.875 16.25H18.125L10 2.5Z" stroke="currentColor" stroke-linecap="square"/>`,reset:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,link:`<path d="M2.08334 12.0833L1.72979 11.7298L1.37624 12.0833L1.72979 12.4369L2.08334 12.0833ZM7.91668 17.9167L7.56312 18.2702L7.91668 18.6238L8.27023 18.2702L7.91668 17.9167ZM17.9167 7.91666L18.2702 8.27022L18.6238 7.91666L18.2702 7.56311L17.9167 7.91666ZM12.0833 2.08333L12.4369 1.72977L12.0833 1.37622L11.7298 1.72977L12.0833 2.08333ZM8.39646 5.06311L8.0429 5.41666L8.75001 6.12377L9.10356 5.77021L8.75001 5.41666L8.39646 5.06311ZM5.77023 9.10355L6.12378 8.74999L5.41668 8.04289L5.06312 8.39644L5.41668 8.74999L5.77023 9.10355ZM14.2298 10.8964L13.8762 11.25L14.5833 11.9571L14.9369 11.6035L14.5833 11.25L14.2298 10.8964ZM11.6036 14.9369L11.9571 14.5833L11.25 13.8762L10.8965 14.2298L11.25 14.5833L11.6036 14.9369ZM7.14646 12.1464L6.7929 12.5L7.50001 13.2071L7.85356 12.8535L7.50001 12.5L7.14646 12.1464ZM12.8536 7.85355L13.2071 7.49999L12.5 6.79289L12.1465 7.14644L12.5 7.49999L12.8536 7.85355ZM2.08334 12.0833L1.72979 12.4369L7.56312 18.2702L7.91668 17.9167L8.27023 17.5631L2.4369 11.7298L2.08334 12.0833ZM17.9167 7.91666L18.2702 7.56311L12.4369 1.72977L12.0833 2.08333L11.7298 2.43688L17.5631 8.27022L17.9167 7.91666ZM12.0833 2.08333L11.7298 1.72977L8.39646 5.06311L8.75001 5.41666L9.10356 5.77021L12.4369 2.43688L12.0833 2.08333ZM5.41668 8.74999L5.06312 8.39644L1.72979 11.7298L2.08334 12.0833L2.4369 12.4369L5.77023 9.10355L5.41668 8.74999ZM14.5833 11.25L14.9369 11.6035L18.2702 8.27022L17.9167 7.91666L17.5631 7.56311L14.2298 10.8964L14.5833 11.25ZM7.91668 17.9167L8.27023 18.2702L11.6036 14.9369L11.25 14.5833L10.8965 14.2298L7.56312 17.5631L7.91668 17.9167ZM7.50001 12.5L7.85356 12.8535L12.8536 7.85355L12.5 7.49999L12.1465 7.14644L7.14646 12.1464L7.50001 12.5Z" fill="currentColor"/>`,providers:`<path d="M5.11115 3.33252H10.8889M5.11115 3.33252L3.33337 3.33254V12.6658H5.11115M5.11115 3.33252L5.11108 1.55469M10.8889 3.33252L12.6667 3.33252V12.6658H10.8889M10.8889 3.33252L10.8889 1.55469M10.8889 12.6658H5.11115M10.8889 12.6658L10.8889 14.4435M5.11115 12.6658L5.11108 14.4435M8 1.55469V3.33247M14.4444 7.99915H12.6666M14.4444 5.11023H12.6666M14.4444 10.8881H12.6666M8 14.4435V12.6658M1.55554 7.99915H3.33332M1.55554 10.8881H3.33332M1.55554 5.11023H3.33332M6 9.99915V5.99915H10V9.99915H6Z" stroke="currentColor"/>`,models:`<path fill-rule="evenodd" clip-rule="evenodd" d="M14 8C9.83336 8 8 9.83336 8 14C8 9.83336 6.16666 8 2 8C6.16666 8 8 6.16666 8 2C8 6.16666 9.83336 8 14 8Z" stroke="currentColor"/>`,appearance:`<path d="M2.00012 13.9997L13.9998 2" stroke="currentColor" stroke-linecap="square"/><path d="M2.00012 8.35278L8.3529 2" stroke="currentColor" stroke-linecap="square"/><path d="M2.00012 2.70586L2.70599 2" stroke="currentColor" stroke-linecap="square"/><path d="M7.64722 14.0012L14 7.64844" stroke="currentColor" stroke-linecap="square"/><path d="M13.2935 13.9988L13.9993 13.293" stroke="currentColor" stroke-linecap="square"/>`,notifications:`<path d="M14.8889 6.77778V9.11112C14.8889 10.093 14.8889 10.8889 14.8889 10.8889H11.3334M5.55558 10.8889H2C2 10.8889 2.00001 10.093 2.00001 9.11112V3.77778C2.00001 2.79594 2.00009 2 2.00009 2H9.44531M5.55558 10.8889V13.1111H8.44447H11.3334V10.8889M5.55558 10.8889H11.3334" stroke="currentColor"/><path d="M13 5C14.1046 5 15 4.10457 15 3C15 1.89543 14.1046 1 13 1C11.8954 1 11 1.89543 11 3C11 4.10457 11.8954 5 13 5Z" stroke="currentColor"/>`,extensions:`<path d="M8 6.75047V9.25047M10.668 6.75047V9.25047M5.33398 6.75047V9.25047M1.33398 2.44531V13.5553H14.6673V2.44531H1.33398Z" stroke="currentColor" stroke-linecap="square"/>`,cube:`<path d="M10 2.5L16.5 6.25V13.75L10 17.5L3.5 13.75V6.25L10 2.5Z" stroke="currentColor"/><path d="M10 10L16.5 6.25M10 10V17.5M10 10L3.5 6.25" stroke="currentColor"/>`,"post-skill":`<rect x="2.5" y="3.5" width="15" height="13" rx="1.5" stroke="currentColor"/><path d="M5.5 7.5H10.5M5.5 10.5H14.5" stroke="currentColor"/>`,"arrow-undo-down":`<path d="M4.08333 11.0859L1.75 8.7526L4.08333 6.41927M2.33333 8.7526L12.5417 8.7526L12.5417 3.21094L7 3.21094" stroke="currentColor" stroke-width="1" stroke-linecap="square"/>`};function Cn(e){return e===`magnifying-glass`||e===`arrow-undo-down`||e===`subagent`||e===`notifications`||e===`appearance`||e===`extensions`||e===`sliders`||e===`providers`||e===`models`?`0 0 16 16`:`0 0 20 20`}var wn={lock:{viewBox:`0 0 16 16`,body:`<rect x="3.5" y="7" width="9" height="7" rx="1" stroke="currentColor"/><path d="M5 7V5a3 3 0 0 1 6 0v2M8 10v1" stroke="currentColor" stroke-linecap="round"/>`},globe:{viewBox:`0 0 16 16`,body:`<circle cx="8" cy="8" r="6" stroke="currentColor"/><ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor"/><path d="M2 8h12" stroke="currentColor"/>`},"select-element":{viewBox:`0 0 16 16`,body:`<path d="M12.5 6.5V2.5C12.5 1.94772 12.0523 1.5 11.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V11.5C1.5 12.0523 1.94772 12.5 2.5 12.5H6.5" stroke="currentColor" stroke-linecap="round"/><path d="M7.5 7.5L14.5 10.1L11.1 11.1L10.1 14.5L7.5 7.5Z" stroke="currentColor" stroke-linejoin="round"/>`},flask:{viewBox:`0 0 16 16`,body:`<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`},edit:{viewBox:`0 0 16 16`,body:`<path d="M13.5556 8.21529V13.5556H2.44446L2.44446 2.44445H7.78474M6.00002 8.16216V10H7.83786L14 3.83784L12.1622 2L6.00002 8.16216Z" stroke="currentColor"/>`},"folder-add-left":{viewBox:`0 0 16 16`,body:`<path d="M7.5 13.3333H1.5V2H6.83333L8.83333 4H14.8333V6M10.1667 11.3333H15.5M12.8333 8.66667V14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},folder:{viewBox:`0 0 16 16`,body:`<path d="M1.33337 2V13.3333H14.6667V4H8.66671L6.66671 2H1.33337Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},branch:{viewBox:`0 0 16 16`,body:`<path d="M5.118 5.686V10.314M5.118 5.686C5.97 5.686 6.661 4.995 6.661 4.143C6.661 3.291 5.97 2.6 5.118 2.6C4.266 2.6 3.575 3.291 3.575 4.143C3.575 4.995 4.266 5.686 5.118 5.686ZM5.118 10.314C4.266 10.314 3.575 11.005 3.575 11.857C3.575 12.709 4.266 13.4 5.118 13.4C5.97 13.4 6.661 12.709 6.661 11.857M5.118 10.314C5.97 10.314 6.661 11.005 6.661 11.857M10.882 5.686C11.734 5.686 12.425 4.995 12.425 4.143C12.425 3.291 11.734 2.6 10.882 2.6C10.03 2.6 9.339 3.291 9.339 4.143C9.339 4.995 10.03 5.686 10.882 5.686ZM10.882 5.686V9.457C10.882 10.783 9.807 11.857 8.482 11.857H6.661" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`},"branch-out":{viewBox:`0 0 16 16`,body:`<path d="M10.4225 3.35355L12.9024 5.83344L10.4225 8.31333" stroke="currentColor"/><path d="M1 12.2852H4.23042C4.89912 12.2852 5.52359 11.951 5.89452 11.3946L9.00783 6.72462C8.37877 6.16823 10.0032 5.83402 10.6719 5.83402H12.9024" stroke="currentColor"/><path d="M8.5 12.2852H14" stroke="currentColor" stroke-linejoin="round"/>`},"grid-plus":{viewBox:`0 0 16 16`,body:`<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},help:{viewBox:`0 0 16 16`,body:`<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`},info:{viewBox:`0 0 16 16`,body:`<g transform="translate(2 2)"><path d="M12 12H0V0H12V12ZM1 1V11H11V1H1ZM6.5791 4.81641V9.37207H5.5791V5.81641H4.46777V4.81641H6.5791ZM6.85645 2.62891V3.62891H5.30078V2.62891H6.85645Z" fill="currentColor"/></g>`},"circle-exclamation":{viewBox:`0 0 16 16`,body:`<path d="M8.75 11.75H7.25V10.25H8.75V11.75Z" fill="currentColor"/><path d="M8.75 9.25H7.25V4.25H8.75V9.25Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C9.93286 1 11.684 1.7836 12.9502 3.0498C14.2164 4.31601 15 6.06714 15 8C15 11.866 11.866 15 8 15C6.06714 15 4.31601 14.2164 3.0498 12.9502C1.7836 11.684 1 9.93286 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 9.65699 2.67148 11.1559 3.75781 12.2422C4.84415 13.3285 6.34301 14 8 14C11.3137 14 14 11.3137 14 8C14 6.34301 13.3285 4.84415 12.2422 3.75781C11.1559 2.67148 9.65699 2 8 2Z" fill="currentColor"/>`},"circle-xmark":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016ZM6.00001 5.29306L5.2929 6.00016L7.2929 8.00016L5.2929 10.0002L6.00001 10.7073L8.00001 8.70727L10 10.7073L10.7071 10.0002L8.70712 8.00016L10.7071 6.00016L10 5.29306L8.00001 7.29306L6.00001 5.29306Z" fill="currentColor"/>`},"sidebar-right":{viewBox:`0 0 20 20`,body:`<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`},status:{viewBox:`0 0 20 20`,body:`<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`},"status-active":{viewBox:`0 0 20 20`,body:`<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`},"magnifying-glass":{viewBox:`0 0 16 16`,body:`<path d="M14 14L10.3454 10.3454M6.88889 11.7778C9.58889 11.7778 11.7778 9.58889 11.7778 6.88889C11.7778 4.18889 9.58889 2 6.88889 2C4.18889 2 2 4.18889 2 6.88889C2 9.58889 4.18889 11.7778 6.88889 11.7778Z" stroke="currentColor"/>`},menu:{viewBox:`0 0 16 16`,body:`<path d="M2 8H14M2 4.664H14M2 11.336H14" stroke="currentColor"/>`},plus:{viewBox:`0 0 16 16`,body:`<path d="M8 2.88867V13.1109" stroke="currentColor" stroke-linejoin="round"/><path d="M2.88867 8H13.1109" stroke="currentColor" stroke-linejoin="round"/>`},"settings-gear":{viewBox:`0 0 16 16`,body:`<path d="M7.99998 1.3335L14 4.66683V11.3335L7.99998 14.6668L2 11.3335V4.66683L7.99998 1.3335Z" stroke="currentColor"/><path d="M9.99998 8.00016C9.99998 9.10476 9.10458 10.0002 7.99998 10.0002C6.89538 10.0002 5.99998 9.10476 5.99998 8.00016C5.99998 6.89556 6.89538 6.00016 7.99998 6.00016C9.10458 6.00016 9.99998 6.89556 9.99998 8.00016Z" stroke="currentColor"/>`},"chevron-down":{viewBox:`0 0 16 16`,body:`<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`},collapse:{viewBox:`0 0 16 16`,body:`<path d="M8 1V6M11 3L8 6L5 3" stroke="currentColor"/><path d="M8 15V10M11 13L8 10L5 13" stroke="currentColor"/><path d="M4 8H6" stroke="currentColor"/><path d="M7 8H9" stroke="currentColor"/><path d="M10 8H12" stroke="currentColor"/>`},check:{viewBox:`0 0 16 16`,body:`<path d="M3.53613 8.17857L6.39328 11.75L12.4647 4.25" stroke="currentColor"/>`},monitor:{viewBox:`0 0 16 16`,body:`<path d="M4.05559 9.38889H0.500007C0.500007 9.38889 0.500017 8.59298 0.500017 7.61112V2.27778C0.500017 1.29594 0.500102 0.5 0.500102 0.5H13.3889C13.3889 0.5 13.3889 1.29594 13.3889 2.27778V7.61112C13.3889 8.59298 13.3889 9.38889 13.3889 9.38889H9.83336M4.05559 9.38889V11.6111H6.94448H9.83336V9.38889M4.05559 9.38889H9.83336" transform="translate(1.05556 1.94444)" stroke="currentColor"/>`},"workspace-new":{viewBox:`0 0 16 16`,body:`<path d="M2 10.7578V14.0011H5.24324M13.9991 5.24324V2H10.7559M13.9991 10.7578V14.0011H10.7559M2 5.24324V2H5.24324" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M8 4.5V11.5M4.5 8H11.5" stroke="currentColor" stroke-linejoin="round"/>`},"workspace-isolated":{viewBox:`0 0 16 16`,body:`<path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/>`},workspace:{viewBox:`0 0 16 16`,body:`<path d="M2 10.668V14.0013H10.6667M13.9974 10.6667V2H2.66406M13.9974 10.668V14.0013H10.6641M2 10V2H5.33333" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M10.6693 10.6654V5.33203H5.33594V10.6654H10.6693Z" fill="currentColor"/>`},"outline-worktree":{viewBox:`0 0 16 16`,body:`<path d="M12 3.11133L14.3885 5.49977L12 7.88822M14.5 5.49972H10.058L5.13456 11.8139M14.5 11.6606L8.5 11.6606M5.50012 11.6597H1.5" stroke="currentColor"/>`},"outline-trash":{viewBox:`0 0 16 16`,body:`<path d="M2.44434 4.22224H13.5554M5.99994 4.22224V2.44446C5.99994 1.95557 5.99992 1.55557 5.99992 1.55557H9.99989C9.99989 1.55557 9.99994 1.95557 9.99994 2.44446V4.22224M6.55545 7.77779L6.7485 11.7778M9.44437 7.77779L9.2513 11.7778M12.1756 6.88891L11.8666 12.7556C11.8168 13.7068 11.7748 14.4445 11.7748 14.4445H4.22511C4.22511 14.4445 4.18392 13.7067 4.13414 12.7556L3.82509 6.88891" stroke="currentColor"/>`},close:{viewBox:`0 0 20 20`,body:`<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`},"xmark-small":{viewBox:`0 0 16 16`,body:`<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`},"outline-xmark":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99487 5.70186L7.29297 7.99995L4.99487 10.2981L5.70198 11.0052L8.00008 8.70706L10.2982 11.0052L11.0053 10.2981L8.70718 7.99995L11.0053 5.70186L10.2982 4.99475L8.00008 7.29285L5.70198 4.99475L4.99487 5.70186Z" fill="currentColor"/>`},"outline-chevron-down":{viewBox:`0 0 16 16`,body:`<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`},"outline-dots":{viewBox:`0 0 16 16`,body:`<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`},expand:{viewBox:`0 0 16 16`,body:`<path d="M8.25 6.17773V1.17773M11.25 4.17773L8.25 1.17773L5.25 4.17773" stroke="currentColor"/><path d="M8.25 9.17773V14.1777M11.25 11.1777L8.25 14.1777L5.25 11.1777" stroke="currentColor"/><path d="M4.25 7.67773H12.25" stroke="currentColor"/>`},filetree:{viewBox:`0 0 16 16`,body:`<path d="M2.5 1.5V12.2484H6.75M2.5 4.74838H6.75" stroke="currentColor"/><rect x="8.5" y="3.2168" width="6" height="3" fill="none" stroke="currentColor"/><rect x="8.5" y="10.75" width="6" height="3" fill="none" stroke="currentColor"/>`},split:{viewBox:`0 0 16 16`,body:`<path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/><rect x="3" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/><rect x="9" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/>`},unified:{viewBox:`0 0 16 16`,body:`<path d="M3.00001 4.00045L12.9998 4L13 6.99955L3 7L3.00001 4.00045Z" fill="currentColor" fill-opacity="0.5"/><path d="M3.0001 9H13L12.9999 12H3L3.0001 9Z" fill="currentColor" fill-opacity="0.5"/><path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/>`},review:{viewBox:`0 0 20 20`,body:`<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`},"window-analytics":{viewBox:`0 0 16 16`,body:`<path d="M14.5 9.8333V13.5H1.5V2.5H7.1667M9.5 2.5V7.5H14.5V2.5H9.5Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},"graduation-cap":{viewBox:`0 0 16 16`,body:`<path d="M12.3327 7.50065V11.0007L7.99935 13.6673L3.66602 11.0007V7.50065M14.3327 9.83398V6.16732M7.99935 2.33398L1.66602 6.00065L7.99935 10.0007L14.3327 6.00065L7.99935 2.33398Z" stroke="currentColor" stroke-linecap="square"/>`},"code-slash":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0812 2.10803L6.55974 14.0809L5.92016 13.8928L9.44161 1.91992L10.0812 2.10803ZM4.13793 4.97275L1.44666 8.00045L4.13793 11.0281L3.63966 11.471L0.554688 8.00045L3.63966 4.52984L4.13793 4.97275ZM12.3617 4.52984L15.4467 8.00045L12.3617 11.471L11.8634 11.0281L14.5547 8.00045L11.8634 4.97275L12.3617 4.52984Z" fill="currentColor"/>`},trash:{viewBox:`0 0 20 20`,body:`<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`},"outline-sliders":{viewBox:`0 0 16 16`,body:`<path d="M11.7779 4.66675H14.4446M11.7779 4.66675C11.7779 5.77132 10.8825 6.66675 9.77789 6.66675C8.67332 6.66675 7.77789 5.77132 7.77789 4.66675M11.7779 4.66675C11.7779 3.56218 10.8825 2.66675 9.77789 2.66675C8.67332 2.66675 7.77789 3.56218 7.77789 4.66675M1.55566 4.66675H7.77789M4.22233 11.3334H1.55566M4.22233 11.3334C4.22233 12.438 5.11776 13.3334 6.22233 13.3334C7.3269 13.3334 8.22233 12.438 8.22233 11.3334M4.22233 11.3334C4.22233 10.2288 5.11776 9.33341 6.22233 9.33341C7.3269 9.33341 8.22233 10.2288 8.22233 11.3334M14.4446 11.3334H8.22233" stroke="currentColor"/>`},"outline-copy":{viewBox:`0 0 16 16`,body:`<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`},"outline-arrow-left":{viewBox:`0 0 16 16`,body:`<path d="M2.44442 7.99999H13.5555M6.22221 4.22222L2.44442 7.99999L6.22221 11.7778" stroke="currentColor"/>`},"outline-arrow-right":{viewBox:`0 0 16 16`,body:`<path d="M13.5555 7.99999H2.4444M9.77773 11.7778L13.5555 7.99999L9.77773 4.22222" stroke="currentColor"/>`},"outline-arrow-up-right":{viewBox:`0 0 16 16`,body:`<path d="M12.5 3.5L3.5 12.5M12.5 9.62L12.5 3.5L6.38 3.5" stroke="currentColor"/>`},"outline-rotate-clockwise":{viewBox:`0 0 16 16`,body:`<path d="M14.1992 8C14.1992 9.18669 13.8473 10.3467 13.188 11.3334C12.5288 12.3201 11.5917 13.0892 10.4953 13.5433C9.39897 13.9974 8.19257 14.1162 7.02868 13.8847C5.86479 13.6532 4.7957 13.0818 3.95658 12.2426C3.11747 11.4035 2.54602 10.3344 2.31451 9.17054C2.083 8.00666 2.20182 6.80026 2.65594 5.7039C3.11007 4.60754 3.87911 3.67047 4.8658 3.01118C5.85249 2.35189 7.01253 2 8.19922 2C9.87922 2 11.4859 2.66667 12.6926 3.82667L14.1992 5.33333M10.866 5.33333L14.1992 5.33333L14.1993 2" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`},"outline-globe":{viewBox:`0 0 16 16`,body:`<path d="M8.00001 14.4445C9.47277 14.4445 10.6667 11.5592 10.6667 8.00001C10.6667 4.44085 9.47277 1.55557 8.00001 1.55557M8.00001 14.4445C6.52725 14.4445 5.33335 11.5592 5.33335 8.00001C5.33335 4.44085 6.52725 1.55557 8.00001 1.55557M8.00001 14.4445C11.5592 14.4445 14.4444 11.5592 14.4444 8C14.4444 4.44083 11.5592 1.55557 8.00001 1.55557M8.00001 14.4445C4.44085 14.4445 1.55556 11.5592 1.55556 8C1.55556 4.44083 4.44085 1.55557 8.00001 1.55557M1.87203 6.00001H14.128M2.03555 10.4445H13.9644" stroke="currentColor"/>`},"outline-globe-plus":{viewBox:`0 0 16 16`,body:`<path d="M7 12.6667C5.71133 12.6667 4.66667 10.1296 4.66667 7C4.66667 3.87039 5.71133 1.33333 7 1.33333C8.2426 1.33333 9.25833 3.69221 9.32933 6.66667" stroke="currentColor" stroke-miterlimit="10"/><path d="M12.6667 6.66667H1.33333" stroke="currentColor"/><path d="M12.6667 7.72825V7C12.6667 3.87039 10.1296 1.33333 7 1.33333C3.8704 1.33333 1.33333 3.87039 1.33333 7C1.33333 10.1296 3.8704 12.6667 7 12.6667H7.58694" stroke="currentColor" stroke-miterlimit="10"/><path d="M9.5 11.5H13.5M11.5 9.5V13.5" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},"outline-cookie":{viewBox:`0 0 16 16`,body:`<path d="M14 8.5A6 6 0 1 1 7.5 2a2 2 0 0 0 2.5 2.5 2 2 0 0 0 2.5 2.5c.4.6.9 1.1 1.5 1.5Z" stroke="currentColor" stroke-linejoin="round"/><path d="M5.5 6.5h.01M5.5 10h.01M8.5 9h.01M10.5 11.5h.01" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>`},"outline-browser-annotate":{viewBox:`0 0 16 16`,body:`<path d="M10.6667 2H14V5.33333M2 5.33333V2H5.33333M2 10.6667V14H5.33333" stroke="currentColor" stroke-linecap="square"/><path d="M11.8571 11.8572L14 14M6.50008 6.50033L14.0001 9.00033L9.00008 14.0003L6.50008 6.50033Z" stroke="currentColor" stroke-linecap="square"/>`},"arrow-up-right":{viewBox:`0 0 16 16`,body:`<path d="M11 9.56V5H6.44M11 5L5 11" stroke="currentColor"/>`},"outline-square-arrow":{viewBox:`0 0 16 16`,body:`<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`},"outline-arrow-to-corner-top-right":{viewBox:`0 0 16 16`,body:`<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`},"outline-hexagonal-warning":{viewBox:`0 0 16 16`,body:`<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`},"outline-share":{viewBox:`0 0 16 16`,body:`<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`},"outline-eye":{viewBox:`0 0 20 20`,body:`<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`},"outline-eye-slash":{viewBox:`0 0 20 20`,body:`<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/><path d="M3 3 17 17" stroke="currentColor" stroke-linecap="round"/>`},refresh:{viewBox:`0 0 20 20`,body:`<path d="M16.25 7.5A6.5 6.5 0 1 0 16.5 11M16.25 3.5v4h-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`},reset:{viewBox:`0 0 20 20`,body:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`},"outline-undo":{viewBox:`0 0 16 16`,body:`<path d="M2 10L4.25193 7.76999C7.29213 4.7594 12.4119 5.77372 14.0747 9.71606" stroke="currentColor"/><path d="M2 6V10H6" stroke="currentColor" stroke-linecap="square"/>`},"outline-reset":{viewBox:`0 0 20 20`,body:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`},"fill-triangle-down":{viewBox:`0 0 16 16`,body:`<path d="M5.37624 6.75194C5.18184 6.41861 5.42224 6 5.80814 6H10.1921C10.578 6 10.8184 6.41861 10.624 6.75194L8.43203 10.5096C8.23909 10.8404 7.76119 10.8404 7.56825 10.5096L5.37624 6.75194Z" fill="currentColor"/>`},waveform:{viewBox:`0 0 16 16`,body:`<path d="M2 7V9M4.5 5V11M7 2.5V13.5M9.5 4.5V11.5M12 6V10M14.5 7.25V8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>`},archive:{viewBox:`0 0 16 16`,body:`<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`}};function Tn(){return Array.from(new Set([...Object.keys(Sn),...Object.keys(wn)]))}function En(e){return Object.hasOwn(wn,e)||Object.hasOwn(Sn,e)}function Dn(e){let t=wn[e];if(t)return t;let n=e;return{body:Sn[n],viewBox:Cn(n)}}var On=L(`<svg><use>`),kn=`opencode-v2-icon-sprite`,An=e=>`opencode-v2-icon-${e}`,jn=!1;function Mn(){return Tn().map(e=>`<symbol id="${An(e)}" viewBox="${Dn(e).viewBox}">${Dn(e).body}</symbol>`).join(``)}function Nn(){if(jn||typeof document>`u`)return;let e=document.getElementById(kn);if(e){e.innerHTML=Mn(),jn=!0;return}let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.id=kn,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.style.position=`absolute`,t.style.overflow=`hidden`,t.innerHTML=Mn(),document.body.insertBefore(t,document.body.firstChild),jn=!0}function Pn(e){let[t,n]=N(e,[`name`,`size`]),r=()=>En(t.name)?t.name:`plus`,i=()=>Dn(r()),a=t.size===`small`?14:t.size===`large`?20:16;return D(Nn),(()=>{var e=On(),t=e.firstChild;return nt(e,M(n,{"data-slot":`icon-svg`,get"data-directional"(){return r()===`arrow-left`||r()===`arrow-right`||r()===`outline-arrow-left`||r()===`outline-arrow-right`||r()===`chevron-left`||r()===`chevron-right`?``:void 0},width:a,height:a,get viewBox(){return i().viewBox},fill:`none`,xmlns:`http://www.w3.org/2000/svg`,get"aria-hidden"(){return n[`aria-hidden`]??`true`}}),!0,!0),x(()=>R(t,`href`,`#${An(r())}`)),e})()}function Fn(e){let[t,n]=N(e,[`variant`,`size`,`icon`,`class`,`classList`]);return j(bn,M(n,{"data-component":`button-v2`,get"data-size"(){return t.size||`normal`},get"data-variant"(){return t.variant||`neutral`},get"data-icon"(){return t.icon},get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return[j(F,{get when(){return t.icon},children:e=>j(Pn,{get name(){return e()}})}),I(()=>e.children)]}}))}function In(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Rn=(e,t,n)=>n>t?t:n<e?e:n,zn={},Bn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Vn=e=>typeof e==`object`&&!!e,Hn=e=>/^0[^.\s]+$/u.test(e);function Un(e){let t;return()=>(t===void 0&&(t=e()),t)}var Wn=e=>e,Gn=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Kn=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},qn=class{constructor(){this.subscriptions=[]}add(e){return In(this.subscriptions,e),()=>this.remove(e)}remove(e){Ln(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Jn=e=>e*1e3,Yn=e=>e/1e3,Xn=(e,t)=>t?1e3/t*e:0,Zn=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Qn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$n=1e-7,er=12;function tr(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Qn(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$n&&++s<er);return o}function nr(e,t,n,r){if(e===t&&n===r)return Wn;let i=t=>tr(t,0,1,e,n);return e=>e===0||e===1?e:Qn(i(e),t,r)}var rr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ir=e=>t=>1-e(1-t),ar=nr(.33,1.53,.69,.99),or=ir(ar),sr=rr(or),cr=e=>e>=1?1:(e*=2)<1?.5*or(e):.5*(2-2**(-10*(e-1))),lr=e=>1-Math.sin(Math.acos(e)),ur=ir(lr),dr=rr(lr),fr=nr(.42,0,1,1),pr=nr(0,0,.58,1),mr=nr(.42,0,.58,1),hr=e=>Array.isArray(e)&&typeof e[0]!=`number`;function gr(e,t){return hr(e)?e[Zn(0,e.length,t)]:e}var _r=e=>Array.isArray(e)&&typeof e[0]==`number`,vr={linear:Wn,easeIn:fr,easeInOut:mr,easeOut:pr,circIn:lr,circInOut:dr,circOut:ur,backIn:or,backInOut:sr,backOut:ar,anticipate:cr},yr=e=>typeof e==`string`,br=e=>{if(_r(e)){e.length;let[t,n,r,i]=e;return nr(t,n,r,i)}return yr(e)?(vr[e],`${e}`,vr[e]):e},xr={delta:0,timestamp:0,isProcessing:!1},Sr;function Cr(){Sr=void 0}var wr={now:()=>(Sr===void 0&&wr.set(xr.isProcessing||zn.useManualTiming?xr.timestamp:performance.now()),Sr),set:e=>{Sr=e,queueMicrotask(Cr)}},Tr=e=>Math.round(e*1e5)/1e5,Er=e=>t=>typeof t==`string`&&t.startsWith(e),Dr=Er(`--`),Or=Er(`var(--`),kr=e=>Or(e)?Ar.test(e.split(`/*`)[0].trim()):!1,Ar=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function jr(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Mr={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Nr={...Mr,transform:e=>Rn(0,1,e)},Pr={...Mr,default:1},Fr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ir(e){return e==null}var Lr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rr=(e,t)=>n=>!!(typeof n==`string`&&Lr.test(n)&&n.startsWith(e)||t&&!Ir(n)&&Object.prototype.hasOwnProperty.call(n,t)),zr=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Fr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Br=e=>Rn(0,255,e),Vr={...Mr,transform:e=>Math.round(Br(e))},Hr={test:Rr(`rgb`,`red`),parse:zr(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Vr.transform(e)+`, `+Vr.transform(t)+`, `+Vr.transform(n)+`, `+Tr(Nr.transform(r))+`)`};function Ur(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Wr={test:Rr(`#`),parse:Ur,transform:Hr.transform},Gr=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kr=Gr(`deg`),qr=Gr(`%`),H=Gr(`px`),Jr=Gr(`vh`),Yr=Gr(`vw`),Xr={...qr,parse:e=>qr.parse(e)/100,transform:e=>qr.transform(e*100)},Zr={test:Rr(`hsl`,`hue`),parse:zr(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+qr.transform(Tr(t))+`, `+qr.transform(Tr(n))+`, `+Tr(Nr.transform(r))+`)`},Qr={test:e=>Hr.test(e)||Wr.test(e)||Zr.test(e),parse:e=>Hr.test(e)?Hr.parse(e):Zr.test(e)?Zr.parse(e):Wr.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Hr.transform(e):Zr.transform(e),getAnimatableNone:e=>{let t=Qr.parse(e);return t.alpha=0,Qr.transform(t)}},$r=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ei=new RegExp(Fr.source),ti=new RegExp($r.source,`i`);function ni(e){return isNaN(e)&&typeof e==`string`&&(ei.test(e)||ti.test(e))}var ri=`number`,ii=`color`,ai=`var`,oi=`var(`,si="${}",ci=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function li(e){let t=e.toString();return ei.test(t)||ti.test(t)}function ui(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ci,e=>(Qr.test(e)?(r.color.push(a),i.push(ii),n.push(Qr.parse(e))):e.startsWith(oi)?(r.var.push(a),i.push(ai),n.push(e)):(r.number.push(a),i.push(ri),n.push(parseFloat(e))),++a,si)).split(si),indexes:r,types:i}}function di(e){return ui(e).values}function fi({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===ri?Tr(r[a]):e===ii?Qr.transform(r[a]):r[a]}return i}}function pi(e){return fi(ui(e))}var mi=e=>typeof e==`number`?0:Qr.test(e)?Qr.getAnimatableNone(e):e,hi=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:mi(e);function gi(e){let t=ui(e);return fi(t)(t.values.map((e,n)=>hi(e,t.split[n])))}var _i={test:ni,parse:di,createTransformer:pi,getAnimatableNone:gi};function vi(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yi({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=vi(s,r,e+1/3),a=vi(s,r,e),o=vi(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function bi(e,t){return n=>n>0?t:e}var U=(e,t,n)=>e+(t-e)*n,xi=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Si=[Wr,Hr,Zr],Ci=e=>Si.find(t=>t.test(e));function wi(e){let t=Ci(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Zr&&(n=yi(n)),n}var Ti=(e,t)=>{let n=wi(e),r=wi(t);if(!n||!r)return bi(e,t);let i={...n};return e=>(i.red=xi(n.red,r.red,e),i.green=xi(n.green,r.green,e),i.blue=xi(n.blue,r.blue,e),i.alpha=U(n.alpha,r.alpha,e),Hr.transform(i))},Ei=new Set([`none`,`hidden`]);function Di(e,t){return Ei.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Oi(e,t){return n=>U(e,t,n)}function ki(e){return typeof e==`number`?Oi:typeof e==`string`?kr(e)?bi:Qr.test(e)?Ti:Ni:Array.isArray(e)?Ai:typeof e==`object`?Qr.test(e)?Ti:ji:bi}function Ai(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ki(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ji(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ki(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Mi(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Ni=(e,t)=>{let n=_i.createTransformer(t),r=ui(e),i=ui(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ei.has(e)&&!i.values.length||Ei.has(t)&&!r.values.length?Di(e,t):Gn(Ai(Mi(r,i),i.values),n):(`${e}${t}`,bi(e,t))},Pi=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Fi(e,t){let n=Pi.exec(e);if(!n)return;let r=Pi.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Tr(U(a,o,e))+i}function Ii(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return U(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Fi(e,t);if(n)return n}return ki(e)(e,t)}var Li=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Ri(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var zi=40;function Bi(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Li.reduce((e,t)=>(e[t]=Ri(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=zn.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,zi),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Li.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Li.length;t++)o[Li[t]].cancel(e)},state:n,steps:o}}var{schedule:W,cancel:Vi,steps:Hi}=Bi(typeof requestAnimationFrame<`u`?requestAnimationFrame:Wn,!0,xr),Ui=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>W.update(t,e),stop:()=>Vi(t),now:()=>xr.isProcessing?xr.timestamp:wr.now()}},Wi=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Gi=2e4;function Ki(e,t=50,n=Gi,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function qi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Ki(r),Gi);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Yn(i)}}var Ji={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Yi=e=>e<0?1/Math.max(1+e,Ji.minDamping):Math.max(1-e,Ji.minDamping);function Xi(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return $i(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Zi(e,t){return e*Math.sqrt(1-t*t)}var Qi=12;function $i(e,t,n){let r=n;for(let n=1;n<Qi;n++)r-=e(r)/t(r);return r}var ea=.001;function ta({duration:e=Ji.duration,bounce:t=Ji.bounce}){let n,r;Ji.maxDuration;let i=Yi(t);e=Rn(Ji.minDuration,Ji.maxDuration,Yn(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Zi(t,i),o=Math.exp(-r);return ea-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Zi(t*t,i);return(-n(t)+ea>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=$i(n,r,a),s=o*Xi(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Jn(e)}}var na=(e,t)=>(t?e>=0:e>0)&&e<1/0;function ra(e,t){if(na(e,t))return e}function ia(e){let t=ra(e.stiffness),n=ra(e.damping,!0),r=ra(e.mass),i={...e,stiffness:t??Ji.stiffness,damping:n??Ji.damping,mass:r??Ji.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Yi(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Xi(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,ta(i)),i.isResolvedFromDuration=!0;(!na(i.stiffness)||!na(i.damping,!0))&&(i.stiffness=Ji.stiffness,i.damping=Ji.damping)}return i}function aa(e=Ji.visualDuration,t=Ji.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=ia({...n}),f=e=>d?0:-Yn(e),p=s/(2*Math.sqrt(o*c)),m=Yn(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Ji.restSpeed.granular:Ji.restSpeed.default),g.restDelta=n.restDelta||(e?Ji.restDelta.granular:Ji.restDelta.default)};_();let v,y,b;if(p<1){let e=Zi(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Jn(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Jn(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Ki(S),Gi),t=Wi(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}aa.applyToOptions=e=>{let t=qi(e,100,aa);return e.ease=t.ease,e.duration=Jn(t.duration),e.type=`keyframes`,e};function oa({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=aa({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function sa(e,t,n){let r=[],i=n||zn.mix||Ii,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Gn(Array.isArray(t)?t[n]||Wn:t,a)),r.push(a)}return r}function ca(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=sa(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Kn(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Rn(e[0],e[a-1],t)):l}function la(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Kn(0,t,r);e.push(U(n,1,i))}}function ua(e){let t=[0];return la(t,e.length-1),t}function da(e,t){return e.map(e=>e*t)}function fa(e,t){return e.map(()=>t||mr).splice(0,e.length-1)}function pa({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=hr(r)?r.map(br):br(r)||mr,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(zn.mix||Ii)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Rn(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=ca(da(n&&n.length===t.length?n:ua(t),e),t,{ease:Array.isArray(i)?i:fa(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ma=5;function ha(e,t,n){let r=Math.max(t-ma,0);return Xn(n-e(r),t-r)}function ga(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):ha(t=>e.next(t).value,t,e.next(t).value)}var _a=e=>e!==null;function va(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(_a),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var ya={decay:oa,inertia:oa,tween:pa,keyframes:pa,spring:aa};function ba(e){typeof e.type==`string`&&(e.type=ya[e.type])}function xa(e,t){return{kind:e,animation:t,timestamp:wr.now(),frameTimestamp:xr.timestamp,frameIsProcessing:xr.isProcessing}}function Sa(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...xa(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Ca(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...xa(`layout-animation-start`,e),node:t})}catch{}}var wa=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Ta=e=>e/100,Ea=class extends wa{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==wr.now()&&this.tick(wr.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Sa(this,this.options)}initAnimation(){let{options:e}=this;ba(e);let{type:t=pa,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||pa;s!==pa&&typeof o[0]!=`number`&&(this.mixKeyframes=Gn(Ta,Ii(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Ki(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Rn(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==oa&&(b.value=va(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Yn(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Yn(e)}get time(){return Yn(this.currentTime)}set time(e){e=Jn(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return ga(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(wr.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Yn(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ui,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(wr.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Da=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Oa(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Fr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Da.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ka=/\b([a-z-]*)\(.*?\)/gu,Aa={..._i,getAnimatableNone:e=>{let t=e.match(ka);return t?t.map(Oa).join(` `):e}},ja={..._i,getAnimatableNone:e=>{let t=_i.parse(e);return _i.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Ma={...Mr,transform:Math.round},Na={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,rotate:Kr,pathRotation:Kr,rotateX:Kr,rotateY:Kr,rotateZ:Kr,scale:Pr,scaleX:Pr,scaleY:Pr,scaleZ:Pr,skew:Kr,skewX:Kr,skewY:Kr,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Nr,originX:Xr,originY:Xr,originZ:H,zIndex:Ma,fillOpacity:Nr,strokeOpacity:Nr,numOctaves:Ma},Pa={...Na,color:Qr,backgroundColor:Qr,outlineColor:Qr,fill:Qr,stroke:Qr,borderColor:Qr,borderTopColor:Qr,borderRightColor:Qr,borderBottomColor:Qr,borderLeftColor:Qr,filter:Aa,WebkitFilter:Aa,mask:ja,WebkitMask:ja},Fa=e=>Pa[e],Ia=new Set([Aa,ja]);function La(e,t){let n=Fa(e);return Ia.has(n)||(n=_i),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function Ra(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var za=e=>e*180/Math.PI,Ba=e=>Ha(za(Math.atan2(e[1],e[0]))),Va={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ba,rotateZ:Ba,skewX:e=>za(Math.atan(e[1])),skewY:e=>za(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ha=e=>(e%=360,e<0&&(e+=360),e),Ua=Ba,Wa=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ga=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ka={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Wa,scaleY:Ga,scale:e=>(Wa(e)+Ga(e))/2,rotateX:e=>Ha(za(Math.atan2(e[6],e[5]))),rotateY:e=>Ha(za(Math.atan2(-e[2],e[0]))),rotateZ:Ua,rotate:Ua,skewX:e=>za(Math.atan(e[4])),skewY:e=>za(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qa(e){return+!!e.includes(`scale`)}function Ja(e,t){if(!e||e===`none`)return qa(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ka,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Va,i=t}if(!i)return qa(t);let a=r[t],o=i[1].split(`,`).map(Xa);return typeof a==`function`?a(o):o[a]}var Ya=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ja(n,t)};function Xa(e){return parseFloat(e.trim())}var Za=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Qa=new Set([...Za,`pathRotation`]),$a=e=>e===Mr||e===H,eo=new Set([`x`,`y`,`z`]),to=Za.filter(e=>!eo.has(e));function no(e){let t=[];return to.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var ro=new Set([`bottom`,`right`]);function io(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var ao={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>io(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>io(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ja(e,`x`),y:({transform:e})=>Ja(e,`y`)};ao.translateX=ao.x,ao.translateY=ao.y;var oo=new Set,so=!1,co=!1,lo=!1;function uo(){if(co){let e=[],t=new Set,n=new Set;oo.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),ro.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=no(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}co=!1,so=!1,oo.forEach(e=>e.complete(lo)),oo.clear()}function fo(){oo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(co=!0)})}function po(){lo=!0,fo(),uo(),lo=!1}function mo(e,t,n){if(typeof e==`string`){if(Bn(e)||Hn(e))return parseFloat(e);if(!_i.test(e)&&_i.test(n))return La(t,n)}return e??void 0}var ho=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(oo.add(this),so||(so=!0,W.read(fo),W.resolveKeyframes(uo))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=mo(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ra(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),oo.delete(this)}cancel(){this.state===`scheduled`&&(oo.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},go=e=>e.startsWith(`--`);function _o(e,t,n){go(t)?e.style.setProperty(t,n):e.style[t]=n}var vo={};function yo(e,t){let n=Un(e);return()=>vo[t]??n()}var bo=yo(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),xo=yo(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),So=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Co={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:So([0,.65,.55,1]),circOut:So([.55,0,1,.45]),backIn:So([.31,.01,.66,-.59]),backOut:So([.33,1.53,.69,.99])};function wo(e,t){if(e)return typeof e==`function`?xo()?Wi(e,t):`ease-out`:_r(e)?So(e):Array.isArray(e)?e.map(e=>wo(e,t)||Co.easeOut):Co[e]}function To(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=wo(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Eo(e){return typeof e==`function`&&`applyToOptions`in e}function Do({type:e,...t}){return Eo(e)&&xo()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Oo=class extends wa{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Do(e);this.animation=To(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=va(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),_o(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Sa(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Yn(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Yn(e)}get time(){return Yn(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Jn(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bo()?(this.animation.timeline=e,t?.(this.animation),Wn):n(this)}},ko={anticipate:cr,backInOut:sr,circInOut:dr};function Ao(e){return e in ko}function jo(e){typeof e.ease==`string`&&Ao(e.ease)&&(e.ease=ko[e.ease])}var Mo=10,No=class extends Oo{constructor(e){jo(e),ba(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ea({...a,autoplay:!1}),s=Math.max(Mo,wr.now()-this.startTime),c=Rn(0,Mo,s-Mo),l=o.sample(s).value,{name:u}=this.options;i&&u&&_o(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Po=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(_i.test(e)||e===`0`)&&!e.startsWith(`url(`));function Fo(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Io(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Po(i,t),s=Po(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):Fo(e)||(n===`spring`||Eo(n))&&r}function Lo(e){e.duration=0,e.type=`keyframes`}var Ro=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),zo=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Bo(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&zo.test(e[t]))return!0;return!1}var Vo=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ho=Un(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Uo(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(Ro.has(n)||Vo.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ho()&&(Ro.has(n)||Vo.has(n)&&Bo(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Wo=40,Go=class extends wa{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=wr.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||ho;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=wr.now();let u=!0;Io(e,i,a,o)||(u=!1,(zn.instantAnimations||!s)&&l?.(va(e,n,t)),e[0]=e[e.length-1],Lo(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>Wo?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&Uo(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new No(n)}catch{m=new Ea(n)}}else m=new Ea(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),po()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},Ko=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return qo(this.animations,`duration`)}get iterationDuration(){return qo(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function qo(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Jo=class extends Ko{then(e,t){return this.finished.finally(e).then(()=>{})}};function Yo(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Xo=30,Zo=e=>!isNaN(parseFloat(e)),Qo={current:void 0},$o=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=wr.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=wr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Zo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new qn)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new qn,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){W.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Qo.current&&Qo.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=wr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Xo)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Xo);return Xn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function es(e,t){return new $o(e,t)}function ts(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ns(e,t){let n=e?.[t]??e?.default??e;return n===e?n:ts(n,e)}var rs={type:`spring`,stiffness:500,damping:25,restSpeed:10},is=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),as={type:`keyframes`,duration:.8},os={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},ss=(e,{keyframes:t})=>t.length>2?as:Qa.has(e)?e.startsWith(`scale`)?is(t[1]):rs:os,cs=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ls(e){for(let t in e)if(!cs.has(t))return!0;return!1}var us=(e,t,n,r={},i,a)=>o=>{let s=ns(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Jn(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ls(s)||Object.assign(u,ss(e,u)),u.duration&&=Jn(u.duration),u.repeatDelay&&=Jn(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Lo(u),u.delay===0&&(d=!0)),(zn.instantAnimations||zn.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Lo(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=va(u.keyframes,s);if(e!==void 0){W.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ea(u):new Go(u)},ds=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fs(e){let t=ds.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function ps(e,t,n=1){`${e}`;let[r,i]=fs(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Bn(e)?parseFloat(e):e}return kr(i)?ps(i,t,n+1):i}function ms(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function hs(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...ms(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function gs(e,t,n){return hs(e.getProps(),t,n,e)}var _s=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,vs=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Za]),ys=e=>Array.isArray(e);function bs(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,es(n))}function xs(e){return ys(e)?e[e.length-1]||0:e}function Ss(e,t){let{transitionEnd:n={},transition:r={},...i}=gs(e,t)||{};i={...i,...n};for(let t in i)bs(e,t,xs(i[t]))}var Cs=e=>!!(e&&e.getVelocity);function ws(e){return!!(Cs(e)&&e.add)}function Ts(e,t){let n=e.getValue(`willChange`);if(ws(n))return n.add(t);if(!n&&zn.WillChange){let n=new zn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Es(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ds=`data-`+Es(`framerAppearId`);function Os(e){return e.props[Ds]}var ks=typeof window<`u`;function As({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function js(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ts(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&As(f,t))continue;let o={delay:n,...ns(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){W.update(()=>r.set(i));continue}let p=!1;if(ks&&window.MotionHandoffAnimation){let n=Os(e);if(n){let e=window.MotionHandoffAnimation(n,t,W);e!==null&&(o.startTime=e,p=!0)}}Ts(e,t);let m=l??e.shouldReduceMotion;r.start(us(t,r,i,m&&vs.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>W.update(()=>{o&&Ss(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ms(e,t,n={}){let r=gs(e,t,_s(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?js(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Ms(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Yo(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Ns(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Ms(e,t,n))):typeof t==`string`?Ms(e,t,n):Promise.all(js(e,gs(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Ps={test:e=>e===`auto`,parse:e=>e},Fs=e=>t=>t.test(e),Is=[Mr,H,qr,Kr,Yr,Jr,Ps],Ls=e=>Is.find(Fs(e));function Rs(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Hn(e)}var zs=new Set([`auto`,`none`,`0`]);function Bs(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!zs.has(t)&&li(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=La(n,i))}var Vs=class extends ho{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),kr(r))){let i=ps(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!vs.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ls(r),o=Ls(i);if(jr(r)!==jr(i)&&ao[n])this.needsMeasurement=!0;else if(a!==o){if($a(a)&&$a(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else ao[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Rs(e[t]))&&n.push(t);n.length&&Bs(e,n,t)}measure(){let{element:e,name:t}=this;return ao[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},Hs=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Us(e){return Vn(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Ws(e){return Vn(e)&&`ownerSVGElement`in e}var Gs=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Ks(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var qs={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Js=Za.length;function Ys(e,t,n){let r=``,i=!0;for(let a=0;a<Js;a++){let o=Za[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Gs(s,Na[o]);if(!c){i=!1;let t=qs[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Gs(a,Na.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Xs(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Qa.has(e))o=!0;else if(Dr(e))i[e]=n;else{let t=Gs(n,Na[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ys(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Zs={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Qs={offset:`strokeDashoffset`,array:`strokeDasharray`};function $s(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Zs:Qs;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ec=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function tc(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Xs(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of ec)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&$s(d,i,a,o,!1)}function nc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function rc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ic(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ac(e){return e===void 0||e===1}function oc({scale:e,scaleX:t,scaleY:n}){return!ac(e)||!ac(t)||!ac(n)}function sc(e){return oc(e)||cc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function cc(e){return lc(e.x)||lc(e.y)}function lc(e){return e&&e!==`0%`}function uc(e,t,n){return n+t*(e-n)}function dc(e,t,n,r,i){return i!==void 0&&(e=uc(e,i,r)),uc(e,n,r)+t}function fc(e,t=0,n=1,r,i){e.min=dc(e.min,t,n,r,i),e.max=dc(e.max,t,n,r,i)}function pc(e,{x:t,y:n}){fc(e.x,t.translate,t.scale,t.originPoint),fc(e.y,n.translate,n.scale,n.originPoint)}var mc=.999999999999,hc=1.0000000000001;function gc(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(_c(e.x,-a.scroll.offset.x),_c(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,pc(e,o)),r&&sc(a.latestValues)&&bc(e,a.latestValues,a.layout?.layoutBox))}t.x<hc&&t.x>mc&&(t.x=1),t.y<hc&&t.y>mc&&(t.y=1)}function _c(e,t){e.min+=t,e.max+=t}function vc(e,t,n,r,i=.5){fc(e,t,n,U(e.min,e.max,i),r)}function yc(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function bc(e,t,n){let r=n??e;vc(e.x,yc(t.x,r.x),t.scaleX,t.scale,t.originX),vc(e.y,yc(t.y,r.y),t.scaleY,t.scale,t.originY)}function xc(e,t){return nc(ic(e.getBoundingClientRect(),t))}function Sc(e,t,n){let r=xc(e,n),{scroll:i}=t;return i&&(_c(r.x,i.offset.x),_c(r.y,i.offset.y)),r}var{schedule:Cc,cancel:wc}=Bi(queueMicrotask,!1),Tc={x:!1,y:!1};function Ec(){return Tc.x||Tc.y}function Dc(e){return e===`x`||e===`y`?Tc[e]?null:(Tc[e]=!0,()=>{Tc[e]=!1}):Tc.x||Tc.y?null:(Tc.x=Tc.y=!0,()=>{Tc.x=Tc.y=!1})}function Oc(e,t){let n=Ks(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function kc(e){return!(e.pointerType===`touch`||Ec())}function Ac(e,t,n={}){let[r,i,a]=Oc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!kc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var jc=(e,t)=>t?e===t||jc(e,t.parentElement):!1,Mc=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Nc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Pc(e){return Nc.has(e.tagName)||e.isContentEditable===!0}var Fc=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Ic(e){return Fc.has(e.tagName)||e.isContentEditable===!0}var Lc=new WeakSet;function Rc(e){return t=>{t.key===`Enter`&&e(t)}}function zc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Bc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Rc(()=>{if(Lc.has(n))return;zc(n,`down`);let e=Rc(()=>{zc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>zc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Vc(e){return Mc(e)&&!Ec()}var Hc=new WeakSet;function Uc(e,t,n={}){let[r,i,a]=Oc(e,n),o=e=>{let r=e.currentTarget;if(!Vc(e)||Hc.has(e))return;Lc.add(r),n.stopPropagation&&Hc.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Lc.has(r)&&Lc.delete(r),Vc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||jc(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Us(e)&&(e.addEventListener(`focus`,e=>Bc(e,i)),!Pc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Wc=new WeakMap,Gc,Kc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ws(r)&&`getBBox`in r?r.getBBox()[t]:r[n],qc=Kc(`inline`,`width`,`offsetWidth`),Jc=Kc(`block`,`height`,`offsetHeight`);function Yc({target:e,borderBoxSize:t}){Wc.get(e)?.forEach(n=>{n(e,{get width(){return qc(e,t)},get height(){return Jc(e,t)}})})}function Xc(e){e.forEach(Yc)}function Zc(){typeof ResizeObserver<`u`&&(Gc=new ResizeObserver(Xc))}function Qc(e,t){Gc||Zc();let n=Ks(e);return n.forEach(e=>{let n=Wc.get(e);n||(n=new Set,Wc.set(e,n)),n.add(t),Gc?.observe(e)}),()=>{n.forEach(e=>{let n=Wc.get(e);n?.delete(t),n?.size||Gc?.unobserve(e)})}}var $c=new Set,el;function tl(){el=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};$c.forEach(t=>t(e))},window.addEventListener(`resize`,el)}function nl(e){return $c.add(e),el||tl(),()=>{$c.delete(e),!$c.size&&typeof el==`function`&&(window.removeEventListener(`resize`,el),el=void 0)}}function rl(e,t){return typeof e==`function`?nl(e):Qc(e,t)}var il={value:null,addProjectionMetrics:null};function al(e){return Ws(e)&&e.tagName===`svg`}var ol=e=>typeof e==`number`?e:parseFloat(e),sl=()=>({translate:0,scale:1,origin:0,originPoint:0}),cl=()=>({x:sl(),y:sl()}),ll=()=>({min:0,max:0}),ul=()=>({x:ll(),y:ll()}),dl=new WeakMap;function fl(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function pl(e){return typeof e==`string`||Array.isArray(e)}var ml=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],hl=[`initial`,...ml];function gl(e){if(fl(e.animate))return!0;for(let t=0;t<hl.length;t++)if(pl(e[hl[t]]))return!0;return!1}function _l(e){return!!(gl(e)||e.variants)}function vl(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Cs(i))e.addValue(r,i);else if(Cs(a))e.addValue(r,es(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,es(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var yl={current:null},bl={current:!1},xl=typeof window<`u`;function Sl(){if(bl.current=!0,xl){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>yl.current=e.matches;e.addEventListener(`change`,t),t()}else yl.current=!1}}var Cl=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],wl={};function Tl(e){wl=e}function El(){return wl}var Dl=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ho,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=wr.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,W.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=gl(t),this.isVariantNode=_l(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Cs(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,dl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(bl.current||Sl(),this.shouldReduceMotion=yl.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Vi(this.notifyUpdate),Vi(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Ro.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Oo({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Jn(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Qa.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in wl){let t=wl[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ul()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Cl.length;t++){let n=Cl[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=vl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=es(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Bn(n)||Hn(n))?n=parseFloat(n):typeof n!=`number`&&!_i.test(n)&&_i.test(t)&&(n=La(e,t)),this.setBaseTarget(e,Cs(n)?n.get():n)),Cs(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new qn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Cc.render(this.render)}},Ol=class extends Dl{constructor(){super(...arguments),this.KeyframeResolver=Vs}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Cs(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},kl=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Al(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var jl={};function Ml(e,{layout:t,layoutId:n}){return Qa.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!jl[e]||e===`opacity`)}function Nl(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Cs(r[t])||i&&Cs(i[t])||Ml(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Pl(e){return window.getComputedStyle(e)}var Fl=class extends Ol{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Al}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Qa.has(t))return this.projection?.isProjecting?qa(t):Ya(e,t);{let n=Pl(e),r=(Dr(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return xc(e,t)}build(e,t,n){Xs(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Nl(e,t,n)}};function Il(e,t){return e in t}var Ll=class extends Dl{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Il(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return ul()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Rl=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),zl=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Bl(e,t,n,r){Al(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Rl.has(n)?n:Es(n),t.attrs[n])}function Vl(e,t,n){let r=Nl(e,t,n);for(let n in e)if(Cs(e[n])||Cs(t[n])){let t=Za.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Hl=class extends Ol{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=ul}getBaseTargetFromProps(e,t){return Qa.has(t)?super.getBaseTargetFromProps(e,t)??qa(t):e[t]}getDefaultValue(e){return Qa.has(e)?this.latestValues[e]??qa(e):void 0}readValueFromInstance(e,t){if(Qa.has(t)){let e=Fa(t);return e&&e.default||0}if(ec.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Rl.has(t)?t:Es(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Vl(e,t,n)}build(e,t,n){tc(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Bl(e,t,n,r)}mount(e){this.isSVGTag=zl(e.tagName),super.mount(e)}};function Ul(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Wl=[...ml].reverse();function Gl(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Ns(e,t,n))),n=ql(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(Wl.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?pl(g)||g===!1?g:void 0:h,v=pl(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||fl(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Kl(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=gs(e,n,_s(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!Ul(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=gs(s,n)?.transition?.delayChildren;r.delay=Yo(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&gs(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Cs(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ql(),i=!0}}}function Kl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Ul(t,e):!1}function ql(){let e={};for(let t of ml)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Jl(e,t){e.min=t.min,e.max=t.max}function Yl(e,t){Jl(e.x,t.x),Jl(e.y,t.y)}function Xl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Zl=.9999,Ql=1.0001,$l=-.01,eu=.01;function tu(e){return e.max-e.min}function nu(e,t,n){return Math.abs(e-t)<=n}function ru(e,t,n,r=.5){e.origin=r,e.originPoint=U(t.min,t.max,e.origin),e.scale=tu(n)/tu(t),e.translate=U(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zl&&e.scale<=Ql||isNaN(e.scale))&&(e.scale=1),(e.translate>=$l&&e.translate<=eu||isNaN(e.translate))&&(e.translate=0)}function iu(e,t,n,r){ru(e.x,t.x,n.x,r?r.originX:void 0),ru(e.y,t.y,n.y,r?r.originY:void 0)}function au(e,t,n,r=0){e.min=(r?U(n.min,n.max,r):n.min)+t.min,e.max=e.min+tu(t)}function ou(e,t,n,r){au(e.x,t.x,n.x,r?.x),au(e.y,t.y,n.y,r?.y)}function su(e,t,n,r=0){let i=r?U(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+tu(t)}function cu(e,t,n,r){su(e.x,t.x,n.x,r?.x),su(e.y,t.y,n.y,r?.y)}function lu(e,t,n,r,i){return e-=t,e=uc(e,1/n,r),i!==void 0&&(e=uc(e,1/i,r)),e}function uu(e,t=0,n=1,r=.5,i,a=e,o=e){if(qr.test(t)&&(t=parseFloat(t),t=U(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=U(a.min,a.max,r);e===a&&(s-=t),e.min=lu(e.min,t,n,s,i),e.max=lu(e.max,t,n,s,i)}function du(e,t,[n,r,i],a,o){uu(e,t[n],t[r],t[i],t.scale,a,o)}var fu=[`x`,`scaleX`,`originX`],pu=[`y`,`scaleY`,`originY`];function mu(e,t,n,r){du(e.x,t,fu,n?n.x:void 0,r?r.x:void 0),du(e.y,t,pu,n?n.y:void 0,r?r.y:void 0)}function hu(e){return e.translate===0&&e.scale===1}function gu(e){return hu(e.x)&&hu(e.y)}function _u(e,t){return e.min===t.min&&e.max===t.max}function vu(e,t){return _u(e.x,t.x)&&_u(e.y,t.y)}function yu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bu(e,t){return yu(e.x,t.x)&&yu(e.y,t.y)}function xu(e){return tu(e.x)/tu(e.y)}function Su(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Cu(e){return[e(`x`),e(`y`)]}function wu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Tu={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(H.test(e))e=parseFloat(e);else return e}return`${wu(e,t.target.x)}% ${wu(e,t.target.y)}%`}},Eu={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=_i.parse(e);if(i.length>5)return r;let a=_i.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=U(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Du(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Ou=Hs.length,ku=e=>typeof e==`number`||H.test(e);function Au(e,t,n,r,i,a){i?(e.opacity=U(0,n.opacity??1,Mu(r)),e.opacityExit=U(t.opacity??1,0,Nu(r))):a&&(e.opacity=U(t.opacity??1,n.opacity??1,r));for(let i=0;i<Ou;i++){let a=Hs[i],o=ju(t,a),s=ju(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ku(o)===ku(s)?(e[a]=Math.max(U(ol(o),ol(s),r),0),(qr.test(s)||qr.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=U(t.rotate||0,n.rotate||0,r))}function ju(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Mu=Pu(0,.5,ur),Nu=Pu(.5,.95,Wn);function Pu(e,t,n){return r=>r<e?0:r>t?1:n(Kn(e,t,r))}function Fu(e,t,n){let r=Cs(e)?e:es(e);return r.start(us(``,r,t,n)),r.animation}function Iu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Lu=(e,t)=>e.depth-t.depth,Ru=class{constructor(){this.children=[],this.isDirty=!1}add(e){In(this.children,e),this.isDirty=!0}remove(e){Ln(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lu),this.isDirty=!1,this.children.forEach(e)}};function zu(e,t){let n=wr.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Vi(r),e(a-t))};return W.setup(r,!0),()=>Vi(r)}function Bu(e){return Cs(e)?e.get():e}var Vu=class{constructor(){this.members=[]}add(e){In(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Ln(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ln(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Hu={borderRadius:{...Tu,applyTo:[...Hs]},borderTopLeftRadius:Tu,borderTopRightRadius:Tu,borderBottomLeftRadius:Tu,borderBottomRightRadius:Tu,boxShadow:Eu},Uu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(jl,{...Hu,...jl});var Wu={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Gu=[``,`X`,`Y`,`Z`],Ku=1e3,qu=0;function Ju(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Os(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,W,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Yu(r)}function Xu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=qu++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,il.value&&(Wu.nodes=Wu.calculatedTargetDeltas=Wu.calculatedProjections=0),this.nodes.forEach($u),this.nodes.forEach(ld),this.nodes.forEach(ud),this.nodes.forEach(ed),il.addProjectionMetrics&&il.addProjectionMetrics(Wu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ru)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new qn),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ws(t)&&!al(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;W.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=zu(i,250),Uu.hasAnimatedSinceResize&&(Uu.hasAnimatedSinceResize=!1,this.nodes.forEach(cd)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||_d,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!bu(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ns(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||cd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(dd),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(rd),this.nodes.forEach(nd);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(id);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ad),this.nodes.forEach(od),this.nodes.forEach(sd),this.nodes.forEach(Zu),this.nodes.forEach(Qu)):this.nodes.forEach(id),this.clearAllSnapshots();let e=wr.now();xr.delta=Rn(0,1e3/60,e-xr.timestamp),xr.timestamp=e,xr.isProcessing=!0,Hi.update.process(xr),Hi.preRender.process(xr),Hi.render.process(xr),xr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(td),this.sharedNodes.forEach(fd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,W.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){W.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!tu(this.snapshot.measuredBox.x)&&!tu(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=ul(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!gu(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||sc(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),xd(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ul();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Cd))){let{scroll:e}=this.root;e&&(_c(t.x,e.offset.x),_c(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ul();if(Yl(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Yl(t,e),_c(t.x,i.offset.x),_c(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||ul();Yl(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(_c(r.x,-n.scroll.offset.x),_c(r.y,-n.scroll.offset.y)),sc(n.latestValues)&&bc(r,n.latestValues,n.layout?.layoutBox)}return sc(this.latestValues)&&bc(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=ul();Yl(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!sc(n.latestValues))continue;let r;n.instance&&(oc(n.latestValues)&&n.updateSnapshot(),r=ul(),Yl(r,n.measurePageBox())),mu(t,n.latestValues,n.snapshot?.layoutBox,r)}return sc(this.latestValues)&&mu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=xr.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=ul(),this.targetWithTransforms=ul()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ou(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Yl(this.target,this.layout.layoutBox),pc(this.target,this.targetDelta)):Yl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),il.value&&Wu.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||oc(this.parent.latestValues)||cc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ul(),this.relativeTargetOrigin=ul(),cu(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Yl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===xr.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Yl(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;gc(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ul());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Xl(this.prevProjectionDelta.x,this.projectionDelta.x),Xl(this.prevProjectionDelta.y,this.projectionDelta.y)),iu(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Su(this.projectionDelta.x,this.prevProjectionDelta.x)||!Su(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),il.value&&Wu.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=cl(),this.projectionDelta=cl(),this.projectionDeltaWithTransform=cl()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=cl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=ul(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(gd));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=U(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=U(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(pd(o.x,e.x,n),pd(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),hd(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&vu(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=ul(),Yl(f,this.relativeTarget)),c&&(this.animationValues=a,Au(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Vi(this.pendingAnimation),void 0),this.pendingAnimation=W.update(()=>{Uu.hasAnimatedSinceResize=!0,this.motionValue||=es(0),this.motionValue.jump(0,!1),this.currentAnimation=Fu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Ca(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ku),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Sd(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||ul();let t=tu(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=tu(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Yl(t,i),bc(t,r),iu(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vu),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Ju(`z`,e,r,this.animationValues);for(let t=0;t<Gu.length;t++)Ju(`rotate${Gu[t]}`,e,r,this.animationValues),Ju(`skew${Gu[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Bu(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Bu(t?.pointerEvents)||``),this.hasProjected&&!sc(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Du(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in jl){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=jl[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Bu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(nd),this.root.sharedNodes.clear()}}}function Zu(e){e.updateLayout()}function Qu(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Cu(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=tu(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Jl(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Sd(i,t.layoutBox,n)&&Cu(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=tu(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=cl();iu(o,n,t.layoutBox);let s=cl();a?iu(s,e.applyTransform(r,!0),t.measuredBox):iu(s,n,t.layoutBox);let c=!gu(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=ul();cu(s,t.layoutBox,i.layoutBox,o);let c=ul();cu(c,n,a.layoutBox,o),bu(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function $u(e){il.value&&Wu.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ed(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function td(e){e.clearSnapshot()}function nd(e){e.clearMeasurements()}function rd(e){e.isLayoutDirty=!0,e.updateLayout()}function id(e){e.isLayoutDirty=!1}function ad(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function od(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function sd(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function cd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ld(e){e.resolveTargetDelta()}function ud(e){e.calcProjection()}function dd(e){e.resetSkewAndRotation()}function fd(e){e.removeLeadSnapshot()}function pd(e,t,n){e.translate=U(t.translate,0,n),e.scale=U(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function md(e,t,n,r){e.min=U(t.min,n.min,r),e.max=U(t.max,n.max,r)}function hd(e,t,n,r){md(e.x,t.x,n.x,r),md(e.y,t.y,n.y,r)}function gd(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var _d={duration:.45,ease:[.4,0,.1,1]},vd=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yd=vd(`applewebkit/`)&&!vd(`chrome/`)?Math.round:Wn;function bd(e){e.min=yd(e.min),e.max=yd(e.max)}function xd(e){bd(e.x),bd(e.y)}function Sd(e,t,n){return e===`position`||e===`preserve-aspect`&&!nu(xu(t),xu(n),.2)}function Cd(e){return e!==e.root&&e.scroll?.wasRoot}var wd=Xu({attachResizeListener:(e,t)=>Iu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Td={current:void 0},Ed=Xu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Td.current){let e=new wd({});e.mount(window),e.setOptions({layoutScroll:!0}),Td.current=e}return Td.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Dd=ie({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`}),Od=ie({}),kd=ie(null);function Ad(e,t){if(gl(e)){let{initial:t,animate:n}=e;return{initial:t===!1||pl(t)?t:void 0,animate:pl(n)?n:void 0}}return e.inherit===!1?{}:t}function jd(e,t){let[n,r]=b(),[i,a]=b();return S(()=>{let n=Ad(e,t);r(n.initial),a(n.animate)}),{get initial(){return n()},get animate(){return i()}}}var Md=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Nd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Md.indexOf(e)>-1||/[A-Z]/u.test(e))}var Pd=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function Fd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Pd.has(e)}function Id(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(!Fd(i)||n===!0&&Fd(i)||!t&&!Fd(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var Ld=(e,t)=>t.isSVG??Nd(e)?new Hl(t):new Fl(t,{allowProjection:e!==`svg`}),Rd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zd(e){let t={};for(let n in e){let r=n.startsWith(`--`)?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,`-ms-`);t[r]=e[n]}return t}function Bd(e,t,n){for(let r in t)!Cs(t[r])&&!Ml(r,n)&&(e[r]=t[r])}function Vd({transformTemplate:e},t){let n=Rd();return Xs(n,t,e),{...n.vars,...n.style}}function Hd(e,t){let n=e.style||{},r={};return Bd(r,n,e),Object.assign(r,Vd(e,t)),r}function Ud(e,t){let n={},r=Hd(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=zd(r),n}var Wd=()=>({...Rd(),attrs:{}});function Gd(e,t,n){let r=Wd();tc(r,t,zl(n),e.transformTemplate,e.style);let i={...r.attrs,style:{...r.style}};if(e.style){let t={};Bd(t,e.style,e),i.style={...t,...i.style}}let a=t.pathLength,o=t.pathSpacing,s=t.pathOffset;if(a!==void 0){let e=o??1-Number(a);i.pathLength=1,i[`stroke-dasharray`]=`${a} ${e}`,i[`stroke-dashoffset`]=`${-Number(s??0)}`}return i.style=zd(i.style),i}function Kd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qd(n,r,i,e),renderState:t()}}function qd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Bu(a[e]);let{initial:o,animate:s}=e,c=gl(e),l=_l(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!fl(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=hs(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}function Jd(e,t,n,r){return Kd(e,t,n,r)}var Yd={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Xd=!1;function Zd(){if(Xd)return;let e={};for(let t in Yd)e[t]={isEnabled:e=>Yd[t].some(t=>!!e[t])};Tl(e),Xd=!0}function Qd(){return Zd(),El()}function $d(e){let t=Qd();for(let n in e)t[n]={...t[n],...e[n]};Tl(t)}var ef=class extends kl{constructor(e){super(e),e.animationState||=Gl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();fl(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState?.reset(),this.unmountControls?.()}},tf=0,nf={animation:{Feature:ef},exit:{Feature:class extends kl{constructor(){super(...arguments),this.id=tf++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function rf(e){return{point:{x:e.pageX,y:e.pageY}}}var af=e=>t=>{let n=t;Mc(n)&&e(n,rf(n))};function of(e,t,n,r){return Iu(e,t,af(n),r)}var sf=({current:e})=>e?e.ownerDocument.defaultView:null;function cf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}var lf=(e,t)=>Math.abs(e-t);function uf(e,t){let n=lf(e.x,t.x),r=lf(e.y,t.y);return Math.sqrt(n**2+r**2)}var df=new Set([`auto`,`scroll`]),ff=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.history=[],this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.removeListeners=()=>{},this.dragSnapToOrigin=!1,this.distanceThreshold=3,this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pf(this.lastRawMoveEventInfo,this.transformPagePoint));let e=hf(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=uf(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:wr.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=pf(t,this.transformPagePoint),this.hasPendingMove=!0,W.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=hf(e.type===`pointercancel`?this.lastMoveEventInfo:pf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Mc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=pf(rf(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=xr;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,hf(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Gn(of(this.contextWindow,`pointermove`,this.handlePointerMove,d),of(this.contextWindow,`pointerup`,this.handlePointerUp,d),of(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(df.has(e.overflowX)||df.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),W.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vi(this.updatePoint)}};function pf(e,t){return t?{point:t(e.point)}:e}function mf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hf({point:e},t){return{point:e,delta:mf(e,_f(t)),offset:mf(e,gf(t)),velocity:vf(t,.1)}}function gf(e){return e[0]}function _f(e){return e[e.length-1]}function vf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=_f(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Jn(t)*2&&(r=e[1]);let a=Yn(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?U(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?U(n,e,r.max):Math.min(e,n)),e}function bf(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function xf(e,{top:t,left:n,bottom:r,right:i}){return{x:bf(e.x,n,i),y:bf(e.y,t,r)}}function Sf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Cf(e,t){return{x:Sf(e.x,t.x),y:Sf(e.y,t.y)}}function wf(e,t){let n=.5,r=tu(e),i=tu(t);return i>r?n=Kn(t.min,t.max-r,e.min):r>i&&(n=Kn(e.min,e.max-i,t.min)),Rn(0,1,n)}function Tf(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Ef=.35;function Df(e=Ef){return e===!1?e=0:e===!0&&(e=Ef),{x:Of(e,`left`,`right`),y:Of(e,`top`,`bottom`)}}function Of(e,t,n){return{min:kf(e,t),max:kf(e,n)}}function kf(e,t){return typeof e==`number`?e:e[t]||0}var Af=new WeakMap,jf=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ul(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Dc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Cu(e=>{let t=this.getAxisMotionValue(e).get()||0;if(qr.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=tu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&W.update(()=>i(e,t),!1,!0),Ts(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Ff(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&W.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new ff(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:sf(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&W.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}dispose(){this.cancel(),this.stopAnimation(),Af.delete(this.visualElement)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Pf(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=yf(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&cf(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?xf(n.layoutBox,e):!1,this.elastic=Df(t),r!==this.constraints&&!cf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Cu(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Tf(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!cf(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Sc(n,r.root,this.visualElement.getTransformPagePoint()),a=Cf(r.layout.layoutBox,i);if(t){let e=t(rc(a));this.hasMutatedConstraints=!!e,e&&(a=nc(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Cu(o=>{if(!Pf(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ts(this.visualElement,e),n.start(us(e,n,0,t,this.visualElement,!1))}stopAnimation(){Cu(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Cu(e=>{if(!Pf(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-U(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!cf(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Cu(e=>{let t=this.getAxisMotionValue(e).get();i[e]=wf({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Cu(t=>{let n=this.getAxisMotionValue(t);if(!Pf(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(U(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Af.set(this.visualElement,this);let e=this.visualElement.current,t=of(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Ic(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();cf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Nf(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),W.read(r);let o=Iu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Cu(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{Vi(r),o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Ef,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Mf(e){let t=!0;return()=>{t?t=!1:e()}}function Nf(e,t,n){let r=rl(e,Mf(n)),i=rl(t,Mf(n));return()=>{r(),i()}}function Pf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ff(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var If=class extends kl{constructor(e){super(e),this.removeGroupControls=Wn,this.removeListeners=Wn,this.controls=new jf(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wn}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Lf=e=>(t,n)=>{e&&W.update(()=>e(t,n),!1,!0)},Rf=class extends kl{constructor(){super(...arguments),this.removePointerDownListener=Wn}onPointerDown(e){this.session=new ff(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sf(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lf(e),onStart:Lf(t),onMove:Lf(n),onEnd:(e,t)=>{delete this.session,r&&W.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=of(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};function zf(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&W.postRender(()=>i(t,rf(t)))}var Bf=class extends kl{mount(){let{current:e}=this.node;e&&(this.unmount=Ac(e,(e,t)=>(zf(this.node,t,`Start`),e=>zf(this.node,e,`End`))))}unmount(){}};function Vf(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&W.postRender(()=>i(t,rf(t)))}var Hf={drag:{Feature:class extends If{unmount(){this.controls.dispose(),super.unmount()}}},pan:{Feature:Rf},hover:{Feature:Bf},tap:{Feature:class extends kl{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Uc(e,(e,t)=>(Vf(this.node,t,`Start`),(e,{success:t})=>Vf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}}},focus:{Feature:class extends kl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Gn(Iu(this.node.current,`focus`,()=>this.onFocus()),Iu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}}}},Uf={...nf,...Hf};function Wf(e,t){!e.projection&&(t.drag||t.dragControls)&&(e.projection=new Ed(e.latestValues,e.parent?.projection),e.projection.setOptions({visualElement:e,alwaysMeasureLayout:!0,layout:!1,animationType:`both`}),e.current&&e.projection.mount(e.current))}var Gf=typeof window<`u`;function Kf(e,t,n,r){return Jd(e?{scrapeMotionValuesFromProps:Vl,createRenderState:Wd}:{scrapeMotionValuesFromProps:Nl,createRenderState:Rd},t,n,r)}function qf(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&$d(r);let a=n?n===`svg`:Nd(e);return function(n){let r=A(Dd),o=A(Od),s=A(kd),c=C(()=>s?{id:s.id(),isPresent:s.isPresent(),initial:s.initial(),custom:s.custom(),onExitComplete:s.onExitComplete,register:s.register??(()=>()=>{})}:null),l=C(()=>{let e={};for(let t in n)t!==`children`&&(e[t]=n[t]);return e}),u=C(()=>({...r,...l()})),d=C(()=>!!u().isStatic),f=jd(n,o),p=Kf(a,n,f,c()),m,h=c();!d()&&Gf&&(m=(i||Ld)(e,{visualState:p,parent:o.visualElement,props:u(),presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:r.reducedMotion,skipAnimations:r.skipAnimations,isSVG:a}),m&&Wf(m,u())),f.visualElement=m;let[g,_]=N(n,[`ref`,`children`]),v=C(()=>{let n=u(),r=Id(l(),typeof e==`string`,t);delete r.children,delete r.ref;let i=typeof e==`string`?e:`svg`,o=a?Gd(n,p.latestValues,i):Ud(n,p.latestValues);return{...r,...o}});D(()=>{m&&m.scheduleRenderMicrotask()});let y=!1;S(()=>{if(!m)return;let e=u(),t=c();if(m.update(e,t),Wf(m,e),m.updateFeatures(),m.current&&m.animationState){if(!y){y=!0;let{animate:n}=e;(e.initial===!1||t?.initial===!1)&&n&&typeof n!=`boolean`&&!fl(n)&&Ss(m,n)}m.animationState.animateChanges()}}),O(()=>{m?.unmount()});let b=e=>{if(!e)return;if(m?.mount(e),m&&o.visualElement){let e=o.visualElement;m.parent=e,typeof e.depth==`number`&&(m.depth=e.depth+1),m.isVariantNode&&!m.isControllingVariants&&(m.removeFromVariantTree?.(),typeof e.addVariantChild==`function`&&(m.removeFromVariantTree=e.addVariantChild(m)))}p.onMount?.(e);let t=g.ref;typeof t==`function`?t(e):t&&typeof t==`object`&&(t.current=e)};return j(Od.Provider,{value:f,get children(){return j(bt,M({component:e},v,{ref:b,get children(){return g.children}}))}})}}function Jf(e,t){return qf(e,t,Uf,Ld)}var Yf=new Map,Xf=new Proxy(Jf,{get:(e,t)=>{if(t===`create`)return Jf;if(typeof t!=`string`)return Reflect.get(e,t);let n=Yf.get(t);return n||(n=Jf(t),Yf.set(t,n)),n}});function Zf(e){let t=es(e),{isStatic:n}=A(Dd);if(n){let e=t.on(`change`,()=>{});O(()=>e())}return O(()=>t.destroy()),t}function Qf(e){return typeof e==`object`&&!Array.isArray(e)}function $f(e,t,n,r){return e==null?[]:typeof e==`string`&&Qf(t)?Ks(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ep(e,t,n){return e*(t+1)}function tp(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function np(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Ln(e,i),r--)}}function rp(e,t,n,r,i,a){np(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:U(i,a,r[o]),easing:gr(n,o)})}function ip(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function ap(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var op=`easeInOut`;function sp(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,tp(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=tp(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=up(e),{delay:l=0,times:u=ua(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Eo(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&pp(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Jn(b));let r=qi(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&la(u,T),c.length===1&&c.unshift(null),m){b=ep(b??a,m,_);let e=[...c],t=[...u];y=Array.isArray(y)?[...y]:[y];let n=[...y];for(let r=0;r<m;r++){c.push(...e);for(let i=0;i<e.length;i++)u.push(t[i]+(r+1)),y.push(i===0?`linear`:gr(n,i-1))}ip(u,m)}let E=w+(b??a);rp(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Cs(p)){let e=cp(p,s);_(m,h,lp(`default`,e))}else{let e=$f(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=cp(r,s);for(let e in m)_(m[e],dp(h,e),lp(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(ap);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Kn(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(op)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function cp(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function lp(e,t){return t[e]||(t[e]=[]),t[e]}function up(e){return Array.isArray(e)?e:[e]}function dp(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var fp=e=>typeof e==`number`,pp=e=>e.every(fp);function mp(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Ws(e)&&!al(e)?new Hl(t):new Fl(t);n.mount(e),dl.set(e,n)}function hp(e){let t=new Ll({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),dl.set(e,t)}function gp(e,t){return Cs(e)||typeof e==`number`||typeof e==`string`&&!Qf(t)}function _p(e,t,n,r){let i=[];if(gp(e,t))i.push(Fu(e,Qf(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=$f(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?mp:hp;dl.has(r)||s(r);let c=dl.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...js(c,{...t,transition:l},{}))}}return i}function vp(e,t,n){let r=[];return sp(e,t,n,{spring:aa}).forEach(({keyframes:e,transition:t},n)=>{r.push(..._p(n,e,t))}),r}function yp(e){return Array.isArray(e)&&e.some(Array.isArray)}function bp(e={}){let{scope:t,reduceMotion:n}=e;function r(e,r,i){let a=[],o;if(yp(e))a=vp(e,n===void 0?r:{reduceMotion:n,...r},t);else{let{onComplete:s,...c}=i||{};typeof s==`function`&&(o=s),a=_p(e,r,n===void 0?c:{reduceMotion:n,...c},t)}let s=new Jo(a);return o&&s.finished.then(o),t&&(t.animations.push(s),s.finished.then(()=>{Ln(t.animations,s)})),s}return r}var xp=bp(),Sp=L(`<div>`),Cp=L(`<button><span data-slot=segmented-control-v2-item-label>`),wp={type:`spring`,visualDuration:.15,bounce:0},Tp=ie();function Ep(){let e=A(Tp);if(!e)throw Error(`SegmentedControlItem must be used inside SegmentedControl`);return e}function Dp(e){return e!==null&&`offsetLeft`in e&&`offsetParent`in e}function Op(e,t){let n=0,r=t;for(;r&&r!==e;)n+=r.offsetLeft,r=Dp(r.offsetParent)?r.offsetParent:null;return r!==e&&(n=t.getBoundingClientRect().left-e.getBoundingClientRect().left),{x:n,width:t.offsetWidth}}function kp(e){let t=C(()=>Object.hasOwn(e,`value`)),[n,r]=N(M({allowDeselect:!1,disabled:!1},e),[`class`,`classList`,`children`,`value`,`defaultValue`,`onChange`,`allowDeselect`,`disabled`,`transition`,`ref`]),[i,a]=b(n.defaultValue??null),[o,s]=b(0),[c,l]=b(!1),u=C(()=>t()?n.value??null:i()),d=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0,f=Zf(0),p=Zf(0),m,h,g=new Map,_={x:0,width:0},v=null,y=e=>{let t=u(),r=t===null?void 0:g.get(t);if(!m||!r){l(!1);return}let i=Op(m,r);if(i.width===0)return;if(_=i,!c()||!e||d()){f.jump(i.x),p.jump(i.width),l(!0);return}let a=n.transition??wp;xp(f,i.x,a),xp(p,i.width,a)};D(()=>{`ResizeObserver`in globalThis&&(h=new ResizeObserver(()=>{let e=u(),t=e===null?void 0:g.get(e);if(!m||!t)return;let n=Op(m,t);n.width!==0&&(c()&&n.x===_.x&&n.width===_.width||y(!1))}),m&&h.observe(m),g.forEach(e=>h?.observe(e)),O(()=>h?.disconnect()))}),S(()=>{let e=u();o();let t=c()&&v!==null&&e!==null&&e!==v;v=e,y(t)});let x=e=>{t()||a(e),n.onChange?.(e)},w={selected:u,groupDisabled:()=>!!n.disabled,select:e=>{x(e)},clearIfAllowed:e=>{n.allowDeselect&&u()===e&&x(null)},focusNext:(e,t)=>{let n=e.closest(`[data-slot="segmented-control-v2"]`);if(!n)return;let r=Array.from(n.querySelectorAll(`button[data-slot="segmented-control-v2-item"]`)).filter(e=>!e.disabled);r[r.indexOf(e)+t]?.focus()},registerItem:(e,t)=>(g.set(e,t),h?.observe(t),s(e=>e+1),()=>{g.get(e)===t&&g.delete(e),h?.unobserve(t),s(e=>e+1)})},T=e=>{m=e;let t=n.ref;t instanceof Function&&t(e)};return j(Tp.Provider,{value:w,get children(){var e=Sp();return rt(T,e),nt(e,M(r,{role:`group`,"data-component":`segmented-control-v2`,"data-slot":`segmented-control-v2`,get"data-ready"(){return c()?``:void 0},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}),!1,!0),B(e,j(F,{get when(){return I(()=>!!c())()&&u()!==null},get children(){return j(Xf.span,{"data-slot":`segmented-control-v2-indicator`,"aria-hidden":`true`,style:{x:f,width:p}})}}),null),B(e,()=>n.children,null),e}})}function Ap(e,t){e instanceof Function?e(t):Array.isArray(e)&&e[0](e[1],t)}function jp(e){let[t,n]=N(M({disabled:!1},e),[`class`,`classList`,`children`,`value`,`disabled`,`onClick`,`onKeyDown`,`ref`]),r=Ep(),i;S(()=>{i&&O(r.registerItem(t.value,i))});let a=C(()=>r.selected()===t.value),o=C(()=>r.groupDisabled()||!!t.disabled),s=e=>{Ap(t.onClick,e),!(e.defaultPrevented||o())&&(a()?r.clearIfAllowed(t.value):r.select(t.value))},c=e=>{if(Ap(t.onKeyDown,e),e.defaultPrevented||o())return;let n=e.currentTarget,i=n.closest(`[data-slot="segmented-control-v2"]`)?.matches(`:dir(rtl)`)?-1:1;if(e.key===`ArrowRight`)e.preventDefault(),r.focusNext(n,i);else if(e.key===`ArrowLeft`)e.preventDefault(),r.focusNext(n,i===1?-1:1);else if(e.key===`Home`)e.preventDefault(),(n.closest(`[data-slot="segmented-control-v2"]`)?.querySelector(`button[data-slot="segmented-control-v2-item"]:not(:disabled)`))?.focus();else if(e.key===`End`){e.preventDefault();let t=n.closest(`[data-slot="segmented-control-v2"]`)?.querySelectorAll(`button[data-slot="segmented-control-v2-item"]:not(:disabled)`);(t?.[t.length-1])?.focus()}},l=e=>{i=e;let n=t.ref;n instanceof Function&&n(e)};return(()=>{var e=Cp(),r=e.firstChild;return rt(l,e),nt(e,M(n,{type:`button`,"data-slot":`segmented-control-v2-item`,get"data-pressed"(){return a()?``:void 0},get"aria-pressed"(){return a()},get disabled(){return o()},get classList(){return{...t.classList,[t.class??``]:!!t.class}},onClick:s,onKeyDown:c}),!1,!0),B(r,()=>t.children),e})()}function Mp(e){let[t,n]=b(e.defaultValue?.()),r=C(()=>e.value?.()!==void 0),i=C(()=>r()?e.value?.():t());return[i,t=>{T(()=>{let a=St(t,i());return Object.is(a,i())||(r()||n(a),e.onChange?.(a)),a})}]}function Np(e){let[t,n]=Mp(e);return[()=>t()??!1,n]}function Pp(e={}){let[t,n]=Np({value:()=>V(e.isSelected),defaultValue:()=>!!V(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{!V(e.isReadOnly)&&!V(e.isDisabled)&&n(t)},toggle:()=>{!V(e.isReadOnly)&&!V(e.isDisabled)&&n(!t())}}}function Fp(e){return t=>(e(t),()=>e(void 0))}var Ip=[`id`,`name`,`validationState`,`required`,`disabled`,`readOnly`];function Lp(e){let t=cn({id:`form-control-${Pe()}`},e),[n,r]=b(),[i,a]=b(),[o,s]=b(),[c,l]=b();return{formControlContext:{name:()=>V(t.name)??V(t.id),dataset:C(()=>({"data-valid":V(t.validationState)===`valid`?``:void 0,"data-invalid":V(t.validationState)===`invalid`?``:void 0,"data-required":V(t.required)?``:void 0,"data-disabled":V(t.disabled)?``:void 0,"data-readonly":V(t.readOnly)?``:void 0})),validationState:()=>V(t.validationState),isRequired:()=>V(t.required),isDisabled:()=>V(t.disabled),isReadOnly:()=>V(t.readOnly),labelId:n,fieldId:i,descriptionId:o,errorMessageId:c,getAriaLabelledBy:(e,t,r)=>{let i=r!=null||n()!=null;return[r,n(),i&&t!=null?e:void 0].filter(Boolean).join(` `)||void 0},getAriaDescribedBy:e=>[o(),c(),e].filter(Boolean).join(` `)||void 0,generateId:jt(()=>V(t.id)),registerLabel:Fp(r),registerField:Fp(a),registerDescription:Fp(s),registerErrorMessage:Fp(l)}}}var Rp=ie();function zp(){let e=A(Rp);if(e===void 0)throw Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Bp(e){let t=zp(),n=cn({id:t.generateId(`description`)},e);return S(()=>O(t.registerDescription(n.id))),j(hn,M({as:`div`},()=>t.dataset(),n))}var Vp=[`id`,`aria-label`,`aria-labelledby`,`aria-describedby`];function Hp(e){let t=zp(),n=cn({id:t.generateId(`field`)},e);return x(()=>O(t.registerField(V(n.id)))),{fieldProps:{id:()=>V(n.id),ariaLabel:()=>V(n[`aria-label`]),ariaLabelledBy:()=>t.getAriaLabelledBy(V(n.id),V(n[`aria-label`]),V(n[`aria-labelledby`])),ariaDescribedBy:()=>t.getAriaDescribedBy(V(n[`aria-describedby`]))}}}function Up(e){let t,n=zp(),[r,i]=N(cn({id:n.generateId(`label`)},e),[`ref`]),a=pn(()=>t,()=>`label`);return S(()=>O(n.registerLabel(i.id))),j(hn,M({as:`label`,ref(e){var n=Dt(e=>t=e,r.ref);typeof n==`function`&&n(e)},get for(){return I(()=>a()===`label`)()?n.fieldId():void 0}},()=>n.dataset(),i))}function Wp(e,t){S(E(e,e=>{if(e==null)return;let n=Gp(e);n!=null&&(n.addEventListener(`reset`,t,{passive:!0}),O(()=>{n.removeEventListener(`reset`,t)}))}))}function Gp(e){return Kp(e)?e.form:e.closest(`form`)}function Kp(e){return e.matches(`textarea, input, select, button`)}function qp(e){let t=zp(),[n,r]=N(cn({id:t.generateId(`error-message`)},e),[`forceMount`]),i=()=>t.validationState()===`invalid`;return S(()=>{i()&&O(t.registerErrorMessage(r.id))}),j(F,{get when(){return n.forceMount||i()},get children(){return j(hn,M({as:`div`},()=>t.dataset(),r))}})}_n({},{Control:()=>Xp,Description:()=>Zp,ErrorMessage:()=>Qp,Input:()=>$p,Label:()=>em,Root:()=>tm,Switch:()=>im,Thumb:()=>rm,useSwitchContext:()=>Yp});var Jp=ie();function Yp(){let e=A(Jp);if(e===void 0)throw Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function Xp(e){let t=zp(),n=Yp(),[r,i]=N(cn({id:n.generateId(`control`)},e),[`onClick`,`onKeyDown`]);return j(hn,M({as:`div`,onClick:e=>{Bt(e,r.onClick),n.toggle(),n.inputRef()?.focus({preventScroll:!0})},onKeyDown:e=>{Bt(e,r.onKeyDown),e.key===Lt.Space&&(n.toggle(),n.inputRef()?.focus({preventScroll:!0}))}},()=>t.dataset(),()=>n.dataset(),i))}function Zp(e){let t=Yp();return j(Bp,M(()=>t.dataset(),e))}function Qp(e){let t=Yp();return j(qp,M(()=>t.dataset(),e))}function $p(e){let t=zp(),n=Yp(),[r,i,a]=N(cn({id:n.generateId(`input`)},e),[`ref`,`style`,`onChange`,`onFocus`,`onBlur`],Vp),{fieldProps:o}=Hp(i);return j(hn,M({as:`input`,ref(e){var t=Dt(n.setInputRef,r.ref);typeof t==`function`&&t(e)},type:`checkbox`,role:`switch`,get id(){return o.id()},get name(){return t.name()},get value(){return n.value()},get checked(){return n.checked()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Et({...fn},r.style)},get"aria-checked"(){return n.checked()},get"aria-label"(){return o.ariaLabel()},get"aria-labelledby"(){return o.ariaLabelledBy()},get"aria-describedby"(){return o.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()===`invalid`||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},onChange:e=>{Bt(e,r.onChange),e.stopPropagation();let t=e.target;n.setIsChecked(t.checked),t.checked=n.checked()},onFocus:e=>{Bt(e,r.onFocus),n.setIsFocused(!0)},onBlur:e=>{Bt(e,r.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),a))}function em(e){let t=Yp();return j(Up,M(()=>t.dataset(),e))}function tm(e){let t,[n,r,i]=N(cn({value:`on`,id:`switch-${Pe()}`},e),[`ref`,`children`,`value`,`checked`,`defaultChecked`,`onChange`,`onPointerDown`],Ip),[a,o]=b(),[s,c]=b(!1),{formControlContext:l}=Lp(r),u=Pp({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>l.isDisabled(),isReadOnly:()=>l.isReadOnly()});Wp(()=>t,()=>u.setIsSelected(n.defaultChecked??!1));let d=e=>{Bt(e,n.onPointerDown),s()&&e.preventDefault()},f=C(()=>({"data-checked":u.isSelected()?``:void 0})),p={value:()=>n.value,dataset:f,checked:()=>u.isSelected(),inputRef:a,generateId:jt(()=>V(r.id)),toggle:()=>u.toggle(),setIsChecked:e=>u.setIsSelected(e),setIsFocused:c,setInputRef:o};return j(Rp.Provider,{value:l,get children(){return j(Jp.Provider,{value:p,get children(){return j(hn,M({as:`div`,ref(e){var r=Dt(e=>t=e,n.ref);typeof r==`function`&&r(e)},role:`group`,get id(){return V(r.id)},onPointerDown:d},()=>l.dataset(),f,i,{get children(){return j(nm,{state:p,get children(){return n.children}})}}))}})}})}function nm(e){return I(ae(()=>{let t=e.children;return At(t)?t(e.state):t}))}function rm(e){let t=zp(),n=Yp();return j(hn,M({as:`div`},()=>t.dataset(),()=>n.dataset(),cn({id:n.generateId(`thumb`)},e)))}var im=Object.assign(tm,{Control:Xp,Description:Zp,ErrorMessage:Qp,Input:$p,Label:em,Thumb:rm});function am(e){let[t,n]=N(e,[`children`,`class`,`appearance`,`hideLabel`,`description`]);return j(tm,M(n,{get class(){return t.class},"data-component":`switch`,get"data-appearance"(){return t.appearance??`compact`},get children(){return[j($p,{"data-slot":`switch-input`}),j(F,{get when(){return t.children},children:e=>j(em,{"data-slot":`switch-label`,get classList(){return{"sr-only":t.hideLabel}},get children(){return e()}})}),j(F,{get when(){return t.description},get children(){return j(Zp,{"data-slot":`switch-description`,get children(){return t.description}})}}),j(Xp,{"data-slot":`switch-control`,get children(){return j(rm,{"data-slot":`switch-thumb`})}}),j(Qp,{"data-slot":`switch-error`})]}}))}var om=new Set([`Avst`,`Arab`,`Armi`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),sm=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function cm(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script??``;return om.has(t)}let t=e.split(`-`)[0];return sm.has(t)}function lm(e){return cm(e)?`rtl`:`ltr`}function um(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:lm(e)}}var dm=um(),fm=new Set;function pm(){dm=um();for(let e of fm)e(dm)}function mm(){let[e,t]=b(dm),n=C(()=>e());return D(()=>{fm.size===0&&window.addEventListener(`languagechange`,pm),fm.add(t),O(()=>{fm.delete(t),fm.size===0&&window.removeEventListener(`languagechange`,pm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var hm=ie();function gm(){let e=mm();return A(hm)||e}var _m={"ui.sessionReview.title":`Session changes`,"ui.sessionReview.title.git":`Git changes`,"ui.sessionReview.title.branch":`Branch changes`,"ui.sessionReview.title.lastTurn":`Last turn changes`,"ui.sessionReview.diffStyle.unified":`Unified`,"ui.sessionReview.diffStyle.split":`Split`,"ui.sessionReview.expandAll":`Expand all`,"ui.sessionReview.collapseAll":`Collapse all`,"ui.sessionReview.change.added":`Added`,"ui.sessionReview.change.removed":`Removed`,"ui.sessionReview.change.modified":`Modified`,"ui.sessionReview.image.loading":`Loading…`,"ui.sessionReview.image.placeholder":`Image`,"ui.sessionReview.largeDiff.title":`Diff too large to render`,"ui.sessionReview.largeDiff.meta":`Limit: {{limit}} changed lines. Current: {{current}} changed lines.`,"ui.sessionReview.largeDiff.renderAnyway":`Render anyway`,"ui.sessionReviewV2.expandMode":`Expand or collapse diff`,"ui.sessionReviewV2.filterFiles":`Filter files`,"ui.sessionReviewV2.toggleSidebar":`Toggle file tree`,"ui.sessionReviewV2.showAllLines":`Show all lines`,"ui.sessionReviewV2.hideNonDiffLines":`Hide non-diff lines`,"ui.sessionReviewV2.unifiedDiff":`Unified diff`,"ui.sessionReviewV2.splitDiff":`Split diff`,"ui.sessionReviewV2.previousFile":`Previous file`,"ui.sessionReviewV2.nextFile":`Next file`,"ui.sessionReviewV2.diffView":`Diff view`,"ui.sessionReviewV2.empty.noGit.title":`No tracked changes`,"ui.sessionReviewV2.empty.noGit.description":`Track, review, and undo changes in this project`,"ui.sessionReviewV2.empty.noGit.action":`Create Git repository`,"ui.sessionReviewV2.empty.noGit.actionLoading":`Creating Git repository…`,"ui.sessionReviewV2.empty.changes.title":`No file changes yet`,"ui.sessionReviewV2.empty.changes.description":`Project changes will appear here`,"ui.sessionReview.openFile":`Open file`,"ui.sessionReview.selection.line":`line {{line}}`,"ui.sessionReview.selection.lines":`lines {{start}}-{{end}}`,"ui.fileMedia.kind.image":`image`,"ui.fileMedia.kind.audio":`audio`,"ui.fileMedia.state.removed":`Removed {{kind}} file.`,"ui.fileMedia.state.loading":`Loading {{kind}}…`,"ui.fileMedia.state.error":`Unable to load {{kind}}.`,"ui.fileMedia.state.unavailable":`{{kind}} preview unavailable.`,"ui.fileMedia.binary.title":`Binary file`,"ui.fileMedia.binary.description.path":`{{path}} is binary.`,"ui.fileMedia.binary.description.default":`Binary content`,"ui.lineComment.label.prefix":`Comment on `,"ui.lineComment.label.suffix":``,"ui.lineComment.editorLabel.prefix":`Commenting on `,"ui.lineComment.editorLabel.suffix":``,"ui.lineComment.placeholder":`Add comment`,"ui.lineComment.contextPlaceholder":`Add context for this change`,"ui.lineComment.submit":`Comment`,"ui.lineComment.cancel":`Cancel`,"ui.sessionTurn.steps.show":`Show steps`,"ui.sessionTurn.steps.hide":`Hide steps`,"ui.sessionTurn.summary.response":`Response`,"ui.sessionTurn.diff.showMore":`Show more changes ({{count}})`,"ui.sessionTurn.diffs.changed.one":`{{count}} Changed file`,"ui.sessionTurn.diffs.changed.other":`{{count}} Changed files`,"ui.sessionTurn.diffs.showAll":`Show all`,"ui.sessionTurn.diffs.showLess":`Show less`,"ui.sessionTurn.diffs.more":`+{{count}} more files`,"ui.sessionTurn.retry.retrying":`retrying`,"ui.sessionTurn.retry.inSeconds":`in {{seconds}}s`,"ui.sessionTurn.retry.attempt":`attempt #{{attempt}}`,"ui.sessionTurn.retry.attemptLine":`{{line}} - attempt #{{attempt}}`,"ui.sessionTurn.retry.attemptLabel":`Attempt {{attempt}}`,"ui.sessionTurn.retry.attemptRetrying":`Attempt {{attempt}} - {{line}}`,"ui.sessionTurn.retry.attemptWaiting.one":`Attempt {{attempt}} - retrying in {{count}}s`,"ui.sessionTurn.retry.attemptWaiting.other":`Attempt {{attempt}} - retrying in {{count}}s`,"ui.sessionTurn.retry.attemptRetryingNow":`Attempt {{attempt}} - retrying`,"ui.sessionTurn.retry.geminiHot":`gemini is way too hot right now`,"ui.sessionTurn.error.freeUsageExceeded":`Free usage exceeded`,"ui.sessionTurn.error.addCredits":`Add credits`,"dialog.usageExceeded.freeTier.title":`Free limit reached`,"dialog.usageExceeded.freeTier.description":`Subscribe to OpenCode Go for reliable access to the best open-source models for $10/month.`,"dialog.usageExceeded.freeTier.actionLabel":`Subscribe`,"dialog.usageExceeded.accountRateLimit.title":`Go limit reached`,"dialog.usageExceeded.accountRateLimit.description":`Usage limit reached. To continue using this model now, enable usage from your available balance`,"dialog.usageExceeded.accountRateLimit.actionLabel":`Open settings`,"ui.sessionTurn.status.delegating":`Delegating work`,"ui.sessionTurn.status.planning":`Planning next steps`,"ui.sessionTurn.status.gatheringContext":`Exploring`,"ui.sessionTurn.status.gatheredContext":`Explored`,"ui.sessionTurn.status.searchingCodebase":`Searching the codebase`,"ui.sessionTurn.status.searchingWeb":`Searching the web`,"ui.sessionTurn.status.makingEdits":`Making edits`,"ui.sessionTurn.status.runningCommands":`Running commands`,"ui.sessionTurn.status.thinking":`Thinking`,"ui.sessionTurn.status.thinkingWithTopic":`Thinking - {{topic}}`,"ui.sessionTurn.status.gatheringThoughts":`Gathering thoughts`,"ui.sessionTurn.status.consideringNextSteps":`Considering next steps`,"ui.messagePart.diagnostic.error":`Error`,"ui.messagePart.title.edit":`Edit`,"ui.messagePart.title.write":`Write`,"ui.messagePart.option.typeOwnAnswer":`Type your own answer`,"ui.messagePart.review.title":`Review your answers`,"ui.messagePart.questions.dismissed":`Questions dismissed`,"ui.messagePart.compaction":`Session compacted`,"ui.messagePart.compaction.started":`Session compaction started`,"ui.messagePart.compaction.queued":`Session compaction queued`,"ui.messagePart.compaction.running":`Compacting`,"ui.messagePart.compaction.failed":`Session compaction failed`,"ui.messagePart.compaction.cancelled":`Session compaction cancelled`,"ui.messagePart.compaction.interrupted":`Session compaction interrupted`,"ui.messagePart.providerCompaction":`Session compacted by provider`,"ui.messagePart.compaction.usage":`{{input}} in · {{output}} out`,"ui.messagePart.context.updates":`Updates`,"ui.messagePart.context.read.one":`{{count}} read`,"ui.messagePart.context.read.other":`{{count}} reads`,"ui.messagePart.context.search.one":`{{count}} search`,"ui.messagePart.context.search.other":`{{count}} searches`,"ui.messagePart.context.list.one":`{{count}} list`,"ui.messagePart.context.list.other":`{{count}} lists`,"ui.messagePart.context.notice.one":`{{count}} Notice`,"ui.messagePart.context.notice.other":`{{count}} Notices`,"ui.messagePart.context.thought.one":`Thought`,"ui.messagePart.context.thought.other":`Thoughts`,"ui.messagePart.context.match.one":`({{count}} match)`,"ui.messagePart.context.match.other":`({{count}} matches)`,"ui.messagePart.tools.used.one":`Used {{count}} {{tools}}`,"ui.messagePart.tools.used.other":`Used {{count}} {{tools}}`,"ui.list.loading":`Loading`,"ui.list.empty":`No results`,"ui.list.clearFilter":`Clear filter`,"ui.list.emptyWithFilter.prefix":`No results for`,"ui.list.emptyWithFilter.suffix":``,"ui.fileSearch.placeholder":`Find`,"ui.fileSearch.previousMatch":`Previous match`,"ui.fileSearch.nextMatch":`Next match`,"ui.fileSearch.close":`Close search`,"ui.messageNav.newMessage":`New message`,"ui.promptInput.noMatchingItems":`No matching items`,"ui.promptInput.commands":`Commands`,"ui.promptInput.dropFiles":`Drop files to add`,"ui.promptInput.dropFiles.image":`Drop images or files to add`,"ui.promptInput.dropFiles.pdf":`Drop PDFs or files to add`,"ui.promptInput.dropFiles.imagePdf":`Drop images, PDFs, or files to add`,"ui.promptInput.removeAttachment":`Remove attachment`,"ui.promptInput.cancelUpload":`Cancel upload`,"ui.promptInput.uploading":`{{percent}}%`,"ui.promptInput.label":`Prompt`,"ui.promptInput.placeholder.shell":`Enter shell command…`,"ui.promptInput.placeholder.normal":`Ask anything, {{slash}} for commands, {{at}} for context…`,"ui.promptInput.placeholder.followUp":`Add follow-up, {{slash}} for commands, {{at}} for context…`,"ui.promptInput.add":`Add images and files`,"ui.promptInput.attachments":`Images and files`,"ui.promptInput.context":`Context`,"ui.promptInput.shell":`Shell command`,"ui.promptInput.chooseAgent":`Choose agent`,"ui.promptInput.chooseModel":`Choose model`,"ui.promptInput.chooseVariant":`Choose model variant`,"ui.promptInput.send":`Send`,"ui.promptInput.stop":`Stop`,"ui.promptInput.exitShell":`Exit`,"ui.promptInput.steer":`Steer`,"ui.promptInput.queue":`Queue`,"ui.promptInput.steerHint":`Send without interrupting`,"ui.tabs.close":`Close tab`,"ui.textField.copyToClipboard":`Copy to clipboard`,"ui.textField.copyLink":`Copy link`,"ui.textField.copied":`Copied`,"ui.imagePreview.alt":`Image preview`,"ui.scrollView.ariaLabel":`scrollable content`,"ui.tool.read":`Read`,"ui.tool.loaded":`Loaded`,"ui.tool.loadedFile":`Loaded {{path}}`,"ui.tool.loadedSkill":`Loaded {{name}} skill`,"ui.tool.loadedSkills.one":`Loaded {{name}} skill`,"ui.tool.loadedSkills.other":`Loaded {{name}} skills`,"ui.tool.list":`List`,"ui.tool.glob":`Glob`,"ui.tool.grep":`Grep`,"ui.tool.task":`Task`,"ui.tool.browser":`Browser`,"ui.tool.webfetch":`Webfetch`,"ui.tool.websearch":`Web Search`,"ui.tool.websearch.provider":`{{provider}} Web Search`,"ui.tool.shell":`Shell`,"ui.tool.shell.writingCommand":`Writing command…`,"ui.tool.shell.exit":`Command exited with code {{code}}`,"ui.tool.shell.timeout":`Command timed out`,"ui.tool.shell.cancelled":`Command cancelled`,"ui.tool.execute":`Execute`,"ui.tool.patch":`Patch`,"ui.tool.questions":`Questions`,"ui.tool.questions.numbered":`Questions {{number}}`,"ui.tool.agent":`{{type}} Agent`,"ui.tool.agent.default":`Agent`,"ui.tool.agent.delegating":`Delegating agent…`,"ui.tool.skill":`Skill`,"ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":`Failed`,"ui.toolErrorCard.copyError":`Copy error`,"ui.common.file.one":`file`,"ui.common.file.other":`files`,"ui.common.fileCount.one":`{{count}} file`,"ui.common.fileCount.other":`{{count}} files`,"ui.common.question.one":`question`,"ui.common.question.other":`questions`,"ui.common.add":`Add`,"ui.common.clear":`Clear`,"ui.common.file":`File`,"ui.common.back":`Back`,"ui.common.cancel":`Cancel`,"ui.common.confirm":`Confirm`,"ui.common.dismiss":`Dismiss`,"ui.common.close":`Close`,"ui.common.next":`Next`,"ui.common.submit":`Submit`,"ui.common.showMore":`Show more`,"ui.common.moreCount.one":`+{{count}} more`,"ui.common.moreCount.other":`+{{count}} more`,"ui.permission.deny":`Deny`,"ui.permission.allowAlways":`Allow always`,"ui.permission.allowOnce":`Allow once`,"ui.message.expand":`Expand message`,"ui.message.collapse":`Collapse message`,"ui.message.copy":`Copy`,"ui.message.copyMessage":`Copy message`,"ui.message.copyFullMessage":`Copy full message`,"ui.message.forkMessage":`Fork to new session`,"ui.message.revertMessage":`Revert message`,"ui.message.moveToQueue":`Move to queue`,"ui.message.pending":`Pending`,"ui.message.voice":`Voice`,"ui.message.deletePending":`Delete`,"ui.message.copyResponse":`Copy response`,"ui.message.copied":`Copied`,"ui.message.thought":`Thought`,"ui.message.duration.seconds":`{{count}}s`,"ui.message.duration.minutesSeconds":`{{minutes}}m {{seconds}}s`,"ui.message.interrupted":`Interrupted`,"ui.message.modelVariant":`{{model}} ({{variant}})`,"ui.sessionTimeline.notice.model":`Model`,"ui.sessionTimeline.notice.modelSwitched":`Switched to {{model}}`,"ui.sessionTimeline.notice.variantSwitched":`Switched variant to {{variant}}`,"ui.sessionTimeline.notice.variantDefault":`Switched variant to Default`,"ui.sessionTimeline.notice.agentChanged":`Agent changed`,"ui.sessionTimeline.notice.movedTo":`Moved to`,"ui.sessionTimeline.notice.movedTooltip":`Session working directory changed`,"ui.sessionTimeline.notice.failed":`{{actor}} failed`,"ui.sessionTimeline.notice.cancelled":`{{actor}} cancelled`,"ui.sessionTimeline.notice.finished":`{{actor}} finished`,"ui.sessionTimeline.notice.instructionsUpdated":`Instructions updated`,"ui.sessionTimeline.notice.restart":`Continuing after restart`,"ui.message.queued":`Queued`,"ui.message.attachment.alt":`attachment`,"ui.patch.action.deleted":`Deleted`,"ui.patch.action.created":`Created`,"ui.patch.action.moved":`Moved`,"ui.patch.action.patched":`Patched`,"ui.question.subtitle.answered":`{{count}} answered`,"ui.question.answer.none":`(no answer)`,"ui.question.review.notAnswered":`(not answered)`,"ui.question.multiHint":`Select all answers that apply`,"ui.question.singleHint":`Select one answer`,"ui.question.custom.placeholder":`Type your answer…`,"ui.question.custom.answerPlaceholder":`Type your own answer…`},vm=new Map;function ym(e,t){let n=vm.get(e);if(n)return n.select(t);let r=new Intl.PluralRules(e);return vm.size>=32&&vm.delete(vm.keys().next().value),vm.set(e,r),r.select(t)}function bm(e,t){return`${e}.${t}`}function xm(e,t,n){if(t<=0||t>=n)return``;let r=new Intl.ListFormat(e,{style:`long`,type:`conjunction`}).formatToParts(Array.from({length:n},(e,t)=>String(t))),i=r.findIndex(e=>e.type===`element`&&e.value===String(t)),a=r.findLastIndex((e,n)=>n<i&&e.type===`element`&&e.value===String(t-1));return r.slice(a+1,i).map(e=>e.value).join(``)}function Sm(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(e,n)=>{let r=t[String(n)];return r===void 0?``:String(r)}):e}function Cm(e){return{...e,tDynamic:(t,n,r)=>e.locale().toLowerCase().split(`-`)[0]===`en`?Sm(n,r):e.t(t,r),list:t=>e.locale().toLowerCase().split(`-`)[0]===`en`?t.join(`, `):new Intl.ListFormat(e.locale(),{style:`long`,type:`conjunction`}).format(t),listSeparator:(t,n)=>e.locale().toLowerCase().split(`-`)[0]===`en`?t>0&&t<n?`,`:``:xm(e.locale(),t,n)}}var wm=Cm({locale:()=>`en`,t:(e,t)=>Sm(_m[e]??String(e),t),plural:(e,t,n)=>wm.pluralForm(e,ym(wm.locale(),t),{...n,count:t}),pluralForm:(e,t,n)=>{let r=_m;return Sm(r[bm(e,t)]??r[`${e}.other`]??`${e}.other`,n)}}),Tm=ie(wm);function Em(){return A(Tm)}var Dm=L(`<span data-slot=text-input-v2-leading-icon>`),Om=L(`<button type=button data-slot=text-input-v2-icon-button>`),km=L(`<div data-component=text-input-v2><div data-slot=text-input-v2-value><input>`);function Am(e){let t=Em(),[n,r]=N(e,[`class`,`classList`,`leadingIcon`,`showCopyButton`,`showClearButton`,`clearIcon`,`copyLabel`,`clearLabel`,`onCopyClick`,`onClearClick`,`numeric`,`invalid`,`appearance`,`disabled`]);return(()=>{var e=km(),i=e.firstChild,a=i.firstChild;return B(i,j(F,{get when(){return n.leadingIcon},get children(){var e=Dm();return B(e,()=>n.leadingIcon),e}}),a),nt(a,M(r,{get type(){return r.type??`text`},get disabled(){return n.disabled},get"aria-invalid"(){return n.invalid?!0:void 0},"data-slot":`text-input-v2-input`}),!1,!1),B(e,j(F,{get when(){return n.showClearButton||n.showCopyButton},get children(){var e=Om();return e.$$click=e=>{n.showClearButton?n.onClearClick?.(e):n.onCopyClick?.(e)},e.$$mousedown=e=>{n.showClearButton&&e.preventDefault()},B(e,j(Pn,{get name(){return I(()=>!!n.showClearButton)()?n.clearIcon??`xmark-small`:`copy`}})),x(r=>{var i=n.showClearButton?`clear`:`copy`,a=n.showClearButton?n.clearLabel??t.t(`ui.common.clear`):n.copyLabel??t.t(`ui.message.copy`),o=n.disabled;return i!==r.e&&R(e,`data-variant`,r.e=i),a!==r.t&&R(e,`aria-label`,r.t=a),o!==r.a&&(e.disabled=r.a=o),r},{e:void 0,t:void 0,a:void 0}),e}}),null),x(t=>{var r=n.disabled?``:void 0,i=n.invalid?``:void 0,a=n.numeric?``:void 0,o=n.appearance??`base`,s=n.leadingIcon?``:void 0,c={...n.classList,[n.class??``]:!!n.class};return r!==t.e&&R(e,`data-disabled`,t.e=r),i!==t.t&&R(e,`data-invalid`,t.t=i),a!==t.a&&R(e,`data-numeric`,t.a=a),o!==t.o&&R(e,`data-appearance`,t.o=o),s!==t.i&&R(e,`data-leading-icon`,t.i=s),t.n=et(e,c,t.n),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})()}Ye([`mousedown`,`click`]);var jm=[`top`,`right`,`bottom`,`left`],Mm=Math.min,Nm=Math.max,Pm=Math.round,Fm=Math.floor,Im=e=>({x:e,y:e}),Lm={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Rm(e,t,n){return Nm(e,Mm(t,n))}function zm(e,t){return typeof e==`function`?e(t):e}function Bm(e){return e.split(`-`)[0]}function Vm(e){return e.split(`-`)[1]}function Hm(e){return e===`x`?`y`:`x`}function Um(e){return e===`y`?`height`:`width`}function Wm(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Gm(e){return Hm(Wm(e))}function Km(e,t,n){n===void 0&&(n=!1);let r=Vm(e),i=Gm(e),a=Um(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=th(o)),[o,th(o)]}function qm(e){let t=th(e);return[Jm(e),t,Jm(t)]}function Jm(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ym=[`left`,`right`],Xm=[`right`,`left`],Zm=[`top`,`bottom`],Qm=[`bottom`,`top`];function $m(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xm:Ym:t?Ym:Xm;case`left`:case`right`:return t?Zm:Qm;default:return[]}}function eh(e,t,n,r){let i=Vm(e),a=$m(Bm(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jm)))),a}function th(e){let t=Bm(e);return Lm[t]+e.slice(t.length)}function nh(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rh(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nh(e)}function ih(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ah(e,t,n){let{reference:r,floating:i}=e,a=Wm(t),o=Gm(t),s=Um(o),c=Bm(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vm(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function oh(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zm(t,e),p=rh(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ih(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ih(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var sh=50,ch=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:oh},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ah(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<sh&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ah(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lh=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zm(e,t)||{};if(l==null)return{};let d=rh(u),f={x:n,y:r},p=Gm(i),m=Um(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Mm(d[_],T),D=Mm(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Rm(E,k,O),te=!c.arrow&&Vm(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ne=te?k<E?k-E:k-O:0;return{[p]:f[p]+ne,data:{[p]:ee,centerOffset:k-ee-ne,...te&&{alignmentOffset:ne}},reset:te}}}),uh=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zm(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bm(r),_=Wm(o),v=Bm(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[th(o)]:qm(o)),x=p!==`none`;!d&&x&&b.push(...eh(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Km(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wm(t)||T.every(e=>Wm(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wm(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function dh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fh(e){return jm.some(t=>e[t]>=0)}var ph=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=zm(e,t);switch(i){case`referenceHidden`:{let e=dh(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fh(e)}}}case`escaped`:{let e=dh(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fh(e)}}}default:return{}}}}},mh=new Set([`left`,`top`]);async function hh(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bm(n),s=Vm(n),c=Wm(n)===`y`,l=mh.has(o)?-1:1,u=a&&c?-1:1,d=zm(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gh=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hh(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_h=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zm(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wm(i),p=Hm(f),m=u[p],h=u[f],g=(e,t)=>Rm(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vh=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zm(e,t),c=await i.detectOverflow(t,s),l=Bm(n),u=Vm(n),d=Wm(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Mm(p-c[m],g),y=Mm(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Nm(c.left,c.right):S=p-2*Nm(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function yh(){return typeof window<`u`}function bh(e){return Ch(e)?(e.nodeName||``).toLowerCase():`#document`}function xh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sh(e){return((Ch(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ch(e){return yh()?e instanceof Node||e instanceof xh(e).Node:!1}function wh(e){return yh()?e instanceof Element||e instanceof xh(e).Element:!1}function Th(e){return yh()?e instanceof HTMLElement||e instanceof xh(e).HTMLElement:!1}function Eh(e){return!yh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xh(e).ShadowRoot}function Dh(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Rh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Oh(e){return/^(table|td|th)$/.test(bh(e))}function kh(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ah=/transform|translate|scale|rotate|perspective|filter/,jh=/paint|layout|strict|content/,Mh=e=>!!e&&e!==`none`,Nh;function Ph(e){let t=wh(e)?Rh(e):e;return Mh(t.transform)||Mh(t.translate)||Mh(t.scale)||Mh(t.rotate)||Mh(t.perspective)||!Ih()&&(Mh(t.backdropFilter)||Mh(t.filter))||Ah.test(t.willChange||``)||jh.test(t.contain||``)}function Fh(e){let t=Bh(e);for(;Th(t)&&!Lh(t);){if(Ph(t))return t;if(kh(t))return null;t=Bh(t)}return null}function Ih(){return Nh??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Nh}function Lh(e){return/^(html|body|#document)$/.test(bh(e))}function Rh(e){return xh(e).getComputedStyle(e)}function zh(e){return wh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bh(e){if(bh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Eh(e)&&e.host||Sh(e);return Eh(t)?t.host:t}function Vh(e){let t=Bh(e);return Lh(t)?(e.ownerDocument||e).body:Th(t)&&Dh(t)?t:Vh(t)}function Hh(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vh(e),i=r===e.ownerDocument?.body,a=xh(r);if(i){let e=Uh(a);return t.concat(a,a.visualViewport||[],Dh(r)?r:[],e&&n?Hh(e):[])}return t.concat(r,Hh(r,[],n))}function Uh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wh(e){let t=Rh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Th(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pm(n)!==a||Pm(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Gh(e){return wh(e)?e:e.contextElement}function Kh(e){let t=Gh(e);if(!Th(t))return Im(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Wh(t),o=(a?Pm(n.width):n.width)/r,s=(a?Pm(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qh=Im(0);function Jh(e){let t=xh(e);return!Ih()||!t.visualViewport?qh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yh(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===xh(e)}function Xh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Gh(e),o=Im(1);t&&(r?wh(r)&&(o=Kh(r)):o=Kh(e));let s=Yh(a,n,r)?Jh(a):Im(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=xh(a),t=wh(r)?xh(r):r,n=e,i=Uh(n);for(;i&&t!==n;){let e=Kh(i),t=i.getBoundingClientRect(),r=Rh(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=xh(i),i=Uh(n)}}return ih({width:u,height:d,x:c,y:l})}function Zh(e,t){let n=zh(e).scrollLeft;return t?t.left+n:Xh(Sh(e)).left+n}function Qh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Zh(e,n),y:n.top+t.scrollTop}}function $h(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Sh(r),s=t?kh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Im(1),u=Im(0),d=Th(r);if((d||!a)&&((bh(r)!==`body`||Dh(o))&&(c=zh(r)),d)){let e=Xh(r);l=Kh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qh(o,c):Im(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function eg(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tg(e){let t=zh(e),n=e.ownerDocument.body,r=Nm(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Nm(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Zh(e),o=-t.scrollTop;return Rh(n).direction===`rtl`&&(a+=Nm(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ng=25;function rg(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=xh(e),a=Sh(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ih()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Zh(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ng&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ig(e,t){let n=Xh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Kh(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ag(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=rg(e,n,t);else if(t===`document`)r=tg(Sh(e));else if(wh(t))r=ig(t,n);else{let n=Jh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ih(r)}function og(e,t){let n=t.get(e);if(n)return n;let r=Hh(e,[],!1).filter(e=>wh(e)&&bh(e)!==`body`),i=null,a=Rh(e).position===`fixed`,o=a?Bh(e):e;for(;wh(o)&&!Lh(o);){let e=Rh(o),t=Ph(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Bh(o)}return t.set(e,r),r}function sg(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?kh(t)?[]:og(t,this._c):[].concat(n),r],o=ag(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ag(t,a[e],i);s=Nm(n.top,s),c=Mm(n.right,c),l=Mm(n.bottom,l),u=Nm(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function cg(e){let{width:t,height:n}=Wh(e);return{width:t,height:n}}function lg(e,t,n){let r=Th(t),i=Sh(t),a=n===`fixed`,o=Xh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Im(0);if((r||!a)&&((bh(t)!==`body`||Dh(i))&&(s=zh(t)),r)){let e=Xh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Zh(i));let l=i&&!r&&!a?Qh(i,s):Im(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ug(e){return Rh(e).position===`static`}function dg(e,t){if(!Th(e)||Rh(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Sh(e)===n&&(n=n.ownerDocument.body),n}function fg(e,t){let n=xh(e);if(kh(e))return n;if(!Th(e)){let t=Bh(e);for(;t&&!Lh(t);){if(wh(t)&&!ug(t))return t;t=Bh(t)}return n}let r=dg(e,t);for(;r&&Oh(r)&&ug(r);)r=dg(r,t);return r&&Lh(r)&&ug(r)&&!Ph(r)?n:r||Fh(e)||n}var pg=async function(e){let t=this.getOffsetParent||fg,n=this.getDimensions,r=await n(e.floating);return{reference:lg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mg(e){return Rh(e).direction===`rtl`}var hg={convertOffsetParentRelativeRectToViewportRelativeRect:$h,getDocumentElement:Sh,getClippingRect:sg,getOffsetParent:fg,getElementRects:pg,getClientRects:eg,getDimensions:cg,getScale:Kh,isElement:wh,isRTL:mg};function gg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _g(e,t,n){let r=null,i,a=Sh(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fm(d),h=Fm(a.clientWidth-(u+f)),g=Fm(a.clientHeight-(d+p)),_=Fm(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Nm(0,Mm(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gg(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=xh(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vg(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Gh(e),u=i||a?[...l?Hh(l):[],...t?Hh(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_g(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Xh(e):null;c&&g();function g(){let t=Xh(e);h&&!gg(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var yg=gh,bg=_h,xg=uh,Sg=vh,Cg=ph,wg=lh,Tg=(e,t,n)=>{let r=new Map,i=n??{},a={...hg,...i.platform,_c:r};return ch(e,t,{...i,platform:a})},Eg=L(`<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>`),Dg=ie();function Og(){let e=A(Dg);if(e===void 0)throw Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var kg=30,Ag=kg/2,jg={top:180,right:-90,bottom:0,left:90};function Mg(e){let t=Og(),[n,r]=N(cn({size:kg},e),[`ref`,`style`,`size`]),i=()=>t.currentPlacement().split(`-`)[0],a=Ng(t.contentRef),o=()=>a()?.getPropertyValue(`background-color`)||`none`,s=()=>a()?.getPropertyValue(`border-${i()}-color`)||`none`,c=()=>a()?.getPropertyValue(`border-${i()}-width`)||`0px`,l=()=>Number.parseInt(c())*2*(kg/n.size),u=()=>`rotate(${jg[i()]} ${Ag} ${Ag}) translate(0 2)`;return j(hn,M({as:`div`,ref(e){var r=Dt(t.setArrowRef,n.ref);typeof r==`function`&&r(e)},"aria-hidden":`true`,get style(){return Et({position:`absolute`,"font-size":`${n.size}px`,width:`1em`,height:`1em`,"pointer-events":`none`,fill:o(),stroke:s(),"stroke-width":l()},n.style)}},r,{get children(){var e=Eg(),t=e.firstChild;return t.firstChild.nextSibling,x(()=>R(t,`transform`,u())),e}}))}function Ng(e){let[t,n]=b();return S(()=>{let t=e();t&&n(Pt(t).getComputedStyle(t))}),t}function Pg(e){let t=Og(),[n,r]=N(e,[`ref`,`style`]);return j(hn,M({as:`div`,ref(e){var r=Dt(t.setPositionerRef,n.ref);typeof r==`function`&&r(e)},"data-popper-positioner":``,get style(){return Et({position:`absolute`,top:0,left:0,"min-width":`max-content`},n.style)}},r))}function Fg(e){let{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect==`function`)return new DOMRect(t,n,r,i);let a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function Ig(e,t){return{contextElement:e,getBoundingClientRect:()=>{let n=t(e);return n?Fg(n):e?e.getBoundingClientRect():Fg()}}}function Lg(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Rg={top:`bottom`,right:`left`,bottom:`top`,left:`right`};function zg(e,t){let[n,r]=e.split(`-`),i=Rg[n];return r?n===`left`||n===`right`?`${i} ${r===`start`?`top`:`bottom`}`:r===`start`?`${i} ${t===`rtl`?`right`:`left`}`:`${i} ${t===`rtl`?`left`:`right`}`:`${i} center`}function Bg(e){let t=cn({getAnchorRect:e=>e?.getBoundingClientRect(),placement:`bottom`,gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=b(),[i,a]=b(),[o,s]=b(t.placement),c=()=>Ig(t.anchorRef?.(),t.getAnchorRect),{direction:l}=gm();async function u(){let e=c(),r=n(),a=i();if(!e||!r)return;let o=(a?.clientHeight||0)/2,u=typeof t.gutter==`number`?t.gutter+o:t.gutter??o;r.style.setProperty(`--kb-popper-content-overflow-padding`,`${t.overflowPadding}px`),e.getBoundingClientRect();let d=[yg(({placement:e})=>{let n=!!e.split(`-`)[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){let e=typeof t.flip==`string`?t.flip.split(` `):void 0;if(e!==void 0&&!e.every(Lg))throw Error("`flip` expects a spaced-delimited list of placements");d.push(xg({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(bg({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(Sg({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:i}){let a=Math.round(i.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty(`--kb-popper-anchor-width`,`${a}px`),r.style.setProperty(`--kb-popper-content-available-width`,`${e}px`),r.style.setProperty(`--kb-popper-content-available-height`,`${n}px`),t.sameWidth&&(r.style.width=`${a}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(Cg({padding:t.detachedPadding})),a&&d.push(wg({element:a,padding:t.arrowPadding}));let f=await Tg(e,r,{placement:t.placement,strategy:`absolute`,middleware:d,platform:{...hg,isRTL:()=>l()===`rtl`}});if(s(f.placement),t.onCurrentPlacementChange?.(f.placement),!r)return;r.style.setProperty(`--kb-popper-content-transform-origin`,zg(f.placement,l()));let p=Math.round(f.x),m=Math.round(f.y),h;if(t.hideWhenDetached&&(h=f.middlewareData.hide?.referenceHidden?`hidden`:`visible`),Object.assign(r.style,{top:`0`,left:`0`,transform:`translate3d(${p}px, ${m}px, 0)`,visibility:h}),a&&f.middlewareData.arrow){let{x:e,y:t}=f.middlewareData.arrow,n=f.placement.split(`-`)[0];Object.assign(a.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`100%`})}}S(()=>{let e=c(),t=n();e&&t&&O(vg(e,t,u,{elementResize:typeof ResizeObserver==`function`}))}),S(()=>{let e=n(),r=t.contentRef?.();e&&r&&queueMicrotask(()=>{e.style.zIndex=getComputedStyle(r).zIndex})});let d={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return j(Dg.Provider,{value:d,get children(){return t.children}})}var Vg=Object.assign(Bg,{Arrow:Mg,Context:Dg,usePopperContext:Og,Positioner:Pg});function Hg(e){let t=t=>{t.key===Lt.Escape&&e.onEscapeKeyDown?.(t)};S(()=>{if(V(e.isDisabled))return;let n=e.ownerDocument?.()??Ft();n.addEventListener(`keydown`,t),O(()=>{n.removeEventListener(`keydown`,t)})})}var Ug=`data-kb-top-layer`,Wg,Gg=!1,Kg=[];function qg(e){return Kg.findIndex(t=>t.node===e)}function Jg(e){return Kg[qg(e)]}function Yg(e){return Kg.length>0&&Kg[Kg.length-1].node===e}function Xg(){return Kg.filter(e=>e.isPointerBlocking)}function Zg(){return[...Xg()].slice(-1)[0]}function Qg(){return Xg().length>0}function $g(e){let t=qg(Zg()?.node);return qg(e)<t}function e_(e){Kg.push(e)}function t_(e){let t=qg(e);t<0||Kg.splice(t,1)}function n_(){for(let{node:e}of Kg)e.style.pointerEvents=$g(e)?`none`:`auto`}function r_(e){if(Qg()&&!Gg){let t=Ft(e);Wg=document.body.style.pointerEvents,t.body.style.pointerEvents=`none`,Gg=!0}}function i_(e){if(Qg())return;let t=Ft(e);t.body.style.pointerEvents=Wg,t.body.style.length===0&&t.body.removeAttribute(`style`),Gg=!1}var a_={layers:Kg,isTopMostLayer:Yg,hasPointerBlockingLayer:Qg,isBelowPointerBlockingLayer:$g,addLayer:e_,removeLayer:t_,indexOf:qg,find:Jg,assignPointerEventToLayers:n_,disableBodyPointerEvents:r_,restoreBodyPointerEvents:i_},o_=`interactOutside.pointerDownOutside`,s_=`interactOutside.focusOutside`;function c_(e,t){let n,r=an,i=()=>Ft(t()),a=t=>e.onPointerDownOutside?.(t),o=t=>e.onFocusOutside?.(t),s=t=>e.onInteractOutside?.(t),c=n=>{let r=n.target;return!(r instanceof Element)||r.closest(`[data-kb-top-layer]`)||!Mt(i(),r)||Mt(t(),r)?!1:!e.shouldExcludeElement?.(r)},l=e=>{function n(){let n=t(),r=e.target;if(!n||!r||!c(e))return;let i=Vt([a,s]);r.addEventListener(o_,i,{once:!0});let o=new CustomEvent(o_,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:e.button===2||Ht(e)&&e.button===0}});r.dispatchEvent(o)}e.pointerType===`touch`?(i().removeEventListener(`click`,n),r=n,i().addEventListener(`click`,n,{once:!0})):n()},u=e=>{let n=t(),r=e.target;if(!n||!r||!c(e))return;let i=Vt([o,s]);r.addEventListener(s_,i,{once:!0});let a=new CustomEvent(s_,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(a)};S(()=>{V(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener(`pointerdown`,l,!0)},0),i().addEventListener(`focusin`,u,!0),O(()=>{window.clearTimeout(n),i().removeEventListener(`click`,r),i().removeEventListener(`pointerdown`,l,!0),i().removeEventListener(`focusin`,u,!0)}))})}var l_=ie();function u_(){return A(l_)}function d_(e){let t,n=u_(),[r,i]=N(e,[`ref`,`disableOutsidePointerEvents`,`excludedElements`,`onEscapeKeyDown`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onDismiss`,`bypassTopMostLayerCheck`]),a=new Set([]),o=e=>{a.add(e);let t=n?.registerNestedLayer(e);return()=>{a.delete(e),t?.()}};c_({shouldExcludeElement:e=>t?r.excludedElements?.some(t=>Mt(t(),e))||[...a].some(t=>Mt(t,e)):!1,onPointerDownOutside:e=>{t&&!a_.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||a_.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},()=>t),Hg({ownerDocument:()=>Ft(t),onEscapeKeyDown:e=>{t&&a_.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),D(()=>{if(!t)return;a_.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});let e=n?.registerNestedLayer(t);a_.assignPointerEventToLayers(),a_.disableBodyPointerEvents(t),O(()=>{t&&(a_.removeLayer(t),e?.(),a_.assignPointerEventToLayers(),a_.restoreBodyPointerEvents(t))})}),S(E([()=>t,()=>r.disableOutsidePointerEvents],([e,t])=>{if(!e)return;let n=a_.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,a_.assignPointerEventToLayers()),t&&a_.disableBodyPointerEvents(e),O(()=>{a_.restoreBodyPointerEvents(e)})},{defer:!0}));let s={registerNestedLayer:o};return j(l_.Provider,{value:s,get children(){return j(hn,M({as:`div`,ref(e){var n=Dt(e=>t=e,r.ref);typeof n==`function`&&n(e)}},i))}})}function f_(e={}){let[t,n]=Np({value:()=>V(e.open),defaultValue:()=>!!V(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var p_=e=>typeof e==`function`?e():e,m_=e=>{let t=C(()=>{let t=p_(e.element);if(t)return getComputedStyle(t)}),n=()=>t()?.animationName??`none`,[r,i]=b(p_(e.show)?`present`:`hidden`),a=t=>{i(t),e.onStateChange?.(t)},o=`none`;return S(r=>{let i=p_(e.show);return T(()=>{if(r===i)return i;let e=o,s=n();i?a(`present`):s===`none`||t()?.display===`none`?a(`hidden`):a(r===!0&&e!==s?`hiding`:`hidden`)}),i},p_(e.show)),S(()=>{let t=p_(e.element);if(!t)return;let i=e=>{e.target===t&&(o=n())},s=e=>{let i=n().includes(e.animationName);e.target===t&&i&&r()===`hiding`&&a(`hidden`)};t.addEventListener(`animationstart`,i),t.addEventListener(`animationcancel`,s),t.addEventListener(`animationend`,s),O(()=>{t.removeEventListener(`animationstart`,i),t.removeEventListener(`animationcancel`,s),t.removeEventListener(`animationend`,s)})}),{present:()=>r()===`present`||r()===`hiding`,state:r}};_n({},{Arrow:()=>Mg,Content:()=>__,Portal:()=>v_,Root:()=>E_,Tooltip:()=>O_,Trigger:()=>D_,useTooltipContext:()=>g_});var h_=ie();function g_(){let e=A(h_);if(e===void 0)throw Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function __(e){let t=g_(),[n,r]=N(cn({id:t.generateId(`content`)},e),[`ref`,`style`]);return S(()=>O(t.registerContentId(r.id))),j(F,{get when(){return t.contentPresent()},get children(){return j(Vg.Positioner,{get children(){return j(d_,M({ref(e){var r=Dt(e=>{t.setContentRef(e)},n.ref);typeof r==`function`&&r(e)},role:`tooltip`,disableOutsidePointerEvents:!1,get style(){return Et({"--kb-tooltip-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},n.style)},onFocusOutside:e=>e.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),r))}})}})}function v_(e){let t=g_();return j(F,{get when(){return t.contentPresent()},get children(){return j(vt,e)}})}function y_(e,t,n){let r=e.split(`-`)[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,c=i.top+i.height/2;switch(r){case`top`:o.push([i.left,c]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,c]);break;case`right`:o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case`bottom`:o.push([i.left,c]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,c]);break;case`left`:o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom])}return o}var b_={},x_=0,S_=!1,C_,w_,T_;function E_(e){let t=`tooltip-${Pe()}`,n=`${++x_}`,r=cn({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=N(r,[`id`,`open`,`defaultOpen`,`onOpenChange`,`disabled`,`triggerOnFocusOnly`,`openDelay`,`closeDelay`,`skipDelayDuration`,`ignoreSafeArea`,`forceMount`,`onCurrentPlacementChange`]),o,[s,c]=b(),[l,u]=b(),[d,f]=b(),[p,m]=b(a.placement),h=f_({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:e=>i.onOpenChange?.(e)}),{present:g}=m_({show:()=>i.forceMount||h.isOpen(),element:()=>d()??null}),_=()=>{b_[n]=y},v=()=>{for(let e in b_)e!==n&&(b_[e](!0),delete b_[e])},y=(e=!1)=>{e||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,h.close()):o||=window.setTimeout(()=>{o=void 0,h.close()},i.closeDelay),window.clearTimeout(C_),C_=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(T_=window.setTimeout(()=>{window.clearTimeout(T_),T_=void 0},i.skipDelayDuration)),S_&&(window.clearTimeout(w_),w_=window.setTimeout(()=>{delete b_[n],w_=void 0,S_=!1},i.closeDelay))},x=()=>{clearTimeout(o),o=void 0,v(),_(),S_=!0,h.open(),window.clearTimeout(C_),C_=void 0,window.clearTimeout(w_),w_=void 0,window.clearTimeout(T_),T_=void 0},w=()=>{v(),_(),!h.isOpen()&&!C_&&!S_?C_=window.setTimeout(()=>{C_=void 0,S_=!0,x()},i.openDelay):h.isOpen()||x()},T=(e=!1)=>{!e&&i.openDelay&&i.openDelay>0&&!o&&!T_?w():x()},E=()=>{window.clearTimeout(C_),C_=void 0,S_=!1},D=()=>{window.clearTimeout(o),o=void 0},k=e=>Mt(l(),e)||Mt(d(),e),ee=e=>{let t=l(),n=d();if(t&&n)return y_(e,t,n)},te=e=>{let t=e.target;if(k(t))D();else{if(!i.ignoreSafeArea){let t=ee(p());if(t&&sn(on(e),t)){D();return}}o||y()}};S(()=>{if(!h.isOpen())return;let e=Ft();e.addEventListener(`pointermove`,te,!0),O(()=>{e.removeEventListener(`pointermove`,te,!0)})}),S(()=>{let e=l();if(!e||!h.isOpen())return;let t=t=>{let n=t.target;Mt(n,e)&&y(!0)},n=Pt();n.addEventListener(`scroll`,t,{capture:!0}),O(()=>{n.removeEventListener(`scroll`,t,{capture:!0})})}),O(()=>{clearTimeout(o),b_[n]&&delete b_[n]});let ne={dataset:C(()=>({"data-expanded":h.isOpen()?``:void 0,"data-closed":h.isOpen()?void 0:``})),isOpen:h.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:g,openTooltip:T,hideTooltip:y,cancelOpening:E,generateId:jt(()=>r.id),registerContentId:Fp(c),isTargetOnTooltip:k,setTriggerRef:u,setContentRef:f};return j(h_.Provider,{value:ne,get children(){return j(Vg,M({anchorRef:l,contentRef:d,onCurrentPlacementChange:e=>{m(e),i.onCurrentPlacementChange?.(e)}},a))}})}function D_(e){let t,n=g_(),[r,i]=N(e,[`ref`,`onPointerEnter`,`onPointerLeave`,`onPointerDown`,`onClick`,`onFocus`,`onBlur`]),a=!1,o=!1,s=!1,c=()=>{a=!1},l=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=e=>{n.isOpen()&&!o&&!s&&n.hideTooltip(e)};return O(()=>{Ft(t).removeEventListener(`pointerup`,c)}),j(hn,M({as:`button`,ref(e){var i=Dt(e=>{n.setTriggerRef(e),t=e},r.ref);typeof i==`function`&&i(e)},get"aria-describedby"(){return I(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:e=>{Bt(e,r.onPointerEnter),!(e.pointerType===`touch`||n.triggerOnFocusOnly()||n.isDisabled()||e.defaultPrevented)&&(o=!0,l())},onPointerLeave:e=>{Bt(e,r.onPointerLeave),e.pointerType!==`touch`&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},onPointerDown:e=>{Bt(e,r.onPointerDown),a=!0,Ft(t).addEventListener(`pointerup`,c,{once:!0})},onClick:e=>{Bt(e,r.onClick),o=!1,s=!1,u(!0)},onFocus:e=>{Bt(e,r.onFocus),!(n.isDisabled()||e.defaultPrevented||a)&&(s=!0,l())},onBlur:e=>{Bt(e,r.onBlur);let t=e.relatedTarget;n.isTargetOnTooltip(t)||(o=!1,s=!1,u(!0))},type:`button`},()=>n.dataset(),i))}var O_=Object.assign(E_,{Arrow:Mg,Content:__,Portal:v_,Trigger:D_}),k_=Symbol(`store-raw`),A_=Symbol(`store-node`),j_=Symbol(`store-has`),M_=Symbol(`store-self`);function N_(e){let t=e[i];if(!t&&(Object.defineProperty(e,i,{value:t=new Proxy(e,V_)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function P_(e){let t;return typeof e==`object`&&!!e&&(e[i]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function F_(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[k_])return n;if(!P_(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=F_(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=F_(i,t))!==i&&(e[a]=r))}return e}function I_(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function L_(e,t,n){if(e[t])return e[t];let[r,i]=b(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function R_(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===i||t===A_||(delete n.value,delete n.writable,n.get=()=>e[i][t]),n}function z_(e){k()&&L_(I_(e,A_),M_)()}function B_(e){return z_(e),Reflect.ownKeys(e)}var V_={get(e,t,n){if(t===k_)return e;if(t===i)return n;if(t===o)return z_(e),n;let r=I_(e,A_),a=r[t],s=a?a():e[t];if(t===A_||t===j_||t===`__proto__`)return s;if(!a){let n=Object.getOwnPropertyDescriptor(e,t);k()&&(typeof s!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(s=L_(r,t,s)())}return P_(s)?N_(s):s},has(e,t){return t===k_||t===i||t===o||t===A_||t===j_||t===`__proto__`||(k()&&L_(I_(e,j_),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:B_,getOwnPropertyDescriptor:R_};function H_(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[j_]&&e[j_][t]&&i!==void 0&&e[j_][t].$()):(e[t]=n,e[j_]&&e[j_][t]&&i===void 0&&e[j_][t].$());let o=I_(e,A_),s;if((s=L_(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=L_(o,`length`,a))&&s.$(e.length)}(s=o[M_])&&s.$()}function U_(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];H_(e,i,t[i])}}function W_(e,t){if(typeof t==`function`&&(t=t(e)),t=F_(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&H_(e,n,r)}H_(e,`length`,r)}else U_(e,t)}function G_(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)G_(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&G_(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)G_(e,[r].concat(t),n);return}if(t.length>1){G_(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=F_(a),r===void 0||P_(i)&&P_(a)&&!Array.isArray(a)?U_(i,a):H_(e,r,a))}function K_(...[e,t]){let n=F_(e||{}),r=Array.isArray(n),i=N_(n);function a(...e){w(()=>{r&&e.length===1?W_(n,e[0]):G_(n,e)})}return[i,a]}function q_(e){let t,[n,r]=K_({open:!1,block:!1,expand:!1}),[i,a]=N(e,[`children`,`appearance`,`class`,`contentClass`,`contentStyle`,`inactive`,`forceOpen`,`triggerTabIndex`,`ignoreSafeArea`,`value`]),o=()=>r(`open`,!1),s=()=>i.forceOpen!==void 0,c=()=>{let e=document.activeElement;return!t||!e?!1:t.contains(e)},l=(e=n.expand)=>{!e&&n.block&&(t?.matches(`:hover`)||c()||r(`block`,!1))},u=()=>{let e=!!t?.querySelector(`[aria-expanded="true"], [data-expanded]`);r(`expand`,e),e?(r(`block`,!0),o()):l(e)},d=()=>{r(`block`,!0),o()},f=()=>{c()||o(),l()};S(()=>{if(!t)return;T(u);let e=new MutationObserver(u);e.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-expanded`,`data-expanded`]}),O(()=>e.disconnect())});let p=!1;return j(Ie,{get children(){return[j(Le,{get when(){return i.inactive},get children(){return i.children}}),j(Le,{when:!0,get children(){return j(E_,M({gutter:4,openDelay:400,skipDelayDuration:300},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return I(()=>!!s())()?i.forceOpen:n.open},onOpenChange:e=>{s()||n.block&&e||(p?p=!1:r(`open`,e))},get children(){return[j(D_,{ref(e){var n=t;typeof n==`function`?n(e):t=e},as:`div`,get tabIndex(){return i.triggerTabIndex},"data-component":`tooltip-v2-trigger`,get class(){return i.class},onPointerDownCapture:d,onKeyDownCapture:e=>{(e.key===`Enter`||e.key===` `)&&d()},onPointerLeave:f,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),j(v_,{get children(){return j(__,{ref:e=>{let n=t?.closest(`[data-theme]`)?.getAttribute(`data-theme`);n&&e.setAttribute(`data-theme`,n)},"data-component":`tooltip-v2`,get"data-appearance"(){return i.appearance??`compact`},get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},onPointerDownOutside:e=>{(t===e.target||e.target instanceof Node&&t?.contains(e.target))&&(p=!0),e.preventDefault()},get children(){return i.value}})}})]}}))}})]}})}var J_=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Y_=function(e){return`/`+e},X_={},Z_=function(e){return e.pathname.endsWith(`.css`)},Q_=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Y_(t,n);let r=s(t),i=Z_(r);return Q_(X_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:J_,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(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`&&i(e.reason);return e().catch(i)})};function ev(){return $_(()=>import(`./popover-C4ZLYe9E.js`).then(e=>({Popover:e.Popover})),__vite__mapDeps([0,1]))}var tv=[`24h`,`7d`,`30d`,`lifetime`],nv=new Set(tv);function rv(e){return nv.has(e)}var iv=new Set([`quota.changed`,`sessions.changed`,`settings.changed`]);function av(e){return ov(e)&&e>=0}function ov(e){return Number.isFinite(e)}function sv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cv(e){return e.input+e.cacheRead+e.cacheWrite+e.output+e.reasoning}function lv(e){return sv(e)?av(e.input)&&av(e.cacheRead)&&av(e.cacheWrite)&&av(e.output)&&av(e.reasoning):!1}function uv(e){return!sv(e)||!lv(e)?!1:av(e.total)&&e.total===cv(e)&&(e.apiEquivalentCostUsd===null||av(e.apiEquivalentCostUsd))&&av(e.unpricedTokens)&&av(e.unknownTokens)&&(e.recordedCostUsd===void 0||av(e.recordedCostUsd))&&(e.recordedCostTokens===void 0||av(e.recordedCostTokens))}function dv(e){return!sv(e)||!av(e.at)||typeof e.topic!=`string`||!iv.has(e.topic)?!1:e.scope===void 0||e.scope===`visibility`}var fv=[`provider_api`,`credentials`,`discovery`,`local`];function pv(e){return e===`provider_api`||e===`discovery`||e===`local`}var mv=[`fresh`,`reuse`,`cooldown`,`transient`,`credentials`];function hv(e){return mv.some(t=>t===e)}function gv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _v(e){return typeof e==`string`}var vv=Object.freeze({version:`1.3.2`,build:`c6a0d0f63ee7`});function yv(e,t){return t.has(e.providerId)||e.providerScopeHash!==void 0&&t.has(e.providerScopeHash)}function bv(e,t){return t.has(e.cardId)||yv(e,t)}function xv(e,t){for(let n of t)if(n.rowId===e||n.aliases?.includes(e))return n.rowId;return e}function Sv(e,t){let n=new Set,r=[];for(let i of e){let e=xv(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function Cv(e){let t=e.indexOf(`#`);if(t<=0)return;let n=/^aggregate\|(.+)$/u.exec(e.slice(t+1))?.[1];if(n)return{cardId:e.slice(0,t),discriminator:n}}function wv(e,t){return e.startsWith(`${t}#`)}function Tv(e,t){return e.endsWith(`|${t}`)}function Ev(e,t){return e.find(e=>wv(e,t.cardId)&&Tv(e,t.discriminator))}function Dv(e,t,n=[]){let r=new Set(t);if(r.size===0)return r;for(let n of t){let t=Cv(n);if(!t||e.includes(n))continue;let i=Ev(e,t);i!==void 0&&(r.delete(n),r.add(i))}for(let e of n){let t=[e.rowId,...e.aliases??[]];if(t.some(e=>r.has(e)))for(let e of t)r.add(e)}return r}function Ov(e,t,n){let r=[],i=new Set,a=e=>{i.has(e)||(i.add(e),r.push(e))};for(let r of t){let t=Cv(r);if(!t||t.cardId!==e||n.includes(r)){a(r);continue}let i=Ev(n,t);i!==void 0&&a(i)}return r}var kv=`k.`,Av=/^[A-Za-z0-9_-]*$/,jv=2;function Mv(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Nv(e){if(!Av.test(e))return;let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r;try{r=atob(`${t}${`=`.repeat(n)}`)}catch{return}let i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function Pv(e){if(e.kind===`unknown`)return`u`;let{id:t}=e,n=new Uint8Array(t.length*jv);for(let e=0;e<t.length;e+=1){let r=t.charCodeAt(e);n[e*2]=r&255,n[e*2+1]=r>>8}return`${kv}${Mv(n)}`}function Fv(e){if(e===`u`)return{kind:`unknown`};if(!e.startsWith(kv))return;let t=Nv(e.slice(2));if(t===void 0||t.length%jv!==0)return;let n=``;for(let e=0;e<t.length;e+=2){let r=t[e]??0,i=t[e+1]??0;n+=String.fromCharCode(r|i<<8)}let r={kind:`known`,id:n};return Pv(r)===e?r:void 0}var Iv=class extends Error{code;status;details;constructor(e,t,n,r){super(n),this.name=`DashboardError`,this.code=e,this.status=t,this.details=r}get isConfigChanged(){return this.code===`config-changed`}},Lv=[`request`,`token`,`credit`,`message`,`interaction`,`unit`],Rv=[`quota`,`rate_limit`,`usage`,`spend`,`budget`,`balance`,`status`],zv=[`currency`,`count`,`custom`],Bv=[`percent`,`value`,`quantity`,`boolean`],Vv=[`connection`,`org`,`account`,`provider`],Hv=[`hour`,`day`],Uv=[`before_reset`,`lasts_past_reset`],Wv=[`peak`,`offpeak`,`mixed`,`unknown`],Gv=[`peak`,`offpeak`,`unknown`],Kv=[`peak`,`offpeak`,`unchanged`],qv=[`api_price`,`quota_points`],Jv=[`CN`,`US`,`CA`],Yv=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`];function G(e,t){return new Iv(`invalid-response`,0,`The dashboard server returned an unexpected payload for ${e} (${t}).`)}function Xv(e){return typeof e==`string`}function Zv(e){return typeof e==`boolean`}function Qv(e){return typeof e==`number`&&Number.isFinite(e)}function $v(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t,n){if(!$v(e))throw G(t,n);return e}function q(e,t,n){if(!Array.isArray(e))throw G(t,n);return e}function J(e,t,n){if(!Xv(e))throw G(t,n);return e}function Y(e,t,n){return e===void 0?void 0:J(e,t,n)}function X(e,t,n){if(!Qv(e))throw G(t,n);return e}function ey(e,t,n){return e===void 0?void 0:X(e,t,n)}function ty(e,t,n,r,i){let a=X(e,t,n);if(!Number.isInteger(a)||a<r||a>i)throw G(t,n);return a}function ny(e,t,n){if(!Zv(e))throw G(t,n);return e}function ry(e,t,n){return e===void 0?void 0:ny(e,t,n)}function Z(e,t,n,r){if(Xv(e)){for(let n of t)if(n===e)return n}throw G(n,r)}function iy(e,t,n,r){return e===void 0?void 0:Z(e,t,n,r)}function ay(e,t,n){if(rv(e))return e;throw G(t,n)}function oy(e,t,n){if(!lv(e))throw G(t,n);return e}function sy(e,t,n){if(!uv(e))throw G(t,n);return e}function cy(e,t,n){return J(e,t,n)}function ly(e,t,n){return J(e,t,n)}function uy(e,t,n){return q(e,t,n).map(e=>{let r=K(e,t,`${n}[]`);return{label:J(r.label,t,`${n}[].label`),value:J(r.value,t,`${n}[].value`)}})}function dy(e,t,n){return q(e,t,n).map(e=>{let r=K(e,t,`${n}[]`);return{key:J(r.key,t,`${n}[].key`),message:J(r.message,t,`${n}[].message`)}})}function fy(e,t,n){let r=K(e,t,n),i=Z(r.kind,zv,t,`${n}.kind`);return i===`currency`?{kind:i,code:J(r.code,t,`${n}.code`)}:i===`count`?{kind:i,unit:Z(r.unit,Lv,t,`${n}.unit`)}:{kind:i,symbol:J(r.symbol,t,`${n}.symbol`)}}function py(e,t,n){let r=K(e,t,n),i=Z(r.kind,Uv,t,`${n}.kind`);return i===`before_reset`?{kind:i,projectedAtIso:J(r.projectedAtIso,t,`${n}.projectedAtIso`)}:{kind:i}}function my(e,t,n){let r=K(e,t,n);return{availableCount:X(r.availableCount,t,`${n}.availableCount`),credits:q(r.credits,t,`${n}.credits`).map(e=>{let r=K(e,t,`${n}.credits[]`),i={},a=Y(r.title,t,`${n}.credits[].title`);return a!==void 0&&(i.title=a),r.expiresAtIso!==void 0&&(i.expiresAtIso=r.expiresAtIso===null?null:J(r.expiresAtIso,t,`${n}.credits[].expiresAtIso`)),i})}}function hy(e,t){let n=`providers.cards[].rows[]`,r=K(e,t,n),i={rowId:ly(r.rowId,t,`${n}.rowId`),label:J(r.label,t,`${n}.label`),kind:Z(r.kind,Bv,t,`${n}.kind`),resultType:Z(r.resultType,Rv,t,`${n}.resultType`)},a=ey(r.percentRemaining,t,`${n}.percentRemaining`);a!==void 0&&(i.percentRemaining=a);let o=ey(r.percentUsed,t,`${n}.percentUsed`);o!==void 0&&(i.percentUsed=o);let s=Y(r.value,t,`${n}.value`);s!==void 0&&(i.value=s);let c=ry(r.booleanValue,t,`${n}.booleanValue`);c!==void 0&&(i.booleanValue=c);let l=Y(r.resetAtIso,t,`${n}.resetAtIso`);l!==void 0&&(i.resetAtIso=l);let u=Y(r.countdown,t,`${n}.countdown`);u!==void 0&&(i.countdown=u);let d=Y(r.info,t,`${n}.info`);if(d!==void 0&&(i.info=d),r.quantity!==void 0){let e=K(r.quantity,t,`${n}.quantity`);i.quantity={decimal:J(e.decimal,t,`${n}.quantity.decimal`),unit:fy(K(e.unit,t,`${n}.quantity.unit`),t,`${n}.quantity.unit`)}}return r.runway!==void 0&&(i.runway=py(r.runway,t,`${n}.runway`)),r.detailRows!==void 0&&(i.detailRows=uy(r.detailRows,t,`${n}.detailRows`)),r.bankedResets!==void 0&&(i.bankedResets=my(r.bankedResets,t,`${n}.bankedResets`)),i}function gy(e,t){let n=`providers.cards[]`,r=K(e,t,n),i={cardId:cy(r.cardId,t,`${n}.cardId`),providerId:J(r.providerId,t,`${n}.providerId`),providerLabel:J(r.providerLabel,t,`${n}.providerLabel`),labelSource:Z(r.labelSource,Vv,t,`${n}.labelSource`),rows:q(r.rows,t,`${n}.rows`).map(e=>hy(e,t)),errors:q(r.errors,t,`${n}.errors`).map(e=>{let r=K(e,t,`${n}.errors[]`),i={label:J(r.label,t,`${n}.errors[].label`),message:J(r.message,t,`${n}.errors[].message`)},a=ry(r.retryable,t,`${n}.errors[].retryable`);a!==void 0&&(i.retryable=a);let o=ey(r.retryAtMs,t,`${n}.errors[].retryAtMs`);if(o!==void 0&&(i.retryAtMs=o),r.attemptOutcome!==void 0){if(!hv(r.attemptOutcome))throw G(t,`${n}.errors[].attemptOutcome`);i.attemptOutcome=r.attemptOutcome}let s=iy(r.kind,[`intentional-filter`],t,`${n}.errors[].kind`);s!==void 0&&(i.kind=s);let c=iy(r.failureCategory,fv,t,`${n}.errors[].failureCategory`);return c!==void 0&&(i.failureCategory=c),i})};if(r.stale!==void 0){if(ny(r.stale,t,`${n}.stale`)!==!0)throw G(t,`${n}.stale`);i.stale=!0}let a=Y(r.accountLabel,t,`${n}.accountLabel`);a!==void 0&&(i.accountLabel=a);let o=Y(r.planLabel,t,`${n}.planLabel`);o!==void 0&&(i.planLabel=o),r.providerScopeId!==void 0&&(i.providerScopeId=cy(r.providerScopeId,t,`${n}.providerScopeId`));let s=Y(r.providerScopeHash,t,`${n}.providerScopeHash`);s!==void 0&&(i.providerScopeHash=s);let c=Y(r.observedAtIso,t,`${n}.observedAtIso`);if(c!==void 0&&(i.observedAtIso=c),r.details!==void 0&&(i.details=uy(r.details,t,`${n}.details`)),r.visibilityRows!==void 0&&(i.visibilityRows=q(r.visibilityRows,t,`${n}.visibilityRows`).map(e=>{let r=K(e,t,`${n}.visibilityRows[]`),i={rowId:ly(r.rowId,t,`${n}.visibilityRows[].rowId`),label:J(r.label,t,`${n}.visibilityRows[].label`)},a=Y(r.info,t,`${n}.visibilityRows[].info`);return a!==void 0&&(i.info=a),r.aliases!==void 0&&(i.aliases=q(r.aliases,t,`${n}.visibilityRows[].aliases`).map(e=>ly(e,t,`${n}.visibilityRows[].aliases[]`))),i})),r.primaryQuotaWindows!==void 0){let e=`${n}.primaryQuotaWindows`,a=q(r.primaryQuotaWindows,t,e).map(n=>{let r=K(n,t,`${e}[]`);return{rowId:ly(r.rowId,t,`${e}[].rowId`),slot:ty(r.slot,t,`${e}[].slot`,0,2)}});if(a.length>3||new Set(a.map(e=>e.rowId)).size!==a.length||new Set(a.map(e=>e.slot)).size!==a.length)throw G(t,e);let o=new Map(i.rows.map(e=>[e.rowId,e]));if(!a.every(e=>{let t=o.get(e.rowId);return t!==void 0&&t.kind===`percent`&&(t.resultType===`quota`||t.resultType===`rate_limit`)&&Number.isFinite(t.percentRemaining)}))throw G(t,e);i.primaryQuotaWindows=a}return i}function _y(e,t,n){if(Xv(e)){if(e===`auto`)return`auto`;throw G(t,n)}return q(e,t,n).map(e=>J(e,t,`${n}[]`))}function vy(e,t){let n=`projects[]`,r=K(e,t,n);return{projectId:J(r.projectId,t,`${n}.projectId`),name:J(r.name,t,`${n}.name`),tokens:sy(r.tokens,t,`${n}.tokens`),rootSessionCount:X(r.rootSessionCount,t,`${n}.rootSessionCount`),latestActivityAtMs:X(r.latestActivityAtMs,t,`${n}.latestActivityAtMs`)}}function yy(e,t,n=`usage.window`){let r=K(e,t,n),i=ey(r.sinceMs,t,`${n}.sinceMs`),a=X(r.untilMs,t,`${n}.untilMs`);return i===void 0?{untilMs:a}:{sinceMs:i,untilMs:a}}var by=[`model`,`provider`];function xy(e,t,n){return Z(e,by,t,n)}function Sy(e,t,n){let r=K(e,t,n),i=Z(r.kind,[`known`,`unknown`],t,`${n}.kind`);return i===`unknown`?{kind:i}:{kind:i,id:J(r.id,t,`${n}.id`)}}function Cy(e,t,n){let r=K(e,t,n);return{dimension:xy(r.dimension,t,`${n}.dimension`),identity:Sy(r.identity,t,`${n}.identity`)}}function wy(e,t,n){let r=K(e,t,n);return{identity:Sy(r.identity,t,`${n}.identity`),peak:sy(r.peak,t,`${n}.peak`),offpeak:sy(r.offpeak,t,`${n}.offpeak`)}}function Ty(e,t,n){return{rows:q(K(e,t,n).rows,t,`${n}.rows`).map(e=>wy(e,t,`${n}.rows[]`))}}function Ey(e,t,n){let r=K(e,t,n);return{identity:Sy(r.identity,t,`${n}.identity`),tokens:sy(r.tokens,t,`${n}.tokens`),sessionCount:X(r.sessionCount,t,`${n}.sessionCount`),stepCount:X(r.stepCount,t,`${n}.stepCount`),children:q(r.children,t,`${n}.children`).map(e=>Ey(e,t,`${n}.children[]`))}}function Dy(e,t,n,r){if(e===void 0)return;let i=q(e,t,n);if(i.length!==r)throw G(t,n);return i.map((e,r)=>{let i=`${n}[${r}]`,a=new Set;return q(e,t,i).map(e=>{let n=K(e,t,`${i}[]`),r=Sy(n.identity,t,`${i}[].identity`),o=r.kind===`unknown`?`unknown`:`known:${r.id}`;if(a.has(o))throw G(t,i);return a.add(o),{identity:r,tokens:sy(n.tokens,t,`${i}[].tokens`)}})})}function Oy(e,t){let n=`series[]`,r=K(e,t,n),i=Z(r.kind,[`entity`,`other`],t,`${n}.kind`),a=sy(r.tokens,t,`${n}.tokens`),o=q(r.buckets,t,`${n}.buckets`).map((e,r)=>sy(e,t,`${n}.buckets[${r}]`)),s=Dy(r.childBuckets,t,`${n}.childBuckets`,o.length);if(i===`other`){let e=Dy(r.parentBuckets,t,`${n}.parentBuckets`,o.length);return{kind:i,tokens:a,buckets:o,...s===void 0?{}:{childBuckets:s},...e===void 0?{}:{parentBuckets:e}}}let c=Sy(r.identity,t,`${n}.identity`);return s===void 0?{kind:i,identity:c,tokens:a,buckets:o}:{kind:i,identity:c,tokens:a,buckets:o,childBuckets:s}}function ky(e,t=`/api/v1/models`){let n=K(e,t,`not an object`),r={dimension:xy(n.dimension,t,`dimension`),range:ay(n.range,t,`range`),window:yy(n.window,t,`window`),bucketUnit:Z(n.bucketUnit,Hv,t,`bucketUnit`),timeZone:J(n.timeZone,t,`timeZone`),buckets:q(n.buckets,t,`buckets`).map(e=>{let n=K(e,t,`buckets[]`);return{startMs:X(n.startMs,t,`buckets[].startMs`),endMs:X(n.endMs,t,`buckets[].endMs`)}}),totals:sy(n.totals,t,`totals`),sessionCount:X(n.sessionCount,t,`sessionCount`),stepCount:X(n.stepCount,t,`stepCount`),rows:q(n.rows,t,`rows`).map(e=>Ey(e,t,`rows[]`)),series:q(n.series,t,`series`).map(e=>Oy(e,t)),stale:ny(n.stale,t,`stale`)};return n.filter!==void 0&&(r.filter=Cy(n.filter,t,`filter`)),n.temporalBreakdown!==void 0&&(r.temporalBreakdown=Ty(n.temporalBreakdown,t,`temporalBreakdown`)),r}function Ay(e,t){let n=`usage.buckets[]`,r=K(e,t,n);return{startMs:X(r.startMs,t,`${n}.startMs`),endMs:X(r.endMs,t,`${n}.endMs`),tokens:sy(r.tokens,t,`${n}.tokens`)}}function jy(e,t){let n=`usage`,r=K(e,t,n);return{range:ay(r.range,t,`${n}.range`),window:yy(r.window,t),bucketUnit:Z(r.bucketUnit,Hv,t,`${n}.bucketUnit`),timeZone:J(r.timeZone,t,`${n}.timeZone`),buckets:q(r.buckets,t,`${n}.buckets`).map(e=>Ay(e,t)),totals:sy(r.totals,t,`${n}.totals`),stepCount:X(r.stepCount,t,`${n}.stepCount`),sessionCount:X(r.sessionCount,t,`${n}.sessionCount`),stale:ny(r.stale,t,`${n}.stale`)}}function My(e,t){let n=`temporal.providers[].models[].effect`,r=K(e,t,n),i=Z(r.unit,qv,t,`${n}.unit`),a=ry(r.scalar,t,`${n}.scalar`);if(i===`quota_points`&&a!==void 0)throw G(t,`${n}.scalar`);return{factor:X(r.factor,t,`${n}.factor`),direction:Z(r.direction,Kv,t,`${n}.direction`),unit:i,...a===void 0?{}:{scalar:a}}}function Ny(e,t){let n=`temporal.providers[].models[].intervals[]`,r=K(e,t,n),i={startMs:X(r.startMs,t,`${n}.startMs`),endMs:X(r.endMs,t,`${n}.endMs`),phase:Z(r.phase,Gv,t,`${n}.phase`)};r.effect!==void 0&&(i.effect=My(r.effect,t));let a=Y(r.reason,t,`${n}.reason`);return a!==void 0&&(i.reason=a),i}function Py(e,t){let n=`temporal.providers[].models[].weekly.windows[]`,r=K(e,t,n),i=q(r.days,t,`${n}.days`).map(e=>Z(e,Yv,t,`${n}.days[]`));if(i.length===0||new Set(i).size!==i.length)throw G(t,`${n}.days`);let a=ty(r.startMinute,t,`${n}.startMinute`,0,1439),o=ty(r.endMinute,t,`${n}.endMinute`,1,1440);if(o<=a)throw G(t,`${n}.endMinute`);let s={days:Yv.filter(e=>i.includes(e)),startMinute:a,endMinute:o,phase:Z(r.phase,Gv,t,`${n}.phase`)};return r.effect!==void 0&&(s.effect=My(r.effect,t)),s}function Fy(e,t){let n=`temporal.providers[].models[].weekly`,r=K(e,t,n),i=J(r.timeZone,t,`${n}.timeZone`);if(i.length===0)throw G(t,`${n}.timeZone`);let a={timeZone:i,utcOffsetMinutes:ty(r.utcOffsetMinutes,t,`${n}.utcOffsetMinutes`,-1440,1440),basePhase:Z(r.basePhase,Gv,t,`${n}.basePhase`),windows:q(r.windows,t,`${n}.windows`).map(e=>Py(e,t))};if(r.baseEffect!==void 0&&(a.baseEffect=My(r.baseEffect,t)),r.exceptHolidays!==void 0){let e=q(r.exceptHolidays,t,`${n}.exceptHolidays`).map(e=>Z(e,Jv,t,`${n}.exceptHolidays[]`));if(new Set(e).size!==e.length)throw G(t,`${n}.exceptHolidays`);a.exceptHolidays=Jv.filter(t=>e.includes(t))}return a}function Iy(e,t){let n=`temporal.providers[].models[]`,r=K(e,t,n),i={modelId:J(r.modelId,t,`${n}.modelId`),state:Z(r.state,Gv,t,`${n}.state`),intervals:q(r.intervals,t,`${n}.intervals`).map(e=>Ny(e,t))};r.effect!==void 0&&(i.effect=My(r.effect,t)),r.weekly!==void 0&&(i.weekly=Fy(r.weekly,t));let a=ey(r.nextChangeAtMs,t,`${n}.nextChangeAtMs`);a!==void 0&&(i.nextChangeAtMs=a),r.nextState!==void 0&&(i.nextState=Z(r.nextState,Gv,t,`${n}.nextState`));let o=Y(r.reason,t,`${n}.reason`);return o!==void 0&&(i.reason=o),i}function Ly(e,t){let n=`temporal.providers[].holidays[]`,r=K(e,t,n);return{jurisdiction:Z(r.jurisdiction,Jv,t,`${n}.jurisdiction`),id:J(r.id,t,`${n}.id`),localStart:J(r.localStart,t,`${n}.localStart`),localEnd:J(r.localEnd,t,`${n}.localEnd`),startMs:X(r.startMs,t,`${n}.startMs`),endMs:X(r.endMs,t,`${n}.endMs`)}}function Ry(e,t){if(e===void 0)return;let n=`temporal.providers[].source`,r=K(e,t,n);return{label:J(r.label,t,`${n}.label`),url:J(r.url,t,`${n}.url`),accessedAt:J(r.accessedAt,t,`${n}.accessedAt`)}}function zy(e,t){let n=`temporal.providers[]`,r=K(e,t,n),i=Ry(r.source,t);return{providerId:J(r.providerId,t,`${n}.providerId`),providerLabel:J(r.providerLabel,t,`${n}.providerLabel`),discovered:ny(r.discovered,t,`${n}.discovered`),phase:Z(r.phase,Wv,t,`${n}.phase`),models:q(r.models,t,`${n}.models`).map(e=>Iy(e,t)),holidays:q(r.holidays,t,`${n}.holidays`).map(e=>Ly(e,t)),...i?{source:i}:{}}}function By(e,t){if(e===void 0)return;let n=`temporal`,r=K(e,t,n),i=K(r.snapshot,t,`${n}.snapshot`);return{generatedAtMs:X(r.generatedAtMs,t,`${n}.generatedAtMs`),providers:q(r.providers,t,`${n}.providers`).map(e=>zy(e,t)),snapshot:{revision:J(i.revision,t,`${n}.snapshot.revision`),generatedAtMs:X(i.generatedAtMs,t,`${n}.snapshot.generatedAtMs`)}}}function Vy(e,t=`/api/v1/quota`){let n=K(e,t,`not an object`),r=K(n.providers,t,`providers`),i={generatedAtMs:X(n.generatedAtMs,t,`generatedAtMs`),stale:ny(n.stale,t,`stale`),timeZone:J(n.timeZone,t,`timeZone`),providers:{cards:q(r.cards,t,`providers.cards`).map(e=>gy(e,t)),enabledProviders:_y(r.enabledProviders,t,`providers.enabledProviders`),polledAtMs:X(r.polledAtMs,t,`providers.polledAtMs`)}},a=By(n.temporal,t);return a!==void 0&&(i.temporal=a),i}function Hy(e,t=`/api/v1/home`){let n=K(e,t,`not an object`),r=K(n.providers,t,`providers`),i={generatedAtMs:X(n.generatedAtMs,t,`generatedAtMs`),range:ay(n.range,t,`range`),stale:ny(n.stale,t,`stale`),providers:{cards:q(r.cards,t,`providers.cards`).map(e=>gy(e,t)),enabledProviders:_y(r.enabledProviders,t,`providers.enabledProviders`),polledAtMs:X(r.polledAtMs,t,`providers.polledAtMs`)},usage:jy(n.usage,t),projects:q(n.projects,t,`projects`).map(e=>vy(e,t))};ry(n.provisional,t,`provisional`)===!0&&(i.provisional=!0);let a=Y(n.exactError,t,`exactError`);return a!==void 0&&(i.exactError=a),i}function Uy(e,t){let n=`roots[]`,r=K(e,t,n),i={sessionId:J(r.sessionId,t,`${n}.sessionId`),title:J(r.title,t,`${n}.title`),tokens:sy(r.tokens,t,`${n}.tokens`),latestActivityAtMs:X(r.latestActivityAtMs,t,`${n}.latestActivityAtMs`)},a=Y(r.worktreeLabel,t,`${n}.worktreeLabel`);return a!==void 0&&(i.worktreeLabel=a),i}function Wy(e,t){let n=K(e,t,`not an object`),r=K(n.totals,t,`totals`),i=sy(r,t,`totals`);return{projectId:J(n.projectId,t,`projectId`),name:J(n.name,t,`name`),range:ay(n.range,t,`range`),window:yy(n.window,t),roots:q(n.roots,t,`roots`).map(e=>Uy(e,t)),totals:{...i,sessionCount:X(r.sessionCount,t,`totals.sessionCount`)},usage:jy(n.usage,t),stale:ny(n.stale,t,`stale`)}}function Gy(e,t){let n=`breadcrumbs[]`,r=K(e,t,n);return{sessionId:J(r.sessionId,t,`${n}.sessionId`),title:J(r.title,t,`${n}.title`),isFocus:ny(r.isFocus,t,`${n}.isFocus`)}}function Ky(e,t,n){let r=K(e,t,n),i={providerId:J(r.providerId,t,`${n}.providerId`),modelId:J(r.modelId,t,`${n}.modelId`)},a=Y(r.effort,t,`${n}.effort`);return a!==void 0&&(i.effort=a),i}function qy(e,t){let n=`nodes[]`,r=K(e,t,n),i={sessionId:J(r.sessionId,t,`${n}.sessionId`),title:J(r.title,t,`${n}.title`),depth:X(r.depth,t,`${n}.depth`),childIds:q(r.childIds,t,`${n}.childIds`).map(e=>J(e,t,`${n}.childIds[]`)),ownTokens:sy(r.ownTokens,t,`${n}.ownTokens`),subtreeTokens:sy(r.subtreeTokens,t,`${n}.subtreeTokens`),stepCount:X(r.stepCount,t,`${n}.stepCount`),subtreeNodeCount:X(r.subtreeNodeCount,t,`${n}.subtreeNodeCount`),latestActivityAtMs:X(r.latestActivityAtMs,t,`${n}.latestActivityAtMs`),models:q(r.models,t,`${n}.models`).map(e=>Ky(e,t,`${n}.models[]`))},a=Y(r.worktreeLabel,t,`${n}.worktreeLabel`);a!==void 0&&(i.worktreeLabel=a);let o=Y(r.agent,t,`${n}.agent`);o!==void 0&&(i.agent=o);let s=Y(r.parentId,t,`${n}.parentId`);s!==void 0&&(i.parentId=s);let c=ey(r.cacheUnknownSteps,t,`${n}.cacheUnknownSteps`);return c!==void 0&&(i.cacheUnknownSteps=c),i}function Jy(e,t){let n=`steps[]`,r=K(e,t,n),i={sessionId:J(r.sessionId,t,`${n}.sessionId`),messageId:J(r.messageId,t,`${n}.messageId`),atMs:X(r.atMs,t,`${n}.atMs`),branch:X(r.branch,t,`${n}.branch`),stack:oy(r.stack,t,`${n}.stack`),contextTokens:X(r.contextTokens,t,`${n}.contextTokens`),totalTokens:X(r.totalTokens,t,`${n}.totalTokens`)},a=ey(r.createdAtMs,t,`${n}.createdAtMs`);return a!==void 0&&(i.createdAtMs=a),r.model!==void 0&&(i.model=Ky(r.model,t,`${n}.model`)),r.cacheReadUnknown!==void 0&&ny(r.cacheReadUnknown,t,`${n}.cacheReadUnknown`)&&(i.cacheReadUnknown=!0),r.cacheWriteUnknown!==void 0&&ny(r.cacheWriteUnknown,t,`${n}.cacheWriteUnknown`)&&(i.cacheWriteUnknown=!0),r.inputMarker!==void 0&&ny(r.inputMarker,t,`${n}.inputMarker`)&&(i.inputMarker=!0),i}function Yy(e,t){let n=`compactionMarkers[]`,r=K(e,t,n);return{sessionId:J(r.sessionId,t,`${n}.sessionId`),atMs:X(r.atMs,t,`${n}.atMs`),messageId:J(r.messageId,t,`${n}.messageId`)}}function Xy(e,t){let n=K(e,t,`not an object`),r=K(n.ownSummary,t,`ownSummary`),i=sy(r,t,`ownSummary`),a=n.unobservedAtMs===void 0?void 0:q(n.unobservedAtMs,t,`unobservedAtMs`).map(e=>X(e,t,`unobservedAtMs[]`));return{...a===void 0?{}:{unobservedAtMs:a},focusSessionId:J(n.focusSessionId,t,`focusSessionId`),timeZone:J(n.timeZone,t,`timeZone`),projectId:J(n.projectId,t,`projectId`),projectName:J(n.projectName,t,`projectName`),breadcrumbs:q(n.breadcrumbs,t,`breadcrumbs`).map(e=>Gy(e,t)),nodes:q(n.nodes,t,`nodes`).map(e=>qy(e,t)),steps:q(n.steps,t,`steps`).map(e=>Jy(e,t)),compactionMarkers:q(n.compactionMarkers,t,`compactionMarkers`).map(e=>Yy(e,t)),ownSummary:{...i,stepCount:X(r.stepCount,t,`ownSummary.stepCount`)},treeTotals:sy(n.treeTotals,t,`treeTotals`),stepSemantics:J(n.stepSemantics,t,`stepSemantics`)}}function Zy(e,t,n){let r={};for(let[i,a]of Object.entries(K(e,t,n)))r[i]=J(a,t,`${n}.${i}`);return r}function Qy(e,t,n){return q(e,t,n).map(e=>J(e,t,`${n}[]`))}function $y(e,t){let n=`import`,r=K(e,t,n),i={available:ny(r.available,t,`${n}.available`),issues:dy(r.issues,t,`${n}.issues`)},a=Y(r.from,t,`${n}.from`);a!==void 0&&(i.from=a);let o=ey(r.keyCount,t,`${n}.keyCount`);return o!==void 0&&(i.keyCount=o),i}function eb(e,t){let n=`issues[]`,r=K(e,t,n);return{label:J(r.label,t,`${n}.label`),key:J(r.key,t,`${n}.key`),message:J(r.message,t,`${n}.message`)}}function tb(e,t=`/api/v1/settings`){let n=K(e,t,`not an object`),r=K(n.dashboard,t,`dashboard`),i=K(n.visibility,t,`visibility`),a=n.provenance===void 0?void 0:Object.fromEntries(Object.entries(K(n.provenance,t,`provenance`)).map(([e,n])=>[e,{scope:Z(K(n,t,`provenance[]`).scope,[`defaults`,`global`,`workspace`,`project`,`legacy`],t,`provenance[].scope`)}]));return{revision:J(n.revision,t,`revision`),pathLabel:J(n.pathLabel,t,`pathLabel`),values:K(n.values,t,`values`),sources:Zy(n.sources,t,`sources`),...a===void 0?{}:{provenance:a},writable:Qy(n.writable,t,`writable`),dashboard:{port:X(r.port,t,`dashboard.port`),url:J(r.url,t,`dashboard.url`)},visibility:{hiddenCards:Qy(i.hiddenCards,t,`visibility.hiddenCards`),hiddenRows:Qy(i.hiddenRows,t,`visibility.hiddenRows`)},import:$y(n.import,t),issues:q(n.issues,t,`issues`).map(e=>eb(e,t))}}function nb(e,t){let n=K(e,t,`not an object`);return{revision:J(n.revision,t,`revision`),applied:K(n.applied,t,`applied`),warnings:dy(n.warnings,t,`warnings`)}}function rb(e,t){let n=K(e,t,`not an object`);return{from:J(n.from,t,`from`),keys:q(n.keys,t,`keys`).map(e=>{let n=K(e,t,`keys[]`);return{key:J(n.key,t,`keys[].key`),value:n.value}}),issues:dy(n.issues,t,`issues`),expectedRevision:J(n.expectedRevision,t,`expectedRevision`)}}function ib(e,t){if(e===void 0)return;let n=K(e,t,`error.details`),r={};for(let[e,t]of Object.entries(n))r[e]=t;return r}async function ab(e,t){let n=new Iv(`internal`,e.status,`The dashboard request to ${t} failed with status ${e.status}.`);try{let r=await e.json();if(!$v(r))return n;let i=r.error;if(!$v(i))return n;let a=Y(i.code,t,`error.code`),o=Y(i.message,t,`error.message`);return a===void 0||o===void 0?n:new Iv(a,e.status,o,ib(i.details,t))}catch{return n}}function ob(e={}){let t=e.baseUrl??``,n=e.fetchImpl??globalThis.fetch.bind(globalThis),r=e.eventSourceFactory??(e=>new EventSource(e,{withCredentials:!1})),i=new Set,a=`connecting`;function o(t){if(t!==a){a=t,e.onConnectionChange?.(t);for(let e of i)e(t)}}async function s(e,r){let i=await n(`${t}${e}`,{...r,headers:r?.body===void 0?void 0:{"content-type":`application/json`},cache:`no-store`});if(!i.ok)throw await ab(i,e);return await i.json()}function c(e,t,n){return s(e,{method:n,body:JSON.stringify(t)})}return{async setActiveView(e){let t=`/api/v1/view`;if(Z(K(await c(t,{scope:e},`PUT`),t,`not an object`).scope,[`quota`,`analytics`],t,`scope`)!==e)throw G(t,`scope does not match the requested view`)},connection:()=>a,onConnectionChange(e){return i.add(e),()=>i.delete(e)},async health(){let e=`/api/v1/health`,t=K(await s(e),e,`not an object`),n=Y(t.version,e,`version`),r=Y(t.build,e,`build`);return{app:`opencode-quota-gui`,contractVersion:X(t.contractVersion,e,`contractVersion`),...n===void 0?{}:{version:n},...r===void 0?{}:{build:r}}},async quota(e){return Vy(e?.refresh?await c(`/api/v1/quota`,{},`POST`):await s(`/api/v1/quota`))},async home(e){let t=`/api/v1/home?range=${encodeURIComponent(e.range)}${e.background?`&background=true`:``}`;return Hy(await s(t),t)},async project(e){let t=`/api/v1/projects/${encodeURIComponent(e.projectId)}?range=${encodeURIComponent(e.range)}`;return Wy(await s(t),t)},async session(e){let t=`/api/v1/sessions/${encodeURIComponent(e.sessionId)}`;return Xy(await s(t),t)},async groups(e){let t=e.filter?.dimension??e.dimension,n=t===`model`?`models`:`providers`,r=e.filter?`/${Pv(e.filter.identity)}`:``,i=t===`model`?`provider`:`model`,a=e.filter&&e.dimension!==i?`&group=${e.dimension}`:``,o=`/api/v1/${n}${r}?range=${encodeURIComponent(e.range)}${a}`;return ky(await s(o),o)},async openSettingsFile(){let e=`/api/v1/settings/open`;if(!ny(K(await c(e,{},`POST`),e,`not an object`).opened,e,`opened`))throw G(e,`file was not opened`)},async settings(){return tb(await s(`/api/v1/settings`))},async saveSettings(e){return nb(await c(`/api/v1/settings`,e,`PUT`),`/api/v1/settings`)},async saveVisibility(e){return nb(await c(`/api/v1/visibility`,e,`PUT`),`/api/v1/visibility`)},async importPreview(){return rb(await s(`/api/v1/settings/import`),`/api/v1/settings/import`)},async importApply(e){return nb(await c(`/api/v1/settings/import`,e,`POST`),`/api/v1/settings/import`)},subscribe(e){let n=r(`${t}/api/v1/events`);return o(`connecting`),n.onopen=()=>o(`live`),n.onerror=()=>o(`reconnecting`),n.onmessage=t=>{try{let n=JSON.parse(t.data);dv(n)&&e(n)}catch{}},()=>{n.close(),o(`reconnecting`)}}}}function sb(e,t=vv){if(e&&e.contractVersion===2&&t.build&&t.build!==`unknown`&&(e.build!==t.build||e.version!==t.version))return`Build mismatch · restart OpenCode`}function cb(e){if(e!==2)return`This dashboard speaks contract version 2, the server offers version ${e}. Restart OpenCode, then reload the page to get a matching build.`}function lb(e){return e instanceof Iv?e.message:ub(e)?`OpenCode stopped waiting for this request. The read may still be finishing in the background; Retry in a moment.`:`OpenCode did not return the dashboard data. Retry, or restart OpenCode if this keeps happening.`}function ub(e){if(typeof e!=`object`||!e)return!1;let t=e,n=t.cause;return t.name===`ClientError`&&t.reason===`Transport`&&typeof n==`object`&&!!n&&`name`in n&&n.name===`TimeoutError`}function db(e,t){return ub(e)&&t<18e4}function fb(e,t){return ub(e)&&t>=18e4}async function pb(e,t){let n=Date.now(),r=!1;for(;;){if(t?.()===!0)throw Error(`analytics read cancelled`);try{return await e()}catch(e){if(!ub(e))throw e;if(Date.now()-n<18e4)continue;if(r)throw e;r=!0}}}var mb=new Set([`bad-request`,`bad-host`,`bad-origin`,`unsupported-media-type`,`body-too-large`,`method-not-allowed`,`not-found`,`config-changed`,`config-read-error`,`config-target-error`,`unknown-setting`,`invalid-setting`,`project-not-found`,`session-not-found`]);function hb(e){if(e instanceof Iv)return e.status>=500&&!mb.has(e.code);if(gv(e)&&`type`in e){let t=e.type;if(_v(t))return!mb.has(t)}return!0}function gb(e){if(e instanceof Iv)return e.isConfigChanged;if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`config-changed`&&typeof t.message==`string`}function _b(e,t){return t===void 0?e.data===void 0?e.loading||e.error===void 0?{kind:`skeleton`}:{kind:`error`,message:lb(e.error),retryable:!0,recoverable:hb(e.error)}:{kind:`ready`,data:e.data,stale:e.error!==void 0,refreshing:e.loading}:{kind:`reload-required`,message:t}}function vb(e,t){if(t.length===0)return e;let n=new Set(t);return e.filter(e=>!bv(e,n))}function yb(e,t){return e===`reconnecting`&&t===`live`}function bb(e,t){return e>t}function xb(e,t,n=[]){if(t.length===0)return e;let r=Dv(e.map(e=>e.rowId),t,n);return e.filter(e=>!r.has(e.rowId))}function Sb(e){return e===`auto`?`No provider accounts are available for this workspace. Check the quota plugin configuration.`:e.length===0?`No providers are enabled. Turn at least one on under Settings → Advanced, or set providers to automatic.`:`The enabled providers reported no accounts for this workspace.`}function Cb(e){return e.stepCount>0||e.sessionCount>0}function wb(e){return e?`No tokens were recorded in this range.`:`No activity in this range. Widen the range to see earlier sessions.`}var Tb=[`lifetime`,`30d`],Eb=1e3,Db=16,Ob=2,kb=12582912;function Ab(e){if(!gv(e))return!0;if(e.provisional===!0||e.stale===!0)return!1;let t=e.usage;return gv(t)&&`stale`in t?t.stale!==!0:!0}function jb(e){try{return JSON.stringify(e).length*2}catch{return kb}}function Mb(e){return e.startsWith(`session:`)}function Nb(e,t={}){let[n,r]=b(new Set),i=new Set,a=new Map,o=new Map,s=new Map,c=0,l=0,u=!1,d=()=>t.owner?.(),f=()=>{let e=new Set(i);for(let t of a.keys())e.add(t);for(let[t,n]of o)n.visible&&e.add(t);r(e)};function p(e){let t=s.get(e);t!==void 0&&(s.delete(e),c-=t.bytes)}function m(){for(let[e,t]of s)if(t.sessionDetail){if([...s.values()].filter(e=>e.sessionDetail).length<=Ob)break;p(e)}for(;s.size>Db||c>kb;){let e=s.keys().next().value;if(e===void 0)return;p(e)}}function h(e,t){!u&&Ab(t)&&(p(e),s.set(e,{value:t,bytes:jb(t),owner:d(),sessionDetail:Mb(e)}),c+=s.get(e)?.bytes??0,m())}function g(e){let t=s.get(e);if(t!==void 0){if(t.owner!==d())p(e);else return t.value}}function _(t){if(!u){for(let n of Tb){if(n===t||i.has(n))continue;let r=s.get(`home:${n}`);if(r!==void 0&&r.owner===d())continue;i.add(n);let o=++l;pb(()=>e({range:n,background:!0}),()=>u).then(e=>{u||(e.provisional===!0?(a.set(n,o),f()):(y(n,o),h(`home:${n}`,e)))}).catch(()=>void 0).finally(()=>{i.delete(n),u||f()})}f()}}function v(e){let t=o.get(e)??{count:0,visible:!1};o.set(e,t),t.count+=1,!t.visible&&t.timer===void 0&&!a.has(e)&&(t.timer=setTimeout(()=>{t.timer=void 0,t.visible=!0,f()},Eb));let n=!1;return()=>{n||(n=!0,--t.count,!(t.count>0)&&(t.timer!==void 0&&clearTimeout(t.timer),o.delete(e),f()))}}function y(e,t){let n=a.get(e);n===void 0||n>t||(a.delete(e),f())}return{pending:n,take:g,remember:h,prefetch:_,beginForeground:v,beginRead:()=>++l,noteProvisional(e,t){if(u)return;let n=a.get(e);n!==void 0&&n>t||(a.set(e,t),f())},clearProvisional:y,dispose(){u=!0;for(let e of o.values())e.timer!==void 0&&clearTimeout(e.timer);o.clear(),i.clear(),a.clear(),s.clear(),c=0,r(new Set)}}}var Pb=`opencode-quota-gui.range`;function Fb(e){if(!e)return`7d`;try{let t=e.getItem(Pb);return rv(t)?t:`7d`}catch{return`7d`}}function Ib(e,t){if(e)try{e.setItem(Pb,t)}catch{}}function Lb(e){try{return Fv(decodeURIComponent(e))}catch{return}}function Rb(e){return e===`model`||e===`provider`?e:void 0}function zb(e){try{let t=decodeURIComponent(e);return t.length===0||t.length>256||t.includes(`\\`)||[...t].some(e=>(e.codePointAt(0)??0)<32||e===``)||t.split(`/`).some(e=>e===`.`||e===`..`)||/\.(?:html|css|js|map|svg|woff2?|ttf)\/*$/i.test(t)?void 0:t}catch{return}}function Bb(e,t){let[n=``,r=``]=e.split(`?`),i=new URLSearchParams(r),a=i.get(`range`),o=rv(a)?a:t,s=Rb(i.get(`group`));if(n===`/`||n===`/quota`)return{route:{name:`home`},range:o};if(n===`/analytics`)return{route:{name:`analytics`},range:o};if(n===`/models`)return{route:{name:`models`,dimension:s??`provider`},range:o};if(n===`/settings`)return{route:{name:`settings`},range:o};let c=/^\/(model|provider)\/([^/]+)$/.exec(n);if(c){let e=Lb(c[2]??``);if(e!==void 0){let t=s===void 0?{}:{modelsGroup:s};return{route:c[1]===`model`?{name:`model`,identity:e,...t}:{name:`provider`,identity:e,...t},range:o}}return{route:{name:`not-found`,path:n},range:o}}let l=/^\/(project|session)\/([^/]+)$/.exec(n),u=l?zb(l[2]??``):void 0;return l&&u!==void 0?l[1]===`project`?{route:{name:`project`,projectId:u},range:o}:{route:i.get(`view`)===`individual`?{name:`session`,sessionId:u,individual:!0}:{name:`session`,sessionId:u},range:o}:{route:{name:`not-found`,path:n},range:o}}function Q(e,t){let n=`?range=${t}`,r=e=>e===`model`?`&group=model`:``,i=e=>e===void 0?``:`&group=${e}`;switch(e.name){case`home`:return`/quota`;case`analytics`:return`/analytics${n}`;case`models`:return`/models${n}${r(e.dimension)}`;case`model`:return`/model/${Pv(e.identity)}${n}${i(e.modelsGroup)}`;case`provider`:return`/provider/${Pv(e.identity)}${n}${i(e.modelsGroup)}`;case`project`:return`/project/${encodeURIComponent(e.projectId)}${n}`;case`session`:return`/session/${encodeURIComponent(e.sessionId)}${e.individual?`?view=individual`:``}`;case`settings`:return`/settings`;default:return`/quota`}}function Vb(e,t){let n=Bb(e.pathname===`/`&&e.hash.startsWith(`#/`)?e.hash.slice(1):e.pathname+e.search,t);return{location:n,path:n.route.name===`not-found`?e.pathname+e.search:Q(n.route,n.range)}}function Hb(e){return e.name===`analytics`||e.name===`models`||e.name===`model`||e.name===`provider`||e.name===`project`}function Ub(e){if(e.name===`models`)return e.dimension;if(e.name===`model`)return e.modelsGroup??`model`;if(e.name===`provider`)return e.modelsGroup??`provider`}function Wb(e){return Hb(e)}var Gb=L(`<nav class="qg-frame-tab qg-analytics-tabs"aria-label="Analytics views"><a>Analytics</a><a>Models`);function Kb(e){return(()=>{var t=Gb(),n=t.firstChild,r=n.nextSibling;return x(t=>{var i=Q({name:`analytics`},e.range),a=e.active===`analytics`?`page`:void 0,o=Q({name:`models`,dimension:e.modelsDimension??`model`},e.range),s=e.active===`models`?`page`:void 0;return i!==t.e&&R(n,`href`,t.e=i),a!==t.t&&R(n,`aria-current`,t.t=a),o!==t.a&&R(r,`href`,t.a=o),s!==t.o&&R(r,`aria-current`,t.o=s),t},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}var qb=L(`<output class=qg-badge title="This page and the running dashboard come from different builds. Restart OpenCode so both use the same build. Quota data still works.">`),Jb=L(`<section class=qg-group aria-labelledby=qg-settings-about><h2 class=qg-group__title id=qg-settings-about>About OpenCode Quota GUI</h2><div class=qg-inherited>`);function Yb(e){return j(F,{get when(){return e.message},children:e=>(()=>{var t=qb();return B(t,e),t})()})}function Xb(e){return(()=>{var t=Jb(),n=t.firstChild.nextSibling;return B(n,()=>`Version ${vv.version} · Build ${vv.build} · Contract 2`),B(t,()=>e.children,null),t})()}var Zb=L(`<svg><path fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></svg>`,!1,!0,!1),Qb=L(`<svg viewBox="0 0 24 24"aria-hidden=true xmlns=http://www.w3.org/2000/svg>`),$b=L(`<svg width=16 height=16 viewBox="0 0 256 256"aria-hidden=true xmlns=http://www.w3.org/2000/svg><path fill=currentColor>`),ex=L(`<svg><g fill=currentColor><circle cx=7 cy=5 r=1.4></circle><circle cx=13 cy=5 r=1.4></circle><circle cx=7 cy=12 r=1.4></circle><circle cx=13 cy=12 r=1.4></circle><circle cx=7 cy=19 r=1.4></circle><circle cx=13 cy=19 r=1.4></svg>`,!1,!0,!1);function tx(e){return(()=>{var t=Zb();return R(t,`d`,e),t})()}function nx(e,t){return(()=>{var n=Qb();return R(n,`width`,t),R(n,`height`,t),B(n,e),n})()}var rx=`M228,208a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V48a4,4,0,0,1,8,0V151.19L93.37,101a4,4,0,0,1,5-.19l61.41,46.05L221.37,93a4,4,0,0,1,5.26,6l-64,56a4,4,0,0,1-5,.19l-61.41-46L36,161.81V204H224A4,4,0,0,1,228,208Z`,ix=`M180,80a4,4,0,0,1,4-4h32a4,4,0,0,1,0,8H184A4,4,0,0,1,180,80ZM40,84H148v20a4,4,0,0,0,8,0V56a4,4,0,0,0-8,0V76H40a4,4,0,0,0,0,8Zm176,88H120a4,4,0,0,0,0,8h96a4,4,0,0,0,0-8ZM88,148a4,4,0,0,0-4,4v20H40a4,4,0,0,0,0,8H84v20a4,4,0,0,0,8,0V152A4,4,0,0,0,88,148Z`;function ax(e){return(()=>{var t=$b(),n=t.firstChild;return R(n,`d`,e),t})()}function ox(){return ax(rx)}function sx(){return ax(ix)}function cx(){return nx(ex(),16)}function lx(e){return nx(tx(`M12 19V5M6.5 10.5 12 5l5.5 5.5`),e.size??12)}function ux(e){return nx(tx(`M12 5v14M6.5 13.5 12 19l5.5-5.5`),e.size??12)}function dx(e){return nx(tx(`M6 6l12 12M18 6L6 18`),e.size??14)}var fx=L(`<span class=qg-range__spinner aria-hidden=true>`),px=L(`<span class=qg-range__label>`);function mx(e){return(()=>{var t=px();return B(t,()=>e.label,null),B(t,j(F,{get when(){return e.pending},get children(){return fx()}}),null),x(()=>R(t,`aria-busy`,e.pending?`true`:void 0)),t})()}var hx=L(`<output class=qg-skeleton aria-busy=true>`),gx=L(`<span class=qg-skeleton__line aria-hidden=true>`),_x=L(`<div class=qg-empty><span>`),vx=L(`<div class=qg-error-card role=alert><span class=qg-error-card__message>`),yx=L(`<button type=button>`),bx=L(`<div class=qg-reload role=alert><strong>This dashboard build is out of date</strong><span>`);function xx(e){let t=()=>e.state.kind===`ready`?e.state:void 0,n=()=>e.state.kind===`error`?e.state:void 0,r=()=>{e.onRetry===void 0?typeof window<`u`&&window.location.reload():e.onRetry()};return j(Ie,{get children(){return[j(Le,{get when(){return e.state.kind===`skeleton`},get children(){return e.skeleton??j(Sx,{get label(){return e.label}})}}),j(Le,{keyed:!0,get when(){return n()},children:t=>j(wx,M({get message(){return t.message},get retryable(){return t.retryable},get recoverable(){return t.recoverable},get autoRetry(){return e.autoRetry}},()=>e.onAutoRetry===void 0?{}:{onAutoRetry:e.onAutoRetry},{onRetry:r}))}),j(Le,{keyed:!0,get when(){return t()},children:t=>e.render(t.data,t.stale)}),j(Le,{when:!0,children:null})]}})}function Sx(e){let t=()=>e.lines??3;return(()=>{var n=hx();return B(n,()=>Array.from({length:t()},()=>gx())),x(()=>R(n,`aria-label`,e.label??`Loading`)),n})()}function Cx(e){return(()=>{var t=_x(),n=t.firstChild;return B(n,()=>e.message),B(t,()=>e.children,null),t})()}function wx(e){return(()=>{var t=vx(),n=t.firstChild;return B(n,()=>e.message),B(t,j(F,{get when(){return e.retryable},get children(){return j(Tx,M({get recoverable(){return e.recoverable===!0},get autoRetry(){return e.autoRetry}},()=>e.onAutoRetry===void 0?{}:{onAutoRetry:e.onAutoRetry},{get onRetry(){return e.onRetry}}))}}),null),t})()}function Tx(e){let[t,n]=b(3),r,i=!1,a=e.recoverable===!0&&e.autoRetry!==!1,o=()=>{r!==void 0&&(clearInterval(r),r=void 0)},s=()=>{i||(i=!0,o(),e.onRetry())};return a&&(r=setInterval(()=>{let r=t()-1;r<=0?(i=!0,o(),(e.onAutoRetry??e.onRetry)()):n(r)},1e3)),O(o),(()=>{var n=yx();return n.$$click=s,B(n,()=>a&&!i?`Retry (${t()})`:`Retry`),x(t=>{var r=e.class??`qg-input`,i=e.label;return r!==t.e&&Qe(n,t.e=r),i!==t.t&&R(n,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),n})()}function Ex(e){return(()=>{var t=bx(),n=t.firstChild.nextSibling;return B(n,()=>e.message),t})()}Ye([`click`]);var Dx={repository:`https://github.com/anomalyco/opencode`,commit:`86976449c40d48f2731553a024f74552593d1764`,license:`MIT`,sourcePath:`packages/ui/src/components/provider-icons/sprite.svg`,sourceSpriteSha256:`90c22219a2aeff3ea489625156530ea0fa8a072a1b934a52a9192074d39237df`,logos:{"claude-agent":{label:`Claude Agent`,url:`/assets/providers/claude-agent.svg`,bytes:1137,sha256:`865cd967fb59ec3440d09ec704223a1c300d8bc1560fe5e63e1f3cf9ed2f95cc`,sourcePath:`packages/ui/src/components/provider-icons/sprite.svg`,sourceSymbol:`claude-agent`,sourceCommit:`850504188198976c668bd3b514c3e8de21b9e0e2`,sourceSpriteSha256:`9f17db4e21f4450b000c2e105ad137c775172135eb31d8441940a45e567d0792`},"opencode-go-g":{label:`OpenCode Go`,url:`/assets/providers/opencode-go-g.svg`,bytes:206,sha256:`60f3be46aa4b540c24212d12db462a74a5147ed48a3d8116689bfad20598d1e0`,sourcePath:`packages/ui/src/components/provider-icons/sprite.svg`,sourceSymbol:`opencode-go`}}},Ox={source:`models.dev`,revision:`30a8b13a5a5507979ddbf8d339c7746cf7e4f442`,logos:JSON.parse(`{"302ai":{"label":"302.AI","url":"/assets/providers/302ai.svg"},"abacus":{"label":"Abacus","url":"/assets/providers/abacus.svg"},"abliteration-ai":{"label":"abliteration.ai","url":"/assets/providers/abliteration-ai.svg"},"above":{"label":"above.dev","url":"/assets/providers/above.svg"},"agentrouter":{"label":"AgentRouter","url":"/assets/providers/agentrouter.svg"},"agnes":{"label":"Agnes AI","url":"/assets/providers/agnes.svg"},"ai-router":{"label":"AI-ROUTER","url":"/assets/providers/ai-router.svg"},"ai21":{"label":"AI21 Labs","url":"/assets/providers/ai21.svg"},"aiand":{"label":"ai&","url":"/assets/providers/aiand.svg"},"aihubmix":{"label":"AIHubMix","url":"/assets/providers/aihubmix.svg"},"aimlapi":{"label":"AI/ML API","url":"/assets/providers/aimlapi.svg"},"ainetcafe":{"label":"ainetcafe","url":"/assets/providers/ainetcafe.svg"},"aixy":{"label":"Aixy","url":"/assets/providers/aixy.svg"},"aki-io":{"label":"AKI.IO","url":"/assets/providers/aki-io.svg"},"alibaba":{"label":"Alibaba","url":"/assets/providers/alibaba.svg"},"alibaba-cn":{"label":"Alibaba (China)","url":"/assets/providers/alibaba-cn.svg"},"alibaba-coding-plan":{"label":"Alibaba Coding Plan","url":"/assets/providers/alibaba-coding-plan.svg"},"alibaba-coding-plan-cn":{"label":"Alibaba Coding Plan (China)","url":"/assets/providers/alibaba-coding-plan-cn.svg"},"alibaba-token-plan":{"label":"Alibaba Token Plan","url":"/assets/providers/alibaba-token-plan.svg"},"amazon-bedrock":{"label":"Amazon Bedrock","url":"/assets/providers/amazon-bedrock.svg"},"ambient":{"label":"Ambient","url":"/assets/providers/ambient.svg"},"amd":{"label":"AMD","url":"/assets/providers/amd.svg"},"anthropic":{"label":"Anthropic","url":"/assets/providers/anthropic.svg"},"anyapi":{"label":"AnyAPI","url":"/assets/providers/anyapi.svg"},"arcee":{"label":"Arcee","url":"/assets/providers/arcee.svg"},"atomic-chat":{"label":"Atomic Chat","url":"/assets/providers/atomic-chat.svg"},"auriko":{"label":"Auriko","url":"/assets/providers/auriko.svg"},"azure":{"label":"Azure","url":"/assets/providers/azure.svg"},"azure-cognitive-services":{"label":"Azure Cognitive Services","url":"/assets/providers/azure-cognitive-services.svg"},"bailing":{"label":"Bailing","url":"/assets/providers/bailing.svg"},"baseten":{"label":"Baseten","url":"/assets/providers/baseten.svg"},"bee":{"label":"Bee by HEOSSI","url":"/assets/providers/bee.svg"},"berget":{"label":"Berget.AI","url":"/assets/providers/berget.svg"},"blueclaw":{"label":"Blue Claw","url":"/assets/providers/blueclaw.svg"},"bothub":{"label":"Bothub","url":"/assets/providers/bothub.svg"},"boundless":{"label":"Boundless","url":"/assets/providers/boundless.svg"},"cerebras":{"label":"Cerebras","url":"/assets/providers/cerebras.svg"},"clarifai":{"label":"Clarifai","url":"/assets/providers/clarifai.svg"},"claudinio":{"label":"Claudinio","url":"/assets/providers/claudinio.svg"},"cloudferro-sherlock":{"label":"CloudFerro Sherlock","url":"/assets/providers/cloudferro-sherlock.svg"},"cloudflare-ai-gateway":{"label":"Cloudflare AI Gateway","url":"/assets/providers/cloudflare-ai-gateway.svg"},"cloudflare-workers-ai":{"label":"Cloudflare Workers AI","url":"/assets/providers/cloudflare-workers-ai.svg"},"cohere":{"label":"Cohere","url":"/assets/providers/cohere.svg"},"commandcode":{"label":"CommandCode","url":"/assets/providers/commandcode.svg"},"coralbricks":{"label":"CoralBricks","url":"/assets/providers/coralbricks.svg"},"crossmodel":{"label":"CrossModel","url":"/assets/providers/crossmodel.svg"},"crusoe":{"label":"Crusoe","url":"/assets/providers/crusoe.svg"},"daoxe":{"label":"DaoXE","url":"/assets/providers/daoxe.svg"},"databricks":{"label":"Databricks","url":"/assets/providers/databricks.svg"},"deepinfra":{"label":"Deep Infra","url":"/assets/providers/deepinfra.svg"},"deepseek":{"label":"DeepSeek","url":"/assets/providers/deepseek.svg"},"digitalocean":{"label":"DigitalOcean","url":"/assets/providers/digitalocean.svg"},"dinference":{"label":"DInference","url":"/assets/providers/dinference.svg"},"drun":{"label":"D.Run (China)","url":"/assets/providers/drun.svg"},"ebcloud":{"label":"EBCloud","url":"/assets/providers/ebcloud.svg"},"echo":{"label":"Echo","url":"/assets/providers/echo.svg"},"edenai":{"label":"Eden AI","url":"/assets/providers/edenai.svg"},"empiriolabs":{"label":"EmpirioLabs AI","url":"/assets/providers/empiriolabs.svg"},"engy":{"label":"engy","url":"/assets/providers/engy.svg"},"evroc":{"label":"evroc","url":"/assets/providers/evroc.svg"},"fastrouter":{"label":"FastRouter","url":"/assets/providers/fastrouter.svg"},"fireworks-ai":{"label":"Fireworks AI","url":"/assets/providers/fireworks-ai.svg"},"fluence":{"label":"Fluence","url":"/assets/providers/fluence.svg"},"freemodel":{"label":"FreeModel","url":"/assets/providers/freemodel.svg"},"friendli":{"label":"Friendli","url":"/assets/providers/friendli.svg"},"frogbot":{"label":"FrogBot","url":"/assets/providers/frogbot.svg"},"github-copilot":{"label":"GitHub Copilot","url":"/assets/providers/github-copilot.svg"},"gitlab":{"label":"GitLab Duo","url":"/assets/providers/gitlab.svg"},"google":{"label":"Google","url":"/assets/providers/google.svg"},"google-vertex":{"label":"Vertex","url":"/assets/providers/google-vertex.svg"},"google-vertex-anthropic":{"label":"Vertex (Anthropic)","url":"/assets/providers/google-vertex-anthropic.svg"},"greenpt":{"label":"GreenPT","url":"/assets/providers/greenpt.svg"},"groq":{"label":"Groq","url":"/assets/providers/groq.svg"},"helicone":{"label":"Helicone","url":"/assets/providers/helicone.svg"},"hetzner":{"label":"Hetzner","url":"/assets/providers/hetzner.svg"},"hpc-ai":{"label":"HPC-AI","url":"/assets/providers/hpc-ai.svg"},"huggingface":{"label":"Hugging Face","url":"/assets/providers/huggingface.svg"},"hyper":{"label":"Charm Hyper","url":"/assets/providers/hyper.svg"},"impossibl":{"label":"Impossibl","url":"/assets/providers/impossibl.svg"},"inception":{"label":"Inception","url":"/assets/providers/inception.svg"},"inceptron":{"label":"Inceptron","url":"/assets/providers/inceptron.svg"},"inco":{"label":"Inco","url":"/assets/providers/inco.svg"},"infer":{"label":"Infer by Flow7","url":"/assets/providers/infer.svg"},"inference":{"label":"Inference","url":"/assets/providers/inference.svg"},"inferx":{"label":"InferX","url":"/assets/providers/inferx.svg"},"infomaniak":{"label":"Infomaniak","url":"/assets/providers/infomaniak.svg"},"io-net":{"label":"IO.NET","url":"/assets/providers/io-net.svg"},"iteracompute":{"label":"IteraCompute","url":"/assets/providers/iteracompute.svg"},"jalapeno":{"label":"Jalapeno Cloud","url":"/assets/providers/jalapeno.svg"},"jiekou":{"label":"Jiekou.AI","url":"/assets/providers/jiekou.svg"},"kenari":{"label":"Kenari","url":"/assets/providers/kenari.svg"},"kilo":{"label":"Kilo Gateway","url":"/assets/providers/kilo.svg"},"kimi-code-plan-cn":{"label":"Kimi For Coding (kimi.com)","url":"/assets/providers/kimi-code-plan-cn.svg"},"kimi-code-plan-global":{"label":"Kimi For Coding (kimi.ai)","url":"/assets/providers/kimi-code-plan-global.svg"},"klokintegration":{"label":"klokintegration.se","url":"/assets/providers/klokintegration.svg"},"kosmik":{"label":"Kosmik Compute","url":"/assets/providers/kosmik.svg"},"kuae-cloud-coding-plan":{"label":"KUAE Cloud Coding Plan","url":"/assets/providers/kuae-cloud-coding-plan.svg"},"lilac":{"label":"Lilac","url":"/assets/providers/lilac.svg"},"liquid":{"label":"Liquid Inference","url":"/assets/providers/liquid.svg"},"llmgateway":{"label":"DevPass (LLM Gateway)","url":"/assets/providers/llmgateway.svg"},"llmgateway-providers":{"label":"LLM Gateway","url":"/assets/providers/llmgateway-providers.svg"},"llmtech":{"label":"LLM Tech","url":"/assets/providers/llmtech.svg"},"llmtr":{"label":"LLMTR","url":"/assets/providers/llmtr.svg"},"lmstudio":{"label":"LMStudio","url":"/assets/providers/lmstudio.svg"},"longcat":{"label":"LongCat","url":"/assets/providers/longcat.svg"},"lowrouter":{"label":"LowRouter","url":"/assets/providers/lowrouter.svg"},"lucidquery":{"label":"LucidQuery","url":"/assets/providers/lucidquery.svg"},"lynkr":{"label":"Lynkr","url":"/assets/providers/lynkr.svg"},"meganova":{"label":"Meganova","url":"/assets/providers/meganova.svg"},"melious":{"label":"Melious","url":"/assets/providers/melious.svg"},"merge-gateway":{"label":"Merge Gateway","url":"/assets/providers/merge-gateway.svg"},"meta":{"label":"Meta","url":"/assets/providers/meta.svg"},"minimax":{"label":"MiniMax (minimax.io)","url":"/assets/providers/minimax.svg"},"minimax-cn":{"label":"MiniMax (minimax.cn)","url":"/assets/providers/minimax-cn.svg"},"minimax-cn-coding-plan":{"label":"MiniMax Token Plan (minimax.cn)","url":"/assets/providers/minimax-cn-coding-plan.svg"},"minimax-coding-plan":{"label":"MiniMax Token Plan (minimax.io)","url":"/assets/providers/minimax-coding-plan.svg"},"mistral":{"label":"Mistral","url":"/assets/providers/mistral.svg"},"mixlayer":{"label":"Mixlayer","url":"/assets/providers/mixlayer.svg"},"moark":{"label":"Moark","url":"/assets/providers/moark.svg"},"modal":{"label":"Modal","url":"/assets/providers/modal.svg"},"model-oracle-ai":{"label":"Model Oracle AI","url":"/assets/providers/model-oracle-ai.svg"},"modelis":{"label":"Modelis","url":"/assets/providers/modelis.svg"},"modelscope":{"label":"ModelScope","url":"/assets/providers/modelscope.svg"},"moonshotai":{"label":"Moonshot AI","url":"/assets/providers/moonshotai.svg"},"moonshotai-cn":{"label":"Moonshot AI (China)","url":"/assets/providers/moonshotai-cn.svg"},"munito":{"label":"Munito AI","url":"/assets/providers/munito.svg"},"munito-eu":{"label":"Munito AI (EU)","url":"/assets/providers/munito-eu.svg"},"nan":{"label":"NaN","url":"/assets/providers/nan.svg"},"nano-gpt":{"label":"NanoGPT","url":"/assets/providers/nano-gpt.svg"},"nearai":{"label":"NEAR AI Cloud","url":"/assets/providers/nearai.svg"},"nebius":{"label":"Nebius Token Factory","url":"/assets/providers/nebius.svg"},"neon":{"label":"Neon","url":"/assets/providers/neon.svg"},"neosmith":{"label":"NeoSmith","url":"/assets/providers/neosmith.svg"},"neuralwatt":{"label":"Neuralwatt","url":"/assets/providers/neuralwatt.svg"},"nova":{"label":"Nova","url":"/assets/providers/nova.svg"},"novita-ai":{"label":"Novita AI","url":"/assets/providers/novita-ai.svg"},"nvidia":{"label":"Nvidia","url":"/assets/providers/nvidia.svg"},"oci":{"label":"OCI Generative AI","url":"/assets/providers/oci.svg"},"ofox":{"label":"Ofox","url":"/assets/providers/ofox.svg"},"ollama-cloud":{"label":"Ollama Cloud","url":"/assets/providers/ollama-cloud.svg"},"openai":{"label":"OpenAI","url":"/assets/providers/openai.svg"},"opencode":{"label":"OpenCode","url":"/assets/providers/opencode.svg"},"opencode-go":{"label":"OpenCode Go","url":"/assets/providers/opencode-go.svg"},"openreason":{"label":"OpenReason","url":"/assets/providers/openreason.svg"},"openrouter":{"label":"OpenRouter","url":"/assets/providers/openrouter.svg"},"opper":{"label":"Opper","url":"/assets/providers/opper.svg"},"orcarouter":{"label":"OrcaRouter","url":"/assets/providers/orcarouter.svg"},"ovhcloud":{"label":"OVHcloud AI Endpoints","url":"/assets/providers/ovhcloud.svg"},"pareto":{"label":"Pareto Inference","url":"/assets/providers/pareto.svg"},"pendra":{"label":"Pendra","url":"/assets/providers/pendra.svg"},"perplexity":{"label":"Perplexity","url":"/assets/providers/perplexity.svg"},"perplexity-agent":{"label":"Perplexity Agent","url":"/assets/providers/perplexity-agent.svg"},"pioneer":{"label":"Pioneer","url":"/assets/providers/pioneer.svg"},"poe":{"label":"Poe","url":"/assets/providers/poe.svg"},"poolside":{"label":"Poolside","url":"/assets/providers/poolside.svg"},"prime":{"label":"Prime Inference","url":"/assets/providers/prime.svg"},"privatemode-ai":{"label":"Privatemode AI","url":"/assets/providers/privatemode-ai.svg"},"qihang-ai":{"label":"QiHang","url":"/assets/providers/qihang-ai.svg"},"qiniu-ai":{"label":"Qiniu","url":"/assets/providers/qiniu-ai.svg"},"qvac":{"label":"QVAC","url":"/assets/providers/qvac.svg"},"reflection":{"label":"Reflection","url":"/assets/providers/reflection.svg"},"regolo-ai":{"label":"Regolo AI","url":"/assets/providers/regolo-ai.svg"},"routing-run":{"label":"routing.run","url":"/assets/providers/routing-run.svg"},"runinfra":{"label":"RunInfra","url":"/assets/providers/runinfra.svg"},"salad-cloud":{"label":"SaladCloud AI Gateway","url":"/assets/providers/salad-cloud.svg"},"sambanova":{"label":"SambaNova","url":"/assets/providers/sambanova.svg"},"scaleway":{"label":"Scaleway","url":"/assets/providers/scaleway.svg"},"scnet-token-plan":{"label":"SCNet Token Plan","url":"/assets/providers/scnet-token-plan.svg"},"scx-ai":{"label":"SCX.ai","url":"/assets/providers/scx-ai.svg"},"sensenova":{"label":"SenseNova (China)","url":"/assets/providers/sensenova.svg"},"siliconflow":{"label":"SiliconFlow","url":"/assets/providers/siliconflow.svg"},"siliconflow-cn":{"label":"SiliconFlow (China)","url":"/assets/providers/siliconflow-cn.svg"},"snowflake-cortex":{"label":"Snowflake Cortex","url":"/assets/providers/snowflake-cortex.svg"},"stackit":{"label":"STACKIT","url":"/assets/providers/stackit.svg"},"standardcompute":{"label":"Standard Compute","url":"/assets/providers/standardcompute.svg"},"stepfun":{"label":"StepFun (China)","url":"/assets/providers/stepfun.svg"},"stepfun-ai":{"label":"StepFun (Global)","url":"/assets/providers/stepfun-ai.svg"},"stepfun-ai-step-plan":{"label":"StepFun Step Plan (Global)","url":"/assets/providers/stepfun-ai-step-plan.svg"},"stepfun-step-plan":{"label":"StepFun Step Plan (China)","url":"/assets/providers/stepfun-step-plan.svg"},"subconscious":{"label":"Subconscious","url":"/assets/providers/subconscious.svg"},"submodel":{"label":"submodel","url":"/assets/providers/submodel.svg"},"teamorouter":{"label":"TeamRouter","url":"/assets/providers/teamorouter.svg"},"tempr":{"label":"Tempr Gateway","url":"/assets/providers/tempr.svg"},"tencent-coding-plan":{"label":"Tencent Coding Plan (China)","url":"/assets/providers/tencent-coding-plan.svg"},"tencent-token-plan":{"label":"Tencent Token Plan","url":"/assets/providers/tencent-token-plan.svg"},"tencent-tokenhub":{"label":"Tencent TokenHub","url":"/assets/providers/tencent-tokenhub.svg"},"tensorx":{"label":"TensorX","url":"/assets/providers/tensorx.svg"},"the-grid-ai":{"label":"The Grid AI","url":"/assets/providers/the-grid-ai.svg"},"thinkingmachines":{"label":"Thinking Machines","url":"/assets/providers/thinkingmachines.svg"},"tinfoil":{"label":"Tinfoil","url":"/assets/providers/tinfoil.svg"},"togetherai":{"label":"Together AI","url":"/assets/providers/togetherai.svg"},"tokengo":{"label":"TokenGo","url":"/assets/providers/tokengo.svg"},"tokenrouter":{"label":"TokenRouter","url":"/assets/providers/tokenrouter.svg"},"trustedrouter":{"label":"TrustedRouter","url":"/assets/providers/trustedrouter.svg"},"umans-ai":{"label":"Umans AI","url":"/assets/providers/umans-ai.svg"},"umans-ai-coding-plan":{"label":"Umans AI Coding Plan","url":"/assets/providers/umans-ai-coding-plan.svg"},"unorouter":{"label":"UnoRouter","url":"/assets/providers/unorouter.svg"},"vancine":{"label":"Vancine","url":"/assets/providers/vancine.svg"},"venice":{"label":"Venice AI","url":"/assets/providers/venice.svg"},"vercel":{"label":"Vercel AI Gateway","url":"/assets/providers/vercel.svg"},"vispark":{"label":"Vispark","url":"/assets/providers/vispark.svg"},"vivgrid":{"label":"Vivgrid","url":"/assets/providers/vivgrid.svg"},"volcengine":{"label":"Volcengine Ark","url":"/assets/providers/volcengine.svg"},"volcengine-coding-plan":{"label":"Volcengine Ark Coding Plan","url":"/assets/providers/volcengine-coding-plan.svg"},"vultr":{"label":"Vultr","url":"/assets/providers/vultr.svg"},"wafer.ai":{"label":"Wafer","url":"/assets/providers/wafer.ai.svg"},"wallaby":{"label":"Wallaby","url":"/assets/providers/wallaby.svg"},"wandb":{"label":"CoreWeave","url":"/assets/providers/wandb.svg"},"watsonx":{"label":"watsonx.ai","url":"/assets/providers/watsonx.svg"},"xai":{"label":"xAI","url":"/assets/providers/xai.svg"},"xiaomi":{"label":"Xiaomi","url":"/assets/providers/xiaomi.svg"},"xiaomi-token-plan-ams":{"label":"Xiaomi Token Plan (Europe)","url":"/assets/providers/xiaomi-token-plan-ams.svg"},"xiaomi-token-plan-cn":{"label":"Xiaomi Token Plan (China)","url":"/assets/providers/xiaomi-token-plan-cn.svg"},"xiaomi-token-plan-sgp":{"label":"Xiaomi Token Plan (Singapore)","url":"/assets/providers/xiaomi-token-plan-sgp.svg"},"xpersona":{"label":"Xpersona","url":"/assets/providers/xpersona.svg"},"zai":{"label":"Z.AI","url":"/assets/providers/zai.svg"},"zai-coding-plan":{"label":"Z.AI Coding Plan","url":"/assets/providers/zai-coding-plan.svg"},"zeldoc":{"label":"Zeldoc","url":"/assets/providers/zeldoc.svg"},"zenifra":{"label":"Zenifra","url":"/assets/providers/zenifra.svg"},"zenmux":{"label":"ZenMux","url":"/assets/providers/zenmux.svg"},"zhipuai":{"label":"Zhipu AI","url":"/assets/providers/zhipuai.svg"},"zhipuai-coding-plan":{"label":"Zhipu AI Coding Plan","url":"/assets/providers/zhipuai-coding-plan.svg"}}`)},kx=`generic`,Ax=`/assets/providers/generic.svg`,jx=/^\/assets\/providers\/[a-z0-9][a-z0-9.-]*\.svg$/u,Mx=Ox.logos,Nx={"opencode-go":`opencode-go-g`},Px=Dx.logos,Fx={opencode:`OpenCode Zen`,"opencode-go":`OpenCode Go`,"github-copilot":`GitHub Copilot`,"minimax-coding-plan":`MiniMax Token Plan`,"minimax-cn-coding-plan":`MiniMax Token Plan (CN)`,"kimi-code-plan-global":`Kimi Code`,"kimi-code-plan-cn":`Kimi Code (CN)`,"alibaba-token-plan":`Alibaba Personal Token Plan`,zai:`Z.ai`,zhipuai:`Zhipu`},Ix=new Set([`atomic-chat`,`orcarouter`,`zenmux`]),Lx={anthropic:{label:`Anthropic`,logoKey:`anthropic`},claude:{label:`Claude Agent`,logoKey:`claude-agent`},"claude-agent":{label:`Claude Agent`,logoKey:`claude-agent`},"claude-code":{label:`Claude Agent`,logoKey:`claude-agent`},copilot:{label:`Copilot`,logoKey:`github-copilot`},"copilot-chat":{label:`Copilot`,logoKey:`github-copilot`},"github-copilot-chat":{label:`Copilot`,logoKey:`github-copilot`},chatgpt:{label:`OpenAI`,logoKey:`openai`},codex:{label:`OpenAI`,logoKey:`openai`},cursor:{label:`Cursor`},"cursor-acp":{label:`Cursor`},"open-cursor":{label:`Cursor`},"@rama_nigg/open-cursor":{label:`Cursor`},synthetic:{label:`Synthetic`},chutes:{label:`Chutes`},"chutes-ai":{label:`Chutes`},"gemini-cli":{label:`Gemini CLI`,logoKey:`google`},gemini:{label:`Gemini CLI`,logoKey:`google`},"google-gemini":{label:`Gemini CLI`,logoKey:`google`},"opencode-gemini-auth":{label:`Gemini CLI`,logoKey:`google`},"google-gemini-cli":{label:`Gemini CLI`,logoKey:`google`},"google-agy":{label:`Google AGY`,logoKey:`google`},"opencode-agy-auth":{label:`Google AGY`,logoKey:`google`},"google-agy-auth":{label:`Google AGY`,logoKey:`google`},nanogpt:{label:`NanoGPT`,logoKey:`nano-gpt`},"nano-gpt":{label:`NanoGPT`,logoKey:`nano-gpt`},"opencode-zen":{label:`OpenCode Zen`,logoKey:`opencode`},"opencode-go-subscription":{label:`OpenCode Go`,logoKey:`opencode-go`},"minimax-china-coding-plan":{label:`MiniMax Token Plan (CN)`,logoKey:`minimax-cn-coding-plan`},"minimax-cn":{label:`MiniMax Token Plan (CN)`,logoKey:`minimax-cn-coding-plan`},"minimax-china":{label:`MiniMax Token Plan (CN)`,logoKey:`minimax-cn-coding-plan`},kimi:{label:`Kimi Code (CN)`,logoKey:`kimi-code-plan-cn`},"kimi-code":{label:`Kimi Code (CN)`,logoKey:`kimi-code-plan-cn`},"kimi-for-code":{label:`Kimi Code (CN)`,logoKey:`kimi-code-plan-cn`},"kimi-for-coding":{label:`Kimi Code (CN)`,logoKey:`kimi-code-plan-cn`},glm:{label:`Z.ai`,logoKey:`zai`},"zai-coding-plan":{label:`Z.ai`,logoKey:`zai`},zhipu:{label:`Zhipu`,logoKey:`zhipuai`},"glm-coding-plan":{label:`Zhipu`,logoKey:`zhipuai`},"zhipu-coding-plan":{label:`Zhipu`,logoKey:`zhipuai`},"zhipuai-coding-plan":{label:`Zhipu`,logoKey:`zhipuai`},"deep-seek":{label:`DeepSeek`,logoKey:`deepseek`},"quota-providers":{label:`Quota providers`}};function Rx(e){return e!==void 0&&jx.test(e)?e:void 0}function zx(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Bx(e){return e.trim().length===0?`Unknown provider`:e}function Vx(e){if(e===void 0)return;let t=zx(Nx,e)??e,n=zx(Mx,t)??zx(Px,t);return n===void 0?void 0:{key:t,logo:n}}function Hx(e){let t=zx(Mx,e);if(t!==void 0){let n=Vx(e),r=Rx(n?.logo.url),i=n?.key??e;return r!==void 0&&!Ix.has(e)?{providerId:e,label:zx(Fx,e)??t.label,logoKey:i,logoSrc:r,hasSpecificLogo:!0}:{providerId:e,label:zx(Fx,e)??t.label,logoKey:kx,logoSrc:Ax,hasSpecificLogo:!1}}let n=zx(Lx,e);if(n!==void 0){let t=Vx(n.logoKey),r=Rx(t?.logo.url);return t!==void 0&&r!==void 0?{providerId:e,label:n.label,logoKey:t.key,logoSrc:r,hasSpecificLogo:!0}:{providerId:e,label:n.label,logoKey:kx,logoSrc:Ax,hasSpecificLogo:!1}}return{providerId:e,label:Bx(e),logoKey:kx,logoSrc:Ax,hasSpecificLogo:!1}}var Ux=6e4,Wx=36e5,Gx=864e5,Kx=10080,qx=8*Gx,Jx=6*Wx,Yx=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`];function Xx(e){let t=new Set(e);return Yx.filter(e=>t.has(e))}function Zx(e){switch(e){case`peak`:return`Peak`;case`offpeak`:return`Off-peak`;case`mixed`:return`Mixed`;default:return`Unknown`}}function Qx(e){return e===`peak`?`Peak`:e===`offpeak`?`Off-peak`:`Unknown`}function $x(e){return Number.isFinite(e)?`${Math.round(e*1e3)/1e3}×`:`—`}function eS(e){if(e)return e.unit===`quota_points`?`Quota points: ${$x(e.factor)}`:e.scalar===!1?`API price varies by token type`:e.scalar===!0?`API price: ${$x(e.factor)}`:e.direction===`peak`?`API price: higher`:e.direction===`offpeak`?`API price: lower`:`API price: unchanged`}function tS(e,t){if(t===void 0||!Number.isFinite(t))return`—`;let n=t-e;if(n<=0)return`now`;let r=Math.ceil(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/60),a=r%60;if(i<24)return a===0?`${i}h`:`${i}h ${a}m`;let o=Math.floor(i/24),s=i%24;return s===0?`${o}d`:`${o}d ${s}h`}function nS(e,t){return e.intervals.find(e=>t>=e.startMs&&t<e.endMs)}function rS(e,t){let n=nS(e,t);return n?.phase===`unknown`?{state:`unknown`,...n.effect?{effect:n.effect}:{},...n.reason?{reason:n.reason}:{}}:n?{state:n.phase,...n.effect?{effect:n.effect}:{},...n.reason?{reason:n.reason}:{}}:{state:e.state,...e.effect?{effect:e.effect}:{},...e.reason?{reason:e.reason}:{}}}function iS(e,t){let n=!1,r=!1,i=!1;for(let a of e){let e=rS(a,t).state;e===`unknown`&&(i=!0),e===`peak`&&(n=!0),e===`offpeak`&&(r=!0)}return i?`unknown`:n&&r?`mixed`:n?`peak`:r?`offpeak`:`unknown`}function aS(e,t){return iS(e.models,t)}function oS(e,t){let n=e.intervals.findIndex(e=>t>=e.startMs&&t<e.endMs),r=(n>=0?e.intervals[n+1]:void 0)??e.intervals.find(e=>e.startMs>t);if(r)return{atMs:r.startMs,phase:r.phase,...r.effect?{effect:r.effect}:{},...r.reason?{reason:r.reason}:{}}}function sS(e,t){if(t===void 0)return e;if(e===`unknown`)return t===`unknown`?void 0:t;if(t!==`unknown`)return e===t?e:void 0}function cS(e,t){let n=oS(e,t),r=e.nextChangeAtMs!==void 0&&e.nextChangeAtMs>t?e.nextChangeAtMs:void 0;if(r!==void 0&&(n===void 0||r<n.atMs))return{atMs:r,...e.nextState===void 0?{}:{phase:e.nextState}};if(n!==void 0){if(r===n.atMs){let t=sS(n.phase,e.nextState);return{atMs:n.atMs,...t===void 0?{}:{phase:t},...n.effect?{effect:n.effect}:{},...n.reason?{reason:n.reason}:{}}}return n}}function lS(e,t,n=4){return e.intervals.filter(e=>e.endMs>t).slice(0,n)}function uS(e){return JSON.stringify({state:e.state,effect:e.effect??null,nextChangeAtMs:e.nextChangeAtMs??null,nextState:e.nextState??null,reason:e.reason??null,intervals:e.intervals.map(e=>({startMs:e.startMs,endMs:e.endMs,phase:e.phase,effect:e.effect??null,reason:e.reason??null})),weekly:dS(e.weekly)})}function dS(e){if(!e)return null;let t=e=>e?[e.factor,e.direction,e.unit,e.scalar??null]:null;return{timeZone:e.timeZone,utcOffsetMinutes:e.utcOffsetMinutes,basePhase:e.basePhase,baseEffect:t(e.baseEffect),windows:e.windows.map(e=>({days:Xx(e.days),startMinute:e.startMinute,endMinute:e.endMinute,phase:e.phase,effect:t(e.effect)})).sort((e,t)=>e.startMinute-t.startMinute||e.endMinute-t.endMinute||e.phase.localeCompare(t.phase)||e.days.join(`,`).localeCompare(t.days.join(`,`))||(e.effect?.join(`|`)??``).localeCompare(t.effect?.join(`|`)??``)),exceptHolidays:[...e.exceptHolidays??[]].sort()}}function fS(e){let t=new Map;for(let n of e){let e=uS(n),r=t.get(e);r?r.models.push(n):t.set(e,{key:e,models:[n]})}return[...t.values()]}function pS(e){return JSON.stringify(e??null)}function mS(e,t=0){let n=new Set;for(let r of e.intervals)r.endMs<=t||n.add(pS(r.effect));return n.size>1}var hS=`h23`,gS=new Map;function _S(e,t,n){let r=`${e}|${t??``}|${n??``}`,i=gS.get(r);if(i)return i;let a=e===`parts`?{timeZone:n,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:hS}:e===`date`?{timeZone:n,month:`numeric`,day:`numeric`}:e===`time`?{timeZone:n,hour:`numeric`,minute:`2-digit`,hourCycle:hS}:e===`clock`?{timeZone:`UTC`,hour:`numeric`,minute:`2-digit`,hourCycle:hS}:{timeZone:n,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`2-digit`,hourCycle:hS},o=new Intl.DateTimeFormat(t,a);if(gS.size>=64){let e=gS.keys().next().value;e!==void 0&&gS.delete(e)}return gS.set(r,o),o}function vS(e,t){return Number(e.find(e=>e.type===t)?.value??`0`)}function yS(e,t){let n=_S(`parts`,t.locale,t.timeZone).formatToParts(e);return{year:vS(n,`year`),month:vS(n,`month`),day:vS(n,`day`),hour:vS(n,`hour`),minute:vS(n,`minute`),second:vS(n,`second`)}}function bS(e,t){return e.year===t.year&&e.month===t.month&&e.day===t.day}function xS(e,t){return _S(`date`,t.locale,t.timeZone).format(e)}function SS(e,t){return _S(`time`,t.locale,t.timeZone).format(e)}function CS(e,t){return _S(`dateTime`,t.locale,t.timeZone).format(e)}function wS(e,t){let n=yS(e,t),r=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second);return Math.round((r-Math.floor(e/1e3)*1e3)/Ux)}var TS=new Map;function ES(e,t){let n=`${t.timeZone??`local`}|${Math.floor(e/Wx)}`,r=TS.get(n);if(r!==void 0)return r;let i=wS(e,t),a=!1;for(let n=Jx;n<=qx;n+=Jx)if(wS(e+n,t)!==i){a=!0;break}if(TS.size>=32){let e=TS.keys().next().value;e!==void 0&&TS.delete(e)}return TS.set(n,a),a}function DS(e,t){if(e===1440)return`24:00`;let n=(e%1440+1440)%1440;return _S(`clock`,t.locale,t.timeZone).format(Date.UTC(2026,0,1,0,n))}function OS(e,t,n={}){return e===0&&t===1440?`all day`:`${DS(e,n)}–${DS(t,n)}`}function kS(e,t){let n=yS(e,t);return n.hour===0&&n.minute===0&&n.second===0}function AS(e,t,n={}){return bS(yS(e,n),yS(t,n))?`${CS(e,n)}–${SS(t,n)}`:`${CS(e,n)} → ${CS(t,n)}`}function jS(e,t){return e.filter(e=>e.endMs>t).sort((e,t)=>e.startMs-t.startMs)[0]}function MS(e,t){return e.startMs<=t&&t<e.endMs}function NS(e,t={}){if(kS(e.startMs,t)&&kS(e.endMs,t)){let n=xS(e.startMs,t),r=xS(e.endMs-1,t);return n===r?n:`${n}–${r}`}return AS(e.startMs,e.endMs,t)}function PS(e){return JSON.stringify([e.startMinute,e.endMinute,e.phase,e.effect??null])}function FS(e){let t=e.map(e=>Yx.indexOf(e)).filter(e=>e>=0);return t.length===0?1/0:Math.min(...t)}function IS(e,t){let n=[];for(let r of e.windows){let e=r.endMinute-r.startMinute;if(!(e<=0))for(let i of Xx(r.days)){let a=Yx.indexOf(i);if(a<0)continue;let o=((a*1440+r.startMinute+t)%Kx+Kx)%Kx,s=e;for(;s>0;){let e=Math.floor(o/1440),t=o%1440,i=Math.min(s,1440-t),a=Yx[e];a!==void 0&&n.push({day:a,startMinute:t,endMinute:t+i,phase:r.phase,...r.effect?{effect:r.effect}:{}}),s-=i,o=(o+i)%Kx}}}return n}function LS(e){let t=new Map;for(let n of e){let e=PS(n),r=t.get(e);r?r.days.add(n.day):t.set(e,{startMinute:n.startMinute,endMinute:n.endMinute,phase:n.phase,...n.effect?{effect:n.effect}:{},days:new Set([n.day])})}return[...t.values()].map(e=>({days:Xx([...e.days]),startMinute:e.startMinute,endMinute:e.endMinute,phase:e.phase,...e.effect?{effect:e.effect}:{}})).sort((e,t)=>FS(e.days)-FS(t.days)||e.startMinute-t.startMinute||e.endMinute-t.endMinute||e.phase.localeCompare(t.phase))}function RS(e,t,n={}){let r=e.weekly;if(!r)return{kind:`dates`,intervals:lS(e,t,4)};if(r.windows.length>0&&ES(t,n))return{kind:`dates`,intervals:lS(e,t,4),localClockChanges:!0};let i=LS(IS(r,wS(t,n)-r.utcOffsetMinutes)),a=new Set([pS(r.baseEffect)]);for(let e of r.windows)a.add(pS(e.effect));return{kind:`weekly`,basePhase:r.basePhase,windows:i,effectVaries:a.size>1}}var zS=L(`<button type=button aria-haspopup=dialog aria-expanded=false>`),BS=L(`<div class=qg-interactive-popover__content>`),VS=140,HS;function US(e){let[t,n]=b(),[r,i]=b(!1),[a,o]=b(!1);D(()=>{typeof document<`u`&&ev().then(e=>{n(()=>e.Popover)})});let s,c=!1,l=!1,u,d,f,p=0;function m(e){if(f!==`hover`||a()||!d)return;let t=d.closest(`[data-component="popover-content"]`);t!==null&&e.target===t&&e.preventDefault()}D(()=>{typeof document<`u`&&document.addEventListener(`focusScope.autoFocusOnMount`,m,!0)});function h(t){d=t,t!==void 0&&queueMicrotask(()=>{let t=d?.closest(`[role="dialog"]`);if(t==null)return;let n=t.getAttribute(`aria-labelledby`);(n===null||document.getElementById(n)===null)&&(t.removeAttribute(`aria-labelledby`),t.setAttribute(`aria-label`,e.panelLabel??e.label))})}function g(){s!==void 0&&(clearTimeout(s),s=void 0)}function _(){return u!==void 0&&document.activeElement===u||d?.contains(document.activeElement)===!0}function v(){g(),i(!1),o(!1),p=Date.now()+300,HS?.close===v&&(HS=void 0)}function y(e){if(g(),r())return;let t=HS;t!==void 0&&t.close!==v&&(t.hasFocus()&&u!==void 0&&(l=!0,u.focus({preventScroll:!0}),l=!1),t.close()),f=e,HS={close:v,hasFocus:_},i(!0)}function S(){a()||(u===void 0||document.activeElement!==u)&&(d?.contains(document.activeElement)||(g(),s=setTimeout(()=>{s=void 0,a()||v()},VS)))}function C(e){c?c=!1:e?(o(!0),y(`click`)):v()}function w(){c=!0,queueMicrotask(()=>{c=!1}),a()?v():(o(!0),y(`click`))}return O(()=>{g(),typeof document<`u`&&document.removeEventListener(`focusScope.autoFocusOnMount`,m,!0),HS?.close===v&&(HS=void 0)}),j(F,{get when(){return t()},get fallback(){return(()=>{var t=zS();return B(t,()=>e.children),x(n=>{var r=e.triggerClass,i=e.label;return r!==n.e&&Qe(t,n.e=r),i!==n.t&&R(t,`aria-label`,n.t=i),n},{e:void 0,t:void 0}),t})()},children:t=>j(bt,{get component(){return t()},triggerAs:`button`,get trigger(){return e.children},get triggerProps(){return{type:`button`,class:e.triggerClass,"aria-label":e.label,"aria-haspopup":`dialog`,onPointerEnter:e=>{u=e.currentTarget,y(`hover`)},onPointerLeave:()=>S(),onFocus:e=>{u=e.currentTarget,!(l||Date.now()<p)&&y(`focus`)},onBlur:()=>{requestAnimationFrame(()=>{a()||d?.contains(document.activeElement)||u?.matches(`:hover`)||S()})},onClick:()=>w()}},get open(){return r()},onOpenChange:C,get placement(){return e.placement??`bottom-start`},gutter:6,shift:8,fitViewport:!0,flip:!0,get class(){return e.contentClass},get children(){var t=BS();t.addEventListener(`pointerleave`,()=>S()),t.addEventListener(`pointerenter`,()=>g());var n=h;return typeof n==`function`?rt(n,t):h=t,B(t,()=>e.content),t}})})}var WS=L(`<span aria-hidden=true>`);function GS(e){let t=()=>Hx(e.providerId),n=()=>e.class===void 0?`qg-provider-logo`:`qg-provider-logo ${e.class}`;return(()=>{var e=WS();return x(r=>{var i=n(),a=`url("${t().logoSrc}")`,o=t().logoKey;return i!==r.e&&Qe(e,r.e=i),a!==r.t&&z(e,`--qg-provider-logo`,r.t=a),o!==r.a&&R(e,`data-provider-logo`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),e})()}var KS=L(`<span class=qg-temporal__arrow data-phase=peak>`),qS=L(`<span class=qg-temporal__arrow data-phase=offpeak>`),JS=L(`<span class=qg-temporal__unknown aria-hidden=true>—`),YS=L(`<span class=qg-temporal-popover__schedule-note>Local clock changes; showing exact dates.`),XS=L(`<div class=qg-temporal-popover__schedule>`),ZS=L(`<span class=qg-temporal-popover__interval><span></span><span class=qg-temporal-popover__time>`),QS=L(`<span class=qg-temporal-popover__effect>`),$S=L(`<div class="qg-temporal-popover__schedule qg-temporal-popover__schedule--weekly">`),eC=L(`<span class=qg-temporal-popover__schedule-line> all week`),tC=L(`<span class=qg-temporal-popover__schedule-line><span>`),nC=L(`<span class="qg-temporal-popover__state qg-row__value">`),rC=L(`<span class=qg-temporal-popover__separator aria-hidden=true> • `),iC=L(`<div class=qg-temporal-popover__summary>`),aC=L(`<section class=qg-temporal-popover__model><div class=qg-temporal-popover__model-line><span class=qg-temporal-popover__model-id>`),oC=L(`<span class=qg-temporal-popover__next>`),sC=L(`<span class=qg-temporal-popover__reason>`),cC=L(`<p class=qg-temporal-popover__note>No account discovered for this provider yet.`),lC=L(`<p class=qg-temporal-popover__note>The current peak or off-peak window is unavailable for these models.`),uC=L(`<div class=qg-temporal-popover__body><header class=qg-temporal-popover__head><span class=qg-temporal-popover__provider></span><span class="qg-temporal-popover__phase qg-row__value">`),dC=L(`<section class=qg-temporal-popover__holidays><span class=qg-temporal-popover__section-title></span><span class=qg-temporal-popover__holiday>`),fC=L(`<span class=qg-temporal__chip-body aria-hidden=true><span class=qg-temporal__arrows>`),pC=L(`<fieldset class=qg-temporal aria-label="Temporal pricing status">`),mC=L(`<div class=qg-temporal__group><div class=qg-temporal__chips>`);function hC(e){let t=Hx(e.providerId);return t.label===e.providerId?e.providerLabel:t.label}function gC(e){return e===`peak`?(()=>{var e=KS();return B(e,j(lx,{})),e})():e===`offpeak`?(()=>{var e=qS();return B(e,j(ux,{})),e})():e===`mixed`?[(()=>{var e=qS();return B(e,j(ux,{})),e})(),(()=>{var e=KS();return B(e,j(lx,{})),e})()]:JS()}function _C(e,t){return e===`peak`||e===`offpeak`?e===t?`Next change`:Qx(e):`Next change`}var vC=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],yC=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function bC(e){let t=[...new Set(e)].map(e=>vC.indexOf(e)).filter(e=>e>=0).sort((e,t)=>e-t);if(t.length===0)return`—`;if(t.length===7)return`Daily`;if(t.length===1)return yC[t[0]]??`—`;let n=new Set(t),r=t.filter(e=>!n.has((e+6)%7));if(r.length===1){let e=r[0],t=e;for(let r=1;r<7;r+=1){let i=(e+r)%7;if(!n.has(i))break;t=i}return`${yC[e]}–${yC[t]}`}let i=[],a=t[0],o=a;for(let e of t.slice(1))e===o+1||(i.push(a===o?yC[a]??``:`${yC[a]}–${yC[o]}`),a=e),o=e;return i.push(a===o?yC[a]??``:`${yC[a]}–${yC[o]}`),i.join(`, `)}function xC(e){let t=new Map;for(let n of e.windows){let e=`${n.days.join(`,`)}|${n.phase}`,r=t.get(e);r?r.windows.push(n):t.set(e,{days:n.days,phase:n.phase,windows:[n]})}let n=[...t.values()];for(let e of n)e.windows.sort((e,t)=>e.startMinute-t.startMinute||e.endMinute-t.endMinute);return n.sort((e,t)=>vC.indexOf(e.days[0]??`mon`)-vC.indexOf(t.days[0]??`mon`)||(e.windows[0]?.startMinute??0)-(t.windows[0]?.startMinute??0)||e.phase.localeCompare(t.phase))}function SC(e){return(()=>{var t=XS();return B(t,j(P,{get each(){return e.schedule.intervals},children:t=>{let n=e.nowMs>=t.startMs&&e.nowMs<t.endMs;return(()=>{var r=ZS(),i=r.firstChild,a=i.nextSibling;return B(i,()=>Qx(t.phase)),B(a,()=>AS(t.startMs,t.endMs,e.formatOptions)),B(r,j(F,{get when(){return I(()=>!(!e.effectVaries||n))()&&t.effect},children:e=>(()=>{var t=QS();return B(t,()=>eS(e())),t})()}),null),x(()=>R(i,`data-phase`,t.phase)),r})()}}),null),B(t,j(F,{get when(){return e.schedule.localClockChanges},get children(){return YS()}}),null),t})()}function CC(e){let t=()=>xC(e.schedule),n=t=>t.windows.map(t=>OS(t.startMinute,t.endMinute,e.formatOptions)).join(`, `);return(()=>{var r=$S();return B(r,j(F,{get when(){return t().length>0},get fallback(){return(()=>{var t=eC(),n=t.firstChild;return B(t,()=>Qx(e.schedule.basePhase),n),t})()},get children(){return j(P,{get each(){return t()},children:e=>(()=>{var t=tC(),r=t.firstChild;return B(r,()=>Qx(e.phase)),B(t,()=>`: ${bC(e.days)} · ${n(e)}`,null),x(()=>R(r,`data-phase`,e.phase)),t})()})}})),r})()}function wC(e){let t=()=>e.schedule.kind===`weekly`?e.schedule:void 0,n=()=>e.schedule.kind===`dates`?e.schedule:void 0;return[j(F,{get when(){return t()},children:t=>j(CC,{get schedule(){return t()},get formatOptions(){return e.formatOptions}})}),j(F,{get when(){return n()},children:t=>j(SC,{get schedule(){return t()},get effectVaries(){return e.effectVaries},get nowMs(){return e.nowMs},get formatOptions(){return e.formatOptions}})})]}function TC(e){let t=()=>e.nowMs??Date.now(),n=()=>e.group.models[0],r=()=>rS(n(),t()),i=()=>cS(n(),t()),a=()=>RS(n(),t(),e.formatOptions),o=()=>{let e=a();return e.kind===`weekly`?e.effectVaries:mS(n(),t())},s=()=>a().kind===`weekly`||lS(n(),t()).length>0,c=()=>e.group.models.map(e=>e.modelId).join(`, `),l=()=>eS(r().effect),u=()=>{let e=i();return e===void 0?void 0:`${_C(e.phase,r().state)} in ${tS(t(),e.atMs)}`};return(()=>{var n=aC(),i=n.firstChild,d=i.firstChild;return B(d,c),B(i,j(F,{get when(){return e.showPhase},get children(){var e=nC();return B(e,()=>Qx(r().state)),x(()=>R(e,`data-phase`,r().state)),e}}),null),B(n,j(F,{get when(){return l()!==void 0||u()!==void 0},get children(){var e=iC();return B(e,j(F,{get when(){return l()},children:e=>(()=>{var t=QS();return B(t,e),t})()}),null),B(e,j(F,{get when(){return I(()=>l()!==void 0)()&&u()!==void 0},get children(){return rC()}}),null),B(e,j(F,{get when(){return u()},children:e=>(()=>{var t=oC();return B(t,e),t})()}),null),e}}),null),B(n,j(F,{get when(){return r().reason},children:e=>(()=>{var t=sC();return B(t,e),t})()}),null),B(n,j(F,{get when(){return s()},get children(){return j(wC,{get schedule(){return a()},get effectVaries(){return o()},get nowMs(){return t()},get formatOptions(){return e.formatOptions}})}}),null),n})()}function EC(e){let t=()=>e.nowMs??Date.now(),n=()=>aS(e.status,t()),r=()=>hC(e.status),i=()=>jS(e.status.holidays,t()),a=()=>fS(e.status.models);return(()=>{var o=uC(),s=o.firstChild,c=s.firstChild,l=c.nextSibling;return B(s,j(GS,{get providerId(){return e.status.providerId},class:`qg-temporal-popover__logo`}),c),B(c,r),B(l,()=>Zx(n())),B(o,j(F,{get when(){return!e.status.discovered},get children(){return cC()}}),null),B(o,j(P,{get each(){return a()},children:r=>j(TC,{group:r,get showPhase(){return n()===`mixed`||n()===`unknown`&&e.status.models.some(e=>rS(e,t()).state!==`unknown`)},get nowMs(){return e.nowMs},get formatOptions(){return e.formatOptions}})}),null),B(o,j(F,{get when(){return i()},children:n=>(()=>{var r=dC(),i=r.firstChild,a=i.nextSibling;return B(i,()=>MS(n(),t())?`Current Holiday:`:`Next Holiday:`),B(a,()=>NS(n(),e.formatOptions)),r})()}),null),B(o,j(F,{get when(){return I(()=>e.status.models.length>0)()&&e.status.models.every(e=>rS(e,t()).state===`unknown`)},get children(){return lC()}}),null),x(()=>R(l,`data-phase`,n())),o})()}function DC(e){let t=()=>aS(e.status,Date.now()),n=()=>hC(e.status);return j(US,{get label(){return`${n()}: ${Zx(t())}. Show peak and off-peak details.`},get panelLabel(){return`Peak and off-peak details for ${n()}`},triggerClass:`qg-temporal__chip`,contentClass:`qg-temporal-popover`,placement:`bottom-start`,get content(){return j(EC,{get status(){return e.status}})},get children(){var n=fC(),r=n.firstChild;return B(n,j(GS,{get providerId(){return e.status.providerId},class:`qg-temporal__logo`}),r),B(r,()=>gC(t())),n}})}var OC=[`peak`,`offpeak`,`mixed`,`unknown`];function kC(e){let t=()=>e.providers.filter(t=>{let n=e.overrides?.[t.providerId];return typeof n==`boolean`?n:t.discovered}),n=()=>OC.map(e=>({phase:e,providers:t().filter(t=>aS(t,Date.now())===e)})).filter(e=>e.providers.length>0);return j(F,{get when(){return n().length>0},get children(){var e=pC();return B(e,j(P,{get each(){return n()},children:e=>(()=>{var t=mC(),n=t.firstChild;return B(n,j(P,{get each(){return e.providers},children:e=>j(DC,{status:e})})),x(()=>R(t,`data-phase`,e.phase)),t})()})),e}})}function AC(e){return j(US,{get label(){return`Peak and off-peak pricing details for ${hC(e.status)}`},triggerClass:`qg-row__info`,contentClass:`qg-temporal-popover`,placement:`bottom-end`,get content(){return j(EC,{get status(){return e.status}})},get children(){return j(Pn,{name:`info`,size:`small`})}})}var jC=L(`<div class=qg-toasts aria-live=polite aria-atomic=false>`),MC=L(`<div class=qg-toast><span></span><button type=button class=qg-eye aria-label=Dismiss title=Dismiss>`),NC=6e3;function PC(){let[e,t]=b([]),n=1;return{toasts:e,push(e,r){let i=n++;t(t=>[...t,{id:i,tone:e,message:r}]),setTimeout(()=>{t(e=>e.filter(e=>e.id!==i))},NC)},dismiss(e){t(t=>t.filter(t=>t.id!==e))}}}function FC(e){return(()=>{var t=jC();return B(t,j(P,{get each(){return e.toaster.toasts()},children:t=>(()=>{var n=MC(),r=n.firstChild,i=r.nextSibling;return B(r,()=>t.message),i.$$click=()=>e.toaster.dismiss(t.id),B(i,j(dx,{})),x(e=>{var r=t.tone,i=t.tone===`error`?`alert`:`status`;return r!==e.e&&R(n,`data-tone`,e.e=r),i!==e.t&&R(n,`role`,e.t=i),e},{e:void 0,t:void 0}),n})()})),t})()}Ye([`click`]);var IC=[{key:`cacheRead`,label:`Cache Read`,colorVar:`--qg-token-cache-read`},{key:`input`,label:`Input`,colorVar:`--qg-token-input`},{key:`reasoning`,label:`Reasoning`,colorVar:`--qg-token-reasoning`},{key:`output`,label:`Output`,colorVar:`--qg-token-output`},{key:`cacheWrite`,label:`Cache Write`,colorVar:`--qg-token-cache-write`}],LC=[{limit:0xe8d4a51000,suffix:`T`},{limit:1e9,suffix:`B`},{limit:1e6,suffix:`M`},{limit:1e3,suffix:`k`}];function RC(e){if(!Number.isFinite(e))return`—`;if(e<1e3)return`${Math.round(e)}`;for(let t of LC)if(e>=t.limit){let n=e/t.limit;return`${n>=100?n.toFixed(0):n.toFixed(1)}${t.suffix}`}return`${Math.round(e)}`}function $(e){return Number.isFinite(e)?Math.round(e).toLocaleString(`en-US`):`—`}function zC(e){return e===null||!Number.isFinite(e)?`≈ $—`:`≈ $${e.toFixed(2)}`}function BC(e,t){return t>0?e===null||!Number.isFinite(e)?`Unpriced`:zC(e):`—`}function VC(e,t){if(!Number.isFinite(e))return`—`;if(e===0)return`0`;let n=t>=1?0:t>=.1?1:t>=.01?2:t>=.001?3:t>=1e-4?4:t>=1e-5?5:6;return e.toFixed(n)}function HC(e){return e===void 0||!Number.isFinite(e)?`—`:`${Math.round(e)}%`}function UC(e){return e==null||!Number.isFinite(e)?`—`:`${e.toFixed(2)}%`}function WC(e){return`${e.providerId}/${e.modelId}${e.effort?`#${e.effort}`:``}`}function GC(e){return Number.isFinite(e)?`${Math.round(e)}%`:`—`}function KC(e,t){return e===void 0||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{timeZone:t})}function qC(e,t){return e===void 0||!Number.isFinite(e)?`—`:new Date(e).toLocaleDateString(`en-GB`,{timeZone:t})}function JC(e,t){return e===void 0||!Number.isFinite(e)?`—`:new Date(e).toLocaleTimeString(`en-GB`,{timeZone:t,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function YC(e){if(e===void 0||!Number.isFinite(e)||e<0)return`-`;if(e<1e3)return`${Math.round(e)} ms`;let t=e/1e3;if(t<10)return`${Number(t.toFixed(1))}s`;let n=Math.round(t);if(n<60)return`${n}s`;let r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=e=>String(e).padStart(2,`0`);return r>0?`${r}h ${o(i)}m`:`${i}m ${o(a)}s`}function XC(e,t){return e===void 0||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function ZC(e,t){return new Date(e).toLocaleTimeString(`en-GB`,{timeZone:t,hour:`2-digit`,minute:`2-digit`})}function QC(e,t){return new Date(e).toLocaleDateString(`en-GB`,{timeZone:t,month:`short`,day:`numeric`})}function $C(e,t,n){return t===`hour`?ZC(e,n):QC(e,n)}function ew(e,t){return t>e?t-1:t}function tw(e,t,n,r){return $C(ew(e,t),n,r)}function nw(e,t,n,r,i=` – `){let a=$C(e,n,r),o=$C(n===`day`?ew(e,t):t,n,r);return a===o?a:`${a}${i}${o}`}function rw(e,t,n){if(!(t<=0||n.at(-1)===t-1))return`Through ${e}`}function iw(e,t=Date.now()){if(!e)return;if(e.kind===`lasts_past_reset`)return`Projected to last until reset`;let n=Date.parse(e.projectedAtIso);if(!Number.isFinite(n)||!Number.isFinite(t)||n<=t)return;let r=Math.ceil((n-t)/6e4),i=Math.floor(r/1440),a=Math.floor(r%1440/60),o=r%60;return`Runs out in ~${[i&&`${i}d`,a&&`${a}h`,o&&`${o}m`].filter(Boolean).join(` `)}`}function aw(e){return e===`hour`?`Hourly token usage`:`Daily token usage`}var ow={"24h":`24h`,"7d":`7 days`,"30d":`30 days`,lifetime:`Lifetime`};function sw(e,t,n){let r=e.toLocaleString(`en-US`);return e===1?`${r} ${t}`:`${r} ${n??`${t}s`}`}function cw(e){let t=e.name;if(t===`models`||t===`model`||t===`provider`)return`models`;if(t===`analytics`||t===`project`||t===`session`)return`analytics`}function lw(e){return cw(e)===void 0?`quota`:`analytics`}function uw(e,t,n){let[r,i]=b(void 0),[a,o]=b(void 0),[s,c]=b(!1),l=0;async function u(){let r=++l;c(!0);let a=Date.now();try{let s,c=!1;for(;;)try{s=await e();break}catch(e){if(r!==l)throw e;let i=Date.now()-a;if(t?.(e,i))continue;if(!c&&n?.(e,i)){c=!0;continue}throw e}return r===l&&(i(()=>s),o(void 0),!0)}catch(e){return r===l&&o(e),!1}finally{r===l&&c(!1)}}function d(){l++,c(!1)}function f(e){l++,i(()=>e),o(void 0),c(!1)}return{data:r,error:a,loading:s,run:u,invalidate:d,set:f}}function dw(e){let t=!1,n=!1,r=0,i=0,a=0,o=!1,s,c,l;function u(){let e=s;if(!e||e.forced)return p();if(l?.after===e.promise)return l.promise;let t=i,n=e.promise.then(e=>t===i?p():e);return l={after:e.promise,promise:n},n}function d(e){let t=e?.changed?u:p;return c?c.then(()=>t()):t()}let f=uw(async()=>{let n=t,r=i;t=!1;let a=await e(n);if(r!==i)throw Error(`Quota connection changed`);return a});function p(e=!1,c=!1){if(s&&(!e||s.forced))return s.promise;let l=e||n&&(c||a>r),u=i;l&&(n=!1),t=l;let d=f.run().then(e=>(s?.promise===d&&(s=void 0,l&&!e&&(n=!0,r=u),l&&e&&(o=!0),!l&&e&&(o=!1)),e));return s={forced:l,epoch:u,promise:d},d}function m(){s?.forced&&(n=!0,r=s.epoch),s=void 0,f.invalidate(),i++,o=!1}return{data:f.data,error:f.error,loading:f.loading,read:d,refresh:()=>p(!0),afterReconnect:()=>c?c.then(()=>p(!1,!0)):p(!1,!0),isRefreshing:()=>s?.forced===!0,consumeRefresh:()=>{let e=o;return o=!1,e},invalidate:m,reconnected:()=>{m(),a=i},holdReads:()=>{let e;return c=new Promise(t=>{e=t}),()=>{c=void 0,e()}}}}var fw=L(`<output class=qg-busy aria-live=polite><span aria-hidden=true> <!> s`),pw=1e3;function mw(e=pw){let[t,n]=b(!1),[r,i]=b(!1),[a,o]=b(0),s,c,l=()=>{s!==void 0&&(clearTimeout(s),s=void 0),c!==void 0&&(clearInterval(c),c=void 0)};return{visible:t,hasData:r,elapsedSeconds:a,update(r){if(i(r.hasData),!r.active){l(),n(!1);return}if(t()||s!==void 0)return;let a=Date.now();o(0),c=setInterval(()=>o(Math.floor((Date.now()-a)/1e3)),1e3),s=setTimeout(()=>{s=void 0,n(!0)},e)},dispose(){l(),n(!1)}}}function hw(e){let t=()=>`${e.indicator.hasData()?`Updating`:`Loading`} ${e.label}…`;return j(F,{get when(){return e.indicator.visible()},get children(){var n=fw(),r=n.firstChild,i=r.firstChild.nextSibling;return i.nextSibling,B(n,t,r),B(r,()=>e.indicator.elapsedSeconds(),i),n}})}var gw=`API-equivalent estimate based on model pricing. Not actual billed spend.`,_w=[`--qg-rank-1`,`--qg-rank-2`,`--qg-rank-3`,`--qg-rank-4`,`--qg-rank-5`],vw=`--qg-rank-other`;function yw(e){return e.kind===`unknown`?`unknown`:`known:${e.id}`}function bw(e,t){return e.kind===`unknown`?t.kind===`unknown`:t.kind===`known`&&e.id===t.id}function xw(e,t){return`${e}:${yw(t)}`}function Sw(e,t){return e.kind===`other`?`other`:xw(t,e.identity)}function Cw(e,t,n){let r=xw(e,t);return n===void 0||n.length===0||n.includes(r)?r:`other`}function ww(e){return e===`model`?`model`:`provider`}function Tw(e){return e===`model`?`provider`:`model`}function Ew(e){return`Usage by ${ww(e)}`}function Dw(e,t){let n=ww(t);return e.kind===`unknown`?`Unknown ${n}`:e.id.trim().length===0?`Empty ${n} ID`:t===`provider`?Hx(e.id).label:e.id}function Ow(e){return e.trim().length===0?JSON.stringify(e):e}function kw(e,t,n){let r=Dw(e,t);return t!==`provider`||e.kind!==`known`?r:n.some(n=>n.kind===`known`&&!bw(n,e)&&Dw(n,t)===r)?`${r} (${Ow(e.id)})`:r}function Aw(e,t){let n=ww(t);return e.kind===`unknown`?`No ${n} id was recorded.`:e.id.length===0?`The recorded ${n} id is empty.`:e.id}function jw(e,t){return e.kind===`unknown`&&t.kind===`unknown`?0:e.kind===`unknown`?1:t.kind===`unknown`||e.id<t.id?-1:+(e.id>t.id)}function Mw(e){return[...e].sort((e,t)=>{if(e.kind===`other`||t.kind===`other`)return e.kind===t.kind?0:e.kind===`other`?1:-1;let n=t.tokens.total-e.tokens.total;return n===0?jw(e.identity,t.identity):n})}function Nw(e,t){return t===`other`?vw:_w[e]??`--qg-rank-other`}function Pw(e,t){if(e===`other`||t===void 0)return vw;let n=t.indexOf(e);return n===-1?vw:Nw(n,`entity`)}function Fw(e,t,n){let r=n===`cost`?Iw(e.tokens.apiEquivalentCostUsd,t.tokens.apiEquivalentCostUsd):t.tokens.total-e.tokens.total;return r===0?jw(e.identity,t.identity):r}function Iw(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:t-e}function Lw(e,t){return[...e].sort((e,n)=>Fw(e,n,t))}function Rw(e){return e.apiEquivalentCostUsd!==null&&e.total>0&&(e.unpricedTokens>0||e.unknownTokens>0)}function zw(e){if(!(e.total<=0))return e.apiEquivalentCostUsd===null?`Unpriced`:Rw(e)?`Partial estimate`:void 0}var Bw=`Includes cost recorded by OpenCode for models without models.dev pricing.`;function Vw(e){let t=[`API-equivalent estimate based on model pricing. Not actual billed spend.`];return e.unpricedTokens>0&&t.push(`${Math.round(e.unpricedTokens)} unpriced tokens are excluded.`),e.unknownTokens>0&&t.push(`${Math.round(e.unknownTokens)} unknown tokens are excluded.`),(e.recordedCostUsd??0)>0&&t.push(Bw),t.join(` `)}function Hw(e){let t=e.apiEquivalentCostUsd===null?`No priced tokens in this total.`:`API-equivalent estimate: $${e.apiEquivalentCostUsd.toFixed(6)}. Not actual billed spend.`;return(e.recordedCostUsd??0)>0?`${t} ${Bw}`:t}function Uw(e){return e.total>0&&e.apiEquivalentCostUsd===0&&e.unpricedTokens===0&&e.unknownTokens===0&&(e.recordedCostUsd??0)===0}function Ww(e){return e.total>0?e.apiEquivalentCostUsd===null||!Number.isFinite(e.apiEquivalentCostUsd)?`Unpriced`:Uw(e)?`Free`:BC(e.apiEquivalentCostUsd,e.total):`—`}function Gw(e){return e.total>0?e.apiEquivalentCostUsd===null||!Number.isFinite(e.apiEquivalentCostUsd)?Vw(e):Uw(e)?`Free: every token in this total is priced at zero. Not actual billed spend.`:Rw(e)?Vw(e):Hw(e):`No usage in this total.`}function Kw(e){let t=0,n=0,r=!1,i=0,a=0,o=0,s=0;for(let c of e)t+=c.total,i+=c.unpricedTokens,a+=c.unknownTokens,o+=c.recordedCostUsd??0,s+=c.recordedCostTokens??0,c.apiEquivalentCostUsd!==null&&(r=!0,n+=c.apiEquivalentCostUsd);let c={total:t,apiEquivalentCostUsd:r?n:null,unpricedTokens:i,unknownTokens:a};return o>0&&(c.recordedCostUsd=o,c.recordedCostTokens=s),c}var qw=1/0;function Jw(e,t){let n=new Map;if(e===void 0)return n;for(let[r,i]of e.entries())t.has(i)&&!n.has(i)&&n.set(i,r);return n}function Yw(e,t){return e.map((e,n)=>({card:e,index:n,rank:t(e)})).sort((e,t)=>e.rank===t.rank?e.index-t.index:e.rank-t.rank).map(({card:e})=>e)}function Xw(e,t,n){let r=[...e];if(t!==void 0&&t.length>0){let e=Jw(t,new Set(r.map(e=>e.cardId)));return Yw(r,t=>e.get(t.cardId)??qw)}let i=Jw(n,new Set(r.map(e=>e.providerId)));return i.size===0?r:Yw(r,e=>i.get(e.providerId)??qw)}var Zw=1/0;function Qw(e,t,n=e=>e.rowId,r=[]){if(t===void 0||t.length===0)return[...e];let i=Jw(Sv(t,r),new Set(e.map(e=>xv(n(e),r))));return i.size===0?[...e]:Yw(e,e=>i.get(xv(n(e),r))??Zw)}function $w(e){if(!e)return``;switch(e.kind){case`currency`:return e.code;case`custom`:return e.symbol;default:return e.unit===`unit`?``:e.unit}}function eT(e){return e.startsWith(`-`)?`-$${e.slice(1)}`:`$${e}`}function tT(e){let t=/^(-?)(\d+)(?:\.(\d+))?$/u.exec(e);if(!t)return e;let[,n=``,r=`0`,i=``]=t,a=Number(`${i}000`.slice(0,2))+ +(Number(i.charAt(2)||`0`)>=5),o=BigInt(r),s=a;return s===100&&(o+=1n,s=0),`${n===`-`&&(o!==0n||s!==0)?`-`:``}${o}.${String(s).padStart(2,`0`)}`}function nT(e,t){switch(e.kind){case`percent`:{let n=HC(rT(e,t));return t.percentLabelStyle===`bare`||n===`—`?n:`${n} ${t.percentMode}`}case`quantity`:{if(!e.quantity)return`—`;let t=$w(e.quantity.unit),n=e.quantity.unit.kind===`currency`?tT(e.quantity.decimal):e.quantity.decimal;return e.quantity.unit.kind===`currency`&&e.quantity.unit.code===`USD`?eT(n):t?`${n} ${t}`:n}case`boolean`:return e.booleanValue===void 0?`—`:e.booleanValue?`yes`:`no`;default:return e.value??`—`}}function rT(e,t){if(e.kind!==`percent`)return;let n=t.percentMode===`used`?e.percentUsed:e.percentRemaining;if(n!==void 0)return n;let r=t.percentMode===`used`?e.percentRemaining:e.percentUsed;return r===void 0?void 0:100-r}function iT(e){if(e.kind===`percent`)return e.percentUsed??(e.percentRemaining===void 0?void 0:100-e.percentRemaining)}function aT(e){return e===void 0?`healthy`:e>=90?`critical`:e>=70?`warning`:`healthy`}function oT(e,t){let n=`[${e}] (`;if(t.startsWith(n)&&t.endsWith(`)`)){let e=t.slice(n.length,-1);if(e.length>0&&!/[()[\]\r\n]/.test(e))return e}return t}function sT(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return`reset`;let r=n-t;if(r<=0)return`reset`;let i=Math.ceil(r/6e4),a=Math.floor(i/1440),o=Math.floor(i%1440/60),s=i%60;return a>0?`${a}d ${o}h ${s}m`:o>0?`${o}h ${s}m`:`${s}m`}var cT=L(`<span class=qg-row__bar-fill aria-hidden=true>`),lT=L(`<span class=qg-row__bar-remaining aria-hidden=true>`),uT=L(`<span class=qg-row__bar><meter class=sr-only min=0 max=100>`),dT=L(`<span class=sr-only>More information about `),fT=L(`<span class=qg-row__info aria-hidden=true>`),pT=L(`<span class=qg-reset__tooltip-body><span class=qg-reset__tooltip-title></span><span>`),mT=L(`<span>`),hT=L(`<div class="qg-row qg-row--resets"data-kind=value><span class=qg-row__labelgroup><span class=qg-row__label></span><span class=qg-reset__count> available</span></span><span class=qg-reset__summary></span><fieldset class=qg-reset__segments aria-label="Available reset expiries">`),gT=L(`<span class=sr-only>`),_T=L(`<span class=qg-reset__segment aria-hidden=true>`),vT=L(`<svg><path d="m5 12 4 4L19 6"></svg>`,!1,!0,!1),yT=L(`<p class=qg-stale>`),bT=L(`<div class=qg-card__errors>`),xT=L(`<div class=qg-card__rows>`),ST=L(`<details class=qg-details><summary>Details</summary><table class=qg-detail-rows><tbody>`),CT=L(`<article class=qg-card><header class=qg-card__head><div class=qg-card__identity><span class=qg-card__provider></span></div><button type=button class=qg-card__copy title="Copy quota summary"><svg viewBox="0 0 24 24"width=16 height=16 fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true></svg></button><output class=sr-only>`),wT=L(`<span class=qg-card__account><span aria-hidden=true>· `),TT=L(`<svg><rect x=8 y=8 width=11 height=12 rx=2></svg>`,!1,!0,!1),ET=L(`<svg><path d="M16 8V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h1"></svg>`,!1,!0,!1),DT=L(`<p class=qg-error><span class=qg-error__label></span><span class=qg-error__message>`),OT=L(`<p class=qg-muted>No quota rows are reported for this account.`),kT=L(`<p class=qg-muted>Every row on this card is hidden — clear them in Settings → Visibility.`),AT=L(`<span class=qg-row__reset>Resets in `),jT=L(`<table class=qg-detail-rows><tbody>`),MT=L(`<div class=qg-row><span class=qg-row__labelgroup><span class=qg-row__label>`),NT=L(`<span class=qg-row__value>`),PT=L(`<tr><th scope=row></th><td>`);function FT(e){let t=()=>Math.min(Math.max(e.displayPercent,0),100);return(()=>{var n=uT(),r=n.firstChild;return B(n,j(F,{get when(){return t()>0},get children(){return cT()}}),null),B(n,j(F,{get when(){return t()<100},get children(){return lT()}}),null),x(i=>{var a=e.displayMode,o=`${t()}%`,s=`${e.label} quota ${e.displayMode}`,c=`${t()}% ${e.displayMode}`;return a!==i.e&&R(n,`data-mode`,i.e=a),o!==i.t&&z(n,`--qg-used-position`,i.t=o),s!==i.a&&R(r,`aria-label`,i.a=s),c!==i.o&&R(r,`aria-valuetext`,i.o=c),i},{e:void 0,t:void 0,a:void 0,o:void 0}),x(()=>r.value=t()),n})()}function IT(e){return e.title??`Full reset`}function LT(e,t){return e.kind===`known`&&e.expiresAtMs!==void 0?`Expires ${KC(e.expiresAtMs,t)}`:e.kind===`none`?`No expiry`:`Expiry unknown`}function RT(e){if(e.kind!==`known`||e.expiresAtIso===void 0)return;let t=sT(e.expiresAtIso);return t===`reset`?`Expired`:t.length>0?`In ${t}`:void 0}function zT(e){let t=e.find(e=>e.kind===`known`);if(t){let e=t.expiresAtIso===void 0?``:sT(t.expiresAtIso);if(e===`reset`)return`Nearest expiry has passed`;if(e.length>0)return`Expires in ${e}`}return e.some(e=>e.kind===`unknown`)?`Expiry unknown`:`No expiry`}function BT(e,t,n,r){let i=RT(e);return[`Reset ${t+1} of ${n}`,IT(e),LT(e,r),...i===void 0?[]:[i]].join(`. `)}function VT(e){let t=e.title?.trim(),n=t===void 0||t.length===0?{}:{title:t};if(e.expiresAtIso===null)return{kind:`none`,...n};if(e.expiresAtIso===void 0)return{kind:`unknown`,...n};let r=Date.parse(e.expiresAtIso);return Number.isFinite(r)?{kind:`known`,expiresAtIso:e.expiresAtIso,expiresAtMs:r,...n}:{kind:`unknown`,...n}}function HT(e){let t=e?.availableCount;if(typeof t!=`number`||!Number.isFinite(t)||t<=0)return[];let n=Math.floor(t),r=(Array.isArray(e?.credits)?e.credits:[]).map(VT),i=r.filter(e=>e.kind===`known`).sort((e,t)=>(e.expiresAtMs??0)-(t.expiresAtMs??0)),a=r.filter(e=>e.kind===`none`),o=r.filter(e=>e.kind===`unknown`),s=[...i,...a,...o].slice(0,n),c=Array.from({length:Math.max(0,n-s.length)},()=>({kind:`unknown`}));return[...s,...c]}function UT(e){return e.bankedResets!==void 0}function WT(e){return e.resultType===`balance`}function GT(e){if(e===`Unlimited`)return!0;if(e===void 0)return!1;let t=Number(e);return Number.isFinite(t)&&t>0}function KT(e,t){return(t.visibilityRows??[]).some(t=>t.rowId===e.rowId||t.aliases?.includes(e.rowId))}function qT(e,t){return KT(e,t)?UT(e)?HT(e.bankedResets).length===0:!WT(e)||e.kind===`quantity`?!1:e.kind!==`value`||!GT(e.value):!1}function JT(e,t){return UT(e)&&KT(e,t)}function YT(e){return j(q_,{get value(){return e.info},triggerTabIndex:0,appearance:`large`,contentClass:`qg-row__tooltip`,get children(){return[(()=>{var t=dT();return t.firstChild,B(t,()=>e.label,null),t})(),(()=>{var e=fT();return B(e,j(Pn,{name:`info`,size:`small`})),e})()]}})}function XT(e){let t=()=>RT(e.segment);return(()=>{var n=pT(),r=n.firstChild,i=r.nextSibling;return B(r,()=>IT(e.segment)),B(i,()=>LT(e.segment,e.timeZone)),B(n,j(F,{get when(){return t()},children:e=>(()=>{var t=mT();return B(t,e),t})()}),null),n})()}function ZT(e){let t=C(()=>HT(e.row.bankedResets)),n=C(()=>zT(t()));return(()=>{var r=hT(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=o.firstChild,c=i.nextSibling,l=c.nextSibling;return B(a,()=>e.row.label),B(i,j(F,{get when(){return e.row.info},children:t=>j(YT,{get label(){return e.row.label},get info(){return t()}})}),o),B(o,()=>t().length,s),B(c,n),B(l,j(P,{get each(){return t()},children:(n,r)=>j(q_,{class:`qg-reset__tip`,get value(){return j(XT,{segment:n,get timeZone(){return e.timeZone}})},triggerTabIndex:0,appearance:`large`,contentClass:`qg-reset__tooltip`,get children(){return[(()=>{var i=gT();return B(i,()=>BT(n,r(),t().length,e.timeZone)),i})(),(()=>{var e=_T();return x(()=>R(e,`data-expiry`,n.kind)),e})()]}})})),x(e=>{var n=t().length,r=t().length;return n!==e.e&&R(l,`data-count`,e.e=n),r!==e.t&&z(l,`--qg-reset-count`,e.t=r),e},{e:void 0,t:void 0}),r})()}function QT(e,t){if(e.resetAtIso===void 0)return!1;let n=Date.parse(e.resetAtIso);return Number.isFinite(n)&&n<=t}function $T(e){return e.attemptOutcome===`cooldown`||e.attemptOutcome===`transient`||pv(e.failureCategory)}function eE(e,t){let n=t?Math.max(1,Math.ceil(Math.max(0,e)/1e3)):Math.max(0,Math.floor(Math.max(0,e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);if(r<60)return`${r}m`;let i=Math.floor(r/60),a=r%60;return a>0?`${i}h ${a}m`:`${i}h`}function tE(e,t){if(e===void 0)return;let n=Date.parse(e);if(!(!Number.isFinite(n)||n>t))return`Updated ${eE(t-n,!1)} ago`}function nE(e){let t=6e4,[n,r]=b(0);D(()=>{let e=setInterval(()=>r(e=>e+t),t);O(()=>clearInterval(e))}),S(E(()=>e.nowMs,()=>r(0),{defer:!0}));let i=()=>{let t=n();return e.nowMs===void 0?Date.now():e.nowMs+t},a=()=>{let t=e.card.visibilityRows??[];return Qw(xb(e.card.rows,e.hiddenRows,t),e.preferences.rowOrder?.[e.card.cardId],e=>e.rowId,t)},o=()=>e.stale?a().filter(e=>!QT(e,i())):a(),s=()=>o().filter(t=>!qT(t,e.card)),[c,l]=b(``),u=C(()=>e.card.stale===!0&&s().length>0?e.card.errors.filter($T):[]),d=C(()=>e.card.errors.filter(e=>!u().includes(e))),f=C(()=>{if(u().length===0)return;let t=i(),n=tE(e.card.observedAtIso,t),r=u().map(e=>e.retryAtMs).filter(e=>e!==void 0&&e>t).sort((e,t)=>e-t)[0];return[n,r===void 0?void 0:`retrying in ${eE(r-t,!0)}`].filter(e=>e!==void 0).join(` · `)||void 0});function p(t){if(e.stale)return;let n=i();if(t.runway?.kind===`lasts_past_reset`){let e=t.resetAtIso;if(!e||!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(e)||!(Date.parse(e)>n))return}return iw(t.runway,n)}let m=t=>e.card.accountLabel?t:`Provider-level error · ${t}`;async function h(){let t=[e.card.providerLabel,e.card.planLabel,e.card.accountLabel?oT(e.card.providerLabel,e.card.accountLabel):void 0].filter(e=>e!==void 0&&e.length>0).join(` · `),n=s().map(t=>{if(JT(t,e.card)){let e=HT(t.bankedResets);return`${t.label}: ${e.length} available · ${zT(e)}`}let n=t.countdown?` · Resets in ${t.countdown}`:``,r=t.kind===`percent`?p(t):void 0,i=r?` · ${r}`:``;return`${t.label}: ${nT(t,e.preferences)}${n}${i}`}),r=f(),i=d().flatMap(e=>[m(e.label),e.message]);try{await navigator.clipboard.writeText([t,...e.stale?[r??`Data may be stale`]:[],...i,...n].join(`
10
+ `)),l(`Quota summary copied.`)}catch{l(`Could not copy quota summary.`)}}return(()=>{var t=CT(),n=t.firstChild.firstChild,r=n.firstChild,i=n.nextSibling,o=i.firstChild,l=i.nextSibling;return B(n,j(GS,{get providerId(){return e.card.providerId},class:`qg-card__logo`}),r),B(r,()=>e.card.providerLabel),B(n,j(F,{get when(){return e.card.planLabel},children:e=>(()=>{var t=wT();return t.firstChild,B(t,e,null),t})()}),null),B(n,j(F,{get when(){return e.card.accountLabel},children:t=>(()=>{var n=wT();return n.firstChild,B(n,()=>oT(e.card.providerLabel,t()),null),n})()}),null),i.$$click=()=>void h(),B(o,j(F,{get when(){return c()===`Quota summary copied.`},get fallback(){return[TT(),ET()]},get children(){return vT()}})),B(l,c),B(t,j(F,{get when(){return e.card.stale===!0},get children(){var e=yT();return B(e,()=>f()??`Data may be stale`),e}}),null),B(t,j(F,{get when(){return d().length>0},get children(){var t=bT();return B(t,j(P,{get each(){return d()},children:t=>(()=>{var n=DT(),r=n.firstChild,i=r.nextSibling;return B(r,()=>m(t.label)),B(i,()=>t.message),x(()=>R(n,`data-level`,e.card.accountLabel?`account`:`provider`)),n})()})),t}}),null),B(t,j(F,{get when(){return s().length>0},get fallback(){return[j(F,{get when(){return e.card.rows.length===0},get children(){return j(F,{get when(){return d().length===0},get children(){return OT()}})}}),j(F,{get when(){return I(()=>e.card.rows.length>0)()&&a().length===0},get children(){return kT()}}),j(F,{get when(){return I(()=>e.card.rows.length>0)()&&a().length>0},get children(){return j(F,{get when(){return d().length===0},get children(){return OT()}})}})]},get children(){var t=xT();return B(t,j(P,{get each(){return s()},children:t=>JT(t,e.card)?j(ZT,{row:t,get timeZone(){return e.timeZone}}):(()=>{var n=MT(),r=n.firstChild,i=r.firstChild;return B(i,()=>t.label),B(r,j(F,{get when(){return t.info},children:e=>j(YT,{get label(){return t.label},get info(){return e()}})}),null),B(n,j(F,{get when(){return I(()=>t.kind===`percent`)()&&p(t)},get fallback(){return(()=>{var n=NT();return B(n,()=>nT(t,e.preferences)),n})()},children:n=>j(q_,{class:`qg-row__value-tip`,get value(){return n()},triggerTabIndex:0,contentClass:`qg-row__tooltip`,get children(){var n=NT();return B(n,()=>nT(t,e.preferences)),n}})}),null),B(n,j(F,{get when(){return t.countdown},get children(){var e=AT();return e.firstChild,B(e,()=>t.countdown,null),e}}),null),B(n,j(F,{get when(){return rT(t,e.preferences)!==void 0},get children(){return j(F,{get when(){return p(t)},get fallback(){return j(FT,{get label(){return t.label},get displayPercent(){return rT(t,e.preferences)??0},get displayMode(){return e.preferences.percentMode}})},children:n=>j(q_,{class:`qg-row__bar-tip`,get value(){return n()},triggerTabIndex:0,contentClass:`qg-row__tooltip`,get children(){return j(FT,{get label(){return t.label},get displayPercent(){return rT(t,e.preferences)??0},get displayMode(){return e.preferences.percentMode}})}})})}}),null),B(n,j(F,{get when(){return I(()=>!!e.preferences.detailed)()&&(t.detailRows?.length??0)>0},get children(){var e=jT(),n=e.firstChild;return B(n,j(P,{get each(){return t.detailRows??[]},children:e=>(()=>{var t=PT(),n=t.firstChild,r=n.nextSibling;return B(n,()=>e.label),B(r,()=>e.value),t})()})),e}}),null),x(e=>{var r=t.kind,i=t.kind===`percent`?aT(iT(t)):void 0;return r!==e.e&&R(n,`data-kind`,e.e=r),i!==e.t&&R(n,`data-severity`,e.t=i),e},{e:void 0,t:void 0}),n})()})),t}}),null),B(t,j(F,{get when(){return(e.card.details?.length??0)>0},get children(){var t=ST(),n=t.firstChild.nextSibling.firstChild;return B(n,j(P,{get each(){return e.card.details??[]},children:e=>(()=>{var t=PT(),n=t.firstChild,r=n.nextSibling;return B(n,()=>e.label),B(r,()=>e.value),t})()})),t}}),null),x(n=>{var r=d().length>0?`true`:void 0,a=`Copy quota summary for ${e.card.providerLabel}${e.card.accountLabel?`, ${oT(e.card.providerLabel,e.card.accountLabel)}`:``}`,s=c()===`Quota summary copied.`?`check`:`copy`;return r!==n.e&&R(t,`data-error`,n.e=r),a!==n.t&&R(i,`aria-label`,n.t=a),s!==n.a&&R(o,`data-copy-icon`,n.a=s),n},{e:void 0,t:void 0,a:void 0}),t})()}Ye([`click`]);var rE=[{value:`activity`,label:`Activity`},{value:`tokens`,label:`Tokens`}];function iE(e,t,n){let r=n===`tokens`?t.tokens-e.tokens:t.latestActivityAtMs-e.latestActivityAtMs;return r===0?e.id<t.id?-1:+(e.id>t.id):r}function aE(e,t){return e.map(e=>({row:e,key:{latestActivityAtMs:e.latestActivityAtMs,tokens:e.tokens.total,id:e.projectId}})).sort((e,n)=>iE(e.key,n.key,t)).map(e=>e.row)}function oE(e,t){return e.map(e=>({row:e,key:{latestActivityAtMs:e.latestActivityAtMs,tokens:e.tokens.total,id:e.sessionId}})).sort((e,n)=>iE(e.key,n.key,t)).map(e=>e.row)}function sE(e,t){if(e.length<=1)return e;let n=new Map(e.map(e=>[e.sessionId,e])),r=e[0];if(!r)return e;let i=e=>({latestActivityAtMs:e.latestActivityAtMs,tokens:e.ownTokens.total,id:e.sessionId}),a=e=>{let r=[];for(let t of e.childIds){let e=n.get(t);e!==void 0&&r.push(e)}return r.sort((e,n)=>iE(i(e),i(n),t))},o=[],s=new Set;(e=>{let t=[e];for(;t.length>0;){let e=t.pop();if(s.has(e.sessionId))continue;s.add(e.sessionId),o.push(e);let n=a(e);for(let e=n.length-1;e>=0;--e){let r=n[e];s.has(r.sessionId)||t.push(r)}}})(r);for(let t of e)s.has(t.sessionId)||(s.add(t.sessionId),o.push(t));return o}function cE(e){return j(kp,{class:`qg-sort`,get"aria-label"(){return`Sort ${e.label}`},get value(){return e.value},onChange:t=>{(t===`activity`||t===`tokens`)&&e.onChange(t)},get children(){return j(P,{each:rE,children:e=>j(jp,{get value(){return e.value},get children(){return e.label}})})}})}var lE={longestIdleGap:`Longest idle gap`,longestHighReuseGap:`Longest high-reuse gap`,unavailable:`Unavailable`,gapBasis:`Previous message completed → next message created`,messageCreated:`Created`,messageCompleted:`Completed`,messageDuration:`Duration`,idleSincePrevious:`Idle before`,overlapsPrevious:`Overlaps previous message`,cacheReadTokens:`Cache read`,cacheReuse:`Cache reuse`,providerModelEffort:`Provider / model / effort`};function uE(e){if(e.cacheReadUnknown||e.cacheWriteUnknown)return null;let{input:t,cacheRead:n,cacheWrite:r}=e.stack,i=t+n+r;return i>0?n/i*100:null}function dE(e){let t=e===null||!Number.isFinite(e)?lE.unavailable:UC(e);return`${lE.cacheReuse}: ${t}`}function fE(e){let t=e.createdAtMs;return t!==void 0&&Number.isFinite(t)&&t>0?t:void 0}function pE(e,t){return e.map((e,t)=>({step:e,index:t})).filter(({step:e})=>e.sessionId===t).sort((e,t)=>(fE(e.step)??e.step.atMs)-(fE(t.step)??t.step.atMs)||e.step.atMs-t.step.atMs||(e.step.messageId<t.step.messageId?-1:+(e.step.messageId>t.step.messageId))).map(({index:e})=>e)}function mE(e,t){let n=[],r;return t.forEach((i,a)=>{let o=e[i],s=fE(o),c={stepIndex:i,completedAtMs:o.atMs,overlap:!1};if(s!==void 0&&(c.createdAtMs=s,s<=o.atMs&&(c.durationMs=o.atMs-s)),r!==void 0){let t=e[r];c.previousStepIndex=r,s!==void 0&&(s<t.atMs?(c.overlap=!0,c.overlapMs=t.atMs-s):c.idleMs=s-t.atMs)}n.push({timing:c,adjacent:r!==void 0&&r===t[a-1]}),(r===void 0||o.atMs>=e[r].atMs)&&(r=i)}),n}function hE(e){let t=Array(e.length);for(let n of new Set(e.map(e=>e.sessionId)))for(let{timing:r}of mE(e,pE(e,n)))t[r.stepIndex]=r;return t}function gE(e,t){return e.model!==void 0&&t.model!==void 0&&e.model.providerId===t.model.providerId&&e.model.modelId===t.model.modelId&&e.model.effort===t.model.effort}function _E(e,t,n){return e.some(e=>e>=t&&e<=n)}function vE(e){let t=e.focusSessionId,n=e.steps,r=e.compactionMarkers.filter(e=>e.sessionId===t).map(e=>e.atMs),i=e.unobservedAtMs??[],a=mE(n,pE(n,t)),o=null,s=null;for(let{timing:e,adjacent:t}of a){if(!t||e.idleMs===void 0||e.previousStepIndex===void 0)continue;let a=n[e.previousStepIndex],c=n[e.stepIndex];if(!gE(a,c))continue;let l=fE(a)??a.atMs,u=e.createdAtMs;if(_E(r,l,u)||_E(i,l,u))continue;let d={fromStepIndex:e.previousStepIndex,toStepIndex:e.stepIndex,idleMs:e.idleMs,cacheReusePct:uE(c)};(o===null||d.idleMs>o.idleMs)&&(o=d),d.cacheReusePct!==null&&d.cacheReusePct>=90&&(s===null||d.idleMs>s.idleMs)&&(s=d)}return{sessionId:t,longestIdle:o,longestHighReuse:s,overlappingSteps:a.filter(({timing:e})=>e.overlap).length}}var yE={width:900,height:260,padding:{top:12,right:46,bottom:24,left:48}};function bE(e){let t=Math.max(e.width-e.padding.left-e.padding.right,1),n=Math.max(e.height-e.padding.top-e.padding.bottom,1);return{left:e.padding.left,top:e.padding.top,width:t,height:n,bottom:e.padding.top+n,right:e.padding.left+t}}function xE(e,t){if(!Number.isFinite(e)||e<=0)return 1;let n=e/Math.max(t,1),r=10**Math.floor(Math.log10(n)),i=n/r;return(i<=1?1:i<=2?2:i<=5?5:10)*r}function SE(e,t,n,r){if(e<=0)return[{value:0,y:n.bottom}];let i=r!==void 0&&r>0?r:xE(e,t),a=[];for(let t=0;t<=e+1e-9;t+=i)a.push({value:t,y:n.bottom-t/e*n.height});return a}var CE=8,wE=.3;function TE(e,t={}){if(!Number.isFinite(e)||e<=0)return{max:0,step:0};let n=Math.max(2,Math.floor(t.targetTicks??8)),r=Math.max(0,(t.segmentCount??1)-1),i=e*(1+(t.plotHeight===void 0?0:Math.min(wE,(r+CE)/Math.max(t.plotHeight,1)))),a=Math.max(t.minStep??0,xE(i,n)),o=Math.ceil(i/a-1e-9)*a;return o<e-1e-9&&(o+=a),!t.allowExact&&o<=e+1e-9&&(o+=a),{max:o,step:a}}function EE(e,t,n){return TE(e,{targetTicks:8,plotHeight:t,segmentCount:n,minStep:1})}function DE(e,t){return Math.max(1,Math.ceil(t/Math.max(e,1)))}function OE(e,t,n){if(e<=0)return[];let r=DE(t,n),i=[];for(let t=0;t<e;t+=r)i.push(t);return i}var kE=40,AE=6,jE=8,ME=4,NE=12;function PE(e){return AE*String(e).length}function FE(e,t){return t<=1?e:2+Math.floor((e-1)/t)}function IE(e,t){if(e<=0)return[];if(e===1)return[0];let n=e-1,r=PE(e)+jE,i=Math.max(t,1)/n,a=Math.max(2,Math.min(NE,Math.floor(Math.max(t,0)/r)+1)),o=1;for(;FE(e,o)>a||o>1&&o*i<r;)o=Math.max(o+1,xE(o+1,1));let s=new Set([1,e]);for(let t=o;t<e;t+=o)s.add(t);let c=[...s].sort((e,t)=>e-t),l=(e,t)=>(t-e)*i<Math.max(PE(e),PE(t))+ME,u=c[0],d=c[1];c.length>2&&u!==void 0&&d!==void 0&&l(u,d)&&c.splice(1,1);let f=c.at(-2),p=c.at(-1);return c.length>2&&f!==void 0&&p!==void 0&&l(f,p)&&c.splice(c.length-2,1),c.map(e=>e-1)}var LE=1,RE=1;function zE(e,t=yE){let n=bE(t),r=e.length,i=r>0?n.width/r:n.width,a=e.reduce((e,t)=>Math.max(e,t.tokens.total),0),o=IC.filter(t=>e.some(e=>e.tokens[t.key]>0)),s=e.reduce((e,t)=>Math.max(e,o.reduce((e,n)=>e+ +(t.tokens[n.key]>0),0)),0),c=a>0?EE(a,n.height,s):{max:0,step:0},l=c.max>0?c.max:1,u=e=>n.bottom-e/l*n.height,d=e=>n.left+e*i,f=e=>r===0?0:Math.min(r-1,Math.max(0,Math.floor((e-n.left)/i))),p=i*.72,m=[];e.forEach((e,t)=>{let r=d(t)+(i-p)/2,a=0,s=n.bottom,c=[];for(let n of o){let i=Math.max(0,e.tokens[n.key]);if(!(i>0))continue;let o=u(a);a+=i;let l=o-u(a),d=s-l;c.push({key:n.key,colorVar:n.colorVar,bucketIndex:t,value:i,x:r,y:d,width:p,height:l,radius:Math.min(RE,p/2,l/2)}),s=d-LE}m.push({bucketIndex:t,x:r,width:p,top:c.at(-1)?.y??n.bottom,bottom:n.bottom,total:e.tokens.total,segments:c})});let h=[];for(let t=0;t<e.length;t+=1){let r=e[t];if(!r)continue;let a=BE(r.tokens);a!==null&&h.push({x:d(t)+i/2,y:n.bottom-a/100*n.height,value:a,bucketIndex:t})}let g=[];for(let e of h){let t=g.at(-1);t&&e.bucketIndex===(t.at(-1)?.bucketIndex??-2)+1?t.push(e):g.push([e])}return{plot:n,bucketCount:r,slot:i,barWidth:p,bars:m,visibleCategories:o,cacheRatePoints:h,cacheRatePath:g.map(e=>{let t=GE(e),n=e[0];return e.length===1&&n?`${t} L ${UE(n.x)} ${UE(n.y)}`:t}).filter(e=>e.length>0).join(` `),cacheRateTicks:[0,25,50,75,100].map(e=>({value:e,y:n.bottom-e/100*n.height})),yMax:a,scaleMax:l,ticks:SE(a>0?c.max:0,8,n,c.step),pointIndexes:e.map((e,t)=>t),labelIndexes:OE(r,i,kE),slotX:d,bucketIndexAt:f}}function BE(e){let t=e.input+e.cacheRead+e.cacheWrite;return t>0?e.cacheRead/t*100:null}var VE={width:900,height:240,padding:{top:34,right:56,bottom:34,left:52}};function HE(e){return Number.isFinite(e)?Math.max(0,e):0}function UE(e){return(Number.isFinite(e)?e:0).toFixed(2)}function WE(e,t){let n=e.length,r=[],i=[],a=Array(n).fill(0);for(let a=0;a<n-1;a+=1){let n=e[a+1]-e[a];r.push(n),i.push(n>0?(t[a+1]-t[a])/n:0)}if(n===2)return a[0]=i[0],a[1]=i[0],a;a[0]=i[0],a[n-1]=i[n-2];for(let e=1;e<n-1;e+=1){let t=i[e-1],n=i[e];if(t===0||n===0||t*n<0){a[e]=0;continue}let o=2*r[e]+r[e-1],s=r[e]+2*r[e-1];a[e]=(o+s)/(o/t+s/n)}for(let e=0;e<n-1;e+=1){let t=i[e];if(t===0){a[e]=0,a[e+1]=0;continue}let n=a[e]/t,r=a[e+1]/t,o=n*n+r*r;if(o>9){let i=3/Math.sqrt(o);a[e]=i*n*t,a[e+1]=i*r*t}}return a}function GE(e){if(e.length===0)return``;if(e.length===1)return YE([...e]);for(let t=1;t<e.length;t+=1)if(!(e[t].x>e[t-1].x))return YE([...e]);let t=e.map(e=>e.x),n=e.map(e=>e.y),r=WE(t,n),i=`M ${UE(t[0])} ${UE(n[0])}`;for(let a=0;a<e.length-1;a+=1){let e=t[a],o=t[a+1],s=n[a],c=n[a+1],l=(o-e)/3;i+=` C ${UE(e+l)} ${UE(s+r[a]*l)} ${UE(o-l)} ${UE(c-r[a+1]*l)} ${UE(o)} ${UE(c)}`}return i}function KE(e,t,n){if(e.length<2)return``;let r=e[0],i=e[e.length-1];return`${t} L ${UE(i.x)} ${UE(n)} L ${UE(r.x)} ${UE(n)} Z`}function qE(e,t,n){let r=e.reduce((e,t)=>Math.max(e,t.value),0),i=n??r,a=i>0?TE(i,{targetTicks:4,allowExact:!0,minStep:1}):{max:0,step:0},o=a.max>0?a.max:1,s=e.map(e=>({...e,y:t.bottom-e.value/o*t.height})),c=GE(s);return{points:s,linePath:c,areaPath:KE(s,c,t.bottom),domainMax:i,scaleMax:o,ticks:SE(a.max,4,t,a.step)}}function JE(e,t=VE){let n=bE(t),r=e.steps,i=r.filter(t=>t.sessionId===e.focusSessionId),a=i.length,o=e=>{if(a<=1)return n.left+n.width/2;let t=Math.min(Math.max(e,0),a-1);return n.left+t/(a-1)*n.width},s=[],c=[],l=[],u=[],d=[],f=[],p=0,m=0,h=-1;for(let t of r){let n=HE(t.totalTokens);if(m+=n,t.sessionId!==e.focusSessionId)continue;h+=1,p+=n;let r=o(h),i=HE(t.contextTokens);s.push(i),u.push({stepIndex:h,x:r,value:i}),c.push(p),l.push(m),d.push({stepIndex:h,x:r,value:p}),f.push({stepIndex:h,x:r,value:m})}let g=e.nodes.some(t=>t.sessionId!==e.focusSessionId)||r.some(t=>t.sessionId!==e.focusSessionId),_=Math.max(p,m),v=qE(d,n,_),y=qE(f,n,_),b=[];if(a>0)for(let t of e.compactionMarkers){if(t.sessionId!==e.focusSessionId)continue;let n=i.findIndex(e=>e.sessionId===t.sessionId&&e.atMs>=t.atMs);n<0||b.push({x:o(n),atMs:t.atMs,sessionId:t.sessionId,stepIndex:n})}let x=i.map(e=>uE(e)),S=[];x.forEach((e,t)=>{if(e===null){S.push([]);return}let r={x:o(t),y:n.bottom-Math.min(Math.max(e,0),100)/100*n.height,stepIndex:t},i=S.at(-1);i!==void 0&&i.length>0&&i.at(-1)?.stepIndex===t-1?i.push(r):S.push([r])});let C=S.filter(e=>e.length>0);return{plot:n,stepCount:a,hasDescendants:g,context:qE(u,n),own:v,tree:y,contextValues:s,ownCumulativeValues:c,treeCumulativeValues:l,cumulativeTicks:y.ticks,compaction:b,cache:{rates:x,singles:C.filter(e=>e.length===1).map(e=>e[0]),paths:C.filter(e=>e.length>1).map(YE)},axisLabelY:n.bottom+16,viewHeight:t.height,stepX:o,labelIndexes:IE(a,n.width)}}function YE(e){if(e.length===0)return``;if(e.length===1){let t=e[0];return`M ${t.x.toFixed(2)} ${t.y.toFixed(2)}`}return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x.toFixed(2)} ${e.y.toFixed(2)}`).join(` `)}function XE(){let[e,t]=b(),[n,r]=b();return{active:()=>e()??n(),inspectPointer:t,inspectFocus:r,clearPointer:()=>t(void 0),clearFocus:()=>r(void 0)}}function ZE(e){let{x:t,left:n,width:r,count:i}=e;if(i<=0)return;if(i===1)return 0;let a=Math.max(0,r),o=Math.max(n,Math.min(n+a,t)),s=a>0?(o-n)/a:0;return Math.round(s*(i-1))}function QE(e){let[t,n]=b(e.width),r,i;function a(e){i?.disconnect(),i=void 0,r=e,e&&typeof ResizeObserver<`u`&&(i=new ResizeObserver(([e])=>{e&&e.contentRect.width>0&&n(e.contentRect.width)}),i.observe(e))}return D(()=>{a(r),O(()=>i?.disconnect())}),{size:{get width(){return t()},get height(){return t()<600?220:e.height},padding:e.padding},ref:e=>{e!==r&&a(e)}}}function $E(e){let{chart:t,bounds:n,tooltip:r}=e,i=Math.max(0,e.gap??10),a=Math.max(t.left,n.left),o=Math.min(t.left+t.width,n.left+n.width),s=n.top,c=n.top+n.height,l=Math.max(0,o-a-16),u=Math.max(0,c-s-16),d=Math.min(r.width,l),f=Math.min(r.height,u),p=(e,t,n)=>Math.max(t,Math.min(e,n)),m=t.left+t.width*e.anchor,h=p(e.anchor<.5?m+i:m-i-d,a+8,Math.max(a+8,o-8-d)),g=p(s+(c-s-f)/2,s+8,Math.max(s+8,c-8-f)),_=Math.min(t.top+t.height,c)>Math.max(t.top,s);return{left:h-t.left,top:g-t.top,maxWidth:l,maxHeight:u,visible:o>a&&_&&d>0&&f>0}}function eD(e,t){let[n,r]=b({left:0,top:0,maxWidth:240,maxHeight:240,visible:!1}),i,a,o,s=!1;function c(){if(s||typeof document>`u`||!i||!a)return;let n=i.closest(`.qg-main`);if(!n)return;let o=n.getBoundingClientRect(),c=Math.max(0,o.left+n.clientLeft),l=Math.max(0,o.top+n.clientTop),u=Math.min(window.innerWidth,o.left+n.clientLeft+n.clientWidth),d=Math.min(window.innerHeight,o.top+n.clientTop+n.clientHeight);r($E({chart:i.getBoundingClientRect(),bounds:{left:c,top:l,width:Math.max(0,u-c),height:Math.max(0,d-l)},tooltip:{width:a.offsetWidth,height:a.offsetHeight},anchor:e(),gap:t?.()}))}return S(()=>{e(),c()}),D(()=>{if(typeof document<`u`){if(window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c),typeof ResizeObserver<`u`){o=new ResizeObserver(c),i&&o.observe(i),a&&o.observe(a);let e=i?.closest(`.qg-main`);e&&o.observe(e)}c(),O(()=>{s=!0,o?.disconnect(),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c)})}}),{position:n,chartRef:e=>{i=e},tooltipRef:e=>{a&&o?.unobserve(a),a=e,o?.observe(e),queueMicrotask(c)}}}var tD=L(`<div class=qg-summary>`),nD=L(`<span class=qg-chart-shell__note>`),rD=L(`<div class=qg-chart-shell__stat><span class=qg-chart-shell__label></span><span class=qg-chart-shell__value>`),iD=L(`<div class=qg-chart-shell__actions>`),aD=L(`<aside class=qg-usage__aside>`),oD=L(`<section class="qg-section qg-chart-shell"><header class=qg-chart-shell__head><h2 class=qg-chart-shell__title><span class=qg-chart__title></span></h2></header><div class=qg-chart-shell__panel><div>`);function sD(e){return(()=>{var t=tD();return B(t,j(P,{get each(){return e.items},children:e=>(()=>{var t=rD(),n=t.firstChild,r=n.nextSibling;return B(n,()=>e.label,null),B(n,j(F,{get when(){return e.info},get children(){return e.info}}),null),B(r,()=>e.value),B(t,j(F,{get when(){return e.note},get children(){var t=nD();return B(t,()=>e.note),t}}),null),x(t=>{var n=e.emphasis===`primary`?`primary`:`secondary`,i=e.title;return n!==t.e&&R(r,`data-emphasis`,t.e=n),i!==t.t&&R(r,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()})),t})()}function cD(e){return(()=>{var t=oD(),n=t.firstChild,r=n.firstChild,i=r.firstChild,a=n.nextSibling,o=a.firstChild;return B(i,()=>e.title),B(n,j(F,{get when(){return e.actions},get children(){var t=iD();return B(t,()=>e.actions),t}}),null),B(a,j(F,{get when(){return e.summary},get children(){return e.summary}}),o),B(o,()=>e.children,null),B(o,j(F,{get when(){return e.aside},get children(){var t=aD();return B(t,()=>e.aside),t}}),null),x(n=>{var i=e.headingId,a=e.headingId,s=e.bodyClass??`qg-usage`;return i!==n.e&&R(t,`aria-labelledby`,n.e=i),a!==n.t&&R(r,`id`,n.t=a),s!==n.a&&Qe(o,n.a=s),n},{e:void 0,t:void 0,a:void 0}),t})()}var lD=L(`<span class=sr-only>About the API-equivalent estimate`),uD=L(`<span class=qg-row__info aria-hidden=true>`),dD=L(`<span>`),fD=L(`<span class=qg-partial>Partial estimate`);function pD(){return j(q_,{value:gw,triggerTabIndex:0,appearance:`large`,contentClass:`qg-row__tooltip`,get children(){return[lD(),(()=>{var e=uD();return B(e,j(Pn,{name:`info`,size:`small`})),e})()]}})}function mD(e){let t=()=>e.tokens.total>0&&e.tokens.apiEquivalentCostUsd===null;return(()=>{var n=dD();return B(n,()=>Ww(e.tokens)),x(r=>{var i=e.class,a=t()?`unpriced`:void 0,o=Gw(e.tokens);return i!==r.e&&Qe(n,r.e=i),a!==r.t&&R(n,`data-cost-status`,r.t=a),o!==r.a&&R(n,`title`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()}function hD(e){return j(F,{get when(){return zw(e.totals)===`Partial estimate`},get children(){var t=fD();return x(()=>R(t,`title`,e.showExclusionTitle===!1?void 0:Vw(e.totals))),t}})}var gD=L(`<span class=sr-only>About the API-equivalent estimate`),_D=L(`<span class=qg-row__info aria-hidden=true>`);function vD(e){let t=[`API-equivalent estimate from list prices, not actual subscription spend.`];return e.unknownTokens>0&&t.push(`${$(e.unknownTokens)} unknown tokens are excluded from the estimate.`),e.unpricedTokens>0&&t.push(`${$(e.unpricedTokens)} unpriced tokens are excluded from the estimate.`),e.unknownTokens===0&&e.unpricedTokens===0&&t.push(`All reported tokens are priced; the figure is still an estimate.`),t.join(` `)}function yD(e){return j(q_,{get value(){return vD(e.totals)},triggerTabIndex:0,appearance:`large`,contentClass:`qg-row__tooltip`,get children(){return[gD(),(()=>{var e=_D();return B(e,j(Pn,{name:`info`,size:`small`})),e})()]}})}var bD=L(`<svg><path class=qg-chart__rate-line></svg>`,!1,!0,!1),xD=L(`<svg><circle class=qg-chart__rate-point r=2></svg>`,!1,!0,!1),SD=L(`<div class=qg-chart><svg role=img><text class="qg-chart__axis-title qg-chart__axis-title--tokens"text-anchor=start>TOKEN USAGE</text><text class="qg-chart__axis-title qg-chart__axis-title--rate"text-anchor=end>CACHE HIT RATE</text></svg><div class=qg-chart__hits>`),CD=L(`<div class=sr-only><table><caption> per </caption><thead><tr><th scope=col>Bucket</th><th scope=col>Cache rate</th><th scope=col>Total</th></tr></thead><tbody>`),wD=L(`<ul class=qg-legend>`),TD=L(`<li class=qg-legend__entry><button type=button class=qg-legend__item data-pinnable=true><span class=qg-legend__swatch aria-hidden=true></span><span class=qg-legend__label></span><span class=qg-legend__value>`),ED=L(`<svg><line class=qg-chart__grid-line></svg>`,!1,!0,!1),DD=L(`<svg><text class=qg-chart__axis-label text-anchor=end></svg>`,!1,!0,!1),OD=L(`<svg><line class=qg-chart__tick-mark></svg>`,!1,!0,!1),kD=L(`<svg><text class="qg-chart__axis-label qg-chart__axis-label--rate"text-anchor=start></svg>`,!1,!0,!1),AD=L(`<svg><rect class=qg-chart__segment></svg>`,!1,!0,!1),jD=L(`<svg><text class=qg-chart__axis-label text-anchor=middle></svg>`,!1,!0,!1),MD=L(`<button type=button class=qg-chart__hit>`),ND=L(`<output class=qg-tooltip><p class=qg-tooltip__head><span></span><span class=qg-tooltip__total></span></p><div class="qg-totals__row qg-tooltip__row qg-tooltip__row--rate"><span class="qg-tooltip__swatch qg-tooltip__swatch--line"aria-hidden=true></span><span class=qg-totals__label>Cache rate</span><span class=qg-totals__value>`),PD=L(`<div class="qg-totals__row qg-tooltip__row"><span class=qg-tooltip__swatch aria-hidden=true></span><span class=qg-totals__label></span><span class=qg-totals__value>`),FD=L(`<p class=qg-chart__axis-caption>`),ID=L(`<th scope=col>`),LD=L(`<tr><th scope=row></th><td></td><td>`),RD=L(`<td>`);function zD(e){let t=XE(),[n,r]=b(),[i,a]=b(),[o,s]=b(),c=t.active,l=()=>n()??i()??o(),u=()=>s(void 0),d=e=>{o()===e?(s(void 0),r(t=>t===e?void 0:t),a(t=>t===e?void 0:t)):s(e)},f;D(()=>{if(typeof document>`u`)return;let e=e=>{if(o()===void 0)return;let t=e.target;t instanceof Node&&f?.contains(t)||s(void 0)};document.addEventListener(`click`,e),O(()=>document.removeEventListener(`click`,e))});let{size:p,ref:m}=QE(yE),h=C(()=>zE(e.usage.buckets,p));S(()=>{let e=new Set(h().visibleCategories.map(e=>e.key));r(t=>t!==void 0&&!e.has(t)?void 0:t),a(t=>t!==void 0&&!e.has(t)?void 0:t),s(t=>t!==void 0&&!e.has(t)?void 0:t)});let g=eD(()=>{let e=c();return e===void 0?0:(h().slotX(e)+h().slot/2)/p.width},()=>h().barWidth/2+12),_=()=>e.usage.timeZone,v=()=>e.title??aw(e.usage.bucketUnit),y=()=>[{label:`Total tokens`,value:$(e.usage.totals.total),emphasis:`primary`},{label:`API-equivalent estimate`,value:Ww(e.usage.totals),info:j(yD,{get totals(){return e.usage.totals}}),note:j(hD,{get totals(){return e.usage.totals},showExclusionTitle:!1})}],w=()=>{let t=c();return t===void 0?void 0:e.usage.buckets[t]},T=e=>UC(e),E=()=>{let e=w();return e===void 0?void 0:BE(e.tokens)},k=t=>{let n=BE(t.tokens),r=h().visibleCategories.map(e=>`${e.label} ${$(t.tokens[e.key])}`).join(`, `);return`${$C(t.startMs,e.usage.bucketUnit,_())}: total ${$(t.tokens.total)} tokens${r.length>0?`, ${r}`:``}, cache rate ${T(n)}`},ee=()=>{let t=e.usage.buckets,n=t.at(-1);if(n)return rw(tw(n.startMs,n.endMs,e.usage.bucketUnit,_()),t.length,h().labelIndexes)};return j(cD,{get title(){return v()},get headingId(){return e.headingId},get summary(){return e.summary??j(sD,{get items(){return y()}})},get aside(){return(()=>{var t=wD();return rt(e=>{f=e},t),B(t,j(P,{get each(){return h().visibleCategories},children:t=>(()=>{var n=TD(),i=n.firstChild,s=i.firstChild.nextSibling,c=s.nextSibling;return i.$$click=()=>d(t.key),i.addEventListener(`blur`,()=>a(void 0)),i.addEventListener(`focus`,()=>a(t.key)),i.addEventListener(`pointerleave`,()=>r(void 0)),i.addEventListener(`pointerenter`,()=>r(t.key)),B(s,()=>t.label),B(c,()=>RC(e.usage.totals[t.key])),x(e=>{var n=`Highlight ${t.label}`,r=o()===t.key?`true`:`false`,a=`var(${t.colorVar})`,s=o()===t.key?`true`:void 0;return n!==e.e&&R(i,`aria-label`,e.e=n),r!==e.t&&R(i,`aria-pressed`,e.t=r),a!==e.a&&z(i,`--qg-swatch`,e.a=a),s!==e.o&&R(i,`data-pinned`,e.o=s),e},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),t})()},get children(){return j(F,{get when(){return e.emptyMessage===void 0||e.usage.buckets.length>0},get fallback(){return j(Cx,{get message(){return e.emptyMessage??``}})},get children(){return[(()=>{var n=SD(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling;return n.$$click=u,rt(e=>{m(e),g.chartRef(e)},n),B(r,j(P,{get each(){return h().ticks},children:e=>[(()=>{var t=ED();return x(n=>{var r=h().plot.left,i=h().plot.right,a=e.y,o=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),a!==n.a&&R(t,`y1`,n.a=a),o!==n.o&&R(t,`y2`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=DD();return B(t,()=>RC(e.value)),x(n=>{var r=h().plot.left-8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]}),i),B(r,j(P,{get each(){return h().cacheRateTicks},children:e=>[(()=>{var t=OD();return x(n=>{var r=h().plot.right,i=h().plot.right+4,a=e.y,o=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),a!==n.a&&R(t,`y1`,n.a=a),o!==n.o&&R(t,`y2`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=kD();return B(t,()=>GC(e.value)),x(n=>{var r=h().plot.right+8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]}),null),B(r,j(P,{get each(){return h().bars},children:e=>j(P,{get each(){return e.segments},children:e=>(()=>{var t=AD();return x(n=>{var r=e.key,i=l()===void 0||l()===e.key?`true`:void 0,a=e.x,o=e.y,s=e.width,c=e.height,u=e.radius,d=e.radius,f=`var(${e.colorVar})`;return r!==n.e&&R(t,`data-category`,n.e=r),i!==n.t&&R(t,`data-highlighted`,n.t=i),a!==n.a&&R(t,`x`,n.a=a),o!==n.o&&R(t,`y`,n.o=o),s!==n.i&&R(t,`width`,n.i=s),c!==n.n&&R(t,`height`,n.n=c),u!==n.s&&R(t,`rx`,n.s=u),d!==n.h&&R(t,`ry`,n.h=d),f!==n.r&&R(t,`fill`,n.r=f),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),t})()})}),null),B(r,j(F,{get when(){return h().cacheRatePath.length>0},get children(){var e=bD();return x(()=>R(e,`d`,h().cacheRatePath)),e}}),null),B(r,j(F,{get when(){return h().cacheRatePoints.length===1},get children(){var e=xD();return x(t=>{var n=h().cacheRatePoints[0]?.x,r=h().cacheRatePoints[0]?.y;return n!==t.e&&R(e,`cx`,t.e=n),r!==t.t&&R(e,`cy`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),B(r,j(P,{get each(){return h().labelIndexes},children:t=>{let n=()=>e.usage.buckets[t];return j(F,{get when(){return n()},children:n=>(()=>{var r=jD();return B(r,()=>$C(n().startMs,e.usage.bucketUnit,_())),x(e=>{var n=h().slotX(t)+h().slot/2,i=p.height-8;return n!==e.e&&R(r,`x`,e.e=n),i!==e.t&&R(r,`y`,e.t=i),e},{e:void 0,t:void 0}),r})()})}}),null),$e(o,`pointerleave`,t.clearPointer),B(o,j(P,{get each(){return e.usage.buckets},children:(e,n)=>(()=>{var r=MD();return $e(r,`blur`,t.clearFocus),r.addEventListener(`focus`,()=>t.inspectFocus(n())),r.addEventListener(`pointerenter`,()=>t.inspectPointer(n())),x(t=>{var i=k(e),a=`${(h().slotX(n())-h().plot.left)/h().plot.width*100}%`,o=`${Math.max(h().slot,1)/h().plot.width*100}%`;return i!==t.e&&R(r,`aria-label`,t.e=i),a!==t.t&&z(r,`left`,t.t=a),o!==t.a&&z(r,`width`,t.a=o),t},{e:void 0,t:void 0,a:void 0}),r})()})),B(n,j(F,{get when(){return w()},children:t=>(()=>{var n=ND(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,s=o.firstChild.nextSibling.nextSibling,c=g.tooltipRef;return typeof c==`function`?rt(c,n):g.tooltipRef=n,B(i,()=>nw(t().startMs,t().endMs,e.usage.bucketUnit,_())),B(a,()=>$(t().tokens.total)),B(n,j(P,{get each(){return h().visibleCategories},children:e=>(()=>{var n=PD(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling;return B(i,()=>e.label),B(a,()=>$(t().tokens[e.key])),x(t=>z(r,`--qg-swatch`,`var(${e.colorVar})`)),n})()}),o),B(s,()=>T(E())),x(e=>{var t=`${g.position().left}px`,r=`${g.position().top}px`,i=`${g.position().maxWidth}px`,a=`${g.position().maxHeight}px`,o=g.position().visible?`visible`:`hidden`;return t!==e.e&&z(n,`left`,e.e=t),r!==e.t&&z(n,`top`,e.t=r),i!==e.a&&z(n,`max-width`,e.a=i),a!==e.o&&z(n,`max-height`,e.o=a),o!==e.i&&z(n,`visibility`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}),null),x(e=>{var t=l()===void 0?void 0:`true`,s=`0 0 ${p.width} ${p.height}`,c=`${v()}. Stacked token usage with a cache hit rate on the right axis.`,u=h().plot.left,d=h().plot.top-6,f=h().plot.right,m=h().plot.top-6,g=`${h().plot.top/p.height*100}%`,_=`${(p.height-h().plot.bottom)/p.height*100}%`,y=`${h().plot.left/p.width*100}%`,b=`${(p.width-h().plot.right)/p.width*100}%`;return t!==e.e&&R(n,`data-highlight`,e.e=t),s!==e.t&&R(r,`viewBox`,e.t=s),c!==e.a&&R(r,`aria-label`,e.a=c),u!==e.o&&R(i,`x`,e.o=u),d!==e.i&&R(i,`y`,e.i=d),f!==e.n&&R(a,`x`,e.n=f),m!==e.s&&R(a,`y`,e.s=m),g!==e.h&&z(o,`top`,e.h=g),_!==e.r&&z(o,`bottom`,e.r=_),y!==e.d&&z(o,`left`,e.d=y),b!==e.l&&z(o,`right`,e.l=b),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),n})(),j(F,{get when(){return ee()},children:e=>(()=>{var t=FD();return B(t,e),t})()}),(()=>{var t=CD(),n=t.firstChild.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=a.firstChild.nextSibling,s=i.nextSibling;return B(n,v,r),B(n,()=>e.usage.bucketUnit,null),B(a,j(P,{get each(){return h().visibleCategories},children:e=>(()=>{var t=ID();return B(t,()=>e.label),t})()}),o),B(s,j(P,{get each(){return e.usage.buckets},children:t=>(()=>{var n=LD(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling;return B(r,()=>$C(t.startMs,e.usage.bucketUnit,_())),B(n,j(P,{get each(){return h().visibleCategories},children:e=>(()=>{var n=RD();return B(n,()=>$(t.tokens[e.key])),n})()}),i),B(i,()=>T(BE(t.tokens))),B(a,()=>$(t.tokens.total)),n})()})),t})()]}})}})}Ye([`click`]);var BD=L(`<div class=qg-card-grid>`),VD=L(`<section class="qg-section qg-quota"id=qg-home-quota aria-label=Quota><footer class=qg-quota__meta>Polled <!> · `),HD=L(`<section class=qg-section aria-label=Quota><div class=qg-card-grid>`),UD=L(`<div class=qg-list><div class=qg-list__head aria-hidden=true><span>Project</span><span>Tokens`),WD=L(`<section class=qg-section aria-labelledby=qg-home-projects><header class=qg-section__head><h2 class=qg-section__title id=qg-home-projects>Projects`),GD=L(`<section class=qg-section aria-labelledby=qg-home-usage><header class=qg-chart-shell__head><h2 class=qg-section__title id=qg-home-usage>`),KD=L(`<a class=qg-list__row data-clickable=true><span class=qg-list__title></span><span class=qg-list__tokens>`);function qD(e){let t=()=>Xw(vb(e.snapshot.providers.cards,e.hiddenCards),e.preferences.cardOrder,e.preferences.providerOrder);return(()=>{var n=VD(),r=n.firstChild,i=r.firstChild.nextSibling;return i.nextSibling,B(n,j(F,{get when(){return t().length>0},get fallback(){return I(()=>!!(e.snapshot.providers.cards.length===0&&e.snapshot.stale))()?j(wx,{message:`Quota data is unavailable.`,get retryable(){return e.onRetry!==void 0},onRetry:()=>e.onRetry?.()}):j(Cx,{get message(){return I(()=>e.snapshot.providers.cards.length>0)()?`Every provider card is hidden. Use the eye toggles in Settings to bring one back.`:Sb(e.snapshot.providers.enabledProviders)}})},get children(){var n=BD();return B(n,j(P,{get each(){return t()},children:t=>j(nE,{card:t,get preferences(){return e.preferences},get hiddenRows(){return e.hiddenRows},get stale(){return e.stale||t.stale===!0},get timeZone(){return e.snapshot.timeZone},get nowMs(){return e.snapshot.providers.polledAtMs}})})),n}}),r),B(r,()=>XC(e.snapshot.providers.polledAtMs,e.snapshot.timeZone),i),B(r,(()=>{var t=I(()=>e.snapshot.providers.enabledProviders===`auto`);return()=>t()?`automatic provider selection`:sw(e.snapshot.providers.enabledProviders.length,`enabled provider`)})(),null),n})()}function JD(){return(()=>{var e=HD(),t=e.firstChild;return B(t,j(Sx,{label:`Loading providers`})),e})()}function YD(e){let[t,n]=b(`activity`),r=C(()=>aE(e.snapshot.projects,t()));return[j(F,{get when(){return e.snapshot.usage.buckets.length>0},get fallback(){return(()=>{var t=GD(),n=t.firstChild.firstChild;return B(n,()=>aw(e.snapshot.usage.bucketUnit)),B(t,j(Cx,{get message(){return wb(Cb(e.snapshot.usage))}}),null),t})()},get children(){return j(zD,{get usage(){return e.snapshot.usage},headingId:`qg-home-usage`})}}),(()=>{var i=WD(),a=i.firstChild;return a.firstChild,B(a,j(cE,{label:`projects`,get value(){return t()},onChange:n}),null),B(i,j(F,{get when(){return e.snapshot.projects.length>0},get fallback(){return j(Cx,{message:`No activity in this range. Widen the range to see earlier projects.`})},get children(){var t=UD();return t.firstChild,B(t,j(P,{get each(){return r()},children:t=>(()=>{var n=KD(),r=n.firstChild,i=r.nextSibling;return B(r,()=>t.name),B(i,()=>RC(t.tokens.total)),x(a=>{var o=Q({name:`project`,projectId:t.projectId},e.range),s=t.name,c=$(t.tokens.total);return o!==a.e&&R(n,`href`,a.e=o),s!==a.t&&R(r,`title`,a.t=s),c!==a.a&&R(i,`title`,a.a=c),a},{e:void 0,t:void 0,a:void 0}),n})()}),null),t}}),null),i})()]}var XD=L(`<div class="qg-breakdown__row qg-breakdown__row--phase"data-level=phase><span class=qg-breakdown__name><span class=qg-breakdown__phase><span class=qg-breakdown__phase-dot aria-hidden=true></span></span></span><span class=qg-breakdown__cost></span><span class=qg-breakdown__tokens>`),ZD=L(`<div class=qg-breakdown><div class=qg-breakdown__head><span>Name</span><span class=qg-breakdown__costhead>Cost</span><span>Tokens`),QD=L(`<section class=qg-section><header class=qg-section__head><h2 class=qg-section__title>Breakdown`),$D=L(`<div class=qg-breakdown__group><a class=qg-breakdown__row><span class=qg-breakdown__name><span class=qg-breakdown__swatch aria-hidden=true></span><span class=qg-breakdown__label></span></span><span class=qg-breakdown__cost></span><span class=qg-breakdown__tokens>`),eO=L(`<a><span class=qg-breakdown__name><span class=qg-breakdown__label></span></span><span class=qg-breakdown__cost></span><span class=qg-breakdown__tokens>`);function tO(e){return e.kind===`known`?e.id:``}function nO(e){return e===`peak`?`Peak`:`Off-peak`}function rO(e){return(()=>{var t=XD(),n=t.firstChild,r=n.firstChild;r.firstChild;var i=n.nextSibling,a=i.nextSibling;return B(r,()=>nO(e.phase),null),B(i,j(mD,{class:`qg-breakdown__costvalue`,get tokens(){return e.tokens}}),null),B(i,j(hD,{get totals(){return e.tokens}}),null),B(a,()=>RC(e.tokens.total)),x(n=>{var i=e.phase,o=e.phase,s=`${$(e.tokens.total)} tokens`;return i!==n.e&&R(t,`data-phase`,n.e=i),o!==n.t&&R(r,`data-phase`,n.t=o),s!==n.a&&R(a,`title`,n.a=s),n},{e:void 0,t:void 0,a:void 0}),t})()}function iO(e){let t=C(()=>Lw(e.rows,e.sort)),n=C(()=>{if(e.dimension!==`provider`||e.temporalBreakdown===void 0)return;let t=new Map;for(let n of e.temporalBreakdown.rows)t.set(xw(`provider`,n.identity),n);return t}),[r,i]=b(),a=()=>e.activeSeries,o=e=>a()===void 0||a()===e?void 0:`true`,s=e=>a()!==void 0&&a()===e?`true`:void 0;return(()=>{var a=QD(),c=a.firstChild,l=c.firstChild;return B(c,j(kp,{class:`qg-sort`,"aria-label":`Sort breakdown`,get value(){return e.sort},onChange:t=>{(t===`cost`||t===`tokens`)&&e.onSortChange(t)},get children(){return[j(jp,{value:`cost`,children:`Cost`}),j(jp,{value:`tokens`,children:`Tokens`})]}}),null),B(a,j(F,{get when(){return t().length>0},get fallback(){return j(Cx,{get message(){return e.emptyMessage??`No usage in this range.`}})},get children(){var a=ZD(),c=a.firstChild.firstChild.nextSibling;return c.firstChild,B(c,j(pD,{}),null),B(a,j(P,{get each(){return t()},children:t=>{let a=()=>xw(e.dimension,t.identity),c=()=>Cw(e.dimension,t.identity,e.seriesKeys),l=()=>e.rows.map(e=>e.identity),u=()=>kw(t.identity,e.dimension,l()),d=()=>Lw(t.children,e.sort),f=()=>t.children.map(e=>e.identity),p=()=>n()?.get(xw(`provider`,t.identity)),m=e.dimension===`model`?`provider`:`model`,h=m===`provider`,g=()=>c()===`other`&&e.otherParentKeys?.has(a())===!0,_=()=>{if(c()!==`other`)return;let t=e.activeParent;return t?.seriesKey===`other`&&e.otherParentKeys?.has(t.parentKey)===!0?t:void 0},v=()=>_()?.parentKey===a(),y=()=>_()!==void 0,b=()=>{i(void 0),g()&&e.onPointerParent!==void 0?e.onPointerParent({seriesKey:`other`,parentKey:a()}):e.onPointerSeries?.(c())},S=()=>{g()&&e.onPointerParent!==void 0?e.onPointerParent(void 0):e.onPointerSeries?.(void 0)},C=()=>{i(void 0),g()&&e.onFocusParent!==void 0?e.onFocusParent({seriesKey:`other`,parentKey:a()}):e.onFocusSeries?.(c())},w=()=>{g()&&e.onFocusParent!==void 0?e.onFocusParent(void 0):e.onFocusSeries?.(void 0)},T=()=>{let n=e.activeChild;if(n?.seriesKey===c())return t.children.some(e=>xw(m,e.identity)===n.childKey)?n:void 0},E=()=>{let e=r();if(e?.seriesKey===c())return t.children.some(t=>xw(m,t.identity)===e.childKey)?e:void 0},D=()=>T()??E(),O=e=>D()?.childKey===e,k=()=>D()!==void 0,ee=t=>{c()!==`other`&&e.onPointerChild!==void 0?e.onPointerChild(t):i(t)},te=t=>{c()!==`other`&&e.onFocusChild!==void 0?e.onFocusChild(t):i(t)},ne=t=>{c()!==`other`&&e.onPointerChild!==void 0?e.onPointerChild(void 0):i(e=>e?.seriesKey===c()&&e.childKey===t?void 0:e)},re=t=>{c()!==`other`&&e.onFocusChild!==void 0?e.onFocusChild(void 0):i(e=>e?.seriesKey===c()&&e.childKey===t?void 0:e)};return(()=>{var n=$D(),r=n.firstChild,i=r.firstChild,l=i.firstChild,g=l.nextSibling,_=i.nextSibling,T=_.nextSibling;return r.addEventListener(`blur`,w),r.addEventListener(`focus`,C),r.addEventListener(`pointerleave`,S),r.addEventListener(`pointerenter`,b),B(i,j(F,{get when(){return e.dimension===`provider`},get children(){return j(GS,{get providerId(){return tO(t.identity)},class:`qg-breakdown__logo`})}}),g),B(g,u),B(_,j(mD,{class:`qg-breakdown__costvalue`,get tokens(){return t.tokens}}),null),B(_,j(hD,{get totals(){return t.tokens}}),null),B(T,()=>RC(t.tokens.total)),B(n,j(F,{get when(){return e.showChildren!==!1},get children(){return j(P,{get each(){return d()},children:t=>{let n=()=>xw(m,t.identity),r=()=>({seriesKey:c(),childKey:n()});return(()=>{var i=eO(),a=i.firstChild,l=a.firstChild,u=a.nextSibling,d=u.nextSibling;return i.addEventListener(`blur`,()=>re(n())),i.addEventListener(`focus`,()=>te(r())),i.addEventListener(`pointerleave`,()=>ne(n())),i.addEventListener(`pointerenter`,()=>ee(r())),Qe(i,h?`qg-breakdown__row qg-breakdown__row--child`:`qg-breakdown__row qg-breakdown__row--child qg-breakdown__row--plain`),B(a,j(F,{when:h,get children(){return j(GS,{get providerId(){return tO(t.identity)},class:`qg-breakdown__logo`})}}),l),B(l,()=>kw(t.identity,m,f())),B(u,j(mD,{class:`qg-breakdown__costvalue`,get tokens(){return t.tokens}}),null),B(u,j(hD,{get totals(){return t.tokens}}),null),B(d,()=>RC(t.tokens.total)),x(r=>{var a=Q(m===`model`?{name:`model`,identity:t.identity,modelsGroup:e.modelsGroup}:{name:`provider`,identity:t.identity,modelsGroup:e.modelsGroup},e.range),l=Aw(t.identity,m),u=n(),f=O(n())||v()?`true`:y()||k()?void 0:s(c()),p=O(n())||v()?void 0:y()||k()?`true`:o(c()),h=`${$(t.tokens.total)} tokens`;return a!==r.e&&R(i,`href`,r.e=a),l!==r.t&&R(i,`title`,r.t=l),u!==r.a&&R(i,`data-child-key`,r.a=u),f!==r.o&&R(i,`data-highlighted`,r.o=f),p!==r.i&&R(i,`data-dimmed`,r.i=p),h!==r.n&&R(d,`title`,r.n=h),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}})}}),null),B(n,j(F,{get when(){return p()},children:e=>[j(rO,{phase:`peak`,get tokens(){return e().peak}}),j(rO,{phase:`offpeak`,get tokens(){return e().offpeak}})]}),null),x(i=>{var u=a(),d=Q(e.dimension===`model`?{name:`model`,identity:t.identity,modelsGroup:e.modelsGroup}:{name:`provider`,identity:t.identity,modelsGroup:e.modelsGroup},e.range),f=Aw(t.identity,e.dimension),p=k()?void 0:v()?`true`:y()?void 0:s(c()),m=k()||v()?void 0:y()?`true`:o(c()),h=`var(${Pw(c(),e.seriesKeys)})`,g=`${$(t.tokens.total)} tokens`;return u!==i.e&&R(n,`data-series-key`,i.e=u),d!==i.t&&R(r,`href`,i.t=d),f!==i.a&&R(r,`title`,i.a=f),p!==i.o&&R(r,`data-highlighted`,i.o=p),m!==i.i&&R(r,`data-dimmed`,i.i=m),h!==i.n&&z(l,`--qg-swatch`,i.n=h),g!==i.s&&R(T,`title`,i.s=g),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}}),null),a}}),null),x(t=>{var n=e.headingId,r=e.headingId;return n!==t.e&&R(a,`aria-labelledby`,t.e=n),r!==t.t&&R(l,`id`,t.t=r),t},{e:void 0,t:void 0}),a})()}function aO(e,t,n){let{segment:r}=e;if(t.length<2)return[];let i=e.mode??`tokens`,a=e.parentTokens?.apiEquivalentCostUsd??null,o=i===`tokens`?Math.max(0,r.value):typeof a==`number`&&Number.isFinite(a)&&a>0?a:0;if(!(o>0))return[];let s=t.map(e=>{let t=e.tokens.apiEquivalentCostUsd;return{entry:e,weight:i===`tokens`?Math.max(0,e.tokens.total):typeof t==`number`&&Number.isFinite(t)&&t>0?t:0}}).filter(e=>e.weight>0);if(s.length<2)return[];let c=[],l=0;for(let{entry:e,weight:t}of s){let i=1-l;if(!(i>0))break;let a=Math.min(t/o,i);if(!(a>0))continue;let s=r.y+r.height-l*r.height,u=a*r.height;c.push({key:xw(n,e.identity),identity:e.identity,tokens:e.tokens,share:a,x:r.x,y:s-u,width:r.width,height:u}),l+=a}return c.length<2?[]:c.map((e,t)=>({...e,fillOpacity:.95-t/Math.max(c.length-1,1)*.3999999999999999}))}function oO(e){return aO(e,e.children??[],Tw(e.dimension))}function sO(e){return aO(e,e.parents??[],e.dimension)}var cO={width:900,height:260,padding:{top:12,right:58,bottom:24,left:48}},lO=1,uO=1;function dO(e){let t=Math.max(e.width-e.padding.left-e.padding.right,1),n=Math.max(e.height-e.padding.top-e.padding.bottom,1);return{left:e.padding.left,top:e.padding.top,width:t,height:n,bottom:e.padding.top+n,right:e.padding.left+t}}function fO(e,t,n=cO){let r=dO(n),i=t.length,a=i>0?r.width/i:r.width,o=e=>r.left+e*a,s=a*.72,c=0,l=t.map((t,n)=>{let r=0,i=0;for(let t of e){let e=Math.max(0,t.buckets[n]?.total??0);r+=e,e>0&&(i+=1)}return c=Math.max(c,i),r}),u=l.reduce((e,t)=>Math.max(e,t),0),d=u>0?EE(u,r.height,c):{max:0,step:0},f=d.max>0?d.max:1,p=e=>r.bottom-e/f*r.height;return{plot:r,slot:a,barWidth:s,yMax:u,scaleMax:f,bars:t.map((t,n)=>{let i=o(n)+(a-s)/2,c=[],u=0,d=r.bottom;return e.forEach((e,t)=>{let r=Math.max(0,e.buckets[n]?.total??0);if(!(r>0))return;let a=p(u);u+=r;let o=a-p(u),l=d-o;c.push({seriesIndex:t,bucketIndex:n,value:r,x:i,y:l,width:s,height:o,radius:Math.min(uO,s/2,o/2)}),d=l-lO}),{bucketIndex:n,x:i,width:s,top:c.at(-1)?.y??r.bottom,bottom:r.bottom,total:l[n]??0,segments:c}}),ticks:SE(d.max,8,r,d.step),labelIndexes:OE(i,a,40),slotX:o}}function pO(e){return e.total>0?e.apiEquivalentCostUsd===null?`unpriced`:e.unpricedTokens>0||e.unknownTokens>0?`partial`:e.apiEquivalentCostUsd===0?`zero`:`priced`:`empty`}function mO(e,t,n){let r=t.map((t,n)=>Kw(e.map(e=>e.buckets[n]).filter(e=>e!==void 0))),i=r.reduce((e,t)=>t.apiEquivalentCostUsd===null?e:Math.max(e,t.apiEquivalentCostUsd),0),a=i>0?TE(i,{targetTicks:4,allowExact:!0}):{max:0,step:0},o=a.max>0?a.max:1,s=r.map((e,t)=>{let r=pO(e),i=e.apiEquivalentCostUsd,a=(r===`priced`||r===`partial`||r===`zero`)&&i!==null?n.plot.bottom-i/o*n.plot.height:null;return{bucketIndex:t,x:n.slotX(t)+n.slot/2,y:a,total:e.total,cost:i,status:r}}),c=[],l=[],u=[],d=()=>{u.length!==0&&(u.length===1?l.push(u[0]):c.push({path:GE(u.map(e=>({x:e.x,y:e.y}))),pointCount:u.length,partial:u.some(e=>e.status===`partial`),firstBucketIndex:u[0]?.bucketIndex,lastBucketIndex:u.at(-1)?.bucketIndex}),u=[])};for(let e of s)e.y===null?d():u.push(e);return d(),{points:s,runs:c,isolated:l,ticks:SE(a.max,4,n.plot,a.step),tickStep:a.step,scaleMax:a.max,maxCost:i,hasNumeric:s.some(e=>e.y!==null),hasPartial:s.some(e=>e.status===`partial`),hasUnpriced:s.some(e=>e.status===`unpriced`)}}var hO=L(`<svg><text class="qg-chart__axis-title qg-chart__axis-title--cost"text-anchor=end>API-EQUIVALENT ($)</svg>`,!1,!0,!1),gO=L(`<div class="qg-chart qg-model-chart__plot"><svg role=img><text class=qg-chart__axis-title text-anchor=start>TOKEN USAGE</text></svg><ul class=qg-chart__hits>`),_O=L(`<div class=sr-only><table><caption> per </caption><thead><tr><th scope=col>Bucket</th><th scope=col>API-equivalent</th><th scope=col>Total</th></tr></thead><tbody>`),vO=L(`<ul class=qg-legend>`),yO=L(`<span class="qg-legend__logo qg-legend__logo--empty"aria-hidden=true>`),bO=L(`<li class=qg-legend__entry><button type=button class=qg-legend__item data-pinnable=true><span class=qg-legend__swatch aria-hidden=true></span><span class="qg-legend__label qg-breakable"></span><span class=qg-legend__value>`),xO=L(`<svg><line class=qg-chart__grid-line></svg>`,!1,!0,!1),SO=L(`<svg><text class=qg-chart__axis-label text-anchor=end></svg>`,!1,!0,!1),CO=L(`<svg><line class=qg-chart__tick-mark></svg>`,!1,!0,!1),wO=L(`<svg><text class="qg-chart__axis-label qg-chart__axis-label--cost"text-anchor=start></svg>`,!1,!0,!1),TO=L(`<svg><rect class=qg-chart__segment></svg>`,!1,!0,!1),EO=L(`<svg><rect class=qg-chart__child-slice></svg>`,!1,!0,!1),DO=L(`<svg><path class=qg-chart__cost-line></svg>`,!1,!0,!1),OO=L(`<svg><line class="qg-chart__cost-line qg-chart__cost-isolated"></svg>`,!1,!0,!1),kO=L(`<svg><text class=qg-chart__axis-label text-anchor=middle></svg>`,!1,!0,!1),AO=L(`<li class="qg-chart__hit qg-model-chart__hit"tabindex=0>`),jO=L(`<output class="qg-tooltip qg-model-tooltip"><p class=qg-tooltip__head><span></span><span class=qg-tooltip__total></span></p><div class="qg-totals__row qg-tooltip__row qg-tooltip__row--note qg-model-tooltip__footer"><span class=qg-totals__label><span class=qg-model-tooltip__total-long>API-equivalent total</span><span class=qg-model-tooltip__total-short aria-hidden=true>Total</span></span><span class=qg-totals__value>`),MO=L(`<span class=qg-model-tooltip__qualifier>partial`),NO=L(`<div class="qg-totals__row qg-tooltip__row qg-model-tooltip__row"><span class=qg-tooltip__swatch aria-hidden=true></span><span class=qg-totals__label></span><span class=qg-model-tooltip__tokens></span><span class=qg-model-tooltip__cost>`),PO=L(`<p class=qg-chart__axis-caption>`),FO=L(`<th scope=col>`),IO=L(`<tr><th scope=row></th><td></td><td>`),LO=L(`<td>`);function RO(e){let t=C(()=>{let t=e.snapshot;return t===void 0?[]:Mw(t.series)}),n=()=>e.snapshot?.dimension??`model`,r=()=>e.snapshot?.buckets??[],i=XE(),a=i.active,{size:o,ref:s}=QE(cO),c=C(()=>fO(t(),r(),o)),l=C(()=>mO(t(),r(),c())),u=eD(()=>{let e=a();return e===void 0?0:(c().slotX(e)+c().slot/2)/o.width},()=>c().barWidth/2+12),d=()=>e.snapshot?.timeZone??`UTC`,f=()=>e.snapshot?.bucketUnit??`hour`,p=t=>e.onPointerSeries?.(t),m=t=>e.onFocusSeries?.(t),h=()=>e.activeSeries,g;D(()=>{if(typeof document>`u`)return;let t=t=>{if(e.pinnedSeries===void 0)return;let n=t.target;n instanceof Node&&g?.contains(n)||e.onClearPinnedSeries?.()};document.addEventListener(`click`,t),O(()=>document.removeEventListener(`click`,t))});let _=()=>e.loading===!0?void 0:e.error,v=e=>h()===void 0?void 0:h()===e?`true`:`false`,y=e=>e.kind===`entity`?e.identity.kind===`known`?e.identity.id:``:void 0,b=()=>t().flatMap(e=>e.kind===`entity`?[e.identity]:[]),S=e=>e.kind===`other`?`Other`:kw(e.identity,n(),b()),w=C(()=>{let r=h(),i=e.activeChild;if(r===void 0||i?.seriesKey!==r)return;let a=t().find(e=>Sw(e,n())===r),o=Tw(n());return a?.childBuckets?.some(e=>e.some(e=>xw(o,e.identity)===i.childKey))===!0?i:void 0}),T=C(()=>{let r=h(),i=e.activeParent;if(r===void 0||i?.seriesKey!==r)return;let a=t().find(e=>Sw(e,n())===r);if(a?.kind===`other`)return a.parentBuckets?.some(e=>e.some(e=>xw(n(),e.identity)===i.parentKey))===!0?i:void 0}),E=()=>w()===void 0?void 0:`true`,k=()=>T()===void 0?void 0:`true`,ee=e=>t().map((t,r)=>{let i=t.buckets[e],a=i!==void 0&&zw(i)===`Partial estimate`;return{entry:t,seriesIndex:r,key:Sw(t,n()),label:S(t),tokens:i,total:i?.total??0,cost:i?.apiEquivalentCostUsd??null,partial:a,costTitle:i===void 0?`No usage in this bucket.`:i.apiEquivalentCostUsd===null||a?Vw(i):Gw(i)}}).filter(e=>e.total>0),te=e=>Kw(t().map(t=>t.buckets[e]).filter(e=>e!==void 0)),ne=()=>{let e=a();return e===void 0?void 0:r()[e]},re=e=>{let t=r()[e];return nw(t?.startMs??0,t?.endMs??0,f(),d(),` to `)},ie=e=>{let t=te(e),n=ee(e).map(e=>`${e.label} ${$(e.total)} tokens, ${Ww(e.tokens)}`);return[re(e),`total ${$(t.total)} tokens`,...n,`API-equivalent total ${Ww(t)}`,zw(t)===`Partial estimate`?`Partial estimate`:``].filter(e=>e.length>0).join(`, `)},A=()=>{let e=r(),t=e.at(-1);if(t)return rw(tw(t.startMs,t.endMs,f(),d()),e.length,c().labelIndexes)};return j(cD,{get title(){return e.title},get headingId(){return e.headingId},get actions(){return e.actions},get summary(){return e.summary},bodyClass:`qg-usage qg-model-chart`,get aside(){return j(F,{get when(){return t().length>0},get children(){var r=vO();return rt(e=>{g=e},r),B(r,j(P,{get each(){return t()},children:(t,r)=>{let i=()=>Sw(t,n()),a=()=>S(t);return(()=>{var o=bO(),s=o.firstChild,c=s.firstChild.nextSibling,l=c.nextSibling;return s.$$click=()=>e.onTogglePinnedSeries?.(i()),s.addEventListener(`blur`,()=>m(void 0)),s.addEventListener(`focus`,()=>m(i())),s.addEventListener(`pointerleave`,()=>p(void 0)),s.addEventListener(`pointerenter`,()=>p(i())),B(s,j(F,{get when(){return I(()=>n()===`provider`)()&&y(t)!==void 0},get children(){return j(GS,{get providerId(){return y(t)??``},class:`qg-legend__logo`})}}),c),B(s,j(F,{get when(){return I(()=>n()===`provider`)()&&t.kind===`other`},get children(){return yO()}}),c),B(c,a),B(l,()=>RC(t.tokens.total)),x(n=>{var o=i(),c=h()===i()?`true`:void 0,l=e.pinnedSeries===i()?`true`:void 0,u=`Highlight ${a()}, ${$(t.tokens.total)} tokens`,d=e.pinnedSeries===i()?`true`:`false`,f=`var(${Nw(r(),t.kind)})`,p=t.kind===`other`?`Every entity outside the top five, combined exactly; usage and known cost are never dropped.`:void 0;return o!==n.e&&R(s,`data-series-key`,n.e=o),c!==n.t&&R(s,`data-active`,n.t=c),l!==n.a&&R(s,`data-pinned`,n.a=l),u!==n.o&&R(s,`aria-label`,n.o=u),d!==n.i&&R(s,`aria-pressed`,n.i=d),f!==n.n&&z(s,`--qg-swatch`,n.n=f),p!==n.s&&R(s,`title`,n.s=p),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),o})()}})),x(()=>R(r,`aria-label`,`${n()} series`)),r}})},get children(){return j(F,{get when(){return e.snapshot},get fallback(){return j(F,{get when(){return _()},get fallback(){return j(Sx,{get label(){return e.loading?`Loading models`:`Loading usage`}})},children:t=>j(wx,M({get message(){return t()},retryable:!0,get recoverable(){return e.errorRecoverable===!0},get autoRetry(){return e.autoRetry}},()=>e.onAutoRetry===void 0?{}:{onAutoRetry:e.onAutoRetry},{onRetry:()=>e.onRetry?.()}))})},get children(){return j(F,{get when(){return I(()=>t().length>0)()&&r().length>0},get fallback(){return j(Cx,{message:`No activity in this range.`})},get children(){return[(()=>{var p=gO(),m=p.firstChild,g=m.firstChild,_=m.nextSibling;return p.$$click=()=>e.onClearPinnedSeries?.(),rt(e=>{s(e),u.chartRef(e)},p),B(m,j(P,{get each(){return c().ticks},children:e=>[(()=>{var t=xO();return x(n=>{var r=c().plot.left,i=c().plot.right,a=e.y,o=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),a!==n.a&&R(t,`y1`,n.a=a),o!==n.o&&R(t,`y2`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=SO();return B(t,()=>RC(e.value)),x(n=>{var r=c().plot.left-8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]}),g),B(m,j(F,{get when(){return l().hasNumeric},get children(){return[(()=>{var e=hO();return x(t=>{var n=c().plot.right,r=c().plot.top-6;return n!==t.e&&R(e,`x`,t.e=n),r!==t.t&&R(e,`y`,t.t=r),t},{e:void 0,t:void 0}),e})(),j(P,{get each(){return l().ticks},children:e=>[(()=>{var t=CO();return x(n=>{var r=c().plot.right,i=c().plot.right+4,a=e.y,o=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),a!==n.a&&R(t,`y1`,n.a=a),o!==n.o&&R(t,`y2`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=wO();return B(t,()=>VC(e.value,l().tickStep)),x(n=>{var r=c().plot.right+8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]})]}}),null),B(m,j(P,{get each(){return c().bars},children:e=>j(P,{get each(){return e.segments},children:e=>{let r=()=>t()[e.seriesIndex],i=()=>r()===void 0?`other`:Sw(r(),n()),a=C(()=>{let t=r();if(t===void 0||h()!==i())return{kind:`child`,slices:[]};if(t.kind===`other`&&t.parentBuckets!==void 0){let r=T(),a=t.parentBuckets[e.bucketIndex],o=sO({segment:e,parentTokens:t.buckets[e.bucketIndex],parents:a,dimension:n()}),s=r!==void 0&&r.seriesKey===i()?r.parentKey:void 0,c=a!==void 0&&a.length===1&&a[0]!==void 0?xw(n(),a[0].identity):void 0;return{kind:`parent`,slices:o,selectedKey:s,envelopeEmphasis:s!==void 0&&o.length===0?c===s?`true`:`false`:void 0}}let a=w();return{kind:`child`,slices:oO({segment:e,parentTokens:t.buckets[e.bucketIndex],children:t.childBuckets?.[e.bucketIndex],dimension:n()}),selectedKey:a!==void 0&&a.seriesKey===i()?a.childKey:void 0}}),o=()=>a().slices,s=()=>a().selectedKey;return[(()=>{var t=TO();return x(n=>{var s=i(),c=e.bucketIndex,l=a().envelopeEmphasis??v(i()),u=e.x,d=e.y,f=e.width,p=e.height,m=e.radius,h=e.radius,g=`var(${Nw(e.seriesIndex,r()?.kind??`other`)})`,_=o().length>0?`0.32`:void 0;return s!==n.e&&R(t,`data-series-key`,n.e=s),c!==n.t&&R(t,`data-bucket-index`,n.t=c),l!==n.a&&R(t,`data-highlighted`,n.a=l),u!==n.o&&R(t,`x`,n.o=u),d!==n.i&&R(t,`y`,n.i=d),f!==n.n&&R(t,`width`,n.n=f),p!==n.s&&R(t,`height`,n.s=p),m!==n.h&&R(t,`rx`,n.h=m),h!==n.r&&R(t,`ry`,n.r=h),g!==n.d&&R(t,`fill`,n.d=g),_!==n.l&&R(t,`fill-opacity`,n.l=_),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),t})(),j(P,{get each(){return o()},children:t=>(()=>{var n=EO();return x(o=>{var c=a().kind,l=i(),u=e.bucketIndex,d=a().kind===`child`?t.key:void 0,f=a().kind===`parent`?t.key:void 0,p=s()===void 0?void 0:s()===t.key?`true`:`false`,m=t.x,h=t.y,g=t.width,_=t.height,v=`var(${Nw(e.seriesIndex,r()?.kind??`other`)})`,y=t.fillOpacity;return c!==o.e&&R(n,`data-slice-kind`,o.e=c),l!==o.t&&R(n,`data-series-key`,o.t=l),u!==o.a&&R(n,`data-bucket-index`,o.a=u),d!==o.o&&R(n,`data-child-key`,o.o=d),f!==o.i&&R(n,`data-parent-key`,o.i=f),p!==o.n&&R(n,`data-highlighted`,o.n=p),m!==o.s&&R(n,`x`,o.s=m),h!==o.h&&R(n,`y`,o.h=h),g!==o.r&&R(n,`width`,o.r=g),_!==o.d&&R(n,`height`,o.d=_),v!==o.l&&R(n,`fill`,o.l=v),y!==o.u&&R(n,`fill-opacity`,o.u=y),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),n})()})]}})}),null),B(m,j(P,{get each(){return l().runs},children:e=>(()=>{var t=DO();return x(n=>{var r=e.partial?`true`:void 0,i=e.path;return r!==n.e&&R(t,`data-partial`,n.e=r),i!==n.t&&R(t,`d`,n.t=i),n},{e:void 0,t:void 0}),t})()}),null),B(m,j(P,{get each(){return l().isolated},children:e=>(()=>{var t=OO();return x(n=>{var r=e.status,i=e.bucketIndex,a=e.x-3,o=e.x+3,s=e.y??c().plot.bottom,l=e.y??c().plot.bottom;return r!==n.e&&R(t,`data-status`,n.e=r),i!==n.t&&R(t,`data-bucket-index`,n.t=i),a!==n.a&&R(t,`x1`,n.a=a),o!==n.o&&R(t,`x2`,n.o=o),s!==n.i&&R(t,`y1`,n.i=s),l!==n.n&&R(t,`y2`,n.n=l),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()}),null),B(m,j(P,{get each(){return c().labelIndexes},children:e=>{let t=()=>r()[e];return j(F,{get when(){return t()},children:t=>(()=>{var n=kO();return B(n,()=>$C(t().startMs,f(),d())),x(t=>{var r=c().slotX(e)+c().slot/2,i=o.height-8;return r!==t.e&&R(n,`x`,t.e=r),i!==t.t&&R(n,`y`,t.t=i),t},{e:void 0,t:void 0}),n})()})}}),null),$e(_,`pointerleave`,i.clearPointer),B(_,j(P,{get each(){return r()},children:(e,t)=>(()=>{var e=AO();return $e(e,`blur`,i.clearFocus),e.addEventListener(`focus`,()=>i.inspectFocus(t())),e.addEventListener(`pointerenter`,()=>i.inspectPointer(t())),x(n=>{var r=`Inspect ${ie(t())}`,i=`${(c().slotX(t())-c().plot.left)/c().plot.width*100}%`,a=`${Math.max(c().slot,1)/c().plot.width*100}%`;return r!==n.e&&R(e,`aria-label`,n.e=r),i!==n.t&&z(e,`left`,n.t=i),a!==n.a&&z(e,`width`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),e})()})),B(p,j(F,{get when(){return ne()},children:e=>{let t=()=>te(a()??0);return(()=>{var n=jO(),r=n.firstChild,i=r.firstChild,o=i.nextSibling,s=r.nextSibling,c=s.firstChild.nextSibling,l=u.tooltipRef;return typeof l==`function`?rt(l,n):u.tooltipRef=n,B(i,()=>nw(e().startMs,e().endMs,f(),d())),B(o,()=>$(t().total)),B(n,j(P,{get each(){return ee(a()??0)},children:e=>(()=>{var t=NO(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling;return B(r,()=>e.label),B(i,()=>$(e.total)),B(a,()=>Ww(e.tokens),null),B(a,j(F,{get when(){return e.partial},get children(){return MO()}}),null),x(t=>{var r=`var(${Nw(e.seriesIndex,e.entry.kind)})`,o=`${$(e.total)} tokens`,s=e.cost===null&&e.total>0?`unpriced`:void 0,c=e.costTitle;return r!==t.e&&z(n,`--qg-swatch`,t.e=r),o!==t.t&&R(i,`title`,t.t=o),s!==t.a&&R(a,`data-cost-status`,t.a=s),c!==t.o&&R(a,`title`,t.o=c),t},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}),s),B(c,()=>Ww(t())),B(s,j(hD,{get totals(){return t()}}),null),x(e=>{var r=`${u.position().left}px`,i=`${u.position().top}px`,a=`${u.position().maxWidth}px`,o=`${u.position().maxHeight}px`,s=u.position().visible?`visible`:`hidden`,l=Gw(t());return r!==e.e&&z(n,`left`,e.e=r),i!==e.t&&z(n,`top`,e.t=i),a!==e.a&&z(n,`max-width`,e.a=a),o!==e.o&&z(n,`max-height`,e.o=o),s!==e.i&&z(n,`visibility`,e.i=s),l!==e.n&&R(c,`title`,e.n=l),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()}}),null),x(t=>{var r=h()===void 0?void 0:`true`,i=E(),a=k(),s=`0 0 ${o.width} ${o.height}`,l=`${e.title}. Stacked token usage by ${n()}, with API-equivalent cost on the right axis.`,u=c().plot.left,d=c().plot.top-6,f=`${e.title} buckets`,v=`${c().plot.top/o.height*100}%`,y=`${(o.height-c().plot.bottom)/o.height*100}%`,b=`${c().plot.left/o.width*100}%`,x=`${(o.width-c().plot.right)/o.width*100}%`;return r!==t.e&&R(p,`data-highlight`,t.e=r),i!==t.t&&R(p,`data-child-highlight`,t.t=i),a!==t.a&&R(p,`data-parent-highlight`,t.a=a),s!==t.o&&R(m,`viewBox`,t.o=s),l!==t.i&&R(m,`aria-label`,t.i=l),u!==t.n&&R(g,`x`,t.n=u),d!==t.s&&R(g,`y`,t.s=d),f!==t.h&&R(_,`aria-label`,t.h=f),v!==t.r&&z(_,`top`,t.r=v),y!==t.d&&z(_,`bottom`,t.d=y),b!==t.l&&z(_,`left`,t.l=b),x!==t.u&&z(_,`right`,t.u=x),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),p})(),j(F,{get when(){return A()},children:e=>(()=>{var t=PO();return B(t,e),t})()}),(()=>{var n=_O(),i=n.firstChild.firstChild,a=i.firstChild,o=i.nextSibling,s=o.firstChild,c=s.firstChild.nextSibling,l=o.nextSibling;return B(i,()=>e.title,a),B(i,f,null),B(s,j(P,{get each(){return t()},children:e=>(()=>{var t=FO();return B(t,()=>S(e)),t})()}),c),B(l,j(P,{get each(){return r()},children:(e,n)=>{let r=()=>te(n());return(()=>{var i=IO(),a=i.firstChild,o=a.nextSibling,s=o.nextSibling;return B(a,()=>$C(e.startMs,f(),d())),B(i,j(P,{get each(){return t()},children:e=>(()=>{var t=LO();return B(t,()=>$(e.buckets[n()]?.total??0)),t})()}),o),B(o,()=>Ww(r()),null),B(o,j(F,{get when(){return zw(r())===`Partial estimate`},children:` Partial estimate`}),null),B(s,()=>$(r().total)),i})()}})),n})()]}})}})}})}Ye([`click`]);function zO(){let[e,t]=b(),[n,r]=b(),[i,a]=b(),[o,s]=b(),[c,l]=b(),[u,d]=b(),[f,p]=b();return{active:()=>e()??o()??f(),activeChild:()=>{if(e()!==void 0)return n();if(o()!==void 0)return c()},activeParent:()=>{if(e()!==void 0)return i();if(o()!==void 0)return u()},pinned:f,inspectPointer:e=>{t(e),r(void 0),a(void 0)},inspectPointerChild:e=>{t(e?.seriesKey),r(e),a(void 0)},inspectPointerParent:e=>{t(e?.seriesKey),a(e),r(void 0)},inspectFocus:e=>{s(e),l(void 0),d(void 0)},inspectFocusChild:e=>{s(e?.seriesKey),l(e),d(void 0)},inspectFocusParent:e=>{s(e?.seriesKey),d(e),l(void 0)},clearPointer:()=>{t(void 0),r(void 0),a(void 0)},clearFocus:()=>{s(void 0),l(void 0),d(void 0)},togglePinned:e=>{f()===e?(p(void 0),t(t=>t===e?void 0:t),r(t=>t?.seriesKey===e?void 0:t),a(t=>t?.seriesKey===e?void 0:t),s(t=>t===e?void 0:t),l(t=>t?.seriesKey===e?void 0:t),d(t=>t?.seriesKey===e?void 0:t)):p(e)},clearPinned:()=>p(void 0),reconcile:(e,n)=>{let i=t=>t!==void 0&&e.has(t.seriesKey)&&(n===void 0||n.has(t.parentKey));t(t=>t!==void 0&&!e.has(t)?void 0:t),r(t=>t!==void 0&&!e.has(t.seriesKey)?void 0:t),a(e=>i(e)?e:void 0),s(t=>t!==void 0&&!e.has(t)?void 0:t),l(t=>t!==void 0&&!e.has(t.seriesKey)?void 0:t),d(e=>i(e)?e:void 0),p(t=>t!==void 0&&!e.has(t)?void 0:t)}}}var BO=L(`<div class=qg-detail><nav class=qg-breadcrumbs aria-label=Breadcrumb><a>Analytics</a><span aria-hidden=true>›</span><a>Models</a><span aria-hidden=true>›</span><span aria-current=page class=qg-breakable></span></nav><header class=qg-page-head><h2 class="qg-page-title qg-breakable"id=qg-model-head>`);function VO(e){let[t,n]=b(`cost`),r=zO(),i=()=>Mw(e.snapshot.series).map(t=>Sw(t,e.snapshot.dimension)),a=C(()=>{let t=new Set;for(let n of e.snapshot.series)if(n.kind===`other`)for(let r of n.parentBuckets??[])for(let n of r)t.add(xw(e.snapshot.dimension,n.identity));return t}),o=()=>{let e=r.activeParent();return e!==void 0&&r.active()===e.seriesKey&&a().has(e.parentKey)?e:void 0},s=()=>BE(e.snapshot.totals),c=()=>{let t=[{label:`Total tokens`,value:$(e.snapshot.totals.total),emphasis:`primary`},{label:`API-equivalent estimate`,value:Ww(e.snapshot.totals),info:j(pD,{}),note:j(hD,{get totals(){return e.snapshot.totals}}),title:Gw(e.snapshot.totals)},{label:`Sessions`,value:$(e.snapshot.sessionCount)}],n=s();return n!==null&&t.push({label:`Cache hit rate`,value:UC(n)}),t},l=()=>Dw(e.identity,`model`);return(()=>{var s=BO(),u=s.firstChild,d=u.firstChild,f=d.nextSibling.nextSibling,p=f.nextSibling.nextSibling,m=u.nextSibling.firstChild;return B(p,l),B(m,l),B(s,j(RO,{get snapshot(){return e.snapshot},get title(){return Ew(e.snapshot.dimension)},headingId:`qg-model-usage`,get summary(){return j(sD,{get items(){return c()}})},get activeSeries(){return r.active()},get activeParent(){return o()},get pinnedSeries(){return r.pinned()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onTogglePinnedSeries(){return r.togglePinned},get onClearPinnedSeries(){return r.clearPinned}}),null),B(s,j(iO,{headingId:`qg-model-breakdown`,get rows(){return e.snapshot.rows},get dimension(){return e.snapshot.dimension},get range(){return e.range},get sort(){return t()},onSortChange:n,showChildren:!1,get temporalBreakdown(){return e.snapshot.temporalBreakdown},get seriesKeys(){return i()},get modelsGroup(){return e.modelsGroup??`model`},get activeSeries(){return r.active()},get otherParentKeys(){return a()},get activeParent(){return o()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onPointerParent(){return r.inspectPointerParent},get onFocusParent(){return r.inspectFocusParent}}),null),x(t=>{var n=Q({name:`analytics`},e.range),r=Q({name:`models`,dimension:e.modelsGroup??`model`},e.range);return n!==t.e&&R(d,`href`,t.e=n),r!==t.t&&R(f,`href`,t.t=r),t},{e:void 0,t:void 0}),s})()}function HO(e){let[t,n]=b(`cost`),r=zO(),i=()=>Mw(e.snapshot?.series??[]).map(t=>Sw(t,e.snapshot?.dimension??e.dimension)),a=()=>{let e=r.active();return e!==void 0&&i().includes(e)?e:void 0},o=()=>{let e=r.activeChild();return e!==void 0&&a()===e.seriesKey?e:void 0},s=C(()=>{let t=e.snapshot?.dimension??e.dimension,n=new Set;for(let r of e.snapshot?.series??[])if(r.kind===`other`)for(let e of r.parentBuckets??[])for(let r of e)n.add(xw(t,r.identity));return n}),c=()=>{let e=r.activeParent();return e!==void 0&&a()===e.seriesKey&&s().has(e.parentKey)?e:void 0},l=()=>{let t=e.snapshot;if(t!==void 0)return[{label:`Processed tokens`,value:$(t.totals.total),emphasis:`primary`},{label:`API-equivalent estimate`,value:Ww(t.totals),info:j(pD,{}),note:j(hD,{get totals(){return t.totals}}),title:Gw(t.totals)}]};return S(()=>{e.dimension,r.clearPointer(),r.clearFocus(),r.clearPinned()}),S(()=>{r.reconcile(new Set(i()),s())}),[j(RO,M({get snapshot(){return e.snapshot},get title(){return Ew(e.dimension)},headingId:`qg-models-usage`,get loading(){return e.loading},get error(){return e.error},get errorRecoverable(){return e.errorRecoverable},get autoRetry(){return e.autoRetry}},()=>e.onAutoRetry===void 0?{}:{onAutoRetry:e.onAutoRetry},{get onRetry(){return e.onRetry},get summary(){return j(F,{get when(){return l()},children:e=>j(sD,{get items(){return e()}})})},get actions(){return j(kp,{class:`qg-sort qg-dimension`,"aria-label":`Group usage by`,get value(){return e.dimension},onChange:t=>{(t===`model`||t===`provider`)&&e.onDimensionChange(t)},get children(){return[j(jp,{value:`provider`,children:`Provider`}),j(jp,{value:`model`,children:`Model`})]}})},get activeSeries(){return a()},get activeChild(){return o()},get activeParent(){return c()},get pinnedSeries(){return r.pinned()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onTogglePinnedSeries(){return r.togglePinned},get onClearPinnedSeries(){return r.clearPinned}})),j(F,{get when(){return e.snapshot},children:e=>j(iO,{headingId:`qg-models-breakdown`,get rows(){return e().rows},get dimension(){return e().dimension},get range(){return e().range},get sort(){return t()},onSortChange:n,get seriesKeys(){return i()},get modelsGroup(){return e().dimension},get activeSeries(){return a()},get activeChild(){return o()},get otherParentKeys(){return s()},get activeParent(){return c()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onPointerChild(){return r.inspectPointerChild},get onFocusChild(){return r.inspectFocusChild},get onPointerParent(){return r.inspectPointerParent},get onFocusParent(){return r.inspectFocusParent}})})]}var UO=L(`<div class=qg-detail><nav class=qg-breadcrumbs aria-label=Breadcrumb><a>Analytics</a><span aria-hidden=true>›</span><span aria-current=page></span></nav><header class=qg-page-head><h2 class=qg-page-title id=qg-project-head>`),WO=L(`<div class="qg-list qg-list--roots"><div class=qg-list__head aria-hidden=true><span>Name</span><span>Worktree</span><span>Tokens`),GO=L(`<section class=qg-section aria-labelledby=qg-project-roots><header class=qg-section__head><h2 class=qg-section__title id=qg-project-roots>Sessions`),KO=L(`<span class=qg-page-head__meta><span class=qg-page-head__meta-label>Worktree`),qO=L(`<a class=qg-list__row data-clickable=true><span class=qg-list__title></span><span class=qg-list__worktree></span><span class=qg-list__tokens>`);function JO(e){let[t,n]=b(`activity`),r=C(()=>oE(e.snapshot.roots,t())),i=()=>{let t=e.snapshot.roots.map(e=>e.worktreeLabel).filter(e=>e!==void 0&&e.length>0);if(t.length===0)return;let[n]=t;return t.every(e=>e===n)?n:void 0},a=()=>[{label:`Total tokens`,value:$(e.snapshot.totals.total),emphasis:`primary`},{label:`API-equivalent estimate`,value:Ww(e.snapshot.totals),info:j(yD,{get totals(){return e.snapshot.totals}}),note:j(hD,{get totals(){return e.snapshot.totals},showExclusionTitle:!1})},{label:`Sessions`,value:$(e.snapshot.totals.sessionCount)}];return[(()=>{var t=UO(),n=t.firstChild,r=n.firstChild,o=r.nextSibling.nextSibling,s=n.nextSibling,c=s.firstChild;return B(o,()=>e.snapshot.name),B(c,()=>e.snapshot.name),B(s,j(F,{get when(){return i()},children:e=>(()=>{var t=KO();return t.firstChild,B(t,e,null),t})()}),null),B(t,j(zD,{get usage(){return e.snapshot.usage},get title(){return aw(e.snapshot.usage.bucketUnit)},headingId:`qg-project-usage`,get summary(){return j(sD,{get items(){return a()}})},emptyMessage:`No activity in this range.`}),null),x(()=>R(r,`href`,Q({name:`analytics`},e.range))),t})(),(()=>{var i=GO(),a=i.firstChild;return a.firstChild,B(a,j(cE,{label:`sessions`,get value(){return t()},onChange:n}),null),B(i,j(F,{get when(){return e.snapshot.roots.length>0},get fallback(){return j(Cx,{message:`No sessions had activity in this range.`})},get children(){var t=WO();return t.firstChild,B(t,j(P,{get each(){return r()},children:t=>(()=>{var n=qO(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling;return B(r,()=>t.title),B(i,()=>t.worktreeLabel??``),B(a,()=>RC(t.tokens.total)),x(i=>{var o=Q({name:`session`,sessionId:t.sessionId},e.range),s=t.title,c=$(t.tokens.total);return o!==i.e&&R(n,`href`,i.e=o),s!==i.t&&R(r,`title`,i.t=s),c!==i.a&&R(a,`title`,i.a=c),i},{e:void 0,t:void 0,a:void 0}),n})()}),null),t}}),null),i})()]}var YO=L(`<div class=qg-detail><nav class=qg-breadcrumbs aria-label=Breadcrumb><a>Analytics</a><span aria-hidden=true>›</span><a>Models</a><span aria-hidden=true>›</span><span aria-current=page class=qg-breakable></span></nav><header class=qg-page-head><h2 class="qg-page-title qg-breakable"id=qg-provider-head>`),XO=L(`<span class=qg-page-head__meta><span class=qg-page-head__meta-label>Provider ID`);function ZO(e){let[t,n]=b(`cost`),r=zO(),i=()=>Mw(e.snapshot.series).map(t=>Sw(t,e.snapshot.dimension)),a=C(()=>{let t=new Set;for(let n of e.snapshot.series)if(n.kind===`other`)for(let r of n.parentBuckets??[])for(let n of r)t.add(xw(e.snapshot.dimension,n.identity));return t}),o=()=>{let e=r.activeParent();return e!==void 0&&r.active()===e.seriesKey&&a().has(e.parentKey)?e:void 0},s=()=>Dw(e.identity,`provider`),c=()=>{if(e.identity.kind===`known`&&e.identity.id.trim().length!==0)return s()===e.identity.id?void 0:e.identity.id},l=()=>[{label:`Total tokens`,value:$(e.snapshot.totals.total),emphasis:`primary`},{label:`API-equivalent estimate`,value:Ww(e.snapshot.totals),info:j(pD,{}),note:j(hD,{get totals(){return e.snapshot.totals}}),title:Gw(e.snapshot.totals)},{label:`Sessions`,value:$(e.snapshot.sessionCount)},{label:`Models`,value:$(e.snapshot.rows.length)}];return(()=>{var u=YO(),d=u.firstChild,f=d.firstChild,p=f.nextSibling.nextSibling,m=p.nextSibling.nextSibling,h=d.nextSibling,g=h.firstChild;return B(m,s),B(g,j(GS,{get providerId(){return I(()=>e.identity.kind===`known`)()?e.identity.id:``},class:`qg-page-head__logo`}),null),B(g,s,null),B(h,j(F,{get when(){return c()},children:e=>(()=>{var t=XO();return t.firstChild,B(t,e,null),t})()}),null),B(u,j(RO,{get snapshot(){return e.snapshot},get title(){return Ew(e.snapshot.dimension)},headingId:`qg-provider-usage`,get summary(){return j(sD,{get items(){return l()}})},get activeSeries(){return r.active()},get activeParent(){return o()},get pinnedSeries(){return r.pinned()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onTogglePinnedSeries(){return r.togglePinned},get onClearPinnedSeries(){return r.clearPinned}}),null),B(u,j(iO,{headingId:`qg-provider-breakdown`,get rows(){return e.snapshot.rows},get dimension(){return e.snapshot.dimension},get range(){return e.range},get sort(){return t()},onSortChange:n,showChildren:!1,get seriesKeys(){return i()},get modelsGroup(){return e.modelsGroup??`provider`},get activeSeries(){return r.active()},get otherParentKeys(){return a()},get activeParent(){return o()},get onPointerSeries(){return r.inspectPointer},get onFocusSeries(){return r.inspectFocus},get onPointerParent(){return r.inspectPointerParent},get onFocusParent(){return r.inspectFocusParent}}),null),x(t=>{var n=Q({name:`analytics`},e.range),r=Q({name:`models`,dimension:e.modelsGroup??`provider`},e.range);return n!==t.e&&R(f,`href`,t.e=n),r!==t.t&&R(p,`href`,t.t=r),t},{e:void 0,t:void 0}),u})()}var QO=L(`<span role=img><span class=qg-model-identity__id>`),$O=L(`<span>`);function ek(e){let t=()=>WC(e),n=()=>`${e.modelId}${e.effort?`#${e.effort}`:``}`,r=()=>Hx(e.providerId),i=()=>e.class===void 0?`qg-model-identity`:`qg-model-identity ${e.class}`;return j(F,{get when(){return r().hasSpecificLogo},get fallback(){return(()=>{var e=$O();return B(e,t),x(n=>{var r=i(),a=t();return r!==n.e&&Qe(e,n.e=r),a!==n.t&&R(e,`title`,n.t=a),n},{e:void 0,t:void 0}),e})()},get children(){var a=QO(),o=a.firstChild;return B(a,()=>e.renderLogo(e.providerId),o),B(o,n),x(e=>{var n=i(),o=`${r().label}: ${t()}`,s=t();return n!==e.e&&Qe(a,e.e=n),o!==e.t&&R(a,`aria-label`,e.t=o),s!==e.a&&R(a,`title`,e.a=s),e},{e:void 0,t:void 0,a:void 0}),a}})}function tk(e){return j(GS,{providerId:e,class:`qg-model-identity__logo`})}function nk(e){return j(ek,{get providerId(){return e.identity.providerId},get modelId(){return e.identity.modelId},get effort(){return e.identity.effort},renderLogo:tk,get class(){return e.class}})}function rk(e,t){let n=[],r;return e.forEach((e,i)=>{if(e.sessionId!==t)return;let a=r?.model,o=e.model;r=e,a!==void 0&&o!==void 0&&(a.providerId!==o.providerId||a.modelId!==o.modelId?n.push({stepIndex:i,kind:`model`,from:a,to:o}):a.effort!==o.effort&&n.push({stepIndex:i,kind:`effort`,from:a,to:o}))}),n}var ik=L(`<svg><path class="qg-chart__area qg-chart__area--total"></svg>`,!1,!0,!1),ak=L(`<svg><path class="qg-chart__area qg-chart__area--own"></svg>`,!1,!0,!1),ok=L(`<svg><path class="qg-chart__area qg-chart__area--context"></svg>`,!1,!0,!1),sk=L(`<svg><path class="qg-chart__line qg-chart__line--total"></svg>`,!1,!0,!1),ck=L(`<svg><path class="qg-chart__line qg-chart__line--own"></svg>`,!1,!0,!1),lk=L(`<svg><path class="qg-chart__line qg-chart__line--context"></svg>`,!1,!0,!1),uk=L(`<svg><line class=qg-chart__cursor></svg>`,!1,!0,!1),dk=L(`<svg><circle class="qg-chart__rate-point qg-chart__rate-point--active"r=3></svg>`,!1,!0,!1),fk=L(`<svg role=img><text class="qg-chart__axis-title qg-chart__axis-title--context"text-anchor=start></text><text class="qg-chart__axis-title qg-chart__axis-title--total"text-anchor=end></text><text class="qg-chart__axis-title qg-chart__axis-title--steps"text-anchor=start>Steps`),pk=L(`<div class=qg-chart__surface role=slider tabindex=0 aria-label="Inspect session steps"aria-orientation=horizontal aria-valuemin=1>`),mk=L(`<div class=qg-chart>`),hk=L(`<p class=qg-chart__note>Descendants added <!> tokens after the last main session step; the orange Session tree line ends there. Tree total tokens in the summary is the final total.`),gk=L(`<th scope=col>Cumulative tokens (Session tree)`),_k=L(`<div class=sr-only><table><caption>Completed steps in the <!>. Context is this session's own; the cumulative total covers this session.</caption><thead><tr><th scope=col>Step</th><th scope=col>Session</th><th scope=col>Branch</th><th scope=col>At</th><th scope=col>Context tokens</th><th scope=col></th><th scope=col></th><th scope=col>Compaction</th><th scope=col>Input</th></tr></thead><tbody>`),vk=L(`<div class=qg-totals__row><span class=qg-totals__label>Steps (tree)</span><span class=qg-totals__value>`),yk=L(`<div class=qg-totals><div class=qg-totals__row><span class=qg-totals__label></span><span class=qg-totals__value></span></div><div class=qg-totals__row><span class=qg-totals__label></span><span class=qg-totals__value>`),bk=L(`<div class=qg-legend__item style=--qg-swatch:var(--qg-chart-total)><span class="qg-legend__swatch qg-legend__swatch--dashed"aria-hidden=true></span><span class=qg-legend__label>Cumulative · Session tree`),xk=L(`<div class=qg-legend__item><span class="qg-legend__mark qg-legend__mark--model"aria-hidden=true></span><span class=qg-legend__label>Model change`),Sk=L(`<div class=qg-legend__item><span class="qg-legend__mark qg-legend__mark--effort"aria-hidden=true></span><span class=qg-legend__label>Effort change`),Ck=L(`<div class=qg-legend__item><span class="qg-legend__mark qg-legend__mark--input"aria-hidden=true></span><span class=qg-legend__label>`),wk=L(`<div class=qg-legend><div class=qg-legend__item style=--qg-swatch:var(--qg-chart-context)><span class=qg-legend__swatch aria-hidden=true></span><span class=qg-legend__label></span></div><div class=qg-legend__item style=--qg-swatch:var(--qg-chart-own)><span class="qg-legend__swatch qg-legend__swatch--dashed"aria-hidden=true></span><span class=qg-legend__label></span></div><div class=qg-legend__item style=--qg-swatch:var(--qg-chart-rate)><span class=qg-legend__swatch aria-hidden=true></span><span class=qg-legend__label>`),Tk=L(`<p class=qg-empty>No completed steps in the <!> yet.`),Ek=L(`<svg><line class=qg-chart__grid-line></svg>`,!1,!0,!1),Dk=L(`<svg><text class="qg-chart__axis-label qg-chart__axis-label--context"text-anchor=end></svg>`,!1,!0,!1),Ok=L(`<svg><line class=qg-chart__tick-mark></svg>`,!1,!0,!1),kk=L(`<svg><text class="qg-chart__axis-label qg-chart__axis-label--total"text-anchor=start></svg>`,!1,!0,!1),Ak=L(`<svg><line class=qg-chart__marker></svg>`,!1,!0,!1),jk=L(`<svg><circle class="qg-chart__point qg-chart__point--total"r=4.5></svg>`,!1,!0,!1),Mk=L(`<svg><circle class="qg-chart__point qg-chart__point--context"r=3.5></svg>`,!1,!0,!1),Nk=L(`<svg><circle class="qg-chart__point qg-chart__point--own"r=2.5></svg>`,!1,!0,!1),Pk=L(`<svg><path class="qg-chart__rate-line qg-chart__rate-line--session"></svg>`,!1,!0,!1),Fk=L(`<svg><circle class=qg-chart__rate-point r=2.5></svg>`,!1,!0,!1),Ik=L(`<svg><path></svg>`,!1,!0,!1),Lk=L(`<svg><path class="qg-chart__transition qg-chart__transition--input"></svg>`,!1,!0,!1),Rk=L(`<svg><text class="qg-chart__axis-label qg-chart__axis-label--step"text-anchor=middle></svg>`,!1,!0,!1),zk=L(`<div class=qg-tooltip__grid-row><span class=qg-tooltip__swatch aria-hidden=true style=--qg-swatch:var(--qg-chart-total)></span><span class=qg-tooltip__label>Cumulative · Session tree</span><span class=qg-tooltip__value>`),Bk=L(`<div class="qg-tooltip__grid-row qg-tooltip__grid-row--detail"><span class=qg-tooltip__swatch-spacer aria-hidden=true></span><span class=qg-tooltip__label></span><span class=qg-tooltip__value>`),Vk=L(`<div class=qg-tooltip__grid-row><span class="qg-tooltip__swatch qg-tooltip__swatch--input"aria-hidden=true></span><span class=qg-tooltip__label>Input</span><span class=qg-tooltip__value>`),Hk=L(`<div class=qg-tooltip__grid-row><span class=qg-tooltip__swatch-spacer aria-hidden=true></span><span class=qg-tooltip__label>Session tree total</span><span class=qg-tooltip__value>`),Uk=L(`<p class=qg-tooltip__note>Descendants ran later; the tree line ends at this step.`),Wk=L(`<p class=qg-tooltip__note>Compaction `),Gk=L(`<output class="qg-tooltip qg-tooltip--session"><div class=qg-tooltip__head><span>Step </span></div><div class="qg-tooltip__group qg-tooltip__group--series"><div class=qg-tooltip__grid-row><span class=qg-tooltip__swatch aria-hidden=true style=--qg-swatch:var(--qg-chart-context)></span><span class=qg-tooltip__label></span><span class=qg-tooltip__value></span></div><div class=qg-tooltip__grid-row><span class=qg-tooltip__swatch aria-hidden=true style=--qg-swatch:var(--qg-chart-own)></span><span class=qg-tooltip__label></span><span class=qg-tooltip__value></span></div><div class=qg-tooltip__grid-row><span class=qg-tooltip__swatch aria-hidden=true style=--qg-swatch:var(--qg-chart-rate)></span><span class=qg-tooltip__label></span><span class=qg-tooltip__value>`),Kk=L(`<span class="qg-tooltip__note qg-tooltip__transition"> from <!> to `),qk=L(`<div class=qg-tooltip__grid-row><span class=qg-tooltip__label></span><span class=qg-tooltip__value>`),Jk=L(`<div class="qg-tooltip__group qg-tooltip__group--timing"><div class=qg-tooltip__grid-row><span class=qg-tooltip__label></span><span class=qg-tooltip__value>`),Yk=L(`<p class=qg-chart__axis-caption>`),Xk=L(`<td>`),Zk=L(`<tr><th scope=row></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>`);function Qk(e){let t=XE(),n=t.active,{size:r,ref:i}=QE(VE),a=C(()=>JE(e.snapshot,r)),o=C(()=>e.snapshot.steps.filter(t=>t.sessionId===e.snapshot.focusSessionId)),s=C(()=>rk(o(),e.snapshot.focusSessionId)),c=e=>s().find(t=>t.stepIndex===e),l=C(()=>{let e=new Set,t=[];for(let n of o()){if(!n.model)continue;let r=WC(n.model);e.has(r)||(e.add(r),t.push(r))}return t}),u=e=>a().cache.rates[e]??null,d=C(()=>hE(o())),f=e=>d()[e],p=e=>{let t=o()[e];return t===void 0||t.cacheReadUnknown?void 0:t.stack.cacheRead},m=C(()=>vE({...e.snapshot,steps:o()})),h=()=>e.snapshot.ownSummary,g=()=>e.snapshot.treeTotals,_=()=>e.snapshot.timeZone,v=()=>e.variant===`main`&&a().hasDescendants,y=()=>e.variant===`main`,b=()=>y()?`Context · Main session`:`Context`,S=()=>y()?`Cumulative · Main session`:`Cumulative`,w=()=>y()?`Cache Rate · Main session`:`Cache Rate`,T=()=>y()?`Steps (own)`:`Steps`,E=()=>y()?`Compactions (focus session)`:`Compactions`,D=()=>e.snapshot.nodes.find(t=>t.sessionId===e.snapshot.focusSessionId)?.parentId===void 0,O=()=>y()||D()?`User prompt`:`Orchestrator message`,k=C(()=>o().flatMap((e,t)=>e.inputMarker===!0?[t]:[])),ee=C(()=>{let e=o(),t=e[0],n=e[e.length-1];return t!==void 0&&n!==void 0&&qC(t.atMs,_())!==qC(n.atMs,_())}),te=e=>e.createdAtMs!==void 0&&qC(e.createdAtMs,_())!==qC(e.completedAtMs,_()),ne=e=>e.createdAtMs===void 0?`—`:te(e)||ee()?KC(e.createdAtMs,_()):JC(e.createdAtMs,_()),re=e=>te(e)?KC(e.completedAtMs,_()):JC(e.completedAtMs,_()),ie=()=>!v()||a().stepCount===0?0:Math.max(0,g().total-(a().treeCumulativeValues.at(-1)??0)),A=()=>e.snapshot.compactionMarkers.filter(t=>t.sessionId===e.snapshot.focusSessionId).length,ae=(e,t)=>{let n={label:e,value:t===null?lE.unavailable:YC(t.idleMs),title:t===null?lE.gapBasis:`${lE.gapBasis} (steps ${t.fromStepIndex+1} → ${t.toStepIndex+1})`};return t!==null&&(n.note=dE(t.cacheReusePct)),n},oe=()=>[ae(lE.longestIdleGap,m().longestIdle),ae(lE.longestHighReuseGap,m().longestHighReuse)],se=()=>[...v()?[{label:`Tree total tokens`,value:$(g().total),emphasis:`primary`},{label:`This session · own tokens`,value:$(h().total)}]:[{label:`Total tokens · this session`,value:$(h().total),emphasis:`primary`}],...oe()],ce=e=>a().compaction.filter(t=>t.stepIndex===e),le=e=>a().contextValues[e],ue=()=>{let e=n();return e===void 0?void 0:o()[e]},de=()=>{let e=n();return e===void 0?[]:ce(e)},fe=eD(()=>{let e=n();return e===void 0?0:a().stepX(e)/r.width}),pe=()=>{let e=fe.position();return{left:`${e.left}px`,top:`${e.top}px`,"min-width":`min(280px, ${e.maxWidth}px)`,"max-width":`${e.maxWidth}px`,"max-height":`${e.maxHeight}px`,visibility:e.visible?`visible`:`hidden`}},me=e=>e===null?lE.unavailable:UC(e),he=e=>{let t=o()[e];if(!t)return`Step ${e+1}`;let n=le(e),r=n===void 0?`Context —`:`Context ${$(n)}`,i=[`Step ${e+1}`,KC(t.atMs,_()),r,`${S()} ${$(a().ownCumulativeValues[e]??0)}`];t.inputMarker&&i.push(`Input ${O()}`),v()&&i.push(`Cumulative · Session tree ${$(a().treeCumulativeValues[e]??0)}`);let s=u(e);i.push(`${lE.cacheReuse} ${me(s)}`);let l=f(e);l&&(l.durationMs!==void 0&&i.push(`${lE.messageDuration} ${YC(l.durationMs)}`),l.overlap?i.push(lE.overlapsPrevious):l.idleMs!==void 0&&i.push(`${lE.idleSincePrevious} ${YC(l.idleMs)}`));let d=c(e);return d&&i.push(`${d.kind===`model`?`Model changed`:`Effort changed`} from ${WC(d.from)} to ${WC(d.to)}`),i.join(`, `)},ge=e=>{let n=e.currentTarget;if(!n)return;let r=n.getBoundingClientRect();if(!(r.width>0))return;let i=a().plot,o=i.left+(e.clientX-r.left)/r.width*i.width;t.inspectPointer(ZE({x:o,left:i.left,width:i.width,count:a().stepCount}))},_e=e=>{let r=a().stepCount;if(r<=0)return;let i=n()??0,o;e.key===`ArrowRight`||e.key===`ArrowDown`?o=Math.min(r-1,i+1):e.key===`ArrowLeft`||e.key===`ArrowUp`?o=Math.max(0,i-1):e.key===`Home`?o=0:e.key===`End`&&(o=r-1),o!==void 0&&(e.preventDefault(),t.clearPointer(),t.inspectFocus(o))},ve=e=>Number.isFinite(e)?e===0?`0`:Math.abs(e)<100?Number(e.toPrecision(3)).toString():RC(e):`—`,ye=()=>a().plot.width<210,be=()=>{let e=a().stepCount;if(!(e<=0))return rw(`step ${e}`,e,a().labelIndexes)};return j(cD,{get title(){return e.title??`Usage by step`},get headingId(){return e.headingId},get summary(){return j(sD,{get items(){return se()}})},bodyClass:`qg-usage qg-usage--session`,get aside(){return[(()=>{var t=yk(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling,o=a.firstChild,s=o.nextSibling;return B(r,T),B(i,()=>$(h().stepCount)),B(t,j(F,{get when(){return v()},get children(){var t=vk(),n=t.firstChild.nextSibling;return B(n,()=>$(e.snapshot.steps.length)),t}}),a),B(o,E),B(s,()=>$(A())),t})(),(()=>{var e=wk(),t=e.firstChild,n=t.firstChild.nextSibling,r=t.nextSibling,i=r.firstChild.nextSibling,a=r.nextSibling,o=a.firstChild.nextSibling;return B(n,b),B(i,S),B(e,j(F,{get when(){return v()},get children(){return bk()}}),a),B(o,w),B(e,j(F,{get when(){return s().some(e=>e.kind===`model`)},get children(){return xk()}}),null),B(e,j(F,{get when(){return s().some(e=>e.kind===`effort`)},get children(){return Sk()}}),null),B(e,j(F,{get when(){return k().length>0},get children(){var e=Ck(),t=e.firstChild.nextSibling;return B(t,O),e}}),null),e})()]},get children(){return[(()=>{var d=mk();return rt(e=>{i(e),fe.chartRef(e)},d),B(d,j(F,{get when(){return a().stepCount>0},get fallback(){return(()=>{var t=Tk(),n=t.firstChild.nextSibling;return n.nextSibling,B(t,()=>e.variant===`main`?`main session`:`session`,n),t})()},get children(){return[(()=>{var t=fk(),i=t.firstChild,c=i.nextSibling,l=c.nextSibling;return B(i,()=>ye()?`Context`:`Context tokens`),B(c,()=>ye()?`Cumulative`:`Cumulative tokens`),B(t,j(P,{get each(){return a().context.ticks},children:e=>[(()=>{var t=Ek();return x(n=>{var r=a().plot.left,i=a().plot.right,o=e.y,s=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),o!==n.a&&R(t,`y1`,n.a=o),s!==n.o&&R(t,`y2`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=Dk();return B(t,()=>ve(e.value)),x(n=>{var r=a().plot.left-8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]}),l),B(t,j(P,{get each(){return a().cumulativeTicks},children:e=>[(()=>{var t=Ok();return x(n=>{var r=a().plot.right,i=a().plot.right+4,o=e.y,s=e.y;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),o!==n.a&&R(t,`y1`,n.a=o),s!==n.o&&R(t,`y2`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=kk();return B(t,()=>ve(e.value)),x(n=>{var r=a().plot.right+8,i=e.y+3;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t})()]}),l),B(t,j(P,{get each(){return a().compaction},children:e=>(()=>{var t=Ak();return x(n=>{var r=e.x,i=e.x,o=a().plot.top,s=a().plot.bottom;return r!==n.e&&R(t,`x1`,n.e=r),i!==n.t&&R(t,`x2`,n.t=i),o!==n.a&&R(t,`y1`,n.a=o),s!==n.o&&R(t,`y2`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}),l),B(t,j(F,{get when(){return I(()=>!!v())()&&a().tree.areaPath},get children(){var e=ik();return x(()=>R(e,`d`,a().tree.areaPath)),e}}),l),B(t,j(F,{get when(){return a().own.areaPath},get children(){var e=ak();return x(()=>R(e,`d`,a().own.areaPath)),e}}),l),B(t,j(F,{get when(){return a().context.areaPath},get children(){var e=ok();return x(()=>R(e,`d`,a().context.areaPath)),e}}),l),B(t,j(F,{get when(){return I(()=>!!v())()&&a().tree.points.length>0},get children(){var e=sk();return x(()=>R(e,`d`,a().tree.linePath)),e}}),l),B(t,j(F,{get when(){return a().own.points.length>0},get children(){var e=ck();return x(()=>R(e,`d`,a().own.linePath)),e}}),l),B(t,j(F,{get when(){return a().context.points.length>0},get children(){var e=lk();return x(()=>R(e,`d`,a().context.linePath)),e}}),l),B(t,j(F,{get when(){return I(()=>!!(v()&&a().tree.points.length===1))()?a().tree.points[0]:void 0},children:e=>(()=>{var t=jk();return x(n=>{var r=e().x,i=e().y;return r!==n.e&&R(t,`cx`,n.e=r),i!==n.t&&R(t,`cy`,n.t=i),n},{e:void 0,t:void 0}),t})()}),l),B(t,j(F,{get when(){return I(()=>a().context.points.length===1)()?a().context.points[0]:void 0},children:e=>(()=>{var t=Mk();return x(n=>{var r=e().x,i=e().y;return r!==n.e&&R(t,`cx`,n.e=r),i!==n.t&&R(t,`cy`,n.t=i),n},{e:void 0,t:void 0}),t})()}),l),B(t,j(F,{get when(){return I(()=>a().own.points.length===1)()?a().own.points[0]:void 0},children:e=>(()=>{var t=Nk();return x(n=>{var r=e().x,i=e().y;return r!==n.e&&R(t,`cx`,n.e=r),i!==n.t&&R(t,`cy`,n.t=i),n},{e:void 0,t:void 0}),t})()}),l),B(t,j(P,{get each(){return a().cache.paths},children:e=>(()=>{var t=Pk();return R(t,`d`,e),t})()}),l),B(t,j(P,{get each(){return a().cache.singles},children:e=>(()=>{var t=Fk();return x(n=>{var r=e.x,i=e.y;return r!==n.e&&R(t,`cx`,n.e=r),i!==n.t&&R(t,`cy`,n.t=i),n},{e:void 0,t:void 0}),t})()}),l),B(t,j(P,{get each(){return s()},children:e=>(()=>{var t=Ik();return x(n=>{var r=`qg-chart__transition qg-chart__transition--${e.kind}`,i=e.kind===`model`?`M ${a().stepX(e.stepIndex)} ${a().plot.top+1} l 4 4 l -4 4 l -4 -4 Z`:`M ${a().stepX(e.stepIndex)-3.5} ${a().plot.top+1} h 7 v 7 h -7 Z`;return r!==n.e&&R(t,`class`,n.e=r),i!==n.t&&R(t,`d`,n.t=i),n},{e:void 0,t:void 0}),t})()}),l),B(t,j(P,{get each(){return k()},children:e=>(()=>{var t=Lk();return x(()=>R(t,`d`,`M ${a().stepX(e)-3.5} ${a().plot.top+10} h 7 v 7 h -7 Z`)),t})()}),l),B(t,j(F,{get when(){return n()!==void 0},get children(){return[(()=>{var e=uk();return x(t=>{var r=a().stepX(n()??0),i=a().stepX(n()??0),o=a().plot.top,s=a().plot.bottom;return r!==t.e&&R(e,`x1`,t.e=r),i!==t.t&&R(e,`x2`,t.t=i),o!==t.a&&R(e,`y1`,t.a=o),s!==t.o&&R(e,`y2`,t.o=s),t},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),j(F,{get when(){return u(n()??0)!==null},get children(){var e=dk();return x(t=>{var r=a().stepX(n()??0),i=a().plot.bottom-Math.min(Math.max(u(n()??0)??0,0),100)/100*a().plot.height;return r!==t.e&&R(e,`cx`,t.e=r),i!==t.t&&R(e,`cy`,t.t=i),t},{e:void 0,t:void 0}),e}})]}}),l),B(t,j(P,{get each(){return a().labelIndexes},children:e=>{let t=()=>o()[e];return j(F,{get when(){return t()},get children(){var t=Rk();return B(t,e+1),x(n=>{var r=a().stepX(e),i=a().axisLabelY;return r!==n.e&&R(t,`x`,n.e=r),i!==n.t&&R(t,`y`,n.t=i),n},{e:void 0,t:void 0}),t}})}}),l),x(n=>{var o=`0 0 ${r.width} ${a().viewHeight}`,s=`Step series for ${e.snapshot.focusSessionId}: ${e.variant===`main`?`main-session`:`focus-session`} context on the left axis and cumulative consumption ${v()?`for this session and its session tree`:`for this session`} on the right axis, plus Cache rate from 0 to 100 percent of the plot height, over ${a().stepCount} completed ${a().stepCount===1?`step`:`steps`}.${ie()>0?` The orange Session tree line ends at the last step shown; descendants that ran later are counted only in the final tree total in the summary.`:``}`,u=a().plot.left,d=a().plot.top-12,f=a().plot.right,p=a().plot.top-12,m=a().plot.left,h=a().viewHeight-4;return o!==n.e&&R(t,`viewBox`,n.e=o),s!==n.t&&R(t,`aria-label`,n.t=s),u!==n.a&&R(i,`x`,n.a=u),d!==n.o&&R(i,`y`,n.o=d),f!==n.i&&R(c,`x`,n.i=f),p!==n.n&&R(c,`y`,n.n=p),m!==n.s&&R(l,`x`,n.s=m),h!==n.h&&R(l,`y`,n.h=h),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),t})(),(()=>{var e=pk();return e.$$keydown=_e,$e(e,`blur`,t.clearFocus),e.addEventListener(`focus`,()=>t.inspectFocus(n()??0)),$e(e,`pointerleave`,t.clearPointer),e.$$pointermove=ge,x(t=>{var i=Math.max(1,a().stepCount),o=(n()??0)+1,s=he(n()??0),c=`${a().plot.top/a().viewHeight*100}%`,l=`${(a().viewHeight-a().plot.bottom)/a().viewHeight*100}%`,u=`${a().plot.left/r.width*100}%`,d=`${(r.width-a().plot.right)/r.width*100}%`;return i!==t.e&&R(e,`aria-valuemax`,t.e=i),o!==t.t&&R(e,`aria-valuenow`,t.t=o),s!==t.a&&R(e,`aria-valuetext`,t.a=s),c!==t.o&&z(e,`top`,t.o=c),l!==t.i&&z(e,`bottom`,t.i=l),u!==t.n&&z(e,`left`,t.n=u),d!==t.s&&z(e,`right`,t.s=d),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),e})(),j(F,{get when(){return ue()},children:e=>(()=>{var t=Gk(),r=t.firstChild,i=r.firstChild;i.firstChild;var s=r.nextSibling,d=s.firstChild,m=d.firstChild.nextSibling,h=m.nextSibling,y=d.nextSibling,C=y.firstChild.nextSibling,T=C.nextSibling,E=y.nextSibling,D=E.firstChild.nextSibling,k=D.nextSibling,te=fe.tooltipRef;return typeof te==`function`?rt(te,t):fe.tooltipRef=t,B(i,()=>(n()??0)+1,null),B(r,j(F,{get when(){return I(()=>l().length>1)()?e().model:void 0},children:e=>j(nk,{get identity(){return e()},class:`qg-tooltip__model`})}),null),B(r,j(F,{get when(){return I(()=>!!(l().length>1&&e().model))()&&c(n()??0)},children:e=>(()=>{var t=Kk(),n=t.firstChild,r=n.nextSibling;return r.nextSibling,B(t,()=>e().kind===`model`?`Model changed`:`Effort changed`,n),B(t,()=>WC(e().from),r),B(t,()=>WC(e().to),null),t})()}),null),B(m,b),B(h,(()=>{var e=I(()=>le(n()??0)===void 0);return()=>e()?`—`:$(le(n()??0))})()),B(C,S),B(T,()=>$(a().ownCumulativeValues[n()??0]??0)),B(s,j(F,{get when(){return v()},get children(){var e=zk(),t=e.firstChild.nextSibling.nextSibling;return B(t,()=>$(a().treeCumulativeValues[n()??0]??0)),e}}),E),B(D,w),B(k,(()=>{var e=I(()=>u(n()??0)===null);return()=>e()?lE.unavailable:UC(u(n()??0))})()),B(s,j(F,{get when(){return p(n()??0)!==void 0},get children(){var e=Bk(),t=e.firstChild.nextSibling,r=t.nextSibling;return B(t,()=>lE.cacheReadTokens),B(r,()=>$(p(n()??0))),e}}),null),B(s,j(F,{get when(){return o()[n()??0]?.inputMarker},get children(){var e=Vk(),t=e.firstChild.nextSibling.nextSibling;return B(t,O),e}}),null),B(s,j(F,{get when(){return I(()=>n()===a().stepCount-1)()&&ie()>0},get children(){return[(()=>{var e=Hk(),t=e.firstChild.nextSibling.nextSibling;return B(t,()=>$(g().total)),e})(),Uk()]}}),null),B(s,j(F,{get when(){return de().length>0},get children(){var e=Wk();return e.firstChild,B(e,()=>de().map(e=>ee()?KC(e.atMs,_()):JC(e.atMs,_())).join(`, `),null),e}}),null),B(t,j(F,{get when(){return f(n()??0)},children:e=>(()=>{var t=Jk(),n=t.firstChild,r=n.firstChild,i=r.nextSibling;return B(t,j(F,{get when(){return e().createdAtMs!==void 0},get children(){var t=qk(),n=t.firstChild,r=n.nextSibling;return B(n,()=>lE.messageCreated),B(r,()=>ne(e())),t}}),n),B(r,()=>lE.messageCompleted),B(i,()=>re(e())),B(t,j(F,{get when(){return e().durationMs!==void 0},get children(){var t=qk(),n=t.firstChild,r=n.nextSibling;return B(n,()=>lE.messageDuration),B(r,()=>YC(e().durationMs)),t}}),null),B(t,j(F,{get when(){return e().overlap||e().idleMs!==void 0},get children(){var t=qk(),n=t.firstChild,r=n.nextSibling;return B(n,(()=>{var t=I(()=>!!e().overlap);return()=>t()?lE.overlapsPrevious:lE.idleSincePrevious})()),B(r,(()=>{var t=I(()=>!!e().overlap);return()=>t()?I(()=>e().overlapMs===void 0)()?`Yes`:YC(e().overlapMs):YC(e().idleMs)})()),t}}),null),t})()}),null),x(e=>tt(t,pe(),e)),t})()})]}})),d})(),j(F,{get when(){return be()},children:e=>(()=>{var t=Yk();return B(t,e),t})()}),j(F,{get when(){return I(()=>a().stepCount>0)()&&ie()>0},get children(){var e=hk(),t=e.firstChild.nextSibling;return t.nextSibling,B(e,()=>$(ie()),t),e}}),(()=>{var t=_k(),n=t.firstChild.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling,s=i.firstChild,c=s.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,l=c.nextSibling,d=i.nextSibling;return B(n,()=>e.variant===`main`?`main session`:`session`,r),B(n,()=>v()?` The Session tree cumulative is folded at these step positions only and ends at the last step; descendant activity that ran later appears only in the final tree total summary.`:``,null),B(c,()=>y()?`Cumulative tokens (Main session)`:`Cumulative tokens`),B(s,j(F,{get when(){return v()},get children(){return gk()}}),l),B(l,w),B(d,j(P,{get each(){return o()},children:(e,t)=>(()=>{var n=Zk(),r=n.firstChild,i=r.nextSibling,o=i.nextSibling,s=o.nextSibling,c=s.nextSibling,l=c.nextSibling,d=l.nextSibling,f=d.nextSibling,p=f.nextSibling;return B(r,()=>t()+1),B(i,()=>e.sessionId),B(o,()=>e.branch),B(s,()=>KC(e.atMs,_())),B(c,(()=>{var e=I(()=>le(t())===void 0);return()=>e()?`—`:$(le(t()))})()),B(l,()=>$(a().ownCumulativeValues[t()]??0)),B(n,j(F,{get when(){return v()},get children(){var e=Xk();return B(e,()=>$(a().treeCumulativeValues[t()]??0)),e}}),d),B(d,()=>me(u(t()))),B(f,(()=>{var e=I(()=>ce(t()).length===0);return()=>e()?`—`:ce(t()).map(e=>`${e.sessionId} at ${KC(e.atMs,_())}`).join(`; `)})()),B(p,(()=>{var t=I(()=>!!e.inputMarker);return()=>t()?O():`—`})()),n})()})),t})()]}})}Ye([`pointermove`,`keydown`]);function $k(e){let t=e.entryWidths.length;if(t===0)return{visibleCount:0,overflowCount:0};let n=Number.isFinite(e.availableWidth)?Math.max(0,e.availableWidth):0,r=0,i=0;for(let a=0;a<t;a+=1){let o=e.entryWidths[a]??0,s=r+(a===0?0:e.separatorWidth)+o;if(s+(t-(a+1)>0?e.separatorWidth+e.overflowWidth:0)>n)break;r=s,i=a+1}return{visibleCount:i,overflowCount:t-i}}var eA=L(`<span class=qg-page-head__models-sep aria-hidden=true> → `),tA=L(`<p class=qg-page-head__models><span class=qg-page-head__models-measure aria-hidden=true><span data-fit-separator> → </span><span data-fit-overflow>+`),nA=L(`<p class=qg-page-head__models>`),rA=L(`<span class=qg-page-head__models-entry>`),iA=L(`<ol class=qg-node__model-list>`),aA=L(`<li>`),oA=L(`<span data-fit-entry>`);function sA(e){let[t,n]=b(e.identities.length),r,i,a=!1,o=()=>{if(a)return;let t=e.identities.length;if(t<=1||r===void 0||i===void 0){n(t);return}let o=r.getBoundingClientRect().width;if(!(o>0))return;let s=Array.from(i.querySelectorAll(`[data-fit-entry]`),e=>e.getBoundingClientRect().width),c=i.querySelector(`[data-fit-separator]`)?.getBoundingClientRect().width??0,l=i.querySelector(`[data-fit-overflow]`)?.getBoundingClientRect().width??0;n($k({availableWidth:o,entryWidths:s,separatorWidth:c,overflowWidth:l}).visibleCount)};D(()=>{o();let e=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>o());e!==void 0&&r!==void 0&&e.observe(r),O(()=>{a=!0,e?.disconnect()}),typeof document<`u`&&document.fonts!==void 0&&document.fonts.ready.then(()=>o())}),S(E(()=>e.identities,()=>o(),{defer:!0}));let s=()=>e.identities.length-t();return j(F,{get when(){return e.identities.length>1},get fallback(){return j(F,{get when(){return e.identities[0]},children:e=>(()=>{var t=nA();return B(t,j(nk,{get identity(){return e()}})),t})()})},get children(){var n=tA(),a=n.firstChild,o=a.firstChild,c=o.nextSibling;c.firstChild;var l=r;typeof l==`function`?rt(l,n):r=n,B(n,j(P,{get each(){return e.identities.slice(0,t())},children:(e,t)=>[j(F,{get when(){return t()>0},get children(){return eA()}}),(()=>{var t=rA();return B(t,j(nk,{identity:e})),t})()]}),a),B(n,j(F,{get when(){return s()>0},get children(){return[j(F,{get when(){return t()>0},get children(){return eA()}}),j(US,{get label(){return`${s()} more model configurations. Show all ${e.identities.length}.`},panelLabel:`Model configurations used by this session, in first-use order`,triggerClass:`qg-node__more`,contentClass:`qg-temporal-popover`,placement:`bottom-start`,get content(){return(()=>{var t=iA();return B(t,j(P,{get each(){return e.identities},children:e=>(()=>{var t=aA();return B(t,j(nk,{identity:e})),t})()})),t})()},get children(){return[`+`,I(()=>s())]}})]}}),a);var u=i;return typeof u==`function`?rt(u,a):i=a,B(a,j(P,{get each(){return e.identities},children:e=>(()=>{var t=oA();return B(t,j(nk,{identity:e})),t})()}),o),B(c,()=>e.identities.length,null),n}})}function cA(e){let t=e.nodes.find(t=>t.sessionId===e.focusSessionId);return{...e,nodes:t===void 0?[]:[{...t,childIds:[]}],steps:e.steps.filter(t=>t.sessionId===e.focusSessionId),treeTotals:e.ownSummary}}var lA=L(`<span class=qg-node__model>`),uA=L(`<span class=qg-node__model-text>`),dA=L(`<ol class=qg-node__model-list>`),fA=L(`<li>`),pA=L(`<span class=qg-node__rate>`),mA=L(`<div class=qg-detail><nav class=qg-breadcrumbs aria-label=Breadcrumb><a>Analytics</a><span aria-hidden=true>›</span><a></a></nav><header class=qg-page-head><div class=qg-page-head__heading><h2 class=qg-page-title id=qg-session-head>`),hA=L(`<button type=button class=qg-input>Show <!> more nodes`),gA=L(`<section class=qg-section aria-labelledby=qg-session-nodes><header class=qg-section__head><h2 class=qg-section__title id=qg-session-nodes>Session tree</h2></header><div class=qg-nodes><div class=qg-nodes__head aria-hidden=true><span>Name</span><span>Agent</span><span>Model</span><span>Cache Rate</span><span>Tokens</span></div></div> `),_A=L(`<p class=qg-footnote>`),vA=L(`<span aria-hidden=true>›`),yA=L(`<a>`),bA=L(`<span aria-current=page>Individual view`),xA=L(`<span aria-current=page>`),SA=L(`<div class=qg-node><a class=qg-node__link><span class=qg-node__name></span></a><span class=qg-node__agent></span><span class="qg-list__tokens qg-node__tokens">`),CA=200;function wA(e){return(()=>{var t=lA();return B(t,j(F,{get when(){return e.models[0]},fallback:`—`,children:t=>[(()=>{var e=uA();return B(e,j(nk,{get identity(){return t()}})),e})(),j(F,{get when(){return e.models.length>1},get children(){return j(US,{get label(){return`${e.models.length-1} more model configurations. Show all ${e.models.length}.`},panelLabel:`Model configurations used by this session, most recently used first`,triggerClass:`qg-node__more`,contentClass:`qg-temporal-popover`,placement:`bottom-start`,get content(){return(()=>{var t=dA();return B(t,j(P,{get each(){return e.models},children:e=>(()=>{var t=fA();return B(t,j(nk,{identity:e})),t})()})),t})()},get children(){return[`+`,I(()=>e.models.length-1)]}})}})]})),t})()}function TA(e){let t=()=>(e.node.cacheUnknownSteps??0)>0,n=()=>t()?null:BE(e.node.ownTokens);return(()=>{var r=pA();return B(r,(()=>{var e=I(()=>n()===null);return()=>e()?`—`:UC(n())})()),x(()=>R(r,`title`,t()?`Unknown: cache counters were not recorded for ${e.node.cacheUnknownSteps} step(s)`:UC(n()))),r})()}var EA=4;function DA(e,t){if(e.detail===0||t===void 0||!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY)||Math.hypot(e.clientX-t.x,e.clientY-t.y)<=EA)return!1;let n=typeof window>`u`?null:window.getSelection();if(n===null||n.isCollapsed||n.toString()===``)return!1;let r=e.currentTarget.closest(`.qg-node`),i=n.anchorNode;return r!==null&&i!==null&&r.contains(i)}function OA(e){let[t,n]=b(CA),[r,i]=b(`activity`),a=C(()=>sE(e.snapshot.nodes,r())),o=()=>a().slice(0,t()),s=C(()=>e.snapshot.nodes.find(t=>t.sessionId===e.snapshot.focusSessionId)),c=()=>e.individual===!0&&s()?.parentId===void 0,l=()=>e.individual===!0||s()?.parentId!==void 0?`focus`:`main`,u=C(()=>l()===`main`?e.snapshot:cA(e.snapshot)),d=C(()=>{if(l()!==`focus`)return[];let e=[],t;for(let n of u().steps){if(!n.model)continue;let r=WC(n.model);r!==t&&(t=r,e.push(n.model))}return e}),f=t=>Q(t===e.snapshot.focusSessionId&&(l()===`main`||e.individual===!0)?{name:`session`,sessionId:t,individual:!0}:{name:`session`,sessionId:t},e.range),p=C(()=>{let t=s();return t===void 0||!(t.parentId&&e.snapshot.nodes.length===1)});return[(()=>{var t=mA(),n=t.firstChild,r=n.firstChild,i=r.nextSibling.nextSibling,a=n.nextSibling.firstChild,o=a.firstChild;return B(i,()=>e.snapshot.projectName),B(n,j(P,{get each(){return e.snapshot.breadcrumbs},children:t=>[vA(),j(F,{get when(){return!t.isFocus},get fallback(){return j(F,{get when(){return c()},get fallback(){return(()=>{var e=xA();return B(e,()=>t.title),e})()},get children(){return[(()=>{var n=yA();return B(n,()=>t.title),x(()=>R(n,`href`,Q({name:`session`,sessionId:t.sessionId},e.range))),n})(),vA(),bA()]}})},get children(){var n=yA();return B(n,()=>t.title),x(()=>R(n,`href`,Q({name:`session`,sessionId:t.sessionId},e.range))),n}})]}),null),B(o,()=>e.snapshot.breadcrumbs.find(e=>e.isFocus)?.title??e.snapshot.focusSessionId),B(a,j(F,{get when(){return d().length>0},get children(){return j(sA,{get identities(){return d()}})}}),null),B(t,j(Qk,{get snapshot(){return u()},get variant(){return l()},headingId:`qg-session-usage`}),null),x(t=>{var n=Q({name:`analytics`},e.range),a=Q({name:`project`,projectId:e.snapshot.projectId},e.range);return n!==t.e&&R(r,`href`,t.e=n),a!==t.t&&R(i,`href`,t.t=a),t},{e:void 0,t:void 0}),t})(),j(F,{get when(){return p()},get children(){var s=gA(),c=s.firstChild;c.firstChild;var l=c.nextSibling;l.firstChild;var u=l.nextSibling;return B(c,j(cE,{label:`session tree`,get value(){return r()},onChange:i}),null),B(l,j(P,{get each(){return o()},children:t=>{let n;return(()=>{var r=SA(),i=r.firstChild,a=i.firstChild,o=i.nextSibling,s=o.nextSibling;return r.$$pointerdown=e=>{n={x:e.clientX,y:e.clientY}},i.$$click=e=>{DA(e,n)&&e.preventDefault()},B(a,()=>t.title),B(o,(()=>{var e=I(()=>!!t.agent?.trim());return()=>e()?t.agent:`—`})()),B(r,j(wA,{get models(){return t.models}}),s),B(r,j(TA,{node:t}),s),B(s,()=>RC(t.ownTokens.total)),x(n=>{var o=t.sessionId===e.snapshot.focusSessionId?`true`:void 0,c=f(t.sessionId),l=t.sessionId===e.snapshot.focusSessionId?`page`:void 0,u=t.title,d=String(t.depth),p=$(t.ownTokens.total);return o!==n.e&&R(r,`data-focus`,n.e=o),c!==n.t&&R(i,`href`,n.t=c),l!==n.a&&R(i,`aria-current`,n.a=l),u!==n.o&&R(a,`title`,n.o=u),d!==n.i&&z(a,`--qg-node-depth`,n.i=d),p!==n.n&&R(s,`title`,n.n=p),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()}}),null),B(s,j(F,{get when(){return t()<a().length},get children(){var e=hA(),r=e.firstChild.nextSibling;return r.nextSibling,e.$$click=()=>n(e=>e+CA),B(e,()=>Math.min(CA,a().length-t()),r),e}}),u),s}}),(()=>{var t=_A();return B(t,()=>e.snapshot.stepSemantics),t})()]}Ye([`click`,`pointerdown`]);var kA=L(`<button type=button>`);function AA(e){let[t,n]=b(!1),[r,i]=b(!1);async function a(){if(!t()){n(!0),i(!1);try{await e.onToggle()}catch{i(!0)}finally{n(!1)}}}let o=()=>e.variant===void 0?``:` qg-eye--${e.variant}`;return(()=>{var n=kA();return n.$$click=()=>{a()},B(n,j(Pn,{get name(){return e.pressed?`outline-eye-slash`:`outline-eye`}})),x(i=>{var a=`qg-eye${o()}`,s=e.pressed?`true`:`false`,c=e.label,l=r()?`${e.title} — the change was not saved`:e.title,u=e.disabled||t();return a!==i.e&&Qe(n,i.e=a),s!==i.t&&R(n,`aria-pressed`,i.t=s),c!==i.a&&R(n,`aria-label`,i.a=c),l!==i.o&&R(n,`title`,i.o=l),u!==i.i&&(n.disabled=i.i=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}Ye([`click`]);var jA=[`Claude Agent`,`Copilot`,`OpenAI`,`Synthetic`,`Chutes`,`Z.ai`,`Zhipu`,`NanoGPT`,`MiniMax Token Plan`,`MiniMax Token Plan (CN)`,`xAI`,`OpenCode Go`,`OpenCode Zen`,`Ollama Cloud`],MA=[`percentDisplayMode`,`percentLabelStyle`,`enabledProviders`,`minIntervalMs`,`requestTimeoutMs`,`accountingDetail`,`waitForQuotaReset`];function NA(e){return MA.some(t=>t===e)}var PA=[{id:`wait`,title:`Wait for quota reset`},{id:`display`,title:`Display`},{id:`temporal`,title:`Temporal pricing`,note:`Live peak and off-peak status. Discovered accounts start on; each switch keeps an explicit on or off choice.`},{id:`advanced`,title:`Advanced`,note:`Provider selection, polling intervals, and accounting detail.`},{id:`visibility`,title:`Visibility`,note:`Choose which cards and rows appear, and drag the grips to arrange your cards.`},{id:`dashboard`,title:`Dashboard`}];function FA(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}var IA=[`rolling`,`weekly`,`monthly`],LA=[`nativeQuotaNotifications`];function RA(e){return e.map(e=>({...e,importable:NA(e.key)}))}var zA=RA([{key:`nativeQuotaNotifications`,hidden:!0,group:`advanced`,control:`native-policy`,label:`Quota alerts`},{key:`waitForQuotaReset`,group:`wait`,control:`switch`,label:`Wait for quota reset`,help:`Hold requests until the quota window resets instead of failing them.`},{key:`autoResumeOnQuotaRecovery`,group:`wait`,control:`switch`,label:`Auto-resume on quota recovery`,help:`When a quota-limited session stops, waits for the same account's window to reset, then after 2 minutes sends one continue. Supported: ${jA.join(`, `)}.`},{key:`percentDisplayMode`,group:`display`,control:`select`,label:`Percent shows`,options:[{value:`remaining`,label:`Remaining`},{value:`used`,label:`Used`}]},{key:`percentLabelStyle`,group:`display`,control:`select`,label:`Label style`,help:`Full includes used or remaining beside the percentage; bare shows only the number.`,options:[{value:`full`,label:`Full`},{value:`bare`,label:`Bare`}]},{key:`quotaProjection`,hidden:!0,group:`display`,control:`switch`,label:`Runway projection`,help:`Show a runway sentence on quota rows when the plugin can project exhaustion.`,clearable:!0,onValue:`runway`},{key:`resetTimeDecimals`,hidden:!0,group:`display`,control:`integer`,label:`Countdown decimals`,help:`0–4 decimal places on reset countdowns; clear to use the default.`,min:0,max:4,clearable:!0},{key:`resetTimeSpaced`,hidden:!0,group:`display`,control:`switch`,label:`Space countdown units`},{key:`formatStyle`,hidden:!0,group:`display`,control:`select`,label:`Quota row style`,help:`Affects toasts, TUI sidebar, and compact status only — not this page.`,options:[{value:`singleWindow`,label:`Single window`},{value:`allWindows`,label:`All windows`}]},{key:`enabledProviders`,group:`advanced`,control:`providers`,label:`Providers`,help:`Automatic selection, or an explicit list. An empty list enables no provider.`},{key:`minIntervalMs`,group:`advanced`,control:`number`,label:`Minimum refresh interval (ms)`,help:`Any finite value above zero; there is no extra dashboard floor.`},{key:`claudeAgentPollIntervalMs`,group:`advanced`,control:`number`,label:`Claude Agent polling interval (ms)`,help:`Minimum spacing between Claude usage requests; at least 60000.`,min:6e4},{key:`requestTimeoutMs`,group:`advanced`,control:`number`,label:`Request timeout (ms)`,help:`Any finite value above zero.`},{key:`accountingDetail`,group:`advanced`,control:`select`,label:`Accounting detail`,options:[{value:`summary`,label:`Summary`},{value:`detailed`,label:`Detailed`}]},{key:`lowQuotaThresholdRemainingPercent`,hidden:!0,group:`advanced`,control:`integer`,label:`Low quota threshold`,help:`Percent of quota remaining at or below which a low-quota alert is sent.`,min:1,max:100},{key:`duplicateCooldownMinutes`,hidden:!0,group:`advanced`,control:`integer`,label:`Duplicate alert cooldown`,help:`Minutes before the same quota alert can repeat. 0 allows immediate repeats.`,min:0},{key:`opencodeGoWindows`,hidden:!0,group:`advanced`,control:`windows`,label:`Go windows`,help:`At least one of rolling, weekly, or monthly.`},{key:`opencodeMonthlyLimit`,hidden:!0,group:`advanced`,control:`number`,label:`Monthly limit`,help:`A number of at least zero, or clear the key to leave it unset.`,min:0,clearable:!0},{key:`dashboard.hiddenCards`,group:`visibility`,control:`list`,label:`Hidden cards`},{key:`dashboard.hiddenRows`,group:`visibility`,control:`list`,label:`Hidden rows`},{key:`dashboard.cardOrder`,group:`visibility`,control:`list`,label:`Card order`,hidden:!0},{key:`dashboard.rowOrder`,group:`visibility`,control:`row-order`,label:`Row order`,hidden:!0},{key:`dashboard.providerOrder`,group:`visibility`,control:`list`,label:`Provider order`,hidden:!0},{key:`dashboard.temporalProviderOverrides`,group:`temporal`,control:`map`,label:`Temporal provider overrides`,hidden:!0},{key:`dashboard.enabled`,group:`dashboard`,control:`switch`,label:`Web dashboard`,help:`Serve the browser dashboard on 127.0.0.1 at dashboard.port. When unset, it follows the OpenCode host version: on below 2.2.1 (including 2.2.0) and off at 2.2.1 or newer. Changing it requires an OpenCode restart.`,hidden:!0},{key:`dashboard.port`,group:`dashboard`,control:`readonly`,label:`Port`,help:`Changing the port needs a restart, so it is read-only here.`,min:1,max:65535}]);function BA(e,t){switch(e.provenance?.[t]?.scope){case`workspace`:return`Workspace override`;case`project`:return`Project override`;case`legacy`:return`Legacy override`;default:return}}function VA(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e.low,n=t&&typeof t==`object`&&!Array.isArray(t)?t.thresholdRemainingPercent:void 0,r=e.duplicateCooldownMinutes;return{...typeof n==`number`&&Number.isInteger(n)&&n>=1&&n<=100?{}:{threshold:`Low quota threshold must be a whole number from 1 to 100% remaining.`},...typeof r==`number`&&Number.isInteger(r)&&r>=0?{}:{cooldown:`Duplicate alert cooldown must be a whole number of minutes, 0 or greater.`}}}function HA(e,t){if(t==null)return e.control===`list`||e.control===`map`||e.clearable?void 0:`${e.label} needs a value.`;switch(e.control){case`native-policy`:{if(typeof t!=`object`||Array.isArray(t))return`Quota alerts need a valid policy.`;let e=t.reset,n=VA(t);return n.threshold?n.threshold:!e||typeof e!=`object`||Array.isArray(e)||!Array.isArray(e.windows)?`Choose valid reset windows.`:n.cooldown}case`switch`:return typeof t==`boolean`?void 0:e.clearable&&e.onValue!==void 0?t===e.onValue?void 0:`${e.label} takes ${e.onValue} or an empty value.`:`${e.label} takes true or false.`;case`select`:return typeof t==`string`&&e.options?.some(e=>e.value===t)?void 0:`Pick one of the listed ${e.label.toLowerCase()} values.`;case`number`:return typeof t!=`number`||!Number.isFinite(t)?`${e.label} takes a number.`:e.min===void 0?FA(t)?void 0:`${e.label} must be greater than zero.`:t<e.min?`${e.label} must be at least ${e.min}.`:void 0;case`integer`:return typeof t!=`number`||!Number.isInteger(t)?`${e.label} takes a whole number.`:e.min!==void 0&&t<e.min?`${e.label} must be at least ${e.min}.`:e.max!==void 0&&t>e.max?`${e.label} must be at most ${e.max}.`:void 0;case`providers`:return t===`auto`?void 0:!Array.isArray(t)||t.some(e=>typeof e!=`string`||e.trim()===``)?`Provider ids must be a list of non-empty strings, or automatic.`:void 0;case`windows`:return!Array.isArray(t)||t.length===0?`Choose at least one window.`:t.every(e=>typeof e==`string`&&IA.includes(e))?void 0:`Windows are limited to rolling, weekly, and monthly.`;case`list`:return Array.isArray(t)&&t.every(e=>typeof e==`string`)?void 0:`${e.label} takes a list of ids.`;case`row-order`:return gv(t)&&Object.entries(t).every(([e,t])=>e.length>0&&Array.isArray(t)&&t.every(e=>_v(e)&&e.length>0))?void 0:`${e.label} takes card ids mapped to row-id lists.`;case`map`:return gv(t)&&Object.values(t).every(e=>e===!0||e===!1)?void 0:`${e.label} takes provider ids mapped to true or false.`;default:return}}function UA(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify(e)===JSON.stringify(t)}function WA(e){let t=e.trim();if(t===``)return;let n=Number(t);return Number.isFinite(n)?n:NaN}function GA(e){let t=WA(e);if(t!==void 0)return typeof t==`number`&&Number.isInteger(t)?t:NaN}function KA(e){return e===`auto`?{mode:`auto`,ids:[]}:Array.isArray(e)?{mode:`manual`,ids:e.filter(e=>typeof e==`string`)}:{mode:`auto`,ids:[]}}function qA(e){return e.split(/[,\s]+/).map(e=>e.trim()).filter(e=>e.length>0)}function JA(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&IA.includes(e)):[]}function YA(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function XA(e){if(!gv(e))return{};let t=[];for(let[n,r]of Object.entries(e))(r===!0||r===!1)&&t.push([n,r]);return Object.fromEntries(t)}function ZA(e){return[e.providerLabel,e.planLabel,e.accountLabel?nj(e.providerLabel,e.accountLabel):void 0].filter(Boolean).join(` · `)}function QA(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function $A(e,t){let n=t.filter(t=>t.providerId===e.providerId),r=new Set([e.providerId]);for(let t of[e.providerScopeHash,...n.map(e=>e.providerScopeHash)])t!==void 0&&r.add(t);return{sameProvider:n,markers:r}}function ej(e,t,n){let{markers:r}=$A(e,n);return[...r].some(e=>t.has(e))}function tj(e,t,n){let{sameProvider:r,markers:i}=$A(t,n),a=e.some(e=>e!==t.cardId&&i.has(e)),o=e.filter(e=>e!==t.cardId&&(!a||!i.has(e)));if(!a)return o;let s=new Set(o);for(let e of r)e.cardId===t.cardId||s.has(e.cardId)||(s.add(e.cardId),o.push(e.cardId));return o}function nj(e,t){let n=`[${e}] (`;if(t.startsWith(n)&&t.endsWith(`)`)){let e=t.slice(n.length,-1);if(e.length>0&&!/[()[\]\r\n]/.test(e))return e}return t}function rj(e,t,n){if(!e.includes(t))return[...e];let r=e.filter(e=>e!==t);return r.splice(Math.max(0,Math.min(Math.trunc(n),r.length)),0,t),r}function ij(e,t,n){return rj(e,t,Math.max(0,Math.min(e.indexOf(t)+n,e.length-1)))}function aj(e){if(!gv(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(n.length===0||!Array.isArray(r))continue;let e=[];for(let t of r)_v(t)&&t.length>0&&e.push(t);e.length>0&&(t[n]=[...new Set(e)])}return t}function oj(e){let t=e.percentDisplayMode===`used`?`used`:`remaining`,n=YA(e[`dashboard.cardOrder`]),r=YA(e[`dashboard.providerOrder`]),i=aj(e[`dashboard.rowOrder`]),a=XA(e[`dashboard.temporalProviderOverrides`]),o={percentMode:t,percentLabelStyle:e.percentLabelStyle===`bare`?`bare`:`full`,showRunway:e.quotaProjection===`runway`,detailed:e.accountingDetail===`detailed`};return n.length>0&&(o.cardOrder=n),r.length>0&&(o.providerOrder=r),Object.keys(i).length>0&&(o.rowOrder=i),Object.keys(a).length>0&&(o.temporalProviderOverrides=a),o}function sj(e){return{edits:{},revision:e,conflict:!1}}function cj(e,t,n){return Object.keys(e.edits).filter(e=>n.includes(e)).filter(n=>!UA(e.edits[n],t[n])).sort()}function lj(e,t){return t.flatMap(t=>{if(!(t.key in e.edits))return[];let n=HA(t,e.edits[t.key]);return n===void 0?[]:[{key:t.key,message:n}]})}function uj(e,t){let n={};for(let r of t){let t=e.edits[r];n[r]=t===void 0?null:t}return n}function dj(e){return{edits:{},revision:e.revision,conflict:!1}}function fj(e,t){return{edits:e.edits,revision:t,conflict:!0}}function pj(e){let t=e.requestFrame??(e=>requestAnimationFrame(e)),n=e.cancelFrame??(e=>cancelAnimationFrame(e)),r=e.reducedMotion??(()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches),i,a,o=new Map;function s(t,n,i){if(!r())for(let r of n){if(r===i)continue;let n=e.nodes(r),a=t.get(r);if(!n||a===void 0)continue;let s=a-n.slot.getBoundingClientRect().top;if(Math.abs(s)<1)continue;o.get(n.card)?.cancel();let c=n.card.animate?.([{transform:`translateY(${s}px)`},{transform:`translateY(0)`}],{duration:150,easing:`cubic-bezier(0.2, 0, 0, 1)`});c&&o.set(n.card,c)}}function c(t){return new Map(t.flatMap(t=>{let n=e.nodes(t);return n?[[t,n.card.getBoundingClientRect().top]]:[]}))}function l(e){let t=e.nodes.card,n=t.getBoundingClientRect(),r=t.offsetWidth,i=t.offsetHeight,a=r>0&&n.width>0?n.width/r:1,o=i>0&&n.height>0?n.height/i:1,s=(e.x-e.offsetX-n.left)/a,c=(e.y-e.offsetY-n.top)/o;Math.abs(s)<.01&&Math.abs(c)<.01||(e.translateX+=s,e.translateY+=c,t.style.setProperty(`transform`,`translate3d(${e.translateX}px, ${e.translateY}px, 0)`))}function u(t){for(let e of[`position`,`top`,`left`,`width`,`z-index`,`transform`,`pointer-events`])t.nodes.card.style.removeProperty(e);e.active(void 0),t.container.hasPointerCapture?.(t.pointerId)&&t.container.releasePointerCapture(t.pointerId),queueMicrotask(()=>{t.nodes.grip.isConnected!==!1&&t.nodes.grip.focus?.({preventScroll:!0})}),typeof window<`u`&&(window.removeEventListener(`blur`,f),window.removeEventListener(`resize`,f),window.removeEventListener(`keydown`,p),window.removeEventListener(`scroll`,m,!0))}function d(t){let r=i;if(!r)return;i=void 0,a!==void 0&&n(a),a=void 0;let o=c(r.order);t&&r.lifted&&r.order.some((e,t)=>e!==r.original[t])&&e.commit([...r.order],r.id),e.preview(void 0),u(r),s(o,e.ids())}function f(){d(!1)}function p(e){e.key===`Escape`&&(e.preventDefault(),f())}function m(){i?.lifted&&h()}function h(){a===void 0&&(a=t(g))}function g(){a=void 0;let t=i;if(!t)return;if(!e.enabled()||e.ids().join(`\0`)!==t.original.join(`\0`)){f();return}let n=t.x-t.startX,r=t.y-t.startY;if(!t.lifted&&Math.hypot(n,r)<4)return;if(!t.lifted){t.lifted=!0,o.get(t.nodes.card)?.cancel(),o.delete(t.nodes.card);let n=t.nodes.card.style;n.setProperty(`position`,`relative`),n.setProperty(`z-index`,`20`),n.setProperty(`pointer-events`,`none`),e.active(t.id)}let u=t.container.closest(`.qg-settings__scroll`),d=!1;if(u){let e=u.getBoundingClientRect(),n=t.y<e.top+40?-5:t.y>e.bottom-40?5:0,r=u.scrollTop;n&&(u.scrollTop+=n),d=u.scrollTop!==r}l(t);let p=t.y-t.offsetY+t.height/2,m=t.order.filter(e=>e!==t.id).filter(t=>{let n=e.nodes(t)?.slot.getBoundingClientRect();return n!==void 0&&p>n.top+n.height/2}).length,g=rj(t.order,t.id,m);if(g.some((e,n)=>e!==t.order[n])){let n=c(t.order);t.order=g,e.preview([...g]),s(n,g,t.id),l(t)}d&&h()}return{down(t,n){if(i||!e.enabled()||n.button!==0||n.isPrimary===!1)return;let r=e.nodes(t),a=e.container();if(!r||!a||!e.ids().includes(t))return;let o=[...e.ids()],s=r.card.getBoundingClientRect();i={id:t,nodes:r,container:a,pointerId:n.pointerId,original:o,order:[...o],offsetX:n.clientX-s.left,offsetY:n.clientY-s.top,height:s.height,startX:n.clientX,startY:n.clientY,x:n.clientX,y:n.clientY,lifted:!1,translateX:0,translateY:0},a.setPointerCapture(n.pointerId),r.grip.focus?.({preventScroll:!0}),n.preventDefault(),typeof window<`u`&&(window.addEventListener(`blur`,f),window.addEventListener(`resize`,f),window.addEventListener(`keydown`,p),window.addEventListener(`scroll`,m,!0))},move(e){i&&e.pointerId===i.pointerId&&(i.x=e.clientX,i.y=e.clientY,e.preventDefault(),h())},up(e){i&&e.pointerId===i.pointerId&&(i.x=e.clientX,i.y=e.clientY,a!==void 0&&n(a),a=void 0,g(),d(!0))},lost(e){e.pointerId===i?.pointerId&&f()},cancel:f,dispose(){f();for(let e of o.values())e.cancel();o.clear()}}}var mj=L(`<div class=qg-temporal-settings>`),hj=L(`<output class=qg-inherited aria-live=polite>`),gj=L(`<p class=qg-inherited>No temporal pricing providers are available.`),_j=L(`<span class=qg-field__meta><span class=qg-inherited>No account discovered.`),vj=L(`<div class="qg-field qg-temporal-settings__row"><div class=qg-field__text><span class="qg-field__label qg-temporal-settings__identity"><span></span></span></div><div class=qg-field__control><span class=qg-inherited aria-hidden=true>`),yj=L(`<fieldset class=qg-vis-list aria-label="Card visibility">`),bj=L(`<p class=qg-inherited>No provider accounts are available to configure yet.`),xj=L(`<div class=qg-vis-slot><article class=qg-vis-provider><header class=qg-vis-provider__head><button type=button class=qg-vis-grip title="Drag to reorder; Alt plus arrow keys move it too"></button><div class=qg-vis-provider__identity><span class=qg-vis-provider__name>`),Sj=L(`<span class=qg-vis-provider__account>· `),Cj=L(`<div class=qg-vis-row-slot><div class=qg-vis-row><button type=button class="qg-vis-grip qg-vis-row__grip"title="Drag to reorder; Alt plus arrow keys move it too"></button><span class=qg-vis-row__label><span class=qg-row__labelgroup><span>`),wj=L(`<span class=sr-only>More information about `),Tj=L(`<span class=qg-row__info aria-hidden=true>`),Ej=L(`<span class=qg-inherited aria-hidden=true>`),Dj=L(`<select class=qg-input>`),Oj=L(`<option>`),kj=L(`<span class=qg-inherited>An empty list enables no provider.`),Aj=L(`<label class=qg-checkbox-option><input type=checkbox><span>`),jj=L(`<span class=qg-inherited>`),Mj=L(`<span class=qg-field__meta>`),Nj=L(`<div class=qg-field><div class=qg-field__text><span class=qg-field__label></span></div><div class=qg-field__control><span class=qg-inherited aria-hidden=true>`),Pj=L(`<section class=qg-group aria-labelledby=qg-settings-alerts><h2 class=qg-group__title id=qg-settings-alerts>Quota alerts</h2><p class=qg-group__note>Choose which desktop alerts to receive and how often they can repeat.</p><div class=qg-field><div class=qg-field__text><span class=qg-field__label>Low quota threshold</span><span class=qg-field__meta>Alert when remaining quota falls to this percentage.</span></div><div class=qg-field__control><span class=qg-inherited>% remaining</span></div></div><div class=qg-field><div class=qg-field__text><span class=qg-field__label>Reset windows</span><span class=qg-field__meta>Choose which quota windows can send reset alerts.</span></div><div class=qg-field__control></div></div><div class=qg-field><div class=qg-field__text><span class=qg-field__label>Duplicate alert cooldown</span><span class=qg-field__meta>Minutes before the same alert can repeat. 0 allows immediate repeats.</span></div><div class=qg-field__control><span class=qg-inherited>minutes`),Fj=L(`<span class=qg-field__error id=qg-alert-threshold-error>`),Ij=L(`<span class=qg-field__error id=qg-alert-cooldown-error>`),Lj=L(`<ul class=qg-note-list>`),Rj=L(`<section class=qg-group aria-labelledby=qg-settings-import><h2 class=qg-group__title id=qg-settings-import>Legacy OpenCode Quota settings detected</h2><p class=qg-group__note>Preview eligible settings before copying them into global defaults. Source files remain untouched.</p><div class=qg-field__control>`),zj=L(`<div class=qg-field><div class=qg-field__text><span class=qg-field__label>Reported issues</span></div><div class=qg-field__control><ul class=qg-note-list>`),Bj=L(`<span> unsaved change(s)`),Vj=L(`<span> · settings changed elsewhere — your edits are kept`),Hj=L(`<div class=qg-settings><div class="qg-form qg-settings__scroll"><header class=qg-section__head><h1 class=qg-page-title>Settings</h1><span class=qg-section__meta>Display, visibility and preferences</span></header><p class=qg-group__note>Changes on this page are saved to the global GUI config file. Legacy settings are import-only; workspace settings are never live overrides. Meaningful legacy sources are noted in the import section.</p><section class=qg-group aria-labelledby=qg-settings-dashboard><h2 class=qg-group__title id=qg-settings-dashboard>Dashboard</h2><div class=qg-field><div class=qg-field__text><span class=qg-field__label>Address</span><span class=qg-field__meta><span>Bound to loopback only; the dashboard is not reachable from other machines.</span></span></div><div class=qg-field__control></div></div><div class=qg-field><div class=qg-field__text><span class=qg-field__label>Settings file</span><span class=qg-field__meta id=qg-settings-file-help>Open in the default application. Unsaved changes are not included.</span></div><div class=qg-field__control><span class=qg-badge>revision </span></div></div></section></div><div class=qg-savebar><span class=qg-savebar__status aria-live=polite></span><div class=qg-field__control>`),Uj=L(`<li>: `),Wj=L(`<span class=qg-inherited>from `),Gj=L(`<p class=qg-field__error>`),Kj=L(`<li> → `),qj=L(`<section class=qg-group><h2 class=qg-group__title>`),Jj=L(`<p class=qg-group__note>`),Yj=L(`<div class=qg-field><div class=qg-field__text><span class=qg-field__label></span><span class=qg-field__meta></span></div><div class=qg-field__control>`),Xj=L(`<span>`),Zj=L(`<span class=qg-field__error>`),Qj=L(`<p class=qg-field__error role=alert>`),$j=L(`<li>: <!> (<!>)`),eM=L(`<span>No unsaved changes.`);function tM(e){let[t,n]=b(sj(e.snapshot.revision)),[r,i]=b(!1),[a,o]=b(),[s,c]=b(),[l,u]=b(void 0),[d,f]=b(void 0),[p,m]=b(!1),[h,g]=b(),[_,v]=b(KA(e.snapshot.values.enabledProviders).ids.join(`, `));S(E(()=>e.snapshot.revision,t=>{n(n=>n.revision===t?n:cj(n,e.snapshot.values,e.snapshot.writable).length===0?sj(t):fj(n,t))})),S(()=>{`nativeQuotaNotifications`in t().edits||(o(void 0),c(void 0))}),S(E(()=>e.snapshot.values.enabledProviders,e=>{`enabledProviders`in t().edits||v(KA(e).ids.join(`, `))}));let y=C(()=>zA.filter(t=>!t.hidden&&t.control!==`readonly`&&e.snapshot.writable.includes(t.key))),w=()=>zA.find(e=>e.key===`dashboard.enabled`),T=C(()=>e.nativeQuotaAlerts?zA.filter(t=>LA.includes(t.key)&&e.snapshot.writable.includes(t.key)):[]),D=C(()=>cj(t(),e.snapshot.values,e.snapshot.writable)),k=C(()=>lj(t(),[...y(),...T()])),ee=e=>k().find(t=>t.key===e)?.message,te=n=>n.key in t().edits?t().edits[n.key]:e.snapshot.values[n.key],ne=t=>BA(e.snapshot,t);function re(e,t){n(n=>({...n,edits:{...n.edits,[e]:t}}))}function ie(){n(sj(e.snapshot.revision)),v(KA(e.snapshot.values.enabledProviders).ids.join(`, `))}async function A(){let r=uj(t(),D());if(Object.keys(r).length!==0){i(!0);try{let i=await e.client.saveSettings({patch:r,expectedRevision:t().revision});n(dj(i)),e.toaster.push(`success`,`Global settings saved.`),await e.onReload()}catch(t){gb(t)?(e.toaster.push(`error`,`Settings changed elsewhere. Your edits were kept — review them against the latest file.`),await e.onReload(),n(t=>cj(t,e.snapshot.values,e.snapshot.writable).length===0?t:fj(t,e.snapshot.revision))):e.toaster.push(`error`,lb(t))}finally{i(!1)}}}async function ae(){if(!p()){if(g(void 0),!e.client.openSettingsFile)g(`Opening the settings file is not available with this server.`);else{m(!0);try{await e.client.openSettingsFile()}catch(e){g(lb(e))}finally{m(!1)}}}}async function oe(){i(!0),f(void 0);try{u(await e.client.importPreview())}catch(e){f(lb(e))}finally{i(!1)}}async function se(){let t=l();if(t){i(!0);try{let r=await e.client.importApply({expectedRevision:t.expectedRevision});u(void 0),n(dj(r)),e.toaster.push(`success`,`Copied to the global settings file.`),await e.onReload()}catch(t){e.toaster.push(`error`,gb(t)?`The settings file changed since the preview. Preview the import again.`:lb(t))}finally{i(!1)}}}let[ce,le]=b(),[ue,de]=b(),[fe,pe]=b(``),me,he=new Map,ge=n=>n in t().edits?t().edits[n]:e.snapshot.values[n],_e=()=>YA(ge(`dashboard.hiddenCards`)),ve=C(()=>new Set(_e())),ye=()=>YA(ge(`dashboard.hiddenRows`)),be=()=>e.snapshot.writable.includes(`dashboard.cardOrder`),xe=()=>e.snapshot.writable.includes(`dashboard.hiddenCards`),Se=()=>e.snapshot.writable.includes(`dashboard.hiddenRows`),Ce=()=>XA(ge(`dashboard.temporalProviderOverrides`)),we=()=>e.snapshot.writable.includes(`dashboard.temporalProviderOverrides`);function Te(e,t){we()&&!r()&&re(`dashboard.temporalProviderOverrides`,{...Ce(),[e]:!t})}let Ee=C(()=>Xw(e.catalog.cards,YA(ge(`dashboard.cardOrder`)),YA(ge(`dashboard.providerOrder`)))),De=C(()=>ue()?Xw(Ee(),ue()):Ee());function Oe(t){return ej(t,ve(),e.catalog.cards)}function ke(t){if(!xe()||r())return;let n=_e();re(`dashboard.hiddenCards`,Oe(t)||n.includes(t.cardId)?tj(n,t,e.catalog.cards):QA(n,t.cardId))}function Ae(e,t){if(!Se()||r())return;let n=Ov(e.cardId,ye(),e.rows.flatMap(e=>[e.id,...e.aliases??[]])),i=t.aliases??[],a=new Set(n),o=a.has(t.id)||i.some(e=>a.has(e)),s=n.filter(e=>e!==t.id&&!i.includes(e));re(`dashboard.hiddenRows`,o?s:[...s,t.id])}function je(t,n){let r=Ee().map(e=>e.cardId);if(JSON.stringify(t)===JSON.stringify(r))return;let i=YA(ge(`dashboard.cardOrder`)).filter(e=>!r.includes(e));re(`dashboard.cardOrder`,[...t,...new Set(i)]);let a=e.catalog.cards.find(e=>e.cardId===n);a&&pe(`${ZA(a)} moved to position ${t.indexOf(n)+1} of ${t.length}.`)}let Me=pj({ids:()=>Ee().map(e=>e.cardId),container:()=>me,nodes:e=>{let t=he.get(e);return t?.slot&&t.card&&t.grip?{slot:t.slot,card:t.card,grip:t.grip}:void 0},enabled:()=>be()&&!r()&&Ne()===void 0,preview:de,active:le,commit:je});O(()=>Me.dispose()),S(()=>{Ee(),r(),Me.cancel()});function M(e,t,n){let r=he.get(e)??{};r[t]=n,he.set(e,r)}function N(e,t){e.key===`Escape`?Me.cancel():!be()||r()||ce()||Ne()||e.altKey===!0&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault?.(),je(ij(Ee().map(e=>e.cardId),t.cardId,e.key===`ArrowUp`?-1:1),t.cardId),queueMicrotask(()=>he.get(t.cardId)?.grip?.focus({preventScroll:!0})))}let[Ne,Pe]=b(),[Fe,Ie]=b(),[Le,Re]=b(``),ze=new Map,Be,Ve=()=>e.snapshot.writable.includes(`dashboard.rowOrder`),He=()=>aj(ge(`dashboard.rowOrder`)),Ue=e=>e.rows.map(e=>({rowId:e.id,aliases:e.aliases}));function We(e){return Qw(e.rows,He()[e.cardId],e=>e.id,Ue(e))}function Ge(e){let t=Fe();return Qw(e.rows,t?.cardId===e.cardId?t.ids:He()[e.cardId],e=>e.id,Ue(e))}function Ke(e,t,n){let r=We(t).map(e=>e.id);if(JSON.stringify(e)===JSON.stringify(r))return;re(`dashboard.rowOrder`,{...He(),[t.cardId]:[...e]});let i=t.rows.find(e=>e.id===n);Re(`${i?.label??`Row`} moved to position ${e.indexOf(n)+1} of ${e.length}.`)}let qe=pj({ids:()=>{let t=e.catalog.cards.find(e=>e.cardId===Be);return t?We(t).map(e=>e.id):[]},nodes:e=>{let t=ze.get(e);return t?.slot&&t.card&&t.grip?{slot:t.slot,card:t.card,grip:t.grip}:void 0},container:()=>me,enabled:()=>Ve()&&!r()&&ce()===void 0,preview:e=>Ie(e&&Be?{cardId:Be,ids:e}:void 0),active:e=>{Pe(e),e===void 0&&(Be=void 0)},commit:(t,n)=>{let r=e.catalog.cards.find(e=>e.cardId===Be);r&&Ke(t,r,n)}});O(()=>qe.dispose()),S(()=>{De(),r(),qe.cancel()});function Je(e,t,n){let r=ze.get(e)??{};r[t]=n,ze.set(e,r)}function L(e,t,n){e.key===`Escape`?qe.cancel():!Ve()||r()||Ne()||ce()||e.altKey===!0&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault?.(),Ke(ij(We(t).map(e=>e.id),n.id,e.key===`ArrowUp`?-1:1),t,n.id),queueMicrotask(()=>ze.get(n.id)?.grip?.focus({preventScroll:!0})))}function Ye(){let t=()=>e.temporal?.providers??[],n=()=>Ce(),i=e=>{let t=n()[e.providerId];return typeof t==`boolean`?t:e.discovered},a=()=>t().filter(e=>Object.hasOwn(n(),e.providerId)).length;return[j(F,{get when(){return t().length>0},get fallback(){return gj()},get children(){var e=mj();return B(e,j(P,{get each(){return t()},children:e=>{let t=()=>i(e),n=hC(e);return(()=>{var i=vj(),a=i.firstChild,o=a.firstChild,s=o.firstChild,c=a.nextSibling,l=c.firstChild;return B(o,j(GS,{get providerId(){return e.providerId},class:`qg-temporal-settings__logo`}),s),B(s,n),B(o,j(AC,{status:e}),null),B(a,j(F,{get when(){return!e.discovered},get children(){return _j()}}),null),B(c,j(am,{appearance:`compact`,hideLabel:!0,get checked(){return t()},get disabled(){return!we()||r()},onChange:()=>Te(e.providerId,t()),get children(){return[`Show peak and off-peak pricing for `,n,` on Quota`]}}),l),B(l,()=>t()?`On`:`Off`),i})()}})),e}}),j(F,{get when(){return t().length>0},get children(){var e=hj();return B(e,(()=>{var e=I(()=>a()>0);return()=>e()?`${a()} manual ${a()===1?`choice`:`choices`}; the rest follow discovered accounts.`:`Defaults follow discovered accounts.`})()),e}})]}function Xe(){return[(()=>{var e=yj();e.$$keydown=e=>{e.key===`Escape`&&(Me.cancel(),qe.cancel())},e.addEventListener(`lostpointercapture`,e=>{Me.lost(e),qe.lost(e)}),e.addEventListener(`pointercancel`,e=>{Me.lost(e),qe.lost(e)}),e.$$pointerup=e=>{Me.up(e),qe.up(e)},e.$$pointermove=e=>{Me.move(e),qe.move(e)};var t=me;return typeof t==`function`?rt(t,e):me=e,B(e,j(F,{get when(){return De().length>0},get fallback(){return bj()},get children(){return j(P,{get each(){return De()},children:e=>{let t=()=>Oe(e),n=()=>t()||_e().includes(e.cardId),i=()=>ce()===e.cardId;return(()=>{var t=xj(),a=t.firstChild,o=a.firstChild,s=o.firstChild,c=s.nextSibling,l=c.firstChild;return rt(t=>M(e.cardId,`slot`,t),t),rt(t=>M(e.cardId,`card`,t),a),s.$$keydown=t=>N(t,e),s.$$pointerdown=t=>Me.down(e.cardId,t),rt(t=>M(e.cardId,`grip`,t),s),B(s,j(cx,{})),B(l,()=>e.providerLabel),B(c,j(F,{get when(){return e.planLabel},children:e=>(()=>{var t=Sj();return t.firstChild,B(t,e,null),t})()}),null),B(c,j(F,{get when(){return e.accountLabel},children:t=>(()=>{var n=Sj();return n.firstChild,B(n,()=>nj(e.providerLabel,t()),null),n})()}),null),B(o,j(AA,{variant:`provider`,get disabled(){return!xe()||r()||ce()!==void 0||Ne()!==void 0},get pressed(){return n()},get label(){return`${n()?`Show`:`Hide`} ${ZA(e)}`},get title(){return n()?`Show card`:`Hide card`},onToggle:async()=>ke(e)}),null),B(a,j(P,{get each(){return Ge(e)},children:t=>{let n=()=>Dv(e.rows.flatMap(e=>[e.id,...e.aliases??[]]),ye(),Ue(e)).has(t.id),i=()=>Ne()===t.id;return(()=>{var a=Cj(),o=a.firstChild,s=o.firstChild,c=s.nextSibling.firstChild,l=c.firstChild;return rt(e=>Je(t.id,`slot`,e),a),rt(e=>Je(t.id,`card`,e),o),s.$$keydown=n=>L(n,e,t),s.$$pointerdown=n=>{Be=e.cardId,qe.down(t.id,n)},rt(e=>Je(t.id,`grip`,e),s),B(s,j(cx,{})),B(l,()=>t.label),B(c,j(F,{get when(){return t.info},children:e=>j(q_,{get value(){return e()},triggerTabIndex:0,appearance:`large`,contentClass:`qg-row__tooltip`,get children(){return[(()=>{var e=wj();return e.firstChild,B(e,()=>t.label,null),e})(),(()=>{var e=Tj();return B(e,j(Pn,{name:`info`,size:`small`})),e})()]}})}),null),B(o,j(AA,{variant:`row`,get disabled(){return!Se()||r()||ce()!==void 0||Ne()!==void 0},get pressed(){return n()},get label(){return`${n()?`Show`:`Hide`} ${t.label}`},get title(){return n()?`Show`:`Hide`},onToggle:async()=>Ae(e,t)}),null),x(e=>{var n=i()?`true`:void 0,c=i()?`true`:void 0,l=`Reorder ${t.label}`,u=!Ve()||r()||ce()!==void 0;return n!==e.e&&R(a,`data-lifted`,e.e=n),c!==e.t&&R(o,`data-dragging`,e.t=c),l!==e.a&&R(s,`aria-label`,e.a=l),u!==e.o&&(s.disabled=e.o=u),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}}),null),x(o=>{var c=i()?`true`:void 0,l=ZA(e),u=n()?`true`:void 0,d=i()?`true`:void 0,f=`Reorder ${ZA(e)}`,p=!be()||r()||Ne()!==void 0;return c!==o.e&&R(t,`data-lifted`,o.e=c),l!==o.t&&R(a,`aria-label`,o.t=l),u!==o.a&&R(a,`data-hidden`,o.a=u),d!==o.o&&R(a,`data-dragging`,o.o=d),f!==o.i&&R(s,`aria-label`,o.i=f),p!==o.n&&(s.disabled=o.n=p),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()}})}})),x(()=>R(e,`data-sorting`,ce()!==void 0||Ne()!==void 0?`true`:void 0)),e})(),(()=>{var e=hj();return B(e,fe),e})(),(()=>{var e=hj();return B(e,Le),e})()]}function Ze(t){let n=()=>te(t),i=()=>t.control!==`readonly`&&e.snapshot.writable.includes(t.key);switch(t.control){case`switch`:{let e=()=>t.clearable?n()===`runway`:n()===!0;return[j(am,{appearance:`compact`,hideLabel:!0,get checked(){return e()},get disabled(){return!i()||r()},onChange:e=>{re(t.key,t.clearable?e?`runway`:null:e)},get children(){return t.label}}),(()=>{var t=Ej();return B(t,()=>e()?`On`:`Off`),t})()]}case`select`:return(()=>{var e=Dj();return e.addEventListener(`change`,e=>re(t.key,e.currentTarget.value)),B(e,j(P,{get each(){return t.options??[]},children:e=>(()=>{var t=Oj();return B(t,()=>e.label),x(()=>t.value=e.value),t})()})),x(n=>{var r=t.label,a=!i();return r!==n.e&&R(e,`aria-label`,n.e=r),a!==n.t&&(e.disabled=n.t=a),n},{e:void 0,t:void 0}),x(()=>e.value=typeof n()==`string`?n():t.key===`percentLabelStyle`?`full`:``),e})();case`number`:case`integer`:return[j(Am,{class:`qg-input`,get"aria-label"(){return t.label},numeric:!0,get invalid(){return ee(t.key)!==void 0},get disabled(){return!i()},get value(){return I(()=>n()===void 0||n()===null)()?``:String(n())},onInput:e=>re(t.key,t.control===`number`?WA(e.currentTarget.value):GA(e.currentTarget.value))}),j(F,{get when(){return t.clearable},get children(){return j(Fn,{variant:`ghost-muted`,size:`small`,get disabled(){return!i()},onClick:()=>re(t.key,null),children:`Clear`})}})];case`providers`:{let e=()=>KA(n());return[j(kp,{"aria-label":`Provider selection`,get value(){return e().mode},get disabled(){return!i()||r()},onChange:e=>{e===`auto`&&re(t.key,`auto`),e===`manual`&&re(t.key,qA(_()))},get children(){return[j(jp,{value:`auto`,children:`Automatic`}),j(jp,{value:`manual`,children:`Manual`})]}}),j(F,{get when(){return e().mode===`manual`},get children(){return[j(Am,{class:`qg-input`,get disabled(){return!i()},placeholder:`provider ids, comma separated`,get value(){return _()},onInput:e=>{v(e.currentTarget.value),re(t.key,qA(e.currentTarget.value))}}),j(F,{get when(){return e().ids.length===0},get children(){return kj()}})]}})]}case`windows`:{let e=()=>JA(n());return j(P,{each:IA,children:n=>(()=>{var r=Aj(),a=r.firstChild,o=a.nextSibling;return a.addEventListener(`change`,r=>{let i=r.currentTarget.checked?[...e(),n]:e().filter(e=>e!==n);re(t.key,IA.filter(e=>i.includes(e)))}),B(o,n),x(()=>a.disabled=!i()),x(()=>a.checked=e().includes(n)),r})()})}default:return(()=>{var e=jj();return B(e,()=>String(n()??`—`)),e})()}}function Qe(){if(T().length===0)return;let e=`nativeQuotaNotifications`;if(!ge(e))return;let t=()=>ge(e),n=()=>VA(ge(e)),i=t=>re(e,t),l=()=>r()||!t().enabled,u=[{value:`fiveHour`,label:`5 hour`},{value:`hourly`,label:`Hourly`},{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`},{value:`yearly`,label:`Yearly`}],d=(e,t,n,r,i)=>(()=>{var a=Nj(),o=a.firstChild,s=o.firstChild,c=o.nextSibling,l=c.firstChild;return B(s,e),B(o,j(F,{when:i,get children(){var e=Mj();return B(e,i),e}}),null),B(c,j(am,{appearance:`compact`,hideLabel:!0,get checked(){return t()},get disabled(){return r()},onChange:n,children:e}),l),B(l,()=>t()?`On`:`Off`),a})();return(()=>{var f=Pj(),p=f.firstChild.nextSibling.nextSibling,m=p.firstChild;m.firstChild.nextSibling;var h=m.nextSibling,g=h.firstChild,_=p.nextSibling,v=_.firstChild.nextSibling,y=_.nextSibling,b=y.firstChild;b.firstChild.nextSibling;var S=b.nextSibling,C=S.firstChild;return B(f,()=>d(`Quota alerts`,()=>t().enabled,e=>i({...t(),enabled:e}),r),p),B(f,()=>d(`Model-change toast`,()=>t().modelChangeToastEnabled,e=>i({...t(),modelChangeToastEnabled:e}),r,`Show a toast in focused windows when the selected model differs from the last observed cache route. This does not affect background notifications or the quota-alert master switch.`),p),B(f,()=>d(`Low quota`,()=>t().low.enabled,e=>i({...t(),low:{...t().low,enabled:e}}),l),p),B(m,j(F,{get when(){return n().threshold},children:e=>(()=>{var t=Fj();return B(t,e),t})()}),null),B(h,j(Am,{class:`qg-input`,"aria-label":`Low quota threshold`,numeric:!0,get invalid(){return n().threshold!==void 0},get"aria-describedby"(){return n().threshold?`qg-alert-threshold-error`:void 0},get disabled(){return l()||!t().low.enabled},get value(){return a()??String(t().low.thresholdRemainingPercent)},onInput:e=>{o(e.currentTarget.value),i({...t(),low:{...t().low,thresholdRemainingPercent:GA(e.currentTarget.value)??NaN}})}}),g),B(f,()=>d(`Quota exhausted`,()=>t().exhausted.enabled,e=>i({...t(),exhausted:{enabled:e}}),l),_),B(f,()=>d(`Quota reset`,()=>t().reset.enabled,e=>i({...t(),reset:{...t().reset,enabled:e}}),l),_),B(v,j(P,{each:u,children:e=>(()=>{var n=Aj(),r=n.firstChild,a=r.nextSibling;return r.addEventListener(`change`,n=>i({...t(),reset:{...t().reset,windows:u.filter(r=>r.value===e.value?n.currentTarget.checked:t().reset.windows.includes(r.value)).map(e=>e.value)}})),B(a,()=>e.label),x(()=>r.disabled=l()||!t().reset.enabled),x(()=>r.checked=t().reset.windows.includes(e.value)),n})()})),B(f,()=>d(`Provider / API failures`,()=>t().providerError.enabled,e=>i({...t(),providerError:{enabled:e}}),l),y),B(b,j(F,{get when(){return n().cooldown},children:e=>(()=>{var t=Ij();return B(t,e),t})()}),null),B(b,j(F,{get when(){return ne(e)},children:e=>(()=>{var t=jj();return B(t,e),t})()}),null),B(S,j(Am,{class:`qg-input`,"aria-label":`Duplicate alert cooldown`,numeric:!0,get invalid(){return n().cooldown!==void 0},get"aria-describedby"(){return n().cooldown?`qg-alert-cooldown-error`:void 0},get disabled(){return l()},get value(){return s()??String(t().duplicateCooldownMinutes)},onInput:e=>{c(e.currentTarget.value),i({...t(),duplicateCooldownMinutes:GA(e.currentTarget.value)??NaN})}}),C),f})()}return(()=>{var n=Hj(),i=n.firstChild,a=i.firstChild.nextSibling.nextSibling,o=a.firstChild.nextSibling,s=o.firstChild.nextSibling,c=o.nextSibling.firstChild;c.firstChild.nextSibling;var u=c.nextSibling,f=u.firstChild;f.firstChild;var m=i.nextSibling.firstChild,g=m.nextSibling;return B(i,j(F,{get when(){return e.snapshot.import.available},get children(){var t=Rj(),n=t.firstChild.nextSibling.nextSibling;return B(t,j(F,{get when(){return e.snapshot.import.issues.length>0},get children(){var t=Lj();return B(t,j(P,{get each(){return e.snapshot.import.issues},children:e=>(()=>{var t=Uj(),n=t.firstChild;return B(t,()=>e.key,n),B(t,()=>e.message,null),t})()})),t}}),n),B(n,j(Fn,{variant:`outline`,size:`small`,get disabled(){return!e.snapshot.import.available||r()},onClick:()=>void oe(),children:`Preview migration`}),null),B(n,j(F,{get when(){return l()},children:e=>[(()=>{var t=Wj();return t.firstChild,B(t,()=>e().from,null),t})(),j(Fn,{variant:`contrast`,size:`small`,get disabled(){return r()},onClick:()=>void se(),get children(){return[`Apply `,I(()=>e().keys.length),` keys`]}})]}),null),B(t,j(F,{get when(){return d()},children:e=>(()=>{var t=Gj();return B(t,e),t})()}),null),B(t,j(F,{get when(){return l()},children:e=>(()=>{var t=Lj();return B(t,j(P,{get each(){return e().keys},children:e=>(()=>{var t=Kj(),n=t.firstChild;return B(t,()=>e.key,n),B(t,()=>JSON.stringify(e.value),null),t})()})),t})()}),null),t}}),a),B(i,j(P,{each:PA,children:t=>j(F,{get when(){return y().some(e=>e.group===t.id)||t.id===`temporal`&&e.temporal!==void 0},get children(){var e=qj(),n=e.firstChild;return B(n,()=>t.title),B(e,j(F,{get when(){return t.note},children:e=>(()=>{var t=Jj();return B(t,e),t})()}),null),B(e,j(F,{get when(){return t.id===`visibility`},get fallback(){return j(F,{get when(){return t.id===`temporal`},get fallback(){return j(P,{get each(){return y().filter(e=>e.group===t.id)},children:e=>(()=>{var t=Yj(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return B(r,()=>e.label),B(i,j(F,{get when(){return e.help},children:e=>(()=>{var t=Xj();return B(t,e),t})()}),null),B(i,j(F,{get when(){return ne(e.key)},children:e=>(()=>{var t=Xj();return B(t,e),t})()}),null),B(n,j(F,{get when(){return ee(e.key)},children:e=>(()=>{var t=Zj();return B(t,e),t})()}),null),B(a,()=>Ze(e)),x(()=>R(t,`data-invalid`,ee(e.key)?`true`:void 0)),t})()})},get children(){return Ye()}})},get children(){return Xe()}}),null),x(r=>{var i=`qg-settings-${t.id}`,a=`qg-settings-${t.id}`;return i!==r.e&&R(e,`aria-labelledby`,r.e=i),a!==r.t&&R(n,`id`,r.t=a),r},{e:void 0,t:void 0}),e}})}),a),B(i,j(F,{get when(){return e.nativeQuotaAlerts},get children(){return Qe()}}),a),B(a,j(F,{get when(){return I(()=>!!e.webDashboardToggle)()?w():void 0},children:e=>(()=>{var t=Yj(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return B(r,()=>e().label),B(i,j(F,{get when(){return e().help},children:e=>(()=>{var t=Xj();return B(t,e),t})()}),null),B(i,j(F,{get when(){return ne(e().key)},children:e=>(()=>{var t=Xj();return B(t,e),t})()}),null),B(a,()=>Ze(e())),t})()}),o),B(s,j(Am,{class:`qg-input`,"aria-label":`Dashboard address`,readOnly:!0,get value(){return e.snapshot.dashboard.url}})),B(c,j(F,{get when(){return h()},children:e=>(()=>{var t=Qj();return B(t,e),t})()}),null),B(u,j(Fn,{class:`qg-settings-file`,variant:`ghost-muted`,size:`small`,get"aria-label"(){return`Open settings file: ${e.snapshot.pathLabel}`},"aria-describedby":`qg-settings-file-help`,get"aria-busy"(){return p()},get disabled(){return p()},onClick:()=>void ae(),get children(){return e.snapshot.pathLabel}}),f),B(f,()=>e.snapshot.revision.slice(0,8),null),B(a,j(F,{get when(){return e.snapshot.issues.length>0},get children(){var t=zj(),n=t.firstChild.nextSibling.firstChild;return B(n,j(P,{get each(){return e.snapshot.issues},children:e=>(()=>{var t=$j(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.nextSibling;return i.nextSibling,B(t,()=>e.label,n),B(t,()=>e.message,r),B(t,()=>e.key,i),t})()})),t}}),null),B(i,j(Xb,{get children(){return e.aboutAction}}),null),B(m,j(F,{get when(){return D().length>0},get fallback(){return eM()},get children(){var e=Bj(),t=e.firstChild;return B(e,()=>D().length,t),e}}),null),B(m,j(F,{get when(){return t().conflict},get children(){return Vj()}}),null),B(g,j(Fn,{variant:`ghost-muted`,size:`small`,get disabled(){return D().length===0||r()||ce()!==void 0},onClick:ie,children:`Discard`}),null),B(g,j(Fn,{variant:`contrast`,size:`small`,get disabled(){return D().length===0||k().length>0||r()||ce()!==void 0},onClick:()=>void A(),children:`Save`}),null),n})()}Ye([`pointermove`,`pointerup`,`keydown`,`pointerdown`]);var nM=L(`<div class=qg-range-failure role=alert><span>Showing <!>. Updating to <!> failed.`),rM=L(`<div class=qg-range-failure role=alert><span>`);function iM(e){let[t,n]=b(e()),[r,i]=b(!1);return S(()=>{let r=e();r!==t()&&(n(r),i(!1))}),{available:()=>!r(),consume:()=>i(!0),reset:()=>i(!1)}}async function aM(e,t){let n=await e.run();return n&&t.reset(),n}function oM(e,t){let n=iM(t),r=()=>void aM(e,n);return{budget:n,retry:r,autoRetry:()=>{n.consume(),r()}}}function sM(e,t,n){let r=()=>_b({data:e.data(),error:e.error(),loading:e.loading()}),i=()=>hM(e.data(),t(),e.loading(),e.error()!==void 0),a=mw();return S(()=>{let t=e.data();a.update({active:e.loading()&&(t===void 0||!n(t)),hasData:t!==void 0})}),O(()=>a.dispose()),{state:r,rangeFailure:i,busy:a}}function cM(e,t,n){S(()=>e.onStale(n()||bb(e.reconnectEpoch,t())||e.connection!==`live`))}function lM(e){return e.enabled?.()!==!1}function uM(e){return uw(e,db,fb)}function dM(e){let t=e.store.take(e.retentionKey);t!==void 0&&e.query.set(t),e.query.run().then(t=>{if(!t)return;e.onApplied?.();let n=e.query.data();n!==void 0&&(e.store.remember(e.retentionKey,n),e.fresh(),e.onFresh?.())})}function fM(e,t,n,r){let[i,a]=b(0);return S(()=>{if(!lM(e))return;let i=e.reconnectEpoch;e.reloadToken,dM({query:t,store:e.store,retentionKey:n(),fresh:()=>a(i),onFresh:e.onFresh,onApplied:()=>r.reset()})}),O(()=>t.invalidate()),i}function pM(e,t,n,r){return j(gM,{failure:e,get recoverable(){return hb(t)},get autoRetry(){return r.available()},onAutoRetry:()=>{r.consume(),n()},onRetry:n})}function mM(e){return ow[e]??e}function hM(e,t,n,r){if(e!==void 0&&e.range!==t&&!n&&r)return{from:e.range,to:t}}function gM(e){return(()=>{var t=nM(),n=t.firstChild,r=n.firstChild.nextSibling,i=r.nextSibling.nextSibling;return i.nextSibling,B(n,()=>mM(e.failure.from),r),B(n,()=>mM(e.failure.to),i),B(t,j(Tx,{class:`qg-range-failure__retry`,get label(){return`Retry updating to ${mM(e.failure.to)}`},get recoverable(){return e.recoverable},get autoRetry(){return e.autoRetry},get onAutoRetry(){return e.onAutoRetry},get onRetry(){return e.onRetry}}),null),t})()}function _M(e){return[j(hw,{get indicator(){return e.busy},label:`analytics`}),j(F,{get when(){return e.rangeFailure()},children:t=>pM(t(),e.query.error(),()=>void aM(e.query,e.budget),e.budget)}),I(()=>e.children)]}function vM(e){let t=e.quotaQuery??dw(t=>e.client.quota(t?{refresh:!0}:void 0)),[n,r]=b(0),i=e.reconnectEpoch,a=e.reloadToken,o=!0,s=mw();S(()=>{s.update({active:t.loading()&&t.data()===void 0,hasData:t.data()!==void 0})}),O(()=>s.dispose()),S(()=>{if(!lM(e))return;let n=e.reconnectEpoch,s=e.reloadToken,c=s!==a;a=s;let l=n!==i;i=n,l&&!e.quotaQuery&&t.reconnected(),o&&!l&&t.consumeRefresh()?(o=!1,r(n),e.onFresh?.()):(o=!1,(l?t.afterReconnect():t.read({changed:c})).then(t=>{t&&(r(n),e.onFresh?.())}))}),S(()=>{t.data()&&e.onSnapshot(t.data())});let c=()=>_b({data:t.data(),error:t.error(),loading:t.loading()}),l=()=>{if(!t.isRefreshing()&&e.onRetryShell?.()!==!0){let n=e.reconnectEpoch;t.refresh().then(i=>{i&&n===e.reconnectEpoch&&t.data()?.stale===!1&&(r(n),e.onFresh?.())})}};return S(()=>e.onStale(t.data()?.stale===!0||t.error()!==void 0||bb(e.reconnectEpoch,n()))),[j(hw,{indicator:s,label:`quota`}),j(xx,{get state(){return c()},label:`Loading providers`,get skeleton(){return j(JD,{})},onRetry:l,render:(t,n)=>j(qD,{snapshot:t,get preferences(){return e.preferences},get hiddenCards(){return e.hiddenCards},get hiddenRows(){return e.hiddenRows},stale:n,onRetry:l})})]}function yM(e){let t=uM(()=>e.client.home({range:e.range})),[n,r]=b(0),[i,a]=b(),o=iM(()=>`home:${e.range}`),s=async()=>{let n=e.range,r=e.store.beginRead();try{let i=await e.client.home({range:n,exact:!0});if(e.range!==n)return;if(i.provisional===!0||i.exactError!==void 0){t.set(i),e.store.clearProvisional(n,r),a(i.exactError??`The exact analytics read failed. Retry to finish this range.`);return}t.set(i),e.store.clearProvisional(n,r),e.store.remember(`home:${n}`,i),a(void 0),o.reset()}catch{}},c=()=>{i()===void 0?aM(t,o):s()},l=()=>{o.consume(),c()};S(()=>{if(!lM(e))return;let n=e.reconnectEpoch,i=e.range;e.reloadToken;let s=e.store.beginRead(),c=e.store.take(`home:${i}`);c!==void 0&&t.set(c);let l=e.store.beginForeground(i);t.run().then(c=>{if(!c){e.store.clearProvisional(i,s);return}o.reset();let l=t.data();l!==void 0&&(l.exactError===void 0?(a(void 0),l.provisional===!0?e.store.noteProvisional(i,s):(e.store.clearProvisional(i,s),e.store.remember(`home:${i}`,l)),r(n),e.onFresh?.()):(e.store.clearProvisional(i,s),a(l.exactError)))}).finally(l),e.store.prefetch(i)}),O(()=>t.invalidate());let{state:u,rangeFailure:d,busy:f}=sM(t,()=>e.range,t=>t.range===e.range),p=()=>{let t=u();return t.kind===`ready`&&t.stale||bb(e.reconnectEpoch,n())?!0:e.connection!==`live`};return S(()=>e.onStale(p()||t.data()?.stale===!0||t.data()?.usage.stale===!0)),j(_M,{busy:f,rangeFailure:d,query:t,budget:o,get children(){return[j(F,{get when(){return i()},children:t=>(()=>{var n=rM(),r=n.firstChild;return B(r,t),B(n,j(Tx,{class:`qg-range-failure__retry`,get label(){return`Retry exact ${mM(e.range)} analytics`},recoverable:!0,get autoRetry(){return o.available()},onAutoRetry:l,onRetry:c}),null),n})()}),j(xx,{get state(){return u()},label:`Loading analytics`,onRetry:c,get autoRetry(){return o.available()},onAutoRetry:l,render:e=>j(YD,{snapshot:e,get range(){return e.range}})})]}})}function bM(e){let t=uM(()=>e.client.groups({range:e.range,dimension:e.dimension})),n=()=>`groups:${e.dimension}:${e.range}`,{budget:r,retry:i,autoRetry:a}=oM(t,n),o=fM(e,t,n,r),s=()=>{let n=t.data();return n!==void 0&&n.dimension===e.dimension?n:void 0},c=()=>hM(s(),e.range,t.loading(),t.error()!==void 0),l=mw();return S(()=>{let n=t.data();l.update({active:t.loading()&&(n===void 0||n.dimension!==e.dimension||n.range!==e.range),hasData:s()!==void 0})}),O(()=>l.dispose()),cM(e,o,()=>t.error()!==void 0||t.data()?.stale===!0),j(_M,{busy:l,rangeFailure:c,query:t,budget:r,get children(){return j(HO,{get snapshot(){return s()},get dimension(){return e.dimension},get loading(){return t.loading()},get error(){return I(()=>t.error()===void 0)()?void 0:lb(t.error())},get errorRecoverable(){return hb(t.error())},get autoRetry(){return r.available()},onAutoRetry:a,onRetry:i,get onDimensionChange(){return e.onDimensionChange}})}})}function xM(e){let t=()=>e.entity===`model`?`provider`:`model`,n=uM(()=>e.client.groups({range:e.range,dimension:t(),filter:{dimension:e.entity,identity:e.identity}})),r=()=>{let t=e.identity.kind===`known`?e.identity.id:`unknown`;return`groups:${e.entity}:${t}:${e.range}`},{budget:i,retry:a,autoRetry:o}=oM(n,r),s=fM(e,n,r,i),c=()=>{let r=n.data();if(r===void 0||r.dimension!==t())return;let i=r.filter;if(i!==void 0&&i.dimension===e.entity&&bw(i.identity,e.identity))return r},l=()=>_b({data:c(),error:n.error(),loading:n.loading()||n.error()===void 0&&n.data()!==void 0&&c()===void 0}),u=()=>hM(c(),e.range,n.loading(),n.error()!==void 0),d=mw();return S(()=>{let r=n.data();d.update({active:n.loading()&&(r===void 0||r.dimension!==t()||r.filter===void 0||!bw(r.filter.identity,e.identity)),hasData:c()!==void 0})}),O(()=>d.dispose()),cM(e,s,()=>n.error()!==void 0||c()?.stale===!0),j(_M,{busy:d,rangeFailure:u,query:n,budget:i,get children(){return j(xx,{get state(){return l()},get label(){return`Loading ${e.entity}`},onRetry:a,get autoRetry(){return i.available()},onAutoRetry:o,render:t=>e.entity===`model`?j(VO,{snapshot:t,get identity(){return e.identity},get range(){return t.range},get modelsGroup(){return e.modelsGroup}}):j(ZO,{snapshot:t,get identity(){return e.identity},get range(){return t.range},get modelsGroup(){return e.modelsGroup}})})}})}function SM(e){let t=uM(()=>e.client.project({projectId:e.projectId,range:e.range})),n=()=>`project:${e.projectId}:${e.range}`,{budget:r,retry:i,autoRetry:a}=oM(t,n),o=fM(e,t,n,r),{state:s,rangeFailure:c,busy:l}=sM(t,()=>e.range,t=>t.range===e.range&&t.projectId===e.projectId);return S(()=>e.onStale(t.error()!==void 0||t.data()?.stale===!0||t.data()?.usage.stale===!0||bb(e.reconnectEpoch,o()))),j(_M,{busy:l,rangeFailure:c,query:t,budget:r,get children(){return j(xx,{get state(){return s()},label:`Loading project`,onRetry:i,get autoRetry(){return r.available()},onAutoRetry:a,render:(t,n)=>j(JO,{snapshot:t,get range(){return t.range},get stale(){return n||e.connection!==`live`||bb(e.reconnectEpoch,o())}})})}})}function CM(e){let t=()=>e.route.sessionId,n=uM(()=>e.client.session({sessionId:t()})),r=iM(()=>`session:${t()}`),i=()=>void aM(n,r),a=()=>{r.consume(),i()},o=fM(e,n,()=>`session:${t()}`,r),s=()=>_b({data:n.data(),error:n.error(),loading:n.loading()}),c=mw();return S(()=>{let e=n.data();c.update({active:n.loading()&&(e===void 0||e.focusSessionId!==t()),hasData:e!==void 0})}),O(()=>c.dispose()),S(()=>e.onStale(n.error()!==void 0||bb(e.reconnectEpoch,o()))),[j(hw,{indicator:c,label:`analytics`}),j(xx,{get state(){return s()},label:`Loading session`,onRetry:i,get autoRetry(){return r.available()},onAutoRetry:a,render:(t,n)=>j(OA,{snapshot:t,get range(){return e.range},get individual(){return e.route.individual===!0},get stale(){return n||e.connection!==`live`||bb(e.reconnectEpoch,o())}})})]}function wM(e){let t=()=>{let t=e.route;return t.name===`model`||t.name===`provider`?t:void 0};return j(Ie,{get children(){return[j(Le,{get when(){return e.route.name===`analytics`},get children(){return j(yM,e)}}),j(Le,{get when(){return I(()=>e.route.name===`models`)()?e.route:void 0},children:t=>j(bM,M(e,{get dimension(){return t().dimension},get onDimensionChange(){return e.onModelsDimensionChange}}))}),j(Le,{get when(){return t()},children:t=>j(xM,M(e,{get entity(){return t().name},get identity(){return t().identity},get modelsGroup(){return t().modelsGroup}}))}),j(Le,{get when(){return I(()=>e.route.name===`project`)()?e.route:void 0},children:t=>j(SM,M(e,{get projectId(){return t().projectId}}))}),j(Le,{get when(){return I(()=>e.route.name===`session`)()?e.route:void 0},children:t=>j(CM,M(e,{get route(){return t()}}))})]}})}function TM(e){let t=()=>_b({data:e.query.data(),error:e.query.error(),loading:e.query.loading()});return j(F,{get when(){return e.query.data()},get fallback(){return[j(xx,{get state(){return t()},label:`Loading settings`,render:()=>null,get onRetry(){return e.onRetry}}),j(F,{get when(){return e.aboutAction},get children(){return j(Xb,{get children(){return e.aboutAction}})}})]},children:t=>j(tM,{get snapshot(){return t()},get client(){return e.client},get toaster(){return e.toaster},get catalog(){return e.catalog},get temporal(){return e.temporal},get webDashboardToggle(){return e.webDashboardToggle},get nativeQuotaAlerts(){return e.nativeQuotaAlerts},get aboutAction(){return e.aboutAction},onReload:async()=>{await e.query.run()}})})}function EM(e){let t=e.indexOf(`#`),n=t>=0?e.slice(t+1):e,r=n.lastIndexOf(`|`);return r>=0?n.slice(0,r):n}var DM=`opencode-quota-gui.visibility-catalog.v2`,OM=2,kM={cards:4e3,rows:2e3,textLength:256};function AM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jM(e){return typeof e==`string`&&e.trim().length>0?e.slice(0,kM.textLength):void 0}function MM(e){return typeof e==`string`&&e.length>0&&e.length<=kM.textLength&&e===e.trim()?e:void 0}function NM(e,t){let n=MM(e),r=`${t}:`;return n?.startsWith(r)&&/^[a-f0-9]{64}$/u.test(n.slice(r.length))?n:void 0}function PM(e){let t=[];if(!AM(e)||!Array.isArray(e.cards))return{cards:t};let n=new Set,r=kM.rows;for(let i of e.cards){if(t.length>=kM.cards)break;if(!AM(i))continue;let e=MM(i.providerId);if(!e)continue;let a=NM(i.cardId,e),o=jM(i.providerLabel);if(!a||!e||!o||n.has(a))continue;n.add(a);let s=jM(i.planLabel),c=jM(i.accountLabel),l=NM(i.providerScopeId,e),u=MM(i.providerScopeHash),d=u&&/^[a-f0-9]{64}$/u.test(u)&&(l===void 0||l===`${e}:${u}`)?u:void 0,f=[],p=new Set;for(let e of Array.isArray(i.rows)?i.rows:[]){if(r<=0)break;if(!AM(e))continue;let t=MM(e.id),n=jM(e.label);if(!t||!t.startsWith(`${a}#`)||t.length<=a.length+1||!n||p.has(t))continue;p.add(t),--r;let i=jM(e.info),o=[];for(let n of Array.isArray(e.aliases)?e.aliases:[]){let e=MM(n);if(!(!e||e===t||!e.startsWith(`${a}#`)||e.length<=a.length+1||o.includes(e))&&(o.push(e),o.length>=8))break}let s={id:t,label:n};i!==void 0&&(s.info=i),o.length>0&&(s.aliases=o),f.push(s)}t.push({cardId:a,providerId:e,providerLabel:o,...s===void 0?{}:{planLabel:s},...c===void 0?{}:{accountLabel:c},...l===void 0?{}:{providerScopeId:l},...d===void 0?{}:{providerScopeHash:d},rows:f})}return{cards:t}}function FM(e){try{let t=e?.getItem(DM);if(!t)return{cards:[]};let n=JSON.parse(t);return AM(n)&&n.version===OM?PM(n):{cards:[]}}catch{return{cards:[]}}}function IM(e,t){try{let n=PM(t).cards.map(e=>({...e,rows:e.rows.map(({aliases:e,...t})=>t)}));e?.setItem(DM,JSON.stringify({version:OM,cards:n}))}catch{}}function LM(e,t){return e.cards.length===t.cards.length&&e.cards.every((e,n)=>{let r=t.cards[n];return r!==void 0&&e.cardId===r.cardId&&e.providerId===r.providerId&&e.providerLabel===r.providerLabel&&e.planLabel===r.planLabel&&e.accountLabel===r.accountLabel&&e.providerScopeId===r.providerScopeId&&e.providerScopeHash===r.providerScopeHash&&e.rows.length===r.rows.length&&e.rows.every((e,t)=>{let n=r.rows[t];return n!==void 0&&e.id===n.id&&e.label===n.label&&e.info===n.info&&e.aliases?.join(`\0`)===n.aliases?.join(`\0`)})})}function RM(e){if(e===void 0)return{cards:[]};let t=[];for(let n of e.providers.cards){if(t.some(e=>e.cardId===n.cardId))continue;let e={cardId:n.cardId,providerId:n.providerId,providerLabel:n.providerLabel,...n.planLabel===void 0?{}:{planLabel:n.planLabel},...n.accountLabel===void 0?{}:{accountLabel:n.accountLabel},...n.providerScopeId===void 0?{}:{providerScopeId:n.providerScopeId},...n.providerScopeHash===void 0?{}:{providerScopeHash:n.providerScopeHash},rows:[]},r=n.visibilityRows??[],i=new Map;for(let e of r){i.set(e.rowId,e);for(let t of e.aliases??[])i.set(t,e)}let a=(t,n,r)=>{let a=i.get(t),o=a?.rowId??t,s=e.rows.find(e=>e.id===o);if(s){s.info===void 0&&r!==void 0&&(s.info=r);return}let c={id:o,label:n};r!==void 0&&(c.info=r),a?.aliases?.length&&(c.aliases=[...a.aliases]),e.rows.push(c)};for(let e of n.rows)a(e.rowId,e.label,e.info);for(let e of r)a(e.rowId,e.label,e.info);t.push(e)}return{cards:t}}function zM(e,t){let n=PM(e),r=PM(t),i=new Map(r.cards.map(e=>[e.cardId,e])),a=n.cards.map(e=>{let t=i.get(e.cardId);if(!t)return e;let n=new Map(t.rows.map(e=>[e.id,e])),r=new Set(e.rows.map(e=>e.id)),a=new Set(e.rows.map(e=>EM(e.id)));return{...e,...e.providerScopeId===void 0&&t.providerScopeId!==void 0?{providerScopeId:t.providerScopeId}:{},...e.providerScopeHash===void 0&&t.providerScopeHash!==void 0?{providerScopeHash:t.providerScopeHash}:{},rows:[...e.rows.map(e=>{let t=e.info??n.get(e.id)?.info;return t===void 0?e:{...e,info:t}}),...t.rows.filter(e=>!r.has(e.id)&&!a.has(EM(e.id)))]}}),o=new Set(a.map(e=>e.cardId));return PM({cards:[...a,...r.cards.filter(e=>!o.has(e.cardId))]})}var BM=L(`<a class="qg-topbar__link qg-nav-icon"aria-label=Quota>`),VM=L(`<a class="qg-topbar__link qg-nav-icon"aria-label=Analytics>`),HM=L(`<span class=qg-stale aria-live=polite>`),UM=L(`<a class=qg-topbar__link aria-label=Settings>`),WM=L(`<div class=qg-error-card role=alert><span>That address does not match a dashboard page.</span><a>Go home`),GM=L(`<div class=qg-app><header class=qg-chrome><nav class=qg-topbar__brand aria-label=Views></nav><div class=qg-topbar__actions></div></header><div class=qg-frame><header class=qg-topbar><div class=qg-topbar__left></div><div class=qg-topbar__actions></div></header><main class=qg-main>`),KM=L(`<span class=qg-frame-tab>`);function qM(){let e=Fb(JM());if(typeof window>`u`)return Bb(`/quota`,e);let t=Vb(window.location,e);return window.location.pathname+window.location.search+window.location.hash!==t.path&&window.history.replaceState(null,``,t.path),Ib(JM(),t.location.range),t.location}function JM(){try{return typeof window>`u`?void 0:window.localStorage}catch{return}}function YM(e){let[t,n]=b(qM()),[r,i]=b(e.client.connection()),[a,o]=b(),[s,c]=b(void 0),[l,u]=b(),[d,f]=b(void 0),[p,m]=b(0),[h,g]=b(0),_=Nb(t=>e.client.home(t),{owner:()=>e.client}),[v,y]=b(void 0),w=dw(t=>e.client.quota(t?{refresh:!0}:void 0));S(()=>{let e=w.data();e&&y(e)});let[T,k]=b(!1),[ee,te]=b(0),[ne,re]=b(0),ie=PC();O(()=>_.dispose());let A=()=>t().range,ae=()=>t().route,oe=C(()=>sb(s())),se=()=>cw(ae()),ce=()=>Ub(ae()),[le,ue]=b(`provider`);S(()=>{let e=ce();e!==void 0&&ue(e)});let de=C(()=>lw(ae()));async function fe(t){try{await e.client.setActiveView?.(t)}catch{}}S(()=>{let e=de();r()===`live`&&fe(e)});let pe=uw(()=>e.client.settings()),me=C(()=>oj(pe.data()?.values??{}));S(E([()=>ae().name,()=>h()],([e,t],n)=>{if(e!==`settings`)return;let r=n!==void 0&&n[1]!==t;(r||!v())&&w.read({changed:r})}));let[he,ge]=b(FM(JM())),_e=C(()=>RM(v())),ve=C(()=>zM(_e(),he()));S(()=>{let e=ve();LM(e,he())||(ge(e),IM(JM(),e))});function ye(e){be(Q(ae(),e))}function be(e){let t=Bb(e,A());if(t.route.name===`not-found`)return;let r=Q(t.route,t.range);window.location.pathname+window.location.search!==r&&(window.history.pushState(null,``,r),Ib(JM(),t.range),n(t))}function xe(e){let r=t();if(r.route.name!==`models`)return;let i={...r,route:{name:`models`,dimension:e}},a=Q(i.route,i.range);window.location.pathname+window.location.search!==a&&(window.history.replaceState(null,``,a),n(i))}function Se(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.(`a`),n=t?.getAttribute(`href`);!t||!n||!n.startsWith(`/`)||n.startsWith(`//`)||t.hasAttribute(`download`)||t.getAttribute(`target`)&&t.getAttribute(`target`)!==`_self`||Bb(n,A()).route.name===`not-found`||(e.preventDefault(),be(n))}let Ce;return S(()=>{let e=r();if(Ce===e)return;let t=Ce;if(Ce=e,t===`live`&&e!==`live`&&w.invalidate(),!yb(t,e))return;w.reconnected();let n=ee()+1;te(n),pe.run().then(e=>{e&&re(n)})}),D(()=>{let t=()=>{let e=Bb(window.location.pathname+window.location.search,Fb(JM()));Ib(JM(),e.range),n(e)};window.addEventListener(`popstate`,t),window.addEventListener(`click`,Se);let r=e.client.onConnectionChange(i),a=e.client.subscribe(e=>{e.topic===`settings.changed`?pe.run():e.topic===`quota.changed`?g(e=>e+1):m(e=>e+1)});(async()=>{try{let t=await e.client.health();c(t),f(cb(t.contractVersion))}catch(e){u(e)}await pe.run()})(),O(()=>{window.removeEventListener(`popstate`,t),window.removeEventListener(`click`,Se),r(),a()})}),(()=>{var t=GM(),n=t.firstChild,i=n.firstChild,s=i.nextSibling,g=n.nextSibling.firstChild,b=g.firstChild,S=b.nextSibling,C=g.nextSibling;return B(i,j(q_,{value:`Quota`,get forceOpen(){return a()===`home`},get children(){var e=BM();return e.$$keydown=e=>{e.key===`Escape`&&o(void 0)},e.$$click=()=>o(void 0),e.addEventListener(`pointerleave`,()=>o(void 0)),e.addEventListener(`pointerenter`,()=>o(`home`)),e.addEventListener(`blur`,()=>o(void 0)),e.addEventListener(`focus`,()=>o(`home`)),B(e,j(sx,{})),x(t=>{var n=ae().name===`home`?`page`:void 0,r=Q({name:`home`},A());return n!==t.e&&R(e,`aria-current`,t.e=n),r!==t.t&&R(e,`href`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),B(i,j(q_,{value:`Analytics`,get forceOpen(){return a()===`analytics`},get children(){var e=VM();return e.$$keydown=e=>{e.key===`Escape`&&o(void 0)},e.$$click=()=>o(void 0),e.addEventListener(`pointerleave`,()=>o(void 0)),e.addEventListener(`pointerenter`,()=>o(`analytics`)),e.addEventListener(`blur`,()=>o(void 0)),e.addEventListener(`focus`,()=>o(`analytics`)),B(e,j(ox,{})),x(t=>{var n=se()===void 0?void 0:`true`,r=Q({name:`analytics`},A());return n!==t.e&&R(e,`data-section-active`,t.e=n),r!==t.t&&R(e,`href`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),B(s,j(Yb,{get message(){return oe()}}),null),B(s,j(F,{get when(){return r()!==`live`||w.error()!==void 0||l()!==void 0||(ae().name===`settings`?bb(ee(),ne())||pe.error()!==void 0:T())},get children(){var e=HM();return B(e,(()=>{var e=I(()=>r()===`connecting`);return()=>e()?`Connecting…`:r()===`reconnecting`?`Reconnecting…`:`Data may be stale`})()),e}}),null),B(s,j(q_,{value:`Settings`,get forceOpen(){return a()===`settings`},get children(){var e=UM();return e.$$keydown=e=>{e.key===`Escape`&&o(void 0)},e.$$click=()=>o(void 0),e.addEventListener(`pointerleave`,()=>o(void 0)),e.addEventListener(`pointerenter`,()=>o(`settings`)),e.addEventListener(`blur`,()=>o(void 0)),e.addEventListener(`focus`,()=>o(`settings`)),B(e,j(Pn,{name:`settings-gear`})),x(t=>{var n=ae().name===`settings`?`page`:void 0,r=Q({name:`settings`},A());return n!==t.e&&R(e,`aria-current`,t.e=n),r!==t.t&&R(e,`href`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),B(b,j(F,{get when(){return se()},get fallback(){return(()=>{var e=KM();return B(e,(()=>{var e=I(()=>ae().name===`home`);return()=>e()?`Quota`:ae().name===`settings`?`Settings`:`Dashboard`})()),e})()},children:e=>j(Kb,{get active(){return e()},get range(){return A()},get modelsDimension(){return ce()??le()}})})),B(S,j(F,{get when(){return I(()=>ae().name===`home`)()?v()?.temporal:void 0},children:e=>j(kC,{get providers(){return e().providers},get overrides(){return me().temporalProviderOverrides}})}),null),B(S,j(F,{get when(){return Wb(ae())},get children(){return j(kp,{class:`qg-range`,"aria-label":`Time range`,get value(){return A()},onChange:e=>{rv(e)&&ye(e)},get children(){return tv.map(e=>j(jp,{value:e,get children(){return j(mx,{get label(){return ow[e]??e},get pending(){return _.pending().has(e)}})}}))}})}}),null),B(C,j(F,{get when(){return d()===void 0},get fallback(){return j(Ex,{get message(){return d()??``}})},get children(){return j(Ie,{get children(){return[j(Le,{get when(){return ae().name===`home`},get children(){return j(vM,{get client(){return e.client},quotaQuery:w,get reloadToken(){return h()},get reconnectEpoch(){return ee()},get preferences(){return me()},get hiddenCards(){return pe.data()?.visibility.hiddenCards??[]},get hiddenRows(){return pe.data()?.visibility.hiddenRows??[]},onSnapshot:y,onStale:k,onRetryShell:()=>{pe.run(),m(e=>e+1),e.client.health().then(e=>{c(e),u(void 0),f(cb(e.contractVersion))}).catch(u)}})}}),j(Le,{get when(){return se()!==void 0},get children(){return j(wM,{get client(){return e.client},store:_,get connection(){return r()},get route(){return ae()},get range(){return A()},get reloadToken(){return p()},get reconnectEpoch(){return ee()},onStale:k,onModelsDimensionChange:xe})}}),j(Le,{get when(){return ae().name===`settings`},get children(){return j(TM,{get client(){return e.client},query:pe,get catalog(){return ve()},get temporal(){return v()?.temporal},toaster:ie,get stale(){return r()!==`live`||bb(ee(),ne())}})}}),j(Le,{when:!0,get children(){var e=WM(),t=e.firstChild.nextSibling;return x(()=>R(t,`href`,Q({name:`home`},A()))),e}})]}})}})),B(t,j(FC,{toaster:ie}),null),x(()=>R(C,`data-settings`,ae().name===`settings`?`true`:void 0)),t})()}Ye([`click`,`keydown`]);var XM=document.getElementById(`root`);if(XM){let e=ob();Je(()=>j(YM,{client:e}),XM)}export{vt as A,Pe as B,cn as C,Et as D,Dt as E,j as F,O as H,ie as I,S as L,I as M,L as N,V as O,F as P,C as R,$t as S,fn as T,N as U,M as V,A as W,jt as _,d_ as a,Zt as b,Mg as c,Pn as d,bn as f,Mt as g,Bt as h,f_ as i,B as j,Ct as k,Em as l,hn as m,m_ as n,Ug as o,_n as p,p_ as r,Vg as s,K_ as t,Fp as u,Ut as v,Ot as w,Ft as x,Nt as y,b as z};