{"version":3,"sources":["jsdelivr-header.js","/npm/@tangible/codemirror@1.4.4/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACiBA,MAAM,WAAa,QAAQ,cAErB,cACJ,cAAa,gBACb,iBACE,QAAQ,aAEZ,SAAS,iBAAiB,EAAI,EAAU,CAAC,GAEvC,MAAM,EAAkB,aAAb,EAAG,QAAuB,WAAW,aAAe,YAEzD,SACJ,EAAW,OAAM,UACjB,GAAY,KACT,GACD,EAEE,EAAoB,IACrB,iBACA,gBAAgB,MAChB,KAGA,GAAyB,eAAZ,EACV,CAAC,EADqC,CAAE,eAAgB,MAKhE,IAAI,EAEJ,EAAkB,UAAY,IACzB,EAAkB,UACrB,IAAK,SAAS,EAAI,GAEhB,GAAI,WAAW,SAAS,wBAAyB,CAE/C,IADe,WAAW,SAAS,wBAAwB,EAAI,GAClD,MACf,CAEA,MAAM,EAAS,MAAM,EAAO,UAAU,cAAgB,GAAG,KAAK,KAC9D,EAAO,iBAAiB,EAC1B,GAGF,EAAkB,OAA4B,IAApB,EAAY,OAElC,IACG,EAAkB,SACjB,EAAY,OAAS,CAAC,GAI9B,EAAS,EAAG,EAAI,GAEhB,MAAM,EAAU,EAAO,oBAEnB,IACF,EAAQ,MAAM,QAAqB,IAAZ,EAAmB,WAAa,GAGzD,EAAO,QAAU,EAOjB,MAAM,EAAY,EAAO,mBAUzB,OAPA,EAAO,GAAG,cAAc,SAAS,EAAI,EAAM,GACzC,IAAI,EAAM,WAAW,YAAY,EAAK,KAAM,KAAM,EAAG,UAAU,YAAc,EAC7E,EAAI,MAAM,WAAa,IAAM,EAAM,KACnC,EAAI,MAAM,YALQ,EAKqB,EAAO,IAChD,IACA,EAAO,UAEA,CACT,CAEA,OAAO,OAAO,iBAAkB,CAC9B,sBACA,4BACA,kCAGF,OAAO,QAAU","file":"/npm/@tangible/codemirror@1.4.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@tangible/codemirror@1.4.4/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * CodeMirror was forked to support a unique namespace.\n *\n * It's a small change in display/Display.js to add a class\n * .tangible-codemirror to the wrapper element (d.wrapper).\n *\n * This allows for scoping the CSS, so our editor can co-exist with\n * other instances of CodeMirror.\n *\n * If you run NPM script \"copy\", which copies the newest CodeMirror to\n * /lib/codemirror-src for recompilation, make sure to re-apply the change.\n *\n * @see ./lib/codemirror/display/Display.js\n * @see ./styles\n *\n * Files in /addon, /lib/codemirror, and /mode are based on version 5.63.1.\n *\n * Run the following command (including the period) in a folder to see where\n * changes were made:\n *\n * grep -rHIn TANGIBLE .\n */\n\nconst CodeMirror = require('./lib/all')\n\nconst {\n  commonOptions,\n  languageOptions\n} = require('./options')\n\nfunction createCodeMirror(el, options = {}) {\n\n  const fn = el.tagName==='TEXTAREA' ? CodeMirror.fromTextArea : CodeMirror\n\n  const {\n    language = 'html',\n    resizable = false,\n    ...passOptions\n  } = options\n\n  const codeMirrorOptions = {\n    ...commonOptions,\n    ...languageOptions[language],\n    ...passOptions,\n    ...(\n      // If no vertical resize - .CodeMirror height: auto or 100%\n      !resizable || resizable==='horizontal' ?  { viewportMargin: Infinity }\n        : {}\n    )\n  }\n\n  let editor\n\n  codeMirrorOptions.extraKeys = {\n    ...codeMirrorOptions.extraKeys,\n    Tab: function(cm, ctx) {\n\n      if (CodeMirror.commands.emmetExpandAbbreviation) {\n        const result = CodeMirror.commands.emmetExpandAbbreviation(cm, ctx)\n        if (!result) return // Returns an object if *not* expanded\n      }\n\n      const spaces = Array(editor.getOption(\"indentUnit\") + 1).join(\" \")\n      editor.replaceSelection(spaces)\n    }\n  }\n\n  codeMirrorOptions.emmet = passOptions.emmet===false\n    ? false\n    : {\n      ...codeMirrorOptions.emmet,\n      ...(passOptions.emmet || {})\n    }\n\n\n  editor = fn(el, codeMirrorOptions)\n\n  const $editor = editor.getWrapperElement()\n\n  if (resizable) {\n    $editor.style.resize = resizable===true ? 'vertical' : resizable // horizontal, both, none\n  }\n\n  editor.element = $editor\n\n  /**\n   * Make wrapped text line up with the base indentation of the line\n   * https://codemirror.net/demo/indentwrap.html\n   */\n\n  const charWidth = editor.defaultCharWidth()\n  const basePadding = 4\n\n  editor.on(\"renderLine\", function(cm, line, elt) {\n    var off = CodeMirror.countColumn(line.text, null, cm.getOption(\"tabSize\")) * charWidth\n    elt.style.textIndent = \"-\" + off + \"px\"\n    elt.style.paddingLeft = (basePadding + off) + \"px\"\n  })\n  editor.refresh()\n\n  return editor\n}\n\nObject.assign(createCodeMirror, {\n  CodeMirror, // For convenient access without calling create\n  commonOptions,\n  languageOptions\n})\n\nmodule.exports = createCodeMirror"]}