import{r as m}from"./vendor-react-wBh_31cN.js";import{h as E,aO as L,p as S,aP as v,m as C}from"./index-dNe6i2rS.js";import{a as k}from"./always-oSAuSdys.js";const u={")":"0","!":"1","@":"'",'"':"'","#":"3","£":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9","~":"#",_:"-","+":"=",":":";","<":",",">":".","?":"/","|":"\\","{":"[","}":"]"},w={"⌥":"alt",option:"alt","⇧":"shift","⌃":"control",ctrl:"control","⌘":"meta",cmd:"meta",command:"meta",mod:"meta",esc:"escape"},K=e=>e.replace(/\+/g,(t,o)=>o===0?t:" ").split(/\s/),P=e=>(typeof e=="string"?[e]:e).reduce((o,r)=>(o.push(K(r.toLowerCase()).reduce((a,n,s,c)=>(c.length===1&&u[n]&&o.push(["shift",u[n]]),w[n]?a.push(w[n]):n!=="then"&&a.push(n),a),[])),o),[]),y=(e,t)=>t.some(o=>e.size===o.size&&!Array.from(e).some(r=>!o.has(r))),h=e=>{const t=e.key.toLowerCase();return u[t]?u[t]:t},g=e=>{const t=e.target;return t.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(t.tagName)&&!(t!=null&&t.readOnly)},T=(e,t,o=[])=>{const r=m.useCallback(t,[t,...o]),a=m.useMemo(()=>P(e).map(l=>new Set(l)),[e]),n=m.useMemo(()=>new Set,[]),s=m.useMemo(()=>new Set,[]),c=m.useRef(null);function d(l){if(g(l))return;const b=h(l);n.add(b),s.add(b),c.current&&(clearTimeout(c.current),c.current=null),c.current=setTimeout(()=>{s.clear()},400),(y(n,a)||s.size>1&&y(s,a))&&(s.clear(),setTimeout(()=>r(l),0))}function f(l){if(g(l)){n.clear();return}n.delete(h(l))}function p(){n.clear()}m.useEffect(()=>(window.addEventListener("keydown",d),window.addEventListener("keyup",f),window.addEventListener("blur",p),()=>{window.removeEventListener("keydown",d),window.removeEventListener("keyup",f),window.removeEventListener("blur",p)}),[r])},z=(e,t,o)=>{var s,c;const[r,a]=e.split(".");let n;return r&&a&&(n=(c=(s=i==null?void 0:i[r])==null?void 0:s.hotkeys[a])==null?void 0:c.command),n||(n=e),T(n,t,o),n},i={general:{title:"General",hotkeys:{search:{label:"Search",command:"⌘ P"},shortcut:{label:"Switch between Shortcuts",command:"⇧ k"},recent:{label:"Switch between Recently Opend",command:"⇧ r"},h:{label:"Home",command:"⇧ h"},fg:{label:"Feature Group List",command:"⇧ f g"},nfg:{label:"Create New Feature Group",command:"⇧ n f g"},fv:{label:"Feature View List",command:"⇧ f v"},sc:{label:"Storage Connector List",command:"⇧ s c"},jp:{label:"Jupyter",command:"⇧ j p"},jb:{label:"Job List",command:"⇧ j b"},airflow:{label:"Airflow",command:"⇧ a f"},ps:{label:"Project Settings",command:"⇧ p s"},m:{label:"Model Registry",command:"⇧ m",onlyDataScinenceProfile:!0},d:{label:"Deployments",command:"⇧ d",onlyDataScinenceProfile:!0},fb:{label:"File Browser",command:"⇧ f b"},git:{label:"Git",command:"⇧ g i t"},python:{label:"Python",command:"⇧ p y"},qe:{label:"Query Engine",command:"⇧ q e"},su:{label:"Superset",command:"⇧ s u"},help:{label:"Help",command:"?"}}}};function H(e,t){const o=E(v("."),([r,a])=>i[r].hotkeys[a],L(k(!!t),S(t)));return typeof e=="string"?o(e):C(o,e)}function A(e){return H(e,"command")}export{i as H,H as a,A as g,z as u};
