@stlite/desktop 0.99.2 → 0.100.0
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/CHANGELOG.md +21 -0
- package/bin/dump_artifacts.js +37 -37
- package/build/assets/{ArrowVegaLiteChart-B-Kd_jPH-Biiko0Ef.js → ArrowVegaLiteChart-AuhdMhKC-SeC_gJ-J.js} +1 -1
- package/build/assets/{Audio-B5gtg70U-Bh9tGjUY.js → Audio-MPOURgx8-aU_D4eY9.js} +1 -1
- package/build/assets/{AudioInput-CgFzLi-y-C8cmY_cr.js → AudioInput-D-1IugfD-BGplNYfL.js} +1 -1
- package/build/assets/{Balloons-CqQICrNd-BGoQrXhe.js → Balloons-C0le0djA-Rl3P1-Qw.js} +1 -1
- package/build/assets/{BidiComponent-CkI6DfPr-CbrqDKKX.js → BidiComponent-BsO32qTF-CaRsffwV.js} +1 -1
- package/build/assets/{Button-BOmzB5Yb-Bpnf-WZl.js → Button-AgVrhiWW-CQ3htb45.js} +1 -1
- package/build/assets/{ButtonGroup-C5sVTynN-DPa0Tx1x.js → ButtonGroup-DhgjbbBB-UV1LCvdW.js} +1 -1
- package/build/assets/{CameraInput-C1f0GN0n-Bo12mEPo.js → CameraInput-CEJ0-YBv-CmSkei37.js} +1 -1
- package/build/assets/{ChatInput-ClqoaQw2-PqG4grVV.js → ChatInput-C2YGDsKa-C1FEQeOd.js} +1 -1
- package/build/assets/{Checkbox-ClzElazy-D-AYf8eH.js → Checkbox-DpcMXROE-DSO9dPZW.js} +1 -1
- package/build/assets/{ColorPicker-mCkrAGPa-CtUHNwYp.js → ColorPicker-DfcSCXdu-BA37Ck4e.js} +1 -1
- package/build/assets/{ComponentInstance-B_1vn-IY-BM9ElpU6.js → ComponentInstance-CZJj3rmu-NhIcYIOG.js} +1 -1
- package/build/assets/{DataFrame-CXPcdw96-Crfv7wfu.js → DataFrame-BARAH3XB-CnqwPbPm.js} +5 -5
- package/build/assets/{DateInput-DzaFFasw-CiMjvLKg.js → DateInput-dJ0HrH9I-DL8FHvR-.js} +1 -1
- package/build/assets/{DateTimeInput-WmD8vSCU-K1wv6LRy.js → DateTimeInput-Dc_pZKKa-C7OxzebL.js} +1 -1
- package/build/assets/{DeckGlJsonChart-CDmFrnUQ-CKLXTmyf.js → DeckGlJsonChart-dSij3LC8-z_q2cC3l.js} +1 -1
- package/build/assets/{DownloadButton-g54AS0W2-qOKvF9wp.js → DownloadButton-5Bz1-AC5-BKem2rXk.js} +1 -1
- package/build/assets/{ErrorOutline.esm-B1NqpuZN-D4cKYVYX.js → ErrorOutline.esm-BskdUBnE-7qRVaCY5.js} +1 -1
- package/build/assets/{Feedback-DTXGrEzp-Dd_SGEH7.js → Feedback-CQYxHKC--CSr7C1Wx.js} +1 -1
- package/build/assets/{FileDownload.esm-B_usFfyI-DvbGAuNe.js → FileDownload.esm-r6GccJGR-bDEy_L2M.js} +1 -1
- package/build/assets/{FileUploader-CzCdIxed-CWWB6xZB.js → FileUploader-CFj8fg_u-D1JfDby-.js} +1 -1
- package/build/assets/{FormSubmitContent-CstMuKlS-CwJlipqn.js → FormSubmitContent-RGGkQf1N-DmLXheJT.js} +1 -1
- package/build/assets/{GraphVizChart-nJ8rg3sZ-B_FsOCth.js → GraphVizChart-BKutiaGH-CUH7s5dq.js} +1 -1
- package/build/assets/{Html-CkFoh4ns-BXVZGZ2C.js → Html-D45ILBvq-DbWAwYlg.js} +1 -1
- package/build/assets/{IFrame-BklekJPV-_sg-kw0j.js → IFrame-DK-NJrL7-0m_xaaau.js} +1 -1
- package/build/assets/{ImageList-l3ue-eW1-CIwYKSdj.js → ImageList-I3kPNHfL-D4nqsHeP.js} +1 -1
- package/build/assets/{InputInstructions-C3LBp4_M-BIHPK8ho.js → InputInstructions-C-Zf4oQL-DB03cpCg.js} +1 -1
- package/build/assets/{Json-DmaVI2eK-CplwjZhb.js → Json-DSgvYeF6-CGGD4AZF.js} +1 -1
- package/build/assets/{LinkButton-D87rEwzB-C31w_f7c.js → LinkButton-DLHHsxjM-CI62E9Lm.js} +1 -1
- package/build/assets/{MenuButton-DCWYT9Sm-Cjs_mH64.js → MenuButton-Oq8rRct9-ZWaMUcpm.js} +1 -1
- package/build/assets/{Metric-B85kD6qx-D6Bt_A2_.js → Metric-B0YF468a-CFi-iNGW.js} +1 -1
- package/build/assets/{Multiselect-Dj9HMUjc-C1tpZV37.js → Multiselect-CVHVCj3g-BAkweYLb.js} +1 -1
- package/build/assets/{NumberInput-Bz1Z4Olo-HwfUQwvD.js → NumberInput-eLkJ0pTb-Bm92Kd3x.js} +1 -1
- package/build/assets/{PageLink-DxIPOlCu-CAX1QvMp.js → PageLink--V5rxSOF-BYF5Fo3G.js} +1 -1
- package/build/assets/{Particles-CgV8FzZe-CZFoM1Ot.js → Particles-DDLlrLpr-LgL3KDiE.js} +1 -1
- package/build/assets/{PlotlyChart-DApJXgoh-msWOSLU2.js → PlotlyChart-BVhQF5xf-Bvz7Dcax.js} +1 -1
- package/build/assets/{Progress-DXRywIcj-D00Siwwp.js → Progress-BokEk05X-Bv2QkIp3.js} +1 -1
- package/build/assets/{ProgressBar-By08lmvS-BN2oE7g_.js → ProgressBar-Buvlf_pb-DyD7N0tJ.js} +1 -1
- package/build/assets/{Radio-DZEQy4hT-Cx0uGU2K.js → Radio-CUrfrjvU-B2myln1A.js} +1 -1
- package/build/assets/{Selectbox-BywNaXj9-EovVNC_I.js → Selectbox-DwkeQO0S-BhQZidV7.js} +1 -1
- package/build/assets/{Slider-sLEYxDUG-Bby7yVsF.js → Slider--afJTFYr-thOxe-ly.js} +1 -1
- package/build/assets/{Snow-MxXLnUX_-CCUTgEUd.js → Snow-dqZuIKEv-DME-mG7b.js} +1 -1
- package/build/assets/{Spinner-D-YJYPV5-qoM-yuRL.js → Spinner-Bk-w9tKQ-Bwm_Vk6T.js} +1 -1
- package/build/assets/{StreamlitSyntaxHighlighter-y_BJ441X-Do55UoZC.js → StreamlitSyntaxHighlighter-U8o3ATK--CsLsQIfZ.js} +1 -1
- package/build/assets/{Table-ah-SFAz4-BuzfN8wv.js → Table-JcIvdLi_-D87CQj8k.js} +1 -1
- package/build/assets/{TableChart.esm-x67iDGlj-hZSJidLi.js → TableChart.esm-Dpji9oSF-DM4jytuW.js} +1 -1
- package/build/assets/{TextArea-COwbG28l-yfu63ssv.js → TextArea-DnpuYIA5-BF6b1Uz8.js} +1 -1
- package/build/assets/{TextInput-CPqz-18c-DPGxqoCs.js → TextInput-BOxdqnrF-BhQogAHg.js} +1 -1
- package/build/assets/{TimeInput-BQ-fP8Yi-FMCqKedu.js → TimeInput-CjU6O1Hm-BfH2ACHB.js} +1 -1
- package/build/assets/{Toast-CGUHIZQI-39x9j5Rs.js → Toast-Dxo0ZqMx-ZaDpGanl.js} +1 -1
- package/build/assets/{Video-CWomx7KF-nGUBPGaY.js → Video-CYwcC1JG-ulcwxNbn.js} +1 -1
- package/build/assets/{WidgetLabel-DUaobbKW-DD-xWyXR.js → WidgetLabel-DTUHhtk_-EPIQC9md.js} +1 -1
- package/build/assets/{WidgetLabelHelpIcon-Dk_Qm9_8-CtMOr4fX.js → WidgetLabelHelpIcon-CfpOYjLN-CUGwBOM8.js} +1 -1
- package/build/assets/{WidgetLabelHelpIconInline-CkTH9muE-i_BwkvTR.js → WidgetLabelHelpIconInline-D4j09uRD-MZxp3LdE.js} +1 -1
- package/build/assets/{_baseAssignValue-DbpQ8D1L-D2c_-zPN.js → _baseAssignValue-CBJGGLCx-DiCzbxPi.js} +1 -1
- package/build/assets/{base-input-CUlWnT-V-BhBQbzWk.js → base-input-YEUHRI4X-r3jc5z5D.js} +1 -1
- package/build/assets/{checkbox-CEu7IJmq-3LmskyhR.js → checkbox-iHgvbvtl-BQg_ZqeS.js} +1 -1
- package/build/assets/{constants-BFZIinC9-BhIl5GAK.js → constants-PqcOHKIA-Am2_uapM.js} +1 -1
- package/build/assets/{createDownloadLinkElement-CO9Q-pa0-BNUtAwjF.js → createDownloadLinkElement-CwAYcc1e-DbJb0I6l.js} +1 -1
- package/build/assets/{createSuper-CPupKoXU-C5x8b8jJ.js → createSuper-DwpxHxg4-FoILwayq.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-D7_bQukB-DqAp5wnt.js → data-grid-overlay-editor-CLo-w1F9-B0x2Sg0-.js} +1 -1
- package/build/assets/{downloader-CZ7qD7NY-DGAnDDXL.js → downloader-CZ7qD7NY-Df1O1edF.js} +1 -1
- package/build/assets/{embed-Dc8baQ26-DAsqJZrc.js → embed-Dq8jQdGh-CBVvTzpb.js} +1 -1
- package/build/assets/{es6-BxevHr5y-DDD2E1qH.js → es6-BxevHr5y-BuJv1L-s.js} +2 -2
- package/build/assets/{formatNumber-DxMjoq14-D-XVTuz9.js → formatNumber-DefaFHuv-BSZLG6Yx.js} +1 -1
- package/build/assets/{iconPosition-9UgvX_TD-BzkVt95G.js → iconPosition-BPGPKkjQ-DDZxDFyf.js} +1 -1
- package/build/assets/{iframeResizer.contentWindow-CCqu70r3-2dQhJjwY.js → iframeResizer.contentWindow-bVTYWYos-CjhKIaGT.js} +1 -1
- package/build/assets/{index-BV2WTlzI-BDu7x5w-.js → index-BxCkce84-CXTDYP74.js} +1 -1
- package/build/assets/{index-DJf52eor.js → index-CHE20_1-.js} +6 -6
- package/build/assets/{index-CDNzkMOW-Ci5P-rfD.js → index-CeKcUppy-CpcuvBWq.js} +1 -1
- package/build/assets/{index-Co96_X1M-Dl06Rnsd.js → index-D1kjTmWN-D-hzXEqP.js} +1 -1
- package/build/assets/{index-BoaYS_fk-BOYhDwkq.js → index-DJIbJyKa-D4FORpfO.js} +1 -1
- package/build/assets/{index-CJ4tMOMA-DwN410du.js → index-I7jKEriY-B-n9NbT_.js} +1 -1
- package/build/assets/{input-HUYzfsf9-BxmLV7Ek.js → input-YNBnpJ12-038QD4s4.js} +1 -1
- package/build/assets/{memory-C-LDMFc2-DmYLyk9H.js → memory-C-LDMFc2-CpCm65Br.js} +1 -1
- package/build/assets/{number-overlay-editor-BQXyYsVn-Dh7S4LVs.js → number-overlay-editor-Cdnv58wS-HWHegkI_.js} +1 -1
- package/build/assets/{pandasStylerUtils-BVB-ECxE-CDURxvwo.js → pandasStylerUtils-DjDsh9Sw-f2V2gA5b.js} +1 -1
- package/build/assets/{possibleConstructorReturn-YeRoNy63-B2FGD3ja.js → possibleConstructorReturn-p-fKXom_-BPFgGBwd.js} +1 -1
- package/build/assets/{reactJsonViewCompat-CeSrJm8p-le930912.js → reactJsonViewCompat-gGOZBlvq-BHD6wBsT.js} +1 -1
- package/build/assets/{sandbox-DbnteG5V-yqy_7sO8.js → sandbox-DbnteG5V-DKMo4DSb.js} +1 -1
- package/build/assets/{select-haj_e3M_-P2nevO2w.js → select-DbfjugKJ-C8EDw3eO.js} +1 -1
- package/build/assets/{sprintfjs-DwuHM96D-Dbm-A0ro.js → sprintfjs-D5kvUrjM--36qIaY-.js} +1 -1
- package/build/assets/{stateful-menu-DhWFcRsJ-hkmyKt6q.js → stateful-menu-DsDbGVB_-C8xJ2Uve.js} +1 -1
- package/build/assets/{styled-components-BwoIjXty-eQCTyKeV.js → styled-components-BsL0GiBO-C2azWTC8.js} +1 -1
- package/build/assets/{styled-components-CggDa8xh-DRn7YfuV.js → styled-components-CZ4GSHz4-BVEj2YLE.js} +1 -1
- package/build/assets/{styled-components-CRl5ROSi-CaifWlLZ.js → styled-components-aeDchaOw-CDmV3dyQ.js} +1 -1
- package/build/assets/{timepicker-t1TdfIJG-CM4-XB8w.js → timepicker-BIFo5a1u-DTWDwWXK.js} +1 -1
- package/build/assets/{toConsumableArray-DtFGUM3A-BLxO6YGd.js → toConsumableArray-BJ_-nsuo-BPUSYd8M.js} +1 -1
- package/build/assets/{useBasicWidgetState-Bd8NTj87-Cqs9ZQAV.js → useBasicWidgetState-oLSfk0mv-C-D-ncQp.js} +1 -1
- package/build/assets/{useIntlLocale-CXWYgGQX-B2q3sAu2.js → useIntlLocale-BELAEOpY-BzvvmoUT.js} +1 -1
- package/build/assets/{useSelectCommon-O2yZsfjb-6cuQoolB.js → useSelectCommon-_ffsRexw-DbdQDzQX.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-BTuNAk3V-5wcrsLsu.js → useTextInputAutoExpand-Coetw41P-BCx9E5Py.js} +1 -1
- package/build/assets/{useUpdateUiValue-B574r2my-B36XHNQq.js → useUpdateUiValue-CAsGHNl5-wS4IfynZ.js} +1 -1
- package/build/assets/{useWaveformController-EemjKAv5-CT3VAgB8.js → useWaveformController-B-n3rX5g-BppMHOmS.js} +1 -1
- package/build/assets/{utils-DNbZWtPr-BHo82ec1.js → utils-CzD7XIpv-COJ6XrrX.js} +1 -1
- package/build/assets/{withCalculatedWidth-CswVJ4Re-BeXEmgBt.js → withCalculatedWidth-nNNFed9I-Fzz_WpIw.js} +1 -1
- package/build/assets/{withFullScreenWrapper-CKo__VbV-B1HqecCF.js → withFullScreenWrapper-jebSlaHO-C2WriMN7.js} +1 -1
- package/build/electron/main.js +2 -2
- package/build/electron/manifest.js +1 -0
- package/build/index.html +1 -1
- package/package.json +6 -5
- package/wheels/streamlit-1.56.0-cp313-none-any.whl +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,N as X,dd as bt,a5 as yt,i as rt,j as C,aw as xt,al as Mt,de as kt,cO as Ct,av as St,ax as Dt,z as vt,a6 as U,b9 as Tt,w as Pt}from"./index-DJf52eor.js";import{l as T}from"./moment-C29_LcvN-BY3oO1nk.js";import{m as Yt}from"./WidgetLabel-DUaobbKW-DD-xWyXR.js";import{j as Et}from"./WidgetLabelHelpIcon-Dk_Qm9_8-CtMOr4fX.js";import{N as Wt}from"./useBasicWidgetState-Bd8NTj87-Cqs9ZQAV.js";import{P as $t,V as Ht,p as Bt,m as Lt}from"./useIntlLocale-CXWYgGQX-B2q3sAu2.js";import{i as Nt}from"./ErrorOutline.esm-B1NqpuZN-D4cKYVYX.js";import"./styled-components-BwoIjXty-eQCTyKeV.js";import"./select-haj_e3M_-P2nevO2w.js";import"./constants-BFZIinC9-BhIl5GAK.js";import"./stateful-menu-DhWFcRsJ-hkmyKt6q.js";import"./timepicker-t1TdfIJG-CM4-XB8w.js";import"./possibleConstructorReturn-YeRoNy63-B2FGD3ja.js";import"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import"./createSuper-CPupKoXU-C5x8b8jJ.js";import"./input-HUYzfsf9-BxmLV7Ek.js";import"./base-input-CUlWnT-V-BhBQbzWk.js";const ot=6048e5,Ot=864e5,V=Symbol.for("constructDateFrom");function M(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&V in e?e[V](t):e instanceof Date?new e.constructor(t):new Date(t)}function w(e,t){return M(t||e,e)}let zt={};function O(){return zt}function B(e,t){const n=O(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=w(e,t?.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function N(e,t){return B(e,{...t,weekStartsOn:1})}function at(e,t){const n=w(e,t?.in),r=n.getFullYear(),o=M(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=N(o),s=M(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const l=N(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function K(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 qt(e,...t){const n=M.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Z(e,t){const n=w(e,t?.in);return n.setHours(0,0,0,0),n}function Ft(e,t,n){const[r,o]=qt(n?.in,e,t),a=Z(r),s=Z(o),l=+a-K(a),f=+s-K(s);return Math.round((l-f)/Ot)}function Rt(e,t){const n=at(e,t),r=M(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),N(r)}function It(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jt(e){return!(!It(e)&&typeof e!="number"||isNaN(+w(e)))}function Gt(e,t){const n=w(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function At(e,t){const n=w(e,t?.in);return Ft(n,Gt(n))+1}function Qt(e,t){const n=w(e,t?.in),r=+N(n)-+Rt(n);return Math.round(r/ot)+1}function it(e,t){const n=w(e,t?.in),r=n.getFullYear(),o=O(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=M(t?.in||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const l=B(s,t),f=M(t?.in||e,0);f.setFullYear(r,0,a),f.setHours(0,0,0,0);const y=B(f,t);return+n>=+l?r+1:+n>=+y?r:r-1}function Xt(e,t){const n=O(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=it(e,t),a=M(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),B(a,t)}function Ut(e,t){const n=w(e,t?.in),r=+B(n,t)-+Xt(n,t);return Math.round(r/ot)+1}function i(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const x={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return i(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):i(n+1,2)},d(e,t){return i(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return i(e.getHours()%12||12,t.length)},H(e,t){return i(e.getHours(),t.length)},m(e,t){return i(e.getMinutes(),t.length)},s(e,t){return i(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return i(o,t.length)}},v={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_={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"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return x.y(e,t)},Y:function(e,t,n,r){const o=it(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return i(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):i(a,t.length)},R:function(e,t){const n=at(e);return i(n,t.length)},u:function(e,t){const n=e.getFullYear();return i(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 i(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"});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 i(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"});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 x.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"});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 i(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Ut(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):i(o,t.length)},I:function(e,t,n){const r=Qt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):i(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):x.d(e,t)},D:function(e,t,n){const r=At(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):i(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return i(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return i(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return i(o,t.length);case"io":return n.ordinalNumber(o,{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"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=v.noon:r===0?o=v.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=v.evening:r>=12?o=v.afternoon:r>=4?o=v.morning:o=v.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{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 x.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):x.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):i(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):i(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):x.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):x.s(e,t)},S:function(e,t){return x.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tt(r);case"XXXX":case"XX":return S(r);default:return S(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tt(r);case"xxxx":case"xx":return S(r);default:return S(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+J(r,":");default:return"GMT"+S(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+J(r,":");default:return"GMT"+S(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return i(r,t.length)},T:function(e,t,n){return i(+e,t.length)}};function J(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+i(a,2)}function tt(e,t){return e%60===0?(e>0?"-":"+")+i(Math.abs(e)/60,2):S(e,t)}function S(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=i(Math.trunc(r/60),2),a=i(r%60,2);return n+o+t+a}const et=(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"});default:return t.date({width:"full"})}},st=(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"});default:return t.time({width:"full"})}},Vt=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return et(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",et(r,t)).replace("{{time}}",st(o,t))},Kt={p:st,P:Vt},Zt=/^D+$/,_t=/^Y+$/,Jt=["D","DD","YY","YYYY"];function te(e){return Zt.test(e)}function ee(e){return _t.test(e)}function ne(e,t,n){const r=re(e,t,n);if(console.warn(r),Jt.includes(e))throw new RangeError(r)}function re(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 oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ie=/^'([^]*?)'?$/,se=/''/g,ue=/[a-zA-Z]/;function nt(e,t,n){const r=O(),o=n?.locale??r.locale??Lt,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=w(e,n?.in);if(!jt(l))throw new RangeError("Invalid time value");let f=t.match(ae).map(u=>{const m=u[0];if(m==="p"||m==="P"){const P=Kt[m];return P(u,o.formatLong)}return u}).join("").match(oe).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const m=u[0];if(m==="'")return{isToken:!1,value:ce(u)};if(_[m])return{isToken:!0,value:u};if(m.match(ue))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:u}});o.localize.preprocessor&&(f=o.localize.preprocessor(l,f));const y={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return f.map(u=>{if(!u.isToken)return u.value;const m=u.value;(!n?.useAdditionalWeekYearTokens&&ee(m)||!n?.useAdditionalDayOfYearTokens&&te(m))&&ne(m,t,String(e));const P=_[m[0]];return P(l,m,o.localize,y)}).join("")}function ce(e){const t=e.match(ie);return t?t[1].replace(se,"'"):e}const L="YYYY-MM-DD";function z(e){return e.map(t=>T(t,L).toDate())}function de(e){return e?e.map(t=>T(t).format(L)):[]}function le({disabled:e,element:t,widgetMgr:n,fragmentId:r}){const o=X(),a=d.useContext(bt),[s,l]=d.useState(!1),[f,y]=d.useState(null),u=d.useCallback(()=>{y(null)},[]),m=d.useCallback(()=>{u(),l(!1)},[u]),P=t.queryParamKey?{paramKey:t.queryParamKey,valueType:"string_array_value",clearable:t.default.length===0,urlFormat:t.isRange?"repeated":void 0}:void 0,[dt,Y]=Wt({getStateFromWidgetMgr:fe,getDefaultStateFromProto:me,getCurrStateFromProto:ge,updateWidgetMgrState:he,element:t,widgetMgr:n,fragmentId:r,queryParamBinding:P,formClearBehavior:"resetValueAndRunCallback",onFormCleared:m}),{colors:g,fontSizes:q,fontWeights:lt,lineHeights:A,spacing:b,sizes:h,zIndices:ft}=X(),{locale:mt}=d.useContext(yt),E=$t(mt),k=d.useMemo(()=>T(t.min,L).toDate(),[t.min]),D=d.useMemo(()=>ct(t),[t]),gt=d.useMemo(()=>{if(!t.isRange)return!1;const c=T().subtract(2,"years").toDate();return k<c},[t.isRange,k]),ht=t.default.length===0&&!e,F=d.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),W=d.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),R=d.useMemo(()=>nt(k,W,{locale:E}),[k,W,E]),I=d.useMemo(()=>D?nt(D,W,{locale:E}):"",[D,W,E]),Q=d.useCallback(c=>{if(!c)return null;if(t.isRange){const p=c==="End"?`before ${I}`:`after ${R}`;return`**Error**: ${c} date set outside allowed range. Please select a date ${p}.`}return`**Error**: Date set outside allowed range. Please select a date between ${R} and ${I}.`},[t.isRange,I,R]),pt=d.useCallback(({date:c})=>{if(u(),rt(c)){Y({value:[],fromUi:!0}),l(!0);return}const p=Array.isArray(c)?c.filter(j=>!!j).map(j=>G(j)):G(c),{errorType:$,newDates:H}=ut(p,k,D);$&&y(Q($)),Y({value:H,fromUi:!0}),l(!H)},[Q,D,k,u,y,Y]),wt=d.useCallback(()=>{if(!s)return;const c=z(t.default);Y({value:c,fromUi:!0}),l(!c)},[s,t,Y]);return C.jsxs("div",{className:"stDateInput","data-testid":"stDateInput",children:[C.jsx(Yt,{label:t.label,disabled:e,labelVisibility:xt(t.labelVisibility?.value),children:t.help&&C.jsx(Et,{content:t.help,label:t.label})}),C.jsx(Ht,{locale:E,density:Bt.high,formatString:W,mask:t.isRange?`${F} – ${F}`:F,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:pt,onClose:wt,quickSelect:gt,overrides:{Popover:{props:{ignoreBoundary:a,placement:Mt.bottomLeft,popoverMargin:Pt(o.spacing.twoXS),overrides:{Body:{style:{...Tt(o),...U(o)&&{borderWidth:o.spacing.none}}}}}},CalendarContainer:{style:{fontSize:q.sm,paddingRight:b.sm,paddingLeft:b.sm,paddingBottom:b.sm,paddingTop:b.sm,borderWidth:o.spacing.none}},Week:{style:{fontSize:q.sm}},Day:{style:({$pseudoHighlighted:c,$pseudoSelected:p,$selected:$,$isHovered:H})=>({fontSize:q.sm,lineHeight:A.base,"::before":{backgroundColor:$||p||c||H?`${g.darkenedBgMix15} !important`:g.transparent},"::after":{borderColor:g.transparent},...U(o)&&H&&p&&!$?{color:g.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:g.transparent},":focus":{backgroundColor:g.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:g.transparent},":focus":{backgroundColor:g.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:f&&C.jsx(Ct,{content:C.jsx(vt,{source:f,allowHTML:!1}),placement:St.TOP_RIGHT,error:!0,children:C.jsx(Dt,{content:Nt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:g.redTextColor,backgroundColor:g.transparent}},Root:{style:({$isFocused:c})=>{const p=kt(g,c);return{borderLeftWidth:h.borderWidth,borderRightWidth:h.borderWidth,borderTopWidth:h.borderWidth,borderBottomWidth:h.borderWidth,paddingRight:b.twoXS,borderTopColor:p,borderRightColor:p,borderBottomColor:p,borderLeftColor:p,...f&&{backgroundColor:g.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:g.grayTextColor,padding:b.threeXS,height:h.clearIconSize,width:h.clearIconSize,":hover":{fill:g.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{position:"relative",zIndex:ft.priority,fontWeight:lt.normal,paddingRight:b.sm,paddingLeft:`calc(${b.sm} + ${h.tagMarginInsideBorder})`,paddingBottom:b.sm,paddingTop:b.sm,lineHeight:A.inputWidget,"::placeholder":{color:g.fadedText60},...f&&{color:g.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:h.minElementHeight,borderLeftWidth:h.borderWidth,borderRightWidth:h.borderWidth,borderTopWidth:h.borderWidth,borderBottomWidth:h.borderWidth}}}}}},value:dt,minDate:k,maxDate:D,range:t.isRange,clearable:ht})]})}function fe(e,t){const n=e.getStringArrayValue(t);if(n!==void 0)return z(n)}function me(e){return z(e.default)??[]}function ge(e){return z(e.value)??[]}function he(e,t,n,r){const o=T(e.min,L).toDate(),a=ct(e);let s=!0;const l=(n.value||[]).map(y=>G(y)),{errorType:f}=ut(l,o,a);f&&(s=!1),s&&t.setStringArrayValue(e,de(n.value),{fromUi:n.fromUi},r)}function ut(e,t,n){const r=[];let o=null;return rt(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(a=>{a&&(n&&a>n?o="End":a<t&&(o="Start"),r.push(a))}):e&&(n&&e>n?o="End":e<t&&(o="Start"),r.push(e)),{errorType:o,newDates:r})}function ct(e){const t=e.max;return t&&t.length>0?T(t,L).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const He=d.memo(le);export{He as default};
|
|
1
|
+
import{r as d,N as X,dd as bt,a5 as yt,i as rt,j as C,aw as xt,al as Mt,de as kt,cO as Ct,av as St,ax as Dt,z as vt,a6 as U,b9 as Tt,w as Pt}from"./index-CHE20_1-.js";import{l as T}from"./moment-C29_LcvN-BY3oO1nk.js";import{m as Yt}from"./WidgetLabel-DTUHhtk_-EPIQC9md.js";import{j as Et}from"./WidgetLabelHelpIcon-CfpOYjLN-CUGwBOM8.js";import{N as Wt}from"./useBasicWidgetState-oLSfk0mv-C-D-ncQp.js";import{P as $t,V as Ht,p as Bt,m as Lt}from"./useIntlLocale-BELAEOpY-BzvvmoUT.js";import{i as Nt}from"./ErrorOutline.esm-BskdUBnE-7qRVaCY5.js";import"./styled-components-BsL0GiBO-C2azWTC8.js";import"./select-DbfjugKJ-C8EDw3eO.js";import"./constants-PqcOHKIA-Am2_uapM.js";import"./stateful-menu-DsDbGVB_-C8xJ2Uve.js";import"./timepicker-BIFo5a1u-DTWDwWXK.js";import"./possibleConstructorReturn-p-fKXom_-BPFgGBwd.js";import"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import"./createSuper-DwpxHxg4-FoILwayq.js";import"./input-YNBnpJ12-038QD4s4.js";import"./base-input-YEUHRI4X-r3jc5z5D.js";const ot=6048e5,Ot=864e5,V=Symbol.for("constructDateFrom");function M(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&V in e?e[V](t):e instanceof Date?new e.constructor(t):new Date(t)}function w(e,t){return M(t||e,e)}let zt={};function O(){return zt}function B(e,t){const n=O(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=w(e,t?.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function N(e,t){return B(e,{...t,weekStartsOn:1})}function at(e,t){const n=w(e,t?.in),r=n.getFullYear(),o=M(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=N(o),s=M(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const l=N(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function K(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 qt(e,...t){const n=M.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Z(e,t){const n=w(e,t?.in);return n.setHours(0,0,0,0),n}function Ft(e,t,n){const[r,o]=qt(n?.in,e,t),a=Z(r),s=Z(o),l=+a-K(a),f=+s-K(s);return Math.round((l-f)/Ot)}function Rt(e,t){const n=at(e,t),r=M(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),N(r)}function It(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jt(e){return!(!It(e)&&typeof e!="number"||isNaN(+w(e)))}function Gt(e,t){const n=w(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function At(e,t){const n=w(e,t?.in);return Ft(n,Gt(n))+1}function Qt(e,t){const n=w(e,t?.in),r=+N(n)-+Rt(n);return Math.round(r/ot)+1}function it(e,t){const n=w(e,t?.in),r=n.getFullYear(),o=O(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=M(t?.in||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const l=B(s,t),f=M(t?.in||e,0);f.setFullYear(r,0,a),f.setHours(0,0,0,0);const y=B(f,t);return+n>=+l?r+1:+n>=+y?r:r-1}function Xt(e,t){const n=O(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=it(e,t),a=M(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),B(a,t)}function Ut(e,t){const n=w(e,t?.in),r=+B(n,t)-+Xt(n,t);return Math.round(r/ot)+1}function i(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const x={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return i(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):i(n+1,2)},d(e,t){return i(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return i(e.getHours()%12||12,t.length)},H(e,t){return i(e.getHours(),t.length)},m(e,t){return i(e.getMinutes(),t.length)},s(e,t){return i(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return i(o,t.length)}},v={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_={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"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return x.y(e,t)},Y:function(e,t,n,r){const o=it(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return i(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):i(a,t.length)},R:function(e,t){const n=at(e);return i(n,t.length)},u:function(e,t){const n=e.getFullYear();return i(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 i(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"});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 i(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"});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 x.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"});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 i(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Ut(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):i(o,t.length)},I:function(e,t,n){const r=Qt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):i(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):x.d(e,t)},D:function(e,t,n){const r=At(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):i(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return i(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return i(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return i(o,t.length);case"io":return n.ordinalNumber(o,{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"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=v.noon:r===0?o=v.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=v.evening:r>=12?o=v.afternoon:r>=4?o=v.morning:o=v.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{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 x.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):x.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):i(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):i(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):x.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):x.s(e,t)},S:function(e,t){return x.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tt(r);case"XXXX":case"XX":return S(r);default:return S(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tt(r);case"xxxx":case"xx":return S(r);default:return S(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+J(r,":");default:return"GMT"+S(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+J(r,":");default:return"GMT"+S(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return i(r,t.length)},T:function(e,t,n){return i(+e,t.length)}};function J(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+i(a,2)}function tt(e,t){return e%60===0?(e>0?"-":"+")+i(Math.abs(e)/60,2):S(e,t)}function S(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=i(Math.trunc(r/60),2),a=i(r%60,2);return n+o+t+a}const et=(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"});default:return t.date({width:"full"})}},st=(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"});default:return t.time({width:"full"})}},Vt=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return et(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",et(r,t)).replace("{{time}}",st(o,t))},Kt={p:st,P:Vt},Zt=/^D+$/,_t=/^Y+$/,Jt=["D","DD","YY","YYYY"];function te(e){return Zt.test(e)}function ee(e){return _t.test(e)}function ne(e,t,n){const r=re(e,t,n);if(console.warn(r),Jt.includes(e))throw new RangeError(r)}function re(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 oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ie=/^'([^]*?)'?$/,se=/''/g,ue=/[a-zA-Z]/;function nt(e,t,n){const r=O(),o=n?.locale??r.locale??Lt,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=w(e,n?.in);if(!jt(l))throw new RangeError("Invalid time value");let f=t.match(ae).map(u=>{const m=u[0];if(m==="p"||m==="P"){const P=Kt[m];return P(u,o.formatLong)}return u}).join("").match(oe).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const m=u[0];if(m==="'")return{isToken:!1,value:ce(u)};if(_[m])return{isToken:!0,value:u};if(m.match(ue))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:u}});o.localize.preprocessor&&(f=o.localize.preprocessor(l,f));const y={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return f.map(u=>{if(!u.isToken)return u.value;const m=u.value;(!n?.useAdditionalWeekYearTokens&&ee(m)||!n?.useAdditionalDayOfYearTokens&&te(m))&&ne(m,t,String(e));const P=_[m[0]];return P(l,m,o.localize,y)}).join("")}function ce(e){const t=e.match(ie);return t?t[1].replace(se,"'"):e}const L="YYYY-MM-DD";function z(e){return e.map(t=>T(t,L).toDate())}function de(e){return e?e.map(t=>T(t).format(L)):[]}function le({disabled:e,element:t,widgetMgr:n,fragmentId:r}){const o=X(),a=d.useContext(bt),[s,l]=d.useState(!1),[f,y]=d.useState(null),u=d.useCallback(()=>{y(null)},[]),m=d.useCallback(()=>{u(),l(!1)},[u]),P=t.queryParamKey?{paramKey:t.queryParamKey,valueType:"string_array_value",clearable:t.default.length===0,urlFormat:t.isRange?"repeated":void 0}:void 0,[dt,Y]=Wt({getStateFromWidgetMgr:fe,getDefaultStateFromProto:me,getCurrStateFromProto:ge,updateWidgetMgrState:he,element:t,widgetMgr:n,fragmentId:r,queryParamBinding:P,formClearBehavior:"resetValueAndRunCallback",onFormCleared:m}),{colors:g,fontSizes:q,fontWeights:lt,lineHeights:A,spacing:b,sizes:h,zIndices:ft}=X(),{locale:mt}=d.useContext(yt),E=$t(mt),k=d.useMemo(()=>T(t.min,L).toDate(),[t.min]),D=d.useMemo(()=>ct(t),[t]),gt=d.useMemo(()=>{if(!t.isRange)return!1;const c=T().subtract(2,"years").toDate();return k<c},[t.isRange,k]),ht=t.default.length===0&&!e,F=d.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),W=d.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),R=d.useMemo(()=>nt(k,W,{locale:E}),[k,W,E]),I=d.useMemo(()=>D?nt(D,W,{locale:E}):"",[D,W,E]),Q=d.useCallback(c=>{if(!c)return null;if(t.isRange){const p=c==="End"?`before ${I}`:`after ${R}`;return`**Error**: ${c} date set outside allowed range. Please select a date ${p}.`}return`**Error**: Date set outside allowed range. Please select a date between ${R} and ${I}.`},[t.isRange,I,R]),pt=d.useCallback(({date:c})=>{if(u(),rt(c)){Y({value:[],fromUi:!0}),l(!0);return}const p=Array.isArray(c)?c.filter(j=>!!j).map(j=>G(j)):G(c),{errorType:$,newDates:H}=ut(p,k,D);$&&y(Q($)),Y({value:H,fromUi:!0}),l(!H)},[Q,D,k,u,y,Y]),wt=d.useCallback(()=>{if(!s)return;const c=z(t.default);Y({value:c,fromUi:!0}),l(!c)},[s,t,Y]);return C.jsxs("div",{className:"stDateInput","data-testid":"stDateInput",children:[C.jsx(Yt,{label:t.label,disabled:e,labelVisibility:xt(t.labelVisibility?.value),children:t.help&&C.jsx(Et,{content:t.help,label:t.label})}),C.jsx(Ht,{locale:E,density:Bt.high,formatString:W,mask:t.isRange?`${F} – ${F}`:F,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:pt,onClose:wt,quickSelect:gt,overrides:{Popover:{props:{ignoreBoundary:a,placement:Mt.bottomLeft,popoverMargin:Pt(o.spacing.twoXS),overrides:{Body:{style:{...Tt(o),...U(o)&&{borderWidth:o.spacing.none}}}}}},CalendarContainer:{style:{fontSize:q.sm,paddingRight:b.sm,paddingLeft:b.sm,paddingBottom:b.sm,paddingTop:b.sm,borderWidth:o.spacing.none}},Week:{style:{fontSize:q.sm}},Day:{style:({$pseudoHighlighted:c,$pseudoSelected:p,$selected:$,$isHovered:H})=>({fontSize:q.sm,lineHeight:A.base,"::before":{backgroundColor:$||p||c||H?`${g.darkenedBgMix15} !important`:g.transparent},"::after":{borderColor:g.transparent},...U(o)&&H&&p&&!$?{color:g.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:g.transparent},":focus":{backgroundColor:g.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:g.transparent},":focus":{backgroundColor:g.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:f&&C.jsx(Ct,{content:C.jsx(vt,{source:f,allowHTML:!1}),placement:St.TOP_RIGHT,error:!0,children:C.jsx(Dt,{content:Nt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:g.redTextColor,backgroundColor:g.transparent}},Root:{style:({$isFocused:c})=>{const p=kt(g,c);return{borderLeftWidth:h.borderWidth,borderRightWidth:h.borderWidth,borderTopWidth:h.borderWidth,borderBottomWidth:h.borderWidth,paddingRight:b.twoXS,borderTopColor:p,borderRightColor:p,borderBottomColor:p,borderLeftColor:p,...f&&{backgroundColor:g.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:g.grayTextColor,padding:b.threeXS,height:h.clearIconSize,width:h.clearIconSize,":hover":{fill:g.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{position:"relative",zIndex:ft.priority,fontWeight:lt.normal,paddingRight:b.sm,paddingLeft:`calc(${b.sm} + ${h.tagMarginInsideBorder})`,paddingBottom:b.sm,paddingTop:b.sm,lineHeight:A.inputWidget,"::placeholder":{color:g.fadedText60},...f&&{color:g.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:h.minElementHeight,borderLeftWidth:h.borderWidth,borderRightWidth:h.borderWidth,borderTopWidth:h.borderWidth,borderBottomWidth:h.borderWidth}}}}}},value:dt,minDate:k,maxDate:D,range:t.isRange,clearable:ht})]})}function fe(e,t){const n=e.getStringArrayValue(t);if(n!==void 0)return z(n)}function me(e){return z(e.default)??[]}function ge(e){return z(e.value)??[]}function he(e,t,n,r){const o=T(e.min,L).toDate(),a=ct(e);let s=!0;const l=(n.value||[]).map(y=>G(y)),{errorType:f}=ut(l,o,a);f&&(s=!1),s&&t.setStringArrayValue(e,de(n.value),{fromUi:n.fromUi},r)}function ut(e,t,n){const r=[];let o=null;return rt(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(a=>{a&&(n&&a>n?o="End":a<t&&(o="Start"),r.push(a))}):e&&(n&&e>n?o="End":e<t&&(o="Start"),r.push(e)),{errorType:o,newDates:r})}function ct(e){const t=e.max;return t&&t.length>0?T(t,L).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const He=d.memo(le);export{He as default};
|
package/build/assets/{DateTimeInput-WmD8vSCU-K1wv6LRy.js → DateTimeInput-Dc_pZKKa-C7OxzebL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,N as Q,dd as ee,ba as te,cy as re,a5 as oe,j as u,aw as ne,i as ie,w as T,al as ae,b9 as I,de as $,cO as se,av as le,ax as de,z as me,a6 as k}from"./index-
|
|
1
|
+
import{r as i,N as Q,dd as ee,ba as te,cy as re,a5 as oe,j as u,aw as ne,i as ie,w as T,al as ae,b9 as I,de as $,cO as se,av as le,ax as de,z as me,a6 as k}from"./index-CHE20_1-.js";import{l as z}from"./moment-C29_LcvN-BY3oO1nk.js";import{m as pe}from"./WidgetLabel-DTUHhtk_-EPIQC9md.js";import{j as ge}from"./WidgetLabelHelpIcon-CfpOYjLN-CUGwBOM8.js";import{P as ce,V as ue,p as he}from"./useIntlLocale-BELAEOpY-BzvvmoUT.js";import{N as be}from"./useBasicWidgetState-oLSfk0mv-C-D-ncQp.js";import{B as fe,m as ye}from"./styled-components-aeDchaOw-CDmV3dyQ.js";import{Z as Ce}from"./select-DbfjugKJ-C8EDw3eO.js";import{i as ve}from"./ErrorOutline.esm-BskdUBnE-7qRVaCY5.js";import"./styled-components-BsL0GiBO-C2azWTC8.js";import"./timepicker-BIFo5a1u-DTWDwWXK.js";import"./possibleConstructorReturn-p-fKXom_-BPFgGBwd.js";import"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import"./createSuper-DwpxHxg4-FoILwayq.js";import"./stateful-menu-DsDbGVB_-C8xJ2Uve.js";import"./input-YNBnpJ12-038QD4s4.js";import"./base-input-YEUHRI4X-r3jc5z5D.js";import"./constants-PqcOHKIA-Am2_uapM.js";import"./styled-components-CZ4GSHz4-BVEj2YLE.js";const xe=fe(ye),Se=({theme:e,isInSidebar:t,step:r,minTime:p,maxTime:h,disabled:g,clearable:b,error:a,scrollbarGutterSize:C,windowHeight:w})=>{const v=Math.ceil(86400/r),o=T(e.sizes.dropdownItemHeight),f=Math.min(T(e.sizes.maxDropdownHeight),w*.7),M=v*o>f;return{Popover:{props:{ignoreBoundary:t,placement:ae.bottomLeft,popoverMargin:T(e.spacing.twoXS),overrides:{Body:{style:{...I(e),...k(e)&&{borderWidth:e.spacing.none}}}}}},CalendarContainer:{style:{fontSize:e.fontSizes.sm,paddingRight:e.spacing.sm,paddingLeft:e.spacing.sm,paddingBottom:e.spacing.none,paddingTop:e.spacing.sm,borderWidth:e.spacing.none}},Week:{style:{fontSize:e.fontSizes.sm}},Day:{style:({$pseudoHighlighted:c,$pseudoSelected:n,$selected:y,$isHovered:x})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,"::before":{backgroundColor:y||n||c||x?`${e.colors.darkenedBgMix15} !important`:e.colors.transparent},"::after":{borderColor:e.colors.transparent},...k(e)&&x&&n&&!y?{color:e.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:e.colors.transparent},":focus":{backgroundColor:e.colors.transparent,outline:0}})},NextButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:e.colors.transparent},":focus":{backgroundColor:e.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:a&&u.jsx(se,{content:u.jsx(me,{source:a,allowHTML:!1}),placement:le.TOP_RIGHT,error:!0,children:u.jsx(de,{content:ve,size:"lg"})}),overrides:{EndEnhancer:{style:{color:a?e.colors.redTextColor:e.colors.grayTextColor,backgroundColor:e.colors.transparent}},Root:{style:({$isFocused:c})=>{const n=$(e.colors,c);return{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingRight:e.spacing.twoXS,borderTopColor:n,borderRightColor:n,borderBottomColor:n,borderLeftColor:n,...a&&{backgroundColor:e.colors.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.grayTextColor,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,":hover":{fill:e.colors.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:e.fontWeights.normal,paddingRight:e.spacing.sm,paddingLeft:`calc(${e.spacing.sm} + ${e.sizes.tagMarginInsideBorder})`,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,lineHeight:e.lineHeights.inputWidget,"::placeholder":{color:e.colors.fadedText60},...a&&{color:e.colors.redTextColor}},props:{"data-testid":"stDateTimeInputField"}}}}},TimeSelectContainer:{style:{paddingTop:e.spacing.none,paddingBottom:e.spacing.none}},TimeSelectFormControl:{style:{marginBottom:e.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:r,format:"24",disabled:g,nullable:b,minTime:p,maxTime:h,overrides:{Select:{props:{disabled:g,overrides:{ControlContainer:{style:({$isFocused:c})=>{const n=$(e.colors,c);return{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:n,borderRightColor:n,borderBottomColor:n,borderLeftColor:n}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ValueContainer:{style:()=>({lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:`calc(${e.spacing.sm} + ${e.sizes.tagMarginInsideBorder})`,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm})},SingleValue:{style:{fontWeight:e.fontWeights.normal,marginLeft:e.spacing.none},props:{"data-testid":"stDateTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingLeft:e.spacing.none,paddingRight:e.spacing.none,boxShadow:"none",maxHeight:`min(${e.sizes.maxDropdownHeight}, 70vh)`,"--scrollbar-gutter-size":M?`${C}px`:"0px"})},DropdownContainer:{style:()=>({...I(e),overflow:"hidden"})},DropdownListItem:{component:xe},Popover:{props:{ignoreBoundary:t,popoverMargin:T(e.spacing.twoXS),overrides:{Body:{style:()=>({overflow:"hidden"})}}}},Placeholder:{style:()=>({color:e.colors.fadedText60,position:"absolute"})},Input:{style:{position:"relative",zIndex:e.zIndices.priority}},SelectArrow:{component:Ce,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}}}}}}}}}},j="YYYY-MM-DDTHH:mm",P=(e,t)=>{const r=e.getStringArrayValue(t);if(r!==void 0)return r.length>0?r[0]:null},W=e=>e.default?.length?e.default[0]:null,L=e=>e.value?.length?e.value[0]:null,Y=e=>{let t;if(Array.isArray(e)?t=e.find(p=>p instanceof Date):t=e,!t||Number.isNaN(t.getTime()))return null;const r=new Date(t.getTime());return r.setSeconds(0,0),r},Te="YYYY/MM/DD, HH:mm",ze=[j,Te],m=e=>{if(ie(e)||e==="")return null;const t=z(e,ze,!0);return t.isValid()?Y(t.toDate()):null},R=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),V=(e,t)=>{const r=new Date(e.getTime());return r.setHours(t.getHours(),t.getMinutes(),0,0),r},we=(e,t,r,p)=>{const h=m(e.min),g=m(e.max),b=a=>{t.setStringArrayValue(e,a?[a]:[],{fromUi:r.fromUi},p)};if(r.value){const a=m(r.value);if(a){h&&a<h||g&&a>g||b(r.value);return}}b(r.value)};function Me({disabled:e,element:t,widgetMgr:r,fragmentId:p}){const h=Q(),g=i.useContext(ee),b=te(),{innerHeight:a}=re(),C=i.useRef(null),w=t.queryParamKey?{paramKey:t.queryParamKey,valueType:"string_array_value",clearable:t.default.length===0}:void 0,v=()=>{const d=P(r,t)??(t.setValue?L(t):W(t));return m(d)},[o,f]=i.useState(v),[M,c]=i.useState(v),[n,y]=be({getStateFromWidgetMgr:P,getDefaultStateFromProto:W,getCurrStateFromProto:L,updateWidgetMgrState:we,element:t,widgetMgr:r,fragmentId:p,queryParamBinding:w,formClearBehavior:"resetValueAndRunCallback",onFormCleared:i.useCallback(()=>{f(m(W(t)))},[t])}),{locale:x}=i.useContext(oe),A=ce(x),E=t.step?Number(t.step):900,s=i.useMemo(()=>m(t.min),[t.min]),l=i.useMemo(()=>m(t.max),[t.max]),D=i.useMemo(()=>m(n),[n]);D!==M&&(f(D),c(D));const F=s??void 0,N=l??void 0,G=i.useMemo(()=>{if(!(!o||!s))return R(o,s)?V(o,s):void 0},[o,s]),U=i.useMemo(()=>{if(!(!o||!l))return R(o,l)?V(o,l):void 0},[o,l]),X=t.format.replaceAll(/[a-zA-Z]/g,"9"),S=`${t.format.replaceAll("Y","y").replaceAll("D","d")}, HH:mm`,q=`${X}, 99:99`,K=`${t.format}, HH:MM`,B=(t.default&&t.default.length>0?t.default[0]:"").length===0&&!e,O=i.useMemo(()=>{if(!o)return null;if(s&&o<s||l&&o>l){const d=z(s).format(S),H=z(l).format(S);return`**Error**: Date and time set outside allowed range. Please select a date and time between ${d} and ${H}.`}return null},[o,s,l,S]),Z=i.useCallback(({date:d})=>{const H=Y(d);f(H),C.current?.open?.()},[]),_=i.useCallback(()=>{const d=o?z(o).format(j):null;d!==n&&y({value:d,fromUi:!0})},[o,n,y]),J=Se({theme:h,isInSidebar:g,step:E,minTime:G,maxTime:U,disabled:e,clearable:B,error:O,scrollbarGutterSize:b,windowHeight:a});return u.jsxs("div",{className:"stDateTimeInput","data-testid":"stDateTimeInput",children:[u.jsx(pe,{label:t.label,disabled:e,labelVisibility:ne(t.labelVisibility?.value),children:t.help&&u.jsx(ge,{content:t.help,label:t.label})}),u.jsx(ue,{ref:C,locale:A,density:he.high,value:o,onChange:Z,onClose:_,minDate:F,maxDate:N,disabled:e,timeSelectStart:!0,formatString:S,mask:q,placeholder:K,clearable:B,overrides:J,"aria-label":t.label})]})}const Xe=i.memo(Me);export{Xe as default};
|
package/build/assets/{DeckGlJsonChart-CDmFrnUQ-CKLXTmyf.js → DeckGlJsonChart-dSij3LC8-z_q2cC3l.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Le,a5 as ZF,N as YF,F as u6,a6 as c6,a7 as QF,a8 as hC,j as Jl,L as $F,J as JF,H as tN,a9 as eN,i as h6,aa as fC,W as iN,x as f6,ab as nN,ac as Bi,ad as Lp,ae as _e,_ as d6}from"./index-DJf52eor.js";import{p as rN,T as ms,x as sN}from"./toConsumableArray-DtFGUM3A-BLxO6YGd.js";import{_ as eh,b as ih,d as K2,a as yp,O as Z2}from"./possibleConstructorReturn-YeRoNy63-B2FGD3ja.js";import{i as zc}from"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import{G as p6,N as oN}from"./withFullScreenWrapper-CKo__VbV-B1HqecCF.js";import{i as pb}from"./index-CVld_lKx-CBWAU0gM.js";import{D as aN}from"./useBasicWidgetState-Bd8NTj87-Cqs9ZQAV.js";import{Z as lN,_ as uN}from"./threshold-C_rop_uq-CSTNJaOo.js";import"./value-FXychKGJ-DfnNAqu8.js";var dC={};function cN(i,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in i)){const o=Object.getOwnPropertyDescriptor(n,r);o&&Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function pC(){let i;if(typeof window<"u"&&window.performance)i=window.performance.now();else if(typeof process<"u"&&process.hrtime){const t=process.hrtime();i=t[0]*1e3+t[1]/1e6}else i=Date.now();return i}let AC=class{constructor(i,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=i,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(i){return this.sampleSize=i,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(i){return this._count+=i,this._samples++,this._checkSampling(),this}subtractCount(i){return this._count-=i,this._samples++,this._checkSampling(),this}addTime(i){return this._time+=i,this.lastTiming=i,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pC(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pC()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}},Py=class{constructor(i){this.stats={},this.id=i.id,this.stats={},this._initializeStats(i.stats),Object.seal(this)}get(i,t="count"){return this._getOrCreate({name:i,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const i of Object.values(this.stats))i.reset();return this}forEach(i){for(const t of Object.values(this.stats))i(t)}getTable(){const i={};return this.forEach(t=>{i[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),i}_initializeStats(i=[]){i.forEach(t=>this._getOrCreate(t))}_getOrCreate(i){const{name:t,type:e}=i;let n=this.stats[t];return n||(i instanceof AC?n=i:n=new AC(t,e),this.stats[t]=n),n}};class hN{stats=new Map;getStats(t){return this.get(t)}get(t){return this.stats.has(t)||this.stats.set(t,new Py({id:t})),this.stats.get(t)}}const A6=new hN,mC=globalThis,gC=globalThis.process||{},fN=globalThis.navigator||{};function m6(i){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Af(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||m6()}function dN(i){return Af()?m6()?"Electron":(fN.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const g6="4.1.0";function pN(i){try{const t=window[i],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}let AN=class{constructor(i,t,e="sessionStorage"){this.storage=pN(e),this.id=i,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(i){if(Object.assign(this.config,i),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let i={};if(this.storage){const t=this.storage.getItem(this.id);i=t?JSON.parse(t):{}}return Object.assign(this.config,i),this}};function mN(i){let t;return i<10?t=`${i.toFixed(2)}ms`:i<100?t=`${i.toFixed(1)}ms`:i<1e3?t=`${i.toFixed(0)}ms`:t=`${(i/1e3).toFixed(2)}s`,t}function gN(i,t=8){const e=Math.max(t-i.length,0);return`${" ".repeat(e)}${i}`}var Ng;(function(i){i[i.BLACK=30]="BLACK",i[i.RED=31]="RED",i[i.GREEN=32]="GREEN",i[i.YELLOW=33]="YELLOW",i[i.BLUE=34]="BLUE",i[i.MAGENTA=35]="MAGENTA",i[i.CYAN=36]="CYAN",i[i.WHITE=37]="WHITE",i[i.BRIGHT_BLACK=90]="BRIGHT_BLACK",i[i.BRIGHT_RED=91]="BRIGHT_RED",i[i.BRIGHT_GREEN=92]="BRIGHT_GREEN",i[i.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",i[i.BRIGHT_BLUE=94]="BRIGHT_BLUE",i[i.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",i[i.BRIGHT_CYAN=96]="BRIGHT_CYAN",i[i.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ng||(Ng={}));const yN=10;function yC(i){return typeof i!="string"?i:(i=i.toUpperCase(),Ng[i]||Ng.WHITE)}function vN(i,t,e){return!Af&&typeof i=="string"&&(t&&(i=`\x1B[${yC(t)}m${i}\x1B[39m`),e&&(i=`\x1B[${yC(e)+yN}m${i}\x1B[49m`)),i}function _N(i,t=["constructor"]){const e=Object.getPrototypeOf(i),n=Object.getOwnPropertyNames(e),r=i;for(const o of n){const s=r[o];typeof s=="function"&&(t.find(l=>o===l)||(r[o]=s.bind(i)))}}function Y2(i,t){if(!i)throw new Error("Assertion failed")}function md(){let i;if(Af()&&mC.performance)i=mC?.performance?.now?.();else if("hrtime"in gC){const t=gC?.hrtime?.();i=t[0]*1e3+t[1]/1e6}else i=Date.now();return i}const gd={debug:Af()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},bN={enabled:!0,level:0};function yd(){}const vC={},_C={once:!0};class ym{constructor({id:t}={id:""}){this.VERSION=g6,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new AN(`__probe-${this.id}__`,bN),this.timeStamp(`${this.id} started`),_N(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t){return this._getLogFunction(0,t,gd.warn,arguments,_C)}error(t){return this._getLogFunction(0,t,gd.error,arguments)}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e){return this._getLogFunction(t,e,gd.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,gd.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,gd.debug||gd.info,arguments,_C)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||yd,n&&[n],{tag:wN(e)}):yd}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||yd)}group(t,e,n={collapsed:!1}){const r=bC({logLevel:t,message:e,opts:n}),{collapsed:o}=n;return r.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yd)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=y6(t)}_getLogFunction(t,e,n,r,o){if(this._shouldLog(t)){o=bC({logLevel:t,message:e,args:r,opts:o}),n=n||o.method,Y2(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=md();const s=o.tag||o.message;if(o.once&&s)if(!vC[s])vC[s]=md();else return yd;return e=xN(this.id,o.message,o),n.bind(console,e,...o.args)}return yd}}ym.VERSION=g6;function y6(i){if(!i)return 0;let t;switch(typeof i){case"number":t=i;break;case"object":t=i.logLevel||i.priority||0;break;default:return 0}return Y2(Number.isFinite(t)&&t>=0),t}function bC(i){const{logLevel:t,message:e}=i;i.logLevel=y6(t);const n=i.args?Array.from(i.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),i.message=t;break;case"object":Object.assign(i,t);break}typeof i.message=="function"&&(i.message=i.message());const r=typeof i.message;return Y2(r==="string"||r==="object"),Object.assign(i,{args:n},i.opts)}function xN(i,t,e){if(typeof t=="string"){const n=e.time?gN(mN(e.total)):"";t=e.time?`${i}: ${n} ${t}`:`${i}: ${t}`,t=vN(t,e.color,e.background)}return t}function wN(i){for(const t in i)for(const e in i[t])return e||"untitled";return"empty"}globalThis.probe={};const v6=new ym({id:"@probe.gl/log"}),Xe=new ym({id:"luma.gl"}),l_={};function Iy(i="id"){l_[i]=l_[i]||1;const t=l_[i]++;return`${i}-${t}`}let pr=class{static defaultProps={id:"undefined",handle:void 0,userData:void 0};toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(i,t,e){if(!i)throw new Error("no device");this._device=i,this.props=EN(t,e);const n=this.props.id!=="undefined"?this.props.id:Iy(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(i){this._attachedResources.add(i)}detachResource(i){this._attachedResources.delete(i)}destroyAttachedResource(i){this._attachedResources.delete(i)&&i.destroy()}destroyAttachedResources(){for(const i of Object.values(this._attachedResources))i.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const i=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];i.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(i,t=this[Symbol.toStringTag]){const e=this._device.statsManager.getStats("Resource Counts");e.get("GPU Memory").addCount(i),e.get(`${t} Memory`).addCount(i),this.allocatedBytes=i}trackDeallocatedMemory(i=this[Symbol.toStringTag]){const t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${i} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const i=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];i.get("Resources Created").incrementCount(),i.get(`${t}s Created`).incrementCount(),i.get(`${t}s Active`).incrementCount()}};function EN(i,t){const e={...t};for(const n in i)i[n]!==void 0&&(e[n]=i[n]);return e}class br extends pr{static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(t,e){const n={...e};(e.usage||0)&br.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":e.data instanceof Uint8Array&&(n.indexType="uint8")),delete n.data,super(t,n,br.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=t.incrementTimestamp()}clone(t){return this.device.createBuffer({...this.props,...t})}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(t,e,n){const r=ArrayBuffer.isView(t)?t.buffer:t,o=Math.min(t?t.byteLength:n,br.DEBUG_DATA_MAX_LENGTH);r===null?this.debugData=new ArrayBuffer(o):e===0&&n===r.byteLength?this.debugData=r.slice(0,o):this.debugData=r.slice(e,e+o)}static defaultProps={...pr.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",onMapped:void 0}}function _6(i){const[t,e,n]=J2[i],r=i.includes("norm"),o=!r&&!i.startsWith("float"),s=i.startsWith("s");return{signedType:t,primitiveType:e,byteLength:n,normalized:r,integer:o,signed:s}}function CN(i){const t=i;switch(t){case"uint8":return"unorm8";case"sint8":return"snorm8";case"uint16":return"unorm16";case"sint16":return"snorm16";default:return t}}function TN(i,t){switch(t){case 1:return i;case 2:return i+i%2;default:return i+(4-i%4)%4}}function Q2(i){const t=ArrayBuffer.isView(i)?i.constructor:i;if(t===Uint8ClampedArray)return"uint8";const e=Object.values(J2).find(n=>t===n[4]);if(!e)throw new Error(t.name);return e[0]}function $2(i){const[,,,,t]=J2[i];return t}const J2={uint8:["uint8","u32",1,!1,Uint8Array],sint8:["sint8","i32",1,!1,Int8Array],unorm8:["uint8","f32",1,!0,Uint8Array],snorm8:["sint8","f32",1,!0,Int8Array],uint16:["uint16","u32",2,!1,Uint16Array],sint16:["sint16","i32",2,!1,Int16Array],unorm16:["uint16","u32",2,!0,Uint16Array],snorm16:["sint16","i32",2,!0,Int16Array],float16:["float16","f16",2,!1,Uint16Array],float32:["float32","f32",4,!1,Float32Array],uint32:["uint32","u32",4,!1,Uint32Array],sint32:["sint32","i32",4,!1,Int32Array]};function tx(i){let t;i.endsWith("-webgl")&&(i.replace("-webgl",""),t=!0);const[e,n]=i.split("x"),r=e,o=n?parseInt(n):1,s=_6(r),l={type:r,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(l.webglOnly=!0),l}function SN(i,t,e){const n=e?CN(i):i;switch(n){case"unorm8":return t===1?"unorm8":t===3?"unorm8x3-webgl":`${n}x${t}`;case"snorm8":case"uint8":case"sint8":case"uint16":case"sint16":case"unorm16":case"snorm16":case"float16":if(t===1||t===3)throw new Error(`size: ${t}`);return`${n}x${t}`;default:return t===1?n:`${n}x${t}`}}function PN(i,t,e){if(!t||t>4)throw new Error(`size ${t}`);const n=t,r=Q2(i);return SN(r,n,e)}function IN(i){let t;switch(i.primitiveType){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return i.components<=2?"float16x2":"float16x4"}return i.components===1?t:`${t}x${i.components}`}const ho="texture-compression-bc",dr="texture-compression-astc",Zl="texture-compression-etc2",MN="texture-compression-etc1-webgl",d0="texture-compression-pvrtc-webgl",u_="texture-compression-atc-webgl",p0="float32-renderable-webgl",c_="float16-renderable-webgl",BN="rgb9e5ufloat-renderable-webgl",h_="snorm8-renderable-webgl",yA="norm16-renderable-webgl",f_="snorm16-renderable-webgl",A0="float32-filterable",xC="float16-filterable-webgl";function b6(i){const t=kN[i];if(!t)throw new Error(`Unsupported texture format ${i}`);return t}const RN={r8unorm:{},rg8unorm:{},"rgb8unorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},r8snorm:{render:h_},rg8snorm:{render:h_},"rgb8snorm-webgl":{},rgba8snorm:{render:h_},r8uint:{},rg8uint:{},rgba8uint:{},r8sint:{},rg8sint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},r16unorm:{f:yA},rg16unorm:{render:yA},"rgb16unorm-webgl":{f:yA},rgba16unorm:{render:yA},r16snorm:{f:f_},rg16snorm:{render:f_},"rgb16snorm-webgl":{f:yA},rgba16snorm:{render:f_},r16uint:{},rg16uint:{},rgba16uint:{},r16sint:{},rg16sint:{},rgba16sint:{},r16float:{render:c_,filter:"float16-filterable-webgl"},rg16float:{render:c_,filter:xC},rgba16float:{render:c_,filter:xC},r32uint:{},rg32uint:{},rgba32uint:{},r32sint:{},rg32sint:{},rgba32sint:{},r32float:{render:p0,filter:A0},rg32float:{render:!1,filter:A0},"rgb32float-webgl":{render:p0,filter:A0},rgba32float:{render:p0,filter:A0},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},rgb9e5ufloat:{channels:"rgb",packed:!0,render:BN},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:p0},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},rgb10a2uint:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0}},LN={"bc1-rgb-unorm-webgl":{f:ho},"bc1-rgb-unorm-srgb-webgl":{f:ho},"bc1-rgba-unorm":{f:ho},"bc1-rgba-unorm-srgb":{f:ho},"bc2-rgba-unorm":{f:ho},"bc2-rgba-unorm-srgb":{f:ho},"bc3-rgba-unorm":{f:ho},"bc3-rgba-unorm-srgb":{f:ho},"bc4-r-unorm":{f:ho},"bc4-r-snorm":{f:ho},"bc5-rg-unorm":{f:ho},"bc5-rg-snorm":{f:ho},"bc6h-rgb-ufloat":{f:ho},"bc6h-rgb-float":{f:ho},"bc7-rgba-unorm":{f:ho},"bc7-rgba-unorm-srgb":{f:ho},"etc2-rgb8unorm":{f:Zl},"etc2-rgb8unorm-srgb":{f:Zl},"etc2-rgb8a1unorm":{f:Zl},"etc2-rgb8a1unorm-srgb":{f:Zl},"etc2-rgba8unorm":{f:Zl},"etc2-rgba8unorm-srgb":{f:Zl},"eac-r11unorm":{f:Zl},"eac-r11snorm":{f:Zl},"eac-rg11unorm":{f:Zl},"eac-rg11snorm":{f:Zl},"astc-4x4-unorm":{f:dr},"astc-4x4-unorm-srgb":{f:dr},"astc-5x4-unorm":{f:dr},"astc-5x4-unorm-srgb":{f:dr},"astc-5x5-unorm":{f:dr},"astc-5x5-unorm-srgb":{f:dr},"astc-6x5-unorm":{f:dr},"astc-6x5-unorm-srgb":{f:dr},"astc-6x6-unorm":{f:dr},"astc-6x6-unorm-srgb":{f:dr},"astc-8x5-unorm":{f:dr},"astc-8x5-unorm-srgb":{f:dr},"astc-8x6-unorm":{f:dr},"astc-8x6-unorm-srgb":{f:dr},"astc-8x8-unorm":{f:dr},"astc-8x8-unorm-srgb":{f:dr},"astc-10x5-unorm":{f:dr},"astc-10x5-unorm-srgb":{f:dr},"astc-10x6-unorm":{f:dr},"astc-10x6-unorm-srgb":{f:dr},"astc-10x8-unorm":{f:dr},"astc-10x8-unorm-srgb":{f:dr},"astc-10x10-unorm":{f:dr},"astc-10x10-unorm-srgb":{f:dr},"astc-12x10-unorm":{f:dr},"astc-12x10-unorm-srgb":{f:dr},"astc-12x12-unorm":{f:dr},"astc-12x12-unorm-srgb":{f:dr},"pvrtc-rgb4unorm-webgl":{f:d0},"pvrtc-rgba4unorm-webgl":{f:d0},"pvrtc-rbg2unorm-webgl":{f:d0},"pvrtc-rgba2unorm-webgl":{f:d0},"etc1-rbg-unorm-webgl":{f:MN},"atc-rgb-unorm-webgl":{f:u_},"atc-rgba-unorm-webgl":{f:u_},"atc-rgbai-unorm-webgl":{f:u_}},kN={...RN,...LN},DN=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],ON=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;class FN{getInfo(t){return wC(t)}isColor(t){return t.startsWith("rgba")||t.startsWith("bgra")||t.startsWith("rgb")}isDepthStencil(t){return t.startsWith("depth")||t.startsWith("stencil")}isCompressed(t){return DN.some(e=>t.startsWith(e))}getCapabilities(t){const e=b6(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=wC(t),o=t.startsWith("depth")||t.startsWith("stencil"),s=r?.signed,l=r?.integer,c=r?.webgl;return n.render&&=!s,n.filter&&=!o&&!s&&!l&&!c,n}}const op=new FN;function wC(i){let t=NN(i);if(op.isCompressed(i)){t.channels="rgb",t.components=3,t.bytesPerPixel=1,t.srgb=!1,t.compressed=!0;const n=zN(i);n&&(t.blockWidth=n.blockWidth,t.blockHeight=n.blockHeight)}const e=ON.exec(i);if(e){const[,n,r,o,s,l]=e,c=`${o}${r}`,g=_6(c),_=g.byteLength*8,C=n.length,I=[_,C>=2?_:0,C>=3?_:0,C>=4?_:0];t={format:i,attachment:t.attachment,dataType:g.signedType,components:C,channels:n,integer:g.integer,signed:g.signed,normalized:g.normalized,bitsPerChannel:I,bytesPerPixel:g.byteLength*n.length,packed:t.packed,srgb:t.srgb},l==="-webgl"&&(t.webgl=!0),s==="-srgb"&&(t.srgb=!0)}return i.endsWith("-webgl")&&(t.webgl=!0),i.endsWith("-srgb")&&(t.srgb=!0),t}function NN(i){const t=b6(i),e=t.bytesPerPixel||1,n=t.bitsPerChannel||[8,8,8,8];return delete t.bitsPerChannel,delete t.bytesPerPixel,delete t.f,delete t.render,delete t.filter,delete t.blend,delete t.store,{...t,format:i,attachment:t.attachment||"color",channels:t.channels||"r",components:t.components||t.channels?.length||1,bytesPerPixel:e,bitsPerChannel:n,dataType:t.dataType||"uint8",srgb:t.srgb??!1,packed:t.packed??!1,webgl:t.webgl??!1,integer:t.integer??!1,signed:t.signed??!1,normalized:t.normalized??!1,compressed:t.compressed??!1}}function zN(i){const t=/.*-(\d+)x(\d+)-.*/.exec(i);if(t){const[,e,n]=t;return{blockWidth:Number(e),blockHeight:Number(n)}}return null}function UN(i){return typeof ImageData<"u"&&i instanceof ImageData||typeof ImageBitmap<"u"&&i instanceof ImageBitmap||typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement||typeof VideoFrame<"u"&&i instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas}function VN(i){if(typeof ImageData<"u"&&i instanceof ImageData||typeof ImageBitmap<"u"&&i instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height};if(typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement)return{width:i.naturalWidth,height:i.naturalHeight};if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement)return{width:i.videoWidth,height:i.videoHeight};if(typeof VideoFrame<"u"&&i instanceof VideoFrame)return{width:i.displayWidth,height:i.displayHeight};throw new Error("Unknown image type")}class GN{}class jN{features;disabledFeatures;constructor(t=[],e){this.features=new Set(t),this.disabledFeatures=e||{}}*[Symbol.iterator](){yield*this.features}has(t){return!this.disabledFeatures?.[t]&&this.features.has(t)}}class ef{static defaultProps={id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(t,e)=>{},onResize:(t,e)=>{const[n,r]=t.getDevicePixelSize();Xe.log(1,`${t} resized => ${n}x${r}px`)()},onPositionChange:(t,e)=>{const[n,r]=t.getPosition();Xe.log(1,`${t} repositioned => ${n},${r}`)()},onVisibilityChange:t=>Xe.log(1,`${t} Visibility changed ${t.isVisible}`)(),onDevicePixelRatioChange:(t,e)=>Xe.log(1,`${t} DPR changed ${e.oldRatio} => ${t.devicePixelRatio}`)(),debug:Xe.get("debug")||void 0,debugShaders:Xe.get("debug-shaders")||void 0,debugFramebuffers:!!Xe.get("debug-framebuffers"),debugFactories:!!Xe.get("debug-factories"),debugWebGL:!!Xe.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_handle:void 0};get[Symbol.toStringTag](){return"Device"}toString(){return`Device(${this.id})`}id;props;userData={};statsManager=A6;timestamp=0;_reused=!1;_lumaData={};_textureCaps={};constructor(t){this.props={...ef.defaultProps,...t},this.id=this.props.id||Iy(this[Symbol.toStringTag].toLowerCase())}getVertexFormatInfo(t){return tx(t)}isVertexFormatSupported(t){return!0}getTextureFormatInfo(t){return op.getInfo(t)}getTextureFormatCapabilities(t){let e=this._textureCaps[t];if(!e){const n=this._getDeviceTextureFormatCapabilities(t);e=this._getDeviceSpecificTextureFormatCapabilities(n),this._textureCaps[t]=e}return e}getMipLevelCount(t,e,n=1){const r=Math.max(t,e,n);return 1+Math.floor(Math.log2(r))}isExternalImage(t){return UN(t)}getExternalImageSize(t){return VN(t)}isTextureFormatSupported(t){return this.getTextureFormatCapabilities(t).create}isTextureFormatFilterable(t){return this.getTextureFormatCapabilities(t).filter}isTextureFormatRenderable(t){return this.getTextureFormatCapabilities(t).render}isTextureFormatCompressed(t){return op.isCompressed(t)}pushDebugGroup(t){this.commandEncoder.pushDebugGroup(t)}popDebugGroup(){this.commandEncoder?.popDebugGroup()}insertDebugMarker(t){this.commandEncoder?.insertDebugMarker(t)}loseDevice(){return!1}incrementTimestamp(){return this.timestamp++}reportError(t,e,...n){return this.props.onError(t,e)?()=>{}:Xe.error(t.message,e,...n)}debug(){if(this.props.debug)debugger;else Xe.once(0,`'Type luma.log.set({debug: true}) in console to enable debug breakpoints',
|
|
1
|
+
import{r as Le,a5 as ZF,N as YF,F as u6,a6 as c6,a7 as QF,a8 as hC,j as Jl,L as $F,J as JF,H as tN,a9 as eN,i as h6,aa as fC,W as iN,x as f6,ab as nN,ac as Bi,ad as Lp,ae as _e,_ as d6}from"./index-CHE20_1-.js";import{p as rN,T as ms,x as sN}from"./toConsumableArray-BJ_-nsuo-BPUSYd8M.js";import{_ as eh,b as ih,d as K2,a as yp,O as Z2}from"./possibleConstructorReturn-p-fKXom_-BPFgGBwd.js";import{i as zc}from"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import{G as p6,N as oN}from"./withFullScreenWrapper-jebSlaHO-C2WriMN7.js";import{i as pb}from"./index-CVld_lKx-CBWAU0gM.js";import{D as aN}from"./useBasicWidgetState-oLSfk0mv-C-D-ncQp.js";import{Z as lN,_ as uN}from"./threshold-C_rop_uq-CSTNJaOo.js";import"./value-FXychKGJ-DfnNAqu8.js";var dC={};function cN(i,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in i)){const o=Object.getOwnPropertyDescriptor(n,r);o&&Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function pC(){let i;if(typeof window<"u"&&window.performance)i=window.performance.now();else if(typeof process<"u"&&process.hrtime){const t=process.hrtime();i=t[0]*1e3+t[1]/1e6}else i=Date.now();return i}let AC=class{constructor(i,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=i,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(i){return this.sampleSize=i,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(i){return this._count+=i,this._samples++,this._checkSampling(),this}subtractCount(i){return this._count-=i,this._samples++,this._checkSampling(),this}addTime(i){return this._time+=i,this.lastTiming=i,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pC(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pC()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}},Py=class{constructor(i){this.stats={},this.id=i.id,this.stats={},this._initializeStats(i.stats),Object.seal(this)}get(i,t="count"){return this._getOrCreate({name:i,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const i of Object.values(this.stats))i.reset();return this}forEach(i){for(const t of Object.values(this.stats))i(t)}getTable(){const i={};return this.forEach(t=>{i[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),i}_initializeStats(i=[]){i.forEach(t=>this._getOrCreate(t))}_getOrCreate(i){const{name:t,type:e}=i;let n=this.stats[t];return n||(i instanceof AC?n=i:n=new AC(t,e),this.stats[t]=n),n}};class hN{stats=new Map;getStats(t){return this.get(t)}get(t){return this.stats.has(t)||this.stats.set(t,new Py({id:t})),this.stats.get(t)}}const A6=new hN,mC=globalThis,gC=globalThis.process||{},fN=globalThis.navigator||{};function m6(i){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Af(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||m6()}function dN(i){return Af()?m6()?"Electron":(fN.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const g6="4.1.0";function pN(i){try{const t=window[i],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}let AN=class{constructor(i,t,e="sessionStorage"){this.storage=pN(e),this.id=i,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(i){if(Object.assign(this.config,i),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let i={};if(this.storage){const t=this.storage.getItem(this.id);i=t?JSON.parse(t):{}}return Object.assign(this.config,i),this}};function mN(i){let t;return i<10?t=`${i.toFixed(2)}ms`:i<100?t=`${i.toFixed(1)}ms`:i<1e3?t=`${i.toFixed(0)}ms`:t=`${(i/1e3).toFixed(2)}s`,t}function gN(i,t=8){const e=Math.max(t-i.length,0);return`${" ".repeat(e)}${i}`}var Ng;(function(i){i[i.BLACK=30]="BLACK",i[i.RED=31]="RED",i[i.GREEN=32]="GREEN",i[i.YELLOW=33]="YELLOW",i[i.BLUE=34]="BLUE",i[i.MAGENTA=35]="MAGENTA",i[i.CYAN=36]="CYAN",i[i.WHITE=37]="WHITE",i[i.BRIGHT_BLACK=90]="BRIGHT_BLACK",i[i.BRIGHT_RED=91]="BRIGHT_RED",i[i.BRIGHT_GREEN=92]="BRIGHT_GREEN",i[i.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",i[i.BRIGHT_BLUE=94]="BRIGHT_BLUE",i[i.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",i[i.BRIGHT_CYAN=96]="BRIGHT_CYAN",i[i.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ng||(Ng={}));const yN=10;function yC(i){return typeof i!="string"?i:(i=i.toUpperCase(),Ng[i]||Ng.WHITE)}function vN(i,t,e){return!Af&&typeof i=="string"&&(t&&(i=`\x1B[${yC(t)}m${i}\x1B[39m`),e&&(i=`\x1B[${yC(e)+yN}m${i}\x1B[49m`)),i}function _N(i,t=["constructor"]){const e=Object.getPrototypeOf(i),n=Object.getOwnPropertyNames(e),r=i;for(const o of n){const s=r[o];typeof s=="function"&&(t.find(l=>o===l)||(r[o]=s.bind(i)))}}function Y2(i,t){if(!i)throw new Error("Assertion failed")}function md(){let i;if(Af()&&mC.performance)i=mC?.performance?.now?.();else if("hrtime"in gC){const t=gC?.hrtime?.();i=t[0]*1e3+t[1]/1e6}else i=Date.now();return i}const gd={debug:Af()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},bN={enabled:!0,level:0};function yd(){}const vC={},_C={once:!0};class ym{constructor({id:t}={id:""}){this.VERSION=g6,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new AN(`__probe-${this.id}__`,bN),this.timeStamp(`${this.id} started`),_N(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t){return this._getLogFunction(0,t,gd.warn,arguments,_C)}error(t){return this._getLogFunction(0,t,gd.error,arguments)}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e){return this._getLogFunction(t,e,gd.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,gd.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,gd.debug||gd.info,arguments,_C)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||yd,n&&[n],{tag:wN(e)}):yd}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||yd)}group(t,e,n={collapsed:!1}){const r=bC({logLevel:t,message:e,opts:n}),{collapsed:o}=n;return r.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||yd)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=y6(t)}_getLogFunction(t,e,n,r,o){if(this._shouldLog(t)){o=bC({logLevel:t,message:e,args:r,opts:o}),n=n||o.method,Y2(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=md();const s=o.tag||o.message;if(o.once&&s)if(!vC[s])vC[s]=md();else return yd;return e=xN(this.id,o.message,o),n.bind(console,e,...o.args)}return yd}}ym.VERSION=g6;function y6(i){if(!i)return 0;let t;switch(typeof i){case"number":t=i;break;case"object":t=i.logLevel||i.priority||0;break;default:return 0}return Y2(Number.isFinite(t)&&t>=0),t}function bC(i){const{logLevel:t,message:e}=i;i.logLevel=y6(t);const n=i.args?Array.from(i.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),i.message=t;break;case"object":Object.assign(i,t);break}typeof i.message=="function"&&(i.message=i.message());const r=typeof i.message;return Y2(r==="string"||r==="object"),Object.assign(i,{args:n},i.opts)}function xN(i,t,e){if(typeof t=="string"){const n=e.time?gN(mN(e.total)):"";t=e.time?`${i}: ${n} ${t}`:`${i}: ${t}`,t=vN(t,e.color,e.background)}return t}function wN(i){for(const t in i)for(const e in i[t])return e||"untitled";return"empty"}globalThis.probe={};const v6=new ym({id:"@probe.gl/log"}),Xe=new ym({id:"luma.gl"}),l_={};function Iy(i="id"){l_[i]=l_[i]||1;const t=l_[i]++;return`${i}-${t}`}let pr=class{static defaultProps={id:"undefined",handle:void 0,userData:void 0};toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(i,t,e){if(!i)throw new Error("no device");this._device=i,this.props=EN(t,e);const n=this.props.id!=="undefined"?this.props.id:Iy(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(i){this._attachedResources.add(i)}detachResource(i){this._attachedResources.delete(i)}destroyAttachedResource(i){this._attachedResources.delete(i)&&i.destroy()}destroyAttachedResources(){for(const i of Object.values(this._attachedResources))i.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const i=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];i.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(i,t=this[Symbol.toStringTag]){const e=this._device.statsManager.getStats("Resource Counts");e.get("GPU Memory").addCount(i),e.get(`${t} Memory`).addCount(i),this.allocatedBytes=i}trackDeallocatedMemory(i=this[Symbol.toStringTag]){const t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${i} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const i=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];i.get("Resources Created").incrementCount(),i.get(`${t}s Created`).incrementCount(),i.get(`${t}s Active`).incrementCount()}};function EN(i,t){const e={...t};for(const n in i)i[n]!==void 0&&(e[n]=i[n]);return e}class br extends pr{static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(t,e){const n={...e};(e.usage||0)&br.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":e.data instanceof Uint8Array&&(n.indexType="uint8")),delete n.data,super(t,n,br.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=t.incrementTimestamp()}clone(t){return this.device.createBuffer({...this.props,...t})}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(t,e,n){const r=ArrayBuffer.isView(t)?t.buffer:t,o=Math.min(t?t.byteLength:n,br.DEBUG_DATA_MAX_LENGTH);r===null?this.debugData=new ArrayBuffer(o):e===0&&n===r.byteLength?this.debugData=r.slice(0,o):this.debugData=r.slice(e,e+o)}static defaultProps={...pr.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",onMapped:void 0}}function _6(i){const[t,e,n]=J2[i],r=i.includes("norm"),o=!r&&!i.startsWith("float"),s=i.startsWith("s");return{signedType:t,primitiveType:e,byteLength:n,normalized:r,integer:o,signed:s}}function CN(i){const t=i;switch(t){case"uint8":return"unorm8";case"sint8":return"snorm8";case"uint16":return"unorm16";case"sint16":return"snorm16";default:return t}}function TN(i,t){switch(t){case 1:return i;case 2:return i+i%2;default:return i+(4-i%4)%4}}function Q2(i){const t=ArrayBuffer.isView(i)?i.constructor:i;if(t===Uint8ClampedArray)return"uint8";const e=Object.values(J2).find(n=>t===n[4]);if(!e)throw new Error(t.name);return e[0]}function $2(i){const[,,,,t]=J2[i];return t}const J2={uint8:["uint8","u32",1,!1,Uint8Array],sint8:["sint8","i32",1,!1,Int8Array],unorm8:["uint8","f32",1,!0,Uint8Array],snorm8:["sint8","f32",1,!0,Int8Array],uint16:["uint16","u32",2,!1,Uint16Array],sint16:["sint16","i32",2,!1,Int16Array],unorm16:["uint16","u32",2,!0,Uint16Array],snorm16:["sint16","i32",2,!0,Int16Array],float16:["float16","f16",2,!1,Uint16Array],float32:["float32","f32",4,!1,Float32Array],uint32:["uint32","u32",4,!1,Uint32Array],sint32:["sint32","i32",4,!1,Int32Array]};function tx(i){let t;i.endsWith("-webgl")&&(i.replace("-webgl",""),t=!0);const[e,n]=i.split("x"),r=e,o=n?parseInt(n):1,s=_6(r),l={type:r,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(l.webglOnly=!0),l}function SN(i,t,e){const n=e?CN(i):i;switch(n){case"unorm8":return t===1?"unorm8":t===3?"unorm8x3-webgl":`${n}x${t}`;case"snorm8":case"uint8":case"sint8":case"uint16":case"sint16":case"unorm16":case"snorm16":case"float16":if(t===1||t===3)throw new Error(`size: ${t}`);return`${n}x${t}`;default:return t===1?n:`${n}x${t}`}}function PN(i,t,e){if(!t||t>4)throw new Error(`size ${t}`);const n=t,r=Q2(i);return SN(r,n,e)}function IN(i){let t;switch(i.primitiveType){case"f32":t="float32";break;case"i32":t="sint32";break;case"u32":t="uint32";break;case"f16":return i.components<=2?"float16x2":"float16x4"}return i.components===1?t:`${t}x${i.components}`}const ho="texture-compression-bc",dr="texture-compression-astc",Zl="texture-compression-etc2",MN="texture-compression-etc1-webgl",d0="texture-compression-pvrtc-webgl",u_="texture-compression-atc-webgl",p0="float32-renderable-webgl",c_="float16-renderable-webgl",BN="rgb9e5ufloat-renderable-webgl",h_="snorm8-renderable-webgl",yA="norm16-renderable-webgl",f_="snorm16-renderable-webgl",A0="float32-filterable",xC="float16-filterable-webgl";function b6(i){const t=kN[i];if(!t)throw new Error(`Unsupported texture format ${i}`);return t}const RN={r8unorm:{},rg8unorm:{},"rgb8unorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},r8snorm:{render:h_},rg8snorm:{render:h_},"rgb8snorm-webgl":{},rgba8snorm:{render:h_},r8uint:{},rg8uint:{},rgba8uint:{},r8sint:{},rg8sint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},r16unorm:{f:yA},rg16unorm:{render:yA},"rgb16unorm-webgl":{f:yA},rgba16unorm:{render:yA},r16snorm:{f:f_},rg16snorm:{render:f_},"rgb16snorm-webgl":{f:yA},rgba16snorm:{render:f_},r16uint:{},rg16uint:{},rgba16uint:{},r16sint:{},rg16sint:{},rgba16sint:{},r16float:{render:c_,filter:"float16-filterable-webgl"},rg16float:{render:c_,filter:xC},rgba16float:{render:c_,filter:xC},r32uint:{},rg32uint:{},rgba32uint:{},r32sint:{},rg32sint:{},rgba32sint:{},r32float:{render:p0,filter:A0},rg32float:{render:!1,filter:A0},"rgb32float-webgl":{render:p0,filter:A0},rgba32float:{render:p0,filter:A0},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},rgb9e5ufloat:{channels:"rgb",packed:!0,render:BN},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:p0},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},rgb10a2uint:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0}},LN={"bc1-rgb-unorm-webgl":{f:ho},"bc1-rgb-unorm-srgb-webgl":{f:ho},"bc1-rgba-unorm":{f:ho},"bc1-rgba-unorm-srgb":{f:ho},"bc2-rgba-unorm":{f:ho},"bc2-rgba-unorm-srgb":{f:ho},"bc3-rgba-unorm":{f:ho},"bc3-rgba-unorm-srgb":{f:ho},"bc4-r-unorm":{f:ho},"bc4-r-snorm":{f:ho},"bc5-rg-unorm":{f:ho},"bc5-rg-snorm":{f:ho},"bc6h-rgb-ufloat":{f:ho},"bc6h-rgb-float":{f:ho},"bc7-rgba-unorm":{f:ho},"bc7-rgba-unorm-srgb":{f:ho},"etc2-rgb8unorm":{f:Zl},"etc2-rgb8unorm-srgb":{f:Zl},"etc2-rgb8a1unorm":{f:Zl},"etc2-rgb8a1unorm-srgb":{f:Zl},"etc2-rgba8unorm":{f:Zl},"etc2-rgba8unorm-srgb":{f:Zl},"eac-r11unorm":{f:Zl},"eac-r11snorm":{f:Zl},"eac-rg11unorm":{f:Zl},"eac-rg11snorm":{f:Zl},"astc-4x4-unorm":{f:dr},"astc-4x4-unorm-srgb":{f:dr},"astc-5x4-unorm":{f:dr},"astc-5x4-unorm-srgb":{f:dr},"astc-5x5-unorm":{f:dr},"astc-5x5-unorm-srgb":{f:dr},"astc-6x5-unorm":{f:dr},"astc-6x5-unorm-srgb":{f:dr},"astc-6x6-unorm":{f:dr},"astc-6x6-unorm-srgb":{f:dr},"astc-8x5-unorm":{f:dr},"astc-8x5-unorm-srgb":{f:dr},"astc-8x6-unorm":{f:dr},"astc-8x6-unorm-srgb":{f:dr},"astc-8x8-unorm":{f:dr},"astc-8x8-unorm-srgb":{f:dr},"astc-10x5-unorm":{f:dr},"astc-10x5-unorm-srgb":{f:dr},"astc-10x6-unorm":{f:dr},"astc-10x6-unorm-srgb":{f:dr},"astc-10x8-unorm":{f:dr},"astc-10x8-unorm-srgb":{f:dr},"astc-10x10-unorm":{f:dr},"astc-10x10-unorm-srgb":{f:dr},"astc-12x10-unorm":{f:dr},"astc-12x10-unorm-srgb":{f:dr},"astc-12x12-unorm":{f:dr},"astc-12x12-unorm-srgb":{f:dr},"pvrtc-rgb4unorm-webgl":{f:d0},"pvrtc-rgba4unorm-webgl":{f:d0},"pvrtc-rbg2unorm-webgl":{f:d0},"pvrtc-rgba2unorm-webgl":{f:d0},"etc1-rbg-unorm-webgl":{f:MN},"atc-rgb-unorm-webgl":{f:u_},"atc-rgba-unorm-webgl":{f:u_},"atc-rgbai-unorm-webgl":{f:u_}},kN={...RN,...LN},DN=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],ON=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;class FN{getInfo(t){return wC(t)}isColor(t){return t.startsWith("rgba")||t.startsWith("bgra")||t.startsWith("rgb")}isDepthStencil(t){return t.startsWith("depth")||t.startsWith("stencil")}isCompressed(t){return DN.some(e=>t.startsWith(e))}getCapabilities(t){const e=b6(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=wC(t),o=t.startsWith("depth")||t.startsWith("stencil"),s=r?.signed,l=r?.integer,c=r?.webgl;return n.render&&=!s,n.filter&&=!o&&!s&&!l&&!c,n}}const op=new FN;function wC(i){let t=NN(i);if(op.isCompressed(i)){t.channels="rgb",t.components=3,t.bytesPerPixel=1,t.srgb=!1,t.compressed=!0;const n=zN(i);n&&(t.blockWidth=n.blockWidth,t.blockHeight=n.blockHeight)}const e=ON.exec(i);if(e){const[,n,r,o,s,l]=e,c=`${o}${r}`,g=_6(c),_=g.byteLength*8,C=n.length,I=[_,C>=2?_:0,C>=3?_:0,C>=4?_:0];t={format:i,attachment:t.attachment,dataType:g.signedType,components:C,channels:n,integer:g.integer,signed:g.signed,normalized:g.normalized,bitsPerChannel:I,bytesPerPixel:g.byteLength*n.length,packed:t.packed,srgb:t.srgb},l==="-webgl"&&(t.webgl=!0),s==="-srgb"&&(t.srgb=!0)}return i.endsWith("-webgl")&&(t.webgl=!0),i.endsWith("-srgb")&&(t.srgb=!0),t}function NN(i){const t=b6(i),e=t.bytesPerPixel||1,n=t.bitsPerChannel||[8,8,8,8];return delete t.bitsPerChannel,delete t.bytesPerPixel,delete t.f,delete t.render,delete t.filter,delete t.blend,delete t.store,{...t,format:i,attachment:t.attachment||"color",channels:t.channels||"r",components:t.components||t.channels?.length||1,bytesPerPixel:e,bitsPerChannel:n,dataType:t.dataType||"uint8",srgb:t.srgb??!1,packed:t.packed??!1,webgl:t.webgl??!1,integer:t.integer??!1,signed:t.signed??!1,normalized:t.normalized??!1,compressed:t.compressed??!1}}function zN(i){const t=/.*-(\d+)x(\d+)-.*/.exec(i);if(t){const[,e,n]=t;return{blockWidth:Number(e),blockHeight:Number(n)}}return null}function UN(i){return typeof ImageData<"u"&&i instanceof ImageData||typeof ImageBitmap<"u"&&i instanceof ImageBitmap||typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement||typeof VideoFrame<"u"&&i instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas}function VN(i){if(typeof ImageData<"u"&&i instanceof ImageData||typeof ImageBitmap<"u"&&i instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height};if(typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement)return{width:i.naturalWidth,height:i.naturalHeight};if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement)return{width:i.videoWidth,height:i.videoHeight};if(typeof VideoFrame<"u"&&i instanceof VideoFrame)return{width:i.displayWidth,height:i.displayHeight};throw new Error("Unknown image type")}class GN{}class jN{features;disabledFeatures;constructor(t=[],e){this.features=new Set(t),this.disabledFeatures=e||{}}*[Symbol.iterator](){yield*this.features}has(t){return!this.disabledFeatures?.[t]&&this.features.has(t)}}class ef{static defaultProps={id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(t,e)=>{},onResize:(t,e)=>{const[n,r]=t.getDevicePixelSize();Xe.log(1,`${t} resized => ${n}x${r}px`)()},onPositionChange:(t,e)=>{const[n,r]=t.getPosition();Xe.log(1,`${t} repositioned => ${n},${r}`)()},onVisibilityChange:t=>Xe.log(1,`${t} Visibility changed ${t.isVisible}`)(),onDevicePixelRatioChange:(t,e)=>Xe.log(1,`${t} DPR changed ${e.oldRatio} => ${t.devicePixelRatio}`)(),debug:Xe.get("debug")||void 0,debugShaders:Xe.get("debug-shaders")||void 0,debugFramebuffers:!!Xe.get("debug-framebuffers"),debugFactories:!!Xe.get("debug-factories"),debugWebGL:!!Xe.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_handle:void 0};get[Symbol.toStringTag](){return"Device"}toString(){return`Device(${this.id})`}id;props;userData={};statsManager=A6;timestamp=0;_reused=!1;_lumaData={};_textureCaps={};constructor(t){this.props={...ef.defaultProps,...t},this.id=this.props.id||Iy(this[Symbol.toStringTag].toLowerCase())}getVertexFormatInfo(t){return tx(t)}isVertexFormatSupported(t){return!0}getTextureFormatInfo(t){return op.getInfo(t)}getTextureFormatCapabilities(t){let e=this._textureCaps[t];if(!e){const n=this._getDeviceTextureFormatCapabilities(t);e=this._getDeviceSpecificTextureFormatCapabilities(n),this._textureCaps[t]=e}return e}getMipLevelCount(t,e,n=1){const r=Math.max(t,e,n);return 1+Math.floor(Math.log2(r))}isExternalImage(t){return UN(t)}getExternalImageSize(t){return VN(t)}isTextureFormatSupported(t){return this.getTextureFormatCapabilities(t).create}isTextureFormatFilterable(t){return this.getTextureFormatCapabilities(t).filter}isTextureFormatRenderable(t){return this.getTextureFormatCapabilities(t).render}isTextureFormatCompressed(t){return op.isCompressed(t)}pushDebugGroup(t){this.commandEncoder.pushDebugGroup(t)}popDebugGroup(){this.commandEncoder?.popDebugGroup()}insertDebugMarker(t){this.commandEncoder?.insertDebugMarker(t)}loseDevice(){return!1}incrementTimestamp(){return this.timestamp++}reportError(t,e,...n){return this.props.onError(t,e)?()=>{}:Xe.error(t.message,e,...n)}debug(){if(this.props.debug)debugger;else Xe.once(0,`'Type luma.log.set({debug: true}) in console to enable debug breakpoints',
|
|
2
2
|
or create a device with the 'debug: true' prop.`)()}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}beginRenderPass(t){return this.commandEncoder.beginRenderPass(t)}beginComputePass(t){return this.commandEncoder.beginComputePass(t)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(t,e){throw new Error("not implemented")}readPixelsToBufferWebGL(t,e){throw new Error("not implemented")}setParametersWebGL(t){throw new Error("not implemented")}getParametersWebGL(t){throw new Error("not implemented")}withParametersWebGL(t,e){throw new Error("not implemented")}clearWebGL(t){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(t){return t.createCanvasContext===!0?{}:t.createCanvasContext}_getDeviceTextureFormatCapabilities(t){const e=op.getCapabilities(t),n=o=>(typeof o=="string"?this.features.has(o):o)??!0,r=n(e.create);return{format:t,create:r,render:r&&n(e.render),filter:r&&n(e.filter),blend:r&&n(e.blend),store:r&&n(e.store)}}_normalizeBufferProps(t){(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e={...t};if((t.usage||0)&br.INDEX&&(t.indexType||(t.data instanceof Uint32Array?e.indexType="uint32":t.data instanceof Uint16Array?e.indexType="uint16":t.data instanceof Uint8Array&&(e.data=new Uint16Array(t.data),e.indexType="uint16")),!e.indexType))throw new Error("indices buffer content must be of type uint16 or uint32");return e}}const WN="set luma.log.level=1 (or higher) to trace rendering",EC="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.";class zg{static defaultProps={...ef.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0};stats=A6;log=Xe;VERSION="9.2.6";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Xe.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Xe.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");Xe.error("This version of luma.gl has already been initialized")()}Xe.log(1,`${this.VERSION} - ${WN}`)(),globalThis.luma=this}async createDevice(t={}){const e={...zg.defaultProps,...t},n=this.selectAdapter(e.type,e.adapters);if(!n)throw new Error(EC);return e.waitForPageLoad&&await n.pageLoaded,await n.create(e)}async attachDevice(t,e){const n=this._getTypeFromHandle(t,e.adapters),r=n&&this.selectAdapter(n,e.adapters);if(!r)throw new Error(EC);return await r?.attach?.(t,e)}registerAdapters(t){for(const e of t)this.preregisteredAdapters.set(e.type,e)}getSupportedAdapters(t=[]){const e=this._getAdapterMap(t);return Array.from(e).map(([,n])=>n).filter(n=>n.isSupported?.()).map(n=>n.type)}getBestAvailableAdapterType(t=[]){const e=["webgpu","webgl","null"],n=this._getAdapterMap(t);for(const r of e)if(n.get(r)?.isSupported?.())return r;return null}selectAdapter(t,e=[]){let n=t;t==="best-available"&&(n=this.getBestAvailableAdapterType(e));const r=this._getAdapterMap(e);return n&&r.get(n)||null}enforceWebGL2(t=!0,e=[]){const n=this._getAdapterMap(e).get("webgl");n||Xe.warn("enforceWebGL2: webgl adapter not found")(),n?.enforceWebGL2?.(t)}setDefaultDeviceProps(t){Object.assign(zg.defaultProps,t)}_getAdapterMap(t=[]){const e=new Map(this.preregisteredAdapters);for(const n of t)e.set(n.type,n);return e}_getTypeFromHandle(t,e=[]){return t instanceof WebGL2RenderingContext?"webgl":typeof GPUDevice<"u"&&t instanceof GPUDevice||t?.queue?"webgpu":t===null?"null":(t instanceof WebGLRenderingContext?Xe.warn("WebGL1 is not supported",t)():Xe.warn("Unknown handle type",t)(),null)}}const Ab=new zg;class HN{get pageLoaded(){return KN()}}const XN=Af()&&typeof document<"u",qN=()=>XN&&document.readyState==="complete";let m0=null;function KN(){return m0||(qN()||typeof window>"u"?m0=Promise.resolve():m0=new Promise(i=>window.addEventListener("load",()=>i()))),m0}function ZN(){let i,t;return{promise:new Promise((e,n)=>{i=e,t=n}),resolve:i,reject:t}}class Wh{static isHTMLCanvas(t){return typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement}static isOffscreenCanvas(t){return typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas}static defaultProps={id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1};id;props;canvas;htmlCanvas;offscreenCanvas;type;initialized;isInitialized=!1;isVisible=!0;cssWidth;cssHeight;devicePixelRatio;devicePixelWidth;devicePixelHeight;drawingBufferWidth;drawingBufferHeight;_initializedResolvers=ZN();_resizeObserver;_intersectionObserver;_position;destroyed=!1;toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(t){if(this.props={...Wh.defaultProps,...t},t=this.props,this.initialized=this._initializedResolvers.promise,Af()?t.canvas?typeof t.canvas=="string"?this.canvas=QN(t.canvas):this.canvas=t.canvas:this.canvas=$N(t):this.canvas={width:t.width||1,height:t.height||1},Wh.isHTMLCanvas(this.canvas)?(this.id=t.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):Wh.isOffscreenCanvas(this.canvas)?(this.id=t.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=t.id||"node-canvas-context",this.type="node"),this.cssWidth=this.htmlCanvas?.clientWidth||this.canvas.width,this.cssHeight=this.htmlCanvas?.clientHeight||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],Wh.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(e=>this._handleIntersection(e)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(e=>this._handleResize(e));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}destroy(){this.destroyed=!0}setProps(t){return"useDevicePixels"in t&&(this.props.useDevicePixels=t.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){const t=this.device.limits.maxTextureDimension2D;return[t,t]}setDrawingBufferSize(t,e){this.canvas.width=t,this.canvas.height=e,this.drawingBufferWidth=t,this.drawingBufferHeight=e}getDevicePixelRatio(){return typeof window<"u"&&window.devicePixelRatio||1}cssToDevicePixels(t,e=!0){const n=this.cssToDeviceRatio(),[r,o]=this.getDrawingBufferSize();return JN(t,n,r,o,e)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){const[t,e]=this.getDevicePixelSize();return t/e}cssToDeviceRatio(){try{const[t]=this.getDrawingBufferSize(),[e]=this.getCSSSize();return e?t/e:1}catch{return 1}}resize(t){this.setDrawingBufferSize(t.width,t.height)}_setAutoCreatedCanvasId(t){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=t)}_handleIntersection(t){const e=t.find(r=>r.target===this.canvas);if(!e)return;const n=e.isIntersecting;this.isVisible!==n&&(this.isVisible=n,this.device.props.onVisibilityChange(this))}_handleResize(t){const e=t.find(c=>c.target===this.canvas);if(!e)return;this.cssWidth=e.contentBoxSize[0].inlineSize,this.cssHeight=e.contentBoxSize[0].blockSize;const n=this.getDevicePixelSize(),r=e.devicePixelContentBoxSize?.[0].inlineSize||e.contentBoxSize[0].inlineSize*devicePixelRatio,o=e.devicePixelContentBoxSize?.[0].blockSize||e.contentBoxSize[0].blockSize*devicePixelRatio,[s,l]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(r,s)),this.devicePixelHeight=Math.max(1,Math.min(o,l)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:n})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels=="number"){const t=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*t,this.cssHeight*t)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){const t=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:t}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(t=100){const e=setInterval(()=>{this.destroyed?clearInterval(e):this.updatePosition()},t)}updatePosition(){const t=this.htmlCanvas?.getBoundingClientRect();if(t){const e=[t.left,t.top];if(this._position??=e,e[0]!==this._position[0]||e[1]!==this._position[1]){const n=this._position;this._position=e,this.device.props.onPositionChange?.(this,{oldPosition:n})}}}}function YN(i){if(typeof i=="string"){const t=document.getElementById(i);if(!t)throw new Error(`${i} is not an HTML element`);return t}return i||document.body}function QN(i){const t=document.getElementById(i);if(!Wh.isHTMLCanvas(t))throw new Error("Object is not a canvas element");return t}function $N(i){const{width:t,height:e}=i,n=document.createElement("canvas");n.id=Iy("lumagl-auto-created-canvas"),n.width=t||1,n.height=e||1,n.style.width=Number.isFinite(t)?`${t}px`:"100%",n.style.height=Number.isFinite(e)?`${e}px`:"100%",i?.visible||(n.style.visibility="hidden");const r=YN(i?.container||null);return r.insertBefore(n,r.firstChild),n}function JN(i,t,e,n,r){const o=i,s=CC(o[0],t,e);let l=TC(o[1],t,n,r),c=CC(o[0]+1,t,e);const g=c===e-1?c:c-1;c=TC(o[1]+1,t,n,r);let _;return r?(c=c===0?c:c+1,_=l,l=c):_=c===n-1?c:c-1,{x:s,y:l,width:Math.max(g-s+1,1),height:Math.max(_-l+1,1)}}function CC(i,t,e){return Math.min(Math.round(i*t),e-1)}function TC(i,t,e,n){return n?Math.max(0,e-1-Math.round(i*t)):Math.min(Math.round(i*t),e-1)}class nf extends pr{static defaultProps={...pr.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1};get[Symbol.toStringTag](){return"Sampler"}constructor(t,e){e=nf.normalizeProps(t,e),super(t,e,nf.defaultProps)}static normalizeProps(t,e){return e}}const t9={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"};class ps extends pr{static SAMPLE=4;static STORAGE=8;static RENDER=16;static COPY_SRC=1;static COPY_DST=2;static TEXTURE=4;static RENDER_ATTACHMENT=16;dimension;baseDimension;format;width;height;depth;mipLevels;updateTimestamp;get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}constructor(t,e){if(e=ps.normalizeProps(t,e),super(t,e,ps.defaultProps),this.dimension=this.props.dimension,this.baseDimension=t9[this.dimension],this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.mipLevels=this.props.mipLevels,this.props.width===void 0||this.props.height===void 0)if(t.isExternalImage(e.data)){const n=t.getExternalImageSize(e.data);this.width=n?.width||1,this.height=n?.height||1}else this.width=1,this.height=1,(this.props.width===void 0||this.props.height===void 0)&&Xe.warn(`${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`)();this.updateTimestamp=t.incrementTimestamp()}setSampler(t){this.sampler=t instanceof nf?t:this.device.createSampler(t)}clone(t){return this.device.createTexture({...this.props,...t})}static normalizeProps(t,e){const n={...e},{width:r,height:o}=n;return typeof r=="number"&&(n.width=Math.max(1,Math.ceil(r))),typeof o=="number"&&(n.height=Math.max(1,Math.ceil(o))),n}_initializeData(t){this.device.isExternalImage(t)?this.copyExternalImage({image:t,width:this.width,height:this.height,depth:this.depth,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}):t&&this.copyImageData({data:t,mipLevel:0,x:0,y:0,z:0,aspect:"all"})}_normalizeCopyImageDataOptions(t){const{width:e,height:n,depth:r}=this,o={...ps.defaultCopyDataOptions,width:e,height:n,depth:r,...t},s=this.device.getTextureFormatInfo(this.format);if(!t.bytesPerRow&&!s.bytesPerPixel)throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);return o.bytesPerRow=t.bytesPerRow||e*(s.bytesPerPixel||4),o.rowsPerImage=t.rowsPerImage||n,o}_normalizeCopyExternalImageOptions(t){const e=this.device.getExternalImageSize(t.image),n={...ps.defaultCopyExternalImageOptions,...e,...t};return n.width=Math.min(n.width,this.width-n.x),n.height=Math.min(n.height,this.height-n.y),n}static defaultProps={...pr.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",usage:ps.TEXTURE|ps.RENDER_ATTACHMENT|ps.COPY_DST,width:void 0,height:void 0,depth:1,mipLevels:1,samples:void 0,sampler:{},view:void 0};static defaultCopyDataOptions={data:void 0,byteOffset:0,bytesPerRow:void 0,rowsPerImage:void 0,mipLevel:0,x:0,y:0,z:0,aspect:"all"};static defaultCopyExternalImageOptions={image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}}class My extends pr{get[Symbol.toStringTag](){return"TextureView"}constructor(t,e){super(t,e,My.defaultProps)}static defaultProps={...pr.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0}}function e9(i,t,e){let n="";const r=t.split(/\r?\n/),o=i.slice().sort((s,l)=>s.lineNum-l.lineNum);switch(e?.showSourceCode||"no"){case"all":let s=0;for(let l=1;l<=r.length;l++)for(n+=x6(r[l-1],l,e);o.length>s&&o[s].lineNum===l;){const c=o[s++];n+=d_(c,r,c.lineNum,{...e,inlineSource:!1})}for(;o.length>s;){const l=o[s++];n+=d_(l,[],0,{...e,inlineSource:!1})}return n;case"issues":case"no":for(const l of i)n+=d_(l,r,l.lineNum,{inlineSource:e?.showSourceCode!=="no"});return n}}function d_(i,t,e,n){if(n?.inlineSource){const o=i9(t,e),s=i.linePos>0?`${" ".repeat(i.linePos+5)}^^^
|
|
3
3
|
`:"";return`
|
|
4
4
|
${o}${s}${i.type.toUpperCase()}: ${i.message}
|
package/build/assets/{DownloadButton-g54AS0W2-qOKvF9wp.js → DownloadButton-5Bz1-AC5-BKem2rXk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,a5 as U,dp as z,an as A,ao as j,aG as Z,j as h,aq as M,aZ as _,ar as N,as as F,dq as O,dr as q}from"./index-
|
|
1
|
+
import{r as a,a5 as U,dp as z,an as A,ao as j,aG as Z,j as h,aq as M,aZ as _,ar as N,as as F,dq as O,dr as q}from"./index-CHE20_1-.js";import{r as W}from"./iconPosition-BPGPKkjQ-DDZxDFyf.js";import{s as I}from"./createDownloadLinkElement-CwAYcc1e-DbJb0I6l.js";const P=/%([0-9A-Fa-f]{2})/g,Y=/[^\x20-\x7e\xa0-\xff]/g,G=/\\([\u0000-\u007f])/g,L=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,K=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,V=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,H=n=>String(n).replace(Y,"?");class J{constructor(e,t){this.type=e,this.parameters=t}}const Q=(n,e)=>String.fromCharCode(Number.parseInt(e,16));function X(n){const e=K.exec(n);if(!e)throw new TypeError("invalid extended field value");const t=e[1].toLowerCase(),s=e[2];let r;switch(t){case"iso-8859-1":r=H(s.replace(P,Q));break;case"utf-8":try{r=decodeURIComponent(s)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return r}function ee(n){let e=V.exec(n);if(!e)throw new TypeError("invalid type format");let t=e[0].length;const s=e[1].toLowerCase();let r;const i=[],l={};let o;for(t=L.lastIndex=e[0].slice(-1)===";"?t-1:t;e=L.exec(n);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,r=e[1].toLowerCase(),o=e[2],i.indexOf(r)!==-1)throw new TypeError("invalid duplicate parameter");if(i.push(r),r.indexOf("*")+1===r.length){r=r.slice(0,-1),o=X(o),l[r]=o;continue}typeof l[r]!="string"&&(o[0]==='"'&&(o=o.slice(1,o.length-1).replace(G,"$1")),l[r]=o)}if(t!==-1&&t!==n.length)throw new TypeError("invalid parameter format");return new J(s,l)}function te(n){const e=ee(n);if(e.type!=="attachment")return;const t=e.parameters.filename;if(typeof t=="string")return t}function re(n,e){return n.sendHttpRequest({method:"GET",path:`${e}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:t,headers:s,body:r})=>{if(t!==200)return;const i=s.get("Content-Disposition"),l=(i&&te(i))??"",o=s.get("Content-Type"),b=new Blob([r],o?{type:o}:void 0),f=URL.createObjectURL(b),c=document.createElement("a");c.setAttribute("href",f),c.setAttribute("target","_blank"),c.setAttribute("download",l),c.click(),URL.revokeObjectURL(f),c.remove()})}function ne(){const n=q();return a.useCallback(e=>re(n,e),[n])}function oe(n){const{disabled:e,element:t,widgetMgr:s,endpoints:r,fragmentId:i}=n,{help:l,label:o,icon:b,ignoreRerun:f,type:c,url:D,deferredFileId:u}=t,T=t.shortcut?t.shortcut:void 0,[R,y]=a.useState(!1),[x,p]=a.useState(null),{enforceDownloadInNewTab:m=!1}=a.useContext(U),{requestDeferredFile:C}=a.useContext(z);let E=A.SECONDARY;c==="primary"?E=A.PRIMARY:c==="tertiary"&&(E=A.TERTIARY);const w=a.useMemo(()=>r.buildDownloadUrl(D),[r,D]);a.useEffect(()=>{u?.length||r.checkSourceUrlResponse(w,"Download Button")},[w,r,u]);const B=a.useCallback(async()=>{if(!C||!u){p("Deferred download not properly configured");return}y(!0),p(null);try{const d=await C(u);if(d.errorMsg){p(d.errorMsg),y(!1);return}const g=r.buildDownloadUrl(d.url);r.checkSourceUrlResponse(g,"Download Button"),I({filename:"",url:g,enforceDownloadInNewTab:m}).click()}catch(d){const g=d instanceof Error?d.message:"Download failed";p(g)}finally{y(!1)}},[C,u,r,m]),k=ne(),v=a.useCallback(()=>{if(!e){if(f||s.setTriggerValue(t,{fromUi:!0},i),t.url.startsWith("/media")){k(t.url);return}u?.length?B():I({filename:"",url:w,enforceDownloadInNewTab:m}).click()}},[e,f,s,t,i,u,B,w,m,k]);j({shortcut:T,disabled:e,onActivate:v});const{clear:S,restart:$}=Z(()=>{p(null)},5e3,{autoStart:!1});return a.useEffect(()=>{x?$():S()},[S,x,$]),h.jsxs("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:[h.jsx(M,{help:l,containerWidth:!0,children:h.jsx(_,{kind:E,size:N.SMALL,disabled:e||R,onClick:v,containerWidth:!0,children:h.jsx(F,{icon:R?"spinner":b,iconPosition:W(t.iconPosition),label:o,shortcut:T})})}),x&&h.jsx(O,{"data-testid":"stDownloadButtonError",children:x})]})}const le=a.memo(oe);export{le as default};
|
package/build/assets/{ErrorOutline.esm-B1NqpuZN-D4cKYVYX.js → ErrorOutline.esm-BskdUBnE-7qRVaCY5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,E as n,_ as a}from"./index-
|
|
1
|
+
import{r,E as n,_ as a}from"./index-CHE20_1-.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(n,a({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,H as A,j as d,am as C,ds as s,x as b}from"./index-
|
|
1
|
+
import{r as l,H as A,j as d,am as C,ds as s,x as b}from"./index-CHE20_1-.js";import{N as j}from"./useBasicWidgetState-oLSfk0mv-C-D-ncQp.js";const R=b("div",{target:"e1b8h3j92"})(({containerWidth:e})=>({width:e?"100%":"auto",minWidth:"fit-content"}),""),I=b("div",{target:"e1b8h3j91"})(({theme:e})=>({display:"flex",flexWrap:"nowrap",gap:e.spacing.threeXS,minWidth:"fit-content"}),""),W=b("button",{target:"e1b8h3j90"})(({theme:e,isSelected:t})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:e.spacing.threeXS,margin:e.spacing.none,backgroundColor:e.colors.transparent,color:t?e.colors.bodyText:e.colors.fadedText60,border:"none",borderRadius:e.radii.button,cursor:"pointer",userSelect:"none",minHeight:"unset",flex:"0 0 fit-content","&:focus":{boxShadow:"none",outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover:not(:disabled)":{color:e.colors.bodyText},"&:disabled":{color:t?e.colors.fadedText40:e.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}}),""),f=[":material/thumb_up:",":material/thumb_down:"],_=[":material/sentiment_sad:",":material/sentiment_dissatisfied:",":material/sentiment_neutral:",":material/sentiment_satisfied:",":material/sentiment_very_satisfied:"],D=":material/star:",M=":material/star_filled:",y=5;function U(e){switch(e){case s.FeedbackType.FACES:return _.map((t,a)=>({icon:t,selectedIcon:t,value:a}));case s.FeedbackType.STARS:return Array.from({length:y},(t,a)=>({icon:D,selectedIcon:M,value:a}));default:return[{icon:f[0],selectedIcon:f[0],value:1},{icon:f[1],selectedIcon:f[1],value:0}]}}function V(e,t){switch(t){case s.FeedbackType.THUMBS:return e===1?"Thumbs up":"Thumbs down";case s.FeedbackType.FACES:return["Very dissatisfied","Dissatisfied","Neutral","Satisfied","Very satisfied"][e]??`Rating ${e+1}`;case s.FeedbackType.STARS:return`${e+1} out of ${y} stars`;default:return`Rating ${e+1}`}}function B(e,t,a){return t===null?!1:a===s.FeedbackType.STARS?e<=t:e===t}function E(e,t){const a=e.getStringValue(t);if(a!==void 0)return a===""?null:parseInt(a,10)}function $(e){return e.default??null}function H(e){return e.value??null}function N(e,t,a,m){const h=a.value===null?"":String(a.value);t.setStringValue(e,h,{fromUi:a.fromUi},m)}function z(e){const{disabled:t,element:a,fragmentId:m,widgetMgr:h,widthConfig:x}=e,{type:u}=a,[k,v]=j({getStateFromWidgetMgr:E,getDefaultStateFromProto:$,getCurrStateFromProto:H,updateWidgetMgrState:N,element:a,widgetMgr:h,fragmentId:m,formClearBehavior:"resetValueOnly"}),o=a.value??k,w=A(x),c=l.useMemo(()=>U(u),[u]),S=l.useRef([]),p=l.useCallback(r=>{v({value:o===r?null:r,fromUi:!0})},[o,v]),T=l.useCallback((r,n)=>{let i;switch(r.key){case"ArrowLeft":case"ArrowUp":r.preventDefault(),i=n>0?n-1:c.length-1;break;case"ArrowRight":case"ArrowDown":r.preventDefault(),i=n<c.length-1?n+1:0;break;case" ":case"Enter":r.preventDefault(),p(c[n].value);return;default:return}S.current[i]?.focus()},[c,p]);return d.jsx(R,{className:"stFeedback","data-testid":"stFeedback",containerWidth:w,children:d.jsx(I,{role:"radiogroup","aria-label":"Feedback rating",children:c.map((r,n)=>{const i=B(r.value,o,u),F=i?r.selectedIcon:r.icon;return d.jsx(W,{ref:g=>{S.current[n]=g},type:"button",role:"radio","aria-checked":o===r.value,"aria-label":V(r.value,u),tabIndex:o===r.value||o===null&&n===0?0:-1,disabled:t,isSelected:i,onClick:()=>p(r.value),onKeyDown:g=>T(g,n),"data-testid":i?"stFeedbackButtonActive":"stFeedbackButton",children:d.jsx(C,{iconValue:F,size:"lg"})},r.value)})})})}const L=l.memo(z);export{L as default};
|
package/build/assets/{FileDownload.esm-B_usFfyI-DvbGAuNe.js → FileDownload.esm-r6GccJGR-bDEy_L2M.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,E as n,_ as o}from"./index-
|
|
1
|
+
import{r as e,E as n,_ as o}from"./index-CHE20_1-.js";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,o({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});i.displayName="Delete";var a=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,o({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});a.displayName="FileDownload";export{a as i,i as o};
|
package/build/assets/{FileUploader-CzCdIxed-CWWB6xZB.js → FileUploader-CFj8fg_u-D1JfDby-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,G as le,aP as N,W as re,O as oe,i as I,aW as ne,j as r,aw as de,aZ as Z,ar as _,an as q,as as G,aY as ce,aX as pe,x as y,w as ue}from"./index-
|
|
1
|
+
import{r as l,G as le,aP as N,W as re,O as oe,i as I,aW as ne,j as r,aw as de,aZ as Z,ar as _,an as q,as as G,aY as ce,aX as pe,x as y,w as ue}from"./index-CHE20_1-.js";import{t as W}from"./UploadFileInfo-DdcsXhjv-m2CBXl3F.js";import{m as fe}from"./WidgetLabel-DTUHhtk_-EPIQC9md.js";import{j as me}from"./WidgetLabelHelpIcon-CfpOYjLN-CUGwBOM8.js";import{k as ge,z as he,S as be,c as xe,a as ye,l as we,i as J,b as Se,U as Ue,j as ze,g as je,Y as A,L as De}from"./utils-CzD7XIpv-COJ6XrrX.js";import"./styled-components-BsL0GiBO-C2azWTC8.js";import"./TableChart.esm-Dpji9oSF-DM4jytuW.js";import"./ErrorOutline.esm-BskdUBnE-7qRVaCY5.js";const X=y("section",{target:"e1b2p2ww8"})(({isDisabled:e,isDragActive:t,theme:a})=>({position:"relative",display:"flex",gap:a.spacing.lg,alignItems:"flex-start",padding:a.spacing.md,backgroundColor:a.colors.secondaryBg,borderRadius:a.radii.default,border:a.colors.widgetBorderColor?`${a.sizes.borderWidth} solid ${a.colors.widgetBorderColor}`:void 0,height:"auto",minHeight:a.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:a.shadows.focusRingOutline},cursor:e?"not-allowed":"pointer",...t&&{boxShadow:`inset 0 0 0 2px ${a.colors.primary}`}}),""),Fe=y("div",{target:"e1b2p2ww7"})(({theme:e})=>({position:"absolute",top:e.spacing.threeXS,right:e.spacing.threeXS,bottom:e.spacing.threeXS,left:e.spacing.threeXS,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.secondaryBg,borderRadius:e.radii.default,zIndex:e.zIndices.priority}),""),Ce=y("span",{target:"e1b2p2ww6"})(({theme:e})=>({color:e.colors.primary,fontSize:e.fontSizes.sm,fontWeight:e.fontWeights.extrabold}),""),ee=y("div",{target:"e1b2p2ww5"})({name:"1xfl00o",styles:"display:flex;align-items:center;justify-content:flex-start;text-align:left;align-self:center;min-width:0;flex:1"}),Ie=y("span",{target:"e1b2p2ww4"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),ke=y("div",{target:"e1b2p2ww3"})({name:"1s8jot1",styles:"display:flex;flex-direction:column;min-width:0;max-width:100%"}),ve=y("span",{target:"e1b2p2ww2"})({name:"1bmnxg7",styles:"white-space:nowrap"}),Ee=y("div",{target:"e1b2p2ww1"})(({theme:e})=>({lineHeight:e.lineHeights.tight}),""),K=2.5,Q=.5;function te(e){const t=Math.floor(e),a=e-t;return`${t*K+Math.max(0,t-1)*Q+(a>0?Q+a*K:0)}rem`}const Me=()=>({[J]:{maxHeight:te(2.25),overflowY:"auto"}}),Be=e=>({[X]:{flexDirection:"column",alignItems:"stretch",height:"fit-content",gap:e.spacing.md},[ee]:{alignSelf:"stretch"},[J]:{flexDirection:"column",flexWrap:"nowrap",alignItems:"flex-start",maxHeight:"none",overflowY:"visible",gap:e.spacing.sm},[we]:{display:"flex",flexDirection:"column",flexWrap:"nowrap",alignItems:"flex-start",gap:e.spacing.sm,maxHeight:te(5.25),overflowY:"auto",width:e.sizes.full},[ye]:{width:e.sizes.full},[xe]:{width:e.sizes.full}}),Re=y("div",{target:"e1b2p2ww0"})(({theme:e,width:t})=>({...Me(),...t<ue("23rem")?Be(e):{}}),""),Le=({acceptedTypes:e,maxSizeBytes:t,disabled:a})=>{const d=()=>e.length?` • ${De(e)}`:null,o=()=>`${je(t,A.Byte,0)} per file`;return r.jsx(ee,{"data-testid":"stFileUploaderDropzoneInstructions",children:r.jsx(ke,{children:r.jsxs(Ie,{disabled:a,children:[o(),d()]})})})},We=l.memo(Le),Ae=({onDrop:e,multiple:t,acceptedTypes:a,maxSizeBytes:d,disabled:o,label:h,acceptDirectory:b=!1,uploadedFiles:w,hasFiles:z=!1})=>r.jsx(Se,{onDrop:e,multiple:t,accept:Ue(a),maxSize:d,disabled:o,useFsAccessApi:!1,children:({getRootProps:U,getInputProps:u,isDragActive:D})=>{const S=u({multiple:t||!!b});return r.jsxs(X,{...U(),"data-testid":"stFileUploaderDropzone",isDisabled:o,isDragActive:D,"aria-label":h,"aria-disabled":o,children:[r.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...S,...b&&{webkitdirectory:""}}),D&&r.jsx(Fe,{children:r.jsx(Ce,{children:b?"Drag and drop directories here":t?"Drag and drop files here":"Drag and drop a file here"})}),z&&w?w:r.jsxs(r.Fragment,{children:[r.jsx(ve,{children:r.jsx(Z,{kind:q.SECONDARY,disabled:o,size:_.MEDIUM,children:r.jsx(G,{icon:":material/upload:",label:b?"Upload directories":"Upload"})})}),r.jsx(We,{acceptedTypes:a,maxSizeBytes:d,disabled:o})]})]})}}),$e=l.memo(Ae),Oe=({items:e,onDelete:t,disabled:a,trailingContent:d})=>r.jsx(Ee,{children:r.jsx(ze,{items:e,onDelete:t,disabled:a,trailingContent:d})}),Te=l.memo(Oe),Ve=(e,t)=>{const a=t.getFileUploaderStateValue(e);if(I(a))return{files:[],nextLocalId:1};const{uploadedFileInfo:d}=a;if(I(d)||d.length===0)return{files:[],nextLocalId:1};let o=1;return{files:d.map(h=>{const b=h.name,w=h.size,z=h.fileId,U=h.fileUrls,u=new W(b,w,o,{type:"uploaded",fileId:z,fileUrls:U});return o+=1,u}),nextLocalId:o}},L=e=>{const t=e.filter(a=>a.status.type==="uploaded").map(a=>{const{name:d,size:o,status:h}=a,{fileId:b,fileUrls:w}=h;return new ce({fileId:b,fileUrls:w,name:d,size:o})});return new pe({uploadedFileInfo:t})},He=({disabled:e,element:t,widgetMgr:a,uploadClient:d,fragmentId:o})=>{const{width:h,elementRef:b}=le(),{files:w,nextLocalId:z}=l.useMemo(()=>Ve(t,a),[t,a]),U=l.useRef(z),[u,D]=l.useState(()=>w),S=l.useRef(u);l.useEffect(()=>{S.current=u},[u]);const[ae,$]=l.useState(!1),j=l.useCallback(()=>{const s=U.current;return U.current+=1,s},[]),k=l.useMemo(()=>{const s=t.maxUploadSizeMb;return ge(s,A.Megabyte,A.Byte)},[t.maxUploadSizeMb]),x=l.useCallback(s=>{N.flushSync(()=>{D(i=>{const n=typeof s=="function"?s(i):s;return S.current=n,n})})},[]),v=l.useCallback(s=>{N.flushSync(()=>{$(s)})},[$]),O=l.useCallback(s=>{x(i=>[...i,s])},[x]),E=l.useCallback(s=>{s.length!==0&&x(i=>[...i,...s])},[x]),T=l.useCallback(s=>{x(i=>i.filter(n=>n.id!==s))},[x]),F=l.useCallback((s,i)=>{x(n=>n.map(m=>m.id===s?i:m))},[x]),C=l.useCallback(s=>S.current.find(i=>i.id===s),[]),V=u.some(s=>s.status.type==="uploading")||ae?"updating":"ready";l.useEffect(()=>{a.getFileUploaderStateValue(t)===void 0&&a.setFileUploaderStateValue(t,L(S.current),{fromUi:!1},o)},[a,t,o]),l.useEffect(()=>{if(V!=="ready")return;const s=L(u),i=a.getFileUploaderStateValue(t);re(s,i)||a.setFileUploaderStateValue(t,s,{fromUi:!0},o)},[V,u,a,t,o]);const se=l.useCallback(()=>{x(()=>[]);const s=L([]);a.setFileUploaderStateValue(t,s,{fromUi:!0},o)},[t,o,x,a]);oe({element:t,widgetMgr:a,onFormCleared:se});const M=t.type,H=l.useCallback(s=>{const i=[],n=[];return s.forEach(m=>{he(m,M)?i.push(m):n.push({file:m,errors:[{code:"file-invalid-type",message:`${m.type} files are not allowed.`}]})}),{accepted:i,rejected:n}},[M]),Y=l.useCallback((s,i)=>{const n=C(s);I(n)||n.status.type!=="uploading"||F(n.id,n.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},[C,F]),P=l.useCallback((s,i)=>{const n=new AbortController,m=i.webkitRelativePath||i.name,c=new W(m,i.size,j(),{type:"uploading",abortController:n,progress:0});O(c),d.uploadFile(t,s.uploadUrl,i,void 0,n.signal).then(()=>Y(c.id,s)).catch(f=>{f instanceof DOMException&&f.name==="AbortError"||F(c.id,c.setStatus({type:"error",errorMessage:f?f.toString():"Unknown error"}))})},[O,t,j,Y,F,d]),B=l.useCallback(s=>{if(e)return;const i=C(s);I(i)||(i.status.type==="uploading"&&i.status.abortController.abort(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&d.deleteFile(i.status.fileUrls.deleteUrl),T(s))},[e,C,T,d]),ie=l.useCallback((s,i)=>{const{multipleFiles:n}=t,m=!!t.acceptDirectory;let c=[...s],f=[...i];if(m&&c.length>0){const{accepted:g,rejected:p}=H(c);c=g,f=[...f,...p]}if(!n&&c.length===0&&f.length>1){const g=f.findIndex(p=>p.errors.length===1&&p.errors[0].code==="too-many-files");g>=0&&(c.push(f[g].file),f.splice(g,1))}if(d.fetchFileURLs(c).then(g=>{if(!n&&c.length>0){const p=S.current.find(R=>R.status.type!=="error");if(p){v(!0);try{B(p.id)}finally{v(!1)}}}ne(g,c).forEach(([p,R])=>{P(p,R)})}).catch(g=>{E(c.map(p=>new W(p.name,p.size,j(),{type:"error",errorMessage:g})))}),f.length>0){const g=f.map(p=>be(p,j(),k));E(g)}},[E,B,t,H,k,j,d,P,v]);return r.jsxs(Re,{className:"stFileUploader","data-testid":"stFileUploader",width:h,ref:b,children:[r.jsx(fe,{label:t.label,disabled:e,labelVisibility:de(t.labelVisibility?.value),children:t.help&&r.jsx(me,{content:t.help,label:t.label})}),r.jsx($e,{onDrop:ie,multiple:t.multipleFiles,acceptedTypes:M,maxSizeBytes:k,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory,hasFiles:u.length>0,uploadedFiles:u.length>0?r.jsx(Te,{items:u,onDelete:B,disabled:e,trailingContent:r.jsx(Z,{kind:q.BORDERLESS_ICON,disabled:e,size:_.XSMALL,"aria-label":"Add files",children:r.jsx(G,{icon:":material/add:"})})}):null})]})},Ge=l.memo(He);export{Ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,dt as b,F as S,du as p,an as i,r as c,ao as x,ap as f,aq as R,aZ as F,ar as M,as as j}from"./index-
|
|
1
|
+
import{j as o,dt as b,F as S,du as p,an as i,r as c,ao as x,ap as f,aq as R,aZ as F,ar as M,as as j}from"./index-CHE20_1-.js";import{r as I}from"./iconPosition-BPGPKkjQ-DDZxDFyf.js";function y(n){const{disabled:l,element:t,widgetMgr:s,fragmentId:u}=n,{formId:e}=t,d=t.shortcut?t.shortcut:void 0,{formsData:B}=S(p),h=B.formsWithUploads.has(e);let r=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?r=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(r=i.TERTIARY_FORM_SUBMIT);const a=l||h;c.useEffect(()=>(s.addSubmitButton(e,t),()=>s.removeSubmitButton(e,t)),[s,e,t]);const m=c.useCallback(()=>{a||s.submitForm(t.formId,u,t)},[a,s,t,u]);return x({shortcut:d,disabled:a,onActivate:m}),o.jsx(f,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o.jsx(R,{help:t.help,containerWidth:!0,children:o.jsx(F,{kind:r,size:M.SMALL,containerWidth:!0,disabled:a,onClick:m,children:o.jsx(j,{icon:t.icon,iconPosition:I(t.iconPosition),label:t.label,shortcut:d})})})})}function _(n){return o.jsx(b,{children:o.jsx(y,{...n})})}export{_ as FormSubmitContent};
|