[
  {
    "path": ".babelrc",
    "content": "{\n    \"presets\": [\"@babel/preset-env\"],\n    \"plugins\": [\"@babel/plugin-proposal-class-properties\"],\n}"
  },
  {
    "path": ".eslintignore",
    "content": "build\ndist"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  \"extends\": \"airbnb-base\",\n  \"rules\": {\n    \"no-param-reassign\": [\"error\", { \"props\": false }],\n    \"class-methods-use-this\": \"off\",\n    \"no-restricted-syntax\": [\"error\", \"WithStatement\"],\n    \"quotes\": [\"error\", \"single\", { \"allowTemplateLiterals\": true }],\n    \"no-console\": \"off\"\n  },\n};\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: x-spreadsheet # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nyarn.lock\n\n.nyc_output/*\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\n\nnode_js:\n - 10.12.0\n\nbranches:\n  only:\n  - master\n\ninstall:\n - npm install -g istanbul\n - npm install\n\nbefore_script:\n\nscript:\n  - npm run build\n  - npm run test\n  - npm run coverage\n\nafter_script:\n  - cp ./dist/* ./docs/ -r\n\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at liangyuliang0335@126.com. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 myliang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "build/locale_loader.js",
    "content": "const path = require('path');\n\nfunction getLocaleCode(name, code) {\n  return `${code.replace('export default', 'const message =')}\nif (window && window.x_spreadsheet) {\n  window.x_spreadsheet.$messages = window.x_spreadsheet.$messages || {};\n  window.x_spreadsheet.$messages['${name}'] = message;\n}\nexport default message;\n`;\n}\n\nmodule.exports = require('babel-loader').custom(babel => {\n  return {\n    result(result, { options }) {\n      // console.log('options:', options);\n      const lang = path.basename(options.filename, '.js');\n      result.code = getLocaleCode(lang, result.code);\n      return result;\n    },\n  };\n});\n"
  },
  {
    "path": "build/webpack.config.js",
    "content": "const path = require('path');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nconst resolve = dir => path.join(__dirname, '..', dir);\n\nmodule.exports = {\n  entry: {\n    xspreadsheet: './src/index.js',\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: {\n          loader: 'babel-loader',\n          options: {\n            presets: ['@babel/preset-env'],\n          }\n        },\n        include: [resolve('src'), resolve('test')],\n      },\n      {\n        test: /\\.css$/,\n        use: [\n          MiniCssExtractPlugin.loader,\n          'style-loader',\n          'css-loader',\n        ],\n      },\n      {\n        test: /\\.less$/,\n        use: [\n          MiniCssExtractPlugin.loader,\n          'css-loader',\n          'less-loader',\n        ],\n      },\n      {\n        test: /\\.(png|svg|jpg|gif)$/,\n        use: [\n          'file-loader',\n        ],\n      },\n      {\n        test: /\\.(woff|woff2|eot|ttf|otf)$/,\n        use: [\n          'file-loader',\n        ],\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "build/webpack.dev.js",
    "content": "const merge = require('webpack-merge');\nconst common = require('./webpack.config.js');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst CleanWebpackPlugin = require('clean-webpack-plugin');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nmodule.exports = merge(common, {\n  mode: 'development',\n  plugins: [\n    new CleanWebpackPlugin(['dist']),\n    //  you should know that the HtmlWebpackPlugin by default will generate its own index.html\n    new HtmlWebpackPlugin({\n      template: './index.html',\n      title: 'x-spreadsheet',\n    }),\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // both options are optional\n      filename: '[name].[contenthash].css',\n      // chunkFilename: devMode ? '[id].[hash].css' : '[id].css',\n    }),\n  ],\n  output: {\n    filename: '[name].[contenthash].js',\n  },\n  devtool: 'inline-source-map',\n  devServer: {\n    host: 'localhost',\n    contentBase: '../dist',\n  },\n});\n"
  },
  {
    "path": "build/webpack.locale.js",
    "content": "const path = require('path');\nconst fs = require('fs');\n\nconst localeFiles = fs.readdirSync(path.resolve(__dirname, '../src/locale'));\nconst entry = {};\nlocaleFiles.forEach((file) => {\n  const name = file.split('.')[0];\n  \n  if (name !== 'locale') {\n    entry[name] = `./src/locale/${file}`;\n  }\n});\n\nmodule.exports = {\n  entry,\n  output: {\n    filename: '[name].js',\n    path: path.resolve(__dirname, '../dist/locale'),\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        loader: path.resolve(__dirname, 'locale_loader.js'),\n      }\n    ]\n  },\n  plugins: [\n  ],\n};\n"
  },
  {
    "path": "build/webpack.prod.js",
    "content": "const path = require('path');\nconst merge = require('webpack-merge');\nconst common = require('./webpack.config.js');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst CleanWebpackPlugin = require('clean-webpack-plugin');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nmodule.exports = merge(common, {\n  mode: 'production',\n  devtool: 'source-map',\n  plugins: [\n    new CleanWebpackPlugin(['dist']),\n    //  you should know that the HtmlWebpackPlugin by default will generate its own index.html\n    new HtmlWebpackPlugin({\n      template: './index.html',\n      title: 'x-spreadsheet',\n    }),\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // both options are optional\n      filename: '[name].css',\n      // chunkFilename: devMode ? '[id].[hash].css' : '[id].css',\n    }),\n  ],\n  output: {\n    filename: '[name].js',\n    path: path.resolve(__dirname, '../dist'),\n  },\n});\n"
  },
  {
    "path": "dist/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <title>x-spreadsheet</title>\n    \n<link href=\"xspreadsheet.css\" rel=\"stylesheet\"></head>\n<body onload=\"load()\">\n  <div style=\"position: fixed; right: 0; top: .3em;\">\n  <iframe src=\"https://ghbtns.com/github-btn.html?user=myliang&repo=x-spreadsheet&type=star&count=true&size=large\" frameborder=\"0\" scrolling=\"0\" width=\"160px\" height=\"30px\"></iframe>\n  </div>\n  <div id=\"x-spreadsheet-demo\"></div>\n  <script>\n    function load(){\n      const rows10 = { len: 1000 };\n      for (let i = 0; i < 1000; i += 1) {\n        rows10[i] = {\n          cells: {\n            0: { text: 'A-' + i },\n            1: { text: 'B-' + i },\n            2: { text: 'C-' + i },\n            3: { text: 'D-' + i },\n            4: { text: 'E-' + i },\n            5: { text: 'F-' + i },\n          }\n        };\n      }\n      const rows = {\n        len: 80,\n        1: {\n          cells: {\n            0: { text: 'testingtesttestetst' },\n            2: { text: 'testing' },\n          },\n        },\n        2: {\n          cells: {\n            0: { text: 'render', style: 0 },\n            1: { text: 'Hello' },\n            2: { text: 'haha', merge: [1, 1] },\n          }\n        },\n        8: {\n          cells: {\n            8: { text: 'border test', style: 0 },\n          }\n        }\n      };\n      // x_spreadsheet.locale('zh-cn');\n      var saveIcon = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTc3MTc3MDkyOTg4IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2NzgiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTIxMy4zMzMzMzMgMTI4aDU5Ny4zMzMzMzRhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMSA4NS4zMzMzMzMgODUuMzMzMzMzdjU5Ny4zMzMzMzRhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS04NS4zMzMzMzMgODUuMzMzMzMzSDIxMy4zMzMzMzNhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS04NS4zMzMzMzMtODUuMzMzMzMzVjIxMy4zMzMzMzNhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMSA4NS4zMzMzMzMtODUuMzMzMzMzeiBtMzY2LjkzMzMzNCAxMjhoMzQuMTMzMzMzYTI1LjYgMjUuNiAwIDAgMSAyNS42IDI1LjZ2MTE5LjQ2NjY2N2EyNS42IDI1LjYgMCAwIDEtMjUuNiAyNS42aC0zNC4xMzMzMzNhMjUuNiAyNS42IDAgMCAxLTI1LjYtMjUuNlYyODEuNmEyNS42IDI1LjYgMCAwIDEgMjUuNi0yNS42ek0yMTMuMzMzMzMzIDIxMy4zMzMzMzN2NTk3LjMzMzMzNGg1OTcuMzMzMzM0VjIxMy4zMzMzMzNIMjEzLjMzMzMzM3ogbTEyOCAwdjI1NmgzNDEuMzMzMzM0VjIxMy4zMzMzMzNoODUuMzMzMzMzdjI5OC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMS00Mi42NjY2NjcgNDIuNjY2NjY3SDI5OC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMS00Mi42NjY2NjctNDIuNjY2NjY3VjIxMy4zMzMzMzNoODUuMzMzMzMzek0yNTYgMjEzLjMzMzMzM2g4NS4zMzMzMzMtODUuMzMzMzMzeiBtNDI2LjY2NjY2NyAwaDg1LjMzMzMzMy04NS4zMzMzMzN6IG0wIDU5Ny4zMzMzMzR2LTEyOEgzNDEuMzMzMzMzdjEyOEgyNTZ2LTE3MC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMSA0Mi42NjY2NjctNDIuNjY2NjY3aDQyNi42NjY2NjZhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMSA0Mi42NjY2NjcgNDIuNjY2NjY3djE3MC42NjY2NjdoLTg1LjMzMzMzM3ogbTg1LjMzMzMzMyAwaC04NS4zMzMzMzMgODUuMzMzMzMzek0zNDEuMzMzMzMzIDgxMC42NjY2NjdIMjU2aDg1LjMzMzMzM3oiIHAtaWQ9IjI2NzkiIGZpbGw9IiMyYzJjMmMiPjwvcGF0aD48L3N2Zz4='\n      var previewEl = document.createElement('img')\n      previewEl.src = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjIxMzI4NTkxMjQzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjU2NjMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyIDE4Ny45MDRhNDM1LjM5MiA0MzUuMzkyIDAgMCAwLTQxOC41NiAzMTUuNjQ4IDQzNS4zMjggNDM1LjMyOCAwIDAgMCA4MzcuMTIgMEE0MzUuNDU2IDQzNS40NTYgMCAwIDAgNTEyIDE4Ny45MDR6TTUxMiAzMjBhMTkyIDE5MiAwIDEgMSAwIDM4NCAxOTIgMTkyIDAgMCAxIDAtMzg0eiBtMCA3Ni44YTExNS4yIDExNS4yIDAgMSAwIDAgMjMwLjQgMTE1LjIgMTE1LjIgMCAwIDAgMC0yMzAuNHpNMTQuMDggNTAzLjQ4OEwxOC41NiA0ODUuNzZsNC44NjQtMTYuMzg0IDQuOTI4LTE0Ljg0OCA4LjA2NC0yMS41NjggNC4wMzItOS43OTIgNC43MzYtMTAuODggOS4zNDQtMTkuNDU2IDEwLjc1Mi0yMC4wOTYgMTIuNjA4LTIxLjMxMkE1MTEuNjE2IDUxMS42MTYgMCAwIDEgNTEyIDExMS4xMDRhNTExLjQ4OCA1MTEuNDg4IDAgMCAxIDQyNC41MTIgMjI1LjY2NGwxMC4yNCAxNS42OGMxMS45MDQgMTkuMiAyMi41OTIgMzkuMTA0IDMyIDU5Ljc3NmwxMC40OTYgMjQuOTYgNC44NjQgMTMuMTg0IDYuNCAxOC45NDQgNC40MTYgMTQuODQ4IDQuOTkyIDE5LjM5Mi0zLjIgMTIuODY0LTMuNTg0IDEyLjgtNi40IDIwLjA5Ni00LjQ4IDEyLjYwOC00Ljk5MiAxMi45MjhhNTExLjM2IDUxMS4zNiAwIDAgMS0xNy4yOCAzOC40bC0xMi4wMzIgMjIuNC0xMS45NjggMjAuMDk2QTUxMS41NTIgNTExLjU1MiAwIDAgMSA1MTIgODk2YTUxMS40ODggNTExLjQ4OCAwIDAgMS00MjQuNDQ4LTIyNS42bC0xMS4zMjgtMTcuNTM2YTUxMS4yMzIgNTExLjIzMiAwIDAgMS0xOS44NC0zNS4wMDhMNTMuMzc2IDYxMS44NGwtOC42NC0xOC4yNC0xMC4xMTItMjQuMTI4LTcuMTY4LTE5LjY0OC04LjMyLTI2LjYyNC0yLjYyNC05Ljc5Mi0yLjQ5Ni05LjkyeiIgcC1pZD0iNTY2NCI+PC9wYXRoPjwvc3ZnPg=='\n      previewEl.width = 16\n      previewEl.height = 16\n\n      var xs = x_spreadsheet('#x-spreadsheet-demo', {\n        showToolbar: true,\n        showGrid: true,\n        showBottomBar: true,\n        extendToolbar: {\n          left: [\n            {\n              tip: 'Save',\n              icon: saveIcon,\n              onClick: (data, sheet) => {\n                console.log('click save button：', data, sheet)\n              }\n            }\n          ],\n          right: [\n            {\n              tip: 'Preview',\n              el: previewEl,\n              onClick: (data, sheet) => {\n                console.log('click preview button：', data)\n              }\n            }\n          ],\n        }\n      })\n        .loadData([{\n          freeze: 'B3',\n          styles: [\n            {\n              bgcolor: '#f4f5f8',\n              textwrap: true,\n              color: '#900b09',\n              border: {\n                top: ['thin', '#0366d6'],\n                bottom: ['thin', '#0366d6'],\n                right: ['thin', '#0366d6'],\n                left: ['thin', '#0366d6'],\n              },\n            },\n          ],\n          merges: [\n            'C3:D4',\n          ],\n          cols: {\n            len: 10,\n            2: { width: 200 },\n          },\n          rows,\n        }, { name: 'sheet-test', rows: rows10 }]).change((cdata) => {\n          // console.log(cdata);\n          console.log('>>>', xs.getData());\n        });\n\n      xs.on('cell-selected', (cell, ri, ci) => {\n          console.log('cell:', cell, ', ri:', ri, ', ci:', ci);\n        }).on('cell-edited', (text, ri, ci) => {\n          console.log('text:', text, ', ri: ', ri, ', ci:', ci);\n        });\n\n      setTimeout(() => {\n        // xs.loadData([{ rows }]);\n        xs.cellText(14, 3, 'cell-text').reRender();\n        console.log('cell(8, 8):', xs.cell(8, 8));\n        console.log('cellStyle(8, 8):', xs.cellStyle(8, 8));\n      }, 5000);\n    }\n  </script>\n  <!--script type=\"text/javascript\" src=\"https://unpkg.com/x-data-spreadsheet@1.0.20/dist/locale/zh-cn.js\"></script-->\n<script type=\"text/javascript\" src=\"xspreadsheet.js\"></script></body>\n</html>\n"
  },
  {
    "path": "dist/locale/de.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Rückgängig machen\",redo:\"Wiederherstellen\",paintformat:\"Format kopieren/einfügen\",clearformat:\"Format löschen\",format:\"Format\",font:\"Schriftart\",fontSize:\"Schriftgrad\",fontBold:\"Fett\",fontItalic:\"Kursiv\",underline:\"Betonen\",strike:\"Streichen\",textColor:\"Text Farbe\",fillColor:\"Füllung Farbe\",border:\"Umrandung\",merge:\"Zellen verbinden\",align:\"Waagrechte Ausrichtung\",valign:\"Vertikale uitlijning\",textwrap:\"Textumbruch\",freeze:\"Zelle sperren\",formula:\"Funktionen\",more:\"Mehr\"},contextmenu:{copy:\"Kopieren\",cut:\"Ausschneiden\",paste:\"Einfügen\",pasteValue:\"Nur Werte einfügen\",pasteFormat:\"Nur Format einfügen\",insertRow:\"Zeile einfügen\",insertColumn:\"Spalte einfügen\",deleteRow:\"Zeile löschen\",deleteColumn:\"Spalte löschen\",deleteCell:\"Zelle löschen\",deleteCellText:\"Zellentext löschen\"},format:{normal:\"Regulär\",text:\"Text\",number:\"Nummer\",percent:\"Prozent\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Termin\",datetime:\"Datum Termin\",duration:\"Dauer\"},formula:{sum:\"Summe\",average:\"Durchschnittliche\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.de=r),t.default=r}]);"
  },
  {
    "path": "dist/locale/en.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=1)}([,function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Undo\",redo:\"Redo\",print:\"Print\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",fontName:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",color:\"Text color\",bgcolor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",autofilter:\"Filter\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",hide:\"Hide\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteSheet:\"Delete\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\",cellprintable:\"Enable export\",cellnonprintable:\"Disable export\",celleditable:\"Enable editing\",cellnoneditable:\"Disable editing\"},print:{size:\"Paper size\",orientation:\"Page orientation\",orientations:[\"Landscape\",\"Portrait\"]},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",eur:\"EUR\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",_if:\"IF\",and:\"AND\",or:\"OR\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{next:\"Next\",cancel:\"Cancel\",remove:\"Remove\",save:\"Save\",ok:\"OK\"},sort:{desc:\"Sort Z -> A\",asc:\"Sort A -> Z\"},filter:{empty:\"empty\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.en=r),t.default=r}]);"
  },
  {
    "path": "dist/locale/nl.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=2)}({2:function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Ongedaan maken\",redo:\"Opnieuw uitvoeren\",paintformat:\"Opmaak kopiëren/plakken\",clearformat:\"Opmaak wissen\",format:\"Opmaak\",font:\"Lettertype\",fontSize:\"Tekengrootte\",fontBold:\"Vet\",fontItalic:\"Cursief\",underline:\"Onderstrepen\",strike:\"Doorstrepen\",textColor:\"Tekstkleur\",fillColor:\"Opvulkleur\",border:\"Randen\",merge:\"Cellen samenvoegen\",align:\"Horizontale uitlijning\",valign:\"Verticale uitlijning\",textwrap:\"Terugloop\",freeze:\"Cel bevriezen\",formula:\"Functies\",more:\"Meer\"},contextmenu:{copy:\"Kopiëren\",cut:\"Knippen\",paste:\"Plakken\",pasteValue:\"Alleen waarden plakken\",pasteFormat:\"Alleen opmaak plakken\",insertRow:\"Rij invoegen\",insertColumn:\"Kolom invoegen\",deleteRow:\"Rij verwijderen\",deleteColumn:\"Kolom verwijderen\",deleteCell:\"Cel verwijderen\",deleteCellText:\"Celtekst verwijderen\"},format:{normal:\"Standaard\",text:\"Tekst\",number:\"Nummer\",percent:\"Percentage\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Tijdstip\",datetime:\"Datum tijd\",duration:\"Duratie\"},formula:{sum:\"Som\",average:\"Gemiddelde\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.nl=r),t.default=r}});"
  },
  {
    "path": "dist/locale/zh-cn.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=3)}({3:function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"撤销\",redo:\"恢复\",print:\"打印\",paintformat:\"格式刷\",clearformat:\"清除格式\",format:\"数据格式\",fontName:\"字体\",fontSize:\"字号\",fontBold:\"加粗\",fontItalic:\"倾斜\",underline:\"下划线\",strike:\"删除线\",color:\"字体颜色\",bgcolor:\"填充颜色\",border:\"边框\",merge:\"合并单元格\",align:\"水平对齐\",valign:\"垂直对齐\",textwrap:\"自动换行\",freeze:\"冻结\",autofilter:\"自动筛选\",formula:\"函数\",more:\"更多\"},contextmenu:{copy:\"复制\",cut:\"剪切\",paste:\"粘贴\",pasteValue:\"粘贴数据\",pasteFormat:\"粘贴格式\",hide:\"隐藏\",insertRow:\"插入行\",insertColumn:\"插入列\",deleteSheet:\"删除\",deleteRow:\"删除行\",deleteColumn:\"删除列\",deleteCell:\"删除\",deleteCellText:\"删除数据\",validation:\"数据验证\",cellprintable:\"可打印\",cellnonprintable:\"不可打印\",celleditable:\"可编辑\",cellnoneditable:\"不可编辑\"},print:{size:\"纸张大小\",orientation:\"方向\",orientations:[\"横向\",\"纵向\"]},format:{normal:\"正常\",text:\"文本\",number:\"数值\",percent:\"百分比\",rmb:\"人民币\",usd:\"美元\",eur:\"欧元\",date:\"短日期\",time:\"时间\",datetime:\"长日期\",duration:\"持续时间\"},formula:{sum:\"求和\",average:\"求平均值\",max:\"求最大值\",min:\"求最小值\",concat:\"字符拼接\",_if:\"条件判断\",and:\"和\",or:\"或\"},validation:{required:\"此值必填\",notMatch:\"此值不匹配验证规则\",between:\"此值应在 {} 和 {} 之间\",notBetween:\"此值不应在 {} 和 {} 之间\",notIn:\"此值不在列表中\",equal:\"此值应该等于 {}\",notEqual:\"此值不应该等于 {}\",lessThan:\"此值应该小于 {}\",lessThanEqual:\"此值应该小于等于 {}\",greaterThan:\"此值应该大于 {}\",greaterThanEqual:\"此值应该大于等于 {}\"},error:{pasteForMergedCell:\"无法对合并的单元格执行此操作\"},calendar:{weeks:[\"日\",\"一\",\"二\",\"三\",\"四\",\"五\",\"六\"],months:[\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\"]},button:{next:\"下一步\",cancel:\"取消\",remove:\"删除\",save:\"保存\",ok:\"确认\"},sort:{desc:\"降序\",asc:\"升序\"},filter:{empty:\"空白\"},dataValidation:{mode:\"模式\",range:\"单元区间\",criteria:\"条件\",modeType:{cell:\"单元格\",column:\"列模式\",row:\"行模式\"},type:{list:\"列表\",number:\"数字\",date:\"日期\",phone:\"手机号\",email:\"电子邮件\"},operator:{be:\"在区间\",nbe:\"不在区间\",lt:\"小于\",lte:\"小于等于\",gt:\"大于\",gte:\"大于等于\",eq:\"等于\",neq:\"不等于\"}}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages[\"zh-cn\"]=r),t.default=r}});"
  },
  {
    "path": "dist/xspreadsheet.css",
    "content": "body {\n  margin: 0;\n}\n.x-spreadsheet {\n  font-size: 13px;\n  line-height: normal;\n  user-select: none;\n  -moz-user-select: none;\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  box-sizing: content-box;\n  background: #fff;\n  -webkit-font-smoothing: antialiased;\n}\n.x-spreadsheet textarea {\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n}\n.x-spreadsheet-sheet {\n  position: relative;\n  overflow: hidden;\n}\n.x-spreadsheet-table {\n  vertical-align: bottom;\n}\n.x-spreadsheet-tooltip {\n  font-family: inherit;\n  position: absolute;\n  padding: 5px 10px;\n  color: #fff;\n  border-radius: 1px;\n  background: #000000;\n  font-size: 12px;\n  z-index: 201;\n}\n.x-spreadsheet-tooltip:before {\n  pointer-events: none;\n  position: absolute;\n  left: calc(50% - 4px);\n  top: -4px;\n  content: \"\";\n  width: 8px;\n  height: 8px;\n  background: inherit;\n  -webkit-transform: rotate(45deg);\n  transform: rotate(45deg);\n  z-index: 1;\n  box-shadow: 1px 1px 3px -1px rgba(0, 0, 0, 0.3);\n}\n.x-spreadsheet-color-palette {\n  padding: 5px;\n}\n.x-spreadsheet-color-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 2;\n  background: #fff;\n}\n.x-spreadsheet-color-palette table td {\n  margin: 0;\n  cursor: pointer;\n  border: 1px solid transparent;\n}\n.x-spreadsheet-color-palette table td:hover {\n  border-color: #ddd;\n}\n.x-spreadsheet-color-palette table td .x-spreadsheet-color-palette-cell {\n  width: 16px;\n  height: 16px;\n}\n.x-spreadsheet-border-palette {\n  padding: 6px;\n}\n.x-spreadsheet-border-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 0;\n  background: #fff;\n  table-layout: fixed;\n}\n.x-spreadsheet-border-palette table td {\n  margin: 0;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left {\n  border-right: 1px solid #eee;\n  padding-right: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell {\n  width: 30px;\n  height: 30px;\n  cursor: pointer;\n  text-align: center;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell .x-spreadsheet-icon-img {\n  opacity: 0.8;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell:hover {\n  background-color: #eee;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right {\n  padding-left: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-toolbar-btn {\n  margin-top: 0;\n  margin-bottom: 3px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-line-type {\n  position: relative;\n  left: 0;\n  top: -3px;\n}\n.x-spreadsheet-dropdown {\n  position: relative;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-content {\n  position: absolute;\n  z-index: 200;\n  background: #fff;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n}\n.x-spreadsheet-dropdown.bottom-left .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  left: 0;\n}\n.x-spreadsheet-dropdown.bottom-right .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  right: 0;\n}\n.x-spreadsheet-dropdown.top-left .x-spreadsheet-dropdown-content {\n  bottom: calc(100% + 5px);\n  left: 0;\n}\n.x-spreadsheet-dropdown.top-right .x-spreadsheet-dropdown-content {\n  bottom: calc(100% + 5px);\n  right: 0;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-title {\n  padding: 0 5px;\n  display: inline-block;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-left {\n  margin-left: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right {\n  width: 10px;\n  margin-right: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right .arrow-down {\n  left: -130px;\n}\n/* resizer **/\n.x-spreadsheet-resizer {\n  position: absolute;\n  z-index: 11;\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-hover {\n  background-color: rgba(75, 137, 255, 0.25);\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-line {\n  position: absolute;\n}\n.x-spreadsheet-resizer.horizontal {\n  cursor: row-resize;\n}\n.x-spreadsheet-resizer.horizontal .x-spreadsheet-resizer-line {\n  border-bottom: 2px dashed #4b89ff;\n  left: 0;\n  bottom: 0;\n}\n.x-spreadsheet-resizer.vertical {\n  cursor: col-resize;\n}\n.x-spreadsheet-resizer.vertical .x-spreadsheet-resizer-line {\n  border-right: 2px dashed #4b89ff;\n  top: 0;\n  right: 0;\n}\n/* scrollbar */\n.x-spreadsheet-scrollbar {\n  position: absolute;\n  bottom: 0;\n  right: 0;\n  background-color: #f4f5f8;\n  opacity: 0.9;\n  z-index: 12;\n}\n.x-spreadsheet-scrollbar.horizontal {\n  right: 15px;\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n.x-spreadsheet-scrollbar.horizontal > div {\n  height: 1px;\n  background: #ddd;\n}\n.x-spreadsheet-scrollbar.vertical {\n  bottom: 15px;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.x-spreadsheet-scrollbar.vertical > div {\n  width: 1px;\n  background: #ddd;\n}\n/* @{css-prefix}-overlayer */\n.x-spreadsheet-overlayer {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 10;\n}\n.x-spreadsheet-overlayer .x-spreadsheet-overlayer-content {\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  width: 100%;\n  height: 100%;\n}\n.x-spreadsheet-editor,\n.x-spreadsheet-selector {\n  box-sizing: content-box;\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n/* @{css-prefix}-selector */\n.x-spreadsheet-selector .hide-input {\n  position: absolute;\n  z-index: 0;\n}\n.x-spreadsheet-selector .hide-input input {\n  padding: 0;\n  width: 0;\n  border: none!important;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-area {\n  position: absolute;\n  border: 2px solid #4b89ff;\n  background: rgba(75, 137, 255, 0.1);\n  z-index: 5;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard,\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  position: absolute;\n  background: transparent;\n  z-index: 100;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard {\n  border: 2px dashed #4b89ff;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  border: 1px dashed rgba(0, 0, 0, 0.45);\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-corner {\n  pointer-events: auto;\n  position: absolute;\n  cursor: crosshair;\n  font-size: 0;\n  height: 5px;\n  width: 5px;\n  right: -5px;\n  bottom: -5px;\n  border: 2px solid #ffffff;\n  background: #4b89ff;\n}\n.x-spreadsheet-editor {\n  z-index: 20;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area {\n  position: absolute;\n  text-align: left;\n  border: 2px solid #4b89ff;\n  line-height: 0;\n  z-index: 100;\n  pointer-events: auto;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area textarea {\n  box-sizing: content-box;\n  border: none;\n  padding: 0 3px;\n  outline: none;\n  resize: none;\n  text-align: start;\n  overflow-y: hidden;\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n  color: inherit;\n  white-space: normal;\n  word-wrap: break-word;\n  line-height: 22px;\n  margin: 0;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area .textline {\n  overflow: hidden;\n  visibility: hidden;\n  position: fixed;\n  top: 0;\n  left: 0;\n}\n.x-spreadsheet-item {\n  user-select: none;\n  background: 0;\n  border: 1px solid transparent;\n  outline: none;\n  height: 26px;\n  color: rgba(0, 0, 0, 0.9);\n  line-height: 26px;\n  list-style: none;\n  padding: 2px 10px;\n  cursor: default;\n  text-align: left;\n  overflow: hidden;\n}\n.x-spreadsheet-item.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-item:hover,\n.x-spreadsheet-item.active {\n  background: rgba(0, 0, 0, 0.05);\n}\n.x-spreadsheet-item.divider {\n  height: 0;\n  padding: 0;\n  margin: 5px 0;\n  border: none;\n  border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n}\n.x-spreadsheet-item .label {\n  float: right;\n  opacity: 0.65;\n  font-size: 1em;\n}\n.x-spreadsheet-item.state,\n.x-spreadsheet-header.state {\n  padding-left: 35px!important;\n  position: relative;\n}\n.x-spreadsheet-item.state:before,\n.x-spreadsheet-header.state:before {\n  content: '';\n  position: absolute;\n  width: 10px;\n  height: 10px;\n  left: 12px;\n  top: calc(50% - 5px);\n  background: rgba(0, 0, 0, 0.08);\n  border-radius: 2px;\n}\n.x-spreadsheet-item.state.checked:before,\n.x-spreadsheet-header.state.checked:before {\n  background: #4b89ff;\n}\n.x-spreadsheet-checkbox {\n  position: relative;\n  display: inline-block;\n  backface-visibility: hidden;\n  outline: 0;\n  vertical-align: baseline;\n  font-style: normal;\n  font-size: 1rem;\n  line-height: 1em;\n}\n.x-spreadsheet-checkbox > input {\n  position: absolute;\n  top: 0;\n  left: 0;\n  opacity: 0!important;\n  outline: 0;\n  z-index: -1;\n}\n.x-spreadsheet-suggest,\n.x-spreadsheet-contextmenu,\n.x-spreadsheet-sort-filter {\n  position: absolute;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n  background: #fff;\n  z-index: 100;\n  width: 260px;\n  pointer-events: auto;\n  overflow: auto;\n}\n.x-spreadsheet-suggest {\n  width: 200px;\n}\n.x-spreadsheet-filter {\n  border: 1px solid #e9e9e9;\n  font-size: 12px;\n  margin: 10px;\n}\n.x-spreadsheet-filter .x-spreadsheet-header {\n  padding: 0.5em 0.75em;\n  background: #f8f8f9;\n  border-bottom: 1px solid #e9e9e9;\n  border-left: 1px solid transparent;\n}\n.x-spreadsheet-filter .x-spreadsheet-body {\n  height: 200px;\n  overflow-y: auto;\n}\n.x-spreadsheet-filter .x-spreadsheet-body .x-spreadsheet-item {\n  height: 20px;\n  line-height: 20px;\n}\n.x-spreadsheet-sort-filter .x-spreadsheet-buttons {\n  margin: 10px;\n}\n.x-spreadsheet-toolbar,\n.x-spreadsheet-bottombar {\n  height: 40px;\n  padding: 0 30px;\n  text-align: left;\n  background: #f5f6f7;\n  display: flex;\n}\n.x-spreadsheet-bottombar {\n  position: relative;\n  border-top: 1px solid #e0e2e4;\n}\n.x-spreadsheet-bottombar .x-spreadsheet-menu > li {\n  line-height: 40px;\n  height: 40px;\n  padding-top: 0;\n  padding-bottom: 0;\n  vertical-align: middle;\n  border-right: 1px solid #e8eaed;\n}\n.x-spreadsheet-menu {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  user-select: none;\n}\n.x-spreadsheet-menu > li {\n  float: left;\n  line-height: 1.25em;\n  padding: 0.785em 1em;\n  margin: 0;\n  vertical-align: middle;\n  text-align: left;\n  font-weight: 400;\n  color: #80868b;\n  white-space: nowrap;\n  cursor: pointer;\n  transition: all 0.3s;\n  font-weight: bold;\n}\n.x-spreadsheet-menu > li.active {\n  background-color: #fff;\n  color: rgba(0, 0, 0, 0.65);\n}\n.x-spreadsheet-menu > li .x-spreadsheet-icon {\n  margin: 0 6px;\n}\n.x-spreadsheet-menu > li .x-spreadsheet-icon .x-spreadsheet-icon-img:hover {\n  opacity: 0.85;\n}\n.x-spreadsheet-menu > li .x-spreadsheet-dropdown {\n  display: inline-block;\n}\n.x-spreadsheet-toolbar {\n  border-bottom: 1px solid #e0e2e4;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btns {\n  display: inline-flex;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more {\n  padding: 0 6px 6px;\n  text-align: left;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more .x-spreadsheet-toolbar-divider {\n  margin-top: 0;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn {\n  flex: 0 0 auto;\n  display: inline-block;\n  border: 1px solid transparent;\n  height: 26px;\n  line-height: 26px;\n  min-width: 26px;\n  margin: 6px 1px 0;\n  padding: 0;\n  text-align: center;\n  border-radius: 2px;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn:hover,\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.active {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toolbar-divider {\n  display: inline-block;\n  border-right: 1px solid #e0e2e4;\n  width: 0;\n  vertical-align: middle;\n  height: 18px;\n  margin: 12px 3px 0;\n}\n.x-spreadsheet-print {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 100;\n  width: 100%;\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n.x-spreadsheet-print-bar {\n  background: #424242;\n  height: 60px;\n  line-height: 60px;\n  padding: 0 30px;\n}\n.x-spreadsheet-print-bar .-title {\n  color: #fff;\n  font-weight: bold;\n  font-size: 1.2em;\n  float: left;\n}\n.x-spreadsheet-print-bar .-right {\n  float: right;\n  margin-top: 12px;\n}\n.x-spreadsheet-print-content {\n  display: flex;\n  flex: auto;\n  flex-direction: row;\n  background: #d0d0d0;\n  height: calc(100% - 60px);\n}\n.x-spreadsheet-print-content .-sider {\n  flex: 0 0 300px;\n  width: 300px;\n  border-left: 2px solid #ccc;\n  background: #fff;\n}\n.x-spreadsheet-print-content .-content {\n  flex: auto;\n  overflow-x: auto;\n  overflow-y: scroll;\n  height: 100%;\n}\n.x-spreadsheet-canvas-card-wraper {\n  margin: 40px 20px;\n}\n.x-spreadsheet-canvas-card {\n  background: #fff;\n  margin: auto;\n  page-break-before: auto;\n  page-break-after: always;\n  box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.2);\n}\n.x-spreadsheet-calendar {\n  color: rgba(0, 0, 0, 0.65);\n  background: #ffffff;\n  user-select: none;\n}\n.x-spreadsheet-calendar .calendar-header {\n  font-weight: 700;\n  line-height: 30px;\n  text-align: center;\n  width: 100%;\n  float: left;\n  background: #f9fafb;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-left {\n  padding-left: 5px;\n  float: left;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right {\n  float: right;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a {\n  padding: 3px 0;\n  margin-right: 2px;\n  border-radius: 2px;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a:hover {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-calendar .calendar-body {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n.x-spreadsheet-calendar .calendar-body th,\n.x-spreadsheet-calendar .calendar-body td {\n  width: 14.28571429%;\n  min-width: 32px;\n  text-align: center;\n  font-weight: 700;\n  line-height: 30px;\n  padding: 0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell:hover {\n  background: #ecf6fd;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.active,\n.x-spreadsheet-calendar .calendar-body td > .cell.active:hover {\n  background: #ecf6fd;\n  color: #2185D0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-datepicker {\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);\n  position: absolute;\n  left: 0;\n  top: calc(100% + 5px);\n  z-index: 10;\n  width: auto;\n}\n.x-spreadsheet-buttons {\n  display: flex;\n  justify-content: flex-end;\n}\n.x-spreadsheet-buttons .x-spreadsheet-button {\n  margin-left: 8px;\n}\n.x-spreadsheet-button {\n  display: inline-block;\n  border-radius: 3px;\n  line-height: 1em;\n  min-height: 1em;\n  white-space: nowrap;\n  text-align: center;\n  cursor: pointer;\n  font-size: 1em;\n  font-weight: 700;\n  padding: 0.75em 1em;\n  color: rgba(0, 0, 0, 0.6);\n  background: #E0E1E2;\n  text-decoration: none;\n  font-family: \"Lato\", \"proxima-nova\", \"Helvetica Neue\", Arial, sans-serif;\n  outline: none;\n  vertical-align: baseline;\n  zoom: 1;\n  user-select: none;\n  transition: all 0.1s linear;\n}\n.x-spreadsheet-button.active,\n.x-spreadsheet-button:hover {\n  background-color: #C0C1C2;\n  color: rgba(0, 0, 0, 0.8);\n}\n.x-spreadsheet-button.primary {\n  color: #fff;\n  background-color: #2185D0;\n}\n.x-spreadsheet-button.primary:hover,\n.x-spreadsheet-button.primary.active {\n  color: #fff;\n  background-color: #1678c2;\n}\n.x-spreadsheet-form-input {\n  font-size: 1em;\n  position: relative;\n  font-weight: 400;\n  display: inline-flex;\n  color: rgba(0, 0, 0, 0.87);\n}\n.x-spreadsheet-form-input input {\n  z-index: 1;\n  margin: 0;\n  max-width: 100%;\n  flex: 1 0 auto;\n  outline: 0;\n  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n  text-align: left;\n  line-height: 30px;\n  height: 30px;\n  padding: 0 8px;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 3px;\n  transition: box-shadow 0.1s ease, border-color 0.1s ease;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-input input:focus {\n  border-color: #4b89ff;\n  box-shadow: inset 0 1px 2px rgba(75, 137, 255, 0.2);\n}\n.x-spreadsheet-form-select {\n  position: relative;\n  display: inline-block;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 2px;\n  cursor: pointer;\n  color: rgba(0, 0, 0, 0.87);\n  user-select: none;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-select .input-text {\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  min-width: 60px;\n  width: auto;\n  height: 30px;\n  line-height: 30px;\n  padding: 0 8px;\n}\n.x-spreadsheet-form-fields {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field {\n  flex: 0 1 auto;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field .label {\n  display: inline-block;\n  margin: 0 10px 0 0;\n}\n.x-spreadsheet-form-field {\n  display: block;\n  vertical-align: middle;\n  margin-left: 10px;\n  margin-bottom: 10px;\n}\n.x-spreadsheet-form-field:first-child {\n  margin-left: 0;\n}\n.x-spreadsheet-form-field.error .x-spreadsheet-form-select,\n.x-spreadsheet-form-field.error input {\n  border-color: #f04134;\n}\n.x-spreadsheet-form-field .tip {\n  color: #f04134;\n  font-size: 0.9em;\n}\n.x-spreadsheet-dimmer {\n  display: none;\n  position: absolute;\n  top: 0 !important;\n  left: 0 !important;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  vertical-align: middle;\n  background-color: rgba(0, 0, 0, 0.6);\n  opacity: 0;\n  -webkit-animation-fill-mode: both;\n  animation-fill-mode: both;\n  -webkit-animation-duration: 0.5s;\n  animation-duration: 0.5s;\n  transition: background-color 0.5s linear;\n  user-select: none;\n  z-index: 1000;\n}\n.x-spreadsheet-dimmer.active {\n  display: block;\n  opacity: 1;\n}\nform fieldset {\n  border: none;\n}\nform fieldset label {\n  display: block;\n  margin-bottom: 0.5em;\n  font-size: 1em;\n  color: #666;\n}\nform fieldset select {\n  font-size: 1.1em;\n  width: 100%;\n  background-color: #fff;\n  border: none;\n  border-bottom: 2px solid #ddd;\n  padding: 0.5em 0.85em;\n  border-radius: 2px;\n}\n.x-spreadsheet-modal,\n.x-spreadsheet-toast {\n  font-size: 13px;\n  position: fixed;\n  z-index: 1001;\n  text-align: left;\n  line-height: 1.25em;\n  min-width: 360px;\n  color: rgba(0, 0, 0, 0.87);\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  border-radius: 4px;\n  border: 1px solid rgba(0, 0, 0, 0.1);\n  background-color: #fff;\n  background-clip: padding-box;\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px;\n}\n.x-spreadsheet-toast {\n  background-color: rgba(255, 255, 255, 0.85);\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-toast-header {\n  font-weight: 600;\n  background-clip: padding-box;\n  background-color: rgba(255, 255, 255, 0.85);\n  border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n  border-radius: 4px 4px 0 0;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon,\n.x-spreadsheet-toast-header .x-spreadsheet-icon {\n  position: absolute;\n  right: 0.8em;\n  top: 0.65em;\n  border-radius: 18px;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon:hover,\n.x-spreadsheet-toast-header .x-spreadsheet-icon:hover {\n  opacity: 1;\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toast-header {\n  color: #F2711C;\n}\n.x-spreadsheet-modal-header {\n  border-bottom: 1px solid #e0e2e4;\n  background: rgba(0, 0, 0, 0.08);\n  font-size: 1.0785em;\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-modal-content,\n.x-spreadsheet-toast-header,\n.x-spreadsheet-toast-content {\n  padding: 0.75em 1em;\n}\n@media screen and (min-width: 320px) and (max-width: 480px) {\n  .x-spreadsheet-toolbar {\n    display: none;\n  }\n}\n.x-spreadsheet-icon {\n  width: 18px;\n  height: 18px;\n  margin: 1px 1px 2px 1px;\n  text-align: center;\n  vertical-align: middle;\n  user-select: none;\n  overflow: hidden;\n  position: relative;\n  display: inline-block;\n  line-height: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img {\n  background-image: url(58eaeb4e52248a5c75936c6f4c33a370.svg);\n  position: absolute;\n  width: 262px;\n  height: 444px;\n  opacity: 0.56;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.undo {\n  left: 0;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.redo {\n  left: -18px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.print {\n  left: -36px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.paintformat {\n  left: -54px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.clearformat {\n  left: -72px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-bold {\n  left: -90px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-italic {\n  left: -108px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.underline {\n  left: -126px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.strike {\n  left: -144px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.color {\n  left: -162px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.bgcolor {\n  left: -180px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.merge {\n  left: -198px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-left {\n  left: -216px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-center {\n  left: -234px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-right {\n  left: 0;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-top {\n  left: -18px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-middle {\n  left: -36px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-bottom {\n  left: -54px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.textwrap {\n  left: -72px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.autofilter {\n  left: -90px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.formula {\n  left: -108px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-down {\n  left: -126px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-right {\n  left: -144px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.link {\n  left: -162px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chart {\n  left: -180px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.freeze {\n  left: -198px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.ellipsis {\n  left: -216px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.add {\n  left: -234px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-all {\n  left: 0;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-inside {\n  left: -18px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-horizontal {\n  left: -36px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-vertical {\n  left: -54px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-outside {\n  left: -72px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-left {\n  left: -90px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-top {\n  left: -108px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-right {\n  left: -126px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-bottom {\n  left: -144px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-none {\n  left: -162px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-color {\n  left: -180px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-type {\n  left: -198px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.close {\n  left: -234px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-down {\n  left: 0;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-up {\n  left: -18px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-left {\n  left: -36px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-right {\n  left: -54px;\n  top: -54px;\n}\n\n\n/*# sourceMappingURL=xspreadsheet.css.map*/"
  },
  {
    "path": "dist/xspreadsheet.js",
    "content": "!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=2)}([function(t,e){},function(t,e,n){},function(t,e,n){\"use strict\";function r(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var o=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),\"string\"==typeof e?(this.el=document.createElement(e),this.el.className=n):this.el=e,this.data={}}var e,n,o;return e=t,(n=[{key:\"data\",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:\"on\",value:function(t,e){var n=r(t.split(\".\")),i=n[0],o=n.slice(1),a=i;return\"mousewheel\"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a=\"DOMMouseScroll\"),this.el.addEventListener(a,function(t){e(t);for(var n=0;n<o.length;n+=1){var r=o[n];if(\"left\"===r&&0!==t.button)return;if(\"right\"===r&&2!==t.button)return;\"stop\"===r&&t.stopPropagation()}}),this}},{key:\"offset\",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach(function(n){e.css(n,\"\".concat(t[n],\"px\"))}),this;var n=this.el;return{top:n.offsetTop,left:n.offsetLeft,height:n.offsetHeight,width:n.offsetWidth}}},{key:\"scroll\",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:\"box\",value:function(){return this.el.getBoundingClientRect()}},{key:\"parent\",value:function(){return new t(this.el.parentNode)}},{key:\"children\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===arguments.length?this.el.childNodes:(n.forEach(function(e){return t.child(e)}),this)}},{key:\"removeChild\",value:function(t){this.el.removeChild(t)}},{key:\"child\",value:function(e){var n=e;return\"string\"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),this.el.appendChild(n),this}},{key:\"contains\",value:function(t){return this.el.contains(t)}},{key:\"className\",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:\"addClass\",value:function(t){return this.el.classList.add(t),this}},{key:\"hasClass\",value:function(t){return this.el.classList.contains(t)}},{key:\"removeClass\",value:function(t){return this.el.classList.remove(t),this}},{key:\"toggle\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"active\";return this.toggleClass(t)}},{key:\"toggleClass\",value:function(t){return this.el.classList.toggle(t)}},{key:\"active\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"active\";return t?this.addClass(e):this.removeClass(e),this}},{key:\"checked\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,\"checked\"),this}},{key:\"disabled\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.addClass(\"disabled\"):this.removeClass(\"disabled\"),this}},{key:\"attr\",value:function(t,e){var n=this;if(void 0!==e)this.el.setAttribute(t,e);else{if(\"string\"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach(function(e){n.el.setAttribute(e,t[e])})}return this}},{key:\"removeAttr\",value:function(t){return this.el.removeAttribute(t),this}},{key:\"html\",value:function(t){return void 0!==t?(this.el.innerHTML=t,this):this.el.innerHTML}},{key:\"val\",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:\"focus\",value:function(){this.el.focus()}},{key:\"cssRemoveKeys\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){return t.el.style.removeProperty(e)}),this}},{key:\"css\",value:function(t,e){var n=this;return void 0===e&&\"string\"!=typeof t?(Object.keys(t).forEach(function(e){n.el.style[e]=t[e]}),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:\"computedStyle\",value:function(){return window.getComputedStyle(this.el,null)}},{key:\"show\",value:function(){return this.css(\"display\",\"block\"),this}},{key:\"hide\",value:function(){return this.css(\"display\",\"none\"),this}}])&&i(e.prototype,n),o&&i(e,o),t}(),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return new o(t,e)};n(0);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var c=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];function s(t){for(var e=\"\",n=t;n>=c.length;)n/=c.length,n-=1,e+=c[parseInt(n,10)%c.length];var r=t%c.length;return e+=c[r]}function u(t){for(var e=0,n=0;n<t.length-1;n+=1){var r=t.charCodeAt(n)-65,i=t.length-1-n;e+=Math.pow(c.length,i)+c.length*r}return e+=t.charCodeAt(t.length-1)-65}function f(t){for(var e=\"\",n=\"\",r=0;r<t.length;r+=1)t.charAt(r)>=\"0\"&&t.charAt(r)<=\"9\"?n+=t.charAt(r):e+=t.charAt(r);return[u(e),parseInt(n,10)-1]}function h(t,e){return\"\".concat(s(t)).concat(e+1)}function p(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===n)return t;var i=l(f(t),2),o=i[0],a=i[1];return r(o,a)?h(o+e,a+n):t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var v=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.sri=e,this.sci=n,this.eri=r,this.eci=i,this.w=o,this.h=a}var e,n,r;return e=t,r=[{key:\"valueOf\",value:function(e){var n=e.split(\":\"),r=d(f(n[0]),2),i=r[0],o=r[1],a=o,l=i;if(n.length>1){var c=d(f(n[1]),2);l=c[0],a=c[1]}return new t(o,i,a,l)}}],(n=[{key:\"set\",value:function(t,e,n,r){this.sri=t,this.sci=e,this.eri=n,this.eci=r}},{key:\"multiple\",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:\"includes\",value:function(){for(var t=0,e=0,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(1===r.length){var o=f(r[0]),a=d(o,2);e=a[0],t=a[1]}else 2===r.length&&(t=r[0],e=r[1]);var l=this.sri,c=this.sci,s=this.eri,u=this.eci;return l<=t&&t<=s&&c<=e&&e<=u}},{key:\"each\",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=n;a<=i;a+=1)if(e(a))for(var l=r;l<=o;l+=1)t(a,l)}},{key:\"contains\",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:\"within\",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:\"disjoint\",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:\"intersects\",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:\"union\",value:function(e){var n=this.sri,r=this.sci,i=this.eri,o=this.eci;return new t(e.sri<n?e.sri:n,e.sci<r?e.sci:r,e.eri>i?e.eri:i,e.eci>o?e.eci:o)}},{key:\"difference\",value:function(e){var n=[],r=function(e,r,i,o){n.push(new t(e,r,i,o))},i=this.sri,o=this.sci,a=this.eri,l=this.eci,c=e.sri-i,s=e.sci-o,u=a-e.eri,f=l-e.eci;return c>0?(r(i,o,e.sri-1,l),u>0?(r(e.eri+1,o,a,l),s>0&&r(e.sri,o,e.eri,e.sci-1),f>0&&r(e.sri,e.eci+1,e.eri,l)):(s>0&&r(e.sri,o,a,e.sci-1),f>0&&r(e.sri,e.eci+1,a,l))):u>0&&(r(e.eri+1,o,a,l),s>0&&r(i,o,e.eri,e.sci-1),f>0&&r(i,e.eci+1,e.eri,l)),s>0?(r(i,o,a,e.sci-1),f>0?(r(i,e.eri+1,a,l),c>0&&r(i,e.sci,e.sri-1,e.eci),u>0&&r(e.sri+1,e.sci,a,e.eci)):(c>0&&r(i,e.sci,e.sri-1,l),u>0&&r(e.sri+1,e.sci,a,l))):f>0&&(r(a,e.eci+1,a,l),c>0&&r(i,o,e.sri-1,e.eci),u>0&&r(e.eri+1,o,a,e.eci)),n}},{key:\"size\",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:\"toString\",value:function(){var t=this.sri,e=this.sci,n=this.eri,r=this.eci,i=h(e,t);return this.multiple()&&(i=\"\".concat(i,\":\").concat(h(r,n))),i}},{key:\"clone\",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:\"equals\",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}])&&y(e.prototype,n),r&&y(e,r),t}();function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var g=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=new v(0,0,0,0),this.ri=0,this.ci=0}var e,n,r;return e=t,(n=[{key:\"multiple\",value:function(){return this.range.multiple()}},{key:\"setIndexes\",value:function(t,e){this.ri=t,this.ci=e}},{key:\"size\",value:function(){return this.range.size()}}])&&b(e.prototype,n),r&&b(e,r),t}();var m=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0};function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var k=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.undoItems=[],this.redoItems=[]}var e,n,r;return e=t,(n=[{key:\"add\",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:\"canUndo\",value:function(){return this.undoItems.length>0}},{key:\"canRedo\",value:function(){return this.redoItems.length>0}},{key:\"undo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canUndo()&&(r.push(JSON.stringify(t)),e(JSON.parse(n.pop())))}},{key:\"redo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canRedo()&&(n.push(JSON.stringify(t)),e(JSON.parse(r.pop())))}}])&&w(e.prototype,n),r&&w(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var S=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=null,this.state=\"clear\"}var e,n,r;return e=t,(n=[{key:\"copy\",value:function(t){return this.range=t,this.state=\"copy\",this}},{key:\"cut\",value:function(t){return this.range=t,this.state=\"cut\",this}},{key:\"isCopy\",value:function(){return\"copy\"===this.state}},{key:\"isCut\",value:function(){return\"cut\"===this.state}},{key:\"isClear\",value:function(){return\"clear\"===this.state}},{key:\"clear\",value:function(){this.range=null,this.state=\"clear\"}}])&&O(e.prototype,n),r&&O(e,r),t}();function x(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function j(t,e,n){return e&&E(t.prototype,e),n&&E(t,n),t}var _=function(){function t(e,n,r){x(this,t),this.ci=e,this.operator=n,this.value=r}return j(t,[{key:\"set\",value:function(t,e){this.operator=t,this.value=e}},{key:\"includes\",value:function(t){var e=this.operator,n=this.value;return\"all\"===e||\"in\"===e&&n.includes(t)}},{key:\"vlength\",value:function(){var t=this.operator,e=this.value;return\"in\"===t?e.length:0}},{key:\"getData\",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),C=function(){function t(e,n){x(this,t),this.ci=e,this.order=n}return j(t,[{key:\"asc\",value:function(){return\"asc\"===this.order}},{key:\"desc\",value:function(){return\"desc\"===this.order}}]),t}(),T=function(){function t(){x(this,t),this.ref=null,this.filters=[],this.sort=null}return j(t,[{key:\"setData\",value:function(t){var e=t.ref,n=t.filters,r=t.sort;null!=e&&(this.ref=e,this.filters=n.map(function(t){return new _(t.ci,t.operator,t.value)}),r&&(this.sort=new C(r.ci,r.order)))}},{key:\"getData\",value:function(){if(this.active()){var t=this.ref,e=this.filters,n=this.sort;return{ref:t,filters:e.map(function(t){return t.getData()}),sort:n}}return{}}},{key:\"addFilter\",value:function(t,e,n){var r=this.getFilter(t);null==r?this.filters.push(new _(t,e,n)):r.set(e,n)}},{key:\"setSort\",value:function(t,e){this.sort=e?new C(t,e):null}},{key:\"includes\",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:\"getSort\",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:\"getFilter\",value:function(t){for(var e=this.filters,n=0;n<e.length;n+=1)if(e[n].ci===t)return e[n];return null}},{key:\"filteredRows\",value:function(t){var e=new Set,n=new Set;if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=this.filters,l=i+1;l<=o;l+=1)for(var c=0;c<a.length;c+=1){var s=a[c],u=t(l,s.ci),f=u?u.text:\"\";if(!s.includes(f)){e.add(l);break}n.add(l)}return{rset:e,fset:n}}},{key:\"items\",value:function(t,e){var n={};if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=i+1;a<=o;a+=1){var l=e(a,t);if(null===l||/^\\s*$/.test(l.text))n[\"\"]=(n[\"\"]||0)+1;else{var c=l.text,s=(n[c]||0)+1;n[c]=s}}return n}},{key:\"range\",value:function(){return v.valueOf(this.ref)}},{key:\"hrange\",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:\"clear\",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:\"active\",value:function(){return null!==this.ref}}]),t}();function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._=e}var e,n,r;return e=t,(n=[{key:\"forEach\",value:function(t){this._.forEach(t)}},{key:\"deleteWithin\",value:function(t){this._=this._.filter(function(e){return!e.within(t)})}},{key:\"getFirstIncludes\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"filterIntersects\",value:function(e){return new t(this._.filter(function(t){return t.intersects(e)}))}},{key:\"intersects\",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:\"union\",value:function(t){var e=t;return this._.forEach(function(t){t.intersects(e)&&(e=t.union(e))}),e}},{key:\"add\",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:\"shift\",value:function(t,e,n,r){this._.forEach(function(i){var o=i.sri,a=i.sci,l=i.eri,c=i.eci,s=i;\"row\"===t?o>=e?(s.sri+=n,s.eri+=n):o<e&&e<=l&&(s.eri+=n,r(o,a,n,0)):\"column\"===t&&(a>=e?(s.sci+=n,s.eci+=n):a<e&&e<=c&&(s.eci+=n,r(o,a,0,n)))})}},{key:\"move\",value:function(t,e,n){this._.forEach(function(r){var i=r;i.within(t)&&(i.eri+=e,i.sri+=e,i.sci+=n,i.eci+=n)})}},{key:\"setData\",value:function(t){return this._=t.map(function(t){return v.valueOf(t)}),this}},{key:\"getData\",value:function(){return this._.map(function(t){return t.toString()})}}])&&P(e.prototype,n),r&&P(e,r),t}();var R=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach(function(n){Object.keys(n).forEach(function(r){var i=n[r];\"string\"==typeof i||\"number\"==typeof i||\"boolean\"==typeof i?e[r]=i:\"function\"!=typeof i&&!Array.isArray(i)&&i instanceof Object?(e[r]=e[r]||{},t(e[r],i)):e[r]=i})}),e};function D(t){for(var e=\"\".concat(t),n=0,r=!1,i=0;i<e.length;i+=1)!0===r&&(n+=1),\".\"===e.charAt(i)&&(r=!0);return n}function I(t,e,n){if(Number.isNaN(e)||Number.isNaN(n))return e+t+n;var r=D(e),i=D(n),o=Number(e),a=Number(n),l=0;if(\"-\"===t)l=o-a;else if(\"+\"===t)l=o+a;else if(\"*\"===t)l=o*a;else if(\"/\"===t)return D(l=o/a)>5?l.toFixed(2):l;return l.toFixed(Math.max(r,i))}var z={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return R.apply(void 0,[{}].concat(e))},equals:function t(e,n){var r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(var i=0;i<r.length;i+=1){var o=r[i],a=e[o],l=n[o];if(void 0===l)return!1;if(\"string\"==typeof a||\"number\"==typeof a||\"boolean\"==typeof a){if(a!==l)return!1}else if(Array.isArray(a)){if(a.length!==l.length)return!1;for(var c=0;c<a.length;c+=1)if(!t(a[c],l[c]))return!1}else if(\"function\"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,l))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=0,r=0;return Object.keys(t).forEach(function(i){n+=e(t[i],i),r+=1}),[n,r]},rangeEach:function(t,e,n){for(var r=t;r<e;r+=1)n(r)},rangeSum:function(t,e,n){for(var r=0,i=t;i<e;i+=1)r+=n(i);return r},rangeReduceIf:function(t,e,n,r,i,o){for(var a=n,l=r,c=t;c<e&&!(a>i);c+=1)a+=l=o(c);return[c,a-l,l]},deleteProperty:function(t,e){var n=t[\"\".concat(e)];return delete t[\"\".concat(e)],n},numberCalc:I};function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N=function(){function t(e){var n=e.len,r=e.height;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.height=r}var e,n,r;return e=t,(n=[{key:\"getHeight\",value:function(t){if(this.isHide(t))return 0;var e=this.get(t);return e&&e.height?e.height:this.height}},{key:\"setHeight\",value:function(t,e){this.getOrNew(t).height=e}},{key:\"unhide\",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:\"isHide\",value:function(t){var e=this.get(t);return e&&e.hide}},{key:\"setHide\",value:function(t,e){var n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumHeight\",value:function(t,e,n){var r=this;return z.rangeSum(t,e,function(t){return n&&n.has(t)?0:r.getHeight(t)})}},{key:\"totalHeight\",value:function(){return this.sumHeight(0,this.len)}},{key:\"get\",value:function(t){return this._[t]}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:\"getCell\",value:function(t,e){var n=this.get(t);return void 0!==n&&void 0!==n.cells&&void 0!==n.cells[e]?n.cells[e]:null}},{key:\"getCellMerge\",value:function(t,e){var n=this.getCell(t,e);return n&&n.merge?n.merge:[0,0]}},{key:\"getCellOrNew\",value:function(t,e){var n=this.getOrNew(t);return n.cells[e]=n.cells[e]||{},n.cells[e]}},{key:\"setCell\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"all\",i=this.getOrNew(t);\"all\"===r?i.cells[e]=n:\"text\"===r?(i.cells[e]=i.cells[e]||{},i.cells[e].text=n.text):\"format\"===r&&(i.cells[e]=i.cells[e]||{},i.cells[e].style=n.style,n.merge&&(i.cells[e].merge=n.merge))}},{key:\"setCellText\",value:function(t,e,n){var r=this.getCellOrNew(t,e);!1!==r.editable&&(r.text=n)}},{key:\"copyPaste\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=e.sri,u=e.sci,f=e.eri,h=e.eci,d=t.size(),y=H(d,2),v=y[0],b=y[1],g=e.size(),m=H(g,2),w=m[0],k=m[1],O=!0,S=0;(f<o||h<a)&&(O=!1,S=f<o?w:k);for(var x=o;x<=l;x+=1)if(this._[x])for(var E=a;E<=c;E+=1)if(this._[x].cells&&this._[x].cells[E])for(var j=s;j<=f;j+=v)for(var _=u;_<=h;_+=b){var C=j+(x-o),T=_+(E-a),P=z.cloneDeep(this._[x].cells[E]);r&&P&&P.text&&P.text.length>0&&function(){var t=P.text,e=_-u+(j-s)+2;if(O||(e-=S+1),\"=\"===t[0])P.text=t.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){var n=0,r=0;return o===s?n=e-1:r=e-1,/^\\d+$/.test(t)?t:p(t,n,r)});else if(v<=1&&b>1&&(s>l||f<o)||b<=1&&v>1&&(u>c||h<a)||v<=1&&b<=1){var n=/[\\\\.\\d]+$/.exec(t);if(null!==n){var r=Number(n[0])+e-1;P.text=t.substring(0,n.index)+r}}}(),this.setCell(C,T,P,n),i(C,T,P)}}},{key:\"cutPaste\",value:function(t,e){var n=this,r={};this.each(function(i){n.eachCells(i,function(o){var a=parseInt(i,10),l=parseInt(o,10);t.includes(i,o)&&(a=e.sri+(a-t.sri),l=e.sci+(l-t.sci)),r[a]=r[a]||{cells:{}},r[a].cells[l]=n._[i].cells[o]})}),this._=r}},{key:\"paste\",value:function(t,e){var n=this;if(!(t.length<=0)){var r=e.sri,i=e.sci;t.forEach(function(t,e){var o=r+e;t.forEach(function(t,e){var r=i+e;n.setCellText(o,r,t)})})}}},{key:\"insert\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r={};this.each(function(i,o){var a=parseInt(i,10);a>=t&&(a+=n,e.eachCells(i,function(e,r){r.text&&\"=\"===r.text[0]&&(r.text=r.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(e){return p(e,0,n,function(e,n){return n>=t})}))})),r[a]=o}),this._=r,this.len+=n}},{key:\"delete\",value:function(t,e){var n=this,r=e-t+1,i={};this.each(function(o,a){var l=parseInt(o,10);l<t?i[l]=a:o>e&&(i[l-r]=a,n.eachCells(o,function(t,n){n.text&&\"=\"===n.text[0]&&(n.text=n.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){return p(t,0,-r,function(t,n){return n>e})}))}))}),this._=i,this.len-=r}},{key:\"insertColumn\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.each(function(r,i){var o={};e.eachCells(r,function(e,r){var i=parseInt(e,10);i>=t&&(i+=n,r.text&&\"=\"===r.text[0]&&(r.text=r.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(e){return p(e,n,0,function(e){return e>=t})}))),o[i]=r}),i.cells=o})}},{key:\"deleteColumn\",value:function(t,e){var n=this,r=e-t+1;this.each(function(i,o){var a={};n.eachCells(i,function(n,i){var o=parseInt(n,10);o<t?a[o]=i:o>e&&(a[o-r]=i,i.text&&\"=\"===i.text[0]&&(i.text=i.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){return p(t,-r,0,function(t){return t>e})})))}),o.cells=a})}},{key:\"deleteCells\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"all\";t.each(function(t,r){e.deleteCell(t,r,n)})}},{key:\"deleteCell\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"all\",r=this.get(t);if(null!==r){var i=this.getCell(t,e);null!==i&&!1!==i.editable&&(\"all\"===n?delete r.cells[e]:\"text\"===n?(i.text&&delete i.text,i.value&&delete i.value):\"format\"===n?(void 0!==i.style&&delete i.style,i.merge&&delete i.merge):\"merge\"===n&&i.merge&&delete i.merge)}}},{key:\"maxCell\",value:function(){var t=Object.keys(this._),e=t[t.length-1],n=this._[e];if(n){var r=n.cells,i=Object.keys(r),o=i[i.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:\"each\",value:function(t){Object.entries(this._).forEach(function(e){var n=H(e,2),r=n[0],i=n[1];t(r,i)})}},{key:\"eachCells\",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach(function(t){var n=H(t,2),r=n[0],i=n[1];e(r,i)})}},{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}}])&&M(e.prototype,n),r&&M(e,r),t}();function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=e.len,r=e.width,i=e.indexWidth,o=e.minWidth;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.width=r,this.indexWidth=i,this.minWidth=o}var e,n,r;return e=t,(n=[{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:\"getWidth\",value:function(t){if(this.isHide(t))return 0;var e=this._[t];return e&&e.width?e.width:this.width}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:\"setWidth\",value:function(t,e){this.getOrNew(t).width=e}},{key:\"unhide\",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:\"isHide\",value:function(t){var e=this._[t];return e&&e.hide}},{key:\"setHide\",value:function(t,e){var n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumWidth\",value:function(t,e){var n=this;return z.rangeSum(t,e,function(t){return n.getWidth(t)})}},{key:\"totalWidth\",value:function(){return this.sumWidth(0,this.len)}}])&&F(e.prototype,n),r&&F(e,r),t}(),V=[\"en\"],q={en:{toolbar:{undo:\"Undo\",redo:\"Redo\",print:\"Print\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",fontName:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",color:\"Text color\",bgcolor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",autofilter:\"Filter\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",hide:\"Hide\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteSheet:\"Delete\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\",cellprintable:\"Enable export\",cellnonprintable:\"Disable export\",celleditable:\"Enable editing\",cellnoneditable:\"Disable editing\"},print:{size:\"Paper size\",orientation:\"Page orientation\",orientations:[\"Landscape\",\"Portrait\"]},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",eur:\"EUR\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",_if:\"IF\",and:\"AND\",or:\"OR\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{next:\"Next\",cancel:\"Cancel\",remove:\"Remove\",save:\"Save\",ok:\"OK\"},sort:{desc:\"Sort Z -> A\",asc:\"Sort A -> Z\"},filter:{empty:\"empty\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}}};function B(t,e){if(e)for(var n=0,r=V;n<r.length;n++){var i=r[n];if(!e[i])break;for(var o=e[i],a=t.match(/(?:\\\\.|[^.])+/g),l=0;l<a.length;l+=1){var c=o[a[l]];if(!c)break;if(l===a.length-1)return c;o=c}}}function L(t){var e=B(t,q);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=B(t,window.x_spreadsheet.$messages)),e||\"\"}function U(t){return function(){return L(t)}}function Y(t,e){arguments.length>2&&void 0!==arguments[2]&&arguments[2]?V=[t]:V.unshift(t),e&&(q[t]=e)}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Z={phone:/^[1-9]\\d{10}$/,email:/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/};function K(t,e){var n=\"\";if(!t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n=L.apply(void 0,[\"validation.\".concat(e)].concat(i))}return[t,n]}var J=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.required=n,this.value=r,this.type=e,this.operator=i,this.message=\"\"}var e,n,r;return e=t,(n=[{key:\"parseValue\",value:function(t){var e=this.type;return\"date\"===e?new Date(t):\"number\"===e?Number(t):t}},{key:\"equals\",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?z.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:\"values\",value:function(){return this.value.split(\",\")}},{key:\"validate\",value:function(t){var e=this.required,n=this.operator,r=this.value,i=this.type;if(e&&/^\\s*$/.test(t))return K(!1,\"required\");if(/^\\s*$/.test(t))return[!0];if(Z[i]&&!Z[i].test(t))return K(!1,\"notMatch\");if(\"list\"===i)return K(this.values().includes(t),\"notIn\");if(n){var o=this.parseValue(t);if(\"be\"===n){var a=$(r,2),l=a[0],c=a[1];return K(o>=this.parseValue(l)&&o<=this.parseValue(c),\"between\",l,c)}if(\"nbe\"===n){var s=$(r,2),u=s[0],f=s[1];return K(o<this.parseValue(u)||o>this.parseValue(f),\"notBetween\",u,f)}if(\"eq\"===n)return K(o===this.parseValue(r),\"equal\",r);if(\"neq\"===n)return K(o!==this.parseValue(r),\"notEqual\",r);if(\"lt\"===n)return K(o<this.parseValue(r),\"lessThan\",r);if(\"lte\"===n)return K(o<=this.parseValue(r),\"lessThanEqual\",r);if(\"gt\"===n)return K(o>this.parseValue(r),\"greaterThan\",r);if(\"gte\"===n)return K(o>=this.parseValue(r),\"greaterThanEqual\",r)}return[!0]}}])&&X(e.prototype,n),r&&X(e,r),t}();function G(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Q(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function et(t,e,n){return e&&tt(t.prototype,e),n&&tt(t,n),t}var nt=function(){function t(e,n,r){Q(this,t),this.refs=n,this.mode=e,this.validator=r}return et(t,[{key:\"includes\",value:function(t,e){for(var n=this.refs,r=0;r<n.length;r+=1){if(v.valueOf(n[r]).includes(t,e))return!0}return!1}},{key:\"addRef\",value:function(t){this.remove(v.valueOf(t)),this.refs.push(t)}},{key:\"remove\",value:function(t){var e=[];this.refs.forEach(function(n){var r=v.valueOf(n);r.intersects(t)?r.difference(t).forEach(function(t){return e.push(t.toString())}):e.push(n)}),this.refs=e}},{key:\"getData\",value:function(){var t=this.refs,e=this.mode,n=this.validator;return{refs:t,mode:e,type:n.type,required:n.required,operator:n.operator,value:n.value}}}],[{key:\"valueOf\",value:function(e){var n=e.refs,r=e.mode,i=e.type,o=e.required,a=e.operator,l=e.value;return new t(r,n,new J(i,o,l,a))}}]),t}(),rt=function(){function t(){Q(this,t),this._=[],this.errors=new Map}return et(t,[{key:\"getError\",value:function(t,e){return this.errors.get(\"\".concat(t,\"_\").concat(e))}},{key:\"validate\",value:function(t,e,n){var r=this.get(t,e),i=\"\".concat(t,\"_\").concat(e),o=this.errors;if(null!==r){var a=G(r.validator.validate(n),2),l=a[0],c=a[1];l?o.delete(i):o.set(i,c)}else o.delete(i);return!0}},{key:\"add\",value:function(t,e,n){var r=n.type,i=n.required,o=n.value,a=n.operator,l=new J(r,i,o,a),c=this.getByValidator(l);null!==c?c.addRef(e):this._.push(new nt(t,[e],l))}},{key:\"getByValidator\",value:function(t){for(var e=0;e<this._.length;e+=1){var n=this._[e];if(n.validator.equals(t))return n}return null}},{key:\"get\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"remove\",value:function(t){this.each(function(e){e.remove(t)})}},{key:\"each\",value:function(t){this._.forEach(function(e){return t(e)})}},{key:\"getData\",value:function(){return this._.filter(function(t){return t.refs.length>0}).map(function(t){return t.getData()})}},{key:\"setData\",value:function(t){this._=t.map(function(t){return nt.valueOf(t)})}}]),t}();function it(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function at(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var lt={mode:\"edit\",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showGrid:!0,showToolbar:!0,showContextmenu:!0,showBottomBar:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{bgcolor:\"#ffffff\",align:\"left\",valign:\"middle\",textwrap:!1,strike:!1,underline:!1,color:\"#0a0a0a\",font:{name:\"Arial\",size:10,bold:!1,italic:!1},format:\"normal\"}},ct=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function st(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.merges,i=e.clone(),o=at(t.size(),2),a=o[0],l=o[1],c=at(e.size(),2),s=c[0],u=c[1];return a>s&&(i.eri=e.sri+a-1),l>u&&(i.eci=e.sci+l-1),!r.intersects(i)||(n(L(\"error.pasteForMergedCell\")),!1)}function ut(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.rows,o=this.merges;\"all\"!==n&&\"format\"!==n||(i.deleteCells(e,n),o.deleteWithin(e)),i.copyPaste(t,e,n,r,function(t,e,n){if(n&&n.merge){var r=at(n.merge,2),i=r[0],a=r[1];if(i<=0&&a<=0)return;o.add(new v(t,e,t+i,e+a))}})}function ft(t,e){var n=this.clipboard,r=this.rows,i=this.merges;r.cutPaste(t,e),i.move(t,e.sri-t.sri,e.sci-t.sci),n.clear()}function ht(t,e,n){var r=this.styles,i=this.rows.getCellOrNew(t,e),o={};void 0!==i.style&&(o=z.cloneDeep(r[i.style])),o=z.merge(o,{border:n}),i.style=this.addStyle(o)}var pt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.settings=z.merge(lt,n||{}),this.name=e||\"sheet\",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new N(this.settings.row),this.cols=new W(this.settings.col),this.validations=new rt,this.hyperlinks={},this.comments={},this.selector=new g,this.scroll=new m,this.history=new k,this.clipboard=new S,this.autoFilter=new T,this.change=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map}var e,n,r;return e=t,(n=[{key:\"addValidation\",value:function(t,e,n){var r=this;this.changeData(function(){r.validations.add(t,e,n)})}},{key:\"removeValidation\",value:function(){var t=this,e=this.selector.range;this.changeData(function(){t.validations.remove(e)})}},{key:\"getSelectedValidator\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=this.validations.get(e,n);return r?r.validator:null}},{key:\"getSelectedValidation\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=t.range,i=this.validations.get(e,n),o={ref:r.toString()};return null!==i&&(o.mode=i.mode,o.validator=i.validator),o}},{key:\"canUndo\",value:function(){return this.history.canUndo()}},{key:\"canRedo\",value:function(){return this.history.canRedo()}},{key:\"undo\",value:function(){var t=this;this.history.undo(this.getData(),function(e){t.setData(e)})}},{key:\"redo\",value:function(){var t=this;this.history.redo(this.getData(),function(e){t.setData(e)})}},{key:\"copy\",value:function(){this.clipboard.copy(this.selector.range)}},{key:\"copyToSystemClipboard\",value:function(){if(void 0!==navigator.clipboard){for(var t=\"\",e=this.rows.getData(),n=this.selector.range.sri;n<=this.selector.range.eri;n+=1){if(ct(e,n)){for(var r=this.selector.range.sci;r<=this.selector.range.eci;r+=1)if(r>this.selector.range.sci&&(t+=\"\\t\"),ct(e[n].cells,r)){var i=String(e[n].cells[r].text);-1===i.indexOf(\"\\n\")&&-1===i.indexOf(\"\\t\")&&-1===i.indexOf('\"')?t+=i:t+='\"'.concat(i,'\"')}}else for(var o=this.selector.range.sci;o<=this.selector.range.eci;o+=1)t+=\"\\t\";t+=\"\\n\"}navigator.clipboard.writeText(t).then(function(){},function(e){console.log(\"text copy to the system clipboard error  \",t,e)})}}},{key:\"cut\",value:function(){this.clipboard.cut(this.selector.range)}},{key:\"paste\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=this.clipboard,i=this.selector;return!r.isClear()&&(!!st.call(this,r.range,i.range,n)&&(this.changeData(function(){r.isCopy()?ut.call(t,r.range,i.range,e):r.isCut()&&ft.call(t,r.range,i.range)}),!0))}},{key:\"pasteFromText\",value:function(t){var e=t.split(\"\\r\\n\").map(function(t){return t.replace(/\"/g,\"\").split(\"\\t\")});e.length>0&&(e.length-=1);var n=this.rows,r=this.selector;this.changeData(function(){n.paste(e,r.range)})}},{key:\"autofill\",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=this.selector.range;return!!st.call(this,i,t,r)&&(this.changeData(function(){ut.call(n,i,t,e,!0)}),!0)}},{key:\"clearClipboard\",value:function(){this.clipboard.clear()}},{key:\"calSelectedRangeByEnd\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges,a=n.range,l=a.sri,c=a.sci,s=a.eri,u=a.eci,f=n.ri,h=n.ci,p=t,d=e;return t<0&&(p=r.len-1),e<0&&(d=i.len-1),p>f?(l=f,s=p):(l=p,s=f),d>h?(c=h,u=d):(c=d,u=h),n.range=o.union(new v(l,c,s,u)),n.range=o.union(n.range),n.range}},{key:\"calSelectedRangeByStart\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new v(t,e,t,e),-1===t&&(o.sri=0,o.eri=r.len-1),-1===e&&(o.sci=0,o.eci=i.len-1)),n.range=o,o}},{key:\"setSelectedCellAttr\",value:function(t,e){var n=this;this.changeData(function(){var r=n.selector,i=n.styles,o=n.rows;if(\"merge\"===t)e?n.merge():n.unmerge();else if(\"border\"===t)(function(t){var e=this,n=t.mode,r=t.style,i=t.color,o=this.styles,a=this.selector,l=this.rows,c=a.range,s=c.sri,u=c.sci,f=c.eri,h=c.eci,p=!this.isSingleSelected();if(p||\"inside\"!==n&&\"horizontal\"!==n&&\"vertical\"!==n)if(\"outside\"!==n||p){if(\"none\"===n)a.range.each(function(t,n){var r=l.getCell(t,n);if(r&&void 0!==r.style){var i=z.cloneDeep(o[r.style]);delete i.border,r.style=e.addStyle(i)}});else if(\"all\"===n||\"inside\"===n||\"outside\"===n||\"horizontal\"===n||\"vertical\"===n)!function(){for(var t=[],o=s;o<=f;o+=1)for(var a=u;a<=h;a+=1){for(var c=[],d=0;d<t.length;d+=1){var y=at(t[d],4),v=y[0],b=y[1],g=y[2],m=y[3];if(o===v+g+1&&c.push(d),v<=o&&o<=v+g&&a===b){a+=m+1;break}}if(c.forEach(function(e){return t.splice(e,1)}),a>h)break;var w=l.getCell(o,a),k=0,O=0;if(w&&w.merge){var S=at(w.merge,2);k=S[0],O=S[1],t.push([o,a,k,O])}var x=k>0&&o+k===f,E=O>0&&a+O===h,j={};\"all\"===n?j={bottom:[r,i],top:[r,i],left:[r,i],right:[r,i]}:\"inside\"===n?(!E&&a<h&&(j.right=[r,i]),!x&&o<f&&(j.bottom=[r,i])):\"horizontal\"===n?!x&&o<f&&(j.bottom=[r,i]):\"vertical\"===n?!E&&a<h&&(j.right=[r,i]):\"outside\"===n&&p&&(s===o&&(j.top=[r,i]),(x||f===o)&&(j.bottom=[r,i]),u===a&&(j.left=[r,i]),(E||h===a)&&(j.right=[r,i])),Object.keys(j).length>0&&ht.call(e,o,a,j),a+=O}}();else if(\"top\"===n||\"bottom\"===n)for(var d=u;d<=h;d+=1)\"top\"===n&&(ht.call(this,s,d,{top:[r,i]}),d+=l.getCellMerge(s,d)[1]),\"bottom\"===n&&(ht.call(this,f,d,{bottom:[r,i]}),d+=l.getCellMerge(f,d)[1]);else if(\"left\"===n||\"right\"===n)for(var y=s;y<=f;y+=1)\"left\"===n&&(ht.call(this,y,u,{left:[r,i]}),y+=l.getCellMerge(y,u)[0]),\"right\"===n&&(ht.call(this,y,h,{right:[r,i]}),y+=l.getCellMerge(y,h)[0])}else ht.call(this,s,u,{top:[r,i],bottom:[r,i],left:[r,i],right:[r,i]})}).call(n,e);else if(\"formula\"===t){var a=r.ri,l=r.ci,c=r.range;if(r.multiple()){var s=at(r.size(),2),u=s[0],f=s[1],p=c.sri,d=c.sci,y=c.eri,v=c.eci;if(u>1)for(var b=d;b<=v;b+=1){o.getCellOrNew(y+1,b).text=\"=\".concat(e,\"(\").concat(h(b,p),\":\").concat(h(b,y),\")\")}else if(f>1){o.getCellOrNew(a,v+1).text=\"=\".concat(e,\"(\").concat(h(d,a),\":\").concat(h(v,a),\")\")}}else{o.getCellOrNew(a,l).text=\"=\".concat(e,\"()\")}}else r.range.each(function(r,a){var l=o.getCellOrNew(r,a),c={};if(void 0!==l.style&&(c=z.cloneDeep(i[l.style])),\"format\"===t)c.format=e,l.style=n.addStyle(c);else if(\"font-bold\"===t||\"font-italic\"===t||\"font-name\"===t||\"font-size\"===t){var s={};s[t.split(\"-\")[1]]=e,c.font=Object.assign(c.font||{},s),l.style=n.addStyle(c)}else\"strike\"===t||\"textwrap\"===t||\"underline\"===t||\"align\"===t||\"valign\"===t||\"color\"===t||\"bgcolor\"===t?(c[t]=e,l.style=n.addStyle(c)):l[t]=e})})}},{key:\"setSelectedCellText\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"input\",n=this.autoFilter,r=this.selector,i=this.rows,o=r.ri,a=r.ci,l=o;this.unsortedRowMap.has(o)&&(l=this.unsortedRowMap.get(o));var c=i.getCell(l,a),s=c?c.text:\"\";if(this.setCellText(l,a,t,e),n.active()){var u=n.getFilter(a);if(u){var f=u.value.findIndex(function(t){return t===s});f>=0&&u.value.splice(f,1,t)}}}},{key:\"getSelectedCell\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=e;return this.unsortedRowMap.has(e)&&(r=this.unsortedRowMap.get(e)),this.rows.getCell(r,n)}},{key:\"xyInSelectedRect\",value:function(t,e){var n=this.getSelectedRect(),r=n.left,i=n.top,o=n.width,a=n.height,l=t-this.cols.indexWidth,c=e-this.rows.height;return l>r&&l<r+o&&c>i&&c<i+a}},{key:\"getSelectedRect\",value:function(){return this.getRect(this.selector.range)}},{key:\"getClipboardRect\",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:\"getRect\",value:function(t){var e=this.scroll,n=this.rows,r=this.cols,i=this.exceptRowSet,o=t.sri,a=t.sci,l=t.eri,c=t.eci;if(o<0&&a<0)return{left:0,l:0,top:0,t:0,scroll:e};var s=r.sumWidth(0,a),u=n.sumHeight(0,o,i),f=n.sumHeight(o,l+1,i),h=r.sumWidth(a,c+1),p=s-e.x,d=u-e.y,y=this.freezeTotalHeight(),v=this.freezeTotalWidth();return v>0&&v>s&&(p=s),y>0&&y>u&&(d=u),{l:s,t:u,left:p,top:d,height:f,width:h,scroll:e}}},{key:\"getCellRectByXY\",value:function(t,e){var n=this.scroll,r=this.merges,i=this.rows,o=this.cols,a=function(t,e){var n=this.rows,r=this.freezeTotalHeight(),i=n.height;r+n.height<t&&(i-=e);for(var o=this.exceptRowSet,a=0,l=i,c=n.height;a<n.len&&!(l>t);a+=1)o.has(a)||(l+=c=n.getHeight(a));return(l-=c)<=0?{ri:-1,top:0,height:c}:{ri:a-1,top:l,height:c}}.call(this,e,n.y),l=a.ri,c=a.top,s=a.height,u=function(t,e){var n=this.cols,r=this.freezeTotalWidth(),i=n.indexWidth;r+n.indexWidth<t&&(i-=e);var o=at(z.rangeReduceIf(0,n.len,i,n.indexWidth,t,function(t){return n.getWidth(t)}),3),a=o[0],l=o[1],c=o[2];return l<=0?{ci:-1,left:0,width:n.indexWidth}:{ci:a-1,left:l,width:c}}.call(this,t,n.x),f=u.ci,h=u.left,p=u.width;if(-1===f&&(p=o.totalWidth()),-1===l&&(s=i.totalHeight()),l>=0||f>=0){var d=r.getFirstIncludes(l,f);if(d){l=d.sri,f=d.sci;var y=this.cellRect(l,f);h=y.left,c=y.top,p=y.width,s=y.height}}return{ri:l,ci:f,left:h,top:c,width:p,height:s}}},{key:\"isSingleSelected\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=at(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!this.selector.multiple()}},{key:\"canUnmerge\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=at(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!1}},{key:\"merge\",value:function(){var t=this,e=this.selector,n=this.rows;if(!this.isSingleSelected()){var r=at(e.size(),2),i=r[0],o=r[1];if(i>1||o>1){var a=e.range,l=a.sri,c=a.sci;this.changeData(function(){var r=n.getCellOrNew(l,c);r.merge=[i-1,o-1],t.merges.add(e.range),t.rows.deleteCells(e.range),t.rows.setCell(l,c,r)})}}}},{key:\"unmerge\",value:function(){var t=this,e=this.selector;if(this.isSingleSelected()){var n=e.range,r=n.sri,i=n.sci;this.changeData(function(){t.rows.deleteCell(r,i,\"merge\"),t.merges.deleteWithin(e.range)})}}},{key:\"canAutofilter\",value:function(){return!this.autoFilter.active()}},{key:\"autofilter\",value:function(){var t=this,e=this.autoFilter,n=this.selector;this.changeData(function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=n.range.toString()})}},{key:\"setAutoFilter\",value:function(t,e,n,r){var i=this.autoFilter;i.addFilter(t,n,r),i.setSort(t,e),this.resetAutoFilter()}},{key:\"resetAutoFilter\",value:function(){var t=this,e=this.autoFilter,n=this.rows;if(e.active()){var r=e.sort,i=e.filteredRows(function(t,e){return n.getCell(t,e)}),o=i.rset,a=i.fset,l=Array.from(a),c=Array.from(a);r&&l.sort(function(t,e){return\"asc\"===r.order?t-e:\"desc\"===r.order?e-t:0}),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach(function(e,n){t.sortedRowMap.set(c[n],e),t.unsortedRowMap.set(e,c[n])})}}},{key:\"deleteCell\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=this.selector;this.changeData(function(){t.rows.deleteCells(n.range,e),\"all\"!==e&&\"format\"!==e||t.merges.deleteWithin(n.range)})}},{key:\"insert\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData(function(){var r=e.selector.range,i=r.sri,o=r.sci,a=e.rows,l=e.merges,c=e.cols,s=i;\"row\"===t?a.insert(i,n):\"column\"===t&&(a.insertColumn(o,n),s=o,c.len+=1),l.shift(t,s,n,function(t,e,n,r){var i=a.getCell(t,e);i.merge[0]+=n,i.merge[1]+=r})})}},{key:\"delete\",value:function(t){var e=this;this.changeData(function(){var n=e.rows,r=e.merges,i=e.selector,o=e.cols,a=i.range,l=i.range,c=l.sri,s=l.sci,u=l.eri,f=l.eci,h=at(i.range.size(),2),p=h[0],d=h[1],y=c,v=p;\"row\"===t?n.delete(c,u):\"column\"===t&&(n.deleteColumn(s,f),y=a.sci,v=d,o.len-=f-s+1),r.shift(t,y,-v,function(t,e,r,i){var o=n.getCell(t,e);o.merge[0]+=r,o.merge[1]+=i,0===o.merge[0]&&0===o.merge[1]&&delete o.merge})})}},{key:\"scrollx\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.cols,o=at(r,2)[1],a=at(z.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getWidth(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.x!==u&&(n.ci=t>0?l:0,n.x=u,e())}},{key:\"scrolly\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.rows,o=at(r,1)[0],a=at(z.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getHeight(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.y!==u&&(n.ri=t>0?l:0,n.y=u,e())}},{key:\"cellRect\",value:function(t,e){var n=this.rows,r=this.cols,i=r.sumWidth(0,e),o=n.sumHeight(0,t),a=n.getCell(t,e),l=r.getWidth(e),c=n.getHeight(t);if(null!==a&&a.merge){var s=at(a.merge,2),u=s[0],f=s[1];if(u>0)for(var h=1;h<=u;h+=1)c+=n.getHeight(t+h);if(f>0)for(var p=1;p<=f;p+=1)l+=r.getWidth(e+p)}return{left:i,top:o,width:l,height:c,cell:a}}},{key:\"getCell\",value:function(t,e){return this.rows.getCell(t,e)}},{key:\"getCellTextOrDefault\",value:function(t,e){var n=this.getCell(t,e);return n&&n.text?n.text:\"\"}},{key:\"getCellStyle\",value:function(t,e){var n=this.getCell(t,e);return n&&void 0!==n.style?this.styles[n.style]:null}},{key:\"getCellStyleOrDefault\",value:function(t,e){var n=this.styles,r=this.rows.getCell(t,e),i=r&&void 0!==r.style?n[r.style]:{};return z.merge(this.defaultStyle(),i)}},{key:\"getSelectedCellStyle\",value:function(){var t=this.selector,e=t.ri,n=t.ci;return this.getCellStyleOrDefault(e,n)}},{key:\"setCellText\",value:function(t,e,n,r){var i=this.rows,o=this.history,a=this.validations;\"finished\"===r?(i.setCellText(t,e,\"\"),o.add(this.getData()),i.setCellText(t,e,n)):(i.setCellText(t,e,n),this.change(this.getData())),a.validate(t,e,n)}},{key:\"freezeIsActive\",value:function(){var t=at(this.freeze,2),e=t[0],n=t[1];return e>0||n>0}},{key:\"setFreeze\",value:function(t,e){var n=this;this.changeData(function(){n.freeze=[t,e]})}},{key:\"freezeTotalWidth\",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:\"freezeTotalHeight\",value:function(){return this.rows.sumHeight(0,this.freeze[0])}},{key:\"setRowHeight\",value:function(t,e){var n=this;this.changeData(function(){n.rows.setHeight(t,e)})}},{key:\"setColWidth\",value:function(t,e){var n=this;this.changeData(function(){n.cols.setWidth(t,e)})}},{key:\"viewHeight\",value:function(){var t=this.settings,e=t.view,n=t.showToolbar,r=t.showBottomBar,i=e.height();return r&&(i-=41),n&&(i-=41),i}},{key:\"viewWidth\",value:function(){return this.settings.view.width()}},{key:\"freezeViewRange\",value:function(){var t=at(this.freeze,2),e=t[0],n=t[1];return new v(0,0,e-1,n-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:\"contentRange\",value:function(){var t=this.rows,e=this.cols,n=at(t.maxCell(),2),r=n[0],i=n[1],o=t.sumHeight(0,r+1),a=e.sumWidth(0,i+1);return new v(0,0,r,i,a,o)}},{key:\"exceptRowTotalHeight\",value:function(t,e){var n=this.exceptRowSet,r=this.rows,i=Array.from(n),o=0;return i.forEach(function(n){if(n<t||n>e){var i=r.getHeight(n);o+=i}}),o}},{key:\"viewRange\",value:function(){var t=this.scroll,e=this.rows,n=this.cols,r=this.freeze,i=this.exceptRowSet,o=t.ri,a=t.ci;o<=0&&(o=at(r,1)[0]);a<=0&&(a=at(r,2)[1]);for(var l=0,c=0,s=[e.len,n.len],u=s[0],f=s[1],h=o;h<e.len&&(i.has(h)||(c+=e.getHeight(h),u=h),!(c>this.viewHeight()));h+=1);for(var p=a;p<n.len&&(f=p,!((l+=n.getWidth(p))>this.viewWidth()));p+=1);return new v(o,a,u,f,l,c)}},{key:\"eachMergesInView\",value:function(t,e){this.merges.filterIntersects(t).forEach(function(t){return e(t)})}},{key:\"hideRowsOrCols\",value:function(){var t=this.rows,e=this.cols,n=this.selector,r=at(n.size(),2),i=r[0],o=r[1],a=n.range,l=a.sri,c=a.sci,s=a.eri,u=a.eci;if(i===t.len)for(var f=c;f<=u;f+=1)e.setHide(f,!0);else if(o===e.len)for(var h=l;h<=s;h+=1)t.setHide(h,!0)}},{key:\"unhideRowsOrCols\",value:function(t,e){this[\"\".concat(t,\"s\")].unhide(e)}},{key:\"rowEach\",value:function(t,e,n){for(var r=0,i=this.rows,o=this.exceptRowSet,a=it(o),l=0,c=0;c<a.length;c+=1)a[c]<t&&(l+=1);for(var s=t+l;s<=e+l;s+=1)if(o.has(s))l+=1;else{var u=i.getHeight(s);if(u>0&&(n(s,r,u),(r+=u)>this.viewHeight()))break}}},{key:\"colEach\",value:function(t,e,n){for(var r=0,i=this.cols,o=t;o<=e;o+=1){var a=i.getWidth(o);if(a>0&&(n(o,r,a),(r+=a)>this.viewWidth()))break}}},{key:\"defaultStyle\",value:function(){return this.settings.style}},{key:\"addStyle\",value:function(t){for(var e=this.styles,n=0;n<e.length;n+=1){var r=e[n];if(z.equals(r,t))return n}return e.push(t),e.length-1}},{key:\"changeData\",value:function(t){this.history.add(this.getData()),t(),this.change(this.getData())}},{key:\"setData\",value:function(t){var e=this;return Object.keys(t).forEach(function(n){if(\"merges\"===n||\"rows\"===n||\"cols\"===n||\"validations\"===n)e[n].setData(t[n]);else if(\"freeze\"===n){var r=at(f(t[n]),2),i=r[0],o=r[1];e.freeze=[o,i]}else\"autofilter\"===n?e.autoFilter.setData(t[n]):void 0!==t[n]&&(e[n]=t[n])}),this}},{key:\"getData\",value:function(){var t=this.name,e=this.freeze,n=this.styles,r=this.merges,i=this.rows,o=this.cols,a=this.validations,l=this.autoFilter;return{name:t,freeze:h(e[1],e[0]),styles:n,merges:r.getData(),rows:i.getData(),cols:o.getData(),validations:a.getData(),autofilter:l.getData()}}}])&&ot(e.prototype,n),r&&ot(e,r),t}();function dt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function yt(t,e,n){t.addEventListener(e,n)}function vt(t,e,n){t.removeEventListener(e,n)}function bt(t){t.xclickoutside&&(vt(window.document.body,\"click\",t.xclickoutside),delete t.xclickoutside)}function gt(t,e){t.xclickoutside=function(n){2===n.detail||t.contains(n.target)||(e?e(t):(t.hide(),bt(t)))},yt(window.document.body,\"click\",t.xclickoutside)}function mt(t,e,n){yt(t,\"mousemove\",e),t.xEvtUp=function(r){vt(t,\"mousemove\",e),vt(t,\"mouseup\",t.xEvtUp),n(r)},yt(t,\"mouseup\",t.xEvtUp)}function wt(t,e,n,r){Math.abs(t)>Math.abs(e)?r(t>0?\"right\":\"left\",t,n):r(e>0?\"down\":\"up\",e,n)}var kt=\"x-spreadsheet\";window.devicePixelRatio;function Ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var St=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.moving=!1,this.vertical=n,this.el=a(\"div\",\"\".concat(kt,\"-resizer \").concat(n?\"vertical\":\"horizontal\")).children(this.unhideHoverEl=a(\"div\",\"\".concat(kt,\"-resizer-hover\")).on(\"dblclick.stop\",function(t){return e.mousedblclickHandler(t)}).css(\"position\",\"absolute\").hide(),this.hoverEl=a(\"div\",\"\".concat(kt,\"-resizer-hover\")).on(\"mousedown.stop\",function(t){return e.mousedownHandler(t)}),this.lineEl=a(\"div\",\"\".concat(kt,\"-resizer-line\")).hide()).hide(),this.cRect=null,this.finishedFn=null,this.minDistance=r,this.unhideFn=function(){}}var e,n,r;return e=t,(n=[{key:\"showUnhide\",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:\"hideUnhide\",value:function(){this.unhideHoverEl.hide()}},{key:\"show\",value:function(t,e){var n=this.moving,r=this.vertical,i=this.hoverEl,o=this.lineEl,a=this.el,l=this.unhideHoverEl;if(!n){this.cRect=t;var c=t.left,s=t.top,u=t.width,f=t.height;a.offset({left:r?c+u-5:c,top:r?s:s+f-5}).show(),i.offset({width:r?5:u,height:r?f:5}),o.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-u:c,top:r?s:5-f,width:r?5:u,height:r?f:5})}}},{key:\"hide\",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:\"mousedblclickHandler\",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:\"mousedownHandler\",value:function(t){var e=this,n=t,r=this.el,i=this.lineEl,o=this.cRect,a=this.vertical,l=this.minDistance,c=a?o.width:o.height;i.show(),mt(window,function(t){e.moving=!0,null!==n&&1===t.buttons&&(a?(c+=t.movementX)>l&&r.css(\"left\",\"\".concat(o.left+c,\"px\")):(c+=t.movementY)>l&&r.css(\"top\",\"\".concat(o.top+c,\"px\")),n=t)},function(){n=null,i.hide(),e.moving=!1,e.hide(),e.finishedFn&&(c<l&&(c=l),e.finishedFn(o,c))})}}])&&Ot(e.prototype,n),r&&Ot(e,r),t}();function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Et=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vertical=e,this.moveFn=null,this.el=a(\"div\",\"\".concat(kt,\"-scrollbar \").concat(e?\"vertical\":\"horizontal\")).child(this.contentEl=a(\"div\",\"\")).on(\"mousemove.stop\",function(){}).on(\"scroll.stop\",function(t){var e=t.target,r=e.scrollTop,i=e.scrollLeft;n.moveFn&&n.moveFn(n.vertical?r:i,t)})}var e,n,r;return e=t,(n=[{key:\"move\",value:function(t){return this.el.scroll(t),this}},{key:\"scroll\",value:function(){return this.el.scroll()}},{key:\"set\",value:function(t,e){var n=t-1;if(e>n){var r=this.vertical?\"height\":\"width\";this.el.css(r,\"\".concat(n-15,\"px\")).show(),this.contentEl.css(this.vertical?\"width\":\"height\",\"1px\").css(r,\"\".concat(e,\"px\"))}else this.el.hide();return this}}])&&xt(e.prototype,n),r&&xt(e,r),t}();function jt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function _t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ct(t,e,n){return e&&_t(t.prototype,e),n&&_t(t,n),t}var Tt=10,Pt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];jt(this,t),this.useHideInput=n,this.inputChange=function(){},this.cornerEl=a(\"div\",\"\".concat(kt,\"-selector-corner\")),this.areaEl=a(\"div\",\"\".concat(kt,\"-selector-area\")).child(this.cornerEl).hide(),this.clipboardEl=a(\"div\",\"\".concat(kt,\"-selector-clipboard\")).hide(),this.autofillEl=a(\"div\",\"\".concat(kt,\"-selector-autofill\")).hide(),this.el=a(\"div\",\"\".concat(kt,\"-selector\")).css(\"z-index\",\"\".concat(Tt)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),n&&(this.hideInput=a(\"input\",\"\").on(\"compositionend\",function(t){e.inputChange(t.target.value)}),this.el.child(this.hideInputDiv=a(\"div\",\"hide-input\").child(this.hideInput)),this.el.child(this.hideInputDiv=a(\"div\",\"hide-input\").child(this.hideInput))),Tt+=1}return Ct(t,[{key:\"setOffset\",value:function(t){return this.el.offset(t).show(),this}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"setAreaOffset\",value:function(t){var e=t.left,n=t.top,r={width:t.width-3+.8,height:t.height-3+.8,left:e-.8,top:n-.8};this.areaEl.offset(r).show(),this.useHideInput&&(this.hideInputDiv.offset(r),this.hideInput.val(\"\").focus())}},{key:\"setClipboardOffset\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.clipboardEl.offset({left:e,top:n,width:r-5,height:i-5})}},{key:\"showAutofill\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.autofillEl.offset({width:r-3,height:i-3,left:e,top:n}).show()}},{key:\"hideAutofill\",value:function(){this.autofillEl.hide()}},{key:\"showClipboard\",value:function(){this.clipboardEl.show()}},{key:\"hideClipboard\",value:function(){this.clipboardEl.hide()}}]),t}();function At(t){var e=this.data,n=t.left,r=t.top,i=t.width,o=t.height,a=t.scroll,l=t.l,c=t.t,s=e.freezeTotalWidth(),u=e.freezeTotalHeight(),f=n-s;s>l&&(f-=a.x);var h=r-u;return u>c&&(h-=a.y),{left:f,top:h,width:i,height:o}}function Rt(t){var e=this.data,n=t.left,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalWidth(),s=n-c;return c>o&&(s-=l.x),{left:s,top:a,width:r,height:i}}function Dt(t){var e=this.data,n=t.top,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalHeight(),s=n-c;return c>a&&(s-=l.y),{left:o,top:s,width:r,height:i}}function It(t){this.br.setAreaOffset(At.call(this,t))}function zt(t){this.t.setAreaOffset(Rt.call(this,t))}function Ht(t){this.l.setAreaOffset(Dt.call(this,t))}function Mt(t){this.l.setClipboardOffset(Dt.call(this,t))}function Nt(t){this.br.setClipboardOffset(At.call(this,t))}function Ft(t){this.t.setClipboardOffset(Rt.call(this,t))}function Wt(t){It.call(this,t),function(t){this.tl.setAreaOffset(t)}.call(this,t),zt.call(this,t),Ht.call(this,t)}function Vt(t){Nt.call(this,t),function(t){this.tl.setClipboardOffset(t)}.call(this,t),Ft.call(this,t),Mt.call(this,t)}var qt=function(){function t(e){var n=this;jt(this,t),this.inputChange=function(){},this.data=e,this.br=new Pt(!0),this.t=new Pt,this.l=new Pt,this.tl=new Pt,this.br.inputChange=function(t){n.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=a(\"div\",\"\".concat(kt,\"-selectors\")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,Tt+=1}return Ct(t,[{key:\"resetData\",value:function(t){this.data=t,this.range=t.selector.range,this.resetAreaOffset()}},{key:\"hide\",value:function(){this.el.hide()}},{key:\"resetOffset\",value:function(){var t=this.data,e=this.tl,n=this.t,r=this.l,i=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();o>0||a>0?(e.setOffset({width:a,height:o}),n.setOffset({left:a,height:o}),r.setOffset({top:o,width:a}),i.setOffset({left:a,top:o})):(e.hide(),n.hide(),r.hide(),i.setOffset({left:0,top:0}))}},{key:\"resetAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Wt.call(this,t),Vt.call(this,e),this.resetOffset()}},{key:\"resetBRTAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();It.call(this,t),zt.call(this,t),Nt.call(this,e),Ft.call(this,e),this.resetOffset()}},{key:\"resetBRLAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();It.call(this,t),Ht.call(this,t),Nt.call(this,e),Mt.call(this,e),this.resetOffset()}},{key:\"set\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=r.calSelectedRangeByStart(t,e),o=i.sri,a=i.sci;if(n){var l=t,c=e;t<0&&(l=0),e<0&&(c=0),r.selector.setIndexes(l,c),this.indexes=[l,c]}this.moveIndexes=[o,a],this.range=i,this.resetAreaOffset(),this.el.show()}},{key:\"setEnd\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=this.lastri,o=this.lastci;if(n){if(t===i&&e===o)return;this.lastri=t,this.lastci=e}this.range=r.calSelectedRangeByEnd(t,e),Wt.call(this,this.data.getSelectedRect())}},{key:\"reset\",value:function(){var t=this.data.selector.range,e=t.eri,n=t.eci;this.setEnd(e,n)}},{key:\"showAutofill\",value:function(t,e){if(-1!==t||-1!==e){var n=this.range,r=n.sri,i=n.sci,o=n.eri,a=n.eci,l=t,c=e,s=r-t,u=o-t,f=a-e;if(i-e>0)this.arange=new v(r,c,o,i-1);else if(s>0)this.arange=new v(l,i,r-1,a);else if(f<0)this.arange=new v(r,a+1,o,c);else{if(!(u<0))return void(this.arange=null);this.arange=new v(o+1,i,l,a)}if(null!==this.arange){var h=this.data.getRect(this.arange);h.width+=2,h.height+=2;var p=this.br,d=this.l,y=this.t,b=this.tl;p.showAutofill(At.call(this,h)),d.showAutofill(Dt.call(this,h)),y.showAutofill(Rt.call(this,h)),b.showAutofill(h)}}}},{key:\"hideAutofill\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideAutofill()})}},{key:\"showClipboard\",value:function(){var t=this,e=this.data.getClipboardRect();Vt.call(this,e),[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].showClipboard()})}},{key:\"hideClipboard\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideClipboard()})}}]),t}();function Bt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Lt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ut(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}var Yt=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"200px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterItems=[],this.items=e,this.el=a(\"div\",\"\".concat(kt,\"-suggest\")).css(\"width\",r).hide(),this.itemClick=n,this.itemIndex=-1}var e,n,r;return e=t,(n=[{key:\"setOffset\",value:function(t){this.el.cssRemoveKeys(\"top\",\"bottom\").offset(t)}},{key:\"hide\",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide(),bt(this.el.parent())}},{key:\"setItems\",value:function(t){this.items=t}},{key:\"search\",value:function(t){var e,n=this,r=this.items;if(/^\\s*$/.test(t)||(r=r.filter(function(e){return(e.key||e).startsWith(t.toUpperCase())})),r=r.map(function(t){var e=t.title;e?\"function\"==typeof e&&(e=e()):e=t;var r=a(\"div\",\"\".concat(kt,\"-item\")).child(e).on(\"click.stop\",function(){n.itemClick(t),n.hide()});return t.label&&r.child(a(\"div\",\"label\").html(t.label)),r}),this.filterItems=r,!(r.length<=0)){var i=this.el;(e=i.html(\"\")).children.apply(e,Bt(r)).show(),gt(i.parent(),function(){n.hide()})}}},{key:\"bindInputEvents\",value:function(t){var e=this;t.on(\"keydown\",function(t){return function(t){var e=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),e){case 37:t.stopPropagation();break;case 38:(function(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle())}).call(this,t);break;case 39:t.stopPropagation();break;case 40:(function(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle())}).call(this,t);break;case 13:case 9:Ut.call(this,t);break;default:t.stopPropagation()}}.call(e,t)})}}])&&Lt(e.prototype,n),r&&Lt(e,r),t}();function $t(t){return($t=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Zt(t,e){return!e||\"object\"!==$t(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Kt(t){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jt(t,e){return(Jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Gt=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=Zt(this,Kt(e).call(this,\"div\",\"\".concat(kt,\"-icon\")))).iconNameEl=a(\"div\",\"\".concat(kt,\"-icon-img \").concat(t)),n.child(n.iconNameEl),n}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jt(t,e)}(e,o),n=e,(r=[{key:\"setName\",value:function(t){this.iconNameEl.className(\"\".concat(kt,\"-icon-img \").concat(t))}}])&&Xt(n.prototype,r),i&&Xt(n,i),e}();function Qt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ee(t,e){t.setMonth(t.getMonth()+e)}function ne(t,e){var n=new Date(t);return n.setDate(e-t.getDay()+1),n}var re=function(){function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=a(\"div\",\"calendar-header-left\"),this.bodyEl=a(\"tbody\",\"\"),this.buildAll(),this.el=a(\"div\",\"x-spreadsheet-calendar\").children(a(\"div\",\"calendar-header\").children(this.headerLeftEl,a(\"div\",\"calendar-header-right\").children(a(\"a\",\"calendar-prev\").on(\"click.stop\",function(){return r.prev()}).child(new Gt(\"chevron-left\")),a(\"a\",\"calendar-next\").on(\"click.stop\",function(){return r.next()}).child(new Gt(\"chevron-right\")))),a(\"table\",\"calendar-body\").children(a(\"thead\",\"\").child((n=a(\"tr\",\"\")).children.apply(n,Qt(L(\"calendar.weeks\").map(function(t){return a(\"th\",\"cell\").child(t)})))),this.bodyEl)),this.selectChange=function(){}}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:\"prev\",value:function(){ee(this.value,-1),this.buildAll()}},{key:\"next\",value:function(){ee(this.value,1),this.buildAll()}},{key:\"buildAll\",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:\"buildHeaderLeft\",value:function(){var t=this.value;this.headerLeftEl.html(\"\".concat(L(\"calendar.months\")[t.getMonth()],\" \").concat(t.getFullYear()))}},{key:\"buildBody\",value:function(){var t,e=this,n=this.value,r=this.cvalue,i=this.bodyEl,o=function(t,e,n){for(var r=new Date(t,e,1,23,59,59),i=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var l=ne(r,7*o+a),c=l.getMonth()!==e,s=l.getMonth()===n.getMonth()&&l.getDate()===n.getDate();i[o][a]={d:l,disabled:c,active:s}}return i}(n.getFullYear(),n.getMonth(),r).map(function(t){var n,r=t.map(function(t){var n=\"cell\";return t.disabled&&(n+=\" disabled\"),t.active&&(n+=\" active\"),a(\"td\",\"\").child(a(\"div\",n).on(\"click.stop\",function(){e.selectChange(t.d)}).child(t.d.getDate().toString()))});return(n=a(\"tr\",\"\")).children.apply(n,Qt(r))});(t=i.html(\"\")).children.apply(t,Qt(o))}}])&&te(e.prototype,n),r&&te(e,r),t}();function ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var oe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.calendar=new re(new Date),this.el=a(\"div\",\"\".concat(kt,\"-datepicker\")).child(this.calendar.el).hide()}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){var e=this.calendar;return\"string\"==typeof t?/^\\d{4}-\\d{1,2}-\\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp(\"-\",\"g\"),\"/\"))):t instanceof Date&&e.setValue(t),this}},{key:\"change\",value:function(t){var e=this;this.calendar.selectChange=function(n){t(n),e.hide()}}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&ie(e.prototype,n),r&&ie(e,r),t}();function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function le(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ce(){var t=this.inputText;if(!/^\\s*$/.test(t)){var e=this.textlineEl,n=this.textEl,r=this.areaOffset,i=t.split(\"\\n\"),o=Math.max.apply(Math,le(i.map(function(t){return t.length}))),a=e.offset().width/t.length,l=(o+1)*a+5,c=this.viewFn().width-r.left-a,s=i.length;if(l>r.width){var u=l;l>c&&(u=c,s+=parseInt(l/c,10),s+=l%c>0?1:0),n.css(\"width\",\"\".concat(u,\"px\"))}(s*=this.rowHeight)>r.height&&n.css(\"height\",\"\".concat(s,\"px\"))}}function se(t){var e=t.keyCode,n=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&n&&(function(t,e){var n=t.target,r=n.value,i=n.selectionEnd,o=\"\".concat(r.slice(0,i)).concat(e).concat(r.slice(i));n.value=o,n.setSelectionRange(i+1,i+1),this.inputText=o,this.textlineEl.html(o),ce.call(this)}.call(this,t,\"\\n\"),t.stopPropagation()),13!==e||n||t.preventDefault()}function ue(t,e){var n=this.textEl,r=this.textlineEl;n.el.blur(),n.val(t),r.html(t),function(t){var e=this.textEl.el;setTimeout(function(){e.focus(),e.setSelectionRange(t,t)},0)}.call(this,e)}var fe=function(){function t(e,n,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.viewFn=n,this.rowHeight=r,this.formulas=e,this.suggest=new Yt(e,function(t){(function(t){var e=this.inputText,n=this.validator,r=0;if(n&&\"list\"===n.type)this.inputText=t,r=this.inputText.length;else{var i=e.lastIndexOf(\"=\"),o=e.substring(0,i+1),a=e.substring(i+1);a=-1!==a.indexOf(\")\")?a.substring(a.indexOf(\")\")):\"\",this.inputText=\"\".concat(o+t.key,\"(\"),r=this.inputText.length,this.inputText+=\")\".concat(a)}ue.call(this,this.inputText,r)}).call(i,t)}),this.datepicker=new oe,this.datepicker.change(function(t){i.setText(function(t){var e=t.getMonth()+1,n=t.getDate();return e<10&&(e=\"0\".concat(e)),n<10&&(n=\"0\".concat(n)),\"\".concat(t.getFullYear(),\"-\").concat(e,\"-\").concat(n)}(t)),i.clear()}),this.areaEl=a(\"div\",\"\".concat(kt,\"-editor-area\")).children(this.textEl=a(\"textarea\",\"\").on(\"input\",function(t){return function(t){var e=t.target.value,n=this.suggest,r=this.textlineEl,i=this.validator,o=this.cell;if(null!==o)if(\"editable\"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=e,i)\"list\"===i.type?n.search(e):n.hide();else{var a=e.lastIndexOf(\"=\");-1!==a?n.search(e.substring(a+1)):n.hide()}r.html(e),ce.call(this),this.change(\"input\",e)}else t.target.value=o.text;else{if(this.inputText=e,i)\"list\"===i.type?n.search(e):n.hide();else{var l=e.lastIndexOf(\"=\");-1!==l?n.search(e.substring(l+1)):n.hide()}r.html(e),ce.call(this),this.change(\"input\",e)}}.call(i,t)}).on(\"paste.stop\",function(){}).on(\"keydown\",function(t){return se.call(i,t)}),this.textlineEl=a(\"div\",\"textline\"),this.suggest.el,this.datepicker.el).on(\"mousemove.stop\",function(){}).on(\"mousedown.stop\",function(){}),this.el=a(\"div\",\"\".concat(kt,\"-editor\")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText=\"\",this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"setFreezeLengths\",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:\"clear\",value:function(){\"\"!==this.inputText&&this.change(\"finished\",this.inputText),this.cell=null,this.areaOffset=null,this.inputText=\"\",this.el.hide(),this.textEl.val(\"\"),this.textlineEl.html(\"\"),function(){this.suggest.setItems(this.formulas)}.call(this),this.datepicker.hide()}},{key:\"setOffset\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"top\",n=this.textEl,r=this.areaEl,i=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var l=t.left,c=t.top,s=t.width,u=t.height,f=t.l,h=t.t,p={left:0,top:0};o.w>f&&o.h>h||(o.w<f&&o.h<h?(p.left=o.w,p.top=o.h):o.w>f?p.top=o.h:o.h>h&&(p.left=o.w)),a.offset(p),r.offset({left:l-p.left-.8,top:c-p.top-.8}),n.offset({width:s-9+.8,height:u-3+.8});var d={left:0};d[e]=u,i.setOffset(d),i.hide()}}},{key:\"setCell\",value:function(t,e){var n=this.el,r=this.datepicker,i=this.suggest;n.show(),this.cell=t;var o=t&&t.text||\"\";if(this.setText(o),this.validator=e,e){var a=e.type;\"date\"===a&&(r.show(),/^\\s*$/.test(o)||r.setValue(o)),\"list\"===a&&(i.setItems(e.values()),i.search(\"\"))}}},{key:\"setText\",value:function(t){this.inputText=t,ue.call(this,t,t.length),ce.call(this)}}])&&ae(e.prototype,n),r&&ae(e,r),t}();function he(t){return(he=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function pe(t,e){return!e||\"object\"!==he(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function de(t){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ye(t,e){return(ye=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ve=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=pe(this,de(e).call(this,\"div\",\"\".concat(kt,\"-button \").concat(r)))).child(L(\"button.\".concat(t))),n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ye(t,e)}(e,o),e}();function be(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ge(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function me(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function we(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ke(t,e,n){return e&&we(t.prototype,e),n&&we(t,n),t}function Oe(){return window.devicePixelRatio||1}function Se(){return Oe()-.5}function xe(t){return parseInt(t*Oe(),10)}function Ee(t){var e=xe(t);return e>0?e-.5:.5}var je=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;me(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.padding=o,this.bgcolor=\"#ffffff\",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null}return ke(t,[{key:\"setBorders\",value:function(t){var e=t.top,n=t.bottom,r=t.left,i=t.right;e&&(this.borderTop=e),i&&(this.borderRight=i),n&&(this.borderBottom=n),r&&(this.borderLeft=r)}},{key:\"innerWidth\",value:function(){return this.width-2*this.padding-2}},{key:\"innerHeight\",value:function(){return this.height-2*this.padding-2}},{key:\"textx\",value:function(t){var e=this.width,n=this.padding,r=this.x;return\"left\"===t?r+=n:\"center\"===t?r+=e/2:\"right\"===t&&(r+=e-n),r}},{key:\"texty\",value:function(t,e){var n=this.height,r=this.padding,i=this.y;return\"top\"===t?i+=r:\"middle\"===t?i+=n/2-e/2:\"bottom\"===t&&(i+=n-r-e),i}},{key:\"topxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:\"rightxys\",value:function(){var t=this.x,e=this.y,n=this.width;return[[t+n,e],[t+n,e+this.height]]}},{key:\"bottomxys\",value:function(){var t=this.x,e=this.y,n=this.width,r=this.height;return[[t,e+r],[t+n,e+r]]}},{key:\"leftxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function _e(t,e,n,r,i,o,a){var l={x:0,y:0};\"underline\"===t?l.y=\"bottom\"===i?0:\"top\"===i?-(o+2):-o/2:\"strike\"===t&&(\"bottom\"===i?l.y=o/2:\"top\"===i&&(l.y=-(o/2+2))),\"center\"===r?l.x=a/2:\"right\"===r&&(l.x=a),this.line([e-l.x,n-l.y],[e-l.x+a,n-l.y])}var Ce=function(){function t(e,n,r){me(this,t),this.el=e,this.ctx=e.getContext(\"2d\"),this.resize(n,r),this.ctx.scale(Oe(),Oe())}return ke(t,[{key:\"resize\",value:function(t,e){this.el.style.width=\"\".concat(t,\"px\"),this.el.style.height=\"\".concat(e,\"px\"),this.el.width=xe(t),this.el.height=xe(e)}},{key:\"clear\",value:function(){var t=this.el,e=t.width,n=t.height;return this.ctx.clearRect(0,0,e,n),this}},{key:\"attr\",value:function(t){return Object.assign(this.ctx,t),this}},{key:\"save\",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:\"restore\",value:function(){return this.ctx.restore(),this}},{key:\"beginPath\",value:function(){return this.ctx.beginPath(),this}},{key:\"translate\",value:function(t,e){return this.ctx.translate(xe(t),xe(e)),this}},{key:\"scale\",value:function(t,e){return this.ctx.scale(t,e),this}},{key:\"clearRect\",value:function(t,e,n,r){return this.ctx.clearRect(t,e,n,r),this}},{key:\"fillRect\",value:function(t,e,n,r){return this.ctx.fillRect(xe(t)-.5,xe(e)-.5,xe(n),xe(r)),this}},{key:\"fillText\",value:function(t,e,n){return this.ctx.fillText(t,xe(e),xe(n)),this}},{key:\"text\",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.ctx,a=r.align,l=r.valign,c=r.font,s=r.color,u=r.strike,f=r.underline,h=e.textx(a);o.save(),o.beginPath(),this.attr({textAlign:a,textBaseline:l,font:\"\".concat(c.italic?\"italic\":\"\",\" \").concat(c.bold?\"bold\":\"\",\" \").concat(xe(c.size),\"px \").concat(c.name),fillStyle:s,strokeStyle:s});var p=\"\".concat(t).split(\"\\n\"),d=e.innerWidth(),y=[];p.forEach(function(t){var e=o.measureText(t).width;if(i&&e>xe(d)){for(var n={w:0,len:0,start:0},r=0;r<t.length;r+=1)n.w>=xe(d)&&(y.push(t.substr(n.start,n.len)),n={w:0,len:0,start:r}),n.len+=1,n.w+=o.measureText(t[r]).width+1;n.len>0&&y.push(t.substr(n.start,n.len))}else y.push(t)});var v=(y.length-1)*(c.size+2),b=e.texty(l,v);return y.forEach(function(t){var e=o.measureText(t).width;n.fillText(t,h,b),u&&_e.call(n,\"strike\",h,b,a,l,c.size,e),f&&_e.call(n,\"underline\",h,b,a,l,c.size,e),b+=c.size+2}),o.restore(),this}},{key:\"border\",value:function(t,e){var n=this.ctx;return n.lineWidth=Se,n.strokeStyle=e,\"medium\"===t?n.lineWidth=xe(2)-.5:\"thick\"===t?n.lineWidth=xe(3):\"dashed\"===t?n.setLineDash([xe(3),xe(2)]):\"dotted\"===t?n.setLineDash([xe(1),xe(1)]):\"double\"===t&&n.setLineDash([xe(2),0]),this}},{key:\"line\",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],n=ge(e,2),r=n[0],i=n[1];t.moveTo(Ee(r),Ee(i));for(var o=1;o<arguments.length;o+=1){var a=o<0||arguments.length<=o?void 0:arguments[o],l=ge(a,2),c=l[0],s=l[1];t.lineTo(Ee(c),Ee(s))}t.stroke()}return this}},{key:\"strokeBorders\",value:function(t){var e=this.ctx;e.save();var n=t.borderTop,r=t.borderRight,i=t.borderBottom,o=t.borderLeft;n&&(this.border.apply(this,be(n)),this.line.apply(this,be(t.topxys()))),r&&(this.border.apply(this,be(r)),this.line.apply(this,be(t.rightxys()))),i&&(this.border.apply(this,be(i)),this.line.apply(this,be(t.bottomxys()))),o&&(this.border.apply(this,be(o)),this.line.apply(this,be(t.leftxys()))),e.restore()}},{key:\"dropdown\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-15,o=r+t.height-15;e.save(),e.beginPath(),e.moveTo(xe(i),xe(o)),e.lineTo(xe(i+8),xe(o)),e.lineTo(xe(i+4),xe(o+6)),e.closePath(),e.fillStyle=\"rgba(0, 0, 0, .45)\",e.fill(),e.restore()}},{key:\"error\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(xe(i-8),xe(r-1)),e.lineTo(xe(i),xe(r-1)),e.lineTo(xe(i),xe(r+8)),e.closePath(),e.fillStyle=\"rgba(255, 0, 0, .65)\",e.fill(),e.restore()}},{key:\"frozen\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(xe(i-8),xe(r-1)),e.lineTo(xe(i),xe(r-1)),e.lineTo(xe(i),xe(r+8)),e.closePath(),e.fillStyle=\"rgba(0, 255, 0, .85)\",e.fill(),e.restore()}},{key:\"rect\",value:function(t,e){var n=this.ctx,r=t.x,i=t.y,o=t.width,a=t.height,l=t.bgcolor;n.save(),n.beginPath(),n.fillStyle=l||\"#fff\",n.rect(Ee(r+1),Ee(i+1),xe(o-2),xe(a-2)),n.clip(),n.fill(),e(),n.restore()}}]),t}(),Te=[{key:\"Arial\",title:\"Arial\"},{key:\"Helvetica\",title:\"Helvetica\"},{key:\"Source Sans Pro\",title:\"Source Sans Pro\"},{key:\"Comic Sans MS\",title:\"Comic Sans MS\"},{key:\"Courier New\",title:\"Courier New\"},{key:\"Verdana\",title:\"Verdana\"},{key:\"Lato\",title:\"Lato\"}],Pe=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function Ae(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var Re=function(t){for(var e=[],n=[],r=[],i=0,o=\"\",a=1,l=\"\",c=0;c<t.length;c+=1){var s=t.charAt(c);if(\" \"!==s){if(s>=\"a\"&&s<=\"z\")r.push(s.toUpperCase());else if(s>=\"0\"&&s<=\"9\"||s>=\"A\"&&s<=\"Z\"||\".\"===s)r.push(s);else if('\"'===s){for(c+=1;'\"'!==t.charAt(c);)r.push(t.charAt(c)),c+=1;n.push('\"'.concat(r.join(\"\"))),r=[]}else if(\"-\"===s&&/[+\\-*/,(]/.test(l))r.push(s);else{if(\"(\"!==s&&r.length>0&&n.push(r.join(\"\")),\")\"===s){var u=e.pop();if(2===i)try{for(var p=Ae(f(n.pop()),2),d=p[0],y=p[1],v=Ae(f(n.pop()),2),b=v[0],g=v[1],m=0,w=b;w<=d;w+=1)for(var k=g;k<=y;k+=1)n.push(h(w,k)),m+=1;n.push([u,m])}catch(t){}else if(1===i||3===i)3===i&&n.push(o),n.push([u,a]),a=1;else for(;\"(\"!==u&&(n.push(u),!(e.length<=0));)u=e.pop();i=0}else if(\"=\"===s||\">\"===s||\"<\"===s){var O=t.charAt(c+1);o=s,\"=\"!==O&&\"-\"!==O||(o+=O,c+=1),i=3}else if(\":\"===s)i=2;else if(\",\"===s)3===i&&n.push(o),i=1,a+=1;else if(\"(\"===s&&r.length>0)e.push(r.join(\"\"));else{if(e.length>0&&(\"+\"===s||\"-\"===s)){var S=e[e.length-1];if(\"(\"!==S&&n.push(e.pop()),\"*\"===S||\"/\"===S)for(;e.length>0&&\"(\"!==(S=e[e.length-1]);)n.push(e.pop())}else if(e.length>0){var x=e[e.length-1];\"*\"!==x&&\"/\"!==x||n.push(e.pop())}e.push(s)}r=[]}l=s}}for(r.length>0&&n.push(r.join(\"\"));e.length>0;)n.push(e.pop());return n},De=function(t,e){var n=Ae(t,1)[0],r=t;if('\"'===n)return t.substring(1);var i=1;if(\"-\"===n&&(r=t.substring(1),i=-1),r[0]>=\"0\"&&r[0]<=\"9\")return i*Number(r);var o=Ae(f(r),2);return i*e(o[0],o[1])},Ie=function(t,e,n,r){for(var i=[],o=0;o<t.length;o+=1){var a=t[o],l=a[0];if(\"+\"===a){var c=i.pop();i.push(I(\"+\",i.pop(),c))}else if(\"-\"===a)if(1===i.length){var s=i.pop();i.push(I(\"*\",s,-1))}else{var u=i.pop();i.push(I(\"-\",i.pop(),u))}else if(\"*\"===a)i.push(I(\"*\",i.pop(),i.pop()));else if(\"/\"===a){var f=i.pop();i.push(I(\"/\",i.pop(),f))}else if(\"=\"===l||\">\"===l||\"<\"===l){var h=i.pop();Number.isNaN(h)||(h=Number(h));var p=i.pop();Number.isNaN(p)||(p=Number(p));var d=!1;\"=\"===l?d=p===h:\">\"===a?d=p>h:\">=\"===a?d=p>=h:\"<\"===a?d=p<h:\"<=\"===a&&(d=p<=h),i.push(d)}else if(Array.isArray(a)){for(var y=Ae(a,2),v=y[0],b=y[1],g=[],m=0;m<b;m+=1)g.push(i.pop());i.push(e[v].render(g.reverse()))}else{if(r.includes(a))return 0;(l>=\"a\"&&l<=\"z\"||l>=\"A\"&&l<=\"Z\")&&r.push(a),i.push(De(a,n)),r.pop()}}return i[0]},ze={render:function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(\"=\"===e[0]){var o=Re(e.substring(1));return o.length<=0?e:Ie(o,n,function(e,o){return t(r(e,o),n,r,i)},i)}return e}};function He(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Me(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var Ne=[{key:\"SUM\",title:U(\"formula.sum\"),render:function(t){return t.reduce(function(t,e){return I(\"+\",t,e)},0)}},{key:\"AVERAGE\",title:U(\"formula.average\"),render:function(t){return t.reduce(function(t,e){return Number(t)+Number(e)},0)/t.length}},{key:\"MAX\",title:U(\"formula.max\"),render:function(t){return Math.max.apply(Math,Me(t.map(function(t){return Number(t)})))}},{key:\"MIN\",title:U(\"formula.min\"),render:function(t){return Math.min.apply(Math,Me(t.map(function(t){return Number(t)})))}},{key:\"IF\",title:U(\"formula._if\"),render:function(t){var e=He(t,3),n=e[0],r=e[1],i=e[2];return n?r:i}},{key:\"AND\",title:U(\"formula.and\"),render:function(t){return t.every(function(t){return t})}},{key:\"OR\",title:U(\"formula.or\"),render:function(t){return t.some(function(t){return t})}},{key:\"CONCAT\",title:U(\"formula.concat\"),render:function(t){return t.join(\"\")}}],Fe=Ne,We={};function Ve(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||Be(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function qe(t){return function(t){if(Array.isArray(t))return t}(t)||Be(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Be(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}Ne.forEach(function(t){We[t.key]=t});var Le=function(t){return t},Ue=function(t){if(/^(-?\\d*.?\\d*)$/.test(t)){var e=qe(Number(t).toFixed(2).toString().split(\"\\\\.\")),n=e[0],r=e.slice(1);return[n.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1,\")].concat(Ve(r))}return t},Ye=[{key:\"normal\",title:U(\"format.normal\"),type:\"string\",render:Le},{key:\"text\",title:U(\"format.text\"),type:\"string\",render:Le},{key:\"number\",title:U(\"format.number\"),type:\"number\",label:\"1,000.12\",render:Ue},{key:\"percent\",title:U(\"format.percent\"),type:\"number\",label:\"10.12%\",render:function(t){return\"\".concat(t,\"%\")}},{key:\"rmb\",title:U(\"format.rmb\"),type:\"number\",label:\"￥10.00\",render:function(t){return\"￥\".concat(Ue(t))}},{key:\"usd\",title:U(\"format.usd\"),type:\"number\",label:\"$10.00\",render:function(t){return\"$\".concat(Ue(t))}},{key:\"eur\",title:U(\"format.eur\"),type:\"number\",label:\"€10.00\",render:function(t){return\"€\".concat(Ue(t))}},{key:\"date\",title:U(\"format.date\"),type:\"date\",label:\"26/09/2008\",render:Le},{key:\"time\",title:U(\"format.time\"),type:\"date\",label:\"15:59:00\",render:Le},{key:\"datetime\",title:U(\"format.datetime\"),type:\"date\",label:\"26/09/2008 15:59:00\",render:Le},{key:\"duration\",title:U(\"format.duration\"),type:\"date\",label:\"24:01:00\",render:Le}],$e={};function Xe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Ye.forEach(function(t){$e[t.key]=t});var Ke=5,Je={fillStyle:\"#f4f5f8\"},Ge={fillStyle:\"#fff\",lineWidth:Se,strokeStyle:\"#e6e6e6\"};function Qe(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.cellRect(e,n),o=i.left,a=i.top,l=i.width,c=i.height;return new je(o,a+r,l,c,Ke)}function tn(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=e.sortedRowMap,a=e.rows,l=e.cols;if(!a.isHide(n)&&!l.isHide(r)){var c=n;o.has(n)&&(c=o.get(n));var s=e.getCell(c,r);if(null!==s){var u=!1;\"editable\"in s&&!1===s.editable&&(u=!0);var f=e.getCellStyleOrDefault(c,r),h=Qe(e,n,r,i);h.bgcolor=f.bgcolor,void 0!==f.border&&(h.setBorders(f.border),t.strokeBorders(h)),t.rect(h,function(){var i=\"\";i=e.settings.evalPaused?s.text||\"\":ze.render(s.text||\"\",We,function(t,n){return e.getCellTextOrDefault(n,t)}),f.format&&(i=$e[f.format].render(i));var o=Object.assign({},f.font);o.size=function(t){for(var e=0;e<Pe.length;e+=1){var n=Pe[e];if(n.pt===t)return n.px}return t}(o.size),t.text(i,h,{align:f.align,valign:f.valign,font:o,color:f.color,strike:f.strike,underline:f.underline},f.textwrap),e.validations.getError(n,r)&&t.error(h),u&&t.frozen(h)})}}}function en(t,e,n,r,i){var o=this.draw,a=this.data;o.save(),o.translate(e,n).translate(r,i);var l=a.exceptRowSet,c=a.exceptRowTotalHeight(t.sri,t.eri);o.save(),o.translate(0,-c),t.each(function(t,e){tn(o,a,t,e)},function(t){return function(t){var e=l.has(t);if(e){var n=a.rows.getHeight(t);o.translate(0,-n)}return!e}(t)}),o.restore();var s=new Set;o.save(),o.translate(0,-c),a.eachMergesInView(t,function(t){var e=t.sri,n=t.sci,r=t.eri;if(l.has(e)){if(!s.has(e)){s.add(e);var i=a.rows.sumHeight(e,r+1);o.translate(0,-i)}}else tn(o,a,e,n)}),o.restore(),function(t){var e=this.data,n=this.draw;if(t){var r=e.autoFilter;if(!r.active())return;var i=r.hrange();t.intersects(i)&&i.each(function(t,r){var i=Qe(e,t,r);n.dropdown(i)})}}.call(this,t),o.restore()}function nn(t,e,n,r){var i=this.draw;i.save(),i.attr({fillStyle:\"rgba(75, 137, 255, 0.08)\"}).fillRect(t,e,n,r),i.restore()}function rn(t,e,n,r,i,o){var a=this,l=this.draw,c=this.data,u=e.h,f=e.w,h=o+r,p=i+n;l.save(),l.attr(Je),\"all\"!==t&&\"left\"!==t||l.fillRect(0,h,n,u),\"all\"!==t&&\"top\"!==t||l.fillRect(p,0,f,r);var d=c.selector.range,y=d.sri,v=d.sci,b=d.eri,g=d.eci;l.attr({textAlign:\"center\",textBaseline:\"middle\",font:\"500 \".concat(xe(12),\"px Source Sans Pro\"),fillStyle:\"#585757\",lineWidth:Se(),strokeStyle:\"#e6e6e6\"}),\"all\"!==t&&\"left\"!==t||(c.rowEach(e.sri,e.eri,function(t,e,r){var i=h+e,o=t;l.line([0,i],[n,i]),y<=o&&o<b+1&&nn.call(a,0,i,n,r),l.fillText(o+1,n/2,i+r/2),t>0&&c.rows.isHide(t-1)&&(l.save(),l.attr({strokeStyle:\"#c6c6c6\"}),l.line([5,i+5],[n-5,i+5]),l.restore())}),l.line([0,u+h],[n,u+h]),l.line([n,h],[n,u+h])),\"all\"!==t&&\"top\"!==t||(c.colEach(e.sci,e.eci,function(t,e,n){var i=p+e,o=t;l.line([i,0],[i,r]),v<=o&&o<g+1&&nn.call(a,i,0,n,r),l.fillText(s(o),i+n/2,r/2),t>0&&c.cols.isHide(t-1)&&(l.save(),l.attr({strokeStyle:\"#c6c6c6\"}),l.line([i+5,5],[i+5,r-5]),l.restore())}),l.line([f+p,0],[f+p,r]),l.line([0,r],[f+p,r])),l.restore()}function on(t,e,n,r,i){var o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=t.w,u=t.h,f=this.draw,h=this.data,p=h.settings;f.save(),f.attr(Ge).translate(e+r,n+i),p.showGrid?(h.rowEach(o,l,function(t,e,n){t!==o&&f.line([0,e],[s,e]),t===l&&f.line([0,e+n],[s,e+n])}),h.colEach(a,c,function(t,e,n){t!==a&&f.line([e,0],[e,u]),t===c&&f.line([e+n,0],[e+n,u])}),f.restore()):f.restore()}var an=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=e,this.draw=new Ce(e,n.viewWidth(),n.viewHeight()),this.data=n}var e,n,r;return e=t,(n=[{key:\"resetData\",value:function(t){this.data=t,this.render()}},{key:\"render\",value:function(){var t=this.data,e=t.rows,n=t.cols.indexWidth,r=e.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.clear();var i=t.viewRange(),o=t.freezeTotalWidth(),a=t.freezeTotalHeight(),l=t.scroll,c=l.x,s=l.y;on.call(this,i,n,r,o,a),en.call(this,i,n,r,-c,-s),rn.call(this,\"all\",i,n,r,o,a),function(t,e){var n=this.draw;n.save(),n.attr({fillStyle:\"#f4f5f8\"}).fillRect(0,0,t,e),n.restore()}.call(this,n,r);var u=Xe(t.freeze,2),f=u[0],h=u[1];if(f>0||h>0){if(f>0){var p=i.clone();p.sri=0,p.eri=f-1,p.h=a,on.call(this,p,n,r,o,0),en.call(this,p,n,r,-c,0),rn.call(this,\"top\",p,n,r,o,0)}if(h>0){var d=i.clone();d.sci=0,d.eci=h-1,d.w=o,on.call(this,d,n,r,0,a),rn.call(this,\"left\",d,n,r,0,a),en.call(this,d,n,r,0,-s)}var y=t.freezeViewRange();on.call(this,y,n,r,0,0),rn.call(this,\"all\",y,n,r,0,0),en.call(this,y,n,r,0,0),function(t,e,n,r){var i=this.draw,o=this.data,a=o.viewWidth()-t,l=o.viewHeight()-e;i.save().translate(t,e).attr({strokeStyle:\"rgba(75, 137, 255, .6)\"}),i.line([0,r],[a,r]),i.line([n,0],[n,l]),i.restore()}.call(this,n,r,o,a)}}},{key:\"clear\",value:function(){this.draw.clear()}}])&&Ze(e.prototype,n),r&&Ze(e,r),t}();function ln(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function cn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var sn=[[\"A3\",11.69,16.54],[\"A4\",8.27,11.69],[\"A5\",5.83,8.27],[\"B4\",9.84,13.9],[\"B5\",6.93,9.84]],un=[\"landscape\",\"portrait\"];function fn(t){return parseInt(96*t,10)}function hn(t){\"cancel\"===t?this.el.hide():this.toPrint()}var pn=function(){function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.paper={w:fn(sn[0][1]),h:fn(sn[0][2]),padding:50,orientation:un[0],get width(){return\"landscape\"===this.orientation?this.h:this.w},get height(){return\"landscape\"===this.orientation?this.w:this.h}},this.data=e,this.el=a(\"div\",\"\".concat(kt,\"-print\")).children(a(\"div\",\"\".concat(kt,\"-print-bar\")).children(a(\"div\",\"-title\").child(\"Print settings\"),a(\"div\",\"-right\").children(a(\"div\",\"\".concat(kt,\"-buttons\")).children(new ve(\"cancel\").on(\"click\",hn.bind(this,\"cancel\")),new ve(\"next\",\"primary\").on(\"click\",hn.bind(this,\"next\"))))),a(\"div\",\"\".concat(kt,\"-print-content\")).children(this.contentEl=a(\"div\",\"-content\"),a(\"div\",\"-sider\").child(a(\"form\",\"\").children(a(\"fieldset\",\"\").children(a(\"label\",\"\").child(\"\".concat(L(\"print.size\"))),(n=a(\"select\",\"\")).children.apply(n,ln(sn.map(function(t,e){return a(\"option\",\"\").attr(\"value\",e).child(\"\".concat(t[0],\" ( \").concat(t[1],\"''x\").concat(t[2],\"'' )\"))}))).on(\"change\",function(t){var e=this.paper,n=t.target.value,r=sn[n];e.w=fn(r[1]),e.h=fn(r[2]),this.preview()}.bind(this))),a(\"fieldset\",\"\").children(a(\"label\",\"\").child(\"\".concat(L(\"print.orientation\"))),(r=a(\"select\",\"\")).children.apply(r,ln(un.map(function(t,e){return a(\"option\",\"\").attr(\"value\",e).child(\"\".concat(L(\"print.orientations\")[e]))}))).on(\"change\",function(t){var e=this.paper,n=t.target.value,r=un[n];e.orientation=r,this.preview()}.bind(this))))))).hide()}var e,n,r;return e=t,(n=[{key:\"resetData\",value:function(t){this.data=t}},{key:\"preview\",value:function(){var t=this,e=this.data,n=this.paper,r=n.width,i=n.height,o=n.padding,l=r-2*o,c=i-2*o,s=e.contentRange(),u=parseInt(s.h/c,10)+1,f=l/s.w,h=o,p=o;f>1&&(h+=(l-s.w)/2);var d=0,y=0;this.contentEl.html(\"\"),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},b=function(n){var o=0,l=0,u=a(\"div\",\"\".concat(kt,\"-canvas-card\")),b=a(\"canvas\",\"\".concat(kt,\"-canvas\"));t.canvases.push(b.el);var g=new Ce(b.el,r,i);for(g.save(),g.translate(h,p),f<1&&g.scale(f,f);d<=s.eri;d+=1){var m=e.rows.getHeight(d);if(!((o+=m)<c)){l=-(o-m);break}for(var w=0;w<=s.eci;w+=1)tn(g,e,d,w,y),v.eci=w}v.eri=d,g.restore(),g.save(),g.translate(h,p),f<1&&g.scale(f,f);var k=y;e.eachMergesInView(v,function(t){var n=t.sri,r=t.sci;tn(g,e,n,r,k)}),g.restore(),v.sri=v.eri,v.sci=v.eci,y+=l,t.contentEl.child(a(\"div\",\"\".concat(kt,\"-canvas-card-wraper\")).child(u.child(b)))},g=0;g<u;g+=1)b();this.el.show()}},{key:\"toPrint\",value:function(){this.el.hide();var t=this.paper,e=a(\"iframe\",\"\").hide().el;window.document.body.appendChild(e);var n=e.contentWindow,r=n.document,i=document.createElement(\"style\");i.innerHTML=\"\\n      @page { size: \".concat(t.width,\"px \").concat(t.height,\"px; };\\n      canvas {\\n        page-break-before: auto;        \\n        page-break-after: always;\\n        image-rendering: pixelated;\\n      };\\n    \"),r.head.appendChild(i),this.canvases.forEach(function(t){var e=t.cloneNode(!1);e.getContext(\"2d\").drawImage(t,0,0),r.body.appendChild(e)}),n.print()}}])&&cn(e.prototype,n),r&&cn(e,r),t}();function dn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var vn=[{key:\"copy\",title:U(\"contextmenu.copy\"),label:\"Ctrl+C\"},{key:\"cut\",title:U(\"contextmenu.cut\"),label:\"Ctrl+X\"},{key:\"paste\",title:U(\"contextmenu.paste\"),label:\"Ctrl+V\"},{key:\"paste-value\",title:U(\"contextmenu.pasteValue\"),label:\"Ctrl+Shift+V\"},{key:\"paste-format\",title:U(\"contextmenu.pasteFormat\"),label:\"Ctrl+Alt+V\"},{key:\"divider\"},{key:\"insert-row\",title:U(\"contextmenu.insertRow\")},{key:\"insert-column\",title:U(\"contextmenu.insertColumn\")},{key:\"divider\"},{key:\"delete-row\",title:U(\"contextmenu.deleteRow\")},{key:\"delete-column\",title:U(\"contextmenu.deleteColumn\")},{key:\"delete-cell-text\",title:U(\"contextmenu.deleteCellText\")},{key:\"hide\",title:U(\"contextmenu.hide\")},{key:\"divider\"},{key:\"validation\",title:U(\"contextmenu.validation\")},{key:\"divider\"},{key:\"cell-printable\",title:U(\"contextmenu.cellprintable\")},{key:\"cell-non-printable\",title:U(\"contextmenu.cellnonprintable\")},{key:\"divider\"},{key:\"cell-editable\",title:U(\"contextmenu.celleditable\")},{key:\"cell-non-editable\",title:U(\"contextmenu.cellnoneditable\")}];function bn(){var t=this;return vn.map(function(e){return function(t){var e=this;return\"divider\"===t.key?a(\"div\",\"\".concat(kt,\"-item divider\")):a(\"div\",\"\".concat(kt,\"-item\")).on(\"click\",function(){e.itemClick(t.key),e.hide()}).children(t.title(),a(\"div\",\"label\").child(t.label||\"\"))}.call(t,e)})}var gn=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.menuItems=bn.call(this),this.el=(n=a(\"div\",\"\".concat(kt,\"-contextmenu\"))).children.apply(n,dn(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.isHide=r,this.setMode(\"range\")}var e,n,r;return e=t,(n=[{key:\"setMode\",value:function(t){var e=this.menuItems[12];\"row-col\"===t?e.show():e.hide()}},{key:\"hide\",value:function(){var t=this.el;t.hide(),bt(t)}},{key:\"setPosition\",value:function(t,e){if(!this.isHide){var n=this.el,r=n.show().offset().width,i=this.viewFn(),o=i.height/2,a=t;i.width-t<=r&&(a-=r),n.css(\"left\",\"\".concat(a,\"px\")),e>o?n.css(\"bottom\",\"\".concat(i.height-e,\"px\")).css(\"max-height\",\"\".concat(e,\"px\")).css(\"top\",\"auto\"):n.css(\"top\",\"\".concat(e,\"px\")).css(\"max-height\",\"\".concat(i.height-e,\"px\")).css(\"bottom\",\"auto\"),gt(n)}}}])&&yn(e.prototype,n),r&&yn(e,r),t}();function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var wn=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.tip=\"\",e&&(this.tip=L(\"toolbar.\".concat(e.replace(/-[a-z]/g,function(t){return t[1].toUpperCase()})))),n&&(this.tip+=\" (\".concat(n,\")\")),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"element\",value:function(){var t=this,e=this.tip;return a(\"div\",\"\".concat(kt,\"-toolbar-btn\")).on(\"mouseenter\",function(e){t.tip&&function(t,e){if(!e.classList.contains(\"active\")){var n=e.getBoundingClientRect(),r=n.left,i=n.top,o=n.width,l=n.height,c=a(\"div\",\"\".concat(kt,\"-tooltip\")).html(t).show();document.body.appendChild(c.el);var s=c.box();c.css(\"left\",\"\".concat(r+o/2-s.width/2,\"px\")).css(\"top\",\"\".concat(i+l+2,\"px\")),yt(e,\"mouseleave\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}),yt(e,\"click\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})}}(t.tip,e.target)}).attr(\"data-tooltip\",e)}},{key:\"setState\",value:function(){}}])&&mn(e.prototype,n),r&&mn(e,r),t}();function kn(t){return(kn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function On(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Sn(t,e){return!e||\"object\"!==kn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function xn(t,e,n){return(xn=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=En(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function En(t){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jn(t,e){return(jn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var _n=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Sn(this,En(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jn(t,e)}(e,wn),n=e,(r=[{key:\"dropdown\",value:function(){}},{key:\"getValue\",value:function(t){return t}},{key:\"element\",value:function(){var t=this,n=this.tag;return this.dd=this.dropdown(),this.dd.change=function(e){return t.change(n,t.getValue(e))},xn(En(e.prototype),\"element\",this).call(this).child(this.dd)}},{key:\"setState\",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}])&&On(n.prototype,r),i&&On(n,i),e}();function Cn(t){return(Cn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Tn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Pn(t,e){return!e||\"object\"!==Cn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function An(t){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Rn(t,e){return(Rn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Dn=function(t){function e(t,n,r,i){var o,l;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(l=Pn(this,An(e).call(this,\"div\",\"\".concat(kt,\"-dropdown \").concat(i)))).title=t,l.change=function(){},l.headerClick=function(){},\"string\"==typeof t?l.title=a(\"div\",\"\".concat(kt,\"-dropdown-title\")).child(t):r&&l.title.addClass(\"arrow-left\"),l.contentEl=a(\"div\",\"\".concat(kt,\"-dropdown-content\")).css(\"width\",n).hide();for(var c=arguments.length,s=new Array(c>4?c-4:0),u=4;u<c;u++)s[u-4]=arguments[u];return(o=l).setContentChildren.apply(o,s),l.headerEl=a(\"div\",\"\".concat(kt,\"-dropdown-header\")),l.headerEl.on(\"click\",function(){\"block\"!==l.contentEl.css(\"display\")?l.show():l.hide()}).children(l.title,r?a(\"div\",\"\".concat(kt,\"-icon arrow-right\")).child(a(\"div\",\"\".concat(kt,\"-icon-img arrow-down\"))):\"\"),l.children(l.headerEl,l.contentEl),l}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rn(t,e)}(e,o),n=e,(r=[{key:\"setContentChildren\",value:function(){var t;(this.contentEl.html(\"\"),arguments.length>0)&&(t=this.contentEl).children.apply(t,arguments)}},{key:\"setTitle\",value:function(t){this.title.html(t),this.hide()}},{key:\"show\",value:function(){var t=this;this.contentEl.show(),this.parent().active(),gt(this.parent(),function(){t.hide()})}},{key:\"hide\",value:function(){this.parent().active(!1),this.contentEl.hide(),bt(this.parent())}}])&&Tn(n.prototype,r),i&&Tn(n,i),e}();function In(t){return(In=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function zn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mn(t,e){return!e||\"object\"!==In(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Nn(t){return(Nn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fn(t,e){return(Fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Wn=function(t){function e(t,n){var r,i;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var o=new Gt(\"align-\".concat(n)),l=t.map(function(t){return(e=\"align-\".concat(t),a(\"div\",\"\".concat(kt,\"-item\")).child(new Gt(e))).on(\"click\",function(){i.setTitle(t),i.change(t)});var e});return i=Mn(this,(r=Nn(e)).call.apply(r,[this,o,\"auto\",!0,\"bottom-left\"].concat(zn(l))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fn(t,e)}(e,Dn),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.setName(\"align-\".concat(t)),this.hide()}}])&&Hn(n.prototype,r),i&&Hn(n,i),e}();function Vn(t){return(Vn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bn(t,e){return!e||\"object\"!==Vn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Un(t,e){return(Un=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Yn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Bn(this,Ln(e).call(this,\"align\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Un(t,e)}(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new Wn([\"left\",\"center\",\"right\"],t)}}])&&qn(n.prototype,r),i&&qn(n,i),e}();function $n(t){return($n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Zn(t,e){return!e||\"object\"!==$n(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Kn(t){return(Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jn(t,e){return(Jn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Gn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Zn(this,Kn(e).call(this,\"valign\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jn(t,e)}(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new Wn([\"top\",\"middle\",\"bottom\"],t)}}])&&Xn(n.prototype,r),i&&Xn(n,i),e}();function Qn(t){return(Qn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function tr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function er(t,e){return!e||\"object\"!==Qn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function nr(t,e,n){return(nr=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ir(t,e){return(ir=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var or=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),er(this,rr(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ir(t,e)}(e,wn),n=e,(r=[{key:\"element\",value:function(){var t=this,n=this.tag;return nr(rr(e.prototype),\"element\",this).call(this).child(new Gt(n)).on(\"click\",function(){return t.click()})}},{key:\"click\",value:function(){this.change(this.tag,this.toggle())}},{key:\"setState\",value:function(t){this.el.active(t)}},{key:\"toggle\",value:function(){return this.el.toggle()}},{key:\"active\",value:function(){return this.el.hasClass(\"active\")}}])&&tr(n.prototype,r),i&&tr(n,i),e}();function ar(t){return(ar=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function cr(t,e){return!e||\"object\"!==ar(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function sr(t){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ur(t,e){return(ur=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var fr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),cr(this,sr(e).call(this,\"autofilter\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ur(t,e)}(e,or),n=e,(r=[{key:\"setState\",value:function(){}}])&&lr(n.prototype,r),i&&lr(n,i),e}();function hr(t){return(hr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function pr(t,e){return!e||\"object\"!==hr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function dr(t){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yr(t,e){return(yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var vr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),pr(this,dr(e).call(this,\"font-bold\",\"Ctrl+B\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yr(t,e)}(e,or),e}();function br(t){return(br=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function gr(t,e){return!e||\"object\"!==br(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function mr(t){return(mr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var kr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),gr(this,mr(e).call(this,\"font-italic\",\"Ctrl+I\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wr(t,e)}(e,or),e}();function Or(t){return(Or=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Sr(t,e){return!e||\"object\"!==Or(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function xr(t){return(xr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Er(t,e){return(Er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var jr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Sr(this,xr(e).call(this,\"strike\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Er(t,e)}(e,or),e}();function _r(t){return(_r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Cr(t,e){return!e||\"object\"!==_r(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Tr(t){return(Tr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pr(t,e){return(Pr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ar=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Cr(this,Tr(e).call(this,\"underline\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pr(t,e)}(e,or),e}();function Rr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var Dr=[\"#ffffff\",\"#000100\",\"#e7e5e6\",\"#445569\",\"#5b9cd6\",\"#ed7d31\",\"#a5a5a5\",\"#ffc001\",\"#4371c6\",\"#71ae47\"],Ir=[[\"#f2f2f2\",\"#7f7f7f\",\"#d0cecf\",\"#d5dce4\",\"#deeaf6\",\"#fce5d5\",\"#ededed\",\"#fff2cd\",\"#d9e2f3\",\"#e3efd9\"],[\"#d8d8d8\",\"#595959\",\"#afabac\",\"#adb8ca\",\"#bdd7ee\",\"#f7ccac\",\"#dbdbdb\",\"#ffe59a\",\"#b3c6e7\",\"#c5e0b3\"],[\"#bfbfbf\",\"#3f3f3f\",\"#756f6f\",\"#8596b0\",\"#9cc2e6\",\"#f4b184\",\"#c9c9c9\",\"#fed964\",\"#8eaada\",\"#a7d08c\"],[\"#a5a5a5\",\"#262626\",\"#3a3839\",\"#333f4f\",\"#2e75b5\",\"#c45a10\",\"#7b7b7b\",\"#bf8e01\",\"#2f5596\",\"#538136\"],[\"#7f7f7f\",\"#0c0c0c\",\"#171516\",\"#222a35\",\"#1f4e7a\",\"#843c0a\",\"#525252\",\"#7e6000\",\"#203864\",\"#365624\"]],zr=[\"#c00000\",\"#fe0000\",\"#fdc101\",\"#ffff01\",\"#93d051\",\"#00b04e\",\"#01b0f1\",\"#0170c1\",\"#012060\",\"#7030a0\"];function Hr(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(kt,\"-color-palette-cell\")).on(\"click.stop\",function(){return e.change(t)}).css(\"background-color\",t))}var Mr=function t(){var e,n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=a(\"div\",\"\".concat(kt,\"-color-palette\")),this.change=function(){};var o=a(\"table\",\"\").children((e=a(\"tbody\",\"\")).children.apply(e,[(n=a(\"tr\",\"\".concat(kt,\"-theme-color-placeholders\"))).children.apply(n,Rr(Dr.map(function(t){return Hr.call(i,t)})))].concat(Rr(Ir.map(function(t){var e;return(e=a(\"tr\",\"\".concat(kt,\"-theme-colors\"))).children.apply(e,Rr(t.map(function(t){return Hr.call(i,t)})))})),[(r=a(\"tr\",\"\".concat(kt,\"-standard-colors\"))).children.apply(r,Rr(zr.map(function(t){return Hr.call(i,t)})))])));this.el.child(o)};function Nr(t){return(Nr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wr(t,e){return!e||\"object\"!==Nr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Vr(t){return(Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qr(t,e){return(qr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Br=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Gt(t).css(\"height\",\"16px\").css(\"border-bottom\",\"3px solid \".concat(n)),o=new Mr;return o.change=function(t){r.setTitle(t),r.change(t)},r=Wr(this,Vr(e).call(this,i,\"auto\",!1,\"bottom-left\",o.el))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qr(t,e)}(e,Dn),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.css(\"border-color\",t),this.hide()}}])&&Fr(n.prototype,r),i&&Fr(n,i),e}();function Lr(t){return(Lr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ur(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Yr(t,e){return!e||\"object\"!==Lr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function $r(t){return($r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xr(t,e){return(Xr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Zr=[[\"thin\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"medium\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"2\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.0\" x2=\"50\" y2=\"1.0\" stroke-width=\"2\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"thick\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"3\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.5\" x2=\"50\" y2=\"1.5\" stroke-width=\"3\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"dashed\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"2\" style=\"user-select: none;\"></line></svg>'],[\"dotted\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"1\" style=\"user-select: none;\"></line></svg>']],Kr=function(t){function e(t){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Gt(\"line-type\"),o=0,l=Zr.map(function(e,n){return a(\"div\",\"\".concat(kt,\"-item state \").concat(t===e[0]?\"checked\":\"\")).on(\"click\",function(){l[o].toggle(\"checked\"),l[n].toggle(\"checked\"),o=n,r.hide(),r.change(e)}).child(a(\"div\",\"\".concat(kt,\"-line-type\")).html(e[1]))});return r=Yr(this,(n=$r(e)).call.apply(n,[this,i,\"auto\",!1,\"bottom-left\"].concat(Ur(l))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xr(t,e)}(e,Dn),e}();function Jr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Gr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Qr(){var t;return a(\"table\",\"\").child((t=a(\"tbody\",\"\")).children.apply(t,arguments))}function ti(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(kt,\"-border-palette-cell\")).child(new Gt(\"border-\".concat(t))).on(\"click\",function(){e.mode=t;var n=e.mode,r=e.style,i=e.color;e.change({mode:n,style:r,color:i})}))}var ei=function t(){var e,n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.color=\"#000\",this.style=\"thin\",this.mode=\"all\",this.change=function(){},this.ddColor=new Br(\"line-color\",this.color),this.ddColor.change=function(t){r.color=t},this.ddType=new Kr(this.style),this.ddType.change=function(t){var e=Gr(t,1)[0];r.style=e},this.el=a(\"div\",\"\".concat(kt,\"-border-palette\"));var i=Qr(a(\"tr\",\"\").children(a(\"td\",\"\".concat(kt,\"-border-palette-left\")).child(Qr((e=a(\"tr\",\"\")).children.apply(e,Jr([\"all\",\"inside\",\"horizontal\",\"vertical\",\"outside\"].map(function(t){return ti.call(r,t)}))),(n=a(\"tr\",\"\")).children.apply(n,Jr([\"left\",\"top\",\"right\",\"bottom\",\"none\"].map(function(t){return ti.call(r,t)}))))),a(\"td\",\"\".concat(kt,\"-border-palette-right\")).children(a(\"div\",\"\".concat(kt,\"-toolbar-btn\")).child(this.ddColor.el),a(\"div\",\"\".concat(kt,\"-toolbar-btn\")).child(this.ddType.el))));this.el.child(i)};function ni(t){return(ni=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ri(t,e){return!e||\"object\"!==ni(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ii(t){return(ii=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oi(t,e){return(oi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ai=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new Gt(\"border-all\"),r=new ei;return r.change=function(e){t.change(e),t.hide()},t=ri(this,ii(e).call(this,n,\"auto\",!1,\"bottom-left\",r.el))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&oi(t,e)}(e,Dn),e}();function li(t){return(li=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function si(t,e){return!e||\"object\"!==li(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ui(t){return(ui=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fi(t,e){return(fi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var hi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),si(this,ui(e).call(this,\"border\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fi(t,e)}(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){return new ai}}])&&ci(n.prototype,r),i&&ci(n,i),e}();function pi(t){return(pi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function di(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yi(t,e){return!e||\"object\"!==pi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function vi(t,e,n){return(vi=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bi(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function bi(t){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gi(t,e){return(gi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var mi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),yi(this,bi(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gi(t,e)}(e,wn),n=e,(r=[{key:\"element\",value:function(){var t=this;return vi(bi(e.prototype),\"element\",this).call(this).child(new Gt(this.tag)).on(\"click\",function(){return t.change(t.tag)})}},{key:\"setState\",value:function(t){this.el.disabled(t)}}])&&di(n.prototype,r),i&&di(n,i),e}();function wi(t){return(wi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ki(t,e){return!e||\"object\"!==wi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Oi(t){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Si(t,e){return(Si=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var xi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ki(this,Oi(e).call(this,\"clearformat\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Si(t,e)}(e,mi),e}();function Ei(t){return(Ei=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ji(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _i(t,e){return!e||\"object\"!==Ei(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ci(t){return(Ci=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ti(t,e){return(Ti=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Pi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),_i(this,Ci(e).call(this,\"paintformat\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ti(t,e)}(e,or),n=e,(r=[{key:\"setState\",value:function(){}}])&&ji(n.prototype,r),i&&ji(n,i),e}();function Ai(t){return(Ai=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ri(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Di(t,e){return!e||\"object\"!==Ai(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ii(t){return(Ii=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zi(t,e){return(zi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Hi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Di(this,Ii(e).call(this,\"color\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zi(t,e)}(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new Br(t,e)}}])&&Ri(n.prototype,r),i&&Ri(n,i),e}();function Mi(t){return(Mi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ni(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fi(t,e){return!e||\"object\"!==Mi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Wi(t){return(Wi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vi(t,e){return(Vi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var qi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Fi(this,Wi(e).call(this,\"bgcolor\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vi(t,e)}(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new Br(t,e)}}])&&Ni(n.prototype,r),i&&Ni(n,i),e}();function Bi(t){return(Bi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Li(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Ui(t,e){return!e||\"object\"!==Bi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Yi(t){return(Yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $i(t,e){return($i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Xi=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Pe.map(function(t){return a(\"div\",\"\".concat(kt,\"-item\")).on(\"click\",function(){n.setTitle(\"\".concat(t.pt)),n.change(t)}).child(\"\".concat(t.pt))});return n=Ui(this,(t=Yi(e)).call.apply(t,[this,\"10\",\"60px\",!0,\"bottom-left\"].concat(Li(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$i(t,e)}(e,Dn),e}();function Zi(t){return(Zi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ji(t,e){return!e||\"object\"!==Zi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Gi(t){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qi(t,e){return(Qi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var to=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ji(this,Gi(e).call(this,\"font-size\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qi(t,e)}(e,_n),n=e,(r=[{key:\"getValue\",value:function(t){return t.pt}},{key:\"dropdown\",value:function(){return new Xi}}])&&Ki(n.prototype,r),i&&Ki(n,i),e}();function eo(t){return(eo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function no(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ro(t,e){return!e||\"object\"!==eo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function io(t){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oo(t,e){return(oo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ao=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Te.map(function(t){return a(\"div\",\"\".concat(kt,\"-item\")).on(\"click\",function(){n.setTitle(t.title),n.change(t)}).child(t.title)});return n=ro(this,(t=io(e)).call.apply(t,[this,Te[0].title,\"160px\",!0,\"bottom-left\"].concat(no(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&oo(t,e)}(e,Dn),e}();function lo(t){return(lo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function co(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function so(t,e){return!e||\"object\"!==lo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function uo(t){return(uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fo(t,e){return(fo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ho=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),so(this,uo(e).call(this,\"font-name\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fo(t,e)}(e,_n),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new ao}}])&&co(n.prototype,r),i&&co(n,i),e}();function po(t){return(po=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function yo(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function vo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bo(t,e){return!e||\"object\"!==po(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function go(t){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mo(t,e){return(mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var wo=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Ye.slice(0);return r.splice(2,0,{key:\"divider\"}),r.splice(8,0,{key:\"divider\"}),r=r.map(function(t){var e=a(\"div\",\"\".concat(kt,\"-item\"));return\"divider\"===t.key?e.addClass(\"divider\"):(e.child(t.title()).on(\"click\",function(){n.setTitle(t.title()),n.change(t)}),t.label&&e.child(a(\"div\",\"label\").html(t.label))),e}),n=bo(this,(t=go(e)).call.apply(t,[this,\"Normal\",\"220px\",!0,\"bottom-left\"].concat(yo(r))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mo(t,e)}(e,Dn),n=e,(r=[{key:\"setTitle\",value:function(t){for(var e=0;e<Ye.length;e+=1)Ye[e].key===t&&this.title.html(Ye[e].title());this.hide()}}])&&vo(n.prototype,r),i&&vo(n,i),e}();function ko(t){return(ko=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function So(t,e){return!e||\"object\"!==ko(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function xo(t){return(xo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Eo(t,e){return(Eo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var jo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),So(this,xo(e).call(this,\"format\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Eo(t,e)}(e,_n),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new wo}}])&&Oo(n.prototype,r),i&&Oo(n,i),e}();function _o(t){return(_o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Co(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function To(t,e){return!e||\"object\"!==_o(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Po(t){return(Po=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ao(t,e){return(Ao=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ro=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Ne.map(function(t){return a(\"div\",\"\".concat(kt,\"-item\")).on(\"click\",function(){n.hide(),n.change(t)}).child(t.key)});return n=To(this,(t=Po(e)).call.apply(t,[this,new Gt(\"formula\"),\"180px\",!0,\"bottom-left\"].concat(Co(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ao(t,e)}(e,Dn),e}();function Do(t){return(Do=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Io(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function zo(t,e){return!e||\"object\"!==Do(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ho(t){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mo(t,e){return(Mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var No=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),zo(this,Ho(e).call(this,\"formula\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mo(t,e)}(e,_n),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new Ro}}])&&Io(n.prototype,r),i&&Io(n,i),e}();function Fo(t){return(Fo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Wo(t,e){return!e||\"object\"!==Fo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qo(t,e){return(qo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Bo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Wo(this,Vo(e).call(this,\"freeze\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qo(t,e)}(e,or),e}();function Lo(t){return(Lo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Uo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yo(t,e){return!e||\"object\"!==Lo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function $o(t){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xo(t,e){return(Xo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Zo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Yo(this,$o(e).call(this,\"merge\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xo(t,e)}(e,or),n=e,(r=[{key:\"setState\",value:function(t,e){this.el.active(t).disabled(e)}}])&&Uo(n.prototype,r),i&&Uo(n,i),e}();function Ko(t){return(Ko=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Jo(t,e){return!e||\"object\"!==Ko(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Go(t){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qo(t,e){return(Qo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ta=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Jo(this,Go(e).call(this,\"redo\",\"Ctrl+Y\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qo(t,e)}(e,mi),e}();function ea(t){return(ea=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function na(t,e){return!e||\"object\"!==ea(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ra(t){return(ra=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ia(t,e){return(ia=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var oa=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),na(this,ra(e).call(this,\"undo\",\"Ctrl+Z\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ia(t,e)}(e,mi),e}();function aa(t){return(aa=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function la(t,e){return!e||\"object\"!==aa(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ca(t){return(ca=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sa(t,e){return(sa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ua=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),la(this,ca(e).call(this,\"print\",\"Ctrl+P\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sa(t,e)}(e,mi),e}();function fa(t){return(fa=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ha(t,e){return!e||\"object\"!==fa(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function pa(t){return(pa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function da(t,e){return(da=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ya=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ha(this,pa(e).call(this,\"textwrap\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&da(t,e)}(e,or),e}();function va(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ba(t){return(ba=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ga(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function ma(t,e){return!e||\"object\"!==ba(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function wa(t){return(wa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ka(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Oa(t,e)}function Oa(t,e){return(Oa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Sa=function(t){function e(){var t;ga(this,e);var n=new Gt(\"ellipsis\"),r=a(\"div\",\"\".concat(kt,\"-toolbar-more\"));return(t=ma(this,wa(e).call(this,n,\"auto\",!1,\"bottom-right\",r))).moreBtns=r,t.contentEl.css(\"max-width\",\"420px\"),t}return ka(e,Dn),e}(),xa=function(t){function e(){var t;return ga(this,e),(t=ma(this,wa(e).call(this,\"more\"))).el.hide(),t}var n,r,i;return ka(e,_n),n=e,(r=[{key:\"dropdown\",value:function(){return new Sa}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&va(n.prototype,r),i&&va(n,i),e}();function Ea(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ja(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function _a(){return a(\"div\",\"\".concat(kt,\"-toolbar-divider\"))}function Ca(){var t,e,n=this.el,r=this.btns,i=this.moreEl,o=this.btns2,a=i.dd,l=a.moreBtns,c=a.contentEl;n.css(\"width\",\"\".concat(this.widthFn(),\"px\"));var s=n.box(),u=160,f=12,h=[],p=[];o.forEach(function(t,e){var n=ja(t,2),r=n[0],i=n[1];u+=i,e===o.length-1||u<s.width?h.push(r):(f+=i,p.push(r))}),(t=r.html(\"\")).children.apply(t,h),(e=l.html(\"\")).children.apply(e,p),c.css(\"width\",\"\".concat(f,\"px\")),p.length>0?i.show():i.hide()}function Ta(t){var e=this,n=new wn;n.el.on(\"click\",function(){t.onClick&&t.onClick(e.data.getData(),e.data)}),n.tip=t.tip||\"\";var r=t.el;if(t.icon&&(r=a(\"img\").attr(\"src\",t.icon)),r){var i=a(\"div\",\"\".concat(kt,\"-icon\"));i.child(r),n.el.child(i)}return n}var Pa=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.data=e,this.change=function(){},this.widthFn=n,this.isHide=i;var o=e.defaultStyle();this.items=[[this.undoEl=new oa,this.redoEl=new ta,new ua,this.paintformatEl=new Pi,this.clearformatEl=new xi],_a(),[this.formatEl=new jo],_a(),[this.fontEl=new ho,this.fontSizeEl=new to],_a(),[this.boldEl=new vr,this.italicEl=new kr,this.underlineEl=new Ar,this.strikeEl=new jr,this.textColorEl=new Hi(o.color)],_a(),[this.fillColorEl=new qi(o.bgcolor),this.borderEl=new hi,this.mergeEl=new Zo],_a(),[this.alignEl=new Yn(o.align),this.valignEl=new Gn(o.valign),this.textwrapEl=new ya],_a(),[this.freezeEl=new Bo,this.autofilterEl=new fr,this.formulaEl=new No]];var l=e.settings.extendToolbar,c=void 0===l?{}:l;if(c.left&&c.left.length>0){this.items.unshift(_a());var s=c.left.map(Ta.bind(this));this.items.unshift(s)}if(c.right&&c.right.length>0){this.items.push(_a());var u=c.right.map(Ta.bind(this));this.items.push(u)}this.items.push([this.moreEl=new xa]),this.el=a(\"div\",\"\".concat(kt,\"-toolbar\")),this.btns=a(\"div\",\"\".concat(kt,\"-toolbar-btns\")),this.items.forEach(function(t){Array.isArray(t)?t.forEach(function(t){r.btns.child(t.el),t.change=function(){r.change.apply(r,arguments)}}):r.btns.child(t.el)}),this.el.child(this.btns),i?this.el.hide():(this.reset(),setTimeout(function(){(function(){var t=this;this.btns2=[],this.items.forEach(function(e){if(Array.isArray(e))e.forEach(function(e){var n=e.el,r=n.box(),i=n.computedStyle(),o=i.marginLeft,a=i.marginRight;t.btns2.push([n,r.width+parseInt(o,10)+parseInt(a,10)])});else{var n=e.box(),r=e.computedStyle(),i=r.marginLeft,o=r.marginRight;t.btns2.push([e,n.width+parseInt(i,10)+parseInt(o,10)])}})}).call(r),Ca.call(r)},0),yt(window,\"resize\",function(){Ca.call(r)}))}var e,n,r;return e=t,(n=[{key:\"paintformatActive\",value:function(){return this.paintformatEl.active()}},{key:\"paintformatToggle\",value:function(){this.paintformatEl.toggle()}},{key:\"trigger\",value:function(t){this[\"\".concat(t,\"El\")].click()}},{key:\"resetData\",value:function(t){this.data=t,this.reset()}},{key:\"reset\",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle();this.undoEl.setState(!t.canUndo()),this.redoEl.setState(!t.canRedo()),this.mergeEl.setState(t.canUnmerge(),!t.selector.multiple()),this.autofilterEl.setState(!t.canAutofilter());var n=e.font,r=e.format;this.formatEl.setState(r),this.fontEl.setState(n.name),this.fontSizeEl.setState(n.size),this.boldEl.setState(n.bold),this.italicEl.setState(n.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive())}}}])&&Ea(e.prototype,n),r&&Ea(e,r),t}();function Aa(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Ra(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Da=function(){function t(e,n){var r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"600px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.title=e,this.el=a(\"div\",\"\".concat(kt,\"-modal\")).css(\"width\",o).children(a(\"div\",\"\".concat(kt,\"-modal-header\")).children(new Gt(\"close\").on(\"click.stop\",function(){return i.hide()}),this.title),(r=a(\"div\",\"\".concat(kt,\"-modal-content\"))).children.apply(r,Aa(n))).hide()}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){var t=this;this.dimmer=a(\"div\",\"\".concat(kt,\"-dimmer active\")),document.body.appendChild(this.dimmer.el);var e=this.el.show().box(),n=e.width,r=e.height,i=document.documentElement,o=i.clientHeight,l=i.clientWidth;this.el.offset({left:(l-n)/2,top:(o-r)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},yt(window,\"keydown\",window.xkeydownEsc)}},{key:\"hide\",value:function(){this.el.hide(),document.body.removeChild(this.dimmer.el),vt(window,\"keydown\",window.xkeydownEsc),delete window.xkeydownEsc}}])&&Ra(e.prototype,n),r&&Ra(e,r),t}();function Ia(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var za=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vchange=function(){},this.el=a(\"div\",\"\".concat(kt,\"-form-input\")),this.input=a(\"input\",\"\").css(\"width\",e).on(\"input\",function(t){return r.vchange(t)}).attr(\"placeholder\",n),this.el.child(this.input)}var e,n,r;return e=t,(n=[{key:\"focus\",value:function(){var t=this;setTimeout(function(){t.input.el.focus()},10)}},{key:\"hint\",value:function(t){this.input.attr(\"placeholder\",t)}},{key:\"val\",value:function(t){return this.input.val(t)}}])&&Ia(e.prototype,n),r&&Ia(e,r),t}();function Ha(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ma=function(){function t(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.key=e,this.getTitle=o,this.vchange=function(){},this.el=a(\"div\",\"\".concat(kt,\"-form-select\")),this.suggest=new Yt(n.map(function(t){return{key:t,title:i.getTitle(t)}}),function(t){i.itemClick(t.key),l(t.key),i.vchange(t.key)},r,this.el),this.el.children(this.itemEl=a(\"div\",\"input-text\").html(this.getTitle(e)),this.suggest.el).on(\"click\",function(){return i.show()})}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){this.suggest.search(\"\")}},{key:\"itemClick\",value:function(t){this.key=t,this.itemEl.html(this.getTitle(t))}},{key:\"val\",value:function(t){return void 0!==t?(this.key=t,this.itemEl.html(this.getTitle(t)),this):this.key}}])&&Ha(e.prototype,n),r&&Ha(e,r),t}();function Na(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Fa={number:/(^\\d+$)|(^\\d+(\\.\\d{0,4})?$)/,date:/^\\d{4}-\\d{1,2}-\\d{1,2}$/},Wa=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.label=\"\",this.rule=n,r&&(this.label=a(\"label\",\"label\").css(\"width\",\"\".concat(i,\"px\")).html(r)),this.tip=a(\"div\",\"tip\").child(\"tip\").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=a(\"div\",\"\".concat(kt,\"-form-field\")).children(this.label,e.el,this.tip)}var e,n,r;return e=t,(n=[{key:\"isShow\",value:function(){return\"none\"!==this.el.css(\"display\")}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"val\",value:function(t){return this.input.val(t)}},{key:\"hint\",value:function(t){this.input.hint(t)}},{key:\"validate\",value:function(){var t=this.input,e=this.rule,n=this.tip,r=this.el,i=t.val();if(e.required&&/^\\s*$/.test(i))return n.html(L(\"validation.required\")),r.addClass(\"error\"),!1;if((e.type||e.pattern)&&!(e.pattern||Fa[e.type]).test(i))return n.html(L(\"validation.notMatch\")),r.addClass(\"error\"),!1;return r.removeClass(\"error\"),!0}}])&&Na(e.prototype,n),r&&Na(e,r),t}();function Va(t){return(Va=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function qa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ba(t,e){return!e||\"object\"!==Va(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function La(t){return(La=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ua(t,e){return(Ua=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ya=100,$a=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new Wa(new Ma(\"cell\",[\"cell\"],\"100%\",function(t){return L(\"dataValidation.modeType.\".concat(t))}),{required:!0},\"\".concat(L(\"dataValidation.range\"),\":\"),Ya),r=new Wa(new za(\"120px\",\"E3 or E3:F12\"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\\d*)(:[A-Z]{1,2}[1-9]\\d*)?$/}),i=new Wa(new Ma(\"list\",[\"list\",\"number\",\"date\",\"phone\",\"email\"],\"100%\",function(t){return L(\"dataValidation.type.\".concat(t))},function(e){return t.criteriaSelected(e)}),{required:!0},\"\".concat(L(\"dataValidation.criteria\"),\":\"),Ya),o=new Wa(new Ma(\"be\",[\"be\",\"nbe\",\"eq\",\"neq\",\"lt\",\"lte\",\"gt\",\"gte\"],\"160px\",function(t){return L(\"dataValidation.operator.\".concat(t))},function(e){return t.criteriaOperatorSelected(e)}),{required:!0}).hide(),l=new Wa(new za(\"70px\",\"10\"),{required:!0}).hide(),c=new Wa(new za(\"70px\",\"100\"),{required:!0,type:\"number\"}).hide(),s=new Wa(new za(\"120px\",\"a,b,c\"),{required:!0}),u=new Wa(new za(\"70px\",\"10\"),{required:!0,type:\"number\"}).hide();return(t=Ba(this,La(e).call(this,L(\"contextmenu.validation\"),[a(\"div\",\"\".concat(kt,\"-form-fields\")).children(n.el,r.el),a(\"div\",\"\".concat(kt,\"-form-fields\")).children(i.el,o.el,l.el,c.el,u.el,s.el),a(\"div\",\"\".concat(kt,\"-buttons\")).children(new ve(\"cancel\").on(\"click\",function(){return t.btnClick(\"cancel\")}),new ve(\"remove\").on(\"click\",function(){return t.btnClick(\"remove\")}),new ve(\"save\",\"primary\").on(\"click\",function(){return t.btnClick(\"save\")}))]))).mf=n,t.rf=r,t.cf=i,t.of=o,t.minvf=l,t.maxvf=c,t.vf=u,t.svf=s,t.change=function(){},t}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ua(t,e)}(e,Da),n=e,(r=[{key:\"showVf\",value:function(t){var e=\"date\"===t?\"2018-11-12\":\"10\",n=this.vf;n.input.hint(e),n.show()}},{key:\"criteriaSelected\",value:function(t){var e=this.of,n=this.minvf,r=this.maxvf,i=this.vf,o=this.svf;\"date\"===t||\"number\"===t?(e.show(),n.rule.type=t,r.rule.type=t,\"date\"===t?(n.hint(\"2018-11-12\"),r.hint(\"2019-11-12\")):(n.hint(\"10\"),r.hint(\"100\")),n.show(),r.show(),i.hide(),o.hide()):(\"list\"===t?o.show():o.hide(),i.hide(),e.hide(),n.hide(),r.hide())}},{key:\"criteriaOperatorSelected\",value:function(t){if(t){var e=this.minvf,n=this.maxvf,r=this.vf;if(\"be\"===t||\"nbe\"===t)e.show(),n.show(),r.hide();else{var i=this.cf.val();r.rule.type=i,\"date\"===i?r.hint(\"2018-11-12\"):r.hint(\"10\"),r.show(),e.hide(),n.hide()}}}},{key:\"btnClick\",value:function(t){if(\"cancel\"===t)this.hide();else if(\"remove\"===t)this.change(\"remove\"),this.hide();else if(\"save\"===t){for(var e=[\"mf\",\"rf\",\"cf\",\"of\",\"svf\",\"vf\",\"minvf\",\"maxvf\"],n=0;n<e.length;n+=1){var r=this[e[n]];if(r.isShow()&&!r.validate())return}var i=this.mf.val(),o=this.rf.val(),a=this.cf.val(),l=this.of.val(),c=this.svf.val();\"number\"!==a&&\"date\"!==a||(c=\"be\"===l||\"nbe\"===l?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change(\"save\",i,o,{type:a,operator:l,required:!1,value:c}),this.hide()}}},{key:\"setValue\",value:function(t){if(t){var e=this.mf,n=this.rf,r=this.cf,i=this.of,o=this.svf,a=this.vf,l=this.minvf,c=this.maxvf,s=t.mode,u=t.ref,f=t.validator||{type:\"list\"},h=f.type,p=f.operator,d=f.value;e.val(s||\"cell\"),n.val(u),r.val(h),i.val(p),Array.isArray(d)?(l.val(d[0]),c.val(d[1])):(o.val(d||\"\"),a.val(d||\"\")),this.criteriaSelected(h),this.criteriaOperatorSelected(p)}this.show()}}])&&qa(n.prototype,r),i&&qa(n,i),e}();function Xa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Za(t){return a(\"div\",\"\".concat(kt,\"-item \").concat(t))}function Ka(t){var e=this;return Za(\"state\").child(L(\"sort.\".concat(t))).on(\"click.stop\",function(){return e.itemClick(t)})}function Ja(){var t=this.filterhEl,e=this.filterValues,n=this.values;t.html(\"\".concat(e.length,\" / \").concat(n.length)),t.checked(e.length===n.length)}var Ga=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterbEl=a(\"div\",\"\".concat(kt,\"-body\")),this.filterhEl=a(\"div\",\"\".concat(kt,\"-header state\")).on(\"click.stop\",function(){return e.filterClick(0,\"all\")}),this.el=a(\"div\",\"\".concat(kt,\"-sort-filter\")).children(this.sortAscEl=Ka.call(this,\"asc\"),this.sortDescEl=Ka.call(this,\"desc\"),Za(\"divider\"),a(\"div\",\"\".concat(kt,\"-filter\")).children(this.filterhEl,this.filterbEl),a(\"div\",\"\".concat(kt,\"-buttons\")).children(new ve(\"cancel\").on(\"click\",function(){return e.btnClick(\"cancel\")}),new ve(\"ok\",\"primary\").on(\"click\",function(){return e.btnClick(\"ok\")}))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}var e,n,r;return e=t,(n=[{key:\"btnClick\",value:function(t){if(\"ok\"===t){var e=this.ci,n=this.sort,r=this.filterValues;this.ok&&this.ok(e,n,\"in\",r)}this.hide()}},{key:\"itemClick\",value:function(t){this.sort=t;var e=this.sortAscEl,n=this.sortDescEl;e.checked(\"asc\"===t),n.checked(\"desc\"===t)}},{key:\"filterClick\",value:function(t,e){var n=this.filterbEl,r=this.filterValues,i=this.values,o=n.children();\"all\"===e?o.length===r.length?(this.filterValues=[],o.forEach(function(t){return a(t).checked(!1)})):(this.filterValues=Array.from(i),o.forEach(function(t){return a(t).checked(!0)})):a(o[t]).toggle(\"checked\")?r.push(e):r.splice(r.findIndex(function(t){return t===e}),1);Ja.call(this)}},{key:\"set\",value:function(t,e,n,r){this.ci=t;var i=this.sortAscEl,o=this.sortDescEl;null!==r?(this.sort=r.order,i.checked(r.asc()),o.checked(r.desc())):(this.sortDesc=null,i.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=n?Array.from(n.value):Object.keys(e),function(t){var e=this,n=this.filterbEl,r=this.filterValues;n.html(\"\"),Object.keys(t).forEach(function(i,o){var l=t[i],c=r.includes(i)?\"checked\":\"\";n.child(a(\"div\",\"\".concat(kt,\"-item state \").concat(c)).on(\"click.stop\",function(){return e.filterClick(o,i)}).children(\"\"===i?L(\"filter.empty\"):i,a(\"div\",\"label\").html(\"(\".concat(l,\")\"))))})}.call(this,e,n),Ja.call(this)}},{key:\"setOffset\",value:function(t){var e=this;this.el.offset(t).show();var n=1;gt(this.el,function(){n<=0&&e.hide(),n-=1})}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide(),bt(this.el)}}])&&Xa(e.prototype,n),r&&Xa(e,r),t}();function Qa(t,e){var n=a(\"div\",\"\".concat(kt,\"-toast\")),r=a(\"div\",\"\".concat(kt,\"-dimmer active\"));n.children(a(\"div\",\"\".concat(kt,\"-toast-header\")).children(new Gt(\"close\").on(\"click.stop\",function(){return document.body.removeChild(n.el),void document.body.removeChild(r.el)}),t),a(\"div\",\"\".concat(kt,\"-toast-content\")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var i=n.box(),o=i.width,l=i.height,c=document.documentElement,s=c.clientHeight,u=c.clientWidth;n.offset({left:(u-o)/2,top:(s-l)/3})}function tl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function el(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function nl(t,e){var n,r=this;return function(){for(var i=r,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=a;n||(n=setTimeout(function(){n=null,t.apply(i,c)},e))}}function rl(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==n){var o=this.table,a=this.selector,l=this.toolbar,c=this.data;this.contextMenu.setMode(-1===e||-1===n?\"row-col\":\"range\");var s=c.getCell(e,n);t?(a.setEnd(e,n,i),this.trigger(\"cells-selected\",s,a.range)):(a.set(e,n,r),this.trigger(\"cell-selected\",s,e,n)),l.reset(),o.render()}}function il(t,e){var n=this.selector,r=this.data,i=r.rows,o=r.cols,a=el(n.indexes,2),l=a[0],c=a[1],s=n.range,u=s.eri,f=s.eci;if(t){var h=el(n.moveIndexes,2);l=h[0],c=h[1]}\"left\"===e?c>0&&(c-=1):\"right\"===e?(f!==c&&(c=f),c<o.len-1&&(c+=1)):\"up\"===e?l>0&&(l-=1):\"down\"===e?(u!==l&&(l=u),l<i.len-1&&(l+=1)):\"row-first\"===e?c=0:\"row-last\"===e?c=o.len-1:\"col-first\"===e?l=0:\"col-last\"===e&&(l=i.len-1),t&&(n.moveIndexes=[l,c]),rl.call(this,t,l,c),function(){var t=this.data,e=this.verticalScrollbar,n=this.horizontalScrollbar,r=t.getSelectedRect(),i=r.l,o=r.t,a=r.left,l=r.top,c=r.width,s=r.height,u=this.getTableOffset();if(Math.abs(a)+c>u.width)n.move({left:i+c-u.width});else{var f=t.freezeTotalWidth();a<f&&n.move({left:i-1-f})}if(Math.abs(l)+s>u.height)e.move({top:o+s-u.height-1});else{var h=t.freezeTotalHeight();l<h&&e.move({top:o-1-h})}}.call(this)}function ol(){var t=this.data,e=this.verticalScrollbar,n=this.getTableOffset().height,r=t.exceptRowTotalHeight(0,-1);e.set(n,t.rows.totalHeight()-r)}function al(){var t=this.data,e=this.horizontalScrollbar,n=this.getTableOffset().width;t&&e.set(n,t.cols.totalWidth())}function ll(){var t=this.tableEl,e=this.overlayerEl,n=this.overlayerCEl,r=this.table,i=this.toolbar,o=this.selector,a=this.el,l=this.getTableOffset(),c=this.getRect();t.attr(c),e.offset(c),n.offset(l),a.css(\"width\",\"\".concat(c.width,\"px\")),ol.call(this),al.call(this),function(){var t=this.selector,e=this.data,n=this.editor,r=el(e.freeze,2),i=r[0],o=r[1];if(i>0||o>0){var a=e.freezeTotalWidth(),l=e.freezeTotalHeight();n.setFreezeLengths(a,l)}t.resetAreaOffset()}.call(this),r.render(),i.reset(),o.reset()}function cl(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function sl(){var t=this.data,e=this.selector;\"read\"!==t.settings.mode&&(t.copy(),t.copyToSystemClipboard(),e.showClipboard())}function ul(){var t=this.data,e=this.selector;\"read\"!==t.settings.mode&&(t.cut(),e.showClipboard())}function fl(t,e){var n=this.data;if(\"read\"!==n.settings.mode)if(n.paste(t,function(t){return Qa(\"Tip\",t)}))ll.call(this);else if(e){var r=e.clipboardData.getData(\"text/plain\");this.data.pasteFromText(r),ll.call(this)}}function hl(t,e){this.data.unhideRowsOrCols(t,e),ll.call(this)}function pl(t){var e=this,n=this.selector,r=this.data,i=this.table,o=this.sortFilter,a=t.offsetX,l=t.offsetY,c=t.target.className===\"\".concat(kt,\"-selector-corner\"),s=r.getCellRectByXY(a,l),u=s.left,f=s.top,h=s.width,p=s.height,d=s.ri,y=s.ci,v=r.autoFilter;if(v.includes(d,y)&&u+h-20<a&&f+p-20<l){var b=v.items(y,function(t,e){return r.rows.getCell(t,e)});return o.hide(),o.set(y,b,v.getFilter(y),v.getSort(y)),void o.setOffset({left:u,top:f+p+2})}t.shiftKey||(c?n.showAutofill(d,y):rl.call(this,!1,d,y),mt(window,function(t){var i=r.getCellRectByXY(t.offsetX,t.offsetY);d=i.ri,y=i.ci,c?n.showAutofill(d,y):1!==t.buttons||t.shiftKey||rl.call(e,!0,d,y,!0,!0)},function(){c&&n.arange&&\"read\"!==r.settings.mode&&r.autofill(n.arange,\"all\",function(t){return Qa(\"Tip\",t)})&&i.render(),n.hideAutofill(),function(){var t=this.toolbar;t.paintformatActive()&&(fl.call(this,\"format\"),cl.call(this),t.paintformatToggle())}.call(e)})),c||1!==t.buttons||t.shiftKey&&rl.call(this,!0,d,y)}function dl(){var t=this.editor,e=this.data.getSelectedRect(),n=this.getTableOffset(),r=\"top\";e.top>n.height/2&&(r=\"bottom\"),t.setOffset(e,r)}function yl(){var t=this.editor,e=this.data;\"read\"!==e.settings.mode&&(dl.call(this),t.setCell(e.getSelectedCell(),e.getSelectedValidator()),cl.call(this))}function vl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"finished\",n=this.data,r=this.table;if(\"read\"!==n.settings.mode){n.setSelectedCellText(t,e);var i=n.selector,o=i.ri,a=i.ci;\"finished\"===e?r.render():this.trigger(\"cell-edited\",t,o,a)}}function bl(t){var e=this.data;\"read\"!==e.settings.mode&&(\"insert-row\"===t?e.insert(\"row\"):\"delete-row\"===t?e.delete(\"row\"):\"insert-column\"===t?e.insert(\"column\"):\"delete-column\"===t?e.delete(\"column\"):\"delete-cell\"===t?e.deleteCell():\"delete-cell-format\"===t?e.deleteCell(\"format\"):\"delete-cell-text\"===t?e.deleteCell(\"text\"):\"cell-printable\"===t?e.setSelectedCellAttr(\"printable\",!0):\"cell-non-printable\"===t?e.setSelectedCellAttr(\"printable\",!1):\"cell-editable\"===t?e.setSelectedCellAttr(\"editable\",!0):\"cell-non-editable\"===t&&e.setSelectedCellAttr(\"editable\",!1),cl.call(this),ll.call(this))}function gl(t,e){var n=this.data;if(\"undo\"===t)this.undo();else if(\"redo\"===t)this.redo();else if(\"print\"===t)this.print.preview();else if(\"paintformat\"===t)!0===e?sl.call(this):cl.call(this);else if(\"clearformat\"===t)bl.call(this,\"delete-cell-format\");else if(\"link\"===t);else if(\"chart\"===t);else if(\"autofilter\"===t)(function(){this.data.autofilter(),ll.call(this)}).call(this);else if(\"freeze\"===t)if(e){var r=n.selector,i=r.ri,o=r.ci;this.freeze(i,o)}else this.freeze(0,0);else n.setSelectedCellAttr(t,e),\"formula\"!==t||n.selector.multiple()||yl.call(this),ll.call(this)}function ml(){var t,e,n,r,i,o,a=this,l=this.selector,c=this.overlayerEl,s=this.rowResizer,u=this.colResizer,f=this.verticalScrollbar,h=this.horizontalScrollbar,p=this.editor,d=this.contextMenu,y=this.toolbar,v=this.modalValidation,b=this.sortFilter;c.on(\"mousemove\",function(t){(function(t){if(0===t.buttons&&t.target.className!==\"\".concat(kt,\"-resizer-hover\")){var e=t.offsetX,n=t.offsetY,r=this.rowResizer,i=this.colResizer,o=this.tableEl,a=this.data,l=a.rows,c=a.cols;if(e>c.indexWidth&&n>l.height)return r.hide(),void i.hide();var s=o.box(),u=a.getCellRectByXY(t.offsetX,t.offsetY);u.ri>=0&&-1===u.ci?(u.width=c.indexWidth,r.show(u,{width:s.width}),l.isHide(u.ri-1)?r.showUnhide(u.ri):r.hideUnhide()):r.hide(),-1===u.ri&&u.ci>=0?(u.height=l.height,i.show(u,{height:s.height}),c.isHide(u.ci-1)?i.showUnhide(u.ci):i.hideUnhide()):i.hide()}}).call(a,t)}).on(\"mousedown\",function(t){p.clear(),d.hide(),2===t.buttons?(a.data.xyInSelectedRect(t.offsetX,t.offsetY)?d.setPosition(t.offsetX,t.offsetY):(pl.call(a,t),d.setPosition(t.offsetX,t.offsetY)),t.stopPropagation()):2===t.detail?yl.call(a):pl.call(a,t)}).on(\"mousewheel.stop\",function(t){(function(t){var e=this.verticalScrollbar,n=this.horizontalScrollbar,r=this.data,i=e.scroll().top,o=n.scroll().left,a=r.rows,l=r.cols,c=t.deltaY,s=t.deltaX,u=function(t,e){var n=t,r=0;do{r=e(n),n+=1}while(r<=0);return r},f=function(t){if(t>0){var n=r.scroll.ri+1;if(n<a.len){var o=u(n,function(t){return a.getHeight(t)});e.move({top:i+o-1})}}else{var l=r.scroll.ri-1;if(l>=0){var c=u(l,function(t){return a.getHeight(t)});e.move({top:0===l?0:i-c})}}},h=Math.abs(c),p=Math.abs(s),d=Math.max(h,p);/Firefox/i.test(window.navigator.userAgent)&&nl(f(t.detail),50),d===p&&nl(function(t){if(t>0){var e=r.scroll.ci+1;if(e<l.len){var i=u(e,function(t){return l.getWidth(t)});n.move({left:o+i-1})}}else{var a=r.scroll.ci-1;if(a>=0){var c=u(a,function(t){return l.getWidth(t)});n.move({left:0===a?0:o-c})}}}(s),50),d===h&&nl(f(c),50)}).call(a,t)}).on(\"mouseout\",function(t){var e=t.offsetX;t.offsetY<=0&&u.hide(),e<=0&&s.hide()}),l.inputChange=function(t){vl.call(a,t,\"input\"),yl.call(a)},t=c.el,n=(e={move:function(t,e){(function(t,e){var n=this.verticalScrollbar,r=this.horizontalScrollbar,i=n.scroll().top,o=r.scroll().left;\"left\"===t||\"right\"===t?r.move({left:o-e}):\"up\"!==t&&\"down\"!==t||n.move({top:i-e})}).call(a,t,e)}}).move,r=e.end,i=0,o=0,yt(t,\"touchstart\",function(t){var e=t.touches[0],n=e.pageX,r=e.pageY;i=n,o=r}),yt(t,\"touchmove\",function(t){if(n){var e=t.changedTouches[0],r=e.pageX,a=e.pageY,l=r-i,c=a-o;(Math.abs(l)>10||Math.abs(c)>10)&&(wt(l,c,t,n),i=r,o=a),t.preventDefault()}}),yt(t,\"touchend\",function(t){if(r){var e=t.changedTouches[0],n=e.pageX,a=e.pageY;wt(n-i,a-o,t,r)}}),y.change=function(t,e){return gl.call(a,t,e)},b.ok=function(t,e,n,r){return function(t,e,n,r){this.data.setAutoFilter(t,e,n,r),ll.call(this)}.call(a,t,e,n,r)},s.finishedFn=function(t,e){(function(t,e){var n=t.ri,r=this.table,i=this.selector;this.data.rows.setHeight(n,e),r.render(),i.resetAreaOffset(),ol.call(this),dl.call(this)}).call(a,t,e)},u.finishedFn=function(t,e){(function(t,e){var n=t.ci,r=this.table,i=this.selector;this.data.cols.setWidth(n,e),r.render(),i.resetAreaOffset(),al.call(this),dl.call(this)}).call(a,t,e)},s.unhideFn=function(t){hl.call(a,\"row\",t)},u.unhideFn=function(t){hl.call(a,\"col\",t)},f.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrolly(t,function(){i.resetBRLAreaOffset(),dl.call(e),r.render()})}).call(a,t,e)},h.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrollx(t,function(){i.resetBRTAreaOffset(),dl.call(e),r.render()})}).call(a,t,e)},p.change=function(t,e){vl.call(a,e,t)},v.change=function(t){if(\"save\"===t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=a.data).addValidation.apply(e,r)}else a.data.removeValidation()},d.itemClick=function(t){\"validation\"===t?v.setValue(a.data.getSelectedValidation()):\"copy\"===t?sl.call(a):\"cut\"===t?ul.call(a):\"paste\"===t?fl.call(a,\"all\"):\"paste-value\"===t?fl.call(a,\"text\"):\"paste-format\"===t?fl.call(a,\"format\"):\"hide\"===t?function(){this.data.hideRowsOrCols(),ll.call(this)}.call(a):bl.call(a,t)},yt(window,\"resize\",function(){a.reload()}),yt(window,\"click\",function(t){a.focusing=c.contains(t.target)}),yt(window,\"paste\",function(t){a.focusing&&(fl.call(a,\"all\",t),t.preventDefault())}),yt(window,\"keydown\",function(t){if(a.focusing){var e=t.keyCode||t.which,n=t.key,r=t.ctrlKey,i=t.shiftKey,o=t.metaKey;if(r||o)switch(e){case 90:a.undo(),t.preventDefault();break;case 89:a.redo(),t.preventDefault();break;case 67:sl.call(a),t.preventDefault();break;case 88:ul.call(a),t.preventDefault();break;case 85:y.trigger(\"underline\"),t.preventDefault();break;case 86:break;case 37:il.call(a,i,\"row-first\"),t.preventDefault();break;case 38:il.call(a,i,\"col-first\"),t.preventDefault();break;case 39:il.call(a,i,\"row-last\"),t.preventDefault();break;case 40:il.call(a,i,\"col-last\"),t.preventDefault();break;case 32:rl.call(a,!1,-1,a.data.selector.ci,!1),t.preventDefault();break;case 66:y.trigger(\"bold\");break;case 73:y.trigger(\"italic\")}else{switch(e){case 32:i&&rl.call(a,!1,a.data.selector.ri,-1,!1);break;case 27:d.hide(),cl.call(a);break;case 37:il.call(a,i,\"left\"),t.preventDefault();break;case 38:il.call(a,i,\"up\"),t.preventDefault();break;case 39:il.call(a,i,\"right\"),t.preventDefault();break;case 40:il.call(a,i,\"down\"),t.preventDefault();break;case 9:p.clear(),il.call(a,!1,i?\"left\":\"right\"),t.preventDefault();break;case 13:p.clear(),il.call(a,!1,i?\"up\":\"down\"),t.preventDefault();break;case 8:bl.call(a,\"delete-cell-text\"),t.preventDefault()}\"Delete\"===n?(bl.call(a,\"delete-cell-text\"),t.preventDefault()):e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=105||\"=\"===t.key?(vl.call(a,t.key,\"input\"),yl.call(a)):113===e&&yl.call(a)}}})}var wl=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.eventMap=function(){var t=new Map;function e(e,n){var r;return t.has(e)&&(r=t.get(e),Array.isArray(r)&&r.push(n)||!1)||t.set(e,[].concat(n))}function n(e,n){var r,i;return t.has(e)&&(r=t.get(e),(i=r.indexOf(n))>=0&&r.splice(i,1)&&0===t.get(e).length&&t.delete(e))}return{get current(){return t},on:e,once:function(t,r){return e(t,function e(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r.call.apply(r,[null].concat(o)),n(t,e)})},fire:function(e,n){return t.has(e)&&function(){var r=t.get(e),i=!0,o=!1,a=void 0;try{for(var l,c=r[Symbol.iterator]();!(i=(l=c.next()).done);i=!0){var s=l.value;s.call.apply(s,[null].concat(dt(n)))}}catch(t){o=!0,a=t}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}}()},removeListener:n,removeAllListeners:function(){t.clear()}}}();var i=n.settings,o=i.view,l=i.showToolbar,c=i.showContextmenu;this.el=a(\"div\",\"\".concat(kt,\"-sheet\")),this.toolbar=new Pa(n,o.width,!l),this.print=new pn(n),e.children(this.toolbar.el,this.el,this.print.el),this.data=n,this.tableEl=a(\"canvas\",\"\".concat(kt,\"-table\")),this.rowResizer=new St(!1,n.rows.height),this.colResizer=new St(!0,n.cols.minWidth),this.verticalScrollbar=new Et(!0),this.horizontalScrollbar=new Et(!1),this.editor=new fe(Fe,function(){return r.getTableOffset()},n.rows.height),this.modalValidation=new $a,this.contextMenu=new gn(function(){return r.getRect()},!c),this.selector=new qt(n),this.overlayerCEl=a(\"div\",\"\".concat(kt,\"-overlayer-content\")).children(this.editor.el,this.selector.el),this.overlayerEl=a(\"div\",\"\".concat(kt,\"-overlayer\")).child(this.overlayerCEl),this.sortFilter=new Ga,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.modalValidation.el,this.sortFilter.el),this.table=new an(this.tableEl.el,n),ml.call(this),ll.call(this),rl.call(this,!1,0,0)}var e,n,r;return e=t,(n=[{key:\"on\",value:function(t,e){return this.eventMap.on(t,e),this}},{key:\"trigger\",value:function(t){for(var e=this.eventMap,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.fire(t,r)}},{key:\"resetData\",value:function(t){this.editor.clear(),this.data=t,ol.call(this),al.call(this),this.toolbar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t)}},{key:\"loadData\",value:function(t){return this.data.setData(t),ll.call(this),this}},{key:\"freeze\",value:function(t,e){return this.data.setFreeze(t,e),ll.call(this),this}},{key:\"undo\",value:function(){this.data.undo(),ll.call(this)}},{key:\"redo\",value:function(){this.data.redo(),ll.call(this)}},{key:\"reload\",value:function(){return ll.call(this),this}},{key:\"getRect\",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:\"getTableOffset\",value:function(){var t=this.data,e=t.rows,n=t.cols,r=this.getRect(),i=r.width,o=r.height;return{width:i-n.indexWidth,height:o-e.height,left:n.indexWidth,top:e.height}}}])&&tl(e.prototype,n),r&&tl(e,r),t}();function kl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Ol(t){return(Ol=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Sl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function xl(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function El(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function jl(t,e,n){return e&&El(t.prototype,e),n&&El(t,n),t}function _l(t,e){return!e||\"object\"!==Ol(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Cl(t){return(Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tl(t,e){return(Tl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Pl=function(t){function e(t){var n;xl(this,e);var r=new Gt(\"ellipsis\");return(n=_l(this,Cl(e).call(this,r,\"auto\",!1,\"top-left\"))).contentClick=t,n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Tl(t,e)}(e,Dn),jl(e,[{key:\"reset\",value:function(t){var e=this,n=t.map(function(t,n){return a(\"div\",\"\".concat(kt,\"-item\")).css(\"width\",\"150px\").css(\"font-weight\",\"normal\").on(\"click\",function(){e.contentClick(n),e.hide()}).child(t)});this.setContentChildren.apply(this,Sl(n))}},{key:\"setTitle\",value:function(){}}]),e}(),Al=[{key:\"delete\",title:U(\"contextmenu.deleteSheet\")}];function Rl(){var t=this;return Al.map(function(e){return function(t){var e=this;return a(\"div\",\"\".concat(kt,\"-item\")).child(t.title()).on(\"click\",function(){e.itemClick(t.key),e.hide()})}.call(t,e)})}var Dl=function(){function t(){var e;xl(this,t),this.el=(e=a(\"div\",\"\".concat(kt,\"-contextmenu\")).css(\"width\",\"160px\")).children.apply(e,Sl(Rl.call(this))).hide(),this.itemClick=function(){}}return jl(t,[{key:\"hide\",value:function(){var t=this.el;t.hide(),bt(t)}},{key:\"setOffset\",value:function(t){var e=this.el;e.offset(t),e.show(),gt(e)}}]),t}(),Il=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};xl(this,t),this.swapFunc=r,this.updateFunc=o,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new Pl(function(t){e.clickSwap2(e.items[t])}),this.contextMenu=new Dl,this.contextMenu.itemClick=i,this.el=a(\"div\",\"\".concat(kt,\"-bottombar\")).children(this.contextMenu.el,this.menuEl=a(\"ul\",\"\".concat(kt,\"-menu\")).child(a(\"li\",\"\").children(new Gt(\"add\").on(\"click\",function(){n()}),a(\"span\",\"\").child(this.moreEl))))}return jl(t,[{key:\"addItem\",value:function(t,e){var n=this;this.dataNames.push(t);var r=a(\"li\",e?\"active\":\"\").child(t);r.on(\"click\",function(){n.clickSwap2(r)}).on(\"contextmenu\",function(t){var e=t.target,i=e.offsetLeft,o=e.offsetHeight;n.contextMenu.setOffset({left:i,bottom:o+1}),n.deleteEl=r}).on(\"dblclick\",function(){var t=r.html(),e=new za(\"auto\",\"\");e.val(t),e.input.on(\"blur\",function(e){var r=e.target.value,i=n.dataNames.findIndex(function(e){return e===t});n.renameItem(i,r)}),r.html(\"\").child(e.el),e.focus()}),e&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:\"renameItem\",value:function(t,e){this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html(\"\").child(e),this.updateFunc(t,e)}},{key:\"clear\",value:function(){var t=this;this.items.forEach(function(e){t.menuEl.removeChild(e.el)}),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:\"deleteItem\",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var n=this.items.findIndex(function(t){return t===e});if(this.items.splice(n,1),this.dataNames.splice(n,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var r=kl(this.items,1)[0];return this.activeEl=r,this.activeEl.toggle(),[n,0]}return[n,-1]}return[-1]}},{key:\"clickSwap2\",value:function(t){var e=this.items.findIndex(function(e){return e===t});this.clickSwap(t),this.activeEl.toggle(),this.swapFunc(e)}},{key:\"clickSwap\",value:function(t){null!==this.activeEl&&this.activeEl.toggle(),this.activeEl=t}}]),t}();n(1);function zl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Hl(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function Ml(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.d(e,\"spreadsheet\",function(){return Wl});var Fl=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t);var i=e;this.options=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hl(n,!0).forEach(function(e){Ml(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hl(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({showBottomBar:!0},r),this.sheetIndex=1,this.datas=[],\"string\"==typeof e&&(i=document.querySelector(e)),this.bottombar=this.options.showBottomBar?new Il(function(){var t=n.addSheet();n.sheet.resetData(t)},function(t){var e=n.datas[t];n.sheet.resetData(e)},function(){n.deleteSheet()},function(t,e){n.datas[t].name=e}):null,this.data=this.addSheet();var o=a(\"div\",\"\".concat(kt)).on(\"contextmenu\",function(t){return t.preventDefault()});i.appendChild(o.el),this.sheet=new wl(o,this.data),null!==this.bottombar&&o.child(this.bottombar.el)}var e,n,r;return e=t,r=[{key:\"locale\",value:function(t,e){Y(t,e)}}],(n=[{key:\"addSheet\",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t||\"sheet\".concat(this.sheetIndex),i=new pt(r,this.options);return i.change=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=e.sheet).trigger.apply(t,[\"change\"].concat(r))},this.datas.push(i),null!==this.bottombar&&this.bottombar.addItem(r,n),this.sheetIndex+=1,i}},{key:\"deleteSheet\",value:function(){if(null!==this.bottombar){var t=zl(this.bottombar.deleteItem(),2),e=t[0],n=t[1];e>=0&&(this.datas.splice(e,1),n>=0&&this.sheet.resetData(this.datas[n]))}}},{key:\"loadData\",value:function(t){var e=Array.isArray(t)?t:[t];if(null!==this.bottombar&&this.bottombar.clear(),this.datas=[],e.length>0)for(var n=0;n<e.length;n+=1){var r=e[n],i=this.addSheet(r.name,0===n);i.setData(r),0===n&&this.sheet.resetData(i)}return this}},{key:\"getData\",value:function(){return this.datas.map(function(t){return t.getData()})}},{key:\"cellText\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[r].setCellText(t,e,n,\"finished\"),this}},{key:\"cell\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCell(t,e)}},{key:\"cellStyle\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCellStyle(t,e)}},{key:\"reRender\",value:function(){return this.sheet.table.render(),this}},{key:\"on\",value:function(t,e){return this.sheet.on(t,e),this}},{key:\"validate\",value:function(){return this.data.validations.errors.size<=0}},{key:\"change\",value:function(t){return this.sheet.on(\"change\",t),this}}])&&Nl(e.prototype,n),r&&Nl(e,r),t}(),Wl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Fl(t,e)};window&&(window.x_spreadsheet=Wl,window.x_spreadsheet.locale=function(t,e){return Y(t,e)});e.default=Fl}]);\n//# sourceMappingURL=xspreadsheet.js.map"
  },
  {
    "path": "docs/dist/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <title>x-spreadsheet</title>\n    \n<link href=\"xspreadsheet.css\" rel=\"stylesheet\"></head>\n<body onload=\"load()\">\n  <div id=\"x-spreadsheet-demo\"></div>\n  <script>\n    function load(){\n      // x.spreadsheet.locale('zh-cn');\n      var xs = x.spreadsheet('#x-spreadsheet-demo', {})\n        .loadData({\n          freeze: 'B3',\n          styles: [\n            {\n              bgcolor: '#f4f5f8',\n              textwrap: true,\n              color: '#900b09',\n              border: {\n                top: ['thin', '#0366d6'],\n                bottom: ['thin', '#0366d6'],\n                right: ['thin', '#0366d6'],\n                left: ['thin', '#0366d6'],\n              },\n            },\n          ],\n          merges: [\n            'C3:D4',\n          ],\n          rows: {\n            1: {\n              cells: {\n                0: { text: 'testingtesttestetst' },\n                2: { text: 'testing' },\n              },\n            },\n            2: {\n              cells: {\n                0: { text: 'render', style: 0 },\n                1: { text: 'Hello' },\n                2: { text: 'haha', merge: [1, 1] },\n              }\n            },\n            8: {\n              cells: {\n                8: { text: 'border test', style: 0 },\n              }\n            }\n          },\n        }).change((cdata) => {\n          console.log(cdata);\n          console.log(xs.validate());\n        });\n    }\n  </script>\n  <!--script type=\"text/javascript\" src=\"https://unpkg.com/x-data-spreadsheet@1.0.20/dist/locale/zh-cn.js\"></script-->\n<script type=\"text/javascript\" src=\"xspreadsheet.js\"></script></body>\n</html>\n"
  },
  {
    "path": "docs/dist/locale/de.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Rückgängig machen\",redo:\"Wiederherstellen\",paintformat:\"Format kopieren/einfügen\",clearformat:\"Format löschen\",format:\"Format\",font:\"Schriftart\",fontSize:\"Schriftgrad\",fontBold:\"Fett\",fontItalic:\"Kursiv\",underline:\"Betonen\",strike:\"Streichen\",textColor:\"Text Farbe\",fillColor:\"Füllung Farbe\",border:\"Umrandung\",merge:\"Zellen verbinden\",align:\"Waagrechte Ausrichtung\",valign:\"Vertikale uitlijning\",textwrap:\"Textumbruch\",freeze:\"Zelle sperren\",formula:\"Funktionen\",more:\"Mehr\"},contextmenu:{copy:\"Kopieren\",cut:\"Ausschneiden\",paste:\"Einfügen\",pasteValue:\"Nur Werte einfügen\",pasteFormat:\"Nur Format einfügen\",insertRow:\"Zeile einfügen\",insertColumn:\"Spalte einfügen\",deleteRow:\"Zeile löschen\",deleteColumn:\"Spalte löschen\",deleteCell:\"Zelle löschen\",deleteCellText:\"Zellentext löschen\"},format:{normal:\"Regulär\",text:\"Text\",number:\"Nummer\",percent:\"Prozent\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Termin\",datetime:\"Datum Termin\",duration:\"Dauer\"},formula:{sum:\"Summe\",average:\"Durchschnittliche\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x&&window.x.spreadsheet&&(window.x.spreadsheet.$messages=window.x.spreadsheet.$messages||{},window.x.spreadsheet.$messages.de=r),t.default=r}]);"
  },
  {
    "path": "docs/dist/locale/en.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=1)}([,function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Undo\",redo:\"Redo\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",font:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",textColor:\"Text color\",fillColor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\"},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{cancel:\"Cancel\",remove:\"Remove\",save:\"Save\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}};window&&window.x&&window.x.spreadsheet&&(window.x.spreadsheet.$messages=window.x.spreadsheet.$messages||{},window.x.spreadsheet.$messages.en=r),t.default=r}]);"
  },
  {
    "path": "docs/dist/locale/nl.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=2)}({2:function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Ongedaan maken\",redo:\"Opnieuw uitvoeren\",paintformat:\"Opmaak kopiëren/plakken\",clearformat:\"Opmaak wissen\",format:\"Opmaak\",font:\"Lettertype\",fontSize:\"Tekengrootte\",fontBold:\"Vet\",fontItalic:\"Cursief\",underline:\"Onderstrepen\",strike:\"Doorstrepen\",textColor:\"Tekstkleur\",fillColor:\"Opvulkleur\",border:\"Randen\",merge:\"Cellen samenvoegen\",align:\"Horizontale uitlijning\",valign:\"Verticale uitlijning\",textwrap:\"Terugloop\",freeze:\"Cel bevriezen\",formula:\"Functies\",more:\"Meer\"},contextmenu:{copy:\"Kopiëren\",cut:\"Knippen\",paste:\"Plakken\",pasteValue:\"Alleen waarden plakken\",pasteFormat:\"Alleen opmaak plakken\",insertRow:\"Rij invoegen\",insertColumn:\"Kolom invoegen\",deleteRow:\"Rij verwijderen\",deleteColumn:\"Kolom verwijderen\",deleteCell:\"Cel verwijderen\",deleteCellText:\"Celtekst verwijderen\"},format:{normal:\"Standaard\",text:\"Tekst\",number:\"Nummer\",percent:\"Percentage\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Tijdstip\",datetime:\"Datum tijd\",duration:\"Duratie\"},formula:{sum:\"Som\",average:\"Gemiddelde\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x&&window.x.spreadsheet&&(window.x.spreadsheet.$messages=window.x.spreadsheet.$messages||{},window.x.spreadsheet.$messages.nl=r),t.default=r}});"
  },
  {
    "path": "docs/dist/locale/zh-cn.js",
    "content": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=3)}({3:function(e,t,r){\"use strict\";r.r(t);const n={toolbar:{undo:\"撤销\",redo:\"恢复\",paintformat:\"格式刷\",clearformat:\"清除格式\",format:\"数据格式\",font:\"字体\",fontSize:\"字号\",fontBold:\"加粗\",fontItalic:\"倾斜\",underline:\"下划线\",strike:\"删除线\",textColor:\"字体颜色\",fillColor:\"填充颜色\",border:\"边框\",merge:\"合并单元格\",align:\"水平对齐\",valign:\"垂直对齐\",textwrap:\"自动换行\",freeze:\"冻结\",formula:\"函数\",more:\"更多\"},contextmenu:{copy:\"复制\",cut:\"剪切\",paste:\"粘贴\",pasteValue:\"粘贴数据\",pasteFormat:\"粘贴格式\",insertRow:\"插入行\",insertColumn:\"插入列\",deleteRow:\"删除行\",deleteColumn:\"删除列\",deleteCell:\"删除\",deleteCellText:\"删除数据\",validation:\"数据验证\"},format:{normal:\"正常\",text:\"文本\",number:\"数值\",percent:\"百分比\",rmb:\"人民币\",usd:\"美元\",date:\"短日期\",time:\"时间\",datetime:\"长日期\",duration:\"持续时间\"},formula:{sum:\"求和\",average:\"求平均值\",max:\"求最大值\",min:\"求最小值\",concat:\"字符拼接\"},validation:{required:\"此值必填\",notMatch:\"此值不匹配验证规则\",between:\"此值应在 {} 和 {} 之间\",notBetween:\"此值不应在 {} 和 {} 之间\",notIn:\"此值不在列表中\",equal:\"此值应该等于 {}\",notEqual:\"此值不应该等于 {}\",lessThan:\"此值应该小于 {}\",lessThanEqual:\"此值应该小于等于 {}\",greaterThan:\"此值应该大于 {}\",greaterThanEqual:\"此值应该大于等于 {}\"},error:{pasteForMergedCell:\"无法对合并的单元格执行此操作\"},calendar:{weeks:[\"日\",\"一\",\"二\",\"三\",\"四\",\"五\",\"六\"],months:[\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\"]},button:{cancel:\"取消\",remove:\"删除\",save:\"保存\"},dataValidation:{mode:\"模式\",range:\"单元区间\",criteria:\"条件\",modeType:{cell:\"单元格\",column:\"列模式\",row:\"行模式\"},type:{list:\"列表\",number:\"数字\",date:\"日期\",phone:\"手机号\",email:\"电子邮件\"},operator:{be:\"在区间\",nbe:\"不在区间\",lt:\"小于\",lte:\"小于等于\",gt:\"大于\",gte:\"大于等于\",eq:\"等于\",neq:\"不等于\"}}};window&&window.x&&window.x.spreadsheet&&(window.x.spreadsheet.$messages=window.x.spreadsheet.$messages||{},window.x.spreadsheet.$messages[\"zh-cn\"]=n),t.default=n}});"
  },
  {
    "path": "docs/dist/xspreadsheet.css",
    "content": "body {\n  margin: 0;\n}\n.x-spreadsheet {\n  font-size: 13px;\n  line-height: normal;\n  user-select: none;\n  -moz-user-select: none;\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  box-sizing: content-box;\n  background: #fff;\n  -webkit-font-smoothing: antialiased;\n}\n.x-spreadsheet textarea {\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n}\n.x-spreadsheet-sheet {\n  position: relative;\n  overflow: hidden;\n}\n.x-spreadsheet-table {\n  vertical-align: bottom;\n}\n.x-spreadsheet-tooltip {\n  font-family: inherit;\n  position: absolute;\n  padding: 5px 10px;\n  color: #fff;\n  border-radius: 1px;\n  background: #000000;\n  font-size: 12px;\n  z-index: 201;\n}\n.x-spreadsheet-tooltip:before {\n  pointer-events: none;\n  position: absolute;\n  left: calc(50% - 4px);\n  top: -4px;\n  content: \"\";\n  width: 8px;\n  height: 8px;\n  background: inherit;\n  -webkit-transform: rotate(45deg);\n  transform: rotate(45deg);\n  z-index: 1;\n  box-shadow: 1px 1px 3px -1px rgba(0, 0, 0, 0.3);\n}\n.x-spreadsheet-color-palette {\n  padding: 5px;\n}\n.x-spreadsheet-color-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 2;\n  background: #fff;\n}\n.x-spreadsheet-color-palette table td {\n  margin: 0;\n  cursor: pointer;\n  border: 1px solid transparent;\n}\n.x-spreadsheet-color-palette table td:hover {\n  border-color: #ddd;\n}\n.x-spreadsheet-color-palette table td .x-spreadsheet-color-palette-cell {\n  width: 16px;\n  height: 16px;\n}\n.x-spreadsheet-border-palette {\n  padding: 6px;\n}\n.x-spreadsheet-border-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 0;\n  background: #fff;\n  table-layout: fixed;\n}\n.x-spreadsheet-border-palette table td {\n  margin: 0;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left {\n  border-right: 1px solid #eee;\n  padding-right: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell {\n  width: 30px;\n  height: 30px;\n  cursor: pointer;\n  text-align: center;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell .x-spreadsheet-icon-img {\n  opacity: 0.8;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell:hover {\n  background-color: #eee;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right {\n  padding-left: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-toolbar-btn {\n  margin-top: 0;\n  margin-bottom: 3px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-line-type {\n  position: relative;\n  left: 0;\n  top: -3px;\n}\n.x-spreadsheet-dropdown {\n  position: relative;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-content {\n  position: absolute;\n  z-index: 200;\n  background: #fff;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n}\n.x-spreadsheet-dropdown.bottom-left .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  left: 0;\n}\n.x-spreadsheet-dropdown.bottom-right .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  right: 0;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-title {\n  padding: 0 5px;\n  display: inline-block;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-left {\n  margin-left: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right {\n  width: 10px;\n  margin-right: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right .arrow-down {\n  left: -130px;\n}\n/* resizer **/\n.x-spreadsheet-resizer {\n  position: absolute;\n  z-index: 11;\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-hover {\n  background-color: rgba(75, 137, 255, 0.25);\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-line {\n  position: absolute;\n}\n.x-spreadsheet-resizer.horizontal {\n  cursor: row-resize;\n}\n.x-spreadsheet-resizer.horizontal .x-spreadsheet-resizer-line {\n  border-bottom: 2px dashed #4b89ff;\n  left: 0;\n  bottom: 0;\n}\n.x-spreadsheet-resizer.vertical {\n  cursor: col-resize;\n}\n.x-spreadsheet-resizer.vertical .x-spreadsheet-resizer-line {\n  border-right: 2px dashed #4b89ff;\n  top: 0;\n  right: 0;\n}\n/* scrollbar */\n.x-spreadsheet-scrollbar {\n  position: absolute;\n  bottom: 0;\n  right: 0;\n  background-color: #f4f5f8;\n  opacity: 0.9;\n  z-index: 12;\n}\n.x-spreadsheet-scrollbar.horizontal {\n  right: 15px;\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n.x-spreadsheet-scrollbar.vertical {\n  bottom: 15px;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n/* @{css-prefix}-overlayer */\n.x-spreadsheet-overlayer {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 10;\n}\n.x-spreadsheet-overlayer .x-spreadsheet-overlayer-content {\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  width: 100%;\n  height: 100%;\n}\n.x-spreadsheet-editor,\n.x-spreadsheet-selector {\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n/* @{css-prefix}-selector */\n.x-spreadsheet-selector .x-spreadsheet-selector-area {\n  position: absolute;\n  border: 2px solid #4b89ff;\n  background: rgba(75, 137, 255, 0.1);\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard,\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  position: absolute;\n  background: transparent;\n  z-index: 100;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard {\n  border: 2px dashed #4b89ff;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  border: 1px dashed rgba(0, 0, 0, 0.45);\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-corner {\n  pointer-events: auto;\n  position: absolute;\n  cursor: crosshair;\n  font-size: 0;\n  height: 5px;\n  width: 5px;\n  right: -5px;\n  bottom: -5px;\n  border: 2px solid #ffffff;\n  background: #4b89ff;\n}\n.x-spreadsheet-editor {\n  z-index: 20;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area {\n  position: absolute;\n  text-align: left;\n  border: 2px solid #4b89ff;\n  line-height: 0;\n  z-index: 100;\n  pointer-events: auto;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area textarea {\n  box-sizing: content-box;\n  border: none;\n  padding: 0 3px;\n  outline-width: 0;\n  resize: none;\n  text-align: start;\n  overflow-y: hidden;\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n  color: inherit;\n  white-space: normal;\n  word-wrap: break-word;\n  line-height: 22px;\n  margin: 0;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area .textline {\n  overflow: hidden;\n  visibility: hidden;\n  position: fixed;\n  top: 0;\n  left: 0;\n}\n.x-spreadsheet-item {\n  user-select: none;\n  background: 0;\n  border: 1px solid transparent;\n  outline: none;\n  height: 26px;\n  color: rgba(0, 0, 0, 0.9);\n  line-height: 26px;\n  list-style: none;\n  padding: 2px 10px;\n  cursor: default;\n  text-align: left;\n}\n.x-spreadsheet-item.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-item:hover,\n.x-spreadsheet-item.active {\n  background: rgba(0, 0, 0, 0.05);\n}\n.x-spreadsheet-item.divider {\n  height: 0;\n  padding: 0;\n  margin: 5px 0;\n  border: none;\n  border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n}\n.x-spreadsheet-item .label {\n  float: right;\n  opacity: 0.65;\n  font-size: 1em;\n}\n.x-spreadsheet-item.state,\n.x-spreadsheet-header.state {\n  padding-left: 35px!important;\n  position: relative;\n}\n.x-spreadsheet-item.state:before,\n.x-spreadsheet-header.state:before {\n  content: '';\n  position: absolute;\n  width: 10px;\n  height: 10px;\n  left: 12px;\n  top: calc(50% - 5px);\n  background: rgba(0, 0, 0, 0.08);\n  border-radius: 2px;\n}\n.x-spreadsheet-item.state.checked:before,\n.x-spreadsheet-header.state.checked:before {\n  background: #4b89ff;\n}\n.x-spreadsheet-checkbox {\n  position: relative;\n  display: inline-block;\n  backface-visibility: hidden;\n  outline: 0;\n  vertical-align: baseline;\n  font-style: normal;\n  font-size: 1rem;\n  line-height: 1em;\n}\n.x-spreadsheet-checkbox > input {\n  position: absolute;\n  top: 0;\n  left: 0;\n  opacity: 0!important;\n  outline: 0;\n  z-index: -1;\n}\n.x-spreadsheet-suggest,\n.x-spreadsheet-contextmenu,\n.x-spreadsheet-sort-filter {\n  position: absolute;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n  background: #fff;\n  z-index: 100;\n  width: 260px;\n  pointer-events: auto;\n  overflow: auto;\n}\n.x-spreadsheet-suggest {\n  width: 200px;\n}\n.x-spreadsheet-filter {\n  border: 1px solid #e9e9e9;\n  font-size: 12px;\n  margin: 10px;\n}\n.x-spreadsheet-filter .x-spreadsheet-header {\n  padding: 0.5em 0.75em;\n  background: #f8f8f9;\n  border-bottom: 1px solid #e9e9e9;\n  border-left: 1px solid transparent;\n}\n.x-spreadsheet-filter .x-spreadsheet-body {\n  height: 200px;\n  overflow-y: auto;\n}\n.x-spreadsheet-filter .x-spreadsheet-body .x-spreadsheet-item {\n  height: 20px;\n  line-height: 20px;\n}\n.x-spreadsheet-sort-filter .x-spreadsheet-buttons {\n  margin: 10px;\n}\n.x-spreadsheet-toolbar,\n.x-spreadsheet-bottombar {\n  height: 40px;\n  padding: 0 30px;\n  text-align: left;\n  background: #f5f6f7;\n  display: flex;\n}\n.x-spreadsheet-bottombar {\n  border-top: 1px solid #e0e2e4;\n}\n.x-spreadsheet-toolbar {\n  border-bottom: 1px solid #e0e2e4;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btns {\n  display: inline-flex;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more {\n  padding: 0 6px 6px;\n  text-align: left;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more .x-spreadsheet-toolbar-divider {\n  margin-top: 0;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn {\n  flex: 0 0 auto;\n  display: inline-block;\n  border: 1px solid transparent;\n  height: 26px;\n  line-height: 26px;\n  min-width: 26px;\n  margin: 6px 1px 0;\n  padding: 0;\n  text-align: center;\n  border-radius: 2px;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn:hover,\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.active {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toolbar-divider {\n  display: inline-block;\n  border-right: 1px solid #e0e2e4;\n  width: 0;\n  vertical-align: middle;\n  height: 18px;\n  margin: 12px 3px 0;\n}\n.x-spreadsheet-calendar {\n  color: rgba(0, 0, 0, 0.65);\n  background: #ffffff;\n  user-select: none;\n}\n.x-spreadsheet-calendar .calendar-header {\n  font-weight: 700;\n  line-height: 30px;\n  text-align: center;\n  width: 100%;\n  float: left;\n  background: #f9fafb;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-left {\n  padding-left: 5px;\n  float: left;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right {\n  float: right;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a {\n  padding: 3px 0;\n  margin-right: 2px;\n  border-radius: 2px;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a:hover {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-calendar .calendar-body {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n.x-spreadsheet-calendar .calendar-body th,\n.x-spreadsheet-calendar .calendar-body td {\n  width: 14.28571429%;\n  min-width: 32px;\n  text-align: center;\n  font-weight: 700;\n  line-height: 30px;\n  padding: 0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell:hover {\n  background: #ecf6fd;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.active,\n.x-spreadsheet-calendar .calendar-body td > .cell.active:hover {\n  background: #ecf6fd;\n  color: #2185D0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-datepicker {\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);\n  position: absolute;\n  left: 0;\n  top: calc(100% + 5px);\n  z-index: 10;\n  width: auto;\n}\n.x-spreadsheet-buttons {\n  display: flex;\n  justify-content: flex-end;\n}\n.x-spreadsheet-buttons .x-spreadsheet-button {\n  margin-left: 8px;\n}\n.x-spreadsheet-button {\n  display: inline-block;\n  border-radius: 3px;\n  line-height: 1em;\n  min-height: 1em;\n  white-space: nowrap;\n  text-align: center;\n  cursor: pointer;\n  font-size: 1em;\n  font-weight: 700;\n  padding: 0.75em 1em;\n  color: rgba(0, 0, 0, 0.6);\n  background: #E0E1E2;\n  text-decoration: none;\n  font-family: \"Lato\", \"proxima-nova\", \"Helvetica Neue\", Arial, sans-serif;\n  outline: none;\n  vertical-align: baseline;\n  zoom: 1;\n  user-select: none;\n  transition: all 0.1s linear;\n}\n.x-spreadsheet-button.active,\n.x-spreadsheet-button:hover {\n  background-color: #C0C1C2;\n  color: rgba(0, 0, 0, 0.8);\n}\n.x-spreadsheet-button.primary {\n  color: #fff;\n  background-color: #2185D0;\n}\n.x-spreadsheet-button.primary:hover,\n.x-spreadsheet-button.primary.active {\n  color: #fff;\n  background-color: #1678c2;\n}\n.x-spreadsheet-form-input {\n  font-size: 1em;\n  position: relative;\n  font-weight: 400;\n  display: inline-flex;\n  color: rgba(0, 0, 0, 0.87);\n}\n.x-spreadsheet-form-input input {\n  z-index: 1;\n  margin: 0;\n  max-width: 100%;\n  flex: 1 0 auto;\n  outline: 0;\n  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n  text-align: left;\n  line-height: 30px;\n  height: 30px;\n  padding: 0 8px;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 3px;\n  transition: box-shadow 0.1s ease, border-color 0.1s ease;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-input input:focus {\n  border-color: #4b89ff;\n  box-shadow: inset 0 1px 2px rgba(75, 137, 255, 0.2);\n}\n.x-spreadsheet-form-select {\n  position: relative;\n  display: inline-block;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 2px;\n  cursor: pointer;\n  color: rgba(0, 0, 0, 0.87);\n  user-select: none;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-select .input-text {\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  min-width: 60px;\n  width: auto;\n  height: 30px;\n  line-height: 30px;\n  padding: 0 8px;\n}\n.x-spreadsheet-form-fields {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field {\n  flex: 0 1 auto;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field .label {\n  display: inline-block;\n  margin: 0 10px 0 0;\n}\n.x-spreadsheet-form-field {\n  display: block;\n  vertical-align: middle;\n  margin-left: 10px;\n  margin-bottom: 10px;\n}\n.x-spreadsheet-form-field:first-child {\n  margin-left: 0;\n}\n.x-spreadsheet-form-field.error .x-spreadsheet-form-select,\n.x-spreadsheet-form-field.error input {\n  border-color: #f04134;\n}\n.x-spreadsheet-form-field .tip {\n  color: #f04134;\n  font-size: 0.9em;\n}\n.x-spreadsheet-dimmer {\n  display: none;\n  position: absolute;\n  top: 0 !important;\n  left: 0 !important;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  vertical-align: middle;\n  background-color: rgba(0, 0, 0, 0.6);\n  opacity: 0;\n  -webkit-animation-fill-mode: both;\n  animation-fill-mode: both;\n  -webkit-animation-duration: 0.5s;\n  animation-duration: 0.5s;\n  transition: background-color 0.5s linear;\n  user-select: none;\n  z-index: 1000;\n}\n.x-spreadsheet-dimmer.active {\n  display: block;\n  opacity: 1;\n}\n.x-spreadsheet-modal,\n.x-spreadsheet-toast {\n  font-size: 13px;\n  position: fixed;\n  z-index: 1001;\n  text-align: left;\n  line-height: 1.25em;\n  min-width: 360px;\n  color: rgba(0, 0, 0, 0.87);\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  border-radius: 4px;\n  border: 1px solid rgba(0, 0, 0, 0.1);\n  background-color: #fff;\n  background-clip: padding-box;\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px;\n}\n.x-spreadsheet-toast {\n  background-color: rgba(255, 255, 255, 0.85);\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-toast-header {\n  font-weight: 600;\n  background-clip: padding-box;\n  background-color: rgba(255, 255, 255, 0.85);\n  border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n  border-radius: 4px 4px 0 0;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon,\n.x-spreadsheet-toast-header .x-spreadsheet-icon {\n  position: absolute;\n  right: 0.8em;\n  top: 0.65em;\n  border-radius: 18px;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon:hover,\n.x-spreadsheet-toast-header .x-spreadsheet-icon:hover {\n  opacity: 1;\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toast-header {\n  color: #F2711C;\n}\n.x-spreadsheet-modal-header {\n  border-bottom: 1px solid #e0e2e4;\n  background: rgba(0, 0, 0, 0.08);\n  font-size: 1.0785em;\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-modal-content,\n.x-spreadsheet-toast-header,\n.x-spreadsheet-toast-content {\n  padding: 0.75em 1em;\n}\n@media screen and (min-width: 320px) and (max-width: 480px) {\n  .x-spreadsheet-toolbar {\n    display: none;\n  }\n}\n.x-spreadsheet-icon {\n  width: 18px;\n  height: 18px;\n  margin: 1px 1px 2px 1px;\n  text-align: center;\n  vertical-align: middle;\n  user-select: none;\n  overflow: hidden;\n  position: relative;\n  display: inline-block;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img {\n  background-image: url(58eaeb4e52248a5c75936c6f4c33a370.svg);\n  position: absolute;\n  width: 262px;\n  height: 444px;\n  opacity: 0.56;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.undo {\n  left: 0;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.redo {\n  left: -18px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.print {\n  left: -36px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.paintformat {\n  left: -54px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.clearformat {\n  left: -72px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-bold {\n  left: -90px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-italic {\n  left: -108px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.underline {\n  left: -126px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.strike {\n  left: -144px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.color {\n  left: -162px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.bgcolor {\n  left: -180px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.merge {\n  left: -198px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-left {\n  left: -216px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-center {\n  left: -234px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-right {\n  left: 0;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-top {\n  left: -18px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-middle {\n  left: -36px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-bottom {\n  left: -54px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.textwrap {\n  left: -72px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.autofilter {\n  left: -90px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.formula {\n  left: -108px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-down {\n  left: -126px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-right {\n  left: -144px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.link {\n  left: -162px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chart {\n  left: -180px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.freeze {\n  left: -198px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.ellipsis {\n  left: -216px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.add {\n  left: -234px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-all {\n  left: 0;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-inside {\n  left: -18px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-horizontal {\n  left: -36px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-vertical {\n  left: -54px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-outside {\n  left: -72px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-left {\n  left: -90px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-top {\n  left: -108px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-right {\n  left: -126px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-bottom {\n  left: -144px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-none {\n  left: -162px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-color {\n  left: -180px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-type {\n  left: -198px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.close {\n  left: -234px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-down {\n  left: 0;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-up {\n  left: -18px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-left {\n  left: -36px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-right {\n  left: -54px;\n  top: -54px;\n}\n\n\n/*# sourceMappingURL=xspreadsheet.css.map*/"
  },
  {
    "path": "docs/dist/xspreadsheet.js",
    "content": "!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=1)}([function(t,e,n){},function(t,e,n){\"use strict\";function r(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var o=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),\"string\"==typeof e?(this.el=document.createElement(e),this.el.className=n):this.el=e,this.data={}}var e,n,o;return e=t,(n=[{key:\"data\",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:\"on\",value:function(t,e){var n=r(t.split(\".\")),i=n[0],o=n.slice(1),a=i;return\"mousewheel\"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a=\"DOMMouseScroll\"),this.el.addEventListener(a,function(t){e(t);for(var n=0;n<o.length;n+=1){var r=o[n];if(\"left\"===r&&0!==t.button)return;if(\"right\"===r&&2!==t.button)return;\"stop\"===r&&t.stopPropagation()}}),this}},{key:\"offset\",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach(function(n){e.css(n,\"\".concat(t[n],\"px\"))}),this;var n=this.el;return{top:n.offsetTop,left:n.offsetLeft,height:n.offsetHeight,width:n.offsetWidth}}},{key:\"scroll\",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:\"box\",value:function(){return this.el.getBoundingClientRect()}},{key:\"parent\",value:function(){return new t(this.el.parentNode)}},{key:\"children\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===arguments.length?this.el.childNodes:(n.forEach(function(e){return t.child(e)}),this)}},{key:\"child\",value:function(e){var n=e;return\"string\"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),this.el.appendChild(n),this}},{key:\"contains\",value:function(t){return this.el.contains(t)}},{key:\"className\",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:\"addClass\",value:function(t){return this.el.classList.add(t),this}},{key:\"hasClass\",value:function(t){return this.el.classList.contains(t)}},{key:\"removeClass\",value:function(t){return this.el.classList.remove(t),this}},{key:\"toggle\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"active\";return this.toggleClass(t)}},{key:\"toggleClass\",value:function(t){return this.el.classList.toggle(t)}},{key:\"active\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"active\";return t?this.addClass(e):this.removeClass(e),this}},{key:\"checked\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,\"checked\"),this}},{key:\"disabled\",value:function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.addClass(\"disabled\"):this.removeClass(\"disabled\"),this}},{key:\"attr\",value:function(t,e){var n=this;if(void 0!==e)this.el.setAttribute(t,e);else{if(\"string\"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach(function(e){n.el.setAttribute(e,t[e])})}return this}},{key:\"removeAttr\",value:function(t){return this.el.removeAttribute(t),this}},{key:\"html\",value:function(t){return void 0!==t?(this.el.innerHTML=t,this):this.el.innerHTML}},{key:\"val\",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:\"cssRemoveKeys\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){return t.el.style.removeProperty(e)}),this}},{key:\"css\",value:function(t,e){var n=this;return void 0===e&&\"string\"!=typeof t?(Object.keys(t).forEach(function(e){n.el.style[e]=t[e]}),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:\"computedStyle\",value:function(){return window.getComputedStyle(this.el,null)}},{key:\"show\",value:function(){return this.css(\"display\",\"block\"),this}},{key:\"hide\",value:function(){return this.css(\"display\",\"none\"),this}}])&&i(e.prototype,n),o&&i(e,o),t}(),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return new o(t,e)};function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var c=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];function s(t){for(var e=\"\",n=t;n>=c.length;)n/=c.length,n-=1,e+=c[parseInt(n,10)%c.length];var r=t%c.length;return e+=c[r]}function u(t){for(var e=0,n=0;n<t.length-1;n+=1){var r=t.charCodeAt(n)-65,i=t.length-1-n;e+=Math.pow(c.length,i)+c.length*r}return e+=t.charCodeAt(t.length-1)-65}function f(t){for(var e=\"\",n=\"\",r=0;r<t.length;r+=1)t.charAt(r)>=\"0\"&&t.charAt(r)<=\"9\"?n+=t.charAt(r):e+=t.charAt(r);return[u(e),parseInt(n,10)-1]}function h(t,e){return\"\".concat(s(t)).concat(e+1)}function y(t,e,n){var r=l(f(t),2);return h(r[0]+e,r[1]+n)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var d=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.sri=e,this.sci=n,this.eri=r,this.eci=i,this.w=o,this.h=a}var e,n,r;return e=t,r=[{key:\"valueOf\",value:function(e){var n=e.split(\":\"),r=p(f(n[0]),2),i=r[0],o=r[1],a=o,l=i;if(n.length>1){var c=p(f(n[1]),2);l=c[0],a=c[1]}return new t(o,i,a,l)}}],(n=[{key:\"set\",value:function(t,e,n,r){this.sri=t,this.sci=e,this.eri=n,this.eci=r}},{key:\"multiple\",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:\"includes\",value:function(){for(var t=0,e=0,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(1===r.length){var o=p(f(r[0]),2);e=o[0],t=o[1]}else 2===r.length&&(t=r[0],e=r[1]);var a=this.sri,l=this.sci,c=this.eri,s=this.eci;return a<=t&&t<=c&&l<=e&&e<=s}},{key:\"each\",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=n;a<=i;a+=1)if(e(a))for(var l=r;l<=o;l+=1)t(a,l)}},{key:\"contains\",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:\"within\",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:\"disjoint\",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:\"intersects\",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:\"union\",value:function(e){var n=this.sri,r=this.sci,i=this.eri,o=this.eci;return new t(e.sri<n?e.sri:n,e.sci<r?e.sci:r,e.eri>i?e.eri:i,e.eci>o?e.eci:o)}},{key:\"difference\",value:function(e){var n=[],r=function(e,r,i,o){n.push(new t(e,r,i,o))},i=this.sri,o=this.sci,a=this.eri,l=this.eci,c=e.sri-i,s=e.sci-o,u=a-e.eri,f=l-e.eci;return c>0?(r(i,o,e.sri-1,l),u>0?(r(e.eri+1,o,a,l),s>0&&r(e.sri,o,e.eri,e.sci-1),f>0&&r(e.sri,e.eci+1,e.eri,l)):(s>0&&r(e.sri,o,a,e.sci-1),f>0&&r(e.sri,e.eci+1,a,l))):u>0&&(r(e.eri+1,o,a,l),s>0&&r(i,o,e.eri,e.sci-1),f>0&&r(i,e.eci+1,e.eri,l)),s>0?(r(i,o,a,e.sci-1),f>0?(r(i,e.eri+1,a,l),c>0&&r(i,e.sci,e.sri-1,e.eci),u>0&&r(e.sri+1,e.sci,a,e.eci)):(c>0&&r(i,e.sci,e.sri-1,l),u>0&&r(e.sri+1,e.sci,a,l))):f>0&&(r(a,e.eci+1,a,l),c>0&&r(i,o,e.sri-1,e.eci),u>0&&r(e.eri+1,o,a,e.eci)),n}},{key:\"size\",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:\"toString\",value:function(){var t=this.sri,e=this.sci,n=this.eri,r=this.eci,i=h(e,t);return this.multiple()&&(i=\"\".concat(i,\":\").concat(h(r,n))),i}},{key:\"clone\",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:\"equals\",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}])&&v(e.prototype,n),r&&v(e,r),t}();function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var g=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=new d(0,0,0,0),this.ri=0,this.ci=0}var e,n,r;return e=t,(n=[{key:\"multiple\",value:function(){return this.range.multiple()}},{key:\"setIndexes\",value:function(t,e){this.ri=t,this.ci=e}},{key:\"size\",value:function(){return this.range.size()}}])&&b(e.prototype,n),r&&b(e,r),t}();var m=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0};function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var k=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.undoItems=[],this.redoItems=[]}var e,n,r;return e=t,(n=[{key:\"add\",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:\"canUndo\",value:function(){return this.undoItems.length>0}},{key:\"canRedo\",value:function(){return this.redoItems.length>0}},{key:\"undo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canUndo()&&(r.push(JSON.stringify(t)),e(JSON.parse(n.pop())))}},{key:\"redo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canRedo()&&(n.push(JSON.stringify(t)),e(JSON.parse(r.pop())))}}])&&w(e.prototype,n),r&&w(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var S=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=null,this.state=\"clear\"}var e,n,r;return e=t,(n=[{key:\"copy\",value:function(t){return this.range=t,this.state=\"copy\",this}},{key:\"cut\",value:function(t){return this.range=t,this.state=\"cut\",this}},{key:\"isCopy\",value:function(){return\"copy\"===this.state}},{key:\"isCut\",value:function(){return\"cut\"===this.state}},{key:\"isClear\",value:function(){return\"clear\"===this.state}},{key:\"clear\",value:function(){this.range=null,this.state=\"clear\"}}])&&O(e.prototype,n),r&&O(e,r),t}();function x(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function j(t,e,n){return e&&E(t.prototype,e),n&&E(t,n),t}var _=function(){function t(e,n,r){x(this,t),this.ci=e,this.operator=n,this.value=r}return j(t,[{key:\"set\",value:function(t,e){this.operator=t,this.value=e}},{key:\"includes\",value:function(t){var e=this.operator,n=this.value;return\"all\"===e||\"in\"===e&&n.includes(t)}},{key:\"vlength\",value:function(){var t=this.operator,e=this.value;return\"in\"===t?e.length:0}},{key:\"getData\",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),C=function(){function t(e,n){x(this,t),this.ci=e,this.order=n}return j(t,[{key:\"asc\",value:function(){return\"asc\"===this.order}},{key:\"desc\",value:function(){return\"desc\"===this.order}}]),t}(),T=function(){function t(){x(this,t),this.ref=null,this.filters=[],this.sort=null}return j(t,[{key:\"setData\",value:function(t){var e=t.ref,n=t.filters,r=t.sort;null!=e&&(this.ref=e,this.fitlers=n.map(function(t){return new _(t.ci,t.operator,t.value)}),r&&(this.sort=new C(r.ci,r.order)))}},{key:\"getData\",value:function(){if(this.active()){var t=this.ref,e=this.filters,n=this.sort;return{ref:t,filters:e.map(function(t){return t.getData()}),sort:n}}return{}}},{key:\"addFilter\",value:function(t,e,n){var r=this.getFilter(t);null==r?this.filters.push(new _(t,e,n)):r.set(e,n)}},{key:\"setSort\",value:function(t,e){this.sort=e?new C(t,e):null}},{key:\"includes\",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:\"getSort\",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:\"getFilter\",value:function(t){for(var e=this.filters,n=0;n<e.length;n+=1)if(e[n].ci===t)return e[n];return null}},{key:\"filteredRows\",value:function(t){var e=new Set,n=new Set;if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=this.filters,l=i+1;l<=o;l+=1)for(var c=0;c<a.length;c+=1){var s=a[c],u=t(l,s.ci),f=u?u.text:\"\";if(!s.includes(f)){e.add(l);break}n.add(l)}return{rset:e,fset:n}}},{key:\"items\",value:function(t,e){var n={};if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=i+1;a<=o;a+=1){var l=e(a,t);if(null===l||/^\\s*$/.test(l.text))n[\"\"]=(n[\"\"]||0)+1;else{var c=l.text,s=(n[c]||0)+1;n[c]=s}}return n}},{key:\"range\",value:function(){return d.valueOf(this.ref)}},{key:\"hrange\",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:\"clear\",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:\"active\",value:function(){return null!==this.ref}}]),t}();function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._=e}var e,n,r;return e=t,(n=[{key:\"forEach\",value:function(t){this._.forEach(t)}},{key:\"deleteWithin\",value:function(t){this._=this._.filter(function(e){return!e.within(t)})}},{key:\"getFirstIncludes\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"filterIntersects\",value:function(e){return new t(this._.filter(function(t){return t.intersects(e)}))}},{key:\"intersects\",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:\"union\",value:function(t){var e=t;return this._.forEach(function(t){t.intersects(e)&&(e=t.union(e))}),e}},{key:\"add\",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:\"shift\",value:function(t,e,n,r){this._.forEach(function(i){var o=i.sri,a=i.sci,l=i.eri,c=i.eci,s=i;\"row\"===t?o>=e?(s.sri+=n,s.eri+=n):o<e&&e<=l&&(s.eri+=n,r(o,a,n,0)):\"column\"===t&&(a>=e?(s.sci+=n,s.eci+=n):a<e&&e<=c&&(s.eci+=n,r(o,a,0,n)))})}},{key:\"move\",value:function(t,e,n){this._.forEach(function(r){var i=r;i.within(t)&&(i.eri+=e,i.sri+=e,i.sci+=n,i.eci+=n)})}},{key:\"setData\",value:function(t){return this._=t.map(function(t){return d.valueOf(t)}),this}},{key:\"getData\",value:function(){return this._.map(function(t){return t.toString()})}}])&&P(e.prototype,n),r&&P(e,r),t}();var R={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach(function(n){Object.keys(n).forEach(function(r){var i=n[r];\"string\"==typeof i||\"number\"==typeof i||\"boolean\"==typeof i?e[r]=i:\"function\"!=typeof i&&!Array.isArray(i)&&i instanceof Object?(e[r]=e[r]||{},t(e[r],i)):e[r]=i})}),e}.apply(void 0,[{}].concat(e))},equals:function t(e,n){var r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(var i=0;i<r.length;i+=1){var o=r[i],a=e[o],l=n[o];if(void 0===l)return!1;if(\"string\"==typeof a||\"number\"==typeof a||\"boolean\"==typeof a){if(a!==l)return!1}else if(Array.isArray(a)){if(a.length!==l.length)return!1;for(var c=0;c<a.length;c+=1)if(!t(a[c],l[c]))return!1}else if(\"function\"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,l))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=0,r=0;return Object.keys(t).forEach(function(i){n+=e(t[i],i),r+=1}),[n,r]},rangeEach:function(t,e,n){for(var r=t;r<e;r+=1)n(r)},rangeSum:function(t,e,n){for(var r=0,i=t;i<e;i+=1)r+=n(i);return r},rangeReduceIf:function(t,e,n,r,i,o){for(var a=n,l=r,c=t;c<e&&!(a>i);c+=1)a+=l=o(c);return[c,a-l,l]},deleteProperty:function(t,e){var n=t[\"\".concat(e)];return delete t[\"\".concat(e)],n}};function D(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var I=function(){function t(e){var n=e.len,r=e.height;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.height=r}var e,n,r;return e=t,(n=[{key:\"getHeight\",value:function(t){var e=this.get(t);return e&&e.height?e.height:this.height}},{key:\"setHeight\",value:function(t,e){this.getOrNew(t).height=e}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumHeight\",value:function(t,e,n){var r=this;return R.rangeSum(t,e,function(t){return n&&n.has(t)?0:r.getHeight(t)})}},{key:\"totalHeight\",value:function(){return this.sumHeight(0,this.len)}},{key:\"get\",value:function(t){return this._[t]}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:\"getCell\",value:function(t,e){var n=this.get(t);return void 0!==n&&void 0!==n.cells&&void 0!==n.cells[e]?n.cells[e]:null}},{key:\"getCellMerge\",value:function(t,e){var n=this.getCell(t,e);return n&&n.merge?n.merge:[0,0]}},{key:\"getCellOrNew\",value:function(t,e){var n=this.getOrNew(t);return n.cells[e]=n.cells[e]||{},n.cells[e]}},{key:\"setCell\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"all\",i=this.getOrNew(t);\"all\"===r?i.cells[e]=n:\"text\"===r?(i.cells[e]=i.cells[e]||{},i.cells[e].text=n.text):\"format\"===r&&(i.cells[e]=i.cells[e]||{},i.cells[e].style=n.style,n.merge&&(i.cells[e].merge=n.merge))}},{key:\"setCellText\",value:function(t,e,n){this.getCellOrNew(t,e).text=n}},{key:\"copyPaste\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=e.sri,u=e.sci,f=e.eri,h=e.eci,p=D(t.size(),2),v=p[0],d=p[1],b=D(e.size(),2),g=b[0],m=b[1],w=!0,k=0;(f<o||h<a)&&(w=!1,k=f<o?g:m);for(var O=o;O<=l;O+=1)if(this._[O])for(var S=a;S<=c;S+=1)if(this._[O].cells&&this._[O].cells[S])for(var x=s;x<=f;x+=v)for(var E=u;E<=h;E+=d){var j=x+(O-o),_=E+(S-a),C=R.cloneDeep(this._[O].cells[S]);r&&C&&C.text&&C.text.length>0&&function(){var t=C.text,e=E-u+(x-s)+2;if(w||(e-=k+1),\"=\"===t[0])C.text=t.replace(/\\w{1,3}\\d/g,function(t){var n=0,r=0;return o===s?n=e-1:r=e-1,y(t,n,r)});else{var n=/[\\\\.\\d]+$/.exec(t);if(null!==n){var r=Number(n[0])+e-1;C.text=t.substring(0,n.index)+r}}}(),this.setCell(j,_,C,n),i(j,_,C)}}},{key:\"cutPaste\",value:function(t,e){var n=this,r={};this.each(function(i){n.eachCells(i,function(o){var a=parseInt(i,10),l=parseInt(o,10);t.includes(i,o)&&(a=e.sri+(a-t.sri),l=e.sci+(l-t.sci)),r[a]=r[a]||{cells:{}},r[a].cells[l]=n._[i].cells[o]})}),this._=r}},{key:\"insert\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each(function(r,i){var o=parseInt(r,10);o>=t&&(o+=e),n[o]=i}),this._=n,this.len+=e}},{key:\"delete\",value:function(t,e){var n=e-t+1,r={};this.each(function(i,o){var a=parseInt(i,10);a<t?r[a]=o:i>e&&(r[a-n]=o)}),this._=r,this.len-=n}},{key:\"insertColumn\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.each(function(r,i){var o={};e.eachCells(r,function(e,r){var i=parseInt(e,10);i>=t&&(i+=n),o[i]=r}),i.cells=o})}},{key:\"deleteColumn\",value:function(t,e){var n=this,r=e-t+1;this.each(function(i,o){var a={};n.eachCells(i,function(n,i){var o=parseInt(n,10);o<t?a[o]=i:o>e&&(a[o-r]=i)}),o.cells=a})}},{key:\"deleteCells\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"all\";t.each(function(t,r){e.deleteCell(t,r,n)})}},{key:\"deleteCell\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"all\",r=this.get(t);if(null!==r){var i=this.getCell(t,e);null!==i&&(\"all\"===n?delete r.cells[e]:\"text\"===n?(i.text&&delete i.text,i.value&&delete i.value):\"format\"===n?(void 0!==i.style&&delete i.style,i.merge&&delete i.merge):\"merge\"===n&&i.merge&&delete i.merge)}}},{key:\"each\",value:function(t){Object.entries(this._).forEach(function(e){var n=D(e,2),r=n[0],i=n[1];t(r,i)})}},{key:\"eachCells\",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach(function(t){var n=D(t,2),r=n[0],i=n[1];e(r,i)})}},{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}}])&&z(e.prototype,n),r&&z(e,r),t}();function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=e.len,r=e.width,i=e.indexWidth,o=e.minWidth;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.width=r,this.indexWidth=i,this.minWidth=o}var e,n,r;return e=t,(n=[{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:\"getWidth\",value:function(t){var e=this._[t];return e&&e.width?e.width:this.width}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:\"setWidth\",value:function(t,e){this.getOrNew(t).width=e}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumWidth\",value:function(t,e){var n=this;return R.rangeSum(t,e,function(t){return n.getWidth(t)})}},{key:\"totalWidth\",value:function(){return this.sumWidth(0,this.len)}}])&&M(e.prototype,n),r&&M(e,r),t}(),F=\"en\",H={en:{toolbar:{undo:\"Undo\",redo:\"Redo\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",fontName:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",color:\"Text color\",bgcolor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",autofilter:\"Filter\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\"},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{cancel:\"Cancel\",remove:\"Remove\",save:\"Save\",ok:\"OK\"},sort:{desc:\"Sort Z -> A\",asc:\"Sort A -> Z\"},filter:{empty:\"empty\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}}};function N(t,e){if(e&&e[F])for(var n=e[F],r=t.split(\".\"),i=0;i<r.length;i+=1){var o=n[r[i]];if(i===r.length-1)return o;if(!o)return;n=o}}function V(t){var e=N(t,H);return!e&&window&&window.x&&window.x.spreadsheet&&window.x.spreadsheet.$messages&&(e=N(t,window.x.spreadsheet.$messages)),e||\"\"}function q(t){return function(){return V(t)}}function B(t,e){F=t,e&&(H[t]=e)}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function U(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Y={phone:/^[1-9]\\d{10}$/,email:/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/};function $(t,e){var n=\"\";if(!t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n=V.apply(void 0,[\"validation.\".concat(e)].concat(i))}return[t,n]}var X=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.required=n,this.value=r,this.type=e,this.operator=i,this.message=\"\"}var e,n,r;return e=t,(n=[{key:\"parseValue\",value:function(t){var e=this.type;return\"date\"===e?new Date(t):\"number\"===e?Number(t):t}},{key:\"equals\",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?R.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:\"values\",value:function(){return this.value.split(\",\")}},{key:\"validate\",value:function(t){var e=this.required,n=this.operator,r=this.value,i=this.type;if(e&&/^\\s*$/.test(t))return $(!1,\"required\");if(/^\\s*$/.test(t))return[!0];if(Y[i]&&!Y[i].test(t))return $(!1,\"notMatch\");if(\"list\"===i)return $(this.values().includes(t),\"notIn\");if(n){var o=this.parseValue(t);if(\"be\"===n){var a=L(r,2),l=a[0],c=a[1];return $(o>=this.parseValue(l)&&o<=this.parseValue(c),\"between\",l,c)}if(\"nbe\"===n){var s=L(r,2),u=s[0],f=s[1];return $(o<this.parseValue(u)||o>this.parseValue(f),\"notBetween\",u,f)}if(\"eq\"===n)return $(o===this.parseValue(r),\"equal\",r);if(\"neq\"===n)return $(o!==this.parseValue(r),\"notEqual\",r);if(\"lt\"===n)return $(o<this.parseValue(r),\"lessThan\",r);if(\"lte\"===n)return $(o<=this.parseValue(r),\"lessThanEqual\",r);if(\"gt\"===n)return $(o>this.parseValue(r),\"greaterThan\",r);if(\"gte\"===n)return $(o>=this.parseValue(r),\"greaterThanEqual\",r)}return[!0]}}])&&U(e.prototype,n),r&&U(e,r),t}();function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function J(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function G(t,e,n){return e&&Z(t.prototype,e),n&&Z(t,n),t}var Q=function(){function t(e,n,r){J(this,t),this.refs=n,this.mode=e,this.validator=r}return G(t,[{key:\"includes\",value:function(t,e){for(var n=this.refs,r=0;r<n.length;r+=1){if(d.valueOf(n[r]).includes(t,e))return!0}return!1}},{key:\"addRef\",value:function(t){this.remove(d.valueOf(t)),this.refs.push(t)}},{key:\"remove\",value:function(t){var e=[];this.refs.forEach(function(n){var r=d.valueOf(n);r.intersects(t)?r.difference(t).forEach(function(t){return e.push(t.toString())}):e.push(n)}),this.refs=e}},{key:\"getData\",value:function(){var t=this.refs,e=this.mode,n=this.validator;return{refs:t,mode:e,type:n.type,required:n.required,operator:n.operator,value:n.value}}}],[{key:\"valueOf\",value:function(e){var n=e.refs,r=e.mode,i=e.type,o=e.required,a=e.operator,l=e.value;return new t(r,n,new X(i,o,l,a))}}]),t}(),tt=function(){function t(){J(this,t),this._=[],this.errors=new Map}return G(t,[{key:\"getError\",value:function(t,e){return this.errors.get(\"\".concat(t,\"_\").concat(e))}},{key:\"validate\",value:function(t,e,n){var r=this.get(t,e),i=\"\".concat(t,\"_\").concat(e),o=this.errors;if(null!==r){var a=K(r.validator.validate(n),2),l=a[0],c=a[1];l?o.delete(i):o.set(i,c)}else o.delete(i);return!0}},{key:\"add\",value:function(t,e,n){var r=n.type,i=n.required,o=n.value,a=n.operator,l=new X(r,i,o,a),c=this.getByValidator(l);null!==c?c.addRef(e):this._.push(new Q(t,[e],l))}},{key:\"getByValidator\",value:function(t){for(var e=0;e<this._.length;e+=1){var n=this._[e];if(n.validator.equals(t))return n}return null}},{key:\"get\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"remove\",value:function(t){this.each(function(e){e.remove(t)})}},{key:\"each\",value:function(t){this._.forEach(function(e){return t(e)})}},{key:\"getData\",value:function(){return this._.filter(function(t){return t.refs.length>0}).map(function(t){return t.getData()})}},{key:\"setData\",value:function(t){this._=t.map(function(t){return Q.valueOf(t)})}}]),t}();function et(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var it={view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showGrid:!0,showToolbar:!0,showContextmenu:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{bgcolor:\"#ffffff\",align:\"left\",valign:\"middle\",textwrap:!1,strike:!1,underline:!1,color:\"#0a0a0a\",font:{name:\"Arial\",size:10,bold:!1,italic:!1}}};function ot(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.merges,i=e.clone(),o=rt(t.size(),2),a=o[0],l=o[1],c=rt(e.size(),2),s=c[0],u=c[1];return a>s&&(i.eri=e.sri+a-1),l>u&&(i.eci=e.sci+l-1),!r.intersects(i)||(n(V(\"error.pasteForMergedCell\")),!1)}function at(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.rows,o=this.merges;\"all\"!==n&&\"format\"!==n||(i.deleteCells(e,n),o.deleteWithin(e)),i.copyPaste(t,e,n,r,function(t,e,n){if(n&&n.merge){var r=rt(n.merge,2),i=r[0],a=r[1];if(i<=0&&a<=0)return;o.add(new d(t,e,t+i,e+a))}})}function lt(t,e,n){var r=this.styles,i=this.rows.getCellOrNew(t,e),o={};void 0!==i.style&&(o=R.cloneDeep(r[i.style])),Object.assign(o,{border:n}),i.style=this.addStyle(o)}var ct=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.settings=R.merge(it,n||{}),this.name=e||\"sheet\",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new I(this.settings.row),this.cols=new W(this.settings.col),this.validations=new tt,this.hyperlinks={},this.comments={},this.selector=new g,this.scroll=new m,this.history=new k,this.clipboard=new S,this.autoFilter=new T,this.change=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map}var e,n,r;return e=t,(n=[{key:\"addValidation\",value:function(t,e,n){var r=this;this.changeData(function(){r.validations.add(t,e,n)})}},{key:\"removeValidation\",value:function(){var t=this,e=this.selector.range;this.changeData(function(){t.validations.remove(e)})}},{key:\"getSelectedValidator\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=this.validations.get(e,n);return r?r.validator:null}},{key:\"getSelectedValidation\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=t.range,i=this.validations.get(e,n),o={ref:r.toString()};return null!==i&&(o.mode=i.mode,o.validator=i.validator),o}},{key:\"canUndo\",value:function(){return this.history.canUndo()}},{key:\"canRedo\",value:function(){return this.history.canRedo()}},{key:\"undo\",value:function(){var t=this;this.history.undo(this.getData(),function(e){t.setData(e)})}},{key:\"redo\",value:function(){var t=this;this.history.redo(this.getData(),function(e){t.setData(e)})}},{key:\"copy\",value:function(){this.clipboard.copy(this.selector.range)}},{key:\"cut\",value:function(){this.clipboard.cut(this.selector.range)}},{key:\"paste\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=this.clipboard,i=this.selector;return!r.isClear()&&(!!ot.call(this,r.range,i.range,n)&&(this.changeData(function(){r.isCopy()?at.call(t,r.range,i.range,e):r.isCut()&&function(t,e){var n=this.clipboard,r=this.rows,i=this.merges;r.cutPaste(t,e),i.move(t,e.sri-t.sri,e.sci-t.sci),n.clear()}.call(t,r.range,i.range)}),!0))}},{key:\"autofill\",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=this.selector.range;return!!ot.call(this,i,t,r)&&(this.changeData(function(){at.call(n,i,t,e,!0)}),!0)}},{key:\"clearClipboard\",value:function(){this.clipboard.clear()}},{key:\"calSelectedRangeByEnd\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges,a=n.range,l=a.sri,c=a.sci,s=a.eri,u=a.eci,f=n.ri,h=n.ci,y=t,p=e;return t<0&&(y=r.len-1),e<0&&(p=i.len-1),y>f?(l=f,s=y):(l=y,s=f),p>h?(c=h,u=p):(c=p,u=h),n.range=o.union(new d(l,c,s,u)),n.range=o.union(n.range),n.range}},{key:\"calSelectedRangeByStart\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new d(t,e,t,e),-1===t&&(o.sri=0,o.eri=r.len-1),-1===e&&(o.sci=0,o.eci=i.len-1)),n.range=o,o}},{key:\"setSelectedCellAttr\",value:function(t,e){var n=this;this.changeData(function(){var r=n.selector,i=n.styles,o=n.rows;if(\"merge\"===t)e?n.merge():n.unmerge();else if(\"border\"===t)(function(t){var e=this,n=t.mode,r=t.style,i=t.color,o=this.styles,a=this.selector,l=this.rows,c=a.range,s=c.sri,u=c.sci,f=c.eri,h=c.eci,y=!this.isSignleSelected();if(y||\"inside\"!==n&&\"horizontal\"!==n&&\"vertical\"!==n)if(\"outside\"!==n||y){if(\"none\"===n)a.range.each(function(t,n){var r=l.getCell(t,n);if(r&&void 0!==r.style){var i=R.cloneDeep(o[r.style]);delete i.border,r.style=e.addStyle(i)}});else if(\"all\"===n||\"inside\"===n||\"outside\"===n||\"horizontal\"===n||\"vertical\"===n)!function(){for(var t=[],o=s;o<=f;o+=1)for(var a=u;a<=h;a+=1){for(var c=[],p=0;p<t.length;p+=1){var v=rt(t[p],4),d=v[0],b=v[1],g=v[2],m=v[3];if(o===d+g+1&&c.push(p),d<=o&&o<=d+g&&a===b){a+=m+1;break}}if(c.forEach(function(e){return t.splice(e,1)}),a>h)break;var w=l.getCell(o,a),k=0,O=0;if(w&&w.merge){var S=rt(w.merge,2);k=S[0],O=S[1],t.push([o,a,k,O])}var x=k>0&&o+k===f,E=O>0&&a+O===h,j={};\"all\"===n?j={bottom:[r,i],top:[r,i],left:[r,i],right:[r,i]}:\"inside\"===n?(!E&&a<h&&(j.right=[r,i]),!x&&o<f&&(j.bottom=[r,i])):\"horizontal\"===n?!x&&o<f&&(j.bottom=[r,i]):\"vertical\"===n?!E&&a<h&&(j.right=[r,i]):\"outside\"===n&&y&&(s===o&&(j.top=[r,i]),(x||f===o)&&(j.bottom=[r,i]),u===a&&(j.left=[r,i]),(E||h===a)&&(j.right=[r,i])),Object.keys(j).length>0&&lt.call(e,o,a,j),a+=O}}();else if(\"top\"===n||\"bottom\"===n)for(var p=u;p<=h;p+=1)\"top\"===n&&(lt.call(this,s,p,{top:[r,i]}),p+=l.getCellMerge(s,p)[1]),\"bottom\"===n&&(lt.call(this,f,p,{bottom:[r,i]}),p+=l.getCellMerge(f,p)[1]);else if(\"left\"===n||\"right\"===n)for(var v=s;v<=f;v+=1)\"left\"===n&&(lt.call(this,v,u,{left:[r,i]}),v+=l.getCellMerge(v,u)[0]),\"right\"===n&&(lt.call(this,v,h,{right:[r,i]}),v+=l.getCellMerge(v,h)[0])}else lt.call(this,s,u,{top:[r,i],bottom:[r,i],left:[r,i],right:[r,i]})}).call(n,e);else if(\"formula\"===t){var a=r.ri,l=r.ci,c=r.range;if(r.multiple()){var s=rt(r.size(),2),u=s[0],f=s[1],y=c.sri,p=c.sci,v=c.eri,d=c.eci;if(u>1)for(var b=p;b<=d;b+=1){o.getCellOrNew(v+1,b).text=\"=\".concat(e,\"(\").concat(h(b,y),\":\").concat(h(b,v),\")\")}else if(f>1){o.getCellOrNew(a,d+1).text=\"=\".concat(e,\"(\").concat(h(p,a),\":\").concat(h(d,a),\")\")}}else{o.getCellOrNew(a,l).text=\"=\".concat(e,\"()\")}}else r.range.each(function(r,a){var l=o.getCellOrNew(r,a),c={};if(void 0!==l.style&&(c=R.cloneDeep(i[l.style])),\"format\"===t)c.format=e,l.style=n.addStyle(c);else if(\"font-bold\"===t||\"font-italic\"===t||\"font-name\"===t||\"font-size\"===t){var s={};s[t.split(\"-\")[1]]=e,c.font=Object.assign(c.font||{},s),l.style=n.addStyle(c)}else\"strike\"!==t&&\"textwrap\"!==t&&\"underline\"!==t&&\"align\"!==t&&\"valign\"!==t&&\"color\"!==t&&\"bgcolor\"!==t||(c[t]=e,l.style=n.addStyle(c))})})}},{key:\"setSelectedCellText\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"input\",n=this.autoFilter,r=this.selector,i=this.rows,o=r.ri,a=r.ci,l=o;this.unsortedRowMap.has(o)&&(l=this.unsortedRowMap.get(o));var c=i.getCell(l,a),s=c?c.text:\"\";if(this.setCellText(l,a,t,e),n.active()){var u=n.getFilter(a);if(u){var f=u.value.findIndex(function(t){return t===s});f>=0&&u.value.splice(f,1,t)}}}},{key:\"getSelectedCell\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=e;return this.unsortedRowMap.has(e)&&(r=this.unsortedRowMap.get(e)),this.rows.getCell(r,n)}},{key:\"xyInSelectedRect\",value:function(t,e){var n=this.getSelectedRect(),r=n.left,i=n.top,o=n.width,a=n.height,l=t-this.cols.indexWidth,c=e-this.rows.height;return l>r&&l<r+o&&c>i&&c<i+a}},{key:\"getSelectedRect\",value:function(){return this.getRect(this.selector.range)}},{key:\"getClipboardRect\",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:\"getRect\",value:function(t){var e=this.scroll,n=this.rows,r=this.cols,i=this.exceptRowSet,o=t.sri,a=t.sci,l=t.eri,c=t.eci;if(o<0&&a<0)return{left:0,l:0,top:0,t:0,scroll:e};var s=r.sumWidth(0,a),u=n.sumHeight(0,o,i),f=n.sumHeight(o,l+1,i),h=r.sumWidth(a,c+1),y=s-e.x,p=u-e.y,v=this.freezeTotalHeight(),d=this.freezeTotalWidth();return d>0&&d>s&&(y=s),v>0&&v>u&&(p=u),{l:s,t:u,left:y,top:p,height:f,width:h,scroll:e}}},{key:\"getCellRectByXY\",value:function(t,e){var n=this.scroll,r=this.merges,i=this.rows,o=this.cols,a=function(t,e){var n=this.rows,r=this.freezeTotalHeight(),i=n.height;r+n.height<t&&(i-=e);for(var o=this.exceptRowSet,a=0,l=i,c=n.height;a<n.len&&!(l>t);a+=1)o.has(a)||(l+=c=n.getHeight(a));return(l-=c)<=0?{ri:-1,top:0,height:c}:{ri:a-1,top:l,height:c}}.call(this,e,n.y),l=a.ri,c=a.top,s=a.height,u=function(t,e){var n=this.cols,r=this.freezeTotalWidth(),i=n.indexWidth;r+n.indexWidth<t&&(i-=e);var o=rt(R.rangeReduceIf(0,n.len,i,n.indexWidth,t,function(t){return n.getWidth(t)}),3),a=o[0],l=o[1],c=o[2];return l<=0?{ci:-1,left:0,width:n.indexWidth}:{ci:a-1,left:l,width:c}}.call(this,t,n.x),f=u.ci,h=u.left,y=u.width;if(-1===f&&(y=o.totalWidth()),-1===l&&(s=i.totalHeight()),l>=0||f>=0){var p=r.getFirstIncludes(l,f);if(p){l=p.sri,f=p.sci;var v=this.cellRect(l,f);h=v.left,c=v.top,y=v.width,s=v.height}}return{ri:l,ci:f,left:h,top:c,width:y,height:s}}},{key:\"isSignleSelected\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=rt(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!this.selector.multiple()}},{key:\"canUnmerge\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=rt(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!1}},{key:\"merge\",value:function(){var t=this,e=this.selector,n=this.rows;if(!this.isSignleSelected()){var r=rt(e.size(),2),i=r[0],o=r[1];if(i>1||o>1){var a=e.range,l=a.sri,c=a.sci;this.changeData(function(){var r=n.getCellOrNew(l,c);r.merge=[i-1,o-1],t.merges.add(e.range),t.rows.deleteCells(e.range),t.rows.setCell(l,c,r)})}}}},{key:\"unmerge\",value:function(){var t=this,e=this.selector;if(this.isSignleSelected()){var n=e.range,r=n.sri,i=n.sci;this.changeData(function(){t.rows.deleteCell(r,i,\"merge\"),t.merges.deleteWithin(e.range)})}}},{key:\"canAutofilter\",value:function(){return!this.autoFilter.active()}},{key:\"autofilter\",value:function(){var t=this,e=this.autoFilter,n=this.selector;this.changeData(function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=n.range.toString()})}},{key:\"setAutoFilter\",value:function(t,e,n,r){var i=this.autoFilter;i.addFilter(t,n,r),i.setSort(t,e),this.resetAutoFilter()}},{key:\"resetAutoFilter\",value:function(){var t=this,e=this.autoFilter,n=this.rows;if(e.active()){var r=e.sort,i=e.filteredRows(function(t,e){return n.getCell(t,e)}),o=i.rset,a=i.fset,l=Array.from(a),c=Array.from(a);r&&l.sort(function(t,e){return\"asc\"===r.order?t-e:\"desc\"===r.order?e-t:0}),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach(function(e,n){t.sortedRowMap.set(c[n],e),t.unsortedRowMap.set(e,c[n])})}}},{key:\"deleteCell\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=this.selector;this.changeData(function(){t.rows.deleteCells(n.range,e),\"all\"!==e&&\"format\"!==e||t.merges.deleteWithin(n.range)})}},{key:\"insert\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData(function(){var r=e.selector.range,i=r.sri,o=r.sci,a=e.rows,l=e.merges,c=e.cols,s=i;\"row\"===t?a.insert(i,n):\"column\"===t&&(a.insertColumn(o,n),s=o,c.len+=1),l.shift(t,s,n,function(t,e,n,r){var i=a.getCell(t,e);i.merge[0]+=n,i.merge[1]+=r})})}},{key:\"delete\",value:function(t){var e=this;this.changeData(function(){var n=e.rows,r=e.merges,i=e.selector,o=e.cols,a=i.range,l=i.range,c=l.sri,s=l.sci,u=l.eri,f=l.eci,h=rt(i.range.size(),2),y=h[0],p=h[1],v=c,d=y;\"row\"===t?n.delete(c,u):\"column\"===t&&(n.deleteColumn(s,f),v=a.sci,d=p,o.len-=1),r.shift(t,v,-d,function(t,e,r,i){var o=n.getCell(t,e);o.merge[0]+=r,o.merge[1]+=i,0===o.merge[0]&&0===o.merge[1]&&delete o.merge})})}},{key:\"scrollx\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.cols,o=rt(r,2)[1],a=rt(R.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getWidth(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.x!==u&&(n.ci=t>0?l:0,n.x=u,e())}},{key:\"scrolly\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.rows,o=rt(r,1)[0],a=rt(R.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getHeight(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.y!==u&&(n.ri=t>0?l:0,n.y=u,e())}},{key:\"cellRect\",value:function(t,e){var n=this.rows,r=this.cols,i=r.sumWidth(0,e),o=n.sumHeight(0,t),a=n.getCell(t,e),l=r.getWidth(e),c=n.getHeight(t);if(null!==a&&a.merge){var s=rt(a.merge,2),u=s[0],f=s[1];if(u>0)for(var h=1;h<=u;h+=1)c+=n.getHeight(t+h);if(f>0)for(var y=1;y<=f;y+=1)l+=r.getWidth(e+y)}return{left:i,top:o,width:l,height:c,cell:a}}},{key:\"getCell\",value:function(t,e){return this.rows.getCell(t,e)}},{key:\"getCellTextOrDefault\",value:function(t,e){var n=this.getCell(t,e);return n&&n.text?n.text:\"\"}},{key:\"getCellStyle\",value:function(t,e){var n=this.getCell(t,e);return n&&void 0!==n.style?this.styles[n.style]:null}},{key:\"getCellStyleOrDefault\",value:function(t,e){var n=this.styles,r=this.rows.getCell(t,e),i=r&&void 0!==r.style?n[r.style]:{};return R.merge(this.defaultStyle(),i)}},{key:\"getSelectedCellStyle\",value:function(){var t=this.selector,e=t.ri,n=t.ci;return this.getCellStyleOrDefault(e,n)}},{key:\"setCellText\",value:function(t,e,n,r){var i=this.rows,o=this.history,a=this.validations;\"finished\"===r?(i.setCellText(t,e,\"\"),o.add(this.getData()),i.setCellText(t,e,n)):(i.setCellText(t,e,n),this.change(this.getData())),a.validate(t,e,n)}},{key:\"freezeIsActive\",value:function(){var t=rt(this.freeze,2),e=t[0],n=t[1];return e>0||n>0}},{key:\"setFreeze\",value:function(t,e){var n=this;this.changeData(function(){n.freeze=[t,e]})}},{key:\"freezeTotalWidth\",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:\"freezeTotalHeight\",value:function(){return this.rows.sumHeight(0,this.freeze[0])}},{key:\"setRowHeight\",value:function(t,e){var n=this;this.changeData(function(){n.rows.setHeight(t,e)})}},{key:\"setColWidth\",value:function(t,e){var n=this;this.changeData(function(){n.cols.setWidth(t,e)})}},{key:\"viewHeight\",value:function(){var t=this.settings,e=t.view,n=t.showToolbar,r=e.height();return n&&(r-=41),r}},{key:\"viewWidth\",value:function(){return this.settings.view.width()}},{key:\"freezeViewRange\",value:function(){var t=rt(this.freeze,2),e=t[0],n=t[1];return new d(0,0,e-1,n-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:\"exceptRowTotalHeight\",value:function(t,e){var n=this.exceptRowSet,r=this.rows,i=Array.from(n),o=0;return i.forEach(function(n){if(n<t||n>e){var i=r.getHeight(n);o+=i}}),o}},{key:\"viewRange\",value:function(){var t=this.scroll,e=this.rows,n=this.cols,r=this.freeze,i=this.exceptRowSet,o=t.ri,a=t.ci;o<=0&&(o=rt(r,1)[0]);a<=0&&(a=rt(r,2)[1]);for(var l=0,c=0,s=[e.len,n.len],u=s[0],f=s[1],h=o;h<e.len&&(i.has(h)||(c+=e.getHeight(h),u=h),!(c>this.viewHeight()));h+=1);for(var y=a;y<n.len&&(f=y,!((l+=n.getWidth(y))>this.viewWidth()));y+=1);return new d(o,a,u,f,l,c)}},{key:\"eachMergesInView\",value:function(t,e){this.merges.filterIntersects(t).forEach(function(t){return e(t)})}},{key:\"rowEach\",value:function(t,e,n){for(var r=0,i=this.rows,o=this.exceptRowSet,a=et(o),l=0,c=0;c<a.length;c+=1)a[c]<t&&(l+=1);for(var s=t+l;s<=e+l;s+=1)if(o.has(s))l+=1;else{var u=i.getHeight(s);if(n(s,r,u),(r+=u)>this.viewHeight())break}}},{key:\"colEach\",value:function(t,e,n){for(var r=0,i=this.cols,o=t;o<=e;o+=1){var a=i.getWidth(o);if(n(o,r,a),(r+=a)>this.viewWidth())break}}},{key:\"defaultStyle\",value:function(){return this.settings.style}},{key:\"addStyle\",value:function(t){for(var e=this.styles,n=0;n<e.length;n+=1){var r=e[n];if(R.equals(r,t))return n}return e.push(t),e.length-1}},{key:\"changeData\",value:function(t){this.history.add(this.getData()),t(),this.change(this.getData())}},{key:\"setData\",value:function(t){var e=this;return Object.keys(t).forEach(function(n){if(\"merges\"===n||\"rows\"===n||\"cols\"===n||\"validations\"===n)e[n].setData(t[n]);else if(\"freeze\"===n){var r=rt(f(t[n]),2),i=r[0],o=r[1];e.freeze=[o,i]}else void 0!==t[n]&&(e[n]=t[n])}),this}},{key:\"getData\",value:function(){var t=this.name,e=this.freeze,n=this.styles,r=this.merges,i=this.rows,o=this.cols,a=this.validations,l=this.autoFilter;return{name:t,freeze:h(e[1],e[0]),styles:n,merges:r.getData(),rows:i.getData(),cols:o.getData(),validations:a.getData(),autofilter:l.getData()}}}])&&nt(e.prototype,n),r&&nt(e,r),t}();function st(t,e,n){t.addEventListener(e,n)}function ut(t,e,n){t.removeEventListener(e,n)}function ft(t){t.xclickoutside&&(ut(window.document.body,\"click\",t.xclickoutside),delete t.xclickoutside)}function ht(t,e){t.xclickoutside=function(n){2===n.detail||t.contains(n.target)||(e?e(t):(t.hide(),ft(t)))},st(window.document.body,\"click\",t.xclickoutside)}function yt(t,e,n){st(t,\"mousemove\",e),t.xEvtUp=function(r){ut(t,\"mousemove\",e),ut(t,\"mouseup\",t.xEvtUp),n(r)},st(t,\"mouseup\",t.xEvtUp)}function pt(t,e,n,r){Math.abs(t)>Math.abs(e)?r(t>0?\"right\":\"left\",t,n):r(e>0?\"down\":\"up\",e,n)}var vt=\"x-spreadsheet\";window.devicePixelRatio;function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var bt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.moving=!1,this.vertical=n,this.el=a(\"div\",\"\".concat(vt,\"-resizer \").concat(n?\"vertical\":\"horizontal\")).children(this.hoverEl=a(\"div\",\"\".concat(vt,\"-resizer-hover\")).on(\"mousedown.stop\",function(t){return e.mousedownHandler(t)}),this.lineEl=a(\"div\",\"\".concat(vt,\"-resizer-line\")).hide()).hide(),this.cRect=null,this.finishedFn=null,this.minDistance=r}var e,n,r;return e=t,(n=[{key:\"show\",value:function(t,e){var n=this.moving,r=this.vertical,i=this.hoverEl,o=this.lineEl,a=this.el;if(!n){this.cRect=t;var l=t.left,c=t.top,s=t.width,u=t.height;a.offset({left:r?l+s-5:l,top:r?c:c+u-5}).show(),i.offset({width:r?5:s,height:r?u:5}),o.offset({width:r?0:e.width,height:r?e.height:0})}}},{key:\"hide\",value:function(){this.el.offset({left:0,top:0}).hide()}},{key:\"mousedownHandler\",value:function(t){var e=this,n=t,r=this.el,i=this.lineEl,o=this.cRect,a=this.vertical,l=this.minDistance,c=a?o.width:o.height;i.show(),yt(window,function(t){e.moving=!0,null!==n&&1===t.buttons&&(a?(c+=t.movementX)>l&&r.css(\"left\",\"\".concat(o.left+c,\"px\")):(c+=t.movementY)>l&&r.css(\"top\",\"\".concat(o.top+c,\"px\")),n=t)},function(){n=null,i.hide(),e.moving=!1,e.hide(),e.finishedFn&&(c<l&&(c=l),e.finishedFn(o,c))})}}])&&dt(e.prototype,n),r&&dt(e,r),t}();function gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var mt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vertical=e,this.moveFn=null,this.el=a(\"div\",\"\".concat(vt,\"-scrollbar \").concat(e?\"vertical\":\"horizontal\")).child(this.contentEl=a(\"div\",\"\")).on(\"mousemove.stop\",function(){}).on(\"scroll.stop\",function(t){var e=t.target,r=e.scrollTop,i=e.scrollLeft;n.moveFn&&n.moveFn(n.vertical?r:i,t)})}var e,n,r;return e=t,(n=[{key:\"move\",value:function(t){return this.el.scroll(t),this}},{key:\"scroll\",value:function(){return this.el.scroll()}},{key:\"set\",value:function(t,e){var n=t-1;if(e>n){var r=this.vertical?\"height\":\"width\";this.el.css(r,\"\".concat(n-15,\"px\")).show(),this.contentEl.css(this.vertical?\"width\":\"height\",\"1px\").css(r,\"\".concat(e,\"px\"))}else this.el.hide();return this}}])&&gt(e.prototype,n),r&&gt(e,r),t}();function wt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ot(t,e,n){return e&&kt(t.prototype,e),n&&kt(t,n),t}var St=10,xt=function(){function t(){wt(this,t),this.cornerEl=a(\"div\",\"\".concat(vt,\"-selector-corner\")),this.areaEl=a(\"div\",\"\".concat(vt,\"-selector-area\")).child(this.cornerEl).hide(),this.clipboardEl=a(\"div\",\"\".concat(vt,\"-selector-clipboard\")).hide(),this.autofillEl=a(\"div\",\"\".concat(vt,\"-selector-autofill\")).hide(),this.el=a(\"div\",\"\".concat(vt,\"-selector\")).css(\"z-index\",\"\".concat(St)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),St+=1}return Ot(t,[{key:\"setOffset\",value:function(t){return this.el.offset(t).show(),this}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"setAreaOffset\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.areaEl.offset({width:r-3+.8,height:i-3+.8,left:e-.8,top:n-.8}).show()}},{key:\"setClipboardOffset\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.clipboardEl.offset({left:e,top:n,width:r-5,height:i-5})}},{key:\"showAutofill\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.autofillEl.offset({width:r-3,height:i-3,left:e,top:n}).show()}},{key:\"hideAutofill\",value:function(){this.autofillEl.hide()}},{key:\"showClipboard\",value:function(){this.clipboardEl.show()}},{key:\"hideClipboard\",value:function(){this.clipboardEl.hide()}}]),t}();function Et(t){var e=this.data,n=t.left,r=t.top,i=t.width,o=t.height,a=t.scroll,l=t.l,c=t.t,s=e.freezeTotalWidth(),u=e.freezeTotalHeight(),f=n-s;s>l&&(f-=a.x);var h=r-u;return u>c&&(h-=a.y),{left:f,top:h,width:i,height:o}}function jt(t){var e=this.data,n=t.left,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalWidth(),s=n-c;return c>o&&(s-=l.x),{left:s,top:a,width:r,height:i}}function _t(t){var e=this.data,n=t.top,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalHeight(),s=n-c;return c>a&&(s-=l.y),{left:o,top:s,width:r,height:i}}function Ct(t){this.br.setAreaOffset(Et.call(this,t))}function Tt(t){this.t.setAreaOffset(jt.call(this,t))}function Pt(t){this.l.setAreaOffset(_t.call(this,t))}function At(t){this.l.setClipboardOffset(_t.call(this,t))}function Rt(t){this.br.setClipboardOffset(Et.call(this,t))}function Dt(t){this.t.setClipboardOffset(jt.call(this,t))}function zt(t){Ct.call(this,t),function(t){this.tl.setAreaOffset(t)}.call(this,t),Tt.call(this,t),Pt.call(this,t)}function It(t){Rt.call(this,t),function(t){this.tl.setClipboardOffset(t)}.call(this,t),Dt.call(this,t),At.call(this,t)}var Mt=function(){function t(e){wt(this,t),this.data=e,this.br=new xt,this.t=new xt,this.l=new xt,this.tl=new xt,this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=a(\"div\",\"\".concat(vt,\"-selectors\")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,St+=1}return Ot(t,[{key:\"hide\",value:function(){this.el.hide()}},{key:\"resetOffset\",value:function(){var t=this.data,e=this.tl,n=this.t,r=this.l,i=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();o>0||a>0?(e.setOffset({width:a,height:o}),n.setOffset({left:a,height:o}),r.setOffset({top:o,width:a}),i.setOffset({left:a,top:o})):(e.hide(),n.hide(),r.hide(),i.setOffset({left:0,top:0}))}},{key:\"resetAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();zt.call(this,t),It.call(this,e),this.resetOffset()}},{key:\"resetBRTAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Ct.call(this,t),Tt.call(this,t),Rt.call(this,e),Dt.call(this,e),this.resetOffset()}},{key:\"resetBRLAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Ct.call(this,t),Pt.call(this,t),Rt.call(this,e),At.call(this,e),this.resetOffset()}},{key:\"set\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=r.calSelectedRangeByStart(t,e),o=i.sri,a=i.sci;if(n){var l=t,c=e;t<0&&(l=0),e<0&&(c=0),r.selector.setIndexes(l,c),this.indexes=[l,c]}this.moveIndexes=[o,a],this.range=i,this.resetAreaOffset(),this.el.show()}},{key:\"setEnd\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=this.lastri,o=this.lastci;if(n){if(t===i&&e===o)return;this.lastri=t,this.lastci=e}this.range=r.calSelectedRangeByEnd(t,e),zt.call(this,this.data.getSelectedRect())}},{key:\"reset\",value:function(){var t=this.data.selector.range,e=t.eri,n=t.eci;this.setEnd(e,n)}},{key:\"showAutofill\",value:function(t,e){if(-1!==t||-1!==e){var n=this.range,r=n.sri,i=n.sci,o=n.eri,a=n.eci,l=t,c=e,s=r-t,u=o-t,f=a-e;if(i-e>0)this.arange=new d(r,c,o,i-1);else if(s>0)this.arange=new d(l,i,r-1,a);else if(f<0)this.arange=new d(r,a+1,o,c);else{if(!(u<0))return void(this.arange=null);this.arange=new d(o+1,i,l,a)}if(null!==this.arange){var h=this.data.getRect(this.arange);h.width+=2,h.height+=2;var y=this.br,p=this.l,v=this.t,b=this.tl;y.showAutofill(Et.call(this,h)),p.showAutofill(_t.call(this,h)),v.showAutofill(jt.call(this,h)),b.showAutofill(h)}}}},{key:\"hideAutofill\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideAutofill()})}},{key:\"showClipboard\",value:function(){var t=this,e=this.data.getClipboardRect();It.call(this,e),[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].showClipboard()})}},{key:\"hideClipboard\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideClipboard()})}}]),t}();function Wt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ht(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}var Nt=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"200px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterItems=[],this.items=e,this.el=a(\"div\",\"\".concat(vt,\"-suggest\")).css(\"width\",r).hide(),this.itemClick=n,this.itemIndex=-1}var e,n,r;return e=t,(n=[{key:\"setOffset\",value:function(t){this.el.cssRemoveKeys(\"top\",\"bottom\").offset(t)}},{key:\"hide\",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide(),ft(this.el.parent())}},{key:\"setItems\",value:function(t){this.items=t}},{key:\"search\",value:function(t){var e,n=this,r=this.items;if(/^\\s*$/.test(t)||(r=r.filter(function(e){return(e.key||e).startsWith(t.toUpperCase())})),r=r.map(function(t){var e=t.title;e?\"function\"==typeof e&&(e=e()):e=t;var r=a(\"div\",\"\".concat(vt,\"-item\")).child(e).on(\"click.stop\",function(){n.itemClick(t),n.hide()});return t.label&&r.child(a(\"div\",\"label\").html(t.label)),r}),this.filterItems=r,!(r.length<=0)){var i=this.el;(e=i.html(\"\")).children.apply(e,Wt(r)).show(),ht(i.parent(),function(){n.hide()})}}},{key:\"bindInputEvents\",value:function(t){var e=this;t.on(\"keydown\",function(t){return function(t){var e=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),e){case 37:t.stopPropagation();break;case 38:(function(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle())}).call(this,t);break;case 39:t.stopPropagation();break;case 40:(function(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle())}).call(this,t);break;case 13:case 9:Ht.call(this,t);break;default:t.stopPropagation()}}.call(e,t)})}}])&&Ft(e.prototype,n),r&&Ft(e,r),t}();function Vt(t){return(Vt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bt(t,e){return!e||\"object\"!==Vt(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Lt(t){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ut(t,e){return(Ut=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Yt=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=Bt(this,Lt(e).call(this,\"div\",\"\".concat(vt,\"-icon\")))).iconNameEl=a(\"div\",\"\".concat(vt,\"-icon-img \").concat(t)),n.child(n.iconNameEl),n}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ut(t,e)}(e,o),n=e,(r=[{key:\"setName\",value:function(t){this.iconNameEl.className(\"\".concat(vt,\"-icon-img \").concat(t))}}])&&qt(n.prototype,r),i&&qt(n,i),e}();function $t(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kt(t,e){t.setMonth(t.getMonth()+e)}function Jt(t,e){var n=new Date(t);return n.setDate(e-t.getDay()+1),n}var Zt=function(){function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=a(\"div\",\"calendar-header-left\"),this.bodyEl=a(\"tbody\",\"\"),this.buildAll(),this.el=a(\"div\",\"x-spreadsheet-calendar\").children(a(\"div\",\"calendar-header\").children(this.headerLeftEl,a(\"div\",\"calendar-header-right\").children(a(\"a\",\"calendar-prev\").on(\"click.stop\",function(){return r.prev()}).child(new Yt(\"chevron-left\")),a(\"a\",\"calendar-next\").on(\"click.stop\",function(){return r.next()}).child(new Yt(\"chevron-right\")))),a(\"table\",\"calendar-body\").children(a(\"thead\",\"\").child((n=a(\"tr\",\"\")).children.apply(n,$t(V(\"calendar.weeks\").map(function(t){return a(\"th\",\"cell\").child(t)})))),this.bodyEl)),this.selectChange=function(){}}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:\"prev\",value:function(){Kt(this.value,-1),this.buildAll()}},{key:\"next\",value:function(){Kt(this.value,1),this.buildAll()}},{key:\"buildAll\",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:\"buildHeaderLeft\",value:function(){var t=this.value;this.headerLeftEl.html(\"\".concat(V(\"calendar.months\")[t.getMonth()],\" \").concat(t.getFullYear()))}},{key:\"buildBody\",value:function(){var t,e=this,n=this.value,r=this.cvalue,i=this.bodyEl,o=function(t,e,n){for(var r=new Date(t,e,1,23,59,59),i=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var l=Jt(r,7*o+a),c=l.getMonth()!==e,s=l.getMonth()===n.getMonth()&&l.getDate()===n.getDate();i[o][a]={d:l,disabled:c,active:s}}return i}(n.getFullYear(),n.getMonth(),r).map(function(t){var n,r=t.map(function(t){var n=\"cell\";return t.disabled&&(n+=\" disabled\"),t.active&&(n+=\" active\"),a(\"td\",\"\").child(a(\"div\",n).on(\"click.stop\",function(){e.selectChange(t.d)}).child(t.d.getDate().toString()))});return(n=a(\"tr\",\"\")).children.apply(n,$t(r))});(t=i.html(\"\")).children.apply(t,$t(o))}}])&&Xt(e.prototype,n),r&&Xt(e,r),t}();function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Qt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.calendar=new Zt(new Date),this.el=a(\"div\",\"\".concat(vt,\"-datepicker\")).child(this.calendar.el).hide()}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){var e=this.calendar;return\"string\"==typeof t?/^\\d{4}-\\d{1,2}-\\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp(\"-\",\"g\"),\"/\"))):t instanceof Date&&e.setValue(t),this}},{key:\"change\",value:function(t){var e=this;this.calendar.selectChange=function(n){t(n),e.hide()}}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&Gt(e.prototype,n),r&&Gt(e,r),t}();function te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ee(){if(!/^\\s*$/.test(this.inputText)){var t=this.textlineEl,e=this.textEl,n=this.areaOffset,r=t.offset().width+9,i=this.viewFn().width-n.left-9;if(r>n.width){var o=r;if(r>i){o=i;var a=parseInt(r/i,10);a+=r%i>0?1:0,(a*=this.rowHeight)>n.height&&e.css(\"height\",\"\".concat(a,\"px\"))}e.css(\"width\",\"\".concat(o,\"px\"))}}}function ne(t,e){var n=this.textEl,r=this.textlineEl;n.el.blur(),n.val(t),r.html(t),function(t){var e=this.textEl.el;setTimeout(function(){e.focus(),e.setSelectionRange(t,t)},0)}.call(this,e)}var re=function(){function t(e,n,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.viewFn=n,this.rowHeight=r,this.formulas=e,this.suggest=new Nt(e,function(t){(function(t){var e=this.inputText,n=this.validator,r=0;if(n&&\"list\"===n.type)this.inputText=t,r=this.inputText.length;else{var i=e.lastIndexOf(\"=\"),o=e.substring(0,i+1),a=e.substring(i+1);a=-1!==a.indexOf(\")\")?a.substring(a.indexOf(\")\")):\"\",this.inputText=\"\".concat(o+t.key,\"(\"),r=this.inputText.length,this.inputText+=\")\".concat(a)}ne.call(this,this.inputText,r)}).call(i,t)}),this.datepicker=new Qt,this.datepicker.change(function(t){i.setText(function(t){var e=t.getMonth()+1,n=t.getDate();return e<10&&(e=\"0\".concat(e)),n<10&&(n=\"0\".concat(n)),\"\".concat(t.getFullYear(),\"-\").concat(e,\"-\").concat(n)}(t)),i.clear()}),this.areaEl=a(\"div\",\"\".concat(vt,\"-editor-area\")).children(this.textEl=a(\"textarea\",\"\").on(\"input\",function(t){return function(t){var e=t.target.value,n=this.suggest,r=this.textlineEl,i=this.validator;if(this.inputText=e,i)\"list\"===i.type?n.search(e):n.hide();else{var o=e.lastIndexOf(\"=\");-1!==o?n.search(e.substring(o+1)):n.hide()}r.html(e),ee.call(this),this.change(\"input\",e)}.call(i,t)}),this.textlineEl=a(\"div\",\"textline\"),this.suggest.el,this.datepicker.el).on(\"mousemove.stop\",function(){}).on(\"mousedown.stop\",function(){}),this.el=a(\"div\",\"\".concat(vt,\"-editor\")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText=\"\",this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"setFreezeLengths\",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:\"clear\",value:function(){\"\"!==this.inputText&&this.change(\"finished\",this.inputText),this.cell=null,this.areaOffset=null,this.inputText=\"\",this.el.hide(),this.textEl.val(\"\"),this.textlineEl.html(\"\"),function(){this.suggest.setItems(this.formulas)}.call(this),this.datepicker.hide()}},{key:\"setOffset\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"top\",n=this.textEl,r=this.areaEl,i=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var l=t.left,c=t.top,s=t.width,u=t.height,f=t.l,h=t.t,y={left:0,top:0};o.w>f&&o.h>h||(o.w<f&&o.h<h?(y.left=o.w,y.top=o.h):o.w>f?y.top=o.h:o.h>h&&(y.left=o.w)),a.offset(y),r.offset({left:l-y.left-.8,top:c-y.top-.8}),n.offset({width:s-9+.8,height:u-3+.8});var p={left:0};p[e]=u,i.setOffset(p),i.hide()}}},{key:\"setCell\",value:function(t,e){var n=this.el,r=this.datepicker,i=this.suggest;n.show(),this.cell=t;var o=t&&t.text||\"\";if(this.setText(o),this.validator=e,e){var a=e.type;\"date\"===a&&(r.show(),/^\\s*$/.test(o)||r.setValue(o)),\"list\"===a&&(i.setItems(e.values()),i.search(\"\"))}}},{key:\"setText\",value:function(t){this.inputText=t,ne.call(this,t,t.length),ee.call(this)}}])&&te(e.prototype,n),r&&te(e,r),t}();function ie(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ae=[{key:\"copy\",title:q(\"contextmenu.copy\"),label:\"Ctrl+C\"},{key:\"cut\",title:q(\"contextmenu.cut\"),label:\"Ctrl+X\"},{key:\"paste\",title:q(\"contextmenu.paste\"),label:\"Ctrl+V\"},{key:\"paste-value\",title:q(\"contextmenu.pasteValue\"),label:\"Ctrl+Shift+V\"},{key:\"paste-format\",title:q(\"contextmenu.pasteFormat\"),label:\"Ctrl+Alt+V\"},{key:\"divider\"},{key:\"insert-row\",title:q(\"contextmenu.insertRow\")},{key:\"insert-column\",title:q(\"contextmenu.insertColumn\")},{key:\"divider\"},{key:\"delete-row\",title:q(\"contextmenu.deleteRow\")},{key:\"delete-column\",title:q(\"contextmenu.deleteColumn\")},{key:\"delete-cell-text\",title:q(\"contextmenu.deleteCellText\")},{key:\"divider\"},{key:\"validation\",title:q(\"contextmenu.validation\")}];function le(){var t=this;return ae.map(function(e){return function(t){var e=this;return\"divider\"===t.key?a(\"div\",\"\".concat(vt,\"-item divider\")):a(\"div\",\"\".concat(vt,\"-item\")).on(\"click\",function(){e.itemClick(t.key),e.hide()}).children(t.title(),a(\"div\",\"label\").child(t.label||\"\"))}.call(t,e)})}var ce=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=(n=a(\"div\",\"\".concat(vt,\"-contextmenu\"))).children.apply(n,ie(le.call(this))).hide(),this.viewFn=e,this.itemClick=function(){},this.isHide=r}var e,n,r;return e=t,(n=[{key:\"hide\",value:function(){var t=this.el;t.hide(),ft(t)}},{key:\"setPosition\",value:function(t,e){if(!this.isHide){var n=this.el,r=n.show().offset(),i=r.height,o=r.width,a=this.viewFn(),l=e,c=t;a.height-e<=i&&(l-=i),a.width-t<=o&&(c-=o),n.offset({left:c,top:l}),ht(n)}}}])&&oe(e.prototype,n),r&&oe(e,r),t}(),se=[{key:\"Arial\",title:\"Arial\"},{key:\"Helvetica\",title:\"Helvetica\"},{key:\"Source Sans Pro\",title:\"Source Sans Pro\"},{key:\"Comic Sans MS\",title:\"Comic Sans MS\"},{key:\"Courier New\",title:\"Courier New\"},{key:\"Verdana\",title:\"Verdana\"},{key:\"Lato\",title:\"Lato\"}],ue=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function fe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var he=function(t,e){if(t[0]>=\"0\"&&t[0]<=\"9\")return Number(t);if('\"'===t[0])return t.substring(1);var n=fe(f(t),2);return e(n[0],n[1])},ye={render:function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(\"=\"===e[0]){var o=function(t){for(var e=[],n=[],r=[],i=0,o=1,a=0;a<t.length;a+=1){var l=t.charAt(a);if(\" \"!==l)if(l>=\"a\"&&l<=\"z\")r.push(l.toUpperCase());else if(l>=\"0\"&&l<=\"9\"||l>=\"A\"&&l<=\"Z\"||\".\"===l)r.push(l);else if('\"'===l){for(a+=1;'\"'!==t.charAt(a);)r.push(t.charAt(a)),a+=1;n.push('\"'.concat(r.join(\"\"))),r=[]}else{if(\"(\"!==l&&r.length>0&&n.push(r.join(\"\")),\")\"===l){var c=e.pop();if(2===i)try{for(var s=fe(f(n.pop()),2),u=s[0],y=s[1],p=fe(f(n.pop()),2),v=p[0],d=p[1],b=0,g=v;g<=u;g+=1)for(var m=d;m<=y;m+=1)n.push(h(g,m)),b+=1;n.push([c,b])}catch(t){}else if(1===i)n.push([c,o]),o=1;else for(;\"(\"!==c&&(n.push(c),!(e.length<=0));)c=e.pop();i=0}else if(\":\"===l)i=2;else if(\",\"===l)i=1,o+=1;else if(\"(\"===l&&r.length>0)e.push(r.join(\"\"));else{if(e.length>0&&(\"+\"===l||\"-\"===l)){var w=e[e.length-1];if(\"(\"!==w&&n.push(e.pop()),\"*\"===w||\"/\"===w)for(;e.length>0&&\"(\"!==(w=e[e.length-1]);)n.push(e.pop())}e.push(l)}r=[]}}for(r.length>0&&n.push(r.join(\"\"));e.length>0;)n.push(e.pop());return n}(e.substring(1));return o.length<=0?e:function(t,e,n,r){for(var i=[],o=0;o<t.length;o+=1)if(\"+\"===t[o]){var a=i.pop();i.push(Number(i.pop())+Number(a))}else if(\"-\"===t[o]){var l=i.pop();i.push(Number(i.pop())-Number(l))}else if(\"*\"===t[o])i.push(Number(i.pop())*Number(i.pop()));else if(\"/\"===t[o]){var c=i.pop();i.push(Number(i.pop())/Number(c))}else if(Array.isArray(t[o])){for(var s=fe(t[o],2),u=s[0],f=s[1],h=[],y=0;y<f;y+=1)h.push(i.pop());i.push(e[u].render(h.reverse()))}else{if(r.includes(t[o]))return 0;r.push(t[o]),i.push(he(t[o],n))}return i[0]}(o,n,function(e,o){return t(r(e,o),n,r,i)},i)}return e}};function pe(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var ve=[{key:\"SUM\",title:q(\"formula.sum\"),render:function(t){return t.reduce(function(t,e){return Number(t)+Number(e)},0)}},{key:\"AVERAGE\",title:q(\"formula.average\"),render:function(t){return t.reduce(function(t,e){return Number(t)+Number(e)},0)/t.length}},{key:\"MAX\",title:q(\"formula.max\"),render:function(t){return Math.max.apply(Math,pe(t.map(function(t){return Number(t)})))}},{key:\"MIN\",title:q(\"formula.min\"),render:function(t){return Math.min.apply(Math,pe(t.map(function(t){return Number(t)})))}},{key:\"CONCAT\",title:q(\"formula.concat\"),render:function(t){return t.join(\"\")}}],de=ve,be={};function ge(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||we(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function me(t){return function(t){if(Array.isArray(t))return t}(t)||we(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function we(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}ve.forEach(function(t){be[t.key]=t});var ke=function(t){return t},Oe=function(t){if(/^(-?\\d*.?\\d*)$/.test(t)){var e=me(Number(t).toFixed(2).toString().split(\"\\\\.\")),n=e[0],r=e.slice(1);return[n.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1,\")].concat(ge(r))}return t},Se=[{key:\"normal\",title:q(\"format.normal\"),type:\"string\",render:ke},{key:\"text\",title:q(\"format.text\"),type:\"string\",render:ke},{key:\"number\",title:q(\"format.number\"),type:\"number\",label:\"1,000.12\",render:Oe},{key:\"percent\",title:q(\"format.percent\"),type:\"number\",label:\"10.12%\",render:function(t){return\"\".concat(t,\"%\")}},{key:\"rmb\",title:q(\"format.rmb\"),type:\"number\",label:\"￥10.00\",render:function(t){return\"￥\".concat(Oe(t))}},{key:\"usd\",title:q(\"format.usd\"),type:\"number\",label:\"$10.00\",render:function(t){return\"$\".concat(Oe(t))}},{key:\"date\",title:q(\"format.date\"),type:\"date\",label:\"26/09/2008\",render:ke},{key:\"time\",title:q(\"format.time\"),type:\"date\",label:\"15:59:00\",render:ke},{key:\"datetime\",title:q(\"format.datetime\"),type:\"date\",label:\"26/09/2008 15:59:00\",render:ke},{key:\"duration\",title:q(\"format.duration\"),type:\"date\",label:\"24:01:00\",render:ke}],xe={};function Ee(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function je(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function _e(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Te(t,e,n){return e&&Ce(t.prototype,e),n&&Ce(t,n),t}function Pe(){return window.devicePixelRatio||1}function Ae(){return Pe()-.5}function Re(t){return parseInt(t*Pe(),10)}function De(t){var e=Re(t);return e>0?e-.5:.5}Se.forEach(function(t){xe[t.key]=t});var ze=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;_e(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.padding=o,this.bgcolor=\"#ffffff\",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null}return Te(t,[{key:\"setBorders\",value:function(t){var e=t.top,n=t.bottom,r=t.left,i=t.right;e&&(this.borderTop=e),i&&(this.borderRight=i),n&&(this.borderBottom=n),r&&(this.borderLeft=r)}},{key:\"innerWidth\",value:function(){return this.width-2*this.padding}},{key:\"innerHeight\",value:function(){return this.height-2*this.padding}},{key:\"textx\",value:function(t){var e=this.width,n=this.padding,r=this.x;return\"left\"===t?r+=n:\"center\"===t?r+=e/2:\"right\"===t&&(r+=e-n),r}},{key:\"texty\",value:function(t,e,n){var r=this.height,i=this.padding,o=this.y;return\"top\"===t?o+=i:\"middle\"===t?o=o+r/2-n:\"bottom\"===t&&(o+=r-2*n-i),o}},{key:\"topxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:\"rightxys\",value:function(){var t=this.x,e=this.y,n=this.width;return[[t+n,e],[t+n,e+this.height]]}},{key:\"bottomxys\",value:function(){var t=this.x,e=this.y,n=this.width,r=this.height;return[[t,e+r],[t+n,e+r]]}},{key:\"leftxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function Ie(t,e,n,r,i,o,a){var l={x:0,y:0};\"underline\"===t?l.y=\"bottom\"===i?0:\"top\"===i?-(o+2):-o/2:\"strike\"===t&&(\"bottom\"===i?l.y=o/2:\"top\"===i&&(l.y=-(o/2+2))),\"center\"===r?l.x=a/2:\"right\"===r&&(l.x=a),this.line([e-l.x,n-l.y],[e-l.x+a,n-l.y])}var Me=function(){function t(e,n,r){_e(this,t),this.el=e,this.ctx=e.getContext(\"2d\"),this.resize(n,r),this.ctx.scale(Pe(),Pe())}return Te(t,[{key:\"resize\",value:function(t,e){this.el.style.width=\"\".concat(t,\"px\"),this.el.style.height=\"\".concat(e,\"px\"),this.el.width=Re(t),this.el.height=Re(e)}},{key:\"clear\",value:function(){var t=this.el,e=t.width,n=t.height;return this.ctx.clearRect(0,0,e,n),this}},{key:\"attr\",value:function(t){return Object.assign(this.ctx,t),this}},{key:\"save\",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:\"restore\",value:function(){return this.ctx.restore(),this}},{key:\"beginPath\",value:function(){return this.ctx.beginPath(),this}},{key:\"translate\",value:function(t,e){return this.ctx.translate(Re(t),Re(e)),this}},{key:\"clearRect\",value:function(t,e,n,r){return this.ctx.clearRect(t,e,n,r),this}},{key:\"fillRect\",value:function(t,e,n,r){return this.ctx.fillRect(Re(t)-.5,Re(e)-.5,Re(n),Re(r)),this}},{key:\"fillText\",value:function(t,e,n){return this.ctx.fillText(t,Re(e),Re(n)),this}},{key:\"text\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.ctx,o=n.align,a=n.valign,l=n.font,c=n.color,s=n.strike,u=n.underline,f=e.textx(o);i.save(),i.beginPath(),this.attr({textAlign:o,textBaseline:a,font:\"\".concat(l.italic?\"italic\":\"\",\" \").concat(l.bold?\"bold\":\"\",\" \").concat(Re(l.size),\"px \").concat(l.name),fillStyle:c,strokeStyle:c});var h=i.measureText(t).width,y=0;r&&(y=(Math.ceil(h/e.innerWidth())-1)*l.size/2);var p=e.texty(a,l.size,y);if(r&&h>e.innerWidth()){for(var v={len:0,start:0},d=0;d<t.length;d+=1)v.len>=e.innerWidth()&&(this.fillText(t.substring(v.start,d),f,p),s&&Ie.call(this,\"strike\",f,p,o,a,l.size,v.len),u&&Ie.call(this,\"underline\",f,p,o,a,l.size,v.len),p+=l.size+2,v.len=0,v.start=d),v.len+=i.measureText(t[d]).width;v.len>0&&(this.fillText(t.substring(v.start),f,p),s&&Ie.call(this,\"strike\",f,p,o,a,l.size,v.len),u&&Ie.call(this,\"underline\",f,p,o,a,l.size,v.len))}else this.fillText(t,f,p),s&&Ie.call(this,\"striket\",f,p,o,a,l.size,h),u&&Ie.call(this,\"underline\",f,p,o,a,l.size,h);return i.restore(),this}},{key:\"border\",value:function(t,e){var n=this.ctx;return n.lineWidth=Ae,n.strokeStyle=e,\"medium\"===t?n.lineWidth=Re(2)-.5:\"thick\"===t?n.lineWidth=Re(3):\"dashed\"===t?n.setLineDash([Re(3),Re(2)]):\"dotted\"===t?n.setLineDash([Re(1),Re(1)]):\"double\"===t&&n.setLineDash([Re(2),0]),this}},{key:\"line\",value:function(){var t=this.ctx;if(arguments.length>1){var e=je(arguments.length<=0?void 0:arguments[0],2),n=e[0],r=e[1];t.moveTo(De(n),De(r));for(var i=1;i<arguments.length;i+=1){var o=je(i<0||arguments.length<=i?void 0:arguments[i],2),a=o[0],l=o[1];t.lineTo(De(a),De(l))}t.stroke()}return this}},{key:\"strokeBorders\",value:function(t){var e=this.ctx;e.save(),e.beginPath();var n=t.borderTop,r=t.borderRight,i=t.borderBottom,o=t.borderLeft;n&&(this.border.apply(this,Ee(n)),this.line.apply(this,Ee(t.topxys()))),r&&(this.border.apply(this,Ee(r)),this.line.apply(this,Ee(t.rightxys()))),i&&(this.border.apply(this,Ee(i)),this.line.apply(this,Ee(t.bottomxys()))),o&&(this.border.apply(this,Ee(o)),this.line.apply(this,Ee(t.leftxys()))),e.restore()}},{key:\"dropdown\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-15,o=r+t.height-15;e.save(),e.beginPath(),e.moveTo(Re(i),Re(o)),e.lineTo(Re(i+8),Re(o)),e.lineTo(Re(i+4),Re(o+6)),e.closePath(),e.fillStyle=\"rgba(0, 0, 0, .45)\",e.fill(),e.restore()}},{key:\"error\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(Re(i-8),Re(r-1)),e.lineTo(Re(i),Re(r-1)),e.lineTo(Re(i),Re(r+8)),e.closePath(),e.fillStyle=\"rgba(255, 0, 0, .65)\",e.fill(),e.restore()}},{key:\"rect\",value:function(t,e){var n=this.ctx,r=t.x,i=t.y,o=t.width,a=t.height,l=t.bgcolor;n.save(),n.beginPath(),n.fillStyle=l||\"#fff\",n.rect(De(r+1),De(i+1),Re(o-2),Re(a-2)),n.clip(),n.fill(),e(),n.restore()}}]),t}();function We(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var He=5,Ne={fillStyle:\"#f4f5f8\"},Ve={fillStyle:\"#fff\",lineWidth:Ae,strokeStyle:\"#e6e6e6\"};function qe(t,e){var n=this.data.cellRect(t,e),r=n.left,i=n.top,o=n.width,a=n.height;return new ze(r,i,o,a,He)}function Be(t,e){var n=this.draw,r=this.data,i=r.sortedRowMap,o=t;i.has(t)&&(o=i.get(t));var a=r.getCell(o,e);if(null!==a){var l=r.getCellStyleOrDefault(o,e),c=qe.call(this,t,e);c.bgcolor=l.bgcolor,void 0!==l.border&&(c.setBorders(l.border),n.strokeBorders(c)),n.rect(c,function(){var i=ye.render(a.text||\"\",be,function(t,e){return r.getCellTextOrDefault(e,t)});l.format&&(i=xe[l.format].render(i));var o=Object.assign({},l.font);o.size=function(t){for(var e=0;e<ue.length;e+=1){var n=ue[e];if(n.pt===t)return n.px}return t}(o.size),n.text(i,c,{align:l.align,valign:l.valign,font:o,color:l.color,strike:l.strike,underline:l.underline},l.textwrap),r.validations.getError(t,e)&&n.error(c)})}}function Le(t,e,n,r,i){var o=this,a=this.draw,l=this.data;a.save(),a.translate(e,n).translate(r,i);var c=l.exceptRowSet,s=l.exceptRowTotalHeight(t.sri,t.eri);a.save(),a.translate(0,-s),t.each(function(t,e){Be.call(o,t,e)},function(t){return function(t){var e=c.has(t);if(e){var n=l.rows.getHeight(t);a.translate(0,-n)}return!e}(t)}),a.restore();var u=new Set;a.save(),a.translate(0,-s),l.eachMergesInView(t,function(t){var e=t.sri,n=t.sci,r=t.eri;if(c.has(e)){if(!u.has(e)){u.add(e);var i=l.rows.sumHeight(e,r+1);a.translate(0,-i)}}else Be.call(o,e,n)}),a.restore(),function(t){var e=this,n=this.data,r=this.draw;if(t){var i=n.autoFilter;if(!i.active())return;var o=i.hrange();t.intersects(o)&&o.each(function(t,n){var i=qe.call(e,t,n);r.dropdown(i)})}}.call(this,t),a.restore()}function Ue(t,e,n,r){var i=this.draw;i.save(),i.attr({fillStyle:\"rgba(75, 137, 255, 0.08)\"}).fillRect(t,e,n,r),i.restore()}function Ye(t,e,n,r,i,o){var a=this,l=this.draw,c=this.data,u=e.h,f=e.w,h=o+r,y=i+n;l.save(),l.attr(Ne),\"all\"!==t&&\"left\"!==t||l.fillRect(0,h,n,u),\"all\"!==t&&\"top\"!==t||l.fillRect(y,0,f,r);var p=c.selector.range,v=p.sri,d=p.sci,b=p.eri,g=p.eci;l.attr({textAlign:\"center\",textBaseline:\"middle\",font:\"500 \".concat(Re(12),\"px Source Sans Pro\"),fillStyle:\"#585757\",lineWidth:Ae(),strokeStyle:\"#e6e6e6\"}),\"all\"!==t&&\"left\"!==t||(c.rowEach(e.sri,e.eri,function(t,e,r){var i=h+e,o=t;l.line([0,i],[n,i]),v<=o&&o<b+1&&Ue.call(a,0,i,n,r),l.fillText(o+1,n/2,i+r/2)}),l.line([0,u+h],[n,u+h]),l.line([n,h],[n,u+h])),\"all\"!==t&&\"top\"!==t||(c.colEach(e.sci,e.eci,function(t,e,n){var i=y+e,o=t;l.line([i,0],[i,r]),d<=o&&o<g+1&&Ue.call(a,i,0,n,r),l.fillText(s(o),i+n/2,r/2)}),l.line([f+y,0],[f+y,r]),l.line([0,r],[f+y,r])),l.restore()}function $e(t,e,n,r,i){var o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=t.w,u=t.h,f=this.draw,h=this.data,y=h.settings;f.save(),f.attr(Ve).translate(e+r,n+i),f.clearRect(0,0,s,u),y.showGrid?(h.rowEach(o,l,function(t,e,n){t!==o&&f.line([0,e],[s,e]),t===l&&f.line([0,e+n],[s,e+n])}),h.colEach(a,c,function(t,e,n){t!==a&&f.line([e,0],[e,u]),t===c&&f.line([e+n,0],[e+n,u])}),f.restore()):f.restore()}var Xe=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=e,this.draw=new Me(e,n.viewWidth(),n.viewHeight()),this.data=n}var e,n,r;return e=t,(n=[{key:\"render\",value:function(){var t=this.data,e=t.rows,n=t.cols.indexWidth,r=e.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.clear();var i=t.viewRange(),o=t.freezeTotalWidth(),a=t.freezeTotalHeight(),l=t.scroll,c=l.x,s=l.y;$e.call(this,i,n,r,o,a),Le.call(this,i,n,r,-c,-s),Ye.call(this,\"all\",i,n,r,o,a),function(t,e){var n=this.draw;n.save(),n.attr({fillStyle:\"#f4f5f8\"}).fillRect(0,0,t,e),n.restore()}.call(this,n,r);var u=We(t.freeze,2),f=u[0],h=u[1];if(f>0||h>0){if(f>0){var y=i.clone();y.sri=0,y.eri=f-1,y.h=a,$e.call(this,y,n,r,o,0),Le.call(this,y,n,r,-c,0),Ye.call(this,\"top\",y,n,r,o,0)}if(h>0){var p=i.clone();p.sci=0,p.eci=h-1,p.w=o,$e.call(this,p,n,r,0,a),Ye.call(this,\"left\",p,n,r,0,a),Le.call(this,p,n,r,0,-s)}var v=t.freezeViewRange();$e.call(this,v,n,r,0,0),Ye.call(this,\"all\",v,n,r,0,0),Le.call(this,v,n,r,0,0),function(t,e,n,r){var i=this.draw,o=this.data,a=o.viewWidth()-t,l=o.viewHeight()-e;i.save().translate(t,e).attr({strokeStyle:\"rgba(75, 137, 255, .6)\"}),i.line([0,r],[a,r]),i.line([n,0],[n,l]),i.restore()}.call(this,n,r,o,a)}}},{key:\"clear\",value:function(){this.draw.clear()}}])&&Fe(e.prototype,n),r&&Fe(e,r),t}();function Ke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Je=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.tip=V(\"toolbar.\".concat(e.replace(/-[a-z]/g,function(t){return t[1].toUpperCase()}))),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"element\",value:function(){var t=this.tip;return a(\"div\",\"\".concat(vt,\"-toolbar-btn\")).on(\"mouseenter\",function(e){!function(t,e){if(!e.classList.contains(\"active\")){var n=e.getBoundingClientRect(),r=n.left,i=n.top,o=n.width,l=n.height,c=a(\"div\",\"\".concat(vt,\"-tooltip\")).html(t).show();document.body.appendChild(c.el);var s=c.box();c.css(\"left\",\"\".concat(r+o/2-s.width/2,\"px\")).css(\"top\",\"\".concat(i+l+2,\"px\")),st(e,\"mouseleave\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}),st(e,\"click\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})}}(t,e.target)}).attr(\"data-tooltip\",t)}},{key:\"setState\",value:function(){}}])&&Ke(e.prototype,n),r&&Ke(e,r),t}();function Ze(t){return(Ze=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qe(t,e){return!e||\"object\"!==Ze(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function tn(t,e,n){return(tn=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=en(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nn(t,e){return(nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var rn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Qe(this,en(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nn(t,e)}(e,Je),n=e,(r=[{key:\"dropdown\",value:function(){}},{key:\"getValue\",value:function(t){return t}},{key:\"element\",value:function(){var t=this,n=this.tag;return this.dd=this.dropdown(),this.dd.change=function(e){return t.change(n,t.getValue(e))},tn(en(e.prototype),\"element\",this).call(this).child(this.dd)}},{key:\"setState\",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}])&&Ge(n.prototype,r),i&&Ge(n,i),e}();function on(t){return(on=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function an(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ln(t,e){return!e||\"object\"!==on(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function cn(t){return(cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sn(t,e){return(sn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var un=function(t){function e(t,n,r,i){var o,l;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(l=ln(this,cn(e).call(this,\"div\",\"\".concat(vt,\"-dropdown \").concat(i)))).title=t,l.change=function(){},\"string\"==typeof t?l.title=a(\"div\",\"\".concat(vt,\"-dropdown-title\")).child(t):r&&l.title.addClass(\"arrow-left\");for(var c=arguments.length,s=new Array(c>4?c-4:0),u=4;u<c;u++)s[u-4]=arguments[u];return l.contentEl=(o=a(\"div\",\"\".concat(vt,\"-dropdown-content\"))).children.apply(o,s).css(\"width\",n).hide(),l.headerEl=a(\"div\",\"\".concat(vt,\"-dropdown-header\")),l.headerEl.on(\"click\",function(){\"block\"!==l.contentEl.css(\"display\")?l.show():l.hide()}).children(l.title,r?a(\"div\",\"\".concat(vt,\"-icon arrow-right\")).child(a(\"div\",\"\".concat(vt,\"-icon-img arrow-down\"))):\"\"),l.children(l.headerEl,l.contentEl),l}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sn(t,e)}(e,o),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.html(t),this.hide()}},{key:\"show\",value:function(){var t=this;this.contentEl.show(),this.parent().active(),ht(this.parent(),function(){t.hide()})}},{key:\"hide\",value:function(){this.parent().active(!1),this.contentEl.hide(),ft(this.parent())}}])&&an(n.prototype,r),i&&an(n,i),e}();function fn(t){return(fn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function hn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pn(t,e){return!e||\"object\"!==fn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function vn(t){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function dn(t,e){return(dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var bn=function(t){function e(t,n){var r,i;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var o=new Yt(\"align-\".concat(n)),l=t.map(function(t){return(e=\"align-\".concat(t),a(\"div\",\"\".concat(vt,\"-item\")).child(new Yt(e))).on(\"click\",function(){i.setTitle(t),i.change(t)});var e});return i=pn(this,(r=vn(e)).call.apply(r,[this,o,\"auto\",!0,\"bottom-left\"].concat(hn(l))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dn(t,e)}(e,un),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.setName(\"align-\".concat(t)),this.hide()}}])&&yn(n.prototype,r),i&&yn(n,i),e}();function gn(t){return(gn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wn(t,e){return!e||\"object\"!==gn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function kn(t){return(kn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function On(t,e){return(On=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Sn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),wn(this,kn(e).call(this,\"align\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&On(t,e)}(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new bn([\"left\",\"center\",\"right\"],t)}}])&&mn(n.prototype,r),i&&mn(n,i),e}();function xn(t){return(xn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function En(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function jn(t,e){return!e||\"object\"!==xn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function _n(t){return(_n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cn(t,e){return(Cn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Tn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),jn(this,_n(e).call(this,\"valign\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cn(t,e)}(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new bn([\"top\",\"middle\",\"bottom\"],t)}}])&&En(n.prototype,r),i&&En(n,i),e}();function Pn(t){return(Pn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function An(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Rn(t,e){return!e||\"object\"!==Pn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Dn(t,e,n){return(Dn=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=zn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function zn(t){return(zn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function In(t,e){return(In=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Mn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Rn(this,zn(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&In(t,e)}(e,Je),n=e,(r=[{key:\"element\",value:function(){var t=this,n=this.tag;return Dn(zn(e.prototype),\"element\",this).call(this).child(new Yt(n)).on(\"click\",function(){return t.click()})}},{key:\"click\",value:function(){this.change(this.tag,this.toggle())}},{key:\"setState\",value:function(t){this.el.active(t)}},{key:\"toggle\",value:function(){return this.el.toggle()}},{key:\"active\",value:function(){return this.el.hasClass(\"active\")}}])&&An(n.prototype,r),i&&An(n,i),e}();function Wn(t){return(Wn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Hn(t,e){return!e||\"object\"!==Wn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Nn(t){return(Nn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vn(t,e){return(Vn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var qn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Hn(this,Nn(e).call(this,\"autofilter\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vn(t,e)}(e,Mn),n=e,(r=[{key:\"setState\",value:function(){}}])&&Fn(n.prototype,r),i&&Fn(n,i),e}();function Bn(t){return(Bn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ln(t,e){return!e||\"object\"!==Bn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Un(t){return(Un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yn(t,e){return(Yn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var $n=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ln(this,Un(e).call(this,\"font-bold\",\"Ctrl+B\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yn(t,e)}(e,Mn),e}();function Xn(t){return(Xn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Kn(t,e){return!e||\"object\"!==Xn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Jn(t){return(Jn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zn(t,e){return(Zn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Gn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Kn(this,Jn(e).call(this,\"font-italic\",\"Ctrl+I\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zn(t,e)}(e,Mn),e}();function Qn(t){return(Qn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function tr(t,e){return!e||\"object\"!==Qn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function er(t){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nr(t,e){return(nr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var rr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),tr(this,er(e).call(this,\"strike\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nr(t,e)}(e,Mn),e}();function ir(t){return(ir=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function or(t,e){return!e||\"object\"!==ir(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ar(t){return(ar=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lr(t,e){return(lr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var cr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),or(this,ar(e).call(this,\"underline\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lr(t,e)}(e,Mn),e}();function sr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var ur=[\"#ffffff\",\"#000100\",\"#e7e5e6\",\"#445569\",\"#5b9cd6\",\"#ed7d31\",\"#a5a5a5\",\"#ffc001\",\"#4371c6\",\"#71ae47\"],fr=[[\"#f2f2f2\",\"#7f7f7f\",\"#d0cecf\",\"#d5dce4\",\"#deeaf6\",\"#fce5d5\",\"#ededed\",\"#fff2cd\",\"#d9e2f3\",\"#e3efd9\"],[\"#d8d8d8\",\"#595959\",\"#afabac\",\"#adb8ca\",\"#bdd7ee\",\"#f7ccac\",\"#dbdbdb\",\"#ffe59a\",\"#b3c6e7\",\"#c5e0b3\"],[\"#bfbfbf\",\"#3f3f3f\",\"#756f6f\",\"#8596b0\",\"#9cc2e6\",\"#f4b184\",\"#c9c9c9\",\"#fed964\",\"#8eaada\",\"#a7d08c\"],[\"#a5a5a5\",\"#262626\",\"#3a3839\",\"#333f4f\",\"#2e75b5\",\"#c45a10\",\"#7b7b7b\",\"#bf8e01\",\"#2f5596\",\"#538136\"],[\"#7f7f7f\",\"#0c0c0c\",\"#171516\",\"#222a35\",\"#1f4e7a\",\"#843c0a\",\"#525252\",\"#7e6000\",\"#203864\",\"#365624\"]],hr=[\"#c00000\",\"#fe0000\",\"#fdc101\",\"#ffff01\",\"#93d051\",\"#00b04e\",\"#01b0f1\",\"#0170c1\",\"#012060\",\"#7030a0\"];function yr(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(vt,\"-color-palette-cell\")).on(\"click.stop\",function(){return e.change(t)}).css(\"background-color\",t))}var pr=function t(){var e,n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=a(\"div\",\"\".concat(vt,\"-color-palette\")),this.change=function(){};var o=a(\"table\",\"\").children((e=a(\"tbody\",\"\")).children.apply(e,[(n=a(\"tr\",\"\".concat(vt,\"-theme-color-placeholders\"))).children.apply(n,sr(ur.map(function(t){return yr.call(i,t)})))].concat(sr(fr.map(function(t){var e;return(e=a(\"tr\",\"\".concat(vt,\"-theme-colors\"))).children.apply(e,sr(t.map(function(t){return yr.call(i,t)})))})),[(r=a(\"tr\",\"\".concat(vt,\"-standard-colors\"))).children.apply(r,sr(hr.map(function(t){return yr.call(i,t)})))])));this.el.child(o)};function vr(t){return(vr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function br(t,e){return!e||\"object\"!==vr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function gr(t){return(gr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mr(t,e){return(mr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var wr=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Yt(t).css(\"height\",\"16px\").css(\"border-bottom\",\"3px solid \".concat(n)),o=new pr;return o.change=function(t){r.setTitle(t),r.change(t)},r=br(this,gr(e).call(this,i,\"auto\",!1,\"bottom-left\",o.el))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mr(t,e)}(e,un),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.css(\"border-color\",t),this.hide()}}])&&dr(n.prototype,r),i&&dr(n,i),e}();function kr(t){return(kr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Or(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Sr(t,e){return!e||\"object\"!==kr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function xr(t){return(xr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Er(t,e){return(Er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var jr=[[\"thin\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"medium\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"2\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.0\" x2=\"50\" y2=\"1.0\" stroke-width=\"2\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"thick\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"3\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.5\" x2=\"50\" y2=\"1.5\" stroke-width=\"3\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"dashed\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"2\" style=\"user-select: none;\"></line></svg>'],[\"dotted\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"1\" style=\"user-select: none;\"></line></svg>']],_r=function(t){function e(t){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Yt(\"line-type\"),o=0,l=jr.map(function(e,n){return a(\"div\",\"\".concat(vt,\"-item state \").concat(t===e[0]?\"checked\":\"\")).on(\"click\",function(){l[o].toggle(\"checked\"),l[n].toggle(\"checked\"),o=n,r.hide(),r.change(e)}).child(a(\"div\",\"\".concat(vt,\"-line-type\")).html(e[1]))});return r=Sr(this,(n=xr(e)).call.apply(n,[this,i,\"auto\",!1,\"bottom-left\"].concat(Or(l))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Er(t,e)}(e,un),e}();function Cr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Tr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Pr(){var t;return a(\"table\",\"\").child((t=a(\"tbody\",\"\")).children.apply(t,arguments))}function Ar(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(vt,\"-border-palette-cell\")).child(new Yt(\"border-\".concat(t))).on(\"click\",function(){e.mode=t;var n=e.mode,r=e.style,i=e.color;e.change({mode:n,style:r,color:i})}))}var Rr=function t(){var e,n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.color=\"#000\",this.style=\"thin\",this.mode=\"all\",this.change=function(){},this.ddColor=new wr(\"line-color\",this.color),this.ddColor.change=function(t){r.color=t},this.ddType=new _r(this.style),this.ddType.change=function(t){var e=Tr(t,1)[0];r.style=e},this.el=a(\"div\",\"\".concat(vt,\"-border-palette\"));var i=Pr(a(\"tr\",\"\").children(a(\"td\",\"\".concat(vt,\"-border-palette-left\")).child(Pr((e=a(\"tr\",\"\")).children.apply(e,Cr([\"all\",\"inside\",\"horizontal\",\"vertical\",\"outside\"].map(function(t){return Ar.call(r,t)}))),(n=a(\"tr\",\"\")).children.apply(n,Cr([\"left\",\"top\",\"right\",\"bottom\",\"none\"].map(function(t){return Ar.call(r,t)}))))),a(\"td\",\"\".concat(vt,\"-border-palette-right\")).children(a(\"div\",\"\".concat(vt,\"-toolbar-btn\")).child(this.ddColor.el),a(\"div\",\"\".concat(vt,\"-toolbar-btn\")).child(this.ddType.el))));this.el.child(i)};function Dr(t){return(Dr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function zr(t,e){return!e||\"object\"!==Dr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ir(t){return(Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mr(t,e){return(Mr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Wr=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new Yt(\"border-all\"),r=new Rr;return r.change=function(e){t.change(e),t.hide()},t=zr(this,Ir(e).call(this,n,\"auto\",!1,\"bottom-left\",r.el))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mr(t,e)}(e,un),e}();function Fr(t){return(Fr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Hr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nr(t,e){return!e||\"object\"!==Fr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Vr(t){return(Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qr(t,e){return(qr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Br=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Nr(this,Vr(e).call(this,\"border\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qr(t,e)}(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){return new Wr}}])&&Hr(n.prototype,r),i&&Hr(n,i),e}();function Lr(t){return(Lr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yr(t,e){return!e||\"object\"!==Lr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function $r(t,e,n){return($r=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xr(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Xr(t){return(Xr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Kr(t,e){return(Kr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Jr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Yr(this,Xr(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kr(t,e)}(e,Je),n=e,(r=[{key:\"element\",value:function(){var t=this;return $r(Xr(e.prototype),\"element\",this).call(this).child(new Yt(this.tag)).on(\"click\",function(){return t.change(t.tag)})}},{key:\"setState\",value:function(t){this.el.disabled(t)}}])&&Ur(n.prototype,r),i&&Ur(n,i),e}();function Zr(t){return(Zr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Gr(t,e){return!e||\"object\"!==Zr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Qr(t){return(Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ti(t,e){return(ti=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ei=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Gr(this,Qr(e).call(this,\"clearformat\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ti(t,e)}(e,Jr),e}();function ni(t){return(ni=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ri(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ii(t,e){return!e||\"object\"!==ni(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function oi(t){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ai(t,e){return(ai=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var li=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ii(this,oi(e).call(this,\"paintformat\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ai(t,e)}(e,Mn),n=e,(r=[{key:\"setState\",value:function(){}}])&&ri(n.prototype,r),i&&ri(n,i),e}();function ci(t){return(ci=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function si(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ui(t,e){return!e||\"object\"!==ci(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function fi(t){return(fi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hi(t,e){return(hi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var yi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ui(this,fi(e).call(this,\"color\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hi(t,e)}(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new wr(t,e)}}])&&si(n.prototype,r),i&&si(n,i),e}();function pi(t){return(pi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function vi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function di(t,e){return!e||\"object\"!==pi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function bi(t){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gi(t,e){return(gi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var mi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),di(this,bi(e).call(this,\"bgcolor\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gi(t,e)}(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new wr(t,e)}}])&&vi(n.prototype,r),i&&vi(n,i),e}();function wi(t){return(wi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ki(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Oi(t,e){return!e||\"object\"!==wi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Si(t){return(Si=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ei=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=ue.map(function(t){return a(\"div\",\"\".concat(vt,\"-item\")).on(\"click\",function(){n.setTitle(\"\".concat(t.pt)),n.change(t)}).child(\"\".concat(t.pt))});return n=Oi(this,(t=Si(e)).call.apply(t,[this,\"10\",\"60px\",!0,\"bottom-left\"].concat(ki(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(e,un),e}();function ji(t){return(ji=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function _i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ci(t,e){return!e||\"object\"!==ji(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ti(t){return(Ti=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pi(t,e){return(Pi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ai=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ci(this,Ti(e).call(this,\"font-size\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pi(t,e)}(e,rn),n=e,(r=[{key:\"getValue\",value:function(t){return t.pt}},{key:\"dropdown\",value:function(){return new Ei}}])&&_i(n.prototype,r),i&&_i(n,i),e}();function Ri(t){return(Ri=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Di(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function zi(t,e){return!e||\"object\"!==Ri(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ii(t){return(Ii=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mi(t,e){return(Mi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Wi=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=se.map(function(t){return a(\"div\",\"\".concat(vt,\"-item\")).on(\"click\",function(){n.setTitle(t.title),n.change(t)}).child(t.title)});return n=zi(this,(t=Ii(e)).call.apply(t,[this,se[0].title,\"160px\",!0,\"bottom-left\"].concat(Di(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mi(t,e)}(e,un),e}();function Fi(t){return(Fi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ni(t,e){return!e||\"object\"!==Fi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Vi(t){return(Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qi(t,e){return(qi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Bi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ni(this,Vi(e).call(this,\"font-name\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qi(t,e)}(e,rn),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new Wi}}])&&Hi(n.prototype,r),i&&Hi(n,i),e}();function Li(t){return(Li=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ui(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $i(t,e){return!e||\"object\"!==Li(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Xi(t){return(Xi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ki(t,e){return(Ki=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ji=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Se.slice(0);return r.splice(2,0,{key:\"divider\"}),r.splice(7,0,{key:\"divider\"}),r=r.map(function(t){var e=a(\"div\",\"\".concat(vt,\"-item\"));return\"divider\"===t.key?e.addClass(\"divider\"):(e.child(t.title()).on(\"click\",function(){n.setTitle(t.title()),n.change(t)}),t.label&&e.child(a(\"div\",\"label\").html(t.label))),e}),n=$i(this,(t=Xi(e)).call.apply(t,[this,\"Normal\",\"220px\",!0,\"bottom-left\"].concat(Ui(r))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ki(t,e)}(e,un),n=e,(r=[{key:\"setTitle\",value:function(t){for(var e=0;e<Se.length;e+=1)Se[e].key===t&&this.title.html(Se[e].title);this.hide()}}])&&Yi(n.prototype,r),i&&Yi(n,i),e}();function Zi(t){return(Zi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Gi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qi(t,e){return!e||\"object\"!==Zi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function to(t){return(to=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function eo(t,e){return(eo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var no=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Qi(this,to(e).call(this,\"format\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&eo(t,e)}(e,rn),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new Ji}}])&&Gi(n.prototype,r),i&&Gi(n,i),e}();function ro(t){return(ro=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function io(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function oo(t,e){return!e||\"object\"!==ro(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ao(t){return(ao=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lo(t,e){return(lo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var co=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=ve.map(function(t){return a(\"div\",\"\".concat(vt,\"-item\")).on(\"click\",function(){n.hide(),n.change(t)}).child(t.key)});return n=oo(this,(t=ao(e)).call.apply(t,[this,new Yt(\"formula\"),\"180px\",!0,\"bottom-left\"].concat(io(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lo(t,e)}(e,un),e}();function so(t){return(so=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function uo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fo(t,e){return!e||\"object\"!==so(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ho(t){return(ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yo(t,e){return(yo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var po=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),fo(this,ho(e).call(this,\"formula\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yo(t,e)}(e,rn),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new co}}])&&uo(n.prototype,r),i&&uo(n,i),e}();function vo(t){return(vo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function bo(t,e){return!e||\"object\"!==vo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function go(t){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mo(t,e){return(mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var wo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),bo(this,go(e).call(this,\"freeze\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mo(t,e)}(e,Mn),e}();function ko(t){return(ko=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function So(t,e){return!e||\"object\"!==ko(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function xo(t){return(xo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Eo(t,e){return(Eo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var jo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),So(this,xo(e).call(this,\"merge\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Eo(t,e)}(e,Mn),n=e,(r=[{key:\"setState\",value:function(t,e){this.el.active(t).disabled(e)}}])&&Oo(n.prototype,r),i&&Oo(n,i),e}();function _o(t){return(_o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Co(t,e){return!e||\"object\"!==_o(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function To(t){return(To=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Po(t,e){return(Po=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ao=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Co(this,To(e).call(this,\"redo\",\"Ctrl+Y\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Po(t,e)}(e,Jr),e}();function Ro(t){return(Ro=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Do(t,e){return!e||\"object\"!==Ro(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function zo(t){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Io(t,e){return(Io=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Mo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Do(this,zo(e).call(this,\"undo\",\"Ctrl+Z\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Io(t,e)}(e,Jr),e}();function Wo(t){return(Wo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Fo(t,e){return!e||\"object\"!==Wo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ho(t){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function No(t,e){return(No=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Vo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Fo(this,Ho(e).call(this,\"textwrap\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&No(t,e)}(e,Mn),e}();function qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bo(t){return(Bo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Lo(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Uo(t,e){return!e||\"object\"!==Bo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Yo(t){return(Yo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $o(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xo(t,e)}function Xo(t,e){return(Xo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ko=function(t){function e(){var t;Lo(this,e);var n=new Yt(\"ellipsis\"),r=a(\"div\",\"\".concat(vt,\"-toolbar-more\"));return(t=Uo(this,Yo(e).call(this,n,\"auto\",!1,\"bottom-right\",r))).moreBtns=r,t.contentEl.css(\"max-width\",\"420px\"),t}return $o(e,un),e}(),Jo=function(t){function e(){var t;return Lo(this,e),(t=Uo(this,Yo(e).call(this,\"more\"))).el.hide(),t}var n,r,i;return $o(e,rn),n=e,(r=[{key:\"dropdown\",value:function(){return new Ko}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&qo(n.prototype,r),i&&qo(n,i),e}();function Zo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Go(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Qo(){return a(\"div\",\"\".concat(vt,\"-toolbar-divider\"))}function ta(){var t,e,n=this.el,r=this.btns,i=this.moreEl,o=this.btns2,a=i.dd,l=a.moreBtns,c=a.contentEl;n.css(\"width\",\"\".concat(this.widthFn()-60,\"px\"));var s=n.box(),u=160,f=12,h=[],y=[];o.forEach(function(t,e){var n=Go(t,2),r=n[0],i=n[1];u+=i,e===o.length-1||u<s.width?h.push(r):(f+=i,y.push(r))}),(t=r.html(\"\")).children.apply(t,h),(e=l.html(\"\")).children.apply(e,y),c.css(\"width\",\"\".concat(f,\"px\")),y.length>0?i.show():i.hide()}var ea=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.data=e,this.change=function(){},this.widthFn=n,this.isHide=i,!i){var o=e.defaultStyle();this.items=[[this.undoEl=new Mo,this.redoEl=new Ao,this.paintformatEl=new li,this.clearformatEl=new ei],Qo(),[this.formatEl=new no],Qo(),[this.fontEl=new Bi,this.fontSizeEl=new Ai],Qo(),[this.boldEl=new $n,this.italicEl=new Gn,this.underlineEl=new cr,this.strikeEl=new rr,this.textColorEl=new yi(o.color)],Qo(),[this.fillColorEl=new mi(o.bgcolor),this.borderEl=new Br,this.mergeEl=new jo],Qo(),[this.alignEl=new Sn(o.align),this.valignEl=new Tn(o.valign),this.textwrapEl=new Vo],Qo(),[this.freezeEl=new wo,this.autofilterEl=new qn,this.formulaEl=new po,this.moreEl=new Jo]],this.el=a(\"div\",\"\".concat(vt,\"-toolbar\")),this.btns=a(\"div\",\"\".concat(vt,\"-toolbar-btns\")),this.items.forEach(function(t){Array.isArray(t)?t.forEach(function(t){r.btns.child(t.el),t.change=function(){r.change.apply(r,arguments)}}):r.btns.child(t.el)}),this.el.child(this.btns),this.reset(),setTimeout(function(){(function(){var t=this;this.btns2=[],this.items.forEach(function(e){if(Array.isArray(e))e.forEach(function(e){var n=e.el,r=n.box(),i=n.computedStyle(),o=i.marginLeft,a=i.marginRight;t.btns2.push([n,r.width+parseInt(o,10)+parseInt(a,10)])});else{var n=e.box(),r=e.computedStyle(),i=r.marginLeft,o=r.marginRight;t.btns2.push([e,n.width+parseInt(i,10)+parseInt(o,10)])}})}).call(r),ta.call(r)},0),st(window,\"resize\",function(){ta.call(r)})}}var e,n,r;return e=t,(n=[{key:\"paintformatActive\",value:function(){return this.paintformatEl.active()}},{key:\"paintformatToggle\",value:function(){this.paintformatEl.toggle()}},{key:\"trigger\",value:function(t){this[\"\".concat(t,\"El\")].click()}},{key:\"reset\",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle(),n=t.getSelectedCell();this.undoEl.setState(!t.canUndo()),this.redoEl.setState(!t.canRedo()),this.mergeEl.setState(t.canUnmerge(),!t.selector.multiple()),this.autofilterEl.setState(!t.canAutofilter());var r=e.font;this.fontEl.setState(r.name),this.fontSizeEl.setState(r.size),this.boldEl.setState(r.bold),this.italicEl.setState(r.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive()),n&&n.format&&this.formatEl.setState(n.format)}}}])&&Zo(e.prototype,n),r&&Zo(e,r),t}();function na(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ra(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ia=function(){function t(e,n){var r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"600px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.title=e,this.el=a(\"div\",\"\".concat(vt,\"-modal\")).css(\"width\",o).children(a(\"div\",\"\".concat(vt,\"-modal-header\")).children(new Yt(\"close\").on(\"click.stop\",function(){return i.hide()}),this.title),(r=a(\"div\",\"\".concat(vt,\"-modal-content\"))).children.apply(r,na(n))).hide()}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){var t=this;this.dimmer=a(\"div\",\"\".concat(vt,\"-dimmer active\")),document.body.appendChild(this.dimmer.el);var e=this.el.show().box(),n=e.width,r=e.height,i=document.documentElement,o=i.clientHeight,l=i.clientWidth;this.el.offset({left:(l-n)/2,top:(o-r)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},st(window,\"keydown\",window.xkeydownEsc)}},{key:\"hide\",value:function(){this.el.hide(),document.body.removeChild(this.dimmer.el),ut(window,\"keydown\",window.xkeydownEsc),delete window.xkeydownEsc}}])&&ra(e.prototype,n),r&&ra(e,r),t}();function oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var aa=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vchange=function(){},this.el=a(\"div\",\"\".concat(vt,\"-form-input\")),this.input=a(\"input\",\"\").css(\"width\",e).on(\"input\",function(t){return r.vchange(t)}).attr(\"placeholder\",n),this.el.child(this.input)}var e,n,r;return e=t,(n=[{key:\"hint\",value:function(t){this.input.attr(\"placeholder\",t)}},{key:\"val\",value:function(t){return this.input.val(t)}}])&&oa(e.prototype,n),r&&oa(e,r),t}();function la(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ca=function(){function t(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.key=e,this.getTitle=o,this.vchange=function(){},this.el=a(\"div\",\"\".concat(vt,\"-form-select\")),this.suggest=new Nt(n.map(function(t){return{key:t,title:i.getTitle(t)}}),function(t){i.itemClick(t.key),l(t.key),i.vchange(t.key)},r,this.el),this.el.children(this.itemEl=a(\"div\",\"input-text\").html(this.getTitle(e)),this.suggest.el).on(\"click\",function(){return i.show()})}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){this.suggest.search(\"\")}},{key:\"itemClick\",value:function(t){this.key=t,this.itemEl.html(this.getTitle(t))}},{key:\"val\",value:function(t){return void 0!==t?(this.key=t,this.itemEl.html(this.getTitle(t)),this):this.key}}])&&la(e.prototype,n),r&&la(e,r),t}();function sa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ua={number:/(^\\d+$)|(^\\d+(\\.\\d{0,4})?$)/,date:/^\\d{4}-\\d{1,2}-\\d{1,2}$/},fa=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.label=\"\",this.rule=n,r&&(this.label=a(\"label\",\"label\").css(\"width\",\"\".concat(i,\"px\")).html(r)),this.tip=a(\"div\",\"tip\").child(\"tip\").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=a(\"div\",\"\".concat(vt,\"-form-field\")).children(this.label,e.el,this.tip)}var e,n,r;return e=t,(n=[{key:\"isShow\",value:function(){return\"none\"!==this.el.css(\"display\")}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"val\",value:function(t){return this.input.val(t)}},{key:\"hint\",value:function(t){this.input.hint(t)}},{key:\"validate\",value:function(){var t=this.input,e=this.rule,n=this.tip,r=this.el,i=t.val();if(e.required&&/^\\s*$/.test(i))return n.html(V(\"validation.required\")),r.addClass(\"error\"),!1;if((e.type||e.pattern)&&!(e.pattern||ua[e.type]).test(i))return n.html(V(\"validation.notMatch\")),r.addClass(\"error\"),!1;return r.removeClass(\"error\"),!0}}])&&sa(e.prototype,n),r&&sa(e,r),t}();function ha(t){return(ha=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ya(t,e){return!e||\"object\"!==ha(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function pa(t){return(pa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function va(t,e){return(va=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var da=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=ya(this,pa(e).call(this,\"div\",\"\".concat(vt,\"-button \").concat(r)))).child(V(\"button.\".concat(t))),n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&va(t,e)}(e,o),e}();function ba(t){return(ba=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ma(t,e){return!e||\"object\"!==ba(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function wa(t){return(wa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ka(t,e){return(ka=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Oa=100,Sa=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new fa(new ca(\"cell\",[\"cell\"],\"100%\",function(t){return V(\"dataValidation.modeType.\".concat(t))}),{required:!0},\"\".concat(V(\"dataValidation.range\"),\":\"),Oa),r=new fa(new aa(\"120px\",\"E3 or E3:F12\"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\\d*)(:[A-Z]{1,2}[1-9]\\d*)?$/}),i=new fa(new ca(\"list\",[\"list\",\"number\",\"date\",\"phone\",\"email\"],\"100%\",function(t){return V(\"dataValidation.type.\".concat(t))},function(e){return t.criteriaSelected(e)}),{required:!0},\"\".concat(V(\"dataValidation.criteria\"),\":\"),Oa),o=new fa(new ca(\"be\",[\"be\",\"nbe\",\"eq\",\"neq\",\"lt\",\"lte\",\"gt\",\"gte\"],\"160px\",function(t){return V(\"dataValidation.operator.\".concat(t))},function(e){return t.criteriaOperatorSelected(e)}),{required:!0}).hide(),l=new fa(new aa(\"70px\",\"10\"),{required:!0}).hide(),c=new fa(new aa(\"70px\",\"100\"),{required:!0,type:\"number\"}).hide(),s=new fa(new aa(\"120px\",\"a,b,c\"),{required:!0}),u=new fa(new aa(\"70px\",\"10\"),{required:!0,type:\"number\"}).hide();return(t=ma(this,wa(e).call(this,V(\"contextmenu.validation\"),[a(\"div\",\"\".concat(vt,\"-form-fields\")).children(n.el,r.el),a(\"div\",\"\".concat(vt,\"-form-fields\")).children(i.el,o.el,l.el,c.el,u.el,s.el),a(\"div\",\"\".concat(vt,\"-buttons\")).children(new da(\"cancel\").on(\"click\",function(){return t.btnClick(\"cancel\")}),new da(\"remove\").on(\"click\",function(){return t.btnClick(\"remove\")}),new da(\"save\",\"primary\").on(\"click\",function(){return t.btnClick(\"save\")}))]))).mf=n,t.rf=r,t.cf=i,t.of=o,t.minvf=l,t.maxvf=c,t.vf=u,t.svf=s,t.change=function(){},t}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ka(t,e)}(e,ia),n=e,(r=[{key:\"showVf\",value:function(t){var e=\"date\"===t?\"2018-11-12\":\"10\",n=this.vf;n.input.hint(e),n.show()}},{key:\"criteriaSelected\",value:function(t){var e=this.of,n=this.minvf,r=this.maxvf,i=this.vf,o=this.svf;\"date\"===t||\"number\"===t?(e.show(),n.rule.type=t,r.rule.type=t,\"date\"===t?(n.hint(\"2018-11-12\"),r.hint(\"2019-11-12\")):(n.hint(\"10\"),r.hint(\"100\")),n.show(),r.show(),i.hide(),o.hide()):(\"list\"===t?o.show():o.hide(),i.hide(),e.hide(),n.hide(),r.hide())}},{key:\"criteriaOperatorSelected\",value:function(t){if(t){var e=this.minvf,n=this.maxvf,r=this.vf;if(\"be\"===t||\"nbe\"===t)e.show(),n.show(),r.hide();else{var i=this.cf.val();r.rule.type=i,\"date\"===i?r.hint(\"2018-11-12\"):r.hint(\"10\"),r.show(),e.hide(),n.hide()}}}},{key:\"btnClick\",value:function(t){if(\"cancel\"===t)this.hide();else if(\"remove\"===t)this.change(\"remove\"),this.hide();else if(\"save\"===t){for(var e=[\"mf\",\"rf\",\"cf\",\"of\",\"svf\",\"vf\",\"minvf\",\"maxvf\"],n=0;n<e.length;n+=1){var r=this[e[n]];if(r.isShow()&&!r.validate())return}var i=this.mf.val(),o=this.rf.val(),a=this.cf.val(),l=this.of.val(),c=this.svf.val();\"number\"!==a&&\"date\"!==a||(c=\"be\"===l||\"nbe\"===l?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change(\"save\",i,o,{type:a,operator:l,required:!1,value:c}),this.hide()}}},{key:\"setValue\",value:function(t){if(t){var e=this.mf,n=this.rf,r=this.cf,i=this.of,o=this.svf,a=this.vf,l=this.minvf,c=this.maxvf,s=t.mode,u=t.ref,f=t.validator||{type:\"list\"},h=f.type,y=f.operator,p=f.value;e.val(s||\"cell\"),n.val(u),r.val(h),i.val(y),Array.isArray(p)?(l.val(p[0]),c.val(p[1])):(o.val(p||\"\"),a.val(p||\"\")),this.criteriaSelected(h),this.criteriaOperatorSelected(y)}this.show()}}])&&ga(n.prototype,r),i&&ga(n,i),e}();function xa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ea(t){return a(\"div\",\"\".concat(vt,\"-item \").concat(t))}function ja(t){var e=this;return Ea(\"state\").child(V(\"sort.\".concat(t))).on(\"click.stop\",function(){return e.itemClick(t)})}function _a(){var t=this.filterhEl,e=this.filterValues,n=this.values;t.html(\"\".concat(e.length,\" / \").concat(n.length)),t.checked(e.length===n.length)}var Ca=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterbEl=a(\"div\",\"\".concat(vt,\"-body\")),this.filterhEl=a(\"div\",\"\".concat(vt,\"-header state\")).on(\"click.stop\",function(){return e.filterClick(0,\"all\")}),this.el=a(\"div\",\"\".concat(vt,\"-sort-filter\")).children(this.sortAscEl=ja.call(this,\"asc\"),this.sortDescEl=ja.call(this,\"desc\"),Ea(\"divider\"),a(\"div\",\"\".concat(vt,\"-filter\")).children(this.filterhEl,this.filterbEl),a(\"div\",\"\".concat(vt,\"-buttons\")).children(new da(\"cancel\").on(\"click\",function(){return e.btnClick(\"cancel\")}),new da(\"ok\",\"primary\").on(\"click\",function(){return e.btnClick(\"ok\")}))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}var e,n,r;return e=t,(n=[{key:\"btnClick\",value:function(t){if(\"ok\"===t){var e=this.ci,n=this.sort,r=this.filterValues;this.ok&&this.ok(e,n,\"in\",r)}this.hide()}},{key:\"itemClick\",value:function(t){this.sort=t;var e=this.sortAscEl,n=this.sortDescEl;e.checked(\"asc\"===t),n.checked(\"desc\"===t)}},{key:\"filterClick\",value:function(t,e){var n=this.filterbEl,r=this.filterValues,i=this.values,o=n.children();\"all\"===e?o.length===r.length?(this.filterValues=[],o.forEach(function(t){return a(t).checked(!1)})):(this.filterValues=Array.from(i),o.forEach(function(t){return a(t).checked(!0)})):a(o[t]).toggle(\"checked\")?r.push(e):r.splice(r.findIndex(function(t){return t===e}),1);_a.call(this)}},{key:\"set\",value:function(t,e,n,r){this.ci=t;var i=this.sortAscEl,o=this.sortDescEl;null!==r?(this.sort=r.order,i.checked(r.asc()),o.checked(r.desc())):(this.sortDesc=null,i.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=n?Array.from(n.value):Object.keys(e),function(t){var e=this,n=this.filterbEl,r=this.filterValues;n.html(\"\"),Object.keys(t).forEach(function(i,o){var l=t[i],c=r.includes(i)?\"checked\":\"\";n.child(a(\"div\",\"\".concat(vt,\"-item state \").concat(c)).on(\"click.stop\",function(){return e.filterClick(o,i)}).children(\"\"===i?V(\"filter.empty\"):i,a(\"div\",\"label\").html(\"(\".concat(l,\")\"))))})}.call(this,e,n),_a.call(this)}},{key:\"setOffset\",value:function(t){var e=this;this.el.offset(t).show();var n=1;ht(this.el,function(){n<=0&&e.hide(),n-=1})}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide(),ft(this.el)}}])&&xa(e.prototype,n),r&&xa(e,r),t}();function Ta(t,e){var n=a(\"div\",\"\".concat(vt,\"-toast\")),r=a(\"div\",\"\".concat(vt,\"-dimmer active\"));n.children(a(\"div\",\"\".concat(vt,\"-toast-header\")).children(new Yt(\"close\").on(\"click.stop\",function(){return document.body.removeChild(n.el),void document.body.removeChild(r.el)}),t),a(\"div\",\"\".concat(vt,\"-toast-content\")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var i=n.box(),o=i.width,l=i.height,c=document.documentElement,s=c.clientHeight,u=c.clientWidth;n.offset({left:(u-o)/2,top:(s-l)/3})}function Pa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Aa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Ra(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==n){var o=this.table,a=this.selector,l=this.toolbar;t?a.setEnd(e,n,i):a.set(e,n,r),l.reset(),o.render()}}function Da(t,e){var n=this.selector,r=this.data,i=r.rows,o=r.cols,a=Aa(n.indexes,2),l=a[0],c=a[1],s=n.range,u=s.eri,f=s.eci;if(t){var h=Aa(n.moveIndexes,2);l=h[0],c=h[1]}\"left\"===e?c>0&&(c-=1):\"right\"===e?(f!==c&&(c=f),c<o.len-1&&(c+=1)):\"up\"===e?l>0&&(l-=1):\"down\"===e?(u!==l&&(l=u),l<i.len-1&&(l+=1)):\"row-first\"===e?c=0:\"row-last\"===e?c=o.len-1:\"col-first\"===e?l=0:\"col-last\"===e&&(l=i.len-1),t&&(n.moveIndexes=[l,c]),Ra.call(this,t,l,c),function(){var t=this.data,e=this.verticalScrollbar,n=this.horizontalScrollbar,r=t.getSelectedRect(),i=r.l,o=r.t,a=r.left,l=r.top,c=r.width,s=r.height,u=this.getTableOffset();if(Math.abs(a)+c>u.width)n.move({left:i+c-u.width});else{var f=t.freezeTotalWidth();a<f&&n.move({left:i-1-f})}if(Math.abs(l)+s>u.height)e.move({top:o+s-u.height-1});else{var h=t.freezeTotalHeight();l<h&&e.move({top:o-1-h})}}.call(this)}function za(){var t=this.data,e=this.verticalScrollbar,n=this.getTableOffset().height,r=t.exceptRowTotalHeight(0,-1);e.set(n,t.rows.totalHeight()-r)}function Ia(){var t=this.data,e=this.horizontalScrollbar,n=this.getTableOffset().width;t&&e.set(n,t.cols.totalWidth())}function Ma(){var t=this.tableEl,e=this.overlayerEl,n=this.overlayerCEl,r=this.table,i=this.toolbar,o=this.selector,a=this.el,l=this.getTableOffset(),c=this.getRect();t.attr(c),e.offset(c),n.offset(l),a.css(\"width\",\"\".concat(c.width,\"px\")),za.call(this),Ia.call(this),function(){var t=this.selector,e=this.data,n=this.editor,r=Aa(e.freeze,2),i=r[0],o=r[1];if(i>0||o>0){var a=e.freezeTotalWidth(),l=e.freezeTotalHeight();n.setFreezeLengths(a,l)}t.resetAreaOffset()}.call(this),r.render(),i.reset(),o.reset()}function Wa(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function Fa(){var t=this.data,e=this.selector;t.copy(),e.showClipboard()}function Ha(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function Na(t){this.data.paste(t,function(t){return Ta(\"Tip\",t)})&&Ma.call(this)}function Va(t){var e=this,n=this.selector,r=this.data,i=this.table,o=this.sortFilter,a=t.offsetX,l=t.offsetY,c=t.target.className===\"\".concat(vt,\"-selector-corner\"),s=r.getCellRectByXY(a,l),u=s.left,f=s.top,h=s.width,y=s.height,p=s.ri,v=s.ci,d=r.autoFilter;if(d.includes(p,v)&&u+h-20<a&&f+y-20<l){var b=d.items(v,function(t,e){return r.rows.getCell(t,e)});return o.set(v,b,d.getFilter(v),d.getSort(v)),void o.setOffset({left:u,top:f+y+2})}t.shiftKey||(c?n.showAutofill(p,v):Ra.call(this,!1,p,v),yt(window,function(t){var i=r.getCellRectByXY(t.offsetX,t.offsetY);p=i.ri,v=i.ci,c?n.showAutofill(p,v):1!==t.buttons||t.shiftKey||Ra.call(e,!0,p,v,!0,!0)},function(){c&&r.autofill(n.arange,\"all\",function(t){return Ta(\"Tip\",t)})&&i.render(),n.hideAutofill(),function(){var t=this.toolbar;t.paintformatActive()&&(Na.call(this,\"format\"),Wa.call(this),t.paintformatToggle())}.call(e)})),c||1!==t.buttons||t.shiftKey&&Ra.call(this,!0,p,v)}function qa(){var t=this.editor,e=this.data.getSelectedRect(),n=this.getTableOffset(),r=\"top\";e.top>n.height/2&&(r=\"bottom\"),t.setOffset(e,r)}function Ba(){var t=this.editor,e=this.data;qa.call(this),t.setCell(e.getSelectedCell(),e.getSelectedValidator()),Wa.call(this)}function La(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"finished\",n=this.data,r=this.table;n.setSelectedCellText(t,e),\"finished\"===e&&r.render()}function Ua(t){var e=this.data;\"insert-row\"===t?e.insert(\"row\"):\"delete-row\"===t?e.delete(\"row\"):\"insert-column\"===t?e.insert(\"column\"):\"delete-column\"===t?e.delete(\"column\"):\"delete-cell\"===t?e.deleteCell():\"delete-cell-format\"===t?e.deleteCell(\"format\"):\"delete-cell-text\"===t&&e.deleteCell(\"text\"),Wa.call(this),Ma.call(this)}function Ya(t,e){var n=this.data;if(\"undo\"===t)this.undo();else if(\"redo\"===t)this.redo();else if(\"print\"===t);else if(\"paintformat\"===t)!0===e?Fa.call(this):Wa.call(this);else if(\"clearformat\"===t)Ua.call(this,\"delete-cell-format\");else if(\"link\"===t);else if(\"chart\"===t);else if(\"autofilter\"===t)(function(){this.data.autofilter(),Ma.call(this)}).call(this);else if(\"freeze\"===t)if(e){var r=n.selector,i=r.ri,o=r.ci;this.freeze(i,o)}else this.freeze(0,0);else n.setSelectedCellAttr(t,e),\"formula\"!==t||n.selector.multiple()||Ba.call(this),Ma.call(this)}function $a(){var t,e,n,r,i,o,a=this,l=this.overlayerEl,c=this.rowResizer,s=this.colResizer,u=this.verticalScrollbar,f=this.horizontalScrollbar,h=this.editor,y=this.contextMenu,p=this.data,v=this.toolbar,d=this.modalValidation,b=this.sortFilter;l.on(\"mousemove\",function(t){(function(t){if(0===t.buttons&&t.target.className!==\"\".concat(vt,\"-resizer-hover\")){var e=t.offsetX,n=t.offsetY,r=this.rowResizer,i=this.colResizer,o=this.tableEl,a=this.data,l=a.rows,c=a.cols;if(e>c.indexWidth&&n>l.height)return r.hide(),void i.hide();var s=o.box(),u=a.getCellRectByXY(t.offsetX,t.offsetY);u.ri>=0&&-1===u.ci?(u.width=c.indexWidth,r.show(u,{width:s.width})):r.hide(),-1===u.ri&&u.ci>=0?(u.height=l.height,i.show(u,{height:s.height})):i.hide()}}).call(a,t)}).on(\"mousedown\",function(t){2===t.buttons?p.xyInSelectedRect(t.offsetX,t.offsetY)?(y.setPosition(t.offsetX,t.offsetY),t.stopPropagation()):y.hide():2===t.detail?Ba.call(a):(h.clear(),Va.call(a,t))}).on(\"mousewheel.stop\",function(t){(function(t){var e=this.verticalScrollbar,n=this.data,r=e.scroll().top,i=t.deltaY,o=n.rows;if(t.detail&&(i=40*t.detail),i>0){var a=n.scroll.ri+1;a<o.len&&e.move({top:r+o.getHeight(a)-1})}else{var l=n.scroll.ri-1;l>=0&&e.move({top:0===l?0:r-o.getHeight(l)})}}).call(a,t)}),t=l.el,n=(e={move:function(t,e){(function(t,e){var n=this.verticalScrollbar,r=this.horizontalScrollbar,i=n.scroll().top,o=r.scroll().left;\"left\"===t||\"right\"===t?r.move({left:o-e}):\"up\"!==t&&\"down\"!==t||n.move({top:i-e})}).call(a,t,e)}}).move,r=e.end,i=0,o=0,st(t,\"touchstart\",function(t){var e=t.touches[0],n=e.pageX,r=e.pageY;i=n,o=r}),st(t,\"touchmove\",function(t){if(n){var e=t.changedTouches[0],r=e.pageX,a=e.pageY,l=r-i,c=a-o;(Math.abs(l)>10||Math.abs(c)>10)&&(pt(l,c,t,n),i=r,o=a),t.preventDefault()}}),st(t,\"touchend\",function(t){if(r){var e=t.changedTouches[0],n=e.pageX,a=e.pageY;pt(n-i,a-o,t,r)}}),v.change=function(t,e){return Ya.call(a,t,e)},b.ok=function(t,e,n,r){return function(t,e,n,r){this.data.setAutoFilter(t,e,n,r),Ma.call(this)}.call(a,t,e,n,r)},c.finishedFn=function(t,e){(function(t,e){var n=t.ri,r=this.table,i=this.selector;this.data.rows.setHeight(n,e),r.render(),i.resetAreaOffset(),za.call(this),qa.call(this)}).call(a,t,e)},s.finishedFn=function(t,e){(function(t,e){var n=t.ci,r=this.table,i=this.selector;this.data.cols.setWidth(n,e),r.render(),i.resetAreaOffset(),Ia.call(this),qa.call(this)}).call(a,t,e)},u.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrolly(t,function(){i.resetBRLAreaOffset(),qa.call(e),r.render()})}).call(a,t,e)},f.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrollx(t,function(){i.resetBRTAreaOffset(),qa.call(e),r.render()})}).call(a,t,e)},h.change=function(t,e){La.call(a,e,t)},d.change=function(t){if(\"save\"===t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];p.addValidation.apply(p,n)}else p.removeValidation()},y.itemClick=function(t){\"validation\"===t?d.setValue(p.getSelectedValidation()):\"copy\"===t?Fa.call(a):\"cut\"===t?Ha.call(a):\"paste\"===t?Na.call(a,\"all\"):\"paste-value\"===t?Na.call(a,\"text\"):\"paste-format\"===t?Na.call(a,\"format\"):Ua.call(a,t)},st(window,\"resize\",function(){a.reload()}),st(window,\"click\",function(t){a.focusing=l.contains(t.target)}),st(window,\"keydown\",function(t){if(a.focusing){var e=t.keyCode||t.which,n=t.key,r=t.ctrlKey,i=t.shiftKey,o=t.altKey,l=t.metaKey;if(r||l){var c=\"all\";switch(i&&(c=\"text\"),o&&(c=\"format\"),e){case 90:a.undo(),t.preventDefault();break;case 89:a.redo(),t.preventDefault();break;case 67:Fa.call(a),t.preventDefault();break;case 88:Ha.call(a),t.preventDefault();break;case 85:v.trigger(\"underline\"),t.preventDefault();break;case 86:Na.call(a,c),t.preventDefault();break;case 37:Da.call(a,i,\"row-first\"),t.preventDefault();break;case 38:Da.call(a,i,\"col-first\"),t.preventDefault();break;case 39:Da.call(a,i,\"row-last\"),t.preventDefault();break;case 40:Da.call(a,i,\"col-last\"),t.preventDefault();break;case 32:Ra.call(a,!1,-1,p.selector.ci,!1),t.preventDefault();break;case 66:v.trigger(\"bold\");break;case 73:v.trigger(\"italic\")}}else{switch(e){case 32:i&&Ra.call(a,!1,p.selector.ri,-1,!1);break;case 27:y.hide(),Wa.call(a);break;case 37:Da.call(a,i,\"left\"),t.preventDefault();break;case 38:Da.call(a,i,\"up\"),t.preventDefault();break;case 39:Da.call(a,i,\"right\"),t.preventDefault();break;case 40:Da.call(a,i,\"down\"),t.preventDefault();break;case 9:h.clear(),Da.call(a,!1,i?\"left\":\"right\"),t.preventDefault();break;case 13:h.clear(),Da.call(a,!1,i?\"up\":\"down\"),t.preventDefault();break;case 8:Ua.call(a,\"delete-cell-text\"),t.preventDefault()}\"Delete\"===n?(Ua.call(a,\"delete-cell-text\"),t.preventDefault()):e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=105||\"=\"===t.key?(La.call(a,t.key,\"input\"),Ba.call(a)):113===e&&Ba.call(a)}}})}var Xa=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t);var i=n.settings,o=i.view,l=i.showToolbar,c=i.showContextmenu;this.el=a(\"div\",\"\".concat(vt,\"-sheet\")),this.toolbar=new ea(n,o.width,!l),e.children(this.toolbar.el,this.el),this.data=n,this.tableEl=a(\"canvas\",\"\".concat(vt,\"-table\")),this.rowResizer=new bt(!1,n.rows.height),this.colResizer=new bt(!0,n.cols.minWidth),this.verticalScrollbar=new mt(!0),this.horizontalScrollbar=new mt(!1),this.editor=new re(de,function(){return r.getTableOffset()},n.rows.height),this.modalValidation=new Sa,this.contextMenu=new ce(function(){return r.getTableOffset()},!c),this.selector=new Mt(n),this.overlayerCEl=a(\"div\",\"\".concat(vt,\"-overlayer-content\")).children(this.editor.el,this.selector.el),this.overlayerEl=a(\"div\",\"\".concat(vt,\"-overlayer\")).child(this.overlayerCEl),this.sortFilter=new Ca,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.modalValidation.el,this.sortFilter.el),this.table=new Xe(this.tableEl.el,n),$a.call(this),Ma.call(this),Ra.call(this,!1,0,0)}var e,n,r;return e=t,(n=[{key:\"loadData\",value:function(t){return this.data.setData(t),Ma.call(this),this}},{key:\"freeze\",value:function(t,e){return this.data.setFreeze(t,e),Ma.call(this),this}},{key:\"undo\",value:function(){this.data.undo(),Ma.call(this)}},{key:\"redo\",value:function(){this.data.redo(),Ma.call(this)}},{key:\"reload\",value:function(){return Ma.call(this),this}},{key:\"getRect\",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:\"getTableOffset\",value:function(){var t=this.data,e=t.rows,n=t.cols,r=this.getRect(),i=r.width,o=r.height;return{width:i-n.indexWidth,height:o-e.height,left:n.indexWidth,top:e.height}}}])&&Pa(e.prototype,n),r&&Pa(e,r),t}();n(0);function Ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.d(e,\"spreadsheet\",function(){return Za});var Ja=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t);var r=e;\"string\"==typeof e&&(r=document.querySelector(e)),this.data=new ct(\"sheet1\",n);var i=a(\"div\",\"\".concat(vt)).on(\"contextmenu\",function(t){return t.preventDefault()});r.appendChild(i.el),this.sheet=new Xa(i,this.data)}var e,n,r;return e=t,r=[{key:\"locale\",value:function(t,e){B(t,e)}}],(n=[{key:\"loadData\",value:function(t){return this.sheet.loadData(t),this}},{key:\"getData\",value:function(){return this.data.getData()}},{key:\"validate\",value:function(){return this.data.validations.errors.size<=0}},{key:\"change\",value:function(t){return this.data.change=t,this}}])&&Ka(e.prototype,n),r&&Ka(e,r),t}(),Za=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ja(t,e)};window&&(window.x=window.x||{},window.x.spreadsheet=Za,window.x.spreadsheet.locale=function(t,e){return B(t,e)});e.default=Ja}]);\n//# sourceMappingURL=xspreadsheet.js.map"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <title>x-spreadsheet</title>\n<link href=\"xspreadsheet.css\" rel=\"stylesheet\"></head>\n<body onload=\"load()\">\n  <div style=\"position: fixed; right: 0; top: .3em;\">\n  <iframe src=\"https://ghbtns.com/github-btn.html?user=myliang&repo=x-spreadsheet&type=star&count=true&size=large\" frameborder=\"0\" scrolling=\"0\" width=\"160px\" height=\"30px\"></iframe>\n  </div>\n  <div id=\"x-spreadsheet-demo\"></div>\n  <script>\n    function load(){\n      const rows10 = { len: 1000 };\n      for (let i = 0; i < 1000; i += 1) {\n        rows10[i] = {\n          cells: {\n            0: { text: 'A-' + i },\n            1: { text: 'B-' + i },\n            2: { text: 'C-' + i },\n            3: { text: 'D-' + i },\n            4: { text: 'E-' + i },\n            5: { text: 'F-' + i },\n          }\n        };\n      }\n      const rows = {\n        len: 80,\n        1: {\n          cells: {\n            0: { text: 'testingtesttestetst' },\n            2: { text: 'testing' },\n          },\n        },\n        2: {\n          cells: {\n            0: { text: 'render', style: 0 },\n            1: { text: 'Hello' },\n            2: { text: 'haha', merge: [1, 1] },\n          }\n        },\n        8: {\n          cells: {\n            8: { text: 'border test', style: 0 },\n          }\n        }\n      };\n      // x_spreadsheet.locale('zh-cn');\n      var xs = x_spreadsheet('#x-spreadsheet-demo', {showToolbar: true, showGrid: true})\n        .loadData([{\n          freeze: 'B3',\n          styles: [\n            {\n              bgcolor: '#f4f5f8',\n              textwrap: true,\n              color: '#900b09',\n              border: {\n                top: ['thin', '#0366d6'],\n                bottom: ['thin', '#0366d6'],\n                right: ['thin', '#0366d6'],\n                left: ['thin', '#0366d6'],\n              },\n            },\n          ],\n          merges: [\n            'C3:D4',\n          ],\n          cols: {\n            len: 10,\n            2: { width: 200 },\n          },\n          rows,\n        }, { name: 'sheet-test', rows: rows10 }]).change((cdata) => {\n          // console.log(cdata);\n          console.log('>>>', xs.getData());\n        });\n\n      xs.on('cell-selected', (cell, ri, ci) => {\n        console.log('cell:', cell, ', ri:', ri, ', ci:', ci);\n      }).on('cell-edited', (text, ri, ci) => {\n        console.log('text:', text, ', ri: ', ri, ', ci:', ci);\n      }).on('pasted-clipboard', (data) => {\n        console.log('>>>>>data is ', data);\n      });\n\n      setTimeout(() => {\n        // xs.loadData([{ rows }]);\n        xs.cellText(14, 3, 'cell-text').reRender();\n        console.log('cell(8, 8):', xs.cell(8, 8));\n        console.log('cellStyle(8, 8):', xs.cellStyle(8, 8));\n      }, 5000);\n    }\n  </script>\n  <!--script type=\"text/javascript\" src=\"https://unpkg.com/x-data-spreadsheet@1.0.20/dist/locale/zh-cn.js\"></script-->\n<script type=\"text/javascript\" src=\"xspreadsheet.js\"></script></body>\n</html>\n"
  },
  {
    "path": "docs/locale/de.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Rückgängig machen\",redo:\"Wiederherstellen\",paintformat:\"Format kopieren/einfügen\",clearformat:\"Format löschen\",format:\"Format\",font:\"Schriftart\",fontSize:\"Schriftgrad\",fontBold:\"Fett\",fontItalic:\"Kursiv\",underline:\"Betonen\",strike:\"Streichen\",textColor:\"Text Farbe\",fillColor:\"Füllung Farbe\",border:\"Umrandung\",merge:\"Zellen verbinden\",align:\"Waagrechte Ausrichtung\",valign:\"Vertikale uitlijning\",textwrap:\"Textumbruch\",freeze:\"Zelle sperren\",formula:\"Funktionen\",more:\"Mehr\"},contextmenu:{copy:\"Kopieren\",cut:\"Ausschneiden\",paste:\"Einfügen\",pasteValue:\"Nur Werte einfügen\",pasteFormat:\"Nur Format einfügen\",insertRow:\"Zeile einfügen\",insertColumn:\"Spalte einfügen\",deleteRow:\"Zeile löschen\",deleteColumn:\"Spalte löschen\",deleteCell:\"Zelle löschen\",deleteCellText:\"Zellentext löschen\"},format:{normal:\"Regulär\",text:\"Text\",number:\"Nummer\",percent:\"Prozent\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Termin\",datetime:\"Datum Termin\",duration:\"Dauer\"},formula:{sum:\"Summe\",average:\"Durchschnittliche\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.de=r),t.default=r}]);"
  },
  {
    "path": "docs/locale/en.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=1)}([,function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Undo\",redo:\"Redo\",print:\"Print\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",fontName:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",color:\"Text color\",bgcolor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",autofilter:\"Filter\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",hide:\"Hide\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteSheet:\"Delete\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\",cellprintable:\"Enable export\",cellnonprintable:\"Disable export\",celleditable:\"Enable editing\",cellnoneditable:\"Disable editing\"},print:{size:\"Paper size\",orientation:\"Page orientation\",orientations:[\"Landscape\",\"Portrait\"]},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",eur:\"EUR\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",_if:\"IF\",and:\"AND\",or:\"OR\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{next:\"Next\",cancel:\"Cancel\",remove:\"Remove\",save:\"Save\",ok:\"OK\"},sort:{desc:\"Sort Z -> A\",asc:\"Sort A -> Z\"},filter:{empty:\"empty\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.en=r),t.default=r}]);"
  },
  {
    "path": "docs/locale/nl.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=2)}({2:function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"Ongedaan maken\",redo:\"Opnieuw uitvoeren\",paintformat:\"Opmaak kopiëren/plakken\",clearformat:\"Opmaak wissen\",format:\"Opmaak\",font:\"Lettertype\",fontSize:\"Tekengrootte\",fontBold:\"Vet\",fontItalic:\"Cursief\",underline:\"Onderstrepen\",strike:\"Doorstrepen\",textColor:\"Tekstkleur\",fillColor:\"Opvulkleur\",border:\"Randen\",merge:\"Cellen samenvoegen\",align:\"Horizontale uitlijning\",valign:\"Verticale uitlijning\",textwrap:\"Terugloop\",freeze:\"Cel bevriezen\",formula:\"Functies\",more:\"Meer\"},contextmenu:{copy:\"Kopiëren\",cut:\"Knippen\",paste:\"Plakken\",pasteValue:\"Alleen waarden plakken\",pasteFormat:\"Alleen opmaak plakken\",insertRow:\"Rij invoegen\",insertColumn:\"Kolom invoegen\",deleteRow:\"Rij verwijderen\",deleteColumn:\"Kolom verwijderen\",deleteCell:\"Cel verwijderen\",deleteCellText:\"Celtekst verwijderen\"},format:{normal:\"Standaard\",text:\"Tekst\",number:\"Nummer\",percent:\"Percentage\",rmb:\"RMB\",usd:\"USD\",date:\"Datum\",time:\"Tijdstip\",datetime:\"Datum tijd\",duration:\"Duratie\"},formula:{sum:\"Som\",average:\"Gemiddelde\",max:\"Max\",min:\"Min\",concat:\"Concat\"}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages.nl=r),t.default=r}});"
  },
  {
    "path": "docs/locale/zh-cn.js",
    "content": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=3)}({3:function(e,t,n){\"use strict\";n.r(t);const r={toolbar:{undo:\"撤销\",redo:\"恢复\",print:\"打印\",paintformat:\"格式刷\",clearformat:\"清除格式\",format:\"数据格式\",fontName:\"字体\",fontSize:\"字号\",fontBold:\"加粗\",fontItalic:\"倾斜\",underline:\"下划线\",strike:\"删除线\",color:\"字体颜色\",bgcolor:\"填充颜色\",border:\"边框\",merge:\"合并单元格\",align:\"水平对齐\",valign:\"垂直对齐\",textwrap:\"自动换行\",freeze:\"冻结\",autofilter:\"自动筛选\",formula:\"函数\",more:\"更多\"},contextmenu:{copy:\"复制\",cut:\"剪切\",paste:\"粘贴\",pasteValue:\"粘贴数据\",pasteFormat:\"粘贴格式\",hide:\"隐藏\",insertRow:\"插入行\",insertColumn:\"插入列\",deleteSheet:\"删除\",deleteRow:\"删除行\",deleteColumn:\"删除列\",deleteCell:\"删除\",deleteCellText:\"删除数据\",validation:\"数据验证\",cellprintable:\"可打印\",cellnonprintable:\"不可打印\",celleditable:\"可编辑\",cellnoneditable:\"不可编辑\"},print:{size:\"纸张大小\",orientation:\"方向\",orientations:[\"横向\",\"纵向\"]},format:{normal:\"正常\",text:\"文本\",number:\"数值\",percent:\"百分比\",rmb:\"人民币\",usd:\"美元\",eur:\"欧元\",date:\"短日期\",time:\"时间\",datetime:\"长日期\",duration:\"持续时间\"},formula:{sum:\"求和\",average:\"求平均值\",max:\"求最大值\",min:\"求最小值\",concat:\"字符拼接\",_if:\"条件判断\",and:\"和\",or:\"或\"},validation:{required:\"此值必填\",notMatch:\"此值不匹配验证规则\",between:\"此值应在 {} 和 {} 之间\",notBetween:\"此值不应在 {} 和 {} 之间\",notIn:\"此值不在列表中\",equal:\"此值应该等于 {}\",notEqual:\"此值不应该等于 {}\",lessThan:\"此值应该小于 {}\",lessThanEqual:\"此值应该小于等于 {}\",greaterThan:\"此值应该大于 {}\",greaterThanEqual:\"此值应该大于等于 {}\"},error:{pasteForMergedCell:\"无法对合并的单元格执行此操作\"},calendar:{weeks:[\"日\",\"一\",\"二\",\"三\",\"四\",\"五\",\"六\"],months:[\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\"]},button:{next:\"下一步\",cancel:\"取消\",remove:\"删除\",save:\"保存\",ok:\"确认\"},sort:{desc:\"降序\",asc:\"升序\"},filter:{empty:\"空白\"},dataValidation:{mode:\"模式\",range:\"单元区间\",criteria:\"条件\",modeType:{cell:\"单元格\",column:\"列模式\",row:\"行模式\"},type:{list:\"列表\",number:\"数字\",date:\"日期\",phone:\"手机号\",email:\"电子邮件\"},operator:{be:\"在区间\",nbe:\"不在区间\",lt:\"小于\",lte:\"小于等于\",gt:\"大于\",gte:\"大于等于\",eq:\"等于\",neq:\"不等于\"}}};window&&window.x_spreadsheet&&(window.x_spreadsheet.$messages=window.x_spreadsheet.$messages||{},window.x_spreadsheet.$messages[\"zh-cn\"]=r),t.default=r}});"
  },
  {
    "path": "docs/xspreadsheet.css",
    "content": "body {\n  margin: 0;\n}\n.x-spreadsheet {\n  font-size: 13px;\n  line-height: normal;\n  user-select: none;\n  -moz-user-select: none;\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  box-sizing: content-box;\n  background: #fff;\n  -webkit-font-smoothing: antialiased;\n}\n.x-spreadsheet textarea {\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n}\n.x-spreadsheet-sheet {\n  position: relative;\n  overflow: hidden;\n}\n.x-spreadsheet-table {\n  vertical-align: bottom;\n}\n.x-spreadsheet-tooltip {\n  font-family: inherit;\n  position: absolute;\n  padding: 5px 10px;\n  color: #fff;\n  border-radius: 1px;\n  background: #000000;\n  font-size: 12px;\n  z-index: 201;\n}\n.x-spreadsheet-tooltip:before {\n  pointer-events: none;\n  position: absolute;\n  left: calc(50% - 4px);\n  top: -4px;\n  content: \"\";\n  width: 8px;\n  height: 8px;\n  background: inherit;\n  -webkit-transform: rotate(45deg);\n  transform: rotate(45deg);\n  z-index: 1;\n  box-shadow: 1px 1px 3px -1px rgba(0, 0, 0, 0.3);\n}\n.x-spreadsheet-color-palette {\n  padding: 5px;\n}\n.x-spreadsheet-color-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 2;\n  background: #fff;\n}\n.x-spreadsheet-color-palette table td {\n  margin: 0;\n  cursor: pointer;\n  border: 1px solid transparent;\n}\n.x-spreadsheet-color-palette table td:hover {\n  border-color: #ddd;\n}\n.x-spreadsheet-color-palette table td .x-spreadsheet-color-palette-cell {\n  width: 16px;\n  height: 16px;\n}\n.x-spreadsheet-border-palette {\n  padding: 6px;\n}\n.x-spreadsheet-border-palette table {\n  margin: 0;\n  padding: 0;\n  border-collapse: separate;\n  border-spacing: 0;\n  background: #fff;\n  table-layout: fixed;\n}\n.x-spreadsheet-border-palette table td {\n  margin: 0;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left {\n  border-right: 1px solid #eee;\n  padding-right: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell {\n  width: 30px;\n  height: 30px;\n  cursor: pointer;\n  text-align: center;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell .x-spreadsheet-icon-img {\n  opacity: 0.8;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-left .x-spreadsheet-border-palette-cell:hover {\n  background-color: #eee;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right {\n  padding-left: 6px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-toolbar-btn {\n  margin-top: 0;\n  margin-bottom: 3px;\n}\n.x-spreadsheet-border-palette .x-spreadsheet-border-palette-right .x-spreadsheet-line-type {\n  position: relative;\n  left: 0;\n  top: -3px;\n}\n.x-spreadsheet-dropdown {\n  position: relative;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-content {\n  position: absolute;\n  z-index: 200;\n  background: #fff;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n}\n.x-spreadsheet-dropdown.bottom-left .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  left: 0;\n}\n.x-spreadsheet-dropdown.bottom-right .x-spreadsheet-dropdown-content {\n  top: calc(100% + 5px);\n  right: 0;\n}\n.x-spreadsheet-dropdown.top-left .x-spreadsheet-dropdown-content {\n  bottom: calc(100% + 5px);\n  left: 0;\n}\n.x-spreadsheet-dropdown.top-right .x-spreadsheet-dropdown-content {\n  bottom: calc(100% + 5px);\n  right: 0;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-title {\n  padding: 0 5px;\n  display: inline-block;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-left {\n  margin-left: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right {\n  width: 10px;\n  margin-right: 4px;\n}\n.x-spreadsheet-dropdown .x-spreadsheet-dropdown-header .x-spreadsheet-icon.arrow-right .arrow-down {\n  left: -130px;\n}\n/* resizer **/\n.x-spreadsheet-resizer {\n  position: absolute;\n  z-index: 11;\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-hover {\n  background-color: rgba(75, 137, 255, 0.25);\n}\n.x-spreadsheet-resizer .x-spreadsheet-resizer-line {\n  position: absolute;\n}\n.x-spreadsheet-resizer.horizontal {\n  cursor: row-resize;\n}\n.x-spreadsheet-resizer.horizontal .x-spreadsheet-resizer-line {\n  border-bottom: 2px dashed #4b89ff;\n  left: 0;\n  bottom: 0;\n}\n.x-spreadsheet-resizer.vertical {\n  cursor: col-resize;\n}\n.x-spreadsheet-resizer.vertical .x-spreadsheet-resizer-line {\n  border-right: 2px dashed #4b89ff;\n  top: 0;\n  right: 0;\n}\n/* scrollbar */\n.x-spreadsheet-scrollbar {\n  position: absolute;\n  bottom: 0;\n  right: 0;\n  background-color: #f4f5f8;\n  opacity: 0.9;\n  z-index: 12;\n}\n.x-spreadsheet-scrollbar.horizontal {\n  right: 15px;\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n.x-spreadsheet-scrollbar.horizontal > div {\n  height: 1px;\n  background: #ddd;\n}\n.x-spreadsheet-scrollbar.vertical {\n  bottom: 15px;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.x-spreadsheet-scrollbar.vertical > div {\n  width: 1px;\n  background: #ddd;\n}\n/* @{css-prefix}-overlayer */\n.x-spreadsheet-overlayer {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 10;\n}\n.x-spreadsheet-overlayer .x-spreadsheet-overlayer-content {\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  width: 100%;\n  height: 100%;\n}\n.x-spreadsheet-editor,\n.x-spreadsheet-selector {\n  box-sizing: content-box;\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n/* @{css-prefix}-selector */\n.x-spreadsheet-selector .hide-input {\n  position: absolute;\n  z-index: 0;\n}\n.x-spreadsheet-selector .hide-input input {\n  padding: 0;\n  width: 0;\n  border: none!important;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-area {\n  position: absolute;\n  border: 2px solid #4b89ff;\n  background: rgba(75, 137, 255, 0.1);\n  z-index: 5;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard,\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  position: absolute;\n  background: transparent;\n  z-index: 100;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-clipboard {\n  border: 2px dashed #4b89ff;\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-autofill {\n  border: 1px dashed rgba(0, 0, 0, 0.45);\n}\n.x-spreadsheet-selector .x-spreadsheet-selector-corner {\n  pointer-events: auto;\n  position: absolute;\n  cursor: crosshair;\n  font-size: 0;\n  height: 5px;\n  width: 5px;\n  right: -5px;\n  bottom: -5px;\n  border: 2px solid #ffffff;\n  background: #4b89ff;\n}\n.x-spreadsheet-editor {\n  z-index: 20;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area {\n  position: absolute;\n  text-align: left;\n  border: 2px solid #4b89ff;\n  line-height: 0;\n  z-index: 100;\n  pointer-events: auto;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area textarea {\n  box-sizing: content-box;\n  border: none;\n  padding: 0 3px;\n  outline: none;\n  resize: none;\n  text-align: start;\n  overflow-y: hidden;\n  font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n  color: inherit;\n  white-space: normal;\n  word-wrap: break-word;\n  line-height: 22px;\n  margin: 0;\n}\n.x-spreadsheet-editor .x-spreadsheet-editor-area .textline {\n  overflow: hidden;\n  visibility: hidden;\n  position: fixed;\n  top: 0;\n  left: 0;\n}\n.x-spreadsheet-item {\n  user-select: none;\n  background: 0;\n  border: 1px solid transparent;\n  outline: none;\n  height: 26px;\n  color: rgba(0, 0, 0, 0.9);\n  line-height: 26px;\n  list-style: none;\n  padding: 2px 10px;\n  cursor: default;\n  text-align: left;\n  overflow: hidden;\n}\n.x-spreadsheet-item.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-item:hover,\n.x-spreadsheet-item.active {\n  background: rgba(0, 0, 0, 0.05);\n}\n.x-spreadsheet-item.divider {\n  height: 0;\n  padding: 0;\n  margin: 5px 0;\n  border: none;\n  border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n}\n.x-spreadsheet-item .label {\n  float: right;\n  opacity: 0.65;\n  font-size: 1em;\n}\n.x-spreadsheet-item.state,\n.x-spreadsheet-header.state {\n  padding-left: 35px!important;\n  position: relative;\n}\n.x-spreadsheet-item.state:before,\n.x-spreadsheet-header.state:before {\n  content: '';\n  position: absolute;\n  width: 10px;\n  height: 10px;\n  left: 12px;\n  top: calc(50% - 5px);\n  background: rgba(0, 0, 0, 0.08);\n  border-radius: 2px;\n}\n.x-spreadsheet-item.state.checked:before,\n.x-spreadsheet-header.state.checked:before {\n  background: #4b89ff;\n}\n.x-spreadsheet-checkbox {\n  position: relative;\n  display: inline-block;\n  backface-visibility: hidden;\n  outline: 0;\n  vertical-align: baseline;\n  font-style: normal;\n  font-size: 1rem;\n  line-height: 1em;\n}\n.x-spreadsheet-checkbox > input {\n  position: absolute;\n  top: 0;\n  left: 0;\n  opacity: 0!important;\n  outline: 0;\n  z-index: -1;\n}\n.x-spreadsheet-suggest,\n.x-spreadsheet-contextmenu,\n.x-spreadsheet-sort-filter {\n  position: absolute;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n  background: #fff;\n  z-index: 100;\n  width: 260px;\n  pointer-events: auto;\n  overflow: auto;\n}\n.x-spreadsheet-suggest {\n  width: 200px;\n}\n.x-spreadsheet-filter {\n  border: 1px solid #e9e9e9;\n  font-size: 12px;\n  margin: 10px;\n}\n.x-spreadsheet-filter .x-spreadsheet-header {\n  padding: 0.5em 0.75em;\n  background: #f8f8f9;\n  border-bottom: 1px solid #e9e9e9;\n  border-left: 1px solid transparent;\n}\n.x-spreadsheet-filter .x-spreadsheet-body {\n  height: 200px;\n  overflow-y: auto;\n}\n.x-spreadsheet-filter .x-spreadsheet-body .x-spreadsheet-item {\n  height: 20px;\n  line-height: 20px;\n}\n.x-spreadsheet-sort-filter .x-spreadsheet-buttons {\n  margin: 10px;\n}\n.x-spreadsheet-toolbar,\n.x-spreadsheet-bottombar {\n  height: 40px;\n  padding: 0 30px;\n  text-align: left;\n  background: #f5f6f7;\n  display: flex;\n}\n.x-spreadsheet-bottombar {\n  position: relative;\n  border-top: 1px solid #e0e2e4;\n}\n.x-spreadsheet-bottombar .x-spreadsheet-menu > li {\n  line-height: 40px;\n  height: 40px;\n  padding-top: 0;\n  padding-bottom: 0;\n  vertical-align: middle;\n  border-right: 1px solid #e8eaed;\n}\n.x-spreadsheet-menu {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  user-select: none;\n}\n.x-spreadsheet-menu > li {\n  float: left;\n  line-height: 1.25em;\n  padding: 0.785em 1em;\n  margin: 0;\n  vertical-align: middle;\n  text-align: left;\n  font-weight: 400;\n  color: #80868b;\n  white-space: nowrap;\n  cursor: pointer;\n  transition: all 0.3s;\n  font-weight: bold;\n}\n.x-spreadsheet-menu > li.active {\n  background-color: #fff;\n  color: rgba(0, 0, 0, 0.65);\n}\n.x-spreadsheet-menu > li .x-spreadsheet-icon {\n  margin: 0 6px;\n}\n.x-spreadsheet-menu > li .x-spreadsheet-icon .x-spreadsheet-icon-img:hover {\n  opacity: 0.85;\n}\n.x-spreadsheet-menu > li .x-spreadsheet-dropdown {\n  display: inline-block;\n}\n.x-spreadsheet-toolbar {\n  border-bottom: 1px solid #e0e2e4;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btns {\n  display: inline-flex;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more {\n  padding: 0 6px 6px;\n  text-align: left;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-more .x-spreadsheet-toolbar-divider {\n  margin-top: 0;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn {\n  flex: 0 0 auto;\n  display: inline-block;\n  border: 1px solid transparent;\n  height: 26px;\n  line-height: 26px;\n  min-width: 26px;\n  margin: 6px 1px 0;\n  padding: 0;\n  text-align: center;\n  border-radius: 2px;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn:hover,\n.x-spreadsheet-toolbar .x-spreadsheet-toolbar-btn.active {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toolbar-divider {\n  display: inline-block;\n  border-right: 1px solid #e0e2e4;\n  width: 0;\n  vertical-align: middle;\n  height: 18px;\n  margin: 12px 3px 0;\n}\n.x-spreadsheet-print {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 100;\n  width: 100%;\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n.x-spreadsheet-print-bar {\n  background: #424242;\n  height: 60px;\n  line-height: 60px;\n  padding: 0 30px;\n}\n.x-spreadsheet-print-bar .-title {\n  color: #fff;\n  font-weight: bold;\n  font-size: 1.2em;\n  float: left;\n}\n.x-spreadsheet-print-bar .-right {\n  float: right;\n  margin-top: 12px;\n}\n.x-spreadsheet-print-content {\n  display: flex;\n  flex: auto;\n  flex-direction: row;\n  background: #d0d0d0;\n  height: calc(100% - 60px);\n}\n.x-spreadsheet-print-content .-sider {\n  flex: 0 0 300px;\n  width: 300px;\n  border-left: 2px solid #ccc;\n  background: #fff;\n}\n.x-spreadsheet-print-content .-content {\n  flex: auto;\n  overflow-x: auto;\n  overflow-y: scroll;\n  height: 100%;\n}\n.x-spreadsheet-canvas-card-wraper {\n  margin: 40px 20px;\n}\n.x-spreadsheet-canvas-card {\n  background: #fff;\n  margin: auto;\n  page-break-before: auto;\n  page-break-after: always;\n  box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.2);\n}\n.x-spreadsheet-calendar {\n  color: rgba(0, 0, 0, 0.65);\n  background: #ffffff;\n  user-select: none;\n}\n.x-spreadsheet-calendar .calendar-header {\n  font-weight: 700;\n  line-height: 30px;\n  text-align: center;\n  width: 100%;\n  float: left;\n  background: #f9fafb;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-left {\n  padding-left: 5px;\n  float: left;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right {\n  float: right;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a {\n  padding: 3px 0;\n  margin-right: 2px;\n  border-radius: 2px;\n}\n.x-spreadsheet-calendar .calendar-header .calendar-header-right a:hover {\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-calendar .calendar-body {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n.x-spreadsheet-calendar .calendar-body th,\n.x-spreadsheet-calendar .calendar-body td {\n  width: 14.28571429%;\n  min-width: 32px;\n  text-align: center;\n  font-weight: 700;\n  line-height: 30px;\n  padding: 0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell:hover {\n  background: #ecf6fd;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.active,\n.x-spreadsheet-calendar .calendar-body td > .cell.active:hover {\n  background: #ecf6fd;\n  color: #2185D0;\n}\n.x-spreadsheet-calendar .calendar-body td > .cell.disabled {\n  pointer-events: none;\n  opacity: 0.5;\n}\n.x-spreadsheet-datepicker {\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);\n  position: absolute;\n  left: 0;\n  top: calc(100% + 5px);\n  z-index: 10;\n  width: auto;\n}\n.x-spreadsheet-buttons {\n  display: flex;\n  justify-content: flex-end;\n}\n.x-spreadsheet-buttons .x-spreadsheet-button {\n  margin-left: 8px;\n}\n.x-spreadsheet-button {\n  display: inline-block;\n  border-radius: 3px;\n  line-height: 1em;\n  min-height: 1em;\n  white-space: nowrap;\n  text-align: center;\n  cursor: pointer;\n  font-size: 1em;\n  font-weight: 700;\n  padding: 0.75em 1em;\n  color: rgba(0, 0, 0, 0.6);\n  background: #E0E1E2;\n  text-decoration: none;\n  font-family: \"Lato\", \"proxima-nova\", \"Helvetica Neue\", Arial, sans-serif;\n  outline: none;\n  vertical-align: baseline;\n  zoom: 1;\n  user-select: none;\n  transition: all 0.1s linear;\n}\n.x-spreadsheet-button.active,\n.x-spreadsheet-button:hover {\n  background-color: #C0C1C2;\n  color: rgba(0, 0, 0, 0.8);\n}\n.x-spreadsheet-button.primary {\n  color: #fff;\n  background-color: #2185D0;\n}\n.x-spreadsheet-button.primary:hover,\n.x-spreadsheet-button.primary.active {\n  color: #fff;\n  background-color: #1678c2;\n}\n.x-spreadsheet-form-input {\n  font-size: 1em;\n  position: relative;\n  font-weight: 400;\n  display: inline-flex;\n  color: rgba(0, 0, 0, 0.87);\n}\n.x-spreadsheet-form-input input {\n  z-index: 1;\n  margin: 0;\n  max-width: 100%;\n  flex: 1 0 auto;\n  outline: 0;\n  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n  text-align: left;\n  line-height: 30px;\n  height: 30px;\n  padding: 0 8px;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 3px;\n  transition: box-shadow 0.1s ease, border-color 0.1s ease;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-input input:focus {\n  border-color: #4b89ff;\n  box-shadow: inset 0 1px 2px rgba(75, 137, 255, 0.2);\n}\n.x-spreadsheet-form-select {\n  position: relative;\n  display: inline-block;\n  background: #fff;\n  border: 1px solid #e9e9e9;\n  border-radius: 2px;\n  cursor: pointer;\n  color: rgba(0, 0, 0, 0.87);\n  user-select: none;\n  box-shadow: inset 0 1px 2px hsla(0, 0%, 4%, 0.06);\n}\n.x-spreadsheet-form-select .input-text {\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  min-width: 60px;\n  width: auto;\n  height: 30px;\n  line-height: 30px;\n  padding: 0 8px;\n}\n.x-spreadsheet-form-fields {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field {\n  flex: 0 1 auto;\n}\n.x-spreadsheet-form-fields .x-spreadsheet-form-field .label {\n  display: inline-block;\n  margin: 0 10px 0 0;\n}\n.x-spreadsheet-form-field {\n  display: block;\n  vertical-align: middle;\n  margin-left: 10px;\n  margin-bottom: 10px;\n}\n.x-spreadsheet-form-field:first-child {\n  margin-left: 0;\n}\n.x-spreadsheet-form-field.error .x-spreadsheet-form-select,\n.x-spreadsheet-form-field.error input {\n  border-color: #f04134;\n}\n.x-spreadsheet-form-field .tip {\n  color: #f04134;\n  font-size: 0.9em;\n}\n.x-spreadsheet-dimmer {\n  display: none;\n  position: absolute;\n  top: 0 !important;\n  left: 0 !important;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  vertical-align: middle;\n  background-color: rgba(0, 0, 0, 0.6);\n  opacity: 0;\n  -webkit-animation-fill-mode: both;\n  animation-fill-mode: both;\n  -webkit-animation-duration: 0.5s;\n  animation-duration: 0.5s;\n  transition: background-color 0.5s linear;\n  user-select: none;\n  z-index: 1000;\n}\n.x-spreadsheet-dimmer.active {\n  display: block;\n  opacity: 1;\n}\nform fieldset {\n  border: none;\n}\nform fieldset label {\n  display: block;\n  margin-bottom: 0.5em;\n  font-size: 1em;\n  color: #666;\n}\nform fieldset select {\n  font-size: 1.1em;\n  width: 100%;\n  background-color: #fff;\n  border: none;\n  border-bottom: 2px solid #ddd;\n  padding: 0.5em 0.85em;\n  border-radius: 2px;\n}\n.x-spreadsheet-modal,\n.x-spreadsheet-toast {\n  font-size: 13px;\n  position: fixed;\n  z-index: 1001;\n  text-align: left;\n  line-height: 1.25em;\n  min-width: 360px;\n  color: rgba(0, 0, 0, 0.87);\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  border-radius: 4px;\n  border: 1px solid rgba(0, 0, 0, 0.1);\n  background-color: #fff;\n  background-clip: padding-box;\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px;\n}\n.x-spreadsheet-toast {\n  background-color: rgba(255, 255, 255, 0.85);\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-toast-header {\n  font-weight: 600;\n  background-clip: padding-box;\n  background-color: rgba(255, 255, 255, 0.85);\n  border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n  border-radius: 4px 4px 0 0;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon,\n.x-spreadsheet-toast-header .x-spreadsheet-icon {\n  position: absolute;\n  right: 0.8em;\n  top: 0.65em;\n  border-radius: 18px;\n}\n.x-spreadsheet-modal-header .x-spreadsheet-icon:hover,\n.x-spreadsheet-toast-header .x-spreadsheet-icon:hover {\n  opacity: 1;\n  background: rgba(0, 0, 0, 0.08);\n}\n.x-spreadsheet-toast-header {\n  color: #F2711C;\n}\n.x-spreadsheet-modal-header {\n  border-bottom: 1px solid #e0e2e4;\n  background: rgba(0, 0, 0, 0.08);\n  font-size: 1.0785em;\n}\n.x-spreadsheet-modal-header,\n.x-spreadsheet-modal-content,\n.x-spreadsheet-toast-header,\n.x-spreadsheet-toast-content {\n  padding: 0.75em 1em;\n}\n@media screen and (min-width: 320px) and (max-width: 480px) {\n  .x-spreadsheet-toolbar {\n    display: none;\n  }\n}\n.x-spreadsheet-icon {\n  width: 18px;\n  height: 18px;\n  margin: 1px 1px 2px 1px;\n  text-align: center;\n  vertical-align: middle;\n  user-select: none;\n  overflow: hidden;\n  position: relative;\n  display: inline-block;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img {\n  background-image: url(58eaeb4e52248a5c75936c6f4c33a370.svg);\n  position: absolute;\n  width: 262px;\n  height: 444px;\n  opacity: 0.56;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.undo {\n  left: 0;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.redo {\n  left: -18px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.print {\n  left: -36px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.paintformat {\n  left: -54px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.clearformat {\n  left: -72px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-bold {\n  left: -90px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.font-italic {\n  left: -108px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.underline {\n  left: -126px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.strike {\n  left: -144px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.color {\n  left: -162px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.bgcolor {\n  left: -180px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.merge {\n  left: -198px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-left {\n  left: -216px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-center {\n  left: -234px;\n  top: 0;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-right {\n  left: 0;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-top {\n  left: -18px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-middle {\n  left: -36px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.align-bottom {\n  left: -54px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.textwrap {\n  left: -72px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.autofilter {\n  left: -90px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.formula {\n  left: -108px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-down {\n  left: -126px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.arrow-right {\n  left: -144px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.link {\n  left: -162px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chart {\n  left: -180px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.freeze {\n  left: -198px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.ellipsis {\n  left: -216px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.add {\n  left: -234px;\n  top: -18px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-all {\n  left: 0;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-inside {\n  left: -18px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-horizontal {\n  left: -36px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-vertical {\n  left: -54px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-outside {\n  left: -72px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-left {\n  left: -90px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-top {\n  left: -108px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-right {\n  left: -126px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-bottom {\n  left: -144px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.border-none {\n  left: -162px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-color {\n  left: -180px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.line-type {\n  left: -198px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.close {\n  left: -234px;\n  top: -36px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-down {\n  left: 0;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-up {\n  left: -18px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-left {\n  left: -36px;\n  top: -54px;\n}\n.x-spreadsheet-icon .x-spreadsheet-icon-img.chevron-right {\n  left: -54px;\n  top: -54px;\n}\n\n\n/*# sourceMappingURL=xspreadsheet.css.map*/"
  },
  {
    "path": "docs/xspreadsheet.js",
    "content": "!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=2)}([function(t,e){},function(t,e,n){},function(t,e,n){\"use strict\";function r(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e);var o=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),\"string\"==typeof e?(this.el=document.createElement(e),this.el.className=n):this.el=e,this.data={}}var e,n,o;return e=t,(n=[{key:\"data\",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:\"on\",value:function(t,e){var n=r(t.split(\".\")),i=n[0],o=n.slice(1),a=i;return\"mousewheel\"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a=\"DOMMouseScroll\"),this.el.addEventListener(a,function(t){e(t);for(var n=0;n<o.length;n+=1){var r=o[n];if(\"left\"===r&&0!==t.button)return;if(\"right\"===r&&2!==t.button)return;\"stop\"===r&&t.stopPropagation()}}),this}},{key:\"offset\",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach(function(n){e.css(n,\"\".concat(t[n],\"px\"))}),this;var n=this.el;return{top:n.offsetTop,left:n.offsetLeft,height:n.offsetHeight,width:n.offsetWidth}}},{key:\"scroll\",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:\"box\",value:function(){return this.el.getBoundingClientRect()}},{key:\"parent\",value:function(){return new t(this.el.parentNode)}},{key:\"children\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===arguments.length?this.el.childNodes:(n.forEach(function(e){return t.child(e)}),this)}},{key:\"removeChild\",value:function(t){this.el.removeChild(t)}},{key:\"child\",value:function(e){var n=e;return\"string\"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),this.el.appendChild(n),this}},{key:\"contains\",value:function(t){return this.el.contains(t)}},{key:\"className\",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:\"addClass\",value:function(t){return this.el.classList.add(t),this}},{key:\"hasClass\",value:function(t){return this.el.classList.contains(t)}},{key:\"removeClass\",value:function(t){return this.el.classList.remove(t),this}},{key:\"toggle\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"active\";return this.toggleClass(t)}},{key:\"toggleClass\",value:function(t){return this.el.classList.toggle(t)}},{key:\"active\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"active\";return t?this.addClass(e):this.removeClass(e),this}},{key:\"checked\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,\"checked\"),this}},{key:\"disabled\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.addClass(\"disabled\"):this.removeClass(\"disabled\"),this}},{key:\"attr\",value:function(t,e){var n=this;if(void 0!==e)this.el.setAttribute(t,e);else{if(\"string\"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach(function(e){n.el.setAttribute(e,t[e])})}return this}},{key:\"removeAttr\",value:function(t){return this.el.removeAttribute(t),this}},{key:\"html\",value:function(t){return void 0!==t?(this.el.innerHTML=t,this):this.el.innerHTML}},{key:\"val\",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:\"focus\",value:function(){this.el.focus()}},{key:\"cssRemoveKeys\",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){return t.el.style.removeProperty(e)}),this}},{key:\"css\",value:function(t,e){var n=this;return void 0===e&&\"string\"!=typeof t?(Object.keys(t).forEach(function(e){n.el.style[e]=t[e]}),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:\"computedStyle\",value:function(){return window.getComputedStyle(this.el,null)}},{key:\"show\",value:function(){return this.css(\"display\",\"block\"),this}},{key:\"hide\",value:function(){return this.css(\"display\",\"none\"),this}}])&&i(e.prototype,n),o&&i(e,o),t}(),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return new o(t,e)};n(0);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var c=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];function s(t){for(var e=\"\",n=t;n>=c.length;)n/=c.length,n-=1,e+=c[parseInt(n,10)%c.length];var r=t%c.length;return e+=c[r]}function u(t){for(var e=0,n=0;n<t.length-1;n+=1){var r=t.charCodeAt(n)-65,i=t.length-1-n;e+=Math.pow(c.length,i)+c.length*r}return e+=t.charCodeAt(t.length-1)-65}function f(t){for(var e=\"\",n=\"\",r=0;r<t.length;r+=1)t.charAt(r)>=\"0\"&&t.charAt(r)<=\"9\"?n+=t.charAt(r):e+=t.charAt(r);return[u(e),parseInt(n,10)-1]}function h(t,e){return\"\".concat(s(t)).concat(e+1)}function p(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===n)return t;var i=l(f(t),2),o=i[0],a=i[1];return r(o,a)?h(o+e,a+n):t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var v=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.sri=e,this.sci=n,this.eri=r,this.eci=i,this.w=o,this.h=a}var e,n,r;return e=t,r=[{key:\"valueOf\",value:function(e){var n=e.split(\":\"),r=d(f(n[0]),2),i=r[0],o=r[1],a=o,l=i;if(n.length>1){var c=d(f(n[1]),2);l=c[0],a=c[1]}return new t(o,i,a,l)}}],(n=[{key:\"set\",value:function(t,e,n,r){this.sri=t,this.sci=e,this.eri=n,this.eci=r}},{key:\"multiple\",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:\"includes\",value:function(){for(var t=0,e=0,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(1===r.length){var o=f(r[0]),a=d(o,2);e=a[0],t=a[1]}else 2===r.length&&(t=r[0],e=r[1]);var l=this.sri,c=this.sci,s=this.eri,u=this.eci;return l<=t&&t<=s&&c<=e&&e<=u}},{key:\"each\",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=n;a<=i;a+=1)if(e(a))for(var l=r;l<=o;l+=1)t(a,l)}},{key:\"contains\",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:\"within\",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:\"disjoint\",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:\"intersects\",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:\"union\",value:function(e){var n=this.sri,r=this.sci,i=this.eri,o=this.eci;return new t(e.sri<n?e.sri:n,e.sci<r?e.sci:r,e.eri>i?e.eri:i,e.eci>o?e.eci:o)}},{key:\"difference\",value:function(e){var n=[],r=function(e,r,i,o){n.push(new t(e,r,i,o))},i=this.sri,o=this.sci,a=this.eri,l=this.eci,c=e.sri-i,s=e.sci-o,u=a-e.eri,f=l-e.eci;return c>0?(r(i,o,e.sri-1,l),u>0?(r(e.eri+1,o,a,l),s>0&&r(e.sri,o,e.eri,e.sci-1),f>0&&r(e.sri,e.eci+1,e.eri,l)):(s>0&&r(e.sri,o,a,e.sci-1),f>0&&r(e.sri,e.eci+1,a,l))):u>0&&(r(e.eri+1,o,a,l),s>0&&r(i,o,e.eri,e.sci-1),f>0&&r(i,e.eci+1,e.eri,l)),s>0?(r(i,o,a,e.sci-1),f>0?(r(i,e.eri+1,a,l),c>0&&r(i,e.sci,e.sri-1,e.eci),u>0&&r(e.sri+1,e.sci,a,e.eci)):(c>0&&r(i,e.sci,e.sri-1,l),u>0&&r(e.sri+1,e.sci,a,l))):f>0&&(r(a,e.eci+1,a,l),c>0&&r(i,o,e.sri-1,e.eci),u>0&&r(e.eri+1,o,a,e.eci)),n}},{key:\"size\",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:\"toString\",value:function(){var t=this.sri,e=this.sci,n=this.eri,r=this.eci,i=h(e,t);return this.multiple()&&(i=\"\".concat(i,\":\").concat(h(r,n))),i}},{key:\"clone\",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:\"equals\",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}])&&y(e.prototype,n),r&&y(e,r),t}();function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var g=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=new v(0,0,0,0),this.ri=0,this.ci=0}var e,n,r;return e=t,(n=[{key:\"multiple\",value:function(){return this.range.multiple()}},{key:\"setIndexes\",value:function(t,e){this.ri=t,this.ci=e}},{key:\"size\",value:function(){return this.range.size()}}])&&b(e.prototype,n),r&&b(e,r),t}();var m=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0};function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var k=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.undoItems=[],this.redoItems=[]}var e,n,r;return e=t,(n=[{key:\"add\",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:\"canUndo\",value:function(){return this.undoItems.length>0}},{key:\"canRedo\",value:function(){return this.redoItems.length>0}},{key:\"undo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canUndo()&&(r.push(JSON.stringify(t)),e(JSON.parse(n.pop())))}},{key:\"redo\",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canRedo()&&(n.push(JSON.stringify(t)),e(JSON.parse(r.pop())))}}])&&w(e.prototype,n),r&&w(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var S=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.range=null,this.state=\"clear\"}var e,n,r;return e=t,(n=[{key:\"copy\",value:function(t){return this.range=t,this.state=\"copy\",this}},{key:\"cut\",value:function(t){return this.range=t,this.state=\"cut\",this}},{key:\"isCopy\",value:function(){return\"copy\"===this.state}},{key:\"isCut\",value:function(){return\"cut\"===this.state}},{key:\"isClear\",value:function(){return\"clear\"===this.state}},{key:\"clear\",value:function(){this.range=null,this.state=\"clear\"}}])&&O(e.prototype,n),r&&O(e,r),t}();function x(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function j(t,e,n){return e&&E(t.prototype,e),n&&E(t,n),t}var _=function(){function t(e,n,r){x(this,t),this.ci=e,this.operator=n,this.value=r}return j(t,[{key:\"set\",value:function(t,e){this.operator=t,this.value=e}},{key:\"includes\",value:function(t){var e=this.operator,n=this.value;return\"all\"===e||\"in\"===e&&n.includes(t)}},{key:\"vlength\",value:function(){var t=this.operator,e=this.value;return\"in\"===t?e.length:0}},{key:\"getData\",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),C=function(){function t(e,n){x(this,t),this.ci=e,this.order=n}return j(t,[{key:\"asc\",value:function(){return\"asc\"===this.order}},{key:\"desc\",value:function(){return\"desc\"===this.order}}]),t}(),T=function(){function t(){x(this,t),this.ref=null,this.filters=[],this.sort=null}return j(t,[{key:\"setData\",value:function(t){var e=t.ref,n=t.filters,r=t.sort;null!=e&&(this.ref=e,this.fitlers=n.map(function(t){return new _(t.ci,t.operator,t.value)}),r&&(this.sort=new C(r.ci,r.order)))}},{key:\"getData\",value:function(){if(this.active()){var t=this.ref,e=this.filters,n=this.sort;return{ref:t,filters:e.map(function(t){return t.getData()}),sort:n}}return{}}},{key:\"addFilter\",value:function(t,e,n){var r=this.getFilter(t);null==r?this.filters.push(new _(t,e,n)):r.set(e,n)}},{key:\"setSort\",value:function(t,e){this.sort=e?new C(t,e):null}},{key:\"includes\",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:\"getSort\",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:\"getFilter\",value:function(t){for(var e=this.filters,n=0;n<e.length;n+=1)if(e[n].ci===t)return e[n];return null}},{key:\"filteredRows\",value:function(t){var e=new Set,n=new Set;if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=this.filters,l=i+1;l<=o;l+=1)for(var c=0;c<a.length;c+=1){var s=a[c],u=t(l,s.ci),f=u?u.text:\"\";if(!s.includes(f)){e.add(l);break}n.add(l)}return{rset:e,fset:n}}},{key:\"items\",value:function(t,e){var n={};if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=i+1;a<=o;a+=1){var l=e(a,t);if(null===l||/^\\s*$/.test(l.text))n[\"\"]=(n[\"\"]||0)+1;else{var c=l.text,s=(n[c]||0)+1;n[c]=s}}return n}},{key:\"range\",value:function(){return v.valueOf(this.ref)}},{key:\"hrange\",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:\"clear\",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:\"active\",value:function(){return null!==this.ref}}]),t}();function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._=e}var e,n,r;return e=t,(n=[{key:\"forEach\",value:function(t){this._.forEach(t)}},{key:\"deleteWithin\",value:function(t){this._=this._.filter(function(e){return!e.within(t)})}},{key:\"getFirstIncludes\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"filterIntersects\",value:function(e){return new t(this._.filter(function(t){return t.intersects(e)}))}},{key:\"intersects\",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:\"union\",value:function(t){var e=t;return this._.forEach(function(t){t.intersects(e)&&(e=t.union(e))}),e}},{key:\"add\",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:\"shift\",value:function(t,e,n,r){this._.forEach(function(i){var o=i.sri,a=i.sci,l=i.eri,c=i.eci,s=i;\"row\"===t?o>=e?(s.sri+=n,s.eri+=n):o<e&&e<=l&&(s.eri+=n,r(o,a,n,0)):\"column\"===t&&(a>=e?(s.sci+=n,s.eci+=n):a<e&&e<=c&&(s.eci+=n,r(o,a,0,n)))})}},{key:\"move\",value:function(t,e,n){this._.forEach(function(r){var i=r;i.within(t)&&(i.eri+=e,i.sri+=e,i.sci+=n,i.eci+=n)})}},{key:\"setData\",value:function(t){return this._=t.map(function(t){return v.valueOf(t)}),this}},{key:\"getData\",value:function(){return this._.map(function(t){return t.toString()})}}])&&P(e.prototype,n),r&&P(e,r),t}();var R=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach(function(n){Object.keys(n).forEach(function(r){var i=n[r];\"string\"==typeof i||\"number\"==typeof i||\"boolean\"==typeof i?e[r]=i:\"function\"!=typeof i&&!Array.isArray(i)&&i instanceof Object?(e[r]=e[r]||{},t(e[r],i)):e[r]=i})}),e};function I(t){for(var e=\"\".concat(t),n=0,r=!1,i=0;i<e.length;i+=1)!0===r&&(n+=1),\".\"===e.charAt(i)&&(r=!0);return n}function D(t,e,n){if(Number.isNaN(e)||Number.isNaN(n))return e+t+n;var r=I(e),i=I(n),o=Number(e),a=Number(n),l=0;if(\"-\"===t)l=o-a;else if(\"+\"===t)l=o+a;else if(\"*\"===t)l=o*a;else if(\"/\"===t)return I(l=o/a)>5?l.toFixed(2):l;return l.toFixed(Math.max(r,i))}var z={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return R.apply(void 0,[{}].concat(e))},equals:function t(e,n){var r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(var i=0;i<r.length;i+=1){var o=r[i],a=e[o],l=n[o];if(void 0===l)return!1;if(\"string\"==typeof a||\"number\"==typeof a||\"boolean\"==typeof a){if(a!==l)return!1}else if(Array.isArray(a)){if(a.length!==l.length)return!1;for(var c=0;c<a.length;c+=1)if(!t(a[c],l[c]))return!1}else if(\"function\"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,l))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=0,r=0;return Object.keys(t).forEach(function(i){n+=e(t[i],i),r+=1}),[n,r]},rangeEach:function(t,e,n){for(var r=t;r<e;r+=1)n(r)},rangeSum:function(t,e,n){for(var r=0,i=t;i<e;i+=1)r+=n(i);return r},rangeReduceIf:function(t,e,n,r,i,o){for(var a=n,l=r,c=t;c<e&&!(a>i);c+=1)a+=l=o(c);return[c,a-l,l]},deleteProperty:function(t,e){var n=t[\"\".concat(e)];return delete t[\"\".concat(e)],n},numberCalc:D};function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N=function(){function t(e){var n=e.len,r=e.height;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.height=r}var e,n,r;return e=t,(n=[{key:\"getHeight\",value:function(t){if(this.isHide(t))return 0;var e=this.get(t);return e&&e.height?e.height:this.height}},{key:\"setHeight\",value:function(t,e){this.getOrNew(t).height=e}},{key:\"unhide\",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:\"isHide\",value:function(t){var e=this.get(t);return e&&e.hide}},{key:\"setHide\",value:function(t,e){var n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumHeight\",value:function(t,e,n){var r=this;return z.rangeSum(t,e,function(t){return n&&n.has(t)?0:r.getHeight(t)})}},{key:\"totalHeight\",value:function(){return this.sumHeight(0,this.len)}},{key:\"get\",value:function(t){return this._[t]}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:\"getCell\",value:function(t,e){var n=this.get(t);return void 0!==n&&void 0!==n.cells&&void 0!==n.cells[e]?n.cells[e]:null}},{key:\"getCellMerge\",value:function(t,e){var n=this.getCell(t,e);return n&&n.merge?n.merge:[0,0]}},{key:\"getCellOrNew\",value:function(t,e){var n=this.getOrNew(t);return n.cells[e]=n.cells[e]||{},n.cells[e]}},{key:\"setCell\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"all\",i=this.getOrNew(t);\"all\"===r?i.cells[e]=n:\"text\"===r?(i.cells[e]=i.cells[e]||{},i.cells[e].text=n.text):\"format\"===r&&(i.cells[e]=i.cells[e]||{},i.cells[e].style=n.style,n.merge&&(i.cells[e].merge=n.merge))}},{key:\"setCellText\",value:function(t,e,n){this.getCellOrNew(t,e).text=n}},{key:\"copyPaste\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=e.sri,u=e.sci,f=e.eri,h=e.eci,d=t.size(),y=H(d,2),v=y[0],b=y[1],g=e.size(),m=H(g,2),w=m[0],k=m[1],O=!0,S=0;(f<o||h<a)&&(O=!1,S=f<o?w:k);for(var x=o;x<=l;x+=1)if(this._[x])for(var E=a;E<=c;E+=1)if(this._[x].cells&&this._[x].cells[E])for(var j=s;j<=f;j+=v)for(var _=u;_<=h;_+=b){var C=j+(x-o),T=_+(E-a),P=z.cloneDeep(this._[x].cells[E]);r&&P&&P.text&&P.text.length>0&&function(){var t=P.text,e=_-u+(j-s)+2;if(O||(e-=S+1),\"=\"===t[0])P.text=t.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){var n=0,r=0;return o===s?n=e-1:r=e-1,/^\\d+$/.test(t)?t:p(t,n,r)});else if(v<=1&&b>1&&(s>l||f<o)||b<=1&&v>1&&(u>c||h<a)||v<=1&&b<=1){var n=/[\\\\.\\d]+$/.exec(t);if(null!==n){var r=Number(n[0])+e-1;P.text=t.substring(0,n.index)+r}}}(),this.setCell(C,T,P,n),i(C,T,P)}}},{key:\"cutPaste\",value:function(t,e){var n=this,r={};this.each(function(i){n.eachCells(i,function(o){var a=parseInt(i,10),l=parseInt(o,10);t.includes(i,o)&&(a=e.sri+(a-t.sri),l=e.sci+(l-t.sci)),r[a]=r[a]||{cells:{}},r[a].cells[l]=n._[i].cells[o]})}),this._=r}},{key:\"paste\",value:function(t,e){var n=this;if(!(t.length<=0)){var r=e.sri,i=e.sci;t.forEach(function(t,e){var o=r+e;t.forEach(function(t,e){var r=i+e;n.setCellText(o,r,t)})})}}},{key:\"insert\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r={};this.each(function(i,o){var a=parseInt(i,10);a>=t&&(a+=n,e.eachCells(i,function(e,r){r.text&&\"=\"===r.text[0]&&(r.text=r.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(e){return p(e,0,n,function(e,n){return n>=t})}))})),r[a]=o}),this._=r,this.len+=n}},{key:\"delete\",value:function(t,e){var n=this,r=e-t+1,i={};this.each(function(o,a){var l=parseInt(o,10);l<t?i[l]=a:o>e&&(i[l-r]=a,n.eachCells(o,function(t,n){n.text&&\"=\"===n.text[0]&&(n.text=n.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){return p(t,0,-r,function(t,n){return n>e})}))}))}),this._=i,this.len-=r}},{key:\"insertColumn\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.each(function(r,i){var o={};e.eachCells(r,function(e,r){var i=parseInt(e,10);i>=t&&(i+=n,r.text&&\"=\"===r.text[0]&&(r.text=r.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(e){return p(e,n,0,function(e){return e>=t})}))),o[i]=r}),i.cells=o})}},{key:\"deleteColumn\",value:function(t,e){var n=this,r=e-t+1;this.each(function(i,o){var a={};n.eachCells(i,function(n,i){var o=parseInt(n,10);o<t?a[o]=i:o>e&&(a[o-r]=i,i.text&&\"=\"===i.text[0]&&(i.text=i.text.replace(/[a-zA-Z]{1,3}\\d+/g,function(t){return p(t,-r,0,function(t){return t>e})})))}),o.cells=a})}},{key:\"deleteCells\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"all\";t.each(function(t,r){e.deleteCell(t,r,n)})}},{key:\"deleteCell\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"all\",r=this.get(t);if(null!==r){var i=this.getCell(t,e);null!==i&&(\"all\"===n?delete r.cells[e]:\"text\"===n?(i.text&&delete i.text,i.value&&delete i.value):\"format\"===n?(void 0!==i.style&&delete i.style,i.merge&&delete i.merge):\"merge\"===n&&i.merge&&delete i.merge)}}},{key:\"maxCell\",value:function(){var t=Object.keys(this._),e=t[t.length-1],n=this._[e];if(n){var r=n.cells,i=Object.keys(r),o=i[i.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:\"each\",value:function(t){Object.entries(this._).forEach(function(e){var n=H(e,2),r=n[0],i=n[1];t(r,i)})}},{key:\"eachCells\",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach(function(t){var n=H(t,2),r=n[0],i=n[1];e(r,i)})}},{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}}])&&M(e.prototype,n),r&&M(e,r),t}();function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=e.len,r=e.width,i=e.indexWidth,o=e.minWidth;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this._={},this.len=n,this.width=r,this.indexWidth=i,this.minWidth=o}var e,n,r;return e=t,(n=[{key:\"setData\",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:\"getData\",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:\"getWidth\",value:function(t){if(this.isHide(t))return 0;var e=this._[t];return e&&e.width?e.width:this.width}},{key:\"getOrNew\",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:\"setWidth\",value:function(t,e){this.getOrNew(t).width=e}},{key:\"unhide\",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:\"isHide\",value:function(t){var e=this._[t];return e&&e.hide}},{key:\"setHide\",value:function(t,e){var n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:\"setStyle\",value:function(t,e){this.getOrNew(t).style=e}},{key:\"sumWidth\",value:function(t,e){var n=this;return z.rangeSum(t,e,function(t){return n.getWidth(t)})}},{key:\"totalWidth\",value:function(){return this.sumWidth(0,this.len)}}])&&F(e.prototype,n),r&&F(e,r),t}(),V=\"en\",q={en:{toolbar:{undo:\"Undo\",redo:\"Redo\",print:\"Print\",paintformat:\"Paint format\",clearformat:\"Clear format\",format:\"Format\",fontName:\"Font\",fontSize:\"Font size\",fontBold:\"Font bold\",fontItalic:\"Font italic\",underline:\"Underline\",strike:\"Strike\",color:\"Text color\",bgcolor:\"Fill color\",border:\"Borders\",merge:\"Merge cells\",align:\"Horizontal align\",valign:\"Vertical align\",textwrap:\"Text wrapping\",freeze:\"Freeze cell\",autofilter:\"Filter\",formula:\"Functions\",more:\"More\"},contextmenu:{copy:\"Copy\",cut:\"Cut\",paste:\"Paste\",pasteValue:\"Paste values only\",pasteFormat:\"Paste format only\",hide:\"Hide\",insertRow:\"Insert row\",insertColumn:\"Insert column\",deleteSheet:\"Delete\",deleteRow:\"Delete row\",deleteColumn:\"Delete column\",deleteCell:\"Delete cell\",deleteCellText:\"Delete cell text\",validation:\"Data validations\",cellprintable:\"Enable export\",cellnonprintable:\"Disable export\",celleditable:\"Enable editing\",cellnoneditable:\"Disable editing\"},print:{size:\"Paper size\",orientation:\"Page orientation\",orientations:[\"Landscape\",\"Portrait\"]},format:{normal:\"Normal\",text:\"Plain Text\",number:\"Number\",percent:\"Percent\",rmb:\"RMB\",usd:\"USD\",eur:\"EUR\",date:\"Date\",time:\"Time\",datetime:\"Date time\",duration:\"Duration\"},formula:{sum:\"Sum\",average:\"Average\",max:\"Max\",min:\"Min\",_if:\"IF\",and:\"AND\",or:\"OR\",concat:\"Concat\"},validation:{required:\"it must be required\",notMatch:\"it not match its validation rule\",between:\"it is between {} and {}\",notBetween:\"it is not between {} and {}\",notIn:\"it is not in list\",equal:\"it equal to {}\",notEqual:\"it not equal to {}\",lessThan:\"it less than {}\",lessThanEqual:\"it less than or equal to {}\",greaterThan:\"it greater than {}\",greaterThanEqual:\"it greater than or equal to {}\"},error:{pasteForMergedCell:\"Unable to do this for merged cells\"},calendar:{weeks:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]},button:{next:\"Next\",cancel:\"Cancel\",remove:\"Remove\",save:\"Save\",ok:\"OK\"},sort:{desc:\"Sort Z -> A\",asc:\"Sort A -> Z\"},filter:{empty:\"empty\"},dataValidation:{mode:\"Mode\",range:\"Cell Range\",criteria:\"Criteria\",modeType:{cell:\"Cell\",column:\"Colun\",row:\"Row\"},type:{list:\"List\",number:\"Number\",date:\"Date\",phone:\"Phone\",email:\"Email\"},operator:{be:\"between\",nbe:\"not betwwen\",lt:\"less than\",lte:\"less than or equal to\",gt:\"greater than\",gte:\"greater than or equal to\",eq:\"equal to\",neq:\"not equal to\"}}}};function B(t,e){if(e&&e[V])for(var n=e[V],r=t.split(\".\"),i=0;i<r.length;i+=1){var o=n[r[i]];if(i===r.length-1)return o;if(!o)return;n=o}}function L(t){var e=B(t,q);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=B(t,window.x_spreadsheet.$messages)),e||\"\"}function U(t){return function(){return L(t)}}function Y(t,e){V=t,e&&(q[t]=e)}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Z={phone:/^[1-9]\\d{10}$/,email:/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/};function K(t,e){var n=\"\";if(!t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n=L.apply(void 0,[\"validation.\".concat(e)].concat(i))}return[t,n]}var J=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.required=n,this.value=r,this.type=e,this.operator=i,this.message=\"\"}var e,n,r;return e=t,(n=[{key:\"parseValue\",value:function(t){var e=this.type;return\"date\"===e?new Date(t):\"number\"===e?Number(t):t}},{key:\"equals\",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?z.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:\"values\",value:function(){return this.value.split(\",\")}},{key:\"validate\",value:function(t){var e=this.required,n=this.operator,r=this.value,i=this.type;if(e&&/^\\s*$/.test(t))return K(!1,\"required\");if(/^\\s*$/.test(t))return[!0];if(Z[i]&&!Z[i].test(t))return K(!1,\"notMatch\");if(\"list\"===i)return K(this.values().includes(t),\"notIn\");if(n){var o=this.parseValue(t);if(\"be\"===n){var a=$(r,2),l=a[0],c=a[1];return K(o>=this.parseValue(l)&&o<=this.parseValue(c),\"between\",l,c)}if(\"nbe\"===n){var s=$(r,2),u=s[0],f=s[1];return K(o<this.parseValue(u)||o>this.parseValue(f),\"notBetween\",u,f)}if(\"eq\"===n)return K(o===this.parseValue(r),\"equal\",r);if(\"neq\"===n)return K(o!==this.parseValue(r),\"notEqual\",r);if(\"lt\"===n)return K(o<this.parseValue(r),\"lessThan\",r);if(\"lte\"===n)return K(o<=this.parseValue(r),\"lessThanEqual\",r);if(\"gt\"===n)return K(o>this.parseValue(r),\"greaterThan\",r);if(\"gte\"===n)return K(o>=this.parseValue(r),\"greaterThanEqual\",r)}return[!0]}}])&&X(e.prototype,n),r&&X(e,r),t}();function G(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Q(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function et(t,e,n){return e&&tt(t.prototype,e),n&&tt(t,n),t}var nt=function(){function t(e,n,r){Q(this,t),this.refs=n,this.mode=e,this.validator=r}return et(t,[{key:\"includes\",value:function(t,e){for(var n=this.refs,r=0;r<n.length;r+=1){if(v.valueOf(n[r]).includes(t,e))return!0}return!1}},{key:\"addRef\",value:function(t){this.remove(v.valueOf(t)),this.refs.push(t)}},{key:\"remove\",value:function(t){var e=[];this.refs.forEach(function(n){var r=v.valueOf(n);r.intersects(t)?r.difference(t).forEach(function(t){return e.push(t.toString())}):e.push(n)}),this.refs=e}},{key:\"getData\",value:function(){var t=this.refs,e=this.mode,n=this.validator;return{refs:t,mode:e,type:n.type,required:n.required,operator:n.operator,value:n.value}}}],[{key:\"valueOf\",value:function(e){var n=e.refs,r=e.mode,i=e.type,o=e.required,a=e.operator,l=e.value;return new t(r,n,new J(i,o,l,a))}}]),t}(),rt=function(){function t(){Q(this,t),this._=[],this.errors=new Map}return et(t,[{key:\"getError\",value:function(t,e){return this.errors.get(\"\".concat(t,\"_\").concat(e))}},{key:\"validate\",value:function(t,e,n){var r=this.get(t,e),i=\"\".concat(t,\"_\").concat(e),o=this.errors;if(null!==r){var a=G(r.validator.validate(n),2),l=a[0],c=a[1];l?o.delete(i):o.set(i,c)}else o.delete(i);return!0}},{key:\"add\",value:function(t,e,n){var r=n.type,i=n.required,o=n.value,a=n.operator,l=new J(r,i,o,a),c=this.getByValidator(l);null!==c?c.addRef(e):this._.push(new nt(t,[e],l))}},{key:\"getByValidator\",value:function(t){for(var e=0;e<this._.length;e+=1){var n=this._[e];if(n.validator.equals(t))return n}return null}},{key:\"get\",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}return null}},{key:\"remove\",value:function(t){this.each(function(e){e.remove(t)})}},{key:\"each\",value:function(t){this._.forEach(function(e){return t(e)})}},{key:\"getData\",value:function(){return this._.filter(function(t){return t.refs.length>0}).map(function(t){return t.getData()})}},{key:\"setData\",value:function(t){this._=t.map(function(t){return nt.valueOf(t)})}}]),t}();function it(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function at(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var lt={mode:\"edit\",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showGrid:!0,showToolbar:!0,showContextmenu:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{bgcolor:\"#ffffff\",align:\"left\",valign:\"middle\",textwrap:!1,strike:!1,underline:!1,color:\"#0a0a0a\",font:{name:\"Arial\",size:10,bold:!1,italic:!1},format:\"normal\"}};function ct(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.merges,i=e.clone(),o=at(t.size(),2),a=o[0],l=o[1],c=at(e.size(),2),s=c[0],u=c[1];return a>s&&(i.eri=e.sri+a-1),l>u&&(i.eci=e.sci+l-1),!r.intersects(i)||(n(L(\"error.pasteForMergedCell\")),!1)}function st(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.rows,o=this.merges;\"all\"!==n&&\"format\"!==n||(i.deleteCells(e,n),o.deleteWithin(e)),i.copyPaste(t,e,n,r,function(t,e,n){if(n&&n.merge){var r=at(n.merge,2),i=r[0],a=r[1];if(i<=0&&a<=0)return;o.add(new v(t,e,t+i,e+a))}})}function ut(t,e){var n=this.clipboard,r=this.rows,i=this.merges;r.cutPaste(t,e),i.move(t,e.sri-t.sri,e.sci-t.sci),n.clear()}function ft(t,e,n){var r=this.styles,i=this.rows.getCellOrNew(t,e),o={};void 0!==i.style&&(o=z.cloneDeep(r[i.style])),o=z.merge(o,{border:n}),i.style=this.addStyle(o)}var ht=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.settings=z.merge(lt,n||{}),this.name=e||\"sheet\",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new N(this.settings.row),this.cols=new W(this.settings.col),this.validations=new rt,this.hyperlinks={},this.comments={},this.selector=new g,this.scroll=new m,this.history=new k,this.clipboard=new S,this.autoFilter=new T,this.change=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map}var e,n,r;return e=t,(n=[{key:\"addValidation\",value:function(t,e,n){var r=this;this.changeData(function(){r.validations.add(t,e,n)})}},{key:\"removeValidation\",value:function(){var t=this,e=this.selector.range;this.changeData(function(){t.validations.remove(e)})}},{key:\"getSelectedValidator\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=this.validations.get(e,n);return r?r.validator:null}},{key:\"getSelectedValidation\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=t.range,i=this.validations.get(e,n),o={ref:r.toString()};return null!==i&&(o.mode=i.mode,o.validator=i.validator),o}},{key:\"canUndo\",value:function(){return this.history.canUndo()}},{key:\"canRedo\",value:function(){return this.history.canRedo()}},{key:\"undo\",value:function(){var t=this;this.history.undo(this.getData(),function(e){t.setData(e)})}},{key:\"redo\",value:function(){var t=this;this.history.redo(this.getData(),function(e){t.setData(e)})}},{key:\"copy\",value:function(){this.clipboard.copy(this.selector.range)}},{key:\"cut\",value:function(){this.clipboard.cut(this.selector.range)}},{key:\"paste\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=this.clipboard,i=this.selector;return!r.isClear()&&(!!ct.call(this,r.range,i.range,n)&&(this.changeData(function(){r.isCopy()?st.call(t,r.range,i.range,e):r.isCut()&&ut.call(t,r.range,i.range)}),!0))}},{key:\"pasteFromText\",value:function(t){var e=t.split(\"\\r\\n\").map(function(t){return t.replace(/\"/g,\"\").split(\"\\t\")});e.length>0&&(e.length-=1);var n=this.rows,r=this.selector;this.changeData(function(){n.paste(e,r.range)})}},{key:\"autofill\",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=this.selector.range;return!!ct.call(this,i,t,r)&&(this.changeData(function(){st.call(n,i,t,e,!0)}),!0)}},{key:\"clearClipboard\",value:function(){this.clipboard.clear()}},{key:\"calSelectedRangeByEnd\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges,a=n.range,l=a.sri,c=a.sci,s=a.eri,u=a.eci,f=n.ri,h=n.ci,p=t,d=e;return t<0&&(p=r.len-1),e<0&&(d=i.len-1),p>f?(l=f,s=p):(l=p,s=f),d>h?(c=h,u=d):(c=d,u=h),n.range=o.union(new v(l,c,s,u)),n.range=o.union(n.range),n.range}},{key:\"calSelectedRangeByStart\",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new v(t,e,t,e),-1===t&&(o.sri=0,o.eri=r.len-1),-1===e&&(o.sci=0,o.eci=i.len-1)),n.range=o,o}},{key:\"setSelectedCellAttr\",value:function(t,e){var n=this;this.changeData(function(){var r=n.selector,i=n.styles,o=n.rows;if(\"merge\"===t)e?n.merge():n.unmerge();else if(\"border\"===t)(function(t){var e=this,n=t.mode,r=t.style,i=t.color,o=this.styles,a=this.selector,l=this.rows,c=a.range,s=c.sri,u=c.sci,f=c.eri,h=c.eci,p=!this.isSignleSelected();if(p||\"inside\"!==n&&\"horizontal\"!==n&&\"vertical\"!==n)if(\"outside\"!==n||p){if(\"none\"===n)a.range.each(function(t,n){var r=l.getCell(t,n);if(r&&void 0!==r.style){var i=z.cloneDeep(o[r.style]);delete i.border,r.style=e.addStyle(i)}});else if(\"all\"===n||\"inside\"===n||\"outside\"===n||\"horizontal\"===n||\"vertical\"===n)!function(){for(var t=[],o=s;o<=f;o+=1)for(var a=u;a<=h;a+=1){for(var c=[],d=0;d<t.length;d+=1){var y=at(t[d],4),v=y[0],b=y[1],g=y[2],m=y[3];if(o===v+g+1&&c.push(d),v<=o&&o<=v+g&&a===b){a+=m+1;break}}if(c.forEach(function(e){return t.splice(e,1)}),a>h)break;var w=l.getCell(o,a),k=0,O=0;if(w&&w.merge){var S=at(w.merge,2);k=S[0],O=S[1],t.push([o,a,k,O])}var x=k>0&&o+k===f,E=O>0&&a+O===h,j={};\"all\"===n?j={bottom:[r,i],top:[r,i],left:[r,i],right:[r,i]}:\"inside\"===n?(!E&&a<h&&(j.right=[r,i]),!x&&o<f&&(j.bottom=[r,i])):\"horizontal\"===n?!x&&o<f&&(j.bottom=[r,i]):\"vertical\"===n?!E&&a<h&&(j.right=[r,i]):\"outside\"===n&&p&&(s===o&&(j.top=[r,i]),(x||f===o)&&(j.bottom=[r,i]),u===a&&(j.left=[r,i]),(E||h===a)&&(j.right=[r,i])),Object.keys(j).length>0&&ft.call(e,o,a,j),a+=O}}();else if(\"top\"===n||\"bottom\"===n)for(var d=u;d<=h;d+=1)\"top\"===n&&(ft.call(this,s,d,{top:[r,i]}),d+=l.getCellMerge(s,d)[1]),\"bottom\"===n&&(ft.call(this,f,d,{bottom:[r,i]}),d+=l.getCellMerge(f,d)[1]);else if(\"left\"===n||\"right\"===n)for(var y=s;y<=f;y+=1)\"left\"===n&&(ft.call(this,y,u,{left:[r,i]}),y+=l.getCellMerge(y,u)[0]),\"right\"===n&&(ft.call(this,y,h,{right:[r,i]}),y+=l.getCellMerge(y,h)[0])}else ft.call(this,s,u,{top:[r,i],bottom:[r,i],left:[r,i],right:[r,i]})}).call(n,e);else if(\"formula\"===t){var a=r.ri,l=r.ci,c=r.range;if(r.multiple()){var s=at(r.size(),2),u=s[0],f=s[1],p=c.sri,d=c.sci,y=c.eri,v=c.eci;if(u>1)for(var b=d;b<=v;b+=1){o.getCellOrNew(y+1,b).text=\"=\".concat(e,\"(\").concat(h(b,p),\":\").concat(h(b,y),\")\")}else if(f>1){o.getCellOrNew(a,v+1).text=\"=\".concat(e,\"(\").concat(h(d,a),\":\").concat(h(v,a),\")\")}}else{o.getCellOrNew(a,l).text=\"=\".concat(e,\"()\")}}else r.range.each(function(r,a){var l=o.getCellOrNew(r,a),c={};if(void 0!==l.style&&(c=z.cloneDeep(i[l.style])),\"format\"===t)c.format=e,l.style=n.addStyle(c);else if(\"font-bold\"===t||\"font-italic\"===t||\"font-name\"===t||\"font-size\"===t){var s={};s[t.split(\"-\")[1]]=e,c.font=Object.assign(c.font||{},s),l.style=n.addStyle(c)}else\"strike\"===t||\"textwrap\"===t||\"underline\"===t||\"align\"===t||\"valign\"===t||\"color\"===t||\"bgcolor\"===t?(c[t]=e,l.style=n.addStyle(c)):l[t]=e})})}},{key:\"setSelectedCellText\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"input\",n=this.autoFilter,r=this.selector,i=this.rows,o=r.ri,a=r.ci,l=o;this.unsortedRowMap.has(o)&&(l=this.unsortedRowMap.get(o));var c=i.getCell(l,a),s=c?c.text:\"\";if(this.setCellText(l,a,t,e),n.active()){var u=n.getFilter(a);if(u){var f=u.value.findIndex(function(t){return t===s});f>=0&&u.value.splice(f,1,t)}}}},{key:\"getSelectedCell\",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=e;return this.unsortedRowMap.has(e)&&(r=this.unsortedRowMap.get(e)),this.rows.getCell(r,n)}},{key:\"xyInSelectedRect\",value:function(t,e){var n=this.getSelectedRect(),r=n.left,i=n.top,o=n.width,a=n.height,l=t-this.cols.indexWidth,c=e-this.rows.height;return l>r&&l<r+o&&c>i&&c<i+a}},{key:\"getSelectedRect\",value:function(){return this.getRect(this.selector.range)}},{key:\"getClipboardRect\",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:\"getRect\",value:function(t){var e=this.scroll,n=this.rows,r=this.cols,i=this.exceptRowSet,o=t.sri,a=t.sci,l=t.eri,c=t.eci;if(o<0&&a<0)return{left:0,l:0,top:0,t:0,scroll:e};var s=r.sumWidth(0,a),u=n.sumHeight(0,o,i),f=n.sumHeight(o,l+1,i),h=r.sumWidth(a,c+1),p=s-e.x,d=u-e.y,y=this.freezeTotalHeight(),v=this.freezeTotalWidth();return v>0&&v>s&&(p=s),y>0&&y>u&&(d=u),{l:s,t:u,left:p,top:d,height:f,width:h,scroll:e}}},{key:\"getCellRectByXY\",value:function(t,e){var n=this.scroll,r=this.merges,i=this.rows,o=this.cols,a=function(t,e){var n=this.rows,r=this.freezeTotalHeight(),i=n.height;r+n.height<t&&(i-=e);for(var o=this.exceptRowSet,a=0,l=i,c=n.height;a<n.len&&!(l>t);a+=1)o.has(a)||(l+=c=n.getHeight(a));return(l-=c)<=0?{ri:-1,top:0,height:c}:{ri:a-1,top:l,height:c}}.call(this,e,n.y),l=a.ri,c=a.top,s=a.height,u=function(t,e){var n=this.cols,r=this.freezeTotalWidth(),i=n.indexWidth;r+n.indexWidth<t&&(i-=e);var o=at(z.rangeReduceIf(0,n.len,i,n.indexWidth,t,function(t){return n.getWidth(t)}),3),a=o[0],l=o[1],c=o[2];return l<=0?{ci:-1,left:0,width:n.indexWidth}:{ci:a-1,left:l,width:c}}.call(this,t,n.x),f=u.ci,h=u.left,p=u.width;if(-1===f&&(p=o.totalWidth()),-1===l&&(s=i.totalHeight()),l>=0||f>=0){var d=r.getFirstIncludes(l,f);if(d){l=d.sri,f=d.sci;var y=this.cellRect(l,f);h=y.left,c=y.top,p=y.width,s=y.height}}return{ri:l,ci:f,left:h,top:c,width:p,height:s}}},{key:\"isSignleSelected\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=at(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!this.selector.multiple()}},{key:\"canUnmerge\",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=at(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!1}},{key:\"merge\",value:function(){var t=this,e=this.selector,n=this.rows;if(!this.isSignleSelected()){var r=at(e.size(),2),i=r[0],o=r[1];if(i>1||o>1){var a=e.range,l=a.sri,c=a.sci;this.changeData(function(){var r=n.getCellOrNew(l,c);r.merge=[i-1,o-1],t.merges.add(e.range),t.rows.deleteCells(e.range),t.rows.setCell(l,c,r)})}}}},{key:\"unmerge\",value:function(){var t=this,e=this.selector;if(this.isSignleSelected()){var n=e.range,r=n.sri,i=n.sci;this.changeData(function(){t.rows.deleteCell(r,i,\"merge\"),t.merges.deleteWithin(e.range)})}}},{key:\"canAutofilter\",value:function(){return!this.autoFilter.active()}},{key:\"autofilter\",value:function(){var t=this,e=this.autoFilter,n=this.selector;this.changeData(function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=n.range.toString()})}},{key:\"setAutoFilter\",value:function(t,e,n,r){var i=this.autoFilter;i.addFilter(t,n,r),i.setSort(t,e),this.resetAutoFilter()}},{key:\"resetAutoFilter\",value:function(){var t=this,e=this.autoFilter,n=this.rows;if(e.active()){var r=e.sort,i=e.filteredRows(function(t,e){return n.getCell(t,e)}),o=i.rset,a=i.fset,l=Array.from(a),c=Array.from(a);r&&l.sort(function(t,e){return\"asc\"===r.order?t-e:\"desc\"===r.order?e-t:0}),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach(function(e,n){t.sortedRowMap.set(c[n],e),t.unsortedRowMap.set(e,c[n])})}}},{key:\"deleteCell\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"all\",n=this.selector;this.changeData(function(){t.rows.deleteCells(n.range,e),\"all\"!==e&&\"format\"!==e||t.merges.deleteWithin(n.range)})}},{key:\"insert\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData(function(){var r=e.selector.range,i=r.sri,o=r.sci,a=e.rows,l=e.merges,c=e.cols,s=i;\"row\"===t?a.insert(i,n):\"column\"===t&&(a.insertColumn(o,n),s=o,c.len+=1),l.shift(t,s,n,function(t,e,n,r){var i=a.getCell(t,e);i.merge[0]+=n,i.merge[1]+=r})})}},{key:\"delete\",value:function(t){var e=this;this.changeData(function(){var n=e.rows,r=e.merges,i=e.selector,o=e.cols,a=i.range,l=i.range,c=l.sri,s=l.sci,u=l.eri,f=l.eci,h=at(i.range.size(),2),p=h[0],d=h[1],y=c,v=p;\"row\"===t?n.delete(c,u):\"column\"===t&&(n.deleteColumn(s,f),y=a.sci,v=d,o.len-=1),r.shift(t,y,-v,function(t,e,r,i){var o=n.getCell(t,e);o.merge[0]+=r,o.merge[1]+=i,0===o.merge[0]&&0===o.merge[1]&&delete o.merge})})}},{key:\"scrollx\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.cols,o=at(r,2)[1],a=at(z.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getWidth(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.x!==u&&(n.ci=t>0?l:0,n.x=u,e())}},{key:\"scrolly\",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.rows,o=at(r,1)[0],a=at(z.rangeReduceIf(o,i.len,0,0,t,function(t){return i.getHeight(t)}),3),l=a[0],c=a[1],s=a[2],u=c;t>0&&(u+=s),n.y!==u&&(n.ri=t>0?l:0,n.y=u,e())}},{key:\"cellRect\",value:function(t,e){var n=this.rows,r=this.cols,i=r.sumWidth(0,e),o=n.sumHeight(0,t),a=n.getCell(t,e),l=r.getWidth(e),c=n.getHeight(t);if(null!==a&&a.merge){var s=at(a.merge,2),u=s[0],f=s[1];if(u>0)for(var h=1;h<=u;h+=1)c+=n.getHeight(t+h);if(f>0)for(var p=1;p<=f;p+=1)l+=r.getWidth(e+p)}return{left:i,top:o,width:l,height:c,cell:a}}},{key:\"getCell\",value:function(t,e){return this.rows.getCell(t,e)}},{key:\"getCellTextOrDefault\",value:function(t,e){var n=this.getCell(t,e);return n&&n.text?n.text:\"\"}},{key:\"getCellStyle\",value:function(t,e){var n=this.getCell(t,e);return n&&void 0!==n.style?this.styles[n.style]:null}},{key:\"getCellStyleOrDefault\",value:function(t,e){var n=this.styles,r=this.rows.getCell(t,e),i=r&&void 0!==r.style?n[r.style]:{};return z.merge(this.defaultStyle(),i)}},{key:\"getSelectedCellStyle\",value:function(){var t=this.selector,e=t.ri,n=t.ci;return this.getCellStyleOrDefault(e,n)}},{key:\"setCellText\",value:function(t,e,n,r){var i=this.rows,o=this.history,a=this.validations;\"finished\"===r?(i.setCellText(t,e,\"\"),o.add(this.getData()),i.setCellText(t,e,n)):(i.setCellText(t,e,n),this.change(this.getData())),a.validate(t,e,n)}},{key:\"freezeIsActive\",value:function(){var t=at(this.freeze,2),e=t[0],n=t[1];return e>0||n>0}},{key:\"setFreeze\",value:function(t,e){var n=this;this.changeData(function(){n.freeze=[t,e]})}},{key:\"freezeTotalWidth\",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:\"freezeTotalHeight\",value:function(){return this.rows.sumHeight(0,this.freeze[0])}},{key:\"setRowHeight\",value:function(t,e){var n=this;this.changeData(function(){n.rows.setHeight(t,e)})}},{key:\"setColWidth\",value:function(t,e){var n=this;this.changeData(function(){n.cols.setWidth(t,e)})}},{key:\"viewHeight\",value:function(){var t=this.settings,e=t.view,n=t.showToolbar,r=e.height();return r-=41,n&&(r-=41),r}},{key:\"viewWidth\",value:function(){return this.settings.view.width()}},{key:\"freezeViewRange\",value:function(){var t=at(this.freeze,2),e=t[0],n=t[1];return new v(0,0,e-1,n-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:\"contentRange\",value:function(){var t=this.rows,e=this.cols,n=at(t.maxCell(),2),r=n[0],i=n[1],o=t.sumHeight(0,r+1),a=e.sumWidth(0,i+1);return new v(0,0,r,i,a,o)}},{key:\"exceptRowTotalHeight\",value:function(t,e){var n=this.exceptRowSet,r=this.rows,i=Array.from(n),o=0;return i.forEach(function(n){if(n<t||n>e){var i=r.getHeight(n);o+=i}}),o}},{key:\"viewRange\",value:function(){var t=this.scroll,e=this.rows,n=this.cols,r=this.freeze,i=this.exceptRowSet,o=t.ri,a=t.ci;o<=0&&(o=at(r,1)[0]);a<=0&&(a=at(r,2)[1]);for(var l=0,c=0,s=[e.len,n.len],u=s[0],f=s[1],h=o;h<e.len&&(i.has(h)||(c+=e.getHeight(h),u=h),!(c>this.viewHeight()));h+=1);for(var p=a;p<n.len&&(f=p,!((l+=n.getWidth(p))>this.viewWidth()));p+=1);return new v(o,a,u,f,l,c)}},{key:\"eachMergesInView\",value:function(t,e){this.merges.filterIntersects(t).forEach(function(t){return e(t)})}},{key:\"hideRowsOrCols\",value:function(){var t=this.rows,e=this.cols,n=this.selector,r=at(n.size(),2),i=r[0],o=r[1],a=n.range,l=a.sri,c=a.sci,s=a.eri,u=a.eci;if(i===t.len)for(var f=c;f<=u;f+=1)e.setHide(f,!0);else if(o===e.len)for(var h=l;h<=s;h+=1)t.setHide(h,!0)}},{key:\"unhideRowsOrCols\",value:function(t,e){this[\"\".concat(t,\"s\")].unhide(e)}},{key:\"rowEach\",value:function(t,e,n){for(var r=0,i=this.rows,o=this.exceptRowSet,a=it(o),l=0,c=0;c<a.length;c+=1)a[c]<t&&(l+=1);for(var s=t+l;s<=e+l;s+=1)if(o.has(s))l+=1;else{var u=i.getHeight(s);if(u>0&&(n(s,r,u),(r+=u)>this.viewHeight()))break}}},{key:\"colEach\",value:function(t,e,n){for(var r=0,i=this.cols,o=t;o<=e;o+=1){var a=i.getWidth(o);if(a>0&&(n(o,r,a),(r+=a)>this.viewWidth()))break}}},{key:\"defaultStyle\",value:function(){return this.settings.style}},{key:\"addStyle\",value:function(t){for(var e=this.styles,n=0;n<e.length;n+=1){var r=e[n];if(z.equals(r,t))return n}return e.push(t),e.length-1}},{key:\"changeData\",value:function(t){this.history.add(this.getData()),t(),this.change(this.getData())}},{key:\"setData\",value:function(t){var e=this;return Object.keys(t).forEach(function(n){if(\"merges\"===n||\"rows\"===n||\"cols\"===n||\"validations\"===n)e[n].setData(t[n]);else if(\"freeze\"===n){var r=at(f(t[n]),2),i=r[0],o=r[1];e.freeze=[o,i]}else\"autofilter\"===n?e.autoFilter.setData(t[n]):void 0!==t[n]&&(e[n]=t[n])}),this}},{key:\"getData\",value:function(){var t=this.name,e=this.freeze,n=this.styles,r=this.merges,i=this.rows,o=this.cols,a=this.validations,l=this.autoFilter;return{name:t,freeze:h(e[1],e[0]),styles:n,merges:r.getData(),rows:i.getData(),cols:o.getData(),validations:a.getData(),autofilter:l.getData()}}}])&&ot(e.prototype,n),r&&ot(e,r),t}();function pt(t,e,n){t.addEventListener(e,n)}function dt(t,e,n){t.removeEventListener(e,n)}function yt(t){t.xclickoutside&&(dt(window.document.body,\"click\",t.xclickoutside),delete t.xclickoutside)}function vt(t,e){t.xclickoutside=function(n){2===n.detail||t.contains(n.target)||(e?e(t):(t.hide(),yt(t)))},pt(window.document.body,\"click\",t.xclickoutside)}function bt(t,e,n){pt(t,\"mousemove\",e),t.xEvtUp=function(r){dt(t,\"mousemove\",e),dt(t,\"mouseup\",t.xEvtUp),n(r)},pt(t,\"mouseup\",t.xEvtUp)}function gt(t,e,n,r){Math.abs(t)>Math.abs(e)?r(t>0?\"right\":\"left\",t,n):r(e>0?\"down\":\"up\",e,n)}var mt=\"x-spreadsheet\";window.devicePixelRatio;function wt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var kt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.moving=!1,this.vertical=n,this.el=a(\"div\",\"\".concat(mt,\"-resizer \").concat(n?\"vertical\":\"horizontal\")).children(this.unhideHoverEl=a(\"div\",\"\".concat(mt,\"-resizer-hover\")).on(\"dblclick.stop\",function(t){return e.mousedblclickHandler(t)}).css(\"position\",\"absolute\").hide(),this.hoverEl=a(\"div\",\"\".concat(mt,\"-resizer-hover\")).on(\"mousedown.stop\",function(t){return e.mousedownHandler(t)}),this.lineEl=a(\"div\",\"\".concat(mt,\"-resizer-line\")).hide()).hide(),this.cRect=null,this.finishedFn=null,this.minDistance=r,this.unhideFn=function(){}}var e,n,r;return e=t,(n=[{key:\"showUnhide\",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:\"hideUnhide\",value:function(){this.unhideHoverEl.hide()}},{key:\"show\",value:function(t,e){var n=this.moving,r=this.vertical,i=this.hoverEl,o=this.lineEl,a=this.el,l=this.unhideHoverEl;if(!n){this.cRect=t;var c=t.left,s=t.top,u=t.width,f=t.height;a.offset({left:r?c+u-5:c,top:r?s:s+f-5}).show(),i.offset({width:r?5:u,height:r?f:5}),o.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-u:c,top:r?s:5-f,width:r?5:u,height:r?f:5})}}},{key:\"hide\",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:\"mousedblclickHandler\",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:\"mousedownHandler\",value:function(t){var e=this,n=t,r=this.el,i=this.lineEl,o=this.cRect,a=this.vertical,l=this.minDistance,c=a?o.width:o.height;i.show(),bt(window,function(t){e.moving=!0,null!==n&&1===t.buttons&&(a?(c+=t.movementX)>l&&r.css(\"left\",\"\".concat(o.left+c,\"px\")):(c+=t.movementY)>l&&r.css(\"top\",\"\".concat(o.top+c,\"px\")),n=t)},function(){n=null,i.hide(),e.moving=!1,e.hide(),e.finishedFn&&(c<l&&(c=l),e.finishedFn(o,c))})}}])&&wt(e.prototype,n),r&&wt(e,r),t}();function Ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var St=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vertical=e,this.moveFn=null,this.el=a(\"div\",\"\".concat(mt,\"-scrollbar \").concat(e?\"vertical\":\"horizontal\")).child(this.contentEl=a(\"div\",\"\")).on(\"mousemove.stop\",function(){}).on(\"scroll.stop\",function(t){var e=t.target,r=e.scrollTop,i=e.scrollLeft;n.moveFn&&n.moveFn(n.vertical?r:i,t)})}var e,n,r;return e=t,(n=[{key:\"move\",value:function(t){return this.el.scroll(t),this}},{key:\"scroll\",value:function(){return this.el.scroll()}},{key:\"set\",value:function(t,e){var n=t-1;if(e>n){var r=this.vertical?\"height\":\"width\";this.el.css(r,\"\".concat(n-15,\"px\")).show(),this.contentEl.css(this.vertical?\"width\":\"height\",\"1px\").css(r,\"\".concat(e,\"px\"))}else this.el.hide();return this}}])&&Ot(e.prototype,n),r&&Ot(e,r),t}();function xt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function jt(t,e,n){return e&&Et(t.prototype,e),n&&Et(t,n),t}var _t=10,Ct=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];xt(this,t),this.useHideInput=n,this.inputChange=function(){},this.cornerEl=a(\"div\",\"\".concat(mt,\"-selector-corner\")),this.areaEl=a(\"div\",\"\".concat(mt,\"-selector-area\")).child(this.cornerEl).hide(),this.clipboardEl=a(\"div\",\"\".concat(mt,\"-selector-clipboard\")).hide(),this.autofillEl=a(\"div\",\"\".concat(mt,\"-selector-autofill\")).hide(),this.el=a(\"div\",\"\".concat(mt,\"-selector\")).css(\"z-index\",\"\".concat(_t)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),n&&(this.hideInput=a(\"input\",\"\").on(\"compositionend\",function(t){e.inputChange(t.target.value)}),this.el.child(this.hideInputDiv=a(\"div\",\"hide-input\").child(this.hideInput)),this.el.child(this.hideInputDiv=a(\"div\",\"hide-input\").child(this.hideInput))),_t+=1}return jt(t,[{key:\"setOffset\",value:function(t){return this.el.offset(t).show(),this}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"setAreaOffset\",value:function(t){var e=t.left,n=t.top,r={width:t.width-3+.8,height:t.height-3+.8,left:e-.8,top:n-.8};this.areaEl.offset(r).show(),this.useHideInput&&(this.hideInputDiv.offset(r),this.hideInput.val(\"\").focus())}},{key:\"setClipboardOffset\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.clipboardEl.offset({left:e,top:n,width:r-5,height:i-5})}},{key:\"showAutofill\",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.autofillEl.offset({width:r-3,height:i-3,left:e,top:n}).show()}},{key:\"hideAutofill\",value:function(){this.autofillEl.hide()}},{key:\"showClipboard\",value:function(){this.clipboardEl.show()}},{key:\"hideClipboard\",value:function(){this.clipboardEl.hide()}}]),t}();function Tt(t){var e=this.data,n=t.left,r=t.top,i=t.width,o=t.height,a=t.scroll,l=t.l,c=t.t,s=e.freezeTotalWidth(),u=e.freezeTotalHeight(),f=n-s;s>l&&(f-=a.x);var h=r-u;return u>c&&(h-=a.y),{left:f,top:h,width:i,height:o}}function Pt(t){var e=this.data,n=t.left,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalWidth(),s=n-c;return c>o&&(s-=l.x),{left:s,top:a,width:r,height:i}}function At(t){var e=this.data,n=t.top,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalHeight(),s=n-c;return c>a&&(s-=l.y),{left:o,top:s,width:r,height:i}}function Rt(t){this.br.setAreaOffset(Tt.call(this,t))}function It(t){this.t.setAreaOffset(Pt.call(this,t))}function Dt(t){this.l.setAreaOffset(At.call(this,t))}function zt(t){this.l.setClipboardOffset(At.call(this,t))}function Ht(t){this.br.setClipboardOffset(Tt.call(this,t))}function Mt(t){this.t.setClipboardOffset(Pt.call(this,t))}function Nt(t){Rt.call(this,t),function(t){this.tl.setAreaOffset(t)}.call(this,t),It.call(this,t),Dt.call(this,t)}function Ft(t){Ht.call(this,t),function(t){this.tl.setClipboardOffset(t)}.call(this,t),Mt.call(this,t),zt.call(this,t)}var Wt=function(){function t(e){var n=this;xt(this,t),this.inputChange=function(){},this.data=e,this.br=new Ct(!0),this.t=new Ct,this.l=new Ct,this.tl=new Ct,this.br.inputChange=function(t){n.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=a(\"div\",\"\".concat(mt,\"-selectors\")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,_t+=1}return jt(t,[{key:\"resetData\",value:function(t){this.data=t,this.range=t.selector.range,this.resetAreaOffset()}},{key:\"hide\",value:function(){this.el.hide()}},{key:\"resetOffset\",value:function(){var t=this.data,e=this.tl,n=this.t,r=this.l,i=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();o>0||a>0?(e.setOffset({width:a,height:o}),n.setOffset({left:a,height:o}),r.setOffset({top:o,width:a}),i.setOffset({left:a,top:o})):(e.hide(),n.hide(),r.hide(),i.setOffset({left:0,top:0}))}},{key:\"resetAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Nt.call(this,t),Ft.call(this,e),this.resetOffset()}},{key:\"resetBRTAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Rt.call(this,t),It.call(this,t),Ht.call(this,e),Mt.call(this,e),this.resetOffset()}},{key:\"resetBRLAreaOffset\",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Rt.call(this,t),Dt.call(this,t),Ht.call(this,e),zt.call(this,e),this.resetOffset()}},{key:\"set\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=r.calSelectedRangeByStart(t,e),o=i.sri,a=i.sci;if(n){var l=t,c=e;t<0&&(l=0),e<0&&(c=0),r.selector.setIndexes(l,c),this.indexes=[l,c]}this.moveIndexes=[o,a],this.range=i,this.resetAreaOffset(),this.el.show()}},{key:\"setEnd\",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=this.lastri,o=this.lastci;if(n){if(t===i&&e===o)return;this.lastri=t,this.lastci=e}this.range=r.calSelectedRangeByEnd(t,e),Nt.call(this,this.data.getSelectedRect())}},{key:\"reset\",value:function(){var t=this.data.selector.range,e=t.eri,n=t.eci;this.setEnd(e,n)}},{key:\"showAutofill\",value:function(t,e){if(-1!==t||-1!==e){var n=this.range,r=n.sri,i=n.sci,o=n.eri,a=n.eci,l=t,c=e,s=r-t,u=o-t,f=a-e;if(i-e>0)this.arange=new v(r,c,o,i-1);else if(s>0)this.arange=new v(l,i,r-1,a);else if(f<0)this.arange=new v(r,a+1,o,c);else{if(!(u<0))return void(this.arange=null);this.arange=new v(o+1,i,l,a)}if(null!==this.arange){var h=this.data.getRect(this.arange);h.width+=2,h.height+=2;var p=this.br,d=this.l,y=this.t,b=this.tl;p.showAutofill(Tt.call(this,h)),d.showAutofill(At.call(this,h)),y.showAutofill(Pt.call(this,h)),b.showAutofill(h)}}}},{key:\"hideAutofill\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideAutofill()})}},{key:\"showClipboard\",value:function(){var t=this,e=this.data.getClipboardRect();Ft.call(this,e),[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].showClipboard()})}},{key:\"hideClipboard\",value:function(){var t=this;[\"br\",\"l\",\"t\",\"tl\"].forEach(function(e){t[e].hideClipboard()})}}]),t}();function Vt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bt(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}var Lt=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"200px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterItems=[],this.items=e,this.el=a(\"div\",\"\".concat(mt,\"-suggest\")).css(\"width\",r).hide(),this.itemClick=n,this.itemIndex=-1}var e,n,r;return e=t,(n=[{key:\"setOffset\",value:function(t){this.el.cssRemoveKeys(\"top\",\"bottom\").offset(t)}},{key:\"hide\",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide(),yt(this.el.parent())}},{key:\"setItems\",value:function(t){this.items=t}},{key:\"search\",value:function(t){var e,n=this,r=this.items;if(/^\\s*$/.test(t)||(r=r.filter(function(e){return(e.key||e).startsWith(t.toUpperCase())})),r=r.map(function(t){var e=t.title;e?\"function\"==typeof e&&(e=e()):e=t;var r=a(\"div\",\"\".concat(mt,\"-item\")).child(e).on(\"click.stop\",function(){n.itemClick(t),n.hide()});return t.label&&r.child(a(\"div\",\"label\").html(t.label)),r}),this.filterItems=r,!(r.length<=0)){var i=this.el;(e=i.html(\"\")).children.apply(e,Vt(r)).show(),vt(i.parent(),function(){n.hide()})}}},{key:\"bindInputEvents\",value:function(t){var e=this;t.on(\"keydown\",function(t){return function(t){var e=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),e){case 37:t.stopPropagation();break;case 38:(function(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle())}).call(this,t);break;case 39:t.stopPropagation();break;case 40:(function(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle())}).call(this,t);break;case 13:case 9:Bt.call(this,t);break;default:t.stopPropagation()}}.call(e,t)})}}])&&qt(e.prototype,n),r&&qt(e,r),t}();function Ut(t){return(Ut=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Yt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $t(t,e){return!e||\"object\"!==Ut(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Xt(t){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zt(t,e){return(Zt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Kt=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=$t(this,Xt(e).call(this,\"div\",\"\".concat(mt,\"-icon\")))).iconNameEl=a(\"div\",\"\".concat(mt,\"-icon-img \").concat(t)),n.child(n.iconNameEl),n}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zt(t,e)}(e,o),n=e,(r=[{key:\"setName\",value:function(t){this.iconNameEl.className(\"\".concat(mt,\"-icon-img \").concat(t))}}])&&Yt(n.prototype,r),i&&Yt(n,i),e}();function Jt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qt(t,e){t.setMonth(t.getMonth()+e)}function te(t,e){var n=new Date(t);return n.setDate(e-t.getDay()+1),n}var ee=function(){function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=a(\"div\",\"calendar-header-left\"),this.bodyEl=a(\"tbody\",\"\"),this.buildAll(),this.el=a(\"div\",\"x-spreadsheet-calendar\").children(a(\"div\",\"calendar-header\").children(this.headerLeftEl,a(\"div\",\"calendar-header-right\").children(a(\"a\",\"calendar-prev\").on(\"click.stop\",function(){return r.prev()}).child(new Kt(\"chevron-left\")),a(\"a\",\"calendar-next\").on(\"click.stop\",function(){return r.next()}).child(new Kt(\"chevron-right\")))),a(\"table\",\"calendar-body\").children(a(\"thead\",\"\").child((n=a(\"tr\",\"\")).children.apply(n,Jt(L(\"calendar.weeks\").map(function(t){return a(\"th\",\"cell\").child(t)})))),this.bodyEl)),this.selectChange=function(){}}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:\"prev\",value:function(){Qt(this.value,-1),this.buildAll()}},{key:\"next\",value:function(){Qt(this.value,1),this.buildAll()}},{key:\"buildAll\",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:\"buildHeaderLeft\",value:function(){var t=this.value;this.headerLeftEl.html(\"\".concat(L(\"calendar.months\")[t.getMonth()],\" \").concat(t.getFullYear()))}},{key:\"buildBody\",value:function(){var t,e=this,n=this.value,r=this.cvalue,i=this.bodyEl,o=function(t,e,n){for(var r=new Date(t,e,1,23,59,59),i=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var l=te(r,7*o+a),c=l.getMonth()!==e,s=l.getMonth()===n.getMonth()&&l.getDate()===n.getDate();i[o][a]={d:l,disabled:c,active:s}}return i}(n.getFullYear(),n.getMonth(),r).map(function(t){var n,r=t.map(function(t){var n=\"cell\";return t.disabled&&(n+=\" disabled\"),t.active&&(n+=\" active\"),a(\"td\",\"\").child(a(\"div\",n).on(\"click.stop\",function(){e.selectChange(t.d)}).child(t.d.getDate().toString()))});return(n=a(\"tr\",\"\")).children.apply(n,Jt(r))});(t=i.html(\"\")).children.apply(t,Jt(o))}}])&&Gt(e.prototype,n),r&&Gt(e,r),t}();function ne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var re=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.calendar=new ee(new Date),this.el=a(\"div\",\"\".concat(mt,\"-datepicker\")).child(this.calendar.el).hide()}var e,n,r;return e=t,(n=[{key:\"setValue\",value:function(t){var e=this.calendar;return\"string\"==typeof t?/^\\d{4}-\\d{1,2}-\\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp(\"-\",\"g\"),\"/\"))):t instanceof Date&&e.setValue(t),this}},{key:\"change\",value:function(t){var e=this;this.calendar.selectChange=function(n){t(n),e.hide()}}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&ne(e.prototype,n),r&&ne(e,r),t}();function ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oe(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ae(){var t=this.inputText;if(!/^\\s*$/.test(t)){var e=this.textlineEl,n=this.textEl,r=this.areaOffset,i=t.split(\"\\n\"),o=Math.max.apply(Math,oe(i.map(function(t){return t.length}))),a=e.offset().width/t.length,l=(o+1)*a+5,c=this.viewFn().width-r.left-a,s=i.length;if(l>r.width){var u=l;l>c&&(u=c,s+=parseInt(l/c,10),s+=l%c>0?1:0),n.css(\"width\",\"\".concat(u,\"px\"))}(s*=this.rowHeight)>r.height&&n.css(\"height\",\"\".concat(s,\"px\"))}}function le(t){var e=t.keyCode,n=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&n&&(function(t,e){var n=t.target,r=n.value,i=n.selectionEnd,o=\"\".concat(r.slice(0,i)).concat(e).concat(r.slice(i));n.value=o,n.setSelectionRange(i+1,i+1),this.inputText=o,this.textlineEl.html(o),ae.call(this)}.call(this,t,\"\\n\"),t.stopPropagation()),13!==e||n||t.preventDefault()}function ce(t,e){var n=this.textEl,r=this.textlineEl;n.el.blur(),n.val(t),r.html(t),function(t){var e=this.textEl.el;setTimeout(function(){e.focus(),e.setSelectionRange(t,t)},0)}.call(this,e)}var se=function(){function t(e,n,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.viewFn=n,this.rowHeight=r,this.formulas=e,this.suggest=new Lt(e,function(t){(function(t){var e=this.inputText,n=this.validator,r=0;if(n&&\"list\"===n.type)this.inputText=t,r=this.inputText.length;else{var i=e.lastIndexOf(\"=\"),o=e.substring(0,i+1),a=e.substring(i+1);a=-1!==a.indexOf(\")\")?a.substring(a.indexOf(\")\")):\"\",this.inputText=\"\".concat(o+t.key,\"(\"),r=this.inputText.length,this.inputText+=\")\".concat(a)}ce.call(this,this.inputText,r)}).call(i,t)}),this.datepicker=new re,this.datepicker.change(function(t){i.setText(function(t){var e=t.getMonth()+1,n=t.getDate();return e<10&&(e=\"0\".concat(e)),n<10&&(n=\"0\".concat(n)),\"\".concat(t.getFullYear(),\"-\").concat(e,\"-\").concat(n)}(t)),i.clear()}),this.areaEl=a(\"div\",\"\".concat(mt,\"-editor-area\")).children(this.textEl=a(\"textarea\",\"\").on(\"input\",function(t){return function(t){var e=t.target.value,n=this.suggest,r=this.textlineEl,i=this.validator,o=this.cell;if(null!==o)if(\"editable\"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=e,i)\"list\"===i.type?n.search(e):n.hide();else{var a=e.lastIndexOf(\"=\");-1!==a?n.search(e.substring(a+1)):n.hide()}r.html(e),ae.call(this),this.change(\"input\",e)}else t.target.value=\"\";else{if(this.inputText=e,i)\"list\"===i.type?n.search(e):n.hide();else{var l=e.lastIndexOf(\"=\");-1!==l?n.search(e.substring(l+1)):n.hide()}r.html(e),ae.call(this),this.change(\"input\",e)}}.call(i,t)}).on(\"paste.stop\",function(){}).on(\"keydown\",function(t){return le.call(i,t)}),this.textlineEl=a(\"div\",\"textline\"),this.suggest.el,this.datepicker.el).on(\"mousemove.stop\",function(){}).on(\"mousedown.stop\",function(){}),this.el=a(\"div\",\"\".concat(mt,\"-editor\")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText=\"\",this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"setFreezeLengths\",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:\"clear\",value:function(){\"\"!==this.inputText&&this.change(\"finished\",this.inputText),this.cell=null,this.areaOffset=null,this.inputText=\"\",this.el.hide(),this.textEl.val(\"\"),this.textlineEl.html(\"\"),function(){this.suggest.setItems(this.formulas)}.call(this),this.datepicker.hide()}},{key:\"setOffset\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"top\",n=this.textEl,r=this.areaEl,i=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var l=t.left,c=t.top,s=t.width,u=t.height,f=t.l,h=t.t,p={left:0,top:0};o.w>f&&o.h>h||(o.w<f&&o.h<h?(p.left=o.w,p.top=o.h):o.w>f?p.top=o.h:o.h>h&&(p.left=o.w)),a.offset(p),r.offset({left:l-p.left-.8,top:c-p.top-.8}),n.offset({width:s-9+.8,height:u-3+.8});var d={left:0};d[e]=u,i.setOffset(d),i.hide()}}},{key:\"setCell\",value:function(t,e){var n=this.el,r=this.datepicker,i=this.suggest;n.show(),this.cell=t;var o=t&&t.text||\"\";if(this.setText(o),this.validator=e,e){var a=e.type;\"date\"===a&&(r.show(),/^\\s*$/.test(o)||r.setValue(o)),\"list\"===a&&(i.setItems(e.values()),i.search(\"\"))}}},{key:\"setText\",value:function(t){this.inputText=t,ce.call(this,t,t.length),ae.call(this)}}])&&ie(e.prototype,n),r&&ie(e,r),t}();function ue(t){return(ue=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function fe(t,e){return!e||\"object\"!==ue(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function he(t){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pe(t,e){return(pe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var de=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(n=fe(this,he(e).call(this,\"div\",\"\".concat(mt,\"-button \").concat(r)))).child(L(\"button.\".concat(t))),n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pe(t,e)}(e,o),e}();function ye(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function ve(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function be(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function me(t,e,n){return e&&ge(t.prototype,e),n&&ge(t,n),t}function we(){return window.devicePixelRatio||1}function ke(){return we()-.5}function Oe(t){return parseInt(t*we(),10)}function Se(t){var e=Oe(t);return e>0?e-.5:.5}var xe=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;be(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.padding=o,this.bgcolor=\"#ffffff\",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null}return me(t,[{key:\"setBorders\",value:function(t){var e=t.top,n=t.bottom,r=t.left,i=t.right;e&&(this.borderTop=e),i&&(this.borderRight=i),n&&(this.borderBottom=n),r&&(this.borderLeft=r)}},{key:\"innerWidth\",value:function(){return this.width-2*this.padding-2}},{key:\"innerHeight\",value:function(){return this.height-2*this.padding-2}},{key:\"textx\",value:function(t){var e=this.width,n=this.padding,r=this.x;return\"left\"===t?r+=n:\"center\"===t?r+=e/2:\"right\"===t&&(r+=e-n),r}},{key:\"texty\",value:function(t,e){var n=this.height,r=this.padding,i=this.y;return\"top\"===t?i+=r:\"middle\"===t?i+=n/2-e/2:\"bottom\"===t&&(i+=n-r-e),i}},{key:\"topxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:\"rightxys\",value:function(){var t=this.x,e=this.y,n=this.width;return[[t+n,e],[t+n,e+this.height]]}},{key:\"bottomxys\",value:function(){var t=this.x,e=this.y,n=this.width,r=this.height;return[[t,e+r],[t+n,e+r]]}},{key:\"leftxys\",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function Ee(t,e,n,r,i,o,a){var l={x:0,y:0};\"underline\"===t?l.y=\"bottom\"===i?0:\"top\"===i?-(o+2):-o/2:\"strike\"===t&&(\"bottom\"===i?l.y=o/2:\"top\"===i&&(l.y=-(o/2+2))),\"center\"===r?l.x=a/2:\"right\"===r&&(l.x=a),this.line([e-l.x,n-l.y],[e-l.x+a,n-l.y])}var je=function(){function t(e,n,r){be(this,t),this.el=e,this.ctx=e.getContext(\"2d\"),this.resize(n,r),this.ctx.scale(we(),we())}return me(t,[{key:\"resize\",value:function(t,e){this.el.style.width=\"\".concat(t,\"px\"),this.el.style.height=\"\".concat(e,\"px\"),this.el.width=Oe(t),this.el.height=Oe(e)}},{key:\"clear\",value:function(){var t=this.el,e=t.width,n=t.height;return this.ctx.clearRect(0,0,e,n),this}},{key:\"attr\",value:function(t){return Object.assign(this.ctx,t),this}},{key:\"save\",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:\"restore\",value:function(){return this.ctx.restore(),this}},{key:\"beginPath\",value:function(){return this.ctx.beginPath(),this}},{key:\"translate\",value:function(t,e){return this.ctx.translate(Oe(t),Oe(e)),this}},{key:\"scale\",value:function(t,e){return this.ctx.scale(t,e),this}},{key:\"clearRect\",value:function(t,e,n,r){return this.ctx.clearRect(t,e,n,r),this}},{key:\"fillRect\",value:function(t,e,n,r){return this.ctx.fillRect(Oe(t)-.5,Oe(e)-.5,Oe(n),Oe(r)),this}},{key:\"fillText\",value:function(t,e,n){return this.ctx.fillText(t,Oe(e),Oe(n)),this}},{key:\"text\",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.ctx,a=r.align,l=r.valign,c=r.font,s=r.color,u=r.strike,f=r.underline,h=e.textx(a);o.save(),o.beginPath(),this.attr({textAlign:a,textBaseline:l,font:\"\".concat(c.italic?\"italic\":\"\",\" \").concat(c.bold?\"bold\":\"\",\" \").concat(Oe(c.size),\"px \").concat(c.name),fillStyle:s,strokeStyle:s});var p=\"\".concat(t).split(\"\\n\"),d=e.innerWidth(),y=[];p.forEach(function(t){var e=o.measureText(t).width;if(i&&e>Oe(d)){for(var n={w:0,len:0,start:0},r=0;r<t.length;r+=1)n.w>=Oe(d)&&(y.push(t.substr(n.start,n.len)),n={w:0,len:0,start:r}),n.len+=1,n.w+=o.measureText(t[r]).width+1;n.len>0&&y.push(t.substr(n.start,n.len))}else y.push(t)});var v=(y.length-1)*(c.size+2),b=e.texty(l,v);return y.forEach(function(t){var e=o.measureText(t).width;n.fillText(t,h,b),u&&Ee.call(n,\"strike\",h,b,a,l,c.size,e),f&&Ee.call(n,\"underline\",h,b,a,l,c.size,e),b+=c.size+2}),o.restore(),this}},{key:\"border\",value:function(t,e){var n=this.ctx;return n.lineWidth=ke,n.strokeStyle=e,\"medium\"===t?n.lineWidth=Oe(2)-.5:\"thick\"===t?n.lineWidth=Oe(3):\"dashed\"===t?n.setLineDash([Oe(3),Oe(2)]):\"dotted\"===t?n.setLineDash([Oe(1),Oe(1)]):\"double\"===t&&n.setLineDash([Oe(2),0]),this}},{key:\"line\",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],n=ve(e,2),r=n[0],i=n[1];t.moveTo(Se(r),Se(i));for(var o=1;o<arguments.length;o+=1){var a=o<0||arguments.length<=o?void 0:arguments[o],l=ve(a,2),c=l[0],s=l[1];t.lineTo(Se(c),Se(s))}t.stroke()}return this}},{key:\"strokeBorders\",value:function(t){var e=this.ctx;e.save();var n=t.borderTop,r=t.borderRight,i=t.borderBottom,o=t.borderLeft;n&&(this.border.apply(this,ye(n)),this.line.apply(this,ye(t.topxys()))),r&&(this.border.apply(this,ye(r)),this.line.apply(this,ye(t.rightxys()))),i&&(this.border.apply(this,ye(i)),this.line.apply(this,ye(t.bottomxys()))),o&&(this.border.apply(this,ye(o)),this.line.apply(this,ye(t.leftxys()))),e.restore()}},{key:\"dropdown\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-15,o=r+t.height-15;e.save(),e.beginPath(),e.moveTo(Oe(i),Oe(o)),e.lineTo(Oe(i+8),Oe(o)),e.lineTo(Oe(i+4),Oe(o+6)),e.closePath(),e.fillStyle=\"rgba(0, 0, 0, .45)\",e.fill(),e.restore()}},{key:\"error\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(Oe(i-8),Oe(r-1)),e.lineTo(Oe(i),Oe(r-1)),e.lineTo(Oe(i),Oe(r+8)),e.closePath(),e.fillStyle=\"rgba(255, 0, 0, .65)\",e.fill(),e.restore()}},{key:\"frozen\",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(Oe(i-8),Oe(r-1)),e.lineTo(Oe(i),Oe(r-1)),e.lineTo(Oe(i),Oe(r+8)),e.closePath(),e.fillStyle=\"rgba(0, 255, 0, .85)\",e.fill(),e.restore()}},{key:\"rect\",value:function(t,e){var n=this.ctx,r=t.x,i=t.y,o=t.width,a=t.height,l=t.bgcolor;n.save(),n.beginPath(),n.fillStyle=l||\"#fff\",n.rect(Se(r+1),Se(i+1),Oe(o-2),Oe(a-2)),n.clip(),n.fill(),e(),n.restore()}}]),t}(),_e=[{key:\"Arial\",title:\"Arial\"},{key:\"Helvetica\",title:\"Helvetica\"},{key:\"Source Sans Pro\",title:\"Source Sans Pro\"},{key:\"Comic Sans MS\",title:\"Comic Sans MS\"},{key:\"Courier New\",title:\"Courier New\"},{key:\"Verdana\",title:\"Verdana\"},{key:\"Lato\",title:\"Lato\"}],Ce=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function Te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}var Pe=function(t){for(var e=[],n=[],r=[],i=0,o=\"\",a=1,l=\"\",c=0;c<t.length;c+=1){var s=t.charAt(c);if(\" \"!==s){if(s>=\"a\"&&s<=\"z\")r.push(s.toUpperCase());else if(s>=\"0\"&&s<=\"9\"||s>=\"A\"&&s<=\"Z\"||\".\"===s)r.push(s);else if('\"'===s){for(c+=1;'\"'!==t.charAt(c);)r.push(t.charAt(c)),c+=1;n.push('\"'.concat(r.join(\"\"))),r=[]}else if(\"-\"===s&&/[+\\-*/,(]/.test(l))r.push(s);else{if(\"(\"!==s&&r.length>0&&n.push(r.join(\"\")),\")\"===s){var u=e.pop();if(2===i)try{for(var p=Te(f(n.pop()),2),d=p[0],y=p[1],v=Te(f(n.pop()),2),b=v[0],g=v[1],m=0,w=b;w<=d;w+=1)for(var k=g;k<=y;k+=1)n.push(h(w,k)),m+=1;n.push([u,m])}catch(t){}else if(1===i||3===i)3===i&&n.push(o),n.push([u,a]),a=1;else for(;\"(\"!==u&&(n.push(u),!(e.length<=0));)u=e.pop();i=0}else if(\"=\"===s||\">\"===s||\"<\"===s){var O=t.charAt(c+1);o=s,\"=\"!==O&&\"-\"!==O||(o+=O,c+=1),i=3}else if(\":\"===s)i=2;else if(\",\"===s)3===i&&n.push(o),i=1,a+=1;else if(\"(\"===s&&r.length>0)e.push(r.join(\"\"));else{if(e.length>0&&(\"+\"===s||\"-\"===s)){var S=e[e.length-1];if(\"(\"!==S&&n.push(e.pop()),\"*\"===S||\"/\"===S)for(;e.length>0&&\"(\"!==(S=e[e.length-1]);)n.push(e.pop())}else if(e.length>0){var x=e[e.length-1];\"*\"!==x&&\"/\"!==x||n.push(e.pop())}e.push(s)}r=[]}l=s}}for(r.length>0&&n.push(r.join(\"\"));e.length>0;)n.push(e.pop());return n},Ae=function(t,e){var n=Te(t,1)[0],r=t;if('\"'===n)return t.substring(1);var i=1;if(\"-\"===n&&(r=t.substring(1),i=-1),r[0]>=\"0\"&&r[0]<=\"9\")return i*Number(r);var o=Te(f(r),2);return i*e(o[0],o[1])},Re=function(t,e,n,r){for(var i=[],o=0;o<t.length;o+=1){var a=t[o],l=a[0];if(\"+\"===a){var c=i.pop();i.push(D(\"+\",i.pop(),c))}else if(\"-\"===a)if(1===i.length){var s=i.pop();i.push(D(\"*\",s,-1))}else{var u=i.pop();i.push(D(\"-\",i.pop(),u))}else if(\"*\"===a)i.push(D(\"*\",i.pop(),i.pop()));else if(\"/\"===a){var f=i.pop();i.push(D(\"/\",i.pop(),f))}else if(\"=\"===l||\">\"===l||\"<\"===l){var h=i.pop();Number.isNaN(h)||(h=Number(h));var p=i.pop();Number.isNaN(p)||(p=Number(p));var d=!1;\"=\"===l?d=p===h:\">\"===a?d=p>h:\">=\"===a?d=p>=h:\"<\"===a?d=p<h:\"<=\"===a&&(d=p<=h),i.push(d)}else if(Array.isArray(a)){for(var y=Te(a,2),v=y[0],b=y[1],g=[],m=0;m<b;m+=1)g.push(i.pop());i.push(e[v].render(g.reverse()))}else{if(r.includes(a))return 0;(l>=\"a\"&&l<=\"z\"||l>=\"A\"&&l<=\"Z\")&&r.push(a),i.push(Ae(a,n)),r.pop()}}return i[0]},Ie={render:function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(\"=\"===e[0]){var o=Pe(e.substring(1));return o.length<=0?e:Re(o,n,function(e,o){return t(r(e,o),n,r,i)},i)}return e}};function De(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function ze(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var He=[{key:\"SUM\",title:U(\"formula.sum\"),render:function(t){return t.reduce(function(t,e){return D(\"+\",t,e)},0)}},{key:\"AVERAGE\",title:U(\"formula.average\"),render:function(t){return t.reduce(function(t,e){return Number(t)+Number(e)},0)/t.length}},{key:\"MAX\",title:U(\"formula.max\"),render:function(t){return Math.max.apply(Math,ze(t.map(function(t){return Number(t)})))}},{key:\"MIN\",title:U(\"formula.min\"),render:function(t){return Math.min.apply(Math,ze(t.map(function(t){return Number(t)})))}},{key:\"IF\",title:U(\"formula._if\"),render:function(t){var e=De(t,3),n=e[0],r=e[1],i=e[2];return n?r:i}},{key:\"AND\",title:U(\"formula.and\"),render:function(t){return t.every(function(t){return t})}},{key:\"OR\",title:U(\"formula.or\"),render:function(t){return t.some(function(t){return t})}},{key:\"CONCAT\",title:U(\"formula.concat\"),render:function(t){return t.join(\"\")}}],Me=He,Ne={};function Fe(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||Ve(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function We(t){return function(t){if(Array.isArray(t))return t}(t)||Ve(t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Ve(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}He.forEach(function(t){Ne[t.key]=t});var qe=function(t){return t},Be=function(t){if(/^(-?\\d*.?\\d*)$/.test(t)){var e=We(Number(t).toFixed(2).toString().split(\"\\\\.\")),n=e[0],r=e.slice(1);return[n.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1,\")].concat(Fe(r))}return t},Le=[{key:\"normal\",title:U(\"format.normal\"),type:\"string\",render:qe},{key:\"text\",title:U(\"format.text\"),type:\"string\",render:qe},{key:\"number\",title:U(\"format.number\"),type:\"number\",label:\"1,000.12\",render:Be},{key:\"percent\",title:U(\"format.percent\"),type:\"number\",label:\"10.12%\",render:function(t){return\"\".concat(t,\"%\")}},{key:\"rmb\",title:U(\"format.rmb\"),type:\"number\",label:\"￥10.00\",render:function(t){return\"￥\".concat(Be(t))}},{key:\"usd\",title:U(\"format.usd\"),type:\"number\",label:\"$10.00\",render:function(t){return\"$\".concat(Be(t))}},{key:\"eur\",title:U(\"format.eur\"),type:\"number\",label:\"€10.00\",render:function(t){return\"€\".concat(Be(t))}},{key:\"date\",title:U(\"format.date\"),type:\"date\",label:\"26/09/2008\",render:qe},{key:\"time\",title:U(\"format.time\"),type:\"date\",label:\"15:59:00\",render:qe},{key:\"datetime\",title:U(\"format.datetime\"),type:\"date\",label:\"26/09/2008 15:59:00\",render:qe},{key:\"duration\",title:U(\"format.duration\"),type:\"date\",label:\"24:01:00\",render:qe}],Ue={};function Ye(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function $e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Le.forEach(function(t){Ue[t.key]=t});var Xe=5,Ze={fillStyle:\"#f4f5f8\"},Ke={fillStyle:\"#fff\",lineWidth:ke,strokeStyle:\"#e6e6e6\"};function Je(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.cellRect(e,n),o=i.left,a=i.top,l=i.width,c=i.height;return new xe(o,a+r,l,c,Xe)}function Ge(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=e.sortedRowMap,a=e.rows,l=e.cols;if(!a.isHide(n)&&!l.isHide(r)){var c=n;o.has(n)&&(c=o.get(n));var s=e.getCell(c,r);if(null!==s){var u=!1;\"editable\"in s&&!1===s.editable&&(u=!0);var f=e.getCellStyleOrDefault(c,r),h=Je(e,n,r,i);h.bgcolor=f.bgcolor,void 0!==f.border&&(h.setBorders(f.border),t.strokeBorders(h)),t.rect(h,function(){var i=Ie.render(s.text||\"\",Ne,function(t,n){return e.getCellTextOrDefault(n,t)});f.format&&(i=Ue[f.format].render(i));var o=Object.assign({},f.font);o.size=function(t){for(var e=0;e<Ce.length;e+=1){var n=Ce[e];if(n.pt===t)return n.px}return t}(o.size),t.text(i,h,{align:f.align,valign:f.valign,font:o,color:f.color,strike:f.strike,underline:f.underline},f.textwrap),e.validations.getError(n,r)&&t.error(h),u&&t.frozen(h)})}}}function Qe(t,e,n,r,i){var o=this.draw,a=this.data;o.save(),o.translate(e,n).translate(r,i);var l=a.exceptRowSet,c=a.exceptRowTotalHeight(t.sri,t.eri);o.save(),o.translate(0,-c),t.each(function(t,e){Ge(o,a,t,e)},function(t){return function(t){var e=l.has(t);if(e){var n=a.rows.getHeight(t);o.translate(0,-n)}return!e}(t)}),o.restore();var s=new Set;o.save(),o.translate(0,-c),a.eachMergesInView(t,function(t){var e=t.sri,n=t.sci,r=t.eri;if(l.has(e)){if(!s.has(e)){s.add(e);var i=a.rows.sumHeight(e,r+1);o.translate(0,-i)}}else Ge(o,a,e,n)}),o.restore(),function(t){var e=this.data,n=this.draw;if(t){var r=e.autoFilter;if(!r.active())return;var i=r.hrange();t.intersects(i)&&i.each(function(t,r){var i=Je(e,t,r);n.dropdown(i)})}}.call(this,t),o.restore()}function tn(t,e,n,r){var i=this.draw;i.save(),i.attr({fillStyle:\"rgba(75, 137, 255, 0.08)\"}).fillRect(t,e,n,r),i.restore()}function en(t,e,n,r,i,o){var a=this,l=this.draw,c=this.data,u=e.h,f=e.w,h=o+r,p=i+n;l.save(),l.attr(Ze),\"all\"!==t&&\"left\"!==t||l.fillRect(0,h,n,u),\"all\"!==t&&\"top\"!==t||l.fillRect(p,0,f,r);var d=c.selector.range,y=d.sri,v=d.sci,b=d.eri,g=d.eci;l.attr({textAlign:\"center\",textBaseline:\"middle\",font:\"500 \".concat(Oe(12),\"px Source Sans Pro\"),fillStyle:\"#585757\",lineWidth:ke(),strokeStyle:\"#e6e6e6\"}),\"all\"!==t&&\"left\"!==t||(c.rowEach(e.sri,e.eri,function(t,e,r){var i=h+e,o=t;l.line([0,i],[n,i]),y<=o&&o<b+1&&tn.call(a,0,i,n,r),l.fillText(o+1,n/2,i+r/2),t>0&&c.rows.isHide(t-1)&&(l.save(),l.attr({strokeStyle:\"#c6c6c6\"}),l.line([5,i+5],[n-5,i+5]),l.restore())}),l.line([0,u+h],[n,u+h]),l.line([n,h],[n,u+h])),\"all\"!==t&&\"top\"!==t||(c.colEach(e.sci,e.eci,function(t,e,n){var i=p+e,o=t;l.line([i,0],[i,r]),v<=o&&o<g+1&&tn.call(a,i,0,n,r),l.fillText(s(o),i+n/2,r/2),t>0&&c.cols.isHide(t-1)&&(l.save(),l.attr({strokeStyle:\"#c6c6c6\"}),l.line([i+5,5],[i+5,r-5]),l.restore())}),l.line([f+p,0],[f+p,r]),l.line([0,r],[f+p,r])),l.restore()}function nn(t,e,n,r,i){var o=t.sri,a=t.sci,l=t.eri,c=t.eci,s=t.w,u=t.h,f=this.draw,h=this.data,p=h.settings;f.save(),f.attr(Ke).translate(e+r,n+i),f.clearRect(0,0,s,u),p.showGrid?(h.rowEach(o,l,function(t,e,n){t!==o&&f.line([0,e],[s,e]),t===l&&f.line([0,e+n],[s,e+n])}),h.colEach(a,c,function(t,e,n){t!==a&&f.line([e,0],[e,u]),t===c&&f.line([e+n,0],[e+n,u])}),f.restore()):f.restore()}var rn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=e,this.draw=new je(e,n.viewWidth(),n.viewHeight()),this.data=n}var e,n,r;return e=t,(n=[{key:\"resetData\",value:function(t){this.data=t,this.render()}},{key:\"render\",value:function(){var t=this.data,e=t.rows,n=t.cols.indexWidth,r=e.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.clear();var i=t.viewRange(),o=t.freezeTotalWidth(),a=t.freezeTotalHeight(),l=t.scroll,c=l.x,s=l.y;nn.call(this,i,n,r,o,a),Qe.call(this,i,n,r,-c,-s),en.call(this,\"all\",i,n,r,o,a),function(t,e){var n=this.draw;n.save(),n.attr({fillStyle:\"#f4f5f8\"}).fillRect(0,0,t,e),n.restore()}.call(this,n,r);var u=Ye(t.freeze,2),f=u[0],h=u[1];if(f>0||h>0){if(f>0){var p=i.clone();p.sri=0,p.eri=f-1,p.h=a,nn.call(this,p,n,r,o,0),Qe.call(this,p,n,r,-c,0),en.call(this,\"top\",p,n,r,o,0)}if(h>0){var d=i.clone();d.sci=0,d.eci=h-1,d.w=o,nn.call(this,d,n,r,0,a),en.call(this,\"left\",d,n,r,0,a),Qe.call(this,d,n,r,0,-s)}var y=t.freezeViewRange();nn.call(this,y,n,r,0,0),en.call(this,\"all\",y,n,r,0,0),Qe.call(this,y,n,r,0,0),function(t,e,n,r){var i=this.draw,o=this.data,a=o.viewWidth()-t,l=o.viewHeight()-e;i.save().translate(t,e).attr({strokeStyle:\"rgba(75, 137, 255, .6)\"}),i.line([0,r],[a,r]),i.line([n,0],[n,l]),i.restore()}.call(this,n,r,o,a)}}},{key:\"clear\",value:function(){this.draw.clear()}}])&&$e(e.prototype,n),r&&$e(e,r),t}();function on(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function an(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ln=[[\"A3\",11.69,16.54],[\"A4\",8.27,11.69],[\"A5\",5.83,8.27],[\"B4\",9.84,13.9],[\"B5\",6.93,9.84]],cn=[\"landscape\",\"portrait\"];function sn(t){return parseInt(96*t,10)}function un(t){\"cancel\"===t?this.el.hide():this.toPrint()}var fn=function(){function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.paper={w:sn(ln[0][1]),h:sn(ln[0][2]),padding:50,orientation:cn[0],get width(){return\"landscape\"===this.orientation?this.h:this.w},get height(){return\"landscape\"===this.orientation?this.w:this.h}},this.data=e,this.el=a(\"div\",\"\".concat(mt,\"-print\")).children(a(\"div\",\"\".concat(mt,\"-print-bar\")).children(a(\"div\",\"-title\").child(\"Print settings\"),a(\"div\",\"-right\").children(a(\"div\",\"\".concat(mt,\"-buttons\")).children(new de(\"cancel\").on(\"click\",un.bind(this,\"cancel\")),new de(\"next\",\"primary\").on(\"click\",un.bind(this,\"next\"))))),a(\"div\",\"\".concat(mt,\"-print-content\")).children(this.contentEl=a(\"div\",\"-content\"),a(\"div\",\"-sider\").child(a(\"form\",\"\").children(a(\"fieldset\",\"\").children(a(\"label\",\"\").child(\"\".concat(L(\"print.size\"))),(n=a(\"select\",\"\")).children.apply(n,on(ln.map(function(t,e){return a(\"option\",\"\").attr(\"value\",e).child(\"\".concat(t[0],\" ( \").concat(t[1],\"''x\").concat(t[2],\"'' )\"))}))).on(\"change\",function(t){var e=this.paper,n=t.target.value,r=ln[n];e.w=sn(r[1]),e.h=sn(r[2]),this.preview()}.bind(this))),a(\"fieldset\",\"\").children(a(\"label\",\"\").child(\"\".concat(L(\"print.orientation\"))),(r=a(\"select\",\"\")).children.apply(r,on(cn.map(function(t,e){return a(\"option\",\"\").attr(\"value\",e).child(\"\".concat(L(\"print.orientations\")[e]))}))).on(\"change\",function(t){var e=this.paper,n=t.target.value,r=cn[n];e.orientation=r,this.preview()}.bind(this))))))).hide()}var e,n,r;return e=t,(n=[{key:\"resetData\",value:function(t){this.data=t}},{key:\"preview\",value:function(){var t=this,e=this.data,n=this.paper,r=n.width,i=n.height,o=n.padding,l=r-2*o,c=i-2*o,s=e.contentRange(),u=parseInt(s.h/c,10)+1,f=l/s.w,h=o,p=o;f>1&&(h+=(l-s.w)/2);var d=0,y=0;this.contentEl.html(\"\"),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},b=function(n){var o=0,l=0,u=a(\"div\",\"\".concat(mt,\"-canvas-card\")),b=a(\"canvas\",\"\".concat(mt,\"-canvas\"));t.canvases.push(b.el);var g=new je(b.el,r,i);for(g.save(),g.translate(h,p),f<1&&g.scale(f,f);d<=s.eri;d+=1){var m=e.rows.getHeight(d);if(!((o+=m)<c)){l=-(o-m);break}for(var w=0;w<=s.eci;w+=1)Ge(g,e,d,w,y),v.eci=w}v.eri=d,g.restore(),g.save(),g.translate(h,p),f<1&&g.scale(f,f);var k=y;e.eachMergesInView(v,function(t){var n=t.sri,r=t.sci;Ge(g,e,n,r,k)}),g.restore(),v.sri=v.eri,v.sci=v.eci,y+=l,t.contentEl.child(a(\"div\",\"\".concat(mt,\"-canvas-card-wraper\")).child(u.child(b)))},g=0;g<u;g+=1)b();this.el.show()}},{key:\"toPrint\",value:function(){this.el.hide();var t=this.paper,e=a(\"iframe\",\"\").hide().el;window.document.body.appendChild(e);var n=e.contentWindow,r=n.document,i=document.createElement(\"style\");i.innerHTML=\"\\n      @page { size: \".concat(t.width,\"px \").concat(t.height,\"px; };\\n      canvas {\\n        page-break-before: auto;        \\n        page-break-after: always;\\n        image-rendering: pixelated;\\n      };\\n    \"),r.head.appendChild(i),this.canvases.forEach(function(t){var e=t.cloneNode(!1);e.getContext(\"2d\").drawImage(t,0,0),r.body.appendChild(e)}),n.print()}}])&&an(e.prototype,n),r&&an(e,r),t}();function hn(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function pn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var dn=[{key:\"copy\",title:U(\"contextmenu.copy\"),label:\"Ctrl+C\"},{key:\"cut\",title:U(\"contextmenu.cut\"),label:\"Ctrl+X\"},{key:\"paste\",title:U(\"contextmenu.paste\"),label:\"Ctrl+V\"},{key:\"paste-value\",title:U(\"contextmenu.pasteValue\"),label:\"Ctrl+Shift+V\"},{key:\"paste-format\",title:U(\"contextmenu.pasteFormat\"),label:\"Ctrl+Alt+V\"},{key:\"divider\"},{key:\"insert-row\",title:U(\"contextmenu.insertRow\")},{key:\"insert-column\",title:U(\"contextmenu.insertColumn\")},{key:\"divider\"},{key:\"delete-row\",title:U(\"contextmenu.deleteRow\")},{key:\"delete-column\",title:U(\"contextmenu.deleteColumn\")},{key:\"delete-cell-text\",title:U(\"contextmenu.deleteCellText\")},{key:\"hide\",title:U(\"contextmenu.hide\")},{key:\"divider\"},{key:\"validation\",title:U(\"contextmenu.validation\")},{key:\"divider\"},{key:\"cell-printable\",title:U(\"contextmenu.cellprintable\")},{key:\"cell-non-printable\",title:U(\"contextmenu.cellnonprintable\")},{key:\"divider\"},{key:\"cell-editable\",title:U(\"contextmenu.celleditable\")},{key:\"cell-non-editable\",title:U(\"contextmenu.cellnoneditable\")}];function yn(){var t=this;return dn.map(function(e){return function(t){var e=this;return\"divider\"===t.key?a(\"div\",\"\".concat(mt,\"-item divider\")):a(\"div\",\"\".concat(mt,\"-item\")).on(\"click\",function(){e.itemClick(t.key),e.hide()}).children(t.title(),a(\"div\",\"label\").child(t.label||\"\"))}.call(t,e)})}var vn=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.menuItems=yn.call(this),this.el=(n=a(\"div\",\"\".concat(mt,\"-contextmenu\"))).children.apply(n,hn(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.isHide=r,this.setMode(\"range\")}var e,n,r;return e=t,(n=[{key:\"setMode\",value:function(t){var e=this.menuItems[12];\"row-col\"===t?e.show():e.hide()}},{key:\"hide\",value:function(){var t=this.el;t.hide(),yt(t)}},{key:\"setPosition\",value:function(t,e){if(!this.isHide){var n=this.el,r=n.show().offset().width,i=this.viewFn(),o=i.height/2,a=t;i.width-t<=r&&(a-=r),n.css(\"left\",\"\".concat(a,\"px\")),e>o?n.css(\"bottom\",\"\".concat(i.height-e,\"px\")).css(\"max-height\",\"\".concat(e,\"px\")).css(\"top\",\"auto\"):n.css(\"top\",\"\".concat(e,\"px\")).css(\"max-height\",\"\".concat(i.height-e,\"px\")).css(\"bottom\",\"auto\"),vt(n)}}}])&&pn(e.prototype,n),r&&pn(e,r),t}();function bn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var gn=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.tip=L(\"toolbar.\".concat(e.replace(/-[a-z]/g,function(t){return t[1].toUpperCase()}))),n&&(this.tip+=\" (\".concat(n,\")\")),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}var e,n,r;return e=t,(n=[{key:\"element\",value:function(){var t=this.tip;return a(\"div\",\"\".concat(mt,\"-toolbar-btn\")).on(\"mouseenter\",function(e){!function(t,e){if(!e.classList.contains(\"active\")){var n=e.getBoundingClientRect(),r=n.left,i=n.top,o=n.width,l=n.height,c=a(\"div\",\"\".concat(mt,\"-tooltip\")).html(t).show();document.body.appendChild(c.el);var s=c.box();c.css(\"left\",\"\".concat(r+o/2-s.width/2,\"px\")).css(\"top\",\"\".concat(i+l+2,\"px\")),pt(e,\"mouseleave\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}),pt(e,\"click\",function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})}}(t,e.target)}).attr(\"data-tooltip\",t)}},{key:\"setState\",value:function(){}}])&&bn(e.prototype,n),r&&bn(e,r),t}();function mn(t){return(mn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function kn(t,e){return!e||\"object\"!==mn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function On(t,e,n){return(On=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Sn(t){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xn(t,e){return(xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var En=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),kn(this,Sn(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xn(t,e)}(e,gn),n=e,(r=[{key:\"dropdown\",value:function(){}},{key:\"getValue\",value:function(t){return t}},{key:\"element\",value:function(){var t=this,n=this.tag;return this.dd=this.dropdown(),this.dd.change=function(e){return t.change(n,t.getValue(e))},On(Sn(e.prototype),\"element\",this).call(this).child(this.dd)}},{key:\"setState\",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}])&&wn(n.prototype,r),i&&wn(n,i),e}();function jn(t){return(jn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function _n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Cn(t,e){return!e||\"object\"!==jn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Tn(t){return(Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pn(t,e){return(Pn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var An=function(t){function e(t,n,r,i){var o,l;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(l=Cn(this,Tn(e).call(this,\"div\",\"\".concat(mt,\"-dropdown \").concat(i)))).title=t,l.change=function(){},l.headerClick=function(){},\"string\"==typeof t?l.title=a(\"div\",\"\".concat(mt,\"-dropdown-title\")).child(t):r&&l.title.addClass(\"arrow-left\"),l.contentEl=a(\"div\",\"\".concat(mt,\"-dropdown-content\")).css(\"width\",n).hide();for(var c=arguments.length,s=new Array(c>4?c-4:0),u=4;u<c;u++)s[u-4]=arguments[u];return(o=l).setContentChildren.apply(o,s),l.headerEl=a(\"div\",\"\".concat(mt,\"-dropdown-header\")),l.headerEl.on(\"click\",function(){\"block\"!==l.contentEl.css(\"display\")?l.show():l.hide()}).children(l.title,r?a(\"div\",\"\".concat(mt,\"-icon arrow-right\")).child(a(\"div\",\"\".concat(mt,\"-icon-img arrow-down\"))):\"\"),l.children(l.headerEl,l.contentEl),l}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pn(t,e)}(e,o),n=e,(r=[{key:\"setContentChildren\",value:function(){var t;(this.contentEl.html(\"\"),arguments.length>0)&&(t=this.contentEl).children.apply(t,arguments)}},{key:\"setTitle\",value:function(t){this.title.html(t),this.hide()}},{key:\"show\",value:function(){var t=this;this.contentEl.show(),this.parent().active(),vt(this.parent(),function(){t.hide()})}},{key:\"hide\",value:function(){this.parent().active(!1),this.contentEl.hide(),yt(this.parent())}}])&&_n(n.prototype,r),i&&_n(n,i),e}();function Rn(t){return(Rn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function In(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function zn(t,e){return!e||\"object\"!==Rn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Hn(t){return(Hn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mn(t,e){return(Mn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Nn=function(t){function e(t,n){var r,i;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var o=new Kt(\"align-\".concat(n)),l=t.map(function(t){return(e=\"align-\".concat(t),a(\"div\",\"\".concat(mt,\"-item\")).child(new Kt(e))).on(\"click\",function(){i.setTitle(t),i.change(t)});var e});return i=zn(this,(r=Hn(e)).call.apply(r,[this,o,\"auto\",!0,\"bottom-left\"].concat(In(l))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mn(t,e)}(e,An),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.setName(\"align-\".concat(t)),this.hide()}}])&&Dn(n.prototype,r),i&&Dn(n,i),e}();function Fn(t){return(Fn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vn(t,e){return!e||\"object\"!==Fn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function qn(t){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Bn(t,e){return(Bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ln=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Vn(this,qn(e).call(this,\"align\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bn(t,e)}(e,En),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new Nn([\"left\",\"center\",\"right\"],t)}}])&&Wn(n.prototype,r),i&&Wn(n,i),e}();function Un(t){return(Un=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $n(t,e){return!e||\"object\"!==Un(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Xn(t){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zn(t,e){return(Zn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Kn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),$n(this,Xn(e).call(this,\"valign\",\"\",t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zn(t,e)}(e,En),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.value;return new Nn([\"top\",\"middle\",\"bottom\"],t)}}])&&Yn(n.prototype,r),i&&Yn(n,i),e}();function Jn(t){return(Jn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qn(t,e){return!e||\"object\"!==Jn(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function tr(t,e,n){return(tr=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=er(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function er(t){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nr(t,e){return(nr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var rr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Qn(this,er(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nr(t,e)}(e,gn),n=e,(r=[{key:\"element\",value:function(){var t=this,n=this.tag;return tr(er(e.prototype),\"element\",this).call(this).child(new Kt(n)).on(\"click\",function(){return t.click()})}},{key:\"click\",value:function(){this.change(this.tag,this.toggle())}},{key:\"setState\",value:function(t){this.el.active(t)}},{key:\"toggle\",value:function(){return this.el.toggle()}},{key:\"active\",value:function(){return this.el.hasClass(\"active\")}}])&&Gn(n.prototype,r),i&&Gn(n,i),e}();function ir(t){return(ir=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function or(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ar(t,e){return!e||\"object\"!==ir(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function lr(t){return(lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cr(t,e){return(cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var sr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ar(this,lr(e).call(this,\"autofilter\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cr(t,e)}(e,rr),n=e,(r=[{key:\"setState\",value:function(){}}])&&or(n.prototype,r),i&&or(n,i),e}();function ur(t){return(ur=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function fr(t,e){return!e||\"object\"!==ur(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function hr(t){return(hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pr(t,e){return(pr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var dr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),fr(this,hr(e).call(this,\"font-bold\",\"Ctrl+B\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pr(t,e)}(e,rr),e}();function yr(t){return(yr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function vr(t,e){return!e||\"object\"!==yr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function br(t){return(br=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gr(t,e){return(gr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var mr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),vr(this,br(e).call(this,\"font-italic\",\"Ctrl+I\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gr(t,e)}(e,rr),e}();function wr(t){return(wr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function kr(t,e){return!e||\"object\"!==wr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Or(t){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Sr(t,e){return(Sr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var xr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),kr(this,Or(e).call(this,\"strike\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Sr(t,e)}(e,rr),e}();function Er(t){return(Er=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function jr(t,e){return!e||\"object\"!==Er(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function _r(t){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cr(t,e){return(Cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Tr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),jr(this,_r(e).call(this,\"underline\",\"Ctrl+U\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cr(t,e)}(e,rr),e}();function Pr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}var Ar=[\"#ffffff\",\"#000100\",\"#e7e5e6\",\"#445569\",\"#5b9cd6\",\"#ed7d31\",\"#a5a5a5\",\"#ffc001\",\"#4371c6\",\"#71ae47\"],Rr=[[\"#f2f2f2\",\"#7f7f7f\",\"#d0cecf\",\"#d5dce4\",\"#deeaf6\",\"#fce5d5\",\"#ededed\",\"#fff2cd\",\"#d9e2f3\",\"#e3efd9\"],[\"#d8d8d8\",\"#595959\",\"#afabac\",\"#adb8ca\",\"#bdd7ee\",\"#f7ccac\",\"#dbdbdb\",\"#ffe59a\",\"#b3c6e7\",\"#c5e0b3\"],[\"#bfbfbf\",\"#3f3f3f\",\"#756f6f\",\"#8596b0\",\"#9cc2e6\",\"#f4b184\",\"#c9c9c9\",\"#fed964\",\"#8eaada\",\"#a7d08c\"],[\"#a5a5a5\",\"#262626\",\"#3a3839\",\"#333f4f\",\"#2e75b5\",\"#c45a10\",\"#7b7b7b\",\"#bf8e01\",\"#2f5596\",\"#538136\"],[\"#7f7f7f\",\"#0c0c0c\",\"#171516\",\"#222a35\",\"#1f4e7a\",\"#843c0a\",\"#525252\",\"#7e6000\",\"#203864\",\"#365624\"]],Ir=[\"#c00000\",\"#fe0000\",\"#fdc101\",\"#ffff01\",\"#93d051\",\"#00b04e\",\"#01b0f1\",\"#0170c1\",\"#012060\",\"#7030a0\"];function Dr(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(mt,\"-color-palette-cell\")).on(\"click.stop\",function(){return e.change(t)}).css(\"background-color\",t))}var zr=function t(){var e,n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.el=a(\"div\",\"\".concat(mt,\"-color-palette\")),this.change=function(){};var o=a(\"table\",\"\").children((e=a(\"tbody\",\"\")).children.apply(e,[(n=a(\"tr\",\"\".concat(mt,\"-theme-color-placeholders\"))).children.apply(n,Pr(Ar.map(function(t){return Dr.call(i,t)})))].concat(Pr(Rr.map(function(t){var e;return(e=a(\"tr\",\"\".concat(mt,\"-theme-colors\"))).children.apply(e,Pr(t.map(function(t){return Dr.call(i,t)})))})),[(r=a(\"tr\",\"\".concat(mt,\"-standard-colors\"))).children.apply(r,Pr(Ir.map(function(t){return Dr.call(i,t)})))])));this.el.child(o)};function Hr(t){return(Hr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nr(t,e){return!e||\"object\"!==Hr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Fr(t){return(Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wr(t,e){return(Wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Vr=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Kt(t).css(\"height\",\"16px\").css(\"border-bottom\",\"3px solid \".concat(n)),o=new zr;return o.change=function(t){r.setTitle(t),r.change(t)},r=Nr(this,Fr(e).call(this,i,\"auto\",!1,\"bottom-left\",o.el))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wr(t,e)}(e,An),n=e,(r=[{key:\"setTitle\",value:function(t){this.title.css(\"border-color\",t),this.hide()}}])&&Mr(n.prototype,r),i&&Mr(n,i),e}();function qr(t){return(qr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Br(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Lr(t,e){return!e||\"object\"!==qr(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ur(t){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yr(t,e){return(Yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var $r=[[\"thin\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"medium\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"2\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.0\" x2=\"50\" y2=\"1.0\" stroke-width=\"2\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"thick\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"3\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.5\" x2=\"50\" y2=\"1.5\" stroke-width=\"3\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],[\"dashed\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"2\" style=\"user-select: none;\"></line></svg>'],[\"dotted\",'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"1\" style=\"user-select: none;\"></line></svg>']],Xr=function(t){function e(t){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var i=new Kt(\"line-type\"),o=0,l=$r.map(function(e,n){return a(\"div\",\"\".concat(mt,\"-item state \").concat(t===e[0]?\"checked\":\"\")).on(\"click\",function(){l[o].toggle(\"checked\"),l[n].toggle(\"checked\"),o=n,r.hide(),r.change(e)}).child(a(\"div\",\"\".concat(mt,\"-line-type\")).html(e[1]))});return r=Lr(this,(n=Ur(e)).call.apply(n,[this,i,\"auto\",!1,\"bottom-left\"].concat(Br(l))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yr(t,e)}(e,An),e}();function Zr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Kr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Jr(){var t;return a(\"table\",\"\").child((t=a(\"tbody\",\"\")).children.apply(t,arguments))}function Gr(t){var e=this;return a(\"td\",\"\").child(a(\"div\",\"\".concat(mt,\"-border-palette-cell\")).child(new Kt(\"border-\".concat(t))).on(\"click\",function(){e.mode=t;var n=e.mode,r=e.style,i=e.color;e.change({mode:n,style:r,color:i})}))}var Qr=function t(){var e,n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.color=\"#000\",this.style=\"thin\",this.mode=\"all\",this.change=function(){},this.ddColor=new Vr(\"line-color\",this.color),this.ddColor.change=function(t){r.color=t},this.ddType=new Xr(this.style),this.ddType.change=function(t){var e=Kr(t,1)[0];r.style=e},this.el=a(\"div\",\"\".concat(mt,\"-border-palette\"));var i=Jr(a(\"tr\",\"\").children(a(\"td\",\"\".concat(mt,\"-border-palette-left\")).child(Jr((e=a(\"tr\",\"\")).children.apply(e,Zr([\"all\",\"inside\",\"horizontal\",\"vertical\",\"outside\"].map(function(t){return Gr.call(r,t)}))),(n=a(\"tr\",\"\")).children.apply(n,Zr([\"left\",\"top\",\"right\",\"bottom\",\"none\"].map(function(t){return Gr.call(r,t)}))))),a(\"td\",\"\".concat(mt,\"-border-palette-right\")).children(a(\"div\",\"\".concat(mt,\"-toolbar-btn\")).child(this.ddColor.el),a(\"div\",\"\".concat(mt,\"-toolbar-btn\")).child(this.ddType.el))));this.el.child(i)};function ti(t){return(ti=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ei(t,e){return!e||\"object\"!==ti(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ni(t){return(ni=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ri(t,e){return(ri=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ii=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new Kt(\"border-all\"),r=new Qr;return r.change=function(e){t.change(e),t.hide()},t=ei(this,ni(e).call(this,n,\"auto\",!1,\"bottom-left\",r.el))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ri(t,e)}(e,An),e}();function oi(t){return(oi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function li(t,e){return!e||\"object\"!==oi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ci(t){return(ci=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function si(t,e){return(si=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ui=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),li(this,ci(e).call(this,\"border\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&si(t,e)}(e,En),n=e,(r=[{key:\"dropdown\",value:function(){return new ii}}])&&ai(n.prototype,r),i&&ai(n,i),e}();function fi(t){return(fi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pi(t,e){return!e||\"object\"!==fi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function di(t,e,n){return(di=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=yi(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function yi(t){return(yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vi(t,e){return(vi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var bi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),pi(this,yi(e).apply(this,arguments))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vi(t,e)}(e,gn),n=e,(r=[{key:\"element\",value:function(){var t=this;return di(yi(e.prototype),\"element\",this).call(this).child(new Kt(this.tag)).on(\"click\",function(){return t.change(t.tag)})}},{key:\"setState\",value:function(t){this.el.disabled(t)}}])&&hi(n.prototype,r),i&&hi(n,i),e}();function gi(t){return(gi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function mi(t,e){return!e||\"object\"!==gi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function wi(t){return(wi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ki(t,e){return(ki=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Oi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),mi(this,wi(e).call(this,\"clearformat\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ki(t,e)}(e,bi),e}();function Si(t){return(Si=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ei(t,e){return!e||\"object\"!==Si(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ji(t){return(ji=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _i(t,e){return(_i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ci=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ei(this,ji(e).call(this,\"paintformat\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_i(t,e)}(e,rr),n=e,(r=[{key:\"setState\",value:function(){}}])&&xi(n.prototype,r),i&&xi(n,i),e}();function Ti(t){return(Ti=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Pi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ai(t,e){return!e||\"object\"!==Ti(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ri(t){return(Ri=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ii(t,e){return(Ii=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Di=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Ai(this,Ri(e).call(this,\"color\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ii(t,e)}(e,En),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new Vr(t,e)}}])&&Pi(n.prototype,r),i&&Pi(n,i),e}();function zi(t){return(zi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mi(t,e){return!e||\"object\"!==zi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ni(t){return(Ni=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fi(t,e){return(Fi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Wi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Mi(this,Ni(e).call(this,\"bgcolor\",void 0,t))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fi(t,e)}(e,En),n=e,(r=[{key:\"dropdown\",value:function(){var t=this.tag,e=this.value;return new Vr(t,e)}}])&&Hi(n.prototype,r),i&&Hi(n,i),e}();function Vi(t){return(Vi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function qi(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Bi(t,e){return!e||\"object\"!==Vi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Li(t){return(Li=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ui(t,e){return(Ui=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Yi=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Ce.map(function(t){return a(\"div\",\"\".concat(mt,\"-item\")).on(\"click\",function(){n.setTitle(\"\".concat(t.pt)),n.change(t)}).child(\"\".concat(t.pt))});return n=Bi(this,(t=Li(e)).call.apply(t,[this,\"10\",\"60px\",!0,\"bottom-left\"].concat(qi(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ui(t,e)}(e,An),e}();function $i(t){return($i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Zi(t,e){return!e||\"object\"!==$i(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ki(t){return(Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ji(t,e){return(Ji=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Gi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Zi(this,Ki(e).call(this,\"font-size\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ji(t,e)}(e,En),n=e,(r=[{key:\"getValue\",value:function(t){return t.pt}},{key:\"dropdown\",value:function(){return new Yi}}])&&Xi(n.prototype,r),i&&Xi(n,i),e}();function Qi(t){return(Qi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function to(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function eo(t,e){return!e||\"object\"!==Qi(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function no(t){return(no=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ro(t,e){return(ro=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var io=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=_e.map(function(t){return a(\"div\",\"\".concat(mt,\"-item\")).on(\"click\",function(){n.setTitle(t.title),n.change(t)}).child(t.title)});return n=eo(this,(t=no(e)).call.apply(t,[this,_e[0].title,\"160px\",!0,\"bottom-left\"].concat(to(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ro(t,e)}(e,An),e}();function oo(t){return(oo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lo(t,e){return!e||\"object\"!==oo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function co(t){return(co=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function so(t,e){return(so=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var uo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),lo(this,co(e).call(this,\"font-name\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}(e,En),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new io}}])&&ao(n.prototype,r),i&&ao(n,i),e}();function fo(t){return(fo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ho(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yo(t,e){return!e||\"object\"!==fo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function vo(t){return(vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bo(t,e){return(bo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var go=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=Le.slice(0);return r.splice(2,0,{key:\"divider\"}),r.splice(8,0,{key:\"divider\"}),r=r.map(function(t){var e=a(\"div\",\"\".concat(mt,\"-item\"));return\"divider\"===t.key?e.addClass(\"divider\"):(e.child(t.title()).on(\"click\",function(){n.setTitle(t.title()),n.change(t)}),t.label&&e.child(a(\"div\",\"label\").html(t.label))),e}),n=yo(this,(t=vo(e)).call.apply(t,[this,\"Normal\",\"220px\",!0,\"bottom-left\"].concat(ho(r))))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bo(t,e)}(e,An),n=e,(r=[{key:\"setTitle\",value:function(t){for(var e=0;e<Le.length;e+=1)Le[e].key===t&&this.title.html(Le[e].title());this.hide()}}])&&po(n.prototype,r),i&&po(n,i),e}();function mo(t){return(mo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ko(t,e){return!e||\"object\"!==mo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function So(t,e){return(So=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var xo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ko(this,Oo(e).call(this,\"format\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&So(t,e)}(e,En),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new go}}])&&wo(n.prototype,r),i&&wo(n,i),e}();function Eo(t){return(Eo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function jo(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function _o(t,e){return!e||\"object\"!==Eo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Co(t){return(Co=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function To(t,e){return(To=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Po=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=He.map(function(t){return a(\"div\",\"\".concat(mt,\"-item\")).on(\"click\",function(){n.hide(),n.change(t)}).child(t.key)});return n=_o(this,(t=Co(e)).call.apply(t,[this,new Kt(\"formula\"),\"180px\",!0,\"bottom-left\"].concat(jo(r))))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&To(t,e)}(e,An),e}();function Ao(t){return(Ao=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Io(t,e){return!e||\"object\"!==Ao(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Do(t){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zo(t,e){return(zo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ho=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Io(this,Do(e).call(this,\"formula\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zo(t,e)}(e,En),n=e,(r=[{key:\"getValue\",value:function(t){return t.key}},{key:\"dropdown\",value:function(){return new Po}}])&&Ro(n.prototype,r),i&&Ro(n,i),e}();function Mo(t){return(Mo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function No(t,e){return!e||\"object\"!==Mo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Fo(t){return(Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wo(t,e){return(Wo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Vo=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),No(this,Fo(e).call(this,\"freeze\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wo(t,e)}(e,rr),e}();function qo(t){return(qo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lo(t,e){return!e||\"object\"!==qo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Uo(t){return(Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yo(t,e){return(Yo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var $o=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Lo(this,Uo(e).call(this,\"merge\"))}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yo(t,e)}(e,rr),n=e,(r=[{key:\"setState\",value:function(t,e){this.el.active(t).disabled(e)}}])&&Bo(n.prototype,r),i&&Bo(n,i),e}();function Xo(t){return(Xo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Zo(t,e){return!e||\"object\"!==Xo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Ko(t){return(Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jo(t,e){return(Jo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Go=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Zo(this,Ko(e).call(this,\"redo\",\"Ctrl+Y\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jo(t,e)}(e,bi),e}();function Qo(t){return(Qo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ta(t,e){return!e||\"object\"!==Qo(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ea(t){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function na(t,e){return(na=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ra=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ta(this,ea(e).call(this,\"undo\",\"Ctrl+Z\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&na(t,e)}(e,bi),e}();function ia(t){return(ia=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function oa(t,e){return!e||\"object\"!==ia(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function aa(t){return(aa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function la(t,e){return(la=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ca=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),oa(this,aa(e).call(this,\"print\",\"Ctrl+P\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&la(t,e)}(e,bi),e}();function sa(t){return(sa=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function ua(t,e){return!e||\"object\"!==sa(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function fa(t){return(fa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ha(t,e){return(ha=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var pa=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),ua(this,fa(e).call(this,\"textwrap\"))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ha(t,e)}(e,rr),e}();function da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ya(t){return(ya=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function va(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function ba(t,e){return!e||\"object\"!==ya(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function ga(t){return(ga=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ma(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wa(t,e)}function wa(t,e){return(wa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ka=function(t){function e(){var t;va(this,e);var n=new Kt(\"ellipsis\"),r=a(\"div\",\"\".concat(mt,\"-toolbar-more\"));return(t=ba(this,ga(e).call(this,n,\"auto\",!1,\"bottom-right\",r))).moreBtns=r,t.contentEl.css(\"max-width\",\"420px\"),t}return ma(e,An),e}(),Oa=function(t){function e(){var t;return va(this,e),(t=ba(this,ga(e).call(this,\"more\"))).el.hide(),t}var n,r,i;return ma(e,En),n=e,(r=[{key:\"dropdown\",value:function(){return new ka}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide()}}])&&da(n.prototype,r),i&&da(n,i),e}();function Sa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Ea(){return a(\"div\",\"\".concat(mt,\"-toolbar-divider\"))}function ja(){var t,e,n=this.el,r=this.btns,i=this.moreEl,o=this.btns2,a=i.dd,l=a.moreBtns,c=a.contentEl;n.css(\"width\",\"\".concat(this.widthFn()-60,\"px\"));var s=n.box(),u=160,f=12,h=[],p=[];o.forEach(function(t,e){var n=xa(t,2),r=n[0],i=n[1];u+=i,e===o.length-1||u<s.width?h.push(r):(f+=i,p.push(r))}),(t=r.html(\"\")).children.apply(t,h),(e=l.html(\"\")).children.apply(e,p),c.css(\"width\",\"\".concat(f,\"px\")),p.length>0?i.show():i.hide()}var _a=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.data=e,this.change=function(){},this.widthFn=n,this.isHide=i;var o=e.defaultStyle();this.items=[[this.undoEl=new ra,this.redoEl=new Go,new ca,this.paintformatEl=new Ci,this.clearformatEl=new Oi],Ea(),[this.formatEl=new xo],Ea(),[this.fontEl=new uo,this.fontSizeEl=new Gi],Ea(),[this.boldEl=new dr,this.italicEl=new mr,this.underlineEl=new Tr,this.strikeEl=new xr,this.textColorEl=new Di(o.color)],Ea(),[this.fillColorEl=new Wi(o.bgcolor),this.borderEl=new ui,this.mergeEl=new $o],Ea(),[this.alignEl=new Ln(o.align),this.valignEl=new Kn(o.valign),this.textwrapEl=new pa],Ea(),[this.freezeEl=new Vo,this.autofilterEl=new sr,this.formulaEl=new Ho,this.moreEl=new Oa]],this.el=a(\"div\",\"\".concat(mt,\"-toolbar\")),this.btns=a(\"div\",\"\".concat(mt,\"-toolbar-btns\")),this.items.forEach(function(t){Array.isArray(t)?t.forEach(function(t){r.btns.child(t.el),t.change=function(){r.change.apply(r,arguments)}}):r.btns.child(t.el)}),this.el.child(this.btns),i?this.el.hide():(this.reset(),setTimeout(function(){(function(){var t=this;this.btns2=[],this.items.forEach(function(e){if(Array.isArray(e))e.forEach(function(e){var n=e.el,r=n.box(),i=n.computedStyle(),o=i.marginLeft,a=i.marginRight;t.btns2.push([n,r.width+parseInt(o,10)+parseInt(a,10)])});else{var n=e.box(),r=e.computedStyle(),i=r.marginLeft,o=r.marginRight;t.btns2.push([e,n.width+parseInt(i,10)+parseInt(o,10)])}})}).call(r),ja.call(r)},0),pt(window,\"resize\",function(){ja.call(r)}))}var e,n,r;return e=t,(n=[{key:\"paintformatActive\",value:function(){return this.paintformatEl.active()}},{key:\"paintformatToggle\",value:function(){this.paintformatEl.toggle()}},{key:\"trigger\",value:function(t){this[\"\".concat(t,\"El\")].click()}},{key:\"resetData\",value:function(t){this.data=t,this.reset()}},{key:\"reset\",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle();this.undoEl.setState(!t.canUndo()),this.redoEl.setState(!t.canRedo()),this.mergeEl.setState(t.canUnmerge(),!t.selector.multiple()),this.autofilterEl.setState(!t.canAutofilter());var n=e.font,r=e.format;this.formatEl.setState(r),this.fontEl.setState(n.name),this.fontSizeEl.setState(n.size),this.boldEl.setState(n.bold),this.italicEl.setState(n.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive())}}}])&&Sa(e.prototype,n),r&&Sa(e,r),t}();function Ca(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function Ta(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Pa=function(){function t(e,n){var r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"600px\";!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.title=e,this.el=a(\"div\",\"\".concat(mt,\"-modal\")).css(\"width\",o).children(a(\"div\",\"\".concat(mt,\"-modal-header\")).children(new Kt(\"close\").on(\"click.stop\",function(){return i.hide()}),this.title),(r=a(\"div\",\"\".concat(mt,\"-modal-content\"))).children.apply(r,Ca(n))).hide()}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){var t=this;this.dimmer=a(\"div\",\"\".concat(mt,\"-dimmer active\")),document.body.appendChild(this.dimmer.el);var e=this.el.show().box(),n=e.width,r=e.height,i=document.documentElement,o=i.clientHeight,l=i.clientWidth;this.el.offset({left:(l-n)/2,top:(o-r)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},pt(window,\"keydown\",window.xkeydownEsc)}},{key:\"hide\",value:function(){this.el.hide(),document.body.removeChild(this.dimmer.el),dt(window,\"keydown\",window.xkeydownEsc),delete window.xkeydownEsc}}])&&Ta(e.prototype,n),r&&Ta(e,r),t}();function Aa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ra=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.vchange=function(){},this.el=a(\"div\",\"\".concat(mt,\"-form-input\")),this.input=a(\"input\",\"\").css(\"width\",e).on(\"input\",function(t){return r.vchange(t)}).attr(\"placeholder\",n),this.el.child(this.input)}var e,n,r;return e=t,(n=[{key:\"focus\",value:function(){var t=this;setTimeout(function(){t.input.el.focus()},10)}},{key:\"hint\",value:function(t){this.input.attr(\"placeholder\",t)}},{key:\"val\",value:function(t){return this.input.val(t)}}])&&Aa(e.prototype,n),r&&Aa(e,r),t}();function Ia(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Da=function(){function t(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.key=e,this.getTitle=o,this.vchange=function(){},this.el=a(\"div\",\"\".concat(mt,\"-form-select\")),this.suggest=new Lt(n.map(function(t){return{key:t,title:i.getTitle(t)}}),function(t){i.itemClick(t.key),l(t.key),i.vchange(t.key)},r,this.el),this.el.children(this.itemEl=a(\"div\",\"input-text\").html(this.getTitle(e)),this.suggest.el).on(\"click\",function(){return i.show()})}var e,n,r;return e=t,(n=[{key:\"show\",value:function(){this.suggest.search(\"\")}},{key:\"itemClick\",value:function(t){this.key=t,this.itemEl.html(this.getTitle(t))}},{key:\"val\",value:function(t){return void 0!==t?(this.key=t,this.itemEl.html(this.getTitle(t)),this):this.key}}])&&Ia(e.prototype,n),r&&Ia(e,r),t}();function za(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ha={number:/(^\\d+$)|(^\\d+(\\.\\d{0,4})?$)/,date:/^\\d{4}-\\d{1,2}-\\d{1,2}$/},Ma=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.label=\"\",this.rule=n,r&&(this.label=a(\"label\",\"label\").css(\"width\",\"\".concat(i,\"px\")).html(r)),this.tip=a(\"div\",\"tip\").child(\"tip\").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=a(\"div\",\"\".concat(mt,\"-form-field\")).children(this.label,e.el,this.tip)}var e,n,r;return e=t,(n=[{key:\"isShow\",value:function(){return\"none\"!==this.el.css(\"display\")}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){return this.el.hide(),this}},{key:\"val\",value:function(t){return this.input.val(t)}},{key:\"hint\",value:function(t){this.input.hint(t)}},{key:\"validate\",value:function(){var t=this.input,e=this.rule,n=this.tip,r=this.el,i=t.val();if(e.required&&/^\\s*$/.test(i))return n.html(L(\"validation.required\")),r.addClass(\"error\"),!1;if((e.type||e.pattern)&&!(e.pattern||Ha[e.type]).test(i))return n.html(L(\"validation.notMatch\")),r.addClass(\"error\"),!1;return r.removeClass(\"error\"),!0}}])&&za(e.prototype,n),r&&za(e,r),t}();function Na(t){return(Na=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Fa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wa(t,e){return!e||\"object\"!==Na(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function Va(t){return(Va=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qa(t,e){return(qa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ba=100,La=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var n=new Ma(new Da(\"cell\",[\"cell\"],\"100%\",function(t){return L(\"dataValidation.modeType.\".concat(t))}),{required:!0},\"\".concat(L(\"dataValidation.range\"),\":\"),Ba),r=new Ma(new Ra(\"120px\",\"E3 or E3:F12\"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\\d*)(:[A-Z]{1,2}[1-9]\\d*)?$/}),i=new Ma(new Da(\"list\",[\"list\",\"number\",\"date\",\"phone\",\"email\"],\"100%\",function(t){return L(\"dataValidation.type.\".concat(t))},function(e){return t.criteriaSelected(e)}),{required:!0},\"\".concat(L(\"dataValidation.criteria\"),\":\"),Ba),o=new Ma(new Da(\"be\",[\"be\",\"nbe\",\"eq\",\"neq\",\"lt\",\"lte\",\"gt\",\"gte\"],\"160px\",function(t){return L(\"dataValidation.operator.\".concat(t))},function(e){return t.criteriaOperatorSelected(e)}),{required:!0}).hide(),l=new Ma(new Ra(\"70px\",\"10\"),{required:!0}).hide(),c=new Ma(new Ra(\"70px\",\"100\"),{required:!0,type:\"number\"}).hide(),s=new Ma(new Ra(\"120px\",\"a,b,c\"),{required:!0}),u=new Ma(new Ra(\"70px\",\"10\"),{required:!0,type:\"number\"}).hide();return(t=Wa(this,Va(e).call(this,L(\"contextmenu.validation\"),[a(\"div\",\"\".concat(mt,\"-form-fields\")).children(n.el,r.el),a(\"div\",\"\".concat(mt,\"-form-fields\")).children(i.el,o.el,l.el,c.el,u.el,s.el),a(\"div\",\"\".concat(mt,\"-buttons\")).children(new de(\"cancel\").on(\"click\",function(){return t.btnClick(\"cancel\")}),new de(\"remove\").on(\"click\",function(){return t.btnClick(\"remove\")}),new de(\"save\",\"primary\").on(\"click\",function(){return t.btnClick(\"save\")}))]))).mf=n,t.rf=r,t.cf=i,t.of=o,t.minvf=l,t.maxvf=c,t.vf=u,t.svf=s,t.change=function(){},t}var n,r,i;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qa(t,e)}(e,Pa),n=e,(r=[{key:\"showVf\",value:function(t){var e=\"date\"===t?\"2018-11-12\":\"10\",n=this.vf;n.input.hint(e),n.show()}},{key:\"criteriaSelected\",value:function(t){var e=this.of,n=this.minvf,r=this.maxvf,i=this.vf,o=this.svf;\"date\"===t||\"number\"===t?(e.show(),n.rule.type=t,r.rule.type=t,\"date\"===t?(n.hint(\"2018-11-12\"),r.hint(\"2019-11-12\")):(n.hint(\"10\"),r.hint(\"100\")),n.show(),r.show(),i.hide(),o.hide()):(\"list\"===t?o.show():o.hide(),i.hide(),e.hide(),n.hide(),r.hide())}},{key:\"criteriaOperatorSelected\",value:function(t){if(t){var e=this.minvf,n=this.maxvf,r=this.vf;if(\"be\"===t||\"nbe\"===t)e.show(),n.show(),r.hide();else{var i=this.cf.val();r.rule.type=i,\"date\"===i?r.hint(\"2018-11-12\"):r.hint(\"10\"),r.show(),e.hide(),n.hide()}}}},{key:\"btnClick\",value:function(t){if(\"cancel\"===t)this.hide();else if(\"remove\"===t)this.change(\"remove\"),this.hide();else if(\"save\"===t){for(var e=[\"mf\",\"rf\",\"cf\",\"of\",\"svf\",\"vf\",\"minvf\",\"maxvf\"],n=0;n<e.length;n+=1){var r=this[e[n]];if(r.isShow()&&!r.validate())return}var i=this.mf.val(),o=this.rf.val(),a=this.cf.val(),l=this.of.val(),c=this.svf.val();\"number\"!==a&&\"date\"!==a||(c=\"be\"===l||\"nbe\"===l?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change(\"save\",i,o,{type:a,operator:l,required:!1,value:c}),this.hide()}}},{key:\"setValue\",value:function(t){if(t){var e=this.mf,n=this.rf,r=this.cf,i=this.of,o=this.svf,a=this.vf,l=this.minvf,c=this.maxvf,s=t.mode,u=t.ref,f=t.validator||{type:\"list\"},h=f.type,p=f.operator,d=f.value;e.val(s||\"cell\"),n.val(u),r.val(h),i.val(p),Array.isArray(d)?(l.val(d[0]),c.val(d[1])):(o.val(d||\"\"),a.val(d||\"\")),this.criteriaSelected(h),this.criteriaOperatorSelected(p)}this.show()}}])&&Fa(n.prototype,r),i&&Fa(n,i),e}();function Ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ya(t){return a(\"div\",\"\".concat(mt,\"-item \").concat(t))}function $a(t){var e=this;return Ya(\"state\").child(L(\"sort.\".concat(t))).on(\"click.stop\",function(){return e.itemClick(t)})}function Xa(){var t=this.filterhEl,e=this.filterValues,n=this.values;t.html(\"\".concat(e.length,\" / \").concat(n.length)),t.checked(e.length===n.length)}var Za=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.filterbEl=a(\"div\",\"\".concat(mt,\"-body\")),this.filterhEl=a(\"div\",\"\".concat(mt,\"-header state\")).on(\"click.stop\",function(){return e.filterClick(0,\"all\")}),this.el=a(\"div\",\"\".concat(mt,\"-sort-filter\")).children(this.sortAscEl=$a.call(this,\"asc\"),this.sortDescEl=$a.call(this,\"desc\"),Ya(\"divider\"),a(\"div\",\"\".concat(mt,\"-filter\")).children(this.filterhEl,this.filterbEl),a(\"div\",\"\".concat(mt,\"-buttons\")).children(new de(\"cancel\").on(\"click\",function(){return e.btnClick(\"cancel\")}),new de(\"ok\",\"primary\").on(\"click\",function(){return e.btnClick(\"ok\")}))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}var e,n,r;return e=t,(n=[{key:\"btnClick\",value:function(t){if(\"ok\"===t){var e=this.ci,n=this.sort,r=this.filterValues;this.ok&&this.ok(e,n,\"in\",r)}this.hide()}},{key:\"itemClick\",value:function(t){this.sort=t;var e=this.sortAscEl,n=this.sortDescEl;e.checked(\"asc\"===t),n.checked(\"desc\"===t)}},{key:\"filterClick\",value:function(t,e){var n=this.filterbEl,r=this.filterValues,i=this.values,o=n.children();\"all\"===e?o.length===r.length?(this.filterValues=[],o.forEach(function(t){return a(t).checked(!1)})):(this.filterValues=Array.from(i),o.forEach(function(t){return a(t).checked(!0)})):a(o[t]).toggle(\"checked\")?r.push(e):r.splice(r.findIndex(function(t){return t===e}),1);Xa.call(this)}},{key:\"set\",value:function(t,e,n,r){this.ci=t;var i=this.sortAscEl,o=this.sortDescEl;null!==r?(this.sort=r.order,i.checked(r.asc()),o.checked(r.desc())):(this.sortDesc=null,i.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=n?Array.from(n.value):Object.keys(e),function(t){var e=this,n=this.filterbEl,r=this.filterValues;n.html(\"\"),Object.keys(t).forEach(function(i,o){var l=t[i],c=r.includes(i)?\"checked\":\"\";n.child(a(\"div\",\"\".concat(mt,\"-item state \").concat(c)).on(\"click.stop\",function(){return e.filterClick(o,i)}).children(\"\"===i?L(\"filter.empty\"):i,a(\"div\",\"label\").html(\"(\".concat(l,\")\"))))})}.call(this,e,n),Xa.call(this)}},{key:\"setOffset\",value:function(t){var e=this;this.el.offset(t).show();var n=1;vt(this.el,function(){n<=0&&e.hide(),n-=1})}},{key:\"show\",value:function(){this.el.show()}},{key:\"hide\",value:function(){this.el.hide(),yt(this.el)}}])&&Ua(e.prototype,n),r&&Ua(e,r),t}();function Ka(t,e){var n=a(\"div\",\"\".concat(mt,\"-toast\")),r=a(\"div\",\"\".concat(mt,\"-dimmer active\"));n.children(a(\"div\",\"\".concat(mt,\"-toast-header\")).children(new Kt(\"close\").on(\"click.stop\",function(){return document.body.removeChild(n.el),void document.body.removeChild(r.el)}),t),a(\"div\",\"\".concat(mt,\"-toast-content\")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var i=n.box(),o=i.width,l=i.height,c=document.documentElement,s=c.clientHeight,u=c.clientWidth;n.offset({left:(u-o)/2,top:(s-l)/3})}function Ja(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ga(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Qa(t,e){var n,r=this;return function(){for(var i=r,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=a;n||(n=setTimeout(function(){n=null,t.apply(i,c)},e))}}function tl(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==n){var o=this.table,a=this.selector,l=this.toolbar,c=this.data;this.contextMenu.setMode(-1===e||-1===n?\"row-col\":\"range\");var s=c.getCell(e,n);t?(a.setEnd(e,n,i),this.trigger(\"cells-selected\",s,a.range)):(a.set(e,n,r),this.trigger(\"cell-selected\",s,e,n)),l.reset(),o.render()}}function el(t,e){var n=this.selector,r=this.data,i=r.rows,o=r.cols,a=Ga(n.indexes,2),l=a[0],c=a[1],s=n.range,u=s.eri,f=s.eci;if(t){var h=Ga(n.moveIndexes,2);l=h[0],c=h[1]}\"left\"===e?c>0&&(c-=1):\"right\"===e?(f!==c&&(c=f),c<o.len-1&&(c+=1)):\"up\"===e?l>0&&(l-=1):\"down\"===e?(u!==l&&(l=u),l<i.len-1&&(l+=1)):\"row-first\"===e?c=0:\"row-last\"===e?c=o.len-1:\"col-first\"===e?l=0:\"col-last\"===e&&(l=i.len-1),t&&(n.moveIndexes=[l,c]),tl.call(this,t,l,c),function(){var t=this.data,e=this.verticalScrollbar,n=this.horizontalScrollbar,r=t.getSelectedRect(),i=r.l,o=r.t,a=r.left,l=r.top,c=r.width,s=r.height,u=this.getTableOffset();if(Math.abs(a)+c>u.width)n.move({left:i+c-u.width});else{var f=t.freezeTotalWidth();a<f&&n.move({left:i-1-f})}if(Math.abs(l)+s>u.height)e.move({top:o+s-u.height-1});else{var h=t.freezeTotalHeight();l<h&&e.move({top:o-1-h})}}.call(this)}function nl(){var t=this.data,e=this.verticalScrollbar,n=this.getTableOffset().height,r=t.exceptRowTotalHeight(0,-1);e.set(n,t.rows.totalHeight()-r)}function rl(){var t=this.data,e=this.horizontalScrollbar,n=this.getTableOffset().width;t&&e.set(n,t.cols.totalWidth())}function il(){var t=this.tableEl,e=this.overlayerEl,n=this.overlayerCEl,r=this.table,i=this.toolbar,o=this.selector,a=this.el,l=this.getTableOffset(),c=this.getRect();t.attr(c),e.offset(c),n.offset(l),a.css(\"width\",\"\".concat(c.width,\"px\")),nl.call(this),rl.call(this),function(){var t=this.selector,e=this.data,n=this.editor,r=Ga(e.freeze,2),i=r[0],o=r[1];if(i>0||o>0){var a=e.freezeTotalWidth(),l=e.freezeTotalHeight();n.setFreezeLengths(a,l)}t.resetAreaOffset()}.call(this),r.render(),i.reset(),o.reset()}function ol(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function al(){var t=this.data,e=this.selector;t.copy(),e.showClipboard()}function ll(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function cl(t,e){var n=this.data;if(\"read\"!==n.settings.mode)if(n.paste(t,function(t){return Ka(\"Tip\",t)}))il.call(this);else if(e){var r=e.clipboardData.getData(\"text/plain\");this.data.pasteFromText(r),il.call(this)}}function sl(t,e){this.data.unhideRowsOrCols(t,e),il.call(this)}function ul(t){var e=this,n=this.selector,r=this.data,i=this.table,o=this.sortFilter,a=t.offsetX,l=t.offsetY,c=t.target.className===\"\".concat(mt,\"-selector-corner\"),s=r.getCellRectByXY(a,l),u=s.left,f=s.top,h=s.width,p=s.height,d=s.ri,y=s.ci,v=r.autoFilter;if(v.includes(d,y)&&u+h-20<a&&f+p-20<l){var b=v.items(y,function(t,e){return r.rows.getCell(t,e)});return o.hide(),o.set(y,b,v.getFilter(y),v.getSort(y)),void o.setOffset({left:u,top:f+p+2})}t.shiftKey||(c?n.showAutofill(d,y):tl.call(this,!1,d,y),bt(window,function(t){var i=r.getCellRectByXY(t.offsetX,t.offsetY);d=i.ri,y=i.ci,c?n.showAutofill(d,y):1!==t.buttons||t.shiftKey||tl.call(e,!0,d,y,!0,!0)},function(){c&&n.arange&&\"read\"!==r.settings.mode&&r.autofill(n.arange,\"all\",function(t){return Ka(\"Tip\",t)})&&i.render(),n.hideAutofill(),function(){var t=this.toolbar;t.paintformatActive()&&(cl.call(this,\"format\"),ol.call(this),t.paintformatToggle())}.call(e)})),c||1!==t.buttons||t.shiftKey&&tl.call(this,!0,d,y)}function fl(){var t=this.editor,e=this.data.getSelectedRect(),n=this.getTableOffset(),r=\"top\";e.top>n.height/2&&(r=\"bottom\"),t.setOffset(e,r)}function hl(){var t=this.editor,e=this.data;\"read\"!==e.settings.mode&&(fl.call(this),t.setCell(e.getSelectedCell(),e.getSelectedValidator()),ol.call(this))}function pl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"finished\",n=this.data,r=this.table;if(\"read\"!==n.settings.mode){n.setSelectedCellText(t,e);var i=n.selector,o=i.ri,a=i.ci;\"finished\"===e?r.render():this.trigger(\"cell-edited\",t,o,a)}}function dl(t){var e=this.data;\"read\"!==e.settings.mode&&(\"insert-row\"===t?e.insert(\"row\"):\"delete-row\"===t?e.delete(\"row\"):\"insert-column\"===t?e.insert(\"column\"):\"delete-column\"===t?e.delete(\"column\"):\"delete-cell\"===t?e.deleteCell():\"delete-cell-format\"===t?e.deleteCell(\"format\"):\"delete-cell-text\"===t?e.deleteCell(\"text\"):\"cell-printable\"===t?e.setSelectedCellAttr(\"printable\",!0):\"cell-non-printable\"===t?e.setSelectedCellAttr(\"printable\",!1):\"cell-editable\"===t?e.setSelectedCellAttr(\"editable\",!0):\"cell-non-editable\"===t&&e.setSelectedCellAttr(\"editable\",!1),ol.call(this),il.call(this))}function yl(t,e){var n=this.data;if(\"undo\"===t)this.undo();else if(\"redo\"===t)this.redo();else if(\"print\"===t)this.print.preview();else if(\"paintformat\"===t)!0===e?al.call(this):ol.call(this);else if(\"clearformat\"===t)dl.call(this,\"delete-cell-format\");else if(\"link\"===t);else if(\"chart\"===t);else if(\"autofilter\"===t)(function(){this.data.autofilter(),il.call(this)}).call(this);else if(\"freeze\"===t)if(e){var r=n.selector,i=r.ri,o=r.ci;this.freeze(i,o)}else this.freeze(0,0);else n.setSelectedCellAttr(t,e),\"formula\"!==t||n.selector.multiple()||hl.call(this),il.call(this)}function vl(){var t,e,n,r,i,o,a=this,l=this.selector,c=this.overlayerEl,s=this.rowResizer,u=this.colResizer,f=this.verticalScrollbar,h=this.horizontalScrollbar,p=this.editor,d=this.contextMenu,y=this.toolbar,v=this.modalValidation,b=this.sortFilter;c.on(\"mousemove\",function(t){(function(t){if(0===t.buttons&&t.target.className!==\"\".concat(mt,\"-resizer-hover\")){var e=t.offsetX,n=t.offsetY,r=this.rowResizer,i=this.colResizer,o=this.tableEl,a=this.data,l=a.rows,c=a.cols;if(e>c.indexWidth&&n>l.height)return r.hide(),void i.hide();var s=o.box(),u=a.getCellRectByXY(t.offsetX,t.offsetY);u.ri>=0&&-1===u.ci?(u.width=c.indexWidth,r.show(u,{width:s.width}),l.isHide(u.ri-1)?r.showUnhide(u.ri):r.hideUnhide()):r.hide(),-1===u.ri&&u.ci>=0?(u.height=l.height,i.show(u,{height:s.height}),c.isHide(u.ci-1)?i.showUnhide(u.ci):i.hideUnhide()):i.hide()}}).call(a,t)}).on(\"mousedown\",function(t){p.clear(),d.hide(),2===t.buttons?(a.data.xyInSelectedRect(t.offsetX,t.offsetY)?d.setPosition(t.offsetX,t.offsetY):(ul.call(a,t),d.setPosition(t.offsetX,t.offsetY)),t.stopPropagation()):2===t.detail?hl.call(a):ul.call(a,t)}).on(\"mousewheel.stop\",function(t){(function(t){var e=this.verticalScrollbar,n=this.horizontalScrollbar,r=this.data,i=e.scroll().top,o=n.scroll().left,a=r.rows,l=r.cols,c=t.deltaY,s=t.deltaX,u=function(t,e){var n=t,r=0;do{r=e(n),n+=1}while(r<=0);return r},f=function(t){if(t>0){var n=r.scroll.ri+1;if(n<a.len){var o=u(n,function(t){return a.getHeight(t)});e.move({top:i+o-1})}}else{var l=r.scroll.ri-1;if(l>=0){var c=u(l,function(t){return a.getHeight(t)});e.move({top:0===l?0:i-c})}}},h=Math.abs(c),p=Math.abs(s),d=Math.max(h,p);/Firefox/i.test(window.navigator.userAgent)&&Qa(f(t.detail),50),d===p&&Qa(function(t){if(t>0){var e=r.scroll.ci+1;if(e<l.len){var i=u(e,function(t){return l.getWidth(t)});n.move({left:o+i-1})}}else{var a=r.scroll.ci-1;if(a>=0){var c=u(a,function(t){return l.getWidth(t)});n.move({left:0===a?0:o-c})}}}(s),50),d===h&&Qa(f(c),50)}).call(a,t)}).on(\"mouseout\",function(t){var e=t.offsetX;t.offsetY<=0&&u.hide(),e<=0&&s.hide()}),l.inputChange=function(t){pl.call(a,t,\"input\"),hl.call(a)},t=c.el,n=(e={move:function(t,e){(function(t,e){var n=this.verticalScrollbar,r=this.horizontalScrollbar,i=n.scroll().top,o=r.scroll().left;\"left\"===t||\"right\"===t?r.move({left:o-e}):\"up\"!==t&&\"down\"!==t||n.move({top:i-e})}).call(a,t,e)}}).move,r=e.end,i=0,o=0,pt(t,\"touchstart\",function(t){var e=t.touches[0],n=e.pageX,r=e.pageY;i=n,o=r}),pt(t,\"touchmove\",function(t){if(n){var e=t.changedTouches[0],r=e.pageX,a=e.pageY,l=r-i,c=a-o;(Math.abs(l)>10||Math.abs(c)>10)&&(gt(l,c,t,n),i=r,o=a),t.preventDefault()}}),pt(t,\"touchend\",function(t){if(r){var e=t.changedTouches[0],n=e.pageX,a=e.pageY;gt(n-i,a-o,t,r)}}),y.change=function(t,e){return yl.call(a,t,e)},b.ok=function(t,e,n,r){return function(t,e,n,r){this.data.setAutoFilter(t,e,n,r),il.call(this)}.call(a,t,e,n,r)},s.finishedFn=function(t,e){(function(t,e){var n=t.ri,r=this.table,i=this.selector;this.data.rows.setHeight(n,e),r.render(),i.resetAreaOffset(),nl.call(this),fl.call(this)}).call(a,t,e)},u.finishedFn=function(t,e){(function(t,e){var n=t.ci,r=this.table,i=this.selector;this.data.cols.setWidth(n,e),r.render(),i.resetAreaOffset(),rl.call(this),fl.call(this)}).call(a,t,e)},s.unhideFn=function(t){sl.call(a,\"row\",t)},u.unhideFn=function(t){sl.call(a,\"col\",t)},f.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrolly(t,function(){i.resetBRLAreaOffset(),fl.call(e),r.render()})}).call(a,t,e)},h.moveFn=function(t,e){(function(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrollx(t,function(){i.resetBRTAreaOffset(),fl.call(e),r.render()})}).call(a,t,e)},p.change=function(t,e){pl.call(a,e,t)},v.change=function(t){if(\"save\"===t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=a.data).addValidation.apply(e,r)}else a.data.removeValidation()},d.itemClick=function(t){\"validation\"===t?v.setValue(a.data.getSelectedValidation()):\"copy\"===t?al.call(a):\"cut\"===t?ll.call(a):\"paste\"===t?cl.call(a,\"all\"):\"paste-value\"===t?cl.call(a,\"text\"):\"paste-format\"===t?cl.call(a,\"format\"):\"hide\"===t?function(){this.data.hideRowsOrCols(),il.call(this)}.call(a):dl.call(a,t)},pt(window,\"resize\",function(){a.reload()}),pt(window,\"click\",function(t){a.focusing=c.contains(t.target)}),pt(window,\"paste\",function(t){cl.call(a,\"all\",t),t.preventDefault()}),pt(window,\"keydown\",function(t){if(a.focusing){var e=t.keyCode||t.which,n=t.key,r=t.ctrlKey,i=t.shiftKey,o=t.metaKey;if(r||o)switch(e){case 90:a.undo(),t.preventDefault();break;case 89:a.redo(),t.preventDefault();break;case 67:al.call(a),t.preventDefault();break;case 88:ll.call(a),t.preventDefault();break;case 85:y.trigger(\"underline\"),t.preventDefault();break;case 86:break;case 37:el.call(a,i,\"row-first\"),t.preventDefault();break;case 38:el.call(a,i,\"col-first\"),t.preventDefault();break;case 39:el.call(a,i,\"row-last\"),t.preventDefault();break;case 40:el.call(a,i,\"col-last\"),t.preventDefault();break;case 32:tl.call(a,!1,-1,a.data.selector.ci,!1),t.preventDefault();break;case 66:y.trigger(\"bold\");break;case 73:y.trigger(\"italic\")}else{switch(e){case 32:i&&tl.call(a,!1,a.data.selector.ri,-1,!1);break;case 27:d.hide(),ol.call(a);break;case 37:el.call(a,i,\"left\"),t.preventDefault();break;case 38:el.call(a,i,\"up\"),t.preventDefault();break;case 39:el.call(a,i,\"right\"),t.preventDefault();break;case 40:el.call(a,i,\"down\"),t.preventDefault();break;case 9:p.clear(),el.call(a,!1,i?\"left\":\"right\"),t.preventDefault();break;case 13:p.clear(),el.call(a,!1,i?\"up\":\"down\"),t.preventDefault();break;case 8:dl.call(a,\"delete-cell-text\"),t.preventDefault()}\"Delete\"===n?(dl.call(a,\"delete-cell-text\"),t.preventDefault()):e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=105||\"=\"===t.key?(pl.call(a,t.key,\"input\"),hl.call(a)):113===e&&hl.call(a)}}})}var bl=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.eventMap=new Map;var i=n.settings,o=i.view,l=i.showToolbar,c=i.showContextmenu;this.el=a(\"div\",\"\".concat(mt,\"-sheet\")),this.toolbar=new _a(n,o.width,!l),this.print=new fn(n),e.children(this.toolbar.el,this.el,this.print.el),this.data=n,this.tableEl=a(\"canvas\",\"\".concat(mt,\"-table\")),this.rowResizer=new kt(!1,n.rows.height),this.colResizer=new kt(!0,n.cols.minWidth),this.verticalScrollbar=new St(!0),this.horizontalScrollbar=new St(!1),this.editor=new se(Me,function(){return r.getTableOffset()},n.rows.height),this.modalValidation=new La,this.contextMenu=new vn(function(){return r.getRect()},!c),this.selector=new Wt(n),this.overlayerCEl=a(\"div\",\"\".concat(mt,\"-overlayer-content\")).children(this.editor.el,this.selector.el),this.overlayerEl=a(\"div\",\"\".concat(mt,\"-overlayer\")).child(this.overlayerCEl),this.sortFilter=new Za,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.modalValidation.el,this.sortFilter.el),this.table=new rn(this.tableEl.el,n),vl.call(this),il.call(this),tl.call(this,!1,0,0)}var e,n,r;return e=t,(n=[{key:\"on\",value:function(t,e){return this.eventMap.set(t,e),this}},{key:\"trigger\",value:function(t){var e=this.eventMap;if(e.has(t)){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.get(t)).call.apply(n,[this].concat(i))}}},{key:\"resetData\",value:function(t){this.editor.clear(),this.data=t,nl.call(this),rl.call(this),this.toolbar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t)}},{key:\"loadData\",value:function(t){return this.data.setData(t),il.call(this),this}},{key:\"freeze\",value:function(t,e){return this.data.setFreeze(t,e),il.call(this),this}},{key:\"undo\",value:function(){this.data.undo(),il.call(this)}},{key:\"redo\",value:function(){this.data.redo(),il.call(this)}},{key:\"reload\",value:function(){return il.call(this),this}},{key:\"getRect\",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:\"getTableOffset\",value:function(){var t=this.data,e=t.rows,n=t.cols,r=this.getRect(),i=r.width,o=r.height;return{width:i-n.indexWidth,height:o-e.height,left:n.indexWidth,top:e.height}}}])&&Ja(e.prototype,n),r&&Ja(e,r),t}();function gl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function ml(t){return(ml=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function wl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||\"[object Arguments]\"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}()}function kl(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Ol(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Sl(t,e,n){return e&&Ol(t.prototype,e),n&&Ol(t,n),t}function xl(t,e){return!e||\"object\"!==ml(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function El(t){return(El=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jl(t,e){return(jl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var _l=function(t){function e(t){var n;kl(this,e);var r=new Kt(\"ellipsis\");return(n=xl(this,El(e).call(this,r,\"auto\",!1,\"top-left\"))).contentClick=t,n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jl(t,e)}(e,An),Sl(e,[{key:\"reset\",value:function(t){var e=this,n=t.map(function(t,n){return a(\"div\",\"\".concat(mt,\"-item\")).css(\"width\",\"150px\").css(\"font-weight\",\"normal\").on(\"click\",function(){e.contentClick(n),e.hide()}).child(t)});this.setContentChildren.apply(this,wl(n))}},{key:\"setTitle\",value:function(){}}]),e}(),Cl=[{key:\"delete\",title:U(\"contextmenu.deleteSheet\")}];function Tl(){var t=this;return Cl.map(function(e){return function(t){var e=this;return a(\"div\",\"\".concat(mt,\"-item\")).child(t.title()).on(\"click\",function(){e.itemClick(t.key),e.hide()})}.call(t,e)})}var Pl=function(){function t(){var e;kl(this,t),this.el=(e=a(\"div\",\"\".concat(mt,\"-contextmenu\")).css(\"width\",\"160px\")).children.apply(e,wl(Tl.call(this))).hide(),this.itemClick=function(){}}return Sl(t,[{key:\"hide\",value:function(){var t=this.el;t.hide(),yt(t)}},{key:\"setOffset\",value:function(t){var e=this.el;e.offset(t),e.show(),vt(e)}}]),t}(),Al=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};kl(this,t),this.swapFunc=r,this.updateFunc=o,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new _l(function(t){e.clickSwap2(e.items[t])}),this.contextMenu=new Pl,this.contextMenu.itemClick=i,this.el=a(\"div\",\"\".concat(mt,\"-bottombar\")).children(this.contextMenu.el,this.menuEl=a(\"ul\",\"\".concat(mt,\"-menu\")).child(a(\"li\",\"\").children(new Kt(\"add\").on(\"click\",function(){e.dataNames.length<10?n():Ka(\"tip\",\"it less than or equal to 10\")}),a(\"span\",\"\").child(this.moreEl))))}return Sl(t,[{key:\"addItem\",value:function(t,e){var n=this;this.dataNames.push(t);var r=a(\"li\",e?\"active\":\"\").child(t);r.on(\"click\",function(){n.clickSwap2(r)}).on(\"contextmenu\",function(t){var e=t.target,i=e.offsetLeft,o=e.offsetHeight;n.contextMenu.setOffset({left:i,bottom:o+1}),n.deleteEl=r}).on(\"dblclick\",function(){var t=r.html(),e=new Ra(\"auto\",\"\");e.val(t),e.input.on(\"blur\",function(e){var r=e.target.value,i=n.dataNames.findIndex(function(e){return e===t});n.renameItem(i,r)}),r.html(\"\").child(e.el),e.focus()}),e&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:\"renameItem\",value:function(t,e){this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html(\"\").child(e),this.updateFunc(t,e)}},{key:\"clear\",value:function(){var t=this;this.items.forEach(function(e){t.menuEl.removeChild(e.el)}),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:\"deleteItem\",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var n=this.items.findIndex(function(t){return t===e});if(this.items.splice(n,1),this.dataNames.splice(n,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var r=gl(this.items,1)[0];return this.activeEl=r,this.activeEl.toggle(),[n,0]}return[n,-1]}return[-1]}},{key:\"clickSwap2\",value:function(t){var e=this.items.findIndex(function(e){return e===t});this.clickSwap(t),this.activeEl.toggle(),this.swapFunc(e)}},{key:\"clickSwap\",value:function(t){null!==this.activeEl&&this.activeEl.toggle(),this.activeEl=t}}]),t}();n(1);function Rl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function Il(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.d(e,\"spreadsheet\",function(){return zl});var Dl=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t);var i=e;this.options=r,this.sheetIndex=1,this.datas=[],\"string\"==typeof e&&(i=document.querySelector(e)),this.bottombar=new Al(function(){var t=n.addSheet();n.sheet.resetData(t)},function(t){var e=n.datas[t];n.sheet.resetData(e)},function(){n.deleteSheet()},function(t,e){n.datas[t].name=e}),this.data=this.addSheet();var o=a(\"div\",\"\".concat(mt)).on(\"contextmenu\",function(t){return t.preventDefault()});i.appendChild(o.el),this.sheet=new bl(o,this.data),o.child(this.bottombar.el)}var e,n,r;return e=t,r=[{key:\"locale\",value:function(t,e){Y(t,e)}}],(n=[{key:\"addSheet\",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t||\"sheet\".concat(this.sheetIndex),i=new ht(r,this.options);return i.change=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=e.sheet).trigger.apply(t,[\"change\"].concat(r))},this.datas.push(i),this.bottombar.addItem(r,n),this.sheetIndex+=1,i}},{key:\"deleteSheet\",value:function(){var t=Rl(this.bottombar.deleteItem(),2),e=t[0],n=t[1];e>=0&&(this.datas.splice(e,1),n>=0&&this.sheet.resetData(this.datas[n]))}},{key:\"loadData\",value:function(t){var e=Array.isArray(t)?t:[t];if(this.bottombar.clear(),this.datas=[],e.length>0)for(var n=0;n<e.length;n+=1){var r=e[n],i=this.addSheet(r.name,0===n);i.setData(r),0===n&&this.sheet.resetData(i)}return this}},{key:\"getData\",value:function(){return this.datas.map(function(t){return t.getData()})}},{key:\"cellText\",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[r].setCellText(t,e,n,\"finished\"),this}},{key:\"cell\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCell(t,e)}},{key:\"cellStyle\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCellStyle(t,e)}},{key:\"reRender\",value:function(){return this.sheet.table.render(),this}},{key:\"on\",value:function(t,e){return this.sheet.on(t,e),this}},{key:\"validate\",value:function(){return this.data.validations.errors.size<=0}},{key:\"change\",value:function(t){return this.sheet.on(\"change\",t),this}}])&&Il(e.prototype,n),r&&Il(e,r),t}(),zl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Dl(t,e)};window&&(window.x_spreadsheet=zl,window.x_spreadsheet.locale=function(t,e){return Y(t,e)});e.default=Dl}]);\n//# sourceMappingURL=xspreadsheet.js.map"
  },
  {
    "path": "index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <title><%= htmlWebpackPlugin.options.title %></title>\n</head>\n<body onload=\"load()\">\n  <div style=\"position: fixed; right: 0; top: .3em;\">\n  <iframe src=\"https://ghbtns.com/github-btn.html?user=myliang&repo=x-spreadsheet&type=star&count=true&size=large\" frameborder=\"0\" scrolling=\"0\" width=\"160px\" height=\"30px\"></iframe>\n  </div>\n  <div id=\"x-spreadsheet-demo\"></div>\n  <script>\n    function load(){\n      const rows10 = { len: 1000 };\n      for (let i = 0; i < 1000; i += 1) {\n        rows10[i] = {\n          cells: {\n            0: { text: 'A-' + i },\n            1: { text: 'B-' + i },\n            2: { text: 'C-' + i },\n            3: { text: 'D-' + i },\n            4: { text: 'E-' + i },\n            5: { text: 'F-' + i },\n          }\n        };\n      }\n      const rows = {\n        len: 80,\n        1: {\n          cells: {\n            0: { text: 'testingtesttestetst' },\n            2: { text: 'testing' },\n          },\n        },\n        2: {\n          cells: {\n            0: { text: 'render', style: 0 },\n            1: { text: 'Hello' },\n            2: { text: 'haha', merge: [1, 1] },\n          }\n        },\n        8: {\n          cells: {\n            8: { text: 'border test', style: 0 },\n          }\n        }\n      };\n      // x_spreadsheet.locale('zh-cn');\n      var saveIcon = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTc3MTc3MDkyOTg4IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2NzgiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTIxMy4zMzMzMzMgMTI4aDU5Ny4zMzMzMzRhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMSA4NS4zMzMzMzMgODUuMzMzMzMzdjU5Ny4zMzMzMzRhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS04NS4zMzMzMzMgODUuMzMzMzMzSDIxMy4zMzMzMzNhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS04NS4zMzMzMzMtODUuMzMzMzMzVjIxMy4zMzMzMzNhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMSA4NS4zMzMzMzMtODUuMzMzMzMzeiBtMzY2LjkzMzMzNCAxMjhoMzQuMTMzMzMzYTI1LjYgMjUuNiAwIDAgMSAyNS42IDI1LjZ2MTE5LjQ2NjY2N2EyNS42IDI1LjYgMCAwIDEtMjUuNiAyNS42aC0zNC4xMzMzMzNhMjUuNiAyNS42IDAgMCAxLTI1LjYtMjUuNlYyODEuNmEyNS42IDI1LjYgMCAwIDEgMjUuNi0yNS42ek0yMTMuMzMzMzMzIDIxMy4zMzMzMzN2NTk3LjMzMzMzNGg1OTcuMzMzMzM0VjIxMy4zMzMzMzNIMjEzLjMzMzMzM3ogbTEyOCAwdjI1NmgzNDEuMzMzMzM0VjIxMy4zMzMzMzNoODUuMzMzMzMzdjI5OC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMS00Mi42NjY2NjcgNDIuNjY2NjY3SDI5OC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMS00Mi42NjY2NjctNDIuNjY2NjY3VjIxMy4zMzMzMzNoODUuMzMzMzMzek0yNTYgMjEzLjMzMzMzM2g4NS4zMzMzMzMtODUuMzMzMzMzeiBtNDI2LjY2NjY2NyAwaDg1LjMzMzMzMy04NS4zMzMzMzN6IG0wIDU5Ny4zMzMzMzR2LTEyOEgzNDEuMzMzMzMzdjEyOEgyNTZ2LTE3MC42NjY2NjdhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMSA0Mi42NjY2NjctNDIuNjY2NjY3aDQyNi42NjY2NjZhNDIuNjY2NjY3IDQyLjY2NjY2NyAwIDAgMSA0Mi42NjY2NjcgNDIuNjY2NjY3djE3MC42NjY2NjdoLTg1LjMzMzMzM3ogbTg1LjMzMzMzMyAwaC04NS4zMzMzMzMgODUuMzMzMzMzek0zNDEuMzMzMzMzIDgxMC42NjY2NjdIMjU2aDg1LjMzMzMzM3oiIHAtaWQ9IjI2NzkiIGZpbGw9IiMyYzJjMmMiPjwvcGF0aD48L3N2Zz4='\n      var previewEl = document.createElement('img')\n      previewEl.src = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjIxMzI4NTkxMjQzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjU2NjMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyIDE4Ny45MDRhNDM1LjM5MiA0MzUuMzkyIDAgMCAwLTQxOC41NiAzMTUuNjQ4IDQzNS4zMjggNDM1LjMyOCAwIDAgMCA4MzcuMTIgMEE0MzUuNDU2IDQzNS40NTYgMCAwIDAgNTEyIDE4Ny45MDR6TTUxMiAzMjBhMTkyIDE5MiAwIDEgMSAwIDM4NCAxOTIgMTkyIDAgMCAxIDAtMzg0eiBtMCA3Ni44YTExNS4yIDExNS4yIDAgMSAwIDAgMjMwLjQgMTE1LjIgMTE1LjIgMCAwIDAgMC0yMzAuNHpNMTQuMDggNTAzLjQ4OEwxOC41NiA0ODUuNzZsNC44NjQtMTYuMzg0IDQuOTI4LTE0Ljg0OCA4LjA2NC0yMS41NjggNC4wMzItOS43OTIgNC43MzYtMTAuODggOS4zNDQtMTkuNDU2IDEwLjc1Mi0yMC4wOTYgMTIuNjA4LTIxLjMxMkE1MTEuNjE2IDUxMS42MTYgMCAwIDEgNTEyIDExMS4xMDRhNTExLjQ4OCA1MTEuNDg4IDAgMCAxIDQyNC41MTIgMjI1LjY2NGwxMC4yNCAxNS42OGMxMS45MDQgMTkuMiAyMi41OTIgMzkuMTA0IDMyIDU5Ljc3NmwxMC40OTYgMjQuOTYgNC44NjQgMTMuMTg0IDYuNCAxOC45NDQgNC40MTYgMTQuODQ4IDQuOTkyIDE5LjM5Mi0zLjIgMTIuODY0LTMuNTg0IDEyLjgtNi40IDIwLjA5Ni00LjQ4IDEyLjYwOC00Ljk5MiAxMi45MjhhNTExLjM2IDUxMS4zNiAwIDAgMS0xNy4yOCAzOC40bC0xMi4wMzIgMjIuNC0xMS45NjggMjAuMDk2QTUxMS41NTIgNTExLjU1MiAwIDAgMSA1MTIgODk2YTUxMS40ODggNTExLjQ4OCAwIDAgMS00MjQuNDQ4LTIyNS42bC0xMS4zMjgtMTcuNTM2YTUxMS4yMzIgNTExLjIzMiAwIDAgMS0xOS44NC0zNS4wMDhMNTMuMzc2IDYxMS44NGwtOC42NC0xOC4yNC0xMC4xMTItMjQuMTI4LTcuMTY4LTE5LjY0OC04LjMyLTI2LjYyNC0yLjYyNC05Ljc5Mi0yLjQ5Ni05LjkyeiIgcC1pZD0iNTY2NCI+PC9wYXRoPjwvc3ZnPg=='\n      previewEl.width = 16\n      previewEl.height = 16\n\n      var xs = x_spreadsheet('#x-spreadsheet-demo', {\n        showToolbar: true,\n        showGrid: true,\n        showBottomBar: true,\n        extendToolbar: {\n          left: [\n            {\n              tip: 'Save',\n              icon: saveIcon,\n              onClick: (data, sheet) => {\n                console.log('click save button：', data, sheet)\n              }\n            }\n          ],\n          right: [\n            {\n              tip: 'Preview',\n              el: previewEl,\n              onClick: (data, sheet) => {\n                console.log('click preview button：', data)\n              }\n            }\n          ],\n        }\n      })\n        .loadData([{\n          freeze: 'B3',\n          styles: [\n            {\n              bgcolor: '#f4f5f8',\n              textwrap: true,\n              color: '#900b09',\n              border: {\n                top: ['thin', '#0366d6'],\n                bottom: ['thin', '#0366d6'],\n                right: ['thin', '#0366d6'],\n                left: ['thin', '#0366d6'],\n              },\n            },\n          ],\n          merges: [\n            'C3:D4',\n          ],\n          cols: {\n            len: 10,\n            2: { width: 200 },\n          },\n          rows,\n        }, { name: 'sheet-test', rows: rows10 }]).change((cdata) => {\n          // console.log(cdata);\n          console.log('>>>', xs.getData());\n        });\n\n      xs.on('cell-selected', (cell, ri, ci) => {\n          console.log('cell:', cell, ', ri:', ri, ', ci:', ci);\n        }).on('cell-edited', (text, ri, ci) => {\n          console.log('text:', text, ', ri: ', ri, ', ci:', ci);\n        }).on('pasted-clipboard', (data) => {\n          console.log('>>>> data is ', data);\n        });\n\n      setTimeout(() => {\n        // xs.loadData([{ rows }]);\n        xs.cellText(14, 3, 'cell-text').reRender();\n        console.log('cell(8, 8):', xs.cell(8, 8));\n        console.log('cellStyle(8, 8):', xs.cellStyle(8, 8));\n      }, 5000);\n    }\n  </script>\n  <!--script type=\"text/javascript\" src=\"https://unpkg.com/x-data-spreadsheet@1.0.20/dist/locale/zh-cn.js\"></script-->\n</body>\n</html>\n"
  },
  {
    "path": "npmx.txt",
    "content": "mkdir x-spreadsheet && cd x-spreadsheet\nnpm init -y\nnpm install webpack webpack-cli --save-dev\n\nmkdir dist src\ntouch webpack.config.js\n\n\nnpm install --save-dev file-loader css-loader file-loader\nnpm install --save-dev html-webpack-plugin\nnpm install --save-dev clean-webpack-plugin\nnpm install --save-dev webpack-dev-server\nnpm install --save-dev webpack-merge\n\n# less\nnpm install less --save-dev\nnpm install less-loader --save-dev\n\nnpm install eslint --save-dev\n./node_modules/.bin/eslint --init # airbnb\n\n\n# test mocha\nnpm install --save-dev mocha\n\n# babel\nnpm install --save-dev babel-loader babel-core babel-preset-env\n# for macha\nnpm install --save-dev babel-register\n# npm install --save-dev babel-plugin-transform-runtime\n# npm install --save babel-runtime\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"x-data-spreadsheet\",\n  \"version\": \"1.1.8\",\n  \"description\": \"a javascript xpreadsheet\",\n  \"types\": \"src/index.d.ts\",\n  \"main\": \"src/index.js\",\n  \"files\": [\n    \"assets\",\n    \"dist\",\n    \"src\"\n  ],\n  \"author\": \"myliang <liangyuliang0335@gmail.com>\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/myliang/x-spreadsheet.git\"\n  },\n  \"nyc\": {\n    \"all\": true,\n    \"include\": [\n      \"src/core/*.js\",\n      \"src/locale/locale.js\"\n    ],\n    \"exclude\": [\n      \"**/*.spec.js\"\n    ]\n  },\n  \"scripts\": {\n    \"dev\": \"webpack-dev-server --open --config build/webpack.dev.js\",\n    \"build\": \"webpack --config build/webpack.prod.js\",\n    \"build-locale\": \"webpack --config build/webpack.locale.js\",\n    \"lint\": \"./node_modules/eslint/bin/eslint.js src\",\n    \"test\": \"nyc ./node_modules/mocha/bin/mocha --require @babel/register --recursive test\",\n    \"coverage\": \"nyc report --reporter=text-lcov > coverage.lcov && codecov -t 31ecdb12-8ecb-46f7-a486-65c2516307dd\",\n    \"postinstall\": \"opencollective-postinstall\"\n  },\n  \"keywords\": [\n    \"javascript\",\n    \"spreadsheet\",\n    \"canvas\"\n  ],\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.3.4\",\n    \"@babel/plugin-proposal-class-properties\": \"^7.4.4\",\n    \"@babel/preset-env\": \"^7.3.4\",\n    \"@babel/register\": \"^7.0.0\",\n    \"babel-loader\": \"^8.0.5\",\n    \"clean-webpack-plugin\": \"^0.1.19\",\n    \"codecov\": \"^3.3.0\",\n    \"css-loader\": \"^1.0.0\",\n    \"eslint\": \"^6.8.0\",\n    \"eslint-config-airbnb-base\": \"^13.1.0\",\n    \"eslint-plugin-import\": \"^2.14.0\",\n    \"file-loader\": \"^2.0.0\",\n    \"html-webpack-plugin\": \"^3.2.0\",\n    \"less\": \"^3.8.1\",\n    \"less-loader\": \"^4.1.0\",\n    \"mini-css-extract-plugin\": \"^0.4.4\",\n    \"mocha\": \"^5.2.0\",\n    \"nyc\": \"^13.3.0\",\n    \"style-loader\": \"^0.23.0\",\n    \"webpack\": \"^4.29.6\",\n    \"webpack-cli\": \"^3.1.0\",\n    \"webpack-dev-server\": \"^3.10.2\",\n    \"webpack-merge\": \"^4.1.4\"\n  },\n  \"dependencies\": {\n    \"opencollective\": \"^1.0.3\",\n    \"opencollective-postinstall\": \"^2.0.2\"\n  },\n  \"collective\": {\n    \"type\": \"opencollective\",\n    \"url\": \"https://opencollective.com/x-spreadsheet\"\n  }\n}\n"
  },
  {
    "path": "readme.md",
    "content": "# x-spreadsheet\n\n[![npm package](https://img.shields.io/npm/v/x-data-spreadsheet.svg)](https://www.npmjs.org/package/x-data-spreadsheet)\n[![NPM downloads](http://img.shields.io/npm/dm/x-data-spreadsheet.svg)](https://npmjs.org/package/x-data-spreadsheet)\n[![NPM downloads](http://img.shields.io/npm/dt/x-data-spreadsheet.svg)](https://npmjs.org/package/x-data-spreadsheet)\n[![Build passing](https://travis-ci.org/myliang/x-spreadsheet.svg?branch=master)](https://travis-ci.org/myliang/x-spreadsheet)\n[![codecov](https://codecov.io/gh/myliang/x-spreadsheet/branch/master/graph/badge.svg)](https://codecov.io/gh/myliang/x-spreadsheet)\n![GitHub](https://img.shields.io/github/license/myliang/x-spreadsheet.svg)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/myliang/x-spreadsheet.svg)\n[![Join the chat at https://gitter.im/x-datav/spreadsheet](https://badges.gitter.im/x-datav/spreadsheet.svg)](https://gitter.im/x-datav/spreadsheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n> A web-based JavaScript spreadsheet\n\n<p align=\"center\">\n  <a href=\"https://github.com/myliang/x-spreadsheet\">\n    <img width=\"100%\" src=\"https://raw.githubusercontent.com/myliang/x-spreadsheet/master/docs/demo.png\">\n  </a>\n</p>\n\n## Document\n* en\n* [zh-cn 中文](https://hondrytravis.github.io/x-spreadsheet-doc/)\n\n## CDN\n```html\n<link rel=\"stylesheet\" href=\"https://unpkg.com/x-data-spreadsheet@1.1.5/dist/xspreadsheet.css\">\n<script src=\"https://unpkg.com/x-data-spreadsheet@1.1.5/dist/xspreadsheet.js\"></script>\n\n<script>\n   x_spreadsheet('#xspreadsheet');\n</script>\n```\n\n## NPM\n\n```shell\nnpm install x-data-spreadsheet\n```\n\n```html\n<div id=\"x-spreadsheet-demo\"></div>\n```\n\n```javascript\nimport Spreadsheet from \"x-data-spreadsheet\";\n// If you need to override the default options, you can set the override\n// const options = {};\n// new Spreadsheet('#x-spreadsheet-demo', options);\nconst s = new Spreadsheet(\"#x-spreadsheet-demo\")\n  .loadData({}) // load data\n  .change(data => {\n    // save data to db\n  });\n\n// data validation\ns.validate()\n```\n\n```javascript\n// default options\n{\n  mode: 'edit', // edit | read\n  showToolbar: true,\n  showGrid: true,\n  showContextmenu: true,\n  view: {\n    height: () => document.documentElement.clientHeight,\n    width: () => document.documentElement.clientWidth,\n  },\n  row: {\n    len: 100,\n    height: 25,\n  },\n  col: {\n    len: 26,\n    width: 100,\n    indexWidth: 60,\n    minWidth: 60,\n  },\n  style: {\n    bgcolor: '#ffffff',\n    align: 'left',\n    valign: 'middle',\n    textwrap: false,\n    strike: false,\n    underline: false,\n    color: '#0a0a0a',\n    font: {\n      name: 'Helvetica',\n      size: 10,\n      bold: false,\n      italic: false,\n    },\n  },\n}\n```\n\n## import | export xlsx\n\nhttps://github.com/SheetJS/sheetjs/tree/master/demos/xspreadsheet#saving-data\n\nthanks https://github.com/SheetJS/sheetjs\n\n## Bind events\n```javascript\nconst s = new Spreadsheet(\"#x-spreadsheet-demo\")\n// event of click on cell\ns.on('cell-selected', (cell, ri, ci) => {});\ns.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});\n// edited on cell\ns.on('cell-edited', (text, ri, ci) => {});\n```\n\n## update cell-text\n```javascript\nconst s = new Spreadsheet(\"#x-spreadsheet-demo\")\n// cellText(ri, ci, text, sheetIndex = 0)\ns.cellText(5, 5, 'xxxx').cellText(6, 5, 'yyy').reRender();\n```\n\n## get cell and cell-style\n```javascript\nconst s = new Spreadsheet(\"#x-spreadsheet-demo\")\n// cell(ri, ci, sheetIndex = 0)\ns.cell(ri, ci);\n// cellStyle(ri, ci, sheetIndex = 0)\ns.cellStyle(ri, ci);\n```\n\n## Internationalization\n```javascript\n// npm \nimport Spreadsheet from 'x-data-spreadsheet';\nimport zhCN from 'x-data-spreadsheet/dist/locale/zh-cn';\n\nSpreadsheet.locale('zh-cn', zhCN);\nnew Spreadsheet(document.getElementById('xss-demo'));\n```\n```html\n<!-- Import via CDN -->\n<link rel=\"stylesheet\" href=\"https://unpkg.com/x-data-spreadsheet@1.1.5/dist/xspreadsheet.css\">\n<script src=\"https://unpkg.com/x-data-spreadsheet@1.1.5/dist/xspreadsheet.js\"></script>\n<script src=\"https://unpkg.com/x-data-spreadsheet@1.1.5/dist/locale/zh-cn.js\"></script>\n\n<script>\n  x_spreadsheet.locale('zh-cn');\n</script>\n```\n\n## Features\n  - Undo & Redo\n  - Paint format\n  - Clear format\n  - Format\n  - Font\n  - Font size\n  - Font bold\n  - Font italic\n  - Underline\n  - Strike\n  - Text color\n  - Fill color\n  - Borders\n  - Merge cells\n  - Align\n  - Text wrapping\n  - Freeze cell\n  - Functions\n  - Resize row-height, col-width\n  - Copy, Cut, Paste\n  - Autofill\n  - Insert row, column\n  - Delete row, column\n  - hide row, column\n  - multiple sheets\n  - print\n  - Data validations\n\n## Development\n\n```sheel\ngit clone https://github.com/myliang/x-spreadsheet.git\ncd x-spreadsheet\nnpm install\nnpm run dev\n```\n\nOpen your browser and visit http://127.0.0.1:8080.\n\n## Browser Support\n\nModern browsers(chrome, firefox, Safari).\n\n## LICENSE\n\nMIT\n"
  },
  {
    "path": "src/algorithm/bitmap.js",
    "content": "/* eslint no-bitwise: \"off\" */\n/*\n  v: int value\n  digit: bit len of v\n  flag: true or false\n*/\nconst bitmap = (v, digit, flag) => {\n  const b = 1 << digit;\n  return flag ? (v | b) : (v ^ b);\n};\nexport default bitmap;\n"
  },
  {
    "path": "src/algorithm/expression.js",
    "content": "// src: include chars: [0-9], +, -, *, /\n// // 9+(3-1)*3+10/2 => 9 3 1-3*+ 10 2/+\nconst infix2suffix = (src) => {\n  const operatorStack = [];\n  const stack = [];\n  for (let i = 0; i < src.length; i += 1) {\n    const c = src.charAt(i);\n    if (c !== ' ') {\n      if (c >= '0' && c <= '9') {\n        stack.push(c);\n      } else if (c === ')') {\n        let c1 = operatorStack.pop();\n        while (c1 !== '(') {\n          stack.push(c1);\n          c1 = operatorStack.pop();\n        }\n      } else {\n        // priority: */ > +-\n        if (operatorStack.length > 0 && (c === '+' || c === '-')) {\n          const last = operatorStack[operatorStack.length - 1];\n          if (last === '*' || last === '/') {\n            while (operatorStack.length > 0) {\n              stack.push(operatorStack.pop());\n            }\n          }\n        }\n        operatorStack.push(c);\n      }\n    }\n  }\n  while (operatorStack.length > 0) {\n    stack.push(operatorStack.pop());\n  }\n  return stack;\n};\n\nexport default {\n  infix2suffix,\n};\n"
  },
  {
    "path": "src/canvas/draw.js",
    "content": "/* global window */\nfunction dpr() {\n  return window.devicePixelRatio || 1;\n}\n\nfunction thinLineWidth() {\n  return dpr() - 0.5;\n}\n\nfunction npx(px) {\n  return parseInt(px * dpr(), 10);\n}\n\nfunction npxLine(px) {\n  const n = npx(px);\n  return n > 0 ? n - 0.5 : 0.5;\n}\n\nclass DrawBox {\n  constructor(x, y, w, h, padding = 0) {\n    this.x = x;\n    this.y = y;\n    this.width = w;\n    this.height = h;\n    this.padding = padding;\n    this.bgcolor = '#ffffff';\n    // border: [width, style, color]\n    this.borderTop = null;\n    this.borderRight = null;\n    this.borderBottom = null;\n    this.borderLeft = null;\n  }\n\n  setBorders({\n    top, bottom, left, right,\n  }) {\n    if (top) this.borderTop = top;\n    if (right) this.borderRight = right;\n    if (bottom) this.borderBottom = bottom;\n    if (left) this.borderLeft = left;\n  }\n\n  innerWidth() {\n    return this.width - (this.padding * 2) - 2;\n  }\n\n  innerHeight() {\n    return this.height - (this.padding * 2) - 2;\n  }\n\n  textx(align) {\n    const { width, padding } = this;\n    let { x } = this;\n    if (align === 'left') {\n      x += padding;\n    } else if (align === 'center') {\n      x += width / 2;\n    } else if (align === 'right') {\n      x += width - padding;\n    }\n    return x;\n  }\n\n  texty(align, h) {\n    const { height, padding } = this;\n    let { y } = this;\n    if (align === 'top') {\n      y += padding;\n    } else if (align === 'middle') {\n      y += height / 2 - h / 2;\n    } else if (align === 'bottom') {\n      y += height - padding - h;\n    }\n    return y;\n  }\n\n  topxys() {\n    const { x, y, width } = this;\n    return [[x, y], [x + width, y]];\n  }\n\n  rightxys() {\n    const {\n      x, y, width, height,\n    } = this;\n    return [[x + width, y], [x + width, y + height]];\n  }\n\n  bottomxys() {\n    const {\n      x, y, width, height,\n    } = this;\n    return [[x, y + height], [x + width, y + height]];\n  }\n\n  leftxys() {\n    const {\n      x, y, height,\n    } = this;\n    return [[x, y], [x, y + height]];\n  }\n}\n\nfunction drawFontLine(type, tx, ty, align, valign, blheight, blwidth) {\n  const floffset = { x: 0, y: 0 };\n  if (type === 'underline') {\n    if (valign === 'bottom') {\n      floffset.y = 0;\n    } else if (valign === 'top') {\n      floffset.y = -(blheight + 2);\n    } else {\n      floffset.y = -blheight / 2;\n    }\n  } else if (type === 'strike') {\n    if (valign === 'bottom') {\n      floffset.y = blheight / 2;\n    } else if (valign === 'top') {\n      floffset.y = -((blheight / 2) + 2);\n    }\n  }\n\n  if (align === 'center') {\n    floffset.x = blwidth / 2;\n  } else if (align === 'right') {\n    floffset.x = blwidth;\n  }\n  this.line(\n    [tx - floffset.x, ty - floffset.y],\n    [tx - floffset.x + blwidth, ty - floffset.y],\n  );\n}\n\nclass Draw {\n  constructor(el, width, height) {\n    this.el = el;\n    this.ctx = el.getContext('2d');\n    this.resize(width, height);\n    this.ctx.scale(dpr(), dpr());\n  }\n\n  resize(width, height) {\n    // console.log('dpr:', dpr);\n    this.el.style.width = `${width}px`;\n    this.el.style.height = `${height}px`;\n    this.el.width = npx(width);\n    this.el.height = npx(height);\n  }\n\n  clear() {\n    const { width, height } = this.el;\n    this.ctx.clearRect(0, 0, width, height);\n    return this;\n  }\n\n  attr(options) {\n    Object.assign(this.ctx, options);\n    return this;\n  }\n\n  save() {\n    this.ctx.save();\n    this.ctx.beginPath();\n    return this;\n  }\n\n  restore() {\n    this.ctx.restore();\n    return this;\n  }\n\n  beginPath() {\n    this.ctx.beginPath();\n    return this;\n  }\n\n  translate(x, y) {\n    this.ctx.translate(npx(x), npx(y));\n    return this;\n  }\n\n  scale(x, y) {\n    this.ctx.scale(x, y);\n    return this;\n  }\n\n  clearRect(x, y, w, h) {\n    this.ctx.clearRect(x, y, w, h);\n    return this;\n  }\n\n  fillRect(x, y, w, h) {\n    this.ctx.fillRect(npx(x) - 0.5, npx(y) - 0.5, npx(w), npx(h));\n    return this;\n  }\n\n  fillText(text, x, y) {\n    this.ctx.fillText(text, npx(x), npx(y));\n    return this;\n  }\n\n  /*\n    txt: render text\n    box: DrawBox\n    attr: {\n      align: left | center | right\n      valign: top | middle | bottom\n      color: '#333333',\n      strike: false,\n      font: {\n        name: 'Arial',\n        size: 14,\n        bold: false,\n        italic: false,\n      }\n    }\n    textWrap: text wrapping\n  */\n  text(mtxt, box, attr = {}, textWrap = true) {\n    const { ctx } = this;\n    const {\n      align, valign, font, color, strike, underline,\n    } = attr;\n    const tx = box.textx(align);\n    ctx.save();\n    ctx.beginPath();\n    this.attr({\n      textAlign: align,\n      textBaseline: valign,\n      font: `${font.italic ? 'italic' : ''} ${font.bold ? 'bold' : ''} ${npx(font.size)}px ${font.name}`,\n      fillStyle: color,\n      strokeStyle: color,\n    });\n    const txts = `${mtxt}`.split('\\n');\n    const biw = box.innerWidth();\n    const ntxts = [];\n    txts.forEach((it) => {\n      const txtWidth = ctx.measureText(it).width;\n      if (textWrap && txtWidth > npx(biw)) {\n        let textLine = { w: 0, len: 0, start: 0 };\n        for (let i = 0; i < it.length; i += 1) {\n          if (textLine.w >= npx(biw)) {\n            ntxts.push(it.substr(textLine.start, textLine.len));\n            textLine = { w: 0, len: 0, start: i };\n          }\n          textLine.len += 1;\n          textLine.w += ctx.measureText(it[i]).width + 1;\n        }\n        if (textLine.len > 0) {\n          ntxts.push(it.substr(textLine.start, textLine.len));\n        }\n      } else {\n        ntxts.push(it);\n      }\n    });\n    const txtHeight = (ntxts.length - 1) * (font.size + 2);\n    let ty = box.texty(valign, txtHeight);\n    ntxts.forEach((txt) => {\n      const txtWidth = ctx.measureText(txt).width;\n      this.fillText(txt, tx, ty);\n      if (strike) {\n        drawFontLine.call(this, 'strike', tx, ty, align, valign, font.size, txtWidth);\n      }\n      if (underline) {\n        drawFontLine.call(this, 'underline', tx, ty, align, valign, font.size, txtWidth);\n      }\n      ty += font.size + 2;\n    });\n    ctx.restore();\n    return this;\n  }\n\n  border(style, color) {\n    const { ctx } = this;\n    ctx.lineWidth = thinLineWidth;\n    ctx.strokeStyle = color;\n    // console.log('style:', style);\n    if (style === 'medium') {\n      ctx.lineWidth = npx(2) - 0.5;\n    } else if (style === 'thick') {\n      ctx.lineWidth = npx(3);\n    } else if (style === 'dashed') {\n      ctx.setLineDash([npx(3), npx(2)]);\n    } else if (style === 'dotted') {\n      ctx.setLineDash([npx(1), npx(1)]);\n    } else if (style === 'double') {\n      ctx.setLineDash([npx(2), 0]);\n    }\n    return this;\n  }\n\n  line(...xys) {\n    const { ctx } = this;\n    if (xys.length > 1) {\n      ctx.beginPath();\n      const [x, y] = xys[0];\n      ctx.moveTo(npxLine(x), npxLine(y));\n      for (let i = 1; i < xys.length; i += 1) {\n        const [x1, y1] = xys[i];\n        ctx.lineTo(npxLine(x1), npxLine(y1));\n      }\n      ctx.stroke();\n    }\n    return this;\n  }\n\n  strokeBorders(box) {\n    const { ctx } = this;\n    ctx.save();\n    // border\n    const {\n      borderTop, borderRight, borderBottom, borderLeft,\n    } = box;\n    if (borderTop) {\n      this.border(...borderTop);\n      // console.log('box.topxys:', box.topxys());\n      this.line(...box.topxys());\n    }\n    if (borderRight) {\n      this.border(...borderRight);\n      this.line(...box.rightxys());\n    }\n    if (borderBottom) {\n      this.border(...borderBottom);\n      this.line(...box.bottomxys());\n    }\n    if (borderLeft) {\n      this.border(...borderLeft);\n      this.line(...box.leftxys());\n    }\n    ctx.restore();\n  }\n\n  dropdown(box) {\n    const { ctx } = this;\n    const {\n      x, y, width, height,\n    } = box;\n    const sx = x + width - 15;\n    const sy = y + height - 15;\n    ctx.save();\n    ctx.beginPath();\n    ctx.moveTo(npx(sx), npx(sy));\n    ctx.lineTo(npx(sx + 8), npx(sy));\n    ctx.lineTo(npx(sx + 4), npx(sy + 6));\n    ctx.closePath();\n    ctx.fillStyle = 'rgba(0, 0, 0, .45)';\n    ctx.fill();\n    ctx.restore();\n  }\n\n  error(box) {\n    const { ctx } = this;\n    const { x, y, width } = box;\n    const sx = x + width - 1;\n    ctx.save();\n    ctx.beginPath();\n    ctx.moveTo(npx(sx - 8), npx(y - 1));\n    ctx.lineTo(npx(sx), npx(y - 1));\n    ctx.lineTo(npx(sx), npx(y + 8));\n    ctx.closePath();\n    ctx.fillStyle = 'rgba(255, 0, 0, .65)';\n    ctx.fill();\n    ctx.restore();\n  }\n\n  frozen(box) {\n    const { ctx } = this;\n    const { x, y, width } = box;\n    const sx = x + width - 1;\n    ctx.save();\n    ctx.beginPath();\n    ctx.moveTo(npx(sx - 8), npx(y - 1));\n    ctx.lineTo(npx(sx), npx(y - 1));\n    ctx.lineTo(npx(sx), npx(y + 8));\n    ctx.closePath();\n    ctx.fillStyle = 'rgba(0, 255, 0, .85)';\n    ctx.fill();\n    ctx.restore();\n  }\n\n  rect(box, dtextcb) {\n    const { ctx } = this;\n    const {\n      x, y, width, height, bgcolor,\n    } = box;\n    ctx.save();\n    ctx.beginPath();\n    ctx.fillStyle = bgcolor || '#fff';\n    ctx.rect(npxLine(x + 1), npxLine(y + 1), npx(width - 2), npx(height - 2));\n    ctx.clip();\n    ctx.fill();\n    dtextcb();\n    ctx.restore();\n  }\n}\n\nexport default {};\nexport {\n  Draw,\n  DrawBox,\n  thinLineWidth,\n  npx,\n};\n"
  },
  {
    "path": "src/canvas/draw2.js",
    "content": "class Draw {\n  constructor(el) {\n    this.el = el;\n    this.ctx = el.getContext('2d');\n  }\n\n  clear() {\n    const { width, height } = this.el;\n    this.ctx.clearRect(0, 0, width, height);\n    return this;\n  }\n\n  attr(m) {\n    Object.assign(this.ctx, m);\n    return this;\n  }\n\n  save() {\n    this.ctx.save();\n    this.ctx.beginPath();\n    return this;\n  }\n\n  restore() {\n    this.ctx.restore();\n    return this;\n  }\n\n  beginPath() {\n    this.ctx.beginPath();\n    return this;\n  }\n\n  closePath() {\n    this.ctx.closePath();\n    return this;\n  }\n\n  measureText(text) {\n    return this.ctx.measureText(text);\n  }\n\n  rect(x, y, width, height) {\n    this.ctx.rect(x, y, width, height);\n    return this;\n  }\n\n  scale(x, y) {\n    this.ctx.scale(x, y);\n    return this;\n  }\n\n  rotate(angle) {\n    this.ctx.rotate(angle);\n    return this;\n  }\n\n  translate(x, y) {\n    this.ctx.translate(x, y);\n    return this;\n  }\n\n  transform(a, b, c, d, e) {\n    this.ctx.transform(a, b, c, d, e);\n    return this;\n  }\n\n  fillRect(x, y, w, h) {\n    this.ctx.fillRect(x, y, w, h);\n    return this;\n  }\n\n  strokeRect(x, y, w, h) {\n    this.ctx.strokeRect(x, y, w, h);\n    return this;\n  }\n\n  fillText(text, x, y, maxWidth) {\n    this.ctx.fillText(text, x, y, maxWidth);\n    return this;\n  }\n\n  strokeText(text, x, y, maxWidth) {\n    this.ctx.strokeText(text, x, y, maxWidth);\n    return this;\n  }\n}\n\nexport default {};\nexport {\n  Draw,\n};\n"
  },
  {
    "path": "src/component/border_palette.js",
    "content": "import { h } from './element';\nimport Icon from './icon';\nimport DropdownColor from './dropdown_color';\nimport DropdownLineType from './dropdown_linetype';\nimport { cssPrefix } from '../config';\n\nfunction buildTable(...trs) {\n  return h('table', '').child(\n    h('tbody', '').children(...trs),\n  );\n}\n\nfunction buildTd(iconName) {\n  return h('td', '').child(\n    h('div', `${cssPrefix}-border-palette-cell`).child(\n      new Icon(`border-${iconName}`),\n    ).on('click', () => {\n      this.mode = iconName;\n      const { mode, style, color } = this;\n      this.change({ mode, style, color });\n    }),\n  );\n}\n\nexport default class BorderPalette {\n  constructor() {\n    this.color = '#000';\n    this.style = 'thin';\n    this.mode = 'all';\n    this.change = () => {};\n    this.ddColor = new DropdownColor('line-color', this.color);\n    this.ddColor.change = (color) => {\n      this.color = color;\n    };\n    this.ddType = new DropdownLineType(this.style);\n    this.ddType.change = ([s]) => {\n      this.style = s;\n    };\n    this.el = h('div', `${cssPrefix}-border-palette`);\n    const table = buildTable(\n      h('tr', '').children(\n        h('td', `${cssPrefix}-border-palette-left`).child(\n          buildTable(\n            h('tr', '').children(\n              ...['all', 'inside', 'horizontal', 'vertical', 'outside'].map(it => buildTd.call(this, it)),\n            ),\n            h('tr', '').children(\n              ...['left', 'top', 'right', 'bottom', 'none'].map(it => buildTd.call(this, it)),\n            ),\n          ),\n        ),\n        h('td', `${cssPrefix}-border-palette-right`).children(\n          h('div', `${cssPrefix}-toolbar-btn`).child(this.ddColor.el),\n          h('div', `${cssPrefix}-toolbar-btn`).child(this.ddType.el),\n        ),\n      ),\n    );\n    this.el.child(table);\n  }\n}\n"
  },
  {
    "path": "src/component/bottombar.js",
    "content": "import { h } from './element';\nimport { bindClickoutside, unbindClickoutside } from './event';\nimport { cssPrefix } from '../config';\nimport Icon from './icon';\nimport FormInput from './form_input';\nimport Dropdown from './dropdown';\n// Record: temp not used\n// import { xtoast } from './message';\nimport { tf } from '../locale/locale';\n\nclass DropdownMore extends Dropdown {\n  constructor(click) {\n    const icon = new Icon('ellipsis');\n    super(icon, 'auto', false, 'top-left');\n    this.contentClick = click;\n  }\n\n  reset(items) {\n    const eles = items.map((it, i) => h('div', `${cssPrefix}-item`)\n      .css('width', '150px')\n      .css('font-weight', 'normal')\n      .on('click', () => {\n        this.contentClick(i);\n        this.hide();\n      })\n      .child(it));\n    this.setContentChildren(...eles);\n  }\n\n  setTitle() {}\n}\n\nconst menuItems = [\n  { key: 'delete', title: tf('contextmenu.deleteSheet') },\n];\n\nfunction buildMenuItem(item) {\n  return h('div', `${cssPrefix}-item`)\n    .child(item.title())\n    .on('click', () => {\n      this.itemClick(item.key);\n      this.hide();\n    });\n}\n\nfunction buildMenu() {\n  return menuItems.map(it => buildMenuItem.call(this, it));\n}\n\nclass ContextMenu {\n  constructor() {\n    this.el = h('div', `${cssPrefix}-contextmenu`)\n      .css('width', '160px')\n      .children(...buildMenu.call(this))\n      .hide();\n    this.itemClick = () => {};\n  }\n\n  hide() {\n    const { el } = this;\n    el.hide();\n    unbindClickoutside(el);\n  }\n\n  setOffset(offset) {\n    const { el } = this;\n    el.offset(offset);\n    el.show();\n    bindClickoutside(el);\n  }\n}\n\nexport default class Bottombar {\n  constructor(addFunc = () => {},\n    swapFunc = () => {},\n    deleteFunc = () => {},\n    updateFunc = () => {}) {\n    this.swapFunc = swapFunc;\n    this.updateFunc = updateFunc;\n    this.dataNames = [];\n    this.activeEl = null;\n    this.deleteEl = null;\n    this.items = [];\n    this.moreEl = new DropdownMore((i) => {\n      this.clickSwap2(this.items[i]);\n    });\n    this.contextMenu = new ContextMenu();\n    this.contextMenu.itemClick = deleteFunc;\n    this.el = h('div', `${cssPrefix}-bottombar`).children(\n      this.contextMenu.el,\n      this.menuEl = h('ul', `${cssPrefix}-menu`).child(\n        h('li', '').children(\n          new Icon('add').on('click', () => {\n            addFunc();\n          }),\n          h('span', '').child(this.moreEl),\n        ),\n      ),\n    );\n  }\n\n  addItem(name, active, options) {\n    this.dataNames.push(name);\n    const item = h('li', active ? 'active' : '').child(name);\n    item.on('click', () => {\n      this.clickSwap2(item);\n    }).on('contextmenu', (evt) => {\n      if (options.mode === 'read') return;\n      const { offsetLeft, offsetHeight } = evt.target;\n      this.contextMenu.setOffset({ left: offsetLeft, bottom: offsetHeight + 1 });\n      this.deleteEl = item;\n    }).on('dblclick', () => {\n      if (options.mode === 'read') return;\n      const v = item.html();\n      const input = new FormInput('auto', '');\n      input.val(v);\n      input.input.on('blur', ({ target }) => {\n        const { value } = target;\n        const nindex = this.dataNames.findIndex(it => it === v);\n        this.renameItem(nindex, value);\n        /*\n        this.dataNames.splice(nindex, 1, value);\n        this.moreEl.reset(this.dataNames);\n        item.html('').child(value);\n        this.updateFunc(nindex, value);\n        */\n      });\n      item.html('').child(input.el);\n      input.focus();\n    });\n    if (active) {\n      this.clickSwap(item);\n    }\n    this.items.push(item);\n    this.menuEl.child(item);\n    this.moreEl.reset(this.dataNames);\n  }\n\n  renameItem(index, value) {\n    this.dataNames.splice(index, 1, value);\n    this.moreEl.reset(this.dataNames);\n    this.items[index].html('').child(value);\n    this.updateFunc(index, value);\n  }\n\n  clear() {\n    this.items.forEach((it) => {\n      this.menuEl.removeChild(it.el);\n    });\n    this.items = [];\n    this.dataNames = [];\n    this.moreEl.reset(this.dataNames);\n  }\n\n  deleteItem() {\n    const { activeEl, deleteEl } = this;\n    if (this.items.length > 1) {\n      const index = this.items.findIndex(it => it === deleteEl);\n      this.items.splice(index, 1);\n      this.dataNames.splice(index, 1);\n      this.menuEl.removeChild(deleteEl.el);\n      this.moreEl.reset(this.dataNames);\n      if (activeEl === deleteEl) {\n        const [f] = this.items;\n        this.activeEl = f;\n        this.activeEl.toggle();\n        return [index, 0];\n      }\n      return [index, -1];\n    }\n    return [-1];\n  }\n\n  clickSwap2(item) {\n    const index = this.items.findIndex(it => it === item);\n    this.clickSwap(item);\n    this.activeEl.toggle();\n    this.swapFunc(index);\n  }\n\n  clickSwap(item) {\n    if (this.activeEl !== null) {\n      this.activeEl.toggle();\n    }\n    this.activeEl = item;\n  }\n}\n"
  },
  {
    "path": "src/component/button.js",
    "content": "import { Element } from './element';\nimport { cssPrefix } from '../config';\nimport { t } from '../locale/locale';\n\nexport default class Button extends Element {\n  // type: primary\n  constructor(title, type = '') {\n    super('div', `${cssPrefix}-button ${type}`);\n    this.child(t(`button.${title}`));\n  }\n}\n"
  },
  {
    "path": "src/component/calendar.js",
    "content": "import { h } from './element';\nimport Icon from './icon';\nimport { t } from '../locale/locale';\n\nfunction addMonth(date, step) {\n  date.setMonth(date.getMonth() + step);\n}\n\nfunction weekday(date, index) {\n  const d = new Date(date);\n  d.setDate(index - date.getDay() + 1);\n  return d;\n}\n\nfunction monthDays(year, month, cdate) {\n  // the first day of month\n  const startDate = new Date(year, month, 1, 23, 59, 59);\n  const datess = [[], [], [], [], [], []];\n  for (let i = 0; i < 6; i += 1) {\n    for (let j = 0; j < 7; j += 1) {\n      const index = i * 7 + j;\n      const d = weekday(startDate, index);\n      const disabled = d.getMonth() !== month;\n      // console.log('d:', d, ', cdate:', cdate);\n      const active = d.getMonth() === cdate.getMonth() && d.getDate() === cdate.getDate();\n      datess[i][j] = { d, disabled, active };\n    }\n  }\n  return datess;\n}\n\nexport default class Calendar {\n  constructor(value) {\n    this.value = value;\n    this.cvalue = new Date(value);\n\n    this.headerLeftEl = h('div', 'calendar-header-left');\n    this.bodyEl = h('tbody', '');\n    this.buildAll();\n    this.el = h('div', 'x-spreadsheet-calendar')\n      .children(\n        h('div', 'calendar-header').children(\n          this.headerLeftEl,\n          h('div', 'calendar-header-right').children(\n            h('a', 'calendar-prev')\n              .on('click.stop', () => this.prev())\n              .child(new Icon('chevron-left')),\n            h('a', 'calendar-next')\n              .on('click.stop', () => this.next())\n              .child(new Icon('chevron-right')),\n          ),\n        ),\n        h('table', 'calendar-body').children(\n          h('thead', '').child(\n            h('tr', '').children(\n              ...t('calendar.weeks').map(week => h('th', 'cell').child(week)),\n            ),\n          ),\n          this.bodyEl,\n        ),\n      );\n    this.selectChange = () => {};\n  }\n\n  setValue(value) {\n    this.value = value;\n    this.cvalue = new Date(value);\n    this.buildAll();\n  }\n\n  prev() {\n    const { value } = this;\n    addMonth(value, -1);\n    this.buildAll();\n  }\n\n  next() {\n    const { value } = this;\n    addMonth(value, 1);\n    this.buildAll();\n  }\n\n  buildAll() {\n    this.buildHeaderLeft();\n    this.buildBody();\n  }\n\n  buildHeaderLeft() {\n    const { value } = this;\n    this.headerLeftEl.html(`${t('calendar.months')[value.getMonth()]} ${value.getFullYear()}`);\n  }\n\n  buildBody() {\n    const { value, cvalue, bodyEl } = this;\n    const mDays = monthDays(value.getFullYear(), value.getMonth(), cvalue);\n    const trs = mDays.map((it) => {\n      const tds = it.map((it1) => {\n        let cls = 'cell';\n        if (it1.disabled) cls += ' disabled';\n        if (it1.active) cls += ' active';\n        return h('td', '').child(\n          h('div', cls)\n            .on('click.stop', () => {\n              this.selectChange(it1.d);\n            })\n            .child(it1.d.getDate().toString()),\n        );\n      });\n      return h('tr', '').children(...tds);\n    });\n    bodyEl.html('').children(...trs);\n  }\n}\n"
  },
  {
    "path": "src/component/color_palette.js",
    "content": "import { h } from './element';\nimport { cssPrefix } from '../config';\n\nconst themeColorPlaceHolders = ['#ffffff', '#000100', '#e7e5e6', '#445569', '#5b9cd6', '#ed7d31', '#a5a5a5', '#ffc001', '#4371c6', '#71ae47'];\n\nconst themeColors = [\n  ['#f2f2f2', '#7f7f7f', '#d0cecf', '#d5dce4', '#deeaf6', '#fce5d5', '#ededed', '#fff2cd', '#d9e2f3', '#e3efd9'],\n  ['#d8d8d8', '#595959', '#afabac', '#adb8ca', '#bdd7ee', '#f7ccac', '#dbdbdb', '#ffe59a', '#b3c6e7', '#c5e0b3'],\n  ['#bfbfbf', '#3f3f3f', '#756f6f', '#8596b0', '#9cc2e6', '#f4b184', '#c9c9c9', '#fed964', '#8eaada', '#a7d08c'],\n  ['#a5a5a5', '#262626', '#3a3839', '#333f4f', '#2e75b5', '#c45a10', '#7b7b7b', '#bf8e01', '#2f5596', '#538136'],\n  ['#7f7f7f', '#0c0c0c', '#171516', '#222a35', '#1f4e7a', '#843c0a', '#525252', '#7e6000', '#203864', '#365624'],\n];\n\nconst standardColors = ['#c00000', '#fe0000', '#fdc101', '#ffff01', '#93d051', '#00b04e', '#01b0f1', '#0170c1', '#012060', '#7030a0'];\n\nfunction buildTd(bgcolor) {\n  return h('td', '').child(\n    h('div', `${cssPrefix}-color-palette-cell`)\n      .on('click.stop', () => this.change(bgcolor))\n      .css('background-color', bgcolor),\n  );\n}\n\nexport default class ColorPalette {\n  constructor() {\n    this.el = h('div', `${cssPrefix}-color-palette`);\n    this.change = () => {};\n    const table = h('table', '').children(\n      h('tbody', '').children(\n        h('tr', `${cssPrefix}-theme-color-placeholders`).children(\n          ...themeColorPlaceHolders.map(color => buildTd.call(this, color)),\n        ),\n        ...themeColors.map(it => h('tr', `${cssPrefix}-theme-colors`).children(\n          ...it.map(color => buildTd.call(this, color)),\n        )),\n        h('tr', `${cssPrefix}-standard-colors`).children(\n          ...standardColors.map(color => buildTd.call(this, color)),\n        ),\n      ),\n    );\n    this.el.child(table);\n  }\n}\n"
  },
  {
    "path": "src/component/contextmenu.js",
    "content": "import { h } from './element';\nimport { bindClickoutside, unbindClickoutside } from './event';\nimport { cssPrefix } from '../config';\nimport { tf } from '../locale/locale';\n\nconst menuItems = [\n  { key: 'copy', title: tf('contextmenu.copy'), label: 'Ctrl+C' },\n  { key: 'cut', title: tf('contextmenu.cut'), label: 'Ctrl+X' },\n  { key: 'paste', title: tf('contextmenu.paste'), label: 'Ctrl+V' },\n  { key: 'paste-value', title: tf('contextmenu.pasteValue'), label: 'Ctrl+Shift+V' },\n  { key: 'paste-format', title: tf('contextmenu.pasteFormat'), label: 'Ctrl+Alt+V' },\n  { key: 'divider' },\n  { key: 'insert-row', title: tf('contextmenu.insertRow') },\n  { key: 'insert-column', title: tf('contextmenu.insertColumn') },\n  { key: 'divider' },\n  { key: 'delete-row', title: tf('contextmenu.deleteRow') },\n  { key: 'delete-column', title: tf('contextmenu.deleteColumn') },\n  { key: 'delete-cell-text', title: tf('contextmenu.deleteCellText') },\n  { key: 'hide', title: tf('contextmenu.hide') },\n  { key: 'divider' },\n  { key: 'validation', title: tf('contextmenu.validation') },\n  { key: 'divider' },\n  { key: 'cell-printable', title: tf('contextmenu.cellprintable') },\n  { key: 'cell-non-printable', title: tf('contextmenu.cellnonprintable') },\n  { key: 'divider' },\n  { key: 'cell-editable', title: tf('contextmenu.celleditable') },\n  { key: 'cell-non-editable', title: tf('contextmenu.cellnoneditable') },\n];\n\nfunction buildMenuItem(item) {\n  if (item.key === 'divider') {\n    return h('div', `${cssPrefix}-item divider`);\n  }\n  return h('div', `${cssPrefix}-item`)\n    .on('click', () => {\n      this.itemClick(item.key);\n      this.hide();\n    })\n    .children(\n      item.title(),\n      h('div', 'label').child(item.label || ''),\n    );\n}\n\nfunction buildMenu() {\n  return menuItems.map(it => buildMenuItem.call(this, it));\n}\n\nexport default class ContextMenu {\n  constructor(viewFn, isHide = false) {\n    this.menuItems = buildMenu.call(this);\n    this.el = h('div', `${cssPrefix}-contextmenu`)\n      .children(...this.menuItems)\n      .hide();\n    this.viewFn = viewFn;\n    this.itemClick = () => {};\n    this.isHide = isHide;\n    this.setMode('range');\n  }\n\n  // row-col: the whole rows or the whole cols\n  // range: select range\n  setMode(mode) {\n    const hideEl = this.menuItems[12];\n    if (mode === 'row-col') {\n      hideEl.show();\n    } else {\n      hideEl.hide();\n    }\n  }\n\n  hide() {\n    const { el } = this;\n    el.hide();\n    unbindClickoutside(el);\n  }\n\n  setPosition(x, y) {\n    if (this.isHide) return;\n    const { el } = this;\n    const { width } = el.show().offset();\n    const view = this.viewFn();\n    const vhf = view.height / 2;\n    let left = x;\n    if (view.width - x <= width) {\n      left -= width;\n    }\n    el.css('left', `${left}px`);\n    if (y > vhf) {\n      el.css('bottom', `${view.height - y}px`)\n        .css('max-height', `${y}px`)\n        .css('top', 'auto');\n    } else {\n      el.css('top', `${y}px`)\n        .css('max-height', `${view.height - y}px`)\n        .css('bottom', 'auto');\n    }\n    bindClickoutside(el);\n  }\n}\n"
  },
  {
    "path": "src/component/datepicker.js",
    "content": "import Calendar from './calendar';\nimport { h } from './element';\nimport { cssPrefix } from '../config';\n\nexport default class Datepicker {\n  constructor() {\n    this.calendar = new Calendar(new Date());\n    this.el = h('div', `${cssPrefix}-datepicker`).child(\n      this.calendar.el,\n    ).hide();\n  }\n\n  setValue(date) {\n    // console.log(':::::::', date, typeof date, date instanceof string);\n    const { calendar } = this;\n    if (typeof date === 'string') {\n      // console.log(/^\\d{4}-\\d{1,2}-\\d{1,2}$/.test(date));\n      if (/^\\d{4}-\\d{1,2}-\\d{1,2}$/.test(date)) {\n        calendar.setValue(new Date(date.replace(new RegExp('-', 'g'), '/')));\n      }\n    } else if (date instanceof Date) {\n      calendar.setValue(date);\n    }\n    return this;\n  }\n\n  change(cb) {\n    this.calendar.selectChange = (d) => {\n      cb(d);\n      this.hide();\n    };\n  }\n\n  show() {\n    this.el.show();\n  }\n\n  hide() {\n    this.el.hide();\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown.js",
    "content": "import { Element, h } from './element';\nimport { bindClickoutside, unbindClickoutside } from './event';\nimport { cssPrefix } from '../config';\n\nexport default class Dropdown extends Element {\n  constructor(title, width, showArrow, placement, ...children) {\n    super('div', `${cssPrefix}-dropdown ${placement}`);\n    this.title = title;\n    this.change = () => {};\n    this.headerClick = () => {};\n    if (typeof title === 'string') {\n      this.title = h('div', `${cssPrefix}-dropdown-title`).child(title);\n    } else if (showArrow) {\n      this.title.addClass('arrow-left');\n    }\n    this.contentEl = h('div', `${cssPrefix}-dropdown-content`)\n      .css('width', width)\n      .hide();\n\n    this.setContentChildren(...children);\n\n    this.headerEl = h('div', `${cssPrefix}-dropdown-header`);\n    this.headerEl.on('click', () => {\n      if (this.contentEl.css('display') !== 'block') {\n        this.show();\n      } else {\n        this.hide();\n      }\n    }).children(\n      this.title,\n      showArrow ? h('div', `${cssPrefix}-icon arrow-right`).child(\n        h('div', `${cssPrefix}-icon-img arrow-down`),\n      ) : '',\n    );\n    this.children(this.headerEl, this.contentEl);\n  }\n\n  setContentChildren(...children) {\n    this.contentEl.html('');\n    if (children.length > 0) {\n      this.contentEl.children(...children);\n    }\n  }\n\n  setTitle(title) {\n    this.title.html(title);\n    this.hide();\n  }\n\n  show() {\n    const { contentEl } = this;\n    contentEl.show();\n    this.parent().active();\n    bindClickoutside(this.parent(), () => {\n      this.hide();\n    });\n  }\n\n  hide() {\n    this.parent().active(false);\n    this.contentEl.hide();\n    unbindClickoutside(this.parent());\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_align.js",
    "content": "import Dropdown from './dropdown';\nimport { h } from './element';\nimport Icon from './icon';\nimport { cssPrefix } from '../config';\n\nfunction buildItemWithIcon(iconName) {\n  return h('div', `${cssPrefix}-item`).child(new Icon(iconName));\n}\n\nexport default class DropdownAlign extends Dropdown {\n  constructor(aligns, align) {\n    const icon = new Icon(`align-${align}`);\n    const naligns = aligns.map(it => buildItemWithIcon(`align-${it}`)\n      .on('click', () => {\n        this.setTitle(it);\n        this.change(it);\n      }));\n    super(icon, 'auto', true, 'bottom-left', ...naligns);\n  }\n\n  setTitle(align) {\n    this.title.setName(`align-${align}`);\n    this.hide();\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_border.js",
    "content": "import Dropdown from './dropdown';\nimport Icon from './icon';\nimport BorderPalette from './border_palette';\n\nexport default class DropdownBorder extends Dropdown {\n  constructor() {\n    const icon = new Icon('border-all');\n    const borderPalette = new BorderPalette();\n    borderPalette.change = (v) => {\n      this.change(v);\n      this.hide();\n    };\n    super(icon, 'auto', false, 'bottom-left', borderPalette.el);\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_color.js",
    "content": "import Dropdown from './dropdown';\nimport Icon from './icon';\nimport ColorPalette from './color_palette';\n\nexport default class DropdownColor extends Dropdown {\n  constructor(iconName, color) {\n    const icon = new Icon(iconName)\n      .css('height', '16px')\n      .css('border-bottom', `3px solid ${color}`);\n    const colorPalette = new ColorPalette();\n    colorPalette.change = (v) => {\n      this.setTitle(v);\n      this.change(v);\n    };\n    super(icon, 'auto', false, 'bottom-left', colorPalette.el);\n  }\n\n  setTitle(color) {\n    this.title.css('border-color', color);\n    this.hide();\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_font.js",
    "content": "import Dropdown from './dropdown';\nimport { h } from './element';\nimport { baseFonts } from '../core/font';\nimport { cssPrefix } from '../config';\n\nexport default class DropdownFont extends Dropdown {\n  constructor() {\n    const nfonts = baseFonts.map(it => h('div', `${cssPrefix}-item`)\n      .on('click', () => {\n        this.setTitle(it.title);\n        this.change(it);\n      })\n      .child(it.title));\n    super(baseFonts[0].title, '160px', true, 'bottom-left', ...nfonts);\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_fontsize.js",
    "content": "import Dropdown from './dropdown';\nimport { h } from './element';\nimport { fontSizes } from '../core/font';\nimport { cssPrefix } from '../config';\n\nexport default class DropdownFontSize extends Dropdown {\n  constructor() {\n    const nfontSizes = fontSizes.map(it => h('div', `${cssPrefix}-item`)\n      .on('click', () => {\n        this.setTitle(`${it.pt}`);\n        this.change(it);\n      })\n      .child(`${it.pt}`));\n    super('10', '60px', true, 'bottom-left', ...nfontSizes);\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_format.js",
    "content": "import Dropdown from './dropdown';\nimport { h } from './element';\nimport { baseFormats } from '../core/format';\nimport { cssPrefix } from '../config';\n\nexport default class DropdownFormat extends Dropdown {\n  constructor() {\n    let nformats = baseFormats.slice(0);\n    nformats.splice(2, 0, { key: 'divider' });\n    nformats.splice(8, 0, { key: 'divider' });\n    nformats = nformats.map((it) => {\n      const item = h('div', `${cssPrefix}-item`);\n      if (it.key === 'divider') {\n        item.addClass('divider');\n      } else {\n        item.child(it.title())\n          .on('click', () => {\n            this.setTitle(it.title());\n            this.change(it);\n          });\n        if (it.label) item.child(h('div', 'label').html(it.label));\n      }\n      return item;\n    });\n    super('Normal', '220px', true, 'bottom-left', ...nformats);\n  }\n\n  setTitle(key) {\n    for (let i = 0; i < baseFormats.length; i += 1) {\n      if (baseFormats[i].key === key) {\n        this.title.html(baseFormats[i].title());\n      }\n    }\n    this.hide();\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_formula.js",
    "content": "import Dropdown from './dropdown';\nimport Icon from './icon';\nimport { h } from './element';\nimport { baseFormulas } from '../core/formula';\nimport { cssPrefix } from '../config';\n\nexport default class DropdownFormula extends Dropdown {\n  constructor() {\n    const nformulas = baseFormulas.map(it => h('div', `${cssPrefix}-item`)\n      .on('click', () => {\n        this.hide();\n        this.change(it);\n      })\n      .child(it.key));\n    super(new Icon('formula'), '180px', true, 'bottom-left', ...nformulas);\n  }\n}\n"
  },
  {
    "path": "src/component/dropdown_linetype.js",
    "content": "import Dropdown from './dropdown';\nimport { h } from './element';\nimport Icon from './icon';\nimport { cssPrefix } from '../config';\n\nconst lineTypes = [\n  ['thin', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],\n  ['medium', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"2\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.0\" x2=\"50\" y2=\"1.0\" stroke-width=\"2\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],\n  ['thick', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"3\" style=\"user-select: none;\"><line x1=\"0\" y1=\"1.5\" x2=\"50\" y2=\"1.5\" stroke-width=\"3\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],\n  ['dashed', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"2\" style=\"user-select: none;\"></line></svg>'],\n  ['dotted', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"1\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" stroke-dasharray=\"1\" style=\"user-select: none;\"></line></svg>'],\n  // ['double', '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"3\" style=\"user-select: none;\"><line x1=\"0\" y1=\"0.5\" x2=\"50\" y2=\"0.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line><line x1=\"0\" y1=\"2.5\" x2=\"50\" y2=\"2.5\" stroke-width=\"1\" stroke=\"black\" style=\"user-select: none;\"></line></svg>'],\n];\n\nexport default class DropdownLineType extends Dropdown {\n  constructor(type) {\n    const icon = new Icon('line-type');\n    let beforei = 0;\n    const lineTypeEls = lineTypes.map((it, iti) => h('div', `${cssPrefix}-item state ${type === it[0] ? 'checked' : ''}`)\n      .on('click', () => {\n        lineTypeEls[beforei].toggle('checked');\n        lineTypeEls[iti].toggle('checked');\n        beforei = iti;\n        this.hide();\n        this.change(it);\n      })\n      .child(\n        h('div', `${cssPrefix}-line-type`).html(it[1]),\n      ));\n\n    super(icon, 'auto', false, 'bottom-left', ...lineTypeEls);\n  }\n}\n"
  },
  {
    "path": "src/component/editor.js",
    "content": "//* global window */\nimport { h } from './element';\nimport Suggest from './suggest';\nimport Datepicker from './datepicker';\nimport { cssPrefix } from '../config';\n// import { mouseMoveUp } from '../event';\n\nfunction resetTextareaSize() {\n  const { inputText } = this;\n  if (!/^\\s*$/.test(inputText)) {\n    const {\n      textlineEl, textEl, areaOffset,\n    } = this;\n    const txts = inputText.split('\\n');\n    const maxTxtSize = Math.max(...txts.map(it => it.length));\n    const tlOffset = textlineEl.offset();\n    const fontWidth = tlOffset.width / inputText.length;\n    const tlineWidth = (maxTxtSize + 1) * fontWidth + 5;\n    const maxWidth = this.viewFn().width - areaOffset.left - fontWidth;\n    let h1 = txts.length;\n    if (tlineWidth > areaOffset.width) {\n      let twidth = tlineWidth;\n      if (tlineWidth > maxWidth) {\n        twidth = maxWidth;\n        h1 += parseInt(tlineWidth / maxWidth, 10);\n        h1 += (tlineWidth % maxWidth) > 0 ? 1 : 0;\n      }\n      textEl.css('width', `${twidth}px`);\n    }\n    h1 *= this.rowHeight;\n    if (h1 > areaOffset.height) {\n      textEl.css('height', `${h1}px`);\n    }\n  }\n}\n\nfunction insertText({ target }, itxt) {\n  const { value, selectionEnd } = target;\n  const ntxt = `${value.slice(0, selectionEnd)}${itxt}${value.slice(selectionEnd)}`;\n  target.value = ntxt;\n  target.setSelectionRange(selectionEnd + 1, selectionEnd + 1);\n\n  this.inputText = ntxt;\n  this.textlineEl.html(ntxt);\n  resetTextareaSize.call(this);\n}\n\nfunction keydownEventHandler(evt) {\n  const { keyCode, altKey } = evt;\n  if (keyCode !== 13 && keyCode !== 9) evt.stopPropagation();\n  if (keyCode === 13 && altKey) {\n    insertText.call(this, evt, '\\n');\n    evt.stopPropagation();\n  }\n  if (keyCode === 13 && !altKey) evt.preventDefault();\n}\n\nfunction inputEventHandler(evt) {\n  const v = evt.target.value;\n  // console.log(evt, 'v:', v);\n  const { suggest, textlineEl, validator } = this;\n  const { cell } = this;\n  if (cell !== null) {\n    if (('editable' in cell && cell.editable === true) || (cell.editable === undefined)) {\n      this.inputText = v;\n      if (validator) {\n        if (validator.type === 'list') {\n          suggest.search(v);\n        } else {\n          suggest.hide();\n        }\n      } else {\n        const start = v.lastIndexOf('=');\n        if (start !== -1) {\n          suggest.search(v.substring(start + 1));\n        } else {\n          suggest.hide();\n        }\n      }\n      textlineEl.html(v);\n      resetTextareaSize.call(this);\n      this.change('input', v);\n    } else {\n      evt.target.value = cell.text || '';\n    }\n  } else {\n    this.inputText = v;\n    if (validator) {\n      if (validator.type === 'list') {\n        suggest.search(v);\n      } else {\n        suggest.hide();\n      }\n    } else {\n      const start = v.lastIndexOf('=');\n      if (start !== -1) {\n        suggest.search(v.substring(start + 1));\n      } else {\n        suggest.hide();\n      }\n    }\n    textlineEl.html(v);\n    resetTextareaSize.call(this);\n    this.change('input', v);\n  }\n}\n\nfunction setTextareaRange(position) {\n  const { el } = this.textEl;\n  setTimeout(() => {\n    el.focus();\n    el.setSelectionRange(position, position);\n  }, 0);\n}\n\nfunction setText(text, position) {\n  const { textEl, textlineEl } = this;\n  // firefox bug\n  textEl.el.blur();\n\n  textEl.val(text);\n  textlineEl.html(text);\n  setTextareaRange.call(this, position);\n}\n\nfunction suggestItemClick(it) {\n  const { inputText, validator } = this;\n  let position = 0;\n  if (validator && validator.type === 'list') {\n    this.inputText = it;\n    position = this.inputText.length;\n  } else {\n    const start = inputText.lastIndexOf('=');\n    const sit = inputText.substring(0, start + 1);\n    let eit = inputText.substring(start + 1);\n    if (eit.indexOf(')') !== -1) {\n      eit = eit.substring(eit.indexOf(')'));\n    } else {\n      eit = '';\n    }\n    this.inputText = `${sit + it.key}(`;\n    // console.log('inputText:', this.inputText);\n    position = this.inputText.length;\n    this.inputText += `)${eit}`;\n  }\n  setText.call(this, this.inputText, position);\n}\n\nfunction resetSuggestItems() {\n  this.suggest.setItems(this.formulas);\n}\n\nfunction dateFormat(d) {\n  let month = d.getMonth() + 1;\n  let date = d.getDate();\n  if (month < 10) month = `0${month}`;\n  if (date < 10) date = `0${date}`;\n  return `${d.getFullYear()}-${month}-${date}`;\n}\n\nexport default class Editor {\n  constructor(formulas, viewFn, rowHeight) {\n    this.viewFn = viewFn;\n    this.rowHeight = rowHeight;\n    this.formulas = formulas;\n    this.suggest = new Suggest(formulas, (it) => {\n      suggestItemClick.call(this, it);\n    });\n    this.datepicker = new Datepicker();\n    this.datepicker.change((d) => {\n      // console.log('d:', d);\n      this.setText(dateFormat(d));\n      this.clear();\n    });\n    this.areaEl = h('div', `${cssPrefix}-editor-area`)\n      .children(\n        this.textEl = h('textarea', '')\n          .on('input', evt => inputEventHandler.call(this, evt))\n          .on('paste.stop', () => {})\n          .on('keydown', evt => keydownEventHandler.call(this, evt)),\n        this.textlineEl = h('div', 'textline'),\n        this.suggest.el,\n        this.datepicker.el,\n      )\n      .on('mousemove.stop', () => {})\n      .on('mousedown.stop', () => {});\n    this.el = h('div', `${cssPrefix}-editor`)\n      .child(this.areaEl).hide();\n    this.suggest.bindInputEvents(this.textEl);\n\n    this.areaOffset = null;\n    this.freeze = { w: 0, h: 0 };\n    this.cell = null;\n    this.inputText = '';\n    this.change = () => {};\n  }\n\n  setFreezeLengths(width, height) {\n    this.freeze.w = width;\n    this.freeze.h = height;\n  }\n\n  clear() {\n    // const { cell } = this;\n    // const cellText = (cell && cell.text) || '';\n    if (this.inputText !== '') {\n      this.change('finished', this.inputText);\n    }\n    this.cell = null;\n    this.areaOffset = null;\n    this.inputText = '';\n    this.el.hide();\n    this.textEl.val('');\n    this.textlineEl.html('');\n    resetSuggestItems.call(this);\n    this.datepicker.hide();\n  }\n\n  setOffset(offset, suggestPosition = 'top') {\n    const {\n      textEl, areaEl, suggest, freeze, el,\n    } = this;\n    if (offset) {\n      this.areaOffset = offset;\n      const {\n        left, top, width, height, l, t,\n      } = offset;\n      // console.log('left:', left, ',top:', top, ', freeze:', freeze);\n      const elOffset = { left: 0, top: 0 };\n      // top left\n      if (freeze.w > l && freeze.h > t) {\n        //\n      } else if (freeze.w < l && freeze.h < t) {\n        elOffset.left = freeze.w;\n        elOffset.top = freeze.h;\n      } else if (freeze.w > l) {\n        elOffset.top = freeze.h;\n      } else if (freeze.h > t) {\n        elOffset.left = freeze.w;\n      }\n      el.offset(elOffset);\n      areaEl.offset({ left: left - elOffset.left - 0.8, top: top - elOffset.top - 0.8 });\n      textEl.offset({ width: width - 9 + 0.8, height: height - 3 + 0.8 });\n      const sOffset = { left: 0 };\n      sOffset[suggestPosition] = height;\n      suggest.setOffset(sOffset);\n      suggest.hide();\n    }\n  }\n\n  setCell(cell, validator) {\n    if (cell && cell.editable === false) return;\n\n    // console.log('::', validator);\n    const { el, datepicker, suggest } = this;\n    el.show();\n    this.cell = cell;\n    const text = (cell && cell.text) || '';\n    this.setText(text);\n\n    this.validator = validator;\n    if (validator) {\n      const { type } = validator;\n      if (type === 'date') {\n        datepicker.show();\n        if (!/^\\s*$/.test(text)) {\n          datepicker.setValue(text);\n        }\n      }\n      if (type === 'list') {\n        suggest.setItems(validator.values());\n        suggest.search('');\n      }\n    }\n  }\n\n  setText(text) {\n    this.inputText = text;\n    // console.log('text>>:', text);\n    setText.call(this, text, text.length);\n    resetTextareaSize.call(this);\n  }\n}\n"
  },
  {
    "path": "src/component/element.js",
    "content": "/* global document */\n/* global window */\nclass Element {\n  constructor(tag, className = '') {\n    if (typeof tag === 'string') {\n      this.el = document.createElement(tag);\n      this.el.className = className;\n    } else {\n      this.el = tag;\n    }\n    this.data = {};\n  }\n\n  data(key, value) {\n    if (value !== undefined) {\n      this.data[key] = value;\n      return this;\n    }\n    return this.data[key];\n  }\n\n  on(eventNames, handler) {\n    const [fen, ...oen] = eventNames.split('.');\n    let eventName = fen;\n    if (eventName === 'mousewheel' && /Firefox/i.test(window.navigator.userAgent)) {\n      eventName = 'DOMMouseScroll';\n    }\n    this.el.addEventListener(eventName, (evt) => {\n      handler(evt);\n      for (let i = 0; i < oen.length; i += 1) {\n        const k = oen[i];\n        if (k === 'left' && evt.button !== 0) {\n          return;\n        }\n        if (k === 'right' && evt.button !== 2) {\n          return;\n        }\n        if (k === 'stop') {\n          evt.stopPropagation();\n        }\n      }\n    });\n    return this;\n  }\n\n  offset(value) {\n    if (value !== undefined) {\n      Object.keys(value).forEach((k) => {\n        this.css(k, `${value[k]}px`);\n      });\n      return this;\n    }\n    const {\n      offsetTop, offsetLeft, offsetHeight, offsetWidth,\n    } = this.el;\n    return {\n      top: offsetTop,\n      left: offsetLeft,\n      height: offsetHeight,\n      width: offsetWidth,\n    };\n  }\n\n  scroll(v) {\n    const { el } = this;\n    if (v !== undefined) {\n      if (v.left !== undefined) {\n        el.scrollLeft = v.left;\n      }\n      if (v.top !== undefined) {\n        el.scrollTop = v.top;\n      }\n    }\n    return { left: el.scrollLeft, top: el.scrollTop };\n  }\n\n  box() {\n    return this.el.getBoundingClientRect();\n  }\n\n  parent() {\n    return new Element(this.el.parentNode);\n  }\n\n  children(...eles) {\n    if (arguments.length === 0) {\n      return this.el.childNodes;\n    }\n    eles.forEach(ele => this.child(ele));\n    return this;\n  }\n\n  removeChild(el) {\n    this.el.removeChild(el);\n  }\n\n  /*\n  first() {\n    return this.el.firstChild;\n  }\n\n  last() {\n    return this.el.lastChild;\n  }\n\n  remove(ele) {\n    return this.el.removeChild(ele);\n  }\n\n  prepend(ele) {\n    const { el } = this;\n    if (el.children.length > 0) {\n      el.insertBefore(ele, el.firstChild);\n    } else {\n      el.appendChild(ele);\n    }\n    return this;\n  }\n\n  prev() {\n    return this.el.previousSibling;\n  }\n\n  next() {\n    return this.el.nextSibling;\n  }\n  */\n\n  child(arg) {\n    let ele = arg;\n    if (typeof arg === 'string') {\n      ele = document.createTextNode(arg);\n    } else if (arg instanceof Element) {\n      ele = arg.el;\n    }\n    this.el.appendChild(ele);\n    return this;\n  }\n\n  contains(ele) {\n    return this.el.contains(ele);\n  }\n\n  className(v) {\n    if (v !== undefined) {\n      this.el.className = v;\n      return this;\n    }\n    return this.el.className;\n  }\n\n  addClass(name) {\n    this.el.classList.add(name);\n    return this;\n  }\n\n  hasClass(name) {\n    return this.el.classList.contains(name);\n  }\n\n  removeClass(name) {\n    this.el.classList.remove(name);\n    return this;\n  }\n\n  toggle(cls = 'active') {\n    return this.toggleClass(cls);\n  }\n\n  toggleClass(name) {\n    return this.el.classList.toggle(name);\n  }\n\n  active(flag = true, cls = 'active') {\n    if (flag) this.addClass(cls);\n    else this.removeClass(cls);\n    return this;\n  }\n\n  checked(flag = true) {\n    this.active(flag, 'checked');\n    return this;\n  }\n\n  disabled(flag = true) {\n    if (flag) this.addClass('disabled');\n    else this.removeClass('disabled');\n    return this;\n  }\n\n  // key, value\n  // key\n  // {k, v}...\n  attr(key, value) {\n    if (value !== undefined) {\n      this.el.setAttribute(key, value);\n    } else {\n      if (typeof key === 'string') {\n        return this.el.getAttribute(key);\n      }\n      Object.keys(key).forEach((k) => {\n        this.el.setAttribute(k, key[k]);\n      });\n    }\n    return this;\n  }\n\n  removeAttr(key) {\n    this.el.removeAttribute(key);\n    return this;\n  }\n\n  html(content) {\n    if (content !== undefined) {\n      this.el.innerHTML = content;\n      return this;\n    }\n    return this.el.innerHTML;\n  }\n\n  val(v) {\n    if (v !== undefined) {\n      this.el.value = v;\n      return this;\n    }\n    return this.el.value;\n  }\n\n  focus() {\n    this.el.focus();\n  }\n\n  cssRemoveKeys(...keys) {\n    keys.forEach(k => this.el.style.removeProperty(k));\n    return this;\n  }\n\n  // css( propertyName )\n  // css( propertyName, value )\n  // css( properties )\n  css(name, value) {\n    if (value === undefined && typeof name !== 'string') {\n      Object.keys(name).forEach((k) => {\n        this.el.style[k] = name[k];\n      });\n      return this;\n    }\n    if (value !== undefined) {\n      this.el.style[name] = value;\n      return this;\n    }\n    return this.el.style[name];\n  }\n\n  computedStyle() {\n    return window.getComputedStyle(this.el, null);\n  }\n\n  show() {\n    this.css('display', 'block');\n    return this;\n  }\n\n  hide() {\n    this.css('display', 'none');\n    return this;\n  }\n}\n\nconst h = (tag, className = '') => new Element(tag, className);\n\nexport {\n  Element,\n  h,\n};\n"
  },
  {
    "path": "src/component/event.js",
    "content": "/* global window */\nexport function bind(target, name, fn) {\n  target.addEventListener(name, fn);\n}\nexport function unbind(target, name, fn) {\n  target.removeEventListener(name, fn);\n}\nexport function unbindClickoutside(el) {\n  if (el.xclickoutside) {\n    unbind(window.document.body, 'click', el.xclickoutside);\n    delete el.xclickoutside;\n  }\n}\n\n// the left mouse button: mousedown → mouseup → click\n// the right mouse button: mousedown → contenxtmenu → mouseup\n// the right mouse button in firefox(>65.0): mousedown → contenxtmenu → mouseup → click on window\nexport function bindClickoutside(el, cb) {\n  el.xclickoutside = (evt) => {\n    // ignore double click\n    // console.log('evt:', evt);\n    if (evt.detail === 2 || el.contains(evt.target)) return;\n    if (cb) cb(el);\n    else {\n      el.hide();\n      unbindClickoutside(el);\n    }\n  };\n  bind(window.document.body, 'click', el.xclickoutside);\n}\nexport function mouseMoveUp(target, movefunc, upfunc) {\n  bind(target, 'mousemove', movefunc);\n  const t = target;\n  t.xEvtUp = (evt) => {\n    // console.log('mouseup>>>');\n    unbind(target, 'mousemove', movefunc);\n    unbind(target, 'mouseup', target.xEvtUp);\n    upfunc(evt);\n  };\n  bind(target, 'mouseup', target.xEvtUp);\n}\n\nfunction calTouchDirection(spanx, spany, evt, cb) {\n  let direction = '';\n  // console.log('spanx:', spanx, ', spany:', spany);\n  if (Math.abs(spanx) > Math.abs(spany)) {\n    // horizontal\n    direction = spanx > 0 ? 'right' : 'left';\n    cb(direction, spanx, evt);\n  } else {\n    // vertical\n    direction = spany > 0 ? 'down' : 'up';\n    cb(direction, spany, evt);\n  }\n}\n// cb = (direction, distance) => {}\nexport function bindTouch(target, { move, end }) {\n  let startx = 0;\n  let starty = 0;\n  bind(target, 'touchstart', (evt) => {\n    const { pageX, pageY } = evt.touches[0];\n    startx = pageX;\n    starty = pageY;\n  });\n  bind(target, 'touchmove', (evt) => {\n    if (!move) return;\n    const { pageX, pageY } = evt.changedTouches[0];\n    const spanx = pageX - startx;\n    const spany = pageY - starty;\n    if (Math.abs(spanx) > 10 || Math.abs(spany) > 10) {\n      // console.log('spanx:', spanx, ', spany:', spany);\n      calTouchDirection(spanx, spany, evt, move);\n      startx = pageX;\n      starty = pageY;\n    }\n    evt.preventDefault();\n  });\n  bind(target, 'touchend', (evt) => {\n    if (!end) return;\n    const { pageX, pageY } = evt.changedTouches[0];\n    const spanx = pageX - startx;\n    const spany = pageY - starty;\n    calTouchDirection(spanx, spany, evt, end);\n  });\n}\n\n// eventemiter\nexport function createEventEmitter() {\n  const listeners = new Map();\n\n  function on(eventName, callback) {\n    const push = () => {\n      const currentListener = listeners.get(eventName);\n      return (Array.isArray(currentListener)\n          && currentListener.push(callback))\n          || false;\n    };\n\n    const create = () => listeners.set(eventName, [].concat(callback));\n\n    return (listeners.has(eventName)\n        && push())\n        || create();\n  }\n\n  function fire(eventName, args) {\n    const exec = () => {\n      const currentListener = listeners.get(eventName);\n      for (const callback of currentListener) callback.call(null, ...args);\n    };\n\n    return listeners.has(eventName)\n        && exec();\n  }\n\n  function removeListener(eventName, callback) {\n    const remove = () => {\n      const currentListener = listeners.get(eventName);\n      const idx = currentListener.indexOf(callback);\n      return (idx >= 0)\n          && currentListener.splice(idx, 1)\n          && listeners.get(eventName).length === 0\n          && listeners.delete(eventName);\n    };\n\n    return listeners.has(eventName)\n        && remove();\n  }\n\n  function once(eventName, callback) {\n    const execCalllback = (...args) => {\n      callback.call(null, ...args);\n      removeListener(eventName, execCalllback);\n    };\n\n    return on(eventName, execCalllback);\n  }\n\n  function removeAllListeners() {\n    listeners.clear();\n  }\n\n  return {\n    get current() {\n      return listeners;\n    },\n    on,\n    once,\n    fire,\n    removeListener,\n    removeAllListeners,\n  };\n}\n"
  },
  {
    "path": "src/component/form_field.js",
    "content": "import { h } from './element';\nimport { cssPrefix } from '../config';\nimport { t } from '../locale/locale';\n\nconst patterns = {\n  number: /(^\\d+$)|(^\\d+(\\.\\d{0,4})?$)/,\n  date: /^\\d{4}-\\d{1,2}-\\d{1,2}$/,\n};\n\n// rule: { required: false, type, pattern: // }\nexport default class FormField {\n  constructor(input, rule, label, labelWidth) {\n    this.label = '';\n    this.rule = rule;\n    if (label) {\n      this.label = h('label', 'label').css('width', `${labelWidth}px`).html(label);\n    }\n    this.tip = h('div', 'tip').child('tip').hide();\n    this.input = input;\n    this.input.vchange = () => this.validate();\n    this.el = h('div', `${cssPrefix}-form-field`)\n      .children(this.label, input.el, this.tip);\n  }\n\n  isShow() {\n    return this.el.css('display') !== 'none';\n  }\n\n  show() {\n    this.el.show();\n  }\n\n  hide() {\n    this.el.hide();\n    return this;\n  }\n\n  val(v) {\n    return this.input.val(v);\n  }\n\n  hint(hint) {\n    this.input.hint(hint);\n  }\n\n  validate() {\n    const {\n      input, rule, tip, el,\n    } = this;\n    const v = input.val();\n    if (rule.required) {\n      if (/^\\s*$/.test(v)) {\n        tip.html(t('validation.required'));\n        el.addClass('error');\n        return false;\n      }\n    }\n    if (rule.type || rule.pattern) {\n      const pattern = rule.pattern || patterns[rule.type];\n      if (!pattern.test(v)) {\n        tip.html(t('validation.notMatch'));\n        el.addClass('error');\n        return false;\n      }\n    }\n    el.removeClass('error');\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/component/form_input.js",
    "content": "import { h } from './element';\nimport { cssPrefix } from '../config';\n\nexport default class FormInput {\n  constructor(width, hint) {\n    this.vchange = () => {};\n    this.el = h('div', `${cssPrefix}-form-input`);\n    this.input = h('input', '').css('width', width)\n      .on('input', evt => this.vchange(evt))\n      .attr('placeholder', hint);\n    this.el.child(this.input);\n  }\n\n  focus() {\n    setTimeout(() => {\n      this.input.el.focus();\n    }, 10);\n  }\n\n  hint(v) {\n    this.input.attr('placeholder', v);\n  }\n\n  val(v) {\n    return this.input.val(v);\n  }\n}\n"
  },
  {
    "path": "src/component/form_select.js",
    "content": "import { h } from './element';\nimport Suggest from './suggest';\nimport { cssPrefix } from '../config';\n\nexport default class FormSelect {\n  constructor(key, items, width, getTitle = it => it, change = () => {}) {\n    this.key = key;\n    this.getTitle = getTitle;\n    this.vchange = () => {};\n    this.el = h('div', `${cssPrefix}-form-select`);\n    this.suggest = new Suggest(items.map(it => ({ key: it, title: this.getTitle(it) })), (it) => {\n      this.itemClick(it.key);\n      change(it.key);\n      this.vchange(it.key);\n    }, width, this.el);\n    this.el.children(\n      this.itemEl = h('div', 'input-text').html(this.getTitle(key)),\n      this.suggest.el,\n    ).on('click', () => this.show());\n  }\n\n  show() {\n    this.suggest.search('');\n  }\n\n  itemClick(it) {\n    this.key = it;\n    this.itemEl.html(this.getTitle(it));\n  }\n\n  val(v) {\n    if (v !== undefined) {\n      this.key = v;\n      this.itemEl.html(this.getTitle(v));\n      return this;\n    }\n    return this.key;\n  }\n}\n"
  },
  {
    "path": "src/component/icon.js",
    "content": "import { Element, h } from './element';\nimport { cssPrefix } from '../config';\n\nexport default class Icon extends Element {\n  constructor(name) {\n    super('div', `${cssPrefix}-icon`);\n    this.iconNameEl = h('div', `${cssPrefix}-icon-img ${name}`);\n    this.child(this.iconNameEl);\n  }\n\n  setName(name) {\n    this.iconNameEl.className(`${cssPrefix}-icon-img ${name}`);\n  }\n}\n"
  },
  {
    "path": "src/component/message.js",
    "content": "/* global document */\nimport { h } from './element';\nimport Icon from './icon';\nimport { cssPrefix } from '../config';\n\nexport function xtoast(title, content) {\n  const el = h('div', `${cssPrefix}-toast`);\n  const dimmer = h('div', `${cssPrefix}-dimmer active`);\n  const remove = () => {\n    document.body.removeChild(el.el);\n    document.body.removeChild(dimmer.el);\n  };\n\n  el.children(\n    h('div', `${cssPrefix}-toast-header`).children(\n      new Icon('close').on('click.stop', () => remove()),\n      title,\n    ),\n    h('div', `${cssPrefix}-toast-content`).html(content),\n  );\n  document.body.appendChild(el.el);\n  document.body.appendChild(dimmer.el);\n  // set offset\n  const { width, height } = el.box();\n  const { clientHeight, clientWidth } = document.documentElement;\n  el.offset({\n    left: (clientWidth - width) / 2,\n    top: (clientHeight - height) / 3,\n  });\n}\n\nexport default {};\n"
  },
  {
    "path": "src/component/modal.js",
    "content": "/* global document */\n/* global window */\nimport { h } from './element';\nimport Icon from './icon';\nimport { cssPrefix } from '../config';\nimport { bind, unbind } from './event';\n\nexport default class Modal {\n  constructor(title, content, width = '600px') {\n    this.title = title;\n    this.el = h('div', `${cssPrefix}-modal`).css('width', width).children(\n      h('div', `${cssPrefix}-modal-header`).children(\n        new Icon('close').on('click.stop', () => this.hide()),\n        this.title,\n      ),\n      h('div', `${cssPrefix}-modal-content`).children(...content),\n    ).hide();\n  }\n\n  show() {\n    // dimmer\n    this.dimmer = h('div', `${cssPrefix}-dimmer active`);\n    document.body.appendChild(this.dimmer.el);\n    const { width, height } = this.el.show().box();\n    const { clientHeight, clientWidth } = document.documentElement;\n    this.el.offset({\n      left: (clientWidth - width) / 2,\n      top: (clientHeight - height) / 3,\n    });\n    window.xkeydownEsc = (evt) => {\n      if (evt.keyCode === 27) {\n        this.hide();\n      }\n    };\n    bind(window, 'keydown', window.xkeydownEsc);\n  }\n\n  hide() {\n    this.el.hide();\n    document.body.removeChild(this.dimmer.el);\n    unbind(window, 'keydown', window.xkeydownEsc);\n    delete window.xkeydownEsc;\n  }\n}\n"
  },
  {
    "path": "src/component/modal_validation.js",
    "content": "import Modal from './modal';\nimport FormInput from './form_input';\nimport FormSelect from './form_select';\nimport FormField from './form_field';\nimport Button from './button';\nimport { t } from '../locale/locale';\nimport { h } from './element';\nimport { cssPrefix } from '../config';\n\nconst fieldLabelWidth = 100;\n\nexport default class ModalValidation extends Modal {\n  constructor() {\n    const mf = new FormField(\n      new FormSelect('cell',\n        ['cell'], // cell|row|column\n        '100%',\n        it => t(`dataValidation.modeType.${it}`)),\n      { required: true },\n      `${t('dataValidation.range')}:`,\n      fieldLabelWidth,\n    );\n    const rf = new FormField(\n      new FormInput('120px', 'E3 or E3:F12'),\n      { required: true, pattern: /^([A-Z]{1,2}[1-9]\\d*)(:[A-Z]{1,2}[1-9]\\d*)?$/ },\n    );\n    const cf = new FormField(\n      new FormSelect('list',\n        ['list', 'number', 'date', 'phone', 'email'],\n        '100%',\n        it => t(`dataValidation.type.${it}`),\n        it => this.criteriaSelected(it)),\n      { required: true },\n      `${t('dataValidation.criteria')}:`,\n      fieldLabelWidth,\n    );\n\n    // operator\n    const of = new FormField(\n      new FormSelect('be',\n        ['be', 'nbe', 'eq', 'neq', 'lt', 'lte', 'gt', 'gte'],\n        '160px',\n        it => t(`dataValidation.operator.${it}`),\n        it => this.criteriaOperatorSelected(it)),\n      { required: true },\n    ).hide();\n    // min, max\n    const minvf = new FormField(\n      new FormInput('70px', '10'),\n      { required: true },\n    ).hide();\n    const maxvf = new FormField(\n      new FormInput('70px', '100'),\n      { required: true, type: 'number' },\n    ).hide();\n    // value\n    const svf = new FormField(\n      new FormInput('120px', 'a,b,c'),\n      { required: true },\n    );\n    const vf = new FormField(\n      new FormInput('70px', '10'),\n      { required: true, type: 'number' },\n    ).hide();\n\n    super(t('contextmenu.validation'), [\n      h('div', `${cssPrefix}-form-fields`).children(\n        mf.el,\n        rf.el,\n      ),\n      h('div', `${cssPrefix}-form-fields`).children(\n        cf.el,\n        of.el,\n        minvf.el,\n        maxvf.el,\n        vf.el,\n        svf.el,\n      ),\n      h('div', `${cssPrefix}-buttons`).children(\n        new Button('cancel').on('click', () => this.btnClick('cancel')),\n        new Button('remove').on('click', () => this.btnClick('remove')),\n        new Button('save', 'primary').on('click', () => this.btnClick('save')),\n      ),\n    ]);\n    this.mf = mf;\n    this.rf = rf;\n    this.cf = cf;\n    this.of = of;\n    this.minvf = minvf;\n    this.maxvf = maxvf;\n    this.vf = vf;\n    this.svf = svf;\n    this.change = () => {};\n  }\n\n  showVf(it) {\n    const hint = it === 'date' ? '2018-11-12' : '10';\n    const { vf } = this;\n    vf.input.hint(hint);\n    vf.show();\n  }\n\n  criteriaSelected(it) {\n    const {\n      of, minvf, maxvf, vf, svf,\n    } = this;\n    if (it === 'date' || it === 'number') {\n      of.show();\n      minvf.rule.type = it;\n      maxvf.rule.type = it;\n      if (it === 'date') {\n        minvf.hint('2018-11-12');\n        maxvf.hint('2019-11-12');\n      } else {\n        minvf.hint('10');\n        maxvf.hint('100');\n      }\n      minvf.show();\n      maxvf.show();\n      vf.hide();\n      svf.hide();\n    } else {\n      if (it === 'list') {\n        svf.show();\n      } else {\n        svf.hide();\n      }\n      vf.hide();\n      of.hide();\n      minvf.hide();\n      maxvf.hide();\n    }\n  }\n\n  criteriaOperatorSelected(it) {\n    if (!it) return;\n    const {\n      minvf, maxvf, vf,\n    } = this;\n    if (it === 'be' || it === 'nbe') {\n      minvf.show();\n      maxvf.show();\n      vf.hide();\n    } else {\n      const type = this.cf.val();\n      vf.rule.type = type;\n      if (type === 'date') {\n        vf.hint('2018-11-12');\n      } else {\n        vf.hint('10');\n      }\n      vf.show();\n      minvf.hide();\n      maxvf.hide();\n    }\n  }\n\n  btnClick(action) {\n    if (action === 'cancel') {\n      this.hide();\n    } else if (action === 'remove') {\n      this.change('remove');\n      this.hide();\n    } else if (action === 'save') {\n      // validate\n      const attrs = ['mf', 'rf', 'cf', 'of', 'svf', 'vf', 'minvf', 'maxvf'];\n      for (let i = 0; i < attrs.length; i += 1) {\n        const field = this[attrs[i]];\n        // console.log('field:', field);\n        if (field.isShow()) {\n          // console.log('it:', it);\n          if (!field.validate()) return;\n        }\n      }\n\n      const mode = this.mf.val();\n      const ref = this.rf.val();\n      const type = this.cf.val();\n      const operator = this.of.val();\n      let value = this.svf.val();\n      if (type === 'number' || type === 'date') {\n        if (operator === 'be' || operator === 'nbe') {\n          value = [this.minvf.val(), this.maxvf.val()];\n        } else {\n          value = this.vf.val();\n        }\n      }\n      // console.log(mode, ref, type, operator, value);\n      this.change('save',\n        mode,\n        ref,\n        {\n          type, operator, required: false, value,\n        });\n      this.hide();\n    }\n  }\n\n  // validation: { mode, ref, validator }\n  setValue(v) {\n    if (v) {\n      const {\n        mf, rf, cf, of, svf, vf, minvf, maxvf,\n      } = this;\n      const {\n        mode, ref, validator,\n      } = v;\n      const {\n        type, operator, value,\n      } = validator || { type: 'list' };\n      mf.val(mode || 'cell');\n      rf.val(ref);\n      cf.val(type);\n      of.val(operator);\n      if (Array.isArray(value)) {\n        minvf.val(value[0]);\n        maxvf.val(value[1]);\n      } else {\n        svf.val(value || '');\n        vf.val(value || '');\n      }\n      this.criteriaSelected(type);\n      this.criteriaOperatorSelected(operator);\n    }\n    this.show();\n  }\n}\n"
  },
  {
    "path": "src/component/print.js",
    "content": "/* global window document */\nimport { h } from './element';\nimport { cssPrefix } from '../config';\nimport Button from './button';\nimport { Draw } from '../canvas/draw';\nimport { renderCell } from './table';\nimport { t } from '../locale/locale';\n\n// resolution: 72 => 595 x 842\n// 150 => 1240 x 1754\n// 200 => 1654 x 2339\n// 300 => 2479 x 3508\n// 96 * cm / 2.54 , 96 * cm / 2.54\n\nconst PAGER_SIZES = [\n  ['A3', 11.69, 16.54],\n  ['A4', 8.27, 11.69],\n  ['A5', 5.83, 8.27],\n  ['B4', 9.84, 13.90],\n  ['B5', 6.93, 9.84],\n];\n\nconst PAGER_ORIENTATIONS = ['landscape', 'portrait'];\n\nfunction inches2px(inc) {\n  return parseInt(96 * inc, 10);\n}\n\nfunction btnClick(type) {\n  if (type === 'cancel') {\n    this.el.hide();\n  } else {\n    this.toPrint();\n  }\n}\n\nfunction pagerSizeChange(evt) {\n  const { paper } = this;\n  const { value } = evt.target;\n  const ps = PAGER_SIZES[value];\n  paper.w = inches2px(ps[1]);\n  paper.h = inches2px(ps[2]);\n  // console.log('paper:', ps, paper);\n  this.preview();\n}\nfunction pagerOrientationChange(evt) {\n  const { paper } = this;\n  const { value } = evt.target;\n  const v = PAGER_ORIENTATIONS[value];\n  paper.orientation = v;\n  this.preview();\n}\n\nexport default class Print {\n  constructor(data) {\n    this.paper = {\n      w: inches2px(PAGER_SIZES[0][1]),\n      h: inches2px(PAGER_SIZES[0][2]),\n      padding: 50,\n      orientation: PAGER_ORIENTATIONS[0],\n      get width() {\n        return this.orientation === 'landscape' ? this.h : this.w;\n      },\n      get height() {\n        return this.orientation === 'landscape' ? this.w : this.h;\n      },\n    };\n    this.data = data;\n    this.el = h('div', `${cssPrefix}-print`)\n      .children(\n        h('div', `${cssPrefix}-print-bar`)\n          .children(\n            h('div', '-title').child('Print settings'),\n            h('div', '-right').children(\n              h('div', `${cssPrefix}-buttons`).children(\n                new Button('cancel').on('click', btnClick.bind(this, 'cancel')),\n                new Button('next', 'primary').on('click', btnClick.bind(this, 'next')),\n              ),\n            ),\n          ),\n        h('div', `${cssPrefix}-print-content`)\n          .children(\n            this.contentEl = h('div', '-content'),\n            h('div', '-sider').child(\n              h('form', '').children(\n                h('fieldset', '').children(\n                  h('label', '').child(`${t('print.size')}`),\n                  h('select', '').children(\n                    ...PAGER_SIZES.map((it, index) => h('option', '').attr('value', index).child(`${it[0]} ( ${it[1]}''x${it[2]}'' )`)),\n                  ).on('change', pagerSizeChange.bind(this)),\n                ),\n                h('fieldset', '').children(\n                  h('label', '').child(`${t('print.orientation')}`),\n                  h('select', '').children(\n                    ...PAGER_ORIENTATIONS.map((it, index) => h('option', '').attr('value', index).child(`${t('print.orientations')[index]}`)),\n                  ).on('change', pagerOrientationChange.bind(this)),\n                ),\n              ),\n            ),\n          ),\n      ).hide();\n  }\n\n  resetData(data) {\n    this.data = data;\n  }\n\n  preview() {\n    const { data, paper } = this;\n    const { width, height, padding } = paper;\n    const iwidth = width - padding * 2;\n    const iheight = height - padding * 2;\n    const cr = data.contentRange();\n    const pages = parseInt(cr.h / iheight, 10) + 1;\n    const scale = iwidth / cr.w;\n    let left = padding;\n    const top = padding;\n    if (scale > 1) {\n      left += (iwidth - cr.w) / 2;\n    }\n    let ri = 0;\n    let yoffset = 0;\n    this.contentEl.html('');\n    this.canvases = [];\n    const mViewRange = {\n      sri: 0,\n      sci: 0,\n      eri: 0,\n      eci: 0,\n    };\n    for (let i = 0; i < pages; i += 1) {\n      let th = 0;\n      let yo = 0;\n      const wrap = h('div', `${cssPrefix}-canvas-card`);\n      const canvas = h('canvas', `${cssPrefix}-canvas`);\n      this.canvases.push(canvas.el);\n      const draw = new Draw(canvas.el, width, height);\n      // cell-content\n      draw.save();\n      draw.translate(left, top);\n      if (scale < 1) draw.scale(scale, scale);\n      // console.log('ri:', ri, cr.eri, yoffset);\n      for (; ri <= cr.eri; ri += 1) {\n        const rh = data.rows.getHeight(ri);\n        th += rh;\n        if (th < iheight) {\n          for (let ci = 0; ci <= cr.eci; ci += 1) {\n            renderCell(draw, data, ri, ci, yoffset);\n            mViewRange.eci = ci;\n          }\n        } else {\n          yo = -(th - rh);\n          break;\n        }\n      }\n      mViewRange.eri = ri;\n      draw.restore();\n      // merge-cell\n      draw.save();\n      draw.translate(left, top);\n      if (scale < 1) draw.scale(scale, scale);\n      const yof = yoffset;\n      data.eachMergesInView(mViewRange, ({ sri, sci }) => {\n        renderCell(draw, data, sri, sci, yof);\n      });\n      draw.restore();\n\n      mViewRange.sri = mViewRange.eri;\n      mViewRange.sci = mViewRange.eci;\n      yoffset += yo;\n      this.contentEl.child(h('div', `${cssPrefix}-canvas-card-wraper`).child(wrap.child(canvas)));\n    }\n    this.el.show();\n  }\n\n  toPrint() {\n    this.el.hide();\n    const { paper } = this;\n    const iframe = h('iframe', '').hide();\n    const { el } = iframe;\n    window.document.body.appendChild(el);\n    const { contentWindow } = el;\n    const idoc = contentWindow.document;\n    const style = document.createElement('style');\n    style.innerHTML = `\n      @page { size: ${paper.width}px ${paper.height}px; };\n      canvas {\n        page-break-before: auto;        \n        page-break-after: always;\n        image-rendering: pixelated;\n      };\n    `;\n    idoc.head.appendChild(style);\n    this.canvases.forEach((it) => {\n      const cn = it.cloneNode(false);\n      const ctx = cn.getContext('2d');\n      // ctx.imageSmoothingEnabled = true;\n      ctx.drawImage(it, 0, 0);\n      idoc.body.appendChild(cn);\n    });\n    contentWindow.print();\n  }\n}\n"
  },
  {
    "path": "src/component/resizer.js",
    "content": "/* global window */\nimport { h } from './element';\nimport { mouseMoveUp } from './event';\nimport { cssPrefix } from '../config';\n\nexport default class Resizer {\n  constructor(vertical = false, minDistance) {\n    this.moving = false;\n    this.vertical = vertical;\n    this.el = h('div', `${cssPrefix}-resizer ${vertical ? 'vertical' : 'horizontal'}`).children(\n      this.unhideHoverEl = h('div', `${cssPrefix}-resizer-hover`)\n        .on('dblclick.stop', evt => this.mousedblclickHandler(evt))\n        .css('position', 'absolute').hide(),\n      this.hoverEl = h('div', `${cssPrefix}-resizer-hover`)\n        .on('mousedown.stop', evt => this.mousedownHandler(evt)),\n      this.lineEl = h('div', `${cssPrefix}-resizer-line`).hide(),\n    ).hide();\n    // cell rect\n    this.cRect = null;\n    this.finishedFn = null;\n    this.minDistance = minDistance;\n    this.unhideFn = () => {};\n  }\n\n  showUnhide(index) {\n    this.unhideIndex = index;\n    this.unhideHoverEl.show();\n  }\n\n  hideUnhide() {\n    this.unhideHoverEl.hide();\n  }\n\n  // rect : {top, left, width, height}\n  // line : {width, height}\n  show(rect, line) {\n    const {\n      moving, vertical, hoverEl, lineEl, el,\n      unhideHoverEl,\n    } = this;\n    if (moving) return;\n    this.cRect = rect;\n    const {\n      left, top, width, height,\n    } = rect;\n    el.offset({\n      left: vertical ? left + width - 5 : left,\n      top: vertical ? top : top + height - 5,\n    }).show();\n    hoverEl.offset({\n      width: vertical ? 5 : width,\n      height: vertical ? height : 5,\n    });\n    lineEl.offset({\n      width: vertical ? 0 : line.width,\n      height: vertical ? line.height : 0,\n    });\n    unhideHoverEl.offset({\n      left: vertical ? 5 - width : left,\n      top: vertical ? top : 5 - height,\n      width: vertical ? 5 : width,\n      height: vertical ? height : 5,\n    });\n  }\n\n  hide() {\n    this.el.offset({\n      left: 0,\n      top: 0,\n    }).hide();\n    this.hideUnhide();\n  }\n\n  mousedblclickHandler() {\n    if (this.unhideIndex) this.unhideFn(this.unhideIndex);\n  }\n\n  mousedownHandler(evt) {\n    let startEvt = evt;\n    const {\n      el, lineEl, cRect, vertical, minDistance,\n    } = this;\n    let distance = vertical ? cRect.width : cRect.height;\n    // console.log('distance:', distance);\n    lineEl.show();\n    mouseMoveUp(window, (e) => {\n      this.moving = true;\n      if (startEvt !== null && e.buttons === 1) {\n        // console.log('top:', top, ', left:', top, ', cRect:', cRect);\n        if (vertical) {\n          distance += e.movementX;\n          if (distance > minDistance) {\n            el.css('left', `${cRect.left + distance}px`);\n          }\n        } else {\n          distance += e.movementY;\n          if (distance > minDistance) {\n            el.css('top', `${cRect.top + distance}px`);\n          }\n        }\n        startEvt = e;\n      }\n    }, () => {\n      startEvt = null;\n      lineEl.hide();\n      this.moving = false;\n      this.hide();\n      if (this.finishedFn) {\n        if (distance < minDistance) distance = minDistance;\n        this.finishedFn(cRect, distance);\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "src/component/scrollbar.js",
    "content": "import { h } from './element';\nimport { cssPrefix } from '../config';\n\nexport default class Scrollbar {\n  constructor(vertical) {\n    this.vertical = vertical;\n    this.moveFn = null;\n    this.el = h('div', `${cssPrefix}-scrollbar ${vertical ? 'vertical' : 'horizontal'}`)\n      .child(this.contentEl = h('div', ''))\n      .on('mousemove.stop', () => {})\n      .on('scroll.stop', (evt) => {\n        const { scrollTop, scrollLeft } = evt.target;\n        // console.log('scrollTop:', scrollTop);\n        if (this.moveFn) {\n          this.moveFn(this.vertical ? scrollTop : scrollLeft, evt);\n        }\n        // console.log('evt:::', evt);\n      });\n  }\n\n  move(v) {\n    this.el.scroll(v);\n    return this;\n  }\n\n  scroll() {\n    return this.el.scroll();\n  }\n\n  set(distance, contentDistance) {\n    const d = distance - 1;\n    // console.log('distance:', distance, ', contentDistance:', contentDistance);\n    if (contentDistance > d) {\n      const cssKey = this.vertical ? 'height' : 'width';\n      // console.log('d:', d);\n      this.el.css(cssKey, `${d - 15}px`).show();\n      this.contentEl\n        .css(this.vertical ? 'width' : 'height', '1px')\n        .css(cssKey, `${contentDistance}px`);\n    } else {\n      this.el.hide();\n    }\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/component/selector.js",
    "content": "import { h } from './element';\nimport { cssPrefix } from '../config';\nimport { CellRange } from '../core/cell_range';\n\nconst selectorHeightBorderWidth = 2 * 2 - 1;\nlet startZIndex = 10;\n\nclass SelectorElement {\n  constructor(useHideInput = false, autoFocus = true) {\n    this.useHideInput = useHideInput;\n    this.autoFocus = autoFocus;\n    this.inputChange = () => {};\n    this.cornerEl = h('div', `${cssPrefix}-selector-corner`);\n    this.areaEl = h('div', `${cssPrefix}-selector-area`)\n      .child(this.cornerEl).hide();\n    this.clipboardEl = h('div', `${cssPrefix}-selector-clipboard`).hide();\n    this.autofillEl = h('div', `${cssPrefix}-selector-autofill`).hide();\n    this.el = h('div', `${cssPrefix}-selector`)\n      .css('z-index', `${startZIndex}`)\n      .children(this.areaEl, this.clipboardEl, this.autofillEl)\n      .hide();\n    if (useHideInput) {\n      this.hideInput = h('input', '')\n        .on('compositionend', (evt) => {\n          this.inputChange(evt.target.value);\n        });\n      this.el.child(this.hideInputDiv = h('div', 'hide-input').child(this.hideInput));\n      this.el.child(this.hideInputDiv = h('div', 'hide-input').child(this.hideInput));\n    }\n    startZIndex += 1;\n  }\n\n  setOffset(v) {\n    this.el.offset(v).show();\n    return this;\n  }\n\n  hide() {\n    this.el.hide();\n    return this;\n  }\n\n  setAreaOffset(v) {\n    const {\n      left, top, width, height,\n    } = v;\n    const of = {\n      width: width - selectorHeightBorderWidth + 0.8,\n      height: height - selectorHeightBorderWidth + 0.8,\n      left: left - 0.8,\n      top: top - 0.8,\n    };\n    this.areaEl.offset(of).show();\n    if (this.useHideInput) {\n      this.hideInputDiv.offset(of);\n      if (this.autoFocus) {\n        this.hideInput.val('').focus();\n      } else {\n        this.hideInput.val('');\n      }\n    }\n  }\n\n  setClipboardOffset(v) {\n    const {\n      left, top, width, height,\n    } = v;\n    this.clipboardEl.offset({\n      left,\n      top,\n      width: width - 5,\n      height: height - 5,\n    });\n  }\n\n  showAutofill(v) {\n    const {\n      left, top, width, height,\n    } = v;\n    this.autofillEl.offset({\n      width: width - selectorHeightBorderWidth,\n      height: height - selectorHeightBorderWidth,\n      left,\n      top,\n    }).show();\n  }\n\n  hideAutofill() {\n    this.autofillEl.hide();\n  }\n\n  showClipboard() {\n    this.clipboardEl.show();\n  }\n\n  hideClipboard() {\n    this.clipboardEl.hide();\n  }\n}\n\nfunction calBRAreaOffset(offset) {\n  const { data } = this;\n  const {\n    left, top, width, height, scroll, l, t,\n  } = offset;\n  const ftwidth = data.freezeTotalWidth();\n  const ftheight = data.freezeTotalHeight();\n  let left0 = left - ftwidth;\n  if (ftwidth > l) left0 -= scroll.x;\n  let top0 = top - ftheight;\n  if (ftheight > t) top0 -= scroll.y;\n  return {\n    left: left0,\n    top: top0,\n    width,\n    height,\n  };\n}\n\nfunction calTAreaOffset(offset) {\n  const { data } = this;\n  const {\n    left, width, height, l, t, scroll,\n  } = offset;\n  const ftwidth = data.freezeTotalWidth();\n  let left0 = left - ftwidth;\n  if (ftwidth > l) left0 -= scroll.x;\n  return {\n    left: left0, top: t, width, height,\n  };\n}\n\nfunction calLAreaOffset(offset) {\n  const { data } = this;\n  const {\n    top, width, height, l, t, scroll,\n  } = offset;\n  const ftheight = data.freezeTotalHeight();\n  let top0 = top - ftheight;\n  // console.log('ftheight:', ftheight, ', t:', t);\n  if (ftheight > t) top0 -= scroll.y;\n  return {\n    left: l, top: top0, width, height,\n  };\n}\n\nfunction setBRAreaOffset(offset) {\n  const { br } = this;\n  br.setAreaOffset(calBRAreaOffset.call(this, offset));\n}\n\nfunction setTLAreaOffset(offset) {\n  const { tl } = this;\n  tl.setAreaOffset(offset);\n}\n\nfunction setTAreaOffset(offset) {\n  const { t } = this;\n  t.setAreaOffset(calTAreaOffset.call(this, offset));\n}\n\nfunction setLAreaOffset(offset) {\n  const { l } = this;\n  l.setAreaOffset(calLAreaOffset.call(this, offset));\n}\n\nfunction setLClipboardOffset(offset) {\n  const { l } = this;\n  l.setClipboardOffset(calLAreaOffset.call(this, offset));\n}\n\nfunction setBRClipboardOffset(offset) {\n  const { br } = this;\n  br.setClipboardOffset(calBRAreaOffset.call(this, offset));\n}\n\nfunction setTLClipboardOffset(offset) {\n  const { tl } = this;\n  tl.setClipboardOffset(offset);\n}\n\nfunction setTClipboardOffset(offset) {\n  const { t } = this;\n  t.setClipboardOffset(calTAreaOffset.call(this, offset));\n}\n\nfunction setAllAreaOffset(offset) {\n  setBRAreaOffset.call(this, offset);\n  setTLAreaOffset.call(this, offset);\n  setTAreaOffset.call(this, offset);\n  setLAreaOffset.call(this, offset);\n}\n\nfunction setAllClipboardOffset(offset) {\n  setBRClipboardOffset.call(this, offset);\n  setTLClipboardOffset.call(this, offset);\n  setTClipboardOffset.call(this, offset);\n  setLClipboardOffset.call(this, offset);\n}\n\nexport default class Selector {\n  constructor(data) {\n    const { autoFocus } = data.settings;\n    this.inputChange = () => {};\n    this.data = data;\n    this.br = new SelectorElement(true, autoFocus);\n    this.t = new SelectorElement();\n    this.l = new SelectorElement();\n    this.tl = new SelectorElement();\n    this.br.inputChange = (v) => {\n      this.inputChange(v);\n    };\n    this.br.el.show();\n    this.offset = null;\n    this.areaOffset = null;\n    this.indexes = null;\n    this.range = null;\n    this.arange = null;\n    this.el = h('div', `${cssPrefix}-selectors`)\n      .children(\n        this.tl.el,\n        this.t.el,\n        this.l.el,\n        this.br.el,\n      ).hide();\n\n    // for performance\n    this.lastri = -1;\n    this.lastci = -1;\n\n    startZIndex += 1;\n  }\n\n  resetData(data) {\n    this.data = data;\n    this.range = data.selector.range;\n    this.resetAreaOffset();\n  }\n\n  hide() {\n    this.el.hide();\n  }\n\n  resetOffset() {\n    const {\n      data, tl, t, l, br,\n    } = this;\n    const freezeHeight = data.freezeTotalHeight();\n    const freezeWidth = data.freezeTotalWidth();\n    if (freezeHeight > 0 || freezeWidth > 0) {\n      tl.setOffset({ width: freezeWidth, height: freezeHeight });\n      t.setOffset({ left: freezeWidth, height: freezeHeight });\n      l.setOffset({ top: freezeHeight, width: freezeWidth });\n      br.setOffset({ left: freezeWidth, top: freezeHeight });\n    } else {\n      tl.hide();\n      t.hide();\n      l.hide();\n      br.setOffset({ left: 0, top: 0 });\n    }\n  }\n\n  resetAreaOffset() {\n    // console.log('offset:', offset);\n    const offset = this.data.getSelectedRect();\n    const coffset = this.data.getClipboardRect();\n    setAllAreaOffset.call(this, offset);\n    setAllClipboardOffset.call(this, coffset);\n    this.resetOffset();\n  }\n\n  resetBRTAreaOffset() {\n    const offset = this.data.getSelectedRect();\n    const coffset = this.data.getClipboardRect();\n    setBRAreaOffset.call(this, offset);\n    setTAreaOffset.call(this, offset);\n    setBRClipboardOffset.call(this, coffset);\n    setTClipboardOffset.call(this, coffset);\n    this.resetOffset();\n  }\n\n  resetBRLAreaOffset() {\n    const offset = this.data.getSelectedRect();\n    const coffset = this.data.getClipboardRect();\n    setBRAreaOffset.call(this, offset);\n    setLAreaOffset.call(this, offset);\n    setBRClipboardOffset.call(this, coffset);\n    setLClipboardOffset.call(this, coffset);\n    this.resetOffset();\n  }\n\n  set(ri, ci, indexesUpdated = true) {\n    const { data } = this;\n    const cellRange = data.calSelectedRangeByStart(ri, ci);\n    const { sri, sci } = cellRange;\n    if (indexesUpdated) {\n      let [cri, cci] = [ri, ci];\n      if (ri < 0) cri = 0;\n      if (ci < 0) cci = 0;\n      data.selector.setIndexes(cri, cci);\n      this.indexes = [cri, cci];\n    }\n\n    this.moveIndexes = [sri, sci];\n    // this.sIndexes = sIndexes;\n    // this.eIndexes = eIndexes;\n    this.range = cellRange;\n    this.resetAreaOffset();\n    this.el.show();\n  }\n\n  setEnd(ri, ci, moving = true) {\n    const { data, lastri, lastci } = this;\n    if (moving) {\n      if (ri === lastri && ci === lastci) return;\n      this.lastri = ri;\n      this.lastci = ci;\n    }\n    this.range = data.calSelectedRangeByEnd(ri, ci);\n    setAllAreaOffset.call(this, this.data.getSelectedRect());\n  }\n\n  reset() {\n    // console.log('::::', this.data);\n    const { eri, eci } = this.data.selector.range;\n    this.setEnd(eri, eci);\n  }\n\n  showAutofill(ri, ci) {\n    if (ri === -1 && ci === -1) return;\n    // console.log('ri:', ri, ', ci:', ci);\n    // const [sri, sci] = this.sIndexes;\n    // const [eri, eci] = this.eIndexes;\n    const {\n      sri, sci, eri, eci,\n    } = this.range;\n    const [nri, nci] = [ri, ci];\n    // const rn = eri - sri;\n    // const cn = eci - sci;\n    const srn = sri - ri;\n    const scn = sci - ci;\n    const ern = eri - ri;\n    const ecn = eci - ci;\n    if (scn > 0) {\n      // left\n      // console.log('left');\n      this.arange = new CellRange(sri, nci, eri, sci - 1);\n      // this.saIndexes = [sri, nci];\n      // this.eaIndexes = [eri, sci - 1];\n      // data.calRangeIndexes2(\n    } else if (srn > 0) {\n      // top\n      // console.log('top');\n      // nri = sri;\n      this.arange = new CellRange(nri, sci, sri - 1, eci);\n      // this.saIndexes = [nri, sci];\n      // this.eaIndexes = [sri - 1, eci];\n    } else if (ecn < 0) {\n      // right\n      // console.log('right');\n      // nci = eci;\n      this.arange = new CellRange(sri, eci + 1, eri, nci);\n      // this.saIndexes = [sri, eci + 1];\n      // this.eaIndexes = [eri, nci];\n    } else if (ern < 0) {\n      // bottom\n      // console.log('bottom');\n      // nri = eri;\n      this.arange = new CellRange(eri + 1, sci, nri, eci);\n      // this.saIndexes = [eri + 1, sci];\n      // this.eaIndexes = [nri, eci];\n    } else {\n      // console.log('else:');\n      this.arange = null;\n      // this.saIndexes = null;\n      // this.eaIndexes = null;\n      return;\n    }\n    if (this.arange !== null) {\n      // console.log(this.saIndexes, ':', this.eaIndexes);\n      const offset = this.data.getRect(this.arange);\n      offset.width += 2;\n      offset.height += 2;\n      const {\n        br, l, t, tl,\n      } = this;\n      br.showAutofill(calBRAreaOffset.call(this, offset));\n      l.showAutofill(calLAreaOffset.call(this, offset));\n      t.showAutofill(calTAreaOffset.call(this, offset));\n      tl.showAutofill(offset);\n    }\n  }\n\n  hideAutofill() {\n    ['br', 'l', 't', 'tl'].forEach((property) => {\n      this[property].hideAutofill();\n    });\n  }\n\n  showClipboard() {\n    const coffset = this.data.getClipboardRect();\n    setAllClipboardOffset.call(this, coffset);\n    ['br', 'l', 't', 'tl'].forEach((property) => {\n      this[property].showClipboard();\n    });\n  }\n\n  hideClipboard() {\n    ['br', 'l', 't', 'tl'].forEach((property) => {\n      this[property].hideClipboard();\n    });\n  }\n}\n"
  },
  {
    "path": "src/component/sheet.js",
    "content": "/* global window */\nimport { h } from './element';\nimport {\n  bind,\n  mouseMoveUp,\n  bindTouch,\n  createEventEmitter,\n} from './event';\nimport Resizer from './resizer';\nimport Scrollbar from './scrollbar';\nimport Selector from './selector';\nimport Editor from './editor';\nimport Print from './print';\nimport ContextMenu from './contextmenu';\nimport Table from './table';\nimport Toolbar from './toolbar/index';\nimport ModalValidation from './modal_validation';\nimport SortFilter from './sort_filter';\nimport { xtoast } from './message';\nimport { cssPrefix } from '../config';\nimport { formulas } from '../core/formula';\n\n/**\n * @desc throttle fn\n * @param func function\n * @param wait Delay in milliseconds\n */\nfunction throttle(func, wait) {\n  let timeout;\n  return (...arg) => {\n    const that = this;\n    const args = arg;\n    if (!timeout) {\n      timeout = setTimeout(() => {\n        timeout = null;\n        func.apply(that, args);\n      }, wait);\n    }\n  };\n}\n\nfunction scrollbarMove() {\n  const {\n    data, verticalScrollbar, horizontalScrollbar,\n  } = this;\n  const {\n    l, t, left, top, width, height,\n  } = data.getSelectedRect();\n  const tableOffset = this.getTableOffset();\n  // console.log(',l:', l, ', left:', left, ', tOffset.left:', tableOffset.width);\n  if (Math.abs(left) + width > tableOffset.width) {\n    horizontalScrollbar.move({ left: l + width - tableOffset.width });\n  } else {\n    const fsw = data.freezeTotalWidth();\n    if (left < fsw) {\n      horizontalScrollbar.move({ left: l - 1 - fsw });\n    }\n  }\n  // console.log('top:', top, ', height:', height, ', tof.height:', tableOffset.height);\n  if (Math.abs(top) + height > tableOffset.height) {\n    verticalScrollbar.move({ top: t + height - tableOffset.height - 1 });\n  } else {\n    const fsh = data.freezeTotalHeight();\n    if (top < fsh) {\n      verticalScrollbar.move({ top: t - 1 - fsh });\n    }\n  }\n}\n\nfunction selectorSet(multiple, ri, ci, indexesUpdated = true, moving = false) {\n  if (ri === -1 && ci === -1) return;\n  const {\n    table, selector, toolbar, data,\n    contextMenu,\n  } = this;\n  const cell = data.getCell(ri, ci);\n  if (multiple) {\n    selector.setEnd(ri, ci, moving);\n    this.trigger('cells-selected', cell, selector.range);\n  } else {\n    // trigger click event\n    selector.set(ri, ci, indexesUpdated);\n    this.trigger('cell-selected', cell, ri, ci);\n  }\n  contextMenu.setMode((ri === -1 || ci === -1) ? 'row-col' : 'range');\n  toolbar.reset();\n  table.render();\n}\n\n// multiple: boolean\n// direction: left | right | up | down | row-first | row-last | col-first | col-last\nfunction selectorMove(multiple, direction) {\n  const {\n    selector, data,\n  } = this;\n  const { rows, cols } = data;\n  let [ri, ci] = selector.indexes;\n  const { eri, eci } = selector.range;\n  if (multiple) {\n    [ri, ci] = selector.moveIndexes;\n  }\n  // console.log('selector.move:', ri, ci);\n  if (direction === 'left') {\n    if (ci > 0) ci -= 1;\n  } else if (direction === 'right') {\n    if (eci !== ci) ci = eci;\n    if (ci < cols.len - 1) ci += 1;\n  } else if (direction === 'up') {\n    if (ri > 0) ri -= 1;\n  } else if (direction === 'down') {\n    if (eri !== ri) ri = eri;\n    if (ri < rows.len - 1) ri += 1;\n  } else if (direction === 'row-first') {\n    ci = 0;\n  } else if (direction === 'row-last') {\n    ci = cols.len - 1;\n  } else if (direction === 'col-first') {\n    ri = 0;\n  } else if (direction === 'col-last') {\n    ri = rows.len - 1;\n  }\n  if (multiple) {\n    selector.moveIndexes = [ri, ci];\n  }\n  selectorSet.call(this, multiple, ri, ci);\n  scrollbarMove.call(this);\n}\n\n// private methods\nfunction overlayerMousemove(evt) {\n  // console.log('x:', evt.offsetX, ', y:', evt.offsetY);\n  if (evt.buttons !== 0) return;\n  if (evt.target.className === `${cssPrefix}-resizer-hover`) return;\n  const { offsetX, offsetY } = evt;\n  const {\n    rowResizer, colResizer, tableEl, data,\n  } = this;\n  const { rows, cols } = data;\n  if (offsetX > cols.indexWidth && offsetY > rows.height) {\n    rowResizer.hide();\n    colResizer.hide();\n    return;\n  }\n  const tRect = tableEl.box();\n  const cRect = data.getCellRectByXY(evt.offsetX, evt.offsetY);\n  if (cRect.ri >= 0 && cRect.ci === -1) {\n    cRect.width = cols.indexWidth;\n    rowResizer.show(cRect, {\n      width: tRect.width,\n    });\n    if (rows.isHide(cRect.ri - 1)) {\n      rowResizer.showUnhide(cRect.ri);\n    } else {\n      rowResizer.hideUnhide();\n    }\n  } else {\n    rowResizer.hide();\n  }\n  if (cRect.ri === -1 && cRect.ci >= 0) {\n    cRect.height = rows.height;\n    colResizer.show(cRect, {\n      height: tRect.height,\n    });\n    if (cols.isHide(cRect.ci - 1)) {\n      colResizer.showUnhide(cRect.ci);\n    } else {\n      colResizer.hideUnhide();\n    }\n  } else {\n    colResizer.hide();\n  }\n}\n\n// let scrollThreshold = 15;\nfunction overlayerMousescroll(evt) {\n  // scrollThreshold -= 1;\n  // if (scrollThreshold > 0) return;\n  // scrollThreshold = 15;\n\n  const { verticalScrollbar, horizontalScrollbar, data } = this;\n  const { top } = verticalScrollbar.scroll();\n  const { left } = horizontalScrollbar.scroll();\n  // console.log('evt:::', evt.wheelDelta, evt.detail * 40);\n\n  const { rows, cols } = data;\n\n  // deltaY for vertical delta\n  const { deltaY, deltaX } = evt;\n  const loopValue = (ii, vFunc) => {\n    let i = ii;\n    let v = 0;\n    do {\n      v = vFunc(i);\n      i += 1;\n    } while (v <= 0);\n    return v;\n  };\n  // console.log('deltaX', deltaX, 'evt.detail', evt.detail);\n  // if (evt.detail) deltaY = evt.detail * 40;\n  const moveY = (vertical) => {\n    if (vertical > 0) {\n      // up\n      const ri = data.scroll.ri + 1;\n      if (ri < rows.len) {\n        const rh = loopValue(ri, i => rows.getHeight(i));\n        verticalScrollbar.move({ top: top + rh - 1 });\n      }\n    } else {\n      // down\n      const ri = data.scroll.ri - 1;\n      if (ri >= 0) {\n        const rh = loopValue(ri, i => rows.getHeight(i));\n        verticalScrollbar.move({ top: ri === 0 ? 0 : top - rh });\n      }\n    }\n  };\n\n  // deltaX for Mac horizontal scroll\n  const moveX = (horizontal) => {\n    if (horizontal > 0) {\n      // left\n      const ci = data.scroll.ci + 1;\n      if (ci < cols.len) {\n        const cw = loopValue(ci, i => cols.getWidth(i));\n        horizontalScrollbar.move({ left: left + cw - 1 });\n      }\n    } else {\n      // right\n      const ci = data.scroll.ci - 1;\n      if (ci >= 0) {\n        const cw = loopValue(ci, i => cols.getWidth(i));\n        horizontalScrollbar.move({ left: ci === 0 ? 0 : left - cw });\n      }\n    }\n  };\n  const tempY = Math.abs(deltaY);\n  const tempX = Math.abs(deltaX);\n  const temp = Math.max(tempY, tempX);\n  // console.log('event:', evt);\n  // detail for windows/mac firefox vertical scroll\n  if (/Firefox/i.test(window.navigator.userAgent)) throttle(moveY(evt.detail), 50);\n  if (temp === tempX) throttle(moveX(deltaX), 50);\n  if (temp === tempY) throttle(moveY(deltaY), 50);\n}\n\nfunction overlayerTouch(direction, distance) {\n  const { verticalScrollbar, horizontalScrollbar } = this;\n  const { top } = verticalScrollbar.scroll();\n  const { left } = horizontalScrollbar.scroll();\n\n  if (direction === 'left' || direction === 'right') {\n    horizontalScrollbar.move({ left: left - distance });\n  } else if (direction === 'up' || direction === 'down') {\n    verticalScrollbar.move({ top: top - distance });\n  }\n}\n\nfunction verticalScrollbarSet() {\n  const { data, verticalScrollbar } = this;\n  const { height } = this.getTableOffset();\n  const erth = data.exceptRowTotalHeight(0, -1);\n  // console.log('erth:', erth);\n  verticalScrollbar.set(height, data.rows.totalHeight() - erth);\n}\n\nfunction horizontalScrollbarSet() {\n  const { data, horizontalScrollbar } = this;\n  const { width } = this.getTableOffset();\n  if (data) {\n    horizontalScrollbar.set(width, data.cols.totalWidth());\n  }\n}\n\nfunction sheetFreeze() {\n  const {\n    selector, data, editor,\n  } = this;\n  const [ri, ci] = data.freeze;\n  if (ri > 0 || ci > 0) {\n    const fwidth = data.freezeTotalWidth();\n    const fheight = data.freezeTotalHeight();\n    editor.setFreezeLengths(fwidth, fheight);\n  }\n  selector.resetAreaOffset();\n}\n\nfunction sheetReset() {\n  const {\n    tableEl,\n    overlayerEl,\n    overlayerCEl,\n    table,\n    toolbar,\n    selector,\n    el,\n  } = this;\n  const tOffset = this.getTableOffset();\n  const vRect = this.getRect();\n  tableEl.attr(vRect);\n  overlayerEl.offset(vRect);\n  overlayerCEl.offset(tOffset);\n  el.css('width', `${vRect.width}px`);\n  verticalScrollbarSet.call(this);\n  horizontalScrollbarSet.call(this);\n  sheetFreeze.call(this);\n  table.render();\n  toolbar.reset();\n  selector.reset();\n}\n\nfunction clearClipboard() {\n  const { data, selector } = this;\n  data.clearClipboard();\n  selector.hideClipboard();\n}\n\nfunction copy(evt) {\n  const { data, selector } = this;\n  if (data.settings.mode === 'read') return;\n  data.copy();\n  data.copyToSystemClipboard(evt);\n  selector.showClipboard();\n}\n\nfunction cut() {\n  const { data, selector } = this;\n  if (data.settings.mode === 'read') return;\n  data.cut();\n  selector.showClipboard();\n}\n\nfunction paste(what, evt) {\n  const { data } = this;\n  if (data.settings.mode === 'read') return;\n  if (data.clipboard.isClear()) {\n    const resetSheet = () => sheetReset.call(this);\n    const eventTrigger = (rows) => {\n      this.trigger('pasted-clipboard', rows);\n    };\n    // pastFromSystemClipboard is async operation, need to tell it how to reset sheet and trigger event after it finishes\n    // pasting content from system clipboard\n    data.pasteFromSystemClipboard(resetSheet, eventTrigger);\n  } else if (data.paste(what, msg => xtoast('Tip', msg))) {\n    sheetReset.call(this);\n  } else if (evt) {\n    const cdata = evt.clipboardData.getData('text/plain');\n    this.data.pasteFromText(cdata);\n    sheetReset.call(this);\n  }\n}\n\nfunction hideRowsOrCols() {\n  this.data.hideRowsOrCols();\n  sheetReset.call(this);\n}\n\nfunction unhideRowsOrCols(type, index) {\n  this.data.unhideRowsOrCols(type, index);\n  sheetReset.call(this);\n}\n\nfunction autofilter() {\n  const { data } = this;\n  data.autofilter();\n  sheetReset.call(this);\n}\n\nfunction toolbarChangePaintformatPaste() {\n  const { toolbar } = this;\n  if (toolbar.paintformatActive()) {\n    paste.call(this, 'format');\n    clearClipboard.call(this);\n    toolbar.paintformatToggle();\n  }\n}\n\nfunction overlayerMousedown(evt) {\n  // console.log(':::::overlayer.mousedown:', evt.detail, evt.button, evt.buttons, evt.shiftKey);\n  // console.log('evt.target.className:', evt.target.className);\n  const {\n    selector, data, table, sortFilter,\n  } = this;\n  const { offsetX, offsetY } = evt;\n  const isAutofillEl = evt.target.className === `${cssPrefix}-selector-corner`;\n  const cellRect = data.getCellRectByXY(offsetX, offsetY);\n  const {\n    left, top, width, height,\n  } = cellRect;\n  let { ri, ci } = cellRect;\n  // sort or filter\n  const { autoFilter } = data;\n  if (autoFilter.includes(ri, ci)) {\n    if (left + width - 20 < offsetX && top + height - 20 < offsetY) {\n      const items = autoFilter.items(ci, (r, c) => data.rows.getCell(r, c));\n      sortFilter.hide();\n      sortFilter.set(ci, items, autoFilter.getFilter(ci), autoFilter.getSort(ci));\n      sortFilter.setOffset({ left, top: top + height + 2 });\n      return;\n    }\n  }\n\n  // console.log('ri:', ri, ', ci:', ci);\n  if (!evt.shiftKey) {\n    // console.log('selectorSetStart:::');\n    if (isAutofillEl) {\n      selector.showAutofill(ri, ci);\n    } else {\n      selectorSet.call(this, false, ri, ci);\n    }\n\n    // mouse move up\n    mouseMoveUp(window, (e) => {\n      // console.log('mouseMoveUp::::');\n      ({ ri, ci } = data.getCellRectByXY(e.offsetX, e.offsetY));\n      if (isAutofillEl) {\n        selector.showAutofill(ri, ci);\n      } else if (e.buttons === 1 && !e.shiftKey) {\n        selectorSet.call(this, true, ri, ci, true, true);\n      }\n    }, () => {\n      if (isAutofillEl && selector.arange && data.settings.mode !== 'read') {\n        if (data.autofill(selector.arange, 'all', msg => xtoast('Tip', msg))) {\n          table.render();\n        }\n      }\n      selector.hideAutofill();\n      toolbarChangePaintformatPaste.call(this);\n    });\n  }\n\n  if (!isAutofillEl && evt.buttons === 1) {\n    if (evt.shiftKey) {\n      // console.log('shiftKey::::');\n      selectorSet.call(this, true, ri, ci);\n    }\n  }\n}\n\nfunction editorSetOffset() {\n  const { editor, data } = this;\n  const sOffset = data.getSelectedRect();\n  const tOffset = this.getTableOffset();\n  let sPosition = 'top';\n  // console.log('sOffset:', sOffset, ':', tOffset);\n  if (sOffset.top > tOffset.height / 2) {\n    sPosition = 'bottom';\n  }\n  editor.setOffset(sOffset, sPosition);\n}\n\nfunction editorSet() {\n  const { editor, data } = this;\n  if (data.settings.mode === 'read') return;\n  editorSetOffset.call(this);\n  editor.setCell(data.getSelectedCell(), data.getSelectedValidator());\n  clearClipboard.call(this);\n}\n\nfunction verticalScrollbarMove(distance) {\n  const { data, table, selector } = this;\n  data.scrolly(distance, () => {\n    selector.resetBRLAreaOffset();\n    editorSetOffset.call(this);\n    table.render();\n  });\n}\n\nfunction horizontalScrollbarMove(distance) {\n  const { data, table, selector } = this;\n  data.scrollx(distance, () => {\n    selector.resetBRTAreaOffset();\n    editorSetOffset.call(this);\n    table.render();\n  });\n}\n\nfunction rowResizerFinished(cRect, distance) {\n  const { ri } = cRect;\n  const { table, selector, data } = this;\n  const { sri, eri } = selector.range;\n  if (ri >= sri && ri <= eri) {\n    for (let row = sri; row <= eri; row += 1) {\n      data.rows.setHeight(row, distance);\n    }\n  } else {\n    data.rows.setHeight(ri, distance);\n  }\n\n  table.render();\n  selector.resetAreaOffset();\n  verticalScrollbarSet.call(this);\n  editorSetOffset.call(this);\n}\n\nfunction colResizerFinished(cRect, distance) {\n  const { ci } = cRect;\n  const { table, selector, data } = this;\n  const { sci, eci } = selector.range;\n  if (ci >= sci && ci <= eci) {\n    for (let col = sci; col <= eci; col += 1) {\n      data.cols.setWidth(col, distance);\n    }\n  } else {\n    data.cols.setWidth(ci, distance);\n  }\n\n  table.render();\n  selector.resetAreaOffset();\n  horizontalScrollbarSet.call(this);\n  editorSetOffset.call(this);\n}\n\nfunction dataSetCellText(text, state = 'finished') {\n  const { data, table } = this;\n  // const [ri, ci] = selector.indexes;\n  if (data.settings.mode === 'read') return;\n  data.setSelectedCellText(text, state);\n  const { ri, ci } = data.selector;\n  if (state === 'finished') {\n    table.render();\n  } else {\n    this.trigger('cell-edited', text, ri, ci);\n  }\n}\n\nfunction insertDeleteRowColumn(type) {\n  const { data } = this;\n  if (data.settings.mode === 'read') return;\n  if (type === 'insert-row') {\n    data.insert('row');\n  } else if (type === 'delete-row') {\n    data.delete('row');\n  } else if (type === 'insert-column') {\n    data.insert('column');\n  } else if (type === 'delete-column') {\n    data.delete('column');\n  } else if (type === 'delete-cell') {\n    data.deleteCell();\n  } else if (type === 'delete-cell-format') {\n    data.deleteCell('format');\n  } else if (type === 'delete-cell-text') {\n    data.deleteCell('text');\n  } else if (type === 'cell-printable') {\n    data.setSelectedCellAttr('printable', true);\n  } else if (type === 'cell-non-printable') {\n    data.setSelectedCellAttr('printable', false);\n  } else if (type === 'cell-editable') {\n    data.setSelectedCellAttr('editable', true);\n  } else if (type === 'cell-non-editable') {\n    data.setSelectedCellAttr('editable', false);\n  }\n  clearClipboard.call(this);\n  sheetReset.call(this);\n}\n\nfunction toolbarChange(type, value) {\n  const { data } = this;\n  if (type === 'undo') {\n    this.undo();\n  } else if (type === 'redo') {\n    this.redo();\n  } else if (type === 'print') {\n    this.print.preview();\n  } else if (type === 'paintformat') {\n    if (value === true) copy.call(this);\n    else clearClipboard.call(this);\n  } else if (type === 'clearformat') {\n    insertDeleteRowColumn.call(this, 'delete-cell-format');\n  } else if (type === 'link') {\n    // link\n  } else if (type === 'chart') {\n    // chart\n  } else if (type === 'autofilter') {\n    // filter\n    autofilter.call(this);\n  } else if (type === 'freeze') {\n    if (value) {\n      const { ri, ci } = data.selector;\n      this.freeze(ri, ci);\n    } else {\n      this.freeze(0, 0);\n    }\n  } else {\n    data.setSelectedCellAttr(type, value);\n    if (type === 'formula' && !data.selector.multiple()) {\n      editorSet.call(this);\n    }\n    sheetReset.call(this);\n  }\n}\n\nfunction sortFilterChange(ci, order, operator, value) {\n  // console.log('sort:', sortDesc, operator, value);\n  this.data.setAutoFilter(ci, order, operator, value);\n  sheetReset.call(this);\n}\n\nfunction sheetInitEvents() {\n  const {\n    selector,\n    overlayerEl,\n    rowResizer,\n    colResizer,\n    verticalScrollbar,\n    horizontalScrollbar,\n    editor,\n    contextMenu,\n    toolbar,\n    modalValidation,\n    sortFilter,\n  } = this;\n  // overlayer\n  overlayerEl\n    .on('mousemove', (evt) => {\n      overlayerMousemove.call(this, evt);\n    })\n    .on('mousedown', (evt) => {\n      editor.clear();\n      contextMenu.hide();\n      // the left mouse button: mousedown → mouseup → click\n      // the right mouse button: mousedown → contenxtmenu → mouseup\n      if (evt.buttons === 2) {\n        if (this.data.xyInSelectedRect(evt.offsetX, evt.offsetY)) {\n          contextMenu.setPosition(evt.offsetX, evt.offsetY);\n        } else {\n          overlayerMousedown.call(this, evt);\n          contextMenu.setPosition(evt.offsetX, evt.offsetY);\n        }\n        evt.stopPropagation();\n      } else if (evt.detail === 2) {\n        editorSet.call(this);\n      } else {\n        overlayerMousedown.call(this, evt);\n      }\n    })\n    .on('mousewheel.stop', (evt) => {\n      overlayerMousescroll.call(this, evt);\n    })\n    .on('mouseout', (evt) => {\n      const { offsetX, offsetY } = evt;\n      if (offsetY <= 0) colResizer.hide();\n      if (offsetX <= 0) rowResizer.hide();\n    });\n\n  selector.inputChange = (v) => {\n    dataSetCellText.call(this, v, 'input');\n    editorSet.call(this);\n  };\n\n  // slide on mobile\n  bindTouch(overlayerEl.el, {\n    move: (direction, d) => {\n      overlayerTouch.call(this, direction, d);\n    },\n  });\n\n  // toolbar change\n  toolbar.change = (type, value) => toolbarChange.call(this, type, value);\n\n  // sort filter ok\n  sortFilter.ok = (ci, order, o, v) => sortFilterChange.call(this, ci, order, o, v);\n\n  // resizer finished callback\n  rowResizer.finishedFn = (cRect, distance) => {\n    rowResizerFinished.call(this, cRect, distance);\n  };\n  colResizer.finishedFn = (cRect, distance) => {\n    colResizerFinished.call(this, cRect, distance);\n  };\n  // resizer unhide callback\n  rowResizer.unhideFn = (index) => {\n    unhideRowsOrCols.call(this, 'row', index);\n  };\n  colResizer.unhideFn = (index) => {\n    unhideRowsOrCols.call(this, 'col', index);\n  };\n  // scrollbar move callback\n  verticalScrollbar.moveFn = (distance, evt) => {\n    verticalScrollbarMove.call(this, distance, evt);\n  };\n  horizontalScrollbar.moveFn = (distance, evt) => {\n    horizontalScrollbarMove.call(this, distance, evt);\n  };\n  // editor\n  editor.change = (state, itext) => {\n    dataSetCellText.call(this, itext, state);\n  };\n  // modal validation\n  modalValidation.change = (action, ...args) => {\n    if (action === 'save') {\n      this.data.addValidation(...args);\n    } else {\n      this.data.removeValidation();\n    }\n  };\n  // contextmenu\n  contextMenu.itemClick = (type) => {\n    // console.log('type:', type);\n    if (type === 'validation') {\n      modalValidation.setValue(this.data.getSelectedValidation());\n    } else if (type === 'copy') {\n      copy.call(this);\n    } else if (type === 'cut') {\n      cut.call(this);\n    } else if (type === 'paste') {\n      paste.call(this, 'all');\n    } else if (type === 'paste-value') {\n      paste.call(this, 'text');\n    } else if (type === 'paste-format') {\n      paste.call(this, 'format');\n    } else if (type === 'hide') {\n      hideRowsOrCols.call(this);\n    } else {\n      insertDeleteRowColumn.call(this, type);\n    }\n  };\n\n  bind(window, 'resize', () => {\n    this.reload();\n  });\n\n  bind(window, 'click', (evt) => {\n    this.focusing = overlayerEl.contains(evt.target);\n  });\n\n  bind(window, 'paste', (evt) => {\n    if (!this.focusing) return;\n    paste.call(this, 'all', evt);\n    evt.preventDefault();\n  });\n\n  bind(window, 'copy', (evt) => {\n    if (!this.focusing) return;\n    copy.call(this, evt);\n    evt.preventDefault();\n  });\n\n  // for selector\n  bind(window, 'keydown', (evt) => {\n    if (!this.focusing) return;\n    const keyCode = evt.keyCode || evt.which;\n    const {\n      key, ctrlKey, shiftKey, metaKey,\n    } = evt;\n    // console.log('keydown.evt: ', keyCode);\n    if (ctrlKey || metaKey) {\n      // const { sIndexes, eIndexes } = selector;\n      // let what = 'all';\n      // if (shiftKey) what = 'text';\n      // if (altKey) what = 'format';\n      switch (keyCode) {\n        case 90:\n          // undo: ctrl + z\n          this.undo();\n          evt.preventDefault();\n          break;\n        case 89:\n          // redo: ctrl + y\n          this.redo();\n          evt.preventDefault();\n          break;\n        case 67:\n          // ctrl + c\n          // => copy\n          // copy.call(this);\n          // evt.preventDefault();\n          break;\n        case 88:\n          // ctrl + x\n          cut.call(this);\n          evt.preventDefault();\n          break;\n        case 85:\n          // ctrl + u\n          toolbar.trigger('underline');\n          evt.preventDefault();\n          break;\n        case 86:\n          // ctrl + v\n          // => paste\n          // evt.preventDefault();\n          break;\n        case 37:\n          // ctrl + left\n          selectorMove.call(this, shiftKey, 'row-first');\n          evt.preventDefault();\n          break;\n        case 38:\n          // ctrl + up\n          selectorMove.call(this, shiftKey, 'col-first');\n          evt.preventDefault();\n          break;\n        case 39:\n          // ctrl + right\n          selectorMove.call(this, shiftKey, 'row-last');\n          evt.preventDefault();\n          break;\n        case 40:\n          // ctrl + down\n          selectorMove.call(this, shiftKey, 'col-last');\n          evt.preventDefault();\n          break;\n        case 32:\n          // ctrl + space, all cells in col\n          selectorSet.call(this, false, -1, this.data.selector.ci, false);\n          evt.preventDefault();\n          break;\n        case 66:\n          // ctrl + B\n          toolbar.trigger('bold');\n          break;\n        case 73:\n          // ctrl + I\n          toolbar.trigger('italic');\n          break;\n        default:\n          break;\n      }\n    } else {\n      // console.log('evt.keyCode:', evt.keyCode);\n      switch (keyCode) {\n        case 32:\n          if (shiftKey) {\n            // shift + space, all cells in row\n            selectorSet.call(this, false, this.data.selector.ri, -1, false);\n          }\n          break;\n        case 27: // esc\n          contextMenu.hide();\n          clearClipboard.call(this);\n          break;\n        case 37: // left\n          selectorMove.call(this, shiftKey, 'left');\n          evt.preventDefault();\n          break;\n        case 38: // up\n          selectorMove.call(this, shiftKey, 'up');\n          evt.preventDefault();\n          break;\n        case 39: // right\n          selectorMove.call(this, shiftKey, 'right');\n          evt.preventDefault();\n          break;\n        case 40: // down\n          selectorMove.call(this, shiftKey, 'down');\n          evt.preventDefault();\n          break;\n        case 9: // tab\n          editor.clear();\n          // shift + tab => move left\n          // tab => move right\n          selectorMove.call(this, false, shiftKey ? 'left' : 'right');\n          evt.preventDefault();\n          break;\n        case 13: // enter\n          editor.clear();\n          // shift + enter => move up\n          // enter => move down\n          selectorMove.call(this, false, shiftKey ? 'up' : 'down');\n          evt.preventDefault();\n          break;\n        case 8: // backspace\n          insertDeleteRowColumn.call(this, 'delete-cell-text');\n          evt.preventDefault();\n          break;\n        default:\n          break;\n      }\n\n      if (key === 'Delete') {\n        insertDeleteRowColumn.call(this, 'delete-cell-text');\n        evt.preventDefault();\n      } else if ((keyCode >= 65 && keyCode <= 90)\n        || (keyCode >= 48 && keyCode <= 57)\n        || (keyCode >= 96 && keyCode <= 105)\n        || evt.key === '='\n      ) {\n        dataSetCellText.call(this, evt.key, 'input');\n        editorSet.call(this);\n      } else if (keyCode === 113) {\n        // F2\n        editorSet.call(this);\n      }\n    }\n  });\n}\n\nexport default class Sheet {\n  constructor(targetEl, data) {\n    this.eventMap = createEventEmitter();\n    const { view, showToolbar, showContextmenu } = data.settings;\n    this.el = h('div', `${cssPrefix}-sheet`);\n    this.toolbar = new Toolbar(data, view.width, !showToolbar);\n    this.print = new Print(data);\n    targetEl.children(this.toolbar.el, this.el, this.print.el);\n    this.data = data;\n    // table\n    this.tableEl = h('canvas', `${cssPrefix}-table`);\n    // resizer\n    this.rowResizer = new Resizer(false, data.rows.height);\n    this.colResizer = new Resizer(true, data.cols.minWidth);\n    // scrollbar\n    this.verticalScrollbar = new Scrollbar(true);\n    this.horizontalScrollbar = new Scrollbar(false);\n    // editor\n    this.editor = new Editor(\n      formulas,\n      () => this.getTableOffset(),\n      data.rows.height,\n    );\n    // data validation\n    this.modalValidation = new ModalValidation();\n    // contextMenu\n    this.contextMenu = new ContextMenu(() => this.getRect(), !showContextmenu);\n    // selector\n    this.selector = new Selector(data);\n    this.overlayerCEl = h('div', `${cssPrefix}-overlayer-content`)\n      .children(\n        this.editor.el,\n        this.selector.el,\n      );\n    this.overlayerEl = h('div', `${cssPrefix}-overlayer`)\n      .child(this.overlayerCEl);\n    // sortFilter\n    this.sortFilter = new SortFilter();\n    // root element\n    this.el.children(\n      this.tableEl,\n      this.overlayerEl.el,\n      this.rowResizer.el,\n      this.colResizer.el,\n      this.verticalScrollbar.el,\n      this.horizontalScrollbar.el,\n      this.contextMenu.el,\n      this.modalValidation.el,\n      this.sortFilter.el,\n    );\n    // table\n    this.table = new Table(this.tableEl.el, data);\n    sheetInitEvents.call(this);\n    sheetReset.call(this);\n    // init selector [0, 0]\n    selectorSet.call(this, false, 0, 0);\n  }\n\n  on(eventName, func) {\n    this.eventMap.on(eventName, func);\n    return this;\n  }\n\n  trigger(eventName, ...args) {\n    const { eventMap } = this;\n    eventMap.fire(eventName, args);\n  }\n\n  resetData(data) {\n    // before\n    this.editor.clear();\n    // after\n    this.data = data;\n    verticalScrollbarSet.call(this);\n    horizontalScrollbarSet.call(this);\n    this.toolbar.resetData(data);\n    this.print.resetData(data);\n    this.selector.resetData(data);\n    this.table.resetData(data);\n  }\n\n  loadData(data) {\n    this.data.setData(data);\n    sheetReset.call(this);\n    return this;\n  }\n\n  // freeze rows or cols\n  freeze(ri, ci) {\n    const { data } = this;\n    data.setFreeze(ri, ci);\n    sheetReset.call(this);\n    return this;\n  }\n\n  undo() {\n    this.data.undo();\n    sheetReset.call(this);\n  }\n\n  redo() {\n    this.data.redo();\n    sheetReset.call(this);\n  }\n\n  reload() {\n    sheetReset.call(this);\n    return this;\n  }\n\n  getRect() {\n    const { data } = this;\n    return { width: data.viewWidth(), height: data.viewHeight() };\n  }\n\n  getTableOffset() {\n    const { rows, cols } = this.data;\n    const { width, height } = this.getRect();\n    return {\n      width: width - cols.indexWidth,\n      height: height - rows.height,\n      left: cols.indexWidth,\n      top: rows.height,\n    };\n  }\n}\n"
  },
  {
    "path": "src/component/sort_filter.js",
    "content": "import { h } from './element';\nimport Button from './button';\nimport { bindClickoutside, unbindClickoutside } from './event';\nimport { cssPrefix } from '../config';\nimport { t } from '../locale/locale';\n\nfunction buildMenu(clsName) {\n  return h('div', `${cssPrefix}-item ${clsName}`);\n}\n\nfunction buildSortItem(it) {\n  return buildMenu('state').child(t(`sort.${it}`))\n    .on('click.stop', () => this.itemClick(it));\n}\n\nfunction buildFilterBody(items) {\n  const { filterbEl, filterValues } = this;\n  filterbEl.html('');\n  const itemKeys = Object.keys(items);\n  itemKeys.forEach((it, index) => {\n    const cnt = items[it];\n    const active = filterValues.includes(it) ? 'checked' : '';\n    filterbEl.child(h('div', `${cssPrefix}-item state ${active}`)\n      .on('click.stop', () => this.filterClick(index, it))\n      .children(it === '' ? t('filter.empty') : it, h('div', 'label').html(`(${cnt})`)));\n  });\n}\n\nfunction resetFilterHeader() {\n  const { filterhEl, filterValues, values } = this;\n  filterhEl.html(`${filterValues.length} / ${values.length}`);\n  filterhEl.checked(filterValues.length === values.length);\n}\n\nexport default class SortFilter {\n  constructor() {\n    this.filterbEl = h('div', `${cssPrefix}-body`);\n    this.filterhEl = h('div', `${cssPrefix}-header state`).on('click.stop', () => this.filterClick(0, 'all'));\n    this.el = h('div', `${cssPrefix}-sort-filter`).children(\n      this.sortAscEl = buildSortItem.call(this, 'asc'),\n      this.sortDescEl = buildSortItem.call(this, 'desc'),\n      buildMenu('divider'),\n      h('div', `${cssPrefix}-filter`).children(\n        this.filterhEl,\n        this.filterbEl,\n      ),\n      h('div', `${cssPrefix}-buttons`).children(\n        new Button('cancel').on('click', () => this.btnClick('cancel')),\n        new Button('ok', 'primary').on('click', () => this.btnClick('ok')),\n      ),\n    ).hide();\n    // this.setFilters(['test1', 'test2', 'text3']);\n    this.ci = null;\n    this.sortDesc = null;\n    this.values = null;\n    this.filterValues = [];\n  }\n\n  btnClick(it) {\n    if (it === 'ok') {\n      const { ci, sort, filterValues } = this;\n      if (this.ok) {\n        this.ok(ci, sort, 'in', filterValues);\n      }\n    }\n    this.hide();\n  }\n\n  itemClick(it) {\n    // console.log('it:', it);\n    this.sort = it;\n    const { sortAscEl, sortDescEl } = this;\n    sortAscEl.checked(it === 'asc');\n    sortDescEl.checked(it === 'desc');\n  }\n\n  filterClick(index, it) {\n    // console.log('index:', index, it);\n    const { filterbEl, filterValues, values } = this;\n    const children = filterbEl.children();\n    if (it === 'all') {\n      if (children.length === filterValues.length) {\n        this.filterValues = [];\n        children.forEach(i => h(i).checked(false));\n      } else {\n        this.filterValues = Array.from(values);\n        children.forEach(i => h(i).checked(true));\n      }\n    } else {\n      const checked = h(children[index]).toggle('checked');\n      if (checked) {\n        filterValues.push(it);\n      } else {\n        filterValues.splice(filterValues.findIndex(i => i === it), 1);\n      }\n    }\n    resetFilterHeader.call(this);\n  }\n\n  // v: autoFilter\n  // items: {value: cnt}\n  // sort { ci, order }\n  set(ci, items, filter, sort) {\n    this.ci = ci;\n    const { sortAscEl, sortDescEl } = this;\n    if (sort !== null) {\n      this.sort = sort.order;\n      sortAscEl.checked(sort.asc());\n      sortDescEl.checked(sort.desc());\n    } else {\n      this.sortDesc = null;\n      sortAscEl.checked(false);\n      sortDescEl.checked(false);\n    }\n    // this.setFilters(items, filter);\n    this.values = Object.keys(items);\n    this.filterValues = filter ? Array.from(filter.value) : Object.keys(items);\n    buildFilterBody.call(this, items, filter);\n    resetFilterHeader.call(this);\n  }\n\n  setOffset(v) {\n    this.el.offset(v).show();\n    let tindex = 1;\n    bindClickoutside(this.el, () => {\n      if (tindex <= 0) {\n        this.hide();\n      }\n      tindex -= 1;\n    });\n  }\n\n  show() {\n    this.el.show();\n  }\n\n  hide() {\n    this.el.hide();\n    unbindClickoutside(this.el);\n  }\n}\n"
  },
  {
    "path": "src/component/suggest.js",
    "content": "import { h } from './element';\nimport { bindClickoutside, unbindClickoutside } from './event';\nimport { cssPrefix } from '../config';\n\nfunction inputMovePrev(evt) {\n  evt.preventDefault();\n  evt.stopPropagation();\n  const { filterItems } = this;\n  if (filterItems.length <= 0) return;\n  if (this.itemIndex >= 0) filterItems[this.itemIndex].toggle();\n  this.itemIndex -= 1;\n  if (this.itemIndex < 0) {\n    this.itemIndex = filterItems.length - 1;\n  }\n  filterItems[this.itemIndex].toggle();\n}\n\nfunction inputMoveNext(evt) {\n  evt.stopPropagation();\n  const { filterItems } = this;\n  if (filterItems.length <= 0) return;\n  if (this.itemIndex >= 0) filterItems[this.itemIndex].toggle();\n  this.itemIndex += 1;\n  if (this.itemIndex > filterItems.length - 1) {\n    this.itemIndex = 0;\n  }\n  filterItems[this.itemIndex].toggle();\n}\n\nfunction inputEnter(evt) {\n  evt.preventDefault();\n  const { filterItems } = this;\n  if (filterItems.length <= 0) return;\n  evt.stopPropagation();\n  if (this.itemIndex < 0) this.itemIndex = 0;\n  filterItems[this.itemIndex].el.click();\n  this.hide();\n}\n\nfunction inputKeydownHandler(evt) {\n  const { keyCode } = evt;\n  if (evt.ctrlKey) {\n    evt.stopPropagation();\n  }\n  switch (keyCode) {\n    case 37: // left\n      evt.stopPropagation();\n      break;\n    case 38: // up\n      inputMovePrev.call(this, evt);\n      break;\n    case 39: // right\n      evt.stopPropagation();\n      break;\n    case 40: // down\n      inputMoveNext.call(this, evt);\n      break;\n    case 13: // enter\n      inputEnter.call(this, evt);\n      break;\n    case 9:\n      inputEnter.call(this, evt);\n      break;\n    default:\n      evt.stopPropagation();\n      break;\n  }\n}\n\nexport default class Suggest {\n  constructor(items, itemClick, width = '200px') {\n    this.filterItems = [];\n    this.items = items;\n    this.el = h('div', `${cssPrefix}-suggest`).css('width', width).hide();\n    this.itemClick = itemClick;\n    this.itemIndex = -1;\n  }\n\n  setOffset(v) {\n    this.el.cssRemoveKeys('top', 'bottom')\n      .offset(v);\n  }\n\n  hide() {\n    const { el } = this;\n    this.filterItems = [];\n    this.itemIndex = -1;\n    el.hide();\n    unbindClickoutside(this.el.parent());\n  }\n\n  setItems(items) {\n    this.items = items;\n    // this.search('');\n  }\n\n  search(word) {\n    let { items } = this;\n    if (!/^\\s*$/.test(word)) {\n      items = items.filter(it => (it.key || it).startsWith(word.toUpperCase()));\n    }\n    items = items.map((it) => {\n      let { title } = it;\n      if (title) {\n        if (typeof title === 'function') {\n          title = title();\n        }\n      } else {\n        title = it;\n      }\n      const item = h('div', `${cssPrefix}-item`)\n        .child(title)\n        .on('click.stop', () => {\n          this.itemClick(it);\n          this.hide();\n        });\n      if (it.label) {\n        item.child(h('div', 'label').html(it.label));\n      }\n      return item;\n    });\n    this.filterItems = items;\n    if (items.length <= 0) {\n      return;\n    }\n    const { el } = this;\n    // items[0].toggle();\n    el.html('').children(...items).show();\n    bindClickoutside(el.parent(), () => { this.hide(); });\n  }\n\n  bindInputEvents(input) {\n    input.on('keydown', evt => inputKeydownHandler.call(this, evt));\n  }\n}\n"
  },
  {
    "path": "src/component/table.js",
    "content": "import { stringAt } from '../core/alphabet';\nimport { getFontSizePxByPt } from '../core/font';\nimport _cell from '../core/cell';\nimport { formulam } from '../core/formula';\nimport { formatm } from '../core/format';\n\nimport {\n  Draw, DrawBox, thinLineWidth, npx,\n} from '../canvas/draw';\n// gobal var\nconst cellPaddingWidth = 5;\nconst tableFixedHeaderCleanStyle = { fillStyle: '#f4f5f8' };\nconst tableGridStyle = {\n  fillStyle: '#fff',\n  lineWidth: thinLineWidth,\n  strokeStyle: '#e6e6e6',\n};\nfunction tableFixedHeaderStyle() {\n  return {\n    textAlign: 'center',\n    textBaseline: 'middle',\n    font: `500 ${npx(12)}px Source Sans Pro`,\n    fillStyle: '#585757',\n    lineWidth: thinLineWidth(),\n    strokeStyle: '#e6e6e6',\n  };\n}\n\nfunction getDrawBox(data, rindex, cindex, yoffset = 0) {\n  const {\n    left, top, width, height,\n  } = data.cellRect(rindex, cindex);\n  return new DrawBox(left, top + yoffset, width, height, cellPaddingWidth);\n}\n/*\nfunction renderCellBorders(bboxes, translateFunc) {\n  const { draw } = this;\n  if (bboxes) {\n    const rset = new Set();\n    // console.log('bboxes:', bboxes);\n    bboxes.forEach(({ ri, ci, box }) => {\n      if (!rset.has(ri)) {\n        rset.add(ri);\n        translateFunc(ri);\n      }\n      draw.strokeBorders(box);\n    });\n  }\n}\n*/\n\nexport function renderCell(draw, data, rindex, cindex, yoffset = 0) {\n  const { sortedRowMap, rows, cols } = data;\n  if (rows.isHide(rindex) || cols.isHide(cindex)) return;\n  let nrindex = rindex;\n  if (sortedRowMap.has(rindex)) {\n    nrindex = sortedRowMap.get(rindex);\n  }\n\n  const cell = data.getCell(nrindex, cindex);\n  if (cell === null) return;\n  let frozen = false;\n  if ('editable' in cell && cell.editable === false) {\n    frozen = true;\n  }\n\n  const style = data.getCellStyleOrDefault(nrindex, cindex);\n  const dbox = getDrawBox(data, rindex, cindex, yoffset);\n  dbox.bgcolor = style.bgcolor;\n  if (style.border !== undefined) {\n    dbox.setBorders(style.border);\n    // bboxes.push({ ri: rindex, ci: cindex, box: dbox });\n    draw.strokeBorders(dbox);\n  }\n  draw.rect(dbox, () => {\n    // render text\n    let cellText = '';\n    if (!data.settings.evalPaused) {\n      cellText = _cell.render(cell.text || '', formulam, (y, x) => (data.getCellTextOrDefault(x, y)));\n    } else {\n      cellText = cell.text || '';\n    }\n    if (style.format) {\n      // console.log(data.formatm, '>>', cell.format);\n      cellText = formatm[style.format].render(cellText);\n    }\n    const font = Object.assign({}, style.font);\n    font.size = getFontSizePxByPt(font.size);\n    // console.log('style:', style);\n    draw.text(cellText, dbox, {\n      align: style.align,\n      valign: style.valign,\n      font,\n      color: style.color,\n      strike: style.strike,\n      underline: style.underline,\n    }, style.textwrap);\n    // error\n    const error = data.validations.getError(rindex, cindex);\n    if (error) {\n      // console.log('error:', rindex, cindex, error);\n      draw.error(dbox);\n    }\n    if (frozen) {\n      draw.frozen(dbox);\n    }\n  });\n}\n\nfunction renderAutofilter(viewRange) {\n  const { data, draw } = this;\n  if (viewRange) {\n    const { autoFilter } = data;\n    if (!autoFilter.active()) return;\n    const afRange = autoFilter.hrange();\n    if (viewRange.intersects(afRange)) {\n      afRange.each((ri, ci) => {\n        const dbox = getDrawBox(data, ri, ci);\n        draw.dropdown(dbox);\n      });\n    }\n  }\n}\n\nfunction renderContent(viewRange, fw, fh, tx, ty) {\n  const { draw, data } = this;\n  draw.save();\n  draw.translate(fw, fh)\n    .translate(tx, ty);\n\n  const { exceptRowSet } = data;\n  // const exceptRows = Array.from(exceptRowSet);\n  const filteredTranslateFunc = (ri) => {\n    const ret = exceptRowSet.has(ri);\n    if (ret) {\n      const height = data.rows.getHeight(ri);\n      draw.translate(0, -height);\n    }\n    return !ret;\n  };\n\n  const exceptRowTotalHeight = data.exceptRowTotalHeight(viewRange.sri, viewRange.eri);\n  // 1 render cell\n  draw.save();\n  draw.translate(0, -exceptRowTotalHeight);\n  viewRange.each((ri, ci) => {\n    renderCell(draw, data, ri, ci);\n  }, ri => filteredTranslateFunc(ri));\n  draw.restore();\n\n\n  // 2 render mergeCell\n  const rset = new Set();\n  draw.save();\n  draw.translate(0, -exceptRowTotalHeight);\n  data.eachMergesInView(viewRange, ({ sri, sci, eri }) => {\n    if (!exceptRowSet.has(sri)) {\n      renderCell(draw, data, sri, sci);\n    } else if (!rset.has(sri)) {\n      rset.add(sri);\n      const height = data.rows.sumHeight(sri, eri + 1);\n      draw.translate(0, -height);\n    }\n  });\n  draw.restore();\n\n  // 3 render autofilter\n  renderAutofilter.call(this, viewRange);\n\n  draw.restore();\n}\n\nfunction renderSelectedHeaderCell(x, y, w, h) {\n  const { draw } = this;\n  draw.save();\n  draw.attr({ fillStyle: 'rgba(75, 137, 255, 0.08)' })\n    .fillRect(x, y, w, h);\n  draw.restore();\n}\n\n// viewRange\n// type: all | left | top\n// w: the fixed width of header\n// h: the fixed height of header\n// tx: moving distance on x-axis\n// ty: moving distance on y-axis\nfunction renderFixedHeaders(type, viewRange, w, h, tx, ty) {\n  const { draw, data } = this;\n  const sumHeight = viewRange.h; // rows.sumHeight(viewRange.sri, viewRange.eri + 1);\n  const sumWidth = viewRange.w; // cols.sumWidth(viewRange.sci, viewRange.eci + 1);\n  const nty = ty + h;\n  const ntx = tx + w;\n\n  draw.save();\n  // draw rect background\n  draw.attr(tableFixedHeaderCleanStyle);\n  if (type === 'all' || type === 'left') draw.fillRect(0, nty, w, sumHeight);\n  if (type === 'all' || type === 'top') draw.fillRect(ntx, 0, sumWidth, h);\n\n  const {\n    sri, sci, eri, eci,\n  } = data.selector.range;\n  // console.log(data.selectIndexes);\n  // draw text\n  // text font, align...\n  draw.attr(tableFixedHeaderStyle());\n  // y-header-text\n  if (type === 'all' || type === 'left') {\n    data.rowEach(viewRange.sri, viewRange.eri, (i, y1, rowHeight) => {\n      const y = nty + y1;\n      const ii = i;\n      draw.line([0, y], [w, y]);\n      if (sri <= ii && ii < eri + 1) {\n        renderSelectedHeaderCell.call(this, 0, y, w, rowHeight);\n      }\n      draw.fillText(ii + 1, w / 2, y + (rowHeight / 2));\n      if (i > 0 && data.rows.isHide(i - 1)) {\n        draw.save();\n        draw.attr({ strokeStyle: '#c6c6c6' });\n        draw.line([5, y + 5], [w - 5, y + 5]);\n        draw.restore();\n      }\n    });\n    draw.line([0, sumHeight + nty], [w, sumHeight + nty]);\n    draw.line([w, nty], [w, sumHeight + nty]);\n  }\n  // x-header-text\n  if (type === 'all' || type === 'top') {\n    data.colEach(viewRange.sci, viewRange.eci, (i, x1, colWidth) => {\n      const x = ntx + x1;\n      const ii = i;\n      draw.line([x, 0], [x, h]);\n      if (sci <= ii && ii < eci + 1) {\n        renderSelectedHeaderCell.call(this, x, 0, colWidth, h);\n      }\n      draw.fillText(stringAt(ii), x + (colWidth / 2), h / 2);\n      if (i > 0 && data.cols.isHide(i - 1)) {\n        draw.save();\n        draw.attr({ strokeStyle: '#c6c6c6' });\n        draw.line([x + 5, 5], [x + 5, h - 5]);\n        draw.restore();\n      }\n    });\n    draw.line([sumWidth + ntx, 0], [sumWidth + ntx, h]);\n    draw.line([0, h], [sumWidth + ntx, h]);\n  }\n  draw.restore();\n}\n\nfunction renderFixedLeftTopCell(fw, fh) {\n  const { draw } = this;\n  draw.save();\n  // left-top-cell\n  draw.attr({ fillStyle: '#f4f5f8' })\n    .fillRect(0, 0, fw, fh);\n  draw.restore();\n}\n\nfunction renderContentGrid({\n  sri, sci, eri, eci, w, h,\n}, fw, fh, tx, ty) {\n  const { draw, data } = this;\n  const { settings } = data;\n\n  draw.save();\n  draw.attr(tableGridStyle)\n    .translate(fw + tx, fh + ty);\n  // const sumWidth = cols.sumWidth(sci, eci + 1);\n  // const sumHeight = rows.sumHeight(sri, eri + 1);\n  // console.log('sumWidth:', sumWidth);\n  // draw.clearRect(0, 0, w, h);\n  if (!settings.showGrid) {\n    draw.restore();\n    return;\n  }\n  // console.log('rowStart:', rowStart, ', rowLen:', rowLen);\n  data.rowEach(sri, eri, (i, y, ch) => {\n    // console.log('y:', y);\n    if (i !== sri) draw.line([0, y], [w, y]);\n    if (i === eri) draw.line([0, y + ch], [w, y + ch]);\n  });\n  data.colEach(sci, eci, (i, x, cw) => {\n    if (i !== sci) draw.line([x, 0], [x, h]);\n    if (i === eci) draw.line([x + cw, 0], [x + cw, h]);\n  });\n  draw.restore();\n}\n\nfunction renderFreezeHighlightLine(fw, fh, ftw, fth) {\n  const { draw, data } = this;\n  const twidth = data.viewWidth() - fw;\n  const theight = data.viewHeight() - fh;\n  draw.save()\n    .translate(fw, fh)\n    .attr({ strokeStyle: 'rgba(75, 137, 255, .6)' });\n  draw.line([0, fth], [twidth, fth]);\n  draw.line([ftw, 0], [ftw, theight]);\n  draw.restore();\n}\n\n/** end */\nclass Table {\n  constructor(el, data) {\n    this.el = el;\n    this.draw = new Draw(el, data.viewWidth(), data.viewHeight());\n    this.data = data;\n  }\n\n  resetData(data) {\n    this.data = data;\n    this.render();\n  }\n\n  render() {\n    // resize canvas\n    const { data } = this;\n    const { rows, cols } = data;\n    // fixed width of header\n    const fw = cols.indexWidth;\n    // fixed height of header\n    const fh = rows.height;\n\n    this.draw.resize(data.viewWidth(), data.viewHeight());\n    this.clear();\n\n    const viewRange = data.viewRange();\n    // renderAll.call(this, viewRange, data.scroll);\n    const tx = data.freezeTotalWidth();\n    const ty = data.freezeTotalHeight();\n    const { x, y } = data.scroll;\n    // 1\n    renderContentGrid.call(this, viewRange, fw, fh, tx, ty);\n    renderContent.call(this, viewRange, fw, fh, -x, -y);\n    renderFixedHeaders.call(this, 'all', viewRange, fw, fh, tx, ty);\n    renderFixedLeftTopCell.call(this, fw, fh);\n    const [fri, fci] = data.freeze;\n    if (fri > 0 || fci > 0) {\n      // 2\n      if (fri > 0) {\n        const vr = viewRange.clone();\n        vr.sri = 0;\n        vr.eri = fri - 1;\n        vr.h = ty;\n        renderContentGrid.call(this, vr, fw, fh, tx, 0);\n        renderContent.call(this, vr, fw, fh, -x, 0);\n        renderFixedHeaders.call(this, 'top', vr, fw, fh, tx, 0);\n      }\n      // 3\n      if (fci > 0) {\n        const vr = viewRange.clone();\n        vr.sci = 0;\n        vr.eci = fci - 1;\n        vr.w = tx;\n        renderContentGrid.call(this, vr, fw, fh, 0, ty);\n        renderFixedHeaders.call(this, 'left', vr, fw, fh, 0, ty);\n        renderContent.call(this, vr, fw, fh, 0, -y);\n      }\n      // 4\n      const freezeViewRange = data.freezeViewRange();\n      renderContentGrid.call(this, freezeViewRange, fw, fh, 0, 0);\n      renderFixedHeaders.call(this, 'all', freezeViewRange, fw, fh, 0, 0);\n      renderContent.call(this, freezeViewRange, fw, fh, 0, 0);\n      // 5\n      renderFreezeHighlightLine.call(this, fw, fh, tx, ty);\n    }\n  }\n\n  clear() {\n    this.draw.clear();\n  }\n}\n\nexport default Table;\n"
  },
  {
    "path": "src/component/toolbar/align.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownAlign from '../dropdown_align';\n\nexport default class Align extends DropdownItem {\n  constructor(value) {\n    super('align', '', value);\n  }\n\n  dropdown() {\n    const { value } = this;\n    return new DropdownAlign(['left', 'center', 'right'], value);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/autofilter.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Autofilter extends ToggleItem {\n  constructor() {\n    super('autofilter');\n  }\n\n  setState() {}\n}\n"
  },
  {
    "path": "src/component/toolbar/bold.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Bold extends ToggleItem {\n  constructor() {\n    super('font-bold', 'Ctrl+B');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/border.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownBorder from '../dropdown_border';\n\nexport default class Border extends DropdownItem {\n  constructor() {\n    super('border');\n  }\n\n  dropdown() {\n    return new DropdownBorder();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/clearformat.js",
    "content": "import IconItem from './icon_item';\n\nexport default class Clearformat extends IconItem {\n  constructor() {\n    super('clearformat');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/dropdown_item.js",
    "content": "import Item from './item';\n\nexport default class DropdownItem extends Item {\n  dropdown() {}\n\n  getValue(v) {\n    return v;\n  }\n\n  element() {\n    const { tag } = this;\n    this.dd = this.dropdown();\n    this.dd.change = it => this.change(tag, this.getValue(it));\n    return super.element().child(\n      this.dd,\n    );\n  }\n\n  setState(v) {\n    if (v) {\n      this.value = v;\n      this.dd.setTitle(v);\n    }\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/fill_color.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownColor from '../dropdown_color';\n\nexport default class FillColor extends DropdownItem {\n  constructor(color) {\n    super('bgcolor', undefined, color);\n  }\n\n  dropdown() {\n    const { tag, value } = this;\n    return new DropdownColor(tag, value);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/font.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownFont from '../dropdown_font';\n\nexport default class Font extends DropdownItem {\n  constructor() {\n    super('font-name');\n  }\n\n  getValue(it) {\n    return it.key;\n  }\n\n  dropdown() {\n    return new DropdownFont();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/font_size.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownFontsize from '../dropdown_fontsize';\n\nexport default class Format extends DropdownItem {\n  constructor() {\n    super('font-size');\n  }\n\n  getValue(it) {\n    return it.pt;\n  }\n\n  dropdown() {\n    return new DropdownFontsize();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/format.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownFormat from '../dropdown_format';\n\nexport default class Format extends DropdownItem {\n  constructor() {\n    super('format');\n  }\n\n  getValue(it) {\n    return it.key;\n  }\n\n  dropdown() {\n    return new DropdownFormat();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/formula.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownFormula from '../dropdown_formula';\n\nexport default class Format extends DropdownItem {\n  constructor() {\n    super('formula');\n  }\n\n  getValue(it) {\n    return it.key;\n  }\n\n  dropdown() {\n    return new DropdownFormula();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/freeze.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Freeze extends ToggleItem {\n  constructor() {\n    super('freeze');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/icon_item.js",
    "content": "import Item from './item';\nimport Icon from '../icon';\n\nexport default class IconItem extends Item {\n  element() {\n    return super.element()\n      .child(new Icon(this.tag))\n      .on('click', () => this.change(this.tag));\n  }\n\n  setState(disabled) {\n    this.el.disabled(disabled);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/index.js",
    "content": "/* global window */\n\nimport Align from './align';\nimport Valign from './valign';\nimport Autofilter from './autofilter';\nimport Bold from './bold';\nimport Italic from './italic';\nimport Strike from './strike';\nimport Underline from './underline';\nimport Border from './border';\nimport Clearformat from './clearformat';\nimport Paintformat from './paintformat';\nimport TextColor from './text_color';\nimport FillColor from './fill_color';\nimport FontSize from './font_size';\nimport Font from './font';\nimport Format from './format';\nimport Formula from './formula';\nimport Freeze from './freeze';\nimport Merge from './merge';\nimport Redo from './redo';\nimport Undo from './undo';\nimport Print from './print';\nimport Textwrap from './textwrap';\nimport More from './more';\nimport Item from './item';\n\nimport { h } from '../element';\nimport { cssPrefix } from '../../config';\nimport { bind } from '../event';\n\nfunction buildDivider() {\n  return h('div', `${cssPrefix}-toolbar-divider`);\n}\n\nfunction initBtns2() {\n  this.btns2 = [];\n  this.items.forEach((it) => {\n    if (Array.isArray(it)) {\n      it.forEach(({ el }) => {\n        const rect = el.box();\n        const { marginLeft, marginRight } = el.computedStyle();\n        this.btns2.push([el, rect.width + parseInt(marginLeft, 10) + parseInt(marginRight, 10)]);\n      });\n    } else {\n      const rect = it.box();\n      const { marginLeft, marginRight } = it.computedStyle();\n      this.btns2.push([it, rect.width + parseInt(marginLeft, 10) + parseInt(marginRight, 10)]);\n    }\n  });\n}\n\nfunction moreResize() {\n  const {\n    el, btns, moreEl, btns2,\n  } = this;\n  const { moreBtns, contentEl } = moreEl.dd;\n  el.css('width', `${this.widthFn()}px`);\n  const elBox = el.box();\n\n  let sumWidth = 160;\n  let sumWidth2 = 12;\n  const list1 = [];\n  const list2 = [];\n  btns2.forEach(([it, w], index) => {\n    sumWidth += w;\n    if (index === btns2.length - 1 || sumWidth < elBox.width) {\n      list1.push(it);\n    } else {\n      sumWidth2 += w;\n      list2.push(it);\n    }\n  });\n  btns.html('').children(...list1);\n  moreBtns.html('').children(...list2);\n  contentEl.css('width', `${sumWidth2}px`);\n  if (list2.length > 0) {\n    moreEl.show();\n  } else {\n    moreEl.hide();\n  }\n}\n\nfunction genBtn(it) {\n  const btn = new Item();\n  btn.el.on('click', () => {\n    if (it.onClick) it.onClick(this.data.getData(), this.data);\n  });\n  btn.tip = it.tip || '';\n\n  let { el } = it;\n\n  if (it.icon) {\n    el = h('img').attr('src', it.icon);\n  }\n\n  if (el) {\n    const icon = h('div', `${cssPrefix}-icon`);\n    icon.child(el);\n    btn.el.child(icon);\n  }\n\n  return btn;\n}\n\nexport default class Toolbar {\n  constructor(data, widthFn, isHide = false) {\n    this.data = data;\n    this.change = () => {};\n    this.widthFn = widthFn;\n    this.isHide = isHide;\n    const style = data.defaultStyle();\n    this.items = [\n      [\n        this.undoEl = new Undo(),\n        this.redoEl = new Redo(),\n        new Print(),\n        this.paintformatEl = new Paintformat(),\n        this.clearformatEl = new Clearformat(),\n      ],\n      buildDivider(),\n      [\n        this.formatEl = new Format(),\n      ],\n      buildDivider(),\n      [\n        this.fontEl = new Font(),\n        this.fontSizeEl = new FontSize(),\n      ],\n      buildDivider(),\n      [\n        this.boldEl = new Bold(),\n        this.italicEl = new Italic(),\n        this.underlineEl = new Underline(),\n        this.strikeEl = new Strike(),\n        this.textColorEl = new TextColor(style.color),\n      ],\n      buildDivider(),\n      [\n        this.fillColorEl = new FillColor(style.bgcolor),\n        this.borderEl = new Border(),\n        this.mergeEl = new Merge(),\n      ],\n      buildDivider(),\n      [\n        this.alignEl = new Align(style.align),\n        this.valignEl = new Valign(style.valign),\n        this.textwrapEl = new Textwrap(),\n      ],\n      buildDivider(),\n      [\n        this.freezeEl = new Freeze(),\n        this.autofilterEl = new Autofilter(),\n        this.formulaEl = new Formula(),\n      ],\n    ];\n\n    const { extendToolbar = {} } = data.settings;\n\n    if (extendToolbar.left && extendToolbar.left.length > 0) {\n      this.items.unshift(buildDivider());\n      const btns = extendToolbar.left.map(genBtn.bind(this));\n\n      this.items.unshift(btns);\n    }\n    if (extendToolbar.right && extendToolbar.right.length > 0) {\n      this.items.push(buildDivider());\n      const btns = extendToolbar.right.map(genBtn.bind(this));\n      this.items.push(btns);\n    }\n\n    this.items.push([this.moreEl = new More()]);\n\n    this.el = h('div', `${cssPrefix}-toolbar`);\n    this.btns = h('div', `${cssPrefix}-toolbar-btns`);\n\n    this.items.forEach((it) => {\n      if (Array.isArray(it)) {\n        it.forEach((i) => {\n          this.btns.child(i.el);\n          i.change = (...args) => {\n            this.change(...args);\n          };\n        });\n      } else {\n        this.btns.child(it.el);\n      }\n    });\n\n    this.el.child(this.btns);\n    if (isHide) {\n      this.el.hide();\n    } else {\n      this.reset();\n      setTimeout(() => {\n        initBtns2.call(this);\n        moreResize.call(this);\n      }, 0);\n      bind(window, 'resize', () => {\n        moreResize.call(this);\n      });\n    }\n  }\n\n  paintformatActive() {\n    return this.paintformatEl.active();\n  }\n\n  paintformatToggle() {\n    this.paintformatEl.toggle();\n  }\n\n  trigger(type) {\n    this[`${type}El`].click();\n  }\n\n  resetData(data) {\n    this.data = data;\n    this.reset();\n  }\n\n  reset() {\n    if (this.isHide) return;\n    const { data } = this;\n    const style = data.getSelectedCellStyle();\n    // console.log('canUndo:', data.canUndo());\n    this.undoEl.setState(!data.canUndo());\n    this.redoEl.setState(!data.canRedo());\n    this.mergeEl.setState(data.canUnmerge(), !data.selector.multiple());\n    this.autofilterEl.setState(!data.canAutofilter());\n    // this.mergeEl.disabled();\n    // console.log('selectedCell:', style, cell);\n    const { font, format } = style;\n    this.formatEl.setState(format);\n    this.fontEl.setState(font.name);\n    this.fontSizeEl.setState(font.size);\n    this.boldEl.setState(font.bold);\n    this.italicEl.setState(font.italic);\n    this.underlineEl.setState(style.underline);\n    this.strikeEl.setState(style.strike);\n    this.textColorEl.setState(style.color);\n    this.fillColorEl.setState(style.bgcolor);\n    this.alignEl.setState(style.align);\n    this.valignEl.setState(style.valign);\n    this.textwrapEl.setState(style.textwrap);\n    // console.log('freeze is Active:', data.freezeIsActive());\n    this.freezeEl.setState(data.freezeIsActive());\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/italic.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Italic extends ToggleItem {\n  constructor() {\n    super('font-italic', 'Ctrl+I');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/item.js",
    "content": "import { cssPrefix } from '../../config';\nimport tooltip from '../tooltip';\nimport { h } from '../element';\nimport { t } from '../../locale/locale';\n\nexport default class Item {\n  // tooltip\n  // tag: the subclass type\n  // shortcut: shortcut key\n  constructor(tag, shortcut, value) {\n    this.tip = '';\n    if (tag) this.tip = t(`toolbar.${tag.replace(/-[a-z]/g, c => c[1].toUpperCase())}`);\n    if (shortcut) this.tip += ` (${shortcut})`;\n    this.tag = tag;\n    this.shortcut = shortcut;\n    this.value = value;\n    this.el = this.element();\n    this.change = () => {};\n  }\n\n  element() {\n    const { tip } = this;\n    return h('div', `${cssPrefix}-toolbar-btn`)\n      .on('mouseenter', (evt) => {\n        if (this.tip) tooltip(this.tip, evt.target);\n      })\n      .attr('data-tooltip', tip);\n  }\n\n  setState() {}\n}\n"
  },
  {
    "path": "src/component/toolbar/merge.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Merge extends ToggleItem {\n  constructor() {\n    super('merge');\n  }\n\n  setState(active, disabled) {\n    this.el.active(active).disabled(disabled);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/more.js",
    "content": "import Dropdown from '../dropdown';\nimport DropdownItem from './dropdown_item';\n\nimport { cssPrefix } from '../../config';\nimport { h } from '../element';\nimport Icon from '../icon';\n\nclass DropdownMore extends Dropdown {\n  constructor() {\n    const icon = new Icon('ellipsis');\n    const moreBtns = h('div', `${cssPrefix}-toolbar-more`);\n    super(icon, 'auto', false, 'bottom-right', moreBtns);\n    this.moreBtns = moreBtns;\n    this.contentEl.css('max-width', '420px');\n  }\n}\n\nexport default class More extends DropdownItem {\n  constructor() {\n    super('more');\n    this.el.hide();\n  }\n\n  dropdown() {\n    return new DropdownMore();\n  }\n\n  show() {\n    this.el.show();\n  }\n\n  hide() {\n    this.el.hide();\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/paintformat.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Paintformat extends ToggleItem {\n  constructor() {\n    super('paintformat');\n  }\n\n  setState() {}\n}\n"
  },
  {
    "path": "src/component/toolbar/print.js",
    "content": "import IconItem from './icon_item';\n\nexport default class Print extends IconItem {\n  constructor() {\n    super('print', 'Ctrl+P');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/redo.js",
    "content": "import IconItem from './icon_item';\n\nexport default class Redo extends IconItem {\n  constructor() {\n    super('redo', 'Ctrl+Y');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/strike.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Strike extends ToggleItem {\n  constructor() {\n    super('strike', 'Ctrl+U');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/text_color.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownColor from '../dropdown_color';\n\nexport default class TextColor extends DropdownItem {\n  constructor(color) {\n    super('color', undefined, color);\n  }\n\n  dropdown() {\n    const { tag, value } = this;\n    return new DropdownColor(tag, value);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/textwrap.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Textwrap extends ToggleItem {\n  constructor() {\n    super('textwrap');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/toggle_item.js",
    "content": "import Item from './item';\nimport Icon from '../icon';\n\nexport default class ToggleItem extends Item {\n  element() {\n    const { tag } = this;\n    return super.element()\n      .child(new Icon(tag))\n      .on('click', () => this.click());\n  }\n\n  click() {\n    this.change(this.tag, this.toggle());\n  }\n\n  setState(active) {\n    this.el.active(active);\n  }\n\n  toggle() {\n    return this.el.toggle();\n  }\n\n  active() {\n    return this.el.hasClass('active');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/underline.js",
    "content": "import ToggleItem from './toggle_item';\n\nexport default class Underline extends ToggleItem {\n  constructor() {\n    super('underline', 'Ctrl+U');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/undo.js",
    "content": "import IconItem from './icon_item';\n\nexport default class Undo extends IconItem {\n  constructor() {\n    super('undo', 'Ctrl+Z');\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar/valign.js",
    "content": "import DropdownItem from './dropdown_item';\nimport DropdownAlign from '../dropdown_align';\n\nexport default class Valign extends DropdownItem {\n  constructor(value) {\n    super('valign', '', value);\n  }\n\n  dropdown() {\n    const { value } = this;\n    return new DropdownAlign(['top', 'middle', 'bottom'], value);\n  }\n}\n"
  },
  {
    "path": "src/component/toolbar.js",
    "content": "/* global window */\nimport { h } from './element';\nimport { bind } from './event';\nimport tooltip from './tooltip';\nimport DropdownFont from './dropdown_font';\nimport DropdownFontSize from './dropdown_fontsize';\nimport DropdownFormat from './dropdown_format';\nimport DropdownFormula from './dropdown_formula';\nimport DropdownColor from './dropdown_color';\nimport DropdownAlign from './dropdown_align';\nimport DropdownBorder from './dropdown_border';\nimport Dropdown from './dropdown';\nimport Icon from './icon';\nimport { cssPrefix } from '../config';\nimport { t } from '../locale/locale';\n\nfunction buildIcon(name) {\n  return new Icon(name);\n}\n\nfunction buildButton(tooltipdata) {\n  return h('div', `${cssPrefix}-toolbar-btn`)\n    .on('mouseenter', (evt) => {\n      tooltip(tooltipdata, evt.target);\n    })\n    .attr('data-tooltip', tooltipdata);\n}\n\nfunction buildDivider() {\n  return h('div', `${cssPrefix}-toolbar-divider`);\n}\n\nfunction buildButtonWithIcon(tooltipdata, iconName, change = () => {}) {\n  return buildButton(tooltipdata)\n    .child(buildIcon(iconName))\n    .on('click', () => change());\n}\n\nfunction bindDropdownChange() {\n  this.ddFormat.change = it => this.change('format', it.key);\n  this.ddFont.change = it => this.change('font-name', it.key);\n  this.ddFormula.change = it => this.change('formula', it.key);\n  this.ddFontSize.change = it => this.change('font-size', it.pt);\n  this.ddTextColor.change = it => this.change('color', it);\n  this.ddFillColor.change = it => this.change('bgcolor', it);\n  this.ddAlign.change = it => this.change('align', it);\n  this.ddVAlign.change = it => this.change('valign', it);\n  this.ddBorder.change = it => this.change('border', it);\n}\n\n\nfunction toggleChange(type) {\n  let elName = type;\n  const types = type.split('-');\n  if (types.length > 1) {\n    types.forEach((it, i) => {\n      if (i === 0) elName = it;\n      else elName += it[0].toUpperCase() + it.substring(1);\n    });\n  }\n  const el = this[`${elName}El`];\n  el.toggle();\n  this.change(type, el.hasClass('active'));\n}\n\nclass DropdownMore extends Dropdown {\n  constructor() {\n    const icon = new Icon('ellipsis');\n    const moreBtns = h('div', `${cssPrefix}-toolbar-more`);\n    super(icon, 'auto', false, 'bottom-right', moreBtns);\n    this.moreBtns = moreBtns;\n    this.contentEl.css('max-width', '420px');\n  }\n}\n\nfunction initBtns2() {\n  this.btns2 = this.btnChildren.map((it) => {\n    const rect = it.box();\n    const { marginLeft, marginRight } = it.computedStyle();\n    return [it, rect.width + parseInt(marginLeft, 10) + parseInt(marginRight, 10)];\n  });\n}\n\nfunction moreResize() {\n  const {\n    el, btns, moreEl, ddMore, btns2,\n  } = this;\n  const { moreBtns, contentEl } = ddMore;\n  el.css('width', `${this.widthFn() - 60}px`);\n  const elBox = el.box();\n\n  let sumWidth = 160;\n  let sumWidth2 = 12;\n  const list1 = [];\n  const list2 = [];\n  btns2.forEach(([it, w], index) => {\n    sumWidth += w;\n    if (index === btns2.length - 1 || sumWidth < elBox.width) {\n      list1.push(it);\n    } else {\n      sumWidth2 += w;\n      list2.push(it);\n    }\n  });\n  btns.html('').children(...list1);\n  moreBtns.html('').children(...list2);\n  contentEl.css('width', `${sumWidth2}px`);\n  if (list2.length > 0) {\n    moreEl.show();\n  } else {\n    moreEl.hide();\n  }\n}\n\nexport default class Toolbar {\n  constructor(data, widthFn, isHide = false) {\n    this.data = data;\n    this.change = () => {};\n    this.widthFn = widthFn;\n    const style = data.defaultStyle();\n    // console.log('data:', data);\n    this.ddFormat = new DropdownFormat();\n    this.ddFont = new DropdownFont();\n    this.ddFormula = new DropdownFormula();\n    this.ddFontSize = new DropdownFontSize();\n    this.ddTextColor = new DropdownColor('text-color', style.color);\n    this.ddFillColor = new DropdownColor('fill-color', style.bgcolor);\n    this.ddAlign = new DropdownAlign(['left', 'center', 'right'], style.align);\n    this.ddVAlign = new DropdownAlign(['top', 'middle', 'bottom'], style.valign);\n    this.ddBorder = new DropdownBorder();\n    this.ddMore = new DropdownMore();\n    this.btnChildren = [\n      this.undoEl = buildButtonWithIcon(`${t('toolbar.undo')} (Ctrl+Z)`, 'undo', () => this.change('undo')),\n      this.redoEl = buildButtonWithIcon(`${t('toolbar.undo')} (Ctrl+Y)`, 'redo', () => this.change('redo')),\n      // this.printEl = buildButtonWithIcon('Print (Ctrl+P)', 'print', () => this.change('print')),\n      this.paintformatEl = buildButtonWithIcon(`${t('toolbar.paintformat')}`, 'paintformat', () => toggleChange.call(this, 'paintformat')),\n      this.clearformatEl = buildButtonWithIcon(`${t('toolbar.clearformat')}`, 'clearformat', () => this.change('clearformat')),\n      buildDivider(),\n      buildButton(`${t('toolbar.format')}`).child(this.ddFormat.el),\n      buildDivider(),\n      buildButton(`${t('toolbar.font')}`).child(this.ddFont.el),\n      buildButton(`${t('toolbar.fontSize')}`).child(this.ddFontSize.el),\n      buildDivider(),\n      this.fontBoldEl = buildButtonWithIcon(`${t('toolbar.fontBold')} (Ctrl+B)`, 'bold', () => toggleChange.call(this, 'font-bold')),\n      this.fontItalicEl = buildButtonWithIcon(`${t('toolbar.fontItalic')} (Ctrl+I)`, 'italic', () => toggleChange.call(this, 'font-italic')),\n      this.underlineEl = buildButtonWithIcon(`${t('toolbar.underline')} (Ctrl+U)`, 'underline', () => toggleChange.call(this, 'underline')),\n      this.strikeEl = buildButtonWithIcon(`${t('toolbar.strike')}`, 'strike', () => toggleChange.call(this, 'strike')),\n      buildButton(`${t('toolbar.textColor')}`).child(this.ddTextColor.el),\n      buildDivider(),\n      buildButton(`${t('toolbar.fillColor')}`).child(this.ddFillColor.el),\n      buildButton(`${t('toolbar.border')}`).child(this.ddBorder.el),\n      this.mergeEl = buildButtonWithIcon(`${t('toolbar.merge')}`, 'merge', () => toggleChange.call(this, 'merge')),\n      buildDivider(),\n      buildButton(`${t('toolbar.align')}`).child(this.ddAlign.el),\n      buildButton(`${t('toolbar.valign')}`).child(this.ddVAlign.el),\n      this.textwrapEl = buildButtonWithIcon(`${t('toolbar.textwrap')}`, 'textwrap', () => toggleChange.call(this, 'textwrap')),\n      buildDivider(),\n      // this.linkEl = buildButtonWithIcon('Insert link', 'link'),\n      // this.chartEl = buildButtonWithIcon('Insert chart', 'chart'),\n      this.freezeEl = buildButtonWithIcon(`${t('toolbar.freeze')}`, 'freeze', () => toggleChange.call(this, 'freeze')),\n      this.autofilterEl = buildButtonWithIcon(`${t('toolbar.autofilter')}`, 'autofilter', () => toggleChange.call(this, 'autofilter')),\n      buildButton(`${t('toolbar.formula')}`).child(this.ddFormula.el),\n      // buildDivider(),\n      this.moreEl = buildButton(`${t('toolbar.more')}`).child(this.ddMore.el).hide(),\n    ];\n    this.el = h('div', `${cssPrefix}-toolbar`);\n    this.btns = h('div', `${cssPrefix}-toolbar-btns`).children(...this.btnChildren);\n    this.el.child(this.btns);\n    if (isHide) this.el.hide();\n    bindDropdownChange.call(this);\n    this.reset();\n    setTimeout(() => {\n      initBtns2.call(this);\n      moreResize.call(this);\n    }, 0);\n    bind(window, 'resize', () => {\n      moreResize.call(this);\n    });\n  }\n\n  paintformatActive() {\n    return this.paintformatEl.hasClass('active');\n  }\n\n  paintformatToggle() {\n    this.paintformatEl.toggle();\n  }\n\n  trigger(type) {\n    toggleChange.call(this, type);\n  }\n\n  reset() {\n    const { data } = this;\n    const style = data.getSelectedCellStyle();\n    const cell = data.getSelectedCell();\n    // console.log('canUndo:', data.canUndo());\n    this.undoEl.disabled(!data.canUndo());\n    this.redoEl.disabled(!data.canRedo());\n    this.mergeEl.active(data.canUnmerge())\n      .disabled(!data.selector.multiple());\n    this.autofilterEl.active(!data.canAutofilter());\n    // this.mergeEl.disabled();\n    // console.log('selectedCell:', style, cell);\n    const { font } = style;\n    this.ddFont.setTitle(font.name);\n    this.ddFontSize.setTitle(font.size);\n    this.fontBoldEl.active(font.bold);\n    this.fontItalicEl.active(font.italic);\n    this.underlineEl.active(style.underline);\n    this.strikeEl.active(style.strike);\n    this.ddTextColor.setTitle(style.color);\n    this.ddFillColor.setTitle(style.bgcolor);\n    this.ddAlign.setTitle(style.align);\n    this.ddVAlign.setTitle(style.valign);\n    this.textwrapEl.active(style.textwrap);\n    // console.log('freeze is Active:', data.freezeIsActive());\n    this.freezeEl.active(data.freezeIsActive());\n    if (cell) {\n      if (cell.format) {\n        this.ddFormat.setTitle(cell.format);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/component/tooltip.js",
    "content": "/* global document */\nimport { h } from './element';\nimport { bind } from './event';\nimport { cssPrefix } from '../config';\n\nexport default function tooltip(html, target) {\n  if (target.classList.contains('active')) {\n    return;\n  }\n  const {\n    left, top, width, height,\n  } = target.getBoundingClientRect();\n  const el = h('div', `${cssPrefix}-tooltip`).html(html).show();\n  document.body.appendChild(el.el);\n  const elBox = el.box();\n  // console.log('elBox:', elBox);\n  el.css('left', `${left + (width / 2) - (elBox.width / 2)}px`)\n    .css('top', `${top + height + 2}px`);\n\n  bind(target, 'mouseleave', () => {\n    if (document.body.contains(el.el)) {\n      document.body.removeChild(el.el);\n    }\n  });\n\n  bind(target, 'click', () => {\n    if (document.body.contains(el.el)) {\n      document.body.removeChild(el.el);\n    }\n  });\n}\n"
  },
  {
    "path": "src/config.js",
    "content": "/* global window */\nexport const cssPrefix = 'x-spreadsheet';\nexport const dpr = window.devicePixelRatio || 1;\nexport default {\n  cssPrefix,\n  dpr,\n};\n"
  },
  {
    "path": "src/core/_.prototypes.js",
    "content": "// font.js\n/**\n * @typedef {number} fontsizePX px for fontSize\n */\n/**\n * @typedef {number} fontsizePT pt for fontSize\n */\n/**\n * @typedef {object} BaseFont\n * @property {string} key inner key\n * @property {string} title title for display\n */\n\n/**\n * @typedef {object} FontSize\n * @property {fontsizePT} pt\n * @property {fontsizePX} px\n */\n\n// alphabet.js\n/**\n * @typedef {string} tagA1 A1 tag for XY-tag (0, 0)\n * @example \"A1\"\n */\n/**\n * @typedef {[number, number]} tagXY\n * @example [0, 0]\n */\n"
  },
  {
    "path": "src/core/alphabet.js",
    "content": "import './_.prototypes';\n\nconst alphabets = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];\n\n/** index number 2 letters\n * @example stringAt(26) ==> 'AA'\n * @date 2019-10-10\n * @export\n * @param {number} index\n * @returns {string}\n */\nexport function stringAt(index) {\n  let str = '';\n  let cindex = index;\n  while (cindex >= alphabets.length) {\n    cindex /= alphabets.length;\n    cindex -= 1;\n    str += alphabets[parseInt(cindex, 10) % alphabets.length];\n  }\n  const last = index % alphabets.length;\n  str += alphabets[last];\n  return str;\n}\n\n/** translate letter in A1-tag to number\n * @date 2019-10-10\n * @export\n * @param {string} str \"AA\" in A1-tag \"AA1\"\n * @returns {number}\n */\nexport function indexAt(str) {\n  let ret = 0;\n  for(let i = 0; i !== str.length; ++i) ret = 26 * ret + str.charCodeAt(i) - 64;\n  return ret - 1;\n}\n\n\n// B10 => x,y\n/** translate A1-tag to XY-tag\n * @date 2019-10-10\n * @export\n * @param {tagA1} src\n * @returns {tagXY}\n */\nexport function expr2xy(src) {\n  let x = '';\n  let y = '';\n  for (let i = 0; i < src.length; i += 1) {\n    if (src.charAt(i) >= '0' && src.charAt(i) <= '9') {\n      y += src.charAt(i);\n    } else {\n      x += src.charAt(i);\n    }\n  }\n  return [indexAt(x), parseInt(y, 10) - 1];\n}\n\n/** translate XY-tag to A1-tag\n * @example x,y => B10\n * @date 2019-10-10\n * @export\n * @param {number} x\n * @param {number} y\n * @returns {tagA1}\n */\nexport function xy2expr(x, y) {\n  return `${stringAt(x)}${y + 1}`;\n}\n\n/** translate A1-tag src by (xn, yn)\n * @date 2019-10-10\n * @export\n * @param {tagA1} src\n * @param {number} xn\n * @param {number} yn\n * @returns {tagA1}\n */\nexport function expr2expr(src, xn, yn, condition = () => true) {\n  if (xn === 0 && yn === 0) return src;\n  const [x, y] = expr2xy(src);\n  if (!condition(x, y)) return src;\n  return xy2expr(x + xn, y + yn);\n}\n\nexport default {\n  stringAt,\n  indexAt,\n  expr2xy,\n  xy2expr,\n  expr2expr,\n};\n"
  },
  {
    "path": "src/core/auto_filter.js",
    "content": "import { CellRange } from './cell_range';\n// operator: all|eq|neq|gt|gte|lt|lte|in|be\n// value:\n//   in => []\n//   be => [min, max]\nclass Filter {\n  constructor(ci, operator, value) {\n    this.ci = ci;\n    this.operator = operator;\n    this.value = value;\n  }\n\n  set(operator, value) {\n    this.operator = operator;\n    this.value = value;\n  }\n\n  includes(v) {\n    const { operator, value } = this;\n    if (operator === 'all') {\n      return true;\n    }\n    if (operator === 'in') {\n      return value.includes(v);\n    }\n    return false;\n  }\n\n  vlength() {\n    const { operator, value } = this;\n    if (operator === 'in') {\n      return value.length;\n    }\n    return 0;\n  }\n\n  getData() {\n    const { ci, operator, value } = this;\n    return { ci, operator, value };\n  }\n}\n\nclass Sort {\n  constructor(ci, order) {\n    this.ci = ci;\n    this.order = order;\n  }\n\n  asc() {\n    return this.order === 'asc';\n  }\n\n  desc() {\n    return this.order === 'desc';\n  }\n}\n\nexport default class AutoFilter {\n  constructor() {\n    this.ref = null;\n    this.filters = [];\n    this.sort = null;\n  }\n\n  setData({ ref, filters, sort }) {\n    if (ref != null) {\n      this.ref = ref;\n      this.filters = filters.map(it => new Filter(it.ci, it.operator, it.value));\n      if (sort) {\n        this.sort = new Sort(sort.ci, sort.order);\n      }\n    }\n  }\n\n  getData() {\n    if (this.active()) {\n      const { ref, filters, sort } = this;\n      return { ref, filters: filters.map(it => it.getData()), sort };\n    }\n    return {};\n  }\n\n  addFilter(ci, operator, value) {\n    const filter = this.getFilter(ci);\n    if (filter == null) {\n      this.filters.push(new Filter(ci, operator, value));\n    } else {\n      filter.set(operator, value);\n    }\n  }\n\n  setSort(ci, order) {\n    this.sort = order ? new Sort(ci, order) : null;\n  }\n\n  includes(ri, ci) {\n    if (this.active()) {\n      return this.hrange().includes(ri, ci);\n    }\n    return false;\n  }\n\n  getSort(ci) {\n    const { sort } = this;\n    if (sort && sort.ci === ci) {\n      return sort;\n    }\n    return null;\n  }\n\n  getFilter(ci) {\n    const { filters } = this;\n    for (let i = 0; i < filters.length; i += 1) {\n      if (filters[i].ci === ci) {\n        return filters[i];\n      }\n    }\n    return null;\n  }\n\n  filteredRows(getCell) {\n    // const ary = [];\n    // let lastri = 0;\n    const rset = new Set();\n    const fset = new Set();\n    if (this.active()) {\n      const { sri, eri } = this.range();\n      const { filters } = this;\n      for (let ri = sri + 1; ri <= eri; ri += 1) {\n        for (let i = 0; i < filters.length; i += 1) {\n          const filter = filters[i];\n          const cell = getCell(ri, filter.ci);\n          const ctext = cell ? cell.text : '';\n          if (!filter.includes(ctext)) {\n            rset.add(ri);\n            break;\n          } else {\n            fset.add(ri);\n          }\n        }\n      }\n    }\n    return { rset, fset };\n  }\n\n  items(ci, getCell) {\n    const m = {};\n    if (this.active()) {\n      const { sri, eri } = this.range();\n      for (let ri = sri + 1; ri <= eri; ri += 1) {\n        const cell = getCell(ri, ci);\n        if (cell !== null && !/^\\s*$/.test(cell.text)) {\n          const key = cell.text;\n          const cnt = (m[key] || 0) + 1;\n          m[key] = cnt;\n        } else {\n          m[''] = (m[''] || 0) + 1;\n        }\n      }\n    }\n    return m;\n  }\n\n  range() {\n    return CellRange.valueOf(this.ref);\n  }\n\n  hrange() {\n    const r = this.range();\n    r.eri = r.sri;\n    return r;\n  }\n\n  clear() {\n    this.ref = null;\n    this.filters = [];\n    this.sort = null;\n  }\n\n  active() {\n    return this.ref !== null;\n  }\n}\n"
  },
  {
    "path": "src/core/cell.js",
    "content": "import { expr2xy, xy2expr } from './alphabet';\nimport { numberCalc } from './helper';\n\n// Converting infix expression to a suffix expression\n// src: AVERAGE(SUM(A1,A2), B1) + 50 + B20\n// return: [A1, A2], SUM[, B1],AVERAGE,50,+,B20,+\nconst infixExprToSuffixExpr = (src) => {\n  const operatorStack = [];\n  const stack = [];\n  let subStrs = []; // SUM, A1, B2, 50 ...\n  let fnArgType = 0; // 1 => , 2 => :\n  let fnArgOperator = '';\n  let fnArgsLen = 1; // A1,A2,A3...\n  let oldc = '';\n  for (let i = 0; i < src.length; i += 1) {\n    const c = src.charAt(i);\n    if (c !== ' ') {\n      if (c >= 'a' && c <= 'z') {\n        subStrs.push(c.toUpperCase());\n      } else if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || c === '.') {\n        subStrs.push(c);\n      } else if (c === '\"') {\n        i += 1;\n        while (src.charAt(i) !== '\"') {\n          subStrs.push(src.charAt(i));\n          i += 1;\n        }\n        stack.push(`\"${subStrs.join('')}`);\n        subStrs = [];\n      } else if (c === '-' && /[+\\-*/,(]/.test(oldc)) {\n        subStrs.push(c);\n      } else {\n        // console.log('subStrs:', subStrs.join(''), stack);\n        if (c !== '(' && subStrs.length > 0) {\n          stack.push(subStrs.join(''));\n        }\n        if (c === ')') {\n          let c1 = operatorStack.pop();\n          if (fnArgType === 2) {\n            // fn argument range => A1:B5\n            try {\n              const [ex, ey] = expr2xy(stack.pop());\n              const [sx, sy] = expr2xy(stack.pop());\n              // console.log('::', sx, sy, ex, ey);\n              let rangelen = 0;\n              for (let x = sx; x <= ex; x += 1) {\n                for (let y = sy; y <= ey; y += 1) {\n                  stack.push(xy2expr(x, y));\n                  rangelen += 1;\n                }\n              }\n              stack.push([c1, rangelen]);\n            } catch (e) {\n              // console.log(e);\n            }\n          } else if (fnArgType === 1 || fnArgType === 3) {\n            if (fnArgType === 3) stack.push(fnArgOperator);\n            // fn argument => A1,A2,B5\n            stack.push([c1, fnArgsLen]);\n            fnArgsLen = 1;\n          } else {\n            // console.log('c1:', c1, fnArgType, stack, operatorStack);\n            while (c1 !== '(') {\n              stack.push(c1);\n              if (operatorStack.length <= 0) break;\n              c1 = operatorStack.pop();\n            }\n          }\n          fnArgType = 0;\n        } else if (c === '=' || c === '>' || c === '<') {\n          const nc = src.charAt(i + 1);\n          fnArgOperator = c;\n          if (nc === '=' || nc === '-') {\n            fnArgOperator += nc;\n            i += 1;\n          }\n          fnArgType = 3;\n        } else if (c === ':') {\n          fnArgType = 2;\n        } else if (c === ',') {\n          if (fnArgType === 3) {\n            stack.push(fnArgOperator);\n          }\n          fnArgType = 1;\n          fnArgsLen += 1;\n        } else if (c === '(' && subStrs.length > 0) {\n          // function\n          operatorStack.push(subStrs.join(''));\n        } else {\n          // priority: */ > +-\n          // console.log('xxxx:', operatorStack, c, stack);\n          if (operatorStack.length > 0 && (c === '+' || c === '-')) {\n            let top = operatorStack[operatorStack.length - 1];\n            if (top !== '(') stack.push(operatorStack.pop());\n            if (top === '*' || top === '/') {\n              while (operatorStack.length > 0) {\n                top = operatorStack[operatorStack.length - 1];\n                if (top !== '(') stack.push(operatorStack.pop());\n                else break;\n              }\n            }\n          } else if (operatorStack.length > 0) {\n            const top = operatorStack[operatorStack.length - 1];\n            if (top === '*' || top === '/') stack.push(operatorStack.pop());\n          }\n          operatorStack.push(c);\n        }\n        subStrs = [];\n      }\n      oldc = c;\n    }\n  }\n  if (subStrs.length > 0) {\n    stack.push(subStrs.join(''));\n  }\n  while (operatorStack.length > 0) {\n    stack.push(operatorStack.pop());\n  }\n  return stack;\n};\n\nconst evalSubExpr = (subExpr, cellRender) => {\n  const [fl] = subExpr;\n  let expr = subExpr;\n  if (fl === '\"') {\n    return subExpr.substring(1);\n  }\n  let ret = 1;\n  if (fl === '-') {\n    expr = subExpr.substring(1);\n    ret = -1;\n  }\n  if (expr[0] >= '0' && expr[0] <= '9') {\n    return ret * Number(expr);\n  }\n  const [x, y] = expr2xy(expr);\n  return ret * cellRender(x, y);\n};\n\n// evaluate the suffix expression\n// srcStack: <= infixExprToSufixExpr\n// formulaMap: {'SUM': {}, ...}\n// cellRender: (x, y) => {}\nconst evalSuffixExpr = (srcStack, formulaMap, cellRender, cellList) => {\n  const stack = [];\n  // console.log(':::::formulaMap:', formulaMap);\n  for (let i = 0; i < srcStack.length; i += 1) {\n    // console.log(':::>>>', srcStack[i]);\n    const expr = srcStack[i];\n    const fc = expr[0];\n    if (expr === '+') {\n      const top = stack.pop();\n      stack.push(numberCalc('+', stack.pop(), top));\n    } else if (expr === '-') {\n      if (stack.length === 1) {\n        const top = stack.pop();\n        stack.push(numberCalc('*', top, -1));\n      } else {\n        const top = stack.pop();\n        stack.push(numberCalc('-', stack.pop(), top));\n      }\n    } else if (expr === '*') {\n      stack.push(numberCalc('*', stack.pop(), stack.pop()));\n    } else if (expr === '/') {\n      const top = stack.pop();\n      stack.push(numberCalc('/', stack.pop(), top));\n    } else if (fc === '=' || fc === '>' || fc === '<') {\n      let top = stack.pop();\n      if (!Number.isNaN(top)) top = Number(top);\n      let left = stack.pop();\n      if (!Number.isNaN(left)) left = Number(left);\n      let ret = false;\n      if (fc === '=') {\n        ret = (left === top);\n      } else if (expr === '>') {\n        ret = (left > top);\n      } else if (expr === '>=') {\n        ret = (left >= top);\n      } else if (expr === '<') {\n        ret = (left < top);\n      } else if (expr === '<=') {\n        ret = (left <= top);\n      }\n      stack.push(ret);\n    } else if (Array.isArray(expr)) {\n      const [formula, len] = expr;\n      const params = [];\n      for (let j = 0; j < len; j += 1) {\n        params.push(stack.pop());\n      }\n      stack.push(formulaMap[formula].render(params.reverse()));\n    } else {\n      if (cellList.includes(expr)) {\n        return 0;\n      }\n      if ((fc >= 'a' && fc <= 'z') || (fc >= 'A' && fc <= 'Z')) {\n        cellList.push(expr);\n      }\n      stack.push(evalSubExpr(expr, cellRender));\n      cellList.pop();\n    }\n    // console.log('stack:', stack);\n  }\n  return stack[0];\n};\n\nconst cellRender = (src, formulaMap, getCellText, cellList = []) => {\n  if (src[0] === '=') {\n    const stack = infixExprToSuffixExpr(src.substring(1));\n    if (stack.length <= 0) return src;\n    return evalSuffixExpr(\n      stack,\n      formulaMap,\n      (x, y) => cellRender(getCellText(x, y), formulaMap, getCellText, cellList),\n      cellList,\n    );\n  }\n  return src;\n};\n\nexport default {\n  render: cellRender,\n};\nexport {\n  infixExprToSuffixExpr,\n};\n"
  },
  {
    "path": "src/core/cell_range.js",
    "content": "import { xy2expr, expr2xy } from './alphabet';\n\nclass CellRange {\n  constructor(sri, sci, eri, eci, w = 0, h = 0) {\n    this.sri = sri;\n    this.sci = sci;\n    this.eri = eri;\n    this.eci = eci;\n    this.w = w;\n    this.h = h;\n  }\n\n  set(sri, sci, eri, eci) {\n    this.sri = sri;\n    this.sci = sci;\n    this.eri = eri;\n    this.eci = eci;\n  }\n\n  multiple() {\n    return this.eri - this.sri > 0 || this.eci - this.sci > 0;\n  }\n\n  // cell-index: ri, ci\n  // cell-ref: A10\n  includes(...args) {\n    let [ri, ci] = [0, 0];\n    if (args.length === 1) {\n      [ci, ri] = expr2xy(args[0]);\n    } else if (args.length === 2) {\n      [ri, ci] = args;\n    }\n    const {\n      sri, sci, eri, eci,\n    } = this;\n    return sri <= ri && ri <= eri && sci <= ci && ci <= eci;\n  }\n\n  each(cb, rowFilter = () => true) {\n    const {\n      sri, sci, eri, eci,\n    } = this;\n    for (let i = sri; i <= eri; i += 1) {\n      if (rowFilter(i)) {\n        for (let j = sci; j <= eci; j += 1) {\n          cb(i, j);\n        }\n      }\n    }\n  }\n\n  contains(other) {\n    return this.sri <= other.sri\n      && this.sci <= other.sci\n      && this.eri >= other.eri\n      && this.eci >= other.eci;\n  }\n\n  // within\n  within(other) {\n    return this.sri >= other.sri\n      && this.sci >= other.sci\n      && this.eri <= other.eri\n      && this.eci <= other.eci;\n  }\n\n  // disjoint\n  disjoint(other) {\n    return this.sri > other.eri\n      || this.sci > other.eci\n      || other.sri > this.eri\n      || other.sci > this.eci;\n  }\n\n  // intersects\n  intersects(other) {\n    return this.sri <= other.eri\n      && this.sci <= other.eci\n      && other.sri <= this.eri\n      && other.sci <= this.eci;\n  }\n\n  // union\n  union(other) {\n    const {\n      sri, sci, eri, eci,\n    } = this;\n    return new CellRange(\n      other.sri < sri ? other.sri : sri,\n      other.sci < sci ? other.sci : sci,\n      other.eri > eri ? other.eri : eri,\n      other.eci > eci ? other.eci : eci,\n    );\n  }\n\n  // intersection\n  // intersection(other) {}\n\n  // Returns Array<CellRange> that represents that part of this that does not intersect with other\n  // difference\n  difference(other) {\n    const ret = [];\n    const addRet = (sri, sci, eri, eci) => {\n      ret.push(new CellRange(sri, sci, eri, eci));\n    };\n    const {\n      sri, sci, eri, eci,\n    } = this;\n    const dsr = other.sri - sri;\n    const dsc = other.sci - sci;\n    const der = eri - other.eri;\n    const dec = eci - other.eci;\n    if (dsr > 0) {\n      addRet(sri, sci, other.sri - 1, eci);\n      if (der > 0) {\n        addRet(other.eri + 1, sci, eri, eci);\n        if (dsc > 0) {\n          addRet(other.sri, sci, other.eri, other.sci - 1);\n        }\n        if (dec > 0) {\n          addRet(other.sri, other.eci + 1, other.eri, eci);\n        }\n      } else {\n        if (dsc > 0) {\n          addRet(other.sri, sci, eri, other.sci - 1);\n        }\n        if (dec > 0) {\n          addRet(other.sri, other.eci + 1, eri, eci);\n        }\n      }\n    } else if (der > 0) {\n      addRet(other.eri + 1, sci, eri, eci);\n      if (dsc > 0) {\n        addRet(sri, sci, other.eri, other.sci - 1);\n      }\n      if (dec > 0) {\n        addRet(sri, other.eci + 1, other.eri, eci);\n      }\n    }\n    if (dsc > 0) {\n      addRet(sri, sci, eri, other.sci - 1);\n      if (dec > 0) {\n        addRet(sri, other.eri + 1, eri, eci);\n        if (dsr > 0) {\n          addRet(sri, other.sci, other.sri - 1, other.eci);\n        }\n        if (der > 0) {\n          addRet(other.sri + 1, other.sci, eri, other.eci);\n        }\n      } else {\n        if (dsr > 0) {\n          addRet(sri, other.sci, other.sri - 1, eci);\n        }\n        if (der > 0) {\n          addRet(other.sri + 1, other.sci, eri, eci);\n        }\n      }\n    } else if (dec > 0) {\n      addRet(eri, other.eci + 1, eri, eci);\n      if (dsr > 0) {\n        addRet(sri, sci, other.sri - 1, other.eci);\n      }\n      if (der > 0) {\n        addRet(other.eri + 1, sci, eri, other.eci);\n      }\n    }\n    return ret;\n  }\n\n  size() {\n    return [\n      this.eri - this.sri + 1,\n      this.eci - this.sci + 1,\n    ];\n  }\n\n  toString() {\n    const {\n      sri, sci, eri, eci,\n    } = this;\n    let ref = xy2expr(sci, sri);\n    if (this.multiple()) {\n      ref = `${ref}:${xy2expr(eci, eri)}`;\n    }\n    return ref;\n  }\n\n  clone() {\n    const {\n      sri, sci, eri, eci, w, h,\n    } = this;\n    return new CellRange(sri, sci, eri, eci, w, h);\n  }\n\n  /*\n  toJSON() {\n    return this.toString();\n  }\n  */\n\n  equals(other) {\n    return this.eri === other.eri\n      && this.eci === other.eci\n      && this.sri === other.sri\n      && this.sci === other.sci;\n  }\n\n  static valueOf(ref) {\n    // B1:B8, B1 => 1 x 1 cell range\n    const refs = ref.split(':');\n    const [sci, sri] = expr2xy(refs[0]);\n    let [eri, eci] = [sri, sci];\n    if (refs.length > 1) {\n      [eci, eri] = expr2xy(refs[1]);\n    }\n    return new CellRange(sri, sci, eri, eci);\n  }\n}\n\nexport default CellRange;\n\nexport {\n  CellRange,\n};\n"
  },
  {
    "path": "src/core/clipboard.js",
    "content": "export default class Clipboard {\n  constructor() {\n    this.range = null; // CellRange\n    this.state = 'clear';\n  }\n\n  copy(cellRange) {\n    this.range = cellRange;\n    this.state = 'copy';\n    return this;\n  }\n\n  cut(cellRange) {\n    this.range = cellRange;\n    this.state = 'cut';\n    return this;\n  }\n\n  isCopy() {\n    return this.state === 'copy';\n  }\n\n  isCut() {\n    return this.state === 'cut';\n  }\n\n  isClear() {\n    return this.state === 'clear';\n  }\n\n  clear() {\n    this.range = null;\n    this.state = 'clear';\n  }\n}\n"
  },
  {
    "path": "src/core/col.js",
    "content": "import helper from './helper';\n\nclass Cols {\n  constructor({\n    len, width, indexWidth, minWidth,\n  }) {\n    this._ = {};\n    this.len = len;\n    this.width = width;\n    this.indexWidth = indexWidth;\n    this.minWidth = minWidth;\n  }\n\n  setData(d) {\n    if (d.len) {\n      this.len = d.len;\n      delete d.len;\n    }\n    this._ = d;\n  }\n\n  getData() {\n    const { len } = this;\n    return Object.assign({ len }, this._);\n  }\n\n  getWidth(i) {\n    if (this.isHide(i)) return 0;\n    const col = this._[i];\n    if (col && col.width) {\n      return col.width;\n    }\n    return this.width;\n  }\n\n  getOrNew(ci) {\n    this._[ci] = this._[ci] || {};\n    return this._[ci];\n  }\n\n  setWidth(ci, width) {\n    const col = this.getOrNew(ci);\n    col.width = width;\n  }\n\n  unhide(idx) {\n    let index = idx;\n    while (index > 0) {\n      index -= 1;\n      if (this.isHide(index)) {\n        this.setHide(index, false);\n      } else break;\n    }\n  }\n\n  isHide(ci) {\n    const col = this._[ci];\n    return col && col.hide;\n  }\n\n  setHide(ci, v) {\n    const col = this.getOrNew(ci);\n    if (v === true) col.hide = true;\n    else delete col.hide;\n  }\n\n  setStyle(ci, style) {\n    const col = this.getOrNew(ci);\n    col.style = style;\n  }\n\n  sumWidth(min, max) {\n    return helper.rangeSum(min, max, i => this.getWidth(i));\n  }\n\n  totalWidth() {\n    return this.sumWidth(0, this.len);\n  }\n}\n\nexport default {};\nexport {\n  Cols,\n};\n"
  },
  {
    "path": "src/core/data_proxy.js",
    "content": "/* global document */\n\nimport Selector from './selector';\nimport Scroll from './scroll';\nimport History from './history';\nimport Clipboard from './clipboard';\nimport AutoFilter from './auto_filter';\nimport { Merges } from './merge';\nimport helper from './helper';\nimport { Rows } from './row';\nimport { Cols } from './col';\nimport { Validations } from './validation';\nimport { CellRange } from './cell_range';\nimport { expr2xy, xy2expr } from './alphabet';\nimport { t } from '../locale/locale';\n\n// private methods\n/*\n * {\n *  name: ''\n *  freeze: [0, 0],\n *  formats: [],\n *  styles: [\n *    {\n *      bgcolor: '',\n *      align: '',\n *      valign: '',\n *      textwrap: false,\n *      strike: false,\n *      underline: false,\n *      color: '',\n *      format: 1,\n *      border: {\n *        left: [style, color],\n *        right: [style, color],\n *        top: [style, color],\n *        bottom: [style, color],\n *      },\n *      font: {\n *        name: 'Helvetica',\n *        size: 10,\n *        bold: false,\n *        italic: false,\n *      }\n *    }\n *  ],\n *  merges: [\n *    'A1:F11',\n *    ...\n *  ],\n *  rows: {\n *    1: {\n *      height: 50,\n *      style: 1,\n *      cells: {\n *        1: {\n *          style: 2,\n *          type: 'string',\n *          text: '',\n *          value: '', // cal result\n *        }\n *      }\n *    },\n *    ...\n *  },\n *  cols: {\n *    2: { width: 100, style: 1 }\n *  }\n * }\n */\nconst defaultSettings = {\n  mode: 'edit', // edit | read\n  view: {\n    height: () => document.documentElement.clientHeight,\n    width: () => document.documentElement.clientWidth,\n  },\n  showGrid: true,\n  showToolbar: true,\n  showContextmenu: true,\n  showBottomBar: true,\n  row: {\n    len: 100,\n    height: 25,\n  },\n  col: {\n    len: 26,\n    width: 100,\n    indexWidth: 60,\n    minWidth: 60,\n  },\n  style: {\n    bgcolor: '#ffffff',\n    align: 'left',\n    valign: 'middle',\n    textwrap: false,\n    strike: false,\n    underline: false,\n    color: '#0a0a0a',\n    font: {\n      name: 'Arial',\n      size: 10,\n      bold: false,\n      italic: false,\n    },\n    format: 'normal',\n  },\n};\n\nconst toolbarHeight = 41;\nconst bottombarHeight = 41;\n\n// src: cellRange\n// dst: cellRange\nfunction canPaste(src, dst, error = () => {}) {\n  const { merges } = this;\n  const cellRange = dst.clone();\n  const [srn, scn] = src.size();\n  const [drn, dcn] = dst.size();\n  if (srn > drn) {\n    cellRange.eri = dst.sri + srn - 1;\n  }\n  if (scn > dcn) {\n    cellRange.eci = dst.sci + scn - 1;\n  }\n  if (merges.intersects(cellRange)) {\n    error(t('error.pasteForMergedCell'));\n    return false;\n  }\n  return true;\n}\nfunction copyPaste(srcCellRange, dstCellRange, what, autofill = false) {\n  const { rows, merges } = this;\n  // delete dest merge\n  if (what === 'all' || what === 'format') {\n    rows.deleteCells(dstCellRange, what);\n    merges.deleteWithin(dstCellRange);\n  }\n  rows.copyPaste(srcCellRange, dstCellRange, what, autofill, (ri, ci, cell) => {\n    if (cell && cell.merge) {\n      // console.log('cell:', ri, ci, cell);\n      const [rn, cn] = cell.merge;\n      if (rn <= 0 && cn <= 0) return;\n      merges.add(new CellRange(ri, ci, ri + rn, ci + cn));\n    }\n  });\n}\n\nfunction cutPaste(srcCellRange, dstCellRange) {\n  const { clipboard, rows, merges } = this;\n  rows.cutPaste(srcCellRange, dstCellRange);\n  merges.move(srcCellRange,\n    dstCellRange.sri - srcCellRange.sri,\n    dstCellRange.sci - srcCellRange.sci);\n  clipboard.clear();\n}\n\n// bss: { top, bottom, left, right }\nfunction setStyleBorder(ri, ci, bss) {\n  const { styles, rows } = this;\n  const cell = rows.getCellOrNew(ri, ci);\n  let cstyle = {};\n  if (cell.style !== undefined) {\n    cstyle = helper.cloneDeep(styles[cell.style]);\n  }\n  cstyle = helper.merge(cstyle, { border: bss });\n  cell.style = this.addStyle(cstyle);\n}\n\nfunction setStyleBorders({ mode, style, color }) {\n  const { styles, selector, rows } = this;\n  const {\n    sri, sci, eri, eci,\n  } = selector.range;\n  const multiple = !this.isSingleSelected();\n  if (!multiple) {\n    if (mode === 'inside' || mode === 'horizontal' || mode === 'vertical') {\n      return;\n    }\n  }\n  if (mode === 'outside' && !multiple) {\n    setStyleBorder.call(this, sri, sci, {\n      top: [style, color], bottom: [style, color], left: [style, color], right: [style, color],\n    });\n  } else if (mode === 'none') {\n    selector.range.each((ri, ci) => {\n      const cell = rows.getCell(ri, ci);\n      if (cell && cell.style !== undefined) {\n        const ns = helper.cloneDeep(styles[cell.style]);\n        delete ns.border;\n        // ['bottom', 'top', 'left', 'right'].forEach((prop) => {\n        //   if (ns[prop]) delete ns[prop];\n        // });\n        cell.style = this.addStyle(ns);\n      }\n    });\n  } else if (mode === 'all' || mode === 'inside' || mode === 'outside'\n    || mode === 'horizontal' || mode === 'vertical') {\n    const merges = [];\n    for (let ri = sri; ri <= eri; ri += 1) {\n      for (let ci = sci; ci <= eci; ci += 1) {\n        // jump merges -- start\n        const mergeIndexes = [];\n        for (let ii = 0; ii < merges.length; ii += 1) {\n          const [mri, mci, rn, cn] = merges[ii];\n          if (ri === mri + rn + 1) mergeIndexes.push(ii);\n          if (mri <= ri && ri <= mri + rn) {\n            if (ci === mci) {\n              ci += cn + 1;\n              break;\n            }\n          }\n        }\n        mergeIndexes.forEach(it => merges.splice(it, 1));\n        if (ci > eci) break;\n        // jump merges -- end\n        const cell = rows.getCell(ri, ci);\n        let [rn, cn] = [0, 0];\n        if (cell && cell.merge) {\n          [rn, cn] = cell.merge;\n          merges.push([ri, ci, rn, cn]);\n        }\n        const mrl = rn > 0 && ri + rn === eri;\n        const mcl = cn > 0 && ci + cn === eci;\n        let bss = {};\n        if (mode === 'all') {\n          bss = {\n            bottom: [style, color],\n            top: [style, color],\n            left: [style, color],\n            right: [style, color],\n          };\n        } else if (mode === 'inside') {\n          if (!mcl && ci < eci) bss.right = [style, color];\n          if (!mrl && ri < eri) bss.bottom = [style, color];\n        } else if (mode === 'horizontal') {\n          if (!mrl && ri < eri) bss.bottom = [style, color];\n        } else if (mode === 'vertical') {\n          if (!mcl && ci < eci) bss.right = [style, color];\n        } else if (mode === 'outside' && multiple) {\n          if (sri === ri) bss.top = [style, color];\n          if (mrl || eri === ri) bss.bottom = [style, color];\n          if (sci === ci) bss.left = [style, color];\n          if (mcl || eci === ci) bss.right = [style, color];\n        }\n        if (Object.keys(bss).length > 0) {\n          setStyleBorder.call(this, ri, ci, bss);\n        }\n        ci += cn;\n      }\n    }\n  } else if (mode === 'top' || mode === 'bottom') {\n    for (let ci = sci; ci <= eci; ci += 1) {\n      if (mode === 'top') {\n        setStyleBorder.call(this, sri, ci, { top: [style, color] });\n        ci += rows.getCellMerge(sri, ci)[1];\n      }\n      if (mode === 'bottom') {\n        setStyleBorder.call(this, eri, ci, { bottom: [style, color] });\n        ci += rows.getCellMerge(eri, ci)[1];\n      }\n    }\n  } else if (mode === 'left' || mode === 'right') {\n    for (let ri = sri; ri <= eri; ri += 1) {\n      if (mode === 'left') {\n        setStyleBorder.call(this, ri, sci, { left: [style, color] });\n        ri += rows.getCellMerge(ri, sci)[0];\n      }\n      if (mode === 'right') {\n        setStyleBorder.call(this, ri, eci, { right: [style, color] });\n        ri += rows.getCellMerge(ri, eci)[0];\n      }\n    }\n  }\n}\n\nfunction getCellRowByY(y, scrollOffsety) {\n  const { rows } = this;\n  const fsh = this.freezeTotalHeight();\n  // console.log('y:', y, ', fsh:', fsh);\n  let inits = rows.height;\n  if (fsh + rows.height < y) inits -= scrollOffsety;\n\n  // handle ri in autofilter\n  const frset = this.exceptRowSet;\n\n  let ri = 0;\n  let top = inits;\n  let { height } = rows;\n  for (; ri < rows.len; ri += 1) {\n    if (top > y) break;\n    if (!frset.has(ri)) {\n      height = rows.getHeight(ri);\n      top += height;\n    }\n  }\n  top -= height;\n  // console.log('ri:', ri, ', top:', top, ', height:', height);\n\n  if (top <= 0) {\n    return { ri: -1, top: 0, height };\n  }\n\n  return { ri: ri - 1, top, height };\n}\n\nfunction getCellColByX(x, scrollOffsetx) {\n  const { cols } = this;\n  const fsw = this.freezeTotalWidth();\n  let inits = cols.indexWidth;\n  if (fsw + cols.indexWidth < x) inits -= scrollOffsetx;\n  const [ci, left, width] = helper.rangeReduceIf(\n    0,\n    cols.len,\n    inits,\n    cols.indexWidth,\n    x,\n    i => cols.getWidth(i),\n  );\n  if (left <= 0) {\n    return { ci: -1, left: 0, width: cols.indexWidth };\n  }\n  return { ci: ci - 1, left, width };\n}\n\nexport default class DataProxy {\n  constructor(name, settings) {\n    this.settings = helper.merge(defaultSettings, settings || {});\n    // save data begin\n    this.name = name || 'sheet';\n    this.freeze = [0, 0];\n    this.styles = []; // Array<Style>\n    this.merges = new Merges(); // [CellRange, ...]\n    this.rows = new Rows(this.settings.row);\n    this.cols = new Cols(this.settings.col);\n    this.validations = new Validations();\n    this.hyperlinks = {};\n    this.comments = {};\n    // save data end\n\n    // don't save object\n    this.selector = new Selector();\n    this.scroll = new Scroll();\n    this.history = new History();\n    this.clipboard = new Clipboard();\n    this.autoFilter = new AutoFilter();\n    this.change = () => {};\n    this.exceptRowSet = new Set();\n    this.sortedRowMap = new Map();\n    this.unsortedRowMap = new Map();\n  }\n\n  addValidation(mode, ref, validator) {\n    // console.log('mode:', mode, ', ref:', ref, ', validator:', validator);\n    this.changeData(() => {\n      this.validations.add(mode, ref, validator);\n    });\n  }\n\n  removeValidation() {\n    const { range } = this.selector;\n    this.changeData(() => {\n      this.validations.remove(range);\n    });\n  }\n\n  getSelectedValidator() {\n    const { ri, ci } = this.selector;\n    const v = this.validations.get(ri, ci);\n    return v ? v.validator : null;\n  }\n\n  getSelectedValidation() {\n    const { ri, ci, range } = this.selector;\n    const v = this.validations.get(ri, ci);\n    const ret = { ref: range.toString() };\n    if (v !== null) {\n      ret.mode = v.mode;\n      ret.validator = v.validator;\n    }\n    return ret;\n  }\n\n  canUndo() {\n    return this.history.canUndo();\n  }\n\n  canRedo() {\n    return this.history.canRedo();\n  }\n\n  undo() {\n    this.history.undo(this.getData(), (d) => {\n      this.setData(d);\n    });\n  }\n\n  redo() {\n    this.history.redo(this.getData(), (d) => {\n      this.setData(d);\n    });\n  }\n\n  copy() {\n    this.clipboard.copy(this.selector.range);\n  }\n\n  copyToSystemClipboard(evt) {\n    let copyText = [];\n    const {\n      sri, eri, sci, eci,\n    } = this.selector.range;\n\n    for (let ri = sri; ri <= eri; ri += 1) {\n      const row = [];\n      for (let ci = sci; ci <= eci; ci += 1) {\n        const cell = this.getCell(ri, ci);\n        row.push((cell && cell.text) || '');\n      }\n      copyText.push(row);\n    }\n\n    // Adding \\n and why not adding \\r\\n is to support online office and client MS office and WPS\n    copyText = copyText.map(row => row.join('\\t')).join('\\n');\n\n    // why used this\n    // cuz http protocol will be blocked request clipboard by browser\n    if (evt) {\n      evt.clipboardData.clearData();\n      evt.clipboardData.setData('text/plain', copyText);\n      evt.preventDefault();\n    }\n\n    // this need https protocol\n    /* global navigator */\n    if (navigator.clipboard) {\n      navigator.clipboard.writeText(copyText).then(() => {}, (err) => {\n        console.log('text copy to the system clipboard error  ', copyText, err);\n      });\n    }\n  }\n\n  cut() {\n    this.clipboard.cut(this.selector.range);\n  }\n\n  // what: all | text | format\n  paste(what = 'all', error = () => {}) {\n    // console.log('sIndexes:', sIndexes);\n    const { clipboard, selector } = this;\n    if (clipboard.isClear()) return false;\n    if (!canPaste.call(this, clipboard.range, selector.range, error)) return false;\n\n    this.changeData(() => {\n      if (clipboard.isCopy()) {\n        copyPaste.call(this, clipboard.range, selector.range, what);\n      } else if (clipboard.isCut()) {\n        cutPaste.call(this, clipboard.range, selector.range);\n      }\n    });\n    return true;\n  }\n\n  pasteFromSystemClipboard(resetSheet, eventTrigger) {\n    const { selector } = this;\n    navigator.clipboard.readText().then((content) => {\n      const contentToPaste = this.parseClipboardContent(content);\n      let startRow = selector.ri;\n      contentToPaste.forEach((row) => {\n        let startColumn = selector.ci;\n        row.forEach((cellContent) => {\n          this.setCellText(startRow, startColumn, cellContent, 'input');\n          startColumn += 1;\n        });\n        startRow += 1;\n      });\n      resetSheet();\n      eventTrigger(this.rows.getData());\n    });\n  }\n\n  parseClipboardContent(clipboardContent) {\n    const parsedData = [];\n\n    // first we need to figure out how many rows we need to paste\n    const rows = clipboardContent.split('\\n');\n\n    // for each row parse cell data\n    let i = 0;\n    rows.forEach((row) => {\n      parsedData[i] = row.split('\\t');\n      i += 1;\n    });\n    return parsedData;\n  }\n\n  pasteFromText(txt) {\n    let lines = [];\n\n    if (/\\r\\n/.test(txt)) lines = txt.split('\\r\\n').map(it => it.replace(/\"/g, '').split('\\t'));\n    else lines = txt.split('\\n').map(it => it.replace(/\"/g, '').split('\\t'));\n\n    if (lines.length) {\n      const { rows, selector } = this;\n\n      this.changeData(() => {\n        rows.paste(lines, selector.range);\n      });\n    }\n  }\n\n  autofill(cellRange, what, error = () => {}) {\n    const srcRange = this.selector.range;\n    if (!canPaste.call(this, srcRange, cellRange, error)) return false;\n    this.changeData(() => {\n      copyPaste.call(this, srcRange, cellRange, what, true);\n    });\n    return true;\n  }\n\n  clearClipboard() {\n    this.clipboard.clear();\n  }\n\n  calSelectedRangeByEnd(ri, ci) {\n    const {\n      selector, rows, cols, merges,\n    } = this;\n    let {\n      sri, sci, eri, eci,\n    } = selector.range;\n    const cri = selector.ri;\n    const cci = selector.ci;\n    let [nri, nci] = [ri, ci];\n    if (ri < 0) nri = rows.len - 1;\n    if (ci < 0) nci = cols.len - 1;\n    if (nri > cri) [sri, eri] = [cri, nri];\n    else [sri, eri] = [nri, cri];\n    if (nci > cci) [sci, eci] = [cci, nci];\n    else [sci, eci] = [nci, cci];\n    selector.range = merges.union(new CellRange(\n      sri, sci, eri, eci,\n    ));\n    selector.range = merges.union(selector.range);\n    // console.log('selector.range:', selector.range);\n    return selector.range;\n  }\n\n  calSelectedRangeByStart(ri, ci) {\n    const {\n      selector, rows, cols, merges,\n    } = this;\n    let cellRange = merges.getFirstIncludes(ri, ci);\n    // console.log('cellRange:', cellRange, ri, ci, merges);\n    if (cellRange === null) {\n      cellRange = new CellRange(ri, ci, ri, ci);\n      if (ri === -1) {\n        cellRange.sri = 0;\n        cellRange.eri = rows.len - 1;\n      }\n      if (ci === -1) {\n        cellRange.sci = 0;\n        cellRange.eci = cols.len - 1;\n      }\n    }\n    selector.range = cellRange;\n    return cellRange;\n  }\n\n  setSelectedCellAttr(property, value) {\n    this.changeData(() => {\n      const { selector, styles, rows } = this;\n      if (property === 'merge') {\n        if (value) this.merge();\n        else this.unmerge();\n      } else if (property === 'border') {\n        setStyleBorders.call(this, value);\n      } else if (property === 'formula') {\n        // console.log('>>>', selector.multiple());\n        const { ri, ci, range } = selector;\n        if (selector.multiple()) {\n          const [rn, cn] = selector.size();\n          const {\n            sri, sci, eri, eci,\n          } = range;\n          if (rn > 1) {\n            for (let i = sci; i <= eci; i += 1) {\n              const cell = rows.getCellOrNew(eri + 1, i);\n              cell.text = `=${value}(${xy2expr(i, sri)}:${xy2expr(i, eri)})`;\n            }\n          } else if (cn > 1) {\n            const cell = rows.getCellOrNew(ri, eci + 1);\n            cell.text = `=${value}(${xy2expr(sci, ri)}:${xy2expr(eci, ri)})`;\n          }\n        } else {\n          const cell = rows.getCellOrNew(ri, ci);\n          cell.text = `=${value}()`;\n        }\n      } else {\n        selector.range.each((ri, ci) => {\n          const cell = rows.getCellOrNew(ri, ci);\n          let cstyle = {};\n          if (cell.style !== undefined) {\n            cstyle = helper.cloneDeep(styles[cell.style]);\n          }\n          if (property === 'format') {\n            cstyle.format = value;\n            cell.style = this.addStyle(cstyle);\n          } else if (property === 'font-bold' || property === 'font-italic'\n            || property === 'font-name' || property === 'font-size') {\n            const nfont = {};\n            nfont[property.split('-')[1]] = value;\n            cstyle.font = Object.assign(cstyle.font || {}, nfont);\n            cell.style = this.addStyle(cstyle);\n          } else if (property === 'strike' || property === 'textwrap'\n            || property === 'underline'\n            || property === 'align' || property === 'valign'\n            || property === 'color' || property === 'bgcolor') {\n            cstyle[property] = value;\n            cell.style = this.addStyle(cstyle);\n          } else {\n            cell[property] = value;\n          }\n        });\n      }\n    });\n  }\n\n  // state: input | finished\n  setSelectedCellText(text, state = 'input') {\n    const { autoFilter, selector, rows } = this;\n    const { ri, ci } = selector;\n    let nri = ri;\n    if (this.unsortedRowMap.has(ri)) {\n      nri = this.unsortedRowMap.get(ri);\n    }\n    const oldCell = rows.getCell(nri, ci);\n    const oldText = oldCell ? oldCell.text : '';\n    this.setCellText(nri, ci, text, state);\n    // replace filter.value\n    if (autoFilter.active()) {\n      const filter = autoFilter.getFilter(ci);\n      if (filter) {\n        const vIndex = filter.value.findIndex(v => v === oldText);\n        if (vIndex >= 0) {\n          filter.value.splice(vIndex, 1, text);\n        }\n        // console.log('filter:', filter, oldCell);\n      }\n    }\n    // this.resetAutoFilter();\n  }\n\n  getSelectedCell() {\n    const { ri, ci } = this.selector;\n    let nri = ri;\n    if (this.unsortedRowMap.has(ri)) {\n      nri = this.unsortedRowMap.get(ri);\n    }\n    return this.rows.getCell(nri, ci);\n  }\n\n  xyInSelectedRect(x, y) {\n    const {\n      left, top, width, height,\n    } = this.getSelectedRect();\n    const x1 = x - this.cols.indexWidth;\n    const y1 = y - this.rows.height;\n    // console.log('x:', x, ',y:', y, 'left:', left, 'top:', top);\n    return x1 > left && x1 < (left + width)\n      && y1 > top && y1 < (top + height);\n  }\n\n  getSelectedRect() {\n    return this.getRect(this.selector.range);\n  }\n\n  getClipboardRect() {\n    const { clipboard } = this;\n    if (!clipboard.isClear()) {\n      return this.getRect(clipboard.range);\n    }\n    return { left: -100, top: -100 };\n  }\n\n  getRect(cellRange) {\n    const {\n      scroll, rows, cols, exceptRowSet,\n    } = this;\n    const {\n      sri, sci, eri, eci,\n    } = cellRange;\n    // console.log('sri:', sri, ',sci:', sci, ', eri:', eri, ', eci:', eci);\n    // no selector\n    if (sri < 0 && sci < 0) {\n      return {\n        left: 0, l: 0, top: 0, t: 0, scroll,\n      };\n    }\n    const left = cols.sumWidth(0, sci);\n    const top = rows.sumHeight(0, sri, exceptRowSet);\n    const height = rows.sumHeight(sri, eri + 1, exceptRowSet);\n    const width = cols.sumWidth(sci, eci + 1);\n    // console.log('sri:', sri, ', sci:', sci, ', eri:', eri, ', eci:', eci);\n    let left0 = left - scroll.x;\n    let top0 = top - scroll.y;\n    const fsh = this.freezeTotalHeight();\n    const fsw = this.freezeTotalWidth();\n    if (fsw > 0 && fsw > left) {\n      left0 = left;\n    }\n    if (fsh > 0 && fsh > top) {\n      top0 = top;\n    }\n    return {\n      l: left,\n      t: top,\n      left: left0,\n      top: top0,\n      height,\n      width,\n      scroll,\n    };\n  }\n\n  getCellRectByXY(x, y) {\n    const {\n      scroll, merges, rows, cols,\n    } = this;\n    let { ri, top, height } = getCellRowByY.call(this, y, scroll.y);\n    let { ci, left, width } = getCellColByX.call(this, x, scroll.x);\n    if (ci === -1) {\n      width = cols.totalWidth();\n    }\n    if (ri === -1) {\n      height = rows.totalHeight();\n    }\n    if (ri >= 0 || ci >= 0) {\n      const merge = merges.getFirstIncludes(ri, ci);\n      if (merge) {\n        ri = merge.sri;\n        ci = merge.sci;\n        ({\n          left, top, width, height,\n        } = this.cellRect(ri, ci));\n      }\n    }\n    return {\n      ri, ci, left, top, width, height,\n    };\n  }\n\n  isSingleSelected() {\n    const {\n      sri, sci, eri, eci,\n    } = this.selector.range;\n    const cell = this.getCell(sri, sci);\n    if (cell && cell.merge) {\n      const [rn, cn] = cell.merge;\n      if (sri + rn === eri && sci + cn === eci) return true;\n    }\n    return !this.selector.multiple();\n  }\n\n  canUnmerge() {\n    const {\n      sri, sci, eri, eci,\n    } = this.selector.range;\n    const cell = this.getCell(sri, sci);\n    if (cell && cell.merge) {\n      const [rn, cn] = cell.merge;\n      if (sri + rn === eri && sci + cn === eci) return true;\n    }\n    return false;\n  }\n\n  merge() {\n    const { selector, rows } = this;\n    if (this.isSingleSelected()) return;\n    const [rn, cn] = selector.size();\n    // console.log('merge:', rn, cn);\n    if (rn > 1 || cn > 1) {\n      const { sri, sci } = selector.range;\n      this.changeData(() => {\n        const cell = rows.getCellOrNew(sri, sci);\n        cell.merge = [rn - 1, cn - 1];\n        this.merges.add(selector.range);\n        // delete merge cells\n        this.rows.deleteCells(selector.range);\n        // console.log('cell:', cell, this.d);\n        this.rows.setCell(sri, sci, cell);\n      });\n    }\n  }\n\n  unmerge() {\n    const { selector } = this;\n    if (!this.isSingleSelected()) return;\n    const { sri, sci } = selector.range;\n    this.changeData(() => {\n      this.rows.deleteCell(sri, sci, 'merge');\n      this.merges.deleteWithin(selector.range);\n    });\n  }\n\n  canAutofilter() {\n    return !this.autoFilter.active();\n  }\n\n  autofilter() {\n    const { autoFilter, selector } = this;\n    this.changeData(() => {\n      if (autoFilter.active()) {\n        autoFilter.clear();\n        this.exceptRowSet = new Set();\n        this.sortedRowMap = new Map();\n        this.unsortedRowMap = new Map();\n      } else {\n        autoFilter.ref = selector.range.toString();\n      }\n    });\n  }\n\n  setAutoFilter(ci, order, operator, value) {\n    const { autoFilter } = this;\n    autoFilter.addFilter(ci, operator, value);\n    autoFilter.setSort(ci, order);\n    this.resetAutoFilter();\n  }\n\n  resetAutoFilter() {\n    const { autoFilter, rows } = this;\n    if (!autoFilter.active()) return;\n    const { sort } = autoFilter;\n    const { rset, fset } = autoFilter.filteredRows((r, c) => rows.getCell(r, c));\n    const fary = Array.from(fset);\n    const oldAry = Array.from(fset);\n    if (sort) {\n      fary.sort((a, b) => {\n        if (sort.order === 'asc') return a - b;\n        if (sort.order === 'desc') return b - a;\n        return 0;\n      });\n    }\n    this.exceptRowSet = rset;\n    this.sortedRowMap = new Map();\n    this.unsortedRowMap = new Map();\n    fary.forEach((it, index) => {\n      this.sortedRowMap.set(oldAry[index], it);\n      this.unsortedRowMap.set(it, oldAry[index]);\n    });\n  }\n\n  deleteCell(what = 'all') {\n    const { selector } = this;\n    this.changeData(() => {\n      this.rows.deleteCells(selector.range, what);\n      if (what === 'all' || what === 'format') {\n        this.merges.deleteWithin(selector.range);\n      }\n    });\n  }\n\n  // type: row | column\n  insert(type, n = 1) {\n    this.changeData(() => {\n      const { sri, sci } = this.selector.range;\n      const { rows, merges, cols } = this;\n      let si = sri;\n      if (type === 'row') {\n        rows.insert(sri, n);\n      } else if (type === 'column') {\n        rows.insertColumn(sci, n);\n        si = sci;\n        cols.len += n;\n        Object.keys(cols._).reverse().forEach((colIndex) => {\n          const col = parseInt(colIndex, 10);\n          if (col >= sci) {\n            cols._[col + n] = cols._[col];\n            delete cols._[col];\n          }\n        });\n      }\n      merges.shift(type, si, n, (ri, ci, rn, cn) => {\n        const cell = rows.getCell(ri, ci);\n        cell.merge[0] += rn;\n        cell.merge[1] += cn;\n      });\n    });\n  }\n\n  // type: row | column\n  delete(type) {\n    this.changeData(() => {\n      const {\n        rows, merges, selector, cols,\n      } = this;\n      const { range } = selector;\n      const {\n        sri, sci, eri, eci,\n      } = selector.range;\n      const [rsize, csize] = selector.range.size();\n      let si = sri;\n      let size = rsize;\n      if (type === 'row') {\n        rows.delete(sri, eri);\n      } else if (type === 'column') {\n        rows.deleteColumn(sci, eci);\n        si = range.sci;\n        size = csize;\n        cols.len -= (eci - sci + 1);\n        Object.keys(cols._).forEach((colIndex) => {\n          const col = parseInt(colIndex, 10);\n          if (col >= sci) {\n            if (col > eci) cols._[col - (eci - sci + 1)] = cols._[col];\n            delete cols._[col];\n          }\n        });\n      }\n      // console.log('type:', type, ', si:', si, ', size:', size);\n      merges.shift(type, si, -size, (ri, ci, rn, cn) => {\n        // console.log('ri:', ri, ', ci:', ci, ', rn:', rn, ', cn:', cn);\n        const cell = rows.getCell(ri, ci);\n        cell.merge[0] += rn;\n        cell.merge[1] += cn;\n        if (cell.merge[0] === 0 && cell.merge[1] === 0) {\n          delete cell.merge;\n        }\n      });\n    });\n  }\n\n  scrollx(x, cb) {\n    const { scroll, freeze, cols } = this;\n    const [, fci] = freeze;\n    const [\n      ci, left, width,\n    ] = helper.rangeReduceIf(fci, cols.len, 0, 0, x, i => cols.getWidth(i));\n    // console.log('fci:', fci, ', ci:', ci);\n    let x1 = left;\n    if (x > 0) x1 += width;\n    if (scroll.x !== x1) {\n      scroll.ci = x > 0 ? ci : 0;\n      scroll.x = x1;\n      cb();\n    }\n  }\n\n  scrolly(y, cb) {\n    const { scroll, freeze, rows } = this;\n    const [fri] = freeze;\n    const [\n      ri, top, height,\n    ] = helper.rangeReduceIf(fri, rows.len, 0, 0, y, i => rows.getHeight(i));\n    let y1 = top;\n    if (y > 0) y1 += height;\n    // console.log('ri:', ri, ' ,y:', y1);\n    if (scroll.y !== y1) {\n      scroll.ri = y > 0 ? ri : 0;\n      scroll.y = y1;\n      cb();\n    }\n  }\n\n  cellRect(ri, ci) {\n    const { rows, cols } = this;\n    const left = cols.sumWidth(0, ci);\n    const top = rows.sumHeight(0, ri);\n    const cell = rows.getCell(ri, ci);\n    let width = cols.getWidth(ci);\n    let height = rows.getHeight(ri);\n    if (cell !== null) {\n      if (cell.merge) {\n        const [rn, cn] = cell.merge;\n        // console.log('cell.merge:', cell.merge);\n        if (rn > 0) {\n          for (let i = 1; i <= rn; i += 1) {\n            height += rows.getHeight(ri + i);\n          }\n        }\n        if (cn > 0) {\n          for (let i = 1; i <= cn; i += 1) {\n            width += cols.getWidth(ci + i);\n          }\n        }\n      }\n    }\n    // console.log('data:', this.d);\n    return {\n      left, top, width, height, cell,\n    };\n  }\n\n  getCell(ri, ci) {\n    return this.rows.getCell(ri, ci);\n  }\n\n  getCellTextOrDefault(ri, ci) {\n    const cell = this.getCell(ri, ci);\n    return (cell && cell.text) ? cell.text : '';\n  }\n\n  getCellStyle(ri, ci) {\n    const cell = this.getCell(ri, ci);\n    if (cell && cell.style !== undefined) {\n      return this.styles[cell.style];\n    }\n    return null;\n  }\n\n  getCellStyleOrDefault(ri, ci) {\n    const { styles, rows } = this;\n    const cell = rows.getCell(ri, ci);\n    const cellStyle = (cell && cell.style !== undefined) ? styles[cell.style] : {};\n    return helper.merge(this.defaultStyle(), cellStyle);\n  }\n\n  getSelectedCellStyle() {\n    const { ri, ci } = this.selector;\n    return this.getCellStyleOrDefault(ri, ci);\n  }\n\n  // state: input | finished\n  setCellText(ri, ci, text, state) {\n    const { rows, history, validations } = this;\n    if (state === 'finished') {\n      rows.setCellText(ri, ci, '');\n      history.add(this.getData());\n      rows.setCellText(ri, ci, text);\n    } else {\n      rows.setCellText(ri, ci, text);\n      this.change(this.getData());\n    }\n    // validator\n    validations.validate(ri, ci, text);\n  }\n\n  freezeIsActive() {\n    const [ri, ci] = this.freeze;\n    return ri > 0 || ci > 0;\n  }\n\n  setFreeze(ri, ci) {\n    this.changeData(() => {\n      this.freeze = [ri, ci];\n    });\n  }\n\n  freezeTotalWidth() {\n    return this.cols.sumWidth(0, this.freeze[1]);\n  }\n\n  freezeTotalHeight() {\n    return this.rows.sumHeight(0, this.freeze[0]);\n  }\n\n  setRowHeight(ri, height) {\n    this.changeData(() => {\n      this.rows.setHeight(ri, height);\n    });\n  }\n\n  setColWidth(ci, width) {\n    this.changeData(() => {\n      this.cols.setWidth(ci, width);\n    });\n  }\n\n  viewHeight() {\n    const { view, showToolbar, showBottomBar } = this.settings;\n    let h = view.height();\n    if (showBottomBar) {\n      h -= bottombarHeight;\n    }\n    if (showToolbar) {\n      h -= toolbarHeight;\n    }\n    return h;\n  }\n\n  viewWidth() {\n    return this.settings.view.width();\n  }\n\n  freezeViewRange() {\n    const [ri, ci] = this.freeze;\n    return new CellRange(0, 0, ri - 1, ci - 1, this.freezeTotalWidth(), this.freezeTotalHeight());\n  }\n\n  contentRange() {\n    const { rows, cols } = this;\n    const [ri, ci] = rows.maxCell();\n    const h = rows.sumHeight(0, ri + 1);\n    const w = cols.sumWidth(0, ci + 1);\n    return new CellRange(0, 0, ri, ci, w, h);\n  }\n\n  exceptRowTotalHeight(sri, eri) {\n    const { exceptRowSet, rows } = this;\n    const exceptRows = Array.from(exceptRowSet);\n    let exceptRowTH = 0;\n    exceptRows.forEach((ri) => {\n      if (ri < sri || ri > eri) {\n        const height = rows.getHeight(ri);\n        exceptRowTH += height;\n      }\n    });\n    return exceptRowTH;\n  }\n\n  viewRange() {\n    const {\n      scroll, rows, cols, freeze, exceptRowSet,\n    } = this;\n    // console.log('scroll:', scroll, ', freeze:', freeze)\n    let { ri, ci } = scroll;\n    if (ri <= 0) [ri] = freeze;\n    if (ci <= 0) [, ci] = freeze;\n\n    let [x, y] = [0, 0];\n    let [eri, eci] = [rows.len, cols.len];\n    for (let i = ri; i < rows.len; i += 1) {\n      if (!exceptRowSet.has(i)) {\n        y += rows.getHeight(i);\n        eri = i;\n      }\n      if (y > this.viewHeight()) break;\n    }\n    for (let j = ci; j < cols.len; j += 1) {\n      x += cols.getWidth(j);\n      eci = j;\n      if (x > this.viewWidth()) break;\n    }\n    // console.log(ri, ci, eri, eci, x, y);\n    return new CellRange(ri, ci, eri, eci, x, y);\n  }\n\n  eachMergesInView(viewRange, cb) {\n    this.merges.filterIntersects(viewRange)\n      .forEach(it => cb(it));\n  }\n\n  hideRowsOrCols() {\n    const { rows, cols, selector } = this;\n    const [rlen, clen] = selector.size();\n    const {\n      sri, sci, eri, eci,\n    } = selector.range;\n    if (rlen === rows.len) {\n      for (let ci = sci; ci <= eci; ci += 1) {\n        cols.setHide(ci, true);\n      }\n    } else if (clen === cols.len) {\n      for (let ri = sri; ri <= eri; ri += 1) {\n        rows.setHide(ri, true);\n      }\n    }\n  }\n\n  // type: row | col\n  // index row-index | col-index\n  unhideRowsOrCols(type, index) {\n    this[`${type}s`].unhide(index);\n  }\n\n  rowEach(min, max, cb) {\n    let y = 0;\n    const { rows } = this;\n    const frset = this.exceptRowSet;\n    const frary = [...frset];\n    let offset = 0;\n    for (let i = 0; i < frary.length; i += 1) {\n      if (frary[i] < min) {\n        offset += 1;\n      }\n    }\n    // console.log('min:', min, ', max:', max, ', scroll:', scroll);\n    for (let i = min + offset; i <= max + offset; i += 1) {\n      if (frset.has(i)) {\n        offset += 1;\n      } else {\n        const rowHeight = rows.getHeight(i);\n        if (rowHeight > 0) {\n          cb(i, y, rowHeight);\n          y += rowHeight;\n          if (y > this.viewHeight()) break;\n        }\n      }\n    }\n  }\n\n  colEach(min, max, cb) {\n    let x = 0;\n    const { cols } = this;\n    for (let i = min; i <= max; i += 1) {\n      const colWidth = cols.getWidth(i);\n      if (colWidth > 0) {\n        cb(i, x, colWidth);\n        x += colWidth;\n        if (x > this.viewWidth()) break;\n      }\n    }\n  }\n\n  defaultStyle() {\n    return this.settings.style;\n  }\n\n  addStyle(nstyle) {\n    const { styles } = this;\n    // console.log('old.styles:', styles, nstyle);\n    for (let i = 0; i < styles.length; i += 1) {\n      const style = styles[i];\n      if (helper.equals(style, nstyle)) return i;\n    }\n    styles.push(nstyle);\n    return styles.length - 1;\n  }\n\n  changeData(cb) {\n    this.history.add(this.getData());\n    cb();\n    this.change(this.getData());\n  }\n\n  setData(d) {\n    Object.keys(d).forEach((property) => {\n      if (property === 'merges' || property === 'rows'\n        || property === 'cols' || property === 'validations') {\n        this[property].setData(d[property]);\n      } else if (property === 'freeze') {\n        const [x, y] = expr2xy(d[property]);\n        this.freeze = [y, x];\n      } else if (property === 'autofilter') {\n        this.autoFilter.setData(d[property]);\n      } else if (d[property] !== undefined) {\n        this[property] = d[property];\n      }\n    });\n    return this;\n  }\n\n  getData() {\n    const {\n      name, freeze, styles, merges, rows, cols, validations, autoFilter,\n    } = this;\n    return {\n      name,\n      freeze: xy2expr(freeze[1], freeze[0]),\n      styles,\n      merges: merges.getData(),\n      rows: rows.getData(),\n      cols: cols.getData(),\n      validations: validations.getData(),\n      autofilter: autoFilter.getData(),\n    };\n  }\n}\n"
  },
  {
    "path": "src/core/font.js",
    "content": "// docs\nimport './_.prototypes';\n\n/** default font list\n * @type {BaseFont[]}\n */\nconst baseFonts = [\n  { key: 'Arial', title: 'Arial' },\n  { key: 'Helvetica', title: 'Helvetica' },\n  { key: 'Source Sans Pro', title: 'Source Sans Pro' },\n  { key: 'Comic Sans MS', title: 'Comic Sans MS' },\n  { key: 'Courier New', title: 'Courier New' },\n  { key: 'Verdana', title: 'Verdana' },\n  { key: 'Lato', title: 'Lato' },\n];\n\n/** default fontSize list\n * @type {FontSize[]}\n */\nconst fontSizes = [\n  { pt: 7.5, px: 10 },\n  { pt: 8, px: 11 },\n  { pt: 9, px: 12 },\n  { pt: 10, px: 13 },\n  { pt: 10.5, px: 14 },\n  { pt: 11, px: 15 },\n  { pt: 12, px: 16 },\n  { pt: 14, px: 18.7 },\n  { pt: 15, px: 20 },\n  { pt: 16, px: 21.3 },\n  { pt: 18, px: 24 },\n  { pt: 22, px: 29.3 },\n  { pt: 24, px: 32 },\n  { pt: 26, px: 34.7 },\n  { pt: 36, px: 48 },\n  { pt: 42, px: 56 },\n  // { pt: 54, px: 71.7 },\n  // { pt: 63, px: 83.7 },\n  // { pt: 72, px: 95.6 },\n];\n\n/** map pt to px\n * @date 2019-10-10\n * @param {fontsizePT} pt\n * @returns {fontsizePX}\n */\nfunction getFontSizePxByPt(pt) {\n  for (let i = 0; i < fontSizes.length; i += 1) {\n    const fontSize = fontSizes[i];\n    if (fontSize.pt === pt) {\n      return fontSize.px;\n    }\n  }\n  return pt;\n}\n\n/** transform baseFonts to map\n * @date 2019-10-10\n * @param {BaseFont[]} [ary=[]]\n * @returns {object}\n */\nfunction fonts(ary = []) {\n  const map = {};\n  baseFonts.concat(ary).forEach((f) => {\n    map[f.key] = f;\n  });\n  return map;\n}\n\nexport default {};\nexport {\n  fontSizes,\n  fonts,\n  baseFonts,\n  getFontSizePxByPt,\n};\n"
  },
  {
    "path": "src/core/format.js",
    "content": "import { tf } from '../locale/locale';\n\nconst formatStringRender = v => v;\n\nconst formatNumberRender = (v) => {\n  // match \"-12.1\" or \"12\" or \"12.1\"\n  if (/^(-?\\d*.?\\d*)$/.test(v)) {\n    const v1 = Number(v).toFixed(2).toString();\n    const [first, ...parts] = v1.split('\\\\.');\n    return [first.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,'), ...parts];\n  }\n  return v;\n};\n\nconst baseFormats = [\n  {\n    key: 'normal',\n    title: tf('format.normal'),\n    type: 'string',\n    render: formatStringRender,\n  },\n  {\n    key: 'text',\n    title: tf('format.text'),\n    type: 'string',\n    render: formatStringRender,\n  },\n  {\n    key: 'number',\n    title: tf('format.number'),\n    type: 'number',\n    label: '1,000.12',\n    render: formatNumberRender,\n  },\n  {\n    key: 'percent',\n    title: tf('format.percent'),\n    type: 'number',\n    label: '10.12%',\n    render: v => `${v}%`,\n  },\n  {\n    key: 'rmb',\n    title: tf('format.rmb'),\n    type: 'number',\n    label: '￥10.00',\n    render: v => `￥${formatNumberRender(v)}`,\n  },\n  {\n    key: 'usd',\n    title: tf('format.usd'),\n    type: 'number',\n    label: '$10.00',\n    render: v => `$${formatNumberRender(v)}`,\n  },\n  {\n    key: 'eur',\n    title: tf('format.eur'),\n    type: 'number',\n    label: '€10.00',\n    render: v => `€${formatNumberRender(v)}`,\n  },\n  {\n    key: 'date',\n    title: tf('format.date'),\n    type: 'date',\n    label: '26/09/2008',\n    render: formatStringRender,\n  },\n  {\n    key: 'time',\n    title: tf('format.time'),\n    type: 'date',\n    label: '15:59:00',\n    render: formatStringRender,\n  },\n  {\n    key: 'datetime',\n    title: tf('format.datetime'),\n    type: 'date',\n    label: '26/09/2008 15:59:00',\n    render: formatStringRender,\n  },\n  {\n    key: 'duration',\n    title: tf('format.duration'),\n    type: 'date',\n    label: '24:01:00',\n    render: formatStringRender,\n  },\n];\n\n// const formats = (ary = []) => {\n//   const map = {};\n//   baseFormats.concat(ary).forEach((f) => {\n//     map[f.key] = f;\n//   });\n//   return map;\n// };\nconst formatm = {};\nbaseFormats.forEach((f) => {\n  formatm[f.key] = f;\n});\n\nexport default {\n};\nexport {\n  formatm,\n  baseFormats,\n};\n"
  },
  {
    "path": "src/core/formula.js",
    "content": "/**\n  formula:\n    key\n    title\n    render\n*/\n/**\n * @typedef {object} Formula\n * @property {string} key\n * @property {function} title\n * @property {function} render\n */\nimport { tf } from '../locale/locale';\nimport { numberCalc } from './helper';\n\n/** @type {Formula[]} */\nconst baseFormulas = [\n  {\n    key: 'SUM',\n    title: tf('formula.sum'),\n    render: ary => ary.reduce((a, b) => numberCalc('+', a, b), 0),\n  },\n  {\n    key: 'AVERAGE',\n    title: tf('formula.average'),\n    render: ary => ary.reduce((a, b) => Number(a) + Number(b), 0) / ary.length,\n  },\n  {\n    key: 'MAX',\n    title: tf('formula.max'),\n    render: ary => Math.max(...ary.map(v => Number(v))),\n  },\n  {\n    key: 'MIN',\n    title: tf('formula.min'),\n    render: ary => Math.min(...ary.map(v => Number(v))),\n  },\n  {\n    key: 'IF',\n    title: tf('formula._if'),\n    render: ([b, t, f]) => (b ? t : f),\n  },\n  {\n    key: 'AND',\n    title: tf('formula.and'),\n    render: ary => ary.every(it => it),\n  },\n  {\n    key: 'OR',\n    title: tf('formula.or'),\n    render: ary => ary.some(it => it),\n  },\n  {\n    key: 'CONCAT',\n    title: tf('formula.concat'),\n    render: ary => ary.join(''),\n  },\n  /* support:  1 + A1 + B2 * 3\n  {\n    key: 'DIVIDE',\n    title: tf('formula.divide'),\n    render: ary => ary.reduce((a, b) => Number(a) / Number(b)),\n  },\n  {\n    key: 'PRODUCT',\n    title: tf('formula.product'),\n    render: ary => ary.reduce((a, b) => Number(a) * Number(b),1),\n  },\n  {\n    key: 'SUBTRACT',\n    title: tf('formula.subtract'),\n    render: ary => ary.reduce((a, b) => Number(a) - Number(b)),\n  },\n  */\n];\n\nconst formulas = baseFormulas;\n\n// const formulas = (formulaAry = []) => {\n//   const formulaMap = {};\n//   baseFormulas.concat(formulaAry).forEach((f) => {\n//     formulaMap[f.key] = f;\n//   });\n//   return formulaMap;\n// };\nconst formulam = {};\nbaseFormulas.forEach((f) => {\n  formulam[f.key] = f;\n});\n\nexport default {\n};\n\nexport {\n  formulam,\n  formulas,\n  baseFormulas,\n};\n"
  },
  {
    "path": "src/core/helper.js",
    "content": "/* eslint-disable no-param-reassign */\nfunction cloneDeep(obj) {\n  return JSON.parse(JSON.stringify(obj));\n}\n\nconst mergeDeep = (object = {}, ...sources) => {\n  sources.forEach((source) => {\n    Object.keys(source).forEach((key) => {\n      const v = source[key];\n      // console.log('k:', key, ', v:', source[key], typeof v, v instanceof Object);\n      if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean') {\n        object[key] = v;\n      } else if (typeof v !== 'function' && !Array.isArray(v) && v instanceof Object) {\n        object[key] = object[key] || {};\n        mergeDeep(object[key], v);\n      } else {\n        object[key] = v;\n      }\n    });\n  });\n  // console.log('::', object);\n  return object;\n};\n\nfunction equals(obj1, obj2) {\n  const keys = Object.keys(obj1);\n  if (keys.length !== Object.keys(obj2).length) return false;\n  for (let i = 0; i < keys.length; i += 1) {\n    const k = keys[i];\n    const v1 = obj1[k];\n    const v2 = obj2[k];\n    if (v2 === undefined) return false;\n    if (typeof v1 === 'string' || typeof v1 === 'number' || typeof v1 === 'boolean') {\n      if (v1 !== v2) return false;\n    } else if (Array.isArray(v1)) {\n      if (v1.length !== v2.length) return false;\n      for (let ai = 0; ai < v1.length; ai += 1) {\n        if (!equals(v1[ai], v2[ai])) return false;\n      }\n    } else if (typeof v1 !== 'function' && !Array.isArray(v1) && v1 instanceof Object) {\n      if (!equals(v1, v2)) return false;\n    }\n  }\n  return true;\n}\n\n/*\n  objOrAry: obejct or Array\n  cb: (value, index | key) => { return value }\n*/\nconst sum = (objOrAry, cb = value => value) => {\n  let total = 0;\n  let size = 0;\n  Object.keys(objOrAry).forEach((key) => {\n    total += cb(objOrAry[key], key);\n    size += 1;\n  });\n  return [total, size];\n};\n\nfunction deleteProperty(obj, property) {\n  const oldv = obj[`${property}`];\n  delete obj[`${property}`];\n  return oldv;\n}\n\nfunction rangeReduceIf(min, max, inits, initv, ifv, getv) {\n  let s = inits;\n  let v = initv;\n  let i = min;\n  for (; i < max; i += 1) {\n    if (s > ifv) break;\n    v = getv(i);\n    s += v;\n  }\n  return [i, s - v, v];\n}\n\nfunction rangeSum(min, max, getv) {\n  let s = 0;\n  for (let i = min; i < max; i += 1) {\n    s += getv(i);\n  }\n  return s;\n}\n\nfunction rangeEach(min, max, cb) {\n  for (let i = min; i < max; i += 1) {\n    cb(i);\n  }\n}\n\nfunction arrayEquals(a1, a2) {\n  if (a1.length === a2.length) {\n    for (let i = 0; i < a1.length; i += 1) {\n      if (a1[i] !== a2[i]) return false;\n    }\n  } else return false;\n  return true;\n}\n\nfunction digits(a) {\n  const v = `${a}`;\n  let ret = 0;\n  let flag = false;\n  for (let i = 0; i < v.length; i += 1) {\n    if (flag === true) ret += 1;\n    if (v.charAt(i) === '.') flag = true;\n  }\n  return ret;\n}\n\nexport function numberCalc(type, a1, a2) {\n  if (Number.isNaN(a1) || Number.isNaN(a2)) {\n    return a1 + type + a2;\n  }\n  const al1 = digits(a1);\n  const al2 = digits(a2);\n  const num1 = Number(a1);\n  const num2 = Number(a2);\n  let ret = 0;\n  if (type === '-') {\n    ret = num1 - num2;\n  } else if (type === '+') {\n    ret = num1 + num2;\n  } else if (type === '*') {\n    ret = num1 * num2;\n  } else if (type === '/') {\n    ret = num1 / num2;\n    if (digits(ret) > 5) return ret.toFixed(2);\n    return ret;\n  }\n  return ret.toFixed(Math.max(al1, al2));\n}\n\nexport default {\n  cloneDeep,\n  merge: (...sources) => mergeDeep({}, ...sources),\n  equals,\n  arrayEquals,\n  sum,\n  rangeEach,\n  rangeSum,\n  rangeReduceIf,\n  deleteProperty,\n  numberCalc,\n};\n"
  },
  {
    "path": "src/core/history.js",
    "content": "// import helper from '../helper';\n\nexport default class History {\n  constructor() {\n    this.undoItems = [];\n    this.redoItems = [];\n  }\n\n  add(data) {\n    this.undoItems.push(JSON.stringify(data));\n    this.redoItems = [];\n  }\n\n  canUndo() {\n    return this.undoItems.length > 0;\n  }\n\n  canRedo() {\n    return this.redoItems.length > 0;\n  }\n\n  undo(currentd, cb) {\n    const { undoItems, redoItems } = this;\n    if (this.canUndo()) {\n      redoItems.push(JSON.stringify(currentd));\n      cb(JSON.parse(undoItems.pop()));\n    }\n  }\n\n  redo(currentd, cb) {\n    const { undoItems, redoItems } = this;\n    if (this.canRedo()) {\n      undoItems.push(JSON.stringify(currentd));\n      cb(JSON.parse(redoItems.pop()));\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/merge.js",
    "content": "import { CellRange } from './cell_range';\n\nclass Merges {\n  constructor(d = []) {\n    this._ = d;\n  }\n\n  forEach(cb) {\n    this._.forEach(cb);\n  }\n\n  deleteWithin(cr) {\n    this._ = this._.filter(it => !it.within(cr));\n  }\n\n  getFirstIncludes(ri, ci) {\n    for (let i = 0; i < this._.length; i += 1) {\n      const it = this._[i];\n      if (it.includes(ri, ci)) {\n        return it;\n      }\n    }\n    return null;\n  }\n\n  filterIntersects(cellRange) {\n    return new Merges(this._.filter(it => it.intersects(cellRange)));\n  }\n\n  intersects(cellRange) {\n    for (let i = 0; i < this._.length; i += 1) {\n      const it = this._[i];\n      if (it.intersects(cellRange)) {\n        // console.log('intersects');\n        return true;\n      }\n    }\n    return false;\n  }\n\n  union(cellRange) {\n    let cr = cellRange;\n    this._.forEach((it) => {\n      if (it.intersects(cr)) {\n        cr = it.union(cr);\n      }\n    });\n    return cr;\n  }\n\n  add(cr) {\n    this.deleteWithin(cr);\n    this._.push(cr);\n  }\n\n  // type: row | column\n  shift(type, index, n, cbWithin) {\n    this._.forEach((cellRange) => {\n      const {\n        sri, sci, eri, eci,\n      } = cellRange;\n      const range = cellRange;\n      if (type === 'row') {\n        if (sri >= index) {\n          range.sri += n;\n          range.eri += n;\n        } else if (sri < index && index <= eri) {\n          range.eri += n;\n          cbWithin(sri, sci, n, 0);\n        }\n      } else if (type === 'column') {\n        if (sci >= index) {\n          range.sci += n;\n          range.eci += n;\n        } else if (sci < index && index <= eci) {\n          range.eci += n;\n          cbWithin(sri, sci, 0, n);\n        }\n      }\n    });\n  }\n\n  move(cellRange, rn, cn) {\n    this._.forEach((it1) => {\n      const it = it1;\n      if (it.within(cellRange)) {\n        it.eri += rn;\n        it.sri += rn;\n        it.sci += cn;\n        it.eci += cn;\n      }\n    });\n  }\n\n  setData(merges) {\n    this._ = merges.map(merge => CellRange.valueOf(merge));\n    return this;\n  }\n\n  getData() {\n    return this._.map(merge => merge.toString());\n  }\n}\n\nexport default {};\nexport {\n  Merges,\n};\n"
  },
  {
    "path": "src/core/row.js",
    "content": "import helper from './helper';\nimport { expr2expr } from './alphabet';\n\nclass Rows {\n  constructor({ len, height }) {\n    this._ = {};\n    this.len = len;\n    // default row height\n    this.height = height;\n  }\n\n  getHeight(ri) {\n    if (this.isHide(ri)) return 0;\n    const row = this.get(ri);\n    if (row && row.height) {\n      return row.height;\n    }\n    return this.height;\n  }\n\n  setHeight(ri, v) {\n    const row = this.getOrNew(ri);\n    row.height = v;\n  }\n\n  unhide(idx) {\n    let index = idx;\n    while (index > 0) {\n      index -= 1;\n      if (this.isHide(index)) {\n        this.setHide(index, false);\n      } else break;\n    }\n  }\n\n  isHide(ri) {\n    const row = this.get(ri);\n    return row && row.hide;\n  }\n\n  setHide(ri, v) {\n    const row = this.getOrNew(ri);\n    if (v === true) row.hide = true;\n    else delete row.hide;\n  }\n\n  setStyle(ri, style) {\n    const row = this.getOrNew(ri);\n    row.style = style;\n  }\n\n  sumHeight(min, max, exceptSet) {\n    return helper.rangeSum(min, max, (i) => {\n      if (exceptSet && exceptSet.has(i)) return 0;\n      return this.getHeight(i);\n    });\n  }\n\n  totalHeight() {\n    return this.sumHeight(0, this.len);\n  }\n\n  get(ri) {\n    return this._[ri];\n  }\n\n  getOrNew(ri) {\n    this._[ri] = this._[ri] || { cells: {} };\n    return this._[ri];\n  }\n\n  getCell(ri, ci) {\n    const row = this.get(ri);\n    if (row !== undefined && row.cells !== undefined && row.cells[ci] !== undefined) {\n      return row.cells[ci];\n    }\n    return null;\n  }\n\n  getCellMerge(ri, ci) {\n    const cell = this.getCell(ri, ci);\n    if (cell && cell.merge) return cell.merge;\n    return [0, 0];\n  }\n\n  getCellOrNew(ri, ci) {\n    const row = this.getOrNew(ri);\n    row.cells[ci] = row.cells[ci] || {};\n    return row.cells[ci];\n  }\n\n  // what: all | text | format\n  setCell(ri, ci, cell, what = 'all') {\n    const row = this.getOrNew(ri);\n    if (what === 'all') {\n      row.cells[ci] = cell;\n    } else if (what === 'text') {\n      row.cells[ci] = row.cells[ci] || {};\n      row.cells[ci].text = cell.text;\n    } else if (what === 'format') {\n      row.cells[ci] = row.cells[ci] || {};\n      row.cells[ci].style = cell.style;\n      if (cell.merge) row.cells[ci].merge = cell.merge;\n    }\n  }\n\n  setCellText(ri, ci, text) {\n    const cell = this.getCellOrNew(ri, ci);\n    if (cell.editable !== false) cell.text = text;\n  }\n\n  // what: all | format | text\n  copyPaste(srcCellRange, dstCellRange, what, autofill = false, cb = () => {}) {\n    const {\n      sri, sci, eri, eci,\n    } = srcCellRange;\n    const dsri = dstCellRange.sri;\n    const dsci = dstCellRange.sci;\n    const deri = dstCellRange.eri;\n    const deci = dstCellRange.eci;\n    const [rn, cn] = srcCellRange.size();\n    const [drn, dcn] = dstCellRange.size();\n    // console.log(srcIndexes, dstIndexes);\n    let isAdd = true;\n    let dn = 0;\n    if (deri < sri || deci < sci) {\n      isAdd = false;\n      if (deri < sri) dn = drn;\n      else dn = dcn;\n    }\n    for (let i = sri; i <= eri; i += 1) {\n      if (this._[i]) {\n        for (let j = sci; j <= eci; j += 1) {\n          if (this._[i].cells && this._[i].cells[j]) {\n            for (let ii = dsri; ii <= deri; ii += rn) {\n              for (let jj = dsci; jj <= deci; jj += cn) {\n                const nri = ii + (i - sri);\n                const nci = jj + (j - sci);\n                const ncell = helper.cloneDeep(this._[i].cells[j]);\n                // ncell.text\n                if (autofill && ncell && ncell.text && ncell.text.length > 0) {\n                  const { text } = ncell;\n                  let n = (jj - dsci) + (ii - dsri) + 2;\n                  if (!isAdd) {\n                    n -= dn + 1;\n                  }\n                  if (text[0] === '=') {\n                    ncell.text = text.replace(/[a-zA-Z]{1,3}\\d+/g, (word) => {\n                      let [xn, yn] = [0, 0];\n                      if (sri === dsri) {\n                        xn = n - 1;\n                        // if (isAdd) xn -= 1;\n                      } else {\n                        yn = n - 1;\n                      }\n                      if (/^\\d+$/.test(word)) return word;\n                      return expr2expr(word, xn, yn);\n                    });\n                  } else if ((rn <= 1 && cn > 1 && (dsri > eri || deri < sri))\n                    || (cn <= 1 && rn > 1 && (dsci > eci || deci < sci))\n                    || (rn <= 1 && cn <= 1)) {\n                    const result = /[\\\\.\\d]+$/.exec(text);\n                    // console.log('result:', result);\n                    if (result !== null) {\n                      const index = Number(result[0]) + n - 1;\n                      ncell.text = text.substring(0, result.index) + index;\n                    }\n                  }\n                }\n                this.setCell(nri, nci, ncell, what);\n                cb(nri, nci, ncell);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  cutPaste(srcCellRange, dstCellRange) {\n    const ncellmm = {};\n    this.each((ri) => {\n      this.eachCells(ri, (ci) => {\n        let nri = parseInt(ri, 10);\n        let nci = parseInt(ci, 10);\n        if (srcCellRange.includes(ri, ci)) {\n          nri = dstCellRange.sri + (nri - srcCellRange.sri);\n          nci = dstCellRange.sci + (nci - srcCellRange.sci);\n        }\n        ncellmm[nri] = ncellmm[nri] || { cells: {} };\n        ncellmm[nri].cells[nci] = this._[ri].cells[ci];\n      });\n    });\n    this._ = ncellmm;\n  }\n\n  // src: Array<Array<String>>\n  paste(src, dstCellRange) {\n    if (src.length <= 0) return;\n    const { sri, sci } = dstCellRange;\n    src.forEach((row, i) => {\n      const ri = sri + i;\n      row.forEach((cell, j) => {\n        const ci = sci + j;\n        this.setCellText(ri, ci, cell);\n      });\n    });\n  }\n\n  insert(sri, n = 1) {\n    const ndata = {};\n    this.each((ri, row) => {\n      let nri = parseInt(ri, 10);\n      if (nri >= sri) {\n        nri += n;\n        this.eachCells(ri, (ci, cell) => {\n          if (cell.text && cell.text[0] === '=') {\n            cell.text = cell.text.replace(/[a-zA-Z]{1,3}\\d+/g, word => expr2expr(word, 0, n, (x, y) => y >= sri));\n          }\n        });\n      }\n      ndata[nri] = row;\n    });\n    this._ = ndata;\n    this.len += n;\n  }\n\n  delete(sri, eri) {\n    const n = eri - sri + 1;\n    const ndata = {};\n    this.each((ri, row) => {\n      const nri = parseInt(ri, 10);\n      if (nri < sri) {\n        ndata[nri] = row;\n      } else if (ri > eri) {\n        ndata[nri - n] = row;\n        this.eachCells(ri, (ci, cell) => {\n          if (cell.text && cell.text[0] === '=') {\n            cell.text = cell.text.replace(/[a-zA-Z]{1,3}\\d+/g, word => expr2expr(word, 0, -n, (x, y) => y > eri));\n          }\n        });\n      }\n    });\n    this._ = ndata;\n    this.len -= n;\n  }\n\n  insertColumn(sci, n = 1) {\n    this.each((ri, row) => {\n      const rndata = {};\n      this.eachCells(ri, (ci, cell) => {\n        let nci = parseInt(ci, 10);\n        if (nci >= sci) {\n          nci += n;\n          if (cell.text && cell.text[0] === '=') {\n            cell.text = cell.text.replace(/[a-zA-Z]{1,3}\\d+/g, word => expr2expr(word, n, 0, x => x >= sci));\n          }\n        }\n        rndata[nci] = cell;\n      });\n      row.cells = rndata;\n    });\n  }\n\n  deleteColumn(sci, eci) {\n    const n = eci - sci + 1;\n    this.each((ri, row) => {\n      const rndata = {};\n      this.eachCells(ri, (ci, cell) => {\n        const nci = parseInt(ci, 10);\n        if (nci < sci) {\n          rndata[nci] = cell;\n        } else if (nci > eci) {\n          rndata[nci - n] = cell;\n          if (cell.text && cell.text[0] === '=') {\n            cell.text = cell.text.replace(/[a-zA-Z]{1,3}\\d+/g, word => expr2expr(word, -n, 0, x => x > eci));\n          }\n        }\n      });\n      row.cells = rndata;\n    });\n  }\n\n  // what: all | text | format | merge\n  deleteCells(cellRange, what = 'all') {\n    cellRange.each((i, j) => {\n      this.deleteCell(i, j, what);\n    });\n  }\n\n  // what: all | text | format | merge\n  deleteCell(ri, ci, what = 'all') {\n    const row = this.get(ri);\n    if (row !== null) {\n      const cell = this.getCell(ri, ci);\n      if (cell !== null && cell.editable !== false) {\n        if (what === 'all') {\n          delete row.cells[ci];\n        } else if (what === 'text') {\n          if (cell.text) delete cell.text;\n          if (cell.value) delete cell.value;\n        } else if (what === 'format') {\n          if (cell.style !== undefined) delete cell.style;\n          if (cell.merge) delete cell.merge;\n        } else if (what === 'merge') {\n          if (cell.merge) delete cell.merge;\n        }\n      }\n    }\n  }\n\n  maxCell() {\n    const keys = Object.keys(this._);\n    const ri = keys[keys.length - 1];\n    const col = this._[ri];\n    if (col) {\n      const { cells } = col;\n      const ks = Object.keys(cells);\n      const ci = ks[ks.length - 1];\n      return [parseInt(ri, 10), parseInt(ci, 10)];\n    }\n    return [0, 0];\n  }\n\n  each(cb) {\n    Object.entries(this._).forEach(([ri, row]) => {\n      cb(ri, row);\n    });\n  }\n\n  eachCells(ri, cb) {\n    if (this._[ri] && this._[ri].cells) {\n      Object.entries(this._[ri].cells).forEach(([ci, cell]) => {\n        cb(ci, cell);\n      });\n    }\n  }\n\n  setData(d) {\n    if (d.len) {\n      this.len = d.len;\n      delete d.len;\n    }\n    this._ = d;\n  }\n\n  getData() {\n    const { len } = this;\n    return Object.assign({ len }, this._);\n  }\n}\n\nexport default {};\nexport {\n  Rows,\n};\n"
  },
  {
    "path": "src/core/scroll.js",
    "content": "export default class Scroll {\n  constructor() {\n    this.x = 0; // left\n    this.y = 0; // top\n    this.ri = 0; // cell row-index\n    this.ci = 0; // cell col-index\n  }\n}\n"
  },
  {
    "path": "src/core/selector.js",
    "content": "import { CellRange } from './cell_range';\n\nexport default class Selector {\n  constructor() {\n    this.range = new CellRange(0, 0, 0, 0);\n    this.ri = 0;\n    this.ci = 0;\n  }\n\n  multiple() {\n    return this.range.multiple();\n  }\n\n  setIndexes(ri, ci) {\n    this.ri = ri;\n    this.ci = ci;\n  }\n\n  size() {\n    return this.range.size();\n  }\n}\n"
  },
  {
    "path": "src/core/validation.js",
    "content": "import Validator from './validator';\nimport { CellRange } from './cell_range';\n\nclass Validation {\n  constructor(mode, refs, validator) {\n    this.refs = refs;\n    this.mode = mode; // cell\n    this.validator = validator;\n  }\n\n  includes(ri, ci) {\n    const { refs } = this;\n    for (let i = 0; i < refs.length; i += 1) {\n      const cr = CellRange.valueOf(refs[i]);\n      if (cr.includes(ri, ci)) return true;\n    }\n    return false;\n  }\n\n  addRef(ref) {\n    this.remove(CellRange.valueOf(ref));\n    this.refs.push(ref);\n  }\n\n  remove(cellRange) {\n    const nrefs = [];\n    this.refs.forEach((it) => {\n      const cr = CellRange.valueOf(it);\n      if (cr.intersects(cellRange)) {\n        const crs = cr.difference(cellRange);\n        crs.forEach(it1 => nrefs.push(it1.toString()));\n      } else {\n        nrefs.push(it);\n      }\n    });\n    this.refs = nrefs;\n  }\n\n  getData() {\n    const { refs, mode, validator } = this;\n    const {\n      type, required, operator, value,\n    } = validator;\n    return {\n      refs, mode, type, required, operator, value,\n    };\n  }\n\n  static valueOf({\n    refs, mode, type, required, operator, value,\n  }) {\n    return new Validation(mode, refs, new Validator(type, required, value, operator));\n  }\n}\nclass Validations {\n  constructor() {\n    this._ = [];\n    // ri_ci: errMessage\n    this.errors = new Map();\n  }\n\n  getError(ri, ci) {\n    return this.errors.get(`${ri}_${ci}`);\n  }\n\n  validate(ri, ci, text) {\n    const v = this.get(ri, ci);\n    const key = `${ri}_${ci}`;\n    const { errors } = this;\n    if (v !== null) {\n      const [flag, message] = v.validator.validate(text);\n      if (!flag) {\n        errors.set(key, message);\n      } else {\n        errors.delete(key);\n      }\n    } else {\n      errors.delete(key);\n    }\n    return true;\n  }\n\n  // type: date|number|phone|email|list\n  // validator: { required, value, operator }\n  add(mode, ref, {\n    type, required, value, operator,\n  }) {\n    const validator = new Validator(\n      type, required, value, operator,\n    );\n    const v = this.getByValidator(validator);\n    if (v !== null) {\n      v.addRef(ref);\n    } else {\n      this._.push(new Validation(mode, [ref], validator));\n    }\n  }\n\n  getByValidator(validator) {\n    for (let i = 0; i < this._.length; i += 1) {\n      const v = this._[i];\n      if (v.validator.equals(validator)) {\n        return v;\n      }\n    }\n    return null;\n  }\n\n  get(ri, ci) {\n    for (let i = 0; i < this._.length; i += 1) {\n      const v = this._[i];\n      if (v.includes(ri, ci)) return v;\n    }\n    return null;\n  }\n\n  remove(cellRange) {\n    this.each((it) => {\n      it.remove(cellRange);\n    });\n  }\n\n  each(cb) {\n    this._.forEach(it => cb(it));\n  }\n\n  getData() {\n    return this._.filter(it => it.refs.length > 0).map(it => it.getData());\n  }\n\n  setData(d) {\n    this._ = d.map(it => Validation.valueOf(it));\n  }\n}\n\nexport default {};\nexport {\n  Validations,\n};\n"
  },
  {
    "path": "src/core/validator.js",
    "content": "import { t } from '../locale/locale';\nimport helper from './helper';\n\nconst rules = {\n  phone: /^[1-9]\\d{10}$/,\n  email: /w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/,\n};\n\nfunction returnMessage(flag, key, ...arg) {\n  let message = '';\n  if (!flag) {\n    message = t(`validation.${key}`, ...arg);\n  }\n  return [flag, message];\n}\n\nexport default class Validator {\n  // operator: b|nb|eq|neq|lt|lte|gt|gte\n  // type: date|number|list|phone|email\n  constructor(type, required, value, operator) {\n    this.required = required;\n    this.value = value;\n    this.type = type;\n    this.operator = operator;\n    this.message = '';\n  }\n\n  parseValue(v) {\n    const { type } = this;\n    if (type === 'date') {\n      return new Date(v);\n    }\n    if (type === 'number') {\n      return Number(v);\n    }\n    return v;\n  }\n\n  equals(other) {\n    let flag = this.type === other.type\n      && this.required === other.required\n      && this.operator === other.operator;\n    if (flag) {\n      if (Array.isArray(this.value)) {\n        flag = helper.arrayEquals(this.value, other.value);\n      } else {\n        flag = this.value === other.value;\n      }\n    }\n    return flag;\n  }\n\n  values() {\n    return this.value.split(',');\n  }\n\n  validate(v) {\n    const {\n      required, operator, value, type,\n    } = this;\n    if (required && /^\\s*$/.test(v)) {\n      return returnMessage(false, 'required');\n    }\n    if (/^\\s*$/.test(v)) return [true];\n    if (rules[type] && !rules[type].test(v)) {\n      return returnMessage(false, 'notMatch');\n    }\n    if (type === 'list') {\n      return returnMessage(this.values().includes(v), 'notIn');\n    }\n    if (operator) {\n      const v1 = this.parseValue(v);\n      if (operator === 'be') {\n        const [min, max] = value;\n        return returnMessage(\n          v1 >= this.parseValue(min) && v1 <= this.parseValue(max),\n          'between',\n          min,\n          max,\n        );\n      }\n      if (operator === 'nbe') {\n        const [min, max] = value;\n        return returnMessage(\n          v1 < this.parseValue(min) || v1 > this.parseValue(max),\n          'notBetween',\n          min,\n          max,\n        );\n      }\n      if (operator === 'eq') {\n        return returnMessage(\n          v1 === this.parseValue(value),\n          'equal',\n          value,\n        );\n      }\n      if (operator === 'neq') {\n        return returnMessage(\n          v1 !== this.parseValue(value),\n          'notEqual',\n          value,\n        );\n      }\n      if (operator === 'lt') {\n        return returnMessage(\n          v1 < this.parseValue(value),\n          'lessThan',\n          value,\n        );\n      }\n      if (operator === 'lte') {\n        return returnMessage(\n          v1 <= this.parseValue(value),\n          'lessThanEqual',\n          value,\n        );\n      }\n      if (operator === 'gt') {\n        return returnMessage(\n          v1 > this.parseValue(value),\n          'greaterThan',\n          value,\n        );\n      }\n      if (operator === 'gte') {\n        return returnMessage(\n          v1 >= this.parseValue(value),\n          'greaterThanEqual',\n          value,\n        );\n      }\n    }\n    return [true];\n  }\n}\n"
  },
  {
    "path": "src/index.d.ts",
    "content": "declare module 'x-data-spreadsheet' {\n  export interface ExtendToolbarOption {\n    tip?: string;\n    el?: HTMLElement;\n    icon?: string;\n    onClick?: (data: object, sheet: object) => void\n  }\n  export interface Options {\n    mode?: 'edit' | 'read';\n    showToolbar?: boolean;\n    showGrid?: boolean;\n    showContextmenu?: boolean;\n    showBottomBar?: boolean;\n    extendToolbar?: {\n      left?: ExtendToolbarOption[],\n      right?: ExtendToolbarOption[],\n    };\n    autoFocus?: boolean;\n    view?: {\n      height: () => number;\n      width: () => number;\n    };\n    row?: {\n      len: number;\n      height: number;\n    };\n    col?: {\n      len: number;\n      width: number;\n      indexWidth: number;\n      minWidth: number;\n    };\n    style?: {\n      bgcolor: string;\n      align: 'left' | 'center' | 'right';\n      valign: 'top' | 'middle' | 'bottom';\n      textwrap: boolean;\n      strike: boolean;\n      underline: boolean;\n      color: string;\n      font: {\n        name: 'Helvetica';\n        size: number;\n        bold: boolean;\n        italic: false;\n      };\n    };\n  }\n\n  export type CELL_SELECTED = 'cell-selected';\n  export type CELLS_SELECTED = 'cells-selected';\n  export type CELL_EDITED = 'cell-edited';\n\n  export type CellMerge = [number, number];\n\n  export interface SpreadsheetEventHandler {\n    (\n      envt: CELL_SELECTED,\n      callback: (cell: Cell, rowIndex: number, colIndex: number) => void\n    ): void;\n    (\n      envt: CELLS_SELECTED,\n      callback: (\n        cell: Cell,\n        parameters: { sri: number; sci: number; eri: number; eci: number }\n      ) => void\n    ): void;\n    (\n      evnt: CELL_EDITED,\n      callback: (text: string, rowIndex: number, colIndex: number) => void\n    ): void;\n  }\n\n  export interface ColProperties {\n    width?: number;\n  }\n\n  /**\n   * Data for representing a cell\n   */\n  export interface CellData {\n    text: string;\n    style?: number;\n    merge?: CellMerge;\n  }\n  /**\n   * Data for representing a row\n   */\n  export interface RowData {\n    cells: {\n      [key: number]: CellData;\n    }\n  }\n\n  /**\n   * Data for representing a sheet\n   */\n  export interface SheetData {\n    name?: string;\n    freeze?: string;\n    styles?: CellStyle[];\n    merges?: string[];\n    cols?: {\n      len?: number;\n      [key: number]: ColProperties;\n    };\n    rows?: {\n      [key: number]: RowData\n    };\n  }\n\n  /**\n   * Data for representing a spreadsheet\n   */\n  export interface SpreadsheetData {\n    [index: number]: SheetData;\n  }\n\n  export interface CellStyle {\n    align?: 'left' | 'center' | 'right';\n    valign?: 'top' | 'middle' | 'bottom';\n    font?: {\n      bold?: boolean;\n    }\n    bgcolor?: string;\n    textwrap?: boolean;\n    color?: string;\n    border?: {\n      top?: string[];\n      right?: string[];\n      bottom?: string[];\n      left?: string[];\n    };\n  }\n  export interface Editor {}\n  export interface Element {}\n\n  export interface Row {}\n  export interface Table {}\n  export interface Cell {}\n  export interface Sheet {}\n\n  export default class Spreadsheet {\n    constructor(container: string | HTMLElement, opts?: Options);\n    on: SpreadsheetEventHandler;\n    /**\n     * retrieve cell\n     * @param rowIndex {number} row index\n     * @param colIndex {number} column index\n     * @param sheetIndex {number} sheet iindex\n     */\n    cell(rowIndex: number, colIndex: number, sheetIndex: number): Cell;\n    /**\n     * retrieve cell style\n     * @param rowIndex\n     * @param colIndex\n     * @param sheetIndex\n     */\n    cellStyle(\n      rowIndex: number,\n      colIndex: number,\n      sheetIndex: number\n    ): CellStyle;\n    /**\n     * get/set cell text\n     * @param rowIndex\n     * @param colIndex\n     * @param text\n     * @param sheetIndex\n     */\n    cellText(\n      rowIndex: number,\n      colIndex: number,\n      text: string,\n      sheetIndex?: number\n    ): this;\n    /**\n     * remove current sheet\n     */\n    deleteSheet(): void;\n\n    /**s\n     * load data\n     * @param json\n     */\n    loadData(json: Record<string, any>): this;\n    /**\n     * get data\n     */\n    getData(): Record<string, any>;\n    /**\n     * bind handler to change event, including data change and user actions\n     * @param callback\n     */\n    change(callback: (json: Record<string, any>) => void): this;\n    /**\n     * set locale\n     * @param lang\n     * @param message\n     */\n    static locale(lang: string, message: object): void;\n  }\n  global {\n    interface Window {\n      x_spreadsheet(container: string | HTMLElement, opts?: Options): Spreadsheet; \n    }\n  }\n}\n\n"
  },
  {
    "path": "src/index.js",
    "content": "/* global window, document */\nimport { h } from './component/element';\nimport DataProxy from './core/data_proxy';\nimport Sheet from './component/sheet';\nimport Bottombar from './component/bottombar';\nimport { cssPrefix } from './config';\nimport { locale } from './locale/locale';\nimport './index.less';\n\n\nclass Spreadsheet {\n  constructor(selectors, options = {}) {\n    let targetEl = selectors;\n    this.options = { showBottomBar: true, ...options };\n    this.sheetIndex = 1;\n    this.datas = [];\n    if (typeof selectors === 'string') {\n      targetEl = document.querySelector(selectors);\n    }\n    this.bottombar = this.options.showBottomBar ? new Bottombar(() => {\n      if (this.options.mode === 'read') return;\n      const d = this.addSheet();\n      this.sheet.resetData(d);\n    }, (index) => {\n      const d = this.datas[index];\n      this.sheet.resetData(d);\n    }, () => {\n      this.deleteSheet();\n    }, (index, value) => {\n      this.datas[index].name = value;\n      this.sheet.trigger('change');\n    }) : null;\n    this.data = this.addSheet();\n    const rootEl = h('div', `${cssPrefix}`)\n      .on('contextmenu', evt => evt.preventDefault());\n    // create canvas element\n    targetEl.appendChild(rootEl.el);\n    this.sheet = new Sheet(rootEl, this.data);\n    if (this.bottombar !== null) {\n      rootEl.child(this.bottombar.el);\n    }\n  }\n\n  addSheet(name, active = true) {\n    const n = name || `sheet${this.sheetIndex}`;\n    const d = new DataProxy(n, this.options);\n    d.change = (...args) => {\n      this.sheet.trigger('change', ...args);\n    };\n    this.datas.push(d);\n    // console.log('d:', n, d, this.datas);\n    if (this.bottombar !== null) {\n      this.bottombar.addItem(n, active, this.options);\n    }\n    this.sheetIndex += 1;\n    return d;\n  }\n\n  deleteSheet() {\n    if (this.bottombar === null) return;\n\n    const [oldIndex, nindex] = this.bottombar.deleteItem();\n    if (oldIndex >= 0) {\n      this.datas.splice(oldIndex, 1);\n      if (nindex >= 0) this.sheet.resetData(this.datas[nindex]);\n      this.sheet.trigger('change');\n    }\n  }\n\n  loadData(data) {\n    const ds = Array.isArray(data) ? data : [data];\n    if (this.bottombar !== null) {\n      this.bottombar.clear();\n    }\n    this.datas = [];\n    if (ds.length > 0) {\n      for (let i = 0; i < ds.length; i += 1) {\n        const it = ds[i];\n        const nd = this.addSheet(it.name, i === 0);\n        nd.setData(it);\n        if (i === 0) {\n          this.sheet.resetData(nd);\n        }\n      }\n    }\n    return this;\n  }\n\n  getData() {\n    return this.datas.map(it => it.getData());\n  }\n\n  cellText(ri, ci, text, sheetIndex = 0) {\n    this.datas[sheetIndex].setCellText(ri, ci, text, 'finished');\n    return this;\n  }\n\n  cell(ri, ci, sheetIndex = 0) {\n    return this.datas[sheetIndex].getCell(ri, ci);\n  }\n\n  cellStyle(ri, ci, sheetIndex = 0) {\n    return this.datas[sheetIndex].getCellStyle(ri, ci);\n  }\n\n  reRender() {\n    this.sheet.table.render();\n    return this;\n  }\n\n  on(eventName, func) {\n    this.sheet.on(eventName, func);\n    return this;\n  }\n\n  validate() {\n    const { validations } = this.data;\n    return validations.errors.size <= 0;\n  }\n\n  change(cb) {\n    this.sheet.on('change', cb);\n    return this;\n  }\n\n  static locale(lang, message) {\n    locale(lang, message);\n  }\n}\n\nconst spreadsheet = (el, options = {}) => new Spreadsheet(el, options);\n\nif (window) {\n  window.x_spreadsheet = spreadsheet;\n  window.x_spreadsheet.locale = (lang, message) => locale(lang, message);\n}\n\nexport default Spreadsheet;\nexport {\n  spreadsheet,\n};\n"
  },
  {
    "path": "src/index.less",
    "content": "@css-prefix: x-spreadsheet;\n// color\n@red-color: #DB2828;\n@red-hover-color: #d01919;\n@orange-color: #F2711C;\n@orange-hover-color: #f26202;\n@yellow-color: #FBBD08;\n@yellow-hover-color: #eaae00;\n@olive-color: #B5CC18;\n@olive-hover-color: #a7bd0d;\n@green-color: #21BA45;\n@green-hover-color: #16ab39;\n@teal-color: #00B5AD;\n@teal-hover-color: #009c95;\n@blue-color: #2185D0;\n@blue-hover-color: #1678c2;\n@violet-color: #6435C9;\n@violet-hover-color: #5829bb;\n@purple-color: #A333C8;\n@purple-hover-color: #9627ba;\n@pink-color: #E03997;\n@pink-hover-color: #e61a8d;\n@brown-color: #A5673F;\n@brown-hover-color: #975b33;\n@grey-color: #767676;\n@grey-hover-color: #838383;\n@dark-color: #343a40;\n@dark-hover-color: darken(@dark-color, 10%);\n@black-color: #1B1C1D;\n@black-hover-color: #27292a;\n\n// base\n@border-style: 1px solid #e0e2e4;\n@icon-size: 18px;\n@line-height: 1.25em;\n@border-color: #e9e9e9;\n@border: 1px solid @border-color;\n@input-border: @border;\n@input-padding: 0.5em 0.75em;\n@input-box-shadow: inset 0 1px 2px hsla(0,0%,4%,.06);\n@border-radius: 2px;\n@form-field-height: 30px;\n@primary-color: @blue-color;\n@primary-hover-color: @blue-hover-color;\n\n// method\n.type-primary() {\n  color: #fff;\n  background-color: @primary-color;\n  &:hover, &.active {\n    color: #fff;\n    background-color: @primary-hover-color;\n  }\n}\n\nbody {\n  margin: 0;\n}\n\n.@{css-prefix} {\n  font-size: 13px;\n  line-height: normal;\n  user-select: none;\n  -moz-user-select: none;\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  box-sizing: content-box;\n  background: #fff;\n  -webkit-font-smoothing: antialiased;\n\n  textarea {\n    font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n  }\n}\n\n.@{css-prefix}-sheet {\n  position: relative;\n  overflow: hidden;\n}\n\n.@{css-prefix}-table {\n  // html5 bottom margin bug\n  vertical-align: bottom;\n}\n\n.@{css-prefix}-tooltip {\n  font-family: inherit;\n  position: absolute;\n  padding: 5px 10px;\n  color: #fff;\n  border-radius: 1px;\n  background: rgba(0, 0, 0, 1);\n  font-size: 12px;\n  z-index: 201;\n\n  &:before {\n    pointer-events: none;\n    position: absolute;\n    left: calc(50% - 4px);\n    top: -4px;\n    content: \"\";\n    width: 8px;\n    height: 8px;\n    background: inherit;\n    -webkit-transform: rotate(45deg);\n    transform: rotate(45deg);\n    z-index: 1;\n    box-shadow: 1px 1px 3px -1px rgba(0, 0, 0, .3);\n  }\n}\n\n.@{css-prefix}-color-palette {\n  padding: 5px;\n\n  table {\n    margin: 0;\n    padding: 0;\n    border-collapse: separate;\n    border-spacing: 2;\n    background: #fff;\n\n    td {\n      margin: 0;\n      cursor: pointer;\n      border: 1px solid transparent;\n\n      &:hover {\n        border-color: #ddd;\n      }\n\n      .@{css-prefix}-color-palette-cell {\n        width: 16px;\n        height: 16px;\n      }\n    }\n  }\n}\n\n.@{css-prefix}-border-palette {\n  padding: 6px;\n\n  table {\n    margin: 0;\n    padding: 0;\n    border-collapse: separate;\n    border-spacing: 0;\n    background: #fff;\n    table-layout: fixed;\n\n    td {\n      margin: 0;\n    }\n  }\n\n  .@{css-prefix}-border-palette-left {\n    border-right: 1px solid #eee;\n    padding-right: 6px;\n\n    .@{css-prefix}-border-palette-cell {\n      width: 30px;\n      height: 30px;\n      cursor: pointer;\n      text-align: center;\n\n      .@{css-prefix}-icon-img {\n        opacity: .8;\n      }\n\n      &:hover {\n        background-color: #eee;\n      }\n    }\n  }\n\n  .@{css-prefix}-border-palette-right {\n    padding-left: 6px;\n\n    .@{css-prefix}-toolbar-btn {\n      margin-top: 0;\n      margin-bottom: 3px;\n    }\n\n    .@{css-prefix}-line-type {\n      position: relative;\n      left: 0;\n      top: -3px;\n    }\n\n  }\n\n}\n\n.@{css-prefix}-dropdown {\n  position: relative;\n\n  .@{css-prefix}-dropdown-content {\n    position: absolute;\n    z-index: 200;\n    background: #fff;\n    box-shadow: 1px 2px 5px 2px rgba(51,51,51,.15);\n  }\n\n  &.bottom-left {\n    .@{css-prefix}-dropdown-content {\n      top: calc(~'100% + 5px');\n      left: 0;\n    }\n  }\n\n  &.bottom-right {\n    .@{css-prefix}-dropdown-content {\n      top: calc(~'100% + 5px');\n      right: 0;\n    }\n  }\n\n  &.top-left {\n    .@{css-prefix}-dropdown-content {\n      bottom: calc(~'100% + 5px');\n      left: 0;\n    }\n  }\n\n  &.top-right {\n    .@{css-prefix}-dropdown-content {\n      bottom: calc(~'100% + 5px');\n      right: 0;\n    }\n  }\n\n\n  .@{css-prefix}-dropdown-title {\n    padding: 0 5px;\n    display: inline-block;\n  }\n\n  .@{css-prefix}-dropdown-header {\n    .@{css-prefix}-icon.arrow-left {\n      margin-left: 4px;\n    }\n    .@{css-prefix}-icon.arrow-right {\n      width: 10px;\n      margin-right: 4px;\n      .arrow-down {\n        left: -130px;\n      }\n    }\n  }\n}\n/* resizer **/\n.@{css-prefix}-resizer {\n  position: absolute;\n  z-index: 11;\n\n  .@{css-prefix}-resizer-hover {\n    background-color: rgba(75, 137, 255, .25);\n  }\n  .@{css-prefix}-resizer-line {\n    position: absolute;\n  }\n\n  &.horizontal {\n    cursor: row-resize;\n    .@{css-prefix}-resizer-line {\n      border-bottom: 2px dashed rgb(75, 137, 255);\n      left: 0;\n      bottom: 0;\n    }\n  }\n  &.vertical {\n    cursor: col-resize;\n    .@{css-prefix}-resizer-line {\n      border-right: 2px dashed rgb(75, 137, 255);\n      top: 0;\n      right: 0;\n    }\n  }\n}\n/* scrollbar */\n.@{css-prefix}-scrollbar {\n  position: absolute;\n  bottom: 0;\n  right: 0;\n  background-color: #f4f5f8;\n  opacity: 0.9;\n  z-index: 12;\n  &.horizontal {\n    right: 15px;\n    overflow-x: scroll;\n    overflow-y: hidden;\n    > div {\n      height: 1px;\n      background: #ddd;\n    }\n  }\n  &.vertical {\n    bottom: 15px;\n    overflow-x: hidden;\n    overflow-y: scroll;\n    > div {\n      width: 1px;\n      background: #ddd;\n    }\n  }\n  &:hover {\n    // opacity: .85;\n  }\n}\n\n/* @{css-prefix}-overlayer */\n.@{css-prefix}-overlayer {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 10;\n  .@{css-prefix}-overlayer-content {\n    position: absolute;\n    overflow: hidden;\n    pointer-events: none;\n    width: 100%;\n    height: 100%;\n  }\n}\n\n.@{css-prefix}-editor, .@{css-prefix}-selector {\n  box-sizing: content-box;\n  position: absolute;\n  overflow: hidden;\n  pointer-events: none;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n/* @{css-prefix}-selector */\n.@{css-prefix}-selector {\n  .hide-input {\n    position: absolute;\n    z-index: 0;\n    input {\n      padding: 0;\n      width: 0;\n      border: none!important;\n    }\n  }\n  .@{css-prefix}-selector-area {\n    position: absolute;\n    border: 2px solid rgb(75, 137, 255);\n    background: rgba(75, 137, 255, .1);\n    z-index: 5;\n  }\n  .@{css-prefix}-selector-clipboard, .@{css-prefix}-selector-autofill {\n    position: absolute;\n    background: transparent;\n    z-index: 100;\n  }\n  .@{css-prefix}-selector-clipboard {\n    border: 2px dashed rgb(75, 137, 255);\n  }\n  .@{css-prefix}-selector-autofill {\n    border: 1px dashed rgba(0, 0, 0, .45); // #606060; // rgba(0, 0, 0, .2);\n  }\n  .@{css-prefix}-selector-corner {\n    pointer-events: auto;\n    position: absolute;\n    cursor: crosshair;\n    font-size: 0;\n    height: 5px;\n    width: 5px;\n    right: -5px;\n    bottom: -5px;\n    border: 2px solid rgb(255, 255, 255);\n    background: rgb(75, 137, 255);\n  }\n}\n.@{css-prefix}-editor {\n  z-index: 20;\n  .@{css-prefix}-editor-area {\n    position: absolute;\n    text-align: left;\n    border: 2px solid rgb(75, 137, 255);\n    line-height: 0;\n    z-index: 100;\n    pointer-events: auto;\n\n    textarea {\n      box-sizing: content-box;\n      border: none;\n      padding: 0 3px;\n      outline: none;\n      resize: none;\n      text-align: start;\n      overflow-y: hidden;\n      font: 400 13px Arial, 'Lato', 'Source Sans Pro', Roboto, Helvetica, sans-serif;\n      color: inherit;\n      white-space: normal;\n      word-wrap: break-word;\n      line-height: 22px;\n      margin: 0;\n    }\n\n    .textline {\n      overflow: hidden;\n      visibility: hidden;\n      position: fixed;\n      top: 0;\n      left: 0;\n    }\n  }\n}\n\n.@{css-prefix}-item {\n  user-select: none;\n  background: 0;\n  border: 1px solid transparent;\n  outline: none;\n  height: 26px;\n  color: rgba(0, 0, 0, .9);\n  line-height: 26px;\n  list-style: none;\n  padding: 2px 10px;\n  cursor: default;\n  text-align: left;\n  overflow: hidden;\n\n  &.disabled {\n    pointer-events: none;\n    opacity: 0.5;\n  }\n\n  &:hover, &.active {\n    background: rgba(0, 0, 0, .05);\n  }\n\n  // &.active {\n    ////   background: #89aef53d;\n  // }\n\n  &.divider {\n    height: 0;\n    padding: 0;\n    margin: 5px 0;\n    border: none;\n    border-bottom: 1px solid rgba(0, 0, 0, .1);\n  }\n\n  .label {\n    float: right;\n    opacity: .65;\n    font-size: 1em;\n  }\n}\n\n.x-spreadsheet-item,\n.x-spreadsheet-header,\n{\n\n  &.state {\n    padding-left: 35px!important;\n    position: relative;\n\n    &:before {\n      content: '';\n      position: absolute;\n      width: 10px;\n      height: 10px;\n      left: 12px;\n      top: calc(50% - 5px);\n      background: rgba(0, 0, 0, 0.08);\n      // border: 1px solid rgba(0, 0, 0, 0.1);\n      border-radius: 2px;\n    }\n  }\n  &.state.checked:before {\n    background: #4b89ff;\n    // content: '';\n    // position: absolute;\n    // width: 5px;\n    // height: 12px;\n    // color: #4b89ff; // #353A41;\n    // border-left: none;\n    // border-top: none;\n    // border-bottom: 2px solid;\n    // border-right: 2px solid;\n    // left: 15px;\n    // top: 6px;\n    // background: none;\n    // border-radius: 0;\n    // transform-origin: center;\n    // transform: rotate(45deg);\n    // -webkit-transform: rotate(45deg);\n  }\n\n}\n\n.@{css-prefix}-checkbox {\n  position: relative;\n  display: inline-block;\n  backface-visibility: hidden;\n  outline: 0;\n  vertical-align: baseline;\n  font-style: normal;\n  font-size: 1rem;\n  line-height: 1em;\n  > input {\n    position: absolute;\n    top: 0;\n    left: 0;\n    opacity: 0!important;\n    outline: 0;\n    z-index: -1;\n  }\n}\n\n.@{css-prefix}-suggest,\n.@{css-prefix}-contextmenu,\n.@{css-prefix}-sort-filter {\n  position: absolute;\n  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);\n  background: #fff;\n  z-index: 100;\n  width: 260px;\n  pointer-events: auto;\n  overflow: auto;\n}\n\n.@{css-prefix}-suggest {\n  width: 200px;\n}\n\n.@{css-prefix}-filter {\n  border: 1px solid #e9e9e9;\n  font-size: 12px;\n  margin: 10px;\n\n  .@{css-prefix}-header {\n    padding: .5em .75em;\n    background: #f8f8f9;\n    border-bottom: 1px solid #e9e9e9;\n    border-left: 1px solid transparent;\n  }\n  .@{css-prefix}-body {\n    height: 200px;\n    overflow-y: auto;\n\n    .@{css-prefix}-item {\n      height: 20px;\n      line-height: 20px;\n    }\n  }\n}\n\n.@{css-prefix}-sort-filter {\n  .@{css-prefix}-buttons {\n    margin: 10px;\n  }\n}\n\n.@{css-prefix}-toolbar, .@{css-prefix}-bottombar {\n  height: 40px;\n  padding: 0 30px;\n  text-align: left;\n  background: #f5f6f7;\n  display: flex;\n}\n\n.@{css-prefix}-bottombar {\n  position: relative;\n  border-top: 1px solid #e0e2e4;\n\n  .@{css-prefix}-menu > li {\n    line-height: 40px;\n    height: 40px;\n    padding-top: 0;\n    padding-bottom: 0;\n    vertical-align: middle;\n    border-right: 1px solid #e8eaed;\n  }\n}\n\n.@{css-prefix}-menu {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  user-select: none;\n}\n.@{css-prefix}-menu > li {\n  float: left;\n  line-height: 1.25em;\n  padding: .785em 1em;\n  margin: 0;\n  vertical-align: middle;\n  text-align: left;\n  font-weight: 400;\n  color: #80868b;\n  white-space: nowrap;\n  cursor: pointer;\n  transition: all .3s;\n  font-weight: bold;\n\n  &.active {\n    background-color: #fff;\n    color: rgba(0, 0, 0, .65);\n  }\n\n  .@{css-prefix}-icon {\n    margin: 0 6px;\n\n    .@{css-prefix}-icon-img {\n      &:hover {\n        opacity: .85;\n      }\n    }\n  }\n\n  .@{css-prefix}-dropdown {\n    display: inline-block;\n  }\n}\n\n.@{css-prefix}-toolbar {\n  border-bottom: 1px solid #e0e2e4;\n\n  .@{css-prefix}-toolbar-btns {\n    display: inline-flex;\n  }\n\n  .@{css-prefix}-toolbar-more {\n    padding: 0 6px 6px;\n    text-align: left;\n    .@{css-prefix}-toolbar-divider {\n      margin-top: 0;\n    }\n  }\n\n  .@{css-prefix}-toolbar-btn {\n    flex: 0 0 auto;\n    display: inline-block;\n    border: 1px solid transparent;\n    height: 26px;\n    line-height: 26px;\n    min-width: 26px;\n    margin: 6px 1px 0;\n    padding: 0;\n    text-align: center;\n    border-radius: 2px;\n\n    &.disabled {\n      pointer-events: none;\n      opacity: 0.5;\n    }\n\n    &:hover, &.active {\n      background: rgba(0, 0, 0, .08);\n    }\n  }\n}\n\n.@{css-prefix}-toolbar-divider {\n  display: inline-block;\n  border-right: 1px solid #e0e2e4;\n  width: 0;\n  vertical-align: middle;\n  height: 18px;\n  margin: 12px 3px 0;\n}\n\n.@{css-prefix}-print {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 100;\n  width: 100%;\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n.@{css-prefix}-print-bar {\n  background: #424242;\n  height: 60px;\n  line-height: 60px;\n  padding: 0 30px;\n\n  .-title {\n    color: #fff;\n    font-weight: bold;\n    font-size: 1.2em;\n    float: left;\n  }\n\n  .-right {\n    float: right;\n    margin-top: 12px;\n  }\n}\n.@{css-prefix}-print-content {\n  display: flex;\n  flex: auto;\n  flex-direction: row;\n  background: #d0d0d0;\n  height: calc(100% - 60px);\n\n  .-sider {\n    flex: 0 0 300px;\n    width: 300px;\n    border-left: 2px solid #ccc;\n    background: #fff;\n  }\n\n  .-content {\n    flex: auto;\n    overflow-x: auto;\n    overflow-y: scroll;\n    height: 100%;\n  }\n}\n\n\n.@{css-prefix}-canvas-card-wraper {\n  margin: 40px 20px;\n}\n.@{css-prefix}-canvas-card {\n  background: #fff;\n  margin: auto;\n  page-break-before: auto;\n  page-break-after: always;\n  box-shadow: 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 3px rgba(0,0,0,0.12), 0 4px 5px 0 rgba(0,0,0,0.20);\n}\n\n.@{css-prefix}-calendar {\n  color: rgba(0,0,0,.65);\n  background: #ffffff;\n  user-select: none;\n\n  .calendar-header {\n    font-weight: 700;\n    line-height: 30px;\n    text-align: center;\n    width: 100%;\n    float: left;\n    background: #f9fafb;\n\n    .calendar-header-left {\n      padding-left: 5px;\n      float: left;\n    }\n\n    .calendar-header-right {\n      float: right;\n\n      a {\n        padding: 3px 0;\n        margin-right: 2px;\n        border-radius: 2px;\n      }\n      a:hover {\n        background: rgba(0,0,0,.08);\n      }\n    }\n  }\n\n  .calendar-body {\n    border-collapse: collapse;\n    border-spacing: 0;\n\n    th, td {\n      width: 100%/7;\n      min-width: 32px;\n      text-align: center;\n      font-weight: 700;\n      line-height: 30px;\n      padding: 0;\n    }\n\n    td > .cell {\n      // border: 1px solid rgba(0,0,0,.05);\n\n      &:hover {\n        background: #ecf6fd;\n      }\n\n      &.active, &.active:hover {\n        background: #ecf6fd;\n        color: #2185D0;\n      }\n\n      &.disabled {\n        pointer-events: none;\n        opacity: 0.5;\n      }\n    }\n  }\n}\n\n.@{css-prefix}-datepicker {\n  box-shadow: 2px 2px 5px rgba(0,0,0,.2);\n  position: absolute;\n  left: 0;\n  top: calc(100% + 5px);\n  z-index: 10;\n  width: auto;\n}\n\n.@{css-prefix}-buttons {\n  display: flex;\n  justify-content: flex-end;\n\n  .@{css-prefix}-button {\n    margin-left: 8px;\n  }\n}\n.@{css-prefix}-button {\n  display: inline-block;\n  border-radius: 3px;\n  line-height: 1em;\n  min-height: 1em;\n  white-space: nowrap;\n  text-align: center;\n  cursor: pointer;\n  font-size: 1em;\n  font-weight: 700;\n  padding: .75em 1em;\n  color: rgba(0,0,0,.6);\n  background: #E0E1E2;\n  text-decoration: none;\n  font-family: \"Lato\",\"proxima-nova\",\"Helvetica Neue\",Arial,sans-serif;\n  //box-shadow: 0px 1px 2px -1px rgba(255,255,255,0.5) inset, 0px -2px 0px 0px rgba(0,0,0,0.1) inset;\n  //box-shadow: 0 0 0 0 rgba(0,0,0,.5) inset;\n  outline: none;\n  vertical-align: baseline;\n  zoom: 1;\n  user-select: none;\n  transition: all 0.1s linear;\n\n  &.active, &:hover {\n    background-color: #C0C1C2;\n    color: rgba(0,0,0,.8);\n  }\n\n  &.primary {\n    .type-primary;\n  }\n}\n\n// form begin\n.@{css-prefix}-form-input {\n  font-size: 1em;\n  position: relative;\n  font-weight: 400;\n  display: inline-flex;\n  color: rgba(0,0,0,.87);\n\n  input {\n    z-index: 1;\n    margin: 0;\n    max-width: 100%;\n    flex: 1 0 auto;\n    outline: 0;\n    -webkit-tap-highlight-color: rgba(255,255,255,0);\n    text-align: left;\n    line-height: @form-field-height;\n    height: @form-field-height;\n    padding: 0 8px;\n    background: #fff;\n    border: 1px solid #e9e9e9;\n    border-radius: 3px;\n    transition: box-shadow .1s ease,border-color .1s ease;\n    box-shadow: inset 0 1px 2px hsla(0,0%,4%,.06);\n\n    &:focus {\n      border-color: rgb(75, 137, 255);\n      box-shadow: inset 0 1px 2px rgba(75, 137, 255, .2);\n    }\n  }\n}\n\n.@{css-prefix}-form-select {\n  position: relative;\n  display: inline-block;\n  background: #fff;\n  border: @input-border;\n  border-radius: 2px;\n  cursor: pointer;\n  color: rgba(0,0,0,.87);\n  user-select: none;\n  box-shadow: inset 0 1px 2px hsla(0,0%,4%,.06);\n\n  .input-text {\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    min-width: 60px;\n    width: auto;\n    height: @form-field-height;\n    line-height: @form-field-height;\n    padding: 0 8px;\n  }\n}\n.@{css-prefix}-form-fields {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n\n  .@{css-prefix}-form-field {\n    flex: 0 1 auto;\n    .label {\n      display: inline-block;\n      margin: 0 10px 0 0;\n    }\n  }\n}\n.@{css-prefix}-form-field {\n  display: block;\n  vertical-align: middle;\n  margin-left: 10px;\n  margin-bottom: 10px;\n\n  &:first-child {\n    margin-left: 0;\n  }\n\n  &.error {\n    .@{css-prefix}-form-select, input {\n      border-color: #f04134;\n    }\n  }\n\n  .tip {\n    color: #f04134;\n    font-size: .9em;\n  }\n}\n// form end\n.@{css-prefix}-dimmer {\n  display: none;\n  position: absolute;\n  top: 0 !important;\n  left: 0 !important;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  vertical-align: middle;\n  background-color: rgba(0, 0, 0, 0.6);\n  opacity: 0;\n  -webkit-animation-fill-mode: both;\n  animation-fill-mode: both;\n  -webkit-animation-duration: 0.5s;\n  animation-duration: 0.5s;\n  transition: background-color 0.5s linear;\n  user-select: none;\n  z-index: 1000;\n\n  &.active {\n    display: block;\n    opacity: 1;\n  }\n}\n\nform fieldset {\n  border: none;\n\n  label {\n    display: block;\n    margin-bottom: .5em;\n    font-size: 1em;\n    color: #666;\n  }\n\n  select {\n    font-size: 1.1em;\n    width: 100%;\n    background-color: #fff;\n    border: none;\n    border-bottom: 2px solid #ddd;\n    padding: .5em .85em;\n    border-radius: 2px;\n  }\n}\n\n.@{css-prefix}-modal, .@{css-prefix}-toast {\n  font-size: 13px;\n  position: fixed;\n  z-index: 1001;\n  text-align: left;\n  line-height: @line-height;\n  min-width: 360px;\n  color: rgba(0,0,0,.87);\n  font-family: 'Lato', 'Source Sans Pro', Roboto, Helvetica, Arial, sans-serif;\n  border-radius: 4px;\n  border: 1px solid rgba(0,0,0,.1);\n  background-color: #fff;\n  background-clip: padding-box;\n  box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px;\n}\n\n.@{css-prefix}-toast {\n  background-color: rgba(255,255,255,.85);\n}\n\n.@{css-prefix}-modal-header, .@{css-prefix}-toast-header {\n  font-weight: 600;\n  background-clip: padding-box;\n  background-color: rgba(255,255,255,.85);\n  border-bottom: 1px solid rgba(0,0,0,.05);\n  border-radius: 4px 4px 0 0;\n\n  .@{css-prefix}-icon {\n    position: absolute;\n    right: .8em;\n    top: .65em;\n    border-radius: 18px;\n\n    &:hover {\n      opacity: 1;\n      background: rgba(0, 0, 0, 0.08);\n    }\n  }\n}\n\n.@{css-prefix}-toast-header {\n  color: @orange-color;\n}\n\n.@{css-prefix}-modal-header {\n  border-bottom: @border-style;\n  background: rgba(0, 0, 0, .08);\n  font-size: 1.0785em;\n}\n\n.@{css-prefix}-modal-header,\n.@{css-prefix}-modal-content,\n.@{css-prefix}-toast-header,\n.@{css-prefix}-toast-content {\n  padding: .75em 1em;\n}\n\n@media screen and (min-width: 320px) and (max-width: 480px) {\n  .@{css-prefix}-toolbar {\n    display: none;\n  }\n}\n\n.@{css-prefix}-icon {\n  width: 18px;\n  height: 18px;\n  margin: 1px 1px 2px 1px;\n  text-align: center;\n  vertical-align: middle;\n  user-select: none;\n  overflow: hidden;\n  position: relative;\n  display: inline-block;\n  line-height: 0;\n\n  .@{css-prefix}-icon-img {\n    background-image: url('../assets/sprite.svg');\n    position: absolute;\n    width: 262px;\n    height: 444px;\n    opacity: 0.56;\n\n    &.undo {\n      left: 0;\n      top: 0;\n    }\n    &.redo {\n      left: -1 * @icon-size;\n      top: 0;\n    }\n    &.print {\n      left: -2 * @icon-size;\n      top: 0;\n    }\n    &.paintformat {\n      left: -3 * @icon-size;\n      top: 0;\n    }\n    &.clearformat {\n      left: -4 * @icon-size;\n      top: 0;\n    }\n    &.font-bold {\n      left: -5 * @icon-size;\n      top: 0;\n    }\n    &.font-italic {\n      left: -6 * @icon-size;\n      top: 0;\n    }\n    &.underline {\n      left: -7 * @icon-size;\n      top: 0;\n    }\n    &.strike {\n      left: -8 * @icon-size;\n      top: 0;\n    }\n    &.color {\n      left: -9 * @icon-size;\n      top: 0;\n    }\n    &.bgcolor {\n      left: -10 * @icon-size;\n      top: 0;\n    }\n    &.merge {\n      left: -11 * @icon-size;\n      top: 0;\n    }\n    &.align-left {\n      left: -12 * @icon-size;\n      top: 0;\n    }\n    &.align-center {\n      left: -13 * @icon-size;\n      top: 0;\n    }\n    &.align-right {\n      left: 0;\n      top: -1 * @icon-size;\n    }\n    &.align-top {\n      left: -1 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.align-middle {\n      left: -2 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.align-bottom {\n      left: -3 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.textwrap {\n      left: -4 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.autofilter {\n      left: -5 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.formula {\n      left: -6 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.arrow-down {\n      left: -7 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.arrow-right {\n      left: -8 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.link {\n      left: -9 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.chart {\n      left: -10 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.freeze {\n      left: -11 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.ellipsis {\n      left: -12 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.add {\n      left: -13 * @icon-size;\n      top: -1 * @icon-size;\n    }\n    &.border-all {\n      left: 0;\n      top: -2 * @icon-size;\n    }\n    &.border-inside {\n      left: -1 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-horizontal {\n      left: -2 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-vertical {\n      left: -3 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-outside {\n      left: -4 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-left {\n      left: -5 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-top {\n      left: -6 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-right {\n      left: -7 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-bottom {\n      left: -8 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.border-none {\n      left: -9 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.line-color {\n      left: -10 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.line-type {\n      left: -11 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.close {\n      left: -13 * @icon-size;\n      top: -2 * @icon-size;\n    }\n    &.chevron-down {\n      left: 0;\n      top: -3 * @icon-size;\n    }\n    &.chevron-up {\n      left: -1 * @icon-size;\n      top: -3 * @icon-size;\n    }\n    &.chevron-left {\n      left: -2 * @icon-size;\n      top: -3 * @icon-size;\n    }\n    &.chevron-right {\n      left: -3 * @icon-size;\n      top: -3 * @icon-size;\n    }\n  }\n}\n"
  },
  {
    "path": "src/locale/de.js",
    "content": "export default {\n  toolbar: {\n    undo: 'Rückgängig machen',\n    redo: 'Wiederherstellen',\n    paintformat: 'Format kopieren/einfügen',\n    clearformat: 'Format löschen',\n    format: 'Format',\n    font: 'Schriftart',\n    fontSize: 'Schriftgrad',\n    fontBold: 'Fett',\n    fontItalic: 'Kursiv',\n    underline: 'Betonen',\n    strike: 'Streichen',\n    textColor: 'Text Farbe',\n    fillColor: 'Füllung Farbe',\n    border: 'Umrandung',\n    merge: 'Zellen verbinden',\n    align: 'Waagrechte Ausrichtung',\n    valign: 'Vertikale uitlijning',\n    textwrap: 'Textumbruch',\n    freeze: 'Zelle sperren',\n    formula: 'Funktionen',\n    more: 'Mehr',\n  },\n  contextmenu: {\n    copy: 'Kopieren',\n    cut: 'Ausschneiden',\n    paste: 'Einfügen',\n    pasteValue: 'Nur Werte einfügen',\n    pasteFormat: 'Nur Format einfügen',\n    insertRow: 'Zeile einfügen',\n    insertColumn: 'Spalte einfügen',\n    deleteRow: 'Zeile löschen',\n    deleteColumn: 'Spalte löschen',\n    deleteCell: 'Zelle löschen',\n    deleteCellText: 'Zellentext löschen',\n  },\n  format: {\n    normal: 'Regulär',\n    text: 'Text',\n    number: 'Nummer',\n    percent: 'Prozent',\n    rmb: 'RMB',\n    usd: 'USD',\n    date: 'Datum',\n    time: 'Termin',\n    datetime: 'Datum Termin',\n    duration: 'Dauer',\n  },\n  formula: {\n    sum: 'Summe',\n    average: 'Durchschnittliche',\n    max: 'Max',\n    min: 'Min',\n    concat: 'Concat',\n  },\n};\n"
  },
  {
    "path": "src/locale/en.js",
    "content": "export default {\n  toolbar: {\n    undo: 'Undo',\n    redo: 'Redo',\n    print: 'Print',\n    paintformat: 'Paint format',\n    clearformat: 'Clear format',\n    format: 'Format',\n    fontName: 'Font',\n    fontSize: 'Font size',\n    fontBold: 'Font bold',\n    fontItalic: 'Font italic',\n    underline: 'Underline',\n    strike: 'Strike',\n    color: 'Text color',\n    bgcolor: 'Fill color',\n    border: 'Borders',\n    merge: 'Merge cells',\n    align: 'Horizontal align',\n    valign: 'Vertical align',\n    textwrap: 'Text wrapping',\n    freeze: 'Freeze cell',\n    autofilter: 'Filter',\n    formula: 'Functions',\n    more: 'More',\n  },\n  contextmenu: {\n    copy: 'Copy',\n    cut: 'Cut',\n    paste: 'Paste',\n    pasteValue: 'Paste values only',\n    pasteFormat: 'Paste format only',\n    hide: 'Hide',\n    insertRow: 'Insert row',\n    insertColumn: 'Insert column',\n    deleteSheet: 'Delete',\n    deleteRow: 'Delete row',\n    deleteColumn: 'Delete column',\n    deleteCell: 'Delete cell',\n    deleteCellText: 'Delete cell text',\n    validation: 'Data validations',\n    cellprintable: 'Enable export',\n    cellnonprintable: 'Disable export',\n    celleditable: 'Enable editing',\n    cellnoneditable: 'Disable editing',\n  },\n  print: {\n    size: 'Paper size',\n    orientation: 'Page orientation',\n    orientations: ['Landscape', 'Portrait'],\n  },\n  format: {\n    normal: 'Normal',\n    text: 'Plain Text',\n    number: 'Number',\n    percent: 'Percent',\n    rmb: 'RMB',\n    usd: 'USD',\n    eur: 'EUR',\n    date: 'Date',\n    time: 'Time',\n    datetime: 'Date time',\n    duration: 'Duration',\n  },\n  formula: {\n    sum: 'Sum',\n    average: 'Average',\n    max: 'Max',\n    min: 'Min',\n    _if: 'IF',\n    and: 'AND',\n    or: 'OR',\n    concat: 'Concat',\n  },\n  validation: {\n    required: 'it must be required',\n    notMatch: 'it not match its validation rule',\n    between: 'it is between {} and {}',\n    notBetween: 'it is not between {} and {}',\n    notIn: 'it is not in list',\n    equal: 'it equal to {}',\n    notEqual: 'it not equal to {}',\n    lessThan: 'it less than {}',\n    lessThanEqual: 'it less than or equal to {}',\n    greaterThan: 'it greater than {}',\n    greaterThanEqual: 'it greater than or equal to {}',\n  },\n  error: {\n    pasteForMergedCell: 'Unable to do this for merged cells',\n  },\n  calendar: {\n    weeks: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n    months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n  },\n  button: {\n    next: 'Next',\n    cancel: 'Cancel',\n    remove: 'Remove',\n    save: 'Save',\n    ok: 'OK',\n  },\n  sort: {\n    desc: 'Sort Z -> A',\n    asc: 'Sort A -> Z',\n  },\n  filter: {\n    empty: 'empty',\n  },\n  dataValidation: {\n    mode: 'Mode',\n    range: 'Cell Range',\n    criteria: 'Criteria',\n    modeType: {\n      cell: 'Cell',\n      column: 'Colun',\n      row: 'Row',\n    },\n    type: {\n      list: 'List',\n      number: 'Number',\n      date: 'Date',\n      phone: 'Phone',\n      email: 'Email',\n    },\n    operator: {\n      be: 'between',\n      nbe: 'not betwwen',\n      lt: 'less than',\n      lte: 'less than or equal to',\n      gt: 'greater than',\n      gte: 'greater than or equal to',\n      eq: 'equal to',\n      neq: 'not equal to',\n    },\n  },\n};\n"
  },
  {
    "path": "src/locale/locale.js",
    "content": "/* global window */\nimport en from './en';\n\n// Defines the fallback language as English\nlet $languages = ['en'];\nconst $messages = {\n  en,\n};\n\nfunction translate(key, messages) {\n  if (messages) {\n    // Return the translation from the first language in the languages array\n    // that has a value for the provided key.\n    for (const lang of $languages) {\n      if (!messages[lang]) break;\n\n      let message = messages[lang];\n\n      // Splits the key at '.' except where escaped as '\\.'\n      const keys = key.match(/(?:\\\\.|[^.])+/g);\n\n      for (let i = 0; i < keys.length; i += 1) {\n        const property = keys[i];\n        const value = message[property];\n\n        // If value doesn't exist, try next language\n        if (!value) break;\n\n        if (i === keys.length - 1) return value;\n\n        // Move down to the next level of the messages object\n        message = value;\n      }\n    }\n  }\n\n  return undefined;\n}\n\nfunction t(key) {\n  let v = translate(key, $messages);\n  if (!v && window && window.x_spreadsheet && window.x_spreadsheet.$messages) {\n    v = translate(key, window.x_spreadsheet.$messages);\n  }\n  return v || '';\n}\n\nfunction tf(key) {\n  return () => t(key);\n}\n\n// If clearLangList is set to false, lang will be added to the front of the\n// languages array. The languages in the language array are searched in order\n// to find a translation. This allows the use of other languages as a fallback\n// if lang is missing some keys. The language array is preloaded with English.\n// To set the languages array to only include lang, set clearLangList to true.\nfunction locale(lang, message, clearLangList = false) {\n  if (clearLangList) {\n    $languages = [lang];\n  } else {\n    // Append to front of array.\n    // Translation method will use the first language in the list that has a\n    // matching key.\n    $languages.unshift(lang);\n  }\n\n  if (message) {\n    $messages[lang] = message;\n  }\n}\n\nexport default {\n  t,\n};\n\nexport {\n  locale,\n  t,\n  tf,\n};\n"
  },
  {
    "path": "src/locale/nl.js",
    "content": "export default {\n  toolbar: {\n    undo: 'Ongedaan maken',\n    redo: 'Opnieuw uitvoeren',\n    paintformat: 'Opmaak kopiëren/plakken',\n    clearformat: 'Opmaak wissen',\n    format: 'Opmaak',\n    font: 'Lettertype',\n    fontSize: 'Tekengrootte',\n    fontBold: 'Vet',\n    fontItalic: 'Cursief',\n    underline: 'Onderstrepen',\n    strike: 'Doorstrepen',\n    textColor: 'Tekstkleur',\n    fillColor: 'Opvulkleur',\n    border: 'Randen',\n    merge: 'Cellen samenvoegen',\n    align: 'Horizontale uitlijning',\n    valign: 'Verticale uitlijning',\n    textwrap: 'Terugloop',\n    freeze: 'Cel bevriezen',\n    formula: 'Functies',\n    more: 'Meer',\n  },\n  contextmenu: {\n    copy: 'Kopiëren',\n    cut: 'Knippen',\n    paste: 'Plakken',\n    pasteValue: 'Alleen waarden plakken',\n    pasteFormat: 'Alleen opmaak plakken',\n    insertRow: 'Rij invoegen',\n    insertColumn: 'Kolom invoegen',\n    deleteRow: 'Rij verwijderen',\n    deleteColumn: 'Kolom verwijderen',\n    deleteCell: 'Cel verwijderen',\n    deleteCellText: 'Celtekst verwijderen',\n  },\n  format: {\n    normal: 'Standaard',\n    text: 'Tekst',\n    number: 'Nummer',\n    percent: 'Percentage',\n    rmb: 'RMB',\n    usd: 'USD',\n    date: 'Datum',\n    time: 'Tijdstip',\n    datetime: 'Datum tijd',\n    duration: 'Duratie',\n  },\n  formula: {\n    sum: 'Som',\n    average: 'Gemiddelde',\n    max: 'Max',\n    min: 'Min',\n    concat: 'Concat',\n  },\n};\n"
  },
  {
    "path": "src/locale/zh-cn.js",
    "content": "export default {\n  toolbar: {\n    undo: '撤销',\n    redo: '恢复',\n    print: '打印',\n    paintformat: '格式刷',\n    clearformat: '清除格式',\n    format: '数据格式',\n    fontName: '字体',\n    fontSize: '字号',\n    fontBold: '加粗',\n    fontItalic: '倾斜',\n    underline: '下划线',\n    strike: '删除线',\n    color: '字体颜色',\n    bgcolor: '填充颜色',\n    border: '边框',\n    merge: '合并单元格',\n    align: '水平对齐',\n    valign: '垂直对齐',\n    textwrap: '自动换行',\n    freeze: '冻结',\n    autofilter: '自动筛选',\n    formula: '函数',\n    more: '更多',\n  },\n  contextmenu: {\n    copy: '复制',\n    cut: '剪切',\n    paste: '粘贴',\n    pasteValue: '粘贴数据',\n    pasteFormat: '粘贴格式',\n    hide: '隐藏',\n    insertRow: '插入行',\n    insertColumn: '插入列',\n    deleteSheet: '删除',\n    deleteRow: '删除行',\n    deleteColumn: '删除列',\n    deleteCell: '删除',\n    deleteCellText: '删除数据',\n    validation: '数据验证',\n    cellprintable: '可打印',\n    cellnonprintable: '不可打印',\n    celleditable: '可编辑',\n    cellnoneditable: '不可编辑',\n  },\n  print: {\n    size: '纸张大小',\n    orientation: '方向',\n    orientations: ['横向', '纵向'],\n  },\n  format: {\n    normal: '正常',\n    text: '文本',\n    number: '数值',\n    percent: '百分比',\n    rmb: '人民币',\n    usd: '美元',\n    eur: '欧元',\n    date: '短日期',\n    time: '时间',\n    datetime: '长日期',\n    duration: '持续时间',\n  },\n  formula: {\n    sum: '求和',\n    average: '求平均值',\n    max: '求最大值',\n    min: '求最小值',\n    concat: '字符拼接',\n    _if: '条件判断',\n    and: '和',\n    or: '或',\n  },\n  validation: {\n    required: '此值必填',\n    notMatch: '此值不匹配验证规则',\n    between: '此值应在 {} 和 {} 之间',\n    notBetween: '此值不应在 {} 和 {} 之间',\n    notIn: '此值不在列表中',\n    equal: '此值应该等于 {}',\n    notEqual: '此值不应该等于 {}',\n    lessThan: '此值应该小于 {}',\n    lessThanEqual: '此值应该小于等于 {}',\n    greaterThan: '此值应该大于 {}',\n    greaterThanEqual: '此值应该大于等于 {}',\n  },\n  error: {\n    pasteForMergedCell: '无法对合并的单元格执行此操作',\n  },\n  calendar: {\n    weeks: ['日', '一', '二', '三', '四', '五', '六'],\n    months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n  },\n  button: {\n    next: '下一步',\n    cancel: '取消',\n    remove: '删除',\n    save: '保存',\n    ok: '确认',\n  },\n  sort: {\n    desc: '降序',\n    asc: '升序',\n  },\n  filter: {\n    empty: '空白',\n  },\n  dataValidation: {\n    mode: '模式',\n    range: '单元区间',\n    criteria: '条件',\n    modeType: {\n      cell: '单元格',\n      column: '列模式',\n      row: '行模式',\n    },\n    type: {\n      list: '列表',\n      number: '数字',\n      date: '日期',\n      phone: '手机号',\n      email: '电子邮件',\n    },\n    operator: {\n      be: '在区间',\n      nbe: '不在区间',\n      lt: '小于',\n      lte: '小于等于',\n      gt: '大于',\n      gte: '大于等于',\n      eq: '等于',\n      neq: '不等于',\n    },\n  },\n};\n"
  },
  {
    "path": "test/core/alphabet_test.js",
    "content": "// const = require('../../src/data/);\nimport assert from 'assert';\nimport { describe, it } from 'mocha';\nimport {\n  indexAt,\n  stringAt,\n  expr2xy,\n  expr2expr,\n} from '../../src/core/alphabet';\n\ndescribe('alphabet', () => {\n  describe('.indexAt()', () => {\n    it('should return 0 when the value is A', () => {\n      assert.equal(indexAt('A'), 0);\n    });\n    it('should return 25 when the value is Z', () => {\n      assert.equal(indexAt('Z'), 25);\n    });\n    it('should return 26 when the value is AA', () => {\n      assert.equal(indexAt('AA'), 26);\n    });\n    it('should return 52 when the value is BA', () => {\n      assert.equal(indexAt('BA'), 52);\n    });\n    it('should return 54 when the value is BC', () => {\n      assert.equal(indexAt('BC'), 54);\n    });\n    it('should return 78 when the value is CA', () => {\n      assert.equal(indexAt('CA'), 78);\n    });\n    it('should return 26 * 26 when the value is ZA', () => {\n      assert.equal(indexAt('ZA'), 26 * 26);\n    });\n    it('should return 26 * 26 + 26 when the value is AAA', () => {\n      assert.equal(indexAt('AAA'), (26 * 26) + 26);\n    });\n  });\n  describe('.stringAt()', () => {\n    it('should return A when the value is 0', () => {\n      assert.equal(stringAt(0), 'A');\n    });\n    it('should return Z when the value is 25', () => {\n      assert.equal(stringAt(25), 'Z');\n    });\n    it('should return AA when the value is 26', () => {\n      assert.equal(stringAt(26), 'AA');\n    });\n    it('should return BC when the value is 54', () => {\n      assert.equal(stringAt(54), 'BC');\n    });\n    it('should return CB when the value is 78', () => {\n      assert.equal(stringAt(78), 'CA');\n    });\n    it('should return ZA when the value is 26 * 26', () => {\n      assert.equal(stringAt(26 * 26), 'ZA');\n    });\n    it('should return Z when the value is 26 * 26 + 1', () => {\n      assert.equal(stringAt((26 * 26) + 1), 'ZB');\n    });\n    it('should return AAA when the value is 26 * 26 + 26', () => {\n      assert.equal(stringAt((26 * 26) + 26), 'AAA');\n    });\n  });\n  describe('.expr2xy()', () => {\n    it('should return 0 when the value is A1', () => {\n      assert.equal(expr2xy('A1')[0], 0);\n      assert.equal(expr2xy('A1')[1], 0);\n    });\n  });\n  describe('.expr2expr()', () => {\n    it('should return B2 when the value is A1, 1, 1', () => {\n      assert.equal(expr2expr('A1', 1, 1), 'B2');\n    });\n    it('should return C4 when the value is A1, 2, 3', () => {\n      assert.equal(expr2expr('A1', 2, 3), 'C4');\n    });\n  });\n});\n"
  },
  {
    "path": "test/core/cell_range_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport { CellRange } from '../../src/core/cell_range';\n\ndescribe('CellRange', () => {\n  describe('#constructor()', () => {\n    it('should return { sri: 1, sci: 2, eri: 3, eci: 4, w: 0, h: 0 } when new CellRange(1,2,3,4)', () => {\n      const cr = new CellRange(1, 2, 3, 4);\n      assert.equal(cr.sri, 1);\n      assert.equal(cr.sci, 2);\n      assert.equal(cr.eri, 3);\n      assert.equal(cr.eci, 4);\n      assert.equal(cr.w, 0);\n      assert.equal(cr.h, 0);\n    });\n    it('should return { sri: 1, sci: 2, eri: 3, eci: 4, w: 5, h: 6 } when new CellRange(1,2,3,4, 5, 6)', () => {\n      const cr = new CellRange(1, 2, 3, 4, 5, 6);\n      assert.equal(cr.sri, 1);\n      assert.equal(cr.sci, 2);\n      assert.equal(cr.eri, 3);\n      assert.equal(cr.eci, 4);\n      assert.equal(cr.w, 5);\n      assert.equal(cr.h, 6);\n    });\n  });\n  \n  describe('#set()', () => {\n    it('should return { sri: 1, sci: 2, eri: 3, eci: 4 } when set(1, 2, 3, 4)', () => {\n      const cr = new CellRange(0, 0, 0, 0);\n      cr.set(1, 2, 3, 4);\n      assert.equal(cr.sri, 1);\n      assert.equal(cr.sci, 2);\n      assert.equal(cr.eri, 3);\n      assert.equal(cr.eci, 4);\n    });\n  });\n\n  describe('#multiple()', () => {\n    it('should return true when new CellRange(1, 2, 1, 3)', () => {\n      const cr = new CellRange(1, 2, 1, 3);\n      assert.ok(cr.multiple());\n    });\n    it('should return true when new CellRange(1, 1, 2, 1)', () => {\n      const cr = new CellRange(1, 1, 2, 1);\n      assert.ok(cr.multiple());\n    });\n    it('should return false when new CellRange(1, 1, 1, 1)', () => {\n      const cr = new CellRange(1, 1, 1, 1);\n      assert.equal(false, cr.multiple());\n    });\n  });\n\n  describe('#includes()', () => {\n    it('should return true when the value is A10', () => {\n      const cr = new CellRange(0, 0, 9, 1);\n      assert.ok(cr.includes('A10'));\n    });\n    it('should return true when the value is 0, 1', () => {\n      const cr = new CellRange(0, 0, 9, 1);\n      assert.ok(cr.includes(0, 1));\n    });\n    it('should return false when the value is A11', () => {\n      const cr = new CellRange(0, 0, 9, 1);\n      assert.equal(false, cr.includes('A11'));\n    });\n    it('should return false when the value is A1', () => {\n      const cr = new CellRange(0, 0, 9, 1);\n      assert.equal(false, cr.includes('A11'));\n    });\n  });\n\n  describe('#contains()', () => {\n    it('should return true when the value is {sri: 2, sci: 2, eri: 2, eci: 2}', () => {\n      const cr = new CellRange(0, 0, 5, 5);\n      const other = new CellRange(2, 2, 2, 2);\n      assert.ok(cr.contains(other));\n    });\n    it('should return true when the value is {sri: 5, sci: 5, eri: 5, eci: 5}', () => {\n      const cr = new CellRange(0, 0, 5, 5);\n      const other = new CellRange(5, 5, 5, 5);\n      assert.ok(cr.contains(other));\n    });\n    it('should return false when the value is {sri: 5, sci: 6, eri: 5, eci: 6}', () => {\n      const cr = new CellRange(0, 0, 5, 5);\n      const other = new CellRange(5, 6, 5, 6);\n      assert.equal(false, cr.contains(other));\n    });\n    it('should return true when the value is {sri: 1, sci: 1, eri: 3, eci: 3}', () => {\n      const cr = new CellRange(2, 2, 5, 5);\n      const other = new CellRange(1, 1, 3, 3);\n      assert.equal(false, cr.contains(other));\n    });\n  });\n\n  describe('#within()', () => {\n    it('should return false when the value is {sri: 2, sci: 2, eri: 2, eci: 2}', () => {\n      const cr = new CellRange(0, 0, 5, 5);\n      const other = new CellRange(2, 2, 2, 2);\n      assert.equal(false, cr.within(other));\n    });\n    it('should return false when the value is {sri: 1, sci: 1, eri: 1, eci: 6}', () => {\n      const cr = new CellRange(1, 1, 1, 6);\n      const other = new CellRange(2, 2, 5, 5);\n      assert.equal(false, cr.within(other));\n    });\n    it('should return false when the value is {sri: 6, sci: 3, eri: 6, eci: 4}', () => {\n      const cr = new CellRange(6, 3, 6, 4);\n      const other = new CellRange(2, 2, 5, 5);\n      assert.equal(false, cr.within(other));\n    });\n    it('should return true when the value is {sri: 2, sci: 2, eri: 5, eci: 5}', () => {\n      const cr = new CellRange(2, 2, 2, 2);\n      const other = new CellRange(2, 2, 5, 5);\n      assert.ok(cr.within(other));\n    });\n  });\n\n  describe('#disjoint()', () => {\n    it('should return true when the value is {sri: 2, sci: 2, eri: 2, eci: 2}', () => {\n      const cr = new CellRange(4, 4, 6, 8);\n      const other = new CellRange(2, 2, 2, 2);\n      assert.ok(cr.disjoint(other));\n    });\n    it('should return true when the value is {sri: 2, sci: 2, eri: 3, eci: 2}', () => {\n      const cr = new CellRange(4, 4, 6, 8);\n      const other = new CellRange(2, 2, 3, 2);\n      assert.ok(cr.disjoint(other));\n    });\n    it('should return false when the value is {sri: 4, sci: 4, eri: 4, eci: 4}', () => {\n      const cr = new CellRange(4, 4, 6, 8);\n      const other = new CellRange(4, 4, 4, 4);\n      assert.equal(false, cr.disjoint(other));\n    });\n    it('should return false when the value is {sri: 5, sci: 2, eri: 5, eci: 9}', () => {\n      const cr = new CellRange(4, 4, 6, 8);\n      const other = new CellRange(5, 2, 5, 9);\n      assert.equal(false, cr.disjoint(other));\n    });\n  });\n\n  describe('#intersects()', () => {\n    // contains\n    it('should return true when the value is {sri: 5, sci: 5, eri: 5, eci: 5}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(5, 5, 5, 5);\n      assert.ok(cr.intersects(other));\n    });\n    // cross 1\n    it('should return true when the value is {sri: 4, sci: 2, eri: 4, eci: 9}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(4, 2, 4, 9);\n      assert.ok(cr.intersects(other));\n    });\n    // cross 2\n    it('should return true when the value is {sri: 2, sci: 4, eri: 9, eci: 4}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(2, 4, 9, 4);\n      assert.ok(cr.intersects(other));\n    });\n    // overlap top\n    it('should return true when the value is {sri: 1, sci: 5, eri: 3, eci: 9}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(1, 5, 3, 9);\n      assert.ok(cr.intersects(other));\n    });\n    // overlap bottom\n    it('should return true when the value is {sri: 8, sci: 5, eri: 10, eci: 9}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(8, 5, 10, 9);\n      assert.ok(cr.intersects(other));\n    });\n    // overlap left\n    it('should return true when the value is {sri: 3, sci: 1, eri: 4, eci: 5}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(3, 1, 4, 5);\n      assert.ok(cr.intersects(other));\n    });\n    // overlap right\n    it('should return true when the value is {sri: 8, sci: 5, eri: 10, eci: 9}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(3, 8, 4, 10);\n      assert.ok(cr.intersects(other));\n    });\n    // left top\n    it('should return true when the value is {sri: 3, sci: 3, eri: 3, eci: 3}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(3, 3, 3, 3);\n      assert.ok(cr.intersects(other));\n    });\n    // left bottom\n    it('should return true when the value is {sri: 8, sci: 3, eri: 8, eci: 3}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(8, 3, 8, 3);\n      assert.ok(cr.intersects(other));\n    });\n    // right top\n    it('should return true when the value is {sri: 3, sci: 8, eri: 3, eci: 8}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(3, 8, 3, 8);\n      assert.ok(cr.intersects(other));\n    });\n    // right bottom\n    it('should return true when the value is {sri: 8, sci: 8, eri: 8, eci: 8}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(8, 8, 8, 8);\n      assert.ok(cr.intersects(other));\n    });\n    // test for false\n    // top false\n    it('should return false when the value is {sri: 2, sci: 4, eri: 2, eci: 7}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(2, 4, 2, 7);\n      assert.equal(false, cr.intersects(other));\n    });\n    // bottom false\n    it('should return false when the value is {sri: 9, sci: 4, eri: 9, eci: 7}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(9, 4, 9, 7);\n      assert.equal(false, cr.intersects(other));\n    });\n    // left false\n    it('should return false when the value is {sri: 4, sci: 1, eri: 4, eci: 2}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(4, 1, 4, 2);\n      assert.equal(false, cr.intersects(other));\n    });\n    // right false\n    it('should return false when the value is {sri: 4, sci: 9, eri: 4, eci: 10}', () => {\n      const cr = new CellRange(3, 3, 8, 8);\n      const other = new CellRange(4, 9, 4, 10);\n      assert.equal(false, cr.intersects(other));\n    });\n  });\n\n  describe('#union()',  () => {\n    it('should return {1,1,5,5} when the value is {3,3,5,5}', () => {\n      const cr = new CellRange(1, 1, 3, 3);\n      const other = new CellRange(3, 3, 5, 5);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // top\n    it('should return {1,1,5,5} when the value is {1,3,2,3}', () => {\n      const cr = new CellRange(2, 1, 5, 5);\n      const other = new CellRange(1, 3, 2, 3);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // top right\n    it('should return {1,1,5,7} when the value is {1,3,2,7}', () => {\n      const cr = new CellRange(2, 1, 5, 5);\n      const other = new CellRange(1, 3, 2, 7);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 7);\n    });\n    // top left\n    it('should return {1,0,5,5} when the value is {1,0,2,3}', () => {\n      const cr = new CellRange(2, 1, 5, 5);\n      const other = new CellRange(1, 0, 2, 3);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 0);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // bottom\n    it('should return {1,1,5,5} when the value is {3,2,5,2}', () => {\n      const cr = new CellRange(1, 1, 3, 5);\n      const other = new CellRange(3, 2, 5, 2);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // bottom right\n    it('should return {1,1,5,7} when the value is {3,2,5,7}', () => {\n      const cr = new CellRange(1, 1, 3, 5);\n      const other = new CellRange(3, 2, 5, 7);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 7);\n    });\n    // bottom left\n    it('should return {1,0,5,5} when the value is {3,0,5,2}', () => {\n      const cr = new CellRange(1, 1, 3, 5);\n      const other = new CellRange(3, 0, 5, 2);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 0);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // left\n    it('should return {1,1,5,5} when the value is {3,1,3,2}', () => {\n      const cr = new CellRange(1, 2, 5, 5);\n      const other = new CellRange(3, 1, 3, 2);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // left top\n    it('should return {1,1,5,5} when the value is {1,1,3,2}', () => {\n      const cr = new CellRange(2, 2, 5, 5);\n      const other = new CellRange(1, 1, 3, 2);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // left bottom\n    it('should return {1,1,7,5} when the value is {3,1,7,1}', () => {\n      const cr = new CellRange(1, 1, 5, 5);\n      const other = new CellRange(3, 1, 7, 1);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 7);\n      assert.equal(ret.eci, 5);\n    });\n    // right\n    it('should return {1,1,5,5} when the value is {2,4,3,5}', () => {\n      const cr = new CellRange(1, 1, 5, 3);\n      const other = new CellRange(2, 4, 3, 5);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // right top\n    it('should return {1,1,5,5} when the value is {1,4,3,5}', () => {\n      const cr = new CellRange(2, 1, 5, 3);\n      const other = new CellRange(1, 4, 3, 5);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n    // right bottom\n    it('should return {1,1,5,5} when the value is {1,4,5,5}', () => {\n      const cr = new CellRange(1, 1, 3, 3);\n      const other = new CellRange(1, 4, 5, 5);\n      const ret = cr.union(other);\n      assert.equal(ret.sri, 1);\n      assert.equal(ret.sci, 1);\n      assert.equal(ret.eri, 5);\n      assert.equal(ret.eci, 5);\n    });\n  });\n\n});\n\n"
  },
  {
    "path": "test/core/cell_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport cell, { infixExprToSuffixExpr } from '../../src/core/cell';\nimport { formulam } from '../../src/core/formula';\n\ndescribe('infixExprToSuffixExpr', () => {\n  it('should return myname:A1 score:50 when the value is CONCAT(\"my name:\", A1, \" score:\", 50)', () => {\n    assert.equal(infixExprToSuffixExpr('CONCAT(\"my name:\", A1, \" score:\", 50)').join(''), '\"my name:A1\" score:50CONCAT,4');\n  });\n  it('should return A1B2SUM,2C1C5AVERAGE,350B20++ when the value is AVERAGE(SUM(A1,B2), C1, C5) + 50 + B20', () => {\n    assert.equal(infixExprToSuffixExpr('AVERAGE(SUM(A1,B2), C1, C5) + 50 + B20').join(''), 'A1B2SUM,2C1C5AVERAGE,350+B20+');\n  });\n  it('should return A1B2B3SUM,3C1C5AVERAGE,350+B20+ when the value is ((AVERAGE(SUM(A1,B2, B3), C1, C5) + 50) + B20)', () => {\n    assert.equal(infixExprToSuffixExpr('((AVERAGE(SUM(A1,B2, B3), C1, C5) + 50) + B20)').join(''), 'A1B2B3SUM,3C1C5AVERAGE,350+B20+');\n  });\n  it('should return 11==tfIF,3 when the value is IF(1==1, \"t\", \"f\")', () => {\n    assert.equal(infixExprToSuffixExpr('IF(1==1, \"t\", \"f\")').join(''), '11==\"t\"fIF,3');\n  });\n  it('should return 11=tfIF,3 when the value is IF(1=1, \"t\", \"f\")', () => {\n    assert.equal(infixExprToSuffixExpr('IF(1=1, \"t\", \"f\")').join(''), '11=\"t\"fIF,3');\n  });\n  it('should return 21>21IF,3 when the value is IF(2>1, 2, 1)', () => {\n    assert.equal(infixExprToSuffixExpr('IF(2>1, 2, 1)').join(''), '21>21IF,3');\n  });\n  it('should return 11=AND,121IF,3 when the value is IF(AND(1=1), 2, 1)', () => {\n    assert.equal(infixExprToSuffixExpr('IF(AND(1=1), 2, 1)').join(''), '11=AND,121IF,3');\n  });\n  it('should return 11=21>AND,221IF,3 when the value is IF(AND(1=1, 2>1), 2, 1)', () => {\n    assert.equal(infixExprToSuffixExpr('IF(AND(1=1, 2>1), 2, 1)').join(''), '11=21>AND,221IF,3');\n  });\n  it('should return 105-20- when the value is 10-5-20', () => {\n    assert.equal(infixExprToSuffixExpr('10-5-20').join(''), '105-20-');\n  });\n  it('should return 105-2010*- when the value is 10-5-20*10', () => {\n    assert.equal(infixExprToSuffixExpr('10-5-20*10').join(''), '105-2010*-');\n  });\n  it('should return 10520*- when the value is 10-5*20', () => {\n    assert.equal(infixExprToSuffixExpr('10-5*20').join(''), '10520*-');\n  });\n  it('should return 105-20+ when the value is 10-5+20', () => {\n    assert.equal(infixExprToSuffixExpr('10-5+20').join(''), '105-20+');\n  });\n  it('should return 123*+45*6+7*+ when the value is 1 + 2*3 + (4 * 5 + 6) * 7', () => {\n    assert.equal(infixExprToSuffixExpr('1+2*3+(4*5+6)*7').join(''), '123*+45*6+7*+');\n  });\n  it('should return 9312*-3*+42/+ when the value is 9+(3-1*2)*3+4/2', () => {\n    assert.equal(infixExprToSuffixExpr('9+(3-1*2)*3+4/2').join(''), '9312*-3*+42/+');\n  });\n  it('should return 931-+23+*42/+ when the value is (9+(3-1))*(2+3)+4/2', () => {\n    assert.equal(infixExprToSuffixExpr('(9+(3-1))*(2+3)+4/2').join(''), '931-+23+*42/+');\n  });\n  it('should return SUM(1) when the value is 1SUM,1', () => {\n    assert.equal(infixExprToSuffixExpr('SUM(1)').join(''), '1SUM');\n  });\n  it('should return SUM() when the value is \"\"', () => {\n    assert.equal(infixExprToSuffixExpr('SUM()').join(''), 'SUM');\n  });\n  it('should return SUM( when the value is SUM', () => {\n    assert.equal(infixExprToSuffixExpr('SUM(').join(''), 'SUM');\n  });\n});\n\ndescribe('cell', () => {\n  describe('.render()', () => {\n    it('should return 0 + 2 + 2 + 6 + 49 + 20 when the value is =SUM(A1,B2, C1, C5) + 50 + B20', () => {\n      assert.equal(cell.render('=SUM(A1,B2, C1, C5) + 50 + B20', formulam, (x, y) => x + y), 0 + 2 + 2 + 6 + 50 + 20);\n    });\n    it('should return 50 + 20 when the value is =50 + B20', () => {\n      assert.equal(cell.render('=50 + B20', formulam, (x, y) => x + y), 50 + 20);\n    });\n    it('should return 2 when the value is =IF(2>1, 2, 1)', () => {\n      assert.equal(cell.render('=IF(2>1, 2, 1)', formulam, (x, y) => x + y), 2);\n    });\n    it('should return 1 + 500 - 20 when the value is =AVERAGE(A1:A3) + 50 * 10 - B20', () => {\n      assert.equal(cell.render('=AVERAGE(A1:A3) + 50 * 10 - B20', formulam, (x, y) => {\n        // console.log('x:', x, ', y:', y);\n        return x + y;\n      }), 1 + 500 - 20);\n    });\n  });\n});\n"
  },
  {
    "path": "test/core/font_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport {\n  fontSizes,\n  fonts,\n  baseFonts,\n  getFontSizePxByPt,\n} from '../../src/core/font';\n\ndescribe('baseFonts', () => {\n  it('should be Array of \"{ key: string, key: string }\"', () => {\n    const result = baseFonts.find((i) => {\n      const keyType = typeof i.key;\n      const titleType = typeof i.title;\n      return keyType !== 'string' || titleType !== 'string';\n    });\n    assert.equal(result, undefined);\n  });\n});\n\ndescribe('fontSizes', () => {\n  it('should be Array of \"{ pt: number, px: number }\"', () => {\n    const result = fontSizes.find((i) => {\n      const ptType = typeof i.pt;\n      const pxType = typeof i.px;\n      return ptType !== 'number' || pxType !== 'number';\n    });\n    assert.equal(result, undefined);\n  });\n});\n\ndescribe('getFontSizePxByPt()', () => {\n  const fontsizeItem = { pt: 7.5, px: 10 };\n  // not include pt\n  const notIncludePT = 6.5;\n\n  it(`should be return ${fontsizeItem.px} when the value is ${fontsizeItem.pt}`, () => {\n    assert.equal(getFontSizePxByPt(fontsizeItem.pt), fontsizeItem.px);\n  });\n  it(`should be return ${notIncludePT} when the value is ${notIncludePT} (same as input arg)`, () => {\n    assert.equal(getFontSizePxByPt(notIncludePT), notIncludePT);\n  });\n});\n\ndescribe('fonts()', () => {\n  const fontItem = baseFonts[0];\n  it(`should include { ${fontItem.key}: ${JSON.stringify(fontItem)} } when the value is not provide.`, () => {\n    const f = fonts();\n    assert.equal(f[fontItem.key], fontItem);\n  });\n\n  /** @type {BaseFont} */\n  const appendItem = [{\n    key: 'test',\n    title: 'test title',\n  }];\n  const appendItems = [appendItem];\n  it(`should include { ${appendItems[0].key}: ${JSON.stringify(appendItems[0])} } when the value is ${JSON.stringify(appendItems)}`, () => {\n    const f = fonts(appendItems);\n    assert.equal(f[appendItem.key], appendItem);\n  });\n});\n"
  },
  {
    "path": "test/core/format_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport {\n  formatm,\n  baseFormats,\n} from '../../src/core/format';\n\nconst gformats = formatm;\ndescribe('formatm', () => {\n  describe('#render()', () => {\n    it('normal: should return AC when the value is AC', () => {\n      assert.equal(gformats.normal.render('AC'), 'AC');\n    });\n    it('text: should return abc when the value is abc', () => {\n      assert.equal(gformats.text.render('abc'), 'abc');\n    });\n    it('number: should return 11,000.20 when the value is 11000.20', () => {\n      assert.equal(gformats.number.render('11000.20'), '11,000.20');\n    });\n    it('number: should return 110,00.20 (NOT MODIFIED when encounter ileagal input) when the value is 110,00.20', () => {\n      assert.equal(gformats.number.render('110,00.20'), '110,00.20');\n    });\n    it('percent: should return 50.456% when the value is 50.456', () => {\n      assert.equal(gformats.percent.render('50.456'), '50.456%');\n    });\n    it('RMB: should return ￥1,200.33 when the value is 1200.333', () => {\n      assert.equal(gformats.rmb.render('1200.333'), '￥1,200.33');\n    });\n    it('USD: should return $1,200.33 when the value is 1200.333', () => {\n      assert.equal(gformats.usd.render('1200.333'), '$1,200.33');\n    });\n    it('EUR: should return €1,200.33 when the value is 1200.333', () => {\n      assert.equal(gformats.eur.render('1200.333'), '€1,200.33');\n    });\n  });\n});\n\ndescribe('baseFormats', () => {\n  // item.key\n  it('typeof item.key should be \"string\"',\n    () => {\n      const KEY = 'key';\n      assert.equal(baseFormats.find(i => typeof i[KEY] !== 'string'), undefined);\n    });\n  // item.title\n  it('typeof item.title should be \"function\"',\n    () => {\n      const KEY = 'title';\n      assert.equal(baseFormats.find(i => typeof i[KEY] !== 'function'), undefined);\n    });\n  // item.type\n  it('typeof item.type should be \"string\"',\n    () => {\n      const KEY = 'type';\n      assert.equal(baseFormats.find(i => typeof i[KEY] !== 'string'), undefined);\n    });\n  // item.render\n  it('typeof item.render should be \"function\"',\n    () => {\n      const KEY = 'render';\n      assert.equal(baseFormats.find(i => typeof i[KEY] !== 'function'), undefined);\n    });\n  // item.label\n  it('typeof item.label should be \"string\" or \"undefined\"',\n    () => {\n      const KEY = 'label';\n      assert.equal(baseFormats.find(i => typeof i[KEY] !== 'string' && typeof i[KEY] !== 'undefined'), undefined);\n    });\n});\n"
  },
  {
    "path": "test/core/formula_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport { formulam } from '../../src/core/formula';\n\nconst gformulas = formulam;\ndescribe('formula', () => {\n  describe('#render()', () => {\n    it('SUM: should return 36 when the value is [\\'12\\', \\'12\\', 12]', () => {\n      assert.equal(gformulas.SUM.render(['12', '12', 12]), 36);\n    });\n    it('AVERAGE: should return 13 when the value is [\\'12\\', \\'13\\', 14]', () => {\n      assert.equal(gformulas.AVERAGE.render(['12', '13', 14]), 13);\n    });\n    it('MAX: should return 14 when the value is [\\'12\\', \\'13\\', 14]', () => {\n      assert.equal(gformulas.MAX.render(['12', '13', 14]), 14);\n    });\n    it('MIN: should return 12 when the value is [\\'12\\', \\'13\\', 14]', () => {\n      assert.equal(gformulas.MIN.render(['12', '13', 14]), 12);\n    });\n    it('IF: should return 12 when the value is [12 > 11, 12, 11]', () => {\n      assert.equal(gformulas.IF.render([12 > 11, 12, 11]), 12);\n    });\n    it('AND: should return true when the value is [\"a\", true, \"ok\"]', () => {\n      assert.equal(gformulas.AND.render(['a', true, 'ok']), true);\n    });\n    it('AND: should return false when the value is [\"a\", false, \"ok\"]', () => {\n      assert.equal(gformulas.AND.render(['a', false, 'ok']), false);\n    });\n    it('OR: should return true when the value is [\"a\", true]', () => {\n      assert.equal(gformulas.OR.render(['a', true]), true);\n    });\n    it('OR: should return true when the value is [\"a\", false]', () => {\n      assert.equal(gformulas.OR.render(['a', false]), true);\n    });\n    it('OR: should return false when the value is [0, false]', () => {\n      assert.equal(gformulas.OR.render([0, false]), false);\n    });\n    it('CONCAT: should return 1200USD when the value is [\\'1200\\', \\'USD\\']', () => {\n      assert.equal(gformulas.CONCAT.render(['1200', 'USD']), '1200USD');\n    });\n  });\n});\n"
  },
  {
    "path": "test/helper_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport helper from '../src/core/helper';\n\ndescribe('helper', () => {\n  describe('.cloneDeep()', () => {\n    it('The modification of the returned value does not affect the original value', () => {\n      const obj = { k: { k1: 'v' } };\n      const obj1 = helper.cloneDeep(obj);\n      obj1.k.k1 = 'v1';\n      assert.equal(obj.k.k1, 'v');\n    });\n  });\n  describe('.merge()', () => {\n    it('should return { a: \\'a\\' } where the value is { a: \\'a\\' }', () => {\n      const merge = helper.merge({ a: 'a' });\n      assert.equal(merge.a, 'a');\n    });\n    it('should return {a: \\'a\\', b: \\'b\\'} where the value is {a: \\'a\\'}, {b: \\'b\\'}', () => {\n      const merge = helper.merge({ a: 'a' }, { b: 'b' });\n      assert.equal(merge.a, 'a');\n      assert.equal(merge.b, 'b');\n    });\n    it('should return { a: { a1: \\'a2\\' }, b: \\'b\\' } where the value is {a: {a1: \\'a1\\'}, b: \\'b\\'}, {a: {a1: \\'b\\'}}', () => {\n      const obj = { a: { a1: 'a1' }, b: 'b' };\n      const merge = helper.merge(obj, { a: { a1: 'a2' } });\n      assert.equal(obj.a.a1, 'a1');\n      assert.equal(merge.a.a1, 'a2');\n      assert.equal(merge.b, 'b');\n    });\n  });\n  // sum\n  describe('.sum()', () => {\n    it('should return [50, 3] where the value is [10, 20, 20]', () => {\n      const [total, size] = helper.sum([10, 20, 20]);\n      assert.equal(total, 50);\n      assert.equal(size, 3);\n    });\n    it('should return [50, 3] where the value is {k1: 10, k2: 20, k3: 20}', () => {\n      const [total, size] = helper.sum({ k1: 10, k2: 20, k3: 20 });\n      assert.equal(total, 50);\n      assert.equal(size, 3);\n    });\n  });\n});\n"
  },
  {
    "path": "test/index_test.js",
    "content": "// import assert from 'assert';\n// import { describe, it } from 'mocha';\n// import alphabet from '../../src/index';\n//\n//\n"
  },
  {
    "path": "test/locale/locale_test.js",
    "content": "import assert from 'assert';\nimport { describe, it } from 'mocha';\nimport {\n  locale,\n  t,\n  tf\n} from '../../src/locale/locale';\n\n// Add window global if it doesn't exist\n// Some tests depend on this global variable's existence\nif (typeof window === 'undefined') {\n  global.window = {};\n}\n\n// Override messages that exist in the fallback locale\nconst localeTest1 = 'TEST_1';\nconst localeTest1Messages = {\n\ttoolbar: {\n\t\tundo: 'Test 1 Undo',\n\t\tredo: 'Test 1 Redo',\n\t},\n\tformula: {\n\t\t\"VAR\\\\.P\": \"Test 1 VARP\"\n\t}\n};\n\nconst localeTest2 = 'TEST_2';\nconst localeTest2Messages = {\n\ttoolbar: {\n\t\tundo: 'Test 2 Undo',\n    // Do not define \"redo\" message in locale test 2\n\t},\n};\n\ndescribe('locale', () => {\n  describe('.t()', () => {\n    it('should return an empty string when the value has no available translation', () => {\n      assert.equal(t('something.not.defined'), '');\n    });\n    it('should return Undo when the value is toolbar.undo', () => {\n      assert.equal(t('toolbar.undo'), 'Undo');\n    });\n  });\n  describe('.tf()', () => {\n    it('should return Undo when the value is toolbar.undo', () => {\n      const functionWhichReturnsTranslatedValue = tf('toolbar.undo');\n      assert.equal(functionWhichReturnsTranslatedValue(), 'Undo');\n    });\n  });\n  describe('.locale()', () => {\n  \t// Must be the first test which calls the locale function,\n  \t// as it depends on the first locale in the language list to be unchanged\n  \t// from the default (English). Subsequent tests must clear the language\n  \t// list to work as intended (otherwise thet language list will grow with\n  \t// each test).\n    it('should return Print when the value is toolbar.print and the fallback locale is English', () => {\n      // Provides no value for toolbar.print, so the English fallback will be used\n      locale(localeTest1, localeTest1Messages, false);\n      assert.equal(t('toolbar.print'), 'Print');\n    });\n    it('should return Test 2 Undo when the value is toolbar.undo', () => {\n      // Set language list to prioritize use of locale test 2, then locale test 1\n      locale(localeTest1, localeTest1Messages, true);\n      locale(localeTest2, localeTest2Messages, false);\n\n      assert.equal(t('toolbar.undo'), 'Test 2 Undo');\n    });\n    it('should return Test 1 Redo when the value is toolbar.redo', () => {\n      // Set language list to prioritize use of locale test 2, then locale test 1\n      locale(localeTest1, localeTest1Messages, true);\n      locale(localeTest2, localeTest2Messages, false);\n\n      // locale test 2 doesn't have the toolbar.redo message defined\n      assert.equal(t('toolbar.redo'), 'Test 1 Redo');\n    });\n  });\n  describe('.t() [tests which depend on modified language list]', () => {\n    it('should return Test 1 VARP when the value is toolbar.formula.VAR\\\\.P', () => {\n      locale(localeTest1, localeTest1Messages, true);\n      assert.equal(t('formula.VAR\\\\.P'), 'Test 1 VARP');\n    });\n    it('should return Test 1 Redo when the value is toolbar.redo and a fallback is specified on the window global', () => {\n      // Only define locale test 2 messages here\n      locale(localeTest2, localeTest2Messages, true);\n\n      // Depends on existence of window global variable\n      // Supply a fallback locale test 2 message dictionary (from locale test 1)\n      window.x_spreadsheet = { $messages: {\n        'TEST_2': localeTest1Messages\n      }};\n\n      assert.equal(t('toolbar.redo'), 'Test 1 Redo');\n    });\n  });\n});\n"
  }
]