react-semaphor 0.1.602 → 0.1.604
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.
- package/dist/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1451
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4491
- package/dist/format-utils/index.js +1 -424
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +1 -88
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +6 -2
- package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
- package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
- package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
- package/dist/chunks/context-BJoEFgNl.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
- package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
- package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-BXT6y303.js +0 -703
- package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
- package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-BW0yozjs.js +0 -2795
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
- package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
- package/dist/chunks/palette-CuA0HlzF.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
- package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
- package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-BKHlDONy.js +0 -21
- package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
- package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
- package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
- package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
- package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
- package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
- package/dist/chunks/token-types-D_xKgyVS.js +0 -8
- package/dist/chunks/upload-Dll_M7XQ.js +0 -15
- package/dist/chunks/validators-ClWHpYql.js +0 -3686
- package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Vn=Object.defineProperty;var Bn=(e,t,n)=>t in e?Vn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _=(e,t,n)=>Bn(e,typeof t!="symbol"?t+"":t,n);import{z as p}from"zod";import{E as en,l as tn}from"./export-file-format-B-wQNHIn.js";import{b2 as nn,b3 as Gn,aX as Qn,a6 as Jn,m as ht,N as er,b4 as tr,b5 as nr,S as rr,J as B,T as ar}from"./validators-CqV3Yka1.js";import"./matrix-operation-contract-D1RC1bfi.js";import{k as ir,i as ve}from"./analytics-base-schemas-BREc5WGv.js";import{b as or}from"./report-runtime-context-BWzIHCKK.js";import{canonicalizeSupportedLocale as te,canonicalizeSupportedCurrencyCode as Ze,DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as sr}from"../value-format-preferences/index.js";import{p as cr,a as ur,c as lr,i as gt,s as be,Y as mr,J as fr,o as dr}from"./raw-temporal-value-DeyEhL0S.js";import{b as hr,r as gr}from"./metric-comparison-DEZYXROZ.js";function ne(e){if(!e||typeof e!="object")return!1;const t=e.type;return t==="number"||t==="currency"||t==="percent"||t==="scientific";}function Ks(e){return ne(e)||!!e&&typeof e=="object"&&e.type==="duration";}const rn=["day","hour","minute","second","millisecond"],Xe={day:864e5,hour:36e5,minute:6e4,second:1e3,millisecond:1},yr={day:"d",hour:"hr",minute:"min",second:"s",millisecond:"ms"},wr={day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],second:["second","seconds"],millisecond:["millisecond","milliseconds"]};function pr(e){return e==="day"||e==="hour"||e==="minute"||e==="second"||e==="millisecond";}function an(e,t){return pr(e)?e:t;}function yt(e,t){return rn.indexOf(an(e,t));}function Tr(e,t){const n=yt(e,"day"),r=yt(t,"second"),a=Math.min(n,r),i=Math.max(n,r);return rn.slice(a,i+1);}function vr(e,t){return e*Xe[an(t,"second")];}function br(e,t){const n=Tr(t.largestUnit,t.smallestUnit),r=n[n.length-1],a=Xe[r];let i=Math.round(e/a)*a;return n.map(o=>{const s=Xe[o],c=Math.floor(i/s);return i-=c*s,{unit:o,value:c};});}function xr(e,t){const n=e.filter(i=>i.value!==0),r=n.length>0?n:[e[e.length-1]],a=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):r.length;return r.slice(0,a).map(i=>`${i.value}${yr[i.unit]}`).join(" ");}function Dr(e,t){const n=e.filter(i=>i.value!==0),r=n.length>0?n:[e[e.length-1]],a=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):r.length;return r.slice(0,a).map(i=>{const[o,s]=wr[i.unit];return`${i.value} ${i.value===1?o:s}`;}).join(" ");}function Sr(e){const t=e.some(c=>c.unit==="day"&&c.value!==0),n=e.some(c=>c.unit==="millisecond"),r=e.findIndex(c=>c.value!==0),a=Math.max(0,e.length-2),i=t?0:r===-1?a:Math.min(r,a),o=r===-1?e.slice(a):e.slice(i);if(o.length===0)return"0";const s=o.map((c,u)=>c.unit==="millisecond"?String(c.value).padStart(3,"0"):u===0?String(c.value):String(c.value).padStart(2,"0")).join(":");return n?s.replace(/:(\d{3})$/,".$1"):s;}function Mr(e,t,n){const r=`${n.prefix||""}${e}${n.suffix||""}`;return t?n.negativeInParentheses?`(${r})`:`-${r}`:r;}function on(e,t={}){if(e==null)return"";const n=typeof e=="number"?e:typeof e=="string"&&e.trim()?Number(e):NaN;if(!Number.isFinite(n))return"";const r=t.inputUnit||"second",a=t.outputStyle==="digital"||t.outputStyle==="long"?t.outputStyle:"compact",i=n<0,o=Math.abs(vr(n,r)),s=br(o,t),c=a==="digital"?Sr(s):a==="long"?Dr(s,t.maxUnits):xr(s,t.maxUnits);return Mr(c,i,t);}function sn(e,t){return on(e!==null&&typeof e=="object"?e.value:e,{inputUnit:t.inputUnit,outputStyle:t.outputStyle,largestUnit:t.largestUnit,smallestUnit:t.smallestUnit,maxUnits:t.maxUnits,prefix:t.prefix,suffix:t.suffix,negativeInParentheses:t.negativeStyle==="parentheses"});}let wt;function pt(e,t){const n=e.format;return n(t);}function kr(e,t){if(wt??(wt=pt(new Intl.NumberFormat("en-US",{useGrouping:!1,maximumFractionDigits:6}),"9007199254740993.000009")==="9007199254740993.000009"),!wt)throw new RangeError("This runtime cannot format exact decimal strings.");const n=Number(e);if(!Number.isFinite(n)||n===0&&e!=="0")throw new RangeError("Exact value is outside the Intl formatting range; use raw text.");return pt(t,e);}function re(e){return typeof e=="number"?e<0:e.value.startsWith("-");}function G(e){return typeof e=="number"?Math.abs(e):re(e)?{...e,value:e.value.slice(1)}:e;}function _r(e){return typeof e=="number"?e===0:/^-?0*(\.0*)?$/.test(e.value);}function cn(e,t){return typeof e=="number"?e*t:{kind:"exact_number",type:"decimal",value:nn(e.value,t)};}function xe(e,t){return t===0?e:typeof e=="number"?e/10**t:{kind:"exact_number",type:"decimal",value:nn(e.value,`1e-${t}`)};}function U(e,t){return typeof e=="number"?t.format(e):kr(e.value,t);}function Tt(e){if(!e)return!1;const t=e.toLowerCase().replace("_","-");return t==="en-in"||t.startsWith("en-in-");}function vt(e,t){const n=G(e),r=a=>typeof n=="number"?n>=a:Gn(n.value,String(a))>=0;return r(1e12)?{power:12,suffix:"T"}:r(1e9)?{power:9,suffix:"B"}:Tt(t)&&r(1e7)?{power:7,suffix:"Cr"}:r(1e6)?{power:6,suffix:"M"}:Tt(t)&&r(1e5)?{power:5,suffix:"L"}:r(1e3)?{power:3,suffix:"K"}:{power:0,suffix:""};}function Ke(e,t){try{const n=j(t);return vt(e,n);}catch{return vt(e,"en-US");}}const un=500,se=/* @__PURE__ */new Map(),ce=/* @__PURE__ */new Map();function N(e,t={}){const n=`${e}|${JSON.stringify(t)}`;let r=se.get(n);return r||(r=new Intl.NumberFormat(e,t),se.size>=un&&se.clear(),se.set(n,r)),r;}function $r(e){let t=ce.get(e);if(t===void 0){try{N(e),t=!0;}catch{t=!1;}ce.size>=un&&ce.clear(),ce.set(e,t);}return t;}function j(e){return e&&$r(e)?e:"en-US";}function nt(e,t){if(e==null||Number.isNaN(e))return"";const n=j(t==null?void 0:t.locale);let r=e;if(t!=null&&t.multiplyBy&&(r=cn(r,t.multiplyBy)),t!=null&&t.useSuffix){const{power:i,suffix:o}=Ke(r,n);r=xe(r,i);const s=U(r,N(n,{minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}));return`${(t==null?void 0:t.prefix)??""}${s}${o}${(t==null?void 0:t.suffix)??""}`;}const a=U(r,N(n,{minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}));if(t!=null&&t.negativeInParentheses&&re(r)){const i=a.replace("-","");return`(${(t==null?void 0:t.prefix)??""}${i}${(t==null?void 0:t.suffix)??""})`;}return`${(t==null?void 0:t.prefix)??""}${a}${(t==null?void 0:t.suffix)??""}`;}function ln(e,t){if(e==null||Number.isNaN(e))return"";const n=j(t==null?void 0:t.locale),r=(t==null?void 0:t.currency)||"USD",a=re(e),i=!!(t!=null&&t.negativeInParentheses&&a),o=i?G(e):e;try{if(t!=null&&t.useSuffix){const{power:c,suffix:u}=Ke(o,n),l=xe(o,c),m=`${U(l,N(n,{style:"currency",currency:r,minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}))}${u}`;return i?`(${m})`:m;}const s=U(o,N(n,{style:"currency",currency:r,minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}));return i?`(${s})`:s;}catch{const s=G(e),c=t!=null&&t.useSuffix?Ke(s,n):{power:0,suffix:""},u=nt(xe(s,c.power),{locale:n,minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}),l=`${r} ${u}${c.suffix}`;return a?t!=null&&t.negativeInParentheses?`(${l})`:`-${l}`:l;}}function mn(e,t){if(e==null||Number.isNaN(e))return"";const n=j(t==null?void 0:t.locale),a=(t==null?void 0:t.alreadyPercent)??(t==null?void 0:t.percentValueMode)==="whole"?xe(e,2):e;return U(a,N(n,{style:"percent",minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0}));}function fn(e,t){if(e==null||Number.isNaN(e))return"";const n=j(t==null?void 0:t.locale);return U(e,N(n,{notation:"scientific",minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2}));}function Nr(e,t){const n=t??"auto",r=n==="never"?G(e):e,a=!re(r)&&(n==="always"||n==="exceptZero"&&!_r(r));return{value:r,plus:a};}function Vs(e){if(!e||!("signDisplay"in e))return e;const{signDisplay:t,...n}=e;return n;}function rt(e,t){if(e==null||Number.isNaN(e))return"";const n=t.scale===void 0?e:cn(e,t.scale),r=Nr(n,t.signDisplay),a=r.value,i=r.plus?"+":"",o=t.negativeStyle==="parentheses"&&re(a),s=o?G(a):a,c={style:t.type==="number"?"decimal":t.type,locale:t.locale,currency:t.currency,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,useGrouping:t.useGrouping,percentValueMode:t.percentValueMode,useSuffix:t.compact};let u;switch(t.type){case"currency":u=ln(s,c);break;case"percent":u=mn(s,c);break;case"scientific":u=fn(s,c);break;default:u=nt(s,c);break;}const l=`${t.prefix??""}${i}${u}${t.suffix??""}`;return o?`(${l})`:l;}function Bs(e,t){return t.type==="duration"?e==null?"":sn(e,t):rt(e,t);}function Er(e,t,n="en-US"){if(e==null||typeof e=="number"&&isNaN(e))return"";if((t==null?void 0:t.style)==="duration")return sn(e,{...t.duration,prefix:t.prefix,suffix:t.suffix,negativeStyle:t.negativeStyle});const r=j((t==null?void 0:t.locale)||n),a=(t==null?void 0:t.style)||"decimal",i=a==="decimal"?"number":a;return i==="currency"&&N(r,{style:"currency",currency:(t==null?void 0:t.currency)||"USD"}),rt(e,{type:i,locale:r,currency:i==="currency"?(t==null?void 0:t.currency)||"USD":void 0,minimumFractionDigits:(t==null?void 0:t.minimumFractionDigits)??0,maximumFractionDigits:(t==null?void 0:t.maximumFractionDigits)??2,useGrouping:(t==null?void 0:t.useGrouping)??!0,percentValueMode:i==="percent"?(t==null?void 0:t.percentValueMode)??"whole":void 0,scale:t==null?void 0:t.scale,compact:t==null?void 0:t.compact,negativeStyle:t==null?void 0:t.negativeStyle,prefix:t==null?void 0:t.prefix,suffix:t==null?void 0:t.suffix});}function Gs(e,t,n){const r={style:t==="currency"?"currency":t==="percent"?"percent":"decimal",locale:n==null?void 0:n.locale,currency:n==null?void 0:n.currency,minimumFractionDigits:n==null?void 0:n.decimalPlaces,maximumFractionDigits:n==null?void 0:n.decimalPlaces,useSuffix:n==null?void 0:n.useSuffix,prefix:n==null?void 0:n.prefix,suffix:n==null?void 0:n.suffix,negativeInParentheses:n==null?void 0:n.negativeInParentheses,multiplyBy:n==null?void 0:n.multiplyBy};switch(t){case"currency":return ln(e,r);case"percent":return mn(e,r);case"scientific":return fn(e,r);default:return nt(e,r);}}function w(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):/* @__PURE__ */new Date(NaN);}function E(e,t){return e instanceof Date?new e.constructor(t):new Date(t);}const dn=6048e5,Or=864e5,hn=6e4,gn=36e5,Qs=525600,ue=43200,bt=1440;let Ir={};function q(){return Ir;}function Q(e,t){var s,c,u,l;const n=q(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((l=(u=n.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,a=w(e),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a;}function De(e){return Q(e,{weekStartsOn:1});}function yn(e){const t=w(e),n=t.getFullYear(),r=E(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=De(r),i=E(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=De(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1;}function xt(e){const t=w(e);return t.setHours(0,0,0,0),t;}function Se(e){const t=w(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n;}function Cr(e,t){const n=xt(e),r=xt(t),a=+n-Se(n),i=+r-Se(r);return Math.round((a-i)/Or);}function Fr(e){const t=yn(e),n=E(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),De(n);}function ge(e,t){const n=w(e),r=w(t),a=n.getTime()-r.getTime();return a<0?-1:a>0?1:a;}function Pr(e){return E(e,Date.now());}function Yr(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]";}function Ar(e){if(!Yr(e)&&typeof e!="number")return!1;const t=w(e);return!isNaN(Number(t));}function zr(e,t){const n=w(e),r=w(t),a=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return a*12+i;}function Rr(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r;};}function Ur(e,t){return+w(e)-+w(t);}function Lr(e){const t=w(e);return t.setHours(23,59,59,999),t;}function Wr(e){const t=w(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t;}function Hr(e){const t=w(e);return+Lr(t)==+Wr(t);}function jr(e,t){const n=w(e),r=w(t),a=ge(n,r),i=Math.abs(zr(n,r));let o;if(i<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*i);let s=ge(n,r)===-a;Hr(w(e))&&i===1&&ge(e,r)===1&&(s=!1),o=a*(i-Number(s));}return o===0?0:o;}function qr(e,t,n){const r=Ur(e,t)/1e3;return Rr(n==null?void 0:n.roundingMethod)(r);}function Zr(e){const t=w(e),n=E(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n;}const Xr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Kr=(e,t,n)=>{let r;const a=Xr[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r;};function Fe(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth];};}const Vr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Br={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Gr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qr={date:Fe({formats:Vr,defaultWidth:"full"}),time:Fe({formats:Br,defaultWidth:"full"}),dateTime:Fe({formats:Gr,defaultWidth:"full"})},Jr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ea=(e,t,n,r)=>Jr[e];function Z(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=e.formattingValues[s]||e.formattingValues[o];}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[s]||e.values[o];}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i];};}const ta={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},na={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ra={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},aa={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ia={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},oa={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sa=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd";}return n+"th";},ca={ordinalNumber:sa,era:Z({values:ta,defaultWidth:"wide"}),quarter:Z({values:na,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Z({values:ra,defaultWidth:"wide"}),day:Z({values:aa,defaultWidth:"wide"}),dayPeriod:Z({values:ia,defaultWidth:"wide",formattingValues:oa,defaultFormattingWidth:"wide"})};function X(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?la(s,f=>f.test(o)):ua(s,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const l=t.slice(o.length);return{value:u,rest:l};};}function ua(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;}function la(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;}function ma(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(a.length);return{value:o,rest:s};};}const fa=/^(\d+)(th|st|nd|rd)?/i,da=/\d+/i,ha={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ga={any:[/^b/i,/^(a|c)/i]},ya={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wa={any:[/1/i,/2/i,/3/i,/4/i]},pa={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ta={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},va={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ba={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xa={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Da={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sa={ordinalNumber:ma({matchPattern:fa,parsePattern:da,valueCallback:e=>parseInt(e,10)}),era:X({matchPatterns:ha,defaultMatchWidth:"wide",parsePatterns:ga,defaultParseWidth:"any"}),quarter:X({matchPatterns:ya,defaultMatchWidth:"wide",parsePatterns:wa,defaultParseWidth:"any",valueCallback:e=>e+1}),month:X({matchPatterns:pa,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),day:X({matchPatterns:va,defaultMatchWidth:"wide",parsePatterns:ba,defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:xa,defaultMatchWidth:"any",parsePatterns:Da,defaultParseWidth:"any"})},wn={code:"en-US",formatDistance:Kr,formatLong:Qr,formatRelative:ea,localize:ca,match:Sa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ma(e){const t=w(e);return Cr(t,Zr(t))+1;}function ka(e){const t=w(e),n=+De(t)-+Fr(t);return Math.round(n/dn)+1;}function pn(e,t){var l,f,m,d;const n=w(e),r=n.getFullYear(),a=q(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((d=(m=a.locale)==null?void 0:m.options)==null?void 0:d.firstWeekContainsDate)??1,o=E(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=Q(o,t),c=E(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=Q(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1;}function _a(e,t){var s,c,u,l;const n=q(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((l=(u=n.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,a=pn(e,t),i=E(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Q(i,t);}function $a(e,t){const n=w(e),r=+Q(n,t)-+_a(n,t);return Math.round(r/dn)+1;}function y(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r;}const $={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return y(t==="yy"?r%100:r,t.length);},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):y(n+1,2);},d(e,t){return y(e.getDate(),t.length);},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m.";}},h(e,t){return y(e.getHours()%12||12,t.length);},H(e,t){return y(e.getHours(),t.length);},m(e,t){return y(e.getMinutes(),t.length);},s(e,t){return y(e.getSeconds(),t.length);},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return y(a,t.length);}},F={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dt={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"});}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"});}return $.y(e,t);},Y:function(e,t,n,r){const a=pn(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return y(o,2);}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):y(i,t.length);},R:function(e,t){const n=yn(e);return y(n,t.length);},u:function(e,t){const n=e.getFullYear();return y(n,t.length);},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return y(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"});}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return y(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"});}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return $.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"});}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return y(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"});}},w:function(e,t,n,r){const a=$a(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):y(a,t.length);},I:function(e,t,n){const r=ka(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):y(r,t.length);},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):$.d(e,t);},D:function(e,t,n){const r=Ma(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):y(r,t.length);},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"});}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return y(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"});}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return y(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"});}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return y(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"});}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"});}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=F.noon:r===0?a=F.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"});}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=F.evening:r>=12?a=F.afternoon:r>=4?a=F.morning:a=F.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"});}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"});}return $.h(e,t);},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):$.H(e,t);},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length);},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length);},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):$.m(e,t);},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):$.s(e,t);},S:function(e,t){return $.S(e,t);},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Mt(r);case"XXXX":case"XX":return I(r);case"XXXXX":case"XXX":default:return I(r,":");}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Mt(r);case"xxxx":case"xx":return I(r);case"xxxxx":case"xxx":default:return I(r,":");}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+St(r,":");case"OOOO":default:return"GMT"+I(r,":");}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+St(r,":");case"zzzz":default:return"GMT"+I(r,":");}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return y(r,t.length);},T:function(e,t,n){const r=e.getTime();return y(r,t.length);}};function St(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+y(i,2);}function Mt(e,t){return e%60===0?(e>0?"-":"+")+y(Math.abs(e)/60,2):I(e,t);}function I(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=y(Math.trunc(r/60),2),i=y(r%60,2);return n+a+t+i;}const kt=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"});}},Tn=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"});}},Na=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return kt(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break;}return i.replace("{{date}}",kt(r,t)).replace("{{time}}",Tn(a,t));},Ea={p:Tn,P:Na},Oa=/^D+$/,Ia=/^Y+$/,Ca=["D","DD","YY","YYYY"];function Fa(e){return Oa.test(e);}function Pa(e){return Ia.test(e);}function Ya(e,t,n){const r=Aa(e,t,n);if(console.warn(r),Ca.includes(e))throw new RangeError(r);}function Aa(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;}const za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ra=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ua=/^'([^]*?)'?$/,La=/''/g,Wa=/[a-zA-Z]/;function at(e,t,n){var l,f,m,d,h,S,ft,dt;const r=q(),a=(n==null?void 0:n.locale)??r.locale??wn,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(m=r.locale)==null?void 0:m.options)==null?void 0:d.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((S=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((dt=(ft=r.locale)==null?void 0:ft.options)==null?void 0:dt.weekStartsOn)??0,s=w(e);if(!Ar(s))throw new RangeError("Invalid time value");let c=t.match(Ra).map(D=>{const x=D[0];if(x==="p"||x==="P"){const Ce=Ea[x];return Ce(D,a.formatLong);}return D;}).join("").match(za).map(D=>{if(D==="''")return{isToken:!1,value:"'"};const x=D[0];if(x==="'")return{isToken:!1,value:Ha(D)};if(Dt[x])return{isToken:!0,value:D};if(x.match(Wa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:D};});a.localize.preprocessor&&(c=a.localize.preprocessor(s,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(D=>{if(!D.isToken)return D.value;const x=D.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Pa(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Fa(x))&&Ya(x,t,String(e));const Ce=Dt[x[0]];return Ce(s,x,a.localize,u);}).join("");}function Ha(e){const t=e.match(Ua);return t?t[1].replace(La,"'"):e;}function ja(e,t,n){const r=q(),a=(n==null?void 0:n.locale)??r.locale??wn,i=2520,o=ge(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,u;o>0?(c=w(t),u=w(e)):(c=w(e),u=w(t));const l=qr(u,c),f=(Se(u)-Se(c))/1e3,m=Math.round((l-f)/60);let d;if(m<2)return n!=null&&n.includeSeconds?l<5?a.formatDistance("lessThanXSeconds",5,s):l<10?a.formatDistance("lessThanXSeconds",10,s):l<20?a.formatDistance("lessThanXSeconds",20,s):l<40?a.formatDistance("halfAMinute",0,s):l<60?a.formatDistance("lessThanXMinutes",1,s):a.formatDistance("xMinutes",1,s):m===0?a.formatDistance("lessThanXMinutes",1,s):a.formatDistance("xMinutes",m,s);if(m<45)return a.formatDistance("xMinutes",m,s);if(m<90)return a.formatDistance("aboutXHours",1,s);if(m<bt){const h=Math.round(m/60);return a.formatDistance("aboutXHours",h,s);}else{if(m<i)return a.formatDistance("xDays",1,s);if(m<ue){const h=Math.round(m/bt);return a.formatDistance("xDays",h,s);}else if(m<ue*2)return d=Math.round(m/ue),a.formatDistance("aboutXMonths",d,s);}if(d=jr(u,c),d<12){const h=Math.round(m/ue);return a.formatDistance("xMonths",h,s);}else{const h=d%12,S=Math.trunc(d/12);return h<3?a.formatDistance("aboutXYears",S,s):h<9?a.formatDistance("overXYears",S,s):a.formatDistance("almostXYears",S+1,s);}}function qa(e,t){return ja(e,Pr(e),t);}function Za(){return Object.assign({},q());}function Js(e,t){const r=Ba(e);let a;if(r.date){const c=Ga(r.date,2);a=Qa(c.restDateString,c.year);}if(!a||isNaN(a.getTime()))return/* @__PURE__ */new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=Ja(r.time),isNaN(o)))return/* @__PURE__ */new Date(NaN);if(r.timezone){if(s=ei(r.timezone),isNaN(s))return/* @__PURE__ */new Date(NaN);}else{const c=new Date(i+o),u=/* @__PURE__ */new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u;}return new Date(i+o+s);}const le={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xa=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ka=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Va=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ba(e){const t={},n=e.split(le.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],le.timeZoneDelimiter.test(t.date)&&(t.date=e.split(le.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=le.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r;}return t;}function Ga(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((r[1]||r[2]).length)};}function Qa(e,t){if(t===null)return/* @__PURE__ */new Date(NaN);const n=e.match(Xa);if(!n)return/* @__PURE__ */new Date(NaN);const r=!!n[4],a=K(n[1]),i=K(n[2])-1,o=K(n[3]),s=K(n[4]),c=K(n[5])-1;if(r)return ii(t,s,c)?ti(t,s,c):/* @__PURE__ */new Date(NaN);{const u=/* @__PURE__ */new Date(0);return!ri(t,i,o)||!ai(t,a)?/* @__PURE__ */new Date(NaN):(u.setUTCFullYear(t,i,Math.max(a,o)),u);}}function K(e){return e?parseInt(e):1;}function Ja(e){const t=e.match(Ka);if(!t)return NaN;const n=Pe(t[1]),r=Pe(t[2]),a=Pe(t[3]);return oi(n,r,a)?n*gn+r*hn+a*1e3:NaN;}function Pe(e){return e&&parseFloat(e.replace(",","."))||0;}function ei(e){if(e==="Z")return 0;const t=e.match(Va);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return si(r,a)?n*(r*gn+a*hn):NaN;}function ti(e,t,n){const r=/* @__PURE__ */new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r;}const ni=[31,null,31,30,31,30,31,31,30,31,30,31];function vn(e){return e%400===0||e%4===0&&e%100!==0;}function ri(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(ni[t]||(vn(e)?29:28));}function ai(e,t){return t>=1&&t<=(vn(e)?366:365);}function ii(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6;}function oi(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25;}function si(e,t){return t>=0&&t<=59;}function _t(e,t,n){const r=Za(),a=li(e,n.timeZone,n.locale??r.locale);return"formatToParts"in a?ci(a,t):ui(a,t);}function ci(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value;}function ui(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):"";}function li(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e});}function mi(e,t){const n=yi(t);return"formatToParts"in n?di(n,e):hi(n,e);}const fi={year:0,month:1,day:2,hour:3,minute:4,second:5};function di(e,t){try{const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const i=fi[n[a].type];i!==void 0&&(r[i]=parseInt(n[a].value,10));}return r;}catch(n){if(n instanceof RangeError)return[NaN];throw n;}}function hi(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)];}const Ye={},$t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(/* @__PURE__ */new Date("2014-06-25T04:00:00.123Z")),gi=$t==="06/25/2014, 00:00:00"||$t==="06/25/2014 00:00:00";function yi(e){return Ye[e]||(Ye[e]=gi?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ye[e];}function it(e,t,n,r,a,i,o){const s=/* @__PURE__ */new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,a,i,o),s;}const Nt=36e5,wi=6e4,Ae={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Oe(e,t,n){if(!e)return 0;let r=Ae.timezoneZ.exec(e);if(r)return 0;let a,i;if(r=Ae.timezoneHH.exec(e),r)return a=parseInt(r[1],10),Et(a)?-(a*Nt):NaN;if(r=Ae.timezoneHHMM.exec(e),r){a=parseInt(r[2],10);const o=parseInt(r[3],10);return Et(a,o)?(i=Math.abs(a)*Nt+o*wi,r[1]==="+"?-i:i):NaN;}if(vi(e)){t=new Date(t||Date.now());const o=n?t:pi(t),s=Ve(o,e);return-(n?s:Ti(t,s,e));}return NaN;}function pi(e){return it(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());}function Ve(e,t){const n=mi(e,t),r=it(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,r-a;}function Ti(e,t,n){let a=e.getTime()-t;const i=Ve(new Date(a),n);if(t===i)return t;a-=i-t;const o=Ve(new Date(a),n);return i===o?i:Math.max(i,o);}function Et(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59);}const Ot={};function vi(e){if(Ot[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ot[e]=!0,!0;}catch{return!1;}}const bi=60*1e3,xi={X:function(e,t,n){const r=ze(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return It(r);case"XXXX":case"XX":return Y(r);case"XXXXX":case"XXX":default:return Y(r,":");}},x:function(e,t,n){const r=ze(n.timeZone,e);switch(t){case"x":return It(r);case"xxxx":case"xx":return Y(r);case"xxxxx":case"xxx":default:return Y(r,":");}},O:function(e,t,n){const r=ze(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Di(r,":");case"OOOO":default:return"GMT"+Y(r,":");}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return _t("short",e,n);case"zzzz":default:return _t("long",e,n);}}};function ze(e,t){const n=e?Oe(e,t,!0)/bi:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n;}function Me(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r;}function Y(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Me(Math.floor(r/60),2),i=Me(Math.floor(r%60),2);return n+a+t+i;}function It(e,t){return e%60===0?(e>0?"-":"+")+Me(Math.abs(e)/60,2):Y(e,t);}function Di(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Me(i,2);}function Ct(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t;}const bn=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Re=36e5,Ft=6e4,Si=2,b={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:bn};function ke(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return/* @__PURE__ */new Date(NaN);const n=t.additionalDigits==null?Si:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return/* @__PURE__ */new Date(NaN);const r=Mi(e),{year:a,restDateString:i}=ki(r.date,n),o=_i(i,a);if(o===null||isNaN(o.getTime()))return/* @__PURE__ */new Date(NaN);if(o){const s=o.getTime();let c=0,u;if(r.time&&(c=$i(r.time),c===null||isNaN(c)))return/* @__PURE__ */new Date(NaN);if(r.timeZone||t.timeZone){if(u=Oe(r.timeZone||t.timeZone,new Date(s+c)),isNaN(u))return/* @__PURE__ */new Date(NaN);}else u=Ct(new Date(s+c)),u=Ct(new Date(s+c+u));return new Date(s+c+u);}else return/* @__PURE__ */new Date(NaN);}function Mi(e){const t={};let n=b.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=b.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const a=b.timeZone.exec(r);a?(t.time=r.replace(a[1],""),t.timeZone=a[1].trim()):t.time=r;}return t;}function ki(e,t){if(e){const n=b.YYY[t],r=b.YYYYY[t];let a=b.YYYY.exec(e)||r.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)};}if(a=b.YY.exec(e)||n.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)};}}return{year:null};}function _i(e,t){if(t===null)return null;let n,r,a;if(!e||!e.length)return n=/* @__PURE__ */new Date(0),n.setUTCFullYear(t),n;let i=b.MM.exec(e);if(i)return n=/* @__PURE__ */new Date(0),r=parseInt(i[1],10)-1,Yt(t,r)?(n.setUTCFullYear(t,r),n):/* @__PURE__ */new Date(NaN);if(i=b.DDD.exec(e),i){n=/* @__PURE__ */new Date(0);const o=parseInt(i[1],10);return Oi(t,o)?(n.setUTCFullYear(t,0,o),n):/* @__PURE__ */new Date(NaN);}if(i=b.MMDD.exec(e),i){n=/* @__PURE__ */new Date(0),r=parseInt(i[1],10)-1;const o=parseInt(i[2],10);return Yt(t,r,o)?(n.setUTCFullYear(t,r,o),n):/* @__PURE__ */new Date(NaN);}if(i=b.Www.exec(e),i)return a=parseInt(i[1],10)-1,At(a)?Pt(t,a):/* @__PURE__ */new Date(NaN);if(i=b.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const o=parseInt(i[2],10)-1;return At(a,o)?Pt(t,a,o):/* @__PURE__ */new Date(NaN);}return null;}function $i(e){let t,n,r=b.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Ue(t)?t%24*Re:NaN;if(r=b.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Ue(t,n)?t%24*Re+n*Ft:NaN;if(r=b.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const a=parseFloat(r[3].replace(",","."));return Ue(t,n,a)?t%24*Re+n*Ft+a*1e3:NaN;}return null;}function Pt(e,t,n){t=t||0,n=n||0;const r=/* @__PURE__ */new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=t*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r;}const Ni=[31,28,31,30,31,30,31,31,30,31,30,31],Ei=[31,29,31,30,31,30,31,31,30,31,30,31];function xn(e){return e%400===0||e%4===0&&e%100!==0;}function Yt(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=xn(e);if(r&&n>Ei[t]||!r&&n>Ni[t])return!1;}return!0;}function Oi(e,t){if(t<1)return!1;const n=xn(e);return!(n&&t>366||!n&&t>365);}function At(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6));}function Ue(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60));}const Ii=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ci(e,t,n={}){t=String(t);const r=t.match(Ii);if(r){const a=ke(n.originalDate||e,n);t=r.reduce(function(i,o){if(o[0]==="'")return i;const s=i.indexOf(o),c=i[s-1]==="'",u=i.replace(o,"'"+xi[o[0]](a,o,n)+"'");return c?u.substring(0,s-1)+u.substring(s+1):u;},t);}return at(e,t,n);}function Fi(e,t,n){e=ke(e,n);const r=Oe(t,e,!0),a=new Date(e.getTime()-r),i=/* @__PURE__ */new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i;}function Dn(e,t,n,r){return r={...r,timeZone:t,originalDate:e},Ci(Fi(e,t,{timeZone:r.timeZone}),n,r);}function ae(e,t,n){if(typeof e=="string"&&!e.match(bn))return ke(e,{...n,timeZone:t});e=ke(e,n);const r=it(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=Oe(t,new Date(r));return new Date(r+a);}function ec(e,t){return e&&e!=="auto"?e:t;}function tc(e,t=/* @__PURE__ */new Date()){try{const n={timeZone:e,timeZoneName:"short"},a=new Intl.DateTimeFormat("en-US",n).formatToParts(t).find(i=>i.type==="timeZoneName");return(a==null?void 0:a.value)||e;}catch{return e;}}function nc(e){try{const t={timeZone:e,timeZoneName:"long"},r=new Intl.DateTimeFormat("en-US",t).formatToParts(/* @__PURE__ */new Date()).find(a=>a.type==="timeZoneName");return(r==null?void 0:r.value)||e;}catch{return e;}}function ot(e,t="auto"){if(!e)return/* @__PURE__ */new Date(NaN);const n=e.endsWith("Z"),r=/[+-]\d{2}:?\d{2}$/.test(e),a=/\([A-Z]{3,4}\)$/.test(e);if(t==="auto")return n||r||a?new Date(e):/* @__PURE__ */new Date(e+"Z");if(t==="local"){if(n||r){const i=e.replace(/Z$/,"").replace(/[+-]\d{2}:?\d{2}$/,"");return new Date(i);}return new Date(e);}else return t==="UTC"?n?new Date(e):r?new Date(e):/* @__PURE__ */new Date(e+"Z"):n||r||a?new Date(e):ae(e,t);}const Pi="MM/dd/yyyy",Yi=(e,t,n,r="auto")=>{if(!e)return"";try{const a=ot(e,r);if(isNaN(a.getTime()))return e;const o=(t&&t.trim()?t:Pi).replace(/LLLL/g,"MMMM").replace(/LLL/g,"MMM");return n&&n!=="auto"?Dn(a,n,o):at(a,o);}catch(a){return console.error("Date formatting error:",a),e;}};function rc(e,t,n="auto"){if(e)try{const r=ot(e,n);if(isNaN(r.getTime()))return;const a="yyyy M d H m s",i=t&&t!=="auto"?Dn(r,t,a):at(r,a),[o,s,c,u,l,f]=i.split(" ").map(Number);return{year:o,month:s,day:c,hour:u,minute:l,second:f};}catch{return;}}const Ai=(e,t="auto")=>{if(!e)return"";try{const n=ot(e,t);return isNaN(n.getTime())?e:qa(n,{addSuffix:!0});}catch(n){return console.error("Relative time formatting error:",n),e;}};function zi(e,t,n,r){const a=e instanceof Date?e.toISOString():String(e),i=(r==null?void 0:r.browserTimezone)||n,o=(r==null?void 0:r.isSqlCard)??!1;if(t!=null&&t.useRelativeTime)return Ai(a,(t==null?void 0:t.sourceTimezone)||"auto");const s=t!=null&&t.useCustomFormat&&t!=null&&t.customFormat?t.customFormat:(t==null?void 0:t.format)||"MM/dd/yyyy";return Yi(a,s,t!=null&&t.timezone&&(t==null?void 0:t.timezone)!=="auto"?t.timezone:o?i:n,(t==null?void 0:t.sourceTimezone)||"auto");}function Sn(e,t,n){var o,s;if(e==null)return e===null?((o=n.absence)==null?void 0:o.nullText)??"":((s=n.absence)==null?void 0:s.emptyText)??"";const r=Qn(e)?e:void 0,a=r?r.value:e,i=r??(typeof e=="number"?e:void 0);if(!n.useFormattedValues||!t)return String(a);switch(t.type){case"number":return i!==void 0?Er(i,t.numberFormat,n.locale):String(a);case"date":return zi(a,t.dateFormat,n.timezone,{browserTimezone:n.browserTimezone,isSqlCard:n.isSqlCard});case"progress":return i!==void 0?`${a}%`:String(a);case"badge":case"link":case"text":case"none":default:return String(a);}}function ac(e,t){return t.visibleColumns.map(n=>{const r=e[n],a=t.columnSettings[n];return Sn(r,a,{useFormattedValues:t.useFormattedValues,timezone:t.timezone,locale:t.locale});});}const Mn=1e4,Ri=1e6,ic=5e6,oc=1024**3,sc=1024**3;function cc(e){return e>Mn;}function uc(e){return e.cardType==="matrixTable"?"try-direct":e.loadedRowCount===null||e.loadedRowCount<=Mn?"direct":e.loadedRowCount<=Ri?"background":"blocked";}const Ui=5*1024*1024,lc=64*1024*1024,_e=p.number().int().positive().max(Number.MAX_SAFE_INTEGER),ye=p.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),$e=ye.refine(e=>e>0),Li=e=>!!e&&e!=="."&&e!==".."&&!e.includes("/")&&!e.includes("\\");function A(e,t){const n=t.split("/");if(n.length!==5||n[0]!=="exports"||n[1]!==e||n[2]!=="attempts"||!n.every(Li))throw new Error("Invalid Matrix export artifact namespace.");return{attemptId:n[3],filename:n[4]};}function mc(e,t,n){const r=`exports/${e}/attempts/${t}/${n}`;return A(e,r),r;}const fc=p.object({acquisition:p.literal("continuation"),jobId:p.string().min(1),sequence:$e,deadlineAt:_e}),Wi=["application/json",...en.map(e=>tn(e).partContentType)],Hi=p.object({key:p.string(),content:p.string(),contentType:p.enum(Wi),encoding:p.literal("gzip-base64").optional()}).refine(e=>!e.encoding||e.contentType==="application/json"||e.contentType===tn("xlsx").partContentType,"Unsupported Matrix artifact encoding."),ji=p.discriminatedUnion("kind",[p.object({kind:p.literal("work"),sequence:$e,checkpointKey:p.string(),objects:p.array(Hi).min(2).max(4),deadlineAt:_e}),p.object({kind:p.literal("committed"),sequence:$e,done:p.boolean(),deadlineAt:_e})]);function qi(e){const t=JSON.stringify(e);if(t===void 0||new TextEncoder().encode(t).byteLength>Ui)throw new RangeError("Matrix export batch exceeds its transport byte limit.");}function dc(e,t){const n=ji.parse(e);if(qi(e),n.deadlineAt!==t.deadlineAt)throw new Error("Matrix deadline does not match the job.");if(n.sequence!==t.sequence+(n.kind==="committed"?1:0))throw new Error("Invalid Matrix batch sequence.");if(n.kind==="work"){A(t.jobId,n.checkpointKey);for(const r of n.objects)A(t.jobId,r.key);}return n;}const Zi=p.object({acquisition:p.literal("continuation"),deadlineAt:_e,chunks:p.array(p.object({chunkNumber:$e,dataKey:p.string()})).min(1),totalRows:ye,totalBytes:ye,fileKey:p.string().min(1).optional(),fileSize:ye.optional(),format:p.enum(en).optional(),sheetKey:p.string().min(1).optional()}).refine(e=>e.fileKey===void 0==(e.fileSize===void 0),"Incomplete published Matrix artifact.").refine(e=>e.format==="xlsx"==(e.sheetKey!==void 0),"An Excel Matrix manifest names its sheet layout, and only it does.");function hc(e,t,n){const r=Zi.parse(e);if(r.deadlineAt!==n)throw new Error("Matrix deadline does not match the job.");return r.chunks.forEach((a,i)=>{if(a.chunkNumber!==i+1)throw new Error("Invalid committed Matrix chunk order.");A(t,a.dataKey);}),r.fileKey!==void 0&&A(t,r.fileKey),r.sheetKey!==void 0&&A(t,r.sheetKey),r;}const Xi="en-US";function zt(e){if(typeof e!="string")return;const t=e.trim();if(!(!t||t.toLowerCase()==="none"))return t;}function we(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.max(0,Math.min(10,Math.trunc(e)));}function Ki(e){return e==="currency"?2:e==="percent"?1:e==="scientific"?2:0;}function Vi(e,t,n){const r=we(t.minimumFractionDigits),a=we(t.maximumFractionDigits);if(typeof r=="number"||typeof a=="number"){const s=r??0,c=a??Math.max(s,2);return{minimumFractionDigits:Math.min(s,c),maximumFractionDigits:Math.max(s,c)};}const i=we(t.decimals);if(typeof i=="number")return{minimumFractionDigits:i,maximumFractionDigits:i};if(n!=null&&n.preserveOmittedProperties)return{};const o=Ki(e);return{minimumFractionDigits:o,maximumFractionDigits:o};}function Bi(e,t){if(!(typeof t!="string"||e==="percent"&&t==="%"))return t;}function Rt(e){const t=zt(e.locale),n=zt(e.currency),r=Bi(e.type,e.suffix);return{...e,...(t!==e.locale?{locale:t}:{}),...(n!==e.currency?{currency:n}:{}),...(r!==e.suffix?{suffix:r}:{})};}function O(e,t,n){const r={...t,type:e};if((n==null?void 0:n.numericInput)==="canonical"&&ne(r))return Rt(r);const a=Vi(e,t,n),i=typeof t.prefix=="string"?t.prefix:void 0,o={type:e,locale:t.locale,minimumFractionDigits:a.minimumFractionDigits,maximumFractionDigits:a.maximumFractionDigits,useGrouping:typeof t.useGrouping=="boolean"?t.useGrouping:typeof t.thousandsSeparator=="boolean"?t.thousandsSeparator:!0,prefix:i,suffix:t.suffix,negativeStyle:t.negativeStyle||"minus",compact:!!t.compact,scale:typeof t.scale=="number"?t.scale:void 0,...(t.signDisplay?{signDisplay:t.signDisplay}:{})};return e==="currency"&&t.currency&&(o.currency=t.currency),e==="percent"&&(o.percentValueMode=t.percentValueMode||"fraction"),Rt(o);}function Ut(e){return{type:"date",locale:e.locale||Xi,pattern:e.pattern,...(e.dialect?{dialect:e.dialect}:{}),...(e.preset?{preset:e.preset}:{}),relative:!!e.relative,timezone:e.timezone,sourceTimezone:e.sourceTimezone,prefix:e.prefix,suffix:e.suffix};}function Le(e){return e==="millisecond"||e==="second"||e==="minute"||e==="hour"||e==="day";}function Lt(e){const t=we(e.maxUnits);return{type:"duration",inputUnit:Le(e.inputUnit)?e.inputUnit:"second",outputStyle:e.outputStyle==="digital"||e.outputStyle==="long"?e.outputStyle:"compact",largestUnit:Le(e.largestUnit)?e.largestUnit:void 0,smallestUnit:Le(e.smallestUnit)?e.smallestUnit:"second",maxUnits:t,prefix:e.prefix,suffix:e.suffix,negativeStyle:e.negativeStyle||"minus"};}function Wt(e){return{type:"string",prefix:e.prefix,suffix:e.suffix};}function Gi(e,t){if(!e)return;if(typeof e=="string"){const r=e.trim().toLowerCase();return r==="currency"?O("currency",{type:"currency"},t):r==="percentage"||r==="percent"?O("percent",{type:"percentage",percentValueMode:"fraction"},t):r==="scientific"?O("scientific",{type:"scientific"},t):r==="date"?Ut({}):r==="duration"?Lt({}):r==="string"?Wt({}):r==="number"?O("number",{type:"number"},t):void 0;}if("type"in e&&e.type==="temporal_bucket"){const r=ir.safeParse(e);return r.success?r.data:void 0;}const n=e;if((t==null?void 0:t.numericInput)==="canonical"){const r=n.type==="percentage"?{...n,type:"percent"}:n;if(ne(r))return O(r.type,r,t);}if(n.type==="percentage")return O("percent",{...n,percentValueMode:n.percentValueMode||"fraction"},t);if(n.type==="number"||n.type==="currency"||n.type==="percent"||n.type==="scientific")return O(n.type,n,t);if(n.type==="date")return Ut(n);if(n.type==="duration")return Lt(n);if(n.type==="string")return Wt(n);}const Qi=Object.freeze({source:"automatic"});function Ji(e,t){var r,a;const n=e.preferences;switch(t){case"tooltip":return(r=n==null?void 0:n.tooltipConfig)==null?void 0:r.valueFormat;case"dataLabel":case"pieLabel":return(a=n==null?void 0:n.dataLabelsConfig)==null?void 0:a.valueFormat;default:return;}}function Ht(e,t){const n=e.config;if(n)return[...(n.metricColumns??[]),...(n.groupByColumns??[]),...(n.detailColumns??[]),...(n.pivotByColumns??[])].find(r=>r.id===t);}function eo(e,t){if(t.kind==="field")return Ht(e,t.fieldId);if(t.kind==="pivot")return Ht(e,t.metricId);}function to(e,t,n){var r,a,i,o,s,c,u,l,f;switch(t.kind){case"field":case"pivot":return n!=null&&n.format&&n.formatOrigin==="override"?n.format:void 0;case"result":return(i=(a=(r=e.preferences)==null?void 0:r.sqlColumns)==null?void 0:a[t.key])==null?void 0:i.format;case"sqlKpiValue":return(s=(o=e.preferences)==null?void 0:o.sqlKpiValue)==null?void 0:s.format;case"matrixMeasure":return(u=(c=e.config)==null?void 0:c.matrix)==null?void 0:u.presentation.measureFormats[t.measureId];case"matrixLevel":return(f=(l=e.config)==null?void 0:l.matrix)==null?void 0:f.presentation.levelFormats[t.levelId];}}function no(e){if(!e)return;if(e.format&&e.formatOrigin!=="override")return e.format;const t=e.semanticTemporalPresentation;return t&&t.granularity===e.granularity?t.format:void 0;}function st(e){return e.surface?{format:e.surface,source:"surface"}:e.override?{format:e.override,source:"override"}:e.model?{format:e.model,source:"model"}:e.snapshot?{format:e.snapshot,source:"snapshot"}:Qi;}function ro(e){var o;const{card:t,column:n,surface:r}=e,a=eo(t,n),i=n.kind==="field"?n.fieldId:n.kind==="pivot"?n.metricId:void 0;return st({surface:r?Ji(t,r):void 0,override:to(t,n,a),model:(i!==void 0?(o=e.modelFormats)==null?void 0:o[i]:void 0)??e.catalogFormat,snapshot:no(a)});}function ao(e,t){const n=r=>r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.keys(r).sort().map(a=>[a,n(r[a])])):r;return JSON.stringify(n(e))===JSON.stringify(n(t));}const io=["metricColumns","groupByColumns","detailColumns","pivotByColumns"],jt=/* @__PURE__ */new WeakMap();function gc(e,t){const n=t==null?void 0:t.modelFormats;if(!e||!n||Object.keys(n).length===0)return e;let r=jt.get(e);if(r||jt.set(e,r=/* @__PURE__ */new WeakMap()),r.has(n))return r.get(n);const a=oo(e,n);return r.set(n,a),a;}function oo(e,t){const n={config:e};let r;for(const a of io){const i=e[a];if(!(i!=null&&i.length))continue;let o=!1;const s=i.map(c=>{const u=ro({card:n,column:{kind:"field",fieldId:c.id},modelFormats:t});return u.source!=="model"||ao(u.format,c.format)?c:(o=!0,{...c,format:u.format});});o&&((r??(r={...e}))[a]=s);}return r??e;}function v(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")?t.constructor:void 0;return typeof n=="function"&&Function.prototype.toString.call(n)===Function.prototype.toString.call(Object);}const so=["type","locale","minimumFractionDigits","maximumFractionDigits","useGrouping","prefix","suffix","negativeStyle","compact","scale","currency","percentValueMode","signDisplay"];function co(e){if(!v(e))return{ok:!1,issues:[{path:"$",message:"Numeric format must be an object."}]};const t=[],n=new Set(so);Object.keys(e).filter(i=>!n.has(i)).forEach(i=>t.push({path:i,message:`Unknown property "${i}".`})),e.type!=="number"&&e.type!=="currency"&&e.type!=="percent"&&e.type!=="scientific"&&t.push({path:"type",message:"Expected number, currency, percent, or scientific."});const r=e.locale===void 0?void 0:te(e.locale);e.locale!==void 0&&!r&&t.push({path:"locale",message:"Expected a supported BCP 47 locale."});const a=e.currency===void 0?void 0:Ze(e.currency);e.currency!==void 0&&!a&&t.push({path:"currency",message:"Expected a supported ISO 4217 currency code."});for(const i of["minimumFractionDigits","maximumFractionDigits"]){const o=e[i];o!==void 0&&(!Number.isInteger(o)||typeof o!="number"||o<0||o>20)&&t.push({path:i,message:"Expected an integer from 0 to 20."});}typeof e.minimumFractionDigits=="number"&&typeof e.maximumFractionDigits=="number"&&e.minimumFractionDigits>e.maximumFractionDigits&&t.push({path:"maximumFractionDigits",message:"Must be greater than or equal to minimumFractionDigits."});for(const i of["useGrouping","compact"])e[i]!==void 0&&typeof e[i]!="boolean"&&t.push({path:i,message:"Expected a boolean."});for(const i of["prefix","suffix"])e[i]!==void 0&&typeof e[i]!="string"&&t.push({path:i,message:"Expected a string."});return e.negativeStyle!==void 0&&e.negativeStyle!=="minus"&&e.negativeStyle!=="parentheses"&&t.push({path:"negativeStyle",message:"Expected minus or parentheses."}),e.percentValueMode!==void 0&&e.percentValueMode!=="fraction"&&e.percentValueMode!=="whole"&&t.push({path:"percentValueMode",message:"Expected fraction or whole."}),e.scale!==void 0&&(typeof e.scale!="number"||!Number.isFinite(e.scale))&&t.push({path:"scale",message:"Expected a finite number."}),e.signDisplay!==void 0&&e.signDisplay!=="auto"&&e.signDisplay!=="always"&&e.signDisplay!=="exceptZero"&&e.signDisplay!=="never"&&t.push({path:"signDisplay",message:"Expected auto, always, exceptZero, or never."}),t.length>0?{ok:!1,issues:t}:{ok:!0,value:{type:e.type,...(r?{locale:r}:{}),...(e.minimumFractionDigits!==void 0?{minimumFractionDigits:e.minimumFractionDigits}:{}),...(e.maximumFractionDigits!==void 0?{maximumFractionDigits:e.maximumFractionDigits}:{}),...(e.useGrouping!==void 0?{useGrouping:e.useGrouping}:{}),...(e.prefix!==void 0?{prefix:e.prefix}:{}),...(e.suffix!==void 0?{suffix:e.suffix}:{}),...(e.negativeStyle!==void 0?{negativeStyle:e.negativeStyle}:{}),...(e.compact!==void 0?{compact:e.compact}:{}),...(e.scale!==void 0?{scale:e.scale}:{}),...(a?{currency:a}:{}),...(e.percentValueMode!==void 0?{percentValueMode:e.percentValueMode}:{}),...(e.signDisplay!==void 0?{signDisplay:e.signDisplay}:{})}};}function uo(e){const t=co(e);if(!t.ok)return t;const n=[];return t.value.locale||n.push({path:"locale",message:"Resolved numeric formats require an explicit locale."}),t.value.minimumFractionDigits===void 0&&n.push({path:"minimumFractionDigits",message:"Resolved numeric formats require minimumFractionDigits."}),t.value.maximumFractionDigits===void 0&&n.push({path:"maximumFractionDigits",message:"Resolved numeric formats require maximumFractionDigits."}),t.value.type==="currency"&&!t.value.currency&&n.push({path:"currency",message:"Resolved currency formats require an explicit currency."}),n.length>0?{ok:!1,issues:n}:t;}function yc(e){var r;const t=/* @__PURE__ */new Set();if(e.snapshot.resolvedFormats.forEach((a,i)=>{if(a.format.type!=="temporal_bucket"){if(a.scope.attachmentIndex!==void 0)throw new Error(`resolvedFormats.${i}.scope.attachmentIndex is not valid for a card export`);if(a.scope.dashboardId!==e.expectedScope.dashboardId||a.scope.cardId!==e.expectedScope.cardId)throw new Error(`resolvedFormats.${i}.scope must match the executing dashboard/card`);if(a.target.kind!=="column")throw new Error(`resolvedFormats.${i}.target must identify an export column`);if(t.has(a.target.columnKey))throw new Error(`resolvedFormats.${i} duplicates export column "${a.target.columnKey}"`);t.add(a.target.columnKey);}}),!e.useFormattedValues)return;if(!((r=e.visibleColumns)!=null&&r.length))throw new Error("visibleColumns must identify every formatted export column");const n=e.visibleColumns.find(a=>!t.has(a));if(n)throw new Error(`resolvedFormats is missing visible export column "${n}"`);}function lo(e,t){const n=new Intl.NumberFormat(e,{style:"currency",currency:t}).resolvedOptions();return{minimumFractionDigits:n.minimumFractionDigits,maximumFractionDigits:n.maximumFractionDigits};}function mo(e){if(e.minimumFractionDigits!==void 0||e.maximumFractionDigits!==void 0){const n=e.minimumFractionDigits??0;return{minimumFractionDigits:n,maximumFractionDigits:e.maximumFractionDigits??Math.max(n,2)};}const t=e.type==="percent"?1:e.type==="scientific"?2:0;return{minimumFractionDigits:t,maximumFractionDigits:t};}function fo(e,t,n){const r=te(e.locale)??t.locale,a=e.type==="number"||e.type==="currency"?Ze(n):void 0;if(!(e.type==="currency"||a!==void 0))return{...e,locale:r,...mo(e)};const o=a??Ze(e.currency)??t.defaultCurrency,s=lo(r,o),c=s.minimumFractionDigits??0,u=s.maximumFractionDigits??c,l=e.minimumFractionDigits??Math.min(c,e.maximumFractionDigits??c),f=e.maximumFractionDigits??Math.max(l,u);return{...e,type:"currency",locale:r,currency:o,minimumFractionDigits:l,maximumFractionDigits:f};}const qt=["YYYY","MMMM","MMM","YY","MM","DD","HH","mm","ss"],ho=["hh","h","a","A"],go={semaphor_tokens:qt,grouped:[...qt,...ho]},yo=/* @__PURE__ */new Set([" ","-","/",":",".",",","T"]),me=["day","week","month","quarter","year"],kn={week_of_short:["week"],week_of_long:["week"],quarter_short:["quarter"],quarter_long:["quarter"],fiscal_quarter_short:["quarter"],fiscal_year:["year"],short:me,long:me,numeric:me,iso:me};function wo(e){return typeof e=="string"&&Object.prototype.hasOwnProperty.call(kn,e);}function po(e,t,n){return go[n].find(r=>e.startsWith(r,t));}function P(e){return{ok:!1,code:"invalid_temporal_bucket_pattern",message:e};}function ie(e,t){var i;if(!e)return P("Type a pattern, for example HH:mm.");if(e.trim()!==e)return P("A pattern can't start or end with a space.");const n=[];let r=0,a=!1;for(;r<e.length;){const o=po(e,r,t);if(o){if(a)return P("Put a separator between two parts, for example HH:mm.");n.push({kind:"token",value:o}),r+=o.length,a=!0;continue;}const s=e[r];if(!yo.has(s))return P(`"${s}" isn't a pattern letter.`);if(n.length===0)return P("A pattern can't start with a separator.");const c=n[n.length-1];c.kind==="literal"?c.value+=s:n.push({kind:"literal",value:s}),r+=1,a=!1;}return((i=n[n.length-1])==null?void 0:i.kind)!=="token"?P("A pattern can't end with a separator."):{ok:!0,segments:n};}function To(e){return e.flatMap(t=>t.kind==="token"?[t.value]:[]);}function fe(e,t){return e.filter(n=>t.includes(n)).length;}function V(e,t){return e.some(n=>t.includes(n));}const _n=["YYYY","YY"],$n=["MMMM","MMM","MM"],vo=[..._n,...$n,"DD"],Be=["HH","hh","h"],bo=["hh","h"],Ge=["a","A"],xo=[...Be,"mm","ss",...Ge],de="A date needs its year, month and day.";function Do(e,t){if(new Set(e).size!==e.length)return"Use each part once.";if(fe(e,Be)>1)return"Use one hour: HH for a 24-hour clock, or h with a for 12-hour.";if(fe(e,Ge)>1)return"Use a once to show AM or PM.";const n=V(e,bo),r=V(e,Ge);if(r&&!n)return"a shows AM or PM: pair it with h or hh, not HH.";if(n&&!r)return"Add a after a 12-hour hour, so 2:30 reads 2:30 PM.";const a=fe(e,_n)===1,i=fe(e,$n)===1,o=e.includes("DD"),s=V(e,Be),c=V(e,xo),u=!V(e,vo)||a&&i&&o;switch(t){case"second":return!s||!e.includes("mm")||!e.includes("ss")?"A second shows hours, minutes and seconds, for example h:mm:ss a.":u?void 0:de;case"minute":return!s||!e.includes("mm")?"A minute shows hours and minutes, for example h:mm a.":u?void 0:de;case"hour":return s?u?void 0:de:"An hour shows its hour, for example h a.";case"day":case"week":return c?`A ${t} shows a date without a time, for example MMM DD, YYYY.`:a&&i&&o?void 0:de;case"month":return a&&i&&!o&&!c?void 0:"A month shows its month and year, for example MMM YYYY.";case"quarter":return"A quarter takes a preset, such as Q1 2024, not a pattern.";case"year":return a&&!i&&!o&&!c?void 0:"A year shows only its year, for example YYYY.";}}function Nn(e,t){if(e.presentation.mode==="auto")return{ok:!0};if(e.presentation.mode==="preset"){const a=kn[e.presentation.preset];return a.includes(t)?{ok:!0}:{ok:!1,code:"incompatible_temporal_bucket_preset",message:`Preset ${e.presentation.preset} requires ${a.join(", ")} granularity.`};}const n=ie(e.presentation.pattern,"grouped");if(!n.ok)return n;const r=Do(To(n.segments),t);return r?{ok:!1,code:"incompatible_temporal_bucket_pattern",message:r}:{ok:!0,segments:n.segments};}function wc(e,t){if(!(!e||!t))return Nn(e,t).ok?e:void 0;}const Zt=/* @__PURE__ */new Map();function En(e,t){var r;let n=Zt.get(e);return n||(n=new Intl.DateTimeFormat(e,{calendar:"gregory",timeZone:"UTC",hour:"numeric",hour12:!0}),Zt.set(e,n)),((r=n.formatToParts(new Date(Date.UTC(2e3,0,1,t))).find(a=>a.type==="dayPeriod"))==null?void 0:r.value)??"";}function So(e){return e.preset?{mode:"preset",preset:e.preset}:e.pattern?{mode:"pattern",dialect:e.dialect??"semaphor_tokens",pattern:e.pattern}:{mode:"auto"};}class L extends Error{constructor(n,r){super(r);_(this,"code");this.name="RawTemporalFormatContractError",this.code=n;}}const Mo=["SSSSSSSSS","SSSSSSSS","SSSSSSS","SSSSSS","SSSSS","SSSS","SSS","SS","S"],ko=["yyyy","MMMM","LLLL","zzz","XXX","MMM","LLL","yy","MM","dd","HH","hh","mm","ss","M","d","H","h","m","s","a"],_o=/* @__PURE__ */new Set(["HH","H","hh","h","mm","m","ss","s","a",...Mo]),$o=/* @__PURE__ */new Set(["zzz","XXX"]),We=/* @__PURE__ */new Set(["short","medium","long"]);function k(e,t){return Object.keys(e).length===t.length&&t.every(r=>r in e);}function g(e){throw new L("invalid_raw_temporal_format",e);}function On(e){if(!e||e.trim()!==e||e.length>256)return g("date_fns patterns must be non-empty, trimmed, and at most 256 characters.");const t=[],n=a=>{const i=t[t.length-1];(i==null?void 0:i.kind)==="literal"?i.value+=a:t.push({kind:"literal",value:a});};let r=0;for(;r<e.length;){if(e[r]==="'"){if(e[r+1]==="'"){n("'"),r+=2;continue;}let o="",s=!1;for(r+=1;r<e.length;){if(e[r]==="'"){if(e[r+1]==="'"){o+="'",r+=2;continue;}s=!0,r+=1;break;}o+=e[r],r+=1;}if(!s)return g("date_fns pattern has an unclosed quote.");n(o);continue;}if(e[r]==="S"){let o=r+1;for(;e[o]==="S";)o+=1;const s=e.slice(r,o);if(s.length>9)return g("date_fns fractional-second tokens support at most nine digits.");t.push({kind:"token",value:s}),r=o;continue;}const a=ko.find(o=>e.startsWith(o,r));if(a){t.push({kind:"token",value:a}),r+=a.length;continue;}const i=e[r];if(/[A-Za-z]/.test(i))return g(`Unsupported date_fns pattern token beginning at "${e.slice(r)}".`);n(i),r+=1;}return t.some(a=>a.kind==="token")?t:g("date_fns patterns must contain at least one token.");}function In(e,t){if(e==="semaphor_tokens"){const n=ie(t,"semaphor_tokens");n.ok||g(n.message);return;}On(t);}function No(e){return!v(e)||!k(e,["dateStyle","dateTime"])?g("Automatic raw temporal styles are incomplete."):We.has(e.dateStyle)?!v(e.dateTime)||!k(e.dateTime,["dateStyle","timeStyle"])||!We.has(e.dateTime.dateStyle)||!We.has(e.dateTime.timeStyle)?g("Automatic dateTime styles are incomplete or invalid."):{dateStyle:e.dateStyle,dateTime:{dateStyle:e.dateTime.dateStyle,timeStyle:e.dateTime.timeStyle}}:g("Automatic dateStyle is invalid.");}function ct(e){const t=["type","locale","calendarTimezone","presentation"],n=[...t,"sourceTimezone"];if(!v(e)||!k(e,t)&&!k(e,n)||e.type!=="raw_temporal")return g("Resolved raw temporal format has an invalid shape.");const r=te(e.locale);return r?typeof e.calendarTimezone!="string"||!ve(e.calendarTimezone)?g("Raw temporal calendarTimezone must be a valid IANA timezone."):e.sourceTimezone!==void 0&&(typeof e.sourceTimezone!="string"||!ve(e.sourceTimezone))?g("Raw temporal sourceTimezone must be a valid IANA timezone."):v(e.presentation)?e.presentation.mode==="auto"?k(e.presentation,["mode","styles"])?{type:"raw_temporal",locale:r,calendarTimezone:e.calendarTimezone,...(e.sourceTimezone?{sourceTimezone:e.sourceTimezone}:{}),presentation:{mode:"auto",styles:No(e.presentation.styles)}}:g("Automatic raw temporal presentation has unknown fields."):e.presentation.mode==="preset"?!k(e.presentation,["mode","preset"])||!An(e.presentation.preset)?g("Preset raw temporal presentation has an invalid shape."):{type:"raw_temporal",locale:r,calendarTimezone:e.calendarTimezone,...(e.sourceTimezone?{sourceTimezone:e.sourceTimezone}:{}),presentation:{mode:"preset",preset:e.presentation.preset}}:e.presentation.mode!=="pattern"||!k(e.presentation,["mode","dialect","pattern"])||e.presentation.dialect!=="semaphor_tokens"&&e.presentation.dialect!=="date_fns"||typeof e.presentation.pattern!="string"?g("Pattern raw temporal presentation has an invalid shape."):(In(e.presentation.dialect,e.presentation.pattern),{type:"raw_temporal",locale:r,calendarTimezone:e.calendarTimezone,...(e.sourceTimezone?{sourceTimezone:e.sourceTimezone}:{}),presentation:{mode:"pattern",dialect:e.presentation.dialect,pattern:e.presentation.pattern}}):g("Raw temporal presentation must be an object."):g("Raw temporal locale is invalid or unsupported.");}function Cn(e){var s,c,u;if(e.format){if(!v(e.format))return g("Authored raw temporal format has an invalid shape.");const l=Object.keys(e.format);if(!l.includes("type")||!l.includes("presentation")||l.some(m=>m!=="type"&&m!=="presentation"&&m!=="timezone"&&m!=="sourceTimezone")||e.format.type!=="raw_temporal"||!v(e.format.presentation))return g("Authored raw temporal format has an invalid shape.");const f=e.format.presentation;if(f.mode==="auto"){if(!k(f,["mode"]))return g("Automatic authored raw temporal format has unknown fields.");}else if(f.mode==="preset"){if(!k(f,["mode","preset"])||!An(f.preset))return g("Authored raw temporal preset has an invalid shape.");}else{if(f.mode!=="pattern"||!k(f,["mode","dialect","pattern"])||f.dialect!=="semaphor_tokens"&&f.dialect!=="date_fns"||typeof f.pattern!="string")return g("Authored raw temporal pattern has an invalid shape.");In(f.dialect,f.pattern);}}const t=(s=e.format)==null?void 0:s.timezone,n=(c=e.format)==null?void 0:c.sourceTimezone,r=t&&t!=="auto"?t:e.calendar.tz,a=n&&n!=="auto"?n==="local"?Intl.DateTimeFormat().resolvedOptions().timeZone:n:void 0;if(t!==void 0&&t!=="auto"&&!ve(r)||a!==void 0&&!ve(a))return g("Authored raw temporal timezone is invalid.");const i=((u=e.format)==null?void 0:u.presentation)??{mode:"auto"},o={type:"raw_temporal",locale:e.preferences.locale,calendarTimezone:r,...(a?{sourceTimezone:a}:{}),presentation:i.mode==="pattern"||i.mode==="preset"?{...i}:{mode:"auto",styles:{dateStyle:e.preferences.dateStyle,dateTime:{...e.preferences.dateTime}}}};return ct(o);}function pc(e){const t=/* @__PURE__ */new Set();let n=!1;for(const r of e.values){if(r===null)continue;n=!0;const a=lr(r);a&&t.add(a);}if(!n)return{status:"empty"};if(t.size===0)return{status:"invalid_only"};if(t.size>1)throw new L("mixed_sql_temporal_semantics",`Declared SQL temporal column "${e.columnKey}" mixes date, wall-datetime, or instant semantics. Normalize it to one kind.`);return{status:"classified",metadata:{kind:"raw_temporal",valueKind:[...t][0]}};}function Tc(e){return{version:1,columns:Object.fromEntries([...e].map(([t,n])=>[t,n.status==="classified"?n.metadata.valueKind:n.status]))};}function Eo(e){if(!v(e)||e.version!==1||!v(e.columns)||Object.keys(e).some(r=>r!=="version"&&r!=="columns"))throw new L("invalid_raw_temporal_format","Raw temporal chunk classification evidence is malformed.");const t={},n=/* @__PURE__ */new Set(["empty","invalid_only","date","wall_datetime","instant"]);for(const[r,a]of Object.entries(e.columns)){if(!r.trim()||!n.has(a))throw new L("invalid_raw_temporal_format","Raw temporal chunk classification evidence contains an invalid column or status.");t[r]=a;}return{version:1,columns:t};}function vc(e){if(e.length===0)return;const t=e.map(Eo),n=Object.keys(t[0].columns).sort();for(let r=1;r<t.length;r+=1){const a=Object.keys(t[r].columns).sort();if(a.length!==n.length||a.some((i,o)=>i!==n[o]))throw new L("invalid_raw_temporal_format","Raw temporal chunk classification evidence has inconsistent columns.");}for(const r of n)if(new Set(t.map(i=>i.columns[r]).filter(i=>i!=="empty"&&i!=="invalid_only")).size>1)throw new L("mixed_sql_temporal_semantics",`Declared SQL temporal column "${r}" has inconsistent semantics across export chunks. Normalize it to one kind.`);}function Qe(e){const t=/* @__PURE__ */new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(e.hour,e.minute,e.second,0),t;}function ut(e,t){const n=e.fraction?`.${e.fraction.padEnd(3,"0").slice(0,3)}`:"";return ae(`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}T${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${n}`,t);}function Fn(e,t){const n=/* @__PURE__ */new Map(),r=/* @__PURE__ */new Map();let a,i,o;return{number(s,c=1){let u=n.get(c);return u||(u=new Intl.NumberFormat(e,{useGrouping:!1,minimumIntegerDigits:c,maximumFractionDigits:0}),n.set(c,u)),u.format(s);},month(s,c,u){var m;const l=`${c}:${u?"standalone":"contextual"}`;let f=r.get(l);if(!f){const d={calendar:"gregory",timeZone:"UTC",month:c};u||(d.day="numeric"),f=new Intl.DateTimeFormat(e,d),r.set(l,f);}return((m=f.formatToParts(s).find(d=>d.type==="month"))==null?void 0:m.value)??"";},dayPeriod(s){return En(e,s.getUTCHours());},instantFields(s){a??(a=new Intl.DateTimeFormat("en-CA",{calendar:"gregory",numberingSystem:"latn",timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}));const c=a.formatToParts(s),u=l=>{var f;return Number((f=c.find(m=>m.type===l))==null?void 0:f.value);};return{year:u("year"),month:u("month"),day:u("day"),hour:u("hour"),minute:u("minute"),second:u("second"),fraction:""};},timezoneName(s){var c;return i??(i=new Intl.DateTimeFormat(e,{calendar:"gregory",timeZone:t,timeZoneName:"short"})),((c=i.formatToParts(s).find(u=>u.type==="timeZoneName"))==null?void 0:c.value)??"";},timezoneOffset(s){var l;o??(o=new Intl.DateTimeFormat("en-US",{calendar:"gregory",timeZone:t,timeZoneName:"longOffset"}));const c=(l=o.formatToParts(s).find(f=>f.type==="timeZoneName"))==null?void 0:l.value;if(!c)return g("Unable to resolve the instant timezone offset.");const u=c.replace(/^GMT/,"");return u===""||/^[+-]00:00$/.test(u)?"Z":u;}};}function Oo(e,t,n,r,a){if(/^S{1,9}$/.test(e)){const i=t.fraction.padEnd(e.length,"0").slice(0,e.length);return r.number(Number(i),e.length);}switch(e){case"YYYY":case"yyyy":return r.number(t.year,4);case"YY":case"yy":return r.number(t.year%100,2);case"MMMM":return r.month(n,"long",!1);case"LLLL":return r.month(n,"long",!0);case"MMM":return r.month(n,"short",!1);case"LLL":return r.month(n,"short",!0);case"MM":return r.number(t.month,2);case"M":return r.number(t.month);case"DD":case"dd":return r.number(t.day,2);case"d":return r.number(t.day);case"HH":return r.number(t.hour,2);case"H":return r.number(t.hour);case"hh":return r.number(t.hour%12||12,2);case"h":return r.number(t.hour%12||12);case"mm":return r.number(t.minute,2);case"m":return r.number(t.minute);case"ss":return r.number(t.second,2);case"s":return r.number(t.second);case"a":return r.dayPeriod(n);case"zzz":return a?r.timezoneName(a):g("Timezone pattern tokens require an instant value.");case"XXX":return a?r.timezoneOffset(a):g("Timezone pattern tokens require an instant value.");default:return g(`Unsupported raw temporal pattern token "${e}".`);}}function Io(e,t,n,r){const a=Qe(t);return e.map(i=>i.kind==="literal"?i.value:Oo(i.value,t,a,n,r)).join("");}function Pn(e,t,n){const r=t==="date_fns"?On(n):(()=>{const i=ie(n,"semaphor_tokens");return i.ok?i.segments:g(i.message);})(),a=r.filter(i=>i.kind==="token").map(i=>i.value);return e==="date"&&a.some(i=>_o.has(i))?g("Date patterns cannot contain time tokens."):e!=="instant"&&a.some(i=>$o.has(i))?g("Timezone pattern tokens require an instant value."):r;}function Co(e){Pn(e.valueKind??"instant",e.dialect,e.pattern);}function Fo(e,t,n,r){const a=Pn(e.valueKind,n,r),i=Fn(t.locale,t.calendarTimezone);return o=>{const s=e.valueKind==="wall_datetime"&&t.sourceTimezone?ut(o.fields,t.sourceTimezone):void 0,c=e.valueKind==="instant"?{...i.instantFields(o.instant),fraction:o.fields.fraction}:s?{...i.instantFields(s),fraction:o.fields.fraction}:o.fields;return Io(a,c,i,o.instant??s);};}function Yn(e,t){const n=Fn(t.locale,t.calendarTimezone);return r=>{const a=e.valueKind==="instant"?n.instantFields(r.instant):e.valueKind==="wall_datetime"&&t.sourceTimezone?n.instantFields(ut(r.fields,t.sourceTimezone)):r.fields;return{year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute,second:a.second};};}const Po=/* @__PURE__ */new Set(["short","long","numeric","iso"]);function An(e){return typeof e=="string"&&Po.has(e);}function Yo(e,t,n){const r=Yn(e,t),a=e.valueKind!=="date",i=(s,c=2)=>String(s).padStart(c,"0");if(n==="iso")return s=>{const c=r(s),u=`${i(c.year,4)}-${i(c.month)}-${i(c.day)}`;return a?`${u} ${i(c.hour)}:${i(c.minute)}`:u;};const o=new Intl.DateTimeFormat(t.locale,{calendar:"gregory",timeZone:"UTC",year:"numeric",month:n,day:"numeric",...(a?{hour:"numeric",minute:"2-digit"}:{})});return s=>{const c=r(s),u=/* @__PURE__ */new Date(0);return u.setUTCFullYear(c.year,c.month-1,c.day),u.setUTCHours(c.hour,c.minute,c.second,0),o.format(u);};}function Ao(e,t){const n=t.presentation.mode==="auto"?t.presentation.styles:g("Automatic raw temporal formatting requires styles.");if(e.valueKind==="date"){const o=new Intl.DateTimeFormat(t.locale,{calendar:"gregory",timeZone:"UTC",dateStyle:n.dateStyle});return s=>o.format(Qe(s.fields));}const r=e.valueKind==="instant",a=!r&&n.dateTime.timeStyle==="long"?"medium":n.dateTime.timeStyle,i=new Intl.DateTimeFormat(t.locale,{calendar:"gregory",timeZone:r||e.valueKind==="wall_datetime"&&t.sourceTimezone?t.calendarTimezone:"UTC",dateStyle:n.dateTime.dateStyle,timeStyle:a});return o=>r?i.format(o.instant):e.valueKind==="wall_datetime"&&t.sourceTimezone?i.format(ut(o.fields,t.sourceTimezone)):i.format(Qe(o.fields));}function Xt(e,t,n){return{ok:!1,text:e,diagnostic:{code:n,message:`Raw temporal ${t.valueKind} value is ${n==="invalid_raw_temporal_value"?"malformed":"out of range"}.`}};}function zn(e){const t=cr(e.metadata),n=ct(e.format),r=n.presentation.mode==="auto"?Ao(t,n):n.presentation.mode==="preset"?Yo(t,n,n.presentation.preset):Fo(t,n,n.presentation.dialect,n.presentation.pattern),a=Yn(t,n);return i=>{if(i===null)return{ok:!0,text:"",status:"empty"};const o=ur(i,t.valueKind);return o.status==="invalid_shape"?Xt(i,t,"invalid_raw_temporal_value"):o.status==="out_of_range"?Xt(i,t,"out_of_range_raw_temporal_value"):{ok:!0,text:r(o),status:"formatted",wallClock:a(o)};};}function zo(e){return zn({metadata:e.metadata,format:e.format})(e.value);}function Ro(e){const t=Cn({format:e.authored,preferences:e.preferences,calendar:e.calendar});return{format:t,formatValue:zn({metadata:e.metadata,format:t})};}const Uo={dateStyle:"short",dateTime:{dateStyle:"short",timeStyle:"short"}};class pe extends Error{constructor(n,r){super(r);_(this,"code");this.name="TemporalBucketContractError",this.code=n;}}const Lo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wo=["January","February","March","April","May","June","July","August","September","October","November","December"];function He(e){return{ok:!1,error:{code:"invalid_temporal_bucket_value",message:e}};}function Ho(e){return e%4===0&&(e%100!==0||e%400===0);}function jo(e,t){return t===2?Ho(e)?29:28:[4,6,9,11].includes(t)?30:31;}function qo(e,t,n){const r=[0,3,2,5,0,3,5,1,4,6,2,4],a=t<3?e-1:e;return(a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+r[t-1]+n)%7;}function Ie(e){var t;return(t=e.calendar.fiscalCalendar)==null?void 0:t.yearStartMonth;}function Zo(e,t){return(e-t+12)%12%3===0;}function Xo(e,t){const{granularity:n}=t,r=Ie(t)??1;switch(n){case"second":return!0;case"minute":return e.second===0;case"hour":return e.minute===0&&e.second===0;case"day":return!0;case"week":return qo(e.year,e.month,e.day)===t.calendar.weekStart;case"month":return e.day===1;case"quarter":return e.day===1&&Zo(e.month,r);case"year":return e.day===1&&e.month===r;}}function oe(e,t){if(e===null)return{ok:!0,value:null};const n=t.granularity==="second"||t.granularity==="minute"||t.granularity==="hour",r=n?/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/.exec(e):/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return He(`Expected ${n?"YYYY-MM-DDTHH:mm:ss":"YYYY-MM-DD"} for ${t.granularity} granularity.`);const a={year:Number(r[1]),month:Number(r[2]),day:Number(r[3]),hour:n?Number(r[4]):0,minute:n?Number(r[5]):0,second:n?Number(r[6]):0};return a.year<1||a.month<1||a.month>12||a.day<1||a.day>jo(a.year,a.month)||a.hour>23||a.minute>59||a.second>59?He(`Invalid canonical ${t.granularity} bucket value ${e}.`):Xo(a,t)?{ok:!0,value:a}:He(`Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`);}const Ne=e=>`${T(e.year,4)}-${T(e.month)}-${T(e.day)}`;function bc(e,t,n){const r=oe(e,t);if(!r.ok||!r.value)return;const a=be({...r.value,millisecond:0},n.amount,n.unit),{granularity:i}=t;if(i==="second"||i==="minute"||i==="hour"){const o={...a,second:i==="second"?a.second:0,minute:i==="hour"?0:a.minute};return`${Ne(o)}T${T(o.hour)}:${T(o.minute)}:${T(o.second)}`;}return Ne(mr(a,i,t.calendar));}function xc(e,t){const n=oe(e,t);if(!n.ok||!n.value)return;const r={...n.value,millisecond:0},a=t.calendar.tz;return{startInclusive:gt(r,a).toISOString(),endExclusive:gt(be(r,1,t.granularity),a).toISOString(),timezone:a};}function Dc(e,t){const{granularity:n}=t;if(n==="second"||n==="minute"||n==="hour")return;const r=oe(e,t);if(!r.ok||!r.value)return;const a={...r.value,hour:0,minute:0,second:0,millisecond:0},i=be(be(a,1,n),-1,"day");return{first:Ne(a),last:Ne(i)};}function Sc(e){const{granularity:t,calendar:n}=e,r=(o,s)=>new Intl.DateTimeFormat("en-US",{...o,timeZone:"UTC"}).format(s),a=[`by ${t} in the ${n.tz} calendar`];t==="week"&&a.push(`weeks starting on ${r({weekday:"long"},new Date(Date.UTC(2023,0,1+n.weekStart)))}`);const i=Ie(e);return i&&(t==="quarter"||t==="year")&&a.push(`the fiscal year starting in ${r({month:"long"},new Date(Date.UTC(2e3,i-1,1)))}`),`${a.join(", ")}; each value is a bucket's start`;}function Rn(e){if(!v(e))return{ok:!1,issues:[{path:"$",message:"Resolved temporal bucket format must be an object."}]};const t=[],n=/* @__PURE__ */new Set(["type","presentation","locale"]);for(const o of Object.keys(e))n.has(o)||t.push({path:o,message:`Unknown property "${o}".`});e.type!=="temporal_bucket"&&t.push({path:"type",message:"Expected temporal_bucket."});const r=e.presentation;if(!v(r))t.push({path:"presentation",message:"Expected a presentation object."});else{const o=r.mode,s=o==="preset"?/* @__PURE__ */new Set(["mode","preset"]):o==="pattern"?/* @__PURE__ */new Set(["mode","pattern"]):o==="auto"?/* @__PURE__ */new Set(["mode","styles"]):/* @__PURE__ */new Set(["mode"]);for(const c of Object.keys(r))s.has(c)||t.push({path:`presentation.${c}`,message:`Unknown property "${c}".`});if(o==="preset")wo(r.preset)||t.push({path:"presentation.preset",message:"Expected a supported preset."});else if(o==="pattern"){if(typeof r.pattern!="string"||!r.pattern)t.push({path:"presentation.pattern",message:"Expected a non-empty pattern."});else{const c=ie(r.pattern,"grouped");c.ok||t.push({path:"presentation.pattern",message:c.message});}}else if(o==="auto"){const c=r.styles;(!v(c)||!["short","medium","long"].includes(String(c.dateStyle))||!v(c.dateTime)||!["short","medium","long"].includes(String(c.dateTime.dateStyle))||!["short","medium","long"].includes(String(c.dateTime.timeStyle))||Object.keys(c).some(u=>u!=="dateStyle"&&u!=="dateTime")||Object.keys(c.dateTime).some(u=>u!=="dateStyle"&&u!=="timeStyle"))&&t.push({path:"presentation.styles",message:"Expected complete resolved date and datetime styles."});}else t.push({path:"presentation.mode",message:"Expected auto, preset, or pattern."});}const a=te(e.locale);if(a||t.push({path:"locale",message:"Expected a supported base BCP 47 locale."}),t.length>0||!a||!v(r))return{ok:!1,issues:t};if(r.mode==="auto"){const o=r.styles;return{ok:!0,value:{type:"temporal_bucket",locale:a,presentation:{mode:"auto",styles:{dateStyle:o.dateStyle,dateTime:{dateStyle:o.dateTime.dateStyle,timeStyle:o.dateTime.timeStyle}}}}};}return{ok:!0,value:{type:"temporal_bucket",presentation:r.mode==="preset"?{mode:"preset",preset:r.preset}:{mode:"pattern",pattern:r.pattern},locale:a}};}function Ko(e,t){const n=!!t.calendar.fiscalCalendar;return e==="fiscal_quarter_short"||e==="fiscal_year"?n:e==="quarter_short"||e==="quarter_long"||jn(e)&&(t.granularity==="quarter"||t.granularity==="year")?!n:!0;}function Un(e,t){return Nn(e,t.granularity).ok?e.presentation.mode==="preset"?Ko(e.presentation.preset,t):!(e.presentation.mode==="pattern"&&t.calendar.fiscalCalendar&&(t.granularity==="quarter"||t.granularity==="year")):!1;}function Kt(e,t){if(!(!e||e.presentation.mode==="auto"))return Un(e,t)?{type:"temporal_bucket",presentation:e.presentation}:void 0;}function Ln(e){var a;const t=te(e.locale);if(!t)throw new pe("invalid_temporal_bucket_format","Temporal bucket locale must be a supported base BCP 47 locale.");const n=Kt(e.cardFormat,e.metadata);if(n)return{format:{...n,locale:t},source:"card"};const r=((a=e.semanticFormat)==null?void 0:a.granularity)===e.metadata.granularity?Kt(e.semanticFormat.format,e.metadata):void 0;return r?{format:{...r,locale:t},source:"semantic"}:{format:{type:"temporal_bucket",locale:t,presentation:{mode:"auto",styles:e.styles??Uo}},source:"automatic"};}function T(e,t=2){return String(e).padStart(t,"0");}function J(e,t,n){if(t==="en-US")return(n==="short"?Lo:Wo)[e-1];const r=new Date(Date.UTC(2e3,e-1,15));return new Intl.DateTimeFormat(t,{calendar:"gregory",month:n,timeZone:"UTC"}).format(r);}function Vo(e,t,n){return t.map(r=>{if(r.kind==="literal")return r.value;switch(r.value){case"YYYY":return T(e.year,4);case"YY":return T(e.year%100);case"MMMM":return J(e.month,n,"long");case"MMM":return J(e.month,n,"short");case"MM":return T(e.month);case"DD":return T(e.day);case"HH":return T(e.hour);case"hh":return T(e.hour%12||12);case"h":return String(e.hour%12||12);case"a":case"A":return En(n,e.hour);case"mm":return T(e.minute);case"ss":return T(e.second);}}).join("");}const Vt=/* @__PURE__ */new Map();function z(e,t){const n=`${e}:${JSON.stringify(t)}`,r=Vt.get(n);if(r)return r;const a=new Intl.DateTimeFormat(e,t);return Vt.set(n,a),a;}function ee(e){const t=/* @__PURE__ */new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(e.hour,e.minute,e.second,0),t;}function Bt(e,t,n){return z(t,{calendar:"gregory",dateStyle:n,timeZone:"UTC"}).format(ee(e));}function Bo(e,t,n){return z(t,{calendar:"gregory",dateStyle:n.dateStyle,timeStyle:n.timeStyle==="long"?"medium":n.timeStyle,timeZone:"UTC"}).format(ee(e));}function Go(e,t,n){var a;if(n==="short"){const i=ee(e),o=z(t,{calendar:"gregory",dateStyle:"short",timeZone:"UTC"}).formatToParts(i),s=o.findIndex(l=>l.type==="month"),c=o.findIndex(l=>l.type==="year"),u=(a=z(t,{calendar:"gregory",timeZone:"UTC",year:"numeric"}).formatToParts(i).find(l=>l.type==="year"))==null?void 0:a.value;if(s>=0&&c>=0&&u){const l=Math.min(s,c),f=Math.max(s,c);let m=!1;return o.slice(l,f+1).filter(d=>d.type==="day"?(m=!0,!1):m&&d.type==="literal"?(m=!1,!1):!0).map(d=>d.type==="year"?u:d.value).join("");}}return z(t,{calendar:"gregory",month:n==="short"?"numeric":n==="medium"?"short":"long",timeZone:"UTC",year:"numeric"}).format(ee(e));}function Wn(e,t){return Math.floor((e.month-t+12)%12/3)+1;}function Gt(e,t){return t===1||e.month<t?e.year:e.year+1;}function Hn(e){return e===1?"1st":e===2?"2nd":e===3?"3rd":`${e}th`;}function jn(e){return e==="short"||e==="long"||e==="numeric"||e==="iso";}function je(e,t,n){return t==="iso"?`${T(e.year,4)}-${T(e.month)}-${T(e.day)}`:z(n,{calendar:"gregory",month:t==="numeric"?"numeric":t==="long"?"long":"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(ee(e));}function Qo(e,t,n,r){const a=Wn(e,1);switch(r){case"week":return t==="numeric"||t==="iso"?je(e,t,n):`Week of ${je(e,t,n)}`;case"month":return t==="iso"?`${T(e.year,4)}-${T(e.month)}`:t==="numeric"?`${T(e.month)}/${T(e.year,4)}`:`${J(e.month,n,t==="long"?"long":"short")} ${e.year}`;case"quarter":return t==="iso"?`${T(e.year,4)}-Q${a}`:t==="long"?`${Hn(a)} Quarter ${e.year}`:`Q${a} ${e.year}`;case"year":return String(e.year);default:return je(e,t,n);}}function Je(e,t,n,r){if(jn(t))return Qo(e,t,n,r.granularity);const a=Ie(r)??1,i=Wn(e,a);switch(t){case"week_of_short":return`Week of ${J(e.month,n,"short")} ${e.day}, ${e.year}`;case"week_of_long":return`Week of ${J(e.month,n,"long")} ${e.day}, ${e.year}`;case"quarter_short":return`Q${i} ${e.year}`;case"quarter_long":return`${Hn(i)} Quarter ${e.year}`;case"fiscal_quarter_short":return`Q${i} FY${Gt(e,a)}`;case"fiscal_year":return`FY${Gt(e,a)}`;}}function Jo(e,t,n,r){const a=Ie(t);switch(t.granularity){case"second":case"minute":case"hour":return Bo(e,n,r.dateTime);case"day":return Bt(e,n,r.dateStyle);case"week":return`Week of ${Bt(e,n,r.dateStyle)}`;case"month":return Go(e,n,r.dateStyle);case"quarter":return Je(e,a?"fiscal_quarter_short":"quarter_short",n,t);case"year":return a?Je(e,"fiscal_year",n,t):String(e.year);}}function Mc(e,t){if(t.granularity!=="second"&&t.granularity!=="minute"&&t.granularity!=="hour"&&t.granularity!=="day"&&t.granularity!=="month")return;const n=oe(e,t);if(!n.ok||n.value===null)return;const{year:r,month:a,day:i,hour:o,minute:s,second:c}=n.value;return{year:r,month:a,day:i,hour:o,minute:s,second:c};}function lt(e){const t=Rn(e.format);if(!t.ok||!Un(t.value,e.metadata))throw new pe("invalid_temporal_bucket_format","Resolved temporal bucket format is invalid or inapplicable to its metadata.");const n=oe(e.value,e.metadata);if(!n.ok)throw new pe(n.error.code,n.error.message);if(n.value===null)return"(Blank)";const{presentation:r,locale:a}=t.value;if(r.mode==="auto")return Jo(n.value,e.metadata,a,r.styles);if(r.mode==="preset")return Je(n.value,r.preset,a,e.metadata);const i=ie(r.pattern,"grouped");if(!i.ok)throw new pe("invalid_temporal_bucket_format",i.message);return Vo(n.value,i.segments,a);}function es(e,t){var a;const n=e[e.length-1];if(!n)return"";if(n.member.kind==="others")return"Others";const r=n.member.value;return r===null?"(Blank)":((a=t==null?void 0:t.get(n.levelId))==null?void 0:a(r))??(typeof r=="object"?r.value:String(r));}function ts(e,t,n){return e==="grand_total"?n??"Grand Total":e==="subtotal"?(n==null?void 0:n.split(er).join(t))??`${t} Total`:t;}function kc(e,t,n,r){var o;const a=e[e.length-1],i=t==="grand_total"?n.grand.label:a?(o=n.levels[a.levelId])==null?void 0:o.label:void 0;return ts(t,es(e,r),i);}function _c(e,t,n){return e.kind==="value"?(t==null?void 0:t(e.value))??"":e.kind==="null"?n.nullText:n.emptyText;}function $c(e){const{path:t,previousPath:n,role:r,repeatLabels:a,levelCount:i}=e;return Array.from({length:i},(o,s)=>{const c=t.slice(0,s+1),u=r==="grand_total"?s===0:r==="subtotal"&&s===t.length-1,l=n&&n.length>s&&ht(n.slice(0,s+1))===ht(c);return{path:c,total:u,visible:u||t.length>s&&(a||!l||s===t.length-1)};});}function ns(e){return(e==null?void 0:e.type)==="date"?{type:"raw_temporal",timezone:e.timezone,sourceTimezone:e.sourceTimezone,presentation:So(e)}:void 0;}function rs(e,t){return Gi(st({override:e,model:t}).format,{preserveOmittedProperties:!0,numericInput:"canonical"});}function Nc(e,t,n){const r=/* @__PURE__ */new Map(),a=/* @__PURE__ */new Map(),i=(o,s)=>{const c=(s==="levels"?t.levelFormats:t.measureFormats)[o.id],u=o.semanticFormat,l=rs(c,u);s==="measures"&&r.set(o.id,{isNumeric:Jn(o.column.dataType)==="number",hasTextAffixes:!!l&&!!("prefix"in l&&l.prefix||"suffix"in l&&l.suffix)});const f=m=>Sn(m,void 0,{useFormattedValues:!0,timezone:n.calendar.tz,locale:n.valueFormat.locale,absence:t.absence});if(o.column.temporalBucket){const m=o.column.temporalBucket,d=Ln({metadata:m,cardFormat:(c==null?void 0:c.type)==="temporal_bucket"?c:void 0,semanticFormat:(u==null?void 0:u.type)==="temporal_bucket"?{granularity:m.granularity,format:u}:void 0,locale:n.valueFormat.locale,styles:{dateStyle:n.valueFormat.dateStyle,dateTime:n.valueFormat.dateTime}});return h=>typeof h=="string"?lt({value:h,metadata:m,format:d.format}):f(h);}if(o.column.rawTemporal){const m=st({override:c,model:u}).format,{formatValue:d}=Ro({authored:ns(m),metadata:o.column.rawTemporal,preferences:n.valueFormat,calendar:n.calendar});return h=>{if(typeof h!="string")return f(h);const S=d(h);return S.ok?S.text:f(h);};}if(ne(l)){const m=fo(l,n.valueFormat);return s==="measures"&&a.set(o.id,m),d=>typeof d=="number"||typeof d=="object"&&d!==null?rt(d,m):f(d);}return(l==null?void 0:l.type)==="duration"&&s==="measures"&&a.set(o.id,l),(l==null?void 0:l.type)==="duration"?m=>typeof m=="number"||typeof m=="string"||typeof m=="object"&&m!==null?on(typeof m=="object"?m.value:m,l):f(m):(l==null?void 0:l.type)==="string"?m=>m===null?f(m):`${l.prefix??""}${f(m)}${l.suffix??""}`:f;};return{levels:new Map(e.levels.map(o=>[o.id,i(o,"levels")])),measures:new Map(e.measures.map(o=>[o.id,i(o,"measures")])),measureSemantics:r,measureFormats:a,absence:t.absence};}function Ec(e,t){return t.levelLabels[e.id]??e.field.label??e.field.name;}function Oc(e,t){return t.measureLabels[e.id]??(e.kind==="aggregate"?e.field.label??e.field.name:e.definition.label);}function Ic(e){return ar.parse(as(e));}function as(e){const t=tr.parse(e),n=r=>({grand:{visible:!0,position:"after"},levels:Object.fromEntries(r.map(a=>[a.id,{visible:!0,position:"before"}]))});return nr.parse({version:1,spec:t,presentation:{layout:{kind:"compact"},absence:{emptyText:"—",nullText:""},levelLabels:{},measureLabels:{},levelFormats:{},measureFormats:{},totals:{rows:n(t.rows),columns:n(t.columns)}},defaultView:{rows:{depth:0,overrides:[]},columns:{depth:t.columns.length>1?1:0,overrides:[]}}});}function is(e,t){const n=new Map(e.map(r=>[B(r),r]));for(const r of t??[])n.set(B(r),r);return[...n.values()];}function Cc(e){const{spec:t,presentation:n,defaults:r,session:a}=rr.parse(e),i=new Map(is(t.sorts,a==null?void 0:a.sorts).map(s=>[B(s),s]));for(const s of["rows","columns"])for(const c of t[s]){const u={axis:s,levelId:c.id,scope:{kind:"level"},target:{kind:"member"},direction:"asc",nulls:"last"};i.has(B(u))||i.set(B(u),u);}const o=(s,c)=>({depth:Math.min(s.depth,Math.max(0,c-1)),overrides:s.overrides.filter(u=>u.path.length<c)});return{spec:{...t,sorts:[...i.values()]},presentation:n,view:{rows:o((a==null?void 0:a.rows)??r.rows,t.rows.length),columns:o((a==null?void 0:a.columns)??r.columns,t.columns.length),sorts:(a==null?void 0:a.sorts)??[]}};}class Qt extends Error{constructor(n){super(`invalid_presentation_execution_snapshot: ${n} Resave this report before running it again.`);_(this,"code","invalid_presentation_execution_snapshot");_(this,"deliveryBlocking",!0);this.name="PresentationExecutionSnapshotError";}}class Fc extends Error{constructor(n){super(`missing_resolved_raw_temporal_format: Column "${n}" has no captured presentation. Resave this report before running it again.`);_(this,"code","missing_resolved_raw_temporal_format");_(this,"deliveryBlocking",!0);this.name="MissingResolvedRawTemporalFormatError";}}function C(e,t,n){const r=new Set(t),a=Object.keys(e).find(i=>!r.has(i));if(a)throw new Error(`${n} contains unknown property "${a}"`);}function os(e,t="scope"){if(!v(e))throw new Error(`${t} must be an object`);C(e,["dashboardId","cardId","attachmentIndex"],t);const n=typeof e.dashboardId=="string"?e.dashboardId.trim():"";if(!n)throw new Error(`${t}.dashboardId is required`);const r=typeof e.cardId=="string"?e.cardId.trim():void 0;if(e.cardId!==void 0&&!r)throw new Error(`${t}.cardId must be a non-empty string`);const a=e.attachmentIndex;if(a!==void 0&&(typeof a!="number"||!Number.isInteger(a)||a<0))throw new Error(`${t}.attachmentIndex must be a non-negative integer`);return{dashboardId:n,...(r?{cardId:r}:{}),...(typeof a=="number"?{attachmentIndex:a}:{})};}function R(e,t,n,r){if(e.kind!==t)return;C(e,["kind",n],r);const a=e[n];if(typeof a!="string"||!a.trim())throw new Error(`${r}.${n} is required`);return a;}function qe(e,t){if(!v(e))throw new Error(`${t} must be an object`);const n=R(e,"metric","metricId",t);if(n)return{kind:"metric",metricId:n};const r=R(e,"column","columnKey",t);if(r)return{kind:"column",columnKey:r};const a=R(e,"matrix_measure","measureId",t);if(a)return{kind:"matrix_measure",measureId:a};throw new Error(`${t} is not a valid numeric presentation target`);}const ss=["type","inputUnit","outputStyle","largestUnit","smallestUnit","maxUnits","prefix","suffix","negativeStyle"];function cs(e){return e==="millisecond"||e==="second"||e==="minute"||e==="hour"||e==="day";}const us=["type","locale","pattern","timezone","sourceTimezone"];function ls(e,t){if(C(e,us,t),typeof e.locale!="string"||!e.locale.trim())throw new Error(`${t}.locale must be a non-empty string`);for(const n of["pattern","timezone","sourceTimezone"])if(e[n]!==void 0&&typeof e[n]!="string")throw new Error(`${t}.${n} must be a string`);return{type:"date",locale:e.locale,...(typeof e.pattern=="string"?{pattern:e.pattern}:{}),...(typeof e.timezone=="string"?{timezone:e.timezone}:{}),...(typeof e.sourceTimezone=="string"?{sourceTimezone:e.sourceTimezone}:{})};}function ms(e,t){C(e,ss,t);for(const i of["inputUnit","largestUnit","smallestUnit"])if(e[i]!==void 0&&!cs(e[i]))throw new Error(`${t}.${i} must be a duration unit`);const n=e.outputStyle;if(n!==void 0&&n!=="compact"&&n!=="digital"&&n!=="long")throw new Error(`${t}.outputStyle must be compact, digital, or long`);const r=e.maxUnits;if(r!==void 0&&(typeof r!="number"||!Number.isInteger(r)||r<0||r>10))throw new Error(`${t}.maxUnits must be an integer from 0 to 10`);for(const i of["prefix","suffix"])if(e[i]!==void 0&&typeof e[i]!="string")throw new Error(`${t}.${i} must be a string`);const a=e.negativeStyle;if(a!==void 0&&a!=="minus"&&a!=="parentheses")throw new Error(`${t}.negativeStyle must be minus or parentheses`);return{type:"duration",...(e.inputUnit!==void 0?{inputUnit:e.inputUnit}:{}),...(n!==void 0?{outputStyle:n}:{}),...(e.largestUnit!==void 0?{largestUnit:e.largestUnit}:{}),...(e.smallestUnit!==void 0?{smallestUnit:e.smallestUnit}:{}),...(r!==void 0?{maxUnits:r}:{}),...(e.prefix!==void 0?{prefix:e.prefix}:{}),...(e.suffix!==void 0?{suffix:e.suffix}:{}),...(a!==void 0?{negativeStyle:a}:{})};}function fs(e,t){if(!v(e))throw new Error(`${t} must be an object`);if(e.kind==="field"){C(e,["kind","fieldId","role"],t);const a=typeof e.fieldId=="string"?e.fieldId.trim():"";if(!a)throw new Error(`${t}.fieldId is required`);const i=e.role;if(i!==void 0&&i!=="groupby"&&i!=="pivotby")throw new Error(`${t}.role must be groupby or pivotby`);return{kind:"field",fieldId:a,...(i?{role:i}:{})};}const n=R(e,"column","columnKey",t);if(n)return{kind:"column",columnKey:n};const r=R(e,"matrix_axis","axisInstanceId",t);if(r)return{kind:"matrix_axis",axisInstanceId:r};throw new Error(`${t} is not a valid temporal bucket presentation target`);}function ds(e,t){if(!v(e))throw new Error(`${t} must be an object`);const n=R(e,"column","columnKey",t);if(!n)throw new Error(`${t} must identify a column`);return{kind:"column",columnKey:n};}function hs(e){return[e.dashboardId,e.cardId??null,e.attachmentIndex??null];}function Ee(e){switch(e.kind){case"metric":return[e.kind,e.metricId];case"column":return[e.kind,e.columnKey];case"matrix_measure":return[e.kind,e.measureId];case"field":return[e.kind,e.fieldId,e.role??""];case"matrix_axis":return[e.kind,e.axisInstanceId];}}function W(e,t){return e.dashboardId===t.dashboardId&&e.cardId===t.cardId&&e.attachmentIndex===t.attachmentIndex;}function H(e,t){const n=Ee(e),r=Ee(t);return n.length===r.length&&n.every((a,i)=>a===r[i]);}function gs(e){if(!Array.isArray(e))throw new Error("resolvedFormats must be an array");const t=/* @__PURE__ */new Set();return e.map((n,r)=>{var c,u;const a=`resolvedFormats.${r}`;if(!v(n))throw new Error(`${a} must be an object`);C(n,["scope","target","format"],a);const i=os(n.scope,`${a}.scope`);if(!v(n.format))throw new Error(`${a}.format must be an object`);let o;switch(n.format.type){case"temporal_bucket":{const l=Rn(n.format);if(!l.ok)throw new Error(`${a}.format is invalid: ${((c=l.issues[0])==null?void 0:c.message)??"invalid value"}`);o={scope:i,target:fs(n.target,`${a}.target`),format:l.value};break;}case"raw_temporal":o={scope:i,target:ds(n.target,`${a}.target`),format:ct(n.format)};break;case"number":case"currency":case"percent":case"scientific":{const l=uo(n.format);if(!l.ok)throw new Error(`${a}.format is invalid: ${((u=l.issues[0])==null?void 0:u.message)??"invalid value"}`);o={scope:i,target:qe(n.target,`${a}.target`),format:l.value};break;}case"date":{const l=qe(n.target,`${a}.target`);if(l.kind!=="column")throw new Error(`${a}.target must identify a column for a date format`);o={scope:i,target:l,format:ls(n.format,`${a}.format`)};break;}case"duration":o={scope:i,target:qe(n.target,`${a}.target`),format:ms(n.format,`${a}.format`)};break;default:throw new Error(`${a}.format.type is unsupported`);}const s=JSON.stringify([...hs(o.scope),...Ee(o.target)]);if(t.has(s))throw new Error(`${a} duplicates a scoped presentation target`);return t.add(s),o;});}function ys(e){try{if(!v(e))throw new Error("presentation execution snapshot must be an object");if(C(e,["version","reportContext","resolvedFormats"],"presentation execution snapshot"),e.version!==1)throw new Error("presentation execution snapshot version must be 1");const t=or(e.reportContext);if(!t.ok){const n=t.issues[0];throw new Error(`presentation execution snapshot reportContext is invalid: ${n!=null&&n.path&&n.path!=="$"?`${n.path}: `:""}${(n==null?void 0:n.message)??"invalid value"}`);}return{version:1,reportContext:t.value,resolvedFormats:gs(e.resolvedFormats)};}catch(t){throw t instanceof Qt?t:new Qt(t instanceof Error?t.message:"Snapshot is invalid.");}}function ws(e){return ys({version:1,reportContext:e.reportContext,resolvedFormats:[...e.resolvedFormats]});}function Pc(e,t){const n=t.filter((r,a)=>!e.resolvedFormats.some(i=>W(i.scope,r.scope)&&H(i.target,r.target))&&t.findIndex(i=>W(i.scope,r.scope)&&H(i.target,r.target))===a);return n.length===0?e:ws({reportContext:e.reportContext,resolvedFormats:[...e.resolvedFormats,...n]});}function Yc(e){const t=ps(e);return ne(t)?t:void 0;}function ps(e){const t=e.snapshot.resolvedFormats.find(n=>n.format.type!=="temporal_bucket"&&n.format.type!=="raw_temporal"&&n.format.type!=="date"&&W(n.scope,e.scope)&&H(n.target,e.target));return t==null?void 0:t.format;}function Ac(e){const t=e.snapshot.resolvedFormats.find(n=>n.format.type==="date"&&W(n.scope,e.scope)&&H(n.target,e.target));return t==null?void 0:t.format;}function zc(e){const t=e.snapshot.resolvedFormats.find(n=>n.format.type==="raw_temporal"&&W(n.scope,e.scope)&&H(n.target,e.target));return t==null?void 0:t.format;}function Rc(e){const t=e.snapshot.resolvedFormats.find(n=>n.format.type==="temporal_bucket"&&W(n.scope,e.scope)&&H(n.target,e.target));return t==null?void 0:t.format;}function Uc(e){var a;const t=/* @__PURE__ */new Set(),n=/* @__PURE__ */new Set();if(e.snapshot.resolvedFormats.forEach((i,o)=>{if(i.scope.attachmentIndex!==void 0)throw new Error(`resolvedFormats.${o}.scope.attachmentIndex is not valid for a card export`);if(i.scope.dashboardId!==e.expectedScope.dashboardId||i.scope.cardId!==e.expectedScope.cardId)throw new Error(`resolvedFormats.${o}.scope must match the executing dashboard/card`);if(i.target.kind==="field"&&i.format.type==="temporal_bucket"){const s=JSON.stringify(Ee(i.target));if(n.has(s))throw new Error(`resolvedFormats.${o} duplicates export field "${i.target.fieldId}"`);n.add(s);return;}if(i.target.kind!=="column")throw new Error(`resolvedFormats.${o}.target must identify an export column or temporal pivot field`);if(t.has(i.target.columnKey))throw new Error(`resolvedFormats.${o} duplicates export column "${i.target.columnKey}"`);t.add(i.target.columnKey);}),!e.useFormattedValues)return;if(!((a=e.visibleColumns)!=null&&a.length))throw new Error("visibleColumns must identify every formatted export column");const r=e.visibleColumns.find(i=>!t.has(i));if(r)throw new Error(`resolvedFormats is missing visible export column "${r}"`);}const Ts=/* @__PURE__ */new Set(["short","medium","long"]),vs=/^(\d{4})-(\d{2})-(\d{2})$/,bs=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/,xs=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/,mt=" – ";function Lc(e){if(!v(e))return;const t=Object.keys(e);if(e.mode==="period_label"&&t.length===1)return{mode:"period_label"};if(e.mode==="style"&&t.length===2&&typeof e.dateStyle=="string"&&Ts.has(e.dateStyle))return{mode:"style",dateStyle:e.dateStyle};if(e.mode==="pattern"&&t.length===3&&e.dialect==="semaphor_tokens"&&typeof e.pattern=="string"&&Ds(e.pattern)===null)return{mode:"pattern",dialect:"semaphor_tokens",pattern:e.pattern};}function Ds(e){try{return Co({dialect:"semaphor_tokens",pattern:e}),null;}catch(t){return t instanceof Error?t.message:"The pattern is invalid.";}}function Wc(e){const{value:t,part:n,presentation:r,preferences:a,calendar:i}=e;if((r==null?void 0:r.mode)==="period_label"&&t.periodLabel&&n==="range")return{ok:!0,text:t.periodLabel};const[o,s]=t.bounds,u=s===void 0||n==="start"?[{raw:o,role:"start"}]:n==="end"?[{raw:s,role:"end"}]:[{raw:o,role:"start"},{raw:s,role:"end"}],l=u.map(({raw:h})=>_s(h,i.tz));if(l.some(h=>h===null))return{ok:!1,text:u.map(({raw:h})=>h).join(mt),diagnostic:{code:"invalid_temporal_input_value",message:"A date input bound is not a date or an instant."}};const f=t.precision==="day"?l.map((h,S)=>Ns(h,u[S].role,i.tz)):[],m=f.length>0&&f.every(h=>h!==null)?f:null;return{ok:!0,text:m?Ss(m,r,a,i):Ms(l.map(h=>$s(h,i.tz)),r,a,i)};}function Ss(e,t,n,r){const[a,i=a]=e;if((t==null?void 0:t.mode)==="pattern")return Xn(e.map(c=>Zn(et(c),"date",t.pattern,n,r)));const o=(t==null?void 0:t.mode)==="style"?t.dateStyle:n.dateStyle;if(!t||t.mode==="period_label"){const c=Es(a,i,r);if(c)return lt({value:et(a),metadata:{kind:"temporal_bucket",granularity:c,calendar:{tz:r.tz,weekStart:r.weekStart??1}},format:Ln({metadata:{kind:"temporal_bucket",granularity:c,calendar:{tz:r.tz,weekStart:r.weekStart??1}},locale:n.locale,styles:{dateStyle:o,dateTime:{...n.dateTime}}}).format});}const s=new Intl.DateTimeFormat(n.locale,{calendar:"gregory",timeZone:"UTC",dateStyle:o});return Is(a,i)?s.format(Te(a)):qn(s,Te(a),Te(i));}function Ms(e,t,n,r){if((t==null?void 0:t.mode)==="pattern")return Xn(e.map(s=>Zn(s.toISOString(),"instant",t.pattern,n,r)));const a=new Intl.DateTimeFormat(n.locale,{calendar:"gregory",timeZone:r.tz,dateStyle:(t==null?void 0:t.mode)==="style"?t.dateStyle:n.dateTime.dateStyle,timeStyle:n.dateTime.timeStyle}),[i,o]=e;return o&&o.getTime()!==i.getTime()?qn(a,i,o):a.format(i);}function qn(e,t,n){const r=e;return typeof r.formatRange=="function"?r.formatRange(t,n):`${e.format(t)}${mt}${e.format(n)}`;}function Zn(e,t,n,r,a){const i=Cn({format:{type:"raw_temporal",presentation:{mode:"pattern",dialect:"semaphor_tokens",pattern:n}},preferences:{...r,defaultCurrency:sr.defaultCurrency},calendar:{tz:a.tz}}),o=t==="date"&&ks(n)?"instant":t;return zo({value:o===t?e:ae(`${e}T00:00:00`,a.tz).toISOString(),metadata:{kind:"raw_temporal",valueKind:o},format:i}).text;}function ks(e){return /HH|mm|ss/.test(e);}function Xn(e){return e[1]===void 0||e[0]===e[1]?e[0]:e.join(mt);}function _s(e,t){const n=vs.exec(e);if(n){const a={year:Number(n[1]),month:Number(n[2]),day:Number(n[3])};return Cs(a)?{kind:"date",date:a}:null;}const r=xs.test(e)?new Date(e.replace(" ","T")):bs.test(e)?ae(e.replace(" ","T"),t):null;return r&&!Number.isNaN(r.getTime())?{kind:"instant",instant:r}:null;}function $s(e,t){return e.kind==="instant"?e.instant:ae(`${et(e.date)}T00:00:00`,t);}function Ns(e,t,n){if(e.kind==="date")return e.date;const r=fr(e.instant,n),a={year:r.year,month:r.month,day:r.day};if(r.hour===0&&r.minute===0&&r.second===0&&e.instant.getUTCMilliseconds()===0)return t==="start"?a:Os(a,-1);const o=r.hour===23&&r.minute===59&&r.second===59;return t==="end"&&o?a:null;}function Es(e,t,n){return n.fiscalCalendar||e.day!==1||e.year!==t.year||t.day!==Kn(t.year,t.month)?null:e.month===t.month?"month":e.month%3===1&&t.month===e.month+2?"quarter":e.month===1&&t.month===12?"year":null;}function et(e){return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`;}function Te(e){const t=/* @__PURE__ */new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(0,0,0,0),t;}function Os(e,t){const n=Te(e);return n.setUTCDate(n.getUTCDate()+t),{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()};}function Is(e,t){return e.year===t.year&&e.month===t.month&&e.day===t.day;}function Kn(e,t){return new Date(Date.UTC(e,t,0)).getUTCDate();}function Cs(e){return e.year>=1&&e.month>=1&&e.month<=12&&e.day>=1&&e.day<=Kn(e.year,e.month);}class Fs extends Error{constructor(n,r){super(`${n}: ${r}`);_(this,"deliveryBlocking",!0);this.code=n,this.name="PivotHeaderPresentationError";}}function Hc(e){var a;const t=e.mode??"formatted",n=e.members.map(i=>{var s;if(t==="canonical"||!i.temporalBucket)return i.value===null?"":String(i.value);const o=(s=e.resolveTemporalFormat)==null?void 0:s.call(e,i.fieldId);if(!o)throw new Fs("missing_resolved_temporal_format",`Missing resolved temporal presentation for pivot field "${i.fieldId}"`);return lt({value:i.value,metadata:i.temporalBucket,format:o});}),r=((a=e.metricLabel)==null?void 0:a.trim())||void 0;return{memberLabels:n,...(r?{metricLabel:r}:{}),flattenedLabel:[...n,...(r?[r]:[])].join(" / ")};}const M=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function Jt(e){return e?e.period?e.period:e.unit&&e.count?`${e.unit}s`:e.days<=1?"day":"days":"period";}function Ps(e,t){return t!=null&&t.period?e===1?`Previous ${t.period}`:`${M(e,t.period)} back`:t!=null&&t.unit&&t.count?e===1?`Previous ${M(t.count,t.unit)}`:`${M(e,"period")} back`:t&&t.days<=1?e===1?"Previous day":`${M(e,"day")} back`:t?e===1?`Previous ${t.days} days`:`${M(e,"period")} back`:e===1?"Previous period":`${M(e,"period")} back`;}function he(e){return e.charAt(0).toLowerCase()+e.slice(1);}function Ys(e){return e.period?`a ${e.period}`:e.unit&&e.count?M(e.count,e.unit):e.days<=1?"a day":M(e.days,"day");}function jc(e,t){const n=tt(e,t).label,r=dr(t).map(a=>`"${tt(a,t).label}"`);return{message:`"${n}" lands inside the window it compares (${Ys(t)}), so it shows no comparison there.`,fix:`Pick a step that clears the window: ${r.join(", ")}.`};}function tt(e,t){const n=hr(e);if(n.kind==="target")return{label:`Target · ${n.targetValue.toLocaleString("en-US")}`,sentence:`a target of ${n.targetValue.toLocaleString("en-US")}`};const r=n.offset??1,a=n.matchWeekdays?", matching weekdays":"";if(n.unit==="period"){const o=Ps(r,t);return{label:o,sentence:r===1?`the ${he(o)}`:he(o)};}if(n.unit==="day"){const o=r===1?"The day before":`${M(r,"day")} back`;return{label:o,sentence:he(o)};}const i=r===1?`Same ${Jt(t)} last ${n.unit}${a}`:`Same ${Jt(t)} ${M(r,n.unit)} back${a}`;return{label:i,sentence:`the ${he(i)}`};}function As(e){return(e==null?void 0:e.kind)==="field_date"?`the ${JSON.stringify(e.label)} filter`:"the dashboard date";}function qc(e,t){const n=t.source==="explicit"?"set on the measure":`from the dashboard date comparison on ${As(t.owner)}`;return`${e} is compared with ${tt(t.spec).sentence} (${n})`;}function Zc(e){const t=/* @__PURE__ */new Map();return e.forEach(n=>{n.id&&t.set(n.id,(t.get(n.id)??0)+1);}),e.flatMap(n=>n.id&&(t.get(n.id)??0)>1?[gr(n)]:[]);}export{os as $,ac as A,oc as B,sc as C,Mn as D,cc as E,Ri as F,uc as G,Ui as H,lc as I,_e as J,A as K,mc as L,ic as M,fc as N,ji as O,qi as P,dc as Q,Zi as R,hc as S,Nc as T,co as U,uo as V,yc as W,lo as X,fo as Y,Qt as Z,Fc as _,Bs as a,w as a$,gs as a0,ys as a1,ws as a2,Pc as a3,Yc as a4,Ac as a5,zc as a6,Rc as a7,Uc as a8,qt as a9,zo as aA,Ro as aB,Lc as aC,Ds as aD,Wc as aE,Fs as aF,Hc as aG,Zc as aH,qc as aI,Vs as aJ,es as aK,kc as aL,$c as aM,_c as aN,Ec as aO,Dn as aP,Js as aQ,Cc as aR,jc as aS,Oc as aT,Ic as aU,as as aV,is as aW,at as aX,q as aY,wn as aZ,ge as a_,ho as aa,wo as ab,ie as ac,Nn as ad,wc as ae,Uo as af,pe as ag,oe as ah,bc as ai,xc as aj,Dc as ak,Sc as al,Rn as am,Ln as an,Mc as ao,lt as ap,So as aq,L as ar,ct as as,Cn as at,pc as au,Tc as av,Eo as aw,vc as ax,Co as ay,zn as az,Gi as b,Rr as b0,Se as b1,bt as b2,ue as b3,Qs as b4,hn as b5,Pr as b6,ja as b7,Xi as b8,Nr as b9,rs as ba,Lt as bb,O as bc,Ut as bd,zt as be,ns as bf,ae as bg,ts as bh,Ks as c,tt as d,nt as e,ps as f,ln as g,mn as h,ne as i,fn as j,rt as k,Er as l,Gs as m,on as n,sn as o,st as p,Yi as q,ro as r,Ai as s,rc as t,ec as u,tc as v,gc as w,nc as x,ot as y,Sn as z};
|
|
@@ -0,0 +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"./metric-comparison-DEZYXROZ.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};
|
|
@@ -0,0 +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-CqV3Yka1.js";import{R as Wc}from"./analytics-base-schemas-BREc5WGv.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
|
+
const m=1280,r={minCssWidth:320,minCssHeight:120,maxCardCssWidth:4096,maxCardCssHeight:4096,maxSheetCssWidth:4096,maxDevicePixels:16384},f=1024,n={fit:"imageFit",width:"imageWidth",height:"imageHeight"};function c(t,e){if(t instanceof URLSearchParams)return t.get(e)??void 0;const i=t[e];return typeof i=="string"?i:void 0;}function u(t){if(!(t===void 0||!/^\d{1,6}$/.test(t.trim())))return Number(t.trim());}function o(t,e,i){return Math.min(Math.max(t,e),i);}function g(t){const{minCssWidth:e,minCssHeight:i,maxCardCssWidth:s,maxCardCssHeight:a}=r;return{cssWidth:o(Math.round(t.cssWidth),e,s),cssHeight:o(Math.round(t.cssHeight),i,a)};}function l(t){return o(Math.round(t),r.minCssWidth,r.maxSheetCssWidth);}function p(t){const e=c(t,n.fit),i=u(c(t,n.width)),s=c(t,n.height),a=u(s);if(i===void 0)return null;switch(e){case"card":return a===void 0?null:{fit:"card",...g({cssWidth:i,cssHeight:a})};case"layout":return s!==void 0?null:{fit:"layout",dashboardWidth:l(i)};case"sheet":return s!==void 0?null:{fit:"sheet",cssWidth:l(i)};default:return null;}}function W(t,e){switch(e.set(n.fit,t.fit),e.delete(n.height),t.fit){case"card":e.set(n.width,String(t.cssWidth)),e.set(n.height,String(t.cssHeight));return;case"layout":e.set(n.width,String(t.dashboardWidth));return;case"sheet":e.set(n.width,String(t.cssWidth));}}function d(t,e){const i=r.maxDevicePixels;return t*2<=i&&e*2<=i?{status:"ready",viewport:{width:t,height:e,deviceScaleFactor:2}}:t<=i&&e<=i?{status:"ready",viewport:{width:t,height:e,deviceScaleFactor:1}}:{status:"too_large",cssWidth:t,cssHeight:e};}function x(t,e){switch(t.fit){case"card":return d(t.cssWidth,t.cssHeight);case"layout":return d(t.dashboardWidth,f);case"sheet":{if(e===void 0||!Number.isFinite(e))throw new Error("A sheet image needs the measured sheet height.");const i=Math.max(Math.ceil(e),r.minCssHeight);return d(t.cssWidth,i);}}}const I=["pdf","png","zip"],h={pdf:Object.freeze({kind:"pdf",extension:"pdf",contentType:"application/pdf",label:"PDF"}),png:Object.freeze({kind:"png",extension:"png",contentType:"image/png",label:"PNG image"}),zip:Object.freeze({kind:"zip",extension:"zip",contentType:"application/zip",label:"PNG images (zip)"})};function S(t){return{...h[t]};}function C(t){var i;return`${(i=t.title)!=null&&i.trim()?t.title:"Report"}-${t.at.toISOString()}.${h[t.kind].extension}`;}function H(t){const e=(t.title??"").replace(/[\\/:*?"<>|\u0000-\u001f]+/g,"_").replace(/\s+/g," ").trim().slice(0,120)||"Sheet";return`${String(t.position).padStart(2,"0")} ${e}.${h.png.extension}`;}export{m as E,r as I,I as R,x as a,C as b,g as c,p,S as r,H as s,W as w};
|