UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 2.7 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./constants-legacy-2_ytuuS3.js","./canvas.utils-legacy-DBwbAhDp.js"],(function(e,t){var n,a,o,i,s,r,c,u,l,d;return{setters:[function(e){n=e.Ft,a=e.Ht,o=e.Mt,i=e.R,s=e.S},function(e){r=e.m,c=e.o},function(e){u=e.Pt},function(e){l=e.xc},function(e){d=e.l}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(y=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[y]="c9a6be44-1cbc-43c9-a786-9c0b89dfa9ff",t._sentryDebugIdIdentifier="sentry-dbid-c9a6be44-1cbc-43c9-a786-9c0b89dfa9ff")}catch(t){}var t,y;e("t",((e,t)=>{const y=i(l,n()),f=c({window:y?.value}),{isCtrlKeyPressed:b}=u(),g=n(null);async function v(){try{g.value=await(navigator.keyboard?.getLayoutMap())??null}catch{g.value=null}}if(navigator.keyboard&&(v(),"addEventListener"in navigator.keyboard)){const e=()=>{v()};navigator.keyboard.addEventListener("layoutchange",e),o((()=>{navigator.keyboard?.removeEventListener("layoutchange",e)}))}const p=s((()=>a(t?.disabled))),h=s((()=>f.value&&d(f.value))),w=s((()=>Object.fromEntries(Object.entries(a(e)).flatMap((([e,t])=>e.split("|").map((e=>[k(e),t])))))));function L(e){return e.map((e=>e.toLowerCase())).sort(((e,t)=>e.localeCompare(t))).join("+")}function k(e){if(1===e.length)return e.toLowerCase();const t=["+","_","-"].reduce(((t,n)=>e.startsWith(n)||e.endsWith(n)?t:n+t),"");return L(e.split(new RegExp(`[${t}]`)))}r(y?.value?.document??document,"keydown",(function(e){if(h.value||p.value)return;const{byKey:t,byCode:n,byLayout:a}=function(e){const{shiftKey:t,altKey:n}=e,a=b(e),o="key"in e?[e.key]:[],i="code"in e?[(s=e.code,s.startsWith("Digit")?s.replace("Digit","").toLowerCase():s.startsWith("Key")?s.replace("Key","").toLowerCase():s.toLowerCase())]:[];var s;const r=[];let c;if(t&&r.push("shift"),a&&r.push("ctrl"),n&&r.push("alt"),g.value&&"code"in e){const t=g.value.get(e.code);t&&(c=L([...r,t]))}return{byKey:L([...r,...o]),byCode:L([...r,...i]),byLayout:c}}(e),o=e.code.startsWith("Key"),i=/^[a-z]$/i.test(e.key),s=/^\p{L}$/u.test(e.key)&&!i,r=b(e),c=!o||r&&s,u=w.value[t],l=a?w.value[a]:void 0,d=c?w.value[n]:void 0,y=u??l??d,f="function"==typeof y?y:y?.disabled()?void 0:y?.run;f&&(e.preventDefault(),e.stopPropagation(),f(e))}))}))}}})); //# sourceMappingURL=useKeybindings-legacy-i79qEe1h.js.map