Ver Fonte

初始化项目

wzz há 3 meses atrás
commit
c31683a22e
100 ficheiros alterados com 14891 adições e 0 exclusões
  1. 22 0
      .editorconfig
  2. 13 0
      .env.development
  3. 10 0
      .env.production
  4. 12 0
      .env.staging
  5. 10 0
      .eslintignore
  6. 199 0
      .eslintrc.js
  7. 23 0
      .gitignore
  8. 30 0
      README.md
  9. 13 0
      babel.config.js
  10. 12 0
      bin/build.bat
  11. 12 0
      bin/package.bat
  12. 12 0
      bin/run-web.bat
  13. 35 0
      build/index.js
  14. 95 0
      package.json
  15. 11 0
      public/WEB-INF/web.xml
  16. BIN
      public/codebase/WebComponentsKit(64bit).exe
  17. BIN
      public/codebase/WebComponentsKit(has rem cfg).exe
  18. BIN
      public/codebase/WebComponentsKit.exe
  19. 106 0
      public/codebase/cryptico.min.js
  20. 621 0
      public/codebase/encryption/AES.js
  21. 106 0
      public/codebase/encryption/cryptico.min.js
  22. 35 0
      public/codebase/encryption/crypto-3.1.2.min.js
  23. 111 0
      public/codebase/encryption/encryption.js
  24. 1 0
      public/codebase/jquery-1.12.1.min.js
  25. 90 0
      public/codebase/jquery.cookie.js
  26. 0 0
      public/codebase/jsPlugin-1.2.0.min.js
  27. 223 0
      public/codebase/playctrl/AudioRenderer.js
  28. 521 0
      public/codebase/playctrl/DecodeWorker.js
  29. 0 0
      public/codebase/playctrl/Decoder.js
  30. BIN
      public/codebase/playctrl/Decoder.js.mem
  31. BIN
      public/codebase/playctrl/Decoder.wasm
  32. 0 0
      public/codebase/playctrl/SuperRender.js
  33. 337 0
      public/codebase/playctrl/SuperRender_10.js
  34. 0 0
      public/codebase/playctrl/SuperRender_20.js
  35. 6833 0
      public/codebase/polyfill2.js
  36. 0 0
      public/codebase/transform/SystemTransform.js
  37. BIN
      public/codebase/transform/SystemTransform.js.mem
  38. 1 0
      public/codebase/transform/systemTransform-worker.min.js
  39. 98 0
      public/codebase/uuid.js
  40. 0 0
      public/codebase/webVideoCtrl.js
  41. 4 0
      public/config.js
  42. BIN
      public/doc/测试.doc
  43. BIN
      public/favicon.ico
  44. 21 0
      public/html/ie.html
  45. 218 0
      public/index.html
  46. 1 0
      public/jquery-1.7.1.min.js
  47. 2 0
      public/robots.txt
  48. 28 0
      src/App.vue
  49. 691 0
      src/api/citiyMin.js
  50. 2077 0
      src/api/city.js
  51. 2 0
      src/api/city2.js
  52. 50 0
      src/api/count.js
  53. 122 0
      src/api/dept.js
  54. 56 0
      src/api/login.js
  55. 9 0
      src/api/menu.js
  56. 516 0
      src/api/rules.js
  57. 83 0
      src/api/school.js
  58. 224 0
      src/api/store.js
  59. 66 0
      src/api/system.js
  60. 60 0
      src/api/system/config.js
  61. 52 0
      src/api/system/dept.js
  62. 52 0
      src/api/system/dict/data.js
  63. 60 0
      src/api/system/dict/type.js
  64. 60 0
      src/api/system/menu.js
  65. 44 0
      src/api/system/notice.js
  66. 52 0
      src/api/system/post.js
  67. 119 0
      src/api/system/role.js
  68. 135 0
      src/api/system/user.js
  69. 76 0
      src/api/tool/gen.js
  70. 392 0
      src/api/user.js
  71. BIN
      src/assets/401_images/401.gif
  72. BIN
      src/assets/404_images/404.png
  73. BIN
      src/assets/404_images/404_cloud.png
  74. 9 0
      src/assets/icons/index.js
  75. 1 0
      src/assets/icons/svg/404.svg
  76. 1 0
      src/assets/icons/svg/account.svg
  77. 1 0
      src/assets/icons/svg/arrowRight.svg
  78. 1 0
      src/assets/icons/svg/bug.svg
  79. 1 0
      src/assets/icons/svg/build.svg
  80. 0 0
      src/assets/icons/svg/button.svg
  81. 0 0
      src/assets/icons/svg/cascader.svg
  82. 1 0
      src/assets/icons/svg/chart.svg
  83. 1 0
      src/assets/icons/svg/checkbox.svg
  84. 1 0
      src/assets/icons/svg/class-bg.svg
  85. 0 0
      src/assets/icons/svg/class.svg
  86. 1 0
      src/assets/icons/svg/clipboard.svg
  87. 1 0
      src/assets/icons/svg/code.svg
  88. 0 0
      src/assets/icons/svg/collect.svg
  89. 0 0
      src/assets/icons/svg/color.svg
  90. 0 0
      src/assets/icons/svg/component.svg
  91. 1 0
      src/assets/icons/svg/control-b.svg
  92. 1 0
      src/assets/icons/svg/control-big.svg
  93. 1 0
      src/assets/icons/svg/control-bl.svg
  94. 1 0
      src/assets/icons/svg/control-br.svg
  95. 1 0
      src/assets/icons/svg/control-c.svg
  96. 0 0
      src/assets/icons/svg/control-cl.svg
  97. 0 0
      src/assets/icons/svg/control-cr.svg
  98. 1 0
      src/assets/icons/svg/control-l.svg
  99. 1 0
      src/assets/icons/svg/control-lb.svg
  100. 1 0
      src/assets/icons/svg/control-lt.svg

+ 22 - 0
.editorconfig

@@ -0,0 +1,22 @@
+# 告诉EditorConfig插件,这是根文件,不用继续往上查找
+root = true
+
+# 匹配全部文件
+[*]
+# 设置字符集
+charset = utf-8
+# 缩进风格,可选space、tab
+indent_style = space
+# 缩进的空格数
+indent_size = 2
+# 结尾换行符,可选lf、cr、crlf
+end_of_line = lf
+# 在文件结尾插入新行
+insert_final_newline = true
+# 删除一行中的前后空格
+trim_trailing_whitespace = true
+
+# 匹配md结尾的文件
+[*.md]
+insert_final_newline = false
+trim_trailing_whitespace = false

+ 13 - 0
.env.development

@@ -0,0 +1,13 @@
+# 页面标题
+VUE_APP_TITLE = 探驱鸟系统
+
+# 开发环境配置
+ENV = 'development'
+
+# 云校园管理系统/开发环境/
+# VUE_APP_BASE_API = '/dev-api'
+VUE_APP_BASE_API = '/system'
+VUE_APP_BASE_URL = ''
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 10 - 0
.env.production

@@ -0,0 +1,10 @@
+# 页面标题
+VUE_APP_TITLE = 探驱鸟系统
+
+# 生产环境配置
+ENV = 'production'
+
+# 云校园管理系统/生产环境
+# VUE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/system'
+VUE_APP_BASE_URL = 'http://112.26.142.150:8011'

+ 12 - 0
.env.staging

@@ -0,0 +1,12 @@
+# 页面标题
+VUE_APP_TITLE = 探驱鸟系统
+
+NODE_ENV = production
+
+# 测试环境配置
+ENV = 'staging'
+
+# 云校园管理系统/测试环境
+# VUE_APP_BASE_API = '/stage-api'
+VUE_APP_BASE_API = '/system'
+VUE_APP_BASE_URL = 'http://112.26.142.150:8011'

+ 10 - 0
.eslintignore

@@ -0,0 +1,10 @@
+# 忽略build目录下类型为js的文件的语法检查
+build/*.js
+# 忽略src/assets目录下文件的语法检查
+src/assets
+# 忽略public目录下文件的语法检查
+public
+# 忽略当前目录下为js的文件的语法检查
+*.js
+# 忽略当前目录下为vue的文件的语法检查
+*.vue

+ 199 - 0
.eslintrc.js

@@ -0,0 +1,199 @@
+// ESlint 检查配置
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: 'babel-eslint',
+    sourceType: 'module'
+  },
+  env: {
+    browser: true,
+    node: true,
+    es6: true,
+  },
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
+
+  // add your custom rules here
+  //it is base on https://github.com/vuejs/eslint-config-vue
+  rules: {
+    "vue/max-attributes-per-line": [2, {
+      "singleline": 10,
+      "multiline": {
+        "max": 1,
+        "allowFirstLine": false
+      }
+    }],
+    "vue/singleline-html-element-content-newline": "off",
+    "vue/multiline-html-element-content-newline":"off",
+    "vue/name-property-casing": ["error", "PascalCase"],
+    "vue/no-v-html": "off",
+    'accessor-pairs': 2,
+    'arrow-spacing': [2, {
+      'before': true,
+      'after': true
+    }],
+    'block-spacing': [2, 'always'],
+    'brace-style': [2, '1tbs', {
+      'allowSingleLine': true
+    }],
+    'camelcase': [0, {
+      'properties': 'always'
+    }],
+    'comma-dangle': [2, 'never'],
+    'comma-spacing': [2, {
+      'before': false,
+      'after': true
+    }],
+    'comma-style': [2, 'last'],
+    'constructor-super': 2,
+    'curly': [2, 'multi-line'],
+    'dot-location': [2, 'property'],
+    'eol-last': 2,
+    'eqeqeq': ["error", "always", {"null": "ignore"}],
+    'generator-star-spacing': [2, {
+      'before': true,
+      'after': true
+    }],
+    'handle-callback-err': [2, '^(err|error)$'],
+    'indent': [2, 2, {
+      'SwitchCase': 1
+    }],
+    'jsx-quotes': [2, 'prefer-single'],
+    'key-spacing': [2, {
+      'beforeColon': false,
+      'afterColon': true
+    }],
+    'keyword-spacing': [2, {
+      'before': true,
+      'after': true
+    }],
+    'new-cap': [2, {
+      'newIsCap': true,
+      'capIsNew': false
+    }],
+    'new-parens': 2,
+    'no-array-constructor': 2,
+    'no-caller': 2,
+    'no-console': 'off',
+    'no-class-assign': 2,
+    'no-cond-assign': 2,
+    'no-const-assign': 2,
+    'no-control-regex': 0,
+    'no-delete-var': 2,
+    'no-dupe-args': 2,
+    'no-dupe-class-members': 2,
+    'no-dupe-keys': 2,
+    'no-duplicate-case': 2,
+    'no-empty-character-class': 2,
+    'no-empty-pattern': 2,
+    'no-eval': 2,
+    'no-ex-assign': 2,
+    'no-extend-native': 2,
+    'no-extra-bind': 2,
+    'no-extra-boolean-cast': 2,
+    'no-extra-parens': [2, 'functions'],
+    'no-fallthrough': 2,
+    'no-floating-decimal': 2,
+    'no-func-assign': 2,
+    'no-implied-eval': 2,
+    'no-inner-declarations': [2, 'functions'],
+    'no-invalid-regexp': 2,
+    'no-irregular-whitespace': 2,
+    'no-iterator': 2,
+    'no-label-var': 2,
+    'no-labels': [2, {
+      'allowLoop': false,
+      'allowSwitch': false
+    }],
+    'no-lone-blocks': 2,
+    'no-mixed-spaces-and-tabs': 2,
+    'no-multi-spaces': 2,
+    'no-multi-str': 2,
+    'no-multiple-empty-lines': [2, {
+      'max': 1
+    }],
+    'no-native-reassign': 2,
+    'no-negated-in-lhs': 2,
+    'no-new-object': 2,
+    'no-new-require': 2,
+    'no-new-symbol': 2,
+    'no-new-wrappers': 2,
+    'no-obj-calls': 2,
+    'no-octal': 2,
+    'no-octal-escape': 2,
+    'no-path-concat': 2,
+    'no-proto': 2,
+    'no-redeclare': 2,
+    'no-regex-spaces': 2,
+    'no-return-assign': [2, 'except-parens'],
+    'no-self-assign': 2,
+    'no-self-compare': 2,
+    'no-sequences': 2,
+    'no-shadow-restricted-names': 2,
+    'no-spaced-func': 2,
+    'no-sparse-arrays': 2,
+    'no-this-before-super': 2,
+    'no-throw-literal': 2,
+    'no-trailing-spaces': 2,
+    'no-undef': 2,
+    'no-undef-init': 2,
+    'no-unexpected-multiline': 2,
+    'no-unmodified-loop-condition': 2,
+    'no-unneeded-ternary': [2, {
+      'defaultAssignment': false
+    }],
+    'no-unreachable': 2,
+    'no-unsafe-finally': 2,
+    'no-unused-vars': [2, {
+      'vars': 'all',
+      'args': 'none'
+    }],
+    'no-useless-call': 2,
+    'no-useless-computed-key': 2,
+    'no-useless-constructor': 2,
+    'no-useless-escape': 0,
+    'no-whitespace-before-property': 2,
+    'no-with': 2,
+    'one-var': [2, {
+      'initialized': 'never'
+    }],
+    'operator-linebreak': [2, 'after', {
+      'overrides': {
+        '?': 'before',
+        ':': 'before'
+      }
+    }],
+    'padded-blocks': [2, 'never'],
+    'quotes': [2, 'single', {
+      'avoidEscape': true,
+      'allowTemplateLiterals': true
+    }],
+    'semi': [2, 'never'],
+    'semi-spacing': [2, {
+      'before': false,
+      'after': true
+    }],
+    'space-before-blocks': [2, 'always'],
+    'space-before-function-paren': [2, 'never'],
+    'space-in-parens': [2, 'never'],
+    'space-infix-ops': 2,
+    'space-unary-ops': [2, {
+      'words': true,
+      'nonwords': false
+    }],
+    'spaced-comment': [2, 'always', {
+      'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
+    }],
+    'template-curly-spacing': [2, 'never'],
+    'use-isnan': 2,
+    'valid-typeof': 2,
+    'wrap-iife': [2, 'any'],
+    'yield-star-spacing': [2, 'both'],
+    'yoda': [2, 'never'],
+    'prefer-const': 2,
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+    'object-curly-spacing': [2, 'always', {
+      objectsInObjects: false
+    }],
+    'array-bracket-spacing': [2, 'never']
+  }
+}

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
+.DS_Store
+node_modules/
+dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+
+package-lock.json
+yarn.lock

+ 30 - 0
README.md

@@ -0,0 +1,30 @@
+## 开发
+
+```bash
+# 克隆项目
+git clone https://gitee.com/y_project/RuoYi-Vue
+
+# 进入项目目录
+cd ruoyi-ui
+
+# 安装依赖
+npm install
+
+# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
+npm install --registry=https://registry.npmmirror.com
+
+# 启动服务
+npm run dev
+```
+
+浏览器访问 http://localhost:80
+
+## 发布
+
+```bash
+# 构建测试环境
+npm run build:stage
+
+# 构建生产环境
+npm run build:prod
+```

+ 13 - 0
babel.config.js

@@ -0,0 +1,13 @@
+module.exports = {
+  presets: [
+    // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
+    '@vue/cli-plugin-babel/preset'
+  ],
+  'env': {
+    'development': {
+      // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
+      // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
+      'plugins': ['dynamic-import-node']
+    }
+  }
+}

+ 12 - 0
bin/build.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 打包Web工程,生成dist文件。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run build:prod
+
+pause

+ 12 - 0
bin/package.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 安装Web工程,生成node_modules文件。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm install --registry=https://registry.npmmirror.com
+
+pause

+ 12 - 0
bin/run-web.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 使用 Vue CLI 命令运行 Web 工程。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run dev
+
+pause

+ 35 - 0
build/index.js

@@ -0,0 +1,35 @@
+const { run } = require('runjs')
+const chalk = require('chalk')
+const config = require('../vue.config.js')
+const rawArgv = process.argv.slice(2)
+const args = rawArgv.join(' ')
+
+if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
+  const report = rawArgv.includes('--report')
+
+  run(`vue-cli-service build ${args}`)
+
+  const port = 9526
+  const publicPath = config.publicPath
+
+  var connect = require('connect')
+  var serveStatic = require('serve-static')
+  const app = connect()
+
+  app.use(
+    publicPath,
+    serveStatic('./dist', {
+      index: ['index.html', '/']
+    })
+  )
+
+  app.listen(port, function () {
+    console.log(chalk.green(`> Preview at  http://localhost:${port}${publicPath}`))
+    if (report) {
+      console.log(chalk.green(`> Report at  http://localhost:${port}${publicPath}report.html`))
+    }
+
+  })
+} else {
+  run(`vue-cli-service build ${args}`)
+}

+ 95 - 0
package.json

@@ -0,0 +1,95 @@
+{
+  "name": "mini",
+  "version": "3.8.5",
+  "description": "探驱鸟系统",
+  "author": "云校园",
+  "license": "MIT",
+  "scripts": {
+    "dev": "vue-cli-service serve",
+    "build:prod": "vue-cli-service build",
+    "build:stage": "vue-cli-service build --mode staging",
+    "preview": "node build/index.js --preview",
+    "lint": "eslint --ext .js,.vue src"
+  },
+  "husky": {
+    "hooks": {
+      "pre-commit": "lint-staged"
+    }
+  },
+  "lint-staged": {
+    "src/**/*.{js,vue}": [
+      "eslint --fix",
+      "git add"
+    ]
+  },
+  "keywords": [
+    "vue",
+    "admin",
+    "dashboard",
+    "element-ui",
+    "boilerplate",
+    "admin-template",
+    "management-system"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://gitee.com/y_project/RuoYi-Vue.git"
+  },
+  "dependencies": {
+    "@riophae/vue-treeselect": "0.4.0",
+    "axios": "0.24.0",
+    "clipboard": "2.0.8",
+    "core-js": "3.25.3",
+    "echarts": "5.4.0",
+    "element-ui": "2.15.12",
+    "file-saver": "2.0.5",
+    "fuse.js": "6.4.3",
+    "highlight.js": "9.18.5",
+    "js-beautify": "1.13.0",
+    "js-cookie": "3.0.1",
+    "jsencrypt": "3.0.0-rc.1",
+    "nprogress": "0.2.0",
+    "qrcodejs2": "0.0.2",
+    "quill": "1.3.7",
+    "screenfull": "5.0.2",
+    "sortablejs": "1.10.2",
+    "vue": "2.6.12",
+    "vue-count-to": "1.0.13",
+    "vue-cropper": "0.5.5",
+    "vue-meta": "2.4.0",
+    "vue-qr": "^4.0.9",
+    "vue-router": "3.4.9",
+    "vuedraggable": "2.24.3",
+    "vuex": "3.6.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "4.4.6",
+    "@vue/cli-plugin-eslint": "4.4.6",
+    "@vue/cli-service": "4.4.6",
+    "babel-eslint": "10.1.0",
+    "babel-plugin-dynamic-import-node": "2.3.3",
+    "chalk": "4.1.0",
+    "compression-webpack-plugin": "5.0.2",
+    "connect": "3.6.6",
+    "eslint": "7.15.0",
+    "eslint-plugin-vue": "7.2.0",
+    "file-loader": "^6.2.0",
+    "lint-staged": "10.5.3",
+    "runjs": "4.4.2",
+    "sass": "1.32.13",
+    "sass-loader": "10.1.1",
+    "script-ext-html-webpack-plugin": "2.1.5",
+    "svg-sprite-loader": "5.1.1",
+    "url-loader": "^4.1.1",
+    "vue-template-compiler": "2.6.12",
+    "xlsx": "^0.18.5"
+  },
+  "engines": {
+    "node": ">=8.9",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions"
+  ]
+}

+ 11 - 0
public/WEB-INF/web.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+version="3.0" metadata-complete="true">
+<display-name>Router for Tomcat</display-name>
+  <error-page>
+  <error-code>404</error-code>
+  <location>/index.html</location>
+  </error-page>
+</web-app>

BIN
public/codebase/WebComponentsKit(64bit).exe


BIN
public/codebase/WebComponentsKit(has rem cfg).exe


BIN
public/codebase/WebComponentsKit.exe


+ 106 - 0
public/codebase/cryptico.min.js

@@ -0,0 +1,106 @@
+var dbits,canary=244837814094590,j_lm=(canary&16777215)==15715070;function BigInteger(a,b,c){a!=null&&("number"==typeof a?this.fromNumber(a,b,c):b==null&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,g){for(;--g>=0;){var h=b*this[a++]+c[d]+e,e=Math.floor(h/67108864);c[d++]=h&67108863}return e}
+function am2(a,b,c,d,e,g){var h=b&32767;for(b>>=15;--g>=0;){var f=this[a]&32767,o=this[a++]>>15,p=b*f+o*h,f=h*f+((p&32767)<<15)+c[d]+(e&1073741823),e=(f>>>30)+(p>>>15)+b*o+(e>>>30);c[d++]=f&1073741823}return e}function am3(a,b,c,d,e,g){var h=b&16383;for(b>>=14;--g>=0;){var f=this[a]&16383,o=this[a++]>>14,p=b*f+o*h,f=h*f+((p&16383)<<14)+c[d]+e,e=(f>>28)+(p>>14)+b*o;c[d++]=f&268435455}return e}
+j_lm&&navigator.appName=="Microsoft Internet Explorer"?(BigInteger.prototype.am=am2,dbits=30):j_lm&&navigator.appName!="Netscape"?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<<dbits)-1;BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP);BigInteger.prototype.F1=BI_FP-dbits;BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=[],rr,vv;
+rr="0".charCodeAt(0);for(vv=0;vv<=9;++vv)BI_RC[rr++]=vv;rr="a".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;rr="A".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return c==null?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t;a.s=this.s}function bnpFromInt(a){this.t=1;this.s=a<0?-1:0;a>0?this[0]=a:a<-1?this[0]=a+DV:this.t=0}
+function nbv(a){var b=nbi();b.fromInt(a);return b}
+function bnpFromString(a,b){var c;if(b==16)c=4;else if(b==8)c=3;else if(b==256)c=8;else if(b==2)c=1;else if(b==32)c=5;else if(b==4)c=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var d=a.length,e=!1,g=0;--d>=0;){var h=c==8?a[d]&255:intAt(a,d);h<0?a.charAt(d)=="-"&&(e=!0):(e=!1,g==0?this[this.t++]=h:g+c>this.DB?(this[this.t-1]|=(h&(1<<this.DB-g)-1)<<g,this[this.t++]=h>>this.DB-g):this[this.t-1]|=h<<g,g+=c,g>=this.DB&&(g-=this.DB))}if(c==8&&(a[0]&128)!=0)this.s=-1,g>0&&(this[this.t-1]|=(1<<
+this.DB-g)-1<<g);this.clamp();e&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t}
+function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);if(a==16)a=4;else if(a==8)a=3;else if(a==2)a=1;else if(a==32)a=5;else if(a==64)a=6;else if(a==4)a=2;else return this.toRadix(a);var b=(1<<a)-1,c,d=!1,e="",g=this.t,h=this.DB-g*this.DB%a;if(g-- >0){if(h<this.DB&&(c=this[g]>>h)>0)d=!0,e=int2char(c);for(;g>=0;)h<a?(c=(this[g]&(1<<h)-1)<<a-h,c|=this[--g]>>(h+=this.DB-a)):(c=this[g]>>(h-=a)&b,h<=0&&(h+=this.DB,--g)),c>0&&(d=!0),d&&(e+=int2char(c))}return d?e:"0"}
+function bnNegate(){var a=nbi();BigInteger.ZERO.subTo(this,a);return a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(b!=0)return b;var c=this.t,b=c-a.t;if(b!=0)return b;for(;--c>=0;)if((b=this[c]-a[c])!=0)return b;return 0}function nbits(a){var b=1,c;if((c=a>>>16)!=0)a=c,b+=16;if((c=a>>8)!=0)a=c,b+=8;if((c=a>>4)!=0)a=c,b+=4;if((c=a>>2)!=0)a=c,b+=2;a>>1!=0&&(b+=1);return b}
+function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a;b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0);b.s=this.s}
+function bnpLShiftTo(a,b){var c=a%this.DB,d=this.DB-c,e=(1<<d)-1,g=Math.floor(a/this.DB),h=this.s<<c&this.DM,f;for(f=this.t-1;f>=0;--f)b[f+g+1]=this[f]>>d|h,h=(this[f]&e)<<c;for(f=g-1;f>=0;--f)b[f]=0;b[g]=h;b.t=this.t+g+1;b.s=this.s;b.clamp()}
+function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<<d)-1;b[0]=this[c]>>d;for(var h=c+1;h<this.t;++h)b[h-c-1]|=(this[h]&g)<<e,b[h-c]=this[h]>>d;d>0&&(b[this.t-c-1]|=(this.s&g)<<e);b.t=this.t-c;b.clamp()}}
+function bnpSubTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=d<0?-1:0;d<-1?b[c++]=this.DV+d:d>0&&(b[c++]=d);b.t=c;b.clamp()}
+function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e<d.t;++e)b[e+c.t]=c.am(0,d[e],b,e,0,c.t);b.s=0;b.clamp();this.s!=a.s&&BigInteger.ZERO.subTo(b,b)}function bnpSquareTo(a){for(var b=this.abs(),c=a.t=2*b.t;--c>=0;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);if((a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV)a[c+b.t]-=b.DV,a[c+b.t+1]=1}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1));a.s=0;a.clamp()}
+function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t<d.t)b!=null&&b.fromInt(0),c!=null&&this.copyTo(c);else{c==null&&(c=nbi());var g=nbi(),h=this.s,a=a.s,f=this.DB-nbits(d[d.t-1]);f>0?(d.lShiftTo(f,g),e.lShiftTo(f,c)):(d.copyTo(g),e.copyTo(c));d=g.t;e=g[d-1];if(e!=0){var o=e*(1<<this.F1)+(d>1?g[d-2]>>this.F2:0),p=this.FV/o,o=(1<<this.F1)/o,q=1<<this.F2,n=c.t,k=n-d,j=b==null?nbi():b;g.dlShiftTo(k,j);c.compareTo(j)>=0&&(c[c.t++]=1,c.subTo(j,c));BigInteger.ONE.dlShiftTo(d,
+j);for(j.subTo(g,g);g.t<d;)g[g.t++]=0;for(;--k>=0;){var l=c[--n]==e?this.DM:Math.floor(c[n]*p+(c[n-1]+q)*o);if((c[n]+=g.am(0,l,c,k,0,d))<l){g.dlShiftTo(k,j);for(c.subTo(j,c);c[n]<--l;)c.subTo(j,c)}}b!=null&&(c.drShiftTo(d,b),h!=a&&BigInteger.ZERO.subTo(b,b));c.t=d;c.clamp();f>0&&c.rShiftTo(f,c);h<0&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(a){var b=nbi();this.abs().divRemTo(a,null,b);this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b);return b}function Classic(a){this.m=a}
+function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;
+function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if((a&1)==0)return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return b>0?this.DV-b:-b}function Montgomery(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}
+function montConvert(a){var b=nbi();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);a.s<0&&b.compareTo(BigInteger.ZERO)>0&&this.m.subTo(b,b);return b}function montRevert(a){var b=nbi();a.copyTo(b);this.reduce(b);return b}
+function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=a[b]&32767,d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Montgomery.prototype.convert=montConvert;
+Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(a,b){if(a>4294967295||a<1)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),g=nbits(a)-1;for(e.copyTo(c);--g>=0;)if(b.sqrTo(c,d),(a&1<<g)>0)b.mulTo(d,e,c);else var h=c,c=d,d=h;return b.revert(c)}
+function bnModPowInt(a,b){var c;c=a<256||b.isEven()?new Classic(b):new Montgomery(b);return this.exp(a,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;
+BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;
+BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function bnClone(){var a=nbi();this.copyTo(a);return a}function bnIntValue(){if(this.s<0)if(this.t==1)return this[0]-this.DV;else{if(this.t==0)return-1}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return this.t==0?this.s:this[0]<<24>>24}function bnShortValue(){return this.t==0?this.s:this[0]<<16>>16}
+function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(a){a==null&&(a=10);if(this.signum()==0||a<2||a>36)return"0";var b=this.chunkSize(a),b=Math.pow(a,b),c=nbv(b),d=nbi(),e=nbi(),g="";for(this.divRemTo(c,d,e);d.signum()>0;)g=(b+e.intValue()).toString(a).substr(1)+g,d.divRemTo(c,d,e);return e.intValue().toString(a)+g}
+function bnpFromRadix(a,b){this.fromInt(0);b==null&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,g=0,h=0,f=0;f<a.length;++f){var o=intAt(a,f);o<0?a.charAt(f)=="-"&&this.signum()==0&&(e=!0):(h=b*h+o,++g>=c&&(this.dMultiply(d),this.dAddOffset(h,0),h=g=0))}g>0&&(this.dMultiply(Math.pow(b,g)),this.dAddOffset(h,0));e&&BigInteger.ZERO.subTo(this,this)}
+function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else{this.fromNumber(a,c);this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this)}else{var c=[],d=a&7;c.length=(a>>3)+1;b.nextBytes(c);d>0?c[0]&=(1<<d)-1:c[0]=0;this.fromString(c,256)}}
+function bnToByteArray(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(a-- >0){if(c<this.DB&&(d=this[a]>>c)!=(this.s&this.DM)>>c)b[e++]=d|this.s<<this.DB-c;for(;a>=0;)if(c<8?(d=(this[a]&(1<<c)-1)<<8-c,d|=this[--a]>>(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,c<=0&&(c+=this.DB,--a)),(d&128)!=0&&(d|=-256),e==0&&(this.s&128)!=(d&128)&&++e,e>0||d!=this.s)b[e++]=d}return b}function bnEquals(a){return this.compareTo(a)==0}function bnMin(a){return this.compareTo(a)<0?this:a}
+function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,g=Math.min(a.t,this.t);for(d=0;d<g;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){e=a.s&this.DM;for(d=g;d<this.t;++d)c[d]=b(this[d],e);c.t=this.t}else{e=this.s&this.DM;for(d=g;d<a.t;++d)c[d]=b(e,a[d]);c.t=a.t}c.s=b(this.s,a.s);c.clamp()}function op_and(a,b){return a&b}function bnAnd(a){var b=nbi();this.bitwiseTo(a,op_and,b);return b}function op_or(a,b){return a|b}
+function bnOr(a){var b=nbi();this.bitwiseTo(a,op_or,b);return b}function op_xor(a,b){return a^b}function bnXor(a){var b=nbi();this.bitwiseTo(a,op_xor,b);return b}function op_andnot(a,b){return a&~b}function bnAndNot(a){var b=nbi();this.bitwiseTo(a,op_andnot,b);return b}function bnNot(){for(var a=nbi(),b=0;b<this.t;++b)a[b]=this.DM&~this[b];a.t=this.t;a.s=~this.s;return a}function bnShiftLeft(a){var b=nbi();a<0?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b}
+function bnShiftRight(a){var b=nbi();a<0?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b}function lbit(a){if(a==0)return-1;var b=0;(a&65535)==0&&(a>>=16,b+=16);(a&255)==0&&(a>>=8,b+=8);(a&15)==0&&(a>>=4,b+=4);(a&3)==0&&(a>>=2,b+=2);(a&1)==0&&++b;return b}function bnGetLowestSetBit(){for(var a=0;a<this.t;++a)if(this[a]!=0)return a*this.DB+lbit(this[a]);return this.s<0?this.t*this.DB:-1}function cbit(a){for(var b=0;a!=0;)a&=a-1,++b;return b}
+function bnBitCount(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c)a+=cbit(this[c]^b);return a}function bnTestBit(a){var b=Math.floor(a/this.DB);return b>=this.t?this.s!=0:(this[b]&1<<a%this.DB)!=0}function bnpChangeBit(a,b){var c=BigInteger.ONE.shiftLeft(a);this.bitwiseTo(c,b,c);return c}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}
+function bnpAddTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=d<0?-1:0;d>0?b[c++]=d:d<-1&&(b[c++]=this.DV+d);b.t=c;b.clamp()}function bnAdd(a){var b=nbi();this.addTo(a,b);return b}function bnSubtract(a){var b=nbi();this.subTo(a,b);return b}
+function bnMultiply(a){var b=nbi();this.multiplyTo(a,b);return b}function bnSquare(){var a=nbi();this.squareTo(a);return a}function bnDivide(a){var b=nbi();this.divRemTo(a,b,null);return b}function bnRemainder(a){var b=nbi();this.divRemTo(a,null,b);return b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();this.divRemTo(a,b,c);return[b,c]}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()}
+function bnpDAddOffset(a,b){if(a!=0){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}NullExp.prototype.convert=nNop;NullExp.prototype.revert=nNop;NullExp.prototype.mulTo=nMulTo;NullExp.prototype.sqrTo=nSqrTo;function bnPow(a){return this.exp(a,new NullExp)}
+function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;d<e;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);d<e;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp();c.drShiftTo(1,c)}
+function Barrett(a){this.r2=nbi();this.q3=nbi();BigInteger.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function barrettConvert(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);else if(a.compareTo(this.m)<0)return a;else{var b=nbi();a.copyTo(b);this.reduce(b);return b}}function barrettRevert(a){return a}
+function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Barrett.prototype.convert=barrettConvert;
+Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo;
+function bnModPow(a,b){var c=a.bitLength(),d,e=nbv(1),g;if(c<=0)return e;else d=c<18?1:c<48?3:c<144?4:c<768?5:6;g=c<8?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var h=[],f=3,o=d-1,p=(1<<d)-1;h[1]=g.convert(this);if(d>1){c=nbi();for(g.sqrTo(h[1],c);f<=p;)h[f]=nbi(),g.mulTo(c,h[f-2],h[f]),f+=2}for(var q=a.t-1,n,k=!0,j=nbi(),c=nbits(a[q])-1;q>=0;){c>=o?n=a[q]>>c-o&p:(n=(a[q]&(1<<c+1)-1)<<o-c,q>0&&(n|=a[q-1]>>this.DB+c-o));for(f=d;(n&1)==0;)n>>=1,--f;if((c-=f)<0)c+=this.DB,--q;if(k)h[n].copyTo(e),
+k=!1;else{for(;f>1;)g.sqrTo(e,j),g.sqrTo(j,e),f-=2;f>0?g.sqrTo(e,j):(f=e,e=j,j=f);g.mulTo(j,h[n],e)}for(;q>=0&&(a[q]&1<<c)==0;)g.sqrTo(e,j),f=e,e=j,j=f,--c<0&&(c=this.DB-1,--q)}return g.revert(e)}
+function bnGCD(a){var b=this.s<0?this.negate():this.clone(),a=a.s<0?a.negate():a.clone();if(b.compareTo(a)<0)var c=b,b=a,a=c;var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(d<0)return b;c<d&&(d=c);d>0&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;b.signum()>0;)(c=b.getLowestSetBit())>0&&b.rShiftTo(c,b),(c=a.getLowestSetBit())>0&&a.rShiftTo(c,a),b.compareTo(a)>=0?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));d>0&&a.lShiftTo(d,a);return a}
+function bnpModInt(a){if(a<=0)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(b==0)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}
+function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||a.signum()==0)return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),g=nbv(0),h=nbv(0),f=nbv(1);c.signum()!=0;){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!e.isEven()||!g.isEven())e.addTo(this,e),g.subTo(a,g);e.rShiftTo(1,e)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1,g)}for(;d.isEven();){d.rShiftTo(1,d);if(b){if(!h.isEven()||!f.isEven())h.addTo(this,h),f.subTo(a,f);h.rShiftTo(1,h)}else f.isEven()||f.subTo(a,f);f.rShiftTo(1,
+f)}c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(h,e),g.subTo(f,g)):(d.subTo(c,d),b&&h.subTo(e,h),f.subTo(g,f))}if(d.compareTo(BigInteger.ONE)!=0)return BigInteger.ZERO;if(f.compareTo(a)>=0)return f.subtract(a);if(f.signum()<0)f.addTo(a,f);else return f;return f.signum()<0?f.add(a):f}
+var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,
+733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=67108864/lowprimes[lowprimes.length-1];
+function bnIsProbablePrime(a){var b,c=this.abs();if(c.t==1&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b<lowprimes.length;++b)if(c[0]==lowprimes[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<lowprimes.length;){for(var d=lowprimes[b],e=b+1;e<lowprimes.length&&d<lplim;)d*=lowprimes[e++];for(d=c.modInt(d);b<e;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}
+function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(c<=0)return!1;var d=b.shiftRight(c),a=a+1>>1;if(a>lowprimes.length)a=lowprimes.length;for(var e=nbi(),g=0;g<a;++g){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var h=e.modPow(d,this);if(h.compareTo(BigInteger.ONE)!=0&&h.compareTo(b)!=0){for(var f=1;f++<c&&h.compareTo(b)!=0;)if(h=h.modPowInt(2,this),h.compareTo(BigInteger.ONE)==0)return!1;if(h.compareTo(b)!=0)return!1}}return!0}
+BigInteger.prototype.chunkSize=bnpChunkSize;BigInteger.prototype.toRadix=bnpToRadix;BigInteger.prototype.fromRadix=bnpFromRadix;BigInteger.prototype.fromNumber=bnpFromNumber;BigInteger.prototype.bitwiseTo=bnpBitwiseTo;BigInteger.prototype.changeBit=bnpChangeBit;BigInteger.prototype.addTo=bnpAddTo;BigInteger.prototype.dMultiply=bnpDMultiply;BigInteger.prototype.dAddOffset=bnpDAddOffset;BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo;BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo;
+BigInteger.prototype.modInt=bnpModInt;BigInteger.prototype.millerRabin=bnpMillerRabin;BigInteger.prototype.clone=bnClone;BigInteger.prototype.intValue=bnIntValue;BigInteger.prototype.byteValue=bnByteValue;BigInteger.prototype.shortValue=bnShortValue;BigInteger.prototype.signum=bnSigNum;BigInteger.prototype.toByteArray=bnToByteArray;BigInteger.prototype.equals=bnEquals;BigInteger.prototype.min=bnMin;BigInteger.prototype.max=bnMax;BigInteger.prototype.and=bnAnd;BigInteger.prototype.or=bnOr;
+BigInteger.prototype.xor=bnXor;BigInteger.prototype.andNot=bnAndNot;BigInteger.prototype.not=bnNot;BigInteger.prototype.shiftLeft=bnShiftLeft;BigInteger.prototype.shiftRight=bnShiftRight;BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit;BigInteger.prototype.bitCount=bnBitCount;BigInteger.prototype.testBit=bnTestBit;BigInteger.prototype.setBit=bnSetBit;BigInteger.prototype.clearBit=bnClearBit;BigInteger.prototype.flipBit=bnFlipBit;BigInteger.prototype.add=bnAdd;BigInteger.prototype.subtract=bnSubtract;
+BigInteger.prototype.multiply=bnMultiply;BigInteger.prototype.divide=bnDivide;BigInteger.prototype.remainder=bnRemainder;BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder;BigInteger.prototype.modPow=bnModPow;BigInteger.prototype.modInverse=bnModInverse;BigInteger.prototype.pow=bnPow;BigInteger.prototype.gcd=bnGCD;BigInteger.prototype.isProbablePrime=bnIsProbablePrime;BigInteger.prototype.square=bnSquare;
+(function(a,b,c,d,e,g,h){function f(a){var b,d,e=this,g=a.length,f=0,h=e.i=e.j=e.m=0;e.S=[];e.c=[];for(g||(a=[g++]);f<c;)e.S[f]=f++;for(f=0;f<c;f++)b=e.S[f],h=h+b+a[f%g]&c-1,d=e.S[h],e.S[f]=d,e.S[h]=b;e.g=function(a){var b=e.S,d=e.i+1&c-1,g=b[d],f=e.j+g&c-1,h=b[f];b[d]=h;b[f]=g;for(var k=b[g+h&c-1];--a;)d=d+1&c-1,g=b[d],f=f+g&c-1,h=b[f],b[d]=h,b[f]=g,k=k*c+b[g+h&c-1];e.i=d;e.j=f;return k};e.g(c)}function o(a,b,c,d,e){c=[];e=typeof a;if(b&&e=="object")for(d in a)if(d.indexOf("S")<5)try{c.push(o(a[d],
+b-1))}catch(g){}return c.length?c:a+(e!="string"?"\x00":"")}function p(a,b,d,e){a+="";for(e=d=0;e<a.length;e++){var g=b,f=e&c-1,h=(d^=b[e&c-1]*19)+a.charCodeAt(e);g[f]=h&c-1}a="";for(e in b)a+=String.fromCharCode(b[e]);return a}b.seedrandom=function(q,n){var k=[],j,q=p(o(n?[q,a]:arguments.length?q:[(new Date).getTime(),a,window],3),k);j=new f(k);p(j.S,a);b.random=function(){for(var a=j.g(d),b=h,f=0;a<e;)a=(a+f)*c,b*=c,f=j.g(1);for(;a>=g;)a/=2,b/=2,f>>>=1;return(a+f)/b};return q};h=b.pow(c,d);e=b.pow(2,
+e);g=e*2;p(b.random(),a)})([],Math,256,6,52);function SeededRandom(){}function SRnextBytes(a){var b;for(b=0;b<a.length;b++)a[b]=Math.floor(Math.random()*256)}SeededRandom.prototype.nextBytes=SRnextBytes;function Arcfour(){this.j=this.i=0;this.S=[]}function ARC4init(a){var b,c,d;for(b=0;b<256;++b)this.S[b]=b;for(b=c=0;b<256;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.j=this.i=0}
+function ARC4next(){var a;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]&255]}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;function prng_newstate(){return new Arcfour}var rng_psize=256,rng_state,rng_pool,rng_pptr;
+function rng_seed_int(a){rng_pool[rng_pptr++]^=a&255;rng_pool[rng_pptr++]^=a>>8&255;rng_pool[rng_pptr++]^=a>>16&255;rng_pool[rng_pptr++]^=a>>24&255;rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}
+if(rng_pool==null){rng_pool=[];rng_pptr=0;var t;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=z.charCodeAt(t)&255}for(;rng_pptr<rng_psize;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=t&255;rng_pptr=0;rng_seed_time()}
+function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(a){var b;for(b=0;b<a.length;++b)a[b]=rng_get_byte()}function SecureRandom(){}SecureRandom.prototype.nextBytes=rng_get_bytes;
+function SHA256(a){function b(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535}function c(a,b){return a>>>b|a<<32-b}a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var h=a.charCodeAt(c);h<128?b+=String.fromCharCode(h):(h>127&&h<2048?b+=String.fromCharCode(h>>6|192):(b+=String.fromCharCode(h>>12|224),b+=String.fromCharCode(h>>6&63|128)),b+=String.fromCharCode(h&63|128))}return b}(a);return function(a){for(var b="",c=0;c<a.length*4;c++)b+="0123456789abcdef".charAt(a[c>>
+2]>>(3-c%4)*8+4&15)+"0123456789abcdef".charAt(a[c>>2]>>(3-c%4)*8&15);return b}(function(a,e){var g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,
+2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],f=Array(64),o,p,q,n,k,j,l,m,s,r,u,w;a[e>>5]|=128<<24-e%32;a[(e+64>>9<<4)+15]=e;for(s=0;s<a.length;s+=16){o=h[0];p=h[1];q=h[2];n=h[3];
+k=h[4];j=h[5];l=h[6];m=h[7];for(r=0;r<64;r++)f[r]=r<16?a[r+s]:b(b(b(c(f[r-2],17)^c(f[r-2],19)^f[r-2]>>>10,f[r-7]),c(f[r-15],7)^c(f[r-15],18)^f[r-15]>>>3),f[r-16]),u=b(b(b(b(m,c(k,6)^c(k,11)^c(k,25)),k&j^~k&l),g[r]),f[r]),w=b(c(o,2)^c(o,13)^c(o,22),o&p^o&q^p&q),m=l,l=j,j=k,k=b(n,u),n=q,q=p,p=o,o=b(u,w);h[0]=b(o,h[0]);h[1]=b(p,h[1]);h[2]=b(q,h[2]);h[3]=b(n,h[3]);h[4]=b(k,h[4]);h[5]=b(j,h[5]);h[6]=b(l,h[6]);h[7]=b(m,h[7])}return h}(function(a){for(var b=[],c=0;c<a.length*8;c+=8)b[c>>5]|=(a.charCodeAt(c/
+8)&255)<<24-c%32;return b}(a),a.length*8))}var sha256={hex:function(a){return SHA256(a)}};
+function SHA1(a){function b(a,b){return a<<b|a>>>32-b}function c(a){var b="",c,d;for(c=7;c>=0;c--)d=a>>>c*4&15,b+=d.toString(16);return b}var d,e,g=Array(80),h=1732584193,f=4023233417,o=2562383102,p=271733878,q=3285377520,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b+=String.fromCharCode(d):(d>127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&
+63|128))}return b}(a);n=a.length;var s=[];for(d=0;d<n-3;d+=4)e=a.charCodeAt(d)<<24|a.charCodeAt(d+1)<<16|a.charCodeAt(d+2)<<8|a.charCodeAt(d+3),s.push(e);switch(n%4){case 0:d=2147483648;break;case 1:d=a.charCodeAt(n-1)<<24|8388608;break;case 2:d=a.charCodeAt(n-2)<<24|a.charCodeAt(n-1)<<16|32768;break;case 3:d=a.charCodeAt(n-3)<<24|a.charCodeAt(n-2)<<16|a.charCodeAt(n-1)<<8|128}for(s.push(d);s.length%16!=14;)s.push(0);s.push(n>>>29);s.push(n<<3&4294967295);for(a=0;a<s.length;a+=16){for(d=0;d<16;d++)g[d]=
+s[a+d];for(d=16;d<=79;d++)g[d]=b(g[d-3]^g[d-8]^g[d-14]^g[d-16],1);e=h;n=f;k=o;j=p;l=q;for(d=0;d<=19;d++)m=b(e,5)+(n&k|~n&j)+l+g[d]+1518500249&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=20;d<=39;d++)m=b(e,5)+(n^k^j)+l+g[d]+1859775393&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=40;d<=59;d++)m=b(e,5)+(n&k|n&j|k&j)+l+g[d]+2400959708&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=60;d<=79;d++)m=b(e,5)+(n^k^j)+l+g[d]+3395469782&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;h=h+e&4294967295;f=f+n&4294967295;o=o+k&4294967295;
+p=p+j&4294967295;q=q+l&4294967295}m=c(h)+c(f)+c(o)+c(p)+c(q);return m.toLowerCase()}
+var sha1={hex:function(a){return SHA1(a)}},MD5=function(a){function b(a,b){var c,d,e,f,g;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;g=(a&1073741823)+(b&1073741823);return c&d?g^2147483648^e^f:c|d?g&1073741824?g^3221225472^e^f:g^1073741824^e^f:g^e^f}function c(a,c,d,e,f,g,h){a=b(a,b(b(c&d|~c&e,f),h));return b(a<<g|a>>>32-g,c)}function d(a,c,d,e,f,g,h){a=b(a,b(b(c&e|d&~e,f),h));return b(a<<g|a>>>32-g,c)}function e(a,c,d,e,f,g,h){a=b(a,b(b(c^d^e,f),h));return b(a<<g|a>>>32-g,c)}function g(a,
+c,d,e,f,g,h){a=b(a,b(b(d^(c|~e),f),h));return b(a<<g|a>>>32-g,c)}function h(a){var b="",c="",d;for(d=0;d<=3;d++)c=a>>>d*8&255,c="0"+c.toString(16),b+=c.substr(c.length-2,2);return b}var f=[],o,p,q,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b+=String.fromCharCode(d):(d>127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b}(a),
+f=function(a){var b,c=a.length;b=c+8;for(var d=((b-b%64)/64+1)*16,e=Array(d-1),f=0,g=0;g<c;)b=(g-g%4)/4,f=g%4*8,e[b]|=a.charCodeAt(g)<<f,g++;e[(g-g%4)/4]|=128<<g%4*8;e[d-2]=c<<3;e[d-1]=c>>>29;return e}(a);k=1732584193;j=4023233417;l=2562383102;m=271733878;for(a=0;a<f.length;a+=16)o=k,p=j,q=l,n=m,k=c(k,j,l,m,f[a+0],7,3614090360),m=c(m,k,j,l,f[a+1],12,3905402710),l=c(l,m,k,j,f[a+2],17,606105819),j=c(j,l,m,k,f[a+3],22,3250441966),k=c(k,j,l,m,f[a+4],7,4118548399),m=c(m,k,j,l,f[a+5],12,1200080426),l=c(l,
+m,k,j,f[a+6],17,2821735955),j=c(j,l,m,k,f[a+7],22,4249261313),k=c(k,j,l,m,f[a+8],7,1770035416),m=c(m,k,j,l,f[a+9],12,2336552879),l=c(l,m,k,j,f[a+10],17,4294925233),j=c(j,l,m,k,f[a+11],22,2304563134),k=c(k,j,l,m,f[a+12],7,1804603682),m=c(m,k,j,l,f[a+13],12,4254626195),l=c(l,m,k,j,f[a+14],17,2792965006),j=c(j,l,m,k,f[a+15],22,1236535329),k=d(k,j,l,m,f[a+1],5,4129170786),m=d(m,k,j,l,f[a+6],9,3225465664),l=d(l,m,k,j,f[a+11],14,643717713),j=d(j,l,m,k,f[a+0],20,3921069994),k=d(k,j,l,m,f[a+5],5,3593408605),
+m=d(m,k,j,l,f[a+10],9,38016083),l=d(l,m,k,j,f[a+15],14,3634488961),j=d(j,l,m,k,f[a+4],20,3889429448),k=d(k,j,l,m,f[a+9],5,568446438),m=d(m,k,j,l,f[a+14],9,3275163606),l=d(l,m,k,j,f[a+3],14,4107603335),j=d(j,l,m,k,f[a+8],20,1163531501),k=d(k,j,l,m,f[a+13],5,2850285829),m=d(m,k,j,l,f[a+2],9,4243563512),l=d(l,m,k,j,f[a+7],14,1735328473),j=d(j,l,m,k,f[a+12],20,2368359562),k=e(k,j,l,m,f[a+5],4,4294588738),m=e(m,k,j,l,f[a+8],11,2272392833),l=e(l,m,k,j,f[a+11],16,1839030562),j=e(j,l,m,k,f[a+14],23,4259657740),
+k=e(k,j,l,m,f[a+1],4,2763975236),m=e(m,k,j,l,f[a+4],11,1272893353),l=e(l,m,k,j,f[a+7],16,4139469664),j=e(j,l,m,k,f[a+10],23,3200236656),k=e(k,j,l,m,f[a+13],4,681279174),m=e(m,k,j,l,f[a+0],11,3936430074),l=e(l,m,k,j,f[a+3],16,3572445317),j=e(j,l,m,k,f[a+6],23,76029189),k=e(k,j,l,m,f[a+9],4,3654602809),m=e(m,k,j,l,f[a+12],11,3873151461),l=e(l,m,k,j,f[a+15],16,530742520),j=e(j,l,m,k,f[a+2],23,3299628645),k=g(k,j,l,m,f[a+0],6,4096336452),m=g(m,k,j,l,f[a+7],10,1126891415),l=g(l,m,k,j,f[a+14],15,2878612391),
+j=g(j,l,m,k,f[a+5],21,4237533241),k=g(k,j,l,m,f[a+12],6,1700485571),m=g(m,k,j,l,f[a+3],10,2399980690),l=g(l,m,k,j,f[a+10],15,4293915773),j=g(j,l,m,k,f[a+1],21,2240044497),k=g(k,j,l,m,f[a+8],6,1873313359),m=g(m,k,j,l,f[a+15],10,4264355552),l=g(l,m,k,j,f[a+6],15,2734768916),j=g(j,l,m,k,f[a+13],21,1309151649),k=g(k,j,l,m,f[a+4],6,4149444226),m=g(m,k,j,l,f[a+11],10,3174756917),l=g(l,m,k,j,f[a+2],15,718787259),j=g(j,l,m,k,f[a+9],21,3951481745),k=b(k,o),j=b(j,p),l=b(l,q),m=b(m,n);return(h(k)+h(j)+h(l)+
+h(m)).toLowerCase()};function parseBigInt(a,b){return new BigInteger(a,b)}function linebrk(a,b){for(var c="",d=0;d+b<a.length;)c+=a.substring(d,d+b)+"\n",d+=b;return c+a.substring(d,a.length)}function byte2Hex(a){return a<16?"0"+a.toString(16):a.toString(16)}
+function pkcs1pad2(a,b){if(b<a.length+11)throw"Message too long for RSA (n="+b+", l="+a.length+")";for(var c=[],d=a.length-1;d>=0&&b>0;){var e=a.charCodeAt(d--);e<128?c[--b]=e:e>127&&e<2048?(c[--b]=e&63|128,c[--b]=e>>6|192):(c[--b]=e&63|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;d=new SecureRandom;for(e=[];b>2;){for(e[0]=0;e[0]==0;)d.nextBytes(e);c[--b]=e[0]}c[--b]=2;c[--b]=0;return new BigInteger(c)}
+function RSAKey(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}function RSASetPublic(a,b){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):alert("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){a=pkcs1pad2(a,this.n.bitLength()+7>>3);if(a==null)return null;a=this.doPublic(a);if(a==null)return null;a=a.toString(16);return(a.length&1)==0?a:"0"+a}
+RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d<c.length&&c[d]==0;)++d;if(c.length-d!=b-1||c[d]!=2)return null;for(++d;c[d]!=0;)if(++d>=c.length)return null;for(var e="";++d<c.length;){var g=c[d]&255;g<128?e+=String.fromCharCode(g):g>191&&g<224?(e+=String.fromCharCode((g&31)<<6|c[d+1]&63),++d):(e+=String.fromCharCode((g&15)<<12|(c[d+1]&63)<<6|c[d+2]&63),d+=2)}return e}
+function RSASetPrivate(a,b,c){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):alert("Invalid RSA private key")}
+function RSASetPrivateEx(a,b,c,d,e,g,h,f){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(g,16),this.dmq1=parseBigInt(h,16),this.coeff=parseBigInt(f,16)):alert("Invalid RSA private key")}
+function RSAGenerate(a,b){var c=new SeededRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;;)if(this.p=new BigInteger(a-d,1,c),this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10))break;for(;;)if(this.q=new BigInteger(d,1,c),this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10))break;if(this.p.compareTo(this.q)<=0){var g=this.p;this.p=this.q;this.q=g}var g=this.p.subtract(BigInteger.ONE),
+h=this.q.subtract(BigInteger.ONE),f=g.multiply(h);if(f.gcd(e).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);this.d=e.modInverse(f);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(h);this.coeff=this.q.modInverse(this.p);break}}}
+function RSADoPrivate(a){if(this.p==null||this.q==null)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),a=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(a)<0;)b=b.add(this.p);return b.subtract(a).multiply(this.coeff).mod(this.p).multiply(this.q).add(a)}function RSADecrypt(a){a=this.doPrivate(parseBigInt(a,16));return a==null?null:pkcs1unpad2(a,this.n.bitLength()+7>>3)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate;
+RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;var _RSASIGN_DIHEAD=[];_RSASIGN_DIHEAD.sha1="3021300906052b0e03021a05000414";_RSASIGN_DIHEAD.sha256="3031300d060960864801650304020105000420";var _RSASIGN_HASHHEXFUNC=[];_RSASIGN_HASHHEXFUNC.sha1=sha1.hex;_RSASIGN_HASHHEXFUNC.sha256=sha256.hex;
+function _rsasign_getHexPaddedDigestInfoForString(a,b,c){b/=4;for(var a=(0,_RSASIGN_HASHHEXFUNC[c])(a),c="00"+_RSASIGN_DIHEAD[c]+a,a="",b=b-4-c.length,d=0;d<b;d+=2)a+="ff";return sPaddedMessageHex="0001"+a+c}function _rsasign_signString(a,b){var c=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),b);return this.doPrivate(parseBigInt(c,16)).toString(16)}
+function _rsasign_signStringWithSHA1(a){a=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),"sha1");return this.doPrivate(parseBigInt(a,16)).toString(16)}function _rsasign_signStringWithSHA256(a){a=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),"sha256");return this.doPrivate(parseBigInt(a,16)).toString(16)}function _rsasign_getDecryptSignatureBI(a,b,c){var d=new RSAKey;d.setPublic(b,c);return d.doPublic(a)}
+function _rsasign_getHexDigestInfoFromSig(a,b,c){return _rsasign_getDecryptSignatureBI(a,b,c).toString(16).replace(/^1f+00/,"")}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(a){for(var b in _RSASIGN_DIHEAD){var c=_RSASIGN_DIHEAD[b],d=c.length;if(a.substring(0,d)==c)return[b,a.substring(d)]}return[]}
+function _rsasign_verifySignatureWithArgs(a,b,c,d){b=_rsasign_getHexDigestInfoFromSig(b,c,d);c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(b);if(c.length==0)return!1;b=c[1];a=(0,_RSASIGN_HASHHEXFUNC[c[0]])(a);return b==a}function _rsasign_verifyHexSignatureForMessage(a,b){var c=parseBigInt(a,16);return _rsasign_verifySignatureWithArgs(b,c,this.n.toString(16),this.e.toString(16))}
+function _rsasign_verifyString(a,b){var b=b.replace(/[ \n]+/g,""),c=this.doPublic(parseBigInt(b,16)).toString(16).replace(/^1f+00/,""),d=_rsasign_getAlgNameAndHashFromHexDisgestInfo(c);if(d.length==0)return!1;c=d[1];d=(0,_RSASIGN_HASHHEXFUNC[d[0]])(a);return c==d}RSAKey.prototype.signString=_rsasign_signString;RSAKey.prototype.signStringWithSHA1=_rsasign_signStringWithSHA1;RSAKey.prototype.signStringWithSHA256=_rsasign_signStringWithSHA256;RSAKey.prototype.verifyString=_rsasign_verifyString;
+RSAKey.prototype.verifyHexSignatureForMessage=_rsasign_verifyHexSignatureForMessage;
+var aes=function(){var a={Sbox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,
+95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ShiftRowTab:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11]};a.Init=
+function(){a.Sbox_Inv=Array(256);for(var b=0;b<256;b++)a.Sbox_Inv[a.Sbox[b]]=b;a.ShiftRowTab_Inv=Array(16);for(b=0;b<16;b++)a.ShiftRowTab_Inv[a.ShiftRowTab[b]]=b;a.xtime=Array(256);for(b=0;b<128;b++)a.xtime[b]=b<<1,a.xtime[128+b]=b<<1^27};a.Done=function(){delete a.Sbox_Inv;delete a.ShiftRowTab_Inv;delete a.xtime};a.ExpandKey=function(b){var c=b.length,d,e=1;switch(c){case 16:d=176;break;case 24:d=208;break;case 32:d=240;break;default:alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!")}for(var g=
+c;g<d;g+=4){var h=b.slice(g-4,g);if(g%c==0){if(h=[a.Sbox[h[1]]^e,a.Sbox[h[2]],a.Sbox[h[3]],a.Sbox[h[0]]],(e<<=1)>=256)e^=283}else c>24&&g%c==16&&(h=[a.Sbox[h[0]],a.Sbox[h[1]],a.Sbox[h[2]],a.Sbox[h[3]]]);for(var f=0;f<4;f++)b[g+f]=b[g+f-c]^h[f]}};a.Encrypt=function(b,c){var d=c.length;a.AddRoundKey(b,c.slice(0,16));for(var e=16;e<d-16;e+=16)a.SubBytes(b,a.Sbox),a.ShiftRows(b,a.ShiftRowTab),a.MixColumns(b),a.AddRoundKey(b,c.slice(e,e+16));a.SubBytes(b,a.Sbox);a.ShiftRows(b,a.ShiftRowTab);a.AddRoundKey(b,
+c.slice(e,d))};a.Decrypt=function(b,c){var d=c.length;a.AddRoundKey(b,c.slice(d-16,d));a.ShiftRows(b,a.ShiftRowTab_Inv);a.SubBytes(b,a.Sbox_Inv);for(d-=32;d>=16;d-=16)a.AddRoundKey(b,c.slice(d,d+16)),a.MixColumns_Inv(b),a.ShiftRows(b,a.ShiftRowTab_Inv),a.SubBytes(b,a.Sbox_Inv);a.AddRoundKey(b,c.slice(0,16))};a.SubBytes=function(a,c){for(var d=0;d<16;d++)a[d]=c[a[d]]};a.AddRoundKey=function(a,c){for(var d=0;d<16;d++)a[d]^=c[d]};a.ShiftRows=function(a,c){for(var d=[].concat(a),e=0;e<16;e++)a[e]=d[c[e]]};
+a.MixColumns=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h;b[c+0]^=f^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=f^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};a.MixColumns_Inv=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h,o=a.xtime[f],p=a.xtime[a.xtime[o^d^g]]^f;f^=a.xtime[a.xtime[o^e^h]];b[c+0]^=p^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=p^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};return a}(),cryptico=function(){var a={};aes.Init();
+a.b256to64=function(a){var c,d,e,g="",h=0,f=0,o=a.length;for(e=0;e<o;e++)d=a.charCodeAt(e),f==0?(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2&63),c=(d&3)<<4):f==1?(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>4&15),c=(d&15)<<2):f==2&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>6&3),h+=1,g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63)),h+=1,f+=1,f==3&&
+(f=0);f>0&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c),g+="=");f==1&&(g+="=");return g};a.b64to256=function(a){var c,d,e="",g=0,h=0,f=a.length;for(d=0;d<f;d++)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(d)),c>=0&&(g&&(e+=String.fromCharCode(h|c>>6-g&255)),g=g+2&7,h=c<<g&255);return e};a.b16to64=function(a){var c,d,e="";a.length%2==1&&(a="0"+a);for(c=0;c+3<=a.length;c+=3)d=parseInt(a.substring(c,c+3),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>
+6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63);c+1==a.length?(d=parseInt(a.substring(c,c+1),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d<<2)):c+2==a.length&&(d=parseInt(a.substring(c,c+2),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4));for(;(e.length&3)>0;)e+="=";return e};a.b64to16=function(a){var c="",
+d,e=0,g;for(d=0;d<a.length;++d){if(a.charAt(d)=="=")break;v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(d));v<0||(e==0?(c+=int2char(v>>2),g=v&3,e=1):e==1?(c+=int2char(g<<2|v>>4),g=v&15,e=2):e==2?(c+=int2char(g),c+=int2char(v>>2),g=v&3,e=3):(c+=int2char(g<<2|v>>4),c+=int2char(v&15),e=0))}e==1&&(c+=int2char(g<<2));return c};a.string2bytes=function(a){for(var c=[],d=0;d<a.length;d++)c.push(a.charCodeAt(d));return c};a.bytes2string=function(a){for(var c="",d=0;d<
+a.length;d++)c+=String.fromCharCode(a[d]);return c};a.blockXOR=function(a,c){for(var d=Array(16),e=0;e<16;e++)d[e]=a[e]^c[e];return d};a.blockIV=function(){var a=new SecureRandom,c=Array(16);a.nextBytes(c);return c};a.pad16=function(a){var c=a.slice(0),d=(16-a.length%16)%16;for(i=a.length;i<a.length+d;i++)c.push(0);return c};a.depad=function(a){for(a=a.slice(0);a[a.length-1]==0;)a=a.slice(0,a.length-1);return a};a.encryptAESCBC=function(b,c){var d=c.slice(0);aes.ExpandKey(d);for(var e=a.string2bytes(b),
+e=a.pad16(e),g=a.blockIV(),h=0;h<e.length/16;h++){var f=e.slice(h*16,h*16+16),o=g.slice(h*16,h*16+16),f=a.blockXOR(o,f);aes.Encrypt(f,d);g=g.concat(f)}d=a.bytes2string(g);return a.b256to64(d)};a.decryptAESCBC=function(b,c){var d=c.slice(0);aes.ExpandKey(d);for(var b=a.b64to256(b),e=a.string2bytes(b),g=[],h=1;h<e.length/16;h++){var f=e.slice(h*16,h*16+16),o=e.slice((h-1)*16,(h-1)*16+16);aes.Decrypt(f,d);f=a.blockXOR(o,f);g=g.concat(f)}g=a.depad(g);return a.bytes2string(g)};a.wrap60=function(a){for(var c=
+"",d=0;d<a.length;d++)d%60==0&&d!=0&&(c+="\n"),c+=a[d];return c};a.generateAESKey=function(){var a=Array(16);(new SecureRandom).nextBytes(a);return a};a.generateRSAKey=function(a,c){Math.seedrandom(sha256.hex(a));var d=new RSAKey;d.generate(c,"10001");return d};a.publicKeyString=function(b){return pubkey=b.n.toString(16)};a.publicKeyID=function(a){return MD5(a)};a.publicKeyFromString=function(b){var b=b.split("|")[0],c=new RSAKey;c.setPublic(b,"10001");return c};a.encrypt=function(b,
+c,d){var e="";try{var h=a.publicKeyFromString(c);e+=h.encrypt(b)+"?"}catch(f){return{status:"Invalid public key"}};return{status:"success",cipher:e}};a.decrypt=function(b,c){var d=b.split("?"),e=c.decrypt(d[0]);return{status:"success",plaintext:e,signature:"unsigned"}};return a}();

+ 621 - 0
public/codebase/encryption/AES.js

@@ -0,0 +1,621 @@
+(function() {
+	var Nr = 10;
+	// convert two-dimensional indicies to one-dim array indices
+	var I00 = 0;
+	var I01 = 1;
+	var I02 = 2;
+	var I03 = 3;
+	var I10 = 4;
+	var I11 = 5;
+	var I12 = 6;
+	var I13 = 7;
+	var I20 = 8;
+	var I21 = 9;
+	var I22 = 10;
+	var I23 = 11;
+	var I30 = 12;
+	var I31 = 13;
+	var I32 = 14;
+	var I33 = 15;
+	
+	// S-Box substitution table
+	var S_enc = new Array(
+	0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
+	0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+	0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
+	0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+	0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
+	0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+	0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
+	0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+	0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
+	0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+	0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
+	0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+	0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
+	0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+	0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
+	0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+	0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
+	0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+	0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
+	0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+	0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
+	0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+	0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
+	0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+	0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
+	0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+	0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
+	0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+	0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
+	0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+	0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
+	0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16);
+	
+	// inverse S-Box for decryptions
+	var S_dec = new Array(
+	0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38,
+	0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
+	0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
+	0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
+	0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d,
+	0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
+	0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2,
+	0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
+	0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16,
+	0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
+	0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,
+	0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
+	0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a,
+	0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
+	0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02,
+	0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
+	0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea,
+	0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
+	0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85,
+	0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
+	0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89,
+	0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
+	0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20,
+	0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
+	0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31,
+	0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
+	0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d,
+	0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
+	0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0,
+	0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
+	0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26,
+	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d);
+	
+	function cvt_hex8 (val) {
+		var vh = (val>>>4)&0x0f;
+		return vh.toString(16) + (val&0x0f).toString(16);
+	}
+	function cvt_byte (str) {
+		// get the first hex digit
+		var val1 = str.charCodeAt(0);
+		// do some error checking
+		if (val1 >= 48 && val1 <= 57) {
+			// have a valid digit 0-9
+			val1 -= 48;
+		} else if (val1 >= 65 && val1 <= 70) {
+			// have a valid digit A-F
+			val1 -= 55;
+		} else if (val1 >= 97 && val1 <= 102) {
+			// have a valid digit A-F
+			val1 -= 87;
+		} else {
+			// not 0-9 or A-F, complain
+			console.log( str.charAt(1)+" is not a valid hex digit" );
+			return -1;
+		}
+		// get the second hex digit
+		var val2 = str.charCodeAt(1);
+		// do some error checking
+		if ( val2 >= 48 && val2 <= 57 ) {
+			// have a valid digit 0-9
+			val2 -= 48;
+		} else if ( val2 >= 65 && val2 <= 70 ) {
+			// have a valid digit A-F
+			val2 -= 55;
+		} else if ( val2 >= 97 && val2 <= 102 ) {
+			// have a valid digit A-F
+			val2 -= 87;
+		} else {
+			// not 0-9 or A-F, complain
+			console.log( str.charAt(2)+" is not a valid hex digit" );
+			return -1;
+		}
+		// all is ok, return the value
+		return val1*16 + val2;
+	}
+	
+	// conversion function for non-constant subscripts
+	// assume subscript range 0..3
+	function I(x,y) {
+		return (x*4) + y;
+	}
+	
+	// remove spaces from input
+	function remove_spaces(instr) {
+		var i;
+		var outstr = "";
+		for(i=0; i<instr.length; i++) {
+		if ( instr.charAt(i) != " " )
+			 // not a space, include it
+			 outstr += instr.charAt(i);
+		}
+		return outstr;
+	}
+
+	// get the message to encrypt/decrypt or the key
+	// return as a 16-byte array
+	function get_value(str, isASCII) {
+		var dbyte = new Array(16);
+		var i;
+		var val;	// one hex digit
+		if (isASCII) {
+			// check length of data
+			if (str.length > 16) {
+				console.log("is too long, using the first 16 ASCII characters" );
+			}
+			// have ASCII data
+			// 16 characters?
+			if (str.length >= 16) {
+				// 16 or more characters
+				for(i=0; i<16; i++) {
+					dbyte[i] = str.charCodeAt(i);
+				}
+			} else {
+				 // less than 16 characters - fill with NULLs
+				for(i=0; i<str.length; i++) {
+					dbyte[i] = str.charCodeAt(i);
+				}
+				for( i=str.length; i<16; i++) {
+					dbyte[i] = 0;
+				}
+			}
+		} else {
+			// have hex data - remove any spaces they used, then convert
+			//str = remove_spaces(str);
+			// check length of data
+			if ( str.length != 32 ) {
+				//console.log("\tget_value:\tstr = " + str + "\tisASCII = " + isASCII); //isASCII = false
+				console.log("length wrong: Is " + str.length + " hex digits, but must be 128 bits (32 hex digits)");
+				dbyte[0] = -1;
+				return dbyte;
+			}
+			for( i=0; i<16; i++ ) {
+				// isolate and convert this substring
+				dbyte[i] = cvt_byte( str.substr(i*2,2) );
+				if( dbyte[i] < 0 ) {
+					// have an error
+					dbyte[0] = -1;
+					return dbyte;
+				}
+			}
+		}
+		// return successful conversion
+		return dbyte;
+	}
+	//do the AES GF(2**8) multiplication
+	// do this by the shift-and-"add" approach
+	function aes_mul(a, b) {
+		var res = 0;
+		while(a > 0) {
+		if((a&1) != 0)
+			res = res ^ b;		// "add" to the result
+			a >>>= 1;			// shift a to get next higher-order bit
+			b <<= 1;			// shift multiplier also
+		}
+		// now reduce it modulo x**8 + x**4 + x**3 + x + 1
+		var hbit = 0x10000;		// bit to test if we need to take action
+		var modulus = 0x11b00;	// modulus - XOR by this to change value
+		while(hbit >= 0x100) {
+			if ((res & hbit) != 0) {
+				res ^= modulus;	// XOR with the modulus
+			}
+			// prepare for the next loop
+			hbit >>= 1;
+			modulus >>= 1;
+		}
+		return res;
+	}
+
+	// apply the S-box substitution to the key expansion
+	function SubWord(word_ary) {
+		var i;
+		for(i=0; i<16; i++) {
+			word_ary[i] = S_enc[word_ary[i]];
+		}
+		return word_ary;
+	}
+	
+	// rotate the bytes in a word
+	function RotWord(word_ary) {
+		return new Array(word_ary[1], word_ary[2], word_ary[3], word_ary[0]);
+	}
+
+	// calculate the first item Rcon[i] = { x^(i-1), 0, 0, 0 }
+	// note we only return the first item
+	function Rcon(exp) {
+		var val = 2;
+		var result = 1;
+	
+	   // remember to calculate x^(exp-1)
+	   exp--;
+	
+	   // process the exponent using normal shift and multiply
+	   while ( exp > 0 )
+	   {
+		  if ( (exp & 1) != 0 )
+			 result = aes_mul( result, val );
+	
+		  // square the value
+		  val = aes_mul( val, val );
+	
+		  // move to the next bit
+		  exp >>= 1;
+	   }
+	
+	   return result;
+	}
+	// round key generation
+	// return a byte array with the expanded key information
+	function key_expand( key )
+	{
+	   var temp = new Array(4);
+	   var i, j;
+	   var w = new Array(4*(Nr+1));
+
+	   // copy initial key stuff
+	   for( i=0; i<16; i++ )
+	   {
+		  w[i] = key[i];
+	   }
+
+	   // generate rest of key schedule using 32-bit words
+	   i = 4;
+	   while ( i < 4*(Nr+1))		// blocksize * ( rounds + 1 )
+	   {
+		  // copy word W[i-1] to temp
+		  for( j=0; j<4; j++ )
+			 temp[j] = w[(i-1)*4+j];
+
+		  if ( i % 4 == 0)
+		  {
+			 // temp = SubWord(RotWord(temp)) ^ Rcon[i/4];
+			 temp = RotWord( temp );
+			 temp = SubWord( temp );
+			 temp[0] ^= Rcon( i>>>2 );
+		  }
+
+		  // word = word ^ temp
+		  for( j=0; j<4; j++ )
+			 w[i*4+j] = w[(i-4)*4+j] ^ temp[j];
+
+		  i++;
+	   }
+
+	   return w;
+	}
+
+	// do S-Box substitution
+	function SubBytes(state, Sbox)
+	{
+	   var i;
+
+	   for( i=0; i<16; i++ )
+		  state[i] = Sbox[ state[i] ];
+
+	   return state;
+	}
+
+	// shift each row as appropriate
+	function ShiftRows(state)
+	{
+	   var t0, t1, t2, t3;
+
+	   // top row (row 0) isn't shifted
+
+	   // next row (row 1) rotated left 1 place
+	   t0 = state[I10];
+	   t1 = state[I11];
+	   t2 = state[I12];
+	   t3 = state[I13];
+	   state[I10] = t1;
+	   state[I11] = t2;
+	   state[I12] = t3;
+	   state[I13] = t0;
+
+	   // next row (row 2) rotated left 2 places
+	   t0 = state[I20];
+	   t1 = state[I21];
+	   t2 = state[I22];
+	   t3 = state[I23];
+	   state[I20] = t2;
+	   state[I21] = t3;
+	   state[I22] = t0;
+	   state[I23] = t1;
+
+	   // bottom row (row 3) rotated left 3 places
+	   t0 = state[I30];
+	   t1 = state[I31];
+	   t2 = state[I32];
+	   t3 = state[I33];
+	   state[I30] = t3;
+	   state[I31] = t0;
+	   state[I32] = t1;
+	   state[I33] = t2;
+
+	   return state;
+	}
+
+	// inverset shift each row as appropriate
+	function InvShiftRows(state)
+	{
+	   var t0, t1, t2, t3;
+
+	   // top row (row 0) isn't shifted
+
+	   // next row (row 1) rotated left 1 place
+	   t0 = state[I10];
+	   t1 = state[I11];
+	   t2 = state[I12];
+	   t3 = state[I13];
+	   state[I10] = t3;
+	   state[I11] = t0;
+	   state[I12] = t1;
+	   state[I13] = t2;
+
+	   // next row (row 2) rotated left 2 places
+	   t0 = state[I20];
+	   t1 = state[I21];
+	   t2 = state[I22];
+	   t3 = state[I23];
+	   state[I20] = t2;
+	   state[I21] = t3;
+	   state[I22] = t0;
+	   state[I23] = t1;
+
+	   // bottom row (row 3) rotated left 3 places
+	   t0 = state[I30];
+	   t1 = state[I31];
+	   t2 = state[I32];
+	   t3 = state[I33];
+	   state[I30] = t1;
+	   state[I31] = t2;
+	   state[I32] = t3;
+	   state[I33] = t0;
+
+	   return state;
+	}
+
+	// process column info
+	function MixColumns(state)
+	{
+	   var col;
+	   var c0, c1, c2, c3;
+
+	   for( col=0; col<4; col++ )
+	   {
+		  c0 = state[I(0,col)];
+		  c1 = state[I(1,col)];
+		  c2 = state[I(2,col)];
+		  c3 = state[I(3,col)];
+
+		  // do mixing, and put back into array
+		  state[I(0,col)] = aes_mul(2,c0) ^ aes_mul(3,c1) ^ c2 ^ c3;
+		  state[I(1,col)] = c0 ^ aes_mul(2,c1) ^ aes_mul(3,c2) ^ c3;
+		  state[I(2,col)] = c0 ^ c1 ^ aes_mul(2,c2) ^ aes_mul(3,c3);
+		  state[I(3,col)] = aes_mul(3,c0) ^ c1 ^ c2 ^ aes_mul(2,c3);
+	   }
+
+	   return state;
+	}
+
+	// inverse process column info
+	function InvMixColumns(state)
+	{
+	   var col;
+	   var c0, c1, c2, c3;
+
+	   for( col=0; col<4; col++ )
+	   {
+		  c0 = state[I(0,col)];
+		  c1 = state[I(1,col)];
+		  c2 = state[I(2,col)];
+		  c3 = state[I(3,col)];
+
+		  // do inverse mixing, and put back into array
+		  state[I(0,col)] = aes_mul(0x0e,c0) ^ aes_mul(0x0b,c1)
+				^ aes_mul(0x0d,c2) ^ aes_mul(0x09,c3);
+		  state[I(1,col)] = aes_mul(0x09,c0) ^ aes_mul(0x0e,c1)
+				^ aes_mul(0x0b,c2) ^ aes_mul(0x0d,c3);
+		  state[I(2,col)] = aes_mul(0x0d,c0) ^ aes_mul(0x09,c1)
+				^ aes_mul(0x0e,c2) ^ aes_mul(0x0b,c3);
+		  state[I(3,col)] = aes_mul(0x0b,c0) ^ aes_mul(0x0d,c1)
+				^ aes_mul(0x09,c2) ^ aes_mul(0x0e,c3);
+	   }
+
+	   return state;
+	}
+
+	// insert subkey information
+	function AddRoundKey( state, w, base )
+	{
+	   var col;
+
+	   for( col=0; col<4; col++ )
+	   {
+		  state[I(0,col)] ^= w[base+col*4];
+		  state[I(1,col)] ^= w[base+col*4+1];
+		  state[I(2,col)] ^= w[base+col*4+2];
+		  state[I(3,col)] ^= w[base+col*4+3];
+	   }
+
+	   return state;
+	}
+
+	// return a transposed array
+	function transpose( msg )
+	{
+	   var row, col;
+	   var state = new Array( 16 );
+
+	   for( row=0; row<4; row++ )
+		  for( col=0; col<4; col++ )
+			 state[I(row,col)] = msg[I(col,row)];
+
+	   return state;
+	}
+
+	// final AES state
+	var AES_output = new Array(16);
+
+	// format AES output
+	// -- uses the global array DES_output
+	function format_AES_output(bASCII)
+	{
+	   var i;
+	   var bits;
+	   var str="";
+
+	   // what type of data do we have to work with?
+	   if (bASCII)
+	   {
+		  // convert each set of bits back to ASCII
+		  for( i=0; i<16; i++ )
+			 str += String.fromCharCode( AES_output[i] );
+	   }
+	   else 
+	   {
+		  // output hexdecimal data (insert spaces)
+		  str = cvt_hex8( AES_output[0] );
+		  for( i=1; i<16; i++ )
+		  {
+			 str += "" + cvt_hex8( AES_output[i] );
+		  }
+	   }
+	   return str;
+	}
+
+	// do encrytion
+	function aes_encrypt(str, key, bASCII)
+	{
+	   //console.log("  aes_encrypt:\tstr = " + str + "\tkey = " + key + "\t bASCII = " + bASCII);
+	   var w = new Array( 4*(Nr+1) );			// subkey information
+	   var state = new Array( 16 );			// working state
+	   var round;
+
+	   //accumulated_output_info = "";
+
+	   // get the message from the user
+	   // also check if it is ASCII or hex
+	   var msg = get_value(str, bASCII);
+
+	   // problems??
+	   if ( msg[0] < 0 )
+	   {
+		  return;
+	   }
+
+	   // get the key from the user
+	   var key = get_value(key, false);
+	   // problems??
+	   if ( key[0] < 0 )
+	   {
+		  return;
+	   }
+
+	   // expand the key
+	   w = key_expand( key );
+
+	   // initial state = message in columns (transposed from what we input)
+	   state = transpose( msg );
+
+	   // display the round key - Transpose due to the way it is stored/used
+	   state = AddRoundKey(state, w, 0);
+
+	   for( round=1; round<Nr; round++ )
+	   {
+		  state = SubBytes(state, S_enc);
+		  state = ShiftRows(state);
+		  state = MixColumns(state);
+		  // display the round key - Transpose due to the way it is stored/used
+		  // note here the spec uses 32-bit words, we are using bytes, so an extra *4
+		  state = AddRoundKey(state, w, round*4*4);
+	   }
+
+	   SubBytes(state, S_enc);
+	   ShiftRows(state);
+	   AddRoundKey(state, w, Nr*4*4);
+
+	   // process output
+	   AES_output = transpose( state );
+	   var szOutput = format_AES_output(!bASCII);
+	   return szOutput;
+	}
+
+	// do decryption
+	function aes_decrypt(str, key, bASCII)
+	{
+	   //console.log("  aes_decrypt:\tstr = " + str + "\tkey = " + key + "\tbASCII = " + bASCII);
+	   var w = new Array( 4*(Nr+1) );			// subkey information
+	   var state = new Array( 16 );			// working state
+	   var round;
+
+	   //accumulated_output_info = "";
+
+	   // get the message from the user
+	   // also check if it is ASCII or hex
+	   var msg = get_value(str, bASCII);
+
+	   // problems??
+	   if ( msg[0] < 0 )
+	   {
+		  return;
+	   }
+	   
+	   // get the key from the user
+	   var key = get_value(key, false);
+	   // problems??
+	   if ( key[0] < 0 )
+	   {
+		  return;
+	   }
+
+	   // expand the key
+	   w = key_expand( key );
+
+	   // initial state = message
+	   state = transpose( msg );
+	   // display the round key - Transpose due to the way it is stored/used
+	   state = AddRoundKey(state, w, Nr*4*4);
+
+	   for( round=Nr-1; round>=1; round-- )
+	   {
+		  state = InvShiftRows(state);
+		  state = SubBytes(state, S_dec);
+		  // display the round key - Transpose due to the way it is stored/used
+		  // note here the spec uses 32-bit words, we are using bytes, so an extra *4
+		  state = AddRoundKey(state, w, round*4*4);
+		  state = InvMixColumns(state);
+	   }
+
+	   InvShiftRows(state);
+	   SubBytes(state, S_dec);
+	   AddRoundKey(state, w, 0);
+
+	   // process output
+	   AES_output = transpose( state );
+	   var szOutput = format_AES_output(!bASCII);
+	   return szOutput;
+	}
+	window.aes_encrypt = aes_encrypt;
+	window.aes_decrypt = aes_decrypt;
+	window.console = window.console || {
+		log: function() {}
+	};
+}());

+ 106 - 0
public/codebase/encryption/cryptico.min.js

@@ -0,0 +1,106 @@
+var dbits,canary=244837814094590,j_lm=(canary&16777215)==15715070;function BigInteger(a,b,c){a!=null&&("number"==typeof a?this.fromNumber(a,b,c):b==null&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,g){for(;--g>=0;){var h=b*this[a++]+c[d]+e,e=Math.floor(h/67108864);c[d++]=h&67108863}return e}
+function am2(a,b,c,d,e,g){var h=b&32767;for(b>>=15;--g>=0;){var f=this[a]&32767,o=this[a++]>>15,p=b*f+o*h,f=h*f+((p&32767)<<15)+c[d]+(e&1073741823),e=(f>>>30)+(p>>>15)+b*o+(e>>>30);c[d++]=f&1073741823}return e}function am3(a,b,c,d,e,g){var h=b&16383;for(b>>=14;--g>=0;){var f=this[a]&16383,o=this[a++]>>14,p=b*f+o*h,f=h*f+((p&16383)<<14)+c[d]+e,e=(f>>28)+(p>>14)+b*o;c[d++]=f&268435455}return e}
+j_lm&&navigator.appName=="Microsoft Internet Explorer"?(BigInteger.prototype.am=am2,dbits=30):j_lm&&navigator.appName!="Netscape"?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<<dbits)-1;BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP);BigInteger.prototype.F1=BI_FP-dbits;BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=[],rr,vv;
+rr="0".charCodeAt(0);for(vv=0;vv<=9;++vv)BI_RC[rr++]=vv;rr="a".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;rr="A".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return c==null?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t;a.s=this.s}function bnpFromInt(a){this.t=1;this.s=a<0?-1:0;a>0?this[0]=a:a<-1?this[0]=a+DV:this.t=0}
+function nbv(a){var b=nbi();b.fromInt(a);return b}
+function bnpFromString(a,b){var c;if(b==16)c=4;else if(b==8)c=3;else if(b==256)c=8;else if(b==2)c=1;else if(b==32)c=5;else if(b==4)c=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var d=a.length,e=!1,g=0;--d>=0;){var h=c==8?a[d]&255:intAt(a,d);h<0?a.charAt(d)=="-"&&(e=!0):(e=!1,g==0?this[this.t++]=h:g+c>this.DB?(this[this.t-1]|=(h&(1<<this.DB-g)-1)<<g,this[this.t++]=h>>this.DB-g):this[this.t-1]|=h<<g,g+=c,g>=this.DB&&(g-=this.DB))}if(c==8&&(a[0]&128)!=0)this.s=-1,g>0&&(this[this.t-1]|=(1<<
+this.DB-g)-1<<g);this.clamp();e&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t}
+function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);if(a==16)a=4;else if(a==8)a=3;else if(a==2)a=1;else if(a==32)a=5;else if(a==64)a=6;else if(a==4)a=2;else return this.toRadix(a);var b=(1<<a)-1,c,d=!1,e="",g=this.t,h=this.DB-g*this.DB%a;if(g-- >0){if(h<this.DB&&(c=this[g]>>h)>0)d=!0,e=int2char(c);for(;g>=0;)h<a?(c=(this[g]&(1<<h)-1)<<a-h,c|=this[--g]>>(h+=this.DB-a)):(c=this[g]>>(h-=a)&b,h<=0&&(h+=this.DB,--g)),c>0&&(d=!0),d&&(e+=int2char(c))}return d?e:"0"}
+function bnNegate(){var a=nbi();BigInteger.ZERO.subTo(this,a);return a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(b!=0)return b;var c=this.t,b=c-a.t;if(b!=0)return b;for(;--c>=0;)if((b=this[c]-a[c])!=0)return b;return 0}function nbits(a){var b=1,c;if((c=a>>>16)!=0)a=c,b+=16;if((c=a>>8)!=0)a=c,b+=8;if((c=a>>4)!=0)a=c,b+=4;if((c=a>>2)!=0)a=c,b+=2;a>>1!=0&&(b+=1);return b}
+function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a;b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0);b.s=this.s}
+function bnpLShiftTo(a,b){var c=a%this.DB,d=this.DB-c,e=(1<<d)-1,g=Math.floor(a/this.DB),h=this.s<<c&this.DM,f;for(f=this.t-1;f>=0;--f)b[f+g+1]=this[f]>>d|h,h=(this[f]&e)<<c;for(f=g-1;f>=0;--f)b[f]=0;b[g]=h;b.t=this.t+g+1;b.s=this.s;b.clamp()}
+function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<<d)-1;b[0]=this[c]>>d;for(var h=c+1;h<this.t;++h)b[h-c-1]|=(this[h]&g)<<e,b[h-c]=this[h]>>d;d>0&&(b[this.t-c-1]|=(this.s&g)<<e);b.t=this.t-c;b.clamp()}}
+function bnpSubTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=d<0?-1:0;d<-1?b[c++]=this.DV+d:d>0&&(b[c++]=d);b.t=c;b.clamp()}
+function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e<d.t;++e)b[e+c.t]=c.am(0,d[e],b,e,0,c.t);b.s=0;b.clamp();this.s!=a.s&&BigInteger.ZERO.subTo(b,b)}function bnpSquareTo(a){for(var b=this.abs(),c=a.t=2*b.t;--c>=0;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);if((a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV)a[c+b.t]-=b.DV,a[c+b.t+1]=1}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1));a.s=0;a.clamp()}
+function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t<d.t)b!=null&&b.fromInt(0),c!=null&&this.copyTo(c);else{c==null&&(c=nbi());var g=nbi(),h=this.s,a=a.s,f=this.DB-nbits(d[d.t-1]);f>0?(d.lShiftTo(f,g),e.lShiftTo(f,c)):(d.copyTo(g),e.copyTo(c));d=g.t;e=g[d-1];if(e!=0){var o=e*(1<<this.F1)+(d>1?g[d-2]>>this.F2:0),p=this.FV/o,o=(1<<this.F1)/o,q=1<<this.F2,n=c.t,k=n-d,j=b==null?nbi():b;g.dlShiftTo(k,j);c.compareTo(j)>=0&&(c[c.t++]=1,c.subTo(j,c));BigInteger.ONE.dlShiftTo(d,
+j);for(j.subTo(g,g);g.t<d;)g[g.t++]=0;for(;--k>=0;){var l=c[--n]==e?this.DM:Math.floor(c[n]*p+(c[n-1]+q)*o);if((c[n]+=g.am(0,l,c,k,0,d))<l){g.dlShiftTo(k,j);for(c.subTo(j,c);c[n]<--l;)c.subTo(j,c)}}b!=null&&(c.drShiftTo(d,b),h!=a&&BigInteger.ZERO.subTo(b,b));c.t=d;c.clamp();f>0&&c.rShiftTo(f,c);h<0&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(a){var b=nbi();this.abs().divRemTo(a,null,b);this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b);return b}function Classic(a){this.m=a}
+function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;
+function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if((a&1)==0)return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return b>0?this.DV-b:-b}function Montgomery(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}
+function montConvert(a){var b=nbi();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);a.s<0&&b.compareTo(BigInteger.ZERO)>0&&this.m.subTo(b,b);return b}function montRevert(a){var b=nbi();a.copyTo(b);this.reduce(b);return b}
+function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=a[b]&32767,d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Montgomery.prototype.convert=montConvert;
+Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(a,b){if(a>4294967295||a<1)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),g=nbits(a)-1;for(e.copyTo(c);--g>=0;)if(b.sqrTo(c,d),(a&1<<g)>0)b.mulTo(d,e,c);else var h=c,c=d,d=h;return b.revert(c)}
+function bnModPowInt(a,b){var c;c=a<256||b.isEven()?new Classic(b):new Montgomery(b);return this.exp(a,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;
+BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;
+BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function bnClone(){var a=nbi();this.copyTo(a);return a}function bnIntValue(){if(this.s<0)if(this.t==1)return this[0]-this.DV;else{if(this.t==0)return-1}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return this.t==0?this.s:this[0]<<24>>24}function bnShortValue(){return this.t==0?this.s:this[0]<<16>>16}
+function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(a){a==null&&(a=10);if(this.signum()==0||a<2||a>36)return"0";var b=this.chunkSize(a),b=Math.pow(a,b),c=nbv(b),d=nbi(),e=nbi(),g="";for(this.divRemTo(c,d,e);d.signum()>0;)g=(b+e.intValue()).toString(a).substr(1)+g,d.divRemTo(c,d,e);return e.intValue().toString(a)+g}
+function bnpFromRadix(a,b){this.fromInt(0);b==null&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,g=0,h=0,f=0;f<a.length;++f){var o=intAt(a,f);o<0?a.charAt(f)=="-"&&this.signum()==0&&(e=!0):(h=b*h+o,++g>=c&&(this.dMultiply(d),this.dAddOffset(h,0),h=g=0))}g>0&&(this.dMultiply(Math.pow(b,g)),this.dAddOffset(h,0));e&&BigInteger.ZERO.subTo(this,this)}
+function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else{this.fromNumber(a,c);this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this)}else{var c=[],d=a&7;c.length=(a>>3)+1;b.nextBytes(c);d>0?c[0]&=(1<<d)-1:c[0]=0;this.fromString(c,256)}}
+function bnToByteArray(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(a-- >0){if(c<this.DB&&(d=this[a]>>c)!=(this.s&this.DM)>>c)b[e++]=d|this.s<<this.DB-c;for(;a>=0;)if(c<8?(d=(this[a]&(1<<c)-1)<<8-c,d|=this[--a]>>(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,c<=0&&(c+=this.DB,--a)),(d&128)!=0&&(d|=-256),e==0&&(this.s&128)!=(d&128)&&++e,e>0||d!=this.s)b[e++]=d}return b}function bnEquals(a){return this.compareTo(a)==0}function bnMin(a){return this.compareTo(a)<0?this:a}
+function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,g=Math.min(a.t,this.t);for(d=0;d<g;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){e=a.s&this.DM;for(d=g;d<this.t;++d)c[d]=b(this[d],e);c.t=this.t}else{e=this.s&this.DM;for(d=g;d<a.t;++d)c[d]=b(e,a[d]);c.t=a.t}c.s=b(this.s,a.s);c.clamp()}function op_and(a,b){return a&b}function bnAnd(a){var b=nbi();this.bitwiseTo(a,op_and,b);return b}function op_or(a,b){return a|b}
+function bnOr(a){var b=nbi();this.bitwiseTo(a,op_or,b);return b}function op_xor(a,b){return a^b}function bnXor(a){var b=nbi();this.bitwiseTo(a,op_xor,b);return b}function op_andnot(a,b){return a&~b}function bnAndNot(a){var b=nbi();this.bitwiseTo(a,op_andnot,b);return b}function bnNot(){for(var a=nbi(),b=0;b<this.t;++b)a[b]=this.DM&~this[b];a.t=this.t;a.s=~this.s;return a}function bnShiftLeft(a){var b=nbi();a<0?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b}
+function bnShiftRight(a){var b=nbi();a<0?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b}function lbit(a){if(a==0)return-1;var b=0;(a&65535)==0&&(a>>=16,b+=16);(a&255)==0&&(a>>=8,b+=8);(a&15)==0&&(a>>=4,b+=4);(a&3)==0&&(a>>=2,b+=2);(a&1)==0&&++b;return b}function bnGetLowestSetBit(){for(var a=0;a<this.t;++a)if(this[a]!=0)return a*this.DB+lbit(this[a]);return this.s<0?this.t*this.DB:-1}function cbit(a){for(var b=0;a!=0;)a&=a-1,++b;return b}
+function bnBitCount(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c)a+=cbit(this[c]^b);return a}function bnTestBit(a){var b=Math.floor(a/this.DB);return b>=this.t?this.s!=0:(this[b]&1<<a%this.DB)!=0}function bnpChangeBit(a,b){var c=BigInteger.ONE.shiftLeft(a);this.bitwiseTo(c,b,c);return c}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}
+function bnpAddTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=d<0?-1:0;d>0?b[c++]=d:d<-1&&(b[c++]=this.DV+d);b.t=c;b.clamp()}function bnAdd(a){var b=nbi();this.addTo(a,b);return b}function bnSubtract(a){var b=nbi();this.subTo(a,b);return b}
+function bnMultiply(a){var b=nbi();this.multiplyTo(a,b);return b}function bnSquare(){var a=nbi();this.squareTo(a);return a}function bnDivide(a){var b=nbi();this.divRemTo(a,b,null);return b}function bnRemainder(a){var b=nbi();this.divRemTo(a,null,b);return b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();this.divRemTo(a,b,c);return[b,c]}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()}
+function bnpDAddOffset(a,b){if(a!=0){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}NullExp.prototype.convert=nNop;NullExp.prototype.revert=nNop;NullExp.prototype.mulTo=nMulTo;NullExp.prototype.sqrTo=nSqrTo;function bnPow(a){return this.exp(a,new NullExp)}
+function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;d<e;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);d<e;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp();c.drShiftTo(1,c)}
+function Barrett(a){this.r2=nbi();this.q3=nbi();BigInteger.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function barrettConvert(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);else if(a.compareTo(this.m)<0)return a;else{var b=nbi();a.copyTo(b);this.reduce(b);return b}}function barrettRevert(a){return a}
+function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Barrett.prototype.convert=barrettConvert;
+Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo;
+function bnModPow(a,b){var c=a.bitLength(),d,e=nbv(1),g;if(c<=0)return e;else d=c<18?1:c<48?3:c<144?4:c<768?5:6;g=c<8?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var h=[],f=3,o=d-1,p=(1<<d)-1;h[1]=g.convert(this);if(d>1){c=nbi();for(g.sqrTo(h[1],c);f<=p;)h[f]=nbi(),g.mulTo(c,h[f-2],h[f]),f+=2}for(var q=a.t-1,n,k=!0,j=nbi(),c=nbits(a[q])-1;q>=0;){c>=o?n=a[q]>>c-o&p:(n=(a[q]&(1<<c+1)-1)<<o-c,q>0&&(n|=a[q-1]>>this.DB+c-o));for(f=d;(n&1)==0;)n>>=1,--f;if((c-=f)<0)c+=this.DB,--q;if(k)h[n].copyTo(e),
+k=!1;else{for(;f>1;)g.sqrTo(e,j),g.sqrTo(j,e),f-=2;f>0?g.sqrTo(e,j):(f=e,e=j,j=f);g.mulTo(j,h[n],e)}for(;q>=0&&(a[q]&1<<c)==0;)g.sqrTo(e,j),f=e,e=j,j=f,--c<0&&(c=this.DB-1,--q)}return g.revert(e)}
+function bnGCD(a){var b=this.s<0?this.negate():this.clone(),a=a.s<0?a.negate():a.clone();if(b.compareTo(a)<0)var c=b,b=a,a=c;var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(d<0)return b;c<d&&(d=c);d>0&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;b.signum()>0;)(c=b.getLowestSetBit())>0&&b.rShiftTo(c,b),(c=a.getLowestSetBit())>0&&a.rShiftTo(c,a),b.compareTo(a)>=0?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));d>0&&a.lShiftTo(d,a);return a}
+function bnpModInt(a){if(a<=0)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(b==0)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}
+function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||a.signum()==0)return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),g=nbv(0),h=nbv(0),f=nbv(1);c.signum()!=0;){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!e.isEven()||!g.isEven())e.addTo(this,e),g.subTo(a,g);e.rShiftTo(1,e)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1,g)}for(;d.isEven();){d.rShiftTo(1,d);if(b){if(!h.isEven()||!f.isEven())h.addTo(this,h),f.subTo(a,f);h.rShiftTo(1,h)}else f.isEven()||f.subTo(a,f);f.rShiftTo(1,
+f)}c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(h,e),g.subTo(f,g)):(d.subTo(c,d),b&&h.subTo(e,h),f.subTo(g,f))}if(d.compareTo(BigInteger.ONE)!=0)return BigInteger.ZERO;if(f.compareTo(a)>=0)return f.subtract(a);if(f.signum()<0)f.addTo(a,f);else return f;return f.signum()<0?f.add(a):f}
+var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,
+733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=67108864/lowprimes[lowprimes.length-1];
+function bnIsProbablePrime(a){var b,c=this.abs();if(c.t==1&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b<lowprimes.length;++b)if(c[0]==lowprimes[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<lowprimes.length;){for(var d=lowprimes[b],e=b+1;e<lowprimes.length&&d<lplim;)d*=lowprimes[e++];for(d=c.modInt(d);b<e;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}
+function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(c<=0)return!1;var d=b.shiftRight(c),a=a+1>>1;if(a>lowprimes.length)a=lowprimes.length;for(var e=nbi(),g=0;g<a;++g){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var h=e.modPow(d,this);if(h.compareTo(BigInteger.ONE)!=0&&h.compareTo(b)!=0){for(var f=1;f++<c&&h.compareTo(b)!=0;)if(h=h.modPowInt(2,this),h.compareTo(BigInteger.ONE)==0)return!1;if(h.compareTo(b)!=0)return!1}}return!0}
+BigInteger.prototype.chunkSize=bnpChunkSize;BigInteger.prototype.toRadix=bnpToRadix;BigInteger.prototype.fromRadix=bnpFromRadix;BigInteger.prototype.fromNumber=bnpFromNumber;BigInteger.prototype.bitwiseTo=bnpBitwiseTo;BigInteger.prototype.changeBit=bnpChangeBit;BigInteger.prototype.addTo=bnpAddTo;BigInteger.prototype.dMultiply=bnpDMultiply;BigInteger.prototype.dAddOffset=bnpDAddOffset;BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo;BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo;
+BigInteger.prototype.modInt=bnpModInt;BigInteger.prototype.millerRabin=bnpMillerRabin;BigInteger.prototype.clone=bnClone;BigInteger.prototype.intValue=bnIntValue;BigInteger.prototype.byteValue=bnByteValue;BigInteger.prototype.shortValue=bnShortValue;BigInteger.prototype.signum=bnSigNum;BigInteger.prototype.toByteArray=bnToByteArray;BigInteger.prototype.equals=bnEquals;BigInteger.prototype.min=bnMin;BigInteger.prototype.max=bnMax;BigInteger.prototype.and=bnAnd;BigInteger.prototype.or=bnOr;
+BigInteger.prototype.xor=bnXor;BigInteger.prototype.andNot=bnAndNot;BigInteger.prototype.not=bnNot;BigInteger.prototype.shiftLeft=bnShiftLeft;BigInteger.prototype.shiftRight=bnShiftRight;BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit;BigInteger.prototype.bitCount=bnBitCount;BigInteger.prototype.testBit=bnTestBit;BigInteger.prototype.setBit=bnSetBit;BigInteger.prototype.clearBit=bnClearBit;BigInteger.prototype.flipBit=bnFlipBit;BigInteger.prototype.add=bnAdd;BigInteger.prototype.subtract=bnSubtract;
+BigInteger.prototype.multiply=bnMultiply;BigInteger.prototype.divide=bnDivide;BigInteger.prototype.remainder=bnRemainder;BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder;BigInteger.prototype.modPow=bnModPow;BigInteger.prototype.modInverse=bnModInverse;BigInteger.prototype.pow=bnPow;BigInteger.prototype.gcd=bnGCD;BigInteger.prototype.isProbablePrime=bnIsProbablePrime;BigInteger.prototype.square=bnSquare;
+(function(a,b,c,d,e,g,h){function f(a){var b,d,e=this,g=a.length,f=0,h=e.i=e.j=e.m=0;e.S=[];e.c=[];for(g||(a=[g++]);f<c;)e.S[f]=f++;for(f=0;f<c;f++)b=e.S[f],h=h+b+a[f%g]&c-1,d=e.S[h],e.S[f]=d,e.S[h]=b;e.g=function(a){var b=e.S,d=e.i+1&c-1,g=b[d],f=e.j+g&c-1,h=b[f];b[d]=h;b[f]=g;for(var k=b[g+h&c-1];--a;)d=d+1&c-1,g=b[d],f=f+g&c-1,h=b[f],b[d]=h,b[f]=g,k=k*c+b[g+h&c-1];e.i=d;e.j=f;return k};e.g(c)}function o(a,b,c,d,e){c=[];e=typeof a;if(b&&e=="object")for(d in a)if(d.indexOf("S")<5)try{c.push(o(a[d],
+b-1))}catch(g){}return c.length?c:a+(e!="string"?"\x00":"")}function p(a,b,d,e){a+="";for(e=d=0;e<a.length;e++){var g=b,f=e&c-1,h=(d^=b[e&c-1]*19)+a.charCodeAt(e);g[f]=h&c-1}a="";for(e in b)a+=String.fromCharCode(b[e]);return a}b.seedrandom=function(q,n){var k=[],j,q=p(o(n?[q,a]:arguments.length?q:[(new Date).getTime(),a,window],3),k);j=new f(k);p(j.S,a);b.random=function(){for(var a=j.g(d),b=h,f=0;a<e;)a=(a+f)*c,b*=c,f=j.g(1);for(;a>=g;)a/=2,b/=2,f>>>=1;return(a+f)/b};return q};h=b.pow(c,d);e=b.pow(2,
+e);g=e*2;p(b.random(),a)})([],Math,256,6,52);function SeededRandom(){}function SRnextBytes(a){var b;for(b=0;b<a.length;b++)a[b]=Math.floor(Math.random()*256)}SeededRandom.prototype.nextBytes=SRnextBytes;function Arcfour(){this.j=this.i=0;this.S=[]}function ARC4init(a){var b,c,d;for(b=0;b<256;++b)this.S[b]=b;for(b=c=0;b<256;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.j=this.i=0}
+function ARC4next(){var a;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]&255]}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;function prng_newstate(){return new Arcfour}var rng_psize=256,rng_state,rng_pool,rng_pptr;
+function rng_seed_int(a){rng_pool[rng_pptr++]^=a&255;rng_pool[rng_pptr++]^=a>>8&255;rng_pool[rng_pptr++]^=a>>16&255;rng_pool[rng_pptr++]^=a>>24&255;rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}
+if(rng_pool==null){rng_pool=[];rng_pptr=0;var t;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=z.charCodeAt(t)&255}for(;rng_pptr<rng_psize;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=t&255;rng_pptr=0;rng_seed_time()}
+function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(a){var b;for(b=0;b<a.length;++b)a[b]=rng_get_byte()}function SecureRandom(){}SecureRandom.prototype.nextBytes=rng_get_bytes;
+function SHA256(a){function b(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535}function c(a,b){return a>>>b|a<<32-b}a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var h=a.charCodeAt(c);h<128?b+=String.fromCharCode(h):(h>127&&h<2048?b+=String.fromCharCode(h>>6|192):(b+=String.fromCharCode(h>>12|224),b+=String.fromCharCode(h>>6&63|128)),b+=String.fromCharCode(h&63|128))}return b}(a);return function(a){for(var b="",c=0;c<a.length*4;c++)b+="0123456789abcdef".charAt(a[c>>
+2]>>(3-c%4)*8+4&15)+"0123456789abcdef".charAt(a[c>>2]>>(3-c%4)*8&15);return b}(function(a,e){var g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,
+2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],f=Array(64),o,p,q,n,k,j,l,m,s,r,u,w;a[e>>5]|=128<<24-e%32;a[(e+64>>9<<4)+15]=e;for(s=0;s<a.length;s+=16){o=h[0];p=h[1];q=h[2];n=h[3];
+k=h[4];j=h[5];l=h[6];m=h[7];for(r=0;r<64;r++)f[r]=r<16?a[r+s]:b(b(b(c(f[r-2],17)^c(f[r-2],19)^f[r-2]>>>10,f[r-7]),c(f[r-15],7)^c(f[r-15],18)^f[r-15]>>>3),f[r-16]),u=b(b(b(b(m,c(k,6)^c(k,11)^c(k,25)),k&j^~k&l),g[r]),f[r]),w=b(c(o,2)^c(o,13)^c(o,22),o&p^o&q^p&q),m=l,l=j,j=k,k=b(n,u),n=q,q=p,p=o,o=b(u,w);h[0]=b(o,h[0]);h[1]=b(p,h[1]);h[2]=b(q,h[2]);h[3]=b(n,h[3]);h[4]=b(k,h[4]);h[5]=b(j,h[5]);h[6]=b(l,h[6]);h[7]=b(m,h[7])}return h}(function(a){for(var b=[],c=0;c<a.length*8;c+=8)b[c>>5]|=(a.charCodeAt(c/
+8)&255)<<24-c%32;return b}(a),a.length*8))}var sha256={hex:function(a){return SHA256(a)}};
+function SHA1(a){function b(a,b){return a<<b|a>>>32-b}function c(a){var b="",c,d;for(c=7;c>=0;c--)d=a>>>c*4&15,b+=d.toString(16);return b}var d,e,g=Array(80),h=1732584193,f=4023233417,o=2562383102,p=271733878,q=3285377520,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b+=String.fromCharCode(d):(d>127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&
+63|128))}return b}(a);n=a.length;var s=[];for(d=0;d<n-3;d+=4)e=a.charCodeAt(d)<<24|a.charCodeAt(d+1)<<16|a.charCodeAt(d+2)<<8|a.charCodeAt(d+3),s.push(e);switch(n%4){case 0:d=2147483648;break;case 1:d=a.charCodeAt(n-1)<<24|8388608;break;case 2:d=a.charCodeAt(n-2)<<24|a.charCodeAt(n-1)<<16|32768;break;case 3:d=a.charCodeAt(n-3)<<24|a.charCodeAt(n-2)<<16|a.charCodeAt(n-1)<<8|128}for(s.push(d);s.length%16!=14;)s.push(0);s.push(n>>>29);s.push(n<<3&4294967295);for(a=0;a<s.length;a+=16){for(d=0;d<16;d++)g[d]=
+s[a+d];for(d=16;d<=79;d++)g[d]=b(g[d-3]^g[d-8]^g[d-14]^g[d-16],1);e=h;n=f;k=o;j=p;l=q;for(d=0;d<=19;d++)m=b(e,5)+(n&k|~n&j)+l+g[d]+1518500249&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=20;d<=39;d++)m=b(e,5)+(n^k^j)+l+g[d]+1859775393&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=40;d<=59;d++)m=b(e,5)+(n&k|n&j|k&j)+l+g[d]+2400959708&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;for(d=60;d<=79;d++)m=b(e,5)+(n^k^j)+l+g[d]+3395469782&4294967295,l=j,j=k,k=b(n,30),n=e,e=m;h=h+e&4294967295;f=f+n&4294967295;o=o+k&4294967295;
+p=p+j&4294967295;q=q+l&4294967295}m=c(h)+c(f)+c(o)+c(p)+c(q);return m.toLowerCase()}
+var sha1={hex:function(a){return SHA1(a)}},MD5=function(a){function b(a,b){var c,d,e,f,g;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;g=(a&1073741823)+(b&1073741823);return c&d?g^2147483648^e^f:c|d?g&1073741824?g^3221225472^e^f:g^1073741824^e^f:g^e^f}function c(a,c,d,e,f,g,h){a=b(a,b(b(c&d|~c&e,f),h));return b(a<<g|a>>>32-g,c)}function d(a,c,d,e,f,g,h){a=b(a,b(b(c&e|d&~e,f),h));return b(a<<g|a>>>32-g,c)}function e(a,c,d,e,f,g,h){a=b(a,b(b(c^d^e,f),h));return b(a<<g|a>>>32-g,c)}function g(a,
+c,d,e,f,g,h){a=b(a,b(b(d^(c|~e),f),h));return b(a<<g|a>>>32-g,c)}function h(a){var b="",c="",d;for(d=0;d<=3;d++)c=a>>>d*8&255,c="0"+c.toString(16),b+=c.substr(c.length-2,2);return b}var f=[],o,p,q,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b+=String.fromCharCode(d):(d>127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b}(a),
+f=function(a){var b,c=a.length;b=c+8;for(var d=((b-b%64)/64+1)*16,e=Array(d-1),f=0,g=0;g<c;)b=(g-g%4)/4,f=g%4*8,e[b]|=a.charCodeAt(g)<<f,g++;e[(g-g%4)/4]|=128<<g%4*8;e[d-2]=c<<3;e[d-1]=c>>>29;return e}(a);k=1732584193;j=4023233417;l=2562383102;m=271733878;for(a=0;a<f.length;a+=16)o=k,p=j,q=l,n=m,k=c(k,j,l,m,f[a+0],7,3614090360),m=c(m,k,j,l,f[a+1],12,3905402710),l=c(l,m,k,j,f[a+2],17,606105819),j=c(j,l,m,k,f[a+3],22,3250441966),k=c(k,j,l,m,f[a+4],7,4118548399),m=c(m,k,j,l,f[a+5],12,1200080426),l=c(l,
+m,k,j,f[a+6],17,2821735955),j=c(j,l,m,k,f[a+7],22,4249261313),k=c(k,j,l,m,f[a+8],7,1770035416),m=c(m,k,j,l,f[a+9],12,2336552879),l=c(l,m,k,j,f[a+10],17,4294925233),j=c(j,l,m,k,f[a+11],22,2304563134),k=c(k,j,l,m,f[a+12],7,1804603682),m=c(m,k,j,l,f[a+13],12,4254626195),l=c(l,m,k,j,f[a+14],17,2792965006),j=c(j,l,m,k,f[a+15],22,1236535329),k=d(k,j,l,m,f[a+1],5,4129170786),m=d(m,k,j,l,f[a+6],9,3225465664),l=d(l,m,k,j,f[a+11],14,643717713),j=d(j,l,m,k,f[a+0],20,3921069994),k=d(k,j,l,m,f[a+5],5,3593408605),
+m=d(m,k,j,l,f[a+10],9,38016083),l=d(l,m,k,j,f[a+15],14,3634488961),j=d(j,l,m,k,f[a+4],20,3889429448),k=d(k,j,l,m,f[a+9],5,568446438),m=d(m,k,j,l,f[a+14],9,3275163606),l=d(l,m,k,j,f[a+3],14,4107603335),j=d(j,l,m,k,f[a+8],20,1163531501),k=d(k,j,l,m,f[a+13],5,2850285829),m=d(m,k,j,l,f[a+2],9,4243563512),l=d(l,m,k,j,f[a+7],14,1735328473),j=d(j,l,m,k,f[a+12],20,2368359562),k=e(k,j,l,m,f[a+5],4,4294588738),m=e(m,k,j,l,f[a+8],11,2272392833),l=e(l,m,k,j,f[a+11],16,1839030562),j=e(j,l,m,k,f[a+14],23,4259657740),
+k=e(k,j,l,m,f[a+1],4,2763975236),m=e(m,k,j,l,f[a+4],11,1272893353),l=e(l,m,k,j,f[a+7],16,4139469664),j=e(j,l,m,k,f[a+10],23,3200236656),k=e(k,j,l,m,f[a+13],4,681279174),m=e(m,k,j,l,f[a+0],11,3936430074),l=e(l,m,k,j,f[a+3],16,3572445317),j=e(j,l,m,k,f[a+6],23,76029189),k=e(k,j,l,m,f[a+9],4,3654602809),m=e(m,k,j,l,f[a+12],11,3873151461),l=e(l,m,k,j,f[a+15],16,530742520),j=e(j,l,m,k,f[a+2],23,3299628645),k=g(k,j,l,m,f[a+0],6,4096336452),m=g(m,k,j,l,f[a+7],10,1126891415),l=g(l,m,k,j,f[a+14],15,2878612391),
+j=g(j,l,m,k,f[a+5],21,4237533241),k=g(k,j,l,m,f[a+12],6,1700485571),m=g(m,k,j,l,f[a+3],10,2399980690),l=g(l,m,k,j,f[a+10],15,4293915773),j=g(j,l,m,k,f[a+1],21,2240044497),k=g(k,j,l,m,f[a+8],6,1873313359),m=g(m,k,j,l,f[a+15],10,4264355552),l=g(l,m,k,j,f[a+6],15,2734768916),j=g(j,l,m,k,f[a+13],21,1309151649),k=g(k,j,l,m,f[a+4],6,4149444226),m=g(m,k,j,l,f[a+11],10,3174756917),l=g(l,m,k,j,f[a+2],15,718787259),j=g(j,l,m,k,f[a+9],21,3951481745),k=b(k,o),j=b(j,p),l=b(l,q),m=b(m,n);return(h(k)+h(j)+h(l)+
+h(m)).toLowerCase()};function parseBigInt(a,b){return new BigInteger(a,b)}function linebrk(a,b){for(var c="",d=0;d+b<a.length;)c+=a.substring(d,d+b)+"\n",d+=b;return c+a.substring(d,a.length)}function byte2Hex(a){return a<16?"0"+a.toString(16):a.toString(16)}
+function pkcs1pad2(a,b){if(b<a.length+11)throw"Message too long for RSA (n="+b+", l="+a.length+")";for(var c=[],d=a.length-1;d>=0&&b>0;){var e=a.charCodeAt(d--);e<128?c[--b]=e:e>127&&e<2048?(c[--b]=e&63|128,c[--b]=e>>6|192):(c[--b]=e&63|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;d=new SecureRandom;for(e=[];b>2;){for(e[0]=0;e[0]==0;)d.nextBytes(e);c[--b]=e[0]}c[--b]=2;c[--b]=0;return new BigInteger(c)}
+function RSAKey(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}function RSASetPublic(a,b){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):alert("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){a=pkcs1pad2(a,this.n.bitLength()+7>>3);if(a==null)return null;a=this.doPublic(a);if(a==null)return null;a=a.toString(16);return(a.length&1)==0?a:"0"+a}
+RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d<c.length&&c[d]==0;)++d;if(c.length-d!=b-1||c[d]!=2)return null;for(++d;c[d]!=0;)if(++d>=c.length)return null;for(var e="";++d<c.length;){var g=c[d]&255;g<128?e+=String.fromCharCode(g):g>191&&g<224?(e+=String.fromCharCode((g&31)<<6|c[d+1]&63),++d):(e+=String.fromCharCode((g&15)<<12|(c[d+1]&63)<<6|c[d+2]&63),d+=2)}return e}
+function RSASetPrivate(a,b,c){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):alert("Invalid RSA private key")}
+function RSASetPrivateEx(a,b,c,d,e,g,h,f){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(g,16),this.dmq1=parseBigInt(h,16),this.coeff=parseBigInt(f,16)):alert("Invalid RSA private key")}
+function RSAGenerate(a,b){var c=new SeededRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;;)if(this.p=new BigInteger(a-d,1,c),this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10))break;for(;;)if(this.q=new BigInteger(d,1,c),this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10))break;if(this.p.compareTo(this.q)<=0){var g=this.p;this.p=this.q;this.q=g}var g=this.p.subtract(BigInteger.ONE),
+h=this.q.subtract(BigInteger.ONE),f=g.multiply(h);if(f.gcd(e).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);this.d=e.modInverse(f);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(h);this.coeff=this.q.modInverse(this.p);break}}}
+function RSADoPrivate(a){if(this.p==null||this.q==null)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),a=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(a)<0;)b=b.add(this.p);return b.subtract(a).multiply(this.coeff).mod(this.p).multiply(this.q).add(a)}function RSADecrypt(a){a=this.doPrivate(parseBigInt(a,16));return a==null?null:pkcs1unpad2(a,this.n.bitLength()+7>>3)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate;
+RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;var _RSASIGN_DIHEAD=[];_RSASIGN_DIHEAD.sha1="3021300906052b0e03021a05000414";_RSASIGN_DIHEAD.sha256="3031300d060960864801650304020105000420";var _RSASIGN_HASHHEXFUNC=[];_RSASIGN_HASHHEXFUNC.sha1=sha1.hex;_RSASIGN_HASHHEXFUNC.sha256=sha256.hex;
+function _rsasign_getHexPaddedDigestInfoForString(a,b,c){b/=4;for(var a=(0,_RSASIGN_HASHHEXFUNC[c])(a),c="00"+_RSASIGN_DIHEAD[c]+a,a="",b=b-4-c.length,d=0;d<b;d+=2)a+="ff";return sPaddedMessageHex="0001"+a+c}function _rsasign_signString(a,b){var c=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),b);return this.doPrivate(parseBigInt(c,16)).toString(16)}
+function _rsasign_signStringWithSHA1(a){a=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),"sha1");return this.doPrivate(parseBigInt(a,16)).toString(16)}function _rsasign_signStringWithSHA256(a){a=_rsasign_getHexPaddedDigestInfoForString(a,this.n.bitLength(),"sha256");return this.doPrivate(parseBigInt(a,16)).toString(16)}function _rsasign_getDecryptSignatureBI(a,b,c){var d=new RSAKey;d.setPublic(b,c);return d.doPublic(a)}
+function _rsasign_getHexDigestInfoFromSig(a,b,c){return _rsasign_getDecryptSignatureBI(a,b,c).toString(16).replace(/^1f+00/,"")}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(a){for(var b in _RSASIGN_DIHEAD){var c=_RSASIGN_DIHEAD[b],d=c.length;if(a.substring(0,d)==c)return[b,a.substring(d)]}return[]}
+function _rsasign_verifySignatureWithArgs(a,b,c,d){b=_rsasign_getHexDigestInfoFromSig(b,c,d);c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(b);if(c.length==0)return!1;b=c[1];a=(0,_RSASIGN_HASHHEXFUNC[c[0]])(a);return b==a}function _rsasign_verifyHexSignatureForMessage(a,b){var c=parseBigInt(a,16);return _rsasign_verifySignatureWithArgs(b,c,this.n.toString(16),this.e.toString(16))}
+function _rsasign_verifyString(a,b){var b=b.replace(/[ \n]+/g,""),c=this.doPublic(parseBigInt(b,16)).toString(16).replace(/^1f+00/,""),d=_rsasign_getAlgNameAndHashFromHexDisgestInfo(c);if(d.length==0)return!1;c=d[1];d=(0,_RSASIGN_HASHHEXFUNC[d[0]])(a);return c==d}RSAKey.prototype.signString=_rsasign_signString;RSAKey.prototype.signStringWithSHA1=_rsasign_signStringWithSHA1;RSAKey.prototype.signStringWithSHA256=_rsasign_signStringWithSHA256;RSAKey.prototype.verifyString=_rsasign_verifyString;
+RSAKey.prototype.verifyHexSignatureForMessage=_rsasign_verifyHexSignatureForMessage;
+var aes=function(){var a={Sbox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,
+95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ShiftRowTab:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11]};a.Init=
+function(){a.Sbox_Inv=Array(256);for(var b=0;b<256;b++)a.Sbox_Inv[a.Sbox[b]]=b;a.ShiftRowTab_Inv=Array(16);for(b=0;b<16;b++)a.ShiftRowTab_Inv[a.ShiftRowTab[b]]=b;a.xtime=Array(256);for(b=0;b<128;b++)a.xtime[b]=b<<1,a.xtime[128+b]=b<<1^27};a.Done=function(){delete a.Sbox_Inv;delete a.ShiftRowTab_Inv;delete a.xtime};a.ExpandKey=function(b){var c=b.length,d,e=1;switch(c){case 16:d=176;break;case 24:d=208;break;case 32:d=240;break;default:alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!")}for(var g=
+c;g<d;g+=4){var h=b.slice(g-4,g);if(g%c==0){if(h=[a.Sbox[h[1]]^e,a.Sbox[h[2]],a.Sbox[h[3]],a.Sbox[h[0]]],(e<<=1)>=256)e^=283}else c>24&&g%c==16&&(h=[a.Sbox[h[0]],a.Sbox[h[1]],a.Sbox[h[2]],a.Sbox[h[3]]]);for(var f=0;f<4;f++)b[g+f]=b[g+f-c]^h[f]}};a.Encrypt=function(b,c){var d=c.length;a.AddRoundKey(b,c.slice(0,16));for(var e=16;e<d-16;e+=16)a.SubBytes(b,a.Sbox),a.ShiftRows(b,a.ShiftRowTab),a.MixColumns(b),a.AddRoundKey(b,c.slice(e,e+16));a.SubBytes(b,a.Sbox);a.ShiftRows(b,a.ShiftRowTab);a.AddRoundKey(b,
+c.slice(e,d))};a.Decrypt=function(b,c){var d=c.length;a.AddRoundKey(b,c.slice(d-16,d));a.ShiftRows(b,a.ShiftRowTab_Inv);a.SubBytes(b,a.Sbox_Inv);for(d-=32;d>=16;d-=16)a.AddRoundKey(b,c.slice(d,d+16)),a.MixColumns_Inv(b),a.ShiftRows(b,a.ShiftRowTab_Inv),a.SubBytes(b,a.Sbox_Inv);a.AddRoundKey(b,c.slice(0,16))};a.SubBytes=function(a,c){for(var d=0;d<16;d++)a[d]=c[a[d]]};a.AddRoundKey=function(a,c){for(var d=0;d<16;d++)a[d]^=c[d]};a.ShiftRows=function(a,c){for(var d=[].concat(a),e=0;e<16;e++)a[e]=d[c[e]]};
+a.MixColumns=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h;b[c+0]^=f^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=f^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};a.MixColumns_Inv=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h,o=a.xtime[f],p=a.xtime[a.xtime[o^d^g]]^f;f^=a.xtime[a.xtime[o^e^h]];b[c+0]^=p^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=p^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};return a}(),cryptico=function(){var a={};aes.Init();
+a.b256to64=function(a){var c,d,e,g="",h=0,f=0,o=a.length;for(e=0;e<o;e++)d=a.charCodeAt(e),f==0?(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2&63),c=(d&3)<<4):f==1?(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>4&15),c=(d&15)<<2):f==2&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>6&3),h+=1,g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63)),h+=1,f+=1,f==3&&
+(f=0);f>0&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c),g+="=");f==1&&(g+="=");return g};a.b64to256=function(a){var c,d,e="",g=0,h=0,f=a.length;for(d=0;d<f;d++)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(d)),c>=0&&(g&&(e+=String.fromCharCode(h|c>>6-g&255)),g=g+2&7,h=c<<g&255);return e};a.b16to64=function(a){var c,d,e="";a.length%2==1&&(a="0"+a);for(c=0;c+3<=a.length;c+=3)d=parseInt(a.substring(c,c+3),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>
+6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63);c+1==a.length?(d=parseInt(a.substring(c,c+1),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d<<2)):c+2==a.length&&(d=parseInt(a.substring(c,c+2),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4));for(;(e.length&3)>0;)e+="=";return e};a.b64to16=function(a){var c="",
+d,e=0,g;for(d=0;d<a.length;++d){if(a.charAt(d)=="=")break;v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(d));v<0||(e==0?(c+=int2char(v>>2),g=v&3,e=1):e==1?(c+=int2char(g<<2|v>>4),g=v&15,e=2):e==2?(c+=int2char(g),c+=int2char(v>>2),g=v&3,e=3):(c+=int2char(g<<2|v>>4),c+=int2char(v&15),e=0))}e==1&&(c+=int2char(g<<2));return c};a.string2bytes=function(a){for(var c=[],d=0;d<a.length;d++)c.push(a.charCodeAt(d));return c};a.bytes2string=function(a){for(var c="",d=0;d<
+a.length;d++)c+=String.fromCharCode(a[d]);return c};a.blockXOR=function(a,c){for(var d=Array(16),e=0;e<16;e++)d[e]=a[e]^c[e];return d};a.blockIV=function(){var a=new SecureRandom,c=Array(16);a.nextBytes(c);return c};a.pad16=function(a){var c=a.slice(0),d=(16-a.length%16)%16;for(i=a.length;i<a.length+d;i++)c.push(0);return c};a.depad=function(a){for(a=a.slice(0);a[a.length-1]==0;)a=a.slice(0,a.length-1);return a};a.encryptAESCBC=function(b,c){var d=c.slice(0);aes.ExpandKey(d);for(var e=a.string2bytes(b),
+e=a.pad16(e),g=a.blockIV(),h=0;h<e.length/16;h++){var f=e.slice(h*16,h*16+16),o=g.slice(h*16,h*16+16),f=a.blockXOR(o,f);aes.Encrypt(f,d);g=g.concat(f)}d=a.bytes2string(g);return a.b256to64(d)};a.decryptAESCBC=function(b,c){var d=c.slice(0);aes.ExpandKey(d);for(var b=a.b64to256(b),e=a.string2bytes(b),g=[],h=1;h<e.length/16;h++){var f=e.slice(h*16,h*16+16),o=e.slice((h-1)*16,(h-1)*16+16);aes.Decrypt(f,d);f=a.blockXOR(o,f);g=g.concat(f)}g=a.depad(g);return a.bytes2string(g)};a.wrap60=function(a){for(var c=
+"",d=0;d<a.length;d++)d%60==0&&d!=0&&(c+="\n"),c+=a[d];return c};a.generateAESKey=function(){var a=Array(16);(new SecureRandom).nextBytes(a);return a};a.generateRSAKey=function(a,c){Math.seedrandom(sha256.hex(a));var d=new RSAKey;d.generate(c,"10001");return d};a.publicKeyString=function(b){return pubkey=b.n.toString(16)};a.publicKeyID=function(a){return MD5(a)};a.publicKeyFromString=function(b){var b=b.split("|")[0],c=new RSAKey;c.setPublic(b,"10001");return c};a.encrypt=function(b,
+c,d){var e="";try{var h=a.publicKeyFromString(c);e+=h.encrypt(b)+"?"}catch(f){return{status:"Invalid public key"}};return{status:"success",cipher:e}};a.decrypt=function(b,c){var d=b.split("?"),e=c.decrypt(d[0]);return{status:"success",plaintext:e,signature:"unsigned"}};return a}();

+ 35 - 0
public/codebase/encryption/crypto-3.1.2.min.js

@@ -0,0 +1,35 @@
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+var CryptoJS=CryptoJS||function(u,p){var d={},l=d.lib={},s=function(){},t=l.Base={extend:function(a){s.prototype=this;var c=new s;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
+r=l.WordArray=t.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=p?c:4*a.length},toString:function(a){return(a||v).stringify(this)},concat:function(a){var c=this.words,e=a.words,j=this.sigBytes;a=a.sigBytes;this.clamp();if(j%4)for(var k=0;k<a;k++)c[j+k>>>2]|=(e[k>>>2]>>>24-8*(k%4)&255)<<24-8*((j+k)%4);else if(65535<e.length)for(k=0;k<a;k+=4)c[j+k>>>2]=e[k>>>2];else c.push.apply(c,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
+32-8*(c%4);a.length=u.ceil(c/4)},clone:function(){var a=t.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],e=0;e<a;e+=4)c.push(4294967296*u.random()|0);return new r.init(c,a)}}),w=d.enc={},v=w.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++){var k=c[j>>>2]>>>24-8*(j%4)&255;e.push((k>>>4).toString(16));e.push((k&15).toString(16))}return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j+=2)e[j>>>3]|=parseInt(a.substr(j,
+2),16)<<24-4*(j%8);return new r.init(e,c/2)}},b=w.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++)e.push(String.fromCharCode(c[j>>>2]>>>24-8*(j%4)&255));return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j++)e[j>>>2]|=(a.charCodeAt(j)&255)<<24-8*(j%4);return new r.init(e,c)}},x=w.Utf8={stringify:function(a){try{return decodeURIComponent(escape(b.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return b.parse(unescape(encodeURIComponent(a)))}},
+q=l.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=x.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,e=c.words,j=c.sigBytes,k=this.blockSize,b=j/(4*k),b=a?u.ceil(b):u.max((b|0)-this._minBufferSize,0);a=b*k;j=u.min(4*a,j);if(a){for(var q=0;q<a;q+=k)this._doProcessBlock(e,q);q=e.splice(0,a);c.sigBytes-=j}return new r.init(q,j)},clone:function(){var a=t.clone.call(this);
+a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:t.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,e){return(new a.init(e)).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return(new n.HMAC.init(a,
+e)).finalize(b)}}});var n=d.algo={};return d}(Math);
+(function(){var u=CryptoJS,p=u.lib.WordArray;u.enc.Base64={stringify:function(d){var l=d.words,p=d.sigBytes,t=this._map;d.clamp();d=[];for(var r=0;r<p;r+=3)for(var w=(l[r>>>2]>>>24-8*(r%4)&255)<<16|(l[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|l[r+2>>>2]>>>24-8*((r+2)%4)&255,v=0;4>v&&r+0.75*v<p;v++)d.push(t.charAt(w>>>6*(3-v)&63));if(l=t.charAt(64))for(;d.length%4;)d.push(l);return d.join("")},parse:function(d){var l=d.length,s=this._map,t=s.charAt(64);t&&(t=d.indexOf(t),-1!=t&&(l=t));for(var t=[],r=0,w=0;w<
+l;w++)if(w%4){var v=s.indexOf(d.charAt(w-1))<<2*(w%4),b=s.indexOf(d.charAt(w))>>>6-2*(w%4);t[r>>>2]|=(v|b)<<24-8*(r%4);r++}return p.create(t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
+(function(u){function p(b,n,a,c,e,j,k){b=b+(n&a|~n&c)+e+k;return(b<<j|b>>>32-j)+n}function d(b,n,a,c,e,j,k){b=b+(n&c|a&~c)+e+k;return(b<<j|b>>>32-j)+n}function l(b,n,a,c,e,j,k){b=b+(n^a^c)+e+k;return(b<<j|b>>>32-j)+n}function s(b,n,a,c,e,j,k){b=b+(a^(n|~c))+e+k;return(b<<j|b>>>32-j)+n}for(var t=CryptoJS,r=t.lib,w=r.WordArray,v=r.Hasher,r=t.algo,b=[],x=0;64>x;x++)b[x]=4294967296*u.abs(u.sin(x+1))|0;r=r.MD5=v.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878])},
+_doProcessBlock:function(q,n){for(var a=0;16>a;a++){var c=n+a,e=q[c];q[c]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var a=this._hash.words,c=q[n+0],e=q[n+1],j=q[n+2],k=q[n+3],z=q[n+4],r=q[n+5],t=q[n+6],w=q[n+7],v=q[n+8],A=q[n+9],B=q[n+10],C=q[n+11],u=q[n+12],D=q[n+13],E=q[n+14],x=q[n+15],f=a[0],m=a[1],g=a[2],h=a[3],f=p(f,m,g,h,c,7,b[0]),h=p(h,f,m,g,e,12,b[1]),g=p(g,h,f,m,j,17,b[2]),m=p(m,g,h,f,k,22,b[3]),f=p(f,m,g,h,z,7,b[4]),h=p(h,f,m,g,r,12,b[5]),g=p(g,h,f,m,t,17,b[6]),m=p(m,g,h,f,w,22,b[7]),
+f=p(f,m,g,h,v,7,b[8]),h=p(h,f,m,g,A,12,b[9]),g=p(g,h,f,m,B,17,b[10]),m=p(m,g,h,f,C,22,b[11]),f=p(f,m,g,h,u,7,b[12]),h=p(h,f,m,g,D,12,b[13]),g=p(g,h,f,m,E,17,b[14]),m=p(m,g,h,f,x,22,b[15]),f=d(f,m,g,h,e,5,b[16]),h=d(h,f,m,g,t,9,b[17]),g=d(g,h,f,m,C,14,b[18]),m=d(m,g,h,f,c,20,b[19]),f=d(f,m,g,h,r,5,b[20]),h=d(h,f,m,g,B,9,b[21]),g=d(g,h,f,m,x,14,b[22]),m=d(m,g,h,f,z,20,b[23]),f=d(f,m,g,h,A,5,b[24]),h=d(h,f,m,g,E,9,b[25]),g=d(g,h,f,m,k,14,b[26]),m=d(m,g,h,f,v,20,b[27]),f=d(f,m,g,h,D,5,b[28]),h=d(h,f,
+m,g,j,9,b[29]),g=d(g,h,f,m,w,14,b[30]),m=d(m,g,h,f,u,20,b[31]),f=l(f,m,g,h,r,4,b[32]),h=l(h,f,m,g,v,11,b[33]),g=l(g,h,f,m,C,16,b[34]),m=l(m,g,h,f,E,23,b[35]),f=l(f,m,g,h,e,4,b[36]),h=l(h,f,m,g,z,11,b[37]),g=l(g,h,f,m,w,16,b[38]),m=l(m,g,h,f,B,23,b[39]),f=l(f,m,g,h,D,4,b[40]),h=l(h,f,m,g,c,11,b[41]),g=l(g,h,f,m,k,16,b[42]),m=l(m,g,h,f,t,23,b[43]),f=l(f,m,g,h,A,4,b[44]),h=l(h,f,m,g,u,11,b[45]),g=l(g,h,f,m,x,16,b[46]),m=l(m,g,h,f,j,23,b[47]),f=s(f,m,g,h,c,6,b[48]),h=s(h,f,m,g,w,10,b[49]),g=s(g,h,f,m,
+E,15,b[50]),m=s(m,g,h,f,r,21,b[51]),f=s(f,m,g,h,u,6,b[52]),h=s(h,f,m,g,k,10,b[53]),g=s(g,h,f,m,B,15,b[54]),m=s(m,g,h,f,e,21,b[55]),f=s(f,m,g,h,v,6,b[56]),h=s(h,f,m,g,x,10,b[57]),g=s(g,h,f,m,t,15,b[58]),m=s(m,g,h,f,D,21,b[59]),f=s(f,m,g,h,z,6,b[60]),h=s(h,f,m,g,C,10,b[61]),g=s(g,h,f,m,j,15,b[62]),m=s(m,g,h,f,A,21,b[63]);a[0]=a[0]+f|0;a[1]=a[1]+m|0;a[2]=a[2]+g|0;a[3]=a[3]+h|0},_doFinalize:function(){var b=this._data,n=b.words,a=8*this._nDataBytes,c=8*b.sigBytes;n[c>>>5]|=128<<24-c%32;var e=u.floor(a/
+4294967296);n[(c+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;n[(c+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(n.length+1);this._process();b=this._hash;n=b.words;for(a=0;4>a;a++)c=n[a],n[a]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return b},clone:function(){var b=v.clone.call(this);b._hash=this._hash.clone();return b}});t.MD5=v._createHelper(r);t.HmacMD5=v._createHmacHelper(r)})(Math);
+(function(){var u=CryptoJS,p=u.lib,d=p.Base,l=p.WordArray,p=u.algo,s=p.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:p.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,r){for(var p=this.cfg,s=p.hasher.create(),b=l.create(),u=b.words,q=p.keySize,p=p.iterations;u.length<q;){n&&s.update(n);var n=s.update(d).finalize(r);s.reset();for(var a=1;a<p;a++)n=s.finalize(n),s.reset();b.concat(n)}b.sigBytes=4*q;return b}});u.EvpKDF=function(d,l,p){return s.create(p).compute(d,
+l)}})();
+CryptoJS.lib.Cipher||function(u){var p=CryptoJS,d=p.lib,l=d.Base,s=d.WordArray,t=d.BufferedBlockAlgorithm,r=p.enc.Base64,w=p.algo.EvpKDF,v=d.Cipher=t.extend({cfg:l.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,b){this.cfg=this.cfg.extend(b);this._xformMode=e;this._key=a;this.reset()},reset:function(){t.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()},
+finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(b,k,d){return("string"==typeof k?c:a).encrypt(e,b,k,d)},decrypt:function(b,k,d){return("string"==typeof k?c:a).decrypt(e,b,k,d)}}}});d.StreamCipher=v.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var b=p.mode={},x=function(e,a,b){var c=this._iv;c?this._iv=u:c=this._prevBlock;for(var d=0;d<b;d++)e[a+d]^=
+c[d]},q=(d.BlockCipherMode=l.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e;this._iv=a}})).extend();q.Encryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize;x.call(this,e,a,c);b.encryptBlock(e,a);this._prevBlock=e.slice(a,a+c)}});q.Decryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize,d=e.slice(a,a+c);b.decryptBlock(e,a);x.call(this,
+e,a,c);this._prevBlock=d}});b=b.CBC=q;q=(p.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,l=[],n=0;n<c;n+=4)l.push(d);c=s.create(l,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};d.BlockCipher=v.extend({cfg:v.cfg.extend({mode:b,padding:q}),reset:function(){v.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,
+this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=d.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),b=(p.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?s.create([1398893684,
+1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=s.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},a=d.SerializableCipher=l.extend({cfg:l.extend({format:b}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var l=a.createEncryptor(c,d);b=l.finalize(b);l=l.cfg;return n.create({ciphertext:b,key:c,iv:l.iv,algorithm:a,mode:l.mode,padding:l.padding,blockSize:a.blockSize,formatter:d.format})},
+decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),p=(p.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=s.random(8));a=w.create({keySize:b+c}).compute(a,d);c=s.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},c=d.PasswordBasedCipher=a.extend({cfg:a.cfg.extend({kdf:p}),encrypt:function(b,c,d,l){l=this.cfg.extend(l);d=l.kdf.execute(d,
+b.keySize,b.ivSize);l.iv=d.iv;b=a.encrypt.call(this,b,c,d.key,l);b.mixIn(d);return b},decrypt:function(b,c,d,l){l=this.cfg.extend(l);c=this._parse(c,l.format);d=l.kdf.execute(d,b.keySize,b.ivSize,c.salt);l.iv=d.iv;return a.decrypt.call(this,b,c,d.key,l)}})}();
+(function(){for(var u=CryptoJS,p=u.lib.BlockCipher,d=u.algo,l=[],s=[],t=[],r=[],w=[],v=[],b=[],x=[],q=[],n=[],a=[],c=0;256>c;c++)a[c]=128>c?c<<1:c<<1^283;for(var e=0,j=0,c=0;256>c;c++){var k=j^j<<1^j<<2^j<<3^j<<4,k=k>>>8^k&255^99;l[e]=k;s[k]=e;var z=a[e],F=a[z],G=a[F],y=257*a[k]^16843008*k;t[e]=y<<24|y>>>8;r[e]=y<<16|y>>>16;w[e]=y<<8|y>>>24;v[e]=y;y=16843009*G^65537*F^257*z^16843008*e;b[k]=y<<24|y>>>8;x[k]=y<<16|y>>>16;q[k]=y<<8|y>>>24;n[k]=y;e?(e=z^a[a[a[G^z]]],j^=a[a[j]]):e=j=1}var H=[0,1,2,4,8,
+16,32,64,128,27,54],d=d.AES=p.extend({_doReset:function(){for(var a=this._key,c=a.words,d=a.sigBytes/4,a=4*((this._nRounds=d+6)+1),e=this._keySchedule=[],j=0;j<a;j++)if(j<d)e[j]=c[j];else{var k=e[j-1];j%d?6<d&&4==j%d&&(k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255]):(k=k<<8|k>>>24,k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255],k^=H[j/d|0]<<24);e[j]=e[j-d]^k}c=this._invKeySchedule=[];for(d=0;d<a;d++)j=a-d,k=d%4?e[j]:e[j-4],c[d]=4>d||4>=j?k:b[l[k>>>24]]^x[l[k>>>16&255]]^q[l[k>>>
+8&255]]^n[l[k&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,t,r,w,v,l)},decryptBlock:function(a,c){var d=a[c+1];a[c+1]=a[c+3];a[c+3]=d;this._doCryptBlock(a,c,this._invKeySchedule,b,x,q,n,s);d=a[c+1];a[c+1]=a[c+3];a[c+3]=d},_doCryptBlock:function(a,b,c,d,e,j,l,f){for(var m=this._nRounds,g=a[b]^c[0],h=a[b+1]^c[1],k=a[b+2]^c[2],n=a[b+3]^c[3],p=4,r=1;r<m;r++)var q=d[g>>>24]^e[h>>>16&255]^j[k>>>8&255]^l[n&255]^c[p++],s=d[h>>>24]^e[k>>>16&255]^j[n>>>8&255]^l[g&255]^c[p++],t=
+d[k>>>24]^e[n>>>16&255]^j[g>>>8&255]^l[h&255]^c[p++],n=d[n>>>24]^e[g>>>16&255]^j[h>>>8&255]^l[k&255]^c[p++],g=q,h=s,k=t;q=(f[g>>>24]<<24|f[h>>>16&255]<<16|f[k>>>8&255]<<8|f[n&255])^c[p++];s=(f[h>>>24]<<24|f[k>>>16&255]<<16|f[n>>>8&255]<<8|f[g&255])^c[p++];t=(f[k>>>24]<<24|f[n>>>16&255]<<16|f[g>>>8&255]<<8|f[h&255])^c[p++];n=(f[n>>>24]<<24|f[g>>>16&255]<<16|f[h>>>8&255]<<8|f[k&255])^c[p++];a[b]=q;a[b+1]=s;a[b+2]=t;a[b+3]=n},keySize:8});u.AES=p._createHelper(d)})();

+ 111 - 0
public/codebase/encryption/encryption.js

@@ -0,0 +1,111 @@
+define(function(require, exports, module) {
+	var _oCommon, _oUtils, _oBase64;
+
+	require("websdk");
+	_oCommon = require("common");
+	_oUtils = require("utils");
+	_oBase64 = require("base64");
+
+	function EncryptionFac () {}
+
+	EncryptionFac.prototype.encrypt = function (oStr, iRSABits, bBase64Encrypted, cbFun) {
+		//var that = this;
+		var	iBits = 1024;
+
+		if (iRSABits) {
+			iBits = iRSABits;
+		}
+
+		var szPassPhrase =  new Date() + "",
+			szMattsRSAkey = cryptico.generateRSAKey(szPassPhrase, iBits),
+			szPublicKeyString = cryptico.publicKeyString(szMattsRSAkey),
+			szXml = "<?xml version='1.0' encoding='UTF-8'?><PublicKey><key>" + _oBase64.encode(szPublicKeyString) + "</key></PublicKey>",
+			oXmlDoc = _oUtils.parseXmlFromStr(szXml);
+
+		WebSDK.WSDK_Request(_oCommon.m_szHostName, _oCommon.m_iHttpProtocal, _oCommon.m_iHttpPort, {
+			cmd: "challenge",
+			type: "POST",
+			data: oXmlDoc,
+			success: function (status, xmlDoc) {
+				var szDecryptionResult = cryptico.decrypt(_oBase64.decode(_oUtils.nodeValue(xmlDoc, "key")), szMattsRSAkey);
+				if(szDecryptionResult.plaintext != null) {
+					var szKey,szEncryptPassword;
+					var aResult = [];
+					if (iBits === 256) {
+						szKey = _oUtils.toHex(szDecryptionResult.plaintext);
+					} else {
+						szKey = szDecryptionResult.plaintext;
+					}
+
+					szEncryptPassword = aes_encrypt(szDecryptionResult.plaintext.substring(0, 16), szKey, true);
+
+					if("function" === typeof cbFun) {
+						if("string" === typeof oStr) {
+							bBase64Encrypted && ( oStr = _oBase64.encode(oStr) );
+							cbFun( _oBase64.encode( szEncryptPassword + _oUtils.encodeAES(oStr, szKey, "", "ecb") ) );
+						} else if("[object Array]" === Object.prototype.toString.call(oStr)) {
+							for(var i = 0, iArrayLen = oStr.length; i < iArrayLen; i++) {
+								bBase64Encrypted && ( oStr[i] = _oBase64.encode(oStr[i]) );
+								var szTemp = szEncryptPassword + _oUtils.encodeAES(oStr[i], szKey, "", "ecb");
+								aResult.push( _oBase64.encode(szTemp) );
+							}
+							cbFun(aResult);
+						}
+					}
+				}
+			}
+		});
+	};
+
+	EncryptionFac.prototype.encryptSync = function (oStr, iRSABits, bBase64Encrypted) {
+		//var that = this;
+		var	iBits = 1024;
+		var aResult = [];
+
+		if (iRSABits) {
+			iBits = iRSABits;
+		}
+
+		var szPassPhrase =  new Date() + "",
+			szMattsRSAkey = cryptico.generateRSAKey(szPassPhrase, iBits),
+			szPublicKeyString = cryptico.publicKeyString(szMattsRSAkey),
+			szXml = "<?xml version='1.0' encoding='UTF-8'?><PublicKey><key>" + _oBase64.encode(szPublicKeyString) + "</key></PublicKey>",
+			oXmlDoc = _oUtils.parseXmlFromStr(szXml);
+
+		WebSDK.WSDK_Request(_oCommon.m_szHostName, _oCommon.m_iHttpProtocal, _oCommon.m_iHttpPort, {
+			cmd: "challenge",
+			type: "POST",
+			async: false,
+			data: oXmlDoc,
+			success: function (status, xmlDoc) {
+				var szDecryptionResult = cryptico.decrypt(_oBase64.decode(_oUtils.nodeValue(xmlDoc, "key")), szMattsRSAkey);
+				if(szDecryptionResult.plaintext != null) {
+					var szKey, szEncryptPassword;
+					if (iBits === 256) {
+						szKey = _oUtils.toHex(szDecryptionResult.plaintext);
+					} else {
+						szKey = szDecryptionResult.plaintext;
+					}
+					szEncryptPassword = aes_encrypt(szDecryptionResult.plaintext.substring(0, 16), szKey, true);
+					if("string" === typeof oStr) {
+						bBase64Encrypted && ( oStr = _oBase64.encode(oStr) );
+						aResult.push( _oBase64.encode( szEncryptPassword + _oUtils.encodeAES(oStr, szKey, "", "ecb") ) );
+					} else {
+						for(var i = 0, iArrayLen = oStr.length; i < iArrayLen; i++) {
+							bBase64Encrypted && ( oStr[i] = _oBase64.encode(oStr[i]) );
+							var szTemp = szEncryptPassword + _oUtils.encodeAES(oStr[i], szKey, "", "ecb");
+							aResult.push( _oBase64.encode(szTemp) );
+						}
+					}
+				}
+			}
+		});
+		if("string" === typeof oStr) {
+			return aResult[0];
+		} else {
+			return aResult;
+		}
+	};
+
+	module.exports = new EncryptionFac();
+});

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 0
public/codebase/jquery-1.12.1.min.js


+ 90 - 0
public/codebase/jquery.cookie.js

@@ -0,0 +1,90 @@
+/*jslint browser: true */ /*global jQuery: true */
+
+/**
+ * jQuery Cookie plugin
+ *
+ * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+
+// TODO JsDoc
+
+/**
+ * Create a cookie with the given key and value and other optional parameters.
+ *
+ * @example $.cookie('the_cookie', 'the_value');
+ * @desc Set the value of a cookie.
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
+ * @desc Create a cookie with all available options.
+ * @example $.cookie('the_cookie', 'the_value');
+ * @desc Create a session cookie.
+ * @example $.cookie('the_cookie', null);
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
+ *       used when the cookie was set.
+ *
+ * @param String key The key of the cookie.
+ * @param String value The value of the cookie.
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
+ *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
+ *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
+ *                             when the the browser exits.
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
+ *                        require a secure protocol (like HTTPS).
+ * @type undefined
+ *
+ * @name $.cookie
+ * @cat Plugins/Cookie
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
+ */
+
+/**
+ * Get the value of a cookie with the given key.
+ *
+ * @example $.cookie('the_cookie');
+ * @desc Get the value of a cookie.
+ *
+ * @param String key The key of the cookie.
+ * @return The value of the cookie.
+ * @type String
+ *
+ * @name $.cookie
+ * @cat Plugins/Cookie
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
+ */
+
+	jQuery.cookie = function (key, value, options) {
+
+		// key and value given, set cookie...
+		if (arguments.length > 1 && (value === null || typeof value !== "object")) {
+			options = jQuery.extend({}, options);
+
+			if (value === null) {
+				options.expires = -1;
+			}
+
+			if (typeof options.expires === 'number') {
+				var days = options.expires, t = options.expires = new Date();
+				t.setDate(t.getDate() + days);
+			}
+
+			return (document.cookie = [
+				encodeURIComponent(key), '=',
+				options.raw ? String(value) : encodeURIComponent(String(value)),
+				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+				options.path ? '; path=' + options.path : '; path=/',
+				options.domain ? '; domain=' + options.domain : '',
+				options.secure ? '; secure' : ''
+			].join(''));
+		}
+
+		// key and possibly options given, get cookie...
+		options = value || {};
+		var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
+		return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
+	};

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/jsPlugin-1.2.0.min.js


+ 223 - 0
public/codebase/playctrl/AudioRenderer.js

@@ -0,0 +1,223 @@
+/**
+ * Created by wangweijie5 on 2016/12/16.
+ */
+
+"use strict";
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var __instance = function () {
+    var instance = void 0;
+    return function (newInstance) {
+        if (newInstance) instance = newInstance;
+        return instance;
+    };
+}();
+
+var AudioRenderer = function () {
+    function AudioRenderer() {
+        _classCallCheck(this, AudioRenderer);
+
+        if (__instance()) return __instance();
+
+        // 确保只有单例
+        if (AudioRenderer.unique !== undefined) {
+            return AudioRenderer.unique;
+        }
+
+        AudioRenderer.unique = this;
+
+        this.oAudioContext = null;
+        this.currentVolume = 0.8; // 初始音量
+        this.bSetVolume = false;
+        this.gainNode = null;
+        this.iWndNum = -1; // 窗口号
+        this.mVolumes = new Map(); // 用于存储所有音量
+
+        // Init AudioContext
+        var AudioContext = window.AudioContext || window.webkitAudioContext;
+        this.oAudioContext = new AudioContext();
+
+        this.writeString = function (view, offset, string) {
+            for (var i = 0; i < string.length; i++) {
+                view.setUint8(offset + i, string.charCodeAt(i));
+            }
+        };
+
+        this.setBufferToDataview = function (output, offset, input) {
+            for (var i = 0; i < input.length; i++, offset++) {
+                output.setUint8(offset, input[i]);
+            }
+        };
+
+        __instance(this);
+    }
+
+    /**
+     * @synopsis 音频播放
+     *
+     *  @param dataBuf [IN] 音频缓存
+     *  @param dataLen [IN] 缓存长度
+     *  @param audioInfo [IN] 音频参数
+     *
+     * @returns 状态码
+     */
+
+
+    _createClass(AudioRenderer, [{
+        key: 'Play',
+        value: function Play(dataBuf, dataLen, audioInfo) {
+            var bufferData = new ArrayBuffer(44 + dataLen);
+            var viewTalk = new DataView(bufferData);
+            var sampleRates = audioInfo.samplesPerSec;
+            var channels = audioInfo.channels;
+            var bitsPerSample = audioInfo.bitsPerSample;
+
+            /* RIFF identifier */
+            this.writeString(viewTalk, 0, 'RIFF');
+            /* file length */
+            viewTalk.setUint32(4, 32 + dataLen * 2, true);
+            /* RIFF type */
+            this.writeString(viewTalk, 8, 'WAVE');
+            /* format chunk identifier */
+            this.writeString(viewTalk, 12, 'fmt ');
+            /* format chunk length */
+            viewTalk.setUint32(16, 16, true);
+            /* sample format (raw) */
+            viewTalk.setUint16(20, 1, true);
+            /* channel count */
+            viewTalk.setUint16(22, channels, true);
+            /* sample rate */
+            viewTalk.setUint32(24, sampleRates, true);
+            /* byte rate (sample rate * block align) */
+            viewTalk.setUint32(28, sampleRates * 2, true);
+            /* block align (channel count * bytes per sample)/8 */
+            viewTalk.setUint16(32, channels * bitsPerSample / 8, true);
+            /* bits per sample */
+            viewTalk.setUint16(34, bitsPerSample, true);
+            /* data chunk identifier */
+            this.writeString(viewTalk, 36, 'data');
+            /* data chunk length */
+            viewTalk.setUint32(40, dataLen, true);
+            this.setBufferToDataview(viewTalk, 44, dataBuf);
+
+            var self = this;
+            this.oAudioContext.decodeAudioData(viewTalk.buffer, function (buffer) {
+
+                var bufferSource = self.oAudioContext.createBufferSource();
+                if (bufferSource == null) {
+                    return -1;
+                }
+
+                bufferSource.buffer = buffer;
+                bufferSource.start(0);
+
+                if (self.gainNode == null || self.bSetVolume) {
+                    self.gainNode = self.oAudioContext.createGain();
+                    // self.gainNode.gain.value = self.currentVolume;
+                    // // self.currentVolume = self.gainNode.gain.value;
+                    // self.gainNode.connect(self.oAudioContext.destination);
+
+                    self.bSetVolume = false;
+                }
+
+                self.gainNode.gain.value = self.currentVolume;
+                // self.currentVolume = self.gainNode.gain.value;
+                self.gainNode.connect(self.oAudioContext.destination);
+
+                bufferSource.connect(self.gainNode);
+            }, function (e) {
+                console.log("decode error");
+                return -1;
+            });
+
+            return 0;
+        }
+
+        /**
+         * @synopsis 停止播放
+         *
+         * @returns 返回音量
+         */
+
+    }, {
+        key: 'Stop',
+        value: function Stop() {
+            if (this.gainNode != null) {
+                this.gainNode.disconnect();
+                this.gainNode = null;
+            }
+
+            // this.oAudioContext.close();
+
+            // AudioRenderer.unique = undefined;
+            // __instance() = null;
+            return true;
+        }
+
+        /**
+         * @synopsis 设置音量
+         *
+         *  @param iVolume [IN] 音量
+         *
+         * @returns 状态码
+         */
+
+    }, {
+        key: 'SetVolume',
+        value: function SetVolume(iVolume) {
+            this.bSetVolume = true;
+            this.currentVolume = iVolume;
+
+            // 储存当前窗口设置音量值
+            this.mVolumes.set(this.iWndNum, iVolume);
+            return true;
+        }
+
+        /**
+         * @synopsis 设置窗口号
+         *
+         *  @param iWndNum [IN] 窗口号
+         *
+         * @returns 状态码
+         */
+
+    }, {
+        key: 'SetWndNum',
+        value: function SetWndNum(iWndNum) {
+            this.iWndNum = iWndNum;
+
+            // 获取当前窗口设置音量值
+            var iVolume = this.mVolumes.get(iWndNum);
+            if (iVolume == undefined) {
+                iVolume = 0.8; // 默认音量
+            }
+            this.currentVolume = iVolume;
+
+            return true;
+        }
+
+        /**
+         * @synopsis 获取音量
+         *
+         * @returns 返回音量
+         */
+
+    }, {
+        key: 'GetVolume',
+        value: function GetVolume() {
+            // 获取当前窗口设置音量值
+            var iVolume = this.mVolumes.get(this.iWndNum);
+            if (iVolume == undefined) {
+                iVolume = 0.8; // 默认音量
+            }
+
+            return iVolume;
+        }
+    }]);
+
+    return AudioRenderer;
+}();
+//# sourceMappingURL=AudioRenderer.js.map

+ 521 - 0
public/codebase/playctrl/DecodeWorker.js

@@ -0,0 +1,521 @@
+/**
+ * Created by wangweijie5 on 2016/12/5.
+ */
+(function (event) {
+    const AUDIO_TYPE = 0;	// 音频
+    const VIDEO_TYPE = 1;   // 视频
+    const PRIVT_TYPE = 2;  // 私有帧
+
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
+
+    const HK_TRUE = 1;  // true
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
+
+    importScripts('Decoder.js');
+    Module.postRun.push(function () {
+        postMessage({'function': "loaded"});
+    });
+
+    var iStreamMode = 0;  // 流模式
+
+    var bOpenMode = false;
+    var bOpenStream = false;
+    
+    var funGetFrameData = null;
+
+    onmessage = function (event)
+    {
+        var eventData = event.data;
+        var res = 0;
+        switch (eventData.command)
+        {
+            case "SetStreamOpenMode":
+                iStreamMode = eventData.data;
+                res = Module._SetStreamOpenMode(iStreamMode);
+                if (res !== HK_TRUE)
+                {
+                    postMessage({'function': "SetStreamOpenMode", 'errorCode': res});
+                    return;
+                }
+                bOpenMode = true;
+                break;
+
+            case "OpenStream":
+                // 接收到的数据
+                var iHeadLen = eventData.dataSize;
+                var pHead = Module._malloc(iHeadLen + 4);
+                if (pHead === null)
+                {
+                    return;
+                }
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
+                aHead.set(eventData.data);
+
+                res = Module._OpenStream(pHead, iHeadLen, eventData.bufPoolSize);
+                postMessage({'function': "OpenStream", 'errorCode': res});
+                if (res !== HK_TRUE)
+                {
+                    //释放内存
+                    Module._free(pHead);
+                    pHead = null;
+                    return;
+                }
+                bOpenStream = true;
+
+                // 加4字节长度信息
+                var a32 = new Uint32Array([iHeadLen]);
+                var a8 = new Uint8Array(a32.buffer);
+                var tempBuf = new Uint8Array(iHeadLen + 4);
+                tempBuf.set(a8, 0);
+                tempBuf.set(eventData.data, 4);
+                a32 = null;
+                a8 = null;
+
+                aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen + 4);
+                aHead.set(tempBuf);
+                tempBuf = null;
+
+                res = Module._InputData(pHead, iHeadLen + 4);
+                if (res !== HK_TRUE)
+                {
+                    postMessage({'function': "InputData", 'errorCode': res});
+                    Module._free(pHead);
+                    pHead = null;
+                    return;
+                }
+
+                // 释放内存
+                Module._free(pHead);
+                pHead = null;
+
+                if (funGetFrameData === null) {
+                    funGetFrameData = Module.cwrap('GetFrameData', 'number');
+                }
+
+                if (iStreamMode === 0) {
+                    // Module._GetFrameData();
+                    funGetFrameData();
+                }
+                break;
+
+            case "InputData":
+                // 接收到的数据
+                var iLen = eventData.dataSize;
+                //console.log("DecodeWorker-InputData-len:%d", iLen);
+
+                if (iLen > 0)
+                {
+                    var pInputData = Module._malloc(iLen);
+                    if (pInputData === null)
+                    {
+                        return;
+                    }
+                    var inputData = new Uint8Array(eventData.data);
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
+                    // aInputData.set(inputData);
+                    Module.writeArrayToMemory(inputData, pInputData);
+                    inputData = null;
+
+                    res = Module._InputData(pInputData, iLen);
+                    //console.log("DecodeWorker-InputData-ret:%d", res);
+                    if (res !== HK_TRUE)
+                    {
+                        if (res === 98)
+                        {
+                            res = 1;
+                        }
+                        postMessage({'function': "InputData", 'errorCode': res});
+                    }
+                    Module._free(pInputData);
+                    pData = null;
+                }
+
+                /////////////////////
+                if (funGetFrameData === null)
+                {
+                    funGetFrameData = Module.cwrap('GetFrameData', 'number');
+                }
+
+                while (bOpenMode && bOpenStream)
+                {
+                    var ret = getFrameData(funGetFrameData);
+                    // var ret = getFrameData();
+
+                    // 直到获取视频帧或数据不足为止
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret)
+                    {
+                        break;
+                    }
+                }
+                break;
+
+            case "SetSecretKey":
+                var keyLen = eventData.nKeyLen;
+                var pKeyData = Module._malloc(keyLen);
+                if (pKeyData === null) {
+                    return;
+                }
+                var nKeySize = eventData.data.length
+                var bufData = stringToBytes (eventData.data);
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
+                aKeyData.set(new Uint8Array(bufData));
+
+                res = Module._SetSecretKey(eventData.nKeyType, pKeyData, keyLen, nKeySize);
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "SetSecretKey", 'errorCode': res});
+                    Module._free(pKeyData);
+                    pKeyData = null;
+                    return;
+                }
+
+                Module._free(pKeyData);
+                pKeyData = null;
+                break;
+
+            case "GetBMP":
+                var nBMPWidth = eventData.width;
+                var nBMPHeight = eventData.height;
+                var pYUVData = eventData.data;
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
+                var oBMPCropRect = eventData.rect;
+
+                var pDataYUV = Module._malloc(nYUVSize);
+                if (pDataYUV === null) {
+                    return;
+                }
+
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
+
+                // 分配BMP空间
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
+                var pBmpData = Module._malloc(nBmpSize);
+                var pBmpSize = Module._malloc(4);
+                if (pBmpData === null || pBmpSize === null) {
+                    Module._free(pDataYUV);
+                    pDataYUV = null;
+
+                    if (pBmpData != null) {
+                        Module._free(pBmpData);
+                        pBmpData = null;
+                    }
+
+                    if (pBmpSize != null) {
+                        Module._free(pBmpSize);
+                        pBmpSize = null;
+                    }
+                    return;
+                }
+
+                Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
+
+                res = Module._GetBMP(pDataYUV, nYUVSize, pBmpData, pBmpSize,
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "GetBMP", 'errorCode': res});
+                    Module._free(pDataYUV);
+                    pDataYUV = null;
+                    Module._free(pBmpData);
+                    pBmpData = null;
+                    Module._free(pBmpSize);
+                    pBmpSize = null;
+                    return;
+                }
+
+                // 获取BMP图片大小
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
+
+                // 获取BMP图片数据
+                var aBmpData = new Uint8Array(nBmpDataSize);
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
+
+                postMessage({'function': "GetBMP", 'data': aBmpData, 'errorCode': res}, [aBmpData.buffer]);
+
+                if (pDataYUV != null) {
+                    Module._free(pDataYUV);
+                    pDataYUV = null;
+                }
+                if (pBmpData != null) {
+                    Module._free(pBmpData);
+                    pBmpData = null;
+                }
+                if (pBmpSize != null) {
+                    Module._free(pBmpSize);
+                    pBmpSize = null;
+                }
+                break;
+
+            case "GetJPEG":
+                var nJpegWidth = eventData.width;
+                var nJpegHeight = eventData.height;
+                var pYUVData1 = eventData.data;
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
+                var oJpegCropRect = eventData.rect;
+
+                var pDataYUV1 = Module._malloc(nYUVSize1);
+                if (pDataYUV1 === null) {
+                    return;
+                }
+
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
+
+                // 分配JPEG空间
+                var pJpegData = Module._malloc(nYUVSize1);
+                var pJpegSize = Module._malloc(4);
+                if (pJpegData === null || pJpegSize === null) {
+                    if (pJpegData != null) {
+                        Module._free(pJpegData);
+                        pJpegData = null;
+                    }
+
+                    if (pJpegSize != null) {
+                        Module._free(pJpegSize);
+                        pJpegSize = null;
+                    }
+
+                    if (pDataYUV1 != null) {
+                        Module._free(pDataYUV1);
+                        pDataYUV1 = null;
+                    }
+                    return;
+                }
+
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
+
+                res = Module._GetJPEG(pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "GetJPEG", 'errorCode': res});
+                    if (pJpegData != null) {
+                        Module._free(pJpegData);
+                        pJpegData = null;
+                    }
+
+                    if (pJpegSize != null) {
+                        Module._free(pJpegSize);
+                        pJpegSize = null;
+                    }
+
+                    if (pDataYUV1 != null) {
+                        Module._free(pDataYUV1);
+                        pDataYUV1 = null;
+                    }
+                    return;
+                }
+
+                // 获取JPEG图片大小
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
+
+                // 获取JPEG图片数据
+                var aJpegData = new Uint8Array(nJpegSize);
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
+
+                postMessage({'function': "GetJPEG", 'data': aJpegData, 'errorCode': res}, [aJpegData.buffer]);
+
+                ajpegSizeData = null;
+                aJpegData = null;
+
+                if (pDataYUV1 != null) {
+                    Module._free(pDataYUV1);
+                    pDataYUV1 = null;
+                }
+                if (pJpegData != null) {
+                    Module._free(pJpegData);
+                    pJpegData = null;
+                }
+                if (pJpegSize != null) {
+                    Module._free(pJpegSize);
+                    pJpegSize = null;
+                }
+                break;
+
+            case "SetDecodeFrameType":
+                var nFrameType = eventData.data;
+                res = Module._SetDecodeFrameType(nFrameType);
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "SetDecodeFrameType", 'errorCode': res});
+                    return;
+                }
+                break;
+
+            case "DisplayRegion":
+                var nRegionNum = eventData.nRegionNum;
+                var srcRect = eventData.srcRect;
+                var hDestWnd = eventData.hDestWnd;
+                var bEnable = eventData.bEnable;
+
+                res = Module._SetDisplayRegion(nRegionNum, srcRect, hDestWnd, bEnable);
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "DisplayRegion", 'errorCode': res});
+                    return;
+                }
+                break;
+
+            case "CloseStream":
+                res = Module._CloseStream();
+                if (res !== HK_TRUE) {
+                    postMessage({'function': "CloseStream", 'errorCode': res});
+                    return;
+                }
+                break;
+
+            case "SetIFrameDecInterval":
+                Module._SetIFrameDecInterval(eventData.data);
+                break;
+
+            default:
+                break;
+        }
+    };
+
+    function getOSDTime(oFrameInfo) {
+        var iYear = oFrameInfo.year;
+        var iMonth = oFrameInfo.month;
+        var iDay = oFrameInfo.day;
+        var iHour = oFrameInfo.hour;
+        var iMinute = oFrameInfo.minute;
+        var iSecond = oFrameInfo.second;
+
+        if (iMonth < 10) {
+            iMonth = "0" + iMonth;
+        }
+        if (iDay < 10) {
+            iDay = "0" + iDay;
+        }
+        if (iHour < 10) {
+            iHour = "0" + iHour;
+        }
+        if (iMinute < 10) {
+            iMinute = "0" + iMinute;
+        }
+        if (iSecond < 10) {
+            iSecond = "0" + iSecond;
+        }
+
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
+    }
+
+    // 获取帧数据
+    function getFrameData(fun)
+    {
+    // function getFrameData() {
+        // 获取帧数据
+        // var res = Module._GetFrameData();
+        var res = fun();
+
+        if (res === HK_TRUE)
+        {
+            var oFrameInfo = Module._GetFrameInfo();
+            //console.log("getFrameData-ok:%d %d %d %d %d %d \n", oFrameInfo.year, oFrameInfo.month, oFrameInfo.day, oFrameInfo.hour, oFrameInfo.minute, oFrameInfo.second);
+
+            switch (oFrameInfo.frameType)
+            {
+                case AUDIO_TYPE:
+                    var iSize = oFrameInfo.frameSize;
+                    if (0 === iSize)
+                    {
+                        return -1;
+                    }
+
+                    var pPCM = Module._GetFrameBuffer();
+                    // var audioBuf = new ArrayBuffer(iSize);
+                    var aPCMData = new Uint8Array(iSize);
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
+
+                    postMessage({
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
+                        'frameInfo': oFrameInfo, 'errorCode': res
+                    }, [aPCMData.buffer]);
+
+                    oFrameInfo = null;
+                    pPCM = null;
+                    audioBuf = null;
+                    aPCMData = null;
+                    return PLAYM4_AUDIO_FRAME;
+
+                case VIDEO_TYPE:
+                    var szOSDTime = getOSDTime(oFrameInfo);
+
+                    var iWidth = oFrameInfo.width;
+                    var iHeight = oFrameInfo.height;
+
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
+                    if (0 === iYUVSize)
+                    {
+                        return -1;
+                    }
+
+                    var pYUV = Module._GetFrameBuffer();
+
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
+                    var aYUVData = new Uint8Array(iYUVSize);
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
+
+                    postMessage({
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
+                    }, [aYUVData.buffer]);
+
+                    oFrameInfo = null;
+                    pYUV = null;
+                    buf = null;
+                    aYUVData = null;
+                    return PLAYM4_VIDEO_FRAME;
+
+                case PRIVT_TYPE:
+                    postMessage({
+                        'function': "GetFrameData", 'type': "", 'data': null,
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
+                    });
+                    return PLAYM4_SYS_NOT_SUPPORT;
+
+                default:
+                    postMessage({
+                        'function': "GetFrameData", 'type': "", 'data': null,
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
+                    });
+                    return PLAYM4_SYS_NOT_SUPPORT;
+            }
+        } else {
+            if (PLAYM4_NEED_MORE_DATA === res || PLAYM4_SYS_NOT_SUPPORT === res) {
+                postMessage({
+                    'function': "GetFrameData", 'type': "", 'data': null,
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': res
+                });
+            }
+
+            return res;
+        }
+    }
+
+    // 开始计算时间
+    function startTime() {
+        return new Date().getTime();
+    }
+
+    // 结束计算时间
+    function endTime() {
+        return new Date().getTime();
+    }
+
+    // 字母字符串转byte数组
+    function stringToBytes ( str ) {
+        var ch, st, re = [];
+        for (var i = 0; i < str.length; i++ ) {
+            ch = str.charCodeAt(i);  // get char
+            st = [];                 // set up "stack"
+            do {
+                st.push( ch & 0xFF );  // push byte to stack
+                ch = ch >> 8;          // shift value down by 1 byte
+            }
+            while ( ch );
+            // add stack contents to result
+            // done because chars have "wrong" endianness
+            re = re.concat( st.reverse() );
+        }
+        // return an array of bytes
+        return re;
+    }
+})();

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/playctrl/Decoder.js


BIN
public/codebase/playctrl/Decoder.js.mem


BIN
public/codebase/playctrl/Decoder.wasm


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/playctrl/SuperRender.js


+ 337 - 0
public/codebase/playctrl/SuperRender_10.js

@@ -0,0 +1,337 @@
+"use strict";
+
+var vertexYUVShader = [
+    'attribute vec4 vertexPos;',
+    'attribute vec2 texturePos;',
+    'varying vec2 textureCoord;',
+
+    'void main()',
+    '{',
+        'gl_Position = vertexPos;',
+        'textureCoord = texturePos;',
+    '}'
+    ].join('\n');
+
+var fragmentYUVShader = [
+    'precision highp float;',
+    'varying highp vec2 textureCoord;',
+    'uniform sampler2D ySampler;',
+    'uniform sampler2D uSampler;',
+    'uniform sampler2D vSampler;',
+    'const mat4 YUV2RGB = mat4',
+    '(',
+        '1.1643828125, 0, 1.59602734375, -.87078515625,',
+        '1.1643828125, -.39176171875, -.81296875, .52959375,',
+        '1.1643828125, 2.017234375, 0, -1.081390625,',
+        '0, 0, 0, 1',
+    ');',
+  
+    'void main(void) {',
+        'highp float y = texture2D(ySampler,  textureCoord).r;',
+        'highp float u = texture2D(uSampler,  textureCoord).r;',
+        'highp float v = texture2D(vSampler,  textureCoord).r;',
+        'gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;',
+    '}'
+    ].join('\n');
+
+(function (root, factory) {
+    root.SuperRender = factory();
+}(this, function () {
+    
+    function RenderManager(canvas) {
+
+        this.canvasElement = document.getElementById(canvas);
+
+        this.initContextGL();
+
+        if(this.contextGL) {
+            this.YUVProgram = this.initProgram(vertexYUVShader, fragmentYUVShader);
+            this.initBuffers();
+            this.initTextures();
+        }
+    };
+
+    /**
+     * 初始化WebGL上下文
+     */
+    RenderManager.prototype.initContextGL = function() {
+        
+        var canvas = this.canvasElement;
+
+        var gl = null;
+
+        try {
+            gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
+        } catch (e) {
+            gl = null;
+        }
+
+        if(!gl || typeof gl.getParameter !== "function") {
+            gl = null;
+        }
+
+        this.contextGL = gl;
+
+        console.log("WebGL1.0");
+    };
+
+    /**
+     * 初始化着色器程序
+     * @param vertexShaderScript    顶点着色器脚本
+     * @param fragmentShaderScript  片段着色器脚本
+     */
+    RenderManager.prototype.initProgram = function(vertexShaderScript, fragmentShaderScript) {
+        
+        var gl = this.contextGL;
+        
+        var vertexShader = gl.createShader(gl.VERTEX_SHADER);
+        gl.shaderSource(vertexShader, vertexShaderScript);
+        gl.compileShader(vertexShader);
+        if(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
+            console.log('Vertex shader failed to compile: ' + gl.getShaderInfoLog(vertexShader));
+        }
+
+        var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
+        gl.shaderSource(fragmentShader, fragmentShaderScript);
+        gl.compileShader(fragmentShader);
+        if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
+            console.log('Fragment shader failed to compile: ' + gl.getShaderInfoLog(fragmentShader));
+        }
+
+        var program = gl.createProgram();
+        gl.attachShader(program, vertexShader);
+        gl.attachShader(program, fragmentShader);
+        gl.linkProgram(program);
+        if(!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+            console.log('Program failed to compile: ' + gl.getProgramInfoLog(program));
+        }
+        
+        gl.deleteShader(vertexShader);
+        gl.deleteShader(fragmentShader);
+
+        return program;
+    };
+
+    /**
+     * 初始化数据缓存
+     */
+    RenderManager.prototype.initBuffers = function() {
+        
+        var gl = this.contextGL;
+    
+        var vertexPosBuffer = gl.createBuffer();
+        gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
+        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);
+        gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+        var texturePosBuffer = gl.createBuffer();
+        gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
+        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.DYNAMIC_DRAW);
+        gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+        this.vertexPosBuffer  = vertexPosBuffer;
+        this.texturePosBuffer = texturePosBuffer;
+    };
+
+    /**
+     * 初始化YUV纹理
+     */
+    RenderManager.prototype.initTextures = function() {
+        
+        var gl = this.contextGL;
+        
+        var program = this.YUVProgram;
+        gl.useProgram(program);
+        
+        var yTextureRef = this.initTexture();
+        var ySamplerRef = gl.getUniformLocation(program, 'ySampler');
+        gl.uniform1i(ySamplerRef, 0);
+        this.yTextureRef = yTextureRef;
+
+        var uTextureRef = this.initTexture();
+        var uSamplerRef = gl.getUniformLocation(program, 'uSampler');
+        gl.uniform1i(uSamplerRef, 1);
+        this.uTextureRef = uTextureRef;
+
+        var vTextureRef = this.initTexture();
+        var vSamplerRef = gl.getUniformLocation(program, 'vSampler');
+        gl.uniform1i(vSamplerRef, 2);
+        this.vTextureRef = vTextureRef;
+        
+        gl.useProgram(null);
+    };
+
+    /**
+     * 创建纹理
+     */
+    RenderManager.prototype.initTexture = function() {
+        
+        var gl = this.contextGL;
+
+        var textureRef = gl.createTexture();
+        gl.bindTexture(gl.TEXTURE_2D, textureRef);
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+        gl.bindTexture(gl.TEXTURE_2D, null);
+
+        return textureRef;
+    };
+
+    /**
+     * 显示帧数据
+     * @param nWidth    宽度
+     * @param nHeight   高度
+     * @param nHeight   帧数据
+     */
+    RenderManager.prototype.SR_DisplayFrameData = function(nWidth, nHeight, pData) {
+
+        if(nWidth <= 0 || nHeight <= 0)
+        {
+            return;
+        }
+
+        var gl = this.contextGL;
+
+        if(null == pData)
+        {
+            gl.clearColor(0.0, 0.0, 0.0, 0.0);
+            gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+            return;
+        }
+
+        var canvas = this.canvasElement;
+
+        this.nWindowWidth = canvas.width;
+        this.nWindowHeight = canvas.height;
+        
+        var nWindowWidth = this.nWindowWidth;
+        var nWindowHeight = this.nWindowHeight;
+
+        gl.clearColor(0.8, 0.8, 1.0, 1.0);
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+        gl.viewport(0, 0, nWindowWidth, nWindowHeight);
+
+        this.updateFrameData(nWidth, nHeight, pData);
+
+        var program = this.YUVProgram;
+        gl.useProgram(program);
+
+        var vertexPosBuffer = this.vertexPosBuffer;
+        gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
+        var vertexPosRef = gl.getAttribLocation(program, 'vertexPos');
+        gl.enableVertexAttribArray(vertexPosRef);
+        gl.vertexAttribPointer(vertexPosRef, 2, gl.FLOAT, false, 0, 0);
+        gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+        var texturePosBuffer = this.texturePosBuffer;
+        gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
+        var texturePosRef = gl.getAttribLocation(program, 'texturePos');
+        gl.enableVertexAttribArray(texturePosRef);
+        gl.vertexAttribPointer(texturePosRef, 2, gl.FLOAT, false, 0, 0);
+        gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+        gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); 
+
+        gl.disableVertexAttribArray(vertexPosRef);
+        gl.disableVertexAttribArray(texturePosRef);
+
+        gl.useProgram(null);
+    };
+
+    /**
+     * 上传YUV数据到纹理
+     * @param nWidth    宽度
+     * @param nHeight   高度
+     * @param nHeight   帧数据
+     */
+    RenderManager.prototype.updateFrameData = function(width, height, data) {
+
+        var gl = this.contextGL;
+
+        var yTextureRef = this.yTextureRef;
+        var uTextureRef = this.uTextureRef;
+        var vTextureRef = this.vTextureRef;
+
+        var i420Data = data;
+
+        var yDataLength = width * height;
+        var yData = i420Data.subarray(0, yDataLength);
+        gl.activeTexture(gl.TEXTURE0);
+        gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
+        gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, yData);
+
+        var cbDataLength = width/2 * height/2;
+        var cbData = i420Data.subarray(yDataLength, yDataLength + cbDataLength);
+        gl.activeTexture(gl.TEXTURE1);
+        gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
+        gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width/2, height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, cbData);
+
+        var crDataLength = cbDataLength;
+        var crData = i420Data.subarray(yDataLength + cbDataLength, yDataLength + cbDataLength + crDataLength);
+        gl.activeTexture(gl.TEXTURE2);
+        gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
+        gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width/2, height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, crData);
+    };
+
+    /**
+     * 设置显示区域
+     * @param stDisplayRect    显示区域
+     */
+    RenderManager.prototype.SR_SetDisplayRect = function(stDisplayRect) {
+
+        var gl = this.contextGL;
+
+        var nWindowWidth = this.nWindowWidth;
+        var nWindowHeight = this.nWindowHeight;
+        
+        var texturePosValues = null;
+        
+        if(stDisplayRect && nWindowWidth > 0 && nWindowHeight > 0) {
+            var fLeft = stDisplayRect.left / nWindowWidth;
+            var fTop = stDisplayRect.top / nWindowHeight;
+            var fRight = stDisplayRect.right / nWindowWidth;
+            var fBottom = stDisplayRect.bottom / nWindowHeight;
+
+            texturePosValues = new Float32Array([fRight, fTop, fLeft, fTop, fRight, fBottom, fLeft, fBottom]);
+        }
+        else {
+            texturePosValues = new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]);
+        }
+
+        var texturePosBuffer = this.texturePosBuffer;
+
+        gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
+        gl.bufferSubData(gl.ARRAY_BUFFER, 0, texturePosValues);
+        gl.bindBuffer(gl.ARRAY_BUFFER, null);
+    };
+
+    /**
+     * 释放显示资源
+     */
+    RenderManager.prototype.SR_Destroy = function() {
+
+        var gl = this.contextGL;
+        
+        var YUVProgram = this.YUVProgram;
+        gl.deleteProgram(YUVProgram);
+
+        var vertexPosBuffer = this.vertexPosBuffer;
+        var texturePosBuffer = this.texturePosBuffer;
+        
+        gl.deleteBuffer(vertexPosBuffer);
+        gl.deleteBuffer(texturePosBuffer);
+
+        var yTextureRef = this.yTextureRef;
+        var uTextureRef = this.uTextureRef;
+        var vTextureRef = this.vTextureRef;
+        gl.deleteTexture(yTextureRef);
+        gl.deleteTexture(uTextureRef);
+        gl.deleteTexture(vTextureRef);
+    };
+
+    return RenderManager;
+
+}));

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/playctrl/SuperRender_20.js


Diff do ficheiro suprimidas por serem muito extensas
+ 6833 - 0
public/codebase/polyfill2.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/transform/SystemTransform.js


BIN
public/codebase/transform/SystemTransform.js.mem


+ 1 - 0
public/codebase/transform/systemTransform-worker.min.js

@@ -0,0 +1 @@
+!function(){function e(){var e=new XMLHttpRequest;return e.open("GET","SystemTransform.js.mem"),e.responseType="arraybuffer",e.send(),e}self.Module={memoryInitializerRequest:e()},importScripts("SystemTransform.js"),Module.postRun.push(function(){postMessage({type:"loaded"})}),onmessage=function(e){var a=e.data;if("create"===a.type){var t=a.len,r=Module._malloc(t),o=Module.HEAPU8.subarray(r,r+t);o.set(new Uint8Array(a.buf));var s=a.packType,l=Module._ST_Create(r,t,s);0!=l?console.log("_ST_Create failed!"):(Module._ST_Start(),postMessage({type:"created"}))}else if("inputData"===a.type){var u=a.len,n=Module._malloc(u),o=Module.HEAPU8.subarray(n,n+u);o.set(new Uint8Array(a.buf));var l=Module._ST_InputData(0,n,u);Module._free(n)}else"release"===a.type&&(Module._ST_Stop(),Module._ST_Release(),close())}}();

+ 98 - 0
public/codebase/uuid.js

@@ -0,0 +1,98 @@
+/*
+
+uuid.js - Version 0.2
+JavaScript Class to create a UUID like identifier
+*/
+
+// On creation of a UUID object, set it's initial value
+function UUID(){
+	this.id = this.createUUID();
+}
+
+// When asked what this Object is, lie and return it's value
+UUID.prototype.valueOf = function(){ return this.id; }
+UUID.prototype.toString = function(){ return this.id; }
+
+//
+// INSTANCE SPECIFIC METHODS
+//
+
+UUID.prototype.createUUID = function(){
+	//
+	// Loose interpretation of the specification DCE 1.1: Remote Procedure Call
+	// described at http://www.opengroup.org/onlinepubs/009629399/apdxa.htm#tagtcjh_37
+	// since JavaScript doesn't allow access to internal systems, the last 48 bits 
+	// of the node section is made up using a series of random numbers (6 octets long).
+	//  
+	var dg = new Date(1582, 10, 15, 0, 0, 0, 0);
+	var dc = new Date();
+	var t = dc.getTime() - dg.getTime();
+	var h = '-';
+	var tl = UUID.getIntegerBits(t,0,31);
+	var tm = UUID.getIntegerBits(t,32,47);
+	var thv = UUID.getIntegerBits(t,48,59) + '1'; // version 1, security version is 2
+	var csar = UUID.getIntegerBits(UUID.rand(4095),0,7);
+	var csl = UUID.getIntegerBits(UUID.rand(4095),0,7);
+
+	// since detection of anything about the machine/browser is far to buggy, 
+	// include some more random numbers here
+	// if NIC or an IP can be obtained reliably, that should be put in
+	// here instead.
+	var n = UUID.getIntegerBits(UUID.rand(8191),0,7) + 
+			UUID.getIntegerBits(UUID.rand(8191),8,15) + 
+			UUID.getIntegerBits(UUID.rand(8191),0,7) + 
+			UUID.getIntegerBits(UUID.rand(8191),8,15) + 
+			UUID.getIntegerBits(UUID.rand(8191),0,15); // this last number is two octets long
+	return tl + h + tm + h + thv + h + csar + csl + h + n; 
+}
+
+
+//
+// GENERAL METHODS (Not instance specific)
+//
+
+
+// Pull out only certain bits from a very large integer, used to get the time
+// code information for the first part of a UUID. Will return zero's if there 
+// aren't enough bits to shift where it needs to.
+UUID.getIntegerBits = function(val,start,end){
+	var base16 = UUID.returnBase(val,16);
+	var quadArray = new Array();
+	var quadString = '';
+	var i = 0;
+	for(i=0;i<base16.length;i++){
+		quadArray.push(base16.substring(i,i+1));	
+	}
+	for(i=Math.floor(start/4);i<=Math.floor(end/4);i++){
+		if(!quadArray[i] || quadArray[i] == '') quadString += '0';
+		else quadString += quadArray[i];
+	}
+	return quadString;
+}
+
+// Numeric Base Conversion algorithm from irt.org
+// In base 16: 0=0, 5=5, 10=A, 15=F
+UUID.returnBase = function(number, base){
+	//
+	// Copyright 1996-2006 irt.org, All Rights Reserved.	
+	//
+	// Downloaded from: http://www.irt.org/script/146.htm	
+	// modified to work in this class by Erik Giberti
+	var convert = ['0','1','2','3','4','5','6','7','8','9','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'];
+    if (number < base) var output = convert[number];
+    else {
+        var MSD = '' + Math.floor(number / base);
+        var LSD = number - MSD*base;
+        if (MSD >= base) var output = this.returnBase(MSD,base) + convert[LSD];
+        else var output = convert[MSD] + convert[LSD];
+    }
+    return output;
+}
+
+// pick a random number within a range of numbers
+// int b rand(int a); where 0 <= b <= a
+UUID.rand = function(max){
+	return Math.floor(Math.random() * max);
+}
+
+// end of UUID class file

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
public/codebase/webVideoCtrl.js


+ 4 - 0
public/config.js

@@ -0,0 +1,4 @@
+window.g={
+  BASE_URL:"http://112.26.142.150:8011"
+  // BASE_URL:""
+}

BIN
public/doc/测试.doc


BIN
public/favicon.ico


Diff do ficheiro suprimidas por serem muito extensas
+ 21 - 0
public/html/ie.html


+ 218 - 0
public/index.html

@@ -0,0 +1,218 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="renderer" content="webkit">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title><%= webpackConfig.name %></title>
+
+    <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
+
+	  <style>
+    html,
+    body,
+    #app {
+      height: 100%;
+      margin: 0px;
+      padding: 0px;
+    }
+    .chromeframe {
+      margin: 0.2em 0;
+      background: #ccc;
+      color: #000;
+      padding: 0.2em 0;
+    }
+
+    #loader-wrapper {
+      position: fixed;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      z-index: 999999;
+    }
+
+    #loader {
+      display: block;
+      position: relative;
+      left: 50%;
+      top: 50%;
+      width: 150px;
+      height: 150px;
+      margin: -75px 0 0 -75px;
+      border-radius: 50%;
+      border: 3px solid transparent;
+      border-top-color: #FFF;
+      -webkit-animation: spin 2s linear infinite;
+      -ms-animation: spin 2s linear infinite;
+      -moz-animation: spin 2s linear infinite;
+      -o-animation: spin 2s linear infinite;
+      animation: spin 2s linear infinite;
+      z-index: 1001;
+    }
+
+    #loader:before {
+      content: "";
+      position: absolute;
+      top: 5px;
+      left: 5px;
+      right: 5px;
+      bottom: 5px;
+      border-radius: 50%;
+      border: 3px solid transparent;
+      border-top-color: #FFF;
+      -webkit-animation: spin 3s linear infinite;
+      -moz-animation: spin 3s linear infinite;
+      -o-animation: spin 3s linear infinite;
+      -ms-animation: spin 3s linear infinite;
+      animation: spin 3s linear infinite;
+    }
+
+    #loader:after {
+      content: "";
+      position: absolute;
+      top: 15px;
+      left: 15px;
+      right: 15px;
+      bottom: 15px;
+      border-radius: 50%;
+      border: 3px solid transparent;
+      border-top-color: #FFF;
+      -moz-animation: spin 1.5s linear infinite;
+      -o-animation: spin 1.5s linear infinite;
+      -ms-animation: spin 1.5s linear infinite;
+      -webkit-animation: spin 1.5s linear infinite;
+      animation: spin 1.5s linear infinite;
+    }
+
+
+    @-webkit-keyframes spin {
+      0% {
+        -webkit-transform: rotate(0deg);
+        -ms-transform: rotate(0deg);
+        transform: rotate(0deg);
+      }
+      100% {
+        -webkit-transform: rotate(360deg);
+        -ms-transform: rotate(360deg);
+        transform: rotate(360deg);
+      }
+    }
+
+    @keyframes spin {
+      0% {
+        -webkit-transform: rotate(0deg);
+        -ms-transform: rotate(0deg);
+        transform: rotate(0deg);
+      }
+      100% {
+        -webkit-transform: rotate(360deg);
+        -ms-transform: rotate(360deg);
+        transform: rotate(360deg);
+      }
+    }
+
+
+    #loader-wrapper .loader-section {
+      position: fixed;
+      top: 0;
+      width: 51%;
+      height: 100%;
+      background: #7171C6;
+      z-index: 1000;
+      -webkit-transform: translateX(0);
+      -ms-transform: translateX(0);
+      transform: translateX(0);
+    }
+
+    #loader-wrapper .loader-section.section-left {
+      left: 0;
+    }
+
+    #loader-wrapper .loader-section.section-right {
+      right: 0;
+    }
+
+
+    .loaded #loader-wrapper .loader-section.section-left {
+      -webkit-transform: translateX(-100%);
+      -ms-transform: translateX(-100%);
+      transform: translateX(-100%);
+      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+    }
+
+    .loaded #loader-wrapper .loader-section.section-right {
+      -webkit-transform: translateX(100%);
+      -ms-transform: translateX(100%);
+      transform: translateX(100%);
+      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+    }
+
+    .loaded #loader {
+      opacity: 0;
+      -webkit-transition: all 0.3s ease-out;
+      transition: all 0.3s ease-out;
+    }
+
+    .loaded #loader-wrapper {
+      visibility: hidden;
+      -webkit-transform: translateY(-100%);
+      -ms-transform: translateY(-100%);
+      transform: translateY(-100%);
+      -webkit-transition: all 0.3s 1s ease-out;
+      transition: all 0.3s 1s ease-out;
+    }
+
+    .no-js #loader-wrapper {
+      display: none;
+    }
+
+    .no-js h1 {
+      color: #222222;
+    }
+
+    #loader-wrapper .load_title {
+      font-family: 'Open Sans';
+      color: #FFF;
+      font-size: 19px;
+      width: 100%;
+      text-align: center;
+      z-index: 9999999999999;
+      position: absolute;
+      top: 60%;
+      opacity: 1;
+      line-height: 30px;
+    }
+
+    #loader-wrapper .load_title span {
+      font-weight: normal;
+      font-style: italic;
+      font-size: 13px;
+      color: #FFF;
+      opacity: 0.5;
+    }
+  </style>
+
+    <script src="../jquery-1.7.1.min.js"></script>
+    <script src="../codebase/webVideoCtrl.js"></script>
+    <script src="../codebase/encryption/AES.js"></script>
+    <script src="../codebase/encryption/cryptico.min.js"></script>
+    <script src="https://webapi.amap.com/maps?v=2.0&key=e85c9cc450cf52d37f7a3d3e4c3d94cb&plugin=AMap.PolygonEditor"></script>
+    <script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
+    <script src="https://cache.amap.com/lbs/static/es5.min.js"></script>
+  </head>
+  <body>
+    <div id="app">
+	    <!--<div id="loader-wrapper">
+		    <div id="loader"></div>
+		    <div class="loader-section section-left"></div>
+		    <div class="loader-section section-right"></div>
+		    <div class="load_title">正在加载系统资源,请耐心等待</div>
+        </div>-->
+	</div>
+  </body>
+</html>

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 0
public/jquery-1.7.1.min.js


+ 2 - 0
public/robots.txt

@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /

+ 28 - 0
src/App.vue

@@ -0,0 +1,28 @@
+<template>
+  <div id="app">
+    <router-view />
+    <theme-picker />
+  </div>
+</template>
+
+<script>
+import ThemePicker from "@/components/ThemePicker";
+
+export default {
+  name: "App",
+  components: { ThemePicker },
+    metaInfo() {
+        return {
+            title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
+            titleTemplate: title => {
+                return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
+            }
+        }
+    }
+};
+</script>
+<style scoped>
+#app .theme-picker {
+  display: none;
+}
+</style>

Diff do ficheiro suprimidas por serem muito extensas
+ 691 - 0
src/api/citiyMin.js


+ 2077 - 0
src/api/city.js

@@ -0,0 +1,2077 @@
+export default [
+  {
+    "value": "340000",
+    "label": "安徽省",
+    "children": [
+      {
+        "value": "340100",
+        "label": "合肥市",
+        "children": null
+      },
+      {
+        "value": "340200",
+        "label": "芜湖市",
+        "children": null
+      },
+      {
+        "value": "340300",
+        "label": "蚌埠市",
+        "children": null
+      },
+      {
+        "value": "340400",
+        "label": "淮南市",
+        "children": null
+      },
+      {
+        "value": "340500",
+        "label": "马鞍山市",
+        "children": null
+      },
+      {
+        "value": "340600",
+        "label": "淮北市",
+        "children": null
+      },
+      {
+        "value": "340700",
+        "label": "铜陵市",
+        "children": null
+      },
+      {
+        "value": "340800",
+        "label": "安庆市",
+        "children": null
+      },
+      {
+        "value": "341000",
+        "label": "黄山市",
+        "children": null
+      },
+      {
+        "value": "341100",
+        "label": "滁州市",
+        "children": null
+      },
+      {
+        "value": "341200",
+        "label": "阜阳市",
+        "children": null
+      },
+      {
+        "value": "341300",
+        "label": "宿州市",
+        "children": null
+      },
+      {
+        "value": "341500",
+        "label": "六安市",
+        "children": null
+      },
+      {
+        "value": "341600",
+        "label": "亳州市",
+        "children": null
+      },
+      {
+        "value": "341700",
+        "label": "池州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "110000",
+    "label": "北京市",
+    "children": [
+      {
+        "value": "110101",
+        "label": "东城区",
+        "children": null
+      },
+      {
+        "value": "110102",
+        "label": "西城区",
+        "children": null
+      },
+      {
+        "value": "110105",
+        "label": "朝阳区",
+        "children": null
+      },
+      {
+        "value": "110106",
+        "label": "丰台区",
+        "children": null
+      },
+      {
+        "value": "110107",
+        "label": "石景山区",
+        "children": null
+      },
+      {
+        "value": "110108",
+        "label": "海淀区",
+        "children": null
+      },
+      {
+        "value": "110109",
+        "label": "门头沟区",
+        "children": null
+      },
+      {
+        "value": "110111",
+        "label": "房山区",
+        "children": null
+      },
+      {
+        "value": "110112",
+        "label": "通州区",
+        "children": null
+      },
+      {
+        "value": "110113",
+        "label": "顺义区",
+        "children": null
+      },
+      {
+        "value": "110114",
+        "label": "昌平区",
+        "children": null
+      },
+      {
+        "value": "110115",
+        "label": "大兴区",
+        "children": null
+      },
+      {
+        "value": "110116",
+        "label": "怀柔区",
+        "children": null
+      },
+      {
+        "value": "110117",
+        "label": "平谷区",
+        "children": null
+      },
+      {
+        "value": "110118",
+        "label": "密云区",
+        "children": null
+      },
+      {
+        "value": "110119",
+        "label": "延庆区",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "120000",
+    "label": "天津市",
+    "children": [
+      {
+        "value": "120101",
+        "label": "和平区",
+        "children": null
+      },
+      {
+        "value": "120102",
+        "label": "河东区",
+        "children": null
+      },
+      {
+        "value": "120103",
+        "label": "河西区",
+        "children": null
+      },
+      {
+        "value": "120104",
+        "label": "南开区",
+        "children": null
+      },
+      {
+        "value": "120105",
+        "label": "河北区",
+        "children": null
+      },
+      {
+        "value": "120106",
+        "label": "红桥区",
+        "children": null
+      },
+      {
+        "value": "120110",
+        "label": "东丽区",
+        "children": null
+      },
+      {
+        "value": "120111",
+        "label": "西青区",
+        "children": null
+      },
+      {
+        "value": "120112",
+        "label": "津南区",
+        "children": null
+      },
+      {
+        "value": "120113",
+        "label": "北辰区",
+        "children": null
+      },
+      {
+        "value": "120114",
+        "label": "武清区",
+        "children": null
+      },
+      {
+        "value": "120115",
+        "label": "宝坻区",
+        "children": null
+      },
+      {
+        "value": "120116",
+        "label": "滨海新区",
+        "children": null
+      },
+      {
+        "value": "120117",
+        "label": "宁河区",
+        "children": null
+      },
+      {
+        "value": "120118",
+        "label": "静海区",
+        "children": null
+      },
+      {
+        "value": "120119",
+        "label": "蓟州区",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "130000",
+    "label": "河北省",
+    "children": [
+      {
+        "value": "130100",
+        "label": "石家庄市",
+        "children": null
+      },
+      {
+        "value": "130200",
+        "label": "唐山市",
+        "children": null
+      },
+      {
+        "value": "130300",
+        "label": "秦皇岛市",
+        "children": null
+      },
+      {
+        "value": "130400",
+        "label": "邯郸市",
+        "children": null
+      },
+      {
+        "value": "130500",
+        "label": "邢台市",
+        "children": null
+      },
+      {
+        "value": "130600",
+        "label": "保定市",
+        "children": null
+      },
+      {
+        "value": "130700",
+        "label": "张家口市",
+        "children": null
+      },
+      {
+        "value": "130800",
+        "label": "承德市",
+        "children": null
+      },
+      {
+        "value": "130900",
+        "label": "沧州市",
+        "children": null
+      },
+      {
+        "value": "131000",
+        "label": "廊坊市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "140000",
+    "label": "山西省",
+    "children": [
+      {
+        "value": "140100",
+        "label": "太原市",
+        "children": null
+      },
+      {
+        "value": "140200",
+        "label": "大同市",
+        "children": null
+      },
+      {
+        "value": "140300",
+        "label": "阳泉市",
+        "children": null
+      },
+      {
+        "value": "140400",
+        "label": "长治市",
+        "children": null
+      },
+      {
+        "value": "140500",
+        "label": "晋城市",
+        "children": null
+      },
+      {
+        "value": "140600",
+        "label": "朔州市",
+        "children": null
+      },
+      {
+        "value": "140700",
+        "label": "晋中市",
+        "children": null
+      },
+      {
+        "value": "140800",
+        "label": "运城市",
+        "children": null
+      },
+      {
+        "value": "140900",
+        "label": "忻州市",
+        "children": null
+      },
+      {
+        "value": "141000",
+        "label": "临汾市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "150000",
+    "label": "内蒙古自治区",
+    "children": [
+      {
+        "value": "150100",
+        "label": "呼和浩特市",
+        "children": null
+      },
+      {
+        "value": "150200",
+        "label": "包头市",
+        "children": null
+      },
+      {
+        "value": "150300",
+        "label": "乌海市",
+        "children": null
+      },
+      {
+        "value": "150400",
+        "label": "赤峰市",
+        "children": null
+      },
+      {
+        "value": "150500",
+        "label": "通辽市",
+        "children": null
+      },
+      {
+        "value": "150600",
+        "label": "鄂尔多斯市",
+        "children": null
+      },
+      {
+        "value": "150700",
+        "label": "呼伦贝尔市",
+        "children": null
+      },
+      {
+        "value": "150800",
+        "label": "巴彦淖尔市",
+        "children": null
+      },
+      {
+        "value": "150900",
+        "label": "乌兰察布市",
+        "children": null
+      },
+      {
+        "value": "152200",
+        "label": "兴安盟",
+        "children": null
+      },
+      {
+        "value": "152500",
+        "label": "锡林郭勒盟",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "210000",
+    "label": "辽宁省",
+    "children": [
+      {
+        "value": "210100",
+        "label": "沈阳市",
+        "children": null
+      },
+      {
+        "value": "210200",
+        "label": "大连市",
+        "children": null
+      },
+      {
+        "value": "210300",
+        "label": "鞍山市",
+        "children": null
+      },
+      {
+        "value": "210400",
+        "label": "抚顺市",
+        "children": null
+      },
+      {
+        "value": "210500",
+        "label": "本溪市",
+        "children": null
+      },
+      {
+        "value": "210600",
+        "label": "丹东市",
+        "children": null
+      },
+      {
+        "value": "210700",
+        "label": "锦州市",
+        "children": null
+      },
+      {
+        "value": "210800",
+        "label": "营口市",
+        "children": null
+      },
+      {
+        "value": "210900",
+        "label": "阜新市",
+        "children": null
+      },
+      {
+        "value": "211000",
+        "label": "辽阳市",
+        "children": null
+      },
+      {
+        "value": "211100",
+        "label": "盘锦市",
+        "children": null
+      },
+      {
+        "value": "211200",
+        "label": "铁岭市",
+        "children": null
+      },
+      {
+        "value": "211300",
+        "label": "朝阳市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "220000",
+    "label": "吉林省",
+    "children": [
+      {
+        "value": "220100",
+        "label": "长春市",
+        "children": null
+      },
+      {
+        "value": "220200",
+        "label": "吉林市",
+        "children": null
+      },
+      {
+        "value": "220300",
+        "label": "四平市",
+        "children": null
+      },
+      {
+        "value": "220400",
+        "label": "辽源市",
+        "children": null
+      },
+      {
+        "value": "220500",
+        "label": "通化市",
+        "children": null
+      },
+      {
+        "value": "220600",
+        "label": "白山市",
+        "children": null
+      },
+      {
+        "value": "220700",
+        "label": "松原市",
+        "children": null
+      },
+      {
+        "value": "220800",
+        "label": "白城市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "230000",
+    "label": "黑龙江省",
+    "children": [
+      {
+        "value": "230100",
+        "label": "哈尔滨市",
+        "children": null
+      },
+      {
+        "value": "230200",
+        "label": "齐齐哈尔市",
+        "children": null
+      },
+      {
+        "value": "230300",
+        "label": "鸡西市",
+        "children": null
+      },
+      {
+        "value": "230400",
+        "label": "鹤岗市",
+        "children": null
+      },
+      {
+        "value": "230500",
+        "label": "双鸭山市",
+        "children": null
+      },
+      {
+        "value": "230600",
+        "label": "大庆市",
+        "children": null
+      },
+      {
+        "value": "230700",
+        "label": "伊春市",
+        "children": null
+      },
+      {
+        "value": "230800",
+        "label": "佳木斯市",
+        "children": null
+      },
+      {
+        "value": "230900",
+        "label": "七台河市",
+        "children": null
+      },
+      {
+        "value": "231000",
+        "label": "牡丹江市",
+        "children": null
+      },
+      {
+        "value": "231100",
+        "label": "黑河市",
+        "children": null
+      },
+      {
+        "value": "231200",
+        "label": "绥化市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "310000",
+    "label": "上海市",
+    "children": [
+      {
+        "value": "310101",
+        "label": "黄浦区",
+        "children": null
+      },
+      {
+        "value": "310104",
+        "label": "徐汇区",
+        "children": null
+      },
+      {
+        "value": "310105",
+        "label": "长宁区",
+        "children": null
+      },
+      {
+        "value": "310106",
+        "label": "静安区",
+        "children": null
+      },
+      {
+        "value": "310107",
+        "label": "普陀区",
+        "children": null
+      },
+      {
+        "value": "310109",
+        "label": "虹口区",
+        "children": null
+      },
+      {
+        "value": "310110",
+        "label": "杨浦区",
+        "children": null
+      },
+      {
+        "value": "310112",
+        "label": "闵行区",
+        "children": null
+      },
+      {
+        "value": "310113",
+        "label": "宝山区",
+        "children": null
+      },
+      {
+        "value": "310114",
+        "label": "嘉定区",
+        "children": null
+      },
+      {
+        "value": "310115",
+        "label": "浦东新区",
+        "children": null
+      },
+      {
+        "value": "310116",
+        "label": "金山区",
+        "children": null
+      },
+      {
+        "value": "310117",
+        "label": "松江区",
+        "children": null
+      },
+      {
+        "value": "310118",
+        "label": "青浦区",
+        "children": null
+      },
+      {
+        "value": "310120",
+        "label": "奉贤区",
+        "children": null
+      },
+      {
+        "value": "310151",
+        "label": "崇明区",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "320000",
+    "label": "江苏省",
+    "children": [
+      {
+        "value": "320100",
+        "label": "南京市",
+        "children": null
+      },
+      {
+        "value": "320200",
+        "label": "无锡市",
+        "children": null
+      },
+      {
+        "value": "320300",
+        "label": "徐州市",
+        "children": null
+      },
+      {
+        "value": "320400",
+        "label": "常州市",
+        "children": null
+      },
+      {
+        "value": "320500",
+        "label": "苏州市",
+        "children": null
+      },
+      {
+        "value": "320600",
+        "label": "南通市",
+        "children": null
+      },
+      {
+        "value": "320700",
+        "label": "连云港市",
+        "children": null
+      },
+      {
+        "value": "320800",
+        "label": "淮安市",
+        "children": null
+      },
+      {
+        "value": "320900",
+        "label": "盐城市",
+        "children": null
+      },
+      {
+        "value": "321000",
+        "label": "扬州市",
+        "children": null
+      },
+      {
+        "value": "321100",
+        "label": "镇江市",
+        "children": null
+      },
+      {
+        "value": "321200",
+        "label": "泰州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "350000",
+    "label": "福建省",
+    "children": [
+      {
+        "value": "350100",
+        "label": "福州市",
+        "children": null
+      },
+      {
+        "value": "350200",
+        "label": "厦门市",
+        "children": null
+      },
+      {
+        "value": "350300",
+        "label": "莆田市",
+        "children": null
+      },
+      {
+        "value": "350400",
+        "label": "三明市",
+        "children": null
+      },
+      {
+        "value": "350500",
+        "label": "泉州市",
+        "children": null
+      },
+      {
+        "value": "350600",
+        "label": "漳州市",
+        "children": null
+      },
+      {
+        "value": "350700",
+        "label": "南平市",
+        "children": null
+      },
+      {
+        "value": "350800",
+        "label": "龙岩市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "330000",
+    "label": "浙江省",
+    "children": [
+      {
+        "value": "330100",
+        "label": "杭州市",
+        "children": null
+      },
+      {
+        "value": "330200",
+        "label": "宁波市",
+        "children": null
+      },
+      {
+        "value": "330300",
+        "label": "温州市",
+        "children": null
+      },
+      {
+        "value": "330400",
+        "label": "嘉兴市",
+        "children": null
+      },
+      {
+        "value": "330500",
+        "label": "湖州市",
+        "children": null
+      },
+      {
+        "value": "330600",
+        "label": "绍兴市",
+        "children": null
+      },
+      {
+        "value": "330700",
+        "label": "金华市",
+        "children": null
+      },
+      {
+        "value": "330800",
+        "label": "衢州市",
+        "children": null
+      },
+      {
+        "value": "330900",
+        "label": "舟山市",
+        "children": null
+      },
+      {
+        "value": "331000",
+        "label": "台州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "360000",
+    "label": "江西省",
+    "children": [
+      {
+        "value": "360100",
+        "label": "南昌市",
+        "children": null
+      },
+      {
+        "value": "360200",
+        "label": "景德镇市",
+        "children": null
+      },
+      {
+        "value": "360300",
+        "label": "萍乡市",
+        "children": null
+      },
+      {
+        "value": "360400",
+        "label": "九江市",
+        "children": null
+      },
+      {
+        "value": "360500",
+        "label": "新余市",
+        "children": null
+      },
+      {
+        "value": "360600",
+        "label": "鹰潭市",
+        "children": null
+      },
+      {
+        "value": "360700",
+        "label": "赣州市",
+        "children": null
+      },
+      {
+        "value": "360800",
+        "label": "吉安市",
+        "children": null
+      },
+      {
+        "value": "360900",
+        "label": "宜春市",
+        "children": null
+      },
+      {
+        "value": "361000",
+        "label": "抚州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "370000",
+    "label": "山东省",
+    "children": [
+      {
+        "value": "370100",
+        "label": "济南市",
+        "children": null
+      },
+      {
+        "value": "370200",
+        "label": "青岛市",
+        "children": null
+      },
+      {
+        "value": "370300",
+        "label": "淄博市",
+        "children": null
+      },
+      {
+        "value": "370400",
+        "label": "枣庄市",
+        "children": null
+      },
+      {
+        "value": "370500",
+        "label": "东营市",
+        "children": null
+      },
+      {
+        "value": "370600",
+        "label": "烟台市",
+        "children": null
+      },
+      {
+        "value": "370700",
+        "label": "潍坊市",
+        "children": null
+      },
+      {
+        "value": "370800",
+        "label": "济宁市",
+        "children": null
+      },
+      {
+        "value": "370900",
+        "label": "泰安市",
+        "children": null
+      },
+      {
+        "value": "371000",
+        "label": "威海市",
+        "children": null
+      },
+      {
+        "value": "371100",
+        "label": "日照市",
+        "children": null
+      },
+      {
+        "value": "371300",
+        "label": "临沂市",
+        "children": null
+      },
+      {
+        "value": "371400",
+        "label": "德州市",
+        "children": null
+      },
+      {
+        "value": "371500",
+        "label": "聊城市",
+        "children": null
+      },
+      {
+        "value": "371600",
+        "label": "滨州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "410000",
+    "label": "河南省",
+    "children": [
+      {
+        "value": "410100",
+        "label": "郑州市",
+        "children": null
+      },
+      {
+        "value": "410200",
+        "label": "开封市",
+        "children": null
+      },
+      {
+        "value": "410300",
+        "label": "洛阳市",
+        "children": null
+      },
+      {
+        "value": "410400",
+        "label": "平顶山市",
+        "children": null
+      },
+      {
+        "value": "410500",
+        "label": "安阳市",
+        "children": null
+      },
+      {
+        "value": "410600",
+        "label": "鹤壁市",
+        "children": null
+      },
+      {
+        "value": "410700",
+        "label": "新乡市",
+        "children": null
+      },
+      {
+        "value": "410800",
+        "label": "焦作市",
+        "children": null
+      },
+      {
+        "value": "410900",
+        "label": "濮阳市",
+        "children": null
+      },
+      {
+        "value": "411000",
+        "label": "许昌市",
+        "children": null
+      },
+      {
+        "value": "411100",
+        "label": "漯河市",
+        "children": null
+      },
+      {
+        "value": "411200",
+        "label": "三门峡市",
+        "children": null
+      },
+      {
+        "value": "411300",
+        "label": "南阳市",
+        "children": null
+      },
+      {
+        "value": "411400",
+        "label": "商丘市",
+        "children": null
+      },
+      {
+        "value": "411500",
+        "label": "信阳市",
+        "children": null
+      },
+      {
+        "value": "411600",
+        "label": "周口市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "420000",
+    "label": "湖北省",
+    "children": [
+      {
+        "value": "420100",
+        "label": "武汉市",
+        "children": null
+      },
+      {
+        "value": "420200",
+        "label": "黄石市",
+        "children": null
+      },
+      {
+        "value": "420300",
+        "label": "十堰市",
+        "children": null
+      },
+      {
+        "value": "420500",
+        "label": "宜昌市",
+        "children": null
+      },
+      {
+        "value": "420600",
+        "label": "襄阳市",
+        "children": null
+      },
+      {
+        "value": "420700",
+        "label": "鄂州市",
+        "children": null
+      },
+      {
+        "value": "420800",
+        "label": "荆门市",
+        "children": null
+      },
+      {
+        "value": "420900",
+        "label": "孝感市",
+        "children": null
+      },
+      {
+        "value": "421000",
+        "label": "荆州市",
+        "children": null
+      },
+      {
+        "value": "421100",
+        "label": "黄冈市",
+        "children": null
+      },
+      {
+        "value": "421200",
+        "label": "咸宁市",
+        "children": null
+      },
+      {
+        "value": "421300",
+        "label": "随州市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "430000",
+    "label": "湖南省",
+    "children": [
+      {
+        "value": "430100",
+        "label": "长沙市",
+        "children": null
+      },
+      {
+        "value": "430200",
+        "label": "株洲市",
+        "children": null
+      },
+      {
+        "value": "430300",
+        "label": "湘潭市",
+        "children": null
+      },
+      {
+        "value": "430400",
+        "label": "衡阳市",
+        "children": null
+      },
+      {
+        "value": "430500",
+        "label": "邵阳市",
+        "children": null
+      },
+      {
+        "value": "430600",
+        "label": "岳阳市",
+        "children": null
+      },
+      {
+        "value": "430700",
+        "label": "常德市",
+        "children": null
+      },
+      {
+        "value": "430800",
+        "label": "张家界市",
+        "children": null
+      },
+      {
+        "value": "430900",
+        "label": "益阳市",
+        "children": null
+      },
+      {
+        "value": "431000",
+        "label": "郴州市",
+        "children": null
+      },
+      {
+        "value": "431100",
+        "label": "永州市",
+        "children": null
+      },
+      {
+        "value": "431200",
+        "label": "怀化市",
+        "children": null
+      },
+      {
+        "value": "431300",
+        "label": "娄底市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "440000",
+    "label": "广东省",
+    "children": [
+      {
+        "value": "440100",
+        "label": "广州市",
+        "children": null
+      },
+      {
+        "value": "440200",
+        "label": "韶关市",
+        "children": null
+      },
+      {
+        "value": "440300",
+        "label": "深圳市",
+        "children": null
+      },
+      {
+        "value": "440400",
+        "label": "珠海市",
+        "children": null
+      },
+      {
+        "value": "440500",
+        "label": "汕头市",
+        "children": null
+      },
+      {
+        "value": "440600",
+        "label": "佛山市",
+        "children": null
+      },
+      {
+        "value": "440700",
+        "label": "江门市",
+        "children": null
+      },
+      {
+        "value": "440800",
+        "label": "湛江市",
+        "children": null
+      },
+      {
+        "value": "440900",
+        "label": "茂名市",
+        "children": null
+      },
+      {
+        "value": "441200",
+        "label": "肇庆市",
+        "children": null
+      },
+      {
+        "value": "441300",
+        "label": "惠州市",
+        "children": null
+      },
+      {
+        "value": "441400",
+        "label": "梅州市",
+        "children": null
+      },
+      {
+        "value": "441500",
+        "label": "汕尾市",
+        "children": null
+      },
+      {
+        "value": "441600",
+        "label": "河源市",
+        "children": null
+      },
+      {
+        "value": "441700",
+        "label": "阳江市",
+        "children": null
+      },
+      {
+        "value": "441800",
+        "label": "清远市",
+        "children": null
+      },
+      {
+        "value": "445100",
+        "label": "潮州市",
+        "children": null
+      },
+      {
+        "value": "445200",
+        "label": "揭阳市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "450000",
+    "label": "广西壮族自治区",
+    "children": [
+      {
+        "value": "450100",
+        "label": "南宁市",
+        "children": null
+      },
+      {
+        "value": "450200",
+        "label": "柳州市",
+        "children": null
+      },
+      {
+        "value": "450300",
+        "label": "桂林市",
+        "children": null
+      },
+      {
+        "value": "450400",
+        "label": "梧州市",
+        "children": null
+      },
+      {
+        "value": "450500",
+        "label": "北海市",
+        "children": null
+      },
+      {
+        "value": "450600",
+        "label": "防城港市",
+        "children": null
+      },
+      {
+        "value": "450700",
+        "label": "钦州市",
+        "children": null
+      },
+      {
+        "value": "450800",
+        "label": "贵港市",
+        "children": null
+      },
+      {
+        "value": "450900",
+        "label": "玉林市",
+        "children": null
+      },
+      {
+        "value": "451000",
+        "label": "百色市",
+        "children": null
+      },
+      {
+        "value": "451100",
+        "label": "贺州市",
+        "children": null
+      },
+      {
+        "value": "451200",
+        "label": "河池市",
+        "children": null
+      },
+      {
+        "value": "451300",
+        "label": "来宾市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "460000",
+    "label": "海南省",
+    "children": [
+      {
+        "value": "460100",
+        "label": "海口市",
+        "children": null
+      },
+      {
+        "value": "460200",
+        "label": "三亚市",
+        "children": null
+      },
+      {
+        "value": "460300",
+        "label": "三沙市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "500000",
+    "label": "重庆市",
+    "children": [
+      {
+        "value": "500101",
+        "label": "万州区",
+        "children": null
+      },
+      {
+        "value": "500102",
+        "label": "涪陵区",
+        "children": null
+      },
+      {
+        "value": "500103",
+        "label": "渝中区",
+        "children": null
+      },
+      {
+        "value": "500104",
+        "label": "大渡口区",
+        "children": null
+      },
+      {
+        "value": "500105",
+        "label": "江北区",
+        "children": null
+      },
+      {
+        "value": "500106",
+        "label": "沙坪坝区",
+        "children": null
+      },
+      {
+        "value": "500107",
+        "label": "九龙坡区",
+        "children": null
+      },
+      {
+        "value": "500108",
+        "label": "南岸区",
+        "children": null
+      },
+      {
+        "value": "500109",
+        "label": "北碚区",
+        "children": null
+      },
+      {
+        "value": "500110",
+        "label": "綦江区",
+        "children": null
+      },
+      {
+        "value": "500111",
+        "label": "大足区",
+        "children": null
+      },
+      {
+        "value": "500112",
+        "label": "渝北区",
+        "children": null
+      },
+      {
+        "value": "500113",
+        "label": "巴南区",
+        "children": null
+      },
+      {
+        "value": "500114",
+        "label": "黔江区",
+        "children": null
+      },
+      {
+        "value": "500115",
+        "label": "长寿区",
+        "children": null
+      },
+      {
+        "value": "500116",
+        "label": "江津区",
+        "children": null
+      },
+      {
+        "value": "500117",
+        "label": "合川区",
+        "children": null
+      },
+      {
+        "value": "500118",
+        "label": "永川区",
+        "children": null
+      },
+      {
+        "value": "500119",
+        "label": "南川区",
+        "children": null
+      },
+      {
+        "value": "500120",
+        "label": "璧山区",
+        "children": null
+      },
+      {
+        "value": "500151",
+        "label": "铜梁区",
+        "children": null
+      },
+      {
+        "value": "500152",
+        "label": "潼南区",
+        "children": null
+      },
+      {
+        "value": "500153",
+        "label": "荣昌区",
+        "children": null
+      },
+      {
+        "value": "500154",
+        "label": "开州区",
+        "children": null
+      },
+      {
+        "value": "500155",
+        "label": "梁平区",
+        "children": null
+      },
+      {
+        "value": "500156",
+        "label": "武隆区",
+        "children": null
+      },
+      {
+        "value": "500229",
+        "label": "城口县",
+        "children": null
+      },
+      {
+        "value": "500230",
+        "label": "丰都县",
+        "children": null
+      },
+      {
+        "value": "500231",
+        "label": "垫江县",
+        "children": null
+      },
+      {
+        "value": "500233",
+        "label": "忠县",
+        "children": null
+      },
+      {
+        "value": "500235",
+        "label": "云阳县",
+        "children": null
+      },
+      {
+        "value": "500236",
+        "label": "奉节县",
+        "children": null
+      },
+      {
+        "value": "500237",
+        "label": "巫山县",
+        "children": null
+      },
+      {
+        "value": "500238",
+        "label": "巫溪县",
+        "children": null
+      },
+      {
+        "value": "500240",
+        "label": "石柱土家族自治县",
+        "children": null
+      },
+      {
+        "value": "500241",
+        "label": "秀山土家族苗族自治县",
+        "children": null
+      },
+      {
+        "value": "500242",
+        "label": "酉阳土家族苗族自治县",
+        "children": null
+      },
+      {
+        "value": "500243",
+        "label": "彭水苗族土家族自治县",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "510000",
+    "label": "四川省",
+    "children": [
+      {
+        "value": "510100",
+        "label": "成都市",
+        "children": null
+      },
+      {
+        "value": "510300",
+        "label": "自贡市",
+        "children": null
+      },
+      {
+        "value": "510400",
+        "label": "攀枝花市",
+        "children": null
+      },
+      {
+        "value": "510500",
+        "label": "泸州市",
+        "children": null
+      },
+      {
+        "value": "510600",
+        "label": "德阳市",
+        "children": null
+      },
+      {
+        "value": "510700",
+        "label": "绵阳市",
+        "children": null
+      },
+      {
+        "value": "510800",
+        "label": "广元市",
+        "children": null
+      },
+      {
+        "value": "510900",
+        "label": "遂宁市",
+        "children": null
+      },
+      {
+        "value": "511000",
+        "label": "内江市",
+        "children": null
+      },
+      {
+        "value": "511100",
+        "label": "乐山市",
+        "children": null
+      },
+      {
+        "value": "511300",
+        "label": "南充市",
+        "children": null
+      },
+      {
+        "value": "511400",
+        "label": "眉山市",
+        "children": null
+      },
+      {
+        "value": "511500",
+        "label": "宜宾市",
+        "children": null
+      },
+      {
+        "value": "511600",
+        "label": "广安市",
+        "children": null
+      },
+      {
+        "value": "511700",
+        "label": "达州市",
+        "children": null
+      },
+      {
+        "value": "511800",
+        "label": "雅安市",
+        "children": null
+      },
+      {
+        "value": "511900",
+        "label": "巴中市",
+        "children": null
+      },
+      {
+        "value": "512000",
+        "label": "资阳市",
+        "children": null
+      },
+      {
+        "value": "513200",
+        "label": "阿坝藏族羌族自治州",
+        "children": null
+      },
+      {
+        "value": "513300",
+        "label": "甘孜藏族自治州",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "520000",
+    "label": "贵州省",
+    "children": [
+      {
+        "value": "520100",
+        "label": "贵阳市",
+        "children": null
+      },
+      {
+        "value": "520200",
+        "label": "六盘水市",
+        "children": null
+      },
+      {
+        "value": "520300",
+        "label": "遵义市",
+        "children": null
+      },
+      {
+        "value": "520400",
+        "label": "安顺市",
+        "children": null
+      },
+      {
+        "value": "520500",
+        "label": "毕节市",
+        "children": null
+      },
+      {
+        "value": "520600",
+        "label": "铜仁市",
+        "children": null
+      },
+      {
+        "value": "522300",
+        "label": "黔西南布依族苗族自治州",
+        "children": null
+      },
+      {
+        "value": "522600",
+        "label": "黔东南苗族侗族自治州",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "530000",
+    "label": "云南省",
+    "children": [
+      {
+        "value": "530100",
+        "label": "昆明市",
+        "children": null
+      },
+      {
+        "value": "530300",
+        "label": "曲靖市",
+        "children": null
+      },
+      {
+        "value": "530400",
+        "label": "玉溪市",
+        "children": null
+      },
+      {
+        "value": "530500",
+        "label": "保山市",
+        "children": null
+      },
+      {
+        "value": "530600",
+        "label": "昭通市",
+        "children": null
+      },
+      {
+        "value": "530700",
+        "label": "丽江市",
+        "children": null
+      },
+      {
+        "value": "530800",
+        "label": "普洱市",
+        "children": null
+      },
+      {
+        "value": "530900",
+        "label": "临沧市",
+        "children": null
+      },
+      {
+        "value": "532300",
+        "label": "楚雄彝族自治州",
+        "children": null
+      },
+      {
+        "value": "532500",
+        "label": "红河哈尼族彝族自治州",
+        "children": null
+      },
+      {
+        "value": "532600",
+        "label": "文山壮族苗族自治州",
+        "children": null
+      },
+      {
+        "value": "532800",
+        "label": "西双版纳傣族自治州",
+        "children": null
+      },
+      {
+        "value": "532900",
+        "label": "大理白族自治州",
+        "children": null
+      },
+      {
+        "value": "533100",
+        "label": "德宏傣族景颇族自治州",
+        "children": null
+      },
+      {
+        "value": "533300",
+        "label": "怒江傈僳族自治州",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "540000",
+    "label": "西藏自治区",
+    "children": [
+      {
+        "value": "540100",
+        "label": "拉萨市",
+        "children": null
+      },
+      {
+        "value": "540200",
+        "label": "日喀则市",
+        "children": null
+      },
+      {
+        "value": "540300",
+        "label": "昌都市",
+        "children": null
+      },
+      {
+        "value": "540400",
+        "label": "林芝市",
+        "children": null
+      },
+      {
+        "value": "540500",
+        "label": "山南市",
+        "children": null
+      },
+      {
+        "value": "540600",
+        "label": "那曲市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "610000",
+    "label": "陕西省",
+    "children": [
+      {
+        "value": "610100",
+        "label": "西安市",
+        "children": null
+      },
+      {
+        "value": "610200",
+        "label": "铜川市",
+        "children": null
+      },
+      {
+        "value": "610300",
+        "label": "宝鸡市",
+        "children": null
+      },
+      {
+        "value": "610400",
+        "label": "咸阳市",
+        "children": null
+      },
+      {
+        "value": "610500",
+        "label": "渭南市",
+        "children": null
+      },
+      {
+        "value": "610600",
+        "label": "延安市",
+        "children": null
+      },
+      {
+        "value": "610700",
+        "label": "汉中市",
+        "children": null
+      },
+      {
+        "value": "610800",
+        "label": "榆林市",
+        "children": null
+      },
+      {
+        "value": "610900",
+        "label": "安康市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "620000",
+    "label": "甘肃省",
+    "children": [
+      {
+        "value": "620100",
+        "label": "兰州市",
+        "children": null
+      },
+      {
+        "value": "620300",
+        "label": "金昌市",
+        "children": null
+      },
+      {
+        "value": "620400",
+        "label": "白银市",
+        "children": null
+      },
+      {
+        "value": "620500",
+        "label": "天水市",
+        "children": null
+      },
+      {
+        "value": "620600",
+        "label": "武威市",
+        "children": null
+      },
+      {
+        "value": "620700",
+        "label": "张掖市",
+        "children": null
+      },
+      {
+        "value": "620800",
+        "label": "平凉市",
+        "children": null
+      },
+      {
+        "value": "620900",
+        "label": "酒泉市",
+        "children": null
+      },
+      {
+        "value": "621000",
+        "label": "庆阳市",
+        "children": null
+      },
+      {
+        "value": "621100",
+        "label": "定西市",
+        "children": null
+      },
+      {
+        "value": "621200",
+        "label": "陇南市",
+        "children": null
+      },
+      {
+        "value": "622900",
+        "label": "临夏回族自治州",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "630000",
+    "label": "青海省",
+    "children": [
+      {
+        "value": "630100",
+        "label": "西宁市",
+        "children": null
+      },
+      {
+        "value": "630200",
+        "label": "海东市",
+        "children": null
+      },
+      {
+        "value": "632200",
+        "label": "海北藏族自治州",
+        "children": null
+      },
+      {
+        "value": "632300",
+        "label": "黄南藏族自治州",
+        "children": null
+      },
+      {
+        "value": "632500",
+        "label": "海南藏族自治州",
+        "children": null
+      },
+      {
+        "value": "632600",
+        "label": "果洛藏族自治州",
+        "children": null
+      },
+      {
+        "value": "632700",
+        "label": "玉树藏族自治州",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "640000",
+    "label": "宁夏回族自治区",
+    "children": [
+      {
+        "value": "640100",
+        "label": "银川市",
+        "children": null
+      },
+      {
+        "value": "640200",
+        "label": "石嘴山市",
+        "children": null
+      },
+      {
+        "value": "640300",
+        "label": "吴忠市",
+        "children": null
+      },
+      {
+        "value": "640400",
+        "label": "固原市",
+        "children": null
+      }
+    ]
+  },
+  {
+    "value": "710000",
+    "label": "台湾省",
+    "children": null
+  },
+  {
+    "value": "810000",
+    "label": "香港特别行政区",
+    "children": null
+  },
+  {
+    "value": "820000",
+    "label": "澳门特别行政区",
+    "children": null
+  }
+]

Diff do ficheiro suprimidas por serem muito extensas
+ 2 - 0
src/api/city2.js


+ 50 - 0
src/api/count.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+
+// 查询交易统计
+export function getPayCount(query) {
+  return request({
+    url: '/system/stats/getMerchantStats',
+    method: 'get',
+    params: query
+  })
+}
+// 查询商户统计日
+export function getMerchantDailyStats(query) {
+  return request({
+    url: '/system/stats/getMerchantDailyStats',
+    method: 'get',
+    params: query
+  })
+}
+// 查询商户统计月
+export function getMerchantMonthStats(query) {
+  return request({
+    url: '/system/stats/getMerchantMonthStats',
+    method: 'get',
+    params: query
+  })
+}
+// 查询门店统计
+export function getStoreCount(query) {
+  return request({
+    url: '/system/stats/getStoreStats',
+    method: 'get',
+    params: query
+  })
+}
+// 查询班级统计
+export function getSchoolClassStats(query) {
+  return request({
+    url: '/system/stats/getSchoolClassStats',
+    method: 'get',
+    params: query
+  })
+}
+// 查询用餐统计
+export function getSchoolMealStats(query) {
+  return request({
+    url: '/system/stats/getSchoolMealStats',
+    method: 'get',
+    params: query
+  })
+}

+ 122 - 0
src/api/dept.js

@@ -0,0 +1,122 @@
+import request from '@/utils/request'
+
+// 获取学校部门列表
+export function getDeptList(query) {
+  return request({
+    url: '/system/schoolDept/list',
+    method: 'get',
+    params: query
+  })
+}
+// 新增学校部门
+export function addSchoolDept(data) {
+  return request({
+    url: '/system/schoolDept/add',
+    method: 'post',
+    data: data
+  })
+}
+// 修改学校部门
+export function updateSchool(query) {
+  return request({
+    url: '/system/schoolDept/update',
+    method: 'post',
+    data: query
+  })
+}
+// 修改人员部门
+export function updateSchoolDeptUser(query) {
+  return request({
+    url: '/system/schoolDept/updateMemberDept',
+    method: 'post',
+    data: query
+  })
+}
+
+// 新增人员部门
+export function addSchoolDeptUser(query) {
+  return request({
+    url: '/system/schoolDept/addMemberDept',
+    method: 'post',
+    data: query
+  })
+}
+//删除学校部门
+export function deleteSchoolDept(query) {
+  return request({
+    url: '/system/schoolDept/delete/'+query,
+    method: 'DELETE'
+  })
+}
+
+//查询教育分类
+export function getClassType(query) {
+  return request({
+    url: '/system/class/getEduType/'+query,
+    method: 'get'
+  })
+}
+
+// 初始化年级和班级
+export function initClass(query) {
+  return request({
+    url: '/system/class/init',
+    method: 'post',
+    data: query
+  })
+}
+// 获取班级年级列表
+export function getClassList(query) {
+  return request({
+    url: '/system/class/list',
+    method: 'get',
+    params: query
+  })
+}
+// 获取班级树
+export function getClassTree(query) {
+  return request({
+    url: '/system/class/tree',
+    method: 'get',
+    params: query
+  })
+}
+// 添加班级
+export function addClass(query) {
+  return request({
+    url: '/system/class/addClass',
+    method: 'post',
+    data: query
+  })
+}
+// 添加-删除班级管理员
+export function updateClassManager(query) {
+  return request({
+    url: '/system/class/updateClassManager',
+    method: 'post',
+    data: query
+  })
+}
+//删除班级
+export function deleteClass(query) {
+  return request({
+    url: '/system/class/deleteClass/'+query,
+    method: 'DELETE'
+  })
+}
+
+//删除年级
+export function deleteGrade(query) {
+  return request({
+    url: '/system/class/deleteGrade/'+query,
+    method: 'DELETE'
+  })
+}
+// 获取部门字典
+export function getDeptDict(query) {
+  return request({
+    url: '/system/schoolDept/getDeptDict',
+    method: 'get',
+    params: query
+  })
+}

+ 56 - 0
src/api/login.js

@@ -0,0 +1,56 @@
+import request from '@/utils/request'
+
+// 登录方法
+export function login(username, password, code, uuid) {
+  const data = {
+    username,
+    password,
+    code,
+    uuid
+  }
+  return request({
+    url: '/auth/login',
+    method: 'post',
+    data: data
+  })
+}
+
+// 注册方法
+export function register(data) {
+  return request({
+    url: '/register',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取用户详细信息
+export function getInfo() {
+  return request({
+    url: '/system/user/getInfo',
+    method: 'get'
+  })
+}
+
+// 退出方法
+export function logout() {
+  return request({
+    url: '/auth/logout',
+    method: 'DELETE'
+  })
+}
+
+// 获取验证码
+export function getCodeImg() {
+  return request({
+    url: '/captchaImage',
+    headers: {
+      isToken: false
+    },
+    method: 'get',
+    timeout: 20000
+  })
+}

+ 9 - 0
src/api/menu.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 获取路由
+export const getRouters = () => {
+  return request({
+    url: '/system/menu/getRouters',
+    method: 'get'
+  })
+}

+ 516 - 0
src/api/rules.js

@@ -0,0 +1,516 @@
+//1、是否合法IP地址
+export function validateIP(rule, value,callback) {
+    if(value==''||value==undefined||value==null){
+        callback();
+    }else {
+        const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
+        if ((!reg.test(value)) && value != '') {
+            callback(new Error('请输入正确的IP地址'));
+        } else {
+            callback();
+        }
+    }
+}
+//2、是否手机号码或者固话
+export function validatePhoneTwo(rule, value, callback) {
+    const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/;;
+    if (value == '' || value == undefined || value == null) {
+        callback(new Error('请输入电话号码或者固话号码'));
+    } else {
+        if ((!reg.test(value)) && value != '') {
+            callback(new Error('请输入正确的电话号码或者固话号码'));
+        } else {
+            callback();
+        }
+    }
+}
+//3、是否固话
+export function validateTelphone(rule, value,callback) {
+    const reg =/0\d{2,3}-\d{7,8}/;
+    if(value==''||value==undefined||value==null){
+        callback();
+    }else {
+        if ((!reg.test(value)) && value != '') {
+            callback(new Error('请输入正确的固定电话)'));
+        } else {
+            callback();
+        }
+    }
+}
+//4、是否手机号码
+export function validatePhone(rule, value,callback) {
+    const reg =/^[1][3-9][0-9]{9}$/;
+    if(value==''||value==undefined||value==null){
+        callback();
+    }else {
+        if ((!reg.test(value)) && value != '') {
+            callback(new Error('请输入正确的电话号码'));
+        } else {
+            callback();
+        }
+    }
+}
+//5、是否身份证号码
+export function validateIdNo(rule, value,callback) {
+    const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
+    if(value==''||value==undefined||value==null){
+        callback();
+    }else {
+        if ((!reg.test(value)) && value != '') {
+            callback(new Error('请输入正确的身份证号码'));
+        } else {
+            callback();
+        }
+    }
+}
+//6、是否邮箱
+export function validateEMail(rule, value,callback) {
+    const reg =/^([a-zA-Z0-9]+[-_\.]?)+@[a-zA-Z0-9]+\.[a-z]+$/;
+    if(value==''||value==undefined||value==null){
+        callback();
+    }else{
+        if (!reg.test(value)){
+            callback(new Error('请输入正确的邮箱'));
+        } else {
+            callback();
+        }
+    }
+}
+//7、合法url
+export function validateURL(url) {
+    const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
+    return urlregex.test(url);
+}
+//8、验证内容是否包含英文数字以及下划线
+export function isPassword(rule, value, callback) {
+    const reg =/^[_a-zA-Z0-9]+$/;
+    if(value==''||value==undefined||value==null){
+        callback();
+    } else {
+        if (!reg.test(value)){
+            callback(new Error('仅由英文字母,数字以及下划线组成'));
+        } else {
+            callback();
+        }
+    }
+}
+//9、自动检验数值的范围
+export function checkMax20000(rule, value, callback) {
+    if (value == '' || value == undefined || value == null) {
+        callback();
+    } else if (!Number(value)) {
+        callback(new Error('请输入[1,20000]之间的数字'));
+    } else if (value < 1 || value > 20000) {
+        callback(new Error('请输入[1,20000]之间的数字'));
+    } else {
+        callback();
+    }
+}
+export function maxPayAmountRule(rule, value, callback) {
+  if (value == '' || value == undefined || value == null) {
+    callback();
+  } else if (!Number(value)) {
+    callback(new Error('请输入[0,9999]之间的数字'));
+  } else if (value < 0 || value > 9999) {
+    callback(new Error('请输入[0,9999]之间的数字'));
+  } else {
+    callback();
+  }
+}
+//10、验证数字输入框最大数值
+export function checkMaxVal(rule, value,callback) {
+    if (value < 0 || value > 最大值) {
+        callback(new Error('请输入[0,最大值]之间的数字'));
+    } else {
+        callback();
+    }
+}
+//11、验证是否1-99之间
+export function isOneToNinetyNine(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入正整数'));
+        } else {
+            const re = /^[1-9][0-9]{0,1}$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入正整数,值为【1,99】'));
+            } else {
+                callback();
+            }
+        }
+    }, 0);
+}
+//12、验证是否整数
+export function isInteger(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入正整数'));
+        } else {
+            const re = /^[0-9]*[1-9][0-9]*$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入正整数'));
+            } else {
+                callback();
+            }
+        }
+    }, 0);
+}
+//13、验证是否整数,非必填
+export function isIntegerNotMust(rule, value, callback) {
+    if (!value) {
+        callback();
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入正整数'));
+        } else {
+            const re = /^[0-9]*[1-9][0-9]*$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入正整数'));
+            } else if(value > 20) {
+                callback(new Error('请输入小于20的正整数'));
+            }else {
+                callback();
+            }
+        }
+    }, 1000);
+}
+//13.1、验证是否整数,非必填
+export function maxArrearsCountRule(rule, value, callback) {
+    if (!value) {
+        callback();
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入正整数'));
+        } else {
+            const re = /^[0-9]*[1-9][0-9]*$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入正整数'));
+            } else if(value > 20) {
+                callback(new Error('请输入小于20的正整数'));
+            }else {
+                callback();
+            }
+        }
+    }, 1000);
+}
+export function maxOfflineOrdersRule(rule, value, callback) {
+  if (!value) {
+    callback();
+  }
+  setTimeout(() => {
+    if (!Number(value)) {
+      callback(new Error('请输入正整数'));
+    } else {
+      const re = /^[0-9]*[1-9][0-9]*$/;
+      const rsCheck = re.test(value);
+      if (!rsCheck) {
+        callback(new Error('请输入正整数'));
+      } else if(value > 50) {
+        callback(new Error('请输入小于50的正整数'));
+      }else {
+        callback();
+      }
+    }
+  }, 1000);
+}
+//14、 验证是否是[0-1]的小数
+export function isDecimal(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入[0,1]之间的数字'));
+        } else {
+            if (value < 0 || value > 1) {
+                callback(new Error('请输入[0,1]之间的数字'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//15、 验证是否是[1-10]的小数,即不可以等于0
+export function isBtnOneToTen(rule, value, callback) {
+    if (typeof value == 'undefined') {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入正整数,值为[1,10]'));
+        } else {
+            if (!(value == '1' || value == '2' || value == '3' || value == '4' || value == '5' || value == '6' || value == '7' || value == '8' || value == '9' || value == '10')) {
+                callback(new Error('请输入正整数,值为[1,10]'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//16、验证是否是[1-100]的小数,即不可以等于0
+export function isBtnOneToHundred(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入整数,值为[1,100]'));
+        } else {
+            if (value < 1 || value > 100) {
+                callback(new Error('请输入整数,值为[1,100]'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//17、验证是否是[0-100]的小数
+export function isBtnZeroToHundred(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (!Number(value)) {
+            callback(new Error('请输入[1,100]之间的数字'));
+        } else {
+            if (value < 0 || value > 100) {
+                callback(new Error('请输入[1,100]之间的数字'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//18、验证端口是否在[0,65535]之间
+export function isPort(rule, value, callback) {
+    if (!value) {
+        return callback(new Error('输入不可以为空'));
+    }
+    setTimeout(() => {
+        if (value == '' || typeof(value) == undefined) {
+            callback(new Error('请输入端口值'));
+        } else {
+            const re = /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入在[0-65535]之间的端口值'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//19、验证端口是否在[0,65535]之间,非必填,isMust表示是否必填
+export function isCheckPort(rule, value, callback) {
+    if (!value) {
+        callback();
+    }
+    setTimeout(() => {
+        if (value == '' || typeof(value) == undefined) {
+            //callback(new Error('请输入端口值'));
+        } else {
+            const re = /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/;
+            const rsCheck = re.test(value);
+            if (!rsCheck) {
+                callback(new Error('请输入在[0-65535]之间的端口值'));
+            } else {
+                callback();
+            }
+        }
+    }, 100);
+}
+//20、小写字母
+export function validateLowerCase(val) {
+    const reg = /^[a-z]+$/;
+    return reg.test(val);
+}
+//22、两位小数验证
+const validateValidity = (rule, value, callback) => {
+    if (!/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(value)) {
+        callback(new Error('最多两位小数!!!'));
+    } else {
+        callback();
+    }
+};
+//23、是否大写字母
+export function validateUpperCase(val) {
+    const reg = /^[A-Z]+$/;
+    return reg.test(val);
+}
+//24、是否大小写字母
+export function validatAlphabets(val) {
+    const reg = /^[A-Za-z]+$/;
+    return reg.test(val);
+}
+//25、密码校验
+export const validatePsdReg = (rule, value, callback) => {
+    if (!value) {
+        return callback(new Error('请输入密码'))
+    }
+    if (!/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$)([^\u4e00-\u9fa5\s]){6,20}$/.test(value)) {
+        callback(new Error('请输入6-20位英文字母、数字或者符号(除空格),且字母、数字和标点符号至少包含两种'))
+    } else {
+        callback()
+    }
+}
+//25.1、密码校验
+export const validatePsdReg2 = (rule, value, callback) => {
+  if (!value) {
+    return callback(new Error('请输入密码'))
+  }
+  if (!/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$)([^\u4e00-\u9fa5\s]){8,20}$/.test(value)) {
+    callback(new Error('请输入字母、数字或符号,且其中至少包含两种'))
+  } else {
+    callback()
+  }
+}
+//26、中文校验
+export const validateContacts = (rule, value, callback) => {
+    if (!value) {
+        return callback(new Error('请输入中文'))
+    }
+    if (!/^[\u0391-\uFFE5A-Za-z]+$/.test(value)) {
+        callback(new Error('不可输入特殊字符'))
+    } else {
+        callback()
+    }
+}
+//27、身份证校验
+export const ID = (rule, value, callback) => {
+    if (!value) {
+        return callback(new Error('身份证不能为空'))
+    }
+    if (! /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
+        callback(new Error('请输入正确的二代身份证号码'))
+    } else {
+        callback()
+    }
+}
+//28、 账号校验
+export const validateCode = (rule, value, callback) => {
+    if (!value) {
+        return callback(new Error('请输入账号'))
+    }
+    if (!/^[0-9a-zA-Z]{5,20}$/g.test(value)) {
+        callback(new Error('账号必须为5-20位字母或数字组合'))
+    } else {
+        callback()
+    }
+}
+//29 、纯数字校验
+export const validateNumber = (rule, value, callback) => {
+    let numberReg = /^\d+$|^\d+[.]?\d+$/
+    if (value !== '') {
+        if (!numberReg.test(value)) {
+            callback(new Error('请输入数字'))
+        } else {
+            callback()
+        }
+    } else {
+        callback(new Error('请输入值'))
+    }
+}
+//非中文
+const validateId = (rule, value, callback) => {
+  if (/[\u4E00-\u9FA5]/g.test(value)) {
+    callback(new Error("不能输入中文"));
+  }else {
+    callback();
+  }
+};
+
+//30、最多一位小数
+const onePoint = (rule, value, callback) => {
+    if (!/^[0-9]+([.]{1}[0-9]{1})?$/.test(value)) {
+        callback(new Error('最多一位小数!!!'));
+    } else {
+        callback();
+    }
+};
+//校验身份证号
+export function isIdentityId(rule, value, callback) {
+    let patrn = /(^\d{15}$)|(^\d{17}(\d|X|x)$)/;//长度或格式校验
+    //地区校验
+    let aCity = {
+        11: "北京",
+        12: "天津",
+        13: "河北",
+        14: "山西",
+        15: "内蒙古",
+        21: "辽宁",
+        22: "吉林",
+        23: "黑龙江",
+        31: "上海",
+        32: "江苏",
+        33: "浙江",
+        34: "安徽",
+        35: "福建",
+        36: "江西",
+        37: "山东",
+        41: "河南",
+        42: "湖北",
+        43: "湖南",
+        44: "广东",
+        45: "广西",
+        46: "海南",
+        50: "重庆",
+        51: "四川",
+        52: "贵州",
+        53: "云南",
+        54: "西藏",
+        61: "陕西",
+        62: "甘肃",
+        63: "青海",
+        64: "宁夏",
+        65: "新疆",
+        71: "台湾",
+        81: "香港",
+        82: "澳门",
+        91: "国外"
+    };
+    // 出生日期验证
+    let sBirthday = (
+            value.substr(6, 4) +
+            "-" +
+            Number(value.substr(10, 2)) +
+            "-" +
+            Number(value.substr(12, 2))
+        ).replace(/-/g, "/"),
+        d = new Date(sBirthday);
+    // 身份证号码校验 最后4位  包括最后一位的数字/字母X
+    let sum = 0,
+        weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
+        codes = "10X98765432";
+    for (let i = 0; i < value.length - 1; i++) {
+        sum += value[i] * weights[i];
+    }
+    let last = codes[sum % 11]; //计算出来的最后一位身份证号码
+
+    if (value === '') {
+        // callback(new Error('身份证号不能为空!'));
+        callback();
+    } else if (!patrn.exec(value)) {
+        callback(new Error('身份证长度或格式错误!'));
+    } else if (!aCity[parseInt(value.substr(0, 2))]) {
+        callback(new Error('身份证地区非法!'));
+    } else if (sBirthday != d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate()) {
+            callback(new Error('出生日期非法!')); }
+        else if (value[value.length - 1] != last) {
+            callback(new Error('身份证号错误!'));
+            // callback();
+    }else {
+        callback();
+    }
+}

+ 83 - 0
src/api/school.js

@@ -0,0 +1,83 @@
+import request from '@/utils/request'
+
+// 获取学校列表
+export function getSchoolList(query) {
+  return request({
+    url: '/system/school/list',
+    method: 'get',
+    params: query
+  })
+}
+//全部学校
+export function getSchoolAll(query) {
+  return request({
+    url: '/system/school/getAll',
+    method: 'get',
+    params: query
+  })
+}
+//查询支付宝学校
+export function getAliSchool(query) {
+  return request({
+    url: '/system/school/getAlipaySchool',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增学校
+export function addSchool(data) {
+  return request({
+    url: '/system/school/add',
+    method: 'post',
+    data: data
+  })
+}
+// 修改学校
+export function updateSchool(query) {
+  return request({
+    url: '/system/school/update',
+    method: 'post',
+    data: query
+  })
+}
+
+//查询学校详情
+export function getSchoolDetail(query) {
+  return request({
+    url: '/system/school/get/'+query,
+    method: 'get',
+    params: query
+  })
+}
+//是否可删除学校
+export function canDeleteSchool(query) {
+  return request({
+    url: '/system/school/canDelete/'+query,
+    method: 'get'
+  })
+}
+//删除学校
+export function deleteSchool(query) {
+  return request({
+    url: '/system/school/delete/'+query,
+    method: 'DELETE'
+  })
+}
+//查询支付设置
+export function getPayConfig(query) {
+  return request({
+    url: '/system/school/getPayConfig/'+query,
+    method: 'get',
+    params: query
+  })
+}
+
+// 修改学校支付配置
+export function updateSchoolPay(query) {
+  return request({
+    url: '/system/school/updatePayConfig',
+    method: 'post',
+    data: query
+  })
+}

+ 224 - 0
src/api/store.js

@@ -0,0 +1,224 @@
+import request from '@/utils/request'
+
+// 获取商户列表
+export function getStoreList(query) {
+  return request({
+    url: '/system/merchant/list',
+    method: 'get',
+    params: query
+  })
+}
+// 新增商户
+export function addStore(query) {
+  return request({
+    url: '/system/merchant/add',
+    method: 'post',
+    data: query
+  })
+}
+// 修改商户
+export function updateStore(query) {
+  return request({
+    url: '/system/merchant/update',
+    method: 'post',
+    data: query
+  })
+}
+
+// 查询商户详情
+export function getStoreDetail(query) {
+  return request({
+    url: '/system/merchant/get/'+query,
+    method: 'get'
+  })
+}
+// 设置商户支付宝
+export function setStorePay(query) {
+  return request({
+    url: '/system/merchant/setAliPayInfo',
+    method: 'post',
+    data: query
+  })
+}
+// 获取商户授权参数
+export function getStoreEw(query) {
+  return request({
+    url: '/system/merchant/getPayAuthInfo/'+query,
+    method: 'get'
+  })
+}
+//删除商户
+export function deleteStore(query) {
+  return request({
+    url: '/system/merchant/deleteById/'+query,
+    method: 'DELETE'
+  })
+}
+// 获取门店列表
+export function getGoodList(query) {
+  return request({
+    url: '/system/store/list',
+    method: 'get',
+    params: query
+  })
+}
+// 新增门店
+export function addGood(query) {
+  return request({
+    url: '/system/store/add',
+    method: 'post',
+    data: query
+  })
+}
+// 更新门店
+export function updateGood(query) {
+  return request({
+    url: '/system/store/update',
+    method: 'post',
+    data: query
+  })
+}
+//查询门店详情
+export function getGoodDetail(query) {
+  return request({
+    url: '/system/store/get/'+query,
+    method: 'get'
+  })
+}
+
+//删除门店
+export function deleteGood(query) {
+  return request({
+    url: '/system/store/deleteById/'+query,
+    method: 'DELETE'
+  })
+}
+// 获取设备列表
+export function getDeviceList(query) {
+  return request({
+    url: '/system/payDevice/list',
+    method: 'get',
+    params: query
+  })
+}
+// 解绑设备
+export function unbindDevice(query) {
+  return request({
+    url: '/system/payDevice/unbind/'+query,
+    method: 'get'
+  })
+}
+// 更新设备
+export function updateDevice(query) {
+  return request({
+    url: '/system/payDevice/flush/'+query,
+    method: 'get'
+  })
+}
+// 设备动态码
+export function deviceCode(query) {
+  return request({
+    url: '/system/store/getDynamicCode/'+query,
+    method: 'get'
+  })
+}
+
+
+// 获取全部商户
+export function getAlldevice(query) {
+  return request({
+    url: '/system/merchant/getMerchantDict',
+    method: 'get',
+    params: query
+  })
+}
+// 获取商户字典
+export function getDeviceDict(query) {
+  return request({
+    url: '/system/merchant/getMerchantDict',
+    method: 'get',
+    params: query
+  })
+}
+// 获取全部门店
+export function getAllIds(query) {
+  return request({
+    url: '/system/merchant/getAllIds',
+    method: 'get',
+    params: query
+  })
+}
+// 获取商户门店字典
+export function getAllstore(query) {
+  return request({
+    url: '/system/merchant/getStoreDict',
+    method: 'get',
+    params: query
+  })
+}
+// 获取学校门店
+export function getSchoolStore(query) {
+  return request({
+    url: '/system/store/getStoreDictBySchoolId',
+    method: 'get',
+    params: query
+  })
+}
+// 获取订单列表
+export function getOrderList(query) {
+  return request({
+    url: '/system/txn/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获取订单、交易详情
+export function getOrderDetail(query) {
+  return request({
+    url: '/system/txn/getTxnDetail',
+    method: 'get',
+    params: query
+  })
+}
+// 退款
+export function reMoney(data) {
+  return request({
+    url: '/system/txn/refund/'+data,
+    method: 'post',
+    data: data
+  })
+}
+
+
+/*
+*
+* 结算管理
+*
+* */
+
+// 获取结算列表
+export function getSettlementList(query) {
+  return request({
+    url: '/system/checkOut/list',
+    method: 'get',
+    params: query
+  })
+}
+// 获取结算记录列表
+export function getSettlementHistoryList(query) {
+  return request({
+    url: '/system/checkOut/getHistoryList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 手动结算
+export function goSettlement(data) {
+  return request({
+    url: '/system/checkOut/doVerifiedAmount',
+    method: 'post',
+    data: data
+  })
+}

+ 66 - 0
src/api/system.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+
+//查询数据字典
+export function getDict(query) {
+  return request({
+    url: '/system/dict/data/type/'+query,
+    method: 'get'
+  })
+}
+// 获取账号列表
+export function getAccountList(query) {
+  return request({
+    url: '/system/user/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增账号
+export function addAccount(query) {
+  return request({
+    url: '/system/user/add',
+    method: 'post',
+    data: query
+  })
+}
+// 修改账号
+export function updateAccount(query) {
+  return request({
+    url: '/system/user/update',
+    method: 'post',
+    data: query
+  })
+}
+// 删除账号
+export function deleteAccount(query) {
+  return request({
+    url: '/system/user/delete',
+    method: 'post',
+    params: query
+  })
+}
+//查询用户账号信息
+export function detailAccount(query) {
+  return request({
+    url: '/system/user/get/'+query,
+    method: 'get'
+  })
+}
+
+//查询角色
+export function allRole(query) {
+  return request({
+    url: '/system/role/list',
+    method: 'get',
+    params: query
+  })
+}
+//查询角色2
+export function getRole(query) {
+  return request({
+    url: '/system/role/getRoleDict',
+    method: 'get',
+    params: query
+  })
+}

+ 60 - 0
src/api/system/config.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询参数列表
+export function listConfig(query) {
+  return request({
+    url: '/system/config/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询参数详细
+export function getConfig(configId) {
+  return request({
+    url: '/system/config/' + configId,
+    method: 'get'
+  })
+}
+
+// 根据参数键名查询参数值
+export function getConfigKey(configKey) {
+  return request({
+    url: '/system/config/configKey/' + configKey,
+    method: 'get'
+  })
+}
+
+// 新增参数配置
+export function addConfig(data) {
+  return request({
+    url: '/system/config',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改参数配置
+export function updateConfig(data) {
+  return request({
+    url: '/system/config',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除参数配置
+export function delConfig(configId) {
+  return request({
+    url: '/system/config/' + configId,
+    method: 'delete'
+  })
+}
+
+// 刷新参数缓存
+export function refreshCache() {
+  return request({
+    url: '/system/config/refreshCache',
+    method: 'delete'
+  })
+}

+ 52 - 0
src/api/system/dept.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询部门列表
+export function listDept(query) {
+  return request({
+    url: '/system/dept/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询部门列表(排除节点)
+export function listDeptExcludeChild(deptId) {
+  return request({
+    url: '/system/dept/list/exclude/' + deptId,
+    method: 'get'
+  })
+}
+
+// 查询部门详细
+export function getDept(deptId) {
+  return request({
+    url: '/system/dept/' + deptId,
+    method: 'get'
+  })
+}
+
+// 新增部门
+export function addDept(data) {
+  return request({
+    url: '/system/dept',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改部门
+export function updateDept(data) {
+  return request({
+    url: '/system/dept',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除部门
+export function delDept(deptId) {
+  return request({
+    url: '/system/dept/' + deptId,
+    method: 'delete'
+  })
+}

+ 52 - 0
src/api/system/dict/data.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询字典数据列表
+export function listData(query) {
+  return request({
+    url: '/system/dict/data/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字典数据详细
+export function getData(dictCode) {
+  return request({
+    url: '/system/dict/data/' + dictCode,
+    method: 'get'
+  })
+}
+
+// 根据字典类型查询字典数据信息
+export function getDicts(dictType) {
+  return request({
+    url: '/system/dict/data/type/' + dictType,
+    method: 'get'
+  })
+}
+
+// 新增字典数据
+export function addData(data) {
+  return request({
+    url: '/system/dict/data',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改字典数据
+export function updateData(data) {
+  return request({
+    url: '/system/dict/data',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除字典数据
+export function delData(dictCode) {
+  return request({
+    url: '/system/dict/data/' + dictCode,
+    method: 'delete'
+  })
+}

+ 60 - 0
src/api/system/dict/type.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询字典类型列表
+export function listType(query) {
+  return request({
+    url: '/system/dict/type/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字典类型详细
+export function getType(dictId) {
+  return request({
+    url: '/system/dict/type/' + dictId,
+    method: 'get'
+  })
+}
+
+// 新增字典类型
+export function addType(data) {
+  return request({
+    url: '/system/dict/type',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改字典类型
+export function updateType(data) {
+  return request({
+    url: '/system/dict/type',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除字典类型
+export function delType(dictId) {
+  return request({
+    url: '/system/dict/type/' + dictId,
+    method: 'delete'
+  })
+}
+
+// 刷新字典缓存
+export function refreshCache() {
+  return request({
+    url: '/system/dict/type/refreshCache',
+    method: 'delete'
+  })
+}
+
+// 获取字典选择框列表
+export function optionselect() {
+  return request({
+    url: '/system/dict/type/optionselect',
+    method: 'get'
+  })
+}

+ 60 - 0
src/api/system/menu.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询菜单列表
+export function listMenu(query) {
+  return request({
+    url: '/system/menu/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询菜单详细
+export function getMenu(menuId) {
+  return request({
+    url: '/system/menu/' + menuId,
+    method: 'get'
+  })
+}
+
+// 查询菜单下拉树结构
+export function treeselect() {
+  return request({
+    url: '/system/menu/treeselect',
+    method: 'get'
+  })
+}
+
+// 根据角色ID查询菜单下拉树结构
+export function roleMenuTreeselect(roleId) {
+  return request({
+    url: '/system/menu/roleMenuTreeselect/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增菜单
+export function addMenu(data) {
+  return request({
+    url: '/system/menu',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改菜单
+export function updateMenu(data) {
+  return request({
+    url: '/system/menu',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除菜单
+export function delMenu(menuId) {
+  return request({
+    url: '/system/menu/' + menuId,
+    method: 'delete'
+  })
+}

+ 44 - 0
src/api/system/notice.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询公告列表
+export function listNotice(query) {
+  return request({
+    url: '/system/notice/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询公告详细
+export function getNotice(noticeId) {
+  return request({
+    url: '/system/notice/' + noticeId,
+    method: 'get'
+  })
+}
+
+// 新增公告
+export function addNotice(data) {
+  return request({
+    url: '/system/notice',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改公告
+export function updateNotice(data) {
+  return request({
+    url: '/system/notice',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除公告
+export function delNotice(noticeId) {
+  return request({
+    url: '/system/notice/' + noticeId,
+    method: 'delete'
+  })
+}

+ 52 - 0
src/api/system/post.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询岗位列表
+export function listPost2(query) {
+  return request({
+    url: '/system/post/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询岗位列表
+export function listPost(query) {
+  return request({
+    url: '/system/store/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询岗位详细
+export function getPost(postId) {
+  return request({
+    url: '/system/post/' + postId,
+    method: 'get'
+  })
+}
+
+// 新增岗位
+export function addPost(data) {
+  return request({
+    url: '/system/post',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改岗位
+export function updatePost(data) {
+  return request({
+    url: '/system/post',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除岗位
+export function delPost(postId) {
+  return request({
+    url: '/system/post/' + postId,
+    method: 'delete'
+  })
+}

+ 119 - 0
src/api/system/role.js

@@ -0,0 +1,119 @@
+import request from '@/utils/request'
+
+// 查询角色列表
+export function listRole(query) {
+  return request({
+    url: '/system/role/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询角色详细
+export function getRole(roleId) {
+  return request({
+    url: '/system/role/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增角色
+export function addRole(data) {
+  return request({
+    url: '/system/role',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改角色
+export function updateRole(data) {
+  return request({
+    url: '/system/role',
+    method: 'put',
+    data: data
+  })
+}
+
+// 角色数据权限
+export function dataScope(data) {
+  return request({
+    url: '/system/role/dataScope',
+    method: 'put',
+    data: data
+  })
+}
+
+// 角色状态修改
+export function changeRoleStatus(roleId, status) {
+  const data = {
+    roleId,
+    status
+  }
+  return request({
+    url: '/system/role/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除角色
+export function delRole(roleId) {
+  return request({
+    url: '/system/role/' + roleId,
+    method: 'delete'
+  })
+}
+
+// 查询角色已授权用户列表
+export function allocatedUserList(query) {
+  return request({
+    url: '/system/role/authUser/allocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询角色未授权用户列表
+export function unallocatedUserList(query) {
+  return request({
+    url: '/system/role/authUser/unallocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 取消用户授权角色
+export function authUserCancel(data) {
+  return request({
+    url: '/system/role/authUser/cancel',
+    method: 'put',
+    data: data
+  })
+}
+
+// 批量取消用户授权角色
+export function authUserCancelAll(data) {
+  return request({
+    url: '/system/role/authUser/cancelAll',
+    method: 'put',
+    params: data
+  })
+}
+
+// 授权用户选择
+export function authUserSelectAll(data) {
+  return request({
+    url: '/system/role/authUser/selectAll',
+    method: 'put',
+    params: data
+  })
+}
+
+// 根据角色ID查询部门树结构
+export function deptTreeSelect(roleId) {
+  return request({
+    url: '/system/role/deptTree/' + roleId,
+    method: 'get'
+  })
+}

+ 135 - 0
src/api/system/user.js

@@ -0,0 +1,135 @@
+import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
+
+// 查询用户列表
+export function listUser(query) {
+  return request({
+    url: '/system/user/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户详细
+export function getUser(userId) {
+  return request({
+    url: '/system/user/' + parseStrEmpty(userId),
+    method: 'get'
+  })
+}
+
+// 新增用户
+export function addUser(data) {
+  return request({
+    url: '/system/user',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户
+export function updateUser(data) {
+  return request({
+    url: '/system/user',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户
+export function delUser(userId) {
+  return request({
+    url: '/system/user/' + userId,
+    method: 'delete'
+  })
+}
+
+// 用户密码重置
+export function resetUserPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: '/system/user/resetPwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户状态修改
+export function changeUserStatus(userId, status) {
+  const data = {
+    userId,
+    status
+  }
+  return request({
+    url: '/system/user/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询用户个人信息
+export function getUserProfile() {
+  return request({
+    url: '/system/user/profile',
+    method: 'get'
+  })
+}
+
+// 修改用户个人信息
+export function updateUserProfile(data) {
+  return request({
+    url: '/system/user/profile',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户密码重置
+export function updateUserPwd(oldPassword, newPassword) {
+  const data = {
+    oldPassword,
+    newPassword
+  }
+  return request({
+    url: '/system/user/profile/updatePwd',
+    method: 'put',
+    params: data
+  })
+}
+
+// 用户头像上传
+export function uploadAvatar(data) {
+  return request({
+    url: '/system/user/profile/avatar',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询授权角色
+export function getAuthRole(userId) {
+  return request({
+    url: '/system/user/authRole/' + userId,
+    method: 'get'
+  })
+}
+
+// 保存授权角色
+export function updateAuthRole(data) {
+  return request({
+    url: '/system/user/authRole',
+    method: 'put',
+    params: data
+  })
+}
+
+// 查询部门下拉树结构
+export function deptTreeSelect() {
+  return request({
+    url: '/system/user/deptTree',
+    method: 'get'
+  })
+}

+ 76 - 0
src/api/tool/gen.js

@@ -0,0 +1,76 @@
+import request from '@/utils/request'
+
+// 查询生成表数据
+export function listTable(query) {
+  return request({
+    url: '/tool/gen/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询db数据库列表
+export function listDbTable(query) {
+  return request({
+    url: '/tool/gen/db/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询表详细信息
+export function getGenTable(tableId) {
+  return request({
+    url: '/tool/gen/' + tableId,
+    method: 'get'
+  })
+}
+
+// 修改代码生成信息
+export function updateGenTable(data) {
+  return request({
+    url: '/tool/gen',
+    method: 'put',
+    data: data
+  })
+}
+
+// 导入表
+export function importTable(data) {
+  return request({
+    url: '/tool/gen/importTable',
+    method: 'post',
+    params: data
+  })
+}
+
+// 预览生成代码
+export function previewTable(tableId) {
+  return request({
+    url: '/tool/gen/preview/' + tableId,
+    method: 'get'
+  })
+}
+
+// 删除表数据
+export function delTable(tableId) {
+  return request({
+    url: '/tool/gen/' + tableId,
+    method: 'delete'
+  })
+}
+
+// 生成代码(自定义路径)
+export function genCode(tableName) {
+  return request({
+    url: '/tool/gen/genCode/' + tableName,
+    method: 'get'
+  })
+}
+
+// 同步数据库
+export function synchDb(tableName) {
+  return request({
+    url: '/tool/gen/synchDb/' + tableName,
+    method: 'get'
+  })
+}

+ 392 - 0
src/api/user.js

@@ -0,0 +1,392 @@
+import request from '@/utils/request'
+
+//查询班级教职工
+export function getClassManager(query) {
+  return request({
+    url: '/system/member/queryStaffByClassId/'+query,
+    method: 'get'
+  })
+}
+// 新增学校部门
+export function addSchoolDept(data) {
+  return request({
+    url: '/system/schoolDept/add',
+    method: 'post',
+    data: data
+  })
+}
+// 修改学校部门
+export function updateSchool(query) {
+  return request({
+    url: '/system/schoolDept/update',
+    method: 'post',
+    data: query
+  })
+}
+// 修改人员部门
+export function updateSchoolDeptUser(query) {
+  return request({
+    url: '/system/schoolDept/updateMemberDept',
+    method: 'post',
+    data: query
+  })
+}
+
+// 新增人员部门
+export function addSchoolDeptUser(query) {
+  return request({
+    url: '/system/schoolDept/addMemberDept',
+    method: 'post',
+    data: query
+  })
+}
+//删除学校部门
+export function deleteSchoolDept(query) {
+  return request({
+    url: '/system/schoolDept/delete/'+query,
+    method: 'DELETE'
+  })
+}
+
+//查询教育分类
+export function getClassType(query) {
+  return request({
+    url: '/system/class/getEduType/'+query,
+    method: 'get'
+  })
+}
+
+// 获取班级年级列表
+export function getClassList(query) {
+  return request({
+    url: '/system/class/list',
+    method: 'get',
+    params: query
+  })
+}
+// 添加-删除班级管理员
+export function updateClassManager(query) {
+  return request({
+    url: '/system/class/updateClassManager',
+    method: 'post',
+    data: query
+  })
+}
+
+// 获取学生
+export function getStudentList(query) {
+  return request({
+    url: '/system/member/student/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增学生
+export function addStudent(data) {
+  return request({
+    url: '/system/member/student/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 新增教师
+export function addTeacher(data) {
+  return request({
+    url: '/system/member/staff/add',
+    method: 'post',
+    data: data
+  })
+}
+// 修改学生/教师
+export function updateTeacher(data) {
+  return request({
+    url: '/system/member/update',
+    method: 'put',
+    data: data
+  })
+}
+
+
+// 查询教师-名称
+export function getTeacherName(query) {
+  return request({
+    url: '/system/member/getStaff',
+    method: 'get',
+    params: query
+  })
+}
+// 获取职工人员列表
+export function getTeacherList(query) {
+  return request({
+    url: '/system/member/worker/list',
+    method: 'get',
+    params: query
+  })
+}
+// 获取采集人员列表
+export function getCollectList(query) {
+  return request({
+    url: '/system/member/collector/list',
+    method: 'get',
+    params: query
+  })
+}
+//删除学生
+export function deleteStudent(data) {
+  return request({
+    url: '/system/member/del/'+data,
+    method: 'DELETE'
+  })
+}
+//批量删除
+export function delBatch(data) {
+  return request({
+    url: '/system/member/batch/del',
+    method: 'post',
+    data: data
+  })
+}
+//学生导出
+export function stuExport(query) {
+  return request({
+    url: '/system/member/student/export',
+    method: 'get',
+
+    responseType:"blob",
+    params: query
+  })
+}
+//老师导出
+export function teaExport(query) {
+  return request({
+    url: '/system/member/staff/export',
+    method: 'get',
+    responseType:"blob",
+    params: query
+  })
+}
+// 新增采集人员
+export function addCollect(data) {
+  return request({
+    url: '/system/member/collector/add/'+data,
+    method: 'get'
+  })
+}
+// 删除采集人员
+export function delCollect(data) {
+  return request({
+    url: '/system/member/collector/del/'+data,
+    method: 'get'
+  })
+}
+// 获取学生详情
+export function studentDetail(data) {
+  return request({
+    url: '/system/member/detail/'+data,
+    method: 'get'
+  })
+}
+// 关闭刷脸
+export function closeFace(data) {
+  return request({
+    url: '/system/member/close/pass',
+    method: 'post',
+    data: data
+  })
+}
+// 关闭支付
+export function closePay(data) {
+  return request({
+    url: '/system/member/close/pay',
+    method: 'post',
+    data: data
+  })
+}
+// 解绑
+export function studentUnbind(data) {
+  return request({
+    url: '/system/member/unbind/'+data,
+    method: 'put'
+  })
+}
+// 查询批量操作结果
+export function getBatch(query) {
+  return request({
+    url: '/system/batch/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
+/*
+*
+* 会员中心
+*
+* */
+
+
+// 查询学生会员列表
+export function getStuMemberList(query) {
+  return request({
+    url: '/system/memberCenter/student/list',
+    method: 'get',
+    params: query
+  })
+}
+// 学生账户充值
+export function stuMemberRecharge(data) {
+  return request({
+    url: '/system/memberCenter/student/recharge',
+    method: 'post',
+    data: data
+  })
+}
+
+// 学生账户批量充值
+export function stuMemberWithdrawalBatch(data) {
+  return request({
+    url: '/system/memberCenter/student/batch/recharge',
+    method: 'post',
+    data: data
+  })
+}
+// 学生账户提现
+export function stuMemberWithdrawal(data) {
+  return request({
+    url: '/system/memberCenter/student/withdrawal',
+    method: 'post',
+    data: data
+  })
+}
+
+// 学生账户冻结
+export function stuMemberFreeze(data) {
+  return request({
+    url: '/system/memberCenter/student/freeze/'+data,
+    method: 'put'
+  })
+}
+// 学生账户解冻
+export function stuMemberUnfreeze(data) {
+  return request({
+    url: '/system/memberCenter/student/unfreeze/'+data,
+    method: 'put'
+  })
+}
+
+// 学生账户记录
+export function getStuMemberRecord(query) {
+  return request({
+    url: '/system/memberCenter/student/walletRecord',
+    method: 'get',
+    params: query
+  })
+}
+// 学生账户管理统计
+export function getStuMemberCount(query) {
+  return request({
+    url: '/system/memberCenter/student/count',
+    method: 'get',
+    params: query
+  })
+}
+
+
+
+// 查询教职工会员列表
+export function getStaffMemberList(query) {
+  return request({
+    url: '/system/memberCenter/staff/list',
+    method: 'get',
+    params: query
+  })
+}
+// 教职工账户充值
+export function staffMemberRecharge(data) {
+  return request({
+    url: '/system/memberCenter/staff/recharge',
+    method: 'put',
+    data: data
+  })
+}
+
+// 教职工账户批量充值
+export function staffMemberWithdrawalBatch(data) {
+  return request({
+    url: '/system/memberCenter/staff/batch/recharge',
+    method: 'put',
+    data: data
+  })
+}
+// 教职工账户提现
+export function staffMemberWithdrawal(data) {
+  return request({
+    url: '/system/memberCenter/staff/withdrawal',
+    method: 'put',
+    data: data
+  })
+}
+
+// 教职工账户冻结
+export function staffMemberFreeze(data) {
+  return request({
+    url: '/system/memberCenter/staff/freeze/'+data,
+    method: 'put'
+  })
+}
+// 教职工账户解冻
+export function staffMemberUnfreeze(data) {
+  return request({
+    url: '/system/memberCenter/staff/unfreeze/'+data,
+    method: 'put'
+  })
+}
+
+// 教职工账户记录
+export function getStaffMemberRecord(query) {
+  return request({
+    url: '/system/memberCenter/staff/walletRecord',
+    method: 'get',
+    params: query
+  })
+}
+// 教职工账户管理统计
+export function getStaffMemberCount(query) {
+  return request({
+    url: '/system/memberCenter/staff/count',
+    method: 'get',
+    params: query
+  })
+}
+//文件下载
+
+// 教职工账户记录
+export function downFile(query) {
+  return request({
+    url: '/system/file/download',
+    method: 'get',
+    responseType:"blob",
+    params: query
+  })
+}
+
+
+// 修改密码
+export function updatePassword(data) {
+  return request({
+    url: '/system/user/updatePassword',
+    method: 'post',
+    data: data
+  })
+}
+// 重置密码
+export function resetPsd(data) {
+  return request({
+    url: '/system/user/resetPwd',
+    method: 'post',
+    params: data
+  })
+}

BIN
src/assets/401_images/401.gif


BIN
src/assets/404_images/404.png


BIN
src/assets/404_images/404_cloud.png


+ 9 - 0
src/assets/icons/index.js

@@ -0,0 +1,9 @@
+import Vue from 'vue'
+import SvgIcon from '@/components/SvgIcon'// svg component
+
+// register globally
+Vue.component('svg-icon', SvgIcon)
+
+const req = require.context('./svg', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys().map(requireContext)
+requireAll(req)

+ 1 - 0
src/assets/icons/svg/404.svg

@@ -0,0 +1 @@
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M121.718 73.272v9.953c3.957-7.584 6.199-16.05 6.199-24.995C127.917 26.079 99.273 0 63.958 0 28.644 0 0 26.079 0 58.23c0 .403.028.806.028 1.21l22.97-25.953h13.34l-19.76 27.187h6.42V53.77l13.728-19.477v49.361H22.998V73.272H2.158c5.951 20.284 23.608 36.208 45.998 41.399-1.44 3.3-5.618 11.263-12.565 12.674-8.607 1.764 23.358.428 46.163-13.178 17.519-4.611 31.938-15.849 39.77-30.513h-13.506V73.272H85.02V59.464l22.998-25.977h13.008l-19.429 27.187h6.421v-7.433l13.727-19.402v39.433h-.027zm-78.24 2.822a10.516 10.516 0 0 1-.996-4.535V44.548c0-1.613.332-3.124.996-4.535a11.66 11.66 0 0 1 2.713-3.68c1.134-1.032 2.49-1.864 4.04-2.468 1.55-.605 3.21-.908 4.982-.908h11.292c1.77 0 3.431.303 4.981.908 1.522.604 2.85 1.41 3.986 2.418l-12.26 16.303v-2.898a1.96 1.96 0 0 0-.665-1.512c-.443-.403-.996-.604-1.66-.604-.665 0-1.218.201-1.661.604a1.96 1.96 0 0 0-.664 1.512v9.071L44.364 77.606a10.556 10.556 0 0 1-.886-1.512zm35.73-4.535c0 1.613-.332 3.124-.997 4.535a11.66 11.66 0 0 1-2.712 3.68c-1.134 1.032-2.49 1.864-4.04 2.469-1.55.604-3.21.907-4.982.907H55.185c-1.77 0-3.431-.303-4.981-.907-1.55-.605-2.906-1.437-4.041-2.47a12.49 12.49 0 0 1-1.384-1.512l13.727-18.217v6.375c0 .605.222 1.109.665 1.512.442.403.996.604 1.66.604.664 0 1.218-.201 1.66-.604a1.96 1.96 0 0 0 .665-1.512V53.87L75.97 36.838c.913.932 1.66 1.99 2.214 3.175.664 1.41.996 2.922.996 4.535v27.011h.028z"/></svg>

+ 1 - 0
src/assets/icons/svg/account.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1685524012848" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3897" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M658.139429 502.784A402.432 402.432 0 0 1 914.285714 877.714286a36.571429 36.571429 0 1 1-73.142857 0 329.142857 329.142857 0 0 0-658.285714 0 36.571429 36.571429 0 1 1-73.142857 0 402.432 402.432 0 0 1 256.146285-374.930286 255.707429 255.707429 0 0 1-108.032-241.225143 109.714286 109.714286 0 0 0 11.702858 211.456 36.571429 36.571429 0 0 1 10.678857 67.437714 36.425143 36.425143 0 0 1-20.260572 10.971429A182.857143 182.857143 0 0 0 109.714286 731.428571a36.571429 36.571429 0 1 1-73.142857 0c0-97.572571 54.930286-183.661714 137.069714-226.742857a182.784 182.784 0 0 1 58.514286-311.588571 36.571429 36.571429 0 0 1 39.716571 10.459428 256.073143 256.073143 0 0 1 480.256 0 36.571429 36.571429 0 0 1 39.643429-10.459428 182.857143 182.857143 0 0 1 58.587428 311.588571A256.219429 256.219429 0 0 1 987.428571 731.428571a36.571429 36.571429 0 1 1-73.142857 0 182.857143 182.857143 0 0 0-150.235428-179.931428 36.425143 36.425143 0 0 1-20.260572-11.044572 36.498286 36.498286 0 0 1 10.678857-67.437714 109.714286 109.714286 0 0 0 11.702858-211.456 255.707429 255.707429 0 0 1-108.032 241.225143zM329.142857 292.571429a182.857143 182.857143 0 1 0 365.714286 0 182.857143 182.857143 0 0 0-365.714286 0z" p-id="3898"></path></svg>

+ 1 - 0
src/assets/icons/svg/arrowRight.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1700031157806" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11333" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M653.248 727.296L608 682.048l149.024-149.056H192v-64h564.992L608 320l45.248-45.248 226.272 226.24z" p-id="11334"></path></svg>

+ 1 - 0
src/assets/icons/svg/bug.svg

@@ -0,0 +1 @@
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M127.88 73.143c0 1.412-.506 2.635-1.518 3.669-1.011 1.033-2.209 1.55-3.592 1.55h-17.887c0 9.296-1.783 17.178-5.35 23.645l16.609 17.044c1.011 1.034 1.517 2.257 1.517 3.67 0 1.412-.506 2.635-1.517 3.668-.958 1.033-2.155 1.55-3.593 1.55-1.438 0-2.635-.517-3.593-1.55l-15.811-16.063a15.49 15.49 0 0 1-1.196 1.06c-.532.434-1.65 1.208-3.353 2.322a50.104 50.104 0 0 1-5.192 2.974c-1.758.87-3.94 1.658-6.546 2.364-2.607.706-5.189 1.06-7.748 1.06V47.044H58.89v73.062c-2.716 0-5.417-.367-8.106-1.102-2.688-.734-5.003-1.631-6.945-2.692a66.769 66.769 0 0 1-5.268-3.179c-1.571-1.057-2.73-1.94-3.476-2.65L33.9 109.34l-14.611 16.877c-1.066 1.14-2.344 1.711-3.833 1.711-1.277 0-2.422-.434-3.434-1.304-1.012-.978-1.557-2.187-1.635-3.627-.079-1.44.333-2.705 1.236-3.794l16.129-18.51c-3.087-6.197-4.63-13.644-4.63-22.342H5.235c-1.383 0-2.58-.517-3.592-1.55S.125 74.545.125 73.132c0-1.412.506-2.635 1.518-3.668 1.012-1.034 2.21-1.55 3.592-1.55h17.887V43.939L9.308 29.833c-1.012-1.033-1.517-2.256-1.517-3.669 0-1.412.505-2.635 1.517-3.668 1.012-1.034 2.21-1.55 3.593-1.55s2.58.516 3.593 1.55l13.813 14.106h67.396l13.814-14.106c1.012-1.034 2.21-1.55 3.592-1.55 1.384 0 2.581.516 3.593 1.55 1.012 1.033 1.518 2.256 1.518 3.668 0 1.413-.506 2.636-1.518 3.67l-13.814 14.105v23.975h17.887c1.383 0 2.58.516 3.593 1.55 1.011 1.033 1.517 2.256 1.517 3.668l-.005.01zM89.552 26.175H38.448c0-7.23 2.489-13.386 7.466-18.469C50.892 2.623 56.92.082 64 .082c7.08 0 13.108 2.541 18.086 7.624 4.977 5.083 7.466 11.24 7.466 18.469z"/></svg>

+ 1 - 0
src/assets/icons/svg/build.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1568899741379" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2054" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M960 591.424V368.96c0-0.288 0.16-0.512 0.16-0.768S960 367.68 960 367.424V192a32 32 0 0 0-32-32H96a32 32 0 0 0-32 32v175.424c0 0.288-0.16 0.512-0.16 0.768s0.16 0.48 0.16 0.768v222.464c0 0.288-0.16 0.512-0.16 0.768s0.16 0.48 0.16 0.768V864a32 32 0 0 0 32 32h832a32 32 0 0 0 32-32v-271.04c0-0.288 0.16-0.512 0.16-0.768S960 591.68 960 591.424z m-560-31.232v-160H608v160h-208z m208 64V832h-208v-207.808H608z m-480-224h208v160H128v-160z m544 0h224v160h-224v-160zM896 224v112.192H128V224h768zM128 624.192h208V832H128v-207.808zM672 832v-207.808h224V832h-224z" p-id="2055"></path></svg>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/button.svg


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/cascader.svg


+ 1 - 0
src/assets/icons/svg/chart.svg

@@ -0,0 +1 @@
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z"/></svg>

+ 1 - 0
src/assets/icons/svg/checkbox.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1575982282951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="902" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M828.40625 90.125H195.59375C137.375 90.125 90.125 137.375 90.125 195.59375v632.8125c0 58.21875 47.25 105.46875 105.46875 105.46875h632.8125c58.21875 0 105.46875-47.25 105.46875-105.46875V195.59375c0-58.21875-47.25-105.46875-105.46875-105.46875z m52.734375 738.28125c0 29.16-23.57015625 52.734375-52.734375 52.734375H195.59375c-29.109375 0-52.734375-23.574375-52.734375-52.734375V195.59375c0-29.109375 23.625-52.734375 52.734375-52.734375h632.8125c29.16 0 52.734375 23.625 52.734375 52.734375v632.8125z" p-id="903"></path><path d="M421.52890625 709.55984375a36.28125 36.28125 0 0 1-27.55265625-12.66890625L205.17453125 476.613125a36.28546875 36.28546875 0 0 1 55.10109375-47.22890625l164.986875 192.4846875 342.16171875-298.48078125a36.2896875 36.2896875 0 0 1 47.70984375 54.68765625L445.3859375 700.6203125a36.3234375 36.3234375 0 0 1-23.85703125 8.93953125z" p-id="904"></path></svg>

+ 1 - 0
src/assets/icons/svg/class-bg.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706171295207" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2411" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M1021.19861931 165.40042354l-1018.15040797 0 322.41309241 364.83534734-322.41309241 335.14233173L1021.19861931 865.37810261z" p-id="2412"></path></svg>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/class.svg


+ 1 - 0
src/assets/icons/svg/clipboard.svg

@@ -0,0 +1 @@
+<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.857 118.857h64V73.143H89.143c-1.902 0-3.52-.668-4.855-2.002-1.335-1.335-2.002-2.954-2.002-4.855V36.57H54.857v82.286zM73.143 16v-4.571a2.2 2.2 0 0 0-.677-1.61 2.198 2.198 0 0 0-1.609-.676H20.571c-.621 0-1.158.225-1.609.676a2.198 2.198 0 0 0-.676 1.61V16a2.2 2.2 0 0 0 .676 1.61c.451.45.988.676 1.61.676h50.285c.622 0 1.158-.226 1.61-.677.45-.45.676-.987.676-1.609zm18.286 48h21.357L91.43 42.642V64zM128 73.143v48c0 1.902-.667 3.52-2.002 4.855-1.335 1.335-2.953 2.002-4.855 2.002H52.57c-1.901 0-3.52-.667-4.854-2.002-1.335-1.335-2.003-2.953-2.003-4.855v-11.429H6.857c-1.902 0-3.52-.667-4.855-2.002C.667 106.377 0 104.759 0 102.857v-96c0-1.902.667-3.52 2.002-4.855C3.337.667 4.955 0 6.857 0h77.714c1.902 0 3.52.667 4.855 2.002 1.335 1.335 2.003 2.953 2.003 4.855V30.29c1 .622 1.856 1.29 2.569 2.003l29.147 29.147c1.335 1.335 2.478 3.145 3.429 5.43.95 2.287 1.426 4.383 1.426 6.291v-.018z"/></svg>

+ 1 - 0
src/assets/icons/svg/code.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1546567861908" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2422" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M318.577778 819.2L17.066667 512l301.511111-307.2 45.511111 45.511111L96.711111 512l267.377778 261.688889zM705.422222 819.2l-45.511111-45.511111L927.288889 512l-267.377778-261.688889 45.511111-45.511111L1006.933333 512zM540.785778 221.866667l55.751111 11.150222L483.157333 802.133333l-55.751111-11.093333z" p-id="2423"></path></svg>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/collect.svg


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/color.svg


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/component.svg


+ 1 - 0
src/assets/icons/svg/control-b.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705029808096" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2221" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M698.543529 161.719339" p-id="2222"></path><path d="M141.942212 161.719339"  p-id="2223"></path><path d="M787.971509 146.839618" p-id="2224"></path><path d="M63.867545 146.839618" p-id="2225"></path><path d="M960.316517 235.263002" p-id="2226"></path><path d="M65.530977 235.263002"  p-id="2227"></path><path d="M959.22247 165.207902"  p-id="2228"></path><path d="M162.582879 285.272625c-41.604731 0-65.23338299 54.963795-34.928639 85.258218L476.928585 719.808628c20.029996 20.031716 49.822121 20.031716 69.853837 0L896.044725 370.530843c31.085714-31.073673 5.136514-85.258218-35.441258-85.258218L162.582879 285.272625 162.582879 285.272625z"  p-id="2229"></path><path d="M64.476495 165.207902"  p-id="2230"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-big.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705643958226" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2569" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M919.264 905.984l-138.912-138.912C851.808 692.32 896 591.328 896 480c0-229.376-186.624-416-416-416S64 250.624 64 480s186.624 416 416 416c95.008 0 182.432-32.384 252.544-86.208l141.44 141.44a31.904 31.904 0 0 0 45.248 0 32 32 0 0 0 0.032-45.248zM128 480C128 285.92 285.92 128 480 128s352 157.92 352 352-157.92 352-352 352S128 674.08 128 480z" p-id="2570"></path><path d="M625.792 448H512v-112a32 32 0 0 0-64 0V448h-112a32 32 0 0 0 0 64H448v112a32 32 0 1 0 64 0V512h113.792a32 32 0 1 0 0-64z" p-id="2571"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-bl.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705645716768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3250" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M956.39 400.827C922.164 266.675 828.186 155.703 701.502 99.874l94.522 443.782L956.39 400.827zM206.208 189.167C106.183 286.191 56.845 424.181 72.696 562.659l351.347-309.096-217.835-64.396zM643.118 78.847a446.363 446.363 0 0 0-138.947-16.775 448.047 448.047 0 0 0-250.583 86.934l437.868 146.949-48.338-217.108zM83.786 623.979c34.443 133.772 128.248 244.407 254.583 300.291l-95.915-426.55L83.786 623.979zM969.893 496.089a372.746 372.746 0 0 0-2.37-34.138l-329.972 303.78 196.157 69.256c91.522-88.456 141.056-211.704 136.185-338.898zM396.862 945.166a447.857 447.857 0 0 0 139.077 16.766 447.784 447.784 0 0 0 250.322-86.718L349.286 733.05l47.576 212.116z" p-id="3251"></path><path d="M397.253 471.171h245.668c22.593 0 40.923 18.32 40.923 40.913 0 22.592-18.33 40.922-40.923 40.922H397.253c-22.592 0-40.922-18.33-40.922-40.922 0-22.593 18.33-40.913 40.922-40.913z"  p-id="3252"></path><path d="M479.17 634.879V389.21c0-22.593 18.32-40.923 40.913-40.923s40.923 18.33 40.923 40.923v245.668c0 22.592-18.33 40.922-40.923 40.922s-40.913-18.329-40.913-40.921z" p-id="3253"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-br.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705645714453" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3097" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M956.39 400.827C922.164 266.675 828.186 155.703 701.502 99.874l94.522 443.782L956.39 400.827z m-750.182-211.66C106.183 286.191 56.845 424.181 72.696 562.659l351.347-309.096-217.835-64.396z m436.91-110.32a446.363 446.363 0 0 0-138.947-16.775 448.047 448.047 0 0 0-250.583 86.934l437.868 146.949-48.338-217.108zM83.786 623.979c34.443 133.772 128.248 244.407 254.583 300.291l-95.915-426.55L83.786 623.979z m886.107-127.89a372.746 372.746 0 0 0-2.37-34.138l-329.972 303.78 196.157 69.256c91.522-88.456 141.056-211.704 136.185-338.898zM396.862 945.166a447.857 447.857 0 0 0 139.077 16.766 447.784 447.784 0 0 0 250.322-86.718L349.286 733.05l47.576 212.116z m0.391-474.039h245.668c22.593 0 40.923 18.32 40.923 40.912 0 22.593-18.33 40.923-40.923 40.923H397.253c-22.592 0-40.922-18.33-40.922-40.923 0-22.592 18.33-40.912 40.922-40.912z" p-id="3098"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-c.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705030804640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4541" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M872.802928 755.99406 872.864326 755.99406 872.864326 755.624646Z" p-id="4542"></path><path d="M922.268526 475.740168c-10.490935-10.727319-28.947286-10.815323-39.587624-0.366344l-18.368346 18.059308c-9.727549-206.461235-177.482227-367.192963-384.91458-367.192963-212.706473 0-385.751644 173.045171-385.751644 385.752668 0 212.720799 173.045171 385.766994 385.751644 385.766994 113.354698 0 220.62891-50.167586 293.924239-137.161916 3.2623-2.495844 5.907547-5.494131 7.907087-8.875135 0.26606-0.322341 0.557702-0.64673 0.853437-0.940418l1.880837-2.998287-0.618077-0.322341c1.26276-3.321652 1.851161-6.5246 1.851161-9.815553 0-16.077164-13.049201-29.155017-29.124318-29.155017-9.66922 0-18.721387 5.142114-23.982204 13.489222-62.806441 75.444273-154.911162 118.734218-252.691139 118.734218-181.244924 0-328.751443-147.447167-328.751443-328.721767 0-181.231621 147.506519-328.72279 328.751443-328.72279 180.070168 0 326.782601 145.509025 328.693114 325.122799l-32.709983-32.813337c-10.552334-10.623965-29.036313-10.653641-39.588647-0.086981-10.991332 10.933003-10.991332 28.712949-0.059352 39.660278l69.064982 69.226664c5.262864 5.320169 12.31549 8.229428 19.778462 8.229428l0.324388-0.028653 0.733711 0.23536c1.589195 0.38067 3.321652 0.851391 5.232165 0.851391 7.375991 0 14.34266-2.849908 19.633153-8.022721l71.445192-70.300113c5.348821-5.246491 8.346085-12.31549 8.405437-19.808138C930.410973 488.069985 927.529343 481.059314 922.268526 475.740168" p-id="4543"></path></svg>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/control-cl.svg


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
src/assets/icons/svg/control-cr.svg


+ 1 - 0
src/assets/icons/svg/control-l.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705029819867" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2535" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M862.280661 698.543529" p-id="2536"></path><path d="M862.280661 141.942212" p-id="2537"></path><path d="M877.160382 787.971509" p-id="2538"></path><path d="M877.160382 63.867545" p-id="2539"></path><path d="M788.736998 960.316517"  p-id="2540"></path><path d="M788.736998 65.530977"  p-id="2541"></path><path d="M858.792098 959.22247" p-id="2542"></path><path d="M738.727375 162.582879c0-41.604731-54.963795-65.23338299-85.258218-34.928639L304.191372 476.928585c-20.031716 20.029996-20.031716 49.822121 0 69.853837L653.469157 896.044725c31.073673 31.085714 85.258218 5.136514 85.258218-35.441258L738.727375 162.582879 738.727375 162.582879z" p-id="2543"></path><path d="M858.792098 64.476495" p-id="2544"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-lb.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705645247606" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2725" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M806.25869173 481.55369695" p-id="2726"></path><path d="M412.68212607 87.97713128" p-id="2727"></path><path d="M880.01537444 534.26727642"  p-id="2728"></path><path d="M367.99655121 22.24845319" p-id="2729"></path><path d="M939.35692386 718.65837472" p-id="2730"></path><path d="M306.64800082 85.94945168" p-id="2731"></path><path d="M988.11975207 668.3483304" p-id="2732"></path><path d="M339.9119153 189.93765326c-29.41898742-29.41898742-84.99223964-7.26169531-84.98494159 35.5883866L254.92454126 719.476988c-0.00121622 28.32790822 21.06499739 49.39412183 49.39412183 49.39412183L798.26109625 768.8601624c43.95332406 0.00851427 63.91872798-56.65460022 35.22591023-85.34741796L339.9119153 189.93765326 339.9119153 189.93765326z"  p-id="2733"></path><path d="M355.43880571 35.66738404" p-id="2734"></path></svg>

+ 1 - 0
src/assets/icons/svg/control-lt.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705645250341" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2882" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M542.44630305 806.25869173" p-id="2883"></path><path d="M936.02286872 412.68212607" p-id="2884"></path><path d="M489.73272358 880.01537444"  p-id="2885"></path><path d="M1001.75154681 367.99655121"  p-id="2886"></path><path d="M305.34162528 939.35692386" p-id="2887"></path><path d="M938.05054832 306.64800082"  p-id="2888"></path><path d="M355.6516696 988.11975207" p-id="2889"></path><path d="M834.06234674 339.9119153c29.41898742-29.41898742 7.26169531-84.99223964-35.5883866-84.98494159L304.523012 254.92454126c-28.32790822-0.00121622-49.39412183 21.06499739-49.39412183 49.39412183L255.1398376 798.26109625c-0.00851427 43.95332406 56.65460022 63.91872798 85.34741796 35.22591023L834.06234674 339.9119153 834.06234674 339.9119153z"  p-id="2890"></path><path d="M988.33261596 355.43880571" p-id="2891"></path></svg>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff