@@ -0,0 +1,545 @@
1+var ElmCode = ElmCode || {};
2+ElmCode.Graphics = ElmCode.Graphics || {};
3+ElmCode.Graphics.Element = function() {
4+ var DLeft_0 = ["DLeft"];
5+ var DRight_1 = ["DRight"];
6+ var DUp_2 = ["DUp"];
7+ var DDown_3 = ["DDown"];
8+ var DIn_4 = ["DIn"];
9+ var DOut_5 = ["DOut"];
10+ function Absolute_12(a1) {
11+ return["Absolute", a1]
12+ }
13+ function Relative_13(a1) {
14+ return["Relative", a1]
15+ }
16+ var Near_14 = ["Near"];
17+ var Mid_15 = ["Mid"];
18+ var Far_16 = ["Far"];
19+ function Position_17(a1) {
20+ return function(a2) {
21+ return["Position", a1, a2]
22+ }
23+ }
24+ function PositionTL_18(a1) {
25+ return function(a2) {
26+ return["PositionTL", a1, a2]
27+ }
28+ }
29+ function PositionTR_19(a1) {
30+ return function(a2) {
31+ return["PositionTR", a1, a2]
32+ }
33+ }
34+ function PositionBL_20(a1) {
35+ return function(a2) {
36+ return["PositionBL", a1, a2]
37+ }
38+ }
39+ function PositionBR_21(a1) {
40+ return function(a2) {
41+ return["PositionBR", a1, a2]
42+ }
43+ }
44+ function Element_37(a1) {
45+ return function(a2) {
46+ return function(a3) {
47+ return function(a4) {
48+ return function(a5) {
49+ return function(a6) {
50+ return["Element", a1, a2, a3, a4, a5, a6]
51+ }
52+ }
53+ }
54+ }
55+ }
56+ }
57+ function EText_39(a1) {
58+ return function(a2) {
59+ return["EText", a1, a2]
60+ }
61+ }
62+ function EImage_40(a1) {
63+ return["EImage", a1]
64+ }
65+ function EVideo_41(a1) {
66+ return["EVideo", a1]
67+ }
68+ function EFittedImage_42(a1) {
69+ return["EFittedImage", a1]
70+ }
71+ function EFlow_43(a1) {
72+ return function(a2) {
73+ return["EFlow", a1, Foreign.JavaScript.castListToJSArray(a2)]
74+ }
75+ }
76+ function ECollage_44(a1) {
77+ return function(a2) {
78+ return function(a3) {
79+ return["ECollage", a1, a2, Value.groupForms(a3)]
80+ }
81+ }
82+ }
83+ var EEmpty_45 = ["EEmpty"];
84+ function EContainer_46(a1) {
85+ return function(a2) {
86+ return["EContainer", a1, a2]
87+ }
88+ }
89+ var Solid_68 = ["Solid"];
90+ var Dotted_69 = ["Dotted"];
91+ var Dashed_70 = ["Dashed"];
92+ function Custom_71(a1) {
93+ return["Custom", a1]
94+ }
95+ var Filled_72 = ["Filled"];
96+ var Outlined_73 = ["Outlined"];
97+ function CustomOutline_74(a1) {
98+ return["CustomOutline", a1]
99+ }
100+ function Line_75(a1) {
101+ return["Line", a1]
102+ }
103+ function Shape_78(a1) {
104+ return function(a2) {
105+ return["Shape", a1, a2]
106+ }
107+ }
108+ function Form_84(a1) {
109+ return function(a2) {
110+ return function(a3) {
111+ return function(a4) {
112+ return["Form", a1, a2, a3, a4]
113+ }
114+ }
115+ }
116+ }
117+ function FLine_85(a1) {
118+ return function(a2) {
119+ return function(a3) {
120+ return["FLine", a1, a2, a3]
121+ }
122+ }
123+ }
124+ function FShape_86(a1) {
125+ return function(a2) {
126+ return function(a3) {
127+ return["FShape", a1, a2, a3]
128+ }
129+ }
130+ }
131+ function FImage_87(a1) {
132+ return function(a2) {
133+ return function(a3) {
134+ return["FImage", a1, a2, a3]
135+ }
136+ }
137+ }
138+ function FElement_88(a1) {
139+ return["FElement", a1]
140+ }
141+ var left_6 = DLeft_0;
142+ var right_7 = DRight_1;
143+ var down_8 = DDown_3;
144+ var up_9 = DUp_2;
145+ var inward_10 = DIn_4;
146+ var outward_11 = DOut_5;
147+ var topLeft_22 = Position_17(Near_14)(Near_14);
148+ var topRight_23 = Position_17(Far_16)(Near_14);
149+ var bottomLeft_24 = Position_17(Near_14)(Far_16);
150+ var bottomRight_25 = Position_17(Far_16)(Far_16);
151+ var midLeft_26 = Position_17(Mid_15)(Near_14);
152+ var midRight_27 = Position_17(Mid_15)(Far_16);
153+ var midTop_28 = Position_17(Near_14)(Mid_15);
154+ var midBottom_29 = Position_17(Far_16)(Mid_15);
155+ var middle_30 = Position_17(Mid_15)(Mid_15);
156+ var topLeftAt_31 = PositionTL_18;
157+ var topRightAt_32 = PositionTR_19;
158+ var bottomLeftAt_33 = PositionBL_20;
159+ var bottomRightAt_34 = PositionBR_21;
160+ var absolute_35 = Absolute_12;
161+ var relative_36 = Relative_13;
162+ function newElement_38(a) { return Element_37(Guid.guid())(a); }
163+ var line_76 = Line_75;
164+ var polygon_79 = Shape_78;
165+ function sprite_96(src) {
166+ return function(w) {
167+ return function(h) {
168+ return function(pos) {
169+ return Form_84(0)(1)(pos)(FImage_87(w)(h)(src))
170+ }
171+ }
172+ }
173+ }
174+ function toForm_97(pos) {
175+ return function(e) {
176+ return Form_84(0)(1)(pos)(FElement_88(e))
177+ }
178+ }
179+ function width_47(w__101) {
180+ return function(Element$_ewhoc_102) {
181+ return function(case7) {
182+ var case0 = case7;
183+ switch(case0[0]) {
184+ case "Element":
185+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
186+ return function(case12) {
187+ var case8 = case12;
188+ switch(case8[0]) {
189+ case "EImage":
190+ case "EVideo":
191+ return newElement_38(case2)(w__101)(case4 * w__101 / case3)(case5)(case6);
192+ case "EText":
193+ var p = Value.getTextSize(w__101,case4,case8[2]);
194+ return newElement_38(case2)(w__101)(p[1])(case5)(case6);
195+ }
196+ return newElement_38(case2)(w__101)(case4)(case5)(case6)
197+ }(case2)
198+ }
199+ throw"Non-exhaustive pattern match in case";
200+ }(Element$_ewhoc_102)
201+ }
202+ }
203+ function height_48(h__108) {
204+ return function(Element$_ewhoc_109) {
205+ return function(case7) {
206+ var case0 = case7;
207+ switch(case0[0]) {
208+ case "Element":
209+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
210+ return function(case12) {
211+ var case8 = case12;
212+ switch(case8[0]) {
213+ case "EImage":
214+ case "EVideo":
215+ return newElement_38(case2)(case3 * h__108 / case4)(h__108)(case5)(case6);
216+ }
217+ return newElement_38(case2)(case3)(h__108)(case5)(case6)
218+ }(case2)
219+ }
220+ throw"Non-exhaustive pattern match in case";
221+ }(Element$_ewhoc_109)
222+ }
223+ }
224+ function size_49(w__115) {
225+ return function(h__116) {
226+ return function(Element$_ewhoc_117) {
227+ return function(case7) {
228+ var case0 = case7;
229+ switch(case0[0]) {
230+ case "Element":
231+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
232+ return newElement_38(case2)(w__115)(h__116)(case5)(case6)
233+ }
234+ throw"Non-exhaustive pattern match in case";
235+ }(Element$_ewhoc_117)
236+ }
237+ }
238+ }
239+ function opacity_50(o__123) {
240+ return function(Element$_ewhoc_124) {
241+ return function(case7) {
242+ var case0 = case7;
243+ switch(case0[0]) {
244+ case "Element":
245+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
246+ return newElement_38(case2)(case3)(case4)(o__123)(case6)
247+ }
248+ throw"Non-exhaustive pattern match in case";
249+ }(Element$_ewhoc_124)
250+ }
251+ }
252+ function color_51(c__130) {
253+ return function(Element$_ewhoc_131) {
254+ return function(case7) {
255+ var case0 = case7;
256+ switch(case0[0]) {
257+ case "Element":
258+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
259+ return newElement_38(case2)(case3)(case4)(case5)(Just(c__130))
260+ }
261+ throw"Non-exhaustive pattern match in case";
262+ }(Element$_ewhoc_131)
263+ }
264+ }
265+ function widthOf_52(e) { return ~~e[3]; }
266+ function heightOf_53(e) { return ~~e[4]; }
267+ function sizeOf_54(e) { return["Tuple2", ~~e[3], ~~e[4]] }
268+ function text_56(txt) {
269+ var p = Value.getTextSize(-1,-1,txt);
270+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
271+ }
272+ function plainText(str) {
273+ var txt = Value.toText(str);
274+ var p = Value.getTextSize(-1,-1,txt);
275+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
276+ }
277+ function asText(v) {
278+ var txt = Value.show(v);
279+ var p = Value.getTextSize(-1,-1,txt);
280+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
281+ }
282+ function centeredText(txt) {
283+ var p = Value.getTextSize(-1,-1,txt);
284+ return newElement_38(EText_39("center")(txt))(p[0])(p[1])(1)(Nothing)
285+ }
286+ function justifiedText(txt) {
287+ var p = Value.getTextSize(-1,-1,txt);
288+ return newElement_38(EText_39("justify")(txt))(p[0])(p[1])(1)(Nothing)
289+ }
290+ function rightedText(txt) {
291+ var p = Value.getTextSize(-1,-1,txt);
292+ return newElement_38(EText_39("right")(txt))(p[0])(p[1])(1)(Nothing)
293+ }
294+ function image_57(w) {
295+ return function(h) {
296+ return function(src) {
297+ return newElement_38(EImage_40(src))(w)(h)(1)(Nothing)
298+ }
299+ }
300+ }
301+ function video_58(w) {
302+ return function(h) {
303+ return function(src) {
304+ return newElement_38(EVideo_41(src))(w)(h)(1)(Nothing)
305+ }
306+ }
307+ }
308+ function fittedImage_59(w_147) {
309+ return function(h_148) {
310+ return function(s_149) {
311+ return newElement_38(EFittedImage_42(s_149))(w_147)(h_148)(1)(Nothing)
312+ }
313+ }
314+ }
315+ function flow_60(dir_150) {
316+ return function(es_151) {
317+ return function() {
318+ var w_152 = function() {
319+ var ws_154 = map(widthOf_52)(es_151);
320+ return function(case1) {
321+ var case0 = case1;
322+ switch(case0[0]) {
323+ case "DLeft":
324+ return sum(ws_154);
325+ case "DRight":
326+ return sum(ws_154)
327+ }
328+ return maximum(ws_154)
329+ }(dir_150)
330+ }();
331+ var h_153 = function() {
332+ var hs_155 = map(heightOf_53)(es_151);
333+ return function(case3) {
334+ var case2 = case3;
335+ switch(case2[0]) {
336+ case "DDown":
337+ return sum(hs_155);
338+ case "DUp":
339+ return sum(hs_155)
340+ }
341+ return maximum(hs_155)
342+ }(dir_150)
343+ }();
344+ return newElement_38(EFlow_43(dir_150)(es_151))(w_152)(h_153)(1)(Nothing)
345+ }()
346+ }
347+ }
348+ function above_61(e1_156) {
349+ return function(e2_157) {
350+ return newElement_38(EFlow_43(DDown_3)(["Cons", e1_156, ["Cons", e2_157, ["Nil"]]]))(max(widthOf_52(e1_156))(widthOf_52(e2_157)))(heightOf_53(e1_156) + heightOf_53(e2_157))(1)(Nothing)
351+ }
352+ }
353+ function below_62(e1_158) {
354+ return function(e2_159) {
355+ return newElement_38(EFlow_43(DDown_3)(["Cons", e2_159, ["Cons", e1_158, ["Nil"]]]))(max(widthOf_52(e1_158))(widthOf_52(e2_159)))(heightOf_53(e1_158) + heightOf_53(e2_159))(1)(Nothing)
356+ }
357+ }
358+ function beside_63(e1_160) {
359+ return function(e2_161) {
360+ return newElement_38(EFlow_43(DRight_1)(["Cons", e1_160, ["Cons", e2_161, ["Nil"]]]))(widthOf_52(e1_160) + widthOf_52(e2_161))(max(heightOf_53(e1_160))(heightOf_53(e2_161)))(1)(Nothing)
361+ }
362+ }
363+ function layers_64(es_162) {
364+ return newElement_38(EFlow_43(DOut_5)(es_162))(maximum(map(widthOf_52)(es_162)))(maximum(map(heightOf_53)(es_162)))(1)(Nothing)
365+ }
366+ function collage_65(w_163) {
367+ return function(h_164) {
368+ return function(forms_165) {
369+ return newElement_38(ECollage_44(w_163)(h_164)(forms_165))(w_163)(h_164)(1)(Nothing)
370+ }
371+ }
372+ }
373+ function spacer_66(w_166) {
374+ return function(h_167) {
375+ return newElement_38(EEmpty_45)(w_166)(h_167)(1)(Nothing)
376+ }
377+ }
378+ function container_67(pos_168) {
379+ return function(w_169) {
380+ return function(h_170) {
381+ return function(e_171) {
382+ return newElement_38(EContainer_46(pos_168)(e_171))(w_169)(h_170)(1)(Nothing)
383+ }
384+ }
385+ }
386+ }
387+ function segment_77(p1_172) {
388+ return function(p2_173) {
389+ return Line_75(["Cons", p1_172, ["Cons", p2_173, ["Nil"]]])
390+ }
391+ }
392+ function rect_80(w_174) {
393+ return function(h_175) {
394+ return function(pos_176) {
395+ return Shape_78(["Cons", ["Tuple2", 0 - w_174 / 2, 0 - h_175 / 2], ["Cons", ["Tuple2", 0 - w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, 0 - h_175 / 2], ["Nil"]]]]])(pos_176)
396+ }
397+ }
398+ }
399+ function oval_81(w_177) {
400+ return function(h_178) {
401+ return function(pos_179) {
402+ return function() {
403+ var n_180 = 50;
404+ return function() {
405+ function f_181(i_182) {
406+ return["Tuple2", w_177 / 2 * cos(2 * (pi / n_180) * i_182), h_178 / 2 * sin(2 * (pi / n_180) * i_182)]
407+ }
408+ return Shape_78(map(f_181)(function() {
409+ var lo = 0;
410+ var hi = n_180 - 1;
411+ var lst = ["Nil"];
412+ if(lo <= hi) {
413+ do {
414+ var lst = ["Cons", hi, lst]
415+ }while(hi-- > lo)
416+ }
417+ return lst
418+ }()))(pos_179)
419+ }()
420+ }()
421+ }
422+ }
423+ }
424+ function circle_82(r_183) {
425+ return oval_81(2 * r_183)(2 * r_183)
426+ }
427+ function ngon_83(n_184) {
428+ return function(r_185) {
429+ return function(pos_186) {
430+ return function() {
431+ var m_187 = toFloat(n_184);
432+ return function() {
433+ function f_188(i_189) {
434+ return["Tuple2", r_185 * cos(2 * (pi / m_187) * i_189), r_185 * sin(2 * (pi / m_187) * i_189)]
435+ }
436+ return Shape_78(map(f_188)(function() {
437+ var lo = 0;
438+ var hi = n_184 - 1;
439+ var lst = ["Nil"];
440+ if(lo <= hi) {
441+ do {
442+ var lst = ["Cons", hi, lst]
443+ }while(hi-- > lo)
444+ }
445+ return lst
446+ }()))(pos_186)
447+ }()
448+ }()
449+ }
450+ }
451+ }
452+ function solid_89(clr_190) {
453+ return function(ln_191) {
454+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Solid_68)(clr_190)(ln_191))
455+ }
456+ }
457+ function dotted_90(clr_192) {
458+ return function(ln_193) {
459+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dotted_69)(clr_192)(ln_193))
460+ }
461+ }
462+ function dashed_91(clr_194) {
463+ return function(ln_195) {
464+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dashed_70)(clr_194)(ln_195))
465+ }
466+ }
467+ function customLine_92(pattern_196) {
468+ return function(clr_197) {
469+ return function(ln_198) {
470+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Custom_71(pattern_196))(clr_197)(ln_198))
471+ }
472+ }
473+ }
474+ function filled_93(clr) {
475+ return function(shape) {
476+ return Form_84(0)(1)(shape[2])(FShape_86(Filled_72)(clr)(shape));
477+ }
478+ }
479+ function outlined_94(clr) {
480+ return function(shape) {
481+ return Form_84(0)(1)(shape[2])(FShape_86(Outlined_73)(clr)(shape));
482+ }
483+ }
484+ function customOutline_95(pattern) {
485+ return function(clr) {
486+ return function(shape) {
487+ return Form_84(0)(1)(shape[2])(FShape_86(["CustomOutline",pattern])(clr)(shape));
488+ }
489+ }
490+ }
491+ function textured(src) {
492+ return function(shape) {
493+ return Form_84(0)(1)(shape[2])(FShape_86(["Textured",src])(null)(shape));
494+ }
495+ }
496+ function rotate_98(t_212) {
497+ return function(Form$thetascaleposform_213) {
498+ return function(case5) {
499+ var case0 = case5;
500+ switch(case0[0]) {
501+ case "Form":
502+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
503+ return Form_84(t_212 + case1)(case2)(case3)(case4)
504+ }
505+ throw"Non-exhaustive pattern match in case";
506+ }(Form$thetascaleposform_213)
507+ }
508+ }
509+ function scale_99(s_218) {
510+ return function(Form$thetascaleposform_219) {
511+ return function(case5) {
512+ var case0 = case5;
513+ switch(case0[0]) {
514+ case "Form":
515+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
516+ return Form_84(case1)(s_218 * case2)(case3)(case4)
517+ }
518+ throw"Non-exhaustive pattern match in case";
519+ }(Form$thetascaleposform_219)
520+ }
521+ }
522+ function move_100(x_224) {
523+ return function(y_225) {
524+ return function(Form$thetascaleTuple2$pxpyform_226) {
525+ return function(case7) {
526+ var case0 = case7;
527+ switch(case0[0]) {
528+ case "Form":
529+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
530+ switch(case3[0]) {
531+ case "Tuple2":
532+ var case5 = case3[1], case6 = case3[2];
533+ return Form_84(case1)(case2)(["Tuple2", x_224 + case5, y_225 + case6])(case4)
534+ }
535+ break
536+ }
537+ throw"Non-exhaustive pattern match in case";
538+ }(Form$thetascaleTuple2$pxpyform_226)
539+ }
540+ }
541+ }
542+ return{left:left_6, right:right_7, down:down_8, up:up_9, inward:inward_10, outward:outward_11, topLeft:topLeft_22, topRight:topRight_23, bottomLeft:bottomLeft_24, bottomRight:bottomRight_25, midLeft:midLeft_26, midRight:midRight_27, midTop:midTop_28, midBottom:midBottom_29, middle:middle_30, topLeftAt:topLeftAt_31, topRightAt:topRightAt_32, bottomLeftAt:bottomLeftAt_33, bottomRightAt:bottomRightAt_34, absolute:absolute_35, relative:relative_36, width:width_47, height:height_48, size:size_49, opacity:opacity_50,
543+ color:color_51, widthOf:widthOf_52, heightOf:heightOf_53, sizeOf:sizeOf_54, text:text_56, plainText:plainText, centeredText:centeredText, justifiedText:justifiedText, rightedText:rightedText, image:image_57, video:video_58, fittedImage:fittedImage_59, flow:flow_60, above:above_61, below:below_62, beside:beside_63, layers:layers_64, collage:collage_65, spacer:spacer_66, container:container_67, line:line_76, segment:segment_77, polygon:polygon_79, rect:rect_80, oval:oval_81, circle:circle_82, ngon:ngon_83, solid:solid_89, dotted:dotted_90, dashed:dashed_91, customLine:customLine_92, filled:filled_93,
544+ outlined:outlined_94, customOutline:customOutline_95, textured:textured, sprite:sprite_96, toForm:toForm_97, rotate:rotate_98, scale:scale_99, move:move_100}
545+}();