@graphysdk/react-renderer 1.8.1-beta.1786352280463 → 1.8.1-beta.1786354953172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editable.cjs +1 -1
- package/dist/editable.mjs +1 -1
- package/dist/{history-chords-Bfvf75tz.cjs → history-chords-BQ7eeQ6T.cjs} +1 -1
- package/dist/{history-chords-V6t-FaHD.js → history-chords-DdGqrRWz.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/editable.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./editable.css');const c=require("./history-chords-Bfvf75tz.cjs"),Zn=require("./font-values-CStAZ2d1.cjs");let m=require("@graphysdk/viz-engine"),v=require("react"),n=require("react/jsx-runtime"),ie=require("zustand/react/shallow"),$n=require("react-dom"),V=require("clsx");V=c.__toESM(V,1);let De=require("@vanilla-extract/dynamic"),M=require("@base-ui/react/menu"),G=require("@base-ui/react"),X=require("@base-ui/react/accordion"),xe=require("@base-ui/react/number-field"),Fe=require("@base-ui/react/radio"),He=require("@base-ui/react/radio-group"),H=require("@base-ui/react/select"),Z=require("@base-ui/react/slider"),fe=require("@base-ui/react/switch"),Xn=require("@base-ui/react/input");var Yn="data-graphy-chart-chrome",Jn="data-graphy-chart-menu",ze={[Jn]:""},Q=e=>({[Yn]:e}),Ge=(e,t)=>e instanceof Element&&e.closest(`[data-graphy-chart-chrome="${CSS.escape(t)}"]`)!==null,Qn=e=>e instanceof Element&&e.closest("[data-graphy-chart-menu]")!==null,et=e=>e instanceof Element&&e.closest("[data-graphy-chart-chrome]")!==null,Y=(e,t,s)=>e instanceof Node&&(t.contains(e)||Ge(e,s)),nt="cml7ha0",Ve=(0,v.createContext)(null),tt=({children:e})=>{const{chartId:t}=c.useGraphContext(),[s]=(0,v.useState)(c.resolvePortalContainer),[r,a]=(0,v.useState)(null);return s===null?null:(0,n.jsxs)(n.Fragment,{children:[(0,$n.createPortal)((0,n.jsx)("div",{ref:a,className:nt,...Q(t)}),s),(0,n.jsx)(Ve.Provider,{value:r,children:e})]})},le=()=>(0,v.useContext)(Ve),Ke=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M2.333 3h11.334v8.667c-2 0-4 .333-5.667 2.333-2-2-3.667-2.333-5.667-2.333z",opacity:".12"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",fillRule:"evenodd",d:"M3.325 3.156a.836.836 0 0 0-.836.836v6.832c0 .462.375.836.836.836h2.131a.5.5 0 0 1 .352.145L8 13.975l2.193-2.17a.5.5 0 0 1 .352-.145h2.13a.84.84 0 0 0 .836-.836V3.992a.84.84 0 0 0-.836-.836zm-1.836.836c0-1.014.822-1.836 1.836-1.836h9.35c1.015 0 1.836.825 1.836 1.836v6.832a1.84 1.84 0 0 1-1.836 1.836H10.75l-2.398 2.374a.5.5 0 0 1-.704 0L5.25 12.66H3.325a1.836 1.836 0 0 1-1.836-1.836z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",fillRule:"evenodd",d:"M8 4.505a.5.5 0 0 1 .5.5v2.172h2.171a.5.5 0 0 1 0 1H8.5v2.171a.5.5 0 0 1-1 0V8.177H5.329a.5.5 0 0 1 0-1H7.5V5.005a.5.5 0 0 1 .5-.5",clipRule:"evenodd"})]});var Be="efjmb40",qe="efjmb41",q="efjmb42",U="efjmb43",rt="efjmb44",at="efjmb45",ot=new Set(["item-press","escape-key","outside-press","close-press","sibling-open","trigger-press"]),ce=({label:e,icon:t,onOpened:s,children:r})=>{const a=le(),[o,i]=(0,v.useState)(!1),d=(l,p)=>{l?(i(!0),s?.()):ot.has(p.reason)&&i(!1)};return(0,n.jsxs)(G.Menu.SubmenuRoot,{open:o,onOpenChange:d,children:[(0,n.jsx)(st,{label:e,icon:t}),(0,n.jsx)(G.Menu.Portal,{container:a,children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(G.Menu.Positioner,{side:"right",align:"start",sideOffset:4,className:Be,...ze,children:(0,n.jsx)(G.Menu.Popup,{className:qe,children:r})})})})]})},st=({label:e,icon:t})=>(0,n.jsxs)(G.Menu.SubmenuTrigger,{className:q,openOnHover:!1,children:[t,(0,n.jsx)("span",{className:U,children:e}),(0,n.jsx)("span",{className:at,children:(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})})]}),it="_1qe7q450",lt="_1qe7q451",ct="_1qe7q452",dt=({label:e,placeholder:t,addLabel:s,at:r,onRequestClose:a})=>{const o=(0,v.useRef)(null),[i,d]=(0,v.useState)(""),{dispatch:l}=c.useGraphCommands(),p=i.trim(),u=()=>{p.length!==0&&(l(new m.AddAnnotationCommand({kind:"comment",annotation:{at:r,content:ut(p)}})),a())},h=x=>{x.key==="Enter"&&(x.preventDefault(),u()),x.key!=="Escape"&&x.stopPropagation()},f=x=>{d(x.target.value)},g=()=>{requestAnimationFrame(()=>o.current?.focus())};return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(Ke,{}),onOpened:g,children:(0,n.jsxs)("div",{className:it,children:[(0,n.jsx)("input",{ref:o,className:lt,value:i,placeholder:t,onChange:f,onKeyDown:h}),(0,n.jsx)("button",{type:"button",className:ct,disabled:p.length===0,onClick:u,children:s})]})})},ut=e=>({type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e}]}]}),ht=e=>(0,n.jsx)(c.Icon,{viewBox:"0 0 15 14",...e,children:(0,n.jsx)("path",{d:"M14.0146 5.20703C14.2118 5.40459 14.2121 5.72447 14.0146 5.92187L12.3291 7.6084C12.2343 7.70313 12.1047 7.75579 11.9707 7.75586C11.8369 7.75573 11.708 7.70291 11.6133 7.6084L9.92773 5.92187C9.73024 5.72438 9.73031 5.40457 9.92773 5.20703C10.1253 5.0095 10.445 5.0095 10.6426 5.20703L11.4658 6.03027L11.4658 1.68652L7.75586 1.68652L7.75586 12.6455C7.75563 12.9246 7.5291 13.1512 7.25 13.1514L2.5293 13.1514C2.2501 13.1514 2.02367 12.9247 2.02344 12.6455L2.02344 5.00781C0.868958 4.77348 0.000106647 3.7528 -1.10559e-07 2.5293C-4.95071e-08 1.13259 1.13261 9.74645e-05 2.5293 -5.23256e-07C3.92588 0.000220668 5.05859 1.13267 5.05859 2.5293C5.05849 3.75251 4.1892 4.77219 3.03516 5.00684L3.03516 12.1396L6.74414 12.1396L6.74414 1.18066C6.74414 0.901394 6.97076 0.674939 7.25 0.674804L11.9707 0.674805C12.2499 0.674939 12.4766 0.901394 12.4766 1.18066L12.4766 6.03027L13.2998 5.20703C13.4973 5.0095 13.8171 5.0095 14.0146 5.20703ZM4.04687 2.5293C4.04687 1.69137 3.36717 1.01194 2.5293 1.01172C1.69132 1.01182 1.01172 1.6913 1.01172 2.5293C1.01184 3.36719 1.6914 4.04678 2.5293 4.04687C3.36709 4.04665 4.04675 3.36712 4.04687 2.5293ZM14.5 11.2969C14.4998 12.6935 13.3673 13.8262 11.9707 13.8262C10.5742 13.826 9.4416 12.6934 9.44141 11.2969C9.44141 9.90018 10.574 8.7677 11.9707 8.76758C13.3675 8.76758 14.5 9.90011 14.5 11.2969ZM13.4883 11.2969C13.4883 10.4588 12.8088 9.7793 11.9707 9.7793C11.1327 9.77942 10.4531 10.4589 10.4531 11.2969C10.4533 12.1347 11.1329 12.8143 11.9707 12.8145C12.8086 12.8145 13.4881 12.1348 13.4883 11.2969Z",fill:"currentColor",fillOpacity:"0.8"})}),mt="relative-difference",pt=({label:e,layer:t,at:s,onRequestClose:r})=>{const{dispatch:a}=c.useGraphCommands(),o=c.useCompiledSelector(l=>l.coordSystem),i=(0,v.useMemo)(()=>(0,m.inferDifferenceArrowEndpoints)({layer:t,at:s,coordSystem:o}),[t,s,o]);if(i===null)return null;const d=()=>{a(new m.AddAnnotationCommand({kind:"differenceArrow",annotation:{...m.DIFFERENCE_ARROW_DEFAULTS,...i,label:mt}})),r()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:d,children:[(0,n.jsx)(ht,{}),(0,n.jsx)("span",{className:U,children:e})]})};function gt(e,t){if(e.type==="polar"&&!vt(t))return[{scope:"series",labelKey:"pieSlice"}];const s=(0,m.hasMultipleGroups)(t.data,t.mapping);switch(t.geom){case"bar":{const r=[{scope:"data-point",labelKey:"bar"}];if(s){const a=t.position==="stack"||t.position==="fill";r.push({scope:"x-value",labelKey:a?"barStack":"barGroup"}),r.push({scope:"series",labelKey:"barSeries"})}return r}case"line":case"area":{const r=[{scope:"data-point",labelKey:"linePoint"}];return s&&r.push({scope:"series",labelKey:"lineSeries"}),r}case"point":{const r=[{scope:"data-point",labelKey:"scatterPoint"}];return s&&r.push({scope:"series",labelKey:"scatterSeries"}),r}default:return[]}}var vt=e=>{const t=(0,m.extractVariableName)(e.mapping.x);return t!==null&&t!==m.CONSTANT_VARIABLES.x},xt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:"0.3",rx:".533"})]}),ft=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:"0.3",rx:".533"})]}),Ct=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:".8",rx:".533"})]}),bt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.3",d:"M0 13.037h4.267v2.445a.52.52 0 0 1-.519.518H.518A.52.52 0 0 1 0 15.482zM0 7.037c0-.286.232-.518.519-.518h3.23c.286 0 .518.232.518.518v5.408H0z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M5.867 7.704h4.266v7.778a.52.52 0 0 1-.518.518h-3.23a.52.52 0 0 1-.518-.518zM5.867 7.111h4.266V4.074a.52.52 0 0 0-.518-.518h-3.23a.52.52 0 0 0-.518.518z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.3",d:"M11.733 10.074H16v5.408a.52.52 0 0 1-.518.518h-3.23a.52.52 0 0 1-.519-.518zM11.733 9.481H16V.52A.52.52 0 0 0 15.482 0h-3.23a.52.52 0 0 0-.519.519z"})]}),St=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:".8",strokeWidth:"1.163",d:"m-1.618 15.96 9.118-5.3 11 2.34"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.6",stroke:"currentColor",strokeOpacity:"0.3",d:"M8 13a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),(0,n.jsx)("rect",{width:"9.795",height:"6",x:"3",y:"2",fill:"currentColor",fillOpacity:"0.3",rx:"1.513"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M5.29 6.62a1.3 1.3 0 0 1-.424-.075 1 1 0 0 1-.373-.244 1.2 1.2 0 0 1-.262-.45 2.1 2.1 0 0 1-.096-.699q0-.389.082-.693.083-.304.238-.514a1.05 1.05 0 0 1 .374-.322q.22-.11.492-.11.285 0 .505.112a.973.973 0 0 1 .526.744h-.54a.5.5 0 0 0-.17-.277.5.5 0 0 0-.321-.105.54.54 0 0 0-.485.273q-.168.273-.17.75h.021a.8.8 0 0 1 .188-.223.92.92 0 0 1 .569-.195.91.91 0 0 1 .813.477q.125.222.123.509 0 .297-.136.536a1 1 0 0 1-.383.372 1.15 1.15 0 0 1-.571.134m-.003-.443a.54.54 0 0 0 .288-.078.57.57 0 0 0 .2-.211.6.6 0 0 0 .073-.299.6.6 0 0 0-.07-.294.54.54 0 0 0-.484-.285.55.55 0 0 0-.403.173.596.596 0 0 0 .108.914.53.53 0 0 0 .288.08M6.88 6.579v-.396l1.05-1.03q.15-.15.25-.27a1 1 0 0 0 .151-.229.6.6 0 0 0 .05-.236.432.432 0 0 0-.244-.405.6.6 0 0 0-.258-.056q-.15 0-.261.062a.43.43 0 0 0-.175.173.56.56 0 0 0-.06.267H6.86q0-.288.132-.5a.9.9 0 0 1 .362-.33q.231-.117.532-.117.303 0 .534.114.23.114.358.312a.8.8 0 0 1 .128.452.9.9 0 0 1-.065.334q-.065.164-.229.363-.162.2-.456.483l-.522.53v.021h1.318v.458zM10.57 6.62a1.3 1.3 0 0 1-.423-.075 1 1 0 0 1-.373-.244 1.2 1.2 0 0 1-.263-.45 2.1 2.1 0 0 1-.096-.699q0-.389.083-.693t.238-.514a1.05 1.05 0 0 1 .374-.322q.219-.11.492-.11.285 0 .505.112a.973.973 0 0 1 .526.744h-.54a.5.5 0 0 0-.17-.277.5.5 0 0 0-.322-.105.54.54 0 0 0-.484.273q-.168.273-.17.75h.02a.8.8 0 0 1 .188-.223.92.92 0 0 1 .569-.195.91.91 0 0 1 .814.477q.125.222.123.509 0 .297-.136.536a1 1 0 0 1-.383.372 1.15 1.15 0 0 1-.572.134m-.002-.443a.54.54 0 0 0 .288-.078.57.57 0 0 0 .2-.211.6.6 0 0 0 .073-.299.6.6 0 0 0-.071-.294.54.54 0 0 0-.483-.285.54.54 0 0 0-.403.173.597.597 0 0 0 .107.914.53.53 0 0 0 .289.08"})]}),jt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{stroke:"currentColor",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:".993",d:"M1.5 12 6 6.5l4 3.5 4-5.5"}),(0,n.jsx)("circle",{cx:"1.493",cy:"11.993",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"5.993",cy:"6.493",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"9.993",cy:"9.993",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"13.993",cy:"4.493",r:".993",fill:"currentColor",fillOpacity:"0.8"})]}),yt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"16",height:"16",fill:"currentColor",fillOpacity:"0.3",rx:"8"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.8",d:"m7.999 16 .412-.01A8 8 0 0 0 8 0z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.6",d:"M15.999 8a8 8 0 0 1-7.588 7.989l-.412.01V8z"})]}),It=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 3.598 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 6.681 11.327)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 9.251 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 10.28 2.59)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 13.877 6.187)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 2.056 12.869)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 15.933 .533)"})]}),Pt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 3.598 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 6.681 11.327)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 9.251 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 10.28 2.59)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 13.877 6.187)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 2.056 12.869)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 15.933 .533)"})]}),wt={bar:xt,barGroup:ft,barStack:bt,barSeries:Ct,linePoint:St,lineSeries:jt,scatterPoint:It,scatterSeries:Pt,pieSlice:yt},Ue=({labelKey:e})=>{const t=wt[e];return(0,n.jsx)(t,{})},We=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M15 4.66667L12.3333 2L2.33334 12L5.00001 14.6667L15 4.66667Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.01683 15.3331C4.84407 15.3343 4.67292 15.2997 4.51421 15.2314C4.3555 15.1632 4.21268 15.0627 4.09476 14.9365L3.88656 14.7283L3.62877 14.8968L3.19253 15.3331H0L2.24072 13.0923L2.03251 12.8445C1.89423 12.7191 1.78392 12.566 1.70875 12.3952C1.63359 12.2244 1.59526 12.0396 1.59626 11.853C1.59579 11.6818 1.63078 11.5124 1.69904 11.3554C1.76729 11.1984 1.86733 11.0573 1.99285 10.9409L11.2036 1.73012C11.3215 1.60384 11.4643 1.5034 11.623 1.43514C11.7817 1.36688 11.9529 1.33228 12.1257 1.33353C12.2969 1.33245 12.4665 1.36716 12.6236 1.43546C12.7807 1.50375 12.9218 1.60412 13.0378 1.73012L15.1496 3.92126C15.2748 4.03899 15.3745 4.1811 15.4427 4.33882C15.5108 4.49654 15.546 4.66655 15.546 4.83837C15.546 5.01019 15.5108 5.1802 15.4427 5.33792C15.3745 5.49564 15.2748 5.63774 15.1496 5.75548L5.93889 14.9662C5.81806 15.0866 5.67403 15.1812 5.51552 15.2443C5.35702 15.3074 5.18736 15.3376 5.01683 15.3331ZM2.48858 11.9125L5.01683 14.4407L9.47843 9.97913L6.95019 7.4608L2.48858 11.9125ZM7.68388 6.72712L10.2022 9.24544L14.644 4.80367L12.1257 2.28534L7.68388 6.72712Z",fill:"currentColor",fillOpacity:"0.8"})]}),Tt=({label:e,options:t,onSelect:s})=>{const r=c.useI18n();return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(We,{}),children:t.map(a=>(0,n.jsxs)(G.Menu.Item,{className:q,onClick:()=>s(a.scope),children:[(0,n.jsx)(Ue,{labelKey:a.labelKey}),(0,n.jsx)("span",{className:U,children:r(`graph.annotations.highlights.labels.${a.labelKey}`)})]},a.scope))})},At=({label:e,layer:t,observation:s,highlights:r,onRequestClose:a})=>{const o=c.useI18n(),{dispatch:i}=c.useGraphCommands(),d=c.useCompiledSelector(g=>g.coordSystem),l=(0,v.useMemo)(()=>(0,m.buildObservationPredicate)(t,s),[t,s]),p=(0,v.useMemo)(()=>gt(d,t),[d,t]),u=(0,v.useMemo)(()=>{const g=new Set(r.map(x=>x.scope));return p.filter(x=>!g.has(x.scope))},[p,r]),[h]=u;if(l===null||h===void 0)return null;const f=g=>{i(new m.AddHighlightCommand({predicate:l,scope:g,layerId:t.id})),a()};if(u.length===1){const g=p.length===1?e:o("graph.annotations.baseMenu.highlightWithLabel",{label:o(`graph.annotations.highlights.labels.${h.labelKey}`)});return(0,n.jsxs)(G.Menu.Item,{className:q,onClick:()=>f(h.scope),children:[(0,n.jsx)(Ue,{labelKey:h.labelKey}),(0,n.jsx)("span",{className:U,children:g})]})}return(0,n.jsx)(Tt,{label:e,options:u,onSelect:f})},_t="_1aafi1g0",Lt="_1aafi1g1",Ze=({children:e})=>(0,n.jsxs)("span",{className:_t,"aria-hidden":"true",children:[e,(0,n.jsx)("span",{className:Lt})]}),Et=({label:e,highlights:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=t.at(-1);if(a===void 0)return null;const o=()=>{r(new m.RemoveHighlightCommand({id:a.id})),s()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:o,children:[(0,n.jsx)(Ze,{children:(0,n.jsx)(We,{})}),(0,n.jsx)("span",{className:U,children:e})]})},Nt=(e,t)=>{const s=c.useCompiledSelector(a=>a.spec.highlights),r=c.useCompiledSelector(a=>a.config.parsingLocale);return(0,v.useMemo)(()=>(0,m.findHighlightsAtObservation)({layer:e,highlights:s,observation:t,parsingLocale:r}),[e,s,t,r])},$e=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M13.5948 4.29016C13.8724 6.22367 12.5301 8.01618 10.5966 8.29384C8.66309 8.57151 6.87058 7.22918 6.59292 5.29567C6.31525 3.36216 7.65758 1.56965 9.59109 1.29198C11.5246 1.01432 13.3171 2.35665 13.5948 4.29016Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.71886 3.51052C6.25611 1.3626 8.43287 0.0568985 10.5808 0.594151C12.7287 1.1314 14.0344 3.30817 13.4972 5.45609C13.0316 7.31748 11.3347 8.54637 9.49237 8.49145L7.50898 12.492C7.46485 12.581 7.40179 12.6548 7.32702 12.7108C7.20005 12.8073 7.03703 12.8532 6.87248 12.8303C6.80957 12.822 6.74697 12.8038 6.68687 12.7749C6.39369 12.6342 6.26689 12.2915 6.3923 11.9963L7.63393 7.97371C6.10249 7.10872 5.27136 5.29962 5.71886 3.51052ZM10.2785 1.80253C8.79799 1.4322 7.29756 2.33222 6.92723 3.81277C6.55691 5.29332 7.45692 6.79375 8.93747 7.16408C10.418 7.5344 11.9185 6.63439 12.2888 5.15384C12.6591 3.67329 11.7591 2.17285 10.2785 1.80253Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.42977 11.1572C5.70072 11.104 5.8772 10.8411 5.82393 10.5702C5.77067 10.2992 5.50784 10.1227 5.23688 10.176C4.31848 10.3565 3.57421 10.6423 3.04695 11.0266C2.51409 11.4149 2.16666 11.936 2.16666 12.557C2.16666 13.0322 2.41215 13.4327 2.74425 13.7433C3.07553 14.0531 3.52776 14.3091 4.04484 14.5137C5.08193 14.9239 6.48048 15.1666 7.99999 15.1666C9.5195 15.1666 10.9181 14.9239 11.9551 14.5137C12.4722 14.3091 12.9244 14.0531 13.2557 13.7433C13.5878 13.4327 13.8333 13.0322 13.8333 12.557C13.8333 11.936 13.4859 11.4149 12.953 11.0266C12.4258 10.6423 11.6815 10.3565 10.7631 10.176C10.4921 10.1227 10.2293 10.2992 10.176 10.5702C10.1228 10.8411 10.2993 11.104 10.5702 11.1572C11.4079 11.3219 11.997 11.5672 12.364 11.8347C12.7255 12.0981 12.8333 12.3496 12.8333 12.557C12.8333 12.6643 12.7803 12.8187 12.5727 13.013C12.3642 13.2079 12.0354 13.4065 11.5873 13.5838C10.6941 13.9371 9.426 14.1666 7.99999 14.1666C6.57398 14.1666 5.30586 13.9371 4.41267 13.5838C3.9646 13.4065 3.63578 13.2079 3.4273 13.013C3.21964 12.8187 3.16666 12.6643 3.16666 12.557C3.16666 12.3496 3.2745 12.0981 3.63595 11.8347C4.00299 11.5672 4.59206 11.3219 5.42977 11.1572Z",fill:"currentColor",fillOpacity:"0.8"})]}),Mt=({label:e,at:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=()=>{r(new m.AddAnnotationCommand({kind:"pinnedNumber",annotation:{at:t}})),s()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:a,children:[(0,n.jsx)($e,{}),(0,n.jsx)("span",{className:U,children:e})]})},Xe=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.7328 9.69963C5.56696 9.47884 5.25352 9.43429 5.03273 9.60013C4.81193 9.76598 4.76739 10.0794 4.93323 10.3002C5.63175 11.2302 6.74548 11.8333 7.99993 11.8333C9.25438 11.8333 10.3681 11.2302 11.0666 10.3002C11.2325 10.0794 11.1879 9.76598 10.9671 9.60013C10.7463 9.43429 10.4329 9.47884 10.2671 9.69963C9.74929 10.3889 8.92657 10.8333 7.99993 10.8333C7.07329 10.8333 6.25057 10.3889 5.7328 9.69963Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M6.66668 6.66658C6.66668 7.03478 6.3682 7.33325 6.00001 7.33325C5.63182 7.33325 5.33334 7.03478 5.33334 6.66658C5.33334 6.29839 5.63182 5.99992 6.00001 5.99992C6.3682 5.99992 6.66668 6.29839 6.66668 6.66658Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M10 7.33325C10.3682 7.33325 10.6667 7.03478 10.6667 6.66658C10.6667 6.29839 10.3682 5.99992 10 5.99992C9.63182 5.99992 9.33334 6.29839 9.33334 6.66658C9.33334 7.03478 9.63182 7.33325 10 7.33325Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 0.833252C4.04197 0.833252 0.833344 4.04188 0.833344 7.99992C0.833344 11.958 4.04197 15.1666 8.00001 15.1666C11.9581 15.1666 15.1667 11.958 15.1667 7.99992C15.1667 4.04188 11.9581 0.833252 8.00001 0.833252ZM14.1667 7.99992C14.1667 11.4057 11.4058 14.1666 8.00001 14.1666C4.59425 14.1666 1.83334 11.4057 1.83334 7.99992C1.83334 4.59416 4.59425 1.83325 8.00001 1.83325C11.4058 1.83325 14.1667 4.59416 14.1667 7.99992Z",fill:"currentColor",fillOpacity:"0.8"})]}),Ye={pinnedNumber:{icon:$e,labelKey:"graph.annotations.baseMenu.unpinNumber"},comment:{icon:Ke,labelKey:"graph.annotations.baseMenu.removeAnnotation"},sticker:{icon:Xe,labelKey:"graph.annotations.baseMenu.removeSticker"},image:null},Ot=e=>(0,m.isObservationAttachmentKind)(e.kind)&&Ye[e.kind]!==null,Rt=({attachment:e,onRequestClose:t})=>{const s=c.useI18n(),{dispatch:r}=c.useGraphCommands(),{icon:a,labelKey:o}=Ye[e.kind],i=()=>{r(new m.RemoveAnnotationCommand({id:e.annotation.id})),t()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:i,children:[(0,n.jsx)(Ze,{children:(0,n.jsx)(a,{})}),(0,n.jsx)("span",{className:U,children:s(o)})]})},kt="ceeojg0",Dt="ceeojg1",Ft="ceeojg2",Ht=({label:e,at:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=o=>{r(new m.AddAnnotationCommand({kind:"sticker",annotation:{at:{anchorType:"observation",...t},sticker:o}})),s()};return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(Xe,{}),children:(0,n.jsx)("div",{className:kt,children:Object.entries(c.STICKER_ASSETS).map(([o,i])=>(0,n.jsx)(G.Menu.Item,{className:Dt,"aria-label":o,onClick:()=>a(o),children:(0,n.jsx)("img",{className:Ft,src:i.src,alt:o})},o))})})},zt=({interaction:e,panelOrigin:t})=>{const s=c.useEditorStore(),r=c.useEditorState(o=>o.menuTrigger);if(e.kind!=="menu"||r===null)return null;const a=()=>{s.getState().releaseInteraction("menu")};return(0,n.jsx)(Gt,{trigger:{x:t.x+r.center.x,y:t.y+r.center.y,radius:r.radius},layer:e.anchor.layer,at:e.anchor.at,observation:e.anchor.observation,onClose:a})},Gt=({trigger:e,layer:t,at:s,observation:r,onClose:a})=>{const o=c.useI18n(),i=le(),d=c.useCompiledSelector(C=>C.spec.annotations),l=c.useCompiledSelector(C=>C.config.parsingLocale),p=Kt(),{x:u,y:h,radius:f}=e,g=(0,v.useMemo)(()=>Vt(u,h,f),[u,h,f]),x=(0,m.findObservationAttachment)(d,s,(0,v.useMemo)(()=>(0,m.createObservationAnchorParser)(t,l),[t,l])),y=x!==null&&Ot(x)?x:null,w=Nt(t,r),j=(C,P)=>{!C&&Bt(P.reason)&&a()};return(0,n.jsx)(M.Menu.Root,{open:p,modal:!1,onOpenChange:j,children:(0,n.jsx)(M.Menu.Portal,{container:i,children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(M.Menu.Positioner,{anchor:g,side:"right",align:"start",sideOffset:8,className:Be,...ze,children:(0,n.jsxs)(M.Menu.Popup,{className:qe,"data-testid":"observation-menu",children:[y!==null&&(0,n.jsx)(Rt,{attachment:y,onRequestClose:a}),(0,n.jsx)(Et,{label:o("graph.annotations.baseMenu.removeHighlight"),highlights:w,onRequestClose:a}),(0,n.jsx)(M.Menu.Separator,{className:rt}),y===null&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Mt,{label:o("graph.annotations.baseMenu.pinNumber"),at:s,onRequestClose:a}),(0,n.jsx)(dt,{label:o("graph.annotations.baseMenu.annotate"),placeholder:o("graph.annotations.textMenu.placeholder"),addLabel:o("graph.annotations.textMenu.addButton"),at:s,onRequestClose:a}),(0,n.jsx)(Ht,{label:o("graph.annotations.baseMenu.addSticker"),at:s,onRequestClose:a})]}),t.highlight!==null&&(0,n.jsx)(At,{label:o("graph.annotations.baseMenu.highlight"),layer:t,observation:r,highlights:w,onRequestClose:a}),(0,n.jsx)(pt,{label:o("graph.annotations.baseMenu.differenceArrow"),layer:t,at:s,onRequestClose:a})]})})})})})},Vt=(e,t,s)=>({getBoundingClientRect:()=>new DOMRect(e-s,t-s,s*2,s*2)}),Kt=()=>{const[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{t(!0)},[]),e},Bt=e=>e==="outside-press"||e==="escape-key"||e==="item-press",qt=()=>{const e=c.useGraphSelection();return Je(e)},Je=e=>{if(e.length!==1)return null;const[t]=e;return t?.kind==="annotation"?t.id:null},Ut=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 9h16m-4-4 4 4"}),(0,n.jsx)("path",{d:"M20 15H4m4 4-4-4"})]})}),Wt=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 7h16"}),(0,n.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,n.jsx)("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),(0,n.jsx)("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"})]})}),Zt={kind:"chrome-popup"},$t="var(--q7gcrz0)",Xt="var(--q7gcrz1)",Yt="q7gcrz2",Jt="q7gcrz3";var Qt="q7gcrz5",er="q7gcrz6",nr="q7gcrz7",tr="q7gcrz8",Qe="q7gcrz9",rr="q7gcrza";var Ce="q7gcrzd q7gcrzc",en="q7gcrze q7gcrzc",ar=["absolute-difference","relative-difference","proportion"],be=["absolute-difference","relative-difference"],or=["relative-difference","proportion"],sr={"absolute-difference":"graph.annotations.differenceArrowToolbar.labelKind.absoluteDifference","relative-difference":"graph.annotations.differenceArrowToolbar.labelKind.relativeDifference",proportion:"graph.annotations.differenceArrowToolbar.labelKind.proportion"},ir=e=>{const{formattingLocale:t}=c.useGraphContext(),s=c.useCompiledSelector(a=>a.config.parsingLocale),r=t??s;return(0,v.useMemo)(()=>{const a=(0,m.areEndpointsComparable)(e.start,e.end);return ar.filter(o=>a||!be.includes(o)||o===e.label).map(o=>({kind:o,nameKey:sr[o],preview:(0,m.formatDifferenceLabel)({locale:r,kind:o,startValue:e.start.measurementValue,endValue:e.end.measurementValue,valueFormat:e.start.valueFormat}),isPickable:a||!be.includes(o),isSuspect:or.includes(o)&&e.start.measurementValue===0}))},[e,r])},$=8,lr=({labelBox:e,panelRect:t,frameWidth:s,frameHeight:r})=>{const a=t.y+e.y,o=a+e.height,i=a-8-36,d=o+8,l=cr($,i>=$?i:d,r-$-36),p=$;return{top:l,left:p,available:Math.max(0,s-$*2),centre:t.x+e.x+e.width/2-p}},cr=(e,t,s)=>Math.max(e,Math.min(t,s)),te=[{id:"small",nameKey:"graph.annotations.differenceArrowToolbar.size.small"},{id:"medium",nameKey:"graph.annotations.differenceArrowToolbar.size.medium"},{id:"large",nameKey:"graph.annotations.differenceArrowToolbar.size.large"}],dr=({arrow:e,labelBox:t,panelRect:s,frameWidth:r,frameHeight:a,frameElement:o})=>{const i=c.useI18n(),{chartId:d,commands:l}=c.useGraphContext(),p=c.useEditorStore(),[u,h]=(0,v.useState)(null),f=ir(e),g=lr({labelBox:t,panelRect:s,frameWidth:r,frameHeight:a}),x=(j,C)=>{l.dispatch(new m.UpdateAnnotationCommand({kind:"differenceArrow",id:e.id,patch:j}),C)};(0,v.useEffect)(()=>()=>l.seal(),[l]),(0,v.useEffect)(()=>{const{claimInteraction:j,releaseInteraction:C}=p.getState();return u===null?C("chrome-popup"):j(Zt),()=>C("chrome-popup")},[p,u]);const y=j=>{h(j?"color":null),j||l.seal()},w=()=>{l.dispatch(new m.RemoveAnnotationCommand({id:e.id})),o.focus({preventScroll:!0})};return(0,n.jsx)("div",{className:Yt,style:{top:g.top,left:g.left,width:g.available},children:(0,n.jsxs)(c.FloatingToolbar.Root,{"aria-label":i("graph.annotations.differenceArrowToolbar.label"),className:Jt,"data-testid":"difference-arrow-toolbar",...Q(d),style:(0,De.assignInlineVars)({[$t]:`${g.centre}px`,[Xt]:`${g.available}px`}),children:[(0,n.jsx)(ur,{options:f,current:e.label,isOpen:u==="labelKind",onOpenChange:j=>h(j?"labelKind":null),onPick:j=>{x({label:j}),h(null)}}),(0,n.jsx)(c.FloatingToolbar.Separator,{}),(0,n.jsx)(c.FloatingToolbar.ColorPicker,{color:e.color,label:i("graph.annotations.differenceArrowToolbar.color"),onChange:j=>x({color:j},{transient:!0}),isOpen:u==="color",onOpenChange:y,popupAttributes:Q(d),children:(0,n.jsx)("span",{className:er,style:{background:e.color??"transparent"}})}),(0,n.jsx)(hr,{current:e.size,isOpen:u==="size",onOpenChange:j=>h(j?"size":null),onPick:j=>{x({size:j}),h(null)}}),(0,n.jsx)(c.FloatingToolbar.Separator,{}),(0,n.jsx)(c.FloatingToolbar.Button,{"aria-label":i("graph.annotations.differenceArrowToolbar.swap"),className:Ce,onClick:()=>x({start:e.end.anchor,end:e.start.anchor}),children:(0,n.jsx)(Ut,{size:"sm",title:""})}),(0,n.jsx)(c.FloatingToolbar.Button,{"aria-label":i("graph.annotations.differenceArrowToolbar.remove"),className:Ce,onClick:w,children:(0,n.jsx)(Wt,{size:"sm",title:""})})]})})},ur=({options:e,current:t,isOpen:s,onOpenChange:r,onPick:a})=>{const o=c.useI18n(),i=e.find(l=>l.kind===t),d=e.some(l=>l.isPickable&&l.kind!==t);return(0,n.jsxs)(M.Menu.Root,{open:s,modal:!1,onOpenChange:r,children:[(0,n.jsxs)(M.Menu.Trigger,{render:(0,n.jsx)(c.FloatingToolbar.Button,{}),"aria-label":o("graph.annotations.differenceArrowToolbar.labelKind.ariaLabel"),className:en,disabled:!d,onMouseDown:l=>l.preventDefault(),children:[(0,n.jsx)("span",{className:Qt,children:i===void 0?"":o(i.nameKey)}),i!==void 0&&(0,n.jsxs)("span",{className:"q7gcrz4",children:["(",i.preview,")"]}),(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})]}),(0,n.jsx)(nn,{children:e.map(l=>(0,n.jsxs)(M.Menu.Item,{className:Qe,"data-selected":l.kind===t,disabled:!l.isPickable,onClick:()=>a(l.kind),children:[(0,n.jsx)("span",{children:o(l.nameKey)}),(l.isSuspect||!l.isPickable)&&(0,n.jsx)("span",{"aria-label":o(l.isPickable?"graph.annotations.differenceArrowToolbar.labelKind.suspectValue":"graph.annotations.differenceArrowToolbar.labelKind.incomparableEnds"),className:"q7gcrzb",role:"img",children:"⚠"}),(0,n.jsx)("span",{className:rr,children:l.preview})]},l.kind))})]})},hr=({current:e,isOpen:t,onOpenChange:s,onPick:r})=>{const a=c.useI18n(),o=te.find(i=>i.id===e)??te[0];return(0,n.jsxs)(M.Menu.Root,{open:t,modal:!1,onOpenChange:s,children:[(0,n.jsxs)(M.Menu.Trigger,{render:(0,n.jsx)(c.FloatingToolbar.Button,{}),"aria-label":a("graph.annotations.differenceArrowToolbar.size.ariaLabel"),className:en,onMouseDown:i=>i.preventDefault(),children:[(0,n.jsx)("span",{children:o===void 0?"":a(o.nameKey)}),(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})]}),(0,n.jsx)(nn,{children:te.map(i=>(0,n.jsx)(M.Menu.Item,{className:Qe,"data-selected":i.id===e,onClick:()=>r(i.id),children:a(i.nameKey)},i.id))})]})},nn=({children:e})=>{const{chartId:t}=c.useGraphContext();return(0,n.jsx)(M.Menu.Portal,{container:c.resolvePortalContainer(),children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(M.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:nr,children:(0,n.jsx)(M.Menu.Popup,{className:tr,onMouseDown:s=>s.preventDefault(),...Q(t),children:e})})})})};var mr="ydgo3h0",pr="ydgo3h1",gr="ydgo3h2",tn=e=>e==="start"?"end":"start",rn=({dispatch:e,arrow:t,endpoint:s,anchor:r})=>{(0,m.areAnchorsEqual)(r,t[s].anchor)||e(new m.UpdateAnnotationCommand({kind:"differenceArrow",id:t.id,patch:{[s]:r}}))},vr=({clientPoint:e,panelOrigin:t,panelRect:s,engine:r,layers:a,coordSystem:o,resolver:i,fixedAnchor:d,align:l})=>{const p=xr({x:e.x-t.x,y:e.y-t.y},s),{primary:u}=r.query((0,m.toPanelCursor)(p,s));if(u===null)return null;const h=a.find(g=>g.id===u.layerId);if(h===void 0)return null;const f=(0,m.resolveObservationPoint)({resolver:i,layer:h,observation:u.observation,coordSystem:o,align:l});return f===null||(0,m.areAnchorsEqual)(f.anchor,d)?null:f},xr=(e,t)=>({x:Math.max(0,Math.min(e.x,t.width)),y:Math.max(0,Math.min(e.y,t.height))}),fr=class{constructor(e){this.params=e,this.listeners=new AbortController,this.pendingEvent=null,this.scheduledFrame=null,this.hasMoved=!1,this.hasPublished=!1,this.handleMove=t=>{t.pointerId===this.params.pointerId&&(this.pendingEvent=t,this.hasMoved=!0,this.scheduledFrame===null&&(this.scheduledFrame=requestAnimationFrame(this.runFrame)))},this.handleUp=t=>{t.pointerId===this.params.pointerId&&(this.pendingEvent=t,this.finish(!0))},this.handleLost=t=>{t.pointerId===this.params.pointerId&&this.finish(!1)},this.runFrame=()=>{this.scheduledFrame=null;const t=this.pendingEvent;if(this.pendingEvent=null,t===null)return;const{editorStore:s,engine:r,anchorResolver:a,endpoint:o,readInputs:i}=this.params,{arrow:d,panelOrigin:l,panelRect:p,layers:u,coordSystem:h}=i(),f=s.getState();if(this.hasPublished&&c.readDraggedEndpointFor(c.readStanding(f,"endpoint-drag"),d.id,o)===null)return;const g=vr({clientPoint:{x:t.clientX,y:t.clientY},panelOrigin:l,panelRect:p,engine:r,layers:u,coordSystem:h,resolver:a,fixedAnchor:d[tn(o)].anchor,align:d[o].anchor.align});g!==null&&this.publish(g)}}start(){const{handle:e}=this.params,{signal:t}=this.listeners;e.addEventListener("pointermove",this.handleMove,{signal:t}),e.addEventListener("pointerup",this.handleUp,{signal:t}),e.addEventListener("lostpointercapture",this.handleLost,{signal:t})}finish(e){this.params.onSettled(),this.listeners.abort(),this.cancelFrame(),e&&this.hasMoved&&this.runFrame(),this.pendingEvent=null;const{editorStore:t,endpoint:s,readInputs:r,dispatch:a}=this.params,{arrow:o}=r(),i=t.getState(),d=c.readDraggedEndpointFor(c.readStanding(i,"endpoint-drag"),o.id,s);d!==null&&(i.releaseInteraction("endpoint-drag"),e&&rn({dispatch:a,arrow:o,endpoint:s,anchor:d.point.anchor}))}publish(e){const{editorStore:t,readInputs:s,endpoint:r}=this.params;t.getState().claimInteraction({kind:"endpoint-drag",annotationId:s().arrow.id,endpoint:r,point:e}),this.hasPublished=!0}cancelFrame(){this.scheduledFrame!==null&&(cancelAnimationFrame(this.scheduledFrame),this.scheduledFrame=null)}},Cr=({arrow:e,panelOrigin:t,panelRect:s})=>{const{commands:r,anchorResolver:a}=c.useGraphContext(),{engine:o}=c.useHoverContext(),i=c.useEditorStore(),d=c.useLatestRef({arrow:e,panelOrigin:t,panelRect:s,...c.useCompiledSelector((0,ie.useShallow)(p=>({layers:p.layers,coordSystem:p.coordSystem})))}),l=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>l.current?.finish(!1),[]),(0,v.useCallback)(p=>({onClick:u=>u.stopPropagation(),onPointerDown:u=>{if(u.button!==0||l.current!==null)return;try{u.currentTarget.setPointerCapture(u.pointerId)}catch{return}u.currentTarget.focus({preventScroll:!0}),u.preventDefault();const h=new fr({handle:u.currentTarget,pointerId:u.pointerId,endpoint:p,readInputs:()=>d.current,editorStore:i,engine:o,anchorResolver:a,dispatch:r.dispatch,onSettled:()=>{l.current=null}});l.current=h,h.start()}}),[d,i,o,a,r])},br=[" ","Enter"],Sr=({arrow:e})=>{const{commands:t,anchorResolver:s}=c.useGraphContext(),r=c.useEditorStore(),{layers:a,coordSystem:o,mainAxis:i}=c.useCompiledSelector((0,ie.useShallow)(l=>({layers:l.layers,coordSystem:l.coordSystem,mainAxis:l.coordSystem.type==="cartesian"?l.coordSystem.mainAxis:"x"}))),d=e.id;return(0,v.useEffect)(()=>()=>{const l=r.getState();c.readStanding(l,"endpoint-drag")?.annotationId===d&&l.releaseInteraction("endpoint-drag")},[r,d]),(0,v.useCallback)(l=>({onKeyDown:p=>{if(p.altKey||p.ctrlKey||p.metaKey||p.shiftKey)return;const u=r.getState(),h=c.readDraggedEndpointFor(c.readStanding(u,"endpoint-drag"),e.id,l);if(br.includes(p.key)){if(p.preventDefault(),p.repeat)return;if(h===null)return u.claimInteraction({kind:"endpoint-drag",annotationId:e.id,endpoint:l,point:e[l]});u.releaseInteraction("endpoint-drag"),rn({dispatch:t.dispatch,arrow:e,endpoint:l,anchor:h.point.anchor});return}if(h===null)return;const f=jr(p.key,i);if(f===null)return;p.preventDefault();const g=yr({arrow:e,endpoint:l,from:h.point.anchor,move:f,layers:a,coordSystem:o,resolver:s});g!==null&&u.claimInteraction({kind:"endpoint-drag",annotationId:e.id,endpoint:l,point:g})}}),[e,r,t,s,a,o,i])},jr=(e,t)=>{const s=e==="ArrowUp"||e==="ArrowDown";return!s&&!(e==="ArrowLeft"||e==="ArrowRight")?null:{axis:t==="x"===s?"cross":"main",step:e==="ArrowDown"||e==="ArrowRight"?1:-1}},yr=({arrow:e,endpoint:t,from:s,move:r,layers:a,coordSystem:o,resolver:i})=>{const d=a.find(p=>p.id===s.layerId);if(d===void 0)return null;const l=(0,m.stepDifferenceArrowEndpoint)({layer:d,from:s,partner:e[tn(t)].anchor,axis:r.axis,step:r.step,canLandOn:p=>(0,m.resolveObservationPoint)({resolver:i,layer:d,observation:p,coordSystem:o,align:e[t].anchor.align})!==null});return l===null?null:(0,m.resolveObservationPoint)({resolver:i,layer:d,observation:l.observation,coordSystem:o,align:e[t].anchor.align})},Ir=e=>{const t=qt();return t===null?null:(0,n.jsx)(Pr,{annotationId:t,...e})},Pr=({annotationId:e,...t})=>{const s=c.useDifferenceArrowGeometries(),r=(0,v.useMemo)(()=>s.find(a=>a.id===e),[s,e]);return r===void 0?null:(0,n.jsx)(wr,{committedArrow:r.committedArrow,committedLabelBox:r.committedLabelBox,labelBox:r.labelBox,start:r.start,end:r.end,isDragged:r.isDragged,...t})},wr=({committedArrow:e,committedLabelBox:t,labelBox:s,start:r,end:a,panelRect:o,panelOrigin:i,frameRect:d,frameElement:l,isDragged:p})=>{const u=Cr({arrow:e,panelOrigin:i,panelRect:o}),h=Sr({arrow:e});return(0,n.jsxs)("div",{"data-testid":"difference-arrow-selection",children:[!p&&(0,n.jsx)(dr,{arrow:e,labelBox:t,panelRect:o,frameWidth:d.width,frameHeight:d.height,frameElement:l}),(0,n.jsx)("div",{"aria-hidden":"true",className:gr,"data-testid":"difference-arrow-selection-label",style:{left:o.x+s.x-2,top:o.y+s.y-2,width:s.width+4,height:s.height+4}}),(0,n.jsx)(Se,{endpoint:"start",point:r,panelRect:o,dragHandlers:u("start"),keyboardHandlers:h("start")}),(0,n.jsx)(Se,{endpoint:"end",point:a,panelRect:o,dragHandlers:u("end"),keyboardHandlers:h("end")})]})},Se=({endpoint:e,point:t,panelRect:s,dragHandlers:r,keyboardHandlers:a})=>(0,n.jsx)("div",{className:mr,"data-testid":"difference-arrow-selection-handle","data-endpoint":e,role:"button",style:{left:s.x+t.x,top:s.y+t.y},tabIndex:0,...r,...a,children:(0,n.jsx)("span",{"aria-hidden":"true",className:pr})}),Tr=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M12 5v14"}),(0,n.jsx)("path",{d:"M5 12h14"})]})}),Ar="var(--_1tyillx0)",_r={rest:.5,hovered:.75,open:1};var Lr="_1tyillx1",Er={rest:"_1tyillx2",hovered:"_1tyillx3",open:"_1tyillx4"},Nr="_1tyillx5",Mr={closed:"_1tyillx6",open:"_1tyillx7"},Or=({interaction:e,panelRect:t})=>{const s=c.useEditorStore(),r=c.useCompiledSelector(d=>d.coordSystem),a=e.kind==="trigger"||e.kind==="menu"?e.anchor:null,o=Rr(e),i=(0,v.useMemo)(()=>{if(a===null)return null;const d=(0,m.projectAnchorToPanel)(a.position,t,r);return{center:d,radius:19*_r[o],target:{kind:"observation",cursor:(0,m.toPanelCursor)(d,t)}}},[a,t,r,o]);return(0,v.useEffect)(()=>{s.getState().setMenuTrigger(i)},[s,i]),(0,v.useEffect)(()=>()=>s.getState().setMenuTrigger(null),[s]),a===null||i===null?null:(0,n.jsx)("div",{"aria-hidden":"true","data-testid":"observation-menu-trigger","data-state":o,className:(0,V.default)(Lr,Er[o]),style:{left:t.x+i.center.x,top:t.y+i.center.y,...(0,De.assignInlineVars)({[Ar]:a.color??Zn.vars.border50})},children:(0,n.jsx)("span",{className:(0,V.default)(Nr,Mr[o==="open"?"open":"closed"]),children:(0,n.jsx)(Tr,{size:"lg"})})})},Rr=e=>e.kind==="menu"?"open":e.kind==="trigger"&&e.isEngaged?"hovered":"rest",kr='button:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Dr=(e,t)=>{const{chartId:s}=c.useGraphContext(),r=c.useEditorStore();(0,v.useEffect)(()=>{if(t===null)return;const a=o=>{if(o.key!=="Tab"||o.defaultPrevented||!Y(o.target,e,s)||r.getState().standingInteraction?.kind==="chrome-popup")return;const i=[...t.querySelectorAll(kr)];if(i.length===0)return;o.preventDefault();const d=i.findIndex(l=>l===document.activeElement);i[d===-1?o.shiftKey?i.length-1:0:(d+(o.shiftKey?-1:1)+i.length)%i.length]?.focus()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t,s,r])},Fr=e=>{const{selectionStore:t,chartId:s}=c.useGraphContext();(0,v.useEffect)(()=>{let r=null;const a=()=>{e.focus({preventScroll:!0})},o=d=>{const{selection:l,clearSelection:p}=t.getState();l.length!==0&&(Y(d.target,e,s)||p())},i=d=>{t.getState().selection.length!==0&&Y(d.target,e,s)&&d.relatedTarget===null&&(r!==null&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=null,document.hasFocus()&&(Y(document.activeElement,e,s)||t.getState().clearSelection())}))};return e.addEventListener("pointerdown",a),document.addEventListener("focusin",o),document.addEventListener("focusout",i),()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("pointerdown",a),document.removeEventListener("focusin",o),document.removeEventListener("focusout",i)}},[e,t,s])},Hr=e=>{const{selectionStore:t,commands:s,chartId:r}=c.useGraphContext(),a=c.useEditorStore(),o=(0,v.useCallback)(d=>{const{selection:l}=t.getState(),p=Je(l);p!==null&&(d.preventDefault(),s.dispatch(new m.RemoveAnnotationCommand({id:p})),e.focus({preventScroll:!0}))},[e,s,t]),i=(0,v.useCallback)(d=>{const l=a.getState();switch(l.standingInteraction?.kind){case"endpoint-drag":l.releaseInteraction("endpoint-drag");return;case"chrome-popup":return;case"menu":l.releaseInteraction("menu");return;default:if(Ge(d.target,r)){e.focus({preventScroll:!0});return}t.getState().clearSelection();return}},[a,t,e,r]);(0,v.useEffect)(()=>{const d=l=>{if(Y(l.target,e,r)&&!zr(l.target)&&!Qn(l.target))switch(l.key){case"Escape":return i(l);case"Delete":case"Backspace":return o(l);default:return}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,o,i,r])},zr=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement),Gr=`[${c.EDIT_TARGET_KIND_ATTRIBUTE}]`,an=(e,t,s)=>{if(typeof document.elementsFromPoint!="function")return null;const r=document.elementsFromPoint(e,t);return Vr(r,s)},Vr=(e,t)=>{for(const s of e){const r=s.closest(Gr);if(r===null||!t.contains(r))continue;const a=Kr(r);if(a!==null)return a}return null},Kr=e=>{const t=e.getAttribute(c.EDIT_TARGET_KIND_ATTRIBUTE);if(t!=="annotation")return null;const s=e.getAttribute(c.EDIT_TARGET_ID_ATTRIBUTE);return s===null||s===""?null:{kind:t,id:s}},Br=()=>{const e=c.useHoverState(a=>a.hover.primary),{layers:t,coordSystem:s}=c.useCompiledSelector((0,ie.useShallow)(a=>({layers:a.layers,coordSystem:a.coordSystem}))),{anchorResolver:r}=c.useGraphContext();return(0,v.useMemo)(()=>{if(e===null)return null;const a=t.find(d=>d.id===e.layerId);if(a===void 0)return null;const o=r.resolve(a.geom,e.observation,{coordSystem:s,position:a.position,purpose:"pin"});if(o===null)return null;const i=(0,m.buildObservationAnchor)(a,e.observation);return i===null?null:{position:o,color:(0,m.getColor)(e.observation),layer:a,at:i,observation:e.observation}},[e,t,s,r])},qr={kind:"idle"},on=()=>{const e=c.useEditorState(r=>r.standingInteraction),t=c.useEditorState(r=>r.chromeUnderPointer),s=Br();return(0,v.useMemo)(()=>e!==null?e:s===null?qr:{kind:"trigger",anchor:s,isEngaged:t==="menu-trigger"},[e,s,t])},Ur=(e,t)=>{const s=c.useEditorStore(),r=c.useLatestRef(t);(0,v.useEffect)(()=>{let a=null,o=null;const i=h=>{const{menuTrigger:f}=s.getState();return f===null?null:(0,m.isPointWithinEditMenuTrigger)(h,f)?"menu-trigger":null},d=()=>{a=null;const h=o;if(o=null,h===null)return;const f=r.current,g=s.getState();g.setChromeUnderPointer(i({x:h.x-f.x,y:h.y-f.y})),g.standingInteraction?.kind!=="menu"&&g.setEditTargetUnderPointer(an(h.x,h.y,e))},l=()=>{const h=s.getState();h.setChromeUnderPointer(null),h.setEditTargetUnderPointer(null)},p=h=>{o={x:h.clientX,y:h.clientY},a===null&&(a=requestAnimationFrame(d))},u=()=>{o=null,a!==null&&(cancelAnimationFrame(a),a=null),l()};return e.addEventListener("pointermove",p),e.addEventListener("pointerleave",u),()=>{a!==null&&cancelAnimationFrame(a),e.removeEventListener("pointermove",p),e.removeEventListener("pointerleave",u),l()}},[e,s,r])},je="editor",ye=[],Wr=(e,t,s,r)=>{const a=on(),{store:o}=c.useHoverContext(),i=c.useGraphSelection().length>0,d=c.useEditorState(u=>u.menuTrigger),l=a.kind==="menu",p=(0,v.useMemo)(()=>d===null?ye:[(0,m.buildEditMenuTriggerRegion)(d)],[d]);Ur(e,t),Zr(a,e,t,s),Fr(e),Hr(e),Dr(e,r),(0,v.useEffect)(()=>(o.getState().publishPointerRegions(je,p),()=>o.getState().publishPointerRegions(je,ye)),[o,p]),(0,v.useEffect)(()=>(o.getState().setPointerSuspended(l||i),()=>o.getState().setPointerSuspended(!1)),[o,l,i]),(0,v.useEffect)(()=>{if(!i)return;const u=o.getState();u.setHoverState(m.RESTING_HOVER_STATE),u.setTooltipAnchor(null)},[o,i])},Zr=(e,t,s,r)=>{const a=c.useEditorStore(),{selectionStore:o}=c.useGraphContext(),{store:i,engine:d}=c.useHoverContext(),l=c.useLatestRef(e),p=c.useLatestRef(s),u=c.useLatestRef(r);(0,v.useEffect)(()=>{const h=j=>{const{menuTrigger:C}=a.getState();return C===null?!1:(0,m.isPointWithinEditMenuTrigger)(Ie(j,p.current),C)},f=j=>{if(h(j)||o.getState().selection.length>0)return;const C=u.current,P=Ie(j,p.current),T=$r(P,C)?d.query((0,m.toPanelCursor)(P,C)):m.RESTING_HOVER_STATE;i.getState().setHoverState(T)};let g=!1;const x=()=>{g=l.current.kind==="menu"},y=j=>{const C=an(j.clientX,j.clientY,t),P=o.getState();if(C===null){P.clearSelection();return}P.setSelection([C])},w=j=>{if(et(j.target))return;const{claimInteraction:C,releaseInteraction:P}=a.getState(),T=h(j);if(!T||g){P("menu"),T||y(j),g&&f(j);return}const R=l.current;R.kind==="trigger"&&C({kind:"menu",anchor:R.anchor})};return document.addEventListener("pointerdown",x,!0),document.addEventListener("click",w),()=>{document.removeEventListener("pointerdown",x,!0),document.removeEventListener("click",w)}},[a,o,t,l,i,d,p,u])},Ie=(e,t)=>({x:e.clientX-t.x,y:e.clientY-t.y}),$r=(e,t)=>e.x>=0&&e.x<=t.width&&e.y>=0&&e.y<=t.height,Xr=({frameElement:e,panelRect:t})=>{const{measureRef:s,screenRect:r}=c.useElementScreenRect(),a=c.useEditorStore();return(0,v.useEffect)(()=>(s(e),()=>s(null)),[s,e]),(0,v.useEffect)(()=>()=>a.getState().releaseInteraction("menu"),[a]),r===null?null:(0,n.jsx)(tt,{children:(0,n.jsx)(Yr,{frameElement:e,frameRect:r,panelRect:t})})},Yr=({frameElement:e,frameRect:t,panelRect:s})=>{const r=(0,v.useMemo)(()=>({x:t.left+s.x,y:t.top+s.y}),[t.left,t.top,s.x,s.y]),[a,o]=(0,v.useState)(null);return Wr(e,r,s,a),(0,n.jsx)(Jr,{frameElement:e,frameRect:t,panelOrigin:r,panelRect:s,boxRef:o})},Jr=({frameElement:e,frameRect:t,panelOrigin:s,panelRect:r,boxRef:a})=>{const o=le(),i=on();return(0,n.jsx)(c.OverlayPortal,{rect:t,zIndex:c.Z_INDEX.editorOverlay,container:o,"data-testid":"editor-overlay",boxRef:a,children:(0,n.jsxs)(c.PortalThemeProvider,{children:[(0,n.jsx)(Ir,{panelRect:r,panelOrigin:s,frameRect:t,frameElement:e}),(0,n.jsx)(Or,{interaction:i,panelRect:r}),(0,n.jsx)(zt,{interaction:i,panelOrigin:s})]})})},Qr=({slots:e,...t})=>(0,n.jsx)(c.EditorProvider,{children:(0,n.jsx)(c.GraphRenderer,{slots:(0,v.useMemo)(()=>({EditorSurface:Xr,...e}),[e]),...t})}),sn=(0,v.createContext)(null),ln=({labelId:e,controlId:t,children:s})=>{const r=(0,v.useMemo)(()=>{let a=null;return{labelId:e,controlId:t,claimControlId:o=>(a??=o,a===o)}},[e,t]);return(0,n.jsx)(sn.Provider,{value:r,children:s})},K=({id:e,ariaLabel:t,ariaLabelledBy:s},r=!0)=>{const a=(0,v.useContext)(sn),o=(0,v.useId)(),[i]=(0,v.useState)(()=>r?a?.claimControlId(o)??!1:!1),d=e??(i?a?.controlId:void 0),l=s??(t===void 0?a?.labelId:void 0);return{...d!==void 0&&{id:d},...t!==void 0&&{"aria-label":t},...l!==void 0&&{"aria-labelledby":l}}};var ea={default:"woi4bh4 woi4bh3",tile:"woi4bh5 woi4bh3"},cn=({label:e,icon:t,onClick:s,variant:r="default",isDisabled:a,ariaLabel:o,ariaLabelledBy:i,id:d})=>{const l=K({id:d,ariaLabel:o,ariaLabelledBy:i}),p=r==="tile";return(0,n.jsxs)("button",{type:"button",className:ea[r],disabled:a,onClick:s,...l,children:[t!==void 0&&(0,n.jsx)("span",{className:"woi4bh0",children:t}),e!==void 0&&(0,n.jsx)("span",{className:p?"woi4bh2":"woi4bh1",children:e})]})},de=(0,v.createContext)(null),E=()=>{const e=(0,v.useContext)(de);if(!e)throw new Error("An editing section must sit inside an <EditorPanel.Root> bound to a graph — pass it a `handle`, or render the panel inside a <GraphProvider>.");return e},dn=({children:e,onKeyDown:t,...s})=>{const r=(0,v.useContext)(de),a=o=>{if(t?.(o),!r||o.defaultPrevented)return;const i=c.resolveHistoryStep(o.nativeEvent);i&&(o.preventDefault(),i==="undo"?r.undo():r.redo())};return(0,n.jsx)("div",{onKeyDown:a,...s,children:e})},un="keyboard",ee=e=>{const t=(0,v.useRef)(!1),s=(0,v.useRef)(!1),r=()=>{t.current=!1,s.current&&(s.current=!1,e?.())};return{commitAfterChange:()=>{if(t.current){s.current=!0;return}e?.()},commitUnlessHeldKey:a=>{if(a){s.current=!0;return}e?.()},gestureHandlers:{onKeyDown:()=>{t.current=!0},onKeyUp:r,onBlur:a=>{a.relatedTarget instanceof Node&&a.currentTarget.contains(a.relatedTarget)||r()}}}},na="eh8dvc0",ta="eh8dvc1 uz3g760",ra="eh8dvc2 uz3g761";var hn=({value:e,onChange:t,onCommit:s,min:r,max:a,step:o,prefix:i,suffix:d,isDisabled:l,hasError:p,ariaLabel:u,ariaLabelledBy:h,id:f})=>{const g=K({id:f,ariaLabel:u,ariaLabelledBy:h}),{commitUnlessHeldKey:x,gestureHandlers:y}=ee(s);return(0,n.jsx)(xe.NumberField.Root,{className:na,value:e,onValueChange:w=>t(w),onValueCommitted:(w,j)=>{x(j.reason===un)},min:r,max:a,step:o,disabled:l,children:(0,n.jsxs)(dn,{className:ta,"data-error":p===!0,"data-disabled":l===!0?"":void 0,children:[i!==void 0&&(0,n.jsx)("span",{className:"eh8dvc3",children:i}),(0,n.jsx)(xe.NumberField.Input,{className:ra,...y,"aria-invalid":p===!0?!0:void 0,...g}),d!==void 0&&(0,n.jsx)("span",{className:"eh8dvc3",children:d})]})})},aa="_1b7s5f0",W={1:"_1b7s5f1",2:"_1b7s5f2",3:"_1b7s5f3",4:"_1b7s5f4",5:"_1b7s5f5",6:"_1b7s5f6"},oa="_1b7s5f7";var sa=6,mn=({options:e,value:t,onChange:s,onCommit:r,columns:a,itemLayout:o="tile",isDisabled:i,ariaLabel:d,ariaLabelledBy:l,id:p})=>{const u=K({id:p,ariaLabel:d,ariaLabelledBy:l}),h=o==="swatch",{commitAfterChange:f,gestureHandlers:g}=ee(r);return(0,n.jsx)(He.RadioGroup,{className:(0,V.default)(aa,ia(a??e.length)),value:t,onValueChange:x=>{s(x),f()},...g,disabled:i,...u,children:e.map(x=>(0,n.jsxs)(Fe.Radio.Root,{value:x.value,disabled:x.isDisabled,className:(0,V.default)(oa,h&&"_1b7s5f8"),"aria-label":h?x.label:void 0,children:[x.icon,!h&&(0,n.jsx)("span",{className:"_1b7s5f9",children:x.label})]},x.value))})},ia=e=>{switch(Math.min(Math.max(Math.round(e),1),sa)){case 1:return W[1];case 2:return W[2];case 3:return W[3];case 4:return W[4];case 5:return W[5];default:return W[6]}},la="_1g5x15w0 uz3g760",ca="_1g5x15w1",da="_1g5x15w2",Pe="_1g5x15w3",ua="_1g5x15w4",ha="_1g5x15w5",ma="_1g5x15w6",pa="_1g5x15w7";var pn=({options:e,value:t,onChange:s,placeholder:r,isDisabled:a,hasError:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d});return(0,n.jsxs)(H.Select.Root,{value:t,onValueChange:u=>u!==null&&s(u),disabled:a,items:e.map(u=>({value:u.value,label:u.label})),children:[(0,n.jsxs)(H.Select.Trigger,{className:la,"data-error":o===!0,...p,children:[(0,n.jsx)(H.Select.Value,{className:ca,children:u=>ga(e,u,r)}),(0,n.jsx)(H.Select.Icon,{className:Pe,children:(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})})]}),(0,n.jsx)(H.Select.Portal,{container:c.resolvePortalContainer(),children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(H.Select.Positioner,{className:ua,sideOffset:4,alignItemWithTrigger:!1,children:(0,n.jsx)(H.Select.Popup,{className:ha,children:e.map(u=>(0,n.jsxs)(H.Select.Item,{value:u.value,disabled:u.isDisabled,className:ma,children:[u.icon,(0,n.jsxs)("span",{className:pa,children:[(0,n.jsx)(H.Select.ItemText,{children:u.label}),u.description!==void 0&&(0,n.jsx)("span",{className:"_1g5x15w8",children:u.description})]}),(0,n.jsx)(H.Select.ItemIndicator,{className:Pe,children:(0,n.jsx)(c.CheckIcon,{size:"sm"})})]},u.value))})})})})]})},ga=(e,t,s)=>t===null?(0,n.jsx)("span",{className:da,children:s}):va(e,t),va=(e,t)=>e.find(s=>s.value===t)?.label??t,xa="vod76w0",fa="vod76w1",Ca="vod76w2",ba="vod76w3",Sa="vod76w4",ja="vod76w5";var gn=({value:e,onChange:t,onCommit:s,min:r,max:a,step:o,suffix:i,formatValue:d,isDisabled:l,ariaLabel:p,ariaLabelledBy:u})=>{const h=K({ariaLabel:p,ariaLabelledBy:u},!1),f=ya(e,i,d),{commitUnlessHeldKey:g,gestureHandlers:x}=ee(s);return(0,n.jsxs)("div",{className:xa,children:[(0,n.jsx)(Z.Slider.Root,{className:fa,value:e,onValueChange:y=>t(y),onValueCommitted:(y,w)=>{g(w.reason===un)},min:r,max:a,step:o,disabled:l,children:(0,n.jsx)(Z.Slider.Control,{className:Ca,children:(0,n.jsxs)(Z.Slider.Track,{className:ba,children:[(0,n.jsx)(Z.Slider.Indicator,{className:Sa}),(0,n.jsx)(Z.Slider.Thumb,{className:ja,...x,...h})]})})}),f!==null&&(0,n.jsx)("span",{className:"vod76w6",children:f})]})},ya=(e,t,s)=>s!==void 0?s(e):t!==void 0?`${e}${t}`:null,Ia="_1hyrlw60",Pa="_1hyrlw61",vn=({isChecked:e,onChange:t,isDisabled:s,ariaLabel:r,ariaLabelledBy:a,id:o})=>{const i=K({id:o,ariaLabel:r,ariaLabelledBy:a});return(0,n.jsx)(fe.Switch.Root,{checked:e,onCheckedChange:d=>t(d),disabled:s,className:Ia,...i,children:(0,n.jsx)(fe.Switch.Thumb,{className:Pa})})},wa="uz3g761",Ta="tpcnun0 uz3g760",xn=({value:e,onChange:t,onCommit:s,placeholder:r,isDisabled:a,hasError:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d});return(0,n.jsx)(dn,{className:Ta,"data-error":o===!0,children:(0,n.jsx)(Xn.Input,{className:wa,value:e,onValueChange:u=>t(u),onBlur:s,placeholder:r,disabled:a,"aria-invalid":o===!0?!0:void 0,...p})})},Aa="cnu9yl0",_a="cnu9yl1";var fn=({options:e,value:t,onChange:s,onCommit:r,itemLayout:a="inline",isDisabled:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d}),u=a==="stacked",{commitAfterChange:h,gestureHandlers:f}=ee(r);return(0,n.jsx)(He.RadioGroup,{className:Aa,value:t,onValueChange:g=>{s(g),h()},...f,disabled:o,...p,children:e.map(g=>(0,n.jsxs)(Fe.Radio.Root,{value:g.value,disabled:g.isDisabled,className:(0,V.default)(_a,u&&"cnu9yl2"),"aria-label":La(g,u),children:[g.icon,Cn(g,u)&&(0,n.jsx)("span",{className:"cnu9yl3",children:g.label})]},g.value))})},Cn=(e,t)=>e.icon===void 0||t,La=(e,t)=>{if(!Cn(e,t))return e.label},bn={ToggleGroup:fn,Switch:vn,Slider:gn,RadioGrid:mn,Button:cn,TextField:xn,NumberField:hn,Select:pn},Sn=(0,v.createContext)(bn),Ea=({controls:e,children:t})=>{const s=(0,v.useMemo)(()=>({...bn,...e}),[e]);return(0,n.jsx)(Sn.Provider,{value:s,children:t})},N=()=>(0,v.useContext)(Sn),Na="_12lhx9e0",Ma=({children:e})=>(0,n.jsx)("div",{className:Na,children:e}),Oa="_139ohwv0",D=({children:e})=>(0,n.jsx)("div",{className:Oa,children:e}),jn=(0,v.createContext)(null),Ra=jn.Provider,yn=()=>{const e=(0,v.useContext)(jn);if(!e)throw new Error("A section must be rendered inside <EditorPanel.Root>.");return e},ka="_1jlczkt0",In="data-graphy-editor-panel",Da={List:D,Grid:Ma};function Fa(e){if(e===void 0)return!1;const t=e.split(/\s+/);return t.includes("_1ii3bsb0")||t.includes("_1ii3bsb1")}var Ha=({handle:e,children:t,controls:s,defaultExpandedSection:r=void 0,className:a})=>{const o=c.useGraphHandle(e),{themeClass:i,inlineVarsStyle:d}=c.useThemeContext(),[l,p]=(0,v.useState)(()=>r?[r]:[]),u=(0,v.useMemo)(()=>({expandSection:h=>p([h]),collapseAllSections:()=>p([])}),[]);return(0,n.jsx)(de.Provider,{value:o,children:(0,n.jsx)(Ea,{controls:s,children:(0,n.jsx)(Ra,{value:u,children:(0,n.jsx)(X.Accordion.Root,{[In]:"",className:(0,V.default)(ka,a,{[i]:!Fa(a)}),style:d,value:l,onValueChange:h=>p(h),children:t})})})})},ue={Root:Ha,Controls:Da},we={stack:"pr583x0",grid:"pr583x1"},Te="pr583x2",za="pr583x3",b=({label:e,layout:t="grid",children:s})=>{const r=(0,v.useId)(),a=(0,v.useId)();return e===void 0?(0,n.jsx)("div",{className:we[t],children:(0,n.jsx)("div",{className:Te,children:s})}):(0,n.jsxs)("div",{className:we[t],children:[(0,n.jsx)("label",{id:r,htmlFor:a,className:za,children:e}),(0,n.jsx)("div",{className:Te,children:(0,n.jsx)(ln,{labelId:r,controlId:a,children:s})})]})},Ga=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsx)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6"})})}),he="_40zvwv0",me="_40zvwv1",Va="_40zvwv2",Pn="_40zvwv3",Ka="_40zvwv4 _40zvwv3";var Ba="_40zvwv6";var qa="_40zvwv8",O=({title:e,layout:t="fixed",preview:s,accessory:r,onOpenChange:a,children:o})=>t==="collapsible"?(0,n.jsx)(Wa,{title:e,preview:s,accessory:r,onOpenChange:a,children:o}):t==="inline"&&s===void 0?(0,n.jsx)(Ua,{title:e,accessory:r,children:o}):(0,n.jsxs)("div",{className:he,children:[(0,n.jsxs)("div",{className:me,children:[(0,n.jsx)("span",{className:Pn,children:e}),s!==void 0&&(0,n.jsx)("span",{className:"_40zvwv5",children:s}),r!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:r})]}),(0,n.jsx)("div",{children:o})]}),Ua=({title:e,accessory:t,children:s})=>{const r=(0,v.useId)(),a=(0,v.useId)();return(0,n.jsx)("div",{className:he,children:(0,n.jsxs)("div",{className:me,children:[(0,n.jsx)("label",{id:r,htmlFor:a,className:Ka,children:e}),(0,n.jsx)("span",{className:Ba,children:(0,n.jsx)(ln,{labelId:r,controlId:a,children:s})}),t!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:t})]})})},Wa=({title:e,preview:t,accessory:s,onOpenChange:r,children:a})=>{const o=c.useI18n();return(0,n.jsxs)(X.Accordion.Item,{value:e,className:he,onOpenChange:r,children:[(0,n.jsxs)(X.Accordion.Header,{className:me,render:(0,n.jsx)("div",{}),children:[(0,n.jsx)(X.Accordion.Trigger,{className:Va,"aria-label":o("editor.accessibility.toggleSection",{title:e})}),(0,n.jsx)("span",{className:Pn,children:e}),t!==void 0&&(0,n.jsx)("span",{className:"_40zvwv5",children:t}),s!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:s}),(0,n.jsx)("span",{className:qa,children:(0,n.jsx)(Ga,{size:"sm"})})]}),(0,n.jsx)(X.Accordion.Panel,{children:(0,n.jsx)("div",{children:a})})]})},Za=({title:e,isChecked:t,onToggle:s,isDisabled:r,preview:a,children:o})=>{const{expandSection:i,collapseAllSections:d}=yn(),{Switch:l}=N(),p=h=>{s(h),h?i(e):d()},u=h=>{h&&!t&&r!==!0&&s(!0)};return(0,n.jsx)(O,{title:e,layout:"collapsible",preview:a,onOpenChange:u,accessory:(0,n.jsx)(l,{isChecked:t,onChange:p,isDisabled:r,ariaLabel:e}),children:o})},$a={horizontal:["bottom","top"],vertical:["left","right"]},Xa={left:"editor.axesPanel.position.left",right:"editor.axesPanel.position.right",top:"editor.axesPanel.position.top",bottom:"editor.axesPanel.position.bottom"},Ya={x:"editor.axesPanel.mainAxisSection.xAxis",y:"editor.axesPanel.mainAxisSection.yAxis"},ae=({axis:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{NumberField:d,Switch:l,TextField:p,ToggleGroup:u}=N();if(!o)return null;const h=o.coordSystem.type==="polar"?o.coordSystem.axisMapping[e].geometry:"linear",f=o.config.axes[e],g=o.scales[e],x=g?.spec,y=x?.scaleType==="continuous"?x:void 0;if(h==="circular"||h==="radial"&&y===void 0)return null;const w=x!==void 0&&"reverse"in x?x:void 0,j=x?.scaleType==="continuous"||x?.scaleType==="datetime",C=e==="y"&&y!==void 0&&o.layers.some(S=>S.yScaleType==="primary"&&S.geom==="bar"),P=y?.transform==="log",T=y?.domainMax??null,R=Ja(y),F=(S,z)=>S.map(J=>({value:J,label:z(J)})),L=o.guides.axes.find(S=>S.scaleAestheticKey===e)?.position,k=$a[L==="bottom"||L==="top"||L===void 0&&e==="x"?"horizontal":"vertical"],A=o.guides.legends.drawn.some(S=>k.some(z=>z===S.position)),I=k.map(S=>({value:S,label:i(Xa[S])})),_=F(["auto","edges"],S=>i(S==="edges"?"editor.axesPanel.labelMode.edges":"editor.axesPanel.labelMode.auto")),B=F(["linear","log"],S=>i(S==="log"?"editor.axesPanel.scale.log":"editor.axesPanel.scale.auto")),On=F(["auto","zero","custom"],S=>i(S==="zero"?"editor.axesPanel.startFrom.zero":S==="custom"?"editor.axesPanel.startFrom.custom":"editor.axesPanel.startFrom.auto")),Rn=F(["auto","custom"],S=>i(S==="custom"?"editor.axesPanel.endAt.custom":"editor.axesPanel.endAt.auto")),kn=F(["no","yes"],S=>i(S==="yes"?"editor.axesPanel.yesNo.yes":"editor.axesPanel.yesNo.no")),Dn=S=>{a.commands.dispatch(new m.SetAxisVisibilityCommand({axis:e,isVisible:S}))},Fn=S=>{a.commands.dispatch(new m.SetAxisLabelCommand({axis:e,label:S===""?null:S}),{transient:!0})},Hn=S=>{a.commands.dispatch(new m.SetAxisTicksVisibilityCommand({axis:e,isVisible:S}))},zn=S=>{a.commands.dispatch(new m.SetAxisTickModeCommand({axis:e,tickMode:S==="edges"?"edges":"auto"}))},Gn=S=>{a.commands.dispatch(new m.SetScaleReverseCommand({scaledAesthetic:e,reverse:S==="yes"}))},Vn=S=>{a.commands.dispatch(new m.SetScaleTransformCommand({scaledAesthetic:e,transform:S==="log"?"log":"linear"}))},ve=S=>{a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,...S}),{transient:!0})},Kn=S=>{S!==null&&ve({domainMin:S})},Bn=S=>{S!==null&&ve({domainMax:S})},qn=S=>{if(y){if(S==="custom"){y.zero&&a.commands.dispatch(new m.SetScaleZeroCommand({scaledAesthetic:e,zero:!1})),a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMin:Ae(g?.domain,"start")}));return}y.domainMin!==null&&a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMin:null})),a.commands.dispatch(new m.SetScaleZeroCommand({scaledAesthetic:e,zero:S==="zero"}))}},Un=S=>{const z=S==="custom"?Ae(g?.domain,"end"):null;a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMax:z}))},Wn=S=>{const z=k.find(J=>J===S);z&&a.commands.dispatch(new m.SetAxisPositionCommand({axis:e,position:z}))};return(0,n.jsx)(O,{title:t??i(Ya[e]),layout:s,preview:r,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.visible"),children:(0,n.jsx)(l,{isChecked:f.isVisible,onChange:Dn})}),h==="linear"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.title"),children:(0,n.jsx)(p,{value:f.label??"",onChange:Fn,onCommit:a.commands.seal})}),(0,n.jsx)(b,{label:i("editor.axesPanel.controls.ticks"),children:(0,n.jsx)(l,{isChecked:f.ticks.isVisible,onChange:Hn})})]}),j&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.labels"),children:(0,n.jsx)(u,{value:f.ticks.mode,options:_,onChange:zn})}),y&&h==="linear"&&!A&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.position"),children:(0,n.jsx)(u,{value:L??f.position,options:I,onChange:Wn})}),w!==void 0&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.reverse"),children:(0,n.jsx)(u,{value:w.reverse===!0?"yes":"no",options:kn,onChange:Gn})}),y&&!C&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.scale"),children:(0,n.jsx)(u,{value:P?"log":"linear",options:B,onChange:Vn})}),y&&!P&&(0,n.jsxs)(n.Fragment,{children:[!C&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.startFrom"),children:(0,n.jsx)(u,{value:R,options:On,onChange:qn})}),R==="custom"&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.value"),children:(0,n.jsx)(d,{value:y.domainMin??null,onChange:Kn,onCommit:a.commands.seal})})]}),(0,n.jsx)(b,{label:i("editor.axesPanel.controls.endAt"),children:(0,n.jsx)(u,{value:T===null?"auto":"custom",options:Rn,onChange:Un})}),T!==null&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.value"),children:(0,n.jsx)(d,{value:T,onChange:Bn,onCommit:a.commands.seal})})]})]})})},Ja=e=>e===void 0?"auto":e.domainMin!==null&&e.domainMin!==void 0?"custom":e.zero===!0?"zero":"auto",Ae=(e,t)=>{const s=t==="start"?e?.[0]:e?.[e.length-1];return typeof s=="number"?s:0},pe=({value:e,onChange:t})=>{const s=E(),r=c.useI18n(),{TextField:a}=N(),o=e!==null&&typeof e!="string",i=d=>t(d===""?null:d);return(0,n.jsx)(b,{label:r("editor.elementsPanel.contentValue"),children:(0,n.jsx)(a,{value:typeof e=="string"?e:"",onChange:i,onCommit:s.commands.seal,isDisabled:o})})},wn=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"caption",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentCaptionCommand({caption:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.footerSection.caption"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isCaptionVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.caption,onChange:p})]})})},_e=/^[a-z][a-z\d+.-]*:/i,Qa={},Tn=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=p=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"source",isVisible:p}))};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.sourceSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isSourceVisible,onChange:l})}),(0,n.jsx)(eo,{source:d.source??Qa})]})})},eo=({source:e})=>{const t=E(),s=c.useI18n(),{TextField:r}=N(),a=l=>{const p=(l.label??"")!==""||(l.url??"")!=="";t.commands.dispatch(new m.SetContentSourceCommand({source:p?l:null}),{transient:!0})},o=()=>{const l=e.url??"";l!==""&&!_e.test(l)&&a({...e,url:`https://${l}`}),t.commands.seal()},i=l=>a({...e,url:l}),d=l=>a({...e,label:l});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:s("editor.elementsPanel.sourceSection.url"),children:(0,n.jsx)(r,{value:e.url??"",onChange:i,onCommit:o,hasError:_e.test(e.url??"")&&!(0,m.isSafeUrl)(e.url)})}),(0,n.jsx)(b,{label:s("editor.elementsPanel.sourceSection.name"),children:(0,n.jsx)(r,{value:e.label??"",onChange:d,onCommit:t.commands.seal})})]})},An=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"subtitle",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentSubtitleCommand({subtitle:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.headerSection.subtitle"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isSubtitleVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.subtitle,onChange:p})]})})},oe=[.8,1,1.2,1.4,1.6,1.8,2,2.5,3,4],no=oe.length/2,_n=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{RadioGrid:i}=N();if(!a)return null;const{textScale:d}=a.config.appearance,l=h=>o("editor.elementsPanel.textSizeSection.scaleFormat",{value:`${h}`}),p=oe.map(h=>({value:`${h}`,label:l(h)})),u=h=>{const f=oe.find(g=>`${g}`===h);f!==void 0&&r.commands.dispatch(new m.SetAppearanceTextScaleCommand({textScale:f}))};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.textSizeSection.title"),layout:t,preview:s??l(d),children:(0,n.jsx)(i,{value:`${d}`,options:p,columns:no,onChange:u,ariaLabel:o("editor.elementsPanel.textSizeSection.title")})})},Ln=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"title",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentTitleCommand({title:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.headerSection.toggleTitle"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isTitleVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.title,onChange:p})]})})},to=({children:e,...t})=>(0,n.jsx)(ue.Root,{...t,children:e??(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ln,{}),(0,n.jsx)(An,{}),(0,n.jsx)(wn,{}),(0,n.jsx)(Tn,{}),(0,n.jsx)(_n,{})]})}),ro=({children:e,...t})=>(0,n.jsx)(ue.Root,{...t,children:e??(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ae,{axis:"x"}),(0,n.jsx)(ae,{axis:"y"})]})}),ne=e=>`${e}px`,En=e=>`${Math.round(e*100)}%`,ao=e=>`${e}°`,oo=24,Le=["dim","desaturate"],so=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,ToggleGroup:d}=N();if(!a)return null;const{cornerRadius:l}=a.config.appearance,p=(0,m.readHighlightDimStyle)(a.spec),u=Le.map(g=>({value:g,label:o(g==="dim"?"editor.highlighting.highlightStyle.tint":"editor.highlighting.highlightStyle.grey")})),h=g=>{r.commands.dispatch(new m.SetAppearanceCornerRadiusCommand({cornerRadius:g}),{transient:!0})},f=g=>{const x=Le.find(y=>y===g);x&&r.commands.dispatch(new m.SetHighlightDimStyleCommand({dimStyle:x}))};return(0,n.jsx)(O,{title:e??o("editor.colorPanel.appearanceSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.colorPanel.borderSection.cornerRadius"),children:(0,n.jsx)(i,{value:l,min:0,max:oo,step:1,formatValue:ne,onChange:h,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.colorPanel.appearanceSection.highlightStyle"),children:(0,n.jsx)(d,{value:p,options:u,onChange:f})})]})})},ge=(e,t)=>{const{colorScheme:s}=c.useThemeContext();return(0,v.useMemo)(()=>{const r=e?.layers.find(a=>a.id===t);return r===void 0?null:(0,m.createStyleResolver)({colorScheme:s}).geomReaders(r)},[e,t,s])},io=.05,lo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,ToggleGroup:d}=N(),l=a?(0,m.findLayerByGeom)(a.spec.layers,"bar"):void 0,p=ge(a,l?.id??null);if(!a||!l||a.coordSystem.type==="polar"&&a.coordSystem.bandAxis===null)return null;const u=g=>{r.commands.dispatch(new m.SetBarWidthCommand({layerId:l.id,width:g}),{transient:!0})},h=g=>{const x=m.BORDER_RADIUS_TOKENS.find(y=>y===g);x&&r.commands.dispatch(new m.SetBarBorderRadiusCommand({layerId:l.id,borderRadius:x}))},f=m.BORDER_RADIUS_TOKENS.map(g=>({value:g,label:o(`editor.graphPanel.barSection.roundingOptions.${g}`)}));return(0,n.jsx)(O,{title:e??o("editor.graphPanel.barSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.barSection.thickness"),children:(0,n.jsx)(i,{value:l.params.width,min:m.MIN_BAR_WIDTH,max:m.MAX_BAR_WIDTH,step:io,formatValue:En,onChange:u,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.graphPanel.barSection.rounding"),layout:"stack",children:(0,n.jsx)(d,{value:p?.get("borderRadius")??m.DEFAULT_BAR_BORDER_RADIUS,options:f,onChange:h})})]})})},co=({layerId:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{Switch:d}=N();if(!o)return null;const l=e===void 0?o.spec.layers[0]:o.spec.layers.find(L=>L.id===e);if(!l)return null;const{showDataLabels:p,format:u,showStackTotals:h,showCategoryLabels:f}=l.dataLabels,g=o.coordSystem.type==="polar",x=l.geom==="bar",y=l.position==="stack"||l.position==="fill",w=x&&!g&&l.position==="stack",j=x&&(!g||p),C=x||l.geom==="area"&&y;if(!(0,m.canPlaceDataLabels)(l.geom,o.coordSystem.type))return null;const P=L=>{const k=new m.ToggleDataLabelsCommand({layerId:l.id,showDataLabels:L});a.commands.dispatch(k)},T=L=>{const k=new m.SetDataLabelsFormatCommand({layerId:l.id,format:L?"percentage":"absolute"});a.commands.dispatch(k)},R=L=>{const k=new m.ToggleStackTotalsCommand({layerId:l.id,showStackTotals:L});a.commands.dispatch(k)},F=L=>{const k=new m.ToggleCategoryLabelsCommand({layerId:l.id,showCategoryLabels:L});a.commands.dispatch(k)};return(0,n.jsx)(O,{title:t??i("editor.graphPanel.graphOptionsSection.title"),layout:s,preview:r,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.dataLabels"),children:(0,n.jsx)(d,{isChecked:p,onChange:P})}),p&&C&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.showPercentages"),children:(0,n.jsx)(d,{isChecked:u==="percentage",onChange:T})}),w&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.stackTotals"),children:(0,n.jsx)(d,{isChecked:h,onChange:R})}),j&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.categoryLabels"),children:(0,n.jsx)(d,{isChecked:f,onChange:F})})]})})},Ee=["solid","dashed","dotted"],uo=Number.parseFloat(c.chromeTokens.gridLineWidth),ho=8,mo=0,po=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,Switch:d,ToggleGroup:l}=N(),{themeValues:p}=c.useThemeContext();if(!a)return null;const u=a.guides.axes.filter(go);if(u.length===0)return null;const h=a.coordSystem.type!=="polar",f=u.some(C=>C.gridVisible),g=a.config.axes.y.grid,x=Ee.map(C=>({value:C,label:o(`editor.graphPanel.gridSection.lineStyles.${C}`)})),y=C=>P=>{r.commands.dispatch(new m.SetGridVisibilityCommand({axis:C,isVisible:P}))},w=C=>{const P=Ee.find(T=>T===C);P&&r.commands.dispatch(new m.SetGridLineStyleCommand({axis:"both",lineStyle:P}))},j=C=>{r.commands.dispatch(new m.SetGridLineWidthCommand({axis:"both",lineWidth:C}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.gridSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[u.map(C=>(0,n.jsx)(b,{label:o(vo(C)),children:(0,n.jsx)(d,{isChecked:C.gridVisible,onChange:y(C.scaleAestheticKey)})},C.scaleAestheticKey)),h&&f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.gridSection.gridStyle"),children:(0,n.jsx)(l,{value:g.lineStyle,options:x,onChange:w})}),(0,n.jsx)(b,{label:o("editor.graphPanel.gridSection.gridThickness"),children:(0,n.jsx)(i,{value:g.lineWidth??c.parsePx(p.gridLineWidth,uo),min:mo,max:ho,step:.5,formatValue:ne,onChange:j,onCommit:r.commands.seal})})]})]})})},go=e=>e.scaleAestheticKey==="x"||e.scaleAestheticKey==="y",vo=e=>e.geometry==="radial"?"editor.graphPanel.gridSection.rings":e.geometry==="circular"?"editor.graphPanel.gridSection.spokes":e.scaleAestheticKey==="x"?"editor.graphPanel.gridSection.verticalGridLines":"editor.graphPanel.gridSection.horizontalGridLines",xo="total",Nn=["total","average","current"],fo=["total"],Ne=["previous","first"],Me=["auto","small","medium","large"],Co=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i,ToggleGroup:d}=N();if(!a)return null;const l=a.config.headline,p=l.show!=="none",u=a.coordSystem,h=u.type==="polar",f=u.type==="polar"&&u.innerRadius>0,g=a.layers.some(I=>I.summary.grandTotal!==void 0);if(h&&!g)return null;const x=h?fo:Nn,y=a.guides.headline,w=y?.kind==="perGroup"&&y.items.some(I=>I.comparison!==null),j=x.map(I=>({value:I,label:o(`editor.graphPanel.headlineNumberSection.metrics.${I}`)})),C=Ne.map(I=>({value:I,label:o(`editor.graphPanel.headlineNumberSection.comparison.${I}`)})),P=Me.map(I=>({value:I,label:o(I==="auto"?"editor.graphPanel.numberFormat.options.auto":`editor.graphPanel.headlineNumberSize.sizes.${I}`)})),T=[{value:"above",label:o("editor.graphPanel.headlineNumberSection.position.above")},{value:"center",label:o("editor.graphPanel.headlineNumberSection.position.center")}],R=I=>{r.commands.dispatch(new m.SetHeadlineShowCommand({show:I?xo:"none"}))},F=I=>{const _=x.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineShowCommand({show:_}))},L=I=>{const _=Ne.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineCompareWithCommand({compareWith:_}))},k=I=>{const _=Me.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineSizeCommand({size:_}))},A=I=>{r.commands.dispatch(new m.SetHeadlinePositionCommand({position:I==="center"?"center":"above"}))};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.headlineNumberSection.title"),layout:t,preview:s??bo(o,l.show),children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.toggle"),children:(0,n.jsx)(i,{isChecked:p,onChange:R})}),p&&(0,n.jsxs)(n.Fragment,{children:[j.length>1&&(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.metricLabel"),layout:"stack",children:(0,n.jsx)(d,{value:l.show,options:j,onChange:F})}),w&&(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.compareWithLabel"),layout:"stack",children:(0,n.jsx)(d,{value:(0,m.resolveComparisonBasis)(l.compareWith),options:C,onChange:L})}),(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSize.sizeLabel"),children:(0,n.jsx)(d,{value:l.size,options:P,onChange:k})}),f&&(0,n.jsx)(b,{label:o("editor.axesPanel.controls.position"),children:(0,n.jsx)(d,{value:l.position,options:T,onChange:A})})]})]})})},bo=(e,t)=>{const s=Nn.find(r=>r===t);return s&&e(`editor.graphPanel.headlineNumberSection.metrics.${s}`)},re=["top","bottom","left","right","none"],Oe=["auto","start","center","end"],Re=["auto","pill","direct"],So=({positions:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{ToggleGroup:d}=N();if(!o)return null;const l=o.config.legend.position,p=e??re,u=o.guides.legends.drawn[0],h=(0,m.canAnchorDirectLabels)({legendPosition:o.guides.legends.position,coordSystem:o.coordSystem,layers:o.layers}),f=o.guides.headline?.kind==="perGroup",g=o.guides.colorGroups.length>0;if(l==="auto"&&u===void 0&&!h&&(f||!g))return null;const x=u?.position??"none",y=l==="auto"?x:l,w=re.filter(A=>A===y||p.includes(A)).map(A=>({value:A,label:i(`editor.graphPanel.legendSection.${A}`)})),j=A=>{const I=re.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendPositionCommand({position:I}))},C=A=>{const I=Oe.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendAlignCommand({align:I}))},P=A=>{const I=Re.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendDisplayCommand({display:I}))},T=Oe.map(A=>({value:A,label:i(`editor.graphPanel.legendSection.align.${A}`)})),R=Re.map(A=>({value:A,label:i(`editor.graphPanel.legendSection.display.${A}`)})),F=t??i("editor.graphPanel.legendSection.title"),L=w.find(A=>A.value===y)?.label,k=u!==void 0;return(0,n.jsx)(O,{title:F,layout:s,preview:r??L,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.position"),layout:"stack",children:(0,n.jsx)(d,{value:y,options:w,onChange:j})}),k&&(0,n.jsx)(b,{label:i("editor.graphPanel.legendSection.alignLabel"),layout:"stack",children:(0,n.jsx)(d,{value:o.config.legend.align,options:T,onChange:C})}),h&&(0,n.jsx)(b,{label:i("editor.graphPanel.legendSection.displayLabel"),layout:"stack",children:(0,n.jsx)(d,{value:o.config.legend.display,options:R,onChange:P})})]})})},jo=1,yo=20,Io=.5,Mn=({layerId:e})=>{const t=E(),s=c.useHandleCompiled(t),{Slider:r}=N(),a=ge(s,e);if(!s)return null;const o=i=>{const d=new m.SetPointSizeCommand({layerId:e,size:i});t.commands.dispatch(d,{transient:!0})};return(0,n.jsx)(r,{value:a?.get("size")??m.DEFAULT_POINT_SIZE,min:jo,max:yo,step:Io,formatValue:ne,onChange:o,onCommit:t.commands.seal})},Po=1,wo=10,To=.1,Ao=["gap","zero","connect"],_o=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Select:i,Slider:d,Switch:l,ToggleGroup:p}=N(),u=a?.spec.layers??[],h=(0,m.findLayerByGeom)(u,"line","area"),f=ge(a,h?.id??null);if(!a||!h)return null;const g=a.coordSystem.type==="polar",x=No(o,h),y=Eo(h,u),w=ke(a.spec,h.geom,"strokeWidth",h.id),j=typeof w=="number",C=h.geom==="line"?h:void 0,P=[{value:"auto",label:o("editor.graphPanel.numberFormat.options.auto")},{value:"custom",label:o("editor.graphPanel.numberFormat.options.custom")}],T=I=>{r.commands.dispatch(new m.ToggleLinePointsVisibilityCommand({layerId:h.id,showPoints:I}))},R=I=>{C&&r.commands.dispatch(new m.ToggleLineFillCommand({layerId:C.id,showFill:I}))},F=I=>{r.commands.dispatch(new m.SetLineInterpolationCommand({layerId:h.id,interpolate:I?"catmull-rom":"linear"}))},L=I=>{const _=f?.get("strokeWidth")??m.DEFAULT_STROKE_WIDTH;r.commands.dispatch(new m.SetLineWidthCommand({layerId:h.id,lineWidth:I==="custom"?_:null}))},k=I=>{r.commands.dispatch(new m.SetLineWidthCommand({layerId:h.id,lineWidth:I}),{transient:!0})},A=I=>{const _=Lo(I);_&&r.commands.dispatch(new m.SetLineMissingValuesCommand({layerId:h.id,missingValues:_}))};return(0,n.jsx)(O,{title:e??o("editor.fineTunePanel.lineStyleSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.showPoints"),children:(0,n.jsx)(l,{isChecked:y!==void 0,onChange:T})}),y&&(0,n.jsx)(b,{label:o("editor.graphPanel.pointSize.label"),children:(0,n.jsx)(Mn,{layerId:y.id})}),C&&!g&&(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.lineFill"),children:(0,n.jsx)(l,{isChecked:ke(a.spec,"line","fillAlpha",C.id)!==void 0,onChange:R})}),!g&&(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.smoothLines"),children:(0,n.jsx)(l,{isChecked:h.params.interpolate==="catmull-rom",onChange:F})}),(0,n.jsx)(b,{label:o("editor.graphPanel.lineThickness.label"),children:(0,n.jsx)(p,{value:j?"custom":"auto",options:P,onChange:L})}),j&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(d,{value:w,min:Po,max:wo,step:To,formatValue:ne,onChange:k,onCommit:r.commands.seal})}),!g&&x.length>1&&(0,n.jsx)(b,{label:o("editor.fineTunePanel.detailSection.missingValues"),children:(0,n.jsx)(i,{value:h.params.missingValues,options:x,onChange:A})})]})})},Lo=e=>Ao.find(t=>t===e),ke=(e,t,s,r)=>(0,m.findStyleRule)(e.styles.overrides,(0,m.buildLayerStyleAddress)(t,r))?.declarations?.[s],Eo=(e,t)=>(0,m.filterLayersByGeoms)(t,"point").find(s=>(0,m.isCompanionLayer)(s,[e])),No=(e,t)=>{const s=[{value:"gap",label:e("editor.graphPanel.treatEmptyValues.leaveGap.label")},{value:"zero",label:e("editor.graphPanel.treatEmptyValues.fillZero.label")}];return t.position!=="stack"&&t.position!=="fill"&&s.push({value:"connect",label:e("editor.graphPanel.treatEmptyValues.connectGaps.label")}),t.geom==="area"?s.filter(r=>r.value!=="gap"):s},Mo="k",Oo=2,Ro=0,ko=5,se=[{value:"k",labelKey:"thousands"},{value:"m",labelKey:"millions"},{value:"b",labelKey:"billions"}],Do=["auto","none"],Fo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{NumberField:i,ToggleGroup:d}=N();if(!a)return null;const{abbreviation:l,decimals:p}=a.config.numberFormat,u=Ho(l)!==void 0,h=p!=="auto",f=P=>P.map(T=>({value:T,label:o(`editor.graphPanel.numberFormat.options.${T}`)})),g=se.map(({value:P,labelKey:T})=>({value:P,label:o(`common.abbreviations.${T}`)})),x=P=>{r.commands.dispatch(new m.SetNumberFormatAbbreviationCommand({abbreviation:P}))},y=P=>{const T=Do.find(R=>R===P);x(T??Mo)},w=P=>{const T=se.find(R=>R.value===P);T&&x(T.value)},j=P=>{r.commands.dispatch(new m.SetNumberFormatDecimalsCommand({decimals:P==="custom"?Oo:"auto"}))},C=P=>{P!==null&&r.commands.dispatch(new m.SetNumberFormatDecimalsCommand({decimals:P}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.numberFormatSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.abbreviationLabel"),children:(0,n.jsx)(d,{value:u?"custom":l,options:f(["auto","none","custom"]),onChange:y})}),u&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(d,{value:l,options:g,onChange:w})}),(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.decimalPlacesLabel"),children:(0,n.jsx)(d,{value:h?"custom":"auto",options:f(["auto","custom"]),onChange:j})}),h&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(i,{value:p,min:Ro,max:ko,onChange:C,onCommit:r.commands.seal})})]})})},Ho=e=>se.find(t=>t.value===e),zo=({title:e,layout:t="collapsible",preview:s})=>{const r=c.useHandleCompiled(E()),a=c.useI18n();if(!r)return null;const o=Go(r.spec.layers);return o?(0,n.jsx)(O,{title:e??a("editor.graphPanel.pointSize.label"),layout:t,preview:s,children:(0,n.jsx)(D,{children:(0,n.jsx)(b,{label:a("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(Mn,{layerId:o.id})})})}):null},Go=e=>{const t=(0,m.filterLayersByGeoms)(e,"line","area");return(0,m.filterLayersByGeoms)(e,"point").find(s=>!(0,m.isCompanionLayer)(s,t))},Vo=.9,Ko=360,Bo=.05,qo=15,Uo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i}=N();if(!a||a.spec.coords.coordType!=="polar")return null;const{innerRadius:d,startAngle:l}=a.spec.coords.params,p=h=>{r.commands.dispatch(new m.SetPolarInnerRadiusCommand({innerRadius:h}),{transient:!0})},u=h=>{r.commands.dispatch(new m.SetPolarStartAngleCommand({startAngle:h}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.polarSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.polarSection.innerRadius"),children:(0,n.jsx)(i,{value:d,min:0,max:Vo,step:Bo,formatValue:En,onChange:p,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.graphPanel.polarSection.startAngle"),children:(0,n.jsx)(i,{value:l,min:0,max:Ko-1,step:qo,formatValue:ao,onChange:u,onCommit:r.commands.seal})})]})})};exports.AppearanceSection=so;exports.AxesPanel=ro;exports.AxisSection=ae;exports.BarSection=lo;exports.Button=cn;exports.CaptionSection=wn;exports.EditableGraphRenderer=Qr;exports.EditorPanel=ue;exports.ElementsPanel=to;exports.GraphOptionsSection=co;exports.GridSection=po;exports.HeadlineSection=Co;exports.IntlProvider=c.IntlProvider;exports.LegendSection=So;exports.LineSection=_o;exports.NumberField=hn;exports.NumberFormatSection=Fo;exports.PANEL_ROOT_ATTRIBUTE=In;exports.PointSection=zo;exports.PolarSection=Uo;exports.RadioGrid=mn;exports.Row=b;exports.Section=O;exports.Select=pn;exports.Slider=gn;exports.SourceSection=Tn;exports.SubtitleSection=An;exports.Switch=vn;exports.TextField=xn;exports.TextSizeSection=_n;exports.TitleSection=Ln;exports.ToggleGroup=fn;exports.ToggledSection=Za;exports.useControls=N;exports.usePanelExpansion=yn;exports.usePanelGraph=E;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./editable.css');const c=require("./history-chords-BQ7eeQ6T.cjs"),Zn=require("./font-values-CStAZ2d1.cjs");let m=require("@graphysdk/viz-engine"),v=require("react"),n=require("react/jsx-runtime"),ie=require("zustand/react/shallow"),$n=require("react-dom"),V=require("clsx");V=c.__toESM(V,1);let De=require("@vanilla-extract/dynamic"),M=require("@base-ui/react/menu"),G=require("@base-ui/react"),X=require("@base-ui/react/accordion"),xe=require("@base-ui/react/number-field"),Fe=require("@base-ui/react/radio"),He=require("@base-ui/react/radio-group"),H=require("@base-ui/react/select"),Z=require("@base-ui/react/slider"),fe=require("@base-ui/react/switch"),Xn=require("@base-ui/react/input");var Yn="data-graphy-chart-chrome",Jn="data-graphy-chart-menu",ze={[Jn]:""},Q=e=>({[Yn]:e}),Ge=(e,t)=>e instanceof Element&&e.closest(`[data-graphy-chart-chrome="${CSS.escape(t)}"]`)!==null,Qn=e=>e instanceof Element&&e.closest("[data-graphy-chart-menu]")!==null,et=e=>e instanceof Element&&e.closest("[data-graphy-chart-chrome]")!==null,Y=(e,t,s)=>e instanceof Node&&(t.contains(e)||Ge(e,s)),nt="cml7ha0",Ve=(0,v.createContext)(null),tt=({children:e})=>{const{chartId:t}=c.useGraphContext(),[s]=(0,v.useState)(c.resolvePortalContainer),[r,a]=(0,v.useState)(null);return s===null?null:(0,n.jsxs)(n.Fragment,{children:[(0,$n.createPortal)((0,n.jsx)("div",{ref:a,className:nt,...Q(t)}),s),(0,n.jsx)(Ve.Provider,{value:r,children:e})]})},le=()=>(0,v.useContext)(Ve),Ke=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M2.333 3h11.334v8.667c-2 0-4 .333-5.667 2.333-2-2-3.667-2.333-5.667-2.333z",opacity:".12"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",fillRule:"evenodd",d:"M3.325 3.156a.836.836 0 0 0-.836.836v6.832c0 .462.375.836.836.836h2.131a.5.5 0 0 1 .352.145L8 13.975l2.193-2.17a.5.5 0 0 1 .352-.145h2.13a.84.84 0 0 0 .836-.836V3.992a.84.84 0 0 0-.836-.836zm-1.836.836c0-1.014.822-1.836 1.836-1.836h9.35c1.015 0 1.836.825 1.836 1.836v6.832a1.84 1.84 0 0 1-1.836 1.836H10.75l-2.398 2.374a.5.5 0 0 1-.704 0L5.25 12.66H3.325a1.836 1.836 0 0 1-1.836-1.836z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",fillRule:"evenodd",d:"M8 4.505a.5.5 0 0 1 .5.5v2.172h2.171a.5.5 0 0 1 0 1H8.5v2.171a.5.5 0 0 1-1 0V8.177H5.329a.5.5 0 0 1 0-1H7.5V5.005a.5.5 0 0 1 .5-.5",clipRule:"evenodd"})]});var Be="efjmb40",qe="efjmb41",q="efjmb42",U="efjmb43",rt="efjmb44",at="efjmb45",ot=new Set(["item-press","escape-key","outside-press","close-press","sibling-open","trigger-press"]),ce=({label:e,icon:t,onOpened:s,children:r})=>{const a=le(),[o,i]=(0,v.useState)(!1),d=(l,p)=>{l?(i(!0),s?.()):ot.has(p.reason)&&i(!1)};return(0,n.jsxs)(G.Menu.SubmenuRoot,{open:o,onOpenChange:d,children:[(0,n.jsx)(st,{label:e,icon:t}),(0,n.jsx)(G.Menu.Portal,{container:a,children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(G.Menu.Positioner,{side:"right",align:"start",sideOffset:4,className:Be,...ze,children:(0,n.jsx)(G.Menu.Popup,{className:qe,children:r})})})})]})},st=({label:e,icon:t})=>(0,n.jsxs)(G.Menu.SubmenuTrigger,{className:q,openOnHover:!1,children:[t,(0,n.jsx)("span",{className:U,children:e}),(0,n.jsx)("span",{className:at,children:(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})})]}),it="_1qe7q450",lt="_1qe7q451",ct="_1qe7q452",dt=({label:e,placeholder:t,addLabel:s,at:r,onRequestClose:a})=>{const o=(0,v.useRef)(null),[i,d]=(0,v.useState)(""),{dispatch:l}=c.useGraphCommands(),p=i.trim(),u=()=>{p.length!==0&&(l(new m.AddAnnotationCommand({kind:"comment",annotation:{at:r,content:ut(p)}})),a())},h=x=>{x.key==="Enter"&&(x.preventDefault(),u()),x.key!=="Escape"&&x.stopPropagation()},f=x=>{d(x.target.value)},g=()=>{requestAnimationFrame(()=>o.current?.focus())};return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(Ke,{}),onOpened:g,children:(0,n.jsxs)("div",{className:it,children:[(0,n.jsx)("input",{ref:o,className:lt,value:i,placeholder:t,onChange:f,onKeyDown:h}),(0,n.jsx)("button",{type:"button",className:ct,disabled:p.length===0,onClick:u,children:s})]})})},ut=e=>({type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e}]}]}),ht=e=>(0,n.jsx)(c.Icon,{viewBox:"0 0 15 14",...e,children:(0,n.jsx)("path",{d:"M14.0146 5.20703C14.2118 5.40459 14.2121 5.72447 14.0146 5.92187L12.3291 7.6084C12.2343 7.70313 12.1047 7.75579 11.9707 7.75586C11.8369 7.75573 11.708 7.70291 11.6133 7.6084L9.92773 5.92187C9.73024 5.72438 9.73031 5.40457 9.92773 5.20703C10.1253 5.0095 10.445 5.0095 10.6426 5.20703L11.4658 6.03027L11.4658 1.68652L7.75586 1.68652L7.75586 12.6455C7.75563 12.9246 7.5291 13.1512 7.25 13.1514L2.5293 13.1514C2.2501 13.1514 2.02367 12.9247 2.02344 12.6455L2.02344 5.00781C0.868958 4.77348 0.000106647 3.7528 -1.10559e-07 2.5293C-4.95071e-08 1.13259 1.13261 9.74645e-05 2.5293 -5.23256e-07C3.92588 0.000220668 5.05859 1.13267 5.05859 2.5293C5.05849 3.75251 4.1892 4.77219 3.03516 5.00684L3.03516 12.1396L6.74414 12.1396L6.74414 1.18066C6.74414 0.901394 6.97076 0.674939 7.25 0.674804L11.9707 0.674805C12.2499 0.674939 12.4766 0.901394 12.4766 1.18066L12.4766 6.03027L13.2998 5.20703C13.4973 5.0095 13.8171 5.0095 14.0146 5.20703ZM4.04687 2.5293C4.04687 1.69137 3.36717 1.01194 2.5293 1.01172C1.69132 1.01182 1.01172 1.6913 1.01172 2.5293C1.01184 3.36719 1.6914 4.04678 2.5293 4.04687C3.36709 4.04665 4.04675 3.36712 4.04687 2.5293ZM14.5 11.2969C14.4998 12.6935 13.3673 13.8262 11.9707 13.8262C10.5742 13.826 9.4416 12.6934 9.44141 11.2969C9.44141 9.90018 10.574 8.7677 11.9707 8.76758C13.3675 8.76758 14.5 9.90011 14.5 11.2969ZM13.4883 11.2969C13.4883 10.4588 12.8088 9.7793 11.9707 9.7793C11.1327 9.77942 10.4531 10.4589 10.4531 11.2969C10.4533 12.1347 11.1329 12.8143 11.9707 12.8145C12.8086 12.8145 13.4881 12.1348 13.4883 11.2969Z",fill:"currentColor",fillOpacity:"0.8"})}),mt="relative-difference",pt=({label:e,layer:t,at:s,onRequestClose:r})=>{const{dispatch:a}=c.useGraphCommands(),o=c.useCompiledSelector(l=>l.coordSystem),i=(0,v.useMemo)(()=>(0,m.inferDifferenceArrowEndpoints)({layer:t,at:s,coordSystem:o}),[t,s,o]);if(i===null)return null;const d=()=>{a(new m.AddAnnotationCommand({kind:"differenceArrow",annotation:{...m.DIFFERENCE_ARROW_DEFAULTS,...i,label:mt}})),r()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:d,children:[(0,n.jsx)(ht,{}),(0,n.jsx)("span",{className:U,children:e})]})};function gt(e,t){if(e.type==="polar"&&!vt(t))return[{scope:"series",labelKey:"pieSlice"}];const s=(0,m.hasMultipleGroups)(t.data,t.mapping);switch(t.geom){case"bar":{const r=[{scope:"data-point",labelKey:"bar"}];if(s){const a=t.position==="stack"||t.position==="fill";r.push({scope:"x-value",labelKey:a?"barStack":"barGroup"}),r.push({scope:"series",labelKey:"barSeries"})}return r}case"line":case"area":{const r=[{scope:"data-point",labelKey:"linePoint"}];return s&&r.push({scope:"series",labelKey:"lineSeries"}),r}case"point":{const r=[{scope:"data-point",labelKey:"scatterPoint"}];return s&&r.push({scope:"series",labelKey:"scatterSeries"}),r}default:return[]}}var vt=e=>{const t=(0,m.extractVariableName)(e.mapping.x);return t!==null&&t!==m.CONSTANT_VARIABLES.x},xt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:"0.3",rx:".533"})]}),ft=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:"0.3",rx:".533"})]}),Ct=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"3.2",height:"7.704",y:"8.296",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"4.741",x:"8.533",y:"11.259",fill:"currentColor",fillOpacity:"0.3",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"11.259",x:"4.267",y:"4.741",fill:"currentColor",fillOpacity:"0.8",rx:".533"}),(0,n.jsx)("rect",{width:"3.2",height:"16",x:"12.8",fill:"currentColor",fillOpacity:".8",rx:".533"})]}),bt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.3",d:"M0 13.037h4.267v2.445a.52.52 0 0 1-.519.518H.518A.52.52 0 0 1 0 15.482zM0 7.037c0-.286.232-.518.519-.518h3.23c.286 0 .518.232.518.518v5.408H0z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M5.867 7.704h4.266v7.778a.52.52 0 0 1-.518.518h-3.23a.52.52 0 0 1-.518-.518zM5.867 7.111h4.266V4.074a.52.52 0 0 0-.518-.518h-3.23a.52.52 0 0 0-.518.518z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.3",d:"M11.733 10.074H16v5.408a.52.52 0 0 1-.518.518h-3.23a.52.52 0 0 1-.519-.518zM11.733 9.481H16V.52A.52.52 0 0 0 15.482 0h-3.23a.52.52 0 0 0-.519.519z"})]}),St=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:".8",strokeWidth:"1.163",d:"m-1.618 15.96 9.118-5.3 11 2.34"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.6",stroke:"currentColor",strokeOpacity:"0.3",d:"M8 13a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),(0,n.jsx)("rect",{width:"9.795",height:"6",x:"3",y:"2",fill:"currentColor",fillOpacity:"0.3",rx:"1.513"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:".8",d:"M5.29 6.62a1.3 1.3 0 0 1-.424-.075 1 1 0 0 1-.373-.244 1.2 1.2 0 0 1-.262-.45 2.1 2.1 0 0 1-.096-.699q0-.389.082-.693.083-.304.238-.514a1.05 1.05 0 0 1 .374-.322q.22-.11.492-.11.285 0 .505.112a.973.973 0 0 1 .526.744h-.54a.5.5 0 0 0-.17-.277.5.5 0 0 0-.321-.105.54.54 0 0 0-.485.273q-.168.273-.17.75h.021a.8.8 0 0 1 .188-.223.92.92 0 0 1 .569-.195.91.91 0 0 1 .813.477q.125.222.123.509 0 .297-.136.536a1 1 0 0 1-.383.372 1.15 1.15 0 0 1-.571.134m-.003-.443a.54.54 0 0 0 .288-.078.57.57 0 0 0 .2-.211.6.6 0 0 0 .073-.299.6.6 0 0 0-.07-.294.54.54 0 0 0-.484-.285.55.55 0 0 0-.403.173.596.596 0 0 0 .108.914.53.53 0 0 0 .288.08M6.88 6.579v-.396l1.05-1.03q.15-.15.25-.27a1 1 0 0 0 .151-.229.6.6 0 0 0 .05-.236.432.432 0 0 0-.244-.405.6.6 0 0 0-.258-.056q-.15 0-.261.062a.43.43 0 0 0-.175.173.56.56 0 0 0-.06.267H6.86q0-.288.132-.5a.9.9 0 0 1 .362-.33q.231-.117.532-.117.303 0 .534.114.23.114.358.312a.8.8 0 0 1 .128.452.9.9 0 0 1-.065.334q-.065.164-.229.363-.162.2-.456.483l-.522.53v.021h1.318v.458zM10.57 6.62a1.3 1.3 0 0 1-.423-.075 1 1 0 0 1-.373-.244 1.2 1.2 0 0 1-.263-.45 2.1 2.1 0 0 1-.096-.699q0-.389.083-.693t.238-.514a1.05 1.05 0 0 1 .374-.322q.219-.11.492-.11.285 0 .505.112a.973.973 0 0 1 .526.744h-.54a.5.5 0 0 0-.17-.277.5.5 0 0 0-.322-.105.54.54 0 0 0-.484.273q-.168.273-.17.75h.02a.8.8 0 0 1 .188-.223.92.92 0 0 1 .569-.195.91.91 0 0 1 .814.477q.125.222.123.509 0 .297-.136.536a1 1 0 0 1-.383.372 1.15 1.15 0 0 1-.572.134m-.002-.443a.54.54 0 0 0 .288-.078.57.57 0 0 0 .2-.211.6.6 0 0 0 .073-.299.6.6 0 0 0-.071-.294.54.54 0 0 0-.483-.285.54.54 0 0 0-.403.173.597.597 0 0 0 .107.914.53.53 0 0 0 .289.08"})]}),jt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{stroke:"currentColor",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:".993",d:"M1.5 12 6 6.5l4 3.5 4-5.5"}),(0,n.jsx)("circle",{cx:"1.493",cy:"11.993",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"5.993",cy:"6.493",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"9.993",cy:"9.993",r:".993",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("circle",{cx:"13.993",cy:"4.493",r:".993",fill:"currentColor",fillOpacity:"0.8"})]}),yt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"16",height:"16",fill:"currentColor",fillOpacity:"0.3",rx:"8"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.8",d:"m7.999 16 .412-.01A8 8 0 0 0 8 0z"}),(0,n.jsx)("path",{fill:"currentColor",fillOpacity:"0.6",d:"M15.999 8a8 8 0 0 1-7.588 7.989l-.412.01V8z"})]}),It=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 3.598 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 6.681 11.327)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 9.251 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 10.28 2.59)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 13.877 6.187)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 2.056 12.869)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 15.933 .533)"})]}),Pt=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 3.598 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 6.681 11.327)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 9.251 7.215)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:".8",rx:"1.028",transform:"matrix(-1 0 0 1 10.28 2.59)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 13.877 6.187)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 2.056 12.869)"}),(0,n.jsx)("rect",{width:"2.056",height:"2.056",fill:"currentColor",fillOpacity:"0.3",rx:"1.028",transform:"matrix(-1 0 0 1 15.933 .533)"})]}),wt={bar:xt,barGroup:ft,barStack:bt,barSeries:Ct,linePoint:St,lineSeries:jt,scatterPoint:It,scatterSeries:Pt,pieSlice:yt},Ue=({labelKey:e})=>{const t=wt[e];return(0,n.jsx)(t,{})},We=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M15 4.66667L12.3333 2L2.33334 12L5.00001 14.6667L15 4.66667Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.01683 15.3331C4.84407 15.3343 4.67292 15.2997 4.51421 15.2314C4.3555 15.1632 4.21268 15.0627 4.09476 14.9365L3.88656 14.7283L3.62877 14.8968L3.19253 15.3331H0L2.24072 13.0923L2.03251 12.8445C1.89423 12.7191 1.78392 12.566 1.70875 12.3952C1.63359 12.2244 1.59526 12.0396 1.59626 11.853C1.59579 11.6818 1.63078 11.5124 1.69904 11.3554C1.76729 11.1984 1.86733 11.0573 1.99285 10.9409L11.2036 1.73012C11.3215 1.60384 11.4643 1.5034 11.623 1.43514C11.7817 1.36688 11.9529 1.33228 12.1257 1.33353C12.2969 1.33245 12.4665 1.36716 12.6236 1.43546C12.7807 1.50375 12.9218 1.60412 13.0378 1.73012L15.1496 3.92126C15.2748 4.03899 15.3745 4.1811 15.4427 4.33882C15.5108 4.49654 15.546 4.66655 15.546 4.83837C15.546 5.01019 15.5108 5.1802 15.4427 5.33792C15.3745 5.49564 15.2748 5.63774 15.1496 5.75548L5.93889 14.9662C5.81806 15.0866 5.67403 15.1812 5.51552 15.2443C5.35702 15.3074 5.18736 15.3376 5.01683 15.3331ZM2.48858 11.9125L5.01683 14.4407L9.47843 9.97913L6.95019 7.4608L2.48858 11.9125ZM7.68388 6.72712L10.2022 9.24544L14.644 4.80367L12.1257 2.28534L7.68388 6.72712Z",fill:"currentColor",fillOpacity:"0.8"})]}),Tt=({label:e,options:t,onSelect:s})=>{const r=c.useI18n();return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(We,{}),children:t.map(a=>(0,n.jsxs)(G.Menu.Item,{className:q,onClick:()=>s(a.scope),children:[(0,n.jsx)(Ue,{labelKey:a.labelKey}),(0,n.jsx)("span",{className:U,children:r(`graph.annotations.highlights.labels.${a.labelKey}`)})]},a.scope))})},At=({label:e,layer:t,observation:s,highlights:r,onRequestClose:a})=>{const o=c.useI18n(),{dispatch:i}=c.useGraphCommands(),d=c.useCompiledSelector(g=>g.coordSystem),l=(0,v.useMemo)(()=>(0,m.buildObservationPredicate)(t,s),[t,s]),p=(0,v.useMemo)(()=>gt(d,t),[d,t]),u=(0,v.useMemo)(()=>{const g=new Set(r.map(x=>x.scope));return p.filter(x=>!g.has(x.scope))},[p,r]),[h]=u;if(l===null||h===void 0)return null;const f=g=>{i(new m.AddHighlightCommand({predicate:l,scope:g,layerId:t.id})),a()};if(u.length===1){const g=p.length===1?e:o("graph.annotations.baseMenu.highlightWithLabel",{label:o(`graph.annotations.highlights.labels.${h.labelKey}`)});return(0,n.jsxs)(G.Menu.Item,{className:q,onClick:()=>f(h.scope),children:[(0,n.jsx)(Ue,{labelKey:h.labelKey}),(0,n.jsx)("span",{className:U,children:g})]})}return(0,n.jsx)(Tt,{label:e,options:u,onSelect:f})},_t="_1aafi1g0",Lt="_1aafi1g1",Ze=({children:e})=>(0,n.jsxs)("span",{className:_t,"aria-hidden":"true",children:[e,(0,n.jsx)("span",{className:Lt})]}),Et=({label:e,highlights:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=t.at(-1);if(a===void 0)return null;const o=()=>{r(new m.RemoveHighlightCommand({id:a.id})),s()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:o,children:[(0,n.jsx)(Ze,{children:(0,n.jsx)(We,{})}),(0,n.jsx)("span",{className:U,children:e})]})},Nt=(e,t)=>{const s=c.useCompiledSelector(a=>a.spec.highlights),r=c.useCompiledSelector(a=>a.config.parsingLocale);return(0,v.useMemo)(()=>(0,m.findHighlightsAtObservation)({layer:e,highlights:s,observation:t,parsingLocale:r}),[e,s,t,r])},$e=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M13.5948 4.29016C13.8724 6.22367 12.5301 8.01618 10.5966 8.29384C8.66309 8.57151 6.87058 7.22918 6.59292 5.29567C6.31525 3.36216 7.65758 1.56965 9.59109 1.29198C11.5246 1.01432 13.3171 2.35665 13.5948 4.29016Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.71886 3.51052C6.25611 1.3626 8.43287 0.0568985 10.5808 0.594151C12.7287 1.1314 14.0344 3.30817 13.4972 5.45609C13.0316 7.31748 11.3347 8.54637 9.49237 8.49145L7.50898 12.492C7.46485 12.581 7.40179 12.6548 7.32702 12.7108C7.20005 12.8073 7.03703 12.8532 6.87248 12.8303C6.80957 12.822 6.74697 12.8038 6.68687 12.7749C6.39369 12.6342 6.26689 12.2915 6.3923 11.9963L7.63393 7.97371C6.10249 7.10872 5.27136 5.29962 5.71886 3.51052ZM10.2785 1.80253C8.79799 1.4322 7.29756 2.33222 6.92723 3.81277C6.55691 5.29332 7.45692 6.79375 8.93747 7.16408C10.418 7.5344 11.9185 6.63439 12.2888 5.15384C12.6591 3.67329 11.7591 2.17285 10.2785 1.80253Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.42977 11.1572C5.70072 11.104 5.8772 10.8411 5.82393 10.5702C5.77067 10.2992 5.50784 10.1227 5.23688 10.176C4.31848 10.3565 3.57421 10.6423 3.04695 11.0266C2.51409 11.4149 2.16666 11.936 2.16666 12.557C2.16666 13.0322 2.41215 13.4327 2.74425 13.7433C3.07553 14.0531 3.52776 14.3091 4.04484 14.5137C5.08193 14.9239 6.48048 15.1666 7.99999 15.1666C9.5195 15.1666 10.9181 14.9239 11.9551 14.5137C12.4722 14.3091 12.9244 14.0531 13.2557 13.7433C13.5878 13.4327 13.8333 13.0322 13.8333 12.557C13.8333 11.936 13.4859 11.4149 12.953 11.0266C12.4258 10.6423 11.6815 10.3565 10.7631 10.176C10.4921 10.1227 10.2293 10.2992 10.176 10.5702C10.1228 10.8411 10.2993 11.104 10.5702 11.1572C11.4079 11.3219 11.997 11.5672 12.364 11.8347C12.7255 12.0981 12.8333 12.3496 12.8333 12.557C12.8333 12.6643 12.7803 12.8187 12.5727 13.013C12.3642 13.2079 12.0354 13.4065 11.5873 13.5838C10.6941 13.9371 9.426 14.1666 7.99999 14.1666C6.57398 14.1666 5.30586 13.9371 4.41267 13.5838C3.9646 13.4065 3.63578 13.2079 3.4273 13.013C3.21964 12.8187 3.16666 12.6643 3.16666 12.557C3.16666 12.3496 3.2745 12.0981 3.63595 11.8347C4.00299 11.5672 4.59206 11.3219 5.42977 11.1572Z",fill:"currentColor",fillOpacity:"0.8"})]}),Mt=({label:e,at:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=()=>{r(new m.AddAnnotationCommand({kind:"pinnedNumber",annotation:{at:t}})),s()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:a,children:[(0,n.jsx)($e,{}),(0,n.jsx)("span",{className:U,children:e})]})},Xe=e=>(0,n.jsxs)(c.Icon,{viewBox:"0 0 16 16",...e,children:[(0,n.jsx)("path",{opacity:"0.12",d:"M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M5.7328 9.69963C5.56696 9.47884 5.25352 9.43429 5.03273 9.60013C4.81193 9.76598 4.76739 10.0794 4.93323 10.3002C5.63175 11.2302 6.74548 11.8333 7.99993 11.8333C9.25438 11.8333 10.3681 11.2302 11.0666 10.3002C11.2325 10.0794 11.1879 9.76598 10.9671 9.60013C10.7463 9.43429 10.4329 9.47884 10.2671 9.69963C9.74929 10.3889 8.92657 10.8333 7.99993 10.8333C7.07329 10.8333 6.25057 10.3889 5.7328 9.69963Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M6.66668 6.66658C6.66668 7.03478 6.3682 7.33325 6.00001 7.33325C5.63182 7.33325 5.33334 7.03478 5.33334 6.66658C5.33334 6.29839 5.63182 5.99992 6.00001 5.99992C6.3682 5.99992 6.66668 6.29839 6.66668 6.66658Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{d:"M10 7.33325C10.3682 7.33325 10.6667 7.03478 10.6667 6.66658C10.6667 6.29839 10.3682 5.99992 10 5.99992C9.63182 5.99992 9.33334 6.29839 9.33334 6.66658C9.33334 7.03478 9.63182 7.33325 10 7.33325Z",fill:"currentColor",fillOpacity:"0.8"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 0.833252C4.04197 0.833252 0.833344 4.04188 0.833344 7.99992C0.833344 11.958 4.04197 15.1666 8.00001 15.1666C11.9581 15.1666 15.1667 11.958 15.1667 7.99992C15.1667 4.04188 11.9581 0.833252 8.00001 0.833252ZM14.1667 7.99992C14.1667 11.4057 11.4058 14.1666 8.00001 14.1666C4.59425 14.1666 1.83334 11.4057 1.83334 7.99992C1.83334 4.59416 4.59425 1.83325 8.00001 1.83325C11.4058 1.83325 14.1667 4.59416 14.1667 7.99992Z",fill:"currentColor",fillOpacity:"0.8"})]}),Ye={pinnedNumber:{icon:$e,labelKey:"graph.annotations.baseMenu.unpinNumber"},comment:{icon:Ke,labelKey:"graph.annotations.baseMenu.removeAnnotation"},sticker:{icon:Xe,labelKey:"graph.annotations.baseMenu.removeSticker"},image:null},Ot=e=>(0,m.isObservationAttachmentKind)(e.kind)&&Ye[e.kind]!==null,Rt=({attachment:e,onRequestClose:t})=>{const s=c.useI18n(),{dispatch:r}=c.useGraphCommands(),{icon:a,labelKey:o}=Ye[e.kind],i=()=>{r(new m.RemoveAnnotationCommand({id:e.annotation.id})),t()};return(0,n.jsxs)(M.Menu.Item,{className:q,onClick:i,children:[(0,n.jsx)(Ze,{children:(0,n.jsx)(a,{})}),(0,n.jsx)("span",{className:U,children:s(o)})]})},kt="ceeojg0",Dt="ceeojg1",Ft="ceeojg2",Ht=({label:e,at:t,onRequestClose:s})=>{const{dispatch:r}=c.useGraphCommands(),a=o=>{r(new m.AddAnnotationCommand({kind:"sticker",annotation:{at:{anchorType:"observation",...t},sticker:o}})),s()};return(0,n.jsx)(ce,{label:e,icon:(0,n.jsx)(Xe,{}),children:(0,n.jsx)("div",{className:kt,children:Object.entries(c.STICKER_ASSETS).map(([o,i])=>(0,n.jsx)(G.Menu.Item,{className:Dt,"aria-label":o,onClick:()=>a(o),children:(0,n.jsx)("img",{className:Ft,src:i.src,alt:o})},o))})})},zt=({interaction:e,panelOrigin:t})=>{const s=c.useEditorStore(),r=c.useEditorState(o=>o.menuTrigger);if(e.kind!=="menu"||r===null)return null;const a=()=>{s.getState().releaseInteraction("menu")};return(0,n.jsx)(Gt,{trigger:{x:t.x+r.center.x,y:t.y+r.center.y,radius:r.radius},layer:e.anchor.layer,at:e.anchor.at,observation:e.anchor.observation,onClose:a})},Gt=({trigger:e,layer:t,at:s,observation:r,onClose:a})=>{const o=c.useI18n(),i=le(),d=c.useCompiledSelector(C=>C.spec.annotations),l=c.useCompiledSelector(C=>C.config.parsingLocale),p=Kt(),{x:u,y:h,radius:f}=e,g=(0,v.useMemo)(()=>Vt(u,h,f),[u,h,f]),x=(0,m.findObservationAttachment)(d,s,(0,v.useMemo)(()=>(0,m.createObservationAnchorParser)(t,l),[t,l])),y=x!==null&&Ot(x)?x:null,w=Nt(t,r),j=(C,P)=>{!C&&Bt(P.reason)&&a()};return(0,n.jsx)(M.Menu.Root,{open:p,modal:!1,onOpenChange:j,children:(0,n.jsx)(M.Menu.Portal,{container:i,children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(M.Menu.Positioner,{anchor:g,side:"right",align:"start",sideOffset:8,className:Be,...ze,children:(0,n.jsxs)(M.Menu.Popup,{className:qe,"data-testid":"observation-menu",children:[y!==null&&(0,n.jsx)(Rt,{attachment:y,onRequestClose:a}),(0,n.jsx)(Et,{label:o("graph.annotations.baseMenu.removeHighlight"),highlights:w,onRequestClose:a}),(0,n.jsx)(M.Menu.Separator,{className:rt}),y===null&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Mt,{label:o("graph.annotations.baseMenu.pinNumber"),at:s,onRequestClose:a}),(0,n.jsx)(dt,{label:o("graph.annotations.baseMenu.annotate"),placeholder:o("graph.annotations.textMenu.placeholder"),addLabel:o("graph.annotations.textMenu.addButton"),at:s,onRequestClose:a}),(0,n.jsx)(Ht,{label:o("graph.annotations.baseMenu.addSticker"),at:s,onRequestClose:a})]}),t.highlight!==null&&(0,n.jsx)(At,{label:o("graph.annotations.baseMenu.highlight"),layer:t,observation:r,highlights:w,onRequestClose:a}),(0,n.jsx)(pt,{label:o("graph.annotations.baseMenu.differenceArrow"),layer:t,at:s,onRequestClose:a})]})})})})})},Vt=(e,t,s)=>({getBoundingClientRect:()=>new DOMRect(e-s,t-s,s*2,s*2)}),Kt=()=>{const[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{t(!0)},[]),e},Bt=e=>e==="outside-press"||e==="escape-key"||e==="item-press",qt=()=>{const e=c.useGraphSelection();return Je(e)},Je=e=>{if(e.length!==1)return null;const[t]=e;return t?.kind==="annotation"?t.id:null},Ut=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 9h16m-4-4 4 4"}),(0,n.jsx)("path",{d:"M20 15H4m4 4-4-4"})]})}),Wt=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 7h16"}),(0,n.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,n.jsx)("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),(0,n.jsx)("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"})]})}),Zt={kind:"chrome-popup"},$t="var(--q7gcrz0)",Xt="var(--q7gcrz1)",Yt="q7gcrz2",Jt="q7gcrz3";var Qt="q7gcrz5",er="q7gcrz6",nr="q7gcrz7",tr="q7gcrz8",Qe="q7gcrz9",rr="q7gcrza";var Ce="q7gcrzd q7gcrzc",en="q7gcrze q7gcrzc",ar=["absolute-difference","relative-difference","proportion"],be=["absolute-difference","relative-difference"],or=["relative-difference","proportion"],sr={"absolute-difference":"graph.annotations.differenceArrowToolbar.labelKind.absoluteDifference","relative-difference":"graph.annotations.differenceArrowToolbar.labelKind.relativeDifference",proportion:"graph.annotations.differenceArrowToolbar.labelKind.proportion"},ir=e=>{const{formattingLocale:t}=c.useGraphContext(),s=c.useCompiledSelector(a=>a.config.parsingLocale),r=t??s;return(0,v.useMemo)(()=>{const a=(0,m.areEndpointsComparable)(e.start,e.end);return ar.filter(o=>a||!be.includes(o)||o===e.label).map(o=>({kind:o,nameKey:sr[o],preview:(0,m.formatDifferenceLabel)({locale:r,kind:o,startValue:e.start.measurementValue,endValue:e.end.measurementValue,valueFormat:e.start.valueFormat}),isPickable:a||!be.includes(o),isSuspect:or.includes(o)&&e.start.measurementValue===0}))},[e,r])},$=8,lr=({labelBox:e,panelRect:t,frameWidth:s,frameHeight:r})=>{const a=t.y+e.y,o=a+e.height,i=a-8-36,d=o+8,l=cr($,i>=$?i:d,r-$-36),p=$;return{top:l,left:p,available:Math.max(0,s-$*2),centre:t.x+e.x+e.width/2-p}},cr=(e,t,s)=>Math.max(e,Math.min(t,s)),te=[{id:"small",nameKey:"graph.annotations.differenceArrowToolbar.size.small"},{id:"medium",nameKey:"graph.annotations.differenceArrowToolbar.size.medium"},{id:"large",nameKey:"graph.annotations.differenceArrowToolbar.size.large"}],dr=({arrow:e,labelBox:t,panelRect:s,frameWidth:r,frameHeight:a,frameElement:o})=>{const i=c.useI18n(),{chartId:d,commands:l}=c.useGraphContext(),p=c.useEditorStore(),[u,h]=(0,v.useState)(null),f=ir(e),g=lr({labelBox:t,panelRect:s,frameWidth:r,frameHeight:a}),x=(j,C)=>{l.dispatch(new m.UpdateAnnotationCommand({kind:"differenceArrow",id:e.id,patch:j}),C)};(0,v.useEffect)(()=>()=>l.seal(),[l]),(0,v.useEffect)(()=>{const{claimInteraction:j,releaseInteraction:C}=p.getState();return u===null?C("chrome-popup"):j(Zt),()=>C("chrome-popup")},[p,u]);const y=j=>{h(j?"color":null),j||l.seal()},w=()=>{l.dispatch(new m.RemoveAnnotationCommand({id:e.id})),o.focus({preventScroll:!0})};return(0,n.jsx)("div",{className:Yt,style:{top:g.top,left:g.left,width:g.available},children:(0,n.jsxs)(c.FloatingToolbar.Root,{"aria-label":i("graph.annotations.differenceArrowToolbar.label"),className:Jt,"data-testid":"difference-arrow-toolbar",...Q(d),style:(0,De.assignInlineVars)({[$t]:`${g.centre}px`,[Xt]:`${g.available}px`}),children:[(0,n.jsx)(ur,{options:f,current:e.label,isOpen:u==="labelKind",onOpenChange:j=>h(j?"labelKind":null),onPick:j=>{x({label:j}),h(null)}}),(0,n.jsx)(c.FloatingToolbar.Separator,{}),(0,n.jsx)(c.FloatingToolbar.ColorPicker,{color:e.color,label:i("graph.annotations.differenceArrowToolbar.color"),onChange:j=>x({color:j},{transient:!0}),isOpen:u==="color",onOpenChange:y,popupAttributes:Q(d),children:(0,n.jsx)("span",{className:er,style:{background:e.color??"transparent"}})}),(0,n.jsx)(hr,{current:e.size,isOpen:u==="size",onOpenChange:j=>h(j?"size":null),onPick:j=>{x({size:j}),h(null)}}),(0,n.jsx)(c.FloatingToolbar.Separator,{}),(0,n.jsx)(c.FloatingToolbar.Button,{"aria-label":i("graph.annotations.differenceArrowToolbar.swap"),className:Ce,onClick:()=>x({start:e.end.anchor,end:e.start.anchor}),children:(0,n.jsx)(Ut,{size:"sm",title:""})}),(0,n.jsx)(c.FloatingToolbar.Button,{"aria-label":i("graph.annotations.differenceArrowToolbar.remove"),className:Ce,onClick:w,children:(0,n.jsx)(Wt,{size:"sm",title:""})})]})})},ur=({options:e,current:t,isOpen:s,onOpenChange:r,onPick:a})=>{const o=c.useI18n(),i=e.find(l=>l.kind===t),d=e.some(l=>l.isPickable&&l.kind!==t);return(0,n.jsxs)(M.Menu.Root,{open:s,modal:!1,onOpenChange:r,children:[(0,n.jsxs)(M.Menu.Trigger,{render:(0,n.jsx)(c.FloatingToolbar.Button,{}),"aria-label":o("graph.annotations.differenceArrowToolbar.labelKind.ariaLabel"),className:en,disabled:!d,onMouseDown:l=>l.preventDefault(),children:[(0,n.jsx)("span",{className:Qt,children:i===void 0?"":o(i.nameKey)}),i!==void 0&&(0,n.jsxs)("span",{className:"q7gcrz4",children:["(",i.preview,")"]}),(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})]}),(0,n.jsx)(nn,{children:e.map(l=>(0,n.jsxs)(M.Menu.Item,{className:Qe,"data-selected":l.kind===t,disabled:!l.isPickable,onClick:()=>a(l.kind),children:[(0,n.jsx)("span",{children:o(l.nameKey)}),(l.isSuspect||!l.isPickable)&&(0,n.jsx)("span",{"aria-label":o(l.isPickable?"graph.annotations.differenceArrowToolbar.labelKind.suspectValue":"graph.annotations.differenceArrowToolbar.labelKind.incomparableEnds"),className:"q7gcrzb",role:"img",children:"⚠"}),(0,n.jsx)("span",{className:rr,children:l.preview})]},l.kind))})]})},hr=({current:e,isOpen:t,onOpenChange:s,onPick:r})=>{const a=c.useI18n(),o=te.find(i=>i.id===e)??te[0];return(0,n.jsxs)(M.Menu.Root,{open:t,modal:!1,onOpenChange:s,children:[(0,n.jsxs)(M.Menu.Trigger,{render:(0,n.jsx)(c.FloatingToolbar.Button,{}),"aria-label":a("graph.annotations.differenceArrowToolbar.size.ariaLabel"),className:en,onMouseDown:i=>i.preventDefault(),children:[(0,n.jsx)("span",{children:o===void 0?"":a(o.nameKey)}),(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})]}),(0,n.jsx)(nn,{children:te.map(i=>(0,n.jsx)(M.Menu.Item,{className:Qe,"data-selected":i.id===e,onClick:()=>r(i.id),children:a(i.nameKey)},i.id))})]})},nn=({children:e})=>{const{chartId:t}=c.useGraphContext();return(0,n.jsx)(M.Menu.Portal,{container:c.resolvePortalContainer(),children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(M.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:nr,children:(0,n.jsx)(M.Menu.Popup,{className:tr,onMouseDown:s=>s.preventDefault(),...Q(t),children:e})})})})};var mr="ydgo3h0",pr="ydgo3h1",gr="ydgo3h2",tn=e=>e==="start"?"end":"start",rn=({dispatch:e,arrow:t,endpoint:s,anchor:r})=>{(0,m.areAnchorsEqual)(r,t[s].anchor)||e(new m.UpdateAnnotationCommand({kind:"differenceArrow",id:t.id,patch:{[s]:r}}))},vr=({clientPoint:e,panelOrigin:t,panelRect:s,engine:r,layers:a,coordSystem:o,resolver:i,fixedAnchor:d,align:l})=>{const p=xr({x:e.x-t.x,y:e.y-t.y},s),{primary:u}=r.query((0,m.toPanelCursor)(p,s));if(u===null)return null;const h=a.find(g=>g.id===u.layerId);if(h===void 0)return null;const f=(0,m.resolveObservationPoint)({resolver:i,layer:h,observation:u.observation,coordSystem:o,align:l});return f===null||(0,m.areAnchorsEqual)(f.anchor,d)?null:f},xr=(e,t)=>({x:Math.max(0,Math.min(e.x,t.width)),y:Math.max(0,Math.min(e.y,t.height))}),fr=class{constructor(e){this.params=e,this.listeners=new AbortController,this.pendingEvent=null,this.scheduledFrame=null,this.hasMoved=!1,this.hasPublished=!1,this.handleMove=t=>{t.pointerId===this.params.pointerId&&(this.pendingEvent=t,this.hasMoved=!0,this.scheduledFrame===null&&(this.scheduledFrame=requestAnimationFrame(this.runFrame)))},this.handleUp=t=>{t.pointerId===this.params.pointerId&&(this.pendingEvent=t,this.finish(!0))},this.handleLost=t=>{t.pointerId===this.params.pointerId&&this.finish(!1)},this.runFrame=()=>{this.scheduledFrame=null;const t=this.pendingEvent;if(this.pendingEvent=null,t===null)return;const{editorStore:s,engine:r,anchorResolver:a,endpoint:o,readInputs:i}=this.params,{arrow:d,panelOrigin:l,panelRect:p,layers:u,coordSystem:h}=i(),f=s.getState();if(this.hasPublished&&c.readDraggedEndpointFor(c.readStanding(f,"endpoint-drag"),d.id,o)===null)return;const g=vr({clientPoint:{x:t.clientX,y:t.clientY},panelOrigin:l,panelRect:p,engine:r,layers:u,coordSystem:h,resolver:a,fixedAnchor:d[tn(o)].anchor,align:d[o].anchor.align});g!==null&&this.publish(g)}}start(){const{handle:e}=this.params,{signal:t}=this.listeners;e.addEventListener("pointermove",this.handleMove,{signal:t}),e.addEventListener("pointerup",this.handleUp,{signal:t}),e.addEventListener("lostpointercapture",this.handleLost,{signal:t})}finish(e){this.params.onSettled(),this.listeners.abort(),this.cancelFrame(),e&&this.hasMoved&&this.runFrame(),this.pendingEvent=null;const{editorStore:t,endpoint:s,readInputs:r,dispatch:a}=this.params,{arrow:o}=r(),i=t.getState(),d=c.readDraggedEndpointFor(c.readStanding(i,"endpoint-drag"),o.id,s);d!==null&&(i.releaseInteraction("endpoint-drag"),e&&rn({dispatch:a,arrow:o,endpoint:s,anchor:d.point.anchor}))}publish(e){const{editorStore:t,readInputs:s,endpoint:r}=this.params;t.getState().claimInteraction({kind:"endpoint-drag",annotationId:s().arrow.id,endpoint:r,point:e}),this.hasPublished=!0}cancelFrame(){this.scheduledFrame!==null&&(cancelAnimationFrame(this.scheduledFrame),this.scheduledFrame=null)}},Cr=({arrow:e,panelOrigin:t,panelRect:s})=>{const{commands:r,anchorResolver:a}=c.useGraphContext(),{engine:o}=c.useHoverContext(),i=c.useEditorStore(),d=c.useLatestRef({arrow:e,panelOrigin:t,panelRect:s,...c.useCompiledSelector((0,ie.useShallow)(p=>({layers:p.layers,coordSystem:p.coordSystem})))}),l=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>l.current?.finish(!1),[]),(0,v.useCallback)(p=>({onClick:u=>u.stopPropagation(),onPointerDown:u=>{if(u.button!==0||l.current!==null)return;try{u.currentTarget.setPointerCapture(u.pointerId)}catch{return}u.currentTarget.focus({preventScroll:!0}),u.preventDefault();const h=new fr({handle:u.currentTarget,pointerId:u.pointerId,endpoint:p,readInputs:()=>d.current,editorStore:i,engine:o,anchorResolver:a,dispatch:r.dispatch,onSettled:()=>{l.current=null}});l.current=h,h.start()}}),[d,i,o,a,r])},br=[" ","Enter"],Sr=({arrow:e})=>{const{commands:t,anchorResolver:s}=c.useGraphContext(),r=c.useEditorStore(),{layers:a,coordSystem:o,mainAxis:i}=c.useCompiledSelector((0,ie.useShallow)(l=>({layers:l.layers,coordSystem:l.coordSystem,mainAxis:l.coordSystem.type==="cartesian"?l.coordSystem.mainAxis:"x"}))),d=e.id;return(0,v.useEffect)(()=>()=>{const l=r.getState();c.readStanding(l,"endpoint-drag")?.annotationId===d&&l.releaseInteraction("endpoint-drag")},[r,d]),(0,v.useCallback)(l=>({onKeyDown:p=>{if(p.altKey||p.ctrlKey||p.metaKey||p.shiftKey)return;const u=r.getState(),h=c.readDraggedEndpointFor(c.readStanding(u,"endpoint-drag"),e.id,l);if(br.includes(p.key)){if(p.preventDefault(),p.repeat)return;if(h===null)return u.claimInteraction({kind:"endpoint-drag",annotationId:e.id,endpoint:l,point:e[l]});u.releaseInteraction("endpoint-drag"),rn({dispatch:t.dispatch,arrow:e,endpoint:l,anchor:h.point.anchor});return}if(h===null)return;const f=jr(p.key,i);if(f===null)return;p.preventDefault();const g=yr({arrow:e,endpoint:l,from:h.point.anchor,move:f,layers:a,coordSystem:o,resolver:s});g!==null&&u.claimInteraction({kind:"endpoint-drag",annotationId:e.id,endpoint:l,point:g})}}),[e,r,t,s,a,o,i])},jr=(e,t)=>{const s=e==="ArrowUp"||e==="ArrowDown";return!s&&!(e==="ArrowLeft"||e==="ArrowRight")?null:{axis:t==="x"===s?"cross":"main",step:e==="ArrowDown"||e==="ArrowRight"?1:-1}},yr=({arrow:e,endpoint:t,from:s,move:r,layers:a,coordSystem:o,resolver:i})=>{const d=a.find(p=>p.id===s.layerId);if(d===void 0)return null;const l=(0,m.stepDifferenceArrowEndpoint)({layer:d,from:s,partner:e[tn(t)].anchor,axis:r.axis,step:r.step,canLandOn:p=>(0,m.resolveObservationPoint)({resolver:i,layer:d,observation:p,coordSystem:o,align:e[t].anchor.align})!==null});return l===null?null:(0,m.resolveObservationPoint)({resolver:i,layer:d,observation:l.observation,coordSystem:o,align:e[t].anchor.align})},Ir=e=>{const t=qt();return t===null?null:(0,n.jsx)(Pr,{annotationId:t,...e})},Pr=({annotationId:e,...t})=>{const s=c.useDifferenceArrowGeometries(),r=(0,v.useMemo)(()=>s.find(a=>a.id===e),[s,e]);return r===void 0?null:(0,n.jsx)(wr,{committedArrow:r.committedArrow,committedLabelBox:r.committedLabelBox,labelBox:r.labelBox,start:r.start,end:r.end,isDragged:r.isDragged,...t})},wr=({committedArrow:e,committedLabelBox:t,labelBox:s,start:r,end:a,panelRect:o,panelOrigin:i,frameRect:d,frameElement:l,isDragged:p})=>{const u=Cr({arrow:e,panelOrigin:i,panelRect:o}),h=Sr({arrow:e});return(0,n.jsxs)("div",{"data-testid":"difference-arrow-selection",children:[!p&&(0,n.jsx)(dr,{arrow:e,labelBox:t,panelRect:o,frameWidth:d.width,frameHeight:d.height,frameElement:l}),(0,n.jsx)("div",{"aria-hidden":"true",className:gr,"data-testid":"difference-arrow-selection-label",style:{left:o.x+s.x-2,top:o.y+s.y-2,width:s.width+4,height:s.height+4}}),(0,n.jsx)(Se,{endpoint:"start",point:r,panelRect:o,dragHandlers:u("start"),keyboardHandlers:h("start")}),(0,n.jsx)(Se,{endpoint:"end",point:a,panelRect:o,dragHandlers:u("end"),keyboardHandlers:h("end")})]})},Se=({endpoint:e,point:t,panelRect:s,dragHandlers:r,keyboardHandlers:a})=>(0,n.jsx)("div",{className:mr,"data-testid":"difference-arrow-selection-handle","data-endpoint":e,role:"button",style:{left:s.x+t.x,top:s.y+t.y},tabIndex:0,...r,...a,children:(0,n.jsx)("span",{"aria-hidden":"true",className:pr})}),Tr=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M12 5v14"}),(0,n.jsx)("path",{d:"M5 12h14"})]})}),Ar="var(--_1tyillx0)",_r={rest:.5,hovered:.75,open:1};var Lr="_1tyillx1",Er={rest:"_1tyillx2",hovered:"_1tyillx3",open:"_1tyillx4"},Nr="_1tyillx5",Mr={closed:"_1tyillx6",open:"_1tyillx7"},Or=({interaction:e,panelRect:t})=>{const s=c.useEditorStore(),r=c.useCompiledSelector(d=>d.coordSystem),a=e.kind==="trigger"||e.kind==="menu"?e.anchor:null,o=Rr(e),i=(0,v.useMemo)(()=>{if(a===null)return null;const d=(0,m.projectAnchorToPanel)(a.position,t,r);return{center:d,radius:19*_r[o],target:{kind:"observation",cursor:(0,m.toPanelCursor)(d,t)}}},[a,t,r,o]);return(0,v.useEffect)(()=>{s.getState().setMenuTrigger(i)},[s,i]),(0,v.useEffect)(()=>()=>s.getState().setMenuTrigger(null),[s]),a===null||i===null?null:(0,n.jsx)("div",{"aria-hidden":"true","data-testid":"observation-menu-trigger","data-state":o,className:(0,V.default)(Lr,Er[o]),style:{left:t.x+i.center.x,top:t.y+i.center.y,...(0,De.assignInlineVars)({[Ar]:a.color??Zn.vars.border50})},children:(0,n.jsx)("span",{className:(0,V.default)(Nr,Mr[o==="open"?"open":"closed"]),children:(0,n.jsx)(Tr,{size:"lg"})})})},Rr=e=>e.kind==="menu"?"open":e.kind==="trigger"&&e.isEngaged?"hovered":"rest",kr='button:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Dr=(e,t)=>{const{chartId:s}=c.useGraphContext(),r=c.useEditorStore();(0,v.useEffect)(()=>{if(t===null)return;const a=o=>{if(o.key!=="Tab"||o.defaultPrevented||!Y(o.target,e,s)||r.getState().standingInteraction?.kind==="chrome-popup")return;const i=[...t.querySelectorAll(kr)];if(i.length===0)return;o.preventDefault();const d=i.findIndex(l=>l===document.activeElement);i[d===-1?o.shiftKey?i.length-1:0:(d+(o.shiftKey?-1:1)+i.length)%i.length]?.focus()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t,s,r])},Fr=e=>{const{selectionStore:t,chartId:s}=c.useGraphContext();(0,v.useEffect)(()=>{let r=null;const a=()=>{e.focus({preventScroll:!0})},o=d=>{const{selection:l,clearSelection:p}=t.getState();l.length!==0&&(Y(d.target,e,s)||p())},i=d=>{t.getState().selection.length!==0&&Y(d.target,e,s)&&d.relatedTarget===null&&(r!==null&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=null,document.hasFocus()&&(Y(document.activeElement,e,s)||t.getState().clearSelection())}))};return e.addEventListener("pointerdown",a),document.addEventListener("focusin",o),document.addEventListener("focusout",i),()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("pointerdown",a),document.removeEventListener("focusin",o),document.removeEventListener("focusout",i)}},[e,t,s])},Hr=e=>{const{selectionStore:t,commands:s,chartId:r}=c.useGraphContext(),a=c.useEditorStore(),o=(0,v.useCallback)(d=>{const{selection:l}=t.getState(),p=Je(l);p!==null&&(d.preventDefault(),s.dispatch(new m.RemoveAnnotationCommand({id:p})),e.focus({preventScroll:!0}))},[e,s,t]),i=(0,v.useCallback)(d=>{const l=a.getState();switch(l.standingInteraction?.kind){case"endpoint-drag":l.releaseInteraction("endpoint-drag");return;case"chrome-popup":return;case"menu":l.releaseInteraction("menu");return;default:if(Ge(d.target,r)){e.focus({preventScroll:!0});return}t.getState().clearSelection();return}},[a,t,e,r]);(0,v.useEffect)(()=>{const d=l=>{if(Y(l.target,e,r)&&!zr(l.target)&&!Qn(l.target))switch(l.key){case"Escape":return i(l);case"Delete":case"Backspace":return o(l);default:return}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,o,i,r])},zr=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement),Gr=`[${c.EDIT_TARGET_KIND_ATTRIBUTE}]`,an=(e,t,s)=>{if(typeof document.elementsFromPoint!="function")return null;const r=document.elementsFromPoint(e,t);return Vr(r,s)},Vr=(e,t)=>{for(const s of e){const r=s.closest(Gr);if(r===null||!t.contains(r))continue;const a=Kr(r);if(a!==null)return a}return null},Kr=e=>{const t=e.getAttribute(c.EDIT_TARGET_KIND_ATTRIBUTE);if(t!=="annotation")return null;const s=e.getAttribute(c.EDIT_TARGET_ID_ATTRIBUTE);return s===null||s===""?null:{kind:t,id:s}},Br=()=>{const e=c.useHoverState(a=>a.hover.primary),{layers:t,coordSystem:s}=c.useCompiledSelector((0,ie.useShallow)(a=>({layers:a.layers,coordSystem:a.coordSystem}))),{anchorResolver:r}=c.useGraphContext();return(0,v.useMemo)(()=>{if(e===null)return null;const a=t.find(d=>d.id===e.layerId);if(a===void 0)return null;const o=r.resolve(a.geom,e.observation,{coordSystem:s,position:a.position,purpose:"pin"});if(o===null)return null;const i=(0,m.buildObservationAnchor)(a,e.observation);return i===null?null:{position:o,color:(0,m.getColor)(e.observation),layer:a,at:i,observation:e.observation}},[e,t,s,r])},qr={kind:"idle"},on=()=>{const e=c.useEditorState(r=>r.standingInteraction),t=c.useEditorState(r=>r.chromeUnderPointer),s=Br();return(0,v.useMemo)(()=>e!==null?e:s===null?qr:{kind:"trigger",anchor:s,isEngaged:t==="menu-trigger"},[e,s,t])},Ur=(e,t)=>{const s=c.useEditorStore(),r=c.useLatestRef(t);(0,v.useEffect)(()=>{let a=null,o=null;const i=h=>{const{menuTrigger:f}=s.getState();return f===null?null:(0,m.isPointWithinEditMenuTrigger)(h,f)?"menu-trigger":null},d=()=>{a=null;const h=o;if(o=null,h===null)return;const f=r.current,g=s.getState();g.setChromeUnderPointer(i({x:h.x-f.x,y:h.y-f.y})),g.standingInteraction?.kind!=="menu"&&g.setEditTargetUnderPointer(an(h.x,h.y,e))},l=()=>{const h=s.getState();h.setChromeUnderPointer(null),h.setEditTargetUnderPointer(null)},p=h=>{o={x:h.clientX,y:h.clientY},a===null&&(a=requestAnimationFrame(d))},u=()=>{o=null,a!==null&&(cancelAnimationFrame(a),a=null),l()};return e.addEventListener("pointermove",p),e.addEventListener("pointerleave",u),()=>{a!==null&&cancelAnimationFrame(a),e.removeEventListener("pointermove",p),e.removeEventListener("pointerleave",u),l()}},[e,s,r])},je="editor",ye=[],Wr=(e,t,s,r)=>{const a=on(),{store:o}=c.useHoverContext(),i=c.useGraphSelection().length>0,d=c.useEditorState(u=>u.menuTrigger),l=a.kind==="menu",p=(0,v.useMemo)(()=>d===null?ye:[(0,m.buildEditMenuTriggerRegion)(d)],[d]);Ur(e,t),Zr(a,e,t,s),Fr(e),Hr(e),Dr(e,r),(0,v.useEffect)(()=>(o.getState().publishPointerRegions(je,p),()=>o.getState().publishPointerRegions(je,ye)),[o,p]),(0,v.useEffect)(()=>(o.getState().setPointerSuspended(l||i),()=>o.getState().setPointerSuspended(!1)),[o,l,i]),(0,v.useEffect)(()=>{if(!i)return;const u=o.getState();u.setHoverState(m.RESTING_HOVER_STATE),u.setTooltipAnchor(null)},[o,i])},Zr=(e,t,s,r)=>{const a=c.useEditorStore(),{selectionStore:o}=c.useGraphContext(),{store:i,engine:d}=c.useHoverContext(),l=c.useLatestRef(e),p=c.useLatestRef(s),u=c.useLatestRef(r);(0,v.useEffect)(()=>{const h=j=>{const{menuTrigger:C}=a.getState();return C===null?!1:(0,m.isPointWithinEditMenuTrigger)(Ie(j,p.current),C)},f=j=>{if(h(j)||o.getState().selection.length>0)return;const C=u.current,P=Ie(j,p.current),T=$r(P,C)?d.query((0,m.toPanelCursor)(P,C)):m.RESTING_HOVER_STATE;i.getState().setHoverState(T)};let g=!1;const x=()=>{g=l.current.kind==="menu"},y=j=>{const C=an(j.clientX,j.clientY,t),P=o.getState();if(C===null){P.clearSelection();return}P.setSelection([C])},w=j=>{if(et(j.target))return;const{claimInteraction:C,releaseInteraction:P}=a.getState(),T=h(j);if(!T||g){P("menu"),T||y(j),g&&f(j);return}const R=l.current;R.kind==="trigger"&&C({kind:"menu",anchor:R.anchor})};return document.addEventListener("pointerdown",x,!0),document.addEventListener("click",w),()=>{document.removeEventListener("pointerdown",x,!0),document.removeEventListener("click",w)}},[a,o,t,l,i,d,p,u])},Ie=(e,t)=>({x:e.clientX-t.x,y:e.clientY-t.y}),$r=(e,t)=>e.x>=0&&e.x<=t.width&&e.y>=0&&e.y<=t.height,Xr=({frameElement:e,panelRect:t})=>{const{measureRef:s,screenRect:r}=c.useElementScreenRect(),a=c.useEditorStore();return(0,v.useEffect)(()=>(s(e),()=>s(null)),[s,e]),(0,v.useEffect)(()=>()=>a.getState().releaseInteraction("menu"),[a]),r===null?null:(0,n.jsx)(tt,{children:(0,n.jsx)(Yr,{frameElement:e,frameRect:r,panelRect:t})})},Yr=({frameElement:e,frameRect:t,panelRect:s})=>{const r=(0,v.useMemo)(()=>({x:t.left+s.x,y:t.top+s.y}),[t.left,t.top,s.x,s.y]),[a,o]=(0,v.useState)(null);return Wr(e,r,s,a),(0,n.jsx)(Jr,{frameElement:e,frameRect:t,panelOrigin:r,panelRect:s,boxRef:o})},Jr=({frameElement:e,frameRect:t,panelOrigin:s,panelRect:r,boxRef:a})=>{const o=le(),i=on();return(0,n.jsx)(c.OverlayPortal,{rect:t,zIndex:c.Z_INDEX.editorOverlay,container:o,"data-testid":"editor-overlay",boxRef:a,children:(0,n.jsxs)(c.PortalThemeProvider,{children:[(0,n.jsx)(Ir,{panelRect:r,panelOrigin:s,frameRect:t,frameElement:e}),(0,n.jsx)(Or,{interaction:i,panelRect:r}),(0,n.jsx)(zt,{interaction:i,panelOrigin:s})]})})},Qr=({slots:e,...t})=>(0,n.jsx)(c.EditorProvider,{children:(0,n.jsx)(c.GraphRenderer,{slots:(0,v.useMemo)(()=>({EditorSurface:Xr,...e}),[e]),...t})}),sn=(0,v.createContext)(null),ln=({labelId:e,controlId:t,children:s})=>{const r=(0,v.useMemo)(()=>{let a=null;return{labelId:e,controlId:t,claimControlId:o=>(a??=o,a===o)}},[e,t]);return(0,n.jsx)(sn.Provider,{value:r,children:s})},K=({id:e,ariaLabel:t,ariaLabelledBy:s},r=!0)=>{const a=(0,v.useContext)(sn),o=(0,v.useId)(),[i]=(0,v.useState)(()=>r?a?.claimControlId(o)??!1:!1),d=e??(i?a?.controlId:void 0),l=s??(t===void 0?a?.labelId:void 0);return{...d!==void 0&&{id:d},...t!==void 0&&{"aria-label":t},...l!==void 0&&{"aria-labelledby":l}}};var ea={default:"woi4bh4 woi4bh3",tile:"woi4bh5 woi4bh3"},cn=({label:e,icon:t,onClick:s,variant:r="default",isDisabled:a,ariaLabel:o,ariaLabelledBy:i,id:d})=>{const l=K({id:d,ariaLabel:o,ariaLabelledBy:i}),p=r==="tile";return(0,n.jsxs)("button",{type:"button",className:ea[r],disabled:a,onClick:s,...l,children:[t!==void 0&&(0,n.jsx)("span",{className:"woi4bh0",children:t}),e!==void 0&&(0,n.jsx)("span",{className:p?"woi4bh2":"woi4bh1",children:e})]})},de=(0,v.createContext)(null),E=()=>{const e=(0,v.useContext)(de);if(!e)throw new Error("An editing section must sit inside an <EditorPanel.Root> bound to a graph — pass it a `handle`, or render the panel inside a <GraphProvider>.");return e},dn=({children:e,onKeyDown:t,...s})=>{const r=(0,v.useContext)(de),a=o=>{if(t?.(o),!r||o.defaultPrevented)return;const i=c.resolveHistoryStep(o.nativeEvent);i&&(o.preventDefault(),i==="undo"?r.undo():r.redo())};return(0,n.jsx)("div",{onKeyDown:a,...s,children:e})},un="keyboard",ee=e=>{const t=(0,v.useRef)(!1),s=(0,v.useRef)(!1),r=()=>{t.current=!1,s.current&&(s.current=!1,e?.())};return{commitAfterChange:()=>{if(t.current){s.current=!0;return}e?.()},commitUnlessHeldKey:a=>{if(a){s.current=!0;return}e?.()},gestureHandlers:{onKeyDown:()=>{t.current=!0},onKeyUp:r,onBlur:a=>{a.relatedTarget instanceof Node&&a.currentTarget.contains(a.relatedTarget)||r()}}}},na="eh8dvc0",ta="eh8dvc1 uz3g760",ra="eh8dvc2 uz3g761";var hn=({value:e,onChange:t,onCommit:s,min:r,max:a,step:o,prefix:i,suffix:d,isDisabled:l,hasError:p,ariaLabel:u,ariaLabelledBy:h,id:f})=>{const g=K({id:f,ariaLabel:u,ariaLabelledBy:h}),{commitUnlessHeldKey:x,gestureHandlers:y}=ee(s);return(0,n.jsx)(xe.NumberField.Root,{className:na,value:e,onValueChange:w=>t(w),onValueCommitted:(w,j)=>{x(j.reason===un)},min:r,max:a,step:o,disabled:l,children:(0,n.jsxs)(dn,{className:ta,"data-error":p===!0,"data-disabled":l===!0?"":void 0,children:[i!==void 0&&(0,n.jsx)("span",{className:"eh8dvc3",children:i}),(0,n.jsx)(xe.NumberField.Input,{className:ra,...y,"aria-invalid":p===!0?!0:void 0,...g}),d!==void 0&&(0,n.jsx)("span",{className:"eh8dvc3",children:d})]})})},aa="_1b7s5f0",W={1:"_1b7s5f1",2:"_1b7s5f2",3:"_1b7s5f3",4:"_1b7s5f4",5:"_1b7s5f5",6:"_1b7s5f6"},oa="_1b7s5f7";var sa=6,mn=({options:e,value:t,onChange:s,onCommit:r,columns:a,itemLayout:o="tile",isDisabled:i,ariaLabel:d,ariaLabelledBy:l,id:p})=>{const u=K({id:p,ariaLabel:d,ariaLabelledBy:l}),h=o==="swatch",{commitAfterChange:f,gestureHandlers:g}=ee(r);return(0,n.jsx)(He.RadioGroup,{className:(0,V.default)(aa,ia(a??e.length)),value:t,onValueChange:x=>{s(x),f()},...g,disabled:i,...u,children:e.map(x=>(0,n.jsxs)(Fe.Radio.Root,{value:x.value,disabled:x.isDisabled,className:(0,V.default)(oa,h&&"_1b7s5f8"),"aria-label":h?x.label:void 0,children:[x.icon,!h&&(0,n.jsx)("span",{className:"_1b7s5f9",children:x.label})]},x.value))})},ia=e=>{switch(Math.min(Math.max(Math.round(e),1),sa)){case 1:return W[1];case 2:return W[2];case 3:return W[3];case 4:return W[4];case 5:return W[5];default:return W[6]}},la="_1g5x15w0 uz3g760",ca="_1g5x15w1",da="_1g5x15w2",Pe="_1g5x15w3",ua="_1g5x15w4",ha="_1g5x15w5",ma="_1g5x15w6",pa="_1g5x15w7";var pn=({options:e,value:t,onChange:s,placeholder:r,isDisabled:a,hasError:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d});return(0,n.jsxs)(H.Select.Root,{value:t,onValueChange:u=>u!==null&&s(u),disabled:a,items:e.map(u=>({value:u.value,label:u.label})),children:[(0,n.jsxs)(H.Select.Trigger,{className:la,"data-error":o===!0,...p,children:[(0,n.jsx)(H.Select.Value,{className:ca,children:u=>ga(e,u,r)}),(0,n.jsx)(H.Select.Icon,{className:Pe,children:(0,n.jsx)(c.ChevronDownIcon,{size:"sm"})})]}),(0,n.jsx)(H.Select.Portal,{container:c.resolvePortalContainer(),children:(0,n.jsx)(c.PortalThemeProvider,{children:(0,n.jsx)(H.Select.Positioner,{className:ua,sideOffset:4,alignItemWithTrigger:!1,children:(0,n.jsx)(H.Select.Popup,{className:ha,children:e.map(u=>(0,n.jsxs)(H.Select.Item,{value:u.value,disabled:u.isDisabled,className:ma,children:[u.icon,(0,n.jsxs)("span",{className:pa,children:[(0,n.jsx)(H.Select.ItemText,{children:u.label}),u.description!==void 0&&(0,n.jsx)("span",{className:"_1g5x15w8",children:u.description})]}),(0,n.jsx)(H.Select.ItemIndicator,{className:Pe,children:(0,n.jsx)(c.CheckIcon,{size:"sm"})})]},u.value))})})})})]})},ga=(e,t,s)=>t===null?(0,n.jsx)("span",{className:da,children:s}):va(e,t),va=(e,t)=>e.find(s=>s.value===t)?.label??t,xa="vod76w0",fa="vod76w1",Ca="vod76w2",ba="vod76w3",Sa="vod76w4",ja="vod76w5";var gn=({value:e,onChange:t,onCommit:s,min:r,max:a,step:o,suffix:i,formatValue:d,isDisabled:l,ariaLabel:p,ariaLabelledBy:u})=>{const h=K({ariaLabel:p,ariaLabelledBy:u},!1),f=ya(e,i,d),{commitUnlessHeldKey:g,gestureHandlers:x}=ee(s);return(0,n.jsxs)("div",{className:xa,children:[(0,n.jsx)(Z.Slider.Root,{className:fa,value:e,onValueChange:y=>t(y),onValueCommitted:(y,w)=>{g(w.reason===un)},min:r,max:a,step:o,disabled:l,children:(0,n.jsx)(Z.Slider.Control,{className:Ca,children:(0,n.jsxs)(Z.Slider.Track,{className:ba,children:[(0,n.jsx)(Z.Slider.Indicator,{className:Sa}),(0,n.jsx)(Z.Slider.Thumb,{className:ja,...x,...h})]})})}),f!==null&&(0,n.jsx)("span",{className:"vod76w6",children:f})]})},ya=(e,t,s)=>s!==void 0?s(e):t!==void 0?`${e}${t}`:null,Ia="_1hyrlw60",Pa="_1hyrlw61",vn=({isChecked:e,onChange:t,isDisabled:s,ariaLabel:r,ariaLabelledBy:a,id:o})=>{const i=K({id:o,ariaLabel:r,ariaLabelledBy:a});return(0,n.jsx)(fe.Switch.Root,{checked:e,onCheckedChange:d=>t(d),disabled:s,className:Ia,...i,children:(0,n.jsx)(fe.Switch.Thumb,{className:Pa})})},wa="uz3g761",Ta="tpcnun0 uz3g760",xn=({value:e,onChange:t,onCommit:s,placeholder:r,isDisabled:a,hasError:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d});return(0,n.jsx)(dn,{className:Ta,"data-error":o===!0,children:(0,n.jsx)(Xn.Input,{className:wa,value:e,onValueChange:u=>t(u),onBlur:s,placeholder:r,disabled:a,"aria-invalid":o===!0?!0:void 0,...p})})},Aa="cnu9yl0",_a="cnu9yl1";var fn=({options:e,value:t,onChange:s,onCommit:r,itemLayout:a="inline",isDisabled:o,ariaLabel:i,ariaLabelledBy:d,id:l})=>{const p=K({id:l,ariaLabel:i,ariaLabelledBy:d}),u=a==="stacked",{commitAfterChange:h,gestureHandlers:f}=ee(r);return(0,n.jsx)(He.RadioGroup,{className:Aa,value:t,onValueChange:g=>{s(g),h()},...f,disabled:o,...p,children:e.map(g=>(0,n.jsxs)(Fe.Radio.Root,{value:g.value,disabled:g.isDisabled,className:(0,V.default)(_a,u&&"cnu9yl2"),"aria-label":La(g,u),children:[g.icon,Cn(g,u)&&(0,n.jsx)("span",{className:"cnu9yl3",children:g.label})]},g.value))})},Cn=(e,t)=>e.icon===void 0||t,La=(e,t)=>{if(!Cn(e,t))return e.label},bn={ToggleGroup:fn,Switch:vn,Slider:gn,RadioGrid:mn,Button:cn,TextField:xn,NumberField:hn,Select:pn},Sn=(0,v.createContext)(bn),Ea=({controls:e,children:t})=>{const s=(0,v.useMemo)(()=>({...bn,...e}),[e]);return(0,n.jsx)(Sn.Provider,{value:s,children:t})},N=()=>(0,v.useContext)(Sn),Na="_12lhx9e0",Ma=({children:e})=>(0,n.jsx)("div",{className:Na,children:e}),Oa="_139ohwv0",D=({children:e})=>(0,n.jsx)("div",{className:Oa,children:e}),jn=(0,v.createContext)(null),Ra=jn.Provider,yn=()=>{const e=(0,v.useContext)(jn);if(!e)throw new Error("A section must be rendered inside <EditorPanel.Root>.");return e},ka="_1jlczkt0",In="data-graphy-editor-panel",Da={List:D,Grid:Ma};function Fa(e){if(e===void 0)return!1;const t=e.split(/\s+/);return t.includes("_1ii3bsb0")||t.includes("_1ii3bsb1")}var Ha=({handle:e,children:t,controls:s,defaultExpandedSection:r=void 0,className:a})=>{const o=c.useGraphHandle(e),{themeClass:i,inlineVarsStyle:d}=c.useThemeContext(),[l,p]=(0,v.useState)(()=>r?[r]:[]),u=(0,v.useMemo)(()=>({expandSection:h=>p([h]),collapseAllSections:()=>p([])}),[]);return(0,n.jsx)(de.Provider,{value:o,children:(0,n.jsx)(Ea,{controls:s,children:(0,n.jsx)(Ra,{value:u,children:(0,n.jsx)(X.Accordion.Root,{[In]:"",className:(0,V.default)(ka,a,{[i]:!Fa(a)}),style:d,value:l,onValueChange:h=>p(h),children:t})})})})},ue={Root:Ha,Controls:Da},we={stack:"pr583x0",grid:"pr583x1"},Te="pr583x2",za="pr583x3",b=({label:e,layout:t="grid",children:s})=>{const r=(0,v.useId)(),a=(0,v.useId)();return e===void 0?(0,n.jsx)("div",{className:we[t],children:(0,n.jsx)("div",{className:Te,children:s})}):(0,n.jsxs)("div",{className:we[t],children:[(0,n.jsx)("label",{id:r,htmlFor:a,className:za,children:e}),(0,n.jsx)("div",{className:Te,children:(0,n.jsx)(ln,{labelId:r,controlId:a,children:s})})]})},Ga=e=>(0,n.jsx)(c.Icon,{...e,children:(0,n.jsx)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6"})})}),he="_40zvwv0",me="_40zvwv1",Va="_40zvwv2",Pn="_40zvwv3",Ka="_40zvwv4 _40zvwv3";var Ba="_40zvwv6";var qa="_40zvwv8",O=({title:e,layout:t="fixed",preview:s,accessory:r,onOpenChange:a,children:o})=>t==="collapsible"?(0,n.jsx)(Wa,{title:e,preview:s,accessory:r,onOpenChange:a,children:o}):t==="inline"&&s===void 0?(0,n.jsx)(Ua,{title:e,accessory:r,children:o}):(0,n.jsxs)("div",{className:he,children:[(0,n.jsxs)("div",{className:me,children:[(0,n.jsx)("span",{className:Pn,children:e}),s!==void 0&&(0,n.jsx)("span",{className:"_40zvwv5",children:s}),r!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:r})]}),(0,n.jsx)("div",{children:o})]}),Ua=({title:e,accessory:t,children:s})=>{const r=(0,v.useId)(),a=(0,v.useId)();return(0,n.jsx)("div",{className:he,children:(0,n.jsxs)("div",{className:me,children:[(0,n.jsx)("label",{id:r,htmlFor:a,className:Ka,children:e}),(0,n.jsx)("span",{className:Ba,children:(0,n.jsx)(ln,{labelId:r,controlId:a,children:s})}),t!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:t})]})})},Wa=({title:e,preview:t,accessory:s,onOpenChange:r,children:a})=>{const o=c.useI18n();return(0,n.jsxs)(X.Accordion.Item,{value:e,className:he,onOpenChange:r,children:[(0,n.jsxs)(X.Accordion.Header,{className:me,render:(0,n.jsx)("div",{}),children:[(0,n.jsx)(X.Accordion.Trigger,{className:Va,"aria-label":o("editor.accessibility.toggleSection",{title:e})}),(0,n.jsx)("span",{className:Pn,children:e}),t!==void 0&&(0,n.jsx)("span",{className:"_40zvwv5",children:t}),s!==void 0&&(0,n.jsx)("span",{className:"_40zvwv7",children:s}),(0,n.jsx)("span",{className:qa,children:(0,n.jsx)(Ga,{size:"sm"})})]}),(0,n.jsx)(X.Accordion.Panel,{children:(0,n.jsx)("div",{children:a})})]})},Za=({title:e,isChecked:t,onToggle:s,isDisabled:r,preview:a,children:o})=>{const{expandSection:i,collapseAllSections:d}=yn(),{Switch:l}=N(),p=h=>{s(h),h?i(e):d()},u=h=>{h&&!t&&r!==!0&&s(!0)};return(0,n.jsx)(O,{title:e,layout:"collapsible",preview:a,onOpenChange:u,accessory:(0,n.jsx)(l,{isChecked:t,onChange:p,isDisabled:r,ariaLabel:e}),children:o})},$a={horizontal:["bottom","top"],vertical:["left","right"]},Xa={left:"editor.axesPanel.position.left",right:"editor.axesPanel.position.right",top:"editor.axesPanel.position.top",bottom:"editor.axesPanel.position.bottom"},Ya={x:"editor.axesPanel.mainAxisSection.xAxis",y:"editor.axesPanel.mainAxisSection.yAxis"},ae=({axis:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{NumberField:d,Switch:l,TextField:p,ToggleGroup:u}=N();if(!o)return null;const h=o.coordSystem.type==="polar"?o.coordSystem.axisMapping[e].geometry:"linear",f=o.config.axes[e],g=o.scales[e],x=g?.spec,y=x?.scaleType==="continuous"?x:void 0;if(h==="circular"||h==="radial"&&y===void 0)return null;const w=x!==void 0&&"reverse"in x?x:void 0,j=x?.scaleType==="continuous"||x?.scaleType==="datetime",C=e==="y"&&y!==void 0&&o.layers.some(S=>S.yScaleType==="primary"&&S.geom==="bar"),P=y?.transform==="log",T=y?.domainMax??null,R=Ja(y),F=(S,z)=>S.map(J=>({value:J,label:z(J)})),L=o.guides.axes.find(S=>S.scaleAestheticKey===e)?.position,k=$a[L==="bottom"||L==="top"||L===void 0&&e==="x"?"horizontal":"vertical"],A=o.guides.legends.drawn.some(S=>k.some(z=>z===S.position)),I=k.map(S=>({value:S,label:i(Xa[S])})),_=F(["auto","edges"],S=>i(S==="edges"?"editor.axesPanel.labelMode.edges":"editor.axesPanel.labelMode.auto")),B=F(["linear","log"],S=>i(S==="log"?"editor.axesPanel.scale.log":"editor.axesPanel.scale.auto")),On=F(["auto","zero","custom"],S=>i(S==="zero"?"editor.axesPanel.startFrom.zero":S==="custom"?"editor.axesPanel.startFrom.custom":"editor.axesPanel.startFrom.auto")),Rn=F(["auto","custom"],S=>i(S==="custom"?"editor.axesPanel.endAt.custom":"editor.axesPanel.endAt.auto")),kn=F(["no","yes"],S=>i(S==="yes"?"editor.axesPanel.yesNo.yes":"editor.axesPanel.yesNo.no")),Dn=S=>{a.commands.dispatch(new m.SetAxisVisibilityCommand({axis:e,isVisible:S}))},Fn=S=>{a.commands.dispatch(new m.SetAxisLabelCommand({axis:e,label:S===""?null:S}),{transient:!0})},Hn=S=>{a.commands.dispatch(new m.SetAxisTicksVisibilityCommand({axis:e,isVisible:S}))},zn=S=>{a.commands.dispatch(new m.SetAxisTickModeCommand({axis:e,tickMode:S==="edges"?"edges":"auto"}))},Gn=S=>{a.commands.dispatch(new m.SetScaleReverseCommand({scaledAesthetic:e,reverse:S==="yes"}))},Vn=S=>{a.commands.dispatch(new m.SetScaleTransformCommand({scaledAesthetic:e,transform:S==="log"?"log":"linear"}))},ve=S=>{a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,...S}),{transient:!0})},Kn=S=>{S!==null&&ve({domainMin:S})},Bn=S=>{S!==null&&ve({domainMax:S})},qn=S=>{if(y){if(S==="custom"){y.zero&&a.commands.dispatch(new m.SetScaleZeroCommand({scaledAesthetic:e,zero:!1})),a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMin:Ae(g?.domain,"start")}));return}y.domainMin!==null&&a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMin:null})),a.commands.dispatch(new m.SetScaleZeroCommand({scaledAesthetic:e,zero:S==="zero"}))}},Un=S=>{const z=S==="custom"?Ae(g?.domain,"end"):null;a.commands.dispatch(new m.SetScaleDomainCommand({scaledAesthetic:e,domainMax:z}))},Wn=S=>{const z=k.find(J=>J===S);z&&a.commands.dispatch(new m.SetAxisPositionCommand({axis:e,position:z}))};return(0,n.jsx)(O,{title:t??i(Ya[e]),layout:s,preview:r,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.visible"),children:(0,n.jsx)(l,{isChecked:f.isVisible,onChange:Dn})}),h==="linear"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.title"),children:(0,n.jsx)(p,{value:f.label??"",onChange:Fn,onCommit:a.commands.seal})}),(0,n.jsx)(b,{label:i("editor.axesPanel.controls.ticks"),children:(0,n.jsx)(l,{isChecked:f.ticks.isVisible,onChange:Hn})})]}),j&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.labels"),children:(0,n.jsx)(u,{value:f.ticks.mode,options:_,onChange:zn})}),y&&h==="linear"&&!A&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.position"),children:(0,n.jsx)(u,{value:L??f.position,options:I,onChange:Wn})}),w!==void 0&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.reverse"),children:(0,n.jsx)(u,{value:w.reverse===!0?"yes":"no",options:kn,onChange:Gn})}),y&&!C&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.scale"),children:(0,n.jsx)(u,{value:P?"log":"linear",options:B,onChange:Vn})}),y&&!P&&(0,n.jsxs)(n.Fragment,{children:[!C&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.startFrom"),children:(0,n.jsx)(u,{value:R,options:On,onChange:qn})}),R==="custom"&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.value"),children:(0,n.jsx)(d,{value:y.domainMin??null,onChange:Kn,onCommit:a.commands.seal})})]}),(0,n.jsx)(b,{label:i("editor.axesPanel.controls.endAt"),children:(0,n.jsx)(u,{value:T===null?"auto":"custom",options:Rn,onChange:Un})}),T!==null&&(0,n.jsx)(b,{label:i("editor.axesPanel.controls.value"),children:(0,n.jsx)(d,{value:T,onChange:Bn,onCommit:a.commands.seal})})]})]})})},Ja=e=>e===void 0?"auto":e.domainMin!==null&&e.domainMin!==void 0?"custom":e.zero===!0?"zero":"auto",Ae=(e,t)=>{const s=t==="start"?e?.[0]:e?.[e.length-1];return typeof s=="number"?s:0},pe=({value:e,onChange:t})=>{const s=E(),r=c.useI18n(),{TextField:a}=N(),o=e!==null&&typeof e!="string",i=d=>t(d===""?null:d);return(0,n.jsx)(b,{label:r("editor.elementsPanel.contentValue"),children:(0,n.jsx)(a,{value:typeof e=="string"?e:"",onChange:i,onCommit:s.commands.seal,isDisabled:o})})},wn=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"caption",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentCaptionCommand({caption:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.footerSection.caption"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isCaptionVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.caption,onChange:p})]})})},_e=/^[a-z][a-z\d+.-]*:/i,Qa={},Tn=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=p=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"source",isVisible:p}))};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.sourceSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isSourceVisible,onChange:l})}),(0,n.jsx)(eo,{source:d.source??Qa})]})})},eo=({source:e})=>{const t=E(),s=c.useI18n(),{TextField:r}=N(),a=l=>{const p=(l.label??"")!==""||(l.url??"")!=="";t.commands.dispatch(new m.SetContentSourceCommand({source:p?l:null}),{transient:!0})},o=()=>{const l=e.url??"";l!==""&&!_e.test(l)&&a({...e,url:`https://${l}`}),t.commands.seal()},i=l=>a({...e,url:l}),d=l=>a({...e,label:l});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:s("editor.elementsPanel.sourceSection.url"),children:(0,n.jsx)(r,{value:e.url??"",onChange:i,onCommit:o,hasError:_e.test(e.url??"")&&!(0,m.isSafeUrl)(e.url)})}),(0,n.jsx)(b,{label:s("editor.elementsPanel.sourceSection.name"),children:(0,n.jsx)(r,{value:e.label??"",onChange:d,onCommit:t.commands.seal})})]})},An=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"subtitle",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentSubtitleCommand({subtitle:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.headerSection.subtitle"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isSubtitleVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.subtitle,onChange:p})]})})},oe=[.8,1,1.2,1.4,1.6,1.8,2,2.5,3,4],no=oe.length/2,_n=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{RadioGrid:i}=N();if(!a)return null;const{textScale:d}=a.config.appearance,l=h=>o("editor.elementsPanel.textSizeSection.scaleFormat",{value:`${h}`}),p=oe.map(h=>({value:`${h}`,label:l(h)})),u=h=>{const f=oe.find(g=>`${g}`===h);f!==void 0&&r.commands.dispatch(new m.SetAppearanceTextScaleCommand({textScale:f}))};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.textSizeSection.title"),layout:t,preview:s??l(d),children:(0,n.jsx)(i,{value:`${d}`,options:p,columns:no,onChange:u,ariaLabel:o("editor.elementsPanel.textSizeSection.title")})})},Ln=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i}=N();if(!a)return null;const d=a.config.content,l=u=>{r.commands.dispatch(new m.ToggleContentVisibilityCommand({slot:"title",isVisible:u}))},p=u=>{r.commands.dispatch(new m.SetContentTitleCommand({title:u}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.elementsPanel.headerSection.toggleTitle"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.elementsPanel.contentVisible"),children:(0,n.jsx)(i,{isChecked:d.isTitleVisible,onChange:l})}),(0,n.jsx)(pe,{value:d.title,onChange:p})]})})},to=({children:e,...t})=>(0,n.jsx)(ue.Root,{...t,children:e??(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ln,{}),(0,n.jsx)(An,{}),(0,n.jsx)(wn,{}),(0,n.jsx)(Tn,{}),(0,n.jsx)(_n,{})]})}),ro=({children:e,...t})=>(0,n.jsx)(ue.Root,{...t,children:e??(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ae,{axis:"x"}),(0,n.jsx)(ae,{axis:"y"})]})}),ne=e=>`${e}px`,En=e=>`${Math.round(e*100)}%`,ao=e=>`${e}°`,oo=24,Le=["dim","desaturate"],so=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,ToggleGroup:d}=N();if(!a)return null;const{cornerRadius:l}=a.config.appearance,p=(0,m.readHighlightDimStyle)(a.spec),u=Le.map(g=>({value:g,label:o(g==="dim"?"editor.highlighting.highlightStyle.tint":"editor.highlighting.highlightStyle.grey")})),h=g=>{r.commands.dispatch(new m.SetAppearanceCornerRadiusCommand({cornerRadius:g}),{transient:!0})},f=g=>{const x=Le.find(y=>y===g);x&&r.commands.dispatch(new m.SetHighlightDimStyleCommand({dimStyle:x}))};return(0,n.jsx)(O,{title:e??o("editor.colorPanel.appearanceSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.colorPanel.borderSection.cornerRadius"),children:(0,n.jsx)(i,{value:l,min:0,max:oo,step:1,formatValue:ne,onChange:h,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.colorPanel.appearanceSection.highlightStyle"),children:(0,n.jsx)(d,{value:p,options:u,onChange:f})})]})})},ge=(e,t)=>{const{colorScheme:s}=c.useThemeContext();return(0,v.useMemo)(()=>{const r=e?.layers.find(a=>a.id===t);return r===void 0?null:(0,m.createStyleResolver)({colorScheme:s}).geomReaders(r)},[e,t,s])},io=.05,lo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,ToggleGroup:d}=N(),l=a?(0,m.findLayerByGeom)(a.spec.layers,"bar"):void 0,p=ge(a,l?.id??null);if(!a||!l||a.coordSystem.type==="polar"&&a.coordSystem.bandAxis===null)return null;const u=g=>{r.commands.dispatch(new m.SetBarWidthCommand({layerId:l.id,width:g}),{transient:!0})},h=g=>{const x=m.BORDER_RADIUS_TOKENS.find(y=>y===g);x&&r.commands.dispatch(new m.SetBarBorderRadiusCommand({layerId:l.id,borderRadius:x}))},f=m.BORDER_RADIUS_TOKENS.map(g=>({value:g,label:o(`editor.graphPanel.barSection.roundingOptions.${g}`)}));return(0,n.jsx)(O,{title:e??o("editor.graphPanel.barSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.barSection.thickness"),children:(0,n.jsx)(i,{value:l.params.width,min:m.MIN_BAR_WIDTH,max:m.MAX_BAR_WIDTH,step:io,formatValue:En,onChange:u,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.graphPanel.barSection.rounding"),layout:"stack",children:(0,n.jsx)(d,{value:p?.get("borderRadius")??m.DEFAULT_BAR_BORDER_RADIUS,options:f,onChange:h})})]})})},co=({layerId:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{Switch:d}=N();if(!o)return null;const l=e===void 0?o.spec.layers[0]:o.spec.layers.find(L=>L.id===e);if(!l)return null;const{showDataLabels:p,format:u,showStackTotals:h,showCategoryLabels:f}=l.dataLabels,g=o.coordSystem.type==="polar",x=l.geom==="bar",y=l.position==="stack"||l.position==="fill",w=x&&!g&&l.position==="stack",j=x&&(!g||p),C=x||l.geom==="area"&&y;if(!(0,m.canPlaceDataLabels)(l.geom,o.coordSystem.type))return null;const P=L=>{const k=new m.ToggleDataLabelsCommand({layerId:l.id,showDataLabels:L});a.commands.dispatch(k)},T=L=>{const k=new m.SetDataLabelsFormatCommand({layerId:l.id,format:L?"percentage":"absolute"});a.commands.dispatch(k)},R=L=>{const k=new m.ToggleStackTotalsCommand({layerId:l.id,showStackTotals:L});a.commands.dispatch(k)},F=L=>{const k=new m.ToggleCategoryLabelsCommand({layerId:l.id,showCategoryLabels:L});a.commands.dispatch(k)};return(0,n.jsx)(O,{title:t??i("editor.graphPanel.graphOptionsSection.title"),layout:s,preview:r,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.dataLabels"),children:(0,n.jsx)(d,{isChecked:p,onChange:P})}),p&&C&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.showPercentages"),children:(0,n.jsx)(d,{isChecked:u==="percentage",onChange:T})}),w&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.stackTotals"),children:(0,n.jsx)(d,{isChecked:h,onChange:R})}),j&&(0,n.jsx)(b,{label:i("editor.graphPanel.graphOptions.categoryLabels"),children:(0,n.jsx)(d,{isChecked:f,onChange:F})})]})})},Ee=["solid","dashed","dotted"],uo=Number.parseFloat(c.chromeTokens.gridLineWidth),ho=8,mo=0,po=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i,Switch:d,ToggleGroup:l}=N(),{themeValues:p}=c.useThemeContext();if(!a)return null;const u=a.guides.axes.filter(go);if(u.length===0)return null;const h=a.coordSystem.type!=="polar",f=u.some(C=>C.gridVisible),g=a.config.axes.y.grid,x=Ee.map(C=>({value:C,label:o(`editor.graphPanel.gridSection.lineStyles.${C}`)})),y=C=>P=>{r.commands.dispatch(new m.SetGridVisibilityCommand({axis:C,isVisible:P}))},w=C=>{const P=Ee.find(T=>T===C);P&&r.commands.dispatch(new m.SetGridLineStyleCommand({axis:"both",lineStyle:P}))},j=C=>{r.commands.dispatch(new m.SetGridLineWidthCommand({axis:"both",lineWidth:C}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.gridSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[u.map(C=>(0,n.jsx)(b,{label:o(vo(C)),children:(0,n.jsx)(d,{isChecked:C.gridVisible,onChange:y(C.scaleAestheticKey)})},C.scaleAestheticKey)),h&&f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.gridSection.gridStyle"),children:(0,n.jsx)(l,{value:g.lineStyle,options:x,onChange:w})}),(0,n.jsx)(b,{label:o("editor.graphPanel.gridSection.gridThickness"),children:(0,n.jsx)(i,{value:g.lineWidth??c.parsePx(p.gridLineWidth,uo),min:mo,max:ho,step:.5,formatValue:ne,onChange:j,onCommit:r.commands.seal})})]})]})})},go=e=>e.scaleAestheticKey==="x"||e.scaleAestheticKey==="y",vo=e=>e.geometry==="radial"?"editor.graphPanel.gridSection.rings":e.geometry==="circular"?"editor.graphPanel.gridSection.spokes":e.scaleAestheticKey==="x"?"editor.graphPanel.gridSection.verticalGridLines":"editor.graphPanel.gridSection.horizontalGridLines",xo="total",Nn=["total","average","current"],fo=["total"],Ne=["previous","first"],Me=["auto","small","medium","large"],Co=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Switch:i,ToggleGroup:d}=N();if(!a)return null;const l=a.config.headline,p=l.show!=="none",u=a.coordSystem,h=u.type==="polar",f=u.type==="polar"&&u.innerRadius>0,g=a.layers.some(I=>I.summary.grandTotal!==void 0);if(h&&!g)return null;const x=h?fo:Nn,y=a.guides.headline,w=y?.kind==="perGroup"&&y.items.some(I=>I.comparison!==null),j=x.map(I=>({value:I,label:o(`editor.graphPanel.headlineNumberSection.metrics.${I}`)})),C=Ne.map(I=>({value:I,label:o(`editor.graphPanel.headlineNumberSection.comparison.${I}`)})),P=Me.map(I=>({value:I,label:o(I==="auto"?"editor.graphPanel.numberFormat.options.auto":`editor.graphPanel.headlineNumberSize.sizes.${I}`)})),T=[{value:"above",label:o("editor.graphPanel.headlineNumberSection.position.above")},{value:"center",label:o("editor.graphPanel.headlineNumberSection.position.center")}],R=I=>{r.commands.dispatch(new m.SetHeadlineShowCommand({show:I?xo:"none"}))},F=I=>{const _=x.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineShowCommand({show:_}))},L=I=>{const _=Ne.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineCompareWithCommand({compareWith:_}))},k=I=>{const _=Me.find(B=>B===I);_&&r.commands.dispatch(new m.SetHeadlineSizeCommand({size:_}))},A=I=>{r.commands.dispatch(new m.SetHeadlinePositionCommand({position:I==="center"?"center":"above"}))};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.headlineNumberSection.title"),layout:t,preview:s??bo(o,l.show),children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.toggle"),children:(0,n.jsx)(i,{isChecked:p,onChange:R})}),p&&(0,n.jsxs)(n.Fragment,{children:[j.length>1&&(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.metricLabel"),layout:"stack",children:(0,n.jsx)(d,{value:l.show,options:j,onChange:F})}),w&&(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSection.compareWithLabel"),layout:"stack",children:(0,n.jsx)(d,{value:(0,m.resolveComparisonBasis)(l.compareWith),options:C,onChange:L})}),(0,n.jsx)(b,{label:o("editor.graphPanel.headlineNumberSize.sizeLabel"),children:(0,n.jsx)(d,{value:l.size,options:P,onChange:k})}),f&&(0,n.jsx)(b,{label:o("editor.axesPanel.controls.position"),children:(0,n.jsx)(d,{value:l.position,options:T,onChange:A})})]})]})})},bo=(e,t)=>{const s=Nn.find(r=>r===t);return s&&e(`editor.graphPanel.headlineNumberSection.metrics.${s}`)},re=["top","bottom","left","right","none"],Oe=["auto","start","center","end"],Re=["auto","pill","direct"],So=({positions:e,title:t,layout:s="collapsible",preview:r})=>{const a=E(),o=c.useHandleCompiled(a),i=c.useI18n(),{ToggleGroup:d}=N();if(!o)return null;const l=o.config.legend.position,p=e??re,u=o.guides.legends.drawn[0],h=(0,m.canAnchorDirectLabels)({legendPosition:o.guides.legends.position,coordSystem:o.coordSystem,layers:o.layers}),f=o.guides.headline?.kind==="perGroup",g=o.guides.colorGroups.length>0;if(l==="auto"&&u===void 0&&!h&&(f||!g))return null;const x=u?.position??"none",y=l==="auto"?x:l,w=re.filter(A=>A===y||p.includes(A)).map(A=>({value:A,label:i(`editor.graphPanel.legendSection.${A}`)})),j=A=>{const I=re.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendPositionCommand({position:I}))},C=A=>{const I=Oe.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendAlignCommand({align:I}))},P=A=>{const I=Re.find(_=>_===A);I&&a.commands.dispatch(new m.SetLegendDisplayCommand({display:I}))},T=Oe.map(A=>({value:A,label:i(`editor.graphPanel.legendSection.align.${A}`)})),R=Re.map(A=>({value:A,label:i(`editor.graphPanel.legendSection.display.${A}`)})),F=t??i("editor.graphPanel.legendSection.title"),L=w.find(A=>A.value===y)?.label,k=u!==void 0;return(0,n.jsx)(O,{title:F,layout:s,preview:r??L,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:i("editor.axesPanel.controls.position"),layout:"stack",children:(0,n.jsx)(d,{value:y,options:w,onChange:j})}),k&&(0,n.jsx)(b,{label:i("editor.graphPanel.legendSection.alignLabel"),layout:"stack",children:(0,n.jsx)(d,{value:o.config.legend.align,options:T,onChange:C})}),h&&(0,n.jsx)(b,{label:i("editor.graphPanel.legendSection.displayLabel"),layout:"stack",children:(0,n.jsx)(d,{value:o.config.legend.display,options:R,onChange:P})})]})})},jo=1,yo=20,Io=.5,Mn=({layerId:e})=>{const t=E(),s=c.useHandleCompiled(t),{Slider:r}=N(),a=ge(s,e);if(!s)return null;const o=i=>{const d=new m.SetPointSizeCommand({layerId:e,size:i});t.commands.dispatch(d,{transient:!0})};return(0,n.jsx)(r,{value:a?.get("size")??m.DEFAULT_POINT_SIZE,min:jo,max:yo,step:Io,formatValue:ne,onChange:o,onCommit:t.commands.seal})},Po=1,wo=10,To=.1,Ao=["gap","zero","connect"],_o=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Select:i,Slider:d,Switch:l,ToggleGroup:p}=N(),u=a?.spec.layers??[],h=(0,m.findLayerByGeom)(u,"line","area"),f=ge(a,h?.id??null);if(!a||!h)return null;const g=a.coordSystem.type==="polar",x=No(o,h),y=Eo(h,u),w=ke(a.spec,h.geom,"strokeWidth",h.id),j=typeof w=="number",C=h.geom==="line"?h:void 0,P=[{value:"auto",label:o("editor.graphPanel.numberFormat.options.auto")},{value:"custom",label:o("editor.graphPanel.numberFormat.options.custom")}],T=I=>{r.commands.dispatch(new m.ToggleLinePointsVisibilityCommand({layerId:h.id,showPoints:I}))},R=I=>{C&&r.commands.dispatch(new m.ToggleLineFillCommand({layerId:C.id,showFill:I}))},F=I=>{r.commands.dispatch(new m.SetLineInterpolationCommand({layerId:h.id,interpolate:I?"catmull-rom":"linear"}))},L=I=>{const _=f?.get("strokeWidth")??m.DEFAULT_STROKE_WIDTH;r.commands.dispatch(new m.SetLineWidthCommand({layerId:h.id,lineWidth:I==="custom"?_:null}))},k=I=>{r.commands.dispatch(new m.SetLineWidthCommand({layerId:h.id,lineWidth:I}),{transient:!0})},A=I=>{const _=Lo(I);_&&r.commands.dispatch(new m.SetLineMissingValuesCommand({layerId:h.id,missingValues:_}))};return(0,n.jsx)(O,{title:e??o("editor.fineTunePanel.lineStyleSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.showPoints"),children:(0,n.jsx)(l,{isChecked:y!==void 0,onChange:T})}),y&&(0,n.jsx)(b,{label:o("editor.graphPanel.pointSize.label"),children:(0,n.jsx)(Mn,{layerId:y.id})}),C&&!g&&(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.lineFill"),children:(0,n.jsx)(l,{isChecked:ke(a.spec,"line","fillAlpha",C.id)!==void 0,onChange:R})}),!g&&(0,n.jsx)(b,{label:o("editor.graphPanel.graphOptions.smoothLines"),children:(0,n.jsx)(l,{isChecked:h.params.interpolate==="catmull-rom",onChange:F})}),(0,n.jsx)(b,{label:o("editor.graphPanel.lineThickness.label"),children:(0,n.jsx)(p,{value:j?"custom":"auto",options:P,onChange:L})}),j&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(d,{value:w,min:Po,max:wo,step:To,formatValue:ne,onChange:k,onCommit:r.commands.seal})}),!g&&x.length>1&&(0,n.jsx)(b,{label:o("editor.fineTunePanel.detailSection.missingValues"),children:(0,n.jsx)(i,{value:h.params.missingValues,options:x,onChange:A})})]})})},Lo=e=>Ao.find(t=>t===e),ke=(e,t,s,r)=>(0,m.findStyleRule)(e.styles.overrides,(0,m.buildLayerStyleAddress)(t,r))?.declarations?.[s],Eo=(e,t)=>(0,m.filterLayersByGeoms)(t,"point").find(s=>(0,m.isCompanionLayer)(s,[e])),No=(e,t)=>{const s=[{value:"gap",label:e("editor.graphPanel.treatEmptyValues.leaveGap.label")},{value:"zero",label:e("editor.graphPanel.treatEmptyValues.fillZero.label")}];return t.position!=="stack"&&t.position!=="fill"&&s.push({value:"connect",label:e("editor.graphPanel.treatEmptyValues.connectGaps.label")}),t.geom==="area"?s.filter(r=>r.value!=="gap"):s},Mo="k",Oo=2,Ro=0,ko=5,se=[{value:"k",labelKey:"thousands"},{value:"m",labelKey:"millions"},{value:"b",labelKey:"billions"}],Do=["auto","none"],Fo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{NumberField:i,ToggleGroup:d}=N();if(!a)return null;const{abbreviation:l,decimals:p}=a.config.numberFormat,u=Ho(l)!==void 0,h=p!=="auto",f=P=>P.map(T=>({value:T,label:o(`editor.graphPanel.numberFormat.options.${T}`)})),g=se.map(({value:P,labelKey:T})=>({value:P,label:o(`common.abbreviations.${T}`)})),x=P=>{r.commands.dispatch(new m.SetNumberFormatAbbreviationCommand({abbreviation:P}))},y=P=>{const T=Do.find(R=>R===P);x(T??Mo)},w=P=>{const T=se.find(R=>R.value===P);T&&x(T.value)},j=P=>{r.commands.dispatch(new m.SetNumberFormatDecimalsCommand({decimals:P==="custom"?Oo:"auto"}))},C=P=>{P!==null&&r.commands.dispatch(new m.SetNumberFormatDecimalsCommand({decimals:P}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.numberFormatSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.abbreviationLabel"),children:(0,n.jsx)(d,{value:u?"custom":l,options:f(["auto","none","custom"]),onChange:y})}),u&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(d,{value:l,options:g,onChange:w})}),(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.decimalPlacesLabel"),children:(0,n.jsx)(d,{value:h?"custom":"auto",options:f(["auto","custom"]),onChange:j})}),h&&(0,n.jsx)(b,{label:o("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(i,{value:p,min:Ro,max:ko,onChange:C,onCommit:r.commands.seal})})]})})},Ho=e=>se.find(t=>t.value===e),zo=({title:e,layout:t="collapsible",preview:s})=>{const r=c.useHandleCompiled(E()),a=c.useI18n();if(!r)return null;const o=Go(r.spec.layers);return o?(0,n.jsx)(O,{title:e??a("editor.graphPanel.pointSize.label"),layout:t,preview:s,children:(0,n.jsx)(D,{children:(0,n.jsx)(b,{label:a("editor.graphPanel.numberFormat.valueLabel"),children:(0,n.jsx)(Mn,{layerId:o.id})})})}):null},Go=e=>{const t=(0,m.filterLayersByGeoms)(e,"line","area");return(0,m.filterLayersByGeoms)(e,"point").find(s=>!(0,m.isCompanionLayer)(s,t))},Vo=.9,Ko=360,Bo=.05,qo=15,Uo=({title:e,layout:t="collapsible",preview:s})=>{const r=E(),a=c.useHandleCompiled(r),o=c.useI18n(),{Slider:i}=N();if(!a||a.spec.coords.coordType!=="polar")return null;const{innerRadius:d,startAngle:l}=a.spec.coords.params,p=h=>{r.commands.dispatch(new m.SetPolarInnerRadiusCommand({innerRadius:h}),{transient:!0})},u=h=>{r.commands.dispatch(new m.SetPolarStartAngleCommand({startAngle:h}),{transient:!0})};return(0,n.jsx)(O,{title:e??o("editor.graphPanel.polarSection.title"),layout:t,preview:s,children:(0,n.jsxs)(D,{children:[(0,n.jsx)(b,{label:o("editor.graphPanel.polarSection.innerRadius"),children:(0,n.jsx)(i,{value:d,min:0,max:Vo,step:Bo,formatValue:En,onChange:p,onCommit:r.commands.seal})}),(0,n.jsx)(b,{label:o("editor.graphPanel.polarSection.startAngle"),children:(0,n.jsx)(i,{value:l,min:0,max:Ko-1,step:qo,formatValue:ao,onChange:u,onCommit:r.commands.seal})})]})})};exports.AppearanceSection=so;exports.AxesPanel=ro;exports.AxisSection=ae;exports.BarSection=lo;exports.Button=cn;exports.CaptionSection=wn;exports.EditableGraphRenderer=Qr;exports.EditorPanel=ue;exports.ElementsPanel=to;exports.GraphOptionsSection=co;exports.GridSection=po;exports.HeadlineSection=Co;exports.IntlProvider=c.IntlProvider;exports.LegendSection=So;exports.LineSection=_o;exports.NumberField=hn;exports.NumberFormatSection=Fo;exports.PANEL_ROOT_ATTRIBUTE=In;exports.PointSection=zo;exports.PolarSection=Uo;exports.RadioGrid=mn;exports.Row=b;exports.Section=O;exports.Select=pn;exports.Slider=gn;exports.SourceSection=Tn;exports.SubtitleSection=An;exports.Switch=vn;exports.TextField=xn;exports.TextSizeSection=_n;exports.TitleSection=Ln;exports.ToggleGroup=fn;exports.ToggledSection=Za;exports.useControls=N;exports.usePanelExpansion=yn;exports.usePanelGraph=E;
|
package/dist/editable.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as _e, D as he, E as Pt, F as It, I as xt, L as ke, M as es, N as T, Q as Tt, S as J, V as se, Z as At, b as M, c as Lt, d as W, et as Nt, f as ge, h as Cn, i as Ot, k as Me, l as Et, m as _t, n as F, o as Sn, p as Ae, r as kt, rt as B, s as Mt, t as Rt, tt as G, u as ve, v as Dt, x as X, y as Se } from "./history-chords-
|
|
1
|
+
import { B as _e, D as he, E as Pt, F as It, I as xt, L as ke, M as es, N as T, Q as Tt, S as J, V as se, Z as At, b as M, c as Lt, d as W, et as Nt, f as ge, h as Cn, i as Ot, k as Me, l as Et, m as _t, n as F, o as Sn, p as Ae, r as kt, rt as B, s as Mt, t as Rt, tt as G, u as ve, v as Dt, x as X, y as Se } from "./history-chords-DdGqrRWz.js";
|
|
2
2
|
import { g as zt } from "./font-values-CPxYeqns.js";
|
|
3
3
|
import { AddAnnotationCommand as ye, AddHighlightCommand as Ft, BORDER_RADIUS_TOKENS as We, CONSTANT_VARIABLES as Ht, DEFAULT_BAR_BORDER_RADIUS as Vt, DEFAULT_POINT_SIZE as Kt, DEFAULT_STROKE_WIDTH as Gt, DIFFERENCE_ARROW_DEFAULTS as Bt, MAX_BAR_WIDTH as Ut, MIN_BAR_WIDTH as qt, RESTING_HOVER_STATE as yn, RemoveAnnotationCommand as Re, RemoveHighlightCommand as Wt, SetAppearanceCornerRadiusCommand as $t, SetAppearanceTextScaleCommand as Zt, SetAxisLabelCommand as Xt, SetAxisPositionCommand as jt, SetAxisTickModeCommand as Yt, SetAxisTicksVisibilityCommand as Qt, SetAxisVisibilityCommand as Jt, SetBarBorderRadiusCommand as er, SetBarWidthCommand as nr, SetContentCaptionCommand as tr, SetContentSourceCommand as rr, SetContentSubtitleCommand as ar, SetContentTitleCommand as or, SetDataLabelsFormatCommand as ir, SetGridLineStyleCommand as lr, SetGridLineWidthCommand as sr, SetGridVisibilityCommand as cr, SetHeadlineCompareWithCommand as dr, SetHeadlinePositionCommand as hr, SetHeadlineShowCommand as $e, SetHeadlineSizeCommand as ur, SetHighlightDimStyleCommand as mr, SetLegendAlignCommand as pr, SetLegendDisplayCommand as gr, SetLegendPositionCommand as vr, SetLineInterpolationCommand as fr, SetLineMissingValuesCommand as br, SetLineWidthCommand as Ze, SetNumberFormatAbbreviationCommand as Cr, SetNumberFormatDecimalsCommand as Xe, SetPointSizeCommand as Sr, SetPolarInnerRadiusCommand as yr, SetPolarStartAngleCommand as wr, SetScaleDomainCommand as pe, SetScaleReverseCommand as Pr, SetScaleTransformCommand as Ir, SetScaleZeroCommand as je, ToggleCategoryLabelsCommand as xr, ToggleContentVisibilityCommand as we, ToggleDataLabelsCommand as Tr, ToggleLineFillCommand as Ar, ToggleLinePointsVisibilityCommand as Lr, ToggleStackTotalsCommand as Nr, UpdateAnnotationCommand as wn, areAnchorsEqual as Pn, areEndpointsComparable as Or, buildEditMenuTriggerRegion as Er, buildLayerStyleAddress as _r, buildObservationAnchor as kr, buildObservationPredicate as Mr, canAnchorDirectLabels as Rr, canPlaceDataLabels as Dr, createObservationAnchorParser as zr, createStyleResolver as Fr, extractVariableName as Hr, filterLayersByGeoms as Le, findHighlightsAtObservation as Vr, findLayerByGeom as In, findObservationAttachment as Kr, findStyleRule as Gr, formatDifferenceLabel as Br, getColor as Ur, hasMultipleGroups as qr, inferDifferenceArrowEndpoints as Wr, isCompanionLayer as xn, isObservationAttachmentKind as $r, isPointWithinEditMenuTrigger as Tn, isSafeUrl as Zr, projectAnchorToPanel as Xr, readHighlightDimStyle as jr, resolveComparisonBasis as Yr, resolveObservationPoint as Ne, stepDifferenceArrowEndpoint as Qr, toPanelCursor as De } from "@graphysdk/viz-engine";
|
|
4
4
|
import { createContext as ue, useCallback as fe, useContext as ae, useEffect as z, useId as de, useMemo as O, useRef as be, useState as $ } from "react";
|