Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/**
2
 * TinyMCE version 6.8.3 (2024-02-08)
3
 */
4
 
5
(function () {
6
    'use strict';
7
 
8
    var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
 
10
    const fireInsertCustomChar = (editor, chr) => {
11
      return editor.dispatch('insertCustomChar', { chr });
12
    };
13
 
14
    const insertChar = (editor, chr) => {
15
      const evtChr = fireInsertCustomChar(editor, chr).chr;
16
      editor.execCommand('mceInsertContent', false, evtChr);
17
    };
18
 
19
    const hasProto = (v, constructor, predicate) => {
20
      var _a;
21
      if (predicate(v, constructor.prototype)) {
22
        return true;
23
      } else {
24
        return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
25
      }
26
    };
27
    const typeOf = x => {
28
      const t = typeof x;
29
      if (x === null) {
30
        return 'null';
31
      } else if (t === 'object' && Array.isArray(x)) {
32
        return 'array';
33
      } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
34
        return 'string';
35
      } else {
36
        return t;
37
      }
38
    };
39
    const isType = type => value => typeOf(value) === type;
40
    const isSimpleType = type => value => typeof value === type;
41
    const eq = t => a => t === a;
42
    const isArray$1 = isType('array');
43
    const isNull = eq(null);
44
    const isUndefined = eq(undefined);
45
    const isNullable = a => a === null || a === undefined;
46
    const isNonNullable = a => !isNullable(a);
47
    const isFunction = isSimpleType('function');
48
 
49
    const constant = value => {
50
      return () => {
51
        return value;
52
      };
53
    };
54
    const never = constant(false);
55
 
56
    class Optional {
57
      constructor(tag, value) {
58
        this.tag = tag;
59
        this.value = value;
60
      }
61
      static some(value) {
62
        return new Optional(true, value);
63
      }
64
      static none() {
65
        return Optional.singletonNone;
66
      }
67
      fold(onNone, onSome) {
68
        if (this.tag) {
69
          return onSome(this.value);
70
        } else {
71
          return onNone();
72
        }
73
      }
74
      isSome() {
75
        return this.tag;
76
      }
77
      isNone() {
78
        return !this.tag;
79
      }
80
      map(mapper) {
81
        if (this.tag) {
82
          return Optional.some(mapper(this.value));
83
        } else {
84
          return Optional.none();
85
        }
86
      }
87
      bind(binder) {
88
        if (this.tag) {
89
          return binder(this.value);
90
        } else {
91
          return Optional.none();
92
        }
93
      }
94
      exists(predicate) {
95
        return this.tag && predicate(this.value);
96
      }
97
      forall(predicate) {
98
        return !this.tag || predicate(this.value);
99
      }
100
      filter(predicate) {
101
        if (!this.tag || predicate(this.value)) {
102
          return this;
103
        } else {
104
          return Optional.none();
105
        }
106
      }
107
      getOr(replacement) {
108
        return this.tag ? this.value : replacement;
109
      }
110
      or(replacement) {
111
        return this.tag ? this : replacement;
112
      }
113
      getOrThunk(thunk) {
114
        return this.tag ? this.value : thunk();
115
      }
116
      orThunk(thunk) {
117
        return this.tag ? this : thunk();
118
      }
119
      getOrDie(message) {
120
        if (!this.tag) {
121
          throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
122
        } else {
123
          return this.value;
124
        }
125
      }
126
      static from(value) {
127
        return isNonNullable(value) ? Optional.some(value) : Optional.none();
128
      }
129
      getOrNull() {
130
        return this.tag ? this.value : null;
131
      }
132
      getOrUndefined() {
133
        return this.value;
134
      }
135
      each(worker) {
136
        if (this.tag) {
137
          worker(this.value);
138
        }
139
      }
140
      toArray() {
141
        return this.tag ? [this.value] : [];
142
      }
143
      toString() {
144
        return this.tag ? `some(${ this.value })` : 'none()';
145
      }
146
    }
147
    Optional.singletonNone = new Optional(false);
148
 
149
    const nativePush = Array.prototype.push;
150
    const map = (xs, f) => {
151
      const len = xs.length;
152
      const r = new Array(len);
153
      for (let i = 0; i < len; i++) {
154
        const x = xs[i];
155
        r[i] = f(x, i);
156
      }
157
      return r;
158
    };
159
    const each = (xs, f) => {
160
      for (let i = 0, len = xs.length; i < len; i++) {
161
        const x = xs[i];
162
        f(x, i);
163
      }
164
    };
165
    const findUntil = (xs, pred, until) => {
166
      for (let i = 0, len = xs.length; i < len; i++) {
167
        const x = xs[i];
168
        if (pred(x, i)) {
169
          return Optional.some(x);
170
        } else if (until(x, i)) {
171
          break;
172
        }
173
      }
174
      return Optional.none();
175
    };
176
    const find = (xs, pred) => {
177
      return findUntil(xs, pred, never);
178
    };
179
    const flatten = xs => {
180
      const r = [];
181
      for (let i = 0, len = xs.length; i < len; ++i) {
182
        if (!isArray$1(xs[i])) {
183
          throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
184
        }
185
        nativePush.apply(r, xs[i]);
186
      }
187
      return r;
188
    };
189
    const bind = (xs, f) => flatten(map(xs, f));
190
 
191
    var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
192
 
193
    const option = name => editor => editor.options.get(name);
194
    const register$2 = editor => {
195
      const registerOption = editor.options.register;
196
      const charMapProcessor = value => isFunction(value) || isArray$1(value);
197
      registerOption('charmap', { processor: charMapProcessor });
198
      registerOption('charmap_append', { processor: charMapProcessor });
199
    };
200
    const getCharMap$1 = option('charmap');
201
    const getCharMapAppend = option('charmap_append');
202
 
203
    const isArray = global.isArray;
204
    const UserDefined = 'User Defined';
205
    const getDefaultCharMap = () => {
206
      return [
207
        {
208
          name: 'Currency',
209
          characters: [
210
            [
211
              36,
212
              'dollar sign'
213
            ],
214
            [
215
              162,
216
              'cent sign'
217
            ],
218
            [
219
              8364,
220
              'euro sign'
221
            ],
222
            [
223
              163,
224
              'pound sign'
225
            ],
226
            [
227
              165,
228
              'yen sign'
229
            ],
230
            [
231
              164,
232
              'currency sign'
233
            ],
234
            [
235
              8352,
236
              'euro-currency sign'
237
            ],
238
            [
239
              8353,
240
              'colon sign'
241
            ],
242
            [
243
              8354,
244
              'cruzeiro sign'
245
            ],
246
            [
247
              8355,
248
              'french franc sign'
249
            ],
250
            [
251
              8356,
252
              'lira sign'
253
            ],
254
            [
255
              8357,
256
              'mill sign'
257
            ],
258
            [
259
              8358,
260
              'naira sign'
261
            ],
262
            [
263
              8359,
264
              'peseta sign'
265
            ],
266
            [
267
              8360,
268
              'rupee sign'
269
            ],
270
            [
271
              8361,
272
              'won sign'
273
            ],
274
            [
275
              8362,
276
              'new sheqel sign'
277
            ],
278
            [
279
              8363,
280
              'dong sign'
281
            ],
282
            [
283
              8365,
284
              'kip sign'
285
            ],
286
            [
287
              8366,
288
              'tugrik sign'
289
            ],
290
            [
291
              8367,
292
              'drachma sign'
293
            ],
294
            [
295
              8368,
296
              'german penny symbol'
297
            ],
298
            [
299
              8369,
300
              'peso sign'
301
            ],
302
            [
303
              8370,
304
              'guarani sign'
305
            ],
306
            [
307
              8371,
308
              'austral sign'
309
            ],
310
            [
311
              8372,
312
              'hryvnia sign'
313
            ],
314
            [
315
              8373,
316
              'cedi sign'
317
            ],
318
            [
319
              8374,
320
              'livre tournois sign'
321
            ],
322
            [
323
              8375,
324
              'spesmilo sign'
325
            ],
326
            [
327
              8376,
328
              'tenge sign'
329
            ],
330
            [
331
              8377,
332
              'indian rupee sign'
333
            ],
334
            [
335
              8378,
336
              'turkish lira sign'
337
            ],
338
            [
339
              8379,
340
              'nordic mark sign'
341
            ],
342
            [
343
              8380,
344
              'manat sign'
345
            ],
346
            [
347
              8381,
348
              'ruble sign'
349
            ],
350
            [
351
              20870,
352
              'yen character'
353
            ],
354
            [
355
              20803,
356
              'yuan character'
357
            ],
358
            [
359
              22291,
360
              'yuan character, in hong kong and taiwan'
361
            ],
362
            [
363
              22278,
364
              'yen/yuan character variant one'
365
            ]
366
          ]
367
        },
368
        {
369
          name: 'Text',
370
          characters: [
371
            [
372
              169,
373
              'copyright sign'
374
            ],
375
            [
376
              174,
377
              'registered sign'
378
            ],
379
            [
380
              8482,
381
              'trade mark sign'
382
            ],
383
            [
384
              8240,
385
              'per mille sign'
386
            ],
387
            [
388
              181,
389
              'micro sign'
390
            ],
391
            [
392
              183,
393
              'middle dot'
394
            ],
395
            [
396
              8226,
397
              'bullet'
398
            ],
399
            [
400
              8230,
401
              'three dot leader'
402
            ],
403
            [
404
              8242,
405
              'minutes / feet'
406
            ],
407
            [
408
              8243,
409
              'seconds / inches'
410
            ],
411
            [
412
              167,
413
              'section sign'
414
            ],
415
            [
416
              182,
417
              'paragraph sign'
418
            ],
419
            [
420
              223,
421
              'sharp s / ess-zed'
422
            ]
423
          ]
424
        },
425
        {
426
          name: 'Quotations',
427
          characters: [
428
            [
429
              8249,
430
              'single left-pointing angle quotation mark'
431
            ],
432
            [
433
              8250,
434
              'single right-pointing angle quotation mark'
435
            ],
436
            [
437
              171,
438
              'left pointing guillemet'
439
            ],
440
            [
441
              187,
442
              'right pointing guillemet'
443
            ],
444
            [
445
              8216,
446
              'left single quotation mark'
447
            ],
448
            [
449
              8217,
450
              'right single quotation mark'
451
            ],
452
            [
453
              8220,
454
              'left double quotation mark'
455
            ],
456
            [
457
              8221,
458
              'right double quotation mark'
459
            ],
460
            [
461
              8218,
462
              'single low-9 quotation mark'
463
            ],
464
            [
465
              8222,
466
              'double low-9 quotation mark'
467
            ],
468
            [
469
              60,
470
              'less-than sign'
471
            ],
472
            [
473
              62,
474
              'greater-than sign'
475
            ],
476
            [
477
              8804,
478
              'less-than or equal to'
479
            ],
480
            [
481
              8805,
482
              'greater-than or equal to'
483
            ],
484
            [
485
              8211,
486
              'en dash'
487
            ],
488
            [
489
              8212,
490
              'em dash'
491
            ],
492
            [
493
              175,
494
              'macron'
495
            ],
496
            [
497
              8254,
498
              'overline'
499
            ],
500
            [
501
              164,
502
              'currency sign'
503
            ],
504
            [
505
              166,
506
              'broken bar'
507
            ],
508
            [
509
              168,
510
              'diaeresis'
511
            ],
512
            [
513
              161,
514
              'inverted exclamation mark'
515
            ],
516
            [
517
              191,
518
              'turned question mark'
519
            ],
520
            [
521
              710,
522
              'circumflex accent'
523
            ],
524
            [
525
              732,
526
              'small tilde'
527
            ],
528
            [
529
              176,
530
              'degree sign'
531
            ],
532
            [
533
              8722,
534
              'minus sign'
535
            ],
536
            [
537
              177,
538
              'plus-minus sign'
539
            ],
540
            [
541
              247,
542
              'division sign'
543
            ],
544
            [
545
              8260,
546
              'fraction slash'
547
            ],
548
            [
549
              215,
550
              'multiplication sign'
551
            ],
552
            [
553
              185,
554
              'superscript one'
555
            ],
556
            [
557
              178,
558
              'superscript two'
559
            ],
560
            [
561
              179,
562
              'superscript three'
563
            ],
564
            [
565
              188,
566
              'fraction one quarter'
567
            ],
568
            [
569
              189,
570
              'fraction one half'
571
            ],
572
            [
573
              190,
574
              'fraction three quarters'
575
            ]
576
          ]
577
        },
578
        {
579
          name: 'Mathematical',
580
          characters: [
581
            [
582
              402,
583
              'function / florin'
584
            ],
585
            [
586
              8747,
587
              'integral'
588
            ],
589
            [
590
              8721,
591
              'n-ary sumation'
592
            ],
593
            [
594
              8734,
595
              'infinity'
596
            ],
597
            [
598
              8730,
599
              'square root'
600
            ],
601
            [
602
              8764,
603
              'similar to'
604
            ],
605
            [
606
              8773,
607
              'approximately equal to'
608
            ],
609
            [
610
              8776,
611
              'almost equal to'
612
            ],
613
            [
614
              8800,
615
              'not equal to'
616
            ],
617
            [
618
              8801,
619
              'identical to'
620
            ],
621
            [
622
              8712,
623
              'element of'
624
            ],
625
            [
626
              8713,
627
              'not an element of'
628
            ],
629
            [
630
              8715,
631
              'contains as member'
632
            ],
633
            [
634
              8719,
635
              'n-ary product'
636
            ],
637
            [
638
              8743,
639
              'logical and'
640
            ],
641
            [
642
              8744,
643
              'logical or'
644
            ],
645
            [
646
              172,
647
              'not sign'
648
            ],
649
            [
650
              8745,
651
              'intersection'
652
            ],
653
            [
654
              8746,
655
              'union'
656
            ],
657
            [
658
              8706,
659
              'partial differential'
660
            ],
661
            [
662
              8704,
663
              'for all'
664
            ],
665
            [
666
              8707,
667
              'there exists'
668
            ],
669
            [
670
              8709,
671
              'diameter'
672
            ],
673
            [
674
              8711,
675
              'backward difference'
676
            ],
677
            [
678
              8727,
679
              'asterisk operator'
680
            ],
681
            [
682
              8733,
683
              'proportional to'
684
            ],
685
            [
686
              8736,
687
              'angle'
688
            ]
689
          ]
690
        },
691
        {
692
          name: 'Extended Latin',
693
          characters: [
694
            [
695
              192,
696
              'A - grave'
697
            ],
698
            [
699
              193,
700
              'A - acute'
701
            ],
702
            [
703
              194,
704
              'A - circumflex'
705
            ],
706
            [
707
              195,
708
              'A - tilde'
709
            ],
710
            [
711
              196,
712
              'A - diaeresis'
713
            ],
714
            [
715
              197,
716
              'A - ring above'
717
            ],
718
            [
719
              256,
720
              'A - macron'
721
            ],
722
            [
723
              198,
724
              'ligature AE'
725
            ],
726
            [
727
              199,
728
              'C - cedilla'
729
            ],
730
            [
731
              200,
732
              'E - grave'
733
            ],
734
            [
735
              201,
736
              'E - acute'
737
            ],
738
            [
739
              202,
740
              'E - circumflex'
741
            ],
742
            [
743
              203,
744
              'E - diaeresis'
745
            ],
746
            [
747
              274,
748
              'E - macron'
749
            ],
750
            [
751
              204,
752
              'I - grave'
753
            ],
754
            [
755
              205,
756
              'I - acute'
757
            ],
758
            [
759
              206,
760
              'I - circumflex'
761
            ],
762
            [
763
              207,
764
              'I - diaeresis'
765
            ],
766
            [
767
              298,
768
              'I - macron'
769
            ],
770
            [
771
              208,
772
              'ETH'
773
            ],
774
            [
775
              209,
776
              'N - tilde'
777
            ],
778
            [
779
              210,
780
              'O - grave'
781
            ],
782
            [
783
              211,
784
              'O - acute'
785
            ],
786
            [
787
              212,
788
              'O - circumflex'
789
            ],
790
            [
791
              213,
792
              'O - tilde'
793
            ],
794
            [
795
              214,
796
              'O - diaeresis'
797
            ],
798
            [
799
              216,
800
              'O - slash'
801
            ],
802
            [
803
              332,
804
              'O - macron'
805
            ],
806
            [
807
              338,
808
              'ligature OE'
809
            ],
810
            [
811
              352,
812
              'S - caron'
813
            ],
814
            [
815
              217,
816
              'U - grave'
817
            ],
818
            [
819
              218,
820
              'U - acute'
821
            ],
822
            [
823
              219,
824
              'U - circumflex'
825
            ],
826
            [
827
              220,
828
              'U - diaeresis'
829
            ],
830
            [
831
              362,
832
              'U - macron'
833
            ],
834
            [
835
              221,
836
              'Y - acute'
837
            ],
838
            [
839
              376,
840
              'Y - diaeresis'
841
            ],
842
            [
843
              562,
844
              'Y - macron'
845
            ],
846
            [
847
              222,
848
              'THORN'
849
            ],
850
            [
851
              224,
852
              'a - grave'
853
            ],
854
            [
855
              225,
856
              'a - acute'
857
            ],
858
            [
859
              226,
860
              'a - circumflex'
861
            ],
862
            [
863
              227,
864
              'a - tilde'
865
            ],
866
            [
867
              228,
868
              'a - diaeresis'
869
            ],
870
            [
871
              229,
872
              'a - ring above'
873
            ],
874
            [
875
              257,
876
              'a - macron'
877
            ],
878
            [
879
              230,
880
              'ligature ae'
881
            ],
882
            [
883
              231,
884
              'c - cedilla'
885
            ],
886
            [
887
              232,
888
              'e - grave'
889
            ],
890
            [
891
              233,
892
              'e - acute'
893
            ],
894
            [
895
              234,
896
              'e - circumflex'
897
            ],
898
            [
899
              235,
900
              'e - diaeresis'
901
            ],
902
            [
903
              275,
904
              'e - macron'
905
            ],
906
            [
907
              236,
908
              'i - grave'
909
            ],
910
            [
911
              237,
912
              'i - acute'
913
            ],
914
            [
915
              238,
916
              'i - circumflex'
917
            ],
918
            [
919
              239,
920
              'i - diaeresis'
921
            ],
922
            [
923
              299,
924
              'i - macron'
925
            ],
926
            [
927
              240,
928
              'eth'
929
            ],
930
            [
931
              241,
932
              'n - tilde'
933
            ],
934
            [
935
              242,
936
              'o - grave'
937
            ],
938
            [
939
              243,
940
              'o - acute'
941
            ],
942
            [
943
              244,
944
              'o - circumflex'
945
            ],
946
            [
947
              245,
948
              'o - tilde'
949
            ],
950
            [
951
              246,
952
              'o - diaeresis'
953
            ],
954
            [
955
              248,
956
              'o slash'
957
            ],
958
            [
959
              333,
960
              'o macron'
961
            ],
962
            [
963
              339,
964
              'ligature oe'
965
            ],
966
            [
967
              353,
968
              's - caron'
969
            ],
970
            [
971
              249,
972
              'u - grave'
973
            ],
974
            [
975
              250,
976
              'u - acute'
977
            ],
978
            [
979
              251,
980
              'u - circumflex'
981
            ],
982
            [
983
              252,
984
              'u - diaeresis'
985
            ],
986
            [
987
              363,
988
              'u - macron'
989
            ],
990
            [
991
              253,
992
              'y - acute'
993
            ],
994
            [
995
              254,
996
              'thorn'
997
            ],
998
            [
999
              255,
1000
              'y - diaeresis'
1001
            ],
1002
            [
1003
              563,
1004
              'y - macron'
1005
            ],
1006
            [
1007
              913,
1008
              'Alpha'
1009
            ],
1010
            [
1011
              914,
1012
              'Beta'
1013
            ],
1014
            [
1015
              915,
1016
              'Gamma'
1017
            ],
1018
            [
1019
              916,
1020
              'Delta'
1021
            ],
1022
            [
1023
              917,
1024
              'Epsilon'
1025
            ],
1026
            [
1027
              918,
1028
              'Zeta'
1029
            ],
1030
            [
1031
              919,
1032
              'Eta'
1033
            ],
1034
            [
1035
              920,
1036
              'Theta'
1037
            ],
1038
            [
1039
              921,
1040
              'Iota'
1041
            ],
1042
            [
1043
              922,
1044
              'Kappa'
1045
            ],
1046
            [
1047
              923,
1048
              'Lambda'
1049
            ],
1050
            [
1051
              924,
1052
              'Mu'
1053
            ],
1054
            [
1055
              925,
1056
              'Nu'
1057
            ],
1058
            [
1059
              926,
1060
              'Xi'
1061
            ],
1062
            [
1063
              927,
1064
              'Omicron'
1065
            ],
1066
            [
1067
              928,
1068
              'Pi'
1069
            ],
1070
            [
1071
              929,
1072
              'Rho'
1073
            ],
1074
            [
1075
              931,
1076
              'Sigma'
1077
            ],
1078
            [
1079
              932,
1080
              'Tau'
1081
            ],
1082
            [
1083
              933,
1084
              'Upsilon'
1085
            ],
1086
            [
1087
              934,
1088
              'Phi'
1089
            ],
1090
            [
1091
              935,
1092
              'Chi'
1093
            ],
1094
            [
1095
              936,
1096
              'Psi'
1097
            ],
1098
            [
1099
              937,
1100
              'Omega'
1101
            ],
1102
            [
1103
              945,
1104
              'alpha'
1105
            ],
1106
            [
1107
              946,
1108
              'beta'
1109
            ],
1110
            [
1111
              947,
1112
              'gamma'
1113
            ],
1114
            [
1115
              948,
1116
              'delta'
1117
            ],
1118
            [
1119
              949,
1120
              'epsilon'
1121
            ],
1122
            [
1123
              950,
1124
              'zeta'
1125
            ],
1126
            [
1127
              951,
1128
              'eta'
1129
            ],
1130
            [
1131
              952,
1132
              'theta'
1133
            ],
1134
            [
1135
              953,
1136
              'iota'
1137
            ],
1138
            [
1139
              954,
1140
              'kappa'
1141
            ],
1142
            [
1143
              955,
1144
              'lambda'
1145
            ],
1146
            [
1147
              956,
1148
              'mu'
1149
            ],
1150
            [
1151
              957,
1152
              'nu'
1153
            ],
1154
            [
1155
              958,
1156
              'xi'
1157
            ],
1158
            [
1159
              959,
1160
              'omicron'
1161
            ],
1162
            [
1163
              960,
1164
              'pi'
1165
            ],
1166
            [
1167
              961,
1168
              'rho'
1169
            ],
1170
            [
1171
              962,
1172
              'final sigma'
1173
            ],
1174
            [
1175
              963,
1176
              'sigma'
1177
            ],
1178
            [
1179
              964,
1180
              'tau'
1181
            ],
1182
            [
1183
              965,
1184
              'upsilon'
1185
            ],
1186
            [
1187
              966,
1188
              'phi'
1189
            ],
1190
            [
1191
              967,
1192
              'chi'
1193
            ],
1194
            [
1195
              968,
1196
              'psi'
1197
            ],
1198
            [
1199
              969,
1200
              'omega'
1201
            ]
1202
          ]
1203
        },
1204
        {
1205
          name: 'Symbols',
1206
          characters: [
1207
            [
1208
              8501,
1209
              'alef symbol'
1210
            ],
1211
            [
1212
              982,
1213
              'pi symbol'
1214
            ],
1215
            [
1216
              8476,
1217
              'real part symbol'
1218
            ],
1219
            [
1220
              978,
1221
              'upsilon - hook symbol'
1222
            ],
1223
            [
1224
              8472,
1225
              'Weierstrass p'
1226
            ],
1227
            [
1228
              8465,
1229
              'imaginary part'
1230
            ]
1231
          ]
1232
        },
1233
        {
1234
          name: 'Arrows',
1235
          characters: [
1236
            [
1237
              8592,
1238
              'leftwards arrow'
1239
            ],
1240
            [
1241
              8593,
1242
              'upwards arrow'
1243
            ],
1244
            [
1245
              8594,
1246
              'rightwards arrow'
1247
            ],
1248
            [
1249
              8595,
1250
              'downwards arrow'
1251
            ],
1252
            [
1253
              8596,
1254
              'left right arrow'
1255
            ],
1256
            [
1257
              8629,
1258
              'carriage return'
1259
            ],
1260
            [
1261
              8656,
1262
              'leftwards double arrow'
1263
            ],
1264
            [
1265
              8657,
1266
              'upwards double arrow'
1267
            ],
1268
            [
1269
              8658,
1270
              'rightwards double arrow'
1271
            ],
1272
            [
1273
              8659,
1274
              'downwards double arrow'
1275
            ],
1276
            [
1277
              8660,
1278
              'left right double arrow'
1279
            ],
1280
            [
1281
              8756,
1282
              'therefore'
1283
            ],
1284
            [
1285
              8834,
1286
              'subset of'
1287
            ],
1288
            [
1289
              8835,
1290
              'superset of'
1291
            ],
1292
            [
1293
              8836,
1294
              'not a subset of'
1295
            ],
1296
            [
1297
              8838,
1298
              'subset of or equal to'
1299
            ],
1300
            [
1301
              8839,
1302
              'superset of or equal to'
1303
            ],
1304
            [
1305
              8853,
1306
              'circled plus'
1307
            ],
1308
            [
1309
              8855,
1310
              'circled times'
1311
            ],
1312
            [
1313
              8869,
1314
              'perpendicular'
1315
            ],
1316
            [
1317
              8901,
1318
              'dot operator'
1319
            ],
1320
            [
1321
              8968,
1322
              'left ceiling'
1323
            ],
1324
            [
1325
              8969,
1326
              'right ceiling'
1327
            ],
1328
            [
1329
              8970,
1330
              'left floor'
1331
            ],
1332
            [
1333
              8971,
1334
              'right floor'
1335
            ],
1336
            [
1337
              9001,
1338
              'left-pointing angle bracket'
1339
            ],
1340
            [
1341
              9002,
1342
              'right-pointing angle bracket'
1343
            ],
1344
            [
1345
              9674,
1346
              'lozenge'
1347
            ],
1348
            [
1349
              9824,
1350
              'black spade suit'
1351
            ],
1352
            [
1353
              9827,
1354
              'black club suit'
1355
            ],
1356
            [
1357
              9829,
1358
              'black heart suit'
1359
            ],
1360
            [
1361
              9830,
1362
              'black diamond suit'
1363
            ],
1364
            [
1365
              8194,
1366
              'en space'
1367
            ],
1368
            [
1369
              8195,
1370
              'em space'
1371
            ],
1372
            [
1373
              8201,
1374
              'thin space'
1375
            ],
1376
            [
1377
              8204,
1378
              'zero width non-joiner'
1379
            ],
1380
            [
1381
              8205,
1382
              'zero width joiner'
1383
            ],
1384
            [
1385
              8206,
1386
              'left-to-right mark'
1387
            ],
1388
            [
1389
              8207,
1390
              'right-to-left mark'
1391
            ]
1392
          ]
1393
        }
1394
      ];
1395
    };
1396
    const charmapFilter = charmap => {
1397
      return global.grep(charmap, item => {
1398
        return isArray(item) && item.length === 2;
1399
      });
1400
    };
1401
    const getCharsFromOption = optionValue => {
1402
      if (isArray(optionValue)) {
1403
        return charmapFilter(optionValue);
1404
      }
1405
      if (typeof optionValue === 'function') {
1406
        return optionValue();
1407
      }
1408
      return [];
1409
    };
1410
    const extendCharMap = (editor, charmap) => {
1411
      const userCharMap = getCharMap$1(editor);
1412
      if (userCharMap) {
1413
        charmap = [{
1414
            name: UserDefined,
1415
            characters: getCharsFromOption(userCharMap)
1416
          }];
1417
      }
1418
      const userCharMapAppend = getCharMapAppend(editor);
1419
      if (userCharMapAppend) {
1420
        const userDefinedGroup = global.grep(charmap, cg => cg.name === UserDefined);
1421
        if (userDefinedGroup.length) {
1422
          userDefinedGroup[0].characters = [
1423
            ...userDefinedGroup[0].characters,
1424
            ...getCharsFromOption(userCharMapAppend)
1425
          ];
1426
          return charmap;
1427
        }
1428
        return charmap.concat({
1429
          name: UserDefined,
1430
          characters: getCharsFromOption(userCharMapAppend)
1431
        });
1432
      }
1433
      return charmap;
1434
    };
1435
    const getCharMap = editor => {
1436
      const groups = extendCharMap(editor, getDefaultCharMap());
1437
      return groups.length > 1 ? [{
1438
          name: 'All',
1439
          characters: bind(groups, g => g.characters)
1440
        }].concat(groups) : groups;
1441
    };
1442
 
1443
    const get = editor => {
1444
      const getCharMap$1 = () => {
1445
        return getCharMap(editor);
1446
      };
1447
      const insertChar$1 = chr => {
1448
        insertChar(editor, chr);
1449
      };
1450
      return {
1451
        getCharMap: getCharMap$1,
1452
        insertChar: insertChar$1
1453
      };
1454
    };
1455
 
1456
    const Cell = initial => {
1457
      let value = initial;
1458
      const get = () => {
1459
        return value;
1460
      };
1461
      const set = v => {
1462
        value = v;
1463
      };
1464
      return {
1465
        get,
1466
        set
1467
      };
1468
    };
1469
 
1470
    const last = (fn, rate) => {
1471
      let timer = null;
1472
      const cancel = () => {
1473
        if (!isNull(timer)) {
1474
          clearTimeout(timer);
1475
          timer = null;
1476
        }
1477
      };
1478
      const throttle = (...args) => {
1479
        cancel();
1480
        timer = setTimeout(() => {
1481
          timer = null;
1482
          fn.apply(null, args);
1483
        }, rate);
1484
      };
1485
      return {
1486
        cancel,
1487
        throttle
1488
      };
1489
    };
1490
 
1491
    const contains = (str, substr, start = 0, end) => {
1492
      const idx = str.indexOf(substr, start);
1493
      if (idx !== -1) {
1494
        return isUndefined(end) ? true : idx + substr.length <= end;
1495
      } else {
1496
        return false;
1497
      }
1498
    };
1499
    const fromCodePoint = String.fromCodePoint;
1500
 
1501
    const charMatches = (charCode, name, lowerCasePattern) => {
1502
      if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) {
1503
        return true;
1504
      } else {
1505
        return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern);
1506
      }
1507
    };
1508
    const scan = (group, pattern) => {
1509
      const matches = [];
1510
      const lowerCasePattern = pattern.toLowerCase();
1511
      each(group.characters, g => {
1512
        if (charMatches(g[0], g[1], lowerCasePattern)) {
1513
          matches.push(g);
1514
        }
1515
      });
1516
      return map(matches, m => ({
1517
        text: m[1],
1518
        value: fromCodePoint(m[0]),
1519
        icon: fromCodePoint(m[0])
1520
      }));
1521
    };
1522
 
1523
    const patternName = 'pattern';
1524
    const open = (editor, charMap) => {
1525
      const makeGroupItems = () => [
1526
        {
1527
          label: 'Search',
1528
          type: 'input',
1529
          name: patternName
1530
        },
1531
        {
1532
          type: 'collection',
1533
          name: 'results'
1534
        }
1535
      ];
1536
      const makeTabs = () => map(charMap, charGroup => ({
1537
        title: charGroup.name,
1538
        name: charGroup.name,
1539
        items: makeGroupItems()
1540
      }));
1541
      const makePanel = () => ({
1542
        type: 'panel',
1543
        items: makeGroupItems()
1544
      });
1545
      const makeTabPanel = () => ({
1546
        type: 'tabpanel',
1547
        tabs: makeTabs()
1548
      });
1549
      const currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All');
1550
      const scanAndSet = (dialogApi, pattern) => {
1551
        find(charMap, group => group.name === currentTab.get()).each(f => {
1552
          const items = scan(f, pattern);
1553
          dialogApi.setData({ results: items });
1554
        });
1555
      };
1556
      const SEARCH_DELAY = 40;
1557
      const updateFilter = last(dialogApi => {
1558
        const pattern = dialogApi.getData().pattern;
1559
        scanAndSet(dialogApi, pattern);
1560
      }, SEARCH_DELAY);
1561
      const body = charMap.length === 1 ? makePanel() : makeTabPanel();
1562
      const initialData = {
1563
        pattern: '',
1564
        results: scan(charMap[0], '')
1565
      };
1566
      const bridgeSpec = {
1567
        title: 'Special Character',
1568
        size: 'normal',
1569
        body,
1570
        buttons: [{
1571
            type: 'cancel',
1572
            name: 'close',
1573
            text: 'Close',
1574
            primary: true
1575
          }],
1576
        initialData,
1577
        onAction: (api, details) => {
1578
          if (details.name === 'results') {
1579
            insertChar(editor, details.value);
1580
            api.close();
1581
          }
1582
        },
1583
        onTabChange: (dialogApi, details) => {
1584
          currentTab.set(details.newTabName);
1585
          updateFilter.throttle(dialogApi);
1586
        },
1587
        onChange: (dialogApi, changeData) => {
1588
          if (changeData.name === patternName) {
1589
            updateFilter.throttle(dialogApi);
1590
          }
1591
        }
1592
      };
1593
      const dialogApi = editor.windowManager.open(bridgeSpec);
1594
      dialogApi.focus(patternName);
1595
    };
1596
 
1597
    const register$1 = (editor, charMap) => {
1598
      editor.addCommand('mceShowCharmap', () => {
1599
        open(editor, charMap);
1600
      });
1601
    };
1602
 
1603
    const init = (editor, all) => {
1604
      editor.ui.registry.addAutocompleter('charmap', {
1605
        trigger: ':',
1606
        columns: 'auto',
1607
        minChars: 2,
1608
        fetch: (pattern, _maxResults) => new Promise((resolve, _reject) => {
1609
          resolve(scan(all, pattern));
1610
        }),
1611
        onAction: (autocompleteApi, rng, value) => {
1612
          editor.selection.setRng(rng);
1613
          editor.insertContent(value);
1614
          autocompleteApi.hide();
1615
        }
1616
      });
1617
    };
1618
 
1619
    const onSetupEditable = editor => api => {
1620
      const nodeChanged = () => {
1621
        api.setEnabled(editor.selection.isEditable());
1622
      };
1623
      editor.on('NodeChange', nodeChanged);
1624
      nodeChanged();
1625
      return () => {
1626
        editor.off('NodeChange', nodeChanged);
1627
      };
1628
    };
1629
    const register = editor => {
1630
      const onAction = () => editor.execCommand('mceShowCharmap');
1631
      editor.ui.registry.addButton('charmap', {
1632
        icon: 'insert-character',
1633
        tooltip: 'Special character',
1634
        onAction,
1635
        onSetup: onSetupEditable(editor)
1636
      });
1637
      editor.ui.registry.addMenuItem('charmap', {
1638
        icon: 'insert-character',
1639
        text: 'Special character...',
1640
        onAction,
1641
        onSetup: onSetupEditable(editor)
1642
      });
1643
    };
1644
 
1645
    var Plugin = () => {
1646
      global$1.add('charmap', editor => {
1647
        register$2(editor);
1648
        const charMap = getCharMap(editor);
1649
        register$1(editor, charMap);
1650
        register(editor);
1651
        init(editor, charMap[0]);
1652
        return get(editor);
1653
      });
1654
    };
1655
 
1656
    Plugin();
1657
 
1658
})();