kms 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/kms/application.js +4 -0
  3. data/app/assets/javascripts/kms/application/controllers/pages_controller.coffee.erb +3 -1
  4. data/app/assets/javascripts/kms/application/controllers/snippets_controller.coffee.erb +2 -1
  5. data/app/assets/javascripts/kms/application/controllers/templates_controller.coffee.erb +2 -1
  6. data/app/assets/javascripts/kms/application/services/errors_service.coffee +1 -4
  7. data/app/assets/stylesheets/kms/application.css +1 -0
  8. data/app/assets/stylesheets/kms/custom.css.scss +3 -0
  9. data/app/controllers/kms/assets_controller.rb +3 -3
  10. data/app/controllers/kms/pages_controller.rb +2 -2
  11. data/app/controllers/kms/settings_controller.rb +1 -1
  12. data/app/controllers/kms/snippets_controller.rb +2 -2
  13. data/app/controllers/kms/templates_controller.rb +5 -5
  14. data/app/controllers/kms/users_controller.rb +2 -2
  15. data/app/views/layouts/kms/kms.html.erb +0 -1
  16. data/config/locales/devise.zh-CN.yml +59 -0
  17. data/config/locales/zh-CN.yml +231 -0
  18. data/lib/kms/version.rb +1 -1
  19. data/spec/controllers/kms/templates_controller_spec.rb +26 -0
  20. data/spec/internal/config/database.yml +7 -0
  21. data/spec/internal/log/test.log +131623 -0
  22. data/spec/internal/public/uploads/kms/asset/file/1/avatar.jpg +0 -0
  23. data/spec/internal/public/uploads/kms/asset/file/2/avatar.jpg +0 -0
  24. data/spec/internal/public/uploads/kms/asset/file/2/style.css +1 -0
  25. data/spec/internal/public/uploads/kms/asset/file/3/style.css +1 -0
  26. data/spec/internal/public/uploads/kms/asset/file/4/avatar.jpg +0 -0
  27. data/spec/internal/public/uploads/kms/asset/file/4/style.css +1 -0
  28. data/spec/internal/public/uploads/kms/asset/file/5/style.css +1 -0
  29. data/spec/internal/public/uploads/kms/asset/file/6/style.css +1 -0
  30. data/spec/internal/public/uploads/tmp/1500976987-41025-0002-0883/style.css +1 -0
  31. data/spec/internal/public/uploads/tmp/1500977082-41195-0002-6495/style.css +1 -0
  32. data/spec/internal/public/uploads/tmp/1500977109-41364-0002-4518/style.css +1 -0
  33. data/spec/internal/public/uploads/tmp/1500977152-41405-0002-2345/style.css +1 -0
  34. data/spec/internal/public/uploads/tmp/1500977327-41694-0002-5448/style.css +1 -0
  35. data/spec/internal/public/uploads/tmp/1500977376-41732-0002-7916/style.css +1 -0
  36. data/spec/internal/public/uploads/tmp/1500977392-41759-0002-7593/style.css +1 -0
  37. data/spec/internal/public/uploads/tmp/1500977410-42259-0002-7527/style.css +1 -0
  38. data/spec/internal/public/uploads/tmp/1500977429-42306-0002-5937/style.css +1 -0
  39. data/spec/internal/public/uploads/tmp/1500977437-42324-0002-5880/style.css +1 -0
  40. data/spec/internal/public/uploads/tmp/1500983228-53594-0002-4559/style.css +1 -0
  41. data/spec/internal/public/uploads/tmp/1500983284-53632-0002-6590/style.css +1 -0
  42. data/spec/internal/public/uploads/tmp/1500983360-53784-0002-7289/style.css +1 -0
  43. data/spec/internal/public/uploads/tmp/1500983469-54321-0002-0386/avatar.jpg +0 -0
  44. data/spec/internal/public/uploads/tmp/1500983469-54321-0004-5691/style.css +1 -0
  45. data/spec/internal/public/uploads/tmp/1500983511-54352-0002-5720/avatar.jpg +0 -0
  46. data/spec/internal/public/uploads/tmp/1500983511-54352-0004-1399/style.css +1 -0
  47. data/spec/internal/public/uploads/tmp/1500983610-54507-0002-4280/avatar.jpg +0 -0
  48. data/spec/internal/public/uploads/tmp/1500983610-54507-0004-9758/style.css +1 -0
  49. data/spec/internal/public/uploads/tmp/1500984466-57012-0002-4146/avatar.jpg +0 -0
  50. data/spec/internal/public/uploads/tmp/1500984466-57012-0004-5895/style.css +1 -0
  51. data/spec/internal/public/uploads/tmp/1500984509-57158-0002-9657/avatar.jpg +0 -0
  52. data/spec/internal/public/uploads/tmp/1500984509-57158-0004-5003/style.css +1 -0
  53. data/spec/internal/public/uploads/tmp/1500984616-57697-0002-7201/avatar.jpg +0 -0
  54. data/spec/internal/public/uploads/tmp/1500984616-57697-0004-6255/style.css +1 -0
  55. data/spec/internal/public/uploads/tmp/1500985257-58947-0002-3629/avatar.jpg +0 -0
  56. data/spec/internal/public/uploads/tmp/1500985257-58947-0004-5338/style.css +1 -0
  57. data/spec/internal/public/uploads/tmp/1500985407-58947-0006-5929/style.css +1 -0
  58. data/spec/internal/public/uploads/tmp/1500985473-59264-0002-0397/avatar.jpg +0 -0
  59. data/spec/internal/public/uploads/tmp/1500985473-59264-0004-6493/style.css +1 -0
  60. data/spec/internal/public/uploads/tmp/1500985475-59264-0007-8674/style.css +1 -0
  61. data/spec/internal/public/uploads/tmp/1500985538-59468-0002-9206/avatar.jpg +0 -0
  62. data/spec/internal/public/uploads/tmp/1500985538-59468-0004-2586/style.css +1 -0
  63. data/spec/internal/public/uploads/tmp/1500985538-59468-0007-6200/style.css +1 -0
  64. data/spec/internal/public/uploads/tmp/1500988358-65877-0002-4528/avatar.jpg +0 -0
  65. data/spec/internal/public/uploads/tmp/1500988358-65877-0004-5904/style.css +1 -0
  66. data/spec/internal/public/uploads/tmp/1500988358-65877-0007-7320/style.css +1 -0
  67. data/spec/internal/public/uploads/tmp/1500988407-65916-0002-3138/avatar.jpg +0 -0
  68. data/spec/internal/public/uploads/tmp/1500988407-65916-0004-5400/style.css +1 -0
  69. data/spec/internal/public/uploads/tmp/1500988407-65916-0007-1655/style.css +1 -0
  70. data/spec/internal/public/uploads/tmp/1500988421-65950-0002-9415/avatar.jpg +0 -0
  71. data/spec/internal/public/uploads/tmp/1500988421-65950-0004-7130/style.css +1 -0
  72. data/spec/internal/public/uploads/tmp/1500988421-65950-0007-9886/style.css +1 -0
  73. data/spec/internal/public/uploads/tmp/1500988435-65981-0002-3228/avatar.jpg +0 -0
  74. data/spec/internal/public/uploads/tmp/1500988435-65981-0004-3682/style.css +1 -0
  75. data/spec/internal/public/uploads/tmp/1500988435-65981-0007-1582/style.css +1 -0
  76. data/spec/internal/public/uploads/tmp/1500988475-66122-0002-9516/avatar.jpg +0 -0
  77. data/spec/internal/public/uploads/tmp/1500988475-66122-0004-5634/style.css +1 -0
  78. data/spec/internal/public/uploads/tmp/1500988530-66122-0007-2272/style.css +1 -0
  79. data/spec/internal/public/uploads/tmp/1500988554-66315-0002-6262/avatar.jpg +0 -0
  80. data/spec/internal/public/uploads/tmp/1500988554-66315-0004-6099/style.css +1 -0
  81. data/spec/internal/public/uploads/tmp/1500988554-66315-0007-1632/style.css +1 -0
  82. data/spec/internal/public/uploads/tmp/1500991751-73722-0002-9937/avatar.jpg +0 -0
  83. data/spec/internal/public/uploads/tmp/1500991751-73722-0004-8034/style.css +1 -0
  84. data/spec/internal/public/uploads/tmp/1500991751-73722-0007-7763/style.css +1 -0
  85. data/spec/internal/public/uploads/tmp/1501233238-34385-0002-3210/avatar.jpg +0 -0
  86. data/spec/internal/public/uploads/tmp/1501233238-34385-0004-5881/style.css +1 -0
  87. data/spec/internal/public/uploads/tmp/1501233238-34385-0007-6280/style.css +1 -0
  88. data/spec/internal/public/uploads/tmp/1508749566-27986-0002-2760/avatar.jpg +0 -0
  89. data/spec/internal/public/uploads/tmp/1508749567-27986-0004-6631/style.css +1 -0
  90. data/spec/internal/public/uploads/tmp/1508749567-27986-0007-5688/style.css +1 -0
  91. data/spec/internal/public/uploads/tmp/1508749660-28185-0002-3255/avatar.jpg +0 -0
  92. data/spec/internal/public/uploads/tmp/1508749660-28185-0004-3845/style.css +1 -0
  93. data/spec/internal/public/uploads/tmp/1508749660-28185-0007-5866/style.css +1 -0
  94. data/spec/internal/public/uploads/tmp/1508749674-28217-0002-4090/avatar.jpg +0 -0
  95. data/spec/internal/public/uploads/tmp/1508749675-28217-0004-8839/style.css +1 -0
  96. data/spec/internal/public/uploads/tmp/1508749675-28217-0007-2008/style.css +1 -0
  97. data/spec/internal/public/uploads/tmp/1508749687-28352-0002-3233/avatar.jpg +0 -0
  98. data/spec/internal/public/uploads/tmp/1508749687-28352-0004-9432/style.css +1 -0
  99. data/spec/internal/public/uploads/tmp/1508749687-28352-0007-1314/style.css +1 -0
  100. data/spec/internal/public/uploads/tmp/1509440450-18161-0002-7535/avatar.jpg +0 -0
  101. data/spec/internal/public/uploads/tmp/1509440450-18161-0004-3378/style.css +1 -0
  102. data/spec/internal/public/uploads/tmp/1509440450-18161-0007-1253/style.css +1 -0
  103. data/spec/internal/public/uploads/tmp/1509440662-18637-0002-2796/avatar.jpg +0 -0
  104. data/spec/internal/public/uploads/tmp/1509440662-18637-0004-5488/style.css +1 -0
  105. data/spec/internal/public/uploads/tmp/1509440662-18637-0007-1149/style.css +1 -0
  106. data/spec/internal/public/uploads/tmp/1509440905-19171-0002-1570/avatar.jpg +0 -0
  107. data/spec/internal/public/uploads/tmp/1509440905-19171-0004-9067/style.css +1 -0
  108. data/spec/internal/public/uploads/tmp/1509440905-19171-0007-1234/style.css +1 -0
  109. data/spec/internal/public/uploads/tmp/1509442552-23601-0002-0420/avatar.jpg +0 -0
  110. data/spec/internal/public/uploads/tmp/1509442552-23601-0004-3628/style.css +1 -0
  111. data/spec/internal/public/uploads/tmp/1509442552-23601-0007-7909/style.css +1 -0
  112. data/spec/internal/public/uploads/tmp/1509445639-31288-0002-5614/avatar.jpg +0 -0
  113. data/spec/internal/public/uploads/tmp/1509445639-31288-0004-5098/style.css +1 -0
  114. data/spec/internal/public/uploads/tmp/1509445639-31288-0007-4238/style.css +1 -0
  115. data/spec/internal/public/uploads/tmp/1511440007-18238-0002-4241/avatar.jpg +0 -0
  116. data/spec/internal/public/uploads/tmp/1511440007-18238-0004-2485/style.css +1 -0
  117. data/spec/internal/public/uploads/tmp/1511440007-18238-0007-1399/style.css +1 -0
  118. data/spec/internal/public/uploads/tmp/1511440298-19007-0002-2235/avatar.jpg +0 -0
  119. data/spec/internal/public/uploads/tmp/1511440298-19007-0004-4653/style.css +1 -0
  120. data/spec/internal/public/uploads/tmp/1511440298-19007-0006-2170/style.css +1 -0
  121. data/spec/internal/public/uploads/tmp/1511440298-19007-0009-2199/style.css +1 -0
  122. data/spec/internal/public/uploads/tmp/1511440315-19038-0002-5207/avatar.jpg +0 -0
  123. data/spec/internal/public/uploads/tmp/1511440315-19038-0004-8181/style.css +1 -0
  124. data/spec/internal/public/uploads/tmp/1511440315-19038-0006-6102/avatar.jpg +0 -0
  125. data/spec/internal/public/uploads/tmp/1511440315-19038-0008-6730/style.css +1 -0
  126. data/spec/internal/public/uploads/tmp/1511440315-19038-0010-4426/style.css +1 -0
  127. data/spec/internal/public/uploads/tmp/1511440315-19038-0013-4618/style.css +1 -0
  128. data/spec/internal/public/uploads/tmp/1511440346-19182-0002-3434/avatar.jpg +0 -0
  129. data/spec/internal/public/uploads/tmp/1511440346-19182-0004-7525/style.css +1 -0
  130. data/spec/internal/public/uploads/tmp/1511440375-19182-0006-9609/avatar.jpg +0 -0
  131. data/spec/internal/public/uploads/tmp/1511440375-19182-0008-1622/style.css +1 -0
  132. data/spec/internal/public/uploads/tmp/1511440376-19182-0010-5905/style.css +1 -0
  133. data/spec/internal/public/uploads/tmp/1511440376-19182-0013-7924/style.css +1 -0
  134. data/spec/internal/public/uploads/tmp/1511440392-19224-0002-8819/avatar.jpg +0 -0
  135. data/spec/internal/public/uploads/tmp/1511440392-19224-0004-8863/style.css +1 -0
  136. data/spec/internal/public/uploads/tmp/1511440392-19224-0006-0138/style.css +1 -0
  137. data/spec/internal/public/uploads/tmp/1511440392-19224-0007-8534/style.css +1 -0
  138. data/spec/internal/public/uploads/tmp/1511440392-19224-0008-6110/style.css +1 -0
  139. data/spec/internal/public/uploads/tmp/1511440392-19224-0009-5540/style.css +1 -0
  140. data/spec/internal/public/uploads/tmp/1511440392-19224-0012-3148/style.css +1 -0
  141. data/spec/internal/public/uploads/tmp/1511440452-19263-0002-7025/avatar.jpg +0 -0
  142. data/spec/internal/public/uploads/tmp/1511440452-19263-0004-7209/style.css +1 -0
  143. data/spec/internal/public/uploads/tmp/1511440452-19263-0006-2686/style.css +1 -0
  144. data/spec/internal/public/uploads/tmp/1511440452-19263-0007-5736/style.css +1 -0
  145. data/spec/internal/public/uploads/tmp/1511440452-19263-0008-3182/style.css +1 -0
  146. data/spec/internal/public/uploads/tmp/1511440452-19263-0009-7924/style.css +1 -0
  147. data/spec/internal/public/uploads/tmp/1511440452-19263-0012-7410/style.css +1 -0
  148. data/spec/internal/public/uploads/tmp/1511440472-19413-0002-2228/avatar.jpg +0 -0
  149. data/spec/internal/public/uploads/tmp/1511440472-19413-0004-6315/style.css +1 -0
  150. data/spec/internal/public/uploads/tmp/1511440472-19413-0006-8298/style.css +1 -0
  151. data/spec/internal/public/uploads/tmp/1511440472-19413-0007-1759/style.css +1 -0
  152. data/spec/internal/public/uploads/tmp/1511440472-19413-0008-4788/style.css +1 -0
  153. data/spec/internal/public/uploads/tmp/1511440472-19413-0009-2475/style.css +1 -0
  154. data/spec/internal/public/uploads/tmp/1511440472-19413-0012-2049/style.css +1 -0
  155. data/spec/internal/public/uploads/tmp/1516625891-88818-0002-5617/avatar.jpg +0 -0
  156. data/spec/internal/public/uploads/tmp/1516625891-88818-0004-6958/style.css +1 -0
  157. data/spec/internal/public/uploads/tmp/1516625891-88818-0006-4976/style.css +1 -0
  158. data/spec/internal/public/uploads/tmp/1516625891-88818-0007-0084/style.css +1 -0
  159. data/spec/internal/public/uploads/tmp/1516625891-88818-0008-2213/style.css +1 -0
  160. data/spec/internal/public/uploads/tmp/1516625891-88818-0009-4527/style.css +1 -0
  161. data/spec/internal/public/uploads/tmp/1516625891-88818-0012-6446/style.css +1 -0
  162. data/spec/internal/public/uploads/tmp/1516625961-88870-0002-7381/avatar.jpg +0 -0
  163. data/spec/internal/public/uploads/tmp/1516625961-88870-0004-9681/style.css +1 -0
  164. data/spec/internal/public/uploads/tmp/1516625961-88870-0006-2372/style.css +1 -0
  165. data/spec/internal/public/uploads/tmp/1516625961-88870-0007-2660/style.css +1 -0
  166. data/spec/internal/public/uploads/tmp/1516625961-88870-0008-0215/style.css +1 -0
  167. data/spec/internal/public/uploads/tmp/1516625961-88870-0009-2368/style.css +1 -0
  168. data/spec/internal/public/uploads/tmp/1516625961-88870-0012-1625/style.css +1 -0
  169. data/spec/internal/public/uploads/tmp/1516626030-88922-0002-3654/avatar.jpg +0 -0
  170. data/spec/internal/public/uploads/tmp/1516626030-88922-0004-3696/style.css +1 -0
  171. data/spec/internal/public/uploads/tmp/1516626030-88922-0006-8048/style.css +1 -0
  172. data/spec/internal/public/uploads/tmp/1516626030-88922-0007-3237/style.css +1 -0
  173. data/spec/internal/public/uploads/tmp/1516626030-88922-0008-4239/style.css +1 -0
  174. data/spec/internal/public/uploads/tmp/1516626030-88922-0009-0391/style.css +1 -0
  175. data/spec/internal/public/uploads/tmp/1516626030-88922-0012-0366/style.css +1 -0
  176. data/spec/internal/public/uploads/tmp/1516626064-88952-0002-1658/avatar.jpg +0 -0
  177. data/spec/internal/public/uploads/tmp/1516626064-88952-0004-5145/style.css +1 -0
  178. data/spec/internal/public/uploads/tmp/1516626064-88952-0006-0849/style.css +1 -0
  179. data/spec/internal/public/uploads/tmp/1516626064-88952-0007-0001/style.css +1 -0
  180. data/spec/internal/public/uploads/tmp/1516626064-88952-0008-9566/style.css +1 -0
  181. data/spec/internal/public/uploads/tmp/1516626064-88952-0009-8240/style.css +1 -0
  182. data/spec/internal/public/uploads/tmp/1516626064-88952-0012-5917/style.css +1 -0
  183. data/spec/internal/public/uploads/tmp/1516626195-89027-0002-5287/avatar.jpg +0 -0
  184. data/spec/internal/public/uploads/tmp/1516626195-89027-0004-2701/style.css +1 -0
  185. data/spec/internal/public/uploads/tmp/1516626195-89027-0006-2672/style.css +1 -0
  186. data/spec/internal/public/uploads/tmp/1516626195-89027-0007-3635/style.css +1 -0
  187. data/spec/internal/public/uploads/tmp/1516626195-89027-0008-4691/style.css +1 -0
  188. data/spec/internal/public/uploads/tmp/1516626195-89027-0009-8448/style.css +1 -0
  189. data/spec/internal/public/uploads/tmp/1516626195-89027-0012-8799/style.css +1 -0
  190. data/spec/internal/public/uploads/tmp/1516626242-89065-0002-1305/avatar.jpg +0 -0
  191. data/spec/internal/public/uploads/tmp/1516626242-89065-0004-0022/style.css +1 -0
  192. data/spec/internal/public/uploads/tmp/1516626242-89065-0006-1914/style.css +1 -0
  193. data/spec/internal/public/uploads/tmp/1516626242-89065-0007-8767/style.css +1 -0
  194. data/spec/internal/public/uploads/tmp/1516626242-89065-0008-3418/style.css +1 -0
  195. data/spec/internal/public/uploads/tmp/1516626242-89065-0009-6464/style.css +1 -0
  196. data/spec/internal/public/uploads/tmp/1516626242-89065-0012-5590/style.css +1 -0
  197. data/spec/internal/public/uploads/tmp/1516626311-89110-0002-9888/avatar.jpg +0 -0
  198. data/spec/internal/public/uploads/tmp/1516626311-89110-0004-7197/style.css +1 -0
  199. data/spec/internal/public/uploads/tmp/1516626311-89110-0006-4036/style.css +1 -0
  200. data/spec/internal/public/uploads/tmp/1516626311-89110-0007-6223/style.css +1 -0
  201. data/spec/internal/public/uploads/tmp/1516626311-89110-0008-7130/style.css +1 -0
  202. data/spec/internal/public/uploads/tmp/1516626311-89110-0009-7880/style.css +1 -0
  203. data/spec/internal/public/uploads/tmp/1516626311-89110-0012-0959/style.css +1 -0
  204. data/spec/internal/public/uploads/tmp/1516626373-89158-0002-5538/avatar.jpg +0 -0
  205. data/spec/internal/public/uploads/tmp/1516626373-89158-0004-7211/style.css +1 -0
  206. data/spec/internal/public/uploads/tmp/1516626373-89158-0006-9913/style.css +1 -0
  207. data/spec/internal/public/uploads/tmp/1516626373-89158-0007-2846/style.css +1 -0
  208. data/spec/internal/public/uploads/tmp/1516626373-89158-0008-5451/style.css +1 -0
  209. data/spec/internal/public/uploads/tmp/1516626373-89158-0009-9255/style.css +1 -0
  210. data/spec/internal/public/uploads/tmp/1516626373-89158-0012-9145/style.css +1 -0
  211. data/spec/internal/public/uploads/tmp/1516626397-89193-0002-0900/avatar.jpg +0 -0
  212. data/spec/internal/public/uploads/tmp/1516626397-89193-0004-9986/style.css +1 -0
  213. data/spec/internal/public/uploads/tmp/1516626397-89193-0006-0413/style.css +1 -0
  214. data/spec/internal/public/uploads/tmp/1516626397-89193-0007-5256/style.css +1 -0
  215. data/spec/internal/public/uploads/tmp/1516626397-89193-0008-0633/style.css +1 -0
  216. data/spec/internal/public/uploads/tmp/1516626397-89193-0009-1029/style.css +1 -0
  217. data/spec/internal/public/uploads/tmp/1516626397-89193-0012-8766/style.css +1 -0
  218. data/spec/internal/public/uploads/tmp/1516626545-89276-0002-2227/avatar.jpg +0 -0
  219. data/spec/internal/public/uploads/tmp/1516626545-89276-0004-7785/style.css +1 -0
  220. data/spec/internal/public/uploads/tmp/1516626545-89276-0006-9774/style.css +1 -0
  221. data/spec/internal/public/uploads/tmp/1516626545-89276-0007-7906/style.css +1 -0
  222. data/spec/internal/public/uploads/tmp/1516626545-89276-0008-0580/style.css +1 -0
  223. data/spec/internal/public/uploads/tmp/1516626545-89276-0009-3651/style.css +1 -0
  224. data/spec/internal/public/uploads/tmp/1516626545-89276-0012-0405/style.css +1 -0
  225. data/spec/internal/public/uploads/tmp/1516626743-89366-0002-5276/avatar.jpg +0 -0
  226. data/spec/internal/public/uploads/tmp/1516626743-89366-0004-1518/style.css +1 -0
  227. data/spec/internal/public/uploads/tmp/1516626743-89366-0006-9759/style.css +1 -0
  228. data/spec/internal/public/uploads/tmp/1516626743-89366-0007-6634/style.css +1 -0
  229. data/spec/internal/public/uploads/tmp/1516626743-89366-0008-6153/style.css +1 -0
  230. data/spec/internal/public/uploads/tmp/1516626743-89366-0009-4213/style.css +1 -0
  231. data/spec/internal/public/uploads/tmp/1516626743-89366-0012-7697/style.css +1 -0
  232. data/spec/internal/public/uploads/tmp/1516627266-89771-0002-3236/avatar.jpg +0 -0
  233. data/spec/internal/public/uploads/tmp/1516627266-89771-0004-8050/style.css +1 -0
  234. data/spec/internal/public/uploads/tmp/1516627266-89771-0006-7143/style.css +1 -0
  235. data/spec/internal/public/uploads/tmp/1516627266-89771-0007-9588/style.css +1 -0
  236. data/spec/internal/public/uploads/tmp/1516627266-89771-0008-5511/style.css +1 -0
  237. data/spec/internal/public/uploads/tmp/1516627266-89771-0009-0275/style.css +1 -0
  238. data/spec/internal/public/uploads/tmp/1516627266-89771-0012-3746/style.css +1 -0
  239. data/spec/internal/tmp/cache/assets/test/sprockets/v3.0/1XyAFYlYI0pK7WAgjR4PgXV6BgU6huJSviWmHetdCRs.cache +1 -0
  240. data/vendor/assets/bower_components/bootstrap/Gemfile.lock +43 -0
  241. data/vendor/assets/bower_components/ng-ckeditor/libs/ckeditor/ckeditor.js +1 -1
  242. data/vendor/assets/bower_components/ng-ckeditor/libs/ckeditor/lang/zh-cn.js +5 -0
  243. data/vendor/assets/javascripts/emmet-codemirror-plugin.js +4 -0
  244. data/vendor/assets/javascripts/emmet-codemirror-plugin.js.map +1 -0
  245. data/vendor/assets/javascripts/liquor.js +382 -0
  246. data/vendor/assets/stylesheets/liquor.css +79 -0
  247. metadata +478 -32
@@ -0,0 +1 @@
1
+ "%_�|�`e����@��<�ݴ8<�g�%����
@@ -0,0 +1,43 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.4.0)
5
+ colorator (0.1)
6
+ ffi (1.9.14-x64-mingw32)
7
+ jekyll (3.1.6)
8
+ colorator (~> 0.1)
9
+ jekyll-sass-converter (~> 1.0)
10
+ jekyll-watch (~> 1.1)
11
+ kramdown (~> 1.3)
12
+ liquid (~> 3.0)
13
+ mercenary (~> 0.3.3)
14
+ rouge (~> 1.7)
15
+ safe_yaml (~> 1.0)
16
+ jekyll-sass-converter (1.4.0)
17
+ sass (~> 3.4)
18
+ jekyll-sitemap (0.11.0)
19
+ addressable (~> 2.4.0)
20
+ jekyll-watch (1.4.0)
21
+ listen (~> 3.0, < 3.1)
22
+ kramdown (1.11.1)
23
+ liquid (3.0.6)
24
+ listen (3.0.8)
25
+ rb-fsevent (~> 0.9, >= 0.9.4)
26
+ rb-inotify (~> 0.9, >= 0.9.7)
27
+ mercenary (0.3.6)
28
+ rb-fsevent (0.9.7)
29
+ rb-inotify (0.9.7)
30
+ ffi (>= 0.5.0)
31
+ rouge (1.11.1)
32
+ safe_yaml (1.0.4)
33
+ sass (3.4.22)
34
+
35
+ PLATFORMS
36
+ x64-mingw32
37
+
38
+ DEPENDENCIES
39
+ jekyll (~> 3.1.2)
40
+ jekyll-sitemap (~> 0.11.0)
41
+
42
+ BUNDLED WITH
43
+ 1.12.5
@@ -984,4 +984,4 @@ null}};a.config.enterMode==CKEDITOR.ENTER_BR&&(this.allowedContent.div=!0)}funct
984
984
  e=d.getStyle("text-align");"left"==e?d.setStyle("text-align","right"):"right"==e&&d.setStyle("text-align","left")}}g.prototype={exec:function(a){var c=a.getSelection(),b=a.config.enterMode;if(c){for(var h=c.createBookmarks(),d=c.getRanges(),e=this.cssClassName,g,f,i=a.config.useComputedState,i=void 0===i||i,k=d.length-1;0<=k;k--){g=d[k].createIterator();for(g.enlargeBr=b!=CKEDITOR.ENTER_BR;f=g.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)if(!f.isReadOnly()){f.removeAttribute("align");f.removeStyle("text-align");
985
985
  var j=e&&(f.$.className=CKEDITOR.tools.ltrim(f.$.className.replace(this.cssClassRegex,""))),m=this.state==CKEDITOR.TRISTATE_OFF&&(!i||l(f,!0)!=this.value);e?m?f.addClass(e):j||f.removeAttribute("class"):m&&f.setStyle("text-align",this.value)}}a.focus();a.forceNextSelectionCheck();c.selectBookmarks(h)}},refresh:function(a,c){var b=c.block||c.blockLimit;this.setState("body"!=b.getName()&&l(b,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("justify",
986
986
  {init:function(a){if(!a.blockless){var c=new g(a,"justifyleft","left"),b=new g(a,"justifycenter","center"),h=new g(a,"justifyright","right"),d=new g(a,"justifyblock","justify");a.addCommand("justifyleft",c);a.addCommand("justifycenter",b);a.addCommand("justifyright",h);a.addCommand("justifyblock",d);a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.justify.left,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.justify.center,command:"justifycenter",
987
- toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.justify.right,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.justify.block,command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",j)}}})})();CKEDITOR.config.plugins='dialogui,dialog,a11yhelp,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,resize,button,toolbar,elementspath,enterkey,entities,popup,filebrowser,floatingspace,listblock,richcombo,format,horizontalrule,htmlwriter,wysiwygarea,image,indent,indentlist,fakeobjects,link,list,magicline,maximize,pastetext,pastefromword,removeformat,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,lineutils,widget,image2,stylesheetparser,showborders,templates,divarea,justify';CKEDITOR.config.skin='moono';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('bold,0,,italic,24,,strike,48,,subscript,72,,superscript,96,,underline,120,,blockquote,144,,copy-rtl,168,,copy,192,,cut-rtl,216,,cut,240,,paste-rtl,264,,paste,288,,horizontalrule,312,,image,336,,indent-rtl,360,,indent,384,,outdent-rtl,408,,outdent,432,,anchor-rtl,456,,anchor,480,,link,504,,unlink,528,,bulletedlist-rtl,552,,bulletedlist,576,,numberedlist-rtl,600,,numberedlist,624,,maximize,648,,pastetext-rtl,672,,pastetext,696,,pastefromword-rtl,720,,pastefromword,744,,removeformat,768,,source-rtl,792,,source,816,,specialchar,840,,scayt,864,,table,888,,redo-rtl,912,,redo,936,,undo-rtl,960,,undo,984,,spellchecker,1008,,image2,1032,,templates-rtl,1056,,templates,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,','icons_hidpi.png');else setIcons('bold,0,auto,italic,24,auto,strike,48,auto,subscript,72,auto,superscript,96,auto,underline,120,auto,blockquote,144,auto,copy-rtl,168,auto,copy,192,auto,cut-rtl,216,auto,cut,240,auto,paste-rtl,264,auto,paste,288,auto,horizontalrule,312,auto,image,336,auto,indent-rtl,360,auto,indent,384,auto,outdent-rtl,408,auto,outdent,432,auto,anchor-rtl,456,auto,anchor,480,auto,link,504,auto,unlink,528,auto,bulletedlist-rtl,552,auto,bulletedlist,576,auto,numberedlist-rtl,600,auto,numberedlist,624,auto,maximize,648,auto,pastetext-rtl,672,auto,pastetext,696,auto,pastefromword-rtl,720,auto,pastefromword,744,auto,removeformat,768,auto,source-rtl,792,auto,source,816,auto,specialchar,840,auto,scayt,864,auto,table,888,auto,redo-rtl,912,auto,redo,936,auto,undo-rtl,960,auto,undo,984,auto,spellchecker,1008,auto,image2,1032,auto,templates-rtl,1056,auto,templates,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto','icons.png');})();CKEDITOR.lang.languages={"en":1,"ru":1};}());
987
+ toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.justify.right,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.justify.block,command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",j)}}})})();CKEDITOR.config.plugins='dialogui,dialog,a11yhelp,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,resize,button,toolbar,elementspath,enterkey,entities,popup,filebrowser,floatingspace,listblock,richcombo,format,horizontalrule,htmlwriter,wysiwygarea,image,indent,indentlist,fakeobjects,link,list,magicline,maximize,pastetext,pastefromword,removeformat,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,lineutils,widget,image2,stylesheetparser,showborders,templates,divarea,justify';CKEDITOR.config.skin='moono';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('bold,0,,italic,24,,strike,48,,subscript,72,,superscript,96,,underline,120,,blockquote,144,,copy-rtl,168,,copy,192,,cut-rtl,216,,cut,240,,paste-rtl,264,,paste,288,,horizontalrule,312,,image,336,,indent-rtl,360,,indent,384,,outdent-rtl,408,,outdent,432,,anchor-rtl,456,,anchor,480,,link,504,,unlink,528,,bulletedlist-rtl,552,,bulletedlist,576,,numberedlist-rtl,600,,numberedlist,624,,maximize,648,,pastetext-rtl,672,,pastetext,696,,pastefromword-rtl,720,,pastefromword,744,,removeformat,768,,source-rtl,792,,source,816,,specialchar,840,,scayt,864,,table,888,,redo-rtl,912,,redo,936,,undo-rtl,960,,undo,984,,spellchecker,1008,,image2,1032,,templates-rtl,1056,,templates,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,','icons_hidpi.png');else setIcons('bold,0,auto,italic,24,auto,strike,48,auto,subscript,72,auto,superscript,96,auto,underline,120,auto,blockquote,144,auto,copy-rtl,168,auto,copy,192,auto,cut-rtl,216,auto,cut,240,auto,paste-rtl,264,auto,paste,288,auto,horizontalrule,312,auto,image,336,auto,indent-rtl,360,auto,indent,384,auto,outdent-rtl,408,auto,outdent,432,auto,anchor-rtl,456,auto,anchor,480,auto,link,504,auto,unlink,528,auto,bulletedlist-rtl,552,auto,bulletedlist,576,auto,numberedlist-rtl,600,auto,numberedlist,624,auto,maximize,648,auto,pastetext-rtl,672,auto,pastetext,696,auto,pastefromword-rtl,720,auto,pastefromword,744,auto,removeformat,768,auto,source-rtl,792,auto,source,816,auto,specialchar,840,auto,scayt,864,auto,table,888,auto,redo-rtl,912,auto,redo,936,auto,undo-rtl,960,auto,undo,984,auto,spellchecker,1008,auto,image2,1032,auto,templates-rtl,1056,auto,templates,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto','icons.png');})();CKEDITOR.lang.languages={"en":1,"ru":1,"zh-cn":1};}());
@@ -0,0 +1,5 @@
1
+ /*
2
+ Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+ CKEDITOR.lang['zh-cn']={"editor":"所见即所得编辑器","editorPanel":"所见即所得编辑器面板","common":{"editorHelp":"按 ALT+0 获得帮助","browseServer":"浏览服务器","url":"URL","protocol":"协议","upload":"上传","uploadSubmit":"上传到服务器","image":"图像","flash":"Flash","form":"表单","checkbox":"复选框","radio":"单选按钮","textField":"单行文本","textarea":"多行文本","hiddenField":"隐藏域","button":"按钮","select":"列表/菜单","imageButton":"图像按钮","notSet":"<没有设置>","id":"ID","name":"名称","langDir":"语言方向","langDirLtr":"从左到右 (LTR)","langDirRtl":"从右到左 (RTL)","langCode":"语言代码","longDescr":"详细说明 URL","cssClass":"样式类名称","advisoryTitle":"标题","cssStyle":"行内样式","ok":"确定","cancel":"取消","close":"关闭","preview":"预览","resize":"拖拽以改变大小","generalTab":"常规","advancedTab":"高级","validateNumberFailed":"需要输入数字格式","confirmNewPage":"当前文档内容未保存,是否确认新建文档?","confirmCancel":"部分修改尚未保存,是否确认关闭对话框?","options":"选项","target":"目标窗口","targetNew":"新窗口 (_blank)","targetTop":"整页 (_top)","targetSelf":"本窗口 (_self)","targetParent":"父窗口 (_parent)","langDirLTR":"从左到右 (LTR)","langDirRTL":"从右到左 (RTL)","styles":"样式","cssClasses":"样式类","width":"宽度","height":"高度","align":"对齐方式","alignLeft":"左对齐","alignRight":"右对齐","alignCenter":"居中","alignJustify":"两端对齐","alignTop":"顶端","alignMiddle":"居中","alignBottom":"底部","alignNone":"无","invalidValue":"无效的值。","invalidHeight":"高度必须为数字格式","invalidWidth":"宽度必须为数字格式","invalidCssLength":"此“%1”字段的值必须为正数,可以包含或不包含一个有效的 CSS 长度单位(px, %, in, cm, mm, em, ex, pt 或 pc)","invalidHtmlLength":"此“%1”字段的值必须为正数,可以包含或不包含一个有效的 HTML 长度单位(px 或 %)","invalidInlineStyle":"内联样式必须为格式是以分号分隔的一个或多个“属性名 : 属性值”。","cssLengthTooltip":"输入一个表示像素值的数字,或加上一个有效的 CSS 长度单位(px, %, in, cm, mm, em, ex, pt 或 pc)。","unavailable":"%1<span class=\"cke_accessibility\">,不可用</span>","keyboard":{"8":"退格键","13":"回车键","16":"Shift","17":"Ctrl","18":"Alt","32":"空格键","35":"行尾键","36":"行首键","46":"删除键","224":"Command"},"keyboardShortcut":"快捷键","optionDefault":"Default"},"basicstyles":{"bold":"加粗","italic":"倾斜","strike":"删除线","subscript":"下标","superscript":"上标","underline":"下划线"},"blockquote":{"toolbar":"块引用"},"notification":{"closed":"通知已关闭"},"button":{"selectedLabel":"已选中 %1 项"},"toolbar":{"toolbarCollapse":"折叠工具栏","toolbarExpand":"展开工具栏","toolbarGroups":{"document":"文档","clipboard":"剪贴板/撤销","editing":"编辑","forms":"表单","basicstyles":"基本格式","paragraph":"段落","links":"链接","insert":"插入","styles":"样式","colors":"颜色","tools":"工具"},"toolbars":"工具栏"},"clipboard":{"copy":"复制","copyError":"您的浏览器安全设置不允许编辑器自动执行复制操作,请使用键盘快捷键(Ctrl/Cmd+C)来完成。","cut":"剪切","cutError":"您的浏览器安全设置不允许编辑器自动执行剪切操作,请使用键盘快捷键(Ctrl/Cmd+X)来完成。","paste":"粘贴","pasteNotification":"您的浏览器不允许用此方式粘贴,要粘贴请按 %1。"},"contextmenu":{"options":"快捷菜单选项"},"elementspath":{"eleLabel":"元素路径","eleTitle":"%1 元素"},"format":{"label":"格式","panelTitle":"格式","tag_address":"地址","tag_div":"段落(DIV)","tag_h1":"标题 1","tag_h2":"标题 2","tag_h3":"标题 3","tag_h4":"标题 4","tag_h5":"标题 5","tag_h6":"标题 6","tag_p":"普通","tag_pre":"已编排格式"},"horizontalrule":{"toolbar":"插入水平线"},"image":{"alt":"替换文本","border":"边框大小","btnUpload":"上传到服务器","button2Img":"确定要把当前图像按钮转换为普通图像吗?","hSpace":"水平间距","img2Button":"确定要把当前图像改变为图像按钮吗?","infoTab":"图像信息","linkTab":"链接","lockRatio":"锁定比例","menu":"图像属性","resetSize":"原始尺寸","title":"图像属性","titleButton":"图像域属性","upload":"上传","urlMissing":"缺少图像源文件地址","vSpace":"垂直间距","validateBorder":"边框大小必须为整数格式","validateHSpace":"水平间距必须为整数格式","validateVSpace":"垂直间距必须为整数格式"},"indent":{"indent":"增加缩进量","outdent":"减少缩进量"},"fakeobjects":{"anchor":"锚点","flash":"Flash 动画","hiddenfield":"隐藏域","iframe":"IFrame","unknown":"未知对象"},"link":{"acccessKey":"访问键","advanced":"高级","advisoryContentType":"内容类型","advisoryTitle":"标题","anchor":{"toolbar":"插入/编辑锚点链接","menu":"锚点链接属性","title":"锚点链接属性","name":"锚点名称","errorName":"请输入锚点名称","remove":"删除锚点"},"anchorId":"按锚点 ID","anchorName":"按锚点名称","charset":"字符编码","cssClasses":"样式类名称","download":"强制下载","displayText":"显示文本","emailAddress":"地址","emailBody":"内容","emailSubject":"主题","id":"ID","info":"超链接信息","langCode":"语言代码","langDir":"语言方向","langDirLTR":"从左到右 (LTR)","langDirRTL":"从右到左 (RTL)","menu":"编辑超链接","name":"名称","noAnchors":"(此文档没有可用的锚点)","noEmail":"请输入电子邮件地址","noUrl":"请输入超链接地址","other":"<其他>","popupDependent":"依附 (NS)","popupFeatures":"弹出窗口属性","popupFullScreen":"全屏 (IE)","popupLeft":"左","popupLocationBar":"地址栏","popupMenuBar":"菜单栏","popupResizable":"可缩放","popupScrollBars":"滚动条","popupStatusBar":"状态栏","popupToolbar":"工具栏","popupTop":"右","rel":"关联","selectAnchor":"选择一个锚点","styles":"行内样式","tabIndex":"Tab 键次序","target":"目标","targetFrame":"<框架>","targetFrameName":"目标框架名称","targetPopup":"<弹出窗口>","targetPopupName":"弹出窗口名称","title":"超链接","toAnchor":"页内锚点链接","toEmail":"电子邮件","toUrl":"地址","toolbar":"插入/编辑超链接","type":"超链接类型","unlink":"取消超链接","upload":"上传"},"list":{"bulletedlist":"项目列表","numberedlist":"编号列表"},"magicline":{"title":"在这插入段落"},"maximize":{"maximize":"全屏","minimize":"最小化"},"pastetext":{"button":"粘贴为无格式文本","pasteNotification":"您的浏览器不允许用此方式粘贴成纯文本,要粘贴请按 %1。"},"pastefromword":{"confirmCleanup":"您要粘贴的内容好像是来自 MS Word,是否要清除 MS Word 格式后再粘贴?","error":"由于内部错误无法清理要粘贴的数据","title":"从 MS Word 粘贴","toolbar":"从 MS Word 粘贴"},"removeformat":{"toolbar":"清除格式"},"sourcearea":{"toolbar":"源码"},"specialchar":{"options":"特殊符号选项","title":"选择特殊符号","toolbar":"插入特殊符号"},"scayt":{"btn_about":"关于即时拼写检查","btn_dictionaries":"字典","btn_disable":"禁用即时拼写检查","btn_enable":"启用即时拼写检查","btn_langs":"语言","btn_options":"选项","text_title":"即时拼写检查"},"stylescombo":{"label":"样式","panelTitle":"样式","panelTitle1":"块级元素样式","panelTitle2":"内联元素样式","panelTitle3":"对象元素样式"},"table":{"border":"边框","caption":"标题","cell":{"menu":"单元格","insertBefore":"在左侧插入单元格","insertAfter":"在右侧插入单元格","deleteCell":"删除单元格","merge":"合并单元格","mergeRight":"向右合并单元格","mergeDown":"向下合并单元格","splitHorizontal":"水平拆分单元格","splitVertical":"垂直拆分单元格","title":"单元格属性","cellType":"单元格类型","rowSpan":"纵跨行数","colSpan":"横跨列数","wordWrap":"自动换行","hAlign":"水平对齐","vAlign":"垂直对齐","alignBaseline":"基线","bgColor":"背景颜色","borderColor":"边框颜色","data":"数据","header":"表头","yes":"是","no":"否","invalidWidth":"单元格宽度必须为数字格式","invalidHeight":"单元格高度必须为数字格式","invalidRowSpan":"行跨度必须为整数格式","invalidColSpan":"列跨度必须为整数格式","chooseColor":"选择"},"cellPad":"边距","cellSpace":"间距","column":{"menu":"列","insertBefore":"在左侧插入列","insertAfter":"在右侧插入列","deleteColumn":"删除列"},"columns":"列数","deleteTable":"删除表格","headers":"标题单元格","headersBoth":"第一列和第一行","headersColumn":"第一列","headersNone":"无","headersRow":"第一行","invalidBorder":"边框粗细必须为数字格式","invalidCellPadding":"单元格填充必须为数字格式","invalidCellSpacing":"单元格间距必须为数字格式","invalidCols":"指定的行数必须大于零","invalidHeight":"表格高度必须为数字格式","invalidRows":"指定的列数必须大于零","invalidWidth":"表格宽度必须为数字格式","menu":"表格属性","row":{"menu":"行","insertBefore":"在上方插入行","insertAfter":"在下方插入行","deleteRow":"删除行"},"rows":"行数","summary":"摘要","title":"表格属性","toolbar":"表格","widthPc":"百分比","widthPx":"像素","widthUnit":"宽度单位"},"undo":{"redo":"重做","undo":"撤消"},"wsc":{"btnIgnore":"忽略","btnIgnoreAll":"全部忽略","btnReplace":"替换","btnReplaceAll":"全部替换","btnUndo":"撤消","changeTo":"更改为","errorLoading":"加载应该服务主机时出错: %s.","ieSpellDownload":"拼写检查插件还没安装, 您是否想现在就下载?","manyChanges":"拼写检查完成: 更改了 %1 个单词","noChanges":"拼写检查完成: 没有更改任何单词","noMispell":"拼写检查完成: 没有发现拼写错误","noSuggestions":"- 没有建议 -","notAvailable":"抱歉, 服务目前暂不可用","notInDic":"没有在字典里","oneChange":"拼写检查完成: 更改了一个单词","progress":"正在进行拼写检查...","title":"拼写检查","toolbar":"拼写检查"},"widget":{"move":"点击并拖拽以移动","label":"%1 小部件"},"image2":{"alt":"替换文本","btnUpload":"上传到服务器","captioned":"带标题图像","captionPlaceholder":"标题","infoTab":"图像信息","lockRatio":"锁定比例","menu":"图像属性","pathName":"图像","pathNameCaption":"标题","resetSize":"原始尺寸","resizer":"点击并拖拽以改变尺寸","title":"图像属性","uploadTab":"上传","urlMissing":"缺少图像源文件地址","altMissing":"缺少替换文本"},"templates":{"button":"模板","emptyListMsg":"(没有模板)","insertOption":"替换当前内容","options":"模板选项","selectPromptMsg":"请选择要在编辑器中使用的模板:","title":"内容模板"},"justify":{"block":"两端对齐","center":"居中","left":"左对齐","right":"右对齐"}};
@@ -0,0 +1,4 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";function t(t){return t===Er||t===qr}function e(e){var n=e.pos,r=e.prev();if(t(r))for(;!e.sol();)if(e.prev()===r&&e.peek()!==zr)return!0;return e.pos=n,!1}function n(t){return r(t)||i(t)}function r(t){var n=t.pos;return!!(e(t)&&t.eat(Lr)&&o(t))||(t.pos=n,!1)}function i(t){var e=t.pos;return!!(t.eatWhile(c)&&t.eat(Lr)&&o(t))||(t.pos=e,!1)}function o(t){return t.eatWhile(a)}function a(t){return t===Rr||s(t)||u(t)}function s(t){return(t&=-33)>=65&&t<=90}function u(t){return t>47&&t<58}function l(t){return t===Mr||t===Tr}function c(e){return e&&e!==Lr&&!l(e)&&!t(e)}function f(t,e,n){e=Math.min(t.length,Math.max(0,null==e?t.length:e)),null!=n&&!0!==n||(e=p(t,e));var r,i=new Sr(t);i.pos=e;for(var o=[];!i.sol();){if(r=i.peek(),g(r))o.push(r);else if(m(r)){if(o.pop()!==Gr.get(r))break}else{if(h(o,Pr)||h(o,Dr)){i.pos--;continue}if(Nr(i)||!d(r))break}i.pos--}if(!o.length&&i.pos!==e){var a=t.slice(i.pos,e).replace(/^[\*\+\>\^]+/,"");return{abbreviation:a,location:e-a.length}}}function p(e,n){for(t(e.charCodeAt(n))&&n++;g(e.charCodeAt(n));)n++;return n}function h(t,e){return-1!==t.indexOf(e)}function d(t){return t>64&&t<91||t>96&&t<123||t>47&&t<58||Yr.has(t)}function m(t){return t===Wr||t===Ur||t===Br}function g(t){return t===Pr||t===Ir||t===Dr}function b(t,e){return e&&(t="upper"===e?t.toUpperCase():t.toLowerCase()),t}function v(t,e){return t instanceof Kr?t:"string"==typeof t?new Kr(t,e):t&&"object"==typeof t?new Kr(t.name,t.value,t.options):void 0}function y(t){return String(t).trim()}function x(t,e,n){return t&&n.indexOf(t)===e}function w(t){return t===ri||t===ii}function k(t){return t>47&&t<58}function $(t,e,n){return e=e||65,n=n||90,(t&=-33)>=e&&t<=n}function C(t){return k(t)||$(t)}function A(t){return 32===t||9===t||160===t}function O(t){return A(t)||10===t||13===t}function j(t,e,n,r){r=r?Object.assign({},si,r):si;var i=t.pos;if(t.eat(e)){for(var o,a=1;!t.eof();)if(!ai(t,r))if((o=t.next())===e)a++;else if(o===n){if(!--a)return t.start=i,!0}else o===r.escape&&t.next();if(t.pos=i,r.throws)throw t.error("Unable to find matching pair for "+String.fromCharCode(e))}return!1}function _(t){var e={};t.charCodeAt(0)===hi&&(t=t.slice(1),e.implied=!0),t.charCodeAt(t.length-1)===di&&(t=t.slice(0,t.length-1),e.boolean=!0);var n={name:t};return Object.keys(e).length&&(n.options=e),n}function S(t){var e=t.pos;if(t.eatWhile(E))return t.start=e,!0}function E(t){return!O(t)&&!w(t)&&t!==gi&&t!==bi&&t!==mi}function q(t){return t.start=t.pos,t.eatWhile(z),t.current()}function z(t){return C(t)||45===t||58===t||36===t||64===t||33===t||95===t||37===t}function T(t){for(var e,n=new ni(t.trim()),r=new ti,i=r,o=[];!n.eof();)if((e=n.peek())!==wi)if(e!==ki){var a=xi(n);if(i.appendChild(a),n.eof())break;switch(n.peek()){case $i:n.next();continue;case Ci:n.next(),i=a;continue;case Ai:for(;n.eat(Ai);)i=i.parent||i;continue}}else{var s=o.pop();if(!s)throw n.error('Unexpected ")" group end');var u=s[0];if(i=s[1],n.next(),u.repeat=ui(n))i.appendChild(u);else{for(;u.firstChild;)i.appendChild(u.firstChild);n.eat($i)}}else{var l=new ti,c=o.length?M(o)[0]:i;o.push([l,c,n.pos]),i=l,n.next()}if(o.length)throw n.pos=o.pop()[2],n.error("Expected group close");return r}function M(t){return t[t.length-1]}function R(t){if(t.repeat&&t.repeat.count){for(var e=1;e<t.repeat.count;e++){var n=t.clone(!0);n.repeat.value=e,n.walk(R),t.parent.insertBefore(n,t)}t.repeat.value=t.repeat.count}}function L(t,e){var n=new Set,r=function(t){var i=e.resolve(t.name);if(i&&!n.has(i)){if("function"==typeof i.value)return i.value(t,e,r);var o=Oi(i.value);n.add(i),o.walk(r),n.delete(i);var a=P(o);for(N(a,t);o.firstChild;)t.parent.insertBefore(o.firstChild,t);a.parent.insertBefore(t,a),a.remove()}};r(t)}function N(t,e){return e.name=t.name,t.selfClosing&&(e.selfClosing=!0),null!=t.value&&(e.value=t.value),t.repeat&&(e.repeat=Object.assign({},t.repeat)),F(t,e)}function F(t,e){W(t,e);for(var n=new Map,r=t.attributes,i=0;i<r.length;i++)n.set(r[i].name,r[i].clone());r=e.attributes.slice();for(var o=0,a=void 0,s=void 0;o<r.length;o++)a=r[o],n.has(a.name)?(s=n.get(a.name),s.value=a.value,s.options.implied&&(s.options.implied=!1)):n.set(a.name,a),e.removeAttribute(a);for(var u=Array.from(n.values()),l=0;l<u.length;l++)e.setAttribute(u[l]);return e}function W(t,e){for(var n=t.classList,r=0;r<n.length;r++)e.addClass(n[r]);return e}function P(t){for(;t.children.length;)t=t.children[t.children.length-1];return t}function U(t){return t=(t||"").toLowerCase(),Si[t]||(_i.has(t)?"span":"div")}function I(t,e){for(var n=new Set,r=e.length,i=0;-1!==(i=t.indexOf(e,i));)n.add(i),i+=r;if(n.size)for(var o=0,a=t.length;o<a;)"\\"===t[o++]&&n.delete(o++);return Array.from(n).map(function(t){return D(t,r)})}function B(t,e,n){for(var r=e.length-1;r>=0;r--){var i=e[r];t=t.substring(0,i[0])+("function"==typeof n?n(t.substr(i[0],i[1])):n)+t.substring(i[0]+i[1])}return t}function D(t,e){return[t,e]}function Y(t){var e=G(t);if(e&&null!=e.value){var n=e.value;t.name=V(t.name,n),t.value=V(t.value,n),t.attributes.forEach(function(e){var r=t.getAttribute(e.name).clone();r.name=V(e.name,n),r.value=V(e.value,n),t.replaceAttribute(e.name,r)})}return t}function G(t){for(;t;){if(t.repeat)return t.repeat;t=t.parent}}function V(t,e){if("string"==typeof t){return H(t,X(t),e)}return t}function X(t){return I(t||"",qi).reduce(function(e,n){if(!/[#{]/.test(t[n[0]+1]||"")){var r=e[e.length-1];r&&r[0]+r[1]===n[0]?r[1]+=n[1]:e.push(n)}return e},[])}function H(t,e,n){return Z(B(t,e,function(t){for(var e=String(n);e.length<t.length;)e="0"+e;return e}))}function Z(t){for(var e=0,n="",r=t.length;e<r;){var i=t[e++];n+="\\"===i?t[e++]||"":i}return n}function Q(t,e){return e=e||1,t.walk(function(t){if(t.repeat&&null===t.repeat.count){for(var n=0;n<e;n++){var r=t.clone(!0);r.repeat.implicit=!0,r.repeat.count=e,r.repeat.value=n+1,r.repeat.index=n,t.parent.insertBefore(r,t)}t.remove()}}),t}function J(t,e){if(Array.isArray(e)&&e.length){var n=!1;t.walk(function(t){t.repeat&&t.repeat.implicit&&(n=!0,K(t,e[t.repeat.index]))}),n||rt(nt(t),e.join("\n"))}return t}function K(t,e){var n=tt(t,e);return t.walk(function(t){return n|=tt(t,e)}),n||rt(nt(t),e),t}function tt(t,e){var n={replaced:!1};return t.value=et(t.value,e,n),t.attributes.forEach(function(r){r.value&&t.setAttribute(r.name,et(r.value,e,n))}),n.replaced}function et(t,e,n){if("string"==typeof t){var r=I(t,Ti);r.length&&(n&&(n.replaced=!0),t=B(t,r,e))}return t}function nt(t){for(;t.children.length;)t=t.children[t.children.length-1];return t}function rt(t,e){if(t.value){var n=I(t.value,Mi);if(n.length)return void(t.value=B(t.value,n,e))}(t.name.toLowerCase("a")||t.hasAttribute("href"))&&(Ri.test(e)?t.setAttribute("href",(Ni.test(e)?"":"http://")+e):Li.test(e)&&t.setAttribute("href","mailto:"+e)),t.value=e}function it(t,e){var n=t.classList.reduce(function(t,n){var r=n.indexOf(e.modifier);return-1!==r&&t.add(n.slice(0,r)),t.add(n)},new Set);n.size&&t.setAttribute("class",Array.from(n).join(" "))}function ot(t,e,n){var r=t.classList.reduce(function(r,i){var o,a,s=i;for((a=i.match(Wi))&&(o=st(t,e,a[1])+n.element+a[2],r.add(o),i=i.slice(a[0].length));a=i.match(Pi);)o||(o=st(t,e,a[1]),r.add(o)),r.add(""+o+n.modifier+a[2]),i=i.slice(a[0].length);return i===s&&r.add(s),r},new Set);t.setAttribute("class",Array.from(r).join(" "))}function at(t){var e=new Map;return t.walk(function(t){var n=t.classList;n.length&&e.set(t,ut(n,Ui)||ut(n,Ii)||e.get(t.parent))}),e}function st(t,e,n){for(var r=n.length>1?n.length:0;t.parent&&r--;)t=t.parent;return e.get(t)}function ut(t,e){return t.filter(e)[0]}function lt(t,e,n){var r=t.getAttribute(e);r&&(r.name=n)}function ct(t,e){return e=e||{},t.walk(function(t){return ft(t,e)}),t}function ft(t,e){for(var n=t.attributes,r=0,i=n.length;r<i;r++){var o=n[r];"string"==typeof o.value&&t.setAttribute(o.name,pt(o.value,e))}return null!=t.value&&(t.value=pt(t.value,e)),t}function pt(t,e){for(var n=ht(t),r=0,i="",o=0,a=n.variables.length;o<a;o++){var s=n.variables[o],u=s.name in e?e[s.name]:s.name;"function"==typeof u&&(u=u(n.string,s,r+s.location)),i+=n.string.slice(r,s.location)+u,r=s.location+s.length}return i+n.string.slice(r)}function ht(t){for(var e,n=/\$\{([a-z][\w\-]*)\}/gi,r=[],i=new Map;e=n.exec(t);)i.set(e.index,e);if(i.size){for(var o=0,a=0,s=t.length,u="";a<s;)if(92===t.charCodeAt(a)&&i.has(a+1)){var l=i.get(a+1);u+=t.slice(o,a)+l[0],o=a=l.index+l[0].length,i.delete(a+1)}else a++;t=u+t.slice(o);for(var c=Array.from(i.values()),f=0,p=c.length;f<p;f++){var h=c[f];r.push({name:h[1],location:h.index,length:h[0].length})}}return{string:t,variables:r}}function dt(t){for(var e,n,r=new ni(t),i=[],o="",a=0,s=0;!r.eof();)e=r.peek(),s=r.pos,e===Ji?(r.next(),r.next()):(n=bt(r,o.length+s-a))?(i.push(n),o+=r.string.slice(a,s)+n.placeholder,a=r.pos):r.next();return new no(o+r.string.slice(a),i)}function mt(t,e,n){n=n||gt;var r=e.map(function(t,e){return{order:e,field:t,end:t.location+t.length}}).sort(function(t,e){return t.end-e.end||t.order-e.order}),i=0;return r.map(function(e){var r=t.substr(e.field.location,e.field.length),o=t.slice(i,e.field.location);return i=e.end,o+n(e.field.index,r)}).join("")+t.slice(i)}function gt(t,e){return e?"${"+t+":"+e+"}":"${"+t+"}"}function bt(t,e){var n=t.pos;if(t.eat(Zi)){var r=yt(t),i="";if(null!=r)return new eo(r,i,e);if(t.eat(Ki)&&null!=(r=yt(t))&&(t.eat(Qi)&&(i=vt(t)),t.eat(to)))return new eo(r,i,e)}t.pos=n}function vt(t){var e,n=[];for(t.start=t.pos;!t.eof();){if((e=t.peek())===Ki)n.push(t.pos);else if(e===to){if(!n.length)break;n.pop()}t.next()}if(n.length)throw t.error('Unable to find matching "}" for curly brace at '+n.pop());return t.current()}function yt(t){if(t.start=t.pos,t.eatWhile(k))return Number(t.current())}function xt(t){return(t||"").split(/\r\n|\r|\n/g)}function wt(t,e,n){void 0===n&&(n=e,e=null),e=e||oo;var r={index:1},i=function(t){return null==t?e(r.index++):Ct(t,r).mark(e)};return kt(t.children,n,i)}function kt(t,e,n){return t.filter($t).map(function(t){var r=e(new io(t,n));return r?r.toString(kt(t.children,e,n)):""}).join("")}function $t(t){return!t.isGroup}function Ct(t,e){var n="object"==typeof t?t:dt(t),r=-1;return n.fields.forEach(function(t){t.index+=e.index,t.index>r&&(r=t.index)}),-1!==r&&(e.index=r+1),n}function At(t,e){if(null==t)return t;for(var n,r,i=[],o=function(t,n,r,i){return null!=e[r]?n+e[r]+i:""},a="",s=0,u=0;u<t.length;)n=t.charCodeAt(u),n===so?i.push(u):n===uo&&(r=i.pop(),i.length||(a+=t.slice(s,r)+t.slice(r+1,u).replace(ao,o),s=u+1)),u++;return a+t.slice(s)}function Ot(t){return(t||"").split(/\r\n|\r|\n/g)}function jt(t){return t.parent.firstChild===t}function _t(t){return t&&!t.parent}function St(t){return t.isTextOnly&&!!t.children.length}function Et(t){var e=t.node;if(St(e)){var n=dt(e.value),r=qt(n);if(r){var i=zt(n,r);t.open=t.renderFields(i[0]),t.close=t.renderFields(i[1])}else t.text=t.renderFields(n);return!0}return!1}function qt(t){return t.fields.reduce(function(t,e){return!t||e.index<t.index?e:t},null)}function zt(t,e){var n=t.fields.indexOf(e);return[new t.constructor(t.string.slice(0,e.location),t.fields.slice(0,n)),new t.constructor(t.string.slice(e.location+e.length),t.fields.slice(n+1))]}function Tt(t,e,n){return n=Object.assign({},n),n.comment=Object.assign({},lo,n.comment),wt(t,n.field,function(t){if(t=Mt(t,e),!Et(t)){var r=t.node;if(r.name){var i=e.name(r.name),o=Ft(t,e);t.open="<"+i+o+(r.selfClosing?e.selfClose():"")+">",r.selfClosing||(t.close="</"+i+">"),It(t,n.comment)}(r.value||!r.children.length&&!r.selfClosing)&&(t.text=t.renderFields(r.value))}return t})}function Mt(t,e){var n=t.node;if(Rt(n,e)){t.indent=e.indent(Ut(n,e)),t.newline="\n";var r=t.newline+t.indent;_t(n.parent)&&jt(n)||(t.beforeOpen=r,n.isTextOnly&&(t.beforeText=r)),Nt(n,e)&&(n.isTextOnly||(t.beforeText=r+e.indent(1)),t.beforeClose=r)}return t}function Rt(t,e){return!!e.get("format")&&((!t.parent.isTextOnly||1!==t.parent.children.length||!dt(t.parent.value).fields.length)&&(!Wt(t,e)||Lt(t,e)))}function Lt(t,e){if(!Wt(t,e))return!1;if(St(t))return!0;if(0===t.childIndex){for(var n=t;n=n.nextSibling;)if(!Wt(n,e))return!0}else if(!Wt(t.previousSibling,e))return!0;if(e.get("inlineBreak")){for(var r=1,i=t,o=t;Pt(i=i.previousSibling,e);)r++;for(;Pt(o=o.nextSibling,e);)r++;if(r>=e.get("inlineBreak"))return!0}for(var a=0,s=t.children.length;a<s;a++)if(Rt(t.children[a],e))return!0;return!1}function Nt(t,e){var n=(t.name||"").toLowerCase();if(-1!==e.get("formatForce").indexOf(n))return!0;for(var r=0;r<t.children.length;r++)if(Rt(t.children[r],e))return!0;return!1}function Ft(t,e){return t.node.attributes.map(function(n){if(n.options.implied&&null==n.value)return null;var r=e.attribute(n.name),i=null;if(n.options.boolean||-1!==e.get("booleanAttributes").indexOf(r.toLowerCase())){if(e.get("compactBooleanAttributes")&&null==n.value)return" "+r;null==n.value&&(i=r)}return null==i&&(i=t.renderFields(n.value))," "+r+"="+e.quote(i)}).join("")}function Wt(t,e){return t&&t.isTextOnly||Pt(t,e)}function Pt(t,e){return t&&e.isInline(t)}function Ut(t,e){for(var n=e.get("formatSkip")||[],r=t.parent.isTextOnly?-2:-1,i=t;i=i.parent;)-1===n.indexOf((i.name||"").toLowerCase())&&r++;return r<0?0:r}function It(t,e){var n=t.node;if(e.enabled&&e.trigger&&n.name)for(var r=t.node.attributes.reduce(function(t,e){return e.name&&null!=e.value&&(t[e.name.toUpperCase().replace(/-/g,"_")]=e.value),t},{}),i=0,o=e.trigger.length;i<o;i++)if(e.trigger[i].toUpperCase()in r){t.open=At(e.before,r)+t.open,t.close&&(t.close+=At(e.after,r));break}}function Bt(t,e,n){n=Object.assign({},ho,n);var r=t.node;if(t.indent=e.indent(Yt(r,e)),t.newline="\n",_t(r.parent)&&jt(r)||(t.beforeOpen=t.newline+t.indent),r.name){var i=Object.assign({NAME:e.name(r.name),SELF_CLOSE:r.selfClosing?n.selfClose:null},Dt(t,e,n.attributes));n.omitName&&n.omitName.test(i.NAME)&&i.PRIMARY_ATTRS&&(i.NAME=null),null!=n.open&&(t.open=At(n.open,i)),null!=n.close&&(t.close=At(n.close,i))}return t}function Dt(t,e,n){n=Object.assign({},po,n);var r=[],i=[];return t.node.attributes.forEach(function(n){if(n.options.implied&&null==n.value)return null;var o=e.attribute(n.name),a=t.renderFields(n.value);if(co.test(o))a&&r.push("#"+a);else if(fo.test(o))a&&r.push("."+a.replace(/\s+/g,"."));else{var s=null==n.value&&(n.options.boolean||-1!==e.get("booleanAttributes").indexOf(o.toLowerCase()));i.push({name:o,value:a,isBoolean:s})}}),{PRIMARY_ATTRS:n.primary(r)||null,SECONDARY_ATTRS:n.secondary(i)||null}}function Yt(t,e){for(var n=t.parent.isTextOnly?-2:-1,r=t;r=r.parent;)n++;return n<0?0:n}function Gt(t,e,n){n=n||{};var r={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(t){return t.map(function(t){return t.isBoolean?t.name+(e.get("compactBooleanAttributes")?"":"=true"):t.name+"="+e.quote(t.value)}).join(" ")}}};return wt(t,n.field,function(t){if(t=Bt(t,e,r),t=Vt(t,e),!Et(t)){var n=t.node;(n.value||!n.children.length&&!n.selfClosing)&&(t.text=t.renderFields(Xt(n,e)))}return t})}function Vt(t,e){var n=t.node;return!n.isTextOnly&&n.value&&(t.beforeText=mo.test(n.value)?t.newline+t.indent+e.indent(1):" "),t}function Xt(t,e){if(null!=t.value&&mo.test(t.value)){var n=Ot(t.value),r=e.indent(1),i=n.reduce(function(t,e){return Math.max(t,e.length)},0);return n.map(function(t,e){return""+(e?r:"")+Ht(t,i)+" |"}).join("\n")}return t.value}function Ht(t,e){for(;t.length<e;)t+=" ";return t}function Zt(t,e,n){n=n||{};var r=n.attributeWrap&&bo[n.attributeWrap]||bo.none,i=r===bo.none?function(t){return t.name+"=true"}:function(t){return t.name},o={open:"[NAME][PRIMARY_ATTRS]"+r+"[SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(t){return t.map(function(t){return t.isBoolean?i(t):t.name+"="+e.quote(t.value)}).join(" ")}}};return wt(t,n.field,function(t,n){if(t=Bt(t,e,o),t=Qt(t,e),!Et(t)){var r=t.node;(r.value||!r.children.length&&!r.selfClosing)&&(t.text=t.renderFields(Jt(r,e)))}return t})}function Qt(t,e){var n=t.node,r=n.parent;return 0===e.get("inlineBreak")&&Kt(n,e)&&!_t(r)&&null==r.value&&1===r.children.length&&(t.beforeOpen=": "),!n.isTextOnly&&n.value&&(t.beforeText=go.test(n.value)?t.newline+t.indent+e.indent(1):" "),t}function Jt(t,e){if(null!=t.value&&go.test(t.value)){var n=e.indent(1);return Ot(t.value).map(function(t,e){return n+(e?" ":"|")+" "+t}).join("\n")}return t.value}function Kt(t,e){return t&&(t.isTextOnly||e.isInline(t))}function te(t,e,n){n=n||{};var r={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary:function(t){return t.map(function(t){return t.isBoolean?t.name:t.name+"="+e.quote(t.value)}).join(", ")}}};return wt(t,n.field,function(t){if(t=Bt(t,e,r),t=ee(t,e),!Et(t)){var n=t.node;(n.value||!n.children.length&&!n.selfClosing)&&(t.text=t.renderFields(ne(n,e)))}return t})}function ee(t,e){var n=t.node;return!n.isTextOnly&&n.value&&(t.beforeText=vo.test(n.value)?t.newline+t.indent+e.indent(1):" "),t}function ne(t,e){if(null!=t.value&&vo.test(t.value)){var n=e.indent(1);return Ot(t.value).map(function(t){return n+"| "+t}).join("\n")}return t.value}function re(t){return!!t&&t in yo}function ie(t){return k(t)||$(t,65,70)}function oe(t){return!(t%17)}function ae(t){return(t>>4).toString(16)}function se(t){return ue(t.toString(16),2)}function ue(t,e){for(;t.length<e;)t="0"+t;return t}function le(t){return k(t)||ce(t)}function ce(t){return 95===t||$(t)}function fe(t){for(var e,n=t.pos,r=t.eat(Oo),i=!1,o=!1;!t.eof()&&(e=t.peek(),e===Ao?!i:k(e));)o=!0,e===Ao&&(i=!0),t.next();return r&&!o&&(t.pos=n),n!==t.pos}function pe(t){return le(t)||t===So}function he(t){return 45===t||le(t)}function de(t){if(!t.eat(Ro))return null;for(var e,n=[];!t.eof();)if(e=me(t))n.push(e);else{if(t.eatWhile(A),t.eat(Lo))break;if(!t.eat(No))throw t.error("Expected , or )")}return n}function me(t){for(var e,n=new wo;!t.eof()&&(t.eatWhile(A),e=jo(t)||$o(t)||To(t)||ge(t));)n.add(e);return n.size?n:null}function ge(t){var e=Eo(t);if(e){var n=de(t);return n?new Fo(e.toString(),n):e}}function be(t){return t.start=t.pos,t.eatWhile(xe),t.eatWhile(ye),t.start!==t.pos?t.current():null}function ve(t){for(var e,n=new wo;!t.eof()&&(t.eat(Io),(e=jo(t)||$o(t))?e.unit||t.eat(Uo):(t.eat(Uo),e=Eo(t,!0)),e);)n.add(e);return n}function ye(t){return ce(t)}function xe(t){return t===Bo||t===Po||t===Wo}function we(t){return t*(t+1)/2}function ke(t){t=t.sort($e);for(var e=[],n=0,r=void 0,i=void 0;n<t.length;n++)if(r=t[n],r.property){for(;e.length;){if(i=e[e.length-1],0===r.property.indexOf(i.property)&&r.property.charCodeAt(i.property.length)===Go){i.addDependency(r),e.push(r);break}e.pop()}e.length||e.push(r)}return t}function $e(t,e){return t.key===e.key?0:t.key<e.key?-1:1}function Ce(t){return/^\s*[\w\-]+/.test(t)}function Ae(t){return String(t).split("|")}function Oe(t){return Vo(t.all({type:"string"}))}function je(t,e){var n=qe(t.name,e,"key");return n?n.property?_e(t,n):Se(t,n):"!"===t.name?Ee(t,"!important"):t}function _e(t,e){var n=t.name;if(t.name=e.property,t.value&&"object"==typeof t.value){var r=e.keywords();if(t.value.size)for(var i=0,o=void 0;i<t.value.value.length;i++)o=t.value.value[i],"!"===o?o=(i?"":"${1} ")+"!important":Me(o)?o=qe(o.value,r)||qe(o.value,Zo)||o:Re(o)&&(o=Ne(t.name,o)),t.value.value[i]=o;else{var a=qe(Te(n,e.key),r);a||(a=e.defaulValue)&&-1===a.indexOf("${")&&(a="${1:"+a+"}"),a&&t.value.add(a)}}return t}function Se(t,e){return Ee(t,e.value)}function Ee(t,e){return t.name=null,t.value=e,t}function qe(t,e,n){if(!t)return null;for(var r=null,i=0,o=0,a=void 0;o<e.length;o++){a=e[o];var s=Yo(t,ze(a,n));if(1===s)return a;s&&s>=i&&(i=s,r=a)}return r}function ze(t,e){var n=t&&"object"==typeof t?t[e]:t,r=(n||"").match(/^[\w-@]+/);return r?r[0]:n}function Te(t,e){for(var n=0,r=0;n<t.length;n++){if(-1===(r=e.indexOf(t[n],r)))return t.slice(n);r++}return""}function Me(t){return Le(t,"keyword")}function Re(t){return Le(t,"numeric")}function Le(t,e){return t&&"object"==typeof t&&t.type===e}function Ne(t,e){return e.unit?e.unit=Jo[e.unit]||e.unit:0!==e.value&&-1===Qo.indexOf(t)&&(e.unit=e.value===(0|e.value)?"px":"em"),e}function Fe(t,e,n){return n=Object.assign({},ta,n),wt(t,n.field,function(r){var i=r.node,o=String(i.value||"");if(i.attributes.length){o=We(o,i.attributes.map(function(t){return Pe(t,n)}))}return r.open=i.name&&e.name(i.name),r.afterOpen=n.format.between,r.text=r.renderFields(o||null),r.open&&(r.afterText=n.format.after),e.get("format")&&(r.newline="\n",t.lastChild!==i&&(r.afterText+=r.newline)),r})}function We(t,e){var n=dt(t),r=n.fields.length;if(r)for(e=e.slice(),e.length>r&&(e=e.slice(0,r-1).concat(e.slice(r-1).join(", ")));e.length;){var i=e.shift(),o=n.fields.shift(),a=i.length-o.length;n.string=n.string.slice(0,o.location)+i+n.string.slice(o.location+o.length);for(var s=0,u=n.fields.length;s<u;s++)n.fields[s].location+=a}return n}function Pe(t,e){return t.value&&"object"==typeof t.value&&"css-value"===t.value.type?t.value.value.map(function(t){return t&&"object"==typeof t?"color"===t.type?t.toString(e.shortHex):t.toString():String(t)}).join(" "):null!=t.value?String(t.value):""}function Ue(t){return!!t&&t in ea}function Ie(t,e){var n=ea[t];return"string"==typeof n&&(n=ea[n]),Object.assign({},n,e&&e.format)}function Be(t){return!t.parent}function De(t,e){return Math.floor(Math.random()*(e-t)+t)}function Ye(t,e){for(var n=t.length,r=Math.min(n,e),i=new Set;i.size<r;)i.add(t[De(0,n)]);return Array.from(i)}function Ge(t){return t[De(0,t.length-1)]}function Ve(t,e){return t.length&&(t=[Xe(t[0])].concat(t.slice(1))),t.join(" ")+(e||Ge("?!..."))}function Xe(t){return t[0].toUpperCase()+t.slice(1)}function He(t){if(t.length<2)return t;t=t.slice();var e=t.length,n=/,$/,r=0;r=e>3&&e<=6?De(0,1):e>6&&e<=12?De(0,2):De(1,4);for(var i=0,o=void 0;i<r;i++)o=De(0,e-2),n.test(t[o])||(t[o]+=",");return t}function Ze(t,e,n){var r,i=[],o=0;for(n&&t.common&&(r=t.common.slice(0,e),o+=r.length,i.push(Ve(He(r),".")));o<e;)r=Ye(t.words,Math.min(De(2,30),e-o)),o+=r.length,i.push(Ve(He(r)));return i.join(" ")}function Qe(t){for(;t.parent;){if(t.repeat&&t.repeat.value&&t.repeat.value>1)return!0;t=t.parent}return!1}function Je(t,e){return e=e||{},"string"==typeof t&&(t=Ke(t,e)),xo(t,e.profile,e.syntax,e.format)}function Ke(t,e){return Oi(t).use(Hi,e.text,e.addons).use(ji,e.snippets).use(ct,e.variables)}function tn(t,e){return e=e||{},"string"==typeof t&&(t=en(t,e)),na(t,e.profile,e.syntax,e.format)}function en(t,e){return"string"==typeof t&&(t=Do(t)),t.use(Ko,e.snippets)}function nn(t){var e={},n=t.name.match(pa);return n[1]&&(e.lang=n[1]),n[2]&&(e.wordCount=+n[2]),fa(t,e)}function rn(t,e){return e=sn(e),un(e.syntax)?tn(t,e):Je(t,e)}function on(t,e){return e=sn(e),un(e.syntax)?en(t,e):Ke(t,e)}function an(t,e){return e instanceof Jr?e:ha(un(t)?"css":t,e)}function sn(t){return"string"==typeof t&&(t={syntax:t}),t=Object.assign({},ga,t),t.format=Object.assign({field:t.field},t.format),t.profile=ln(t),t.variables=Object.assign({},da,t.variables),t.snippets=an(un(t.syntax)?"css":t.syntax,t.snippets),t}function un(t){return ma.has(t)}function ln(t){return t.profile instanceof Xr?t.profile:new Xr(t.profile)}function cn(t,e){var n=t.getModeAt(e||t.getCursor()),r="xml"===n.name?"html":n.name;if(fn(r))return r;var i=t.getOption("emmet");return i&&fn(i.syntax)?i.syntax:null}function fn(t){return ba.has(t)}function pn(t,e){var n=cn(t,e);return n&&(!ya[n]||ya[n](t,e))}function hn(t){return t.getOption("indentWithTabs")?"\t":gn(" ",t.getOption("indentUnit"))}function dn(t,e,n){var r=mn(e),i=hn(t);return"\t"!==i&&(r=r.map(function(t){return t.replace(/^\t+/,function(t){return gn(i,t.length)})})),n&&(r=r.map(function(t,e){return e?n+t:t})),r.join("\n")}function mn(t){return Array.isArray(t)?t:t.split(/\r\n|\r|\n/g)}function gn(t,e){for(var n="";0<e--;)n+=t;return n}function bn(t){return t.replace(/\$\{\d+(:[^\}]+)?\}/g,"")}function vn(t,e,n){return n?yn(e,t.from)>0&&yn(e,t.to)<0:yn(e,t.from)>=0&&yn(e,t.to)<=0}function yn(t,e){return t.line-e.line||t.ch-e.ch}function xn(t,e,n){return rn(t,Object.assign({syntax:cn(e),field:wa},An(e),n))}function wn(t,e){return on(t,Object.assign({syntax:cn(e)},An(e)))}function kn(t,e){return e=e||e.getCursor(),f(t.getLine(e.line),e.ch,!0)}function $n(t,e){try{return{ast:wn(t,e),abbreviation:t,snippet:xn(t,e)}}catch(t){return null}}function Cn(t,e,n){var r,i=!1,o=0;try{r=xn(e,t,{field:function(t,e){return void 0===e&&(e=""),i||(i=!0,o=e.length,e=xa+e),e}})}catch(t){return!1}var a=t.getLine(n.from.line),s=a.match(/^\s+/);r=dn(t,r,s&&s[0]);var u=r.length;return i&&(u=r.indexOf(xa),r=r.slice(0,u)+r.slice(u+xa.length)),t.operation(function(){t.replaceRange(r,n.from,n.to);var e=t.indexFromPos(n.from),i=t.posFromIndex(u+e);return o?t.setSelection(i,{line:i.line,ch:i.ch+o}):t.setCursor(i),!0})}function An(t,e){var n=t.getModeAt(e||t.getCursor()),r=t.getOption("emmet"),i=r&&r.profile;return"xml"===n.name&&(i=Object.assign({selfClosingStyle:n.configuration},i)),Object.assign({profile:i,snippets:On(t,cn(t,e))},r)}function On(t,e){var n=t.getOption("emmet");if(n)return un(e)?n.stylesheetSnippets:n.markupSnippets}function jn(t){var e=_n(t,t.getCursor());e&&zn(t,e)||(En(t),pn(t)&&Sn(t,t.getCursor()))}function _n(t,e){for(var n=t.findMarksAt(e),r=0;r<n.length;r++)if(n[r].className===ka)return n[r]}function Sn(t,e,n){var r=_n(t,e);if(r)return r;En(t);var i=kn(t,e),o=i&&$n(i.abbreviation,t);if(o&&(n||qn(o))){var a={line:e.line,ch:i.location},s={line:e.line,ch:i.location+i.abbreviation.length},u=t.markText(a,s,{inclusiveRight:!0,clearWhenEmpty:!0,className:ka});return u.model=o,u}}function En(t){for(var e=t.getAllMarks(),n=0;n<e.length;n++)e[n].className===ka&&e[n].clear()}function qn(t){var e=t.ast.children[0];return e&&/^[a-z]/i.test(e.name)}function zn(t,e){var n=e.find();if(n.from.line!==n.to.line)return!1;var r=t.getRange(n.from,n.to);return!(!r||/^\s|\s$/g.test(r))&&(e.model&&e.model.abbreviation===r||(e.model=$n(r,t)),!(!e.model||!e.model.snippet))}function Tn(t){t=t.sort(Mn);for(var e=[],n=0,r=void 0,i=void 0;n<t.length;n++)if(r=t[n],r.property){for(;e.length;){if(i=e[e.length-1],0===r.property.indexOf(i.property)&&r.property.charCodeAt(i.property.length)===Aa){i.addDependency(r),e.push(r);break}e.pop()}e.length||e.push(r)}return t}function Mn(t,e){return t.key===e.key?0:t.key<e.key?-1:1}function Rn(t){return/^\s*[\w\-]+/.test(t)}function Ln(t){return String(t).split("|")}function Nn(t){return Oa(t.all({type:"string"}))}function Fn(t,e,n,r){var i=[];r=r||t.getCursor();var o={from:n,to:{line:n.line,ch:n.ch+e.abbreviation.length}};i.push(new Ea("expanded-abbreviation",t,o,"Expand abbreviation",e.snippet,function(){return Cn(t,e.abbreviation,o)}));var a=Un(e.abbreviation,r.ch-n.ch);if(null!==a){var s={from:{line:r.line,ch:r.ch-a.length},to:r},u=Pn(t,r).filter(function(t){return t.key!==a&&0===t.key.indexOf(a)}).map(function(e){return new Ea("snippet",t,s,e.key,e.preview,e.key)});i=i.concat(u)}return i}function Wn(t,e,n,r){var i=[];r=r||t.getCursor();var o={from:n,to:{line:n.line,ch:n.ch+e.abbreviation.length}};i.push(new Ea("expanded-abbreviation",t,o,"Expand abbreviation",e.snippet,function(){return Cn(t,e.abbreviation,o)}));var a=In(e.abbreviation,r.ch-n.ch);if(null!==a){var s={from:{line:r.line,ch:r.ch-a.length},to:r},u=Pn(t,r).filter(function(t){return t.key!==a&&0===t.key.indexOf(a)}).map(function(e){return new Ea("snippet",t,s,e.key,e.preview,e.key)});i=i.concat(u)}return i}function Pn(t,e){var n=cn(t,e);t.state.emmetCompletions||(t.state.emmetCompletions={});var r=t.state.emmetCompletions;if(!(n in r)){var i=an(n,On(t,n));if(un(n))r[n]=Nn(i).map(function(t){var e=t.property,n=t.keywords();return n.length&&(e+=": "+bn(n.join(" | "))),{key:t.key,value:t.value,keywords:n,preview:e}});else{var o=function(t,e){return e||""},a={syntax:n,field:o};r[n]=i.all({type:"string"}).map(function(e){return{key:e.key,value:e.value,preview:xn(e.value,t,a)}})}}return r[n]}function Un(t,e){return Bn(t,e,/[\w:\-\$@]+$/)}function In(t,e){return Bn(t,e,/[\w-@$]+$/)}function Bn(t,e,n){if(0===e)return"";var r=t.slice(0,e).match(n),i=r&&r[0]||"";return i&&(i===t||/[>\^\+\(\)]/.test(t[e-i.length-1]))?i:null}function Dn(t){return t===za||t===Ta}function Yn(t){return t>47&&t<58}function Gn(t,e,n){return e=e||65,n=n||90,(t&=-33)>=e&&t<=n}function Vn(t){return Yn(t)||Gn(t)}function Xn(t){return 32===t||9===t||160===t}function Hn(t){return Xn(t)||10===t||13===t}function Zn(t,e,n,r){r=r?Object.assign({},La,r):La;var i=t.pos;if(t.eat(e)){for(var o,a=1;!t.eof();)if(!Ra(t,r))if((o=t.next())===e)a++;else if(o===n){if(!--a)return t.start=i,!0}else o===r.escape&&t.next();if(t.pos=i,r.throws)throw t.error("Unable to find matching pair for "+String.fromCharCode(e))}return!1}function Qn(t,e){var n=t.pos;if(t.eatWhile(e))return new Pa(t,n,t.pos);t.pos=n}function Jn(t){return Ba(t)||Wa(t,tr)}function Kn(t){var e=t.pos;if(Ra(t)){var n,r,i=t.pos;t.pos=e,t.next(),n=t.start=t.pos,t.pos=i,t.backUp(1),r=t.pos;var o=Wa(t,n,r);return t.pos=i,o}return Ba(t)||nr(t)}function tr(t){return t!==Ya&&!er(t)&&!Hn(t)}function er(t){return t===Ga||t===Da}function nr(t){return Wa(t,rr)}function rr(t){return!(isNaN(t)||Dn(t)||Hn(t)||er(t))}function ir(t){return Wa(t,or)}function or(t){return Vn(t)||t===Za||t===Ha||t===Xa||t===Qa}function ar(t,e){for(var n=t.pos,r=0;r<e.length;r++)if(!t.eat(e[r]))return t.pos=n,!1;return t.start=n,!0}function sr(t,e,n,r){var i=t.pos;if(ar(t,e)){for(;!t.eof();){if(ar(t,n))return!0;t.next()}return!!r||(t.pos=i,!1)}return t.pos=i,null}function ur(t){return t.split("").map(function(t){return t.charCodeAt(0)})}function lr(t,e){e=Object.assign({},os,e);for(var n,r,i,o="string"==typeof t?new qa(t):t,a=new Na(o,"root"),s=new Set(e.empty),u=e.special.reduce(function(t,e){return t.set(e,ur("</"+e+">"))},new Map),l=[a];!o.eof();)if(n=cr(o))if(i=pr(n),"open"===n.type)r=new Na(o,"tag",n),hr(l).addChild(r),u.has(i)?r.close=fr(o,u.get(i)):function(t,n){return t.selfClosing||!e.xml&&s.has(n)}(n,i)||l.push(r);else if("close"===n.type){for(var c=l.length-1;c>0;c--)if(l[c].name.toLowerCase()===i){l[c].close=n,l=l.slice(0,c);break}}else hr(l).addChild(new Na(o,n.type,n));else o.next();return a}function cr(t){if(60===t.peek())return es(t)||is(t)||Ja(t)}function fr(t,e){for(var n=t.pos;!t.eof();){if(ar(t,e))return t.pos=t.start,Ja(t);t.next()}return t.pos=n,null}function pr(t){return t.name?t.name.value.toLowerCase():"#"+t.type}function hr(t){return t[t.length-1]}function dr(t){return{from:t.start,to:t.end}}function mr(t,e){var n=new us(t),r="xml"===e;try{return new as(lr(n,{xml:r}),"html",e||"html")}catch(t){console.warn(t)}}function gr(t){return mr(t,yr(t))}function br(t){return t.state._emmetModel||(t.state._emmetModel=gr(t)),t.state._emmetModel}function vr(t){t.state._emmetModel=null}function yr(t){var e=t.getMode();return"htmlmixed"===e.name?"html":"xml"===e.name?e.configuration:e.name}function xr(t,e){e=e||t.getCursor();var n=wr(t);if(n)if(vn(n.open.find(),e)){if(!n.close||Ar(t,n.open)===Ar(t,n.close))return n}else if(n.close&&vn(n.close.find(),e)&&Ar(t,n.open)===Ar(t,n.close))return n;kr(t);var r=$r(t,e);if(r&&"tag"===r.type)return{open:Cr(t,r.open.name,ls),close:r.close&&Cr(t,r.close.name,cs)}}function wr(t){var e,n;return t.getAllMarks().forEach(function(t){t.className===ls?e=t:t.className===cs&&(n=t)}),e?{open:e,close:n}:null}function kr(t){t.getAllMarks().forEach(function(t){t.className!==ls&&t.className!==cs||t.clear()})}function $r(t,e){var n=t.getEmmetDocumentModel();return n&&n.nodeForPoint(e||t.getCursor())}function Cr(t,e,n){return t.markText(e.start,e.end,{className:n,inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1})}function Ar(t,e){var n=e.find();return n?t.getRange(n.from,n.to):""}function Or(t,e){var n=wr(t),r=e.from;n&&(vn(n.open.find(),r)&&n.close?jr(t,n.open,n.close):n.close&&vn(n.close.find(),r)&&jr(t,n.close,n.open))}function jr(t,e,n){var r=_r(t,e),i=n.find(),o=r.match(/[\w:\-]+/),a=r?o&&o[0]:"";null!=a?t.getRange(i.from,i.to)!==a&&t.replaceRange(a,i.from,i.to):kr(t)}function _r(t,e){
2
+ var n=e.find();return n?t.getRange(n.from,n.to):""}var Sr=function(t){this.string=t,this.pos=this.string.length};Sr.prototype.sol=function(){return 0===this.pos},Sr.prototype.peek=function(t){return this.string.charCodeAt(this.pos-1+(t||0))},Sr.prototype.prev=function(){if(!this.sol())return this.string.charCodeAt(--this.pos)},Sr.prototype.eat=function(t){var e="function"==typeof t?t(this.peek()):t===this.peek();return e&&this.pos--,e},Sr.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos<e};var Er=39,qr=34,zr=92,Tr=9,Mr=32,Rr=58,Lr=61,Nr=function(t){var e=t.pos;if(!t.eat(62))return!1;var r=!1;for(t.eat(47);!t.sol();){if(t.eatWhile(l),o(t)){if(t.eat(47)){r=t.eat(60);break}if(t.eat(60)){r=!0;break}if(t.eat(l))continue;if(t.eat(Lr)){r=o(t);break}if(i(t)){r=!0;break}break}if(!n(t))break}return t.pos=e,r},Fr=function(t){return t.charCodeAt(0)},Wr=Fr("["),Pr=Fr("]"),Ur=Fr("("),Ir=Fr(")"),Br=Fr("{"),Dr=Fr("}"),Yr=new Set("#.*:$-_!@%^+>/".split("").map(Fr)),Gr=(new Map).set(Wr,Pr).set(Ur,Ir).set(Br,Dr),Vr={indent:"\t",tagCase:"",attributeCase:"",attributeQuotes:"double",format:!0,formatSkip:["html"],formatForce:["body"],inlineBreak:3,compactBooleanAttributes:!1,booleanAttributes:["contenteditable","seamless","async","autofocus","autoplay","checked","controls","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","readonly","required","reversed","selected","typemustmatch"],selfClosingStyle:"html",inlineElements:["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]},Xr=function(t){this.options=Object.assign({},Vr,t),this.quoteChar="single"===this.options.attributeQuotes?"'":'"'};Xr.prototype.get=function(t){return this.options[t]},Xr.prototype.quote=function(t){return""+this.quoteChar+(null!=t?t:"")+this.quoteChar},Xr.prototype.name=function(t){return b(t,this.options.tagCase)},Xr.prototype.attribute=function(t){return b(t,this.options.attributeCase)},Xr.prototype.isBooleanAttribute=function(t){return t.options.boolean||-1!==this.get("booleanAttributes").indexOf((t.name||"").toLowerCase())},Xr.prototype.selfClose=function(){switch(this.options.selfClosingStyle){case"xhtml":return" /";case"xml":return"/";default:return""}},Xr.prototype.indent=function(t){var e=this;t=t||0;for(var n="";t--;)n+=e.options.indent;return n},Xr.prototype.isInline=function(t){return"string"==typeof t?-1!==this.get("inlineElements").indexOf(t.toLowerCase()):null!=t.name?this.isInline(t.name):t.isTextOnly},Xr.prototype.field=function(t,e){return this.options.field(t,e)};var Hr=function(t,e){this.key=t,this.value=e},Zr=function(t){this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(t)},Qr={disabled:{}};Qr.disabled.get=function(){return this._disabled},Zr.prototype.disable=function(){this._disabled=!0},Zr.prototype.enable=function(){this._disabled=!1},Zr.prototype.set=function(t,e){var n=this;if("string"==typeof t)t.split("|").forEach(function(t){return n._string.set(t,new Hr(t,e))});else{if(!(t instanceof RegExp))throw new Error("Unknow snippet key: "+t);this._regexp.set(t,new Hr(t,e))}return this},Zr.prototype.get=function(t){var e=this;if(!this.disabled){if(this._string.has(t))return this._string.get(t);for(var n=Array.from(this._regexp.keys()),r=0,i=n.length;r<i;r++)if(n[r].test(t))return e._regexp.get(n[r])}},Zr.prototype.load=function(t){var e=this;this.reset(),t instanceof Map?t.forEach(function(t,n){return e.set(n,t)}):t&&"object"==typeof t&&Object.keys(t).forEach(function(n){return e.set(n,t[n])})},Zr.prototype.reset=function(){this._string.clear(),this._regexp.clear()},Zr.prototype.values=function(){if(this.disabled)return[];var t=Array.from(this._string.values()),e=Array.from(this._regexp.values());return t.concat(e)},Object.defineProperties(Zr.prototype,Qr);var Jr=function(t){var e=this;this._registry=[],Array.isArray(t)?t.forEach(function(t,n){return e.add(n,t)}):"object"==typeof t&&this.add(t)};Jr.prototype.get=function(t){for(var e=this,n=0;n<this._registry.length;n++){var r=e._registry[n];if(r.level===t)return r.store}},Jr.prototype.add=function(t,e){null!=t&&"object"==typeof t&&(e=t,t=0);var n=new Zr(e);return this.remove(t),this._registry.push({level:t,store:n}),this._registry.sort(function(t,e){return e.level-t.level}),n},Jr.prototype.remove=function(t){this._registry=this._registry.filter(function(e){return e.level!==t&&e.store!==t})},Jr.prototype.resolve=function(t){for(var e=this,n=0;n<this._registry.length;n++){var r=e._registry[n].store.get(t);if(r)return r}},Jr.prototype.all=function(t){t=t||{};var e=new Map,n=function(n){var r=n.key instanceof RegExp?"regexp":"string";t.type&&t.type!==r||e.has(n.key)||e.set(n.key,n)};return this._registry.forEach(function(t){t.store.values().forEach(n)}),Array.from(e.values())},Jr.prototype.clear=function(){this._registry.length=0};var Kr=function(t,e,n){this.name=t,this.value=null!=e?e:null,this.options=n||{}};Kr.prototype.clone=function(){return new Kr(this.name,this.value,Object.assign({},this.options))},Kr.prototype.valueOf=function(){return this.name+'="'+this.value+'"'};var ti=function(t,e){var n=this;this.name=t||null,this.value=null,this.repeat=null,this.selfClosing=!1,this.children=[],this.parent=null,this.next=null,this.previous=null,this._attributes=[],Array.isArray(e)&&e.forEach(function(t){return n.setAttribute(t)})},ei={attributes:{},attributesMap:{},isGroup:{},isTextOnly:{},firstChild:{},lastChild:{},childIndex:{},nextSibling:{},previousSibling:{},classList:{}};ei.attributes.get=function(){return this._attributes},ei.attributesMap.get=function(){return this.attributes.reduce(function(t,e){return t[e.name]=e.options.boolean?e.name:e.value,t},{})},ei.isGroup.get=function(){return!this.name&&!this.value&&!this._attributes.length},ei.isTextOnly.get=function(){return!this.name&&!!this.value&&!this._attributes.length},ei.firstChild.get=function(){return this.children[0]},ei.lastChild.get=function(){return this.children[this.children.length-1]},ei.childIndex.get=function(){return this.parent?this.parent.children.indexOf(this):-1},ei.nextSibling.get=function(){return this.next},ei.previousSibling.get=function(){return this.previous},ei.classList.get=function(){var t=this.getAttribute("class");return t&&t.value?t.value.split(/\s+/g).filter(x):[]},ti.prototype.create=function(t,e){return new ti(t,e)},ti.prototype.setAttribute=function(t,e){var n=v(t,e),r=this.getAttribute(t);r?this.replaceAttribute(r,n):this._attributes.push(n)},ti.prototype.hasAttribute=function(t){return!!this.getAttribute(t)},ti.prototype.getAttribute=function(t){var e=this;"object"==typeof t&&(t=t.name);for(var n=0;n<this._attributes.length;n++){var r=e._attributes[n];if(r.name===t)return r}},ti.prototype.replaceAttribute=function(t,e,n){"string"==typeof t&&(t=this.getAttribute(t));var r=this._attributes.indexOf(t);-1!==r&&this._attributes.splice(r,1,v(e,n))},ti.prototype.removeAttribute=function(t){"string"==typeof t&&(t=this.getAttribute(t));var e=this._attributes.indexOf(t);-1!==e&&this._attributes.splice(e,1)},ti.prototype.clearAttributes=function(){this._attributes.length=0},ti.prototype.addClass=function(t){t=y(t),this.hasAttribute("class")?t&&!this.hasClass(t)&&this.setAttribute("class",this.classList.concat(t).join(" ")):this.setAttribute("class",t)},ti.prototype.hasClass=function(t){return-1!==this.classList.indexOf(y(t))},ti.prototype.removeClass=function(t){t=y(t),this.hasClass(t)&&this.setAttribute("class",this.classList.filter(function(e){return e!==t}).join(" "))},ti.prototype.appendChild=function(t){this.insertAt(t,this.children.length)},ti.prototype.insertBefore=function(t,e){this.insertAt(t,this.children.indexOf(e))},ti.prototype.insertAt=function(t,e){if(e<0||e>this.children.length)throw new Error("Unable to insert node: position is out of child list range");var n=this.children[e-1],r=this.children[e];t.remove(),t.parent=this,this.children.splice(e,0,t),n&&(t.previous=n,n.next=t),r&&(t.next=r,r.previous=t)},ti.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&(this.children.splice(e,1),t.previous&&(t.previous.next=t.next),t.next&&(t.next.previous=t.previous),t.parent=t.next=t.previous=null)},ti.prototype.remove=function(){this.parent&&this.parent.removeChild(this)},ti.prototype.clone=function(t){var e=new ti(this.name);return e.value=this.value,e.selfClosing=this.selfClosing,this.repeat&&(e.repeat=Object.assign({},this.repeat)),this._attributes.forEach(function(t){return e.setAttribute(t.clone())}),t&&this.children.forEach(function(t){return e.appendChild(t.clone(!0))}),e},ti.prototype.walk=function(t,e){e=e||0;for(var n=this.firstChild;n;){var r=n.next;if(!1===t(n,e)||!1===n.walk(t,e+1))return!1;n=r}},ti.prototype.use=function(t){for(var e=arguments,n=[this],r=1;r<arguments.length;r++)n.push(e[r]);return t.apply(null,n),this},ti.prototype.toString=function(){var t=this,e=this.attributes.map(function(e){e=t.getAttribute(e.name);var n=e.options,r=(n&&n.implied?"!":"")+(e.name||"");return n&&n.boolean?r+=".":null!=e.value&&(r+='="'+e.value+'"'),r}),n=""+(this.name||"");return e.length&&(n+="["+e.join(" ")+"]"),null!=this.value&&(n+="{"+this.value+"}"),this.selfClosing&&(n+="/"),this.repeat&&(n+="*"+(this.repeat.count?this.repeat.count:""),null!=this.repeat.value&&(n+="@"+this.repeat.value)),n},Object.defineProperties(ti.prototype,ei);var ni=function(t,e,n){null==n&&"string"==typeof t&&(n=t.length),this.string=t,this.pos=this.start=e||0,this.end=n};ni.prototype.eof=function(){return this.pos>=this.end},ni.prototype.limit=function(t,e){return new this.constructor(this.string,t,e)},ni.prototype.peek=function(){return this.string.charCodeAt(this.pos)},ni.prototype.next=function(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)},ni.prototype.eat=function(t){var e=this.peek(),n="function"==typeof t?t(e):e===t;return n&&this.next(),n},ni.prototype.eatWhile=function(t){for(var e=this.pos;!this.eof()&&this.eat(t););return this.pos!==e},ni.prototype.backUp=function(t){this.pos-=t||1},ni.prototype.current=function(){return this.substring(this.start,this.pos)},ni.prototype.substring=function(t,e){return this.string.slice(t,e)},ni.prototype.error=function(t){var e=new Error(t+" at char "+(this.pos+1));return e.originalMessage=t,e.pos=this.pos,e.string=this.string,e};var ri=39,ii=34,oi={escape:92,throws:!1},ai=function(t,e){e=e?Object.assign({},oi,e):oi;var n=t.pos,r=t.peek();if(t.eat(w)){for(;!t.eof();)switch(t.next()){case r:return t.start=n,!0;case e.escape:t.next()}if(t.pos=n,e.throws)throw t.error("Unable to consume quoted string")}return!1},si={escape:92,throws:!1},ui=function(t){if(t.eat(42))return t.start=t.pos,{count:t.eatWhile(k)?+t.current():null}},li={throws:!0},ci=function(t){if(ai(t,li))return t.current().slice(1,-1)},fi={throws:!0},pi=function(t){return j(t,123,125,fi)?t.current().slice(1,-1):null},hi=33,di=46,mi=61,gi=91,bi=93,vi=/^\!?[\w\-:\$@]+\.?$/,yi=function(t){if(!t.eat(gi))return null;for(var e,n,r=[];!t.eof();){if(t.eatWhile(A),t.eat(bi))return r;if(null!=(e=ci(t)))r.push({name:null,value:e});else{if(!S(t))throw t.error("Expected attribute name");e=t.current(),vi.test(e)?(n=_(e),r.push(n),t.eat(mi)&&(null!=(e=ci(t))?n.value=e:null!=(e=pi(t))?(n.value=e,n.options={before:"{",after:"}"}):S(t)&&(n.value=t.current()))):r.push({name:null,value:e})}}throw t.error('Expected closing "]" brace')},xi=function(t){for(var e,n=t.pos,r=new ti(q(t));!t.eof();)if(t.eat(46))r.addClass(q(t));else if(t.eat(35))r.setAttribute("id",q(t));else{if(t.eat(47)){if(r.isGroup)throw t.backUp(1),t.error("Unexpected self-closing indicator");r.selfClosing=!0,(e=ui(t))&&(r.repeat=e);break}if(e=yi(t))for(var i=0,o=e.length;i<o;i++)r.setAttribute(e[i]);else if(null!==(e=pi(t)))r.value=e;else{if(!(e=ui(t)))break;r.repeat=e}}if(n===t.pos)throw t.error("Unable to consume abbreviation node, unexpected "+t.peek());return r},wi=40,ki=41,$i=43,Ci=62,Ai=94,Oi=function(t){var e=T(t);return e.walk(R),e},ji=function(t,e){return t.walk(function(t){return L(t,e)}),t},_i=new Set("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")),Si={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"},Ei=function(t){return t.walk(function(t){null==t.name&&t.attributes.length&&(t.name=U(t.parent.name))}),t},qi="$",zi=function(t){return t.walk(Y),t},Ti="$#",Mi="|",Ri=/^((?:https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,Li=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,Ni=/^([a-z]+:)?\/\//i,Fi={element:"__",modifier:"_"},Wi=/^(-+)([a-z0-9]+)/i,Pi=/^(_+)([a-z0-9]+)/i,Ui=function(t){return/^[a-z]\-/i.test(t)},Ii=function(t){return/^[a-z]/i.test(t)},Bi=function(t,e){e=Object.assign({},Fi,e),t.walk(function(t){return it(t,e)});var n=at(t);return t.walk(function(t){return ot(t,n,e)}),t},Di=function(t){return t.walk(function(t){lt(t,"class","className"),lt(t,"for","htmlFor")}),t},Yi=/^xsl:(variable|with\-param)$/i,Gi=function(t){return t.walk(function(t){Yi.test(t.name||"")&&(t.children.length||t.value)&&t.removeAttribute("select")}),t},Vi={bem:Bi,jsx:Di,xsl:Gi},Xi=function(t,e){return Object.keys(e||{}).forEach(function(n){if(n in Vi){var r="object"==typeof e[n]?e[n]:null;t=t.use(Vi[n],r)}}),t},Hi=function(t,e,n){return"string"==typeof e?e=[e]:e&&"object"==typeof e&&!Array.isArray(e)&&(n=e,e=null),t.use(Ei).use(Q,Array.isArray(e)?e.length:null).use(zi).use(J,e).use(Xi,n)},Zi=36,Qi=58,Ji=92,Ki=123,to=125,eo=function(t,e,n){this.index=t,this.placeholder=e,this.location=n,this.length=this.placeholder.length},no=function(t,e){this.string=t,this.fields=e};no.prototype.mark=function(t){return mt(this.string,this.fields,t)},no.prototype.toString=function(){return string};var ro=function(t){return t},io=function(t,e,n){"object"==typeof e&&(n=e,e=null),this.node=t,this._fieldsRenderer=e||ro,this.open=null,this.beforeOpen="",this.afterOpen="",this.close=null,this.beforeClose="",this.afterClose="",this.text=null,this.beforeText="",this.afterText="",this.indent="",this.newline="",n&&Object.assign(this,n)};io.prototype.clone=function(){return new this.constructor(this.node,this)},io.prototype.indentText=function(t){var e=this,n=xt(t);if(1===n.length)return t;var r=this.newline||this.indent?this.newline:" ";return n.map(function(t,n){return n?e.indent+t:t}).join(r)},io.prototype.renderFields=function(t){return this._fieldsRenderer(t)},io.prototype.toString=function(t){var e=this._wrap(this.open,this.beforeOpen,this.afterOpen),n=this._wrap(this.close,this.beforeClose,this.afterClose);return e+this._wrap(this.text,this.beforeText,this.afterText)+(null!=t?t:"")+n},io.prototype._wrap=function(t,e,n){return e=null!=e?e:"",n=null!=n?n:"",null!=t?(t=e?t.replace(/^\s+/,""):t,t=n?t.replace(/\s+$/,""):t,e+this.indentText(t)+n):""};var oo=function(t,e){return e||""},ao=/^(.*?)([A-Z_]+)(.*?)$/,so=91,uo=93,lo={enabled:!1,trigger:["id","class"],before:"",after:"\n\x3c!-- /[#ID][.CLASS] --\x3e"},co=/^id$/i,fo=/^class$/i,po={primary:function(t){return t.join("")},secondary:function(t){return t.map(function(t){return t.isBoolean?t.name:t.name+"="+t.value}).join(", ")}},ho={open:null,close:null,omitName:/^div$/i,attributes:po},mo=/\n|\r/,go=/\n|\r/,bo={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},vo=/\n|\r/,yo={html:Tt,haml:Gt,slim:Zt,pug:te},xo=function(t,e,n,r){return"object"==typeof n&&(r=n,n=null),re(n)||(n="html"),yo[n](t,e,r)},wo=function(){this.type="css-value",this.value=[]},ko={size:{}};ko.size.get=function(){return this.value.length},wo.prototype.add=function(t){this.value.push(t)},wo.prototype.has=function(t){return-1!==this.value.indexOf(t)},wo.prototype.toString=function(){return this.value.join(" ")},Object.defineProperties(wo.prototype,ko);var $o=function(t){if(35===t.peek()){t.start=t.pos,t.next(),t.eat(116)||t.eatWhile(ie);var e=t.current();if(t.start=t.pos,t.eat(46)&&!t.eatWhile(k))throw t.error("Unexpected character for alpha value of color");return new Co(e,t.current())}},Co=function(t,e){this.type="color",this.raw=t,this.alpha=Number(null!=e&&""!==e?e:1),t=t.slice(1);var n=0,r=0,i=0;if("t"===t)this.alpha=0;else switch(t.length){case 0:break;case 1:n=r=i=t+t;break;case 2:n=r=i=t;break;case 3:n=t[0]+t[0],r=t[1]+t[1],i=t[2]+t[2];break;default:t+=t,n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6)}this.r=parseInt(n,16),this.g=parseInt(r,16),this.b=parseInt(i,16)};Co.prototype.toHex=function(t){var e=t&&oe(this.r)&&oe(this.g)&&oe(this.b)?ae:se;return"#"+e(this.r)+e(this.g)+e(this.b)},Co.prototype.toRGB=function(){var t=[this.r,this.g,this.b];return 1!==this.alpha&&t.push(this.alpha.toFixed(8).replace(/\.?0+$/,"")),(3===t.length?"rgb":"rgba")+"("+t.join(", ")+")"},Co.prototype.toString=function(t){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(t):this.toRGB():"transparent"};var Ao=46,Oo=45,jo=function(t){if(t.start=t.pos,fe(t)){var e=t.current();return t.start=t.pos,t.eat(37)||t.eatWhile(ce),new _o(e,t.current())}},_o=function(t,e){this.type="numeric",this.value=Number(t),this.unit=e||""};_o.prototype.toString=function(){return""+this.value+this.unit};var So=45,Eo=function(t,e){return t.start=t.pos,t.eat(36)||t.eat(64)?t.eatWhile(he):e?t.eatWhile(ce):t.eatWhile(pe),t.start!==t.pos?new qo(t.current()):null},qo=function(t){this.type="keyword",this.value=t};qo.prototype.toString=function(){return this.value};var zo={throws:!0},To=function(t){if(ai(t,zo))return new Mo(t.current())},Mo=function(t){this.type="string",this.value=t};Mo.prototype.toString=function(){return this.value};var Ro=40,Lo=41,No=44,Fo=function(t,e){this.type="function",this.name=t,this.args=e||[]};Fo.prototype.toString=function(){return this.name+"("+this.args.join(", ")+")"};var Wo=33,Po=36,Uo=45,Io=58,Bo=64,Do=function(t){for(var e=new ti,n=new ni(t);!n.eof();){var r=new ti(be(n));r.value=ve(n);var i=de(n);if(i)for(var o=0;o<i.length;o++)r.setAttribute(String(o),i[o]);if(n.eat(Wo)&&r.value.add("!"),e.appendChild(r),!n.eat(43))break}if(!n.eof())throw n.error("Unexpected character");return e},Yo=function(t,e){if(t===e)return 1;if(!e||t.charCodeAt(0)!==e.charCodeAt(0))return 0;for(var n,r,i,o,a=t.length,s=e.length,u=1,l=1,c=s;u<a;){for(n=t.charCodeAt(u),i=!1,o=!1;l<s;){if(r=e.charCodeAt(l),n===r){i=!0,c+=(s-l)*(o?2:1);break}o=45===r,l++}if(!i)break;u++}return c&&c*(u/a)/we(s)},Go=45,Vo=function(t){return ke(t.map(function(t){return new Xo(t.key,t.value)}))},Xo=function(t,e){this.key=t,this.value=e,this.property=null;var n=e&&e.match(/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/);n&&(this.property=n[1],this.value=n[2]),this.dependencies=[]},Ho={defaulValue:{}};Xo.prototype.addDependency=function(t){this.dependencies.push(t)},Ho.defaulValue.get=function(){return null!=this.value?Ae(this.value)[0]:null},Xo.prototype.keywords=function(){var t,e,n=[],r=new Set,i=0;for(this.property&&n.push(this);i<n.length;)if(t=n[i++],t.value){e=Ae(t.value).filter(Ce);for(var o=0;o<e.length;o++)r.add(e[o].trim());for(var a=0,s=t.dependencies;a<s.length;a++)-1===n.indexOf(s[a])&&n.push(s[a])}return Array.from(r)},Object.defineProperties(Xo.prototype,Ho);var Zo=["auto","inherit","unset"],Qo=["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],Jo={e:"em",p:"%",x:"ex",r:"rem"},Ko=function(t,e){var n=Oe(e);return t.walk(function(t){return je(t,n)}),t},ta={shortHex:!0,format:{between:": ",after:";"}},ea={css:{between:": ",after:";"},scss:"css",less:"css",sass:{between:": ",after:""},stylus:{between:" ",after:""}},na=function(t,e,n,r){return"object"==typeof n&&(r=n,n=null),Ue(n)||(n="css"),r=Object.assign({},r,{format:Ie(n,r)}),Fe(t,e,r)},ra={a:"a[href]","a:link":"a[href='http://${0}']","a:mail":"a[href='mailto:${0}']",abbr:"abbr[title]","acr|acronym":"acronym[title]",base:"base[href]/",basefont:"basefont/",br:"br/",frame:"frame/",hr:"hr/",bdo:"bdo[dir]","bdo:r":"bdo[dir=rtl]","bdo:l":"bdo[dir=ltr]",col:"col/",link:"link[rel=stylesheet href]/","link:css":"link[href='${1:style}.css']","link:print":"link[href='${1:print}.css' media=print]","link:favicon":"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']","link:touch":"link[rel=apple-touch-icon href='${1:favicon.png}']","link:rss":"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']","link:atom":"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']","link:im|link:import":"link[rel=import href='${1:component}.html']",meta:"meta/","meta:utf":"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']","meta:vp":"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']","meta:compat":"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']","meta:edge":"meta:compat[content='${1:ie=edge}']","meta:redirect":"meta[http-equiv=refresh content='0; url=${1:http://example.com}']",style:"style",script:"script[!src]","script:src":"script[src]",img:"img[src alt]/","img:s|img:srcset":"img[srcset src alt]","img:z|img:sizes":"img[sizes srcset src alt]",picture:"picture","src|source":"source/","src:sc|source:src":"source[src type]","src:s|source:srcset":"source[srcset]","src:t|source:type":"source[srcset type='${1:image/}']","src:z|source:sizes":"source[sizes srcset]","src:m|source:media":"source[media='(${1:min-width: })' srcset]","src:mt|source:media:type":"source:media[type='${2:image/}']","src:mz|source:media:sizes":"source:media[sizes srcset]","src:zt|source:sizes:type":"source[sizes srcset type='${1:image/}']",iframe:"iframe[src frameborder=0]",embed:"embed[src type]/",object:"object[data type]",param:"param[name value]/",map:"map[name]",area:"area[shape coords href alt]/","area:d":"area[shape=default]","area:c":"area[shape=circle]","area:r":"area[shape=rect]","area:p":"area[shape=poly]",form:"form[action]","form:get":"form[method=get]","form:post":"form[method=post]",label:"label[for]",input:"input[type=${1:text}]/",inp:"input[name=${1} id=${1}]","input:h|input:hidden":"input[type=hidden name]","input:t|input:text":"inp","input:search":"inp[type=search]","input:email":"inp[type=email]","input:url":"inp[type=url]","input:p|input:password":"inp[type=password]","input:datetime":"inp[type=datetime]","input:date":"inp[type=date]","input:datetime-local":"inp[type=datetime-local]","input:month":"inp[type=month]","input:week":"inp[type=week]","input:time":"inp[type=time]","input:tel":"inp[type=tel]","input:number":"inp[type=number]","input:color":"inp[type=color]","input:c|input:checkbox":"inp[type=checkbox]","input:r|input:radio":"inp[type=radio]","input:range":"inp[type=range]","input:f|input:file":"inp[type=file]","input:s|input:submit":"input[type=submit value]","input:i|input:image":"input[type=image src alt]","input:b|input:button":"input[type=button value]","input:reset":"input:button[type=reset]",isindex:"isindex/",select:"select[name=${1} id=${1}]","select:d|select:disabled":"select[disabled.]","opt|option":"option[value]",textarea:"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]",marquee:"marquee[behavior direction]","menu:c|menu:context":"menu[type=context]","menu:t|menu:toolbar":"menu[type=toolbar]",video:"video[src]",audio:"audio[src]","html:xml":"html[xmlns=http://www.w3.org/1999/xhtml]",keygen:"keygen/",command:"command/","btn:s|button:s|button:submit":"button[type=submit]","btn:r|button:r|button:reset":"button[type=reset]","btn:d|button:d|button:disabled":"button[disabled.]","fst:d|fset:d|fieldset:d|fieldset:disabled":"fieldset[disabled.]",bq:"blockquote",fig:"figure",figc:"figcaption",pic:"picture",ifr:"iframe",emb:"embed",obj:"object",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",tarea:"textarea",leg:"legend",sect:"section",art:"article",hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",mn:"main",tem:"template",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",cmd:"command","ri:d|ri:dpr":"img:s","ri:v|ri:viewport":"img:z","ri:a|ri:art":"pic>src:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{<!DOCTYPE html>}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{\x3c!-- ${0} --\x3e}","cc:ie":"{\x3c!--[if IE]>${0}<![endif]--\x3e}","cc:noie":"{\x3c!--[if !IE]>\x3c!--\x3e${0}\x3c!--<![endif]--\x3e}"},ia={"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:flex-start|flex-end|center|space-between|space-around|stretch",ai:"align-items:flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:${1:time}",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:#${1:000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:#${1:000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:#${1:000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:#${1:000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:#${1:000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:#${1:000}",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:#${1:fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:color}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:#${1:000}",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fz:"font-size",fza:"font-size-adjust",h:"height",jc:"justify-content:flex-start|flex-end|center|space-between|space-around",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:#${1:000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick",op:"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",
3
+ trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"},oa={html:ra,css:ia},aa={common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]},sa={common:["далеко-далеко","за","словесными","горами","в стране","гласных","и согласных","живут","рыбные","тексты"],words:["вдали","от всех","они","буквенных","домах","на берегу","семантика","большого","языкового","океана","маленький","ручеек","даль","журчит","по всей","обеспечивает","ее","всеми","необходимыми","правилами","эта","парадигматическая","страна","которой","жаренные","предложения","залетают","прямо","рот","даже","всемогущая","пунктуация","не","имеет","власти","над","рыбными","текстами","ведущими","безорфографичный","образ","жизни","однажды","одна","маленькая","строчка","рыбного","текста","имени","lorem","ipsum","решила","выйти","большой","мир","грамматики","великий","оксмокс","предупреждал","о","злых","запятых","диких","знаках","вопроса","коварных","точках","запятой","но","текст","дал","сбить","себя","толку","он","собрал","семь","своих","заглавных","букв","подпоясал","инициал","за","пояс","пустился","дорогу","взобравшись","первую","вершину","курсивных","гор","бросил","последний","взгляд","назад","силуэт","своего","родного","города","буквоград","заголовок","деревни","алфавит","подзаголовок","своего","переулка","грустный","реторический","вопрос","скатился","его","щеке","продолжил","свой","путь","дороге","встретил","рукопись","она","предупредила","моей","все","переписывается","несколько","раз","единственное","что","меня","осталось","это","приставка","возвращайся","ты","лучше","свою","безопасную","страну","послушавшись","рукописи","наш","продолжил","свой","путь","вскоре","ему","повстречался","коварный","составитель","рекламных","текстов","напоивший","языком","речью","заманивший","свое","агентство","которое","использовало","снова","снова","своих","проектах","если","переписали","то","живет","там","до","сих","пор"]},ua={common:["mujer","uno","dolor","más","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","paño","suntuoso","molde","namibia","planeador","mirar","demás","oficinista","excepción","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cuórum","dignísimo","facilismo","letra","nihilista","expedición","alma","alveolar","aparte","león","animal","como","paria","belleza","modo","natividad","justo","ataque","séquito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunción","incidente","marejada","placenta","amanecer","fuga","previsor","presentación","lejos","necesariamente","sospechoso","adiposidad","quindío","pócima","voluble","débito","sintió","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","mínima","mayores","repugnante","dulce","obcecado","montaña","enigma","total","deletéreo","décima","cábala","fotografía","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magnífico","distinción","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crepúsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abadía","analfabeto","remo","fugacidad","oficio","en","almácigo","vos","pan","represión","números","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patrón","explícito","paloma","síndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","apéndice","arquitecto","columna","yugo","computador","mula","a","propósito","fantasía","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]},la={latin:aa,ru:sa,sp:ua},ca={wordCount:30,skipCommon:!1,lang:"latin"},fa=function(t,e){e=Object.assign({},ca,e);var n=la[e.lang]||la.latin,r=!e.skipCommon&&!Qe(t);return t.repeat||Be(t.parent)?(t.value=Ze(n,e.wordCount,r),t.name=U(t.parent.name)):(t.parent.value=Ze(n,e.wordCount,r),t.remove()),t},pa=/^lorem([a-z]*)(\d*)$/,ha=function(t,e){var n=[oa[t]||oa.html];Array.isArray(e)?e.forEach(function(t){n.push("string"==typeof t?oa[t]:t)}):"object"==typeof e&&n.push(e);var r=new Jr(n.filter(Boolean));return"css"!==t&&r.get(0).set(pa,nn),r},da={lang:"en",locale:"en-US",charset:"UTF-8"},ma=new Set(["css","sass","scss","less","stylus","sss"]),ga={syntax:"html",field:function(t,e){return e||""},text:null,profile:null,variables:{},snippets:{},addons:null,format:null},ba=new Set(["html","xml","xsl","jsx","js","pug","slim","haml","css","sass","scss","less","sss","stylus"]),va=function(t,e){var n=t.getTokenTypeAt(e||t.getCursor());return n&&/^property\b/.test(n)},ya={html:function(t,e){return null===t.getTokenTypeAt(e||t.getCursor())},css:va,less:va,sass:va,scss:va},xa="[[::emmet-cursor::]]",wa=function(t,e){return void 0===e&&(e=""),e},ka="emmet-abbreviation",$a=function(t){if(t.somethingSelected())return t.constructor.Pass;var e=t.getCursor(),n=_n(t,e),r=!1;if(n)r=Cn(t,n.model.ast,n.find());else{var i=kn(t,e);if(i){var o={from:{line:e.line,ch:i.location},to:{line:e.line,ch:i.location+i.abbreviation.length}};r=Cn(t,i.abbreviation,o)}}return En(t),r||t.constructor.Pass},Ca=function(t){var e=t.getCursor();if("xml"===t.getModeAt(e).name){var n=(Object.assign({},e,{ch:e.ch+1}),t.getTokenAt(e)),r=t.getTokenAt(Object.assign({},e,{ch:e.ch+1}));if("tag bracket"===n.type&&">"===n.string&&"tag bracket"===r.type&&"</"===r.string){var i=t.getLine(e.line).match(/^\s+/),o=i?i[0]:"",a=hn(t),s="\n"+o+a,u="\n"+o;t.replaceRange(s+u,e,e);var l=t.indexFromPos(e),c=t.posFromIndex(l+s.length);return void t.setCursor(c)}}return t.constructor.Pass},Aa=45,Oa=function(t){return Tn(t.map(function(t){return new ja(t.key,t.value)}))},ja=function(t,e){this.key=t,this.value=e,this.property=null;var n=e&&e.match(/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/);n&&(this.property=n[1],this.value=n[2]),this.dependencies=[]},_a={defaulValue:{}};ja.prototype.addDependency=function(t){this.dependencies.push(t)},_a.defaulValue.get=function(){return null!=this.value?Ln(this.value)[0]:null},ja.prototype.keywords=function(){var t,e,n=[],r=new Set,i=0;for(this.property&&n.push(this);i<n.length;)if(t=n[i++],t.value){e=Ln(t.value).filter(Rn);for(var o=0;o<e.length;o++)r.add(e[o].trim());for(var a=0,s=t.dependencies;a<s.length;a++)-1===n.indexOf(s[a])&&n.push(s[a])}return Array.from(r)},Object.defineProperties(ja.prototype,_a);var Sa=function(t,e,n,r){r=r||t.getCursor();var i=cn(t,r);return i?un(i)?Wn(t,e,n,r):Fn(t,e,n,r):[]},Ea=function(t,e,n,r,i,o){this.type=t,this.editor=e,this.range=n,this.label=r,this.preview=i,this.snippet=o,this._inserted=!1};Ea.prototype.insert=function(){if(!this._inserted)if(this._inserted=!0,"function"==typeof this.snippet)this.snippet(this.editor,this.range);else{this.editor.replaceRange(this.snippet,this.range.from,this.range.to);var t=this.editor.indexFromPos(this.range.from),e=this.editor.posFromIndex(t+this.snippet.length);this.editor.setCursor(e)}};var qa=function(t,e,n){null==n&&"string"==typeof t&&(n=t.length),this.string=t,this.pos=this.start=e||0,this.end=n};qa.prototype.eof=function(){return this.pos>=this.end},qa.prototype.limit=function(t,e){return new this.constructor(this.string,t,e)},qa.prototype.peek=function(){return this.string.charCodeAt(this.pos)},qa.prototype.next=function(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)},qa.prototype.eat=function(t){var e=this.peek(),n="function"==typeof t?t(e):e===t;return n&&this.next(),n},qa.prototype.eatWhile=function(t){for(var e=this.pos;!this.eof()&&this.eat(t););return this.pos!==e},qa.prototype.backUp=function(t){this.pos-=t||1},qa.prototype.current=function(){return this.substring(this.start,this.pos)},qa.prototype.substring=function(t,e){return this.string.slice(t,e)},qa.prototype.error=function(t){var e=new Error(t+" at char "+(this.pos+1));return e.originalMessage=t,e.pos=this.pos,e.string=this.string,e};var za=39,Ta=34,Ma={escape:92,throws:!1},Ra=function(t,e){e=e?Object.assign({},Ma,e):Ma;var n=t.pos,r=t.peek();if(t.eat(Dn)){for(;!t.eof();)switch(t.next()){case r:return t.start=n,!0;case e.escape:t.next()}if(t.pos=n,e.throws)throw t.error("Unable to consume quoted string")}return!1},La={escape:92,throws:!1},Na=function(t,e,n,r){this.stream=t,this.type=e,this.open=n,this.close=r,this.children=[],this.parent=null},Fa={name:{},attributes:{},start:{},end:{},firstChild:{},nextSibling:{},previousSibling:{}};Fa.name.get=function(){return"tag"===this.type&&this.open?this.open&&this.open.name&&this.open.name.value:"#"+this.type},Fa.attributes.get=function(){return this.open&&this.open.attributes},Fa.start.get=function(){return this.open&&this.open.start},Fa.end.get=function(){return this.close?this.close.end:this.open&&this.open.end},Fa.firstChild.get=function(){return this.children[0]},Fa.nextSibling.get=function(){var t=this.getIndex();return-1!==t?this.parent.children[t+1]:null},Fa.previousSibling.get=function(){var t=this.getIndex();return-1!==t?this.parent.children[t-1]:null},Na.prototype.getIndex=function(){return this.parent?this.parent.children.indexOf(this):-1},Na.prototype.addChild=function(t){return this.removeChild(t),this.children.push(t),t.parent=this,this},Na.prototype.removeChild=function(t){var e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),t.parent=null),this},Object.defineProperties(Na.prototype,Fa);var Wa=function(t,e,n){return"function"==typeof e?Qn(t,e):new Pa(t,e,n)},Pa=function(t,e,n){this.stream=t,this.start=null!=e?e:t.start,this.end=null!=n?n:t.pos,this._value=null},Ua={value:{}};Ua.value.get=function(){if(null===this._value){var t=this.stream.start,e=this.stream.pos;this.stream.start=this.start,this.stream.pos=this.end,this._value=this.stream.current(),this.stream.start=t,this.stream.pos=e}return this._value},Pa.prototype.toString=function(){return this.value},Pa.prototype.valueOf=function(){return this.value+" ["+this.start+"; "+this.end+"]"},Object.defineProperties(Pa.prototype,Ua);var Ia={throws:!0},Ba=function(t){var e=t.pos;if(Zn(t,60,62,Ia)||Zn(t,91,93,Ia)||Zn(t,40,41,Ia)||Zn(t,123,125,Ia))return Wa(t,e)},Da=47,Ya=61,Ga=62,Va=function(t){for(var e,n=[];!t.eof();)if(t.eatWhile(Hn),e={start:t.pos},e.name=Jn(t))t.eat(Ya)?e.value=Kn(t):e.boolean=!0,e.end=t.pos,n.push(e);else{if(er(t.peek()))break;t.next()}return n},Xa=45,Ha=46,Za=58,Qa=95,Ja=function(t){var e=t.pos;if(t.eat(60)){var n={type:t.eat(47)?"close":"open"};if((n.name=ir(t))&&("close"!==n.type&&(n.attributes=Va(t),t.eatWhile(Hn),n.selfClosing=t.eat(47)),t.eat(62)))return Object.assign(Wa(t,e),n)}return t.pos=e,null},Ka=ur("\x3c!--"),ts=ur("--\x3e"),es=function(t){var e=t.pos;if(sr(t,Ka,ts,!0)){var n=Wa(t,e);return n.type="comment",n}return null},ns=ur("<![CDATA["),rs=ur("]]>"),is=function(t){var e=t.pos;if(sr(t,ns,rs,!0)){var n=Wa(t,e);return n.type="cdata",n}return null},os={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr"]},as=function(t,e,n){this.dom=t,this.type=e,this.syntax=n};as.prototype.nodeForPoint=function(t,e){for(var n=this.dom.firstChild,r=null;n;)vn(dr(n),t,e)?(r=n,n=n.firstChild):n=n.nextSibling;return r};var ss=function(t,e,n){null==n&&"string"==typeof t&&(n=t.length),this.string=t,this.pos=this.start=e||0,this.end=n};ss.prototype.eof=function(){return this.pos>=this.end},ss.prototype.limit=function(t,e){return new this.constructor(this.string,t,e)},ss.prototype.peek=function(){return this.string.charCodeAt(this.pos)},ss.prototype.next=function(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)},ss.prototype.eat=function(t){var e=this.peek(),n="function"==typeof t?t(e):e===t;return n&&this.next(),n},ss.prototype.eatWhile=function(t){for(var e=this.pos;!this.eof()&&this.eat(t););return this.pos!==e},ss.prototype.backUp=function(t){this.pos-=t||1},ss.prototype.current=function(){return this.substring(this.start,this.pos)},ss.prototype.substring=function(t,e){return this.string.slice(t,e)},ss.prototype.error=function(t){var e=new Error(t+" at char "+(this.pos+1));return e.originalMessage=t,e.pos=this.pos,e.string=this.string,e};var us=function(t){function e(e,n,r){t.call(this);var i=e.constructor;this.editor=e,this.start=this.pos=n||i.Pos(0,0);var o=e.lastLine();this._eof=r?r.to:i.Pos(o,this._lineLength(o)),this._sof=r?r.from:i.Pos(0,0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sof=function(){return yn(this.pos,this._sof)<=0},e.prototype.eof=function(){return yn(this.pos,this._eof)>=0},e.prototype.limit=function(t,e){return new this.constructor(this.editor,t,{from:t,to:e})},e.prototype.peek=function(){var t=this.pos,e=(t.line,t.ch),n=this.editor.getLine(this.pos.line);return e<n.length?n.charCodeAt(e):10},e.prototype.next=function(){if(!this.eof()){var t=this.peek();return this.pos=Object.assign({},this.pos,{ch:this.pos.ch+1}),this.pos.ch>=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=Object.assign({},this._eof)),t}return NaN},e.prototype.backUp=function(t){var e=this,n=this.editor.constructor,r=this.pos,i=r.line,o=r.ch;for(o-=t||1;i>=0&&o<0;)i--,o+=e._lineLength(i);return this.pos=i<0||o<0?n.Pos(0,0):n.Pos(i,o),this.peek()},e.prototype.current=function(){return this.substring(this.start,this.pos)},e.prototype.substring=function(t,e){return this.editor.getRange(t,e)},e.prototype.error=function(t){var e=new Error(t+" at line "+this.pos.line+", column "+this.pos.ch);return e.originalMessage=t,e.pos=this.pos,e.string=this.string,e},e.prototype._lineLength=function(t){var e=t===this.editor.lastLine();return this.editor.getLine(t).length+(e?0:1)},e}(ss),ls="emmet-open-tag",cs="emmet-close-tag",fs={emmetExpandAbbreviation:$a,emmetInsertLineBreak:Ca};"undefined"!=typeof CodeMirror&&function(t){Object.assign(t.commands,fs),t.defineOption("markEmmetAbbreviation",!0,function(t,e){e?t.on("change",jn):(t.off("change",jn),En(t))}),t.defineOption("autoRenameTags",!0,function(t,e){e?t.on("change",Or):t.off("change",Or)}),t.defineOption("markTagPairs",!1,function(t,e){e?(t.on("cursorActivity",xr),t.on("change",vr)):(t.off("cursorActivity",xr),t.off("change",vr),vr(t),kr(t))}),t.defineOption("emmet",{}),t.defineExtension("getEmmetCompletions",function(t,e){var n=this;"boolean"==typeof t&&(e=t,t=null);var r,i;if(t=t||n.getCursor(),n.getOption("markEmmetAbbreviation")){var o=_n(n,t)||e&&Sn(n,t,!0);o&&(r=o.find(),i=Sa(n,o.model,r.from,t))}else{var a=kn(n,t);if(a){var s=$n(a.abbreviation,n);s&&(r={from:{line:t.line,ch:a.location},to:{line:t.line,ch:a.location+a.abbreviation.length}},i=Sa(n,s,r.from,t))}}if(i&&i.length)return{from:r.from,to:r.to,list:i}}),t.defineExtension("getEmmetAbbreviation",function(t){var e=this;t=t||e.getCursor();var n=_n(e,t);if(n)return{abbreviation:n.model.abbreviation,ast:n.model.ast,location:n.find().from,fromMarker:!0};var r=kn(e,t);if(r)try{return{abbreviation:r.abbreviation,ast:wn(r.abbreviation,e),location:{line:t.line,ch:r.location},fromMarker:!1}}catch(t){}return null}),t.defineExtension("findEmmetMarker",function(t){return _n(this,t||this.getCursor())}),t.defineExtension("getEmmetDocumentModel",function(){var t=this;return t.getOption("markTagPairs")?br(t):gr(t)})}(CodeMirror)});
4
+ //# sourceMappingURL=emmet-codemirror-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emmet-codemirror-plugin.js","sources":["../node_modules/@emmetio/extract-abbreviation/dist/extract-abbreviation.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/output-profile/dist/output-profile.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/node/dist/node.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/stream-reader-utils/dist/stream-reader-utils.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/abbreviation/dist/abbreviation.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/html-snippets-resolver/dist/html-snippets-resolver.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/implicit-tag/dist/implicit-tag.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/html-transform/dist/html-transform.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/variable-resolver/dist/variable-resolver.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/field-parser/dist/field-parser.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/output-renderer/dist/output-renderer.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/markup-formatters/dist/markup-formatters.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/css-abbreviation/dist/css-abbreviation.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/css-snippets-resolver/dist/css-snippets-resolver.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/stylesheet-formatters/dist/stylesheet-formatters.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/lorem/dist/lorem.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/dist/expand.es.js","../lib/detect-syntax.js","../lib/utils.js","../lib/expand-abbreviation.js","../lib/abbreviation-marker.js","../node_modules/@emmetio/css-snippets-resolver/dist/css-snippets-resolver.es.js","../lib/autocomplete.js","../../html-matcher/node_modules/@emmetio/stream-reader-utils/dist/stream-reader-utils.es.js","../../html-matcher/dist/html-matcher.es.js","../lib/model/syntax-model.js","../lib/model/html.js","../lib/model/index.js","../lib/match-tag.js","../lib/rename-tag.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/snippets-registry/dist/snippets-registry.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/stream-reader/dist/stream-reader.es.js","../../../../../../usr/local/lib/node_modules/@emmetio/expand-abbreviation/node_modules/@emmetio/snippets/dist/snippets.es.js","../lib/commands/expand-abbreviation.js","../lib/commands/formatted-line-break.js","../../stream-reader/dist/stream-reader.es.js","../node_modules/@emmetio/stream-reader/dist/stream-reader.es.js","../lib/stream-reader.js","../extension.js","../browser.js"],"sourcesContent":["/**\n * Minimalistic backwards stream reader\n */\nclass StreamReader {\n\tconstructor(string) {\n\t\tthis.string = string;\n\t\tthis.pos = this.string.length;\n\t}\n\n\tsol() {\n\t\treturn this.pos === 0;\n\t}\n\n\tpeek(offset) {\n\t\treturn this.string.charCodeAt(this.pos - 1 + (offset || 0));\n\t}\n\n\tprev() {\n\t\tif (!this.sol()) {\n\t\t\treturn this.string.charCodeAt(--this.pos);\n\t\t}\n\t}\n\n\teat(match) {\n\t\tconst ok = typeof match === 'function'\n\t\t\t? match(this.peek())\n\t\t\t: match === this.peek();\n\n\t\tif (ok) {\n\t\t\tthis.pos--;\n\t\t}\n\n\t\treturn ok;\n\t}\n\n\teatWhile(match) {\n\t\tconst start = this.pos;\n\t\twhile (this.eat(match)) {}\n\t\treturn this.pos < start;\n\t}\n}\n\n/**\n * Quotes-related utilities\n */\n\nconst SINGLE_QUOTE = 39; // '\nconst DOUBLE_QUOTE = 34; // \"\nconst ESCAPE = 92; // \\\n\n/**\n * Check if given character code is a quote\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isQuote(c) {\n\treturn c === SINGLE_QUOTE || c === DOUBLE_QUOTE;\n}\n\n/**\n * Consumes quoted value, if possible\n * @param {StreamReader} stream\n * @return {Boolean} Returns `true` is value was consumed\n */\nfunction eatQuoted(stream) {\n\tconst start = stream.pos;\n\tconst quote = stream.prev();\n\n\tif (isQuote(quote)) {\n\t\twhile (!stream.sol()) {\n\t\t\tif (stream.prev() === quote && stream.peek() !== ESCAPE) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tstream.pos = start;\n\treturn false;\n}\n\nconst TAB = 9;\nconst SPACE = 32;\nconst SLASH = 47; // /\nconst COLON = 58; // :\nconst EQUALS = 61; // =\nconst ANGLE_LEFT = 60; // <\nconst ANGLE_RIGHT = 62; // >\n\n/**\n * Check if given reader’s current position points at the end of HTML tag\n * @param {StreamReader} stream\n * @return {Boolean}\n */\nvar isAtHTMLTag = function(stream) {\n\tconst start = stream.pos;\n\n\tif (!stream.eat(ANGLE_RIGHT)) {\n\t\treturn false;\n\t}\n\n\tlet ok = false;\n\tstream.eat(SLASH); // possibly self-closed element\n\n\twhile (!stream.sol()) {\n\t\tstream.eatWhile(isWhiteSpace);\n\n\t\tif (eatIdent(stream)) {\n\t\t\t// ate identifier: could be a tag name, boolean attribute or unquoted\n\t\t\t// attribute value\n\t\t\tif (stream.eat(SLASH)) {\n\t\t\t\t// either closing tag or invalid tag\n\t\t\t\tok = stream.eat(ANGLE_LEFT);\n\t\t\t\tbreak;\n\t\t\t} else if (stream.eat(ANGLE_LEFT)) {\n\t\t\t\t// opening tag\n\t\t\t\tok = true;\n\t\t\t\tbreak;\n\t\t\t} else if (stream.eat(isWhiteSpace)) {\n\t\t\t\t// boolean attribute\n\t\t\t\tcontinue;\n\t\t\t} else if (stream.eat(EQUALS)) {\n\t\t\t\t// simple unquoted value or invalid attribute\n\t\t\t\tok = eatIdent(stream);\n\t\t\t\tbreak;\n\t\t\t} else if (eatAttributeWithUnquotedValue(stream)) {\n\t\t\t\t// identifier was a part of unquoted value\n\t\t\t\tok = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// invalid tag\n\t\t\tbreak;\n\t\t}\n\n\t\tif (eatAttribute(stream)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tbreak;\n\t}\n\n\tstream.pos = start;\n\treturn ok;\n};\n\n/**\n * Eats HTML attribute from given string.\n * @param {StreamReader} state\n * @return {Boolean} `true` if attribute was consumed.\n */\nfunction eatAttribute(stream) {\n\treturn eatAttributeWithQuotedValue(stream) || eatAttributeWithUnquotedValue(stream);\n}\n\n/**\n * @param {StreamReader} stream\n * @return {Boolean}\n */\nfunction eatAttributeWithQuotedValue(stream) {\n\tconst start = stream.pos;\n\tif (eatQuoted(stream) && stream.eat(EQUALS) && eatIdent(stream)) {\n\t\treturn true;\n\t}\n\n\tstream.pos = start;\n\treturn false;\n}\n\n/**\n * @param {StreamReader} stream\n * @return {Boolean}\n */\nfunction eatAttributeWithUnquotedValue(stream) {\n\tconst start = stream.pos;\n\tif (stream.eatWhile(isUnquotedValue) && stream.eat(EQUALS) && eatIdent(stream)) {\n\t\treturn true;\n\t}\n\n\tstream.pos = start;\n\treturn false;\n}\n\n/**\n * Eats HTML identifier from stream\n * @param {StreamReader} stream\n * @return {Boolean}\n */\nfunction eatIdent(stream) {\n\treturn stream.eatWhile(isIdent);\n}\n\n/**\n * Check if given character code belongs to HTML identifier\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isIdent(c) {\n\treturn c === COLON || isAlpha(c) || isNumber(c);\n}\n\n/**\n * Check if given character code is alpha code (letter though A to Z)\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isAlpha(c) {\n\tc &= ~32; // quick hack to convert any char code to uppercase char code\n\treturn c >= 65 && c <= 90; // A-Z\n}\n\n/**\n * Check if given code is a number\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isNumber(c) {\n\treturn c > 47 && c < 58;\n}\n\n/**\n * Check if given code is a whitespace\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isWhiteSpace(c) {\n\treturn c === SPACE || c === TAB;\n}\n\n/**\n * Check if given code may belong to unquoted attribute value\n * @param {Number} c\n * @return {Boolean}\n */\nfunction isUnquotedValue(c) {\n\treturn c && c !== EQUALS && !isWhiteSpace(c) && !isQuote(c);\n}\n\nconst code = ch => ch.charCodeAt(0);\nconst SQUARE_BRACE_L = code('[');\nconst SQUARE_BRACE_R = code(']');\nconst ROUND_BRACE_L = code('(');\nconst ROUND_BRACE_R = code(')');\nconst CURLY_BRACE_L = code('{');\nconst CURLY_BRACE_R = code('}');\n\nconst specialChars = new Set('#.*:$-_!@%^+>/'.split('').map(code));\nconst bracePairs = new Map()\n.set(SQUARE_BRACE_L, SQUARE_BRACE_R)\n.set(ROUND_BRACE_L, ROUND_BRACE_R)\n.set(CURLY_BRACE_L, CURLY_BRACE_R);\n\n/**\n * Extracts Emmet abbreviation from given string.\n * The goal of this module is to extract abbreviation from current editor’s line,\n * e.g. like this: `<span>.foo[title=bar|]</span>` -> `.foo[title=bar]`, where\n * `|` is a current caret position.\n * @param {String} line A text line where abbreviation should be expanded\n * @param {Number} [pos] Caret position in line. If not given, uses end-of-line\n * @param {Boolean} [lookAhead] Allow parser to look ahead of `pos` index for\n * searching of missing abbreviation parts. Most editors automatically inserts\n * closing braces for `[`, `{` and `(`, which will most likely be right after\n * current caret position. So in order to properly expand abbreviation, user\n * must explicitly move caret right after auto-inserted braces. Whith this option\n * enabled, parser will search for closing braces right after `pos`. Default is `true`\n * @return {Object} Object with `abbreviation` and its `location` in given line\n * if abbreviation can be extracted, `null` otherwise\n */\nfunction extractAbbreviation(line, pos, lookAhead) {\n\t// make sure `pos` is within line range\n\tpos = Math.min(line.length, Math.max(0, pos == null ? line.length : pos));\n\n\tif (lookAhead == null || lookAhead === true) {\n\t\tpos = offsetPastAutoClosed(line, pos);\n\t}\n\n\tlet c;\n\tconst stream = new StreamReader(line);\n\tstream.pos = pos;\n\tconst stack = [];\n\n\twhile (!stream.sol()) {\n\t\tc = stream.peek();\n\n\t\tif (isCloseBrace(c)) {\n\t\t\tstack.push(c);\n\t\t} else if (isOpenBrace(c)) {\n\t\t\tif (stack.pop() !== bracePairs.get(c)) {\n\t\t\t\t// unexpected brace\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (has(stack, SQUARE_BRACE_R) || has(stack, CURLY_BRACE_R)) {\n\t\t\t// respect all characters inside attribute sets or text nodes\n\t\t\tstream.pos--;\n\t\t\tcontinue;\n\t\t} else if (isAtHTMLTag(stream) || !isAbbreviation(c)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tstream.pos--;\n\t}\n\n\tif (!stack.length && stream.pos !== pos) {\n\t\t// found something, remove some invalid symbols from the\n\t\t// beginning and return abbreviation\n\t\tconst abbreviation = line.slice(stream.pos, pos).replace(/^[\\*\\+\\>\\^]+/, '');\n\t\treturn {\n\t\t\tabbreviation,\n\t\t\tlocation: pos - abbreviation.length\n\t\t};\n\t}\n}\n\n/**\n * Returns new `line` index which is right after characters beyound `pos` that\n * edditor will likely automatically close, e.g. }, ], and quotes\n * @param {String} line\n * @param {Number} pos\n * @return {Number}\n */\nfunction offsetPastAutoClosed(line, pos) {\n\t// closing quote is allowed only as a next character\n\tif (isQuote(line.charCodeAt(pos))) {\n\t\tpos++;\n\t}\n\n\t// offset pointer until non-autoclosed character is found\n\twhile (isCloseBrace(line.charCodeAt(pos))) {\n\t\tpos++;\n\t}\n\n\treturn pos;\n}\n\nfunction has(arr, value) {\n\treturn arr.indexOf(value) !== -1;\n}\n\nfunction isAbbreviation(c) {\n\treturn (c > 64 && c < 91) // uppercase letter\n\t\t|| (c > 96 && c < 123) // lowercase letter\n\t\t|| (c > 47 && c < 58) // number\n\t\t|| specialChars.has(c); // special character\n}\n\nfunction isOpenBrace(c) {\n\treturn c === SQUARE_BRACE_L || c === ROUND_BRACE_L || c === CURLY_BRACE_L;\n}\n\nfunction isCloseBrace(c) {\n\treturn c === SQUARE_BRACE_R || c === ROUND_BRACE_R || c === CURLY_BRACE_R;\n}\n\nexport default extractAbbreviation;\n","var defaultOptions = {\n\t/**\n\t * String for one-level indentation\n\t * @type {String}\n\t */\n\tindent: '\\t',\n\n\t/**\n\t * Tag case: 'lower', 'upper' or '' (keep as-is)\n\t * @type {String}\n\t */\n\ttagCase: '',\n\n\t/**\n\t * Attribute name case: 'lower', 'upper' or '' (keep as-is)\n\t * @type {String}\n\t */\n\tattributeCase: '',\n\n\t/**\n\t * Attribute value quotes: 'single' or 'double'\n\t * @type {String}\n\t */\n\tattributeQuotes: 'double',\n\n\t/**\n\t * Enable output formatting (indentation and line breaks)\n\t * @type {Boolean}\n\t */\n\tformat: true,\n\n\t/**\n\t * A list of tag names that should not get inner indentation\n\t * @type {Set}\n\t */\n\tformatSkip: ['html'],\n\n\t/**\n\t * A list of tag names that should *always* get inner indentation.\n\t * @type {Set}\n\t */\n\tformatForce: ['body'],\n\n\t/**\n\t * How many inline sibling elements should force line break for each tag.\n\t * Set to 0 to output all inline elements without formatting.\n\t * Set to 1 to output all inline elements with formatting (same as block-level).\n\t * @type {Number}\n\t */\n\tinlineBreak: 3,\n\n\t/**\n\t * Produce compact notation of boolean attribues: attributes where name equals value.\n\t * With this option enabled, output `<div contenteditable>` instead of\n\t * `<div contenteditable=\"contenteditable\">`\n\t * @type {Boolean}\n\t */\n\tcompactBooleanAttributes: false,\n\n\t/**\n\t * A set of boolean attributes\n\t * @type {Set}\n\t */\n\tbooleanAttributes: ['contenteditable', 'seamless', 'async', 'autofocus',\n\t\t'autoplay', 'checked', 'controls', 'defer', 'disabled', 'formnovalidate',\n\t\t'hidden', 'ismap', 'loop', 'multiple', 'muted', 'novalidate', 'readonly',\n\t\t'required', 'reversed', 'selected', 'typemustmatch'],\n\n\t/**\n\t * Style of self-closing tags:\n\t * 'html' – <br>\n\t * 'xml' – <br/>\n\t * 'xhtml' – <br />\n\t * @type {String}\n\t */\n\tselfClosingStyle: 'html',\n\n\t/**\n\t * A set of inline-level elements\n\t * @type {Set}\n\t */\n\tinlineElements: ['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo',\n\t\t'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i',\n\t\t'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'object', 'q',\n\t\t's', 'samp', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup',\n\t\t'textarea', 'tt', 'u', 'var']\n};\n\n/**\n * Creates output profile for given options (@see defaults)\n * @param {defaults} options\n */\nclass Profile {\n constructor(options) {\n this.options = Object.assign({}, defaultOptions, options);\n this.quoteChar = this.options.attributeQuotes === 'single' ? '\\'' : '\"';\n }\n\n\t/**\n\t * Returns value of given option name\n\t * @param {String} name\n\t * @return {*}\n\t */\n\tget(name) {\n\t\treturn this.options[name];\n\t}\n\n /**\n * Quote given string according to profile\n * @param {String} str String to quote\n * @return {String}\n */\n quote(str) {\n return `${this.quoteChar}${str != null ? str : ''}${this.quoteChar}`;\n }\n\n /**\n * Output given tag name accoding to options\n * @param {String} name\n * @return {String}\n */\n name(name) {\n return strcase(name, this.options.tagCase);\n }\n\n\t/**\n\t * Outputs attribute name accoding to current settings\n\t * @param {String} Attribute name\n\t * @return {String}\n\t */\n attribute(attr) {\n return strcase(attr, this.options.attributeCase);\n }\n\n /**\n * Check if given attribute is boolean\n * @param {Attribute} attr\n * @return {Boolean}\n */\n isBooleanAttribute(attr) {\n return attr.options.boolean\n\t\t\t|| this.get('booleanAttributes').indexOf((attr.name || '').toLowerCase()) !== -1;\n }\n\n\t/**\n\t * Returns a token for self-closing tag, depending on current options\n\t * @return {String}\n\t */\n\tselfClose() {\n\t\tswitch (this.options.selfClosingStyle) {\n\t\t\tcase 'xhtml': return ' /';\n\t\t\tcase 'xml': return '/';\n\t\t\tdefault: return '';\n\t\t}\n\t}\n\n\t/**\n\t * Returns indent for given level\n\t * @param {Number} level Indentation level\n\t * @return {String}\n\t */\n\tindent(level) {\n\t\tlevel = level || 0;\n\t\tlet output = '';\n\t\twhile (level--) {\n\t\t\toutput += this.options.indent;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Check if given tag name belongs to inline-level element\n\t * @param {Node|String} node Parsed node or tag name\n\t * @return {Boolean}\n\t */\n\tisInline(node) {\n if (typeof node === 'string') {\n return this.get('inlineElements').indexOf(node.toLowerCase()) !== -1;\n }\n\n // inline node is a node either with inline-level name or text-only node\n return node.name != null ? this.isInline(node.name) : node.isTextOnly;\n\t}\n\n\t/**\n\t * Outputs formatted field for given params\n\t * @param {Number} index Field index\n\t * @param {String} [placeholder] Field placeholder, can be empty\n\t * @return {String}\n\t */\n\tfield(index, placeholder) {\n\t\treturn this.options.field(index, placeholder);\n\t}\n}\n\nfunction strcase(string, type) {\n if (type) {\n string = type === 'upper' ? string.toUpperCase() : string.toLowerCase();\n }\n return string;\n}\n\nexport default Profile;\n","/**\n * Attribute descriptor of parsed abbreviation node\n * @param {String} name Attribute name\n * @param {String} value Attribute value\n * @param {Object} options Additional custom attribute options\n * @param {Boolean} options.boolean Attribute is boolean (e.g. name equals value)\n * @param {Boolean} options.implied Attribute is implied (e.g. must be outputted\n * only if contains non-null value)\n */\nclass Attribute {\n\tconstructor(name, value, options) {\n\t\tthis.name = name;\n\t\tthis.value = value != null ? value : null;\n\t\tthis.options = options || {};\n\t}\n\n\t/**\n\t * Create a copy of current attribute\n\t * @return {Attribute}\n\t */\n\tclone() {\n\t\treturn new Attribute(this.name, this.value, Object.assign({}, this.options));\n\t}\n\n\t/**\n\t * A string representation of current node\n\t */\n\tvalueOf() {\n\t\treturn `${this.name}=\"${this.value}\"`;\n\t}\n}\n\n/**\n * A parsed abbreviation AST node. Nodes build up an abbreviation AST tree\n */\nclass Node {\n\t/**\n\t * Creates a new node\n\t * @param {String} [name] Node name\n\t * @param {Array} [attributes] Array of attributes to add\n\t */\n\tconstructor(name, attributes) {\n\t\t// own properties\n\t\tthis.name = name || null;\n\t\tthis.value = null;\n\t\tthis.repeat = null;\n\t\tthis.selfClosing = false;\n\n\t\tthis.children = [];\n\n\t\t/** @type {Node} Pointer to parent node */\n\t\tthis.parent = null;\n\n\t\t/** @type {Node} Pointer to next sibling */\n\t\tthis.next = null;\n\n\t\t/** @type {Node} Pointer to previous sibling */\n\t\tthis.previous = null;\n\n\t\tthis._attributes = [];\n\n\t\tif (Array.isArray(attributes)) {\n\t\t\tattributes.forEach(attr => this.setAttribute(attr));\n\t\t}\n\t}\n\n\t/**\n\t * Array of current node attributes\n\t * @return {Attribute[]} Array of attributes\n\t */\n\tget attributes() {\n\t\treturn this._attributes;\n\t}\n\n\t/**\n\t * A shorthand to retreive node attributes as map\n\t * @return {Object}\n\t */\n\tget attributesMap() {\n\t\treturn this.attributes.reduce((out, attr) => {\n\t\t\tout[attr.name] = attr.options.boolean ? attr.name : attr.value;\n\t\t\treturn out;\n\t\t}, {});\n\t}\n\n\t/**\n\t * Check if current node is a grouping one, e.g. has no actual representation\n\t * and is used for grouping subsequent nodes only\n\t * @return {Boolean}\n\t */\n\tget isGroup() {\n\t\treturn !this.name && !this.value && !this._attributes.length;\n\t}\n\n\t/**\n\t * Check if given node is a text-only node, e.g. contains only value\n\t * @return {Boolean}\n\t */\n\tget isTextOnly() {\n\t\treturn !this.name && !!this.value && !this._attributes.length;\n\t}\n\n\t/**\n\t * Returns first child node\n\t * @return {Node}\n\t */\n\tget firstChild() {\n\t\treturn this.children[0];\n\t}\n\n\t/**\n\t * Returns last child of current node\n\t * @return {Node}\n\t */\n\tget lastChild() {\n\t\treturn this.children[this.children.length - 1];\n\t}\n\n\t/**\n\t * Return index of current node in its parent child list\n\t * @return {Number} Returns -1 if current node is a root one\n\t */\n\tget childIndex() {\n\t\treturn this.parent ? this.parent.children.indexOf(this) : -1;\n\t}\n\n\t/**\n\t * Returns next sibling of current node\n\t * @return {Node}\n\t */\n\tget nextSibling() {\n\t\treturn this.next;\n\t}\n\n\t/**\n\t * Returns previous sibling of current node\n\t * @return {Node}\n\t */\n\tget previousSibling() {\n\t\treturn this.previous;\n\t}\n\n\t/**\n\t * Returns array of unique class names in current node\n\t * @return {String[]}\n\t */\n\tget classList() {\n\t\tconst attr = this.getAttribute('class');\n\t\treturn attr && attr.value\n\t\t\t? attr.value.split(/\\s+/g).filter(uniqueClass)\n\t\t\t: [];\n\t}\n\n\t/**\n\t * Convenient alias to create a new node instance\n\t * @param {String} [name] Node name\n\t * @param {Object} [attributes] Attributes hash\n\t * @return {Node}\n\t */\n\tcreate(name, attributes) {\n\t\treturn new Node(name, attributes);\n\t}\n\n\t/**\n\t * Sets given attribute for current node\n\t * @param {String|Object|Attribute} name Attribute name or attribute object\n\t * @param {String} [value] Attribute value\n\t */\n\tsetAttribute(name, value) {\n\t\tconst attr = createAttribute(name, value);\n\t\tconst curAttr = this.getAttribute(name);\n\t\tif (curAttr) {\n\t\t\tthis.replaceAttribute(curAttr, attr);\n\t\t} else {\n\t\t\tthis._attributes.push(attr);\n\t\t}\n\t}\n\n\t/**\n\t * Check if attribute with given name exists in node\n\t * @param {String} name\n\t * @return {Boolean}\n\t */\n\thasAttribute(name) {\n\t\treturn !!this.getAttribute(name);\n\t}\n\n\t/**\n\t * Returns attribute object by given name\n\t * @param {String} name\n\t * @return {Attribute}\n\t */\n\tgetAttribute(name) {\n\t\tif (typeof name === 'object') {\n\t\t\tname = name.name;\n\t\t}\n\n\t\tfor (var i = 0; i < this._attributes.length; i++) {\n\t\t\tconst attr = this._attributes[i];\n\t\t\tif (attr.name === name) {\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Replaces attribute with new instance\n\t * @param {String|Attribute} curAttribute Current attribute name or instance\n\t * to replace\n\t * @param {String|Object|Attribute} newName New attribute name or attribute object\n\t * @param {String} [newValue] New attribute value\n\t */\n\treplaceAttribute(curAttribute, newName, newValue) {\n\t\tif (typeof curAttribute === 'string') {\n\t\t\tcurAttribute = this.getAttribute(curAttribute);\n\t\t}\n\n\t\tconst ix = this._attributes.indexOf(curAttribute);\n\t\tif (ix !== -1) {\n\t\t\tthis._attributes.splice(ix, 1, createAttribute(newName, newValue));\n\t\t}\n\t}\n\n\t/**\n\t * Removes attribute with given name\n\t * @param {String|Attribute} attr Atrtibute name or instance\n\t */\n\tremoveAttribute(attr) {\n\t\tif (typeof attr === 'string') {\n\t\t\tattr = this.getAttribute(attr);\n\t\t}\n\n\t\tconst ix = this._attributes.indexOf(attr);\n\t\tif (ix !== -1) {\n\t\t\tthis._attributes.splice(ix, 1);\n\t\t}\n\t}\n\n\t/**\n\t * Removes all attributes from current node\n\t */\n\tclearAttributes() {\n\t\tthis._attributes.length = 0;\n\t}\n\n\t/**\n\t * Adds given class name to class attribute\n\t * @param {String} token Class name token\n\t */\n\taddClass(token) {\n\t\ttoken = normalize(token);\n\n\t\tif (!this.hasAttribute('class')) {\n\t\t\tthis.setAttribute('class', token);\n\t\t} else if (token && !this.hasClass(token)) {\n\t\t\tthis.setAttribute('class', this.classList.concat(token).join(' '));\n\t\t}\n\t}\n\n\t/**\n\t * Check if current node contains given class name\n\t * @param {String} token Class name token\n\t * @return {Boolean}\n\t */\n\thasClass(token) {\n\t\treturn this.classList.indexOf(normalize(token)) !== -1;\n\t}\n\n\t/**\n\t * Removes given class name from class attribute\n\t * @param {String} token Class name token\n\t */\n\tremoveClass(token) {\n\t\ttoken = normalize(token);\n\t\tif (this.hasClass(token)) {\n\t\t\tthis.setAttribute('class', this.classList.filter(name => name !== token).join(' '));\n\t\t}\n\t}\n\n\t/**\n\t * Appends child to current node\n\t * @param {Node} node\n\t */\n\tappendChild(node) {\n\t\tthis.insertAt(node, this.children.length);\n\t}\n\n\t/**\n\t * Inserts given `newNode` before `refNode` child node\n\t * @param {Node} newNode\n\t * @param {Node} refNode\n\t */\n\tinsertBefore(newNode, refNode) {\n\t\tthis.insertAt(newNode, this.children.indexOf(refNode));\n\t}\n\n\t/**\n\t * Insert given `node` at `pos` position of child list\n\t * @param {Node} node\n\t * @param {Number} pos\n\t */\n\tinsertAt(node, pos) {\n\t\tif (pos < 0 || pos > this.children.length) {\n\t\t\tthrow new Error('Unable to insert node: position is out of child list range');\n\t\t}\n\n\t\tconst prev = this.children[pos - 1];\n\t\tconst next = this.children[pos];\n\n\t\tnode.remove();\n\t\tnode.parent = this;\n\t\tthis.children.splice(pos, 0, node);\n\n\t\tif (prev) {\n\t\t\tnode.previous = prev;\n\t\t\tprev.next = node;\n\t\t}\n\n\t\tif (next) {\n\t\t\tnode.next = next;\n\t\t\tnext.previous = node;\n\t\t}\n\t}\n\n\t/**\n\t * Removes given child from current node\n\t * @param {Node} node\n\t */\n\tremoveChild(node) {\n\t\tconst ix = this.children.indexOf(node);\n\t\tif (ix !== -1) {\n\t\t\tthis.children.splice(ix, 1);\n\t\t\tif (node.previous) {\n\t\t\t\tnode.previous.next = node.next;\n\t\t\t}\n\n\t\t\tif (node.next) {\n\t\t\t\tnode.next.previous = node.previous;\n\t\t\t}\n\n\t\t\tnode.parent = node.next = node.previous = null;\n\t\t}\n\t}\n\n\t/**\n\t * Removes current node from its parent\n\t */\n\tremove() {\n\t\tif (this.parent) {\n\t\t\tthis.parent.removeChild(this);\n\t\t}\n\t}\n\n\t/**\n\t * Creates a detached copy of current node\n\t * @param {Boolean} deep Clone node contents as well\n\t * @return {Node}\n\t */\n\tclone(deep) {\n\t\tconst clone = new Node(this.name);\n\t\tclone.value = this.value;\n\t\tclone.selfClosing = this.selfClosing;\n\t\tif (this.repeat) {\n\t\t\tclone.repeat = Object.assign({}, this.repeat);\n\t\t}\n\n\t\tthis._attributes.forEach(attr => clone.setAttribute(attr.clone()));\n\n\t\tif (deep) {\n\t\t\tthis.children.forEach(child => clone.appendChild(child.clone(true)));\n\t\t}\n\n\t\treturn clone;\n\t}\n\n\t/**\n\t * Walks on each descendant node and invokes given `fn` function on it.\n\t * The function receives two arguments: the node itself and its depth level\n\t * from current node. If function returns `false`, it stops walking\n\t * @param {Function} fn\n\t */\n\twalk(fn, _level) {\n\t\t_level = _level || 0;\n\t\tlet ctx = this.firstChild;\n\n\t\twhile (ctx) {\n\t\t\t// in case if context node will be detached during `fn` call\n\t\t\tconst next = ctx.next;\n\n\t\t\tif (fn(ctx, _level) === false || ctx.walk(fn, _level + 1) === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tctx = next;\n\t\t}\n\t}\n\n\t/**\n\t * A helper method for transformation chaining: runs given `fn` function on\n\t * current node and returns the same node\n\t */\n\tuse(fn) {\n\t\tconst args = [this];\n\t\tfor (var i = 1; i < arguments.length; i++) {\n\t\t\targs.push(arguments[i]);\n\t\t}\n\n\t\tfn.apply(null, args);\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst attrs = this.attributes.map(attr => {\n\t\t\tattr = this.getAttribute(attr.name);\n\t\t\tconst opt = attr.options;\n\t\t\tlet out = `${opt && opt.implied ? '!' : ''}${attr.name || ''}`;\n\t\t\tif (opt && opt.boolean) {\n\t\t\t\tout += '.';\n\t\t\t} else if (attr.value != null) {\n\t\t\t\tout += `=\"${attr.value}\"`;\n\t\t\t}\n\t\t\treturn out;\n\t\t});\n\n\t\tlet out = `${this.name || ''}`;\n\t\tif (attrs.length) {\n\t\t\tout += `[${attrs.join(' ')}]`;\n\t\t}\n\n\t\tif (this.value != null) {\n\t\t\tout += `{${this.value}}`;\n\t\t}\n\n\t\tif (this.selfClosing) {\n\t\t\tout += '/';\n\t\t}\n\n\t\tif (this.repeat) {\n\t\t\tout += `*${this.repeat.count ? this.repeat.count : ''}`;\n\t\t\tif (this.repeat.value != null) {\n\t\t\t\tout += `@${this.repeat.value}`;\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n\n/**\n * Attribute factory\n * @param {String|Attribute|Object} name Attribute name or attribute descriptor\n * @param {*} value Attribute value\n * @return {Attribute}\n */\nfunction createAttribute(name, value) {\n\tif (name instanceof Attribute) {\n\t\treturn name;\n\t}\n\n\tif (typeof name === 'string') {\n\t\treturn new Attribute(name, value);\n\t}\n\n\tif (name && typeof name === 'object') {\n\t\treturn new Attribute(name.name, name.value, name.options);\n\t}\n}\n\n/**\n * @param {String} str\n * @return {String}\n */\nfunction normalize(str) {\n\treturn String(str).trim();\n}\n\nfunction uniqueClass(item, i, arr) {\n\treturn item && arr.indexOf(item) === i;\n}\n\nexport default Node;\n","/**\n * Methods for consuming quoted values\n */\n\nconst SINGLE_QUOTE = 39; // '\nconst DOUBLE_QUOTE = 34; // \"\n\nconst defaultOptions = {\n\tescape: 92, // \\ character\n\tthrows: false\n};\n\n/**\n * Consumes 'single' or \"double\"-quoted string from given string, if possible\n * @param {StreamReader} stream\n * @param {Number} options.escape A character code of quote-escape symbol\n * @param {Boolean} options.throws Throw error if quotes string can’t be properly consumed\n * @return {Boolean} `true` if quoted string was consumed. The contents\n * of quoted string will be availabe as `stream.current()`\n */\nvar eatQuoted = function(stream, options) {\n\toptions = options ? Object.assign({}, defaultOptions, options) : defaultOptions;\n\tconst start = stream.pos;\n\tconst quote = stream.peek();\n\n\tif (stream.eat(isQuote)) {\n\t\twhile (!stream.eof()) {\n\t\t\tswitch (stream.next()) {\n\t\t\t\tcase quote:\n\t\t\t\t\tstream.start = start;\n\t\t\t\t\treturn true;\n\n\t\t\t\tcase options.escape:\n\t\t\t\t\tstream.next();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we’re here then stream wasn’t properly consumed.\n\t\t// Revert stream and decide what to do\n\t\tstream.pos = start;\n\n\t\tif (options.throws) {\n\t\t\tthrow stream.error('Unable to consume quoted string');\n\t\t}\n\t}\n\n\treturn false;\n};\n\nfunction isQuote(code) {\n\treturn code === SINGLE_QUOTE || code === DOUBLE_QUOTE;\n}\n\n/**\n * Check if given code is a number\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isNumber(code) {\n\treturn code > 47 && code < 58;\n}\n\n/**\n * Check if given character code is alpha code (letter through A to Z)\n * @param {Number} code\n * @param {Number} [from]\n * @param {Number} [to]\n * @return {Boolean}\n */\nfunction isAlpha(code, from, to) {\n\tfrom = from || 65; // A\n\tto = to || 90; // Z\n\tcode &= ~32; // quick hack to convert any char code to uppercase char code\n\n\treturn code >= from && code <= to;\n}\n\n/**\n * Check if given character code is alpha-numeric (letter through A to Z or number)\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isAlphaNumeric(code) {\n\treturn isNumber(code) || isAlpha(code);\n}\n\nfunction isWhiteSpace(code) {\n\treturn code === 32 /* space */\n\t\t|| code === 9 /* tab */\n\t\t|| code === 160; /* non-breaking space */\n}\n\n/**\n * Check if given character code is a space\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isSpace(code) {\n\treturn isWhiteSpace(code)\n\t\t|| code === 10 /* LF */\n\t\t|| code === 13; /* CR */\n}\n\nconst defaultOptions$1 = {\n\tescape: 92, // \\ character\n\tthrows: false\n};\n\n/**\n * Eats paired characters substring, for example `(foo)` or `[bar]`\n * @param {StreamReader} stream\n * @param {Number} open Character code of pair openinig\n * @param {Number} close Character code of pair closing\n * @param {Object} [options]\n * @return {Boolean} Returns `true` if chacarter pair was successfully\n * consumed, it’s content will be available as `stream.current()`\n */\nfunction eatPair(stream, open, close, options) {\n\toptions = options ? Object.assign({}, defaultOptions$1, options) : defaultOptions$1;\n\tconst start = stream.pos;\n\n\tif (stream.eat(open)) {\n\t\tlet stack = 1, ch;\n\n\t\twhile (!stream.eof()) {\n\t\t\tif (eatQuoted(stream, options)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tch = stream.next();\n\t\t\tif (ch === open) {\n\t\t\t\tstack++;\n\t\t\t} else if (ch === close) {\n\t\t\t\tstack--;\n\t\t\t\tif (!stack) {\n\t\t\t\t\tstream.start = start;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (ch === options.escape) {\n\t\t\t\tstream.next();\n\t\t\t}\n\t\t}\n\n\t\t// If we’re here then paired character can’t be consumed\n\t\tstream.pos = start;\n\n\t\tif (options.throws) {\n\t\t\tthrow stream.error(`Unable to find matching pair for ${String.fromCharCode(open)}`);\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport { eatQuoted, isQuote, isAlpha, isNumber, isAlphaNumeric, isSpace, isWhiteSpace, eatPair };\n","import Node from '@emmetio/node';\nimport StreamReader from '@emmetio/stream-reader';\nimport { eatPair, eatQuoted, isAlphaNumeric, isNumber, isQuote, isSpace, isWhiteSpace } from '@emmetio/stream-reader-utils';\n\nconst ASTERISK = 42; // *\n\n/**\n * Consumes node repeat token from current stream position and returns its\n * parsed value\n * @param {StringReader} stream\n * @return {Object}\n */\nvar consumeRepeat = function(stream) {\n\tif (stream.eat(ASTERISK)) {\n\t\tstream.start = stream.pos;\n\n\t\t// XXX think about extending repeat syntax with through numbering\n\t\treturn { count: stream.eatWhile(isNumber) ? +stream.current() : null };\n\t}\n};\n\nconst opt = { throws: true };\n\n/**\n * Consumes quoted literal from current stream position and returns it’s inner,\n * unquoted, value\n * @param {StringReader} stream\n * @return {String} Returns `null` if unable to consume quoted value from current\n * position\n */\nvar consumeQuoted = function(stream) {\n\tif (eatQuoted(stream, opt)) {\n\t\treturn stream.current().slice(1, -1);\n\t}\n};\n\nconst LCURLY = 123; // {\nconst RCURLY = 125; // }\n\nconst opt$1 = { throws: true };\n\n/**\n * Consumes text node, e.g. contents of `{...}` and returns its inner value\n * @param {StringReader} stream\n * @return {String} Consumed text content or `null` otherwise\n */\nvar consumeTextNode = function(stream) {\n\treturn eatPair(stream, LCURLY, RCURLY, opt$1)\n\t\t? stream.current().slice(1, -1)\n\t\t: null;\n};\n\nconst EXCL = 33; // .\nconst DOT$1 = 46; // .\nconst EQUALS = 61; // =\nconst ATTR_OPEN = 91; // [\nconst ATTR_CLOSE = 93; // ]\n\nconst reAttributeName = /^\\!?[\\w\\-:\\$@]+\\.?$/;\n\n/**\n * Consumes attributes defined in square braces from given stream.\n * Example:\n * [attr col=3 title=\"Quoted string\" selected. support={react}]\n * @param {StringReader} stream\n * @returns {Array} Array of consumed attributes\n */\nvar consumeAttributes = function(stream) {\n\tif (!stream.eat(ATTR_OPEN)) {\n\t\treturn null;\n\t}\n\n\tconst result = [];\n\tlet token, attr;\n\n\twhile (!stream.eof()) {\n\t\tstream.eatWhile(isWhiteSpace);\n\n\t\tif (stream.eat(ATTR_CLOSE)) {\n\t\t\treturn result; // End of attribute set\n\t\t} else if ((token = consumeQuoted(stream)) != null) {\n\t\t\t// Consumed quoted value: anonymous attribute\n\t\t\tresult.push({\n\t\t\t\tname: null,\n\t\t\t\tvalue: token\n\t\t\t});\n\t\t} else if (eatUnquoted(stream)) {\n\t\t\t// Consumed next word: could be either attribute name or unquoted default value\n\t\t\ttoken = stream.current();\n\t\t\tif (!reAttributeName.test(token)) {\n\t\t\t\t// anonymous attribute\n\t\t\t\tresult.push({ name: null, value: token });\n\t\t\t} else {\n\t\t\t\t// Looks like a regular attribute\n\t\t\t\tattr = parseAttributeName(token);\n\t\t\t\tresult.push(attr);\n\n\t\t\t\tif (stream.eat(EQUALS)) {\n\t\t\t\t\t// Explicitly defined value. Could be a word, a quoted string\n\t\t\t\t\t// or React-like expression\n\t\t\t\t\tif ((token = consumeQuoted(stream)) != null) {\n\t\t\t\t\t\tattr.value = token;\n\t\t\t\t\t} else if ((token = consumeTextNode(stream)) != null) {\n\t\t\t\t\t\tattr.value = token;\n\t\t\t\t\t\tattr.options = {\n\t\t\t\t\t\t\tbefore: '{',\n\t\t\t\t\t\t\tafter: '}'\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (eatUnquoted(stream)) {\n\t\t\t\t\t\tattr.value = stream.current();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow stream.error('Expected attribute name');\n\t\t}\n\t}\n\n\tthrow stream.error('Expected closing \"]\" brace');\n};\n\nfunction parseAttributeName(name) {\n\tconst options = {};\n\n\t// If a first character in attribute name is `!` — it’s an implied\n\t// default attribute\n\tif (name.charCodeAt(0) === EXCL) {\n\t\tname = name.slice(1);\n\t\toptions.implied = true;\n\t}\n\n\t// Check for last character: if it’s a `.`, user wants boolean attribute\n\tif (name.charCodeAt(name.length - 1) === DOT$1) {\n\t\tname = name.slice(0, name.length - 1);\n\t\toptions.boolean = true;\n\t}\n\n\tconst attr = { name };\n\tif (Object.keys(options).length) {\n\t\tattr.options = options;\n\t}\n\n\treturn attr;\n}\n\n/**\n * Eats token that can be an unquoted value from given stream\n * @param {StreamReader} stream\n * @return {Boolean}\n */\nfunction eatUnquoted(stream) {\n\tconst start = stream.pos;\n\tif (stream.eatWhile(isUnquoted)) {\n\t\tstream.start = start;\n\t\treturn true;\n\t}\n}\n\nfunction isUnquoted(code) {\n\treturn !isSpace(code) && !isQuote(code)\n\t\t&& code !== ATTR_OPEN && code !== ATTR_CLOSE && code !== EQUALS;\n}\n\nconst HASH = 35; // #\nconst DOT = 46; // .\nconst SLASH = 47; // /\n\n/**\n * Consumes a single element node from current abbreviation stream\n * @param {StringReader} stream\n * @return {Node}\n */\nvar consumeElement = function(stream) {\n\t// consume element name, if provided\n\tconst start = stream.pos;\n\tconst node = new Node(eatName(stream));\n\tlet next;\n\n\twhile (!stream.eof()) {\n\t\tif (stream.eat(DOT)) {\n\t\t\tnode.addClass(eatName(stream));\n\t\t} else if (stream.eat(HASH)) {\n\t\t\tnode.setAttribute('id', eatName(stream));\n\t\t} else if (stream.eat(SLASH)) {\n\t\t\t// A self-closing indicator must be at the end of non-grouping node\n\t\t\tif (node.isGroup) {\n\t\t\t\tstream.backUp(1);\n\t\t\t\tthrow stream.error('Unexpected self-closing indicator');\n\t\t\t}\n\t\t\tnode.selfClosing = true;\n\t\t\tif (next = consumeRepeat(stream)) {\n\t\t\t\tnode.repeat = next;\n\t\t\t}\n\t\t\tbreak;\n\t\t} else if (next = consumeAttributes(stream)) {\n\t\t\tfor (let i = 0, il = next.length; i < il; i++) {\n\t\t\t\tnode.setAttribute(next[i]);\n\t\t\t}\n\t\t} else if ((next = consumeTextNode(stream)) !== null) {\n\t\t\tnode.value = next;\n\t\t} else if (next = consumeRepeat(stream)) {\n\t\t\tnode.repeat = next;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (start === stream.pos) {\n\t\tthrow stream.error(`Unable to consume abbreviation node, unexpected ${stream.peek()}`);\n\t}\n\n\treturn node;\n};\n\nfunction eatName(stream) {\n\tstream.start = stream.pos;\n\tstream.eatWhile(isName);\n\treturn stream.current();\n}\n\nfunction isName(code) {\n\treturn isAlphaNumeric(code)\n\t\t|| code === 45 /* - */\n\t\t|| code === 58 /* : */\n\t\t|| code === 36 /* $ */\n\t\t|| code === 64 /* @ */\n\t\t|| code === 33 /* ! */\n\t\t|| code === 95 /* _ */\n\t\t|| code === 37 /* % */;\n}\n\nconst GROUP_START = 40; // (\nconst GROUP_END = 41; // )\nconst OP_SIBLING = 43; // +\nconst OP_CHILD = 62; // >\nconst OP_CLIMB = 94; // ^\n\n/**\n * Parses given string into a node tree\n * @param {String} str Abbreviation to parse\n * @return {Node}\n */\nfunction parse(str) {\n\tconst stream = new StreamReader(str.trim());\n\tconst root = new Node();\n\tlet ctx = root, groupStack = [], ch;\n\n\twhile (!stream.eof()) {\n\t\tch = stream.peek();\n\n\t\tif (ch === GROUP_START) { // start of group\n\t\t\t// The grouping node should be detached to properly handle\n\t\t\t// out-of-bounds `^` operator. Node will be attached right on group end\n\t\t\tconst node = new Node();\n\t\t\tconst groupCtx = groupStack.length ? last(groupStack)[0] : ctx;\n\t\t\tgroupStack.push([node, groupCtx, stream.pos]);\n\t\t\tctx = node;\n\t\t\tstream.next();\n\t\t\tcontinue;\n\t\t} else if (ch === GROUP_END) { // end of group\n\t\t\tconst lastGroup = groupStack.pop();\n\t\t\tif (!lastGroup) {\n\t\t\t\tthrow stream.error('Unexpected \")\" group end');\n\t\t\t}\n\n\t\t\tconst node = lastGroup[0];\n\t\t\tctx = lastGroup[1];\n\t\t\tstream.next();\n\n\t\t\t// a group can have a repeater\n\t\t\tif (node.repeat = consumeRepeat(stream)) {\n\t\t\t\tctx.appendChild(node);\n\t\t\t} else {\n\t\t\t\t// move all children of group into parent node\n\t\t\t\twhile (node.firstChild) {\n\t\t\t\t\tctx.appendChild(node.firstChild);\n\t\t\t\t}\n\t\t\t\t// for convenience, groups can be joined with optional `+` operator\n\t\t\t\tstream.eat(OP_SIBLING);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst node = consumeElement(stream);\n\t\tctx.appendChild(node);\n\n\t\tif (stream.eof()) {\n\t\t\tbreak;\n\t\t}\n\n\t\tswitch (stream.peek()) {\n\t\t\tcase OP_SIBLING:\n\t\t\t\tstream.next();\n\t\t\t\tcontinue;\n\n\t\t\tcase OP_CHILD:\n\t\t\t\tstream.next();\n\t\t\t\tctx = node;\n\t\t\t\tcontinue;\n\n\t\t\tcase OP_CLIMB:\n\t\t\t\t// it’s perfectly valid to have multiple `^` operators\n\t\t\t\twhile (stream.eat(OP_CLIMB)) {\n\t\t\t\t\tctx = ctx.parent || ctx;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tif (groupStack.length) {\n\t\tstream.pos = groupStack.pop()[2];\n\t\tthrow stream.error('Expected group close');\n\t}\n\n\treturn root;\n}\n\nfunction last(arr) {\n\treturn arr[arr.length - 1];\n}\n\n/**\n * Parses given abbreviation and un-rolls it into a full tree: recursively\n * replaces repeated elements with actual nodes\n * @param {String} abbr\n * @return {Node}\n */\nvar index = function(abbr) {\n\tconst tree = parse(abbr);\n\ttree.walk(unroll);\n\treturn tree;\n};\n\nfunction unroll(node) {\n\tif (!node.repeat || !node.repeat.count) {\n\t\treturn;\n\t}\n\n\tfor (let i = 1; i < node.repeat.count; i++) {\n\t\tconst clone = node.clone(true);\n\t\tclone.repeat.value = i;\n\t\tclone.walk(unroll);\n\t\tnode.parent.insertBefore(clone, node);\n\t}\n\n\tnode.repeat.value = node.repeat.count;\n}\n\nexport default index;\n","import parse from '@emmetio/abbreviation';\n\n/**\n * For every node in given `tree`, finds matching snippet from `registry` and\n * resolves it into a parsed abbreviation. Resolved node is then updated or\n * replaced with matched abbreviation tree.\n *\n * A HTML registry basically contains aliases to another Emmet abbreviations,\n * e.g. a predefined set of name, attribues and so on, possibly a complex\n * abbreviation with multiple elements. So we have to get snippet, parse it\n * and recursively resolve it.\n *\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {SnippetsRegistry} registry Registry with all available snippets\n * @return {Node} Updated tree\n */\n\nvar index = function(tree, registry) {\n tree.walk(node => resolveNode(node, registry));\n return tree;\n};\n\nfunction resolveNode(node, registry) {\n const stack = new Set();\n const resolve = node => {\n const snippet = registry.resolve(node.name);\n // A snippet in stack means circular reference.\n // It can be either a user error or a perfectly valid snippet like\n // \"img\": \"img[src alt]/\", e.g. an element with predefined shape.\n // In any case, simply stop parsing and keep element as is\n if (!snippet || stack.has(snippet)) {\n return;\n }\n\n // In case if matched snippet is a function, pass control into it\n if (typeof snippet.value === 'function') {\n return snippet.value(node, registry, resolve);\n }\n\n const tree = parse(snippet.value);\n\n stack.add(snippet);\n tree.walk(resolve);\n stack.delete(snippet);\n\n // move current node contents into new tree\n const childTarget = findDeepestNode(tree);\n merge(childTarget, node);\n\n while (tree.firstChild) {\n node.parent.insertBefore(tree.firstChild, node);\n }\n\n childTarget.parent.insertBefore(node, childTarget);\n childTarget.remove();\n };\n\n resolve(node);\n}\n\n/**\n * Adds data from first node into second node and returns it\n * @param {Node} from\n * @param {Node} to\n * @return {Node}\n */\nfunction merge(from, to) {\n to.name = from.name;\n\n if (from.selfClosing) {\n to.selfClosing = true;\n }\n\n if (from.value != null) {\n to.value = from.value;\n }\n\n if (from.repeat) {\n to.repeat = Object.assign({}, from.repeat);\n }\n\n return mergeAttributes(from, to);\n}\n\n/**\n * Transfer attributes from first element to second one and preserve first\n * element’s attributes order\n * @param {Node} from\n * @param {Node} to\n * @return {Node}\n */\nfunction mergeAttributes(from, to) {\n mergeClassNames(from, to);\n\n // It’s important to preserve attributes order: ones in `from` have higher\n // pripority than in `to`. Collect attributes in map in order they should\n // appear in `to`\n const attrMap = new Map();\n\n let attrs = from.attributes;\n for (let i = 0; i < attrs.length; i++) {\n attrMap.set(attrs[i].name, attrs[i].clone());\n }\n\n attrs = to.attributes.slice();\n for (let i = 0, attr, a; i < attrs.length; i++) {\n attr = attrs[i];\n if (attrMap.has(attr.name)) {\n a = attrMap.get(attr.name);\n a.value = attr.value;\n\n // If user explicitly wrote attribute in abbreviation, it’s no longer\n // implied and should be outputted even if value is empty\n if (a.options.implied) {\n a.options.implied = false;\n }\n } else {\n attrMap.set(attr.name, attr);\n }\n\n to.removeAttribute(attr);\n }\n\n const newAttrs = Array.from(attrMap.values());\n for (let i = 0; i < newAttrs.length; i++) {\n to.setAttribute(newAttrs[i]);\n }\n\n return to;\n}\n\n/**\n * Adds class names from first node to second one\n * @param {Node} from\n * @param {Node} to\n * @return {Node}\n */\nfunction mergeClassNames(from, to) {\n const classNames = from.classList;\n for (let i = 0; i < classNames.length; i++) {\n to.addClass(classNames[i]);\n }\n\n return to;\n}\n\n/**\n * Finds node which is the deepest for in current node or node iteself.\n * @param {Node} node\n * @return {Node}\n */\nfunction findDeepestNode(node) {\n\twhile (node.children.length) {\n\t\tnode = node.children[node.children.length - 1];\n\t}\n\n\treturn node;\n}\n\nexport default index;\n","const inlineElements = new Set('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'.split(','));\nconst elementMap = {\n p: 'span',\n ul: 'li',\n ol: 'li',\n table: 'tr',\n tr: 'td',\n tbody: 'tr',\n thead: 'tr',\n tfoot: 'tr',\n colgroup: 'col',\n select: 'option',\n optgroup: 'option',\n audio: 'source',\n video: 'source',\n object: 'param',\n map: 'area'\n};\n\n/**\n * Returns best child node name for given parent node name\n * @param {String} parentName Name of parent node\n * @return {String}\n */\nfunction resolveImplicitName(parentName) {\n parentName = (parentName || '').toLowerCase();\n return elementMap[parentName]\n || (inlineElements.has(parentName) ? 'span' : 'div');\n}\n\nexport default resolveImplicitName;\n","import resolveImplicitTag from '@emmetio/implicit-tag';\n\n/**\n * Adds missing tag names for given tree depending on node’s parent name\n */\nvar implicitTags = function(tree) {\n tree.walk(node => {\n // resolve only nameless nodes without content\n if (node.name == null && node.attributes.length) {\n node.name = resolveImplicitTag(node.parent.name);\n }\n });\n return tree;\n};\n\n/**\n * Locates all occurances of given `token` which are not escaped (e.g. are not\n * preceded with `\\`) given in `str`\n * @param {String} str\n * @return {Array} Array of token ranges\n */\nfunction findUnescapedTokens(str, token) {\n const result = new Set();\n const tlen = token.length;\n\n // 1. Find all occurances of tokens\n let pos = 0;\n while ((pos = str.indexOf(token, pos)) !== -1) {\n result.add(pos);\n pos += tlen;\n }\n\n if (result.size) {\n // 2. Remove ones that escaped\n let pos = 0;\n const len = str.length;\n\n while (pos < len) {\n if (str[pos++] === '\\\\') {\n result.delete(pos++);\n }\n }\n }\n\n return Array.from(result).map(ix => range(ix, tlen));\n}\n\n/**\n * Replaces `ranges`, generated by `range()` function, with given `value` in `str`\n * @param {String} str Where to replace ranges\n * @param {Array} ranges Ranes, created by `range()` function\n * @param {String|Function} value Replacement value. If it’s a function, it\n * will take a range value as argument and should return a new string\n * @return {String}\n */\nfunction replaceRanges(str, ranges, value) {\n\t// should walk from the end of array to keep ranges valid after replacement\n\tfor (let i = ranges.length - 1; i >= 0; i--) {\n\t\tconst r = ranges[i];\n\n\t\tstr = str.substring(0, r[0])\n\t\t\t+ (typeof value === 'function' ? value(str.substr(r[0], r[1])) : value)\n\t\t\t+ str.substring(r[0] + r[1]);\n\t}\n\n\treturn str;\n}\n\nfunction range(start, length) {\n return [start, length];\n}\n\nconst numberingToken = '$';\n\n/**\n * Numbering of expanded abbreviation: finds all nodes with `$` in value\n * or attributes and replaces its occurances with repeater value\n */\nvar applyNumbering = function(tree) {\n tree.walk(applyNumbering$1);\n return tree;\n};\n\n/**\n * Applies numbering for given node: replaces occurances of numbering token\n * in node’s name, content and attributes\n * @param {Node} node\n * @return {Node}\n */\nfunction applyNumbering$1(node) {\n const repeater = findRepeater(node);\n\n if (repeater && repeater.value != null) {\n // NB replace numbering in nodes with explicit repeater only:\n // it solves issues with abbreviations like `xsl:if[test=$foo]` where\n // `$foo` is preferred output\n const value = repeater.value;\n\n node.name = replaceNumbering(node.name, value);\n node.value = replaceNumbering(node.value, value);\n node.attributes.forEach(attr => {\n const copy = node.getAttribute(attr.name).clone();\n copy.name = replaceNumbering(attr.name, value);\n copy.value = replaceNumbering(attr.value, value);\n node.replaceAttribute(attr.name, copy);\n });\n }\n\n return node;\n}\n\n/**\n * Returns repeater object for given node\n * @param {Node} node\n * @return {Object}\n */\nfunction findRepeater(node) {\n while (node) {\n if (node.repeat) {\n return node.repeat;\n }\n\n node = node.parent;\n }\n}\n\n/**\n * Replaces numbering in given string\n * @param {String} str\n * @param {Number} value\n * @return {String}\n */\nfunction replaceNumbering(str, value) {\n // replace numbering in strings only: skip explicit wrappers that could\n // contain unescaped numbering tokens\n if (typeof str === 'string') {\n const ranges = getNumberingRanges(str);\n return replaceNumberingRanges(str, ranges, value);\n }\n\n return str;\n}\n\n/**\n * Returns numbering ranges, e.g. ranges of `$` occurances, in given string.\n * Multiple adjacent ranges are combined\n * @param {String} str\n * @return {Array}\n */\nfunction getNumberingRanges(str) {\n return findUnescapedTokens(str || '', numberingToken)\n .reduce((out, range$$1) => {\n // skip ranges that actually belongs to output placeholder or tabstops\n if (!/[#{]/.test(str[range$$1[0] + 1] || '')) {\n const lastRange = out[out.length - 1];\n if (lastRange && lastRange[0] + lastRange[1] === range$$1[0]) {\n lastRange[1] += range$$1[1];\n } else {\n out.push(range$$1);\n }\n }\n\n return out;\n }, []);\n}\n\n/**\n * @param {String} str\n * @param {Array} ranges\n * @param {Number} value\n * @return {String}\n */\nfunction replaceNumberingRanges(str, ranges, value) {\n const replaced = replaceRanges(str, ranges, token => {\n let _value = String(value);\n // pad values for multiple numbering tokens, e.g. 3 for $$$ becomes 003\n while (_value.length < token.length) {\n _value = '0' + _value;\n }\n return _value;\n });\n\n // unescape screened numbering tokens\n return unescapeString(replaced);\n}\n\n/**\n * Unescapes characters, screened with `\\`, in given string\n * @param {String} str\n * @return {String}\n */\nfunction unescapeString(str) {\n let i = 0, result = '';\n const len = str.length;\n\n while (i < len) {\n const ch = str[i++];\n result += (ch === '\\\\') ? (str[i++] || '') : ch;\n }\n\n return result;\n}\n\n/** Placeholder for inserted content */\nconst placeholder = '$#';\n\n/** Placeholder for caret */\nconst caret = '|';\n\nconst reUrl = /^((?:https?|ftp|file):\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\nconst reEmail = /^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/;\nconst reProto = /^([a-z]+:)?\\/\\//i;\n\n/**\n * Inserts content into node with implicit repeat count: this node is then\n * duplicated for each content item and content itself is inserted either into\n * deepest child or instead of a special token.\n *\n * This method uses two distinct steps: `prepare()` and `insert()` since most\n * likely these steps will be used separately to properly insert content\n * with unescaped `$` numbering markers.\n *\n * @param {Node} tree Parsed abbreviation\n * @param {String[]} content Array of content items to insert\n * @return {Node}\n */\n/**\n * Finds nodes with implicit repeat and creates `amount` copies of it in tree\n * @param {Node} tree\n * @param {Number} amount\n * @return {Node}\n */\nfunction prepare(tree, amount) {\n amount = amount || 1;\n tree.walk(node => {\n if (node.repeat && node.repeat.count === null) {\n for (let i = 0; i < amount; i++) {\n const clone = node.clone(true);\n clone.repeat.implicit = true;\n clone.repeat.count = amount;\n clone.repeat.value = i + 1;\n clone.repeat.index = i;\n node.parent.insertBefore(clone, node);\n }\n\n node.remove();\n }\n });\n\n return tree;\n}\n\n/**\n * Inserts content into implicitly repeated nodes, created by `prepare()` method\n * @param {Node} tree\n * @param {String[]} content\n * @return {Node}\n */\nfunction insert(tree, content) {\n if (Array.isArray(content) && content.length) {\n let updated = false;\n tree.walk(node => {\n if (node.repeat && node.repeat.implicit) {\n updated = true;\n insertContent(node, content[node.repeat.index]);\n }\n });\n\n if (!updated) {\n // no node with implicit repeat was found, insert content as\n // deepest child\n setNodeContent(findDeepestNode(tree), content.join('\\n'));\n }\n }\n\n return tree;\n}\n\n/**\n * Inserts `content` into given `node`: either replaces output placeholders\n * or inserts it into deepest child node\n * @param {Node} node\n * @param {String} content\n * @return {Node}\n */\nfunction insertContent(node, content) {\n\tlet inserted = insertContentIntoPlaceholder(node, content);\n\tnode.walk(child => inserted |= insertContentIntoPlaceholder(child, content));\n\n\tif (!inserted) {\n\t\t// no placeholders were found in node, insert content into deepest child\n\t\tsetNodeContent(findDeepestNode(node), content);\n\t}\n\n\treturn node;\n}\n\n/**\n * Inserts given `content` into placeholders for given `node`. Placeholders\n * might be available in attribute values and node content\n * @param {Node} node\n * @param {String} content\n * @return {Boolean} Returns `true` if placeholders were found and replaced in node\n */\nfunction insertContentIntoPlaceholder(node, content) {\n\tconst state = {replaced: false};\n\n\tnode.value = replacePlaceholder(node.value, content, state);\n\tnode.attributes.forEach(attr => {\n\t\tif (attr.value) {\n\t\t\tnode.setAttribute(attr.name, replacePlaceholder(attr.value, content, state));\n\t\t}\n\t});\n\n\treturn state.replaced;\n}\n\n/**\n * Replaces all placeholder occurances in given `str` with `value`\n * @param {String} str\n * @param {String} value\n * @param {Object} [_state] If provided, set `replaced` property of given\n * object to `true` if placeholder was found and replaced\n * @return {String}\n */\nfunction replacePlaceholder(str, value, _state) {\n\tif (typeof str === 'string') {\n\t\tconst ranges = findUnescapedTokens(str, placeholder);\n\t\tif (ranges.length) {\n\t\t\tif (_state) {\n\t\t\t\t_state.replaced = true;\n\t\t\t}\n\n\t\t\tstr = replaceRanges(str, ranges, value);\n\t\t}\n\t}\n\n\treturn str;\n}\n\n/**\n * Finds node which is the deepest for in current node or node iteself.\n * @param {Node} node\n * @return {Node}\n */\nfunction findDeepestNode(node) {\n\twhile (node.children.length) {\n\t\tnode = node.children[node.children.length - 1];\n\t}\n\n\treturn node;\n}\n\n/**\n * Updates content of given node\n * @param {Node} node\n * @param {String} content\n */\nfunction setNodeContent(node, content) {\n\t// find caret position and replace it with content, if possible\n\tif (node.value) {\n\t\tconst ranges = findUnescapedTokens(node.value, caret);\n\t\tif (ranges.length) {\n\t\t\tnode.value = replaceRanges(node.value, ranges, content);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (node.name.toLowerCase('a') || node.hasAttribute('href')) {\n\t\t// special case: inserting content into `<a>` tag\n\t\tif (reUrl.test(content)) {\n\t\t\tnode.setAttribute('href', (reProto.test(content) ? '' : 'http://') + content);\n\t\t} else if (reEmail.test(content)) {\n\t\t\tnode.setAttribute('href', 'mailto:' + content);\n\t\t}\n\t}\n\n\tnode.value = content;\n}\n\nconst defaultOptions = {\n\telement: '__',\n\tmodifier: '_'\n};\n\nconst reElement = /^(-+)([a-z0-9]+)/i;\nconst reModifier = /^(_+)([a-z0-9]+)/i;\nconst blockCandidates1 = className => /^[a-z]\\-/i.test(className);\nconst blockCandidates2 = className => /^[a-z]/i.test(className);\n\n/**\n * BEM transformer: updates class names written as `-element` and\n * `_modifier` into full class names as described in BEM specs. Also adds missing\n * class names: fir example, if node contains `.block_modifier` class, ensures\n * that element contains `.block` class as well\n */\nvar bem = function(tree, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\n\ttree.walk(node => expandClassNames(node, options));\n\n\tconst lookup = createBlockLookup(tree);\n tree.walk(node => expandShortNotation(node, lookup, options));\n\n\treturn tree;\n};\n\n/**\n * Expands existing class names in BEM notation in given `node`.\n * For example, if node contains `b__el_mod` class name, this method ensures\n * that element contains `b__el` class as well\n * @param {Node} node\n * @param {Object} options\n * @return {Set}\n */\nfunction expandClassNames(node, options) {\n\tconst classNames = node.classList.reduce((out, cl) => {\n\t\t// remove all modifiers from class name to get a base element name\n\t\tconst ix = cl.indexOf(options.modifier);\n\t\tif (ix !== -1) {\n\t\t\tout.add(cl.slice(0, ix));\n\t\t}\n\n\t\treturn out.add(cl);\n\t}, new Set());\n\n\tif (classNames.size) {\n\t\tnode.setAttribute('class', Array.from(classNames).join(' '));\n\t}\n}\n\n/**\n * Expands short BEM notation, e.g. `-element` and `_modifier`\n * @param {Node} node Parsed Emmet abbreviation node\n * @param {Map} lookup BEM block name lookup\n * @param {Object} options\n */\nfunction expandShortNotation(node, lookup, options) {\n\tconst classNames = node.classList.reduce((out, cl) => {\n\t\tlet prefix, m;\n\t\tconst originalClass = cl;\n\n\t\t// parse element definition (could be only one)\n\t\tif (m = cl.match(reElement)) {\n\t\t\tprefix = getBlockName(node, lookup, m[1]) + options.element + m[2];\n\t\t\tout.add(prefix);\n\t\t\tcl = cl.slice(m[0].length);\n\t\t}\n\n\t\t// parse modifiers definitions (may contain multiple)\n\t\twhile (m = cl.match(reModifier)) {\n\t\t\tif (!prefix) {\n\t\t\t\tprefix = getBlockName(node, lookup, m[1]);\n\t\t\t\tout.add(prefix);\n\t\t\t}\n\n\t\t\tout.add(`${prefix}${options.modifier}${m[2]}`);\n\t\t\tcl = cl.slice(m[0].length);\n\t\t}\n\n\t\tif (cl === originalClass) {\n\t\t\t// class name wasn’t modified: it’s not a BEM-specific class,\n\t\t\t// add it as-is into output\n\t\t\tout.add(originalClass);\n\t\t}\n\n\t\treturn out;\n\t}, new Set());\n\n\tnode.setAttribute('class', Array.from(classNames).join(' '));\n}\n\n/**\n * Creates block name lookup for each node in given tree, e.g. finds block\n * name explicitly for each node\n * @param {Node} tree\n * @return {Map}\n */\nfunction createBlockLookup(tree) {\n\tconst lookup = new Map();\n\n\ttree.walk(node => {\n\t\tconst classNames = node.classList;\n\t\tif (classNames.length) {\n\t\t\t// guess best block name from class or use parent’s block name\n\t\t\tlookup.set(node,\n\t\t\t\tfind(classNames, blockCandidates1)\n\t\t\t\t|| find(classNames, blockCandidates2)\n\t\t\t\t|| lookup.get(node.parent)\n\t\t\t);\n\t\t}\n\t});\n\n\treturn lookup;\n}\n\n/**\n * Returns block name for given `node` by `prefix`, which tells the depth of\n * of parent node lookup\n * @param {Node} node\n * @param {Map} lookup\n * @param {String} prefix\n * @return {String}\n */\nfunction getBlockName(node, lookup, prefix) {\n\tlet depth = prefix.length > 1 ? prefix.length : 0;\n\twhile (node.parent && depth--) {\n\t\tnode = node.parent;\n\t}\n\n\treturn lookup.get(node);\n}\n\nfunction find(arr, filter) {\n\treturn arr.filter(filter)[0];\n}\n\n/**\n * JSX transformer: replaces `class` and `for` attributes with `className` and\n * `htmlFor` attributes respectively\n */\nvar jsx = function(tree) {\n\ttree.walk(node => {\n\t\treplace(node, 'class', 'className');\n\t\treplace(node, 'for', 'htmlFor');\n\t});\n\treturn tree;\n};\n\nfunction replace(node, oldName, newName) {\n\tlet attr = node.getAttribute(oldName);\n\tif (attr) {\n\t\tattr.name = newName;\n\t}\n}\n\nconst reSupporterNames = /^xsl:(variable|with\\-param)$/i;\n\n/**\n * XSL transformer: removes `select` attributes from certain nodes that contain\n * children\n */\nvar xsl = function(tree) {\n\ttree.walk(node => {\n\t\tif (reSupporterNames.test(node.name || '') && (node.children.length || node.value)) {\n\t\t\tnode.removeAttribute('select');\n\t\t}\n\t});\n\treturn tree;\n};\n\nconst supportedAddons = { bem, jsx, xsl };\n\n/**\n * Runs additional transforms on given tree.\n * These transforms may introduce side-effects and unexpected result\n * so they are not applied by default, authors must specify which addons\n * in `addons` argument as `{addonName: addonOptions}`\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Object} addons Add-ons to apply and their options\n */\nvar addons = function(tree, addons) {\n Object.keys(addons || {}).forEach(key => {\n if (key in supportedAddons) {\n const addonOpt = typeof addons[key] === 'object' ? addons[key] : null;\n tree = tree.use(supportedAddons[key], addonOpt);\n }\n });\n\n return tree;\n};\n\n/**\n * Applies basic HTML-specific transformations for given parsed abbreviation:\n * – resolve implied tag names\n * – insert repeated content\n * – resolve node numbering\n */\nvar index = function(tree, content, appliedAddons) {\n if (typeof content === 'string') {\n content = [content];\n } else if (content && typeof content === 'object' && !Array.isArray(content)) {\n appliedAddons = content;\n content = null;\n }\n\n return tree\n .use(implicitTags)\n .use(prepare, Array.isArray(content) ? content.length : null)\n .use(applyNumbering)\n .use(insert, content)\n .use(addons, appliedAddons);\n};\n\nexport default index;\n","/**\n * Replaces all unescaped ${variable} occurances in given parsed abbreviation\n * `tree` with values provided in `variables` hash. Precede `$` with `\\` to\n * escape it and skip replacement\n * @param {Node} tree Parsed abbreviation tree\n * @param {Object} variables Variables values\n * @return {Node}\n */\nfunction replaceVariables(tree, variables) {\n\tvariables = variables || {};\n tree.walk(node => replaceInNode(node, variables));\n return tree;\n}\n\nfunction replaceInNode(node, variables) {\n // Replace variables in attributes.\n const attrs = node.attributes;\n\n for (let i = 0, il = attrs.length; i < il; i++) {\n const attr = attrs[i];\n if (typeof attr.value === 'string') {\n node.setAttribute(attr.name, replaceInString(attr.value, variables));\n }\n }\n\n if (node.value != null) {\n node.value = replaceInString(node.value, variables);\n }\n\n return node;\n}\n\n/**\n * Replaces all unescaped `${variable}` occurances in given string with values\n * from `variables` object\n * @param {String} string\n * @param {Object} variables\n * @return {String}\n */\nfunction replaceInString(string, variables) {\n const model = createModel(string);\n let offset = 0;\n let output = '';\n\n for (let i = 0, il = model.variables.length; i < il; i++) {\n const v = model.variables[i];\n let value = v.name in variables ? variables[v.name] : v.name;\n if (typeof value === 'function') {\n value = value(model.string, v, offset + v.location);\n }\n\n output += model.string.slice(offset, v.location) + value;\n offset = v.location + v.length;\n }\n\n return output + model.string.slice(offset);\n}\n\n/**\n * Creates variable model from given string. The model contains a `string` with\n * all escaped variable tokens written without escape symbol and `variables`\n * property with all unescaped variables and their ranges\n * @param {String} string\n * @return {Object}\n */\nfunction createModel(string) {\n const reVariable = /\\$\\{([a-z][\\w\\-]*)\\}/ig;\n const escapeCharCode = 92; // `\\` symbol\n const variables = [];\n\n // We have to replace unescaped (e.g. not preceded with `\\`) tokens.\n // Instead of writing a stream parser, we’ll cut some edges here:\n // 1. Find all tokens\n // 2. Walk string char-by-char and resolve only tokens that are not escaped\n const tokens = new Map();\n let m;\n while (m = reVariable.exec(string)) {\n tokens.set(m.index, m);\n }\n\n if (tokens.size) {\n let start = 0, pos = 0, len = string.length;\n let output = '';\n while (pos < len) {\n if (string.charCodeAt(pos) === escapeCharCode && tokens.has(pos + 1)) {\n // Found escape symbol that escapes variable: we should\n // omit this symbol in output string and skip variable\n const token = tokens.get(pos + 1);\n output += string.slice(start, pos) + token[0];\n start = pos = token.index + token[0].length;\n tokens.delete(pos + 1);\n continue;\n }\n\n pos++;\n }\n\n string = output + string.slice(start);\n\n // Not using `.map()` here to reduce memory allocations\n const validMatches = Array.from(tokens.values());\n for (let i = 0, il = validMatches.length; i < il; i++) {\n const token = validMatches[i];\n variables.push({\n name: token[1],\n location: token.index,\n length: token[0].length\n });\n }\n }\n\n return {string, variables};\n}\n\nexport default replaceVariables;\n","import StreamReader from '@emmetio/stream-reader';\nimport { isNumber } from '@emmetio/stream-reader-utils';\n\nconst DOLLAR = 36; // $\nconst COLON = 58; // :\nconst ESCAPE = 92; // \\\nconst OPEN_BRACE = 123; // {\nconst CLOSE_BRACE = 125; // }\n\n/**\n * Finds fields in given string and returns object with field-less string\n * and array of fileds found\n * @param {String} string\n * @return {Object}\n */\nfunction parse(string) {\n\tconst stream = new StreamReader(string);\n\tconst fields = [];\n\tlet cleanString = '', offset = 0, pos = 0;\n\tlet code, field;\n\n\twhile (!stream.eof()) {\n\t\tcode = stream.peek();\n\t\tpos = stream.pos;\n\n\t\tif (code === ESCAPE) {\n\t\t\tstream.next();\n\t\t\tstream.next();\n\t\t} else if (field = consumeField(stream, cleanString.length + pos - offset)) {\n\t\t\tfields.push(field);\n\t\t\tcleanString += stream.string.slice(offset, pos) + field.placeholder;\n\t\t\toffset = stream.pos;\n\t\t} else {\n\t\t\tstream.next();\n\t\t}\n\t}\n\n\treturn new FieldString(cleanString + stream.string.slice(offset), fields);\n}\n\n/**\n * Marks given `string` with `fields`: wraps each field range with\n * `${index:placeholder}` (by default) or any other token produced by `token`\n * function, if provided\n * @param {String} string String to mark\n * @param {Array} fields Array of field descriptor. A field descriptor is a\n * `{index, location, length}` array. It is important that fields in array\n * must be ordered by their location in string: some fields my refer the same\n * location so they must appear in order that user expects.\n * @param {Function} [token] Function that generates field token. This function\n * received two arguments: `index` and `placeholder` and should return string\n * @return {String} String with marked fields\n */\nfunction mark(string, fields, token) {\n\ttoken = token || createToken;\n\n\t// order fields by their location and appearence\n\t// NB field ranges should not overlap! (not supported yet)\n\tconst ordered = fields\n\t.map((field, order) => ({order, field, end: field.location + field.length}))\n\t.sort((a, b) => (a.end - b.end) || (a.order - b.order));\n\n\t// mark ranges in string\n\tlet offset = 0;\n\tconst result = ordered.map(item => {\n\t\tconst placeholder = string.substr(item.field.location, item.field.length);\n\t\tconst prefix = string.slice(offset, item.field.location);\n\t\toffset = item.end;\n\t\treturn prefix + token(item.field.index, placeholder);\n\t});\n\n\treturn result.join('') + string.slice(offset);\n}\n\n/**\n * Creates field token for string\n * @param {Number} index Field index\n * @param {String} placeholder Field placeholder, could be empty string\n * @return {String}\n */\nfunction createToken(index, placeholder) {\n\treturn placeholder ? `\\${${index}:${placeholder}}` : `\\${${index}}`;\n}\n\n/**\n * Consumes field from current stream position: it can be an `$index` or\n * or `${index}` or `${index:placeholder}`\n * @param {StreamReader} stream\n * @param {Number} location Field location in *clean* string\n * @return {Object} Object with `index` and `placeholder` properties if\n * fieald was successfully consumed, `null` otherwise\n */\nfunction consumeField(stream, location) {\n\tconst start = stream.pos;\n\n\tif (stream.eat(DOLLAR)) {\n\t\t// Possible start of field\n\t\tlet index = consumeIndex(stream);\n\t\tlet placeholder = '';\n\n\t\t// consumed $index placeholder\n\t\tif (index != null) {\n\t\t\treturn new Field(index, placeholder, location);\n\t\t}\n\n\t\tif (stream.eat(OPEN_BRACE)) {\n\t\t\tindex = consumeIndex(stream);\n\t\t\tif (index != null) {\n\t\t\t\tif (stream.eat(COLON)) {\n\t\t\t\t\tplaceholder = consumePlaceholder(stream);\n\t\t\t\t}\n\n\t\t\t\tif (stream.eat(CLOSE_BRACE)) {\n\t\t\t\t\treturn new Field(index, placeholder, location);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// If we reached here then there’s no valid field here, revert\n\t// back to starting position\n\tstream.pos = start;\n}\n\n/**\n * Consumes a placeholder: value right after `:` in field. Could be empty\n * @param {StreamReader} stream\n * @return {String}\n */\nfunction consumePlaceholder(stream) {\n\tlet code;\n\tconst stack = [];\n\tstream.start = stream.pos;\n\n\twhile (!stream.eof()) {\n\t\tcode = stream.peek();\n\n\t\tif (code === OPEN_BRACE) {\n\t\t\tstack.push(stream.pos);\n\t\t} else if (code === CLOSE_BRACE) {\n\t\t\tif (!stack.length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstack.pop();\n\t\t}\n\t\tstream.next();\n\t}\n\n\tif (stack.length) {\n\t\tthrow stream.error('Unable to find matching \"}\" for curly brace at ' + stack.pop());\n\t}\n\n\treturn stream.current();\n}\n\n/**\n * Consumes integer from current stream position\n * @param {StreamReader} stream\n * @return {Number}\n */\nfunction consumeIndex(stream) {\n\tstream.start = stream.pos;\n\tif (stream.eatWhile(isNumber)) {\n\t\treturn Number(stream.current());\n\t}\n}\n\nclass Field {\n\tconstructor(index, placeholder, location) {\n\t\tthis.index = index;\n\t\tthis.placeholder = placeholder;\n\t\tthis.location = location;\n\t\tthis.length = this.placeholder.length;\n\t}\n}\n\nclass FieldString {\n\t/**\n\t * @param {String} string\n\t * @param {Field[]} fields\n\t */\n\tconstructor(string, fields) {\n\t\tthis.string = string;\n\t\tthis.fields = fields;\n\t}\n\n\tmark(token) {\n\t\treturn mark(this.string, this.fields, token);\n\t}\n\n\ttoString() {\n\t\treturn string;\n\t}\n}\n\nexport { mark, createToken };export default parse;\n","import parseFields from '@emmetio/field-parser';\n\nconst defaultFieldsRenderer = text => text;\n\n/**\n * Output node is an object containing generated output for given Emmet\n * abbreviation node. Output node can be passed to various processors that\n * may shape-up final node output. The final output is simply a concatenation\n * of `.open`, `.text` and `.close` properties and its `.before*` and `.after*`\n * satellites\n * @param {Node} node Parsed Emmet abbreviation node\n * @param {Function} fieldsRenderer A function for rendering fielded text (text with\n * tabstops) for current node. @see ./render.js for details\n */\nclass OutputNode {\n\tconstructor(node, fieldsRenderer, options) {\n\t\tif (typeof fieldsRenderer === 'object') {\n\t\t\toptions = fieldsRenderer;\n\t\t\tfieldsRenderer = null;\n\t\t}\n\n\t\tthis.node = node;\n\t\tthis._fieldsRenderer = fieldsRenderer || defaultFieldsRenderer;\n\n\t\tthis.open = null;\n\t\tthis.beforeOpen = '';\n\t\tthis.afterOpen = '';\n\n\t\tthis.close = null;\n\t\tthis.beforeClose = '';\n\t\tthis.afterClose = '';\n\n\t\tthis.text = null;\n\t\tthis.beforeText = '';\n\t\tthis.afterText = '';\n\n\t\tthis.indent = '';\n\t\tthis.newline = '';\n\n\t\tif (options) {\n Object.assign(this, options);\n }\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.node, this);\n\t}\n\n\t/**\n\t * Properly indents given multiline text\n\t * @param {String} text\n\t */\n\tindentText(text) {\n\t\tconst lines = splitByLines(text);\n if (lines.length === 1) {\n // no newlines, nothing to indent\n return text;\n }\n\n // No newline and no indent means no formatting at all:\n // in this case we should replace newlines with spaces\n const nl = (!this.newline && !this.indent) ? ' ' : this.newline;\n return lines.map((line, i) => i ? this.indent + line : line).join(nl);\n\t}\n\n\t/**\n\t * Renders given text with fields\n\t * @param {String} text\n\t * @return {String}\n\t */\n\trenderFields(text) {\n\t\treturn this._fieldsRenderer(text);\n\t}\n\n\ttoString(children) {\n\t\tconst open = this._wrap(this.open, this.beforeOpen, this.afterOpen);\n\t\tconst close = this._wrap(this.close, this.beforeClose, this.afterClose);\n\t\tconst text = this._wrap(this.text, this.beforeText, this.afterText);\n\n\t\treturn open + text + (children != null ? children : '') + close;\n\t}\n\n\t_wrap(str, before, after) {\n\t\tbefore = before != null ? before : '';\n\t\tafter = after != null ? after : '';\n\n // automatically trim whitespace for non-empty wraps\n if (str != null) {\n str = before ? str.replace(/^\\s+/, '') : str;\n str = after ? str.replace(/\\s+$/, '') : str;\n return before + this.indentText(str) + after;\n }\n\n return '';\n\t}\n}\n\n/**\n * Splits given text by lines\n * @param {String} text\n * @return {String[]}\n */\nfunction splitByLines(text) {\n\treturn (text || '').split(/\\r\\n|\\r|\\n/g);\n}\n\n/**\n * Default output of field (tabstop)\n * @param {Number} index Field index\n * @param {String} placeholder Field placeholder, can be null\n * @return {String}\n */\nconst defaultField = (index, placeholder) => (placeholder || '');\n\n/**\n * Renders given parsed abbreviation `tree` via `formatter` function.\n\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Function} [field] Optional function to format field/tabstop (@see `defaultField`)\n * @param {Function} formatter Output formatter function. It takes an output node—\n * a special wrapper for parsed node that holds formatting and output properties—\n * and updates its output properties to shape-up node’s output.\n * Function arguments:\n * \t– `outNode`: OutputNode\n * \t– `renderFields`: a helper function that parses fields/tabstops from given\n * \t text and replaces them with `field` function output.\n * \t It also takes care about field indicies and ensures that the same indicies\n * \t from different nodes won’t collide\n */\nfunction render(tree, field, formatter) {\n if (typeof formatter === 'undefined') {\n formatter = field;\n field = null;\n }\n\n field = field || defaultField;\n\n // Each node may contain fields like `${1:placeholder}`.\n\t// Since most modern editors will link all fields with the same\n\t// index, we have to ensure that different nodes has their own indicies.\n\t// We’ll use this `fieldState` object to globally increment field indices\n\t// during output\n\tconst fieldState = { index: 1 };\n\n const fieldsRenderer = text => text == null\n ? field(fieldState.index++)\n : getFieldsModel(text, fieldState).mark(field);\n\n\treturn run(tree.children, formatter, fieldsRenderer);\n}\n\nfunction run(nodes, formatter, fieldsRenderer) {\n\treturn nodes.filter(notGroup).map(node => {\n\t\tconst outNode = formatter(new OutputNode(node, fieldsRenderer));\n\t\treturn outNode ? outNode.toString(run(node.children, formatter, fieldsRenderer)) : '';\n\t}).join('');\n}\n\nfunction notGroup(node) {\n return !node.isGroup;\n}\n\n/**\n * Returns fields (tab-stops) model with properly updated indices that won’t\n * collide with fields in other nodes of foprmatted tree\n * @param {String|Object} text Text to get fields model from or model itself\n * @param {Object} fieldState Abbreviation tree-wide field state reference\n * @return {Object} Field model\n */\nfunction getFieldsModel(text, fieldState) {\n\tconst model = typeof text === 'object' ? text : parseFields(text);\n let largestIndex = -1;\n\n model.fields.forEach(field => {\n\t\tfield.index += fieldState.index;\n\t\tif (field.index > largestIndex) {\n\t\t\tlargestIndex = field.index;\n\t\t}\n\t});\n\n\tif (largestIndex !== -1) {\n\t\tfieldState.index = largestIndex + 1;\n\t}\n\n return model;\n}\n\nexport default render;\n","import parseFields from '@emmetio/field-parser';\nimport render from '@emmetio/output-renderer';\n\nconst TOKEN = /^(.*?)([A-Z_]+)(.*?)$/;\nconst TOKEN_OPEN = 91; // [\nconst TOKEN_CLOSE = 93; // ]\n\n/**\n * A basic templating engine.\n * Takes every `[TOKEN]` from given string and replaces it with\n * `TOKEN` value from given `data` attribute. The token itself may contain\n * various characters between `[`, token name and `]`. Contents of `[...]` will\n * be outputted only if `TOKEN` value is not empty. Also, only `TOKEN` name will\n * be replaced with actual value, all other characters will remain as is.\n *\n * Example:\n * ```\n * template('[<NAME>]', {NAME: 'foo'}) -> \"<foo>\"\n * template('[<NAME>]', {}) -> \"\"\n * ```\n */\nfunction template(str, data) {\n\tif (str == null) {\n\t\treturn str;\n\t}\n\n\t// NB since token may contain inner `[` and `]`, we can’t just use regexp\n\t// for replacement, should manually parse string instead\n\tconst stack = [];\n\tconst replacer = (str, left, token, right) =>\n\t\tdata[token] != null ? left + data[token] + right : '';\n\n\tlet output = '';\n\tlet offset = 0, i = 0;\n\tlet code, lastPos;\n\n\twhile (i < str.length) {\n\t\tcode = str.charCodeAt(i);\n\t\tif (code === TOKEN_OPEN) {\n\t\t\tstack.push(i);\n\t\t} else if (code === TOKEN_CLOSE) {\n\t\t\tlastPos = stack.pop();\n\t\t\tif (!stack.length) {\n\t\t\t\toutput += str.slice(offset, lastPos) +\n\t\t\t\t\tstr.slice(lastPos + 1, i).replace(TOKEN, replacer);\n\t\t\t\toffset = i + 1;\n\t\t\t}\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn output + str.slice(offset);\n}\n\n/**\n * Various utility methods used by formatters\n */\n\n/**\n * Splits given text by lines\n * @param {String} text\n * @return {String[]}\n */\nfunction splitByLines(text) {\n\treturn (text || '').split(/\\r\\n|\\r|\\n/g);\n}\n\n/**\n * Check if given node is a first child in its parent\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isFirstChild(node) {\n\treturn node.parent.firstChild === node;\n}\n\n/**\n * Check if given node is a last child in its parent node\n * @param {Node} node\n * @return {Boolean}\n */\n\n\n/**\n * Check if given node is a root node\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isRoot(node) {\n\treturn node && !node.parent;\n}\n\n/**\n * Check if given node is a pseudo-snippet: a text-only node with explicitly\n * defined children\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isPseudoSnippet(node) {\n return node.isTextOnly && !!node.children.length;\n}\n\n/**\n * Handles pseudo-snippet node.\n * A pseudo-snippet is a text-only node with explicitly defined children.\n * For such case, we have to figure out if pseudo-snippet contains fields\n * (tab-stops) in node value and “split” it: make contents before field with\n * lowest index node’s “open” part and contents after lowest index — “close”\n * part. With this trick a final output will look like node’s children\n * are nested inside node value\n * @param {OutputNode} outNode\n * @return {Boolean} Returns “true” if given node is a pseudo-snippets,\n * `false` otherwise\n */\nfunction handlePseudoSnippet(outNode) {\n\tconst node = outNode.node; // original abbreviaiton node\n\n\tif (isPseudoSnippet(node)) {\n\t\tconst fieldsModel = parseFields(node.value);\n\t\tconst field = findLowestIndexField(fieldsModel);\n\t\tif (field) {\n\t\t\tconst parts = splitFieldsModel(fieldsModel, field);\n outNode.open = outNode.renderFields(parts[0]);\n\t\t\toutNode.close = outNode.renderFields(parts[1]);\n\t\t} else {\n\t\t\toutNode.text = outNode.renderFields(fieldsModel);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Finds field with lowest index in given text\n * @param {Object} model\n * @return {Object}\n */\nfunction findLowestIndexField(model) {\n\treturn model.fields.reduce((result, field) =>\n\t\t!result || field.index < result.index ? field : result\n\t\t, null);\n}\n\n/**\n * Splits given fields model in two parts by given field\n * @param {Object} model\n * @param {Object} field\n * @return {Array} Two-items array\n */\nfunction splitFieldsModel(model, field) {\n\tconst ix = model.fields.indexOf(field);\n\n\tconst left = new model.constructor(\n\t\tmodel.string.slice(0, field.location),\n\t\tmodel.fields.slice(0, ix)\n\t);\n\n\tconst right = new model.constructor(\n\t\tmodel.string.slice(field.location + field.length),\n\t\tmodel.fields.slice(ix + 1)\n\t);\n\n\treturn [left, right];\n}\n\nconst commentOptions = {\n\t// enable node commenting\n\tenabled: false,\n\n\t// attributes that should trigger node commenting on specific node,\n\t// if commenting is enabled\n\ttrigger: ['id', 'class'],\n\n\t// comment before opening tag\n\tbefore: '',\n\n\t// comment after closing tag\n\tafter: '\\n<!-- /[#ID][.CLASS] -->'\n};\n\n/**\n * Renders given parsed Emmet abbreviation as HTML, formatted according to\n * `profile` options\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Profile} profile Output profile\n * @param {Object} [options] Additional formatter options\n * @return {String}\n */\nfunction html(tree, profile, options) {\n\toptions = Object.assign({}, options);\n\toptions.comment = Object.assign({}, commentOptions, options.comment);\n\n\treturn render(tree, options.field, outNode => {\n\t\toutNode = setFormatting(outNode, profile);\n\n\t\tif (!handlePseudoSnippet(outNode)) {\n\t\t\tconst node = outNode.node;\n\n\t\t\tif (node.name) {\n\t\t\t\tconst name = profile.name(node.name);\n\t\t\t\tconst attrs = formatAttributes(outNode, profile);\n\n\t\t\t\toutNode.open = `<${name}${attrs}${node.selfClosing ? profile.selfClose() : ''}>`;\n\t\t\t\tif (!node.selfClosing) {\n\t\t\t\t\toutNode.close = `</${name}>`;\n\t\t\t\t}\n\n\t\t\t\tcommentNode(outNode, options.comment);\n\t\t\t}\n\n\t\t\t// Do not generate fields for nodes with empty value and children\n\t\t\t// or if node is self-closed\n\t\t\tif (node.value || (!node.children.length && !node.selfClosing) ) {\n\t\t\t\toutNode.text = outNode.renderFields(node.value);\n\t\t\t}\n\t\t}\n\n\t\treturn outNode;\n\t});\n}\n\n/**\n * Updates formatting properties for given output node\n * @param {OutputNode} outNode Output wrapper of farsed abbreviation node\n * @param {Profile} profile Output profile\n * @return {OutputNode}\n */\nfunction setFormatting(outNode, profile) {\n\tconst node = outNode.node;\n\n if (shouldFormatNode(node, profile)) {\n outNode.indent = profile.indent(getIndentLevel(node, profile));\n outNode.newline = '\\n';\n const prefix = outNode.newline + outNode.indent;\n\n // do not format the very first node in output\n if (!isRoot(node.parent) || !isFirstChild(node)) {\n outNode.beforeOpen = prefix;\n if (node.isTextOnly) {\n outNode.beforeText = prefix;\n }\n }\n\n if (hasInnerFormatting(node, profile)) {\n if (!node.isTextOnly) {\n outNode.beforeText = prefix + profile.indent(1);\n }\n outNode.beforeClose = prefix;\n }\n }\n\n return outNode;\n}\n\n/**\n * Check if given node should be formatted\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction shouldFormatNode(node, profile) {\n\tif (!profile.get('format')) {\n\t\treturn false;\n\t}\n\n if (node.parent.isTextOnly\n && node.parent.children.length === 1\n && parseFields(node.parent.value).fields.length) {\n // Edge case: do not format the only child of text-only node,\n // but only if parent contains fields\n return false;\n }\n\n\treturn isInline(node, profile) ? shouldFormatInline(node, profile) : true;\n}\n\n/**\n * Check if given inline node should be formatted as well, e.g. it contains\n * enough adjacent siblings that should force formatting\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction shouldFormatInline(node, profile) {\n\tif (!isInline(node, profile)) {\n\t\treturn false;\n\t}\n\n if (isPseudoSnippet(node)) {\n return true;\n }\n\n // check if inline node is the next sibling of block-level node\n if (node.childIndex === 0) {\n // first node in parent: format if it’s followed by a block-level element\n let next = node;\n while (next = next.nextSibling) {\n if (!isInline(next, profile)) {\n return true;\n }\n }\n } else if (!isInline(node.previousSibling, profile)) {\n // node is right after block-level element\n return true;\n }\n\n if (profile.get('inlineBreak')) {\n // check for adjacent inline elements before and after current element\n let adjacentInline = 1;\n let before = node, after = node;\n\n while (isInlineElement((before = before.previousSibling), profile)) {\n adjacentInline++;\n }\n\n while (isInlineElement((after = after.nextSibling), profile)) {\n adjacentInline++;\n }\n\n\t\tif (adjacentInline >= profile.get('inlineBreak')) {\n\t\t\treturn true;\n\t\t}\n }\n\n\t// Another edge case: inline node contains node that should receive foramtting\n\tfor (let i = 0, il = node.children.length; i < il; i++) {\n\t\tif (shouldFormatNode(node.children[i], profile)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n return false;\n}\n\n/**\n * Check if given node contains inner formatting, e.g. any of its children should\n * be formatted\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction hasInnerFormatting(node, profile) {\n // check if node if forced for inner formatting\n const nodeName = (node.name || '').toLowerCase();\n if (profile.get('formatForce').indexOf(nodeName) !== -1) {\n return true;\n }\n\n // check if any of children should receive formatting\n // NB don’t use `childrent.some()` to reduce memory allocations\n for (let i = 0; i < node.children.length; i++) {\n if (shouldFormatNode(node.children[i], profile)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Outputs attributes of given abbreviation node as HTML attributes\n * @param {OutputNode} outNode\n * @param {Profile} profile\n * @return {String}\n */\nfunction formatAttributes(outNode, profile) {\n\tconst node = outNode.node;\n\n return node.attributes.map(attr => {\n if (attr.options.implied && attr.value == null) {\n \t\treturn null;\n \t}\n\n \tconst attrName = profile.attribute(attr.name);\n \tlet attrValue = null;\n\n // handle boolean attributes\n \tif (attr.options.boolean || profile.get('booleanAttributes').indexOf(attrName.toLowerCase()) !== -1) {\n \t\tif (profile.get('compactBooleanAttributes') && attr.value == null) {\n \t\t\treturn ` ${attrName}`;\n \t\t} else if (attr.value == null) {\n \t\t\tattrValue = attrName;\n \t\t}\n \t}\n\n \tif (attrValue == null) {\n \t\tattrValue = outNode.renderFields(attr.value);\n \t}\n\n \treturn ` ${attrName}=${profile.quote(attrValue)}`;\n }).join('');\n}\n\n/**\n * Check if given node is inline-level\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction isInline(node, profile) {\n\treturn (node && node.isTextOnly) || isInlineElement(node, profile);\n}\n\n/**\n * Check if given node is inline-level element, e.g. element with explicitly\n * defined node name\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction isInlineElement(node, profile) {\n\treturn node && profile.isInline(node);\n}\n\n/**\n * Computes indent level for given node\n * @param {Node} node\n * @param {Profile} profile\n * @param {Number} level\n * @return {Number}\n */\nfunction getIndentLevel(node, profile) {\n\t// Increase indent level IF NOT:\n\t// * parent is text-only node\n\t// * there’s a parent node with a name that is explicitly set to decrease level\n\tconst skip = profile.get('formatSkip') || [];\n\tlet level = node.parent.isTextOnly ? -2 : -1;\n\tlet ctx = node;\n\twhile (ctx = ctx.parent) {\n\t\tif (skip.indexOf( (ctx.name || '').toLowerCase() ) === -1) {\n\t\t\tlevel++;\n\t\t}\n\t}\n\n\treturn level < 0 ? 0 : level;\n}\n\n/**\n * Comments given output node, if required\n * @param {OutputNode} outNode\n * @param {Object} options\n */\nfunction commentNode(outNode, options) {\n\tconst node = outNode.node;\n\n\tif (!options.enabled || !options.trigger || !node.name) {\n\t\treturn;\n\t}\n\n\tconst attrs = outNode.node.attributes.reduce((out, attr) => {\n\t\tif (attr.name && attr.value != null) {\n\t\t\tout[attr.name.toUpperCase().replace(/-/g, '_')] = attr.value;\n\t\t}\n\n\t\treturn out;\n\t}, {});\n\n\t// add comment only if attribute trigger is present\n\tfor (let i = 0, il = options.trigger.length; i < il; i++) {\n\t\tif (options.trigger[i].toUpperCase() in attrs) {\n\t\t\toutNode.open = template(options.before, attrs) + outNode.open;\n\t\t\tif (outNode.close) {\n\t\t\t\toutNode.close += template(options.after, attrs);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Common utility methods for indent-based syntaxes (Slim, Pug, etc.)\n */\n\nconst reId = /^id$/i;\nconst reClass = /^class$/i;\nconst defaultAttrOptions = {\n\tprimary: attrs => attrs.join(''),\n\tsecondary: attrs => attrs.map(attr => attr.isBoolean ? attr.name : `${attr.name}=${attr.value}`).join(', ')\n};\n\nconst defaultNodeOptions = {\n\topen: null,\n\tclose: null,\n\tomitName: /^div$/i,\n\tattributes: defaultAttrOptions\n};\n\nfunction indentFormat(outNode, profile, options) {\n\toptions = Object.assign({}, defaultNodeOptions, options);\n\tconst node = outNode.node;\n\n\toutNode.indent = profile.indent(getIndentLevel$1(node, profile));\n\toutNode.newline = '\\n';\n\n\t// Do not format the very first node in output\n if (!isRoot(node.parent) || !isFirstChild(node)) {\n outNode.beforeOpen = outNode.newline + outNode.indent;\n }\n\n\tif (node.name) {\n\t\tconst data = Object.assign({\n\t\t\tNAME: profile.name(node.name),\n\t\t\tSELF_CLOSE: node.selfClosing ? options.selfClose : null\n\t\t}, getAttributes(outNode, profile, options.attributes));\n\n\t\t// omit tag name if node has primary attributes\n\t\tif (options.omitName && options.omitName.test(data.NAME) && data.PRIMARY_ATTRS) {\n\t\t\tdata.NAME = null;\n\t\t}\n\n\t\tif (options.open != null) {\n\t\t\toutNode.open = template(options.open, data);\n\t\t}\n\n\t\tif (options.close != null) {\n\t\t\toutNode.close = template(options.close, data);\n\t\t}\n\t}\n\n\treturn outNode;\n}\n\n/**\n * Formats attributes of given node into a string.\n * @param {OutputNode} node Output node wrapper\n * @param {Profile} profile Output profile\n * @param {Object} options Additional formatting options\n * @return {String}\n */\nfunction getAttributes(outNode, profile, options) {\n\toptions = Object.assign({}, defaultAttrOptions, options);\n\tconst primary = [], secondary = [];\n\tconst node = outNode.node;\n\n\tnode.attributes.forEach(attr => {\n\t\tif (attr.options.implied && attr.value == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst name = profile.attribute(attr.name);\n\t\tconst value = outNode.renderFields(attr.value);\n\n\t\tif (reId.test(name)) {\n\t\t\tvalue && primary.push(`#${value}`);\n\t\t} else if (reClass.test(name)) {\n\t\t\tvalue && primary.push(`.${value.replace(/\\s+/g, '.')}`);\n\t\t} else {\n\t\t\tconst isBoolean = attr.value == null\n\t\t\t\t&& (attr.options.boolean || profile.get('booleanAttributes').indexOf(name.toLowerCase()) !== -1);\n\n\t\t\tsecondary.push({ name, value, isBoolean });\n\t\t}\n\t});\n\n\treturn {\n\t\tPRIMARY_ATTRS: options.primary(primary) || null,\n\t\tSECONDARY_ATTRS: options.secondary(secondary) || null\n\t};\n}\n\n/**\n * Computes indent level for given node\n * @param {Node} node\n * @param {Profile} profile\n * @param {Number} level\n * @return {Number}\n */\nfunction getIndentLevel$1(node, profile) {\n\tlet level = node.parent.isTextOnly ? -2 : -1;\n\tlet ctx = node;\n\twhile (ctx = ctx.parent) {\n\t\tlevel++;\n\t}\n\n\treturn level < 0 ? 0 : level;\n}\n\nconst reNl = /\\n|\\r/;\n\n/**\n * Renders given parsed Emmet abbreviation as HAML, formatted according to\n * `profile` options\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Profile} profile Output profile\n * @param {Object} [options] Additional formatter options\n * @return {String}\n */\nfunction haml(tree, profile, options) {\n\toptions = options || {};\n\tconst nodeOptions = {\n\t\topen: '[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]',\n\t\tselfClose: '/',\n\t\tattributes: {\n\t\t\tsecondary(attrs) {\n\t\t\t\treturn attrs.map(attr => attr.isBoolean\n\t\t\t\t\t? `${attr.name}${profile.get('compactBooleanAttributes') ? '' : '=true'}`\n\t\t\t\t\t: `${attr.name}=${profile.quote(attr.value)}`\n\t\t\t\t).join(' ');\n\t\t\t}\n\t\t}\n\t};\n\n\treturn render(tree, options.field, outNode => {\n\t\toutNode = indentFormat(outNode, profile, nodeOptions);\n\t\toutNode = updateFormatting(outNode, profile);\n\n\t\tif (!handlePseudoSnippet(outNode)) {\n\t\t\tconst node = outNode.node;\n\n\t\t\t// Do not generate fields for nodes with empty value and children\n\t\t\t// or if node is self-closed\n\t\t\tif (node.value || (!node.children.length && !node.selfClosing) ) {\n\t\t\t\toutNode.text = outNode.renderFields(formatNodeValue(node, profile));\n\t\t\t}\n\t\t}\n\n return outNode;\n\t});\n}\n\n/**\n * Updates formatting properties for given output node\n * NB Unlike HTML, HAML is indent-based format so some formatting options from\n * `profile` will not take effect, otherwise output will be broken\n * @param {OutputNode} outNode Output wrapper of parsed abbreviation node\n * @param {Profile} profile Output profile\n * @return {OutputNode}\n */\nfunction updateFormatting(outNode, profile) {\n\tconst node = outNode.node;\n\n if (!node.isTextOnly && node.value) {\n // node with text: put a space before single-line text\n outNode.beforeText = reNl.test(node.value)\n\t\t\t? outNode.newline + outNode.indent + profile.indent(1)\n\t\t\t: ' ';\n }\n\n\treturn outNode;\n}\n/**\n * Formats value of given node: for multiline text we should add a ` |` suffix\n * at the end of each line. Also ensure that text is perfectly aligned.\n * @param {Node} node\n * @param {Profile} profile\n * @return {String|null}\n */\nfunction formatNodeValue(node, profile) {\n\tif (node.value != null && reNl.test(node.value)) {\n\t\tconst lines = splitByLines(node.value);\n\t\tconst indent = profile.indent(1);\n\t\tconst maxLength = lines.reduce((prev, line) => Math.max(prev, line.length), 0);\n\n\t\treturn lines.map((line, i) => `${i ? indent : ''}${pad(line, maxLength)} |`).join('\\n');\n\t}\n\n\treturn node.value;\n}\n\nfunction pad(text, len) {\n\twhile (text.length < len) {\n\t\ttext += ' ';\n\t}\n\n\treturn text;\n}\n\nconst reNl$1 = /\\n|\\r/;\nconst secondaryAttrs = {\n\tnone: '[ SECONDARY_ATTRS]',\n\tround: '[(SECONDARY_ATTRS)]',\n\tcurly: '[{SECONDARY_ATTRS}]',\n\tsquare: '[[SECONDARY_ATTRS]'\n};\n\n/**\n * Renders given parsed Emmet abbreviation as Slim, formatted according to\n * `profile` options\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Profile} profile Output profile\n * @param {Object} [options] Additional formatter options\n * @return {String}\n */\nfunction slim(tree, profile, options) {\n\toptions = options || {};\n\tconst SECONDARY_ATTRS = options.attributeWrap\n\t\t&& secondaryAttrs[options.attributeWrap]\n\t\t|| secondaryAttrs.none;\n\n\tconst booleanAttr = SECONDARY_ATTRS === secondaryAttrs.none\n\t\t? attr => `${attr.name}=true`\n\t\t: attr => attr.name;\n\n\tconst nodeOptions = {\n\t\topen: `[NAME][PRIMARY_ATTRS]${SECONDARY_ATTRS}[SELF_CLOSE]`,\n\t\tselfClose: '/',\n\t\tattributes: {\n\t\t\tsecondary(attrs) {\n\t\t\t\treturn attrs.map(attr => attr.isBoolean\n\t\t\t\t\t? booleanAttr(attr)\n\t\t\t\t\t: `${attr.name}=${profile.quote(attr.value)}`\n\t\t\t\t).join(' ');\n\t\t\t}\n\t\t}\n\t};\n\n\treturn render(tree, options.field, (outNode, renderFields) => {\n\t\toutNode = indentFormat(outNode, profile, nodeOptions);\n\t\toutNode = updateFormatting$1(outNode, profile);\n\n\t\tif (!handlePseudoSnippet(outNode)) {\n\t\t\tconst node = outNode.node;\n\n\t\t\t// Do not generate fields for nodes with empty value and children\n\t\t\t// or if node is self-closed\n\t\t\tif (node.value || (!node.children.length && !node.selfClosing) ) {\n\t\t\t\toutNode.text = outNode.renderFields(formatNodeValue$1(node, profile));\n\t\t\t}\n\t\t}\n\n return outNode;\n\t});\n}\n\n/**\n * Updates formatting properties for given output node\n * NB Unlike HTML, Slim is indent-based format so some formatting options from\n * `profile` will not take effect, otherwise output will be broken\n * @param {OutputNode} outNode Output wrapper of farsed abbreviation node\n * @param {Profile} profile Output profile\n * @return {OutputNode}\n */\nfunction updateFormatting$1(outNode, profile) {\n\tconst node = outNode.node;\n\tconst parent = node.parent;\n\n\t// Edge case: a single inline-level child inside node without text:\n\t// allow it to be inlined\n\tif (profile.get('inlineBreak') === 0 && isInline$1(node, profile)\n\t\t&& !isRoot(parent) && parent.value == null && parent.children.length === 1) {\n\t\toutNode.beforeOpen = ': ';\n\t}\n\n if (!node.isTextOnly && node.value) {\n // node with text: put a space before single-line text\n outNode.beforeText = reNl$1.test(node.value)\n\t\t\t? outNode.newline + outNode.indent + profile.indent(1)\n\t\t\t: ' ';\n }\n\n\treturn outNode;\n}\n\n/**\n * Formats value of given node: for multiline text we should precede each\n * line with `| ` with one-level deep indent\n * @param {Node} node\n * @param {Profile} profile\n * @return {String|null}\n */\nfunction formatNodeValue$1(node, profile) {\n\tif (node.value != null && reNl$1.test(node.value)) {\n\t\tconst indent = profile.indent(1);\n\t\treturn splitByLines(node.value).map((line, i) => `${indent}${i ? ' ' : '|'} ${line}`).join('\\n');\n\t}\n\n\treturn node.value;\n}\n\n/**\n * Check if given node is inline-level\n * @param {Node} node\n * @param {Profile} profile\n * @return {Boolean}\n */\nfunction isInline$1(node, profile) {\n\treturn node && (node.isTextOnly || profile.isInline(node));\n}\n\nconst reNl$2 = /\\n|\\r/;\n\n/**\n * Renders given parsed Emmet abbreviation as Pug, formatted according to\n * `profile` options\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Profile} profile Output profile\n * @param {Object} [options] Additional formatter options\n * @return {String}\n */\nfunction pug(tree, profile, options) {\n\toptions = options || {};\n\tconst nodeOptions = {\n\t\topen: '[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]',\n\t\tattributes: {\n\t\t\tsecondary(attrs) {\n\t\t\t\treturn attrs.map(attr => attr.isBoolean ? attr.name : `${attr.name}=${profile.quote(attr.value)}`).join(', ');\n\t\t\t}\n\t\t}\n\t};\n\n\treturn render(tree, options.field, outNode => {\n\t\toutNode = indentFormat(outNode, profile, nodeOptions);\n\t\toutNode = updateFormatting$2(outNode, profile);\n\n\t\tif (!handlePseudoSnippet(outNode)) {\n\t\t\tconst node = outNode.node;\n\t\t\t// Do not generate fields for nodes with empty value and children\n\t\t\t// or if node is self-closed\n\t\t\tif (node.value || (!node.children.length && !node.selfClosing) ) {\n\t\t\t\toutNode.text = outNode.renderFields(formatNodeValue$2(node, profile));\n\t\t\t}\n\t\t}\n\n return outNode;\n\t});\n}\n\n/**\n * Updates formatting properties for given output node\n * NB Unlike HTML, Pug is indent-based format so some formatting options from\n * `profile` will not take effect, otherwise output will be broken\n * @param {OutputNode} outNode Output wrapper of parsed abbreviation node\n * @param {Profile} profile Output profile\n * @return {OutputNode}\n */\nfunction updateFormatting$2(outNode, profile) {\n\tconst node = outNode.node;\n\n if (!node.isTextOnly && node.value) {\n // node with text: put a space before single-line text\n outNode.beforeText = reNl$2.test(node.value)\n\t\t\t? outNode.newline + outNode.indent + profile.indent(1)\n\t\t\t: ' ';\n }\n\n\treturn outNode;\n}\n\n/**\n * Formats value of given node: for multiline text we should precede each\n * line with `| ` with one-level deep indent\n * @param {Node} node\n * @param {Profile} profile\n * @return {String|null}\n */\nfunction formatNodeValue$2(node, profile) {\n\tif (node.value != null && reNl$2.test(node.value)) {\n\t\tconst indent = profile.indent(1);\n\t\treturn splitByLines(node.value).map(line => `${indent}| ${line}`).join('\\n');\n\t}\n\n\treturn node.value;\n}\n\nconst supportedSyntaxed = { html, haml, slim, pug };\n\n/**\n * Outputs given parsed abbreviation in specified syntax\n * @param {Node} tree Parsed abbreviation tree\n * @param {Profile} profile Output profile\n * @param {String} [syntax] Output syntax. If not given, `html` syntax is used\n * @param {Function} options.field A function to output field/tabstop for\n * host editor. This function takes two arguments: `index` and `placeholder` and\n * should return a string that represents tabstop in host editor. By default\n * only a placeholder is returned\n * @example\n * {\n * \tfield(index, placeholder) {\n * \t\t// return field in TextMate-style, e.g. ${1} or ${2:foo}\n * \t\treturn `\\${${index}${placeholder ? ':' + placeholder : ''}}`;\n * }\n * }\n * @return {String}\n */\nvar index = function(tree, profile, syntax, options) {\n\tif (typeof syntax === 'object') {\n\t\toptions = syntax;\n\t\tsyntax = null;\n\t}\n\n\tif (!supports(syntax)) {\n\t\t// fallback to HTML if given syntax is not supported\n\t\tsyntax = 'html';\n\t}\n\n\treturn supportedSyntaxed[syntax](tree, profile, options);\n};\n\n/**\n * Check if given syntax is supported\n * @param {String} syntax\n * @return {Boolean}\n */\nfunction supports(syntax) {\n\treturn !!syntax && syntax in supportedSyntaxed;\n}\n\nexport { supports };export default index;\n","import Node from '@emmetio/node';\nimport StreamReader from '@emmetio/stream-reader';\nimport { eatQuoted, isAlpha, isNumber, isWhiteSpace } from '@emmetio/stream-reader-utils';\n\n/**\n * A wrapper for holding CSS value\n */\nclass CSSValue {\n\tconstructor() {\n\t\tthis.type = 'css-value';\n\t\tthis.value = [];\n\t}\n\n\tget size() {\n\t\treturn this.value.length;\n\t}\n\n\tadd(value) {\n\t\tthis.value.push(value);\n\t}\n\n\thas(value) {\n\t\treturn this.value.indexOf(value) !== -1;\n\t}\n\n\ttoString() {\n\t\treturn this.value.join(' ');\n\t}\n}\n\nconst HASH = 35; // #\nconst DOT = 46; // .\n\n/**\n * Consumes a color token from given string\n * @param {StreamReader} stream\n * @return {Color} Returns consumend color object, `undefined` otherwise\n */\nvar consumeColor = function(stream) {\n\t// supported color variations:\n\t// #abc → #aabbccc\n\t// #0 → #000000\n\t// #fff.5 → rgba(255, 255, 255, 0.5)\n\t// #t → transparent\n\tif (stream.peek() === HASH) {\n\t\tstream.start = stream.pos;\n\t\tstream.next();\n\n\t\tstream.eat(116) /* t */ || stream.eatWhile(isHex);\n\t\tconst base = stream.current();\n\n\t\t// a hex color can be followed by `.num` alpha value\n\t\tstream.start = stream.pos;\n\t\tif (stream.eat(DOT) && !stream.eatWhile(isNumber)) {\n\t\t\tthrow stream.error('Unexpected character for alpha value of color');\n\t\t}\n\n\t\treturn new Color(base, stream.current());\n\t}\n};\n\nclass Color {\n\tconstructor(value, alpha) {\n\t\tthis.type = 'color';\n\t\tthis.raw = value;\n\t\tthis.alpha = Number(alpha != null && alpha !== '' ? alpha : 1);\n\t\tvalue = value.slice(1); // remove #\n\n\t\tlet r = 0, g = 0, b = 0;\n\n\t\tif (value === 't') {\n\t\t\tthis.alpha = 0;\n\t\t} else {\n\t\t\tswitch (value.length) {\n\t\t\t\tcase 0:\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tr = g = b = value + value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tr = g = b = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tr = value[0] + value[0];\n\t\t\t\t\tg = value[1] + value[1];\n\t\t\t\t\tb = value[2] + value[2];\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tvalue += value;\n\t\t\t\t\tr = value.slice(0, 2);\n\t\t\t\t\tg = value.slice(2, 4);\n\t\t\t\t\tb = value.slice(4, 6);\n\t\t\t}\n\t\t}\n\n\t\tthis.r = parseInt(r, 16);\n\t\tthis.g = parseInt(g, 16);\n\t\tthis.b = parseInt(b, 16);\n\t}\n\n\t/**\n\t * Output current color as hex value\n\t * @param {Boolean} shor Produce short value (e.g. #fff instead of #ffffff), if possible\n\t * @return {String}\n\t */\n\ttoHex(short) {\n\t\tconst fn = (short && isShortHex(this.r) && isShortHex(this.g) && isShortHex(this.b))\n\t\t\t? toShortHex : toHex;\n\n\t\treturn '#' + fn(this.r) + fn(this.g) + fn(this.b);\n\t}\n\n\t/**\n\t * Output current color as `rgba?(...)` CSS color\n\t * @return {String}\n\t */\n\ttoRGB() {\n\t\tconst values = [this.r, this.g, this.b];\n\t\tif (this.alpha !== 1) {\n\t\t\tvalues.push(this.alpha.toFixed(8).replace(/\\.?0+$/, ''));\n\t\t}\n\n\t\treturn `${values.length === 3 ? 'rgb' : 'rgba'}(${values.join(', ')})`;\n\t}\n\n\ttoString(short) {\n\t\tif (!this.r && !this.g && !this.b && !this.alpha) {\n\t\t\treturn 'transparent';\n\t\t}\n\t\treturn this.alpha === 1 ? this.toHex(short) : this.toRGB();\n\t}\n}\n\n/**\n * Check if given code is a hex value (/0-9a-f/)\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isHex(code) {\n\treturn isNumber(code) || isAlpha(code, 65, 70); // A-F\n}\n\nfunction isShortHex(hex) {\n\treturn !(hex % 17);\n}\n\nfunction toShortHex(num) {\n\treturn (num >> 4).toString(16);\n}\n\nfunction toHex(num) {\n\treturn pad(num.toString(16), 2);\n}\n\nfunction pad(value, len) {\n\twhile (value.length < len) {\n\t\tvalue = '0' + value;\n\t}\n\treturn value;\n}\n\n/**\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isAlphaNumericWord(code) {\n\treturn isNumber(code) || isAlphaWord(code);\n}\n\n/**\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isAlphaWord(code) {\n\treturn code === 95 /* _ */ || isAlpha(code);\n}\n\nconst PERCENT = 37; // %\nconst DOT$1 = 46; // .\nconst DASH$1 = 45; // -\n\n/**\n * Consumes numeric CSS value (number with optional unit) from current stream,\n * if possible\n * @param {StreamReader} stream\n * @return {NumericValue}\n */\nvar consumeNumericValue = function(stream) {\n\tstream.start = stream.pos;\n\tif (eatNumber(stream)) {\n\t\tconst num = stream.current();\n\t\tstream.start = stream.pos;\n\n\t\t// eat unit, which can be a % or alpha word\n\t\tstream.eat(PERCENT) || stream.eatWhile(isAlphaWord);\n\t\treturn new NumericValue(num, stream.current());\n\t}\n};\n\n/**\n * A numeric CSS value with optional unit\n */\nclass NumericValue {\n\tconstructor(value, unit) {\n\t\tthis.type = 'numeric';\n\t\tthis.value = Number(value);\n\t\tthis.unit = unit || '';\n\t}\n\n\ttoString() {\n\t\treturn `${this.value}${this.unit}`;\n\t}\n}\n\n/**\n * Eats number value from given stream\n * @param {StreamReader} stream\n * @return {Boolean} Returns `true` if number was consumed\n */\nfunction eatNumber(stream) {\n\tconst start = stream.pos;\n\tconst negative = stream.eat(DASH$1);\n\tlet hadDot = false, consumed = false, code;\n\n\twhile (!stream.eof()) {\n\t\tcode = stream.peek();\n\n\t\t// either a second dot or not a number: stop parsing\n\t\tif (code === DOT$1 ? hadDot : !isNumber(code)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconsumed = true;\n\n\t\tif (code === DOT$1) {\n\t\t\thadDot = true;\n\t\t}\n\n\t\tstream.next();\n\t}\n\n\tif (negative && !consumed) {\n\t\t// edge case: consumed dash only, bail out\n\t\tstream.pos = start;\n\t}\n\n\treturn start !== stream.pos;\n}\n\nconst DOLLAR$1 = 36; // $\nconst DASH$2 = 45; // -\nconst AT$1 = 64; // @\n\n/**\n * Consumes a keyword: either a variable (a word that starts with $ or @) or CSS\n * keyword or shorthand\n * @param {StreamReader} stream\n * @param {Boolean} [short] Use short notation for consuming value.\n * The difference between “short” and “full” notation is that first one uses\n * alpha characters only and used for extracting keywords from abbreviation,\n * while “full” notation also supports numbers and dashes\n * @return {String} Consumed variable\n */\nvar consumeKeyword = function(stream, short) {\n\tstream.start = stream.pos;\n\n\tif (stream.eat(DOLLAR$1) || stream.eat(AT$1)) {\n\t\t// SCSS or LESS variable\n\t\tstream.eatWhile(isVariableName);\n\t} else if (short) {\n\t\tstream.eatWhile(isAlphaWord);\n\t} else {\n\t\tstream.eatWhile(isKeyword);\n\t}\n\n\treturn stream.start !== stream.pos ? new Keyword(stream.current()) : null;\n};\n\nclass Keyword {\n\tconstructor(value) {\n\t\tthis.type = 'keyword';\n\t\tthis.value = value;\n\t}\n\n\ttoString() {\n\t\treturn this.value;\n\t}\n}\n\nfunction isKeyword(code) {\n\treturn isAlphaNumericWord(code) || code === DASH$2;\n}\n\nfunction isVariableName(code) {\n\treturn code === 45 /* - */ || isAlphaNumericWord(code);\n}\n\nconst opt = { throws: true };\n\n/**\n * Consumes 'single' or \"double\"-quoted string from given string, if possible\n * @param {StreamReader} stream\n * @return {String}\n */\nvar consumeQuoted = function(stream) {\n\tif (eatQuoted(stream, opt)) {\n\t\treturn new QuotedString(stream.current());\n\t}\n};\n\nclass QuotedString {\n\tconstructor(value) {\n\t\tthis.type = 'string';\n\t\tthis.value = value;\n\t}\n\n\ttoString() {\n\t\treturn this.value;\n\t}\n}\n\nconst LBRACE = 40; // (\nconst RBRACE = 41; // )\nconst COMMA = 44; // ,\n\n/**\n * Consumes arguments from given string.\n * Arguments are comma-separated list of CSS values inside round braces, e.g.\n * `(1, a2, 'a3')`. Nested lists and quoted strings are supported\n * @param {StreamReader} stream\n * @return {Array} Array of arguments, `null` if arguments cannot be consumed\n */\nfunction consumeArgumentList(stream) {\n\tif (!stream.eat(LBRACE)) {\n\t\t// not an argument list\n\t\treturn null;\n\t}\n\n\tlet level = 1, code, arg;\n\tconst argsList = [];\n\n\twhile (!stream.eof()) {\n\t\tif (arg = consumeArgument(stream)) {\n\t\t\targsList.push(arg);\n\t\t} else {\n\t\t\t// didn’t consumed argument, expect argument separator or end-of-arguments\n\t\t\tstream.eatWhile(isWhiteSpace);\n\n\t\t\tif (stream.eat(RBRACE)) {\n\t\t\t\t// end of arguments list\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!stream.eat(COMMA)) {\n\t\t\t\tthrow stream.error('Expected , or )');\n\t\t\t}\n\t\t}\n\t}\n\n\treturn argsList;\n}\n\n/**\n * Consumes a single argument. An argument is a `CSSValue`, e.g. it could be\n * a space-separated string of value\n * @param {StreamReader} stream\n * @return {CSSValue}\n */\nfunction consumeArgument(stream) {\n\tconst result = new CSSValue();\n\tlet value;\n\n\twhile (!stream.eof()) {\n\t\tstream.eatWhile(isWhiteSpace);\n\t\tvalue = consumeNumericValue(stream) || consumeColor(stream)\n\t\t\t|| consumeQuoted(stream) || consumeKeywordOrFunction(stream);\n\n\t\tif (!value) {\n\t\t\tbreak;\n\t\t}\n\n\t\tresult.add(value);\n\t}\n\n\treturn result.size ? result : null;\n}\n\n/**\n * Consumes either function call like `foo()` or keyword like `foo`\n * @param {StreamReader} stream\n * @return {Keyword|FunctionCall}\n */\nfunction consumeKeywordOrFunction(stream) {\n\tconst kw = consumeKeyword(stream);\n\tif (kw) {\n\t\tconst args = consumeArgumentList(stream);\n\t\treturn args ? new FunctionCall(kw.toString(), args) : kw;\n\t}\n}\n\nclass FunctionCall {\n\t/**\n\t * @param {String} name Function name\n\t * @param {Array} args Function arguments\n\t */\n\tconstructor(name, args) {\n\t\tthis.type = 'function';\n\t\tthis.name = name;\n\t\tthis.args = args || [];\n\t}\n\n\ttoString() {\n\t\treturn `${this.name}(${this.args.join(', ')})`;\n\t}\n}\n\nconst EXCL = 33; // !\nconst DOLLAR = 36; // $\nconst PLUS = 43; // +\nconst DASH = 45; // -\nconst COLON = 58; // :\nconst AT = 64; // @\n\n/**\n * Parses given Emmet CSS abbreviation and returns it as parsed Node tree\n * @param {String} abbr\n * @return {Node}\n */\nvar index = function(abbr) {\n\tconst root = new Node();\n\tconst stream = new StreamReader(abbr);\n\tlet node;\n\n\twhile (!stream.eof()) {\n\t\tlet node = new Node(consumeIdent(stream));\n\t\tnode.value = consumeValue(stream);\n\n\t\tconst args = consumeArgumentList(stream);\n\t\tif (args) {\n\t\t\t// technically, arguments in CSS are anonymous Emmet Node attributes,\n\t\t\t// but since Emmet can support only one anonymous, `null`-name\n\t\t\t// attribute (for good reasons), we’ll use argument index as name\n\t\t\tfor (let i = 0; i < args.length; i++) {\n\t\t\t\tnode.setAttribute(String(i), args[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Consume `!important` modifier at the end of expression\n\t\tif (stream.eat(EXCL)) {\n\t\t\tnode.value.add('!');\n\t\t}\n\n\t\troot.appendChild(node);\n\n\t\t// CSS abbreviations cannot be nested, only listed\n\t\tif (!stream.eat(PLUS)) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!stream.eof()) {\n\t\tthrow stream.error('Unexpected character');\n\t}\n\n\treturn root;\n};\n\n/**\n * Consumes CSS property identifier from given stream\n * @param {StreamReader} stream\n * @return {String}\n */\nfunction consumeIdent(stream) {\n\tstream.start = stream.pos;\n\tstream.eatWhile(isIdentPrefix);\n\tstream.eatWhile(isIdent);\n\treturn stream.start !== stream.pos ? stream.current() : null;\n}\n\n/**\n * Consumes embedded value from Emmet CSS abbreviation stream\n * @param {StreamReader} stream\n * @return {CSSValue}\n */\nfunction consumeValue(stream) {\n\tconst values = new CSSValue();\n\tlet value;\n\n\twhile (!stream.eof()) {\n\t\t// use colon as value separator\n\t\tstream.eat(COLON);\n\t\tif (value = consumeNumericValue(stream) || consumeColor(stream)) {\n\t\t\t// edge case: a dash after unit-less numeric value or color should\n\t\t\t// be treated as value separator, not negative sign\n\t\t\tif (!value.unit) {\n\t\t\t\tstream.eat(DASH);\n\t\t\t}\n\t\t} else {\n\t\t\tstream.eat(DASH);\n\t\t\tvalue = consumeKeyword(stream, true);\n\t\t}\n\n\t\tif (!value) {\n\t\t\tbreak;\n\t\t}\n\n\t\tvalues.add(value);\n\t}\n\n\treturn values;\n}\n\n/**\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isIdent(code) {\n\treturn isAlphaWord(code);\n}\n\n/**\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isIdentPrefix(code) {\n\treturn code === AT || code === DOLLAR || code === EXCL;\n}\n\nexport default index;\n","const DASH = 45; // -\n\n/**\n * Calculates fuzzy match score of how close `abbr` matches given `string`.\n * @param {String} abbr Abbreviation to score\n * @param {String} string String to match\n * @param {Number} [fuzziness] Fuzzy factor\n * @return {Number} Match score\n */\nvar stringScore = function(abbr, string) {\n if (abbr === string) {\n return 1;\n }\n\n // a string MUST start with the same character as abbreviation\n if (!string || abbr.charCodeAt(0) !== string.charCodeAt(0)) {\n return 0;\n }\n\n const abbrLength = abbr.length;\n const stringLength = string.length;\n let i = 1, j = 1, score = stringLength;\n let ch1, ch2, found, acronym;\n\n while (i < abbrLength) {\n ch1 = abbr.charCodeAt(i);\n found = false;\n acronym = false;\n\n while (j < stringLength) {\n ch2 = string.charCodeAt(j);\n\n if (ch1 === ch2) {\n found = true;\n score += (stringLength - j) * (acronym ? 2 : 1);\n break;\n }\n\n // add acronym bonus for exactly next match after unmatched `-`\n acronym = ch2 === DASH;\n j++;\n }\n\n if (!found) {\n break;\n }\n\n i++;\n }\n\n return score && score * (i / abbrLength) / sum(stringLength);\n};\n\n/**\n * Calculates sum of first `n` natural numbers, e.g. 1+2+3+...n\n * @param {Number} n\n * @return {Number}\n */\nfunction sum(n) {\n return n * (n + 1) / 2;\n}\n\nconst reProperty = /^([a-z\\-]+)(?:\\s*:\\s*([^\\n\\r]+))?$/;\nconst DASH$1 = 45; // -\n\n/**\n * Creates a special structure for resolving CSS properties from plain CSS\n * snippets.\n * Almost all CSS snippets are aliases for real CSS properties with available\n * value variants, optionally separated by `|`. Most values are keywords that\n * can be fuzzy-resolved as well. Some CSS properties are shorthands for other,\n * more specific properties, like `border` and `border-style`. For such cases\n * keywords from more specific properties should be available in shorthands too.\n * @param {Snippet[]} snippets\n * @return {CSSSnippet[]}\n */\nvar cssSnippets = function(snippets) {\n return nest( snippets.map(snippet => new CSSSnippet(snippet.key, snippet.value)) );\n};\n\nclass CSSSnippet {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this.property = null;\n\n // detect if given snippet is a property\n const m = value && value.match(reProperty);\n if (m) {\n this.property = m[1];\n this.value = m[2];\n }\n\n this.dependencies = [];\n }\n\n addDependency(dep) {\n this.dependencies.push(dep);\n }\n\n get defaulValue() {\n return this.value != null ? splitValue(this.value)[0] : null;\n }\n\n /**\n * Returns list of unique keywords for current CSS snippet and its dependencies\n * @return {String[]}\n */\n keywords() {\n const stack = [];\n const keywords = new Set();\n let i = 0, item, candidates;\n\n if (this.property) {\n // scan valid CSS-properties only\n stack.push(this);\n }\n\n while (i < stack.length) {\n // NB Keep items in stack instead of push/pop to avoid possible\n // circular references\n item = stack[i++];\n\n if (item.value) {\n candidates = splitValue(item.value).filter(isKeyword$1);\n\n // extract possible keywords from snippet value\n for (let j = 0; j < candidates.length; j++) {\n keywords.add(candidates[j].trim());\n }\n\n // add dependencies into scan stack\n for (let j = 0, deps = item.dependencies; j < deps.length; j++) {\n if (stack.indexOf(deps[j]) === -1) {\n stack.push(deps[j]);\n }\n }\n }\n }\n\n return Array.from(keywords);\n }\n}\n\n/**\n * Nests more specific CSS properties into shorthand ones, e.g.\n * background-position-x -> background-position -> background\n * @param {CSSSnippet[]} snippets\n * @return {CSSSnippet[]}\n */\nfunction nest(snippets) {\n snippets = snippets.sort(snippetsSort);\n const stack = [];\n\n // For sorted list of CSS properties, create dependency graph where each\n // shorthand property contains its more specific one, e.g.\n // backgound -> background-position -> background-position-x\n for (let i = 0, cur, prev; i < snippets.length; i++) {\n cur = snippets[i];\n\n if (!cur.property) {\n // not a CSS property, skip it\n continue;\n }\n\n // Check if current property belongs to one from parent stack.\n // Since `snippets` array is sorted, items are perfectly aligned\n // from shorthands to more specific variants\n while (stack.length) {\n prev = stack[stack.length - 1];\n\n if (cur.property.indexOf(prev.property) === 0\n && cur.property.charCodeAt(prev.property.length) === DASH$1) {\n prev.addDependency(cur);\n stack.push(cur);\n break;\n }\n\n stack.pop();\n }\n\n if (!stack.length) {\n stack.push(cur);\n }\n }\n\n return snippets;\n}\n\n/**\n * A sorting function for array of snippets\n * @param {CSSSnippet} a\n * @param {CSSSnippet} b\n * @return {Number}\n */\nfunction snippetsSort(a, b) {\n if (a.key === b.key) {\n return 0;\n }\n\n return a.key < b.key ? -1 : 1;\n}\n\n/**\n * Check if given string is a keyword candidate\n * @param {String} str\n * @return {Boolean}\n */\nfunction isKeyword$1(str) {\n return /^\\s*[\\w\\-]+/.test(str);\n}\n\nfunction splitValue(value) {\n return String(value).split('|');\n}\n\nconst globalKeywords = ['auto', 'inherit', 'unset'];\nconst unitlessProperties = [\n 'z-index', 'line-height', 'opacity', 'font-weight', 'zoom',\n 'flex', 'flex-grow', 'flex-shrink'\n];\nconst unitAliases = {\n e :'em',\n p: '%',\n x: 'ex',\n r: 'rem'\n};\n\n/**\n * For every node in given `tree`, finds matching snippet from `registry` and\n * updates node with snippet data.\n *\n * This resolver uses fuzzy matching for searching matched snippets and their\n * keyword values.\n */\n\nvar index = function(tree, registry) {\n\tconst snippets = convertToCSSSnippets(registry);\n\ttree.walk(node => resolveNode(node, snippets));\n\treturn tree;\n};\n\nfunction convertToCSSSnippets(registry) {\n return cssSnippets(registry.all({type: 'string'}))\n}\n\n/**\n * Resolves given node: finds matched CSS snippets using fuzzy match and resolves\n * keyword aliases from node value\n * @param {Node} node\n * @param {CSSSnippet[]} snippets\n * @return {Node}\n */\nfunction resolveNode(node, snippets) {\n\tconst snippet = findBestMatch(node.name, snippets, 'key');\n\n\tif (!snippet) {\n\t\t// Edge case: `!important` snippet\n\t\treturn node.name === '!' ? setNodeAsText(node, '!important') : node;\n\t}\n\n\treturn snippet.property\n\t\t? resolveAsProperty(node, snippet)\n\t\t: resolveAsSnippet(node, snippet);\n}\n\n/**\n * Resolves given parsed abbreviation node as CSS propery\n * @param {Node} node\n * @param {CSSSnippet} snippet\n * @return {Node}\n */\nfunction resolveAsProperty(node, snippet) {\n const abbr = node.name;\n\tnode.name = snippet.property;\n\n\tif (node.value && typeof node.value === 'object') {\n\t\t// resolve keyword shortcuts\n\t\tconst keywords = snippet.keywords();\n\n\t\tif (!node.value.size) {\n\t\t\t// no value defined, try to resolve unmatched part as a keyword alias\n\t\t\tlet kw = findBestMatch(getUnmatchedPart(abbr, snippet.key), keywords);\n\n if (!kw) {\n // no matching value, try to get default one\n kw = snippet.defaulValue;\n if (kw && kw.indexOf('${') === -1) {\n // Quick and dirty test for existing field. If not, wrap\n // default value in a field\n kw = `\\${1:${kw}}`;\n }\n }\n\n\t\t\tif (kw) {\n\t\t\t\tnode.value.add(kw);\n\t\t\t}\n\t\t} else {\n\t\t\t// replace keyword aliases in current node value\n\t\t\tfor (let i = 0, token; i < node.value.value.length; i++) {\n\t\t\t\ttoken = node.value.value[i];\n\n\t\t\t\tif (token === '!') {\n\t\t\t\t\ttoken = `${!i ? '${1} ' : ''}!important`;\n\t\t\t\t} else if (isKeyword(token)) {\n\t\t\t\t\ttoken = findBestMatch(token.value, keywords)\n\t\t\t\t\t\t|| findBestMatch(token.value, globalKeywords)\n\t\t\t\t\t\t|| token;\n\t\t\t\t} else if (isNumericValue(token)) {\n token = resolveNumericValue(node.name, token);\n }\n\n node.value.value[i] = token;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn node;\n}\n\n/**\n * Resolves given parsed abbreviation node as a snippet: a plain code chunk\n * @param {Node} node\n * @param {CSSSnippet} snippet\n * @return {Node}\n */\nfunction resolveAsSnippet(node, snippet) {\n\treturn setNodeAsText(node, snippet.value);\n}\n\n/**\n * Sets given parsed abbreviation node as a text snippet\n * @param {Node} node\n * @param {String} text\n * @return {Node}\n */\nfunction setNodeAsText(node, text) {\n\tnode.name = null;\n\tnode.value = text;\n\treturn node;\n}\n\n/**\n * Finds best matching item from `items` array\n * @param {String} abbr Abbreviation to match\n * @param {Array} items List of items for match\n * @param {String} [key] If `items` is a list of objects, use `key` as object\n * property to test against\n * @return {*}\n */\nfunction findBestMatch(abbr, items, key) {\n\tif (!abbr) {\n\t\treturn null;\n\t}\n\n\tlet matchedItem = null;\n\tlet maxScore = 0;\n\n\tfor (let i = 0, item; i < items.length; i++) {\n\t\titem = items[i];\n\t\tconst score = stringScore(abbr, getScoringPart(item, key));\n\n\t\tif (score === 1) {\n\t\t\t// direct hit, no need to look further\n\t\t\treturn item;\n\t\t}\n\n\t\tif (score && score >= maxScore) {\n\t\t\tmaxScore = score;\n\t\t\tmatchedItem = item;\n\t\t}\n\t}\n\n\treturn matchedItem;\n}\n\nfunction getScoringPart(item, key) {\n const value = item && typeof item === 'object' ? item[key] : item;\n const m = (value || '').match(/^[\\w-@]+/);\n return m ? m[0] : value;\n}\n\n/**\n * Returns a part of `abbr` that wasn’t directly matched agains `string`.\n * For example, if abbreviation `poas` is matched against `position`, the unmatched part will be `as`\n * since `a` wasn’t found in string stream\n * @param {String} abbr\n * @param {String} string\n * @return {String}\n */\nfunction getUnmatchedPart(abbr, string) {\n\tfor (let i = 0, lastPos = 0; i < abbr.length; i++) {\n\t\tlastPos = string.indexOf(abbr[i], lastPos);\n\t\tif (lastPos === -1) {\n\t\t\treturn abbr.slice(i);\n\t\t}\n lastPos++;\n\t}\n\n\treturn '';\n}\n\n/**\n * Check if given CSS value token is a keyword\n * @param {*} token\n * @return {Boolean}\n */\nfunction isKeyword(token) {\n\treturn tokenTypeOf(token, 'keyword');\n}\n\n/**\n * Check if given CSS value token is a numeric value\n * @param {*} token\n * @return {Boolean}\n */\nfunction isNumericValue(token) {\n return tokenTypeOf(token, 'numeric');\n}\n\nfunction tokenTypeOf(token, type) {\n\treturn token && typeof token === 'object' && token.type === type;\n}\n\n/**\n * Resolves numeric value for given CSS property\n * @param {String} property CSS property name\n * @param {NumericValue} token CSS numeric value token\n * @return {NumericValue}\n */\nfunction resolveNumericValue(property, token) {\n if (token.unit) {\n token.unit = unitAliases[token.unit] || token.unit;\n } else if (token.value !== 0 && unitlessProperties.indexOf(property) === -1) {\n // use `px` for integers, `em` for floats\n // NB: num|0 is a quick alternative to Math.round(0)\n token.unit = token.value === (token.value|0) ? 'px' : 'em';\n }\n\n return token;\n}\n\nexport { convertToCSSSnippets, stringScore, cssSnippets };export default index;\n","import render from '@emmetio/output-renderer';\nimport parseFields from '@emmetio/field-parser';\n\nconst defaultOptions = {\n\tshortHex: true,\n\tformat: {\n\t\tbetween: ': ',\n\t\tafter: ';'\n\t}\n};\n\n/**\n * Renders given parsed Emmet CSS abbreviation as CSS-like\n * stylesheet, formatted according to `profile` options\n * @param {Node} tree Parsed Emmet abbreviation\n * @param {Profile} profile Output profile\n * @param {Object} [options] Additional formatter options\n * @return {String}\n */\nfunction css(tree, profile, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\n\treturn render(tree, options.field, outNode => {\n\t\tconst node = outNode.node;\n\t\tlet value = String(node.value || '');\n\n\t\tif (node.attributes.length) {\n\t\t\tconst fieldValues = node.attributes.map(attr => stringifyAttribute(attr, options));\n\t\t\tvalue = injectFields(value, fieldValues);\n\t\t}\n\n\t\toutNode.open = node.name && profile.name(node.name);\n\t\toutNode.afterOpen = options.format.between;\n\t\toutNode.text = outNode.renderFields(value || null);\n\n\t\tif (outNode.open) {\n\t\t\toutNode.afterText = options.format.after;\n\t\t}\n\n\t\tif (profile.get('format')) {\n\t\t\toutNode.newline = '\\n';\n\t\t\tif (tree.lastChild !== node) {\n\t\t\t\toutNode.afterText += outNode.newline;\n\t\t\t}\n\t\t}\n\n\t\treturn outNode;\n\t});\n}\n\n/**\n * Injects given field values at each field of given string\n * @param {String} string\n * @param {String[]} attributes\n * @return {FieldString}\n */\nfunction injectFields(string, values) {\n\tconst fieldsModel = parseFields(string);\n\tconst fieldsAmount = fieldsModel.fields.length;\n\n\tif (fieldsAmount) {\n\t\tvalues = values.slice();\n\t\tif (values.length > fieldsAmount) {\n\t\t\t// More values that output fields: collapse rest values into\n\t\t\t// a single token\n\t\t\tvalues = values.slice(0, fieldsAmount - 1)\n\t\t\t\t.concat(values.slice(fieldsAmount - 1).join(', '));\n\t\t}\n\n\t\twhile (values.length) {\n\t\t\tconst value = values.shift();\n\t\t\tconst field = fieldsModel.fields.shift();\n\t\t\tconst delta = value.length - field.length;\n\n\t\t\tfieldsModel.string = fieldsModel.string.slice(0, field.location)\n\t\t\t\t+ value\n\t\t\t\t+ fieldsModel.string.slice(field.location + field.length);\n\n\t\t\t// Update location of the rest fields in string\n\t\t\tfor (let i = 0, il = fieldsModel.fields.length; i < il; i++) {\n\t\t\t\tfieldsModel.fields[i].location += delta;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fieldsModel;\n}\n\nfunction stringifyAttribute(attr, options) {\n\tif (attr.value && typeof attr.value === 'object' && attr.value.type === 'css-value') {\n\t\treturn attr.value.value\n\t\t.map(token => {\n\t\t\tif (token && typeof token === 'object') {\n\t\t\t\treturn token.type === 'color'\n\t\t\t\t\t? token.toString(options.shortHex)\n\t\t\t\t\t: token.toString();\n\t\t\t}\n\n\t\t\treturn String(token);\n\t\t})\n\t\t.join(' ');\n\t}\n\n\treturn attr.value != null ? String(attr.value) : '';\n}\n\nconst syntaxFormat = {\n\tcss: {\n\t\tbetween: ': ',\n\t\tafter: ';'\n\t},\n\tscss: 'css',\n\tless: 'css',\n\tsass: {\n\t\tbetween: ': ',\n\t\tafter: ''\n\t},\n\tstylus: {\n\t\tbetween: ' ',\n\t\tafter: ''\n\t}\n};\n\n/**\n * Outputs given parsed abbreviation in specified stylesheet syntax\n * @param {Node} tree Parsed abbreviation tree\n * @param {Profile} profile Output profile\n * @param {String} [syntax] Output syntax. If not given, `css` syntax is used\n * @param {Function} options.field A function to output field/tabstop for\n * host editor. This function takes two arguments: `index` and `placeholder` and\n * should return a string that represents tabstop in host editor. By default\n * only a placeholder is returned\n * @example\n * {\n * \tfield(index, placeholder) {\n * \t\t// return field in TextMate-style, e.g. ${1} or ${2:foo}\n * \t\treturn `\\${${index}${placeholder ? ':' + placeholder : ''}}`;\n * }\n * }\n * @return {String}\n */\nvar index = function(tree, profile, syntax, options) {\n\tif (typeof syntax === 'object') {\n\t\toptions = syntax;\n\t\tsyntax = null;\n\t}\n\n\tif (!supports(syntax)) {\n\t\t// fallback to CSS if given syntax is not supported\n\t\tsyntax = 'css';\n\t}\n\n\toptions = Object.assign({}, options, {\n\t\tformat: getFormat(syntax, options)\n\t});\n\n\t// CSS abbreviations doesn’t support nesting so simply\n\t// output root node children\n\treturn css(tree, profile, options);\n};\n\n/**\n * Check if given syntax is supported\n * @param {String} syntax\n * @return {Boolean}\n */\nfunction supports(syntax) {\n\treturn !!syntax && syntax in syntaxFormat;\n}\n\n/**\n * Returns formatter object for given syntax\n * @param {String} syntax\n * @param {Object} [options]\n * @return {Object} Formatter object as defined in `syntaxFormat`\n */\nfunction getFormat(syntax, options) {\n\tlet format = syntaxFormat[syntax];\n\tif (typeof format === 'string') {\n\t\tformat = syntaxFormat[format];\n\t}\n\n\treturn Object.assign({}, format, options && options.format);\n}\n\nexport { supports };export default index;\n","import resolveImplicitTag from '@emmetio/implicit-tag';\n\nvar latin = {\n\t\"common\": [\"lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\", \"consectetur\", \"adipisicing\", \"elit\"],\n\t\"words\": [\"exercitationem\", \"perferendis\", \"perspiciatis\", \"laborum\", \"eveniet\",\n\t\t\"sunt\", \"iure\", \"nam\", \"nobis\", \"eum\", \"cum\", \"officiis\", \"excepturi\",\n\t\t\"odio\", \"consectetur\", \"quasi\", \"aut\", \"quisquam\", \"vel\", \"eligendi\",\n\t\t\"itaque\", \"non\", \"odit\", \"tempore\", \"quaerat\", \"dignissimos\",\n\t\t\"facilis\", \"neque\", \"nihil\", \"expedita\", \"vitae\", \"vero\", \"ipsum\",\n\t\t\"nisi\", \"animi\", \"cumque\", \"pariatur\", \"velit\", \"modi\", \"natus\",\n\t\t\"iusto\", \"eaque\", \"sequi\", \"illo\", \"sed\", \"ex\", \"et\", \"voluptatibus\",\n\t\t\"tempora\", \"veritatis\", \"ratione\", \"assumenda\", \"incidunt\", \"nostrum\",\n\t\t\"placeat\", \"aliquid\", \"fuga\", \"provident\", \"praesentium\", \"rem\",\n\t\t\"necessitatibus\", \"suscipit\", \"adipisci\", \"quidem\", \"possimus\",\n\t\t\"voluptas\", \"debitis\", \"sint\", \"accusantium\", \"unde\", \"sapiente\",\n\t\t\"voluptate\", \"qui\", \"aspernatur\", \"laudantium\", \"soluta\", \"amet\",\n\t\t\"quo\", \"aliquam\", \"saepe\", \"culpa\", \"libero\", \"ipsa\", \"dicta\",\n\t\t\"reiciendis\", \"nesciunt\", \"doloribus\", \"autem\", \"impedit\", \"minima\",\n\t\t\"maiores\", \"repudiandae\", \"ipsam\", \"obcaecati\", \"ullam\", \"enim\",\n\t\t\"totam\", \"delectus\", \"ducimus\", \"quis\", \"voluptates\", \"dolores\",\n\t\t\"molestiae\", \"harum\", \"dolorem\", \"quia\", \"voluptatem\", \"molestias\",\n\t\t\"magni\", \"distinctio\", \"omnis\", \"illum\", \"dolorum\", \"voluptatum\", \"ea\",\n\t\t\"quas\", \"quam\", \"corporis\", \"quae\", \"blanditiis\", \"atque\", \"deserunt\",\n\t\t\"laboriosam\", \"earum\", \"consequuntur\", \"hic\", \"cupiditate\",\n\t\t\"quibusdam\", \"accusamus\", \"ut\", \"rerum\", \"error\", \"minus\", \"eius\",\n\t\t\"ab\", \"ad\", \"nemo\", \"fugit\", \"officia\", \"at\", \"in\", \"id\", \"quos\",\n\t\t\"reprehenderit\", \"numquam\", \"iste\", \"fugiat\", \"sit\", \"inventore\",\n\t\t\"beatae\", \"repellendus\", \"magnam\", \"recusandae\", \"quod\", \"explicabo\",\n\t\t\"doloremque\", \"aperiam\", \"consequatur\", \"asperiores\", \"commodi\",\n\t\t\"optio\", \"dolor\", \"labore\", \"temporibus\", \"repellat\", \"veniam\",\n\t\t\"architecto\", \"est\", \"esse\", \"mollitia\", \"nulla\", \"a\", \"similique\",\n\t\t\"eos\", \"alias\", \"dolore\", \"tenetur\", \"deleniti\", \"porro\", \"facere\",\n\t\t\"maxime\", \"corrupti\"]\n};\n\nvar ru = {\n\t\"common\": [\"далеко-далеко\", \"за\", \"словесными\", \"горами\", \"в стране\", \"гласных\", \"и согласных\", \"живут\", \"рыбные\", \"тексты\"],\n\t\"words\": [\"вдали\", \"от всех\", \"они\", \"буквенных\", \"домах\", \"на берегу\", \"семантика\",\n\t\t\"большого\", \"языкового\", \"океана\", \"маленький\", \"ручеек\", \"даль\",\n\t\t\"журчит\", \"по всей\", \"обеспечивает\", \"ее\",\"всеми\", \"необходимыми\",\n\t\t\"правилами\", \"эта\", \"парадигматическая\", \"страна\", \"которой\", \"жаренные\",\n\t\t\"предложения\", \"залетают\", \"прямо\", \"рот\", \"даже\", \"всемогущая\",\n\t\t\"пунктуация\", \"не\", \"имеет\", \"власти\", \"над\", \"рыбными\", \"текстами\",\n\t\t\"ведущими\", \"безорфографичный\", \"образ\", \"жизни\", \"однажды\", \"одна\",\n\t\t\"маленькая\", \"строчка\",\"рыбного\", \"текста\", \"имени\", \"lorem\", \"ipsum\",\n\t\t\"решила\", \"выйти\", \"большой\", \"мир\", \"грамматики\", \"великий\", \"оксмокс\",\n\t\t\"предупреждал\", \"о\", \"злых\", \"запятых\", \"диких\", \"знаках\", \"вопроса\",\n\t\t\"коварных\", \"точках\", \"запятой\", \"но\", \"текст\", \"дал\", \"сбить\",\n\t\t\"себя\", \"толку\", \"он\", \"собрал\", \"семь\", \"своих\", \"заглавных\", \"букв\",\n\t\t\"подпоясал\", \"инициал\", \"за\", \"пояс\", \"пустился\", \"дорогу\",\n\t\t\"взобравшись\", \"первую\", \"вершину\", \"курсивных\", \"гор\", \"бросил\",\n\t\t\"последний\", \"взгляд\", \"назад\", \"силуэт\", \"своего\", \"родного\", \"города\",\n\t\t\"буквоград\", \"заголовок\", \"деревни\", \"алфавит\", \"подзаголовок\", \"своего\",\n\t\t\"переулка\", \"грустный\", \"реторический\", \"вопрос\", \"скатился\", \"его\",\n\t\t\"щеке\", \"продолжил\", \"свой\", \"путь\", \"дороге\", \"встретил\", \"рукопись\",\n\t\t\"она\", \"предупредила\", \"моей\", \"все\", \"переписывается\", \"несколько\",\n\t\t\"раз\", \"единственное\", \"что\", \"меня\", \"осталось\", \"это\", \"приставка\",\n\t\t\"возвращайся\", \"ты\", \"лучше\", \"свою\", \"безопасную\", \"страну\", \"послушавшись\",\n\t\t\"рукописи\", \"наш\", \"продолжил\", \"свой\", \"путь\", \"вскоре\", \"ему\",\n\t\t\"повстречался\", \"коварный\", \"составитель\", \"рекламных\", \"текстов\",\n\t\t\"напоивший\", \"языком\", \"речью\", \"заманивший\", \"свое\", \"агентство\",\n\t\t\"которое\", \"использовало\", \"снова\", \"снова\", \"своих\", \"проектах\",\n\t\t\"если\", \"переписали\", \"то\", \"живет\", \"там\", \"до\", \"сих\", \"пор\"]\n};\n\nvar sp = {\n\t\"common\": [\"mujer\", \"uno\", \"dolor\", \"más\", \"de\", \"poder\", \"mismo\", \"si\"],\n\t\"words\": [\"ejercicio\", \"preferencia\", \"perspicacia\", \"laboral\", \"paño\",\n\t\t\"suntuoso\", \"molde\", \"namibia\", \"planeador\", \"mirar\", \"demás\", \"oficinista\", \"excepción\",\n\t\t\"odio\", \"consecuencia\", \"casi\", \"auto\", \"chicharra\", \"velo\", \"elixir\",\n\t\t\"ataque\", \"no\", \"odio\", \"temporal\", \"cuórum\", \"dignísimo\",\n\t\t\"facilismo\", \"letra\", \"nihilista\", \"expedición\", \"alma\", \"alveolar\", \"aparte\",\n\t\t\"león\", \"animal\", \"como\", \"paria\", \"belleza\", \"modo\", \"natividad\",\n\t\t\"justo\", \"ataque\", \"séquito\", \"pillo\", \"sed\", \"ex\", \"y\", \"voluminoso\",\n\t\t\"temporalidad\", \"verdades\", \"racional\", \"asunción\", \"incidente\", \"marejada\",\n\t\t\"placenta\", \"amanecer\", \"fuga\", \"previsor\", \"presentación\", \"lejos\",\n\t\t\"necesariamente\", \"sospechoso\", \"adiposidad\", \"quindío\", \"pócima\",\n\t\t\"voluble\", \"débito\", \"sintió\", \"accesorio\", \"falda\", \"sapiencia\",\n\t\t\"volutas\", \"queso\", \"permacultura\", \"laudo\", \"soluciones\", \"entero\",\n\t\t\"pan\", \"litro\", \"tonelada\", \"culpa\", \"libertario\", \"mosca\", \"dictado\",\n\t\t\"reincidente\", \"nascimiento\", \"dolor\", \"escolar\", \"impedimento\", \"mínima\",\n\t\t\"mayores\", \"repugnante\", \"dulce\", \"obcecado\", \"montaña\", \"enigma\",\n\t\t\"total\", \"deletéreo\", \"décima\", \"cábala\", \"fotografía\", \"dolores\",\n\t\t\"molesto\", \"olvido\", \"paciencia\", \"resiliencia\", \"voluntad\", \"molestias\",\n\t\t\"magnífico\", \"distinción\", \"ovni\", \"marejada\", \"cerro\", \"torre\", \"y\",\n\t\t\"abogada\", \"manantial\", \"corporal\", \"agua\", \"crepúsculo\", \"ataque\", \"desierto\",\n\t\t\"laboriosamente\", \"angustia\", \"afortunado\", \"alma\", \"encefalograma\",\n\t\t\"materialidad\", \"cosas\", \"o\", \"renuncia\", \"error\", \"menos\", \"conejo\",\n\t\t\"abadía\", \"analfabeto\", \"remo\", \"fugacidad\", \"oficio\", \"en\", \"almácigo\", \"vos\", \"pan\",\n\t\t\"represión\", \"números\", \"triste\", \"refugiado\", \"trote\", \"inventor\",\n\t\t\"corchea\", \"repelente\", \"magma\", \"recusado\", \"patrón\", \"explícito\",\n\t\t\"paloma\", \"síndrome\", \"inmune\", \"autoinmune\", \"comodidad\",\n\t\t\"ley\", \"vietnamita\", \"demonio\", \"tasmania\", \"repeler\", \"apéndice\",\n\t\t\"arquitecto\", \"columna\", \"yugo\", \"computador\", \"mula\", \"a\", \"propósito\",\n\t\t\"fantasía\", \"alias\", \"rayo\", \"tenedor\", \"deleznable\", \"ventana\", \"cara\",\n\t\t\"anemia\", \"corrupto\"]\n};\n\nconst langs = { latin, ru, sp };\n\nconst defaultOptions = {\n\twordCount: 30,\n\tskipCommon: false,\n\tlang: 'latin'\n};\n\n/**\n * Replaces given parsed Emmet abbreviation node with nodes filled with\n * Lorem Ipsum stub text.\n * @param {Node} node\n * @return {Node}\n */\nvar index = function(node, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\tconst dict = langs[options.lang] || langs.latin;\n const startWithCommon = !options.skipCommon && !isRepeating(node);\n\n\tif (!node.repeat && !isRoot(node.parent)) {\n\t\t// non-repeating element, insert text stub as a content of parent node\n\t\t// and remove current one\n\t\tnode.parent.value = paragraph(dict, options.wordCount, startWithCommon);\n\t\tnode.remove();\n\t} else {\n\t\t// Replace named node with generated content\n\t\tnode.value = paragraph(dict, options.wordCount, startWithCommon);\n\t\tnode.name = resolveImplicitTag(node.parent.name);\n\t}\n\n\treturn node;\n};\n\nfunction isRoot(node) {\n\treturn !node.parent;\n}\n\n/**\n * Returns random integer between <code>from</code> and <code>to</code> values\n * @param {Number} from\n * @param {Number} to\n * @returns {Number}\n */\nfunction rand(from, to) {\n\treturn Math.floor(Math.random() * (to - from) + from);\n}\n\n/**\n * @param {Array} arr\n * @param {Number} count\n * @returns {Array}\n */\nfunction sample(arr, count) {\n\tconst len = arr.length;\n\tconst iterations = Math.min(len, count);\n\tconst result = new Set();\n\n\twhile (result.size < iterations) {\n\t\tresult.add(arr[rand(0, len)]);\n\t}\n\n\treturn Array.from(result);\n}\n\nfunction choice(val) {\n\treturn val[rand(0, val.length - 1)];\n}\n\nfunction sentence(words, end) {\n\tif (words.length) {\n\t\twords = [capitalize(words[0])].concat(words.slice(1));\n\t}\n\n\treturn words.join(' ') + (end || choice('?!...')); // more dots than question marks\n}\n\nfunction capitalize(word) {\n\treturn word[0].toUpperCase() + word.slice(1);\n}\n\n/**\n * Insert commas at randomly selected words. This function modifies values\n * inside <code>words</code> array\n * @param {Array} words\n */\nfunction insertCommas(words) {\n\tif (words.length < 2) {\n\t\treturn words;\n\t}\n\n\twords = words.slice();\n\tconst len = words.length;\n\tconst hasComma = /,$/;\n\tlet totalCommas = 0;\n\n\tif (len > 3 && len <= 6) {\n\t\ttotalCommas = rand(0, 1);\n\t} else if (len > 6 && len <= 12) {\n\t\ttotalCommas = rand(0, 2);\n\t} else {\n\t\ttotalCommas = rand(1, 4);\n\t}\n\n\tfor (let i = 0, pos, word; i < totalCommas; i++) {\n\t\tpos = rand(0, len - 2);\n\t\tif (!hasComma.test(words[pos])) {\n\t\t\twords[pos] += ',';\n\t\t}\n\t}\n\n\treturn words;\n}\n\n/**\n * Generate a paragraph of \"Lorem ipsum\" text\n * @param {Object} dict Words dictionary (see `lang/*.json`)\n * @param {Number} wordCount Words count in paragraph\n * @param {Boolean} startWithCommon Should paragraph start with common\n * \"lorem ipsum\" sentence.\n * @returns {String}\n */\nfunction paragraph(dict, wordCount, startWithCommon) {\n\tconst result = [];\n\tlet totalWords = 0;\n\tlet words;\n\n\tif (startWithCommon && dict.common) {\n\t\twords = dict.common.slice(0, wordCount);\n\t\ttotalWords += words.length;\n\t\tresult.push(sentence(insertCommas(words), '.'));\n\t}\n\n\twhile (totalWords < wordCount) {\n\t\twords = sample(dict.words, Math.min(rand(2, 30), wordCount - totalWords));\n\t\ttotalWords += words.length;\n\t\tresult.push(sentence(insertCommas(words)));\n\t}\n\n\treturn result.join(' ');\n}\n\n/**\n * Check if given node is in repeating context, e.g. node itself or one of its\n * parent is repeated\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isRepeating(node) {\n while (node.parent) {\n if (node.repeat && node.repeat.value && node.repeat.value > 1) {\n return true;\n }\n\n node = node.parent;\n }\n\n return false;\n}\n\nexport default index;\n","import Profile from '@emmetio/output-profile';\nimport SnippetsRegistry from '@emmetio/snippets-registry';\nimport parseAbbreviation from '@emmetio/abbreviation';\nimport resolveSnippets from '@emmetio/html-snippets-resolver';\nimport transform from '@emmetio/html-transform';\nimport resolveVariables from '@emmetio/variable-resolver';\nimport format from '@emmetio/markup-formatters';\nimport parseAbbreviation$1 from '@emmetio/css-abbreviation';\nimport resolveSnippets$1 from '@emmetio/css-snippets-resolver';\nimport format$1 from '@emmetio/stylesheet-formatters';\nimport defaultSnippets from '@emmetio/snippets';\nimport lorem from '@emmetio/lorem';\n\n/**\n * Expands given abbreviation into code\n * @param {String|Node} abbr Abbreviation to parse or already parsed abbreviation\n * @param {Object} options\n * @return {String}\n */\nfunction expand$1(abbr, options) {\n\toptions = options || {};\n\n\tif (typeof abbr === 'string') {\n\t\tabbr = parse$1(abbr, options);\n\t}\n\n\treturn format(abbr, options.profile, options.syntax, options.format);\n}\n\n/**\n * Parses given Emmet abbreviation into a final abbreviation tree with all\n * required transformations applied\n * @param {String} Abbreviation to parse\n * @param {Object} options\n * @return {Node}\n */\nfunction parse$1(abbr, options) {\n\treturn parseAbbreviation(abbr)\n\t.use(transform, options.text, options.addons)\n\t.use(resolveSnippets, options.snippets)\n\t.use(resolveVariables, options.variables);\n}\n\n/**\n * Expands given abbreviation into code\n * @param {String|Node} abbr Abbreviation to parse or already parsed abbreviation\n * @param {Object} options\n * @return {String}\n */\nfunction expand$2(abbr, options) {\n\toptions = options || {};\n\n\tif (typeof abbr === 'string') {\n\t\tabbr = parse$2(abbr, options);\n\t}\n\n\treturn format$1(abbr, options.profile, options.syntax, options.format);\n}\n\n/**\n * Parses given Emmet abbreviation into a final abbreviation tree with all\n * required transformations applied\n * @param {String|Node} Abbreviation to parse or already parsed abbreviation\n * @param {Object} options\n * @return {Node}\n */\nfunction parse$2(abbr, options) {\n\tif (typeof abbr === 'string') {\n\t\tabbr = parseAbbreviation$1(abbr);\n\t}\n\n\treturn abbr.use(resolveSnippets$1, options.snippets);\n}\n\nconst reLorem = /^lorem([a-z]*)(\\d*)$/;\n\n/**\n * Constructs a snippets registry, filled with snippets, for given options\n * @param {String} syntax Abbreviation syntax\n * @param {Object|Object[]} snippets Additional snippets\n * @return {SnippetsRegistry}\n */\nvar snippetsRegistryFactory = function(syntax, snippets) {\n\tconst registrySnippets = [defaultSnippets[syntax] || defaultSnippets.html];\n\n\tif (Array.isArray(snippets)) {\n\t\tsnippets.forEach(item => {\n\t\t\t// if array item is a string, treat it as a reference to globally\n\t\t\t// defined snippets\n\t\t\tregistrySnippets.push(typeof item === 'string' ? defaultSnippets[item] : item);\n\t\t});\n\t} else if (typeof snippets === 'object') {\n\t\tregistrySnippets.push(snippets);\n\t}\n\n\tconst registry = new SnippetsRegistry(registrySnippets.filter(Boolean));\n\n\t// for non-stylesheet syntaxes add Lorem Ipsum generator\n\tif (syntax !== 'css') {\n\t\tregistry.get(0).set(reLorem, loremGenerator);\n\t}\n\n\treturn registry;\n};\n\nfunction loremGenerator(node) {\n\tconst options = {};\n\tconst m = node.name.match(reLorem);\n\tif (m[1]) {\n\t\toptions.lang = m[1];\n\t}\n\n\tif (m[2]) {\n\t\toptions.wordCount = +m[2];\n\t}\n\n\treturn lorem(node, options);\n}\n\n/**\n * Default variables used in snippets to insert common values into predefined snippets\n * @type {Object}\n */\nconst defaultVariables = {\n\tlang: 'en',\n\tlocale: 'en-US',\n\tcharset: 'UTF-8'\n};\n\n/**\n * A list of syntaxes that should use Emmet CSS abbreviations:\n * a variations of default abbreivation that holds values right in abbreviation name\n * @type {Set}\n */\nconst stylesheetSyntaxes = new Set(['css', 'sass', 'scss', 'less', 'stylus', 'sss']);\n\nconst defaultOptions = {\n\t/**\n\t * Abbreviation output syntax\n\t * @type {String}\n\t */\n\tsyntax: 'html',\n\n\t/**\n\t * Field/tabstop generator for editor. Most editors support TextMate-style\n\t * fields: ${0} or ${1:item}. So for TextMate-style fields this function\n\t * will look like this:\n\t * @example\n\t * (index, placeholder) => `\\${${index}${placeholder ? ':' + placeholder : ''}}`\n\t *\n\t * @param {Number} index Placeholder index. Fields with the same indices\n\t * should be linked\n\t * @param {String} [placeholder] Field placeholder\n\t * @return {String}\n\t */\n\tfield: (index, placeholder) => placeholder || '',\n\n\t/**\n\t * Insert given text string(s) into expanded abbreviation\n\t * If array of strings is given, the implicitly repeated element (e.g. `li*`)\n\t * will be repeated by the amount of items in array\n\t * @type {String|String[]}\n\t */\n\ttext: null,\n\n\t/**\n\t * Either predefined output profile or options for output profile. Used for\n\t * abbreviation output\n\t * @type {Profile|Object}\n\t */\n\tprofile: null,\n\n\t/**\n\t * Custom variables for variable resolver\n\t * @see @emmetio/variable-resolver\n\t * @type {Object}\n\t */\n\tvariables: {},\n\n\t/**\n\t * Custom predefined snippets for abbreviation. The expanded abbreviation\n\t * will try to match given snippets that may contain custom elements,\n\t * predefined attributes etc.\n\t * May also contain array of items: either snippets (Object) or references\n\t * to default syntax snippets (String; the key in default snippets hash)\n\t * @see @emmetio/snippets\n\t * @type {Object|SnippetsRegistry}\n\t */\n\tsnippets: {},\n\n\t/**\n\t * Hash of additional transformations that should be applied to expanded\n\t * abbreviation, like BEM or JSX. Since these transformations introduce\n\t * side-effect, they are disabled by default and should be enabled by\n\t * providing a transform name as a key and transform options as value:\n\t * @example\n\t * {\n\t * bem: {element: '--'},\n\t * jsx: true // no options, just enable transform\n\t * }\n\t * @see @emmetio/html-transform/lib/addons\n\t * @type {Object}\n\t */\n\taddons: null,\n\n\t/**\n\t * Additional options for syntax formatter\n\t * @see @emmetio/markup-formatters\n\t * @type {Object}\n\t */\n\tformat: null\n};\n\n/**\n * Expands given abbreviation into string, formatted according to provided\n * syntax and options\n * @param {String|Node} abbr Abbreviation string or parsed abbreviation tree\n * @param {String|Object} [options] Parsing and formatting options (object) or\n * abbreviation syntax (string)\n * @return {String}\n */\nfunction expand$$1(abbr, options) {\n\toptions = createOptions(options);\n\n\treturn isStylesheet(options.syntax)\n\t\t? expand$2(abbr, options)\n\t\t: expand$1(abbr, options);\n}\n\n/**\n * Parses given abbreviation into AST tree. This tree can be later formatted to\n * string with `expand` function\n * @param {String} abbr Abbreviation to parse\n * @param {String|Object} [options] Parsing and formatting options (object) or\n * abbreviation syntax (string)\n * @return {Node}\n */\nfunction parse$$1(abbr, options) {\n\toptions = createOptions(options);\n\n\treturn isStylesheet(options.syntax)\n\t\t? parse$2(abbr, options)\n\t\t: parse$1(abbr, options);\n}\n\n/**\n * Creates snippets registry for given syntax and additional `snippets`\n * @param {String} syntax Snippets syntax, used for retreiving predefined snippets\n * @param {SnippetsRegistry|Object|Object[]} [snippets] Additional snippets\n * @return {SnippetsRegistry}\n */\nfunction createSnippetsRegistry(syntax, snippets) {\n\treturn snippets instanceof SnippetsRegistry\n\t\t? snippets\n\t\t: snippetsRegistryFactory(isStylesheet(syntax) ? 'css' : syntax, snippets);\n}\n\nfunction createOptions(options) {\n\tif (typeof options === 'string') {\n\t\toptions = { syntax: options };\n\t}\n\n\toptions = Object.assign({}, defaultOptions, options);\n\toptions.format = Object.assign({field: options.field}, options.format);\n\toptions.profile = createProfile(options);\n\toptions.variables = Object.assign({}, defaultVariables, options.variables);\n\toptions.snippets = createSnippetsRegistry(isStylesheet(options.syntax) ? 'css' : options.syntax, options.snippets);\n\n\treturn options;\n}\n\n/**\n * Check if given syntax belongs to stylesheet markup.\n * Emmet uses different abbreviation flavours: one is a default markup syntax,\n * used for HTML, Slim, Pug etc, the other one is used for stylesheets and\n * allows embedded values in abbreviation name\n * @param {String} syntax\n * @return {Boolean}\n */\nfunction isStylesheet(syntax) {\n\treturn stylesheetSyntaxes.has(syntax);\n}\n\n/**\n * Creates output profile from given options\n * @param {Object} options\n * @return {Profile}\n */\nfunction createProfile(options) {\n\treturn options.profile instanceof Profile\n\t\t? options.profile\n\t\t: new Profile(options.profile);\n}\n\nexport { expand$$1 as expand, parse$$1 as parse, createSnippetsRegistry, createOptions, isStylesheet, createProfile };\n","'use babel';\n\n/**\n * Syntaxes known by Emmet. All other syntaxes shoud map to one of these\n * @type {Set}\n */\nconst knownSyntaxes = new Set([\n\t'html', 'xml', 'xsl', 'jsx', 'js', 'pug', 'slim', 'haml',\n\t'css', 'sass', 'scss', 'less', 'sss', 'stylus'\n]);\n\n/**\n * Common context checker for abbreviation auto-activation for\n * stylesheet syntaxes (CSS, SCSS, LESS etc.)\n * @param {CodeMirror} editor\n * @return {Boolean}\n */\nconst stylesheetAutoActivationContext = (editor, pos) => {\n\tconst tokenType = editor.getTokenTypeAt(pos || editor.getCursor());\n\t// NB may return `property` or `property error` type\n\treturn tokenType && /^property\\b/.test(tokenType);\n};\n\nconst autoActivationContext = {\n\thtml(editor, pos) {\n\t\t// Do not provide automatic abbreviation completion inside HTML tags,\n\t\t// e.g. work only inside plain text token\n\t\treturn editor.getTokenTypeAt(pos || editor.getCursor()) === null;\n\t},\n\n\tcss: stylesheetAutoActivationContext,\n\tless: stylesheetAutoActivationContext,\n\tsass: stylesheetAutoActivationContext,\n\tscss: stylesheetAutoActivationContext\n};\n\n/**\n * Detect Emmet syntax from given editor’s position.\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} [pos]\n * @return {String} Returns `null` if Emmet syntax can’t be detected\n */\nexport default function detectSyntax(editor, pos) {\n\tconst mode = editor.getModeAt(pos || editor.getCursor());\n\tconst syntax = mode.name === 'xml' ? 'html' : mode.name;\n\n\tif (isSupported(syntax)) {\n\t\treturn syntax;\n\t}\n\n\t// No supported syntax found, try from Emmet-specific options\n\tconst emmetOpt = editor.getOption('emmet');\n\tif (emmetOpt && isSupported(emmetOpt.syntax)) {\n\t\treturn emmetOpt.syntax;\n\t}\n\n\treturn null;\n}\n\n/**\n * Check if given syntax is supported by Emmet\n * @param {String} syntax\n * @return {Boolean}\n */\nexport function isSupported(syntax) {\n\treturn knownSyntaxes.has(syntax);\n}\n\n/**\n * Check if current editor’s context (syntax, scope) allows automatic Emmet\n * abbreviation activation as user types text. If this function returns `false`,\n * it is recommended to not create any Emmet completions when user types text,\n * but insert them when user activated autocomplete popup manually\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} [pos]\n * @return {Boolean}\n */\nexport function hasAutoActivateContext(editor, pos) {\n\tconst syntax = detectSyntax(editor, pos);\n\treturn syntax && (!autoActivationContext[syntax] || autoActivationContext[syntax](editor, pos));\n}\n","'use strict';\n\n/**\n * Returns token used for single indentation in given editor\n * @param {CodeMirror} editor\n * @return {String}\n */\nexport function getIndentation(editor) {\n\tif (!editor.getOption('indentWithTabs')) {\n\t\treturn repeatString(' ', editor.getOption('indentUnit'));\n\t}\n\n\treturn '\\t';\n}\n\n/**\n * Normalizes text according to given CodeMirror instance indentation\n * preferences\n * @param {String} text\n * @param {CodeMirror} editor\n * @param {String} [indentation] Applies `indentText()` with given argument,\n * if provided\n * @return {String}\n */\nexport function normalizeText(editor, text, indentation) {\n\tlet lines = splitByLines(text);\n\tconst indent = getIndentation(editor);\n\n\tif (indent !== '\\t') {\n\t\tlines = lines.map(line => line.replace(/^\\t+/,\n\t\t\ttabs => repeatString(indent, tabs.length)));\n\t}\n\n\tif (indentation) {\n\t\tlines = lines.map((line, i) => i ? indentation + line : line);\n\t}\n\n\treturn lines.join('\\n');\n}\n\n/**\n * Indents each line, except first one, in given text\n * @param {String} text\n * @param {String} indentation\n * @return {String}\n */\nexport function indentText(text, indentation) {\n\treturn splitByLines(text)\n\t.map((line, i) => i ? indentation + line : line)\n\t.join('\\n');\n}\n\n/**\n * Splits given text by lines\n * @param {String} text\n * @return {String[]} Lines of text\n */\nexport function splitByLines(text) {\n\treturn Array.isArray(text) ? text : text.split(/\\r\\n|\\r|\\n/g);\n}\n\nexport function repeatString(str, count) {\n\tlet result = '';\n\twhile (0 < count--) {\n\t\tresult += str;\n\t}\n\n\treturn result;\n}\n\n/**\n * Quick and dirty way to remove fields from given string\n * @param {String} str\n * @return {String}\n */\nexport function removeFields(str) {\n\treturn str.replace(/\\$\\{\\d+(:[^\\}]+)?\\}/g, '');\n}\n\n/**\n * Check if given range contains point\n * @param {CodeMirror.Range} range\n * @param {CodeMirror.Pos} pos\n * @param {Boolean} [exclude] Exclude range and and start\n * @return {Boolean}\n */\nexport function containsPos(range, pos, exclude) {\n\treturn exclude\n\t\t? comparePos(pos, range.from) > 0 && comparePos(pos, range.to) < 0\n\t\t: comparePos(pos, range.from) >= 0 && comparePos(pos, range.to) <= 0;\n}\n\nexport function comparePos(a, b) {\n\treturn a.line - b.line || a.ch - b.ch;\n}\n","'use babel';\n\nimport extract from '@emmetio/extract-abbreviation';\nimport { expand, parse, isStylesheet } from '@emmetio/expand-abbreviation';\nimport detectSyntax from './detect-syntax';\nimport { normalizeText } from './utils';\n\nconst cursorMark = '[[::emmet-cursor::]]';\n\n// NB CodeMirror doesn’t natively supports tabstops\nconst editorField = (index, placeholder = '') => placeholder;\n\n/**\n * Expands given abbreviation for given editor.\n * The editor is used to detect abbreviation syntax and provide\n * tag context for markup abbreviations\n * @param {String|Node} abbr\n * @param {CodeMirror} editor\n * @return {String}\n * @throws Error if abbreviation is invalid\n */\nexport default function expandAbbreviation(abbr, editor, options) {\n\treturn expand(abbr, Object.assign({\n\t\tsyntax: detectSyntax(editor),\n\t\tfield: editorField\n\t}, getExpandOptions(editor), options));\n}\n\n/**\n * Parses abbreviation for given editor\n * @param {String} abbr\n * @param {CodeMirror} editor\n * @return {Node}\n * @throws Error if abbreviation is invalid\n */\nexport function parseAbbreviation(abbr, editor) {\n\treturn parse(abbr, Object.assign({\n\t\tsyntax: detectSyntax(editor),\n\t}, getExpandOptions(editor)));\n}\n\n/**\n * Extracts abbreviation from given position of editor\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} [pos]\n * @return {Object} Object with `{abbreviation, location}` properties or `null`\n */\nexport function extractAbbreviation(editor, pos) {\n\tpos = pos || pos.getCursor();\n\tconst line = editor.getLine(pos.line);\n\n\treturn extract(line, pos.ch, true);\n}\n\n/**\n * Returns abbreviation model: object with `ast` and `snippet` properties\n * that contains parsed and expanded abbreviation respectively\n * @param {String} abbreviation\n * @param {CodeMirror} editor\n * @return {Object} Returns `null` if abbreviation cannot be parsed\n */\nexport function createAbbreviationModel(abbreviation, editor) {\n\ttry {\n\t\tconst ast = parseAbbreviation(abbreviation, editor);\n\t\treturn {\n\t\t\tast,\n\t\t\tabbreviation,\n\t\t\tsnippet: expandAbbreviation(abbreviation, editor)\n\t\t};\n\t} catch (err) {\n\t\t// console.warn('Unable to build Emmet abbreviation model', err);\n\t\treturn null;\n\t}\n}\n\n/**\n * Expands given abbreviation and inserts expanded result into editor, maintaining\n * proper indentation and final cursor position\n * @param {CodeMirror} editor CodeMirror editor instance\n * @param {String|Object} abbr Abbreviation to expand (string or parsed)\n * @param {CodeMirror.Range} range Location of abbreviation in editor\n * @return {Boolean} Returns `true` if abbreviation was successfully expanded and inserted\n */\nexport function expandAndInsert(editor, abbr, range) {\n\tlet cursorMarked = false;\n\tlet newSelectionSize = 0;\n\tlet expanded;\n\n\ttry {\n\t\texpanded = expandAbbreviation(abbr, editor, {\n\t\t\t// CodeMirror doesn’t support snippets with tab-stops natively so we have\n\t\t\t// to mark first output with a special token so we can find it later\n\t\t\t// to properly plant cursor into new position\n\t\t\tfield(index, placeholder = '') {\n\t\t\t\tif (!cursorMarked) {\n\t\t\t\t\tcursorMarked = true;\n\t\t\t\t\tnewSelectionSize = placeholder.length;\n\t\t\t\t\tplaceholder = cursorMark + placeholder;\n\t\t\t\t}\n\n\t\t\t\treturn placeholder;\n\t\t\t}\n\t\t});\n\t} catch (err) {\n\t\t// Invalid abbreviation\n\t\t// console.warn(err);\n\t\treturn false;\n\t}\n\n\tconst line = editor.getLine(range.from.line);\n\tconst matchIndent = line.match(/^\\s+/);\n\texpanded = normalizeText(editor, expanded, matchIndent && matchIndent[0]);\n\n\tlet newCursorPos = expanded.length;\n\n\tif (cursorMarked) {\n\t\t// Remove cursor stub and re-position cursor\n\t\tnewCursorPos = expanded.indexOf(cursorMark);\n\t\texpanded = expanded.slice(0, newCursorPos) + expanded.slice(newCursorPos + cursorMark.length);\n\t}\n\n\t// Replace abbreviation with expanded result\n\treturn editor.operation(() => {\n\t\teditor.replaceRange(expanded, range.from, range.to);\n\n\t\t// Position cursor\n\t\tconst startIx = editor.indexFromPos(range.from);\n\t\tconst newCursor = editor.posFromIndex(newCursorPos + startIx);\n\t\tif (newSelectionSize) {\n\t\t\teditor.setSelection(newCursor, {\n\t\t\t\tline: newCursor.line,\n\t\t\t\tch: newCursor.ch + newSelectionSize\n\t\t\t});\n\t\t} else {\n\t\t\teditor.setCursor(newCursor);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\n/**\n * Returns options object for syntax from given editor. In most cases, it detects\n * XML-style syntax (HTML, XML, XHTML) and returns options configured for proper\n * output\n * @param {CodeMirror} editor\n * @param {Point} [pos] Point in editor where syntax should be detected.\n * Uses `editor.getCursor()` in not given\n * @return {Object}\n */\nexport function getExpandOptions(editor, pos) {\n\tconst mode = editor.getModeAt(pos || editor.getCursor());\n\tconst emmetOpt = editor.getOption('emmet');\n\tlet profile = emmetOpt && emmetOpt.profile;\n\n\tif (mode.name === 'xml') {\n\t\tprofile = Object.assign({ selfClosingStyle: mode.configuration }, profile);\n\t}\n\n\treturn Object.assign({\n\t\tprofile,\n\t\tsnippets: snippetsFromOptions(editor, detectSyntax(editor, pos))\n\t}, emmetOpt);\n}\n\n/**\n * Returns custom snippets from Emmet options of given editor\n * @param {CodeMirror} editor\n * @param {String} syntax\n * @return {Object}\n */\nexport function snippetsFromOptions(editor, syntax) {\n\tconst emmetOpt = editor.getOption('emmet');\n\tif (emmetOpt) {\n\t\treturn isStylesheet(syntax)\n\t\t\t? emmetOpt.stylesheetSnippets\n\t\t\t: emmetOpt.markupSnippets;\n\t}\n}\n","'use strict';\n\nimport { createAbbreviationModel, extractAbbreviation } from './expand-abbreviation';\nimport { hasAutoActivateContext } from './detect-syntax';\n\nconst emmetMarkerClass = 'emmet-abbreviation';\n\n/**\n * Editor’s `change` event handler that marks Emmet abbreviation when editor\n * content is updated\n * @param {CodeMirror} editor\n */\nexport function markOnEditorChange(editor) {\n\tconst marker = findMarker(editor, editor.getCursor());\n\tif (marker && isValidMarker(editor, marker)) {\n\t\treturn;\n\t}\n\n\t// No valid marker under caret, remove all registered markers\n\t// and create a new one\n\tclearMarkers(editor);\n\tif (hasAutoActivateContext(editor)) {\n\t\tmarkAbbreviation(editor, editor.getCursor());\n\t}\n}\n\n/**\n * Returns *valid* Emmet abbreviation marker (if any) for given position of editor\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} [pos]\n * @return {CodeMirror.TextMarker}\n */\nexport function findMarker(editor, pos) {\n\tconst markers = editor.findMarksAt(pos);\n\tfor (let i = 0; i < markers.length; i++) {\n\t\tif (markers[i].className === emmetMarkerClass) {\n\t\t\treturn markers[i];\n\t\t}\n\t}\n}\n\n/**\n * Marks Emmet abbreviation for given editor position, if possible\n * @param {TextEditor} editor Editor where abbreviation marker should be created\n * @param {Point} pos Buffer position where abbreviation should be created.\n * Abbreviation will be automatically extracted from\n * given position\n * @param {Boolean} [forced] Indicates that user forcibly requested abbreviation\n * marker (e.g. was not activated automatically).\n * Affects abbreviation detection policy\n * @return {DisplayMarker} Returns `undefined` if no valid abbreviation under caret\n */\nexport function markAbbreviation(editor, pos, forced) {\n\tconst marker = findMarker(editor, pos);\n\tif (marker) {\n\t\t// there’s active marker with valid abbreviation\n\t\treturn marker;\n\t}\n\n\t// No active marker: remove previous markers and create new one, if possible\n\tclearMarkers(editor);\n\n\tconst extracted = extractAbbreviation(editor, pos);\n\tconst model = extracted && createAbbreviationModel(extracted.abbreviation, editor);\n\n\tif (model && (forced || allowedForAutoActivation(model))) {\n\t\tconst from = { line: pos.line, ch: extracted.location };\n\t\tconst to = { line: pos.line, ch: extracted.location + extracted.abbreviation.length };\n\n\t\tconst marker = editor.markText(from, to, {\n\t\t\tinclusiveRight: true,\n\t\t\tclearWhenEmpty: true,\n\t\t\tclassName: emmetMarkerClass\n\t\t});\n\t\tmarker.model = model;\n\t\treturn marker;\n\t}\n}\n\n/**\n * Removes Emmmet abbreviation markers from given editor\n * @param {TextEditor} editor\n */\nexport function clearMarkers(editor) {\n\tconst markers = editor.getAllMarks();\n\tfor (let i = 0; i < markers.length; i++) {\n\t\tif (markers[i].className === emmetMarkerClass) {\n\t\t\tmarkers[i].clear();\n\t\t}\n\t}\n}\n\n/**\n * Check if given abbreviation model is allowed for auto-activated abbreviation\n * marker. Used to reduce falsy activations\n * @param {Object} model Parsed abbreviation model (see `createAbbreviationModel()`)\n * @return {Boolean}\n */\nfunction allowedForAutoActivation(model) {\n\tconst rootNode = model.ast.children[0];\n\t// The very first node should start with alpha character\n\t// Skips falsy activations for something like `$foo` etc.\n\treturn rootNode && /^[a-z]/i.test(rootNode.name);\n}\n\n/**\n * Ensures that given editor Emmet abbreviation marker contains valid Emmet abbreviation\n * and updates abbreviation model if required\n * @param {CodeMirror} editor\n * @param {CodeMirror.TextMarket} marker\n * @return {Boolean} `true` if marker contains valid abbreviation\n */\nfunction isValidMarker(editor, marker) {\n\tconst range = marker.find();\n\n\t// No newlines inside abreviation\n\tif (range.from.line !== range.to.line) {\n\t\treturn false;\n\t}\n\n\t// Make sure marker contains valid abbreviation\n\tconst text = editor.getRange(range.from, range.to);\n\tif (!text || /^\\s|\\s$/g.test(text)) {\n\t\treturn false;\n\t}\n\n\tif (!marker.model || marker.model.abbreviation !== text) {\n\t\t// marker contents was updated, re-parse abbreviation\n\t\tmarker.model = createAbbreviationModel(text, editor);\n\t}\n\n\treturn !!(marker.model && marker.model.snippet);\n}\n","const DASH = 45; // -\n\n/**\n * Calculates fuzzy match score of how close `abbr` matches given `string`.\n * @param {String} abbr Abbreviation to score\n * @param {String} string String to match\n * @param {Number} [fuzziness] Fuzzy factor\n * @return {Number} Match score\n */\nvar stringScore = function(abbr, string) {\n if (abbr === string) {\n return 1;\n }\n\n // a string MUST start with the same character as abbreviation\n if (!string || abbr.charCodeAt(0) !== string.charCodeAt(0)) {\n return 0;\n }\n\n const abbrLength = abbr.length;\n const stringLength = string.length;\n let i = 1, j = 1, score = stringLength;\n let ch1, ch2, found, acronym;\n\n while (i < abbrLength) {\n ch1 = abbr.charCodeAt(i);\n found = false;\n acronym = false;\n\n while (j < stringLength) {\n ch2 = string.charCodeAt(j);\n\n if (ch1 === ch2) {\n found = true;\n score += (stringLength - j) * (acronym ? 2 : 1);\n break;\n }\n\n // add acronym bonus for exactly next match after unmatched `-`\n acronym = ch2 === DASH;\n j++;\n }\n\n if (!found) {\n break;\n }\n\n i++;\n }\n\n return score && score * (i / abbrLength) / sum(stringLength);\n};\n\n/**\n * Calculates sum of first `n` natural numbers, e.g. 1+2+3+...n\n * @param {Number} n\n * @return {Number}\n */\nfunction sum(n) {\n return n * (n + 1) / 2;\n}\n\nconst reProperty = /^([a-z\\-]+)(?:\\s*:\\s*([^\\n\\r]+))?$/;\nconst DASH$1 = 45; // -\n\n/**\n * Creates a special structure for resolving CSS properties from plain CSS\n * snippets.\n * Almost all CSS snippets are aliases for real CSS properties with available\n * value variants, optionally separated by `|`. Most values are keywords that\n * can be fuzzy-resolved as well. Some CSS properties are shorthands for other,\n * more specific properties, like `border` and `border-style`. For such cases\n * keywords from more specific properties should be available in shorthands too.\n * @param {Snippet[]} snippets\n * @return {CSSSnippet[]}\n */\nvar cssSnippets = function(snippets) {\n return nest( snippets.map(snippet => new CSSSnippet(snippet.key, snippet.value)) );\n};\n\nclass CSSSnippet {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this.property = null;\n\n // detect if given snippet is a property\n const m = value && value.match(reProperty);\n if (m) {\n this.property = m[1];\n this.value = m[2];\n }\n\n this.dependencies = [];\n }\n\n addDependency(dep) {\n this.dependencies.push(dep);\n }\n\n get defaulValue() {\n return this.value != null ? splitValue(this.value)[0] : null;\n }\n\n /**\n * Returns list of unique keywords for current CSS snippet and its dependencies\n * @return {String[]}\n */\n keywords() {\n const stack = [];\n const keywords = new Set();\n let i = 0, item, candidates;\n\n if (this.property) {\n // scan valid CSS-properties only\n stack.push(this);\n }\n\n while (i < stack.length) {\n // NB Keep items in stack instead of push/pop to avoid possible\n // circular references\n item = stack[i++];\n\n if (item.value) {\n candidates = splitValue(item.value).filter(isKeyword$1);\n\n // extract possible keywords from snippet value\n for (let j = 0; j < candidates.length; j++) {\n keywords.add(candidates[j].trim());\n }\n\n // add dependencies into scan stack\n for (let j = 0, deps = item.dependencies; j < deps.length; j++) {\n if (stack.indexOf(deps[j]) === -1) {\n stack.push(deps[j]);\n }\n }\n }\n }\n\n return Array.from(keywords);\n }\n}\n\n/**\n * Nests more specific CSS properties into shorthand ones, e.g.\n * background-position-x -> background-position -> background\n * @param {CSSSnippet[]} snippets\n * @return {CSSSnippet[]}\n */\nfunction nest(snippets) {\n snippets = snippets.sort(snippetsSort);\n const stack = [];\n\n // For sorted list of CSS properties, create dependency graph where each\n // shorthand property contains its more specific one, e.g.\n // backgound -> background-position -> background-position-x\n for (let i = 0, cur, prev; i < snippets.length; i++) {\n cur = snippets[i];\n\n if (!cur.property) {\n // not a CSS property, skip it\n continue;\n }\n\n // Check if current property belongs to one from parent stack.\n // Since `snippets` array is sorted, items are perfectly aligned\n // from shorthands to more specific variants\n while (stack.length) {\n prev = stack[stack.length - 1];\n\n if (cur.property.indexOf(prev.property) === 0\n && cur.property.charCodeAt(prev.property.length) === DASH$1) {\n prev.addDependency(cur);\n stack.push(cur);\n break;\n }\n\n stack.pop();\n }\n\n if (!stack.length) {\n stack.push(cur);\n }\n }\n\n return snippets;\n}\n\n/**\n * A sorting function for array of snippets\n * @param {CSSSnippet} a\n * @param {CSSSnippet} b\n * @return {Number}\n */\nfunction snippetsSort(a, b) {\n if (a.key === b.key) {\n return 0;\n }\n\n return a.key < b.key ? -1 : 1;\n}\n\n/**\n * Check if given string is a keyword candidate\n * @param {String} str\n * @return {Boolean}\n */\nfunction isKeyword$1(str) {\n return /^\\s*[\\w\\-]+/.test(str);\n}\n\nfunction splitValue(value) {\n return String(value).split('|');\n}\n\nconst globalKeywords = ['auto', 'inherit', 'unset'];\nconst unitlessProperties = [\n 'z-index', 'line-height', 'opacity', 'font-weight', 'zoom',\n 'flex', 'flex-grow', 'flex-shrink'\n];\nconst unitAliases = {\n e :'em',\n p: '%',\n x: 'ex',\n r: 'rem'\n};\n\n/**\n * For every node in given `tree`, finds matching snippet from `registry` and\n * updates node with snippet data.\n *\n * This resolver uses fuzzy matching for searching matched snippets and their\n * keyword values.\n */\n\nvar index = function(tree, registry) {\n\tconst snippets = convertToCSSSnippets(registry);\n\ttree.walk(node => resolveNode(node, snippets));\n\treturn tree;\n};\n\nfunction convertToCSSSnippets(registry) {\n return cssSnippets(registry.all({type: 'string'}))\n}\n\n/**\n * Resolves given node: finds matched CSS snippets using fuzzy match and resolves\n * keyword aliases from node value\n * @param {Node} node\n * @param {CSSSnippet[]} snippets\n * @return {Node}\n */\nfunction resolveNode(node, snippets) {\n\tconst snippet = findBestMatch(node.name, snippets, 'key');\n\n\tif (!snippet) {\n\t\t// Edge case: `!important` snippet\n\t\treturn node.name === '!' ? setNodeAsText(node, '!important') : node;\n\t}\n\n\treturn snippet.property\n\t\t? resolveAsProperty(node, snippet)\n\t\t: resolveAsSnippet(node, snippet);\n}\n\n/**\n * Resolves given parsed abbreviation node as CSS propery\n * @param {Node} node\n * @param {CSSSnippet} snippet\n * @return {Node}\n */\nfunction resolveAsProperty(node, snippet) {\n const abbr = node.name;\n\tnode.name = snippet.property;\n\n\tif (node.value && typeof node.value === 'object') {\n\t\t// resolve keyword shortcuts\n\t\tconst keywords = snippet.keywords();\n\n\t\tif (!node.value.size) {\n\t\t\t// no value defined, try to resolve unmatched part as a keyword alias\n\t\t\tlet kw = findBestMatch(getUnmatchedPart(abbr, snippet.key), keywords);\n\n if (!kw) {\n // no matching value, try to get default one\n kw = snippet.defaulValue;\n if (kw && kw.indexOf('${') === -1) {\n // Quick and dirty test for existing field. If not, wrap\n // default value in a field\n kw = `\\${1:${kw}}`;\n }\n }\n\n\t\t\tif (kw) {\n\t\t\t\tnode.value.add(kw);\n\t\t\t}\n\t\t} else {\n\t\t\t// replace keyword aliases in current node value\n\t\t\tfor (let i = 0, token; i < node.value.value.length; i++) {\n\t\t\t\ttoken = node.value.value[i];\n\n\t\t\t\tif (token === '!') {\n\t\t\t\t\ttoken = `${!i ? '${1} ' : ''}!important`;\n\t\t\t\t} else if (isKeyword(token)) {\n\t\t\t\t\ttoken = findBestMatch(token.value, keywords)\n\t\t\t\t\t\t|| findBestMatch(token.value, globalKeywords)\n\t\t\t\t\t\t|| token;\n\t\t\t\t} else if (isNumericValue(token)) {\n token = resolveNumericValue(node.name, token);\n }\n\n node.value.value[i] = token;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn node;\n}\n\n/**\n * Resolves given parsed abbreviation node as a snippet: a plain code chunk\n * @param {Node} node\n * @param {CSSSnippet} snippet\n * @return {Node}\n */\nfunction resolveAsSnippet(node, snippet) {\n\treturn setNodeAsText(node, snippet.value);\n}\n\n/**\n * Sets given parsed abbreviation node as a text snippet\n * @param {Node} node\n * @param {String} text\n * @return {Node}\n */\nfunction setNodeAsText(node, text) {\n\tnode.name = null;\n\tnode.value = text;\n\treturn node;\n}\n\n/**\n * Finds best matching item from `items` array\n * @param {String} abbr Abbreviation to match\n * @param {Array} items List of items for match\n * @param {String} [key] If `items` is a list of objects, use `key` as object\n * property to test against\n * @return {*}\n */\nfunction findBestMatch(abbr, items, key) {\n\tif (!abbr) {\n\t\treturn null;\n\t}\n\n\tlet matchedItem = null;\n\tlet maxScore = 0;\n\n\tfor (let i = 0, item; i < items.length; i++) {\n\t\titem = items[i];\n\t\tconst score = stringScore(abbr, getScoringPart(item, key));\n\n\t\tif (score === 1) {\n\t\t\t// direct hit, no need to look further\n\t\t\treturn item;\n\t\t}\n\n\t\tif (score && score >= maxScore) {\n\t\t\tmaxScore = score;\n\t\t\tmatchedItem = item;\n\t\t}\n\t}\n\n\treturn matchedItem;\n}\n\nfunction getScoringPart(item, key) {\n const value = item && typeof item === 'object' ? item[key] : item;\n const m = (value || '').match(/^[\\w-@]+/);\n return m ? m[0] : value;\n}\n\n/**\n * Returns a part of `abbr` that wasn’t directly matched agains `string`.\n * For example, if abbreviation `poas` is matched against `position`, the unmatched part will be `as`\n * since `a` wasn’t found in string stream\n * @param {String} abbr\n * @param {String} string\n * @return {String}\n */\nfunction getUnmatchedPart(abbr, string) {\n\tfor (let i = 0, lastPos = 0; i < abbr.length; i++) {\n\t\tlastPos = string.indexOf(abbr[i], lastPos);\n\t\tif (lastPos === -1) {\n\t\t\treturn abbr.slice(i);\n\t\t}\n lastPos++;\n\t}\n\n\treturn '';\n}\n\n/**\n * Check if given CSS value token is a keyword\n * @param {*} token\n * @return {Boolean}\n */\nfunction isKeyword(token) {\n\treturn tokenTypeOf(token, 'keyword');\n}\n\n/**\n * Check if given CSS value token is a numeric value\n * @param {*} token\n * @return {Boolean}\n */\nfunction isNumericValue(token) {\n return tokenTypeOf(token, 'numeric');\n}\n\nfunction tokenTypeOf(token, type) {\n\treturn token && typeof token === 'object' && token.type === type;\n}\n\n/**\n * Resolves numeric value for given CSS property\n * @param {String} property CSS property name\n * @param {NumericValue} token CSS numeric value token\n * @return {NumericValue}\n */\nfunction resolveNumericValue(property, token) {\n if (token.unit) {\n token.unit = unitAliases[token.unit] || token.unit;\n } else if (token.value !== 0 && unitlessProperties.indexOf(property) === -1) {\n // use `px` for integers, `em` for floats\n // NB: num|0 is a quick alternative to Math.round(0)\n token.unit = token.value === (token.value|0) ? 'px' : 'em';\n }\n\n return token;\n}\n\nexport { convertToCSSSnippets, stringScore, cssSnippets };export default index;\n","'use strict';\n\nimport { createSnippetsRegistry, isStylesheet } from '@emmetio/expand-abbreviation';\nimport { convertToCSSSnippets } from '@emmetio/css-snippets-resolver';\nimport detectSyntax from './detect-syntax';\nimport expandAbbreviation, { expandAndInsert, snippetsFromOptions } from './expand-abbreviation';\nimport { removeFields } from './utils';\n\n/**\n * Returns available completions from given editor\n * @param {CodeMirror} editor\n * @param {String} abbrModel Parsed Emmet abbreviation model for which\n * completions should be populated\n * (see `createAbbreviationModel()`)\n * @param {CodeMirror.Pos} abbrPos Abbreviation location in editor\n * @param {CodeMirror.Pos} [cursorPos] Cursor position in editor\n * @return {EmmetCompletion[]}\n */\nexport default function(editor, abbrModel, abbrPos, cursorPos) {\n\tcursorPos = cursorPos || editor.getCursor();\n\tconst syntax = detectSyntax(editor, cursorPos);\n\tif (!syntax) {\n\t\t// Unsupported syntax\n\t\treturn [];\n\t}\n\n\treturn isStylesheet(syntax)\n\t\t? getStylesheetCompletions(editor, abbrModel, abbrPos, cursorPos)\n\t\t: getMarkupCompletions(editor, abbrModel, abbrPos, cursorPos);\n}\n\n/**\n * Returns completions for markup syntaxes (HTML, Slim, Pug etc.)\n * @param {CodeMirror} editor\n * @param {Object} abbrModel Parsed Emmet abbreviation model for which\n * completions should be populated\n * (see `createAbbreviationModel()`)\n * @param {CodeMirror.Pos} abbrPos Abbreviation location in editor\n * @param {CodeMirror.Pos} [cursorPos] Cursor position in editor\n * @return {EmmetCompletion[]}\n */\nexport function getMarkupCompletions(editor, abbrModel, abbrPos, cursorPos) {\n\tlet result = [];\n\tcursorPos = cursorPos || editor.getCursor();\n\n\tconst abbrRange = {\n\t\tfrom: abbrPos,\n\t\tto: { line: abbrPos.line, ch: abbrPos.ch + abbrModel.abbreviation.length }\n\t};\n\n\tresult.push(new EmmetCompletion('expanded-abbreviation', editor, abbrRange, 'Expand abbreviation',\n\t\tabbrModel.snippet, () => expandAndInsert(editor, abbrModel.abbreviation, abbrRange)));\n\n\t// Make sure that current position precedes element name (e.g. not attribute,\n\t// class, id etc.)\n\tconst prefix = getMarkupPrefix(abbrModel.abbreviation, cursorPos.ch - abbrPos.ch);\n\tif (prefix !== null) {\n\t\tconst prefixRange = {\n\t\t\tfrom: { line: cursorPos.line, ch: cursorPos.ch - prefix.length },\n\t\t\tto: cursorPos\n\t\t};\n\n\t\tconst completions = getSnippetCompletions(editor, cursorPos)\n\t\t.filter(snippet => snippet.key !== prefix && snippet.key.indexOf(prefix) === 0)\n\t\t.map(snippet => new EmmetCompletion('snippet', editor, prefixRange, snippet.key,\n\t\t\tsnippet.preview, snippet.key));\n\n\t\tresult = result.concat(completions);\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns completions for stylesheet syntaxes\n * @param {CodeMirror} editor\n * @param {Object} abbrModel\n * @param {CodeMirror.Pos} abbrPos\n * @param {CodeMirror.Pos} cursorPos\n * @return {EmmetCompletion[]}\n */\nfunction getStylesheetCompletions(editor, abbrModel, abbrPos, cursorPos) {\n\tlet result = [];\n\tcursorPos = cursorPos || editor.getCursor();\n\n\tconst abbrRange = {\n\t\tfrom: abbrPos,\n\t\tto: { line: abbrPos.line, ch: abbrPos.ch + abbrModel.abbreviation.length }\n\t};\n\n\tresult.push(new EmmetCompletion('expanded-abbreviation', editor, abbrRange, 'Expand abbreviation',\n\t\tabbrModel.snippet, () => expandAndInsert(editor, abbrModel.abbreviation, abbrRange)));\n\n\t// Make sure that current position precedes element name (e.g. not attribute,\n\t// class, id etc.)\n\tconst prefix = getStylesheetPrefix(abbrModel.abbreviation, cursorPos.ch - abbrPos.ch);\n\tif (prefix !== null) {\n\t\tconst prefixRange = {\n\t\t\tfrom: { line: cursorPos.line, ch: cursorPos.ch - prefix.length },\n\t\t\tto: cursorPos\n\t\t};\n\n\t\tconst completions = getSnippetCompletions(editor, cursorPos)\n\t\t.filter(snippet => snippet.key !== prefix && snippet.key.indexOf(prefix) === 0)\n\t\t.map(snippet => new EmmetCompletion('snippet', editor, prefixRange,\n\t\t\tsnippet.key, snippet.preview, snippet.key));\n\n\t\tresult = result.concat(completions);\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns all possible snippets completions for given editor context.\n * Completions are cached in editor for for re-use\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} pos\n * @return {Array}\n */\nfunction getSnippetCompletions(editor, pos) {\n\tconst syntax = detectSyntax(editor, pos);\n\n\tif (!editor.state.emmetCompletions) {\n\t\teditor.state.emmetCompletions = {};\n\t}\n\n\tconst cache = editor.state.emmetCompletions;\n\n\tif (!(syntax in cache)) {\n\t\tconst registry = createSnippetsRegistry(syntax, snippetsFromOptions(editor, syntax));\n\n\t\tif (isStylesheet(syntax)) {\n\t\t\t// Collect snippets for stylesheet context: just a plain list of\n\t\t\t// snippets, converted specifically for CSS context\n\t\t\tcache[syntax] = convertToCSSSnippets(registry).map(snippet => {\n\t\t\t\tlet preview = snippet.property;\n\t\t\t\tconst keywords = snippet.keywords();\n\t\t\t\tif (keywords.length) {\n\t\t\t\t\tpreview += `: ${removeFields(keywords.join(' | '))}`;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tkey: snippet.key,\n\t\t\t\t\tvalue: snippet.value,\n\t\t\t\t\tkeywords,\n\t\t\t\t\tpreview\n\t\t\t\t};\n\t\t\t});\n\t\t} else {\n\t\t\t// Collect snippets for markup syntaxes: HTML, XML, Slim, Pug etc.\n\t\t\t// Not just a plain snippets list but thier expanded result as well\n\t\t\tconst field = (index, placeholder) => placeholder || '';\n\t\t\tconst expandOpt = { syntax, field };\n\n\t\t\tcache[syntax] = registry.all({type: 'string'}).map(snippet => ({\n\t\t\t\tkey: snippet.key,\n\t\t\t\tvalue: snippet.value,\n\t\t\t\tpreview: expandAbbreviation(snippet.value, editor, expandOpt)\n\t\t\t}));\n\t\t}\n\t}\n\n\treturn cache[syntax];\n}\n\n/**\n * Returns node element prefix, if applicable, for given `pos` in abbreviation\n * for markup syntaxes completions\n * @param {String} abbr\n * @param {Number} pos\n * @return {String} Returns `null` if not in element name context\n */\nfunction getMarkupPrefix(abbr, pos) {\n\treturn getPrefix(abbr, pos, /[\\w:\\-\\$@]+$/);\n}\n\n/**\n * Returns node element prefix, if applicable, for given `pos` in abbreviation\n * for stylesheet syntaxes completions\n * @param {String} abbr\n * @param {Number} pos\n * @return {String} Returns `null` if not in element name context\n */\nfunction getStylesheetPrefix(abbr, pos) {\n\treturn getPrefix(abbr, pos, /[\\w-@$]+$/);\n}\n\n/**\n * Get snippet completion prefix that matches given `match` regexp from `pos`\n * character pasition of given `abbr` abbreviation\n * @param {String} abbr\n * @param {Number} pos\n * @param {RegExp} match\n * @return {String}\n */\nfunction getPrefix(abbr, pos, match) {\n\tif (pos === 0) {\n\t\t// Word prefix is at the beginning of abbreviation: it’s an element\n\t\t// context for sure\n\t\treturn '';\n\t}\n\n\tconst m = abbr.slice(0, pos).match(match);\n\tconst prefix = m && m[0] || '';\n\n\t// Check if matched prefix is either at the beginning of abbreviation or\n\t// at the element bound, e.g. right after operator\n\tif (prefix && (prefix === abbr || /[>\\^\\+\\(\\)]/.test(abbr[pos - prefix.length - 1]))) {\n\t\treturn prefix;\n\t}\n\n\treturn null;\n}\n\nclass EmmetCompletion {\n\tconstructor(type, editor, range, label, preview, snippet) {\n\t\tthis.type = type;\n\t\tthis.editor = editor;\n\t\tthis.range = range;\n\t\tthis.label = label;\n\t\tthis.preview = preview;\n\t\tthis.snippet = snippet;\n\n\t\tthis._inserted = false;\n\t}\n\n\tinsert() {\n\t\tif (!this._inserted) {\n\t\t\tthis._inserted = true;\n\t\t\tif (typeof this.snippet === 'function') {\n\t\t\t\tthis.snippet(this.editor, this.range);\n\t\t\t} else {\n\t\t\t\tthis.editor.replaceRange(this.snippet, this.range.from, this.range.to);\n\n\t\t\t\t// Position cursor\n\t\t\t\tconst startIx = this.editor.indexFromPos(this.range.from);\n\t\t\t\tconst newCursor = this.editor.posFromIndex(startIx + this.snippet.length);\n\t\t\t\tthis.editor.setCursor(newCursor);\n\t\t\t}\n\t\t}\n\t}\n};\n","/**\n * Methods for consuming quoted values\n */\n\nconst SINGLE_QUOTE = 39; // '\nconst DOUBLE_QUOTE = 34; // \"\n\nconst defaultOptions = {\n\tescape: 92, // \\ character\n\tthrows: false\n};\n\n/**\n * Consumes 'single' or \"double\"-quoted string from given string, if possible\n * @param {StreamReader} stream\n * @param {Number} options.escape A character code of quote-escape symbol\n * @param {Boolean} options.throws Throw error if quotes string can’t be properly consumed\n * @return {Boolean} `true` if quoted string was consumed. The contents\n * of quoted string will be availabe as `stream.current()`\n */\nvar eatQuoted = function(stream, options) {\n\toptions = options ? Object.assign({}, defaultOptions, options) : defaultOptions;\n\tconst start = stream.pos;\n\tconst quote = stream.peek();\n\n\tif (stream.eat(isQuote)) {\n\t\twhile (!stream.eof()) {\n\t\t\tswitch (stream.next()) {\n\t\t\t\tcase quote:\n\t\t\t\t\tstream.start = start;\n\t\t\t\t\treturn true;\n\n\t\t\t\tcase options.escape:\n\t\t\t\t\tstream.next();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we’re here then stream wasn’t properly consumed.\n\t\t// Revert stream and decide what to do\n\t\tstream.pos = start;\n\n\t\tif (options.throws) {\n\t\t\tthrow stream.error('Unable to consume quoted string');\n\t\t}\n\t}\n\n\treturn false;\n};\n\nfunction isQuote(code) {\n\treturn code === SINGLE_QUOTE || code === DOUBLE_QUOTE;\n}\n\n/**\n * Check if given code is a number\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isNumber(code) {\n\treturn code > 47 && code < 58;\n}\n\n/**\n * Check if given character code is alpha code (letter through A to Z)\n * @param {Number} code\n * @param {Number} [from]\n * @param {Number} [to]\n * @return {Boolean}\n */\nfunction isAlpha(code, from, to) {\n\tfrom = from || 65; // A\n\tto = to || 90; // Z\n\tcode &= ~32; // quick hack to convert any char code to uppercase char code\n\n\treturn code >= from && code <= to;\n}\n\n/**\n * Check if given character code is alpha-numeric (letter through A to Z or number)\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isAlphaNumeric(code) {\n\treturn isNumber(code) || isAlpha(code);\n}\n\nfunction isWhiteSpace(code) {\n\treturn code === 32 /* space */\n\t\t|| code === 9 /* tab */\n\t\t|| code === 160; /* non-breaking space */\n}\n\n/**\n * Check if given character code is a space\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isSpace(code) {\n\treturn isWhiteSpace(code)\n\t\t|| code === 10 /* LF */\n\t\t|| code === 13; /* CR */\n}\n\nconst defaultOptions$1 = {\n\tescape: 92, // \\ character\n\tthrows: false\n};\n\n/**\n * Eats paired characters substring, for example `(foo)` or `[bar]`\n * @param {StreamReader} stream\n * @param {Number} open Character code of pair openinig\n * @param {Number} close Character code of pair closing\n * @param {Object} [options]\n * @return {Boolean} Returns `true` if chacarter pair was successfully\n * consumed, it’s content will be available as `stream.current()`\n */\nfunction eatPair(stream, open, close, options) {\n\toptions = options ? Object.assign({}, defaultOptions$1, options) : defaultOptions$1;\n\tconst start = stream.pos;\n\n\tif (stream.eat(open)) {\n\t\tlet stack = 1, ch;\n\n\t\twhile (!stream.eof()) {\n\t\t\tif (eatQuoted(stream, options)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tch = stream.next();\n\t\t\tif (ch === open) {\n\t\t\t\tstack++;\n\t\t\t} else if (ch === close) {\n\t\t\t\tstack--;\n\t\t\t\tif (!stack) {\n\t\t\t\t\tstream.start = start;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (ch === options.escape) {\n\t\t\t\tstream.next();\n\t\t\t}\n\t\t}\n\n\t\t// If we’re here then paired character can’t be consumed\n\t\tstream.pos = start;\n\n\t\tif (options.throws) {\n\t\t\tthrow stream.error(`Unable to find matching pair for ${String.fromCharCode(open)}`);\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport { eatQuoted, isQuote, isAlpha, isNumber, isAlphaNumeric, isSpace, isWhiteSpace, eatPair };\n","import StreamReader from '@emmetio/stream-reader';\nimport { eatPair, eatQuoted, isAlphaNumeric, isQuote, isSpace } from '@emmetio/stream-reader-utils';\n\nclass Node {\n\tconstructor(stream, type, open, close) {\n\t\tthis.stream = stream;\n\t\tthis.type = type;\n\t\tthis.open = open;\n\t\tthis.close = close;\n\n\t\tthis.children = [];\n\t\tthis.parent = null;\n\t}\n\n\t/**\n\t * Returns node name\n\t * @return {String}\n\t */\n\tget name() {\n\t\tif (this.type === 'tag' && this.open) {\n\t\t\treturn this.open && this.open.name && this.open.name.value;\n\t\t}\n\n\t\treturn '#' + this.type;\n\t}\n\n\t/**\n\t * Returns attributes of current node\n\t * @return {Array}\n\t */\n\tget attributes() {\n\t\treturn this.open && this.open.attributes;\n\t}\n\n\t/**\n\t * Returns node’s start position in stream\n\t * @return {*}\n\t */\n\tget start() {\n\t\treturn this.open && this.open.start;\n\t}\n\n\t/**\n\t * Returns node’s start position in stream\n\t * @return {*}\n\t */\n\tget end() {\n\t\treturn this.close ? this.close.end : this.open && this.open.end;\n\t}\n\n\tget firstChild() {\n\t\treturn this.children[0];\n\t}\n\n\tget nextSibling() {\n\t\tconst ix = this.getIndex();\n\t\treturn ix !== -1 ? this.parent.children[ix + 1] : null;\n\t}\n\n\tget previousSibling() {\n\t\tconst ix = this.getIndex();\n\t\treturn ix !== -1 ? this.parent.children[ix - 1] : null;\n\t}\n\n\t/**\n\t * Returns current element’s index in parent list of child nodes\n\t * @return {Number}\n\t */\n\tgetIndex() {\n\t\treturn this.parent ? this.parent.children.indexOf(this) : -1;\n\t}\n\n\t/**\n\t * Adds given node as a child\n\t * @param {Node} node\n\t * @return {Node} Current node\n\t */\n\taddChild(node) {\n\t\tthis.removeChild(node);\n\t\tthis.children.push(node);\n\t\tnode.parent = this;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes given node from current node’s child list\n\t * @param {Node} node\n\t * @return {Node} Current node\n\t */\n\tremoveChild(node) {\n\t\tconst ix = this.children.indexOf(node);\n\t\tif (ix !== -1) {\n\t\t\tthis.children.splice(ix, 1);\n\t\t\tnode.parent = null;\n\t\t}\n\n\t\treturn this;\n\t}\n}\n\n/**\n * A token factory method\n * @param {StreamReader} stream\n * @param {Point|Function} start Tokens’ start location or stream consumer\n * @param {Point} [end] Tokens’ end location\n * @return {Token}\n */\nvar token = function(stream, start, end) {\n\treturn typeof start === 'function'\n\t\t? eatToken(stream, start)\n\t\t: new Token(stream, start, end);\n};\n\n/**\n * Consumes characters from given stream that matches `fn` call and returns it\n * as token, if consumed\n * @param {StreamReader} stream\n * @param {Function} test\n * @return {Token}\n */\nfunction eatToken(stream, test) {\n\tconst start = stream.pos;\n\tif (stream.eatWhile(test)) {\n\t\treturn new Token(stream, start, stream.pos);\n\t}\n\n\tstream.pos = start;\n}\n\n/**\n * A structure describing text fragment in content stream\n */\nclass Token {\n\t/**\n\t * @param {ContentStreamReader} stream\n\t * @param {Point} start Tokens’ start location in content stream\n\t * @param {Point} end Tokens’ end location in content stream\n\t */\n\tconstructor(stream, start, end) {\n\t\tthis.stream = stream;\n\t\tthis.start = start != null ? start : stream.start;\n\t\tthis.end = end != null ? end : stream.pos;\n\t\tthis._value = null;\n\t}\n\n\t/**\n\t * Returns token textual value\n\t * NB implemented as getter to reduce unnecessary memory allocations for\n\t * strings that not required\n\t * @return {String}\n\t */\n\tget value() {\n\t\tif (this._value === null) {\n\t\t\tconst start = this.stream.start;\n\t\t\tconst end = this.stream.pos;\n\n\t\t\tthis.stream.start = this.start;\n\t\t\tthis.stream.pos = this.end;\n\t\t\tthis._value = this.stream.current();\n\n\t\t\tthis.stream.start = start;\n\t\t\tthis.stream.pos = end;\n\t\t}\n\n\t\treturn this._value;\n\t}\n\n\ttoString() {\n\t\treturn this.value;\n\t}\n\n\tvalueOf() {\n\t\treturn `${this.value} [${this.start}; ${this.end}]`;\n\t}\n}\n\nconst LANGLE = 60;\nconst RANGLE = 62; // < and >\nconst LSQUARE = 91;\nconst RSQUARE = 93; // [ and ]\nconst LROUND = 40;\nconst RROUND = 41; // ( and )\nconst LCURLY = 123;\nconst RCURLY = 125; // { and }\n\nconst opt = { throws: true };\n\n/**\n * Consumes paired tokens (like `[` and `]`) with respect of nesting and embedded\n * quoted values\n * @param {StreamReader} stream\n * @return {Token} A token with consumed paired character\n */\nvar eatPaired = function(stream) {\n\tconst start = stream.pos;\n\tconst consumed = eatPair(stream, LANGLE, RANGLE, opt)\n\t\t|| eatPair(stream, LSQUARE, RSQUARE, opt)\n\t\t|| eatPair(stream, LROUND, RROUND, opt)\n\t\t|| eatPair(stream, LCURLY, RCURLY, opt);\n\n\tif (consumed) {\n\t\treturn token(stream, start);\n\t}\n};\n\nconst SLASH$1 = 47; // /\nconst EQUALS = 61; // =\nconst RIGHT_ANGLE$1 = 62; // >\n\n/**\n * Consumes attributes from given stream\n * @param {StreamReader} stream\n * @return {Array} Array of consumed attributes\n */\nvar eatAttributes = function(stream) {\n\tconst result = [];\n\tlet name, value, attr;\n\n\twhile (!stream.eof()) {\n\t\tstream.eatWhile(isSpace);\n\t\tattr = { start: stream.pos };\n\n\t\t// A name could be a regular name or expression:\n\t\t// React-style – <div {...props}>\n\t\t// Angular-style – <div [ng-for]>\n\t\tif (attr.name = eatAttributeName(stream)) {\n\t\t\t// Consumed attribute name. Can be an attribute with name\n\t\t\t// or boolean attribute. The value can be React-like expression\n\t\t\tif (stream.eat(EQUALS)) {\n\t\t\t\tattr.value = eatAttributeValue(stream);\n\t\t\t} else {\n\t\t\t\tattr.boolean = true;\n\t\t\t}\n\t\t\tattr.end = stream.pos;\n\t\t\tresult.push(attr);\n\t\t} else if (isTerminator(stream.peek())) {\n\t\t\t// look for tag terminator in order to skip any other possible characters\n\t\t\t// (maybe junk)\n\t\t\tbreak;\n\t\t} else {\n\t\t\tstream.next();\n\t\t}\n\t}\n\n\treturn result;\n};\n\n/**\n * Consumes attribute name from current location\n * @param {StreamReader} stream\n * @return {Token}\n */\nfunction eatAttributeName(stream) {\n\treturn eatPaired(stream) || token(stream, isAttributeName);\n}\n\n/**\n * Consumes attribute value from given location\n * @param {StreamReader} stream\n * @return {Token}\n */\nfunction eatAttributeValue(stream) {\n\tconst start = stream.pos;\n\tif (eatQuoted(stream)) {\n\t\t// Should return token that points to unquoted value.\n\t\t// Use stream readers’ public API to traverse instead of direct\n\t\t// manipulation\n\t\tconst current = stream.pos;\n\t\tlet valueStart, valueEnd;\n\n\t\tstream.pos = start;\n\t\tstream.next();\n\t\tvalueStart = stream.start = stream.pos;\n\n\t\tstream.pos = current;\n\t\tstream.backUp(1);\n\t\tvalueEnd = stream.pos;\n\n\t\tconst result = token(stream, valueStart, valueEnd);\n\t\tstream.pos = current;\n\t\treturn result;\n\t}\n\n\treturn eatPaired(stream) || eatUnquoted(stream);\n}\n\n/**\n * Check if given code belongs to attribute name.\n * NB some custom HTML variations allow non-default values in name, like `*ngFor`\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isAttributeName(code) {\n\treturn code !== EQUALS && !isTerminator(code) && !isSpace(code);\n}\n\n/**\n * Check if given code is tag terminator\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isTerminator(code) {\n\treturn code === RIGHT_ANGLE$1 || code === SLASH$1;\n}\n\n/**\n * Eats unquoted value from stream\n * @param {StreamReader} stream\n * @return {Token}\n */\nfunction eatUnquoted(stream) {\n\treturn token(stream, isUnquoted);\n}\n\n/**\n * Check if given character code is valid unquoted value\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isUnquoted(code) {\n\treturn !isNaN(code) && !isQuote(code) && !isSpace(code) && !isTerminator(code);\n}\n\nconst DASH = 45; // -\nconst DOT = 46; // .\nconst SLASH = 47; // /\nconst COLON = 58; // :\nconst LEFT_ANGLE = 60; // <\nconst RIGHT_ANGLE = 62; // >\nconst UNDERSCORE = 95; // _\n\n/**\n * Parses tag definition (open or close tag) from given stream state\n * @param {StreamReader} stream Content stream reader\n * @return {Object}\n */\nvar tag = function(stream) {\n\tconst start = stream.pos;\n\n\tif (stream.eat(LEFT_ANGLE)) {\n\t\tconst model = { type: stream.eat(SLASH) ? 'close' : 'open' };\n\n\t\tif (model.name = eatTagName(stream)) {\n\t\t\tif (model.type !== 'close') {\n\t\t\t\tmodel.attributes = eatAttributes(stream);\n\t\t\t\tstream.eatWhile(isSpace);\n\t\t\t\tmodel.selfClosing = stream.eat(SLASH);\n\t\t\t}\n\n\t\t\tif (stream.eat(RIGHT_ANGLE)) {\n\t\t\t\t// tag properly closed\n\t\t\t\treturn Object.assign(token(stream, start), model);\n\t\t\t}\n\t\t}\n\t}\n\n\t// invalid tag, revert to original position\n\tstream.pos = start;\n\treturn null;\n};\n\n/**\n * Eats HTML identifier (tag or attribute name) from given stream\n * @param {StreamReader} stream\n * @return {Token}\n */\nfunction eatTagName(stream) {\n\treturn token(stream, isTagName);\n}\n\n/**\n * Check if given character code can be used as HTML/XML tag name\n * @param {Number} code\n * @return {Boolean}\n */\nfunction isTagName(code) {\n\treturn isAlphaNumeric(code)\n\t\t|| code === COLON // colon is used for namespaces\n\t\t|| code === DOT // in rare cases declarative tag names may have dots in names\n\t\t|| code === DASH\n\t\t|| code === UNDERSCORE;\n}\n\n/**\n * Eats array of character codes from given stream\n * @param {StreamReader} stream\n * @param {Number[]} codes Array of character codes\n * @return {Boolean}\n */\nfunction eatArray(stream, codes) {\n\tconst start = stream.pos;\n\n\tfor (let i = 0; i < codes.length; i++) {\n\t\tif (!stream.eat(codes[i])) {\n\t\t\tstream.pos = start;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tstream.start = start;\n\treturn true;\n}\n\n/**\n * Consumes section from given string which starts with `open` character codes\n * and ends with `close` character codes\n * @param {StreamReader} stream\n * @param {Number[]} open\n * @param {Number[]} close\n * @return {Boolean} Returns `true` if section was consumed\n */\nfunction eatSection(stream, open, close, allowUnclosed) {\n\tconst start = stream.pos;\n\tif (eatArray(stream, open)) {\n\t\t// consumed `<!--`, read next until we find ending part or reach the end of input\n\t\twhile (!stream.eof()) {\n\t\t\tif (eatArray(stream, close)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstream.next();\n\t\t}\n\n\t\t// unclosed section is allowed\n\t\tif (allowUnclosed) {\n\t\t\treturn true;\n\t\t}\n\n\t\tstream.pos = start;\n\t\treturn false;\n\t}\n\n\t// unable to find section, revert to initial position\n\tstream.pos = start;\n\treturn null;\n}\n\n/**\n * Converts given string into array of character codes\n * @param {String} str\n * @return {Number[]}\n */\nfunction toCharCodes(str) {\n\treturn str.split('').map(ch => ch.charCodeAt(0));\n}\n\nconst open = toCharCodes('<!--');\nconst close = toCharCodes('-->');\n\n/**\n * Consumes HTML comment from given stream\n * @param {StreamReader} stream\n * @return {Token}\n */\nvar comment = function(stream) {\n\tconst start = stream.pos;\n\tif (eatSection(stream, open, close, true)) {\n\t\tconst result = token(stream, start);\n\t\tresult.type = 'comment';\n\t\treturn result;\n\t}\n\n\treturn null;\n};\n\nconst open$1 = toCharCodes('<![CDATA[');\nconst close$1 = toCharCodes(']]>');\n\n/**\n * Consumes CDATA from given stream\n * @param {StreamReader} stream\n * @return {Token}\n */\nvar cdata = function(stream) {\n\tconst start = stream.pos;\n\tif (eatSection(stream, open$1, close$1, true)) {\n\t\tconst result = token(stream, start);\n\t\tresult.type = 'cdata';\n\t\treturn result;\n\t}\n\n\treturn null;\n};\n\nconst defaultOptions = {\n\t/**\n\t * Expect XML content in searching content. It alters how should-be-empty\n\t * elements are treated: for example, in XML mode parser will try to locate\n\t * closing pair for `<br>` tag\n\t * @type {Boolean}\n\t */\n\txml: false,\n\n\tspecial: ['script', 'style'],\n\n\t/**\n\t * List of elements that should be treated as empty (e.g. without closing tag)\n\t * in non-XML syntax\n\t * @type {Array}\n\t */\n\tempty: ['img', 'meta', 'link', 'br', 'base', 'hr', 'area', 'wbr']\n};\n\n/**\n * Parses given content into a DOM-like structure\n * @param {String|StreamReader} content\n * @param {Object} options\n * @return {Node}\n */\nfunction parse(content, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\tconst stream = typeof content === 'string'\n\t\t? new StreamReader(content)\n\t\t: content;\n\n\tconst root = new Node(stream, 'root');\n\tconst empty = new Set(options.empty);\n\tconst special = options.special.reduce(\n\t\t(map, name) => map.set(name, toCharCodes(`</${name}>`)), new Map());\n\tconst isEmpty = (token, name) =>\n\t\ttoken.selfClosing || (!options.xml && empty.has(name));\n\n\tlet m, node, name, stack = [root];\n\n\twhile (!stream.eof()) {\n\t\tif (m = match(stream)) {\n\t\t\tname = getName(m);\n\n\t\t\tif (m.type === 'open') {\n\t\t\t\t// opening tag\n\t\t\t\tnode = new Node(stream, 'tag', m);\n\t\t\t\tlast(stack).addChild(node);\n\t\t\t\tif (special.has(name)) {\n\t\t\t\t\tnode.close = consumeSpecial(stream, special.get(name));\n\t\t\t\t} else if (!isEmpty(m, name)) {\n\t\t\t\t\tstack.push(node);\n\t\t\t\t}\n\t\t\t} else if (m.type === 'close') {\n\t\t\t\t// closing tag, find it’s matching opening tag\n\t\t\t\tfor (let i = stack.length - 1; i > 0; i--) {\n\t\t\t\t\tif (stack[i].name.toLowerCase() === name) {\n\t\t\t\t\t\tstack[i].close = m;\n\t\t\t\t\t\tstack = stack.slice(0, i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlast(stack).addChild(new Node(stream, m.type, m));\n\t\t\t}\n\t\t} else {\n\t\t\tstream.next();\n\t\t}\n\t}\n\n\treturn root;\n}\n\n/**\n * Matches known token in current state of given stream\n * @param {ContentStreamReader} stream\n * @return {Token}\n */\nfunction match(stream) {\n\t// fast-path optimization: check for `<` code\n\tif (stream.peek() === 60 /* < */) {\n\t\treturn comment(stream) || cdata(stream) || tag(stream);\n\t}\n}\n\n/**\n * @param {StreamReader} stream\n * @param {Number[]} codes\n * @return {Token}\n */\nfunction consumeSpecial(stream, codes) {\n\tconst start = stream.pos;\n\tlet m;\n\n\twhile (!stream.eof()) {\n\t\tif (eatArray(stream, codes)) {\n\t\t\tstream.pos = stream.start;\n\t\t\treturn tag(stream);\n\t\t}\n\t\tstream.next();\n\t}\n\n\tstream.pos = start;\n\treturn null;\n}\n\n/**\n * Returns name of given matched token\n * @param {Token} tag\n * @return {String}\n */\nfunction getName(tag$$1) {\n\treturn tag$$1.name ? tag$$1.name.value.toLowerCase() : `#${tag$$1.type}`;\n}\n\nfunction last(arr) {\n\treturn arr[arr.length - 1];\n}\n\nexport { defaultOptions, match };export default parse;\n","'use strict';\n\nimport { containsPos } from '../utils';\n\n/**\n * A syntax-specific model container, used to get unified access to underlying\n * parsed document\n */\nexport default class SyntaxModel {\n\t/**\n\t * @param {Object} dom Parsed document tree\n\t * @param {String} type Type of document (html, stylesheet, etc.)\n\t * @param {String} [syntax] Optional document syntax like html, xhtml or xml\n\t */\n\tconstructor(dom, type, syntax) {\n\t\tthis.dom = dom;\n\t\tthis.type = type;\n\t\tthis.syntax = syntax;\n\t}\n\n\t/**\n\t * Returns best matching node for given point\n\t * @param {CodeMirror.Pos} pos\n\t * @param {Boolean} [exclude] Exclude node’s start and end positions from\n\t * search\n\t * @return {Node}\n\t */\n\tnodeForPoint(pos, exclude) {\n\t\tlet ctx = this.dom.firstChild;\n\t\tlet found = null;\n\n\t\twhile (ctx) {\n\t\t\tif (containsPos(range(ctx), pos, exclude)) {\n\t\t\t\t// Found matching tag. Try to find deeper, more accurate match\n\t\t\t\tfound = ctx;\n\t\t\t\tctx = ctx.firstChild;\n\t\t\t} else {\n\t\t\t\tctx = ctx.nextSibling;\n\t\t\t}\n\t\t}\n\n\t\treturn found;\n\t}\n}\n\nfunction range(node) {\n\treturn {\n\t\tfrom: node.start,\n\t\tto: node.end\n\t};\n}\n","'use strict';\n\nimport parseHTML from '@emmetio/html-matcher';\nimport SyntaxModel from './syntax-model';\nimport StreamReader from '../stream-reader';\n\n/**\n * Creates DOM-like model for given text editor\n * @param {CodeMirror} editor\n * @param {String} syntax\n * @return {Node}\n */\nexport default function create(editor, syntax) {\n\tconst stream = new StreamReader(editor);\n\tconst xml = syntax === 'xml';\n\n\ttry {\n\t\treturn new SyntaxModel(parseHTML(stream, { xml }), 'html', syntax || 'html');\n\t} catch (err) {\n\t\tconsole.warn(err);\n\t}\n}\n","'use babel';\n\nimport parseHTML from './html';\n\nexport default function getModel(editor) {\n\tconst syntax = getSyntax(editor);\n\treturn parseHTML(editor, syntax);\n}\n\nexport function getCachedModel(editor) {\n\tif (!editor.state._emmetModel) {\n\t\teditor.state._emmetModel = getModel(editor);\n\t}\n\n\treturn editor.state._emmetModel;\n}\n\nexport function resetCachedModel(editor) {\n\teditor.state._emmetModel = null;\n}\n\n/**\n * Returns parser-supported syntax of given editor (like 'html', 'css' etc.).\n * Returns `null` if editor’s syntax is unsupported\n * @param {CodeMirror} editor\n * @return {String}\n */\nfunction getSyntax(editor) {\n\tconst mode = editor.getMode();\n\n\tif (mode.name === 'htmlmixed') {\n\t\treturn 'html';\n\t}\n\n\treturn mode.name === 'xml' ? mode.configuration : mode.name;\n}\n","'use strict';\n\nimport { containsPos } from './utils';\n\nconst openTagMark = 'emmet-open-tag';\nconst closeTagMark = 'emmet-close-tag';\n\n/**\n * Finds matching tag pair for given position in editor\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} pos\n * @return {Object}\n */\nexport default function matchTag(editor, pos) {\n\tpos = pos || editor.getCursor();\n\n\t// First, check if there are tag markers in editor\n\tconst marked = getMarkedTag(editor);\n\n\t// If marks found, validate them: make sure cursor is either in open\n\t// or close tag\n\tif (marked) {\n\t\tif (containsPos(marked.open.find(), pos)) {\n\t\t\t// Point is inside open tag, make sure if there’s a closing tag,\n\t\t\t// it matches open tag content\n\t\t\tif (!marked.close || text(editor, marked.open) === text(editor, marked.close)) {\n\t\t\t\treturn marked;\n\t\t\t}\n\t\t} else if (marked.close) {\n\t\t\t// There’s a close tag, make sure pointer is inside it and it matches\n\t\t\t// open tag\n\t\t\tif (containsPos(marked.close.find(), pos) && text(editor, marked.open) === text(editor, marked.close)) {\n\t\t\t\treturn marked;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Markers are not valid anymore, remove them\n\tclearTagMatch(editor);\n\n\t// Find new tag pair from parsed HTML model and mark them\n\tconst node = findTagPair(editor, pos);\n\tif (node && node.type === 'tag') {\n\t\treturn {\n\t\t\topen: createTagMark(editor, node.open.name, openTagMark),\n\t\t\tclose: node.close && createTagMark(editor, node.close.name, closeTagMark)\n\t\t};\n\t}\n}\n\nexport function getMarkedTag(editor) {\n\tlet open, close;\n\teditor.getAllMarks().forEach(mark => {\n\t\tif (mark.className === openTagMark) {\n\t\t\topen = mark;\n\t\t} else if (mark.className === closeTagMark) {\n\t\t\tclose = mark;\n\t\t}\n\t});\n\n\treturn open ? { open, close } : null;\n}\n\n/**\n * Removes all matched tag pair markers from editor\n * @param {CodeMirror} editor\n */\nexport function clearTagMatch(editor) {\n\teditor.getAllMarks().forEach(mark => {\n\t\tif (mark.className === openTagMark || mark.className === closeTagMark) {\n\t\t\tmark.clear();\n\t\t}\n\t});\n}\n\n/**\n * Finds tag pair (open and close, if any) form parsed HTML model of given editor\n * @param {CodeMirror} editor\n * @param {CodeMirror.Pos} pos\n * @return {Object}\n */\nexport function findTagPair(editor, pos) {\n\tconst model = editor.getEmmetDocumentModel();\n\treturn model && model.nodeForPoint(pos || editor.getCursor());\n}\n\nfunction createTagMark(editor, tag, className) {\n\treturn editor.markText(tag.start, tag.end, {\n\t\tclassName,\n\t\tinclusiveLeft: true,\n\t\tinclusiveRight: true,\n\t\tclearWhenEmpty: false\n\t});\n}\n\nfunction text(editor, mark) {\n\tconst range = mark.find();\n\treturn range ? editor.getRange(range.from, range.to) : '';\n}\n","'use strict';\n\nimport { getMarkedTag, clearTagMatch } from './match-tag';\nimport { containsPos } from './utils';\n\nexport default function renameTag(editor, obj) {\n\tconst tag = getMarkedTag(editor);\n\tconst pos = obj.from;\n\n\tif (!tag) {\n\t\treturn;\n\t}\n\n\tif (containsPos(tag.open.find(), pos) && tag.close) {\n\t\t// Update happened inside open tag, update close tag as well\n\t\tupdateTag(editor, tag.open, tag.close);\n\t} else if (tag.close && containsPos(tag.close.find(), pos)) {\n\t\t// Update happened inside close tag, update open tag as well\n\t\tupdateTag(editor, tag.close, tag.open);\n\t}\n}\n\nexport function updateTag(editor, source, dest) {\n\tconst name = text(editor, source);\n\tconst range = dest.find();\n\tconst m = name.match(/[\\w:\\-]+/);\n\tconst newName = !name ? '' : (m && m[0]);\n\n\tif (newName != null) {\n\t\tif (editor.getRange(range.from, range.to) !== newName) {\n\t\t\teditor.replaceRange(newName, range.from, range.to);\n\t\t}\n\t} else {\n\t\t// User entered something that wasn’t a valid tag name.\n\t\tclearTagMatch(editor);\n\t}\n}\n\nfunction text(editor, mark) {\n\tconst range = mark.find();\n\treturn range ? editor.getRange(range.from, range.to) : '';\n}\n","class Snippet {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n }\n}\n\nclass SnippetsStorage {\n constructor(data) {\n this._string = new Map();\n this._regexp = new Map();\n this._disabled = false;\n\n this.load(data);\n }\n\n get disabled() {\n return this._disabled;\n }\n\n /**\n * Disables current store. A disabled store always returns `undefined`\n * on `get()` method\n */\n disable() {\n this._disabled = true;\n }\n\n /**\n * Enables current store.\n */\n enable() {\n this._disabled = false;\n }\n\n /**\n * Registers a new snippet item\n * @param {String|Regexp} key\n * @param {String|Function} value\n */\n set(key, value) {\n if (typeof key === 'string') {\n key.split('|').forEach(k => this._string.set(k, new Snippet(k, value)));\n } else if (key instanceof RegExp) {\n this._regexp.set(key, new Snippet(key, value));\n } else {\n throw new Error('Unknow snippet key: ' + key);\n }\n\n return this;\n }\n\n /**\n * Returns a snippet matching given key. It first tries to find snippet\n * exact match in a string key map, then tries to match one with regexp key\n * @param {String} key\n * @return {Snippet}\n */\n get(key) {\n if (this.disabled) {\n return undefined;\n }\n\n if (this._string.has(key)) {\n return this._string.get(key);\n }\n\n const keys = Array.from(this._regexp.keys());\n for (let i = 0, il = keys.length; i < il; i++) {\n if (keys[i].test(key)) {\n return this._regexp.get(keys[i]);\n }\n }\n }\n\n /**\n * Batch load of snippets data\n * @param {Object|Map} data\n */\n load(data) {\n this.reset();\n if (data instanceof Map) {\n data.forEach((value, key) => this.set(key, value));\n } else if (data && typeof data === 'object') {\n Object.keys(data).forEach(key => this.set(key, data[key]));\n }\n }\n\n /**\n * Clears all stored snippets\n */\n reset() {\n this._string.clear();\n this._regexp.clear();\n }\n\n /**\n * Returns all available snippets from given store\n */\n values() {\n if (this.disabled) {\n return [];\n }\n \n const string = Array.from(this._string.values());\n const regexp = Array.from(this._regexp.values());\n return string.concat(regexp);\n }\n}\n\n/**\n * A snippets registry. Contains snippets, separated by store and sorted by\n * priority: a store with higher priority takes precedence when resolving snippet\n * for given key\n */\nclass SnippetsRegistry {\n /**\n * Creates snippets registry, filled with given `data`\n * @param {Object|Array} data Registry snippets. If array is given, adds items\n * from array in order of precedence, registers global snippets otherwise\n */\n constructor(data) {\n this._registry = [];\n\n if (Array.isArray(data)) {\n data.forEach((snippets, level) => this.add(level, snippets));\n } else if (typeof data === 'object') {\n this.add(data);\n }\n }\n\n /**\n * Return store for given level\n * @param {Number} level\n * @return {SnippetsStorage}\n */\n get(level) {\n for (let i = 0; i < this._registry.length; i++) {\n const item = this._registry[i];\n if (item.level === level) {\n return item.store;\n }\n }\n }\n\n /**\n * Adds new store for given level\n * @param {Number} [level] Store level (priority). Store with higher level\n * takes precedence when resolving snippets\n * @param {Object} [snippets] A snippets data for new store\n * @return {SnipetsStorage}\n */\n add(level, snippets) {\n if (level != null && typeof level === 'object') {\n snippets = level;\n level = 0;\n }\n\n const store = new SnippetsStorage(snippets);\n\n // remove previous store from same level\n this.remove(level);\n\n this._registry.push({level, store});\n this._registry.sort((a, b) => b.level - a.level);\n\n return store;\n }\n\n /**\n * Remove registry with given level or store\n * @param {Number|SnippetsStorage} data Either level or snippets store\n */\n remove(data) {\n this._registry = this._registry\n .filter(item => item.level !== data && item.store !== data);\n }\n\n /**\n * Returns snippet from registry that matches given name\n * @param {String} name\n * @return {Snippet}\n */\n resolve(name) {\n for (let i = 0; i < this._registry.length; i++) {\n const snippet = this._registry[i].store.get(name);\n if (snippet) {\n return snippet;\n }\n }\n }\n\n /**\n * Returns all available snippets from current registry. Snippets with the\n * same key are resolved by their storage priority.\n * @param {Object} options\n * @param {Object} options.type Return snippets only of given type: 'string'\n * or 'regexp'. Returns all snippets if not defined\n * @return {Array}\n */\n all(options) {\n options = options || {};\n const result = new Map();\n\n const fillResult = snippet => {\n const type = snippet.key instanceof RegExp ? 'regexp' : 'string';\n if ((!options.type || options.type === type) && !result.has(snippet.key)) {\n result.set(snippet.key, snippet);\n }\n };\n\n this._registry.forEach(item => {\n item.store.values().forEach(fillResult);\n });\n\n return Array.from(result.values());\n }\n\n /**\n * Removes all stores from registry\n */\n clear() {\n this._registry.length = 0;\n }\n}\n\nexport default SnippetsRegistry;\n","/**\n * A streaming, character code-based string reader\n */\nclass StreamReader {\n\tconstructor(string, start, end) {\n\t\tif (end == null && typeof string === 'string') {\n\t\t\tend = string.length;\n\t\t}\n\n\t\tthis.string = string;\n\t\tthis.pos = this.start = start || 0;\n\t\tthis.end = end;\n\t}\n\n\t/**\n\t * Returns true only if the stream is at the end of the file.\n\t * @returns {Boolean}\n\t */\n\teof() {\n\t\treturn this.pos >= this.end;\n\t}\n\n\t/**\n\t * Creates a new stream instance which is limited to given `start` and `end`\n\t * range. E.g. its `eof()` method will look at `end` property, not actual\n\t * stream end\n\t * @param {Point} start\n\t * @param {Point} end\n\t * @return {StreamReader}\n\t */\n\tlimit(start, end) {\n\t\treturn new this.constructor(this.string, start, end);\n\t}\n\n\t/**\n\t * Returns the next character code in the stream without advancing it.\n\t * Will return NaN at the end of the file.\n\t * @returns {Number}\n\t */\n\tpeek() {\n\t\treturn this.string.charCodeAt(this.pos);\n\t}\n\n\t/**\n\t * Returns the next character in the stream and advances it.\n\t * Also returns <code>undefined</code> when no more characters are available.\n\t * @returns {Number}\n\t */\n\tnext() {\n\t\tif (this.pos < this.string.length) {\n\t\t\treturn this.string.charCodeAt(this.pos++);\n\t\t}\n\t}\n\n\t/**\n\t * `match` can be a character code or a function that takes a character code\n\t * and returns a boolean. If the next character in the stream 'matches'\n\t * the given argument, it is consumed and returned.\n\t * Otherwise, `false` is returned.\n\t * @param {Number|Function} match\n\t * @returns {Boolean}\n\t */\n\teat(match) {\n\t\tconst ch = this.peek();\n\t\tconst ok = typeof match === 'function' ? match(ch) : ch === match;\n\n\t\tif (ok) {\n\t\t\tthis.next();\n\t\t}\n\n\t\treturn ok;\n\t}\n\n\t/**\n\t * Repeatedly calls <code>eat</code> with the given argument, until it\n\t * fails. Returns <code>true</code> if any characters were eaten.\n\t * @param {Object} match\n\t * @returns {Boolean}\n\t */\n\teatWhile(match) {\n\t\tconst start = this.pos;\n\t\twhile (!this.eof() && this.eat(match)) {}\n\t\treturn this.pos !== start;\n\t}\n\n\t/**\n\t * Backs up the stream n characters. Backing it up further than the\n\t * start of the current token will cause things to break, so be careful.\n\t * @param {Number} n\n\t */\n\tbackUp(n) {\n\t\tthis.pos -= (n || 1);\n\t}\n\n\t/**\n\t * Get the string between the start of the current token and the\n\t * current stream position.\n\t * @returns {String}\n\t */\n\tcurrent() {\n\t\treturn this.substring(this.start, this.pos);\n\t}\n\n\t/**\n\t * Returns substring for given range\n\t * @param {Number} start\n\t * @param {Number} [end]\n\t * @return {String}\n\t */\n\tsubstring(start, end) {\n\t\treturn this.string.slice(start, end);\n\t}\n\n\t/**\n\t * Creates error object with current stream state\n\t * @param {String} message\n\t * @return {Error}\n\t */\n\terror(message) {\n\t\tconst err = new Error(`${message} at char ${this.pos + 1}`);\n\t\terr.originalMessage = message;\n\t\terr.pos = this.pos;\n\t\terr.string = this.string;\n\t\treturn err;\n\t}\n}\n\nexport default StreamReader;\n","var html = {\n\t\"a\": \"a[href]\",\n\t\"a:link\": \"a[href='http://${0}']\",\n\t\"a:mail\": \"a[href='mailto:${0}']\",\n\t\"abbr\": \"abbr[title]\",\n\t\"acr|acronym\": \"acronym[title]\",\n\t\"base\": \"base[href]/\",\n\t\"basefont\": \"basefont/\",\n\t\"br\": \"br/\",\n\t\"frame\": \"frame/\",\n\t\"hr\": \"hr/\",\n\t\"bdo\": \"bdo[dir]\",\n\t\"bdo:r\": \"bdo[dir=rtl]\",\n\t\"bdo:l\": \"bdo[dir=ltr]\",\n\t\"col\": \"col/\",\n\t\"link\": \"link[rel=stylesheet href]/\",\n\t\"link:css\": \"link[href='${1:style}.css']\",\n\t\"link:print\": \"link[href='${1:print}.css' media=print]\",\n\t\"link:favicon\": \"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']\",\n\t\"link:touch\": \"link[rel=apple-touch-icon href='${1:favicon.png}']\",\n\t\"link:rss\": \"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']\",\n\t\"link:atom\": \"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']\",\n\t\"link:im|link:import\": \"link[rel=import href='${1:component}.html']\",\n\t\"meta\": \"meta/\",\n\t\"meta:utf\": \"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']\",\n\t\"meta:vp\": \"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']\",\n\t\"meta:compat\": \"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']\",\n\t\"meta:edge\": \"meta:compat[content='${1:ie=edge}']\",\n\t\"meta:redirect\": \"meta[http-equiv=refresh content='0; url=${1:http://example.com}']\",\n\t\"style\": \"style\",\n\t\"script\": \"script[!src]\",\n\t\"script:src\": \"script[src]\",\n\t\"img\": \"img[src alt]/\",\n\t\"img:s|img:srcset\": \"img[srcset src alt]\",\n\t\"img:z|img:sizes\": \"img[sizes srcset src alt]\",\n\t\"picture\": \"picture\",\n\t\"src|source\": \"source/\",\n\t\"src:sc|source:src\": \"source[src type]\",\n\t\"src:s|source:srcset\": \"source[srcset]\",\n\t\"src:t|source:type\": \"source[srcset type='${1:image/}']\",\n\t\"src:z|source:sizes\": \"source[sizes srcset]\",\n\t\"src:m|source:media\": \"source[media='(${1:min-width: })' srcset]\",\n\t\"src:mt|source:media:type\": \"source:media[type='${2:image/}']\",\n\t\"src:mz|source:media:sizes\": \"source:media[sizes srcset]\",\n\t\"src:zt|source:sizes:type\": \"source[sizes srcset type='${1:image/}']\",\n\t\"iframe\": \"iframe[src frameborder=0]\",\n\t\"embed\": \"embed[src type]/\",\n\t\"object\": \"object[data type]\",\n\t\"param\": \"param[name value]/\",\n\t\"map\": \"map[name]\",\n\t\"area\": \"area[shape coords href alt]/\",\n\t\"area:d\": \"area[shape=default]\",\n\t\"area:c\": \"area[shape=circle]\",\n\t\"area:r\": \"area[shape=rect]\",\n\t\"area:p\": \"area[shape=poly]\",\n\t\"form\": \"form[action]\",\n\t\"form:get\": \"form[method=get]\",\n\t\"form:post\": \"form[method=post]\",\n\t\"label\": \"label[for]\",\n\t\"input\": \"input[type=${1:text}]/\",\n\t\"inp\": \"input[name=${1} id=${1}]\",\n\t\"input:h|input:hidden\": \"input[type=hidden name]\",\n\t\"input:t|input:text\": \"inp\",\n\t\"input:search\": \"inp[type=search]\",\n\t\"input:email\": \"inp[type=email]\",\n\t\"input:url\": \"inp[type=url]\",\n\t\"input:p|input:password\": \"inp[type=password]\",\n\t\"input:datetime\": \"inp[type=datetime]\",\n\t\"input:date\": \"inp[type=date]\",\n\t\"input:datetime-local\": \"inp[type=datetime-local]\",\n\t\"input:month\": \"inp[type=month]\",\n\t\"input:week\": \"inp[type=week]\",\n\t\"input:time\": \"inp[type=time]\",\n\t\"input:tel\": \"inp[type=tel]\",\n\t\"input:number\": \"inp[type=number]\",\n\t\"input:color\": \"inp[type=color]\",\n\t\"input:c|input:checkbox\": \"inp[type=checkbox]\",\n\t\"input:r|input:radio\": \"inp[type=radio]\",\n\t\"input:range\": \"inp[type=range]\",\n\t\"input:f|input:file\": \"inp[type=file]\",\n\t\"input:s|input:submit\": \"input[type=submit value]\",\n\t\"input:i|input:image\": \"input[type=image src alt]\",\n\t\"input:b|input:button\": \"input[type=button value]\",\n \"input:reset\": \"input:button[type=reset]\",\n\t\"isindex\": \"isindex/\",\n\t\"select\": \"select[name=${1} id=${1}]\",\n\t\"select:d|select:disabled\": \"select[disabled.]\",\n\t\"opt|option\": \"option[value]\",\n\t\"textarea\": \"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]\",\n\t\"marquee\": \"marquee[behavior direction]\",\n\t\"menu:c|menu:context\": \"menu[type=context]\",\n\t\"menu:t|menu:toolbar\": \"menu[type=toolbar]\",\n\t\"video\": \"video[src]\",\n\t\"audio\": \"audio[src]\",\n\t\"html:xml\": \"html[xmlns=http://www.w3.org/1999/xhtml]\",\n\t\"keygen\": \"keygen/\",\n\t\"command\": \"command/\",\n\t\"btn:s|button:s|button:submit\" : \"button[type=submit]\",\n\t\"btn:r|button:r|button:reset\" : \"button[type=reset]\",\n\t\"btn:d|button:d|button:disabled\" : \"button[disabled.]\",\n\t\"fst:d|fset:d|fieldset:d|fieldset:disabled\" : \"fieldset[disabled.]\",\n\n\t\"bq\": \"blockquote\",\n\t\"fig\": \"figure\",\n\t\"figc\": \"figcaption\",\n\t\"pic\": \"picture\",\n\t\"ifr\": \"iframe\",\n\t\"emb\": \"embed\",\n\t\"obj\": \"object\",\n\t\"cap\": \"caption\",\n\t\"colg\": \"colgroup\",\n\t\"fst\": \"fieldset\",\n\t\"btn\": \"button\",\n\t\"optg\": \"optgroup\",\n\t\"tarea\": \"textarea\",\n\t\"leg\": \"legend\",\n\t\"sect\": \"section\",\n\t\"art\": \"article\",\n\t\"hdr\": \"header\",\n\t\"ftr\": \"footer\",\n\t\"adr\": \"address\",\n\t\"dlg\": \"dialog\",\n\t\"str\": \"strong\",\n\t\"prog\": \"progress\",\n\t\"mn\": \"main\",\n\t\"tem\": \"template\",\n\t\"fset\": \"fieldset\",\n\t\"datag\": \"datagrid\",\n\t\"datal\": \"datalist\",\n\t\"kg\": \"keygen\",\n\t\"out\": \"output\",\n\t\"det\": \"details\",\n\t\"cmd\": \"command\",\n\n\t\"ri:d|ri:dpr\": \"img:s\",\n\t\"ri:v|ri:viewport\": \"img:z\",\n\t\"ri:a|ri:art\": \"pic>src:m+img\",\n\t\"ri:t|ri:type\": \"pic>src:t+img\",\n\n\t\"!!!\": \"{<!DOCTYPE html>}\",\n\t\"doc\": \"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body\",\n\t\"!|html:5\": \"!!!+doc\",\n\n\t\"c\": \"{<!-- ${0} -->}\",\n\t\"cc:ie\": \"{<!--[if IE]>${0}<![endif]-->}\",\n\t\"cc:noie\": \"{<!--[if !IE]><!-->${0}<!--<![endif]-->}\"\n};\n\nvar css = {\n\t\"@f\": \"@font-face {\\n\\tfont-family: ${1};\\n\\tsrc: url(${1});\\n}\",\n\t\"@ff\": \"@font-face {\\n\\tfont-family: '${1:FontName}';\\n\\tsrc: url('${2:FileName}.eot');\\n\\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\\n\\t\\t url('${2:FileName}.woff') format('woff'),\\n\\t\\t url('${2:FileName}.ttf') format('truetype'),\\n\\t\\t url('${2:FileName}.svg#${1:FontName}') format('svg');\\n\\tfont-style: ${3:normal};\\n\\tfont-weight: ${4:normal};\\n}\",\n\t\"@i|@import\": \"@import url(${0});\",\n\t\"@kf\": \"@keyframes ${1:identifier} {\\n\\t${2}\\n}\",\n\t\"@m|@media\": \"@media ${1:screen} {\\n\\t${0}\\n}\",\n\t\"ac\": \"align-content:flex-start|flex-end|center|space-between|space-around|stretch\",\n\t\"ai\": \"align-items:flex-start|flex-end|center|baseline|stretch\",\n\t\"anim\": \"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}\",\n\t\"animdel\": \"animation-delay:${1:time}\",\n\t\"animdir\": \"animation-direction:normal|reverse|alternate|alternate-reverse\",\n\t\"animdur\": \"animation-duration:${1:0}s\",\n\t\"animfm\": \"animation-fill-mode:both|forwards|backwards\",\n\t\"animic\": \"animation-iteration-count:1|infinite\",\n\t\"animn\": \"animation-name\",\n\t\"animps\": \"animation-play-state:running|paused\",\n\t\"animtf\": \"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})\",\n\t\"ap\": \"appearance:none\",\n\t\"as\": \"align-self:auto|flex-start|flex-end|center|baseline|stretch\",\n\t\"b\": \"bottom\",\n\t\"bd\": \"border:${1:1px} ${2:solid} ${3:#000}\",\n\t\"bdb\": \"border-bottom:${1:1px} ${2:solid} ${3:#000}\",\n\t\"bdbc\": \"border-bottom-color:#${1:000}\",\n\t\"bdbi\": \"border-bottom-image:url(${0})\",\n\t\"bdbk\": \"border-break:close\",\n\t\"bdbli\": \"border-bottom-left-image:url(${0})|continue\",\n\t\"bdblrs\": \"border-bottom-left-radius\",\n\t\"bdbri\": \"border-bottom-right-image:url(${0})|continue\",\n\t\"bdbrrs\": \"border-bottom-right-radius\",\n\t\"bdbs\": \"border-bottom-style\",\n\t\"bdbw\": \"border-bottom-width\",\n\t\"bdc\": \"border-color:#${1:000}\",\n\t\"bdci\": \"border-corner-image:url(${0})|continue\",\n\t\"bdcl\": \"border-collapse:collapse|separate\",\n\t\"bdf\": \"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space\",\n\t\"bdi\": \"border-image:url(${0})\",\n\t\"bdl\": \"border-left:${1:1px} ${2:solid} ${3:#000}\",\n\t\"bdlc\": \"border-left-color:#${1:000}\",\n\t\"bdlen\": \"border-length\",\n\t\"bdli\": \"border-left-image:url(${0})\",\n\t\"bdls\": \"border-left-style\",\n\t\"bdlw\": \"border-left-width\",\n\t\"bdr\": \"border-right:${1:1px} ${2:solid} ${3:#000}\",\n\t\"bdrc\": \"border-right-color:#${1:000}\",\n\t\"bdri\": \"border-right-image:url(${0})\",\n\t\"bdrs\": \"border-radius\",\n\t\"bdrst\": \"border-right-style\",\n\t\"bdrw\": \"border-right-width\",\n\t\"bds\": \"border-style:hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset\",\n\t\"bdsp\": \"border-spacing\",\n\t\"bdt\": \"border-top:${1:1px} ${2:solid} ${3:#000}\",\n\t\"bdtc\": \"border-top-color:#${1:000}\",\n\t\"bdti\": \"border-top-image:url(${0})\",\n\t\"bdtli\": \"border-top-left-image:url(${0})|continue\",\n\t\"bdtlrs\": \"border-top-left-radius\",\n\t\"bdtri\": \"border-top-right-image:url(${0})|continue\",\n\t\"bdtrrs\": \"border-top-right-radius\",\n\t\"bdts\": \"border-top-style\",\n\t\"bdtw\": \"border-top-width\",\n\t\"bdw\": \"border-width\",\n\t\"bfv\": \"backface-visibility:hidden|visible\",\n\t\"bg\": \"background:#${1:000}\",\n\t\"bga\": \"background-attachment:fixed|scroll\",\n\t\"bgbk\": \"background-break:bounding-box|each-box|continuous\",\n\t\"bgc\": \"background-color:#${1:fff}\",\n\t\"bgcp\": \"background-clip:padding-box|border-box|content-box|no-clip\",\n\t\"bgi\": \"background-image:url(${0})\",\n\t\"bgo\": \"background-origin:padding-box|border-box|content-box\",\n\t\"bgp\": \"background-position:${1:0} ${2:0}\",\n\t\"bgpx\": \"background-position-x\",\n\t\"bgpy\": \"background-position-y\",\n\t\"bgr\": \"background-repeat:no-repeat|repeat-x|repeat-y|space|round\",\n\t\"bgsz\": \"background-size:contain|cover\",\n\t\"bxsh\": \"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:color}|none\",\n\t\"bxsz\": \"box-sizing:border-box|content-box|border-box\",\n\t\"c\": \"color:#${1:000}\",\n\t\"cl\": \"clear:both|left|right|none\",\n\t\"cm\": \"/* ${0} */\",\n\t\"cnt\": \"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})\",\n\t\"coi\": \"counter-increment\",\n\t\"colm\": \"columns\",\n\t\"colmc\": \"column-count\",\n\t\"colmf\": \"column-fill\",\n\t\"colmg\": \"column-gap\",\n\t\"colmr\": \"column-rule\",\n\t\"colmrc\": \"column-rule-color\",\n\t\"colmrs\": \"column-rule-style\",\n\t\"colmrw\": \"column-rule-width\",\n\t\"colms\": \"column-span\",\n\t\"colmw\": \"column-width\",\n\t\"cor\": \"counter-reset\",\n\t\"cp\": \"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})\",\n\t\"cps\": \"caption-side:top|bottom\",\n\t\"cur\": \"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text\",\n\t\"d\": \"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group\",\n\t\"ec\": \"empty-cells:show|hide\",\n\t\"f\": \"font:${1:1em} ${2:sans-serif}\",\n\t\"fef\": \"font-effect:none|engrave|emboss|outline\",\n\t\"fem\": \"font-emphasize\",\n\t\"femp\": \"font-emphasize-position:before|after\",\n\t\"fems\": \"font-emphasize-style:none|accent|dot|circle|disc\",\n\t\"ff\": \"font-family:serif|sans-serif|cursive|fantasy|monospace\",\n\t\"fl\": \"float:left|right|none\",\n\t\"fs\": \"font-style:italic|normal|oblique\",\n\t\"fsm\": \"font-smoothing:antialiased|subpixel-antialiased|none\",\n\t\"fst\": \"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded\",\n\t\"fv\": \"font-variant:normal|small-caps\",\n\t\"fw\": \"font-weight:normal|bold|bolder|lighter\",\n\t\"fx\": \"flex\",\n\t\"fxb\": \"flex-basis:fill|max-content|min-content|fit-content|content\",\n\t\"fxd\": \"flex-direction:row|row-reverse|column|column-reverse\",\n\t\"fxf\": \"flex-flow\",\n\t\"fxg\": \"flex-grow\",\n\t\"fxsh\": \"flex-shrink\",\n\t\"fxw\": \"flex-wrap:nowrap|wrap|wrap-reverse\",\n\t\"fz\": \"font-size\",\n\t\"fza\": \"font-size-adjust\",\n\t\"h\": \"height\",\n\t\"jc\": \"justify-content:flex-start|flex-end|center|space-between|space-around\",\n\t\"l\": \"left\",\n\t\"lg\": \"background-image:linear-gradient(${1})\",\n\t\"lh\": \"line-height\",\n\t\"lis\": \"list-style\",\n\t\"lisi\": \"list-style-image\",\n\t\"lisp\": \"list-style-position:inside|outside\",\n\t\"list\": \"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman\",\n\t\"lts\": \"letter-spacing:normal\",\n\t\"m\": \"margin\",\n\t\"mah\": \"max-height\",\n\t\"mar\": \"max-resolution\",\n\t\"maw\": \"max-width\",\n\t\"mb\": \"margin-bottom\",\n\t\"mih\": \"min-height\",\n\t\"mir\": \"min-resolution\",\n\t\"miw\": \"min-width\",\n\t\"ml\": \"margin-left\",\n\t\"mr\": \"margin-right\",\n\t\"mt\": \"margin-top\",\n\t\"ol\": \"outline\",\n\t\"olc\": \"outline-color:#${1:000}|invert\",\n\t\"olo\": \"outline-offset\",\n\t\"ols\": \"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset\",\n\t\"olw\": \"outline-width|thin|medium|thick\",\n\t\"op\": \"opacity\",\n\t\"ord\": \"order\",\n\t\"ori\": \"orientation:landscape|portrait\",\n\t\"orp\": \"orphans\",\n\t\"ov\": \"overflow:hidden|visible|hidden|scroll|auto\",\n\t\"ovs\": \"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee\",\n\t\"ovx\": \"overflow-x:hidden|visible|hidden|scroll|auto\",\n\t\"ovy\": \"overflow-y:hidden|visible|hidden|scroll|auto\",\n\t\"p\": \"padding\",\n\t\"pb\": \"padding-bottom\",\n\t\"pgba\": \"page-break-after:auto|always|left|right\",\n\t\"pgbb\": \"page-break-before:auto|always|left|right\",\n\t\"pgbi\": \"page-break-inside:auto|avoid\",\n\t\"pl\": \"padding-left\",\n\t\"pos\": \"position:relative|absolute|relative|fixed|static\",\n\t\"pr\": \"padding-right\",\n\t\"pt\": \"padding-top\",\n\t\"q\": \"quotes\",\n\t\"qen\": \"quotes:'\\\\201C' '\\\\201D' '\\\\2018' '\\\\2019'\",\n\t\"qru\": \"quotes:'\\\\00AB' '\\\\00BB' '\\\\201E' '\\\\201C'\",\n\t\"r\": \"right\",\n\t\"rsz\": \"resize:none|both|horizontal|vertical\",\n\t\"t\": \"top\",\n\t\"ta\": \"text-align:left|center|right|justify\",\n\t\"tal\": \"text-align-last:left|center|right\",\n\t\"tbl\": \"table-layout:fixed\",\n\t\"td\": \"text-decoration:none|underline|overline|line-through\",\n\t\"te\": \"text-emphasis:none|accent|dot|circle|disc|before|after\",\n\t\"th\": \"text-height:auto|font-size|text-size|max-size\",\n\t\"ti\": \"text-indent\",\n\t\"tj\": \"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan\",\n\t\"to\": \"text-outline:${1:0} ${2:0} ${3:#000}\",\n\t\"tov\": \"text-overflow:ellipsis|clip\",\n\t\"tr\": \"text-replace\",\n\t\"trf\": \"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})\",\n\t\"trfo\": \"transform-origin\",\n\t\"trfs\": \"transform-style:preserve-3d\",\n\t\"trs\": \"transition:${1:prop} ${2:time}\",\n\t\"trsde\": \"transition-delay:${1:time}\",\n\t\"trsdu\": \"transition-duration:${1:time}\",\n\t\"trsp\": \"transition-property:${1:prop}\",\n\t\"trstf\": \"transition-timing-function:${1:fn}\",\n\t\"tsh\": \"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}\",\n\t\"tt\": \"text-transform:uppercase|lowercase|capitalize|none\",\n\t\"tw\": \"text-wrap:none|normal|unrestricted|suppress\",\n\t\"us\": \"user-select:none\",\n\t\"v\": \"visibility:hidden|visible|collapse\",\n\t\"va\": \"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub\",\n\t\"w\": \"width\",\n\t\"whs\": \"white-space:nowrap|pre|pre-wrap|pre-line|normal\",\n\t\"whsc\": \"white-space-collapse:normal|keep-all|loose|break-strict|break-all\",\n\t\"wid\": \"widows\",\n\t\"wm\": \"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl\",\n\t\"wob\": \"word-break:normal|keep-all|break-all\",\n\t\"wos\": \"word-spacing\",\n\t\"wow\": \"word-wrap:none|unrestricted|suppress|break-word|normal\",\n\t\"z\": \"z-index\",\n\t\"zom\": \"zoom:1\"\n};\n\nvar index = { html, css };\n\nexport default index;\n","'use strict';\n\nimport { findMarker, clearMarkers } from '../abbreviation-marker';\nimport { extractAbbreviation, expandAndInsert } from '../expand-abbreviation';\n\n/**\n * Expand abbreviation command\n * @param {CodeMirror} editor\n */\nexport default function(editor) {\n\tif (editor.somethingSelected()) {\n\t\treturn editor.constructor.Pass;\n\t}\n\n\tconst pos = editor.getCursor();\n\tconst marker = findMarker(editor, pos);\n\n\tlet result = false;\n\n\t// Handle two possible options: expand abbreviation from Emmet marker that\n\t// matches given location or extract & expand abbreviation from cursor\n\t// position. The last one may happen if either `markeEmmetAbbreviation`\n\t// option is turned off or user moved cursor away from Emmet marker and\n\t// tries to expand another abbreviation\n\n\tif (marker) {\n\t\tresult = expandAndInsert(editor, marker.model.ast, marker.find());\n\t} else {\n\t\tconst abbrData = extractAbbreviation(editor, pos);\n\t\tif (abbrData) {\n\t\t\tconst range = {\n\t\t\t\tfrom: {\n\t\t\t\t\tline: pos.line,\n\t\t\t\t\tch: abbrData.location\n\t\t\t\t},\n\t\t\t\tto: {\n\t\t\t\t\tline: pos.line,\n\t\t\t\t\tch: abbrData.location + abbrData.abbreviation.length\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tresult = expandAndInsert(editor, abbrData.abbreviation, range);\n\t\t}\n\t}\n\n\tclearMarkers(editor);\n\n\t// If no abbreviation was expanded, allow editor to handle different\n\t// action for keyboard shortcut (Tab key mostly)\n\treturn result || editor.constructor.Pass;\n}\n","'use strict';\n\nimport { getIndentation } from '../utils';\n\n/**\n * Inserts formatted line tag between tags\n * @param {CodeMirror} editor\n */\nexport default function(editor) {\n\tconst cursor = editor.getCursor();\n\tconst mode = editor.getModeAt(cursor);\n\n\tif (mode.name === 'xml') {\n\t\tconst next = Object.assign({}, cursor, { ch: cursor.ch + 1 });\n\t\tconst left = editor.getTokenAt(cursor);\n\t\tconst right = editor.getTokenAt(Object.assign({}, cursor, { ch: cursor.ch + 1 }));\n\n\t\tif (left.type === 'tag bracket' && left.string === '>'\n\t\t\t&& right.type === 'tag bracket' && right.string === '</') {\n\t\t\t\tconst matchIndent = editor.getLine(cursor.line).match(/^\\s+/);\n\t\t\t\tconst curIndent = matchIndent ? matchIndent[0] : '';\n\t\t\t\tconst indent = getIndentation(editor);\n\n\t\t\t\t// Insert formatted line break\n\t\t\t\tconst before = `\\n${curIndent}${indent}`;\n\t\t\t\tconst after = `\\n${curIndent}`;\n\t\t\t\teditor.replaceRange(before + after, cursor, cursor);\n\n\t\t\t\t// Position cursor\n\t\t\t\tconst startIx = editor.indexFromPos(cursor);\n\t\t\t\tconst newCursor = editor.posFromIndex(startIx + before.length);\n\t\t\t\teditor.setCursor(newCursor);\n\n\t\t\t\treturn;\n\t\t\t}\n\t}\n\n\treturn editor.constructor.Pass;\n}\n","/**\n * A streaming, character code-based string reader\n */\nclass StreamReader {\n\tconstructor(string, start, end) {\n\t\tif (end == null && typeof string === 'string') {\n\t\t\tend = string.length;\n\t\t}\n\n\t\tthis.string = string;\n\t\tthis.pos = this.start = start || 0;\n\t\tthis.end = end;\n\t}\n\n\t/**\n\t * Returns true only if the stream is at the end of the file.\n\t * @returns {Boolean}\n\t */\n\teof() {\n\t\treturn this.pos >= this.end;\n\t}\n\n\t/**\n\t * Creates a new stream instance which is limited to given `start` and `end`\n\t * range. E.g. its `eof()` method will look at `end` property, not actual\n\t * stream end\n\t * @param {Point} start\n\t * @param {Point} end\n\t * @return {StreamReader}\n\t */\n\tlimit(start, end) {\n\t\treturn new this.constructor(this.string, start, end);\n\t}\n\n\t/**\n\t * Returns the next character code in the stream without advancing it.\n\t * Will return NaN at the end of the file.\n\t * @returns {Number}\n\t */\n\tpeek() {\n\t\treturn this.string.charCodeAt(this.pos);\n\t}\n\n\t/**\n\t * Returns the next character in the stream and advances it.\n\t * Also returns <code>undefined</code> when no more characters are available.\n\t * @returns {Number}\n\t */\n\tnext() {\n\t\tif (this.pos < this.string.length) {\n\t\t\treturn this.string.charCodeAt(this.pos++);\n\t\t}\n\t}\n\n\t/**\n\t * `match` can be a character code or a function that takes a character code\n\t * and returns a boolean. If the next character in the stream 'matches'\n\t * the given argument, it is consumed and returned.\n\t * Otherwise, `false` is returned.\n\t * @param {Number|Function} match\n\t * @returns {Boolean}\n\t */\n\teat(match) {\n\t\tconst ch = this.peek();\n\t\tconst ok = typeof match === 'function' ? match(ch) : ch === match;\n\n\t\tif (ok) {\n\t\t\tthis.next();\n\t\t}\n\n\t\treturn ok;\n\t}\n\n\t/**\n\t * Repeatedly calls <code>eat</code> with the given argument, until it\n\t * fails. Returns <code>true</code> if any characters were eaten.\n\t * @param {Object} match\n\t * @returns {Boolean}\n\t */\n\teatWhile(match) {\n\t\tconst start = this.pos;\n\t\twhile (!this.eof() && this.eat(match)) {}\n\t\treturn this.pos !== start;\n\t}\n\n\t/**\n\t * Backs up the stream n characters. Backing it up further than the\n\t * start of the current token will cause things to break, so be careful.\n\t * @param {Number} n\n\t */\n\tbackUp(n) {\n\t\tthis.pos -= (n || 1);\n\t}\n\n\t/**\n\t * Get the string between the start of the current token and the\n\t * current stream position.\n\t * @returns {String}\n\t */\n\tcurrent() {\n\t\treturn this.substring(this.start, this.pos);\n\t}\n\n\t/**\n\t * Returns substring for given range\n\t * @param {Number} start\n\t * @param {Number} [end]\n\t * @return {String}\n\t */\n\tsubstring(start, end) {\n\t\treturn this.string.slice(start, end);\n\t}\n\n\t/**\n\t * Creates error object with current stream state\n\t * @param {String} message\n\t * @return {Error}\n\t */\n\terror(message) {\n\t\tconst err = new Error(`${message} at char ${this.pos + 1}`);\n\t\terr.originalMessage = message;\n\t\terr.pos = this.pos;\n\t\terr.string = this.string;\n\t\treturn err;\n\t}\n}\n\nexport default StreamReader;\n","/**\n * A streaming, character code-based string reader\n */\nclass StreamReader {\n\tconstructor(string, start, end) {\n\t\tif (end == null && typeof string === 'string') {\n\t\t\tend = string.length;\n\t\t}\n\n\t\tthis.string = string;\n\t\tthis.pos = this.start = start || 0;\n\t\tthis.end = end;\n\t}\n\n\t/**\n\t * Returns true only if the stream is at the end of the file.\n\t * @returns {Boolean}\n\t */\n\teof() {\n\t\treturn this.pos >= this.end;\n\t}\n\n\t/**\n\t * Creates a new stream instance which is limited to given `start` and `end`\n\t * range. E.g. its `eof()` method will look at `end` property, not actual\n\t * stream end\n\t * @param {Point} start\n\t * @param {Point} end\n\t * @return {StreamReader}\n\t */\n\tlimit(start, end) {\n\t\treturn new this.constructor(this.string, start, end);\n\t}\n\n\t/**\n\t * Returns the next character code in the stream without advancing it.\n\t * Will return NaN at the end of the file.\n\t * @returns {Number}\n\t */\n\tpeek() {\n\t\treturn this.string.charCodeAt(this.pos);\n\t}\n\n\t/**\n\t * Returns the next character in the stream and advances it.\n\t * Also returns <code>undefined</code> when no more characters are available.\n\t * @returns {Number}\n\t */\n\tnext() {\n\t\tif (this.pos < this.string.length) {\n\t\t\treturn this.string.charCodeAt(this.pos++);\n\t\t}\n\t}\n\n\t/**\n\t * `match` can be a character code or a function that takes a character code\n\t * and returns a boolean. If the next character in the stream 'matches'\n\t * the given argument, it is consumed and returned.\n\t * Otherwise, `false` is returned.\n\t * @param {Number|Function} match\n\t * @returns {Boolean}\n\t */\n\teat(match) {\n\t\tconst ch = this.peek();\n\t\tconst ok = typeof match === 'function' ? match(ch) : ch === match;\n\n\t\tif (ok) {\n\t\t\tthis.next();\n\t\t}\n\n\t\treturn ok;\n\t}\n\n\t/**\n\t * Repeatedly calls <code>eat</code> with the given argument, until it\n\t * fails. Returns <code>true</code> if any characters were eaten.\n\t * @param {Object} match\n\t * @returns {Boolean}\n\t */\n\teatWhile(match) {\n\t\tconst start = this.pos;\n\t\twhile (!this.eof() && this.eat(match)) {}\n\t\treturn this.pos !== start;\n\t}\n\n\t/**\n\t * Backs up the stream n characters. Backing it up further than the\n\t * start of the current token will cause things to break, so be careful.\n\t * @param {Number} n\n\t */\n\tbackUp(n) {\n\t\tthis.pos -= (n || 1);\n\t}\n\n\t/**\n\t * Get the string between the start of the current token and the\n\t * current stream position.\n\t * @returns {String}\n\t */\n\tcurrent() {\n\t\treturn this.substring(this.start, this.pos);\n\t}\n\n\t/**\n\t * Returns substring for given range\n\t * @param {Number} start\n\t * @param {Number} [end]\n\t * @return {String}\n\t */\n\tsubstring(start, end) {\n\t\treturn this.string.slice(start, end);\n\t}\n\n\t/**\n\t * Creates error object with current stream state\n\t * @param {String} message\n\t * @return {Error}\n\t */\n\terror(message) {\n\t\tconst err = new Error(`${message} at char ${this.pos + 1}`);\n\t\terr.originalMessage = message;\n\t\terr.pos = this.pos;\n\t\terr.string = this.string;\n\t\treturn err;\n\t}\n}\n\nexport default StreamReader;\n","'use strict';\n\nimport StreamReader from '@emmetio/stream-reader';\nimport { comparePos } from './utils';\n\nconst LINE_END = 10; // \\n\n\n/**\n * A stream reader for CodeMirror editor\n */\nexport default class CodeMirrorStreamReader extends StreamReader {\n\t/**\n\t * @param {CodeMirror} editor\n\t * @param {CodeMirror.Pos} [pos]\n\t * @param {CodeMirror.Range} [limit]\n\t */\n\tconstructor(editor, pos, limit) {\n\t\tsuper();\n\t\tconst CodeMirror = editor.constructor;\n\t\tthis.editor = editor;\n\t\tthis.start = this.pos = pos || CodeMirror.Pos(0, 0);\n\n\t\tconst lastLine = editor.lastLine();\n\t\tthis._eof = limit ? limit.to : CodeMirror.Pos(lastLine, this._lineLength(lastLine));\n\t\tthis._sof = limit ? limit.from : CodeMirror.Pos(0, 0);\n\t}\n\n\t/**\n\t * Returns true only if the stream is at the beginning of the file.\n\t * @returns {Boolean}\n\t */\n\tsof() {\n\t\treturn comparePos(this.pos, this._sof) <= 0;\n\t}\n\n\t/**\n\t * Returns true only if the stream is at the end of the file.\n\t * @returns {Boolean}\n\t */\n\teof() {\n\t\treturn comparePos(this.pos, this._eof) >= 0;\n\t}\n\n\t/**\n\t * Creates a new stream instance which is limited to given `start` and `end`\n\t * points for underlying buffer\n\t * @param {CodeMirror.Pos} start\n\t * @param {CodeMirror.Pos} end\n\t * @return {CodeMirrorStreamReader}\n\t */\n\tlimit(from, to) {\n\t\treturn new this.constructor(this.editor, from, { from, to });\n\t}\n\n\t/**\n\t * Returns the next character code in the stream without advancing it.\n\t * Will return NaN at the end of the file.\n\t * @returns {Number}\n\t */\n\tpeek() {\n\t\tconst { line, ch } = this.pos;\n\t\tconst lineStr = this.editor.getLine(this.pos.line);\n\t\treturn ch < lineStr.length ? lineStr.charCodeAt(ch) : LINE_END;\n\t}\n\n\t/**\n\t * Returns the next character in the stream and advances it.\n\t * Also returns NaN when no more characters are available.\n\t * @returns {Number}\n\t */\n\tnext() {\n\t\tif (!this.eof()) {\n\t\t\tconst code = this.peek();\n\t\t\tthis.pos = Object.assign({}, this.pos, { ch: this.pos.ch + 1 });\n\n\t\t\tif (this.pos.ch >= this._lineLength(this.pos.line)) {\n\t\t\t\tthis.pos.line++;\n\t\t\t\tthis.pos.ch = 0;\n\t\t\t}\n\n\t\t\tif (this.eof()) {\n\t\t\t\t// handle edge case where position can move on next line\n\t\t\t\t// after EOF\n\t\t\t\tthis.pos = Object.assign({}, this._eof);\n\t\t\t}\n\n\t\t\treturn code;\n\t\t}\n\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * Backs up the stream n characters. Backing it up further than the\n\t * start of the current token will cause things to break, so be careful.\n\t * @param {Number} n\n\t */\n\tbackUp(n) {\n\t\tconst CodeMirror = this.editor.constructor;\n\n\t\tlet { line, ch } = this.pos;\n\t\tch -= (n || 1);\n\n\t\twhile (line >= 0 && ch < 0) {\n\t\t\tline--;\n\t\t\tch += this._lineLength(line);\n\t\t}\n\n\t\tthis.pos = line < 0 || ch < 0\n\t\t\t? CodeMirror.Pos(0, 0)\n\t\t\t: CodeMirror.Pos(line, ch);\n\n\t\treturn this.peek();\n\t}\n\n\t/**\n\t * Get the string between the start of the current token and the\n\t * current stream position.\n\t * @returns {String}\n\t */\n\tcurrent() {\n\t\treturn this.substring(this.start, this.pos);\n\t}\n\n\t/**\n\t * Returns contents for given range\n\t * @param {Point} from\n\t * @param {Point} to\n\t * @return {String}\n\t */\n\tsubstring(from, to) {\n\t\treturn this.editor.getRange(from, to);\n\t}\n\n\t/**\n\t * Creates error object with current stream state\n\t * @param {String} message\n\t * @return {Error}\n\t */\n\terror(message) {\n\t\tconst err = new Error(`${message} at line ${this.pos.line}, column ${this.pos.ch}`);\n\t\terr.originalMessage = message;\n\t\terr.pos = this.pos;\n\t\terr.string = this.string;\n\t\treturn err;\n\t}\n\n\t/**\n\t * Returns length of given line, including line ending\n\t * @param {Number} line\n\t * @return {Number}\n\t */\n\t_lineLength(line) {\n\t\tconst isLast = line === this.editor.lastLine();\n\t\treturn this.editor.getLine(line).length + (isLast ? 0 : 1);\n\t}\n}\n","'use strict';\n\nimport emmetExpandAbbreviation from './lib/commands/expand-abbreviation';\nimport emmetInsertLineBreak from './lib/commands/formatted-line-break';\nimport {\n\tmarkOnEditorChange, findMarker, markAbbreviation, clearMarkers\n} from './lib/abbreviation-marker';\nimport autocompleteProvider from './lib/autocomplete';\nimport { extractAbbreviation, parseAbbreviation, createAbbreviationModel } from './lib/expand-abbreviation';\nimport getModel, { getCachedModel, resetCachedModel } from './lib/model/index';\nimport matchTag, { clearTagMatch } from './lib/match-tag';\nimport renameTag from './lib/rename-tag';\n\nconst commands = { emmetExpandAbbreviation, emmetInsertLineBreak };\n\n/**\n * Registers Emmet extension on given CodeMirror constructor.\n * This file is designed to be imported somehow into the app (CommonJS, ES6,\n * Rollup/Webpack/whatever). If you simply want to add a <script> into your page\n * that registers Emmet extension on global CodeMirror constructor, use\n * `browser.js` instead\n */\nexport default function registerEmmetExtension(CodeMirror) {\n\t// Register Emmet commands\n\tObject.assign(CodeMirror.commands, commands);\n\n\t// Defines options that allows abbreviation marking in text editor\n\tCodeMirror.defineOption('markEmmetAbbreviation', true, (editor, value) => {\n\t\tif (value) {\n\t\t\teditor.on('change', markOnEditorChange);\n\t\t} else {\n\t\t\teditor.off('change', markOnEditorChange);\n\t\t\tclearMarkers(editor);\n\t\t}\n\t});\n\n\tCodeMirror.defineOption('autoRenameTags', true, (editor, value) => {\n\t\tvalue ? editor.on('change', renameTag) : editor.off('change', renameTag);\n\t});\n\n\tCodeMirror.defineOption('markTagPairs', false, (editor, value) => {\n\t\tif (value) {\n\t\t\teditor.on('cursorActivity', matchTag);\n\t\t\teditor.on('change', resetCachedModel);\n\t\t} else {\n\t\t\teditor.off('cursorActivity', matchTag);\n\t\t\teditor.off('change', resetCachedModel);\n\t\t\tresetCachedModel(editor);\n\t\t\tclearTagMatch(editor);\n\t\t}\n\t});\n\n\t// Additional options for Emmet, for Expand Abbreviation action mostly:\n\t// https://github.com/emmetio/expand-abbreviation/blob/master/index.js#L26\n\tCodeMirror.defineOption('emmet', {});\n\n\t/**\n\t * Returns Emmet completions for context from `pos` position.\n\t * Abbreviations are calculated for marked abbreviation at given position.\n\t * If no parsed abbreviation marker is available and `force` argument is\n\t * given, tries to mark abbreviation and populate completions list again.\n\t * @param {CodeMirror.Pos} [pos]\n\t * @param {Boolean} [force]\n\t * @return {EmmetCompletion[]}\n\t */\n\tCodeMirror.defineExtension('getEmmetCompletions', function(pos, force) {\n\t\tconst editor = this;\n\t\tif (typeof pos === 'boolean') {\n\t\t\tforce = pos;\n\t\t\tpos = null;\n\t\t}\n\n\t\tlet abbrRange, list;\n\n\t\tpos = pos || editor.getCursor();\n\t\tif (editor.getOption('markEmmetAbbreviation')) {\n\t\t\t// Get completions from auto-inserted marker\n\t\t\tconst marker = findMarker(editor, pos) || (force && markAbbreviation(editor, pos, true));\n\t\t\tif (marker) {\n\t\t\t\tabbrRange = marker.find();\n\t\t\t\tlist = autocompleteProvider(editor, marker.model, abbrRange.from, pos);\n\t\t\t}\n\t\t} else {\n\t\t\t// No abbreviation auto-marker, try to extract abbreviation from given\n\t\t\t// cursor location\n\t\t\tconst extracted = extractAbbreviation(editor, pos);\n\t\t\tif (extracted) {\n\t\t\t\tconst model = createAbbreviationModel(extracted.abbreviation, editor);\n\t\t\t\tif (model) {\n\t\t\t\t\tabbrRange = {\n\t\t\t\t\t\tfrom: { line: pos.line, ch: extracted.location },\n\t\t\t\t\t\tto: { line: pos.line, ch: extracted.location + extracted.abbreviation.length }\n\t\t\t\t\t};\n\t\t\t\t\tlist = autocompleteProvider(editor, model, abbrRange.from, pos);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (list && list.length) {\n\t\t\treturn {\n\t\t\t\tfrom: abbrRange.from,\n\t\t\t\tto: abbrRange.to,\n\t\t\t\tlist\n\t\t\t};\n\t\t}\n\t});\n\n\t/**\n\t * Returns valid Emmet abbreviation and its location in editor from given\n\t * position\n\t * @param {CodeMirror.Pos} [pos] Position from which abbreviation should be\n\t * extracted. If not given, current cursor\n\t * position is used\n\t * @return {Object} Object with `abbreviation` and `location` properties\n\t * or `null` if there’s no valid abbreviation\n\t */\n\tCodeMirror.defineExtension('getEmmetAbbreviation', function(pos) {\n\t\tconst editor = this;\n\t\tpos = pos || editor.getCursor();\n\t\tconst marker = findMarker(editor, pos);\n\n\t\tif (marker) {\n\t\t\treturn {\n\t\t\t\tabbreviation: marker.model.abbreviation,\n\t\t\t\tast: marker.model.ast,\n\t\t\t\tlocation: marker.find().from,\n\t\t\t\tfromMarker: true\n\t\t\t};\n\t\t}\n\n\t\tconst extracted = extractAbbreviation(editor, pos);\n\t\tif (extracted) {\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tabbreviation: extracted.abbreviation,\n\t\t\t\t\tast: parseAbbreviation(extracted.abbreviation, editor),\n\t\t\t\t\tlocation: { line: pos.line, ch: extracted.location },\n\t\t\t\t\tfromMarker: false\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\t// Will throw if abbreviation is invalid\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t});\n\n\tCodeMirror.defineExtension('findEmmetMarker', function(pos) {\n\t\treturn findMarker(this, pos || this.getCursor());\n\t});\n\n\tCodeMirror.defineExtension('getEmmetDocumentModel', function() {\n\t\tconst editor = this;\n\t\treturn editor.getOption('markTagPairs')\n\t\t\t? getCachedModel(editor)\n\t\t\t: getModel(editor);\n\t});\n}\n","'use strict';\n\nimport registerEmmetExtension from './extension.js';\n\nif (typeof CodeMirror !== 'undefined') {\n\tregisterEmmetExtension(CodeMirror);\n}\n"],"names":["isQuote","c","SINGLE_QUOTE","DOUBLE_QUOTE","eatQuoted","stream","const","start","pos","quote","prev","sol","peek","ESCAPE","eatAttribute","eatAttributeWithQuotedValue","eatAttributeWithUnquotedValue","eat","EQUALS","eatIdent","eatWhile","isUnquotedValue","isIdent","COLON","isAlpha","isNumber","isWhiteSpace","SPACE","TAB","extractAbbreviation","line","lookAhead","Math","min","length","max","offsetPastAutoClosed","let","StreamReader","stack","isCloseBrace","push","isOpenBrace","pop","bracePairs","get","has","SQUARE_BRACE_R","CURLY_BRACE_R","isAtHTMLTag","isAbbreviation","abbreviation","slice","replace","location","charCodeAt","arr","value","indexOf","specialChars","SQUARE_BRACE_L","ROUND_BRACE_L","CURLY_BRACE_L","ROUND_BRACE_R","strcase","string","type","toUpperCase","toLowerCase","createAttribute","name","Attribute","options","normalize","str","String","trim","uniqueClass","item","i","code","from","to","isAlphaNumeric","isSpace","eatPair","open","close","Object","assign","defaultOptions$1","ch","eof","next","escape","throws","error","fromCharCode","parseAttributeName","EXCL","implied","DOT$1","boolean","attr","keys","eatUnquoted","isUnquoted","ATTR_OPEN","ATTR_CLOSE","eatName","isName","current","parse","root","Node","ctx","groupStack","GROUP_START","GROUP_END","node","consumeElement","appendChild","OP_SIBLING","OP_CHILD","OP_CLIMB","parent","lastGroup","repeat","consumeRepeat","firstChild","groupCtx","last","unroll","count","clone","walk","insertBefore","resolveNode","registry","Set","resolve","snippet","tree","add","delete","childTarget","findDeepestNode","merge","remove","selfClosing","mergeAttributes","mergeClassNames","attrMap","Map","attrs","attributes","set","a","removeAttribute","newAttrs","Array","values","setAttribute","classNames","classList","addClass","children","resolveImplicitName","parentName","elementMap","inlineElements","findUnescapedTokens","token","result","tlen","size","len","map","ix","range","replaceRanges","ranges","r","substring","substr","applyNumbering$1","repeater","findRepeater","replaceNumbering","forEach","copy","getAttribute","replaceAttribute","replaceNumberingRanges","getNumberingRanges","numberingToken","reduce","out","range$$1","test","lastRange","unescapeString","_value","prepare","amount","implicit","index","insert","content","isArray","updated","insertContent","setNodeContent","join","inserted","insertContentIntoPlaceholder","child","state","replaced","replacePlaceholder","_state","placeholder","caret","hasAttribute","reUrl","reProto","reEmail","expandClassNames","cl","modifier","expandShortNotation","lookup","prefix","m","originalClass","match","reElement","getBlockName","element","reModifier","createBlockLookup","find","blockCandidates1","blockCandidates2","depth","filter","oldName","newName","replaceVariables","variables","replaceInNode","il","replaceInString","model","createModel","offset","output","v","reVariable","tokens","exec","validMatches","field","fields","cleanString","consumeField","FieldString","mark","createToken","ordered","order","end","sort","b","DOLLAR","consumeIndex","Field","OPEN_BRACE","consumePlaceholder","CLOSE_BRACE","Number","splitByLines","text","split","render","formatter","defaultField","fieldState","fieldsRenderer","getFieldsModel","run","nodes","notGroup","outNode","OutputNode","toString","isGroup","parseFields","largestIndex","template","data","lastPos","replacer","left","right","TOKEN_OPEN","TOKEN_CLOSE","TOKEN","isFirstChild","isRoot","isPseudoSnippet","isTextOnly","handlePseudoSnippet","fieldsModel","findLowestIndexField","parts","splitFieldsModel","renderFields","constructor","html","profile","comment","commentOptions","setFormatting","formatAttributes","selfClose","commentNode","shouldFormatNode","indent","getIndentLevel","newline","beforeOpen","beforeText","hasInnerFormatting","beforeClose","isInline","shouldFormatInline","childIndex","nextSibling","previousSibling","adjacentInline","before","after","isInlineElement","nodeName","attrName","attribute","attrValue","skip","level","enabled","trigger","indentFormat","defaultNodeOptions","getIndentLevel$1","NAME","SELF_CLOSE","getAttributes","omitName","PRIMARY_ATTRS","defaultAttrOptions","primary","secondary","reId","reClass","isBoolean","SECONDARY_ATTRS","haml","nodeOptions","updateFormatting","formatNodeValue","reNl","lines","maxLength","pad","slim","attributeWrap","secondaryAttrs","none","booleanAttr","updateFormatting$1","formatNodeValue$1","isInline$1","reNl$1","pug","updateFormatting$2","formatNodeValue$2","reNl$2","supports","syntax","supportedSyntaxed","isHex","isShortHex","hex","toShortHex","num","toHex","isAlphaNumericWord","isAlphaWord","eatNumber","negative","DASH$1","hadDot","consumed","isKeyword","DASH$2","isVariableName","consumeArgumentList","LBRACE","arg","argsList","consumeArgument","RBRACE","COMMA","CSSValue","consumeNumericValue","consumeColor","consumeQuoted","consumeKeywordOrFunction","kw","consumeKeyword","args","FunctionCall","consumeIdent","isIdentPrefix","consumeValue","unit","DASH","AT","sum","n","nest","snippets","snippetsSort","cur","property","addDependency","key","isKeyword$1","splitValue","convertToCSSSnippets","cssSnippets","all","findBestMatch","resolveAsProperty","resolveAsSnippet","setNodeAsText","abbr","keywords","globalKeywords","isNumericValue","resolveNumericValue","getUnmatchedPart","defaulValue","items","matchedItem","maxScore","score","stringScore","getScoringPart","tokenTypeOf","unitAliases","unitlessProperties","css","defaultOptions","injectFields","stringifyAttribute","afterOpen","format","between","afterText","lastChild","fieldsAmount","concat","shift","delta","shortHex","syntaxFormat","getFormat","rand","floor","random","sample","iterations","choice","val","sentence","words","capitalize","word","insertCommas","hasComma","totalCommas","paragraph","dict","wordCount","startWithCommon","totalWords","common","isRepeating","expand$1","parse$1","parseAbbreviation","use","transform","addons","resolveSnippets","resolveVariables","expand$2","parse$2","format$1","parseAbbreviation$1","resolveSnippets$1","loremGenerator","reLorem","lang","lorem","expand$$1","createOptions","isStylesheet","parse$$1","createSnippetsRegistry","SnippetsRegistry","snippetsRegistryFactory","createProfile","defaultVariables","stylesheetSyntaxes","Profile","detectSyntax","editor","mode","getModeAt","getCursor","isSupported","emmetOpt","getOption","knownSyntaxes","hasAutoActivateContext","autoActivationContext","getIndentation","repeatString","normalizeText","indentation","tabs","removeFields","containsPos","exclude","comparePos","expandAbbreviation","expand","editorField","getExpandOptions","extract","getLine","createAbbreviationModel","ast","err","expandAndInsert","expanded","cursorMarked","newSelectionSize","cursorMark","matchIndent","newCursorPos","operation","replaceRange","startIx","indexFromPos","newCursor","posFromIndex","setSelection","setCursor","selfClosingStyle","configuration","snippetsFromOptions","stylesheetSnippets","markupSnippets","markOnEditorChange","marker","findMarker","isValidMarker","clearMarkers","markAbbreviation","markers","findMarksAt","className","emmetMarkerClass","forced","extracted","allowedForAutoActivation","markText","inclusiveRight","clearWhenEmpty","getAllMarks","clear","rootNode","getRange","getMarkupCompletions","abbrModel","abbrPos","cursorPos","abbrRange","EmmetCompletion","getMarkupPrefix","prefixRange","completions","getSnippetCompletions","preview","getStylesheetCompletions","getStylesheetPrefix","emmetCompletions","cache","expandOpt","getPrefix","eatToken","Token","eatAttributeName","eatPaired","isAttributeName","eatAttributeValue","valueStart","valueEnd","backUp","isTerminator","RIGHT_ANGLE$1","SLASH$1","isNaN","eatTagName","isTagName","DOT","UNDERSCORE","eatArray","codes","eatSection","allowUnclosed","toCharCodes","empty","special","getName","addChild","consumeSpecial","xml","cdata","tag","tag$$1","create","SyntaxModel","parseHTML","console","warn","getModel","getSyntax","getCachedModel","_emmetModel","resetCachedModel","getMode","matchTag","marked","getMarkedTag","clearTagMatch","findTagPair","createTagMark","openTagMark","closeTagMark","getEmmetDocumentModel","nodeForPoint","inclusiveLeft","renameTag","obj","updateTag","source","dest","this","ok","tagCase","attributeCase","attributeQuotes","formatSkip","formatForce","inlineBreak","compactBooleanAttributes","booleanAttributes","quoteChar","isBooleanAttribute","Snippet","SnippetsStorage","_string","_regexp","_disabled","load","prototypeAccessors","disabled","disable","enable","k","RegExp","Error","reset","regexp","_registry","store","fillResult","valueOf","previous","_attributes","attributesMap","curAttr","curAttribute","newValue","splice","clearAttributes","hasClass","removeClass","insertAt","newNode","refNode","removeChild","deep","fn","_level","arguments","apply","opt","limit","message","originalMessage","opt$1","consumeTextNode","reAttributeName","consumeAttributes","p","ul","ol","table","tr","tbody","thead","tfoot","colgroup","select","optgroup","audio","video","object","implicitTags","resolveImplicitTag","applyNumbering","bem","jsx","reSupporterNames","xsl","supportedAddons","addonOpt","appliedAddons","defaultFieldsRenderer","_fieldsRenderer","afterClose","indentText","nl","_wrap","round","curly","square","base","Color","alpha","raw","g","parseInt","short","toRGB","toFixed","NumericValue","Keyword","QuotedString","ch1","ch2","found","acronym","abbrLength","stringLength","j","CSSSnippet","dependencies","dep","candidates","deps","e","x","scss","less","sass","stylus","a:link","a:mail","acr|acronym","basefont","br","frame","hr","bdo","bdo:r","bdo:l","col","link","link:css","link:print","link:favicon","link:touch","link:rss","link:atom","link:im|link:import","meta","meta:utf","meta:vp","meta:compat","meta:edge","meta:redirect","style","script","script:src","img","img:s|img:srcset","img:z|img:sizes","picture","src|source","src:sc|source:src","src:s|source:srcset","src:t|source:type","src:z|source:sizes","src:m|source:media","src:mt|source:media:type","src:mz|source:media:sizes","src:zt|source:sizes:type","iframe","embed","param","area","area:d","area:c","area:r","area:p","form","form:get","form:post","label","input","inp","input:h|input:hidden","input:t|input:text","input:search","input:email","input:url","input:p|input:password","input:datetime","input:date","input:datetime-local","input:month","input:week","input:time","input:tel","input:number","input:color","input:c|input:checkbox","input:r|input:radio","input:range","input:f|input:file","input:s|input:submit","input:i|input:image","input:b|input:button","input:reset","isindex","select:d|select:disabled","opt|option","textarea","marquee","menu:c|menu:context","menu:t|menu:toolbar","html:xml","keygen","command","btn:s|button:s|button:submit","btn:r|button:r|button:reset","btn:d|button:d|button:disabled","fst:d|fset:d|fieldset:d|fieldset:disabled","bq","fig","figc","pic","ifr","emb","cap","colg","fst","btn","optg","tarea","leg","sect","art","hdr","ftr","adr","dlg","prog","mn","tem","fset","datag","datal","kg","det","cmd","ri:d|ri:dpr","ri:v|ri:viewport","ri:a|ri:art","ri:t|ri:type","!!!","doc","!|html:5","cc:ie","cc:noie","@f","@ff","@i|@import","@kf","@m|@media","ac","ai","anim","animdel","animdir","animdur","animfm","animic","animn","animps","animtf","ap","as","bd","bdb","bdbc","bdbi","bdbk","bdbli","bdblrs","bdbri","bdbrrs","bdbs","bdbw","bdc","bdci","bdcl","bdf","bdi","bdl","bdlc","bdlen","bdli","bdls","bdlw","bdr","bdrc","bdri","bdrs","bdrst","bdrw","bds","bdsp","bdt","bdtc","bdti","bdtli","bdtlrs","bdtri","bdtrrs","bdts","bdtw","bdw","bfv","bg","bga","bgbk","bgc","bgcp","bgi","bgo","bgp","bgpx","bgpy","bgr","bgsz","bxsh","bxsz","cm","cnt","coi","colm","colmc","colmf","colmg","colmr","colmrc","colmrs","colmrw","colms","colmw","cor","cp","cps","d","ec","f","fef","fem","femp","fems","ff","fl","fs","fsm","fv","fw","fx","fxb","fxd","fxf","fxg","fxsh","fxw","fz","fza","h","jc","l","lg","lh","lis","lisi","lisp","list","lts","mah","mar","maw","mb","mih","mir","miw","ml","mr","mt","olc","olo","ols","olw","op","ord","ori","orp","ov","ovs","ovx","ovy","pb","pgba","pgbb","pgbi","pl","pr","pt","q","qen","qru","rsz","t","ta","tal","tbl","td","te","th","ti","tj","tov","trf","trfo","trfs","trs","trsde","trsdu","trsp","trstf","tsh","tt","tw","us","va","w","whs","whsc","wid","wm","wob","wos","wow","z","zom","latin","ru","sp","langs","skipCommon","registrySnippets","defaultSnippets","Boolean","locale","charset","stylesheetAutoActivationContext","tokenType","getTokenTypeAt","somethingSelected","Pass","abbrData","cursor","getTokenAt","curIndent","_inserted","getIndex","prototypeAccessors$1","eatAttributes","open$1","close$1","dom","CodeMirrorStreamReader","super","CodeMirror","Pos","lastLine","_eof","_lineLength","_sof","sof","lineStr","NaN","isLast","commands","emmetExpandAbbreviation","emmetInsertLineBreak","defineOption","on","off","defineExtension","force","autocompleteProvider","fromMarker"],"mappings":"sJAuDA,SAASA,GAAQC,GAChB,MAAOA,KAAMC,IAAgBD,IAAME,GAQpC,QAASC,GAAUC,GAClBC,GAAMC,GAAQF,EAAOG,IACfC,EAAQJ,EAAOK,MAErB,IAAIV,EAAQS,GACX,MAAQJ,EAAOM,OACd,GAAIN,EAAOK,SAAWD,GAASJ,EAAOO,SAAWC,GAChD,OAAO,CAMV,OADAR,GAAOG,IAAMD,GACN,EAyER,QAASO,GAAaT,GACrB,MAAOU,GAA4BV,IAAWW,EAA8BX,GAO7E,QAASU,GAA4BV,GACpCC,GAAMC,GAAQF,EAAOG,GACrB,UAAIJ,EAAUC,IAAWA,EAAOY,IAAIC,KAAWC,EAASd,MAIxDA,EAAOG,IAAMD,GACN,GAOR,QAASS,GAA8BX,GACtCC,GAAMC,GAAQF,EAAOG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I,IACfxpB,GAAMA,GAAOygB,EAAOG,WACpB9gB,IAAM4jB,GAASC,GAAWlD,EAAQzgB,EAElC,IAAI0jB,EACH,OACC/gB,aAAc+gB,EAAOrU,MAAM1M,aAC3Bwf,IAAKuB,EAAOrU,MAAM8S,IAClBrf,SAAU4gB,EAAOjV,OAAOhK,KACxBmjC,YAAY,EAId9nC,IAAMskB,GAAY/iB,GAAoBof,EAAQzgB,EAC9C,IAAIokB,EACH,IACC,OACCzhB,aAAcyhB,EAAUzhB,aACxBwf,IAAKrD,GAAkBsF,EAAUzhB,aAAc8d,GAC/C3d,UAAYxB,KAAMtB,EAAIsB,KAAO6D,GAAIif,EAAUthB,UAC3C8kC,YAAY,GAEZ,MAAOxlB,IAKV,MAAO,QAGRqkB,EAAWgB,gBAAgB,kBAAmB,SAASznC,GACtD,MAAO2jB,IAAW6F,KAAMxpB,GAAOwpB,KAAK5I,eAGrC6lB,EAAWgB,gBAAgB,wBAAyB,WACnD3nC,GAAM2gB,GAAS+I,IACf,OAAO/I,GAAOM,UAAU,gBACrBqH,GAAe3H,GACfyH,GAASzH,MCtJUgmB"}
@@ -0,0 +1,382 @@
1
+ // Copyright (c) 2012 Henning Kiel
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the "Software"), to deal in
5
+ // the Software without restriction, including without limitation the rights to
6
+ // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ // the Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
9
+
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
+
20
+ CodeMirror.defineMode("liquor", function(config, parserConfig) {
21
+ function chain(stream, state, f) {
22
+ state.tokenize = f;
23
+ return f(stream, state);
24
+ }
25
+
26
+ // Used as scratch variables to communicate multiple values without
27
+ // consing up tons of objects.
28
+ var type, content;
29
+ function ret(tp, style, cont) {
30
+ type = tp; content = cont;
31
+ return style;
32
+ }
33
+
34
+ function liquorTokenBase(stream, state) {
35
+ var ch = stream.next();
36
+ if (/[\s]/.test(ch)) {
37
+ return ret("whitespace", "liquor-whitespace");
38
+ }
39
+ else if (state.liquorMode == "output-markup" && ch == '}' && stream.eat('}')) {
40
+ state.tokenize = nonLiquor;
41
+ return ret("}}");
42
+ }
43
+ else if (state.liquorMode == "tag-markup" && ch == '%' && stream.eat('}')) {
44
+ state.tokenize = nonLiquor;
45
+ return ret("%}");
46
+ }
47
+ else if (ch == '"' || ch == "'")
48
+ return chain(stream, state, liquorTokenString(ch));
49
+ else if (/[\.,:\|\[\]]/.test(ch))
50
+ return ret(ch);
51
+ else if (/\d/.test(ch)) {
52
+ stream.match(/^\d*(?:\.\d*)?/);
53
+ return ret("number", "liquor-atom");
54
+ }
55
+ else {
56
+ stream.eatWhile(/[\w_?<>=]/);
57
+ var word = stream.current();
58
+ if (word == 'end') {
59
+ stream.eatWhile(/[\w\s]/);
60
+ word = stream.current();
61
+ }
62
+ return ret("word", "liquor-word", word);
63
+ }
64
+
65
+ }
66
+
67
+ function liquorTokenString(quote) {
68
+ return function(stream, state) {
69
+ if (!nextUntilUnescaped(stream, quote))
70
+ state.tokenize = liquorTokenBase;
71
+ return ret("string", "liquor-string");
72
+ };
73
+ }
74
+
75
+ function nextUntilUnescaped(stream, end) {
76
+ var escaped = false, next;
77
+ while ((next = stream.next()) != null) {
78
+ if (next == end && !escaped)
79
+ return false;
80
+ // Liquor does not seem to have string quote escaping
81
+ escaped = !escaped && next == "abc";
82
+ }
83
+ return escaped;
84
+ }
85
+
86
+ function nonLiquor(stream, state) {
87
+ var ch = stream.next();
88
+ state.liquorMode = null;
89
+ if (ch == '{') {
90
+ if (stream.eat('%')) {
91
+ state.tokenize = liquorTokenBase;
92
+ state.liquorMode = "tag-markup";
93
+ return ret("{%", "liquor-markup-delimiter");
94
+ }
95
+ else if (stream.eat('{')) {
96
+ state.tokenize = liquorTokenBase;
97
+ state.liquorMode = "output-markup";
98
+ return ret("{{", "liquor-markup-delimiter");
99
+ }
100
+ }
101
+ stream.eatWhile(/[^{]/);
102
+ return null;
103
+ }
104
+
105
+
106
+ function parseLiquor(state, type, content, stream) {
107
+ var cc = state.cc;
108
+ // Communicate our context to the combinators.
109
+ // (Less wasteful than consing up a hundred closures on every call.)
110
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
111
+
112
+ while(true) {
113
+ var combinator = cc.length ? cc.pop() : liquorMarkup;
114
+ if (combinator(type, content)) {
115
+ // Immediately work off any autocompletion objects on the stack
116
+ while(cc.length && cc[cc.length - 1].ac)
117
+ cc.pop()();
118
+
119
+ if (cx.marked) return cx.marked;
120
+ return null;
121
+ }
122
+ }
123
+ }
124
+
125
+ // Combinator utils
126
+
127
+ var cx = {state: null, column: null, marked: null, cc: null};
128
+ function pass() {
129
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
130
+ }
131
+ function cont() {
132
+ pass.apply(null, arguments);
133
+ return true;
134
+ }
135
+
136
+ // Combinators
137
+
138
+ function expect(wanted, marker, wantedValue) {
139
+ return function expecting(type, value) {
140
+ if (type == wanted && (typeof(value) == "undefined" || value == wantedValue)) {
141
+ if (typeof(marker) == 'string') cx.marked = marker;
142
+ return cont();
143
+ }
144
+ else return cont(arguments.callee);
145
+ };
146
+ }
147
+
148
+ function markAc(type) {
149
+ var result = function() {
150
+ var state = cx.state;
151
+ state.ac = type;
152
+ pass(unmarkAc);
153
+ };
154
+ result.ac = true;
155
+
156
+ return result;
157
+ }
158
+
159
+ function unmarkAc() {
160
+ cx.state.ac = null;
161
+ }
162
+
163
+ function liquorMarkup(type) {
164
+ if (type == "{{") return cont(markAc('variable'), expression, maybeFilters, expect("}}", "liquor-markup-delimiter"));
165
+ if (type == "{%") return cont(markAc('tag'), tagName, expect("%}", "liquor-markup-delimiter"));
166
+ return cont();
167
+ }
168
+
169
+ var endTag = /^end\s[\w]+$/;
170
+ var zeroArgTags = {"live": true, "footer": true, "comment": true};
171
+
172
+ function tagName(type, value) {
173
+ if (type == "word") {
174
+ if (endTag.test(value)) {
175
+ cx.marked = "liquor-endtag-name";
176
+ }
177
+ else {
178
+ cx.marked = "liquor-tag-name";
179
+ if (value == "include") return cont(expression, maybeIncludeArgs);
180
+ if (value == "cycle") return cont(maybeCycleName, commasep(expression, "%}", true));
181
+ if (value == "if" || value == "unless") return cont(markAc('variable'), expression, expect("word", "liquor-keyword", "then"), expect(':'), maybeOperator);
182
+ if (value == "capture") return cont(expression);
183
+ if (value == "for") return cont(expression, expect("word", "liquor-keyword", "in"), expect(':'), markAc('variable'), expression, expect("word", "liquor-keyword", "do"), expect(':'), maybeForArgs);
184
+ if (value == "assign" || value == "declare") return cont(expression, expect('word', "liquor-operator", "="), markAc('variable'), expression);
185
+ if (zeroArgTags.hasOwnProperty(value)) return cont();
186
+ }
187
+ }
188
+ return cont();
189
+ }
190
+
191
+ function maybeForArgs(type, value) {
192
+ if (type == 'word' && value == 'reversed') {
193
+ cx.marked = "liquor-keyword";
194
+ return cont(maybeTagAttributes);
195
+ }
196
+ return pass(maybeTagAttributes);
197
+ }
198
+
199
+ function maybeTagAttributes(type) {
200
+ if (type == "word") {
201
+ cx.marked = "liquor-tag-attribute-name";
202
+ return cont(expect(":"), expression, maybeTagAttributes);
203
+ }
204
+ return pass();
205
+ }
206
+
207
+ function expression(type) {
208
+ if (type == 'word') {
209
+ cx.marked = "liquor-variable";
210
+ return cont(maybeMethod);
211
+ }
212
+ return cont();
213
+ }
214
+
215
+ function maybeMethod(type) {
216
+ if (type == '.') return cont(markAc('method'), method, maybeMethod);
217
+ if (type == '[') return cont(expression, expect(']'), maybeMethod);
218
+ return pass();
219
+ }
220
+
221
+ function method(type) {
222
+ if (type == 'word') {
223
+ cx.marked = "liquor-method";
224
+ }
225
+ return cont();
226
+ }
227
+
228
+ var operators = {"<": true, ">": true, "<=": true, ">=": true, "==": true, "contains": true, "and": true, "or": true};
229
+
230
+ function maybeOperator(type, value) {
231
+ if (operators.hasOwnProperty(value)) {
232
+ cx.marked = "liquor-operator";
233
+ return cont(markAc('variable'), expression, maybeOperator);
234
+ }
235
+ return pass();
236
+ }
237
+
238
+ function maybeCycleName() {
239
+ // Liquor's cycle interprets its first argument as the cycle name if it is follow by a :.
240
+ // In order to separate between a non-name variable argument and the name argument, we
241
+ // do a look-ahead here.
242
+ // If we find a : after our current position, the current expression is the cycle name.
243
+ if (cx.stream.match(/\s*:/, false)) {
244
+ cx.stream.match(/\s*/);
245
+ cx.marked = "liquor-tag-cycle-name";
246
+ return cont(expect(':'));
247
+ }
248
+ return pass();
249
+ }
250
+
251
+ function maybeIncludeArgs(type, value) {
252
+ if (type == 'word') {
253
+ if (value == 'for' || value == 'with') {
254
+ cx.marked = "liquor-keyword";
255
+ return cont(expression);
256
+ }
257
+ }
258
+ return pass();
259
+ }
260
+
261
+ function maybeFilters(type) {
262
+ if (type == '|') return cont(markAc('filter'), filterName, maybeFilterArgs, maybeFilters);
263
+ return pass();
264
+ }
265
+
266
+ function filterName() {
267
+ cx.marked = "liquor-filter";
268
+ return cont();
269
+ }
270
+
271
+ function maybeFilterArgs(type) {
272
+ if (type == ':') return cont(commasep(expression, {"}}": true, "|": true}, true));
273
+ return pass(maybeFilters);
274
+ }
275
+
276
+ function commasep(what, end, doNotEat) {
277
+ function checkForEnd(type) {
278
+ return (typeof(end) == "string" && type == end) || (typeof(end) == "object" && end.hasOwnProperty(type));
279
+ }
280
+ function proceed(type) {
281
+ if (type == ",") return cont(what, proceed);
282
+ if (checkForEnd(type)) return doNotEat ? pass() : cont();
283
+ return cont(expect(end));
284
+ }
285
+ return function commaSeparated(type) {
286
+ if (checkForEnd(type)) return doNotEat ? pass() : cont();
287
+ else return pass(what, proceed);
288
+ };
289
+ }
290
+
291
+ return {
292
+ startState: function() {
293
+ return {
294
+ tokenize: nonLiquor,
295
+ cc: [],
296
+ liquorMode: null,
297
+ ac: null
298
+ }
299
+ },
300
+
301
+ resetState: function(state) {
302
+ state.tokenize = nonLiquor;
303
+ state.cc = [];
304
+ state.liquorMode = null;
305
+ state.ac = null;
306
+ return state;
307
+ },
308
+
309
+ token: function(stream, state) {
310
+ type = null;
311
+
312
+ // Liquor markup cannot span multiple lines
313
+ if (stream.sol()) this.resetState(state);
314
+
315
+ var style = state.tokenize(stream, state);
316
+
317
+ // If we have found liquor markup, we always set some common CSS classes, so we can make use
318
+ // of the style cascade.
319
+ if (state.liquorMode != null) {
320
+ style = (style || "") + " liquor liquor-" + state.liquorMode;
321
+ }
322
+
323
+ // No parsing necessary for white space inside liquor markup or when did not detect any liquor markup.
324
+ if (type == "whitespace" || type == null) return style;
325
+
326
+ var parseType = parseLiquor(state, type, content, stream);
327
+
328
+ return (style || "") + " " + (parseType || "");
329
+ }
330
+ };
331
+ });
332
+ CodeMirror.defineMIME("application/x-liquor-template", "liquor");
333
+
334
+ CodeMirror.defineMode("htmlmixedliquor", function(config, parserConfig) {
335
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), CodeMirror.getMode(config, parserConfig.overlay || "application/x-liquor-template"), false);
336
+ });
337
+
338
+ // Compatibility with CodeMirror's formatting addon
339
+ if (CodeMirror.modeExtensions){
340
+ CodeMirror.modeExtensions["htmlmixedliquor"] = CodeMirror.modeExtensions["htmlmixed"];
341
+
342
+ // If the current mode is 'htmlmixed', returns the extension of a mode located at
343
+ // the specified position (can be htmlmixed, css or javascript). Otherwise, simply
344
+ // returns the extension of the editor's current mode.
345
+ CodeMirror.defineExtension("getModeExtAtPos", function (pos) {
346
+ var token = this.getTokenAt(pos);
347
+ if (token && token.state && token.state.mode)
348
+ return CodeMirror.modeExtensions[token.state.mode == "html" ? "htmlmixed" : token.state.mode];
349
+ else
350
+ if (token && token.state && token.state.base && token.state.base.mode)
351
+ return CodeMirror.modeExtensions[token.state.base.mode == "html" ? "htmlmixed" : token.state.base.mode];
352
+ else
353
+ return this.getModeExt();
354
+ });
355
+
356
+ }
357
+
358
+ CodeMirror.defineExtension("commentRangeLiquor", function (isComment, from, to) {
359
+ var curMode = this.getModeExtAtPos(this.getCursor());
360
+ if (isComment) { // Comment range
361
+ var commentedText = this.getRange(from, to);
362
+ this.replaceRange("{% comment %}" + this.getRange(from, to) + "{% endcomment %}"
363
+ , from, to);
364
+ if (from.line == to.line && from.ch == to.ch) { // An empty comment inserted - put cursor inside
365
+ this.setCursor(from.line, from.ch + "{% comment %}".length);
366
+ }
367
+ }
368
+ else { // Uncomment range
369
+ var selText = this.getRange(from, to);
370
+ var startIndex = selText.indexOf("{% comment %}");
371
+ var endIndex = selText.lastIndexOf("{% endcomment %}");
372
+ if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {
373
+ // Take string till comment start
374
+ selText = selText.substr(0, startIndex)
375
+ // From comment start till comment end
376
+ + selText.substring(startIndex + "{% comment %}".length, endIndex)
377
+ // From comment end till string end
378
+ + selText.substr(endIndex + "{% endcomment %}".length);
379
+ }
380
+ this.replaceRange(selText, from, to);
381
+ }
382
+ });