efficient-shell 8.34.0 → 8.35.1
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/README.md +9 -0
- package/dist/{Browser-QBAMRKYI.js → Browser-F67PEY2U.js} +14 -14
- package/dist/Calculator-6ZU5MKTQ.js +29 -0
- package/dist/CurrencyConverter-Z6L7QAZU.js +21 -0
- package/dist/{Documents-E3GMXALJ.js → Documents-MQDSI27F.js} +25 -25
- package/dist/{Files-2DWPYRM5.js → Files-DEC4KVQM.js} +43 -43
- package/dist/Notepad-2IRVJ7MB.js +25 -0
- package/dist/PdfViewer-KSLOYXMD.js +1 -0
- package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-TRGMI4YT.js} +44 -44
- package/dist/{Preview-VZYFOH2U.js → Preview-PXOEKXSR.js} +17 -17
- package/dist/Sidebar-QQFJJWE2.js +43 -0
- package/dist/Spreadsheet-WROI4P6D.js +37 -0
- package/dist/Stock-SUDCDSUL.js +16 -0
- package/dist/{Weather-DS4YZ6SH.js → Weather-WQE4ZQAL.js} +18 -18
- package/dist/{WorldClock-7S4TITSF.js → WorldClock-2AGEYLZP.js} +6 -6
- package/dist/ai/index.d.ts +47 -9
- package/dist/ai/index.js +38 -33
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
- package/dist/chunk-2EOQDYGM.js +29 -0
- package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
- package/dist/chunk-2PWZNFFP.js +19 -0
- package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
- package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
- package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
- package/dist/{chunk-BQ2IPQNR.js → chunk-3RPIPYLU.js} +1 -1
- package/dist/chunk-4AJRHTTB.js +1 -0
- package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
- package/dist/{chunk-GIM2422N.js → chunk-4HCRZHIX.js} +1 -1
- package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
- package/dist/chunk-5FCEBKT2.js +7 -0
- package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
- package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
- package/dist/{chunk-QDOTMA3W.js → chunk-64ZHCEZN.js} +1 -1
- package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
- package/dist/{chunk-T5SEGUCJ.js → chunk-7ACSSYEZ.js} +13 -13
- package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
- package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
- package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
- package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
- package/dist/{chunk-TFMC2WAS.js → chunk-BKZGI76S.js} +1 -1
- package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
- package/dist/{chunk-LCM5U6BY.js → chunk-CCPNMYCK.js} +1 -1
- package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
- package/dist/chunk-DIN3EFOM.js +14 -0
- package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
- package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
- package/dist/{chunk-4C4SQ4YW.js → chunk-EM6BEHAD.js} +8 -8
- package/dist/{chunk-W5M6P4DZ.js → chunk-ETF7LAYZ.js} +5 -5
- package/dist/{chunk-LEC4SZIV.js → chunk-EVB35JP5.js} +1 -1
- package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
- package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
- package/dist/chunk-F2AEP37B.js +4 -0
- package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
- package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
- package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
- package/dist/{chunk-FFJVCLGH.js → chunk-G2MJTE6X.js} +11 -11
- package/dist/{chunk-3BPF6PP3.js → chunk-G2V2ADJQ.js} +2 -2
- package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
- package/dist/{chunk-3WC6ITJ3.js → chunk-H33Z4ZIY.js} +6 -6
- package/dist/{chunk-CPXHU3Y2.js → chunk-HAIMJAI4.js} +2 -2
- package/dist/chunk-HMHL27AU.js +6 -0
- package/dist/{chunk-RSO67DWS.js → chunk-I4VD5D43.js} +4 -4
- package/dist/{chunk-BIYL7CEI.js → chunk-IFDW5QW6.js} +2 -2
- package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
- package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
- package/dist/chunk-JBQWR4SX.js +8 -0
- package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
- package/dist/chunk-JE6TBZGY.js +8 -0
- package/dist/{chunk-LBLV64XG.js → chunk-JUGPTBMS.js} +1 -1
- package/dist/{chunk-BUGAWNOC.js → chunk-JVIOAZHW.js} +4 -4
- package/dist/{chunk-B2XDNBR3.js → chunk-L3G3YHVN.js} +1 -1
- package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
- package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
- package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
- package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
- package/dist/{chunk-USYNZGY4.js → chunk-MICWRC72.js} +7 -7
- package/dist/{chunk-ZN3O2KJ7.js → chunk-MOD4PGVF.js} +10 -10
- package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
- package/dist/chunk-NKZNPYDB.js +3 -0
- package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
- package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
- package/dist/{chunk-3J5QUHPO.js → chunk-OFKWTOXK.js} +3 -3
- package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
- package/dist/{chunk-L3NYH4QV.js → chunk-PAB2ZU4F.js} +37 -37
- package/dist/{chunk-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
- package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
- package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
- package/dist/{chunk-KNVE7CMS.js → chunk-RJZYORCR.js} +1 -1
- package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
- package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
- package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
- package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
- package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
- package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
- package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
- package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
- package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
- package/dist/chunk-WAZTGEMG.js +1 -0
- package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
- package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
- package/dist/{chunk-OSA24YH6.js → chunk-WSPO4N72.js} +14 -14
- package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
- package/dist/{chunk-VB7Z3HXO.js → chunk-XDDTFV32.js} +1 -1
- package/dist/{chunk-XC55NMXR.js → chunk-XNJMLHGK.js} +1 -1
- package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
- package/dist/{chunk-CRYEG7OT.js → chunk-YBB56N6X.js} +1 -1
- package/dist/{chunk-FRPNTDP4.js → chunk-ZNCU3UIW.js} +4 -4
- package/dist/{chunk-ZOSIPTXM.js → chunk-ZNXBKFV7.js} +5 -5
- package/dist/{chunk-RCMP37VO.js → chunk-ZRHQGFO5.js} +3 -3
- package/dist/{chunk-MEFXMUWI.js → chunk-ZXSMSVLU.js} +3 -3
- package/dist/data/ListLoadError.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +136 -136
- package/dist/map/index.js +6 -6
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.d.ts +2 -2
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.d.ts +2 -2
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-4JDJKSA7.js +0 -29
- package/dist/CurrencyConverter-S7LG5PMX.js +0 -21
- package/dist/Notepad-VQ66RWLT.js +0 -25
- package/dist/PdfViewer-67VBUIRD.js +0 -1
- package/dist/Sidebar-YB4OVUG5.js +0 -43
- package/dist/Spreadsheet-4KXRJSHT.js +0 -37
- package/dist/Stock-VNFYS73L.js +0 -16
- package/dist/chunk-3JJFBUK6.js +0 -3
- package/dist/chunk-57SJKYA4.js +0 -29
- package/dist/chunk-AS4CTEZD.js +0 -8
- package/dist/chunk-HSOREHQB.js +0 -1
- package/dist/chunk-JJXFPGX4.js +0 -6
- package/dist/chunk-LYYR5DSP.js +0 -14
- package/dist/chunk-RERNKFEW.js +0 -19
- package/dist/chunk-W7S56JZ7.js +0 -7
- package/dist/chunk-YCQVEJOT.js +0 -3
- package/dist/chunk-YW2DH6YQ.js +0 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?
|
|
4
|
-
/* @__PURE__ */b("span",{children:z.playing?
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:N(
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-2SHYR3RA.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,R=a(r??null)??C,P=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[P,D,q,R+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-R)/i)),I=a(p??null)??D??R,j=Math.min(Math.max(y??I,R),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(R).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?R:null,z=$?a($.date):null,H=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let J,U;if(H&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},U=E}else if(J=E??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);U=e>=0&&e<t.length-1?t[e+1]:null}else U=null;const Y={};for(const e of U?.items??[])Y[e.part_number]=e;const B=!(!d||J?.id===d),K=d?Math.min(a(p??null)??A,A):A,V=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:R,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:E,nextAfter:$,displayed:J,prevReport:U,prevByPN:Y,isInterpolated:H,playing:v,startPlay:()=>{if(v)return void N();if(K<=R)return void f(K);M(!0),f(R);let e=performance.now(),t=R;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:V,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:R,poNumber:P,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),H=c().production,J=d(),U=_??H.heading,Y=e=>o(e,J);if(0===D.length&&0===R.length)return null;const B=R.filter(e=>"shipment"===e.kind),K=R.filter(e=>"inspection"===e.kind),V=R.filter(e=>"invoice"===e.kind),X=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?H.pause:H.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:z.playing?H.pause:H.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??H.backTo(String(W))}):null,[re,ne]=p(H.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(j.date).getTime())," · ",H.overall(Math.round(Z))," · ",H.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:H.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:H.estimatedCompletion,dateText:Y(G)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??H.start,end:M?.end??(e?H.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:U,subject:P,meta:[`${Y(O)} → ${Y(q)}`,H.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
11
11
|
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),
|
|
13
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),
|
|
14
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),
|
|
12
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),H.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),H.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),H.inspection]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),H.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-MY755PTJ.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
5
5
|
/* @__PURE__ */t("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
6
|
-
/* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(
|
|
6
|
+
/* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(a,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */n(c,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
7
7
|
/* @__PURE__ */n(e,{header:"Shipping address",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
8
8
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
9
|
-
/* @__PURE__ */n(
|
|
10
|
-
/* @__PURE__ */n(
|
|
11
|
-
/* @__PURE__ */n(
|
|
9
|
+
/* @__PURE__ */n(a,{label:"First name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Alice"})}),
|
|
10
|
+
/* @__PURE__ */n(a,{label:"Last name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Nguyen"})})]}),
|
|
11
|
+
/* @__PURE__ */n(a,{label:"Address",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123 Market St"})}),
|
|
12
12
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
13
|
-
/* @__PURE__ */n(
|
|
14
|
-
/* @__PURE__ */n(
|
|
15
|
-
/* @__PURE__ */n(
|
|
16
|
-
/* @__PURE__ */n(
|
|
13
|
+
/* @__PURE__ */n(a,{label:"City",children:/* @__PURE__ */n(c,{placeholder:"San Francisco"})}),
|
|
14
|
+
/* @__PURE__ */n(a,{label:"ZIP",children:/* @__PURE__ */n(c,{placeholder:"94103"})}),
|
|
15
|
+
/* @__PURE__ */n(a,{label:"Country",children:/* @__PURE__ */n(l,{value:p,onChange:u,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
16
|
+
/* @__PURE__ */n(r,{checked:m,onChange:o,label:"Billing address same as shipping"})]})}),
|
|
17
17
|
/* @__PURE__ */n(e,{header:"Payment",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
18
|
-
/* @__PURE__ */n(
|
|
18
|
+
/* @__PURE__ */n(a,{label:"Card number",required:!0,children:/* @__PURE__ */n(c,{placeholder:"1234 5678 9012 3456"})}),
|
|
19
19
|
/* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
20
|
-
/* @__PURE__ */n(
|
|
21
|
-
/* @__PURE__ */n(
|
|
20
|
+
/* @__PURE__ */n(a,{label:"Expiry",required:!0,children:/* @__PURE__ */n(c,{placeholder:"MM / YY"})}),
|
|
21
|
+
/* @__PURE__ */n(a,{label:"CVC",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123"})})]})]})})]}),
|
|
22
22
|
/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
23
23
|
/* @__PURE__ */t(e,{header:"Order summary",children:[
|
|
24
24
|
/* @__PURE__ */n("ul",{className:"space-y-2 text-sm",children:h.map(e=>/* @__PURE__ */t("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
@@ -36,4 +36,4 @@ return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__P
|
|
|
36
36
|
/* @__PURE__ */n("span",{children:"Total"}),
|
|
37
37
|
/* @__PURE__ */t("span",{children:["$",g]})]})]}),
|
|
38
38
|
/* @__PURE__ */t(d,{block:!0,className:"mt-4",children:["Pay $",g]})]}),
|
|
39
|
-
/* @__PURE__ */n(
|
|
39
|
+
/* @__PURE__ */n(i,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}export{m as CheckoutTemplate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
|
|
2
2
|
return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
|
|
3
3
|
/* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
|
|
4
4
|
return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-EBC4XFL2.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */t("div",{children:[
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-4NXMMWL6.js";import{Icon as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[_,D]=s(0),[
|
|
1
|
+
import{toast_default as e}from"./chunk-4NXMMWL6.js";import{Icon as t}from"./chunk-2SHYR3RA.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import{useShellStrings as r}from"./chunk-E6UCGCOC.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[_,D]=s(0),[P,W]=s(1),[L,S]=s(!0),[$,A]=s(!0),O=i(x.loadFailed);O.current=x.loadFailed,l(()=>{let t=!1;return A(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),D(e.numPages),A(!1))}).catch(()=>{t||(e.error(O.current),A(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!L||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});W(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,L,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:P}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,P]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===d?x.fitPage:x.fitWidth,U="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
5
|
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
6
|
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,_)}),
|
|
7
7
|
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(_,e+1)),disabled:E>=_,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),
|
|
10
|
-
/* @__PURE__ */m("select",{value:
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),
|
|
13
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),W(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:L?"fit":v.includes(Math.round(100*P))?Math.round(100*P):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),W(Number(t)/100)):S(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:T}),!L&&!v.includes(Math.round(100*P))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*P),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),W(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":L,className:U+(L?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
15
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=_;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:U,children:[
|
|
16
16
|
/* @__PURE__ */u(t,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
17
|
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:U,children:[
|
|
18
18
|
/* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:U,children:[
|
|
19
19
|
/* @__PURE__ */u(t,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
-
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<_?(e.preventDefault(),z(e=>Math.min(_,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<_&&(e.preventDefault(),z(e=>Math.min(_,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(_)))},children
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<_?(e.preventDefault(),z(e=>Math.min(_,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<_&&(e.preventDefault(),z(e=>Math.min(_,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(_)))},children:$?/* @__PURE__ */u(n,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return t("div",{role:"group","aria-label":p?void 0:m,"aria-labelledby":p,"aria-describedby":f,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((l,n)=>{const b=`${g}-${n}-state`,m=`${g}-${n}-reason`,u=Boolean(l.disabled)&&null!=l.disabledReason&&""!==l.disabledReason,p=/* @__PURE__ */c("button",{type:"button","aria-pressed":l.shown,disabled:!(!l.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":
|
|
3
|
-
/* @__PURE__ */t(
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{swallowPress as r,describedByWith as i,OffWithReason as a}from"./chunk-VH6GB73Q.js";import{OneLineLabel as o}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useId as n,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":p,"aria-describedby":f}){const w=l().displayChips,g=n();/* @__PURE__ */
|
|
2
|
+
return t("div",{role:"group","aria-label":p?void 0:m,"aria-labelledby":p,"aria-describedby":f,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((l,n)=>{const b=`${g}-${n}-state`,m=`${g}-${n}-reason`,u=Boolean(l.disabled)&&null!=l.disabledReason&&""!==l.disabledReason,p=/* @__PURE__ */c("button",{type:"button","aria-pressed":l.shown,disabled:!(!l.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?r:()=>h(l.id,!l.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(l.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
|
|
3
|
+
/* @__PURE__ */t(e,{name:l.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
4
|
/* @__PURE__ */t(o,{children:l.label})]}),f=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:l.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
5
|
-
return c(d,{children:[u?/* @__PURE__ */t(
|
|
5
|
+
return c(d,{children:[u?/* @__PURE__ */t(a,{reason:l.disabledReason,id:m,children:p}):/* @__PURE__ */t(s,{content:l.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:p}),f]},l.id)})})}export{b as DisplayChips};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-X2S2XDZI.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-X2S2XDZI.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-WSPO4N72.js";import{ChartFrame as a}from"./chunk-BRHIRE4D.js";import{ColumnChart as l}from"./chunk-ETF7LAYZ.js";import{TH_ONE_LINE as s}from"./chunk-6KO5VTL7.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CloseGlyph as e}from"./chunk-
|
|
1
|
+
import{CloseGlyph as e}from"./chunk-FMKTVZAO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-YDYDR72S.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as o,useEffect as l}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-PCKYNZ5Y.js";import{Avatar as t}from"./chunk-MMFJBWJC.js";import{Input_default as a}from"./chunk-GX2GSDJP.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */l("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */n("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */l(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */n("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-
|
|
1
|
+
import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-2SHYR3RA.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
|
|
2
2
|
return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
|
|
3
3
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
|
|
4
4
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
|
|
@@ -10,4 +10,4 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
10
10
|
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${y??d[e]??"text-gray-600"}`,children:x??s[e]??e.slice(0,3).toUpperCase()})]})}function w({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
11
|
return o(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=u(e.entityId,e.label);/* @__PURE__ */
|
|
12
12
|
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${a(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&r(t)?n(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?f[e.fileKind]:d[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function S(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function T(){const e=S();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,T as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,S as peekFilesViewRequest,b as publishDesktopFolders,I as requestFilesDesktopFolderView,j as requestFilesTrashView,v as subscribeDesktopFolders};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-5N5DBTTF.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Input_default as r}from"./chunk-GX2GSDJP.js";import{INPUT_SIZES as n}from"./chunk-PF3ANJFI.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-E6UCGCOC.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},y=e=>t(e.trim());function k(t){const{value:n,kinds:o,rules:k=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:j=""}=t,O=void 0!==t.onApply,P=u().link,$=k.isSafe??y,E=d(),z=c(null),A=c(null),[D,U]=p({url:n}),S=O?D.url:n,[T,R]=p(!1),[W,G]=p(null),[J,K]=p(null),X=c(()=>{});X.current=O?t.onCancel:()=>{},m(()=>{if(O)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(X.current(),!0)},()=>z.current)},[O]),m(()=>{if(!O)return;const e=A.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const B=o??[{value:b,label:P.address,target:{type:"text"}}],H=W&&W.against===S?W.kind:k.kindOf(S),I=B.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===H),L=I.find(e=>"text"===e.target.type),M=I.find(e=>e.value===H)??L??I[0];if(!M)return null;const Q="text"!==M.target.type,V=Q?k.targetOf(S):S,Y=h(M.target),q=Y.find(e=>e.value===V),Z=e=>({value:e,label:P.unavailable(e)}),_="select"===M.target.type&&V&&w?w(V):null,ee=_?k.readFilter(S):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=J&&J.against===S?J.text:S,te=!Q&&""!==le.trim()&&!$(le),re=te&&(!O||T),ne=(e,a)=>{O?U({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},ie=(e,a)=>{G(a=>a?{...a,against:e}:a),ne(e,a)},oe=e=>{if(!e)return ie("");const a=Y.find(a=>a.value===e);ie(e,a?.label)},se=Q?S:le.trim(),ue=()=>{if(!O||!se)return;if(!Q&&te)return void R(!0);const e=Q&&D.url===se?D.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[Z(a),...e]:[...e],ce=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
+
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let pe;if("text"===M.target.type)pe=/* @__PURE__ */f(r,{ref:A,id:`${E}-address`,size:"sm",type:"text",invalid:re,"aria-label":P.address,"aria-describedby":re?`${E}-why`:void 0,placeholder:F??P.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:C,onChange:e=>(e=>{R(!1);const a=e.trim();a?$(e)?(K({text:e,against:a}),ie(a)):K({text:e,against:S}):(K({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===M.target.type?M.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):M.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:M.target.placeholder},...de(e,V)];pe=ce(M.label,V,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce(P.linkType,M.value,I.map(e=>({value:e.value,label:e.label})),e=>{K(null),R(!1);const a=I.find(a=>a.value===e);if(!a||"text"===a.target.type)return void G({kind:e,against:S});const l=h(a.target)[0];G({kind:e,against:l?l.value:""}),l?ne(l.value,l.label):ne("")},!1),pe,_&&ce(P.filter,ee?.param??"",[{value:"",label:P.noFilter},...ee&&!ae?[Z(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(V,q?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(k.withFilter(V,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce(P.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(k.withFilter(V,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),re&&/* @__PURE__ */f("p",{id:`${E}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:P.unsafe}),M.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:M.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:P.filterHint})]});if(!O)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:me});const fe=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:z,role:"dialog","aria-label":N??P.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[Q?/* @__PURE__ */f("span",{className:a({inline:!0}),children:P.title}):/* @__PURE__ */f("label",{htmlFor:`${E}-address`,className:a({inline:!0}),children:P.title}),me,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:P.remove}):null,
|
|
7
|
+
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>X.current(),children:P.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:C||""===se,children:P.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const y=u().link,[w,N]=p(!1),C=c(null),F=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(r,{size:"sm",type:"text",className:"rounded-b-none","aria-label":y.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":y.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${n.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
+
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-gray-400")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-gray-400"),children:t||y.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(k,{value:t,label:y.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{k as LinkPicker,w as TextLinkField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{useShellStrings as i}from"./chunk-E6UCGCOC.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
|
|
3
3
|
/* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
|
|
4
4
|
/* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as c}from"react/jsx-runtime";var o=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,i=l(void 0);function d({href:t,children:r}){const n=s(i),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
2
|
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&n?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&n(l)&&e.preventDefault()}:void 0,children:r})}function m(e){const t=[];let r,n=0,l=0;const s=new RegExp(o.source,"g");for(;null!==(r=s.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
|
|
3
3
|
/* @__PURE__ */c("span",{className:"text-gray-400",children:["[",r[1],"]"]},l++)):void 0!==r[3]?t.push(
|
|
4
4
|
/* @__PURE__ */a(d,{href:r[4],children:r[3]},l++)):void 0!==r[5]?t.push(
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-VU6VPKM3.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-VU6VPKM3.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{FormField as r}from"./chunk-MVQBVPWP.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-7PCI6AUU.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as o}from"./chunk-4IU5BSVE.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
5
5
|
/* @__PURE__ */m("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
|
|
6
6
|
/* @__PURE__ */m(e,{header:"Profile",children:/* @__PURE__ */d("div",{className:"space-y-4",children:[
|
|
7
7
|
/* @__PURE__ */d("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
8
|
-
/* @__PURE__ */m(
|
|
9
|
-
/* @__PURE__ */m(
|
|
10
|
-
/* @__PURE__ */m(
|
|
11
|
-
/* @__PURE__ */m(
|
|
8
|
+
/* @__PURE__ */m(r,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */m(c,{id:"fn",defaultValue:"Alice"})}),
|
|
9
|
+
/* @__PURE__ */m(r,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */m(c,{id:"ln",defaultValue:"Nguyen"})})]}),
|
|
10
|
+
/* @__PURE__ */m(r,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */m(c,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
|
|
11
|
+
/* @__PURE__ */m(r,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */m(i,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
12
12
|
/* @__PURE__ */m(e,{header:"Preferences",children:/* @__PURE__ */d("div",{className:"space-y-4",children:[
|
|
13
13
|
/* @__PURE__ */d("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
14
|
-
/* @__PURE__ */m(
|
|
15
|
-
/* @__PURE__ */m(
|
|
14
|
+
/* @__PURE__ */m(r,{label:"Country",htmlFor:"country",children:/* @__PURE__ */m(l,{value:f,onChange:g,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
15
|
+
/* @__PURE__ */m(r,{label:"Plan",children:/* @__PURE__ */d("div",{className:"space-y-2 pt-1",children:[
|
|
16
16
|
/* @__PURE__ */m(a,{name:"plan",checked:"free"===s,onChange:()=>h("free"),label:"Free"}),
|
|
17
17
|
/* @__PURE__ */m(a,{name:"plan",checked:"pro"===s,onChange:()=>h("pro"),label:"Pro"}),
|
|
18
18
|
/* @__PURE__ */m(a,{name:"plan",checked:"team"===s,onChange:()=>h("team"),label:"Team"})]})})]}),
|
|
19
|
-
/* @__PURE__ */m(
|
|
19
|
+
/* @__PURE__ */m(n,{checked:u,onChange:p,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
20
20
|
/* @__PURE__ */d("div",{className:"flex items-center justify-end gap-2",children:[
|
|
21
21
|
/* @__PURE__ */m(o,{variant:"secondary",children:"Cancel"}),
|
|
22
22
|
/* @__PURE__ */m(o,{type:"submit",children:"Save changes"})]})]})})}export{s as FormLayoutPage};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-Y4MI6NRI.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-Y4MI6NRI.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-I4VD5D43.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-E6UCGCOC.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:j,formatValue:C,yAxisLabel:F,className:L,emptyLabel:A,radius:V=3,loading:O=!1,animate:R=!0,glow:S=!1,emphasise:z=!1,activeKey:E,highlight:I="none",valueLabels:T=!1,onSelect:Y,min:B,formatTooltipValue:U,tooltipLabels:D,barGap:G=4,seriesLabels:H=!1}){const W=x(),{highlighted:J}=r(),K=d().charts,P=f(),Q=C??(t=>p(t,P)),Z=U??Q;if(O)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:L});const q=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},X=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>X.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>X.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>X.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:X.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,X.length),n=X.length>1?Math.min(G,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=H&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>X.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
|
|
2
2
|
return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
|
|
3
|
-
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:j,min:nt?void 0:
|
|
3
|
+
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:j,min:nt?void 0:B,formatValue:nt?t=>b(Math.round(100*t),0,P):Q,yAxisLabel:F,className:L,emptyLabel:A,onSelect:Y,ariaLabel:K.acrossCategories(X.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:D?.[t]??v[t],rows:X.map(e=>({key:e.key,label:e.label,color:q(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,P)} · ${Z(e.data[t])}`:Z(e.data[t]):void 0})),footnote:nt?K.inCategory(Z(tt[t])):void 0}),overlay:T&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),T&&!nt&&v.map((a,n)=>{if(k){if(!X.some(t=>Number.isFinite(t.data[n])))return null;const a=X.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
|
|
4
4
|
return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(a)},`v${n}`)}return X.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
|
|
5
|
-
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=E?v.indexOf(E):-1,c=l(k?tt:X[0]?.data??[],
|
|
5
|
+
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=E?v.indexOf(E):-1,c=l(k?tt:X[0]?.data??[],I),d=s??(h>=0?h:c);/* @__PURE__ */
|
|
6
6
|
return M("g",{children:[
|
|
7
|
-
/* @__PURE__ */y(t,{id:
|
|
8
|
-
return y("rect",{x:M,y:v,width:g,height:w,rx:
|
|
7
|
+
/* @__PURE__ */y(t,{id:W,glow:S}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return X.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=q(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),j=null===d||d===l,C=j?p:z?u.muted:p,F=o(t.key,J);/* @__PURE__ */
|
|
8
|
+
return y("rect",{x:M,y:v,width:g,height:w,rx:V,fill:C,fillOpacity:F??(j?1:z?.32:.45),filter:S&&d===l?`url(#${n(W)})`:void 0,className:"rosh-viz-mark"+(R?` ${e.rise}`:""),style:R?a(l*(k?1:X.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!z&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLanguage as e}from"./chunk-QQCHLRKG.js";import{RadioGroup as a}from"./chunk-TZSPJIP4.js";import{Select_default as n}from"./chunk-
|
|
1
|
+
import{useShellLanguage as e}from"./chunk-QQCHLRKG.js";import{RadioGroup as a}from"./chunk-TZSPJIP4.js";import{Select_default as n}from"./chunk-2PWZNFFP.js";import{Icon as t}from"./chunk-2SHYR3RA.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-gray-500 ${m}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
3
3
|
/* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */s("div",{children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-GATKJSGL.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Segmented as i}from"./chunk-N6DTTOB6.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-FMKTVZAO.js";import{TransferProgress as u}from"./chunk-S7VSXUKS.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-YDYDR72S.js";import{Icon as p}from"./chunk-2SHYR3RA.js";import{useShellStrings as b}from"./chunk-E6UCGCOC.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:U,hint:F,error:O,required:S,className:P,accept:$="image/*",maxSizeBytes:z,fit:V="cover",height:A=112,placeholder:B,cta:H,acceptHint:K,showFilename:T=!0,allowReplace:q=!0,allowRemove:D=!0,replaceLabel:G,removeLabel:Y,busy:I=!1,busyLabel:M,choosingLabel:W,pickFailedLabel:_,progress:E,disabled:J=!1,kind:Q,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,re=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof Y&&Y?Y:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=I||ne,me=ne&&!I?W??ie.choosing:M??ie.uploading,he=O??(se?_??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=J||ue,ke=!!w&&(t(w,$)||w===ve),je=B??r($,ie),xe=G??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:K,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?o(w):"",Ue=!ke&&!!ee,Fe=J||!q&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[q&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
2
|
/* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),
|
|
4
|
-
/* @__PURE__ */j(
|
|
5
|
-
/* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(
|
|
3
|
+
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),D&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Ue?void 0:{height:A},children:[Ue?
|
|
4
|
+
/* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:V,objectPosition:Z||void 0}}),T&&w&&/* @__PURE__ */j(n,{children:Ce}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:E,rounded:"rounded-md"})]}),Se=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":S||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:A},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(x,{children:[
|
|
5
|
+
/* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(s,{})}),
|
|
6
6
|
/* @__PURE__ */j("span",{className:"px-3 text-xs text-gray-500",children:je}),
|
|
7
7
|
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),K&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:K})]})});/* @__PURE__ */
|
|
8
|
-
return k(
|
|
9
|
-
/* @__PURE__ */j(
|
|
8
|
+
return k(a,{label:U,htmlFor:be,hint:F,error:he,required:S,className:P,children:[X&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Oe:Se,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as t}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as o}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as d}from"./chunk-E6UCGCOC.js";import{useRef as m,useId as u,useState as f,useEffect as h}from"react";import{createPortal as p}from"react-dom";import{jsx as x,jsxs as b}from"react/jsx-runtime";var g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function v({open:v,onClose:y,title:k,description:j,role:N="dialog",children:w,footer:C,blocking:T=!1,size:W="md",initialFocus:A,"aria-label":D,"aria-labelledby":J,"aria-describedby":L,className:R=""}){const U=m(null),G=u(),H=u(),z=!T,B=u(),I=d().dialog,K=e(n()),[Q,V]=f(null);return t(v),l(U,v&&null!==K,A),o(v),h(()=>{if(v)return c(()=>(T||y(),!0),()=>U.current)},[v,T,y]),v&&K?p(
|
|
2
|
+
/* @__PURE__ */x(r,{value:Q,children:/* @__PURE__ */b("div",{ref:V,className:"fixed inset-0",style:{zIndex:s.overlay},role:"presentation",children:[
|
|
3
|
+
/* @__PURE__ */x("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */x("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:T?void 0:e=>{e.target===e.currentTarget&&y()},children:/* @__PURE__ */b("div",{ref:U,...i({role:N,modal:!0,titleId:k?B:void 0,labelledBy:J,label:D}),"aria-describedby":L??(j?H:w?G:void 0),className:`relative max-h-full w-full ${g[W]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${R}`.trim(),children:[k&&/* @__PURE__ */x("h2",{id:B,className:(z?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:k}),j&&/* @__PURE__ */x("p",{id:H,className:((k?"mt-1":z?"pr-8":"")+" text-sm text-gray-500").trim(),children:j}),w&&/* @__PURE__ */x("div",{id:G,className:"mt-2 text-sm text-gray-600",children:w}),C&&/* @__PURE__ */x("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:C}),z&&/* @__PURE__ */x("button",{type:"button",onClick:y,"aria-label":I.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */x(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),K):null}export{v as Dialog};
|