Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Initial code snapshot from the examples/ directory of the clay framework
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:1912f091d48e77130b85cbad5c65d47ca1b2f647e30733aa64f2c88a9dfc1bd2
User & Date: plaidhatter 2018-11-15 12:26:19
Context
2018-11-15
13:25
Adding a license.terms file check-in: 7420891e98 user: plaidhatter tags: trunk
12:26
Initial code snapshot from the examples/ directory of the clay framework check-in: 1912f091d4 user: plaidhatter tags: trunk
12:21
initial empty check-in check-in: 7312ee1095 user: plaidhatter tags: trunk
Changes

Added claykit.ini.











































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
###
# This script implements a basic TclTkit with statically linked
# Tk, sqlite, threads, udp, and mmtk (which includes canvas3d and tkhtml)
###
set name [my define get name]
if {$name eq {}} {
  set name [file rootname [file tail [info script]]]
  my define set name $name
}
my define set vfs $name.vfs
my define set SHARED_BUILD 0
my define set version 0.1
my define set localpath $name
my define set profile devel
my define set prefix /tcl
my define set tk 0
my define set static_tk 0
my define set installdir [file join $::CWD PKGROOT]
my define set USEMSVC    [info exists env(VisualStudioVersion)]
my define set prefix_broken_destdir [file join $::SANDBOX tmp]
if {[my define get debug 0]} {
  my define set tclkit_bare [file join $::CWD ${name}_debug[my define get EXEEXT]]
  my define set exe         [file join $::CWD ${name}[my define get EXEEXT]]

} else {
  my define set tclkit_bare [file join $::CWD ${name}_bare[my define get EXEEXT]]
  my define set exe         [file join $::CWD ${name}[my define get EXEEXT]]
}
my define set output_c ${name}.c
my define set libs   	 {}
my define set cleanup [list $name.c $name.h $name.vfs kitcrypt.c [my define get tclkit_bare]]

my add_project tcl {
  class subproject.core
  name tcl
  tag release
  static 1
  fossil_url http://fossil.etoyoc.com/fossil/tcl
}

my add_project tcllib {
  profile {
    release: e954c041404d45d93d7c8cb58a29192d43873ac9
    devel: trunk
  }
  class subproject.sak
  install vfs
  fossil_url http://fossil.etoyoc.com/fossil/tcllib
  module_list {
cmdline csv cron coroutine
dns fileutil
nettool ncgi
practcl sha1 uri
virtchannel_base virtchannel_core
}
}

my add_project thread {
  profile {
    release: 2a36d0a6c31569bfb3562e3d58e9e8204f447a7e
    devel:   practcl
  }
  class subproject.binary
  install static
  pkg_name Thread
  initfunc Thread_Init
  fossil_url http://fossil.etoyoc.com/fossil/thread
}

my add_project clay {
  profile {
    devel:    trunk
  }
  fossil_url http://fossil.etoyoc.com/fossil/clay
  class subproject.practcl
  install vfs
  module_list all
}

my add_project sqlite {
  profile {
    release: 40ffdfb26af3e7443b2912e1039c06bf9ed75846
    devel:   practcl
  }
  class subproject.binary
  pkg_name sqlite3
  install static-autoload
  initfunc Sqlite3_Init
  fossil_url http://fossil.etoyoc.com/fossil/sqlite
}

my add_project udp {
  profile {
    release: 7c396e1a767db57b07b48daa8e0cfc0ea622bbe9
    devel:   practcl
  }
  class subproject.binary
  install static
  initfunc Udp_Init
  pkg_name udp
  fossil_url http://fossil.etoyoc.com/fossil/tcludp
}

my add_project tdom {
  tag trunk
  class subproject.binary
  install static
  initfunc Tdom_Init
  pkg_name tdom
  fossil_url http://core.tcl.tk/tdom
}

my add_project rl_json {
  class subproject.binary
  git_url https://github.com/RubyLane/rl_json
  tag master
  install static
}

###
# Add a local Zlib implementation
###
set TCLSRCDIR [my project tcl define get srcdir]

my define set tclsrcdir [my project tcl define get builddir]

# Handle cases where we haven't downloaded our dependencies yet
if {[my define get TEACUP_OS] eq "windows"} {
  set PLATFORM_SRC_DIR win
  my define set kit_resource_file [file join [my define get builddir] tclkit.rc]
  my define add resource_include [file join [my define get srcdir] win rc]
  my define set teapot c:/Tcl/lib/teapot/package/win32-ix86/lib

  my add filename [file join $TCLSRCDIR win tclWinReg.c] \
    class csource \
    pkg_name registry  pkg_vers 1.3.2 \
    initfunc Registry_Init autoload 1
  # Have DDE on hand, but don't autoload
  my add filename [file join $TCLSRCDIR win tclWinDde.c] \
    class csource \
    pkg_name dde  pkg_vers 1.4.0 \
    initfunc Dde_Init autoload 0

} else {
  set PLATFORM_SRC_DIR unix
}

my add [file join $::SRCDIR cmodules kitcrypt.tcl]

Added htdocs/favicon.ico.

cannot compute difference between binary files

Added htdocs/images/Faenza-weather-showers-scattered-symbolic.svg.









































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="16"
   height="16"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.48.3.1 r9886"
   version="1.0"
   sodipodi:docname="weather-showers-scattered-symbolic.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <defs
     id="defs4">
    <linearGradient
       id="linearGradient3171"
       inkscape:collect="always">
      <stop
         id="stop3173"
         offset="0"
         style="stop-color:#000000;stop-opacity:1;" />
      <stop
         id="stop3175"
         offset="1"
         style="stop-color:#000000;stop-opacity:0;" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3171"
       id="linearGradient3342"
       gradientUnits="userSpaceOnUse"
       x1="4.9375"
       y1="11"
       x2="8"
       y2="11" />
    <linearGradient
       id="linearGradient3266"
       inkscape:collect="always">
      <stop
         id="stop3268"
         offset="0"
         style="stop-color:#505050;stop-opacity:1;" />
      <stop
         id="stop3270"
         offset="1"
         style="stop-color:#505050;stop-opacity:0;" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3266"
       id="linearGradient3340"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(2,0)"
       x1="3.8890872"
       y1="15.656685"
       x2="4.3288512"
       y2="12.842732" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3242"
       id="linearGradient3338"
       gradientUnits="userSpaceOnUse"
       x1="3.5"
       y1="14.03125"
       x2="3.5"
       y2="7.9958577" />
    <linearGradient
       id="linearGradient3242">
      <stop
         id="stop3244"
         offset="0"
         style="stop-color:#505050;stop-opacity:1;" />
      <stop
         style="stop-color:#a7a7a7;stop-opacity:1;"
         offset="0.5"
         id="stop3260" />
      <stop
         style="stop-color:#ffffff;stop-opacity:1;"
         offset="0.69999999"
         id="stop3250" />
      <stop
         id="stop3246"
         offset="1"
         style="stop-color:#c8c8c8;stop-opacity:1;" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3242"
       id="linearGradient3336"
       gradientUnits="userSpaceOnUse"
       x1="7.6126604"
       y1="14.756505"
       x2="5.5251265"
       y2="7.243495" />
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 11 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="22 : 11 : 1"
       inkscape:persp3d-origin="11 : 7.3333333 : 1"
       id="perspective23" />
    <linearGradient
       id="ShadowGradient">
      <stop
         style="stop-color:#000000;stop-opacity:1;"
         offset="0"
         id="stop3393" />
      <stop
         style="stop-color:#000000;stop-opacity:0;"
         offset="1"
         id="stop3395" />
    </linearGradient>
    <linearGradient
       id="StandardGradient">
      <stop
         style="stop-color:#000000;stop-opacity:1;"
         offset="0"
         id="stop3389" />
      <stop
         style="stop-color:#646464;stop-opacity:1;"
         offset="1"
         id="stop3391" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3381"
       x1="9.9375"
       y1="3"
       x2="9.9375"
       y2="19.017569"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3782"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(0,-1)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2400"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-9,10)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3174"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,0.8856249,4.1536343)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3178"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0,1,-1,0,12.009822,7.0098219)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3182"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(-0.7071068,0.7071068,-0.7071068,-0.7071068,17.856188,16.895447)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3186"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(-1,0,0,-1,15,28.019644)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3190"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,5.1143752,33.866009)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3194"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0,-1,1,0,-6.0098215,31.009821)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3198"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,-11.856186,21.124197)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3224"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,11.292893,-6.263456)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2407"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-22,-5)"
       x1="9.75"
       y1="5"
       x2="9.75"
       y2="19.055693" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3228"
       x1="6.7010484"
       y1="1"
       x2="6.7010484"
       y2="15.001111"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3171"
       id="linearGradient2630"
       gradientUnits="userSpaceOnUse"
       x1="4.9375"
       y1="11"
       x2="8"
       y2="11"
       gradientTransform="translate(4.8043455e-2,-1.0546018)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3266"
       id="linearGradient2633"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(2.0480435,-1.0546018)"
       x1="3.8890872"
       y1="15.656685"
       x2="4.3288512"
       y2="12.842732" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3242"
       id="linearGradient2636"
       gradientUnits="userSpaceOnUse"
       x1="3.5"
       y1="14.03125"
       x2="3.5"
       y2="7.9958577"
       gradientTransform="translate(4.8043455e-2,-1.0546018)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3242"
       id="linearGradient2639"
       gradientUnits="userSpaceOnUse"
       x1="7.6126604"
       y1="14.756505"
       x2="5.5251265"
       y2="7.243495"
       gradientTransform="translate(4.8043455e-2,-1.0546018)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient3242"
       id="linearGradient2641"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-2,-2.9999999)"
       x1="7.6126604"
       y1="14.756505"
       x2="5.5251265"
       y2="7.243495" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3421"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2433"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="matrix(1.2397314,0,0,1,-2.1450456,0)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2435"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="matrix(1.3065009,0,0,1,-3.6644889,0)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2437"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="matrix(1.315615,0,0,1,-4.7200494,0)" />
    <inkscape:perspective
       id="perspective2849"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 0.5 : 1"
       sodipodi:type="inkscape:persp3d" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2898"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554" />
    <inkscape:perspective
       id="perspective2917"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 0.5 : 1"
       sodipodi:type="inkscape:persp3d" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4081"
       id="linearGradient3538"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(1,0)"
       x1="16.5"
       y1="19.542921"
       x2="16.5"
       y2="2.5" />
    <linearGradient
       id="linearGradient4081">
      <stop
         style="stop-color:#aaaaaa;stop-opacity:1;"
         offset="0"
         id="stop4083" />
      <stop
         style="stop-color:#f0f0f0;stop-opacity:1;"
         offset="1"
         id="stop4085" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4081"
       id="linearGradient3542"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-4,-3)"
       x1="10.50519"
       y1="15.28125"
       x2="10.50519"
       y2="6.7458849" />
    <linearGradient
       id="linearGradient2926">
      <stop
         style="stop-color:#aaaaaa;stop-opacity:1;"
         offset="0"
         id="stop2928" />
      <stop
         style="stop-color:#f0f0f0;stop-opacity:1;"
         offset="1"
         id="stop2930" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4081"
       id="linearGradient3540"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-4,-3)"
       x1="14.524625"
       y1="17.41902"
       x2="14.524625"
       y2="4.625" />
    <linearGradient
       id="linearGradient2933">
      <stop
         style="stop-color:#aaaaaa;stop-opacity:1;"
         offset="0"
         id="stop2935" />
      <stop
         style="stop-color:#f0f0f0;stop-opacity:1;"
         offset="1"
         id="stop2937" />
    </linearGradient>
    <linearGradient
       y2="2.5"
       x2="16.5"
       y1="19.542921"
       x1="16.5"
       gradientTransform="translate(-4,-3)"
       gradientUnits="userSpaceOnUse"
       id="linearGradient2942"
       xlink:href="#linearGradient4081"
       inkscape:collect="always" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4081"
       id="linearGradient2945"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-4,-3)"
       x1="16.5"
       y1="19.542921"
       x2="16.5"
       y2="2.5" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4081"
       id="linearGradient2948"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(1,0,0,0.94352368,-4,-2.3752307)"
       x1="16.5"
       y1="19.542921"
       x2="16.5"
       y2="2.5" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient2950"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3729"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="translate(0,1)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient"
       id="linearGradient3731"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554" />
    <inkscape:perspective
       id="perspective3777"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 0.5 : 1"
       sodipodi:type="inkscape:persp3d" />
    <linearGradient
       id="StandardGradient-1"
       gradientTransform="scale(1.1467263,0.8720476)"
       x1="7.1904788"
       y1="6.9551144"
       x2="7.1904788"
       y2="18.319494"
       gradientUnits="userSpaceOnUse">
      <stop
         style="stop-color:#000000;stop-opacity:0.86274511;"
         offset="0"
         id="stop3280" />
      <stop
         style="stop-color:#000000;stop-opacity:0.47058824;"
         offset="1"
         id="stop3282" />
    </linearGradient>
    <linearGradient
       y2="18.319494"
       x2="7.1904788"
       y1="6.9551144"
       x1="7.1904788"
       gradientTransform="matrix(1.1467263,0,0,0.8720476,2.5196744,8.5383193)"
       gradientUnits="userSpaceOnUse"
       id="linearGradient3785"
       xlink:href="#StandardGradient-1"
       inkscape:collect="always" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-1"
       id="linearGradient3804"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-1"
       id="linearGradient3808"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="translate(0,1)" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-1"
       id="linearGradient3812"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-1"
       id="linearGradient3817"
       gradientUnits="userSpaceOnUse"
       x1="8.4375"
       y1="1"
       x2="8.4375"
       y2="15.007554"
       gradientTransform="translate(-20,0)" />
    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath3824">
      <path
         style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
         d="m -20,0 0,16 16,0 0,-16 -16,0 z M -7.625,1 C -5.995915,2.9288438 -5,5.3432918 -5,8 c 1e-6,2.708425 -1.032388,5.178784 -2.71875,7.125 l -1.5,-1.25 c 1.364366,-1.613056 2.1875,-3.651801 2.1875,-5.875 0,-2.1639699 -0.76332,-4.1574263 -2.0625,-5.75 L -7.625,1 z M -9.8125,2.84375 C -8.662551,4.2737473 -8,6.0683029 -8,8 c 0,1.9878056 -0.722863,3.803569 -1.9375,5.25 l -1.5,-1.28125 C -10.539955,10.861821 -10,9.5005507 -10,8 -10,6.5562172 -10.506676,5.24065 -11.34375,4.15625 l 1.53125,-1.3125 z m -5.1875,1.125 0,8 L -17,10 -18.5,10 C -18.777,10 -19,9.777 -19,9.5 l 0,-3 C -19,6.223 -18.777,6 -18.5,6 l 1.5,0 2,-2.03125 z M -12.0625,4.75 C -11.393055,5.6663669 -11,6.8041149 -11,8 c 0,1.2594208 -0.420217,2.432325 -1.15625,3.375 L -13.6875,10.0625 C -13.263995,9.4700266 -13,8.7691247 -13,8 -13,7.2815285 -13.219346,6.6300346 -13.59375,6.0625 L -12.0625,4.75 z"
         id="path3826" />
    </clipPath>
    <inkscape:perspective
       id="perspective2945"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 0.5 : 1"
       sodipodi:type="inkscape:persp3d" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient3750"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       id="StandardGradient-6"
       gradientTransform="matrix(0.9984539,0,0,0.9984539,-0.0459776,0.05767558)"
       x1="10.710332"
       y1="1.9963325"
       x2="10.710332"
       y2="18.974037"
       gradientUnits="userSpaceOnUse">
      <stop
         style="stop-color:#000000;stop-opacity:0.86274511;"
         offset="0"
         id="stop3277" />
      <stop
         style="stop-color:#000000;stop-opacity:0.47058824;"
         offset="1"
         id="stop3279" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient2953"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.77744586,0,0,0.77121526,-0.55489171,-0.3761043)"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient2955"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.77744586,0,0,0.77121526,-0.55489171,-1.3761043)"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient3732"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.77744586,0,0,0.77121526,-0.55489171,-0.3761043)"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient3736"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.77744586,0,0,0.77121526,-0.55489171,-1.3761043)"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient3741"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.77744586,0,0,0.77121526,-20.554892,-1.3761043)"
       x1="11"
       y1="3"
       x2="11"
       y2="20.117243" />
    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath3748">
      <path
         style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
         d="m -20,0 0,16 16,0 0,-16 -16,0 z M -15.5,1.46875 -12,3.9375 -8.5,1.46875 -5,3.9375 -8.5,6.625 -5,8.96875 -12,14 -19,8.96875 -15.5,6.625 -19,3.9375 -15.5,1.46875 z"
         id="path3750" />
    </clipPath>
    <inkscape:perspective
       id="perspective2966"
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
       inkscape:vp_z="1 : 0.5 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 0.5 : 1"
       sodipodi:type="inkscape:persp3d" />
    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath3806">
      <path
         style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
         d="m -20,0 0,16 16,0 0,-16 -16,0 z m 14.28125,1 c 0.1826931,0 0.3653865,0.084136 0.5,0.21875 0.269228,0.269228 0.269228,0.730773 0,1 L -8.03125,5 l 0,1.53125 a 0.52760556,0.52613824 0 0 1 -0.15625,0.375 L -10.15625,8.875 a 0.52760556,0.52613824 0 0 1 -0.0625,0.03125 l -2.6875,-2.6875 a 0.52760556,0.52613824 0 0 1 0,-0.03125 0.52760556,0.52613824 0 0 1 0.03125,-0.03125 l 1.96875,-1.96875 a 0.52760556,0.52613824 0 0 1 0.375,-0.15625 l 1.53125,0 2.78125,-2.8125 C -6.084136,1.084136 -5.9014431,1 -5.71875,1 z m -8.125,6.125 a 0.52760556,0.52613824 0 0 1 0.03125,0 l 2.6875,2.6875 a 0.52760556,0.52613824 0 0 1 0,0.03125 0.52760556,0.52613824 0 0 1 -0.03125,0.03125 L -13.125,11.84375 A 0.52760556,0.52613824 0 0 1 -13.5,12 l -1.53125,0 -2.78125,2.8125 c -0.269228,0.269228 -0.730772,0.269228 -1,0 -0.269228,-0.269228 -0.269228,-0.730773 0,-1 L -16,11.03125 -16,9.5 a 0.52760556,0.52613824 0 0 1 0.15625,-0.375 L -13.875,7.15625 A 0.52760556,0.52613824 0 0 1 -13.84375,7.125 z"
         id="path3808" />
    </clipPath>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#StandardGradient-6"
       id="linearGradient3849"
       gradientUnits="userSpaceOnUse"
       x1="10.973592"
       y1="1.0816979"
       x2="10.973592"
       y2="8.9478464"
       gradientTransform="translate(-20,0)" />
    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath3856">
      <path
         style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
         d="m -20,0 0,16 16,0 0,-16 -16,0 z m 14.28125,1 c 0.1826931,0 0.3653865,0.084136 0.5,0.21875 0.269228,0.269228 0.269228,0.730773 0,1 L -8.03125,5 l 0,1.53125 a 0.52760556,0.52613824 0 0 1 -0.15625,0.375 L -10.15625,8.875 a 0.52760556,0.52613824 0 0 1 -0.0625,0.03125 l -2.6875,-2.6875 a 0.52760556,0.52613824 0 0 1 0,-0.03125 0.52760556,0.52613824 0 0 1 0.03125,-0.03125 l 1.96875,-1.96875 a 0.52760556,0.52613824 0 0 1 0.375,-0.15625 l 1.53125,0 2.78125,-2.8125 C -6.084136,1.084136 -5.9014431,1 -5.71875,1 z"
         id="path3858" />
    </clipPath>
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#e7e7e7"
     borderopacity="1"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="23.105011"
     inkscape:cx="12.261892"
     inkscape:cy="4.4643351"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="true"
     inkscape:showpageshadow="false"
     showguides="true"
     inkscape:guide-bbox="true"
     inkscape:window-width="1920"
     inkscape:window-height="1029"
     inkscape:window-x="0"
     inkscape:window-y="24"
     inkscape:window-maximized="1"
     inkscape:snap-global="true">
    <sodipodi:guide
       orientation="1,0"
       position="0,112"
       id="guide2383" />
    <inkscape:grid
       type="xygrid"
       id="grid3672"
       visible="true"
       enabled="true" />
    <sodipodi:guide
       orientation="1,0"
       position="22.008699,4.1542523"
       id="guide2950" />
    <sodipodi:guide
       orientation="0,1"
       position="11.22532,22.008699"
       id="guide2952" />
  </sodipodi:namedview>
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Calque 1"
     inkscape:groupmode="layer"
     id="layer1">
    <path
       sodipodi:nodetypes="ccsccscsscc"
       id="path3863"
       d="m 7,-18 c -1.8768845,0 -3.4437066,1.287639 -3.875,3.03125 C 1.92405,-14.7862 1,-13.751934 1,-12.5 c 0,1.380712 1.1192881,2.5 2.5,2.5 l 9,0 c 1.380712,0 2.5,-1.119288 2.5,-2.5 0,-1.208123 -0.860792,-2.204384 -2,-2.4375 6.5e-4,-0.02096 0,-0.04138 0,-0.0625 0,-1.104569 -0.895431,-2 -2,-2 -0.379916,0 -0.728742,0.128564 -1.03125,0.3125 C 9.2367617,-17.497359 8.1776106,-18 7,-18 z"
       style="color:#000000;fill:#6e6e6e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
    <path
       inkscape:transform-center-y="-0.48682856"
       sodipodi:nodetypes="ssscs"
       inkscape:connector-curvature="0"
       id="path3878"
       d="M 8.5,11.874521 C 8.5,12.522552 8.0604763,13 7.5000004,13 6.9356517,13 6.5,12.526117 6.5,11.874523 6.5,10.98275 7.4999997,10 7.4999997,10 7.4999997,10 8.5,10.983027 8.5,11.874521 z"
       style="color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
    <path
       style="color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
       d="M 7.5,0 C 5.164201,0 3.253781,1.785153 3.03125,4.0625 1.877066,4.283877 1,5.281256 1,6.5 1,7.880712 2.119288,9 3.5,9 l 4,0 4,0 C 13.432997,9 15,7.432997 15,5.5 15,3.567003 13.432997,2 11.5,2 11.41568,2 11.332827,2.02539 11.25,2.03125 10.446562,0.802689 9.077518,0 7.5,0 z"
       id="path3901"
       inkscape:connector-curvature="0" />
  </g>
</svg>

Added htdocs/images/credits.tml.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
[my html_header {Credits}]
Game Icons were sourced from the following artists and sites:

<div>Icons made by <a href="https://www.flaticon.com/authors/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
<div>Icons made by <a href="https://www.flaticon.com/authors/eucalyp" title="Eucalyp">Eucalyp</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
<div>Icons made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
[my html_footer]

Added htdocs/images/crown.svg.













>
>
>
>
>
>
1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="500pt" height="500pt" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#fefefe" stroke="#fefefe" stroke-width="0.09375" d=" M 0.0 0.0 L 500.0 0.0 L 500.0 500.0 L 0.0 500.0 L 0.0 0.0 Z" />
<path fill="#030303" stroke="#030303" stroke-width="0.09375" d=" M 244.3 171.4 C 250.3 171.3 255.2 175.6 260.7 177.2 C 269.9 179.9 278.0 186.0 282.5 194.4 C 284.7 198.3 284.6 202.8 284.5 207.0 C 283.9 216.2 289.4 224.8 287.1 234.0 C 286.0 239.3 283.1 246.5 288.4 250.6 C 294.8 254.5 302.7 254.7 310.0 254.5 C 318.2 254.3 326.4 254.9 334.5 254.3 C 339.9 252.6 345.1 250.0 349.3 246.2 C 350.4 241.6 347.5 237.4 346.8 233.0 C 348.0 225.2 352.7 218.1 352.5 210.0 C 352.5 205.0 351.9 199.4 355.0 195.0 C 358.6 190.0 363.2 185.4 369.1 183.1 C 375.5 180.9 381.9 176.9 389.0 178.8 C 395.4 179.8 398.9 185.7 403.0 190.0 C 406.1 193.4 409.7 197.0 409.5 201.9 C 409.5 230.0 409.5 258.0 409.5 286.1 C 409.9 292.5 405.5 297.9 401.0 302.0 C 397.1 305.9 391.5 307.7 386.0 307.5 C 347.3 307.4 308.7 307.5 270.0 307.5 C 261.2 307.1 252.9 310.8 244.2 310.5 C 239.8 310.6 235.5 310.3 231.2 310.5 C 224.3 310.3 217.7 312.9 210.9 313.5 C 204.0 314.1 197.4 311.4 190.6 310.6 C 184.4 310.2 178.2 310.7 172.0 310.5 C 165.5 310.3 159.5 307.2 153.0 307.5 C 146.7 307.7 140.3 307.2 134.1 306.0 C 131.7 305.5 129.0 304.5 127.9 302.1 C 126.3 298.0 126.3 293.6 125.3 289.5 C 124.2 283.5 120.2 278.3 120.4 272.0 C 120.0 265.9 122.7 260.1 122.5 254.0 C 122.6 245.0 122.4 236.0 122.5 227.0 C 122.6 221.1 125.5 215.8 125.5 210.0 C 125.7 203.0 125.2 195.9 125.6 189.0 C 126.1 184.5 129.4 181.1 133.4 179.4 C 138.9 176.9 144.7 173.4 151.0 174.8 C 156.1 176.0 161.1 177.7 165.6 180.5 C 170.3 183.7 170.9 189.8 172.4 194.8 C 174.2 200.3 173.4 206.1 173.5 211.7 C 173.5 216.2 174.8 220.6 174.4 225.1 C 173.5 234.8 169.6 244.2 170.6 254.1 C 171.0 257.3 172.9 260.9 176.4 261.4 C 182.8 261.8 189.3 261.8 195.6 260.6 C 202.2 259.5 208.7 262.5 215.3 261.3 C 219.4 260.6 224.3 259.5 226.2 255.3 C 230.9 247.8 229.5 238.7 229.4 230.3 C 227.7 217.6 228.8 204.7 228.5 191.9 C 227.9 185.9 234.4 183.6 237.3 179.4 C 239.7 176.8 240.9 172.6 244.3 171.4 Z" />
</svg>

Added htdocs/images/deadly.svg.





























































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
   xmlns:ns="http://ns.adobe.com/Variables/1.0/"
   xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://web.resource.org/cc/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   i:viewOrigin="249.2485 453.7085"
   i:rulerOrigin="-242 -332"
   i:pageBounds="242 460 370 332"
   width="48pt"
   height="48pt"
   viewBox="0 0 128.251 121.702"
   overflow="visible"
   enable-background="new 0 0 128.251 121.702"
   xml:space="preserve"
   id="svg153"
   sodipodi:version="0.32"
   sodipodi:docname="skull.svg"
   sodipodi:docbase="/home/rursus/Desktop/icons/Grass/scalable/apps"
   inkscape:version="0.44.1">
  <defs
   id="defs195"><linearGradient
   y2="85.9819"
   x2="79.3954"
   y1="32.4824"
   x1="2.9902"
   gradientUnits="userSpaceOnUse"
   id="linearGradient3782">
      <stop
   id="stop3784"
   style="stop-color:white;stop-opacity:1;"
   offset="0.0056" /><stop
   offset="0.49434999"
   style="stop-color:#faf4bb;stop-opacity:1;"
   id="stop3788" />
      <stop
   id="stop3786"
   style="stop-color:#d1cf5c;stop-opacity:1;"
   offset="0.9831" />
      
      
      
    </linearGradient><linearGradient
   id="linearGradient3755"><stop
     id="stop3757"
     offset="0"
     style="stop-color:black;stop-opacity:1;" /><stop
     style="stop-color:black;stop-opacity:0.84955752;"
     offset="0.5"
     id="stop3761" /><stop
     id="stop3759"
     offset="1"
     style="stop-color:black;stop-opacity:0;" /></linearGradient><linearGradient
   y2="85.9819"
   x2="79.3954"
   y1="32.4824"
   x1="2.9902"
   gradientUnits="userSpaceOnUse"
   id="linearGradient3731">
      <stop
   id="stop3733"
   style="stop-color:#c4cefd;stop-opacity:1;"
   offset="0.0056" />
      <stop
   id="stop3735"
   style="stop-color:#3240cf;stop-opacity:1;"
   offset="0.9831" />
      
      
      
    </linearGradient>
    <linearGradient
   id="XMLID_3_"
   gradientUnits="userSpaceOnUse"
   x1="2.9902"
   y1="32.4824"
   x2="79.3954"
   y2="85.9819">
      <stop
   offset="0.0056"
   style="stop-color:#FFFFFF"
   id="stop186" />
      <stop
   offset="0.9831"
   style="stop-color:#1C1C1C"
   id="stop187" />
      
      
      
    </linearGradient>
  
    
    
    
    
    
  
      
    
      
      
    
      <linearGradient
   id="XMLID_2_"
   gradientUnits="userSpaceOnUse"
   x1="30.1553"
   y1="51.205101"
   x2="78.9132"
   y2="85.345802"
   gradientTransform="matrix(1.53777,0,0,1.53789,2.6399,-29.3369)">
        <stop
   offset="0.0056"
   style="stop-color:#FFFFFF"
   id="stop175" />
        <stop
   offset="0.9831"
   style="stop-color:#1C1C1C"
   id="stop176" />
        
        
        
      </linearGradient>
      
      
    
      
      
    <radialGradient
   inkscape:collect="always"
   xlink:href="#linearGradient3755"
   id="radialGradient3753"
   cx="64.282196"
   cy="61.039604"
   fx="64.282196"
   fy="61.039604"
   r="63.954281"
   gradientTransform="matrix(1,0,0,0.999956,0,2.675063e-3)"
   gradientUnits="userSpaceOnUse" /><radialGradient
   inkscape:collect="always"
   xlink:href="#linearGradient3782"
   id="radialGradient3780"
   cx="62.975849"
   cy="42.444698"
   fx="62.975849"
   fy="42.444698"
   r="23.902042"
   gradientTransform="matrix(1,0,0,1.29819,0,-12.6566)"
   gradientUnits="userSpaceOnUse" /><radialGradient
   inkscape:collect="always"
   xlink:href="#linearGradient3782"
   id="radialGradient3806"
   cx="63.986263"
   cy="49.442539"
   fx="63.986263"
   fy="49.442539"
   r="21.7887"
   gradientTransform="matrix(1,0,0,0.470718,0,26.16907)"
   gradientUnits="userSpaceOnUse" /><linearGradient
   inkscape:collect="always"
   xlink:href="#linearGradient3782"
   id="linearGradient3814"
   x1="62.752071"
   y1="56.040272"
   x2="62.849331"
   y2="105.54034"
   gradientUnits="userSpaceOnUse" /><linearGradient
   inkscape:collect="always"
   xlink:href="#linearGradient3782"
   id="linearGradient3816"
   x1="62.752071"
   y1="56.040272"
   x2="62.849331"
   y2="105.54034"
   gradientUnits="userSpaceOnUse" /></defs>
  <sodipodi:namedview
   id="base"
   inkscape:zoom="5.6568542"
   inkscape:cx="22.655027"
   inkscape:cy="27.851162"
   inkscape:window-width="980"
   inkscape:window-height="610"
   inkscape:window-x="62"
   inkscape:window-y="111"
   inkscape:current-layer="svg153" />
  <metadata
   id="metadata154">
    <sfw
   id="sfw9">
      <slices
   id="slices11" />
      <sliceSourceBounds
   x="249.249"
   y="332.007"
   width="128.251"
   height="121.702"
   bottomLeftOrigin="true"
   id="sliceSourceBounds13" />
    </sfw>
    <ns:variableSets>
      <ns:variableSet
   varSetName="binding1"
   locked="none">
        <ns:variables />
        <ns:sampleDataSets />
      </ns:variableSet>
    </ns:variableSets>
  <rdf:RDF><cc:Work
     rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
       rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata>
  
<path
   d="M 128.23648,61.026491 C 128.24371,96.344758 99.618082,124.98221 64.298263,124.99108 C 28.978454,124.99995 0.33843408,96.376901 0.32791974,61.058634 C 0.31740893,25.74037 28.940383,-2.8997231 64.260196,-2.911873 C 99.580002,-2.924019 128.22268,25.696378 128.23646,61.014641"
   id="path4457"
   style="fill:url(#radialGradient3753);fill-opacity:1.0;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" /><path
   id="path1381"
   d="M 41.308156,38.771817 L 39.287335,32.763063 L 41.308156,22.40314 L 50.065048,14.529598 L 60.393691,11.628821 L 67.803368,11.628821 L 76.784798,14.3224 L 84.868083,22.817535 L 86.439833,27.7903 L 86.664368,34.627848 L 84.194475,38.357421 L 72.518619,63.014036 L 72.518619,70.058782 L 71.251758,70.909281 L 70.077465,71.076405 L 70.274537,68.54903 L 70.008761,71.702196 L 69.002432,72.079158 L 67.810964,72.071723 L 66.897201,71.936153 L 66.492574,70.818234 L 66.319367,68.846099 L 65.822169,71.913845 L 65.602677,72.589782 L 64.874056,73.094876 L 63.960296,73.215572 L 63.00025,72.951871 L 62.271629,72.218352 L 61.959569,68.922179 L 61.740077,72.288899 L 60.910259,72.881512 L 59.525027,73.260573 L 58.463785,72.870836 L 57.772822,72.139415 L 57.498421,68.546363 L 57.362873,71.189096 L 56.810763,71.995266 L 55.564382,72.288901 L 54.80399,71.947213 L 53.840831,71.216551 L 53.433084,70.058782 L 53.882157,58.662867 L 41.308156,38.771817 z "
   style="fill:url(#radialGradient3780);fill-opacity:1.0;fill-rule:evenodd;stroke:black;stroke-width:2.00392187;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
   id="path2910"
   d="M 100.13651,91.81462 L 100.36104,95.958588 L 98.115689,98.030574 L 94.747653,100.93135 L 91.379617,100.10256 L 78.356546,88.499445 L 62.639049,81.247499 L 44.900729,75.238744 L 31.877658,72.130767 L 27.386945,73.166759 L 24.917051,73.581157 L 20.875408,72.337965 L 22.671693,68.608394 L 27.386945,66.329211 L 32.326729,62.806838 L 35.245694,64.050028 L 39.511871,67.779601 L 52.984014,72.545165 L 67.578833,78.968315 L 86.888903,86.634659 L 96.094868,90.985826 L 100.13651,91.81462 z "
   style="fill:url(#linearGradient3814);fill-opacity:1.0;fill-rule:evenodd;stroke:black;stroke-width:2.00392187;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
   id="path2906"
   d="M 92.27776,62.806838 L 97.442081,63.428432 L 98.789297,66.122013 L 103.72908,66.329211 L 105.52537,69.644386 L 103.50455,72.545165 L 101.03465,72.545165 L 95.421261,70.47318 L 72.069547,79.175515 L 53.657619,88.292247 L 42.430836,92.229018 L 37.940122,96.580184 L 35.021157,100.93135 L 32.775801,102.17454 L 26.937872,99.066566 L 25.366122,93.679405 L 28.509622,90.57143 L 36.368372,89.742636 L 54.7803,81.040301 L 75.662118,73.373959 L 88.685189,66.536409 L 92.27776,62.806838 z "
   style="fill:url(#linearGradient3816);fill-opacity:1.0;fill-rule:evenodd;stroke:black;stroke-width:2.00392187;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
   id="path2144"
   d="M 58.161559,56.439842 L 52.336858,59.698863 L 46.727889,57.781791 L 42.197561,50.880341 L 42.413294,43.212061 L 48.453724,39.186217 L 55.141345,42.445235 L 60.966049,44.554012 L 69.595235,43.595477 L 78.008695,40.528164 L 83.833396,42.445235 L 85.774963,48.004736 L 82.323288,53.755947 L 78.440152,56.439842 L 73.909828,59.123744 L 69.595235,57.781791 L 62.691885,50.113513 L 58.161559,56.439842 z "
   style="fill:url(#radialGradient3806);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:1.96038902;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" /><path
   id="path3676"
   d="M 63.986262,52.239715 L 61.740904,52.446915 L 60.169156,56.383684 L 60.169156,58.455669 L 61.516369,57.626875 L 62.863584,55.55489 L 63.761727,57.419678 L 65.10894,58.248471 L 65.558013,55.969288 L 63.986262,52.239715 z "
   style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" /><path
   style="fill:#8b8b69;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.21676981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 61.929555,47.307859 L 53.130538,42.894616 L 48.213442,40.339576 L 43.813936,43.359166 L 43.813936,48.701517 L 46.919469,53.579315 L 52.354153,55.437523 L 57.271254,54.276144 L 61.929555,47.307859 z "
   id="path4438" /><path
   style="fill:#45451b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.21676981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 60.470075,47.530996 L 53.416022,44.026234 L 49.474053,41.997163 L 45.94703,44.395158 L 45.94703,48.637765 L 48.43669,52.511446 L 52.793603,53.987133 L 56.735577,53.064829 L 60.470075,47.530996 z "
   id="path2914" /><path
   style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.25981092;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 59.235126,47.801948 L 54.253218,45.569068 L 51.469212,44.276347 L 48.97826,45.804108 L 48.97826,48.507069 L 50.736578,50.97499 L 53.813637,51.91515 L 56.597646,51.32755 L 59.235126,47.801948 z "
   id="path4440" /><path
   style="fill:#8b8b69;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.21676981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 64.807985,47.100659 L 73.607002,42.687416 L 78.524098,40.132376 L 82.923604,43.151966 L 82.923604,48.494317 L 79.818071,53.372115 L 74.383387,55.230323 L 69.466286,54.068944 L 64.807985,47.100659 z "
   id="path4449" /><path
   style="fill:#45451b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.21676981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 66.267465,47.323796 L 73.321518,43.819034 L 77.263487,41.789963 L 80.79051,44.187958 L 80.79051,48.430565 L 78.30085,52.304246 L 73.943937,53.779933 L 70.001963,52.857629 L 66.267465,47.323796 z "
   id="path4451" /><path
   style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.25981092;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
   d="M 67.502414,47.594748 L 72.484322,45.361868 L 75.268328,44.069147 L 77.75928,45.596908 L 77.75928,48.299869 L 76.000962,50.76779 L 72.923903,51.70795 L 70.139894,51.12035 L 67.502414,47.594748 z "
   id="path4453" /></svg>

Added htdocs/images/demigod.svg.



>
1
<svg height="682pt" viewBox="-138 -21 682 682.66669" width="682pt" xmlns="http://www.w3.org/2000/svg"><path d="m202.246094 136.132812c37.082031 0 67.25-30.171874 67.25-67.25 0-37.085937-30.167969-67.257812-67.25-67.257812-37.085938 0-67.253906 30.171875-67.253906 67.25 0 37.085938 30.167968 67.257812 67.253906 67.257812zm0 0"/><path d="m228.046875 516.605469h37.496094v123.394531h-37.496094zm0 0"/><path d="m67.769531 457.695312 38.910157 17.742188 27.808593-43.703125-3.539062 47.371094h52.503906v-68.4375h37.5v68.4375h51.660156l-2.128906-44.894531 26.230469 41.226562 38.746094-17.667969-47.070313-84.914062h-173.386719zm0 0"/><path d="m315.804688 173.25 82.3125-44.21875.457031-128.898438-37.496094-.132812-.378906 106.570312-94.789063 50.921876h-131.042968l-104.871094-65.671876v-91.7539058h-37.496094v112.5156248l91.402344 57.238281 50.582031 105.984376-5.675781 59.550781h142.875l-6.023438-59.503907zm0 0"/><path d="m140.734375 516.605469h37.492187v123.394531h-37.492187zm0 0"/></svg>

Added htdocs/images/diety.svg.



>
1
<svg height="512pt" viewBox="0 -33 512.0005 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m325.308594 147.371094c0 2.632812 1.070312 5.210937 2.933594 7.070312 1.859374 1.859375 4.4375 2.929688 7.066406 2.929688 2.632812 0 5.210937-1.070313 7.070312-2.929688 1.863282-1.859375 2.929688-4.4375 2.929688-7.070312 0-2.628906-1.066406-5.207032-2.929688-7.070313-1.859375-1.859375-4.4375-2.929687-7.070312-2.929687-2.628906 0-5.207032 1.070312-7.066406 2.929687-1.863282 1.863281-2.933594 4.441407-2.933594 7.070313zm0 0"/><path d="m510.660156 431.085938-150.535156-260.734376c-2.761719-4.785156-8.875-6.425781-13.660156-3.660156-4.78125 2.761719-6.421875 8.875-3.660156 13.660156l35.59375 61.648438c-35.046876-23.652344-76.484376-36.75-119.964844-37.222656-.808594-.019532-1.621094-.03125-2.433594-.03125s-1.621094.011718-2.429688.03125c-43.480468.472656-84.921874 13.570312-119.96875 37.222656l122.398438-212 54.058594 93.628906c2.757812 4.785156 8.875 6.421875 13.660156 3.660156 4.78125-2.761718 6.421875-8.875 3.660156-13.660156l-62.71875-108.628906c-1.785156-3.09375-5.085937-5-8.660156-5s-6.875 1.90625-8.660156 5l-246 426.085938c-1.785156 3.09375-1.785156 6.90625 0 10s5.085937 5 8.660156 5h492c3.574219 0 6.875-1.90625 8.660156-5s1.785156-6.90625 0-10zm-323.972656-137.03125c0-38.21875 31.09375-69.3125 69.3125-69.3125 38.222656 0 69.3125 31.09375 69.3125 69.3125 0 38.222656-31.09375 69.316406-69.3125 69.316406s-69.3125-31.09375-69.3125-69.316406zm.84375 57.28125c-31.609375-11.535157-60.023438-31.058594-82.566406-57.28125 22.542968-26.21875 50.957031-45.742188 82.566406-57.277344-13.003906 15.519531-20.84375 35.496094-20.84375 57.277344s7.839844 41.761718 20.84375 57.28125zm157.78125-57.28125c0-21.777344-7.839844-41.757813-20.84375-57.277344 31.613281 11.53125 60.023438 31.058594 82.566406 57.277344-22.542968 26.222656-50.953125 45.746093-82.566406 57.28125 13.003906-15.519532 20.84375-35.5 20.84375-57.28125zm-317.992188 132.03125 66.246094-114.746094c41.023438 45.34375 98.464844 71.328125 160.003906 71.996094.808594.019531 1.617188.035156 2.429688.035156s1.625-.015625 2.429688-.035156c61.539062-.667969 118.980468-26.652344 160.003906-71.996094l66.246094 114.746094zm0 0"/></svg>

Added htdocs/images/eye.svg.



>
1
<svg height="512pt" viewBox="0 -33 512.0005 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m325.308594 147.371094c0 2.632812 1.070312 5.210937 2.933594 7.070312 1.859374 1.859375 4.4375 2.929688 7.066406 2.929688 2.632812 0 5.210937-1.070313 7.070312-2.929688 1.863282-1.859375 2.929688-4.4375 2.929688-7.070312 0-2.628906-1.066406-5.207032-2.929688-7.070313-1.859375-1.859375-4.4375-2.929687-7.070312-2.929687-2.628906 0-5.207032 1.070312-7.066406 2.929687-1.863282 1.863281-2.933594 4.441407-2.933594 7.070313zm0 0"/><path d="m510.660156 431.085938-150.535156-260.734376c-2.761719-4.785156-8.875-6.425781-13.660156-3.660156-4.78125 2.761719-6.421875 8.875-3.660156 13.660156l35.59375 61.648438c-35.046876-23.652344-76.484376-36.75-119.964844-37.222656-.808594-.019532-1.621094-.03125-2.433594-.03125s-1.621094.011718-2.429688.03125c-43.480468.472656-84.921874 13.570312-119.96875 37.222656l122.398438-212 54.058594 93.628906c2.757812 4.785156 8.875 6.421875 13.660156 3.660156 4.78125-2.761718 6.421875-8.875 3.660156-13.660156l-62.71875-108.628906c-1.785156-3.09375-5.085937-5-8.660156-5s-6.875 1.90625-8.660156 5l-246 426.085938c-1.785156 3.09375-1.785156 6.90625 0 10s5.085937 5 8.660156 5h492c3.574219 0 6.875-1.90625 8.660156-5s1.785156-6.90625 0-10zm-323.972656-137.03125c0-38.21875 31.09375-69.3125 69.3125-69.3125 38.222656 0 69.3125 31.09375 69.3125 69.3125 0 38.222656-31.09375 69.316406-69.3125 69.316406s-69.3125-31.09375-69.3125-69.316406zm.84375 57.28125c-31.609375-11.535157-60.023438-31.058594-82.566406-57.28125 22.542968-26.21875 50.957031-45.742188 82.566406-57.277344-13.003906 15.519531-20.84375 35.496094-20.84375 57.277344s7.839844 41.761718 20.84375 57.28125zm157.78125-57.28125c0-21.777344-7.839844-41.757813-20.84375-57.277344 31.613281 11.53125 60.023438 31.058594 82.566406 57.277344-22.542968 26.222656-50.953125 45.746093-82.566406 57.28125 13.003906-15.519532 20.84375-35.5 20.84375-57.28125zm-317.992188 132.03125 66.246094-114.746094c41.023438 45.34375 98.464844 71.328125 160.003906 71.996094.808594.019531 1.617188.035156 2.429688.035156s1.625-.015625 2.429688-.035156c61.539062-.667969 118.980468-26.652344 160.003906-71.996094l66.246094 114.746094zm0 0"/></svg>

Added htdocs/images/female.svg.









>
>
>
>
1
2
3
4
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="75" height="75">
<path stroke="#000" stroke-width="5" fill="none" d="m47,59H28m9.5,10V46.2a18.3,18.3 0 1,1 .1,0"/>
</svg>

Added htdocs/images/green_check.svg.





























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Yellow check by Gregory Maxwell. Copyright 2005. GFDL-1.2 -->
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://web.resource.org/cc/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.0"
   x="0.0000000"
   y="0.0000000"
   width="600.00000"
   height="600.00000"
   id="Yes_check"
   sodipodi:version="0.32"
   inkscape:version="0.45.1"
   sodipodi:docname="Orange_check.svg"
   sodipodi:docbase="C:\Documents and Settings\Kitsu\Desktop\temp\complete"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <metadata
     id="metadata1375">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs1373">
    <linearGradient
       id="linearGradient2250">
      <stop
         style="stop-color:#66cc44;stop-opacity:1"
         offset="0"
         id="stop2252" />
      <stop
         style="stop-color:#66cc44;stop-opacity:1"
         offset="1"
         id="stop2254" />
    </linearGradient>
    <radialGradient
       inkscape:collect="always"
       xlink:href="#linearGradient2250"
       id="radialGradient2256"
       cx="300"
       cy="300"
       fx="300"
       fy="300"
       r="292.31146"
       gradientTransform="matrix(1,0,0,0.98278,0,5.165947)"
       gradientUnits="userSpaceOnUse" />
  </defs>
  <sodipodi:namedview
     inkscape:window-height="579"
     inkscape:window-width="790"
     inkscape:pageshadow="2"
     inkscape:pageopacity="0.0"
     borderopacity="1.0"
     bordercolor="#666666"
     pagecolor="#ffffff"
     id="base"
     inkscape:zoom="0.62333333"
     inkscape:cx="300"
     inkscape:cy="300"
     inkscape:window-x="65"
     inkscape:window-y="60"
     inkscape:current-layer="Yes_check" />
  <path
     d="M 7.6885391,404.61420 C 7.6885391,404.61420 122.85389,534.30185 145.88696,587.27791 L 244.92916,587.27791 C 286.38869,460.59602 447.62018,158.16034 585.81860,52.208207 C 614.45182,15.394067 542.52080,0.19798715 484.47310,24.568517 C 396.98668,61.298507 231.98485,341.73657 201.16633,409.22081 C 157.40350,420.73735 111.33735,335.51499 111.33735,335.51499 L 7.6885391,404.61420 z "
     style="fill:url(#radialGradient2256);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
     id="check" />
</svg>

Added htdocs/images/heart.svg.









>
>
>
>
1
2
3
4
<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240">
<path fill="#D12" d="M121,229Q89,180 47,145Q9,112 9,65Q9,9 68,9Q96,9 121,33Q145,9 173,9Q233,9 233,65Q233,112 194,145Q152,180 121,229"/>
</svg>

Added htdocs/images/hercules.svg.



>
1
<svg height="682pt" viewBox="-138 -21 682 682.66669" width="682pt" xmlns="http://www.w3.org/2000/svg"><path d="m202.246094 136.132812c37.082031 0 67.25-30.171874 67.25-67.25 0-37.085937-30.167969-67.257812-67.25-67.257812-37.085938 0-67.253906 30.171875-67.253906 67.25 0 37.085938 30.167968 67.257812 67.253906 67.257812zm0 0"/><path d="m228.046875 516.605469h37.496094v123.394531h-37.496094zm0 0"/><path d="m67.769531 457.695312 38.910157 17.742188 27.808593-43.703125-3.539062 47.371094h52.503906v-68.4375h37.5v68.4375h51.660156l-2.128906-44.894531 26.230469 41.226562 38.746094-17.667969-47.070313-84.914062h-173.386719zm0 0"/><path d="m315.804688 173.25 82.3125-44.21875.457031-128.898438-37.496094-.132812-.378906 106.570312-94.789063 50.921876h-131.042968l-104.871094-65.671876v-91.7539058h-37.496094v112.5156248l91.402344 57.238281 50.582031 105.984376-5.675781 59.550781h142.875l-6.023438-59.503907zm0 0"/><path d="m140.734375 516.605469h37.492187v123.394531h-37.492187zm0 0"/></svg>

Added htdocs/images/hermaphrodite.svg.









































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="370"
   height="504"
   id="svg2"
   version="1.1"
   inkscape:version="0.48.4 r9939"
   sodipodi:docname="Hermaphrodite_symbol.svg">
  <metadata
     id="metadata14">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs12" />
  <sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="1280"
     inkscape:window-height="751"
     id="namedview10"
     showgrid="false"
     inkscape:zoom="1.8730159"
     inkscape:cx="184.02515"
     inkscape:cy="533.43332"
     inkscape:window-x="-4"
     inkscape:window-y="-4"
     inkscape:window-maximized="1"
     inkscape:current-layer="svg2" />
  <rect
     width="235"
     height="235"
     ry="117.5"
     x="40"
     y="110"
     style="fill-opacity:0;stroke:#a00;stroke-width:40;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
     id="rect4" />
  <path
     d="M 156,358.94915 156,472 m -60,-68 120,0"
     style="fill-opacity:0;stroke:#aa0000;stroke-width:40;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
     id="path6"
     inkscape:connector-curvature="0"
     sodipodi:nodetypes="cccc" />
  <path
     d="M 329,136 L 329,44 L 244,136 L 329,44 L 245,44"
     style="fill-opacity:0;stroke:#a00;stroke-width:40;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;fill:#008080"
     id="path8" />
</svg>

Added htdocs/images/inca_sun.svg.







































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="399.99979"
   height="400.10999"
   id="svg4250"
   sodipodi:version="0.32"
   inkscape:version="0.46"
   version="1.0"
   sodipodi:docname="Inca Sun.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <defs
     id="defs4252">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 526.18109 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="744.09448 : 526.18109 : 1"
       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
       id="perspective4258" />
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.91898613"
     inkscape:cx="260.27116"
     inkscape:cy="202.19941"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1280"
     inkscape:window-height="744"
     inkscape:window-x="-4"
     inkscape:window-y="-4" />
  <metadata
     id="metadata4255">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Capa 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(482.85703,159.12138)">
    <g
       id="g4179"
       style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-opacity:1"
       transform="translate(-402.85714,-364.06629)">
      <path
         d="M 110.19909,404.9999 L 117.54977,600.45957 C 117.54977,600.45957 117.54977,604.13593 120,604.13593 C 122.45023,604.13593 122.45023,600.45957 122.45023,600.45957 L 129.80091,404.9999"
         id="path13"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path19"
         d="M 101.53038,468.14602 C 90.276449,492.74274 99.940557,512.84255 88.696985,534.31499 C 77.453414,555.78742 84.482597,573.47517 83.72913,583.3263 C 82.975662,593.17742 74.917679,595.91451 76.952345,598.20442 C 78.987011,600.49433 87.411365,595.95596 90.698356,582.86875 C 93.985347,569.78156 86.141634,562.24515 99.623779,535.91341 C 113.10592,509.58167 102.3934,497.70976 115.92625,474.20209"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1"
         id="path3047"
         d="M 129.80091,404.9999 L 122.45023,209.54023 C 122.45023,209.54023 122.45023,205.86387 120,205.86387 C 117.54977,205.86387 117.54977,209.54023 117.54977,209.54023 L 110.19909,404.9999" />
      <path
         d="M 138.46962,341.85378 C 149.72355,317.25706 140.05944,297.15724 151.30302,275.68481 C 162.54659,254.21237 155.51741,236.52462 156.27087,226.6735 C 157.02434,216.82237 165.08232,214.08529 163.04766,211.79538 C 161.01299,209.50547 152.58864,214.04383 149.30165,227.13104 C 146.01466,240.21824 153.85837,247.75465 140.37622,274.08639 C 126.89408,300.41813 137.6066,312.29004 124.07375,335.79771"
         id="path3053"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         id="path2942"
         d="M 120,395.19628 L -75.405587,402.549 C -75.405587,402.549 -79.080927,402.549 -79.080927,404.9999 C -79.080927,407.45081 -75.405587,407.45081 -75.405587,407.45081 L 120,414.80352"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 56.871356,386.52517 C 32.281441,375.26812 12.187186,384.9349 -9.2793075,373.68822 C -30.745801,362.44154 -48.428657,369.47266 -58.277057,368.71899 C -68.125456,367.96531 -70.861783,359.9051 -73.151057,361.94033 C -75.440332,363.97556 -70.903228,372.40224 -57.819644,375.69014 C -44.73606,378.97804 -37.201733,371.13216 -10.877283,384.61804 C 15.447168,398.10392 27.315796,387.38843 50.816955,400.92502"
         id="path2948"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         d="M 120,414.80352 L 315.40559,407.45081 C 315.40559,407.45081 319.08093,407.45081 319.08093,404.9999 C 319.08093,402.549 315.40559,402.549 315.40559,402.549 L 120,395.19628"
         id="path3035"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path3041"
         d="M 183.12864,423.47463 C 207.71856,434.73168 227.81281,425.0649 249.27931,436.31158 C 270.7458,447.55826 288.42866,440.52714 298.27706,441.28081 C 308.12546,442.03449 310.86178,450.0947 313.15106,448.05947 C 315.44033,446.02424 310.90323,437.59756 297.81964,434.30966 C 284.73606,431.02176 277.20173,438.86764 250.87728,425.38176 C 224.55283,411.89588 212.6842,422.61137 189.18304,409.07478"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         id="path2867"
         d="M 113.06971,398.06769 L -19.905189,541.47771 C -19.905189,541.47771 -22.504047,544.07729 -20.771475,545.81034 C -19.038903,547.54339 -16.440045,544.94382 -16.440045,544.94382 L 126.93029,411.93211"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         d="M 62.301314,436.58734 C 36.955886,446.01991 29.580657,467.06808 6.4511485,474.29878 C -16.678361,481.52948 -24.211646,499.00836 -31.708298,505.44123 C -39.20495,511.8741 -46.837679,508.11008 -47.017715,511.16841 C -47.197751,514.22675 -38.032616,516.97621 -26.456871,510.04705 C -14.881127,503.1179 -15.099895,492.24097 13.047619,483.15758 C 41.195134,474.07418 42.012624,458.10248 68.19962,451.05187"
         id="path2873"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1"
         id="path2987"
         d="M 126.93029,411.93211 L 259.90519,268.52209 C 259.90519,268.52209 262.50405,265.92251 260.77148,264.18946 C 259.0389,262.45641 256.44004,265.05598 256.44004,265.05598 L 113.06971,398.06769" />
      <path
         d="M 177.69869,373.41246 C 203.04411,363.97989 210.41934,342.93172 233.54885,335.70102 C 256.67836,328.47032 264.21165,310.99144 271.7083,304.55857 C 279.20495,298.1257 286.83768,301.88972 287.01772,298.83139 C 287.19775,295.77305 278.03262,293.02359 266.45687,299.95275 C 254.88113,306.8819 255.09989,317.75883 226.95238,326.84222 C 198.80487,335.92562 197.98738,351.89732 171.80038,358.94793"
         id="path2993"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         d="M 126.93029,398.06769 L -16.440045,265.05598 C -16.440045,265.05598 -19.038903,262.45641 -20.771475,264.18946 C -22.504047,265.92251 -19.905189,268.52209 -19.905189,268.52209 L 113.06971,411.93211"
         id="path2926"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         id="path2932"
         d="M 88.421302,347.28524 C 78.99134,321.9328 57.949,314.55553 50.720303,291.41962 C 43.491606,268.2837 26.017556,260.74833 19.586468,253.24961 C 13.15538,245.75088 16.918359,238.11604 13.860872,237.93595 C 10.803384,237.75586 8.0546833,246.92354 14.98192,258.50249 C 21.909157,270.08144 32.783073,269.86261 41.863953,298.01791 C 50.944833,326.17322 66.91212,326.99094 73.96078,353.18518"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1"
         id="path3023"
         d="M 113.06971,411.93211 L 256.44004,544.94382 C 256.44004,544.94382 259.0389,547.54339 260.77148,545.81034 C 262.50405,544.07729 259.90519,541.47771 259.90519,541.47771 L 126.93029,398.06769" />
      <path
         d="M 151.5787,462.71456 C 161.00866,488.067 182.051,495.44427 189.2797,518.58018 C 196.50839,541.7161 213.98244,549.25147 220.41353,556.75019 C 226.84462,564.24892 223.08164,571.88376 226.13913,572.06385 C 229.19662,572.24394 231.94532,563.07626 225.01808,551.49731 C 218.09084,539.91836 207.21693,540.13719 198.13605,511.98189 C 189.05517,483.82658 173.08788,483.00886 166.03922,456.81462"
         id="path3029"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792448000000010;stroke-opacity:1" />
      <path
         id="path2814"
         d="M 110.94514,401.24822 L 42.957805,584.64316 C 42.957805,584.64316 41.551313,588.03967 43.815027,588.97759 C 46.078742,589.91551 47.485234,586.519 47.485234,586.519 L 129.05486,408.75158"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 78.778011,456.26933 C 58.970579,474.68585 60.209312,496.95497 41.606735,512.489 C 23.004157,528.02302 22.73134,547.05506 18.266407,555.8679 C 13.801475,564.68073 5.3097225,564.12495 6.3134406,567.0194 C 7.3171588,569.91385 16.836523,568.9457 24.880177,558.11293 C 32.923831,547.28015 28.560448,537.31493 51.090258,518.1484 C 73.620068,498.98187 68.264913,483.91301 89.761138,467.375"
         id="path2820"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 129.05486,408.75158 L 197.0422,225.35664 C 197.0422,225.35664 198.44869,221.96013 196.18497,221.02221 C 193.92126,220.08429 192.51477,223.4808 192.51477,223.4808 L 110.94514,401.24822"
         id="path2963"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path2969"
         d="M 161.22199,353.73047 C 181.02942,335.31395 179.79069,313.04483 198.39327,297.5108 C 216.99584,281.97678 217.26866,262.94474 221.73359,254.1319 C 226.19853,245.31907 234.69028,245.87485 233.68656,242.9804 C 232.68284,240.08595 223.16348,241.0541 215.11982,251.88687 C 207.07617,262.71965 211.43955,272.68487 188.90974,291.8514 C 166.37993,311.01793 171.73509,326.08679 150.23886,342.6248"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path2894"
         d="M 123.75064,395.94254 L -59.593562,327.93639 C -59.593562,327.93639 -62.989134,326.52951 -63.926795,328.79385 C -64.864456,331.05819 -61.468885,332.46507 -61.468885,332.46507 L 116.24936,414.05726"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 68.744753,363.76651 C 50.333327,343.9536 28.070361,345.19267 12.540635,326.58495 C -2.9890906,307.97723 -22.015872,307.70433 -30.826267,303.23817 C -39.636663,298.772 -39.081043,290.2779 -41.97469,291.28189 C -44.868337,292.28589 -43.900459,301.80789 -33.070681,309.85377 C -22.240902,317.89965 -12.278432,313.53505 6.8827957,336.0711 C 26.044024,358.60714 41.108713,353.2505 57.642157,374.75267"
         id="path2900"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 116.24936,414.05726 L 299.59356,482.06341 C 299.59356,482.06341 302.98913,483.47029 303.9268,481.20595 C 304.86446,478.94161 301.46888,477.53473 301.46888,477.53473 L 123.75064,395.94254"
         id="path2999"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path3005"
         d="M 171.25525,446.23329 C 189.66667,466.0462 211.92964,464.80713 227.45936,483.41485 C 242.98909,502.02257 262.01587,502.29547 270.82627,506.76163 C 279.63666,511.2278 279.08104,519.7219 281.97469,518.71791 C 284.86834,517.71391 283.90046,508.19191 273.07068,500.14603 C 262.2409,492.10015 252.27843,496.46475 233.1172,473.9287 C 213.95598,451.39266 198.89129,456.7493 182.35784,435.24713"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 116.24936,395.94254 L -61.468885,477.53474 C -61.468885,477.53474 -64.864456,478.94162 -63.926795,481.20597 C -62.989134,483.47031 -59.593562,482.06342 -59.593562,482.06342 L 123.75064,414.05726"
         id="path2847"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path2853"
         d="M 54.608722,412.09645 C 27.583909,411.10905 12.717532,427.73186 -11.41765,425.55842 C -35.552832,423.38499 -49.199709,436.64971 -58.586783,439.72327 C -67.973857,442.79683 -73.585549,436.3976 -74.921931,439.15421 C -76.258312,441.91083 -68.842713,447.95932 -55.497181,445.98868 C -42.151649,444.01805 -38.192498,433.88534 -8.7124833,436.26795 C 20.767531,438.65055 27.633209,424.20755 54.524244,427.71773"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 123.75064,414.05726 L 301.46888,332.46506 C 301.46888,332.46506 304.86446,331.05818 303.9268,328.79384 C 302.98913,326.52949 299.59356,327.93638 299.59356,327.93638 L 116.24936,395.94254"
         id="path2975"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path2981"
         d="M 185.39128,397.90335 C 212.41609,398.89075 227.28247,382.26794 251.41765,384.44138 C 275.55283,386.61481 289.19971,373.35009 298.58678,370.27653 C 307.97386,367.20297 313.58555,373.6022 314.92193,370.84559 C 316.25831,368.08897 308.84271,362.04048 295.49718,364.01112 C 282.15165,365.98175 278.1925,376.11446 248.71248,373.73185 C 219.23247,371.34925 212.36679,385.79225 185.47576,382.28207"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path2910"
         d="M 129.05486,401.24822 L 47.485234,223.4808 C 47.485234,223.4808 46.078742,220.08429 43.815027,221.02221 C 41.551313,221.96013 42.957805,225.35664 42.957805,225.35664 L 110.94514,408.75158"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 112.90542,339.59053 C 113.89254,312.55823 97.274331,297.68774 99.447165,273.54588 C 101.62,249.40402 88.358945,235.75337 85.286239,226.3637 C 82.213533,216.97402 88.610991,211.36078 85.855138,210.02403 C 83.099284,208.68728 77.05247,216.10493 79.022558,229.45415 C 80.992645,242.80338 91.122553,246.76363 88.740605,276.2518 C 86.358658,305.73997 100.79767,312.60755 97.288452,339.50602"
         id="path2916"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         d="M 110.94514,408.75158 L 192.51477,586.519 C 192.51477,586.519 193.92126,589.91551 196.18497,588.97759 C 198.44869,588.03967 197.0422,584.64316 197.0422,584.64316 L 129.05486,401.24822"
         id="path3011"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
      <path
         id="path3017"
         d="M 127.09458,470.40927 C 126.10746,497.44157 142.72567,512.31206 140.55283,536.45392 C 138.38,560.59578 151.64105,574.24643 154.71376,583.6361 C 157.78647,593.02578 151.38901,598.63902 154.14486,599.97577 C 156.90072,601.31252 162.94753,593.89487 160.97744,580.54565 C 159.00735,567.19642 148.87745,563.23617 151.25939,533.748 C 153.64134,504.25983 139.20233,497.39225 142.71155,470.49378"
         style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1.83792435999999990;stroke-opacity:1" />
    </g>
    <g
       id="g4213"
       style="fill:#000000;fill-opacity:1"
       transform="translate(-402.85714,-364.06629)">
      <g
         id="g4172"
         style="fill:#000000;fill-opacity:1">
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path15"
           d="M 115.09955,404.9999 L 120,539.18695 L 124.90045,404.9999" />
        <path
           d="M 104.63308,474.40495 C 95.90231,498.88988 105.09864,515.14283 93.376937,535.89268 C 106.40056,521.03529 97.814851,501.78021 109.19091,476.58307"
           id="path21"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           d="M 116.53486,401.5338 L 25.141683,499.88448 L 123.46514,408.466"
           id="path2869"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           d="M 115.47257,403.12406 L 68.663049,528.97256 L 124.52743,406.87574"
           id="path2816"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2822"
           d="M 79.250002,463.23951 C 61.816438,482.51859 64.09473,501.05461 45.326858,515.73802 C 63.043224,506.99689 62.477619,485.92101 82.627588,466.99651" />
      </g>
      <g
         id="g4079"
         style="fill:#000000;fill-opacity:1">
        <path
           d="M 124.90045,404.9999 L 120,270.81285 L 115.09955,404.9999"
           id="path3049"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path3055"
           d="M 135.36692,335.59485 C 144.09769,311.10992 134.90136,294.85697 146.62306,274.10712 C 133.59944,288.96451 142.18515,308.21958 130.80909,333.41673" />
        <path
           d="M 120,400.09809 L -14.149917,404.9999 L 120,409.90171"
           id="path2944"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2950"
           d="M 50.614152,389.62873 C 26.136,380.89554 9.8875497,390.09442 -10.85656,378.36947 C 3.9967181,391.3967 23.246466,382.80861 48.43664,394.18782" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2875"
           d="M 60.070742,443.20762 C 36.588487,454.34579 31.601887,472.34295 8.6450877,478.72451 C 28.357037,477.4304 35.897649,457.74231 61.753879,447.97155" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2928"
           d="M 123.46514,401.5338 L 25.141683,310.11532 L 116.53486,408.466" />
        <path
           d="M 81.802852,345.05405 C 70.667772,321.5653 52.675593,316.57732 46.295791,293.61416 C 47.589549,313.33157 67.272192,320.87427 77.040247,346.73766"
           id="path2934"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2965"
           d="M 124.52743,406.87574 L 171.33695,281.02724 L 115.47257,403.12406" />
        <path
           d="M 121.87532,400.47122 L -3.9383634,353.64875 L 118.12468,409.52858"
           id="path2896"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2902"
           d="M 61.776499,364.23863 C 42.502756,346.80024 23.97186,349.07917 9.2925041,330.3061 C 18.031218,348.02737 39.101276,347.46161 58.020535,367.61715" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2849"
           d="M 118.12468,400.47122 L -3.9383634,456.35106 L 121.87532,409.52858" />
        <path
           d="M 50.015171,417.35895 C 24.059186,418.66052 12.56686,433.3789 -11.083901,430.48709 C 7.6226646,436.837 22.121502,421.53404 49.747617,422.40453"
           id="path2855"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           d="M 124.52743,403.12406 L 68.663049,281.02724 L 115.47257,406.87574"
           id="path2912"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2918"
           d="M 107.64437,334.9957 C 106.34317,309.03254 91.628848,297.53703 94.519866,273.87972 C 88.171707,292.59147 103.47043,307.09432 102.60019,334.72808" />
      </g>
      <g
         style="fill:#000000;fill-opacity:1"
         id="g4157">
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path3037"
           d="M 120,409.90171 L 254.14992,404.9999 L 120,400.09809" />
        <path
           d="M 189.38585,420.37107 C 213.864,429.10426 230.11245,419.90538 250.85656,431.63033 C 236.00328,418.6031 216.75353,427.19119 191.56336,415.81198"
           id="path3043"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           d="M 123.46514,408.466 L 214.85832,310.11532 L 116.53486,401.5338"
           id="path2989"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2995"
           d="M 179.92926,366.79218 C 203.41151,355.65401 208.39811,337.65685 231.35491,331.27529 C 211.64296,332.5694 204.10235,352.25749 178.24612,362.02825" />
        <path
           d="M 116.53486,408.466 L 214.85832,499.88448 L 123.46514,401.5338"
           id="path3025"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path3031"
           d="M 158.19715,464.94575 C 169.33223,488.4345 187.32441,493.42248 193.70421,516.38564 C 192.41045,496.66823 172.72781,489.12553 162.95975,463.26214" />
        <path
           d="M 160.75,346.76029 C 178.18356,327.48121 175.90527,308.94519 194.67314,294.26178 C 176.95678,303.00291 177.52238,324.07879 157.37241,343.00329"
           id="path2971"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path3001"
           d="M 118.12468,409.52858 L 243.93836,456.35105 L 121.87532,400.47122" />
        <path
           d="M 178.2235,445.76117 C 197.49724,463.19956 216.02814,460.92063 230.7075,479.6937 C 221.96878,461.97243 200.89872,462.53819 181.97947,442.38265"
           id="path3007"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path2977"
           d="M 121.87532,409.52858 L 243.93836,353.64874 L 118.12468,400.47122" />
        <path
           d="M 189.98483,392.64085 C 215.94081,391.33929 227.43314,376.6209 251.0839,379.51271 C 232.37734,373.1628 217.8785,388.46576 190.25238,387.59527"
           id="path2983"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
        <path
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5"
           id="path3013"
           d="M 115.47257,406.87574 L 171.33695,528.97256 L 124.52743,403.12406" />
        <path
           d="M 132.35563,475.0041 C 133.65683,500.96726 148.37115,512.46277 145.48013,536.12008 C 151.82829,517.40833 136.52957,502.90548 137.39981,475.27172"
           id="path3019"
           style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5" />
      </g>
    </g>
    <circle
       style="fill:#e6e6e6;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-opacity:1"
       sodipodi:ry="65"
       sodipodi:rx="65"
       sodipodi:cy="0"
       sodipodi:cx="0"
       cy="0"
       cx="0"
       id="circle31"
       r="65"
       transform="matrix(1.2251134,0,0,1.2254525,-282.85714,40.933611)" />
    <g
       id="g4131"
       style="fill:#000000"
       transform="translate(-402.8575,-364.06629)">
      <g
         id="g4106"
         style="fill:#000000">
        <path
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="uppalpebra"
           d="M 148.17761,384.16721 C 140.21437,384.16721 138.3767,386.00539 134.70136,389.06902 C 131.02602,392.13265 129.18835,391.51992 128.57579,392.13265 C 127.96324,392.74538 128.57579,394.58355 129.80091,393.97083 C 131.02602,393.3581 133.47625,392.13265 137.15159,389.06902 C 140.82693,386.00539 144.50227,386.00539 148.17761,386.00539 C 159.20363,386.00539 165.3292,395.19628 166.55431,394.58355 C 167.77942,393.97083 160.42874,384.16721 148.17761,384.16721" />
        <path
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="upeyecontour"
           d="M 162.26641,394.58355 C 154.30318,386.00539 139.60181,385.39266 133.47625,395.19628 L 135.92647,395.19628 C 142.05204,385.39266 156.7534,389.68174 157.97852,393.97083 L 157.97852,395.19628" />
        <circle
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="pupil"
           cx="22"
           cy="-9"
           r="4.5"
           sodipodi:cx="22"
           sodipodi:cy="-9"
           sodipodi:rx="4.5"
           sodipodi:ry="4.5"
           transform="matrix(1.2251134,0,0,1.2254525,120,404.9999)" />
        <path
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="loweyecontour"
           d="M 133.47625,395.19628 C 139.60181,400.71082 153.07806,401.32354 162.26641,394.58355 L 157.97852,393.97083 C 151.85295,400.71082 142.05204,400.09809 135.92647,395.19628 L 135.92647,393.97083" />
        <path
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="lowpalpebra"
           d="M 162.87897,397.64719 C 152.46551,405.61263 142.05204,404.9999 135.92647,401.32354 C 129.80091,397.64719 129.80091,396.42173 131.02602,396.42173 C 132.25113,396.42173 133.47625,397.64719 138.3767,400.09809 C 143.27715,402.549 150.62784,402.549 162.87897,397.64719" />
        <path
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           id="midlip"
           d="M 138.3767,441.76348 C 126.12557,438.08712 123.67534,440.53802 120,440.53802 L 118.77489,440.53802 L 120,442.98893 C 124.90045,442.98893 127.35068,439.31257 138.3767,441.76348" />
        <path
           style="fill:#000000;stroke-width:1.5"
           id="chin"
           d="M 131.02602,461.37072 C 131.02602,455.27953 126.0895,450.34164 120,450.34164 C 113.9105,450.34164 108.97398,455.27953 108.97398,461.37072 C 110.18644,456.26062 114.74941,452.65285 120,452.65285 C 125.25059,452.65285 129.81356,456.26062 131.02602,461.37072" />
        <path
           d="M 91.822392,384.16721 C 99.785629,384.16721 101.6233,386.00539 105.29864,389.06902 C 108.97398,392.13265 110.81165,391.51992 111.42421,392.13265 C 112.03676,392.74538 111.42421,394.58355 110.19909,393.97083 C 108.97398,393.3581 106.52375,392.13265 102.84841,389.06902 C 99.173072,386.00539 95.497732,386.00539 91.822392,386.00539 C 80.796371,386.00539 74.670804,395.19628 73.445691,394.58355 C 72.220577,393.97083 79.571258,384.16721 91.822392,384.16721"
           id="path2775"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
        <path
           d="M 77.733588,394.58355 C 85.696825,386.00539 100.39819,385.39266 106.52375,395.19628 L 104.07353,395.19628 C 97.947959,385.39266 83.246598,389.68174 82.021485,393.97083 L 82.021485,395.19628"
           id="path2777"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
        <circle
           sodipodi:ry="4.5"
           sodipodi:rx="4.5"
           sodipodi:cy="-9"
           sodipodi:cx="22"
           r="4.5"
           cy="-9"
           cx="22"
           id="circle2779"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5"
           transform="matrix(-1.2251134,0,0,1.2254525,120,404.9999)" />
        <path
           d="M 106.52375,395.19628 C 100.39819,400.71082 86.921938,401.32354 77.733588,394.58355 L 82.021485,393.97083 C 88.147052,400.71082 97.947959,400.09809 104.07353,395.19628 L 104.07353,393.97083"
           id="path2781"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
        <path
           d="M 77.121031,397.64719 C 87.534495,405.61263 97.947959,404.9999 104.07353,401.32354 C 110.19909,397.64719 110.19909,396.42173 108.97398,396.42173 C 107.74887,396.42173 106.52375,397.64719 101.6233,400.09809 C 96.722845,402.549 89.372165,402.549 77.121031,397.64719"
           id="path2783"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
        <path
           d="M 99.785629,441.76348 C 113.26188,440.53802 108.97398,448.50346 120,448.50346 L 121.22511,448.50346 L 120,450.34164 C 106.52375,450.34164 112.64932,442.98893 99.785629,441.76348"
           id="path2791"
           style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
        <g
           id="g4095"
           style="fill:#000000">
          <path
             d="M 170.22965,387.84357 C 156.14085,375.58904 138.3767,373.75086 128.57579,382.94176 C 121.46233,392.45502 122.0962,403.65647 130.41346,415.41625 C 129.80091,415.41625 128.57579,416.02897 127.96324,416.6417 C 121.78554,404.8739 120.72288,392.75628 124.90045,381.7163 C 138.3767,370.68723 156.7534,369.46178 170.22965,387.84357"
             id="eyebrow_nose"
             style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
          <path
             d="M 132.86369,416.02897 C 134.59856,416.64597 135.60927,418.45186 135.2282,420.25376 C 134.84713,422.05566 133.19189,423.29743 131.35585,423.15883 C 129.51981,423.02023 128.06963,421.54403 127.96324,419.70533 C 127.35068,420.93078 124.90045,424.60714 120,424.60714 L 118.77489,424.60714 L 120,426.44532 C 121.22511,426.44532 124.90045,426.44532 127.35068,424.60714 C 128.77596,426.65253 131.39596,427.48691 133.74111,426.64227 C 136.08626,425.79762 137.57311,423.4841 137.3677,420.99935 C 137.16228,418.5146 135.31569,416.47681 132.86369,416.02897"
             id="nose"
             style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
          <path
             d="M 140.21437,441.76348 C 134.70136,438.08712 132.25113,432.57258 126.12557,432.57258 C 124.90045,432.57258 122.45023,433.18531 120,434.41076 L 118.77489,434.41076 L 120,436.24894 C 122.45023,436.24894 126.12557,433.18531 130.41346,435.63621 C 134.70136,438.08712 137.15159,440.53802 140.21437,441.76348"
             id="uplip"
             style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
          <path
             d="M 140.21437,441.76348 C 126.73812,440.53802 131.02602,448.50346 120,448.50346 L 118.77489,448.50346 L 120,450.34164 C 133.47625,450.34164 127.35068,442.98893 140.21437,441.76348"
             id="path43"
             style="fill:#000000;fill-opacity:1;stroke-width:1.5" />
          <path
             style="fill:#000000;fill-opacity:1;stroke-width:1.5"
             id="path2773"
             d="M 69.770351,387.84357 C 83.859155,375.58904 101.6233,373.75086 111.42421,382.94176 C 118.53767,392.45502 117.9038,403.65647 109.58654,415.41625 C 110.19909,415.41625 111.42421,416.02897 112.03676,416.6417 C 118.21446,404.8739 119.27712,392.75628 115.09955,381.7163 C 101.6233,370.68723 83.246598,369.46178 69.770351,387.84357" />
          <path
             style="fill:#000000;fill-opacity:1;stroke-width:1.5"
             id="path2785"
             d="M 107.13631,416.02897 C 105.40144,416.64597 104.39073,418.45186 104.7718,420.25376 C 105.15287,422.05566 106.80811,423.29743 108.64415,423.15883 C 110.48019,423.02023 111.93037,421.54403 112.03676,419.70533 C 112.64932,420.93078 115.09955,424.60714 120,424.60714 L 121.22511,424.60714 L 120,426.44532 C 118.77489,426.44532 115.09955,426.44532 112.64932,424.60714 C 111.22404,426.65253 108.60404,427.48691 106.25889,426.64227 C 103.91374,425.79762 102.42689,423.4841 102.6323,420.99935 C 102.83772,418.5146 104.68431,416.47681 107.13631,416.02897" />
          <path
             style="fill:#000000;fill-opacity:1;stroke-width:1.5"
             id="path2787"
             d="M 99.785629,441.76348 C 105.29864,438.08712 107.74887,432.57258 113.87443,432.57258 C 115.09955,432.57258 117.54977,433.18531 120,434.41076 L 121.22511,434.41076 L 120,436.24894 C 117.54977,436.24894 113.87443,433.18531 109.58654,435.63621 C 105.29864,438.08712 102.84841,440.53802 99.785629,441.76348" />
          <path
             style="fill:#000000;fill-opacity:1;stroke-width:1.5"
             id="path2789"
             d="M 101.6233,441.76348 C 113.87443,438.08712 116.32466,440.53802 120,440.53802 L 121.22511,440.53802 L 120,442.98893 C 115.09955,442.98893 112.64932,439.31257 101.6233,441.76348" />
          <path
             style="fill:#000000;fill-opacity:1;stroke-width:1.5"
             id="path2793"
             d="M 108.97398,461.37072 C 108.97398,455.27953 113.9105,450.34164 120,450.34164 C 126.0895,450.34164 131.02602,455.27953 131.02602,461.37072 C 129.81356,456.26062 125.25059,452.65285 120,452.65285 C 114.74941,452.65285 110.18644,456.26062 108.97398,461.37072" />
        </g>
      </g>
    </g>
  </g>
</svg>

Added htdocs/images/jinyan.svg.













































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   id="svg2"
   version="1.1"
   inkscape:version="0.48.1 "
   sodipodi:docname="gin jan.svg">
  <defs
     id="defs4" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.35"
     inkscape:cx="568.15086"
     inkscape:cy="568.48992"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1366"
     inkscape:window-height="706"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Capa 1"
     inkscape:groupmode="layer"
     id="layer1">
    <path
       style="fill:#000000;fill-rule:evenodd;stroke:none"
       d="m 360.35714,186.71875 c -11.26233,0.0296 -22.6988,1.18648 -34.15625,3.5625 -91.65956,19.00813 -150.53882,108.71271 -131.53125,200.375 l 4.625,17.625 c 24.4662,75.86494 97.9622,123.51975 175.625,116.875 l 0,1.625 c 75.22714,3.76153 141.36842,57.71594 157.375,134.90625 19.00757,91.66229 -39.87169,181.36687 -131.53125,200.375 -8.63041,1.78975 -17.28176,2.90165 -25.84375,3.34375 l 0,0.21875 c 22.75931,-0.0159 45.83004,-2.30826 68.90625,-7.09375 183.53365,-38.06075 301.46588,-217.7109 263.40625,-401.25 C 673.96962,296.87571 532.55033,186.5674 374.91964,186.71875 l 0,0.59375 c -4.81695,-0.40565 -9.67246,-0.60661 -14.5625,-0.59375 z m 0.1875,125 c 20.71321,-0.0545 39.31776,14.42732 43.6875,35.5 4.99399,24.08306 -10.48015,47.63086 -34.5625,52.625 -22.27145,4.6186 -44.45609,-8.28951 -51.4375,-29.9375 l -1.21875,-4.625 c -4.99399,-24.08306 10.48015,-47.63086 34.5625,-52.625 3.01029,-0.62427 6.00972,-0.92972 8.96875,-0.9375 z"
       id="path3004"
       inkscape:connector-curvature="0" />
    <rect
       style="opacity:0.97142855;fill:none;stroke:none"
       id="rect3006"
       width="231.42857"
       height="648.57141"
       x="-460"
       y="43.790752" />
    <path
       inkscape:transform-center-y="-199.09305"
       inkscape:transform-center-x="28.815245"
       sodipodi:type="arc"
       style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       id="path3013"
       sodipodi:cx="-580"
       sodipodi:cy="272.36218"
       sodipodi:rx="48.57143"
       sodipodi:ry="48.57143"
       d="m -627.55959,282.22468 a 48.57143,48.57143 0 1 1 1.33274,5.04596"
       sodipodi:start="2.9371194"
       sodipodi:end="9.1128031"
       sodipodi:open="true"
       transform="matrix(0.91684868,0,0,0.9168759,895.24802,446.37483)" />
    <path
       style="fill:#000000;fill-rule:evenodd;stroke:none"
       d="M 371.46875 166.1875 C 347.55287 166.2504 323.29896 168.70446 298.96875 173.75 C 104.32708 214.11431 -20.738116 404.6338 19.625 599.28125 L 29.5 636.65625 C 85.926089 811.6226 265.11962 915.95408 445.125 878.625 C 639.76667 838.2607 764.83187 647.7412 724.46875 453.09375 C 689.15103 282.77723 538.87992 165.74717 371.46875 166.1875 z M 371.5 186.71875 C 529.35716 186.30355 671.07283 296.68454 704.375 457.28125 C 742.43463 640.82035 624.5024 820.4705 440.96875 858.53125 C 271.23612 893.72999 102.23715 795.35618 49.03125 630.375 L 39.71875 595.09375 C 1.6591214 411.55465 119.59135 231.93575 303.125 193.875 C 326.06671 189.11741 348.94898 186.77806 371.5 186.71875 z "
       id="path3033" />
  </g>
</svg>

Added htdocs/images/lodging.svg.









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="123.547px" height="123.539px" viewBox="-0.258 -0.548 123.547 123.539"
	 style="enable-background:new -0.258 -0.548 123.547 123.539;" xml:space="preserve">
<g>
	<path style="fill:#231F20;" d="M109.633,122.785c8.156,0,14.773-6.609,14.773-14.742V14.004c0-8.133-6.617-14.75-14.773-14.75
		H15.609c-8.156,0-14.758,6.617-14.758,14.75v94.039c0,8.133,6.602,14.742,14.758,14.742H109.633z"/>
	<path style="fill:#FFFFFF;" d="M15.609,1.754c-6.758,0-12.258,5.492-12.258,12.25v94.039c0,6.75,5.5,12.242,12.258,12.242h94.023
		c6.766,0,12.258-5.492,12.258-12.242V14.004c0-6.758-5.492-12.25-12.258-12.25H15.609z"/>
	<path style="fill:#231F20;" d="M102.531,71.98v14.844h7.836V64.637H22.727V32.527c0-2.148-1.719-3.906-3.891-3.906l0,0
		c-2.148,0-3.883,1.758-3.883,3.906v54.297h7.773V71.98H102.531z"/>
	<path style="fill:#231F20;" d="M34.688,48.176c3.898,0,7.047-3.148,7.047-7.055c0-3.883-3.148-7.031-7.047-7.031
		c-3.891,0-7.039,3.148-7.039,7.031C27.648,45.027,30.797,48.176,34.688,48.176z"/>
	<path style="fill:#231F20;" d="M110.492,58.801l-0.023-9.695c-0.023-3.07-2.617-5.195-5.617-5.562L49.523,38.02
		c-0.109-0.023-0.211-0.07-0.305-0.07c-1.922,0-3.469,1.562-3.469,3.469v10.445H31.281c-1.938,0-3.484,1.562-3.484,3.469
		c0,1.93,1.547,3.469,3.484,3.469H110.492z"/>
</g>
</svg>

Added htdocs/images/male.svg.









>
>
>
>
1
2
3
4
<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
<path fill="none" stroke="#000" stroke-width="3.3" d="m30,21a12.2,12.2 0 1,0 2,2zl1,1 11-11m-9,0h9v9"/>
</svg>

Added htdocs/images/man.svg.





































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 903.7288 1712.5328" enable-background="new 0 0 903.7288 1712.5328" xml:space="preserve">
<g>
	<path d="M801.3882,925.212c-4.1222,17.1665-14.6907,29.3257-30.4462,35.1493c-25.9366,9.5861-46.9487-1.978-59.9796-24.6365
		c-2.2269-3.8456-3.9421-7.9816-5.2701-12.2144l-96.4429-305.9421c-1.7014-5.3809-9.6276-4.288-9.7938,1.3694L593.881,805.087
		l106.3336,797.895c3.7487,28.2191-18.1904,53.2844-46.6586,53.2844h-65.1804c-23.7371,0-43.7536-17.6509-46.7137-41.1945
		l-89.803-714.0814l-89.8032,714.0814c-2.9602,23.5436-22.9764,41.1945-46.6999,41.1945h-65.1806
		c-28.4682,0-50.4208-25.0653-46.6583-53.2844l106.3334-797.895l-5.5747-186.1494c-0.166-5.6574-8.106-6.7503-9.7936-1.3694
		l-96.4429,305.9421c-1.3418,4.2328-3.0572,8.3688-5.2704,12.2144c-13.0443,22.6584-34.0566,34.2225-59.9794,24.6365
		c-15.7695-5.8236-26.324-17.9828-30.4601-35.1493c-2.5452-10.61-2.0059-21.7316,1.0236-32.2169l138.4257-479.3928
		c13.0031-45.0538,54.2389-76.067,101.1324-76.067h217.9096c46.8934,0,88.1293,31.0132,101.1321,76.067l138.4258,479.3928
		C803.4078,903.4804,803.9474,914.6019,801.3882,925.212z"/>
	<circle cx="451.8644" cy="185.3735" r="129.107"/>
</g>
</svg>

Added htdocs/images/market.svg.













































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 59.998 59.998" style="enable-background:new 0 0 59.998 59.998;" xml:space="preserve">
<g>
	<path d="M16.586,10.028c0.407,1.178,1.504,1.97,2.73,1.97h7.431c1.226,0,2.323-0.792,2.73-1.97
		c0.388-1.126,1.607-3.645,2.553-4.445c0.829-0.703,1.218-1.792,1.014-2.842c-0.2-1.033-0.921-1.849-1.928-2.182
		c-3.001-0.995-5.663-0.66-7.698,0.967c-0.365,0.292-0.855,0.292-1.22,0C20.163-0.1,17.503-0.435,14.5,0.56
		c-1.007,0.333-1.729,1.148-1.929,2.182c-0.204,1.05,0.185,2.139,1.014,2.842C14.656,6.49,16.296,9.188,16.586,10.028z
		 M14.535,3.123c0.036-0.187,0.162-0.521,0.594-0.664c0.93-0.308,1.797-0.461,2.599-0.461c1.234,0,2.312,0.364,3.221,1.091
		c1.095,0.877,2.625,0.875,3.718,0c1.501-1.2,3.458-1.412,5.82-0.63c0.432,0.143,0.557,0.478,0.593,0.664
		c0.067,0.347-0.061,0.696-0.343,0.935c-1.528,1.294-2.894,4.576-3.15,5.319c-0.128,0.372-0.466,0.622-0.839,0.622h-7.431
		c-0.374,0-0.711-0.25-0.839-0.622c-0.417-1.208-2.272-4.194-3.599-5.319C14.596,3.818,14.467,3.469,14.535,3.123z"/>
	<path d="M31.532,13.998c0-0.552-0.448-1-1-1c-0.186,0-0.351,0.065-0.5,0.153c-0.149-0.089-0.314-0.153-0.5-0.153h-12
		c-0.552,0-1,0.448-1,1s0.448,1,1,1h12v1h-11c-0.552,0-1,0.448-1,1s0.448,1,1,1h11.925c0.896,0.746,2,1.173,3.179,1.173
		c1.335,0,2.591-0.521,3.536-1.466c0.391-0.391,0.391-1.023,0-1.414c-0.391-0.391-1.023-0.391-1.414,0
		c-1.13,1.13-3.088,1.133-4.226,0.014V13.998z"/>
	<path d="M21.532,25.998c-6.411,0-14,8.131-14,15c0,0.552,0.448,1,1,1s1-0.448,1-1c0-5.71,6.729-13,12-13c0.552,0,1-0.448,1-1
		S22.084,25.998,21.532,25.998z"/>
	<path d="M49.532,31.998c-1.031,0-2.259,0.06-3.497,0.201c-1.347-2.466-3.123-4.587-5.365-6.304L33.468,21
		c-1.191-0.914-3.068-2.002-5.246-2.002h-7.777c-1.924,0-3.816,0.655-5.3,1.822l-7.078,5.157c-7.377,5.8-9.712,15.964-5.551,24.168
		c1.514,2.985,4.043,6.592,7.501,6.826c0.271,0.018,0.545,0.028,0.821,0.028h19.459c1.468,1.826,3.715,3,6.235,3
		c2.898,0,5.434-1.555,6.838-3.869c1.787,0.555,3.978,0.869,6.162,0.869c4.809,0,10-1.529,10-4v-5.5h-0.079
		c0.048-0.162,0.079-0.328,0.079-0.5v-6v-5.5C59.532,32.735,53.246,31.998,49.532,31.998z M57.456,35.489
		c-0.021,0.021-0.038,0.042-0.067,0.065c-0.039,0.031-0.086,0.064-0.139,0.098c-0.066,0.042-0.146,0.086-0.233,0.13
		c-0.071,0.036-0.145,0.073-0.23,0.11c-0.105,0.047-0.229,0.094-0.356,0.142c-0.102,0.038-0.205,0.076-0.321,0.115
		c-0.146,0.048-0.314,0.096-0.483,0.143c-0.132,0.037-0.262,0.075-0.408,0.111c-0.19,0.047-0.404,0.09-0.617,0.133
		c-0.161,0.033-0.314,0.067-0.488,0.098c-0.24,0.042-0.508,0.078-0.773,0.114c-0.181,0.025-0.35,0.053-0.543,0.075
		c-0.315,0.036-0.662,0.061-1.008,0.086c-0.176,0.013-0.336,0.031-0.52,0.042c-0.546,0.03-1.124,0.048-1.741,0.048
		s-1.195-0.018-1.741-0.048c-0.184-0.01-0.344-0.028-0.52-0.042c-0.346-0.026-0.693-0.051-1.008-0.086
		c-0.193-0.022-0.362-0.05-0.543-0.075c-0.265-0.036-0.533-0.072-0.773-0.114c-0.174-0.031-0.327-0.065-0.488-0.098
		c-0.213-0.044-0.427-0.087-0.617-0.133c-0.146-0.036-0.275-0.073-0.408-0.111c-0.169-0.047-0.336-0.095-0.483-0.143
		c-0.116-0.038-0.219-0.077-0.321-0.115c-0.127-0.048-0.251-0.095-0.356-0.142c-0.085-0.037-0.159-0.074-0.23-0.11
		c-0.087-0.045-0.167-0.089-0.233-0.13c-0.053-0.034-0.1-0.066-0.139-0.098c-0.027-0.021-0.042-0.04-0.062-0.06
		c0.012-0.01,0.02-0.02,0.034-0.031c0.037-0.031,0.09-0.066,0.142-0.1c0.081-0.053,0.182-0.109,0.301-0.169
		c0.065-0.033,0.129-0.065,0.205-0.098c0.079-0.035,0.17-0.07,0.261-0.106c0.108-0.042,0.226-0.084,0.351-0.126
		c0.09-0.03,0.177-0.061,0.277-0.091c0.224-0.068,0.469-0.135,0.738-0.2c0.124-0.03,0.268-0.057,0.403-0.085
		c0.163-0.035,0.33-0.069,0.507-0.101c0.195-0.035,0.402-0.068,0.616-0.1c1.127-0.17,2.476-0.288,4.085-0.288
		C54.253,33.998,56.896,34.973,57.456,35.489z M42.207,43.716c0.09,0.038,0.183,0.074,0.277,0.111
		c0.174,0.068,0.352,0.132,0.536,0.195c0.097,0.033,0.192,0.065,0.291,0.096c0.211,0.066,0.428,0.127,0.65,0.186
		c0.078,0.021,0.153,0.044,0.232,0.063c0.303,0.076,0.613,0.146,0.931,0.208c0.066,0.013,0.135,0.023,0.202,0.036
		c0.255,0.048,0.513,0.092,0.775,0.131c0.112,0.017,0.225,0.031,0.338,0.046c0.225,0.03,0.451,0.057,0.68,0.081
		c0.12,0.012,0.24,0.024,0.36,0.035c0.236,0.021,0.473,0.037,0.711,0.051c0.106,0.006,0.212,0.014,0.318,0.019
		c0.342,0.015,0.683,0.025,1.023,0.025c0.34,0,0.681-0.01,1.023-0.025c0.108-0.005,0.216-0.013,0.324-0.019
		c0.235-0.014,0.47-0.03,0.704-0.05c0.123-0.011,0.246-0.023,0.368-0.036c0.225-0.023,0.448-0.05,0.67-0.08
		c0.116-0.015,0.232-0.03,0.347-0.047c0.258-0.038,0.512-0.082,0.763-0.129c0.071-0.013,0.143-0.024,0.214-0.038
		c0.316-0.063,0.625-0.132,0.926-0.207c0.084-0.021,0.164-0.045,0.247-0.067c0.217-0.058,0.43-0.118,0.636-0.183
		c0.101-0.032,0.198-0.065,0.296-0.098c0.183-0.062,0.361-0.127,0.534-0.194c0.093-0.036,0.186-0.073,0.276-0.111
		c0.18-0.076,0.351-0.156,0.516-0.238c0.052-0.026,0.111-0.048,0.161-0.074l0.006,3.524c-0.235,0.569-2.819,1.837-6.896,2.04
		c-0.366,0.013-0.72,0.031-1.115,0.031c-2.203,0-4.379-0.338-6.041-0.932c-0.006-0.01-0.013-0.02-0.019-0.03
		c-0.118-0.206-0.243-0.407-0.378-0.601c-0.02-0.029-0.043-0.056-0.064-0.085c-0.125-0.175-0.254-0.346-0.393-0.51
		c-0.042-0.049-0.087-0.094-0.13-0.143c-0.123-0.139-0.247-0.276-0.379-0.406c-0.068-0.067-0.141-0.127-0.211-0.192
		c-0.116-0.106-0.23-0.212-0.351-0.311c-0.012-0.01-0.022-0.021-0.034-0.03c0-0.391,0.001-1.26,0.002-2.353
		c0.051,0.027,0.112,0.05,0.164,0.076C41.862,43.562,42.03,43.641,42.207,43.716z M28.996,54.998H10.838
		c-0.231,0-0.461-0.008-0.688-0.023c-1.965-0.133-4.043-2.17-5.851-5.735c-3.731-7.356-1.626-16.479,4.974-21.669l7.078-5.157
		c1.162-0.913,2.616-1.416,4.093-1.416h7.777c1.617,0,3.083,0.864,4.076,1.623l7.202,4.894c1.789,1.372,3.28,3.05,4.445,5.001
		c-1.266,0.261-2.49,0.659-3.331,1.243c-0.023,0.016-0.046,0.032-0.069,0.048c-0.127,0.092-0.243,0.189-0.349,0.291
		c-0.045,0.043-0.085,0.087-0.126,0.132c-0.079,0.087-0.155,0.175-0.217,0.269c-0.052,0.077-0.09,0.16-0.13,0.242
		c-0.035,0.074-0.077,0.145-0.102,0.223c-0.055,0.169-0.089,0.346-0.089,0.534v5.5v3.589c-0.337-0.137-0.686-0.247-1.044-0.337
		c-0.047-0.012-0.094-0.025-0.141-0.036c-0.35-0.082-0.707-0.144-1.072-0.178c-0.041-0.004-0.082-0.003-0.123-0.006
		c-0.205-0.016-0.411-0.031-0.62-0.031c-0.11,0-0.216,0.012-0.325,0.016c-0.085,0.003-0.17,0.007-0.255,0.013
		c-0.356,0.026-0.708,0.067-1.05,0.138c-0.007,0.001-0.013,0.001-0.02,0.003c-0.027,0.006-0.052,0.017-0.079,0.023
		c-0.313,0.069-0.618,0.16-0.916,0.266c-0.108,0.038-0.216,0.076-0.322,0.118c-0.297,0.119-0.587,0.251-0.866,0.404
		c-0.105,0.057-0.203,0.123-0.305,0.185c-0.195,0.119-0.385,0.244-0.568,0.379c-0.108,0.079-0.217,0.156-0.321,0.24
		c-0.235,0.19-0.459,0.393-0.671,0.609c-0.093,0.094-0.178,0.194-0.266,0.293c-0.15,0.168-0.293,0.343-0.428,0.523
		c-0.073,0.098-0.15,0.191-0.219,0.292c-0.176,0.257-0.333,0.527-0.478,0.804c-0.056,0.108-0.107,0.218-0.159,0.329
		c-0.114,0.245-0.216,0.495-0.305,0.753c-0.026,0.075-0.058,0.146-0.081,0.222c-0.103,0.328-0.178,0.668-0.238,1.012
		c-0.008,0.044-0.024,0.086-0.031,0.13c-0.008,0.054-0.008,0.112-0.015,0.166c-0.032,0.235-0.052,0.473-0.063,0.714
		c-0.004,0.086-0.012,0.171-0.013,0.258c0,0.037-0.006,0.073-0.006,0.11c0,0.159,0.015,0.314,0.024,0.47
		C28.594,53.333,28.735,54.201,28.996,54.998z M36.532,57.998c-3.285,0-5.958-2.654-5.996-5.929c0-0.078,0.002-0.155,0.005-0.233
		c0.003-0.11,0.008-0.219,0.017-0.328c0.007-0.092,0.018-0.183,0.029-0.274c0.012-0.093,0.026-0.185,0.042-0.276
		c0.045-0.26,0.103-0.517,0.182-0.766c0.008-0.027,0.02-0.052,0.029-0.078c0.084-0.251,0.185-0.496,0.302-0.733
		c0.011-0.023,0.022-0.046,0.033-0.068c0.539-1.058,1.39-1.952,2.421-2.541c0.004-0.002,0.007-0.005,0.011-0.007
		c0.234-0.133,0.48-0.245,0.73-0.345c0.065-0.026,0.131-0.049,0.196-0.072c0.222-0.079,0.448-0.148,0.681-0.199
		c0.032-0.007,0.062-0.018,0.094-0.024c0.289-0.059,0.579-0.091,0.868-0.108c0.055-0.003,0.11-0.007,0.166-0.008
		c0.295-0.009,0.589-0.001,0.879,0.033c0.017,0.002,0.033,0.005,0.049,0.008c0.306,0.038,0.609,0.099,0.907,0.185
		c0.004,0.001,0.009,0.002,0.013,0.003c0.307,0.089,0.608,0.204,0.902,0.343c0.27,0.128,0.533,0.271,0.779,0.436l0.04,0.028
		c0.035,0.024,0.067,0.051,0.101,0.075c0.166,0.119,0.325,0.245,0.478,0.38c0.037,0.032,0.073,0.066,0.109,0.099
		c0.153,0.142,0.299,0.29,0.436,0.446c0.014,0.016,0.028,0.03,0.042,0.046c0.318,0.37,0.592,0.779,0.812,1.218
		c0.051,0.1,0.102,0.201,0.147,0.304c0.076,0.175,0.142,0.352,0.201,0.531c0.004,0.013,0.01,0.026,0.014,0.039
		c0.058,0.181,0.105,0.365,0.145,0.55c0.003,0.015,0.008,0.029,0.011,0.043c0.038,0.184,0.066,0.37,0.087,0.557
		c0.002,0.017,0.006,0.032,0.008,0.049c0.021,0.204,0.032,0.409,0.032,0.616c0,0.212-0.012,0.423-0.034,0.633
		c-0.003,0.031-0.01,0.06-0.014,0.091c-0.022,0.181-0.049,0.361-0.088,0.538c-0.004,0.02-0.011,0.039-0.015,0.059
		c-0.043,0.19-0.094,0.378-0.156,0.564c-0.003,0.008-0.006,0.016-0.009,0.024c-0.066,0.194-0.142,0.385-0.228,0.574
		C41.041,56.552,38.954,57.998,36.532,57.998z M49.532,54.998c-1.898,0-3.787-0.253-5.339-0.706
		c0.001-0.002,0.001-0.004,0.001-0.006c0.097-0.324,0.168-0.658,0.224-0.998c0.013-0.081,0.026-0.161,0.037-0.243
		c0.045-0.344,0.077-0.691,0.077-1.047c0-0.259-0.014-0.516-0.039-0.771c-0.009-0.092-0.025-0.181-0.037-0.272
		c-0.017-0.129-0.029-0.259-0.052-0.386c1.517,0.28,3.279,0.429,5.128,0.429c2.39,0,5.845-0.305,8.004-1.259l0.006,3.188
		C57.286,53.546,54.251,54.998,49.532,54.998z M49.532,42.998c-4.703,0-7.731-1.441-7.995-1.994c0.001-1.14,0.002-2.297,0.002-3.261
		c0.025,0.011,0.055,0.02,0.081,0.031c0.239,0.102,0.489,0.198,0.755,0.286c0.014,0.005,0.028,0.01,0.043,0.014
		c0.272,0.088,0.559,0.167,0.852,0.24c0.096,0.024,0.195,0.046,0.293,0.068c0.214,0.049,0.43,0.096,0.651,0.138
		c0.107,0.021,0.213,0.041,0.321,0.06c0.243,0.043,0.487,0.081,0.734,0.117c0.078,0.011,0.155,0.024,0.233,0.035
		c0.323,0.043,0.646,0.081,0.967,0.112c0.081,0.008,0.16,0.014,0.241,0.021c0.247,0.022,0.491,0.042,0.733,0.058
		c0.105,0.007,0.207,0.013,0.31,0.019c0.224,0.013,0.442,0.023,0.658,0.031c0.091,0.003,0.182,0.007,0.271,0.01
		c0.293,0.008,0.579,0.013,0.849,0.013c0.269,0,0.555-0.005,0.848-0.013c0.091-0.003,0.183-0.007,0.275-0.01
		c0.214-0.008,0.431-0.018,0.654-0.031c0.105-0.006,0.208-0.012,0.314-0.019c0.242-0.016,0.487-0.036,0.734-0.059
		c0.08-0.007,0.158-0.013,0.238-0.021c0.322-0.032,0.645-0.069,0.968-0.113c0.079-0.011,0.157-0.024,0.236-0.035
		c0.246-0.035,0.49-0.074,0.732-0.117c0.109-0.019,0.215-0.04,0.322-0.06c0.221-0.043,0.438-0.089,0.653-0.139
		c0.098-0.023,0.196-0.044,0.292-0.068c0.299-0.075,0.591-0.155,0.868-0.245c0.014-0.005,0.026-0.01,0.04-0.014
		c0.261-0.086,0.508-0.181,0.743-0.281c0.028-0.012,0.061-0.022,0.089-0.034l0.006,3.188C57.286,41.546,54.251,42.998,49.532,42.998
		z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Added htdocs/images/medical.svg.







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="59.288246mm"
   height="156.79028mm"
   viewBox="0 0 210.07646 555.55612"
   id="svg4307"
   version="1.1"
   inkscape:version="0.91 r13725"
   sodipodi:docname="Rod.svg">
  <defs
     id="defs4309" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="11.2"
     inkscape:cx="79.694514"
     inkscape:cy="96.528971"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     fit-margin-top="5"
     fit-margin-left="5"
     fit-margin-right="5"
     fit-margin-bottom="5"
     inkscape:window-width="1858"
     inkscape:window-height="1057"
     inkscape:window-x="54"
     inkscape:window-y="-8"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata4312">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(359.32394,85.41585)">
    <path
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
       d="m -284.24538,-67.520744 4.37009,95.541545 c -100.59945,12.150486 -68.23818,66.608038 2.86026,87.543349 0.35074,17.1719 1.63407,36.78464 2.15995,58.55928 -63.17037,26.21479 -59.59028,58.58165 2.99854,85.10176 0.43823,18.67659 1.97448,37.03661 2.50038,54.73955 -37.33375,13.18908 -27.50912,41.33012 1.66602,52.13476 0.35073,9.73665 0.70016,18.07476 1.05078,26.30664 -33.56176,12.66885 -7.39782,27.77955 0.38867,29.70118 -0.22463,21.30407 -0.32947,30.25045 0.0625,30.3164 5.32664,-0.90156 4.49826,-31.9765 5.28711,-51.0957 -1.63222,0.48322 -3.70065,1.21846 -5.28516,1.56836 0.0503,4.57295 0.0154,10.968 -0.0566,17.98828 -9.7023,-4.92972 -10.9772,-12.12672 -9.28851,-15.50028 3.9068,-7.80473 28.61798,-6.59722 31.85687,-23.50753 1.99997,-10.44187 -4.12017,-16.75089 -12.27148,-21.88477 -0.0879,4.95688 -0.12679,6.95072 -0.30218,11.64203 8.85491,7.45697 0.6575,15.82718 -4.55524,18.48492 0.61353,-16.19823 0.7458,-40.98801 1.35937,-61.96484 -3.24305,0.66787 -6.8237,1.906 -9.71602,3.08721 0.26294,5.6649 0.85531,17.31547 1.03047,22.80342 -7.83587,-3.33049 -12.81764,-8.40905 -12.63672,-16.03125 0.51162,-21.55436 52.51305,-12.75552 60.10325,-51.51339 2.6558,-13.56129 -15.64649,-27.80552 -31.33567,-36.03739 -0.17516,5.84197 -0.26221,10.34944 -0.4375,16.1914 26.38022,12.83316 15.0608,35.40466 -6.31445,44.03516 1.05179,-36.55659 2.10446,-74.17576 3.15625,-112.67969 -5.78488,2.56691 -12.49359,4.95848 -17.84023,7.52539 0.35074,11.50694 1.11934,22.9874 1.46992,34.75986 -14.37443,-7.25822 -24.73819,-14.04856 -21.58281,-25.73252 7.80086,-28.41204 99.09261,-28.07181 90.85352,-80.20703 -2.6295,-16.90632 -25.62905,-25.47599 -45.35017,-31.49497 l -0.79239,19.49693 c 35.13416,14.43175 16.4835,32.66662 -5.79492,41.48632 1.0518,-42.39864 2.81924,-83.737288 3.34515,-103.829788 -8.01543,-0.99432 -20.14851,-1.182736 -27.3341,0.140974 0.0879,5.04533 0.81734,18.85453 1.16797,35.05274 -100.06065,-43.68961 47.66698,-67.180987 67.89173,-24.387801 14.14236,3.5582 55.96461,-2.32022 38.32965,-15.06796 -21.58528,-15.90173 -53.06038,-27.221233 -79.41853,-27.605743 l 3.30126,-95.741862 z m 84.56501,113.915179 c 4.02307,0.037 12.22969,4.64953 11.35742,6.79101 -5.80406,4.33816 -12.56751,-1.11825 -12.7871,-6.50586 0.36526,-0.202 0.85496,-0.29044 1.42968,-0.28515 z"
       id="path4272-7"
       inkscape:connector-curvature="0"
       sodipodi:nodetypes="cccccccccccccssccccccsscccccccccccccccccccsccs" />
  </g>
</svg>

Added htdocs/images/mercury.svg.

















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://web.resource.org/cc/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="50"
   height="50"
   id="svg34864"
   sodipodi:version="0.32"
   inkscape:version="0.44"
   version="1.0"
   sodipodi:docbase="C:\Documents and Settings\Owner\Desktop\SVG work\Symbols"
   sodipodi:docname="Mercury symbol.svg">
  <defs
     id="defs34866" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     gridtolerance="10000"
     guidetolerance="10"
     objecttolerance="10"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="5.6"
     inkscape:cx="40.112546"
     inkscape:cy="23.612944"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     inkscape:window-width="853"
     inkscape:window-height="573"
     inkscape:window-x="110"
     inkscape:window-y="145" />
  <metadata
     id="metadata34869">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(-348.7552,-478.0905)">
    <path
       sodipodi:type="arc"
       style="opacity:1;color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:3.125;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
       id="path3058"
       sodipodi:cx="100.5"
       sodipodi:cy="36.5"
       sodipodi:rx="11.5"
       sodipodi:ry="11.5"
       d="M 112 36.5 A 11.5 11.5 0 1 1  89,36.5 A 11.5 11.5 0 1 1  112 36.5 z"
       transform="matrix(0.96,0,0,0.96,277.357,466.9525)" />
    <path
       sodipodi:type="arc"
       style="opacity:1;color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:3.70043731;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
       id="path3060"
       sodipodi:cx="100.5"
       sodipodi:cy="36.5"
       sodipodi:rx="11.5"
       sodipodi:ry="11.5"
       d="M 111.9469,37.603862 A 11.5,11.5 0 0 1 89.052015,37.592533"
       transform="matrix(0.810715,0,0,0.810715,292.4483,451.9429)"
       sodipodi:start="0.096136028"
       sodipodi:end="3.0464463"
       sodipodi:open="true" />
    <path
       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 373.83706,512.99267 L 373.83706,524.99267"
       id="path3062" />
    <path
       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="M 368.83706,519.99267 L 378.83706,519.99267"
       id="path3937" />
  </g>
</svg>

Added htdocs/images/palace.svg.



>
1
<svg height="464pt" viewBox="0 0 464 464" width="464pt" xmlns="http://www.w3.org/2000/svg"><path d="m288 384h32v16h-32zm0 0"/><path d="m288 416h16v16h-16zm0 0"/><path d="m144 336v-64h-80v64h16v-48h48v48zm0 0"/><path d="m288 272h16v64h-16zm0 0"/><path d="m352 304h16v32h-16zm0 0"/><path d="m48 384h32v16h-32zm0 0"/><path d="m48 448h32v16h-32zm0 0"/><path d="m0 448h32v16h-32zm0 0"/><path d="m96 304h16v32h-16zm0 0"/><path d="m0 384h32v16h-32zm0 0"/><path d="m0 416h48v16h-48zm0 0"/><path d="m414.289062 236.175781-2.226562-6.703125c-1.09375-3.273437-4.152344-5.472656-7.589844-5.472656h-344.945312c-3.449219 0-6.496094 2.191406-7.589844 5.472656l-2.234375 6.703125c-2.527344 7.601563-6.679687 14.320313-11.992187 19.832031h388.578124c-5.3125-5.511718-9.457031-12.230468-12-19.832031zm0 0"/><path d="m272 208v-64h-80v64h16v-48h48v48zm0 0"/><path d="m352 176h16v32h-16zm0 0"/><path d="m288 144h16v64h-16zm0 0"/><path d="m400 208v-64h-80v64h16v-48h48v48zm0 0"/><path d="m414.289062 108.175781-2.226562-6.703125c-1.09375-3.273437-4.152344-5.472656-7.589844-5.472656h-344.945312c-3.449219 0-6.496094 2.191406-7.589844 5.472656l-2.234375 6.703125c-2.527344 7.601563-6.679687 14.320313-11.992187 19.832031h388.578124c-5.3125-5.511718-9.457031-12.230468-12-19.832031zm0 0"/><path d="m392 80-11.9375-48.585938c6.847656-1.804687 11.9375-8 11.9375-15.414062 0-8.832031-7.167969-16-16-16s-16 7.167969-16 16c0 4.65625 2.023438 8.808594 5.199219 11.734375-24.710938 7.226563-71.839844 20.265625-133.199219 20.265625s-108.488281-13.046875-133.199219-20.265625c3.175781-2.925781 5.199219-7.078125 5.199219-11.734375 0-8.832031-7.167969-16-16-16s-16 7.167969-16 16c0 7.414062 5.089844 13.601562 11.9375 15.414062l-11.9375 48.585938zm0 0"/><path d="m400 336v-64h-80v64h16v-48h48v48zm0 0"/><path d="m64 416h32v16h-32zm0 0"/><path d="m96 176h16v32h-16zm0 0"/><path d="m224 176h16v32h-16zm0 0"/><path d="m144 208v-64h-80v64h16v-48h48v48zm0 0"/><path d="m160 144h16v64h-16zm0 0"/><path d="m224 304h16v48h-16zm0 0"/><path d="m368 416h32v16h-32zm0 0"/><path d="m288 448h32v16h-32zm0 0"/><path d="m336 384h32v16h-32zm0 0"/><path d="m320 416h32v16h-32zm0 0"/><path d="m96 448h32v16h-32zm0 0"/><path d="m336 448h32v16h-32zm0 0"/><path d="m288 352h176v16h-176zm0 0"/><path d="m432 384h32v16h-32zm0 0"/><path d="m384 448h32v16h-32zm0 0"/><path d="m416 416h48v16h-48zm0 0"/><path d="m432 448h32v16h-32zm0 0"/><path d="m384 384h32v16h-32zm0 0"/><path d="m144 384h32v16h-32zm0 0"/><path d="m144 448h32v16h-32zm0 0"/><path d="m160 416h16v16h-16zm0 0"/><path d="m96 384h32v16h-32zm0 0"/><path d="m112 416h32v16h-32zm0 0"/><path d="m0 352h176v16h-176zm0 0"/><path d="m192 368h80v16h-80zm0 0"/><path d="m192 400h80v16h-80zm0 0"/><path d="m160 272h16v64h-16zm0 0"/><path d="m192 336v16h16v-64h48v64h16v-80h-80zm0 0"/><path d="m192 432h80v16h-80zm0 0"/></svg>

Added htdocs/images/rain.svg.







>
>
>
1
2
3
<svg class="svg-icon" viewBox="0 0 20 20">
<path fill="none" d="M16.903,5.793c0.001-0.037,0.006-0.074,0.006-0.111c0-1.431-1.161-2.591-2.591-2.591c-0.653,0-1.248,0.244-1.704,0.642c-0.922-1.424-2.518-2.369-4.342-2.369c-2.601,0-4.748,1.918-5.119,4.415C1.633,6.141,0.5,7.504,0.5,9.136c0,1.908,1.546,3.455,3.455,3.455h12.09c1.908,0,3.455-1.547,3.455-3.455C19.5,7.525,18.395,6.176,16.903,5.793 M16.045,11.728H3.955c-1.429,0-2.591-1.162-2.591-2.591c0-1.203,0.818-2.239,1.99-2.518c0.343-0.081,0.603-0.364,0.654-0.712C4.32,3.809,6.153,2.228,8.272,2.228c1.464,0,2.385,0.306,3.186,1.543c0.136,0.21,0.789,0.783,1.037,0.817c0.04,0.006,0.119,0.008,0.119,0.008c0.208,0,0.41-0.074,0.568-0.213c0.315-0.276,0.72-0.429,1.136-0.429c0.952,0,1.727,0.775,1.726,1.736l-0.003,0.063c-0.02,0.409,0.252,0.774,0.648,0.876c1.146,0.294,1.947,1.324,1.947,2.506C18.637,10.565,17.475,11.728,16.045,11.728 M9.136,15.182c0,0.477,0.387,0.863,0.864,0.863c0.477,0,0.864-0.387,0.864-0.863c0-0.863-0.864-1.727-0.864-1.727S9.136,14.318,9.136,15.182 M4.818,17.772c0,0.478,0.387,0.864,0.863,0.864c0.477,0,0.864-0.387,0.864-0.864c0-0.863-0.864-1.728-0.864-1.728S4.818,16.909,4.818,17.772M13.454,16.909c0,0.477,0.388,0.863,0.864,0.863s0.863-0.387,0.863-0.863c0-0.864-0.863-1.728-0.863-1.728S13.454,16.045,13.454,16.909"></path>
</svg>

Added htdocs/images/road.svg.

















































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve">
<g>
	<g>
		<path d="M299.29,1.087c-19.788,0-35.886,16.099-35.886,35.887c0,19.787,16.099,35.886,35.886,35.886
			c19.789,0,35.887-16.099,35.887-35.886C335.177,17.186,319.078,1.087,299.29,1.087z M299.29,57.652
			c-11.403,0-20.679-9.277-20.679-20.679c0-11.403,9.276-20.68,20.679-20.68c11.403,0,20.68,9.277,20.68,20.68
			C319.969,48.376,310.692,57.652,299.29,57.652z"/>
	</g>
</g>
<g>
	<g>
		<path d="M443.991,233.136c-4.2,0-7.604,3.405-7.604,7.604v22.731c0,4.959-3.944,9.003-8.858,9.189v-78.555
			c0-4.199-3.404-7.604-7.604-7.604c-4.2,0-7.604,3.405-7.604,7.604v40.047h-1.199c-5.076,0-9.206-4.129-9.206-9.206v-15.634
			c0-4.199-3.404-7.604-7.604-7.604c-4.2,0-7.604,3.404-7.604,7.604v15.634c0,13.462,10.953,24.414,24.414,24.414h1.199v53.224
			c0,4.199,3.404,7.604,7.604,7.604c4.2,0,7.604-3.405,7.604-7.604v-14.708c13.301-0.188,24.066-11.059,24.066-24.404v-22.731
			C451.595,236.54,448.191,233.136,443.991,233.136z"/>
	</g>
</g>
<g>
	<g>
		<path d="M123.795,334.928c-4.2,0-7.604,3.404-7.604,7.604v16.998c0,6.081-3.788,11.284-9.124,13.403v-18.236
			c0-4.199-3.404-7.604-7.604-7.604s-7.604,3.404-7.604,7.604v26.862c0,10.343-8.415,18.758-18.758,18.758h-1.01h-5.92
			c-8.475,0-15.37-6.895-15.37-15.37v-9.262c13.742-1.999,24.331-13.856,24.331-28.144v-26.3c0-4.199-3.404-7.604-7.604-7.604
			s-7.604,3.405-7.604,7.604v26.3c0,7.299-5.938,13.238-13.238,13.238h-3.49h-0.87c-8.743,0-15.858-7.114-15.858-15.858v-13.035
			c0-4.199-3.404-7.604-7.604-7.604c-4.2,0-7.604,3.405-7.604,7.604v13.035c0,14.817,10.428,27.246,24.331,30.33v9.695
			c0,16.296,12.813,29.652,28.894,30.529v38.065c0,4.199,3.404,7.604,7.604,7.604s7.604-3.405,7.604-7.604v-38.659
			c13.227-2.613,23.715-12.931,26.586-26.064c14.203-2.181,25.117-14.484,25.117-29.289v-16.998
			C131.398,338.333,127.995,334.928,123.795,334.928z"/>
	</g>
</g>
<g>
	<g>
		<path d="M504.392,147.419H396.929c-4.2,0-7.604,3.404-7.604,7.604s3.404,7.604,7.604,7.604h107.463c4.2,0,7.604-3.404,7.604-7.604
			S508.592,147.419,504.392,147.419z"/>
	</g>
</g>
<g>
	<g>
		<path d="M405.125,500.817L287.93,162.627h83.65c4.2,0,7.604-3.404,7.604-7.604s-3.404-7.604-7.604-7.604H7.604
			c-4.2,0-7.604,3.404-7.604,7.604s3.404,7.604,7.604,7.604h216.463l-82.421,237.844c-1.374,3.968,0.728,8.299,4.695,9.674
			c3.969,1.376,8.299-0.727,9.675-4.695l84.147-242.823h31.672l118.92,343.17c1.09,3.144,4.034,5.116,7.185,5.116
			c0.825,0,1.666-0.136,2.49-0.422C404.397,509.117,406.498,504.785,405.125,500.817z"/>
	</g>
</g>
<g>
	<g>
		<path d="M142.693,420.672c-3.973-1.375-8.3,0.727-9.675,4.695l-26.146,75.451c-1.374,3.968,0.728,8.299,4.695,9.674
			c0.824,0.286,1.665,0.422,2.49,0.422c3.15,0,6.095-1.973,7.185-5.116l26.146-75.451
			C148.762,426.379,146.66,422.047,142.693,420.672z"/>
	</g>
</g>
<g>
	<g>
		<path d="M275.655,273.597l-2.829-42.237c-0.268-3.994-3.585-7.096-7.587-7.096h-18.483c-4.004,0-7.322,3.102-7.59,7.096
			l-2.828,42.237c-0.141,2.1,0.596,4.165,2.034,5.702c1.438,1.538,3.448,2.41,5.554,2.41h24.14c2.105,0,4.116-0.873,5.554-2.41
			C275.058,277.762,275.795,275.697,275.655,273.597z M252.056,266.501l1.81-27.029h4.259l1.81,27.029H252.056z"/>
	</g>
</g>
<g>
	<g>
		<path d="M282.173,370.917l-4.826-72.136c-0.268-3.994-3.584-7.097-7.587-7.097h-27.516c-4.003,0-7.32,3.103-7.587,7.097
			l-4.828,72.136c-0.141,2.1,0.596,4.164,2.034,5.702c1.438,1.538,3.448,2.41,5.554,2.41h37.168c2.105,0,4.116-0.872,5.554-2.41
			C281.576,375.082,282.314,373.018,282.173,370.917z M245.546,363.821l3.809-56.928h13.292l3.808,56.928H245.546z"/>
	</g>
</g>
<g>
	<g>
		<path d="M291.002,502.8l-6.59-98.426c-0.268-3.994-3.585-7.096-7.587-7.096h-41.649c-4.002,0-7.32,3.102-7.587,7.096L221,502.799
			c-0.28,4.19,2.889,7.815,7.079,8.095c4.186,0.277,7.815-2.888,8.095-7.079l6.115-91.329h27.426l6.115,91.329
			c0.27,4.017,3.612,7.097,7.58,7.097c0.171,0,0.343-0.006,0.516-0.017C288.114,510.614,291.283,506.99,291.002,502.8z"/>
	</g>
</g>
<g>
	<g>
		<path d="M511.027,65.505c-2.055-3.661-6.692-4.964-10.352-2.909c-5.907,3.315-11.553,6.793-17.012,10.156
			c-29.716,18.302-57.783,35.589-134.862,35.589c-101.65,0-142.731-12.536-169.917-20.832c-14.746-4.5-26.393-8.053-41.463-8.053
			c-20.795,0-40.475,6.374-61.311,13.121C54.491,99.579,32.134,106.82,7.607,106.82c-4.2,0-7.604,3.405-7.604,7.604
			c0,4.199,3.404,7.604,7.604,7.604c26.929,0,50.446-7.617,73.189-14.983c19.661-6.367,38.231-12.381,56.625-12.381
			c12.801,0,22.961,3.1,37.024,7.392c28.049,8.559,70.437,21.494,174.355,21.494c81.386,0,112.626-19.241,142.837-37.848
			c5.577-3.435,10.844-6.679,16.481-9.844C511.78,73.802,513.082,69.167,511.027,65.505z"/>
	</g>
</g>
<g>
	<g>
		<path d="M255.998,172.768c-4.2,0-7.604,3.405-7.604,7.604v21.419c0,4.199,3.403,7.604,7.604,7.604c4.2,0,7.604-3.405,7.604-7.604
			v-21.419C263.602,176.172,260.198,172.768,255.998,172.768z"/>
	</g>
</g>
<g>
	<g>
		<path d="M443.686,423.3c-5.104,4.555-1.793,13.284,5.051,13.284c3.73,0.001,6.963-2.803,7.519-6.486
			C457.288,423.24,448.869,418.674,443.686,423.3z"/>
	</g>
</g>
<g>
	<g>
		<path d="M468.449,420.268c-2.513,1.958-3.514,5.359-2.535,8.377c0.999,3.077,3.982,5.223,7.216,5.223
			c3.583,0,6.747-2.622,7.452-6.124C481.94,420.983,473.885,416.033,468.449,420.268z"/>
	</g>
</g>
<g>
	<g>
		<path d="M456.089,443.876c-2.535,2.009-3.525,5.486-2.445,8.533c1.06,2.992,3.983,5.042,7.157,5.042
			c3.529,0,6.621-2.513,7.409-5.934C469.782,444.695,461.573,439.528,456.089,443.876z"/>
	</g>
</g>
<g>
	<g>
		<path d="M41.119,254.604c-2.836-1.695-6.561-1.327-9.012,0.886c-5.053,4.563-1.686,13.242,5.107,13.242
			c3.523,0,6.64-2.521,7.418-5.942C45.352,259.63,43.895,256.264,41.119,254.604z"/>
	</g>
</g>
<g>
	<g>
		<path d="M57.825,273.071c-2.82-1.875-6.619-1.635-9.189,0.567c-5.24,4.491-1.916,13.353,4.971,13.353
			c3.614,0,6.798-2.649,7.468-6.193C61.635,277.843,60.33,274.737,57.825,273.071z"/>
	</g>
</g>
<g>
	<g>
		<path d="M31.956,277.096c-2.679-2.116-6.574-2.15-9.293-0.09c-2.574,1.95-3.627,5.374-2.631,8.441
			c0.999,3.075,3.981,5.223,7.216,5.223c3.455,0,6.525-2.421,7.376-5.761C35.353,282.048,34.267,278.923,31.956,277.096z"/>
	</g>
</g>
<g>
	<g>
		<path d="M161.568,224.286c-0.594-4.158-4.453-7.044-8.603-6.452c-5.703,0.815-13.808,3.415-20.772,8.507
			c-2.098-10.759-6.646-22.653-16.032-32.041c-2.97-2.97-7.783-2.97-10.754,0c-2.97,2.97-2.97,7.784,0,10.753
			c5.501,5.501,8.771,12.423,10.682,19.269c-6.193-3.776-12.855-5.79-17.749-6.49c-4.151-0.589-7.973,2.282-8.583,6.424
			c-0.609,4.143,2.26,8,6.4,8.628c0.894,0.135,21.89,3.514,21.89,20.865c0,3.982,3.072,7.29,7.043,7.583
			c0.191,0.014,0.379,0.021,0.568,0.021c3.735,0,6.957-2.736,7.515-6.488c0.048-0.325,0.313-2.198,0.494-5.164
			c2.937-13.82,20.597-16.685,21.474-16.818C159.284,232.278,162.16,228.433,161.568,224.286z"/>
	</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Added htdocs/images/satan.svg.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="400pt" height="355pt" viewBox="0 0 400 355" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#fefefe" stroke="#fefefe" stroke-width="0.09375" d=" M 0.0 0.0 L 400.0 0.0 L 400.0 355.0 L 0.0 355.0 L 0.0 0.0 Z" />
<path fill="#010101" stroke="#010101" stroke-width="0.09375" d=" M 178.7 36.7 C 184.0 35.4 188.3 39.5 192.8 41.5 C 199.2 44.6 203.9 50.5 206.5 57.0 C 209.1 61.6 210.8 67.3 208.5 72.4 C 205.3 79.7 201.9 87.1 198.4 94.3 C 193.7 103.9 183.6 109.1 178.6 118.4 C 176.6 122.1 173.1 125.4 173.4 129.9 C 173.5 137.6 173.4 145.4 173.4 153.1 C 173.3 156.7 175.5 159.6 177.0 162.6 C 180.7 171.2 187.9 178.1 196.2 182.1 C 203.3 182.9 211.0 183.4 217.5 179.9 C 224.1 177.5 230.6 174.8 237.1 172.1 C 240.3 170.8 242.0 167.6 244.1 165.1 C 250.1 157.8 255.3 148.7 254.6 138.9 C 254.9 131.1 248.1 123.3 240.1 123.5 C 234.7 123.4 229.3 123.3 224.0 123.6 C 217.7 124.0 212.4 127.9 208.2 132.3 C 205.3 135.5 201.5 138.6 201.0 143.2 C 200.3 145.8 200.8 150.5 197.0 150.5 C 193.0 149.8 189.7 146.7 187.4 143.5 C 183.9 138.2 185.8 131.8 186.7 126.1 C 187.4 120.0 191.3 114.7 196.0 110.9 C 199.7 109.1 204.0 109.1 207.7 107.5 C 213.4 105.1 219.6 104.6 225.5 103.0 C 228.8 102.0 232.2 103.3 235.4 103.9 C 240.1 105.0 245.0 105.2 249.1 107.7 C 256.4 112.3 263.6 117.4 268.4 124.6 C 273.3 129.9 275.5 137.3 274.1 144.3 C 272.2 153.3 275.6 163.0 271.3 171.4 C 269.3 175.4 268.7 180.2 265.6 183.6 C 262.9 186.6 259.9 189.3 257.5 192.6 C 255.4 195.3 253.9 198.7 250.8 200.5 C 247.2 202.6 243.6 205.6 239.1 205.4 C 228.1 205.5 217.1 205.5 206.1 205.4 C 200.1 205.5 194.8 202.6 189.6 200.0 C 185.0 197.5 181.7 193.3 177.2 190.6 C 174.0 188.4 169.9 186.9 168.1 183.2 C 163.7 175.1 156.0 169.5 151.9 161.3 C 150.0 157.9 150.5 153.8 150.5 150.0 C 150.6 138.8 150.2 127.5 150.7 116.3 C 152.5 111.9 157.4 109.9 160.6 106.6 C 168.2 98.8 174.3 89.5 179.2 79.9 C 181.5 75.4 186.0 71.6 185.8 66.1 C 185.8 63.1 186.2 60.0 185.4 57.1 C 182.8 53.0 178.4 50.3 176.2 45.9 C 174.6 42.8 175.8 38.5 178.7 36.7 Z" />
<path fill="#010101" stroke="#010101" stroke-width="0.09375" d=" M 301.0 114.5 C 303.2 114.6 305.5 114.2 307.7 114.9 C 313.6 117.8 319.0 121.9 322.6 127.5 C 325.7 132.1 330.6 136.7 329.3 142.8 C 328.4 148.0 327.8 153.4 325.2 158.1 C 322.5 163.3 320.1 168.9 316.6 173.7 C 311.8 179.5 306.1 184.5 301.4 190.3 C 295.8 197.6 290.2 205.1 287.0 213.9 C 285.7 217.7 283.7 221.3 282.6 225.2 C 281.7 229.9 284.0 234.3 285.3 238.7 C 286.6 242.9 286.9 247.6 289.9 251.1 C 293.8 256.0 298.8 260.2 304.5 263.0 C 307.4 264.5 310.5 262.6 313.3 261.6 C 324.6 257.2 335.3 250.6 343.3 241.3 C 346.1 238.2 346.7 234.0 346.6 230.0 C 346.6 223.1 344.8 215.3 338.9 211.0 C 334.2 209.6 329.3 209.3 324.6 207.9 C 321.6 206.7 318.8 208.9 316.5 210.6 C 311.4 214.7 310.6 222.1 305.5 226.3 C 301.5 229.7 297.5 233.1 294.0 236.9 C 293.1 236.5 292.3 236.0 291.5 235.4 C 291.7 230.8 290.8 226.0 292.8 221.7 C 295.0 217.2 295.7 212.0 299.1 208.2 C 302.9 203.6 307.9 200.2 312.1 196.0 C 313.9 194.4 315.7 192.3 318.2 191.7 C 322.7 191.2 327.2 191.8 331.7 191.0 C 337.3 190.0 343.0 191.3 348.7 192.0 C 353.0 192.6 355.9 196.2 358.5 199.3 C 361.7 203.2 365.4 206.6 369.0 210.0 C 371.2 212.2 373.6 214.7 373.4 218.0 C 373.6 227.0 373.4 236.1 373.5 245.1 C 373.7 250.4 370.3 254.8 368.3 259.4 C 365.3 266.0 359.5 270.7 356.1 277.0 C 354.9 279.0 354.0 281.5 351.6 282.4 C 346.3 284.9 341.0 287.6 335.7 290.0 C 331.5 291.8 327.1 290.0 323.1 288.7 C 317.6 286.8 311.7 287.8 305.9 287.5 C 301.3 287.5 297.3 284.7 293.4 282.5 C 288.4 279.2 283.3 276.1 278.8 272.1 C 274.3 268.1 272.1 262.3 267.9 258.1 C 266.5 256.4 264.5 255.0 263.8 252.8 C 263.3 248.9 263.9 245.0 263.2 241.1 C 262.2 237.4 259.4 234.2 259.5 230.1 C 259.4 224.1 259.5 218.0 259.5 211.9 C 259.1 206.2 262.6 201.4 263.8 196.0 C 264.5 192.5 267.3 190.1 269.5 187.4 C 272.1 184.3 273.7 180.5 276.4 177.4 C 280.9 172.2 285.4 166.9 291.5 163.5 C 297.2 160.3 300.3 154.3 303.9 149.1 C 307.0 143.4 310.7 137.2 309.3 130.4 C 308.0 127.1 305.0 124.8 302.9 122.0 C 301.0 120.0 301.5 117.0 301.0 114.5 Z" />
<path fill="#010101" stroke="#010101" stroke-width="0.09375" d=" M 80.0 144.9 C 76.9 143.3 76.4 137.9 80.2 136.8 C 85.2 135.7 89.8 138.7 94.2 140.8 C 100.7 143.9 106.2 148.8 113.0 151.3 C 117.1 153.4 123.0 155.4 123.3 160.9 C 123.6 166.3 123.7 171.7 123.2 177.1 C 121.5 183.7 116.5 189.1 111.3 193.3 C 102.7 200.3 95.8 209.2 87.1 216.1 C 83.6 219.0 79.6 221.4 77.3 225.4 C 74.1 229.8 73.1 235.2 71.0 240.1 C 69.9 243.0 68.5 245.9 68.5 249.0 C 68.3 251.6 70.1 253.6 71.3 255.7 C 74.6 260.3 74.6 266.4 78.1 270.9 C 81.3 274.9 84.5 279.2 88.8 282.1 C 92.8 283.0 97.0 282.5 101.1 282.5 C 104.5 282.7 107.5 281.0 110.4 279.7 C 114.6 277.7 119.6 278.3 123.5 275.5 C 131.2 270.8 135.8 262.7 139.8 254.8 C 142.1 250.6 141.6 245.6 141.4 240.9 C 140.9 232.9 134.5 225.5 126.8 223.6 C 123.9 225.0 121.6 227.3 118.8 228.9 C 114.8 231.6 110.0 233.0 106.9 236.8 C 103.1 241.2 102.0 247.1 98.7 251.7 C 92.7 251.2 88.3 246.1 82.5 244.5 C 83.1 239.1 81.3 233.2 84.6 228.4 C 86.9 223.9 91.8 222.2 96.1 220.3 C 100.5 218.6 105.3 218.1 109.7 216.0 C 114.1 213.7 119.2 214.6 124.0 214.5 C 130.0 214.6 136.3 213.6 141.9 216.3 C 146.5 218.4 152.1 218.4 156.1 221.9 C 160.4 225.5 164.4 229.6 167.5 234.3 C 169.9 238.1 169.1 242.7 169.8 246.9 C 170.8 250.6 173.4 253.9 173.4 257.9 C 173.6 263.0 173.9 268.3 171.8 273.1 C 169.8 277.8 167.7 282.5 164.4 286.4 C 160.2 291.2 155.3 295.5 150.1 299.1 C 147.5 301.0 144.1 301.0 141.0 301.6 C 135.9 302.4 131.4 305.9 126.1 305.5 C 118.5 305.3 110.8 305.9 103.2 305.2 C 94.0 302.8 85.4 298.8 76.7 294.9 C 70.7 291.5 65.3 286.8 61.1 281.2 C 57.1 274.8 53.4 268.1 49.8 261.4 C 47.0 256.1 44.5 250.2 44.6 244.1 C 45.4 237.6 49.8 232.4 51.9 226.4 C 54.6 219.9 53.6 212.4 57.5 206.4 C 62.0 199.1 68.9 193.8 74.6 187.5 C 79.4 182.1 85.3 177.6 89.8 171.9 C 92.6 165.8 96.1 159.6 95.8 152.7 C 90.2 150.8 85.0 148.0 80.0 144.9 Z" />
</svg>

Added htdocs/images/vendor.svg.























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 484.656 484.656" style="enable-background:new 0 0 484.656 484.656;" xml:space="preserve">
<g>
	<path d="M451.074,438.034h-9.837V195.806h-0.008c-12.084,0-23.525-3.944-33.045-10.585c-6.411,4.508-13.791,7.84-21.954,9.467
		c-3.746,0.746-7.553,1.118-11.322,1.118c-2.499,0-4.943-0.278-7.371-0.595v180.184c0,10.282-8.339,18.62-18.629,18.62h-66.923
		v-51.032l23.595,39.378c2.785,4.657,7.72,7.236,12.782,7.236c2.595,0,5.237-0.683,7.634-2.119
		c7.045-4.228,9.338-13.362,5.108-20.414l-47.429-79.167c-2.936-4.912-8.268-7.339-13.607-7.037
		c-0.357-0.033-54.953-0.041-55.286-0.017c-5.411-0.372-10.822,2.079-13.805,7.054l-47.43,79.167
		c-4.229,7.052-1.937,16.186,5.109,20.414c2.397,1.436,5.039,2.119,7.634,2.119c5.062,0,9.997-2.579,12.782-7.236l23.746-39.631
		v51.285h-67.066c-10.291,0-18.629-8.337-18.629-18.62V195.211c-2.427,0.317-4.872,0.595-7.371,0.595
		c-3.745,0-7.554-0.372-11.361-1.126c-8.157-1.626-15.52-4.951-21.923-9.459c-9.52,6.641-20.953,10.585-33.038,10.585h-0.008
		v242.228h-9.837c-12.877,0-23.311,10.433-23.311,23.311c0,12.877,10.434,23.311,23.311,23.311h417.492
		c12.878,0,23.311-10.434,23.311-23.311C474.385,448.467,463.952,438.034,451.074,438.034z"/>
	<path d="M242.321,197.226c-17.115,0-31.007,15.877-31.007,35.474c0,19.581,13.892,35.473,31.007,35.473
		c17.13,0,31.015-15.892,31.015-35.473C273.335,213.103,259.451,197.226,242.321,197.226z"/>
	<path d="M33.938,169.553c3.167,0.936,6.356,1.387,9.506,1.387c14.265,0,27.453-9.29,31.744-23.666l1.745-5.832
		c1.563,13.973,11.798,25.968,26.318,28.857c2.181,0.436,4.363,0.642,6.506,0.642c15.495,0,29.34-10.916,32.482-26.682l0.809-4.054
		c1.143,15.78,13.409,28.952,29.689,30.57c1.12,0.11,2.23,0.158,3.333,0.158c16.821,0,31.237-12.757,32.943-29.863l0.246-2.46
		c0.452,17.923,15.044,32.323,33.07,32.323c18.025,0,32.617-14.4,33.069-32.323l0.245,2.46
		c1.707,17.106,16.123,29.863,32.944,29.863c1.103,0,2.213-0.047,3.332-0.158c16.28-1.618,28.555-14.79,29.689-30.57l0.809,4.054
		c3.143,15.773,16.987,26.682,32.481,26.682c2.144,0,4.326-0.206,6.507-0.642c14.52-2.889,24.764-14.884,26.318-28.857l1.745,5.832
		c4.292,14.377,17.479,23.666,31.744,23.666c3.149,0,6.339-0.452,9.506-1.387c17.549-5.246,27.515-23.716,22.279-41.25
		L443.076,28.158C438.086,11.449,422.718,0,405.279,0H79.377C61.938,0,46.57,11.449,41.58,28.158L11.659,128.303
		C6.423,145.837,16.389,164.307,33.938,169.553z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Added htdocs/images/vitruvian-man-black-silhouette.svg.

































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="-0.4 -30.8 768 798.8" enable-background="new -0.4 -30.8 768 798.8" xml:space="preserve">
<path fill="#000000"     d="M767.4,368.1
	c0-52.9-10.9-104.2-30.8-152.4c-9.9-24.1-22.3-46.9-37.1-68.4v-31.5h-23.1c-6.6-8.5-13.5-16.4-20.7-23.9
	c-35-36-75.8-64.6-121.2-84.3c-47-20.4-97-31-148.4-31S284.7-13.1,237.6,7.3C192.2,27.1,151.4,56.1,116.4,92
	c-7.2,7.4-14.1,15.3-20.7,23.8H65.1V154c-11.7,19.4-22.3,40-31.2,61.6C14.1,264,4.4,315.2,4.4,368.1s9.5,104.2,29.4,152.4
	c8.9,21.6,19.7,42.2,31.4,61.6V764h634.4V588.9c14.9-21.4,27.2-44.2,37.1-68.4C756.5,472.3,767.4,421,767.4,368.1z M695.2,120.1v21
	c-5.3-7.7-9.4-14.6-15.3-21H695.2z M466.1,746.7c-7.2-0.7-19.4-4.8-19.4-4.8c-2.6-1.8-24.6-14.7-24.6-14.7l-4-8.8
	c-4.8-8.1-2.9-38.5-2.9-38.5c2.2-11.4-1.5-44.8-1.5-44.8c-2.2-18,0-29.4,0-29.4c2.2-2.2,5.9-16.9,5.9-16.9c4-3.3,2.6-27.9,2.6-27.9
	c2.9-2.9,11-38.2,11-38.2c0,5.9,25.3,47.7,25.3,47.7c-1.8,2.9,7.7,27.9,7.7,27.9c2.2,30.1,22.8,39.6,22.8,39.6
	c4,19.1,19.1,33.8,19.1,33.8c6.6,7,14.7,18,14.7,18c1.5,3.3,5.5,12.5,5.5,12.5c0,6.2,2.9,15.4,2.9,15.4c1.9,2.9,4,4.5,6.1,5.3
	C514.6,733.2,490.8,741.2,466.1,746.7z M675.2,120.6c-2,0-4.2,0-4.2,0c-0.4-1.8-18.4,2-18.4,2c-2.9,4.4-12.8,7.2-12.8,7.2
	c-8.8,2.6-14,15-14,15c-7,0.7-19.1,7.7-19.1,7.7c-7.3,3.7-20.2,6.6-20.2,6.6c-33.5,2.4-59.5,27.5-59.5,27.5
	c-23.5,2.2-42.2,14.3-42.2,14.3c-29-9.9-41.1,3.6-41.1,3.6c-6.9,0.3-19.1,8-19.1,8l-4.9-2.8c3.8-1,8.3-8.3,8.3-8.3
	c5.6-1.4,6.6-14.2,6.6-14.2c5.6-3.1,3.9-12.2,3.9-12.2c6.3-8.7-2.2-12.7-2.2-12.7c5.9-13-2.1-12.7-2.1-12.7
	c-1.4-12.2-10.1-12.2-10.1-12.2c-0.3-15.3-10.8-16.2-10.8-16.2c-0.7-0.8-1.6-1.2-2.6-1.2h263.3C674.6,120.1,674.9,120.1,675.2,120.6
	z M356.6,123.7c-8,2.4-9.7,12.4-9.7,12.4c-10.8-4.5-11.8,10.6-11.8,10.6c-6.9,4.2-1.4,14.5-1.4,14.5c-3.5,4.5,1.7,11.1,1.7,11.1
	c-6.3,6.9,0.7,15.6,0.7,15.6c-1.7,3.5,4.5,8,4.5,8c-1.7,4.2,6.3,11.8,6.3,11.8l-2.4,2.1l-4.2-2.8c-26.4-14.9-49.3-7.3-49.3-7.3
	c-8.7-8-49.3-17.4-49.3-17.4c-13.2-18.4-73.6-29.5-73.6-29.5c-15.3-5.2-23.3-10.1-23.3-10.1c-3.8-9-12.8-14.2-12.8-14.2l-5.2-7.5
	c-0.6-0.6-1.2-0.9-1.9-0.9h237.4C358.4,122.2,356.6,123.7,356.6,123.7z M111.7,120.1c3,2.1,8.6,3.7,8.6,3.7v4.7
	c-3.2-2.8-11.2-6.3-16.5-8.4H111.7z M96.5,119.3c1.2,3.8,13.1,11.6,13.1,11.6c-2.4-0.3-14.7-4.5-14.7-4.5c0.7,6.5,5.7,8,5.7,8
	c6.3,1.7,15,11.1,15,11.1l-8-2.4c-5.6-3.8-10.1-4.5-10.1-4.5c0.3,7.6,20.3,13.9,20.3,13.9c13.2,14.3,23.1,12.5,23.1,12.5
	c2.9,2.9,26.8,13.9,26.8,13.9c29.7,25,67.1,27.6,67.1,27.6c7.7,7,44,20.2,44,20.2s12.5,2.6-1.5,0s-34.1,2-34.1,2
	c-10.3,2.9-17.2-2-17.2-2c-22.4-6.6-63.9-1.8-63.9-1.8c-4.8,1.1-31.2-1.5-31.2-1.5c-6.2-5.5-17.3-8.1-17.3-8.1l-5.9-1.8
	c-4.8-4-11.4-2.2-11.4-2.2c-8.8-0.4-12.1,0.7-12.1,0.7c-0.7,7,13.2,4.4,13.2,4.4l5.5,2.6c-8.4,0.4-10.3,1.8-10.3,1.8l-6.2-0.4
	c-4.8,0-15,3.7-15,3.7c-0.7,4,9.8,3.3,9.8,3.3c15.1,0.4,15.1,3.3,15.1,3.3l-11.4,0.7c-10.3,0-11.4,1.5-11.4,1.5
	c-0.4,5.5,27.2,5.5,27.2,5.5l-11.4,1.5c-6.2-0.4-8.1,2.2-8.1,2.2c-0.4,4.8,23.9,1.8,23.9,1.8l9.9,2.6c5.5,2.6,22.8,0,22.8,0
	c8.8-1.5,25.3,2.9,25.3,2.9c41.1,11,65.3,2.6,65.3,2.6c8.4,4.8,37.1,1.8,37.1,1.8c9.2,5.5,30.8,4.8,30.8,4.8
	c13.2-2.6,19.8,4.8,19.8,4.8c0.4,8.4,9.5,21.7,9.5,21.7c0.4,21.7,14.3,52.1,14.3,52.1c-1.8,0-4,14.7-4,14.7
	c-4.4,8.8-2.6,20.2-2.6,20.2c-2.6,0.4-5.9,19.8-5.9,19.8c-1.8,3.7-5.1,20.6-5.1,20.6c-7,6.2-23.1,43.3-23.1,43.3l-8.1,23.5
	c-4.4,7.7-7,34.1-7,34.1c-7.3,6.6-18.7,28.3-18.7,28.3l-21.7,23.1c-16.5,13.6-22.8,44.8-22.8,44.8c-1.8,4.4-10.6,48.8-10.6,48.8
	c0,4.4-9.9,21.7-9.9,21.7c-2.9,1.5-11.4,7.7-11.4,7.7c-6.5-1.2-9.8,2.1-10.9,4.3C135.5,662.8,98,624.9,69.4,580.6v-425
	C77.8,142.9,87.1,130.8,96.5,119.3z M214.4,712.6c7.7-0.4,5.7-13.2,5.7-13.2s-2-7.3,1.6-9.9c3.7-2.6,5.5-14.3,5.5-14.3
	c0.7-8.1,7-18.7,7-18.7c4.8-7,17.3-28.6,17.3-28.6c12.1-8.4,20.2-34.9,20.2-34.9c3.7-15.4,15.1-29.4,15.1-29.4
	c9.5-5.5,21.3-23.1,21.3-23.1c4.8-4.4,11.4-15.8,11.4-15.8c2.6-6.6,8.8-21.7,7.7-15.1c-0.1,0.4-0.1,0.9-0.1,1.5
	c0.1,9.2,8.9,40.4,8.9,40.4c-4.8,5.9-6.6,40-6.6,40l-5.9,25.3c-5.9,29.4,8.1,60.2,8.1,60.2c-2.2,7.3,18,44,18,44
	c-0.7,4-0.4,15.8-0.4,15.8c-5.9,4.4-1.5,11-1.5,11c-0.6,3,4.6,5.5,6.6,6.3c-50.4-4.4-98.1-19-140.9-41.8
	C214,712.5,214.4,712.6,214.4,712.6z M389.8,755.5c0.9-9.6-8.1-11.3-8.1-11.3l-5.5-11c-0.4-7-3.7-12.8-3.7-12.8
	c-5.1-5.9-6.6-20.2-6.6-20.2c0.4-10.6-2.9-26.1-2.9-26.1l-0.4-10.3c2.9-12.5-1.1-39.3-1.1-39.3c-4-14.7,0-27.5,0-27.5
	c3.7-2.6,6.2-19.5,6.2-19.5c3.3-4.8,3.8-27.5,3.8-27.5c0.8-26,4.8-39.7,7.6-46.2c-1.8,15.9,4,59.4,4,59.4c0,12.8-8.8,54.3-8.8,54.3
	c-9.2,31.6,7.3,54.3,7.3,54.3c-3.3,8.8,4.9,36.7,4.9,36.7c5.6,10.3,6.8,27.9,6.8,27.9c-4,9.2-3.7,14.7-3.7,14.7
	c0.5,1.9,1.4,3.3,2.7,4.3C391.6,755.5,390.7,755.5,389.8,755.5z M595,689.9c-0.3-5-8.1-4.5-8.1-4.5c-2.2-3.7-15.6,1.8-15.6,1.8
	c-2.2-1.1-18.6,0-18.6,0c-13.6-8.1-23.4-49.6-23.4-49.6c-5.9-29-25.7-55.8-25.7-55.8c-9.5-10.6-9.5-15.8-9.5-15.8
	c-2.6-21.3-7.7-26.8-7.7-26.8c-7.7-10.6-8.1-22.4-8.1-22.4c1.8-19.8-6.6-34.9-6.6-34.9c-2.2-12.5-13.9-35.2-13.9-35.2
	c0-1.8-12.1-25.3-12.1-25.3c2.2-11-4-27.9-4-27.9l-6.2-19.5c4.8-10.6-0.4-22-0.4-22c0-1.8-1.8-15.8-1.8-15.8c2.9-3.7,7-25.3,7-25.3
	c6.6-11.4,8.1-29.4,8.1-29.4l1.8-6.2c5.9-15.4,21.7-17.3,21.7-17.3c6.6,4,31.6-1.1,31.6-1.1c7.7,1.8,35.6-1.5,35.6-1.5
	c18.4,14.7,65.3-1.5,65.3-1.5c12.8-2.2,34.5-2.2,34.5-2.2c2.6,1.5,20.9,0,20.9,0l7.7-2.2c19.5-0.7,21.7-5.1,21.7-5.1
	c-1.1-4-20.2,0-20.2,0l1.1-4l14.7-0.1c8.8,0.7,7.3-5.9,7.3-5.9c2,0.1,3.4-0.1,3.4-0.5v353.1C668.7,627.7,634.7,662.5,595,689.9z
	 M564.6,709.2c-4.1,2.3-8.3,4.5-12.6,6.7c2.8-5.1,8.8-7.4,8.8-7.4C562.1,709,563.4,709.2,564.6,709.2z M695.2,229
	c-2.1-1.9-6.3-2.1-6.3-2.1c2.2,0,2.6-2.8,2.6-2.8c-3.7-4.8-20.2-4.4-20.2-4.4h-7c-12.5-2.1-24.2,8.4-24.2,8.4
	c-2.6-0.4-9.2,0.5-9.2,0.5c-7.7,2.9-31.6,0.2-31.6,0.2c-22-4-58.4,3.2-58.4,3.2c-12.8-5.1-40.2-3.1-40.2-3.1
	c10.2-1.5,45.1-21.2,45.1-21.2c25.5-1.4,41.6-16.2,41.6-16.2c26.9-21.1,49.3-25.1,49.3-25.1c5.7,1.2,12.6-2.4,12.6-2.4
	c2.7-2.7,9.9-8.7,9.9-8.7c2.4-0.9,12.6-8.4,12.6-8.4c7.2-5.7,4.3-9,4.3-9c-2.4-0.3-17,10.1-17,10.1v-2.6l5.5-4.5
	c2.4-0.9,8.7-5.9,8.7-5.9c9.2-4,8.2-7,8.2-7c-5-1.6-19,5.9-19,5.9l0.8-2.9c10.8-5,13-7.5,13.7-8.2c6.7,8.4,12.9,17.1,18.3,26
	L695.2,229L695.2,229z M386.1-17.7c113.5,0,215.4,50.8,284.6,133.5H101.5C170.7,33.1,272.6-17.7,386.1-17.7z M69.3,120.1h22.9
	c-7.6,8.5-15.5,17.4-22.9,27.4V120.1z M7.4,368.1C7.4,292.6,29,222,65.1,162.4v411.5C29,514.2,7.4,443.6,7.4,368.1z M69.3,588.7
	c13.8,20.1,29.3,38.9,46.3,56.3c35,36,76.2,65,121.6,84.7c36.4,15.8,74.9,25.7,114.2,30H69.3V588.7z M695.2,759.8H420.7
	c6.6-1.1,13.1-2.2,19.6-3.1c10.3,2.7,36.1,1.4,36.1,1.4c2.2,0,2.2-5.6,2.2-5.6c0.1-1.6-0.9-2.8-2.4-3.6
	c19.8-4.9,39.3-11.6,58.2-19.8c45.4-19.7,85.4-48,120.4-84c15.1-15.5,28.7-32.2,40.3-49.9V759.8z M699.5,155.4
	c39.3,61.1,62.1,134.2,62.1,212.7s-22.8,151.6-62.1,212.7V155.4z"/>
</svg>

Added htdocs/images/warning.svg.



>
1

Added htdocs/images/warrior.svg.



>
1
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m217 427.652344h-32.511719l-8.230469-8.230469 292.597657-294.71875c27.824219-28.027344 43.144531-65.210937 43.144531-104.703125 0-11.046875-8.953125-20-20-20h-1.859375c-39.597656 0-76.851563 15.390625-104.902344 43.339844l-293.050781 292.011718-8.210938-8.210937v-32.140625c0-11.046875-8.953124-20-20-20-11.046874 0-20 8.953125-20 20v40.425781c0 5.304688 2.109376 10.390625 5.859376 14.140625l42.324218 42.328125-41.542968 41.542969c-3.382813-.929688-6.9375-1.4375-10.617188-1.4375-22.089844 0-40 17.910156-40 40s17.910156 40 40 40 40-17.910156 40-40c0-3.484375-.449219-6.867188-1.285156-10.089844l41.730468-41.730468 41.617188 41.617187c3.75 3.75 8.839844 5.855469 14.144531 5.855469h40.792969c11.046875 0 20-8.953125 20-20 0-11.042969-8.953125-20-20-20zm196.472656-355.976563c15.617188-15.558593 35.128906-25.792969 56.332032-29.785156-4.183594 20.53125-14.246094 39.429687-29.34375 54.640625l-292.488282 294.605469-27.503906-27.503907zm-370.503906 52.949219c-27.695312-27.972656-42.96875-65.105469-42.96875-104.523438v-.101562c0-11.046875 8.953125-20 20-20h1.757812c39.671876 0 76.976563 15.441406 105.042969 43.480469l90.34375 90.378906c7.808594 7.8125 7.808594 20.476563-.003906 28.285156-7.8125 7.808594-20.476563 7.804688-28.285156-.003906l-90.335938-90.371094c-15.605469-15.589843-35.125-25.851562-56.339843-29.863281 4.164062 20.519531 14.191406 39.40625 29.25 54.613281l90.929687 92.335938c7.753906 7.871093 7.65625 20.535156-.214844 28.285156-3.898437 3.835937-8.964843 5.75-14.03125 5.75-5.171875 0-10.339843-1.992187-14.253906-5.96875zm469.03125 347.375c0 22.089844-17.910156 40-40 40s-40-17.910156-40-40c0-3.484375.449219-6.867188 1.285156-10.089844l-41.730468-41.730468-41.617188 41.617187c-3.75 3.75-8.839844 5.855469-14.144531 5.855469h-39.792969c-11.046875 0-20-8.953125-20-20 0-11.042969 8.953125-20 20-20h31.511719l8.246093-8.246094-39.960937-40.328125c-7.777344-7.847656-7.71875-20.511719.125-28.285156 7.847656-7.773438 20.511719-7.71875 28.285156.128906l39.835938 40.199219 27.355469-27.355469-41.382813-40.46875c-7.894531-7.722656-8.035156-20.386719-.3125-28.28125 7.722656-7.898437 20.386719-8.039063 28.28125-.316406l41.699219 40.78125 8.339844-8.339844v-32.140625c0-11.046875 8.953124-20 20-20 11.046874 0 20 8.953125 20 20v40.425781c0 5.304688-2.105469 10.390625-5.855469 14.140625l-42.328125 42.328125 41.542968 41.542969c3.382813-.929688 6.9375-1.4375 10.617188-1.4375 22.089844 0 40 17.910156 40 40zm0 0"/></svg>

Added htdocs/images/woman.svg.





































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 847 1684" enable-background="new 0 0 847 1684" xml:space="preserve">
<g>
	<path d="M779.803,905.6337c-4.906,17.6151-17.4805,29.8795-36.8879,35.3109c-31.3215,8.7738-54.4355-4.9732-66.7133-33.6936
		l-103.938-356.2625c-0.7545-2.6145-4.5417-2.3718-4.9596,0.3236l-20.863,134.2757c-3.3019,21.2539-1.6712,42.9794,4.7711,63.5056
		l142.3214,453.8254c7.7766,24.7986-10.7549,50.0282-36.7529,50.0282h-98.9512c-5.9164,0-10.9435,4.3802-11.7523,10.2428
		l-46.4027,336.2485c-3.3559,24.394-24.2054,42.5616-48.8287,42.5616h-54.6915c-24.6233,0-45.4728-18.1676-48.8287-42.5616
		l-46.4027-336.2485c-0.8088-5.8625-5.8224-10.2428-11.7523-10.2428h-98.9515c-25.9977,0-44.5292-25.2296-36.753-50.0282
		l142.3218-453.8254c6.4422-20.5262,8.073-42.2517,4.7711-63.5056l-20.8495-134.2757c-0.4179-2.6954-4.2051-2.9381-4.9731-0.3236
		L170.7982,907.251c-12.2781,28.7204-35.3917,42.4674-66.7133,33.6936c-19.4074-5.4315-31.9819-17.6959-36.8879-35.3109
		c-2.9515-10.6202-2.4392-21.9008,0.9167-32.3862L225.4223,380.553c10.8089-33.8821,42.292-56.8747,77.8591-56.8747h240.4507
		c35.5533,0,67.0367,22.9926,77.8456,56.8747l157.3085,492.6945C782.2421,883.7328,782.7545,895.0135,779.803,905.6337z"/>
	<circle cx="423.5" cy="172.9557" r="130.9557"/>
</g>
</svg>

Added htdocs/style.css.















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
* {
    margin:0px;
    padding:0px;
}
html, body {
    height:100%;
}
body {
    background: white;
    color: black;
    font-family: fixed;
    font-size:0;
}
p.status {
    color: black;
}
p.reply {
    color: darkblue;
}
p.command {
    background: darkgrey;
    color: green;
}
div.error {
    color: red;
}
div.reply {
    color: black;
}
div.unicode {
  font-famly: "Arial Unicode MS"
    color: black;
}
div#top{
    color: black;
    height:30px;
    line-height:30px;
    font-size:14px;
    background: white;
}
div#output {
    height:calc(100% - 80px);
    overflow-y: scroll;
    overflow-x: hidden;
    padding:5px;
    font-size:14px;
}
div#bottom{
    height:30px;
    line-height:30px;
    font-size:14px;
}
.svg-icon {
  width: 1em;
  height: 1em;
}

.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
  fill: #4691f6;
}

.svg-icon circle {
  stroke: #4691f6;
  stroke-width: 1;
}
@font-face {
  font-family: 'Cuneiform';
  src: url('/font/Santakku.ttf')  format('truetype') /* Safari, Android, iOS */
}

Added make.tcl.













































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
set ::CWD [pwd]
set ::SRCDIR [file dirname [file normalize [info script]]]
set ::SANDBOX  [file dirname $::SRCDIR]

namespace eval ::main {
  variable DIR [file dirname [file normalize [info script]]]
  set ::auto_path [linsert $::auto_path 0 [file join $DIR modules]]
}
puts [list LOADING PRACTCL FROM [file join $::main::DIR scripts practcl.tcl]]
source [file join $::main::DIR scripts practcl.tcl]
set ::SRCDIR $::main::DIR

::practcl::library  create PROJECT {
name clay
version 0.1
}
[::practcl::LOCAL tool tcllib] define set tag hypnotoad
::practcl::LOCAL add_tool clay {
  tag trunk
  class subproject.sak
  install vfs
  fossil_url http://fossil.etoyoc.com/clay
}
::practcl::LOCAL add_tool thread {
  profile {
    release: 2a36d0a6c31569bfb3562e3d58e9e8204f447a7e
    devel:   practcl
  }
  class subproject.binary
  install static
  pkg_name Thread
  initfunc Thread_Init
  fossil_url http://fossil.etoyoc.com/fossil/thread
}
PROJECT add_project bootswatch {
  class subproject.source
  git_url https://github.com/thomaspark/bootswatch
  tag master
}

proc installModule {modpath DEST} {
  puts [list installModule $modpath $DEST]
  set dpath  [file join $DEST modules [file tail $modpath]]
  if {[file exists $dpath] && [file type $dpath] eq "link"} return
  if {[file exists [file join $modpath build build.tcl]]} {
    puts [list Rebuild $modpath]
    ::practcl::dotclexec [file join $modpath build build.tcl]
  } elseif {![file exists [file join $modpath pkgIndex.tcl]]} {
    puts [list Reindex $modpath]
    pkg_mkIndex $modpath
  }
  file delete -force $dpath
  file mkdir $dpath
  foreach file [glob  [file join $modpath *.tcl]] {
    file copy $file $dpath
  }
  if {[file exists [file join $modpath htdocs]]} {
    ::practcl::installDir [file join $modpath htdocs] [file join $dpath htdocs]
  }
}

proc installPlugin {modpath DEST} {
  set dpath  [file join $DEST plugin [file tail $modpath]]
  if {[file exists [file join $modpath build build.tcl]]} {
    puts [list Rebuild $modpath]
    ::practcl::dotclexec [file join $modpath build build.tcl]
  } elseif {![file exists [file join $modpath pkgIndex.tcl]]} {
    puts [list Reindex $modpath]
    pkg_mkIndex $modpath
  }
  file delete -force $dpath
  file mkdir $dpath
  foreach file [glob  [file join $modpath *.tcl]] {
    file copy $file $dpath
  }
  if {[file exists [file join $modpath htdocs]]} {
    ::practcl::installDir [file join $modpath htdocs] [file join $dpath htdocs]
  }
}

proc modules {} {
  set result {}
  foreach modpath [glob [file join $::main::DIR modules *]] {
    ::practcl::buildModule $modpath
    if {![file exists [file join $modpath pkgIndex.tcl]]} continue
    lappend result [file tail $modpath]
  }
  return $result
}

###
# Build level scripting
###
switch [lindex $argv 0] {
  packages {
    ###
    # Build external packages needed by toadhttpd
    ###
    puts "BUILDING LOCAL TCL ENVIRONMENT"
    foreach item {tclconfig tcl sqlite thread} {
      set obj [::practcl::LOCAL tool $item]
      puts [list $item $obj]
      if {[catch {$obj env-install} err errdat]} {
        puts ***
        puts [dict get $errdat -errorinfo]
        puts ***
      }
    }
    ###
    # Just unpack the source for bootswatch
    ###
    foreach item {tcllib bootswatch} {
      set obj [PROJECT project $item]
      puts [list $item $obj]
      if {[catch {$obj unpack} err errdat]} {
        puts ***
        puts [dict get $errdat -errorinfo]
        puts ***
      }
    }
  }
  gilgamesh {
    set DEST [file normalize [lindex $argv 1]]
    file mkdir $DEST
    foreach dir {
      class lang object
    } {
      ::practcl::installDir [file join $::main::DIR example gilgamesh $dir] [file join $DEST $dir]
    }
    file copy -force  [file join $::main::DIR example gilgamesh main.tcl] [file join $DEST main.tcl]
    foreach modpath [glob [file join $::main::DIR modules *]] {
      installModule $modpath $DEST
    }
    foreach {project modules} {
      tcllib {
        cmdline csv coroutine cron devtools dns
        sha1 uri
      }
    } {
      set obj [::practcl::LOCAL tool $project]
      $obj unpack
      $obj update
      set lsrcdir [$obj define get srcdir]
      foreach module $modules {
        installModule [file join $lsrcdir modules $module] $DEST
      }
    }
  }
  claykit {
    set dat [::practcl::config.tcl $CWD]
    set object TCLKIT
    ::practcl::tclkit  create $object $dat
    $object define set name claykit
    $object define set sandbox $::SANDBOX
    $object define set srcdir  $::SRCDIR
    $object source [file join $::SRCDIR claykit.ini]
    set INSTALLDIR [$object define get installdir]
    if {![file exists [$object define get tclkit_bare]]} {
      $object build-tclcore
      $object implement $CWD
      foreach item [$object link list package] {
        if {![string is true [$item define get static 0]]} continue
        puts [list GENERATING $item [$item define get srcdir]]
        $item compile
      }
      $object build-tclsh [$object define get tclkit_bare] $object
    }
    set VFS [file join $CWD [$object define get vfs]]
    file mkdir $VFS
    foreach item [$object link list package] {
      set modlist [$item define get module_list]
      puts [list PACKAGE INSTALL [$item define get name] MODLIST $modlist]
      if {[llength $modlist]} {
        if {[catch {$item install-module [file join ${VFS} modules] {*}$modlist} error errdat]} {
          puts stderr "BUILD FAILURE $item"
          puts "FAILED TO  INSTALL package $item"
          puts [dict get $errdat -errorinfo]
          exit 1
        }
      } elseif {[string is true [$item define get vfsinstall 1]]} {
        puts [list GENERATING $item [$item define get srcdir]]
        if {[catch {$item install $INSTALLDIR} error errdat]} {
          puts stderr "BUILD FAILURE $item"
          puts "FAILED TO  INSTALL package $item"
          puts [dict get $errdat -errorinfo]
          exit 1
        }
      }
    }
    # Copy in our "secret squirrel" code
    #set SCMCOPY [list ::exec [WISHKIT define get tclkit_bare] [file join $::SRCDIR scripts scm-copy.tcl]]
    #set SCMCOPY ::practcl::copyDir
    #{*}$SCMCOPY [file join $::SRCDIR src] ${VFS}
    if {[$object define get debug 0]} {
      $object wrap $CWD [$object define get exe] $VFS [file join $CWD PKGROOT]
    } else {
      $object wrap $CWD [$object define get exe] $VFS [file join $CWD PKGROOT]
    }
  }
  modules {
    set modules [modules]
    puts $modules
    exit 0
    #return $result
  }
  install {
    set DEST [file normalize [lindex $argv 1]]
    file mkdir $DEST
    set modlist [modules]
    foreach module $modlist {
      set modpath [file join $::main::DIR modules $module]
      ::practcl::installModule $modpath [file join $DEST $module]
    }
  }
  install-module {
    set DEST [file normalize [lindex $argv 1]]
    file mkdir $DEST
    puts [list FIRST ITEM [lindex $argv 2]]
    if {[lindex $argv 2] in {all *}} {
      set modlist [modules]
    } else {
      set modlist [lrange $argv 2 end]
    }
    foreach module $modlist {
      set modpath [file join $::main::DIR modules $module]
      ::practcl::installModule $modpath [file join $DEST $module]
    }
  }

}

Added scripts/practcl.tcl.



























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
###
# Amalgamated package for practcl
# Do not edit directly, tweak the source in src/ and rerun
# build.tcl
###
package require Tcl 8.6
package provide practcl 0.15
namespace eval ::practcl {}

###
# START: httpwget/wget.tcl
###
package provide http::wget 0.1
package require http
::namespace eval ::http {
}
proc ::http::_followRedirects {url args} {
    while 1 {
        set token [geturl $url -validate 1]
        set ncode [ncode $token]
        if { $ncode eq "404" } {
          error "URL Not found"
        }
        switch -glob $ncode {
            30[1237] {### redirect - see below ###}
            default  {cleanup $token ; return $url}
        }
        upvar #0 $token state
        array set meta [set ${token}(meta)]
        cleanup $token
        if {![info exists meta(Location)]} {
           return $url
        }
        set url $meta(Location)
        unset meta
    }
    return $url
}
proc ::http::wget {url destfile {verbose 1}} {
    set tmpchan [open $destfile w]
    fconfigure $tmpchan -translation binary
    if { $verbose } {
        puts [list  GETTING [file tail $destfile] from $url]
    }
    set real_url [_followRedirects $url]
    set token [geturl $real_url -channel $tmpchan -binary yes]
    if {[ncode $token] != "200"} {
      error "DOWNLOAD FAILED"
    }
    cleanup $token
    close $tmpchan
}

###
# END: httpwget/wget.tcl
###
###
# START: clay/clay.tcl
###
package provide clay 0.6
namespace eval ::clay {
}
package require Tcl 8.5
namespace eval uuid {
    variable accel
    array set accel {critcl 0}
    namespace export uuid
    variable uid
    if {![info exists uid]} {
        set uid 1
    }
    proc K {a b} {set a}
}
proc ::uuid::generate_tcl_machinfo {} {
  variable machinfo
  if {[info exists machinfo]} {
    return $machinfo
  }
  lappend machinfo [clock seconds]; # timestamp
  lappend machinfo [clock clicks];  # system incrementing counter
  lappend machinfo [info hostname]; # spatial unique id (poor)
  lappend machinfo [pid];           # additional entropy
  lappend machinfo [array get ::tcl_platform]

  ###
  # If we have /dev/urandom just stream 128 bits from that
  ###
  if {[file exists /dev/urandom]} {
    set fin [open /dev/urandom r]
    binary scan [read $fin 128] H* machinfo
    close $fin
  } elseif {[catch {package require nettool}]} {
    # More spatial information -- better than hostname.
    # bug 1150714: opening a server socket may raise a warning messagebox
    #   with WinXP firewall, using ipconfig will return all IP addresses
    #   including ipv6 ones if available. ipconfig is OK on win98+
    if {[string equal $::tcl_platform(platform) "windows"]} {
      catch {exec ipconfig} config
      lappend machinfo $config
    } else {
      catch {
          set s [socket -server void -myaddr [info hostname] 0]
          K [fconfigure $s -sockname] [close $s]
      } r
      lappend machinfo $r
    }

    if {[package provide Tk] != {}} {
      lappend machinfo [winfo pointerxy .]
      lappend machinfo [winfo id .]
    }
  } else {
    ###
    # If the nettool package works on this platform
    # use the stream of hardware ids from it
    ###
    lappend machinfo {*}[::nettool::hwid_list]
  }
  return $machinfo
}
proc ::uuid::generate_tcl {} {
    package require md5 2
    variable uid

    set tok [md5::MD5Init]
    md5::MD5Update $tok [incr uid];      # package incrementing counter
    foreach string [generate_tcl_machinfo] {
      md5::MD5Update $tok $string
    }
    set r [md5::MD5Final $tok]
    binary scan $r c* r

    # 3.4: set uuid versioning fields
    lset r 8 [expr {([lindex $r 8] & 0x3F) | 0x80}]
    lset r 6 [expr {([lindex $r 6] & 0x0F) | 0x40}]

    return [binary format c* $r]
}
if {[string equal $tcl_platform(platform) "windows"]
        && [package provide critcl] != {}} {
    namespace eval uuid {
        critcl::ccode {
            #define WIN32_LEAN_AND_MEAN
            #define STRICT
            #include <windows.h>
            #include <ole2.h>
            typedef long (__stdcall *LPFNUUIDCREATE)(UUID *);
            typedef const unsigned char cu_char;
        }
        critcl::cproc generate_c {Tcl_Interp* interp} ok {
            HRESULT hr = S_OK;
            int r = TCL_OK;
            UUID uuid = {0};
            HMODULE hLib;
            LPFNUUIDCREATE lpfnUuidCreate = NULL;
            hLib = LoadLibraryA(("rpcrt4.dll"));
            if (hLib)
                lpfnUuidCreate = (LPFNUUIDCREATE)
                    GetProcAddress(hLib, "UuidCreate");
            if (lpfnUuidCreate) {
                Tcl_Obj *obj;
                lpfnUuidCreate(&uuid);
                obj = Tcl_NewByteArrayObj((cu_char *)&uuid, sizeof(uuid));
                Tcl_SetObjResult(interp, obj);
            } else {
                Tcl_SetResult(interp, "error: failed to create a guid",
                              TCL_STATIC);
                r = TCL_ERROR;
            }
            return r;
        }
    }
}
proc ::uuid::tostring {uuid} {
    binary scan $uuid H* s
    foreach {a b} {0 7 8 11 12 15 16 19 20 end} {
        append r [string range $s $a $b] -
    }
    return [string tolower [string trimright $r -]]
}
proc ::uuid::fromstring {uuid} {
    return [binary format H* [string map {- {}} $uuid]]
}
proc ::uuid::equal {left right} {
    set l [fromstring $left]
    set r [fromstring $right]
    return [string equal $l $r]
}
proc ::uuid::generate {} {
    variable accel
    if {$accel(critcl)} {
        return [generate_c]
    } else {
        return [generate_tcl]
    }
}
proc uuid::uuid {cmd args} {
    switch -exact -- $cmd {
        generate {
            if {[llength $args] != 0} {
                return -code error "wrong # args:\
                    should be \"uuid generate\""
            }
            return [tostring [generate]]
        }
        equal {
            if {[llength $args] != 2} {
                return -code error "wrong \# args:\
                    should be \"uuid equal uuid1 uuid2\""
            }
            return [eval [linsert $args 0 equal]]
        }
        default {
            return -code error "bad option \"$cmd\":\
                must be generate or equal"
        }
    }
}
proc ::uuid::LoadAccelerator {name} {
    variable accel
    set r 0
    switch -exact -- $name {
        critcl {
            if {![catch {package require tcllibc}]} {
                set r [expr {[info commands ::uuid::generate_c] != {}}]
            }
        }
        default {
            return -code error "invalid accelerator package:\
                must be one of [join [array names accel] {, }]"
        }
    }
    set accel($name) $r
}
namespace eval ::uuid {
    variable e {}
    foreach e {critcl} {
        if {[LoadAccelerator $e]} break
    }
    unset e
}
package provide uuid 1.0.7
namespace eval ::oo::dialect {
  namespace export create
}
foreach {flag test} {
  tip470 {package vsatisfies [package provide Tcl] 8.7}
} {
  if {![info exists ::oo::dialect::has($flag)]} {
    set ::oo::dialect::has($flag) [eval $test]
  }
}
proc ::oo::dialect::Push {class} {
  ::variable class_stack
  lappend class_stack $class
}
proc ::oo::dialect::Peek {} {
  ::variable class_stack
  return [lindex $class_stack end]
}
proc ::oo::dialect::Pop {} {
  ::variable class_stack
  set class_stack [lrange $class_stack 0 end-1]
}
if {$::oo::dialect::has(tip470)} {
proc ::oo::dialect::current_class {} {
  return [uplevel 1 self]
}
} else {
proc ::oo::dialect::current_class {} {
  tailcall Peek
}
}
proc ::oo::dialect::create {name {parent ""}} {
  variable has
  set NSPACE [NSNormalize [uplevel 1 {namespace current}] $name]
  ::namespace eval $NSPACE {::namespace eval define {}}
  ###
  # Build the "define" namespace
  ###

  if {$parent eq ""} {
    ###
    # With no "parent" language, begin with all of the keywords in
    # oo::define
    ###
    foreach command [info commands ::oo::define::*] {
      set procname [namespace tail $command]
      interp alias {} ${NSPACE}::define::$procname {} \
        ::oo::dialect::DefineThunk $procname
    }
    # Create an empty dynamic_methods proc
    proc ${NSPACE}::dynamic_methods {class} {}
    namespace eval $NSPACE {
      ::namespace export dynamic_methods
      ::namespace eval define {::namespace export *}
    }
    set ANCESTORS {}
  } else {
    ###
    # If we have a parent language, that language already has the
    # [oo::define] keywords as well as additional keywords and behaviors.
    # We should begin with that
    ###
    set pnspace [NSNormalize [uplevel 1 {namespace current}] $parent]
    apply [list parent {
      ::namespace export dynamic_methods
      ::namespace import -force ${parent}::dynamic_methods
    } $NSPACE] $pnspace

    apply [list parent {
      ::namespace import -force ${parent}::define::*
      ::namespace export *
    } ${NSPACE}::define] $pnspace
      set ANCESTORS [list ${pnspace}::object]
  }
  ###
  # Build our dialect template functions
  ###
  proc ${NSPACE}::define {oclass args} [string map [list %NSPACE% $NSPACE] {
  ###
  # To facilitate library reloading, allow
  # a dialect to create a class from DEFINE
  ###
  set class [::oo::dialect::NSNormalize [uplevel 1 {namespace current}] $oclass]
    if {[info commands $class] eq {}} {
      %NSPACE%::class create $class {*}${args}
    } else {
      ::oo::dialect::Define %NSPACE% $class {*}${args}
    }
}]
  interp alias {} ${NSPACE}::define::current_class {} \
    ::oo::dialect::current_class
  interp alias {} ${NSPACE}::define::aliases {} \
    ::oo::dialect::Aliases $NSPACE
  interp alias {} ${NSPACE}::define::superclass {} \
    ::oo::dialect::SuperClass $NSPACE

  if {[info command ${NSPACE}::class] ne {}} {
    ::rename ${NSPACE}::class {}
  }
  ###
  # Build the metaclass for our language
  ###
  ::oo::class create ${NSPACE}::class {
    superclass ::oo::dialect::MotherOfAllMetaClasses
  }
  # Wire up the create method to add in the extra argument we need; the
  # MotherOfAllMetaClasses will know what to do with it.
  ::oo::objdefine ${NSPACE}::class \
    method create {name {definitionScript ""}} \
      "next \$name [list ${NSPACE}::define] \$definitionScript"

  ###
  # Build the mother of all classes. Note that $ANCESTORS is already
  # guaranteed to be a list in canonical form.
  ###
  uplevel #0 [string map [list %NSPACE% [list $NSPACE] %name% [list $name] %ANCESTORS% $ANCESTORS] {
    %NSPACE%::class create %NSPACE%::object {
     superclass %ANCESTORS%
      # Put MOACish stuff in here
    }
  }]
  if { "${NSPACE}::class" ni $::oo::dialect::core_classes } {
    lappend ::oo::dialect::core_classes "${NSPACE}::class"
  }
  if { "${NSPACE}::object" ni $::oo::dialect::core_classes } {
    lappend ::oo::dialect::core_classes "${NSPACE}::object"
  }
}
proc ::oo::dialect::NSNormalize {namespace qualname} {
  if {![string match ::* $qualname]} {
    set qualname ${namespace}::$qualname
  }
  regsub -all {::+} $qualname "::"
}
proc ::oo::dialect::DefineThunk {target args} {
  tailcall ::oo::define [Peek] $target {*}$args
}
proc ::oo::dialect::Canonical {namespace NSpace class} {
  namespace upvar $namespace cname cname
  #if {[string match ::* $class]} {
  #  return $class
  #}
  if {[info exists cname($class)]} {
    return $cname($class)
  }
  if {[info exists ::oo::dialect::cname($class)]} {
    return $::oo::dialect::cname($class)
  }
  if {[info exists ::oo::dialect::cname(${NSpace}::${class})]} {
    return $::oo::dialect::cname(${NSpace}::${class})
  }
  foreach item [list "${NSpace}::$class" "::$class"] {
    if {[info commands $item] ne {}} {
      return $item
    }
  }
  return ${NSpace}::$class
}
proc ::oo::dialect::Define {namespace class args} {
  Push $class
  try {
  	if {[llength $args]==1} {
      namespace eval ${namespace}::define [lindex $args 0]
    } else {
      ${namespace}::define::[lindex $args 0] {*}[lrange $args 1 end]
    }
  	${namespace}::dynamic_methods $class
  } finally {
    Pop
  }
}
proc ::oo::dialect::Aliases {namespace args} {
  set class [Peek]
  namespace upvar $namespace cname cname
  set NSpace [join [lrange [split $class ::] 1 end-2] ::]
  set cname($class) $class
  foreach name $args {
    set cname($name) $class
    #set alias $name
    set alias [NSNormalize $NSpace $name]
    # Add a local metaclass reference
    if {![info exists ::oo::dialect::cname($alias)]} {
      lappend ::oo::dialect::aliases($class) $alias
      ##
      # Add a global reference, first come, first served
      ##
      set ::oo::dialect::cname($alias) $class
    }
  }
}
proc ::oo::dialect::SuperClass {namespace args} {
  set class [Peek]
  namespace upvar $namespace class_info class_info
  dict set class_info($class) superclass 1
  set ::oo::dialect::cname($class) $class
  set NSpace [join [lrange [split $class ::] 1 end-2] ::]
  set unique {}
  foreach item $args {
    set Item [Canonical $namespace $NSpace $item]
    dict set unique $Item $item
  }
  set root ${namespace}::object
  if {$class ne $root} {
    dict set unique $root $root
  }
  tailcall ::oo::define $class superclass {*}[dict keys $unique]
}
if {[info command ::oo::dialect::MotherOfAllMetaClasses] eq {}} {
::oo::class create ::oo::dialect::MotherOfAllMetaClasses {
  superclass ::oo::class
  constructor {define definitionScript} {
    $define [self] {
      superclass
    }
    $define [self] $definitionScript
  }
  method aliases {} {
    if {[info exists ::oo::dialect::aliases([self])]} {
      return $::oo::dialect::aliases([self])
    }
  }
}
}
namespace eval ::oo::dialect {
  variable core_classes {::oo::class ::oo::object}
}
package provide oo::dialect 0.4
package provide dicttool 1.2
namespace eval ::dicttool {
}
namespace eval ::dicttool {
}
namespace eval ::tcllib {
}
proc ::tcllib::PROC {name arglist body {ninja {}}} {
  if {[info commands $name] ne {}} return
  proc $name $arglist $body
  eval $ninja
}
if {[info commands ::PROC] eq {}} {
  namespace eval ::tcllib { namespace export PROC }
  namespace eval :: { namespace import ::tcllib::PROC }
}
proc ::tcllib::noop args {}
if {[info commands ::noop] eq {}} {
  namespace eval ::tcllib { namespace export noop }
  namespace eval :: { namespace import ::tcllib::noop }
}
proc ::tcllib::putb {buffername args} {
  upvar 1 $buffername buffer
  switch [llength $args] {
    1 {
      append buffer [lindex $args 0] \n
    }
    2 {
      append buffer [string map {*}$args] \n
    }
    default {
      error "usage: putb buffername ?map? string"
    }
  }
}
if {[info command ::putb] eq {}} {
  namespace eval ::tcllib { namespace export putb }
  namespace eval :: { namespace import ::tcllib::putb }
}
::tcllib::PROC ::tcl::dict::getnull {dictionary args} {
  if {[exists $dictionary {*}$args]} {
    get $dictionary {*}$args
  }
} {
  namespace ensemble configure dict -map [dict replace\
      [namespace ensemble configure dict -map] getnull ::tcl::dict::getnull]
}
::tcllib::PROC ::tcl::dict::is_dict { d } {
  # is it a dict, or can it be treated like one?
  if {[catch {dict size $d} err]} {
    #::set ::errorInfo {}
    return 0
  }
  return 1
} {
  namespace ensemble configure dict -map [dict replace\
      [namespace ensemble configure dict -map] is_dict ::tcl::dict::is_dict]
}
::tcllib::PROC ::tcl::dict::rmerge {args} {
  ::set result [dict create . {}]
  # Merge b into a, and handle nested dicts appropriately
  ::foreach b $args {
    for { k v } $b {
      ::set field [string trim $k :/]
      if {![::dicttool::is_branch $b $k]} {
        # Element names that end in ":" are assumed to be literals
        set result $k $v
      } elseif { [exists $result $k] } {
        # key exists in a and b?  let's see if both values are dicts
        # both are dicts, so merge the dicts
        if { [is_dict [get $result $k]] && [is_dict $v] } {
          set result $k [rmerge [get $result $k] $v]
        } else {
          set result $k $v
        }
      } else {
        set result $k $v
      }
    }
  }
  return $result
} {
  namespace ensemble configure dict -map [dict replace\
      [namespace ensemble configure dict -map] rmerge ::tcl::dict::rmerge]
}
::tcllib::PROC ::dicttool::is_branch { dict path } {
  set field [lindex $path end]
  if {[string index $field end] eq ":"} {
    return 0
  }
  if {[string index $field 0] eq "."} {
    return 0
  }
  if {[string index $field end] eq "/"} {
    return 1
  }
  return [dict exists $dict {*}$path .]
}
::tcllib::PROC ::dicttool::print {dict} {
  ::set result {}
  ::set level -1
  ::dicttool::_dictputb $level result $dict
  return $result
}
::tcllib::PROC ::dicttool::_dictputb {level varname dict} {
  upvar 1 $varname result
  incr level
  dict for {field value} $dict {
    if {$field eq "."} continue
    if {[dicttool::is_branch $dict $field]} {
      putb result "[string repeat "  " $level]$field \{"
      _dictputb $level result $value
      putb result "[string repeat "  " $level]\}"
    } else {
      putb result "[string repeat "  " $level][list $field $value]"
    }
  }
}
proc ::dicttool::sanitize {dict} {
  ::set result {}
  ::set level -1
  ::dicttool::_sanitizeb {} result $dict
  return $result
}
proc ::dicttool::_sanitizeb {path varname dict} {
  upvar 1 $varname result
  dict for {field value} $dict {
    if {$field eq "."} continue
    if {[dicttool::is_branch $dict $field]} {
      _sanitizeb [list {*}$path $field] result $value
    } else {
      dict set result {*}$path $field $value
    }
  }
}
proc ::dicttool::storage {rawpath} {
  set isleafvar 0
  set path {}
  set tail [string index $rawpath end]
  foreach element $rawpath {
    set items [split [string trim $element /] /]
    foreach item $items {
      if {$item eq {}} continue
      lappend path $item
    }
  }
  return $path
}
proc ::dicttool::dictset {varname args} {
  upvar 1 $varname result
  if {[llength $args] < 2} {
    error "Usage: ?path...? path value"
  } elseif {[llength $args]==2} {
    set rawpath [lindex $args 0]
  } else {
    set rawpath  [lrange $args 0 end-1]
  }
  set value [lindex $args end]
  set path [storage $rawpath]
  set dot .
  set one {}
  dict set result $dot $one
  set dpath {}
  foreach item [lrange $path 0 end-1] {
    set field $item
    lappend dpath [string trim $item /]
    dict set result {*}$dpath $dot $one
  }
  set field [lindex $rawpath end]
  set ext   [string index $field end]
  if {$ext eq {:} || ![dict is_dict $value]} {
    dict set result {*}$path $value
    return
  }
  if {$ext eq {/} && ![dict exists $result {*}$path $dot]} {
    dict set result {*}$path $dot $one
  }
  if {[dict exists $result {*}$path $dot]} {
    dict set result {*}$path [::dicttool::merge [dict get $result {*}$path] $value]
    return
  }
  dict set result {*}$path $value
}
proc ::dicttool::dictmerge {varname args} {
  upvar 1 $varname result
  set dot .
  set one {}
  dict set result $dot $one
  foreach dict $args {
    dict for {f v} $dict {
      set field [string trim $f /]
      set bbranch [dicttool::is_branch $dict $f]
      if {![dict exists $result $field]} {
        dict set result $field $v
        if {$bbranch} {
          dict set result $field [dicttool::merge $v]
        } else {
          dict set result $field $v
        }
      } elseif {[dict exists $result $field $dot]} {
        if {$bbranch} {
          dict set result $field [dicttool::merge [dict get $result $field] $v]
        } else {
          dict set result $field $v
        }
      }
    }
  }
  return $result
}
proc ::dicttool::merge {args} {
  ###
  # The result of a merge is always a dict with branches
  ###
  set dot .
  set one {}
  dict set result $dot $one
  set argument 0
  foreach b $args {
    # Merge b into a, and handle nested dicts appropriately
    if {![dict is_dict $b]} {
      error "Element $b is not a dictionary"
    }
    dict for { k v } $b {
      if {$k eq $dot} {
        dict set result $dot $one
        continue
      }
      set bbranch [is_branch $b $k]
      set field [string trim $k /]
      if { ![dict exists $result $field] } {
        if {$bbranch} {
          dict set result $field [merge $v]
        } else {
          dict set result $field $v
        }
      } else {
        set abranch [dict exists $result $field $dot]
        if {$abranch && $bbranch} {
          dict set result $field [merge [dict get $result $field] $v]
        } else {
          dict set result $field $v
          if {$bbranch} {
            dict set result $field $dot $one
          }
        }
      }
    }
  }
  return $result
}
::tcllib::PROC ::tcl::dict::isnull {dictionary args} {
  if {![exists $dictionary {*}$args]} {return 1}
  return [expr {[get $dictionary {*}$args] in {{} NULL null}}]
} {
  namespace ensemble configure dict -map [dict replace\
      [namespace ensemble configure dict -map] isnull ::tcl::dict::isnull]
}
namespace eval ::dictargs {
}
if {[info commands ::dictargs::parse] eq {}} {
  proc ::dictargs::parse {argdef argdict} {
    set result {}
    dict for {field info} $argdef {
      if {![string is alnum [string index $field 0]]} {
        error "$field is not a simple variable name"
      }
      upvar 1 $field _var
      set aliases {}
      if {[dict exists $argdict $field]} {
        set _var [dict get $argdict $field]
        continue
      }
      if {[dict exists $info aliases:]} {
        set found 0
        foreach {name} [dict get $info aliases:] {
          if {[dict exists $argdict $name]} {
            set _var [dict get $argdict $name]
            set found 1
            break
          }
        }
        if {$found} continue
      }
      if {[dict exists $info default:]} {
        set _var [dict get $info default:] \n
        continue
      }
      set mandatory 1
      if {[dict exists $info mandatory:]} {
        set mandatory [dict get $info mandatory:]
      }
      if {$mandatory} {
        error "$field is required"
      }
    }
  }
}
proc ::dictargs::proc {name argspec body} {
  set result {}
  append result "::dictargs::parse \{$argspec\} \$args" \;
  append result $body
  uplevel 1 [list ::proc $name [list [list args [list dictargs $argspec]]] $result]
}
proc ::dictargs::method {name argspec body} {
  set class [lindex [::info level -1] 1]
  set result {}
  append result "::dictargs::parse \{$argspec\} \$args" \;
  append result $body
  oo::define $class method $name [list [list args [list dictargs $argspec]]] $result
}
::tcllib::PROC ::dicttool::ladd {varname args} {
  upvar 1 $varname var
  if ![info exists var] {
      set var {}
  }
  foreach item $args {
    if {$item in $var} continue
    lappend var $item
  }
  return $var
}
::tcllib::PROC ::dicttool::ldelete {varname args} {
  upvar 1 $varname var
  if ![info exists var] {
      return
  }
  foreach item [lsort -unique $args] {
    while {[set i [lsearch $var $item]]>=0} {
      set var [lreplace $var $i $i]
    }
  }
  return $var
}
::tcllib::PROC ::dicttool::lrandom list {
  set len [llength $list]
  set idx [expr int(rand()*$len)]
  return [lindex $list $idx]
}
namespace eval ::dicttool {
  namespace export *
}
package require Tcl 8.6 ;# try in pipeline.tcl. Possibly other things.
package require TclOO
::oo::dialect::create ::clay
::namespace eval ::clay {
}
::namespace eval ::clay::classes {
}
::namespace eval ::clay::define {
}
namespace eval ::clay {
}
set ::clay::trace 0
proc ::clay::_ancestors {resultvar class} {
  upvar 1 $resultvar result
  if {$class in $result} {
    return
  }
  lappend result $class
  foreach aclass [::info class superclasses $class] {
    _ancestors result $aclass
  }
}
proc ::clay::ancestors {args} {
  set result {}
  set queue  {}
  set metaclasses {}

  foreach class $args {
    set ancestors($class) {}
    _ancestors ancestors($class) $class
  }
  foreach class [lreverse $args] {
    foreach aclass $ancestors($class) {
      if {$aclass in $result} continue
      set skip 0
      foreach bclass $args {
        if {$class eq $bclass} continue
        if {$aclass in $ancestors($bclass)} {
          set skip 1
          break
        }
      }
      if {$skip} continue
      lappend result $aclass
    }
  }
  foreach class [lreverse $args] {
    foreach aclass $ancestors($class) {
      if {$aclass in $result} continue
      lappend result $aclass
    }
  }
  ###
  # Screen out classes that do not participate in clay
  # interactions
  ###
  set output {}
  foreach {item} $result {
    if {[catch {$item clay noop} err]} {
      continue
    }
    lappend output $item
  }
  return $output
}
proc ::clay::args_to_dict args {
  if {[llength $args]==1} {
    return [lindex $args 0]
  }
  return $args
}
proc ::clay::args_to_options args {
  set result {}
  foreach {var val} [args_to_dict {*}$args] {
    lappend result [string trim $var -:] $val
  }
  return $result
}
proc ::clay::dynamic_arguments {ensemble method arglist args} {
  set idx 0
  set len [llength $args]
  if {$len > [llength $arglist]} {
    ###
    # Catch if the user supplies too many arguments
    ###
    set dargs 0
    if {[lindex $arglist end] ni {args dictargs}} {
      return -code error -level 2 "Usage: $ensemble $method [string trim [dynamic_wrongargs_message $arglist]]"
    }
  }
  foreach argdef $arglist {
    if {$argdef eq "args"} {
      ###
      # Perform args processing in the style of tcl
      ###
      uplevel 1 [list set args [lrange $args $idx end]]
      break
    }
    if {$argdef eq "dictargs"} {
      ###
      # Perform args processing in the style of tcl
      ###
      uplevel 1 [list set args [lrange $args $idx end]]
      ###
      # Perform args processing in the style of clay
      ###
      set dictargs [::clay::args_to_options {*}[lrange $args $idx end]]
      uplevel 1 [list set dictargs $dictargs]
      break
    }
    if {$idx > $len} {
      ###
      # Catch if the user supplies too few arguments
      ###
      if {[llength $argdef]==1} {
        return -code error -level 2 "Usage: $ensemble $method [string trim [dynamic_wrongargs_message $arglist]]"
      } else {
        uplevel 1 [list set [lindex $argdef 0] [lindex $argdef 1]]
      }
    } else {
      uplevel 1 [list set [lindex $argdef 0] [lindex $args $idx]]
    }
    incr idx
  }
}
proc ::clay::dynamic_wrongargs_message {arglist} {
  set result ""
  set dargs 0
  foreach argdef $arglist {
    if {$argdef in {args dictargs}} {
      set dargs 1
      break
    }
    if {[llength $argdef]==1} {
      append result " $argdef"
    } else {
      append result " ?[lindex $argdef 0]?"
    }
  }
  if { $dargs } {
    append result " ?option value?..."
  }
  return $result
}
proc ::clay::is_dict { d } {
  # is it a dict, or can it be treated like one?
  if {[catch {::dict size $d} err]} {
    #::set ::errorInfo {}
    return 0
  }
  return 1
}
proc ::clay::is_null value {
  return [expr {$value in {{} NULL}}]
}
proc ::clay::leaf args {
  set marker [string index [lindex $args end] end]
  set result [path {*}${args}]
  if {$marker eq "/"} {
    return $result
  }
  return [list {*}[lrange $result 0 end-1] [string trim [string trim [lindex $result end]] /]]
}
proc ::clay::path args {
  set result {}
  foreach item $args {
    set item [string trim $item :./]
    foreach subitem [split $item /] {
      lappend result [string trim ${subitem}]/
    }
  }
  return $result
}
proc ::clay::script_path {} {
  set path [file dirname [file join [pwd] [info script]]]
  return $path
}
proc ::clay::NSNormalize qualname {
  if {![string match ::* $qualname]} {
    set qualname ::clay::classes::$qualname
  }
  regsub -all {::+} $qualname "::"
}
proc ::clay::uuid_generate args {
  return [uuid::uuid generate]
}
namespace eval ::clay {
  variable option_class {}
  variable core_classes {::oo::class ::oo::object}
}
proc ::clay::dynamic_methods class {
  foreach command [info commands [namespace current]::dynamic_methods_*] {
    $command $class
  }
}
proc ::clay::dynamic_methods_class {thisclass} {
  set methods {}
  set mdata [$thisclass clay find class_typemethod]
  foreach {method info} $mdata {
    if {$method eq {.}} continue
    set method [string trimright $method :/-]
    if {$method in $methods} continue
    lappend methods $method
    set arglist [dict getnull $info arglist]
    set body    [dict getnull $info body]
    ::oo::objdefine $thisclass method $method $arglist $body
  }
}
proc ::clay::define::Array {name {values {}}} {
  set class [current_class]
  set name [string trim $name :/]
  $class clay branch array $name
  dict for {var val} $values {
    $class clay set array/ $name $var $val
  }
}
proc ::clay::define::Delegate {name info} {
  set class [current_class]
  foreach {field value} $info {
    $class clay set component/ [string trim $name :/]/ $field $value
  }
}
proc ::clay::define::constructor {arglist rawbody} {
  set body {
my variable DestroyEvent
set DestroyEvent 0
::clay::object_create [self] [info object class [self]]
# Initialize public variables and options
my InitializePublic
  }
  append body $rawbody
  set class [current_class]
  ::oo::define $class constructor $arglist $body
}
proc ::clay::define::Class_Method {name arglist body} {
  set class [current_class]
  $class clay set class_typemethod/ [string trim $name :/] [dict create arglist $arglist body $body]
}
proc ::clay::define::class_method {name arglist body} {
  set class [current_class]
  $class clay set class_typemethod/ [string trim $name :/] [dict create arglist $arglist body $body]
}
proc ::clay::define::clay {args} {
  set class [current_class]
  if {[lindex $args 0] in "cget set branch"} {
    $class clay {*}$args
  } else {
    $class clay set {*}$args
  }
}
proc ::clay::define::destructor rawbody {
  set body {
# Run the destructor once and only once
set self [self]
my variable DestroyEvent
if {$DestroyEvent} return
set DestroyEvent 1
::clay::object_destroy $self
}
  append body $rawbody
  ::oo::define [current_class] destructor $body
}
proc ::clay::define::Dict {name {values {}}} {
  set class [current_class]
  set name [string trim $name :/]
  $class clay branch dict $name
  foreach {var val} $values {
    $class clay set dict/ $name/ $var $val
  }
}
proc ::clay::define::Option {name args} {
  set class [current_class]
  set dictargs {default {}}
  foreach {var val} [::clay::args_to_dict {*}$args] {
    dict set dictargs [string trim $var -:/] $val
  }
  set name [string trimleft $name -]

  ###
  # Option Class handling
  ###
  set optclass [dict getnull $dictargs class]
  if {$optclass ne {}} {
    foreach {f v} [$class clay find option_class $optclass] {
      if {![dict exists $dictargs $f]} {
        dict set dictargs $f $v
      }
    }
    if {$optclass eq "variable"} {
      variable $name [dict getnull $dictargs default]
    }
  }
  foreach {f v} $dictargs {
    $class clay set option $name $f $v
  }
}
proc ::clay::define::Option_Class {name args} {
  set class [current_class]
  set dictargs {default {}}
  set name [string trimleft $name -:]
  foreach {f v} [::clay::args_to_dict {*}$args] {
    $class clay set option_class $name [string trim $f -/:] $v
  }
}
proc ::clay::define::Variable {name {default {}}} {
  set class [current_class]
  set name [string trimright $name :/]
  $class clay set variable/ $name $default
}
proc ::clay::object_create {objname {class {}}} {
  #if {$::clay::trace>0} {
  #  puts [list $objname CREATE]
  #}
}
proc ::clay::object_rename {object newname} {
  if {$::clay::trace>0} {
    puts [list $object RENAME -> $newname]
  }
}
proc ::clay::object_destroy objname {
  if {$::clay::trace>0} {
    puts [list $objname DESTROY]
  }
  ::cron::object_destroy $objname
}
::namespace eval ::clay::define {
}
proc ::clay::ensemble_methodbody {ensemble einfo} {
  set default standard
  set preamble {}
  set eswitch {}
  if {[dict exists $einfo default]} {
    set emethodinfo [dict get $einfo default]
    set arglist     [dict getnull $emethodinfo arglist]
    set realbody    [dict get $emethodinfo body]
    if {[llength $arglist]==1 && [lindex $arglist 0] in {{} args arglist}} {
      set body {}
    } else {
      set body "\n      ::clay::dynamic_arguments $ensemble \$method [list $arglist] {*}\$args"
    }
    append body "\n      " [string trim $realbody] "      \n"
    set default $body
    dict unset einfo default
  }
  foreach {msubmethod esubmethodinfo} [lsort -dictionary -stride 2 $einfo] {
    set submethod [string trim $msubmethod :/-]
    if {$submethod eq "_body"} continue
    if {$submethod eq "_preamble"} {
      set preamble [dict getnull $esubmethodinfo body]
      continue
    }
    set arglist     [dict getnull $esubmethodinfo arglist]
    set realbody    [dict getnull $esubmethodinfo body]
    if {[string length [string trim $realbody]] eq {}} {
      dict set eswitch $submethod {}
    } else {
      if {[llength $arglist]==1 && [lindex $arglist 0] in {{} args arglist}} {
        set body {}
      } else {
        set body "\n      ::clay::dynamic_arguments $ensemble \$method [list $arglist] {*}\$args"
      }
      append body "\n      " [string trim $realbody] "      \n"
      if {$submethod eq "default"} {
        set default $body
      } else {
        foreach alias [dict getnull $esubmethodinfo aliases] {
          dict set eswitch $alias -
        }
        dict set eswitch $submethod $body
      }
    }
  }
  set methodlist [lsort -dictionary [dict keys $eswitch]]
  if {![dict exists $eswitch <list>]} {
    dict set eswitch <list> {return $methodlist}
  }
  if {$default eq "standard"} {
    set default "error \"unknown method $ensemble \$method. Valid: \$methodlist\""
  }
  dict set eswitch default $default
  set mbody {}

  append mbody $preamble \n

  append mbody \n [list set methodlist $methodlist]
  append mbody \n "set code \[catch {switch -- \$method [list $eswitch]} result opts\]"
  append mbody \n {return -options $opts $result}
  return $mbody
}
::proc ::clay::define::Ensemble {rawmethod arglist body} {
  set class [current_class]
  #if {$::clay::trace>2} {
  #  puts [list $class Ensemble $rawmethod $arglist $body]
  #}
  set mlist [split $rawmethod "::"]
  set ensemble [string trim [lindex $mlist 0] :/]
  set mensemble ${ensemble}/
  if {[llength $mlist]==1 || [lindex $mlist 1] in "_body"} {
    set method _body
    ###
    # Simple method, needs no parsing, but we do need to record we have one
    ###
    $class clay set method_ensemble/ $mensemble _body [dict create arglist $arglist body $body]
    if {$::clay::trace>2} {
      puts [list $class clay set method_ensemble/ $mensemble _body ...]
    }
    set method $rawmethod
    if {$::clay::trace>2} {
      puts [list $class Ensemble $rawmethod $arglist $body]
      set rawbody $body
      set body {puts [list [self] $class [self method]]}
      append body \n $rawbody
    }
    ::oo::define $class method $rawmethod $arglist $body
    return
  }
  set method [join [lrange $mlist 2 end] "::"]
  $class clay set method_ensemble/ $mensemble [string trim [lindex $method 0] :/] [dict create arglist $arglist body $body]
  if {$::clay::trace>2} {
    puts [list $class clay set method_ensemble/ $mensemble [string trim $method :/]  ...]
  }
}
::oo::define ::clay::class {
  method clay {submethod args} {
    my variable clay
    if {![info exists clay]} {
      set clay {}
    }
    switch $submethod {
      ancestors {
        tailcall ::clay::ancestors [self]
      }
      branch {
        set path [::dicttool::storage $args]
        if {![dict exists $clay {*}$path .]} {
          dict set clay {*}$path . {}
        }
      }
      exists {
        if {![info exists clay]} {
          return 0
        }
        set path [::dicttool::storage $args]
        if {[dict exists $clay {*}$path]} {
          return 1
        }
        if {[dict exists $clay {*}[lrange $path 0 end-1] [lindex $path end]:]} {
          return 1
        }
        return 0
      }
      dump {
        return $clay
      }
      dget {
         if {![info exists clay]} {
          return {}
        }
        set path [::dicttool::storage $args]
        if {[dict exists $clay {*}$path]} {
          return [dict get $clay {*}$path]
        }
        if {[dict exists $clay {*}[lrange $path 0 end-1] [lindex $path end]:]} {
          return [dict get $clay {*}[lrange $path 0 end-1] [lindex $path end]:]
        }
        return {}
      }
      is_branch {
        set path [::dicttool::storage $args]
        return [dict exists $clay {*}$path .]
      }
      getnull -
      get {
        if {![info exists clay]} {
          return {}
        }
        set path [::dicttool::storage $args]
        if {[llength $path]==0} {
          return $clay
        }
        if {[dict exists $clay {*}$path .]} {
          return [::dicttool::sanitize [dict get $clay {*}$path]]
        }
        if {[dict exists $clay {*}$path]} {
          return [dict get $clay {*}$path]
        }
        if {[dict exists $clay {*}[lrange $path 0 end-1] [lindex $path end]:]} {
          return [dict get $clay {*}[lrange $path 0 end-1] [lindex $path end]:]
        }
        return {}
      }
      find {
        set path [::dicttool::storage $args]
        if {![info exists clay]} {
          set clay {}
        }
        set clayorder [::clay::ancestors [self]]
        set found 0
        if {[llength $path]==0} {
          set result [dict create . {}]
          foreach class $clayorder {
            ::dicttool::dictmerge result [$class clay dump]
          }
          return [::dicttool::sanitize $result]
        }
        foreach class $clayorder {
          if {[$class clay exists {*}$path .]} {
            # Found a branch break
            set found 1
            break
          }
          if {[$class clay exists {*}$path]} {
            # Found a leaf. Return that value immediately
            return [$class clay get {*}$path]
          }
          if {[dict exists $clay {*}[lrange $path 0 end-1] [lindex $path end]:]} {
            return [dict get $clay {*}[lrange $path 0 end-1] [lindex $path end]:]
          }
        }
        if {!$found} {
          return {}
        }
        set result {}
        # Leaf searches return one data field at a time
        # Search in our local dict
        # Search in the in our list of classes for an answer
        foreach class [lreverse $clayorder] {
          ::dicttool::dictmerge result [$class clay dget {*}$path]
        }
        return [::dicttool::sanitize $result]
      }
      merge {
        foreach arg $args {
          ::dicttool::dictmerge clay {*}$arg
        }
      }
      noop {
        # Do nothing. Used as a sign of clay savviness
      }
      search {
        foreach aclass [::clay::ancestors [self]] {
          if {[$aclass clay exists {*}$args]} {
            return [$aclass clay get {*}$args]
          }
        }
      }
      set {
        ::dicttool::dictset clay {*}$args
      }
      unset {
        dict unset clay {*}$args
      }
      default {
        dict $submethod clay {*}$args
      }
    }
  }
}
::oo::define ::clay::object {
  method clay {submethod args} {
    my variable clay claycache clayorder config option_canonical
    if {![info exists clay]} {set clay {}}
    if {![info exists claycache]} {set claycache {}}
    if {![info exists config]} {set config {}}
    if {![info exists clayorder] || [llength $clayorder]==0} {
      set clayorder [::clay::ancestors [info object class [self]] {*}[lreverse [info object mixins [self]]]]
    }
    switch $submethod {
      ancestors {
        return $clayorder
      }
      branch {
        set path [::dicttool::storage $args]
        if {![dict exists $clay {*}$path .]} {
          dict set clay {*}$path . {}
        }
      }
      cget {
        # Leaf searches return one data field at a time
        # Search in our local dict
        if {[llength $args]==1} {
          set field [string trim [lindex $args 0] -:/]
          if {[info exists option_canonical($field)]} {
            set field $option_canonical($field)
          }
          if {[dict exists $config $field]} {
            return [dict get $config $field]
          }
        }
        set path [::dicttool::storage $args]
        if {[dict exists $clay {*}$path]} {
          return [dict get $clay {*}$path]
        }
        # Search in our local cache
        if {[dict exists $claycache {*}$path]} {
          if {[dict exists $claycache {*}$path .]} {
            return [dict remove [dict get $claycache {*}$path] .]
          } else {
            return [dict get $claycache {*}$path]
          }
        }
        # Search in the in our list of classes for an answer
        foreach class $clayorder {
          if {[$class clay exists {*}$path]} {
            set value [$class clay get {*}$path]
            dict set claycache {*}$path $value
            return $value
          }
          if {[$class clay exists const {*}$path]} {
            set value [$class clay get const {*}$path]
            dict set claycache {*}$path $value
            return $value
          }
          if {[$class clay exists option {*}$path default]} {
            set value [$class clay get option {*}$path default]
            dict set claycache {*}$path $value
            return $value
          }
        }
        return {}
      }
      delegate {
        if {![dict exists $clay .delegate <class>]} {
          dict set clay .delegate <class> [info object class [self]]
        }
        if {[llength $args]==0} {
          return [dict get $clay .delegate]
        }
        if {[llength $args]==1} {
          set stub <[string trim [lindex $args 0] <>]>
          if {![dict exists $clay .delegate $stub]} {
            return {}
          }
          return [dict get $clay .delegate $stub]
        }
        if {([llength $args] % 2)} {
          error "Usage: delegate
    OR
    delegate stub
    OR
    delegate stub OBJECT ?stub OBJECT? ..."
        }
        foreach {stub object} $args {
          set stub <[string trim $stub <>]>
          dict set clay .delegate $stub $object
          oo::objdefine [self] forward ${stub} $object
          oo::objdefine [self] export ${stub}
        }
      }
      dump {
        # Do a full dump of clay data
        set result {}
        # Search in the in our list of classes for an answer
        foreach class $clayorder {
          ::dicttool::dictmerge result [$class clay dump]
        }
        ::dicttool::dictmerge result $clay
        return $result
      }
      ensemble_map {
        set ensemble [lindex $args 0]
        my variable claycache
        set mensemble [string trim $ensemble :/]
        if {[dict exists $claycache method_ensemble $mensemble]} {
          return [dicttool::sanitize [dict get $claycache method_ensemble $mensemble]]
        }
        set emap [my clay dget method_ensemble $mensemble]
        dict set claycache method_ensemble $mensemble $emap
        return [dicttool::sanitize $emap]
      }
      eval {
        set script [lindex $args 0]
        set buffer {}
        set thisline {}
        foreach line [split $script \n] {
          append thisline $line
          if {![info complete $thisline]} {
            append thisline \n
            continue
          }
          set thisline [string trim $thisline]
          if {[string index $thisline 0] eq "#"} continue
          if {[string length $thisline]==0} continue
          if {[lindex $thisline 0] eq "my"} {
            # Line already calls out "my", accept verbatim
            append buffer $thisline \n
          } elseif {[string range $thisline 0 2] eq "::"} {
            # Fully qualified commands accepted verbatim
            append buffer $thisline \n
          } elseif {
            append buffer "my $thisline" \n
          }
          set thisline {}
        }
        eval $buffer
      }
      evolve -
      initialize {
        my InitializePublic
      }
      exists {
        # Leaf searches return one data field at a time
        # Search in our local dict
        set path [::dicttool::storage $args]
        if {[dict exists $clay {*}$path]} {
          return 1
        }
        # Search in our local cache
        if {[dict exists $claycache {*}$path]} {
          return 2
        }
        set count 2
        # Search in the in our list of classes for an answer
        foreach class $clayorder {
          incr count
          if {[$class clay exists {*}$path]} {
            return $count
          }
        }
        return 0
      }
      flush {
        set claycache {}
        set clayorder [::clay::ancestors [info object class [self]] {*}[lreverse [info object mixins [self]]]]
      }
      forward {
        oo::objdefine [self] forward {*}$args
      }
      dget {
        set path [::dicttool::storage $args]
        if {[llength $path]==0} {
          # Do a full dump of clay data
          set result {}
          # Search in the in our list of classes for an answer
          foreach class $clayorder {
            ::dicttool::dictmerge result [$class clay dump]
          }
          ::dicttool::dictmerge result $clay
          return $result
        }
        # Search in our local cache
        if {[dict exists $claycache {*}$path .]} {
          return [dict get $claycache {*}$path]
        }
        if {[dict exists $claycache {*}$path]} {
          return [dict get $claycache {*}$path]
        }
        if {[dict exists $clay {*}$path] && ![dict exists $clay {*}$path .]} {
          # Path is a leaf
          return [dict get $clay {*}$path]
        }
        set found 0
        set branch [dict exists $clay {*}$path .]
        foreach class $clayorder {
          if {[$class clay exists {*}$path .]} {
            set found 1
            break
          }
          if {!$branch && [$class clay exists {*}$path]} {
            set result [$class clay dget {*}$path]
            dict set claycache {*}$path $result
            return $result
          }
        }
        # Path is a branch
        set result [dict getnull $clay {*}$path]
        foreach class $clayorder {
          if {![$class clay exists {*}$path .]} continue
          ::dicttool::dictmerge result [$class clay dget {*}$path]
        }
        #if {[dict exists $clay {*}$path .]} {
        #  ::dicttool::dictmerge result
        #}
        dict set claycache {*}$path $result
        return $result
      }
      getnull -
      get {
        set path [::dicttool::storage $args]
        if {[llength $path]==0} {
          # Do a full dump of clay data
          set result {}
          # Search in the in our list of classes for an answer
          foreach class $clayorder {
            ::dicttool::dictmerge result [$class clay dump]
          }
          ::dicttool::dictmerge result $clay
          return [::dicttool::sanitize $result]
        }
        # Search in our local cache
        if {[dict exists $claycache {*}$path .]} {
          return [::dicttool::sanitize [dict get $claycache {*}$path]]
        }
        if {[dict exists $claycache {*}$path]} {
          return [dict get $claycache {*}$path]
        }
        if {[dict exists $clay {*}$path] && ![dict exists $clay {*}$path .]} {
          # Path is a leaf
          return [dict get $clay {*}$path]
        }
        set found 0
        set branch [dict exists $clay {*}$path .]
        foreach class $clayorder {
          if {[$class clay exists {*}$path .]} {
            set found 1
            break
          }
          if {!$branch && [$class clay exists {*}$path]} {
            set result [$class clay dget {*}$path]
            dict set claycache {*}$path $result
            return $result
          }
        }
        # Path is a branch
        set result [dict getnull $clay {*}$path]
        #foreach class [lreverse $clayorder] {
        #  if {![$class clay exists {*}$path .]} continue
        #  ::dicttool::dictmerge result [$class clay dget {*}$path]
        #}
        foreach class $clayorder {
          if {![$class clay exists {*}$path .]} continue
          ::dicttool::dictmerge result [$class clay dget {*}$path]
        }
        #if {[dict exists $clay {*}$path .]} {
        #  ::dicttool::dictmerge result [dict get $clay {*}$path]
        #}
        dict set claycache {*}$path $result
        return [dicttool::sanitize $result]
      }
      leaf {
        # Leaf searches return one data field at a time
        # Search in our local dict
        set path [::dicttool::storage $args]
        if {[dict exists $clay {*}$path .]} {
          return [dicttool::sanitize [dict get $clay {*}$path]]
        }
        if {[dict exists $clay {*}$path]} {
          return [dict get $clay {*}$path]
        }
        # Search in our local cache
        if {[dict exists $claycache {*}$path .]} {
          return [dicttool::sanitize [dict get $claycache {*}$path]]
        }
        if {[dict exists $claycache {*}$path]} {
          return [dict get $claycache {*}$path]
        }
        # Search in the in our list of classes for an answer
        foreach class $clayorder {
          if {[$class clay exists {*}$path]} {
            set value [$class clay get {*}$path]
            dict set claycache {*}$path $value
            return $value
          }
        }
      }
      merge {
        foreach arg $args {
          ::dicttool::dictmerge clay {*}$arg
        }
      }
      mixin {
        ###
        # Mix in the class
        ###
        set prior  [info object mixins [self]]
        set newmixin {}
        foreach item $args {
          lappend newmixin ::[string trimleft $item :]
        }
        set newmap $args
        foreach class $prior {
          if {$class ni $newmixin} {
            set script [$class clay search mixin/ unmap-script]
            if {[string length $script]} {
              if {[catch $script err errdat]} {
                puts stderr "[self] MIXIN ERROR POPPING $class:\n[dict get $errdat -errorinfo]"
              }
            }
          }
        }
        ::oo::objdefine [self] mixin {*}$args
        ###
        # Build a compsite map of all ensembles defined by the object's current
        # class as well as all of the classes being mixed in
        ###
        my InitializePublic
        foreach class $newmixin {
          if {$class ni $prior} {
            set script [$class clay search mixin/ map-script]
            if {[string length $script]} {
              if {[catch $script err errdat]} {
                puts stderr "[self] MIXIN ERROR PUSHING $class:\n[dict get $errdat -errorinfo]"
              }
            }
          }
        }
        foreach class $newmixin {
          set script [$class clay search mixin/ react-script]
          if {[string length $script]} {
            if {[catch $script err errdat]} {
              puts stderr "[self] MIXIN ERROR PEEKING $class:\n[dict get $errdat -errorinfo]"
            }
            break
          }
        }
      }
      mixinmap {
        my variable clay
        if {![dict exists $clay .mixin]} {
          dict set clay .mixin {}
        }
        if {[llength $args]==0} {
          return [dict get $clay .mixin]
        } elseif {[llength $args]==1} {
          return [dict getnull $clay .mixin [lindex $args 0]]
        } else {
          dict for {slot classes} $args {
            dict set clay .mixin $slot $classes
          }
          set classlist {}
          dict for {item class} [dict get $clay .mixin] {
            if {$class ne {}} {
              lappend classlist $class
            }
          }
          my clay mixin {*}[lreverse $classlist]
        }
      }
      provenance {
        if {[dict exists $clay {*}$args]} {
          return self
        }
        foreach class $clayorder {
          if {[$class clay exists {*}$args]} {
            return $class
          }
        }
        return {}
      }
      replace {
        set clay [lindex $args 0]
      }
      source {
        source [lindex $args 0]
      }
      set {
        #puts [list [self] clay SET {*}$args]
        set claycache {}
        ::dicttool::dictset clay {*}$args
      }
      default {
        dict $submethod clay {*}$args
      }
    }
  }
  method InitializePublic {} {
    my variable clayorder clay claycache config option_canonical
    set claycache {}
    set clayorder [::clay::ancestors [info object class [self]] {*}[lreverse [info object mixins [self]]]]
    if {![info exists clay]} {
      set clay {}
    }
    if {![info exists config]} {
      set config {}
    }
    dict for {var value} [my clay get variable] {
      if { $var in {. clay} } continue
      set var [string trim $var :/]
      my variable $var
      if {![info exists $var]} {
        if {$::clay::trace>2} {puts [list initialize variable $var $value]}
        set $var $value
      }
    }
    dict for {var value} [my clay get dict/] {
      if { $var in {. clay} } continue
      set var [string trim $var :/]
      my variable $var
      if {![info exists $var]} {
        set $var {}
      }
      foreach {f v} $value {
        if {$f eq "."} continue
        if {![dict exists ${var} $f]} {
          if {$::clay::trace>2} {puts [list initialize dict $var $f $v]}
          dict set ${var} $f $v
        }
      }
    }
    foreach {var value} [my clay get array/] {
      if { $var in {. clay} } continue
      set var [string trim $var :/]
      if { $var eq {clay} } continue
      my variable $var
      if {![info exists $var]} { array set $var {} }
      foreach {f v} $value {
        if {![array exists ${var}($f)]} {
          if {$f eq "."} continue
          if {$::clay::trace>2} {puts [list initialize array $var\($f\) $v]}
          set ${var}($f) $v
        }
      }
    }
    foreach {field info} [my clay get option/] {
      if { $field in {. clay} } continue
      set field [string trim $field -/:]
      foreach alias [dict getnull $info aliases] {
        set option_canonical($alias) $field
      }
      if {[dict exists $config $field]} continue
      set getcmd [dict getnull $info default-command]
      if {$getcmd ne {}} {
        set value [{*}[string map [list %field% $field %self% [namespace which my]] $getcmd]]
      } else {
        set value [dict getnull $info default]
      }
      dict set config $field $value
      set setcmd [dict getnull $info set-command]
      if {$setcmd ne {}} {
        {*}[string map [list %field% [list $field] %value% [list $value] %self% [namespace which my]] $setcmd]
      }
    }
    my variable clayorder clay claycache
    if {[info exists clay]} {
      set emap [dict getnull $clay method_ensemble]
    } else {
      set emap {}
    }
    foreach class [lreverse $clayorder] {
      ###
      # Build a compsite map of all ensembles defined by the object's current
      # class as well as all of the classes being mixed in
      ###
      dict for {mensemble einfo} [$class clay get method_ensemble] {
        if {$mensemble eq {.}} continue
        set ensemble [string trim $mensemble :/]
        if {$::clay::trace>2} {puts [list Defining $ensemble from $class]}

        dict for {method info} $einfo {
          if {$method eq {.}} continue
          if {![dict is_dict $info]} {
            puts [list WARNING: class: $class method: $method not dict: $info]
            continue
          }
          dict set info source $class
          if {$::clay::trace>2} {puts [list Defining $ensemble -> $method from $class - $info]}
          dict set emap $ensemble $method $info
        }
      }
    }
    foreach {ensemble einfo} $emap {
      #if {[dict exists $einfo _body]} continue
      set body [::clay::ensemble_methodbody $ensemble $einfo]
      if {$::clay::trace>2} {
        set rawbody $body
        set body {puts [list [self] <object> [self method]]}
        append body \n $rawbody
      }
      oo::objdefine [self] method $ensemble {{method default} args} $body
    }
  }
}
::clay::object clay branch array
::clay::object clay branch mixin
::clay::object clay branch option
::clay::object clay branch dict clay
::clay::object clay set variable DestroyEvent 0
namespace eval ::clay {
  namespace export *
}

###
# END: clay/clay.tcl
###
###
# START: setup.tcl
###
package require TclOO
set tcllib_path {}
foreach path {.. ../.. ../../..} {
  foreach path [glob -nocomplain [file join [file normalize $path] tcllib* modules]] {
    set tclib_path $path
    lappend ::auto_path $path
    break
  }
  if {$tcllib_path ne {}} break
}
namespace eval ::practcl {
}
namespace eval ::practcl::OBJECT {
}

###
# END: setup.tcl
###
###
# START: doctool.tcl
###
namespace eval ::practcl {
}
proc ::practcl::cat fname {
    if {![file exists $fname]} {
       return
    }
    set fin [open $fname r]
    set data [read $fin]
    close $fin
    return $data
}
proc ::practcl::docstrip text {
  set result {}
  foreach line [split $text \n] {
    append thisline $line \n
    if {![info complete $thisline]} continue
    set outline $thisline
    set thisline {}
    if {[string trim $outline] eq {}} {
      continue
    }
    if {[string index [string trim $outline] 0] eq "#"} continue
    set cmd [string trim [lindex $outline 0] :]
    if {$cmd eq "namespace" && [lindex $outline 1] eq "eval"} {
      append result [list {*}[lrange $outline 0 end-1]] " " \{ \n [docstrip [lindex $outline end]]\} \n
      continue
    }
    if {[string match "*::define" $cmd] && [llength $outline]==3} {
      append result [list {*}[lrange $outline 0 end-1]] " " \{ \n [docstrip [lindex $outline end]]\} \n
      continue
    }
    if {$cmd eq "oo::class" && [lindex $outline 1] eq "create"} {
      append result [list {*}[lrange $outline 0 end-1]] " " \{ \n [docstrip [lindex $outline end]]\} \n
      continue
    }
    append result $outline
  }
  return $result
}
proc ::putb {buffername args} {
  upvar 1 $buffername buffer
  switch [llength $args] {
    1 {
      append buffer [lindex $args 0] \n
    }
    2 {
      append buffer [string map {*}$args] \n
    }
    default {
      error "usage: putb buffername ?map? string"
    }
  }
}
::oo::class create ::practcl::doctool {
  constructor {} {
    my reset
  }
  method arglist {arglist} {
    set result [dict create]
    foreach arg $arglist {
      set name [lindex $arg 0]
      dict set result $name positional 1
      dict set result $name mandatory  1
      if {$name in {args dictargs}} {
        switch [llength $arg] {
          1 {
            dict set result $name mandatory 0
          }
          2 {
            dict for {optname optinfo} [lindex $arg 1] {
              set optname [string trim $optname -:]
              dict set result $optname {positional 1 mandatory 0}
              dict for {f v} $optinfo {
                dict set result $optname [string trim $f -:] $v
              }
            }
          }
          default {
            error "Bad argument"
          }
        }
      } else {
        switch [llength $arg] {
          1 {
            dict set result $name mandatory 1
          }
          2 {
            dict set result $name mandatory 0
            dict set result $name default   [lindex $arg 1]
          }
          default {
            error "Bad argument"
          }
        }
      }
    }
    return $result
  }
  method comment block {
    set count 0
    set field description
    set result [dict create description {}]
    foreach line [split $block \n] {
      set sline [string trim $line]
      set fwidx [string first " " $sline]
      if {$fwidx < 0} {
        set firstword [string range $sline 0 end]
        set restline {}
      } else {
        set firstword [string range $sline 0 [expr {$fwidx-1}]]
        set restline [string range $sline [expr {$fwidx+1}] end]
      }
      if {[string index $firstword end] eq ":"} {
        set field [string tolower [string trim $firstword -:]]
        switch $field {
          desc {
            set field description
          }
        }
        if {[string length $restline]} {
          dict append result $field "$restline\n"
        }
      } else {
        dict append result $field "$line\n"
      }
    }
    return $result
  }
  method keyword.Annotation {resultvar commentblock type name body} {
    upvar 1 $resultvar result
    set name [string trim $name :]
    if {[dict exists $result $type $name]} {
      set info [dict get $result $type $name]
    } else {
      set info [my comment $commentblock]
    }
    foreach {f v} $body {
      dict set info $f $v
    }
    dict set result $type $name $info
  }
  method keyword.Class {resultvar commentblock name body} {
    upvar 1 $resultvar result
    set name [string trim $name :]
    if {[dict exists $result class $name]} {
      set info [dict get $result class $name]
    } else {
      set info [my comment $commentblock]
    }
    set commentblock {}
    foreach line [split $body \n] {
      append thisline $line \n
      if {![info complete $thisline]} continue
      set thisline [string trim $thisline]
      if {[string index $thisline 0] eq "#"} {
        append commentblock [string trimleft $thisline #] \n
        set thisline {}
        continue
      }
      set cmd [string trim [lindex $thisline 0] ":"]
      switch $cmd {
        Option -
        option {
          my keyword.Annotation info $commentblock option [lindex $thisline 1] [lindex $thisline 2]
          set commentblock {}
        }
        variable -
        Variable {
          my keyword.Annotation info $commentblock variable [lindex $thisline 1] [list type scaler default [lindex $thisline 2]]
          set commentblock {}
        }
        Dict -
        Array {
          set iinfo [lindex $thisline 2]
          dict set iinfo type [string tolower $cmd]
          my keyword.Annotation info $commentblock variable [lindex $thisline 1] $iinfo
          set commentblock {}
        }
        Componant -
        Delegate {
          my keyword.Annotation info $commentblock delegate [lindex $thisline 1] [lindex $thisline 2]
          set commentblock {}
        }
        method -
        Ensemble {
          my keyword.Class_Method info $commentblock  {*}[lrange $thisline 1 end-1]
          set commentblock {}
        }
      }
      set thisline {}
    }
    dict set result class $name $info
  }
  method keyword.class {resultvar commentblock name body} {
    upvar 1 $resultvar result
    set name [string trim $name :]
    if {[dict exists $result class $name]} {
      set info [dict get $result class $name]
    } else {
      set info [my comment $commentblock]
    }
    set commentblock {}
    foreach line [split $body \n] {
      append thisline $line \n
      if {![info complete $thisline]} continue
      set thisline [string trim $thisline]
      if {[string index $thisline 0] eq "#"} {
        append commentblock [string trimleft $thisline #] \n
        set thisline {}
        continue
      }
      set cmd [string trim [lindex $thisline 0] ":"]
      switch $cmd {
        Option -
        option {
          puts [list keyword.Annotation $cmd $thisline]
          my keyword.Annotation info $commentblock option [lindex $thisline 1] [lindex $thisline 2]
          set commentblock {}
        }
        variable -
        Variable {
          my keyword.Annotation info $commentblock variable [lindex $thisline 1] [list default [lindex $thisline 2]]
          set commentblock {}
        }
        Dict -
        Array {
          set iinfo [lindex $thisline 2]
          dict set iinfo type [string tolower $cmd]
          my keyword.Annotation info $commentblock variable [lindex $thisline 1] $iinfo
          set commentblock {}
        }
        Componant -
        Delegate {
          my keyword.Annotation info $commentblock delegate [lindex $thisline 1] [lindex $thisline 2]
          set commentblock {}
        }
        superclass {
          dict set info ancestors [lrange $thisline 1 end]
          set commentblock {}
        }
        classmethod -
        class_method -
        Class_Method {
          my keyword.Class_Method info $commentblock  {*}[lrange $thisline 1 end-1]
          set commentblock {}
        }
        destructor -
        constructor {
          my keyword.method info $commentblock {*}[lrange $thisline 0 end-1]
          set commentblock {}
        }
        method -
        Ensemble {
          my keyword.method info $commentblock  {*}[lrange $thisline 1 end-1]
          set commentblock {}
        }
      }
      set thisline {}
    }
    dict set result class $name $info
  }
  method keyword.Class_Method {resultvar commentblock name args} {
    upvar 1 $resultvar result
    set info [my comment $commentblock]
    if {[dict exists $info show_body] && [dict get $info show_body]} {
      dict set info internals [lindex $args end]
    }
    if {[dict exists $info ensemble]} {
      dict for {method minfo} [dict get $info ensemble] {
        dict set result Class_Method "${name} $method" $minfo
      }
    } else {
      switch [llength $args] {
        1 {
          set arglist [lindex $args 0]
        }
        0 {
          set arglist dictargs
          #set body [lindex $args 0]
        }
        default {error "could not interpret method $name {*}$args"}
      }
      if {![dict exists $info arglist]} {
        dict set info arglist [my arglist $arglist]
      }
      dict set result Class_Method [string trim $name :] $info
    }
  }
  method keyword.method {resultvar commentblock name args} {
    upvar 1 $resultvar result
    set info [my comment $commentblock]
    if {[dict exists $info show_body] && [dict get $info show_body]} {
      dict set info internals [lindex $args end]
    }
    if {[dict exists $info ensemble]} {
      dict for {method minfo} [dict get $info ensemble] {
        dict set result method "\"${name} $method\"" $minfo
      }
    } else {
      switch [llength $args] {
        1 {
          set arglist [lindex $args 0]
        }
        0 {
          set arglist dictargs
          #set body [lindex $args 0]
        }
        default {error "could not interpret method $name {*}$args"}
      }
      if {![dict exists $info arglist]} {
        dict set info arglist [my arglist $arglist]
      }
      dict set result method "\"[split [string trim $name :] ::]\"" $info
    }
  }
  method keyword.proc {commentblock name arglist} {
    set info [my comment $commentblock]
    if {![dict exists $info arglist]} {
      dict set info arglist [my arglist $arglist]
    }
    return $info
  }
  method reset {} {
    my variable coro
    set coro [info object namespace [self]]::coro
    oo::objdefine [self] forward coro $coro
    if {[info command $coro] ne {}} {
      rename $coro {}
    }
    coroutine $coro {*}[namespace code {my Main}]
  }
  method Main {} {

    my variable info
    set info [dict create]
    yield [info coroutine]
    set thisline {}
    set commentblock {}
    set linec 0
    while 1 {
      set line [yield]
      append thisline $line \n
      if {![info complete $thisline]} continue
      set thisline [string trim $thisline]
      if {[string index $thisline 0] eq "#"} {
        append commentblock [string trimleft $thisline #] \n
        set thisline {}
        continue
      }
      set cmd [string trim [lindex $thisline 0] ":"]
      switch $cmd {
        dictargs::proc {
          set procinfo [my keyword.proc $commentblock [lindex $thisline 1] [list args [list dictargs [lindex $thisline 2]]]]
          if {[dict exists $procinfo show_body] && [dict get $procinfo show_body]} {
            dict set procinfo internals [lindex $thisline end]
          }
          dict set info proc [string trim [lindex $thisline 1] :] $procinfo
          set commentblock {}
        }
        tcllib::PROC -
        PROC -
        Proc -
        proc {
          set procinfo [my keyword.proc $commentblock {*}[lrange $thisline 1 2]]
          if {[dict exists $procinfo show_body] && [dict get $procinfo show_body]} {
            dict set procinfo internals [lindex $thisline end]
          }
          dict set info proc [string trim [lindex $thisline 1] :] $procinfo
          set commentblock {}
        }
        oo::objdefine {
          if {[llength $thisline]==3} {
            lassign $thisline tcmd name body
            my keyword.Class info $commentblock $name $body
          } else {
            puts "Warning: bare oo::define in library"
          }
        }
        oo::define {
          if {[llength $thisline]==3} {
            lassign $thisline tcmd name body
            my keyword.class info $commentblock $name $body
          } else {
            puts "Warning: bare oo::define in library"
          }
        }
        tao::define -
        clay::define -
        tool::define {
          lassign $thisline tcmd name body
          my keyword.class info $commentblock $name $body
          set commentblock {}
        }
        oo::class {
          lassign $thisline tcmd mthd name body
          my keyword.class info $commentblock $name $body
          set commentblock {}
        }
        default {
          if {[lindex [split $cmd ::] end] eq "define"} {
            lassign $thisline tcmd name body
            my keyword.class info $commentblock $name $body
            set commentblock {}
          }
          set commentblock {}
        }
      }
      set thisline {}
    }
  }
  method section.method {keyword method minfo} {
    set result {}
    set line "\[call $keyword \[cmd $method\]"
    if {[dict exists $minfo arglist]} {
      dict for {argname arginfo} [dict get $minfo arglist] {
        set positional 1
        set mandatory  1
        set repeating 0
        dict with arginfo {}
        if {$mandatory==0} {
          append line " \[opt \""
        } else {
          append line " "
        }
        if {$positional} {
          append line "\[arg $argname"
        } else {
          append line "\[option \"$argname"
          if {[dict exists $arginfo type]} {
            append line " \[emph [dict get $arginfo type]\]"
          } else {
            append line " \[emph value\]"
          }
          append line "\""
        }
        append line "\]"
        if {$mandatory==0} {
          if {[dict exists $arginfo default]} {
            append line " \[const \"[dict get $arginfo default]\"\]"
          }
          append line "\"\]"
        }
        if {$repeating} {
          append line " \[opt \[option \"$argname...\"\]\]"
        }
      }
    }
    append line \]
    putb result $line
    if {[dict exists $minfo description]} {
      putb result [dict get $minfo description]
    }
    if {[dict exists $minfo example]} {
      putb result "\[para\]Example: \[example [list [dict get $minfo example]]\]"
    }
    if {[dict exists $minfo internals]} {
      putb result "\[para\]Internals: \[example [list [dict get $minfo internals]]\]"
    }
    return $result
  }
  method section.annotation {type name iinfo} {
    set result "\[call $type \[cmd $name\]\]"
    if {[dict exists $iinfo description]} {
      putb result [dict get $iinfo description]
    }
    if {[dict exists $iinfo example]} {
      putb result "\[para\]Example: \[example [list [dict get $minfo example]]\]"
    }
    return $result
  }
  method section.class {class_name class_info} {
    set result {}
    putb result "\[subsection \{Class  $class_name\}\]"
    if {[dict exists $class_info ancestors]} {
      set line "\[emph \"ancestors\"\]:"
      foreach {c} [dict get $class_info ancestors] {
        append line " \[class [string trim $c :]\]"
      }
      putb result $line
      putb result {[para]}
    }
    dict for {f v} $class_info {
      if {$f in {Class_Method method description ancestors example option variable delegate}} continue
      putb result "\[emph \"$f\"\]: $v"
      putb result {[para]}
    }
    if {[dict exists $class_info example]} {
      putb result "\[example \{[list [dict get $class_info example]]\}\]"
      putb result {[para]}
    }
    if {[dict exists $class_info description]} {
      putb result [dict get $class_info description]
      putb result {[para]}
    }
    dict for {f v} $class_info {
      if {$f ni {option variable delegate}} continue
      putb result "\[class \{[string totitle $f]\}\]"
      #putb result "Methods on the class object itself."
      putb result {[list_begin definitions]}
      dict for {item iinfo} [dict get $class_info $f] {
        putb result [my section.annotation $f $item $iinfo]
      }
      putb result {[list_end]}
      putb result {[para]}
    }
    if {[dict exists $class_info Class_Method]} {
      putb result "\[class \{Class Methods\}\]"
      #putb result "Methods on the class object itself."
      putb result {[list_begin definitions]}
      dict for {method minfo} [dict get $class_info Class_Method] {
        putb result [my section.method classmethod $method $minfo]
      }
      putb result {[list_end]}
      putb result {[para]}
    }
    if {[dict exists $class_info method]} {
      putb result "\[class {Methods}\]"
      putb result {[list_begin definitions]}
      dict for {method minfo} [dict get $class_info method] {
        putb result [my section.method method $method $minfo]
      }
      putb result {[list_end]}
      putb result {[para]}
    }
    return $result
  }
  method section.command {procinfo} {
    set result {}
    putb result "\[section \{Commands\}\]"
    putb result {[list_begin definitions]}
    dict for {method minfo} $procinfo {
      putb result [my section.method proc $method $minfo]
    }
    putb result {[list_end]}
    return $result
  }
  method manpage args {
    my variable info
    set map {%version% 0.0 %module% {Your_Module_Here}}
    set result {}
    set header {}
    set footer {}
    set authors {}
    dict with args {}
    dict set map %keyword% comment
    putb result $map {[%keyword% {-*- tcl -*- doctools manpage}]
[vset PACKAGE_VERSION %version%]
[manpage_begin %module% n [vset PACKAGE_VERSION]]}
    putb result $map $header

    dict for {sec_type sec_info} $info {
      switch $sec_type {
        proc {
          putb result [my section.command $sec_info]
        }
        class {
          putb result "\[section Classes\]"
          dict for {class_name class_info} $sec_info {
            putb result [my section.class $class_name $class_info]
          }
        }
        default {
          putb result "\[section [list $sec_type $sec_name]\]"
          if {[dict exists $sec_info description]} {
            putb result [dict get $sec_info description]
          }
        }
      }
    }
    if {[llength $authors]} {
      putb result {[section AUTHORS]}
      foreach {name email} $authors {
        putb result "$name \[uri mailto:$email\]\[para\]"
      }
    }
    putb result $footer
    putb result {[manpage_end]}
    return $result
  }
  method scan_text {text} {
    my variable linecount coro
    set linecount 0
    foreach line [split $text \n] {
      incr linecount
      $coro $line
    }
  }
  method scan_file {filename} {
    my variable linecount coro
    set fin [open $filename r]
    set linecount 0
    while {[gets $fin line]>=0} {
      incr linecount
      $coro $line
    }
    close $fin
  }
}

###
# END: doctool.tcl
###
###
# START: buildutil.tcl
###
proc Proc {name arglist body} {
  if {[info command $name] ne {}} return
  proc $name $arglist $body
}
Proc ::noop args {}
proc ::practcl::debug args {
  #puts $args
  ::practcl::cputs ::DEBUG_INFO $args
}
proc ::practcl::doexec args {
  puts [list {*}$args]
  exec {*}$args >&@ stdout
}
proc ::practcl::doexec_in {path args} {
  set PWD [pwd]
  cd $path
  puts [list {*}$args]
  exec {*}$args >&@ stdout
  cd $PWD
}
proc ::practcl::dotclexec args {
  puts [list [info nameofexecutable] {*}$args]
  exec [info nameofexecutable] {*}$args >&@ stdout
}
proc ::practcl::domake {path args} {
  set PWD [pwd]
  cd $path
  puts [list *** $path ***]
  puts [list make {*}$args]
  exec make {*}$args >&@ stdout
  cd $PWD
}
proc ::practcl::domake.tcl {path args} {
  set PWD [pwd]
  cd $path
  puts [list *** $path ***]
  puts [list make.tcl {*}$args]
  exec [info nameofexecutable] make.tcl {*}$args >&@ stdout
  cd $PWD
}
proc ::practcl::fossil {path args} {
  set PWD [pwd]
  cd $path
  puts [list {*}$args]
  exec fossil {*}$args >&@ stdout
  cd $PWD
}
proc ::practcl::fossil_status {dir} {
  if {[info exists ::fosdat($dir)]} {
    return $::fosdat($dir)
  }
  set result {
tags experimental
version {}
  }
  set pwd [pwd]
  cd $dir
  set info [exec fossil status]
  cd $pwd
  foreach line [split $info \n] {
    if {[lindex $line 0] eq "checkout:"} {
      set hash [lindex $line end-3]
      set maxdate [lrange $line end-2 end-1]
      dict set result hash $hash
      dict set result maxdate $maxdate
      regsub -all {[^0-9]} $maxdate {} isodate
      dict set result isodate $isodate
    }
    if {[lindex $line 0] eq "tags:"} {
      set tags [lrange $line 1 end]
      dict set result tags $tags
      break
    }
  }
  set ::fosdat($dir) $result
  return $result
}
proc ::practcl::os {} {
  return [${::practcl::MAIN} define get TEACUP_OS]
}
proc ::practcl::mkzip {exename barekit vfspath} {
  ::practcl::tcllib_require zipfile::mkzip
  ::zipfile::mkzip::mkzip $exename -runtime $barekit -directory $vfspath
}
proc ::practcl::sort_dict list {
  return [::lsort -stride 2 -dictionary $list]
}
if {[::package vcompare $::tcl_version 8.6] < 0} {
  # Approximate ::zipfile::mkzip with exec calls
  proc ::practcl::mkzip {exename barekit vfspath} {
    set path [file dirname [file normalize $exename]]
    set zipfile [file join $path [file rootname $exename].zip]
    file copy -force $barekit $exename
    set pwd [pwd]
    cd $vfspath
    exec zip -r $zipfile .
    cd $pwd
    set fout [open $exename a]
    set fin [open $zipfile r]
    chan configure $fout -translation binary
    chan configure $fin -translation binary
    chan copy $fin $fout
    chan close $fin
    chan close $fout
    exec zip -A $exename
  }
  proc ::practcl::sort_dict list {
    set result {}
    foreach key [lsort -dictionary [dict keys $list]] {
      dict set result $key [dict get $list $key]
    }
    return $result
  }
}
proc ::practcl::local_os {} {
  # If we have already run this command, return
  # a cached copy of the data
  if {[info exists ::practcl::LOCAL_INFO]} {
    return $::practcl::LOCAL_INFO
  }
  set result [array get ::practcl::CONFIG]
  dict set result TEACUP_PROFILE unknown
  dict set result TEACUP_OS unknown
  dict set result EXEEXT {}
  set windows 0
  if {$::tcl_platform(platform) eq "windows"} {
    set windows 1
  }
  if {$windows} {
    set system "windows"
    set arch ix86
    dict set result TEACUP_PROFILE win32-ix86
    dict set result TEACUP_OS windows
    dict set result EXEEXT .exe
  } else {
    set system [exec uname -s]-[exec uname -r]
    set arch unknown
    dict set result TEACUP_OS generic
  }
  dict set result TEA_PLATFORM $system
  dict set result TEA_SYSTEM $system
  if {[info exists ::SANDBOX]} {
    dict set result sandbox $::SANDBOX
  }
  switch -glob $system {
    Linux* {
      dict set result TEACUP_OS linux
      set arch [exec uname -m]
      dict set result TEACUP_PROFILE "linux-glibc2.3-$arch"
    }
    GNU* {
      set arch [exec uname -m]
      dict set result TEACUP_OS "gnu"
    }
    NetBSD-Debian {
      set arch [exec uname -m]
      dict set result TEACUP_OS "netbsd-debian"
    }
    OpenBSD-* {
      set arch [exec arch -s]
      dict set result TEACUP_OS "openbsd"
    }
    Darwin* {
      set arch [exec uname -m]
      dict set result TEACUP_OS "macosx"
      if {$arch eq "x86_64"} {
        dict set result TEACUP_PROFILE "macosx10.5-i386-x86_84"
      } else {
        dict set result TEACUP_PROFILE "macosx-universal"
      }
    }
    OpenBSD* {
      set arch [exec arch -s]
      dict set result TEACUP_OS "openbsd"
    }
  }
  if {$arch eq "unknown"} {
    catch {set arch [exec uname -m]}
  }
  switch -glob $arch {
    i*86 {
      set arch "ix86"
    }
    amd64 {
      set arch "x86_64"
    }
  }
  dict set result TEACUP_ARCH $arch
  if {[dict get $result TEACUP_PROFILE] eq "unknown"} {
    dict set result TEACUP_PROFILE [dict get $result TEACUP_OS]-$arch
  }
  set OS [dict get $result TEACUP_OS]
  dict set result os $OS

  # Look for a local preference file
  set pathlist {}
  set userhome [file normalize ~/tcl]
  set local_install [file join $userhome lib]
  switch $OS {
    windows {
      set userhome [file join [file normalize $::env(LOCALAPPDATA)] Tcl]
      if {[file exists c:/Tcl/Teapot]} {
        dict set result teapot c:/Tcl/Teapot
      }
    }
    macosx {
      set userhome [file join [file normalize {~/Library/Application Support/}] Tcl]
      if {[file exists {~/Library/Application Support/ActiveState/Teapot/repository/}]} {
        dict set result teapot [file normalize {~/Library/Application Support/ActiveState/Teapot/repository/}]
      }
      dict set result local_install [file normalize ~/Library/Tcl]
      if {![dict exists $result sandbox]} {
        dict set result sandbox       [file normalize ~/Library/Tcl/sandbox]
      }
    }
    default {
    }
  }
  dict set result userhome $userhome
  # Load user preferences
  if {[file exists [file join $userhome practcl.rc]]} {
    set dat [::practcl::read_rc_file [file join $userhome practcl.rc]]
    foreach {f v} $dat {
      dict set result $f $v
    }
  }
  if {![dict exists $result prefix]} {
    dict set result prefix   $userhome
  }

  # Create a default path for the teapot
  if {![dict exists $result teapot]} {
    dict set result teapot [file join $userhome teapot]
  }
  # Create a default path for the local sandbox
  if {![dict exists $result sandbox]} {
    dict set result sandbox [file join $userhome sandbox]
  }
  # Create a default path for download folder
  if {![dict exists $result download]} {
    dict set result download [file join $userhome download]
  }
  # Path to install local packages
  if {![dict exists $result local_install]} {
    dict set result local_install [file join $userhome lib]
  }
  if {![dict exists result fossil_mirror] && [::info exists ::env(FOSSIL_MIRROR)]} {
    dict set result fossil_mirror $::env(FOSSIL_MIRROR)
  }

  set ::practcl::LOCAL_INFO $result
  return $result
}
proc ::practcl::config.tcl {path} {
   return [read_configuration $path]
}
proc ::practcl::read_configuration {path} {
  dict set result buildpath $path
  set result [local_os]
  set OS [dict get $result TEACUP_OS]
  set windows 0
  dict set result USEMSVC 0
  if {[file exists [file join $path config.tcl]]} {
    # We have a definitive configuration file. Read its content
    # and take it as gospel
    set cresult [read_rc_file [file join $path config.tcl]]
    set cresult [::practcl::de_shell $cresult]
    if {[dict exists $cresult srcdir] && ![dict exists $cresult sandbox]} {
      dict set cresult sandbox  [file dirname [dict get $cresult srcdir]]
    }
    set result [dict merge $result [::practcl::de_shell $cresult]]
  }
  if {[file exists [file join $path config.site]]} {
    # No config.tcl file is present but we do seed
    dict set result USEMSVC 0
    foreach {f v} [::practcl::de_shell [::practcl::read_sh_file [file join $path config.site]]] {
      dict set result $f $v
      dict set result XCOMPILE_${f} $v
    }
    dict set result CONFIG_SITE [file join $path config.site]
    if {[dict exist $result XCOMPILE_CC] && [regexp mingw [dict get $result XCOMPILE_CC]]} {
      set windows 1
    }
  } elseif {[info exists ::env(VisualStudioVersion)]} {
    set windows 1
    dict set result USEMSVC 1
  }
  if {$windows && [dict get $result TEACUP_OS] ne "windows"} {
    if {![dict exists exists $result TEACUP_ARCH]} {
      dict set result TEACUP_ARCH ix86
    }
    dict set result TEACUP_PROFILE win32-[dict get $result TEACUP_ARCH]
    dict set result TEACUP_OS windows
    dict set result EXEEXT .exe
  }
  return $result
}
if {$::tcl_platform(platform) eq "windows"} {
proc ::practcl::msys_to_tclpath msyspath {
  return [exec sh -c "cd $msyspath ; pwd -W"]
}
proc ::practcl::tcl_to_myspath tclpath {
  set path [file normalize $tclpath]
  return "/[string index $path 0][string range $path 2 end]"
  #return [exec sh -c "cd $tclpath ; pwd"]
}
} else {
proc ::practcl::msys_to_tclpath msyspath {
  return [file normalize $msyspath]
}
proc ::practcl::tcl_to_myspath msyspath {
  return [file normalize $msyspath]
}
}
proc ::practcl::tcllib_require {pkg args} {
  # Try to load the package from the local environment
  if {[catch [list ::package require $pkg {*}$args] err]==0} {
    return $err
  }
  ::practcl::LOCAL tool tcllib env-load
  uplevel #0 [list ::package require $pkg {*}$args]
}
namespace eval ::practcl::platform {
}
proc ::practcl::platform::tcl_core_options {os} {
  ###
  # Download our required packages
  ###
  set tcl_config_opts {}
  # Auto-guess options for the local operating system
  switch $os {
    windows {
      #lappend tcl_config_opts --disable-stubs
    }
    linux {
    }
    macosx {
      lappend tcl_config_opts --enable-corefoundation=yes  --enable-framework=no
    }
  }
  lappend tcl_config_opts --with-tzdata
  return $tcl_config_opts
}
proc ::practcl::platform::tk_core_options {os} {
  ###
  # Download our required packages
  ###
  set tk_config_opts {}

  # Auto-guess options for the local operating system
  switch $os {
    windows {
    }
    linux {
      lappend tk_config_opts --enable-xft=no --enable-xss=no
    }
    macosx {
      lappend tk_config_opts --enable-aqua=yes
    }
  }
  return $tk_config_opts
}
proc ::practcl::read_rc_file {filename {localdat {}}} {
  set result $localdat
  set fin [open $filename r]
  set bufline {}
  set rawcount 0
  set linecount 0
  while {[gets $fin thisline]>=0} {
    incr rawcount
    append bufline \n $thisline
    if {![info complete $bufline]} continue
    set line [string trimleft $bufline]
    set bufline {}
    if {[string index [string trimleft $line] 0] eq "#"} continue
    append result \n $line
    #incr linecount
    #set key [lindex $line 0]
    #set value [lindex $line 1]
    #dict set result $key $value
  }
  close $fin
  return $result
}
proc ::practcl::read_sh_subst {line info} {
  regsub -all {\x28} $line \x7B line
  regsub -all {\x29} $line \x7D line

  #set line [string map $key [string trim $line]]
  foreach {field value} $info {
    catch {set $field $value}
  }
  if [catch {subst $line} result] {
    return {}
  }
  set result [string trim $result]
  return [string trim $result ']
}
proc ::practcl::read_sh_file {filename {localdat {}}} {
  set fin [open $filename r]
  set result {}
  if {$localdat eq {}} {
    set top 1
    set local [array get ::env]
    dict set local EXE {}
  } else {
    set top 0
    set local $localdat
  }
  while {[gets $fin line] >= 0} {
    set line [string trim $line]
    if {[string index $line 0] eq "#"} continue
    if {$line eq {}} continue
    catch {
    if {[string range $line 0 6] eq "export "} {
      set eq [string first "=" $line]
      set field [string trim [string range $line 6 [expr {$eq - 1}]]]
      set value [read_sh_subst [string range $line [expr {$eq+1}] end] $local]
      dict set result $field [read_sh_subst $value $local]
      dict set local $field $value
    } elseif {[string range $line 0 7] eq "include "} {
      set subfile [read_sh_subst [string range $line 7 end] $local]
      foreach {field value} [read_sh_file $subfile $local] {
        dict set result $field $value
      }
    } else {
      set eq [string first "=" $line]
      if {$eq > 0} {
        set field [read_sh_subst [string range $line 0 [expr {$eq - 1}]] $local]
        set value [string trim [string range $line [expr {$eq+1}] end] ']
        #set value [read_sh_subst [string range $line [expr {$eq+1}] end] $local]
        dict set local $field $value
        dict set result $field $value
      }
    }
    } err opts
    if {[dict get $opts -code] != 0} {
      #puts $opts
      puts "Error reading line:\n$line\nerr: $err\n***"
      return $err {*}$opts
    }
  }
  return $result
}
proc ::practcl::read_Config.sh filename {
  set fin [open $filename r]
  set result {}
  set linecount 0
  while {[gets $fin line] >= 0} {
    set line [string trim $line]
    if {[string index $line 0] eq "#"} continue
    if {$line eq {}} continue
    catch {
      set eq [string first "=" $line]
      if {$eq > 0} {
        set field [string range $line 0 [expr {$eq - 1}]]
        set value [string trim [string range $line [expr {$eq+1}] end] ']
        #set value [read_sh_subst [string range $line [expr {$eq+1}] end] $local]
        dict set result $field $value
        incr $linecount
      }
    } err opts
    if {[dict get $opts -code] != 0} {
      #puts $opts
      puts "Error reading line:\n$line\nerr: $err\n***"
      return $err {*}$opts
    }
  }
  return $result
}
proc ::practcl::read_Makefile filename {
  set fin [open $filename r]
  set result {}
  while {[gets $fin line] >= 0} {
    set line [string trim $line]
    if {[string index $line 0] eq "#"} continue
    if {$line eq {}} continue
    catch {
      set eq [string first "=" $line]
      if {$eq > 0} {
        set field [string trim [string range $line 0 [expr {$eq - 1}]]]
        set value [string trim [string trim [string range $line [expr {$eq+1}] end] ']]
        switch $field {
          PKG_LIB_FILE {
            dict set result libfile $value
          }
          srcdir {
            if {$value eq "."} {
              dict set result srcdir [file dirname $filename]
            } else {
              dict set result srcdir $value
            }
          }
          PACKAGE_NAME {
            dict set result name $value
          }
          PACKAGE_VERSION {
            dict set result version $value
          }
          LIBS {
            dict set result PRACTCL_LIBS $value
          }
          PKG_LIB_FILE {
            dict set result libfile $value
          }
        }
      }
    } err opts
    if {[dict get $opts -code] != 0} {
      #puts $opts
      puts "Error reading line:\n$line\nerr: $err\n***"
      return $err {*}$opts
    }
    # the Compile field is about where most TEA files start getting silly
    if {$field eq "compile"} {
      break
    }
  }
  return $result
}
proc ::practcl::cputs {varname args} {
  upvar 1 $varname buffer
  if {[llength $args]==1 && [string length [string trim [lindex $args 0]]] == 0} {

  }
  if {[info exist buffer]} {
    if {[string index $buffer end] ne "\n"} {
      append buffer \n
    }
  } else {
    set buffer \n
  }
  # Trim leading \n's
  append buffer [string trimleft [lindex $args 0] \n] {*}[lrange $args 1 end]
}
proc ::practcl::tcl_to_c {body} {
  set result {}
  foreach rawline [split $body \n] {
    set line [string map [list \" \\\" \\ \\\\] $rawline]
    cputs result "\n        \"$line\\n\" \\"
  }
  return [string trimright $result \\]
}
proc ::practcl::_tagblock {text {style tcl} {note {}}} {
  if {[string length [string trim $text]]==0} {
    return {}
  }
  set output {}
  switch $style {
    tcl {
      ::practcl::cputs output "# BEGIN $note"
    }
    c {
      ::practcl::cputs output "/* BEGIN $note */"
    }
    default {
      ::practcl::cputs output "# BEGIN $note"
    }
  }
  ::practcl::cputs output $text
  switch $style {
    tcl {
      ::practcl::cputs output "# END $note"
    }
    c {
      ::practcl::cputs output "/* END $note */"
    }
    default {
      ::practcl::cputs output "# END $note"
    }
  }
  return $output
}
proc ::practcl::de_shell {data} {
  set values {}
  foreach flag {DEFS TCL_DEFS TK_DEFS} {
    if {[dict exists $data $flag]} {
      #set value {}
      #foreach item [dict get $data $flag] {
      #  append value " " [string map {{ } {\ }} $item]
      #}
      dict set values $flag [dict get $data $flag]
    }
  }
  set map {}
  lappend map {${PKG_OBJECTS}} %LIBRARY_OBJECTS%
  lappend map {$(PKG_OBJECTS)} %LIBRARY_OBJECTS%
  lappend map {${PKG_STUB_OBJECTS}} %LIBRARY_STUB_OBJECTS%
  lappend map {$(PKG_STUB_OBJECTS)} %LIBRARY_STUB_OBJECTS%

  if {[dict exists $data name]} {
    lappend map %LIBRARY_NAME% [dict get $data name]
    lappend map %LIBRARY_VERSION% [dict get $data version]
    lappend map %LIBRARY_VERSION_NODOTS% [string map {. {}} [dict get $data version]]
    if {[dict exists $data libprefix]} {
      lappend map %LIBRARY_PREFIX% [dict get $data libprefix]
    } else {
      lappend map %LIBRARY_PREFIX% [dict get $data prefix]
    }
  }
  foreach flag [dict keys $data] {
    if {$flag in {TCL_DEFS TK_DEFS DEFS}} continue
    set value [string trim [dict get $data $flag] \"]
    dict set map "\$\{${flag}\}" $value
    dict set map "\$\(${flag}\)" $value
    #dict set map "\$${flag}" $value
    dict set map "%${flag}%" $value
    dict set values $flag [dict get $data $flag]
    #dict set map "\$\{${flag}\}" $proj($flag)
  }
  set changed 1
  while {$changed} {
    set changed 0
    foreach {field value} $values {
      if {$field in {TCL_DEFS TK_DEFS DEFS}} continue
      dict with values {}
      set newval [string map $map $value]
      if {$newval eq $value} continue
      set changed 1
      dict set values $field $newval
    }
  }
  return $values
}

###
# END: buildutil.tcl
###
###
# START: fileutil.tcl
###
proc ::practcl::grep {pattern {files {}}} {
    set result [list]
    if {[llength $files] == 0} {
            # read from stdin
            set lnum 0
            while {[gets stdin line] >= 0} {
                incr lnum
                if {[regexp -- $pattern $line]} {
                        lappend result "${lnum}:${line}"
                }
            }
    } else {
            foreach filename $files {
            set file [open $filename r]
            set lnum 0
            while {[gets $file line] >= 0} {
                incr lnum
                if {[regexp -- $pattern $line]} {
                    lappend result "${filename}:${lnum}:${line}"
                }
            }
            close $file
            }
    }
    return $result
}
proc ::practcl::file_lexnormalize {sp} {
    set spx [file split $sp]

    # Resolution of embedded relative modifiers (., and ..).

    if {
      ([lsearch -exact $spx . ] < 0) &&
      ([lsearch -exact $spx ..] < 0)
    } {
      # Quick path out if there are no relative modifiers
      return $sp
    }

    set absolute [expr {![string equal [file pathtype $sp] relative]}]
    # A volumerelative path counts as absolute for our purposes.

    set sp $spx
    set np {}
    set noskip 1

    while {[llength $sp]} {
      set ele    [lindex $sp 0]
      set sp     [lrange $sp 1 end]
      set islast [expr {[llength $sp] == 0}]

      if {[string equal $ele ".."]} {
          if {
            ($absolute  && ([llength $np] >  1)) ||
            (!$absolute && ([llength $np] >= 1))
          } {
            # .. : Remove the previous element added to the
            # new path, if there actually is enough to remove.
            set np [lrange $np 0 end-1]
          }
      } elseif {[string equal $ele "."]} {
          # Ignore .'s, they stay at the current location
          continue
      } else {
          # A regular element.
          lappend np $ele
      }
    }
    if {[llength $np] > 0} {
      return [eval [linsert $np 0 file join]]
      # 8.5: return [file join {*}$np]
    }
    return {}
}
proc ::practcl::file_relative {base dst} {
    # Ensure that the link to directory 'dst' is properly done relative to
    # the directory 'base'.

    if {![string equal [file pathtype $base] [file pathtype $dst]]} {
      return -code error "Unable to compute relation for paths of different pathtypes: [file pathtype $base] vs. [file pathtype $dst], ($base vs. $dst)"
    }

    set base [file_lexnormalize [file join [pwd] $base]]
    set dst  [file_lexnormalize [file join [pwd] $dst]]

    set save $dst
    set base [file split $base]
    set dst  [file split $dst]

    while {[string equal [lindex $dst 0] [lindex $base 0]]} {
      set dst  [lrange $dst  1 end]
      set base [lrange $base 1 end]
      if {![llength $dst]} {break}
    }

    set dstlen  [llength $dst]
    set baselen [llength $base]

    if {($dstlen == 0) && ($baselen == 0)} {
      # Cases:
      # (a) base == dst

      set dst .
    } else {
      # Cases:
      # (b) base is: base/sub = sub
      #     dst  is: base     = {}

      # (c) base is: base     = {}
      #     dst  is: base/sub = sub

      while {$baselen > 0} {
          set dst [linsert $dst 0 ..]
          incr baselen -1
      }
      # 8.5: set dst [file join {*}$dst]
      set dst [eval [linsert $dst 0 file join]]
    }

    return $dst
}
proc ::practcl::findByPattern {basedir patterns} {
    set queue $basedir
    set result {}
    while {[llength $queue]} {
      set item [lindex $queue 0]
      set queue [lrange $queue 1 end]
      if {[file isdirectory $item]} {
        foreach path [glob -nocomplain [file join $item *]] {
          lappend queue $path
        }
        continue
      }
      foreach pattern $patterns {
        set fname [file tail $item]
        if {[string match $pattern $fname]} {
          lappend result $item
          break
        }
      }
    }
    return $result
}
proc ::practcl::log {fname comment} {
  set fname [file normalize $fname]
  if {[info exists ::practcl::logchan($fname)]} {
    set fout $::practcl::logchan($fname)
    after cancel $::practcl::logevent($fname)
  } else {
    set fout [open $fname a]
  }
  puts $fout $comment
  # Defer close until idle
  set ::practcl::logevent($fname) [after idle "close $fout ; unset ::practcl::logchan($fname)"]
}

###
# END: fileutil.tcl
###
###
# START: installutil.tcl
###
proc ::practcl::_pkgindex_simpleIndex {path} {
set buffer {}
  set pkgidxfile    [file join $path pkgIndex.tcl]
  set modfile       [file join $path [file tail $path].tcl]
  set use_pkgindex  [file exists $pkgidxfile]
  set tclfiles      {}
  set found 0
  set mlist [list pkgIndex.tcl index.tcl [file tail $modfile] version_info.tcl]
  foreach file [glob -nocomplain [file join $path *.tcl]] {
    if {[file tail $file] ni $mlist} {
      puts [list NONMODFILE $file]
      return {}
    }
  }
  foreach file [glob -nocomplain [file join $path *.tcl]] {
    if { [file tail $file] == "version_info.tcl" } continue
    set fin [open $file r]
    set dat [read $fin]
    close $fin
    if {![regexp "package provide" $dat]} continue
    set fname [file rootname [file tail $file]]
    # Look for a package provide statement
    foreach line [split $dat \n] {
      set line [string trim $line]
      if { [string range $line 0 14] != "package provide" } continue
      set package [lindex $line 2]
      set version [lindex $line 3]
      if {[string index $package 0] in "\$ \[ @"} continue
      if {[string index $version 0] in "\$ \[ @"} continue
      puts "PKGLINE $line"
      append buffer "package ifneeded $package $version \[list source \[file join %DIR% [file tail $file]\]\]" \n
      break
    }
  }
  return $buffer
}
proc ::practcl::_pkgindex_directory {path} {
  set buffer {}
  set pkgidxfile    [file join $path pkgIndex.tcl]
  set modfile       [file join $path [file tail $path].tcl]
  set use_pkgindex  [file exists $pkgidxfile]
  set tclfiles      {}
  if {$use_pkgindex && [file exists $modfile]} {
    set use_pkgindex 0
    set mlist [list pkgIndex.tcl [file tail $modfile]]
    foreach file [glob -nocomplain [file join $path *.tcl]] {
      lappend tclfiles [file tail $file]
      if {[file tail $file] in $mlist} continue
      incr use_pkgindex
    }
  }
  if {!$use_pkgindex} {
    # No pkgIndex file, read the source
    foreach file [glob -nocomplain $path/*.tm] {
      set file [file normalize $file]
      set fname [file rootname [file tail $file]]
      ###
      # We used to be able to ... Assume the package is correct in the filename
      # No hunt for a "package provides"
      ###
      set package [lindex [split $fname -] 0]
      set version [lindex [split $fname -] 1]
      ###
      # Read the file, and override assumptions as needed
      ###
      set fin [open $file r]
      set dat [read $fin]
      close $fin
      # Look for a teapot style Package statement
      foreach line [split $dat \n] {
        set line [string trim $line]
        if { [string range $line 0 9] != "# Package " } continue
        set package [lindex $line 2]
        set version [lindex $line 3]
        break
      }
      # Look for a package provide statement
      foreach line [split $dat \n] {
        set line [string trim $line]
        if { [string range $line 0 14] != "package provide" } continue
        set package [lindex $line 2]
        set version [lindex $line 3]
        break
      }
      if {[string trim $version] ne {}} {
        append buffer "package ifneeded $package $version \[list source \[file join \$dir [file tail $file]\]\]" \n
      }
    }
    foreach file [glob -nocomplain $path/*.tcl] {
      if { [file tail $file] == "version_info.tcl" } continue
      set fin [open $file r]
      set dat [read $fin]
      close $fin
      if {![regexp "package provide" $dat]} continue
      set fname [file rootname [file tail $file]]
      # Look for a package provide statement
      foreach line [split $dat \n] {
        set line [string trim $line]
        if { [string range $line 0 14] != "package provide" } continue
        set package [lindex $line 2]
        set version [lindex $line 3]
        if {[string index $package 0] in "\$ \[ @"} continue
        if {[string index $version 0] in "\$ \[ @"} continue
        append buffer "package ifneeded $package $version \[list source \[file join \$dir [file tail $file]\]\]" \n
        break
      }
    }
    return $buffer
  }
  set fin [open $pkgidxfile r]
  set dat [read $fin]
  close $fin
  set trace 0
  #if {[file tail $path] eq "tool"} {
  #  set trace 1
  #}
  set thisline {}
  foreach line [split $dat \n] {
    append thisline $line \n
    if {![info complete $thisline]} continue
    set line [string trim $line]
    if {[string length $line]==0} {
      set thisline {} ; continue
    }
    if {[string index $line 0] eq "#"} {
      set thisline {} ; continue
    }
    if {[regexp "if.*catch.*package.*Tcl.*return" $thisline]} {
      if {$trace} {puts "[file dirname $pkgidxfile] Ignoring $thisline"}
      set thisline {} ; continue
    }
    if {[regexp "if.*package.*vsatisfies.*package.*provide.*return" $thisline]} {
      if {$trace} { puts "[file dirname $pkgidxfile] Ignoring $thisline" }
      set thisline {} ; continue
    }
    if {![regexp "package.*ifneeded" $thisline]} {
      # This package index contains arbitrary code
      # source instead of trying to add it to the master
      # package index
      if {$trace} { puts "[file dirname $pkgidxfile] Arbitrary code $thisline" }
      return {source [file join $dir pkgIndex.tcl]}
    }
    append buffer $thisline \n
    set thisline {}
  }
  if {$trace} {puts [list [file dirname $pkgidxfile] $buffer]}
  return $buffer
}
proc ::practcl::_pkgindex_path_subdir {path} {
  set result {}
  if {[file exists [file join $path src build.tcl]]} {
    # Tool style module, don't dive into subdirectories
    return $path
  }
  foreach subpath [glob -nocomplain [file join $path *]] {
    if {[file isdirectory $subpath]} {
      if {[file tail $subpath] eq "build" && [file exists [file join $subpath build.tcl]]} continue
      lappend result $subpath {*}[_pkgindex_path_subdir $subpath]
    }
  }
  return $result
}
proc ::practcl::pkgindex_path {args} {
  set stack {}
  set buffer {
lappend ::PATHSTACK $dir
set IDXPATH [lindex $::PATHSTACK end]
  }
  set preindexed {}
  foreach base $args {
    set base [file normalize $base]
    set paths {}
    foreach dir [glob -nocomplain [file join $base *]] {
      set thisdir [file tail $dir]
      if {$thisdir eq "teapot"} continue
      if {$thisdir eq "pkgs"} {
        foreach subdir [glob -nocomplain [file join $dir *]] {
          set thissubdir [file tail $subdir]
          set skip 0
          foreach file {pkgIndex.tcl tclIndex} {
            if {[file exists [file join $subdir $file]]} {
              set skip 1
              append buffer "set dir \[file join \$::IDXPATH [list $thisdir] [list $thissubdir]\] \; "
              append buffer "source \[file join \$dir ${file}\]" \n
            }
          }
          if {$skip} continue
          lappend paths {*}[::practcl::_pkgindex_path_subdir $subdir]
        }
        continue
      }
      lappend paths $dir {*}[::practcl::_pkgindex_path_subdir $dir]
    }
    append buffer ""
    set i    [string length  $base]
    # Build a list of all of the paths
    if {[llength $paths]} {
      foreach path $paths {
        if {$path eq $base} continue
        set path_indexed($path) 0
      }
    } else {
      puts [list WARNING: NO PATHS FOUND IN $base]
    }
    set path_indexed($base) 1
    set path_indexed([file join $base boot tcl]) 1
    append buffer \n {# SINGLE FILE MODULES BEGIN} \n {set dir [file dirname $::PKGIDXFILE]} \n
    foreach path $paths {
      if {$path_indexed($path)} continue
      set thisdir [file_relative $base $path]
      set simpleIdx [_pkgindex_simpleIndex $path]
      if {[string length $simpleIdx]==0} continue
      incr path_indexed($path)
      if {[string length $simpleIdx]} {
        incr path_indexed($path)
        append buffer [string map [list %DIR% "\$dir \{$thisdir\}"] [string trimright $simpleIdx]] \n
      }
    }
    append buffer {# SINGLE FILE MODULES END} \n
    foreach path $paths {
      if {$path_indexed($path)} continue
      set thisdir [file_relative $base $path]
      set idxbuf [::practcl::_pkgindex_directory $path]
      if {[string length $idxbuf]} {
        incr path_indexed($path)
        append buffer "set dir \[set PKGDIR \[file join \[lindex \$::PATHSTACK end\] $thisdir\]\]" \n
        append buffer [string map {$dir $PKGDIR} [string trimright $idxbuf]] \n
      }
    }
  }
  append buffer {
set dir [lindex $::PATHSTACK end]
set ::PATHSTACK [lrange $::PATHSTACK 0 end-1]
}
  return $buffer
}
proc ::practcl::installDir {d1 d2} {
  puts [format {%*sCreating %s} [expr {4 * [info level]}] {} [file tail $d2]]
  file delete -force -- $d2
  file mkdir $d2

  foreach ftail [glob -directory $d1 -nocomplain -tails *] {
    set f [file join $d1 $ftail]
    if {[file isdirectory $f] && [string compare CVS $ftail]} {
      installDir $f [file join $d2 $ftail]
    } elseif {[file isfile $f]} {
	    file copy -force $f [file join $d2 $ftail]
	    if {$::tcl_platform(platform) eq {unix}} {
        file attributes [file join $d2 $ftail] -permissions 0644
	    } else {
        file attributes [file join $d2 $ftail] -readonly 1
	    }
    }
  }

  if {$::tcl_platform(platform) eq {unix}} {
    file attributes $d2 -permissions 0755
  } else {
    file attributes $d2 -readonly 1
  }
}
proc ::practcl::copyDir {d1 d2 {toplevel 1}} {
  #if {$toplevel} {
  #  puts [list ::practcl::copyDir $d1 -> $d2]
  #}
  #file delete -force -- $d2
  file mkdir $d2
  if {[file isfile $d1]} {
    file copy -force $d1 $d2
    set ftail [file tail $d1]
    if {$::tcl_platform(platform) eq {unix}} {
      file attributes [file join $d2 $ftail] -permissions 0644
    } else {
      file attributes [file join $d2 $ftail] -readonly 1
    }
  } else {
    foreach ftail [glob -directory $d1 -nocomplain -tails *] {
      set f [file join $d1 $ftail]
      if {[file isdirectory $f] && [string compare CVS $ftail]} {
        copyDir $f [file join $d2 $ftail] 0
      } elseif {[file isfile $f]} {
        file copy -force $f [file join $d2 $ftail]
        if {$::tcl_platform(platform) eq {unix}} {
          file attributes [file join $d2 $ftail] -permissions 0644
        } else {
          file attributes [file join $d2 $ftail] -readonly 1
        }
      }
    }
  }
}
proc ::practcl::buildModule {modpath} {
  set buildscript [file join $modpath build build.tcl]
  if {![file exists $buildscript]} return
  set pkgIndexFile [file join $modpath pkgIndex.tcl]
  if {[file exists $pkgIndexFile]} {
    set latest 0
    foreach file [::practcl::findByPattern [file dirname $buildscript] *.tcl] {
      set mtime [file mtime $file]
      if {$mtime>$latest} {
        set latest $mtime
      }
    }
    set IdxTime [file mtime $pkgIndexFile]
    if {$latest<$IdxTime} return
  }
  ::practcl::dotclexec $buildscript
}
proc ::practcl::installModule {modpath DEST} {
  puts [list installModule $modpath $DEST]
  set dpath  [file join $DEST modules [file tail $modpath]]
  if {[file exists [file join $modpath build build.tcl]]} {
    buildModule $modpath
  } elseif {![file exists [file join $modpath pkgIndex.tcl]]} {
    puts [list Reindex $modpath]
    pkg_mkIndex $modpath
  }
  file delete -force $dpath
  file mkdir $dpath
  foreach file [glob  [file join $modpath *.tcl]] {
    file copy $file $dpath
  }
  if {[file exists [file join $modpath htdocs]]} {
    ::practcl::copyDir [file join $modpath htdocs] [file join $dpath htdocs]
  }
}

###
# END: installutil.tcl
###
###
# START: makeutil.tcl
###
proc ::practcl::trigger {args} {
  ::practcl::LOCAL make trigger {*}$args
  foreach {name obj} [::practcl::LOCAL make objects] {
    set ::make($name) [$obj do]
  }
}
proc ::practcl::depends {args} {
  ::practcl::LOCAL make depends {*}$args
}
proc ::practcl::target {name info {action {}}} {
  set obj [::practcl::LOCAL make task $name $info $action]
  set ::make($name) 0
  set filename [$obj define get filename]
  if {$filename ne {}} {
    set ::target($name) $filename
  }
}

###
# END: makeutil.tcl
###
###
# START: class metaclass.tcl
###
::clay::define ::practcl::metaclass {
  method _MorphPatterns {} {
    return {{@name@} {::practcl::@name@} {::practcl::*@name@} {::practcl::*@name@*}}
  }
  method define {submethod args} {
    my variable define
    switch $submethod {
      dump {
        return [array get define]
      }
      add {
        set field [lindex $args 0]
        if {![info exists define($field)]} {
          set define($field) {}
        }
        foreach arg [lrange $args 1 end] {
          if {$arg ni $define($field)} {
            lappend define($field) $arg
          }
        }
        return $define($field)
      }
      remove {
        set field [lindex $args 0]
        if {![info exists define($field)]} {
          return
        }
        set rlist [lrange $args 1 end]
        set olist $define($field)
        set nlist {}
        foreach arg $olist {
          if {$arg in $rlist} continue
          lappend nlist $arg
        }
        set define($field) $nlist
        return $nlist
      }
      exists {
        set field [lindex $args 0]
        return [info exists define($field)]
      }
      getnull -
      get -
      cget {
        set field [lindex $args 0]
        if {[info exists define($field)]} {
          return $define($field)
        }
        return [lindex $args 1]
      }
      set {
        if {[llength $args]==1} {
          set arglist [lindex $args 0]
        } else {
          set arglist $args
        }
        array set define $arglist
        if {[dict exists $arglist class]} {
          my select
        }
      }
      default {
        array $submethod define {*}$args
      }
    }
  }
  method graft args {
    return [my clay delegate {*}$args]
  }
  method initialize {} {}
  method link {command args} {
    my variable links
    switch $command {
      object {
        foreach obj $args {
          foreach linktype [$obj linktype] {
            my link add $linktype $obj
          }
        }
      }
      add {
        ###
        # Add a link to an object that was externally created
        ###
        if {[llength $args] ne 2} { error "Usage: link add LINKTYPE OBJECT"}
        lassign $args linktype object
        if {[info exists links($linktype)] && $object in $links($linktype)} {
          return
        }
        lappend links($linktype) $object
      }
      remove {
        set object [lindex $args 0]
        if {[llength $args]==1} {
          set ltype *
        } else {
          set ltype [lindex $args 1]
        }
        foreach {linktype elements} [array get links $ltype] {
          if {$object in $elements} {
            set nlist {}
            foreach e $elements {
              if { $object ne $e } { lappend nlist $e }
            }
            set links($linktype) $nlist
          }
        }
      }
      list {
        if {[llength $args]==0} {
          return [array get links]
        }
        if {[llength $args] != 1} { error "Usage: link list LINKTYPE"}
        set linktype [lindex $args 0]
        if {![info exists links($linktype)]} {
          return {}
        }
        return $links($linktype)
      }
      dump {
        return [array get links]
      }
    }
  }
  method morph classname {
    my variable define
    if {$classname ne {}} {
      set map [list @name@ $classname]
      foreach pattern [string map $map [my _MorphPatterns]] {
        set pattern [string trim $pattern]
        set matches [info commands $pattern]
        if {![llength $matches]} continue
        set class [lindex $matches 0]
        break
      }
      set mixinslot {}
      foreach {slot pattern} {
        distribution ::practcl::distribution*
        product      ::practcl::product*
        toolset      ::practcl::toolset*
      } {
        if {[string match $pattern $class]} {
           set mixinslot $slot
           break
        }
      }
      if {$mixinslot ne {}} {
        my clay mixinmap $mixinslot $class
      } elseif {[info command $class] ne {}} {
        if {[info object class [self]] ne $class} {
          ::oo::objdefine [self] class $class
          ::practcl::debug [self] morph $class
           my define set class $class
        }
      } else {
        error "[self] Could not detect class for $classname"
      }
    }
    if {[::info exists define(oodefine)]} {
      ::oo::objdefine [self] $define(oodefine)
      #unset define(oodefine)
    }
  }
  method script script {
    eval $script
  }
  method select {} {
    my variable define
    if {[info exists define(class)]} {
      my morph $define(class)
    } else {
      if {[::info exists define(oodefine)]} {
        ::oo::objdefine [self] $define(oodefine)
        #unset define(oodefine)
      }
    }
  }
  method source filename {
    source $filename
  }
}

###
# END: class metaclass.tcl
###
###
# START: class toolset baseclass.tcl
###
::clay::define ::practcl::toolset {
  method config.sh {} {
    return [my read_configuration]
  }
  method BuildDir {PWD} {
    set name [my define get name]
    set debug [my define get debug 0]
    if {[my <project> define get LOCAL 0]} {
      return [my define get builddir [file join $PWD local $name]]
    }
    if {$debug} {
      return [my define get builddir [file join $PWD debug $name]]
    } else {
      return [my define get builddir [file join $PWD pkg $name]]
    }
  }
  method MakeDir {srcdir} {
    return $srcdir
  }
  method read_configuration {} {
    my variable conf_result
    if {[info exists conf_result]} {
      return $conf_result
    }
    set result {}
    set name [my define get name]
    set PWD $::CWD
    set builddir [my define get builddir]
    my unpack
    set srcdir [my define get srcdir]
    if {![file exists $builddir]} {
      my Configure
    }
    set filename [file join $builddir config.tcl]
    # Project uses the practcl template. Use the leavings from autoconf
    if {[file exists $filename]} {
      set dat [::practcl::read_configuration $builddir]
      foreach {item value} [::practcl::sort_dict $dat] {
        dict set result $item $value
      }
      set conf_result $result
      return $result
    }
    set filename [file join $builddir ${name}Config.sh]
    if {[file exists $filename]} {
      set l [expr {[string length $name]+1}]
      foreach {field dat} [::practcl::read_Config.sh $filename] {
        set field [string tolower $field]
        if {[string match ${name}_* $field]} {
          set field [string range $field $l end]
        }
        switch $field {
          version {
            dict set result pkg_vers $dat
          }
          lib_file {
            set field libfile
          }
        }
        dict set result $field $dat
      }
      set conf_result $result
      return $result
    }
    ###
    # Oh man... we have to guess
    ###
    if {![file exists [file join $builddir Makefile]]} {
      my Configure
    }
    set filename [file join $builddir Makefile]
    if {![file exists $filename]} {
      error "Could not locate any configuration data in $srcdir"
    }
    foreach {field dat} [::practcl::read_Makefile $filename] {
      dict set result $field $dat
    }
    if {![dict exists $result PRACTCL_PKG_LIBS] && [dict exists $result LIBS]} {
      dict set result PRACTCL_PKG_LIBS [dict get $result LIBS]
    }
    set conf_result $result
    cd $PWD
    return $result
  }
  method build-cflags {PROJECT DEFS namevar versionvar defsvar} {
    upvar 1 $namevar name $versionvar version NAME NAME $defsvar defs
    set name [string tolower [${PROJECT} define get name [${PROJECT} define get pkg_name]]]
    set NAME [string toupper $name]
    set version [${PROJECT} define get version [${PROJECT} define get pkg_vers]]
    if {$version eq {}} {
      set version 0.1a
    }
    set defs $DEFS
    foreach flag {
      -DPACKAGE_NAME
      -DPACKAGE_VERSION
      -DPACKAGE_TARNAME
      -DPACKAGE_STRING
    } {
      if {[set i [string first $flag $defs]] >= 0} {
        set j [string first -D $flag [expr {$i+[string length $flag]}]]
        set predef [string range $defs 0 [expr {$i-1}]]
        set postdef [string range $defs $j end]
        set defs "$predef $postdef"
      }
    }
    append defs " -DPACKAGE_NAME=\"${name}\" -DPACKAGE_VERSION=\"${version}\""
    append defs " -DPACKAGE_TARNAME=\"${name}\" -DPACKAGE_STRING=\"${name}\x5c\x20${version}\""
    return $defs
  }
  method critcl args {
    if {![info exists critcl]} {
      ::practcl::LOCAL tool critcl env-load
      set critcl [file join [::practcl::LOCAL tool critcl define get srcdir] main.tcl
    }
    set srcdir [my SourceRoot]
    set PWD [pwd]
    cd $srcdir
    ::practcl::dotclexec $critcl {*}$args
    cd $PWD
  }
}
oo::objdefine ::practcl::toolset {
  # Perform the selection for the toolset mixin
  method select object {
    ###
    # Select the toolset to use for this project
    ###
    if {[$object define exists toolset]} {
      return [$object define get toolset]
    }
    set class [$object define get toolset]
    if {$class ne {}} {
      $object clay mixinmap toolset $class
    } else {
      if {[info exists ::env(VisualStudioVersion)]} {
        $object clay mixinmap toolset ::practcl::toolset.msvc
      } else {
        $object clay mixinmap toolset ::practcl::toolset.gcc
      }
    }
  }
}

###
# END: class toolset baseclass.tcl
###
###
# START: class toolset gcc.tcl
###
::clay::define ::practcl::toolset.gcc {
  superclass ::practcl::toolset
  method Autoconf {} {
    ###
    # Re-run autoconf for this project
    # Not a good idea in practice... but in the right hands it can be useful
    ###
    set pwd [pwd]
    set srcdir [file normalize [my define get srcdir]]
    cd $srcdir
    foreach template {configure.ac configure.in} {
      set input [file join $srcdir $template]
      if {[file exists $input]} {
        puts "autoconf -f $input > [file join $srcdir configure]"
        exec autoconf -f $input > [file join $srcdir configure]
      }
    }
    cd $pwd
  }
  method BuildDir {PWD} {
    set name [my define get name]
    set debug [my define get debug 0]
    if {[my <project> define get LOCAL 0]} {
      return [my define get builddir [file join $PWD local $name]]
    }
    if {$debug} {
      return [my define get builddir [file join $PWD debug $name]]
    } else {
      return [my define get builddir [file join $PWD pkg $name]]
    }
  }
  method ConfigureOpts {} {
    set opts {}
    set builddir [my define get builddir]

    if {[my define get broken_destroot 0]} {
      set PREFIX [my <project> define get prefix_broken_destdir]
    } else {
      set PREFIX [my <project> define get prefix]
    }
    switch [my define get name] {
      tcl {
        set opts [::practcl::platform::tcl_core_options [my <project> define get TEACUP_OS]]
      }
      tk {
        set opts [::practcl::platform::tk_core_options  [my <project> define get TEACUP_OS]]
      }
    }
    if {[my <project> define get CONFIG_SITE] != {}} {
      lappend opts --host=[my <project> define get HOST]
    }
    set inside_msys [string is true -strict [my <project> define get MSYS_ENV 0]]
    lappend opts --with-tclsh=[info nameofexecutable]

    if {[my define get tk 0]} {
      if {![my <project> define get LOCAL 0]} {
        set obj [my <project> tclcore]
        if {$obj ne {}} {
          if {$inside_msys} {
            lappend opts --with-tcl=[::practcl::file_relative [file normalize $builddir] [$obj define get builddir]]
          } else {
            lappend opts --with-tcl=[file normalize [$obj define get builddir]]
          }
        }
        set obj [my <project> tkcore]
        if {$obj ne {}} {
          if {$inside_msys} {
            lappend opts --with-tk=[::practcl::file_relative [file normalize $builddir] [$obj define get builddir]]
          } else {
            lappend opts --with-tk=[file normalize [$obj define get builddir]]
          }
        }
      } else {
        lappend opts --with-tcl=[file join $PREFIX lib]
        lappend opts --with-tk=[file join $PREFIX lib]
      }
    } else {
      if {![my <project> define get LOCAL 0]} {
        set obj [my <project> tclcore]
        if {$obj ne {}} {
          if {$inside_msys} {
            lappend opts --with-tcl=[::practcl::file_relative [file normalize $builddir] [$obj define get builddir]]
          } else {
            lappend opts --with-tcl=[file normalize [$obj define get builddir]]
          }
        }
      } else {
        lappend opts --with-tcl=[file join $PREFIX lib]
      }
    }

    lappend opts {*}[my define get config_opts]
    if {![regexp -- "--prefix" $opts]} {
      lappend opts --prefix=$PREFIX --exec-prefix=$PREFIX
    }
    if {[my define get debug 0]} {
      lappend opts --enable-symbols=true
    }
    #--exec_prefix=$PREFIX
    #if {$::tcl_platform(platform) eq "windows"} {
    #  lappend opts --disable-64bit
    #}
    if {[my define get static 1]} {
      lappend opts --disable-shared
      #--disable-stubs
      #
    } else {
      lappend opts --enable-shared
    }
    return $opts
  }
  method MakeDir {srcdir} {
    set localsrcdir $srcdir
    if {[file exists [file join $srcdir generic]]} {
      my define add include_dir [file join $srcdir generic]
    }
    set os [my <project> define get TEACUP_OS]
    switch $os {
      windows {
        if {[file exists [file join $srcdir win]]} {
          my define add include_dir [file join $srcdir win]
        }
        if {[file exists [file join $srcdir win Makefile.in]]} {
          set localsrcdir [file join $srcdir win]
        }
      }
      default {
        if {[file exists [file join $srcdir $os]]} {
          my define add include_dir [file join $srcdir $os]
        }
        if {[file exists [file join $srcdir unix]]} {
          my define add include_dir [file join $srcdir unix]
        }
        if {[file exists [file join $srcdir $os Makefile.in]]} {
          set localsrcdir [file join $srcdir $os]
        } elseif {[file exists [file join $srcdir unix Makefile.in]]} {
          set localsrcdir [file join $srcdir unix]
        }
      }
    }
    return $localsrcdir
  }
  Ensemble make::autodetect {} {
    set srcdir [my define get srcdir]
    set localsrcdir [my define get localsrcdir]
    if {$localsrcdir eq {}} {
      set localsrcdir $srcdir
    }
    if {$srcdir eq $localsrcdir} {
      if {![file exists [file join $srcdir tclconfig install-sh]]} {
        # ensure we have tclconfig with all of the trimmings
        set teapath {}
        if {[file exists [file join $srcdir .. tclconfig install-sh]]} {
          set teapath [file join $srcdir .. tclconfig]
        } else {
          set tclConfigObj [::practcl::LOCAL tool tclconfig]
          $tclConfigObj load
          set teapath [$tclConfigObj define get srcdir]
        }
        set teapath [file normalize $teapath]
        #file mkdir [file join $srcdir tclconfig]
        if {[catch {file link -symbolic [file join $srcdir tclconfig] $teapath}]} {
          ::practcl::copyDir [file join $teapath] [file join $srcdir tclconfig]
        }
      }
    }
    set builddir [my define get builddir]
    file mkdir $builddir
    if {![file exists [file join $localsrcdir configure]]} {
      if {[file exists [file join $localsrcdir autogen.sh]]} {
        cd $localsrcdir
        catch {exec sh autogen.sh >>& [file join $builddir autoconf.log]}
        cd $::CWD
      }
    }
    set opts [my ConfigureOpts]
    if {[file exists [file join $builddir autoconf.log]]} {
      file delete [file join $builddir autoconf.log]
    }
    ::practcl::debug [list PKG [my define get name] CONFIGURE {*}$opts]
    ::practcl::log   [file join $builddir autoconf.log] [list  CONFIGURE {*}$opts]
    cd $builddir
    if {[my <project> define get CONFIG_SITE] ne {}} {
      set ::env(CONFIG_SITE) [my <project> define get CONFIG_SITE]
    }
    catch {exec sh [file join $localsrcdir configure] {*}$opts >>& [file join $builddir autoconf.log]}
    cd $::CWD
  }
  Ensemble make::clean {} {
    set builddir [file normalize [my define get builddir]]
    catch {::practcl::domake $builddir clean}
  }
  Ensemble make::compile {} {
    set name [my define get name]
    set srcdir [my define get srcdir]
    if {[my define get static 1]} {
      puts "BUILDING Static $name $srcdir"
    } else {
      puts "BUILDING Dynamic $name $srcdir"
    }
    cd $::CWD
    set builddir [file normalize [my define get builddir]]
    file mkdir $builddir
    if {![file exists [file join $builddir Makefile]]} {
      my Configure
    }
    if {[file exists [file join $builddir make.tcl]]} {
      if {[my define get debug 0]} {
        ::practcl::domake.tcl $builddir debug all
      } else {
        ::practcl::domake.tcl $builddir all
      }
    } else {
      ::practcl::domake $builddir all
    }
  }
  Ensemble make::install DEST {
    set PWD [pwd]
    set builddir [my define get builddir]
    if {[my <project> define get LOCAL 0] || $DEST eq {}} {
      if {[file exists [file join $builddir make.tcl]]} {
        puts "[self] Local INSTALL (Practcl)"
        ::practcl::domake.tcl $builddir install
      } elseif {[my define get broken_destroot 0] == 0} {
        puts "[self] Local INSTALL (TEA)"
        ::practcl::domake $builddir install
      }
    } else {
      if {[file exists [file join $builddir make.tcl]]} {
        # Practcl builds can inject right to where we need them
        puts "[self] VFS INSTALL $DEST (Practcl)"
        ::practcl::domake.tcl $builddir install-package $DEST
      } elseif {[my define get broken_destroot 0] == 0} {
        # Most modern TEA projects understand DESTROOT in the makefile
        puts "[self] VFS INSTALL $DEST (TEA)"
        ::practcl::domake $builddir install DESTDIR=[::practcl::file_relative $builddir $DEST]
      } else {
        # But some require us to do an install into a fictitious filesystem
        # and then extract the gooey parts within.
        # (*cough*) TkImg
        set PREFIX [my <project> define get prefix]
        set BROKENROOT [::practcl::msys_to_tclpath [my <project> define get prefix_broken_destdir]]
        file delete -force $BROKENROOT
        file mkdir $BROKENROOT
        ::practcl::domake $builddir $install
        ::practcl::copyDir $BROKENROOT  [file join $DEST [string trimleft $PREFIX /]]
        file delete -force $BROKENROOT
      }
    }
    cd $PWD
  }
  method build-compile-sources {PROJECT COMPILE CPPCOMPILE INCLUDES} {
    set objext [my define get OBJEXT o]
    set EXTERN_OBJS {}
    set OBJECTS {}
    set result {}
    set builddir [$PROJECT define get builddir]
    file mkdir [file join $builddir objs]
    set debug [$PROJECT define get debug 0]

    set task {}
    ###
    # Compile the C sources
    ###
    ::practcl::debug ### COMPILE PRODUCTS
    foreach {ofile info} [${PROJECT} project-compile-products] {
      ::practcl::debug $ofile $info
      if {[dict exists $info library]} {
        #dict set task $ofile done 1
        continue
      }
      # Products with no cfile aren't compiled
      if {![dict exists $info cfile] || [set cfile [dict get $info cfile]] eq {}} {
        #dict set task $ofile done 1
        continue
      }
      set ofile [file rootname $ofile]
      dict set task $ofile done 0
      if {[dict exists $info external] && [dict get $info external]==1} {
        dict set task $ofile external 1
      } else {
        dict set task $ofile external 0
      }
      set cfile [dict get $info cfile]
      if {$debug} {
        set ofilename [file join $builddir objs [file rootname [file tail $ofile]].debug.${objext}]
      } else {
        set ofilename [file join $builddir objs [file tail $ofile]].${objext}
      }
      dict set task $ofile source $cfile
      dict set task $ofile objfile $ofilename
      if {![dict exist $info command]} {
        if {[file extension $cfile] in {.c++ .cpp}} {
          set cmd $CPPCOMPILE
        } else {
          set cmd $COMPILE
        }
        if {[dict exists $info extra]} {
          append cmd " [dict get $info extra]"
        }
        append cmd " $INCLUDES"
        append cmd " -c $cfile"
        append cmd " -o $ofilename"
        dict set task $ofile command $cmd
      }
    }
    set completed 0
    while {$completed==0} {
      set completed 1
      foreach {ofile info} $task {
        set waiting {}
        if {[dict exists $info done] && [dict get $info done]} continue
        ::practcl::debug COMPILING $ofile $info
        set filename [dict get $info objfile]
        if {[file exists $filename] && [file mtime $filename]>[file mtime [dict get $info source]]} {
          lappend result $filename
          dict set task $ofile done 1
          continue
        }
        if {[dict exists $info depend]} {
          foreach file [dict get $info depend] {
            if {[dict exists $task $file command] && [dict exists $task $file done] && [dict get $task $file done] != 1} {
              set waiting $file
              break
            }
          }
        }
        if {$waiting ne {}} {
          set completed 0
          puts "$ofile waiting for $waiting"
          continue
        }
        if {[dict exists $info command]} {
          set cmd [dict get $info command]
          puts "$cmd"
          exec {*}$cmd >&@ stdout
        }
        if {[file exists $filename]} {
          lappend result $filename
          dict set task $ofile done 1
          continue
        }
        error "Failed to produce $filename"
      }
    }
    return $result
  }
method build-Makefile {path PROJECT} {
  array set proj [$PROJECT define dump]
  set path $proj(builddir)
  cd $path
  set includedir .
  set objext [my define get OBJEXT o]

  #lappend includedir [::practcl::file_relative $path $proj(TCL_INCLUDES)]
  lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TCL_SRC_DIR) generic]]]
  lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(srcdir) generic]]]
  foreach include [$PROJECT toolset-include-directory] {
    set cpath [::practcl::file_relative $path [file normalize $include]]
    if {$cpath ni $includedir} {
      lappend includedir $cpath
    }
  }
  set INCLUDES  "-I[join $includedir " -I"]"
  set NAME [string toupper $proj(name)]
  set result {}
  set products {}
  set libraries {}
  set thisline {}
  ::practcl::cputs result "${NAME}_DEFS = $proj(DEFS)\n"
  ::practcl::cputs result "${NAME}_INCLUDES = -I\"[join $includedir "\" -I\""]\"\n"
  ::practcl::cputs result "${NAME}_COMPILE = \$(CC) \$(CFLAGS) \$(PKG_CFLAGS) \$(${NAME}_DEFS) \$(${NAME}_INCLUDES) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(AM_CFLAGS)"
  ::practcl::cputs result "${NAME}_CPPCOMPILE = \$(CXX) \$(CFLAGS) \$(PKG_CFLAGS) \$(${NAME}_DEFS) \$(${NAME}_INCLUDES) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(AM_CFLAGS)"

  foreach {ofile info} [$PROJECT project-compile-products] {
    dict set products $ofile $info
    set fname [file rootname ${ofile}].${objext}
    if {[dict exists $info library]} {
lappend libraries $ofile
continue
    }
    if {[dict exists $info depend]} {
      ::practcl::cputs result "\n${fname}: [dict get $info depend]"
    } else {
      ::practcl::cputs result "\n${fname}:"
    }
    set cfile [dict get $info cfile]
    if {[file extension $cfile] in {.c++ .cpp}} {
      set cmd "\t\$\(${NAME}_CPPCOMPILE\)"
    } else {
      set cmd "\t\$\(${NAME}_COMPILE\)"
    }
    if {[dict exists $info extra]} {
      append cmd " [dict get $info extra]"
    }
    append cmd " -c [dict get $info cfile] -o \$@\n\t"
    ::practcl::cputs result  $cmd
  }

  set map {}
  lappend map %LIBRARY_NAME% $proj(name)
  lappend map %LIBRARY_VERSION% $proj(version)
  lappend map %LIBRARY_VERSION_NODOTS% [string map {. {}} $proj(version)]
  lappend map %LIBRARY_PREFIX% [$PROJECT define getnull libprefix]

  if {[string is true [$PROJECT define get SHARED_BUILD]]} {
    set outfile [$PROJECT define get libfile]
  } else {
    set outfile [$PROJECT shared_library]
  }
  $PROJECT define set shared_library $outfile
  ::practcl::cputs result "
${NAME}_SHLIB = $outfile
${NAME}_OBJS = [dict keys $products]
"

  #lappend map %OUTFILE% {\[$]@}
  lappend map %OUTFILE% $outfile
  lappend map %LIBRARY_OBJECTS% "\$(${NAME}_OBJS)"
  ::practcl::cputs result "$outfile: \$(${NAME}_OBJS)"
  ::practcl::cputs result "\t[string map $map [$PROJECT define get PRACTCL_SHARED_LIB]]"
  if {[$PROJECT define get PRACTCL_VC_MANIFEST_EMBED_DLL] ni {: {}}} {
    ::practcl::cputs result "\t[string map $map [$PROJECT define get PRACTCL_VC_MANIFEST_EMBED_DLL]]"
  }
  ::practcl::cputs result {}
  if {[string is true [$PROJECT define get SHARED_BUILD]]} {
    #set outfile [$PROJECT static_library]
    set outfile $proj(name).a
  } else {
    set outfile [$PROJECT define get libfile]
  }
  $PROJECT define set static_library $outfile
  dict set map %OUTFILE% $outfile
  ::practcl::cputs result "$outfile: \$(${NAME}_OBJS)"
  ::practcl::cputs result "\t[string map $map [$PROJECT define get PRACTCL_STATIC_LIB]]"
  ::practcl::cputs result {}
  return $result
}
method build-library {outfile PROJECT} {
  array set proj [$PROJECT define dump]
  set path $proj(builddir)
  cd $path
  set includedir .
  #lappend includedir [::practcl::file_relative $path $proj(TCL_INCLUDES)]
  lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TCL_SRC_DIR) generic]]]
  if {[$PROJECT define get TEA_PRIVATE_TCL_HEADERS 0]} {
    if {[$PROJECT define get TEA_PLATFORM] eq "windows"} {
      lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TCL_SRC_DIR) win]]]
    } else {
      lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TCL_SRC_DIR) unix]]]
    }
  }

  lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(srcdir) generic]]]

  if {[$PROJECT define get tk 0]} {
    lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TK_SRC_DIR) generic]]]
    lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TK_SRC_DIR) ttk]]]
    lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TK_SRC_DIR) xlib]]]
    if {[$PROJECT define get TEA_PRIVATE_TK_HEADERS 0]} {
      if {[$PROJECT define get TEA_PLATFORM] eq "windows"} {
        lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TK_SRC_DIR) win]]]
      } else {
        lappend includedir [::practcl::file_relative $path [file normalize [file join $proj(TK_SRC_DIR) unix]]]
      }
    }
    lappend includedir [::practcl::file_relative $path [file normalize $proj(TK_BIN_DIR)]]
  }
  foreach include [$PROJECT toolset-include-directory] {
    set cpath [::practcl::file_relative $path [file normalize $include]]
    if {$cpath ni $includedir} {
      lappend includedir $cpath
    }
  }
  my build-cflags $PROJECT $proj(DEFS) name version defs
  set NAME [string toupper $name]
  set debug [$PROJECT define get debug 0]
  set os [$PROJECT define get TEACUP_OS]

  set INCLUDES  "-I[join $includedir " -I"]"
  if {$debug} {
    set COMPILE "$proj(CC) $proj(CFLAGS_DEBUG) -ggdb \
$proj(CFLAGS_WARNING) $INCLUDES $defs"

    if {[info exists proc(CXX)]} {
      set COMPILECPP "$proj(CXX) $defs $INCLUDES $proj(CFLAGS_DEBUG) -ggdb \
  $defs $proj(CFLAGS_WARNING)"
    } else {
      set COMPILECPP $COMPILE
    }
  } else {
    set COMPILE "$proj(CC) $proj(CFLAGS) $defs"

    if {[info exists proc(CXX)]} {
      set COMPILECPP "$proj(CXX) $defs $proj(CFLAGS)"
    } else {
      set COMPILECPP $COMPILE
    }
  }

  set products [my build-compile-sources $PROJECT $COMPILE $COMPILECPP $INCLUDES]

  set map {}
  lappend map %LIBRARY_NAME% $proj(name)
  lappend map %LIBRARY_VERSION% $proj(version)
  lappend map %LIBRARY_VERSION_NODOTS% [string map {. {}} $proj(version)]
  lappend map %OUTFILE% $outfile
  lappend map %LIBRARY_OBJECTS% $products
  lappend map {${CFLAGS}} "$proj(CFLAGS_DEFAULT) $proj(CFLAGS_WARNING)"

  if {[string is true [$PROJECT define get SHARED_BUILD 1]]} {
    set cmd [$PROJECT define get PRACTCL_SHARED_LIB]
    append cmd " [$PROJECT define get PRACTCL_LIBS]"
    set cmd [string map $map $cmd]
    puts $cmd
    exec {*}$cmd >&@ stdout
    if {[$PROJECT define get PRACTCL_VC_MANIFEST_EMBED_DLL] ni {: {}}} {
      set cmd [string map $map [$PROJECT define get PRACTCL_VC_MANIFEST_EMBED_DLL]]
      puts $cmd
      exec {*}$cmd >&@ stdout
    }
  } else {
    set cmd [string map $map [$PROJECT define get PRACTCL_STATIC_LIB]]
    puts $cmd
    exec {*}$cmd >&@ stdout
  }
  set ranlib [$PROJECT define get RANLIB]
  if {$ranlib ni {{} :}} {
    catch {exec $ranlib $outfile}
  }
}
method build-tclsh {outfile PROJECT} {
  if {[my define get tk 0] && [my define get static_tk 0]} {
    puts " BUILDING STATIC TCL/TK EXE $PROJECT"
    set TKOBJ  [$PROJECT tkcore]
    if {[info command $TKOBJ] eq {}} {
      set TKOBJ ::noop
      $PROJECT define set static_tk 0
    } else {
      ::practcl::toolset select $TKOBJ
      array set TK  [$TKOBJ read_configuration]
      set do_tk [$TKOBJ define get static]
      $PROJECT define set static_tk $do_tk
      $PROJECT define set tk $do_tk
      set TKSRCDIR [$TKOBJ define get srcdir]
    }
  } else {
    puts " BUILDING STATIC TCL EXE $PROJECT"
    set TKOBJ ::noop
    my define set static_tk 0
  }
  set TCLOBJ [$PROJECT tclcore]
  ::practcl::toolset select $TCLOBJ
  set PKG_OBJS {}
  foreach item [$PROJECT link list core.library] {
    if {[string is true [$item define get static]]} {
      lappend PKG_OBJS $item
    }
  }
  foreach item [$PROJECT link list package] {
    if {[string is true [$item define get static]]} {
      lappend PKG_OBJS $item
    }
  }
  array set TCL [$TCLOBJ read_configuration]
  set path [file dirname [file normalize $outfile]]
  cd $path
  ###
  # For a static Tcl shell, we need to build all local sources
  # with the same DEFS flags as the tcl core was compiled with.
  # The DEFS produced by a TEA extension aren't intended to operate
  # with the internals of a staticly linked Tcl
  ###
  my build-cflags $PROJECT $TCL(defs) name version defs
  set debug [$PROJECT define get debug 0]
  set NAME [string toupper $name]
  set result {}
  set libraries {}
  set thisline {}
  set OBJECTS {}
  set EXTERN_OBJS {}
  foreach obj $PKG_OBJS {
    $obj compile
    set config($obj) [$obj read_configuration]
  }
  set os [$PROJECT define get TEACUP_OS]
  set TCLSRCDIR [$TCLOBJ define get srcdir]

  set includedir .
  foreach include [$TCLOBJ toolset-include-directory] {
    set cpath [::practcl::file_relative $path [file normalize $include]]
    if {$cpath ni $includedir} {
      lappend includedir $cpath
    }
  }
  lappend includedir [::practcl::file_relative $path [file normalize ../tcl/compat/zlib]]
  if {[$PROJECT define get static_tk]} {
    lappend includedir [::practcl::file_relative $path [file normalize [file join $TKSRCDIR generic]]]
    lappend includedir [::practcl::file_relative $path [file normalize [file join $TKSRCDIR ttk]]]
    lappend includedir [::practcl::file_relative $path [file normalize [file join $TKSRCDIR xlib]]]
    lappend includedir [::practcl::file_relative $path [file normalize $TKSRCDIR]]
  }

  foreach include [$PROJECT toolset-include-directory] {
    set cpath [::practcl::file_relative $path [file normalize $include]]
    if {$cpath ni $includedir} {
      lappend includedir $cpath
    }
  }

  set INCLUDES  "-I[join $includedir " -I"]"
  if {$debug} {
      set COMPILE "$TCL(cc) $TCL(shlib_cflags) $TCL(cflags_debug) -ggdb \
$TCL(cflags_warning) $TCL(extra_cflags)"
  } else {
      set COMPILE "$TCL(cc) $TCL(shlib_cflags) $TCL(cflags_optimize) \
$TCL(cflags_warning) $TCL(extra_cflags)"
  }
  append COMPILE " " $defs
  lappend OBJECTS {*}[my build-compile-sources $PROJECT $COMPILE $COMPILE $INCLUDES]

  set TCLSRC [file normalize $TCLSRCDIR]

  if {[${PROJECT} define get TEACUP_OS] eq "windows"} {
    set windres [$PROJECT define get RC windres]
    set RSOBJ [file join $path objs tclkit.res.o]
    set RCSRC [${PROJECT} define get kit_resource_file]
    set RCMAN [${PROJECT} define get kit_manifest_file]
    set RCICO [${PROJECT} define get kit_icon_file]

    set cmd [list $windres -o $RSOBJ -DSTATIC_BUILD --include [::practcl::file_relative $path [file join $TCLSRC generic]]]
    if {[$PROJECT define get static_tk]} {
      if {$RCSRC eq {} || ![file exists $RCSRC]} {
        set RCSRC [file join $TKSRCDIR win rc wish.rc]
      }
      if {$RCMAN eq {} || ![file exists $RCMAN]} {
        set RCMAN [file join [$TKOBJ define get builddir] wish.exe.manifest]
      }
      if {$RCICO eq {} || ![file exists $RCICO]} {
        set RCICO [file join $TCLSRCDIR win rc wish.ico]
      }
      set TKSRC [file normalize $TKSRCDIR]
      lappend cmd --include [::practcl::file_relative $path [file join $TKSRC generic]] \
        --include [::practcl::file_relative $path [file join $TKSRC win]] \
        --include [::practcl::file_relative $path [file join $TKSRC win rc]]
    } else {
      if {$RCSRC eq {} || ![file exists $RCSRC]} {
        set RCSRC [file join $TCLSRCDIR win tclsh.rc]
      }
      if {$RCMAN eq {} || ![file exists $RCMAN]} {
        set RCMAN [file join [$TCLOBJ define get builddir] tclsh.exe.manifest]
      }
      if {$RCICO eq {} || ![file exists $RCICO]} {
        set RCICO [file join $TCLSRCDIR win tclsh.ico]
      }
    }
    foreach item [${PROJECT} define get resource_include] {
      lappend cmd --include [::practcl::file_relative $path [file normalize $item]]
    }
    lappend cmd [file tail $RCSRC]
    if {![file exists [file join $path [file tail $RCSRC]]]} {
      file copy -force $RCSRC [file join $path [file tail $RCSRC]]
    }
    if {![file exists [file join $path [file tail $RCMAN]]]} {
      file copy -force $RCMAN [file join $path [file tail $RCMAN]]
    }
    if {![file exists [file join $path [file tail $RCICO]]]} {
      file copy -force $RCICO [file join $path [file tail $RCICO]]
    }
    ::practcl::doexec {*}$cmd
    lappend OBJECTS $RSOBJ
  }
  puts "***"
  set cmd "$TCL(cc)"
  if {$debug} {
   append cmd " $TCL(cflags_debug)"
  } else {
   append cmd " $TCL(cflags_optimize)"
  }
  append cmd " $TCL(ld_flags)"
  if {$debug} {
   append cmd " $TCL(ldflags_debug)"
  } else {
   append cmd " $TCL(ldflags_optimize)"
  }

  append cmd " $OBJECTS"
  append cmd " $EXTERN_OBJS"
  if {$debug && $os eq "windows"} {
    ###
    # There is bug in the core's autoconf and the value for
    # tcl_build_lib_spec does not have the 'g' suffix
    ###
    append cmd " -L[file dirname $TCL(build_stub_lib_path)] -ltcl86g"
    if {[$PROJECT define get static_tk]} {
      append cmd " -L[file dirname $TK(build_stub_lib_path)] -ltk86g"
    }
  } else {
    append cmd " $TCL(build_lib_spec)"
    if {[$PROJECT define get static_tk]} {
      append cmd  " $TK(build_lib_spec)"
    }
  }
  foreach obj $PKG_OBJS {
    append cmd " [$obj linker-products $config($obj)]"
  }
  set LIBS {}
  foreach item $TCL(libs) {
    if {[string range $item 0 1] eq "-l" && $item in $LIBS } continue
    lappend LIBS $item
  }
  if {[$PROJECT define get static_tk]} {
    foreach item $TK(libs) {
      if {[string range $item 0 1] eq "-l" && $item in $LIBS } continue
      lappend LIBS $item
    }
  }
  if {[info exists TCL(extra_libs)]} {
    foreach item $TCL(extra_libs) {
      if {[string range $item 0 1] eq "-l" && $item in $LIBS } continue
      lappend LIBS $item
    }
  }
  foreach obj $PKG_OBJS {
    puts [list Checking $obj for external dependencies]
    foreach item [$obj linker-external $config($obj)] {
      puts [list $obj adds $item]
      if {[string range $item 0 1] eq "-l" && $item in $LIBS } continue
      lappend LIBS $item
    }
  }
  append cmd " ${LIBS}"
  foreach obj $PKG_OBJS {
    puts [list Checking $obj for additional link items]
    foreach item [$obj linker-extra $config($obj)] {
      append cmd $item
    }
  }
  if {$debug && $os eq "windows"} {
    append cmd " -L[file dirname $TCL(build_stub_lib_path)] ${TCL(stub_lib_flag)}"
    if {[$PROJECT define get static_tk]} {
      append cmd " -L[file dirname $TK(build_stub_lib_path)] ${TK(stub_lib_flag)}"
    }
  } else {
    append cmd " $TCL(build_stub_lib_spec)"
    if {[$PROJECT define get static_tk]} {
      append cmd " $TK(build_stub_lib_spec)"
    }
  }
  if {[info exists TCL(cc_search_flags)]} {
    append cmd " $TCL(cc_search_flags)"
  }
  append cmd " -o $outfile "
  if {$os eq "windows"} {
    set LDFLAGS_CONSOLE {-mconsole -pipe -static-libgcc}
    set LDFLAGS_WINDOW  {-mwindows -pipe -static-libgcc}
    append cmd " $LDFLAGS_CONSOLE"
  }
  puts "LINK: $cmd"
  exec {*}[string map [list "\n" " " "  " " "] $cmd] >&@ stdout
}
}

###
# END: class toolset gcc.tcl
###
###
# START: class toolset msvc.tcl
###
::clay::define ::practcl::toolset.msvc {
  superclass ::practcl::toolset
  method BuildDir {PWD} {
    set srcdir [my define get srcdir]
    return $srcdir
  }
  Ensemble make::autodetect {} {
  }
  Ensemble make::clean {} {
    set PWD [pwd]
    set srcdir [my define get srcdir]
    cd $srcdir
    catch {::practcl::doexec nmake -f makefile.vc clean}
    cd $PWD
  }
  Ensemble make::compile {} {
    set srcdir [my define get srcdir]
    if {[my define get static 1]} {
      puts "BUILDING Static $name $srcdir"
    } else {
      puts "BUILDING Dynamic $name $srcdir"
    }
    cd $srcdir
    if {[file exists [file join $srcdir make.tcl]]} {
      if {[my define get debug 0]} {
        ::practcl::domake.tcl $srcdir debug all
      } else {
        ::practcl::domake.tcl $srcdir all
      }
    } else {
      if {[file exists [file join $srcdir makefile.vc]]} {
        ::practcl::doexec nmake -f makefile.vc INSTALLDIR=[my <project> define get installdir]  {*}[my NmakeOpts] release
      } elseif {[file exists [file join $srcdir win makefile.vc]]} {
        cd [file join $srcdir win]
        ::practcl::doexec nmake -f makefile.vc INSTALLDIR=[my <project> define get installdir]  {*}[my NmakeOpts] release
      } else {
        error "No make.tcl or makefile.vc found for project $name"
      }
    }
  }
  Ensemble make::install DEST {
    set PWD [pwd]
    set srcdir [my define get srcdir]
    cd $srcdir
    if {$DEST eq {}} {
      error "No destination given"
    }
    if {[my <project> define get LOCAL 0] || $DEST eq {}} {
      if {[file exists [file join $srcdir make.tcl]]} {
        # Practcl builds can inject right to where we need them
        puts "[self] Local Install (Practcl)"
        ::practcl::domake.tcl $srcdir install
      } else {
        puts "[self] Local Install (Nmake)"
        ::practcl::doexec nmake -f makefile.vc {*}[my NmakeOpts] install
      }
    } else {
      if {[file exists [file join $srcdir make.tcl]]} {
        # Practcl builds can inject right to where we need them
        puts "[self] VFS INSTALL $DEST (Practcl)"
        ::practcl::domake.tcl $srcdir install-package $DEST
      } else {
        puts "[self] VFS INSTALL $DEST"
        ::practcl::doexec nmake -f makefile.vc INSTALLDIR=$DEST {*}[my NmakeOpts] install
      }
    }
    cd $PWD
  }
  method MakeDir {srcdir} {
    set localsrcdir $srcdir
    if {[file exists [file join $srcdir generic]]} {
      my define add include_dir [file join $srcdir generic]
    }
    if {[file exists [file join $srcdir win]]} {
       my define add include_dir [file join $srcdir win]
    }
    if {[file exists [file join $srcdir makefile.vc]]} {
      set localsrcdir [file join $srcdir win]
    }
    return $localsrcdir
  }
  method NmakeOpts {} {
    set opts {}
    set builddir [file normalize [my define get builddir]]

    if {[my <project> define exists tclsrcdir]} {
      ###
      # On Windows we are probably running under MSYS, which doesn't deal with
      # spaces in filename well
      ###
      set TCLSRCDIR  [::practcl::file_relative [file normalize $builddir] [file normalize [file join $::CWD [my <project> define get tclsrcdir] ..]]]
      set TCLGENERIC [::practcl::file_relative [file normalize $builddir] [file normalize [file join $::CWD [my <project> define get tclsrcdir] .. generic]]]
      lappend opts TCLDIR=[file normalize $TCLSRCDIR]
      #--with-tclinclude=$TCLGENERIC
    }
    if {[my <project> define exists tksrcdir]} {
      set TKSRCDIR  [::practcl::file_relative [file normalize $builddir] [file normalize [file join $::CWD [my <project> define get tksrcdir] ..]]]
      set TKGENERIC [::practcl::file_relative [file normalize $builddir] [file normalize [file join $::CWD [my <project> define get tksrcdir] .. generic]]]
      #lappend opts --with-tk=$TKSRCDIR --with-tkinclude=$TKGENERIC
      lappend opts TKDIR=[file normalize $TKSRCDIR]
    }
    return $opts
  }
}

###
# END: class toolset msvc.tcl
###
###
# START: class target.tcl
###
::clay::define ::practcl::make_obj {
  superclass ::practcl::metaclass
  constructor {module_object name info {action_body {}}} {
    my variable define triggered domake
    set triggered 0
    set domake 0
    set define(name) $name
    set define(action) {}
    array set define $info
    my select
    my initialize
    foreach {stub obj} [$module_object child organs] {
      my graft $stub $obj
    }
    if {$action_body ne {}} {
      set define(action) $action_body
    }
  }
  method do {} {
    my variable domake
    return $domake
  }
  method check {} {
    my variable needs_make domake
    if {$domake} {
      return 1
    }
    if {[info exists needs_make]} {
      return $needs_make
    }
    set make_objects [my <module> make objects]
    set needs_make 0
    foreach item [my define get depends] {
      if {![dict exists $make_objects $item]} continue
      set depobj [dict get $make_objects $item]
      if {$depobj eq [self]} {
        puts "WARNING [self] depends on itself"
        continue
      }
      if {[$depobj check]} {
        set needs_make 1
      }
    }
    if {!$needs_make} {
      foreach filename [my output] {
        if {$filename ne {} && ![file exists $filename]} {
          set needs_make 1
        }
      }
    }
    return $needs_make
  }
  method output {} {
    set result {}
    set filename [my define get filename]
    if {$filename ne {}} {
      lappend result $filename
    }
    foreach filename [my define get files] {
      if {$filename ne {}} {
        lappend result $filename
      }
    }
    return $result
  }
  method reset {} {
    my variable triggered domake needs_make
    set triggerd 0
    set domake 0
    set needs_make 0
  }
  method triggers {} {
    my variable triggered domake define
    if {$triggered} {
      return $domake
    }
    set triggered 1
    set make_objects [my <module> make objects]

    foreach item [my define get depends] {
      if {![dict exists $make_objects $item]} continue
      set depobj [dict get $make_objects $item]
      if {$depobj eq [self]} {
        puts "WARNING [self] triggers itself"
        continue
      } else {
        set r [$depobj check]
        if {$r} {
          $depobj triggers
        }
      }
    }
    set domake 1
    my <module> make trigger {*}[my define get triggers]
  }
}

###
# END: class target.tcl
###
###
# START: class object.tcl
###
::clay::define ::practcl::object {
  superclass ::practcl::metaclass
  constructor {parent args} {
    my variable links define
    set organs [$parent child organs]
    my clay delegate {*}$organs
    array set define $organs
    array set define [$parent child define]
    array set links {}
    if {[llength $args]==1 && [file exists [lindex $args 0]]} {
      my define set filename [lindex $args 0]
      ::practcl::product select [self]
    } elseif {[llength $args] == 1} {
      set data  [uplevel 1 [list subst [lindex $args 0]]]
      array set define $data
      my select
    } else {
      array set define [uplevel 1 [list subst $args]]
      my select
    }
    my initialize

  }
  method child {method} {
    return {}
  }
  method go {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable links
    foreach {linktype objs} [array get links] {
      foreach obj $objs {
        $obj go
      }
    }
    ::practcl::debug [list /[self] [self method] [self class]]
  }
}

###
# END: class object.tcl
###
###
# START: class dynamic.tcl
###
::clay::define ::practcl::dynamic {
  method cstructure {name definition {argdat {}}} {
    my variable cstruct
    dict set cstruct $name body $definition
    foreach {f v} $argdat {
      dict set cstruct $name $f $v
    }
    if {![dict exists $cstruct $name public]} {
      dict set cstruct $name public 1
    }
  }
  method include header {
    my define add include $header
  }
  method include_dir args {
    my define add include_dir {*}$args
  }
  method include_directory args {
    my define add include_dir {*}$args
  }
  method c_header body {
    my variable code
    ::practcl::cputs code(header) $body
  }
  method c_code body {
    my variable code
    ::practcl::cputs code(funct) $body
  }
  method c_function {header body {info {}}} {
    set header [string map "\t \  \n \ \ \  \ " $header]
    my variable code cfunct
    foreach regexp {
         {(.*) ([a-zA-Z_][a-zA-Z0-9_]*) *\((.*)\)}
         {(.*) (\x2a[a-zA-Z_][a-zA-Z0-9_]*) *\((.*)\)}
    } {
      if {[regexp $regexp $header all keywords funcname arglist]} {
        set dat [dict merge {export 0 extern 0 public 1 inline 0} $info]
        dict set dat header $header
        dict set dat body $body
        dict set dat keywords $keywords
        dict set dat arglist $arglist
        if {"IRM_INLINE" in $keywords || "CTHULHU_INLINE" in $keywords} {
          dict set dat public 1
          dict set dat extern 0
          dict set dat inline 1
        } else {
          if {"inline" in $keywords} {
            dict set dat inline 1
          }
          if {"STUB_EXPORT" in $keywords} {
            dict set dat extern 1
            dict set dat public 1
            dict set dat export 1
            dict set dat inline 0
          } elseif {"extern" in $keywords} {
            dict set dat extern 1
            dict set dat public 1
          } elseif {"static" in $keywords} {
            dict set dat public 0
          }
        }
        if {[dict get $dat inline] && [dict get $dat public]} {
          set header [string map {IRM_INLINE {} CTHULHU_INLINE {} static {} inline {} extern {}} [dict get $dat header]]
          dict set dat header "extern $header"
        }
        dict set cfunct $funcname $dat
        return
      }
    }
    puts "WARNING: NON CONFORMING FUNCTION DEFINITION: $headers $body"
    ::practcl::cputs code(header) "$header\;"
    # Could not parse that block as a function
    # append it verbatim to our c_implementation
    ::practcl::cputs code(funct) "$header [list $body]"
  }
  method c_tcloomethod {name body {arginfo {}}} {
    my variable methods code
    foreach {f v} $arginfo {
      dict set methods $name $f $v
    }
    dict set methods $name body "Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext); /* The current connection object */
$body"
  }
  method cmethod {name body {arginfo {}}} {
    my variable methods code
    foreach {f v} $arginfo {
      dict set methods $name $f $v
    }
    dict set methods $name body "Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext); /* The current connection object */
$body"
  }
  method c_tclproc_nspace nspace {
    my variable code
    if {![info exists code(nspace)]} {
      set code(nspace) {}
    }
    if {$nspace ni $code(nspace)} {
      lappend code(nspace) $nspace
    }
  }
  method c_tclcmd {name body {arginfo {}}} {
    my variable tclprocs code

    foreach {f v} $arginfo {
      dict set tclprocs $name $f $v
    }
    dict set tclprocs $name body $body
  }
  method c_tclproc_raw {name body {arginfo {}}} {
    my variable tclprocs code

    foreach {f v} $arginfo {
      dict set tclprocs $name $f $v
    }
    dict set tclprocs $name body $body
  }
  method tcltype {name argdat} {
    my variable tcltype
    foreach {f v} $argdat {
      dict set tcltype $name $f $v
    }
    if {![dict exists tcltype $name cname]} {
      dict set tcltype $name cname [string tolower $name]_tclobjtype
    }
    lappend map @NAME@ $name
    set info [dict get $tcltype $name]
    foreach {f v} $info {
      lappend map @[string toupper $f]@ $v
    }
    foreach {func fpat template} {
      freeproc         {@Name@Obj_freeIntRepProc}       {void @FNAME@(Tcl_Obj *objPtr)}
      dupproc          {@Name@Obj_dupIntRepProc}        {void @FNAME@(Tcl_Obj *srcPtr,Tcl_Obj *dupPtr)}
      updatestringproc {@Name@Obj_updateStringRepProc} {void @FNAME@(Tcl_Obj *objPtr)}
      setfromanyproc   {@Name@Obj_setFromAnyProc}       {int @FNAME@(Tcl_Interp *interp,Tcl_Obj *objPtr)}
    } {
      if {![dict exists $info $func]} {
        error "$name does not define $func"
      }
      set body [dict get $info $func]
      # We were given a function name to call
      if {[llength $body] eq 1} continue
      set fname [string map [list @Name@ [string totitle $name]] $fpat]
      my c_function [string map [list @FNAME@ $fname] $template] [string map $map $body]
      dict set tcltype $name $func $fname
    }
  }
  method project-compile-products {} {
    set filename [my define get output_c]
    set result {}
    if {$filename ne {}} {
      ::practcl::debug [self] [self class] [self method] project-compile-products $filename

      if {[my define exists ofile]} {
        set ofile [my define get ofile]
      } else {
        set ofile [my Ofile $filename]
        my define set ofile $ofile
      }
      lappend result $ofile [list cfile $filename extra [my define get extra] external [string is true -strict [my define get external]]]
    } else {
      set filename [my define get cfile]
      if {$filename ne {}} {
        ::practcl::debug [self] [self class] [self method] project-compile-products $filename
        if {[my define exists ofile]} {
          set ofile [my define get ofile]
        } else {
          set ofile [my Ofile $filename]
          my define set ofile $ofile
        }
        lappend result $ofile [list cfile $filename extra [my define get extra] external [string is true -strict [my define get external]]]
      }
    }
    foreach item [my link list subordinate] {
      lappend result {*}[$item project-compile-products]
    }
    return $result
  }
  method implement path {
    my go
    my Collate_Source $path
    if {[my define get output_c] eq {}} return
    set filename [file join $path [my define get output_c]]
    ::practcl::debug [self] [my define get filename] WANTS TO GENERATE $filename
    my define set cfile $filename
    set fout [open $filename w]
    puts $fout [my generate-c]
    if {[my define get initfunc] ne {}} {
      puts $fout "extern int DLLEXPORT [my define get initfunc]( Tcl_Interp *interp ) \x7B"
      puts $fout [my generate-loader-module]
      if {[my define get pkg_name] ne {}} {
        puts $fout "   Tcl_PkgProvide(interp, \"[my define get pkg_name]\", \"[my define get pkg_vers]\");"
      }
      puts $fout "  return TCL_OK\;"
      puts $fout "\x7D"
    }
    close $fout
  }
  method initialize {} {
    set filename [my define get filename]
    if {$filename eq {}} {
      return
    }
    if {[my define get name] eq {}} {
      my define set name [file tail [file rootname $filename]]
    }
    if {[my define get localpath] eq {}} {
      my define set localpath [my <module> define get localpath]_[my define get name]
    }
    ::source $filename
  }
  method linktype {} {
    return {subordinate product dynamic}
  }
  method generate-cfile-constant {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    my variable code cstruct methods tcltype
    if {[info exists code(constant)]} {
      ::practcl::cputs result "/* [my define get filename] CONSTANT */"
      ::practcl::cputs result $code(constant)
    }
    if {[info exists cstruct]} {
      foreach {name info} $cstruct {
        set map {}
        lappend map @NAME@ $name
        lappend map @MACRO@ GET[string toupper $name]

        if {[dict exists $info deleteproc]} {
          lappend map @DELETEPROC@ [dict get $info deleteproc]
        } else {
          lappend map @DELETEPROC@ NULL
        }
        if {[dict exists $info cloneproc]} {
          lappend map @CLONEPROC@ [dict get $info cloneproc]
        } else {
          lappend map @CLONEPROC@ NULL
        }
        ::practcl::cputs result [string map $map {
const static Tcl_ObjectMetadataType @NAME@DataType = {
  TCL_OO_METADATA_VERSION_CURRENT,
  "@NAME@",
  @DELETEPROC@,
  @CLONEPROC@
};
#define @MACRO@(OBJCONTEXT) (@NAME@ *) Tcl_ObjectGetMetadata(OBJCONTEXT,&@NAME@DataType)
}]
      }
    }
    if {[info exists tcltype]} {
      foreach {type info} $tcltype {
        dict with info {}
        ::practcl::cputs result "const Tcl_ObjType $cname = \{\n .name=\"$type\",\n .freeIntRepProc = &${freeproc},\n  .dupIntRepProc = &${dupproc},\n  .updateStringProc = &${updatestringproc},\n  .setFromAnyProc = &${setfromanyproc}\n\}\;"
      }
    }

    if {[info exists methods]} {
      set mtypes {}
      foreach {name info} $methods {
        set callproc   [dict get $info callproc]
        set methodtype [dict get $info methodtype]
        if {$methodtype in $mtypes} continue
        lappend mtypes $methodtype
        ###
        # Build the data struct for this method
        ###
        ::practcl::cputs result "const static Tcl_MethodType $methodtype = \{"
        ::practcl::cputs result "  .version = TCL_OO_METADATA_VERSION_CURRENT,\n  .name = \"$name\",\n  .callProc = $callproc,"
        if {[dict exists $info deleteproc]} {
          set deleteproc [dict get $info deleteproc]
        } else {
          set deleteproc NULL
        }
        if {$deleteproc ni { {} NULL }} {
          ::practcl::cputs result "  .deleteProc = $deleteproc,"
        } else {
          ::practcl::cputs result "  .deleteProc = NULL,"
        }
        if {[dict exists $info cloneproc]} {
          set cloneproc [dict get $info cloneproc]
        } else {
          set cloneproc NULL
        }
        if {$cloneproc ni { {} NULL }} {
          ::practcl::cputs result "  .cloneProc = $cloneproc\n\}\;"
        } else {
          ::practcl::cputs result "  .cloneProc = NULL\n\}\;"
        }
        dict set methods $name methodtype $methodtype
      }
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      ::practcl::cputs result [$obj generate-cfile-constant]
    }
    return $result
  }
  method generate-cfile-header {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct cstruct methods tcltype tclprocs
    set result {}
    if {[info exists code(header)]} {
      ::practcl::cputs result $code(header)
    }
    ::practcl::debug [list cfunct [info exists cfunct]]
    if {[info exists cfunct]} {
      foreach {funcname info} $cfunct {
        if {[dict get $info public]} continue
        ::practcl::cputs result "[dict get $info header]\;"
      }
    }
    ::practcl::debug [list tclprocs [info exists tclprocs]]
    if {[info exists tclprocs]} {
      foreach {name info} $tclprocs {
        if {[dict exists $info header]} {
          ::practcl::cputs result "[dict get $info header]\;"
        }
      }
    }
    ::practcl::debug [list methods [info exists methods] [my define get cclass]]
    if {[info exists methods]} {
      set thisclass [my define get cclass]
      foreach {name info} $methods {
        if {[dict exists $info header]} {
          ::practcl::cputs result "[dict get $info header]\;"
        }
      }
      # Add the initializer wrapper for the class
      ::practcl::cputs result "static int ${thisclass}_OO_Init(Tcl_Interp *interp)\;"
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      set dat [$obj generate-cfile-header]
      if {[string length [string trim $dat]]} {
        ::practcl::cputs result "/* BEGIN [$obj define get filename] generate-cfile-header */"
        ::practcl::cputs result $dat
        ::practcl::cputs result "/* END [$obj define get filename] generate-cfile-header */"
      }
    }
    return $result
  }
  method generate-cfile-tclapi {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code methods tclprocs
    set result {}
    if {[info exists code(method)]} {
      ::practcl::cputs result $code(method)
    }

    if {[info exists tclprocs]} {
      foreach {name info} $tclprocs {
        if {![dict exists $info body]} continue
        set callproc [dict get $info callproc]
        set header [dict get $info header]
        set body [dict get $info body]
        ::practcl::cputs result "/* Tcl Proc $name */"
        ::practcl::cputs result "${header} \{${body}\}"
      }
    }


    if {[info exists methods]} {
      set thisclass [my define get cclass]
      foreach {name info} $methods {
        if {![dict exists $info body]} continue
        set callproc [dict get $info callproc]
        set header [dict get $info header]
        set body [dict get $info body]
        ::practcl::cputs result "/* OO Method $thisclass $name */"
        ::practcl::cputs result "${header} \{${body}\}"
      }
      # Build the OO_Init function
      ::practcl::cputs result "/* Loader for $thisclass */"
      ::practcl::cputs result "static int ${thisclass}_OO_Init(Tcl_Interp *interp) \{"
      ::practcl::cputs result [string map [list @CCLASS@ $thisclass @TCLCLASS@ [my define get class]] {
  /*
  ** Build the "@TCLCLASS@" class
  */
  Tcl_Obj* nameObj;		/* Name of a class or method being looked up */
  Tcl_Object curClassObject;  /* Tcl_Object representing the current class */
  Tcl_Class curClass;		/* Tcl_Class representing the current class */

  /*
   * Find the "@TCLCLASS@" class, and attach an 'init' method to it.
   */

  nameObj = Tcl_NewStringObj("@TCLCLASS@", -1);
  Tcl_IncrRefCount(nameObj);
  if ((curClassObject = Tcl_GetObjectFromObj(interp, nameObj)) == NULL) {
      Tcl_DecrRefCount(nameObj);
      return TCL_ERROR;
  }
  Tcl_DecrRefCount(nameObj);
  curClass = Tcl_GetObjectAsClass(curClassObject);
}]
      if {[dict exists $methods constructor]} {
        set mtype [dict get $methods constructor methodtype]
        ::practcl::cputs result [string map [list @MTYPE@ $mtype] {
  /* Attach the constructor to the class */
  Tcl_ClassSetConstructor(interp, curClass, Tcl_NewMethod(interp, curClass, NULL, 1, &@MTYPE@, NULL));
    }]
      }
      foreach {name info} $methods {
        dict with info {}
        if {$name in {constructor destructor}} continue
        ::practcl::cputs result [string map [list @NAME@ $name @MTYPE@ $methodtype] {
  nameObj=Tcl_NewStringObj("@NAME@",-1);
  Tcl_NewMethod(interp, curClass, nameObj, 1, &@MTYPE@, (ClientData) NULL);
  Tcl_DecrRefCount(nameObj);
}]
        if {[dict exists $info aliases]} {
          foreach alias [dict get $info aliases] {
            if {[dict exists $methods $alias]} continue
            ::practcl::cputs result [string map [list @NAME@ $alias @MTYPE@ $methodtype] {
  nameObj=Tcl_NewStringObj("@NAME@",-1);
  Tcl_NewMethod(interp, curClass, nameObj, 1, &@MTYPE@, (ClientData) NULL);
  Tcl_DecrRefCount(nameObj);
}]
          }
        }
      }
      ::practcl::cputs result "  return TCL_OK\;\n\}\n"
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      ::practcl::cputs result [$obj generate-cfile-tclapi]
    }
    return $result
  }
  method generate-loader-module {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    my variable code methods tclprocs
    if {[info exists code(nspace)]} {
      ::practcl::cputs result "  \{\n    Tcl_Namespace *modPtr;"
      foreach nspace $code(nspace) {
        ::practcl::cputs result [string map [list @NSPACE@ $nspace] {
    modPtr=Tcl_FindNamespace(interp,"@NSPACE@",NULL,TCL_NAMESPACE_ONLY);
    if(!modPtr) {
      modPtr = Tcl_CreateNamespace(interp, "@NSPACE@", NULL, NULL);
    }
}]
      }
      ::practcl::cputs result "  \}"
    }
    if {[info exists code(tclinit)]} {
      ::practcl::cputs result $code(tclinit)
    }
    if {[info exists code(cinit)]} {
      ::practcl::cputs result $code(cinit)
    }
    if {[info exists code(initfuncts)]} {
      foreach func $code(initfuncts) {
        ::practcl::cputs result "  if (${func}(interp) != TCL_OK) return TCL_ERROR\;"
      }
    }
    if {[info exists tclprocs]} {
      foreach {name info} $tclprocs {
        set map [list @NAME@ $name @CALLPROC@ [dict get $info callproc]]
        ::practcl::cputs result [string map $map {  Tcl_CreateObjCommand(interp,"@NAME@",(Tcl_ObjCmdProc *)@CALLPROC@,NULL,NULL);}]
        if {[dict exists $info aliases]} {
          foreach alias [dict get $info aliases] {
            set map [list @NAME@ $alias @CALLPROC@ [dict get $info callproc]]
            ::practcl::cputs result [string map $map {  Tcl_CreateObjCommand(interp,"@NAME@",(Tcl_ObjCmdProc *)@CALLPROC@,NULL,NULL);}]
          }
        }
      }
    }

    if {[info exists code(nspace)]} {
      ::practcl::cputs result "  \{\n    Tcl_Namespace *modPtr;"
      foreach nspace $code(nspace) {
        ::practcl::cputs result [string map [list @NSPACE@ $nspace] {
    modPtr=Tcl_FindNamespace(interp,"@NSPACE@",NULL,TCL_NAMESPACE_ONLY);
    Tcl_CreateEnsemble(interp, modPtr->fullName, modPtr, TCL_ENSEMBLE_PREFIX);
    Tcl_Export(interp, modPtr, "[a-z]*", 1);
}]
      }
      ::practcl::cputs result "  \}"
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} {
        ::practcl::cputs result [$obj generate-loader-external]
      } else {
        ::practcl::cputs result [$obj generate-loader-module]
      }
    }
    return $result
  }
  method Collate_Source CWD {
    my variable methods code cstruct tclprocs
    if {[info exists methods]} {
      ::practcl::debug [self] methods [my define get cclass]
      set thisclass [my define get cclass]
      foreach {name info} $methods {
        # Provide a callproc
        if {![dict exists $info callproc]} {
          set callproc [string map {____ _ ___ _ __ _} [string map {{ } _ : _} OOMethod_${thisclass}_${name}]]
          dict set methods $name callproc $callproc
        } else {
          set callproc [dict get $info callproc]
        }
        if {[dict exists $info body] && ![dict exists $info header]} {
          dict set methods $name header "static int ${callproc}(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext objectContext ,int objc ,Tcl_Obj *const *objv)"
        }
        if {![dict exists $info methodtype]} {
          set methodtype [string map {{ } _ : _} OOMethodType_${thisclass}_${name}]
          dict set methods $name methodtype $methodtype
        }
      }
      if {![info exists code(initfuncts)] || "${thisclass}_OO_Init" ni $code(initfuncts)} {
        lappend code(initfuncts) "${thisclass}_OO_Init"
      }
    }
    set thisnspace [my define get nspace]

    if {[info exists tclprocs]} {
      ::practcl::debug [self] tclprocs [dict keys $tclprocs]
      foreach {name info} $tclprocs {
        if {![dict exists $info callproc]} {
          set callproc [string map {____ _ ___ _ __ _} [string map {{ } _ : _} TclCmd_${thisnspace}_${name}]]
          dict set tclprocs $name callproc $callproc
        } else {
          set callproc [dict get $info callproc]
        }
        if {[dict exists $info body] && ![dict exists $info header]} {
          dict set tclprocs $name header "static int ${callproc}(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv\[\])"
        }
      }
    }
  }
  method select {} {}
}

###
# END: class dynamic.tcl
###
###
# START: class product.tcl
###
::clay::define ::practcl::product {
  method code {section body} {
    my variable code
    ::practcl::cputs code($section) $body
  }
  method Collate_Source CWD {}
  method project-compile-products {} {
    set result {}
    noop {
    set filename [my define get filename]
    if {$filename ne {}} {
      ::practcl::debug [self] [self class] [self method] project-compile-products $filename
      if {[my define exists ofile]} {
        set ofile [my define get ofile]
      } else {
        set ofile [my Ofile $filename]
        my define set ofile $ofile
      }
      lappend result $ofile [list cfile $filename include [my define get include]  extra [my define get extra] external [string is true -strict [my define get external]] object [self]]
    }
    }
    foreach item [my link list subordinate] {
      lappend result {*}[$item project-compile-products]
    }
    return $result
  }
  method generate-debug {{spaces {}}} {
    set result {}
    ::practcl::cputs result "$spaces[list [self] [list class [info object class [self]] filename [my define get filename]] links [my link list]]"
    foreach item [my link list subordinate] {
      practcl::cputs result [$item generate-debug "$spaces  "]
    }
    return $result
  }
  method generate-cfile-constant {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    my variable code cstruct methods tcltype
    if {[info exists code(constant)]} {
      ::practcl::cputs result "/* [my define get filename] CONSTANT */"
      ::practcl::cputs result $code(constant)
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      ::practcl::cputs result [$obj generate-cfile-constant]
    }
    return $result
  }
  method generate-cfile-public-structure {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cstruct methods tcltype
    set result {}
    if {[info exists code(struct)]} {
      ::practcl::cputs result $code(struct)
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      ::practcl::cputs result [$obj generate-cfile-public-structure]
    }
    return $result
  }
  method generate-cfile-header {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct cstruct methods tcltype tclprocs
    set result {}
    if {[info exists code(header)]} {
      ::practcl::cputs result $code(header)
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      set dat [$obj generate-cfile-header]
      if {[string length [string trim $dat]]} {
        ::practcl::cputs result "/* BEGIN [$obj define get filename] generate-cfile-header */"
        ::practcl::cputs result $dat
        ::practcl::cputs result "/* END [$obj define get filename] generate-cfile-header */"
      }
    }
    return $result
  }
  method generate-cfile-global {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct cstruct methods tcltype tclprocs
    set result {}
    if {[info exists code(global)]} {
      ::practcl::cputs result $code(global)
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      set dat [$obj generate-cfile-global]
      if {[string length [string trim $dat]]} {
        ::practcl::cputs result "/* BEGIN [$obj define get filename] generate-cfile-global */"
        ::practcl::cputs result $dat
        ::practcl::cputs result "/* END [$obj define get filename] generate-cfile-global */"
      }
    }
    return $result
  }
  method generate-cfile-private-typedef {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cstruct
    set result {}
    if {[info exists code(private-typedef)]} {
      ::practcl::cputs result $code(private-typedef)
    }
    if {[info exists cstruct]} {
      # Add defintion for native c data structures
      foreach {name info} $cstruct {
        if {[dict get $info public]==1} continue
        ::practcl::cputs result "typedef struct $name ${name}\;"
        if {[dict exists $info aliases]} {
          foreach n [dict get $info aliases] {
            ::practcl::cputs result "typedef struct $name ${n}\;"
          }
        }
      }
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-cfile-private-typedef]
    }
    return $result
  }
  method generate-cfile-private-structure {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cstruct
    set result {}
    if {[info exists code(private-structure)]} {
      ::practcl::cputs result $code(private-structure)
    }
    if {[info exists cstruct]} {
      foreach {name info} $cstruct {
        if {[dict get $info public]==1} continue
        if {[dict exists $info comment]} {
          ::practcl::cputs result [dict get $info comment]
        }
        ::practcl::cputs result "struct $name \{[dict get $info body]\}\;"
      }
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-cfile-private-structure]
    }
    return $result
  }
  method generate-cfile-functions {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct
    set result {}
    if {[info exists code(funct)]} {
      ::practcl::cputs result $code(funct)
    }
    if {[info exists cfunct]} {
      foreach {funcname info} $cfunct {
        ::practcl::cputs result "/* $funcname */"
        if {[dict get $info inline] && [dict get $info public]} {
          ::practcl::cputs result "\ninline [dict get $info header]\{[dict get $info body]\}"
        } else {
          ::practcl::cputs result "\n[dict get $info header]\{[dict get $info body]\}"
        }
      }
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} {
        continue
      }
      ::practcl::cputs result [$obj generate-cfile-functions]
    }
    return $result
  }
  method generate-cfile-tclapi {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code methods tclprocs
    set result {}
    if {[info exists code(method)]} {
      ::practcl::cputs result $code(method)
    }
    foreach obj [my link list product] {
      # Exclude products that will generate their own C files
      if {[$obj define get output_c] ne {}} continue
      ::practcl::cputs result [$obj generate-cfile-tclapi]
    }
    return $result
  }
  method generate-hfile-public-define {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code
    set result {}
    if {[info exists code(public-define)]} {
      ::practcl::cputs result $code(public-define)
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-define]
    }
    return $result
  }
  method generate-hfile-public-macro {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code
    set result {}
    if {[info exists code(public-macro)]} {
      ::practcl::cputs result $code(public-macro)
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-macro]
    }
    return $result
  }
  method generate-hfile-public-typedef {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cstruct
    set result {}
    if {[info exists code(public-typedef)]} {
      ::practcl::cputs result $code(public-typedef)
    }
    if {[info exists cstruct]} {
      # Add defintion for native c data structures
      foreach {name info} $cstruct {
        if {[dict get $info public]==0} continue
        ::practcl::cputs result "typedef struct $name ${name}\;"
        if {[dict exists $info aliases]} {
          foreach n [dict get $info aliases] {
            ::practcl::cputs result "typedef struct $name ${n}\;"
          }
        }
      }
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-typedef]
    }
    return $result
  }
  method generate-hfile-public-structure {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cstruct
    set result {}
    if {[info exists code(public-structure)]} {
      ::practcl::cputs result $code(public-structure)
    }
    if {[info exists cstruct]} {
      foreach {name info} $cstruct {
        if {[dict get $info public]==0} continue
        if {[dict exists $info comment]} {
          ::practcl::cputs result [dict get $info comment]
        }
        ::practcl::cputs result "struct $name \{[dict get $info body]\}\;"
      }
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-structure]
    }
    return $result
  }
  method generate-hfile-public-headers {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code tcltype
    set result {}
    if {[info exists code(public-header)]} {
      ::practcl::cputs result $code(public-header)
    }
    if {[info exists tcltype]} {
      foreach {type info} $tcltype {
        if {![dict exists $info cname]} {
          set cname [string tolower ${type}]_tclobjtype
          dict set tcltype $type cname $cname
        } else {
          set cname [dict get $info cname]
        }
        ::practcl::cputs result "extern const Tcl_ObjType $cname\;"
      }
    }
    if {[info exists code(public)]} {
      ::practcl::cputs result $code(public)
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-headers]
    }
    return $result
  }
  method generate-hfile-public-function {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct tcltype
    set result {}

    if {[my define get initfunc] ne {}} {
      ::practcl::cputs result "int [my define get initfunc](Tcl_Interp *interp);"
    }
    if {[info exists cfunct]} {
      foreach {funcname info} $cfunct {
        if {![dict get $info public]} continue
        ::practcl::cputs result "[dict get $info header]\;"
      }
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-hfile-public-function]
    }
    return $result
  }
  method generate-hfile-public-includes {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set includes {}
    foreach item [my define get public-include] {
      if {$item ni $includes} {
        lappend includes $item
      }
    }
    foreach mod [my link list product] {
      foreach item [$mod generate-hfile-public-includes] {
        if {$item ni $includes} {
          lappend includes $item
        }
      }
    }
    return $includes
  }
  method generate-hfile-public-verbatim {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set includes {}
    foreach item [my define get public-verbatim] {
      if {$item ni $includes} {
        lappend includes $item
      }
    }
    foreach mod [my link list subordinate] {
      foreach item [$mod generate-hfile-public-verbatim] {
        if {$item ni $includes} {
          lappend includes $item
        }
      }
    }
    return $includes
  }
  method generate-loader-external {} {
    if {[my define get initfunc] eq {}} {
      return "/*  [my define get filename] declared not initfunc */"
    }
    return "  if([my define get initfunc](interp)) return TCL_ERROR\;"
  }
  method generate-loader-module {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code
    set result {}
    if {[info exists code(cinit)]} {
      ::practcl::cputs result $code(cinit)
    }
    if {[my define get initfunc] ne {}} {
      ::practcl::cputs result "  if([my define get initfunc](interp)!=TCL_OK) return TCL_ERROR\;"
    }
    set result [::practcl::_tagblock $result c [my define get filename]]
    foreach item [my link list product] {
      if {[$item define get output_c] ne {}} {
        ::practcl::cputs result [$item generate-loader-external]
      } else {
        ::practcl::cputs result [$item generate-loader-module]
      }
    }
    return $result
  }
  method generate-stub-function {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    my variable code cfunct tcltype
    set result {}
    foreach mod [my link list product] {
      foreach {funct def} [$mod generate-stub-function] {
        dict set result $funct $def
      }
    }
    if {[info exists cfunct]} {
      foreach {funcname info} $cfunct {
        if {![dict get $info export]} continue
        dict set result $funcname [dict get $info header]
      }
    }
    return $result
  }
  method IncludeAdd {headervar args} {
    upvar 1 $headervar headers
    foreach inc $args {
      if {[string index $inc 0] ni {< \"}} {
        set inc "\"$inc\""
      }
      if {$inc ni $headers} {
        lappend headers $inc
      }
    }
  }
  method generate-tcl-loader {} {
    set result {}
    set PKGINIT [my define get pkginit]
    set PKG_NAME [my define get name [my define get pkg_name]]
    set PKG_VERSION [my define get pkg_vers [my define get version]]
    if {[string is true [my define get SHARED_BUILD 0]]} {
      set LIBFILE [my define get libfile]
      ::practcl::cputs result [string map \
        [list @LIBFILE@ $LIBFILE @PKGINIT@ $PKGINIT @PKG_NAME@ $PKG_NAME @PKG_VERSION@ $PKG_VERSION] {
# Shared Library Style
load [file join [file dirname [file join [pwd] [info script]]] @LIBFILE@] @PKGINIT@
package provide @PKG_NAME@ @PKG_VERSION@
}]
    } else {
      ::practcl::cputs result [string map \
      [list @PKGINIT@ $PKGINIT @PKG_NAME@ $PKG_NAME @PKG_VERSION@ $PKG_VERSION] {
# Tclkit Style
load {} @PKGINIT@
package provide @PKG_NAME@ @PKG_VERSION@
}]
    }
    return $result
  }
  method generate-tcl-pre {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    my variable code
    if {[info exists code(tcl)]} {
      set result [::practcl::_tagblock $code(tcl) tcl [my define get filename]]
    }
    if {[info exists code(tcl-pre)]} {
      set result [::practcl::_tagblock $code(tcl) tcl [my define get filename]]
    }
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-tcl-pre]
    }
    return $result
  }
  method generate-tcl-post {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    my variable code
    if {[info exists code(tcl-post)]} {
      set result [::practcl::_tagblock $code(tcl-post) tcl [my define get filename]]
    }
    foreach mod [my link list product] {
      ::practcl::cputs result [$mod generate-tcl-post]
    }
    return $result
  }
  method linktype {} {
    return {subordinate product}
  }
  method Ofile filename {
    set lpath [my <module> define get localpath]
    if {$lpath eq {}} {
      set lpath [my <module> define get name]
    }
    return ${lpath}_[file rootname [file tail $filename]]
  }
  method project-static-packages {} {
    set result [my define get static_packages]
    set initfunc [my define get initfunc]
    if {$initfunc ne {}} {
      set pkg_name [my define get pkg_name]
      if {$pkg_name ne {}} {
        dict set result $pkg_name initfunc $initfunc
        dict set result $pkg_name version [my define get version [my define get pkg_vers]]
        dict set result $pkg_name autoload [my define get autoload 0]
      }
    }
    foreach item [my link list subordinate] {
      foreach {pkg info} [$item project-static-packages] {
        dict set result $pkg $info
      }
    }
    return $result
  }
  method toolset-include-directory {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result [my define get include_dir]
    foreach obj [my link list product] {
      foreach path [$obj toolset-include-directory] {
        lappend result $path
      }
    }
    return $result
  }
  method target {method args} {
    switch $method {
      is_unix { return [expr {$::tcl_platform(platform) eq "unix"}] }
    }
  }
}
oo::objdefine ::practcl::product {

  method select {object} {
    set class [$object define get class]
    set mixin [$object define get product]
    if {$class eq {} && $mixin eq {}} {
      set filename [$object define get filename]
      if {$filename ne {} && [file exists $filename]} {
        switch [file extension $filename] {
          .tcl {
            set mixin ::practcl::product.dynamic
          }
          .h {
            set mixin ::practcl::product.cheader
          }
          .c {
            set mixin ::practcl::product.csource
          }
          .ini {
            switch [file tail $filename] {
              module.ini {
                set class ::practcl::module
              }
              library.ini {
                set class ::practcl::subproject
              }
            }
          }
          .so -
          .dll -
          .dylib -
          .a {
            set mixin ::practcl::product.clibrary
          }
        }
      }
    }
    if {$class ne {}} {
      $object clay mixinmap core $class
    }
    if {$mixin ne {}} {
      $object clay mixinmap product $mixin
    }
  }
}
::clay::define ::practcl::product.cheader {
  superclass ::practcl::product
  method project-compile-products {} {}
  method generate-loader-module {} {}
}
::clay::define ::practcl::product.csource {
  superclass ::practcl::product
  method project-compile-products {} {
    set result {}
    set filename [my define get filename]
    if {$filename ne {}} {
      ::practcl::debug [self] [self class] [self method] project-compile-products $filename
      if {[my define exists ofile]} {
        set ofile [my define get ofile]
      } else {
        set ofile [my Ofile $filename]
        my define set ofile $ofile
      }
      lappend result $ofile [list cfile $filename extra [my define get extra] external [string is true -strict [my define get external]] object [self]]
    }
    foreach item [my link list subordinate] {
      lappend result {*}[$item project-compile-products]
    }
    return $result
  }
}
::clay::define ::practcl::product.clibrary {
  superclass ::practcl::product
  method linker-products {configdict} {
    return [my define get filename]
  }
}
::clay::define ::practcl::product.dynamic {
  superclass ::practcl::dynamic ::practcl::product
  method initialize {} {
    set filename [my define get filename]
    if {$filename eq {}} {
      return
    }
    if {[my define get name] eq {}} {
      my define set name [file tail [file rootname $filename]]
    }
    if {[my define get localpath] eq {}} {
      my define set localpath [my <module> define get localpath]_[my define get name]
    }
    # Future Development:
    # Scan source file to see if it is encoded in criticl or practcl notation
    #set thisline {}
    #foreach line [split [::practcl::cat $filename] \n] {
    #
    #}
    ::source $filename
    if {[my define get output_c] ne {}} {
      # Turn into a module if we have an output_c file
      my morph ::practcl::module
    }
  }
}
::clay::define ::practcl::product.critcl {
  superclass ::practcl::dynamic ::practcl::product
}

###
# END: class product.tcl
###
###
# START: class module.tcl
###
::clay::define ::practcl::module {
  superclass ::practcl::object ::practcl::product.dynamic
  Dict make_object {}
  method _MorphPatterns {} {
    return {{@name@} {::practcl::module.@name@} ::practcl::module}
  }
  method add args {
    my variable links
    set object [::practcl::object new [self] {*}$args]
    foreach linktype [$object linktype] {
      lappend links($linktype) $object
    }
    return $object
  }
  method install-headers args {}
  Ensemble make::_preamble {} {
    my variable make_object
    if {![info exists make_object]} {
      set make_object {}
    }
  }
  Ensemble make::pkginfo {} {
    ###
    # Build local variables needed for install
    ###
    package require platform
    set result {}
    set dat [my define dump]
    set PKG_DIR [dict get $dat name][dict get $dat version]
    dict set result PKG_DIR $PKG_DIR
    dict with dat {}
    if {![info exists DESTDIR]} {
      set DESTDIR {}
    }
    dict set result profile [::platform::identify]
    dict set result os $::tcl_platform(os)
    dict set result platform $::tcl_platform(platform)
    foreach {field value} $dat {
      switch $field {
        includedir -
        mandir -
        datadir -
        libdir -
        libfile -
        name -
        output_tcl -
        version -
        authors -
        license -
        requires {
          dict set result $field $value
        }
        TEA_PLATFORM {
          dict set result platform $value
        }
        TEACUP_OS {
          dict set result os $value
        }
        TEACUP_PROFILE {
          dict set result profile $value
        }
        TEACUP_ZIPFILE {
          dict set result zipfile $value
        }
      }
    }
    if {![dict exists $result zipfile]} {
      dict set result zipfile "[dict get $result name]-[dict get $result version]-[dict get $result profile].zip"
    }
    return $result
  }
  Ensemble make::objects {} {
    return $make_object
  }
  Ensemble make::object name {
    if {[dict exists $make_object $name]} {
      return [dict get $make_object $name]
    }
    return {}
  }
  Ensemble make::reset {} {
    foreach {name obj} $make_object {
      $obj reset
    }
  }
  Ensemble make::trigger args {
    foreach {name obj} $make_object {
      if {$name in $args} {
        $obj triggers
      }
    }
  }
  Ensemble make::depends args {
    foreach {name obj} $make_object {
      if {$name in $args} {
        $obj check
      }
    }
  }
  Ensemble make::filename name {
    if {[dict exists $make_object $name]} {
      return [[dict get $make_object $name] define get filename]
    }
  }
  Ensemble make::target {name Info body} {
    set info [uplevel #0 [list subst $Info]]
    set nspace [namespace current]
    if {[dict exist $make_object $name]} {
      set obj [dict get $$make_object $name]
    } else {
      set obj [::practcl::make_obj new [self] $name $info $body]
      dict set make_object $name $obj
      dict set target_make $name 0
      dict set target_trigger $name 0
    }
    if {[dict exists $info aliases]} {
      foreach item [dict get $info aliases] {
        if {![dict exists $make_object $item]} {
          dict set make_object $item $obj
        }
      }
    }
    return $obj
  }
  clay set method_ensemble make target aliases {task add}
  Ensemble make::todo {} {
    foreach {name obj} $make_object {
      if {[$obj do]} {
        lappend result $name
      }
    }
    return $result
  }
  Ensemble make::do {} {
    global CWD SRCDIR project SANDBOX
    foreach {name obj} $make_object {
      if {[$obj do]} {
        eval [$obj define get action]
      }
    }
  }
  method child which {
    switch $which {
      delegate -
      organs {
        return [list project [my define get project] module [self]]
      }
    }
  }
  method generate-c {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {
/* This file was generated by practcl */
    }
    set includes {}

    foreach mod [my link list product] {
      # Signal modules to formulate final implementation
      $mod go
    }
    set headers {}

    my IncludeAdd headers <tcl.h> <tclOO.h>
    if {[my define get tk 0]} {
      my IncludeAdd headers <tk.h>
    }
    if {[my define get output_h] ne {}} {
      my IncludeAdd headers [my define get output_h]
    }
    my IncludeAdd headers {*}[my define get include]

    foreach mod [my link list dynamic] {
      my IncludeAdd headers {*}[$mod define get include]
    }
    foreach inc $headers {
      ::practcl::cputs result "#include $inc"
    }
    foreach {method} {
      generate-cfile-header
      generate-cfile-private-typedef
      generate-cfile-private-structure
      generate-cfile-public-structure
      generate-cfile-constant
      generate-cfile-global
      generate-cfile-functions
      generate-cfile-tclapi
    } {
      set dat [my $method]
      if {[string length [string trim $dat]]} {
        ::practcl::cputs result "/* BEGIN $method [my define get filename] */"
        ::practcl::cputs result $dat
        ::practcl::cputs result "/* END $method [my define get filename] */"
      }
    }
    ::practcl::debug [list /[self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    return $result
  }
  method generate-h {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    foreach method {
      generate-hfile-public-define
      generate-hfile-public-macro
    } {
      ::practcl::cputs result "/* BEGIN SECTION $method */"
      ::practcl::cputs result [my $method]
      ::practcl::cputs result "/* END SECTION $method */"
    }
    set includes [my generate-hfile-public-includes]
    foreach inc $includes {
      if {[string index $inc 0] ni {< \"}} {
        ::practcl::cputs result "#include \"$inc\""
      } else {
        ::practcl::cputs result "#include $inc"
      }
    }
    foreach method {
      generate-hfile-public-typedef
      generate-hfile-public-structure
    } {
      ::practcl::cputs result "/* BEGIN SECTION $method */"
      ::practcl::cputs result [my $method]
      ::practcl::cputs result "/* END SECTION $method */"
    }

    foreach file [my generate-hfile-public-verbatim] {
      ::practcl::cputs result "/* BEGIN $file */"
      ::practcl::cputs result [::practcl::cat $file]
      ::practcl::cputs result "/* END $file */"
    }

    foreach method {
      generate-hfile-public-headers
      generate-hfile-public-function
    } {
      ::practcl::cputs result "/* BEGIN SECTION $method */"
      ::practcl::cputs result [my $method]
      ::practcl::cputs result "/* END SECTION $method */"
    }
    return $result
  }
  method generate-loader {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set result {}
    if {[my define get initfunc] eq {}} return
    ::practcl::cputs result  "
extern int DLLEXPORT [my define get initfunc]( Tcl_Interp *interp ) \{"
    ::practcl::cputs result  {
  /* Initialise the stubs tables. */
  #ifdef USE_TCL_STUBS
    if (Tcl_InitStubs(interp, "8.6", 0)==NULL) return TCL_ERROR;
    if (TclOOInitializeStubs(interp, "1.0") == NULL) return TCL_ERROR;
}
    if {[my define get tk 0]} {
      ::practcl::cputs result  {    if (Tk_InitStubs(interp, "8.6", 0)==NULL) return TCL_ERROR;}
    }
    ::practcl::cputs result {  #endif}
    set TCLINIT [my generate-tcl-pre]
    if {[string length [string trim $TCLINIT]]} {
      ::practcl::cputs result "  if(interp) {\nif(Tcl_Eval(interp,[::practcl::tcl_to_c $TCLINIT])) return TCL_ERROR;\n  }"
    }
    ::practcl::cputs result [my generate-loader-module]

    set TCLINIT [my generate-tcl-post]
    if {[string length [string trim $TCLINIT]]} {
      ::practcl::cputs result "  if(interp) {\nif(Tcl_Eval(interp,[::practcl::tcl_to_c $TCLINIT])) return TCL_ERROR;\n }"
    }
    if {[my define exists pkg_name]} {
      ::practcl::cputs result  "    if (Tcl_PkgProvide(interp, \"[my define get pkg_name [my define get name]]\" , \"[my define get pkg_vers [my define get version]]\" )) return TCL_ERROR\;"
    }
    ::practcl::cputs result  "  return TCL_OK\;\n\}\n"
    return $result
  }
  method initialize {} {
    set filename [my define get filename]
    if {$filename eq {}} {
      return
    }
    if {[my define get name] eq {}} {
      my define set name [file tail [file dirname $filename]]
    }
    if {[my define get localpath] eq {}} {
      my define set localpath [my <project> define get name]_[my define get name]
    }
    my graft module [self]
    ::practcl::debug [self] SOURCE $filename
    my source $filename
  }
  method implement path {
    my go
    my Collate_Source $path
    set errs {}
    foreach item [my link list dynamic] {
      if {[catch {$item implement $path} err errdat]} {
        lappend errs "Skipped $item: [$item define get filename] $err"
        if {[dict exists $errdat -errorinfo]} {
          lappend errs [dict get $errdat -errorinfo]
        } else {
          lappend errs $errdat
        }
      }
    }
    foreach item [my link list module] {
      if {[catch {$item implement $path} err errdat]} {
        lappend errs "Skipped $item: [$item define get filename] $err"
        if {[dict exists $errdat -errorinfo]} {
          lappend errs [dict get $errdat -errorinfo]
        } else {
          lappend errs $errdat
        }
      }
    }
    if {[llength $errs]} {
      set logfile [file join $::CWD practcl.log]
      ::practcl::log $logfile "*** ERRORS ***"
      foreach {item trace} $errs {
        ::practcl::log $logfile "###\n# ERROR\n###\n$item"
       ::practcl::log $logfile "###\n# TRACE\n###\n$trace"
      }
      ::practcl::log $logfile "*** DEBUG INFO ***"
      ::practcl::log $logfile $::DEBUG_INFO
      puts stderr "Errors saved to $logfile"
      exit 1
    }
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set filename [my define get output_c]
    if {$filename eq {}} {
      ::practcl::debug [list /[self] [self method] [self class]]
      return
    }
    set cout [open [file join $path [file rootname $filename].c] w]
    puts $cout [subst {/*
** This file is generated by the [info script] script
** any changes will be overwritten the next time it is run
*/}]
    puts $cout [my generate-c]
    puts $cout [my generate-loader]
    close $cout
    ::practcl::debug [list /[self] [self method] [self class]]
  }
  method linktype {} {
    return {subordinate product dynamic module}
  }
}

###
# END: class module.tcl
###
###
# START: class project baseclass.tcl
###
::clay::define ::practcl::project {
  superclass ::practcl::module
  method _MorphPatterns {} {
    return {{@name@} {::practcl::@name@} {::practcl::project.@name@} {::practcl::project}}
  }
  constructor args {
    my variable define
    if {[llength $args] == 1} {
      set rawcontents [lindex $args 0]
    } else {
      set rawcontents $args
    }
    if {[catch {uplevel 1 [list subst $rawcontents]} contents]} {
      set contents $rawcontents
    }
    ###
    # The first instance of ::practcl::project (or its descendents)
    # registers itself as the ::practcl::MAIN. If a project other
    # than ::practcl::LOCAL is created, odds are that was the one
    # the developer intended to be the main project
    ###
    if {$::practcl::MAIN eq "::practcl::LOCAL"} {
      set ::practcl::MAIN [self]
    }
    # DEFS fields need to be passed unchanged and unsubstituted
    # as we need to preserve their escape characters
    foreach field {TCL_DEFS DEFS TK_DEFS} {
      if {[dict exists $rawcontents $field]} {
        dict set contents $field [dict get $rawcontents $field]
      }
    }
    my graft module [self]
    array set define $contents
    ::practcl::toolset select [self]
    my initialize
  }
  method add_object object {
    my link object $object
  }
  method add_project {pkg info {oodefine {}}} {
    ::practcl::debug [self] add_project $pkg $info
    set os [my define get TEACUP_OS]
    if {$os eq {}} {
      set os [::practcl::os]
      my define set os $os
    }
    set fossilinfo [list download [my define get download] tag trunk sandbox [my define get sandbox]]
    if {[dict exists $info os] && ($os ni [dict get $info os])} return
    # Select which tag to use here.
    # For production builds: tag-release
    set profile [my define get profile release]:
    if {[dict exists $info profile $profile]} {
      dict set info tag [dict get $info profile $profile]
    }
    dict set info USEMSVC [my define get USEMSVC 0]
    dict set info debug [my define get debug 0]
    set obj [namespace current]::PROJECT.$pkg
    if {[info command $obj] eq {}} {
      set obj [::practcl::subproject create $obj [self] [dict merge $fossilinfo [list name $pkg pkg_name $pkg static 0 class subproject.binary] $info]]
    }
    my link object $obj
    oo::objdefine $obj $oodefine
    $obj define set masterpath $::CWD
    $obj go
    return $obj
  }
  method add_tool {pkg info {oodefine {}}} {
    ::practcl::debug [self] add_tool $pkg $info
    set info [dict merge [::practcl::local_os] $info]

    set os [dict get $info TEACUP_OS]
    set fossilinfo [list download [my define get download] tag trunk sandbox [my define get sandbox]]
    if {[dict exists $info os] && ($os ni [dict get $info os])} return
    # Select which tag to use here.
    # For production builds: tag-release
    set profile [my define get profile release]:
    if {[dict exists $info profile $profile]} {
      dict set info tag [dict get $info profile $profile]
    }
    set obj ::practcl::OBJECT::TOOL.$pkg
    if {[info command $obj] eq {}} {
      set obj [::practcl::subproject create $obj [self] [dict merge $fossilinfo [list name $pkg pkg_name $pkg static 0] $info]]
    }
    my link add tool $obj
    oo::objdefine $obj $oodefine
    $obj define set masterpath $::CWD
    $obj go
    return $obj
  }
  method build-tclcore {} {
    set os [my define get TEACUP_OS]
    set tcl_config_opts [::practcl::platform::tcl_core_options $os]
    set tk_config_opts  [::practcl::platform::tk_core_options $os]

    lappend tcl_config_opts --prefix [my define get prefix] --exec-prefix [my define get prefix]
    set tclobj [my tclcore]
    if {[my define get debug 0]} {
      $tclobj define set debug 1
      lappend tcl_config_opts --enable-symbols=true
    }
    $tclobj define set config_opts $tcl_config_opts
    $tclobj go
    $tclobj compile

    set _TclSrcDir [$tclobj define get localsrcdir]
    my define set tclsrcdir $_TclSrcDir
    if {[my define get tk 0]} {
      set tkobj [my tkcore]
      lappend tk_config_opts --with-tcl=[::practcl::file_relative [$tkobj define get builddir]  [$tclobj define get builddir]]
      if {[my define get debug 0]} {
        $tkobj define set debug 1
        lappend tk_config_opts --enable-symbols=true
      }
      $tkobj define set config_opts $tk_config_opts
      $tkobj compile
    }
  }
  method child which {
    switch $which {
      delegate -
      organs {
	# A library can be a project, it can be a module. Any
	# subordinate modules will indicate their existance
        return [list project [self] module [self]]
      }
    }
  }
  method linktype {} {
    return project
  }
  method project {pkg args} {
    set obj [namespace current]::PROJECT.$pkg
    if {[llength $args]==0} {
      return $obj
    }
    ${obj} {*}$args
  }
  method tclcore {} {
    if {[info commands [set obj [my clay delegate tclcore]]] ne {}} {
      return $obj
    }
    if {[info commands [set obj [my project TCLCORE]]] ne {}} {
      my graft tclcore $obj
      return $obj
    }
    if {[info commands [set obj [my project tcl]]] ne {}} {
      my graft tclcore $obj
      return $obj
    }
    if {[info commands [set obj [my tool tcl]]] ne {}} {
      my graft tclcore $obj
      return $obj
    }
    # Provide a fallback
    set obj [my add_tool tcl {
      tag release class subproject.core
      fossil_url http://core.tcl.tk/tcl
    }]
    my graft tclcore $obj
    return $obj
  }
  method tkcore {} {
    if {[set obj [my clay delegate tkcore]] ne {}} {
      return $obj
    }
    if {[set obj [my project tk]] ne {}} {
      my graft tkcore $obj
      return $obj
    }
    if {[set obj [my tool tk]] ne {}} {
      my graft tkcore $obj
      return $obj
    }
    # Provide a fallback
    set obj [my add_tool tk {
      tag release class tool.core
      fossil_url http://core.tcl.tk/tk
    }]
    my graft tkcore $obj
    return $obj
  }
  method tool {pkg args} {
    set obj ::practcl::OBJECT::TOOL.$pkg
    if {[llength $args]==0} {
      return $obj
    }
    ${obj} {*}$args
  }
}

###
# END: class project baseclass.tcl
###
###
# START: class project library.tcl
###
::clay::define ::practcl::library {
  superclass ::practcl::project
  method clean {PATH} {
    set objext [my define get OBJEXT o]
    foreach {ofile info} [my project-compile-products] {
      if {[file exists [file join $PATH objs $ofile].${objext}]} {
        file delete [file join $PATH objs $ofile].${objext}
      }
    }
    foreach ofile [glob -nocomplain [file join $PATH *.${objext}]] {
      file delete $ofile
    }
    foreach ofile [glob -nocomplain [file join $PATH objs *]] {
      file delete $ofile
    }
    set libfile [my define get libfile]
    if {[file exists [file join $PATH $libfile]]} {
      file delete [file join $PATH $libfile]
    }
    my implement $PATH
  }
  method project-compile-products {} {
    set result {}
    foreach item [my link list subordinate] {
      lappend result {*}[$item project-compile-products]
    }
    set filename [my define get output_c]
    if {$filename ne {}} {
      ::practcl::debug [self] [self class] [self method] project-compile-products $filename
      set ofile [file rootname [file tail $filename]]_main
      lappend result $ofile [list cfile $filename extra [my define get extra] external [string is true -strict [my define get external]]]
    }
    return $result
  }
  method go {} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set name [my define getnull name]
    if {$name eq {}} {
      set name generic
      my define name generic
    }
    if {[my define get tk] eq {@TEA_TK_EXTENSION@}} {
      my define set tk 0
    }
    set output_c [my define getnull output_c]
    if {$output_c eq {}} {
      set output_c [file rootname $name].c
      my define set output_c $output_c
    }
    set output_h [my define getnull output_h]
    if {$output_h eq {}} {
      set output_h [file rootname $output_c].h
      my define set output_h $output_h
    }
    set output_tcl [my define getnull output_tcl]
    #if {$output_tcl eq {}} {
    #  set output_tcl [file rootname $output_c].tcl
    #  my define set output_tcl $output_tcl
    #}
    #set output_mk [my define getnull output_mk]
    #if {$output_mk eq {}} {
    #  set output_mk [file rootname $output_c].mk
    #  my define set output_mk $output_mk
    #}
    set initfunc [my define getnull initfunc]
    if {$initfunc eq {}} {
      set initfunc [string totitle $name]_Init
      my define set initfunc $initfunc
    }
    set output_decls [my define getnull output_decls]
    if {$output_decls eq {}} {
      set output_decls [file rootname $output_c].decls
      my define set output_decls $output_decls
    }
    my variable links
    foreach {linktype objs} [array get links] {
      foreach obj $objs {
        $obj go
      }
    }
    ::practcl::debug [list /[self] [self method] [self class] -- [my define get filename] [info object class [self]]]
  }
  method generate-decls {pkgname path} {
    ::practcl::debug [list [self] [self method] [self class] -- [my define get filename] [info object class [self]]]
    set outfile [file join $path/$pkgname.decls]

    ###
    # Build the decls file
    ## #
    set fout [open $outfile w]
    puts $fout [subst {###
  # $outfile
  #
  # This file was generated by [info script]
  ###

library $pkgname
interface $pkgname
}]

    ###
    # Generate list of functions
    ###
    set stubfuncts [my generate-stub-function]
    set thisline {}
    set functcount 0
    foreach {func header} $stubfuncts {
      puts $fout [list declare [incr functcount] $header]
    }
    puts $fout [list export "int [my define get initfunc](Tcl_Inter *interp)"]
    puts $fout [list export "char *[string totitle [my define get name]]_InitStubs(Tcl_Inter *interp, char *version, int exact)"]

    close $fout

    ###
    # Build [package]Decls.h
    ###
    set hout [open [file join $path ${pkgname}Decls.h] w]
    close $hout

    set cout [open [file join $path ${pkgname}StubInit.c] w]
    puts $cout [string map [list %pkgname% $pkgname %PkgName% [string totitle $pkgname]] {
#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif
#undef USE_TCL_STUB_PROCS

#include "tcl.h"
#include "%pkgname%.h"

/*
** Ensure that Tdom_InitStubs is built as an exported symbol.  The other stub
** functions should be built as non-exported symbols.
*/

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

%PkgName%Stubs *%pkgname%StubsPtr;

 /*
 **----------------------------------------------------------------------
 **
 **  %PkgName%_InitStubs --
 **
 **        Checks that the correct version of %PkgName% is loaded and that it
 **        supports stubs. It then initialises the stub table pointers.
 **
 **  Results:
 **        The actual version of %PkgName% that satisfies the request, or
 **        NULL to indicate that an error occurred.
 **
 **  Side effects:
 **        Sets the stub table pointers.
 **
 **----------------------------------------------------------------------
 */

char *
%PkgName%_InitStubs (Tcl_Interp *interp, char *version, int exact)
{
  char *actualVersion;
  actualVersion = Tcl_PkgRequireEx(interp, "%pkgname%", version, exact,(ClientData *) &%pkgname%StubsPtr);
  if (!actualVersion) {
    return NULL;
  }
  if (!%pkgname%StubsPtr) {
    Tcl_SetResult(interp,"This implementation of %PkgName% does not support stubs",TCL_STATIC);
    return NULL;
  }
  return actualVersion;
}
}]
    close $cout
  }
  method implement path {
    my go
    my Collate_Source $path
    set errs {}
    foreach item [my link list dynamic] {
      if {[catch {$item implement $path} err errdat]} {
        lappend errs "Skipped $item: [$item define get filename] $err"
        if {[dict exists $errdat -errorinfo]} {
          lappend errs [dict get $errdat -errorinfo]
        } else {
          lappend errs $errdat
        }
      }
    }
    foreach item [my link list module] {
      if {[catch {$item implement $path} err errdat]} {
        lappend errs "Skipped $item: [$item define get filename] $err"
        if {[dict exists $errdat -errorinfo]} {
          lappend errs [dict get $errdat -errorinfo]
        } else {
          lappend errs $errdat
        }
      }
    }
    if {[llength $errs]} {
      set logfile [file join $::CWD practcl.log]
      ::practcl::log $logfile "*** ERRORS ***"
      foreach {item trace} $errs {
        ::practcl::log $logfile "###\n# ERROR\n###$item"
        ::practcl::log $logfile "###\n# TRACE\n###$trace"
      }
      ::practcl::log $logfile "*** DEBUG INFO ***"
      ::practcl::log $logfile $::DEBUG_INFO
      puts stderr "Errors saved to $logfile"
      exit 1
    }
    set cout [open [file join $path [my define get output_c]] w]
    puts $cout [subst {/*
** This file is generated by the [info script] script
** any changes will be overwritten the next time it is run
*/}]
    puts $cout [my generate-c]
    puts $cout [my generate-loader]
    close $cout

    set macro HAVE_[string toupper [file rootname [my define get output_h]]]_H
    set hout [open [file join $path [my define get output_h]] w]
    puts $hout [subst {/*
** This file is generated by the [info script] script
** any changes will be overwritten the next time it is run
*/}]
    puts $hout "#ifndef ${macro}"
    puts $hout "#define ${macro} 1"
    puts $hout [my generate-h]
    puts $hout "#endif"
    close $hout

    set output_tcl [my define get output_tcl]
    if {$output_tcl ne {}} {
      set tclout [open [file join $path [my define get output_tcl]] w]
      puts $tclout "###
# This file is generated by the [info script] script
# any changes will be overwritten the next time it is run
###"
      puts $tclout [my generate-tcl-pre]
      puts $tclout [my generate-tcl-loader]
      puts $tclout [my generate-tcl-post]
      close $tclout
    }
  }
  method generate-make path {
    my build-Makefile $path [self]
  }
  method linktype {} {
    return library
  }
  method package-ifneeded {args} {
    set result {}
    set name [my define get pkg_name [my define get name]]
    set version [my define get pkg_vers [my define get version]]
    if {$version eq {}} {
      set version 0.1a
    }
    set output_tcl [my define get output_tcl]
    if {$output_tcl ne {}} {
      set script "\[list source \[file join \$dir $output_tcl\]\]"
    } elseif {[my define get SHARED_BUILD 0]} {
      set script "\[list load \[file join \$dir [my define get libfile]\] $name\]"
    } else {
      # Provide a null passthrough
      set script "\[list package provide $name $version\]"
    }
    set result "package ifneeded [list $name] [list $version] $script"
    foreach alias $args {
      set script "package require $name $version \; package provide $alias $version"
      append result \n\n [list package ifneeded $alias $version $script]
    }
    return $result
  }
  method shared_library {{filename {}}} {
    set name [string tolower [my define get name [my define get pkg_name]]]
    set NAME [string toupper $name]
    set version [my define get version [my define get pkg_vers]]
    set map {}
    lappend map %LIBRARY_NAME% $name
    lappend map %LIBRARY_VERSION% $version
    lappend map %LIBRARY_VERSION_NODOTS% [string map {. {}} $version]
    lappend map %LIBRARY_PREFIX% [my define getnull libprefix]
    set outfile [string map $map [my define get PRACTCL_NAME_LIBRARY]][my define get SHLIB_SUFFIX]
    return $outfile
  }
  method static_library {{filename {}}} {
    set name [string tolower [my define get name [my define get pkg_name]]]
    set NAME [string toupper $name]
    set version [my define get version [my define get pkg_vers]]
    set map {}
    lappend map %LIBRARY_NAME% $name
    lappend map %LIBRARY_VERSION% $version
    lappend map %LIBRARY_VERSION_NODOTS% [string map {. {}} $version]
    lappend map %LIBRARY_PREFIX% [my define getnull libprefix]
    set outfile [string map $map [my define get PRACTCL_NAME_LIBRARY]].a
    return $outfile
  }
}

###
# END: class project library.tcl
###
###
# START: class project tclkit.tcl
###
::clay::define ::practcl::tclkit {
  superclass ::practcl::library
  method build-tclkit_main {PROJECT PKG_OBJS} {
    ###
    # Build static package list
    ###
    set statpkglist {}
    foreach cobj [list {*}${PKG_OBJS} $PROJECT] {
      foreach {pkg info} [$cobj project-static-packages] {
        dict set statpkglist $pkg $info
      }
    }
    foreach {ofile info} [${PROJECT} project-compile-products] {
      if {![dict exists $info object]} continue
      set cobj [dict get $info object]
      foreach {pkg info} [$cobj project-static-packages] {
        dict set statpkglist $pkg $info
      }
    }

    set result {}
    $PROJECT include {<tcl.h>}
    $PROJECT include {"tclInt.h"}
    $PROJECT include {"tclFileSystem.h"}
    $PROJECT include {<assert.h>}
    $PROJECT include {<stdio.h>}
    $PROJECT include {<stdlib.h>}
    $PROJECT include {<string.h>}
    $PROJECT include {<math.h>}

    $PROJECT code header {
#ifndef MODULE_SCOPE
#   define MODULE_SCOPE extern
#endif

/*
** Provide a dummy Tcl_InitStubs if we are using this as a static
** library.
*/
#ifndef USE_TCL_STUBS
# undef  Tcl_InitStubs
# define Tcl_InitStubs(a,b,c) TCL_VERSION
#endif
#define STATIC_BUILD 1
#undef USE_TCL_STUBS

/* Make sure the stubbed variants of those are never used. */
#undef Tcl_ObjSetVar2
#undef Tcl_NewStringObj
#undef Tk_Init
#undef Tk_MainEx
#undef Tk_SafeInit
}

    # Build an area of the file for #define directives and
    # function declarations
    set define {}
    set mainhook   [$PROJECT define get TCL_LOCAL_MAIN_HOOK Tclkit_MainHook]
    set mainfunc   [$PROJECT define get TCL_LOCAL_APPINIT Tclkit_AppInit]
    set mainscript [$PROJECT define get main.tcl main.tcl]
    set vfsroot    [$PROJECT define get vfsroot "[$PROJECT define get ZIPFS_VOLUME]app"]
    set vfs_main "${vfsroot}/${mainscript}"

    set map {}
    foreach var {
      vfsroot mainhook mainfunc vfs_main
    } {
      dict set map %${var}% [set $var]
    }
    set thread_init_script {namespace eval ::starkit {}}
    append thread_init_script \n [list set ::starkit::topdir $vfsroot]
    set preinitscript {
set ::odie(boot_vfs) %vfsroot%
set ::SRCDIR $::odie(boot_vfs)
namespace eval ::starkit {}
set ::starkit::topdir %vfsroot%
if {[file exists [file join %vfsroot% tcl_library init.tcl]]} {
  set ::tcl_library [file join %vfsroot% tcl_library]
  set ::auto_path {}
}
if {[file exists [file join %vfsroot% tk_library tk.tcl]]} {
  set ::tk_library [file join %vfsroot% tk_library]
}
} ; # Preinitscript

    set zvfsboot {
/*
 * %mainhook% --
 * Performs the argument munging for the shell
 */
  }
    ::practcl::cputs zvfsboot {
  CONST char *archive;
  Tcl_FindExecutable(*argv[0]);
  archive=Tcl_GetNameOfExecutable();
}
    # We have to initialize the virtual filesystem before calling
    # Tcl_Init().  Otherwise, Tcl_Init() will not be able to find
    # its startup script files.
    if {![$PROJECT define get tip_430 0]} {
      # Add declarations of functions that tip430 puts in the stub files
      $PROJECT code public-header {
int TclZipfs_Init(Tcl_Interp *interp);
int TclZipfs_Mount(
    Tcl_Interp *interp,
    const char *mntpt,
    const char *zipname,
    const char *passwd
);
int TclZipfs_Mount_Buffer(
    Tcl_Interp *interp,
    const char *mntpt,
    unsigned char *data,
    size_t datalen,
    int copy
);
}
      ::practcl::cputs zvfsboot {  TclZipfs_Init(NULL);}
    }
    ::practcl::cputs zvfsboot "  if(!TclZipfs_Mount(NULL, \"app\", archive, NULL)) \x7B "
    ::practcl::cputs zvfsboot {
      Tcl_Obj *vfsinitscript;
      vfsinitscript=Tcl_NewStringObj("%vfs_main%",-1);
      Tcl_IncrRefCount(vfsinitscript);
      if(Tcl_FSAccess(vfsinitscript,F_OK)==0) {
        /* Startup script should be set before calling Tcl_AppInit */
        Tcl_SetStartupScript(vfsinitscript,NULL);
      }
    }
    ::practcl::cputs zvfsboot "    TclSetPreInitScript([::practcl::tcl_to_c $preinitscript])\;"
    ::practcl::cputs zvfsboot "  \x7D else \x7B"
    ::practcl::cputs zvfsboot "    TclSetPreInitScript([::practcl::tcl_to_c {
foreach path {../tcl} {
  set p  [file join $path library init.tcl]
  if {[file exists [file join $path library init.tcl]]} {
    set ::tcl_library [file normalize [file join $path library]]
    break
  }
}
foreach path {
  ../tk
} {
  if {[file exists [file join $path library tk.tcl]]} {
    set ::tk_library [file normalize [file join $path library]]
    break
  }
}
}])\;"
    ::practcl::cputs zvfsboot "  \x7D"
    ::practcl::cputs zvfsboot "  return TCL_OK;"

    if {[$PROJECT define get TEACUP_OS] eq "windows"} {
      set header {int %mainhook%(int *argc, TCHAR ***argv)}
    } else {
      set header {int %mainhook%(int *argc, char ***argv)}
    }
    $PROJECT c_function  [string map $map $header] [string map $map $zvfsboot]

    practcl::cputs appinit "int %mainfunc%(Tcl_Interp *interp) \x7B"

  # Build AppInit()
  set appinit {}
  practcl::cputs appinit {
  if ((Tcl_Init)(interp) == TCL_ERROR) {
      return TCL_ERROR;
  }

}
    if {![$PROJECT define get tip_430 0]} {
      ::practcl::cputs appinit {  TclZipfs_Init(interp);}
    }
    set main_init_script {}

    foreach {statpkg info} $statpkglist {
      set initfunc {}
      if {[dict exists $info initfunc]} {
        set initfunc [dict get $info initfunc]
      }
      if {$initfunc eq {}} {
        set initfunc [string totitle ${statpkg}]_Init
      }
      if {![dict exists $info version]} {
        error "$statpkg HAS NO VERSION"
      }
      # We employ a NULL to prevent the package system from thinking the
      # package is actually loaded into the interpreter
      $PROJECT code header "extern Tcl_PackageInitProc $initfunc\;\n"
      set script [list package ifneeded $statpkg [dict get $info version] [list ::load {} $statpkg]]
      append main_init_script \n [list set ::kitpkg(${statpkg}) $script]

      if {[dict get $info autoload]} {
        ::practcl::cputs appinit "  if(${initfunc}(interp)) return TCL_ERROR\;"
        ::practcl::cputs appinit "  Tcl_StaticPackage(interp,\"$statpkg\",$initfunc,NULL)\;"
      } else {
        ::practcl::cputs appinit "\n  Tcl_StaticPackage(NULL,\"$statpkg\",$initfunc,NULL)\;"
        append main_init_script \n $script
      }
    }
    append main_init_script \n {
if {[file exists [file join $::starkit::topdir pkgIndex.tcl]]} {
  #In a wrapped exe, we don't go out to the environment
  set dir $::starkit::topdir
  source [file join $::starkit::topdir pkgIndex.tcl]
}}
    append thread_init_script $main_init_script
    append main_init_script \n {
# Specify a user-specific startup file to invoke if the application
# is run interactively.  Typically the startup file is "~/.apprc"
# where "app" is the name of the application.  If this line is deleted
# then no user-specific startup file will be run under any conditions.
}
    append thread_init_script \n [list set ::starkit::thread_init $thread_init_script]
    append main_init_script \n [list set ::starkit::thread_init $thread_init_script]
    append main_init_script \n [list set tcl_rcFileName [$PROJECT define get tcl_rcFileName ~/.tclshrc]]


    practcl::cputs appinit "  Tcl_Eval(interp,[::practcl::tcl_to_c  $thread_init_script]);"
    practcl::cputs appinit {  return TCL_OK;}
    $PROJECT c_function [string map $map "int %mainfunc%(Tcl_Interp *interp)"] [string map $map $appinit]
  }
  method Collate_Source CWD {
    next $CWD
    set name [my define get name]
    # Assume a static shell
    if {[my define exists SHARED_BUILD]} {
      my define set SHARED_BUILD 0
    }
    if {![my define exists TCL_LOCAL_APPINIT]} {
      my define set TCL_LOCAL_APPINIT Tclkit_AppInit
    }
    if {![my define exists TCL_LOCAL_MAIN_HOOK]} {
      my define set TCL_LOCAL_MAIN_HOOK Tclkit_MainHook
    }
    set PROJECT [self]
    set os [$PROJECT define get TEACUP_OS]
    if {[my define get SHARED_BUILD 0]} {
      puts [list BUILDING TCLSH FOR OS $os]
    } else {
      puts [list BUILDING KIT FOR OS $os]
    }
    set TCLOBJ [$PROJECT tclcore]
    ::practcl::toolset select $TCLOBJ

    set TCLSRCDIR [$TCLOBJ define get srcdir]
    set PKG_OBJS {}
    foreach item [$PROJECT link list core.library] {
      if {[string is true [$item define get static]]} {
        lappend PKG_OBJS $item
      }
    }
    foreach item [$PROJECT link list package] {
      if {[string is true [$item define get static]]} {
        lappend PKG_OBJS $item
      }
    }
    # Arrange to build an main.c that utilizes TCL_LOCAL_APPINIT and TCL_LOCAL_MAIN_HOOK
    if {$os eq "windows"} {
      set PLATFORM_SRC_DIR win
      if {[my define get SHARED_BUILD 0]} {
        my add class csource filename [file join $TCLSRCDIR win tclWinReg.c] initfunc Registry_Init pkg_name registry pkg_vers 1.3.1 autoload 1
        my add class csource filename [file join $TCLSRCDIR win tclWinDde.c] initfunc Dde_Init pkg_name dde pkg_vers 1.4.0 autoload 1
      }
      my add class csource ofile [my define get name]_appinit.o filename [file join $TCLSRCDIR win tclAppInit.c] extra [list -DTCL_LOCAL_MAIN_HOOK=[my define get TCL_LOCAL_MAIN_HOOK Tclkit_MainHook] -DTCL_LOCAL_APPINIT=[my define get TCL_LOCAL_APPINIT Tclkit_AppInit]]
    } else {
      set PLATFORM_SRC_DIR unix
      my add class csource ofile [my define get name]_appinit.o filename [file join $TCLSRCDIR unix tclAppInit.c] extra [list -DTCL_LOCAL_MAIN_HOOK=[my define get TCL_LOCAL_MAIN_HOOK Tclkit_MainHook] -DTCL_LOCAL_APPINIT=[my define get TCL_LOCAL_APPINIT Tclkit_AppInit]]
    }

    if {[my define get SHARED_BUILD 0]} {
      ###
      # Add local static Zlib implementation
      ###
      set cdir [file join $TCLSRCDIR compat zlib]
      foreach file {
        adler32.c compress.c crc32.c
        deflate.c infback.c inffast.c
        inflate.c inftrees.c trees.c
        uncompr.c zutil.c
      } {
        my add [file join $cdir $file]
      }
    }
    ###
    # Pre 8.7, Tcl doesn't include a Zipfs implementation
    # in the core. Grab the one from odielib
    ###
    set zipfs [file join $TCLSRCDIR generic tclZipfs.c]
    if {![$PROJECT define exists ZIPFS_VOLUME]} {
      $PROJECT define set ZIPFS_VOLUME "zipfs:/"
    }
    $PROJECT code header "#define ZIPFS_VOLUME \"[$PROJECT define get ZIPFS_VOLUME]\""
    if {[file exists $zipfs]} {
      $TCLOBJ define set tip_430 1
      my define set tip_430 1
    } else {
      # The Tclconfig project maintains a mirror of the version
      # released with the Tcl core
      my define set tip_430 0
      ::practcl::LOCAL tool tclconfig unpack
      set COMPATSRCROOT [::practcl::LOCAL tool tclconfig define get srcdir]
      my add class csource ofile tclZipfs.o filename [file join $COMPATSRCROOT compat tclZipfs.c] extra -I[::practcl::file_relative $CWD [file join $TCLSRCDIR compat zlib contrib minizip]]
    }

    my define add include_dir [file join $TCLSRCDIR generic]
    my define add include_dir [file join $TCLSRCDIR $PLATFORM_SRC_DIR]
    # This file will implement TCL_LOCAL_APPINIT and TCL_LOCAL_MAIN_HOOK
    my build-tclkit_main $PROJECT $PKG_OBJS
  }
  method wrap {PWD exename vfspath args} {
    cd $PWD
    if {![file exists $vfspath]} {
      file mkdir $vfspath
    }
    foreach item [my link list core.library] {
      set name  [$item define get name]
      set libsrcdir [$item define get srcdir]
      if {[file exists [file join $libsrcdir library]]} {
        ::practcl::copyDir [file join $libsrcdir library] [file join $vfspath ${name}_library]
      }
    }
    # Assume the user will populate the VFS path
    #if {[my define get installdir] ne {}} {
    #  ::practcl::copyDir [file join [my define get installdir] [string trimleft [my define get prefix] /] lib] [file join $vfspath lib]
    #}
    foreach arg $args {
       ::practcl::copyDir $arg $vfspath
    }

    set fout [open [file join $vfspath pkgIndex.tcl] w]
    puts $fout [string map [list %platform% [my define get TEACUP_PROFILE]] {set ::tcl_teapot_profile {%platform%}}]
    puts $fout {
set ::PKGIDXFILE [info script]
set dir [file dirname $::PKGIDXFILE]
if {$::tcl_platform(platform) eq "windows"} {
  set ::g(HOME) [file join [file normalize $::env(LOCALAPPDATA)] tcl]
} else {
  set ::g(HOME) [file normalize ~/tcl]
}
set ::tcl_teapot [file join $::g(HOME) teapot $::tcl_teapot_profile]
lappend ::auto_path $::tcl_teapot
}
    puts $fout [list proc installDir [info args ::practcl::installDir] [info body ::practcl::installDir]]
    set buffer [::practcl::pkgindex_path $vfspath]
    puts $fout $buffer
    puts $fout {
# Advertise statically linked packages
foreach {pkg script} [array get ::kitpkg] {
  eval $script
}
}
    puts $fout {
###
# Cache binary packages distributed as dynamic libraries in a known location
###
foreach teapath [glob -nocomplain [file join $dir teapot $::tcl_teapot_profile *]] {
  set pkg [file tail $teapath]
  set pkginstall [file join $::tcl_teapot $pkg]
  if {![file exists $pkginstall]} {
    installDir $teapath $pkginstall
  }
}
}
    close $fout

    set EXEEXT [my define get EXEEXT]
    set tclkit_bare [my define get tclkit_bare]
    ::practcl::mkzip ${exename}${EXEEXT} $tclkit_bare $vfspath
    if { [my define get TEACUP_OS] ne "windows" } {
      file attributes ${exename}${EXEEXT} -permissions a+x
    }
  }
}

###
# END: class project tclkit.tcl
###
###
# START: class distro baseclass.tcl
###
::clay::define ::practcl::distribution {
  method scm_info {} {
    return {
      scm  None
      hash {}
      maxdate {}
      tags {}
      isodate {}
    }
  }
  method DistroMixIn {} {
    my define set scm none
  }
  method Sandbox {} {
    if {[my define exists sandbox]} {
      return [my define get sandbox]
    }
    if {[my clay delegate project] ni {::noop {}}} {
      set sandbox [my <project> define get sandbox]
      if {$sandbox ne {}} {
        my define set sandbox $sandbox
        return $sandbox
      }
    }
    set sandbox [file normalize [file join $::CWD ..]]
    my define set sandbox $sandbox
    return $sandbox
  }
  method SrcDir {} {
    set pkg [my define get name]
    if {[my define exists srcdir]} {
      return [my define get srcdir]
    }
    set sandbox [my Sandbox]
    set srcdir [file join [my Sandbox] $pkg]
    my define set srcdir $srcdir
    return $srcdir
  }
  method ScmTag    {} {}
  method ScmClone  {} {}
  method ScmUnpack {} {}
  method ScmUpdate {} {}
  method Unpack {} {
    set srcdir [my SrcDir]
    if {[file exists $srcdir]} {
      return
    }
    set pkg [my define get name]
    if {[my define exists download]} {
      # Utilize a staged download
      set download [my define get download]
      if {[file exists [file join $download $pkg.zip]]} {
        ::practcl::tcllib_require zipfile::decode
        ::zipfile::decode::unzipfile [file join $download $pkg.zip] $srcdir
        return
      }
    }
    my ScmUnpack
  }
}
oo::objdefine ::practcl::distribution {
  method Sandbox {object} {
    if {[$object define exists sandbox]} {
      return [$object define get sandbox]
    }
    if {[$object clay delegate project] ni {::noop {}}} {
      set sandbox [$object <project> define get sandbox]
      if {$sandbox ne {}} {
        $object define set sandbox $sandbox
        return $sandbox
      }
    }
    set pkg [$object define get name]
    set sandbox [file normalize [file join $::CWD ..]]
    $object define set sandbox $sandbox
    return $sandbox
  }

  method select object {
    if {[$object define exists scm]} {
      return [$object define get scm]
    }

    set pkg [$object define get name]
    if {[$object define get srcdir] ne {}} {
      set srcdir [$object define get srcdir]
    } else {
      set srcdir [file join [my Sandbox $object] $pkg]
      $object define set srcdir $srcdir
    }

    set classprefix ::practcl::distribution.
    if {[file exists $srcdir]} {
      foreach class [::info commands ${classprefix}*] {
        if {[$class claim_path $srcdir]} {
          $object clay mixinmap distribution $class
          set name [$class claim_option]
          $object define set scm $name
          return $name
        }
      }
    }
    foreach class [::info commands ${classprefix}*] {
      if {[$class claim_object $object]} {
        $object clay mixinmap distribution $class
        set name [$class claim_option]
        $object define set scm $name
        return $name
      }
    }
    if {[$object define get scm] eq {} && [$object define exists file_url]} {
      set class ::practcl::distribution.snapshot
      set name [$class claim_option]
      $object define set scm $name
      $object clay mixinmap distribution $class
      return $name
    }
    error "Cannot determine source distribution method"
  }

  method claim_option {} {
    return Unknown
  }

  method claim_object object {
    return false
  }

  method claim_path path {
    return false
  }
}

###
# END: class distro baseclass.tcl
###
###
# START: class distro snapshot.tcl
###
::clay::define ::practcl::distribution.snapshot {
  superclass ::practcl::distribution
  method ScmUnpack {} {
    set srcdir [my SrcDir]
    if {[file exists [file join $srcdir .download]]} {
      return 0
    }
    set dpath [::practcl::LOCAL define get download]
    set url [my define get file_url]
    set fname [file tail $url]
    set archive [file join $dpath $fname]
    if {![file exists $archive]} {
      ::http::wget $url $archive
    }
    set CWD [pwd]
    switch [file extension $fname] {
      .zip {
        # Zipfile

      }
      .tar {
        ::practcl::tcllib_require tar
      }
      .tgz -
      .gz {
        # Tarball
        ::practcl::tcllib_require tcl::transform::zlib
        ::practcl::tcllib_require tar
        set fh [::open $archive]
        fconfigure $fh -encoding binary -translation lf -eofchar {}
        ::tcl::transform::zlib $fh
      }
    }
    set fosdb [my ScmClone]
    set tag [my ScmTag]
    file mkdir $srcdir
    ::practcl::fossil $srcdir open $fosdb $tag
    return 1
  }
}
oo::objdefine ::practcl::distribution.snapshot {

  method claim_object object {
    return false
  }

  method claim_option {} {
    return snapshot
  }

  method claim_path path {
    if {[file exists [file join $path .download]]} {
      return true
    }
    return false
  }
}

###
# END: class distro snapshot.tcl
###
###
# START: class distro fossil.tcl
###
::clay::define ::practcl::distribution.fossil {
  superclass ::practcl::distribution
  method scm_info {} {
    set info [next]
    dict set info scm fossil
    foreach {field value} [::practcl::fossil_status [my define get srcdir]] {
      dict set info $field $value
    }
    return $info
  }
  method ScmClone  {} {
    set srcdir [my SrcDir]
    if {[file exists [file join $srcdir .fslckout]]} {
      return
    }
    if {[file exists [file join $srcdir _FOSSIL_]]} {
      return
    }
    if {![::info exists ::practcl::fossil_dbs]} {
      # Get a list of local fossil databases
      set ::practcl::fossil_dbs [exec fossil all list]
    }
    set pkg [my define get name]
    # Return an already downloaded fossil repo
    foreach line [split $::practcl::fossil_dbs \n] {
      set line [string trim $line]
      if {[file rootname [file tail $line]] eq $pkg} {
        return $line
      }
    }
    set download [::practcl::LOCAL define get download]
    set fosdb [file join $download $pkg.fos]
    if {[file exists $fosdb]} {
      return $fosdb
    }

    file mkdir [file join $download fossil]
    set fosdb [file join $download fossil $pkg.fos]
    if {[file exists $fosdb]} {
      return $fosdb
    }

    set cloned 0
    # Attempt to clone from a local network mirror
    if {[::practcl::LOCAL define exists fossil_mirror]} {
      set localmirror [::practcl::LOCAL define get fossil_mirror]
      catch {
        ::practcl::doexec fossil clone $localmirror/$pkg $fosdb
        set cloned 1
      }
      if {$cloned} {
        return $fosdb
      }
    }
    # Attempt to clone from the canonical source
    if {[my define get fossil_url] ne {}} {
      catch {
        ::practcl::doexec fossil clone [my define get fossil_url] $fosdb
        set cloned 1
      }
      if {$cloned} {
        return $fosdb
      }
    }
    # Fall back to the fossil mirror on the island of misfit toys
    ::practcl::doexec fossil clone http://fossil.etoyoc.com/fossil/$pkg $fosdb
    return $fosdb
  }
  method ScmTag {} {
    if {[my define exists scm_tag]} {
      return [my define get scm_tag]
    }
    if {[my define exists tag]} {
      set tag [my define get tag]
    } else {
      set tag trunk
    }
    my define set scm_tag $tag
    return $tag
  }
  method ScmUnpack {} {
    set srcdir [my SrcDir]
    if {[file exists [file join $srcdir .fslckout]]} {
      return 0
    }
    if {[file exists [file join $srcdir _FOSSIL_]]} {
      return 0
    }
    set CWD [pwd]
    set fosdb [my ScmClone]
    set tag [my ScmTag]
    file mkdir $srcdir
    ::practcl::fossil $srcdir open $fosdb $tag
    return 1
  }
  method ScmUpdate {} {
    if {[my ScmUnpack]} {
      return
    }
    set srcdir [my SrcDir]
    set tag [my ScmTag]
    ::practcl::fossil $srcdir update $tag
  }
}
oo::objdefine ::practcl::distribution.fossil {

  # Check for markers in the metadata
  method claim_object obj {
    set path [$obj define get srcdir]
    if {[my claim_path $path]} {
      return true
    }
    if {[$obj define get fossil_url] ne {}} {
      return true
    }
    return false
  }

  method claim_option {} {
    return fossil
  }

  # Check for markers in the source root
  method claim_path path {
    if {[file exists [file join $path .fslckout]]} {
      return true
    }
    if {[file exists [file join $path _FOSSIL_]]} {
      return true
    }
    return false
  }
}

###
# END: class distro fossil.tcl
###
###
# START: class distro git.tcl
###
::clay::define ::practcl::distribution.git {
  superclass ::practcl::distribution
  method ScmTag {} {
    if {[my define exists scm_tag]} {
      return [my define get scm_tag]
    }
    if {[my define exists tag]} {
      set tag [my define get tag]
    } else {
      set tag master
    }
    my define set scm_tag $tag
    return $tag
  }
  method ScmUnpack {} {
    set srcdir [my SrcDir]
    if {[file exists [file join $srcdir .git]]} {
      return 0
    }
    set CWD [pwd]
    set tag [my ScmTag]
    set pkg [my define get name]
    if {[my define exists git_url]} {
      ::practcl::doexec git clone --branch $tag [my define get git_url] $srcdir
    } else {
      ::practcl::doexec git clone --branch $tag https://github.com/eviltwinskippy/$pkg $srcdir
    }
    return 1
  }
  method ScmUpdate {} {
    if {[my ScmUnpack]} {
      return
    }
    set CWD [pwd]
    set srcdir [my SrcDir]
    set tag [my ScmTag]
    ::practcl::doexec_in $srcdir git pull
    cd $CWD
  }
}
oo::objdefine ::practcl::distribution.git {

  method claim_object obj {
    set path [$obj define get srcdir]
    if {[my claim_path $path]} {
      return true
    }
    if {[$obj define get git_url] ne {}} {
      return true
    }
    return false
  }

  method claim_option {} {
    return git
  }

  method claim_path path {
   if {[file exists [file join $path .git]]} {
      return true
    }
    return false
  }
}

###
# END: class distro git.tcl
###
###
# START: class subproject baseclass.tcl
###
::clay::define ::practcl::subproject {
  superclass ::practcl::module
  method _MorphPatterns {} {
    return {{::practcl::subproject.@name@} {::practcl::@name@} {@name@} {::practcl::subproject}}
  }
  method BuildDir {PWD} {
    return [my define get srcdir]
  }
  method child which {
    switch $which {
      delegate -
      organs {
	# A library can be a project, it can be a module. Any
	# subordinate modules will indicate their existance
        return [list project [self] module [self]]
      }
    }
  }
  method compile {} {}
  method go {} {
    ::practcl::distribution select [self]
    set name [my define get name]
    my define set builddir [my BuildDir [my define get masterpath]]
    my define set builddir [my BuildDir [my define get masterpath]]
    my sources
  }
  method install args {}
  method linktype {} {
    return {subordinate package}
  }
  method linker-products {configdict} {}
  method linker-external {configdict} {
    if {[dict exists $configdict PRACTCL_PKG_LIBS]} {
      return [dict get $configdict PRACTCL_PKG_LIBS]
    }
    if {[dict exists $configdict LIBS]} {
      return [dict get $configdict LIBS]
    }
  }
  method linker-extra {configdict} {
    if {[dict exists $configdict PRACTCL_LINKER_EXTRA]} {
      return [dict get $configdict PRACTCL_LINKER_EXTRA]
    }
    return {}
  }
  method env-bootstrap {} {
    set pkg [my define get pkg_name [my define get name]]
    package require $pkg
  }
  method env-exec {} {}
  method env-install {} {
    my unpack
  }
  method env-load {} {
    my variable loaded
    if {[info exists loaded]} {
      return 0
    }
    if {![my env-present]} {
      my env-install
    }
    my env-bootstrap
    set loaded 1
  }
  method env-present {} {
    set pkg [my define get pkg_name [my define get name]]
    if {[catch [list package require $pkg]]} {
      return 0
    }
    return 1
  }
  method sources {} {}
  method update {} {
    my ScmUpdate
  }
  method unpack {} {
    cd $::CWD
    ::practcl::distribution select [self]
    my Unpack
    ::practcl::toolset select [self]
    cd $::CWD
  }
}
::clay::define ::practcl::subproject.source {
  superclass ::practcl::subproject ::practcl::library
  method env-bootstrap {} {
    set LibraryRoot [file join [my define get srcdir] [my define get module_root modules]]
    if {[file exists $LibraryRoot] && $LibraryRoot ni $::auto_path} {
      set ::auto_path [linsert $::auto_path 0 $LibraryRoot]
    }
  }
  method env-present {} {
    set path [my define get srcdir]
    return [file exists $path]
  }
  method linktype {} {
    return {subordinate package source}
  }
}
::clay::define ::practcl::subproject.teapot {
  superclass ::practcl::subproject
  method env-bootstrap {} {
    set pkg [my define get pkg_name [my define get name]]
    package require $pkg
  }
  method env-install {} {
    set pkg [my define get pkg_name [my define get name]]
    set download [my <project> define get download]
    my unpack
    set prefix [string trimleft [my <project> define get prefix] /]
    ::practcl::tcllib_require zipfile::decode
    ::zipfile::decode::unzipfile [file join $download $pkg.zip] [file join $prefix lib $pkg]
  }
  method env-present {} {
    set pkg [my define get pkg_name [my define get name]]
    if {[catch [list package require $pkg]]} {
      return 0
    }
    return 1
  }
  method install DEST {
    set pkg [my define get pkg_name [my define get name]]
    set download [my <project> define get download]
    my unpack
    set prefix [string trimleft [my <project> define get prefix] /]
    ::practcl::tcllib_require zipfile::decode
    ::zipfile::decode::unzipfile [file join $download $pkg.zip] [file join $DEST $prefix lib $pkg]
  }
}
::clay::define ::practcl::subproject.kettle {
  superclass ::practcl::subproject
  method kettle {path args} {
    my variable kettle
    if {![info exists kettle]} {
      ::practcl::LOCAL tool kettle env-load
      set kettle [file join [::practcl::LOCAL tool kettle define get srcdir] kettle]
    }
    set srcdir [my SourceRoot]
    ::practcl::dotclexec $kettle -f [file join $srcdir build.tcl] {*}$args
  }
  method install DEST {
    my kettle reinstall --prefix $DEST
  }
}
::clay::define ::practcl::subproject.critcl {
  superclass ::practcl::subproject
  method install DEST {
    my critcl -pkg [my define get name]
    set srcdir [my SourceRoot]
    ::practcl::copyDir [file join $srcdir [my define get name]] [file join $DEST lib [my define get name]]
  }
}
::clay::define ::practcl::subproject.sak {
  superclass ::practcl::subproject
  method env-bootstrap {} {
    set LibraryRoot [file join [my define get srcdir] [my define get module_root modules]]
    if {[file exists $LibraryRoot] && $LibraryRoot ni $::auto_path} {
      set ::auto_path [linsert $::auto_path 0 $LibraryRoot]
    }
  }
  method env-install {} {
    ###
    # Handle teapot installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    my unpack
    set prefix [my <project> define get prefix [file normalize [file join ~ tcl]]]
    set srcdir [my define get srcdir]
    ::practcl::dotclexec [file join $srcdir installer.tcl] \
      -apps -app-path [file join $prefix apps] \
      -html -html-path [file join $prefix doc html $pkg] \
      -pkg-path [file join $prefix lib $pkg]  \
      -no-nroff -no-wait -no-gui
  }
  method env-present {} {
    set path [my define get srcdir]
    return [file exists $path]
  }
  method install DEST {
    ###
    # Handle teapot installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    my unpack
    set prefix [string trimleft [my <project> define get prefix] /]
    set srcdir [my define get srcdir]
    ::practcl::dotclexec [file join $srcdir installer.tcl] \
      -pkg-path [file join $DEST $prefix lib $pkg]  \
      -no-examples -no-html -no-nroff \
      -no-wait -no-gui -no-apps
  }
  method install-module {DEST args} {
    set srcdir [my define get srcdir]
    if {[llength $args]==1 && [lindex $args 0] in {* all}} {
      set pkg [my define get pkg_name [my define get name]]
      ::practcl::dotclexec [file join $srcdir installer.tcl] \
        -pkg-path [file join $DEST $pkg]  \
        -no-examples -no-html -no-nroff \
        -no-wait -no-gui -no-apps
    } else {
      foreach module $args {
        ::practcl::installModule [file join $srcdir modules $module] [file join $DEST $module]
      }
    }
  }
}
::clay::define ::practcl::subproject.practcl {
  superclass ::practcl::subproject
  method env-bootstrap {} {
    set LibraryRoot [file join [my define get srcdir] [my define get module_root modules]]
    if {[file exists $LibraryRoot] && $LibraryRoot ni $::auto_path} {
      set ::auto_path [linsert $::auto_path 0 $LibraryRoot]
    }
  }
  method env-install {} {
    ###
    # Handle teapot installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    my unpack
    set prefix [my <project> define get prefix [file normalize [file join ~ tcl]]]
    set srcdir [my define get srcdir]
    ::practcl::dotclexec [file join $srcdir make.tcl] install [file join $prefix lib $pkg]
  }
  method install DEST {
    ###
    # Handle teapot installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    my unpack
    set prefix [string trimleft [my <project> define get prefix] /]
    set srcdir [my define get srcdir]
    puts [list INSTALLING  [my define get name] to [file join $DEST $prefix lib $pkg]]
    ::practcl::dotclexec [file join $srcdir make.tcl] install [file join $DEST $prefix lib $pkg]
  }
  method install-module {DEST args} {
    set pkg [my define get pkg_name [my define get name]]
    set srcdir [my define get srcdir]
    ::practcl::dotclexec [file join $srcdir make.tcl] install-module $DEST {*}$args
  }
}

###
# END: class subproject baseclass.tcl
###
###
# START: class subproject binary.tcl
###
::clay::define ::practcl::subproject.binary {
  superclass ::practcl::subproject
  method clean {} {
    set builddir [file normalize [my define get builddir]]
    if {![file exists $builddir]} return
    if {[file exists [file join $builddir make.tcl]]} {
      ::practcl::domake.tcl $builddir clean
    } else {
      catch {::practcl::domake $builddir clean}
    }
  }
 method env-install {} {
    ###
    # Handle tea installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    set os [::practcl::local_os]
    my define set os $os
    my unpack
    set prefix [my <project> define get prefix [file normalize [file join ~ tcl]]]
    set srcdir [my define get srcdir]
    lappend options --prefix $prefix --exec-prefix $prefix
    my define set config_opts $options
    my go
    my clean
    my compile
    my make install {}
  }
  method project-compile-products {} {}
  method ComputeInstall {} {
    if {[my define exists install]} {
      switch [my define get install] {
        static {
          my define set static 1
          my define set autoload 0
        }
        static-autoload {
          my define set static 1
          my define set autoload 1
        }
        vfs {
          my define set static 0
          my define set autoload 0
          my define set vfsinstall 1
        }
        null {
          my define set static 0
          my define set autoload 0
          my define set vfsinstall 0
        }
        default {

        }
      }
    }
  }
  method go {} {
    next
    ::practcl::distribution select [self]
    my ComputeInstall
    my define set builddir [my BuildDir [my define get masterpath]]
  }
  method linker-products {configdict} {
    if {![my define get static 0]} {
      return {}
    }
    set srcdir [my define get builddir]
    if {[dict exists $configdict libfile]} {
      return " [file join $srcdir [dict get $configdict libfile]]"
    }
  }
  method project-static-packages {} {
    if {![my define get static 0]} {
      return {}
    }
    set result [my define get static_packages]
    set statpkg  [my define get static_pkg]
    set initfunc [my define get initfunc]
    if {$initfunc ne {}} {
      set pkg_name [my define get pkg_name]
      if {$pkg_name ne {}} {
        dict set result $pkg_name initfunc $initfunc
        set version [my define get version]
        if {$version eq {}} {
          my unpack
          set info [my read_configuration]
          set version [dict get $info version]
          set pl {}
          if {[dict exists $info patch_level]} {
            set pl [dict get $info patch_level]
            append version $pl
          }
          my define set version $version
        }
        dict set result $pkg_name version $version
        dict set result $pkg_name autoload [my define get autoload 0]
      }
    }
    foreach item [my link list subordinate] {
      foreach {pkg info} [$item project-static-packages] {
        dict set result $pkg $info
      }
    }
    return $result
  }
  method BuildDir {PWD} {
    set name [my define get name]
    set debug [my define get debug 0]
    if {[my <project> define get LOCAL 0]} {
      return [my define get builddir [file join $PWD local $name]]
    }
    if {$debug} {
      return [my define get builddir [file join $PWD debug $name]]
    } else {
      return [my define get builddir [file join $PWD pkg $name]]
    }
  }
  method compile {} {
    set name [my define get name]
    set PWD $::CWD
    cd $PWD
    my unpack
    set srcdir [file normalize [my SrcDir]]
    set localsrcdir [my MakeDir $srcdir]
    my define set localsrcdir $localsrcdir
    my Collate_Source $PWD
    ###
    # Build a starter VFS for both Tcl and wish
    ###
    set srcdir [my define get srcdir]
    if {[my define get static 1]} {
      puts "BUILDING Static $name $srcdir"
    } else {
      puts "BUILDING Dynamic $name $srcdir"
    }
    my make compile
    cd $PWD
  }
  method Configure {} {
    cd $::CWD
    my unpack
    ::practcl::toolset select [self]
    set srcdir [file normalize [my define get srcdir]]
    set builddir [file normalize [my define get builddir]]
    file mkdir $builddir
    my make autodetect
  }
  method install DEST {
    set PWD [pwd]
    set PREFIX  [my <project> define get prefix]
    ###
    # Handle teapot installs
    ###
    set pkg [my define get pkg_name [my define get name]]
    if {[my <project> define get teapot] ne {}} {
      set TEAPOT [my <project> define get teapot]
      set found 0
      foreach ver [my define get pkg_vers [my define get version]] {
        set teapath [file join $TEAPOT $pkg$ver]
        if {[file exists $teapath]} {
          set dest  [file join $DEST [string trimleft $PREFIX /] lib [file tail $teapath]]
          ::practcl::copyDir $teapath $dest
          return
        }
      }
    }
    my compile
    my make install $DEST
    cd $PWD
  }
}
::clay::define ::practcl::subproject.tea {
  superclass ::practcl::subproject.binary
}
::clay::define ::practcl::subproject.library {
  superclass ::practcl::subproject.binary ::practcl::library
  method install DEST {
    my compile
  }
}
::clay::define ::practcl::subproject.external {
  superclass ::practcl::subproject.binary
  method install DEST {
    my compile
  }
}

###
# END: class subproject binary.tcl
###
###
# START: class subproject core.tcl
###
::clay::define ::practcl::subproject.core {
  superclass ::practcl::subproject.binary
  method env-bootstrap {} {}
  method env-present {} {
    set PREFIX [my <project> define get prefix]
    set name [my define get name]
    set fname [file join $PREFIX lib ${name}Config.sh]
    return [file exists $fname]
  }
  method env-install {} {
    my unpack
    set os [::practcl::local_os]

    set prefix [my <project> define get prefix [file normalize [file join ~ tcl]]]
    lappend options --prefix $prefix --exec-prefix $prefix
    my define set config_opts $options
    puts [list [self] OS [dict get $os TEACUP_OS] options $options]
    my go
    my compile
    my make install {}
  }
  method go {} {
    my define set core_binary 1
    next
  }
  method linktype {} {
    return {subordinate core.library}
  }
}

###
# END: class subproject core.tcl
###
###
# START: class tool.tcl
###
set ::practcl::MAIN ::practcl::LOCAL
set ::auto_index(::practcl::LOCAL) {
  ::practcl::project create ::practcl::LOCAL
  ::practcl::LOCAL define set [::practcl::local_os]
  ::practcl::LOCAL define set LOCAL 1

  # Until something better comes along, use ::practcl::LOCAL
  # as our main project
  # Add tclconfig as a project of record
  ::practcl::LOCAL add_tool tclconfig {
    name tclconfig tag practcl class subproject.source fossil_url http://core.tcl.tk/tclconfig
  }
  # Add tcllib as a project of record
  ::practcl::LOCAL add_tool tcllib {
    tag trunk class sak fossil_url http://core.tcl.tk/tcllib
  }
  ::practcl::LOCAL add_tool kettle {
    tag trunk class sak fossil_url http://fossil.etoyoc.com/fossil/kettle
  }
  ::practcl::LOCAL add_tool tclvfs {
    tag trunk class tea
    fossil_url http://fossil.etoyoc.com/fossil/tclvfs
  }
  ::practcl::LOCAL add_tool critcl {
    tag master class subproject.binary
    git_url http://github.com/andreas-kupries/critcl
    modules lib
  } {
    method env-bootstrap {} {
      package require critcl::app
    }
    method env-install {} {
      my unpack
      set prefix [my <project> define get prefix [file join [file normalize ~] tcl]]
      set srcdir [my define get srcdir]
      ::practcl::dotclexec [file join $srcdir build.tcl] install [file join $prefix lib]
    }
  }
  ::practcl::LOCAL add_tool odie {
    tag trunk class subproject.source
    fossil_url http://fossil.etoyoc.com/fossil/odie
  }
  ::practcl::LOCAL add_tool tcl {
    tag release class subproject.core
    fossil_url http://core.tcl.tk/tcl
  }
  ::practcl::LOCAL add_tool tk {
    tag release class subproject.core
    fossil_url http://core.tcl.tk/tcl
  }
  ::practcl::LOCAL add_tool sqlite {
    tag practcl
    class subproject.tea
    pkg_name sqlite3
    fossil_url http://fossil.etoyoc.com/fossil/sqlite
  }
}

###
# END: class tool.tcl
###

namespace eval ::practcl {
  namespace export *
}

Added src/class/actor.tcl.



































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
###
# Provide basic interactions
###
::clay::define ::gilgamesh::core/actor {
  clay set english pronoun person

  Option divinity {class mixin base ::gilgamesh::divinity}
  Option form     {class mixin base ::gilgamesh::form}
  Option gender   {class mixin base ::gilgamesh::gender}
  Option vocation {class mixin base ::gilgamesh::vocation}

  Ensemble is::actor {} {
    return 1
  }

  ###
  # This ensemble exercises an actor's abilities
  # On success this command returns either a zero or positive
  # On failure this command returns -1
  # A postive number awards the actor experience points
  #
  # For now assume that absent any training or special rule
  # an ability check will
  # always fail
  ###
  Ensemble ability::default args {
    return -1
  }

  ###
  # Traveling coroutine
  ###
  method TravelCoro {destination} {
    try {
      #puts [list [info coroutine] START $destination]
      set route {}
      set travel_coro [my state get travel_coro]
      if {[dict size $travel_coro]} {
        if {[dict exists $travel_coro destination] && $destination eq [dict get $travel_coro destination]} {
          #puts [list [info coroutine] RESUME $destination]
          dict for {f v} $travel_coro {
            set $f $v
          }
        } else {
          ###
          # Warp to the end of the last route
          ###
          if {[dict exists $travel_coro uuidp]} {
            #puts [list [info coroutine] WARP [dict get $travel_coro uuidp]]
            my state location [dict get $travel_coro uuidp]
          }
        }
      }
      if {[llength $route]==0} {
        if {$destination eq {} || $destination eq [my state location]} {
          return {arrived 1 time 0}
        }
        set locobj [my location object]
        if {[catch {$locobj route find [my state location] $destination} route errdat]} {
          puts [dict getnull $errdat -errorinfo]
          return [list arrived 1 time 0 error $route]
        }
        #puts [list [info coroutine] ROUTE $route]

        # Can travel for 12 hours per day
        set travel_days [expr {12.0/24.0}]
        set total_time 0
        set total_distance 0
        set step_time 0
        set time_elapsed 0
        set waypoint_traveled {}
        lappend waypoint_traveled [my state location]
      }
      ###
      # There Ain't Such Thing As a Free Link every travel task is at least 10 minutes
      # of clock time
      ###
      set tastaffl [expr {10.0/(24*60)}]
      set restore 0
      set mode {}
      foreach waypoint $route {
        set uuidp [lindex $waypoint 0]
        if {$uuidp in $waypoint_traveled} {
          #puts [list [info coroutine] SKIP $uuidp]
          set restore 1
          continue
        }
        #puts [list [info coroutine] WAYPOINT $waypoint]
        set dat   [lindex $waypoint 1]
        set waypoint_time 0
        set waypoint_distance 0
        set step_time     [dict get $dat time]
        if { $step_time<$tastaffl } {
          set step_time $tastaffl
        }
        if {$restore} {
          dict for {f v} $travel_coro {
            set $f $v
          }
        }
        unset -nocomplain travel_coro

        set step_distance [dict get $dat distance]
        while {$waypoint_time < $step_time} {
          #puts [list [info coroutine] STEP WT: $waypoint_time ST: $step_time TD: $travel_days]

          if {$step_time < ($waypoint_time + $travel_days)} {
            ###
            # If we can get there in less than the time alotted
            # just magically get there
            ###
            lappend waypoint_traveled $uuidp
            my state set location $uuidp
            set total_distance  [expr {$total_distance + ($step_distance - $waypoint_distance)}]
            set total_time      [expr {$total_time + ($step_time - $waypoint_time)}]
            set travel_days     [expr {$travel_days - ($step_time - $waypoint_time)}]
            my time_elapsed add [expr {($step_time - $waypoint_time)+$time_elapsed}]
            break
          }
          set time_elapsed  $travel_days
          set waypoint_time [expr {$waypoint_time + $travel_days}]
          set waypoint_distance [expr {($step_time - $waypoint_time)/$step_time * $step_distance}]

          my state set location f16f7e06-d454-41e2-bebe-e64b397be1d4
          set location          [my location current]
          foreach var [info locals] {
            dict set info $var [set $var]
          }
          my state set travel_coro $info
          set command [yield [list arrived 0 time $time_elapsed]]
          set time_elapsed 0
          switch [lindex $command 0] {
            abort {
              my state set location $uuidp
              dict set reply time [expr {$step_time - $waypoint_time}]
              dict set reply location $uuidp
              dict set reply arrived 1
              return $reply
            }
            advance {
              set travel_days [string toupper [lindex $command 1]]
              if {![string is double $travel_days]} {
                set travel_days 1.0
              }
            }
            default {
              set travel_days 1.0
            }
          }
        }
      }
    } on error {err errdat} {
      puts $err
      puts [list [info coroutine] ERROR [dict getnull $errdat -errorinfo]]
    }
    my state set travel_coro {}
    my state set location $destination
    if {![info exists time_elapsed]} {
      set time_elapsed 0
    }
    return [list arrived 1 time $time_elapsed]
  }

  Ensemble travel::_preamble {} {
    set coroname ::CORO::[my uuid]#travel
    #puts [list [self] travel $method $args]
  }

  Ensemble travel::destination {} {
    if {[info commands $coroname] ne {}} {
      return [$coroname destination]
    }
    return {}
  }


  Ensemble travel::goto dest {
    set locuuid [my find_object $dest [my state location]]
    if {$locuuid eq [my state location]} {
      my state set destination {}
      return {arrived 1 time 0}
    }
    my state set destination $locuuid
    my travel advance 0.1
  }

  Ensemble travel::advance {{days 0.1}} {
    if {$days eq {}} {
      # If blank given, travel till dusk
      set days DUSK
    }
    if {[info commands $coroname] eq {}} {
      coroutine $coroname {*}[namespace code [list my TravelCoro [my state get destination]]]
    }
    if {[info commands $coroname] eq {}} {
      return [list arrived 1 time 0]
    }
    return [$coroname [list advance $days]]
  }

  Ensemble travel::stop {} {
    if {[info commands $coroname] ne {}} {
      $coroname abort
    }
    my state set destination {}
  }


}

Added src/class/avatar.tcl.



























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
::clay::define ::gilgamesh::core/avatar {
  superclass ::gilgamesh::core/actor

  variable time_elapsed 0

  Ensemble time_elapsed::_preamble {} {
    my variable time_elapsed
  }
  Ensemble time_elapsed::reset {} {
    set time_elapsed 0
  }
  Ensemble time_elapsed::add time {
    set time_elapsed [expr {$time_elapsed + $time}]
  }
  Ensemble time_elapsed::value {} {
    return $time_elapsed
  }

  method INTERACT {objuuid command} {
    my <stage> interact [my uuid] $objuuid player [list command $command]
  }

  method find_object {rawstring {location {}}} {
    set string {}
    foreach word [string toupper $rawstring] {
      if {$word in {IN AT THE}} continue
      lappend string $word
    }
    ###
    # Locate an object from a description
    ###
    # If it's a UUID we just take it on faith
    ###
    if {[lindex $string 0] eq "SELF"} {
      return [my uuid]
    }
    if {[lindex $string 0] eq "HERE"} {
      set location [my <db> onecolumn {select location from object where uuid=:myuuid}]
      return $location
    }
    if {[my <db> exists {select uuid from object where upper(uuid)=upper(:string)}]} {
      return [string tolower $string]
    }
    set pat [string toupper "%$string%"]
    foreach place $location {
      ###
      # Name search
      ###
      set matches [my <db> eval {select uuid from object where location=:place and upper(name)=upper(:string)}]
      if {[llength $matches]==1} {
        return [lindex $matches 0]
      }
      set matches [my <db> eval {select uuid from object where location=:place and upper(name) like :pat}]
      if {[llength $matches]==1} {
        return [lindex $matches 0]
      }
      ###
      # Soundex Name search
      ###
      set matches [my <db> eval {select uuid from object where location=:place and soundex(name)=soundex(:string)}]
      if {[llength $matches]==1} {
        return [lindex $matches 0]
      }

      ###
      # Do an exact tag match
      ###
      foreach item $string {
        my <db> eval {select distinct uuid from object where location=:place and objectid in (select objectid from object_info where upper(value)=upper(:string))} {
          lappend matchtag($uuid) $item
        }
      }
      foreach item $string {
        my <db> eval {select distinct uuid from object where location=:place and objectid in (select objectid from object_tags where upper(tag)=upper(:string))} {
          lappend matchtag($uuid) $item
        }
      }
      set best {}
      set score 0
      set matchcount 0
      foreach {uuid terms} [array get matchtag] {
        if {[llength $terms]==$score} {
          incr matchcount
        } elseif {[llength $terms]>$score} {
          set best $uuid
          set score [llength $terms]
          set matchcount 1
        }
      }
      if {$matchcount==1} {
        return $best
      }
      array unset matchtag *
      ###
      # Do a soundex match
      ###
      foreach item $string {
        my <db> eval {select distinct uuid from object where location=:place and objectid in (select objectid from object_info where soundex(value)=soundex(:string))} {
          lappend matchtag($uuid) $item
        }
      }
      foreach item $string {
        my <db> eval {select distinct uuid from object where location=:place and objectid in (select objectid from object_tags where stem=soundex(:string))} {
          lappend matchtag($uuid) $item
        }
      }
      set best {}
      set score 0
      set matchcount 0
      foreach {uuid terms} [array get matchtag] {
        if {[llength $terms]==$score} {
          incr matchcount
        } elseif {[llength $terms]>$score} {
          set best $uuid
          set score [llength $terms]
          set matchcount 1
        }
      }
      if {$matchcount==1} {
        return $best
      }
    }
    ###
    # Name search, any location
    ###
    set matches [my <db> eval {select uuid from object where upper(name)=upper(:string)}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    set matches [my <db> eval {select uuid from object where upper(name) like :pat}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    ###
    # Soundex Name search, any location
    ###
    set matches [my <db> eval {select uuid from object where soundex(name)=soundex(:string)}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    set location [my <db> onecolumn {select location from object where uuid=:location}]


    ###
    # Name search, any location
    ###
    set matches [my <db> eval {select uuid from object where upper(name)=upper(:string) and core='location'}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    set matches [my <db> eval {select uuid from object where upper(name) like :pat and core='location'}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    ###
    # Soundex Name search, any location
    ###
    set matches [my <db> eval {select uuid from object where soundex(name)=soundex(:string) and core='location'}]
    if {[llength $matches]==1} {
      return [lindex $matches 0]
    }
    set location [my <db> onecolumn {select location from object where uuid=:location}]
    return {}
    ###
    # Tag search, same location
    ###
    #set matches {}
    #set matches [my <db> eval {select uuid from object where location=:location and objectid in (select objectid from object_tags where stem() soundex(value)=soundex(:string))}]
    #if {[llength $matches]==1} {
    #  return [my <stage> object wake [lindex $matches 0]]
    #}
  }

  if {![string match *zipfs* $::GAME(MODULES)]} {
  PLAYER_COMMAND RELOAD {
    exec [info nameofexecutable] [file join $::GAME(MODULES) clay-stage build build.tcl]
    exec [info nameofexecutable] [file join $::GAME(MODULES) pheme build build.tcl]
    source [file join $::GAME(MODULES) clay clay.tcl]
    source [file join $::GAME(MODULES) clay-stage clay-stage.tcl]
    source [file join $::GAME(MODULES) pheme pheme.tcl]
    source [file join $::GAME(MODULES) porter porter.tcl]
    source [file join $::GAME(MODULES) randomword randomword.tcl]
    source [file join $::GAME(DIR) lang en_us.tcl]
    source [file join $::GAME(DIR) class index.tcl]
  }
  }

  PLAYER_COMMAND DESTINATION {

  }


  PLAYER_COMMAND LIST {
    set type [::stem::stem [lindex $string 1]]
    set result {}
    switch $type {
      CITI -
      CITY {
        my <db> eval {select objectid from object_info where field='has_city' and value=1} {
          set uuid    [my <stage> object uuid $objectid]
          set name    [my <stage> object name $objectid]
          lappend result $name $uuid
        }
      }
    }
    set content {}
    foreach {name uuid} [lsort -stride 2 -dictionary $result] {
      append content " <a href=/info/$uuid>$name</a> "
    }
    dict set reply content $content
  }

  PLAYER_COMMAND SOURCE {
    source [lindex $string 1]
  }

  PLAYER_COMMAND SLEEP {
    set now [my <stage> time current]
    my time_elapsed add [expr {[::stage::dawn $now]-$now}]
    putb output "You sleep until dawn."
    dict set reply code ok
    dict set reply content $output
    return $reply
  }


  PLAYER_COMMAND ROUTE {
    set A [my state location]
    set bstring [lrange $string 1 end]
    set B [my find_object $bstring $A]
    if {$B eq {}} {
      set B [my <db> onecolumn {select uuid from object where core='location' and name like :bstring}]
    }
    if {$B eq {}} {
      dict set reply content "Cannot find location $bstring"
      dict set reply code err
      return $reply
    }
    set locobj [my location object]
    set route [$locobj route find $A $B]
    set total_time 0
    set total_distance 0
    set output {<table><tr><TH>NAME</TH><TH>TIME</TH><TH>DISTANCE</TH></TR>}
    foreach point $route {
      set time 0
      set distance 0
      set uuidp [lindex $point 0]
      set dat [lindex $point 1]
      dict with dat {}
      set gobj [my <stage> object wake $uuidp]
      putb output "<tr><td><a href=/info/$uuidp>[$gobj location name]</a></td><td>$time</td><td>$distance</td></tr>"
      set total_time [expr {$total_time+$time}]
      set total_distance [expr {$total_distance+$distance}]
    }
    putb output "</table>"
    putb output "<p>Total Travel Time: $total_time days"
    putb output "<p>Total Travel Distance: $total_distance km<br>"

    dict set reply code ok
    dict set reply content $output
    return $reply
  }

  PLAYER_COMMAND {MENU INTERACT} {
    set idx 1
    if {[string toupper [lindex $string $idx]] in {AT}} {
      incr idx
    }
    set objuuid {}
    if {[llength $string]==1 } {
      set objuuid [my state location]
    } else {
      set objuuid [my find_object [lrange $string $idx end] [my state location]]
      if {$objuuid eq {}} {
        dict set reply code err
        dict set reply content "(look) I could not find a [lrange $string $idx end]"
        return $reply
      }
    }
    return [my INTERACT $objuuid MENU]
  }

  method Html_Edit {field value} {
    if {$field in {core uuid location owner}} {
      return $value
    }
    if {$field in {created mtime}} {
      if {$value ne {}} {
        return [clock format $value]
      }
      return {}
    }
    if {[my clay get option $field class] eq "mixin"} {
      putb content "<select name=\"$field\">"
      putb content "<option value=\"$value\" selected>$value</option>"
      set base [my clay get option $field base]
      if {$base ne {}} {
        foreach class [lsort -dictionary [info commands $base/*]] {
          set val [lindex [split $class /] end]
          if {$val eq $value} continue
          putb content "<option value=\"$val\">$val</option>"
        }
      }
      putb content "</select>"
      return $content
    }
    switch [my clay get option $field type] {
      "textarea" {
        set row "<textarea name=\"$field\""
        foreach attrib {rows cols placeholder wrap} {
          if {![my clay exists option $field $attrib]} continue
          append row " $attrib=\"[my clay get option $field $attrib]\""
        }
        append row ">$value</textarea>"
        return $row
      }
      "select" {
        putb content "<select name=\"$field\">"
        set opts {}
        putb content "<option value=\"$value\" selected>$value</option>"
        set optlist [my clay get option $field options]
        foreach val $optlist {
          if {$vale eq $value} continue
          putb content "<option value=\"$val\">$val</option>"
        }
        putb content "</select>"
        return $content
      }
    }
    return "<input name=\"$field\" value=\"$value\">"
  }

  PLAYER_COMMAND EDIT {
    set done 0
    if {[dict getnull $msginfo msginfo action] eq "CANCEL"} {
      set reply [my INTERACT [my uuid] LOOK]
      return
    }
    foreach {f v} [dict getnull $msginfo msginfo] {
      if {$f in {command object action}} continue
      my state set $f $v
    }
    set data [my state get]
    putb content {<FORM action/><input type=submit name="action" VALUE="CANCEL"><input type=hidden name=command value="LOOK SELF"></FORM>}
    putb content {<FORM action=/ method=post><input type=hidden name=command value="EDIT">}
    putb content "<TABLE>"
    putb content "<tr><td colspan=2><input type=submit name=\"action\" VALUE=\"SAVE\"></td></tr>"
    set optinfo [my clay get option]
    foreach {f v} $data {
      putb content "<tr><td>$f</td><td>"
      putb content [my Html_Edit $f $v]
      putb content "</td></tr>"
    }
    putb content "<tr><td colspan=2><input type=submit name=\"action\" VALUE=\"SAVE\"></td></tr>"
    putb content "</FORM>"
    set reply [my INTERACT [my uuid] LOOK]
    dict set reply form $content
  }

  PLAYER_COMMAND TRAVEL {
    set idx 1
    if {[string toupper [lindex $string 1]] in {TO TILL}} {
      incr idx
    }
    set keyword [string toupper [lindex $string $idx]]
    if {[string is double -strict $keyword] || $keyword in {WAYPOINT END DUSK DAY {}}} {
      my travel advance $keyword
      return [my INTERACT [my location room] LOOK]
    }
    set info [my travel goto [lrange $string 2 end]]
    return [my INTERACT [my location room] LOOK]
  }

  PLAYER_COMMAND {GOTO GO} {
    set info [my travel goto [lrange $string 1 end]]
    return [my INTERACT [my location room] LOOK]
  }
  ###
  # Infocom standard commands
  ###
  PLAYER_COMMAND INVENTORY {
    putb buffer "You are carrying:<p><ul>"
    putb buffer [my Contents_Html [list msg_from [my uuid]]]
    dict set reply code ok
    dict set reply content $buffer
    return $reply
  }

  PLAYER_COMMAND LOCATION {
    set myuuid [my uuid]
    set location [my <db> onecolumn {select location from object where uuid=:myuuid}]
    return [my INTERACT $location LOOK]
  }

  PLAYER_COMMAND LOOK {
    set idx 1
    if {[string toupper [lindex $string $idx]] in {AT}} {
      incr idx
    }
    set objuuid {}
    if {[llength $string]==1 } {
      set objuuid [my state location]
    } else {
      set objuuid [my find_object [lrange $string $idx end] [my state location]]
      if {$objuuid eq {}} {
        dict set reply code err
        dict set reply content "(look) I could not find a [lrange $string $idx end]"
        return $reply
      }
    }
    return [my INTERACT $objuuid LOOK]
  }

  method command reqdata {
    if {[dict exist $reqdata command]} {
      set string [dict getnull $reqdata command]
    } else {
      set string [dict getnull $reqdata string]
    }
    puts [list COMMAND $string]
    set body [my Implementation command $string]
    if {[string length $body]} {
      puts [list AVATAR IMPLEMENTATION $string]
      dict set reply code ok
      dict set reply content {TBA}
      try $body on error {err errdat} {
        set reply [dict create code err content $err error [dict getnull $errdat -errorinfo]]
      }
      return $reply
    }
    set myuuid [my uuid]
    set location [my <db> onecolumn {select location from object where uuid=:myuuid}]
    foreach objuuid [my <db> eval {select uuid from object where location=:location}] {
      set obj [my <stage> object wake $objuuid]
      if {![$obj interact_find $string]} continue
      return [my INTERACT $objuuid $string]
    }
    if {[string length $body]==0} {
      ###
      # Find an object and see if it has any specific commands
      ###
      if {[string length $string]==0} {
        set reply [dict create code noop]
      } else {
        set reply [dict create code err content "(avatar) I don't understand $string"]
      }
      return $reply
    }

    return $reply
  }

  method html_command {reqdata} {
    my variable history buffer
    set buffer {}
    if {![info exists history]} {
      set history {}
    }
    foreach {command reply} $history {
      append buffer \n "<p class=\"command\">$command</p><div class=\"reply\">$reply</div>"
    }
    my time_elapsed reset
    ###
    # Use a generic command
    ###
    if {[dict exists $reqdata string]} {
      set string [dict getnull $reqdata string]
    } else {
      set string [dict getnull $reqdata command]
    }
    try {
      if {[dict exists $reqdata object]} {
        # Form passed us an interaction with a specific object
        set reply [my <stage> interact [my uuid] [dict get $reqdata object] player $reqdata]
      } else {
        set reply [my command $reqdata]
      }
      set time [my time_elapsed value]
      if {$time > 0} {
        my <stage> time advance $time
      }
    } on error {err errdat} {
      dict set reply code err
      dict set reply content $err
      dict set reply error [dict getnull $errdat -errorinfo]
    }
    set output {}
    ###
    # Format our HTML request as a standard STAGE RPC message
    ###
    if {[dict get $reply code] eq "err"} {
      append buffer \n "<p class=\"command\">$string</p><div class=\"error\">[dict get $reply content]<p><pre>[::html::html_entities [dict getnull $reply error]]</pre></div>"
    } elseif {[dict get $reply code] eq "noop"} {
    } else {
      lappend history $string [dict get $reply content]
      set history [lrange $history end-50 end]
      append buffer \n "<p class=\"command\">$string</p><div class=\"reply\">[dict get $reply content]</div>"
      if {[dict exists $reply form]} {
        dict set output form [dict get $reply form]
      }
    }
    set infoblock {}
    append infoblock "Location: [my <stage> object name [my state location]] Time: [my <stage> time display] Level: [my state get level] XP: [my state get xp]"
    dict set output infoblock $infoblock
    dict set output content $buffer
    return $output
  }

}

Added src/class/divinity.tcl.















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
clay::define ::gilgamesh::divinity {

}

clay::define ::gilgamesh::divinity/beast {

}

clay::define ::gilgamesh::divinity/mortal {

}

clay::define ::gilgamesh::divinity/demigod {

}

clay::define ::gilgamesh::divinity/demon {

}

clay::define ::gilgamesh::divinity/diety {

}

Added src/class/form.tcl.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
clay::define ::gilgamesh::form {
}

###
# Bipedal form
###
clay::define ::gilgamesh::form/humanoid {
  superclass ::gilgamesh::form
}

###
# Many legs, and either claws on the first pair(s)
# or opposable jaws
# Possible weapon on tail
###
clay::define ::gilgamesh::form/arthropod {
  superclass ::gilgamesh::form
}

###
# Form of a beast on all fours
# Tail optional
###
clay::define ::gilgamesh::form/animal {
  superclass ::gilgamesh::form
}

###
# It's... complicated
###
clay::define ::gilgamesh::form/mythical {
  superclass ::gilgamesh::form
}

Added src/class/gender.tcl.























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
###
# Gender specific behaviors
###

clay::define ::gilgamesh::gender {
  Ensemble is::male {} {
    return 0
  }
  Ensemble is::female {} {
    return 0
  }
}

clay::define ::gilgamesh::gender/male {
  superclass ::gilgamesh::gender
  Ensemble is::male {} {
    return 1
  }

  Ensemble agent::mating {object dictargs} {
    if {![$object is female]} {
      return [list code fail content "Wrong gender"]
    }
    if {$attraction>0.5} {
      return [list code ok]
    }
    return [list code fail content "Not interested"]
  }
}

clay::define ::gilgamesh::gender/female {
  superclass ::gilgamesh::gender
  Ensemble is::female {} {
    return 1
  }


  Ensemble agent::mating {object dictargs} {
    if {![$object is male]} {
      return [list code fail content "Wrong gender"]
    }
    set attraction [expr {rand()}]
    if {$attraction>0.5} {
      return [list code ok]
    }
    return [list code fail content "Not interested"]
  }

}

clay::define ::gilgamesh::gender/q {
  superclass ::gilgamesh::gender
  Ensemble is::male {} {
    return 1
  }
  Ensemble is::female {} {
    return 1
  }
}

Added src/class/index.tcl.



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
###
# loader for gilgamesh classes
###
set here [file dirname [info script]]
namespace eval ::CORO {}
set loaded [info script]
foreach file {proc.tcl object.tcl actor.tcl avatar.tcl} {
  set fname [file join $here $file]
  lappend loaded $fname
  source $fname
}
foreach file [lsort -dictionary [glob [file join $here *.tcl]]] {
  if {$file in $loaded} continue
  lappend loaded $file
  source $file
}

Added src/class/item.tcl.





































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clay::define ::gilgamesh::core/item {
  clay set english pronoun item
  Option type {class mixin base ::gilgamesh::item}

  method menu_options actor {
    set invalid MENU
    if {[my state location] eq $actor} {
      lappend invalid TAKE
    } else {
      lappend invalid USE DROP
    }
    set result {}
    foreach {item info} [my clay get interaction player] {
      set canonical [dict get $info canonical]
      if {$canonical in $invalid} continue
      if {$canonical in $result} continue
      lappend result $canonical
    }
    return $result
  }

  PLAYER_INTERACTION DROP {
    set description [my state get description]
    dict set reply code ok
    dict set reply object [my uuid]
    set actor [dict get $msginfo msg_from]
    my state set location [my <stage> object location $actor]
    dict set reply content "Dropped"
    return $reply
  }

  PLAYER_INTERACTION TAKE {
    set description [my state get description]
    dict set reply code ok
    dict set reply object [my uuid]
    set actor [dict get $msginfo msg_from]
    my state set location $actor
    dict set reply content "Taken"
    return $reply
  }

}

clay::define ::gilgamesh::item/food {

  Dict state {
    count 1
  }

  PLAYER_INTERACTION {EAT USE} {
    set actor [dict get $msginfo msg_from]
    set count [my state get count]
    incr count -1
    my state set count $count
    if {$count <= 0} {
      my <stage> object destroy [my uuid]
    }
  }
}

clay::define ::gilgamesh::item/junk {
}

clay::define ::gilgamesh::item/treasure {
}

Added src/class/location.tcl.











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
package require router

clay::define ::gilgamesh::core/location {

  Option environment {class mixin base ::gilgamesh::environment}

  clay set english pronoun location

  clay set is location  1
  clay set is plane     0
  clay set is region    0
  clay set is structure 0
  clay set is room      0

  Ensemble location::name {} {
    return [my state get name]
  }

  Ensemble location::plane {} {
    return [my uuid]
  }

  Ensemble location::room {} {
    return [my uuid]
  }

  Ensemble location::region {} {
    if {[my is region]} {
      return [my uuid]
    }
    if {[my state get location] eq {}} {
      my clay set is region 1
      return [my uuid]
    }
    return [[my <stage> object wake [my state get location]] location region]
  }

  Ensemble location::structure {} {
    return [my uuid]
  }

  method route_local_links {} {
    set myuuid [my uuid]
    set result {}
    ###
    # Add a connection to everything that has this uuid as a location
    ###
    my <db> eval {select uuid,name from stage.object where core='location' and location=:myuuid} {
      set obj [my <stage> object wake $uuid]
      lappend result {*}[$obj route_local_links]
    }
    my <db> eval {select * from link where type='transport' and object_a=:myuuid} {
      set info [my <db> eval {select field,value from link_info where linkid=:linkid}]
      lappend result $myuuid $object_b [dict get $info time] $info
    }
    return $result
  }


  method route_matrix {} {
    set myuuid [my uuid]
    my variable RouteLocal
    if {![info exists RouteLocal]} {
      set RouteLocal [my route_local_links]
    }
    return $RouteLocal
  }

  Ensemble route::exits {uuid} {
    set result {}
    foreach {start end cost info} [my route_matrix] {
      if {$start eq $uuid && $end ni $result} {
        lappend result $end $info
      }
    }
    return $result
  }

  Ensemble route::find {startuuid enduuid} {
    ###
    # Short cuts
    ###
    if {$startuuid eq $enduuid} {
      return {}
    }
    set startobj  [my <stage> object wake $startuuid]
    set endobj    [my <stage> object wake $enduuid]
    set room_a    [$startobj location room]
    set room_b    [$endobj   location room]
    if {$room_a eq $room_b} {
      return {}
    }
    set route_matrix {}
    set roomobja  [my <stage> object wake $room_a]
    set roomobjb  [my <stage> object wake $room_b]
    set region_a  [$roomobja location region]
    set region_b  [$roomobjb location region]
    set regenobja [my <stage> object wake $region_a]

    foreach {loca locb cost info} [$regenobja route_matrix] {
      ::router::add_connection route_matrix $loca $locb $cost $info
    }
    if {$region_a ne $region_b} {
      foreach {loca locb cost info} [my <stage> route_matrix] {
        ::router::add_connection route_matrix $loca $locb $cost $info
      }
      set regenobjb [my <stage> object wake $region_b]
      foreach {loca locb cost info} [$regenobjb route_matrix] {
        ::router::add_connection route_matrix $loca $locb $cost $info
      }
    }
    set route [::router::find_route $route_matrix $room_a $room_b]
    if {[llength $route]==0} {
      error "Route not found"
    }
    return $route
  }
  ###
  # Sean's traveling constants
  #
  # Travelling by foot:
  # Source material, Army Field Manual 21-18
  # https://armypubs.army.mil/epubs/DR_pubs/DR_a/pdf/web/ARN3051_ATP%203-21x18%20FINAL%20WEB.pdf
  # Figure 1-2, Page 1-18:
  #
  # Daily Rate:   20-32 km/day
  # On Roads:
  #   Daytime:    4km/hr
  #   Night:      3.2km/hr
  # Cross Country:
  #   Daytime:    2.4km/hr
  #   Night:      1.6km/hr
  ###
  method Transit_Links msginfo {
    putb content "<p>From here you may access:"
    set elist {}
    foreach {end info} [my route exits [my uuid]] {
      set endobj [my <stage> object wake $end]
      set distance [dict get $info distance]
      set time     [dict get $info time]
      ###
      # Assume that hiking takes
      ###
      if {$distance > 20} {
        lappend elist "<a href=/travel/${end}>[$endobj location name]</a> ([expr {int(round($distance))}] km / [expr {int(ceil($distance/20.0))}] days)"
      } elseif {$distance > 10} {
        lappend elist "<a href=/travel/${end}>[$endobj location name]</a> ([format "%.1f" $distance] km / [format "%.1f" [expr {$distance/4.0}] hours)"
      } elseif {$distance > 0.1} {
        lappend elist "<a href=/travel/${end}>[$endobj location name]</a> ([expr {int(ceil($distance*1000))}] m)"
      } else {
        lappend elist "<a href=/travel/${end}>[$endobj location name]</a>"
      }
    }
    return "$content [join $elist " | "]"
  }

  method Contents_Html msginfo {
    set myuuid [my uuid]
    set result $myuuid
    set actor [dict get $msginfo msg_from]
    lappend result $actor
    putb content "<table>"
    my <db> eval {select uuid,name,core from stage.object where core not in ('location','actor','avatar') and location=:myuuid} {
      if {$uuid in $result} continue
      set obj [my <stage> object wake $uuid]
      lappend result $uuid
      putb content "<tr><td>$core</td><td><a href=/interact/$uuid>$name</a></td>"
      putb content "<form action=/ method=post><input type=hidden name=object value=\"$uuid\"><TD>"
      foreach item [$obj menu_options $actor] {
        putb content "<input type=submit name=command value=$item>"
      }
      putb content "</TD></form></TR>"
    }
    putb content </table>
  }

  method Contents_People msginfo {
    set myuuid [my uuid]
    set result $myuuid
    set actor [dict get $msginfo msg_from]
    lappend result $actor
    putb content {<span class="lnr lnr-warning"></span>}
    putb content "<div class=\"unicode\">"
    putb content "<table>"
    my <db> eval {select uuid,name,core from stage.object where core in ('actor','avatar') and location=:myuuid} {
      if {$uuid in $result} continue
      set obj [my <stage> object wake $uuid]
      lappend result $uuid
      switch [$obj state get gender] {
        male {
          set gender {<img height=20 width=20 src=/images/male.svg>}
        }
        female {
          set gender {<img height=20 width=20 src=/images/female.svg>}
        }
        default {
          set gender {<img src=/static/images/mercury.svg>}
        }
      }
      switch [$obj state get divinty] {
        diety {
          set divinity {&#x1202D;}
        }
        demigod {
          set divinity {&#x1202E;}
        }
        demon {
          set divinity {&#x1202F;}
        }
        default {
          set divinity &nbsp;
        }
      }
      switch [$obj state get form] {
        humaniod {
          set form {&#1F6B6;}
        }
        arthropod {
          set form {&#1F980;}
        }
        animal {
          set form {&#1F402;}
        }
        mythical {
          set form {&#1F991;}
        }
        humaniod -
        default {
          set form {&nbsp;}
          switch [$obj state get gender] {
            male {
              set gender {<img height=20 width=20 src=/images/man.svg>}
            }
            female {
              set gender {<img height=20 width=20 src=/images/woman.svg>}
            }
            default {
              set gender {<img height=20 width=20 src=/static/images/mercury.svg>}
            }
          }
        }
      }
      putb content "<tr><td>${divinity}</td><td>${gender}</td><td>${form}</td><td>[$obj state get vocation]</td><td><a href=/interact/$uuid>$name</a></td>"
      putb content "<form action=/ method=post><input type=hidden name=object value=\"$uuid\"><TD>"
      foreach item [$obj menu_options $actor] {
        putb content "<input type=submit name=command value=$item>"
      }
      putb content "</TD></form></TR>"
    }
    putb content </table>
    putb content "</div>"
  }

  PLAYER_INTERACTION LOOK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/look/[my uuid]>$name</a> - Location</h3>Uuid: [my uuid]<p>"
    set description [my state get description]
    if {$description ne {}} {
      putb content $description
    }
    putb content [my Transit_Links $msginfo]
    putb content "<p>You See the following here:"
    putb content [my Contents_Html $msginfo]
    putb content "<p>You See the following people here:"
    putb content [my Contents_People $msginfo]
    dict set reply content $content
    #return $reply
  }
}

###
# A plane of existence
###
clay::define ::gilgamesh::environment/plane {
  clay set is plane 1

  Ensemble location::_preamble args {
    set location [my uuid]
    set locobj   [self]
  }
}


###
# A location in a mythological setting
###
clay::define ::gilgamesh::environment/mythical {
  superclass ::gilgamesh::environment/plane
}

###
# A location in a material setting
###
clay::define ::gilgamesh::environment/material {
  superclass ::gilgamesh::environment/plane
}


###
# A region in a plane of existence
###
clay::define ::gilgamesh::environment/region {
  clay set is region 1

  Ensemble location::plane {} {
    return $location
  }
}

clay::define ::gilgamesh::environment/travel {
  superclass ::gilgamesh::environment/plane

  method TravelInfo {msginfo} {
    set actor [dict get $msginfo msg_from]
    set actorobj [my <stage> object wake $actor]
    set travel_coro [$actorobj state get travel_coro]
    set dname [my <stage> object name [dict getnull $travel_coro destination]]
    set wayprev inf
    set waynext inf
    if {[dict exists $travel_coro uuidp]} {
      set uuidp [dict get $travel_coro uuidp]
      putb content "<h3>On the road to <a href=/info/$uuidp>[my <stage> object name $uuidp]</a></h3>"
      if {[dict exists $travel_coro waypoint_time] && [dict exists $travel_coro step_time]} {
        set wayprev [dict get $travel_coro waypoint_time]
        set waynext [expr { [dict get $travel_coro step_time] - [dict get $travel_coro waypoint_time]}]
      }
    } else {
      putb content "<h3>On the Road to Nowhere</h3><p>"
      putb content [my Transit_Links $msginfo]
      set description [my state get description]
      if {$description ne {}} {
        putb content $description
      }
    }
    set hour [expr {1.0/24.0}]
    set now  [my <stage> time current]
    set dawn [::stage::dawn $now]
    set dusk [::stage::dusk $now]
    set eod [expr {[::stage::dusk $now]-$now}]
    if {$waynext < 12} {
      putb content "Waypoint is [expr {$waynext * 24}] hours away."
    } elseif {$waynext < inf} {
      putb content "Waypoint is $waynext days away."
    }
    if {$eod<8} {
      putb content "Dusk is [expr {$eod*24}] hours away."
      putb content "<form action=/ method=post><input type=hidden name=command value=\"TRAVEL $eod\">"
      putb content "<input type=submit name=do value=\"TRAVEL TILL DUSK\">"
      putb content "</form>"
    }
    if {$wayprev < $hour} {
      set backloc [lindex [dict getnull $travel_coro waypoint_traveled] end]
      if {$backloc ne {}} {
        putb content "<form action=/ method=post><input type=hidden name=object value=\"[my uuid]\">"
        putb content "<input type=hidden name=location value=\"$backloc\">"
        putb content "<input type=hidden name=time value=\"$wayprev\">"
        putb content "<input type=hidden name=command value=\"VISIT\">"
        putb content "<input type=submit name=string value=\"VISIT [my <stage> object name $backloc]\">"
        putb content "</form>"
      }
    }
    if {$waynext < $hour || $waynext < $dusk} {
      putb content "<form action=/ method=post><input type=hidden name=object value=\"[my uuid]\">"
      putb content "<input type=hidden name=location value=\"$uuidp\">"
      putb content "<input type=hidden name=time value=\"$waynext\">"
      putb content "<input type=hidden name=command value=\"VISIT\">"
      putb content "<input type=submit name=string value=\"VISIT [my <stage> object name $uuidp]\">"
      putb content "</form>"
    }
    putb content "<form action=/ method=post><input type=hidden name=object value=\"[my uuid]\">"
    putb content "<input type=submit name=command value=\"CAMP\">"
    putb content "</form>"
    return $content
  }

  PLAYER_INTERACTION VISIT {
    puts [list MSGINFO $msginfo]
    set actor [dict get $msginfo msg_from]
    set actorobj [my <stage> object wake $actor]
    set location [dict get $msginfo msg_content location]
    $actorobj time_elapsed add [dict get $msginfo msg_content time]
    $actorobj state set location $location
    set locobj [my <stage> object wake $location]
    return [$locobj player [list msg_from $actor location $location msg_content [list command LOOK]]]
  }

  PLAYER_INTERACTION NOWHERE {
    putb content "You go nowhere, and fast."
    set actor [dict get $msginfo msg_from]
    set actorobj [my <stage> object wake $actor]
    $actorobj state set location cba9f2a2-b06f-49ab-a7cf-c02a734476cd
    dict set reply content $content
  }


  PLAYER_INTERACTION CAMP {
    set actor [dict get $msginfo msg_from]
    set actorobj [my <stage> object wake $actor]
    set now [my <stage> time current]
    $actorobj time_elapsed add [expr {[::stage::dawn $now]-$now}]
    putb content "You make camp for the evening, rest, and awake at dawn the next morning.<P>"
    putb content [my TravelInfo $msginfo]
    dict set reply content $content
  }

  PLAYER_INTERACTION LOOK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content [my TravelInfo $msginfo]
    dict set reply content $content
    #return $reply
  }
}


clay::define ::gilgamesh::environment/structure {
  clay set is structure 1


  method route_local_links {} {
    set myuuid [my uuid]
    set result {}
    if {![my is region] || ![my is plane] || ![my is region]} {
      set location [my state get location]
      if {$location ne $myuuid && $location ne {}} {
        lappend result $myuuid    $location 0 [list time 0 distance 0.010]
        lappend result $location    $myuuid 0 [list time 0 distance 0.010]
      }
    }
    ###
    # Add a connection to everything that has this uuid as a location
    ###
    my <db> eval {select uuid,name from stage.object where core='location' and location=:myuuid} {
      set obj [my <stage> object wake $uuid]
      lappend result {*}[$obj route_local_links]
    }
    my <db> eval {select * from link where type='transport' and object_a=:myuuid} {
      set info [my <db> eval {select field,value from link_info where linkid=:linkid}]
      lappend result $myuuid $object_b [dict get $info time] $info
    }
    return $result
  }

  Ensemble location::plane {} {
    return [[my <stage> object wake [my state get location]] location plane]
  }

  Ensemble location::structure {} {
    set location [my uuid]
  }
  Ensemble location::room {} {
    set location [my uuid]
  }
}


clay::define ::gilgamesh::environment/city {
  superclass ::gilgamesh::environment/structure

  Ensemble location::name {} {
    return "[my state get name]"
  }

  Ensemble location::structure {} {
    set location [my uuid]
  }
  Ensemble location::room {} {
    set location [my uuid]
  }
}



###
# Nebulous area that defines where people sleep
###
clay::define ::gilgamesh::environment/residential {
  superclass ::gilgamesh::environment/structure
  clay set description {The residential district of the city.
The area is dotted with huts and the various trappings of urban life.}
}

clay::define ::gilgamesh::environment/marketplace {
  superclass ::gilgamesh::environment/structure
  clay set description {The market district of the city.
The area is dotted with shops and the various trappings of urban life.}
}

clay::define ::gilgamesh::environment/temple {
  superclass ::gilgamesh::environment/structure
  clay set description {The temple district of the city.
The area is dotted with places to worship.}
}

clay::define ::gilgamesh::environment/palace {
  superclass ::gilgamesh::environment/structure

  clay set description {The temple district of the city.
The area is dotted with places to worship.}
}


clay::define ::gilgamesh::environment/tavern {
  superclass ::gilgamesh::environment/structure
}

clay::define ::gilgamesh::environment/surrounds {
  superclass ::gilgamesh::environment/structure
}

clay::define ::gilgamesh::environment/room {
  clay set is room      1

  method is::room {} {
    return 1
  }
  Ensemble location::room {} {
    set location [my uuid]
  }

}

Added src/class/object.tcl.

































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
proc ::clay::define::PLAYER_COMMAND {names body} {
  set class [current_class]
  set canonical [string toupper [lindex $names 0]]
  foreach name $names {
    set name [string toupper $name]
    $class clay set interaction command ${name} class    $class
    $class clay set interaction command ${name} body    $body
    $class clay set interaction command ${name} canonical $canonical
  }
}

proc ::clay::define::PLAYER_INTERACTION {names body} {
  set class [current_class]
  set canonical [string toupper [lindex $names 0]]
  foreach name $names {
    set name [string toupper $name]
    $class clay set interaction player ${name} class    $class
    $class clay set interaction player ${name} body    $body
    $class clay set interaction player ${name} canonical $canonical
  }
}

proc ::clay::define::Interaction {args} {
  set class [current_class]
  switch [llength $args] {
    2 {
      lassign $args names body
      set type player
    }
    3 {
      lassign $args type names body
    }
    4 {
      lassign $args type names meta body
    }
  }
  set canonical [lindex [string toupper $names] 0]
  if {![dict exists $meta type]} {
    set types player
  } else {
    set types [dict get $meta type]
  }
  dict set meta class $class
  dict set meta body  $body
  dict set meta canonical  $canonical
  foreach {type} $types {
    foreach name $name {
      $class clay set interaction $type ${name} $meta
    }
  }
}

clay::define ::stage::object {

  Option core         {class mixin base ::gilgamesh::core}
  Option behavior     {class mixin}
  Option name         {type string}
  Option description  {type textarea rows 6 cols 60}

  clay set english pronoun object

  Ensemble english::pronoun {} {
    if {[my state get pronoun] ne {}} {
      return [my state get pronoun]
    }
    foreach cmd {
      {my clay get english pronoun}
      {my state get class}
      {[lindex [my tags] 0]}
    } {
      set token [{*}$cmd]
      if {$token ne {}} {
        return $token
      }
    }
  }

  method Contents_Html msginfo {
    set myuuid [my uuid]
    set result $myuuid
    set actor [dict get $msginfo msg_from]
    lappend result $actor
    putb content "<table>"
    my <db> eval {select uuid,name,core from stage.object where core!='location' and location=:myuuid} {
      if {$uuid in $result} continue
      set obj [my <stage> object wake $uuid]
      lappend result $uuid
      putb content "<tr><td>$core</td><td><a href=/interact/$uuid>$name</a></td>"
      putb content "<form action=/ method=post><input type=hidden name=object value=\"$uuid\"><TD>"
      foreach item [$obj menu_options $actor] {
        putb content "<input type=submit name=command value=$item>"
      }
      putb content "</TD></form></TR>"
    }
    putb content </table>
  }

  ###
  # Assume any intraction that is otherwise unknown will fail
  ###
  Ensemble agent::default args {
    return [list code fail content "Unknown interaction $method"]
  }

  Ensemble is::default {} {
    if {[my clay exists is $method]} {
      return [string is true -strict [my clay get is $method]]
    }
    return 0
  }

  method menu_options actor {
    set result MENU
    foreach {item info} [my clay get interaction player] {
      set canonical [dict get $info canonical]
      if {$canonical ni $result} {
        lappend result $canonical
      }
    }
    return [lrange $result 1 end]
  }

  PLAYER_INTERACTION MENU {
    dict set reply code ok
    dict set reply object [my uuid]
    set name [my state get name]
    set actor [dict get $msginfo msg_from]
    putb content "<h3><a href=/interact/[my uuid]>$name</a></h3>"
    putb content "<form action=/ method=post><input type=hidden name=object value=\"[my uuid]\">"
    foreach item [my menu_options $actor] {
      putb content "<input type=submit name=command value=$item>"
    }
    putb content "</form>"
    dict set reply object  [my uuid]
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION INFO {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/interact/[my uuid]>$name</a></h3>"
    putb content <table>
    putb content "<tr><td>Classes</td><td>[my clay ancestors]</td><tr>"
    dict for {f v} [my state get] {
      putb content "<tr><td>$f</td><td>$v</td></tr>"
    }
    putb content "</table>"
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION LOOK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/interact/[my uuid]>$name</a> - OBJECT</h3>"
    set description [my state get description]
    if {$description ne {}} {
      putb content $description
    }
    dict set reply content $content
    return $reply
  }

  method Implementation {type string} {
    set matches {}
    set string [string toupper $string]
    set verb [lindex $string 0]
    foreach aclass [my clay ancestors] {
      if {[$aclass clay exists interaction $type $verb]} {
        return [$aclass clay get interaction $type $verb body]
      }
      dict for {v i} [$aclass clay get interaction $type] {
        if {[string match $v ${verb}*]} {
          return [dict get $i body]
        }
      }
    }
    return {}
  }

  method interact_find string {
    set body [my Implementation player $string]
    if {![string length $body]} {
      return 0
    }
    return 1
  }

  method location {method args} {
    set location [my state location]
    if {$location eq  {}} {
      # The void plane
      set location cba9f2a2-b06f-49ab-a7cf-c02a734476cd
    }
    if {$method eq "current"} {
      return $location
    }
    set locobj [my <stage> object wake $location]
    if {$method eq "object"} {
      return $locobj
    }
    tailcall $locobj location $method {*}$args
  }

  ###
  # Interaction Dispatcher
  ###
  method player msginfo {
    set string [dict getnull $msginfo msg_content command]
    if {$string eq {}} {
      set string [dict getnull $msginfo msg_content string]
    }
    set body [my Implementation player $string]
    if {[string length $body]==0} {
      set reply [dict create code err content "(object) I don't understand $string"]
      return $reply
    }
    dict set reply code ok
    dict set reply content {TBA}

    try $body on error {err errdat} {
      set reply [dict create code err content $err error [dict getnull $errdat -errorinfo]]
    }
    return $reply
  }

  method stage_message msginfo {
    set msguuid [dict getnull $msginfo msg_uuid]
    set subject [dict getnull $msginfo msg_subject]
    switch $subject {
      "actor" {
        set reply [my actor $msginfo]
        my <stage> reply $msguuid $reply
      }
      "player" {
        set reply [my player $msginfo]
        my <stage> reply $msguuid $reply
      }
      default {
        my event $subject $msginfo
      }
    }
  }

}

Added src/class/party.tcl.



















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
###
# Behaviors for groups of people
###
::clay::define ::gilgamesh::core/group {
  clay set english pronoun group

  method members {} {
    set myuuid [my uuid]
    set result {}
    my <db> eval {select * from link where type='group' and object_a=:myuuid} {
      set info [my <db> eval {select field,value from link_info where linkid=:linkid}]
      lappend result $object_b $info
    }
    return $result
  }

  method leader {} {
    set result {}
    set maxrank 0
    my <db> eval {select * from link where type='group' and object_a=:myuuid} {
      set info [my <db> eval {select field,value from link_info where linkid=:linkid}]
      set rank [dict getnull $info rank]
      if {$rank == $maxrank} {
        lappend result $object_b
      } elseif {$rank > $maxrank} {
        set result {}
        lappend result $object_b
        set maxrank $rank
      }
    }
    return $result
  }
}

###
# A party is a small group led by a leader.
# Parties operate in proximity to one another and coordinate on combat and logistics.
###
::clay::define ::gilgamesh::group/party {
  clay set english pronoun party
}

###
# A clan is a group of individuals related by familial ties. Information known within
# the clan tends to be highly personal, and stays within the clan
###
::clay::define ::gilgamesh::group/clan {
  clay set english pronoun clan
}

###
# A cult is a religious group led by a leader. They tend to operate irrespective of
# physical distance, and coordinate on spiritual matters.
###
::clay::define ::gilgamesh::group/cult {
  clay set english pronoun cult
}

###
# A network is a trade group which distributes priviliged information to its members.
###
::clay::define ::gilgamesh::group/network {
  clay set english pronoun network
}

###
# A syndicate is a trade group who seeks to protect the interests of its members
# through intimidation and violence.
###
::clay::define ::gilgamesh::group/syndicate {
  clay set english pronoun syndicate
}

###
# An army is a martial organization that operates under the orders of its
# head of state or patron.
###
::clay::define ::gilgamesh::group/army {
  clay set english pronoun army
}

###
# A state is a governmental body that controls a portion of land and the
# people who live on it. They operate by levying taxes, maintaining infrastructure,
# and defending the area from invasion by raising an army
###
::clay::define ::gilgamesh::group/state {
  clay set english pronoun state
}

Added src/class/proc.tcl.

Added src/class/prop.tcl.

























































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
clay::define ::gilgamesh::core/prop {
  clay set english pronoun object
  Option type {class mixin base ::gilgamesh::prop}
}

clay::define ::gilgamesh::prop/bed {
  clay set english pronoun bed

  PLAYER_INTERACTION SLEEP {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You fall asleep and awake rested in the morning.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::prop/chair {
  clay set english pronoun chair

  PLAYER_INTERACTION SIT {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You sit down.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::prop/throne {
  superclass ::gilgamesh::prop/chair

  clay set english pronoun throne

  PLAYER_INTERACTION SIT {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You sit down.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::prop/container {

  clay set english pronoun container

  Dict state {
    locked 0
  }

  method menu_options actor {
    set result MENU
    if {[my state get locked]==0} {
      lappend result UNLOCK
    } else {
      lappend result LOCK
    }
    foreach {item info} [my clay get interaction player] {
      set canonical [dict get $info canonical]
      if {$canonical ni $result} {
        lappend result $canonical
      }
    }
    return [lrange $result 2 end]
  }

  PLAYER_INTERACTION LOOK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/look/[my uuid]>$name</a> - PROP</h3>"
    set description [my state get description]
    if {$description ne {}} {
      putb content $description
    }
    if {[my state get locked]} {
      putb content "<p>This item appears to be locked"
    }
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION LOCK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/look/[my uuid]>$name</a></h3>"
    if {[my state get locked]} {
      dict set reply code err
      putb content "<p>This item is already locked"
      dict set reply content $content
      return $reply
    }
    my state set locked 1
    putb content "<p>This item is now locked"
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION UNLOCK {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/look/[my uuid]>$name</a></h3>"
    if {[my state get locked]==0} {
      dict set reply code err
      putb content "<p>This item is already unlocked"
      dict set reply content $content
      return $reply
    }
    if {[my state get keycode] ne {}} {
      set keycode [my state get keycode]
      set actor [dict get $msginfo msg_from]
      # Look through the actor's inventory for a device with a matching
      # keycode
      set itemlist [my <stage> object contents $actor]
      foreach {item class name} $itemlist {
        set obj [my <stage> object wake $item]
        if {[$obj state get keycode] eq $keycode} {
          my state set locked 0
          putb content "<p>You use <a href=/look/$item>$name</a> to unlock this [my english pronoun]"
          dict set reply time    10
          dict set reply content $content
          return $reply
        }
      }
    }
    set actor [dict get $msginfo msg_from]
    set actorobj [my <stage> object wake $actor]
    dict set reply time 300
    if {[$actorobj ability lockpick [my state get difficulty]]} {
      my state set locked 0
      putb content "<p>You successfully picked the lock"
      putb content [my Contents_Html $msginfo]
    } else {
      putb content "<p>You fumble a bit with the lock, but are unsuccessful in opening it."
    }
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION SEARCH {
    dict set reply code ok
    dict set reply object [my uuid]
    set content {}
    set name [my state get name]
    if {$name eq {}} {
      set name [my uuid]
    }
    putb content "<h3><a href=/interact/[my uuid]>$name</a></h3>"
    if {[my state get locked]} {
      putb content "<p>This [my english pronoun] appears to be locked"
      dict set reply content [my uuid]
      return $reply
    } else {
      putb content [my Contents_Html $msginfo]
    }
    dict set reply content $content
    return $reply
  }
}


clay::define ::gilgamesh::prop/chest {
  superclass ::gilgamesh::prop/container
  clay set english pronoun chest
}

clay::define ::gilgamesh::prop/corpse {
  superclass ::gilgamesh::prop/container
  clay set english pronoun corpse
  method menu_options actor {
    return SEARCH
  }
}

Added src/class/quest.tcl.





































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
clay::define ::gilgamesh::core/quest {
  superclass ::stage::Coroutine
  clay set english pronoun quest
  Option type {class mixin base ::gilgamesh::quest}

}

###
# Mission that is essentially, go out and fetch something
# and bring it back
###
clay::define :gilgamesh::quest/fetch {

  Dict state {
    stage 0
  }

  method TreasureName {} {
    set name [my state get name]
    set objname "$name - Objective"
    return $objname
  }

  method Main {} {
    ###
    # A quest to send the player to go get something out of the vending machine
    ###
    set name [my state get name]
    if {[my state get treasure] eq {}} {
      set treasureuuid [::stage::uuid]
      set value [my state get treasure_value]
      if {$value eq {}} {
        set value [expr {int(1000*rand())}]
      }
      set objname [my TreasureName]
      my <stage> object create [dict create \
        uuid $treasureuuid \
        name {$objname} \
        mixinmap {behavior ::stage::item.treasure} \
        value $value \
        location $location]
      my state set treasure $treasureuuid
    }
    set giver     [my state get giver]
    set player    [my state get player]
    set chest     [my state get chest]
    set treasure  [my state get treasure]

    if {[my state get stage]<1} {
      my state set completed 0


      set location  [my <db> onecolumn {select location from object where uuid=:chest}]
      set questid [my uuid]
      set gobj [my <stage> object wake $giver]
      set pobj [my <stage> object wake $player]
    }

    yield [info coroutine]
    $pobj script meet $giver
    $gobj script give_quest $player $questid
    $pobj script travel $location
    $pobj script find   $chest
    $pobj script loot   $chest
    $pobj script meet $giver
    $pobj script give_object $giver $treasure
    my state set completed 1
  }
}


###
# Go out and slay a randomly generated monster
###
clay::define :gilgamesh::quest/slay {
}

###
# Race an NPC to a goal
###
clay::define :gilgamesh::quest/race {
}

Added src/class/social.tcl.



>
1

Added src/class/stage.tcl.

















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
clay::define ::stage::router {

}

proc ::stage::dawn {time_current} {
  set day_of_year   [expr {int(ceil(fmod($time_current,360)))}]
  set tod           [expr {floor(fmod($time_current,1)*24)}]
  if {$tod<=0} {
    incr day_of_year
  }
  if {$tod<=18} {
    return [expr {($day_of_year-1)+19.0/24.0}]
  } else {
    return [expr {$day_of_year+19.0/24.0}]
  }
}

proc ::stage::dusk {time_current} {
  set day_of_year   [expr {int(ceil(fmod($time_current,360)))}]
  set tod           [expr {floor(fmod($time_current,1)*24)}]
  if {$tod<=0} {
    incr day_of_year
  }
  if {$tod<=18} {
    return [expr {($day_of_year-1)+7.0/24.0}]
  } else {
    return [expr {$day_of_year+7.0/24.0}]
  }
}

clay::define ::stage::stage {

  method route_matrix {} {
    my variable Router_Matrix
    if {[info exists Router_Matrix]} {
      return $Router_Matrix
    }
    set Router_Matrix {}
    my <db> eval {select * from link where type='transport'} {
      set info [my <db> eval {select field,value from link_info where linkid=:linkid}]
      lappend Router_Matrix $object_a $object_b [dict get $info time] $info
    }
    return $Router_Matrix
  }

  Ensemble time::display {} {
    if {[catch {
    set year          [expr {int(ceil($time_current/360))}]
    set tod           [expr {floor(fmod($time_current,1)*24)}]
    set day_of_year   [expr {int(ceil(fmod($time_current,360)))}]
    if {$tod > 12} {
      # We are before noon on the next day
      incr day_of_year
    }
    set month         [expr {$day_of_year/30}]
    set day_of_month  [expr {$day_of_year-$month*30}]
    set day_of_week   [expr {int(floor(fmod($time_current,7*24)))}]
    set result "[lindex {Sun Mon Tue Wed Thur Fri Sat} ${day_of_week}] ${day_of_month}/"
    append result "[lindex {One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve} $month]/$year"
    if {$tod==12} {
      append result " Noon"
    } elseif {$tod > 12} {
      append result " [expr {$tod-12}] AM"
    } else {
      append result " $tod PM"
    }
    } err errdat]} {
      return [dict get $errdat -errorinfo]
    }
    return $result
  }
}

Added src/class/vocation.tcl.

















































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
###
# Characters are roles that actors take on
###
clay::define ::gilgamesh::vocation {
}

clay::define ::gilgamesh::vocation/lord {
  superclass ::gilgamesh::vocation
  PLAYER_INTERACTION NEWS {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You exchange news.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION JOB {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You request some work from the lord.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::vocation/chancellor {
  superclass ::gilgamesh::vocation
  PLAYER_INTERACTION NEWS {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You exchange news.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION JOB {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You request some work from the lord.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::vocation/warrior {
  superclass ::gilgamesh::vocation

  PLAYER_INTERACTION TRAIN {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You train with the warrior.}
    dict set reply content $content
    return $reply
  }
}

clay::define ::gilgamesh::vocation/shaman {
  superclass ::gilgamesh::vocation

  PLAYER_INTERACTION HEAL {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {After negotiating a price, this person cures your ailments.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION NEWS {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You exchange news.}
    dict set reply content $content
    return $reply
  }
}

###
#
clay::define ::gilgamesh::vocation/harlot {
  superclass ::gilgamesh::vocation

  PLAYER_INTERACTION HEAL {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {After negotiating the apporopriate offering to the temple, this person cures your ailments.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION THERAPY {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {After negotiating the apporopriate offering to the temple, the two of you engage in a therapy session.}
    dict set reply content $content
    return $reply
  }

}

###
# Set up booths to trade goods
###
clay::define ::gilgamesh::vocation/trader {
  superclass ::gilgamesh::vocation

  PLAYER_INTERACTION BARTER {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {Here are today's specials:}
    dict set reply content $content
    return $reply
  }
}

###
# Transport goods between cities
###
clay::define ::gilgamesh::vocation/caravan {
  superclass ::gilgamesh::vocation


}

clay::define ::gilgamesh::vocation/innkeeper {
  superclass ::gilgamesh::vocation

  PLAYER_INTERACTION DRINK {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You order a drink, and down it.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION NEWS {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You exchange news.}
    dict set reply content $content
    return $reply
  }

  PLAYER_INTERACTION RENT {
    dict set reply code ok
    dict set reply object [my uuid]
    putb content {You arrange to rent a room.}
    dict set reply content $content
    return $reply
  }
}


Added src/class/weapon.tcl.



>
1

Added src/lang/en_us.tcl.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
###
# American English language strings
###
namespace eval ::phrase::en-us {}

proc ::phrase::en-us::translate phrase {
  return $phrase
}

Added src/main.tcl.

























































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
package require clay
package require Thread

global GAME
set GAME(DIR)       [file dirname [file normalize [info script]]]
if {$::tcl_platform(platform) eq "windows"} {
  set GAME(SAVE) [file join $::env(APPDATA) clay gilgamesh]
} else {
  set GAME(SAVE) [file normalize [file join ~ .clay gilgamesh]]
}
file mkdir $GAME(SAVE)
if {[lindex $argv 0] ne {}} {
  set GAME(DBFILE) [file normalize [lindex $argv 0]]
  set GAME(SAVE)   [file dirname $GAME(DBFILE)]
} else {
  set GAME(DBFILE) [file join $GAME(SAVE) game.sqlite]
  #set GAME(DBFILE) :memory:
}
if {[file exists [file join $GAME(DIR) modules]]} {
  # Running installed a VFS or installed instance
  set GAME(MODULES)   [file normalize [file join $GAME(DIR) modules]]
  set GAME(TCLLIB)    $GAME(MODULES)
  set GAME(PATH)      [linsert $::auto_path 0 $GAME(MODULES)]
} else {
  # Running a prototype from the source tree
  set GAME(MODULES)   [file normalize [file join $GAME(DIR) .. .. modules]]
  set GAME(TCLLIB)   [file normalize [file join $GAME(DIR) .. .. .. tcllib modules]]
  set GAME(PATH)      [linsert $::auto_path 0 $GAME(MODULES) $GAME(TCLLIB)]
}
set GAME(DBTIMEOUT) 10000

###
# Rebuild key modules
###
foreach module {dicttool clay clay-stage} {
  if {![file exists [file join $GAME(MODULES) $module $module.tcl]]} {
    source [file join $GAME(MODULES) $module build build.tcl]
  }
}
if {![file exists $GAME(TCLLIB)]} {
  exec [info nameofexecutable] [file join $GAME(DIR) .. .. make.tcl] packages
}
set thread_init {}
if {[info exists ::starkit::thread_init]} {
  putb thread_init $::starkit::thread_init
}
putb thread_init [list array set GAME [array get GAME]]
putb thread_init {
set ::auto_path $GAME(PATH)
package require coroutine
package require html

source [file join $GAME(MODULES) clay clay.tcl]
source [file join $GAME(MODULES) clay-stage clay-stage.tcl]
source [file join $GAME(MODULES) pheme pheme.tcl]
source [file join $GAME(MODULES) porter porter.tcl]
source [file join $GAME(MODULES) randomword randomword.tcl]
source [file join $GAME(DIR) lang en_us.tcl]
source [file join $GAME(DIR) class index.tcl]
}
set thread(httpd)  [thread::create]
set thread(objects) [thread::create]

putb thread_init [list array set thread [array get thread]]

thread::send $thread(httpd) $thread_init
thread::send $thread(objects) $thread_init

###
# Object thread initialization
###
thread::send $thread(objects) {

if {![file exists $GAME(DBFILE)]} {
  set create 1
} else {
  set create 0
}
::stage::stage create MAIN $GAME(DBFILE)

if {$create} {
  source [file join $GAME(DIR) object index.tcl]
}
}

###
# Httpd server initialization
###
thread::send $thread(httpd) {
::stage::stage create MAIN $GAME(DBFILE)

source [file join $GAME(MODULES) clay clay.tcl]
source [file join $GAME(MODULES) httpd httpd.tcl]
package require nettool

::httpd::server create HTTPD

set info {}

::clay::define ::httpd::reply {
  method html_header args {
    return {<HTML><HEAD>
<link rel="stylesheet" href="/style.css">
</HEAD><BODY>
<style type="text/css" media="screen"></style>
}
  }
  method html_footer args {
    return "</BODY></HTML>"
  }
}

namespace eval ::gilgamesh {}

clay::define ::gilgamesh::content {
  method content {} {
    set uuid [my clay get uuid]
    set dat  [split [my request get REQUEST_URI] /]
    switch [llength $dat] {
      3 {
        switch [string toupper [lindex $dat 1]] {
          INFO {
            dict set query command  INFO
            dict set query object   [lindex $dat 2]
            set script "\[MAIN object wake avatar\] html_command \{ $query \}"
          }
          LOOK {
            #set command "LOOK $objuuid"
            dict set query command  LOOK
            dict set query object   [lindex $dat 2]
            set script "\[MAIN object wake avatar\] html_command \{ $query \}"
          }
          TRAVEL - GOTO {
            dict set query command  [list TRAVEL TO [lindex $dat 2]]
            set script "\[MAIN object wake avatar\] html_command \{ $query \}"
          }
          INTERACT - MENU {
            dict set query command  MENU
            dict set query object   [lindex $dat 2]
            set script "\[MAIN object wake avatar\] html_command \{ $query \}"
          }
          default {
            set script "\[MAIN object wake avatar\] html_command \{ [my FormData] \}"
          }
        }
      }
      default {
        set script "\[MAIN object wake avatar\] html_command [list [my FormData]]"
      }
    }
    set response [::thread::send $::thread(objects) $script]
    my puts [my html_header {}]
    my puts {<div id="top">}
    my puts [dict getnull $response infoblock]
    my puts {&#x12000;}

    my puts "</div>"
    my puts {<div id="output">}
    if {[dict exists $response form]} {
      my puts [dict getnull $response form]
    } else {
      my puts [dict getnull $response content]
    }
    my puts "</div>"
    my puts {<div id="bottom">}
    my puts {<form action=/ method=post><input size=80 name=command><input type=submit name=do></form></div>}
    my puts {<SCRIPT>var objDiv = document.getElementById("output");
  objDiv.scrollTop = objDiv.scrollHeight;</SCRIPT>}
    my puts [my html_footer {}]
  }
}

HTTPD clay set server doc_root [file join $::GAME(DIR) htdocs]
oo::objdefine HTTPD {

  method debug args {
    puts $args
  }
  method Dispatch_Local {data} {
    ###
    # Fallback to docroot handling
    ###
    set reply $data
    foreach pattern {
      /images*
      /style*
      /favicon.ico
      /doc*
    } {
      if {[string match $pattern [dict get $reply http REQUEST_URI]]} {
        # Serve static content
        dict set reply prefix {}
        dict set reply path [file join $::GAME(DIR) htdocs]
        dict set reply mixin reply ::httpd::content.file
        return $reply
      }
    }
    dict set reply prefix {}
    dict set reply path [file join $::GAME(DIR) htdocs]
    dict set reply mixin reply ::gilgamesh::content
    return $reply
  }
}

set port [HTTPD port_listening]
exec open http://localhost:$port/ &
}

thread::send $thread(objects) {
MAIN time restore
if {![::tsv::exists ::stage::queue mutex]} {
  tsv::set ::stage::queue mutex   [::thread::mutex create]
  tsv::set ::stage::queue read    [thread::cond  create]
  tsv::set ::stage::queue write   [thread::cond  create]
  tsv::set ::stage::queue buffer  {}
  tsv::set ::stage::queue size    1000
}
namespace eval ::msg {}
vwait forever
}

Added src/object/character.tcl.









>
>
>
>
1
2
3
4
###
# Major Characters in the Game
# Players are a stand in for Gilgamesh
###

Added src/object/cities.csv.























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
UUID,SIZE,NAME,X,Y,Cuneiform
3e1ae6bb-4276-4652-b5f9-042a99253c6d,MEDIUM,Uruk,0,0,𒌷𒀕
db322b11-25f7-4878-bf89-7065927cb602,LARGE,Larsa,57,26,
5a4e13b7-1294-4c38-adbe-829ca469826b,LARGE,Eridu,64,72,𒉣𒆠
b5b673cb-1db8-4d33-9950-ca2eec2a5e72,LARGE,Shuruppack,24,-43,𒋢𒆳𒊒𒆠
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,MEDIUM,Ur,71,56,𒋀𒀕𒆠
f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,MEDIUM,Lagash,74,-78,𒉢𒁓𒆷𒆠
f7b52ab7-0be1-4ec9-9790-fca79c69231a,MEDIUM,Adab,5,-104,𒌓𒉣𒆠
10ac6d6b-d85d-4776-ab8b-211437a95489,MEDIUM,Umma,50,-68,𒄑𒆵𒆠
5c688180-f93c-44cc-8c3d-3c784caef066,MEDIUM,Larak,40,-155,𒆷𒊏𒀝𒆠
2478e597-2341-4f73-a8ba-b2715605aece,MEDIUM,Nippur,-61,-139,𒂗𒆤𒆠
9fb4cd21-354e-4595-9c74-44c5f3d88884,MEDIUM,Isin,-60,-100,𒉌𒋛𒅔𒆠
dab39a25-09fb-4bc7-9917-cb516786d5bd,MEDIUM,Kish,-139,-205,𒆧𒆠
b2a07a00-fdcf-4173-a154-ac4f45c08302,MEDIUM,Akshak,-139,-277,𒌔𒆠
8e2fae01-a436-4f74-b3e6-01788b9d34ad,LARGE,Sippar,-185,-276,𒌓𒄒𒉣𒆠
322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,SMALL,Marad,-114,-130
b78d2662-dbd6-4e1d-89fc-5093c22d15a4,SMALL,Der,44,-269,𒌷𒂦𒀭𒆠
18b357a1-8e65-461a-b165-f1bc564dc66b,MEDIUM,Hamazi,7,-645,𒄩𒈠𒍢𒆠
580a31a1-6ad1-415d-8eb0-f3ae83520221,MEDIUM,Mari,-619,-530
c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,SMALL,Puzrish-Dagon,-42,-118
f55773d6-a557-45b3-98d7-23ad7c3d6903,SMALL,Susa,357,-139
b4d12906-e5f2-4c21-b2e6-1b4f593db19f,SMALL,Nuzu,-185,-658
1cc41760-92f2-400f-9cb4-ec841e8360f8,SMALL,Ashur,-312,-660
30899112-a23f-4105-a612-e48eecd44db5,SMALL,Arbela,-215,-781,
21d40577-3b80-4acd-91ef-fb5aaaaa9a43,SMALL,Nineveh,-319,-814,𒌷𒉌𒉡𒀀
6c86ca7f-53d4-4385-a0cd-0b7cedd09673,SMALL,Nagar,-593,-873
1eab6449-c4ee-422d-9746-99ce44dffaac,LARGE,Guzana,-711,-889

Added src/object/connection.csv.











































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
uuida,uuidb,namea,nameb,distance,time,days
5a4e13b7-1294-4c38-adbe-829ca469826b,2ced6b3b-0587-42d1-934b-b5084dc8f8c7,Eridu,Ur,12.1,2.42,0
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,5a4e13b7-1294-4c38-adbe-829ca469826b,Ur,Eridu,12.1,2.42,0
db322b11-25f7-4878-bf89-7065927cb602,2ced6b3b-0587-42d1-934b-b5084dc8f8c7,Larsa,Ur,23.1,2.31,0
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,db322b11-25f7-4878-bf89-7065927cb602,Ur,Larsa,23.1,4.62,0
3e1ae6bb-4276-4652-b5f9-042a99253c6d,db322b11-25f7-4878-bf89-7065927cb602,Uruk,Larsa,65.6,6.56,1
db322b11-25f7-4878-bf89-7065927cb602,3e1ae6bb-4276-4652-b5f9-042a99253c6d,Larsa,Uruk,65.6,13.12,2
f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,2ced6b3b-0587-42d1-934b-b5084dc8f8c7,Lagash,Ur,93.5,9.35,1
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,Ur,Lagash,93.5,18.7,2
f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,db322b11-25f7-4878-bf89-7065927cb602,Lagash,Larsa,110.2,11.02,2
db322b11-25f7-4878-bf89-7065927cb602,f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,Larsa,Lagash,110.2,22.04,3
10ac6d6b-d85d-4776-ab8b-211437a95489,f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,Umma,Lagash,18.1,1.81,0
f809b7d1-5d28-43a4-8a36-5ffa3cd2cf89,10ac6d6b-d85d-4776-ab8b-211437a95489,Lagash,Umma,18.1,3.62,0
5c688180-f93c-44cc-8c3d-3c784caef066,10ac6d6b-d85d-4776-ab8b-211437a95489,Larak,Umma,76.4,7.640000000000001,1
10ac6d6b-d85d-4776-ab8b-211437a95489,5c688180-f93c-44cc-8c3d-3c784caef066,Umma,Larak,76.4,15.280000000000001,2
b2a07a00-fdcf-4173-a154-ac4f45c08302,5c688180-f93c-44cc-8c3d-3c784caef066,Akshak,Larak,151.2,15.12,2
5c688180-f93c-44cc-8c3d-3c784caef066,b2a07a00-fdcf-4173-a154-ac4f45c08302,Larak,Akshak,151.2,30.24,4
b5b673cb-1db8-4d33-9950-ca2eec2a5e72,3e1ae6bb-4276-4652-b5f9-042a99253c6d,Shuruppack,Uruk,34.3,6.859999999999999,1
3e1ae6bb-4276-4652-b5f9-042a99253c6d,b5b673cb-1db8-4d33-9950-ca2eec2a5e72,Uruk,Shuruppack,34.3,6.859999999999999,1
b5b673cb-1db8-4d33-9950-ca2eec2a5e72,10ac6d6b-d85d-4776-ab8b-211437a95489,Shuruppack,Umma,25.2,5.04,0
10ac6d6b-d85d-4776-ab8b-211437a95489,b5b673cb-1db8-4d33-9950-ca2eec2a5e72,Umma,Shuruppack,25.2,5.04,0
b5b673cb-1db8-4d33-9950-ca2eec2a5e72,9fb4cd21-354e-4595-9c74-44c5f3d88884,Shuruppack,Isin,70.8,14.16,2
9fb4cd21-354e-4595-9c74-44c5f3d88884,b5b673cb-1db8-4d33-9950-ca2eec2a5e72,Isin,Shuruppack,70.8,14.16,2
9fb4cd21-354e-4595-9c74-44c5f3d88884,3e1ae6bb-4276-4652-b5f9-042a99253c6d,Isin,Uruk,142.5,14.25,2
3e1ae6bb-4276-4652-b5f9-042a99253c6d,9fb4cd21-354e-4595-9c74-44c5f3d88884,Uruk,Isin,142.5,28.5,3
322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,9fb4cd21-354e-4595-9c74-44c5f3d88884,Marad,Isin,43.0,4.3,0
9fb4cd21-354e-4595-9c74-44c5f3d88884,322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,Isin,Marad,43.0,8.6,1
8e2fae01-a436-4f74-b3e6-01788b9d34ad,b2a07a00-fdcf-4173-a154-ac4f45c08302,Sippar,Akshak,32.1,6.42,1
b2a07a00-fdcf-4173-a154-ac4f45c08302,8e2fae01-a436-4f74-b3e6-01788b9d34ad,Akshak,Sippar,32.1,6.42,1
18b357a1-8e65-461a-b165-f1bc564dc66b,b2a07a00-fdcf-4173-a154-ac4f45c08302,Hamazi,Akshak,303.8,30.380000000000003,4
b2a07a00-fdcf-4173-a154-ac4f45c08302,18b357a1-8e65-461a-b165-f1bc564dc66b,Akshak,Hamazi,303.8,60.760000000000005,7
b4d12906-e5f2-4c21-b2e6-1b4f593db19f,b2a07a00-fdcf-4173-a154-ac4f45c08302,Nuzu,Akshak,334.7,33.47,4
b2a07a00-fdcf-4173-a154-ac4f45c08302,b4d12906-e5f2-4c21-b2e6-1b4f593db19f,Akshak,Nuzu,334.7,66.94,7
1cc41760-92f2-400f-9cb4-ec841e8360f8,b2a07a00-fdcf-4173-a154-ac4f45c08302,Ashur,Akshak,322.5,32.25,4
b2a07a00-fdcf-4173-a154-ac4f45c08302,1cc41760-92f2-400f-9cb4-ec841e8360f8,Akshak,Ashur,322.5,64.5,7
b4d12906-e5f2-4c21-b2e6-1b4f593db19f,1cc41760-92f2-400f-9cb4-ec841e8360f8,Nuzu,Ashur,110.8,11.08,2
1cc41760-92f2-400f-9cb4-ec841e8360f8,b4d12906-e5f2-4c21-b2e6-1b4f593db19f,Ashur,Nuzu,110.8,22.16,3
580a31a1-6ad1-415d-8eb0-f3ae83520221,8e2fae01-a436-4f74-b3e6-01788b9d34ad,Mari,Sippar,438.5,43.85,5
8e2fae01-a436-4f74-b3e6-01788b9d34ad,580a31a1-6ad1-415d-8eb0-f3ae83520221,Sippar,Mari,438.5,87.7,9
30899112-a23f-4105-a612-e48eecd44db5,1cc41760-92f2-400f-9cb4-ec841e8360f8,Arbela,Ashur,151.5,15.15,2
1cc41760-92f2-400f-9cb4-ec841e8360f8,30899112-a23f-4105-a612-e48eecd44db5,Ashur,Arbela,151.5,30.3,4
21d40577-3b80-4acd-91ef-fb5aaaaa9a43,1cc41760-92f2-400f-9cb4-ec841e8360f8,Nineveh,Ashur,129.0,12.9,2
1cc41760-92f2-400f-9cb4-ec841e8360f8,21d40577-3b80-4acd-91ef-fb5aaaaa9a43,Ashur,Nineveh,129.0,25.8,3
21d40577-3b80-4acd-91ef-fb5aaaaa9a43,30899112-a23f-4105-a612-e48eecd44db5,Nineveh,Arbela,152.3,15.23,2
30899112-a23f-4105-a612-e48eecd44db5,21d40577-3b80-4acd-91ef-fb5aaaaa9a43,Arbela,Nineveh,152.3,30.46,4
6c86ca7f-53d4-4385-a0cd-0b7cedd09673,580a31a1-6ad1-415d-8eb0-f3ae83520221,Nagar,Mari,264.0,26.4,3
580a31a1-6ad1-415d-8eb0-f3ae83520221,6c86ca7f-53d4-4385-a0cd-0b7cedd09673,Mari,Nagar,264.0,52.8,6
8e2fae01-a436-4f74-b3e6-01788b9d34ad,322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,Sippar,Marad,113.3,11.33,2
322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,8e2fae01-a436-4f74-b3e6-01788b9d34ad,Marad,Sippar,113.3,22.66,3
dab39a25-09fb-4bc7-9917-cb516786d5bd,322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,Kish,Marad,55.2,5.5200000000000005,0
322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,dab39a25-09fb-4bc7-9917-cb516786d5bd,Marad,Kish,55.2,11.040000000000001,2
322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,2478e597-2341-4f73-a8ba-b2715605aece,Marad,Nippur,37.4,7.4799999999999995,1
2478e597-2341-4f73-a8ba-b2715605aece,322d88e1-fbbd-4e35-a9ea-bb4f5a767f61,Nippur,Marad,37.4,7.4799999999999995,1
2478e597-2341-4f73-a8ba-b2715605aece,c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,Nippur,Puzrish-Dagon,19.8,3.96,0
c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,2478e597-2341-4f73-a8ba-b2715605aece,Puzrish-Dagon,Nippur,19.8,3.96,0
c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,f7b52ab7-0be1-4ec9-9790-fca79c69231a,Puzrish-Dagon,Adab,34.2,6.840000000000001,1
f7b52ab7-0be1-4ec9-9790-fca79c69231a,c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,Adab,Puzrish-Dagon,34.2,6.840000000000001,1
c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,9fb4cd21-354e-4595-9c74-44c5f3d88884,Puzrish-Dagon,Isin,17.7,3.54,0
9fb4cd21-354e-4595-9c74-44c5f3d88884,c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,Isin,Puzrish-Dagon,17.7,3.54,0
c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,5c688180-f93c-44cc-8c3d-3c784caef066,Puzrish-Dagon,Larak,62.7,12.540000000000001,2
5c688180-f93c-44cc-8c3d-3c784caef066,c1ac4264-31a3-460c-9b06-06a6ffbf5fc1,Larak,Puzrish-Dagon,62.7,12.540000000000001,2
f7b52ab7-0be1-4ec9-9790-fca79c69231a,b5b673cb-1db8-4d33-9950-ca2eec2a5e72,Adab,Shuruppack,44.6,8.92,1
b5b673cb-1db8-4d33-9950-ca2eec2a5e72,f7b52ab7-0be1-4ec9-9790-fca79c69231a,Shuruppack,Adab,44.6,8.92,1
dab39a25-09fb-4bc7-9917-cb516786d5bd,2478e597-2341-4f73-a8ba-b2715605aece,Kish,Nippur,71.2,14.24,2
2478e597-2341-4f73-a8ba-b2715605aece,dab39a25-09fb-4bc7-9917-cb516786d5bd,Nippur,Kish,71.2,14.24,2
dab39a25-09fb-4bc7-9917-cb516786d5bd,b2a07a00-fdcf-4173-a154-ac4f45c08302,Kish,Akshak,50.3,10.059999999999999,2
b2a07a00-fdcf-4173-a154-ac4f45c08302,dab39a25-09fb-4bc7-9917-cb516786d5bd,Akshak,Kish,50.3,10.059999999999999,2
2478e597-2341-4f73-a8ba-b2715605aece,5c688180-f93c-44cc-8c3d-3c784caef066,Nippur,Larak,71.4,14.280000000000001,2
5c688180-f93c-44cc-8c3d-3c784caef066,2478e597-2341-4f73-a8ba-b2715605aece,Larak,Nippur,71.4,14.280000000000001,2
b78d2662-dbd6-4e1d-89fc-5093c22d15a4,5c688180-f93c-44cc-8c3d-3c784caef066,Der,Larak,79.6,15.919999999999998,2
5c688180-f93c-44cc-8c3d-3c784caef066,b78d2662-dbd6-4e1d-89fc-5093c22d15a4,Larak,Der,79.6,15.919999999999998,2
b78d2662-dbd6-4e1d-89fc-5093c22d15a4,b2a07a00-fdcf-4173-a154-ac4f45c08302,Der,Akshak,127.8,25.56,3
b2a07a00-fdcf-4173-a154-ac4f45c08302,b78d2662-dbd6-4e1d-89fc-5093c22d15a4,Akshak,Der,127.8,25.56,3
2478e597-2341-4f73-a8ba-b2715605aece,2ced6b3b-0587-42d1-934b-b5084dc8f8c7,Nippur,Ur,328.7,32.87,4
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,2478e597-2341-4f73-a8ba-b2715605aece,Ur,Nippur,328.7,65.74,7
b78d2662-dbd6-4e1d-89fc-5093c22d15a4,f55773d6-a557-45b3-98d7-23ad7c3d6903,Der,Susa,236.5,47.3,5
f55773d6-a557-45b3-98d7-23ad7c3d6903,b78d2662-dbd6-4e1d-89fc-5093c22d15a4,Susa,Der,236.5,47.3,5
1eab6449-c4ee-422d-9746-99ce44dffaac,6c86ca7f-53d4-4385-a0cd-0b7cedd09673,Guzana,Nagar,124.6,12.459999999999999,2
6c86ca7f-53d4-4385-a0cd-0b7cedd09673,1eab6449-c4ee-422d-9746-99ce44dffaac,Nagar,Guzana,124.6,24.919999999999998,3
bb3ccabe-6bfd-4224-9c8f-abbcfca2326b,1eab6449-c4ee-422d-9746-99ce44dffaac,Cedar Forest,Guzana,1059.6,105.96,11
1eab6449-c4ee-422d-9746-99ce44dffaac,bb3ccabe-6bfd-4224-9c8f-abbcfca2326b,Guzana,Cedar Forest,1059.6,211.92,22
e9ac6b28-ac90-4d68-a0d1-526a5c321016,21d40577-3b80-4acd-91ef-fb5aaaaa9a43,Mount Nisir,Nineveh,1188.9,118.89000000000001,12
21d40577-3b80-4acd-91ef-fb5aaaaa9a43,e9ac6b28-ac90-4d68-a0d1-526a5c321016,Nineveh,Mount Nisir,1188.9,237.78000000000003,24
ffa40190-0826-4706-a892-a15c2225794a,2ced6b3b-0587-42d1-934b-b5084dc8f8c7,Dilmun,Ur,622.7,62.27,7
2ced6b3b-0587-42d1-934b-b5084dc8f8c7,ffa40190-0826-4706-a892-a15c2225794a,Ur,Dilmun,622.7,124.54,13

Added src/object/index.tcl.













































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
###
# loader for gilgamesh game objects
###


package require uuid
package require csv
package require md5 2

proc ::lrandom list {
  set len [llength $list]
  set idx [expr int(rand()*$len)]
  return [lindex $list $idx]
}

proc mapscape {mag scale} {
  return [expr {int(round($mag*$scale*10))/10.0}]
}

###
# A Rigged uuid generator that produces the same sequence all of the time
###
proc generate_uuid {type} {
    package require md5 2
    global uid

    set tok [md5::MD5Init]
    md5::MD5Update $tok gilgamesh;             # salt the uuid
    md5::MD5Update $tok $type;                 # salt the uuid
    md5::MD5Update $tok [incr uid(type)];      # package incrementing counter
    set r [md5::MD5Final $tok]
    binary scan $r c* r

    # 3.4: set uuid versioning fields
    lset r 8 [expr {([lindex $r 8] & 0x3F) | 0x80}]
    lset r 6 [expr {([lindex $r 6] & 0x0F) | 0x40}]

    set bin [binary format c* $r]
    return [::uuid::tostring $bin]
}

namespace eval ::main {}
set ::main::here [file dirname [info script]]
set loaded [info script]
foreach file {character.tcl uruk.tcl location.tcl map.tcl} {
  set fname [file join $::main::here $file]
  lappend loaded $fname
  MAIN clay source $fname
}
foreach file [lsort -dictionary [glob [file join $::main::here *.tcl]]] {
  if {$file in $loaded} continue
  lappend loaded $file
  MAIN clay source $file
}

Added src/object/item.tcl.

Added src/object/location.tcl.













































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
###
# Major Locations in the Game
###
my object create {
  cname   avatar
  name    {The Player}
  core    avatar
  location  884da325-a95d-4adf-8c73-0b110ff570a4
  home      3e1ae6bb-4276-4652-b5f9-042a99253c6d
  link {}
  description {You are the main character in this story. Feel free to change this
description with the <a href=/edit/self>EDIT SELF</a> command.}
}
my object create {
  uuid        21f869ea-e339-42d7-ab00-28f9dcef4d58
  name        {Heaven}
  cname       heaven
  core        location
  environment mythical
  description {The Realm of the Gods}
}
my object create {
  uuid          cba9f2a2-b06f-49ab-a7cf-c02a734476cd
  name          {Nowhere}
  cname         {}
  core          location
  environment   plane
  link          {}
  description {This is the nowhere. Nothing is really defined as such, I'd say use
your imagination but there is literally nothing here. At least setting wise. I mean,
<i>you</i> are here. And probably any lost things in the database.}
}


my object create {
  uuid        f936e810-f0b2-4321-81ce-37cc932447f9
  name        {Material Plane}
  core        location
  cname       earth
  environment material
  link        {}
  description {The material plane. Basically anywhere in physical existence}
}

my object create {
  uuid        f16f7e06-d454-41e2-bebe-e64b397be1d4
  name        {On the Road}
  core        location
  cname       road
  environment travel
  location    f936e810-f0b2-4321-81ce-37cc932447f9
  link        {}
  description {On the road between cities}
}

Added src/object/map.tcl.



















































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
###
# Converting map data extracted from
# https://cdn.britannica.com/50/2550-050-993C719C.jpg
#
# Into useful coordinates
###

# Map scale is approx 215 pixels ~ 150 km
set scale [expr {150.0/215.0}]
###
# We pick Uruk as the "center" of the map
#
# Other cities are relative to Uruk.
# All coordinates are in pixels. +x is east, +y is south
# All distances measured from center of map dot to center of map dot
###
puts "Generating Cities"
set fin [open [file join $::main::here cities.csv] r]
# Throw out headers
gets $fin line
while {[gets $fin line]>=0} {
  set lline [csv::split $line]
  lassign $lline uuid size name xmap ymap
  if {$uuid eq {}} continue
  dict set map $name uuid $uuid
  dict set map $name location f936e810-f0b2-4321-81ce-37cc932447f9
  dict set map $name name $name
  dict set map $name core location
  dict set map $name environment wilderness
  dict set map $name has_city 1
  dict set map $name size [string tolower $size]
  dict set map $name coords [list [mapscape $xmap $scale] [mapscape $ymap $scale]]
  my object create [dict get $map $name]
}
close $fin

puts "Generating Regions"
set pi [expr {4.0*atan(1.0)}]
set fin [open [file join $::main::here regions.csv] r]
# Throw out headers
gets $fin line
while {[gets $fin line]>=0} {
  set lline [csv::split $line]
  lassign $lline UUID NAME DISTANCE THETA HAS_CITY
  if {$uuid eq {}} continue
  set name $NAME
  dict set map $name uuid $UUID
  dict set map $name name $NAME
  dict set map $name core location
  dict set map $name location f936e810-f0b2-4321-81ce-37cc932447f9
  dict set map $name environment wilderness
  dict set map $name has_city $HAS_CITY
  dict set map $name coords [list [expr ($DISTANCE*cos($THETA*$pi/180.0))] [expr ($DISTANCE*sin($THETA*$pi/180.0))]]
  my object create [dict get $map $name]
}
close $fin

#my <db> eval {select uuid,name from stage.object where core='location'} {
#  set obj [my object wake $uuid]
#}

puts "Generating Townsfolk"
###
# Procedurally generate cities and their inhabitants
###
dict for {regionname info} $map {
  if {![dict exists $info has_city]} continue
  if {![dict get $info has_city]} continue
  ###
  # Every city gets:
  # a marketplace
  # a palace
  # a gate
  ###
  set regionname [string totitle $regionname]
  set regionuuid [dict get $info uuid]

  foreach {type} {wilderness dungeon surrounds} {
    set info {core location}
    dict set info uuid [generate_uuid $type]
    dict set info location $regionuuid
    dict set info environment $type
    dict set info name [string totitle "$regionname [string totitle $type]"]
    dict set info tags $type
    my object create $info
    dict set bldg $type $info
    my object create $info
  }

  ###
  # Generate a city in the region
  ###
  set myuuid [dict get $info uuid]
  set cityuuid [generate_uuid city]
  set cityname "$regionname Center"

  set info {core location}
  dict set info uuid $cityuuid
  dict set info location $regionuuid
  dict set info environment city
  dict set info name $cityname
  dict set info tags city
  dict set bldg city $info
  my object create $info

  set types {palace  marketplace temple residential tavern}
  foreach type $types {
    set info {core location}
    dict set info uuid [generate_uuid $type]
    dict set info environment $type
    dict set info name "$regionname [string totitle $type]"
    dict set info tags $type
    dict set info location $cityuuid
    dict set bldg $type $info
    my object create $info
  }

  ###
  # Every city gets the following vendors:
  ###
  set types {
    hermit      {count 1 location wilderness}
    farmer      {count 1 location surrounds}
    earl        {count 1 location palace}
    chancellor  {count 1 location palace}
    warrior     {count 1 location city}
    harlot      {count 1 location temple gender male}
    harlot      {count 1 location temple gender female}
    shaman      {count 1 location temple}
    alchemist   {count 1 location marketplace}
    soothsayer  {count 1 location marketplace}
    trader      {count 1 location marketplace}
    caravan     {count 2 location marketplace}
    innkeeper   {count 1 location tavern}
  }
  dict for {type roldat} $types {
    dict with roldat {}
    for {set x 0} {$x < $count} {incr x} {
      set info {core actor}
      if {[dict exists $roldat gender]} {
        set gender [::lrandom [dict get $roldat gender]]
      } else {
        set gender [::lrandom {male female}]
      }
      dict set info location [dict get $bldg [dict get $roldat location] uuid]
      dict set info divinity mortal
      dict set info form humanoid
      dict set info vocation $type
      dict set info gender $gender
      dict set info name "[::randomword::word $gender]"
      dict set info home $regionname
      dict set info work [dict get $bldg [dict get $roldat location] uuid]
      my object create $info
    }
  }
}

puts "Building Roads"
set fin [open [file join $::main::here paths.csv] r]
#set linkout [open [file join $here .. connection.csv] w]
#puts $linkout [csv::join {uuida uuidb namea nameb distance time days}]
# Throw out headers
gets $fin line
while {[gets $fin line]>=0} {
  set lline [csv::split $line]
  set citya {}
  set water 0
  set bendy 1.0
  lassign $lline citya cityb water bendy
  if {$citya eq {}} continue
  lassign [dict get $map $citya coords] x0 y0
  lassign [dict get $map $cityb coords] x1 y1
  set dx [expr {$x1-$x0}]
  set dy [expr {$y1-$y0}]

  set rawdistance [expr {sqrt($dx*$dx + $dy*$dy)}]

  if {$bendy != {} && $bendy > 1} {
    set rawdistance [expr $rawdistance*$bendy]
  }
  # Round to the nearest meter
  set distance [expr {int(round($rawdistance*1000))/1000.0}]
  set infoab {}
  dict set infoab start [dict get $map $citya coords]
  dict set infoab end   [dict get $map $cityb coords]
  dict set infoab distance $distance

  set infoba {}
  dict set infoba start [dict get $map $cityb coords]
  dict set infoba end   [dict get $map $citya coords]
  dict set infoba distance $distance

  switch $water {
    0 {
      # Road travel in both directions
      # Assume 5 km/hour in each direction
      set time [expr {$distance/5.0/24.0}]
      dict set infoab type  road
      dict set infoab time  $time
      dict set infoba type  road
      dict set infoba time  $time
    }
    1 {
      # River travel on one direction Road in the
      # other direction
      set time [expr {$distance/10.0/24.0}]
      dict set infoab type  river
      dict set infoab time  $time
      set time [expr {$distance/5.0/24.0}]
      dict set infoba type  road
      dict set infoba time  $time
    }
    2 {
      # Sea travel in both directions
      # Pulling a figure out of the air...er...water
      # 10 km/hour
      set time [expr {$distance/10.0/24.0}]
      dict set infoab type  sea
      dict set infoab time  $time
      dict set infoba type  sea
      dict set infoba time  $time
    }

  }
  if {!$water} {

  } else {
    # Assume 10 km/hour downstream and 5 km/hour (walking) upstream
    dict set infoab type water
    dict set infoab time [expr {$distance/10.0/24.0}]
  }

  my link add [dict get $map $citya uuid] [dict get $map $cityb uuid] transport $infoab
  my link add [dict get $map $cityb uuid] [dict get $map $citya uuid] transport $infoba
  #puts $linkout [csv::join [list [dict get $map $citya uuid] [dict get $map $cityb uuid] $citya $cityb [dict get $infoab distance] [dict get $infoab time] [dict get $infoab days]]]
  #puts $linkout [csv::join [list [dict get $map $cityb uuid] [dict get $map $citya uuid] $cityb $citya [dict get $infoba distance] [dict get $infoba time] [dict get $infoba days]]]
}
#close $linkout

###
# Add links back from nowhere
###
my link add cba9f2a2-b06f-49ab-a7cf-c02a734476cd 3e1ae6bb-4276-4652-b5f9-042a99253c6d transport {
  distance  0
  time      0
  type      mythic
  days      0
}

Added src/object/npc.tcl.



>
1

Added src/object/pantheon.tcl.







































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
###
# Generate the Gods of gilgamesh
###

set storyout [open [file join $::GAME(SAVE) creation.text] w]
###
# Gods fall into a variety of patterns. The worship of each diety
# exemplifies a particular pattern of the SIMPLE system and requires
# a different temple. As Gods become more popular a temple is
# constructed in a Town
###

###
# The "S.I.M.P.L.E." system:
#
# (S)avvy - How well the character understands politics, economics, and human nature
# (I)ntellect - How well the character can grasp abstract concepts
# (M)ight - How much physical and spiritual energy the character can bring to bear
# (P)erception - How well the character can pull information from both the real and spiritual worlds
# (L)uck - How much of a thumb on the scale of chance the character can place to shape events
# (E)mpathy - How well the characters can detect the feelings and motivations of other characters.
###

###
# Principles in God creation
# There was a pair of original Gods who managed to balance everything. But as
# they had offspring, the offspring took on random attributes that magnified
# a SIMPLE attribute while diminishing others.
###
set heavenuuid [my object uuid heaven]

###
# Set the random number seed
###
puts "SEED: [expr srand(0)]"

###
# Create the Grandfather God
###
set info {
attributes {
  savvy       5
  intellect   5
  might       5
  perception  5
  luck        5
  empathy     5
}
gender male
description {The All-Father}
}
set name [::randomword::word male 3]
dict set info name $name
dict set info uuid [generate_uuid god]
my object create $info
set male(0) $info

# Create the Grandmother God
set info {
attributes {
  savvy       5
  intellect   5
  might       5
  perception  5
  luck        5
  empathy     5
}
gender female
description {The All-Mother}
}
set name [::randomword::word female 3]
dict set info name $name
dict set info uuid [generate_uuid god]
my object create $info
set female(0) $info

###
# Interactions
# seduction - one party seduced the other through magical means
# drunken encounter - both parties were drunk and creation happened
# love      - Two parties looked into each others eyes and fell in love
# hate bang - Two parties slept with each other to get back and someone else
# cuckold   - Two parties cheated on a third and possibly fourth party
#
# With only two gods we have to pick between seduce, drunk or true
###

proc href {gender number} {
  upvar 1 $gender data
  return "\[wiki [dict get $data(0) uuid] [dict get $data(0) name]\]"
}

proc name {gender number} {
  upvar 1 $gender data
  return "[dict get $data(0) name]"
}

###
# Generate a random number of generation 1 Gods from this pairing
###
puts $storyout "In the beginning there were two Gods of All Creation:"
# Who first?
set first  [lrandom {male female}]
if {$first eq "female"} {
  puts $storyout "[href female 0] and [href male 0]"
} else {
  puts $storyout "[href male 0] and [href female 0]"

}
puts $storyout <P>
close $storyout
proc sex_interaction {actor_a actor_b actor_c} {
  global relationship
  set uuid_a [dict get $actor_a uuid]
  set uuid_b [dict get $actor_b uuid]

  set relation_a [dict get $relationship $uuid_a $]
  if {[dict exists $relationship $actor_a $actor_b]}  {
    set info [dict get $relationship $actor_a $actor_b]
    if {![dict exists $relation_a attaction]} {
      dict set relation_a attraction [expr {rand()}]
    }
    dict set relat
  }
  dict set relationship [dict get $actor_a uuid] [dict get $actor_b uuid] consort
  dict set relationship [dict get $actor_b uuid] [dict get $actor_a uuid] consort

  set willing_a [expr {1 0 1}]
  set willing_b [expr {1 0}]
  dict set map %href_a% [href $actor_a]
  dict set map %href_b% [href $actor_b]
  dict set map %href_c% [href $actor_c]

  dict set map %name_a% [dict get $actor_a name]
  dict set map %name_b% [dict get $actor_b name]
  dict set map %gender_a% [dict get $actor_a gender]
  dict set map %gender_b% [dict get $actor_b gender]

  if {!$willing_a} {
    if {!$willing_b} {
      # Neither party wanted to have sex... and yet here we are
      #
      # Story about how the both decided to have sex for some higher purpose

      set story [string map $map {%href_a% and %href_b% pondered the mystery of the universe and decided
now was the time to produce a child. They reluctantly did the deed, and product of that
union was %href_c%.
}]
    } else {
      # A was under some form of curse, but B was kind of horny
      #
      # Story about how A managed to say just the right thing to B and one
      # thing lead to another
      return [string map $map {%href_a% and %href_b% met up on day, and the subject turned to the
empty universe they inhabited. %name_a% wondered what could be done. Now %name_b%
had [::pheme::posessive_determiner [::pheme::pronoun_personal %gender_b%]] eye on
%name_a% for quite some time and knew now was [::pheme::posessive_determiner [::pheme::pronoun_personal %gender_b%]]
chance.
  pondered the mystery of the universe and decided
now was the time to produce a child. They reluctantly did the deed, and product of that
union was %href_c%.
}]
    }
  }
  # A wanted to
  if {$willing_b} {
    # And so did B

  }
  set willing_b [expr {willing unwilling}]

  set mood_a
  set mood_b [lrandom {aroused neutral cold drunk}]
  if {$mood_a eq ""}
  switch [lrandom {aroused neutral cold drunk}] {
    aroused {
    }
    neutral {
    }
    cold {
    }
    drunk {
    }
  }

}


proc event_seduction {gender_a who_a gender_b who_b} {
  set tod   [lrandom {Morning Evening Afternoon Evening}]
  set form [lrandom {
        cuckoo flame spouse satyr patron {golden rain} {tame white bull}
        eagle swan
      }]
  set line "One [lrandom {Morning Evening Afternoon Evening}] [href $gender_a $who_a] "
  switch [lrandom {form chase disabled}] {
    form {
      ###
      # A takes the form of something else to trick B into having sex
      # List stolen from https://quizlet.com/39502731/the-seductions-of-zeus-flash-cards/
      # because, frankly, I couldn't make a set as strange as this one up
      #
      # Omitted the swallowing metis because..frankly I can't figure out
      ###

      append line " came to [href $gender_b $who_b] in the form of a $form. And raped "
      append line " [::pheme::pronoun_personal subject $gender_b]. From that moment on the two were consorts."
      return $line
    }
    chase {
      append line " simply had to mate with [href $gender_b $who_b]. [name $gender_b $who_b]"
      append line " rebuffed [name $gender_a $who_a]."

      append line " [string totitle [pronoun subject $gender_b]] run until [pronoun personal $gender_b]"
      append line [lrandom {
        {came to a tall cliff %pp% could not climb.}
        {came to a massive river %pp% could not cross.}
        {the edge of the world.}

      }]
      switch $impediment {
        obstacle {

          switch [lrandom {cliff river edge}] {
            cliff {
              append line "a tall cliff."
            }
            river {
              append line "a massive river."

            }
          }

          [::pheme::pronoun_personal object $gender_b] couldn't cross."
        }
      }
      append line " rebuffed [name $gender_a $who_a]. And run until "

    }
  }

}

Added src/object/paths.csv.























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CITY_A,CITY_B,WATER,BEND
Eridu,Ur,0
Larsa,Ur,1
Uruk,Larsa,1,1.5
Lagash,Ur,1
Lagash,Larsa,1,1.5
Umma,Lagash,1
Larak,Umma,1,1.25
Akshak,Larak,1
Shuruppack,Uruk,0
Shuruppack,Umma,0
Shuruppack,Isin,0
Isin,Uruk,1,1.75
Marad,Isin,1,1
Sippar,Akshak,0
Hamazi,Akshak,1,1.1
Nuzu,Akshak,1,1.25
Ashur,Akshak,1,1.1
Nuzu,Ashur,1,1.25
Mari,Sippar,1,1.25
Arbela,Ashur,1,1.4
Nineveh,Ashur,1,1.2
Nineveh,Arbela,1,2
Nagar,Mari,1,1.1
Sippar,Marad,1,1
Kish,Marad,1,1
Marad,Nippur,0
Nippur,Puzrish-Dagon,0
Puzrish-Dagon,Adab,0
Puzrish-Dagon,Isin,0
Puzrish-Dagon,Larak,0
Adab,Shuruppack,0
Kish,Nippur,0
Kish,Akshak,0
Nippur,Larak,0
Der,Larak,0
Der,Akshak,0
Nippur,Ur,1,2
Der,Susa,0,1
Guzana,Nagar,1,1.5
Cedar Forest,Guzana,1,1
Mount Nisir,Nineveh,1,1.0
Dilmun,Ur,2,1.0

Added src/object/planes.csv.

Added src/object/quest.tcl.







>
>
>
1
2
3
###
# Quests in the game
###

Added src/object/regions.csv.











>
>
>
>
>
1
2
3
4
5
UUID,NAME,DISTANCE,THETA,HAS_CITY,CITY
0ae98c93-e91a-46c9-bbed-f67db2479ffa,Sumer,0,0,0
bb3ccabe-6bfd-4224-9c8f-abbcfca2326b,Cedar Forest,1000,160,0
e9ac6b28-ac90-4d68-a0d1-526a5c321016,Mount Nisir,600,90,0
ffa40190-0826-4706-a892-a15c2225794a,Dilmun,600,290,1

Added src/object/trade.tcl.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
###
# Trade Routes
#
# Sumeria had fertile fields to grow crops, and beer
# but for just about everything else (like timber, gems, and copper)
# the needed to trade.
#
# This game implements those trading areas as regions
###

###
# They used to trade with Dilman for Copper
###

Added src/object/uruk.tcl.



>
1

Added src/tables/measurement.tcl.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
###
# Ancient Mesopotamian units of measurement
# https://en.wikipedia.org/wiki/Ancient_Mesopotamian_units_of_measurement
###
package require units
namespace eval ::gilgamesh {}


Added src/tools/aristocracy.tcl.

Added src/tools/build.tcl.















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


namespace eval ::main {}
set ::main::here [file dirname [file join [pwd] [info script]]]
source [file join $::main::here .. .. .. modules randomword randomword.tcl]
exec [info nameofexecutable] [file join $::main::here .. .. .. modules clay  build  build.tcl]
exec [info nameofexecutable] [file join $::main::here .. .. .. modules clay-stage  build  build.tcl]
exec [info nameofexecutable] [file join $::main::here .. .. .. modules pheme build build.tcl]
source [file join $::main::here .. .. .. modules pheme pheme.tcl]
source [file join $::main::here .. .. .. modules router router.tcl]
source [file join $::main::here .. .. .. modules clay clay.tcl]
source [file join $::main::here .. .. .. modules clay-stage clay-stage.tcl]

source [file join $::main::here .. class index.tcl]

source [file join $::main::here .. class index.tcl]

::stage::stage create MAIN :memory:


source [file join $::main::here map.tcl]
source [file join $::main::here pantheon.tcl]
source [file join $::main::here aristocracy.tcl]