react-semaphor 0.1.514 → 0.1.516
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/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +226 -225
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +8 -8
- package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
- package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
- package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
- package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
- package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
- package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
- package/dist/chunks/{dashboard-briefing-launcher-e3s3MuSs.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
- package/dist/chunks/{dashboard-briefing-launcher-BzPD50QD.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-DAOABnks.js → dashboard-controls-DFfit5KH.js} +12 -12
- package/dist/chunks/{dashboard-controls-DQBfOqmC.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
- package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
- package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
- package/dist/chunks/{dashboard-json-S5Eq2GAg.js → dashboard-json-DVtcA02f.js} +7 -7
- package/dist/chunks/{dashboard-json-1jZycd5h.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-Bkm0ciHG.js → edit-dashboard-visual-lJ6rDH3w.js} +4553 -4542
- package/dist/chunks/{editor-action-buttons-Bvv16QA-.js → editor-action-buttons-Bnxxa439.js} +7 -7
- package/dist/chunks/{editor-action-buttons-B2NCSsDw.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
- package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
- package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
- package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
- package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
- package/dist/chunks/{index-nhUr9xBz.js → index-BVVl2JDK.js} +57955 -54696
- package/dist/chunks/{index-CACdoqu3.js → index-C8w91oj4.js} +61 -51
- package/dist/chunks/index-Cw2ypaFl.cjs +1 -0
- package/dist/chunks/index-DfqMtR9S.cjs +4 -0
- package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
- package/dist/chunks/{index-CnGVjyF8.js → index-ylOpKRDu.js} +877 -849
- package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
- package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
- package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
- package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
- package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
- package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
- package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
- package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
- package/dist/chunks/matrix-formatter-CCXNRt3s.js +341 -0
- package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
- package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
- package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
- package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
- package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
- package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
- package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
- package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
- package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
- package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
- package/dist/chunks/pivot-result-lifecycle-gl9cBfB-.cjs +1 -0
- package/dist/chunks/{pivot-result-lifecycle-BeOpjAhg.js → pivot-result-lifecycle-kRhiJkzg.js} +208 -149
- package/dist/chunks/{raw-temporal-DrmCX9Wq.js → raw-temporal-BqOfk-xN.js} +471 -361
- package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
- package/dist/chunks/raw-temporal-eJXecCyJ.cjs +1 -0
- package/dist/chunks/{report-preferences-dialog-B2fzQH1T.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-DcLkVqni.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
- package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
- package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
- package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
- package/dist/chunks/{semantic-format-BZxJLKvw.js → semantic-format-DwqGYx4V.js} +25 -31
- package/dist/chunks/semantic-format-mVI32OJH.cjs +1 -0
- package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
- package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
- package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
- package/dist/chunks/{switch-QfKb0Iwe.js → switch-DNv-hVmt.js} +8260 -7659
- package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
- package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
- package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
- package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
- package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
- package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
- package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +233 -227
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +291 -397
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/pdf-table-layout/index.cjs +1 -0
- package/dist/pdf-table-layout/index.js +993 -0
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
- package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
- package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
- package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
- package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
- package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
- package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
- package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
- package/dist/types/components/document-sheet/document-page.d.ts +9 -5
- package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
- package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
- package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
- package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
- package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
- package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
- package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
- package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
- package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
- package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
- package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
- package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
- package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
- package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
- package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
- package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
- package/dist/types/components/visual/aggregated-table/utils/metric-format-resolver.d.ts +3 -3
- package/dist/types/components/visual/data-table/types/data-table.d.ts +4 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-metric-formatting.d.ts +2 -2
- package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
- package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
- package/dist/types/lib/document/document-edits.d.ts +119 -0
- package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
- package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
- package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
- package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
- package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
- package/dist/types/lib/document/document-pagination.d.ts +56 -3
- package/dist/types/lib/document/document-panel-target.d.ts +19 -0
- package/dist/types/lib/document/document-section-editor.d.ts +8 -7
- package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
- package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
- package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
- package/dist/types/lib/document/document-section-utils.d.ts +11 -4
- package/dist/types/lib/document/document-table-dom.d.ts +4 -6
- package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
- package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
- package/dist/types/lib/document/document-table-style.d.ts +15 -4
- package/dist/types/lib/document/document-table-surface.d.ts +15 -0
- package/dist/types/lib/document/document-variables.d.ts +40 -6
- package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
- package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
- package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
- package/dist/types/lib/formatters/metric-formatting.d.ts +3 -3
- package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
- package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
- package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
- package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
- package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
- package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
- package/dist/types/lib/query-context/card-execution.d.ts +30 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
- package/dist/types/lib/stores/editor-store.d.ts +2 -0
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +1 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
- package/dist/types/lib/types/common-types.d.ts +34 -1
- package/dist/types/lib/utils/card-definition.d.ts +2 -0
- package/dist/types/lib/utils/card-utils.d.ts +13 -6
- package/dist/types/lib/utils/date-timezone-utils.d.ts +26 -4
- package/dist/types/pdf-table-layout.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
- package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
- package/dist/types/shared/format-utils/formatters/duration-formatter.d.ts +4 -1
- package/dist/types/shared/format-utils/formatters/index.d.ts +2 -2
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +8 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
- package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
- package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
- package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
- package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
- package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
- package/dist/types/shared/format-utils/presentation-execution.d.ts +17 -2
- package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +16 -1
- package/package.json +6 -1
- package/dist/chunks/edit-dashboard-visual-BwJ2Eljw.cjs +0 -172
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
- package/dist/chunks/index-DhlVxvyI.cjs +0 -4
- package/dist/chunks/index-DrOFJOCq.cjs +0 -1424
- package/dist/chunks/index-F25jnH0p.cjs +0 -1
- package/dist/chunks/matrix-formatter-BLunke3R.js +0 -424
- package/dist/chunks/matrix-formatter-CveLJo6S.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-Cxz8-06f.cjs +0 -5
- package/dist/chunks/pivot-header-presentation-Dm9dUQsl.js +0 -415
- package/dist/chunks/pivot-result-lifecycle-BiERyXnS.cjs +0 -1
- package/dist/chunks/raw-temporal-BUeTpG76.cjs +0 -1
- package/dist/chunks/semantic-format-BzH69TRq.cjs +0 -1
- package/dist/chunks/switch--Re1K566.cjs +0 -134
- package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function F(e,t){const n=b(t);return"formatToParts"in n?$(n,e):A(n,e)}const _={year:0,month:1,day:2,hour:3,minute:4,second:5};function $(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const a=_[n[i].type];a!==void 0&&(r[a]=parseInt(n[i].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function A(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 f={},I=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(new Date("2014-06-25T04:00:00.123Z")),S=I==="06/25/2014, 00:00:00"||I==="06/25/2014 00:00:00";function b(e){return f[e]||(f[e]=S?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"})),f[e]}function T(e,t,n,r,i,a,o){const u=new Date(0);return u.setUTCFullYear(e,t,n),u.setUTCHours(r,i,a,o),u}const w=36e5,L=6e4,D={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Y(e,t,n){if(!e)return 0;let r=D.timezoneZ.exec(e);if(r)return 0;let i,a;if(r=D.timezoneHH.exec(e),r)return i=parseInt(r[1],10),g(i)?-(i*w):NaN;if(r=D.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const o=parseInt(r[3],10);return g(i,o)?(a=Math.abs(i)*w+o*L,r[1]==="+"?-a:a):NaN}if(E(e)){t=new Date(t||Date.now());const o=n?t:Z(t),u=m(o,e);return-(n?u:z(t,u,e))}return NaN}function Z(e){return T(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function m(e,t){const n=F(e,t),r=T(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let i=e.getTime();const a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function z(e,t,n){let i=e.getTime()-t;const a=m(new Date(i),n);if(t===a)return t;i-=a-t;const o=m(new Date(i),n);return a===o?a:Math.max(a,o)}function g(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const M={};function E(e){if(M[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),M[e]=!0,!0}catch{return!1}}function h(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 U=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,N=36e5,H=6e4,P=2,s={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:U};function p(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?P: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 new Date(NaN);const r=W(e),{year:i,restDateString:a}=k(r.date,n),o=v(a,i);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const u=o.getTime();let c=0,l;if(r.time&&(c=j(r.time),c===null||isNaN(c)))return new Date(NaN);if(r.timeZone||t.timeZone){if(l=Y(r.timeZone||t.timeZone,new Date(u+c)),isNaN(l))return new Date(NaN)}else l=h(new Date(u+c)),l=h(new Date(u+c+l));return new Date(u+c+l)}else return new Date(NaN)}function W(e){const t={};let n=s.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=s.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=s.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function k(e,t){if(e){const n=s.YYY[t],r=s.YYYYY[t];let i=s.YYYY.exec(e)||r.exec(e);if(i){const a=i[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(i=s.YY.exec(e)||n.exec(e),i){const a=i[1];return{year:parseInt(a,10)*100,restDateString:e.slice(a.length)}}}return{year:null}}function v(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=s.MM.exec(e);if(a)return n=new Date(0),r=parseInt(a[1],10)-1,C(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(a=s.DDD.exec(e),a){n=new Date(0);const o=parseInt(a[1],10);return q(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(a=s.MMDD.exec(e),a){n=new Date(0),r=parseInt(a[1],10)-1;const o=parseInt(a[2],10);return C(t,r,o)?(n.setUTCFullYear(t,r,o),n):new Date(NaN)}if(a=s.Www.exec(e),a)return i=parseInt(a[1],10)-1,O(i)?x(t,i):new Date(NaN);if(a=s.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const o=parseInt(a[2],10)-1;return O(i,o)?x(t,i,o):new Date(NaN)}return null}function j(e){let t,n,r=s.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),d(t)?t%24*N:NaN;if(r=s.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),d(t,n)?t%24*N+n*H:NaN;if(r=s.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return d(t,n,i)?t%24*N+n*H+i*1e3:NaN}return null}function x(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,a=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}const R=[31,28,31,30,31,30,31,31,30,31,30,31],G=[31,29,31,30,31,30,31,31,30,31,30,31];function y(e){return e%400===0||e%4===0&&e%100!==0}function C(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=y(e);if(r&&n>G[t]||!r&&n>R[t])return!1}return!0}function q(e,t){if(t<1)return!1;const n=y(e);return!(n&&t>366||!n&&t>365)}function O(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function d(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}function J(e,t,n){if(typeof e=="string"&&!e.match(U))return p(e,{...n,timeZone:t});e=p(e,n);const r=T(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=Y(t,new Date(r));return new Date(r+i)}exports.fromZonedTime=J;exports.toDate=p;exports.tzParseTimezone=Y;
|
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { b4 as L, S as T, ak as _ } from "./validators-CkHsAvwB.js";
|
|
2
|
-
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
3
|
-
import { t as d, c as P, g as $, e as C, a as x, b as O, d as A, f as Z, i as k } from "./semantic-format-BZxJLKvw.js";
|
|
4
|
-
import { f as R, s as U, k as z, j as V, b as X } from "./raw-temporal-DrmCX9Wq.js";
|
|
5
|
-
import { b as p, c as M } from "./constants-DeLIHVAW.js";
|
|
6
|
-
import { f as j } from "./index-CACdoqu3.js";
|
|
7
|
-
import { d as E, f as Y } from "./temporal-bucket-B9hMwemw.js";
|
|
8
|
-
const N = [
|
|
9
|
-
"day",
|
|
10
|
-
"hour",
|
|
11
|
-
"minute",
|
|
12
|
-
"second",
|
|
13
|
-
"millisecond"
|
|
14
|
-
], b = {
|
|
15
|
-
day: 864e5,
|
|
16
|
-
hour: 36e5,
|
|
17
|
-
minute: 6e4,
|
|
18
|
-
second: 1e3,
|
|
19
|
-
millisecond: 1
|
|
20
|
-
}, B = {
|
|
21
|
-
day: "d",
|
|
22
|
-
hour: "hr",
|
|
23
|
-
minute: "min",
|
|
24
|
-
second: "s",
|
|
25
|
-
millisecond: "ms"
|
|
26
|
-
}, q = {
|
|
27
|
-
day: ["day", "days"],
|
|
28
|
-
hour: ["hour", "hours"],
|
|
29
|
-
minute: ["minute", "minutes"],
|
|
30
|
-
second: ["second", "seconds"],
|
|
31
|
-
millisecond: ["millisecond", "milliseconds"]
|
|
32
|
-
};
|
|
33
|
-
function H(e) {
|
|
34
|
-
return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
|
|
35
|
-
}
|
|
36
|
-
function v(e, t) {
|
|
37
|
-
return H(e) ? e : t;
|
|
38
|
-
}
|
|
39
|
-
function w(e, t) {
|
|
40
|
-
return N.indexOf(v(e, t));
|
|
41
|
-
}
|
|
42
|
-
function W(e, t) {
|
|
43
|
-
const n = w(e, "day"), s = w(t, "second"), r = Math.min(n, s), o = Math.max(n, s);
|
|
44
|
-
return N.slice(r, o + 1);
|
|
45
|
-
}
|
|
46
|
-
function G(e, t) {
|
|
47
|
-
return e * b[v(t, "second")];
|
|
48
|
-
}
|
|
49
|
-
function K(e, t) {
|
|
50
|
-
const n = W(t.largestUnit, t.smallestUnit), s = n[n.length - 1], r = b[s];
|
|
51
|
-
let o = Math.round(e / r) * r;
|
|
52
|
-
return n.map((u) => {
|
|
53
|
-
const a = b[u], c = Math.floor(o / a);
|
|
54
|
-
return o -= c * a, { unit: u, value: c };
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function F(e, t) {
|
|
58
|
-
const n = e.filter((o) => o.value !== 0), s = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : s.length;
|
|
59
|
-
return s.slice(0, r).map((o) => `${o.value}${B[o.unit]}`).join(" ");
|
|
60
|
-
}
|
|
61
|
-
function J(e, t) {
|
|
62
|
-
const n = e.filter((o) => o.value !== 0), s = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : s.length;
|
|
63
|
-
return s.slice(0, r).map((o) => {
|
|
64
|
-
const [u, a] = q[o.unit];
|
|
65
|
-
return `${o.value} ${o.value === 1 ? u : a}`;
|
|
66
|
-
}).join(" ");
|
|
67
|
-
}
|
|
68
|
-
function Q(e) {
|
|
69
|
-
const t = e.some(
|
|
70
|
-
(c) => c.unit === "day" && c.value !== 0
|
|
71
|
-
), n = e.some((c) => c.unit === "millisecond"), s = e.findIndex((c) => c.value !== 0), r = Math.max(0, e.length - 2), o = t ? 0 : s === -1 ? r : Math.min(s, r), u = s === -1 ? e.slice(r) : e.slice(o);
|
|
72
|
-
if (u.length === 0)
|
|
73
|
-
return "0";
|
|
74
|
-
const a = u.map((c, i) => c.unit === "millisecond" ? String(c.value).padStart(3, "0") : i === 0 ? String(c.value) : String(c.value).padStart(2, "0")).join(":");
|
|
75
|
-
return n ? a.replace(/:(\d{3})$/, ".$1") : a;
|
|
76
|
-
}
|
|
77
|
-
function ee(e, t, n) {
|
|
78
|
-
const s = `${n.prefix || ""}${e}${n.suffix || ""}`;
|
|
79
|
-
return t ? n.negativeInParentheses ? `(${s})` : `-${s}` : s;
|
|
80
|
-
}
|
|
81
|
-
function te(e, t = {}) {
|
|
82
|
-
if (e == null)
|
|
83
|
-
return "";
|
|
84
|
-
const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
|
|
85
|
-
if (!Number.isFinite(n))
|
|
86
|
-
return "";
|
|
87
|
-
const s = t.inputUnit || "second", r = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", o = n < 0, u = Math.abs(G(n, s)), a = K(u, t), c = r === "digital" ? Q(a) : r === "long" ? J(a, t.maxUnits) : F(a, t.maxUnits);
|
|
88
|
-
return ee(c, o, t);
|
|
89
|
-
}
|
|
90
|
-
function g(e, t) {
|
|
91
|
-
const n = d(e), s = d(t), r = n.getTime() - s.getTime();
|
|
92
|
-
return r < 0 ? -1 : r > 0 ? 1 : r;
|
|
93
|
-
}
|
|
94
|
-
function ne(e) {
|
|
95
|
-
return P(e, Date.now());
|
|
96
|
-
}
|
|
97
|
-
function re(e, t) {
|
|
98
|
-
const n = d(e), s = d(t), r = n.getFullYear() - s.getFullYear(), o = n.getMonth() - s.getMonth();
|
|
99
|
-
return r * 12 + o;
|
|
100
|
-
}
|
|
101
|
-
function se(e) {
|
|
102
|
-
return (t) => {
|
|
103
|
-
const s = (e ? Math[e] : Math.trunc)(t);
|
|
104
|
-
return s === 0 ? 0 : s;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function oe(e, t) {
|
|
108
|
-
return +d(e) - +d(t);
|
|
109
|
-
}
|
|
110
|
-
function ae(e) {
|
|
111
|
-
const t = d(e);
|
|
112
|
-
return t.setHours(23, 59, 59, 999), t;
|
|
113
|
-
}
|
|
114
|
-
function ie(e) {
|
|
115
|
-
const t = d(e), n = t.getMonth();
|
|
116
|
-
return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
117
|
-
}
|
|
118
|
-
function ue(e) {
|
|
119
|
-
const t = d(e);
|
|
120
|
-
return +ae(t) == +ie(t);
|
|
121
|
-
}
|
|
122
|
-
function ce(e, t) {
|
|
123
|
-
const n = d(e), s = d(t), r = g(n, s), o = Math.abs(
|
|
124
|
-
re(n, s)
|
|
125
|
-
);
|
|
126
|
-
let u;
|
|
127
|
-
if (o < 1)
|
|
128
|
-
u = 0;
|
|
129
|
-
else {
|
|
130
|
-
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - r * o);
|
|
131
|
-
let a = g(n, s) === -r;
|
|
132
|
-
ue(d(e)) && o === 1 && g(e, s) === 1 && (a = !1), u = r * (o - Number(a));
|
|
133
|
-
}
|
|
134
|
-
return u === 0 ? 0 : u;
|
|
135
|
-
}
|
|
136
|
-
function le(e, t, n) {
|
|
137
|
-
const s = oe(e, t) / 1e3;
|
|
138
|
-
return se(n == null ? void 0 : n.roundingMethod)(s);
|
|
139
|
-
}
|
|
140
|
-
function fe(e, t, n) {
|
|
141
|
-
const s = $(), r = (n == null ? void 0 : n.locale) ?? s.locale ?? C, o = 2520, u = g(e, t);
|
|
142
|
-
if (isNaN(u))
|
|
143
|
-
throw new RangeError("Invalid time value");
|
|
144
|
-
const a = Object.assign({}, n, {
|
|
145
|
-
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
146
|
-
comparison: u
|
|
147
|
-
});
|
|
148
|
-
let c, i;
|
|
149
|
-
u > 0 ? (c = d(t), i = d(e)) : (c = d(e), i = d(t));
|
|
150
|
-
const m = le(i, c), f = (x(i) - x(c)) / 1e3, l = Math.round((m - f) / 60);
|
|
151
|
-
let h;
|
|
152
|
-
if (l < 2)
|
|
153
|
-
return n != null && n.includeSeconds ? m < 5 ? r.formatDistance("lessThanXSeconds", 5, a) : m < 10 ? r.formatDistance("lessThanXSeconds", 10, a) : m < 20 ? r.formatDistance("lessThanXSeconds", 20, a) : m < 40 ? r.formatDistance("halfAMinute", 0, a) : m < 60 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", 1, a) : l === 0 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", l, a);
|
|
154
|
-
if (l < 45)
|
|
155
|
-
return r.formatDistance("xMinutes", l, a);
|
|
156
|
-
if (l < 90)
|
|
157
|
-
return r.formatDistance("aboutXHours", 1, a);
|
|
158
|
-
if (l < p) {
|
|
159
|
-
const y = Math.round(l / 60);
|
|
160
|
-
return r.formatDistance("aboutXHours", y, a);
|
|
161
|
-
} else {
|
|
162
|
-
if (l < o)
|
|
163
|
-
return r.formatDistance("xDays", 1, a);
|
|
164
|
-
if (l < M) {
|
|
165
|
-
const y = Math.round(l / p);
|
|
166
|
-
return r.formatDistance("xDays", y, a);
|
|
167
|
-
} else if (l < M * 2)
|
|
168
|
-
return h = Math.round(l / M), r.formatDistance("aboutXMonths", h, a);
|
|
169
|
-
}
|
|
170
|
-
if (h = ce(i, c), h < 12) {
|
|
171
|
-
const y = Math.round(l / M);
|
|
172
|
-
return r.formatDistance("xMonths", y, a);
|
|
173
|
-
} else {
|
|
174
|
-
const y = h % 12, D = Math.trunc(h / 12);
|
|
175
|
-
return y < 3 ? r.formatDistance("aboutXYears", D, a) : y < 9 ? r.formatDistance("overXYears", D, a) : r.formatDistance("almostXYears", D + 1, a);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
function me(e, t) {
|
|
179
|
-
return fe(e, ne(e), t);
|
|
180
|
-
}
|
|
181
|
-
function Ie(e, t) {
|
|
182
|
-
return e && e !== "auto" ? e : t;
|
|
183
|
-
}
|
|
184
|
-
function Le(e, t = /* @__PURE__ */ new Date()) {
|
|
185
|
-
try {
|
|
186
|
-
const n = {
|
|
187
|
-
timeZone: e,
|
|
188
|
-
timeZoneName: "short"
|
|
189
|
-
}, r = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((o) => o.type === "timeZoneName");
|
|
190
|
-
return (r == null ? void 0 : r.value) || e;
|
|
191
|
-
} catch {
|
|
192
|
-
return e;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function _e(e) {
|
|
196
|
-
try {
|
|
197
|
-
const t = {
|
|
198
|
-
timeZone: e,
|
|
199
|
-
timeZoneName: "long"
|
|
200
|
-
}, s = new Intl.DateTimeFormat("en-US", t).formatToParts(
|
|
201
|
-
/* @__PURE__ */ new Date()
|
|
202
|
-
).find((r) => r.type === "timeZoneName");
|
|
203
|
-
return (s == null ? void 0 : s.value) || e;
|
|
204
|
-
} catch {
|
|
205
|
-
return e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function S(e, t = "auto") {
|
|
209
|
-
if (!e)
|
|
210
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
211
|
-
const n = e.endsWith("Z"), s = /[+-]\d{2}:?\d{2}$/.test(e), r = /\([A-Z]{3,4}\)$/.test(e);
|
|
212
|
-
if (t === "auto")
|
|
213
|
-
return n || s || r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
|
|
214
|
-
if (t === "local") {
|
|
215
|
-
if (n || s) {
|
|
216
|
-
const o = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
217
|
-
return new Date(o);
|
|
218
|
-
}
|
|
219
|
-
return new Date(e);
|
|
220
|
-
} else return t === "UTC" ? n ? new Date(e) : s ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || s || r ? new Date(e) : j(e, t);
|
|
221
|
-
}
|
|
222
|
-
const de = "MM/dd/yyyy", he = (e, t, n, s = "auto") => {
|
|
223
|
-
if (!e)
|
|
224
|
-
return "";
|
|
225
|
-
try {
|
|
226
|
-
const r = S(e, s);
|
|
227
|
-
if (isNaN(r.getTime()))
|
|
228
|
-
return e;
|
|
229
|
-
const u = (t && t.trim() ? t : de).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
230
|
-
return n && n !== "auto" ? O(r, n, u) : A(r, u);
|
|
231
|
-
} catch (r) {
|
|
232
|
-
return console.error("Date formatting error:", r), e;
|
|
233
|
-
}
|
|
234
|
-
}, ye = (e, t = "auto") => {
|
|
235
|
-
if (!e)
|
|
236
|
-
return "";
|
|
237
|
-
try {
|
|
238
|
-
const n = S(e, t);
|
|
239
|
-
return isNaN(n.getTime()) ? e : me(n, { addSuffix: !0 });
|
|
240
|
-
} catch (n) {
|
|
241
|
-
return console.error("Relative time formatting error:", n), e;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
function Me(e, t, n, s) {
|
|
245
|
-
const r = e instanceof Date ? e.toISOString() : String(e), o = (s == null ? void 0 : s.browserTimezone) || n, u = (s == null ? void 0 : s.isSqlCard) ?? !1;
|
|
246
|
-
if (t != null && t.useRelativeTime)
|
|
247
|
-
return ye(
|
|
248
|
-
r,
|
|
249
|
-
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
250
|
-
);
|
|
251
|
-
const a = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
|
|
252
|
-
return he(
|
|
253
|
-
r,
|
|
254
|
-
a,
|
|
255
|
-
t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : u ? o : n,
|
|
256
|
-
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
function I(e, t, n) {
|
|
260
|
-
var u, a;
|
|
261
|
-
if (e == null)
|
|
262
|
-
return e === null ? ((u = n.absence) == null ? void 0 : u.nullText) ?? "" : ((a = n.absence) == null ? void 0 : a.emptyText) ?? "";
|
|
263
|
-
const s = L(e) ? e : void 0, r = s ? s.value : e, o = s ?? (typeof e == "number" ? e : void 0);
|
|
264
|
-
if (!n.useFormattedValues || !t)
|
|
265
|
-
return String(r);
|
|
266
|
-
switch (t.type) {
|
|
267
|
-
case "number":
|
|
268
|
-
return o !== void 0 ? R(
|
|
269
|
-
o,
|
|
270
|
-
t.numberFormat,
|
|
271
|
-
n.locale
|
|
272
|
-
) : String(r);
|
|
273
|
-
case "date":
|
|
274
|
-
return Me(
|
|
275
|
-
r,
|
|
276
|
-
t.dateFormat,
|
|
277
|
-
n.timezone,
|
|
278
|
-
{
|
|
279
|
-
browserTimezone: n.browserTimezone,
|
|
280
|
-
isSqlCard: n.isSqlCard
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
case "progress":
|
|
284
|
-
return o !== void 0 ? `${r}%` : String(r);
|
|
285
|
-
case "badge":
|
|
286
|
-
case "link":
|
|
287
|
-
case "text":
|
|
288
|
-
case "none":
|
|
289
|
-
default:
|
|
290
|
-
return String(r);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function Pe(e, t) {
|
|
294
|
-
return t.visibleColumns.map((n) => {
|
|
295
|
-
const s = e[n], r = t.columnSettings[n];
|
|
296
|
-
return I(s, r, {
|
|
297
|
-
useFormattedValues: t.useFormattedValues,
|
|
298
|
-
timezone: t.timezone,
|
|
299
|
-
locale: t.locale
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
function ge(e, t) {
|
|
304
|
-
var r;
|
|
305
|
-
const n = e[e.length - 1];
|
|
306
|
-
if (!n) return "";
|
|
307
|
-
if (n.member.kind === "others") return "Others";
|
|
308
|
-
const s = n.member.value;
|
|
309
|
-
return s === null ? "(Blank)" : ((r = t == null ? void 0 : t.get(n.levelId)) == null ? void 0 : r(s)) ?? (typeof s == "object" ? s.value : String(s));
|
|
310
|
-
}
|
|
311
|
-
function De(e, t, n) {
|
|
312
|
-
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? n ?? `${t} Total` : t;
|
|
313
|
-
}
|
|
314
|
-
function $e(e, t, n, s) {
|
|
315
|
-
var u;
|
|
316
|
-
const r = e[e.length - 1], o = t === "grand_total" ? n.grand.label : r ? (u = n.levels[r.levelId]) == null ? void 0 : u.label : void 0;
|
|
317
|
-
return De(t, ge(e, s), o);
|
|
318
|
-
}
|
|
319
|
-
function Ce(e, t, n) {
|
|
320
|
-
return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
|
|
321
|
-
}
|
|
322
|
-
function Oe(e) {
|
|
323
|
-
const { path: t, previousPath: n, role: s, repeatLabels: r, levelCount: o } = e;
|
|
324
|
-
return Array.from({ length: o }, (u, a) => {
|
|
325
|
-
const c = t.slice(0, a + 1), i = s === "grand_total" ? a === 0 : s === "subtotal" && a === t.length - 1, m = n && n.length > a && T(n.slice(0, a + 1)) === T(c);
|
|
326
|
-
return {
|
|
327
|
-
path: c,
|
|
328
|
-
total: i,
|
|
329
|
-
visible: i || t.length > a && (r || !m || a === t.length - 1)
|
|
330
|
-
};
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
function be(e, t) {
|
|
334
|
-
return Z(e ?? t, {
|
|
335
|
-
preserveOmittedProperties: !0,
|
|
336
|
-
numericInput: "canonical"
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
function Ae(e, t, n) {
|
|
340
|
-
const s = /* @__PURE__ */ new Map(), r = (o, u) => {
|
|
341
|
-
const a = (u === "levels" ? t.levelFormats : t.measureFormats)[o.id], c = o.semanticFormat, i = be(a, c);
|
|
342
|
-
u === "measures" && s.set(o.id, {
|
|
343
|
-
isNumeric: _(o.column.dataType) === "number",
|
|
344
|
-
// Use normalized affixes: a redundant percent suffix is already removed.
|
|
345
|
-
hasTextAffixes: !!i && !!("prefix" in i && i.prefix || "suffix" in i && i.suffix)
|
|
346
|
-
});
|
|
347
|
-
const m = (f) => I(f, void 0, {
|
|
348
|
-
useFormattedValues: !0,
|
|
349
|
-
timezone: n.calendar.tz,
|
|
350
|
-
locale: n.valueFormat.locale,
|
|
351
|
-
absence: t.absence
|
|
352
|
-
});
|
|
353
|
-
if (o.column.temporalBucket) {
|
|
354
|
-
const f = o.column.temporalBucket, l = E({
|
|
355
|
-
metadata: f,
|
|
356
|
-
cardFormat: (a == null ? void 0 : a.type) === "temporal_bucket" ? a : void 0,
|
|
357
|
-
semanticFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? { granularity: f.granularity, format: c } : void 0,
|
|
358
|
-
locale: n.valueFormat.locale,
|
|
359
|
-
styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
|
|
360
|
-
});
|
|
361
|
-
return (h) => typeof h == "string" ? Y({ value: h, metadata: f, format: l.format }) : m(h);
|
|
362
|
-
}
|
|
363
|
-
if (o.column.rawTemporal) {
|
|
364
|
-
const f = U({
|
|
365
|
-
metadata: o.column.rawTemporal,
|
|
366
|
-
format: z({
|
|
367
|
-
format: (i == null ? void 0 : i.type) === "date" ? {
|
|
368
|
-
type: "raw_temporal",
|
|
369
|
-
timezone: i.timezone,
|
|
370
|
-
sourceTimezone: i.sourceTimezone,
|
|
371
|
-
presentation: i.pattern ? {
|
|
372
|
-
mode: "pattern",
|
|
373
|
-
dialect: "semaphor_tokens",
|
|
374
|
-
pattern: i.pattern
|
|
375
|
-
} : { mode: "auto" }
|
|
376
|
-
} : void 0,
|
|
377
|
-
preferences: n.valueFormat,
|
|
378
|
-
calendar: n.calendar
|
|
379
|
-
})
|
|
380
|
-
});
|
|
381
|
-
return (l) => {
|
|
382
|
-
if (typeof l != "string") return m(l);
|
|
383
|
-
const h = f(l);
|
|
384
|
-
return h.ok ? h.text : m(l);
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
if (k(i)) {
|
|
388
|
-
const f = V(i, n.valueFormat);
|
|
389
|
-
return (l) => typeof l == "number" || typeof l == "object" && l !== null ? X(l, f) : m(l);
|
|
390
|
-
}
|
|
391
|
-
return (i == null ? void 0 : i.type) === "duration" ? (f) => typeof f == "number" || typeof f == "string" || typeof f == "object" && f !== null ? te(
|
|
392
|
-
typeof f == "object" ? f.value : f,
|
|
393
|
-
i
|
|
394
|
-
) : m(f) : (i == null ? void 0 : i.type) === "string" ? (f) => f === null ? m(f) : `${i.prefix ?? ""}${m(f)}${i.suffix ?? ""}` : m;
|
|
395
|
-
};
|
|
396
|
-
return {
|
|
397
|
-
levels: new Map(
|
|
398
|
-
e.levels.map((o) => [o.id, r(o, "levels")])
|
|
399
|
-
),
|
|
400
|
-
measures: new Map(
|
|
401
|
-
e.measures.map((o) => [o.id, r(o, "measures")])
|
|
402
|
-
),
|
|
403
|
-
measureSemantics: s
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
export {
|
|
407
|
-
$e as a,
|
|
408
|
-
Oe as b,
|
|
409
|
-
Ce as c,
|
|
410
|
-
te as d,
|
|
411
|
-
he as e,
|
|
412
|
-
Pe as f,
|
|
413
|
-
ye as g,
|
|
414
|
-
Le as h,
|
|
415
|
-
_e as i,
|
|
416
|
-
S as j,
|
|
417
|
-
I as k,
|
|
418
|
-
me as l,
|
|
419
|
-
ge as m,
|
|
420
|
-
be as n,
|
|
421
|
-
De as o,
|
|
422
|
-
Ae as p,
|
|
423
|
-
Ie as r
|
|
424
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const T=require("./validators-DVYAnnX0.cjs");require("./matrix-operation-contract-DoiWTUbT.cjs");const f=require("./semantic-format-BzH69TRq.cjs"),y=require("./raw-temporal-BUeTpG76.cjs"),M=require("./constants-B00YUv89.cjs"),R=require("./index-F25jnH0p.cjs"),v=require("./temporal-bucket-4YEPEKlJ.cjs"),I=["day","hour","minute","second","millisecond"],x={day:864e5,hour:36e5,minute:6e4,second:1e3,millisecond:1},Z={day:"d",hour:"hr",minute:"min",second:"s",millisecond:"ms"},z={day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],second:["second","seconds"],millisecond:["millisecond","milliseconds"]};function U(e){return e==="day"||e==="hour"||e==="minute"||e==="second"||e==="millisecond"}function L(e,t){return U(e)?e:t}function N(e,t){return I.indexOf(L(e,t))}function k(e,t){const n=N(e,"day"),s=N(t,"second"),r=Math.min(n,s),o=Math.max(n,s);return I.slice(r,o+1)}function V(e,t){return e*x[L(t,"second")]}function q(e,t){const n=k(t.largestUnit,t.smallestUnit),s=n[n.length-1],r=x[s];let o=Math.round(e/r)*r;return n.map(u=>{const a=x[u],c=Math.floor(o/a);return o-=c*a,{unit:u,value:c}})}function X(e,t){const n=e.filter(o=>o.value!==0),s=n.length>0?n:[e[e.length-1]],r=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):s.length;return s.slice(0,r).map(o=>`${o.value}${Z[o.unit]}`).join(" ")}function E(e,t){const n=e.filter(o=>o.value!==0),s=n.length>0?n:[e[e.length-1]],r=typeof t=="number"&&Number.isFinite(t)?Math.max(1,Math.trunc(t)):s.length;return s.slice(0,r).map(o=>{const[u,a]=z[o.unit];return`${o.value} ${o.value===1?u:a}`}).join(" ")}function j(e){const t=e.some(c=>c.unit==="day"&&c.value!==0),n=e.some(c=>c.unit==="millisecond"),s=e.findIndex(c=>c.value!==0),r=Math.max(0,e.length-2),o=t?0:s===-1?r:Math.min(s,r),u=s===-1?e.slice(r):e.slice(o);if(u.length===0)return"0";const a=u.map((c,i)=>c.unit==="millisecond"?String(c.value).padStart(3,"0"):i===0?String(c.value):String(c.value).padStart(2,"0")).join(":");return n?a.replace(/:(\d{3})$/,".$1"):a}function B(e,t,n){const s=`${n.prefix||""}${e}${n.suffix||""}`;return t?n.negativeInParentheses?`(${s})`:`-${s}`:s}function S(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 s=t.inputUnit||"second",r=t.outputStyle==="digital"||t.outputStyle==="long"?t.outputStyle:"compact",o=n<0,u=Math.abs(V(n,s)),a=q(u,t),c=r==="digital"?j(a):r==="long"?E(a,t.maxUnits):X(a,t.maxUnits);return B(c,o,t)}function g(e,t){const n=f.toDate(e),s=f.toDate(t),r=n.getTime()-s.getTime();return r<0?-1:r>0?1:r}function Y(e){return f.constructFrom(e,Date.now())}function W(e,t){const n=f.toDate(e),s=f.toDate(t),r=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return r*12+o}function F(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function H(e,t){return+f.toDate(e)-+f.toDate(t)}function G(e){const t=f.toDate(e);return t.setHours(23,59,59,999),t}function K(e){const t=f.toDate(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function J(e){const t=f.toDate(e);return+G(t)==+K(t)}function Q(e,t){const n=f.toDate(e),s=f.toDate(t),r=g(n,s),o=Math.abs(W(n,s));let u;if(o<1)u=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*o);let a=g(n,s)===-r;J(f.toDate(e))&&o===1&&g(e,s)===1&&(a=!1),u=r*(o-Number(a))}return u===0?0:u}function ee(e,t,n){const s=H(e,t)/1e3;return F(n==null?void 0:n.roundingMethod)(s)}function te(e,t,n){const s=f.getDefaultOptions(),r=(n==null?void 0:n.locale)??s.locale??f.enUS,o=2520,u=g(e,t);if(isNaN(u))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:u});let c,i;u>0?(c=f.toDate(t),i=f.toDate(e)):(c=f.toDate(e),i=f.toDate(t));const h=ee(i,c),m=(f.getTimezoneOffsetInMilliseconds(i)-f.getTimezoneOffsetInMilliseconds(c))/1e3,l=Math.round((h-m)/60);let d;if(l<2)return n!=null&&n.includeSeconds?h<5?r.formatDistance("lessThanXSeconds",5,a):h<10?r.formatDistance("lessThanXSeconds",10,a):h<20?r.formatDistance("lessThanXSeconds",20,a):h<40?r.formatDistance("halfAMinute",0,a):h<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):l===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",l,a);if(l<45)return r.formatDistance("xMinutes",l,a);if(l<90)return r.formatDistance("aboutXHours",1,a);if(l<M.minutesInDay){const D=Math.round(l/60);return r.formatDistance("aboutXHours",D,a)}else{if(l<o)return r.formatDistance("xDays",1,a);if(l<M.minutesInMonth){const D=Math.round(l/M.minutesInDay);return r.formatDistance("xDays",D,a)}else if(l<M.minutesInMonth*2)return d=Math.round(l/M.minutesInMonth),r.formatDistance("aboutXMonths",d,a)}if(d=Q(i,c),d<12){const D=Math.round(l/M.minutesInMonth);return r.formatDistance("xMonths",D,a)}else{const D=d%12,b=Math.trunc(d/12);return D<3?r.formatDistance("aboutXYears",b,a):D<9?r.formatDistance("overXYears",b,a):r.formatDistance("almostXYears",b+1,a)}}function _(e,t){return te(e,Y(e),t)}function ne(e,t){return e&&e!=="auto"?e:t}function re(e,t=new Date){try{const n={timeZone:e,timeZoneName:"short"},r=new Intl.DateTimeFormat("en-US",n).formatToParts(t).find(o=>o.type==="timeZoneName");return(r==null?void 0:r.value)||e}catch{return e}}function se(e){try{const t={timeZone:e,timeZoneName:"long"},s=new Intl.DateTimeFormat("en-US",t).formatToParts(new Date).find(r=>r.type==="timeZoneName");return(s==null?void 0:s.value)||e}catch{return e}}function p(e,t="auto"){if(!e)return new Date(NaN);const n=e.endsWith("Z"),s=/[+-]\d{2}:?\d{2}$/.test(e),r=/\([A-Z]{3,4}\)$/.test(e);if(t==="auto")return n||s||r?new Date(e):new Date(e+"Z");if(t==="local"){if(n||s){const o=e.replace(/Z$/,"").replace(/[+-]\d{2}:?\d{2}$/,"");return new Date(o)}return new Date(e)}else return t==="UTC"?n?new Date(e):s?new Date(e):new Date(e+"Z"):n||s||r?new Date(e):R.fromZonedTime(e,t)}const oe="MM/dd/yyyy",C=(e,t,n,s="auto")=>{if(!e)return"";try{const r=p(e,s);if(isNaN(r.getTime()))return e;const u=(t&&t.trim()?t:oe).replace(/LLLL/g,"MMMM").replace(/LLL/g,"MMM");return n&&n!=="auto"?f.formatInTimeZone(r,n,u):f.format(r,u)}catch(r){return console.error("Date formatting error:",r),e}},P=(e,t="auto")=>{if(!e)return"";try{const n=p(e,t);return isNaN(n.getTime())?e:_(n,{addSuffix:!0})}catch(n){return console.error("Relative time formatting error:",n),e}};function ae(e,t,n,s){const r=e instanceof Date?e.toISOString():String(e),o=(s==null?void 0:s.browserTimezone)||n,u=(s==null?void 0:s.isSqlCard)??!1;if(t!=null&&t.useRelativeTime)return P(r,(t==null?void 0:t.sourceTimezone)||"auto");const a=t!=null&&t.useCustomFormat&&(t!=null&&t.customFormat)?t.customFormat:(t==null?void 0:t.format)||"MM/dd/yyyy";return C(r,a,t!=null&&t.timezone&&(t==null?void 0:t.timezone)!=="auto"?t.timezone:u?o:n,(t==null?void 0:t.sourceTimezone)||"auto")}function w(e,t,n){var u,a;if(e==null)return e===null?((u=n.absence)==null?void 0:u.nullText)??"":((a=n.absence)==null?void 0:a.emptyText)??"";const s=T.isExactNumericValue(e)?e:void 0,r=s?s.value:e,o=s??(typeof e=="number"?e:void 0);if(!n.useFormattedValues||!t)return String(r);switch(t.type){case"number":return o!==void 0?y.formatNumberWithColumnSettings(o,t.numberFormat,n.locale):String(r);case"date":return ae(r,t.dateFormat,n.timezone,{browserTimezone:n.browserTimezone,isSqlCard:n.isSqlCard});case"progress":return o!==void 0?`${r}%`:String(r);case"badge":case"link":case"text":case"none":default:return String(r)}}function ie(e,t){return t.visibleColumns.map(n=>{const s=e[n],r=t.columnSettings[n];return w(s,r,{useFormattedValues:t.useFormattedValues,timezone:t.timezone,locale:t.locale})})}function A(e,t){var r;const n=e[e.length-1];if(!n)return"";if(n.member.kind==="others")return"Others";const s=n.member.value;return s===null?"(Blank)":((r=t==null?void 0:t.get(n.levelId))==null?void 0:r(s))??(typeof s=="object"?s.value:String(s))}function O(e,t,n){return e==="grand_total"?n??"Grand Total":e==="subtotal"?n??`${t} Total`:t}function ue(e,t,n,s){var u;const r=e[e.length-1],o=t==="grand_total"?n.grand.label:r?(u=n.levels[r.levelId])==null?void 0:u.label:void 0;return O(t,A(e,s),o)}function ce(e,t,n){return e.kind==="value"?(t==null?void 0:t(e.value))??"":e.kind==="null"?n.nullText:n.emptyText}function le(e){const{path:t,previousPath:n,role:s,repeatLabels:r,levelCount:o}=e;return Array.from({length:o},(u,a)=>{const c=t.slice(0,a+1),i=s==="grand_total"?a===0:s==="subtotal"&&a===t.length-1,h=n&&n.length>a&&T.matrixPathKey(n.slice(0,a+1))===T.matrixPathKey(c);return{path:c,total:i,visible:i||t.length>a&&(r||!h||a===t.length-1)}})}function $(e,t){return f.fromSemanticFormat(e??t,{preserveOmittedProperties:!0,numericInput:"canonical"})}function fe(e,t,n){const s=new Map,r=(o,u)=>{const a=(u==="levels"?t.levelFormats:t.measureFormats)[o.id],c=o.semanticFormat,i=$(a,c);u==="measures"&&s.set(o.id,{isNumeric:T.normalizeAnalyticsCatalogDataType(o.column.dataType)==="number",hasTextAffixes:!!i&&!!("prefix"in i&&i.prefix||"suffix"in i&&i.suffix)});const h=m=>w(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,l=v.resolveTemporalBucketPresentation({metadata:m,cardFormat:(a==null?void 0:a.type)==="temporal_bucket"?a:void 0,semanticFormat:(c==null?void 0:c.type)==="temporal_bucket"?{granularity:m.granularity,format:c}:void 0,locale:n.valueFormat.locale,styles:{dateStyle:n.valueFormat.dateStyle,dateTime:n.valueFormat.dateTime}});return d=>typeof d=="string"?v.formatTemporalBucket({value:d,metadata:m,format:l.format}):h(d)}if(o.column.rawTemporal){const m=y.prepareRawTemporalFormatter({metadata:o.column.rawTemporal,format:y.resolveRawTemporalFormat({format:(i==null?void 0:i.type)==="date"?{type:"raw_temporal",timezone:i.timezone,sourceTimezone:i.sourceTimezone,presentation:i.pattern?{mode:"pattern",dialect:"semaphor_tokens",pattern:i.pattern}:{mode:"auto"}}:void 0,preferences:n.valueFormat,calendar:n.calendar})});return l=>{if(typeof l!="string")return h(l);const d=m(l);return d.ok?d.text:h(l)}}if(f.isNumericCanonicalFormat(i)){const m=y.resolveNumericPresentation(i,n.valueFormat);return l=>typeof l=="number"||typeof l=="object"&&l!==null?y.formatNumericCanonical(l,m):h(l)}return(i==null?void 0:i.type)==="duration"?m=>typeof m=="number"||typeof m=="string"||typeof m=="object"&&m!==null?S(typeof m=="object"?m.value:m,i):h(m):(i==null?void 0:i.type)==="string"?m=>m===null?h(m):`${i.prefix??""}${h(m)}${i.suffix??""}`:h};return{levels:new Map(e.levels.map(o=>[o.id,r(o,"levels")])),measures:new Map(e.measures.map(o=>[o.id,r(o,"measures")])),measureSemantics:s}}exports.formatCellValue=w;exports.formatDate=C;exports.formatDistanceToNow=_;exports.formatDuration=S;exports.formatRelativeTime=P;exports.formatRowForExport=ie;exports.getTimezoneAbbreviation=re;exports.getTimezoneName=se;exports.matrixAxisLabel=ue;exports.matrixCellText=ce;exports.matrixLevelLabels=le;exports.matrixMemberLabel=A;exports.matrixTotalLabel=O;exports.parseWithSourceTimezone=p;exports.prepareMatrixFormatting=fe;exports.resolveMatrixValueFormat=$;exports.resolveTimezone=ne;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("./validators-DVYAnnX0.cjs"),f=["=","!=",">","<",">=","<=","like","not like","between","not between","in","not in","is null","is not null"],y=new Set(["string","number","date","boolean"]);function P(t){return typeof t=="string"&&f.includes(t)}function b(t,e){switch(t){case"is null":case"is not null":return e.length===0;case"between":case"not between":return e.length===2;case"in":case"not in":return e.length>=1;default:return e.length===1}}function m(t){if(!t||typeof t!="object"||Array.isArray(t))return;const e=t,n={};for(const i of S)e[i]!==void 0&&(n[i]=e[i]);return n}const S=["operation","values","valueType","temporalBucket","relativeMeta","temporalPrecision"];function v(t){const e=m(t);if(!e)return;const{operation:n,values:i}=e;if(!P(n)||!Array.isArray(i)||!b(n,i))return;const r=typeof e.valueType=="string"&&y.has(e.valueType)?e.valueType:void 0;return{operation:n,values:i,...r?{valueType:r}:{},...e.temporalBucket!==void 0?{temporalBucket:e.temporalBucket}:{},...e.relativeMeta!==void 0?{relativeMeta:e.relativeMeta}:{},...e.temporalPrecision!==void 0?{temporalPrecision:e.temporalPrecision}:{}}}function E(t){const e=v(t);if(!e)throw new Error(`Filter operation "${String(t.operation)}" cannot be expressed as predicate semantics.`);return e}function N(t){return t.operation==="is null"||t.operation==="is not null"}function c(t){var e;return JSON.stringify([((e=t.field)==null?void 0:e.id)??"",t.operator,t.value??null,t.temporalBucket??null])}function A(t){return JSON.stringify(t.map(c).sort())}function g(t){const e=new Map;for(const n of t)for(const i of n.tuples){const r=i.conditions.filter(l=>{var o;return(o=l.field)==null?void 0:o.id});if(r.length===0)continue;let a=e.get(n.sourceCardId);a||(a=new Map,e.set(n.sourceCardId,a));const s=[...r].sort((l,o)=>c(l).localeCompare(c(o)));a.set(A(s),s)}return[...e.entries()].sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>({sourceCardId:n,tuples:[...i.entries()].sort(([r],[a])=>r.localeCompare(a)).map(([,r])=>({conditions:r}))}))}function C(t){const e=g(t);if(e.length!==0)return{id:"selection",logicalOperator:"AND",negate:!1,conditions:[],groups:e.map(n=>{const i=`selection:${n.sourceCardId}`;return{id:i,logicalOperator:"OR",negate:!1,conditions:[],groups:n.tuples.map((r,a)=>{const s=`${i}:${a}`;return{id:s,logicalOperator:"AND",negate:!1,conditions:r.conditions.map((l,o)=>({...l,id:`${s}:${o}`})),groups:[]}})}})}}function I(t){return JSON.stringify(g(t).map(e=>[e.sourceCardId,e.tuples.map(n=>n.conditions.map(c))]))}function h(t,e){var i;if(e===null)return!0;if(e.overrides.length===0)return t.length<=e.depth;const n=d.matrixPathKey(t);return((i=e.overrides.find(r=>r.path.length===t.length&&d.matrixPathKey(r.path)===n))==null?void 0:i.expanded)??t.length<=e.depth}function T(t){var p;const{path:e,levelCount:n,expansion:i,total:r,axis:a}=t,s=e.length>=n||((p=e[e.length-1])==null?void 0:p.member.kind)==="others",l=!s&&!t.childrenEmpty,o=l&&h(e,i),u=a==="rows"&&t.rowLayout!=="tabular";return{expandable:l,expanded:o,memberVisible:u||!o,valueVisible:s||!!(r!=null&&r.visible)&&(!o||r.position==="before"),subtotalBefore:!u&&o&&!!(r!=null&&r.visible)&&r.position==="before",subtotalAfter:o&&!!(r!=null&&r.visible)&&r.position==="after"}}exports.NATIVE_PREDICATE_OPERATIONS=f;exports.compileSelectionFilterGroup=C;exports.isMatrixPathExpanded=h;exports.isNullCheckPredicate=N;exports.parseNativePredicateSemantics=v;exports.projectNativePredicateSemantics=m;exports.resolveMatrixMemberPresentation=T;exports.selectionFilterGroupKey=I;exports.toNativePredicateSemantics=E;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var X=(e,r,t)=>r in e?v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var w=(e,r,t)=>X(e,typeof r!="symbol"?r+"":r,t);const D=require("./semantic-format-BzH69TRq.cjs"),k=require("./matrix-formatter-CveLJo6S.cjs"),f=require("./raw-temporal-BUeTpG76.cjs"),d=require("../pdf-export-policy/index.cjs"),G=require("./temporal-bucket-4YEPEKlJ.cjs");function B(e,r,t){const n={...r,locale:r.locale??t};if(n.type==="number")return f.formatNumericCanonical(e,n);const{prefix:o,suffix:a,...s}=n;return`${o??""}${f.formatNumericCanonical(e,{...s,negativeStyle:n.type==="currency"?n.negativeStyle:"minus"})}${a??""}`}function A(e,r,t){return e===null?{value:e,text:null}:!r||!D.isNumericCanonicalFormat(r)&&r.type!=="duration"?{value:e,text:f.formatNumericCanonical(e,{type:"number",locale:t})}:r.type==="duration"?{value:e,text:k.formatDuration(e,{inputUnit:r.inputUnit,outputStyle:r.outputStyle,largestUnit:r.largestUnit,smallestUnit:r.smallestUnit,maxUnits:r.maxUnits,prefix:r.prefix,suffix:r.suffix,negativeInParentheses:r.negativeStyle==="parentheses"})}:{value:e,text:B(e,r,t)}}function T(e,r,t,n){return e===null?{value:e,text:null}:n==="percent"?{value:e,text:f.formatNumericCanonical(e,{type:"percent",locale:t,minimumFractionDigits:r,maximumFractionDigits:r,percentValueMode:"fraction"})}:{value:e,text:f.formatNumericCanonical(e,{type:"number",locale:t,minimumFractionDigits:r,maximumFractionDigits:r,suffix:"×"})}}function _(e,r){if(e===void 0)return r;if(!Number.isInteger(e)||e<0||e>6)throw new RangeError("Comparison precision must be an integer from 0 to 6.");return e}function $(e,r){const t={mode:r.displayMode,current:A(e.currentValue,r.metricFormat,r.locale),comparison:A(e.comparisonValue,r.metricFormat,r.locale)};return(r.displayMode==="difference"||r.displayMode==="both")&&(t.difference=A(e.delta,r.metricFormat,r.locale)),(r.displayMode==="percent_change"||r.displayMode==="both")&&(t.percentChange=T(e.percentChange,_(r.precision,1),r.locale,"percent")),r.displayMode==="ratio"&&(t.ratio=T(e.ratio,_(r.precision,2),r.locale,"ratio")),t}function U(e){const r=e.trimStart().charAt(0);return["=","+","-","@"].includes(r)||[" ","\r",`
|
|
2
|
-
`].includes(e.charAt(0))?`'${e}`:e}function C(e,r=","){if(e==null)return"";const t=String(e);return t.includes(r)||t.includes('"')||t.includes(`
|
|
3
|
-
`)||t.includes("\r")?`"${t.replace(/"/g,'""')}"`:t}function b(e,r=","){return e.map(t=>C(t,r)).join(r)}function h(e,r={}){const{delimiter:t=",",lineEnding:n=`
|
|
4
|
-
`}=r;return e.map(o=>b(o,t)).join(n)}function N(e,r={}){if(e.length===0)return"";const{delimiter:t=",",lineEnding:n=`
|
|
5
|
-
`,includeHeaders:o=!0,columns:a}=r,s=a||Object.keys(e[0]),l=[];o&&l.push(s);for(const u of e){const i=s.map(g=>{const c=u[g];return c==null?"":String(c)});l.push(i)}return h(l,{delimiter:t,lineEnding:n})}const L=1e4,j=1e6,q=5e6,Y=1024**3,H=1024**3;function K(e){return e>L}class R extends Error{constructor(){super(...arguments);w(this,"code",d.PDF_SAFETY_LIMIT_EXCEEDED)}}function S(e){if(!e||typeof e!="object")return;const{error:r,message:t,detail:n}=e;for(const o of[r,t,n])if(typeof o=="string"&&o.trim())return o.trim()}async function x(e){const r=`PDF request failed: ${e.status} ${e.statusText}`.trim(),t=e.headers.get("content-type")||"";try{if(t.includes("application/json")){const o=await e.json(),a=typeof o.code=="string"?o.code:typeof o.errorCode=="string"?o.errorCode:void 0;return{message:S(o)||r,code:a}}const n=await e.text();if(!n.trim())return{message:r};try{const o=JSON.parse(n),a=typeof o.code=="string"?o.code:typeof o.errorCode=="string"?o.errorCode:void 0;return{message:S(o)||n.trim(),code:a}}catch{return{message:n.trim()}}}catch{return{message:r}}}async function W(e){if(!e.token)throw new Error("Missing auth token for PDF export");if(d.getUtf8ByteLength(e.serializedPayload)>d.FAST_PDF_POLICY.maxRequestBytes)throw new Error("Fast-path PDF request exceeds the structured body limit");const r=await(e.fetchImpl??fetch)(e.url,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:e.serializedPayload,signal:e.signal});if(!r.ok){const n=await x(r);throw n.code===d.PDF_SAFETY_LIMIT_EXCEEDED?new R(n.message):new Error(n.message)}const t=await r.json();if(t!=null&&t.error)throw new Error(t.error);if(typeof(t==null?void 0:t.url)!="string"||!t.url.trim())throw new Error("Fast-path PDF response missing download URL");return t}const z="pdf-group-continuation";function P(e){if(!e.previousRow||e.row.isSubtotal===!0||e.row.isGrandTotal===!0||e.previousRow.isSubtotal===!0||e.previousRow.isGrandTotal===!0)return!0;for(let r=0;r<=e.levelIndex;r++)if(e.getValue(e.row,r)!==e.getValue(e.previousRow,r))return!0;return!1}const V="__TOTAL__";function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e){return e===V}function J(e){const r=new Map,t=(e.groupByColumns??[]).map((o,a)=>{var i,g,c;if(!m(o))throw new Error(`Aggregate groupByColumns[${a}] is invalid`);const s=typeof o.id=="string"&&o.id.length>0?o.id:void 0,l=s?(c=(g=(i=e.columnKeyMap)==null?void 0:i.byRole)==null?void 0:g.groupby)==null?void 0:c[s]:void 0,u=(l==null?void 0:l.outputKey)||(l==null?void 0:l.rawKey)||(typeof o.alias=="string"&&o.alias.length>0?o.alias:typeof o.name=="string"&&o.name.length>0?o.name:void 0);if(!u)throw new Error(`Aggregate groupByColumns[${a}] has no output key`);return[s,o.alias,o.name,u].forEach(y=>{typeof y=="string"&&y.length>0&&r.set(y,u)}),u}),n=(e.rowAggregates??[]).flatMap(o=>!m(o)||typeof o.function!="string"||typeof o.groupLevel!="string"?[]:[{function:o.function,groupLevel:o.groupLevel==="ALL"?"ALL":r.get(o.groupLevel)||o.groupLevel,...typeof o.label=="string"?{label:o.label}:{}}]);return{groupColumnKeys:t,rowAggregates:n}}function M(e){return e==="SUM"?"Total":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function F(e){var t;if(e.customLabel)return e.customLabel;const r=M(e.aggregateFunction);if(e.levelValue!==void 0&&!p(e.levelValue)){if(e.levelValue===null){const o=(t=e.formatValue)==null?void 0:t.call(e,null);return o?`Subtotal ${o}`:`Subtotal ${r}`}const n=e.formatValue?e.formatValue(e.levelValue):String(e.levelValue);if(n)return`Subtotal (${n})`}return`Subtotal ${r}`}function O(e,r){return r||`Grand ${M(e)}`}function Q(e){const r=e.context.groupColumnKeys.indexOf(e.columnKey);if(r<0)throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);return P({row:e.row,previousRow:e.previousRow,levelIndex:r,getValue:(t,n)=>t[e.context.groupColumnKeys[n]]})}function E(e){var n,o;const r=e.context.groupColumnKeys,t=typeof e.row.aggregate=="string"?e.row.aggregate:"SUM";if(e.row.isGrandTotal===!0){const a=(n=e.context.rowAggregates.find(s=>s.groupLevel==="ALL"))==null?void 0:n.label;return{kind:"grand-total",cells:r.map((s,l)=>({columnKey:s,text:l===0?O(t,a):"",placement:l===0?"label":"empty",colSpan:l===0?r.length:1}))}}if(e.row.isSubtotal===!0){if(typeof e.row.subtotalLevel!="string")throw new Error("Aggregate subtotal row is missing subtotalLevel");const a=r.indexOf(e.row.subtotalLevel);if(a<0)throw new Error(`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`);const s=m(e.row.subtotalContext)?e.row.subtotalContext:void 0,l=m(s==null?void 0:s.groupByValues)?s.groupByValues:{},u=(o=e.context.rowAggregates.find(i=>i.groupLevel===e.row.subtotalLevel&&i.function===t))==null?void 0:o.label;return{kind:"subtotal",cells:r.map((i,g)=>{if(g>a)return{columnKey:i,text:"",placement:"empty",colSpan:1};if(g<a){const c=e.row[i];return{columnKey:i,text:c===void 0||p(c)?"":e.formatValue(c,i),placement:"value",colSpan:1}}return{columnKey:i,text:F({aggregateFunction:t,customLabel:u,levelValue:l[i],formatValue:c=>e.formatLabelValue?e.formatLabelValue(c,i):String(e.formatValue(c,i)??"")}),placement:"label",colSpan:r.length-a}})}}return{kind:"data",cells:r.map(a=>{const s=e.row[a];return{columnKey:a,text:s===void 0||p(s)?"":e.formatValue(s,a),placement:"value",colSpan:1}})}}function Z(e){const r=E(e).cells.find(t=>t.columnKey===e.columnKey);if(!r)throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);return r.text}function ee(e){return E(e).cells.map(r=>r.text)}class I extends Error{constructor(t,n){super(`${t}: ${n}`);w(this,"deliveryBlocking",!0);this.code=t,this.name="PivotHeaderPresentationError"}}function re(e){var o;const r=e.mode??"formatted",t=e.members.map(a=>{var l;if(r==="canonical"||!a.temporalBucket)return a.value===null?"":String(a.value);const s=(l=e.resolveTemporalFormat)==null?void 0:l.call(e,a.fieldId);if(!s)throw new I("missing_resolved_temporal_format",`Missing resolved temporal presentation for pivot field "${a.fieldId}"`);return G.formatTemporalBucket({value:a.value,metadata:a.temporalBucket,format:s})}),n=((o=e.metricLabel)==null?void 0:o.trim())||void 0;return{memberLabels:t,...n?{metricLabel:n}:{},flattenedLabel:[...t,...n?[n]:[]].join(" / ")}}exports.AGGREGATE_TOTAL_MEMBER_MARKER=V;exports.DIRECT_CSV_EXPORT_MAX_ROWS=L;exports.FULL_DATASET_CSV_EXPORT_MAX_ROWS=j;exports.MATRIX_EXPORT_MAX_ARTIFACT_BYTES=H;exports.MATRIX_EXPORT_MAX_CELLS=q;exports.MATRIX_EXPORT_MAX_ENCODED_BYTES=Y;exports.PDF_GROUP_CONTINUATION_CLASS=z;exports.PdfSafetyLimitError=R;exports.PivotHeaderPresentationError=I;exports.arrayToCSV=h;exports.arrayToCSVRow=b;exports.escapeCSVValue=C;exports.formatAggregateGrandTotalLabel=O;exports.formatAggregateGroupCell=Z;exports.formatAggregateGroupRow=ee;exports.formatAggregateSubtotalLabel=F;exports.formatMetricComparison=$;exports.isAggregateTotalMemberMarker=p;exports.objectsToCSV=N;exports.presentAggregateGroupRow=E;exports.presentPivotHeader=re;exports.protectCSVText=U;exports.readPdfErrorResponse=x;exports.requestStructuredPdf=W;exports.requiresChunkedCsvExport=K;exports.resolveAggregateTablePresentationContext=J;exports.shouldPresentAggregateGroupValue=Q;exports.shouldPresentGroupedTableValue=P;
|