django-handyhelpers 0.3.20__py3-none-any.whl → 0.3.35__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (571) hide show
  1. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/METADATA +16 -6
  2. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/RECORD +562 -75
  3. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/WHEEL +1 -1
  4. handyhelpers/__init__.py +6 -6
  5. handyhelpers/forms.py +9 -1
  6. handyhelpers/mixins/form_mixins.py +61 -0
  7. handyhelpers/mixins/model_mixins.py +21 -0
  8. handyhelpers/mixins/serializer_mixins.py +35 -0
  9. handyhelpers/mixins/view_mixins.py +5 -2
  10. handyhelpers/serializers.py +23 -3
  11. handyhelpers/static/handyhelpers/css/table_sortable.css +17 -0
  12. handyhelpers/static/handyhelpers/js/sidebar.js +8 -4
  13. handyhelpers/static/handyhelpers/js/table_sortable.js +119 -0
  14. handyhelpers/static/node_modules/.bin/acorn +4 -0
  15. handyhelpers/static/node_modules/.bin/css-b64-images +13 -0
  16. handyhelpers/static/node_modules/.bin/esbuild +0 -0
  17. handyhelpers/static/node_modules/.bin/html-minifier-terser +308 -0
  18. handyhelpers/static/node_modules/.bin/minify +98 -0
  19. handyhelpers/static/node_modules/.bin/terser +21 -0
  20. handyhelpers/static/node_modules/.bin/uglifyjs +624 -0
  21. handyhelpers/static/node_modules/.package-lock.json +750 -0
  22. handyhelpers/static/node_modules/@esbuild/linux-x64/README.md +3 -0
  23. handyhelpers/static/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  24. handyhelpers/static/node_modules/@esbuild/linux-x64/package.json +20 -0
  25. handyhelpers/static/node_modules/@jridgewell/gen-mapping/LICENSE +19 -0
  26. handyhelpers/static/node_modules/@jridgewell/gen-mapping/README.md +227 -0
  27. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +230 -0
  28. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +1 -0
  29. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +246 -0
  30. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +1 -0
  31. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +88 -0
  32. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  33. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +36 -0
  34. handyhelpers/static/node_modules/@jridgewell/gen-mapping/package.json +76 -0
  35. handyhelpers/static/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  36. handyhelpers/static/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  37. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +232 -0
  38. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
  39. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +240 -0
  40. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
  41. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
  42. handyhelpers/static/node_modules/@jridgewell/resolve-uri/package.json +69 -0
  43. handyhelpers/static/node_modules/@jridgewell/set-array/LICENSE +19 -0
  44. handyhelpers/static/node_modules/@jridgewell/set-array/README.md +37 -0
  45. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.mjs +69 -0
  46. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.mjs.map +1 -0
  47. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.umd.js +83 -0
  48. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map +1 -0
  49. handyhelpers/static/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts +32 -0
  50. handyhelpers/static/node_modules/@jridgewell/set-array/package.json +65 -0
  51. handyhelpers/static/node_modules/@jridgewell/source-map/LICENSE +19 -0
  52. handyhelpers/static/node_modules/@jridgewell/source-map/README.md +184 -0
  53. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.cjs +95 -0
  54. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.cjs.map +1 -0
  55. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.mjs +90 -0
  56. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.mjs.map +1 -0
  57. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.umd.js +1242 -0
  58. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map +1 -0
  59. handyhelpers/static/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts +35 -0
  60. handyhelpers/static/node_modules/@jridgewell/source-map/package.json +71 -0
  61. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/LICENSE +21 -0
  62. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  63. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +424 -0
  64. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  65. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +439 -0
  66. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +1 -0
  67. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
  68. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +8 -0
  69. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
  70. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
  71. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/package.json +75 -0
  72. handyhelpers/static/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  73. handyhelpers/static/node_modules/@jridgewell/trace-mapping/README.md +257 -0
  74. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +580 -0
  75. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -0
  76. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +600 -0
  77. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -0
  78. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +8 -0
  79. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +32 -0
  80. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +7 -0
  81. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +1 -0
  82. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +2 -0
  83. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  84. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +4 -0
  85. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +79 -0
  86. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +99 -0
  87. handyhelpers/static/node_modules/@jridgewell/trace-mapping/package.json +77 -0
  88. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/enums.js +1 -1
  89. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-base.js +12 -170
  90. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-base.js.map +1 -1
  91. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-lite.js +14 -184
  92. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-lite.js.map +1 -1
  93. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper.js +14 -197
  94. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper.js.map +1 -1
  95. handyhelpers/static/node_modules/@popperjs/core/dist/esm/createPopper.js +6 -66
  96. handyhelpers/static/node_modules/@popperjs/core/dist/esm/modifiers/arrow.js +1 -12
  97. handyhelpers/static/node_modules/@popperjs/core/dist/esm/modifiers/computeStyles.js +2 -14
  98. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/computeAutoPlacement.js +0 -4
  99. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/userAgent.js +1 -1
  100. handyhelpers/static/node_modules/@popperjs/core/dist/umd/enums.js +1 -1
  101. handyhelpers/static/node_modules/@popperjs/core/dist/umd/enums.min.js +1 -1
  102. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.js +12 -170
  103. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.js.map +1 -1
  104. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.min.js +2 -2
  105. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.min.js.map +1 -1
  106. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.js +14 -184
  107. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.js.map +1 -1
  108. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.min.js +2 -2
  109. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.min.js.map +1 -1
  110. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.js +14 -197
  111. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.js.map +1 -1
  112. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.min.js +2 -2
  113. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.min.js.map +1 -1
  114. handyhelpers/static/node_modules/@popperjs/core/lib/createPopper.js +6 -66
  115. handyhelpers/static/node_modules/@popperjs/core/lib/createPopper.js.flow +2 -80
  116. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/arrow.js +1 -12
  117. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/arrow.js.flow +0 -22
  118. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +2 -14
  119. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/computeStyles.js.flow +3 -33
  120. handyhelpers/static/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +0 -4
  121. handyhelpers/static/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.flow +0 -12
  122. handyhelpers/static/node_modules/@popperjs/core/lib/utils/userAgent.js +1 -1
  123. handyhelpers/static/node_modules/@popperjs/core/lib/utils/userAgent.js.flow +1 -1
  124. handyhelpers/static/node_modules/@popperjs/core/package.json +1 -1
  125. handyhelpers/static/node_modules/@putout/minify/LICENSE +21 -0
  126. handyhelpers/static/node_modules/@putout/minify/README.md +110 -0
  127. handyhelpers/static/node_modules/@putout/minify/bundle/minify.min.js +52 -0
  128. handyhelpers/static/node_modules/@putout/minify/package.json +112 -0
  129. handyhelpers/static/node_modules/@swc/core/Visitor.d.ts +218 -0
  130. handyhelpers/static/node_modules/@swc/core/Visitor.js +1407 -0
  131. handyhelpers/static/node_modules/@swc/core/binding.d.ts +56 -0
  132. handyhelpers/static/node_modules/@swc/core/binding.js +351 -0
  133. handyhelpers/static/node_modules/@swc/core/index.d.ts +118 -0
  134. handyhelpers/static/node_modules/@swc/core/index.js +439 -0
  135. handyhelpers/static/node_modules/@swc/core/package.json +114 -0
  136. handyhelpers/static/node_modules/@swc/core/postinstall.js +148 -0
  137. handyhelpers/static/node_modules/@swc/core/spack.d.ts +51 -0
  138. handyhelpers/static/node_modules/@swc/core/spack.js +87 -0
  139. handyhelpers/static/node_modules/@swc/core/util.d.ts +1 -0
  140. handyhelpers/static/node_modules/@swc/core/util.js +104 -0
  141. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/README.md +3 -0
  142. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/package.json +45 -0
  143. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  144. handyhelpers/static/node_modules/@swc/counter/CHANGELOG.md +7 -0
  145. handyhelpers/static/node_modules/@swc/counter/README.md +7 -0
  146. handyhelpers/static/node_modules/@swc/counter/index.js +1 -0
  147. handyhelpers/static/node_modules/@swc/counter/package.json +27 -0
  148. handyhelpers/static/node_modules/@swc/types/LICENSE +201 -0
  149. handyhelpers/static/node_modules/@swc/types/README.md +4 -0
  150. handyhelpers/static/node_modules/@swc/types/assumptions.d.ts +92 -0
  151. handyhelpers/static/node_modules/@swc/types/assumptions.js +2 -0
  152. handyhelpers/static/node_modules/@swc/types/index.d.ts +1977 -0
  153. handyhelpers/static/node_modules/@swc/types/index.js +2 -0
  154. handyhelpers/static/node_modules/@swc/types/package.json +39 -0
  155. handyhelpers/static/node_modules/acorn/CHANGELOG.md +928 -0
  156. handyhelpers/static/node_modules/acorn/LICENSE +21 -0
  157. handyhelpers/static/node_modules/acorn/README.md +282 -0
  158. handyhelpers/static/node_modules/acorn/bin/acorn +4 -0
  159. handyhelpers/static/node_modules/acorn/dist/acorn.d.mts +866 -0
  160. handyhelpers/static/node_modules/acorn/dist/acorn.d.ts +866 -0
  161. handyhelpers/static/node_modules/acorn/dist/acorn.js +6174 -0
  162. handyhelpers/static/node_modules/acorn/dist/acorn.mjs +6145 -0
  163. handyhelpers/static/node_modules/acorn/dist/bin.js +90 -0
  164. handyhelpers/static/node_modules/acorn/package.json +50 -0
  165. handyhelpers/static/node_modules/buffer-from/LICENSE +21 -0
  166. handyhelpers/static/node_modules/buffer-from/index.js +72 -0
  167. handyhelpers/static/node_modules/buffer-from/package.json +19 -0
  168. handyhelpers/static/node_modules/buffer-from/readme.md +69 -0
  169. handyhelpers/static/node_modules/camel-case/LICENSE +21 -0
  170. handyhelpers/static/node_modules/camel-case/README.md +47 -0
  171. handyhelpers/static/node_modules/camel-case/dist/index.d.ts +5 -0
  172. handyhelpers/static/node_modules/camel-case/dist/index.js +23 -0
  173. handyhelpers/static/node_modules/camel-case/dist/index.js.map +1 -0
  174. handyhelpers/static/node_modules/camel-case/dist/index.spec.d.ts +1 -0
  175. handyhelpers/static/node_modules/camel-case/dist/index.spec.js +26 -0
  176. handyhelpers/static/node_modules/camel-case/dist/index.spec.js.map +1 -0
  177. handyhelpers/static/node_modules/camel-case/dist.es2015/index.d.ts +5 -0
  178. handyhelpers/static/node_modules/camel-case/dist.es2015/index.js +17 -0
  179. handyhelpers/static/node_modules/camel-case/dist.es2015/index.js.map +1 -0
  180. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.d.ts +1 -0
  181. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.js +24 -0
  182. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.js.map +1 -0
  183. handyhelpers/static/node_modules/camel-case/package.json +89 -0
  184. handyhelpers/static/node_modules/clean-css/History.md +1504 -0
  185. handyhelpers/static/node_modules/clean-css/LICENSE +19 -0
  186. handyhelpers/static/node_modules/clean-css/README.md +987 -0
  187. handyhelpers/static/node_modules/clean-css/index.js +1 -0
  188. handyhelpers/static/node_modules/clean-css/package.json +48 -0
  189. handyhelpers/static/node_modules/commander/LICENSE +22 -0
  190. handyhelpers/static/node_modules/commander/Readme.md +1134 -0
  191. handyhelpers/static/node_modules/commander/esm.mjs +16 -0
  192. handyhelpers/static/node_modules/commander/index.js +27 -0
  193. handyhelpers/static/node_modules/commander/package-support.json +16 -0
  194. handyhelpers/static/node_modules/commander/package.json +80 -0
  195. handyhelpers/static/node_modules/commander/typings/index.d.ts +889 -0
  196. handyhelpers/static/node_modules/css-b64-images/.npmignore +15 -0
  197. handyhelpers/static/node_modules/css-b64-images/.travis.yml +5 -0
  198. handyhelpers/static/node_modules/css-b64-images/README.md +78 -0
  199. handyhelpers/static/node_modules/css-b64-images/bin/css-b64-images +13 -0
  200. handyhelpers/static/node_modules/css-b64-images/draft.png +0 -0
  201. handyhelpers/static/node_modules/css-b64-images/draft.xcf +0 -0
  202. handyhelpers/static/node_modules/css-b64-images/package.json +30 -0
  203. handyhelpers/static/node_modules/css-b64-images/test/css-b64-images-test.js +38 -0
  204. handyhelpers/static/node_modules/css-b64-images/test/fixture/css/style.css +52 -0
  205. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.eot +0 -0
  206. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.svg +248 -0
  207. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.ttf +0 -0
  208. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.woff +0 -0
  209. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.eot +0 -0
  210. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.svg +245 -0
  211. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.ttf +0 -0
  212. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.woff +0 -0
  213. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/background-pattern.gif +0 -0
  214. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/dots.svg +6 -0
  215. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/mixit-banner.png +0 -0
  216. handyhelpers/static/node_modules/debug/LICENSE +20 -0
  217. handyhelpers/static/node_modules/debug/README.md +481 -0
  218. handyhelpers/static/node_modules/debug/package.json +65 -0
  219. handyhelpers/static/node_modules/debug/src/browser.js +272 -0
  220. handyhelpers/static/node_modules/debug/src/common.js +292 -0
  221. handyhelpers/static/node_modules/debug/src/index.js +10 -0
  222. handyhelpers/static/node_modules/debug/src/node.js +263 -0
  223. handyhelpers/static/node_modules/dot-case/LICENSE +21 -0
  224. handyhelpers/static/node_modules/dot-case/README.md +37 -0
  225. handyhelpers/static/node_modules/dot-case/dist/index.d.ts +3 -0
  226. handyhelpers/static/node_modules/dot-case/dist/index.js +11 -0
  227. handyhelpers/static/node_modules/dot-case/dist/index.js.map +1 -0
  228. handyhelpers/static/node_modules/dot-case/dist/index.spec.d.ts +1 -0
  229. handyhelpers/static/node_modules/dot-case/dist/index.spec.js +26 -0
  230. handyhelpers/static/node_modules/dot-case/dist/index.spec.js.map +1 -0
  231. handyhelpers/static/node_modules/dot-case/dist.es2015/index.d.ts +3 -0
  232. handyhelpers/static/node_modules/dot-case/dist.es2015/index.js +7 -0
  233. handyhelpers/static/node_modules/dot-case/dist.es2015/index.js.map +1 -0
  234. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.d.ts +1 -0
  235. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.js +24 -0
  236. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.js.map +1 -0
  237. handyhelpers/static/node_modules/dot-case/package.json +89 -0
  238. handyhelpers/static/node_modules/entities/LICENSE +11 -0
  239. handyhelpers/static/node_modules/entities/package.json +90 -0
  240. handyhelpers/static/node_modules/entities/readme.md +122 -0
  241. handyhelpers/static/node_modules/esbuild/LICENSE.md +21 -0
  242. handyhelpers/static/node_modules/esbuild/README.md +3 -0
  243. handyhelpers/static/node_modules/esbuild/bin/esbuild +0 -0
  244. handyhelpers/static/node_modules/esbuild/install.js +286 -0
  245. handyhelpers/static/node_modules/esbuild/package.json +47 -0
  246. handyhelpers/static/node_modules/find-up/index.d.ts +247 -0
  247. handyhelpers/static/node_modules/find-up/index.js +107 -0
  248. handyhelpers/static/node_modules/find-up/license +9 -0
  249. handyhelpers/static/node_modules/find-up/package.json +61 -0
  250. handyhelpers/static/node_modules/find-up/readme.md +160 -0
  251. handyhelpers/static/node_modules/fun-effects/LICENSE +674 -0
  252. handyhelpers/static/node_modules/fun-effects/README.md +10 -0
  253. handyhelpers/static/node_modules/fun-effects/dist/css/background_icons.min.css +1 -0
  254. handyhelpers/static/node_modules/fun-effects/dist/css/blur_group.min.css +1 -0
  255. handyhelpers/static/node_modules/fun-effects/dist/css/fades.min.css +1 -0
  256. handyhelpers/static/node_modules/fun-effects/dist/css/marquee.min.css +1 -0
  257. handyhelpers/static/node_modules/fun-effects/dist/css/scroller.min.css +1 -0
  258. handyhelpers/static/node_modules/fun-effects/dist/index.js +15 -0
  259. handyhelpers/static/node_modules/fun-effects/dist/js/background_icons.min.js +1 -0
  260. handyhelpers/static/node_modules/fun-effects/dist/js/marquee.min.js +1 -0
  261. handyhelpers/static/node_modules/fun-effects/dist/js/scroller.min.js +1 -0
  262. handyhelpers/static/node_modules/fun-effects/package.json +39 -0
  263. handyhelpers/static/node_modules/fun-effects/src/css/background_icons.css +39 -0
  264. handyhelpers/static/node_modules/fun-effects/src/css/blur_group.css +22 -0
  265. handyhelpers/static/node_modules/fun-effects/src/css/fades.css +94 -0
  266. handyhelpers/static/node_modules/fun-effects/src/css/marquee.css +45 -0
  267. handyhelpers/static/node_modules/fun-effects/src/css/scroller.css +144 -0
  268. handyhelpers/static/node_modules/fun-effects/src/index.js +15 -0
  269. handyhelpers/static/node_modules/fun-effects/src/js/background_icons.js +101 -0
  270. handyhelpers/static/node_modules/fun-effects/src/js/marquee.js +81 -0
  271. handyhelpers/static/node_modules/fun-effects/src/js/scroller.js +37 -0
  272. handyhelpers/static/node_modules/html-minifier-terser/LICENSE +22 -0
  273. handyhelpers/static/node_modules/html-minifier-terser/README.md +168 -0
  274. handyhelpers/static/node_modules/html-minifier-terser/cli.js +308 -0
  275. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.cjs +1857 -0
  276. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.esm.bundle.js +57509 -0
  277. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.umd.bundle.js +57520 -0
  278. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.umd.bundle.min.js +9 -0
  279. handyhelpers/static/node_modules/html-minifier-terser/package.json +105 -0
  280. handyhelpers/static/node_modules/html-minifier-terser/src/htmlminifier.js +1366 -0
  281. handyhelpers/static/node_modules/html-minifier-terser/src/htmlparser.js +565 -0
  282. handyhelpers/static/node_modules/html-minifier-terser/src/tokenchain.js +68 -0
  283. handyhelpers/static/node_modules/html-minifier-terser/src/utils.js +11 -0
  284. handyhelpers/static/node_modules/jju/LICENSE +21 -0
  285. handyhelpers/static/node_modules/jju/Makefile +20 -0
  286. handyhelpers/static/node_modules/jju/README.md +249 -0
  287. handyhelpers/static/node_modules/jju/index.js +32 -0
  288. handyhelpers/static/node_modules/jju/package.json +34 -0
  289. handyhelpers/static/node_modules/jju/package.yaml +36 -0
  290. handyhelpers/static/node_modules/locate-path/index.d.ts +92 -0
  291. handyhelpers/static/node_modules/locate-path/index.js +77 -0
  292. handyhelpers/static/node_modules/locate-path/license +9 -0
  293. handyhelpers/static/node_modules/locate-path/package.json +48 -0
  294. handyhelpers/static/node_modules/locate-path/readme.md +123 -0
  295. handyhelpers/static/node_modules/lower-case/LICENSE +21 -0
  296. handyhelpers/static/node_modules/lower-case/README.md +35 -0
  297. handyhelpers/static/node_modules/lower-case/dist/index.d.ts +8 -0
  298. handyhelpers/static/node_modules/lower-case/dist/index.js +53 -0
  299. handyhelpers/static/node_modules/lower-case/dist/index.js.map +1 -0
  300. handyhelpers/static/node_modules/lower-case/dist/index.spec.d.ts +1 -0
  301. handyhelpers/static/node_modules/lower-case/dist/index.spec.js +36 -0
  302. handyhelpers/static/node_modules/lower-case/dist/index.spec.js.map +1 -0
  303. handyhelpers/static/node_modules/lower-case/dist.es2015/index.d.ts +8 -0
  304. handyhelpers/static/node_modules/lower-case/dist.es2015/index.js +48 -0
  305. handyhelpers/static/node_modules/lower-case/dist.es2015/index.js.map +1 -0
  306. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.d.ts +1 -0
  307. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.js +34 -0
  308. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.js.map +1 -0
  309. handyhelpers/static/node_modules/lower-case/package.json +87 -0
  310. handyhelpers/static/node_modules/minify/ChangeLog +1307 -0
  311. handyhelpers/static/node_modules/minify/LICENSE +22 -0
  312. handyhelpers/static/node_modules/minify/README.md +177 -0
  313. handyhelpers/static/node_modules/minify/bin/minify.js +98 -0
  314. handyhelpers/static/node_modules/minify/deno.json +5 -0
  315. handyhelpers/static/node_modules/minify/help.json +8 -0
  316. handyhelpers/static/node_modules/minify/package.json +65 -0
  317. handyhelpers/static/node_modules/ms/index.js +162 -0
  318. handyhelpers/static/node_modules/ms/license.md +21 -0
  319. handyhelpers/static/node_modules/ms/package.json +38 -0
  320. handyhelpers/static/node_modules/ms/readme.md +59 -0
  321. handyhelpers/static/node_modules/no-case/LICENSE +21 -0
  322. handyhelpers/static/node_modules/no-case/README.md +37 -0
  323. handyhelpers/static/node_modules/no-case/dist/index.d.ts +10 -0
  324. handyhelpers/static/node_modules/no-case/dist/index.js +35 -0
  325. handyhelpers/static/node_modules/no-case/dist/index.js.map +1 -0
  326. handyhelpers/static/node_modules/no-case/dist/index.spec.d.ts +1 -0
  327. handyhelpers/static/node_modules/no-case/dist/index.spec.js +59 -0
  328. handyhelpers/static/node_modules/no-case/dist/index.spec.js.map +1 -0
  329. handyhelpers/static/node_modules/no-case/dist.es2015/index.d.ts +10 -0
  330. handyhelpers/static/node_modules/no-case/dist.es2015/index.js +31 -0
  331. handyhelpers/static/node_modules/no-case/dist.es2015/index.js.map +1 -0
  332. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.d.ts +1 -0
  333. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.js +57 -0
  334. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.js.map +1 -0
  335. handyhelpers/static/node_modules/no-case/package.json +85 -0
  336. handyhelpers/static/node_modules/p-limit/index.d.ts +40 -0
  337. handyhelpers/static/node_modules/p-limit/index.js +68 -0
  338. handyhelpers/static/node_modules/p-limit/license +9 -0
  339. handyhelpers/static/node_modules/p-limit/package.json +54 -0
  340. handyhelpers/static/node_modules/p-limit/readme.md +99 -0
  341. handyhelpers/static/node_modules/p-locate/index.d.ts +49 -0
  342. handyhelpers/static/node_modules/p-locate/index.js +48 -0
  343. handyhelpers/static/node_modules/p-locate/license +9 -0
  344. handyhelpers/static/node_modules/p-locate/package.json +56 -0
  345. handyhelpers/static/node_modules/p-locate/readme.md +91 -0
  346. handyhelpers/static/node_modules/param-case/LICENSE +21 -0
  347. handyhelpers/static/node_modules/param-case/README.md +37 -0
  348. handyhelpers/static/node_modules/param-case/dist/index.d.ts +3 -0
  349. handyhelpers/static/node_modules/param-case/dist/index.js +11 -0
  350. handyhelpers/static/node_modules/param-case/dist/index.js.map +1 -0
  351. handyhelpers/static/node_modules/param-case/dist/index.spec.d.ts +1 -0
  352. handyhelpers/static/node_modules/param-case/dist/index.spec.js +24 -0
  353. handyhelpers/static/node_modules/param-case/dist/index.spec.js.map +1 -0
  354. handyhelpers/static/node_modules/param-case/dist.es2015/index.d.ts +3 -0
  355. handyhelpers/static/node_modules/param-case/dist.es2015/index.js +7 -0
  356. handyhelpers/static/node_modules/param-case/dist.es2015/index.js.map +1 -0
  357. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.d.ts +1 -0
  358. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.js +22 -0
  359. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.js.map +1 -0
  360. handyhelpers/static/node_modules/param-case/package.json +91 -0
  361. handyhelpers/static/node_modules/pascal-case/LICENSE +21 -0
  362. handyhelpers/static/node_modules/pascal-case/README.md +47 -0
  363. handyhelpers/static/node_modules/pascal-case/dist/index.d.ts +5 -0
  364. handyhelpers/static/node_modules/pascal-case/dist/index.js +24 -0
  365. handyhelpers/static/node_modules/pascal-case/dist/index.js.map +1 -0
  366. handyhelpers/static/node_modules/pascal-case/dist/index.spec.d.ts +1 -0
  367. handyhelpers/static/node_modules/pascal-case/dist/index.spec.js +25 -0
  368. handyhelpers/static/node_modules/pascal-case/dist/index.spec.js.map +1 -0
  369. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.d.ts +5 -0
  370. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.js +18 -0
  371. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.js.map +1 -0
  372. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.d.ts +1 -0
  373. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.js +23 -0
  374. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.js.map +1 -0
  375. handyhelpers/static/node_modules/pascal-case/package.json +90 -0
  376. handyhelpers/static/node_modules/path-exists/index.d.ts +31 -0
  377. handyhelpers/static/node_modules/path-exists/index.js +19 -0
  378. handyhelpers/static/node_modules/path-exists/license +9 -0
  379. handyhelpers/static/node_modules/path-exists/package.json +41 -0
  380. handyhelpers/static/node_modules/path-exists/readme.md +52 -0
  381. handyhelpers/static/node_modules/readjson/ChangeLog +110 -0
  382. handyhelpers/static/node_modules/readjson/LICENSE +21 -0
  383. handyhelpers/static/node_modules/readjson/README.md +36 -0
  384. handyhelpers/static/node_modules/readjson/package.json +46 -0
  385. handyhelpers/static/node_modules/relateurl/README.md +159 -0
  386. handyhelpers/static/node_modules/relateurl/license +21 -0
  387. handyhelpers/static/node_modules/relateurl/package.json +46 -0
  388. handyhelpers/static/node_modules/simport/ChangeLog +77 -0
  389. handyhelpers/static/node_modules/simport/LICENSE +21 -0
  390. handyhelpers/static/node_modules/simport/README.md +81 -0
  391. handyhelpers/static/node_modules/simport/fixture/context.js +3 -0
  392. handyhelpers/static/node_modules/simport/fixture/default-frozen-function.mjs +2 -0
  393. handyhelpers/static/node_modules/simport/fixture/default-frozen-object.mjs +2 -0
  394. handyhelpers/static/node_modules/simport/package.json +65 -0
  395. handyhelpers/static/node_modules/simport/simport.js +84 -0
  396. handyhelpers/static/node_modules/simport/simport.mjs +22 -0
  397. handyhelpers/static/node_modules/source-map/CHANGELOG.md +301 -0
  398. handyhelpers/static/node_modules/source-map/LICENSE +28 -0
  399. handyhelpers/static/node_modules/source-map/README.md +742 -0
  400. handyhelpers/static/node_modules/source-map/dist/source-map.debug.js +3234 -0
  401. handyhelpers/static/node_modules/source-map/dist/source-map.js +3233 -0
  402. handyhelpers/static/node_modules/source-map/dist/source-map.min.js +2 -0
  403. handyhelpers/static/node_modules/source-map/dist/source-map.min.js.map +1 -0
  404. handyhelpers/static/node_modules/source-map/package.json +73 -0
  405. handyhelpers/static/node_modules/source-map/source-map.d.ts +98 -0
  406. handyhelpers/static/node_modules/source-map/source-map.js +8 -0
  407. handyhelpers/static/node_modules/source-map-support/LICENSE.md +21 -0
  408. handyhelpers/static/node_modules/source-map-support/README.md +284 -0
  409. handyhelpers/static/node_modules/source-map-support/browser-source-map-support.js +114 -0
  410. handyhelpers/static/node_modules/source-map-support/package.json +31 -0
  411. handyhelpers/static/node_modules/source-map-support/register-hook-require.js +1 -0
  412. handyhelpers/static/node_modules/source-map-support/register.js +1 -0
  413. handyhelpers/static/node_modules/source-map-support/source-map-support.js +625 -0
  414. handyhelpers/static/node_modules/terser/CHANGELOG.md +783 -0
  415. handyhelpers/static/node_modules/terser/LICENSE +27 -0
  416. handyhelpers/static/node_modules/terser/PATRONS.md +15 -0
  417. handyhelpers/static/node_modules/terser/README.md +1421 -0
  418. handyhelpers/static/node_modules/terser/bin/package.json +10 -0
  419. handyhelpers/static/node_modules/terser/bin/terser +21 -0
  420. handyhelpers/static/node_modules/terser/bin/uglifyjs +10 -0
  421. handyhelpers/static/node_modules/terser/dist/.gitkeep +0 -0
  422. handyhelpers/static/node_modules/terser/dist/bundle.min.js +32962 -0
  423. handyhelpers/static/node_modules/terser/dist/package.json +10 -0
  424. handyhelpers/static/node_modules/terser/main.js +27 -0
  425. handyhelpers/static/node_modules/terser/node_modules/commander/CHANGELOG.md +419 -0
  426. handyhelpers/static/node_modules/terser/node_modules/commander/LICENSE +22 -0
  427. handyhelpers/static/node_modules/terser/node_modules/commander/Readme.md +428 -0
  428. handyhelpers/static/node_modules/terser/node_modules/commander/index.js +1224 -0
  429. handyhelpers/static/node_modules/terser/node_modules/commander/package.json +38 -0
  430. handyhelpers/static/node_modules/terser/node_modules/commander/typings/index.d.ts +310 -0
  431. handyhelpers/static/node_modules/terser/package.json +153 -0
  432. handyhelpers/static/node_modules/terser/tools/domprops.js +9026 -0
  433. handyhelpers/static/node_modules/terser/tools/exit.cjs +7 -0
  434. handyhelpers/static/node_modules/terser/tools/props.html +68 -0
  435. handyhelpers/static/node_modules/terser/tools/terser.d.ts +216 -0
  436. handyhelpers/static/node_modules/tippy.js/LICENSE +21 -0
  437. handyhelpers/static/node_modules/tippy.js/README.md +63 -0
  438. handyhelpers/static/node_modules/tippy.js/animations/perspective-extreme.css +1 -0
  439. handyhelpers/static/node_modules/tippy.js/animations/perspective-subtle.css +1 -0
  440. handyhelpers/static/node_modules/tippy.js/animations/perspective.css +1 -0
  441. handyhelpers/static/node_modules/tippy.js/animations/scale-extreme.css +1 -0
  442. handyhelpers/static/node_modules/tippy.js/animations/scale-subtle.css +1 -0
  443. handyhelpers/static/node_modules/tippy.js/animations/scale.css +1 -0
  444. handyhelpers/static/node_modules/tippy.js/animations/shift-away-extreme.css +1 -0
  445. handyhelpers/static/node_modules/tippy.js/animations/shift-away-subtle.css +1 -0
  446. handyhelpers/static/node_modules/tippy.js/animations/shift-away.css +1 -0
  447. handyhelpers/static/node_modules/tippy.js/animations/shift-toward-extreme.css +1 -0
  448. handyhelpers/static/node_modules/tippy.js/animations/shift-toward-subtle.css +1 -0
  449. handyhelpers/static/node_modules/tippy.js/animations/shift-toward.css +1 -0
  450. handyhelpers/static/node_modules/tippy.js/dist/backdrop.css +1 -0
  451. handyhelpers/static/node_modules/tippy.js/dist/border.css +1 -0
  452. handyhelpers/static/node_modules/tippy.js/dist/svg-arrow.css +1 -0
  453. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.js +2516 -0
  454. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.js.map +1 -0
  455. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.min.js +2 -0
  456. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.min.js.map +1 -0
  457. handyhelpers/static/node_modules/tippy.js/dist/tippy.cjs.js +2497 -0
  458. handyhelpers/static/node_modules/tippy.js/dist/tippy.cjs.js.map +1 -0
  459. handyhelpers/static/node_modules/tippy.js/dist/tippy.css +1 -0
  460. handyhelpers/static/node_modules/tippy.js/dist/tippy.esm.js +2486 -0
  461. handyhelpers/static/node_modules/tippy.js/dist/tippy.esm.js.map +1 -0
  462. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.js +2496 -0
  463. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.js.map +1 -0
  464. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.min.js +2 -0
  465. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.min.js.map +1 -0
  466. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.cjs.js +2388 -0
  467. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.cjs.js.map +1 -0
  468. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.esm.js +2377 -0
  469. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.esm.js.map +1 -0
  470. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.js +2382 -0
  471. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.js.map +1 -0
  472. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.min.js +2 -0
  473. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.min.js.map +1 -0
  474. handyhelpers/static/node_modules/tippy.js/headless/package.json +16 -0
  475. handyhelpers/static/node_modules/tippy.js/index.d.ts +260 -0
  476. handyhelpers/static/node_modules/tippy.js/package.json +157 -0
  477. handyhelpers/static/node_modules/tippy.js/themes/light-border.css +1 -0
  478. handyhelpers/static/node_modules/tippy.js/themes/light.css +1 -0
  479. handyhelpers/static/node_modules/tippy.js/themes/material.css +1 -0
  480. handyhelpers/static/node_modules/tippy.js/themes/translucent.css +1 -0
  481. handyhelpers/static/node_modules/try-catch/ChangeLog +55 -0
  482. handyhelpers/static/node_modules/try-catch/LICENSE +21 -0
  483. handyhelpers/static/node_modules/try-catch/README.md +38 -0
  484. handyhelpers/static/node_modules/try-catch/package.json +34 -0
  485. handyhelpers/static/node_modules/try-to-catch/ChangeLog +64 -0
  486. handyhelpers/static/node_modules/try-to-catch/LICENSE +21 -0
  487. handyhelpers/static/node_modules/try-to-catch/README.md +74 -0
  488. handyhelpers/static/node_modules/try-to-catch/package.json +47 -0
  489. handyhelpers/static/node_modules/tslib/CopyrightNotice.txt +15 -0
  490. handyhelpers/static/node_modules/tslib/LICENSE.txt +12 -0
  491. handyhelpers/static/node_modules/tslib/README.md +164 -0
  492. handyhelpers/static/node_modules/tslib/SECURITY.md +41 -0
  493. handyhelpers/static/node_modules/tslib/modules/index.d.ts +38 -0
  494. handyhelpers/static/node_modules/tslib/modules/index.js +70 -0
  495. handyhelpers/static/node_modules/tslib/modules/package.json +3 -0
  496. handyhelpers/static/node_modules/tslib/package.json +47 -0
  497. handyhelpers/static/node_modules/tslib/tslib.d.ts +460 -0
  498. handyhelpers/static/node_modules/tslib/tslib.es6.html +1 -0
  499. handyhelpers/static/node_modules/tslib/tslib.es6.js +402 -0
  500. handyhelpers/static/node_modules/tslib/tslib.es6.mjs +401 -0
  501. handyhelpers/static/node_modules/tslib/tslib.html +1 -0
  502. handyhelpers/static/node_modules/tslib/tslib.js +484 -0
  503. handyhelpers/static/node_modules/uglify-js/LICENSE +29 -0
  504. handyhelpers/static/node_modules/uglify-js/README.md +1479 -0
  505. handyhelpers/static/node_modules/uglify-js/bin/uglifyjs +624 -0
  506. handyhelpers/static/node_modules/uglify-js/package.json +56 -0
  507. handyhelpers/static/node_modules/uglify-js/tools/domprops.html +456 -0
  508. handyhelpers/static/node_modules/uglify-js/tools/domprops.json +8327 -0
  509. handyhelpers/static/node_modules/uglify-js/tools/exports.js +8 -0
  510. handyhelpers/static/node_modules/uglify-js/tools/node.js +115 -0
  511. handyhelpers/static/node_modules/uglify-js/tools/tty.js +22 -0
  512. handyhelpers/static/node_modules/unicorn-magic/default.js +14 -0
  513. handyhelpers/static/node_modules/unicorn-magic/index.d.ts +29 -0
  514. handyhelpers/static/node_modules/unicorn-magic/license +9 -0
  515. handyhelpers/static/node_modules/unicorn-magic/node.js +7 -0
  516. handyhelpers/static/node_modules/unicorn-magic/package.json +49 -0
  517. handyhelpers/static/node_modules/unicorn-magic/readme.md +25 -0
  518. handyhelpers/static/node_modules/yocto-queue/index.d.ts +61 -0
  519. handyhelpers/static/node_modules/yocto-queue/index.js +78 -0
  520. handyhelpers/static/node_modules/yocto-queue/license +9 -0
  521. handyhelpers/static/node_modules/yocto-queue/package.json +48 -0
  522. handyhelpers/static/node_modules/yocto-queue/readme.md +70 -0
  523. handyhelpers/static/package.json +3 -1
  524. handyhelpers/static/yarn.lock +393 -20
  525. handyhelpers/templates/handyhelpers/generic/bs5/generic_index.html +5 -8
  526. handyhelpers/templates/handyhelpers/handyhelpers_base_bs5.htm +5 -1
  527. handyhelpers/templates/handyhelpers/handyhelpers_with_sidebar.htm +50 -3
  528. handyhelpers/templates/handyhelpers/htmx/bs5/filter_form/generic_modal_swap.htm +48 -0
  529. handyhelpers/templates/handyhelpers/htmx/bs5/form/form_wrapper.htm +48 -0
  530. handyhelpers/templates/handyhelpers/htmx/bs5/form/inline_form.htm +166 -0
  531. handyhelpers/templates/handyhelpers/htmx/bs5/form/inline_form_disabled.htm +125 -0
  532. handyhelpers/templates/handyhelpers/htmx/bs5/generic_modal_swap.htm +2 -3
  533. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/content_title.htm +38 -0
  534. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/controls.htm +21 -0
  535. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/card.htm +17 -0
  536. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/list.htm +11 -0
  537. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/table.htm +21 -0
  538. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/filter_form_modal_swap.htm +48 -0
  539. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/full.html +6 -0
  540. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_card.htm +7 -0
  541. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_list.htm +7 -0
  542. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_minimal.htm +7 -0
  543. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_table.htm +18 -0
  544. handyhelpers/templates/handyhelpers/htmx/bs5/index.htm +34 -0
  545. handyhelpers/templates/handyhelpers/report/annual_stats.html +6 -0
  546. handyhelpers/templates/handyhelpers/report/annual_stats_content.htm +43 -0
  547. handyhelpers/templates/handyhelpers/report/chartjs/annual_progress_chart.htm +1 -1
  548. handyhelpers/templates/handyhelpers/report/chartjs/annual_progress_content.htm +40 -39
  549. handyhelpers/templates/handyhelpers/report/chartjs/annual_stats.html +25 -36
  550. handyhelpers/templates/handyhelpers/report/chartjs/annual_trends_content.htm +35 -34
  551. handyhelpers/templates/handyhelpers/report/chartjs/day_count_chart.htm +1 -1
  552. handyhelpers/templates/handyhelpers/report/chartjs/month_count_chart.htm +1 -1
  553. handyhelpers/templates/handyhelpers/report/chartjs/week_count_chart.htm +1 -1
  554. handyhelpers/templates/handyhelpers/report/chartjs/year_count_chart.htm +1 -1
  555. handyhelpers/templatetags/form_tags.py +47 -0
  556. handyhelpers/templatetags/htmx_tags.py +21 -0
  557. handyhelpers/views/action.py +3 -1
  558. handyhelpers/views/calendar.py +33 -14
  559. handyhelpers/views/htmx.py +396 -4
  560. handyhelpers/views/report.py +12 -5
  561. handyhelpers/management/commands/generate_admin.py +0 -110
  562. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/format.js +0 -9
  563. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/validateModifiers.js +0 -81
  564. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.d.ts +0 -1
  565. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.js +0 -9
  566. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.js.flow +0 -5
  567. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.d.ts +0 -1
  568. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.js +0 -81
  569. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.js.flow +0 -151
  570. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/LICENSE +0 -0
  571. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1479 @@
1
+ UglifyJS 3
2
+ ==========
3
+
4
+ UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit.
5
+
6
+ #### Note:
7
+ - `uglify-js` supports JavaScript and most language features in ECMAScript.
8
+ - For more exotic parts of ECMAScript, process your source file with transpilers
9
+ like [Babel](https://babeljs.io/) before passing onto `uglify-js`.
10
+ - `uglify-js@3` has a simplified [API](#api-reference) and [CLI](#command-line-usage)
11
+ that is not backwards compatible with [`uglify-js@2`](https://github.com/mishoo/UglifyJS/tree/v2.x).
12
+
13
+ Install
14
+ -------
15
+
16
+ First make sure you have installed the latest version of [node.js](http://nodejs.org/)
17
+ (You may need to restart your computer after this step).
18
+
19
+ From NPM for use as a command line app:
20
+
21
+ npm install uglify-js -g
22
+
23
+ From NPM for programmatic use:
24
+
25
+ npm install uglify-js
26
+
27
+ # Command line usage
28
+
29
+ uglifyjs [input files] [options]
30
+
31
+ UglifyJS can take multiple input files. It's recommended that you pass the
32
+ input files first, then pass the options. UglifyJS will parse input files
33
+ in sequence and apply any compression options. The files are parsed in the
34
+ same global scope, that is, a reference from a file to some
35
+ variable/function declared in another file will be matched properly.
36
+
37
+ If no input file is specified, UglifyJS will read from STDIN.
38
+
39
+ If you wish to pass your options before the input files, separate the two with
40
+ a double dash to prevent input files being used as option arguments:
41
+
42
+ uglifyjs --compress --mangle -- input.js
43
+
44
+ ### Command line options
45
+
46
+ ```
47
+ -h, --help Print usage information.
48
+ `--help options` for details on available options.
49
+ -V, --version Print version number.
50
+ -p, --parse <options> Specify parser options:
51
+ `acorn` Use Acorn for parsing.
52
+ `bare_returns` Allow return outside of functions.
53
+ Useful when minifying CommonJS
54
+ modules and Userscripts that may
55
+ be anonymous function wrapped (IIFE)
56
+ by the .user.js engine `caller`.
57
+ `spidermonkey` Assume input files are SpiderMonkey
58
+ AST format (as JSON).
59
+ -c, --compress [options] Enable compressor/specify compressor options:
60
+ `pure_funcs` List of functions that can be safely
61
+ removed when their return values are
62
+ not used.
63
+ -m, --mangle [options] Mangle names/specify mangler options:
64
+ `reserved` List of names that should not be mangled.
65
+ --mangle-props [options] Mangle properties/specify mangler options:
66
+ `builtins` Mangle property names that overlaps
67
+ with standard JavaScript globals.
68
+ `debug` Add debug prefix and suffix.
69
+ `domprops` Mangle property names that overlaps
70
+ with DOM properties.
71
+ `keep_quoted` Only mangle unquoted properties.
72
+ `regex` Only mangle matched property names.
73
+ `reserved` List of names that should not be mangled.
74
+ -b, --beautify [options] Beautify output/specify output options:
75
+ `beautify` Enabled with `--beautify` by default.
76
+ `preamble` Preamble to prepend to the output. You
77
+ can use this to insert a comment, for
78
+ example for licensing information.
79
+ This will not be parsed, but the source
80
+ map will adjust for its presence.
81
+ `quote_style` Quote style:
82
+ 0 - auto
83
+ 1 - single
84
+ 2 - double
85
+ 3 - original
86
+ `wrap_iife` Wrap IIFEs in parentheses. Note: you may
87
+ want to disable `negate_iife` under
88
+ compressor options.
89
+ -O, --output-opts [options] Specify output options (`beautify` disabled by default).
90
+ -o, --output <file> Output file path (default STDOUT). Specify `ast` or
91
+ `spidermonkey` to write UglifyJS or SpiderMonkey AST
92
+ as JSON to STDOUT respectively.
93
+ --annotations Process and preserve comment annotations.
94
+ (`/*@__PURE__*/` or `/*#__PURE__*/`)
95
+ --no-annotations Ignore and discard comment annotations.
96
+ --comments [filter] Preserve copyright comments in the output. By
97
+ default this works like Google Closure, keeping
98
+ JSDoc-style comments that contain "@license" or
99
+ "@preserve". You can optionally pass one of the
100
+ following arguments to this flag:
101
+ - "all" to keep all comments
102
+ - a valid JS RegExp like `/foo/` or `/^!/` to
103
+ keep only matching comments.
104
+ Note that currently not *all* comments can be
105
+ kept when compression is on, because of dead
106
+ code removal or cascading statements into
107
+ sequences.
108
+ --config-file <file> Read `minify()` options from JSON file.
109
+ -d, --define <expr>[=value] Global definitions.
110
+ -e, --enclose [arg[:value]] Embed everything in a big function, with configurable
111
+ argument(s) & value(s).
112
+ --expression Parse a single expression, rather than a program
113
+ (for parsing JSON).
114
+ --ie Support non-standard Internet Explorer.
115
+ Equivalent to setting `ie: true` in `minify()`
116
+ for `compress`, `mangle` and `output` options.
117
+ By default UglifyJS will not try to be IE-proof.
118
+ --keep-fargs Do not mangle/drop function arguments.
119
+ --keep-fnames Do not mangle/drop function names. Useful for
120
+ code relying on Function.prototype.name.
121
+ --module Process input as ES module (implies --toplevel)
122
+ --no-module Avoid optimizations which may alter runtime behavior
123
+ under prior versions of JavaScript.
124
+ --name-cache <file> File to hold mangled name mappings.
125
+ --self Build UglifyJS as a library (implies --wrap UglifyJS)
126
+ --source-map [options] Enable source map/specify source map options:
127
+ `base` Path to compute relative paths from input files.
128
+ `content` Input source map, useful if you're compressing
129
+ JS that was generated from some other original
130
+ code. Specify "inline" if the source map is
131
+ included within the sources.
132
+ `filename` Filename and/or location of the output source
133
+ (sets `file` attribute in source map).
134
+ `includeSources` Pass this flag if you want to include
135
+ the content of source files in the
136
+ source map as sourcesContent property.
137
+ `names` Include symbol names in the source map.
138
+ `root` Path to the original source to be included in
139
+ the source map.
140
+ `url` If specified, path to the source map to append in
141
+ `//# sourceMappingURL`.
142
+ --timings Display operations run time on STDERR.
143
+ --toplevel Compress and/or mangle variables in top level scope.
144
+ --v8 Support non-standard Chrome & Node.js
145
+ Equivalent to setting `v8: true` in `minify()`
146
+ for `mangle` and `output` options.
147
+ By default UglifyJS will not try to be v8-proof.
148
+ --verbose Print diagnostic messages.
149
+ --warn Print warning messages.
150
+ --webkit Support non-standard Safari/Webkit.
151
+ Equivalent to setting `webkit: true` in `minify()`
152
+ for `compress`, `mangle` and `output` options.
153
+ By default UglifyJS will not try to be Safari-proof.
154
+ --wrap <name> Embed everything in a big function, making the
155
+ “exports” and “global” variables available. You
156
+ need to pass an argument to this option to
157
+ specify the name that your module will take
158
+ when included in, say, a browser.
159
+ ```
160
+
161
+ Specify `--output` (`-o`) to declare the output file. Otherwise the output
162
+ goes to STDOUT.
163
+
164
+ ## CLI source map options
165
+
166
+ UglifyJS can generate a source map file, which is highly useful for
167
+ debugging your compressed JavaScript. To get a source map, pass
168
+ `--source-map --output output.js` (source map will be written out to
169
+ `output.js.map`).
170
+
171
+ Additional options:
172
+
173
+ - `--source-map "filename='<NAME>'"` to specify the name of the source map. The value of
174
+ `filename` is only used to set `file` attribute (see [the spec][sm-spec])
175
+ in source map file.
176
+
177
+ - `--source-map "root='<URL>'"` to pass the URL where the original files can be found.
178
+
179
+ - `--source-map "names=false"` to omit symbol names if you want to reduce size
180
+ of the source map file.
181
+
182
+ - `--source-map "url='<URL>'"` to specify the URL where the source map can be found.
183
+ Otherwise UglifyJS assumes HTTP `X-SourceMap` is being used and will omit the
184
+ `//# sourceMappingURL=` directive.
185
+
186
+ For example:
187
+
188
+ uglifyjs js/file1.js js/file2.js \
189
+ -o foo.min.js -c -m \
190
+ --source-map "root='http://foo.com/src',url='foo.min.js.map'"
191
+
192
+ The above will compress and mangle `file1.js` and `file2.js`, will drop the
193
+ output in `foo.min.js` and the source map in `foo.min.js.map`. The source
194
+ mapping will refer to `http://foo.com/src/js/file1.js` and
195
+ `http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src`
196
+ as the source map root, and the original files as `js/file1.js` and
197
+ `js/file2.js`).
198
+
199
+ ### Composed source map
200
+
201
+ When you're compressing JS code that was output by a compiler such as
202
+ CoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd
203
+ like to map back to the original code (i.e. CoffeeScript). UglifyJS has an
204
+ option to take an input source map. Assuming you have a mapping from
205
+ CoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript →
206
+ compressed JS by mapping every token in the compiled JS to its original
207
+ location.
208
+
209
+ To use this feature pass `--source-map "content='/path/to/input/source.map'"`
210
+ or `--source-map "content=inline"` if the source map is included inline with
211
+ the sources.
212
+
213
+ ## CLI compress options
214
+
215
+ You need to pass `--compress` (`-c`) to enable the compressor. Optionally
216
+ you can pass a comma-separated list of [compress options](#compress-options).
217
+
218
+ Options are in the form `foo=bar`, or just `foo` (the latter implies
219
+ a boolean option that you want to set `true`; it's effectively a
220
+ shortcut for `foo=true`).
221
+
222
+ Example:
223
+
224
+ uglifyjs file.js -c toplevel,sequences=false
225
+
226
+ ## CLI mangle options
227
+
228
+ To enable the mangler you need to pass `--mangle` (`-m`). The following
229
+ (comma-separated) options are supported:
230
+
231
+ - `eval` (default: `false`) — mangle names visible in scopes where `eval` or
232
+ `with` are used.
233
+
234
+ - `reserved` (default: `[]`) — when mangling is enabled but you want to
235
+ prevent certain names from being mangled, you can declare those names with
236
+ `--mangle reserved` — pass a comma-separated list of names. For example:
237
+
238
+ uglifyjs ... -m reserved=['$','require','exports']
239
+
240
+ to prevent the `require`, `exports` and `$` names from being changed.
241
+
242
+ ### CLI mangling property names (`--mangle-props`)
243
+
244
+ **Note:** THIS WILL PROBABLY BREAK YOUR CODE. Mangling property names
245
+ is a separate step, different from variable name mangling. Pass
246
+ `--mangle-props` to enable it. It will mangle all properties in the
247
+ input code with the exception of built in DOM properties and properties
248
+ in core JavaScript classes. For example:
249
+
250
+ ```javascript
251
+ // example.js
252
+ var x = {
253
+ baz_: 0,
254
+ foo_: 1,
255
+ calc: function() {
256
+ return this.foo_ + this.baz_;
257
+ }
258
+ };
259
+ x.bar_ = 2;
260
+ x["baz_"] = 3;
261
+ console.log(x.calc());
262
+ ```
263
+ Mangle all properties (except for JavaScript `builtins`):
264
+ ```bash
265
+ $ uglifyjs example.js -c -m --mangle-props
266
+ ```
267
+ ```javascript
268
+ var x={o:0,_:1,l:function(){return this._+this.o}};x.t=2,x.o=3,console.log(x.l());
269
+ ```
270
+ Mangle all properties except for `reserved` properties:
271
+ ```bash
272
+ $ uglifyjs example.js -c -m --mangle-props reserved=[foo_,bar_]
273
+ ```
274
+ ```javascript
275
+ var x={o:0,foo_:1,_:function(){return this.foo_+this.o}};x.bar_=2,x.o=3,console.log(x._());
276
+ ```
277
+ Mangle all properties matching a `regex`:
278
+ ```bash
279
+ $ uglifyjs example.js -c -m --mangle-props regex=/_$/
280
+ ```
281
+ ```javascript
282
+ var x={o:0,_:1,calc:function(){return this._+this.o}};x.l=2,x.o=3,console.log(x.calc());
283
+ ```
284
+
285
+ Combining mangle properties options:
286
+ ```bash
287
+ $ uglifyjs example.js -c -m --mangle-props regex=/_$/,reserved=[bar_]
288
+ ```
289
+ ```javascript
290
+ var x={o:0,_:1,calc:function(){return this._+this.o}};x.bar_=2,x.o=3,console.log(x.calc());
291
+ ```
292
+
293
+ In order for this to be of any use, we avoid mangling standard JS names by
294
+ default (`--mangle-props builtins` to override).
295
+
296
+ A default exclusion file is provided in `tools/domprops.json` which should
297
+ cover most standard JS and DOM properties defined in various browsers. Pass
298
+ `--mangle-props domprops` to disable this feature.
299
+
300
+ A regular expression can be used to define which property names should be
301
+ mangled. For example, `--mangle-props regex=/^_/` will only mangle property
302
+ names that start with an underscore.
303
+
304
+ When you compress multiple files using this option, in order for them to
305
+ work together in the end we need to ensure somehow that one property gets
306
+ mangled to the same name in all of them. For this, pass `--name-cache filename.json`
307
+ and UglifyJS will maintain these mappings in a file which can then be reused.
308
+ It should be initially empty. Example:
309
+
310
+ ```bash
311
+ $ rm -f /tmp/cache.json # start fresh
312
+ $ uglifyjs file1.js file2.js --mangle-props --name-cache /tmp/cache.json -o part1.js
313
+ $ uglifyjs file3.js file4.js --mangle-props --name-cache /tmp/cache.json -o part2.js
314
+ ```
315
+
316
+ Now, `part1.js` and `part2.js` will be consistent with each other in terms
317
+ of mangled property names.
318
+
319
+ Using the name cache is not necessary if you compress all your files in a
320
+ single call to UglifyJS.
321
+
322
+ ### Mangling unquoted names (`--mangle-props keep_quoted`)
323
+
324
+ Using quoted property name (`o["foo"]`) reserves the property name (`foo`)
325
+ so that it is not mangled throughout the entire script even when used in an
326
+ unquoted style (`o.foo`). Example:
327
+
328
+ ```javascript
329
+ // stuff.js
330
+ var o = {
331
+ "foo": 1,
332
+ bar: 3,
333
+ };
334
+ o.foo += o.bar;
335
+ console.log(o.foo);
336
+ ```
337
+ ```bash
338
+ $ uglifyjs stuff.js --mangle-props keep_quoted -c -m
339
+ ```
340
+ ```javascript
341
+ var o={foo:1,o:3};o.foo+=o.o,console.log(o.foo);
342
+ ```
343
+
344
+ If the minified output will be processed again by UglifyJS, consider specifying
345
+ `keep_quoted_props` so the same property names are preserved:
346
+
347
+ ```bash
348
+ $ uglifyjs stuff.js --mangle-props keep_quoted -c -m -O keep_quoted_props
349
+ ```
350
+ ```javascript
351
+ var o={"foo":1,o:3};o.foo+=o.o,console.log(o.foo);
352
+ ```
353
+
354
+ ### Debugging property name mangling
355
+
356
+ You can also pass `--mangle-props debug` in order to mangle property names
357
+ without completely obscuring them. For example the property `o.foo`
358
+ would mangle to `o._$foo$_` with this option. This allows property mangling
359
+ of a large codebase while still being able to debug the code and identify
360
+ where mangling is breaking things.
361
+
362
+ ```bash
363
+ $ uglifyjs stuff.js --mangle-props debug -c -m
364
+ ```
365
+ ```javascript
366
+ var o={_$foo$_:1,_$bar$_:3};o._$foo$_+=o._$bar$_,console.log(o._$foo$_);
367
+ ```
368
+
369
+ You can also pass a custom suffix using `--mangle-props debug=XYZ`. This would then
370
+ mangle `o.foo` to `o._$foo$XYZ_`. You can change this each time you compile a
371
+ script to identify how a property got mangled. One technique is to pass a
372
+ random number on every compile to simulate mangling changing with different
373
+ inputs (e.g. as you update the input script with new properties), and to help
374
+ identify mistakes like writing mangled keys to storage.
375
+
376
+
377
+ # API Reference
378
+
379
+ Assuming installation via NPM, you can load UglifyJS in your application
380
+ like this:
381
+ ```javascript
382
+ var UglifyJS = require("uglify-js");
383
+ ```
384
+
385
+ There is a single high level function, **`minify(code, options)`**,
386
+ which will perform all minification [phases](#minify-options) in a configurable
387
+ manner. By default `minify()` will enable the options [`compress`](#compress-options)
388
+ and [`mangle`](#mangle-options). Example:
389
+ ```javascript
390
+ var code = "function add(first, second) { return first + second; }";
391
+ var result = UglifyJS.minify(code);
392
+ console.log(result.error); // runtime error, or `undefined` if no error
393
+ console.log(result.code); // minified output: function add(n,d){return n+d}
394
+ ```
395
+
396
+ You can `minify` more than one JavaScript file at a time by using an object
397
+ for the first argument where the keys are file names and the values are source
398
+ code:
399
+ ```javascript
400
+ var code = {
401
+ "file1.js": "function add(first, second) { return first + second; }",
402
+ "file2.js": "console.log(add(1 + 2, 3 + 4));"
403
+ };
404
+ var result = UglifyJS.minify(code);
405
+ console.log(result.code);
406
+ // function add(d,n){return d+n}console.log(add(3,7));
407
+ ```
408
+
409
+ The `toplevel` option:
410
+ ```javascript
411
+ var code = {
412
+ "file1.js": "function add(first, second) { return first + second; }",
413
+ "file2.js": "console.log(add(1 + 2, 3 + 4));"
414
+ };
415
+ var options = { toplevel: true };
416
+ var result = UglifyJS.minify(code, options);
417
+ console.log(result.code);
418
+ // console.log(3+7);
419
+ ```
420
+
421
+ The `nameCache` option:
422
+ ```javascript
423
+ var options = {
424
+ mangle: {
425
+ toplevel: true,
426
+ },
427
+ nameCache: {}
428
+ };
429
+ var result1 = UglifyJS.minify({
430
+ "file1.js": "function add(first, second) { return first + second; }"
431
+ }, options);
432
+ var result2 = UglifyJS.minify({
433
+ "file2.js": "console.log(add(1 + 2, 3 + 4));"
434
+ }, options);
435
+ console.log(result1.code);
436
+ // function n(n,r){return n+r}
437
+ console.log(result2.code);
438
+ // console.log(n(3,7));
439
+ ```
440
+
441
+ You may persist the name cache to the file system in the following way:
442
+ ```javascript
443
+ var cacheFileName = "/tmp/cache.json";
444
+ var options = {
445
+ mangle: {
446
+ properties: true,
447
+ },
448
+ nameCache: JSON.parse(fs.readFileSync(cacheFileName, "utf8"))
449
+ };
450
+ fs.writeFileSync("part1.js", UglifyJS.minify({
451
+ "file1.js": fs.readFileSync("file1.js", "utf8"),
452
+ "file2.js": fs.readFileSync("file2.js", "utf8")
453
+ }, options).code, "utf8");
454
+ fs.writeFileSync("part2.js", UglifyJS.minify({
455
+ "file3.js": fs.readFileSync("file3.js", "utf8"),
456
+ "file4.js": fs.readFileSync("file4.js", "utf8")
457
+ }, options).code, "utf8");
458
+ fs.writeFileSync(cacheFileName, JSON.stringify(options.nameCache), "utf8");
459
+ ```
460
+
461
+ An example of a combination of `minify()` options:
462
+ ```javascript
463
+ var code = {
464
+ "file1.js": "function add(first, second) { return first + second; }",
465
+ "file2.js": "console.log(add(1 + 2, 3 + 4));"
466
+ };
467
+ var options = {
468
+ toplevel: true,
469
+ compress: {
470
+ global_defs: {
471
+ "@console.log": "alert"
472
+ },
473
+ passes: 2
474
+ },
475
+ output: {
476
+ beautify: false,
477
+ preamble: "/* uglified */"
478
+ }
479
+ };
480
+ var result = UglifyJS.minify(code, options);
481
+ console.log(result.code);
482
+ // /* uglified */
483
+ // alert(10);"
484
+ ```
485
+
486
+ To produce warnings:
487
+ ```javascript
488
+ var code = "function f(){ var u; return 2 + 3; }";
489
+ var options = { warnings: true };
490
+ var result = UglifyJS.minify(code, options);
491
+ console.log(result.error); // runtime error, `undefined` in this case
492
+ console.log(result.warnings); // [ 'Dropping unused variable u [0:1,18]' ]
493
+ console.log(result.code); // function f(){return 5}
494
+ ```
495
+
496
+ An error example:
497
+ ```javascript
498
+ var result = UglifyJS.minify({"foo.js" : "if (0) else console.log(1);"});
499
+ console.log(JSON.stringify(result.error));
500
+ // {"message":"Unexpected token: keyword (else)","filename":"foo.js","line":1,"col":7,"pos":7}
501
+ ```
502
+ Note: unlike `uglify-js@2.x`, the `3.x` API does not throw errors. To
503
+ achieve a similar effect one could do the following:
504
+ ```javascript
505
+ var result = UglifyJS.minify(code, options);
506
+ if (result.error) throw result.error;
507
+ ```
508
+
509
+ ## Minify options
510
+
511
+ - `annotations` — pass `false` to ignore all comment annotations and elide them
512
+ from output. Useful when, for instance, external tools incorrectly applied
513
+ `/*@__PURE__*/` or `/*#__PURE__*/`. Pass `true` to both compress and retain
514
+ comment annotations in output to allow for further processing downstream.
515
+
516
+ - `compress` (default: `{}`) — pass `false` to skip compressing entirely.
517
+ Pass an object to specify custom [compress options](#compress-options).
518
+
519
+ - `expression` (default: `false`) — parse as a single expression, e.g. JSON.
520
+
521
+ - `ie` (default: `false`) — enable workarounds for Internet Explorer bugs.
522
+
523
+ - `keep_fargs` (default: `false`) — pass `true` to prevent discarding or mangling
524
+ of function arguments.
525
+
526
+ - `keep_fnames` (default: `false`) — pass `true` to prevent discarding or mangling
527
+ of function names. Useful for code relying on `Function.prototype.name`.
528
+
529
+ - `mangle` (default: `true`) — pass `false` to skip mangling names, or pass
530
+ an object to specify [mangle options](#mangle-options) (see below).
531
+
532
+ - `mangle.properties` (default: `false`) — a subcategory of the mangle option.
533
+ Pass an object to specify custom [mangle property options](#mangle-properties-options).
534
+
535
+ - `module` (default: `true`) — process input as ES module, i.e. implicit
536
+ `"use strict";` and support for top-level `await`. When explicitly specified,
537
+ also enables `toplevel`.
538
+
539
+ - `nameCache` (default: `null`) — pass an empty object `{}` or a previously
540
+ used `nameCache` object if you wish to cache mangled variable and
541
+ property names across multiple invocations of `minify()`. Note: this is
542
+ a read/write property. `minify()` will read the name cache state of this
543
+ object and update it during minification so that it may be
544
+ reused or externally persisted by the user.
545
+
546
+ - `output` (default: `null`) — pass an object if you wish to specify
547
+ additional [output options](#output-options). The defaults are optimized
548
+ for best compression.
549
+
550
+ - `parse` (default: `{}`) — pass an object if you wish to specify some
551
+ additional [parse options](#parse-options).
552
+
553
+ - `sourceMap` (default: `false`) — pass an object if you wish to specify
554
+ [source map options](#source-map-options).
555
+
556
+ - `toplevel` (default: `false`) — set to `true` if you wish to enable top level
557
+ variable and function name mangling and to drop unused variables and functions.
558
+
559
+ - `v8` (default: `false`) — enable workarounds for Chrome & Node.js bugs.
560
+
561
+ - `warnings` (default: `false`) — pass `true` to return compressor warnings
562
+ in `result.warnings`. Use the value `"verbose"` for more detailed warnings.
563
+
564
+ - `webkit` (default: `false`) — enable workarounds for Safari/WebKit bugs.
565
+ PhantomJS users should set this option to `true`.
566
+
567
+ ## Minify options structure
568
+
569
+ ```javascript
570
+ {
571
+ parse: {
572
+ // parse options
573
+ },
574
+ compress: {
575
+ // compress options
576
+ },
577
+ mangle: {
578
+ // mangle options
579
+
580
+ properties: {
581
+ // mangle property options
582
+ }
583
+ },
584
+ output: {
585
+ // output options
586
+ },
587
+ sourceMap: {
588
+ // source map options
589
+ },
590
+ nameCache: null, // or specify a name cache object
591
+ toplevel: false,
592
+ warnings: false,
593
+ }
594
+ ```
595
+
596
+ ### Source map options
597
+
598
+ To generate a source map:
599
+ ```javascript
600
+ var result = UglifyJS.minify({"file1.js": "var a = function() {};"}, {
601
+ sourceMap: {
602
+ filename: "out.js",
603
+ url: "out.js.map"
604
+ }
605
+ });
606
+ console.log(result.code); // minified output
607
+ console.log(result.map); // source map
608
+ ```
609
+
610
+ Note that the source map is not saved in a file, it's just returned in
611
+ `result.map`. The value passed for `sourceMap.url` is only used to set
612
+ `//# sourceMappingURL=out.js.map` in `result.code`. The value of
613
+ `filename` is only used to set `file` attribute (see [the spec][sm-spec])
614
+ in source map file.
615
+
616
+ You can set option `sourceMap.url` to be `"inline"` and source map will
617
+ be appended to code.
618
+
619
+ You can also specify sourceRoot property to be included in source map:
620
+ ```javascript
621
+ var result = UglifyJS.minify({"file1.js": "var a = function() {};"}, {
622
+ sourceMap: {
623
+ root: "http://example.com/src",
624
+ url: "out.js.map"
625
+ }
626
+ });
627
+ ```
628
+
629
+ If you're compressing compiled JavaScript and have a source map for it, you
630
+ can use `sourceMap.content`:
631
+ ```javascript
632
+ var result = UglifyJS.minify({"compiled.js": "compiled code"}, {
633
+ sourceMap: {
634
+ content: "content from compiled.js.map",
635
+ url: "minified.js.map"
636
+ }
637
+ });
638
+ // same as before, it returns `code` and `map`
639
+ ```
640
+
641
+ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.url`.
642
+
643
+ If you wish to reduce file size of the source map, set option `sourceMap.names`
644
+ to be `false` and all symbol names will be omitted.
645
+
646
+ ## Parse options
647
+
648
+ - `bare_returns` (default: `false`) — support top level `return` statements
649
+
650
+ - `html5_comments` (default: `true`) — process HTML comment as workaround for
651
+ browsers which do not recognize `<script>` tags
652
+
653
+ - `module` (default: `false`) — set to `true` if you wish to process input as
654
+ ES module, i.e. implicit `"use strict";` and support for top-level `await`.
655
+
656
+ - `shebang` (default: `true`) — support `#!command` as the first line
657
+
658
+ ## Compress options
659
+
660
+ - `annotations` (default: `true`) — Pass `false` to disable potentially dropping
661
+ functions marked as "pure". A function call is marked as "pure" if a comment
662
+ annotation `/*@__PURE__*/` or `/*#__PURE__*/` immediately precedes the call. For
663
+ example: `/*@__PURE__*/foo();`
664
+
665
+ - `arguments` (default: `true`) — replace `arguments[index]` with function
666
+ parameter name whenever possible.
667
+
668
+ - `arrows` (default: `true`) — apply optimizations to arrow functions
669
+
670
+ - `assignments` (default: `true`) — apply optimizations to assignment expressions
671
+
672
+ - `awaits` (default: `true`) — apply optimizations to `await` expressions
673
+
674
+ - `booleans` (default: `true`) — various optimizations for boolean context,
675
+ for example `!!a ? b : c → a ? b : c`
676
+
677
+ - `collapse_vars` (default: `true`) — Collapse single-use non-constant variables,
678
+ side effects permitting.
679
+
680
+ - `comparisons` (default: `true`) — apply certain optimizations to binary nodes,
681
+ e.g. `!(a <= b) → a > b`, attempts to negate binary nodes, e.g.
682
+ `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc.
683
+
684
+ - `conditionals` (default: `true`) — apply optimizations for `if`-s and conditional
685
+ expressions
686
+
687
+ - `dead_code` (default: `true`) — remove unreachable code
688
+
689
+ - `default_values` (default: `true`) — drop overshadowed default values
690
+
691
+ - `directives` (default: `true`) — remove redundant or non-standard directives
692
+
693
+ - `drop_console` (default: `false`) — Pass `true` to discard calls to
694
+ `console.*` functions. If you wish to drop a specific function call
695
+ such as `console.info` and/or retain side effects from function arguments
696
+ after dropping the function call then use `pure_funcs` instead.
697
+
698
+ - `drop_debugger` (default: `true`) — remove `debugger;` statements
699
+
700
+ - `evaluate` (default: `true`) — Evaluate expression for shorter constant
701
+ representation. Pass `"eager"` to always replace function calls whenever
702
+ possible, or a positive integer to specify an upper bound for each individual
703
+ evaluation in number of characters.
704
+
705
+ - `expression` (default: `false`) — Pass `true` to preserve completion values
706
+ from terminal statements without `return`, e.g. in bookmarklets.
707
+
708
+ - `functions` (default: `true`) — convert declarations from `var` to `function`
709
+ whenever possible.
710
+
711
+ - `global_defs` (default: `{}`) — see [conditional compilation](#conditional-compilation)
712
+
713
+ - `hoist_exports` (default: `true`) — hoist `export` statements to facilitate
714
+ various `compress` and `mangle` optimizations.
715
+
716
+ - `hoist_funs` (default: `false`) — hoist function declarations
717
+
718
+ - `hoist_props` (default: `true`) — hoist properties from constant object and
719
+ array literals into regular variables subject to a set of constraints. For example:
720
+ `var o={p:1, q:2}; f(o.p, o.q);` is converted to `f(1, 2);`. Note: `hoist_props`
721
+ works best with `toplevel` and `mangle` enabled, alongside with `compress` option
722
+ `passes` set to `2` or higher.
723
+
724
+ - `hoist_vars` (default: `false`) — hoist `var` declarations (this is `false`
725
+ by default because it seems to increase the size of the output in general)
726
+
727
+ - `if_return` (default: `true`) — optimizations for if/return and if/continue
728
+
729
+ - `imports` (default: `true`) — drop unreferenced import symbols when used with `unused`
730
+
731
+ - `inline` (default: `true`) — inline calls to function with simple/`return` statement:
732
+ - `false` — same as `0`
733
+ - `0` — disabled inlining
734
+ - `1` — inline simple functions
735
+ - `2` — inline functions with arguments
736
+ - `3` — inline functions with arguments and variables
737
+ - `4` — inline functions with arguments, variables and statements
738
+ - `true` — same as `4`
739
+
740
+ - `join_vars` (default: `true`) — join consecutive `var` statements
741
+
742
+ - `keep_fargs` (default: `false`) — discard unused function arguments except
743
+ when unsafe to do so, e.g. code which relies on `Function.prototype.length`.
744
+ Pass `true` to always retain function arguments.
745
+
746
+ - `keep_infinity` (default: `false`) — Pass `true` to prevent `Infinity` from
747
+ being compressed into `1/0`, which may cause performance issues on Chrome.
748
+
749
+ - `loops` (default: `true`) — optimizations for `do`, `while` and `for` loops
750
+ when we can statically determine the condition.
751
+
752
+ - `merge_vars` (default: `true`) — combine and reuse variables.
753
+
754
+ - `module` (default: `false`) — set to `true` if you wish to process input as
755
+ ES module, i.e. implicit `"use strict";`.
756
+
757
+ - `negate_iife` (default: `true`) — negate "Immediately-Called Function Expressions"
758
+ where the return value is discarded, to avoid the parentheses that the
759
+ code generator would insert.
760
+
761
+ - `objects` (default: `true`) — compact duplicate keys in object literals.
762
+
763
+ - `passes` (default: `1`) — The maximum number of times to run compress.
764
+ In some cases more than one pass leads to further compressed code. Keep in
765
+ mind more passes will take more time.
766
+
767
+ - `properties` (default: `true`) — rewrite property access using the dot notation, for
768
+ example `foo["bar"] → foo.bar`
769
+
770
+ - `pure_funcs` (default: `null`) — You can pass an array of names and
771
+ UglifyJS will assume that those functions do not produce side
772
+ effects. DANGER: will not check if the name is redefined in scope.
773
+ An example case here, for instance `var q = Math.floor(a/b)`. If
774
+ variable `q` is not used elsewhere, UglifyJS will drop it, but will
775
+ still keep the `Math.floor(a/b)`, not knowing what it does. You can
776
+ pass `pure_funcs: [ 'Math.floor' ]` to let it know that this
777
+ function won't produce any side effect, in which case the whole
778
+ statement would get discarded. The current implementation adds some
779
+ overhead (compression will be slower). Make sure symbols under `pure_funcs`
780
+ are also under `mangle.reserved` to avoid mangling.
781
+
782
+ - `pure_getters` (default: `"strict"`) — Pass `true` for UglifyJS to assume that
783
+ object property access (e.g. `foo.bar` or `a[42]`) does not throw exception or
784
+ alter program states via getter function. Pass `"strict"` to allow dropping or
785
+ reordering `foo.bar` only if `foo` is not `null` or `undefined` and is safe to
786
+ access as a variable. Pass `false` to retain all property accesses.
787
+
788
+ - `reduce_funcs` (default: `true`) — Allows single-use functions to be
789
+ inlined as function expressions when permissible allowing further
790
+ optimization. Enabled by default. Option depends on `reduce_vars`
791
+ being enabled. Some code runs faster in the Chrome V8 engine if this
792
+ option is disabled. Does not negatively impact other major browsers.
793
+
794
+ - `reduce_vars` (default: `true`) — Improve optimization on variables assigned with and
795
+ used as constant values.
796
+
797
+ - `rests` (default: `true`) — apply optimizations to rest parameters
798
+
799
+ - `sequences` (default: `true`) — join consecutive simple statements using the
800
+ comma operator. May be set to a positive integer to specify the maximum number
801
+ of consecutive comma sequences that will be generated. If this option is set to
802
+ `true` then the default `sequences` limit is `200`. Set option to `false` or `0`
803
+ to disable. The smallest `sequences` length is `2`. A `sequences` value of `1`
804
+ is grandfathered to be equivalent to `true` and as such means `200`. On rare
805
+ occasions the default sequences limit leads to very slow compress times in which
806
+ case a value of `20` or less is recommended.
807
+
808
+ - `side_effects` (default: `true`) — drop extraneous code which does not affect
809
+ outcome of runtime execution.
810
+
811
+ - `spreads` (default: `true`) — flatten spread expressions.
812
+
813
+ - `strings` (default: `true`) — compact string concatenations.
814
+
815
+ - `switches` (default: `true`) — de-duplicate and remove unreachable `switch` branches
816
+
817
+ - `templates` (default: `true`) — compact template literals by embedding expressions
818
+ and/or converting to string literals, e.g. `` `foo ${42}` → "foo 42"``
819
+
820
+ - `top_retain` (default: `null`) — prevent specific toplevel functions and
821
+ variables from `unused` removal (can be array, comma-separated, RegExp or
822
+ function. Implies `toplevel`)
823
+
824
+ - `toplevel` (default: `false`) — drop unreferenced functions (`"funcs"`) and/or
825
+ variables (`"vars"`) in the top level scope (`false` by default, `true` to drop
826
+ both unreferenced functions and variables)
827
+
828
+ - `typeofs` (default: `true`) — compress `typeof` expressions, e.g.
829
+ `typeof foo == "undefined" → void 0 === foo`
830
+
831
+ - `unsafe` (default: `false`) — apply "unsafe" transformations (discussion below)
832
+
833
+ - `unsafe_comps` (default: `false`) — assume operands cannot be (coerced to) `NaN`
834
+ in numeric comparisons, e.g. `a <= b`. In addition, expressions involving `in`
835
+ or `instanceof` would never throw.
836
+
837
+ - `unsafe_Function` (default: `false`) — compress and mangle `Function(args, code)`
838
+ when both `args` and `code` are string literals.
839
+
840
+ - `unsafe_math` (default: `false`) — optimize numerical expressions like
841
+ `2 * x * 3` into `6 * x`, which may give imprecise floating point results.
842
+
843
+ - `unsafe_proto` (default: `false`) — optimize expressions like
844
+ `Array.prototype.slice.call(a)` into `[].slice.call(a)`
845
+
846
+ - `unsafe_regexp` (default: `false`) — enable substitutions of variables with
847
+ `RegExp` values the same way as if they are constants.
848
+
849
+ - `unsafe_undefined` (default: `false`) — substitute `void 0` if there is a
850
+ variable named `undefined` in scope (variable name will be mangled, typically
851
+ reduced to a single character)
852
+
853
+ - `unused` (default: `true`) — drop unreferenced functions and variables (simple
854
+ direct variable assignments do not count as references unless set to `"keep_assign"`)
855
+
856
+ - `varify` (default: `true`) — convert block-scoped declarations into `var`
857
+ whenever safe to do so
858
+
859
+ - `yields` (default: `true`) — apply optimizations to `yield` expressions
860
+
861
+ ## Mangle options
862
+
863
+ - `eval` (default: `false`) — Pass `true` to mangle names visible in scopes
864
+ where `eval` or `with` are used.
865
+
866
+ - `reserved` (default: `[]`) — Pass an array of identifiers that should be
867
+ excluded from mangling. Example: `["foo", "bar"]`.
868
+
869
+ - `toplevel` (default: `false`) — Pass `true` to mangle names declared in the
870
+ top level scope.
871
+
872
+ Examples:
873
+
874
+ ```javascript
875
+ // test.js
876
+ var globalVar;
877
+ function funcName(firstLongName, anotherLongName) {
878
+ var myVariable = firstLongName + anotherLongName;
879
+ }
880
+ ```
881
+ ```javascript
882
+ var code = fs.readFileSync("test.js", "utf8");
883
+
884
+ UglifyJS.minify(code).code;
885
+ // 'function funcName(a,n){}var globalVar;'
886
+
887
+ UglifyJS.minify(code, { mangle: { reserved: ['firstLongName'] } }).code;
888
+ // 'function funcName(firstLongName,a){}var globalVar;'
889
+
890
+ UglifyJS.minify(code, { mangle: { toplevel: true } }).code;
891
+ // 'function n(n,a){}var a;'
892
+ ```
893
+
894
+ ### Mangle properties options
895
+
896
+ - `builtins` (default: `false`) — Use `true` to allow the mangling of built-in
897
+ properties of JavaScript API. Not recommended to override this setting.
898
+
899
+ - `debug` (default: `false`) — Mangle names with the original name still present.
900
+ Pass an empty string `""` to enable, or a non-empty string to set the debug suffix.
901
+
902
+ - `domprops` (default: `false`) — Use `true` to allow the mangling of properties
903
+ commonly found in Document Object Model. Not recommended to override this setting.
904
+
905
+ - `keep_fargs` (default: `false`) — Use `true` to prevent mangling of function
906
+ arguments.
907
+
908
+ - `keep_quoted` (default: `false`) — Only mangle unquoted property names.
909
+
910
+ - `regex` (default: `null`) — Pass a RegExp literal to only mangle property
911
+ names matching the regular expression.
912
+
913
+ - `reserved` (default: `[]`) — Do not mangle property names listed in the
914
+ `reserved` array.
915
+
916
+ ## Output options
917
+
918
+ The code generator tries to output shortest code possible by default. In
919
+ case you want beautified output, pass `--beautify` (`-b`). Optionally you
920
+ can pass additional arguments that control the code output:
921
+
922
+ - `annotations` (default: `false`) — pass `true` to retain comment annotations
923
+ `/*@__PURE__*/` or `/*#__PURE__*/`, otherwise they will be discarded even if
924
+ `comments` is set.
925
+
926
+ - `ascii_only` (default: `false`) — escape Unicode characters in strings and
927
+ regexps (affects directives with non-ascii characters becoming invalid)
928
+
929
+ - `beautify` (default: `true`) — whether to actually beautify the output.
930
+ Passing `-b` will set this to true. Use `-O` if you want to generate minified
931
+ code and specify additional arguments.
932
+
933
+ - `braces` (default: `false`) — always insert braces in `if`, `for`,
934
+ `do`, `while` or `with` statements, even if their body is a single
935
+ statement.
936
+
937
+ - `comments` (default: `false`) — pass `true` or `"all"` to preserve all
938
+ comments, `"some"` to preserve multi-line comments that contain `@cc_on`,
939
+ `@license`, or `@preserve` (case-insensitive), a regular expression string
940
+ (e.g. `/^!/`), or a function which returns `boolean`, e.g.
941
+ ```javascript
942
+ function(node, comment) {
943
+ return comment.value.indexOf("@type " + node.TYPE) >= 0;
944
+ }
945
+ ```
946
+
947
+ - `extendscript` (default: `false`) — enable workarounds for Adobe ExtendScript
948
+ bugs
949
+
950
+ - `galio` (default: `false`) — enable workarounds for ANT Galio bugs
951
+
952
+ - `indent_level` (default: `4`) — indent by specified number of spaces or the
953
+ exact whitespace sequence supplied, e.g. `"\t"`.
954
+
955
+ - `indent_start` (default: `0`) — prefix all lines by whitespace sequence
956
+ specified in the same format as `indent_level`.
957
+
958
+ - `inline_script` (default: `true`) — escape HTML comments and the slash in
959
+ occurrences of `</script>` in strings
960
+
961
+ - `keep_quoted_props` (default: `false`) — when turned on, prevents stripping
962
+ quotes from property names in object literals.
963
+
964
+ - `max_line_len` (default: `false`) — maximum line length (for uglified code)
965
+
966
+ - `preamble` (default: `null`) — when passed it must be a string and
967
+ it will be prepended to the output literally. The source map will
968
+ adjust for this text. Can be used to insert a comment containing
969
+ licensing information, for example.
970
+
971
+ - `preserve_line` (default: `false`) — pass `true` to retain line numbering on
972
+ a best effort basis.
973
+
974
+ - `quote_keys` (default: `false`) — pass `true` to quote all keys in literal
975
+ objects
976
+
977
+ - `quote_style` (default: `0`) — preferred quote style for strings (affects
978
+ quoted property names and directives as well):
979
+ - `0` — prefers double quotes, switches to single quotes when there are
980
+ more double quotes in the string itself. `0` is best for gzip size.
981
+ - `1` — always use single quotes
982
+ - `2` — always use double quotes
983
+ - `3` — always use the original quotes
984
+
985
+ - `semicolons` (default: `true`) — separate statements with semicolons. If
986
+ you pass `false` then whenever possible we will use a newline instead of a
987
+ semicolon, leading to more readable output of uglified code (size before
988
+ gzip could be smaller; size after gzip insignificantly larger).
989
+
990
+ - `shebang` (default: `true`) — preserve shebang `#!` in preamble (bash scripts)
991
+
992
+ - `width` (default: `80`) — only takes effect when beautification is on, this
993
+ specifies an (orientative) line width that the beautifier will try to
994
+ obey. It refers to the width of the line text (excluding indentation).
995
+ It doesn't work very well currently, but it does make the code generated
996
+ by UglifyJS more readable.
997
+
998
+ - `wrap_iife` (default: `false`) — pass `true` to wrap immediately invoked
999
+ function expressions. See
1000
+ [#640](https://github.com/mishoo/UglifyJS/issues/640) for more details.
1001
+
1002
+ # Miscellaneous
1003
+
1004
+ ### Keeping copyright notices or other comments
1005
+
1006
+ You can pass `--comments` to retain certain comments in the output. By
1007
+ default it will keep JSDoc-style comments that contain "@preserve",
1008
+ "@license" or "@cc_on" (conditional compilation for IE). You can pass
1009
+ `--comments all` to keep all the comments, or a valid JavaScript regexp to
1010
+ keep only comments that match this regexp. For example `--comments /^!/`
1011
+ will keep comments like `/*! Copyright Notice */`.
1012
+
1013
+ Note, however, that there might be situations where comments are lost. For
1014
+ example:
1015
+ ```javascript
1016
+ function f() {
1017
+ /** @preserve Foo Bar */
1018
+ function g() {
1019
+ // this function is never called
1020
+ }
1021
+ return something();
1022
+ }
1023
+ ```
1024
+
1025
+ Even though it has "@preserve", the comment will be lost because the inner
1026
+ function `g` (which is the AST node to which the comment is attached to) is
1027
+ discarded by the compressor as not referenced.
1028
+
1029
+ The safest comments where to place copyright information (or other info that
1030
+ needs to be kept in the output) are comments attached to toplevel nodes.
1031
+
1032
+ ### The `unsafe` `compress` option
1033
+
1034
+ It enables some transformations that *might* break code logic in certain
1035
+ contrived cases, but should be fine for most code. You might want to try it
1036
+ on your own code, it should reduce the minified size. Here's what happens
1037
+ when this flag is on:
1038
+
1039
+ - `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[ 1, 2, 3 ]`
1040
+ - `new Object()` → `{}`
1041
+ - `String(exp)` or `exp.toString()` → `"" + exp`
1042
+ - `new Object/RegExp/Function/Error/Array (...)` → we discard the `new`
1043
+
1044
+ ### Conditional compilation
1045
+
1046
+ You can use the `--define` (`-d`) switch in order to declare global
1047
+ variables that UglifyJS will assume to be constants (unless defined in
1048
+ scope). For example if you pass `--define DEBUG=false` then, coupled with
1049
+ dead code removal UglifyJS will discard the following from the output:
1050
+ ```javascript
1051
+ if (DEBUG) {
1052
+ console.log("debug stuff");
1053
+ }
1054
+ ```
1055
+
1056
+ You can specify nested constants in the form of `--define env.DEBUG=false`.
1057
+
1058
+ UglifyJS will warn about the condition being always false and about dropping
1059
+ unreachable code; for now there is no option to turn off only this specific
1060
+ warning, you can pass `warnings=false` to turn off *all* warnings.
1061
+
1062
+ Another way of doing that is to declare your globals as constants in a
1063
+ separate file and include it into the build. For example you can have a
1064
+ `build/defines.js` file with the following:
1065
+ ```javascript
1066
+ var DEBUG = false;
1067
+ var PRODUCTION = true;
1068
+ // etc.
1069
+ ```
1070
+
1071
+ and build your code like this:
1072
+
1073
+ uglifyjs build/defines.js js/foo.js js/bar.js... -c
1074
+
1075
+ UglifyJS will notice the constants and, since they cannot be altered, it
1076
+ will evaluate references to them to the value itself and drop unreachable
1077
+ code as usual. The build will contain the `const` declarations if you use
1078
+ them. If you are targeting < ES6 environments which does not support `const`,
1079
+ using `var` with `reduce_vars` (enabled by default) should suffice.
1080
+
1081
+ ### Conditional compilation API
1082
+
1083
+ You can also use conditional compilation via the programmatic API. With the difference that the
1084
+ property name is `global_defs` and is a compressor property:
1085
+
1086
+ ```javascript
1087
+ var result = UglifyJS.minify(fs.readFileSync("input.js", "utf8"), {
1088
+ compress: {
1089
+ dead_code: true,
1090
+ global_defs: {
1091
+ DEBUG: false
1092
+ }
1093
+ }
1094
+ });
1095
+ ```
1096
+
1097
+ To replace an identifier with an arbitrary non-constant expression it is
1098
+ necessary to prefix the `global_defs` key with `"@"` to instruct UglifyJS
1099
+ to parse the value as an expression:
1100
+ ```javascript
1101
+ UglifyJS.minify("alert('hello');", {
1102
+ compress: {
1103
+ global_defs: {
1104
+ "@alert": "console.log"
1105
+ }
1106
+ }
1107
+ }).code;
1108
+ // returns: 'console.log("hello");'
1109
+ ```
1110
+
1111
+ Otherwise it would be replaced as string literal:
1112
+ ```javascript
1113
+ UglifyJS.minify("alert('hello');", {
1114
+ compress: {
1115
+ global_defs: {
1116
+ "alert": "console.log"
1117
+ }
1118
+ }
1119
+ }).code;
1120
+ // returns: '"console.log"("hello");'
1121
+ ```
1122
+
1123
+ ### Using native Uglify AST with `minify()`
1124
+ ```javascript
1125
+ // example: parse only, produce native Uglify AST
1126
+
1127
+ var result = UglifyJS.minify(code, {
1128
+ parse: {},
1129
+ compress: false,
1130
+ mangle: false,
1131
+ output: {
1132
+ ast: true,
1133
+ code: false // optional - faster if false
1134
+ }
1135
+ });
1136
+
1137
+ // result.ast contains native Uglify AST
1138
+ ```
1139
+ ```javascript
1140
+ // example: accept native Uglify AST input and then compress and mangle
1141
+ // to produce both code and native AST.
1142
+
1143
+ var result = UglifyJS.minify(ast, {
1144
+ compress: {},
1145
+ mangle: {},
1146
+ output: {
1147
+ ast: true,
1148
+ code: true // optional - faster if false
1149
+ }
1150
+ });
1151
+
1152
+ // result.ast contains native Uglify AST
1153
+ // result.code contains the minified code in string form.
1154
+ ```
1155
+
1156
+ ### Working with Uglify AST
1157
+
1158
+ Transversal and transformation of the native AST can be performed through
1159
+ [`TreeWalker`](https://github.com/mishoo/UglifyJS/blob/master/lib/ast.js) and
1160
+ [`TreeTransformer`](https://github.com/mishoo/UglifyJS/blob/master/lib/transform.js)
1161
+ respectively.
1162
+
1163
+ ### ESTree / SpiderMonkey AST
1164
+
1165
+ UglifyJS has its own abstract syntax tree format; for
1166
+ [practical reasons](http://lisperator.net/blog/uglifyjs-why-not-switching-to-spidermonkey-ast/)
1167
+ we can't easily change to using the SpiderMonkey AST internally. However,
1168
+ UglifyJS now has a converter which can import a SpiderMonkey AST.
1169
+
1170
+ For example [Acorn][acorn] is a super-fast parser that produces a
1171
+ SpiderMonkey AST. It has a small CLI utility that parses one file and dumps
1172
+ the AST in JSON on the standard output. To use UglifyJS to mangle and
1173
+ compress that:
1174
+
1175
+ acorn file.js | uglifyjs -p spidermonkey -m -c
1176
+
1177
+ The `-p spidermonkey` option tells UglifyJS that all input files are not
1178
+ JavaScript, but JS code described in SpiderMonkey AST in JSON. Therefore we
1179
+ don't use our own parser in this case, but just transform that AST into our
1180
+ internal AST.
1181
+
1182
+ ### Use Acorn for parsing
1183
+
1184
+ More for fun, I added the `-p acorn` option which will use Acorn to do all
1185
+ the parsing. If you pass this option, UglifyJS will `require("acorn")`.
1186
+
1187
+ Acorn is really fast (e.g. 250ms instead of 380ms on some 650K code), but
1188
+ converting the SpiderMonkey tree that Acorn produces takes another 150ms so
1189
+ in total it's a bit more than just using UglifyJS's own parser.
1190
+
1191
+ [acorn]: https://github.com/ternjs/acorn
1192
+ [sm-spec]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k
1193
+
1194
+ ### Uglify Fast Minify Mode
1195
+
1196
+ It's not well known, but whitespace removal and symbol mangling accounts
1197
+ for 95% of the size reduction in minified code for most JavaScript - not
1198
+ elaborate code transforms. One can simply disable `compress` to speed up
1199
+ Uglify builds by 3 to 5 times.
1200
+
1201
+ | d3.js | minify size | gzip size | minify time (seconds) |
1202
+ | --- | ---: | ---: | ---: |
1203
+ | original | 511,371 | 119,932 | - |
1204
+ | uglify-js@3.13.0 mangle=false, compress=false | 363,988 | 95,695 | 0.56 |
1205
+ | uglify-js@3.13.0 mangle=true, compress=false | 253,305 | 81,281 | 0.99 |
1206
+ | uglify-js@3.13.0 mangle=true, compress=true | 244,436 | 79,854 | 5.30 |
1207
+
1208
+ To enable fast minify mode from the CLI use:
1209
+ ```
1210
+ uglifyjs file.js -m
1211
+ ```
1212
+ To enable fast minify mode with the API use:
1213
+ ```javascript
1214
+ UglifyJS.minify(code, { compress: false, mangle: true });
1215
+ ```
1216
+
1217
+ ### Source maps and debugging
1218
+
1219
+ Various `compress` transforms that simplify, rearrange, inline and remove code
1220
+ are known to have an adverse effect on debugging with source maps. This is
1221
+ expected as code is optimized and mappings are often simply not possible as
1222
+ some code no longer exists. For highest fidelity in source map debugging
1223
+ disable the Uglify `compress` option and just use `mangle`.
1224
+
1225
+ ### Compiler assumptions
1226
+
1227
+ To allow for better optimizations, the compiler makes various assumptions:
1228
+
1229
+ - The code does not rely on preserving its runtime performance characteristics.
1230
+ Typically uglified code will run faster due to less instructions and easier
1231
+ inlining, but may be slower on rare occasions for a specific platform, e.g.
1232
+ see [`reduce_funcs`](#compress-options).
1233
+ - `.toString()` and `.valueOf()` don't have side effects, and for built-in
1234
+ objects they have not been overridden.
1235
+ - `undefined`, `NaN` and `Infinity` have not been externally redefined.
1236
+ - `arguments.callee`, `arguments.caller` and `Function.prototype.caller` are not used.
1237
+ - The code doesn't expect the contents of `Function.prototype.toString()` or
1238
+ `Error.prototype.stack` to be anything in particular.
1239
+ - Getting and setting properties on a plain object does not cause other side effects
1240
+ (using `.watch()` or `Proxy`).
1241
+ - Object properties can be added, removed and modified (not prevented with
1242
+ `Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`,
1243
+ `Object.preventExtensions()` or `Object.seal()`).
1244
+ - If array destructuring is present, index-like properties in `Array.prototype`
1245
+ have not been overridden:
1246
+ ```javascript
1247
+ Object.prototype[0] = 42;
1248
+ var [ a ] = [];
1249
+ var { 0: b } = {};
1250
+ // 42 undefined
1251
+ console.log([][0], a);
1252
+ // 42 42
1253
+ console.log({}[0], b);
1254
+ ```
1255
+ - Earlier versions of JavaScript will throw `SyntaxError` with the following:
1256
+ ```javascript
1257
+ ({
1258
+ p: 42,
1259
+ get p() {},
1260
+ });
1261
+ // SyntaxError: Object literal may not have data and accessor property with
1262
+ // the same name
1263
+ ```
1264
+ UglifyJS may modify the input which in turn may suppress those errors.
1265
+ - Iteration order of keys over an object which contains spread syntax in later
1266
+ versions of Chrome and Node.js may be altered.
1267
+ - When `toplevel` is enabled, UglifyJS effectively assumes input code is wrapped
1268
+ within `function(){ ... }`, thus forbids aliasing of declared global variables:
1269
+ ```javascript
1270
+ A = "FAIL";
1271
+ var B = "FAIL";
1272
+ // can be `global`, `self`, `window` etc.
1273
+ var top = function() {
1274
+ return this;
1275
+ }();
1276
+ // "PASS"
1277
+ top.A = "PASS";
1278
+ console.log(A);
1279
+ // "FAIL" after compress and/or mangle
1280
+ top.B = "PASS";
1281
+ console.log(B);
1282
+ ```
1283
+ - Use of `arguments` alongside destructuring as function parameters, e.g.
1284
+ `function({}, arguments) {}` will result in `SyntaxError` in earlier versions
1285
+ of Chrome and Node.js - UglifyJS may modify the input which in turn may
1286
+ suppress those errors.
1287
+ - Earlier versions of Chrome and Node.js will throw `ReferenceError` with the
1288
+ following:
1289
+ ```javascript
1290
+ var a;
1291
+ try {
1292
+ throw 42;
1293
+ } catch ({
1294
+ [a]: b,
1295
+ // ReferenceError: a is not defined
1296
+ }) {
1297
+ let a;
1298
+ }
1299
+ ```
1300
+ UglifyJS may modify the input which in turn may suppress those errors.
1301
+ - Later versions of JavaScript will throw `SyntaxError` with the following:
1302
+ ```javascript
1303
+ a => {
1304
+ let a;
1305
+ };
1306
+ // SyntaxError: Identifier 'a' has already been declared
1307
+ ```
1308
+ UglifyJS may modify the input which in turn may suppress those errors.
1309
+ - Later versions of JavaScript will throw `SyntaxError` with the following:
1310
+ ```javascript
1311
+ try {
1312
+ // ...
1313
+ } catch ({ message: a }) {
1314
+ var a;
1315
+ }
1316
+ // SyntaxError: Identifier 'a' has already been declared
1317
+ ```
1318
+ UglifyJS may modify the input which in turn may suppress those errors.
1319
+ - Some versions of Chrome and Node.js will throw `ReferenceError` with the
1320
+ following:
1321
+ ```javascript
1322
+ console.log(((a, b = function() {
1323
+ return a;
1324
+ // ReferenceError: a is not defined
1325
+ }()) => b)());
1326
+ ```
1327
+ UglifyJS may modify the input which in turn may suppress those errors.
1328
+ - Some arithmetic operations with `BigInt` may throw `TypeError`:
1329
+ ```javascript
1330
+ 1n + 1;
1331
+ // TypeError: can't convert BigInt to number
1332
+ ```
1333
+ UglifyJS may modify the input which in turn may suppress those errors.
1334
+ - Some versions of JavaScript will throw `SyntaxError` with the
1335
+ following:
1336
+ ```javascript
1337
+ console.log(String.raw`\uFo`);
1338
+ // SyntaxError: Invalid Unicode escape sequence
1339
+ ```
1340
+ UglifyJS may modify the input which in turn may suppress those errors.
1341
+ - Some versions of JavaScript will throw `SyntaxError` with the
1342
+ following:
1343
+ ```javascript
1344
+ try {} catch (e) {
1345
+ for (var e of []);
1346
+ }
1347
+ // SyntaxError: Identifier 'e' has already been declared
1348
+ ```
1349
+ UglifyJS may modify the input which in turn may suppress those errors.
1350
+ - Some versions of Chrome and Node.js will give incorrect results with the
1351
+ following:
1352
+ ```javascript
1353
+ console.log({
1354
+ ...{
1355
+ set 42(v) {},
1356
+ 42: "PASS",
1357
+ },
1358
+ });
1359
+ // Expected: { '42': 'PASS' }
1360
+ // Actual: { '42': undefined }
1361
+ ```
1362
+ UglifyJS may modify the input which in turn may suppress those errors.
1363
+ - Later versions of JavaScript will throw `SyntaxError` with the following:
1364
+ ```javascript
1365
+ var await;
1366
+ class A {
1367
+ static p = await;
1368
+ }
1369
+ // SyntaxError: Unexpected reserved word
1370
+ ```
1371
+ UglifyJS may modify the input which in turn may suppress those errors.
1372
+ - Later versions of JavaScript will throw `SyntaxError` with the following:
1373
+ ```javascript
1374
+ var async;
1375
+ for (async of []);
1376
+ // SyntaxError: The left-hand side of a for-of loop may not be 'async'.
1377
+ ```
1378
+ UglifyJS may modify the input which in turn may suppress those errors.
1379
+ - Some versions of Chrome and Node.js will give incorrect results with the
1380
+ following:
1381
+ ```javascript
1382
+ console.log({
1383
+ ...console,
1384
+ get 42() {
1385
+ return "FAIL";
1386
+ },
1387
+ [42]: "PASS",
1388
+ }[42], {
1389
+ ...console,
1390
+ get 42() {
1391
+ return "FAIL";
1392
+ },
1393
+ 42: "PASS",
1394
+ }[42]);
1395
+ // Expected: "PASS PASS"
1396
+ // Actual: "PASS FAIL"
1397
+ ```
1398
+ UglifyJS may modify the input which in turn may suppress those errors.
1399
+ - Earlier versions of JavaScript will throw `TypeError` with the following:
1400
+ ```javascript
1401
+ (function() {
1402
+ {
1403
+ const a = "foo";
1404
+ }
1405
+ {
1406
+ const a = "bar";
1407
+ }
1408
+ })();
1409
+ // TypeError: const 'a' has already been declared
1410
+ ```
1411
+ UglifyJS may modify the input which in turn may suppress those errors.
1412
+ - Later versions of Chrome and Node.js will give incorrect results with the
1413
+ following:
1414
+ ```javascript
1415
+ try {
1416
+ class A {
1417
+ static 42;
1418
+ static get 42() {}
1419
+ }
1420
+ console.log("PASS");
1421
+ } catch (e) {
1422
+ console.log("FAIL");
1423
+ }
1424
+ // Expected: "PASS"
1425
+ // Actual: "FAIL"
1426
+ ```
1427
+ UglifyJS may modify the input which in turn may suppress those errors.
1428
+ - Some versions of Chrome and Node.js will give incorrect results with the
1429
+ following:
1430
+ ```javascript
1431
+ (async function(a) {
1432
+ (function() {
1433
+ var b = await => console.log("PASS");
1434
+ b();
1435
+ })();
1436
+ })().catch(console.error);
1437
+ // Expected: "PASS"
1438
+ // Actual: SyntaxError: Unexpected reserved word
1439
+ ```
1440
+ UglifyJS may modify the input which in turn may suppress those errors.
1441
+ - Later versions of Chrome and Node.js will give incorrect results with the
1442
+ following:
1443
+ ```javascript
1444
+ try {
1445
+ f();
1446
+ function f() {
1447
+ throw 42;
1448
+ }
1449
+ } catch (e) {
1450
+ console.log(typeof f, e);
1451
+ }
1452
+ // Expected: "function 42"
1453
+ // Actual: "undefined 42"
1454
+ ```
1455
+ UglifyJS may modify the input which in turn may suppress those errors.
1456
+ - Later versions of JavaScript will throw `SyntaxError` with the following:
1457
+ ```javascript
1458
+ "use strict";
1459
+ console.log(function f() {
1460
+ return f = "PASS";
1461
+ }());
1462
+ // Expected: "PASS"
1463
+ // Actual: TypeError: invalid assignment to const 'f'
1464
+ ```
1465
+ UglifyJS may modify the input which in turn may suppress those errors.
1466
+ - Adobe ExtendScript will give incorrect results with the following:
1467
+ ```javascript
1468
+ alert(true ? "PASS" : false ? "FAIL" : null);
1469
+ // Expected: "PASS"
1470
+ // Actual: "FAIL"
1471
+ ```
1472
+ UglifyJS may modify the input which in turn may suppress those errors.
1473
+ - Adobe ExtendScript will give incorrect results with the following:
1474
+ ```javascript
1475
+ alert(42 ? null ? "FAIL" : "PASS" : "FAIL");
1476
+ // Expected: "PASS"
1477
+ // Actual: SyntaxError: Expected: :
1478
+ ```
1479
+ UglifyJS may modify the input which in turn may suppress those errors.