react-semaphor 0.1.606 → 0.1.608

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 (150) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/appearance-runtime/index.js +1 -1
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/assistant-protocol/index.js +1 -1
  5. package/dist/brand-studio/index.js +2 -2
  6. package/dist/briefings/index.js +1 -1
  7. package/dist/chunks/add-to-dashboard-Bu3M9DpP.js +12 -0
  8. package/dist/chunks/appearance-provider-BBYTKSjL.js +613 -0
  9. package/dist/chunks/appearance-runtime-provider-De2VZS4F.js +1 -0
  10. package/dist/chunks/assistant-chat-x3NCrm5n.js +53 -0
  11. package/dist/chunks/attachment-filter-line-ClTS4GvQ.js +1 -0
  12. package/dist/chunks/{bookmark-impact-BW30cm5E.js → bookmark-impact-xCmo8x3V.js} +1 -1
  13. package/dist/chunks/bookmark-state-BmbBu1th.js +1 -0
  14. package/dist/chunks/{brand-CL5xDiFH.js → brand-3m_qSMyC.js} +1 -1
  15. package/dist/chunks/card-filter-builder-CM3SZ4kO.js +11 -0
  16. package/dist/chunks/check-input-C7S2sNzB.js +151 -0
  17. package/dist/chunks/{comparison-window-caption-tguyN24S.js → comparison-window-caption-WzGsqv4n.js} +1 -1
  18. package/dist/chunks/compiler-XErOfUUx.js +1 -0
  19. package/dist/chunks/context-Cwj8Axgd.js +2 -0
  20. package/dist/chunks/currency-presentation-binding-s4PlA3Wu.js +1 -0
  21. package/dist/chunks/custom-visual-inputs-CUtxCe4T.js +1 -0
  22. package/dist/chunks/custom-visual-write-CH-k-4HE.js +1 -0
  23. package/dist/chunks/{dashboard-Cyhj9EOl.js → dashboard-BwuurlUI.js} +1 -1
  24. package/dist/chunks/{dashboard-briefing-launcher-CyOFddmD.js → dashboard-briefing-launcher-CX7mCnPi.js} +5 -5
  25. package/dist/chunks/{dashboard-controls-DpADfhr0.js → dashboard-controls-Bwjy9G1i.js} +8 -8
  26. package/dist/chunks/{dashboard-json-4xMChR2q.js → dashboard-json-B9lK28i0.js} +1 -1
  27. package/dist/chunks/dashboard-temporal-snapshot-CcndP6CF.js +1 -0
  28. package/dist/chunks/edit-dashboard-visual-BF3mfrWf.js +103 -0
  29. package/dist/chunks/{filter-line-WwUV5JzN.js → filter-line-W-qQAjke.js} +1 -1
  30. package/dist/chunks/filter-reach-preview-DSH_k8AJ.js +1 -0
  31. package/dist/chunks/{filter-value-text-DqTHe_vu.js → filter-value-text-DQwYZHz0.js} +1 -1
  32. package/dist/chunks/kpi-trend-rule-DDbguInc.js +1 -0
  33. package/dist/chunks/{layout-grid-Dtsioq4h.js → layout-grid-Bx0jBVXj.js} +1 -1
  34. package/dist/chunks/matrix-analytical-definition-jn075ooo.js +1 -0
  35. package/dist/chunks/{matrix-member-presentation-vVAv-aqg.js → matrix-member-presentation-Chz6uGYz.js} +1 -1
  36. package/dist/chunks/matrix-operation-contract-DceN49RX.js +1 -0
  37. package/dist/chunks/metric-formatting-DILSVxLq.js +1 -0
  38. package/dist/chunks/{numeric-range-options-C8tr-Bls.js → numeric-range-options-Drc1EZ6H.js} +1 -1
  39. package/dist/chunks/{palette-565cA0nh.js → palette-CZJ4ZCY9.js} +1 -1
  40. package/dist/chunks/pivot-result-contract-expectations-D_ane7I2.js +1 -0
  41. package/dist/chunks/{pivot-result-identity-B0eWVMXg.js → pivot-result-identity-DRhVJMsF.js} +1 -1
  42. package/dist/chunks/{raw-temporal-value-BHQ-ldpW.js → raw-temporal-value-B4Md6Xfb.js} +1 -1
  43. package/dist/chunks/report-preferences-dialog-EQNoTych.js +1 -0
  44. package/dist/chunks/{report-runtime-context-Cd1b5pku.js → report-runtime-context-CkxgMKr6.js} +1 -1
  45. package/dist/chunks/resolve-dashboard-input-context-B5yUS9ZM.js +8 -0
  46. package/dist/chunks/sandbox-host-WJXxpvz7.js +197 -0
  47. package/dist/chunks/saved-dashboard-context-DQlA4Mg0.js +1 -0
  48. package/dist/chunks/{selection-filter-compiler-kYsRugss.js → selection-filter-compiler-BxtEEB6Z.js} +1 -1
  49. package/dist/chunks/semaphor-ready-indicator-Cq3C2SNo.js +622 -0
  50. package/dist/chunks/set-wWdhgHSh.js +1 -0
  51. package/dist/chunks/slider-C4jUvJtd.js +599 -0
  52. package/dist/chunks/stored-dashboard-1x0q2cNx.js +1 -0
  53. package/dist/chunks/table-cell-text-DFHUGeG6.js +1 -0
  54. package/dist/chunks/{table-export-sheet-xaczzWZF.js → table-export-sheet-CthBUHu4.js} +1 -1
  55. package/dist/chunks/{token-types-1vzMWjI-.js → token-types-BM0mpZce.js} +1 -1
  56. package/dist/chunks/{validators-Dg2kyF4_.js → validators-U8IL8djK.js} +1 -1
  57. package/dist/chunks/{variable-draft-CRbSYdB6.js → variable-draft-CwX-b6Fs.js} +1 -1
  58. package/dist/dashboard/index.js +1 -1
  59. package/dist/dashboard-authoring/index.js +1 -1
  60. package/dist/extensions/index.js +1 -0
  61. package/dist/format-utils/index.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/report-runtime-context/index.js +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/surfboard/index.js +1 -1
  66. package/dist/types/components/assistant/assistant-store.d.ts +19 -0
  67. package/dist/types/components/assistant/use-assistant.d.ts +4 -0
  68. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +2 -3
  69. package/dist/types/components/visual/data-table/table-cell-text.d.ts +93 -0
  70. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -1
  71. package/dist/types/extensions.d.ts +2 -0
  72. package/dist/types/index.js +1 -1
  73. package/dist/types/lib/charts/types.d.ts +3 -1
  74. package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -2
  75. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +12 -12
  76. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +25 -25
  77. package/dist/types/lib/stores/dashboard-store.d.ts +33 -2
  78. package/dist/types/lib/stores/editor-store.d.ts +8 -0
  79. package/dist/types/lib/types/common-types.d.ts +3 -0
  80. package/dist/types/lib/utils/card-definition.d.ts +12 -12
  81. package/dist/types/lib/utils/card-type-change.d.ts +9 -0
  82. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +6 -6
  83. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
  84. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +248 -248
  85. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  86. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  87. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +2 -2
  88. package/dist/types/shared/assistant-protocol/context.d.ts +26 -26
  89. package/dist/types/shared/assistant-protocol/parts.d.ts +4 -0
  90. package/dist/types/shared/assistant-protocol/request.d.ts +2 -1
  91. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +16 -6
  92. package/dist/types/shared/dashboard-authoring/card-settings/custom-visual-write.d.ts +50 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
  94. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  95. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +2 -2
  96. package/dist/types/shared/dashboard-authoring/changes/custom-visual-change.d.ts +57 -0
  97. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +61 -54
  98. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +5 -1
  99. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +5 -1
  100. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +10 -0
  101. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +60 -60
  102. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +4 -4
  103. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +48 -48
  104. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +8 -2
  105. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
  106. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
  107. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +8 -0
  108. package/dist/types/shared/extensions/check-audits.d.ts +30 -0
  109. package/dist/types/shared/extensions/check-findings.d.ts +46 -0
  110. package/dist/types/shared/extensions/check-input.d.ts +23 -0
  111. package/dist/types/shared/extensions/check-renders.d.ts +44 -0
  112. package/dist/types/shared/extensions/check-runner.d.ts +19 -0
  113. package/dist/types/shared/extensions/index.d.ts +17 -0
  114. package/dist/types/shared/extensions/read-document.d.ts +18 -0
  115. package/dist/types/shared/extensions/sandbox-host.d.ts +63 -0
  116. package/dist/types/shared/extensions/saved-refs.d.ts +33 -0
  117. package/dist/types/shared/extensions/script-policy.d.ts +11 -0
  118. package/dist/types/shared/extensions/types.d.ts +186 -0
  119. package/dist/types/shared/extensions/visual-contract.d.ts +38 -0
  120. package/dist/types/shared/extensions/visual-payload.d.ts +75 -0
  121. package/dist/types/shared/extensions/visual-theme.d.ts +21 -0
  122. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +13 -6
  123. package/dist/types/shared/format-utils/matrix-continuation.d.ts +2 -2
  124. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +24 -24
  125. package/dist/types/shared/usage-events/details.d.ts +4 -4
  126. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  127. package/dist/usage-events/index.js +1 -1
  128. package/package.json +7 -2
  129. package/dist/chunks/add-to-dashboard-CEmZUf9o.js +0 -12
  130. package/dist/chunks/appearance-provider-fIhJSX6y.js +0 -613
  131. package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +0 -1
  132. package/dist/chunks/assistant-chat-SBKSrrEA.js +0 -51
  133. package/dist/chunks/attachment-filter-line-C_zHMhGh.js +0 -1
  134. package/dist/chunks/bookmark-state-DScd31KT.js +0 -1
  135. package/dist/chunks/card-filter-builder-CzScSOQY.js +0 -11
  136. package/dist/chunks/context-CntvtZwC.js +0 -2
  137. package/dist/chunks/dashboard-temporal-snapshot-w3SMiPKj.js +0 -1
  138. package/dist/chunks/edit-dashboard-visual-DlvY7au4.js +0 -73
  139. package/dist/chunks/filter-reach-preview-DAEIyrEG.js +0 -1
  140. package/dist/chunks/kpi-trend-rule-N1Xkwe_u.js +0 -1
  141. package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +0 -1
  142. package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +0 -1
  143. package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +0 -1
  144. package/dist/chunks/report-preferences-dialog-B2ZGPS9t.js +0 -1
  145. package/dist/chunks/resolve-dashboard-input-context-SlAAe4GF.js +0 -8
  146. package/dist/chunks/saved-dashboard-context-Bc2SVDr-.js +0 -1
  147. package/dist/chunks/semaphor-ready-indicator-Bj-cjkz-.js +0 -612
  148. package/dist/chunks/set-CACXVM2A.js +0 -1
  149. package/dist/chunks/slider-CWze9OEM.js +0 -4
  150. package/dist/chunks/stored-dashboard-CcNdU-mG.js +0 -1
@@ -1 +1 @@
1
- var y=Object.defineProperty;var c=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>c(i,typeof t!="symbol"?t+"":t,e);import{v as u}from"./matrix-operation-contract-CWvcEsQ0.js";class l extends Error{constructor(e){super(`missing_pivot_member_identity: ${e}`);a(this,"deliveryBlocking",!0);a(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError";}}function d(i){const{identity:t,columnKey:e,expectedPivotFieldIds:o}=i,s=((o==null?void 0:o.length)||0)===0;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.metricId!="string"||!t.metricId||typeof t.metricAlias!="string"||!t.metricAlias||!Array.isArray(t.members))throw new l(`Physical pivot column "${e}" is missing stable metric or member identity.`);if(t.members.forEach((r,n)=>{if(!r||typeof r!="object"||Array.isArray(r)||typeof r.fieldId!="string"||!r.fieldId||r.value!==null&&typeof r.value!="string"||r.temporalBucket!==void 0&&!u(r.temporalBucket).ok)throw new l(`Physical pivot column "${e}" has invalid identity for member ${n}.`);if(o&&r.fieldId!==o[n])throw new l(`Physical pivot column "${e}" has member "${r.fieldId}" at tuple position ${n}; expected "${o[n]||"no member"}".`);}),t.members.length===0){if(s)return t.members;throw new l(`Physical pivot column "${e}" is missing its required pivot tuple.`);}if(o&&t.members.length!==o.length)throw new l(`Physical pivot column "${e}" has ${t.members.length} members; expected ${o.length}.`);return t.members;}function m(i,t){i.forEach(e=>{e.pivotIdentity!==void 0&&d({identity:e.pivotIdentity,columnKey:e.key,expectedPivotFieldIds:t.expectedPivotFieldIds});});}function p(i,t,e){var s;const o=i==null?void 0:i.byRole;if(!(!o||typeof o!="object"||Array.isArray(o)))return(s=o[e])==null?void 0:s[t];}function h(i,t){if(!i)return;const e=i.byRole;if(!e||typeof e!="object"||Array.isArray(e))return;const o=Object.values(e).flatMap(r=>{const n=r==null?void 0:r[t];return n?[n]:[];});if(o.length!==1)return;const[s]=o;if(!(s.role==="metric"&&Object.values(i.byMetricAlias??{}).some(r=>r.role===s.role&&r.rawKey===s.rawKey&&r.outputKey===s.outputKey)))return s;}export{l as P,h as a,d as b,m as c,p as r};
1
+ var y=Object.defineProperty;var c=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>c(i,typeof t!="symbol"?t+"":t,e);import{v as u}from"./matrix-operation-contract-DceN49RX.js";class l extends Error{constructor(e){super(`missing_pivot_member_identity: ${e}`);a(this,"deliveryBlocking",!0);a(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError";}}function d(i){const{identity:t,columnKey:e,expectedPivotFieldIds:o}=i,s=((o==null?void 0:o.length)||0)===0;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.metricId!="string"||!t.metricId||typeof t.metricAlias!="string"||!t.metricAlias||!Array.isArray(t.members))throw new l(`Physical pivot column "${e}" is missing stable metric or member identity.`);if(t.members.forEach((r,n)=>{if(!r||typeof r!="object"||Array.isArray(r)||typeof r.fieldId!="string"||!r.fieldId||r.value!==null&&typeof r.value!="string"||r.temporalBucket!==void 0&&!u(r.temporalBucket).ok)throw new l(`Physical pivot column "${e}" has invalid identity for member ${n}.`);if(o&&r.fieldId!==o[n])throw new l(`Physical pivot column "${e}" has member "${r.fieldId}" at tuple position ${n}; expected "${o[n]||"no member"}".`);}),t.members.length===0){if(s)return t.members;throw new l(`Physical pivot column "${e}" is missing its required pivot tuple.`);}if(o&&t.members.length!==o.length)throw new l(`Physical pivot column "${e}" has ${t.members.length} members; expected ${o.length}.`);return t.members;}function m(i,t){i.forEach(e=>{e.pivotIdentity!==void 0&&d({identity:e.pivotIdentity,columnKey:e.key,expectedPivotFieldIds:t.expectedPivotFieldIds});});}function p(i,t,e){var s;const o=i==null?void 0:i.byRole;if(!(!o||typeof o!="object"||Array.isArray(o)))return(s=o[e])==null?void 0:s[t];}function h(i,t){if(!i)return;const e=i.byRole;if(!e||typeof e!="object"||Array.isArray(e))return;const o=Object.values(e).flatMap(r=>{const n=r==null?void 0:r[t];return n?[n]:[];});if(o.length!==1)return;const[s]=o;if(!(s.role==="metric"&&Object.values(i.byMetricAlias??{}).some(r=>r.role===s.role&&r.rawKey===s.rawKey&&r.outputKey===s.outputKey)))return s;}export{l as P,h as a,d as b,m as c,p as r};
@@ -1 +1 @@
1
- var xc=Object.defineProperty;var _c=(n,t,e)=>t in n?xc(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wr=(n,t,e)=>_c(n,typeof t!="symbol"?t+"":t,e);import{j as Uc,r as $c,aM as Si,k as Lc}from"./validators-Dg2kyF4_.js";import{R as Wc}from"./analytics-base-schemas-DMFrDqn_.js";const jc=globalThis.Temporal,zc=(n,t)=>`Non-positive ${n}: ${t}`,qc=(n,t)=>`Non-finite ${n}: ${t}`,Gc=n=>`Cannot convert bigint to ${n}`,Hc="Invalid object",jr=(n,t,e,o)=>Xt(n,t)+`; must be between ${e}-${o}`,Xt=(n,t)=>`Invalid ${n}: ${t}`,Vc=1e3,Kc=1e6,Jc=1e9,Xc=6e10,Qc=36e11;function Bn(n){return n===void 0?/* @__PURE__ */Object.create(null):Qt(n);}function Oi(n,t="number"){if(typeof n=="bigint")throw new TypeError(Gc(t));if(n=Number(n),!Number.isFinite(n))throw new RangeError(qc(t,n));return n;}function z(n,t){return Math.trunc(Oi(n,t))||0;}function zr(n,t){return ns(z(n,t),t);}function ns(n,t="number"){if(n<=0)throw new RangeError(zc(t,n));return n;}function ts(n,t,e){return Math.min(Math.max(n,t),e);}function Oe(n){return n!==null&&(typeof n=="object"||typeof n=="function");}function Qt(n){if(!Oe(n))throw new TypeError(Hc);return n;}const Mt=Xt,ne=n=>`Missing ${n}`,es="Invalid bag",Ci=(n,t,e)=>Xt(n,t)+"; must be "+Object.keys(e).join(),os="Cannot use valueOf",rs="Invalid calling context",Eo=n=>"Missing year"+(n?"/era/eraYear":""),tt="Invalid leap month",is=n=>Xt("Calendar",n),as=(n,t)=>`Unknown calendar ${n}; might need ${t}`,Fi=n=>Xt("TimeZone",n),$n="Out-of-bounds date",Zo=n=>`Cannot parse: ${n}`,ko=ts,J=Oe;function p(n){throw new RangeError(n);}function b(n){throw new TypeError(n);}function vo(n,t,e,o,r){return fn(t,((i,a)=>{const c=i[a];return c===void 0&&b(ne(a)),c;})(n,t),e,o,r);}function fn(n,t,e,o,r,i){const a=ko(t,e,o);return r&&t!==a&&p(((c,s,u,d,f)=>f?jr(c,f[s],f[u],f[d]):jr(c,s,u,d))(n,t,e,o,i)),a;}function It(n,t=Map,e=1e4){const o=new t();return(r,...i)=>{if(o.has(r))return o.get(r);o.size>=e&&o.clear();const a=n(r,...i);return o.set(r,a),a;};}const cs=n=>wo({name:n},1),wo=(n,t)=>Ot(e=>({value:e,configurable:1,writable:!t}),n),Bo=n=>({[Symbol.toStringTag]:{value:n,configurable:1}});function Ot(n,t){const e={};for(const o in t)e[o]=n(t[o],o);return e;}function te(n,t){const e={};for(const o of n)e[o]=t;return e;}function Pi(n){const t={};for(const e of n)t[e]=o=>o[e];return t;}function vn(n,t,e=/* @__PURE__ */Object.create(null)){for(const o of n)e[o]=t[o];return e;}function Ei(n,t,e){for(const o of n)if(t[o]!==e[o])return 0;return 1;}function ss(n,t,e){const o={...e};for(let r=0;r<t;r++)o[n[r]]=0;return o;}function q(n,...t){return(...e)=>n(...t,...e);}function qr(){}function Gr(n){return n[0].toUpperCase()+n.substring(1);}function w(...n){return[].concat(...n).sort();}function Ro(n){return new RegExp(`^${n}$`);}function jt(n){return parseInt(n.padEnd(9,"0"));}function tn(n){return n===void 0?0:parseInt(n);}function Ce(n,t){return String(t).padStart(n,"0");}const dn=/* @__PURE__ */q(Ce,2);function Cn(n,t){return Math.sign(n-t);}function V(n,t){return n<t?-1:n>t?1:0;}function Zi(n,t){const e=n/t;return n%t<0n?e-1n:e;}function Ao(n,t){const e=Zi(n,t);return[e,n-e*t];}function Fn(n,t){return[Math.floor(n/t),_e(n,t)];}function _e(n,t){return(n%t+t)%t;}function Ct(n,t){return Math.trunc(n/t)||0;}function Yo(n,t){return n%t||0;}function ki(n,t=1){return t*(0.5+n/5);}function Ie(n){return Math.abs(n%1)===0.5;}const wi="iso8601",us="gregory",ds={bce:-1,ce:0};function Bi(n){const t=n.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t;}const on=void 0,fs=0;function Tn(n){return n===on?"iso8601":n===0?"gregory":n.id;}const ms=/^M(\d{2})(L?)$/;function Ri(n){const t=ms.exec(n);return t||p((e=>`Invalid monthCode: ${e}`)(n)),[parseInt(t[1]),!!t[2]];}function Ai(n,t){return"M"+dn(n)+(t?"L":"");}function To(n,t,e){return n+(t||e&&n>=e?1:0);}const Do={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},xo=/* @__PURE__ */Object.keys(Do),ee=Vc,oe=Kc,it=Jc,re=Xc,ie=Qc,Rn=864e11,mn=[1,ee,oe,it,re,ie,Rn],ls=/* @__PURE__ */BigInt(ee),Ue=/* @__PURE__ */BigInt(oe),ot=/* @__PURE__ */BigInt(it),hs=/* @__PURE__ */BigInt(re),ys=/* @__PURE__ */BigInt(ie),C=/* @__PURE__ */BigInt(Rn);function Yi(n,t){const e=Number(n/C),o=Number(n%C);return e*(Rn/t)+(Math.trunc(o/t)+o%t/t);}const $=/* @__PURE__ */xo.slice(0,6),_o=/* @__PURE__ */Pi($),$e=["year"],at=["day"],Uo=["day","month","year"],Le=["offset"],$o=["timeZone"],Ft=["era","eraYear"],ps=["era","eraYear","year"],xi=["month","monthCode"],gs=["day","month","monthCode"],Mo=/* @__PURE__ */w($),vs=/* @__PURE__ */w(Ft,$e),ae=/* @__PURE__ */w(xi,$e),_i=/* @__PURE__ */w(Ft,ae),ce=/* @__PURE__ */w(["monthCode"],$e),Ui=/* @__PURE__ */w(Ft,ce),$i=/* @__PURE__ */w(at,["monthCode"]),ct=/* @__PURE__ */w(at,ae),st=/* @__PURE__ */w(at,Ft,ae),Li=/* @__PURE__ */w(ct,$),Wi=/* @__PURE__ */w(st,$),Ts=/* @__PURE__ */w(ct,$,Le),Ds=/* @__PURE__ */w(st,$,Le),ji=/* @__PURE__ */w(ct,$,Le,$o),zi=/* @__PURE__ */w(st,$,Le,$o),Ms=/* @__PURE__ */w(at,ce),Is=/* @__PURE__ */w(at,Ft,ce),Dn=/* @__PURE__ */te($,0);function qi(n){return We(n,1),n;}const Ns={hour:23,minute:59,second:59};function We(n,t){const e={};for(const o of $)e[o]=fn(o,n[o],0,Ns[o]||999,t);return e;}function rn(n){return Lo(n)*it+Hi(n);}function Gi(n){return 1e3*Lo(n)+n.millisecond;}function Lo(n){return 3600*n.hour+60*n.minute+n.second;}function Hi(n){return n.millisecond*oe+n.microsecond*ee+n.nanosecond;}function Wo(n){const[t,e]=Fn(n,Rn);return[Vi(e),t];}function Vi(n){const[t,e]=Fn(n,oe),[o,r]=Fn(e,ee);return bs(t,o,r);}function bs(n,t=0,e=0){const[o,r]=Fn(n,36e5),[i,a]=Fn(r,6e4),[c,s]=Fn(a,1e3);return{hour:o,minute:i,second:c,millisecond:s,microsecond:t,nanosecond:e};}function Hr(n){const[t,e]=Ao(n,ot);return[Number(t),Number(e)];}function Fe(n){return Number(Zi(n,Ue));}function j(n){return Ln(n)+BigInt(rn(n));}function Ss(n){return je(n)+Gi(n);}function Ln(n){return BigInt(Mn(n))*C;}function je(n){return 864e5*Mn(n);}function Mn(n){return zt(n.year,n.month,n.day);}function zt(n,t=1,e=1){const o=t-1;return n+=Math.floor(o/12),t=_e(o,12),Date.UTC(n%400-400,t,0)/864e5+146097*(Ct(n,400)+1)+e;}function se(n){const[t,e]=Ao(n,C);return{...Ki(Number(t)),...Vi(Number(e))};}function Ki(n){const t=new Date(864e5*_e(n,146097));return{year:t.getUTCFullYear()+400*Math.floor(n/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()};}const Os=1972;function Cs(n){return[n,0];}function Io(n,t){if(!t)return{year:1972,month:n};}function Fs(n,t,e){return{year:n,month:t,day:e};}function Ji(n,t){switch(t){case 2:return ze(n)?29:28;case 4:case 6:case 9:case 11:return 30;}return 31;}function Ps(n){return ze(n)?366:365;}function ze(n){return n%4==0&&(n%100!=0||n%400==0);}function Es(n,t,e){return n+=Ct(e,12),(t+=Yo(e,12))<1?(n--,t+=12):t>12&&(n++,t-=12),{year:n,month:t};}function Zs(n,t,e,o){return 12*(e-n)+o-t;}function jo(n){return _e(zt(n.year,n.month,n.day)+4,7)||7;}function Xi(n){return zt(n.year,n.month,n.day)-zt(n.year)+1;}function Qi(n){let t=n.year,e=Math.floor((Xi(n)-jo(n)+10)/7),o=uo(t);return e<1?e=o=uo(--t):e>o&&(e=1,o=uo(++t)),{weekOfYear:e,yearOfWeek:t,De:o};}function uo(n){const t=jo({year:n,month:1,day:1});return t===4||t===3&&ze(n)?53:52;}function ks({year:n}){return n<1?{era:"bce",eraYear:1-n}:{era:"ce",eraYear:n};}function ws(n){return ue(n),qi(n);}function ue(n){return na(n,1),n;}function na(n,t){const{year:e}=n,o=vo(n,"month",1,12,t);return{year:e,month:o,day:vo(n,"day",1,Ji(e,o),t)};}function O(n,t){return n?n.de(t):t;}function rt(n,t,e){return n?n.L(t,e):Cs(e);}function Pe(n,t){var e;return n===0?ks(t):n&&((e=n.h)==null?void 0:e.call(n,t))||{};}function ut(n,t,e,o){return n?n.fe(t,e,o):Fs(t,e,o);}function qt(n,t){return n?n.j(t):12;}function Gt(n,t,e){return n?n.o(t,e):Ji(t,e);}function zo(n,t){const{year:e,month:o}=O(n,t),[r,i]=rt(n,e,o);return Ai(r,i);}function ta(n,t){const{year:e}=O(n,t);return n?n.q(e):ze(e);}function ea(n,t){const{year:e}=O(n,t);return qt(n,e);}function oa(n,t){const{year:e,month:o}=O(n,t);return Gt(n,e,o);}function ra(n,t){const{year:e}=O(n,t);return n?n.i(e):Ps(e);}function Bs(n,t){if(!n)return Xi(t);const{year:e}=O(n,t),o=ut(n,e,1,1);return Mn(t)-Mn(o)+1;}function Rs(n,t){return n===on?Qi(t).weekOfYear:void 0;}function As(n,t){return n===on?Qi(t).yearOfWeek:void 0;}const S=/* @__PURE__ */xo.map(n=>n+"s"),Ys=/* @__PURE__ */Pi(S),ia=/* @__PURE__ */w(S),xs=/* @__PURE__ */S.slice(0,6),aa=/* @__PURE__ */S.slice(6),_s=/* @__PURE__ */aa.slice(1),k=/* @__PURE__ */te(S,0),qo=/* @__PURE__ */te(xs,0),Go=/* @__PURE__ */q(ss,S);function ca(n,t){return t==null&&p(ne(n)),t;}const G=/* @__PURE__ */q(Us,"string");function Us(n,t,e=n){return typeof t!==n&&b(Mt(e,t)),t;}function $s(n,t="number"){return Number.isInteger(n)||p(((e,o)=>`Non-integer ${e}: ${o}`)(t,n)),n||0;}function qe(n){return typeof n=="symbol"&&b("Cannot convert Symbol to string"),String(n);}function Ho(n){if(!Oe(n))return n;const t=n[Symbol.toPrimitive];if(t!=null){typeof t!="function"&&b();const e=Reflect.apply(t,n,["string"]);return Oe(e)&&b(),e;}return Date.prototype[Symbol.toPrimitive].call(n,"string");}function Vo(n){return typeof n=="boolean"?BigInt(n?1:0):typeof n=="string"?BigInt(n):(typeof n!="bigint"&&b(`Invalid bigint: ${n}`),n);}function Ko(n,t){return $s(Oi(n,t),t);}const Pn="smallestUnit",Ls={constrain:0,reject:1},Ws={compatible:0,reject:1,earlier:2,later:3},js={reject:0,use:1,prefer:2,ignore:3},zs={auto:0,never:1,critical:2,always:3},qs={auto:0,never:1,critical:2},Gs={auto:0,never:1},Hs={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Vs=[Math.floor,n=>Ie(n)?Math.floor(n):Math.round(n),Math.ceil,n=>Ie(n)?Math.ceil(n):Math.round(n),Math.trunc,n=>Ie(n)?Math.trunc(n)||0:Math.round(n),n=>n<0?Math.floor(n):Math.ceil(n),n=>Math.sign(n)*Math.round(Math.abs(n))||0,n=>Ie(n)?(n=Math.trunc(n)||0)+n%2:Math.round(n)],Ks={previous:-1,next:1};function Jo(n){const t=n.roundingIncrement;if(t===void 0)return 1;const e=z(t,"roundingIncrement");return(e<1||e>10**9)&&p(Mt("roundingIncrement",e)),e;}function Xo(n){let t=n.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(qe(t)==="auto")return;p(Mt("fractionalSecondDigits",t));}t=fn("fractionalSecondDigits",Math.floor(t),0,9,1);}return t;}function Qo(n,t,e=0,o){let r=t[n];if(r===void 0)return o?e:void 0;if(r=qe(r),r==="auto")return o?e:null;let i=Do[r];return i===void 0&&(i=S.indexOf(r)),i<0&&p(Ci(n,r,Do)),i;}function qn(n,t,e,o=0){const r=e[n];if(r===void 0)return o;const i=qe(r),a=t[i];return a===void 0&&p(Ci(n,i,t)),a;}const Pt=/* @__PURE__ */q(Qo,Pn),sa=/* @__PURE__ */q(Qo,"largestUnit"),Js=/* @__PURE__ */q(Qo,"unit"),ua=/* @__PURE__ */q(qn,"overflow",Ls),da=/* @__PURE__ */q(qn,"disambiguation",Ws),Xs=/* @__PURE__ */q(qn,"offset",js),nr=/* @__PURE__ */q(qn,"calendarName",zs),Qs=/* @__PURE__ */q(qn,"timeZoneName",qs),nu=/* @__PURE__ */q(qn,"offset",Gs),Et=/* @__PURE__ */q(qn,"roundingMode",Hs),tu=/* @__PURE__ */q(qn,"direction",Ks);function Ge(n,t){return typeof n=="string"?((e,o)=>{const r=/* @__PURE__ */Object.create(null);return r[e]=o,r;})(t,n):Qt(n);}function tr(n,t,e,o){const r=o?Rn:mn[t+1];if(r){const i=n*mn[t];(r%i||!o&&i===r)&&p(Mt("roundingIncrement",n));}else!e&&n>1&&p(Mt("roundingIncrement",n));return n;}function Nt(n,t,e,o){return t!=null&&fn(n,t,e,o,1,xo),t;}function fa(n,t){t>n&&p("smallestUnit > largestUnit");}function Zt(n,t,e,o=9,r=0,i=4){t=Bn(t);let a=sa(t,r),c=Jo(t),s=Et(t,i),u=Pt(t,r,1);return a=Nt("largestUnit",a,r,o),u=Nt(Pn,u,r,o),a==null?a=Math.max(e,u):fa(a,u),c=tr(c,u,1),n&&(s=(d=>d<4?(d+2)%4:d)(s)),[a,u,c,s];}function He(n,t=6,e){let o=Jo(n=Ge(n,Pn));const r=Et(n,7);let i=Pt(n);return i=ca(Pn,i),i=Nt(Pn,i,0,t),o=tr(o,i,void 0,e),[i,o,r];}function P(n,t){return vn(Uo,n,vn($,t));}const er=/* @__PURE__ */BigInt(1e8)*C,or=/* @__PURE__ */BigInt(-1e8)*C,ma=or-C;function Ee(n){const t=12*n.year+n.month;return(t<-3261848||t>3309129)&&p($n),n;}function an(n,t=1){const e=Ln(n);return(e<(t?ma:or)||e>er)&&p($n),n;}function kt(n){return eu(j(n)),n;}function eu(n){return(n<=ma||n>=er+C)&&p($n),n;}function In(n){return(n<or||n>er)&&p($n),n;}function rr(n,t){return In(Ln(n)+BigInt(rn(n)-t));}function bt(n,t,e){return ir(n/t,e)*t||0;}function ir(n,t){return Vs[t](n);}function ou(n,t,e,o){const r=la(n,t,o,e);return ha(r,Number(e-r.N)/Number(r.te-r.N));}function ru(n,t,e,o){return bt(ha(n,ya(t,n.N,n.te)),e,o);}function la(n,t,e,o){let r=Vr(n,t,e);return((i,a,c,s)=>s>0?a<=i&&i<=c:c<=i&&i<=a)(o,r.N,r.te,Math.sign(t))||(r=Vr(n+t,t,e)),r;}function Vr(n,t,e){const o=n+t;return{ve:n,pe:o,N:e(n),te:e(o)};}function ha(n,t){return n.ve+t*(n.pe-n.ve);}function ya(n,t,e){const o=e-t,r=n-t;if(!r)return 0;const i=r<0n?-r:r,a=o<0n?-o:o,c=V(r,0n)===V(o,0n)?1:-1;return V(i,a)<=0?i===a?c:ki(V(2n*i,a),c):Number(r)/Number(o);}function gn(n){return{epochNanoseconds:n};}function ln(n,t,e){return{calendar:e,timeZone:t,epochNanoseconds:n};}function Sn(n,t){return vn($,n,F(n,t));}function F(n,t){return vn(Uo,n,{calendar:t});}function wt(n){return vn($,n);}function En(n){return vn(S,n,{sign:Rt(n)});}function iu(n,t,e,o){return ln(t===6?uu(n,o):du(n,t,e,o),n.timeZone,n.calendar);}function au(n){const[t,e]=va(n);return Yi(e-t,ie);}function cu(n){const{timeZone:t,calendar:e}=n;return ln(St(t,P(A(n),Dn)),t,e);}function Ve(n,t,e,o,r,i,a,c){if(o===0&&r===1)return n;const s=Rt(n)||1,u=Be(o,c)?c&&o<6&&e>=6?lu:hu:mu;let[d,f,m]=u(s,n,t,e,o,r,i,a);return m&&o!==7&&(d=((l,g,y,h,v,T)=>{for(let N=h+1;N<=y;N++){if(N===7&&y!==7)continue;const I=Go(N,l);I[S[N]]+=v;const x=V(g,dr(T,I));if(x&&x!==v)break;l=I;}return l;})(d,f,e,Math.max(6,o),s,a)),d;}function su(n,t,e){const o=Math.max(Math.min(kn(n),6),3);return jn(Ke(Zn(n),BigInt(t),e),o);}function uu(n,t){const[e,o]=va(n);return yu(n.epochNanoseconds,e,o,t);}function du(n,t,e,o){if(t===0&&e===1)return n.epochNanoseconds;const r=A(n);return gu(n.timeZone,pa(r,t,e,o),r.offsetNanoseconds);}function pa(n,t,e,o){return ga(n,Je(t,e),o,mn[t+1]);}function fu(n,t,e,o){return ar(n,Je(t,e),o,mn[t+1]);}function ga(n,t,e,o){const[r,i]=ar(n,t,e,o),a=P(Bt(n,i),r);return kt(a),a;}function ar(n,t,e,o=Rn){const r=rn(n),i=r%o;return Wo(r-i+bt(i,t,e));}function mu(n,t,e,o,r,i,a,c){const s=S[r],u=Go(r,t);r===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const d=Ct(t[s],i)*i,f=la(d,i*n,l=>(u[s]=l,dr(c,u)),e),m=ru(f,e,i,a);return u[s]=m,[u,m===f.pe?f.te:f.N,m!==d];}function lu(n,t,e,o,r,i,a,c){const s=Number(At(t)),u=Je(r,i);let d=bt(s,u,a);const f={...t,...qo},m=c.X(f),l=c.X({...f,days:f.days+n}),g=Number(l-m);Math.sign(g)!==n&&p("Out-of-bounds TimeZone gap");const y=d-g;let h=0,v;y&&Math.sign(y)!==n?v=m+BigInt(d):(h+=n,d=bt(y,u,a),v=l+BigInt(d));const T=to(d);return[{...t,...T,days:t.days+h},v,!!h];}function hu(n,t,e,o,r,i,a){const c=Zn(t),s=Ke(c,Xe(r,i),a),u=s-c,d=Math.sign(Number(s/C)-Number(c/C))===n,f=jn(s,Math.min(o,6));return[{...t,...f},e+u,d];}function va(n){const{timeZone:t}=n,e=P(A(n),Dn),o=P(Bt(e,1),Dn);return[St(t,e),St(t,o)];}function yu(n,t,e,o){return ir(ya(n<e?n:e-1n,t,e),o)?e:t;}function Ze(n){return bt(n,re,7);}function Ke(n,t,e){return Ta(n,t,e,n/t%2n);}function cr(n,t,e){const[o,r]=Ao(n,C),i=o*C;return i+Ta(r,t,e,i/t+r/t&1n);}function Ta(n,t,e,o){const r=n/t,i=n%t;let a=0;i&&(a=ki(V(2n*(i<0n?-i:i),t),Math.sign(Number(i))));const c=ir(Number(o)+a,e);return(r-o+BigInt(c))*t;}function Je(n,t){return mn[n]*t;}function Xe(n,t){return BigInt(mn[n])*BigInt(t);}const A=/* @__PURE__ */It(pu,WeakMap);function pu(n){const{epochNanoseconds:t,timeZone:e}=n,o=e.B(t);return{...se(t+BigInt(o)),offsetNanoseconds:o};}function gu(n,t,e){return de(n,t,e,2,0);}function de(n,t,e,o=0,r=0,i,a){if(a||e!==void 0&&o===1)return rr(t,e||0);const c=n.O(t);if(e!==void 0&&o!==3){an(t,0);const s=((u,d,f,m)=>{const l=j(d);m&&(f=Ze(f));for(const g of u){let y=Number(l-g);if(m&&(y=Ze(y)),y===f)return g;}})(c,t,e,i);if(s!==void 0)return s;o===0&&p("Invalid TimeZone offset");}return dt(n,t,r,c);}function dt(n,t,e=0,o=n.O(t)){if(o.length===1)return o[0];if(e===1&&p("Ambiguous offset"),o.length)return o[e===3?1:0];const r=j(t),i=((c,s)=>{const u=c.B(s-C);return(d=>(d>Rn&&p("Out-of-bounds TimeZone gap"),d))(c.B(s+C)-u);})(n,r),a=se(r+BigInt(i*(e===2?-1:1)));return(o=n.O(a))[e===2?0:o.length-1];}function St(n,t){const e=n.O(t);if(e.length)return e[0];const o=j(t)-C;return n.C(o,1);}function Kr(n,t,e,o=0){Rt(e)&&fn("unit",kn(e),8,9,1,S);const r=an(Ht(n,t));return Ht(n,Wn(n,r,e,o));}function ke(n,t,e=0){const{calendar:o,epochNanoseconds:r,timeZone:i}=n,a=At(t);let c=r;if(Ea(t)){const s=A(n);c=dt(i,P(Wn(o,s,{...t,...qo},e),s))+a;}else c+=a;return{...n,epochNanoseconds:In(c)};}function we(n,t,e,o=0){const[r,i]=No(t,e);return kt(P(Wn(n,t,{...e,...qo,days:e.days+i},o),r));}function No(n,t){return vu(n,At(t));}function Jr(n,t){return Tu(n,(fn("unit",kn(e=t),0,5,1,S),At(e)));var e;}function Wn(n,t,e,o=0){let{years:r,months:i,weeks:a,days:c}=e,s;if(c+=Number(At(e)/C),r||i)s=bo(n,t,r,i,o);else{if(!a&&!c)return t;s=t;}return(a||c)&&(s=Bt(s,7*a+c)),an(s);}function Ht(n,t){return Bt(t,1-O(n,t).day);}function bo(n,t,e,o,r){const i=O(n,t);let{year:a,month:c,day:s}=i;if(e){const[u,d]=rt(n,a,c);a+=e,c=So(n,u,d,n?n.p(a):void 0,r),c=fn("month",c,1,qt(n,a),r);}return o&&({year:a,month:c}=Da(n,a,c,o)),s=fn("day",s,1,Gt(n,a,c),r),ut(n,a,c,s);}function Da(n,t,e,o){return n?n.ae(t,e,o):Es(t,e,o);}function So(n,t,e,o,r){if(e){const i=n?n.l:void 0;if(o!==void 0&&(i<0||o===t+1))return o;if(r===1&&p(tt),i<0)return-i;}return To(t,0,o);}function vu(n,t){const e=Number(t/C),o=Number(t%C),[r,i]=Wo(rn(n)+o);return[r,e+i];}function Tu(n,t){return In(n+t);}function Bt(n,t){return t?Ki(Mn(n)+t):n;}function Qe(n,t){return Tn(n)!==Tn(t)&&p("Mismatching Calendars"),n;}function Du(n,t){return n.m!==t.m&&p("Mismatching TimeZones"),n;}function Mu(n){return n.timeZone.id;}function Iu(n,t,e,o,r,i,a){return o<6?no(t.epochNanoseconds,e.epochNanoseconds,o,r,i,a):((c,s,u,d,f,m,l)=>{const g=Du(s.timeZone,u.timeZone),y=u.epochNanoseconds;if(y===s.epochNanoseconds)return k;let h;return h=Ia(g,c,s,u,d),h=Ve(h,y,d,f,m,l,Sa(c,g,s),1),h;})(n,t,e,o,r,i,a);}function Nu(n,t,e,o,r,i,a){return o<=6?no(j(t),j(e),o,r,i,a):((c,s,u,d,f,m,l)=>{const g=j(u),y=V(g,j(s));if(!y)return k;let h;return h=Na(c,s,u,y,d),h=Ve(h,g,d,f,m,l,((v,T)=>({ne:j(T),X:N=>j(P(Wn(v,T,N),T))}))(c,s)),h;})(n,t,e,o,r,i,a);}function bu(n,t,e,o,r,i,a){const c=Ht(n,t),s=Ht(n,e);return ur(c,s)?Ma(n,an(c),an(s),o,r,i,a,8):k;}function Su(n,t,e,o,r,i,a,c=6){return o===6?no(Ln(t),Ln(e),o,r,i,a):Ma(n,t,e,o,r,i,a,c);}function Ou(n,t,e,o,r,i){const a=bt(rn(t)-rn(n),Je(o,r),i);return{...k,...to(a,e)};}function Ma(n,t,e,o,r,i,a,c=6){const s=Ln(e);if(!ur(t,e))return k;let u;return u=sr(n,t,e,o),r===c&&i===1||(u=Ve(u,s,o,r,i,a,Oa(n,t))),u;}function no(n,t,e,o,r,i){return{...k,...jn(Ke(t-n,Xe(o,r),i),e)};}function Ia(n,t,e,o,r){return r<6?{...k,...jn(o.epochNanoseconds-e.epochNanoseconds,r)}:((i,a,c)=>{const s=V(c.epochNanoseconds,a.epochNanoseconds);if(!s)return k;if(!ur(A(a),A(c)))return{...k,...jn(c.epochNanoseconds-a.epochNanoseconds,5)};const[u,d,f]=Fu(i,a,c,s);return{...(m=u,l=d,sr(t,m,l,r)),...to(f)};var m,l;})(n,e,o);}function Cu(n,t,e,o){const r=j(t),i=j(e),a=V(i,r);return a?o<=6?{...k,...jn(i-r,o)}:Na(n,t,e,a,o):k;}function Na(n,t,e,o,r){let i=e,a=rn(e)-rn(t);return Math.sign(a)===-o&&(i=Bt(e,-o),a+=Rn*o),{...sr(n,t,i,r),...to(a)};}function Fu(n,t,e,o){const r=A(t),i=A(e),a=e.epochNanoseconds;let c=0;const s=rn(i)-rn(r);Math.sign(s)===-o&&c++;const u=o>0?2:1;for(;;c++){const d=Bt(i,c*-o),f=dt(n,P(d,r));if(c===u||V(a,f)!==-o)return[r,d,Number(a-f)];}}function sr(n,t,e,o){if(o<=7)return((y,h,v)=>{const T=fo(h,v);return y?{...k,weeks:Ct(T,7),days:Yo(T,7)}:{...k,days:T};})(o===7,t,e);const r=O(n,t),i=O(n,e);if(o===8){const{year:y,month:h,day:v}=r,{year:T,month:N,day:I}=i,x=Math.sign(Cn(T,y)||Cn(N,h)||fo(t,e));let _=0,sn=0;if(x){_=n?n.ee(y,h,T,N):Zs(y,h,T,N);let X=bo(n,t,0,_,0);x*Cn(v,I)>0&&(_-=x,X=bo(n,t,0,_,0)),sn=fo(X,e);}return{...k,months:_,days:sn};}const{year:a,month:c,day:s}=r;let{year:u,month:d,day:f}=i,m=u-a,l=d-c,g=f-s;if(m||l){const y=Math.sign(m||l);let h=Gt(n,u,d),v=0;if(Math.sign(f-s)===-y){const T=h;({year:u,month:d}=Da(n,u,d,-y)),m=u-a,l=d-c,h=Gt(n,u,d),v=y<0?-T:h;}if(g=f-Math.min(s,h)+v,m){const[T,N]=rt(n,a,c),[I,x]=rt(n,u,d),_=n?n.l:void 0;if(l=_!==void 0&&N&&!x&&(_<0?y>0&&I===-_:y<0&&I===T)?0:I-T||Number(x)-Number(N),Math.sign(l)===-y){const sn=y<0&&-qt(n,u);u-=y,m=u-a,l=d-So(n,T,N,n?n.p(u):void 0,0)+(sn||qt(n,u));}else if(n){const sn=So(n,T,N,n.p(u),0);l=n.ee(u,sn,u,d);}}}return{...k,years:m,months:l,days:g};}function ur(n,t){return Cn(n.year,t.year)||Cn(n.month,t.month)||Cn(n.day,t.day);}function fo(n,t){return Mn(t)-Mn(n);}function ba(n,t,e){return fe(n)?((o,r,i)=>{const{calendar:a,timeZone:c}=o,s=ke(o,r);return[Ia(c,a,o,s,i),s.epochNanoseconds,Sa(a,c,o)];})(n,t,e):((o,r,i)=>{const{calendar:a}=o,c=kt(P(o,Dn)),s=we(a,c,r);return[Cu(a,c,s,i),j(s),Oa(a,o)];})(n,t,e);}function Xr(n,t){return fe(n)?ke(n,t).epochNanoseconds:j(we(n.calendar,P(n,Dn),t));}function dr(n,t){return Ea(t)?n.X(t):n.ne;}function Sa(n,t,e){const o=A(e);return{ne:e.epochNanoseconds,X:r=>dt(t,P(Wn(n,o,r),o))};}function Oa(n,t){return{ne:Ln(t),X:e=>Ln(Wn(n,t,e))};}function fe(n){return"timeZone"in n;}function Be(n,t){return n<=6-(t?1:0);}function fr(n,t,e){const o={};for(let r=t;r>=0;r--){const i=mn[r];o[e[r]]=Ct(n,i),n=Yo(n,i);}return o;}const Pu=2**53;function Qr(n,t,e){const o=Math.max(kn(t),kn(e));return fn("unit",o,0,6,1,S),((r,i,a,c)=>En(ft(((s,u,d,f)=>{const m=Zn(s)+Zn(u)*BigInt(f?-1:1);return Number.isFinite(Number(m/C))||p($n),{...k,...jn(m,d)};})(i,a,c,r))))(n,t,e,o);}function Eu(n,t,e){const o=kn(t),[r,i,a,c,s]=((l,g,y)=>{l=Ge(l,Pn);let h=sa(l);const v=y(l.relativeTo);let T=Jo(l);const N=Et(l,7);let I=Pt(l);return h===void 0&&I===void 0&&p("Required smallestUnit or largestUnit"),I==null&&(I=0),h==null&&(h=Math.max(I,g)),fa(h,I),T=tr(T,I,1),T>1&&I>5&&h!==I&&p("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[h,I,T,N,v];})(e,o,n);if(!s&&Math.max(o,r)<=6)return En(ft(((l,g,y,h,v)=>{const T=Ke(Zn(l),Xe(y,h),v);return{...k,...jn(T,g)};})(t,r,i,a,c)));s||p("Missing relativeTo");const u=fe(s);if(!t.sign&&(!u||r<6))return t;const[d,f,m]=ba(s,t,r);return En(Ve(d,f,r,i,a,c,m,u));}function Zu(n){return n.sign===-1?Ca(n):n;}function Ca(n){return En(Nn(n));}function Nn(n){const t={};for(const e of S)t[e]=-1*n[e]||0;return t;}function Rt(n,t=S){let e=0;for(const o of t){const r=Math.sign(n[o]);r&&(e&&e!==r&&p("Cannot mix duration signs"),e=r);}return e;}function ft(n){for(const e of _s)ku(e,n[e]);const t=Zn(n);return Fa(Number(t/ot)),n;}function ku(n,t){return fn(n,t,-4294967295,4294967295,1);}function Fa(n){Number.isSafeInteger(n)||p("Out-of-bounds duration");}function Zn(n){return BigInt(n.days)*C+At(n);}function At(n){return BigInt(n.hours)*ys+BigInt(n.minutes)*hs+Pa(n);}function Pa(n){return BigInt(n.seconds)*ot+BigInt(n.milliseconds)*Ue+BigInt(n.microseconds)*ls+BigInt(n.nanoseconds);}function jn(n,t=6){const e=Number(n/C),o=Number(n%C),r=mn[t],i=t<=3?Number(n/BigInt(r)):e*(Rn/r)+Ct(o,r);Number.isFinite(i)||p($n),t<=3&&Math.abs(i)/(it/mn[t])>=Pu&&p($n);const a=fr(o,t,S);return a[S[t]]=i,a;}function to(n,t=5){return fr(n,t,S);}function Ea(n){return!!Rt(n,aa);}function kn(n){let t=9;for(;t>0&&!n[S[t]];t--);return t;}function eo(n,t){return V(n.epochNanoseconds,t.epochNanoseconds);}function wu(n,t,e,o){const r=n(Bn(o).relativeTo),i=Math.max(kn(t),kn(e));return Ei(S,t,e)?0:Be(i,r&&fe(r))?V(Zn(t),Zn(e)):(r||p("Missing relativeTo"),V(Xr(r,t),Xr(r,e)));}function Za(n,t){return Yt(n,t)||mr(n,t);}function Yt(n,t){return Cn(Mn(n),Mn(t));}function mr(n,t){return Cn(rn(n),rn(t));}function Bu(n,t){return!eo(n,t);}function Ru(n,t){return!eo(n,t)&&n.timeZone.m===t.timeZone.m&&n.calendar===t.calendar;}function Au(n,t){return!Za(n,t)&&n.calendar===t.calendar;}function Yu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function xu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function _u(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function Uu(n,t){return!mr(n,t);}function me(n){return n===0?ds:n?n.k:void 0;}function L(n,t,e=t){return me(n)?e:t;}function ka(n,t){const e=t||void 0,o=me(t);let{era:r,eraYear:i,year:a}=n;if(a!==void 0&&(a=z(a,"year")),i!==void 0&&(i=z(i,"eraYear")),r!==void 0||i!==void 0){r!==void 0&&i!==void 0||b("Mismatching era/eraYear"),o||p("Forbidden era/eraYear");const c=Bi(r),s=o[c];s===void 0&&p((d=>`Invalid era: ${d}`)(r));const u=e!=null&&e._?e._(i,c,s):$u(i,s);a!==void 0&&a!==u&&p("Mismatching year/eraYear"),a=u;}else a===void 0&&b(Eo(o));return a;}function Re(n,t,e,o,r){let{month:i,monthCode:a}=n;if(a!==void 0){const c=((s,u,d,f,m=Ri(u))=>{const l=s?s.p(d):void 0,[g,y]=m;let h=To(g,y,l);if(y){const v=s?s.l:void 0;v===void 0&&p(tt),v>0?(h>v&&p(tt),l!==h&&(f===1&&p(tt),h=To(g,0,l))):(h!==-v&&p(tt),l===void 0&&f===1&&p(tt));}return h;})(t,a,e,r,o);i!==void 0&&i!==c&&p("Mismatching month/monthCode"),i=c,r=1;}else i===void 0&&b("Missing month/monthCode");return fn("month",i,1,qt(t,e),r);}function Oo(n,t,e,o,r){return vo(n,"day",1,Gt(t,e,o),r);}function $u(n,t){return(t+n)*(Math.sign(t)||1)||0;}function le(n,t){return We(vn($,{...Dn,...n}),t);}const Lu=/^([+-])([01]\d|2[0-3])(?:(:?)([0-5]\d)(?:\3([0-5]\d)(?:[.,](\d{1,9}))?)?)?$/;function lr(n){const t=wa(n);return t===void 0&&p(Zo(n)),t;}function wa(n,t){const e=Lu.exec(n);if(e)return t&&e[5]&&p(Zo(n)),/* @__PURE__ */(o=>o&&o!=="+"?-1:1)(e[1])*(parseInt(e[2])*ie+tn(e[4])*re+tn(e[5])*it+jt(e[6]||""));}const cn={era:qe,month:zr,monthCode(n,t){return G(Ho(n),t);},day:zr},hr=/* @__PURE__ */te($,z),Ba=/* @__PURE__ */te(S,Ko),yr=/* @__PURE__ */Object.assign({},cn,hr),pr={offset(n){return lr(G(Ho(n)));},...yr};function E(n,t,e,o,r=!o){const i={};let a=0;for(const c of t){let s=n[c];if(s!==void 0){a=1;const u=e[c];u&&(s=u(s,c)),i[c]=s;}else o&&o.includes(c)&&b(ne(c));}return r&&!a&&b("No valid fields: "+t.join()),i;}function D(n){return n===void 0?0:ua(Qt(n));}function Vt(n,t=0){n=Bn(n);const e=da(n),o=Xs(n,t);return[ua(n),o,e];}function Wu(n){return da(Bn(n));}function hn(n,t,e){const o=me(t);n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o)),n.monthCode===void 0&&n.month===void 0&&b("Missing month/monthCode"),e||n.day!==void 0||b(ne("day"));const r=Ra(n);return[ka(n,t),r];}function gr(n,t){const e=t===on,o=me(t);n.day===void 0&&b(ne("day")),e||n.month===void 0||n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o));const r=Ra(n);return[n.eraYear!==void 0||n.year!==void 0?ka(n,t):void 0,r];}function oo(n,t=Dn,e){const o=P(n,t);return kt(o),Sn(o,e);}function Gn(n,t,e,o,r){const i=Re(n,t,e,o,r);return F(an(ut(t,e,i,Oo(n,t,e,i,r))),t);}function vr(n,t,e,o,r){return ju(t,e,Re(n,t,e,o,r));}function Tr(n,t,e,o,r){var d;const i=t===on;let a=e,c,s,u;if(a===void 0&&i&&(a=1972),a!==void 0){i||an(ut(t,a,1,1));const f=Re(n,t,a,o,r);c=Oo(n,t,a,f,r),[s,u]=rt(t,a,f);}else{n.monthCode===void 0&&b("Missing month/monthCode"),[s,u]=o;const f=t?t.re:1972;if(f!==void 0)c=Oo(n,t,f,Re(n,t,f,o,r),r);else{const m=r===0&&t?(d=t.ge)==null?void 0:d.call(t,s,u,n.day):void 0;c=m!==void 0?m:n.day;}}return zu(t,s,u,c,n.day,r);}function ju(n,t,e){return F(Ee(ut(n,t,e,1)),n);}function zu(n,t,e,o,r,i){var d;let a=e;a&&((n&&((d=n.U)==null?void 0:d[t]))??1/0)<r&&(i===1&&p(tt),a=0,o=ko(r,1,(n&&n.R)??1/0));let c=n?n.u(t,!!a,o):Io(t,!!a);for(;!c&&i===0&&o>1;)o--,c=n?n.u(t,!!a,o):Io(t,!!a);c||p("Cannot guess year");const{year:s,month:u}=c;return F(an(ut(n,s,u,o)),n);}function Ra(n){if(n.monthCode!==void 0)return Ri(n.monthCode);}const An=Intl.DateTimeFormat;function qu(n,t){t<-864e13&&p($n);const e=n.formatToParts(t),o={};for(const r of e)o[r.type]=r.value;return o;}const Gu={El_Aaiun:16,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Ne=-4e9;function Aa(n,t=4){const e=Xo(n),o=Et(n,4),r=Pt(n);return[o,...Mr(Nt(Pn,r,0,t),e)];}function Dr(n){return nr(Bn(n));}function Ya(n,t){return Aa(Bn(n),t);}function Mr(n,t){return n!=null?[mn[n],n<4?9-3*n:-1]:[t===void 0?1:10**(9-t),t];}function ni(n,t,e){const[o,r,i,a]=(s=>{const u=Xo(s=Bn(s)),d=Et(s,4),f=Pt(s);return[s.timeZone,d,...Mr(Nt(Pn,f,0,4),u)];})(e),c=o!==void 0;return((s,u,d,f,m,l)=>{d=cr(d,BigInt(m),f);const g=u.B(d);return Ir(se(d+BigInt(g)),l)+(s?ro(Ze(g)):"Z");})(c,K(c?n(o):"UTC"),t.epochNanoseconds,r,i,a);}function ti(n,t){const e=(o=>{o=Bn(o);const r=nr(o),i=Xo(o),a=nu(o),c=Et(o,4),s=Pt(o);return[r,Qs(o),a,c,...Mr(Nt(Pn,s,0,4),i)];})(t);return((o,r,i,a,c,s,u,d,f,m)=>{a=cr(a,BigInt(f),d);const l=i.B(a);return Ir(se(a+BigInt(l)),m)+ro(Ze(l),u)+Ku(r,s)+Nr(o,c);})(n.calendar,n.timeZone.id,n.timeZone,n.epochNanoseconds,...e);}function ei(n,t){const e=(o=>(o=Bn(o),[nr(o),...Aa(o)]))(t);return((o,r,i,a,c,s)=>Ir(ga(r,c,a),s)+Nr(o,i))(n.calendar,n,...e);}function oi(n,t){return e=n.calendar,o=n,r=Dr(t),Ae(o)+Nr(e,r);var e,o,r;}function ri(n,t){return xa(n.calendar,_a,n,Dr(t));}function ii(n,t){return xa(n.calendar,Vu,n,Dr(t));}function xa(n,t,e,o){const r=o>1||o===0&&n!==on;return o===1?n===on?t(e):Ae(e):r?Ae(e)+$a(Tn(n),o===2):t(e);}function ai(n,t){return((e,o,r,i)=>Ua(ar(e,r,o)[0],i))(n,...Ya(t));}function mo(n,t){const[e,o,r]=Ya(t,3);return o>1&&((n={...n,...su(n,o,e)}).sign=Rt(n),ft(n)),Hu(n,r);}function Hu(n,t){const{sign:e}=n,o=e===-1?Nn(n):n,{hours:r,minutes:i}=o,a=Pa(o),c=Number(a/ot),s=Number(a%ot);Fa(c);const u=br(s,t),d=t>=0||!e||u;return(e<0?"-":"")+"P"+ci({Y:nt(o.years),M:nt(o.months),W:nt(o.weeks),D:nt(o.days)})+(r||i||c||d?"T"+ci({H:nt(r),M:nt(i),S:nt(c,d)+u}):"");}function ci(n){const t=[];for(const e in n){const o=n[e];o&&t.push(o,e);}return t.join("");}function nt(n,t){if(!n&&!t)return"";const e=/* @__PURE__ */Object.create(null);return e.useGrouping=0,n.toLocaleString("fullwide",e);}function Ir(n,t){return Ae(n)+"T"+Ua(n,t);}function Ae(n){return _a(n)+"-"+dn(n.day);}function _a(n){const{year:t}=n;return(t<0||t>9999?La(t)+Ce(6,Math.abs(t)):Ce(4,t))+"-"+dn(n.month);}function Vu(n){return dn(n.month)+"-"+dn(n.day);}function Ua(n,t){const e=[dn(n.hour),dn(n.minute)];return t!==-1&&e.push(dn(n.second)+((o,r,i,a)=>br(o*oe+r*ee+i,a))(n.millisecond,n.microsecond,n.nanosecond,t)),e.join(":");}function ro(n,t=0){if(t===1)return"";const[e,o]=Fn(Math.abs(n),ie),[r,i]=Fn(o,re),[a,c]=Fn(i,it);return La(n)+dn(e)+":"+dn(r)+(a||c?":"+dn(a)+br(c):"");}function Ku(n,t){return t!==1?"["+(t===2?"!":"")+n+"]":"";}function Nr(n,t){return t>1||t===0&&n!==on?$a(Tn(n),t===2):"";}function $a(n,t){return"["+(t?"!":"")+"u-ca="+n+"]";}const Ju=/0+$/;function br(n,t){let e=Ce(9,n);return e=t===void 0?e.replace(Ju,""):e.slice(0,t),e?"."+e:"";}function La(n){return n<0?"-":"+";}const Xu=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Qu=/[^\w\/:+-]+/;function nd(n){return Sr(G(n));}function Sr(n){return Wa(n).id;}const Wa=/* @__PURE__ */It(n=>{const t=n.toUpperCase(),e=(r=>{const i=wa(r,1);if(i!==void 0)return{id:ro(i),Z:i,m:i};})(t);if(e)return{kind:"fixed",...e};const o=t==="UTC"?"UTC":(r=>(Qu.test(r)&&p(Fi(r)),Xu.test(r)&&p("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(c,s)=>c.length<=2&&!a||c==="in"||c==="chat"?c.toUpperCase():c.length>2||!s?Gr(c).replace(/island|noronha|murdo|rivadavia|urville/,Gr):c)).join("/")))(n);return td(o);}),td=/* @__PURE__ */It(n=>{if(n==="UTC")return{kind:"utc",id:n,m:n};const t=(e=n.toUpperCase(),new An("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));var e;return{kind:"named",id:n,format:t,m:t.resolvedOptions().timeZone};});function K(n){const t=Wa(n);return ed(t.id,t);}const ed=/* @__PURE__ */It((n,t)=>t.kind==="named"?new rd(n,t.m,t.format):new od(n,t.m,t.kind==="fixed"?t.Z:0));class od{constructor(t,e,o){this.id=t,this.m=e,this.Z=o;}B(){return this.Z;}O(t){return[rr(t,this.Z)];}C(){}}class rd{constructor(t,e,o){this.id=t,this.m=e,this.me=((r,i)=>{const a=It(r),c=It(id),s=86400*i;function u(m){const[l,g]=si(m,s),y=be(l),h=be(g),v=a(y),T=a(h);return v===T?v:f(c(y,h),v,T,m);}function d(m,l,g,y=m){let[h,v]=si(m,s);const T=s*l,N=()=>l<0?v>g:h<g;for(;N();){const I=be(h),x=be(v),_=a(I),sn=a(x);if(_!==sn){const X=c(I,x);f(X,_,sn);const U=X[0];if((Cn(U,y)||1)===l)return U;}h+=T,v+=T;}}function f(m,l,g,y){let h,v;for(;(y===void 0||(h=y<m[0]?l:y>=m[1]?g:void 0)===void 0)&&(v=m[1]-m[0]);){const T=m[0]+Math.floor(v/2);r(T)===g?m[1]=T:m[0]=T+1;}return h;}return{Ae(m){const l=u(m-86400),g=u(m+86400),y=m-l,h=m-g;if(l===g)return[y];const v=u(y);return v===u(h)?[m-v]:l>g?[y,h]:[];},ze:u,C(m,l){if(!(l>0&&m>=864e10))return l<0?m<=Ne?void 0:m>4e9?d(m,-1,m-94867200)??d(4e9,-1,Ne):d(m,-1,Ne):d(Math.max(m,Ne)-1,1,Math.max(m,Math.floor(Date.now()/1e3))+94867200,m);}};})(/* @__PURE__ */(r=>i=>{const a=qu(r,1e3*i);return 86400*zt((c=>{const s=c.relatedYear;if(s!==void 0)return parseInt(s);const u=parseInt(c.year);return c.era!==void 0&&Bi(c.era)==="bce"?1-u:u;})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i;})(o),(r=>{const i=r.split("/").pop();return Gu[i]||19;})(t));}B(t){return this.me.ze((e=>Hr(e)[0])(t))*it;}O(t){const e=86400*Mn(t)+Lo(t),o=Hi(t);return this.me.Ae(e).map(r=>In(BigInt(r)*ot+BigInt(o)));}C(t,e){const[o,r]=Hr(t),i=this.me.C(o+(e>0||r?1:0),e);if(i!==void 0)return BigInt(i)*ot;}}function id(n,t){return[n,t];}function si(n,t){const e=Math.floor(n/t)*t;return[e,e+t];}function be(n){return ko(n,-1e10,864e10);}function ad(n,t,e){const o=E(e,L(t,ji,zi),pr,[],0),r=o.timeZone!==void 0,[i,a]=hn(o,t),c=Gn(o,t,i,a,0);if(r){const s=le(o),u=K(n(o.timeZone));return{epochNanoseconds:de(u,P(c,s),o.offset),timeZone:u,calendar:t};}return c;}function cd(n,t,e,o){const r=E(e,L(t,ji,zi),pr,$o,0),i=n(r.timeZone),[a,c]=hn(r,t),[s,u,d]=Vt(o),f=Gn(r,t,a,c,s),m=le(r,s),l=K(i);return ln(de(l,P(f,m),r.offset,u,d),l,t);}function sd(n,t,e){const o=E(t,L(n,Li,Wi),yr,[],0),[r,i]=hn(o,n),a=D(e);return oo(Gn(o,n,r,i,a),le(o,a),n);}function ud(n,t,e,o=[]){const r=E(t,L(n,ct,st),cn,o),[i,a]=hn(r,n);return Gn(r,n,i,a,D(e));}function dd(n,t,e,o){const r=E(t,L(n,ae,_i),cn,o),[i,a]=hn(r,n,1);return vr(r,n,i,a,D(e));}function fd(n,t,e,o){const r=E(e,L(n,ct,st),cn,at,0);t&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=1972);const[i,a]=gr(r,n);return Tr(r,n,i,a,D(o));}function md(n,t){return le(E(n,Mo,hr,[],1),D(t));}function ld(n){const t=E(n,ia,Ba);return En(ft({...k,...t}));}function wn(n){p(Zo(n));}function hd(n){const t=Hn(n=G(Ho(n)));let e;return t||wn(n),t.I?e=0:t.offset?e=lr(t.offset):wn(n),gn(rr(t,e));}function yd(n,t){const e=Hn(G(n));return e&&e.timeZoneId?ja(e,t,void 0):Or(he(n),t);}function pd(n,t,e){const o=Hn(G(n));return o&&o.timeZoneId||wn(n),ja(o,t,e);}function gd(n,t){const e=he(n);return kt(e),{...P(e,e),calendar:t(e.calendarId)};}function vd(n,t){return Or(he(n),t);}function Td(n,t){const e=Cr(G(n))||he(n),o=t(e.calendarId);return F(Ee(Ht(o,Ee(e))),o);}function Dd(n,t){const e=Fr(G(n))||he(n);if(e.calendarId==="iso8601")return F({...e,year:1972},t("iso8601"));const{calendar:o}=Or(e,t),{year:r,month:i,day:a}=O(o,e),[c,s]=rt(o,r,i),u=o?o.u(c,s,a):Io(c,s);return u||p("Cannot guess year"),F(an(ut(o,u.year,u.month,a)),o);}function Md(n){const t=Hn(n=G(n))||qa(n);return(!t||!t.qe||t.I||Cr(n)||Fr(n))&&wn(n),wt(t);}function Id(n){const t=Ed.exec(G(n));t&&!Zd.test(n)||wn(n);const e=fr(3600*jt(t[7]||"")+60*jt(t[9]||"")+jt(t[11]||""),4,S),o={...e,years:tn(t[2]),months:tn(t[3]),weeks:tn(t[4]),days:tn(t[5]),hours:tn(t[6]),minutes:tn(t[8])+e.minutes,seconds:tn(t[10])+e.seconds};return En(ft(t[1]==="-"?Nn(o):o));}function Nd(n){const t=Hn(n)||Cr(n)||Fr(n)||qa(n);return t?t.calendarId:n;}function bd(n){const t=Hn(n);return t&&(t.timeZoneId||t.I&&"UTC"||t.offset)||n;}function he(n){const t=Hn(G(n));return t&&!t.I||wn(n),t;}function ja(n,t,e){const o=K(Sr(n.timeZoneId));let r;if(n.qe){const a=n.offset?lr(n.offset):void 0,[,c,s]=Vt(e);r=de(o,n,a,c,s,!(o.Z||n.offset===void 0||(i=n.offset,i.length>6)),n.I);}else Vt(e),r=St(o,n);var i;return In(r),ln(r,o,t(n.calendarId));}function Or(n,t){return F(an(n),t(n.calendarId));}function ui(n,t=""){return`([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\${n}([0-5]\\d${t})(?:[.,](\\d{1,9}))?)?)?`;}const Sd="((?!-0{6})[+-]\\d{6}|\\d{4})(-?)(0[1-9]|1[0-2])\\2(0[1-9]|[12]\\d|3[01])(?:[Tt ]"+ui(6,"|60")+"(?:([Zz])|(([+-])"+ui(14)+"))?)?",Od=/* @__PURE__ */Ro("((?!-0{6})[+-]\\d{6}|\\d{4})-?(0[1-9]|1[0-2])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Cd=/* @__PURE__ */Ro("(?:--)?(0[1-9]|1[0-2])-?(0[1-9]|[12]\\d|3[01])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Fd=/* @__PURE__ */Ro(Sd+"(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Pd=/\[(!?)([^=]+)=([^\]]+)/g,Ed=/^([+-])?P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(?:T(?:(\d+)(?:[.,](\d{1,9}))?H)?(?:(\d+)(?:[.,](\d{1,9}))?M)?(?:(\d+)(?:[.,](\d{1,9}))?S)?)?$/i,Zd=/[PT]$|[.,]\d+[HMS]./i;function Hn(n){const t=Fd.exec(n);if(!t)return;const e=(o=>({year:parseInt(o[1]),month:parseInt(o[3]),day:parseInt(o[4]),...Wo(jt(o[9]||""))[0],hour:tn(o[5]),minute:tn(o[7]),second:Math.min(tn(o[8]),59),...Pr(o[18],o[19]),qe:!!o[5],I:!!o[10],offset:o[11]}))(t);return ue(e);}function Cr(n){const t=Od.exec(n);return t?za((e=>({year:parseInt(e[1]),month:parseInt(e[2]),day:1,...Pr(e[3],e[4])}))(t)):void 0;}function Fr(n){const t=Cd.exec(n);if(t){const o=(r=>({year:1972,month:parseInt(r[1]),day:parseInt(r[2]),...Pr(r[3],r[4])}))(t);if(Ei(Uo,e=o,na(e)))return za(o);}var e;}function za(n){return n.calendarId!=="iso8601"&&wn(n.calendarId),n;}function qa(n){const t=Hn(n.replace(/^t?/i,"0000-01-01T"));return t&&!t.I?t:void 0;}function Pr(n,t){let e;const o=[];return t.replace(Pd,(r,i,a,c)=>(a==="u-ca"?(o.push(c.toLowerCase()),e||(e=i)):i&&wn(r),"")),o.length>1&&e&&wn(t),{timeZoneId:n,calendarId:o[0]||"iso8601"};}function xt(n,t,e){const o=Object.assign(/* @__PURE__ */Object.create(null),t);return lo(o,e,xi),me(n)&&(lo(o,e,ps),n&&n.je&&lo(o,e,gs,Ft)),o;}function lo(n,t,e,o){let r=0;const i=[];for(const a of e)t[a]!==void 0?r=1:i.push(a);if(Object.assign(n,t),r)for(const a of o||i)delete n[a];}function kd(n,t,e){const o=L(n,Ts,Ds),r=A(t),{year:i,month:a,day:c}=O(n,r),s={year:i,monthCode:ye(n,i,a),day:c,hour:r.hour,minute:r.minute,second:r.second,millisecond:r.millisecond,microsecond:r.microsecond,nanosecond:r.nanosecond,offset:r.offsetNanoseconds},u=E(e,o,pr),d=xt(n,s,u);return[{...s,...u},d];}function wd(n,t,e){const o=L(n,Li,Wi),{year:r,month:i,day:a}=O(n,t),c={year:r,monthCode:ye(n,r,i),day:a,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,microsecond:t.microsecond,nanosecond:t.nanosecond},s=E(e,o,yr),u=xt(n,c,s);return[{...c,...s},u];}function Bd(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Rd(n,t,e){const o=L(n,ae,_i),{year:r,month:i}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i)},E(e,o,cn));}function Ad(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Yd(n,t,e,o,r,i,a,c){const{calendar:s,timeZone:u}=n;return ln(de(u,P(Gn(e,s,o,r,i),We(t,i)),t.offset,a,c),u,s);}function xd(n,t,e,o,r,i){return oo(Gn(t,e,o,r,i),We(n,i),e);}function _d(n,t){return{...vn(Mo,n),...E(t,Mo,hr)};}function Ud(n,t){return En((e=n,o=t,ft({...e,...E(o,ia,Ba)})));var e,o;}function ye(n,t,e){const[o,r]=rt(n,t,e);return Ai(o,r);}function $d(n,t,e){const[o,r]=((f,m)=>{const l=m((f=Ge(f,"unit")).relativeTo);let g=Js(f);return g=ca("unit",g),[g,l];})(e,n),i=kn(t),a=Math.max(o,i),c=r&&fe(r);if(!r&&Be(a,c))return di(t,o);if(r||p("Missing relativeTo"),!t.sign&&(!c||o<6))return 0;const[s,u,d]=ba(r,t,o);return Be(o,c)?di(s,o):((f,m,l,g)=>{const y=S[l],h=Go(l,f);return ou(f[y],Rt(f)||1,m,v=>(h[y]=v,dr(g,h)));})(s,u,o,d);}function di(n,t){return Yi(Zn(n),mn[t]);}function Ld(n,t,e){return ln(n.epochNanoseconds,t,e);}function Wd(n){return gn(n.epochNanoseconds);}function Ga(n){return Sn(A(n),n.calendar);}function Ha(n){return F(A(n),n.calendar);}function Va(n){return wt(A(n));}function jd(n,t,e){return ln(In(dt(t,n,e)),t,n.calendar);}function zd(n,t,e){let o;return o=e?dt(t,P(n,e)):St(t,P(n,Dn)),ln(o,t,n.calendar);}function qd(n,t,e){return Ka(n,vn(L(n,ce,Ui),t),E(Qt(e),at,cn,[]));}function Gd(n,t,e){const o=L(n,$e,vs);return Ka(n,vn($i,t),E(Qt(e),o,cn,[]));}function Hd(n,t){const e=E(t,$i,cn),[o,r]=gr(e,n);return Tr(e,n,o,r,0);}function Vd(n,t){const e=E(t,L(n,ce,Ui),cn),[o,r]=hn(e,n,1);return vr(e,n,o,r,0);}function Ka(n,t,e){const o=L(n,Ms,Is);let r=xt(n,t,e);r=E(r,o,cn,[]);const[i,a]=hn(r,n);return Gn(r,n,i,a,0);}function Kd(n){return gn(In(BigInt(Ko(n))*Ue));}function Jd(n){return gn(In(Vo(n)));}function pe(n){return n.timeZone="UTC",["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium"),n;}function Xd(n,t){return n.timeZone!==void 0&&b("Cannot specify TimeZone"),n.timeZone=t,n;}function ge(n,t,e){const o=n.resolvedOptions().calendar;!e&&t.calendar===on||Tn(t.calendar)===o||p("Mismatching Calendars");}function mt(n,t,e,o,r){const i=new Set(n),a=new Set(t),c=new Set(e);return(s,u)=>{let d,f;const m={},l={},g={};let y=0,h=0;for(const U of Object.keys(s)){const ht=s[U];ht===void 0||c.has(U)||(i.has(U)?U==="dateStyle"?d=ht:U==="timeStyle"?f=ht:m[U]=ht:U==="era"?l[U]=ht:a.has(U)?U==="dateStyle"||U==="timeStyle"?h=1:y=1:g[U]=ht);}const v=d!==void 0,T=f!==void 0,N=v||T,I=Object.keys(m).length>0,x=y||h,_=I||v||T,sn=Object.keys(l).length>0;(!u&&x||u&&x&&!_||N&&(I||sn||y))&&b("Invalid formatting options");const X={};return N||_||Object.assign(X,o),Object.assign(X,m,l,g),v&&(r?Object.assign(X,r[d]):X.dateStyle=d),T&&(X.timeStyle=f),X;};}const Ja={year:"numeric",month:"numeric",day:"numeric"},Xa={hour:"numeric",minute:"numeric",second:"numeric"},Er=/* @__PURE__ */Object.assign({},Ja,Xa),Zr=["weekday","year","month","day","dateStyle"],ve=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],kr=/* @__PURE__ */Zr.concat(ve),Qd=/* @__PURE__ */["weekday","day"].concat(ve),nf=/* @__PURE__ */["weekday","year"].concat(ve),tf=/* @__PURE__ */mt(kr,[],[],Er),ef=/* @__PURE__ */mt(kr,[],[],{...Er,timeZoneName:"short"}),of=/* @__PURE__ */mt(kr,[],["timeZoneName"],Er),rf=/* @__PURE__ */mt(Zr,ve,["timeZoneName"],Ja),af=/* @__PURE__ */mt(ve,Zr,["timeZoneName","era"],Xa),cf=/* @__PURE__ */mt(["year","month","dateStyle"],Qd,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),sf=/* @__PURE__ */mt(["month","day","dateStyle"],nf,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function uf(n,t){const{timeZone:e}=n,o=P(A(n),t||Dn);return ln(t?dt(e,o):St(e,o),e,n.calendar);}function df(n){const t=Ge(n,"direction"),e=tu(t,0);return e||p(Mt("direction",e)),e;}function ho(n){const t=Co(),e=n.B(t);return se(t+BigInt(e));}function Co(){return BigInt(Date.now())*Ue;}function Lt(){return new An().resolvedOptions().timeZone||"UTC";}const Qa="PlainYearMonth",nc="PlainMonthDay",tc="PlainDate",ec="PlainDateTime",oc="PlainTime",rc="ZonedDateTime",ic="Instant",ac="Duration";function Vn(n,t,e,...o){return Object.defineProperties(t,cs(n)),Object.defineProperties(t.prototype,Bo("Temporal."+n)),Object.defineProperties(t.prototype,Ot(r=>({get(){return r(e(this));},configurable:1}),Object.assign({},...o))),t;}const Kn=qr.name!=="noop"||globalThis.process?qr:n=>{Object.defineProperty(n,"_str_",{value:n.toJSON()});};function Jn(){b(rs);}function Xn(){b(os);}const ff={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);}},wr={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},mf={monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},lf={daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}},Br={dayOfWeek(n){return jo(n);},dayOfYear(n){return Bs(n.calendar,n);},weekOfYear(n){return Rs(n.calendar,n);},yearOfWeek(n){return As(n.calendar,n);},daysInWeek(){return 7;},daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}};function fi(n,t,e,o){const[r,i,a,c]=Zt(n,o,3,5);return _t(n,no(t.epochNanoseconds,e.epochNanoseconds,r,i,a,c));}function mi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,5);return _t(n,Iu(r,t,e,i,a,c,s));}function li(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6);return _t(n,Nu(r,t,e,i,a,c,s));}function hi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6,9,6);return _t(n,Su(r,t,e,i,a,c,s));}function yi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,9,9,8);return _t(n,bu(r,t,e,i,a,c,s));}function pi(n,t,e,o){const[r,i,a,c]=Zt(n,o,5,5);return _t(n,Ou(t,e,r,i,a,c));}function _t(n,t){return En(n?Nn(t):t);}function hf(n,t,e){const{calendar:o}=n,r=Bd(o,n,t),[i,a]=hn(r,o),c=D(e);return Gn(r,o,i,a,c);}function yf(n,t,e){const{calendar:o}=n,[r,i]=wd(o,n,t),[a,c]=hn(i,o),s=D(e);return xd(r,i,o,a,c,s);}function pf(n,t,e){const{calendar:o}=n,r=Rd(o,n,t),[i,a]=hn(r,o,1),c=D(e);return vr(r,o,i,a,c);}function gf(n,t,e){const{calendar:o}=n,r=Ad(o,n,t),[i,a]=gr(r,o),c=D(e);return Tr(r,o,i,a,c);}function vf(n,t,e){const o=_d(n,t),r=D(e);return le(o,r);}function Tf(n,t,e){const{calendar:o}=n,[r,i]=kd(o,n,t),[a,c]=hn(i,o),[s,u,d]=Vt(e,2);return Yd(n,r,i,a,c,s,u,d);}function Qn(n){const t=G(n).toLowerCase();return t===wi?on:t===us?fs:void p(as(n,"temporal-polyfill/full"));}function Te(n=wi){return Qn(n);}const cc=/* @__PURE__ */new WeakMap(),sc=/* @__PURE__ */Vn(rc,class{constructor(n,t,e=void 0){const o=In(Vo(n)),r=K(nd(t)),i=Te(e);uc(this,ln(o,r,i));}static from(n,t=void 0){return W(yt(n,t));}static compare(n,t){return eo(yt(n),yt(t));}get calendarId(){return Tn(M(this).calendar);}get timeZoneId(){return M(this).timeZone.id;}get epochMilliseconds(){return Fe(M(this).epochNanoseconds);}get epochNanoseconds(){return M(this).epochNanoseconds;}get offset(){return ro(A(M(this)).offsetNanoseconds);}get offsetNanoseconds(){return A(M(this)).offsetNanoseconds;}get hoursInDay(){return au(M(this));}with(n,t=void 0){return W(Tf(M(this),Ut(n),t));}withCalendar(n){return W({...M(this),calendar:co(n)});}withTimeZone(n){return W({...M(this),timeZone:K(en(n))});}withPlainTime(n=void 0){return W(uf(M(this),Yr(n)));}add(n,t=void 0){const e=M(this);return W(ke(e,R(n),D(t)));}subtract(n,t=void 0){const e=M(this);return W(ke(e,Nn(R(n)),D(t)));}until(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(0,e,o,t));}since(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(1,e,o,t));}round(n){const t=M(this),[e,o,r]=He(n);return W(iu(t,e,o,r));}startOfDay(){return W(cu(M(this)));}equals(n){return Ru(M(this),yt(n));}toInstant(){return xn(Wd(M(this)));}toPlainDateTime(){return yn(Ga(M(this)));}toPlainDate(){return pn(Ha(M(this)));}toPlainTime(){return Un(Va(M(this)));}toLocaleString(n=void 0,t={}){const e=M(this),o=new An(n,Xd(ef(t),Mu(e)));return ge(o,e),o.format(Fe(e.epochNanoseconds));}toString(n=void 0){return ti(M(this),n);}toJSON(){return ti(M(this));}getTimeZoneTransition(n){const t=M(this),e=t.timeZone.C(t.epochNanoseconds,df(n));return e!==void 0?W({...t,epochNanoseconds:e}):null;}valueOf(){return Xn();}},Df,wr,Br,_o);function W(n){return uc(Object.create(sc.prototype),n);}function M(n){return bn(n)||Jn();}function Df(n){const t=M(n);return{...A(t),calendar:t.calendar};}function bn(n){return cc.get(n);}function yt(n,t){if(J(n)){const e=bn(n);if(e)return Vt(t),e;const o=De(n);return cd(en,o,n,t);}return pd(n,Qn,t);}function uc(n,t){return cc.set(n,t),Kn(n),n;}function en(n){if(J(n)){const t=bn(n);return t||b(Fi(n)),t.timeZone.id;}return(t=>Sr(bd(G(t))))(n);}const dc=/* @__PURE__ */new WeakMap(),fc=/* @__PURE__ */Vn(ic,class{constructor(n){const t=In(Vo(n));mc(this,gn(t));}static from(n){return xn(pt(n));}static fromEpochMilliseconds(n){return xn(Kd(n));}static fromEpochNanoseconds(n){return xn(Jd(n));}static compare(n,t){return eo(pt(n),pt(t));}get epochMilliseconds(){return Fe(Q(this).epochNanoseconds);}get epochNanoseconds(){return Q(this).epochNanoseconds;}add(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,R(n))));}subtract(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,Nn(R(n)))));}until(n,t=void 0){return Z(fi(0,Q(this),pt(n),t));}since(n,t=void 0){return Z(fi(1,Q(this),pt(n),t));}round(n){const t=Q(this),[e,o,r]=He(n,5,1);return xn(gn(cr(t.epochNanoseconds,Xe(e,o),r)));}equals(n){return Bu(Q(this),pt(n));}toZonedDateTimeISO(n){return W(Ld(Q(this),K(en(n))));}toLocaleString(n=void 0,t={}){const e=Q(this);return new An(n,tf(t)).format(Fe(e.epochNanoseconds));}toString(n=void 0){return ni(en,Q(this),n);}toJSON(){return ni(en,Q(this));}valueOf(){return Xn();}});function xn(n){return mc(Object.create(fc.prototype),n);}function Q(n){return Rr(n)||Jn();}function Rr(n){return dc.get(n);}function pt(n){if(J(n)){const t=Rr(n);if(t)return t;const e=bn(n);if(e)return gn(e.epochNanoseconds);}return hd(n);}function mc(n,t){return dc.set(n,t),Kn(n),n;}const lc=/* @__PURE__ */new WeakMap(),hc=/* @__PURE__ */Vn(nc,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??Os),s=an(ue({year:c,month:r,day:i}));yc(this,F(s,a));}static from(n,t=void 0){return Fo(gi(n,t));}get calendarId(){return Tn(Yn(this).calendar);}with(n,t=void 0){return Fo(gf(Yn(this),Ut(n),t));}equals(n){return _u(Yn(this),gi(n));}toPlainDate(n){const t=Yn(this);return pn(Gd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=Yn(this),o=new An(n,pe(sf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ii(Yn(this),n);}toJSON(){return ii(Yn(this));}valueOf(){return Xn();}},Yn,mf);function Fo(n){return yc(Object.create(hc.prototype),n);}function Yn(n){return io(n)||Jn();}function io(n){return lc.get(n);}function gi(n,t){if(J(n)){const o=io(n);if(o)return D(t),o;const r=Fc(n);return fd(r===void 0?on:r,r===void 0,n,t);}const e=Dd(n,Qn);return D(t),e;}function yc(n,t){return lc.set(n,t),Kn(n),n;}const pc=/* @__PURE__ */new WeakMap(),gc=/* @__PURE__ */Vn(Qa,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??1),s=Ee(ue({year:r,month:i,day:c}));vc(this,F(s,a));}static from(n,t=void 0){return Wt(gt(n,t));}static compare(n,t){return Yt(gt(n),gt(t));}get calendarId(){return Tn(nn(this).calendar);}with(n,t=void 0){return Wt(pf(nn(this),Ut(n),t));}add(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(0,e,o,t));}since(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(1,e,o,t));}equals(n){return xu(nn(this),gt(n));}toPlainDate(n){const t=nn(this);return pn(qd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=nn(this),o=new An(n,pe(cf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ri(nn(this),n);}toJSON(){return ri(nn(this));}valueOf(){return Xn();}},nn,ff,lf);function Wt(n){return vc(Object.create(gc.prototype),n);}function nn(n){return ao(n)||Jn();}function ao(n){return pc.get(n);}function gt(n,t){if(J(n)){const o=ao(n);if(o)return D(t),o;const r=De(n);return dd(r,n,t);}const e=Td(n,Qn);return D(t),e;}function vc(n,t){return pc.set(n,t),Kn(n),n;}function Mf(n){if(!J(n))return;let t=Rr(n);return t?[ic,t]:(t=bn(n),t?[rc,t]:(t=lt(n),t?[ec,t]:(t=$t(n),t?[tc,t]:(t=Ar(n),t?[oc,t]:(t=ao(n),t?[Qa,t]:(t=io(n),t?[nc,t]:(t=xr(n),t?[ac,t]:void 0)))))));}function Ut(n){return(Mf(n)||n.calendar!==void 0||n.timeZone!==void 0)&&b(es),n;}const Tc=/* @__PURE__ */new WeakMap(),Dc=/* @__PURE__ */Vn(oc,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0){const a=qi(Ot(z,{hour:n,minute:t,second:e,millisecond:o,microsecond:r,nanosecond:i}));Mc(this,wt(a));}static from(n,t=void 0){return Un(_n(n,t));}static compare(n,t){return mr(_n(n),_n(t));}with(n,t=void 0){return Un(vf(un(this),Ut(n),t));}add(n){const t=un(this);return Un(No(t,R(n))[0]);}subtract(n){const t=un(this);return Un(No(t,Nn(R(n)))[0]);}until(n,t=void 0){return Z(pi(0,un(this),_n(n),t));}since(n,t=void 0){return Z(pi(1,un(this),_n(n),t));}round(n){const t=un(this),[e,o,r]=He(n,5);return Un(fu(t,e,o,r)[0]);}equals(n){return Uu(un(this),_n(n));}toLocaleString(n=void 0,t={}){const e=un(this);return new An(n,pe(af(t))).format(Gi(e));}toString(n=void 0){return ai(un(this),n);}toJSON(){return ai(un(this));}valueOf(){return Xn();}},un,_o);function Un(n){return Mc(Object.create(Dc.prototype),n);}function un(n){return Ar(n)||Jn();}function Ar(n){return Tc.get(n);}function _n(n,t){if(J(n)){const o=Ar(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),wt(r);const i=bn(n);return i?(D(t),Va(i)):md(n,t);}const e=Md(n);return D(t),e;}function Yr(n){return n===void 0?void 0:_n(n);}function Mc(n,t){return Tc.set(n,t),Kn(n),n;}const Ic=/* @__PURE__ */new WeakMap(),Nc=/* @__PURE__ */Vn(ec,class{constructor(n,t,e,o=0,r=0,i=0,a=0,c=0,s=0,u=void 0){const d=kt(ws(Ot(z,{year:n,month:t,day:e,hour:o,minute:r,second:i,millisecond:a,microsecond:c,nanosecond:s}))),f=Te(u);bc(this,Sn(d,f));}static from(n,t=void 0){return yn(vt(n,t));}static compare(n,t){const e=vt(n),o=vt(t);return Za(e,o);}get calendarId(){return Tn(B(this).calendar);}with(n,t=void 0){return yn(yf(B(this),Ut(n),t));}withCalendar(n){const t=B(this);return yn(Sn(t,co(n)));}withPlainTime(n=void 0){const t=B(this);return yn(oo(t,Yr(n),t.calendar));}add(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=B(this),o=vt(n);return Z(li(0,e,o,t));}since(n,t=void 0){const e=B(this),o=vt(n);return Z(li(1,e,o,t));}round(n){const t=B(this),[e,o,r]=He(n);return yn(Sn(pa(t,e,o,r),t.calendar));}equals(n){return Au(B(this),vt(n));}toZonedDateTime(n,t=void 0){return W(jd(B(this),K(en(n)),Wu(t)));}toPlainDate(){const n=B(this);return pn(F(n,n.calendar));}toPlainTime(){return Un(wt(B(this)));}toLocaleString(n=void 0,t={}){const e=B(this),o=new An(n,pe(of(t)));return ge(o,e),o.format(Ss(e));}toString(n=void 0){return ei(B(this),n);}toJSON(){return ei(B(this));}valueOf(){return Xn();}},B,wr,Br,_o);function yn(n){return bc(Object.create(Nc.prototype),n);}function B(n){return lt(n)||Jn();}function lt(n){return Ic.get(n);}function vt(n,t){if(J(n)){const o=lt(n);if(o)return D(t),o;const r=$t(n);if(r)return D(t),Sn(P(r,Dn),r.calendar);const i=bn(n);if(i)return D(t),Ga(i);const a=De(n);return sd(a,n,t);}const e=gd(n,Qn);return D(t),e;}function bc(n,t){return Ic.set(n,t),Kn(n),n;}const Sc=/* @__PURE__ */new WeakMap(),Oc=/* @__PURE__ */Vn(tc,class{constructor(n,t,e,o=void 0){const r=an(ue(Ot(z,{year:n,month:t,day:e}))),i=Te(o);Cc(this,F(r,i));}static from(n,t=void 0){return pn(Tt(n,t));}static compare(n,t){return Yt(Tt(n),Tt(t));}get calendarId(){return Tn(Y(this).calendar);}with(n,t=void 0){return pn(hf(Y(this),Ut(n),t));}withCalendar(n){const t=Y(this);return pn(F(t,co(n)));}add(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(0,e,o,t));}since(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(1,e,o,t));}equals(n){return Yu(Y(this),Tt(n));}toZonedDateTime(n){const t=J(n)?{timeZone:n.timeZone,plainTime:n.plainTime}:{timeZone:n},e=Y(this),o=en(t.timeZone),r=t.plainTime,i=r!==void 0?_n(r):void 0;return W(zd(e,K(o),i));}toPlainDateTime(n=void 0){const t=Y(this);return yn(oo(t,Yr(n),t.calendar));}toPlainYearMonth(){const n=Y(this);return Wt(Vd(n.calendar,this));}toPlainMonthDay(){const n=Y(this);return Fo(Hd(n.calendar,this));}toLocaleString(n=void 0,t={}){const e=Y(this),o=new An(n,pe(rf(t)));return ge(o,e),o.format(je(e));}toString(n=void 0){return oi(Y(this),n);}toJSON(){return oi(Y(this));}valueOf(){return Xn();}},Y,wr,Br);function pn(n){return Cc(Object.create(Oc.prototype),n);}function Y(n){return $t(n)||Jn();}function $t(n){return Sc.get(n);}function Tt(n,t){if(J(n)){const o=$t(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),F(r,r.calendar);const i=bn(n);if(i)return D(t),Ha(i);const a=De(n);return ud(a,n,t);}const e=vd(n,Qn);return D(t),e;}function Cc(n,t){return Sc.set(n,t),Kn(n),n;}function De(n){const t=Fc(n);return t===void 0?on:t;}function Fc(n){const{calendar:t}=n;if(t!==void 0)return co(t);}function co(n){if(J(n)){const t=$t(n)||lt(n)||bn(n)||io(n)||ao(n);return t||b(is(n)),t.calendar;}return(t=>Qn(Nd(G(t))))(n);}const Pc=/* @__PURE__ */new WeakMap(),Ec=/* @__PURE__ */Vn(ac,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0,a=0,c=0,s=0,u=0){const d=ft(Ot(Ko,{years:n,months:t,weeks:e,days:o,hours:r,minutes:i,seconds:a,milliseconds:c,microseconds:s,nanoseconds:u}));Zc(this,En(d));}static from(n){return Z(R(n));}static compare(n,t,e=void 0){return wu(yo,R(n),R(t),e);}get sign(){return H(this).sign;}get blank(){return!H(this).sign;}with(n){return Z(Ud(H(this),n));}negated(){return Z(Ca(H(this)));}abs(){return Z(Zu(H(this)));}add(n){return Z(Qr(0,H(this),R(n)));}subtract(n){return Z(Qr(1,H(this),R(n)));}round(n){return Z(Eu(yo,H(this),n));}total(n){return $d(yo,H(this),n);}toLocaleString(n=void 0,t){const e=H(this);return Intl.DurationFormat?new Intl.DurationFormat(n,t).format(e):mo(e,t);}toString(n=void 0){return mo(H(this),n);}toJSON(){return mo(H(this));}valueOf(){return Xn();}},H,Ys);function Z(n){return Zc(Object.create(Ec.prototype),n);}function H(n){return xr(n)||Jn();}function xr(n){return Pc.get(n);}function R(n){return J(n)?xr(n)||ld(n):Id(n);}function yo(n){if(n!==void 0){if(J(n)){const t=bn(n);if(t)return t;const e=$t(n);if(e)return e;const o=lt(n);if(o)return F(o,o.calendar);const r=De(n);return ad(en,r,n);}return yd(n,Qn);}}function Zc(n,t){return Pc.set(n,t),Kn(n),n;}const If=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal.Now"),...wo({timeZoneId(){return Lt();},instant(){return xn(gn(Co()));},zonedDateTimeISO(n=Lt()){const t=K(en(n));return W(ln(Co(),t));},plainDateTimeISO(n=Lt()){const t=ho(K(en(n)));return yn(Sn(t));},plainDateISO(n=Lt()){const t=ho(K(en(n)));return pn(F(t));},plainTimeISO(n=Lt()){const t=ho(K(en(n)));return Un(wt(t));}})}),Nf=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal"),...wo({PlainYearMonth:gc,PlainMonthDay:hc,PlainDate:Oc,PlainTime:Dc,PlainDateTime:Nc,ZonedDateTime:sc,Instant:fc,Duration:Ec,Now:If})}),bf=jc||Nf,Me=globalThis.Temporal??bf,Sf="compatible";function zn(n){return Me.Instant.fromEpochMilliseconds(n.getTime());}function _r(n){return new Date(n.epochMilliseconds);}function om(n){return _r(zn(n).add({milliseconds:1}));}function Of(n){return _r(zn(n).subtract({milliseconds:1}));}function rm(n,t){return zn(n).until(zn(t)).total("milliseconds");}function im(n,t){return _r(zn(n).add({milliseconds:t}));}const Cf=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:[T ](\d{1,2})(?::(\d{2}))?(?::(\d{2})(?:\.(\d{1,9}))?)?(\s*)(Z|[+-]\d{2}(?::?\d{2})?)?)?)?)?/i;function Ur(n){const t=Cf.exec(n);if(!t)return null;const[e,o,r,i,a,c,s,u,d,f]=t,m=f===void 0&&d?e.length-d.length:e.length;return{year:Number(o),...(r!==void 0?{month:Number(r)}:{}),...(i!==void 0?{day:Number(i)}:{}),...(a!==void 0?{time:{hour:Number(a),hourDigits:a.length,...(c!==void 0?{minute:Number(c)}:{}),...(s!==void 0?{second:Number(s)}:{}),fraction:u??""}}:{}),...(f!==void 0?{offset:f.toUpperCase()==="Z"?"Z":f}:{}),...(f!==void 0&&d?{spacedOffset:!0}:{}),rest:n.slice(m)};}function am(n){return n==="Z"?"Z":n.length===3?`${n}:00`:n.replace(/^([+-]\d{2}):?(\d{2})$/,"$1:$2");}function cm(n){var t,e,o;try{return new Me.PlainDateTime(n.year,n.month??1,n.day??1,((t=n.time)==null?void 0:t.hour)??0,((e=n.time)==null?void 0:e.minute)??0,((o=n.time)==null?void 0:o.second)??0),!0;}catch{return!1;}}function sm(n){return Number(n.padEnd(3,"0").slice(0,3));}function Ye(n){const t=Ur(n);return!!(t&&t.day!==void 0&&!t.time&&t.offset===void 0&&t.rest==="");}function $r(n,t){const e=zn(n).toZonedDateTimeISO(t);return{year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second};}function On(n){return new Me.PlainDateTime(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond??0);}function um(n){return On(n).toZonedDateTime("UTC").epochMilliseconds;}function Ff(n,t){return new Date(On(n).toZonedDateTime(t,{disambiguation:Sf}).epochMilliseconds);}function dm(n,t){const e=On(n),o=r=>e.toZonedDateTime(t,{disambiguation:r});return[...new Set([o("earlier"),o("later")].filter(r=>r.toPlainDateTime().equals(e)).map(r=>r.epochMilliseconds))].sort((r,i)=>r-i).map(r=>new Date(r));}const fm={second:1e3,minute:6e4,hour:36e5};function kc(n,t){return{...$r(n,t),millisecond:(n.getTime()%1e3+1e3)%1e3};}function Kt(n,t){return Ff(n,t);}function Dt(n){return{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,second:n.second,millisecond:n.millisecond};}function wc(n,t){return new Me.PlainYearMonth(n,t).daysInMonth;}function Se(n,t){return Dt(On(n).add({months:t}));}function Jt(n,t,e){if(t===0)return n;switch(e){case"second":return Dt(On(n).add({seconds:t}));case"minute":return Dt(On(n).add({minutes:t}));case"hour":return Dt(On(n).add({hours:t}));case"day":return Dt(On(n).add({days:t}));case"week":return Dt(On(n).add({weeks:t}));case"month":return Se(n,t);case"quarter":return Se(n,t*3);case"year":return Se(n,t*12);}}function Pf(n){return new Me.PlainDate(n.year,n.month,n.day).dayOfWeek%7;}function vi(n){var e;const t=(e=n.fiscalCalendar)==null?void 0:e.yearStartMonth;return t&&t>=1&&t<=12?t:1;}function Ef(n,t,e){const o={...n,hour:0,minute:0,second:0,millisecond:0};switch(t){case"day":return o;case"week":return Jt(o,-((Pf(n)-e.weekStart+7)%7),"day");case"month":return{...o,day:1};case"quarter":{const r=(n.month-vi(e)+12)%12;return Se({...o,day:1},-(r%3));}case"year":{const r=vi(e);return{...o,year:n.month>=r?n.year:n.year-1,month:r,day:1};}}}function Lr(n,t,e,o=0){if(t==="second"||t==="minute"||t==="hour"){const a=u=>t==="second"?{seconds:u}:t==="minute"?{minutes:u}:{hours:u},s=zn(n).toZonedDateTimeISO(e.tz).round({smallestUnit:t,roundingMode:"floor"}).toInstant().add(a(o));return{start:new Date(s.epochMilliseconds),endExclusive:new Date(s.add(a(1)).epochMilliseconds)};}const r=t,i=Jt(Ef(kc(n,e.tz),r,e),o,t);return{start:Kt(i,e.tz),endExclusive:Kt(Jt(i,1,t),e.tz)};}const Zf=["year","quarter","month","week","day"];function Ti(n,t,e){return Zf.find(o=>{const r=Lr(n,o,e);return r.start.getTime()===n.getTime()&&r.endExclusive.getTime()===t.getTime();})??null;}function mm(n,t,e){return Lr(n,t,e).start;}function lm(n,t,e){return Of(Lr(n,t,e).endExclusive);}function hm(n,t,e,o){return t===0?n:Kt(Jt(kc(n,o.tz),t,e),o.tz);}function ym(n,t,e){const o=r=>zn(r).toZonedDateTimeISO(e).toPlainDate();return o(n).until(o(t),{largestUnit:"days"}).days;}function pm(n,t){const{year:e,month:o,day:r}=$r(n,t);return`${String(e).padStart(4,"0")}-${String(o).padStart(2,"0")}-${String(r).padStart(2,"0")}`;}function kf(n){if(!Ye(n))return null;const{year:t,month:e,day:o}=Ur(n);return e<1||e>12||o<1||o>wc(t,e)?null:{year:t,month:e,day:o};}function wf(n,t){const e=kf(n);if(!e)return null;const o={...e,hour:0,minute:0,second:0,millisecond:0};return{start:Kt(o,t),endExclusive:Kt(Jt(o,1,"day"),t)};}const gm={direction:"last",count:7,unit:"day",includeCurrent:!0,toDate:!1},Bf=/* @__PURE__ */new Set(["minute","hour"]),so=n=>Bf.has(n);function Rf(n){const{direction:t,unit:e}=n;return so(e)?{direction:"last",count:n.count,unit:e,includeCurrent:!0,toDate:!1}:t==="this"||n.count===1&&n.includeCurrent?{direction:"this",count:1,unit:e,includeCurrent:!0,toDate:t==="this"&&n.toDate}:{direction:t,count:n.count,unit:e,includeCurrent:n.includeCurrent,toDate:!1};}function Af(n){const{direction:t,count:e,unit:o}=n;if(so(o)&&t!=="last")return`Only the last ${o}s can be picked.`;if(t==="this")return;if(!Number.isInteger(e)||e<1)return"Enter a whole number, 1 or more.";const r=Si[o];if(e>r)return`At most ${r.toLocaleString("en-US")} ${o}s (ten years).`;}function vm(n){if(Af(n))return;const t=Rf(n);if(so(t.unit))return{kind:"rolling",unit:t.unit,n:t.count,anchor:"now"};const e=t.unit;if(t.direction==="this")return{kind:"periods",unit:e,from:0,to:0,...(t.toDate?{toDate:!0}:{}),anchor:"now"};const[o,r]=t.direction==="last"?t.includeCurrent?[-(t.count-1),0]:[-t.count,-1]:t.includeCurrent?[0,t.count-1]:[1,t.count];return{kind:"periods",unit:e,from:o,to:r,anchor:"now"};}function Tm(n){if(n.kind==="rolling")return n.anchor==="now"&&so(n.unit)?{direction:"last",count:n.n,unit:n.unit,includeCurrent:!0,toDate:!1}:void 0;if(n.kind!=="periods"||n.anchor!=="now")return;const{unit:t,from:e,to:o}=n,r=(i,a,c)=>({direction:i,count:a,unit:t,includeCurrent:c,toDate:!1});if(e===0&&o===0)return{...r("this",1,!0),toDate:!!n.toDate};if(!n.toDate){if(o===0&&e<0)return r("last",1-e,!0);if(o===-1&&e<=-1)return r("last",-e,!1);if(e===0&&o>0)return r("next",o+1,!0);if(e===1&&o>=1)return r("next",o,!1);}}const Dm={side:"before",point:{kind:"ago",count:30,unit:"day"},inclusive:!1};function Yf(n){const{point:t}=n;if(t.kind==="now"||t.kind==="current")return;if(!Number.isInteger(t.count)||t.count<1)return"Enter a whole number, 1 or more.";const e=Si[t.unit];if(t.count>e)return`At most ${e.toLocaleString("en-US")} ${t.unit}s (ten years).`;}function Bc(n){if(n==="<"||n==="<=")return{side:"before",inclusive:n==="<="};if(n===">"||n===">=")return{side:"after",inclusive:n===">="};}const xe=(n,t)=>n==="before"?t?"<=":"<":t?">=":">";function Mm(n){if(Yf(n))return;const{side:t,point:e,inclusive:o}=n;if(e.kind==="now")return{operator:xe(t,t==="before"),window:{kind:"periods",unit:"day",from:0,to:0,toDate:!0,anchor:"now"}};const r=e.kind==="current"?0:e.kind==="ago"?-e.count:e.count;return{operator:xe(t,o),window:{kind:"periods",unit:e.unit,from:r,to:r,anchor:"now"}};}function xf(n,t){var a;const e=(a=Bc(n))==null?void 0:a.side;if(!e||t.kind!=="periods"||t.anchor!=="now"||t.from!==t.to)return;const{unit:o,from:r}=t;if(t.toDate)return o==="day"&&r===0&&n===xe(e,e==="before")?{side:e,point:{kind:"now"},inclusive:!1}:void 0;const i=r===0?{kind:"current",unit:o}:{kind:r<0?"ago":"ahead",count:Math.abs(r),unit:o};return{side:e,point:i,inclusive:n==="<="||n===">="};}function _f(n){if(n.kind==="now")return"now";const{unit:t}=n;if(n.kind==="current")return t==="day"?"today":`this ${t}`;const{count:e}=n;return t==="day"&&e===1?n.kind==="ago"?"yesterday":"tomorrow":`${e} ${e===1?t:`${t}s`} ${n.kind==="ago"?"ago":"from now"}`;}const Uf={"<":"Before","<=":"On or before",">":"After",">=":"On or after"};function Rc(n){return Uf[n];}function $f(n){const t=n.point.kind==="now"?n.side==="before"?"<":">":xe(n.side,n.inclusive);return`${Rc(t)} ${_f(n.point)}`;}function Im(n,t){if(!Bc(n))return;const o=xf(n,t);if(o)return $f(o);const r=Uc(t).label;return`${Rc(n)} the ${$c(n)} of ${r.charAt(0).toLowerCase()}${r.slice(1)}`;}const po={day:1,week:7,month:30.44,quarter:91.31,year:365.25},Lf={day:1,week:7,month:28,quarter:89,year:365},Wf={day:1,week:7,month:31,quarter:92,year:366},Po=24*60*60*1e3;function Di(n){if(n)switch(n.kind){case"relative":return qf(Lc(n.window));case"fixedDay":return{days:1,period:"day"};case"fixedMonth":return{days:wc(n.year,n.month+1),period:"month"};case"range":{const t=Mi(n.start),e=Mi(n.end);if(t===null||e===null||e<t)return;const o=typeof n.end=="string"&&Ye(n.end),r=bi(Math.round(((o?e+Po:e+1)-t)/Po));if(!r||!n.calendar)return r;const i=(s,u,d)=>{var f;return typeof s=="string"&&Ye(s)?(f=wf(s,n.calendar.tz))==null?void 0:f[u==="start"?"start":"endExclusive"]:new Date(d);},a=i(n.start,"start",t),c=i(n.end,"endExclusive",e+1);return a&&c?Ii(r,Ti(a,c,n.calendar)):r;}case"resolved":{const t=Date.parse(n.window.startInclusive),e=Date.parse(n.window.endExclusive);if(!Number.isFinite(t)||!Number.isFinite(e)||e<=t)return;const o=bi(Ni(e-1,n.window.timezone)-Ni(t,n.window.timezone)+1);return!o||!n.calendar?o:Ii(o,Ti(new Date(t),new Date(e),{...n.calendar,tz:n.window.timezone}));}}}function Nm(n){return n.picked?Di({kind:"relative",window:n.picked}):n.whole?Di({kind:"resolved",window:n.whole,calendar:n.calendar}):void 0;}function Mi(n){const t=n instanceof Date?n.getTime():typeof n=="string"?Date.parse(n):Number.NaN;return Number.isFinite(t)?t:null;}function Ii(n,t){return t&&t!=="day"?{days:n.days,period:t}:n;}function Ni(n,t){const e=$r(new Date(n),t);return Date.UTC(e.year,e.month-1,e.day)/Po;}const jf=[31,28,31,30,31,30,31,31,30,31,30,31];function Ac(n,t){const e=n==="month"?t:n==="quarter"?3*t:12*t,o=Math.floor(e/12),r=e%12;let i=r?Number.POSITIVE_INFINITY:0;for(let a=0;r&&a<12;a+=1){let c=0;for(let s=0;s<r;s+=1)c+=jf[(a+s)%12];i=Math.min(i,c);}return o*365+i;}function go(n,t,e){if(n!=="month"&&n!=="quarter"&&n!=="year")return e;const o=Ac(n,t);return o<e.days?{...e,fewestDays:o}:e;}function bi(n){if(!(!Number.isFinite(n)||n<1))return n===1?{days:n,period:"day"}:{days:n};}function zf(n,t){return t==="month"||t==="quarter"||t==="year"?Ac(t,1):t==="week"&&n==="week"?7:1;}function qf(n){if(n)switch(n.kind){case"periods":{const t=n.to-n.from+1,e=t===1?go(n.unit,1,{days:Math.round(po[n.unit]),period:n.unit}):go(n.unit,t,{days:Math.round(t*po[n.unit]),...(n.unit==="day"?{}:{count:t,unit:n.unit})});if(!n.toDate||typeof n.anchor!="object")return e;const o=Math.min(e.fewestDays??e.days,zf(n.unit,n.anchor.lastComplete));return o<e.days?{...e,fewestDays:o}:e;}case"rolling":{if(n.unit==="minute"||n.unit==="hour"){const t=n.unit==="hour"?n.n:n.n/60;return{days:Math.max(1,Math.ceil(t/24)),count:n.n,unit:n.unit};}return go(n.unit,n.n,{days:Math.round(n.n*po[n.unit]),...(n.unit==="day"?{}:{count:n.n,unit:n.unit})});}case"monthDay":return{days:1,period:"day"};default:return;}}function bm(n,t){return!t||n.unit==="period"?!1:(n.matchWeekdays?364:Wf[n.unit])*(n.offset??1)<(t.fewestDays??t.days);}const Gf=["week","month","quarter","year"];function Sm(n){const t=Gf.filter(e=>!n||Lf[e]>n.days&&n.period!==e);return[{kind:"shift",unit:"period"},...t.map(e=>({kind:"shift",unit:e}))];}const Om=["day","week","month","quarter","year"];class et extends Error{constructor(e){super(e);Wr(this,"code");this.name="RawTemporalMetadataContractError",this.code=Wc.invalidMetadata;}}function Hf(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;const t=Object.getPrototypeOf(n);return t===null||t===Object.prototype;}function Vf(n){if(!Hf(n))throw new et("Raw temporal metadata must be an object.");const t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("valueKind"))throw new et("Raw temporal metadata must contain only kind and valueKind.");if(n.kind!=="raw_temporal")throw new et("Raw temporal metadata kind must be raw_temporal.");if(n.valueKind!=="date"&&n.valueKind!=="wall_datetime"&&n.valueKind!=="instant")throw new et("Raw temporal valueKind must be date, wall_datetime, or instant.");return{kind:"raw_temporal",valueKind:n.valueKind};}function Cm(n,t){if(!n.rawTemporal){if(t.metadataRequired)throw new et("Activated raw temporal result is missing metadata.");return;}if(n.temporalBucket)throw new et("A result column cannot carry both raw and grouped temporal metadata.");const e=Vf(n.rawTemporal),o=e.valueKind==="date"?"date":"datetime";if(n.dataType!==o)throw new et(`${e.valueKind} raw temporal values require dataType ${o}.`);return e;}function Yc(n){const t=Ur(n);return!t||t.rest!==""?void 0:Ye(n)?{kind:"date",text:t}:!t.time||t.time.hourDigits!==2||t.time.minute===void 0?void 0:t.offset===void 0?{kind:"wall_datetime",text:t}:(t.offset==="Z"&&n.endsWith("Z")||t.offset.length===6&&t.offset[3]===":")&&!t.spacedOffset?{kind:"instant",text:t}:void 0;}function Fm(n){var t;return(t=Yc(n))==null?void 0:t.kind;}function Kf(n){return n%4===0&&(n%100!==0||n%400===0);}function Jf(n,t){return t===2?Kf(n)?29:28:[4,6,9,11].includes(t)?30:31;}function Xf(n){return n.year>=1&&n.year<=9999&&n.month>=1&&n.month<=12&&n.day>=1&&n.day<=Jf(n.year,n.month)&&n.hour>=0&&n.hour<=23&&n.minute>=0&&n.minute<=59&&n.second>=0&&n.second<=59;}function Qf(n){var t,e,o,r;return{year:n.year,month:n.month??1,day:n.day??1,hour:((t=n.time)==null?void 0:t.hour)??0,minute:((e=n.time)==null?void 0:e.minute)??0,second:((o=n.time)==null?void 0:o.second)??0,fraction:((r=n.time)==null?void 0:r.fraction)??""};}function Pm(n,t){const e=Yc(n);if(!e||e.kind!==t)return{status:"invalid_shape"};const o=Qf(e.text);if(!Xf(o))return{status:"out_of_range"};if(t==="instant"){const r=e.text.offset;if(r&&r!=="Z"){const[a,c]=r.slice(1).split(":").map(Number);if(a>23||c>59)return{status:"out_of_range"};}const i=new Date(n.replace(" ","T"));return Number.isNaN(i.getTime())?{status:"out_of_range"}:{status:"valid",fields:o,instant:i};}return{status:"valid",fields:o};}export{Ti as $,vm as A,zn as B,Om as C,Dm as D,_r as E,om as F,Of as G,rm as H,im as I,$r as J,On as K,um as L,Ff as M,Ur as N,am as O,cm as P,sm as Q,et as R,Ye as S,Me as T,fm as U,wc as V,Sf as W,Pf as X,Ef as Y,Lr as Z,Zf as _,Pm as a,mm as a0,lm as a1,hm as a2,ym as a3,pm as a4,kf as a5,wf as a6,Di as b,Fm as c,Im as d,Nm as e,bm as f,Yf as g,Mm as h,Kt as i,Rc as j,xe as k,Bc as l,$f as m,_f as n,Sm as o,Vf as p,gm as q,xf as r,Jt as s,Af as t,so as u,Cm as v,kc as w,Rf as x,Tm as y,dm as z};
1
+ var xc=Object.defineProperty;var _c=(n,t,e)=>t in n?xc(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wr=(n,t,e)=>_c(n,typeof t!="symbol"?t+"":t,e);import{j as Uc,r as $c,aM as Si,k as Lc}from"./validators-U8IL8djK.js";import{R as Wc}from"./analytics-base-schemas-DMFrDqn_.js";const jc=globalThis.Temporal,zc=(n,t)=>`Non-positive ${n}: ${t}`,qc=(n,t)=>`Non-finite ${n}: ${t}`,Gc=n=>`Cannot convert bigint to ${n}`,Hc="Invalid object",jr=(n,t,e,o)=>Xt(n,t)+`; must be between ${e}-${o}`,Xt=(n,t)=>`Invalid ${n}: ${t}`,Vc=1e3,Kc=1e6,Jc=1e9,Xc=6e10,Qc=36e11;function Bn(n){return n===void 0?/* @__PURE__ */Object.create(null):Qt(n);}function Oi(n,t="number"){if(typeof n=="bigint")throw new TypeError(Gc(t));if(n=Number(n),!Number.isFinite(n))throw new RangeError(qc(t,n));return n;}function z(n,t){return Math.trunc(Oi(n,t))||0;}function zr(n,t){return ns(z(n,t),t);}function ns(n,t="number"){if(n<=0)throw new RangeError(zc(t,n));return n;}function ts(n,t,e){return Math.min(Math.max(n,t),e);}function Oe(n){return n!==null&&(typeof n=="object"||typeof n=="function");}function Qt(n){if(!Oe(n))throw new TypeError(Hc);return n;}const Mt=Xt,ne=n=>`Missing ${n}`,es="Invalid bag",Ci=(n,t,e)=>Xt(n,t)+"; must be "+Object.keys(e).join(),os="Cannot use valueOf",rs="Invalid calling context",Eo=n=>"Missing year"+(n?"/era/eraYear":""),tt="Invalid leap month",is=n=>Xt("Calendar",n),as=(n,t)=>`Unknown calendar ${n}; might need ${t}`,Fi=n=>Xt("TimeZone",n),$n="Out-of-bounds date",Zo=n=>`Cannot parse: ${n}`,ko=ts,J=Oe;function p(n){throw new RangeError(n);}function b(n){throw new TypeError(n);}function vo(n,t,e,o,r){return fn(t,((i,a)=>{const c=i[a];return c===void 0&&b(ne(a)),c;})(n,t),e,o,r);}function fn(n,t,e,o,r,i){const a=ko(t,e,o);return r&&t!==a&&p(((c,s,u,d,f)=>f?jr(c,f[s],f[u],f[d]):jr(c,s,u,d))(n,t,e,o,i)),a;}function It(n,t=Map,e=1e4){const o=new t();return(r,...i)=>{if(o.has(r))return o.get(r);o.size>=e&&o.clear();const a=n(r,...i);return o.set(r,a),a;};}const cs=n=>wo({name:n},1),wo=(n,t)=>Ot(e=>({value:e,configurable:1,writable:!t}),n),Bo=n=>({[Symbol.toStringTag]:{value:n,configurable:1}});function Ot(n,t){const e={};for(const o in t)e[o]=n(t[o],o);return e;}function te(n,t){const e={};for(const o of n)e[o]=t;return e;}function Pi(n){const t={};for(const e of n)t[e]=o=>o[e];return t;}function vn(n,t,e=/* @__PURE__ */Object.create(null)){for(const o of n)e[o]=t[o];return e;}function Ei(n,t,e){for(const o of n)if(t[o]!==e[o])return 0;return 1;}function ss(n,t,e){const o={...e};for(let r=0;r<t;r++)o[n[r]]=0;return o;}function q(n,...t){return(...e)=>n(...t,...e);}function qr(){}function Gr(n){return n[0].toUpperCase()+n.substring(1);}function w(...n){return[].concat(...n).sort();}function Ro(n){return new RegExp(`^${n}$`);}function jt(n){return parseInt(n.padEnd(9,"0"));}function tn(n){return n===void 0?0:parseInt(n);}function Ce(n,t){return String(t).padStart(n,"0");}const dn=/* @__PURE__ */q(Ce,2);function Cn(n,t){return Math.sign(n-t);}function V(n,t){return n<t?-1:n>t?1:0;}function Zi(n,t){const e=n/t;return n%t<0n?e-1n:e;}function Ao(n,t){const e=Zi(n,t);return[e,n-e*t];}function Fn(n,t){return[Math.floor(n/t),_e(n,t)];}function _e(n,t){return(n%t+t)%t;}function Ct(n,t){return Math.trunc(n/t)||0;}function Yo(n,t){return n%t||0;}function ki(n,t=1){return t*(0.5+n/5);}function Ie(n){return Math.abs(n%1)===0.5;}const wi="iso8601",us="gregory",ds={bce:-1,ce:0};function Bi(n){const t=n.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t;}const on=void 0,fs=0;function Tn(n){return n===on?"iso8601":n===0?"gregory":n.id;}const ms=/^M(\d{2})(L?)$/;function Ri(n){const t=ms.exec(n);return t||p((e=>`Invalid monthCode: ${e}`)(n)),[parseInt(t[1]),!!t[2]];}function Ai(n,t){return"M"+dn(n)+(t?"L":"");}function To(n,t,e){return n+(t||e&&n>=e?1:0);}const Do={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},xo=/* @__PURE__ */Object.keys(Do),ee=Vc,oe=Kc,it=Jc,re=Xc,ie=Qc,Rn=864e11,mn=[1,ee,oe,it,re,ie,Rn],ls=/* @__PURE__ */BigInt(ee),Ue=/* @__PURE__ */BigInt(oe),ot=/* @__PURE__ */BigInt(it),hs=/* @__PURE__ */BigInt(re),ys=/* @__PURE__ */BigInt(ie),C=/* @__PURE__ */BigInt(Rn);function Yi(n,t){const e=Number(n/C),o=Number(n%C);return e*(Rn/t)+(Math.trunc(o/t)+o%t/t);}const $=/* @__PURE__ */xo.slice(0,6),_o=/* @__PURE__ */Pi($),$e=["year"],at=["day"],Uo=["day","month","year"],Le=["offset"],$o=["timeZone"],Ft=["era","eraYear"],ps=["era","eraYear","year"],xi=["month","monthCode"],gs=["day","month","monthCode"],Mo=/* @__PURE__ */w($),vs=/* @__PURE__ */w(Ft,$e),ae=/* @__PURE__ */w(xi,$e),_i=/* @__PURE__ */w(Ft,ae),ce=/* @__PURE__ */w(["monthCode"],$e),Ui=/* @__PURE__ */w(Ft,ce),$i=/* @__PURE__ */w(at,["monthCode"]),ct=/* @__PURE__ */w(at,ae),st=/* @__PURE__ */w(at,Ft,ae),Li=/* @__PURE__ */w(ct,$),Wi=/* @__PURE__ */w(st,$),Ts=/* @__PURE__ */w(ct,$,Le),Ds=/* @__PURE__ */w(st,$,Le),ji=/* @__PURE__ */w(ct,$,Le,$o),zi=/* @__PURE__ */w(st,$,Le,$o),Ms=/* @__PURE__ */w(at,ce),Is=/* @__PURE__ */w(at,Ft,ce),Dn=/* @__PURE__ */te($,0);function qi(n){return We(n,1),n;}const Ns={hour:23,minute:59,second:59};function We(n,t){const e={};for(const o of $)e[o]=fn(o,n[o],0,Ns[o]||999,t);return e;}function rn(n){return Lo(n)*it+Hi(n);}function Gi(n){return 1e3*Lo(n)+n.millisecond;}function Lo(n){return 3600*n.hour+60*n.minute+n.second;}function Hi(n){return n.millisecond*oe+n.microsecond*ee+n.nanosecond;}function Wo(n){const[t,e]=Fn(n,Rn);return[Vi(e),t];}function Vi(n){const[t,e]=Fn(n,oe),[o,r]=Fn(e,ee);return bs(t,o,r);}function bs(n,t=0,e=0){const[o,r]=Fn(n,36e5),[i,a]=Fn(r,6e4),[c,s]=Fn(a,1e3);return{hour:o,minute:i,second:c,millisecond:s,microsecond:t,nanosecond:e};}function Hr(n){const[t,e]=Ao(n,ot);return[Number(t),Number(e)];}function Fe(n){return Number(Zi(n,Ue));}function j(n){return Ln(n)+BigInt(rn(n));}function Ss(n){return je(n)+Gi(n);}function Ln(n){return BigInt(Mn(n))*C;}function je(n){return 864e5*Mn(n);}function Mn(n){return zt(n.year,n.month,n.day);}function zt(n,t=1,e=1){const o=t-1;return n+=Math.floor(o/12),t=_e(o,12),Date.UTC(n%400-400,t,0)/864e5+146097*(Ct(n,400)+1)+e;}function se(n){const[t,e]=Ao(n,C);return{...Ki(Number(t)),...Vi(Number(e))};}function Ki(n){const t=new Date(864e5*_e(n,146097));return{year:t.getUTCFullYear()+400*Math.floor(n/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()};}const Os=1972;function Cs(n){return[n,0];}function Io(n,t){if(!t)return{year:1972,month:n};}function Fs(n,t,e){return{year:n,month:t,day:e};}function Ji(n,t){switch(t){case 2:return ze(n)?29:28;case 4:case 6:case 9:case 11:return 30;}return 31;}function Ps(n){return ze(n)?366:365;}function ze(n){return n%4==0&&(n%100!=0||n%400==0);}function Es(n,t,e){return n+=Ct(e,12),(t+=Yo(e,12))<1?(n--,t+=12):t>12&&(n++,t-=12),{year:n,month:t};}function Zs(n,t,e,o){return 12*(e-n)+o-t;}function jo(n){return _e(zt(n.year,n.month,n.day)+4,7)||7;}function Xi(n){return zt(n.year,n.month,n.day)-zt(n.year)+1;}function Qi(n){let t=n.year,e=Math.floor((Xi(n)-jo(n)+10)/7),o=uo(t);return e<1?e=o=uo(--t):e>o&&(e=1,o=uo(++t)),{weekOfYear:e,yearOfWeek:t,De:o};}function uo(n){const t=jo({year:n,month:1,day:1});return t===4||t===3&&ze(n)?53:52;}function ks({year:n}){return n<1?{era:"bce",eraYear:1-n}:{era:"ce",eraYear:n};}function ws(n){return ue(n),qi(n);}function ue(n){return na(n,1),n;}function na(n,t){const{year:e}=n,o=vo(n,"month",1,12,t);return{year:e,month:o,day:vo(n,"day",1,Ji(e,o),t)};}function O(n,t){return n?n.de(t):t;}function rt(n,t,e){return n?n.L(t,e):Cs(e);}function Pe(n,t){var e;return n===0?ks(t):n&&((e=n.h)==null?void 0:e.call(n,t))||{};}function ut(n,t,e,o){return n?n.fe(t,e,o):Fs(t,e,o);}function qt(n,t){return n?n.j(t):12;}function Gt(n,t,e){return n?n.o(t,e):Ji(t,e);}function zo(n,t){const{year:e,month:o}=O(n,t),[r,i]=rt(n,e,o);return Ai(r,i);}function ta(n,t){const{year:e}=O(n,t);return n?n.q(e):ze(e);}function ea(n,t){const{year:e}=O(n,t);return qt(n,e);}function oa(n,t){const{year:e,month:o}=O(n,t);return Gt(n,e,o);}function ra(n,t){const{year:e}=O(n,t);return n?n.i(e):Ps(e);}function Bs(n,t){if(!n)return Xi(t);const{year:e}=O(n,t),o=ut(n,e,1,1);return Mn(t)-Mn(o)+1;}function Rs(n,t){return n===on?Qi(t).weekOfYear:void 0;}function As(n,t){return n===on?Qi(t).yearOfWeek:void 0;}const S=/* @__PURE__ */xo.map(n=>n+"s"),Ys=/* @__PURE__ */Pi(S),ia=/* @__PURE__ */w(S),xs=/* @__PURE__ */S.slice(0,6),aa=/* @__PURE__ */S.slice(6),_s=/* @__PURE__ */aa.slice(1),k=/* @__PURE__ */te(S,0),qo=/* @__PURE__ */te(xs,0),Go=/* @__PURE__ */q(ss,S);function ca(n,t){return t==null&&p(ne(n)),t;}const G=/* @__PURE__ */q(Us,"string");function Us(n,t,e=n){return typeof t!==n&&b(Mt(e,t)),t;}function $s(n,t="number"){return Number.isInteger(n)||p(((e,o)=>`Non-integer ${e}: ${o}`)(t,n)),n||0;}function qe(n){return typeof n=="symbol"&&b("Cannot convert Symbol to string"),String(n);}function Ho(n){if(!Oe(n))return n;const t=n[Symbol.toPrimitive];if(t!=null){typeof t!="function"&&b();const e=Reflect.apply(t,n,["string"]);return Oe(e)&&b(),e;}return Date.prototype[Symbol.toPrimitive].call(n,"string");}function Vo(n){return typeof n=="boolean"?BigInt(n?1:0):typeof n=="string"?BigInt(n):(typeof n!="bigint"&&b(`Invalid bigint: ${n}`),n);}function Ko(n,t){return $s(Oi(n,t),t);}const Pn="smallestUnit",Ls={constrain:0,reject:1},Ws={compatible:0,reject:1,earlier:2,later:3},js={reject:0,use:1,prefer:2,ignore:3},zs={auto:0,never:1,critical:2,always:3},qs={auto:0,never:1,critical:2},Gs={auto:0,never:1},Hs={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Vs=[Math.floor,n=>Ie(n)?Math.floor(n):Math.round(n),Math.ceil,n=>Ie(n)?Math.ceil(n):Math.round(n),Math.trunc,n=>Ie(n)?Math.trunc(n)||0:Math.round(n),n=>n<0?Math.floor(n):Math.ceil(n),n=>Math.sign(n)*Math.round(Math.abs(n))||0,n=>Ie(n)?(n=Math.trunc(n)||0)+n%2:Math.round(n)],Ks={previous:-1,next:1};function Jo(n){const t=n.roundingIncrement;if(t===void 0)return 1;const e=z(t,"roundingIncrement");return(e<1||e>10**9)&&p(Mt("roundingIncrement",e)),e;}function Xo(n){let t=n.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(qe(t)==="auto")return;p(Mt("fractionalSecondDigits",t));}t=fn("fractionalSecondDigits",Math.floor(t),0,9,1);}return t;}function Qo(n,t,e=0,o){let r=t[n];if(r===void 0)return o?e:void 0;if(r=qe(r),r==="auto")return o?e:null;let i=Do[r];return i===void 0&&(i=S.indexOf(r)),i<0&&p(Ci(n,r,Do)),i;}function qn(n,t,e,o=0){const r=e[n];if(r===void 0)return o;const i=qe(r),a=t[i];return a===void 0&&p(Ci(n,i,t)),a;}const Pt=/* @__PURE__ */q(Qo,Pn),sa=/* @__PURE__ */q(Qo,"largestUnit"),Js=/* @__PURE__ */q(Qo,"unit"),ua=/* @__PURE__ */q(qn,"overflow",Ls),da=/* @__PURE__ */q(qn,"disambiguation",Ws),Xs=/* @__PURE__ */q(qn,"offset",js),nr=/* @__PURE__ */q(qn,"calendarName",zs),Qs=/* @__PURE__ */q(qn,"timeZoneName",qs),nu=/* @__PURE__ */q(qn,"offset",Gs),Et=/* @__PURE__ */q(qn,"roundingMode",Hs),tu=/* @__PURE__ */q(qn,"direction",Ks);function Ge(n,t){return typeof n=="string"?((e,o)=>{const r=/* @__PURE__ */Object.create(null);return r[e]=o,r;})(t,n):Qt(n);}function tr(n,t,e,o){const r=o?Rn:mn[t+1];if(r){const i=n*mn[t];(r%i||!o&&i===r)&&p(Mt("roundingIncrement",n));}else!e&&n>1&&p(Mt("roundingIncrement",n));return n;}function Nt(n,t,e,o){return t!=null&&fn(n,t,e,o,1,xo),t;}function fa(n,t){t>n&&p("smallestUnit > largestUnit");}function Zt(n,t,e,o=9,r=0,i=4){t=Bn(t);let a=sa(t,r),c=Jo(t),s=Et(t,i),u=Pt(t,r,1);return a=Nt("largestUnit",a,r,o),u=Nt(Pn,u,r,o),a==null?a=Math.max(e,u):fa(a,u),c=tr(c,u,1),n&&(s=(d=>d<4?(d+2)%4:d)(s)),[a,u,c,s];}function He(n,t=6,e){let o=Jo(n=Ge(n,Pn));const r=Et(n,7);let i=Pt(n);return i=ca(Pn,i),i=Nt(Pn,i,0,t),o=tr(o,i,void 0,e),[i,o,r];}function P(n,t){return vn(Uo,n,vn($,t));}const er=/* @__PURE__ */BigInt(1e8)*C,or=/* @__PURE__ */BigInt(-1e8)*C,ma=or-C;function Ee(n){const t=12*n.year+n.month;return(t<-3261848||t>3309129)&&p($n),n;}function an(n,t=1){const e=Ln(n);return(e<(t?ma:or)||e>er)&&p($n),n;}function kt(n){return eu(j(n)),n;}function eu(n){return(n<=ma||n>=er+C)&&p($n),n;}function In(n){return(n<or||n>er)&&p($n),n;}function rr(n,t){return In(Ln(n)+BigInt(rn(n)-t));}function bt(n,t,e){return ir(n/t,e)*t||0;}function ir(n,t){return Vs[t](n);}function ou(n,t,e,o){const r=la(n,t,o,e);return ha(r,Number(e-r.N)/Number(r.te-r.N));}function ru(n,t,e,o){return bt(ha(n,ya(t,n.N,n.te)),e,o);}function la(n,t,e,o){let r=Vr(n,t,e);return((i,a,c,s)=>s>0?a<=i&&i<=c:c<=i&&i<=a)(o,r.N,r.te,Math.sign(t))||(r=Vr(n+t,t,e)),r;}function Vr(n,t,e){const o=n+t;return{ve:n,pe:o,N:e(n),te:e(o)};}function ha(n,t){return n.ve+t*(n.pe-n.ve);}function ya(n,t,e){const o=e-t,r=n-t;if(!r)return 0;const i=r<0n?-r:r,a=o<0n?-o:o,c=V(r,0n)===V(o,0n)?1:-1;return V(i,a)<=0?i===a?c:ki(V(2n*i,a),c):Number(r)/Number(o);}function gn(n){return{epochNanoseconds:n};}function ln(n,t,e){return{calendar:e,timeZone:t,epochNanoseconds:n};}function Sn(n,t){return vn($,n,F(n,t));}function F(n,t){return vn(Uo,n,{calendar:t});}function wt(n){return vn($,n);}function En(n){return vn(S,n,{sign:Rt(n)});}function iu(n,t,e,o){return ln(t===6?uu(n,o):du(n,t,e,o),n.timeZone,n.calendar);}function au(n){const[t,e]=va(n);return Yi(e-t,ie);}function cu(n){const{timeZone:t,calendar:e}=n;return ln(St(t,P(A(n),Dn)),t,e);}function Ve(n,t,e,o,r,i,a,c){if(o===0&&r===1)return n;const s=Rt(n)||1,u=Be(o,c)?c&&o<6&&e>=6?lu:hu:mu;let[d,f,m]=u(s,n,t,e,o,r,i,a);return m&&o!==7&&(d=((l,g,y,h,v,T)=>{for(let N=h+1;N<=y;N++){if(N===7&&y!==7)continue;const I=Go(N,l);I[S[N]]+=v;const x=V(g,dr(T,I));if(x&&x!==v)break;l=I;}return l;})(d,f,e,Math.max(6,o),s,a)),d;}function su(n,t,e){const o=Math.max(Math.min(kn(n),6),3);return jn(Ke(Zn(n),BigInt(t),e),o);}function uu(n,t){const[e,o]=va(n);return yu(n.epochNanoseconds,e,o,t);}function du(n,t,e,o){if(t===0&&e===1)return n.epochNanoseconds;const r=A(n);return gu(n.timeZone,pa(r,t,e,o),r.offsetNanoseconds);}function pa(n,t,e,o){return ga(n,Je(t,e),o,mn[t+1]);}function fu(n,t,e,o){return ar(n,Je(t,e),o,mn[t+1]);}function ga(n,t,e,o){const[r,i]=ar(n,t,e,o),a=P(Bt(n,i),r);return kt(a),a;}function ar(n,t,e,o=Rn){const r=rn(n),i=r%o;return Wo(r-i+bt(i,t,e));}function mu(n,t,e,o,r,i,a,c){const s=S[r],u=Go(r,t);r===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const d=Ct(t[s],i)*i,f=la(d,i*n,l=>(u[s]=l,dr(c,u)),e),m=ru(f,e,i,a);return u[s]=m,[u,m===f.pe?f.te:f.N,m!==d];}function lu(n,t,e,o,r,i,a,c){const s=Number(At(t)),u=Je(r,i);let d=bt(s,u,a);const f={...t,...qo},m=c.X(f),l=c.X({...f,days:f.days+n}),g=Number(l-m);Math.sign(g)!==n&&p("Out-of-bounds TimeZone gap");const y=d-g;let h=0,v;y&&Math.sign(y)!==n?v=m+BigInt(d):(h+=n,d=bt(y,u,a),v=l+BigInt(d));const T=to(d);return[{...t,...T,days:t.days+h},v,!!h];}function hu(n,t,e,o,r,i,a){const c=Zn(t),s=Ke(c,Xe(r,i),a),u=s-c,d=Math.sign(Number(s/C)-Number(c/C))===n,f=jn(s,Math.min(o,6));return[{...t,...f},e+u,d];}function va(n){const{timeZone:t}=n,e=P(A(n),Dn),o=P(Bt(e,1),Dn);return[St(t,e),St(t,o)];}function yu(n,t,e,o){return ir(ya(n<e?n:e-1n,t,e),o)?e:t;}function Ze(n){return bt(n,re,7);}function Ke(n,t,e){return Ta(n,t,e,n/t%2n);}function cr(n,t,e){const[o,r]=Ao(n,C),i=o*C;return i+Ta(r,t,e,i/t+r/t&1n);}function Ta(n,t,e,o){const r=n/t,i=n%t;let a=0;i&&(a=ki(V(2n*(i<0n?-i:i),t),Math.sign(Number(i))));const c=ir(Number(o)+a,e);return(r-o+BigInt(c))*t;}function Je(n,t){return mn[n]*t;}function Xe(n,t){return BigInt(mn[n])*BigInt(t);}const A=/* @__PURE__ */It(pu,WeakMap);function pu(n){const{epochNanoseconds:t,timeZone:e}=n,o=e.B(t);return{...se(t+BigInt(o)),offsetNanoseconds:o};}function gu(n,t,e){return de(n,t,e,2,0);}function de(n,t,e,o=0,r=0,i,a){if(a||e!==void 0&&o===1)return rr(t,e||0);const c=n.O(t);if(e!==void 0&&o!==3){an(t,0);const s=((u,d,f,m)=>{const l=j(d);m&&(f=Ze(f));for(const g of u){let y=Number(l-g);if(m&&(y=Ze(y)),y===f)return g;}})(c,t,e,i);if(s!==void 0)return s;o===0&&p("Invalid TimeZone offset");}return dt(n,t,r,c);}function dt(n,t,e=0,o=n.O(t)){if(o.length===1)return o[0];if(e===1&&p("Ambiguous offset"),o.length)return o[e===3?1:0];const r=j(t),i=((c,s)=>{const u=c.B(s-C);return(d=>(d>Rn&&p("Out-of-bounds TimeZone gap"),d))(c.B(s+C)-u);})(n,r),a=se(r+BigInt(i*(e===2?-1:1)));return(o=n.O(a))[e===2?0:o.length-1];}function St(n,t){const e=n.O(t);if(e.length)return e[0];const o=j(t)-C;return n.C(o,1);}function Kr(n,t,e,o=0){Rt(e)&&fn("unit",kn(e),8,9,1,S);const r=an(Ht(n,t));return Ht(n,Wn(n,r,e,o));}function ke(n,t,e=0){const{calendar:o,epochNanoseconds:r,timeZone:i}=n,a=At(t);let c=r;if(Ea(t)){const s=A(n);c=dt(i,P(Wn(o,s,{...t,...qo},e),s))+a;}else c+=a;return{...n,epochNanoseconds:In(c)};}function we(n,t,e,o=0){const[r,i]=No(t,e);return kt(P(Wn(n,t,{...e,...qo,days:e.days+i},o),r));}function No(n,t){return vu(n,At(t));}function Jr(n,t){return Tu(n,(fn("unit",kn(e=t),0,5,1,S),At(e)));var e;}function Wn(n,t,e,o=0){let{years:r,months:i,weeks:a,days:c}=e,s;if(c+=Number(At(e)/C),r||i)s=bo(n,t,r,i,o);else{if(!a&&!c)return t;s=t;}return(a||c)&&(s=Bt(s,7*a+c)),an(s);}function Ht(n,t){return Bt(t,1-O(n,t).day);}function bo(n,t,e,o,r){const i=O(n,t);let{year:a,month:c,day:s}=i;if(e){const[u,d]=rt(n,a,c);a+=e,c=So(n,u,d,n?n.p(a):void 0,r),c=fn("month",c,1,qt(n,a),r);}return o&&({year:a,month:c}=Da(n,a,c,o)),s=fn("day",s,1,Gt(n,a,c),r),ut(n,a,c,s);}function Da(n,t,e,o){return n?n.ae(t,e,o):Es(t,e,o);}function So(n,t,e,o,r){if(e){const i=n?n.l:void 0;if(o!==void 0&&(i<0||o===t+1))return o;if(r===1&&p(tt),i<0)return-i;}return To(t,0,o);}function vu(n,t){const e=Number(t/C),o=Number(t%C),[r,i]=Wo(rn(n)+o);return[r,e+i];}function Tu(n,t){return In(n+t);}function Bt(n,t){return t?Ki(Mn(n)+t):n;}function Qe(n,t){return Tn(n)!==Tn(t)&&p("Mismatching Calendars"),n;}function Du(n,t){return n.m!==t.m&&p("Mismatching TimeZones"),n;}function Mu(n){return n.timeZone.id;}function Iu(n,t,e,o,r,i,a){return o<6?no(t.epochNanoseconds,e.epochNanoseconds,o,r,i,a):((c,s,u,d,f,m,l)=>{const g=Du(s.timeZone,u.timeZone),y=u.epochNanoseconds;if(y===s.epochNanoseconds)return k;let h;return h=Ia(g,c,s,u,d),h=Ve(h,y,d,f,m,l,Sa(c,g,s),1),h;})(n,t,e,o,r,i,a);}function Nu(n,t,e,o,r,i,a){return o<=6?no(j(t),j(e),o,r,i,a):((c,s,u,d,f,m,l)=>{const g=j(u),y=V(g,j(s));if(!y)return k;let h;return h=Na(c,s,u,y,d),h=Ve(h,g,d,f,m,l,((v,T)=>({ne:j(T),X:N=>j(P(Wn(v,T,N),T))}))(c,s)),h;})(n,t,e,o,r,i,a);}function bu(n,t,e,o,r,i,a){const c=Ht(n,t),s=Ht(n,e);return ur(c,s)?Ma(n,an(c),an(s),o,r,i,a,8):k;}function Su(n,t,e,o,r,i,a,c=6){return o===6?no(Ln(t),Ln(e),o,r,i,a):Ma(n,t,e,o,r,i,a,c);}function Ou(n,t,e,o,r,i){const a=bt(rn(t)-rn(n),Je(o,r),i);return{...k,...to(a,e)};}function Ma(n,t,e,o,r,i,a,c=6){const s=Ln(e);if(!ur(t,e))return k;let u;return u=sr(n,t,e,o),r===c&&i===1||(u=Ve(u,s,o,r,i,a,Oa(n,t))),u;}function no(n,t,e,o,r,i){return{...k,...jn(Ke(t-n,Xe(o,r),i),e)};}function Ia(n,t,e,o,r){return r<6?{...k,...jn(o.epochNanoseconds-e.epochNanoseconds,r)}:((i,a,c)=>{const s=V(c.epochNanoseconds,a.epochNanoseconds);if(!s)return k;if(!ur(A(a),A(c)))return{...k,...jn(c.epochNanoseconds-a.epochNanoseconds,5)};const[u,d,f]=Fu(i,a,c,s);return{...(m=u,l=d,sr(t,m,l,r)),...to(f)};var m,l;})(n,e,o);}function Cu(n,t,e,o){const r=j(t),i=j(e),a=V(i,r);return a?o<=6?{...k,...jn(i-r,o)}:Na(n,t,e,a,o):k;}function Na(n,t,e,o,r){let i=e,a=rn(e)-rn(t);return Math.sign(a)===-o&&(i=Bt(e,-o),a+=Rn*o),{...sr(n,t,i,r),...to(a)};}function Fu(n,t,e,o){const r=A(t),i=A(e),a=e.epochNanoseconds;let c=0;const s=rn(i)-rn(r);Math.sign(s)===-o&&c++;const u=o>0?2:1;for(;;c++){const d=Bt(i,c*-o),f=dt(n,P(d,r));if(c===u||V(a,f)!==-o)return[r,d,Number(a-f)];}}function sr(n,t,e,o){if(o<=7)return((y,h,v)=>{const T=fo(h,v);return y?{...k,weeks:Ct(T,7),days:Yo(T,7)}:{...k,days:T};})(o===7,t,e);const r=O(n,t),i=O(n,e);if(o===8){const{year:y,month:h,day:v}=r,{year:T,month:N,day:I}=i,x=Math.sign(Cn(T,y)||Cn(N,h)||fo(t,e));let _=0,sn=0;if(x){_=n?n.ee(y,h,T,N):Zs(y,h,T,N);let X=bo(n,t,0,_,0);x*Cn(v,I)>0&&(_-=x,X=bo(n,t,0,_,0)),sn=fo(X,e);}return{...k,months:_,days:sn};}const{year:a,month:c,day:s}=r;let{year:u,month:d,day:f}=i,m=u-a,l=d-c,g=f-s;if(m||l){const y=Math.sign(m||l);let h=Gt(n,u,d),v=0;if(Math.sign(f-s)===-y){const T=h;({year:u,month:d}=Da(n,u,d,-y)),m=u-a,l=d-c,h=Gt(n,u,d),v=y<0?-T:h;}if(g=f-Math.min(s,h)+v,m){const[T,N]=rt(n,a,c),[I,x]=rt(n,u,d),_=n?n.l:void 0;if(l=_!==void 0&&N&&!x&&(_<0?y>0&&I===-_:y<0&&I===T)?0:I-T||Number(x)-Number(N),Math.sign(l)===-y){const sn=y<0&&-qt(n,u);u-=y,m=u-a,l=d-So(n,T,N,n?n.p(u):void 0,0)+(sn||qt(n,u));}else if(n){const sn=So(n,T,N,n.p(u),0);l=n.ee(u,sn,u,d);}}}return{...k,years:m,months:l,days:g};}function ur(n,t){return Cn(n.year,t.year)||Cn(n.month,t.month)||Cn(n.day,t.day);}function fo(n,t){return Mn(t)-Mn(n);}function ba(n,t,e){return fe(n)?((o,r,i)=>{const{calendar:a,timeZone:c}=o,s=ke(o,r);return[Ia(c,a,o,s,i),s.epochNanoseconds,Sa(a,c,o)];})(n,t,e):((o,r,i)=>{const{calendar:a}=o,c=kt(P(o,Dn)),s=we(a,c,r);return[Cu(a,c,s,i),j(s),Oa(a,o)];})(n,t,e);}function Xr(n,t){return fe(n)?ke(n,t).epochNanoseconds:j(we(n.calendar,P(n,Dn),t));}function dr(n,t){return Ea(t)?n.X(t):n.ne;}function Sa(n,t,e){const o=A(e);return{ne:e.epochNanoseconds,X:r=>dt(t,P(Wn(n,o,r),o))};}function Oa(n,t){return{ne:Ln(t),X:e=>Ln(Wn(n,t,e))};}function fe(n){return"timeZone"in n;}function Be(n,t){return n<=6-(t?1:0);}function fr(n,t,e){const o={};for(let r=t;r>=0;r--){const i=mn[r];o[e[r]]=Ct(n,i),n=Yo(n,i);}return o;}const Pu=2**53;function Qr(n,t,e){const o=Math.max(kn(t),kn(e));return fn("unit",o,0,6,1,S),((r,i,a,c)=>En(ft(((s,u,d,f)=>{const m=Zn(s)+Zn(u)*BigInt(f?-1:1);return Number.isFinite(Number(m/C))||p($n),{...k,...jn(m,d)};})(i,a,c,r))))(n,t,e,o);}function Eu(n,t,e){const o=kn(t),[r,i,a,c,s]=((l,g,y)=>{l=Ge(l,Pn);let h=sa(l);const v=y(l.relativeTo);let T=Jo(l);const N=Et(l,7);let I=Pt(l);return h===void 0&&I===void 0&&p("Required smallestUnit or largestUnit"),I==null&&(I=0),h==null&&(h=Math.max(I,g)),fa(h,I),T=tr(T,I,1),T>1&&I>5&&h!==I&&p("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[h,I,T,N,v];})(e,o,n);if(!s&&Math.max(o,r)<=6)return En(ft(((l,g,y,h,v)=>{const T=Ke(Zn(l),Xe(y,h),v);return{...k,...jn(T,g)};})(t,r,i,a,c)));s||p("Missing relativeTo");const u=fe(s);if(!t.sign&&(!u||r<6))return t;const[d,f,m]=ba(s,t,r);return En(Ve(d,f,r,i,a,c,m,u));}function Zu(n){return n.sign===-1?Ca(n):n;}function Ca(n){return En(Nn(n));}function Nn(n){const t={};for(const e of S)t[e]=-1*n[e]||0;return t;}function Rt(n,t=S){let e=0;for(const o of t){const r=Math.sign(n[o]);r&&(e&&e!==r&&p("Cannot mix duration signs"),e=r);}return e;}function ft(n){for(const e of _s)ku(e,n[e]);const t=Zn(n);return Fa(Number(t/ot)),n;}function ku(n,t){return fn(n,t,-4294967295,4294967295,1);}function Fa(n){Number.isSafeInteger(n)||p("Out-of-bounds duration");}function Zn(n){return BigInt(n.days)*C+At(n);}function At(n){return BigInt(n.hours)*ys+BigInt(n.minutes)*hs+Pa(n);}function Pa(n){return BigInt(n.seconds)*ot+BigInt(n.milliseconds)*Ue+BigInt(n.microseconds)*ls+BigInt(n.nanoseconds);}function jn(n,t=6){const e=Number(n/C),o=Number(n%C),r=mn[t],i=t<=3?Number(n/BigInt(r)):e*(Rn/r)+Ct(o,r);Number.isFinite(i)||p($n),t<=3&&Math.abs(i)/(it/mn[t])>=Pu&&p($n);const a=fr(o,t,S);return a[S[t]]=i,a;}function to(n,t=5){return fr(n,t,S);}function Ea(n){return!!Rt(n,aa);}function kn(n){let t=9;for(;t>0&&!n[S[t]];t--);return t;}function eo(n,t){return V(n.epochNanoseconds,t.epochNanoseconds);}function wu(n,t,e,o){const r=n(Bn(o).relativeTo),i=Math.max(kn(t),kn(e));return Ei(S,t,e)?0:Be(i,r&&fe(r))?V(Zn(t),Zn(e)):(r||p("Missing relativeTo"),V(Xr(r,t),Xr(r,e)));}function Za(n,t){return Yt(n,t)||mr(n,t);}function Yt(n,t){return Cn(Mn(n),Mn(t));}function mr(n,t){return Cn(rn(n),rn(t));}function Bu(n,t){return!eo(n,t);}function Ru(n,t){return!eo(n,t)&&n.timeZone.m===t.timeZone.m&&n.calendar===t.calendar;}function Au(n,t){return!Za(n,t)&&n.calendar===t.calendar;}function Yu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function xu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function _u(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function Uu(n,t){return!mr(n,t);}function me(n){return n===0?ds:n?n.k:void 0;}function L(n,t,e=t){return me(n)?e:t;}function ka(n,t){const e=t||void 0,o=me(t);let{era:r,eraYear:i,year:a}=n;if(a!==void 0&&(a=z(a,"year")),i!==void 0&&(i=z(i,"eraYear")),r!==void 0||i!==void 0){r!==void 0&&i!==void 0||b("Mismatching era/eraYear"),o||p("Forbidden era/eraYear");const c=Bi(r),s=o[c];s===void 0&&p((d=>`Invalid era: ${d}`)(r));const u=e!=null&&e._?e._(i,c,s):$u(i,s);a!==void 0&&a!==u&&p("Mismatching year/eraYear"),a=u;}else a===void 0&&b(Eo(o));return a;}function Re(n,t,e,o,r){let{month:i,monthCode:a}=n;if(a!==void 0){const c=((s,u,d,f,m=Ri(u))=>{const l=s?s.p(d):void 0,[g,y]=m;let h=To(g,y,l);if(y){const v=s?s.l:void 0;v===void 0&&p(tt),v>0?(h>v&&p(tt),l!==h&&(f===1&&p(tt),h=To(g,0,l))):(h!==-v&&p(tt),l===void 0&&f===1&&p(tt));}return h;})(t,a,e,r,o);i!==void 0&&i!==c&&p("Mismatching month/monthCode"),i=c,r=1;}else i===void 0&&b("Missing month/monthCode");return fn("month",i,1,qt(t,e),r);}function Oo(n,t,e,o,r){return vo(n,"day",1,Gt(t,e,o),r);}function $u(n,t){return(t+n)*(Math.sign(t)||1)||0;}function le(n,t){return We(vn($,{...Dn,...n}),t);}const Lu=/^([+-])([01]\d|2[0-3])(?:(:?)([0-5]\d)(?:\3([0-5]\d)(?:[.,](\d{1,9}))?)?)?$/;function lr(n){const t=wa(n);return t===void 0&&p(Zo(n)),t;}function wa(n,t){const e=Lu.exec(n);if(e)return t&&e[5]&&p(Zo(n)),/* @__PURE__ */(o=>o&&o!=="+"?-1:1)(e[1])*(parseInt(e[2])*ie+tn(e[4])*re+tn(e[5])*it+jt(e[6]||""));}const cn={era:qe,month:zr,monthCode(n,t){return G(Ho(n),t);},day:zr},hr=/* @__PURE__ */te($,z),Ba=/* @__PURE__ */te(S,Ko),yr=/* @__PURE__ */Object.assign({},cn,hr),pr={offset(n){return lr(G(Ho(n)));},...yr};function E(n,t,e,o,r=!o){const i={};let a=0;for(const c of t){let s=n[c];if(s!==void 0){a=1;const u=e[c];u&&(s=u(s,c)),i[c]=s;}else o&&o.includes(c)&&b(ne(c));}return r&&!a&&b("No valid fields: "+t.join()),i;}function D(n){return n===void 0?0:ua(Qt(n));}function Vt(n,t=0){n=Bn(n);const e=da(n),o=Xs(n,t);return[ua(n),o,e];}function Wu(n){return da(Bn(n));}function hn(n,t,e){const o=me(t);n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o)),n.monthCode===void 0&&n.month===void 0&&b("Missing month/monthCode"),e||n.day!==void 0||b(ne("day"));const r=Ra(n);return[ka(n,t),r];}function gr(n,t){const e=t===on,o=me(t);n.day===void 0&&b(ne("day")),e||n.month===void 0||n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o));const r=Ra(n);return[n.eraYear!==void 0||n.year!==void 0?ka(n,t):void 0,r];}function oo(n,t=Dn,e){const o=P(n,t);return kt(o),Sn(o,e);}function Gn(n,t,e,o,r){const i=Re(n,t,e,o,r);return F(an(ut(t,e,i,Oo(n,t,e,i,r))),t);}function vr(n,t,e,o,r){return ju(t,e,Re(n,t,e,o,r));}function Tr(n,t,e,o,r){var d;const i=t===on;let a=e,c,s,u;if(a===void 0&&i&&(a=1972),a!==void 0){i||an(ut(t,a,1,1));const f=Re(n,t,a,o,r);c=Oo(n,t,a,f,r),[s,u]=rt(t,a,f);}else{n.monthCode===void 0&&b("Missing month/monthCode"),[s,u]=o;const f=t?t.re:1972;if(f!==void 0)c=Oo(n,t,f,Re(n,t,f,o,r),r);else{const m=r===0&&t?(d=t.ge)==null?void 0:d.call(t,s,u,n.day):void 0;c=m!==void 0?m:n.day;}}return zu(t,s,u,c,n.day,r);}function ju(n,t,e){return F(Ee(ut(n,t,e,1)),n);}function zu(n,t,e,o,r,i){var d;let a=e;a&&((n&&((d=n.U)==null?void 0:d[t]))??1/0)<r&&(i===1&&p(tt),a=0,o=ko(r,1,(n&&n.R)??1/0));let c=n?n.u(t,!!a,o):Io(t,!!a);for(;!c&&i===0&&o>1;)o--,c=n?n.u(t,!!a,o):Io(t,!!a);c||p("Cannot guess year");const{year:s,month:u}=c;return F(an(ut(n,s,u,o)),n);}function Ra(n){if(n.monthCode!==void 0)return Ri(n.monthCode);}const An=Intl.DateTimeFormat;function qu(n,t){t<-864e13&&p($n);const e=n.formatToParts(t),o={};for(const r of e)o[r.type]=r.value;return o;}const Gu={El_Aaiun:16,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Ne=-4e9;function Aa(n,t=4){const e=Xo(n),o=Et(n,4),r=Pt(n);return[o,...Mr(Nt(Pn,r,0,t),e)];}function Dr(n){return nr(Bn(n));}function Ya(n,t){return Aa(Bn(n),t);}function Mr(n,t){return n!=null?[mn[n],n<4?9-3*n:-1]:[t===void 0?1:10**(9-t),t];}function ni(n,t,e){const[o,r,i,a]=(s=>{const u=Xo(s=Bn(s)),d=Et(s,4),f=Pt(s);return[s.timeZone,d,...Mr(Nt(Pn,f,0,4),u)];})(e),c=o!==void 0;return((s,u,d,f,m,l)=>{d=cr(d,BigInt(m),f);const g=u.B(d);return Ir(se(d+BigInt(g)),l)+(s?ro(Ze(g)):"Z");})(c,K(c?n(o):"UTC"),t.epochNanoseconds,r,i,a);}function ti(n,t){const e=(o=>{o=Bn(o);const r=nr(o),i=Xo(o),a=nu(o),c=Et(o,4),s=Pt(o);return[r,Qs(o),a,c,...Mr(Nt(Pn,s,0,4),i)];})(t);return((o,r,i,a,c,s,u,d,f,m)=>{a=cr(a,BigInt(f),d);const l=i.B(a);return Ir(se(a+BigInt(l)),m)+ro(Ze(l),u)+Ku(r,s)+Nr(o,c);})(n.calendar,n.timeZone.id,n.timeZone,n.epochNanoseconds,...e);}function ei(n,t){const e=(o=>(o=Bn(o),[nr(o),...Aa(o)]))(t);return((o,r,i,a,c,s)=>Ir(ga(r,c,a),s)+Nr(o,i))(n.calendar,n,...e);}function oi(n,t){return e=n.calendar,o=n,r=Dr(t),Ae(o)+Nr(e,r);var e,o,r;}function ri(n,t){return xa(n.calendar,_a,n,Dr(t));}function ii(n,t){return xa(n.calendar,Vu,n,Dr(t));}function xa(n,t,e,o){const r=o>1||o===0&&n!==on;return o===1?n===on?t(e):Ae(e):r?Ae(e)+$a(Tn(n),o===2):t(e);}function ai(n,t){return((e,o,r,i)=>Ua(ar(e,r,o)[0],i))(n,...Ya(t));}function mo(n,t){const[e,o,r]=Ya(t,3);return o>1&&((n={...n,...su(n,o,e)}).sign=Rt(n),ft(n)),Hu(n,r);}function Hu(n,t){const{sign:e}=n,o=e===-1?Nn(n):n,{hours:r,minutes:i}=o,a=Pa(o),c=Number(a/ot),s=Number(a%ot);Fa(c);const u=br(s,t),d=t>=0||!e||u;return(e<0?"-":"")+"P"+ci({Y:nt(o.years),M:nt(o.months),W:nt(o.weeks),D:nt(o.days)})+(r||i||c||d?"T"+ci({H:nt(r),M:nt(i),S:nt(c,d)+u}):"");}function ci(n){const t=[];for(const e in n){const o=n[e];o&&t.push(o,e);}return t.join("");}function nt(n,t){if(!n&&!t)return"";const e=/* @__PURE__ */Object.create(null);return e.useGrouping=0,n.toLocaleString("fullwide",e);}function Ir(n,t){return Ae(n)+"T"+Ua(n,t);}function Ae(n){return _a(n)+"-"+dn(n.day);}function _a(n){const{year:t}=n;return(t<0||t>9999?La(t)+Ce(6,Math.abs(t)):Ce(4,t))+"-"+dn(n.month);}function Vu(n){return dn(n.month)+"-"+dn(n.day);}function Ua(n,t){const e=[dn(n.hour),dn(n.minute)];return t!==-1&&e.push(dn(n.second)+((o,r,i,a)=>br(o*oe+r*ee+i,a))(n.millisecond,n.microsecond,n.nanosecond,t)),e.join(":");}function ro(n,t=0){if(t===1)return"";const[e,o]=Fn(Math.abs(n),ie),[r,i]=Fn(o,re),[a,c]=Fn(i,it);return La(n)+dn(e)+":"+dn(r)+(a||c?":"+dn(a)+br(c):"");}function Ku(n,t){return t!==1?"["+(t===2?"!":"")+n+"]":"";}function Nr(n,t){return t>1||t===0&&n!==on?$a(Tn(n),t===2):"";}function $a(n,t){return"["+(t?"!":"")+"u-ca="+n+"]";}const Ju=/0+$/;function br(n,t){let e=Ce(9,n);return e=t===void 0?e.replace(Ju,""):e.slice(0,t),e?"."+e:"";}function La(n){return n<0?"-":"+";}const Xu=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Qu=/[^\w\/:+-]+/;function nd(n){return Sr(G(n));}function Sr(n){return Wa(n).id;}const Wa=/* @__PURE__ */It(n=>{const t=n.toUpperCase(),e=(r=>{const i=wa(r,1);if(i!==void 0)return{id:ro(i),Z:i,m:i};})(t);if(e)return{kind:"fixed",...e};const o=t==="UTC"?"UTC":(r=>(Qu.test(r)&&p(Fi(r)),Xu.test(r)&&p("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(c,s)=>c.length<=2&&!a||c==="in"||c==="chat"?c.toUpperCase():c.length>2||!s?Gr(c).replace(/island|noronha|murdo|rivadavia|urville/,Gr):c)).join("/")))(n);return td(o);}),td=/* @__PURE__ */It(n=>{if(n==="UTC")return{kind:"utc",id:n,m:n};const t=(e=n.toUpperCase(),new An("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));var e;return{kind:"named",id:n,format:t,m:t.resolvedOptions().timeZone};});function K(n){const t=Wa(n);return ed(t.id,t);}const ed=/* @__PURE__ */It((n,t)=>t.kind==="named"?new rd(n,t.m,t.format):new od(n,t.m,t.kind==="fixed"?t.Z:0));class od{constructor(t,e,o){this.id=t,this.m=e,this.Z=o;}B(){return this.Z;}O(t){return[rr(t,this.Z)];}C(){}}class rd{constructor(t,e,o){this.id=t,this.m=e,this.me=((r,i)=>{const a=It(r),c=It(id),s=86400*i;function u(m){const[l,g]=si(m,s),y=be(l),h=be(g),v=a(y),T=a(h);return v===T?v:f(c(y,h),v,T,m);}function d(m,l,g,y=m){let[h,v]=si(m,s);const T=s*l,N=()=>l<0?v>g:h<g;for(;N();){const I=be(h),x=be(v),_=a(I),sn=a(x);if(_!==sn){const X=c(I,x);f(X,_,sn);const U=X[0];if((Cn(U,y)||1)===l)return U;}h+=T,v+=T;}}function f(m,l,g,y){let h,v;for(;(y===void 0||(h=y<m[0]?l:y>=m[1]?g:void 0)===void 0)&&(v=m[1]-m[0]);){const T=m[0]+Math.floor(v/2);r(T)===g?m[1]=T:m[0]=T+1;}return h;}return{Ae(m){const l=u(m-86400),g=u(m+86400),y=m-l,h=m-g;if(l===g)return[y];const v=u(y);return v===u(h)?[m-v]:l>g?[y,h]:[];},ze:u,C(m,l){if(!(l>0&&m>=864e10))return l<0?m<=Ne?void 0:m>4e9?d(m,-1,m-94867200)??d(4e9,-1,Ne):d(m,-1,Ne):d(Math.max(m,Ne)-1,1,Math.max(m,Math.floor(Date.now()/1e3))+94867200,m);}};})(/* @__PURE__ */(r=>i=>{const a=qu(r,1e3*i);return 86400*zt((c=>{const s=c.relatedYear;if(s!==void 0)return parseInt(s);const u=parseInt(c.year);return c.era!==void 0&&Bi(c.era)==="bce"?1-u:u;})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i;})(o),(r=>{const i=r.split("/").pop();return Gu[i]||19;})(t));}B(t){return this.me.ze((e=>Hr(e)[0])(t))*it;}O(t){const e=86400*Mn(t)+Lo(t),o=Hi(t);return this.me.Ae(e).map(r=>In(BigInt(r)*ot+BigInt(o)));}C(t,e){const[o,r]=Hr(t),i=this.me.C(o+(e>0||r?1:0),e);if(i!==void 0)return BigInt(i)*ot;}}function id(n,t){return[n,t];}function si(n,t){const e=Math.floor(n/t)*t;return[e,e+t];}function be(n){return ko(n,-1e10,864e10);}function ad(n,t,e){const o=E(e,L(t,ji,zi),pr,[],0),r=o.timeZone!==void 0,[i,a]=hn(o,t),c=Gn(o,t,i,a,0);if(r){const s=le(o),u=K(n(o.timeZone));return{epochNanoseconds:de(u,P(c,s),o.offset),timeZone:u,calendar:t};}return c;}function cd(n,t,e,o){const r=E(e,L(t,ji,zi),pr,$o,0),i=n(r.timeZone),[a,c]=hn(r,t),[s,u,d]=Vt(o),f=Gn(r,t,a,c,s),m=le(r,s),l=K(i);return ln(de(l,P(f,m),r.offset,u,d),l,t);}function sd(n,t,e){const o=E(t,L(n,Li,Wi),yr,[],0),[r,i]=hn(o,n),a=D(e);return oo(Gn(o,n,r,i,a),le(o,a),n);}function ud(n,t,e,o=[]){const r=E(t,L(n,ct,st),cn,o),[i,a]=hn(r,n);return Gn(r,n,i,a,D(e));}function dd(n,t,e,o){const r=E(t,L(n,ae,_i),cn,o),[i,a]=hn(r,n,1);return vr(r,n,i,a,D(e));}function fd(n,t,e,o){const r=E(e,L(n,ct,st),cn,at,0);t&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=1972);const[i,a]=gr(r,n);return Tr(r,n,i,a,D(o));}function md(n,t){return le(E(n,Mo,hr,[],1),D(t));}function ld(n){const t=E(n,ia,Ba);return En(ft({...k,...t}));}function wn(n){p(Zo(n));}function hd(n){const t=Hn(n=G(Ho(n)));let e;return t||wn(n),t.I?e=0:t.offset?e=lr(t.offset):wn(n),gn(rr(t,e));}function yd(n,t){const e=Hn(G(n));return e&&e.timeZoneId?ja(e,t,void 0):Or(he(n),t);}function pd(n,t,e){const o=Hn(G(n));return o&&o.timeZoneId||wn(n),ja(o,t,e);}function gd(n,t){const e=he(n);return kt(e),{...P(e,e),calendar:t(e.calendarId)};}function vd(n,t){return Or(he(n),t);}function Td(n,t){const e=Cr(G(n))||he(n),o=t(e.calendarId);return F(Ee(Ht(o,Ee(e))),o);}function Dd(n,t){const e=Fr(G(n))||he(n);if(e.calendarId==="iso8601")return F({...e,year:1972},t("iso8601"));const{calendar:o}=Or(e,t),{year:r,month:i,day:a}=O(o,e),[c,s]=rt(o,r,i),u=o?o.u(c,s,a):Io(c,s);return u||p("Cannot guess year"),F(an(ut(o,u.year,u.month,a)),o);}function Md(n){const t=Hn(n=G(n))||qa(n);return(!t||!t.qe||t.I||Cr(n)||Fr(n))&&wn(n),wt(t);}function Id(n){const t=Ed.exec(G(n));t&&!Zd.test(n)||wn(n);const e=fr(3600*jt(t[7]||"")+60*jt(t[9]||"")+jt(t[11]||""),4,S),o={...e,years:tn(t[2]),months:tn(t[3]),weeks:tn(t[4]),days:tn(t[5]),hours:tn(t[6]),minutes:tn(t[8])+e.minutes,seconds:tn(t[10])+e.seconds};return En(ft(t[1]==="-"?Nn(o):o));}function Nd(n){const t=Hn(n)||Cr(n)||Fr(n)||qa(n);return t?t.calendarId:n;}function bd(n){const t=Hn(n);return t&&(t.timeZoneId||t.I&&"UTC"||t.offset)||n;}function he(n){const t=Hn(G(n));return t&&!t.I||wn(n),t;}function ja(n,t,e){const o=K(Sr(n.timeZoneId));let r;if(n.qe){const a=n.offset?lr(n.offset):void 0,[,c,s]=Vt(e);r=de(o,n,a,c,s,!(o.Z||n.offset===void 0||(i=n.offset,i.length>6)),n.I);}else Vt(e),r=St(o,n);var i;return In(r),ln(r,o,t(n.calendarId));}function Or(n,t){return F(an(n),t(n.calendarId));}function ui(n,t=""){return`([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\${n}([0-5]\\d${t})(?:[.,](\\d{1,9}))?)?)?`;}const Sd="((?!-0{6})[+-]\\d{6}|\\d{4})(-?)(0[1-9]|1[0-2])\\2(0[1-9]|[12]\\d|3[01])(?:[Tt ]"+ui(6,"|60")+"(?:([Zz])|(([+-])"+ui(14)+"))?)?",Od=/* @__PURE__ */Ro("((?!-0{6})[+-]\\d{6}|\\d{4})-?(0[1-9]|1[0-2])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Cd=/* @__PURE__ */Ro("(?:--)?(0[1-9]|1[0-2])-?(0[1-9]|[12]\\d|3[01])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Fd=/* @__PURE__ */Ro(Sd+"(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Pd=/\[(!?)([^=]+)=([^\]]+)/g,Ed=/^([+-])?P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(?:T(?:(\d+)(?:[.,](\d{1,9}))?H)?(?:(\d+)(?:[.,](\d{1,9}))?M)?(?:(\d+)(?:[.,](\d{1,9}))?S)?)?$/i,Zd=/[PT]$|[.,]\d+[HMS]./i;function Hn(n){const t=Fd.exec(n);if(!t)return;const e=(o=>({year:parseInt(o[1]),month:parseInt(o[3]),day:parseInt(o[4]),...Wo(jt(o[9]||""))[0],hour:tn(o[5]),minute:tn(o[7]),second:Math.min(tn(o[8]),59),...Pr(o[18],o[19]),qe:!!o[5],I:!!o[10],offset:o[11]}))(t);return ue(e);}function Cr(n){const t=Od.exec(n);return t?za((e=>({year:parseInt(e[1]),month:parseInt(e[2]),day:1,...Pr(e[3],e[4])}))(t)):void 0;}function Fr(n){const t=Cd.exec(n);if(t){const o=(r=>({year:1972,month:parseInt(r[1]),day:parseInt(r[2]),...Pr(r[3],r[4])}))(t);if(Ei(Uo,e=o,na(e)))return za(o);}var e;}function za(n){return n.calendarId!=="iso8601"&&wn(n.calendarId),n;}function qa(n){const t=Hn(n.replace(/^t?/i,"0000-01-01T"));return t&&!t.I?t:void 0;}function Pr(n,t){let e;const o=[];return t.replace(Pd,(r,i,a,c)=>(a==="u-ca"?(o.push(c.toLowerCase()),e||(e=i)):i&&wn(r),"")),o.length>1&&e&&wn(t),{timeZoneId:n,calendarId:o[0]||"iso8601"};}function xt(n,t,e){const o=Object.assign(/* @__PURE__ */Object.create(null),t);return lo(o,e,xi),me(n)&&(lo(o,e,ps),n&&n.je&&lo(o,e,gs,Ft)),o;}function lo(n,t,e,o){let r=0;const i=[];for(const a of e)t[a]!==void 0?r=1:i.push(a);if(Object.assign(n,t),r)for(const a of o||i)delete n[a];}function kd(n,t,e){const o=L(n,Ts,Ds),r=A(t),{year:i,month:a,day:c}=O(n,r),s={year:i,monthCode:ye(n,i,a),day:c,hour:r.hour,minute:r.minute,second:r.second,millisecond:r.millisecond,microsecond:r.microsecond,nanosecond:r.nanosecond,offset:r.offsetNanoseconds},u=E(e,o,pr),d=xt(n,s,u);return[{...s,...u},d];}function wd(n,t,e){const o=L(n,Li,Wi),{year:r,month:i,day:a}=O(n,t),c={year:r,monthCode:ye(n,r,i),day:a,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,microsecond:t.microsecond,nanosecond:t.nanosecond},s=E(e,o,yr),u=xt(n,c,s);return[{...c,...s},u];}function Bd(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Rd(n,t,e){const o=L(n,ae,_i),{year:r,month:i}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i)},E(e,o,cn));}function Ad(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Yd(n,t,e,o,r,i,a,c){const{calendar:s,timeZone:u}=n;return ln(de(u,P(Gn(e,s,o,r,i),We(t,i)),t.offset,a,c),u,s);}function xd(n,t,e,o,r,i){return oo(Gn(t,e,o,r,i),We(n,i),e);}function _d(n,t){return{...vn(Mo,n),...E(t,Mo,hr)};}function Ud(n,t){return En((e=n,o=t,ft({...e,...E(o,ia,Ba)})));var e,o;}function ye(n,t,e){const[o,r]=rt(n,t,e);return Ai(o,r);}function $d(n,t,e){const[o,r]=((f,m)=>{const l=m((f=Ge(f,"unit")).relativeTo);let g=Js(f);return g=ca("unit",g),[g,l];})(e,n),i=kn(t),a=Math.max(o,i),c=r&&fe(r);if(!r&&Be(a,c))return di(t,o);if(r||p("Missing relativeTo"),!t.sign&&(!c||o<6))return 0;const[s,u,d]=ba(r,t,o);return Be(o,c)?di(s,o):((f,m,l,g)=>{const y=S[l],h=Go(l,f);return ou(f[y],Rt(f)||1,m,v=>(h[y]=v,dr(g,h)));})(s,u,o,d);}function di(n,t){return Yi(Zn(n),mn[t]);}function Ld(n,t,e){return ln(n.epochNanoseconds,t,e);}function Wd(n){return gn(n.epochNanoseconds);}function Ga(n){return Sn(A(n),n.calendar);}function Ha(n){return F(A(n),n.calendar);}function Va(n){return wt(A(n));}function jd(n,t,e){return ln(In(dt(t,n,e)),t,n.calendar);}function zd(n,t,e){let o;return o=e?dt(t,P(n,e)):St(t,P(n,Dn)),ln(o,t,n.calendar);}function qd(n,t,e){return Ka(n,vn(L(n,ce,Ui),t),E(Qt(e),at,cn,[]));}function Gd(n,t,e){const o=L(n,$e,vs);return Ka(n,vn($i,t),E(Qt(e),o,cn,[]));}function Hd(n,t){const e=E(t,$i,cn),[o,r]=gr(e,n);return Tr(e,n,o,r,0);}function Vd(n,t){const e=E(t,L(n,ce,Ui),cn),[o,r]=hn(e,n,1);return vr(e,n,o,r,0);}function Ka(n,t,e){const o=L(n,Ms,Is);let r=xt(n,t,e);r=E(r,o,cn,[]);const[i,a]=hn(r,n);return Gn(r,n,i,a,0);}function Kd(n){return gn(In(BigInt(Ko(n))*Ue));}function Jd(n){return gn(In(Vo(n)));}function pe(n){return n.timeZone="UTC",["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium"),n;}function Xd(n,t){return n.timeZone!==void 0&&b("Cannot specify TimeZone"),n.timeZone=t,n;}function ge(n,t,e){const o=n.resolvedOptions().calendar;!e&&t.calendar===on||Tn(t.calendar)===o||p("Mismatching Calendars");}function mt(n,t,e,o,r){const i=new Set(n),a=new Set(t),c=new Set(e);return(s,u)=>{let d,f;const m={},l={},g={};let y=0,h=0;for(const U of Object.keys(s)){const ht=s[U];ht===void 0||c.has(U)||(i.has(U)?U==="dateStyle"?d=ht:U==="timeStyle"?f=ht:m[U]=ht:U==="era"?l[U]=ht:a.has(U)?U==="dateStyle"||U==="timeStyle"?h=1:y=1:g[U]=ht);}const v=d!==void 0,T=f!==void 0,N=v||T,I=Object.keys(m).length>0,x=y||h,_=I||v||T,sn=Object.keys(l).length>0;(!u&&x||u&&x&&!_||N&&(I||sn||y))&&b("Invalid formatting options");const X={};return N||_||Object.assign(X,o),Object.assign(X,m,l,g),v&&(r?Object.assign(X,r[d]):X.dateStyle=d),T&&(X.timeStyle=f),X;};}const Ja={year:"numeric",month:"numeric",day:"numeric"},Xa={hour:"numeric",minute:"numeric",second:"numeric"},Er=/* @__PURE__ */Object.assign({},Ja,Xa),Zr=["weekday","year","month","day","dateStyle"],ve=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],kr=/* @__PURE__ */Zr.concat(ve),Qd=/* @__PURE__ */["weekday","day"].concat(ve),nf=/* @__PURE__ */["weekday","year"].concat(ve),tf=/* @__PURE__ */mt(kr,[],[],Er),ef=/* @__PURE__ */mt(kr,[],[],{...Er,timeZoneName:"short"}),of=/* @__PURE__ */mt(kr,[],["timeZoneName"],Er),rf=/* @__PURE__ */mt(Zr,ve,["timeZoneName"],Ja),af=/* @__PURE__ */mt(ve,Zr,["timeZoneName","era"],Xa),cf=/* @__PURE__ */mt(["year","month","dateStyle"],Qd,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),sf=/* @__PURE__ */mt(["month","day","dateStyle"],nf,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function uf(n,t){const{timeZone:e}=n,o=P(A(n),t||Dn);return ln(t?dt(e,o):St(e,o),e,n.calendar);}function df(n){const t=Ge(n,"direction"),e=tu(t,0);return e||p(Mt("direction",e)),e;}function ho(n){const t=Co(),e=n.B(t);return se(t+BigInt(e));}function Co(){return BigInt(Date.now())*Ue;}function Lt(){return new An().resolvedOptions().timeZone||"UTC";}const Qa="PlainYearMonth",nc="PlainMonthDay",tc="PlainDate",ec="PlainDateTime",oc="PlainTime",rc="ZonedDateTime",ic="Instant",ac="Duration";function Vn(n,t,e,...o){return Object.defineProperties(t,cs(n)),Object.defineProperties(t.prototype,Bo("Temporal."+n)),Object.defineProperties(t.prototype,Ot(r=>({get(){return r(e(this));},configurable:1}),Object.assign({},...o))),t;}const Kn=qr.name!=="noop"||globalThis.process?qr:n=>{Object.defineProperty(n,"_str_",{value:n.toJSON()});};function Jn(){b(rs);}function Xn(){b(os);}const ff={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);}},wr={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},mf={monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},lf={daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}},Br={dayOfWeek(n){return jo(n);},dayOfYear(n){return Bs(n.calendar,n);},weekOfYear(n){return Rs(n.calendar,n);},yearOfWeek(n){return As(n.calendar,n);},daysInWeek(){return 7;},daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}};function fi(n,t,e,o){const[r,i,a,c]=Zt(n,o,3,5);return _t(n,no(t.epochNanoseconds,e.epochNanoseconds,r,i,a,c));}function mi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,5);return _t(n,Iu(r,t,e,i,a,c,s));}function li(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6);return _t(n,Nu(r,t,e,i,a,c,s));}function hi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6,9,6);return _t(n,Su(r,t,e,i,a,c,s));}function yi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,9,9,8);return _t(n,bu(r,t,e,i,a,c,s));}function pi(n,t,e,o){const[r,i,a,c]=Zt(n,o,5,5);return _t(n,Ou(t,e,r,i,a,c));}function _t(n,t){return En(n?Nn(t):t);}function hf(n,t,e){const{calendar:o}=n,r=Bd(o,n,t),[i,a]=hn(r,o),c=D(e);return Gn(r,o,i,a,c);}function yf(n,t,e){const{calendar:o}=n,[r,i]=wd(o,n,t),[a,c]=hn(i,o),s=D(e);return xd(r,i,o,a,c,s);}function pf(n,t,e){const{calendar:o}=n,r=Rd(o,n,t),[i,a]=hn(r,o,1),c=D(e);return vr(r,o,i,a,c);}function gf(n,t,e){const{calendar:o}=n,r=Ad(o,n,t),[i,a]=gr(r,o),c=D(e);return Tr(r,o,i,a,c);}function vf(n,t,e){const o=_d(n,t),r=D(e);return le(o,r);}function Tf(n,t,e){const{calendar:o}=n,[r,i]=kd(o,n,t),[a,c]=hn(i,o),[s,u,d]=Vt(e,2);return Yd(n,r,i,a,c,s,u,d);}function Qn(n){const t=G(n).toLowerCase();return t===wi?on:t===us?fs:void p(as(n,"temporal-polyfill/full"));}function Te(n=wi){return Qn(n);}const cc=/* @__PURE__ */new WeakMap(),sc=/* @__PURE__ */Vn(rc,class{constructor(n,t,e=void 0){const o=In(Vo(n)),r=K(nd(t)),i=Te(e);uc(this,ln(o,r,i));}static from(n,t=void 0){return W(yt(n,t));}static compare(n,t){return eo(yt(n),yt(t));}get calendarId(){return Tn(M(this).calendar);}get timeZoneId(){return M(this).timeZone.id;}get epochMilliseconds(){return Fe(M(this).epochNanoseconds);}get epochNanoseconds(){return M(this).epochNanoseconds;}get offset(){return ro(A(M(this)).offsetNanoseconds);}get offsetNanoseconds(){return A(M(this)).offsetNanoseconds;}get hoursInDay(){return au(M(this));}with(n,t=void 0){return W(Tf(M(this),Ut(n),t));}withCalendar(n){return W({...M(this),calendar:co(n)});}withTimeZone(n){return W({...M(this),timeZone:K(en(n))});}withPlainTime(n=void 0){return W(uf(M(this),Yr(n)));}add(n,t=void 0){const e=M(this);return W(ke(e,R(n),D(t)));}subtract(n,t=void 0){const e=M(this);return W(ke(e,Nn(R(n)),D(t)));}until(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(0,e,o,t));}since(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(1,e,o,t));}round(n){const t=M(this),[e,o,r]=He(n);return W(iu(t,e,o,r));}startOfDay(){return W(cu(M(this)));}equals(n){return Ru(M(this),yt(n));}toInstant(){return xn(Wd(M(this)));}toPlainDateTime(){return yn(Ga(M(this)));}toPlainDate(){return pn(Ha(M(this)));}toPlainTime(){return Un(Va(M(this)));}toLocaleString(n=void 0,t={}){const e=M(this),o=new An(n,Xd(ef(t),Mu(e)));return ge(o,e),o.format(Fe(e.epochNanoseconds));}toString(n=void 0){return ti(M(this),n);}toJSON(){return ti(M(this));}getTimeZoneTransition(n){const t=M(this),e=t.timeZone.C(t.epochNanoseconds,df(n));return e!==void 0?W({...t,epochNanoseconds:e}):null;}valueOf(){return Xn();}},Df,wr,Br,_o);function W(n){return uc(Object.create(sc.prototype),n);}function M(n){return bn(n)||Jn();}function Df(n){const t=M(n);return{...A(t),calendar:t.calendar};}function bn(n){return cc.get(n);}function yt(n,t){if(J(n)){const e=bn(n);if(e)return Vt(t),e;const o=De(n);return cd(en,o,n,t);}return pd(n,Qn,t);}function uc(n,t){return cc.set(n,t),Kn(n),n;}function en(n){if(J(n)){const t=bn(n);return t||b(Fi(n)),t.timeZone.id;}return(t=>Sr(bd(G(t))))(n);}const dc=/* @__PURE__ */new WeakMap(),fc=/* @__PURE__ */Vn(ic,class{constructor(n){const t=In(Vo(n));mc(this,gn(t));}static from(n){return xn(pt(n));}static fromEpochMilliseconds(n){return xn(Kd(n));}static fromEpochNanoseconds(n){return xn(Jd(n));}static compare(n,t){return eo(pt(n),pt(t));}get epochMilliseconds(){return Fe(Q(this).epochNanoseconds);}get epochNanoseconds(){return Q(this).epochNanoseconds;}add(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,R(n))));}subtract(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,Nn(R(n)))));}until(n,t=void 0){return Z(fi(0,Q(this),pt(n),t));}since(n,t=void 0){return Z(fi(1,Q(this),pt(n),t));}round(n){const t=Q(this),[e,o,r]=He(n,5,1);return xn(gn(cr(t.epochNanoseconds,Xe(e,o),r)));}equals(n){return Bu(Q(this),pt(n));}toZonedDateTimeISO(n){return W(Ld(Q(this),K(en(n))));}toLocaleString(n=void 0,t={}){const e=Q(this);return new An(n,tf(t)).format(Fe(e.epochNanoseconds));}toString(n=void 0){return ni(en,Q(this),n);}toJSON(){return ni(en,Q(this));}valueOf(){return Xn();}});function xn(n){return mc(Object.create(fc.prototype),n);}function Q(n){return Rr(n)||Jn();}function Rr(n){return dc.get(n);}function pt(n){if(J(n)){const t=Rr(n);if(t)return t;const e=bn(n);if(e)return gn(e.epochNanoseconds);}return hd(n);}function mc(n,t){return dc.set(n,t),Kn(n),n;}const lc=/* @__PURE__ */new WeakMap(),hc=/* @__PURE__ */Vn(nc,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??Os),s=an(ue({year:c,month:r,day:i}));yc(this,F(s,a));}static from(n,t=void 0){return Fo(gi(n,t));}get calendarId(){return Tn(Yn(this).calendar);}with(n,t=void 0){return Fo(gf(Yn(this),Ut(n),t));}equals(n){return _u(Yn(this),gi(n));}toPlainDate(n){const t=Yn(this);return pn(Gd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=Yn(this),o=new An(n,pe(sf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ii(Yn(this),n);}toJSON(){return ii(Yn(this));}valueOf(){return Xn();}},Yn,mf);function Fo(n){return yc(Object.create(hc.prototype),n);}function Yn(n){return io(n)||Jn();}function io(n){return lc.get(n);}function gi(n,t){if(J(n)){const o=io(n);if(o)return D(t),o;const r=Fc(n);return fd(r===void 0?on:r,r===void 0,n,t);}const e=Dd(n,Qn);return D(t),e;}function yc(n,t){return lc.set(n,t),Kn(n),n;}const pc=/* @__PURE__ */new WeakMap(),gc=/* @__PURE__ */Vn(Qa,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??1),s=Ee(ue({year:r,month:i,day:c}));vc(this,F(s,a));}static from(n,t=void 0){return Wt(gt(n,t));}static compare(n,t){return Yt(gt(n),gt(t));}get calendarId(){return Tn(nn(this).calendar);}with(n,t=void 0){return Wt(pf(nn(this),Ut(n),t));}add(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(0,e,o,t));}since(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(1,e,o,t));}equals(n){return xu(nn(this),gt(n));}toPlainDate(n){const t=nn(this);return pn(qd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=nn(this),o=new An(n,pe(cf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ri(nn(this),n);}toJSON(){return ri(nn(this));}valueOf(){return Xn();}},nn,ff,lf);function Wt(n){return vc(Object.create(gc.prototype),n);}function nn(n){return ao(n)||Jn();}function ao(n){return pc.get(n);}function gt(n,t){if(J(n)){const o=ao(n);if(o)return D(t),o;const r=De(n);return dd(r,n,t);}const e=Td(n,Qn);return D(t),e;}function vc(n,t){return pc.set(n,t),Kn(n),n;}function Mf(n){if(!J(n))return;let t=Rr(n);return t?[ic,t]:(t=bn(n),t?[rc,t]:(t=lt(n),t?[ec,t]:(t=$t(n),t?[tc,t]:(t=Ar(n),t?[oc,t]:(t=ao(n),t?[Qa,t]:(t=io(n),t?[nc,t]:(t=xr(n),t?[ac,t]:void 0)))))));}function Ut(n){return(Mf(n)||n.calendar!==void 0||n.timeZone!==void 0)&&b(es),n;}const Tc=/* @__PURE__ */new WeakMap(),Dc=/* @__PURE__ */Vn(oc,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0){const a=qi(Ot(z,{hour:n,minute:t,second:e,millisecond:o,microsecond:r,nanosecond:i}));Mc(this,wt(a));}static from(n,t=void 0){return Un(_n(n,t));}static compare(n,t){return mr(_n(n),_n(t));}with(n,t=void 0){return Un(vf(un(this),Ut(n),t));}add(n){const t=un(this);return Un(No(t,R(n))[0]);}subtract(n){const t=un(this);return Un(No(t,Nn(R(n)))[0]);}until(n,t=void 0){return Z(pi(0,un(this),_n(n),t));}since(n,t=void 0){return Z(pi(1,un(this),_n(n),t));}round(n){const t=un(this),[e,o,r]=He(n,5);return Un(fu(t,e,o,r)[0]);}equals(n){return Uu(un(this),_n(n));}toLocaleString(n=void 0,t={}){const e=un(this);return new An(n,pe(af(t))).format(Gi(e));}toString(n=void 0){return ai(un(this),n);}toJSON(){return ai(un(this));}valueOf(){return Xn();}},un,_o);function Un(n){return Mc(Object.create(Dc.prototype),n);}function un(n){return Ar(n)||Jn();}function Ar(n){return Tc.get(n);}function _n(n,t){if(J(n)){const o=Ar(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),wt(r);const i=bn(n);return i?(D(t),Va(i)):md(n,t);}const e=Md(n);return D(t),e;}function Yr(n){return n===void 0?void 0:_n(n);}function Mc(n,t){return Tc.set(n,t),Kn(n),n;}const Ic=/* @__PURE__ */new WeakMap(),Nc=/* @__PURE__ */Vn(ec,class{constructor(n,t,e,o=0,r=0,i=0,a=0,c=0,s=0,u=void 0){const d=kt(ws(Ot(z,{year:n,month:t,day:e,hour:o,minute:r,second:i,millisecond:a,microsecond:c,nanosecond:s}))),f=Te(u);bc(this,Sn(d,f));}static from(n,t=void 0){return yn(vt(n,t));}static compare(n,t){const e=vt(n),o=vt(t);return Za(e,o);}get calendarId(){return Tn(B(this).calendar);}with(n,t=void 0){return yn(yf(B(this),Ut(n),t));}withCalendar(n){const t=B(this);return yn(Sn(t,co(n)));}withPlainTime(n=void 0){const t=B(this);return yn(oo(t,Yr(n),t.calendar));}add(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=B(this),o=vt(n);return Z(li(0,e,o,t));}since(n,t=void 0){const e=B(this),o=vt(n);return Z(li(1,e,o,t));}round(n){const t=B(this),[e,o,r]=He(n);return yn(Sn(pa(t,e,o,r),t.calendar));}equals(n){return Au(B(this),vt(n));}toZonedDateTime(n,t=void 0){return W(jd(B(this),K(en(n)),Wu(t)));}toPlainDate(){const n=B(this);return pn(F(n,n.calendar));}toPlainTime(){return Un(wt(B(this)));}toLocaleString(n=void 0,t={}){const e=B(this),o=new An(n,pe(of(t)));return ge(o,e),o.format(Ss(e));}toString(n=void 0){return ei(B(this),n);}toJSON(){return ei(B(this));}valueOf(){return Xn();}},B,wr,Br,_o);function yn(n){return bc(Object.create(Nc.prototype),n);}function B(n){return lt(n)||Jn();}function lt(n){return Ic.get(n);}function vt(n,t){if(J(n)){const o=lt(n);if(o)return D(t),o;const r=$t(n);if(r)return D(t),Sn(P(r,Dn),r.calendar);const i=bn(n);if(i)return D(t),Ga(i);const a=De(n);return sd(a,n,t);}const e=gd(n,Qn);return D(t),e;}function bc(n,t){return Ic.set(n,t),Kn(n),n;}const Sc=/* @__PURE__ */new WeakMap(),Oc=/* @__PURE__ */Vn(tc,class{constructor(n,t,e,o=void 0){const r=an(ue(Ot(z,{year:n,month:t,day:e}))),i=Te(o);Cc(this,F(r,i));}static from(n,t=void 0){return pn(Tt(n,t));}static compare(n,t){return Yt(Tt(n),Tt(t));}get calendarId(){return Tn(Y(this).calendar);}with(n,t=void 0){return pn(hf(Y(this),Ut(n),t));}withCalendar(n){const t=Y(this);return pn(F(t,co(n)));}add(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(0,e,o,t));}since(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(1,e,o,t));}equals(n){return Yu(Y(this),Tt(n));}toZonedDateTime(n){const t=J(n)?{timeZone:n.timeZone,plainTime:n.plainTime}:{timeZone:n},e=Y(this),o=en(t.timeZone),r=t.plainTime,i=r!==void 0?_n(r):void 0;return W(zd(e,K(o),i));}toPlainDateTime(n=void 0){const t=Y(this);return yn(oo(t,Yr(n),t.calendar));}toPlainYearMonth(){const n=Y(this);return Wt(Vd(n.calendar,this));}toPlainMonthDay(){const n=Y(this);return Fo(Hd(n.calendar,this));}toLocaleString(n=void 0,t={}){const e=Y(this),o=new An(n,pe(rf(t)));return ge(o,e),o.format(je(e));}toString(n=void 0){return oi(Y(this),n);}toJSON(){return oi(Y(this));}valueOf(){return Xn();}},Y,wr,Br);function pn(n){return Cc(Object.create(Oc.prototype),n);}function Y(n){return $t(n)||Jn();}function $t(n){return Sc.get(n);}function Tt(n,t){if(J(n)){const o=$t(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),F(r,r.calendar);const i=bn(n);if(i)return D(t),Ha(i);const a=De(n);return ud(a,n,t);}const e=vd(n,Qn);return D(t),e;}function Cc(n,t){return Sc.set(n,t),Kn(n),n;}function De(n){const t=Fc(n);return t===void 0?on:t;}function Fc(n){const{calendar:t}=n;if(t!==void 0)return co(t);}function co(n){if(J(n)){const t=$t(n)||lt(n)||bn(n)||io(n)||ao(n);return t||b(is(n)),t.calendar;}return(t=>Qn(Nd(G(t))))(n);}const Pc=/* @__PURE__ */new WeakMap(),Ec=/* @__PURE__ */Vn(ac,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0,a=0,c=0,s=0,u=0){const d=ft(Ot(Ko,{years:n,months:t,weeks:e,days:o,hours:r,minutes:i,seconds:a,milliseconds:c,microseconds:s,nanoseconds:u}));Zc(this,En(d));}static from(n){return Z(R(n));}static compare(n,t,e=void 0){return wu(yo,R(n),R(t),e);}get sign(){return H(this).sign;}get blank(){return!H(this).sign;}with(n){return Z(Ud(H(this),n));}negated(){return Z(Ca(H(this)));}abs(){return Z(Zu(H(this)));}add(n){return Z(Qr(0,H(this),R(n)));}subtract(n){return Z(Qr(1,H(this),R(n)));}round(n){return Z(Eu(yo,H(this),n));}total(n){return $d(yo,H(this),n);}toLocaleString(n=void 0,t){const e=H(this);return Intl.DurationFormat?new Intl.DurationFormat(n,t).format(e):mo(e,t);}toString(n=void 0){return mo(H(this),n);}toJSON(){return mo(H(this));}valueOf(){return Xn();}},H,Ys);function Z(n){return Zc(Object.create(Ec.prototype),n);}function H(n){return xr(n)||Jn();}function xr(n){return Pc.get(n);}function R(n){return J(n)?xr(n)||ld(n):Id(n);}function yo(n){if(n!==void 0){if(J(n)){const t=bn(n);if(t)return t;const e=$t(n);if(e)return e;const o=lt(n);if(o)return F(o,o.calendar);const r=De(n);return ad(en,r,n);}return yd(n,Qn);}}function Zc(n,t){return Pc.set(n,t),Kn(n),n;}const If=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal.Now"),...wo({timeZoneId(){return Lt();},instant(){return xn(gn(Co()));},zonedDateTimeISO(n=Lt()){const t=K(en(n));return W(ln(Co(),t));},plainDateTimeISO(n=Lt()){const t=ho(K(en(n)));return yn(Sn(t));},plainDateISO(n=Lt()){const t=ho(K(en(n)));return pn(F(t));},plainTimeISO(n=Lt()){const t=ho(K(en(n)));return Un(wt(t));}})}),Nf=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal"),...wo({PlainYearMonth:gc,PlainMonthDay:hc,PlainDate:Oc,PlainTime:Dc,PlainDateTime:Nc,ZonedDateTime:sc,Instant:fc,Duration:Ec,Now:If})}),bf=jc||Nf,Me=globalThis.Temporal??bf,Sf="compatible";function zn(n){return Me.Instant.fromEpochMilliseconds(n.getTime());}function _r(n){return new Date(n.epochMilliseconds);}function om(n){return _r(zn(n).add({milliseconds:1}));}function Of(n){return _r(zn(n).subtract({milliseconds:1}));}function rm(n,t){return zn(n).until(zn(t)).total("milliseconds");}function im(n,t){return _r(zn(n).add({milliseconds:t}));}const Cf=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:[T ](\d{1,2})(?::(\d{2}))?(?::(\d{2})(?:\.(\d{1,9}))?)?(\s*)(Z|[+-]\d{2}(?::?\d{2})?)?)?)?)?/i;function Ur(n){const t=Cf.exec(n);if(!t)return null;const[e,o,r,i,a,c,s,u,d,f]=t,m=f===void 0&&d?e.length-d.length:e.length;return{year:Number(o),...(r!==void 0?{month:Number(r)}:{}),...(i!==void 0?{day:Number(i)}:{}),...(a!==void 0?{time:{hour:Number(a),hourDigits:a.length,...(c!==void 0?{minute:Number(c)}:{}),...(s!==void 0?{second:Number(s)}:{}),fraction:u??""}}:{}),...(f!==void 0?{offset:f.toUpperCase()==="Z"?"Z":f}:{}),...(f!==void 0&&d?{spacedOffset:!0}:{}),rest:n.slice(m)};}function am(n){return n==="Z"?"Z":n.length===3?`${n}:00`:n.replace(/^([+-]\d{2}):?(\d{2})$/,"$1:$2");}function cm(n){var t,e,o;try{return new Me.PlainDateTime(n.year,n.month??1,n.day??1,((t=n.time)==null?void 0:t.hour)??0,((e=n.time)==null?void 0:e.minute)??0,((o=n.time)==null?void 0:o.second)??0),!0;}catch{return!1;}}function sm(n){return Number(n.padEnd(3,"0").slice(0,3));}function Ye(n){const t=Ur(n);return!!(t&&t.day!==void 0&&!t.time&&t.offset===void 0&&t.rest==="");}function $r(n,t){const e=zn(n).toZonedDateTimeISO(t);return{year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second};}function On(n){return new Me.PlainDateTime(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond??0);}function um(n){return On(n).toZonedDateTime("UTC").epochMilliseconds;}function Ff(n,t){return new Date(On(n).toZonedDateTime(t,{disambiguation:Sf}).epochMilliseconds);}function dm(n,t){const e=On(n),o=r=>e.toZonedDateTime(t,{disambiguation:r});return[...new Set([o("earlier"),o("later")].filter(r=>r.toPlainDateTime().equals(e)).map(r=>r.epochMilliseconds))].sort((r,i)=>r-i).map(r=>new Date(r));}const fm={second:1e3,minute:6e4,hour:36e5};function kc(n,t){return{...$r(n,t),millisecond:(n.getTime()%1e3+1e3)%1e3};}function Kt(n,t){return Ff(n,t);}function Dt(n){return{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,second:n.second,millisecond:n.millisecond};}function wc(n,t){return new Me.PlainYearMonth(n,t).daysInMonth;}function Se(n,t){return Dt(On(n).add({months:t}));}function Jt(n,t,e){if(t===0)return n;switch(e){case"second":return Dt(On(n).add({seconds:t}));case"minute":return Dt(On(n).add({minutes:t}));case"hour":return Dt(On(n).add({hours:t}));case"day":return Dt(On(n).add({days:t}));case"week":return Dt(On(n).add({weeks:t}));case"month":return Se(n,t);case"quarter":return Se(n,t*3);case"year":return Se(n,t*12);}}function Pf(n){return new Me.PlainDate(n.year,n.month,n.day).dayOfWeek%7;}function vi(n){var e;const t=(e=n.fiscalCalendar)==null?void 0:e.yearStartMonth;return t&&t>=1&&t<=12?t:1;}function Ef(n,t,e){const o={...n,hour:0,minute:0,second:0,millisecond:0};switch(t){case"day":return o;case"week":return Jt(o,-((Pf(n)-e.weekStart+7)%7),"day");case"month":return{...o,day:1};case"quarter":{const r=(n.month-vi(e)+12)%12;return Se({...o,day:1},-(r%3));}case"year":{const r=vi(e);return{...o,year:n.month>=r?n.year:n.year-1,month:r,day:1};}}}function Lr(n,t,e,o=0){if(t==="second"||t==="minute"||t==="hour"){const a=u=>t==="second"?{seconds:u}:t==="minute"?{minutes:u}:{hours:u},s=zn(n).toZonedDateTimeISO(e.tz).round({smallestUnit:t,roundingMode:"floor"}).toInstant().add(a(o));return{start:new Date(s.epochMilliseconds),endExclusive:new Date(s.add(a(1)).epochMilliseconds)};}const r=t,i=Jt(Ef(kc(n,e.tz),r,e),o,t);return{start:Kt(i,e.tz),endExclusive:Kt(Jt(i,1,t),e.tz)};}const Zf=["year","quarter","month","week","day"];function Ti(n,t,e){return Zf.find(o=>{const r=Lr(n,o,e);return r.start.getTime()===n.getTime()&&r.endExclusive.getTime()===t.getTime();})??null;}function mm(n,t,e){return Lr(n,t,e).start;}function lm(n,t,e){return Of(Lr(n,t,e).endExclusive);}function hm(n,t,e,o){return t===0?n:Kt(Jt(kc(n,o.tz),t,e),o.tz);}function ym(n,t,e){const o=r=>zn(r).toZonedDateTimeISO(e).toPlainDate();return o(n).until(o(t),{largestUnit:"days"}).days;}function pm(n,t){const{year:e,month:o,day:r}=$r(n,t);return`${String(e).padStart(4,"0")}-${String(o).padStart(2,"0")}-${String(r).padStart(2,"0")}`;}function kf(n){if(!Ye(n))return null;const{year:t,month:e,day:o}=Ur(n);return e<1||e>12||o<1||o>wc(t,e)?null:{year:t,month:e,day:o};}function wf(n,t){const e=kf(n);if(!e)return null;const o={...e,hour:0,minute:0,second:0,millisecond:0};return{start:Kt(o,t),endExclusive:Kt(Jt(o,1,"day"),t)};}const gm={direction:"last",count:7,unit:"day",includeCurrent:!0,toDate:!1},Bf=/* @__PURE__ */new Set(["minute","hour"]),so=n=>Bf.has(n);function Rf(n){const{direction:t,unit:e}=n;return so(e)?{direction:"last",count:n.count,unit:e,includeCurrent:!0,toDate:!1}:t==="this"||n.count===1&&n.includeCurrent?{direction:"this",count:1,unit:e,includeCurrent:!0,toDate:t==="this"&&n.toDate}:{direction:t,count:n.count,unit:e,includeCurrent:n.includeCurrent,toDate:!1};}function Af(n){const{direction:t,count:e,unit:o}=n;if(so(o)&&t!=="last")return`Only the last ${o}s can be picked.`;if(t==="this")return;if(!Number.isInteger(e)||e<1)return"Enter a whole number, 1 or more.";const r=Si[o];if(e>r)return`At most ${r.toLocaleString("en-US")} ${o}s (ten years).`;}function vm(n){if(Af(n))return;const t=Rf(n);if(so(t.unit))return{kind:"rolling",unit:t.unit,n:t.count,anchor:"now"};const e=t.unit;if(t.direction==="this")return{kind:"periods",unit:e,from:0,to:0,...(t.toDate?{toDate:!0}:{}),anchor:"now"};const[o,r]=t.direction==="last"?t.includeCurrent?[-(t.count-1),0]:[-t.count,-1]:t.includeCurrent?[0,t.count-1]:[1,t.count];return{kind:"periods",unit:e,from:o,to:r,anchor:"now"};}function Tm(n){if(n.kind==="rolling")return n.anchor==="now"&&so(n.unit)?{direction:"last",count:n.n,unit:n.unit,includeCurrent:!0,toDate:!1}:void 0;if(n.kind!=="periods"||n.anchor!=="now")return;const{unit:t,from:e,to:o}=n,r=(i,a,c)=>({direction:i,count:a,unit:t,includeCurrent:c,toDate:!1});if(e===0&&o===0)return{...r("this",1,!0),toDate:!!n.toDate};if(!n.toDate){if(o===0&&e<0)return r("last",1-e,!0);if(o===-1&&e<=-1)return r("last",-e,!1);if(e===0&&o>0)return r("next",o+1,!0);if(e===1&&o>=1)return r("next",o,!1);}}const Dm={side:"before",point:{kind:"ago",count:30,unit:"day"},inclusive:!1};function Yf(n){const{point:t}=n;if(t.kind==="now"||t.kind==="current")return;if(!Number.isInteger(t.count)||t.count<1)return"Enter a whole number, 1 or more.";const e=Si[t.unit];if(t.count>e)return`At most ${e.toLocaleString("en-US")} ${t.unit}s (ten years).`;}function Bc(n){if(n==="<"||n==="<=")return{side:"before",inclusive:n==="<="};if(n===">"||n===">=")return{side:"after",inclusive:n===">="};}const xe=(n,t)=>n==="before"?t?"<=":"<":t?">=":">";function Mm(n){if(Yf(n))return;const{side:t,point:e,inclusive:o}=n;if(e.kind==="now")return{operator:xe(t,t==="before"),window:{kind:"periods",unit:"day",from:0,to:0,toDate:!0,anchor:"now"}};const r=e.kind==="current"?0:e.kind==="ago"?-e.count:e.count;return{operator:xe(t,o),window:{kind:"periods",unit:e.unit,from:r,to:r,anchor:"now"}};}function xf(n,t){var a;const e=(a=Bc(n))==null?void 0:a.side;if(!e||t.kind!=="periods"||t.anchor!=="now"||t.from!==t.to)return;const{unit:o,from:r}=t;if(t.toDate)return o==="day"&&r===0&&n===xe(e,e==="before")?{side:e,point:{kind:"now"},inclusive:!1}:void 0;const i=r===0?{kind:"current",unit:o}:{kind:r<0?"ago":"ahead",count:Math.abs(r),unit:o};return{side:e,point:i,inclusive:n==="<="||n===">="};}function _f(n){if(n.kind==="now")return"now";const{unit:t}=n;if(n.kind==="current")return t==="day"?"today":`this ${t}`;const{count:e}=n;return t==="day"&&e===1?n.kind==="ago"?"yesterday":"tomorrow":`${e} ${e===1?t:`${t}s`} ${n.kind==="ago"?"ago":"from now"}`;}const Uf={"<":"Before","<=":"On or before",">":"After",">=":"On or after"};function Rc(n){return Uf[n];}function $f(n){const t=n.point.kind==="now"?n.side==="before"?"<":">":xe(n.side,n.inclusive);return`${Rc(t)} ${_f(n.point)}`;}function Im(n,t){if(!Bc(n))return;const o=xf(n,t);if(o)return $f(o);const r=Uc(t).label;return`${Rc(n)} the ${$c(n)} of ${r.charAt(0).toLowerCase()}${r.slice(1)}`;}const po={day:1,week:7,month:30.44,quarter:91.31,year:365.25},Lf={day:1,week:7,month:28,quarter:89,year:365},Wf={day:1,week:7,month:31,quarter:92,year:366},Po=24*60*60*1e3;function Di(n){if(n)switch(n.kind){case"relative":return qf(Lc(n.window));case"fixedDay":return{days:1,period:"day"};case"fixedMonth":return{days:wc(n.year,n.month+1),period:"month"};case"range":{const t=Mi(n.start),e=Mi(n.end);if(t===null||e===null||e<t)return;const o=typeof n.end=="string"&&Ye(n.end),r=bi(Math.round(((o?e+Po:e+1)-t)/Po));if(!r||!n.calendar)return r;const i=(s,u,d)=>{var f;return typeof s=="string"&&Ye(s)?(f=wf(s,n.calendar.tz))==null?void 0:f[u==="start"?"start":"endExclusive"]:new Date(d);},a=i(n.start,"start",t),c=i(n.end,"endExclusive",e+1);return a&&c?Ii(r,Ti(a,c,n.calendar)):r;}case"resolved":{const t=Date.parse(n.window.startInclusive),e=Date.parse(n.window.endExclusive);if(!Number.isFinite(t)||!Number.isFinite(e)||e<=t)return;const o=bi(Ni(e-1,n.window.timezone)-Ni(t,n.window.timezone)+1);return!o||!n.calendar?o:Ii(o,Ti(new Date(t),new Date(e),{...n.calendar,tz:n.window.timezone}));}}}function Nm(n){return n.picked?Di({kind:"relative",window:n.picked}):n.whole?Di({kind:"resolved",window:n.whole,calendar:n.calendar}):void 0;}function Mi(n){const t=n instanceof Date?n.getTime():typeof n=="string"?Date.parse(n):Number.NaN;return Number.isFinite(t)?t:null;}function Ii(n,t){return t&&t!=="day"?{days:n.days,period:t}:n;}function Ni(n,t){const e=$r(new Date(n),t);return Date.UTC(e.year,e.month-1,e.day)/Po;}const jf=[31,28,31,30,31,30,31,31,30,31,30,31];function Ac(n,t){const e=n==="month"?t:n==="quarter"?3*t:12*t,o=Math.floor(e/12),r=e%12;let i=r?Number.POSITIVE_INFINITY:0;for(let a=0;r&&a<12;a+=1){let c=0;for(let s=0;s<r;s+=1)c+=jf[(a+s)%12];i=Math.min(i,c);}return o*365+i;}function go(n,t,e){if(n!=="month"&&n!=="quarter"&&n!=="year")return e;const o=Ac(n,t);return o<e.days?{...e,fewestDays:o}:e;}function bi(n){if(!(!Number.isFinite(n)||n<1))return n===1?{days:n,period:"day"}:{days:n};}function zf(n,t){return t==="month"||t==="quarter"||t==="year"?Ac(t,1):t==="week"&&n==="week"?7:1;}function qf(n){if(n)switch(n.kind){case"periods":{const t=n.to-n.from+1,e=t===1?go(n.unit,1,{days:Math.round(po[n.unit]),period:n.unit}):go(n.unit,t,{days:Math.round(t*po[n.unit]),...(n.unit==="day"?{}:{count:t,unit:n.unit})});if(!n.toDate||typeof n.anchor!="object")return e;const o=Math.min(e.fewestDays??e.days,zf(n.unit,n.anchor.lastComplete));return o<e.days?{...e,fewestDays:o}:e;}case"rolling":{if(n.unit==="minute"||n.unit==="hour"){const t=n.unit==="hour"?n.n:n.n/60;return{days:Math.max(1,Math.ceil(t/24)),count:n.n,unit:n.unit};}return go(n.unit,n.n,{days:Math.round(n.n*po[n.unit]),...(n.unit==="day"?{}:{count:n.n,unit:n.unit})});}case"monthDay":return{days:1,period:"day"};default:return;}}function bm(n,t){return!t||n.unit==="period"?!1:(n.matchWeekdays?364:Wf[n.unit])*(n.offset??1)<(t.fewestDays??t.days);}const Gf=["week","month","quarter","year"];function Sm(n){const t=Gf.filter(e=>!n||Lf[e]>n.days&&n.period!==e);return[{kind:"shift",unit:"period"},...t.map(e=>({kind:"shift",unit:e}))];}const Om=["day","week","month","quarter","year"];class et extends Error{constructor(e){super(e);Wr(this,"code");this.name="RawTemporalMetadataContractError",this.code=Wc.invalidMetadata;}}function Hf(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;const t=Object.getPrototypeOf(n);return t===null||t===Object.prototype;}function Vf(n){if(!Hf(n))throw new et("Raw temporal metadata must be an object.");const t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("valueKind"))throw new et("Raw temporal metadata must contain only kind and valueKind.");if(n.kind!=="raw_temporal")throw new et("Raw temporal metadata kind must be raw_temporal.");if(n.valueKind!=="date"&&n.valueKind!=="wall_datetime"&&n.valueKind!=="instant")throw new et("Raw temporal valueKind must be date, wall_datetime, or instant.");return{kind:"raw_temporal",valueKind:n.valueKind};}function Cm(n,t){if(!n.rawTemporal){if(t.metadataRequired)throw new et("Activated raw temporal result is missing metadata.");return;}if(n.temporalBucket)throw new et("A result column cannot carry both raw and grouped temporal metadata.");const e=Vf(n.rawTemporal),o=e.valueKind==="date"?"date":"datetime";if(n.dataType!==o)throw new et(`${e.valueKind} raw temporal values require dataType ${o}.`);return e;}function Yc(n){const t=Ur(n);return!t||t.rest!==""?void 0:Ye(n)?{kind:"date",text:t}:!t.time||t.time.hourDigits!==2||t.time.minute===void 0?void 0:t.offset===void 0?{kind:"wall_datetime",text:t}:(t.offset==="Z"&&n.endsWith("Z")||t.offset.length===6&&t.offset[3]===":")&&!t.spacedOffset?{kind:"instant",text:t}:void 0;}function Fm(n){var t;return(t=Yc(n))==null?void 0:t.kind;}function Kf(n){return n%4===0&&(n%100!==0||n%400===0);}function Jf(n,t){return t===2?Kf(n)?29:28:[4,6,9,11].includes(t)?30:31;}function Xf(n){return n.year>=1&&n.year<=9999&&n.month>=1&&n.month<=12&&n.day>=1&&n.day<=Jf(n.year,n.month)&&n.hour>=0&&n.hour<=23&&n.minute>=0&&n.minute<=59&&n.second>=0&&n.second<=59;}function Qf(n){var t,e,o,r;return{year:n.year,month:n.month??1,day:n.day??1,hour:((t=n.time)==null?void 0:t.hour)??0,minute:((e=n.time)==null?void 0:e.minute)??0,second:((o=n.time)==null?void 0:o.second)??0,fraction:((r=n.time)==null?void 0:r.fraction)??""};}function Pm(n,t){const e=Yc(n);if(!e||e.kind!==t)return{status:"invalid_shape"};const o=Qf(e.text);if(!Xf(o))return{status:"out_of_range"};if(t==="instant"){const r=e.text.offset;if(r&&r!=="Z"){const[a,c]=r.slice(1).split(":").map(Number);if(a>23||c>59)return{status:"out_of_range"};}const i=new Date(n.replace(" ","T"));return Number.isNaN(i.getTime())?{status:"out_of_range"}:{status:"valid",fields:o,instant:i};}return{status:"valid",fields:o};}export{Ti as $,vm as A,zn as B,Om as C,Dm as D,_r as E,om as F,Of as G,rm as H,im as I,$r as J,On as K,um as L,Ff as M,Ur as N,am as O,cm as P,sm as Q,et as R,Ye as S,Me as T,fm as U,wc as V,Sf as W,Pf as X,Ef as Y,Lr as Z,Zf as _,Pm as a,mm as a0,lm as a1,hm as a2,ym as a3,pm as a4,kf as a5,wf as a6,Di as b,Fm as c,Im as d,Nm as e,bm as f,Yf as g,Mm as h,Kt as i,Rc as j,xe as k,Bc as l,$f as m,_f as n,Sm as o,Vf as p,gm as q,xf as r,Jt as s,Af as t,so as u,Cm as v,kc as w,Rf as x,Tm as y,dm as z};
@@ -0,0 +1 @@
1
+ import{jsx as s,Fragment as W,jsxs as d}from"react/jsx-runtime";import Je,{useMemo as B,useState as I,useEffect as M,lazy as re,Suspense as ee,useRef as z,useLayoutEffect as ae,useCallback as P,useId as H}from"react";import{aK as pe,u as A,B as R,aL as Ye,aM as Qe,aN as ea,aO as aa,aP as ta,aQ as ra,aR as sa,aS as na,r as $,q as Le,F as ia,t as ye,v as la,E as oa,S as da,aT as ca,aU as ua,ax as ma,aV as Se,aW as ne,av as Z,P as ha,b as fa,e as ga,g as we,aX as ve,ag as Ue,aY as O,a4 as ce,a5 as ue,a6 as me,a7 as he,a8 as F,aZ as ba,a_ as pa,a$ as va,b0 as ya,b1 as Sa,b2 as wa,b3 as xa,b4 as xe,b5 as Te}from"./appearance-provider-BBYTKSjL.js";import{a as Ta,aQ as Ca,aR as Na,aS as Oe,H as Ea,E as Ia,aT as Aa,aU as ka,aV as J,aW as Fe,aX as Ce,aY as Da,aZ as _a,a_ as Pa,a$ as Ra,F as za,B as La,S as Ua,U as Oa,D as Fa,A as Ba,C as Ma,b0 as Wa,f as ja,g as Va,h as $a,i as Ha,j as Ne,k as Ee,b1 as Ka}from"./semaphor-ready-indicator-Cq3C2SNo.js";import{_ as qa,bR as Ga,n as U,bS as Be}from"./resolve-dashboard-input-context-B5yUS9ZM.js";import{P as Xa}from"./bookmark-state-BmbBu1th.js";import{r as Za,a as Me}from"./availability-3AIOf6Z-.js";import"./validators-U8IL8djK.js";import"./matrix-operation-contract-DceN49RX.js";import"./analytics-base-schemas-DMFrDqn_.js";import{parseValueFormatPreferencesResponse as Ja,canonicalizeSupportedLocale as We,getSupportedCurrencyCodes as Ya,canonicalizeSupportedCurrencyCode as Qa}from"../value-format-preferences/index.js";import{k as je}from"./filter-reach-preview-DSH_k8AJ.js";import{a as et}from"./report-runtime-context-CkxgMKr6.js";import{at as Y,aA as K}from"./pivot-result-contract-expectations-D_ane7I2.js";function at(){return/* @__PURE__ */s("div",{role:"dashboard-plus-main",className:"flex min-h-0 grow basis-0 overflow-hidden",children:/* @__PURE__ */s("section",{className:"flex min-h-0 grow basis-0 flex-col overflow-hidden",children:/* @__PURE__ */s(Ta,{})})});}const tt=/* @__PURE__ */new Set(["iat","exp","nbf","jti"]);function rt(e){return qa(Object.fromEntries(Object.entries(e??{}).filter(([a])=>!tt.has(a))));}function st(e){var t;const a=e==null?void 0:e.config;return Za({features:((t=a==null?void 0:a.projectFeatures)==null?void 0:t.features)??{},config:{enabled:Me(a).enabled},identity:{orgUserId:e==null?void 0:e.orgUserId,tenantId:e==null?void 0:e.tenantId,endUserId:e==null?void 0:e.endUserId},modelConfigured:!0});}let Ie=0;function Ae(e,a){Ie+=1;const{name:t,layout:r}=Me(a==null?void 0:a.config);return{...Na(r),id:Ie,callerKey:e,assistantName:t};}function nt({children:e,authToken:a}){const t=pe(),r=B(()=>a===void 0?t.tokenProps:lt(a),[a,t.tokenProps]),n=B(()=>rt(r),[r]),l=B(()=>st(r).available,[r]),[i,o]=I(()=>Ae(n,r));i.callerKey!==n&&o(Ae(n,r)),ot(i);const m=B(()=>({instance:i,available:l}),[i,l]);return/* @__PURE__ */s(Ca.Provider,{value:m,children:e});}function it({children:e}){return Oe()?/* @__PURE__ */s(W,{children:e}):/* @__PURE__ */s(nt,{children:e});}function lt(e){if(!(e!=null&&e.accessToken))return{};try{return Ga(e.accessToken);}catch{return{};}}function ot(e){M(()=>{const a=(r,n)=>{const l=e.store.getState().focus;l&&!dt(l,r,n)&&e.clearFocus();},t=A.getState();return a(t.selectedSheetId,t.dashboard),A.subscribe((r,n)=>{(r.selectedSheetId!==n.selectedSheetId||r.dashboard!==n.dashboard)&&a(r.selectedSheetId,r.dashboard),r.isVisualEditing&&!n.isVisualEditing&&e.leaveBeside();});},[e]);}function dt(e,a,t){if((a??null)!==e.sheetId)return!1;const r=t?Xa(t,e.cardId):void 0;return!!r&&r.sheet.id===e.sheetId;}const ct=re(()=>import("./assistant-chat-x3NCrm5n.js"));function nr(){const e=Ea(),a=Ia();if(!e.available)return null;const t=a!=="lg";return/* @__PURE__ */d(R,{variant:e.isOpen?"secondary":"outline",size:"xs","aria-pressed":e.isOpen,"aria-label":e.assistantName,title:t?e.assistantName:void 0,onClick:e.toggle,className:t?"w-7 px-0":void 0,children:[/* @__PURE__ */s(Aa,{className:"h-3.5 w-3.5"}),!t&&e.assistantName]});}const ut={"docked-right":"relative shrink-0 border-l border-border","docked-left":"relative order-first shrink-0 border-r border-border",centered:"absolute left-1/2 top-1/2 z-30 h-[min(80%,760px)] w-[min(640px,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-card border border-border shadow-lg","full-page":"absolute inset-0 z-30"},mt="absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg",ht=640,X=8;function ft({surface:e="dashboard"}={}){const a=Oe(),{isOpen:t,mounted:r,storedLayout:n,width:l,beside:i,besideSize:o,focusCardId:m,askCount:b}=Ye((a==null?void 0:a.instance.store)??ka,Qe(g=>{var y;return{isOpen:g.isOpen,mounted:g.mounted,storedLayout:g.layout,width:g.width,beside:g.beside,besideSize:g.besideSize,focusCardId:(y=g.focus)==null?void 0:y.cardId,askCount:g.askCount};})),x=e==="none",u=A(g=>i&&t&&m&&!x?gt(g.dashboard,g.selectedSheetId,m):void 0),f=bt(u,b);if(!(a!=null&&a.available)||!r&&!x)return null;const c=x?"full-page":f.shown?"beside-card":n,w=x||t,h=c==="docked-right"||c==="docked-left";return/* @__PURE__ */d("aside",{ref:f.setFloating,"aria-label":a.instance.assistantName,"data-testid":"assistant-panel","data-layout":c,"data-beside-frame":c==="beside-card"?u:void 0,"data-beside-side":c==="beside-card"?f.side:void 0,className:U("flex-col bg-background",c==="beside-card"?mt:ut[c],w?"flex":"hidden"),style:c==="beside-card"?{...f.style,width:o.width,height:o.height}:h?{width:l,maxWidth:`${Ve*100}%`}:void 0,onKeyDown:c==="beside-card"?g=>{if(g.key!=="Escape"||g.defaultPrevented||!(g.target instanceof Node)||!g.currentTarget.contains(g.target))return;g.preventDefault();const y=f.cardActions();a.instance.close(),y==null||y.focus();}:void 0,children:[h?/* @__PURE__ */s(yt,{instance:a.instance,side:c==="docked-left"?"right":"left",width:l}):null,c==="beside-card"?/* @__PURE__ */s(vt,{instance:a.instance,size:o,side:f.handleSide}):null,/* @__PURE__ */s(ee,{fallback:null,children:/* @__PURE__ */s(ct,{instance:a.instance,surface:e,placement:c},a.instance.id)})]});}function gt(e,a,t){var n,l,i;const r=(n=e.sheets)==null?void 0:n.find(o=>o.id===a);return(i=(l=r==null?void 0:r.frames)==null?void 0:l.find(o=>{var m;return(m=o.cards)==null?void 0:m.some(b=>b.id===t);}))==null?void 0:i.id;}function bt(e,a){var w;const[t,r]=I(void 0),[n,l]=I(void 0),i=z(a);ae(()=>{i.current=a;});const o=n===a?null:t,{refs:m,elements:b,floatingStyles:x,middlewareData:u,isPositioned:f}=ea({strategy:"absolute",placement:o??"right-start",middleware:[aa(X),ta({padding:X}),ra({padding:X,apply:({availableWidth:h,availableHeight:g,elements:y})=>{y.floating.style.setProperty("--assistant-beside-max-w",`${Math.max(0,h)}px`),y.floating.style.setProperty("--assistant-beside-max-h",`${Math.max(0,g)}px`);}}),sa()],whileElementsMounted:(h,g,y)=>na(h,g,()=>{const E=pt(h,g);r(E),E===null&&l(i.current),y();})}),c=b.floating;return ae(()=>{m.setReference(e?ke(c==null?void 0:c.parentElement,e):null);},[e,c,m]),{shown:e!==void 0&&o!==null&&b.reference!==null,setFloating:m.setFloating,style:{...x,...(!f||(w=u.hide)!=null&&w.referenceHidden?{visibility:"hidden"}:{})},side:o??void 0,handleSide:o==="left-start"?"left":"right",cardActions:()=>{var h;return e?(h=ke(c==null?void 0:c.parentElement,e))==null?void 0:h.querySelector("[data-card-actions]"):null;}};}function ke(e,a){return e?Array.from(e.querySelectorAll("[data-frame-id]")).find(t=>t.dataset.frameId===a)??null:null;}function pt(e,a){const t=a.parentElement;if(!t||!e.isConnected)return null;const r=t.getBoundingClientRect();if(r.width<ht)return null;const n=e.getBoundingClientRect(),{min:l}=Fe,i=(o,m)=>o>=l.width+2*X&&m>=l.height+2*X;return i(r.right-n.right,r.height)?"right-start":i(n.left-r.left,r.height)?"left-start":i(r.width,r.bottom-n.bottom)?"bottom-start":null;}function vt({instance:e,size:a,side:t}){const r=z(void 0),n=t==="left"?-1:1,l=i=>{const o=r.current;return{width:o.start.width+n*(i.clientX-o.x),height:o.start.height+(i.clientY-o.y)};};return/* @__PURE__ */s("div",{role:"separator","aria-label":"Resize assistant",tabIndex:0,title:"Drag to resize. Double-click to reset.",onPointerDown:i=>{var o,m;i.preventDefault(),(m=(o=i.currentTarget).setPointerCapture)==null||m.call(o,i.pointerId),r.current={x:i.clientX,y:i.clientY,start:a};},onPointerMove:i=>{r.current&&e.setBesideSize(l(i));},onPointerUp:i=>{r.current&&(e.setBesideSize(l(i),{save:!0}),r.current=void 0);},onPointerCancel:()=>{r.current=void 0;},onKeyDown:i=>{const o={ArrowLeft:{width:-n*V,height:0},ArrowRight:{width:n*V,height:0},ArrowUp:{width:0,height:-V},ArrowDown:{width:0,height:V}}[i.key];o&&(i.preventDefault(),e.setBesideSize({width:a.width+o.width,height:a.height+o.height},{save:!0}));},onDoubleClick:()=>e.setBesideSize(Fe.default,{save:!0}),className:U("absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",t==="left"?"left-0 cursor-nesw-resize rounded-bl-card":"right-0 cursor-nwse-resize rounded-br-card")});}const V=16,Ve=0.6;function yt({instance:e,side:a,width:t}){const r=z(void 0),n=u=>{var c,w;const f=(w=(c=u.closest("aside"))==null?void 0:c.parentElement)==null?void 0:w.clientWidth;return f?f*Ve:J.max;},l=u=>{var f;return((f=u.closest("aside"))==null?void 0:f.getBoundingClientRect().width)||t;},i=u=>{const f=r.current;if(!f)return t;const c=u-f.startX;return Ce(f.startWidth+(a==="left"?-c:c),f.maxForArea);},o=u=>{var f,c;u.preventDefault(),(c=(f=u.currentTarget).setPointerCapture)==null||c.call(f,u.pointerId),r.current={startX:u.clientX,startWidth:l(u.currentTarget),maxForArea:n(u.currentTarget)};},m=u=>{r.current&&e.setWidth(i(u.clientX));},b=u=>{r.current&&(e.setWidth(i(u.clientX),{save:!0}),r.current=void 0);},x=u=>{if(u.key!=="ArrowLeft"&&u.key!=="ArrowRight")return;u.preventDefault();const f=u.key==="ArrowLeft"==(a==="left");e.setWidth(Ce(l(u.currentTarget)+(f?V:-V),n(u.currentTarget)),{save:!0});};return/* @__PURE__ */s("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize assistant","aria-valuenow":t,"aria-valuemin":J.min,"aria-valuemax":J.max,tabIndex:0,title:"Drag to resize. Double-click to reset.",onPointerDown:o,onPointerMove:m,onPointerUp:b,onPointerCancel:b,onKeyDown:x,onDoubleClick:()=>e.setWidth(J.default,{save:!0}),className:U("absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",a==="left"?"-left-[3px]":"-right-[3px]")});}function St(e){const a=Da();return P(async(t,r)=>{const n=A.getState();if(n.isVisualEditing)return xt(t,a,e,r);if(!e())return{ok:!1,reason:"not_editable",message:$.no_save};if(n.dashboard!==t.basedOn)return{ok:!1,reason:"dashboard_changed",message:$.dashboard_changed};const l=je(t.basedOn,t.operations,t.context);if(!l.ok)return{ok:!1,reason:"refused",message:l.failedAt.message};const i={domainsById:{}};for(const o of l.queryFrames){const m=await a(o,{reuseLoaded:!0}).catch(b=>{console.warn("Applying the change without refreshed semantic metadata:",b);});Le(i,m);}return r!=null&&r.stillWanted&&!r.stillWanted()?{ok:!1,reason:"dropped"}:e()?A.getState().actions.applyProposal({...t,semanticExecutionPayload:i}):{ok:!1,reason:"not_editable",message:$.no_save};},[e,a]);}const q={other_changes:"Not applied: while you're editing a card, I can change only that card.",changed:"Not applied: the card changed while I was answering.",closed:"Not applied: the editor closed while I was answering."},fe=/* @__PURE__ */new WeakMap();function wt(e,a){var n,l;const t=(n=fe.get(e))==null?void 0:n.get(a);if(t)return t;if(!Be(e,a.id))return;const r={...e,sheets:(l=e.sheets)==null?void 0:l.map(i=>{var o;return{...i,frames:(o=i.frames)==null?void 0:o.map(m=>m.cards.some(b=>b.id===a.id)?{...m,cards:m.cards.map(b=>b.id===a.id?a:b)}:m)};})};return $e(e,a,r),r;}function $e(e,a,t){const r=fe.get(e)??/* @__PURE__ */new WeakMap();r.set(a,t),fe.set(e,r);}async function xt(e,a,t,r){var x;if(!t())return{ok:!1,reason:"not_editable",message:$.no_save};const n=A.getState().dashboard,l=ia.getState().card;if(e.basedOn===n)return{ok:!1,reason:"not_editable",message:$.not_editable};if(!n||e.basedOn!==wt(n,l))return{ok:!1,reason:"dashboard_changed",message:q.changed};if(!e.operations.every(u=>u.op==="card.update"&&u.cardId===l.id))return{ok:!1,reason:"not_editable",message:q.other_changes};const i=je(e.basedOn,e.operations,e.context);if(!i.ok)return{ok:!1,reason:"refused",message:i.failedAt.message};const o=(x=Be(i.dashboard,l.id))==null?void 0:x.card;if(!o)return{ok:!1,reason:"refused",message:q.other_changes};const m={domainsById:{}};for(const u of i.queryFrames){const f=await a(u,{reuseLoaded:!0}).catch(c=>{console.warn("Changing the card without refreshed semantic metadata:",c);});Le(m,f);}if(r!=null&&r.stillWanted&&!r.stillWanted())return{ok:!1,reason:"dropped"};if(!t())return{ok:!1,reason:"not_editable",message:$.no_save};const b=A.getState().actions.adoptIntoEditedCard({draft:l,dashboard:n,changed:o,semanticExecutionPayload:m});return b==="closed"?{ok:!1,reason:"dashboard_changed",message:q.closed}:b==="changed"?{ok:!1,reason:"dashboard_changed",message:q.changed}:($e(A.getState().dashboard,o,i.dashboard),{ok:!0,after:i.dashboard,inDraft:!0});}function Tt(e){const{canEditDashboard:a,isInspectionMode:t}=_a(),r=Pa(),n=A(ye),l=e&&r&&a===!0&&!t,i=z(l);ae(()=>{i.current=l;});const o=P(()=>i.current&&ye(A.getState()),[]);return{canChange:l&&n,canChangeNow:o};}const He={dashboard_changed:"Not applied: the dashboard on screen changed after this change was prepared.",not_editable:"Not applied: the dashboard can't be changed on screen right now (the editor is open, or Save isn't shown).",expired:"Not applied: it arrived after the time it had to land.",refused:"Not applied: the change no longer fits the dashboard."},G={changed:"Changed by your assistant",undo:"Undo",changedSince:"Changed since. Cancel discards every unsaved change.",closeEditorToUndo:"Close the editor to undo."};function Ct({port:e,onLifecycleEvent:a}){const{canChange:t,canChangeNow:r}=Tt(!0),n=A(c=>{var w;return(w=c.dashboard)==null?void 0:w.id;}),l=St(r),[i,o]=I(null),m=z(/* @__PURE__ */new Map()),b=z(/* @__PURE__ */new Map()),x=z(Promise.resolve()),u=z({apply:l,onLifecycleEvent:a});ae(()=>{u.current={apply:l,onLifecycleEvent:a};}),M(()=>{e.setScreenState({eligible:t,...(n?{dashboardId:n}:{})});},[e,t,n]),M(()=>A.subscribe((c,w)=>{if(c.editSessionEpoch!==w.editSessionEpoch){m.current.clear(),o(null);return;}if(c.dashboard!==w.dashboard)for(const[h,g]of m.current)g!==c.dashboard&&m.current.delete(h);}),[]),M(()=>{const c=h=>{const g=A.getState().dashboard;if(!g||g.id!==h.dashboardId)return;const y=It();m.current.set(y,g),e.answerCopyRequest({kind:"uploaded",screenId:e.screenId,requestId:h.requestId,revisionId:y,dashboard:g});},w=async(h,g)=>{var p,S,C;const y=b.current.get(h.deliveryId);if(y){e.reportOutcome({screenId:e.screenId,deliveryId:h.deliveryId,outcome:y});return;}const E=m.current.get(h.revisionId),k=()=>!E||m.current.get(h.revisionId)!==E?"dashboard_changed":performance.now()<g+h.applyWithinMs?null:"expired",_=k();let D;if(_||!E)D=Q(_??"dashboard_changed");else{let v="expired";const j=await u.current.apply({proposalId:h.proposalId,operations:h.operations,context:h.context,basedOn:E},{stillWanted:()=>{const L=k();return L&&(v=L),L===null;}});D=Et(j,v);}if(b.current.set(h.deliveryId,D),e.reportOutcome({screenId:e.screenId,deliveryId:h.deliveryId,outcome:D}),D.status!=="applied")return;const N=((p=A.getState().dashboard)==null?void 0:p.id)??"";o({deliveryId:h.deliveryId,proposalId:h.proposalId,summary:h.summary,dashboardId:N,words:null}),(C=(S=u.current).onLifecycleEvent)==null||C.call(S,{type:"dashboard:change-applied",dashboardId:N,payload:{deliveryId:h.deliveryId,summary:h.summary}});};return e.subscribe(h=>{if(h.type==="copy_request"){c(h);return;}const g=performance.now();x.current=x.current.then(()=>w(h,g).catch(y=>console.error("[live-screen] a delivery failed",y)));});},[e]);const f=P(()=>{var w,h;if(!i)return;const c=A.getState().actions.undoProposal(i.proposalId);c.ok?((h=(w=u.current).onLifecycleEvent)==null||h.call(w,{type:"dashboard:change-undone",dashboardId:i.dashboardId,payload:{deliveryId:i.deliveryId,summary:i.summary}}),o(null)):c.reason==="changed_since"?o({...i,words:"changed_since"}):c.reason==="not_editable"?o({...i,words:"not_editable"}):o(null);},[i]);return i?/* @__PURE__ */s(Nt,{note:i,onUndo:f}):null;}function Nt({note:e,onUndo:a}){const t=A(i=>la(i,e.proposalId)),r=A(i=>i.isVisualEditing);if(t==="none"&&e.words===null)return null;const n=e.words==="changed_since"||t==="changed_since",l=n?"changed_since":e.words==="not_editable"?"not_editable":t;return/* @__PURE__ */d("div",{className:"flex min-h-8 items-center gap-2 border-b border-border bg-muted/40 px-3 py-1 text-xs text-muted-foreground","data-testid":"live-change-note","data-note-state":l,role:"status",children:[/* @__PURE__ */d("span",{className:"truncate",title:e.summary.join(" "),children:[G.changed,n?`. ${G.changedSince}`:e.words==="not_editable"?`. ${G.closeEditorToUndo}`:""]}),!n&&t==="undoable"?/* @__PURE__ */d(W,{children:[/* @__PURE__ */s("span",{"aria-hidden":"true",children:"·"}),/* @__PURE__ */d(R,{variant:"outline",size:"xs",className:"h-6 gap-1 px-2 text-[11.5px]",disabled:r,title:r?G.closeEditorToUndo:void 0,onClick:a,children:[/* @__PURE__ */s(Ra,{className:"h-3 w-3"}),G.undo]})]}):null]});}function Et(e,a){if(e.ok)return{status:"applied"};switch(e.reason){case"dashboard_changed":case"not_editable":return Q(e.reason);case"refused":return{status:"not_applied",reason:"refused",message:(e.message||He.refused).slice(0,500)};case"dropped":return Q(a);case"previous_not_applied":return Q("refused");}}function Q(e){return{status:"not_applied",reason:e,message:He[e]};}function It(){return globalThis.crypto.randomUUID();}const At=re(()=>import("./dashboard-controls-Bwjy9G1i.js")),kt=re(()=>import("./edit-dashboard-visual-BF3mfrWf.js")),Dt=re(()=>import("./dashboard-json-B9lK28i0.js"));function ir({showControls:e=!1,showFooter:a=!0,liveScreen:t,...r}){const n=A(o=>o.showDashboardJSON),{appearance:l,preferences:i}=r;return/* @__PURE__ */s(oa,{FallbackComponent:za,children:/* @__PURE__ */s(da,{dashboardProps:r,children:/* @__PURE__ */d(La,{children:[/* @__PURE__ */s(Ua,{componentType:"surfboard",componentId:r.id}),/* @__PURE__ */d(Oa,{appearance:l,children:[/* @__PURE__ */s(ca,{toastOptions:{classNames:{toast:"max-w-[calc(100vw-2rem)] overflow-x-hidden !items-start [--toast-close-button-end:0.5rem] [--toast-close-button-start:auto] [--toast-close-button-transform:translate(0,0)] sm:max-w-[44rem]",content:"min-w-0 flex-1",icon:"mt-0.5 shrink-0",title:"max-w-full break-words pr-8",description:"max-w-full break-words",closeButton:"!top-2 h-6 w-6 rounded-md border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground"}}}),/* @__PURE__ */d(Fa,{preferences:i,children:[n&&/* @__PURE__ */s(ee,{fallback:null,children:/* @__PURE__ */s(Dt,{})}),/* @__PURE__ */s(Ba,{children:/* @__PURE__ */s(it,{children:/* @__PURE__ */d("main",{className:"relative flex h-full w-full flex-col overflow-hidden",children:[e&&/* @__PURE__ */s(ee,{fallback:null,children:/* @__PURE__ */s(At,{})}),t&&/* @__PURE__ */s(Ct,{port:t,onLifecycleEvent:r.onDashboardLifecycleEvent}),/* @__PURE__ */d("div",{className:"relative flex grow overflow-hidden",children:[/* @__PURE__ */s("div",{className:"flex min-w-0 flex-1",children:/* @__PURE__ */s(Ma,{...r,type:"dashboard",children:/* @__PURE__ */s(_t,{})})}),/* @__PURE__ */s(ft,{})]})]})})})]})]})]})})});}function _t(){const e=A(t=>t.isVisualEditing),a=B(()=>/* @__PURE__ */s(ua.Provider,{value:!0,children:/* @__PURE__ */s(at,{})}),[]);return/* @__PURE__ */d("div",{className:"relative flex min-h-0 min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */s("div",{className:"flex min-h-0 grow basis-0 flex-col",style:e?{visibility:"hidden"}:void 0,inert:e||void 0,"aria-hidden":e||void 0,"data-dashboard-hidden":e||void 0,children:a}),e&&/* @__PURE__ */s("div",{className:"absolute inset-0 z-10 flex flex-col",children:/* @__PURE__ */s(ee,{fallback:null,children:/* @__PURE__ */s(kt,{})})})]});}function Pt(e={}){const{authToken:a,tokenProps:t}=pe(),r=A(N=>N.actions.applyResolvedCalendarPreferences),n=e.enabled??!0,l=(a==null?void 0:a.accessToken)??null,i=(t==null?void 0:t.apiServiceUrl)??null,[o,m]=I(!1),[b,x]=I(!1),[u,f]=I(!1),[c,w]=I(null),[h,g]=I(null),y=z(l);y.current=l,M(()=>{g(null),w(null),m(!1),x(!1),f(!1);},[l]);const E=P(async N=>{const p=et(await N.json());if(!p.ok)throw new Error("Calendar preferences response is invalid");return p.value;},[]),k=P(async()=>{if(!n||!l||!i)return;const N=l;m(!0),w(null);try{const p=await fetch(`${i}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${l}`}});if(!p.ok){const C=await p.json().catch(()=>({}));throw new Error(C.error||"Failed to fetch preferences");}const S=await E(p);y.current===N&&g(S);}catch(p){y.current===N&&w(p instanceof Error?p.message:"Unknown error");}finally{y.current===N&&m(!1);}},[l,i,n,E]);M(()=>{n&&k();},[n,k]);const _=P(async N=>{if(!l||!i)return w("Not authenticated"),!1;const p=l;x(!0),w(null);try{const S=await fetch(`${i}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(N)});if(!S.ok){const v=await S.json().catch(()=>({}));throw new Error(v.error||"Failed to update preferences");}const C=await E(S);return y.current!==p?!1:(g(C),r(C.resolved,C.sources),!0);}catch(S){return y.current===p&&w(S instanceof Error?S.message:"Unknown error"),!1;}finally{y.current===p&&x(!1);}},[l,i,r,E]),D=P(async()=>{if(!l||!i)return w("Not authenticated"),!1;const N=l;f(!0),w(null);try{const p=await fetch(`${i}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}});if(!p.ok){const C=await p.json().catch(()=>({}));throw new Error(C.error||"Failed to clear preferences");}const S=await E(p);return y.current!==N?!1:(g(S),r(S.resolved,S.sources),!0);}catch(p){return y.current===N&&w(p instanceof Error?p.message:"Unknown error"),!1;}finally{y.current===N&&f(!1);}},[l,i,r,E]);return{preferences:h,isLoading:o,isSaving:b,isClearing:u,error:c,updatePreferences:_,clearPreferences:D,refetch:k};}const te=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],Ke=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],De="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function Rt(){try{const e=Intl;if(e.supportedValuesOf)return e.supportedValuesOf("timeZone");}catch{}return te.map(e=>e.value);}function zt(e){if(!e)return"default";if(e.tz!==e.weekStart)return"inherited";switch(e.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default";}}function _e(e){const a=te.find(t=>t.value===e);return a?a.label:e;}function Lt(e){const a=Ke.find(t=>t.value===e);return a?a.label:String(e);}function Ut({active:e,onClose:a}){const{preferences:t,isLoading:r,isSaving:n,isClearing:l,updatePreferences:i,clearPreferences:o}=Pt({enabled:e}),m=ma(),b=(t==null?void 0:t.resolved.tz)||(m==null?void 0:m.tz)||"UTC",x=(t==null?void 0:t.resolved.weekStart)??(m==null?void 0:m.weekStart)??1,[u,f]=I((t==null?void 0:t.stored)===null),[c,w]=I(!1),[h,g]=I(b),[y,E]=I(x),[k,_]=I(!1),D=B(()=>Rt(),[]),N=B(()=>D.filter(T=>!te.some(Ze=>Ze.value===T)),[D]),p=B(()=>_e(h),[h]),S=t!=null&&t.inherited?_e(t.inherited.tz):"UTC",C=t!=null&&t.inherited?Lt(t.inherited.weekStart):"Monday",v=zt(t==null?void 0:t.inheritedSources);Je.useEffect(()=>{if(!e){w(!1);return;}c||(t&&f(t.stored===null),g(b),E(x));},[e,c,t,b,x]);const j=async()=>{if(r){O.error("Preferences are still loading. Please try again.");return;}u?(await o())?(O.success("Now using default settings."),a()):O.error("Failed to save preferences. Please try again."):(await i({tz:h,weekStart:y}))?(O.success("Preferences saved."),a()):O.error("Failed to save preferences. Please try again.");},L=()=>{a();},se=n||l,Xe=se||r;return/* @__PURE__ */d(W,{children:[/* @__PURE__ */d("div",{className:"space-y-4 py-1",children:[/* @__PURE__ */d(Se,{value:u?"defaults":"custom",onValueChange:T=>{w(!0),f(T==="defaults");},className:"space-y-0.5",children:[/* @__PURE__ */d("label",{htmlFor:"mode-defaults",className:U("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",u&&"bg-muted/50"),onClick:()=>{w(!0),f(!0);},children:[/* @__PURE__ */s(ne,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),/* @__PURE__ */d("div",{className:"flex-1 min-w-0",children:[/* @__PURE__ */d("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",v," defaults"]}),/* @__PURE__ */d("p",{className:"text-[12px] text-muted-foreground",children:[S,", week starts ",C]})]})]}),/* @__PURE__ */d("label",{htmlFor:"mode-custom",className:U("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!u&&"bg-muted/50"),onClick:()=>{w(!0),f(!1);},children:[/* @__PURE__ */s(ne,{value:"custom",id:"mode-custom",className:"mt-0.5"}),/* @__PURE__ */s("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),/* @__PURE__ */d("div",{className:U("space-y-4 border-t border-border/60 pt-4 transition-opacity",u&&"pointer-events-none opacity-50"),children:[/* @__PURE__ */d("div",{className:"space-y-1.5",children:[/* @__PURE__ */s(Z,{className:De,children:"Timezone"}),/* @__PURE__ */d(ha,{open:k,onOpenChange:_,modal:!0,children:[/* @__PURE__ */s(fa,{asChild:!0,children:/* @__PURE__ */d(R,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:u,children:[/* @__PURE__ */s("span",{className:"truncate",children:p}),/* @__PURE__ */s(Wa,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),/* @__PURE__ */s(ga,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:/* @__PURE__ */d(ja,{className:"overflow-visible",children:[/* @__PURE__ */s(Va,{placeholder:"Search timezones…"}),/* @__PURE__ */d($a,{children:[/* @__PURE__ */s(Ha,{children:"No timezone found."}),/* @__PURE__ */s(Ne,{heading:"Common",children:te.map(T=>/* @__PURE__ */d(Ee,{value:`${T.value} ${T.label}`,onSelect:()=>{w(!0),g(T.value),_(!1);},children:[/* @__PURE__ */s(we,{className:U("h-3.5 w-3.5",h===T.value?"opacity-100":"opacity-0")}),/* @__PURE__ */s("span",{className:"flex-1",children:T.label}),/* @__PURE__ */s("span",{className:"text-[11px] text-muted-foreground",children:T.value})]},T.value))}),/* @__PURE__ */s(Ka,{}),/* @__PURE__ */s(Ne,{heading:"All timezones",children:N.map(T=>/* @__PURE__ */d(Ee,{value:T,onSelect:()=>{w(!0),g(T),_(!1);},children:[/* @__PURE__ */s(we,{className:U("h-3.5 w-3.5",h===T?"opacity-100":"opacity-0")}),T]},T))})]})]})})]})]}),/* @__PURE__ */d("div",{className:"space-y-1.5",children:[/* @__PURE__ */s(Z,{className:De,children:"Week starts on"}),/* @__PURE__ */s(Se,{value:String(y),onValueChange:T=>{w(!0),E(Number(T));},className:"flex gap-4",disabled:u,children:Ke.map(T=>/* @__PURE__ */d("label",{htmlFor:`week-start-${T.value}`,className:U("flex cursor-pointer items-center gap-2 text-[13px]",u&&"cursor-not-allowed"),children:[/* @__PURE__ */s(ne,{value:String(T.value),id:`week-start-${T.value}`,disabled:u}),T.label]},T.value))})]})]})]}),/* @__PURE__ */d(ve,{children:[/* @__PURE__ */s(R,{variant:"outline",size:"xs",onClick:L,disabled:se,children:"Cancel"}),/* @__PURE__ */s(R,{size:"xs",onClick:j,disabled:Xe,children:se?/* @__PURE__ */d(W,{children:[/* @__PURE__ */s(Ue,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]});}function Ot(e={}){const{authToken:a,tokenProps:t}=pe(),r=A(p=>p.actions.applyResolvedValueFormatPreferences),n=e.enabled??!0,l=(a==null?void 0:a.accessToken)??null,i=(t==null?void 0:t.apiServiceUrl)??null,o=z(l);o.current=l;const[m,b]=I(null),[x,u]=I(!1),[f,c]=I(!1),[w,h]=I(!1),[g,y]=I(null);M(()=>{b(null),y(null),u(!1),c(!1),h(!1);},[l]);const E=P(async p=>{const S=Ja(await p.json());if(!S.ok)throw new Error("Value format preferences response is invalid");return S.value;},[]),k=P(async(p,S)=>{if(!l||!i)throw new Error("Not authenticated");const C=await fetch(`${i}/v1/user-preferences/value-format`,{method:p,headers:{Authorization:`Bearer ${l}`,...(S?{"Content-Type":"application/json"}:{})},body:S?JSON.stringify(S):void 0});if(!C.ok){const v=await C.json().catch(()=>({}));throw new Error(v.error||"Failed to update preferences");}return E(C);},[l,i,E]),_=P(async()=>{if(!n||!l||!i)return;const p=l;u(!0),y(null);try{const S=await k("GET");o.current===p&&b(S);}catch(S){o.current===p&&y(S instanceof Error?S.message:"Unknown error");}finally{o.current===p&&u(!1);}},[l,i,n,k]);M(()=>{n&&_();},[n,_]);const D=P(async p=>{const S=l;c(!0),y(null);try{const C=await k("PATCH",p);return o.current!==S?!1:(b(C),r(C.resolved,C.sources),!0);}catch(C){return o.current===S&&y(C instanceof Error?C.message:"Unknown error"),!1;}finally{o.current===S&&c(!1);}},[l,r,k]),N=P(async()=>{const p=l;h(!0),y(null);try{const S=await k("DELETE");return o.current!==p?!1:(b(S),r(S.resolved,S.sources),!0);}catch(S){return o.current===p&&y(S instanceof Error?S.message:"Unknown error"),!1;}finally{o.current===p&&h(!1);}},[l,r,k]);return{preferences:m,isLoading:x,isSaving:f,isClearing:w,error:g,updatePreferences:D,clearPreferences:N,refetch:_};}const ge=[{value:"en-US",label:"English (United States)"},{value:"en-GB",label:"English (United Kingdom)"},{value:"de-DE",label:"German (Germany)"},{value:"fr-FR",label:"French (France)"},{value:"es-ES",label:"Spanish (Spain)"},{value:"it-IT",label:"Italian (Italy)"},{value:"nl-NL",label:"Dutch (Netherlands)"},{value:"pt-BR",label:"Portuguese (Brazil)"},{value:"ja-JP",label:"Japanese (Japan)"},{value:"en-IN",label:"English (India)"},{value:"en-AU",label:"English (Australia)"},{value:"en-NZ",label:"English (New Zealand)"},{value:"mi-NZ",label:"Māori (New Zealand)"}],qe=/* @__PURE__ */new Set(["USD","EUR","GBP","CAD","AUD","JPY","CHF","INR","BRL","KWD"]),Ft=Ya(),Bt=Ft.filter(e=>!qe.has(e)),Ge=[{value:"short",label:"Short"},{value:"medium",label:"Medium"},{value:"long",label:"Long"}],Pe="2026-07-31",ie="2026-07-31T14:30:45";function be(e){switch(e){case"viewer_user":return"user";case"viewer_tenant_user":return"tenant user";case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"session_initial":return"embedded session";case"system_default":return"system";default:return"another preference level";}}function le(e){var a;return((a=Ge.find(t=>t.value===e))==null?void 0:a.label)??e;}function Mt(e){const a=ge.find(t=>t.value===e);return a?`${a.label} — ${a.value}`:e;}function oe(e){return{short:e("short"),medium:e("medium"),long:e("long")};}function de({id:e,label:a,value:t,inherited:r,inheritedSource:n,examples:l,disabled:i,onValueChange:o}){const m=t===void 0?`Inherited · ${le(r)}`:le(t);return/* @__PURE__ */d("div",{className:"space-y-1.5",children:[/* @__PURE__ */s(Z,{htmlFor:e,className:"text-[11px] text-muted-foreground",children:a}),/* @__PURE__ */d(ce,{value:t??"inherit",disabled:i,onValueChange:o,children:[/* @__PURE__ */s(ue,{id:e,size:"xs",children:/* @__PURE__ */s(me,{children:m})}),/* @__PURE__ */d(he,{children:[/* @__PURE__ */s(F,{value:"inherit",className:"[&>span:last-child]:w-full",children:/* @__PURE__ */d("span",{className:"flex w-full min-w-0 items-center justify-between gap-4",children:[/* @__PURE__ */d("span",{children:["Inherited from ",be(n)," ·"," ",le(r)]}),/* @__PURE__ */s("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:l[r]})]})}),Ge.map(b=>/* @__PURE__ */s(F,{value:b.value,className:"[&>span:last-child]:w-full",children:/* @__PURE__ */d("span",{className:"flex w-full min-w-0 items-center justify-between gap-4",children:[/* @__PURE__ */s("span",{children:b.label}),/* @__PURE__ */s("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:l[b.value]})]})},b.value))]})]})]});}function Wt({value:e,inherited:a,inheritedSources:t,onChange:r,disabled:n}){var N,p,S,C;const l=H(),i=H(),o=H(),m=H(),b=H(),u=(e.locale===void 0?void 0:We(e.locale))??a.locale,f=e.defaultCurrency??a.defaultCurrency,c={locale:u,dateStyle:e.dateStyle??a.dateStyle,dateTime:{dateStyle:((N=e.dateTime)==null?void 0:N.dateStyle)??a.dateTime.dateStyle,timeStyle:((p=e.dateTime)==null?void 0:p.timeStyle)??a.dateTime.timeStyle},defaultCurrency:f},w=new Intl.NumberFormat(u,{style:"currency",currency:f}).format(1e3),h=Y({preferences:c,calendar:{tz:"UTC"}}),g=K({value:Pe,metadata:{kind:"raw_temporal",valueKind:"date"},format:h}).text,y=K({value:ie,metadata:{kind:"raw_temporal",valueKind:"wall_datetime"},format:h}).text,E=oe(v=>K({value:Pe,metadata:{kind:"raw_temporal",valueKind:"date"},format:Y({preferences:{...c,dateStyle:v},calendar:{tz:"UTC"}})}).text),k=oe(v=>K({value:ie,metadata:{kind:"raw_temporal",valueKind:"wall_datetime"},format:Y({preferences:{...c,dateTime:{...c.dateTime,dateStyle:v}},calendar:{tz:"UTC"}})}).text),_=oe(v=>K({value:ie,metadata:{kind:"raw_temporal",valueKind:"wall_datetime"},format:Y({preferences:{...c,dateTime:{...c.dateTime,timeStyle:v}},calendar:{tz:"UTC"}})}).text),D=(v,j)=>{const L={...e.dateTime,[v]:j==="inherit"?void 0:j};r({...e,dateTime:L.dateStyle===void 0&&L.timeStyle===void 0?void 0:L});};return/* @__PURE__ */d("div",{className:"space-y-4",children:[/* @__PURE__ */d("div",{className:"space-y-1.5",children:[/* @__PURE__ */s(Z,{htmlFor:l,className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Locale"}),/* @__PURE__ */d(ce,{value:e.locale??"inherit",disabled:n,onValueChange:v=>r({...e,locale:v==="inherit"?void 0:v}),children:[/* @__PURE__ */s(ue,{id:l,size:"xs",children:/* @__PURE__ */s(me,{children:e.locale===void 0?`Inherited · ${a.locale}`:Mt(e.locale)})}),/* @__PURE__ */d(he,{children:[/* @__PURE__ */d(F,{value:"inherit",children:["Inherited from ",be(t.locale)," ·"," ",a.locale]}),e.locale&&!ge.some(v=>v.value===e.locale)&&/* @__PURE__ */s(F,{value:e.locale,children:e.locale}),ge.map(v=>/* @__PURE__ */d(F,{value:v.value,children:[v.label," — ",v.value]},v.value))]})]})]}),/* @__PURE__ */d("fieldset",{className:"space-y-2",children:[/* @__PURE__ */s("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Date values"}),/* @__PURE__ */s(de,{id:o,label:"Format",value:e.dateStyle,inherited:a.dateStyle,inheritedSource:t.dateStyle,examples:E,disabled:n,onValueChange:v=>r({...e,dateStyle:v==="inherit"?void 0:v})})]}),/* @__PURE__ */d("fieldset",{className:"space-y-2",children:[/* @__PURE__ */s("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Date & time values"}),/* @__PURE__ */s(de,{id:m,label:"Date",value:(S=e.dateTime)==null?void 0:S.dateStyle,inherited:a.dateTime.dateStyle,inheritedSource:t.dateTime.dateStyle,examples:k,disabled:n,onValueChange:v=>D("dateStyle",v)}),/* @__PURE__ */s(de,{id:b,label:"Time",value:(C=e.dateTime)==null?void 0:C.timeStyle,inherited:a.dateTime.timeStyle,inheritedSource:t.dateTime.timeStyle,examples:_,disabled:n,onValueChange:v=>D("timeStyle",v)})]}),/* @__PURE__ */d("div",{className:"space-y-1.5",children:[/* @__PURE__ */s(Z,{htmlFor:i,className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Default currency"}),/* @__PURE__ */d(ce,{value:e.defaultCurrency??"inherit",disabled:n,onValueChange:v=>r({...e,defaultCurrency:v==="inherit"?void 0:v}),children:[/* @__PURE__ */s(ue,{id:i,size:"xs",children:/* @__PURE__ */s(me,{children:e.defaultCurrency===void 0?`Inherited · ${a.defaultCurrency}`:e.defaultCurrency})}),/* @__PURE__ */d(he,{children:[/* @__PURE__ */d(F,{value:"inherit",children:["Inherited from ",be(t.defaultCurrency)," ·"," ",a.defaultCurrency]}),[...qe].map(v=>/* @__PURE__ */s(F,{value:v,children:v},v)),Bt.map(v=>/* @__PURE__ */s(F,{value:v,children:v},v))]})]})]}),/* @__PURE__ */d("div",{className:"rounded-control border border-border/60 bg-muted/30 px-3 py-2",children:[/* @__PURE__ */s("p",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Preview"}),/* @__PURE__ */d("dl",{className:"mt-1.5 space-y-1 text-[12px]",children:[/* @__PURE__ */d("div",{className:"flex items-baseline justify-between gap-4",children:[/* @__PURE__ */s("dt",{className:"text-muted-foreground",children:"Date"}),/* @__PURE__ */s("dd",{className:"text-right font-medium text-foreground",children:g})]}),/* @__PURE__ */d("div",{className:"flex items-baseline justify-between gap-4",children:[/* @__PURE__ */s("dt",{className:"text-muted-foreground",children:"Date & time"}),/* @__PURE__ */s("dd",{className:"text-right font-medium text-foreground",children:y})]}),/* @__PURE__ */d("div",{className:"flex items-baseline justify-between gap-4",children:[/* @__PURE__ */s("dt",{className:"text-muted-foreground",children:"Currency"}),/* @__PURE__ */s("dd",{className:"text-right font-medium text-foreground",children:w})]})]})]}),/* @__PURE__ */s("p",{className:"text-[11px] text-muted-foreground",children:"Currency values are not converted. Date examples use a fixed reference value and the Gregorian calendar."})]});}const Re=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function ze(e,a){var t,r;switch(a){case"locale":return e==null?void 0:e.locale;case"dateStyle":return e==null?void 0:e.dateStyle;case"dateTime.dateStyle":return(t=e==null?void 0:e.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(r=e==null?void 0:e.dateTime)==null?void 0:r.timeStyle;case"defaultCurrency":return e==null?void 0:e.defaultCurrency;}}function jt(e){var r,n;const a=(r=e==null?void 0:e.dateTime)==null?void 0:r.dateStyle,t=(n=e==null?void 0:e.dateTime)==null?void 0:n.timeStyle;return{locale:e==null?void 0:e.locale,dateStyle:e==null?void 0:e.dateStyle,dateTime:a===void 0&&t===void 0?void 0:{dateStyle:a,timeStyle:t},defaultCurrency:e==null?void 0:e.defaultCurrency};}function Vt({active:e,onClose:a}){var o,m,b,x,u,f,c;const{preferences:t,isLoading:r,isSaving:n,updatePreferences:l}=Ot({enabled:e});if(!e)return null;if(!t)return/* @__PURE__ */d(W,{children:[/* @__PURE__ */s("div",{className:"py-2",children:/* @__PURE__ */s("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:r?"Loading preferences…":"Preferences unavailable."})}),/* @__PURE__ */d(ve,{className:"justify-between sm:justify-between",children:[/* @__PURE__ */s(R,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),/* @__PURE__ */d("div",{className:"flex gap-2",children:[/* @__PURE__ */s(R,{variant:"outline",size:"xs",onClick:a,children:"Cancel"}),/* @__PURE__ */s(R,{size:"xs",disabled:!0,children:"Save"})]})]})]});const i=[((o=t.stored)==null?void 0:o.locale)??"",((m=t.stored)==null?void 0:m.dateStyle)??"",((x=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:x.dateStyle)??"",((f=(u=t.stored)==null?void 0:u.dateTime)==null?void 0:f.timeStyle)??"",((c=t.stored)==null?void 0:c.defaultCurrency)??""].join(":");return/* @__PURE__ */s($t,{preferences:t,isSaving:n,updatePreferences:l,onClose:a},i);}function $t({preferences:e,isSaving:a,updatePreferences:t,onClose:r}){var b,x;const[n,l]=I(()=>jt(e.stored)),i=(n.locale===void 0||We(n.locale)!==void 0)&&(n.defaultCurrency===void 0||Qa(n.defaultCurrency)!==void 0)&&(n.dateStyle===void 0||["short","medium","long"].includes(n.dateStyle))&&(((b=n.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(n.dateTime.dateStyle))&&(((x=n.dateTime)==null?void 0:x.timeStyle)===void 0||["short","medium","long"].includes(n.dateTime.timeStyle)),o=async()=>{const u={...(n.locale!==void 0?{locale:n.locale}:{}),...(n.dateStyle!==void 0?{dateStyle:n.dateStyle}:{}),...(n.dateTime?{dateTime:{...n.dateTime}}:{}),...(n.defaultCurrency!==void 0?{defaultCurrency:n.defaultCurrency}:{})},f=Re.filter(h=>ze(n,h)===void 0&&ze(e.stored,h)!==void 0),c={...(Object.keys(u).length>0?{set:u}:{}),...(f.length>0?{clear:f}:{})};(Object.keys(c).length===0?!0:await t(c))?(O.success("Display format preferences saved."),r()):O.error("Failed to save preferences. Please try again.");},m=async()=>{(await t({clear:[...Re]}))?(O.success("Display format preferences reset."),r()):O.error("Failed to reset display format preferences. Please try again.");};return/* @__PURE__ */d(W,{children:[/* @__PURE__ */s("div",{className:"py-2",children:/* @__PURE__ */s(Wt,{value:n,inherited:e.inherited,inheritedSources:e.inheritedSources,onChange:l,disabled:a})}),/* @__PURE__ */d(ve,{className:"justify-between sm:justify-between",children:[/* @__PURE__ */s(R,{variant:"ghost",size:"xs",onClick:m,disabled:a||e.stored===null,children:"Reset display formats"}),/* @__PURE__ */d("div",{className:"flex gap-2",children:[/* @__PURE__ */s(R,{variant:"outline",size:"xs",onClick:r,disabled:a,children:"Cancel"}),/* @__PURE__ */s(R,{size:"xs",onClick:o,disabled:a||!i,children:a?/* @__PURE__ */d(W,{children:[/* @__PURE__ */s(Ue,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]});}function lr({open:e,onOpenChange:a}){const[t,r]=I("display"),n=()=>a(!1);return/* @__PURE__ */s(ba,{open:e,onOpenChange:a,children:/* @__PURE__ */d(pa,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[/* @__PURE__ */d(va,{children:[/* @__PURE__ */s(ya,{className:"text-[15px]",children:"Report preferences"}),/* @__PURE__ */s(Sa,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),/* @__PURE__ */d(wa,{value:t,onValueChange:r,children:[/* @__PURE__ */d(xa,{variant:"underline",className:"w-full justify-start",children:[/* @__PURE__ */s(xe,{value:"display",children:"Display formats"}),/* @__PURE__ */s(xe,{value:"calendar",children:"Calendar"})]}),/* @__PURE__ */s(Te,{value:"display",children:/* @__PURE__ */s(Vt,{active:e&&t==="display",onClose:n})}),/* @__PURE__ */s(Te,{value:"calendar",children:/* @__PURE__ */s(Ut,{active:e&&t==="calendar",onClose:n})})]})]})});}export{nt as A,ir as D,lr as R,Wt as a,ft as b,nr as c,wt as d,St as e,Tt as u};
@@ -1 +1 @@
1
- import{parseValueFormatPreferences as _,isReportPreferenceSource as C}from"../value-format-preferences/index.js";import{p as g}from"./validators-Dg2kyF4_.js";import{i as k}from"./analytics-base-schemas-DMFrDqn_.js";const D={tz:"UTC",weekStart:1,anchor:"now"},b=["tz","weekStart","anchor","fiscalCalendar"],w=["kind","yearStartMonth"],E=["calendar","valueFormat","preferenceSources"],z=["calendar","valueFormat"],p=["tz","weekStart"],F=["stored","inherited","inheritedSources","resolved","sources"],T=["locale","dateStyle","dateTime","defaultCurrency"],R=["dateStyle","timeStyle"];function o(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const a=Object.getPrototypeOf(e);return a===null||Object.getPrototypeOf(a)===null;}function n(e,a,r){const t=new Set(a);return Object.keys(e).filter(s=>!t.has(s)).map(s=>({path:r==="$"?s:`${r}.${s}`,code:"unknown_property",message:`Unknown property "${s}"`}));}function y(e){return Number.isInteger(e)&&typeof e=="number"&&e>=0&&e<=6;}function d(e,a,r){if(!o(e))return{ok:!1,issues:[{path:a,code:"invalid_type",message:"Calendar preferences must be an object"}]};const t=n(e,["tz","weekStart"],a);return(!r||e.tz!==void 0)&&(typeof e.tz!="string"||!k(e.tz))&&t.push({path:`${a}.tz`,code:"invalid_timezone",message:"tz must be a valid IANA timezone"}),(!r||e.weekStart!==void 0)&&!y(e.weekStart)&&t.push({path:`${a}.weekStart`,code:"invalid_week_start",message:"weekStart must be an integer from 0 to 6"}),t.length?{ok:!1,issues:t}:{ok:!0,value:{...(e.tz!==void 0?{tz:e.tz}:{}),...(e.weekStart!==void 0?{weekStart:e.weekStart}:{})}};}function A(e){if(e==="now")return{ok:!0,value:"now"};if(!o(e))return{ok:!1,issues:[{path:"anchor",code:"invalid_anchor",message:'anchor must be "now" or an object with an ISO timestamp'}]};const a=n(e,["iso"],"anchor"),r=e.iso;return g(r)===null&&a.push({path:"anchor.iso",code:"invalid_anchor",message:"anchor.iso must be an ISO timestamp with an explicit offset"}),a.length?{ok:!1,issues:a}:{ok:!0,value:{iso:r}};}function $(e){if(!o(e))return{ok:!1,issues:[{path:"fiscalCalendar",code:"invalid_fiscal_calendar",message:"fiscalCalendar must be an object"}]};const a=n(e,w,"fiscalCalendar");return e.kind!=="month_aligned"&&a.push({path:"fiscalCalendar.kind",code:"invalid_fiscal_calendar",message:'fiscalCalendar.kind must be "month_aligned"'}),(!Number.isInteger(e.yearStartMonth)||typeof e.yearStartMonth!="number"||e.yearStartMonth<1||e.yearStartMonth>12)&&a.push({path:"fiscalCalendar.yearStartMonth",code:"invalid_fiscal_calendar",message:"fiscalCalendar.yearStartMonth must be an integer from 1 to 12"}),a.length?{ok:!1,issues:a}:{ok:!0,value:{kind:"month_aligned",yearStartMonth:e.yearStartMonth}};}function O(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Calendar context must be an object"}]};const a=n(e,b,"$");(typeof e.tz!="string"||!k(e.tz))&&a.push({path:"tz",code:"invalid_timezone",message:"tz must be a valid IANA timezone"}),y(e.weekStart)||a.push({path:"weekStart",code:"invalid_week_start",message:"weekStart must be an integer from 0 to 6"});const r=A(e.anchor);r.ok||a.push(...r.issues);let t;if(e.fiscalCalendar!==void 0){const s=$(e.fiscalCalendar);s.ok?t=s.value:a.push(...s.issues);}return a.length||!r.ok?{ok:!1,issues:a}:{ok:!0,value:{tz:e.tz,weekStart:e.weekStart,anchor:r.value,...(t?{fiscalCalendar:t}:{})}};}function l(e,a,r){if(!C(e)){r.push({path:a,code:"invalid_preference_source",message:"Preference source is invalid"});return;}return e;}function h(e,a){if(!o(e))return{ok:!1,issues:[{path:a,code:"invalid_type",message:"Calendar preference sources must be an object"}]};const r=n(e,p,a),t=l(e.tz,`${a}.tz`,r),s=l(e.weekStart,`${a}.weekStart`,r);return r.length||!t||!s?{ok:!1,issues:r}:{ok:!0,value:{tz:t,weekStart:s}};}function K(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Calendar preference response must be an object"}]};const a=n(e,F,"$"),r=e.stored===null?{ok:!0,value:null}:d(e.stored,"stored",!0),t=d(e.inherited,"inherited",!1),s=h(e.inheritedSources,"inheritedSources"),c=d(e.resolved,"resolved",!1),i=h(e.sources,"sources");for(const u of[r,t,s,c,i])u.ok||a.push(...u.issues);return a.length||!r.ok||!t.ok||!s.ok||!c.ok||!i.ok?{ok:!1,issues:a}:{ok:!0,value:{stored:r.value,inherited:t.value,inheritedSources:s.value,resolved:c.value,sources:i.value}};}function j(e){if(!o(e))return{ok:!1,issues:[{path:"preferenceSources",code:"invalid_type",message:"preferenceSources must be an object"}]};const a=n(e,z,"preferenceSources"),r=e.calendar,t=e.valueFormat;if(o(r)||a.push({path:"preferenceSources.calendar",code:"invalid_type",message:"Calendar preference sources must be an object"}),o(t)||a.push({path:"preferenceSources.valueFormat",code:"invalid_type",message:"Value-format preference sources must be an object"}),!o(r)||!o(t))return{ok:!1,issues:a};a.push(...n(r,p,"preferenceSources.calendar"),...n(t,T,"preferenceSources.valueFormat"));const s=t.dateTime;o(s)?a.push(...n(s,R,"preferenceSources.valueFormat.dateTime")):a.push({path:"preferenceSources.valueFormat.dateTime",code:"invalid_type",message:"Datetime preference sources must be an object"});const c=l(r.tz,"preferenceSources.calendar.tz",a),i=l(r.weekStart,"preferenceSources.calendar.weekStart",a),u=l(t.locale,"preferenceSources.valueFormat.locale",a),f=l(t.dateStyle,"preferenceSources.valueFormat.dateStyle",a),m=o(s)?l(s.dateStyle,"preferenceSources.valueFormat.dateTime.dateStyle",a):void 0,S=o(s)?l(s.timeStyle,"preferenceSources.valueFormat.dateTime.timeStyle",a):void 0,v=l(t.defaultCurrency,"preferenceSources.valueFormat.defaultCurrency",a);return a.length||!c||!i||!u||!f||!m||!S||!v?{ok:!1,issues:a}:{ok:!0,value:{calendar:{tz:c,weekStart:i},valueFormat:{locale:u,dateStyle:f,dateTime:{dateStyle:m,timeStyle:S},defaultCurrency:v}}};}function P(e){var t;const a=_(e);if(!a.ok)return{ok:!1,issues:a.issues.map(s=>({path:`valueFormat.${s.path}`,code:"invalid_value_format",message:s.message}))};const r=a.value;return r.locale===void 0||r.dateStyle===void 0||((t=r.dateTime)==null?void 0:t.dateStyle)===void 0||r.dateTime.timeStyle===void 0||r.defaultCurrency===void 0?{ok:!1,issues:[{path:"valueFormat",code:"invalid_value_format",message:"Resolved value-format preferences must be complete"}]}:{ok:!0,value:{locale:r.locale,dateStyle:r.dateStyle,dateTime:{dateStyle:r.dateTime.dateStyle,timeStyle:r.dateTime.timeStyle},defaultCurrency:r.defaultCurrency}};}function U(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Report runtime context must be an object"}]};const a=n(e,E,"$"),r=O(e.calendar),t=P(e.valueFormat),s=j(e.preferenceSources);return r.ok||a.push(...r.issues.map(c=>({...c,path:c.path==="$"?"calendar":`calendar.${c.path}`}))),t.ok||a.push(...t.issues),s.ok||a.push(...s.issues),a.length||!r.ok||!t.ok||!s.ok?{ok:!1,issues:a}:{ok:!0,value:{calendar:r.value,valueFormat:t.value,preferenceSources:s.value}};}export{D,K as a,U as b,O as p};
1
+ import{parseValueFormatPreferences as _,isReportPreferenceSource as C}from"../value-format-preferences/index.js";import{p as g}from"./validators-U8IL8djK.js";import{i as k}from"./analytics-base-schemas-DMFrDqn_.js";const D={tz:"UTC",weekStart:1,anchor:"now"},b=["tz","weekStart","anchor","fiscalCalendar"],w=["kind","yearStartMonth"],E=["calendar","valueFormat","preferenceSources"],z=["calendar","valueFormat"],p=["tz","weekStart"],F=["stored","inherited","inheritedSources","resolved","sources"],T=["locale","dateStyle","dateTime","defaultCurrency"],R=["dateStyle","timeStyle"];function o(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const a=Object.getPrototypeOf(e);return a===null||Object.getPrototypeOf(a)===null;}function n(e,a,r){const t=new Set(a);return Object.keys(e).filter(s=>!t.has(s)).map(s=>({path:r==="$"?s:`${r}.${s}`,code:"unknown_property",message:`Unknown property "${s}"`}));}function y(e){return Number.isInteger(e)&&typeof e=="number"&&e>=0&&e<=6;}function d(e,a,r){if(!o(e))return{ok:!1,issues:[{path:a,code:"invalid_type",message:"Calendar preferences must be an object"}]};const t=n(e,["tz","weekStart"],a);return(!r||e.tz!==void 0)&&(typeof e.tz!="string"||!k(e.tz))&&t.push({path:`${a}.tz`,code:"invalid_timezone",message:"tz must be a valid IANA timezone"}),(!r||e.weekStart!==void 0)&&!y(e.weekStart)&&t.push({path:`${a}.weekStart`,code:"invalid_week_start",message:"weekStart must be an integer from 0 to 6"}),t.length?{ok:!1,issues:t}:{ok:!0,value:{...(e.tz!==void 0?{tz:e.tz}:{}),...(e.weekStart!==void 0?{weekStart:e.weekStart}:{})}};}function A(e){if(e==="now")return{ok:!0,value:"now"};if(!o(e))return{ok:!1,issues:[{path:"anchor",code:"invalid_anchor",message:'anchor must be "now" or an object with an ISO timestamp'}]};const a=n(e,["iso"],"anchor"),r=e.iso;return g(r)===null&&a.push({path:"anchor.iso",code:"invalid_anchor",message:"anchor.iso must be an ISO timestamp with an explicit offset"}),a.length?{ok:!1,issues:a}:{ok:!0,value:{iso:r}};}function $(e){if(!o(e))return{ok:!1,issues:[{path:"fiscalCalendar",code:"invalid_fiscal_calendar",message:"fiscalCalendar must be an object"}]};const a=n(e,w,"fiscalCalendar");return e.kind!=="month_aligned"&&a.push({path:"fiscalCalendar.kind",code:"invalid_fiscal_calendar",message:'fiscalCalendar.kind must be "month_aligned"'}),(!Number.isInteger(e.yearStartMonth)||typeof e.yearStartMonth!="number"||e.yearStartMonth<1||e.yearStartMonth>12)&&a.push({path:"fiscalCalendar.yearStartMonth",code:"invalid_fiscal_calendar",message:"fiscalCalendar.yearStartMonth must be an integer from 1 to 12"}),a.length?{ok:!1,issues:a}:{ok:!0,value:{kind:"month_aligned",yearStartMonth:e.yearStartMonth}};}function O(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Calendar context must be an object"}]};const a=n(e,b,"$");(typeof e.tz!="string"||!k(e.tz))&&a.push({path:"tz",code:"invalid_timezone",message:"tz must be a valid IANA timezone"}),y(e.weekStart)||a.push({path:"weekStart",code:"invalid_week_start",message:"weekStart must be an integer from 0 to 6"});const r=A(e.anchor);r.ok||a.push(...r.issues);let t;if(e.fiscalCalendar!==void 0){const s=$(e.fiscalCalendar);s.ok?t=s.value:a.push(...s.issues);}return a.length||!r.ok?{ok:!1,issues:a}:{ok:!0,value:{tz:e.tz,weekStart:e.weekStart,anchor:r.value,...(t?{fiscalCalendar:t}:{})}};}function l(e,a,r){if(!C(e)){r.push({path:a,code:"invalid_preference_source",message:"Preference source is invalid"});return;}return e;}function h(e,a){if(!o(e))return{ok:!1,issues:[{path:a,code:"invalid_type",message:"Calendar preference sources must be an object"}]};const r=n(e,p,a),t=l(e.tz,`${a}.tz`,r),s=l(e.weekStart,`${a}.weekStart`,r);return r.length||!t||!s?{ok:!1,issues:r}:{ok:!0,value:{tz:t,weekStart:s}};}function K(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Calendar preference response must be an object"}]};const a=n(e,F,"$"),r=e.stored===null?{ok:!0,value:null}:d(e.stored,"stored",!0),t=d(e.inherited,"inherited",!1),s=h(e.inheritedSources,"inheritedSources"),c=d(e.resolved,"resolved",!1),i=h(e.sources,"sources");for(const u of[r,t,s,c,i])u.ok||a.push(...u.issues);return a.length||!r.ok||!t.ok||!s.ok||!c.ok||!i.ok?{ok:!1,issues:a}:{ok:!0,value:{stored:r.value,inherited:t.value,inheritedSources:s.value,resolved:c.value,sources:i.value}};}function j(e){if(!o(e))return{ok:!1,issues:[{path:"preferenceSources",code:"invalid_type",message:"preferenceSources must be an object"}]};const a=n(e,z,"preferenceSources"),r=e.calendar,t=e.valueFormat;if(o(r)||a.push({path:"preferenceSources.calendar",code:"invalid_type",message:"Calendar preference sources must be an object"}),o(t)||a.push({path:"preferenceSources.valueFormat",code:"invalid_type",message:"Value-format preference sources must be an object"}),!o(r)||!o(t))return{ok:!1,issues:a};a.push(...n(r,p,"preferenceSources.calendar"),...n(t,T,"preferenceSources.valueFormat"));const s=t.dateTime;o(s)?a.push(...n(s,R,"preferenceSources.valueFormat.dateTime")):a.push({path:"preferenceSources.valueFormat.dateTime",code:"invalid_type",message:"Datetime preference sources must be an object"});const c=l(r.tz,"preferenceSources.calendar.tz",a),i=l(r.weekStart,"preferenceSources.calendar.weekStart",a),u=l(t.locale,"preferenceSources.valueFormat.locale",a),f=l(t.dateStyle,"preferenceSources.valueFormat.dateStyle",a),m=o(s)?l(s.dateStyle,"preferenceSources.valueFormat.dateTime.dateStyle",a):void 0,S=o(s)?l(s.timeStyle,"preferenceSources.valueFormat.dateTime.timeStyle",a):void 0,v=l(t.defaultCurrency,"preferenceSources.valueFormat.defaultCurrency",a);return a.length||!c||!i||!u||!f||!m||!S||!v?{ok:!1,issues:a}:{ok:!0,value:{calendar:{tz:c,weekStart:i},valueFormat:{locale:u,dateStyle:f,dateTime:{dateStyle:m,timeStyle:S},defaultCurrency:v}}};}function P(e){var t;const a=_(e);if(!a.ok)return{ok:!1,issues:a.issues.map(s=>({path:`valueFormat.${s.path}`,code:"invalid_value_format",message:s.message}))};const r=a.value;return r.locale===void 0||r.dateStyle===void 0||((t=r.dateTime)==null?void 0:t.dateStyle)===void 0||r.dateTime.timeStyle===void 0||r.defaultCurrency===void 0?{ok:!1,issues:[{path:"valueFormat",code:"invalid_value_format",message:"Resolved value-format preferences must be complete"}]}:{ok:!0,value:{locale:r.locale,dateStyle:r.dateStyle,dateTime:{dateStyle:r.dateTime.dateStyle,timeStyle:r.dateTime.timeStyle},defaultCurrency:r.defaultCurrency}};}function U(e){if(!o(e))return{ok:!1,issues:[{path:"$",code:"invalid_type",message:"Report runtime context must be an object"}]};const a=n(e,E,"$"),r=O(e.calendar),t=P(e.valueFormat),s=j(e.preferenceSources);return r.ok||a.push(...r.issues.map(c=>({...c,path:c.path==="$"?"calendar":`calendar.${c.path}`}))),t.ok||a.push(...t.issues),s.ok||a.push(...s.issues),a.length||!r.ok||!t.ok||!s.ok?{ok:!1,issues:a}:{ok:!0,value:{calendar:r.value,valueFormat:t.value,preferenceSources:s.value}};}export{D,K as a,U as b,O as p};