efficient-shell 4.165.0 → 4.166.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.
Files changed (56) hide show
  1. package/README.md +75 -2
  2. package/dist/{Browser-ZX5GWPSM.js → Browser-2MBG34IR.js} +14 -14
  3. package/dist/Calculator-R3WJTNZ6.js +29 -0
  4. package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
  5. package/dist/{CurrencyConverter-7OPRFA5D.js → CurrencyConverter-PEXSQQUK.js} +7 -7
  6. package/dist/{Documents-QV63346J.js → Documents-YL4RIOZO.js} +15 -15
  7. package/dist/{Files-BU5V56YF.js → Files-3ZRUTRSB.js} +22 -22
  8. package/dist/Notepad-3ZM2FR6C.js +25 -0
  9. package/dist/{PomodoroTimer-FJV6MGE3.js → PomodoroTimer-5QHA5UOY.js} +14 -14
  10. package/dist/{Preview-PMQKG6FH.js → Preview-32F4DTCK.js} +9 -9
  11. package/dist/{Sidebar-E6GLVCJL.js → Sidebar-QQSRLMJG.js} +22 -22
  12. package/dist/Spreadsheet-GOZI7I4L.js +37 -0
  13. package/dist/{Stock-SSNUY34E.js → Stock-XJFITZZA.js} +4 -4
  14. package/dist/{Weather-T5WM66B2.js → Weather-BDC633GV.js} +16 -16
  15. package/dist/{WorldClock-C3GT27AV.js → WorldClock-ROOVRRCJ.js} +7 -7
  16. package/dist/apps/index.js +1 -1
  17. package/dist/brand.css +1 -1
  18. package/dist/{chunk-QTPVA26D.js → chunk-7TQ7NMT3.js} +1 -1
  19. package/dist/{chunk-PLX2N4N6.js → chunk-7YFAFXQG.js} +2 -2
  20. package/dist/chunk-AFYQTVZO.js +1 -0
  21. package/dist/chunk-BKDE67DB.js +12 -0
  22. package/dist/{chunk-A7Q4BCPI.js → chunk-CRI4UFBU.js} +5 -5
  23. package/dist/{chunk-DJ6UVHAZ.js → chunk-DTRXR6JQ.js} +11 -11
  24. package/dist/chunk-G5J6YSN5.js +5 -0
  25. package/dist/{chunk-YWXYBJ5Y.js → chunk-HA2WG27U.js} +2 -2
  26. package/dist/{chunk-D7EJSASN.js → chunk-HGG5M5AB.js} +1 -1
  27. package/dist/chunk-HZZNJHRH.js +1 -0
  28. package/dist/chunk-JKVDTKBE.js +988 -0
  29. package/dist/chunk-M4DB7UBZ.js +29 -0
  30. package/dist/{chunk-RKEHUV7U.js → chunk-QASZIYLG.js} +1 -1
  31. package/dist/chunk-SOI4LR67.js +27 -0
  32. package/dist/chunk-UVZIPXIA.js +10 -0
  33. package/dist/chunk-VRHUY4P4.js +1 -0
  34. package/dist/{chunk-ZLJCWBDF.js → chunk-VXBJNMAA.js} +60 -60
  35. package/dist/chunk-X4FJ54PP.js +1 -0
  36. package/dist/{index-DRkpyISn.d.ts → index-DcLqfJX3.d.ts} +182 -13
  37. package/dist/index.d.ts +3 -13
  38. package/dist/index.js +83 -83
  39. package/dist/map/index.js +3 -3
  40. package/dist/page-tabs/index.js +5 -5
  41. package/dist/ui/index.d.ts +1 -1
  42. package/dist/ui/index.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/Calculator-NZH4FVRW.js +0 -29
  45. package/dist/ConfirmDialog-WEVZTFLU.js +0 -1
  46. package/dist/Notepad-KZIJ5ZTF.js +0 -25
  47. package/dist/Spreadsheet-DE5HPVE2.js +0 -37
  48. package/dist/chunk-4UCRT4ST.js +0 -5
  49. package/dist/chunk-ELSUXC3N.js +0 -1
  50. package/dist/chunk-FGPWGHNT.js +0 -27
  51. package/dist/chunk-KRTZFHYW.js +0 -29
  52. package/dist/chunk-MAIHBBWT.js +0 -1
  53. package/dist/chunk-SHVGZW2J.js +0 -1
  54. package/dist/chunk-SQ7BPUZG.js +0 -9
  55. package/dist/chunk-VDL2RLZG.js +0 -10
  56. package/dist/chunk-XYITV4EC.js +0 -983
package/dist/map/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import{Button_default as e}from"../chunk-4UCRT4ST.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-MAIHBBWT.js";import{useShellStrings as r}from"../chunk-NCQLGQYR.js";import{useRef as o,useState as a,useEffect as l,useCallback as i,useMemo as s,useSyncExternalStore as c}from"react";import{createPortal as u}from"react-dom";import{jsxs as d,jsx as p,Fragment as m}from"react/jsx-runtime";import{useQuery as h}from"@tanstack/react-query";var g="maplibregl-compact-show";function f(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(g)&&(e.classList.remove(g),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var y=20,b=12,x=480,v={center:[0,0],left:[y,0],right:[-20,0],top:[0,y],"top-left":[0,y],"top-right":[0,y],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},w=(e,t=12)=>Math.max(0,Math.floor(e-t-b-y-10-16));function k(e,t,n,r=12){const o=e.y-y-r,a=n.height-e.y-y-b,l=t.height<=o||t.height>a&&o>=a,i=l?Math.max(0,t.height-o):-Math.max(0,t.height-a);let s="",c=0;return e.x-t.width/2<b?(s="-left",c=Math.max(0,b-e.x)):e.x+t.width/2>n.width-b&&(s="-right",c=-Math.max(0,e.x-(n.width-b))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var M="maplibre-gl-worker.mjs",N=e=>`/maplibre-gl/${e}/${M}`,C=null;function L(){return C??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(N(e.getVersion())),e)).catch(e=>{throw C=null,e}),C}var $=24,S=28,E=29;function j(e){const t=[...e].sort((e,t)=>e-t),n=[];for(let e=0;e<t.length;){let r=e;for(;r+1<t.length&&t[r+1]===t[r]+1;)r++;n.push(r===e?String(t[e]):`${t[e]}–${t[r]}`),e=r+1}return n.join(", ")}function A(e){const t=Math.max(S,12+8*e.length);return t+t%2}var z=(e,t,n,r)=>({left:e-n/2,top:t-r/2,right:e+n/2,bottom:t+r/2});function B(e,t){return e.left<t.right+1&&t.left<e.right+1&&e.top<t.bottom+1&&t.top<e.bottom+1}var R=e=>z(e.x,e.y,e.width,e.height);function T(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(R(e[t]),R(e[n])))return[e[t],e[n]];return null}function O(e,t=[]){const n=[],r=e=>t.some(t=>B(t,e));let o=e.filter(e=>null!==e.stop).sort((e,t)=>e.stop-t.stop).map(e=>({keys:[e.key],stops:[e.stop],x:e.x,y:e.y,width:S,height:S,under:0}));for(let e=T(o);e;e=T(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=A(j(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(R(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=z(t.x,t.y,$,$),l=o.find(t=>B(R(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(R(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:$,height:$,under:0})}return{groups:[...o,...a],hidden:n}}function W(e,t,n){let r=-1/0;for(const o of t){const t=Math.max(Math.abs(o.x-e.x),Math.abs(o.y-e.y));r=Math.max(r,0===t?1/0:n+Math.log2(29/t))}return r}function q(e){const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:n}),()=>t.disconnect()}var F=t;var K="routes",_=["routes-road","routes-estimate"];function H(e){const t=document.createElement("span");t.style.display="none",t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color||"#2563eb";return t.remove(),P(n)}function P(e){const t=document.createElement("canvas").getContext("2d");if(!t)return"#2563eb";t.fillStyle="#2563eb",t.fillStyle=e,t.fillRect(0,0,1,1);const[n,r,o]=t.getImageData(0,0,1,1).data;return`rgb(${n}, ${r}, ${o})`}var I={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},D={center:[30,20],zoom:1},Z="ring-2 ring-gray-900 ring-offset-2";var G="var(--color-gray-600, #4b5563)",V="http://www.w3.org/2000/svg",U=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function Y(e){return e.split(/\s+/).some(e=>{const t=e.search(/[[(]/),n=t<0?e:e.slice(0,t),r=e.slice(n.lastIndexOf(":")+1);return r.startsWith("border-")&&!Q.test(r.slice(7))})}var J=(...e)=>e.filter(Boolean).join(" ");function X(e){const t=document.createElementNS(V,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("aria-hidden","true");for(const n of e){const e=document.createElementNS(V,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function ee(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var te=(e,t)=>J("relative grid place-items-center rounded-full cursor-pointer",t&&(null!=e.stop?"h-7 w-7":"h-6 w-6"));function ne(e,t,n,r){const o=t&&!r&&null==e.stop&&!e.dot;return J("grid place-items-center rounded-full border-2 font-semibold leading-none shadow-md transition-transform motion-reduce:transition-none",!Y(e.tone)&&"border-white",e.tone,e.dot?"h-4 w-4 opacity-80":null!=e.stop?"h-7 w-7 text-xs ring-2 ring-gray-900":o?"h-8 w-8 text-xs [&_svg]:h-4 [&_svg]:w-4":"h-6 w-6 text-[10px] [&_svg]:h-3.5 [&_svg]:w-3.5",t&&(o?"ring-2 ring-gray-900 ring-offset-1":Z),e.approximate&&"border-dashed opacity-80",e.faded&&!t&&"opacity-40",n&&"scale-125 opacity-100")}var re=e=>J("grid place-items-center border-2 px-0.5 text-xs font-semibold leading-none shadow-sm",e.stop?"h-7 min-w-7":"h-6 min-w-6",!Y(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function oe({pins:t,selectedKey:n,focus:s,onSelect:m,ariaLabel:h,className:g="",children:y,routes:b,fitTo:x,attribution:M,marks:N,groupCrowded:C=!1,noun:E,highlightKey:A=null,picking:z=!1,onPick:B,card:R,cardMinMapWidth:T=480,fullScreen:V,initialView:Q=D,cooperativeGestures:Y=!1}){const oe=r().map,ie=o(null),se=o(null),ce=o(null),ue=o(null),de=o([]),pe=o(/* @__PURE__ */new Map),me=o(/* @__PURE__ */new Map),he=o(/* @__PURE__ */new Map),ge=o(null),fe=o(/* @__PURE__ */new Map),ye=o(""),[be,xe]=a(!1),[ve,we]=a(!1),ke=c(q,F,()=>!1)?"dark":"light",Me=o({onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:E});l(()=>{Me.current={onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:E}});const Ne=i(()=>{const e=ce.current,{pins:t,selectedKey:n}=Me.current,r=n?t.find(e=>e.key===n):void 0;e&&r&&!e.getBounds().contains([r.lng,r.lat])&&e.easeTo({center:[r.lng,r.lat],duration:U()?0:400})},[]),Ce=o(!1),Le=i((e,t)=>{const n=ce.current,r=ue.current;if(!n||!r)return;const o=n.getZoom();if(o>=17.5){const t=e.indexOf(Me.current.selectedKey??"");return void Me.current.onSelect(e[(t+1)%e.length])}const a=e.map(e=>pe.current.get(e).pin),l=new r.LngLatBounds([a[0].lng,a[0].lat],[a[0].lng,a[0].lat]);for(const e of a)l.extend([e.lng,e.lat]);const i=a.map(e=>n.project([e.lng,e.lat])),s=Math.max(...i.map((e,t)=>W(e,i.filter((e,n)=>n!==t),o))),{clientWidth:c,clientHeight:u}=n.getContainer(),d=n.cameraForBounds(l,{padding:Math.min(64,c/4,u/4)})?.zoom??18,p=document.activeElement===t;Ce.current=!0,n.once("moveend",()=>{if(Ce.current=!1,!p)return;const e=a[0].key,t=pe.current.get(e)?.button,n=t&&"none"!==t.style.display?t:[...me.current.values()].find(t=>t.keys.includes(e))?.button;n?.focus({preventScroll:!0})}),n.easeTo({center:l.getCenter(),zoom:Math.min(18,Math.max(o+1,Math.min(d,s))),duration:U()?0:600})},[]),$e=i(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ie.current||Ce.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Me.current;for(const[e,t]of pe.current){const a=ne(t.pin,e===n,e===r,o);t.mark.className!==a&&(t.mark.className=a);const l=e===n?"1":"";t.button.style.zIndex!==l&&(t.button.style.zIndex=l)}let i=null;if(o){const r=e.getContainer().getBoundingClientRect(),o=[...ie.current.querySelectorAll("a[href], button, input, select, textarea, summary, [role='button'], [tabindex]:not([tabindex='-1'])")].filter(e=>!e.closest("[data-pin], [data-pin-group], .maplibregl-canvas")).map(e=>{const t=e.getBoundingClientRect(),n=e.closest("[data-map-card]")?.getBoundingClientRect()??t;return{left:Math.max(t.left,n.left)-r.left,top:Math.max(t.top,n.top)-r.top,right:Math.min(t.right,n.right)-r.left,bottom:Math.min(t.bottom,n.bottom)-r.top}}).filter(e=>e.right>e.left&&e.bottom>e.top);i=O([...pe.current.values()].map(({pin:t})=>{const n=e.project([t.lng,t.lat]);return{key:t.key,x:n.x,y:n.y,stop:t.stop??null}}),o);const s=e=>(l??a.places)(e),c=e.getZoom()<17.5?a.spread:a.cycle,u=(e,t)=>{const n=t?"":"none";e.style.display!==n&&(e.style.display=n)},d=/* @__PURE__ */new Map;for(const r of i.groups){const o=r.under>0?a.closeBy(r.under,s(r.under)):null,l=1===r.keys.length?pe.current.get(r.keys[0]):null;if(l){u(l.button,!0),l.button.setAttribute("aria-label",o?`${l.name}; ${o}`:l.name),l.button.title=o?`${l.title}\n${o}`:l.title;continue}for(const e of r.keys)u(pe.current.get(e).button,!1);const i=r.keys.join(" ");let p=me.current.get(i);if(!p){const n=document.createElement("button");n.type="button",n.dataset.pinGroup="",n.className="grid place-items-center rounded-full cursor-pointer",n.append(document.createElement("span"));const o=pe.current.get(r.keys[0]).pin,a={button:n,keys:r.keys,marker:new t.Marker({element:n,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)};n.addEventListener("click",e=>{e.stopPropagation(),Le(a.keys,n)}),p=a}p.keys=r.keys;const m=r.keys.map(e=>pe.current.get(e)),h=r.stops.length>0?j(r.stops):String(m.length),g=r.stops.length>0?a.stops(h):a.group(m.length,s(m.length));p.button.style.width=`${r.width}px`,p.button.style.height=`${r.height}px`,p.button.setAttribute("aria-label",`${g}: ${m.map(e=>e.pin.label).join("; ")}. ${c}${o?`; ${o}`:""}.`),p.button.title=[`${g}:`,...m.map(e=>e.title),...o?[o]:[],c].join("\n");const f=p.button.firstElementChild;f.textContent=h;const y=J("grid place-items-center rounded-full border-2 border-gray-700 bg-white font-semibold leading-none text-gray-900 shadow-sm",r.stops.length>0?"h-7 w-full px-1 text-xs ring-2 ring-gray-900":m.every(e=>e.pin.dot)?"h-5 w-5 text-[0.6rem]":"h-6 w-6 text-[0.7rem]",null!=n&&r.keys.includes(n)&&Z);f.className!==y&&(f.className=y),d.set(i,p)}for(const e of i.hidden)u(pe.current.get(e).button,!1);for(const[e,t]of me.current)d.has(e)||t.marker.remove();me.current=d}if(ge.current){const e=r&&i?i.groups.find(e=>e.keys.includes(r)&&e.keys.length>1):void 0,t=r?pe.current.get(r):void 0,n=r?he.current.get(r):void 0,o=e?{at:pe.current.get(e.keys[0]).pin,width:e.width,height:e.height}:t?{at:t.pin,width:t.button.offsetWidth||(null!=t.pin.stop?S:$),height:t.button.offsetHeight||(null!=t.pin.stop?S:$)}:n?{at:n.mark,width:n.element.offsetWidth||S,height:n.element.offsetHeight||S}:null,a=ge.current.getElement();a.style.display=o?"":"none",o&&(ge.current.setLngLat([o.at.lng,o.at.lat]),a.style.width=`${o.width+22}px`,a.style.height=`${o.height+22}px`)}},[Le]);l(()=>{if($e(),!ie.current)return;const e=new ResizeObserver(()=>$e());e.observe(ie.current);for(const t of ie.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),l(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await L();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:I[ke],center:Q.center,zoom:Q.zoom,attributionControl:M?{compact:!0,customAttribution:M}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===Y?window.matchMedia("(pointer: coarse)").matches:Y}),t.touchZoomRotate.disableRotation(),t.keyboard.disableRotation(),t.addControl(new o.NavigationControl({showCompass:!1}),"top-right");const a=document.createElement("div");a.dataset.pinRing="",a.setAttribute("aria-hidden","true"),a.className="pointer-events-none rounded-full border-2 border-gray-900 bg-gray-900/15 shadow-[0_0_0_2px_var(--color-white,#fff)]",a.style.display="none",ge.current=new o.Marker({element:a,anchor:"center"}).setLngLat(Q.center).addTo(t),t.on("click",e=>{Me.current.picking&&Me.current.onPick?.({lat:e.lngLat.lat,lng:e.lngLat.lng})}),t.on("move",$e),t.on("moveend",$e),t.on("resize",$e),t.on("error",e=>console.warn("[map]",e.error?.message)),r=f(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ne()}),n.observe(se.current),ce.current=t,xe(!0)}catch(t){console.error("[map] could not start",t),e||we(!0)}})(),()=>{e=!0,n?.disconnect(),r(),de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),ge.current?.remove(),ge.current=null,t?.remove(),ce.current=null}},[]);const Se=o(ke);l(()=>{be&&ce.current&&Se.current!==ke&&(Se.current=ke,ce.current.setStyle(I[ke]))},[be,ke]),l(()=>{const e=ce.current,n=ue.current;if(!be||!e||!n)return;de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),pe.current.clear(),he.current.clear();for(const e of fe.current.keys())t.some(t=>t.key===e)||fe.current.delete(e);const r=Me.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=te(o,C);const a=o.approximate?r.approximate(o.label):o.label,l=o.title??(o.approximate?r.approximateTitle(o.label):o.label);t.setAttribute("aria-label",a),t.title=l;const i=document.createElement("span");if(ee(i,o.data),o.dot);else if(null!=o.iconNode){const e=fe.current.get(o.key);e&&i.append(e)}else o.icon?.length?i.append(X(o.icon)):i.textContent=null!=o.stop?String(o.stop):o.glyph;if(t.append(i),o.badge){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className=J("absolute -right-2 -top-2 grid h-4 min-w-4 place-items-center rounded-full px-0.5 text-[9px] font-semibold leading-none shadow",o.badgeTone??"bg-white text-gray-900"),e.textContent=o.badge,t.appendChild(e)}t.addEventListener("click",e=>{e.stopPropagation(),Me.current.onSelect(o.key)}),de.current.push(new n.Marker({element:t,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)),pe.current.set(o.key,{pin:o,button:t,mark:i,name:a,title:l})}for(const t of N??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,ee(r,t.data),r.className=re(t),r.textContent=t.text,r.title=t.title??t.label,r.setAttribute("role","img"),r.setAttribute("aria-label",t.label),de.current.push(new n.Marker({element:r,anchor:"center"}).setLngLat([t.lng,t.lat]).addTo(e)),he.current.set(t.key,{mark:t,element:r})}$e()},[be,t,N,C,$e]),l(()=>{be&&$e()},[be,n,A,$e]),l(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ne);return()=>cancelAnimationFrame(e)},[be,n,Ne]),l(()=>{const e=ce.current,n=ue.current,r=x?[...t,...N??[]].filter(e=>x.includes(e.key)):t;if(!be||!e||!n||0===r.length)return;const o=r.map(e=>`${e.key}@${e.lat},${e.lng}`).sort().join("|");if(ye.current===o)return;const a=""===ye.current;if(ye.current=o,1===r.length)return void e.jumpTo({center:[r[0].lng,r[0].lat],zoom:13});const l=new n.LngLatBounds([r[0].lng,r[0].lat],[r[0].lng,r[0].lat]);for(const e of r)l.extend([e.lng,e.lat]);e.fitBounds(l,{padding:48,maxZoom:14,animate:!a})},[be,t,N,x]),l(()=>{const e=ce.current;if(!be||!e)return;const t=(b??[]).filter(e=>e.coordinates.length>=2),n=[...new Set(t.flatMap(e=>e.attribution?[e.attribution]:[]))].join(" · "),r=()=>{const r=function(){const e=document.createElement("span");e.className="text-blue-600",e.style.display="none",document.body.appendChild(e);const t=getComputedStyle(e).color||"#2563eb";return e.remove(),P(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?H(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(K);if(i&&(i.attribution||"")!==n){for(const t of _)e.getLayer(t)&&e.removeLayer(t);e.removeSource(K)}const s=e.getSource(K);s?s.setData(o):e.addSource(K,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:K,filter:["!",["get","estimate"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":4,"line-opacity":a}}),e.getLayer("routes-estimate")||e.addLayer({id:"routes-estimate",type:"line",source:K,filter:["get","estimate"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":3,"line-dasharray":[1.5,1.5],"line-opacity":a}})},o=()=>{try{r()}catch(e){console.debug("[map] routes wait for the style",e)}};return o(),e.on("style.load",o),e.once("idle",o),()=>{e.off("style.load",o),e.off("idle",o)}},[be,b,ke]),l(()=>{const e=ce.current;if(!be||!e||!s)return;const n=t.find(e=>e.key===s.key);if(!n)return;const r=e.getZoom(),o=C?W(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,a={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,o))};U()?e.jumpTo(a):e.flyTo({...a,duration:600})},[be,s?.n]);const[Ee,je]=a(!1);l(()=>{const e=ie.current;if(!e)return;const t=()=>je(e.clientWidth<T);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[T]);const Ae=n?t.find(e=>e.key===n)??null:null,ze=Ae?.key??null,Be=Ae?.lng??0,Re=Ae?.lat??0,Te=be&&!Ee&&null!=R&&!!Ae,[Oe,We]=a(null);l(()=>{const e=ce.current,t=ue.current;if(!(Te&&e&&t&&ze))return;const n=document.createElement("div");n.dataset.mapCard="",n.className="w-[26rem] overflow-y-auto overscroll-contain";const r=new t.Popup({anchor:"bottom",offset:v,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Be,Re]).setDOMContent(n).addTo(e),o=r.getElement(),a=o.querySelector(".maplibregl-popup-content");a&&Object.assign(a.style,{padding:"0",background:"transparent",borderRadius:"0",boxShadow:"none"});const l=o.querySelector(".maplibregl-popup-tip");l&&Object.assign(l.style,{borderTopColor:G,borderBottomColor:G}),We(n);let i=!1,s=!1;const c=(t=!0)=>{if(s)return;if(e.isMoving())return void(i||(i=!0,e.once("moveend",()=>{i=!1,c()})));const{clientWidth:o,clientHeight:a}=e.getContainer(),l=function(e,t){const n=e.getBoundingClientRect().top,r=[...e.querySelectorAll(".maplibregl-ctrl-top-left > *, .maplibregl-ctrl-top-right > *"),...t?.querySelectorAll(":scope > [data-map-control]")??[]];let o=0;for(const e of r){const t=e.getBoundingClientRect();t.height>0&&(o=Math.max(o,t.bottom-n))}return o}(e.getContainer(),ie.current)+8,u=`${w(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=k(e.project(p),{width:d.offsetWidth,height:d.offsetHeight},{width:o,height:a},l);r.options.anchor!==m&&(r.options.anchor=m,r.setLngLat(p)),!t||0===h.x&&0===h.y||e.panBy([-h.x,-h.y],{duration:U()?0:250}),$e()},u=new ResizeObserver(()=>c());u.observe(n);const d=()=>c(),p=()=>{i||c(!1)};e.on("resize",d),e.on("moveend",p);let m=!1;const h=pe.current,g=e=>{m=n.contains(e.target)};return document.addEventListener("focusin",g),()=>{if(s=!0,u.disconnect(),e.off("resize",d),e.off("moveend",p),document.removeEventListener("focusin",g),r.remove(),We(null),m&&(!document.activeElement||document.activeElement===document.body)){const e=h.get(ze)?.button;e&&"none"!==e.style.display&&e.focus({preventScroll:!0})}}},[Te,ze,Be,Re,$e]);const qe=V?.active??!1,Fe=o(V?.onChange);l(()=>{Fe.current=V?.onChange}),l(()=>{if(!V)return;const e=document.documentElement;qe&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!qe&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[qe]);const Ke=!!V;return l(()=>{if(!Ke)return;const e=()=>{document.fullscreenElement||Fe.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[Ke]),/* @__PURE__ */d("div",{ref:ie,className:J("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",z&&"[&_canvas]:cursor-crosshair",g),children:[
2
+ import{Button_default as e}from"../chunk-BKDE67DB.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-HZZNJHRH.js";import"../chunk-D65T4H6J.js";import"../chunk-X4FJ54PP.js";import{useShellStrings as r}from"../chunk-NCQLGQYR.js";import{useRef as o,useState as a,useEffect as l,useCallback as i,useMemo as s,useSyncExternalStore as c}from"react";import{createPortal as u}from"react-dom";import{jsxs as d,jsx as p,Fragment as m}from"react/jsx-runtime";import{useQuery as h}from"@tanstack/react-query";var g="maplibregl-compact-show";function f(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(g)&&(e.classList.remove(g),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var y=20,b=12,x=480,v={center:[0,0],left:[y,0],right:[-20,0],top:[0,y],"top-left":[0,y],"top-right":[0,y],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},w=(e,t=12)=>Math.max(0,Math.floor(e-t-b-y-10-16));function k(e,t,n,r=12){const o=e.y-y-r,a=n.height-e.y-y-b,l=t.height<=o||t.height>a&&o>=a,i=l?Math.max(0,t.height-o):-Math.max(0,t.height-a);let s="",c=0;return e.x-t.width/2<b?(s="-left",c=Math.max(0,b-e.x)):e.x+t.width/2>n.width-b&&(s="-right",c=-Math.max(0,e.x-(n.width-b))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var M="maplibre-gl-worker.mjs",N=e=>`/maplibre-gl/${e}/${M}`,C=null;function L(){return C??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(N(e.getVersion())),e)).catch(e=>{throw C=null,e}),C}var $=24,E=28,S=29;function j(e){const t=[...e].sort((e,t)=>e-t),n=[];for(let e=0;e<t.length;){let r=e;for(;r+1<t.length&&t[r+1]===t[r]+1;)r++;n.push(r===e?String(t[e]):`${t[e]}–${t[r]}`),e=r+1}return n.join(", ")}function z(e){const t=Math.max(E,12+8*e.length);return t+t%2}var A=(e,t,n,r)=>({left:e-n/2,top:t-r/2,right:e+n/2,bottom:t+r/2});function B(e,t){return e.left<t.right+1&&t.left<e.right+1&&e.top<t.bottom+1&&t.top<e.bottom+1}var R=e=>A(e.x,e.y,e.width,e.height);function T(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(R(e[t]),R(e[n])))return[e[t],e[n]];return null}function O(e,t=[]){const n=[],r=e=>t.some(t=>B(t,e));let o=e.filter(e=>null!==e.stop).sort((e,t)=>e.stop-t.stop).map(e=>({keys:[e.key],stops:[e.stop],x:e.x,y:e.y,width:E,height:E,under:0}));for(let e=T(o);e;e=T(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=z(j(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(R(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=A(t.x,t.y,$,$),l=o.find(t=>B(R(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(R(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:$,height:$,under:0})}return{groups:[...o,...a],hidden:n}}function F(e,t,n){let r=-1/0;for(const o of t){const t=Math.max(Math.abs(o.x-e.x),Math.abs(o.y-e.y));r=Math.max(r,0===t?1/0:n+Math.log2(29/t))}return r}function K(e){const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:n}),()=>t.disconnect()}var W=t;var q="routes",H=["routes-road","routes-estimate"];function _(e){const t=document.createElement("span");t.style.display="none",t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color||"#2563eb";return t.remove(),P(n)}function P(e){const t=document.createElement("canvas").getContext("2d");if(!t)return"#2563eb";t.fillStyle="#2563eb",t.fillStyle=e,t.fillRect(0,0,1,1);const[n,r,o]=t.getImageData(0,0,1,1).data;return`rgb(${n}, ${r}, ${o})`}var D={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},I={center:[30,20],zoom:1},Z="ring-2 ring-gray-900 ring-offset-2";var G="var(--color-gray-600, #4b5563)",V="http://www.w3.org/2000/svg",J=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function U(e){return e.split(/\s+/).some(e=>{const t=e.search(/[[(]/),n=t<0?e:e.slice(0,t),r=e.slice(n.lastIndexOf(":")+1);return r.startsWith("border-")&&!Q.test(r.slice(7))})}var X=(...e)=>e.filter(Boolean).join(" ");function Y(e){const t=document.createElementNS(V,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("aria-hidden","true");for(const n of e){const e=document.createElementNS(V,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function ee(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var te=(e,t)=>X("relative grid place-items-center rounded-full cursor-pointer",t&&(null!=e.stop?"h-7 w-7":"h-6 w-6"));function ne(e,t,n,r){const o=t&&!r&&null==e.stop&&!e.dot;return X("grid place-items-center rounded-full border-2 font-semibold leading-none shadow-md transition-transform motion-reduce:transition-none",!U(e.tone)&&"border-white",e.tone,e.dot?"h-4 w-4 opacity-80":null!=e.stop?"h-7 w-7 text-xs ring-2 ring-gray-900":o?"h-8 w-8 text-xs [&_svg]:h-4 [&_svg]:w-4":"h-6 w-6 text-[10px] [&_svg]:h-3.5 [&_svg]:w-3.5",t&&(o?"ring-2 ring-gray-900 ring-offset-1":Z),e.approximate&&"border-dashed opacity-80",e.faded&&!t&&"opacity-40",n&&"scale-125 opacity-100")}var re=e=>X("grid place-items-center border-2 px-0.5 text-xs font-semibold leading-none shadow-sm",e.stop?"h-7 min-w-7":"h-6 min-w-6",!U(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function oe({pins:t,selectedKey:n,focus:s,onSelect:m,ariaLabel:h,className:g="",children:y,routes:b,fitTo:x,attribution:M,marks:N,groupCrowded:C=!1,noun:S,highlightKey:z=null,picking:A=!1,onPick:B,card:R,cardMinMapWidth:T=480,fullScreen:V,initialView:Q=I,cooperativeGestures:U=!1}){const oe=r().map,ie=o(null),se=o(null),ce=o(null),ue=o(null),de=o([]),pe=o(/* @__PURE__ */new Map),me=o(/* @__PURE__ */new Map),he=o(/* @__PURE__ */new Map),ge=o(null),fe=o(/* @__PURE__ */new Map),ye=o(""),[be,xe]=a(!1),[ve,we]=a(!1),ke=c(K,W,()=>!1)?"dark":"light",Me=o({onSelect:m,onPick:B,picking:A,pins:t,selectedKey:n,highlightKey:z,groupCrowded:C,strings:oe,noun:S});l(()=>{Me.current={onSelect:m,onPick:B,picking:A,pins:t,selectedKey:n,highlightKey:z,groupCrowded:C,strings:oe,noun:S}});const Ne=i(()=>{const e=ce.current,{pins:t,selectedKey:n}=Me.current,r=n?t.find(e=>e.key===n):void 0;e&&r&&!e.getBounds().contains([r.lng,r.lat])&&e.easeTo({center:[r.lng,r.lat],duration:J()?0:400})},[]),Ce=o(!1),Le=i((e,t)=>{const n=ce.current,r=ue.current;if(!n||!r)return;const o=n.getZoom();if(o>=17.5){const t=e.indexOf(Me.current.selectedKey??"");return void Me.current.onSelect(e[(t+1)%e.length])}const a=e.map(e=>pe.current.get(e).pin),l=new r.LngLatBounds([a[0].lng,a[0].lat],[a[0].lng,a[0].lat]);for(const e of a)l.extend([e.lng,e.lat]);const i=a.map(e=>n.project([e.lng,e.lat])),s=Math.max(...i.map((e,t)=>F(e,i.filter((e,n)=>n!==t),o))),{clientWidth:c,clientHeight:u}=n.getContainer(),d=n.cameraForBounds(l,{padding:Math.min(64,c/4,u/4)})?.zoom??18,p=document.activeElement===t;Ce.current=!0,n.once("moveend",()=>{if(Ce.current=!1,!p)return;const e=a[0].key,t=pe.current.get(e)?.button,n=t&&"none"!==t.style.display?t:[...me.current.values()].find(t=>t.keys.includes(e))?.button;n?.focus({preventScroll:!0})}),n.easeTo({center:l.getCenter(),zoom:Math.min(18,Math.max(o+1,Math.min(d,s))),duration:J()?0:600})},[]),$e=i(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ie.current||Ce.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Me.current;for(const[e,t]of pe.current){const a=ne(t.pin,e===n,e===r,o);t.mark.className!==a&&(t.mark.className=a);const l=e===n?"1":"";t.button.style.zIndex!==l&&(t.button.style.zIndex=l)}let i=null;if(o){const r=e.getContainer().getBoundingClientRect(),o=[...ie.current.querySelectorAll("a[href], button, input, select, textarea, summary, [role='button'], [tabindex]:not([tabindex='-1'])")].filter(e=>!e.closest("[data-pin], [data-pin-group], .maplibregl-canvas")).map(e=>{const t=e.getBoundingClientRect(),n=e.closest("[data-map-card]")?.getBoundingClientRect()??t;return{left:Math.max(t.left,n.left)-r.left,top:Math.max(t.top,n.top)-r.top,right:Math.min(t.right,n.right)-r.left,bottom:Math.min(t.bottom,n.bottom)-r.top}}).filter(e=>e.right>e.left&&e.bottom>e.top);i=O([...pe.current.values()].map(({pin:t})=>{const n=e.project([t.lng,t.lat]);return{key:t.key,x:n.x,y:n.y,stop:t.stop??null}}),o);const s=e=>(l??a.places)(e),c=e.getZoom()<17.5?a.spread:a.cycle,u=(e,t)=>{const n=t?"":"none";e.style.display!==n&&(e.style.display=n)},d=/* @__PURE__ */new Map;for(const r of i.groups){const o=r.under>0?a.closeBy(r.under,s(r.under)):null,l=1===r.keys.length?pe.current.get(r.keys[0]):null;if(l){u(l.button,!0),l.button.setAttribute("aria-label",o?`${l.name}; ${o}`:l.name),l.button.title=o?`${l.title}\n${o}`:l.title;continue}for(const e of r.keys)u(pe.current.get(e).button,!1);const i=r.keys.join(" ");let p=me.current.get(i);if(!p){const n=document.createElement("button");n.type="button",n.dataset.pinGroup="",n.className="grid place-items-center rounded-full cursor-pointer",n.append(document.createElement("span"));const o=pe.current.get(r.keys[0]).pin,a={button:n,keys:r.keys,marker:new t.Marker({element:n,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)};n.addEventListener("click",e=>{e.stopPropagation(),Le(a.keys,n)}),p=a}p.keys=r.keys;const m=r.keys.map(e=>pe.current.get(e)),h=r.stops.length>0?j(r.stops):String(m.length),g=r.stops.length>0?a.stops(h):a.group(m.length,s(m.length));p.button.style.width=`${r.width}px`,p.button.style.height=`${r.height}px`,p.button.setAttribute("aria-label",`${g}: ${m.map(e=>e.pin.label).join("; ")}. ${c}${o?`; ${o}`:""}.`),p.button.title=[`${g}:`,...m.map(e=>e.title),...o?[o]:[],c].join("\n");const f=p.button.firstElementChild;f.textContent=h;const y=X("grid place-items-center rounded-full border-2 border-gray-700 bg-white font-semibold leading-none text-gray-900 shadow-sm",r.stops.length>0?"h-7 w-full px-1 text-xs ring-2 ring-gray-900":m.every(e=>e.pin.dot)?"h-5 w-5 text-[0.6rem]":"h-6 w-6 text-[0.7rem]",null!=n&&r.keys.includes(n)&&Z);f.className!==y&&(f.className=y),d.set(i,p)}for(const e of i.hidden)u(pe.current.get(e).button,!1);for(const[e,t]of me.current)d.has(e)||t.marker.remove();me.current=d}if(ge.current){const e=r&&i?i.groups.find(e=>e.keys.includes(r)&&e.keys.length>1):void 0,t=r?pe.current.get(r):void 0,n=r?he.current.get(r):void 0,o=e?{at:pe.current.get(e.keys[0]).pin,width:e.width,height:e.height}:t?{at:t.pin,width:t.button.offsetWidth||(null!=t.pin.stop?E:$),height:t.button.offsetHeight||(null!=t.pin.stop?E:$)}:n?{at:n.mark,width:n.element.offsetWidth||E,height:n.element.offsetHeight||E}:null,a=ge.current.getElement();a.style.display=o?"":"none",o&&(ge.current.setLngLat([o.at.lng,o.at.lat]),a.style.width=`${o.width+22}px`,a.style.height=`${o.height+22}px`)}},[Le]);l(()=>{if($e(),!ie.current)return;const e=new ResizeObserver(()=>$e());e.observe(ie.current);for(const t of ie.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),l(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await L();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:D[ke],center:Q.center,zoom:Q.zoom,attributionControl:M?{compact:!0,customAttribution:M}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===U?window.matchMedia("(pointer: coarse)").matches:U}),t.touchZoomRotate.disableRotation(),t.keyboard.disableRotation(),t.addControl(new o.NavigationControl({showCompass:!1}),"top-right");const a=document.createElement("div");a.dataset.pinRing="",a.setAttribute("aria-hidden","true"),a.className="pointer-events-none rounded-full border-2 border-gray-900 bg-gray-900/15 shadow-[0_0_0_2px_var(--color-white,#fff)]",a.style.display="none",ge.current=new o.Marker({element:a,anchor:"center"}).setLngLat(Q.center).addTo(t),t.on("click",e=>{Me.current.picking&&Me.current.onPick?.({lat:e.lngLat.lat,lng:e.lngLat.lng})}),t.on("move",$e),t.on("moveend",$e),t.on("resize",$e),t.on("error",e=>console.warn("[map]",e.error?.message)),r=f(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ne()}),n.observe(se.current),ce.current=t,xe(!0)}catch(t){console.error("[map] could not start",t),e||we(!0)}})(),()=>{e=!0,n?.disconnect(),r(),de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),ge.current?.remove(),ge.current=null,t?.remove(),ce.current=null}},[]);const Ee=o(ke);l(()=>{be&&ce.current&&Ee.current!==ke&&(Ee.current=ke,ce.current.setStyle(D[ke]))},[be,ke]),l(()=>{const e=ce.current,n=ue.current;if(!be||!e||!n)return;de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),pe.current.clear(),he.current.clear();for(const e of fe.current.keys())t.some(t=>t.key===e)||fe.current.delete(e);const r=Me.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=te(o,C);const a=o.approximate?r.approximate(o.label):o.label,l=o.title??(o.approximate?r.approximateTitle(o.label):o.label);t.setAttribute("aria-label",a),t.title=l;const i=document.createElement("span");if(ee(i,o.data),o.dot);else if(null!=o.iconNode){const e=fe.current.get(o.key);e&&i.append(e)}else o.icon?.length?i.append(Y(o.icon)):i.textContent=null!=o.stop?String(o.stop):o.glyph;if(t.append(i),o.badge){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className=X("absolute -right-2 -top-2 grid h-4 min-w-4 place-items-center rounded-full px-0.5 text-[9px] font-semibold leading-none shadow",o.badgeTone??"bg-white text-gray-900"),e.textContent=o.badge,t.appendChild(e)}t.addEventListener("click",e=>{e.stopPropagation(),Me.current.onSelect(o.key)}),de.current.push(new n.Marker({element:t,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)),pe.current.set(o.key,{pin:o,button:t,mark:i,name:a,title:l})}for(const t of N??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,ee(r,t.data),r.className=re(t),r.textContent=t.text,r.title=t.title??t.label,r.setAttribute("role","img"),r.setAttribute("aria-label",t.label),de.current.push(new n.Marker({element:r,anchor:"center"}).setLngLat([t.lng,t.lat]).addTo(e)),he.current.set(t.key,{mark:t,element:r})}$e()},[be,t,N,C,$e]),l(()=>{be&&$e()},[be,n,z,$e]),l(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ne);return()=>cancelAnimationFrame(e)},[be,n,Ne]),l(()=>{const e=ce.current,n=ue.current,r=x?[...t,...N??[]].filter(e=>x.includes(e.key)):t;if(!be||!e||!n||0===r.length)return;const o=r.map(e=>`${e.key}@${e.lat},${e.lng}`).sort().join("|");if(ye.current===o)return;const a=""===ye.current;if(ye.current=o,1===r.length)return void e.jumpTo({center:[r[0].lng,r[0].lat],zoom:13});const l=new n.LngLatBounds([r[0].lng,r[0].lat],[r[0].lng,r[0].lat]);for(const e of r)l.extend([e.lng,e.lat]);e.fitBounds(l,{padding:48,maxZoom:14,animate:!a})},[be,t,N,x]),l(()=>{const e=ce.current;if(!be||!e)return;const t=(b??[]).filter(e=>e.coordinates.length>=2),n=[...new Set(t.flatMap(e=>e.attribution?[e.attribution]:[]))].join(" · "),r=()=>{const r=function(){const e=document.createElement("span");e.className="text-blue-600",e.style.display="none",document.body.appendChild(e);const t=getComputedStyle(e).color||"#2563eb";return e.remove(),P(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?_(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(q);if(i&&(i.attribution||"")!==n){for(const t of H)e.getLayer(t)&&e.removeLayer(t);e.removeSource(q)}const s=e.getSource(q);s?s.setData(o):e.addSource(q,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:q,filter:["!",["get","estimate"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":4,"line-opacity":a}}),e.getLayer("routes-estimate")||e.addLayer({id:"routes-estimate",type:"line",source:q,filter:["get","estimate"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":3,"line-dasharray":[1.5,1.5],"line-opacity":a}})},o=()=>{try{r()}catch(e){console.debug("[map] routes wait for the style",e)}};return o(),e.on("style.load",o),e.once("idle",o),()=>{e.off("style.load",o),e.off("idle",o)}},[be,b,ke]),l(()=>{const e=ce.current;if(!be||!e||!s)return;const n=t.find(e=>e.key===s.key);if(!n)return;const r=e.getZoom(),o=C?F(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,a={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,o))};J()?e.jumpTo(a):e.flyTo({...a,duration:600})},[be,s?.n]);const[Se,je]=a(!1);l(()=>{const e=ie.current;if(!e)return;const t=()=>je(e.clientWidth<T);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[T]);const ze=n?t.find(e=>e.key===n)??null:null,Ae=ze?.key??null,Be=ze?.lng??0,Re=ze?.lat??0,Te=be&&!Se&&null!=R&&!!ze,[Oe,Fe]=a(null);l(()=>{const e=ce.current,t=ue.current;if(!(Te&&e&&t&&Ae))return;const n=document.createElement("div");n.dataset.mapCard="",n.className="w-[26rem] overflow-y-auto overscroll-contain";const r=new t.Popup({anchor:"bottom",offset:v,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Be,Re]).setDOMContent(n).addTo(e),o=r.getElement(),a=o.querySelector(".maplibregl-popup-content");a&&Object.assign(a.style,{padding:"0",background:"transparent",borderRadius:"0",boxShadow:"none"});const l=o.querySelector(".maplibregl-popup-tip");l&&Object.assign(l.style,{borderTopColor:G,borderBottomColor:G}),Fe(n);let i=!1,s=!1;const c=(t=!0)=>{if(s)return;if(e.isMoving())return void(i||(i=!0,e.once("moveend",()=>{i=!1,c()})));const{clientWidth:o,clientHeight:a}=e.getContainer(),l=function(e,t){const n=e.getBoundingClientRect().top,r=[...e.querySelectorAll(".maplibregl-ctrl-top-left > *, .maplibregl-ctrl-top-right > *"),...t?.querySelectorAll(":scope > [data-map-control]")??[]];let o=0;for(const e of r){const t=e.getBoundingClientRect();t.height>0&&(o=Math.max(o,t.bottom-n))}return o}(e.getContainer(),ie.current)+8,u=`${w(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=k(e.project(p),{width:d.offsetWidth,height:d.offsetHeight},{width:o,height:a},l);r.options.anchor!==m&&(r.options.anchor=m,r.setLngLat(p)),!t||0===h.x&&0===h.y||e.panBy([-h.x,-h.y],{duration:J()?0:250}),$e()},u=new ResizeObserver(()=>c());u.observe(n);const d=()=>c(),p=()=>{i||c(!1)};e.on("resize",d),e.on("moveend",p);let m=!1;const h=pe.current,g=e=>{m=n.contains(e.target)};return document.addEventListener("focusin",g),()=>{if(s=!0,u.disconnect(),e.off("resize",d),e.off("moveend",p),document.removeEventListener("focusin",g),r.remove(),Fe(null),m&&(!document.activeElement||document.activeElement===document.body)){const e=h.get(Ae)?.button;e&&"none"!==e.style.display&&e.focus({preventScroll:!0})}}},[Te,Ae,Be,Re,$e]);const Ke=V?.active??!1,We=o(V?.onChange);l(()=>{We.current=V?.onChange}),l(()=>{if(!V)return;const e=document.documentElement;Ke&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!Ke&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Ke]);const qe=!!V;return l(()=>{if(!qe)return;const e=()=>{document.fullscreenElement||We.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[qe]),/* @__PURE__ */d("div",{ref:ie,className:X("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",A&&"[&_canvas]:cursor-crosshair",g),children:[
3
3
  /* @__PURE__ */p("div",{className:"absolute inset-0",children:/* @__PURE__ */p("div",{ref:se,className:"h-full w-full",role:"region","aria-label":h})}),ve&&/* @__PURE__ */p("p",{className:"absolute inset-0 grid place-items-center p-6 text-center text-sm text-gray-500",children:oe.failed}),V&&/* @__PURE__ */p(e,{"data-map-control":"",variant:"secondary",size:"sm",className:"absolute left-3 top-3 z-10",onClick:()=>V.onChange(!V.active),leftIcon:/* @__PURE__ */p(le,{leave:V.active}),children:V.active?oe.leaveFullScreen:oe.fullScreen}),y,null!=R&&!Te&&/* @__PURE__ */p("div",{"data-map-card":"",className:"absolute bottom-3 left-3 right-3 z-10 max-h-[calc(100%-1.5rem)] max-w-md overflow-y-auto overscroll-contain",children:R}),Te&&Oe?u(R,Oe):null,be&&/* @__PURE__ */p(ae,{pins:t,hosts:fe.current})]})}function ae({pins:e,hosts:t}){/* @__PURE__ */
4
4
  return p(m,{children:e.map(e=>{if(null==e.iconNode||e.dot)return null;let n=t.get(e.key);return n||(n=document.createElement("span"),n.className="contents",t.set(e.key,n)),u(e.iconNode,n,e.key)})})}function le({leave:e}){/* @__PURE__ */
5
5
  return p("svg",{"aria-hidden":"true",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e?"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25":"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function ie(){const[e,t]=a(null);return{highlightKey:e,pointAt:i(e=>{const n=()=>t(e),r=()=>t(t=>t===e?null:t);return{onMouseEnter:n,onMouseLeave:r,onFocus:n,onBlur:r}},[])}}var se=3e3,ce=e=>!!e?.pending&&3e3,ue=e=>`${e.kind}:${e.id}`,de=e=>("located"===e.placement||"approximate"===e.placement)&&null!=e.lat&&null!=e.lng;function pe(e){switch(e){case"located":return null;case"approximate":return"Approximate: only the suburb or postcode matched";case"pending":return"Locating…";case"not_found":return"Not on the map: address not found";case"failed":return"Not on the map: the map service could not be reached";case"no_address":return"Not on the map: no city or postcode"}}var me={importer:{label:"Importer",tone:"bg-sky-600 text-white"},dealer:{label:"Dealer",tone:"bg-purple-600 text-white"},retail:{label:"Retail",tone:"bg-green-600 text-white"},supplier:{label:"Supplier",tone:"bg-sky-600 text-white"},delivery_location:{label:"Delivery location",tone:"bg-amber-600 text-white"},warehouse:{label:"Warehouse",tone:"bg-amber-600 text-white"}},he=["importer","dealer","retail","supplier","delivery_location","warehouse"];function ge(e){return"supplier"===e.kind?"supplier":"customer"===e.kind?e.category||"importer":e.kind}var fe=(e,t=me)=>t[e]?.tone??"bg-gray-700 text-white",ye=(e,t=me)=>t[e]?.label??e,be=(e,t)=>fe(ge(e),t);function xe(e,t,n=me){return null!=t?String(t):(n[ge(e)]?.label??"").charAt(0).toUpperCase()}var ve=["delivery_location","warehouse"];function we(e,t=ve){const n=/* @__PURE__ */new Map;let r=0;for(const o of e)t.includes(o.kind)&&n.set(ue(o),++r);return n}function ke(e){const t={onMap:0,approximate:0,pending:0,off:0};for(const n of e)de(n)?(t.onMap+=1,"approximate"===n.placement&&(t.approximate+=1)):"pending"===n.placement?t.pending+=1:t.off+=1;return t}function Me(e){const t=[`${e.onMap} on the map`];return e.approximate&&t.push(`${e.approximate} approximate`),e.pending&&t.push(`${e.pending} locating`),e.off&&t.push(`${e.off} not on the map`),t.join(" · ")}function Ne(e){const t=[...new Set(e.filter(de).map(ge))];return[...he.filter(e=>t.includes(e)),...t.filter(e=>!he.includes(e))]}function Ce(e,t){return e.filter(e=>!de(e)&&"pending"!==e.placement).map(e=>{const n=t?.get(ue(e)),r=pe(e.placement)?.replace(/^Not on the map: /,"")??"";return{key:ue(e),text:`${null!=n?`${n}. `:""}${e.label}: ${r}`}})}function Le({categories:e,palette:t=me,floating:n=!0}){return e.length<2?null:/* @__PURE__ */p("div",{className:(n?"absolute left-3 top-3 z-10 ":"")+"flex flex-wrap gap-x-3 gap-y-1 rounded-lg border border-gray-200 bg-white px-2.5 py-1.5 text-xs text-gray-600 shadow-sm",children:e.map(e=>/* @__PURE__ */d("span",{className:"inline-flex items-center gap-1.5",children:[
@@ -10,7 +10,7 @@ return d("section",{"aria-label":c.chosen(t.label),className:"absolute bottom-3
10
10
  /* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-900 [overflow-wrap:anywhere]",children:[null!=n&&/* @__PURE__ */d("span",{className:"mr-1 text-gray-400",children:[n,"."]}),t.label,t.code&&/* @__PURE__ */p("span",{className:"ml-1.5 text-xs font-normal text-gray-400",children:t.code})]}),
11
11
  /* @__PURE__ */p("p",{className:"text-xs text-gray-500",children:l[s]?ye(s,l):t.category})]}),
12
12
  /* @__PURE__ */p("button",{type:"button",onClick:a,"aria-label":c.closeCard,className:"rounded p-0.5 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */p("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),
13
- /* @__PURE__ */p("p",{className:"text-sm text-gray-700 [overflow-wrap:anywhere]",children:t.address||"—"}),i&&/* @__PURE__ */p("p",{className:"text-xs text-gray-500",children:i}),t.matched&&"approximate"===t.placement&&/* @__PURE__ */d("p",{className:"text-xs text-gray-400 [overflow-wrap:anywhere]",children:["Placed at: ",t.matched]}),o&&/* @__PURE__ */p("div",{className:"flex justify-end",children:/* @__PURE__ */p(e,{variant:"secondary",size:"sm",onClick:o,children:c.openRecord})})]})}function Se(e,t,{staleTime:n}={}){return h({queryKey:e,queryFn:t,staleTime:n,refetchInterval:e=>ce(e.state.data)})}function Ee({queryKey:e,queryFn:t,refreshSignal:n,onOpen:r,ariaLabel:i,title:c="Locations",palette:u=me,numbers:m,className:h="",mapClassName:g="min-h-[240px] flex-1"}){const{data:f,isError:y,refetch:b}=Se(e,t,{staleTime:0}),x=o(!1);l(()=>{x.current?b():x.current=!0},[n]);const[v,w]=a(null),k=s(()=>f?.points??[],[f]),M=s(()=>m??we(k),[m,k]),N=s(()=>k.filter(de).map(e=>({key:ue(e),label:e.label,lat:e.lat,lng:e.lng,glyph:xe(e,M.get(ue(e))??null,u),tone:be(e,u),approximate:"approximate"===e.placement})),[k,M,u]),C=s(()=>Ce(k,M),[k,M]),L=s(()=>Ne(k),[k]),$=f?.pending??0,S=k.find(e=>ue(e)===v)??null,E=S&&r?r(S):null;/* @__PURE__ */
13
+ /* @__PURE__ */p("p",{className:"text-sm text-gray-700 [overflow-wrap:anywhere]",children:t.address||"—"}),i&&/* @__PURE__ */p("p",{className:"text-xs text-gray-500",children:i}),t.matched&&"approximate"===t.placement&&/* @__PURE__ */d("p",{className:"text-xs text-gray-400 [overflow-wrap:anywhere]",children:["Placed at: ",t.matched]}),o&&/* @__PURE__ */p("div",{className:"flex justify-end",children:/* @__PURE__ */p(e,{variant:"secondary",size:"sm",onClick:o,children:c.openRecord})})]})}function Ee(e,t,{staleTime:n}={}){return h({queryKey:e,queryFn:t,staleTime:n,refetchInterval:e=>ce(e.state.data)})}function Se({queryKey:e,queryFn:t,refreshSignal:n,onOpen:r,ariaLabel:i,title:c="Locations",palette:u=me,numbers:m,className:h="",mapClassName:g="min-h-[240px] flex-1"}){const{data:f,isError:y,refetch:b}=Ee(e,t,{staleTime:0}),x=o(!1);l(()=>{x.current?b():x.current=!0},[n]);const[v,w]=a(null),k=s(()=>f?.points??[],[f]),M=s(()=>m??we(k),[m,k]),N=s(()=>k.filter(de).map(e=>({key:ue(e),label:e.label,lat:e.lat,lng:e.lng,glyph:xe(e,M.get(ue(e))??null,u),tone:be(e,u),approximate:"approximate"===e.placement})),[k,M,u]),C=s(()=>Ce(k,M),[k,M]),L=s(()=>Ne(k),[k]),$=f?.pending??0,E=k.find(e=>ue(e)===v)??null,S=E&&r?r(E):null;/* @__PURE__ */
14
14
  return d("section",{"aria-label":c,className:`flex min-w-0 flex-col ${h}`,children:[
15
15
  /* @__PURE__ */d("div",{className:"flex min-h-[30px] items-center justify-between mb-2",children:[
16
16
  /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-900",children:c}),f&&/* @__PURE__ */p("span",{className:"text-xs text-gray-500",children:Me(ke(k))})]}),
@@ -20,4 +20,4 @@ return d("section",{"aria-label":c,className:`flex min-w-0 flex-col ${h}`,childr
20
20
  /* @__PURE__ */p("button",{type:"button",onClick:()=>{b()},className:"font-medium text-blue-600 hover:text-blue-800 hover:underline",children:"Try again"})]}),!y&&($>0||C.length>0)&&/* @__PURE__ */d("div",{className:"max-w-full space-y-0.5 rounded-lg border border-gray-200 bg-white px-2.5 py-1.5 text-xs shadow-sm","aria-live":"polite",children:[$>0&&/* @__PURE__ */d("p",{className:"flex items-center gap-1.5 text-gray-500",children:[
21
21
  /* @__PURE__ */d("svg",{className:"h-3 w-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[
22
22
  /* @__PURE__ */p("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
23
- /* @__PURE__ */p("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Locating ",$," address",1===$?"":"es","…"]}),C.slice(0,3).map(e=>/* @__PURE__ */p("p",{className:"truncate text-amber-700",title:e.text,children:e.text},e.key)),C.length>3&&/* @__PURE__ */d("p",{className:"text-gray-500",children:["+",C.length-3," more not on the map"]})]})]}),S&&/* @__PURE__ */p($e,{point:S,number:M.get(ue(S))??null,onOpen:E,onClose:()=>w(null),palette:u})]})]})}export{x as CARD_MIN_MAP_WIDTH,g as COMPACT_SHOW,oe as EntityMap,Ee as LocationsMap,M as MAPLIBRE_WORKER_FILE,E as MAP_APART_PX,me as MAP_CATEGORIES,S as MAP_STOP_PX,$ as MAP_TARGET_PX,Le as MapLegend,se as PENDING_POLL_MS,ve as SECONDARY_KINDS,$e as SelectedCard,w as cardMaxHeight,ye as categoryLabel,fe as categoryTone,f as foldAttributionOnce,de as isOnMap,O as layoutPins,Ne as legendCategories,L as loadMapLibre,we as locationNumbers,N as mapLibreWorkerUrl,ce as mapPointsRefetchInterval,Ce as offMapNotes,ge as pinCategory,xe as pinGlyph,be as pinTone,k as placeCard,pe as placementNote,ue as pointKey,j as stopsLabel,ke as summarize,Me as summaryText,ie as useMapHighlight,Se as useMapPoints,W as zoomApart};
23
+ /* @__PURE__ */p("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Locating ",$," address",1===$?"":"es","…"]}),C.slice(0,3).map(e=>/* @__PURE__ */p("p",{className:"truncate text-amber-700",title:e.text,children:e.text},e.key)),C.length>3&&/* @__PURE__ */d("p",{className:"text-gray-500",children:["+",C.length-3," more not on the map"]})]})]}),E&&/* @__PURE__ */p($e,{point:E,number:M.get(ue(E))??null,onOpen:S,onClose:()=>w(null),palette:u})]})]})}export{x as CARD_MIN_MAP_WIDTH,g as COMPACT_SHOW,oe as EntityMap,Se as LocationsMap,M as MAPLIBRE_WORKER_FILE,S as MAP_APART_PX,me as MAP_CATEGORIES,E as MAP_STOP_PX,$ as MAP_TARGET_PX,Le as MapLegend,se as PENDING_POLL_MS,ve as SECONDARY_KINDS,$e as SelectedCard,w as cardMaxHeight,ye as categoryLabel,fe as categoryTone,f as foldAttributionOnce,de as isOnMap,O as layoutPins,Ne as legendCategories,L as loadMapLibre,we as locationNumbers,N as mapLibreWorkerUrl,ce as mapPointsRefetchInterval,Ce as offMapNotes,ge as pinCategory,xe as pinGlyph,be as pinTone,k as placeCard,pe as placementNote,ue as pointKey,j as stopsLabel,ke as summarize,Me as summaryText,ie as useMapHighlight,Ee as useMapPoints,F as zoomApart};
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import{TabStrip as e}from"../chunk-DJ6UVHAZ.js";import"../chunk-6KO2U66R.js";import{confirm as t}from"../chunk-KRTZFHYW.js";import"../chunk-VDL2RLZG.js";import"../chunk-ELSUXC3N.js";import"../chunk-MAIHBBWT.js";import{useShellStrings as n}from"../chunk-NCQLGQYR.js";import{useBrowserLayoutEffect as r}from"../chunk-D65T4H6J.js";import*as i from"react";import{createContext as l,memo as c,useRef as a,useEffect as s,useMemo as o,useId as u,useCallback as y,useReducer as d,useState as f,useContext as p}from"react";import{useLocation as k,useNavigate as m}from"react-router-dom";import{jsx as b,Fragment as v,jsxs as h}from"react/jsx-runtime";var g=l(null),K=l(null),F=12;var T=(e,t)=>e.filter(e=>e!==t);function N(e,t){return[...t.map(t=>e.find(e=>e.key===t)).filter(e=>Boolean(e)),...e.filter(e=>!t.includes(e.key))]}function A(e,t,n=12){const r=e.clock+1;let i;i=e.tabs.find(e=>e.key===t.key)?e.tabs.map(e=>e.key===t.key?{...e,path:t.path,title:"page"===e.titleFrom?e.title:t.title||e.title,lastActive:r}:e):[...e.tabs,{key:t.key,path:t.path,title:t.title,titleFrom:"route",pinned:!1,lastActive:r}];let l={...e,tabs:i,activeKey:t.key,mounted:(c=e.mounted,a=t.key,c.includes(a)?c:[...c,a]),clock:r};var c,a;return l.closing&&l.closing!==t.key?l=I(l,l.closing):l.closing===t.key&&(l={...l,closing:null}),function(e,t){let n=e;for(;n.tabs.length>t;){const e=n.tabs.filter(e=>!e.pinned&&e.key!==n.activeKey&&!n.dirty.includes(e.key)&&e.key!==n.closing).sort((e,t)=>e.lastActive-t.lastActive);if(0===e.length)break;n=I(n,e[0].key)}return n}(l,n)}function w(e){let t={...e,activeKey:null};return t.closing&&(t=I(t,t.closing)),t}function I(e,t){return{...e,tabs:e.tabs.filter(e=>e.key!==t),mounted:T(e.mounted,t),dirty:T(e.dirty,t),activeKey:e.activeKey===t?null:e.activeKey,closing:e.closing===t?null:e.closing}}function C(e,t){switch(t.type){case"visit":return A(e,t.entry,t.maxTabs);case"transient":return w(e);case"close":{let n=e;for(const e of t.keys)n=I(n,e);return t.closing?function(e,t){return{...e,closing:t}}(n,t.closing):n}case"title":return function(e,t,n){const r=e.tabs.find(e=>e.key===t);return!r||!n||r.title===n&&"page"===r.titleFrom?e:{...e,tabs:e.tabs.map(e=>e.key===t?{...e,title:n,titleFrom:"page"}:e)}}(e,t.key,t.title);case"dirty":return function(e,t,n){return n===e.dirty.includes(t)?e:{...e,dirty:n?[...e.dirty,t]:T(e.dirty,t)}}(e,t.key,t.dirty)}}var L=e=>`${e.pathname}${e.search}`;function M(e){const t=e.indexOf("#"),n=t>=0?e.slice(t):"",r=t>=0?e.slice(0,t):e,i=r.indexOf("?");return{pathname:i>=0?r.slice(0,i):r,search:i>=0?r.slice(i):"",hash:n}}function x({children:e,resolve:i,pinned:l=[],storageKey:c,maxTabs:p=12,enabled:v=!0,confirmDiscard:h}){const K=k(),F=m(),T=n().pageTabs,I=u(),x=a(i);x.current=i;const j=y(e=>{const t=x.current(e);return t?{key:t.key??e.pathname,path:L(e),title:t.title}:null},[]),[O,R]=d(C,void 0,()=>{const e=function(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{return[]}const r=n;if(!r||1!==r.v||!Array.isArray(r.tabs))return[];const i=[];for(const e of r.tabs){if(!e||"string"!=typeof e.path||!e.path.startsWith("/")||e.path.startsWith("//"))continue;const n=e.path.indexOf("#"),r=n>=0?e.path.slice(0,n):e.path,l=t(r);if(!l||i.some(e=>e.key===l.key))continue;const c="page"===e.titleFrom&&"string"==typeof e.title&&e.title;i.push({key:l.key,path:r,title:c||l.title,titleFrom:c?"page":"route",pinned:!1,lastActive:0})}return i}(function(e){if(!e)return null;try{return localStorage.getItem(e)}catch{return null}}(c),e=>j(M(e)));let t=function(e,t){const n=t.map(e=>e.key);let r=e.tabs.map(e=>({...e,pinned:n.includes(e.key)}));for(const e of t)r.some(t=>t.key===e.key)||(r=[...r,{key:e.key,path:e.path,title:e.title,titleFrom:"route",pinned:!0,lastActive:0}]);return{...e,tabs:N(r,n)}}({tabs:[],activeKey:null,mounted:[],dirty:[],closing:null,clock:0,tabs:e},l.map(e=>j(M(e))).filter(e=>Boolean(e)));const n=v?j(K):null;return t=n?A(t,n,p):w(t),t}),D=a(O);D.current=O;const S=a(/* @__PURE__ */new Map),$=v?j(K):null,E=$?.key??null;r(()=>{if(!v)return;const e=j(K);e?(S.current.set(e.key,K),R({type:"visit",entry:e,maxTabs:p})):R({type:"transient"})},[K,v,p,j]),s(()=>{const e=new Set(O.tabs.map(e=>e.key));for(const t of S.current.keys())e.has(t)||S.current.delete(t)},[O.tabs]);const B=o(()=>function(e){const t={v:1,tabs:e.tabs.filter(t=>t.key!==e.closing).map(({key:e,path:t,title:n,titleFrom:r})=>({key:e,path:t,title:n,titleFrom:r}))};return JSON.stringify(t)}(O),[O]);s(()=>{if(c)try{localStorage.setItem(c,B)}catch{}},[B,c]);const H=O.dirty.length>0;s(()=>{if(!H)return;const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[H]);const J=a(/* @__PURE__ */new Map),W=y((e,t)=>{let n=J.current.get(e);return void 0===n&&(n=J.current.size,J.current.set(e,n)),`${I}-page-${t}-${n}`},[I]),U=y(e=>h?h(e):t({title:T.discardTitle,message:1===e.length?T.discardOne:T.discardCount?.(e.length)??`${e.length} ${T.discardMany}`,confirmLabel:T.discardConfirm,cancelLabel:T.keepEditing,variant:"warning"}),[h,T]),V=y(()=>{const e=D.current;return e.tabs.find(e=>e.pinned)?.path??"/"},[]),Z=y((e,t,n)=>{const r=D.current,i=r.activeKey;if(!i||!e.includes(i))return void R({type:"close",keys:e,closing:null});let l=t;if(!l){const t={...r,tabs:r.tabs.filter(t=>t.key===i||!e.includes(t.key))},c=n?r.tabs.find(t=>t.key===n&&!e.includes(t.key)):void 0;l=(c??function(e,t){const n=e.tabs.filter(n=>n.key!==e.closing||n.key===t),r=n.findIndex(e=>e.key===t);return r<0?null:n[r+1]??n[r-1]??null}(t,i))?.path??V()}R({type:"close",keys:e.filter(e=>e!==i),closing:i}),F(l)},[F,V]),G=y(async(e,t={})=>{const n=D.current.tabs.find(t=>t.key===e);return!n||n.pinned?(t.to&&F(t.to),!1):!(!t.force&&D.current.dirty.includes(e)&&!await U([n]))&&(!!D.current.tabs.some(t=>t.key===e)&&(Z([e],t.to),!0))},[U,Z,F]),P=y(async(e,t)=>{let n=function(e,t,n){const r=e.tabs.filter(e=>!e.pinned);if("all"===t)return r.map(e=>e.key);if("others"===t)return r.filter(e=>e.key!==n).map(e=>e.key);const i=e.tabs.findIndex(e=>e.key===n);return i<0?[]:e.tabs.slice(i+1).filter(e=>!e.pinned).map(e=>e.key)}(D.current,e,t);const r=D.current.tabs.filter(e=>n.includes(e.key)&&D.current.dirty.includes(e.key));r.length&&!await U(r)&&(n=n.filter(e=>!r.some(t=>t.key===e)));const i=new Set(D.current.tabs.map(e=>e.key));n=n.filter(e=>i.has(e)),n.length&&Z(n,void 0,"all"===e?null:t)},[U,Z]),Q=y(e=>{const t=D.current.tabs.find(t=>t.key===e);t&&e!==D.current.activeKey&&F(t.path)},[F]),Y=y((e,t)=>R({type:"title",key:e,title:t}),[]),z=y((e,t)=>R({type:"dirty",key:e,dirty:t}),[]),[X,q]=f({}),_=y((e,t)=>{q(n=>{if((n[e]??null)===t)return n;const r={...n};return t?r[e]=t:delete r[e],r})},[]),ee=y(e=>j(e)?.key??null,[j]),te=y(e=>S.current.get(e),[]),ne=o(()=>v?O.tabs.filter(e=>e.key!==O.closing):[],[v,O.tabs,O.closing]),re=o(()=>({enabled:v,state:O,currentKey:E,resolve:i,keyFor:ee,locationFor:te,idFor:W,activate:Q,close:G,closeMany:P,setTitle:Y,setDirty:z,copies:X,setCopy:_,visibleTabs:ne}),[v,O,E,i,ee,te,W,Q,G,P,Y,z,X,_,ne]);/* @__PURE__ */
3
- return b(g.Provider,{value:re,children:e})}var j=i.Activity,O=Boolean(j);function R({active:e,children:t}){return j?/* @__PURE__ */b(j,{mode:e?"visible":"hidden",children:t}):/* @__PURE__ */b(v,{children:t})}var D=c(function({tabKey:e,active:t,location:n,render:i,className:l,panelId:c,tabId:u}){const y=a(null),d=a(t),f=a(/* @__PURE__ */new Map);r(()=>{const e=d.current;if(d.current=t,t&&!e)for(const[e,[t,n]]of f.current)e.isConnected?(e.scrollTop=t,e.scrollLeft=n):f.current.delete(e)},[t]),s(()=>{const e=y.current;if(!e)return;const t=e=>{if(!d.current)return;const t=e.target;t&&"number"==typeof t.scrollTop&&f.current.set(t,[t.scrollTop,t.scrollLeft])};return e.addEventListener("scroll",t,!0),()=>e.removeEventListener("scroll",t,!0)},[]);const p=o(()=>({key:e,activeRef:d}),[e]);/* @__PURE__ */
4
- return b("div",{ref:y,role:c?"tabpanel":void 0,id:c,"aria-labelledby":u,hidden:!t,style:t?void 0:{display:"none"},className:l,"data-page-tab":e,children:/* @__PURE__ */b(K.Provider,{value:p,children:/* @__PURE__ */b(R,{active:t,children:i(n)})})})},(e,t)=>e.active===t.active&&e.location===t.location&&e.className===t.className&&e.panelId===t.panelId&&e.tabId===t.tabId&&(!t.active||e.render===t.render)),S="\0transient";function $({children:e,frameClassName:t}){const n=p(g),r=k();if(!n||!n.enabled)/* @__PURE__ */
5
- return b("div",{className:t,children:e(r)},S);const{state:i,currentKey:l,locationFor:c,idFor:a}=n,s=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!s.includes(l)&&s.push(l),/* @__PURE__ */h(v,{children:[s.map(n=>{const i=n===l,s=i?r:c(n);return s?/* @__PURE__ */b(D,{tabKey:n,active:i,location:s,render:e,className:t,panelId:a(n,"panel"),tabId:a(n,"tab")},n):null}),!l&&/* @__PURE__ */b(D,{tabKey:S,active:!0,location:r,render:e,className:t},S)]})}function E({className:t,activeClassName:r,end:i}){const l=p(g),c=n().pageTabs;if(!l||!l.enabled)return null;const{visibleTabs:a,state:s,idFor:o,activate:u,close:y,closeMany:d,resolve:f}=l;/* @__PURE__ */
6
- return b(e,{tabs:a.map(e=>({key:e.key,title:e.title,pinned:e.pinned,dirty:s.dirty.includes(e.key),copy:l.copies[e.key],icon:f(M(e.path))?.icon})),activeKey:l.currentKey??null,idFor:o,panelMounted:e=>s.mounted.includes(e),onActivate:u,onClose:e=>{y(e)},onCloseMany:(e,t)=>{d(e,t)},label:c.label,className:t,activeClassName:r,end:i})}var B={enabled:!1,tabs:[],activeKey:null,activate:()=>{},close:async()=>!1,closeOthers:async()=>{},closeRight:async()=>{},closeAll:async()=>{}};function H(){const e=p(g);return e&&e.enabled?{enabled:!0,tabs:e.visibleTabs,activeKey:e.currentKey,activate:e.activate,close:e.close,closeOthers:t=>e.closeMany("others",t),closeRight:t=>e.closeMany("right",t),closeAll:()=>e.closeMany("all",null)}:B}function J(){const e=p(g),t=p(K),n=m();return{key:e?.enabled&&t?t.key:null,close:y(async(r={})=>e?.enabled&&t&&e.state.tabs.some(e=>e.key===t.key)?e.close(t.key,r):(r.to&&n(r.to),!1),[e,t,n])}}function W(e){const t=p(g),n=p(K),r=t?.enabled?t.setTitle:void 0,i=n?.key;s(()=>{r&&i&&e&&r(i,e)},[r,i,e])}function U(e){const t=p(g),n=p(K),r=t?.enabled?t.setCopy:void 0,i=n?.key;s(()=>{if(r&&i)return r(i,e||null),()=>r(i,null)},[r,i,e])}function V(e){const t=p(g),n=p(K),r=t?.enabled?t.setDirty:void 0;s(()=>{if(r&&n)return r(n.key,e),()=>{n.activeRef.current&&r(n.key,!1)}},[r,n,e])}export{F as DEFAULT_MAX_TABS,O as PAGE_TABS_PAUSE_HIDDEN,E as PageTabBar,$ as PageTabsOutlet,x as PageTabsProvider,M as parseTabPath,J as usePageTab,U as usePageTabCopy,V as usePageTabDirty,W as usePageTabTitle,H as usePageTabs};
2
+ import{TabStrip as e}from"../chunk-DTRXR6JQ.js";import"../chunk-6KO2U66R.js";import{confirm as t}from"../chunk-M4DB7UBZ.js";import"../chunk-UVZIPXIA.js";import"../chunk-AFYQTVZO.js";import"../chunk-HZZNJHRH.js";import{useBrowserLayoutEffect as n}from"../chunk-D65T4H6J.js";import"../chunk-X4FJ54PP.js";import{useShellStrings as r}from"../chunk-NCQLGQYR.js";import*as i from"react";import{createContext as l,memo as c,useRef as a,useEffect as s,useMemo as o,useId as u,useCallback as y,useReducer as d,useState as f,useContext as p}from"react";import{useLocation as k,useNavigate as m}from"react-router-dom";import{jsx as b,Fragment as v,jsxs as h}from"react/jsx-runtime";var g=l(null),K=l(null),F=12;var T=(e,t)=>e.filter(e=>e!==t);function N(e,t){return[...t.map(t=>e.find(e=>e.key===t)).filter(e=>Boolean(e)),...e.filter(e=>!t.includes(e.key))]}function A(e,t,n=12){const r=e.clock+1;let i;i=e.tabs.find(e=>e.key===t.key)?e.tabs.map(e=>e.key===t.key?{...e,path:t.path,title:"page"===e.titleFrom?e.title:t.title||e.title,lastActive:r}:e):[...e.tabs,{key:t.key,path:t.path,title:t.title,titleFrom:"route",pinned:!1,lastActive:r}];let l={...e,tabs:i,activeKey:t.key,mounted:(c=e.mounted,a=t.key,c.includes(a)?c:[...c,a]),clock:r};var c,a;return l.closing&&l.closing!==t.key?l=w(l,l.closing):l.closing===t.key&&(l={...l,closing:null}),function(e,t){let n=e;for(;n.tabs.length>t;){const e=n.tabs.filter(e=>!e.pinned&&e.key!==n.activeKey&&!n.dirty.includes(e.key)&&e.key!==n.closing).sort((e,t)=>e.lastActive-t.lastActive);if(0===e.length)break;n=w(n,e[0].key)}return n}(l,n)}function I(e){let t={...e,activeKey:null};return t.closing&&(t=w(t,t.closing)),t}function w(e,t){return{...e,tabs:e.tabs.filter(e=>e.key!==t),mounted:T(e.mounted,t),dirty:T(e.dirty,t),activeKey:e.activeKey===t?null:e.activeKey,closing:e.closing===t?null:e.closing}}function M(e,t){switch(t.type){case"visit":return A(e,t.entry,t.maxTabs);case"transient":return I(e);case"close":{let n=e;for(const e of t.keys)n=w(n,e);return t.closing?function(e,t){return{...e,closing:t}}(n,t.closing):n}case"title":return function(e,t,n){const r=e.tabs.find(e=>e.key===t);return!r||!n||r.title===n&&"page"===r.titleFrom?e:{...e,tabs:e.tabs.map(e=>e.key===t?{...e,title:n,titleFrom:"page"}:e)}}(e,t.key,t.title);case"dirty":return function(e,t,n){return n===e.dirty.includes(t)?e:{...e,dirty:n?[...e.dirty,t]:T(e.dirty,t)}}(e,t.key,t.dirty)}}var C=e=>`${e.pathname}${e.search}`;function j(e){const t=e.indexOf("#"),n=t>=0?e.slice(t):"",r=t>=0?e.slice(0,t):e,i=r.indexOf("?");return{pathname:i>=0?r.slice(0,i):r,search:i>=0?r.slice(i):"",hash:n}}function x({children:e,resolve:i,pinned:l=[],storageKey:c,maxTabs:p=12,enabled:v=!0,confirmDiscard:h}){const K=k(),F=m(),T=r().pageTabs,w=u(),x=a(i);x.current=i;const O=y(e=>{const t=x.current(e);return t?{key:t.key??e.pathname,path:C(e),title:t.title}:null},[]),[L,R]=d(M,void 0,()=>{const e=function(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{return[]}const r=n;if(!r||1!==r.v||!Array.isArray(r.tabs))return[];const i=[];for(const e of r.tabs){if(!e||"string"!=typeof e.path||!e.path.startsWith("/")||e.path.startsWith("//"))continue;const n=e.path.indexOf("#"),r=n>=0?e.path.slice(0,n):e.path,l=t(r);if(!l||i.some(e=>e.key===l.key))continue;const c="page"===e.titleFrom&&"string"==typeof e.title&&e.title;i.push({key:l.key,path:r,title:c||l.title,titleFrom:c?"page":"route",pinned:!1,lastActive:0})}return i}(function(e){if(!e)return null;try{return localStorage.getItem(e)}catch{return null}}(c),e=>O(j(e)));let t=function(e,t){const n=t.map(e=>e.key);let r=e.tabs.map(e=>({...e,pinned:n.includes(e.key)}));for(const e of t)r.some(t=>t.key===e.key)||(r=[...r,{key:e.key,path:e.path,title:e.title,titleFrom:"route",pinned:!0,lastActive:0}]);return{...e,tabs:N(r,n)}}({tabs:[],activeKey:null,mounted:[],dirty:[],closing:null,clock:0,tabs:e},l.map(e=>O(j(e))).filter(e=>Boolean(e)));const n=v?O(K):null;return t=n?A(t,n,p):I(t),t}),D=a(L);D.current=L;const $=a(/* @__PURE__ */new Map),J=v?O(K):null,S=J?.key??null;n(()=>{if(!v)return;const e=O(K);e?($.current.set(e.key,K),R({type:"visit",entry:e,maxTabs:p})):R({type:"transient"})},[K,v,p,O]),s(()=>{const e=new Set(L.tabs.map(e=>e.key));for(const t of $.current.keys())e.has(t)||$.current.delete(t)},[L.tabs]);const B=o(()=>function(e){const t={v:1,tabs:e.tabs.filter(t=>t.key!==e.closing).map(({key:e,path:t,title:n,titleFrom:r})=>({key:e,path:t,title:n,titleFrom:r}))};return JSON.stringify(t)}(L),[L]);s(()=>{if(c)try{localStorage.setItem(c,B)}catch{}},[B,c]);const E=L.dirty.length>0;s(()=>{if(!E)return;const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[E]);const P=a(/* @__PURE__ */new Map),Z=y((e,t)=>{let n=P.current.get(e);return void 0===n&&(n=P.current.size,P.current.set(e,n)),`${w}-page-${t}-${n}`},[w]),H=y(e=>h?h(e):t({title:T.discardTitle,message:1===e.length?T.discardOne:T.discardCount?.(e.length)??`${e.length} ${T.discardMany}`,confirmLabel:T.discardConfirm,cancelLabel:T.keepEditing,variant:"warning"}),[h,T]),Q=y(()=>{const e=D.current;return e.tabs.find(e=>e.pinned)?.path??"/"},[]),U=y((e,t,n)=>{const r=D.current,i=r.activeKey;if(!i||!e.includes(i))return void R({type:"close",keys:e,closing:null});let l=t;if(!l){const t={...r,tabs:r.tabs.filter(t=>t.key===i||!e.includes(t.key))},c=n?r.tabs.find(t=>t.key===n&&!e.includes(t.key)):void 0;l=(c??function(e,t){const n=e.tabs.filter(n=>n.key!==e.closing||n.key===t),r=n.findIndex(e=>e.key===t);return r<0?null:n[r+1]??n[r-1]??null}(t,i))?.path??Q()}R({type:"close",keys:e.filter(e=>e!==i),closing:i}),F(l)},[F,Q]),V=y(async(e,t={})=>{const n=D.current.tabs.find(t=>t.key===e);return!n||n.pinned?(t.to&&F(t.to),!1):!(!t.force&&D.current.dirty.includes(e)&&!await H([n]))&&(!!D.current.tabs.some(t=>t.key===e)&&(U([e],t.to),!0))},[H,U,F]),X=y(async(e,t)=>{let n=function(e,t,n){const r=e.tabs.filter(e=>!e.pinned);if("all"===t)return r.map(e=>e.key);if("others"===t)return r.filter(e=>e.key!==n).map(e=>e.key);const i=e.tabs.findIndex(e=>e.key===n);return i<0?[]:e.tabs.slice(i+1).filter(e=>!e.pinned).map(e=>e.key)}(D.current,e,t);const r=D.current.tabs.filter(e=>n.includes(e.key)&&D.current.dirty.includes(e.key));r.length&&!await H(r)&&(n=n.filter(e=>!r.some(t=>t.key===e)));const i=new Set(D.current.tabs.map(e=>e.key));n=n.filter(e=>i.has(e)),n.length&&U(n,void 0,"all"===e?null:t)},[H,U]),W=y(e=>{const t=D.current.tabs.find(t=>t.key===e);t&&e!==D.current.activeKey&&F(t.path)},[F]),Y=y((e,t)=>R({type:"title",key:e,title:t}),[]),z=y((e,t)=>R({type:"dirty",key:e,dirty:t}),[]),[G,q]=f({}),_=y((e,t)=>{q(n=>{if((n[e]??null)===t)return n;const r={...n};return t?r[e]=t:delete r[e],r})},[]),ee=y(e=>O(e)?.key??null,[O]),te=y(e=>$.current.get(e),[]),ne=o(()=>v?L.tabs.filter(e=>e.key!==L.closing):[],[v,L.tabs,L.closing]),re=o(()=>({enabled:v,state:L,currentKey:S,resolve:i,keyFor:ee,locationFor:te,idFor:Z,activate:W,close:V,closeMany:X,setTitle:Y,setDirty:z,copies:G,setCopy:_,visibleTabs:ne}),[v,L,S,i,ee,te,Z,W,V,X,Y,z,G,_,ne]);/* @__PURE__ */
3
+ return b(g.Provider,{value:re,children:e})}var O=i.Activity,L=Boolean(O);function R({active:e,children:t}){return O?/* @__PURE__ */b(O,{mode:e?"visible":"hidden",children:t}):/* @__PURE__ */b(v,{children:t})}var D=c(function({tabKey:e,active:t,location:r,render:i,className:l,panelId:c,tabId:u}){const y=a(null),d=a(t),f=a(/* @__PURE__ */new Map);n(()=>{const e=d.current;if(d.current=t,t&&!e)for(const[e,[t,n]]of f.current)e.isConnected?(e.scrollTop=t,e.scrollLeft=n):f.current.delete(e)},[t]),s(()=>{const e=y.current;if(!e)return;const t=e=>{if(!d.current)return;const t=e.target;t&&"number"==typeof t.scrollTop&&f.current.set(t,[t.scrollTop,t.scrollLeft])};return e.addEventListener("scroll",t,!0),()=>e.removeEventListener("scroll",t,!0)},[]);const p=o(()=>({key:e,activeRef:d}),[e]);/* @__PURE__ */
4
+ return b("div",{ref:y,role:c?"tabpanel":void 0,id:c,"aria-labelledby":u,hidden:!t,style:t?void 0:{display:"none"},className:l,"data-page-tab":e,children:/* @__PURE__ */b(K.Provider,{value:p,children:/* @__PURE__ */b(R,{active:t,children:i(r)})})})},(e,t)=>e.active===t.active&&e.location===t.location&&e.className===t.className&&e.panelId===t.panelId&&e.tabId===t.tabId&&(!t.active||e.render===t.render)),$="\0transient";function J({children:e,frameClassName:t}){const n=p(g),r=k();if(!n||!n.enabled)/* @__PURE__ */
5
+ return b("div",{className:t,children:e(r)},$);const{state:i,currentKey:l,locationFor:c,idFor:a}=n,s=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!s.includes(l)&&s.push(l),/* @__PURE__ */h(v,{children:[s.map(n=>{const i=n===l,s=i?r:c(n);return s?/* @__PURE__ */b(D,{tabKey:n,active:i,location:s,render:e,className:t,panelId:a(n,"panel"),tabId:a(n,"tab")},n):null}),!l&&/* @__PURE__ */b(D,{tabKey:$,active:!0,location:r,render:e,className:t},$)]})}function S({className:t,activeClassName:n,end:i}){const l=p(g),c=r().pageTabs;if(!l||!l.enabled)return null;const{visibleTabs:a,state:s,idFor:o,activate:u,close:y,closeMany:d,resolve:f}=l;/* @__PURE__ */
6
+ return b(e,{tabs:a.map(e=>({key:e.key,title:e.title,pinned:e.pinned,dirty:s.dirty.includes(e.key),copy:l.copies[e.key],icon:f(j(e.path))?.icon})),activeKey:l.currentKey??null,idFor:o,panelMounted:e=>s.mounted.includes(e),onActivate:u,onClose:e=>{y(e)},onCloseMany:(e,t)=>{d(e,t)},label:c.label,className:t,activeClassName:n,end:i})}var B={enabled:!1,tabs:[],activeKey:null,activate:()=>{},close:async()=>!1,closeOthers:async()=>{},closeRight:async()=>{},closeAll:async()=>{}};function E(){const e=p(g);return e&&e.enabled?{enabled:!0,tabs:e.visibleTabs,activeKey:e.currentKey,activate:e.activate,close:e.close,closeOthers:t=>e.closeMany("others",t),closeRight:t=>e.closeMany("right",t),closeAll:()=>e.closeMany("all",null)}:B}function P(){const e=p(g),t=p(K),n=m();return{key:e?.enabled&&t?t.key:null,close:y(async(r={})=>e?.enabled&&t&&e.state.tabs.some(e=>e.key===t.key)?e.close(t.key,r):(r.to&&n(r.to),!1),[e,t,n])}}function Z(e){const t=p(g),n=p(K),r=t?.enabled?t.setTitle:void 0,i=n?.key;s(()=>{r&&i&&e&&r(i,e)},[r,i,e])}function H(e){const t=p(g),n=p(K),r=t?.enabled?t.setCopy:void 0,i=n?.key;s(()=>{if(r&&i)return r(i,e||null),()=>r(i,null)},[r,i,e])}function Q(e){const t=p(g),n=p(K),r=t?.enabled?t.setDirty:void 0;s(()=>{if(r&&n)return r(n.key,e),()=>{n.activeRef.current&&r(n.key,!1)}},[r,n,e])}export{F as DEFAULT_MAX_TABS,L as PAGE_TABS_PAUSE_HIDDEN,S as PageTabBar,J as PageTabsOutlet,x as PageTabsProvider,j as parseTabPath,P as usePageTab,H as usePageTabCopy,Q as usePageTabDirty,Z as usePageTabTitle,E as usePageTabs};
@@ -1,4 +1,4 @@
1
- export { A as ALT, b as ALT_SHIFT_D, c as ALT_SHIFT_E, d as ALT_SHIFT_N, e as APP_UPDATE_POLL_MS, f as Accordion, g as AccordionItem, h as AccordionProps, i as Align, j as AngleScale, k as AppUpdateBanner, l as AppUpdateBannerProps, m as AttachButton, n as AttachButtonProps, o as AttachmentDropZone, p as AttachmentDropZoneProps, q as AttachmentList, r as AttachmentListProps, s as AuthScreen, t as AuthScreenProps, u as Avatar, v as AvatarGroup, w as AvatarGroupProps, x as AvatarProps, y as AvatarSize, z as AvatarStatus, B as BackgroundVariant, D as BandScale, E as Banner, F as BannerEmphasis, G as BannerProps, H as BannerTone, I as BarChart, J as BarChartProps, K as BoxPlotBox, L as BoxPlotChart, M as BoxPlotChartProps, N as BrandAssetEditor, O as BrandAssetEditorProps, Q as BrandAssetPreview, R as BrandMark, T as BrandMarkProps, U as BrandMarkSlot, V as BrandMarkSurface, W as BrandMarkTreatment, X as BreadcrumbItem, Y as Breadcrumbs, Z as BreadcrumbsProps, _ as BudgetBar, $ as BudgetBarProps, a0 as BudgetState, a1 as Button, a2 as ButtonClassesOptions, a3 as ButtonProps, a4 as ButtonSize, a5 as ButtonVariant, a6 as CHART_INK, a7 as CMD_A, a8 as CMD_DOT, a9 as CMD_ENTER, aa as CMD_K, ab as CMD_S, ac as Calendar, ad as CalendarMode, ae as CalendarProps, af as Candle, ag as CandlestickChart, ah as CandlestickChartProps, ai as Card, aj as CardPadding, ak as CardProps, al as CartesianPlot, am as CartesianPlotProps, an as CellStyle, ao as ChartBackgroundVariant, ap as ChartBrush, aq as ChartBrushProps, ar as ChartCurve, as as ChartDefs, at as ChartDefsProps, au as ChartDot, av as ChartDotProps, aw as ChartDotVariant, ax as ChartFillVariant, ay as ChartFrame, az as ChartFrameProps, aA as ChartHighlightProvider, aB as ChartLegendEntry, aC as ChartLegendSwatch, aD as ChartRange, aE as ChartReferenceLine, aF as ChartRevealDirection, aG as ChartSkeleton, aH as ChartSkeletonProps, aI as ChartStatusTone, aJ as ChartStrokeVariant, aK as ChartTooltip, aL as ChartTooltipProps, aM as ChartTooltipRow, aN as ChatTemplate, aO as Checkbox, aP as CheckboxProps, aQ as CheckoutTemplate, aR as ChordChart, aS as ChordChartProps, aT as ColorPicker, aU as ColorPickerPanel, aV as ColorPickerPanelProps, aW as ColorPickerProps, aX as ColorPreset, aY as ColorSwatch, aZ as ColorSwatchProps, a_ as ColorSwatchSize, a$ as ColoredBadge, b0 as ColoredBadgeProps, b1 as ColumnChart, b2 as ColumnChartProps, C as ColumnDef, b3 as ColumnSeries, b4 as ComposerAttachments, b5 as ComposerAttachmentsProps, b6 as ConfirmProvider, b7 as ContainerFillChart, b8 as ContainerFillChartProps, b9 as ContainerFillItem, ba as ContextMenu, bb as ContextMenuPoint, bc as ContextMenuProps, bd as ContextMenuState, be as CountBadge, bf as CountBadgeProps, bg as CountBadgeTone, bh as Curve, bi as DAY_MS, bj as DEFAULT_SHELL_STRINGS, bk as DashboardTemplate, bl as DataTable, bm as DataTableColumn, bn as DataTableColumnGroup, bo as DataTableHeader, bp as DataTablePage, bq as DataTableProps, br as DataTableRowLink, bs as DataTableRowProps, bt as DatePicker, bu as DatePickerProps, bv as DateRangePicker, bw as DateRangePickerProps, bx as DateTimePicker, by as DateTimePickerProps, bz as DescriptionColumns, bA as DescriptionItem, bB as DescriptionList, bC as DescriptionListProps, bD as Dialog, bE as DialogProps, bF as DialogSize, bG as Divider, bH as DividerProps, bI as DividerSpacing, bJ as DonutChart, bK as DonutChartProps, bL as DonutSegment, bM as Drawer, bN as DrawerProps, bO as DrawerSide, bP as DrawerSize, bQ as DropdownMenu, bR as DropdownMenuAlign, bS as DropdownMenuCheckboxItem, bT as DropdownMenuDividerItem, bU as DropdownMenuEntry, bV as DropdownMenuItem, bW as DropdownMenuLabelItem, bX as DropdownMenuLinkItem, bY as DropdownMenuProps, bZ as DropdownMenuRadioItem, b_ as DropdownMenuSide, b$ as DropdownPositionOptions, c0 as ENTER, c1 as EditableGrid, c2 as EditableGridProps, c3 as EmailTemplate, c4 as EmptyState, c5 as EmptyStateProps, c6 as EmptyValue, c7 as EmptyValueProps, c8 as ErrorBoundary, c9 as ErrorBoundaryProps, ca as ErrorPage, cb as ErrorPageProps, cc as FileIntake, cd as FilePicker, ce as FilePickerProps, cf as FillVariant, cg as FormError, ch as FormErrorSummary, ci as FormErrorSummaryProps, cj as FormField, ck as FormFieldProps, cl as FormLayoutPage, cm as FunnelChart, cn as FunnelChartProps, co as FunnelStage, cp as GLASS_DIVIDER, cr as GROUP_COLORS, cs as GROUP_COLORS_SOLID, ct as GalleryTemplate, cu as Gap, cv as GlassOptions, cw as GlobalSearch, cx as GlobalSearchProps, cy as Grid, cz as GridCols, cA as GridColumn, cB as GridProps, cC as HeatmapChart, cD as HeatmapChartProps, cE as HelpCenter, cF as HelpCenterDoc, cG as HelpCenterProps, cH as HexInput, cI as HistogramBin, cJ as HistogramChart, cK as HistogramChartProps, cL as Hsv, cM as INPUT_BASE, cN as INPUT_SIZES, cO as IconButton, cP as IconButtonClassesOptions, cQ as IconButtonProps, cR as IconRail, cS as IconRailButton, cT as IconRailButtonProps, cU as IconRailLabels, cV as IconRailLabelsShown, cW as IconRailOrientation, cX as IconRailProps, cY as Inline, cZ as InlineProps, c_ as Input, c$ as InputNumber, d0 as InputNumberProps, d1 as InputProps, d2 as InputSize, d3 as Justify, d4 as Kanban, d5 as KanbanColumn, d6 as KanbanProps, d7 as Kbd, d8 as KbdProps, d9 as KbdSize, da as Label, db as LabelClassesOptions, dc as LabelProps, dd as LadderScale, de as LineChart, df as LineChartProps, dg as LineChartSeries, dh as LinearScale, di as ListFooter, dj as ListLoadError, dk as ListLoadErrorProps, dl as LoadingSpinner, dm as LoadingSpinnerProps, dn as MAX_FRACTION_DIGITS, dp as MENU_MAX_HEIGHT, dq as MOD, dr as MOTION, ds as Markdown, ds as MarkdownLite, dt as MarkdownLiteProps, dt as MarkdownProps, du as MediaUploadField, dv as MediaUploadFieldProps, dw as MediaUploadGrid, dx as MediaUploadGridItem, dy as MediaUploadGridProps, dz as MenuPos, dA as Meter, dB as MeterProps, dC as MetricBar, dD as MetricBarProps, dE as Milestone, dF as MilestoneKind, dG as MilestoneTimeline, dH as MilestoneTimelineProps, dJ as NEXT_CHUNK_PATH_PREFIX, dK as NativeSelect, dL as NumericKeypad, dM as NumericKeypadProps, dN as OVERLAY_OPEN_EVENT, dO as POPUP_MAX_WIDTH, dP as POST_PRODUCTION_STATUSES, dQ as PageHeader, dR as PageHeaderProps, P as PaginatedResponse, dS as Pagination, dT as PaginationProps, dU as PaperclipGlyph, dV as Paragraph, dW as ParagraphProps, dX as PieChart, dY as PieChartProps, dZ as PieSegment, d_ as PlotGeometry, d$ as Point, e0 as Popover, e1 as PopoverAlign, e2 as PopoverProps, e3 as PopoverRenderProps, e4 as PopoverSide, e5 as PopupMenu, e6 as PopupMenuDivider, e7 as PopupMenuItem, e8 as PopupMenuItemProps, e9 as PopupMenuLabel, ea as PopupMenuProps, eb as PopupSubmenu, ec as PopupSubmenuProps, ed as PortalBrandingContextValue, ee as PortalBrandingProvider, ef as PortalBrandingProviderProps, eg as ProductionTimeline, eh as ProductionTimelineProps, ei as ProductionTimelineSnapshot, ej as ProgressItem, ek as PublicPortal, el as PublicPortalBranding, em as RADAR_SERIES_CAP, en as RadarAxis, eo as RadarChart, ep as RadarChartProps, eq as RadarSeries, er as RadialBarChart, es as RadialBarChartProps, et as RadialBarRow, eu as Radio, ev as RadioGroup, ew as RadioGroupOption, ex as RadioGroupOrientation, ey as RadioGroupProps, ez as RadioProps, eA as Range, eB as RangeChart, eC as RangeChartProps, eD as RangeRow, eE as RankedBars, eF as RankedBarsProps, eG as RankedBarsRow, eH as ResizeHandle, eI as ResizeHandleProps, eJ as ResizeHandleSide, eK as ResolvedPortalBrandAsset, eL as Result, eM as ResultProps, eN as ResultStatus, eO as RevealDirection, eP as SCATTER_SERIES_CAP, eQ as SERIES_SLOT_COUNT, eR as SERIES_VARS, eS as SHIFT, eT as STAGES, eU as STALE_CHUNK_RELOAD_COOLDOWN_MS, eV as STALE_CHUNK_RELOAD_KEY, eW as STATUS_VARS, eX as SankeyChart, eY as SankeyChartProps, eZ as SankeyLink, e_ as SankeyNode, e$ as ScatterChart, f0 as ScatterChartProps, f1 as ScatterPoint, f2 as ScatterSeries, S as SearchConfig, f3 as SearchListRoute, f4 as SearchProvider, f5 as SearchQuickAction, f6 as SearchResponse, f7 as SearchResult, f8 as SearchableOption, f9 as SearchableSelect, fa as SearchableSelectProps, fb as Segmented, fc as SegmentedOption, fd as SegmentedProps, fe as SegmentedSize, ff as Select, fg as SelectBaseProps, fh as SelectItem, fi as SelectMultipleProps, fj as SelectOption, fk as SelectOptionGroup, fl as SelectProps, fm as SemanticGroup, fn as SettingRow, fo as SettingRowProps, fp as SeverityTone, fs as ShellPrefsAdapter, ft as ShellPrefsProvider, fu as ShellStrings, fv as ShellStringsOverride, fw as ShellStringsProvider, fx as SidebarActionButton, fy as SidebarActionButtonProps, fz as SidebarGroupLabel, fA as SidebarGroupLabelProps, fB as SidebarLayout, fC as SidebarLayoutProps, fD as SidebarNavGroup, fE as SidebarNavGroupProps, fF as SidebarNavItem, fG as SidebarNavItemProps, fH as Skeleton, fI as SkeletonProps, fJ as SkeletonVariant, fK as Slider, fL as SliderProps, fM as SliderSize, fN as Snippet, fO as SnippetProps, fP as SnippetSize, fQ as SnippetVariant, a as SortState, fR as Sparkline, fS as SparklineProps, fT as Stack, fU as StackProps, fV as StaleChunkReloadOptions, fW as StatCard, fX as StatCardProps, fY as StatTile, fZ as StatTileProps, f_ as Statistic, f$ as StatisticProps, g0 as StatisticSize, g1 as StatisticTone, g2 as StatusBadge, g3 as StatusBadgeProvider, g4 as StatusEmphasis, g5 as StepItem, g6 as Stepper, g7 as StepperProps, g8 as StrokeVariant, g9 as SunburstChart, ga as SunburstChartProps, gb as SunburstNode, gc as Switch, gd as SwitchProps, ge as SwitchSize, gf as TabItem, gg as Tabs, gh as TabsProps, gi as TagInput, gj as TagInputOption, gk as TagInputProps, gl as Text, gm as TextProps, gn as TextSize, go as TextTone, gp as TextWeight, gq as Textarea, gr as TextareaProps, gs as Theme, gt as TileButton, gu as TileButtonProps, gv as TileSize, gw as TimeAgo, gx as TimeAgoProps, gy as TimePicker, gz as TimePickerProps, gA as TimeSeriesChart, gB as TimeSeriesChartProps, gC as TimeSeriesSeries, gD as TimelineMarker, gE as TimelineMarkerKind, gF as TimelineReport, gG as TimelineScrubProgress, gH as TimelineTrack, gI as TimelineTrackItem, gJ as TimelineTrackKind, gK as TimelineTrackPending, gL as TimelineTrackPhase, gM as TimelineTrackPlayback, gN as TimelineTrackProps, gO as TimelineTrackThumb, gP as Title, gQ as TitleLevel, gR as TitleProps, gS as ToastOptions, gT as ToastPlacement, gU as Tooltip, gV as TooltipProps, gW as TopNav, gX as TopNavItem, gY as TopNavProps, gZ as Tree, g_ as TreeDrop, g$ as TreeEmptySlot, h0 as TreeEmptySlotProps, h1 as TreeGroup, h2 as TreeGroupLabel, h3 as TreeGroupProps, h4 as TreeMove, h5 as TreeProps, h6 as TreeRow, h7 as TreeRowProps, h8 as TreeSeam, h9 as TreeSeamProps, ha as TreemapChart, hb as TreemapChartProps, hc as TreemapItem, hd as TreemapTile, he as UseAppUpdateOptions, hf as UseContextMenu, hg as UseProductionTimelineOpts, hh as VERSION, hi as VITE_PRELOAD_ERROR_EVENT, hj as WaterfallChart, hk as WaterfallChartProps, hl as WaterfallStep, hm as ZLayer, hn as Z_LAYERS, ho as angleScale, hp as appendKey, hq as applyThemePrefs, hr as arcPath, hs as areaBetween, ht as areaFrom, hu as autoHighlightIndex, hv as backspace, hw as bandScale, hx as binValues, hy as budgetState, hz as bumpPath, hA as buttonClasses, hB as calcOverall, hC as calcReportOverall, hD as colorFill, hE as colorSwatchClasses, hF as confirm, hG as confirmDestructive, hH as curvePath, hI as dashFor, hK as dismissPopups, hL as fillFor, hM as fillId, hN as fmtSliderDate, hO as fromDateKey, hP as glassStyle, hQ as glowId, hR as groundId, hS as groupColors, hT as hexToHsv, hU as highlightOpacity, hV as hsvToHex, hW as iconButtonClasses, hX as inputClasses, hY as installStaleChunkReload, hZ as isMac, h_ as isSeverityTone, h$ as isStaleChunkError, i1 as labelClasses, i2 as ladderScale, i3 as leavesContextMenuAlone, i4 as linearPath, i5 as linearScale, i6 as logScale, i7 as maskId, i8 as mediaFileName, i9 as monotonePath, ia as niceMax, ib as openGlobalSearch, ic as parseHexColor, id as polygonPoints, ie as popupBounds, ig as prompt, ih as pushRecentSearch, ii as radiusScale, ij as resolveBrandMarkTreatment, ik as resolvePortalBrandAsset, il as resolveSeriesColor, im as resolveTheme, io as sanitizeRecentSearches, ip as seriesColor, iq as severityOf, ir as splinePath, is as squarify, it as stagger, iu as stepPath, iv as tabButtonId, iw as tabPanelId, ix as toDateKey, iy as toDayMs, iz as toISODate, iA as toast, iB as useAppUpdate, iC as useClickOutside, iD as useConfirm, iE as useContextMenu, iF as useDebouncedValue, iG as useDropdownPosition, iH as useFocusTrap, iI as useHighlight, iJ as useIsMobile, iK as useLocalStoragePrefs, iL as usePlotWidth, iM as usePortalBranding, iN as useProductionTimeline, iO as useScrollLock, iP as useShellLocale, iQ as useShellPrefs, iR as useShellStrings, iS as useTheme } from '../index-DRkpyISn.js';
1
+ export { A as ALT, b as ALT_SHIFT_D, c as ALT_SHIFT_E, d as ALT_SHIFT_N, e as APP_UPDATE_POLL_MS, f as Accordion, g as AccordionItem, h as AccordionProps, i as Align, j as AngleScale, k as AppUpdateBanner, l as AppUpdateBannerProps, m as AttachButton, n as AttachButtonProps, o as AttachmentDropZone, p as AttachmentDropZoneProps, q as AttachmentList, r as AttachmentListProps, s as AuthScreen, t as AuthScreenProps, u as Avatar, v as AvatarGroup, w as AvatarGroupProps, x as AvatarProps, y as AvatarSize, z as AvatarStatus, B as BackgroundVariant, D as BandScale, E as Banner, F as BannerEmphasis, G as BannerProps, H as BannerTone, I as BarChart, J as BarChartProps, K as BoxPlotBox, L as BoxPlotChart, M as BoxPlotChartProps, N as BrandAssetEditor, O as BrandAssetEditorProps, Q as BrandAssetPreview, R as BrandMark, T as BrandMarkProps, U as BrandMarkSlot, V as BrandMarkSurface, W as BrandMarkTreatment, X as BreadcrumbItem, Y as Breadcrumbs, Z as BreadcrumbsProps, _ as BudgetBar, $ as BudgetBarProps, a0 as BudgetState, a1 as Button, a2 as ButtonClassesOptions, a3 as ButtonProps, a4 as ButtonSize, a5 as ButtonVariant, a6 as CHART_INK, a7 as CMD_A, a8 as CMD_DOT, a9 as CMD_ENTER, aa as CMD_K, ab as CMD_S, ac as Calendar, ad as CalendarMode, ae as CalendarProps, af as Candle, ag as CandlestickChart, ah as CandlestickChartProps, ai as Card, aj as CardPadding, ak as CardProps, al as CartesianPlot, am as CartesianPlotProps, an as CellStyle, ao as ChartBackgroundVariant, ap as ChartBrush, aq as ChartBrushProps, ar as ChartCurve, as as ChartDefs, at as ChartDefsProps, au as ChartDot, av as ChartDotProps, aw as ChartDotVariant, ax as ChartFillVariant, ay as ChartFrame, az as ChartFrameProps, aA as ChartHighlightProvider, aB as ChartLegendEntry, aC as ChartLegendSwatch, aD as ChartRange, aE as ChartReferenceLine, aF as ChartRevealDirection, aG as ChartSkeleton, aH as ChartSkeletonProps, aI as ChartStatusTone, aJ as ChartStrokeVariant, aK as ChartTooltip, aL as ChartTooltipProps, aM as ChartTooltipRow, aN as ChatTemplate, aO as Checkbox, aP as CheckboxProps, aQ as CheckoutTemplate, aR as ChordChart, aS as ChordChartProps, aT as ColorPicker, aU as ColorPickerPanel, aV as ColorPickerPanelProps, aW as ColorPickerProps, aX as ColorPreset, aY as ColorSwatch, aZ as ColorSwatchProps, a_ as ColorSwatchSize, a$ as ColoredBadge, b0 as ColoredBadgeProps, b1 as ColumnChart, b2 as ColumnChartProps, C as ColumnDef, b3 as ColumnSeries, b4 as ComposerAttachments, b5 as ComposerAttachmentsProps, b6 as ConfirmProvider, b7 as ContainerFillChart, b8 as ContainerFillChartProps, b9 as ContainerFillItem, ba as ContextMenu, bb as ContextMenuPoint, bc as ContextMenuProps, bd as ContextMenuState, be as CountBadge, bf as CountBadgeProps, bg as CountBadgeTone, bh as Curve, bi as DAY_MS, bj as DEFAULT_SHELL_STRINGS, bk as DashboardTemplate, bl as DataTable, bm as DataTableColumn, bn as DataTableColumnGroup, bo as DataTableHeader, bp as DataTablePage, bq as DataTableProps, br as DataTableRowLink, bs as DataTableRowProps, bt as DatePicker, bu as DatePickerProps, bv as DateRangePicker, bw as DateRangePickerProps, bx as DateTimePicker, by as DateTimePickerProps, bz as DescriptionColumns, bA as DescriptionItem, bB as DescriptionList, bC as DescriptionListProps, bD as Dialog, bE as DialogProps, bF as DialogSize, bG as Divider, bH as DividerProps, bI as DividerSpacing, bJ as DonutChart, bK as DonutChartProps, bL as DonutSegment, bM as Drawer, bN as DrawerProps, bO as DrawerSide, bP as DrawerSize, bQ as DropdownMenu, bR as DropdownMenuAlign, bS as DropdownMenuCheckboxItem, bT as DropdownMenuDividerItem, bU as DropdownMenuEntry, bV as DropdownMenuItem, bW as DropdownMenuLabelItem, bX as DropdownMenuLinkItem, bY as DropdownMenuProps, bZ as DropdownMenuRadioItem, b_ as DropdownMenuSide, b$ as DropdownPositionOptions, c0 as ENTER, c1 as EditableGrid, c2 as EditableGridProps, c3 as EmailTemplate, c4 as EmptyState, c5 as EmptyStateProps, c6 as EmptyValue, c7 as EmptyValueProps, c8 as ErrorBoundary, c9 as ErrorBoundaryProps, ca as ErrorPage, cb as ErrorPageProps, cc as FileIntake, cd as FilePicker, ce as FilePickerProps, cf as FillVariant, cg as FormError, ch as FormErrorSummary, ci as FormErrorSummaryProps, cj as FormField, ck as FormFieldProps, cl as FormLayoutPage, cm as FunnelChart, cn as FunnelChartProps, co as FunnelStage, cp as GLASS_DIVIDER, cr as GROUP_COLORS, cs as GROUP_COLORS_SOLID, ct as GalleryTemplate, cu as Gap, cv as GlassOptions, cw as GlobalSearch, cx as GlobalSearchProps, cy as Grid, cz as GridCols, cA as GridColumn, cB as GridProps, cC as HeatmapChart, cD as HeatmapChartProps, cE as HelpCenter, cF as HelpCenterDoc, cG as HelpCenterProps, cH as HexInput, cI as HistogramBin, cJ as HistogramChart, cK as HistogramChartProps, cL as Hsv, cM as INPUT_BASE, cN as INPUT_SIZES, cO as IconButton, cP as IconButtonClassesOptions, cQ as IconButtonProps, cR as IconRail, cS as IconRailButton, cT as IconRailButtonProps, cU as IconRailLabels, cV as IconRailLabelsShown, cW as IconRailOrientation, cX as IconRailProps, cY as Inline, cZ as InlineProps, c_ as Input, c$ as InputNumber, d0 as InputNumberProps, d1 as InputProps, d2 as InputSize, d3 as Justify, d4 as Kanban, d5 as KanbanColumn, d6 as KanbanProps, d7 as Kbd, d8 as KbdProps, d9 as KbdSize, da as Label, db as LabelClassesOptions, dc as LabelProps, dd as LadderScale, de as LineChart, df as LineChartProps, dg as LineChartSeries, dh as LinearScale, di as ListFooter, dj as ListLoadError, dk as ListLoadErrorProps, dl as LoadingSpinner, dm as LoadingSpinnerProps, dn as MAX_FRACTION_DIGITS, dp as MENU_MAX_HEIGHT, dq as MOD, dr as MOTION, ds as Markdown, ds as MarkdownLite, dt as MarkdownLiteProps, dt as MarkdownProps, du as MediaUploadField, dv as MediaUploadFieldProps, dw as MediaUploadGrid, dx as MediaUploadGridItem, dy as MediaUploadGridProps, dz as MenuPos, dA as Meter, dB as MeterProps, dC as MetricBar, dD as MetricBarProps, dE as Milestone, dF as MilestoneKind, dG as MilestoneTimeline, dH as MilestoneTimelineProps, dJ as NEXT_CHUNK_PATH_PREFIX, dK as NativeSelect, dL as NumericKeypad, dM as NumericKeypadProps, dN as OVERLAY_OPEN_EVENT, dO as POPUP_MAX_WIDTH, dP as POST_PRODUCTION_STATUSES, dQ as PageHeader, dR as PageHeaderProps, P as PaginatedResponse, dS as Pagination, dT as PaginationProps, dU as PaperclipGlyph, dV as Paragraph, dW as ParagraphProps, dX as PieChart, dY as PieChartProps, dZ as PieSegment, d_ as PlotGeometry, d$ as Point, e0 as Popover, e1 as PopoverAlign, e2 as PopoverProps, e3 as PopoverRenderProps, e4 as PopoverSide, e5 as PopupMenu, e6 as PopupMenuDivider, e7 as PopupMenuItem, e8 as PopupMenuItemProps, e9 as PopupMenuLabel, ea as PopupMenuProps, eb as PopupSubmenu, ec as PopupSubmenuProps, ed as PortalBrandingContextValue, ee as PortalBrandingProvider, ef as PortalBrandingProviderProps, eg as ProductionTimeline, eh as ProductionTimelineProps, ei as ProductionTimelineSnapshot, ej as ProgressItem, ek as PublicPortal, el as PublicPortalBranding, em as RADAR_SERIES_CAP, en as RadarAxis, eo as RadarChart, ep as RadarChartProps, eq as RadarSeries, er as RadialBarChart, es as RadialBarChartProps, et as RadialBarRow, eu as Radio, ev as RadioGroup, ew as RadioGroupOption, ex as RadioGroupOrientation, ey as RadioGroupProps, ez as RadioProps, eA as Range, eB as RangeChart, eC as RangeChartProps, eD as RangeRow, eE as RankedBars, eF as RankedBarsProps, eG as RankedBarsRow, eH as ResizeHandle, eI as ResizeHandleProps, eJ as ResizeHandleSide, eK as ResolvedPortalBrandAsset, eL as Result, eM as ResultProps, eN as ResultStatus, eO as RevealDirection, eP as SCATTER_SERIES_CAP, eQ as SERIES_SLOT_COUNT, eR as SERIES_VARS, eS as SHIFT, eT as STAGES, eU as STALE_CHUNK_RELOAD_COOLDOWN_MS, eV as STALE_CHUNK_RELOAD_KEY, eW as STATUS_VARS, eX as SankeyChart, eY as SankeyChartProps, eZ as SankeyLink, e_ as SankeyNode, e$ as ScatterChart, f0 as ScatterChartProps, f1 as ScatterPoint, f2 as ScatterSeries, S as SearchConfig, f3 as SearchListRoute, f4 as SearchProvider, f5 as SearchQuickAction, f6 as SearchResponse, f7 as SearchResult, f8 as SearchableItem, f9 as SearchableOption, fa as SearchableOptionGroup, fb as SearchableSelect, fc as SearchableSelectBaseProps, fd as SearchableSelectMultipleProps, fe as SearchableSelectProps, ff as Segmented, fg as SegmentedOption, fh as SegmentedProps, fi as SegmentedSize, fj as Select, fk as SelectBaseProps, fl as SelectItem, fm as SelectMultipleProps, fn as SelectOption, fo as SelectOptionGroup, fp as SelectProps, fq as SemanticGroup, fr as SettingRow, fs as SettingRowProps, ft as SeverityTone, fw as ShellPrefsAdapter, fx as ShellPrefsProvider, fy as ShellStrings, fz as ShellStringsOverride, fA as ShellStringsProvider, fB as SidebarActionButton, fC as SidebarActionButtonProps, fD as SidebarGroupLabel, fE as SidebarGroupLabelProps, fF as SidebarLayout, fG as SidebarLayoutProps, fH as SidebarNavGroup, fI as SidebarNavGroupProps, fJ as SidebarNavItem, fK as SidebarNavItemProps, fL as Skeleton, fM as SkeletonProps, fN as SkeletonVariant, fO as Slider, fP as SliderProps, fQ as SliderSize, fR as Snippet, fS as SnippetProps, fT as SnippetSize, fU as SnippetVariant, a as SortState, fV as Sparkline, fW as SparklineProps, fX as Stack, fY as StackProps, fZ as StaleChunkReloadOptions, f_ as StatCard, f$ as StatCardProps, g0 as StatTile, g1 as StatTileProps, g2 as Statistic, g3 as StatisticProps, g4 as StatisticSize, g5 as StatisticTone, g6 as StatusBadge, g7 as StatusBadgeProvider, g8 as StatusEmphasis, g9 as StepItem, ga as Stepper, gb as StepperProps, gc as StrokeVariant, gd as SunburstChart, ge as SunburstChartProps, gf as SunburstNode, gg as Switch, gh as SwitchProps, gi as SwitchSize, gj as TabItem, gk as Tabs, gl as TabsProps, gm as TagInput, gn as TagInputOption, go as TagInputProps, gp as Text, gq as TextProps, gr as TextSize, gs as TextTone, gt as TextWeight, gu as Textarea, gv as TextareaProps, gw as Theme, gx as TileButton, gy as TileButtonProps, gz as TileSize, gA as TimeAgo, gB as TimeAgoProps, gC as TimePicker, gD as TimePickerProps, gE as TimeSeriesChart, gF as TimeSeriesChartProps, gG as TimeSeriesSeries, gH as TimelineMarker, gI as TimelineMarkerKind, gJ as TimelineReport, gK as TimelineScrubProgress, gL as TimelineTrack, gM as TimelineTrackItem, gN as TimelineTrackKind, gO as TimelineTrackPending, gP as TimelineTrackPhase, gQ as TimelineTrackPlayback, gR as TimelineTrackProps, gS as TimelineTrackThumb, gT as Title, gU as TitleLevel, gV as TitleProps, gW as ToastOptions, gX as ToastPlacement, gY as Tooltip, gZ as TooltipProps, g_ as TopNav, g$ as TopNavItem, h0 as TopNavProps, h1 as Tree, h2 as TreeDrop, h3 as TreeEmptySlot, h4 as TreeEmptySlotProps, h5 as TreeGroup, h6 as TreeGroupLabel, h7 as TreeGroupProps, h8 as TreeMove, h9 as TreeProps, ha as TreeRow, hb as TreeRowProps, hc as TreeSeam, hd as TreeSeamProps, he as TreemapChart, hf as TreemapChartProps, hg as TreemapItem, hh as TreemapTile, hi as UseAppUpdateOptions, hj as UseContextMenu, hk as UseProductionTimelineOpts, hl as VERSION, hm as VITE_PRELOAD_ERROR_EVENT, hn as WaterfallChart, ho as WaterfallChartProps, hp as WaterfallStep, hq as ZLayer, hr as Z_LAYERS, hs as angleScale, ht as appendKey, hu as applyThemePrefs, hv as arcPath, hw as areaBetween, hx as areaFrom, hy as autoHighlightIndex, hz as backspace, hA as bandScale, hB as binValues, hC as budgetState, hD as bumpPath, hE as buttonClasses, hF as calcOverall, hG as calcReportOverall, hH as colorFill, hI as colorSwatchClasses, hJ as confirm, hK as confirmDestructive, hL as curvePath, hM as dashFor, hO as dismissPopups, hP as fillFor, hQ as fillId, hR as fmtSliderDate, hS as fromDateKey, hT as glassStyle, hU as glowId, hV as groundId, hW as groupColors, hX as hexToHsv, hY as highlightOpacity, hZ as hsvToHex, h_ as iconButtonClasses, h$ as inputClasses, i0 as installStaleChunkReload, i1 as isMac, i2 as isSeverityTone, i3 as isStaleChunkError, i5 as labelClasses, i6 as ladderScale, i7 as leavesContextMenuAlone, i8 as linearPath, i9 as linearScale, ia as logScale, ib as maskId, ic as mediaFileName, id as monotonePath, ie as niceMax, ig as openGlobalSearch, ih as parseHexColor, ii as polygonPoints, ij as popupBounds, ik as prompt, il as pushRecentSearch, im as radiusScale, io as registerModalEscapeInterceptor, ip as resolveBrandMarkTreatment, iq as resolvePortalBrandAsset, ir as resolveSeriesColor, is as resolveTheme, it as sanitizeRecentSearches, iu as seriesColor, iv as severityOf, iw as splinePath, ix as squarify, iy as stagger, iz as stepPath, iA as tabButtonId, iB as tabPanelId, iC as toDateKey, iD as toDayMs, iE as toISODate, iF as toast, iG as useAppUpdate, iH as useClickOutside, iI as useConfirm, iJ as useContextMenu, iK as useDebouncedValue, iL as useDropdownPosition, iM as useFocusTrap, iN as useHighlight, iO as useIsMobile, iP as useLocalStoragePrefs, iQ as usePlotWidth, iR as usePortalBranding, iS as useProductionTimeline, iT as useScrollLock, iU as useShellLocale, iV as useShellPrefs, iW as useShellStrings, iX as useTheme } from '../index-DcLqfJX3.js';
2
2
  export { FileIntakeAlert, FileIntakeLimits, FileIntakeOptions, FileRejection, FileRejectionReason, acceptsFile, useFileIntake } from '../file-intake/index.js';
3
3
  export { C as CurrencyFormat, D as DATE_FORMAT_OPTIONS, a as DateFormatKey, E as EMPTY_VALUE, F as FormatDateOptions, b as FormatMoneyOptions, T as TZ_AUTO, c as TimeAgoOptions, d as currencyDecimals, e as currencySymbol, f as firstDayOfWeek, g as formatBytes, h as formatDate, i as formatDateTime, j as formatMoney, k as formatTime, l as getUserDateFormat, m as getUserTimezone, s as setCurrencyFormats, n as setUserDateFormat, o as setUserTimezone, p as syncTimezoneFromProfile, t as timeAgo } from '../index-DCUzlKPZ.js';
4
4
  import 'react';
package/dist/ui/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{APP_UPDATE_POLL_MS,Accordion,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,Banner,BarChart,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,Divider,DonutChart,Drawer,DropdownMenu,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FilePicker_default as FilePicker,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,INPUT_BASE,INPUT_SIZES,IconButton_default as IconButton,IconRail,IconRailButton,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LineChart,ListFooter,ListLoadError,MAX_FRACTION_DIGITS,MOTION,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,Skeleton,Slider,Snippet,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,Tabs,TagInput,Text,Textarea_default as Textarea,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,angleScale,appendKey,applyThemePrefs,arcPath,areaBetween,areaFrom,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,groupColors,hexToHsv,highlightOpacity,hsvToHex,inputClasses,isSeverityTone,labelClasses,ladderScale,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceMax,parseHexColor,polygonPoints,radiusScale,resolvePortalBrandAsset,resolveSeriesColor,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useTheme}from"../chunk-XYITV4EC.js";export{Breadcrumbs}from"../chunk-FZRQBHTK.js";export{MENU_MAX_HEIGHT,POPUP_MAX_WIDTH,ResizeHandle,SidebarLayout,Tooltip,popupBounds,useDropdownPosition}from"../chunk-SQ7BPUZG.js";export{BrandMark,GlobalSearch,openGlobalSearch,pushRecent as pushRecentSearch,resolveBrandMarkTreatment,sanitizeRecent as sanitizeRecentSearches}from"../chunk-FGPWGHNT.js";export{EditableGrid}from"../chunk-PLX2N4N6.js";import"../chunk-BR22X7E5.js";export{toast_default as toast}from"../chunk-KSSAVLO7.js";export{VERSION}from"../chunk-SHVGZW2J.js";export{ALT,ALT_SHIFT_D,ALT_SHIFT_E,ALT_SHIFT_N,CMD_A,CMD_DOT,CMD_ENTER,CMD_K,CMD_S,ENTER,Kbd,LoadingSpinner,MOD,NEXT_CHUNK_PATH_PREFIX,Result,SHIFT,STALE_CHUNK_RELOAD_COOLDOWN_MS,STALE_CHUNK_RELOAD_KEY,ShellPrefsProvider,VITE_PRELOAD_ERROR_EVENT,installStaleChunkReload,isMac,isStaleChunkError,useIsMobile,useLocalStoragePrefs,useShellPrefs}from"../chunk-A7Q4BCPI.js";import"../chunk-5A7MWTXX.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-5J2TKKGH.js";export{DATE_FORMAT_OPTIONS,EMPTY_VALUE,TZ_AUTO,currencyDecimals,currencySymbol,firstDayOfWeek,formatBytes,formatDate,formatDateTime,formatMoney,formatTime,getUserDateFormat,getUserTimezone,setCurrencyFormats,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile,timeAgo}from"../chunk-S2AZZGFF.js";export{Button_default as Button,buttonClasses,iconButtonClasses}from"../chunk-4UCRT4ST.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-KRTZFHYW.js";export{GLASS_DIVIDER,PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,glassStyle,leavesContextMenuAlone}from"../chunk-VDL2RLZG.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups}from"../chunk-ELSUXC3N.js";import"../chunk-MAIHBBWT.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-NCQLGQYR.js";import"../chunk-D65T4H6J.js";
2
+ export{APP_UPDATE_POLL_MS,Accordion,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,Banner,BarChart,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,Divider,DonutChart,Drawer,DropdownMenu,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FilePicker_default as FilePicker,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,INPUT_BASE,INPUT_SIZES,IconButton_default as IconButton,IconRail,IconRailButton,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LineChart,ListFooter,ListLoadError,MAX_FRACTION_DIGITS,MOTION,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,Skeleton,Slider,Snippet,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,Tabs,TagInput,Text,Textarea_default as Textarea,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,angleScale,appendKey,applyThemePrefs,arcPath,areaBetween,areaFrom,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,groupColors,hexToHsv,highlightOpacity,hsvToHex,inputClasses,isSeverityTone,labelClasses,ladderScale,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceMax,parseHexColor,polygonPoints,radiusScale,resolvePortalBrandAsset,resolveSeriesColor,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useTheme}from"../chunk-JKVDTKBE.js";export{Breadcrumbs}from"../chunk-FZRQBHTK.js";export{ResizeHandle,SidebarLayout}from"../chunk-G5J6YSN5.js";export{BrandMark,GlobalSearch,openGlobalSearch,pushRecent as pushRecentSearch,resolveBrandMarkTreatment,sanitizeRecent as sanitizeRecentSearches}from"../chunk-SOI4LR67.js";export{EditableGrid}from"../chunk-7YFAFXQG.js";import"../chunk-BR22X7E5.js";export{toast_default as toast}from"../chunk-KSSAVLO7.js";export{VERSION}from"../chunk-VRHUY4P4.js";export{ALT,ALT_SHIFT_D,ALT_SHIFT_E,ALT_SHIFT_N,CMD_A,CMD_DOT,CMD_ENTER,CMD_K,CMD_S,ENTER,Kbd,LoadingSpinner,MOD,NEXT_CHUNK_PATH_PREFIX,Result,SHIFT,STALE_CHUNK_RELOAD_COOLDOWN_MS,STALE_CHUNK_RELOAD_KEY,ShellPrefsProvider,VITE_PRELOAD_ERROR_EVENT,installStaleChunkReload,isMac,isStaleChunkError,useIsMobile,useLocalStoragePrefs,useShellPrefs}from"../chunk-CRI4UFBU.js";import"../chunk-5A7MWTXX.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-5J2TKKGH.js";export{DATE_FORMAT_OPTIONS,EMPTY_VALUE,TZ_AUTO,currencyDecimals,currencySymbol,firstDayOfWeek,formatBytes,formatDate,formatDateTime,formatMoney,formatTime,getUserDateFormat,getUserTimezone,setCurrencyFormats,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile,timeAgo}from"../chunk-S2AZZGFF.js";export{Button_default as Button,MENU_MAX_HEIGHT,POPUP_MAX_WIDTH,Tooltip,buttonClasses,iconButtonClasses,popupBounds,useDropdownPosition}from"../chunk-BKDE67DB.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-M4DB7UBZ.js";export{PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,leavesContextMenuAlone}from"../chunk-UVZIPXIA.js";import"../chunk-AFYQTVZO.js";export{GLASS_DIVIDER,glassStyle}from"../chunk-HZZNJHRH.js";import"../chunk-D65T4H6J.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups,registerModalEscapeInterceptor}from"../chunk-X4FJ54PP.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-NCQLGQYR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-shell",
3
- "version": "4.165.0",
3
+ "version": "4.166.0",
4
4
  "description": "Desktop-style React UI shell — windows, taskbar, start menu, sticky notes, frosted glass theming, and bundled apps.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1,29 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-RKEHUV7U.js";import{useWidgetSettings as n}from"./chunk-ZLJCWBDF.js";import"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-4UCRT4ST.js";import"./chunk-6KO2U66R.js";import"./chunk-KRTZFHYW.js";import"./chunk-VDL2RLZG.js";import"./chunk-ELSUXC3N.js";import"./chunk-MAIHBBWT.js";import"./chunk-NCQLGQYR.js";import"./chunk-D65T4H6J.js";import{useState as r,useRef as l,useCallback as o,useEffect as i}from"react";import{jsxs as a,Fragment as c,jsx as s}from"react/jsx-runtime";var u="calc_appearance";function d(){const[d,h]=r("0"),[m,b]=r(null),[k,g]=r(null),[p,v]=r(!1),[x,y]=r(""),[N,f]=r([]),[C,$]=r(!1),[j,w]=r(()=>e(u)),[L,E]=r(!1),[S,T]=r(j),W=l(null);n(o(()=>{T({...j}),E(!0)},[j]));const B=o(e=>{y(""),h(t=>p||"0"===t?(v(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[p]),A=o(()=>{h("0"),b(null),g(null),v(!1)},[]),D=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),F=o(e=>{const t=parseFloat(d);if(null!==m&&k&&!p){const e=D(m,t,k);h(String(e)),b(e),f(n=>[`${m} ${k} ${t} = ${e}`,...n].slice(0,20))}else b(t);g(e),v(!0)},[d,m,k,p,D]),R=o(()=>{if(null===m||!k)return;const e=parseFloat(d),t=D(m,e,k),n=`${m} ${k} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),h(String(t)),b(null),g(null),v(!0)},[d,m,k,D]),U=o(()=>{h(e=>String(parseFloat(e)/100))},[]),H=o(()=>{h(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);i(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?B(e.key):"."===e.key?B("."):"+"===e.key?F("+"):"-"===e.key?F("-"):"*"===e.key?F("×"):"/"===e.key?(e.preventDefault(),F("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&W.current?.contains(e.target)&&e.preventDefault(),R()):"Escape"===e.key?A():"Backspace"===e.key?h(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&U())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[B,F,R,A,U]);const M="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",I=`${M} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,O=`${M} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Q=`${M} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,X=`${M} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
- return a(c,{children:[
3
- /* @__PURE__ */a("div",{ref:W,className:"flex flex-col h-full",style:{opacity:j.activeOpacity/100,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */a("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
- /* @__PURE__ */s("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:N.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */s("div",{className:"text-[11px] text-slate-400 text-right font-mono truncate",children:e},t))}),(x||k&&null!==m)&&/* @__PURE__ */s("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${m} ${k} ${p?"":d}`}),
6
- /* @__PURE__ */a("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */s("button",{onClick:()=>{navigator.clipboard.writeText(d),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */s("svg",C?{className:"h-5 w-5 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}:{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),
8
- /* @__PURE__ */s("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(d)})]})]}),
9
- /* @__PURE__ */a("div",{className:"grid grid-cols-4 grid-rows-5 gap-1.5 flex-1 min-h-0 p-2",children:[
10
- /* @__PURE__ */s("button",{onClick:A,className:Q,children:"AC"}),
11
- /* @__PURE__ */s("button",{onClick:H,className:Q,children:"+/−"}),
12
- /* @__PURE__ */s("button",{onClick:U,className:Q,children:"%"}),
13
- /* @__PURE__ */s("button",{onClick:()=>F("÷"),className:`${O} ${"÷"===k?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */s("button",{onClick:()=>B("7"),className:I,children:"7"}),
15
- /* @__PURE__ */s("button",{onClick:()=>B("8"),className:I,children:"8"}),
16
- /* @__PURE__ */s("button",{onClick:()=>B("9"),className:I,children:"9"}),
17
- /* @__PURE__ */s("button",{onClick:()=>F("×"),className:`${O} ${"×"===k?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */s("button",{onClick:()=>B("4"),className:I,children:"4"}),
19
- /* @__PURE__ */s("button",{onClick:()=>B("5"),className:I,children:"5"}),
20
- /* @__PURE__ */s("button",{onClick:()=>B("6"),className:I,children:"6"}),
21
- /* @__PURE__ */s("button",{onClick:()=>F("-"),className:`${O} ${"-"===k?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */s("button",{onClick:()=>B("1"),className:I,children:"1"}),
23
- /* @__PURE__ */s("button",{onClick:()=>B("2"),className:I,children:"2"}),
24
- /* @__PURE__ */s("button",{onClick:()=>B("3"),className:I,children:"3"}),
25
- /* @__PURE__ */s("button",{onClick:()=>F("+"),className:`${O} ${"+"===k?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */s("button",{onClick:()=>B("0"),className:`${I} col-span-2`,children:"0"}),
27
- /* @__PURE__ */s("button",{onClick:()=>B("."),className:I,children:"."}),
28
- /* @__PURE__ */s("button",{onClick:R,className:X,children:"="})]})]}),
29
- /* @__PURE__ */s(t,{open:L,onClose:()=>E(!1),title:"Calculator Settings",appearance:S,onAppearanceChange:T,onSave:()=>{w(S),localStorage.setItem(u,JSON.stringify(S)),E(!1)}})]})}export{d as default};
@@ -1 +0,0 @@
1
- export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-KRTZFHYW.js";import"./chunk-ELSUXC3N.js";import"./chunk-NCQLGQYR.js";
@@ -1,25 +0,0 @@
1
- import{getNumberingConfigs as e}from"./chunk-QTPVA26D.js";import{SidebarLayout as t}from"./chunk-SQ7BPUZG.js";import{AboutApp as r}from"./chunk-D7EJSASN.js";import{toast_default as n}from"./chunk-KSSAVLO7.js";import"./chunk-SHVGZW2J.js";import{useWindowManager as o,client_default as i}from"./chunk-ZLJCWBDF.js";import{useShellPrefs as l}from"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import{timeAgo as s}from"./chunk-S2AZZGFF.js";import"./chunk-4UCRT4ST.js";import"./chunk-6KO2U66R.js";import"./chunk-KRTZFHYW.js";import"./chunk-VDL2RLZG.js";import"./chunk-ELSUXC3N.js";import"./chunk-MAIHBBWT.js";import"./chunk-NCQLGQYR.js";import"./chunk-D65T4H6J.js";import{useRef as c,useEffect as a,useState as d,useCallback as p}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as m,Fragment as h,jsx as g}from"react/jsx-runtime";var x=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var y={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:k,save:v}=l(),{data:N}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=c({});a(()=>{if(!N)return;const e={};for(const t of N){const r=y[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[N]);const _=k.notepad_notes||[],[T,j]=d(null),[C,L]=d(""),[S,$]=d(""),[W,B]=d("yellow"),[D,X]=d(!1),[A,M]=d(!1),O=c(null),V=c(),Z=_.find(e=>e.id===T);a(()=>{if(!T&&_.length>0){const e=_[0];j(e.id),L(e.title),$(e.content),B(e.color)}},[_.length]);const H=p(e=>{v({notepad_notes:e})},[v]),I=p(()=>{if(!T||!D)return;const e=_.map(e=>e.id===T?{...e,title:C,content:S,color:W,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);H(e),X(!1)},[T,D,C,S,W,_,H]);a(()=>{if(D)return V.current&&clearTimeout(V.current),V.current=setTimeout(I,800),()=>{V.current&&clearTimeout(V.current)}},[D,I]),a(()=>()=>{D&&I()},[]);const P=e=>{D&&I(),j(e.id),L(e.title),$(e.content),B(e.color),X(!1),M(!1)},R=e=>{const t=S.slice(0,e),r=S.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=S.slice(e+r[0].length);$(t+n+o),X(!0)},U=async(e,t)=>{const r=w.current[e];if(!r)return;const o=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:o,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,o):n.error(`${o} not found`)}catch{n.error(`Failed to look up ${o}`)}},q="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",F=/* @__PURE__ */m(h,{children:[
2
- /* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */m("button",{onClick:()=>{D&&I();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,..._];H(t),j(e.id),L(""),$(""),B("yellow"),X(!1),M(!0),setTimeout(()=>O.current?.focus(),50)},className:"w-full flex items-center justify-center gap-1.5 rounded-lg bg-blue-600 text-white px-3 py-1.5 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
3
- /* @__PURE__ */g("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),"New Note"]})}),
4
- /* @__PURE__ */g("div",{className:"flex-1 overflow-y-auto",children:0===_.length?/* @__PURE__ */g("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):_.map(e=>{const t=(r=e.color,x.find(e=>e.key===r)||x[0]);var r;/* @__PURE__ */
5
- return m("button",{onClick:()=>P(e),className:"w-full text-left px-3 py-2.5 border-b border-gray-100 transition-colors "+(T===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
6
- /* @__PURE__ */m("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */g("div",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${t.dot}`}),
8
- /* @__PURE__ */g("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"}),e.sticky&&/* @__PURE__ */g("svg",{className:"h-3 w-3 text-amber-500 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */g("path",{d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})]}),
9
- /* @__PURE__ */g("p",{className:"text-xs text-gray-400 mt-0.5 truncate ml-4.5",children:e.content.replace(/\[[ xX]?\]/g,"").slice(0,60)||"Empty note"}),
10
- /* @__PURE__ */g("p",{className:"text-[10px] text-gray-300 mt-0.5 ml-4.5",children:s(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
- return m("div",{className:"h-full",children:[
12
- /* @__PURE__ */g(r,{app:"notepad"}),
13
- /* @__PURE__ */g(t,{sidebar:F,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:T?/* @__PURE__ */m("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
- /* @__PURE__ */m("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */g("input",{value:C,onChange:e=>{L(e.target.value),X(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{B(e.key),X(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${W===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);H(t);const r=t.find(t=>t.id===e);n.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(T),title:Z?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(Z?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:Z?.sticky?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})}),
18
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.filter(t=>t.id!==e);if(H(t),T===e){const e=t[0];e?P(e):(j(null),L(""),$(""))}})(T),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})})]}),A?/* @__PURE__ */g("textarea",{ref:O,value:S,onChange:e=>{$(e.target.value),X(!0)},onBlur:()=>{M(!1),D&&I()},placeholder:q,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */g("div",{onClick:()=>{M(!0),setTimeout(()=>O.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:S?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],l=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=l.exec(e));){const e=s[1],t=s[2];if(w.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */g("button",{onClick:()=>U(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let c=0;for(let e=0;e<r;e++)c+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=c+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>R(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */g("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:"​"},`empty-${r}`));const a=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
19
- return g("div",{className:a?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:q})}),
20
- /* @__PURE__ */m("div",{className:"px-4 py-1.5 border-t border-gray-100 flex items-center gap-4 text-[10px] text-gray-400",children:[
21
- /* @__PURE__ */g("span",{children:"[] checkbox"}),
22
- /* @__PURE__ */g("span",{children:"SO#35001 entity link"}),
23
- /* @__PURE__ */g("span",{className:"ml-auto",children:A?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */m("div",{className:"text-center text-gray-400",children:[
24
- /* @__PURE__ */g("svg",{className:"h-12 w-12 mx-auto mb-3 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),
25
- /* @__PURE__ */g("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -1,37 +0,0 @@
1
- import{EditableGrid as e}from"./chunk-PLX2N4N6.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-D7EJSASN.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import"./chunk-SHVGZW2J.js";import{WindowTitle as a}from"./chunk-ZLJCWBDF.js";import"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-4UCRT4ST.js";import"./chunk-6KO2U66R.js";import"./chunk-KRTZFHYW.js";import"./chunk-VDL2RLZG.js";import"./chunk-ELSUXC3N.js";import"./chunk-MAIHBBWT.js";import"./chunk-NCQLGQYR.js";import"./chunk-D65T4H6J.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function w(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function k(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const k=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=w(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,$]=s(0),L=l([]),U=l(C),E=l(!1);c(()=>{E.current?E.current=!1:U.current!==C&&(L.current.push(U.current),L.current.length>50&&L.current.shift()),U.current=C},[C]);const M=i(()=>{const e=L.current.pop();e&&(E.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),M())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[M]);const[A,D]=s(N?.title??"Untitled"),[R,B]=s(()=>g.current?.data.onEmail),F=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),$(0),D(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),B(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==k.current&&F(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&F(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[I,K]=s(!1),[T,X]=s(null),[W,H]=s(""),O=l(null),[V,Z]=s("1"),[J,Q]=s("10"),z=C[j]||C[0],G=z.data,P=z.columns,Y=z.cellStyles??{},[_,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return _?[_]:[]},[ee,_]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:_,ae=oe?Y[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==P.length?se({data:e,columns:y(t)}):se({data:e})},[se,P.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),X(null)},ue=()=>G.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];G.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=G.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
2
- return u("div",{ref:m,className:"flex flex-col h-full",children:[
3
- /* @__PURE__ */d(a,{title:`${me=A||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
4
- /* @__PURE__ */d(t,{app:"spreadsheet"}),
5
- /* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[I?/* @__PURE__ */d("input",{type:"text",value:A,onChange:e=>D(e.target.value),onBlur:()=>K(!1),onKeyDown:e=>{"Enter"===e.key&&K(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>K(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:A||"Untitled"}),
6
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
7
- /* @__PURE__ */d("input",{ref:O,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),$(0),D(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),D(r)}O.current&&(O.current.value="")},className:"hidden"}),
8
- /* @__PURE__ */d("button",{onClick:()=>O.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
9
- /* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${A||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),R&&/* @__PURE__ */d("button",{onClick:()=>R(ue(),`${A||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
10
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
11
- /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
12
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:V,onChange:e=>Z(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
13
- /* @__PURE__ */d("button",{onClick:()=>(e=>{const t=P.length+e;se({columns:y(t),data:G.map(t=>[...t,...Array(e).fill("")])})})(parseInt(V)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
14
- /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
15
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:J,onChange:e=>Q(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
16
- /* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(J)||10,void se({data:[...G,...Array.from({length:e},()=>Array(P.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
17
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
18
- /* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
19
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
20
- /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
21
- /* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
22
- /* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
23
- /* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
24
- /* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
25
- /* @__PURE__ */d("option",{value:"sm",children:"XS"}),
26
- /* @__PURE__ */d("option",{value:"base",children:"S"}),
27
- /* @__PURE__ */d("option",{value:"lg",children:"M"}),
28
- /* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
29
- /* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:P,data:G,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:Y,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
30
- /* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
31
- /* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>$(t),onDoubleClick:()=>{X(t),H(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&$(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:T===t?/* @__PURE__ */d("input",{type:"text",value:W,onChange:e=>H(e.target.value),onBlur:()=>ie(t,W||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,W||e.name),"Escape"===r.key&&X(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
32
- /* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),$(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
33
- /* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
34
- /* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
35
- /* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
36
- /* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
37
- /* @__PURE__ */u("span",{children:[G.length," × ",P.length]})]})]})]});var me}export{k as default};
@@ -1,5 +0,0 @@
1
- import{forwardRef as e,useId as r}from"react";import{jsxs as o,jsx as t}from"react/jsx-runtime";var s="inline-flex items-center justify-center rounded-md font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60",i={primary:"bg-blue-600 text-white shadow-sm hover:bg-blue-700 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",secondary:"border border-gray-300 bg-white text-gray-700 shadow-sm hover:bg-gray-50 focus-visible:ring-[color:var(--rosh-focus-ring)]",ghost:"text-gray-700 hover:bg-gray-100 focus-visible:ring-[color:var(--rosh-focus-ring)]","ghost-danger":"text-red-600 hover:bg-red-50 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]",danger:"bg-red-600 text-white shadow-sm hover:bg-red-700 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-strong)]",link:"text-blue-600 underline-offset-4 hover:underline focus-visible:ring-[color:var(--rosh-focus-ring)]"},a={sm:"gap-1 px-2.5 py-1 text-xs",md:"gap-1.5 px-3 py-1.5 text-sm",lg:"gap-2 px-4 py-2.5 text-sm","touch-sm":"gap-1.5 h-11 px-4 text-base",touch:"gap-2 h-14 px-5 text-base","touch-lg":"gap-2 h-16 px-6 text-lg","touch-xl":"gap-3 h-20 px-8 text-2xl"},l={sm:"gap-1 text-xs",md:"gap-1.5 text-sm",lg:"gap-2 text-sm","touch-sm":"gap-1.5 text-base",touch:"gap-2 text-base","touch-lg":"gap-2 text-lg","touch-xl":"gap-3 text-2xl"},n={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10","touch-sm":"h-11 w-11",touch:"h-14 w-14","touch-lg":"h-16 w-16","touch-xl":"h-20 w-20"};function c({variant:e="primary",size:r="md",block:o=!1,className:t=""}={}){const n="link"===e;return[n?"inline-flex items-center font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60":s,i[e],n?l[r]:a[r],o?"w-full":"",t].filter(Boolean).join(" ")}function g({variant:e="ghost",size:r="md",pressed:o=!1,className:t=""}={}){const a=!o||"ghost"!==e&&"secondary"!==e?i[e]:"bg-blue-50 text-blue-700 hover:bg-blue-100 focus-visible:ring-[color:var(--rosh-focus-ring)]";return[s,a,n[r],"shrink-0 p-0",t].filter(Boolean).join(" ")}function u(){/* @__PURE__ */
2
- return o("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
3
- /* @__PURE__ */t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
4
- /* @__PURE__ */t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}var d=e(function({variant:e="primary",size:s="md",loading:i=!1,leftIcon:a,rightIcon:l,block:n=!1,disabled:g,type:d="button",children:h,className:x="",disabledReason:b,...m},p){const f=r(),v=g||i,y=v&&null!=b&&""!==b,w=y?f:void 0,N=/* @__PURE__ */o("button",{ref:p,type:d,disabled:v,"aria-busy":i||void 0,"aria-describedby":w,className:c({variant:e,size:s,block:n,className:x}),...m,children:[i?/* @__PURE__ */t(u,{}):a,h,!i&&l]});return y?/* @__PURE__ */o("span",{className:n?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[N,
5
- /* @__PURE__ */t("span",{id:w,className:"text-xs text-red-600",children:b})]}):N});export{d as Button_default,c as buttonClasses,g as iconButtonClasses};
@@ -1 +0,0 @@
1
- import{useEffect as e,useLayoutEffect as n}from"react";var t=/* @__PURE__ */new Set,o=null;var r=/* @__PURE__ */new Map;function i(e,n){return t.add(e),n&&r.set(e,n),function(){if(o||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&d(e)&&(e.preventDefault(),e.stopPropagation())};document.addEventListener("keydown",e,!0),o=()=>document.removeEventListener("keydown",e,!0)}(),()=>{t.delete(e),r.delete(e),0===t.size&&o&&(o(),o=null)}}function d(e){const n=Array.from(t);for(let t=n.length-1;t>=0;t--)try{if(n[t](e))return!0}catch{}return!1}function u(e){if(!e)return!1;for(const[n,o]of r){if(!t.has(n))continue;let r;try{r=o()}catch{r=null}if(r&&r.isConnected&&!r.contains(e))return!0}return!1}var f="react-os-shell:overlay-open";function c(){"undefined"!=typeof window&&window.dispatchEvent(new Event(f))}function a(e){return"undefined"==typeof window?()=>{}:(window.addEventListener(f,e),()=>window.removeEventListener(f,e))}var w={window:50,windowStep:10,menu:400,pinnedWindow:999,overlay:9999,popup:1e4},p="undefined"==typeof document?e:n;function s(e){p(()=>{e&&c()},[e])}export{f as OVERLAY_OPEN_EVENT,w as Z_LAYERS,c as dismissPopups,u as escapeSurfaceAbove,a as onOverlayOpen,i as registerModalEscapeInterceptor,d as runEscapeInterceptors,s as useDismissPopupsOnOpen};
@@ -1,27 +0,0 @@
1
- import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{glassStyle as a}from"./chunk-VDL2RLZG.js";import{useDismissPopupsOnOpen as l,Z_LAYERS as o}from"./chunk-ELSUXC3N.js";import{useShellStrings as s}from"./chunk-NCQLGQYR.js";import{useState as i,useEffect as c,useRef as d,useMemo as u,useId as p,useCallback as y}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";var b={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function g(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function k(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function w({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:d,width:u,height:p,decorative:y=!1,fallbackMode:m="monogram",adaptive:h=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:_=4,treatmentRadius:L=8,className:A="",style:C}){const[$,E]=i(e||t||"");c(()=>{E(e||t||"")},[e,t]);const T=Boolean(t&&$===t&&$!==e),I=(T?a??h:h)?x(T?n:w,T?r:N,s):"bare",S=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==d&&null==u&&null==p?b[o]:"","dark"===s?"text-white":"text-gray-700",v[I],A].filter(Boolean).join(" "),j={...k(I,L,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return $?/* @__PURE__ */f("span",{className:S,"data-brand-treatment":I,style:j,children:/* @__PURE__ */f("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>E(e=>t&&e!==t?t:"")})}):"none"===m?null:/* @__PURE__ */f("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${S} rounded-md bg-gray-100 font-semibold`,style:j,children:y?null:g(l)})}function N(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function L(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&N(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function A(e,t,n){return!!t&&e.some(e=>e.to===t||A(_(e,n),t,n))}var C="__page__";function $(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function E(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])N(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:C,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?C:r.entityType,entity_id:r.entityId})}return n}var I="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function j(e,t,n,r){return{type:e,label:t,entity_type:C,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function M(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=t.get(n.type);e?e.push(n):t.set(n.type,[n])}return Array.from(t,([e,t])=>({type:e,results:t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.type}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.type),l=r?a?.listRoutes?.[e.type]:void 0;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.type}`,label:r,result:j(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=S("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function R(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var D=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function K(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function B(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),t.some(e=>D(e,r))||t.push(r)}return t.slice(0,8)}function P(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var z=[];function U(e,t,n){const[r,a]=i([]),[l,o]=i(z),[s,u]=i(!1),[p,f]=i("none"),m=d(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());c(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(z),f("none"),void u(!1);u(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...P(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),f(0===l.failed?"none":l.failed>=t.length?"all":"some"),u(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:y(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(z),f("none"),u(!1)},[])}}var H=(e,t)=>`${e}-opt-${t}`;function F(e,t){return"seeAll"===e.kind?"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3":"action"===e.kind?e.icon??I:e.icon?e.icon:t?.[e.result.type]?t[e.result.type]:I}function G({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
2
- return f("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */m("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
3
- /* @__PURE__ */m("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
4
- /* @__PURE__ */f("span",{children:e.title}),
5
- /* @__PURE__ */f("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
6
- return m("div",{id:H(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
7
- /* @__PURE__ */f("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:F(e,a)})}),
8
- /* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[
9
- /* @__PURE__ */f("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */f("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */f("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var W="react-os-shell:open-global-search";function X(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(W))}function O({providers:e,typeIcons:t,listRoutes:n,placeholder:r,quickActions:b,onSelect:g,recent:x,onRecord:v,favorites:k}={}){const w=s().search,N=r??w.placeholder,[_,L]=i(!1),[A,C]=i(""),[$,E]=i(0),T=d(null),{results:j,truncatedTypes:D,loading:K,failure:B,reset:P}=U(A,e,2);c(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),L(e=>!e)),"Escape"===e.key&&_&&L(!1)},t=()=>L(!0);return window.addEventListener("keydown",e),window.addEventListener(W,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(W,t)}},[_]),l(_);const[z,F]=i(!1);_!==z&&(F(_),_&&(C(""),E(0),P())),c(()=>{_?setTimeout(()=>T.current?.focus(),50):C("")},[_]),c(()=>{E(0)},[j]);const X=A.length>=2,O=u(()=>X?M(j,b,A,w.actions,{truncatedTypes:D,listRoutes:n,seeAllLabel:w.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((e,t)=>({kind:"recent",key:`recent:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type,result:e})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((e,t)=>({kind:"favorite",key:`favorite:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:e})),count:e.favorites.length});const r=S("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[X,j,D,n,b,A,x,k,w]),Q=u(()=>function(e){return e.flatMap(e=>e.rows)}(O),[O]),V=Math.min($,Math.max(Q.length-1,0)),q=p(),Y=Q.length>0;c(()=>{_&&0!==Q.length&&document.getElementById(H(q,V))?.scrollIntoView?.({block:"nearest"})},[_,V,Q.length,q]);const Z=y(e=>{L(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||v?.(e.result),g?.(e.result)):e.action.onSelect()},[g,v]);return _?h(
10
- /* @__PURE__ */m("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>L(!1),children:[
11
- /* @__PURE__ */f("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
- /* @__PURE__ */m("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:a(),children:[
13
- /* @__PURE__ */m("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
- /* @__PURE__ */f("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:I})}),
15
- /* @__PURE__ */f("input",{ref:T,type:"text",value:A,onChange:e=>{C(e.target.value),E(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),E(R(V,1,Q.length))):"ArrowUp"===e.key?(e.preventDefault(),E(R(V,-1,Q.length))):"Tab"===e.key&&Q.length>0?(e.preventDefault(),E(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(O.map(e=>e.rows.length),V,e.shiftKey?-1:1))):"Enter"===e.key&&Q[V]&&Z(Q[V])},placeholder:N,role:"combobox","aria-expanded":Y,"aria-controls":Y?q:void 0,"aria-activedescendant":Y?H(q,V):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),K&&/* @__PURE__ */f("span",{"data-global-search-spinner":"",role:"status","aria-label":w.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
16
- /* @__PURE__ */f("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:w.escBadge})]}),
17
- /* @__PURE__ */m("div",{className:"max-h-[50vh] overflow-y-auto",children:[K&&0===Q.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!K&&"all"===B&&X&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!K&&X&&0===Q.length&&"all"!==B&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),Y&&/* @__PURE__ */f(G,{sections:O,activeIdx:V,listId:q,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:E,onPick:Z}),!K&&"some"===B&&X&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!K&&!X&&0===Q.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.minChars(2)})]}),
18
- /* @__PURE__ */m("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
19
- /* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[
20
- /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
21
- /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
22
- /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${w.navigate}`]}),
23
- /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
24
- /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.enterKey}),` ${w.open}`]}),O.length>1&&/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
25
- /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.tabKey}),` ${w.nextGroup}`]})]}),
26
- /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
27
- /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.escKey}),` ${w.close}`]})]})]})]}),document.body):null}export{w as BrandMark,O as GlobalSearch,C as PAGE_RESULT_ENTITY,T as favoritesToResults,E as navPagesProvider,X as openGlobalSearch,$ as parsePageResultTarget,L as partitionNav,K as pushRecent,x as resolveBrandMarkTreatment,A as rowsContainRoute,B as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};