bedrock_sass 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (466) hide show
  1. checksums.yaml +4 -4
  2. data/assets/_vendor/ace/ace.js +255 -589
  3. data/assets/_vendor/ace/ext-beautify.js +1 -2
  4. data/assets/_vendor/ace/ext-elastic_tabstops_lite.js +2 -2
  5. data/assets/_vendor/ace/ext-emmet.js +4 -4
  6. data/assets/_vendor/ace/ext-error_marker.js +1 -2
  7. data/assets/_vendor/ace/ext-keybinding_menu.js +1 -2
  8. data/assets/_vendor/ace/ext-language_tools.js +5 -9
  9. data/assets/_vendor/ace/ext-linking.js +1 -2
  10. data/assets/_vendor/ace/ext-modelist.js +9 -5
  11. data/assets/_vendor/ace/ext-options.js +10 -7
  12. data/assets/_vendor/ace/ext-rtl.js +1 -2
  13. data/assets/_vendor/ace/ext-searchbox.js +8 -4
  14. data/assets/_vendor/ace/ext-settings_menu.js +10 -7
  15. data/assets/_vendor/ace/ext-spellcheck.js +1 -2
  16. data/assets/_vendor/ace/ext-split.js +1 -2
  17. data/assets/_vendor/ace/ext-static_highlight.js +11 -8
  18. data/assets/_vendor/ace/ext-statusbar.js +1 -2
  19. data/assets/_vendor/ace/ext-textarea.js +1 -5
  20. data/assets/_vendor/ace/ext-themelist.js +2 -4
  21. data/assets/_vendor/ace/ext-whitespace.js +1 -2
  22. data/assets/_vendor/ace/keybinding-emacs.js +6 -2
  23. data/assets/_vendor/ace/keybinding-vim.js +13 -25
  24. data/assets/_vendor/ace/mode-abap.js +2 -3
  25. data/assets/_vendor/ace/mode-abc.js +3 -2
  26. data/assets/_vendor/ace/mode-actionscript.js +2 -2
  27. data/assets/_vendor/ace/mode-ada.js +1 -2
  28. data/assets/_vendor/ace/mode-apache_conf.js +2 -2
  29. data/assets/_vendor/ace/mode-apex.js +457 -0
  30. data/assets/_vendor/ace/mode-applescript.js +1 -2
  31. data/assets/_vendor/ace/mode-asciidoc.js +2 -2
  32. data/assets/_vendor/ace/mode-asl.js +1 -2
  33. data/assets/_vendor/ace/mode-assembly_x86.js +2 -2
  34. data/assets/_vendor/ace/mode-autohotkey.js +1 -2
  35. data/assets/_vendor/ace/mode-batchfile.js +2 -2
  36. data/assets/_vendor/ace/mode-bro.js +2 -2
  37. data/assets/_vendor/ace/mode-c9search.js +1 -2
  38. data/assets/_vendor/ace/mode-c_cpp.js +2 -2
  39. data/assets/_vendor/ace/mode-cirru.js +1 -2
  40. data/assets/_vendor/ace/mode-clojure.js +2 -2
  41. data/assets/_vendor/ace/mode-cobol.js +1 -2
  42. data/assets/_vendor/ace/mode-coffee.js +1 -2
  43. data/assets/_vendor/ace/mode-coldfusion.js +3 -2
  44. data/assets/_vendor/ace/mode-csharp.js +3 -3
  45. data/assets/_vendor/ace/mode-csound_document.js +319 -80
  46. data/assets/_vendor/ace/mode-csound_orchestra.js +323 -86
  47. data/assets/_vendor/ace/mode-csound_score.js +1 -2
  48. data/assets/_vendor/ace/mode-csp.js +1 -2
  49. data/assets/_vendor/ace/mode-css.js +2 -2
  50. data/assets/_vendor/ace/mode-curly.js +3 -2
  51. data/assets/_vendor/ace/mode-d.js +2 -2
  52. data/assets/_vendor/ace/mode-dart.js +24 -14
  53. data/assets/_vendor/ace/mode-diff.js +4 -4
  54. data/assets/_vendor/ace/mode-django.js +3 -2
  55. data/assets/_vendor/ace/mode-dockerfile.js +3 -2
  56. data/assets/_vendor/ace/mode-dot.js +1 -2
  57. data/assets/_vendor/ace/mode-drools.js +3 -2
  58. data/assets/_vendor/ace/mode-edifact.js +2 -2
  59. data/assets/_vendor/ace/mode-eiffel.js +1 -2
  60. data/assets/_vendor/ace/mode-ejs.js +5 -2
  61. data/assets/_vendor/ace/mode-elixir.js +2 -2
  62. data/assets/_vendor/ace/mode-elm.js +1 -2
  63. data/assets/_vendor/ace/mode-erlang.js +2 -2
  64. data/assets/_vendor/ace/mode-forth.js +2 -2
  65. data/assets/_vendor/ace/mode-fortran.js +1 -2
  66. data/assets/_vendor/ace/mode-fsharp.js +1 -2
  67. data/assets/_vendor/ace/mode-fsl.js +258 -0
  68. data/assets/_vendor/ace/mode-ftl.js +3 -2
  69. data/assets/_vendor/ace/mode-gcode.js +1 -2
  70. data/assets/_vendor/ace/mode-gherkin.js +2 -4
  71. data/assets/_vendor/ace/mode-gitignore.js +1 -2
  72. data/assets/_vendor/ace/mode-glsl.js +2 -2
  73. data/assets/_vendor/ace/mode-gobstones.js +3 -2
  74. data/assets/_vendor/ace/mode-golang.js +1 -2
  75. data/assets/_vendor/ace/mode-graphqlschema.js +1 -2
  76. data/assets/_vendor/ace/mode-groovy.js +4 -2
  77. data/assets/_vendor/ace/mode-haml.js +5 -2
  78. data/assets/_vendor/ace/mode-handlebars.js +3 -2
  79. data/assets/_vendor/ace/mode-haskell.js +2 -2
  80. data/assets/_vendor/ace/mode-haskell_cabal.js +1 -2
  81. data/assets/_vendor/ace/mode-haxe.js +2 -2
  82. data/assets/_vendor/ace/mode-hjson.js +2 -2
  83. data/assets/_vendor/ace/mode-html.js +3 -2
  84. data/assets/_vendor/ace/mode-html_elixir.js +4 -2
  85. data/assets/_vendor/ace/mode-html_ruby.js +5 -2
  86. data/assets/_vendor/ace/mode-ini.js +1 -2
  87. data/assets/_vendor/ace/mode-io.js +2 -2
  88. data/assets/_vendor/ace/mode-jack.js +1 -2
  89. data/assets/_vendor/ace/mode-jade.js +14 -115
  90. data/assets/_vendor/ace/mode-java.js +64 -3
  91. data/assets/_vendor/ace/mode-javascript.js +2 -2
  92. data/assets/_vendor/ace/mode-json.js +1 -2
  93. data/assets/_vendor/ace/mode-jsoniq.js +8 -2317
  94. data/assets/_vendor/ace/mode-jsp.js +4 -2
  95. data/assets/_vendor/ace/mode-jssm.js +2 -2
  96. data/assets/_vendor/ace/mode-jsx.js +1 -2
  97. data/assets/_vendor/ace/mode-julia.js +2 -2
  98. data/assets/_vendor/ace/mode-kotlin.js +2 -2
  99. data/assets/_vendor/ace/mode-latex.js +1 -2
  100. data/assets/_vendor/ace/mode-less.js +4 -2
  101. data/assets/_vendor/ace/mode-liquid.js +2026 -477
  102. data/assets/_vendor/ace/mode-lisp.js +2 -2
  103. data/assets/_vendor/ace/mode-livescript.js +1 -2
  104. data/assets/_vendor/ace/mode-logiql.js +2 -2
  105. data/assets/_vendor/ace/mode-logtalk.js +352 -0
  106. data/assets/_vendor/ace/mode-lsl.js +1 -2
  107. data/assets/_vendor/ace/mode-lua.js +1 -2
  108. data/assets/_vendor/ace/mode-luapage.js +3 -2
  109. data/assets/_vendor/ace/mode-lucene.js +2 -3
  110. data/assets/_vendor/ace/mode-makefile.js +3 -2
  111. data/assets/_vendor/ace/mode-markdown.js +5 -2
  112. data/assets/_vendor/ace/mode-mask.js +3 -2
  113. data/assets/_vendor/ace/mode-matlab.js +1 -2
  114. data/assets/_vendor/ace/mode-maze.js +2 -2
  115. data/assets/_vendor/ace/mode-mel.js +2 -2
  116. data/assets/_vendor/ace/mode-mixal.js +1 -2
  117. data/assets/_vendor/ace/mode-mushcode.js +2 -2
  118. data/assets/_vendor/ace/mode-mysql.js +3 -4
  119. data/assets/_vendor/ace/mode-nix.js +2 -2
  120. data/assets/_vendor/ace/mode-nsis.js +2 -2
  121. data/assets/_vendor/ace/mode-objectivec.js +3 -2
  122. data/assets/_vendor/ace/mode-ocaml.js +1 -2
  123. data/assets/_vendor/ace/mode-pascal.js +2 -2
  124. data/assets/_vendor/ace/mode-perl.js +2 -2
  125. data/assets/_vendor/ace/mode-perl6.js +593 -0
  126. data/assets/_vendor/ace/mode-pgsql.js +304 -69
  127. data/assets/_vendor/ace/mode-php.js +844 -1029
  128. data/assets/_vendor/ace/mode-php_laravel_blade.js +844 -1029
  129. data/assets/_vendor/ace/mode-pig.js +2 -2
  130. data/assets/_vendor/ace/mode-plain_text.js +1 -2
  131. data/assets/_vendor/ace/mode-powershell.js +2 -2
  132. data/assets/_vendor/ace/mode-praat.js +2 -2
  133. data/assets/_vendor/ace/mode-prolog.js +2 -2
  134. data/assets/_vendor/ace/mode-properties.js +1 -2
  135. data/assets/_vendor/ace/mode-protobuf.js +2 -2
  136. data/assets/_vendor/ace/mode-puppet.js +1 -2
  137. data/assets/_vendor/ace/mode-python.js +297 -63
  138. data/assets/_vendor/ace/mode-r.js +3 -2
  139. data/assets/_vendor/ace/mode-razor.js +9 -3
  140. data/assets/_vendor/ace/mode-rdoc.js +2 -2
  141. data/assets/_vendor/ace/mode-red.js +2 -2
  142. data/assets/_vendor/ace/mode-redshift.js +1 -2
  143. data/assets/_vendor/ace/mode-rhtml.js +5 -2
  144. data/assets/_vendor/ace/mode-rst.js +1 -2
  145. data/assets/_vendor/ace/mode-ruby.js +3 -2
  146. data/assets/_vendor/ace/mode-rust.js +2 -2
  147. data/assets/_vendor/ace/mode-sass.js +205 -117
  148. data/assets/_vendor/ace/mode-scad.js +2 -2
  149. data/assets/_vendor/ace/mode-scala.js +3 -2
  150. data/assets/_vendor/ace/mode-scheme.js +2 -2
  151. data/assets/_vendor/ace/mode-scss.js +204 -115
  152. data/assets/_vendor/ace/mode-sh.js +3 -2
  153. data/assets/_vendor/ace/mode-sjs.js +2 -2
  154. data/assets/_vendor/ace/mode-slim.js +18 -117
  155. data/assets/_vendor/ace/mode-smarty.js +3 -2
  156. data/assets/_vendor/ace/mode-snippets.js +1 -2
  157. data/assets/_vendor/ace/mode-soy_template.js +4 -2
  158. data/assets/_vendor/ace/mode-space.js +1 -2
  159. data/assets/_vendor/ace/mode-sparql.js +2 -2
  160. data/assets/_vendor/ace/mode-sql.js +2 -3
  161. data/assets/_vendor/ace/mode-sqlserver.js +2 -2
  162. data/assets/_vendor/ace/mode-stylus.js +3 -2
  163. data/assets/_vendor/ace/mode-svg.js +2 -2
  164. data/assets/_vendor/ace/mode-swift.js +1 -2
  165. data/assets/_vendor/ace/mode-tcl.js +2 -2
  166. data/assets/_vendor/ace/mode-terraform.js +1 -2
  167. data/assets/_vendor/ace/mode-tex.js +2 -2
  168. data/assets/_vendor/ace/mode-text.js +1 -2
  169. data/assets/_vendor/ace/mode-textile.js +1 -2
  170. data/assets/_vendor/ace/mode-toml.js +1 -2
  171. data/assets/_vendor/ace/mode-tsx.js +2 -2
  172. data/assets/_vendor/ace/mode-turtle.js +2 -2
  173. data/assets/_vendor/ace/mode-twig.js +3 -2
  174. data/assets/_vendor/ace/mode-typescript.js +2 -2
  175. data/assets/_vendor/ace/mode-vala.js +2 -2
  176. data/assets/_vendor/ace/mode-vbscript.js +1 -2
  177. data/assets/_vendor/ace/mode-velocity.js +4 -2
  178. data/assets/_vendor/ace/mode-verilog.js +1 -2
  179. data/assets/_vendor/ace/mode-vhdl.js +1 -2
  180. data/assets/_vendor/ace/mode-visualforce.js +2641 -0
  181. data/assets/_vendor/ace/mode-wollok.js +3 -2
  182. data/assets/_vendor/ace/mode-xml.js +1 -2
  183. data/assets/_vendor/ace/mode-xquery.js +8 -2287
  184. data/assets/_vendor/ace/mode-yaml.js +1 -2
  185. data/assets/_vendor/ace/snippets/abap.js +2 -3
  186. data/assets/_vendor/ace/snippets/abc.js +1 -2
  187. data/assets/_vendor/ace/snippets/actionscript.js +1 -2
  188. data/assets/_vendor/ace/snippets/ada.js +2 -3
  189. data/assets/_vendor/ace/snippets/apache_conf.js +2 -3
  190. data/assets/_vendor/ace/snippets/apex.js +14 -0
  191. data/assets/_vendor/ace/snippets/applescript.js +2 -3
  192. data/assets/_vendor/ace/snippets/asciidoc.js +2 -3
  193. data/assets/_vendor/ace/snippets/asl.js +2 -3
  194. data/assets/_vendor/ace/snippets/assembly_x86.js +2 -3
  195. data/assets/_vendor/ace/snippets/autohotkey.js +2 -3
  196. data/assets/_vendor/ace/snippets/batchfile.js +2 -3
  197. data/assets/_vendor/ace/snippets/bro.js +1 -2
  198. data/assets/_vendor/ace/snippets/c9search.js +2 -3
  199. data/assets/_vendor/ace/snippets/c_cpp.js +1 -2
  200. data/assets/_vendor/ace/snippets/cirru.js +2 -3
  201. data/assets/_vendor/ace/snippets/clojure.js +1 -2
  202. data/assets/_vendor/ace/snippets/cobol.js +2 -3
  203. data/assets/_vendor/ace/snippets/coffee.js +1 -2
  204. data/assets/_vendor/ace/snippets/coldfusion.js +2 -3
  205. data/assets/_vendor/ace/snippets/csharp.js +2 -3
  206. data/assets/_vendor/ace/snippets/csound_document.js +1 -2
  207. data/assets/_vendor/ace/snippets/csound_orchestra.js +1 -2
  208. data/assets/_vendor/ace/snippets/csound_score.js +2 -3
  209. data/assets/_vendor/ace/snippets/csp.js +1 -2
  210. data/assets/_vendor/ace/snippets/css.js +1 -2
  211. data/assets/_vendor/ace/snippets/curly.js +2 -3
  212. data/assets/_vendor/ace/snippets/d.js +2 -3
  213. data/assets/_vendor/ace/snippets/dart.js +1 -2
  214. data/assets/_vendor/ace/snippets/diff.js +1 -2
  215. data/assets/_vendor/ace/snippets/django.js +1 -2
  216. data/assets/_vendor/ace/snippets/dockerfile.js +2 -3
  217. data/assets/_vendor/ace/snippets/dot.js +2 -3
  218. data/assets/_vendor/ace/snippets/drools.js +1 -2
  219. data/assets/_vendor/ace/snippets/edifact.js +1 -2
  220. data/assets/_vendor/ace/snippets/eiffel.js +2 -3
  221. data/assets/_vendor/ace/snippets/ejs.js +2 -3
  222. data/assets/_vendor/ace/snippets/elixir.js +1 -2
  223. data/assets/_vendor/ace/snippets/elm.js +2 -3
  224. data/assets/_vendor/ace/snippets/erlang.js +1 -2
  225. data/assets/_vendor/ace/snippets/forth.js +2 -3
  226. data/assets/_vendor/ace/snippets/fortran.js +2 -3
  227. data/assets/_vendor/ace/snippets/fsharp.js +2 -3
  228. data/assets/_vendor/ace/snippets/fsl.js +14 -0
  229. data/assets/_vendor/ace/snippets/ftl.js +2 -3
  230. data/assets/_vendor/ace/snippets/gcode.js +2 -3
  231. data/assets/_vendor/ace/snippets/gherkin.js +2 -3
  232. data/assets/_vendor/ace/snippets/gitignore.js +2 -3
  233. data/assets/_vendor/ace/snippets/glsl.js +2 -3
  234. data/assets/_vendor/ace/snippets/gobstones.js +1 -2
  235. data/assets/_vendor/ace/snippets/golang.js +2 -3
  236. data/assets/_vendor/ace/snippets/graphqlschema.js +1 -2
  237. data/assets/_vendor/ace/snippets/groovy.js +2 -3
  238. data/assets/_vendor/ace/snippets/haml.js +1 -2
  239. data/assets/_vendor/ace/snippets/handlebars.js +2 -3
  240. data/assets/_vendor/ace/snippets/haskell.js +1 -2
  241. data/assets/_vendor/ace/snippets/haskell_cabal.js +2 -3
  242. data/assets/_vendor/ace/snippets/haxe.js +2 -3
  243. data/assets/_vendor/ace/snippets/hjson.js +1 -2
  244. data/assets/_vendor/ace/snippets/html.js +1 -2
  245. data/assets/_vendor/ace/snippets/html_elixir.js +2 -3
  246. data/assets/_vendor/ace/snippets/html_ruby.js +2 -3
  247. data/assets/_vendor/ace/snippets/ini.js +2 -3
  248. data/assets/_vendor/ace/snippets/io.js +1 -2
  249. data/assets/_vendor/ace/snippets/jack.js +2 -3
  250. data/assets/_vendor/ace/snippets/jade.js +2 -3
  251. data/assets/_vendor/ace/snippets/java.js +1 -2
  252. data/assets/_vendor/ace/snippets/javascript.js +1 -2
  253. data/assets/_vendor/ace/snippets/json.js +2 -3
  254. data/assets/_vendor/ace/snippets/jsoniq.js +1 -2
  255. data/assets/_vendor/ace/snippets/jsp.js +1 -2
  256. data/assets/_vendor/ace/snippets/jssm.js +1 -2
  257. data/assets/_vendor/ace/snippets/jsx.js +2 -3
  258. data/assets/_vendor/ace/snippets/julia.js +2 -3
  259. data/assets/_vendor/ace/snippets/kotlin.js +1 -2
  260. data/assets/_vendor/ace/snippets/latex.js +2 -3
  261. data/assets/_vendor/ace/snippets/less.js +2 -3
  262. data/assets/_vendor/ace/snippets/liquid.js +883 -3
  263. data/assets/_vendor/ace/snippets/lisp.js +2 -3
  264. data/assets/_vendor/ace/snippets/livescript.js +2 -3
  265. data/assets/_vendor/ace/snippets/logiql.js +2 -3
  266. data/assets/_vendor/ace/snippets/logtalk.js +14 -0
  267. data/assets/_vendor/ace/snippets/lsl.js +1 -2
  268. data/assets/_vendor/ace/snippets/lua.js +1 -2
  269. data/assets/_vendor/ace/snippets/luapage.js +2 -3
  270. data/assets/_vendor/ace/snippets/lucene.js +2 -3
  271. data/assets/_vendor/ace/snippets/makefile.js +1 -2
  272. data/assets/_vendor/ace/snippets/markdown.js +1 -2
  273. data/assets/_vendor/ace/snippets/mask.js +2 -3
  274. data/assets/_vendor/ace/snippets/matlab.js +2 -3
  275. data/assets/_vendor/ace/snippets/maze.js +1 -2
  276. data/assets/_vendor/ace/snippets/mel.js +2 -3
  277. data/assets/_vendor/ace/snippets/mixal.js +2 -3
  278. data/assets/_vendor/ace/snippets/mushcode.js +2 -3
  279. data/assets/_vendor/ace/snippets/mysql.js +2 -3
  280. data/assets/_vendor/ace/snippets/nix.js +2 -3
  281. data/assets/_vendor/ace/snippets/nsis.js +1 -2
  282. data/assets/_vendor/ace/snippets/objectivec.js +2 -3
  283. data/assets/_vendor/ace/snippets/ocaml.js +2 -3
  284. data/assets/_vendor/ace/snippets/pascal.js +2 -3
  285. data/assets/_vendor/ace/snippets/perl.js +1 -2
  286. data/assets/_vendor/ace/snippets/perl6.js +14 -0
  287. data/assets/_vendor/ace/snippets/pgsql.js +2 -3
  288. data/assets/_vendor/ace/snippets/php.js +1 -2
  289. data/assets/_vendor/ace/snippets/php_laravel_blade.js +2 -3
  290. data/assets/_vendor/ace/snippets/pig.js +2 -3
  291. data/assets/_vendor/ace/snippets/plain_text.js +2 -3
  292. data/assets/_vendor/ace/snippets/powershell.js +2 -3
  293. data/assets/_vendor/ace/snippets/praat.js +2 -3
  294. data/assets/_vendor/ace/snippets/prolog.js +2 -3
  295. data/assets/_vendor/ace/snippets/properties.js +2 -3
  296. data/assets/_vendor/ace/snippets/protobuf.js +1 -2
  297. data/assets/_vendor/ace/snippets/puppet.js +2 -3
  298. data/assets/_vendor/ace/snippets/python.js +1 -2
  299. data/assets/_vendor/ace/snippets/r.js +1 -2
  300. data/assets/_vendor/ace/snippets/razor.js +1 -2
  301. data/assets/_vendor/ace/snippets/rdoc.js +2 -3
  302. data/assets/_vendor/ace/snippets/red.js +1 -2
  303. data/assets/_vendor/ace/snippets/redshift.js +2 -3
  304. data/assets/_vendor/ace/snippets/rhtml.js +2 -3
  305. data/assets/_vendor/ace/snippets/rst.js +1 -2
  306. data/assets/_vendor/ace/snippets/ruby.js +1 -2
  307. data/assets/_vendor/ace/snippets/rust.js +2 -3
  308. data/assets/_vendor/ace/snippets/sass.js +2 -3
  309. data/assets/_vendor/ace/snippets/scad.js +2 -3
  310. data/assets/_vendor/ace/snippets/scala.js +2 -3
  311. data/assets/_vendor/ace/snippets/scheme.js +2 -3
  312. data/assets/_vendor/ace/snippets/scss.js +2 -3
  313. data/assets/_vendor/ace/snippets/sh.js +1 -2
  314. data/assets/_vendor/ace/snippets/sjs.js +2 -3
  315. data/assets/_vendor/ace/snippets/slim.js +2 -3
  316. data/assets/_vendor/ace/snippets/smarty.js +2 -3
  317. data/assets/_vendor/ace/snippets/snippets.js +1 -2
  318. data/assets/_vendor/ace/snippets/soy_template.js +2 -3
  319. data/assets/_vendor/ace/snippets/space.js +2 -3
  320. data/assets/_vendor/ace/snippets/sparql.js +1 -2
  321. data/assets/_vendor/ace/snippets/sql.js +1 -2
  322. data/assets/_vendor/ace/snippets/sqlserver.js +1 -2
  323. data/assets/_vendor/ace/snippets/stylus.js +2 -3
  324. data/assets/_vendor/ace/snippets/svg.js +2 -3
  325. data/assets/_vendor/ace/snippets/swift.js +2 -3
  326. data/assets/_vendor/ace/snippets/tcl.js +1 -2
  327. data/assets/_vendor/ace/snippets/terraform.js +2 -3
  328. data/assets/_vendor/ace/snippets/tex.js +1 -2
  329. data/assets/_vendor/ace/snippets/text.js +2 -3
  330. data/assets/_vendor/ace/snippets/textile.js +1 -2
  331. data/assets/_vendor/ace/snippets/toml.js +2 -3
  332. data/assets/_vendor/ace/snippets/tsx.js +2 -3
  333. data/assets/_vendor/ace/snippets/turtle.js +1 -2
  334. data/assets/_vendor/ace/snippets/twig.js +2 -3
  335. data/assets/_vendor/ace/snippets/typescript.js +2 -3
  336. data/assets/_vendor/ace/snippets/vala.js +1 -2
  337. data/assets/_vendor/ace/snippets/vbscript.js +2 -3
  338. data/assets/_vendor/ace/snippets/velocity.js +1 -2
  339. data/assets/_vendor/ace/snippets/verilog.js +2 -3
  340. data/assets/_vendor/ace/snippets/vhdl.js +2 -3
  341. data/assets/_vendor/ace/snippets/visualforce.js +14 -0
  342. data/assets/_vendor/ace/snippets/wollok.js +1 -2
  343. data/assets/_vendor/ace/snippets/xml.js +2 -3
  344. data/assets/_vendor/ace/snippets/xquery.js +1 -2
  345. data/assets/_vendor/ace/snippets/yaml.js +2 -3
  346. data/assets/_vendor/ace/theme-ambiance.js +1 -2
  347. data/assets/_vendor/ace/theme-chaos.js +1 -2
  348. data/assets/_vendor/ace/theme-chrome.js +1 -2
  349. data/assets/_vendor/ace/theme-clouds.js +1 -2
  350. data/assets/_vendor/ace/theme-clouds_midnight.js +1 -2
  351. data/assets/_vendor/ace/theme-cobalt.js +1 -2
  352. data/assets/_vendor/ace/theme-crimson_editor.js +1 -2
  353. data/assets/_vendor/ace/theme-dawn.js +1 -2
  354. data/assets/_vendor/ace/theme-dracula.js +1 -2
  355. data/assets/_vendor/ace/theme-dreamweaver.js +1 -2
  356. data/assets/_vendor/ace/theme-eclipse.js +1 -2
  357. data/assets/_vendor/ace/theme-github.js +3 -3
  358. data/assets/_vendor/ace/theme-gob.js +1 -2
  359. data/assets/_vendor/ace/theme-gruvbox.js +1 -2
  360. data/assets/_vendor/ace/theme-idle_fingers.js +1 -2
  361. data/assets/_vendor/ace/theme-iplastic.js +1 -2
  362. data/assets/_vendor/ace/theme-katzenmilch.js +1 -2
  363. data/assets/_vendor/ace/theme-kr_theme.js +1 -2
  364. data/assets/_vendor/ace/theme-kuroir.js +1 -2
  365. data/assets/_vendor/ace/theme-merbivore.js +1 -2
  366. data/assets/_vendor/ace/theme-merbivore_soft.js +1 -2
  367. data/assets/_vendor/ace/theme-mono_industrial.js +1 -2
  368. data/assets/_vendor/ace/theme-monokai.js +1 -2
  369. data/assets/_vendor/ace/theme-pastel_on_dark.js +1 -2
  370. data/assets/_vendor/ace/theme-solarized_dark.js +1 -2
  371. data/assets/_vendor/ace/theme-solarized_light.js +1 -2
  372. data/assets/_vendor/ace/theme-sqlserver.js +1 -2
  373. data/assets/_vendor/ace/theme-terminal.js +1 -2
  374. data/assets/_vendor/ace/theme-textmate.js +1 -2
  375. data/assets/_vendor/ace/theme-tomorrow.js +1 -2
  376. data/assets/_vendor/ace/theme-tomorrow_night.js +1 -2
  377. data/assets/_vendor/ace/theme-tomorrow_night_blue.js +1 -2
  378. data/assets/_vendor/ace/theme-tomorrow_night_bright.js +1 -2
  379. data/assets/_vendor/ace/theme-tomorrow_night_eighties.js +1 -2
  380. data/assets/_vendor/ace/theme-twilight.js +1 -2
  381. data/assets/_vendor/ace/theme-vibrant_ink.js +1 -2
  382. data/assets/_vendor/ace/theme-xcode.js +1 -2
  383. data/assets/_vendor/ace/worker-coffee.js +11 -20
  384. data/assets/_vendor/ace/worker-css.js +23 -20
  385. data/assets/_vendor/ace/worker-html.js +25 -31
  386. data/assets/_vendor/ace/worker-javascript.js +76 -36
  387. data/assets/_vendor/ace/worker-json.js +25 -20
  388. data/assets/_vendor/ace/worker-lua.js +68 -69
  389. data/assets/_vendor/ace/worker-php.js +12 -20
  390. data/assets/_vendor/ace/worker-xml.js +12 -22
  391. data/assets/_vendor/ace/worker-xquery.js +44 -12378
  392. data/assets/_vendor/tinymce/plugins/advlist/plugin.js +137 -137
  393. data/assets/_vendor/tinymce/plugins/anchor/plugin.js +102 -102
  394. data/assets/_vendor/tinymce/plugins/autolink/plugin.js +154 -154
  395. data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +145 -145
  396. data/assets/_vendor/tinymce/plugins/autosave/plugin.js +207 -217
  397. data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -1
  398. data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +89 -89
  399. data/assets/_vendor/tinymce/plugins/charmap/plugin.js +1246 -1246
  400. data/assets/_vendor/tinymce/plugins/code/plugin.js +80 -80
  401. data/assets/_vendor/tinymce/plugins/codesample/plugin.js +852 -852
  402. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +109 -109
  403. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +144 -144
  404. data/assets/_vendor/tinymce/plugins/directionality/plugin.js +53 -53
  405. data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +74 -74
  406. data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +464 -464
  407. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +152 -152
  408. data/assets/_vendor/tinymce/plugins/help/plugin.js +639 -678
  409. data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -1
  410. data/assets/_vendor/tinymce/plugins/hr/plugin.js +29 -29
  411. data/assets/_vendor/tinymce/plugins/image/plugin.js +1119 -1126
  412. data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -1
  413. data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +3414 -3445
  414. data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +1 -1
  415. data/assets/_vendor/tinymce/plugins/importcss/plugin.js +230 -230
  416. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +152 -152
  417. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +193 -193
  418. data/assets/_vendor/tinymce/plugins/link/plugin.js +646 -646
  419. data/assets/_vendor/tinymce/plugins/lists/plugin.js +2103 -1037
  420. data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -1
  421. data/assets/_vendor/tinymce/plugins/media/plugin.js +1050 -1050
  422. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +69 -69
  423. data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +98 -98
  424. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +91 -91
  425. data/assets/_vendor/tinymce/plugins/paste/plugin.js +1725 -1364
  426. data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -1
  427. data/assets/_vendor/tinymce/plugins/preview/plugin.js +107 -107
  428. data/assets/_vendor/tinymce/plugins/print/plugin.js +28 -28
  429. data/assets/_vendor/tinymce/plugins/save/plugin.js +101 -101
  430. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +535 -537
  431. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  432. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +683 -681
  433. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -1
  434. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +95 -95
  435. data/assets/_vendor/tinymce/plugins/table/plugin.js +8927 -9805
  436. data/assets/_vendor/tinymce/plugins/table/plugin.min.js +1 -1
  437. data/assets/_vendor/tinymce/plugins/template/plugin.js +305 -311
  438. data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -1
  439. data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +317 -317
  440. data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +575 -329
  441. data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -1
  442. data/assets/_vendor/tinymce/plugins/toc/plugin.js +201 -201
  443. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +113 -113
  444. data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +419 -471
  445. data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  446. data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +371 -308
  447. data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -1
  448. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  449. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +1 -0
  450. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  451. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  452. data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -1
  453. data/assets/_vendor/tinymce/themes/inlite/theme.js +9272 -9686
  454. data/assets/_vendor/tinymce/themes/inlite/theme.min.js +1 -1
  455. data/assets/_vendor/tinymce/themes/mobile/theme.js +12130 -13042
  456. data/assets/_vendor/tinymce/themes/mobile/theme.min.js +1 -1
  457. data/assets/_vendor/tinymce/themes/modern/theme.js +9090 -9504
  458. data/assets/_vendor/tinymce/themes/modern/theme.min.js +1 -1
  459. data/assets/_vendor/tinymce/tinymce.js +24914 -25218
  460. data/assets/bedrock/js/bedrock.js +1 -1
  461. data/assets/bedrock/scss/components/no-content.scss +5 -0
  462. data/assets/bedrock/scss/components/select-box.scss +1 -1
  463. data/lib/bedrock_sass.rb +51 -16
  464. data/lib/bedrock_sass/engine.rb +3 -2
  465. data/lib/bedrock_sass/version.rb +1 -1
  466. metadata +17 -7
@@ -1 +1 @@
1
- !function(){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");function n(t,e){return i(document.createElement("canvas"),t,e)}function o(t){return t.getContext("2d")}function i(t,e,n){return t.width=e,t.height=n,t}var a,u,c,l,h={create:n,clone:function(t){var e;return o(e=n(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:o,get3dContext:function(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},p={getWidth:function(t){return t.naturalWidth||t.width},getHeight:function(t){return t.naturalHeight||t.height}},g=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(o,this),r(a,this))},e=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(r){var o=this;null!==this._state?e(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(o._value)}catch(n){return void r.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(o,this),r(a,this))}this._state=!0,this._value=t,u.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,r){var o=this;return new t(function(t,e){i.call(o,new c(n,r,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(o,i){if(0===c.length)return o([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}c[e]=t,0==--a&&o(c)}catch(r){i(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(o){return new t(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},t}(),s=function(t){return function(){return t}},f=function(i){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},d=s(!1),m=s(!0),y=d,v=m,b=function(){return w},w=(l={fold:function(t,e){return t()},is:y,isSome:y,isNone:v,getOr:c=function(t){return t},getOrThunk:u=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:c,orThunk:u,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:y,forall:v,filter:b,equals:a=function(t){return t.isNone()},equals_:a,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(l),l),x=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:v,isNone:y,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return x(t(n))},ap:function(t){return t.fold(b,function(t){return x(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:w},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(y,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},I={some:x,none:b,from:function(t){return null===t||t===undefined?w:x(t)}},T="undefined"!=typeof window?window:Function("return this;")(),R=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:T,r=0;r<t.length&&n!==undefined&&null!==n;++r)n=n[t[r]];return n}(t.split("."),e)},S={getOrDie:function(t,e){var n=R(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}};function O(){return new(S.getOrDie("FileReader"))}var F={atob:function(t){return S.getOrDie("atob")(t)},requestAnimationFrame:function(t){S.getOrDie("requestAnimationFrame")(t)}};function C(u){return new g(function(t,e){var n=URL.createObjectURL(u),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",a)};function i(){o(),t(r)}function a(){o(),e("Unable to load data of type "+u.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",a),r.src=n,r.complete&&i()})}function E(r){return new g(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()})}function D(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return I.none();for(var r,o,i,a=n[1],u=e[1],c=F.atob(u),l=c.length,s=Math.ceil(l/1024),f=new Array(s),d=0;d<s;++d){for(var h=1024*d,p=Math.min(h+1024,l),g=new Array(p-h),m=h,y=0;m<p;++y,++m)g[y]=c[m].charCodeAt(0);f[d]=(r=g,new(S.getOrDie("Uint8Array"))(r))}return I.some((o=f,i={type:a},new(S.getOrDie("Blob"))(o,i)))}function A(n){return new g(function(t,e){D(n).fold(function(){e("uri is not base64: "+n)},t)})}function _(n){return new g(function(t){var e=new O;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var k={blobToImage:C,imageToBlob:function(t){var e=t.src;return 0===e.indexOf("data:")?A(e):E(e)},blobToArrayBuffer:function(n){return new g(function(t){var e=new O;e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:_,blobToBase64:function(t){return _(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:D,canvasToBlob:function(t,n,r){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new g(function(e){t.toBlob(function(t){e(t)},n,r)}):A(t.toDataURL(n,r))},canvasToDataURL:function(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function(t){return C(t).then(function(t){var e,n;return e=t,URL.revokeObjectURL(e.src),n=h.create(p.getWidth(t),p.getHeight(t)),h.get2dContext(n).drawImage(t,0,0),n})},uriToBlob:function(t){return 0===t.indexOf("blob:")?E(t):0===t.indexOf("data:")?A(t):null}},L=function(t){return k.blobToImage(t)},P=function(t){return k.imageToBlob(t)};function B(t,e,n){var r=e.type;function o(e,n){return t.then(function(t){return k.canvasToDataURL(t,e,n)})}return{getType:s(r),toBlob:function(){return g.resolve(e)},toDataURL:function(){return n},toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return k.canvasToBlob(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(h.clone)}}}function H(e){return k.blobToDataUri(e).then(function(t){return B(k.blobToCanvas(e),e,t)})}var M={fromBlob:H,fromCanvas:function(e,t){return k.canvasToBlob(e,t).then(function(t){return B(g.resolve(e),t,e.toDataURL())})},fromImage:function(t){return k.imageToBlob(t).then(function(t){return H(t)})},fromBlobAndUrlSync:function(t,e){return B(k.blobToCanvas(t),t,e)}};function N(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var U=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function j(t,e){var n,r,o,i,a=[],u=new Array(10);for(n=0;n<5;n++){for(r=0;r<5;r++)a[r]=e[r+5*n];for(r=0;r<5;r++){for(o=i=0;o<5;o++)i+=t[r+5*o]*a[o];u[r+5*n]=i}}return u}function G(t,n){return n=N(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,N(t,0,1)})}var z={identity:function(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},adjust:G,multiply:j,adjustContrast:function(t,e){var n;return e=N(e,-1,1),j(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?U[e]:U[Math.floor(e)]*(1-n)+U[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function(t,e){return j(t,[1,0,0,0,e=N(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function(t,e){var n;return j(t,[.3086*(1-(n=1+(0<(e=N(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function(t,e){var n,r,o,i,a;return e=N(e,-180,180)/180*Math.PI,j(t,[(o=.213)+.787*(n=Math.cos(e))+(r=Math.sin(e))*-o,(i=.715)+n*-i+r*-i,(a=.072)+n*-a+.928*r,0,0,o+n*-o+.143*r,i+n*(1-i)+.14*r,a+n*-a+-.283*r,0,0,o+n*-o+-.787*r,i+n*-i+r*i,a+.928*n+r*a,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function(t,e,n,r){return j(t,[e=N(e,0,2),0,0,0,0,0,n=N(n,0,2),0,0,0,0,0,r=N(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function(t,e){return j(t,G([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=N(e,0,1)))},adjustGrayscale:function(t,e){return j(t,G([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=N(e,0,1)))}};function V(a,u){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=u,i=h.get2dContext(e),o=function(t,e){var n,r,o,i,a,u=t.data,c=e[0],l=e[1],s=e[2],f=e[3],d=e[4],h=e[5],p=e[6],g=e[7],m=e[8],y=e[9],v=e[10],b=e[11],w=e[12],x=e[13],I=e[14],T=e[15],R=e[16],S=e[17],O=e[18],F=e[19];for(a=0;a<u.length;a+=4)n=u[a],r=u[a+1],o=u[a+2],i=u[a+3],u[a]=n*c+r*l+o*s+i*f+d,u[a+1]=n*h+r*p+o*g+i*m+y,u[a+2]=n*v+r*b+o*w+i*x+I,u[a+3]=n*T+r*R+o*S+i*O+F;return t}(i.getImageData(0,0,e.width,e.height),r),i.putImageData(o,0,0),M.fromCanvas(e,n);var e,n,r,o,i})}function W(u,c){return u.toCanvas().then(function(t){return e=t,n=u.getType(),r=c,a=h.get2dContext(e),o=a.getImageData(0,0,e.width,e.height),i=a.getImageData(0,0,e.width,e.height),i=function(t,e,n){var r,o,i,a,u,c,l,s,f,d,h,p,g,m,y,v,b;function w(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),r=t.data,o=e.data,v=t.width,b=t.height,c=0;c<b;c++)for(u=0;u<v;u++){for(l=s=f=0,h=0;h<i;h++)for(d=0;d<i;d++)p=w(u+d-a,0,v-1),g=w(c+h-a,0,b-1),m=4*(g*v+p),y=n[h*i+d],l+=r[m]*y,s+=r[m+1]*y,f+=r[m+2]*y;o[m=4*(c*v+u)]=w(l,0,255),o[m+1]=w(s,0,255),o[m+2]=w(f,0,255)}return e}(o,i,r),a.putImageData(i,0,0),M.fromCanvas(e,n);var e,n,r,o,i,a})}function q(u){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r,o,i=h.get2dContext(t),a=new Array(256);for(o=0;o<a.length;o++)a[o]=u(o,n);return r=function(t,e){var n,r=t.data;for(n=0;n<r.length;n+=4)r[n]=e[r[n]],r[n+1]=e[r[n+1]],r[n+2]=e[r[n+2]];return t}(i.getImageData(0,0,t.width,t.height),a),i.putImageData(r,0,0),M.fromCanvas(t,e)}(t,e.getType(),n)})}}function Y(n){return function(t,e){return V(t,n(z.identity(),e))}}function X(e){return function(t){return W(t,e)}}var J,K={invert:(J=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0],function(t){return V(t,J)}),brightness:Y(z.adjustBrightness),hue:Y(z.adjustHue),saturate:Y(z.adjustSaturation),contrast:Y(z.adjustContrast),grayscale:Y(z.adjustGrayscale),sepia:Y(z.adjustSepia),colorize:function(t,e,n,r){return V(t,z.adjustColors(z.identity(),e,n,r))},sharpen:X([0,-1,0,-1,5,-1,0,-1,0]),emboss:X([-2,-1,0,-1,1,1,0,1,2]),gamma:q(function(t,e){return 255*Math.pow(t/255,1-e)}),exposure:q(function(t,e){return 255*(1-Math.exp(-t/255*e))}),colorFilter:V,convoluteFilter:W},Z={scale:function e(t,n,r){var o=p.getWidth(t),i=p.getHeight(t),a=n/o,u=r/i,c=!1;(a<.5||2<a)&&(a=a<.5?.5:2,c=!0),(u<.5||2<u)&&(u=u<.5?.5:2,c=!0);var l,s,f,d=(l=t,s=a,f=u,new g(function(t){var e=p.getWidth(l),n=p.getHeight(l),r=Math.floor(e*s),o=Math.floor(n*f),i=h.create(r,o),a=h.get2dContext(i);a.drawImage(l,0,0,e,n,0,0,r,o),t(i)}));return c?d.then(function(t){return e(t,n,r)}):d}},Q={rotate:function(c,l){return c.toCanvas().then(function(t){return e=t,n=c.getType(),r=l,o=h.create(e.width,e.height),i=h.get2dContext(o),90!=(r=r<(u=a=0)?360+r:r)&&270!=r||h.resize(o,o.height,o.width),90!=r&&180!=r||(a=o.width),270!=r&&180!=r||(u=o.height),i.translate(a,u),i.rotate(r*Math.PI/180),i.drawImage(e,0,0),M.fromCanvas(o,n);var e,n,r,o,i,a,u})},flip:function(a,u){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=u,o=h.create(e.width,e.height),i=h.get2dContext(o),"v"==r?(i.scale(1,-1),i.drawImage(e,0,-o.height)):(i.scale(-1,1),i.drawImage(e,-o.width,0)),M.fromCanvas(o,n);var e,n,r,o,i})},crop:function(c,l,s,f,d){return c.toCanvas().then(function(t){return e=t,n=c.getType(),r=l,o=s,i=f,a=d,u=h.create(i,a),h.get2dContext(u).drawImage(e,-r,-o),M.fromCanvas(u,n);var e,n,r,o,i,a,u})},resize:function(e,n,r){return e.toCanvas().then(function(t){return Z.scale(t,n,r).then(function(t){return M.fromCanvas(t,e.getType())})})}},tt=function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}return t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),r=0,o=0;r<e;r++)o|=this.readByteAt(t+r)<<Math.abs(n+8*r);return o},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._dv?this._dv.byteLength:0},t}(),et={274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},nt={36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},rt={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},ot={513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"},it={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},at=function(){function t(t){this._offsets={tiffHeader:10,IFD0:null,IFD1:null,exifIFD:null,gpsIFD:null},this._tiffTags={};var e=this;if(e._reader=new tt(t),e._idx=e._offsets.tiffHeader,65505!==e.SHORT(0)||"EXIF\0"!==e.STRING(4,5).toUpperCase())throw new Error("Exif data cannot be read or not available.");if(e._reader.littleEndian=18761==e.SHORT(e._idx),42!==e.SHORT(e._idx+=2))throw new Error("Invalid Exif data.");e._offsets.IFD0=e._offsets.tiffHeader+e.LONG(e._idx+=2),e._tiffTags=e.extractTags(e._offsets.IFD0,et),"ExifIFDPointer"in e._tiffTags&&(e._offsets.exifIFD=e._offsets.tiffHeader+e._tiffTags.ExifIFDPointer,delete e._tiffTags.ExifIFDPointer),"GPSInfoIFDPointer"in e._tiffTags&&(e._offsets.gpsIFD=e._offsets.tiffHeader+e._tiffTags.GPSInfoIFDPointer,delete e._tiffTags.GPSInfoIFDPointer);var n=e.LONG(e._offsets.IFD0+12*e.SHORT(e._offsets.IFD0)+2);n&&(e._offsets.IFD1=e._offsets.tiffHeader+n)}return t.prototype.BYTE=function(t){return this._reader.BYTE(t)},t.prototype.SHORT=function(t){return this._reader.SHORT(t)},t.prototype.LONG=function(t){return this._reader.LONG(t)},t.prototype.SLONG=function(t){return this._reader.SLONG(t)},t.prototype.CHAR=function(t){return this._reader.CHAR(t)},t.prototype.STRING=function(t,e){return this._reader.STRING(t,e)},t.prototype.SEGMENT=function(t,e){return this._reader.SEGMENT(t,e)},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._reader.length()},t.prototype.UNDEFINED=function(){return this.BYTE.apply(this,arguments)},t.prototype.RATIONAL=function(t){return this.LONG(t)/this.LONG(t+4)},t.prototype.SRATIONAL=function(t){return this.SLONG(t)/this.SLONG(t+4)},t.prototype.ASCII=function(t){return this.CHAR(t)},t.prototype.TIFF=function(){return this._tiffTags},t.prototype.EXIF=function(){var t=null;if(this._offsets.exifIFD){try{t=this.extractTags(this._offsets.exifIFD,nt)}catch(r){return null}if(t.ExifVersion&&Array.isArray(t.ExifVersion)){for(var e=0,n="";e<t.ExifVersion.length;e++)n+=String.fromCharCode(t.ExifVersion[e]);t.ExifVersion=n}}return t},t.prototype.GPS=function(){var t=null;if(this._offsets.gpsIFD){try{t=this.extractTags(this._offsets.gpsIFD,rt)}catch(e){return null}t.GPSVersionID&&Array.isArray(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},t.prototype.thumb=function(){var t=this;if(t._offsets.IFD1)try{var e=t.extractTags(t._offsets.IFD1,ot);if("JPEGInterchangeFormat"in e)return t.SEGMENT(t._offsets.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(n){}return null},t.prototype.extractTags=function(t,e){var n,r,o,i,a,u,c,l,s=this,f=[],d={},h={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},p={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(n=s.SHORT(t),r=0;r<n;r++)if(f=[],c=t+2+12*r,(o=e[s.SHORT(c)])!==undefined){if(i=h[s.SHORT(c+=2)],a=s.LONG(c+=2),!(u=p[i]))throw new Error("Invalid Exif data.");if(c+=4,4<u*a&&(c=s.LONG(c)+s._offsets.tiffHeader),c+u*a>=s.length())throw new Error("Invalid Exif data.");"ASCII"!==i?(f=s.asArray(i,c,a),l=1==a?f[0]:f,it.hasOwnProperty(o)&&"object"!=typeof l?d[o]=it[o][l]:d[o]=l):d[o]=s.STRING(c,a).replace(/\0$/,"").trim()}return d},t}(),ut=function(t){var e,n,r=[],o=0;for(e=2;e<=t.length();)if(65488<=(n=t.SHORT(e))&&n<=65495)e+=2;else{if(65498===n||65497===n)break;o=t.SHORT(e+2)+2,65505<=n&&n<=65519&&r.push({hex:n,name:"APP"+(15&n),start:e,length:o,segment:t.SEGMENT(e,o)}),e+=o}return r},ct=function(u){return k.blobToArrayBuffer(u).then(function(t){try{var e=new tt(t);if(65496===e.SHORT(0)){var n=ut(e),r=n.filter(function(t){return"APP1"===t.name}),o={};if(!r.length)return g.reject("Headers did not include required information");var i=new at(r[0].segment);return(o={tiff:i.TIFF(),exif:i.EXIF(),gps:i.GPS(),thumb:i.thumb()}).rawHeaders=n,o}return g.reject("Image was not a jpeg")}catch(a){return g.reject("Unsupported format or not an image: "+u.type+" (Exception: "+a.message+")")}})},lt=function(t,e){return Q.rotate(t,e)},st={invert:function(t){return K.invert(t)},sharpen:function(t){return K.sharpen(t)},emboss:function(t){return K.emboss(t)},brightness:function(t,e){return K.brightness(t,e)},hue:function(t,e){return K.hue(t,e)},saturate:function(t,e){return K.saturate(t,e)},contrast:function(t,e){return K.contrast(t,e)},grayscale:function(t,e){return K.grayscale(t,e)},sepia:function(t,e){return K.sepia(t,e)},colorize:function(t,e,n,r){return K.colorize(t,e,n,r)},gamma:function(t,e){return K.gamma(t,e)},exposure:function(t,e){return K.exposure(t,e)},flip:function(t,e){return Q.flip(t,e)},crop:function(t,e,n,r,o){return Q.crop(t,e,n,r,o)},resize:function(t,e,n){return Q.resize(t,e,n)},rotate:lt,exifRotate:function(e){return e.toBlob().then(ct).then(function(t){switch(t.tiff.Orientation){case 6:return lt(e,90);case 3:return lt(e,180);case 8:return lt(e,270);default:return e}},function(){return e})}},ft=function(t){return t.toBlob()},dt={blobToImageResult:function(t){return M.fromBlob(t)},fromBlobAndUrlSync:function(t,e){return M.fromBlobAndUrlSync(t,e)},imageToImageResult:function(t){return M.fromImage(t)},imageResultToBlob:function(t,e,n){return e===undefined&&n===undefined?ft(t):t.toAdjustedBlob(e,n)},imageResultToOriginalBlob:ft,imageResultToDataURL:function(t){return t.toDataURL()}},ht=function(){return S.getOrDie("URL")},pt={createObjectURL:function(t){return ht().createObjectURL(t)},revokeObjectURL:function(t){ht().revokeObjectURL(t)}},gt=tinymce.util.Tools.resolve("tinymce.util.Delay"),mt=tinymce.util.Tools.resolve("tinymce.util.Promise"),yt=tinymce.util.Tools.resolve("tinymce.util.URI"),vt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),bt=tinymce.util.Tools.resolve("tinymce.ui.Factory"),wt=tinymce.util.Tools.resolve("tinymce.geom.Rect"),xt=function(n){return new mt(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})},It=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Tt=tinymce.util.Tools.resolve("tinymce.util.Observable"),Rt=tinymce.util.Tools.resolve("tinymce.util.VK"),St=0,Ot={create:function(t){return new(bt.get("Control").extend({Defaults:{classes:"imagepanel"},selection:function(t){return arguments.length?(this.state.set("rect",t),this):this.state.get("rect")},imageSize:function(){var t=this.state.get("viewRect");return{w:t.w,h:t.h}},toggleCropRect:function(t){this.state.set("cropEnabled",t)},imageSrc:function(t){var o=this,i=new Image;i.src=t,xt(i).then(function(){var t,e,n=o.state.get("viewRect");if((e=o.$el.find("img"))[0])e.replaceWith(i);else{var r=document.createElement("div");r.className="mce-imagepanel-bg",o.getEl().appendChild(r),o.getEl().appendChild(i)}t={x:0,y:0,w:i.naturalWidth,h:i.naturalHeight},o.state.set("viewRect",t),o.state.set("rect",wt.inflate(t,-20,-20)),n&&n.w===t.w&&n.h===t.h||o.zoomFit(),o.repaintImage(),o.fire("load")})},zoom:function(t){return arguments.length?(this.state.set("zoom",t),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var t,e,n,r,o,i;t=this.$el.find("img"),e=this.getEl().clientWidth,n=this.getEl().clientHeight,r=t[0].naturalWidth,o=t[0].naturalHeight,1<=(i=Math.min((e-10)/r,(n-10)/o))&&(i=1),this.zoom(i)},repaintImage:function(){var t,e,n,r,o,i,a,u,c,l,s;s=this.getEl(),c=this.zoom(),l=this.state.get("rect"),a=this.$el.find("img"),u=this.$el.find(".mce-imagepanel-bg"),o=s.offsetWidth,i=s.offsetHeight,n=a[0].naturalWidth*c,r=a[0].naturalHeight*c,t=Math.max(0,o/2-n/2),e=Math.max(0,i/2-r/2),a.css({left:t,top:e,width:n,height:r}),u.css({left:t,top:e,width:n,height:r}),this.cropRect&&(this.cropRect.setRect({x:l.x*c+t,y:l.y*c+e,w:l.w*c,h:l.h*c}),this.cropRect.setClampRect({x:t,y:e,w:n,h:r}),this.cropRect.setViewPortRect({x:0,y:0,w:o,h:i}))},bindStates:function(){var r=this;function n(t){r.cropRect=function(l,n,s,r,o){var f,a,t,i,e="mce-",u=e+"crid-"+St++;function d(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function c(t,e,n,r){var o,i,a,u,c;o=e.x,i=e.y,a=e.w,u=e.h,o+=n*t.deltaX,i+=r*t.deltaY,(a+=n*t.deltaW)<20&&(a=20),(u+=r*t.deltaH)<20&&(u=20),c=l=wt.clamp({x:o,y:i,w:a,h:u},s,"move"===t.name),c=d(s,c),f.fire("updateRect",{rect:c}),g(c)}function h(e){function t(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),It("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}$.each(a,function(t){It("#"+u+"-"+t.name,r).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}function p(t){h(l=t)}function g(t){var e,n;p((e=s,{x:(n=t).x+e.x,y:n.y+e.y,w:n.w,h:n.h}))}return a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],It('<div id="'+u+'" class="'+e+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),$.each(i,function(t){It("#"+u,r).append('<div id="'+u+"-"+t+'"class="'+e+'croprect-block" style="display: none" data-mce-bogus="all">')}),$.each(a,function(t){It("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="'+e+"croprect-handle "+e+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false">')}),t=$.map(a,function(e){var n;return new(bt.get("DragHelper"))(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=l},drag:function(t){c(e,n,t.deltaX,t.deltaY)}})}),h(l),It(r).on("focusin focusout",function(t){It(t.target).attr("aria-grabbed","focus"===t.type)}),It(r).on("keydown",function(e){var i;function t(t,e,n,r,o){t.stopPropagation(),t.preventDefault(),c(i,n,r,o)}switch($.each(a,function(t){if(e.target.id===u+"-"+t.name)return i=t,!1}),e.keyCode){case Rt.LEFT:t(e,0,l,-10,0);break;case Rt.RIGHT:t(e,0,l,10,0);break;case Rt.UP:t(e,0,l,0,-10);break;case Rt.DOWN:t(e,0,l,0,10);break;case Rt.ENTER:case Rt.SPACEBAR:e.preventDefault(),o()}}),f=$.extend({toggleVisibility:function(t){var e;e=$.map(a,function(t){return"#"+u+"-"+t.name}).concat($.map(i,function(t){return"#"+u+"-"+t})).join(","),t?It(e,r).show():It(e,r).hide()},setClampRect:function(t){s=t,h(l)},setRect:p,getInnerRect:function(){return d(s,l)},setInnerRect:g,setViewPortRect:function(t){n=t,h(l)},destroy:function(){$.each(t,function(t){t.destroy()}),t=[]}},Tt)}(t,r.state.get("viewRect"),r.state.get("viewRect"),r.getEl(),function(){r.fire("crop")}),r.cropRect.on("updateRect",function(t){var e=t.rect,n=r.zoom();e={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)},r.state.set("rect",e)}),r.on("remove",r.cropRect.destroy)}r.state.on("change:cropEnabled",function(t){r.cropRect.toggleVisibility(t.value),r.repaintImage()}),r.state.on("change:zoom",function(){r.repaintImage()}),r.state.on("change:rect",function(t){var e=t.value;r.cropRect||n(e),r.cropRect.setRect(e)})}}))(t)}};function Ft(t){return{blob:t,url:pt.createObjectURL(t)}}function Ct(t){t&&pt.revokeObjectURL(t.url)}function Et(t){$.each(t,Ct)}function Dt(i,a,t,e){var u,n,r,c,o,l,s,f,d,h,p,g,m,y,v,b,w,x,I,T,R,S,O,F,C,E,D,A=function(){var n=[],r=-1;function t(){return 0<r}function e(){return-1!==r&&r<n.length-1}return{data:n,add:function(t){var e;return e=n.splice(++r),n.push(t),{state:t,removed:e}},undo:function(){if(t())return n[--r]},redo:function(){if(e())return n[++r]},canUndo:t,canRedo:e}}(),_=function(t){return i.rtl?t.reverse():t};function k(t){var e,n,r,o;e=u.find("#w")[0],n=u.find("#h")[0],r=parseInt(e.value(),10),o=parseInt(n.value(),10),u.find("#constrain")[0].checked()&&F&&C&&r&&o&&("w"===t.control.settings.name?(o=Math.round(r*E),n.value(o)):(r=Math.round(o*D),e.value(r))),F=r,C=o}function L(t){return Math.round(100*t)+"%"}function P(){u.find("#undo").disabled(!A.canUndo()),u.find("#redo").disabled(!A.canRedo()),u.statusbar.find("#save").disabled(!A.canUndo())}function B(){u.find("#undo").disabled(!0),u.find("#redo").disabled(!0)}function H(t){t&&f.imageSrc(t.url)}function M(e){return function(){var t=$.grep(O,function(t){return t.settings.name!==e});$.each(t,function(t){t.hide()}),e.show(),e.focus()}}function N(t){H(c=Ft(t))}function U(t){H(a=Ft(t)),Et(A.add(a).removed),P()}function j(){var e=f.selection();dt.blobToImageResult(a.blob).then(function(t){st.crop(t,e.x,e.y,e.w,e.h).then(q).then(function(t){U(t),z()})})}var G=function(e){var n=[].slice.call(arguments,1);return function(){var t=c||a;dt.blobToImageResult(t.blob).then(function(t){e.apply(this,[t].concat(n)).then(q).then(N)})}};function z(){H(a),Ct(c),M(n)(),P()}function V(){c?(U(c.blob),z()):function t(e,n){c?n():setTimeout(function(){0<e--?t(e,n):i.windowManager.alert("Error: failed to apply image operation.")},10)}(100,V)}function W(t){return bt.create("Form",{layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:t})}var q=function(t){return t.toBlob()};function Y(t,e){return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){B(),dt.blobToImageResult(a.blob).then(function(t){return e(t)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})})}function X(t,n,e,r,o){return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(t){var e;e=t.value,dt.blobToImageResult(a.blob).then(function(t){return n(t,e)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})},minValue:i.rtl?o:r,maxValue:i.rtl?r:o,value:e,previewFilter:L},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){this.find("slider").value(e),B()})}o=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:j}])).hide().on("show hide",function(t){f.toggleCropRect("show"===t.type)}).on("show",B),l=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:k},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:k},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:function(t){!0===t.control.value()&&(E=C/F,D=F/C)}},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}])).hide().on("submit",function(t){var e=parseInt(u.find("#w").value(),10),n=parseInt(u.find("#h").value(),10);t.preventDefault(),function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[].slice.call(arguments,1);return function(){dt.blobToImageResult(a.blob).then(function(t){e.apply(this,[t].concat(r)).then(q).then(U)})}}(st.resize,e,n)(),z()}).on("show",B),s=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:G(st.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:G(st.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:G(st.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:G(st.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",B),p=Y(0,st.invert),I=Y(0,st.sharpen),T=Y(0,st.emboss),g=X(0,st.brightness,0,-1,1),m=X(0,st.hue,180,0,360),y=X(0,st.saturate,0,-1,1),v=X(0,st.contrast,0,-1,1),b=X(0,st.grayscale,0,0,1),w=X(0,st.sepia,0,0,1),x=function(t,o){function e(){var e,n,r;e=u.find("#r")[0].value(),n=u.find("#g")[0].value(),r=u.find("#b")[0].value(),dt.blobToImageResult(a.blob).then(function(t){return o(t,e,n,r)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})}var n=i.rtl?2:0,r=i.rtl?0:2;return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"slider",label:"G",name:"g",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"slider",label:"B",name:"b",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){u.find("#r,#g,#b").value(1),B()})}(0,st.colorize),R=X(0,st.gamma,0,-1,1),S=X(0,st.exposure,1,0,2),r=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:M(m)},{text:"saturate",icon:"saturate",onclick:M(y)},{text:"sepia",icon:"sepia",onclick:M(w)},{text:"emboss",icon:"emboss",onclick:M(T)},{text:"exposure",icon:"exposure",onclick:M(S)},{type:"spacer",flex:1}])).hide(),n=W(_([{tooltip:"Crop",icon:"crop",onclick:M(o)},{tooltip:"Resize",icon:"resize2",onclick:M(l)},{tooltip:"Orientation",icon:"orientation",onclick:M(s)},{tooltip:"Brightness",icon:"sun",onclick:M(g)},{tooltip:"Sharpen",icon:"sharpen",onclick:M(I)},{tooltip:"Contrast",icon:"contrast",onclick:M(v)},{tooltip:"Color levels",icon:"drop",onclick:M(x)},{tooltip:"Gamma",icon:"gamma",onclick:M(R)},{tooltip:"Invert",icon:"invert",onclick:M(p)}])),f=Ot.create({flex:1,imageSrc:a.url}),d=bt.create("Container",{layout:"flex",direction:"column",pack:"start",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:function(){H(a=A.undo()),P()}},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:function(){H(a=A.redo()),P()}},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:function(){var t=f.zoom();t<2&&(t+=.1),f.zoom(t)}},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:function(){var t=f.zoom();.1<t&&(t-=.1),f.zoom(t)}}]}),h=bt.create("Container",{type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:_([d,f])}),O=[n,o,l,s,r,p,g,m,y,v,b,w,x,I,T,R,S],(u=i.windowManager.open({layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(vt.DOM.getViewPort().w,800),minHeight:Math.min(vt.DOM.getViewPort().h,650),title:"Edit image",items:O.concat([h]),buttons:_([{text:"Save",name:"save",subtype:"primary",onclick:function(){t(a.blob),u.close()}},{text:"Cancel",onclick:"close"}])})).on("close",function(){e(),Et(A.data),c=A=null}),A.add(a),P(),f.on("load",function(){F=f.imageSize().w,C=f.imageSize().h,E=C/F,D=F/C,u.find("#w").value(F),u.find("#h").value(C)}),f.on("crop",j)}var At,_t={edit:function(r,t){return new mt(function(e,n){return t.toBlob().then(function(t){Dt(r,Ft(t),e,n)})})}},kt={getImageSize:function(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},setImageSize:function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function(t){return{w:t.naturalWidth,h:t.naturalHeight}}},Lt=(At="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===At}),Pt=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n,t))return I.some(o)}return I.none()};Array.prototype.slice;function Bt(){return new(S.getOrDie("XMLHttpRequest"))}Lt(Array.from)&&Array.from;var Ht=function(t){return null!==t&&t!==undefined},Mt=function(t,e){var n;return n=e.reduce(function(t,e){return Ht(t)?t[e]:undefined},t),Ht(n)?n:null},Nt=function(e){return new mt(function(n){var t=new O;t.onload=function(t){var e=t.target;n(e.result)},t.readAsText(e)})},Ut=function(e,r,o){return new mt(function(t){var n;(n=new Bt).onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:this.response})},n.open("GET",e,!0),n.withCredentials=o,$.each(r,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},jt=function(t){var e;try{e=JSON.parse(t)}catch(n){}return e},Gt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],zt=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],Vt=function(e){return"ImageProxy HTTP error: "+Pt(Gt,function(t){return e===t.code}).fold(s("Unknown ImageProxy error"),function(t){return t.message})},Wt=function(t){var e=Vt(t);return mt.reject(e)},qt=function(e){return Pt(zt,function(t){return t.type===e}).fold(s("Unknown service error"),function(t){return t.message})},Yt=function(t,e){return Nt(e).then(function(t){var e,n,r=(e=jt(t),"ImageProxy Service error: "+((n=Mt(e,["error","type"]))?qt(n):"Invalid JSON in service error message"));return mt.reject(r)})},Xt=function(t,e){return 400===(n=t)||403===n||500===n?Yt(0,e):Wt(t);var n},$t=Wt,Jt=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return Ut((n=t,r=e,o=-1===n.indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)||!r?n:n+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(t){return t.status<200||300<=t.status?Xt(t.status,t.blob):mt.resolve(t.blob)})},Kt=function(t,e,n){return e?Jt(t,e):Ut(t,{},n).then(function(t){return t.status<200||300<=t.status?$t(t.status):mt.resolve(t.blob)})},Zt=0,Qt=function(t,e){t.notificationManager.open({text:e,type:"error"})},te=function(t){return t.selection.getNode()},ee=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new yt(n).host===t.documentBaseURI.host},ne=function(t,e){return-1!==$.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new yt(e.src).host)},re=function(t,e){var n,r,o,i,a=e.src;return ne(t,e)?Kt(e.src,null,(r=t,o=e,-1!==$.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new yt(o.src).host))):ee(t,e)?P(e):(a=t.getParam("imagetools_proxy"),a+=(-1===a.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),n=(i=t).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),Kt(a,n,!1))},oe=function(t){var e;return(e=t.editorUpload.blobCache.getByUri(te(t).src))?mt.resolve(e.blob()):re(t,te(t))},ie=function(t){clearTimeout(t.get())},ae=function(c,l,s,f,d){return l.toBlob().then(function(t){var e,n,r,o,i,a,u;return r=c.editorUpload.blobCache,e=(i=te(c)).src,c.getParam("images_reuse_filename",!1,"boolean")&&((o=r.getByUri(e))?(e=o.uri(),n=o.name()):(a=c,n=(u=e.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?a.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+Zt++,blob:t,base64:l.toBase64(),uri:e,name:n}),r.add(o),c.undoManager.transact(function(){c.$(i).on("load",function t(){var e,n,r;c.$(i).off("load",t),c.nodeChanged(),s?c.editorUpload.uploadImagesAuto():(ie(f),e=c,n=f,r=gt.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),n.set(r))}),d&&c.$(i).attr({width:d.w,height:d.h}),c.$(i).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},ue=function(e,n,t,r){return function(){return e._scanForImages().then(f(oe,e)).then(dt.blobToImageResult).then(t).then(function(t){return ae(e,t,!1,n,r)},function(t){Qt(e,t)})}},ce=function(n,r,o){return function(){var t=kt.getImageSize(te(n)),e=t?{w:t.h,h:t.w}:null;return ue(n,r,function(t){return st.rotate(t,o)},e)()}},le=function(t,e,n){return function(){return ue(t,e,function(t){return st.flip(t,n)})()}},se=function(e,r){return function(){var o=te(e),i=kt.getNaturalImageSize(o),n=function(r){return new mt(function(n){L(r).then(function(t){var e=kt.getNaturalImageSize(t);i.w===e.w&&i.h===e.h||kt.getImageSize(o)&&kt.setImageSize(o,e),pt.revokeObjectURL(t.src),n(r)})})};oe(e).then(dt.blobToImageResult).then(f(function(e,t){return _t.edit(e,t).then(n).then(dt.blobToImageResult).then(function(t){return ae(e,t,!0,r)},function(){})},e),function(t){Qt(e,t)})}},fe=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")&&(ee(t,e)||ne(t,e)||t.settings.imagetools_proxy)},de=ie,he=function(n,t){$.each({mceImageRotateLeft:ce(n,t,-90),mceImageRotateRight:ce(n,t,90),mceImageFlipVertical:le(n,t,"v"),mceImageFlipHorizontal:le(n,t,"h"),mceEditImage:se(n,t)},function(t,e){n.addCommand(e,t)})},pe=function(n,r,o){n.on("NodeChange",function(t){var e=o.get();e&&e.src!==t.element.src&&(de(r),n.editorUpload.uploadImagesAuto(),o.set(null)),fe(n,t.element)&&o.set(t.element)})},ge=function(t){t.addButton("rotateleft",{title:"Rotate counterclockwise",cmd:"mceImageRotateLeft"}),t.addButton("rotateright",{title:"Rotate clockwise",cmd:"mceImageRotateRight"}),t.addButton("flipv",{title:"Flip vertically",cmd:"mceImageFlipVertical"}),t.addButton("fliph",{title:"Flip horizontally",cmd:"mceImageFlipHorizontal"}),t.addButton("editimage",{title:"Edit image",cmd:"mceEditImage"}),t.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})},me=function(t){t.addContextToolbar(f(fe,t),t.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions"))};t.add("imagetools",function(t){var e=r(0),n=r(null);he(t,e),ge(t),me(t),pe(t,e,n)})}();
1
+ !function(){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");function n(t,e){return i(document.createElement("canvas"),t,e)}function o(t){return t.getContext("2d")}function i(t,e,n){return t.width=e,t.height=n,t}var h={create:n,clone:function(t){var e;return o(e=n(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:o,get3dContext:function(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},p={getWidth:function(t){return t.naturalWidth||t.width},getHeight:function(t){return t.naturalHeight||t.height}},g=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(o,this),r(a,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(r){var o=this;null!==this._state?e(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(o._value)}catch(n){return void r.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(o,this),r(a,this))}this._state=!0,this._value=t,u.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,r){var o=this;return new t(function(t,e){i.call(o,new c(n,r,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(o,i){if(0===c.length)return o([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}c[e]=t,0==--a&&o(c)}catch(r){i(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(o){return new t(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},t}(),a=function(t){return function(){return t}};function u(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}var c,l,s,f,d=a(!1),m=a(!0),y=d,v=m,b=function(){return w},w=(f={fold:function(t,e){return t()},is:y,isSome:y,isNone:v,getOr:s=function(t){return t},getOrThunk:l=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:s,orThunk:l,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:y,forall:v,filter:b,equals:c=function(t){return t.isNone()},equals_:c,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(f),f),x=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:v,isNone:y,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return x(t(n))},ap:function(t){return t.fold(b,function(t){return x(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:w},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(y,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},I={some:x,none:b,from:function(t){return null===t||t===undefined?w:x(t)}},T="undefined"!=typeof window?window:Function("return this;")(),R=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:T,r=0;r<t.length&&n!==undefined&&null!==n;++r)n=n[t[r]];return n}(t.split("."),e)},S={getOrDie:function(t,e){var n=R(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}};function O(){return new(S.getOrDie("FileReader"))}var F={atob:function(t){return S.getOrDie("atob")(t)},requestAnimationFrame:function(t){S.getOrDie("requestAnimationFrame")(t)}};function C(u){return new g(function(t,e){var n=URL.createObjectURL(u),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",a)};function i(){o(),t(r)}function a(){o(),e("Unable to load data of type "+u.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",a),r.src=n,r.complete&&i()})}function E(r){return new g(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()})}function D(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return I.none();for(var r,o,i,a=n[1],u=e[1],c=F.atob(u),l=c.length,s=Math.ceil(l/1024),f=new Array(s),d=0;d<s;++d){for(var h=1024*d,p=Math.min(h+1024,l),g=new Array(p-h),m=h,y=0;m<p;++y,++m)g[y]=c[m].charCodeAt(0);f[d]=(r=g,new(S.getOrDie("Uint8Array"))(r))}return I.some((o=f,i={type:a},new(S.getOrDie("Blob"))(o,i)))}function A(n){return new g(function(t,e){D(n).fold(function(){e("uri is not base64: "+n)},t)})}function _(n){return new g(function(t){var e=O();e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var k={blobToImage:C,imageToBlob:function(t){var e=t.src;return 0===e.indexOf("data:")?A(e):E(e)},blobToArrayBuffer:function(n){return new g(function(t){var e=O();e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:_,blobToBase64:function(t){return _(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:D,canvasToBlob:function(t,n,r){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new g(function(e){t.toBlob(function(t){e(t)},n,r)}):A(t.toDataURL(n,r))},canvasToDataURL:function(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function(t){return C(t).then(function(t){var e,n;return e=t,URL.revokeObjectURL(e.src),n=h.create(p.getWidth(t),p.getHeight(t)),h.get2dContext(n).drawImage(t,0,0),n})},uriToBlob:function(t){return 0===t.indexOf("blob:")?E(t):0===t.indexOf("data:")?A(t):null}},L=function(t){return k.blobToImage(t)},P=function(t){return k.imageToBlob(t)};function B(t,e,n){var r=e.type;function o(e,n){return t.then(function(t){return k.canvasToDataURL(t,e,n)})}return{getType:a(r),toBlob:function(){return g.resolve(e)},toDataURL:function(){return n},toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return k.canvasToBlob(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(h.clone)}}}function H(e){return k.blobToDataUri(e).then(function(t){return B(k.blobToCanvas(e),e,t)})}var M={fromBlob:H,fromCanvas:function(e,t){return k.canvasToBlob(e,t).then(function(t){return B(g.resolve(e),t,e.toDataURL())})},fromImage:function(t){return k.imageToBlob(t).then(function(t){return H(t)})},fromBlobAndUrlSync:function(t,e){return B(k.blobToCanvas(t),t,e)}};function N(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var U=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function j(t,e){var n,r,o,i,a=[],u=new Array(10);for(n=0;n<5;n++){for(r=0;r<5;r++)a[r]=e[r+5*n];for(r=0;r<5;r++){for(o=i=0;o<5;o++)i+=t[r+5*o]*a[o];u[r+5*n]=i}}return u}function G(t,n){return n=N(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,N(t,0,1)})}var z={identity:function(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},adjust:G,multiply:j,adjustContrast:function(t,e){var n;return e=N(e,-1,1),j(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?U[e]:U[Math.floor(e)]*(1-n)+U[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function(t,e){return j(t,[1,0,0,0,e=N(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function(t,e){var n;return j(t,[.3086*(1-(n=1+(0<(e=N(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function(t,e){var n,r,o,i,a;return e=N(e,-180,180)/180*Math.PI,j(t,[(o=.213)+.787*(n=Math.cos(e))+(r=Math.sin(e))*-o,(i=.715)+n*-i+r*-i,(a=.072)+n*-a+.928*r,0,0,o+n*-o+.143*r,i+n*(1-i)+.14*r,a+n*-a+-.283*r,0,0,o+n*-o+-.787*r,i+n*-i+r*i,a+.928*n+r*a,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function(t,e,n,r){return j(t,[e=N(e,0,2),0,0,0,0,0,n=N(n,0,2),0,0,0,0,0,r=N(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function(t,e){return j(t,G([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=N(e,0,1)))},adjustGrayscale:function(t,e){return j(t,G([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=N(e,0,1)))}};function V(a,u){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=u,i=h.get2dContext(e),o=function(t,e){var n,r,o,i,a,u=t.data,c=e[0],l=e[1],s=e[2],f=e[3],d=e[4],h=e[5],p=e[6],g=e[7],m=e[8],y=e[9],v=e[10],b=e[11],w=e[12],x=e[13],I=e[14],T=e[15],R=e[16],S=e[17],O=e[18],F=e[19];for(a=0;a<u.length;a+=4)n=u[a],r=u[a+1],o=u[a+2],i=u[a+3],u[a]=n*c+r*l+o*s+i*f+d,u[a+1]=n*h+r*p+o*g+i*m+y,u[a+2]=n*v+r*b+o*w+i*x+I,u[a+3]=n*T+r*R+o*S+i*O+F;return t}(i.getImageData(0,0,e.width,e.height),r),i.putImageData(o,0,0),M.fromCanvas(e,n);var e,n,r,o,i})}function W(u,c){return u.toCanvas().then(function(t){return e=t,n=u.getType(),r=c,a=h.get2dContext(e),o=a.getImageData(0,0,e.width,e.height),i=a.getImageData(0,0,e.width,e.height),i=function(t,e,n){var r,o,i,a,u,c,l,s,f,d,h,p,g,m,y,v,b;function w(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),r=t.data,o=e.data,v=t.width,b=t.height,c=0;c<b;c++)for(u=0;u<v;u++){for(l=s=f=0,h=0;h<i;h++)for(d=0;d<i;d++)p=w(u+d-a,0,v-1),g=w(c+h-a,0,b-1),m=4*(g*v+p),y=n[h*i+d],l+=r[m]*y,s+=r[m+1]*y,f+=r[m+2]*y;o[m=4*(c*v+u)]=w(l,0,255),o[m+1]=w(s,0,255),o[m+2]=w(f,0,255)}return e}(o,i,r),a.putImageData(i,0,0),M.fromCanvas(e,n);var e,n,r,o,i,a})}function q(u){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r,o,i=h.get2dContext(t),a=new Array(256);for(o=0;o<a.length;o++)a[o]=u(o,n);return r=function(t,e){var n,r=t.data;for(n=0;n<r.length;n+=4)r[n]=e[r[n]],r[n+1]=e[r[n+1]],r[n+2]=e[r[n+2]];return t}(i.getImageData(0,0,t.width,t.height),a),i.putImageData(r,0,0),M.fromCanvas(t,e)}(t,e.getType(),n)})}}function Y(n){return function(t,e){return V(t,n(z.identity(),e))}}function X(e){return function(t){return W(t,e)}}var J,K={invert:(J=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0],function(t){return V(t,J)}),brightness:Y(z.adjustBrightness),hue:Y(z.adjustHue),saturate:Y(z.adjustSaturation),contrast:Y(z.adjustContrast),grayscale:Y(z.adjustGrayscale),sepia:Y(z.adjustSepia),colorize:function(t,e,n,r){return V(t,z.adjustColors(z.identity(),e,n,r))},sharpen:X([0,-1,0,-1,5,-1,0,-1,0]),emboss:X([-2,-1,0,-1,1,1,0,1,2]),gamma:q(function(t,e){return 255*Math.pow(t/255,1-e)}),exposure:q(function(t,e){return 255*(1-Math.exp(-t/255*e))}),colorFilter:V,convoluteFilter:W},Z={scale:function e(t,n,r){var o=p.getWidth(t),i=p.getHeight(t),a=n/o,u=r/i,c=!1;(a<.5||2<a)&&(a=a<.5?.5:2,c=!0),(u<.5||2<u)&&(u=u<.5?.5:2,c=!0);var l,s,f,d=(l=t,s=a,f=u,new g(function(t){var e=p.getWidth(l),n=p.getHeight(l),r=Math.floor(e*s),o=Math.floor(n*f),i=h.create(r,o),a=h.get2dContext(i);a.drawImage(l,0,0,e,n,0,0,r,o),t(i)}));return c?d.then(function(t){return e(t,n,r)}):d}},Q={rotate:function(c,l){return c.toCanvas().then(function(t){return e=t,n=c.getType(),r=l,o=h.create(e.width,e.height),i=h.get2dContext(o),90!=(r=r<(u=a=0)?360+r:r)&&270!=r||h.resize(o,o.height,o.width),90!=r&&180!=r||(a=o.width),270!=r&&180!=r||(u=o.height),i.translate(a,u),i.rotate(r*Math.PI/180),i.drawImage(e,0,0),M.fromCanvas(o,n);var e,n,r,o,i,a,u})},flip:function(a,u){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=u,o=h.create(e.width,e.height),i=h.get2dContext(o),"v"==r?(i.scale(1,-1),i.drawImage(e,0,-o.height)):(i.scale(-1,1),i.drawImage(e,-o.width,0)),M.fromCanvas(o,n);var e,n,r,o,i})},crop:function(c,l,s,f,d){return c.toCanvas().then(function(t){return e=t,n=c.getType(),r=l,o=s,i=f,a=d,u=h.create(i,a),h.get2dContext(u).drawImage(e,-r,-o),M.fromCanvas(u,n);var e,n,r,o,i,a,u})},resize:function(e,n,r){return e.toCanvas().then(function(t){return Z.scale(t,n,r).then(function(t){return M.fromCanvas(t,e.getType())})})}},tt=function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}return t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),r=0,o=0;r<e;r++)o|=this.readByteAt(t+r)<<Math.abs(n+8*r);return o},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._dv?this._dv.byteLength:0},t}(),et={274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},nt={36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},rt={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},ot={513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"},it={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},at=function(){function t(t){this._offsets={tiffHeader:10,IFD0:null,IFD1:null,exifIFD:null,gpsIFD:null},this._tiffTags={};var e=this;if(e._reader=new tt(t),e._idx=e._offsets.tiffHeader,65505!==e.SHORT(0)||"EXIF\0"!==e.STRING(4,5).toUpperCase())throw new Error("Exif data cannot be read or not available.");if(e._reader.littleEndian=18761==e.SHORT(e._idx),42!==e.SHORT(e._idx+=2))throw new Error("Invalid Exif data.");e._offsets.IFD0=e._offsets.tiffHeader+e.LONG(e._idx+=2),e._tiffTags=e.extractTags(e._offsets.IFD0,et),"ExifIFDPointer"in e._tiffTags&&(e._offsets.exifIFD=e._offsets.tiffHeader+e._tiffTags.ExifIFDPointer,delete e._tiffTags.ExifIFDPointer),"GPSInfoIFDPointer"in e._tiffTags&&(e._offsets.gpsIFD=e._offsets.tiffHeader+e._tiffTags.GPSInfoIFDPointer,delete e._tiffTags.GPSInfoIFDPointer);var n=e.LONG(e._offsets.IFD0+12*e.SHORT(e._offsets.IFD0)+2);n&&(e._offsets.IFD1=e._offsets.tiffHeader+n)}return t.prototype.BYTE=function(t){return this._reader.BYTE(t)},t.prototype.SHORT=function(t){return this._reader.SHORT(t)},t.prototype.LONG=function(t){return this._reader.LONG(t)},t.prototype.SLONG=function(t){return this._reader.SLONG(t)},t.prototype.CHAR=function(t){return this._reader.CHAR(t)},t.prototype.STRING=function(t,e){return this._reader.STRING(t,e)},t.prototype.SEGMENT=function(t,e){return this._reader.SEGMENT(t,e)},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._reader.length()},t.prototype.UNDEFINED=function(){return this.BYTE.apply(this,arguments)},t.prototype.RATIONAL=function(t){return this.LONG(t)/this.LONG(t+4)},t.prototype.SRATIONAL=function(t){return this.SLONG(t)/this.SLONG(t+4)},t.prototype.ASCII=function(t){return this.CHAR(t)},t.prototype.TIFF=function(){return this._tiffTags},t.prototype.EXIF=function(){var t=null;if(this._offsets.exifIFD){try{t=this.extractTags(this._offsets.exifIFD,nt)}catch(r){return null}if(t.ExifVersion&&Array.isArray(t.ExifVersion)){for(var e=0,n="";e<t.ExifVersion.length;e++)n+=String.fromCharCode(t.ExifVersion[e]);t.ExifVersion=n}}return t},t.prototype.GPS=function(){var t=null;if(this._offsets.gpsIFD){try{t=this.extractTags(this._offsets.gpsIFD,rt)}catch(e){return null}t.GPSVersionID&&Array.isArray(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},t.prototype.thumb=function(){var t=this;if(t._offsets.IFD1)try{var e=t.extractTags(t._offsets.IFD1,ot);if("JPEGInterchangeFormat"in e)return t.SEGMENT(t._offsets.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(n){}return null},t.prototype.extractTags=function(t,e){var n,r,o,i,a,u,c,l,s=this,f=[],d={},h={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},p={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(n=s.SHORT(t),r=0;r<n;r++)if(f=[],c=t+2+12*r,(o=e[s.SHORT(c)])!==undefined){if(i=h[s.SHORT(c+=2)],a=s.LONG(c+=2),!(u=p[i]))throw new Error("Invalid Exif data.");if(c+=4,4<u*a&&(c=s.LONG(c)+s._offsets.tiffHeader),c+u*a>=s.length())throw new Error("Invalid Exif data.");"ASCII"!==i?(f=s.asArray(i,c,a),l=1==a?f[0]:f,it.hasOwnProperty(o)&&"object"!=typeof l?d[o]=it[o][l]:d[o]=l):d[o]=s.STRING(c,a).replace(/\0$/,"").trim()}return d},t}(),ut=function(t){var e,n,r=[],o=0;for(e=2;e<=t.length();)if(65488<=(n=t.SHORT(e))&&n<=65495)e+=2;else{if(65498===n||65497===n)break;o=t.SHORT(e+2)+2,65505<=n&&n<=65519&&r.push({hex:n,name:"APP"+(15&n),start:e,length:o,segment:t.SEGMENT(e,o)}),e+=o}return r},ct=function(u){return k.blobToArrayBuffer(u).then(function(t){try{var e=new tt(t);if(65496===e.SHORT(0)){var n=ut(e),r=n.filter(function(t){return"APP1"===t.name}),o={};if(!r.length)return g.reject("Headers did not include required information");var i=new at(r[0].segment);return(o={tiff:i.TIFF(),exif:i.EXIF(),gps:i.GPS(),thumb:i.thumb()}).rawHeaders=n,o}return g.reject("Image was not a jpeg")}catch(a){return g.reject("Unsupported format or not an image: "+u.type+" (Exception: "+a.message+")")}})},lt=function(t,e){return Q.rotate(t,e)},st={invert:function(t){return K.invert(t)},sharpen:function(t){return K.sharpen(t)},emboss:function(t){return K.emboss(t)},brightness:function(t,e){return K.brightness(t,e)},hue:function(t,e){return K.hue(t,e)},saturate:function(t,e){return K.saturate(t,e)},contrast:function(t,e){return K.contrast(t,e)},grayscale:function(t,e){return K.grayscale(t,e)},sepia:function(t,e){return K.sepia(t,e)},colorize:function(t,e,n,r){return K.colorize(t,e,n,r)},gamma:function(t,e){return K.gamma(t,e)},exposure:function(t,e){return K.exposure(t,e)},flip:function(t,e){return Q.flip(t,e)},crop:function(t,e,n,r,o){return Q.crop(t,e,n,r,o)},resize:function(t,e,n){return Q.resize(t,e,n)},rotate:lt,exifRotate:function(e){return e.toBlob().then(ct).then(function(t){switch(t.tiff.Orientation){case 6:return lt(e,90);case 3:return lt(e,180);case 8:return lt(e,270);default:return e}},function(){return e})}},ft=function(t){return t.toBlob()},dt={blobToImageResult:function(t){return M.fromBlob(t)},fromBlobAndUrlSync:function(t,e){return M.fromBlobAndUrlSync(t,e)},imageToImageResult:function(t){return M.fromImage(t)},imageResultToBlob:function(t,e,n){return e===undefined&&n===undefined?ft(t):t.toAdjustedBlob(e,n)},imageResultToOriginalBlob:ft,imageResultToDataURL:function(t){return t.toDataURL()}},ht=function(){return S.getOrDie("URL")},pt={createObjectURL:function(t){return ht().createObjectURL(t)},revokeObjectURL:function(t){ht().revokeObjectURL(t)}},gt=tinymce.util.Tools.resolve("tinymce.util.Delay"),mt=tinymce.util.Tools.resolve("tinymce.util.Promise"),yt=tinymce.util.Tools.resolve("tinymce.util.URI"),vt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),bt=tinymce.util.Tools.resolve("tinymce.ui.Factory"),wt=tinymce.util.Tools.resolve("tinymce.geom.Rect"),xt=function(n){return new mt(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})},It=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Tt=tinymce.util.Tools.resolve("tinymce.util.Observable"),Rt=tinymce.util.Tools.resolve("tinymce.util.VK"),St=0,Ot={create:function(t){return new(bt.get("Control").extend({Defaults:{classes:"imagepanel"},selection:function(t){return arguments.length?(this.state.set("rect",t),this):this.state.get("rect")},imageSize:function(){var t=this.state.get("viewRect");return{w:t.w,h:t.h}},toggleCropRect:function(t){this.state.set("cropEnabled",t)},imageSrc:function(t){var o=this,i=new Image;i.src=t,xt(i).then(function(){var t,e,n=o.state.get("viewRect");if((e=o.$el.find("img"))[0])e.replaceWith(i);else{var r=document.createElement("div");r.className="mce-imagepanel-bg",o.getEl().appendChild(r),o.getEl().appendChild(i)}t={x:0,y:0,w:i.naturalWidth,h:i.naturalHeight},o.state.set("viewRect",t),o.state.set("rect",wt.inflate(t,-20,-20)),n&&n.w===t.w&&n.h===t.h||o.zoomFit(),o.repaintImage(),o.fire("load")})},zoom:function(t){return arguments.length?(this.state.set("zoom",t),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var t,e,n,r,o,i;t=this.$el.find("img"),e=this.getEl().clientWidth,n=this.getEl().clientHeight,r=t[0].naturalWidth,o=t[0].naturalHeight,1<=(i=Math.min((e-10)/r,(n-10)/o))&&(i=1),this.zoom(i)},repaintImage:function(){var t,e,n,r,o,i,a,u,c,l,s;s=this.getEl(),c=this.zoom(),l=this.state.get("rect"),a=this.$el.find("img"),u=this.$el.find(".mce-imagepanel-bg"),o=s.offsetWidth,i=s.offsetHeight,n=a[0].naturalWidth*c,r=a[0].naturalHeight*c,t=Math.max(0,o/2-n/2),e=Math.max(0,i/2-r/2),a.css({left:t,top:e,width:n,height:r}),u.css({left:t,top:e,width:n,height:r}),this.cropRect&&(this.cropRect.setRect({x:l.x*c+t,y:l.y*c+e,w:l.w*c,h:l.h*c}),this.cropRect.setClampRect({x:t,y:e,w:n,h:r}),this.cropRect.setViewPortRect({x:0,y:0,w:o,h:i}))},bindStates:function(){var r=this;function n(t){r.cropRect=function(l,n,s,r,o){var f,a,t,i,e="mce-",u=e+"crid-"+St++;function d(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function c(t,e,n,r){var o,i,a,u,c;o=e.x,i=e.y,a=e.w,u=e.h,o+=n*t.deltaX,i+=r*t.deltaY,(a+=n*t.deltaW)<20&&(a=20),(u+=r*t.deltaH)<20&&(u=20),c=l=wt.clamp({x:o,y:i,w:a,h:u},s,"move"===t.name),c=d(s,c),f.fire("updateRect",{rect:c}),g(c)}function h(e){function t(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),It("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}$.each(a,function(t){It("#"+u+"-"+t.name,r).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}function p(t){h(l=t)}function g(t){var e,n;p((e=s,{x:(n=t).x+e.x,y:n.y+e.y,w:n.w,h:n.h}))}return a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],It('<div id="'+u+'" class="'+e+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),$.each(i,function(t){It("#"+u,r).append('<div id="'+u+"-"+t+'"class="'+e+'croprect-block" style="display: none" data-mce-bogus="all">')}),$.each(a,function(t){It("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="'+e+"croprect-handle "+e+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false">')}),t=$.map(a,function(e){var n;return new(bt.get("DragHelper"))(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=l},drag:function(t){c(e,n,t.deltaX,t.deltaY)}})}),h(l),It(r).on("focusin focusout",function(t){It(t.target).attr("aria-grabbed","focus"===t.type)}),It(r).on("keydown",function(e){var i;function t(t,e,n,r,o){t.stopPropagation(),t.preventDefault(),c(i,n,r,o)}switch($.each(a,function(t){if(e.target.id===u+"-"+t.name)return i=t,!1}),e.keyCode){case Rt.LEFT:t(e,0,l,-10,0);break;case Rt.RIGHT:t(e,0,l,10,0);break;case Rt.UP:t(e,0,l,0,-10);break;case Rt.DOWN:t(e,0,l,0,10);break;case Rt.ENTER:case Rt.SPACEBAR:e.preventDefault(),o()}}),f=$.extend({toggleVisibility:function(t){var e;e=$.map(a,function(t){return"#"+u+"-"+t.name}).concat($.map(i,function(t){return"#"+u+"-"+t})).join(","),t?It(e,r).show():It(e,r).hide()},setClampRect:function(t){s=t,h(l)},setRect:p,getInnerRect:function(){return d(s,l)},setInnerRect:g,setViewPortRect:function(t){n=t,h(l)},destroy:function(){$.each(t,function(t){t.destroy()}),t=[]}},Tt)}(t,r.state.get("viewRect"),r.state.get("viewRect"),r.getEl(),function(){r.fire("crop")}),r.cropRect.on("updateRect",function(t){var e=t.rect,n=r.zoom();e={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)},r.state.set("rect",e)}),r.on("remove",r.cropRect.destroy)}r.state.on("change:cropEnabled",function(t){r.cropRect.toggleVisibility(t.value),r.repaintImage()}),r.state.on("change:zoom",function(){r.repaintImage()}),r.state.on("change:rect",function(t){var e=t.value;r.cropRect||n(e),r.cropRect.setRect(e)})}}))(t)}};function Ft(t){return{blob:t,url:pt.createObjectURL(t)}}function Ct(t){t&&pt.revokeObjectURL(t.url)}function Et(t){$.each(t,Ct)}function Dt(i,a,t,e){var u,n,r,c,o,l,s,f,d,h,p,g,m,y,v,b,w,x,I,T,R,S,O,F,C,E,D,A=function(){var n=[],r=-1;function t(){return 0<r}function e(){return-1!==r&&r<n.length-1}return{data:n,add:function(t){var e;return e=n.splice(++r),n.push(t),{state:t,removed:e}},undo:function(){if(t())return n[--r]},redo:function(){if(e())return n[++r]},canUndo:t,canRedo:e}}(),_=function(t){return i.rtl?t.reverse():t};function k(t){var e,n,r,o;e=u.find("#w")[0],n=u.find("#h")[0],r=parseInt(e.value(),10),o=parseInt(n.value(),10),u.find("#constrain")[0].checked()&&F&&C&&r&&o&&("w"===t.control.settings.name?(o=Math.round(r*E),n.value(o)):(r=Math.round(o*D),e.value(r))),F=r,C=o}function L(t){return Math.round(100*t)+"%"}function P(){u.find("#undo").disabled(!A.canUndo()),u.find("#redo").disabled(!A.canRedo()),u.statusbar.find("#save").disabled(!A.canUndo())}function B(){u.find("#undo").disabled(!0),u.find("#redo").disabled(!0)}function H(t){t&&f.imageSrc(t.url)}function M(e){return function(){var t=$.grep(O,function(t){return t.settings.name!==e});$.each(t,function(t){t.hide()}),e.show(),e.focus()}}function N(t){H(c=Ft(t))}function U(t){H(a=Ft(t)),Et(A.add(a).removed),P()}function j(){var e=f.selection();dt.blobToImageResult(a.blob).then(function(t){st.crop(t,e.x,e.y,e.w,e.h).then(q).then(function(t){U(t),z()})})}var G=function(e){var n=[].slice.call(arguments,1);return function(){var t=c||a;dt.blobToImageResult(t.blob).then(function(t){e.apply(this,[t].concat(n)).then(q).then(N)})}};function z(){H(a),Ct(c),M(n)(),P()}function V(){c?(U(c.blob),z()):function t(e,n){c?n():setTimeout(function(){0<e--?t(e,n):i.windowManager.alert("Error: failed to apply image operation.")},10)}(100,V)}function W(t){return bt.create("Form",{layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:t})}var q=function(t){return t.toBlob()};function Y(t,e){return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){B(),dt.blobToImageResult(a.blob).then(function(t){return e(t)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})})}function X(t,n,e,r,o){return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(t){var e;e=t.value,dt.blobToImageResult(a.blob).then(function(t){return n(t,e)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})},minValue:i.rtl?o:r,maxValue:i.rtl?r:o,value:e,previewFilter:L},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){this.find("slider").value(e),B()})}o=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:j}])).hide().on("show hide",function(t){f.toggleCropRect("show"===t.type)}).on("show",B),l=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:k},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:k},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:function(t){!0===t.control.value()&&(E=C/F,D=F/C)}},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}])).hide().on("submit",function(t){var e=parseInt(u.find("#w").value(),10),n=parseInt(u.find("#h").value(),10);t.preventDefault(),function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[].slice.call(arguments,1);return function(){dt.blobToImageResult(a.blob).then(function(t){e.apply(this,[t].concat(r)).then(q).then(U)})}}(st.resize,e,n)(),z()}).on("show",B),s=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:G(st.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:G(st.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:G(st.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:G(st.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",B),p=Y(0,st.invert),I=Y(0,st.sharpen),T=Y(0,st.emboss),g=X(0,st.brightness,0,-1,1),m=X(0,st.hue,180,0,360),y=X(0,st.saturate,0,-1,1),v=X(0,st.contrast,0,-1,1),b=X(0,st.grayscale,0,0,1),w=X(0,st.sepia,0,0,1),x=function(t,o){function e(){var e,n,r;e=u.find("#r")[0].value(),n=u.find("#g")[0].value(),r=u.find("#b")[0].value(),dt.blobToImageResult(a.blob).then(function(t){return o(t,e,n,r)}).then(q).then(function(t){var e=Ft(t);H(e),Ct(c),c=e})}var n=i.rtl?2:0,r=i.rtl?0:2;return W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"slider",label:"G",name:"g",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"slider",label:"B",name:"b",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:L},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:V}])).hide().on("show",function(){u.find("#r,#g,#b").value(1),B()})}(0,st.colorize),R=X(0,st.gamma,0,-1,1),S=X(0,st.exposure,1,0,2),r=W(_([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:M(m)},{text:"saturate",icon:"saturate",onclick:M(y)},{text:"sepia",icon:"sepia",onclick:M(w)},{text:"emboss",icon:"emboss",onclick:M(T)},{text:"exposure",icon:"exposure",onclick:M(S)},{type:"spacer",flex:1}])).hide(),n=W(_([{tooltip:"Crop",icon:"crop",onclick:M(o)},{tooltip:"Resize",icon:"resize2",onclick:M(l)},{tooltip:"Orientation",icon:"orientation",onclick:M(s)},{tooltip:"Brightness",icon:"sun",onclick:M(g)},{tooltip:"Sharpen",icon:"sharpen",onclick:M(I)},{tooltip:"Contrast",icon:"contrast",onclick:M(v)},{tooltip:"Color levels",icon:"drop",onclick:M(x)},{tooltip:"Gamma",icon:"gamma",onclick:M(R)},{tooltip:"Invert",icon:"invert",onclick:M(p)}])),f=Ot.create({flex:1,imageSrc:a.url}),d=bt.create("Container",{layout:"flex",direction:"column",pack:"start",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:function(){H(a=A.undo()),P()}},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:function(){H(a=A.redo()),P()}},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:function(){var t=f.zoom();t<2&&(t+=.1),f.zoom(t)}},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:function(){var t=f.zoom();.1<t&&(t-=.1),f.zoom(t)}}]}),h=bt.create("Container",{type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:_([d,f])}),O=[n,o,l,s,r,p,g,m,y,v,b,w,x,I,T,R,S],(u=i.windowManager.open({layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(vt.DOM.getViewPort().w,800),minHeight:Math.min(vt.DOM.getViewPort().h,650),title:"Edit image",items:O.concat([h]),buttons:_([{text:"Save",name:"save",subtype:"primary",onclick:function(){t(a.blob),u.close()}},{text:"Cancel",onclick:"close"}])})).on("close",function(){e(),Et(A.data),c=A=null}),A.add(a),P(),f.on("load",function(){F=f.imageSize().w,C=f.imageSize().h,E=C/F,D=F/C,u.find("#w").value(F),u.find("#h").value(C)}),f.on("crop",j)}var At,_t={edit:function(r,t){return new mt(function(e,n){return t.toBlob().then(function(t){Dt(r,Ft(t),e,n)})})}},kt={getImageSize:function(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},setImageSize:function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function(t){return{w:t.naturalWidth,h:t.naturalHeight}}},Lt=(At="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===At}),Pt=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n,t))return I.some(o)}return I.none()};Array.prototype.slice;Lt(Array.from)&&Array.from;var Bt=function(t){return null!==t&&t!==undefined},Ht=function(t,e){var n;return n=e.reduce(function(t,e){return Bt(t)?t[e]:undefined},t),Bt(n)?n:null},Mt=function(e){return new mt(function(n){var t=O();t.onload=function(t){var e=t.target;n(e.result)},t.readAsText(e)})},Nt=function(e,r,o){return new mt(function(t){var n;(n=new(S.getOrDie("XMLHttpRequest"))).onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:this.response})},n.open("GET",e,!0),n.withCredentials=o,$.each(r,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},Ut=function(t){var e;try{e=JSON.parse(t)}catch(n){}return e},jt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],Gt=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],zt=function(e){return"ImageProxy HTTP error: "+Pt(jt,function(t){return e===t.code}).fold(a("Unknown ImageProxy error"),function(t){return t.message})},Vt=function(t){var e=zt(t);return mt.reject(e)},Wt=function(e){return Pt(Gt,function(t){return t.type===e}).fold(a("Unknown service error"),function(t){return t.message})},qt=function(t,e){return Mt(e).then(function(t){var e,n,r=(e=Ut(t),"ImageProxy Service error: "+((n=Ht(e,["error","type"]))?Wt(n):"Invalid JSON in service error message"));return mt.reject(r)})},Yt=function(t,e){return 400===(n=t)||403===n||500===n?qt(0,e):Vt(t);var n},Xt=Vt,$t=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return Nt((n=t,r=e,o=-1===n.indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)||!r?n:n+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(t){return t.status<200||300<=t.status?Yt(t.status,t.blob):mt.resolve(t.blob)})},Jt=function(t,e,n){return e?$t(t,e):Nt(t,{},n).then(function(t){return t.status<200||300<=t.status?Xt(t.status):mt.resolve(t.blob)})},Kt=0,Zt=function(t,e){t.notificationManager.open({text:e,type:"error"})},Qt=function(t){return t.selection.getNode()},te=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new yt(n).host===t.documentBaseURI.host},ee=function(t,e){return-1!==$.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new yt(e.src).host)},ne=function(t,e){var n,r,o,i,a=e.src;return ee(t,e)?Jt(e.src,null,(r=t,o=e,-1!==$.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new yt(o.src).host))):te(t,e)?P(e):(a=t.getParam("imagetools_proxy"),a+=(-1===a.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),n=(i=t).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),Jt(a,n,!1))},re=function(t){var e;return(e=t.editorUpload.blobCache.getByUri(Qt(t).src))?mt.resolve(e.blob()):ne(t,Qt(t))},oe=function(t){clearTimeout(t.get())},ie=function(c,l,s,f,d){return l.toBlob().then(function(t){var e,n,r,o,i,a,u;return r=c.editorUpload.blobCache,e=(i=Qt(c)).src,c.getParam("images_reuse_filename",!1,"boolean")&&((o=r.getByUri(e))?(e=o.uri(),n=o.name()):(a=c,n=(u=e.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?a.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+Kt++,blob:t,base64:l.toBase64(),uri:e,name:n}),r.add(o),c.undoManager.transact(function(){c.$(i).on("load",function t(){var e,n,r;c.$(i).off("load",t),c.nodeChanged(),s?c.editorUpload.uploadImagesAuto():(oe(f),e=c,n=f,r=gt.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),n.set(r))}),d&&c.$(i).attr({width:d.w,height:d.h}),c.$(i).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},ae=function(e,n,t,r){return function(){return e._scanForImages().then(u(re,e)).then(dt.blobToImageResult).then(t).then(function(t){return ie(e,t,!1,n,r)},function(t){Zt(e,t)})}},ue=function(n,r,o){return function(){var t=kt.getImageSize(Qt(n)),e=t?{w:t.h,h:t.w}:null;return ae(n,r,function(t){return st.rotate(t,o)},e)()}},ce=function(t,e,n){return function(){return ae(t,e,function(t){return st.flip(t,n)})()}},le=function(e,r){return function(){var o=Qt(e),i=kt.getNaturalImageSize(o),n=function(r){return new mt(function(n){L(r).then(function(t){var e=kt.getNaturalImageSize(t);i.w===e.w&&i.h===e.h||kt.getImageSize(o)&&kt.setImageSize(o,e),pt.revokeObjectURL(t.src),n(r)})})};re(e).then(dt.blobToImageResult).then(u(function(e,t){return _t.edit(e,t).then(n).then(dt.blobToImageResult).then(function(t){return ie(e,t,!0,r)},function(){})},e),function(t){Zt(e,t)})}},se=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")&&(te(t,e)||ee(t,e)||t.settings.imagetools_proxy)},fe=oe,de=function(n,t){$.each({mceImageRotateLeft:ue(n,t,-90),mceImageRotateRight:ue(n,t,90),mceImageFlipVertical:ce(n,t,"v"),mceImageFlipHorizontal:ce(n,t,"h"),mceEditImage:le(n,t)},function(t,e){n.addCommand(e,t)})},he=function(n,r,o){n.on("NodeChange",function(t){var e=o.get();e&&e.src!==t.element.src&&(fe(r),n.editorUpload.uploadImagesAuto(),o.set(null)),se(n,t.element)&&o.set(t.element)})},pe=function(t){t.addButton("rotateleft",{title:"Rotate counterclockwise",cmd:"mceImageRotateLeft"}),t.addButton("rotateright",{title:"Rotate clockwise",cmd:"mceImageRotateRight"}),t.addButton("flipv",{title:"Flip vertically",cmd:"mceImageFlipVertical"}),t.addButton("fliph",{title:"Flip horizontally",cmd:"mceImageFlipHorizontal"}),t.addButton("editimage",{title:"Edit image",cmd:"mceEditImage"}),t.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})},ge=function(t){t.addContextToolbar(u(se,t),t.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions"))};t.add("imagetools",function(t){var e=r(0),n=r(null);de(t,e),pe(t),ge(t),he(t,e,n)})}();
@@ -1,264 +1,264 @@
1
1
  (function () {
2
2
  var importcss = (function () {
3
- 'use strict';
3
+ 'use strict';
4
4
 
5
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
5
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
6
6
 
7
- var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
7
+ var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
8
8
 
9
- var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
9
+ var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
10
10
 
11
- var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
11
+ var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
12
12
 
13
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
13
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
14
14
 
15
- var shouldMergeClasses = function (editor) {
16
- return editor.getParam('importcss_merge_classes');
17
- };
18
- var shouldImportExclusive = function (editor) {
19
- return editor.getParam('importcss_exclusive');
20
- };
21
- var getSelectorConverter = function (editor) {
22
- return editor.getParam('importcss_selector_converter');
23
- };
24
- var getSelectorFilter = function (editor) {
25
- return editor.getParam('importcss_selector_filter');
26
- };
27
- var getCssGroups = function (editor) {
28
- return editor.getParam('importcss_groups');
29
- };
30
- var shouldAppend = function (editor) {
31
- return editor.getParam('importcss_append');
32
- };
33
- var getFileFilter = function (editor) {
34
- return editor.getParam('importcss_file_filter');
35
- };
36
- var $_84yzl0fbjm0ofzaj = {
37
- shouldMergeClasses: shouldMergeClasses,
38
- shouldImportExclusive: shouldImportExclusive,
39
- getSelectorConverter: getSelectorConverter,
40
- getSelectorFilter: getSelectorFilter,
41
- getCssGroups: getCssGroups,
42
- shouldAppend: shouldAppend,
43
- getFileFilter: getFileFilter
44
- };
15
+ var shouldMergeClasses = function (editor) {
16
+ return editor.getParam('importcss_merge_classes');
17
+ };
18
+ var shouldImportExclusive = function (editor) {
19
+ return editor.getParam('importcss_exclusive');
20
+ };
21
+ var getSelectorConverter = function (editor) {
22
+ return editor.getParam('importcss_selector_converter');
23
+ };
24
+ var getSelectorFilter = function (editor) {
25
+ return editor.getParam('importcss_selector_filter');
26
+ };
27
+ var getCssGroups = function (editor) {
28
+ return editor.getParam('importcss_groups');
29
+ };
30
+ var shouldAppend = function (editor) {
31
+ return editor.getParam('importcss_append');
32
+ };
33
+ var getFileFilter = function (editor) {
34
+ return editor.getParam('importcss_file_filter');
35
+ };
36
+ var Settings = {
37
+ shouldMergeClasses: shouldMergeClasses,
38
+ shouldImportExclusive: shouldImportExclusive,
39
+ getSelectorConverter: getSelectorConverter,
40
+ getSelectorFilter: getSelectorFilter,
41
+ getCssGroups: getCssGroups,
42
+ shouldAppend: shouldAppend,
43
+ getFileFilter: getFileFilter
44
+ };
45
45
 
46
- var removeCacheSuffix = function (url) {
47
- var cacheSuffix = global$3.cacheSuffix;
48
- if (typeof url === 'string') {
49
- url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
50
- }
51
- return url;
52
- };
53
- var isSkinContentCss = function (editor, href) {
54
- var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
55
- if (skin) {
56
- var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : global$2.baseURL + '/skins/' + skin;
57
- return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css';
58
- }
59
- return false;
60
- };
61
- var compileFilter = function (filter) {
62
- if (typeof filter === 'string') {
63
- return function (value) {
64
- return value.indexOf(filter) !== -1;
65
- };
66
- } else if (filter instanceof RegExp) {
67
- return function (value) {
68
- return filter.test(value);
69
- };
70
- }
71
- return filter;
72
- };
73
- var getSelectors = function (editor, doc, fileFilter) {
74
- var selectors = [], contentCSSUrls = {};
75
- function append(styleSheet, imported) {
76
- var href = styleSheet.href, rules;
77
- href = removeCacheSuffix(href);
78
- if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
79
- return;
46
+ var removeCacheSuffix = function (url) {
47
+ var cacheSuffix = global$3.cacheSuffix;
48
+ if (typeof url === 'string') {
49
+ url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
80
50
  }
81
- global$4.each(styleSheet.imports, function (styleSheet) {
82
- append(styleSheet, true);
51
+ return url;
52
+ };
53
+ var isSkinContentCss = function (editor, href) {
54
+ var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
55
+ if (skin) {
56
+ var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : global$2.baseURL + '/skins/' + skin;
57
+ return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css';
58
+ }
59
+ return false;
60
+ };
61
+ var compileFilter = function (filter) {
62
+ if (typeof filter === 'string') {
63
+ return function (value) {
64
+ return value.indexOf(filter) !== -1;
65
+ };
66
+ } else if (filter instanceof RegExp) {
67
+ return function (value) {
68
+ return filter.test(value);
69
+ };
70
+ }
71
+ return filter;
72
+ };
73
+ var getSelectors = function (editor, doc, fileFilter) {
74
+ var selectors = [], contentCSSUrls = {};
75
+ function append(styleSheet, imported) {
76
+ var href = styleSheet.href, rules;
77
+ href = removeCacheSuffix(href);
78
+ if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
79
+ return;
80
+ }
81
+ global$4.each(styleSheet.imports, function (styleSheet) {
82
+ append(styleSheet, true);
83
+ });
84
+ try {
85
+ rules = styleSheet.cssRules || styleSheet.rules;
86
+ } catch (e) {
87
+ }
88
+ global$4.each(rules, function (cssRule) {
89
+ if (cssRule.styleSheet) {
90
+ append(cssRule.styleSheet, true);
91
+ } else if (cssRule.selectorText) {
92
+ global$4.each(cssRule.selectorText.split(','), function (selector) {
93
+ selectors.push(global$4.trim(selector));
94
+ });
95
+ }
96
+ });
97
+ }
98
+ global$4.each(editor.contentCSS, function (url) {
99
+ contentCSSUrls[url] = true;
83
100
  });
101
+ if (!fileFilter) {
102
+ fileFilter = function (href, imported) {
103
+ return imported || contentCSSUrls[href];
104
+ };
105
+ }
84
106
  try {
85
- rules = styleSheet.cssRules || styleSheet.rules;
107
+ global$4.each(doc.styleSheets, function (styleSheet) {
108
+ append(styleSheet);
109
+ });
86
110
  } catch (e) {
87
111
  }
88
- global$4.each(rules, function (cssRule) {
89
- if (cssRule.styleSheet) {
90
- append(cssRule.styleSheet, true);
91
- } else if (cssRule.selectorText) {
92
- global$4.each(cssRule.selectorText.split(','), function (selector) {
93
- selectors.push(global$4.trim(selector));
94
- });
112
+ return selectors;
113
+ };
114
+ var defaultConvertSelectorToFormat = function (editor, selectorText) {
115
+ var format;
116
+ var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
117
+ if (!selector) {
118
+ return;
119
+ }
120
+ var elementName = selector[1];
121
+ var classes = selector[2].substr(1).split('.').join(' ');
122
+ var inlineSelectorElements = global$4.makeMap('a,img');
123
+ if (selector[1]) {
124
+ format = { title: selectorText };
125
+ if (editor.schema.getTextBlockElements()[elementName]) {
126
+ format.block = elementName;
127
+ } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
128
+ format.selector = elementName;
129
+ } else {
130
+ format.inline = elementName;
95
131
  }
132
+ } else if (selector[2]) {
133
+ format = {
134
+ inline: 'span',
135
+ title: selectorText.substr(1),
136
+ classes: classes
137
+ };
138
+ }
139
+ if (Settings.shouldMergeClasses(editor) !== false) {
140
+ format.classes = classes;
141
+ } else {
142
+ format.attributes = { class: classes };
143
+ }
144
+ return format;
145
+ };
146
+ var getGroupsBySelector = function (groups, selector) {
147
+ return global$4.grep(groups, function (group) {
148
+ return !group.filter || group.filter(selector);
96
149
  });
97
- }
98
- global$4.each(editor.contentCSS, function (url) {
99
- contentCSSUrls[url] = true;
100
- });
101
- if (!fileFilter) {
102
- fileFilter = function (href, imported) {
103
- return imported || contentCSSUrls[href];
104
- };
105
- }
106
- try {
107
- global$4.each(doc.styleSheets, function (styleSheet) {
108
- append(styleSheet);
150
+ };
151
+ var compileUserDefinedGroups = function (groups) {
152
+ return global$4.map(groups, function (group) {
153
+ return global$4.extend({}, group, {
154
+ original: group,
155
+ selectors: {},
156
+ filter: compileFilter(group.filter),
157
+ item: {
158
+ text: group.title,
159
+ menu: []
160
+ }
161
+ });
109
162
  });
110
- } catch (e) {
111
- }
112
- return selectors;
113
- };
114
- var defaultConvertSelectorToFormat = function (editor, selectorText) {
115
- var format;
116
- var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
117
- if (!selector) {
118
- return;
119
- }
120
- var elementName = selector[1];
121
- var classes = selector[2].substr(1).split('.').join(' ');
122
- var inlineSelectorElements = global$4.makeMap('a,img');
123
- if (selector[1]) {
124
- format = { title: selectorText };
125
- if (editor.schema.getTextBlockElements()[elementName]) {
126
- format.block = elementName;
127
- } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
128
- format.selector = elementName;
163
+ };
164
+ var isExclusiveMode = function (editor, group) {
165
+ return group === null || Settings.shouldImportExclusive(editor) !== false;
166
+ };
167
+ var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
168
+ return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
169
+ };
170
+ var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
171
+ if (isExclusiveMode(editor, group)) {
172
+ globallyUniqueSelectors[selector] = true;
129
173
  } else {
130
- format.inline = elementName;
174
+ group.selectors[selector] = true;
131
175
  }
132
- } else if (selector[2]) {
133
- format = {
134
- inline: 'span',
135
- title: selectorText.substr(1),
136
- classes: classes
137
- };
138
- }
139
- if ($_84yzl0fbjm0ofzaj.shouldMergeClasses(editor) !== false) {
140
- format.classes = classes;
141
- } else {
142
- format.attributes = { class: classes };
143
- }
144
- return format;
145
- };
146
- var getGroupsBySelector = function (groups, selector) {
147
- return global$4.grep(groups, function (group) {
148
- return !group.filter || group.filter(selector);
149
- });
150
- };
151
- var compileUserDefinedGroups = function (groups) {
152
- return global$4.map(groups, function (group) {
153
- return global$4.extend({}, group, {
154
- original: group,
155
- selectors: {},
156
- filter: compileFilter(group.filter),
157
- item: {
158
- text: group.title,
159
- menu: []
160
- }
161
- });
162
- });
163
- };
164
- var isExclusiveMode = function (editor, group) {
165
- return group === null || $_84yzl0fbjm0ofzaj.shouldImportExclusive(editor) !== false;
166
- };
167
- var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
168
- return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
169
- };
170
- var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
171
- if (isExclusiveMode(editor, group)) {
172
- globallyUniqueSelectors[selector] = true;
173
- } else {
174
- group.selectors[selector] = true;
175
- }
176
- };
177
- var convertSelectorToFormat = function (editor, plugin, selector, group) {
178
- var selectorConverter;
179
- if (group && group.selector_converter) {
180
- selectorConverter = group.selector_converter;
181
- } else if ($_84yzl0fbjm0ofzaj.getSelectorConverter(editor)) {
182
- selectorConverter = $_84yzl0fbjm0ofzaj.getSelectorConverter(editor);
183
- } else {
184
- selectorConverter = function () {
185
- return defaultConvertSelectorToFormat(editor, selector);
186
- };
187
- }
188
- return selectorConverter.call(plugin, selector, group);
189
- };
190
- var setup = function (editor) {
191
- editor.on('renderFormatsMenu', function (e) {
192
- var globallyUniqueSelectors = {};
193
- var selectorFilter = compileFilter($_84yzl0fbjm0ofzaj.getSelectorFilter(editor)), ctrl = e.control;
194
- var groups = compileUserDefinedGroups($_84yzl0fbjm0ofzaj.getCssGroups(editor));
195
- var processSelector = function (selector, group) {
196
- if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
197
- markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
198
- var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
199
- if (format) {
200
- var formatName = format.name || global$1.DOM.uniqueId();
201
- editor.formatter.register(formatName, format);
202
- return global$4.extend({}, ctrl.settings.itemDefaults, {
203
- text: format.title,
204
- format: formatName
205
- });
176
+ };
177
+ var convertSelectorToFormat = function (editor, plugin, selector, group) {
178
+ var selectorConverter;
179
+ if (group && group.selector_converter) {
180
+ selectorConverter = group.selector_converter;
181
+ } else if (Settings.getSelectorConverter(editor)) {
182
+ selectorConverter = Settings.getSelectorConverter(editor);
183
+ } else {
184
+ selectorConverter = function () {
185
+ return defaultConvertSelectorToFormat(editor, selector);
186
+ };
187
+ }
188
+ return selectorConverter.call(plugin, selector, group);
189
+ };
190
+ var setup = function (editor) {
191
+ editor.on('renderFormatsMenu', function (e) {
192
+ var globallyUniqueSelectors = {};
193
+ var selectorFilter = compileFilter(Settings.getSelectorFilter(editor)), ctrl = e.control;
194
+ var groups = compileUserDefinedGroups(Settings.getCssGroups(editor));
195
+ var processSelector = function (selector, group) {
196
+ if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
197
+ markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
198
+ var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
199
+ if (format) {
200
+ var formatName = format.name || global$1.DOM.uniqueId();
201
+ editor.formatter.register(formatName, format);
202
+ return global$4.extend({}, ctrl.settings.itemDefaults, {
203
+ text: format.title,
204
+ format: formatName
205
+ });
206
+ }
206
207
  }
208
+ return null;
209
+ };
210
+ if (!Settings.shouldAppend(editor)) {
211
+ ctrl.items().remove();
207
212
  }
208
- return null;
209
- };
210
- if (!$_84yzl0fbjm0ofzaj.shouldAppend(editor)) {
211
- ctrl.items().remove();
212
- }
213
- global$4.each(getSelectors(editor, e.doc || editor.getDoc(), compileFilter($_84yzl0fbjm0ofzaj.getFileFilter(editor))), function (selector) {
214
- if (selector.indexOf('.mce-') === -1) {
215
- if (!selectorFilter || selectorFilter(selector)) {
216
- var selectorGroups = getGroupsBySelector(groups, selector);
217
- if (selectorGroups.length > 0) {
218
- global$4.each(selectorGroups, function (group) {
219
- var menuItem = processSelector(selector, group);
213
+ global$4.each(getSelectors(editor, e.doc || editor.getDoc(), compileFilter(Settings.getFileFilter(editor))), function (selector) {
214
+ if (selector.indexOf('.mce-') === -1) {
215
+ if (!selectorFilter || selectorFilter(selector)) {
216
+ var selectorGroups = getGroupsBySelector(groups, selector);
217
+ if (selectorGroups.length > 0) {
218
+ global$4.each(selectorGroups, function (group) {
219
+ var menuItem = processSelector(selector, group);
220
+ if (menuItem) {
221
+ group.item.menu.push(menuItem);
222
+ }
223
+ });
224
+ } else {
225
+ var menuItem = processSelector(selector, null);
220
226
  if (menuItem) {
221
- group.item.menu.push(menuItem);
227
+ ctrl.add(menuItem);
222
228
  }
223
- });
224
- } else {
225
- var menuItem = processSelector(selector, null);
226
- if (menuItem) {
227
- ctrl.add(menuItem);
228
229
  }
229
230
  }
230
231
  }
231
- }
232
- });
233
- global$4.each(groups, function (group) {
234
- if (group.item.menu.length > 0) {
235
- ctrl.add(group.item);
236
- }
232
+ });
233
+ global$4.each(groups, function (group) {
234
+ if (group.item.menu.length > 0) {
235
+ ctrl.add(group.item);
236
+ }
237
+ });
238
+ e.control.renderNew();
237
239
  });
238
- e.control.renderNew();
239
- });
240
- };
241
- var $_ebayx4f6jm0ofzac = {
242
- defaultConvertSelectorToFormat: defaultConvertSelectorToFormat,
243
- setup: setup
244
- };
240
+ };
241
+ var ImportCss = {
242
+ defaultConvertSelectorToFormat: defaultConvertSelectorToFormat,
243
+ setup: setup
244
+ };
245
245
 
246
- var get = function (editor) {
247
- var convertSelectorToFormat = function (selectorText) {
248
- return $_ebayx4f6jm0ofzac.defaultConvertSelectorToFormat(editor, selectorText);
246
+ var get = function (editor) {
247
+ var convertSelectorToFormat = function (selectorText) {
248
+ return ImportCss.defaultConvertSelectorToFormat(editor, selectorText);
249
+ };
250
+ return { convertSelectorToFormat: convertSelectorToFormat };
249
251
  };
250
- return { convertSelectorToFormat: convertSelectorToFormat };
251
- };
252
- var $_7rogatf5jm0ofza9 = { get: get };
252
+ var Api = { get: get };
253
253
 
254
- global.add('importcss', function (editor) {
255
- $_ebayx4f6jm0ofzac.setup(editor);
256
- return $_7rogatf5jm0ofza9.get(editor);
257
- });
258
- function Plugin () {
259
- }
254
+ global.add('importcss', function (editor) {
255
+ ImportCss.setup(editor);
256
+ return Api.get(editor);
257
+ });
258
+ function Plugin () {
259
+ }
260
260
 
261
- return Plugin;
261
+ return Plugin;
262
262
 
263
263
  }());
264
264
  })();