/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../w3c-keyname/index.js"),t=require("../../prosemirror-state/dist/index.js"),r="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),i="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function n(e){let t,i,n,l,a=e.split(/-(?!$)/),o=a[a.length-1];"Space"==o&&(o=" ");for(let s=0;s<a.length-1;s++){let e=a[s];if(/^(cmd|meta|m)$/i.test(e))l=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))i=!0;else if(/^s(hift)?$/i.test(e))n=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);r?l=!0:i=!0}}return t&&(o="Alt-"+o),i&&(o="Ctrl-"+o),l&&(o="Meta-"+o),n&&(o="Shift-"+o),o}function l(e,t,r=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),r&&t.shiftKey&&(e="Shift-"+e),e}function a(t){let r=function(e){let t=Object.create(null);for(let r in e)t[n(r)]=e[r];return t}(t);return function(t,n){let a,o=e.keyName(n),s=r[l(o,n)];if(s&&s(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let e=r[l(o,n,!1)];if(e&&e(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(i&&n.ctrlKey&&n.altKey)&&(a=e.base[n.keyCode])&&a!=o){let e=r[l(a,n)];if(e&&e(t.state,t.dispatch,t))return!0}}return!1}}exports.keydownHandler=a,exports.keymap=function(e){return new t.Plugin({props:{handleKeyDown:a(e)}})};