fnschool 20250109.80531.837__py3-none-any.whl → 20251011.81638.854__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fnschool might be problematic. Click here for more details.

Files changed (278) hide show
  1. fnschoo1/__init__.py +53 -0
  2. fnschoo1/canteen/admin.py +3 -0
  3. fnschoo1/canteen/apps.py +6 -0
  4. fnschoo1/canteen/forms.py +84 -0
  5. fnschoo1/canteen/migrations/0001_initial.py +119 -0
  6. fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py +20 -0
  7. fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py +23 -0
  8. fnschoo1/canteen/migrations/0004_alter_ingredient_name_category_and_more.py +66 -0
  9. fnschoo1/canteen/migrations/0005_alter_category_created_at_alter_category_name_and_more.py +41 -0
  10. fnschoo1/canteen/migrations/0006_category_is_disabled_alter_category_user_and_more.py +49 -0
  11. fnschoo1/canteen/migrations/0007_alter_consumption_amount_used_and_more.py +30 -0
  12. fnschoo1/canteen/migrations/0008_category_abbreviation_mealtype.py +67 -0
  13. fnschoo1/canteen/migrations/0009_alter_category_abbreviation_and_more.py +55 -0
  14. fnschoo1/canteen/migrations/0010_alter_consumption_options_alter_ingredient_options_and_more.py +215 -0
  15. fnschoo1/canteen/migrations/0011_category_pin_to_consumptions_top.py +23 -0
  16. fnschoo1/canteen/migrations/0012_alter_ingredient_storage_date.py +18 -0
  17. fnschoo1/canteen/models.py +179 -0
  18. fnschoo1/canteen/templates/canteen/category/create.html +17 -0
  19. fnschoo1/canteen/templates/canteen/category/delete.html +61 -0
  20. fnschoo1/canteen/templates/canteen/category/list.html +63 -0
  21. fnschoo1/canteen/templates/canteen/category/update.html +23 -0
  22. fnschoo1/canteen/templates/canteen/close.html +11 -0
  23. fnschoo1/canteen/templates/canteen/consumption/_create.html +19 -0
  24. fnschoo1/canteen/templates/canteen/consumption/create.html +456 -0
  25. fnschoo1/canteen/templates/canteen/ingredient/close.html +11 -0
  26. fnschoo1/canteen/templates/canteen/ingredient/create.html +19 -0
  27. fnschoo1/canteen/templates/canteen/ingredient/create_one.html +17 -0
  28. fnschoo1/canteen/templates/canteen/ingredient/delete.html +41 -0
  29. fnschoo1/canteen/templates/canteen/ingredient/list.html +128 -0
  30. fnschoo1/canteen/templates/canteen/ingredient/update.html +23 -0
  31. fnschoo1/canteen/templates/canteen/meal_type/create.html +17 -0
  32. fnschoo1/canteen/templates/canteen/meal_type/delete.html +56 -0
  33. fnschoo1/canteen/templates/canteen/meal_type/list.html +59 -0
  34. fnschoo1/canteen/templates/canteen/meal_type/update.html +23 -0
  35. fnschoo1/canteen/tests.py +3 -0
  36. fnschoo1/canteen/urls.py +116 -0
  37. fnschoo1/canteen/views.py +814 -0
  38. fnschoo1/canteen/workbook/generate.py +2098 -0
  39. fnschoo1/db.sqlite3 +0 -0
  40. fnschoo1/fnschool/__init__.py +13 -0
  41. fnschoo1/fnschool/asgi.py +16 -0
  42. fnschoo1/fnschool/settings.py +167 -0
  43. fnschoo1/fnschool/templatetags/fnschool_tags.py +27 -0
  44. fnschoo1/fnschool/urls.py +30 -0
  45. fnschoo1/fnschool/views.py +9 -0
  46. fnschoo1/fnschool/wsgi.py +16 -0
  47. fnschoo1/locale/en/LC_MESSAGES/django.mo +0 -0
  48. fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  49. fnschoo1/manage.py +25 -0
  50. fnschoo1/profiles/admin.py +27 -0
  51. fnschoo1/profiles/apps.py +12 -0
  52. fnschoo1/profiles/forms.py +67 -0
  53. fnschoo1/profiles/migrations/0001_initial.py +192 -0
  54. fnschoo1/profiles/migrations/0002_alter_profile_bio.py +20 -0
  55. fnschoo1/profiles/migrations/0003_alter_profile_options_alter_profile_address_and_more.py +67 -0
  56. fnschoo1/profiles/migrations/0004_profile_gender.py +26 -0
  57. fnschoo1/profiles/migrations/0005_alter_profile_gender.py +23 -0
  58. fnschoo1/profiles/models.py +60 -0
  59. fnschoo1/profiles/signals.py +20 -0
  60. fnschoo1/profiles/templates/profiles/create.html +16 -0
  61. fnschoo1/profiles/templates/profiles/detail.html +14 -0
  62. fnschoo1/profiles/templates/profiles/edit.html +12 -0
  63. fnschoo1/profiles/templates/profiles/log_in.html +20 -0
  64. fnschoo1/profiles/templates/profiles/log_out.html +12 -0
  65. fnschoo1/profiles/tests.py +3 -0
  66. fnschoo1/profiles/urls.py +15 -0
  67. fnschoo1/profiles/views.py +63 -0
  68. fnschoo1/static/css/bootstrap.min.css +11776 -0
  69. fnschoo1/static/css/fnschool.css +26 -0
  70. fnschoo1/static/images/favicon.ico +0 -0
  71. fnschoo1/static/js/bootstrap.bundle.min.js +4223 -0
  72. fnschoo1/static/js/bootstrap.min.js +2919 -0
  73. fnschoo1/static/js/fnschool.js +84 -0
  74. fnschoo1/static/js/jquery.min.js +5413 -0
  75. fnschoo1/static/js/jquery.slim.min.js +4331 -0
  76. fnschoo1/static/js/popper.min.js +1306 -0
  77. fnschoo1/static_collected/admin/css/autocomplete.css +377 -0
  78. fnschoo1/static_collected/admin/css/base.css +1224 -0
  79. fnschoo1/static_collected/admin/css/changelists.css +334 -0
  80. fnschoo1/static_collected/admin/css/dark_mode.css +136 -0
  81. fnschoo1/static_collected/admin/css/dashboard.css +30 -0
  82. fnschoo1/static_collected/admin/css/forms.css +546 -0
  83. fnschoo1/static_collected/admin/css/login.css +62 -0
  84. fnschoo1/static_collected/admin/css/nav_sidebar.css +145 -0
  85. fnschoo1/static_collected/admin/css/responsive.css +1043 -0
  86. fnschoo1/static_collected/admin/css/responsive_rtl.css +84 -0
  87. fnschoo1/static_collected/admin/css/rtl.css +311 -0
  88. fnschoo1/static_collected/admin/css/vendor/select2/select2.css +708 -0
  89. fnschoo1/static_collected/admin/css/vendor/select2/select2.min.css +1 -0
  90. fnschoo1/static_collected/admin/css/widgets.css +639 -0
  91. fnschoo1/static_collected/admin/js/SelectBox.js +128 -0
  92. fnschoo1/static_collected/admin/js/SelectFilter2.js +503 -0
  93. fnschoo1/static_collected/admin/js/actions.js +232 -0
  94. fnschoo1/static_collected/admin/js/admin/DateTimeShortcuts.js +496 -0
  95. fnschoo1/static_collected/admin/js/admin/RelatedObjectLookups.js +276 -0
  96. fnschoo1/static_collected/admin/js/autocomplete.js +33 -0
  97. fnschoo1/static_collected/admin/js/calendar.js +251 -0
  98. fnschoo1/static_collected/admin/js/cancel.js +29 -0
  99. fnschoo1/static_collected/admin/js/change_form.js +21 -0
  100. fnschoo1/static_collected/admin/js/collapse.js +43 -0
  101. fnschoo1/static_collected/admin/js/core.js +174 -0
  102. fnschoo1/static_collected/admin/js/filters.js +37 -0
  103. fnschoo1/static_collected/admin/js/inlines.js +439 -0
  104. fnschoo1/static_collected/admin/js/jquery.init.js +8 -0
  105. fnschoo1/static_collected/admin/js/nav_sidebar.js +81 -0
  106. fnschoo1/static_collected/admin/js/popup_response.js +24 -0
  107. fnschoo1/static_collected/admin/js/prepopulate.js +43 -0
  108. fnschoo1/static_collected/admin/js/prepopulate_init.js +20 -0
  109. fnschoo1/static_collected/admin/js/theme.js +57 -0
  110. fnschoo1/static_collected/admin/js/urlify.js +529 -0
  111. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.js +10913 -0
  112. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.min.js +2 -0
  113. fnschoo1/static_collected/admin/js/vendor/select2/i18n/af.js +43 -0
  114. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ar.js +36 -0
  115. fnschoo1/static_collected/admin/js/vendor/select2/i18n/az.js +33 -0
  116. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bg.js +38 -0
  117. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bn.js +39 -0
  118. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bs.js +48 -0
  119. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ca.js +41 -0
  120. fnschoo1/static_collected/admin/js/vendor/select2/i18n/cs.js +62 -0
  121. fnschoo1/static_collected/admin/js/vendor/select2/i18n/da.js +37 -0
  122. fnschoo1/static_collected/admin/js/vendor/select2/i18n/de.js +41 -0
  123. fnschoo1/static_collected/admin/js/vendor/select2/i18n/dsb.js +51 -0
  124. fnschoo1/static_collected/admin/js/vendor/select2/i18n/el.js +43 -0
  125. fnschoo1/static_collected/admin/js/vendor/select2/i18n/en.js +41 -0
  126. fnschoo1/static_collected/admin/js/vendor/select2/i18n/es.js +41 -0
  127. fnschoo1/static_collected/admin/js/vendor/select2/i18n/et.js +38 -0
  128. fnschoo1/static_collected/admin/js/vendor/select2/i18n/eu.js +45 -0
  129. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fa.js +42 -0
  130. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fi.js +42 -0
  131. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fr.js +43 -0
  132. fnschoo1/static_collected/admin/js/vendor/select2/i18n/gl.js +40 -0
  133. fnschoo1/static_collected/admin/js/vendor/select2/i18n/he.js +44 -0
  134. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hi.js +40 -0
  135. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hr.js +45 -0
  136. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hsb.js +51 -0
  137. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hu.js +44 -0
  138. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hy.js +40 -0
  139. fnschoo1/static_collected/admin/js/vendor/select2/i18n/id.js +36 -0
  140. fnschoo1/static_collected/admin/js/vendor/select2/i18n/is.js +37 -0
  141. fnschoo1/static_collected/admin/js/vendor/select2/i18n/it.js +43 -0
  142. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ja.js +40 -0
  143. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ka.js +42 -0
  144. fnschoo1/static_collected/admin/js/vendor/select2/i18n/km.js +38 -0
  145. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ko.js +42 -0
  146. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lt.js +45 -0
  147. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lv.js +41 -0
  148. fnschoo1/static_collected/admin/js/vendor/select2/i18n/mk.js +42 -0
  149. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ms.js +38 -0
  150. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nb.js +38 -0
  151. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ne.js +44 -0
  152. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nl.js +46 -0
  153. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pl.js +43 -0
  154. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ps.js +41 -0
  155. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt-BR.js +39 -0
  156. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt.js +41 -0
  157. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ro.js +43 -0
  158. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ru.js +48 -0
  159. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sk.js +61 -0
  160. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sl.js +41 -0
  161. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sq.js +43 -0
  162. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr-Cyrl.js +48 -0
  163. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr.js +48 -0
  164. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sv.js +40 -0
  165. fnschoo1/static_collected/admin/js/vendor/select2/i18n/th.js +36 -0
  166. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tk.js +36 -0
  167. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tr.js +40 -0
  168. fnschoo1/static_collected/admin/js/vendor/select2/i18n/uk.js +59 -0
  169. fnschoo1/static_collected/admin/js/vendor/select2/i18n/vi.js +37 -0
  170. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-CN.js +36 -0
  171. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-TW.js +33 -0
  172. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.js +7115 -0
  173. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.min.js +2 -0
  174. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.js +4993 -0
  175. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.min.js +160 -0
  176. fnschoo1/static_collected/css/bootstrap.min.css +11776 -0
  177. fnschoo1/static_collected/css/fnschool.css +26 -0
  178. fnschoo1/static_collected/images/favicon.ico +0 -0
  179. fnschoo1/static_collected/js/bootstrap.bundle.min.js +4223 -0
  180. fnschoo1/static_collected/js/bootstrap.min.js +2919 -0
  181. fnschoo1/static_collected/js/fnschool.js +84 -0
  182. fnschoo1/static_collected/js/jquery.min.js +5413 -0
  183. fnschoo1/static_collected/js/jquery.slim.min.js +4331 -0
  184. fnschoo1/static_collected/js/popper.min.js +1306 -0
  185. fnschoo1/templates/base/_css.html +1 -0
  186. fnschoo1/templates/base/_js.html +15 -0
  187. fnschoo1/templates/base/content.html +30 -0
  188. fnschoo1/templates/base/header_content_footer.html +35 -0
  189. fnschoo1/templates/close.html +11 -0
  190. fnschoo1/templates/home.html +51 -0
  191. fnschoo1/templates/includes/_footer.html +39 -0
  192. fnschoo1/templates/includes/_header.html +77 -0
  193. fnschoo1/templates/includes/_navigation.html +0 -0
  194. fnschoo1/templates/includes/_paginator.html +27 -0
  195. fnschoo1/templates/registration/logged_out.html +0 -0
  196. fnschoo1/templates/registration/login.html +0 -0
  197. fnschool-20251011.81638.854.dist-info/METADATA +179 -0
  198. fnschool-20251011.81638.854.dist-info/RECORD +209 -0
  199. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info}/WHEEL +1 -1
  200. fnschool-20251011.81638.854.dist-info/entry_points.txt +2 -0
  201. fnschool-20251011.81638.854.dist-info/top_level.txt +1 -0
  202. fnschool/__init__.py +0 -35
  203. fnschool/__main__.py +0 -16
  204. fnschool/app.py +0 -103
  205. fnschool/canteen/__init__.py +0 -3
  206. fnschool/canteen/__main__.py +0 -3
  207. fnschool/canteen/bill.py +0 -253
  208. fnschool/canteen/canteen.py +0 -1
  209. fnschool/canteen/canteen.toml +0 -61
  210. fnschool/canteen/config.py +0 -10
  211. fnschool/canteen/consuming.py +0 -53
  212. fnschool/canteen/currency.py +0 -17
  213. fnschool/canteen/data/bill.i18n.xlsx +0 -0
  214. fnschool/canteen/data/bill.xlsx +0 -0
  215. fnschool/canteen/data/consuming.xlsx +0 -0
  216. fnschool/canteen/data/purchase_list.xlsx +0 -0
  217. fnschool/canteen/entry.py +0 -40
  218. fnschool/canteen/food.py +0 -206
  219. fnschool/canteen/food_classes.py +0 -33
  220. fnschool/canteen/food_classes.toml +0 -64
  221. fnschool/canteen/operator.py +0 -91
  222. fnschool/canteen/path.py +0 -28
  223. fnschool/canteen/spreadsheet/base.py +0 -213
  224. fnschool/canteen/spreadsheet/consuming.py +0 -310
  225. fnschool/canteen/spreadsheet/consumingsum.py +0 -76
  226. fnschool/canteen/spreadsheet/cover.py +0 -64
  227. fnschool/canteen/spreadsheet/ctspreadsheet.py +0 -351
  228. fnschool/canteen/spreadsheet/food.py +0 -680
  229. fnschool/canteen/spreadsheet/inventory.py +0 -375
  230. fnschool/canteen/spreadsheet/merging.py +0 -340
  231. fnschool/canteen/spreadsheet/preconsuming.py +0 -329
  232. fnschool/canteen/spreadsheet/purchasing.py +0 -885
  233. fnschool/canteen/spreadsheet/purchasingsum.py +0 -110
  234. fnschool/canteen/spreadsheet/spreadsheet.py +0 -363
  235. fnschool/canteen/spreadsheet/translating.py +0 -12
  236. fnschool/canteen/spreadsheet/unwarehousing.py +0 -178
  237. fnschool/canteen/spreadsheet/unwarehousingsum.py +0 -11
  238. fnschool/canteen/spreadsheet/warehousing.py +0 -360
  239. fnschool/canteen/spreadsheet/workbook.py +0 -17
  240. fnschool/canteen/test.py +0 -97
  241. fnschool/config.py +0 -48
  242. fnschool/entry.py +0 -67
  243. fnschool/exam/__init__.py +0 -8
  244. fnschool/exam/data/parental_emails.xlsx +0 -0
  245. fnschool/exam/data/score.xlsx +0 -0
  246. fnschool/exam/email.py +0 -349
  247. fnschool/exam/entry.py +0 -36
  248. fnschool/exam/language.py +0 -19
  249. fnschool/exam/path.py +0 -24
  250. fnschool/exam/score.py +0 -1191
  251. fnschool/exam/subject.py +0 -20
  252. fnschool/exam/teacher.py +0 -54
  253. fnschool/external.py +0 -89
  254. fnschool/games/__init__.py +0 -1
  255. fnschool/games/__main__.py +0 -1
  256. fnschool/games/games.py +0 -1
  257. fnschool/inoutput.py +0 -97
  258. fnschool/language.py +0 -40
  259. fnschool/locales/en_US/LC_MESSAGES/fnschool.mo +0 -0
  260. fnschool/locales/zh_CN/LC_MESSAGES/fnschool.mo +0 -0
  261. fnschool/locales/zh_HK/LC_MESSAGES/fnschool.mo +0 -0
  262. fnschool/locales/zh_SG/LC_MESSAGES/fnschool.mo +0 -0
  263. fnschool/locales/zh_TW/LC_MESSAGES/fnschool.mo +0 -0
  264. fnschool/path.py +0 -45
  265. fnschool/test.py +0 -24
  266. fnschool/user.py +0 -262
  267. fnschool-20250109.80531.837.dist-info/METADATA +0 -342
  268. fnschool-20250109.80531.837.dist-info/RECORD +0 -78
  269. fnschool-20250109.80531.837.dist-info/entry_points.txt +0 -5
  270. fnschool-20250109.80531.837.dist-info/top_level.txt +0 -1
  271. /fnschool/canteen/consume.py → /fnschoo1/canteen/__init__.py +0 -0
  272. /fnschool/canteen/food_recount.toml → /fnschoo1/canteen/migrations/__init__.py +0 -0
  273. {fnschool/canteen/spreadsheet → fnschoo1/canteen/workbook}/__init__.py +0 -0
  274. /fnschool/exam/__main__.py → /fnschoo1/fnschool/templatetags/__init__.py +0 -0
  275. /fnschool/canteen/food_recounts.toml → /fnschoo1/profiles/__init__.py +0 -0
  276. /fnschool/canteen/warehouse.py → /fnschoo1/profiles/migrations/__init__.py +0 -0
  277. /fnschool/canteen/workbook.toml → /fnschoo1/templates/base/_content.html +0 -0
  278. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,529 @@
1
+ /*global XRegExp*/
2
+ 'use strict'
3
+ {
4
+ const LATIN_MAP = {
5
+ À: 'A',
6
+ Á: 'A',
7
+ Â: 'A',
8
+ Ã: 'A',
9
+ Ä: 'A',
10
+ Å: 'A',
11
+ Æ: 'AE',
12
+ Ç: 'C',
13
+ È: 'E',
14
+ É: 'E',
15
+ Ê: 'E',
16
+ Ë: 'E',
17
+ Ì: 'I',
18
+ Í: 'I',
19
+ Î: 'I',
20
+ Ï: 'I',
21
+ Ð: 'D',
22
+ Ñ: 'N',
23
+ Ò: 'O',
24
+ Ó: 'O',
25
+ Ô: 'O',
26
+ Õ: 'O',
27
+ Ö: 'O',
28
+ Ő: 'O',
29
+ Ø: 'O',
30
+ Ù: 'U',
31
+ Ú: 'U',
32
+ Û: 'U',
33
+ Ü: 'U',
34
+ Ű: 'U',
35
+ Ý: 'Y',
36
+ Þ: 'TH',
37
+ Ÿ: 'Y',
38
+ ß: 'ss',
39
+ à: 'a',
40
+ á: 'a',
41
+ â: 'a',
42
+ ã: 'a',
43
+ ä: 'a',
44
+ å: 'a',
45
+ æ: 'ae',
46
+ ç: 'c',
47
+ è: 'e',
48
+ é: 'e',
49
+ ê: 'e',
50
+ ë: 'e',
51
+ ì: 'i',
52
+ í: 'i',
53
+ î: 'i',
54
+ ï: 'i',
55
+ ð: 'd',
56
+ ñ: 'n',
57
+ ò: 'o',
58
+ ó: 'o',
59
+ ô: 'o',
60
+ õ: 'o',
61
+ ö: 'o',
62
+ ő: 'o',
63
+ ø: 'o',
64
+ ù: 'u',
65
+ ú: 'u',
66
+ û: 'u',
67
+ ü: 'u',
68
+ ű: 'u',
69
+ ý: 'y',
70
+ þ: 'th',
71
+ ÿ: 'y',
72
+ }
73
+ const LATIN_SYMBOLS_MAP = {
74
+ '©': '(c)',
75
+ }
76
+ const GREEK_MAP = {
77
+ α: 'a',
78
+ β: 'b',
79
+ γ: 'g',
80
+ δ: 'd',
81
+ ε: 'e',
82
+ ζ: 'z',
83
+ η: 'h',
84
+ θ: '8',
85
+ ι: 'i',
86
+ κ: 'k',
87
+ λ: 'l',
88
+ μ: 'm',
89
+ ν: 'n',
90
+ ξ: '3',
91
+ ο: 'o',
92
+ π: 'p',
93
+ ρ: 'r',
94
+ σ: 's',
95
+ τ: 't',
96
+ υ: 'y',
97
+ φ: 'f',
98
+ χ: 'x',
99
+ ψ: 'ps',
100
+ ω: 'w',
101
+ ά: 'a',
102
+ έ: 'e',
103
+ ί: 'i',
104
+ ό: 'o',
105
+ ύ: 'y',
106
+ ή: 'h',
107
+ ώ: 'w',
108
+ ς: 's',
109
+ ϊ: 'i',
110
+ ΰ: 'y',
111
+ ϋ: 'y',
112
+ ΐ: 'i',
113
+ Α: 'A',
114
+ Β: 'B',
115
+ Γ: 'G',
116
+ Δ: 'D',
117
+ Ε: 'E',
118
+ Ζ: 'Z',
119
+ Η: 'H',
120
+ Θ: '8',
121
+ Ι: 'I',
122
+ Κ: 'K',
123
+ Λ: 'L',
124
+ Μ: 'M',
125
+ Ν: 'N',
126
+ Ξ: '3',
127
+ Ο: 'O',
128
+ Π: 'P',
129
+ Ρ: 'R',
130
+ Σ: 'S',
131
+ Τ: 'T',
132
+ Υ: 'Y',
133
+ Φ: 'F',
134
+ Χ: 'X',
135
+ Ψ: 'PS',
136
+ Ω: 'W',
137
+ Ά: 'A',
138
+ Έ: 'E',
139
+ Ί: 'I',
140
+ Ό: 'O',
141
+ Ύ: 'Y',
142
+ Ή: 'H',
143
+ Ώ: 'W',
144
+ Ϊ: 'I',
145
+ Ϋ: 'Y',
146
+ }
147
+ const TURKISH_MAP = {
148
+ ş: 's',
149
+ Ş: 'S',
150
+ ı: 'i',
151
+ İ: 'I',
152
+ ç: 'c',
153
+ Ç: 'C',
154
+ ü: 'u',
155
+ Ü: 'U',
156
+ ö: 'o',
157
+ Ö: 'O',
158
+ ğ: 'g',
159
+ Ğ: 'G',
160
+ }
161
+ const ROMANIAN_MAP = {
162
+ ă: 'a',
163
+ î: 'i',
164
+ ș: 's',
165
+ ț: 't',
166
+ â: 'a',
167
+ Ă: 'A',
168
+ Î: 'I',
169
+ Ș: 'S',
170
+ Ț: 'T',
171
+ Â: 'A',
172
+ }
173
+ const RUSSIAN_MAP = {
174
+ а: 'a',
175
+ б: 'b',
176
+ в: 'v',
177
+ г: 'g',
178
+ д: 'd',
179
+ е: 'e',
180
+ ё: 'yo',
181
+ ж: 'zh',
182
+ з: 'z',
183
+ и: 'i',
184
+ й: 'j',
185
+ к: 'k',
186
+ л: 'l',
187
+ м: 'm',
188
+ н: 'n',
189
+ о: 'o',
190
+ п: 'p',
191
+ р: 'r',
192
+ с: 's',
193
+ т: 't',
194
+ у: 'u',
195
+ ф: 'f',
196
+ х: 'h',
197
+ ц: 'c',
198
+ ч: 'ch',
199
+ ш: 'sh',
200
+ щ: 'sh',
201
+ ъ: '',
202
+ ы: 'y',
203
+ ь: '',
204
+ э: 'e',
205
+ ю: 'yu',
206
+ я: 'ya',
207
+ А: 'A',
208
+ Б: 'B',
209
+ В: 'V',
210
+ Г: 'G',
211
+ Д: 'D',
212
+ Е: 'E',
213
+ Ё: 'Yo',
214
+ Ж: 'Zh',
215
+ З: 'Z',
216
+ И: 'I',
217
+ Й: 'J',
218
+ К: 'K',
219
+ Л: 'L',
220
+ М: 'M',
221
+ Н: 'N',
222
+ О: 'O',
223
+ П: 'P',
224
+ Р: 'R',
225
+ С: 'S',
226
+ Т: 'T',
227
+ У: 'U',
228
+ Ф: 'F',
229
+ Х: 'H',
230
+ Ц: 'C',
231
+ Ч: 'Ch',
232
+ Ш: 'Sh',
233
+ Щ: 'Sh',
234
+ Ъ: '',
235
+ Ы: 'Y',
236
+ Ь: '',
237
+ Э: 'E',
238
+ Ю: 'Yu',
239
+ Я: 'Ya',
240
+ }
241
+ const UKRAINIAN_MAP = {
242
+ Є: 'Ye',
243
+ І: 'I',
244
+ Ї: 'Yi',
245
+ Ґ: 'G',
246
+ є: 'ye',
247
+ і: 'i',
248
+ ї: 'yi',
249
+ ґ: 'g',
250
+ }
251
+ const CZECH_MAP = {
252
+ č: 'c',
253
+ ď: 'd',
254
+ ě: 'e',
255
+ ň: 'n',
256
+ ř: 'r',
257
+ š: 's',
258
+ ť: 't',
259
+ ů: 'u',
260
+ ž: 'z',
261
+ Č: 'C',
262
+ Ď: 'D',
263
+ Ě: 'E',
264
+ Ň: 'N',
265
+ Ř: 'R',
266
+ Š: 'S',
267
+ Ť: 'T',
268
+ Ů: 'U',
269
+ Ž: 'Z',
270
+ }
271
+ const SLOVAK_MAP = {
272
+ á: 'a',
273
+ ä: 'a',
274
+ č: 'c',
275
+ ď: 'd',
276
+ é: 'e',
277
+ í: 'i',
278
+ ľ: 'l',
279
+ ĺ: 'l',
280
+ ň: 'n',
281
+ ó: 'o',
282
+ ô: 'o',
283
+ ŕ: 'r',
284
+ š: 's',
285
+ ť: 't',
286
+ ú: 'u',
287
+ ý: 'y',
288
+ ž: 'z',
289
+ Á: 'a',
290
+ Ä: 'A',
291
+ Č: 'C',
292
+ Ď: 'D',
293
+ É: 'E',
294
+ Í: 'I',
295
+ Ľ: 'L',
296
+ Ĺ: 'L',
297
+ Ň: 'N',
298
+ Ó: 'O',
299
+ Ô: 'O',
300
+ Ŕ: 'R',
301
+ Š: 'S',
302
+ Ť: 'T',
303
+ Ú: 'U',
304
+ Ý: 'Y',
305
+ Ž: 'Z',
306
+ }
307
+ const POLISH_MAP = {
308
+ ą: 'a',
309
+ ć: 'c',
310
+ ę: 'e',
311
+ ł: 'l',
312
+ ń: 'n',
313
+ ó: 'o',
314
+ ś: 's',
315
+ ź: 'z',
316
+ ż: 'z',
317
+ Ą: 'A',
318
+ Ć: 'C',
319
+ Ę: 'E',
320
+ Ł: 'L',
321
+ Ń: 'N',
322
+ Ó: 'O',
323
+ Ś: 'S',
324
+ Ź: 'Z',
325
+ Ż: 'Z',
326
+ }
327
+ const LATVIAN_MAP = {
328
+ ā: 'a',
329
+ č: 'c',
330
+ ē: 'e',
331
+ ģ: 'g',
332
+ ī: 'i',
333
+ ķ: 'k',
334
+ ļ: 'l',
335
+ ņ: 'n',
336
+ š: 's',
337
+ ū: 'u',
338
+ ž: 'z',
339
+ Ā: 'A',
340
+ Č: 'C',
341
+ Ē: 'E',
342
+ Ģ: 'G',
343
+ Ī: 'I',
344
+ Ķ: 'K',
345
+ Ļ: 'L',
346
+ Ņ: 'N',
347
+ Š: 'S',
348
+ Ū: 'U',
349
+ Ž: 'Z',
350
+ }
351
+ const ARABIC_MAP = {
352
+ أ: 'a',
353
+ ب: 'b',
354
+ ت: 't',
355
+ ث: 'th',
356
+ ج: 'g',
357
+ ح: 'h',
358
+ خ: 'kh',
359
+ د: 'd',
360
+ ذ: 'th',
361
+ ر: 'r',
362
+ ز: 'z',
363
+ س: 's',
364
+ ش: 'sh',
365
+ ص: 's',
366
+ ض: 'd',
367
+ ط: 't',
368
+ ظ: 'th',
369
+ ع: 'aa',
370
+ غ: 'gh',
371
+ ف: 'f',
372
+ ق: 'k',
373
+ ك: 'k',
374
+ ل: 'l',
375
+ م: 'm',
376
+ ن: 'n',
377
+ ه: 'h',
378
+ و: 'o',
379
+ ي: 'y',
380
+ }
381
+ const LITHUANIAN_MAP = {
382
+ ą: 'a',
383
+ č: 'c',
384
+ ę: 'e',
385
+ ė: 'e',
386
+ į: 'i',
387
+ š: 's',
388
+ ų: 'u',
389
+ ū: 'u',
390
+ ž: 'z',
391
+ Ą: 'A',
392
+ Č: 'C',
393
+ Ę: 'E',
394
+ Ė: 'E',
395
+ Į: 'I',
396
+ Š: 'S',
397
+ Ų: 'U',
398
+ Ū: 'U',
399
+ Ž: 'Z',
400
+ }
401
+ const SERBIAN_MAP = {
402
+ ђ: 'dj',
403
+ ј: 'j',
404
+ љ: 'lj',
405
+ њ: 'nj',
406
+ ћ: 'c',
407
+ џ: 'dz',
408
+ đ: 'dj',
409
+ Ђ: 'Dj',
410
+ Ј: 'j',
411
+ Љ: 'Lj',
412
+ Њ: 'Nj',
413
+ Ћ: 'C',
414
+ Џ: 'Dz',
415
+ Đ: 'Dj',
416
+ }
417
+ const AZERBAIJANI_MAP = {
418
+ ç: 'c',
419
+ ə: 'e',
420
+ ğ: 'g',
421
+ ı: 'i',
422
+ ö: 'o',
423
+ ş: 's',
424
+ ü: 'u',
425
+ Ç: 'C',
426
+ Ə: 'E',
427
+ Ğ: 'G',
428
+ İ: 'I',
429
+ Ö: 'O',
430
+ Ş: 'S',
431
+ Ü: 'U',
432
+ }
433
+ const GEORGIAN_MAP = {
434
+ ა: 'a',
435
+ ბ: 'b',
436
+ გ: 'g',
437
+ დ: 'd',
438
+ ე: 'e',
439
+ ვ: 'v',
440
+ ზ: 'z',
441
+ თ: 't',
442
+ ი: 'i',
443
+ კ: 'k',
444
+ ლ: 'l',
445
+ მ: 'm',
446
+ ნ: 'n',
447
+ ო: 'o',
448
+ პ: 'p',
449
+ ჟ: 'j',
450
+ რ: 'r',
451
+ ს: 's',
452
+ ტ: 't',
453
+ უ: 'u',
454
+ ფ: 'f',
455
+ ქ: 'q',
456
+ ღ: 'g',
457
+ ყ: 'y',
458
+ შ: 'sh',
459
+ ჩ: 'ch',
460
+ ც: 'c',
461
+ ძ: 'dz',
462
+ წ: 'w',
463
+ ჭ: 'ch',
464
+ ხ: 'x',
465
+ ჯ: 'j',
466
+ ჰ: 'h',
467
+ }
468
+
469
+ const ALL_DOWNCODE_MAPS = [
470
+ LATIN_MAP,
471
+ LATIN_SYMBOLS_MAP,
472
+ GREEK_MAP,
473
+ TURKISH_MAP,
474
+ ROMANIAN_MAP,
475
+ RUSSIAN_MAP,
476
+ UKRAINIAN_MAP,
477
+ CZECH_MAP,
478
+ SLOVAK_MAP,
479
+ POLISH_MAP,
480
+ LATVIAN_MAP,
481
+ ARABIC_MAP,
482
+ LITHUANIAN_MAP,
483
+ SERBIAN_MAP,
484
+ AZERBAIJANI_MAP,
485
+ GEORGIAN_MAP,
486
+ ]
487
+
488
+ const Downcoder = {
489
+ Initialize: function () {
490
+ if (Downcoder.map) {
491
+ // already made
492
+ return
493
+ }
494
+ Downcoder.map = {}
495
+ for (const lookup of ALL_DOWNCODE_MAPS) {
496
+ Object.assign(Downcoder.map, lookup)
497
+ }
498
+ Downcoder.regex = new RegExp(Object.keys(Downcoder.map).join('|'), 'g')
499
+ },
500
+ }
501
+
502
+ function downcode(slug) {
503
+ Downcoder.Initialize()
504
+ return slug.replace(Downcoder.regex, function (m) {
505
+ return Downcoder.map[m]
506
+ })
507
+ }
508
+
509
+ function URLify(s, num_chars, allowUnicode) {
510
+ // changes, e.g., "Petty theft" to "petty-theft"
511
+ if (!allowUnicode) {
512
+ s = downcode(s)
513
+ }
514
+ s = s.toLowerCase() // convert to lowercase
515
+ // if downcode doesn't hit, the char will be stripped here
516
+ if (allowUnicode) {
517
+ // Keep Unicode letters including both lowercase and uppercase
518
+ // characters, whitespace, and dash; remove other characters.
519
+ s = XRegExp.replace(s, XRegExp('[^-_\\p{L}\\p{N}\\s]', 'g'), '')
520
+ } else {
521
+ s = s.replace(/[^-\w\s]/g, '') // remove unneeded chars
522
+ }
523
+ s = s.replace(/^\s+|\s+$/g, '') // trim leading/trailing spaces
524
+ s = s.replace(/[-\s]+/g, '-') // convert spaces to hyphens
525
+ s = s.substring(0, num_chars) // trim to first num_chars chars
526
+ return s.replace(/-+$/g, '') // trim any trailing hyphens
527
+ }
528
+ window.URLify = URLify
529
+ }