Text");
57 | });
58 |
59 | it("format renders multiple in a text block", () => {
60 | expect(formatHTML("# Lorem\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\n## Quisque\nQuisque sit amet nisi quis eros cursus finibus quis sed nisl.\n"))
61 | .toContain('
Text");
70 | });
71 |
72 | it("format renders multiple in a text block", () => {
73 | expect(formatHTML("# Lorem\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\n## Quisque\nQuisque sit amet nisi quis eros cursus finibus quis sed nisl.\n"))
74 | .toContain('
95 | ```
96 |
97 | ### Creating new MDText object
98 | In case you want to control lifecycle of the dictionary object (instead of default singleton)
99 | it can be created with MDText constructor.
100 | ```js
101 | import { MDText } from 'i18n-react';
102 | let T = new MDText({...});
103 | let x = T.translate("path.to.string");
104 |
105 | ```
106 | ### Passing in the React Context
107 | MDText object can be passed in the react 16.3+ context. See examples/yaml for complete example.
108 | ```tsx
109 | import { MDText } from 'i18n-react';
110 | let MDTextContext = React.createContext();
111 | let Texts = new MDText({...});
112 |
113 |
114 | { (T) =>
115 |
116 | }
117 |
118 | ```
119 |
120 | ### Difference between Keys and Context
121 | Text attribute is a key that should point to string or JSON object, it has to be present in the language resource.
122 | Then if needed the context is used to disambiguate betwen multiple texts according to the following rules:
123 | 1. Exact match for the context value.
124 | 1. For numeric context values - key with range, e.g. 2..4 that matches context value.
125 | 1. Explicit default - '_' key.
126 | 1. First key.
127 |
128 | ### Missing translations
129 | By default if translation for the specified key is not present the key itself is returned
130 | to help you find the missing translation.
131 | This behaviour can be augmented by passing custom ``notFound`` value to setText options or MDText contructor.
132 |
133 | This value can be either a string, or a function returning a string.
134 | If it is a string, then it will be returned as is any time a key is missing.
135 | If you provide a function, then the function will be run with the missing key
136 | and context as arguments.
137 |
138 | ```js
139 | // "Not Found!" will replace all missing translations
140 | T.setTexts(translations, {
141 | notFound: 'Not Found!'
142 | })
143 |
144 | // "SomeKey <-- this guy" will appear instead
145 | T.setTexts(translations, {
146 | notFound: key => `${key} <-- this guy`
147 | })
148 |
149 | // you can combine this solution with markdown!
150 | T.setTexts(translations, {
151 | notFound: key => `**${key}**` // will render SomeKey
152 | })
153 | ```
154 |
155 | ### Function in translation
156 | Translation dictionaries can be extended with functions (as in notFound).
157 |
158 | ```js
159 | T.setTexts({
160 | a: 'A',
161 | n: (_key, ctx) => ctx ? `Number ${ctx}` : '',
162 | });
163 | T.translate('a')) // 'A'
164 | T.translate('n', { context: 9 })) // 'Number 9'
165 | ```
166 |
167 | ## Markdown syntax
168 |
169 | + ``*italic*`` *italic* - ```` **breaking change V1, ```` in V0**
170 | + ``_italic_`` _italic_ - ```` **breaking change V1, ```` in V0**
171 | + ``**bold**`` **bold** ```` *new - V1*
172 | + ``__bold__`` __bold__ ```` *new - V1*
173 | + ``~underlined~`` underlined ```` *new - V1*
174 | + ``~~strike~~`` ~~strike~~ ```` *new - V1*
175 | + ``\n`` New Line `` ``
176 | + ``[Paragraph 1][Paragraph 2]`` Multiple paragraphs ``
``
177 | + ``#``-``####`` Headers ``
-
``
178 | + \`\` \*as\*\_[IS]\_ \`\` Literal *new - V1*
179 |
180 | ### Unit tests are half-loaf documentation
181 | You are welcomed to consult examples folder and unit tests for usage details and examples.
182 |
183 | ## Breaking changes
184 | ### 0.7
185 | ##### Literal \`\` changed to better match GitHub
186 | Allows matching number of backticks (with optional whitespace) to form a literal. This allows quoting of the backtick pairs: ```` ``` `` ``` ```` => ``` `` ``` .
187 |
188 | ### 0.6
189 | ##### Literal \`\` in V1 syntax
190 | New \`\` syntax \`\` (in V1 only) to disable MD processing.
191 |
192 | ### 0.5
193 | ##### React 16+ required
194 | As React now allows fragments and strings in render the default behavior of ```` changed not to wrap the output into ```` when ``tag`` property is not specified.
195 |
196 | ### 0.4
197 | ##### New MD syntax
198 | The new MD flavor (aligned with github's Markdown) is added : V1. Opt-in for this release, will become default in the next major release.
199 | V1 introduces strike and underline, and rehabilitates ```` and ```` tags.
200 |
201 | ```yaml
202 | em: "an *italic* style"
203 | i: "an _italic_ style"
204 | strong: "a **bold** move"
205 | b: "a __bold__ move"
206 | u: "an ~underlined~ word"
207 | strike: "a ~~strike~~ out"
208 | ```
209 | To opt-in for the new syntax:
210 | ```js
211 | let T = new MDText(texts, { MDFlavor: 1 });
212 | // or for the singelton
213 | T.setTexts(require('../texts/texts-en.yml'), { MDFlavor: 1, notFound: 'NA' });
214 | ```
215 | #### notFound Deprecation
216 | MDText notFound property is deprecated - please switch to constructor or serTexts options.
217 |
218 | ### 0.3
219 | ##### Unknown Prop Warning
220 | React 15.2 is preparing to stop filtering HTML properties (https://fb.me/react-unknown-prop) - the feature that i18n relied upon for
221 | preventing interpolation variables from leaking into the DOM.
222 |
223 | Thus new syntax for passing variables is introduced:
224 | ```xml
225 |
226 | /* replaces */
227 |
228 | ```
229 | All tags passing to T.* anything beside ```text```, ```tag``` and ```context``` properties have to be updated or React 15.2 will cry annoyingly.
230 |
231 | ##### typescript 2.0 / ts@next typings
232 | Updated package.json contains all the info for the new typescript to get typings automatically.
233 |
234 | ### 0.2
235 | * ES6 style export (use default export explicitly for commonJS/UMD)
236 | * Stateless react components (shouldComponentUpdate optimization removed)
237 | * Default export (T above) no longer can be used as a react component (use T.text or T.span instead)
238 |
239 | ## Development
240 | #### Commands
241 | * Watch commonJS build: ```$ npm start```
242 | * Build commonJS/UMD version: ```$ npm run build```
243 | * Start dev server for examples: ```$ npm run examples``` (http://localhost:1818/webpack-dev-server/examples/)
244 | * Build examples: ```$ npm run build:examples```
245 | * Run tests (Firefox): ```$ npm test```
246 | * Watch tests (Chrome): ```$ npm run test:watch```
247 |
248 |
--------------------------------------------------------------------------------
/dist/i18n-react.umd.js:
--------------------------------------------------------------------------------
1 | (function webpackUniversalModuleDefinition(root, factory) {
2 | if(typeof exports === 'object' && typeof module === 'object')
3 | module.exports = factory(require("React"));
4 | else if(typeof define === 'function' && define.amd)
5 | define(["React"], factory);
6 | else if(typeof exports === 'object')
7 | exports["i18n-react"] = factory(require("React"));
8 | else
9 | root["i18n-react"] = factory(root["React"]);
10 | })(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
11 | return /******/ (function(modules) { // webpackBootstrap
12 | /******/ // The module cache
13 | /******/ var installedModules = {};
14 | /******/
15 | /******/ // The require function
16 | /******/ function __webpack_require__(moduleId) {
17 | /******/
18 | /******/ // Check if module is in cache
19 | /******/ if(installedModules[moduleId]) {
20 | /******/ return installedModules[moduleId].exports;
21 | /******/ }
22 | /******/ // Create a new module (and put it into the cache)
23 | /******/ var module = installedModules[moduleId] = {
24 | /******/ i: moduleId,
25 | /******/ l: false,
26 | /******/ exports: {}
27 | /******/ };
28 | /******/
29 | /******/ // Execute the module function
30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31 | /******/
32 | /******/ // Flag the module as loaded
33 | /******/ module.l = true;
34 | /******/
35 | /******/ // Return the exports of the module
36 | /******/ return module.exports;
37 | /******/ }
38 | /******/
39 | /******/
40 | /******/ // expose the modules object (__webpack_modules__)
41 | /******/ __webpack_require__.m = modules;
42 | /******/
43 | /******/ // expose the module cache
44 | /******/ __webpack_require__.c = installedModules;
45 | /******/
46 | /******/ // define getter function for harmony exports
47 | /******/ __webpack_require__.d = function(exports, name, getter) {
48 | /******/ if(!__webpack_require__.o(exports, name)) {
49 | /******/ Object.defineProperty(exports, name, {
50 | /******/ configurable: false,
51 | /******/ enumerable: true,
52 | /******/ get: getter
53 | /******/ });
54 | /******/ }
55 | /******/ };
56 | /******/
57 | /******/ // getDefaultExport function for compatibility with non-harmony modules
58 | /******/ __webpack_require__.n = function(module) {
59 | /******/ var getter = module && module.__esModule ?
60 | /******/ function getDefault() { return module['default']; } :
61 | /******/ function getModuleExports() { return module; };
62 | /******/ __webpack_require__.d(getter, 'a', getter);
63 | /******/ return getter;
64 | /******/ };
65 | /******/
66 | /******/ // Object.prototype.hasOwnProperty.call
67 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68 | /******/
69 | /******/ // __webpack_public_path__
70 | /******/ __webpack_require__.p = "";
71 | /******/
72 | /******/ // Load entry module and return exports
73 | /******/ return __webpack_require__(__webpack_require__.s = 0);
74 | /******/ })
75 | /************************************************************************/
76 | /******/ ([
77 | /* 0 */
78 | /***/ (function(module, exports, __webpack_require__) {
79 |
80 | "use strict";
81 |
82 | var __rest = (this && this.__rest) || function (s, e) {
83 | var t = {};
84 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
85 | t[p] = s[p];
86 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
87 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
88 | t[p[i]] = s[p[i]];
89 | return t;
90 | };
91 | exports.__esModule = true;
92 | var React = __webpack_require__(1);
93 | var mdflavors_1 = __webpack_require__(2);
94 | function isString(s) {
95 | return typeof s === 'string' || s instanceof String;
96 | }
97 | function isObject(o) {
98 | return typeof o === 'object';
99 | }
100 | function isFunction(o) {
101 | return typeof o === 'function';
102 | }
103 | function get(obj, path) {
104 | var spath = path.split('.');
105 | for (var i = 0, len = spath.length; i < len; i++) {
106 | if (!obj || !isObject(obj))
107 | return undefined;
108 | obj = obj[spath[i]];
109 | }
110 | return obj;
111 | }
112 | function first(o) {
113 | for (var k in o) {
114 | if (k != '__')
115 | return o[k];
116 | }
117 | }
118 | function flatten(l) {
119 | var r = [];
120 | var s = '';
121 | var flush = function () { return s && (r.push(s), s = ''); };
122 | for (var _i = 0, l_1 = l; _i < l_1.length; _i++) {
123 | var i = l_1[_i];
124 | if (i == null)
125 | continue;
126 | if (isString(i)) {
127 | s += i;
128 | }
129 | else {
130 | flush();
131 | r.push(i);
132 | }
133 | }
134 | flush();
135 | return r.length > 1 ? r : (r.length ? r[0] : null);
136 | }
137 | var matcher = /** @class */ (function () {
138 | function matcher(mdFlavor, inter, self) {
139 | this.mdFlavor = mdFlavor;
140 | this.inter = inter;
141 | this.self = self;
142 | }
143 | matcher.prototype.M = function (value) {
144 | if (!value)
145 | return null;
146 | var m = mdflavors_1.mdMatch(this.mdFlavor, value);
147 | if (!m)
148 | return value;
149 | var middle = null;
150 | switch (m.tag) {
151 | case "inter":
152 | middle = this.inter && this.inter(m.body);
153 | break;
154 | case "self":
155 | middle = this.self && this.self(m.body);
156 | break;
157 | case "literals":
158 | case "literal":
159 | middle = m.body;
160 | break;
161 | default:
162 | middle = React.createElement(m.tag, { key: m.tag + m.body }, this.M(m.body));
163 | break;
164 | }
165 | return flatten([this.M(m.head), middle, this.M(m.tail)]);
166 | };
167 | return matcher;
168 | }());
169 | function rangeHit(node, val) {
170 | for (var t in node) {
171 | if (!node.hasOwnProperty(t))
172 | continue;
173 | var range = t.match(/^(-?\d+)\.\.(-?\d+)$/);
174 | if (range && (+range[1] <= val && val <= +range[2])) {
175 | return node[t];
176 | }
177 | }
178 | }
179 | function resolveContextPath(node, p, path, context) {
180 | var key = path[p];
181 | var trans;
182 | if (key != null && context[key] != null) {
183 | trans = get(node, context[key].toString());
184 | if (trans == null && (+context[key]) === context[key]) {
185 | trans = rangeHit(node, +context[key]);
186 | }
187 | }
188 | if (trans == null)
189 | trans = node._;
190 | if (trans == null)
191 | trans = first(node);
192 | if (trans != null && !isString(trans)) {
193 | return resolveContextPath(trans, p + 1, path, context);
194 | }
195 | return trans;
196 | }
197 | function resolveContext(node, context) {
198 | if (context == null) {
199 | return resolveContextPath(node, 0, [], null);
200 | }
201 | else if (!isObject(context)) {
202 | return resolveContextPath(node, 0, ['_'], { _: context });
203 | }
204 | else {
205 | var ctx_keys = [];
206 | if (node.__) {
207 | ctx_keys = node.__.split('.');
208 | }
209 | else {
210 | for (var k in context) {
211 | if (!context.hasOwnProperty(k))
212 | continue;
213 | ctx_keys.push(k);
214 | }
215 | }
216 | return resolveContextPath(node, 0, ctx_keys, context);
217 | }
218 | }
219 | var MDText = /** @class */ (function () {
220 | function MDText(texts, opt) {
221 | this.texts = texts;
222 | this.MDFlavor = 0;
223 | // public access is deprecated
224 | this.notFound = undefined;
225 | this.p = this.factory('p');
226 | this.span = this.factory('span');
227 | this.li = this.factory('li');
228 | this.div = this.factory('div');
229 | this.button = this.factory('button');
230 | this.a = this.factory('a');
231 | this.text = this.factory(null);
232 | this.setOpts(opt);
233 | }
234 | MDText.prototype.setTexts = function (texts, opt) {
235 | this.texts = texts;
236 | this.setOpts(opt);
237 | };
238 | MDText.prototype.setOpts = function (opt) {
239 | if (!opt)
240 | return;
241 | if (opt.notFound !== undefined)
242 | this.notFound = opt.notFound;
243 | if (opt.MDFlavor !== undefined)
244 | this.MDFlavor = opt.MDFlavor;
245 | };
246 | MDText.prototype.interpolate = function (exp, vars) {
247 | var _a = exp.split(','), vn = _a[0], flags = _a[1];
248 | var v = get(vars, vn);
249 | if (v == null) {
250 | return null;
251 | }
252 | else if (React.isValidElement(v)) {
253 | return React.cloneElement(v, { key: 'r' });
254 | }
255 | var vs;
256 | if (flags && flags.match(/l/)) {
257 | vs = v.toLocaleString();
258 | }
259 | else {
260 | vs = v.toString();
261 | }
262 | return vs;
263 | };
264 | MDText.prototype.format = function (value, vars) {
265 | var _this = this;
266 | if (!value)
267 | return value;
268 | return new matcher(mdflavors_1.mdFlavors[this.MDFlavor], function (exp) { return _this.interpolate(exp, vars); }, function (exp) { return _this.translate(exp, vars); }).M(value);
269 | };
270 | MDText.prototype.translate = function (key, options) {
271 | if (!key)
272 | return key;
273 | var trans = get(this.texts, key);
274 | var context = options && options.context;
275 | if (trans != null && !(isString(trans) || isFunction(trans))) {
276 | trans = resolveContext(trans, context);
277 | }
278 | if (trans == null) {
279 | trans = (options && options.notFound !== undefined) ? options.notFound :
280 | this.notFound !== undefined ? this.notFound :
281 | key;
282 | }
283 | if (isFunction(trans)) {
284 | trans = trans(key, context);
285 | }
286 | return this.format(trans, options);
287 | };
288 | MDText.prototype.factory = function (tagF) {
289 | var _this = this;
290 | // name High Order Function for React Dev tools
291 | var MDText = function (props) {
292 | var text = props.text, tag = props.tag, restProps = __rest(props, ["text", "tag"]);
293 | var key;
294 | var options;
295 | if (text == null || isString(text)) {
296 | key = text;
297 | options = props;
298 | var notFound = restProps.notFound, context = restProps.context, rest2Props = __rest(restProps, ["notFound", "context"]);
299 | restProps = rest2Props;
300 | }
301 | else {
302 | key = text.key;
303 | options = text;
304 | }
305 | var aTag = tagF || tag;
306 | var translation = _this.translate(key, options);
307 | return aTag ?
308 | React.createElement(aTag, restProps, translation) :
309 | translation;
310 | };
311 | return MDText;
312 | };
313 | return MDText;
314 | }());
315 | exports.MDText = MDText;
316 | var singleton = new MDText(null);
317 | exports["default"] = singleton;
318 |
319 |
320 | /***/ }),
321 | /* 1 */
322 | /***/ (function(module, exports) {
323 |
324 | module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
325 |
326 | /***/ }),
327 | /* 2 */
328 | /***/ (function(module, exports, __webpack_require__) {
329 |
330 | "use strict";
331 |
332 | exports.__esModule = true;
333 | var R = {
334 | "`` ": [/^(.*?(?:(?!`).|^))(``+)\s(.*?)\s\2(?!`)(.*)$/, [1, 3, 4]],
335 | "``": [/^(.*?(?:(?!`).|^))(``+)(?!`)(.*?(?!`).)\2(?!`)(.*)$/, [1, 3, 4]],
336 | "*": /^(|.*?\W)\*(\S.*?)\*(|\W.*)$/,
337 | "**": /^(|.*?\W)\*\*(\S.*?)\*\*(|\W.*)$/,
338 | "_": /^(|.*?\W)_(\S.*?)_(|\W.*)$/,
339 | "__": /^(|.*?\W)__(\S.*?)__(|\W.*)$/,
340 | "~": /^(|.*?\W)~(\S.*?)~(|\W.*)$/,
341 | "~~": /^(|.*?\W)~~(\S.*?)~~(|\W.*)$/,
342 | "[]": /^(.*?)\[(.*?)\](.*)$/,
343 | "#": /^(|.*?(?=\n))\n*\s*#([^#].*?)#*\s*\n+([\S\s]*)$/,
344 | "##": /^(|.*?(?=\n))\n*\s*##([^#].*?)#*\s*\n+([\S\s]*)$/,
345 | "###": /^(|.*?(?=\n))\n*\s*###([^#].*?)#*\s*\n+([\S\s]*)$/,
346 | "####": /^(|.*?(?=\n))\n*\s*####([^#].*?)#*\s*\n+([\S\s]*)$/,
347 | "\n": /^(.*?)[^\S\n]*\n()[^\S\n]*([\s\S]*)$/,
348 | "{{}}": /^(.*?)\{\{(.*?)\}\}(.*)$/,
349 | "{}": /^(.*?)\{(.*?)\}(.*)$/,
350 | };
351 | exports.mdFlavors = [
352 | {
353 | maybe: /[\*_\{\[\n]/,
354 | tags: {
355 | strong: R["*"],
356 | em: R["_"],
357 | p: R["[]"],
358 | h1: R["#"],
359 | h2: R["##"],
360 | h3: R["###"],
361 | h4: R["####"],
362 | br: R["\n"],
363 | self: R["{{}}"],
364 | inter: R["{}"],
365 | }
366 | },
367 | {
368 | maybe: /[`\*_~\{\[\n]/,
369 | tags: {
370 | literals: R["`` "],
371 | literal: R["``"],
372 | strong: R["**"],
373 | em: R["*"],
374 | b: R["__"],
375 | i: R["_"],
376 | strike: R["~~"],
377 | u: R["~"],
378 | p: R["[]"],
379 | h1: R["#"],
380 | h2: R["##"],
381 | h3: R["###"],
382 | h4: R["####"],
383 | br: R["\n"],
384 | self: R["{{}}"],
385 | inter: R["{}"],
386 | }
387 | }
388 | ];
389 | function mdMatch(md, value) {
390 | if (!value.match(md.maybe))
391 | return null;
392 | var tags = md.tags;
393 | var match = null;
394 | for (var ctag in tags) {
395 | if (!tags.hasOwnProperty(ctag))
396 | continue;
397 | var rg = tags[ctag];
398 | var _a = rg instanceof RegExp ? [rg, [1, 2, 3]] : rg, regex = _a[0], groups = _a[1];
399 | var cmatch = regex.exec(value);
400 | if (cmatch) {
401 | if (match == null || cmatch[groups[0]].length < match.head.length) {
402 | match = { tag: ctag, head: cmatch[groups[0]], body: cmatch[groups[1]], tail: cmatch[groups[2]] };
403 | }
404 | }
405 | }
406 | return match;
407 | }
408 | exports.mdMatch = mdMatch;
409 |
410 |
411 | /***/ })
412 | /******/ ]);
413 | });
414 | //# sourceMappingURL=i18n-react.umd.js.map
--------------------------------------------------------------------------------
/dist/i18n-react.umd.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 28526bce190001f41438","webpack:///./src/i18n-react.ts","webpack:///external \"React\"","webpack:///./src/mdflavors.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iCAAiC;AAC9D,6BAA6B,iBAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sBAAsB;AAC3E;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,aAAa;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,qCAAqC,EAAE,kBAAkB,mCAAmC,EAAE;AAC/K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;;;;;;AC5OA,+C;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,EAAE,OAAO,EAAE;AAChC,OAAO,YAAY,OAAO;AAC1B;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,wBAAwB;AACxB;AACA,KAAK;AACL;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA","file":"i18n-react.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"React\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"i18n-react\"] = factory(require(\"React\"));\n\telse\n\t\troot[\"i18n-react\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 28526bce190001f41438","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nexports.__esModule = true;\nvar React = require(\"react\");\nvar mdflavors_1 = require(\"./mdflavors\");\nfunction isString(s) {\n return typeof s === 'string' || s instanceof String;\n}\nfunction isObject(o) {\n return typeof o === 'object';\n}\nfunction isFunction(o) {\n return typeof o === 'function';\n}\nfunction get(obj, path) {\n var spath = path.split('.');\n for (var i = 0, len = spath.length; i < len; i++) {\n if (!obj || !isObject(obj))\n return undefined;\n obj = obj[spath[i]];\n }\n return obj;\n}\nfunction first(o) {\n for (var k in o) {\n if (k != '__')\n return o[k];\n }\n}\nfunction flatten(l) {\n var r = [];\n var s = '';\n var flush = function () { return s && (r.push(s), s = ''); };\n for (var _i = 0, l_1 = l; _i < l_1.length; _i++) {\n var i = l_1[_i];\n if (i == null)\n continue;\n if (isString(i)) {\n s += i;\n }\n else {\n flush();\n r.push(i);\n }\n }\n flush();\n return r.length > 1 ? r : (r.length ? r[0] : null);\n}\nvar matcher = /** @class */ (function () {\n function matcher(mdFlavor, inter, self) {\n this.mdFlavor = mdFlavor;\n this.inter = inter;\n this.self = self;\n }\n matcher.prototype.M = function (value) {\n if (!value)\n return null;\n var m = mdflavors_1.mdMatch(this.mdFlavor, value);\n if (!m)\n return value;\n var middle = null;\n switch (m.tag) {\n case \"inter\":\n middle = this.inter && this.inter(m.body);\n break;\n case \"self\":\n middle = this.self && this.self(m.body);\n break;\n case \"literals\":\n case \"literal\":\n middle = m.body;\n break;\n default:\n middle = React.createElement(m.tag, { key: m.tag + m.body }, this.M(m.body));\n break;\n }\n return flatten([this.M(m.head), middle, this.M(m.tail)]);\n };\n return matcher;\n}());\nfunction rangeHit(node, val) {\n for (var t in node) {\n if (!node.hasOwnProperty(t))\n continue;\n var range = t.match(/^(-?\\d+)\\.\\.(-?\\d+)$/);\n if (range && (+range[1] <= val && val <= +range[2])) {\n return node[t];\n }\n }\n}\nfunction resolveContextPath(node, p, path, context) {\n var key = path[p];\n var trans;\n if (key != null && context[key] != null) {\n trans = get(node, context[key].toString());\n if (trans == null && (+context[key]) === context[key]) {\n trans = rangeHit(node, +context[key]);\n }\n }\n if (trans == null)\n trans = node._;\n if (trans == null)\n trans = first(node);\n if (trans != null && !isString(trans)) {\n return resolveContextPath(trans, p + 1, path, context);\n }\n return trans;\n}\nfunction resolveContext(node, context) {\n if (context == null) {\n return resolveContextPath(node, 0, [], null);\n }\n else if (!isObject(context)) {\n return resolveContextPath(node, 0, ['_'], { _: context });\n }\n else {\n var ctx_keys = [];\n if (node.__) {\n ctx_keys = node.__.split('.');\n }\n else {\n for (var k in context) {\n if (!context.hasOwnProperty(k))\n continue;\n ctx_keys.push(k);\n }\n }\n return resolveContextPath(node, 0, ctx_keys, context);\n }\n}\nvar MDText = /** @class */ (function () {\n function MDText(texts, opt) {\n this.texts = texts;\n this.MDFlavor = 0;\n // public access is deprecated\n this.notFound = undefined;\n this.p = this.factory('p');\n this.span = this.factory('span');\n this.li = this.factory('li');\n this.div = this.factory('div');\n this.button = this.factory('button');\n this.a = this.factory('a');\n this.text = this.factory(null);\n this.setOpts(opt);\n }\n MDText.prototype.setTexts = function (texts, opt) {\n this.texts = texts;\n this.setOpts(opt);\n };\n MDText.prototype.setOpts = function (opt) {\n if (!opt)\n return;\n if (opt.notFound !== undefined)\n this.notFound = opt.notFound;\n if (opt.MDFlavor !== undefined)\n this.MDFlavor = opt.MDFlavor;\n };\n MDText.prototype.interpolate = function (exp, vars) {\n var _a = exp.split(','), vn = _a[0], flags = _a[1];\n var v = get(vars, vn);\n if (v == null) {\n return null;\n }\n else if (React.isValidElement(v)) {\n return React.cloneElement(v, { key: 'r' });\n }\n var vs;\n if (flags && flags.match(/l/)) {\n vs = v.toLocaleString();\n }\n else {\n vs = v.toString();\n }\n return vs;\n };\n MDText.prototype.format = function (value, vars) {\n var _this = this;\n if (!value)\n return value;\n return new matcher(mdflavors_1.mdFlavors[this.MDFlavor], function (exp) { return _this.interpolate(exp, vars); }, function (exp) { return _this.translate(exp, vars); }).M(value);\n };\n MDText.prototype.translate = function (key, options) {\n if (!key)\n return key;\n var trans = get(this.texts, key);\n var context = options && options.context;\n if (trans != null && !(isString(trans) || isFunction(trans))) {\n trans = resolveContext(trans, context);\n }\n if (trans == null) {\n trans = (options && options.notFound !== undefined) ? options.notFound :\n this.notFound !== undefined ? this.notFound :\n key;\n }\n if (isFunction(trans)) {\n trans = trans(key, context);\n }\n return this.format(trans, options);\n };\n MDText.prototype.factory = function (tagF) {\n var _this = this;\n // name High Order Function for React Dev tools\n var MDText = function (props) {\n var text = props.text, tag = props.tag, restProps = __rest(props, [\"text\", \"tag\"]);\n var key;\n var options;\n if (text == null || isString(text)) {\n key = text;\n options = props;\n var notFound = restProps.notFound, context = restProps.context, rest2Props = __rest(restProps, [\"notFound\", \"context\"]);\n restProps = rest2Props;\n }\n else {\n key = text.key;\n options = text;\n }\n var aTag = tagF || tag;\n var translation = _this.translate(key, options);\n return aTag ?\n React.createElement(aTag, restProps, translation) :\n translation;\n };\n return MDText;\n };\n return MDText;\n}());\nexports.MDText = MDText;\nvar singleton = new MDText(null);\nexports[\"default\"] = singleton;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/i18n-react.ts\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 1\n// module chunks = 0","\"use strict\";\nexports.__esModule = true;\nvar R = {\n \"`` \": [/^(.*?(?:(?!`).|^))(``+)\\s(.*?)\\s\\2(?!`)(.*)$/, [1, 3, 4]],\n \"``\": [/^(.*?(?:(?!`).|^))(``+)(?!`)(.*?(?!`).)\\2(?!`)(.*)$/, [1, 3, 4]],\n \"*\": /^(|.*?\\W)\\*(\\S.*?)\\*(|\\W.*)$/,\n \"**\": /^(|.*?\\W)\\*\\*(\\S.*?)\\*\\*(|\\W.*)$/,\n \"_\": /^(|.*?\\W)_(\\S.*?)_(|\\W.*)$/,\n \"__\": /^(|.*?\\W)__(\\S.*?)__(|\\W.*)$/,\n \"~\": /^(|.*?\\W)~(\\S.*?)~(|\\W.*)$/,\n \"~~\": /^(|.*?\\W)~~(\\S.*?)~~(|\\W.*)$/,\n \"[]\": /^(.*?)\\[(.*?)\\](.*)$/,\n \"#\": /^(|.*?(?=\\n))\\n*\\s*#([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"##\": /^(|.*?(?=\\n))\\n*\\s*##([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"###\": /^(|.*?(?=\\n))\\n*\\s*###([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"####\": /^(|.*?(?=\\n))\\n*\\s*####([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"\\n\": /^(.*?)[^\\S\\n]*\\n()[^\\S\\n]*([\\s\\S]*)$/,\n \"{{}}\": /^(.*?)\\{\\{(.*?)\\}\\}(.*)$/,\n \"{}\": /^(.*?)\\{(.*?)\\}(.*)$/,\n};\nexports.mdFlavors = [\n {\n maybe: /[\\*_\\{\\[\\n]/,\n tags: {\n strong: R[\"*\"],\n em: R[\"_\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n },\n {\n maybe: /[`\\*_~\\{\\[\\n]/,\n tags: {\n literals: R[\"`` \"],\n literal: R[\"``\"],\n strong: R[\"**\"],\n em: R[\"*\"],\n b: R[\"__\"],\n i: R[\"_\"],\n strike: R[\"~~\"],\n u: R[\"~\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n }\n];\nfunction mdMatch(md, value) {\n if (!value.match(md.maybe))\n return null;\n var tags = md.tags;\n var match = null;\n for (var ctag in tags) {\n if (!tags.hasOwnProperty(ctag))\n continue;\n var rg = tags[ctag];\n var _a = rg instanceof RegExp ? [rg, [1, 2, 3]] : rg, regex = _a[0], groups = _a[1];\n var cmatch = regex.exec(value);\n if (cmatch) {\n if (match == null || cmatch[groups[0]].length < match.head.length) {\n match = { tag: ctag, head: cmatch[groups[0]], body: cmatch[groups[1]], tail: cmatch[groups[2]] };\n }\n }\n }\n return match;\n}\nexports.mdMatch = mdMatch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/mdflavors.ts\n// module id = 2\n// module chunks = 0"],"sourceRoot":""}
--------------------------------------------------------------------------------
/dist/i18n-react.umd.min.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///i18n-react.umd.min.js","webpack:///webpack/bootstrap 38508bf759147b08282a","webpack:///./src/i18n-react.ts","webpack:///external \"React\"","webpack:///./src/mdflavors.ts"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isString","String","isObject","isFunction","obj","path","spath","split","len","length","first","k","flatten","r","flush","push","_i","l_1","rangeHit","node","val","t","range","match","resolveContextPath","context","trans","key","toString","_","resolveContext","ctx_keys","__","__rest","e","indexOf","getOwnPropertySymbols","React","mdflavors_1","matcher","mdFlavor","inter","self","M","value","mdMatch","middle","tag","body","createElement","head","tail","MDText","texts","opt","MDFlavor","notFound","undefined","span","li","div","button","a","text","setOpts","setTexts","interpolate","exp","vars","_a","vn","flags","v","isValidElement","cloneElement","toLocaleString","format","_this","mdFlavors","translate","options","tagF","props","restProps","aTag","translation","singleton","md","maybe","tags","ctag","rg","RegExp","regex","groups","cmatch","exec","R","`` ","``","*","**","~","~~","[]","#","##","###","####","\n","{{}}","{}","strong","em","h1","h2","h3","h4","br","literals","literal","b","strike","u"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,cAAAD,EAAAG,QAAA,UAEAJ,EAAA,cAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAZ,WAUA,OANAO,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,GAAA,EAGAX,EAAAD,QAvBA,GAAAU,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAhB,EAAAiB,EAAAC,GACAV,EAAAW,EAAAnB,EAAAiB,IACAG,OAAAC,eAAArB,EAAAiB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAxB,GACA,GAAAiB,GAAAjB,KAAAyB,WACA,WAA2B,MAAAzB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAO,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GA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AAvB,EAAA,MACAe,OAAAf,EAAA,MACAgB,GAAAhB,EAAA,KACAwB,EAAAxB,EAAA,GACAvH,EAAAuH,EAAA,EACAyB,OAAAzB,EAAA,MACA0B,EAAA1B,EAAA,KACAnG,EAAAmG,EAAA,MACAiB,GAAAjB,EAAA,KACAkB,GAAAlB,EAAA,MACAmB,GAAAnB,EAAA,OACAoB,GAAApB,EAAA,QACAqB,GAAArB,EAAA,MACAvD,KAAAuD,EAAA,QACAxD,MAAAwD,EAAA,SAuBAlI,EAAA8E","file":"i18n-react.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"React\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"i18n-react\"] = factory(require(\"React\"));\n\telse\n\t\troot[\"i18n-react\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"React\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"i18n-react\"] = factory(require(\"React\"));\n\telse\n\t\troot[\"i18n-react\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nexports.__esModule = true;\nvar React = __webpack_require__(1);\nvar mdflavors_1 = __webpack_require__(2);\nfunction isString(s) {\n return typeof s === 'string' || s instanceof String;\n}\nfunction isObject(o) {\n return typeof o === 'object';\n}\nfunction isFunction(o) {\n return typeof o === 'function';\n}\nfunction get(obj, path) {\n var spath = path.split('.');\n for (var i = 0, len = spath.length; i < len; i++) {\n if (!obj || !isObject(obj))\n return undefined;\n obj = obj[spath[i]];\n }\n return obj;\n}\nfunction first(o) {\n for (var k in o) {\n if (k != '__')\n return o[k];\n }\n}\nfunction flatten(l) {\n var r = [];\n var s = '';\n var flush = function () { return s && (r.push(s), s = ''); };\n for (var _i = 0, l_1 = l; _i < l_1.length; _i++) {\n var i = l_1[_i];\n if (i == null)\n continue;\n if (isString(i)) {\n s += i;\n }\n else {\n flush();\n r.push(i);\n }\n }\n flush();\n return r.length > 1 ? r : (r.length ? r[0] : null);\n}\nvar matcher = /** @class */ (function () {\n function matcher(mdFlavor, inter, self) {\n this.mdFlavor = mdFlavor;\n this.inter = inter;\n this.self = self;\n }\n matcher.prototype.M = function (value) {\n if (!value)\n return null;\n var m = mdflavors_1.mdMatch(this.mdFlavor, value);\n if (!m)\n return value;\n var middle = null;\n switch (m.tag) {\n case \"inter\":\n middle = this.inter && this.inter(m.body);\n break;\n case \"self\":\n middle = this.self && this.self(m.body);\n break;\n case \"literals\":\n case \"literal\":\n middle = m.body;\n break;\n default:\n middle = React.createElement(m.tag, { key: m.tag + m.body }, this.M(m.body));\n break;\n }\n return flatten([this.M(m.head), middle, this.M(m.tail)]);\n };\n return matcher;\n}());\nfunction rangeHit(node, val) {\n for (var t in node) {\n if (!node.hasOwnProperty(t))\n continue;\n var range = t.match(/^(-?\\d+)\\.\\.(-?\\d+)$/);\n if (range && (+range[1] <= val && val <= +range[2])) {\n return node[t];\n }\n }\n}\nfunction resolveContextPath(node, p, path, context) {\n var key = path[p];\n var trans;\n if (key != null && context[key] != null) {\n trans = get(node, context[key].toString());\n if (trans == null && (+context[key]) === context[key]) {\n trans = rangeHit(node, +context[key]);\n }\n }\n if (trans == null)\n trans = node._;\n if (trans == null)\n trans = first(node);\n if (trans != null && !isString(trans)) {\n return resolveContextPath(trans, p + 1, path, context);\n }\n return trans;\n}\nfunction resolveContext(node, context) {\n if (context == null) {\n return resolveContextPath(node, 0, [], null);\n }\n else if (!isObject(context)) {\n return resolveContextPath(node, 0, ['_'], { _: context });\n }\n else {\n var ctx_keys = [];\n if (node.__) {\n ctx_keys = node.__.split('.');\n }\n else {\n for (var k in context) {\n if (!context.hasOwnProperty(k))\n continue;\n ctx_keys.push(k);\n }\n }\n return resolveContextPath(node, 0, ctx_keys, context);\n }\n}\nvar MDText = /** @class */ (function () {\n function MDText(texts, opt) {\n this.texts = texts;\n this.MDFlavor = 0;\n // public access is deprecated\n this.notFound = undefined;\n this.p = this.factory('p');\n this.span = this.factory('span');\n this.li = this.factory('li');\n this.div = this.factory('div');\n this.button = this.factory('button');\n this.a = this.factory('a');\n this.text = this.factory(null);\n this.setOpts(opt);\n }\n MDText.prototype.setTexts = function (texts, opt) {\n this.texts = texts;\n this.setOpts(opt);\n };\n MDText.prototype.setOpts = function (opt) {\n if (!opt)\n return;\n if (opt.notFound !== undefined)\n this.notFound = opt.notFound;\n if (opt.MDFlavor !== undefined)\n this.MDFlavor = opt.MDFlavor;\n };\n MDText.prototype.interpolate = function (exp, vars) {\n var _a = exp.split(','), vn = _a[0], flags = _a[1];\n var v = get(vars, vn);\n if (v == null) {\n return null;\n }\n else if (React.isValidElement(v)) {\n return React.cloneElement(v, { key: 'r' });\n }\n var vs;\n if (flags && flags.match(/l/)) {\n vs = v.toLocaleString();\n }\n else {\n vs = v.toString();\n }\n return vs;\n };\n MDText.prototype.format = function (value, vars) {\n var _this = this;\n if (!value)\n return value;\n return new matcher(mdflavors_1.mdFlavors[this.MDFlavor], function (exp) { return _this.interpolate(exp, vars); }, function (exp) { return _this.translate(exp, vars); }).M(value);\n };\n MDText.prototype.translate = function (key, options) {\n if (!key)\n return key;\n var trans = get(this.texts, key);\n var context = options && options.context;\n if (trans != null && !(isString(trans) || isFunction(trans))) {\n trans = resolveContext(trans, context);\n }\n if (trans == null) {\n trans = (options && options.notFound !== undefined) ? options.notFound :\n this.notFound !== undefined ? this.notFound :\n key;\n }\n if (isFunction(trans)) {\n trans = trans(key, context);\n }\n return this.format(trans, options);\n };\n MDText.prototype.factory = function (tagF) {\n var _this = this;\n // name High Order Function for React Dev tools\n var MDText = function (props) {\n var text = props.text, tag = props.tag, restProps = __rest(props, [\"text\", \"tag\"]);\n var key;\n var options;\n if (text == null || isString(text)) {\n key = text;\n options = props;\n var notFound = restProps.notFound, context = restProps.context, rest2Props = __rest(restProps, [\"notFound\", \"context\"]);\n restProps = rest2Props;\n }\n else {\n key = text.key;\n options = text;\n }\n var aTag = tagF || tag;\n var translation = _this.translate(key, options);\n return aTag ?\n React.createElement(aTag, restProps, translation) :\n translation;\n };\n return MDText;\n };\n return MDText;\n}());\nexports.MDText = MDText;\nvar singleton = new MDText(null);\nexports[\"default\"] = singleton;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nexports.__esModule = true;\nvar R = {\n \"`` \": [/^(.*?(?:(?!`).|^))(``+)\\s(.*?)\\s\\2(?!`)(.*)$/, [1, 3, 4]],\n \"``\": [/^(.*?(?:(?!`).|^))(``+)(?!`)(.*?(?!`).)\\2(?!`)(.*)$/, [1, 3, 4]],\n \"*\": /^(|.*?\\W)\\*(\\S.*?)\\*(|\\W.*)$/,\n \"**\": /^(|.*?\\W)\\*\\*(\\S.*?)\\*\\*(|\\W.*)$/,\n \"_\": /^(|.*?\\W)_(\\S.*?)_(|\\W.*)$/,\n \"__\": /^(|.*?\\W)__(\\S.*?)__(|\\W.*)$/,\n \"~\": /^(|.*?\\W)~(\\S.*?)~(|\\W.*)$/,\n \"~~\": /^(|.*?\\W)~~(\\S.*?)~~(|\\W.*)$/,\n \"[]\": /^(.*?)\\[(.*?)\\](.*)$/,\n \"#\": /^(|.*?(?=\\n))\\n*\\s*#([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"##\": /^(|.*?(?=\\n))\\n*\\s*##([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"###\": /^(|.*?(?=\\n))\\n*\\s*###([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"####\": /^(|.*?(?=\\n))\\n*\\s*####([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"\\n\": /^(.*?)[^\\S\\n]*\\n()[^\\S\\n]*([\\s\\S]*)$/,\n \"{{}}\": /^(.*?)\\{\\{(.*?)\\}\\}(.*)$/,\n \"{}\": /^(.*?)\\{(.*?)\\}(.*)$/,\n};\nexports.mdFlavors = [\n {\n maybe: /[\\*_\\{\\[\\n]/,\n tags: {\n strong: R[\"*\"],\n em: R[\"_\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n },\n {\n maybe: /[`\\*_~\\{\\[\\n]/,\n tags: {\n literals: R[\"`` \"],\n literal: R[\"``\"],\n strong: R[\"**\"],\n em: R[\"*\"],\n b: R[\"__\"],\n i: R[\"_\"],\n strike: R[\"~~\"],\n u: R[\"~\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n }\n];\nfunction mdMatch(md, value) {\n if (!value.match(md.maybe))\n return null;\n var tags = md.tags;\n var match = null;\n for (var ctag in tags) {\n if (!tags.hasOwnProperty(ctag))\n continue;\n var rg = tags[ctag];\n var _a = rg instanceof RegExp ? [rg, [1, 2, 3]] : rg, regex = _a[0], groups = _a[1];\n var cmatch = regex.exec(value);\n if (cmatch) {\n if (match == null || cmatch[groups[0]].length < match.head.length) {\n match = { tag: ctag, head: cmatch[groups[0]], body: cmatch[groups[1]], tail: cmatch[groups[2]] };\n }\n }\n }\n return match;\n}\nexports.mdMatch = mdMatch;\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// i18n-react.umd.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 38508bf759147b08282a","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nexports.__esModule = true;\nvar React = require(\"react\");\nvar mdflavors_1 = require(\"./mdflavors\");\nfunction isString(s) {\n return typeof s === 'string' || s instanceof String;\n}\nfunction isObject(o) {\n return typeof o === 'object';\n}\nfunction isFunction(o) {\n return typeof o === 'function';\n}\nfunction get(obj, path) {\n var spath = path.split('.');\n for (var i = 0, len = spath.length; i < len; i++) {\n if (!obj || !isObject(obj))\n return undefined;\n obj = obj[spath[i]];\n }\n return obj;\n}\nfunction first(o) {\n for (var k in o) {\n if (k != '__')\n return o[k];\n }\n}\nfunction flatten(l) {\n var r = [];\n var s = '';\n var flush = function () { return s && (r.push(s), s = ''); };\n for (var _i = 0, l_1 = l; _i < l_1.length; _i++) {\n var i = l_1[_i];\n if (i == null)\n continue;\n if (isString(i)) {\n s += i;\n }\n else {\n flush();\n r.push(i);\n }\n }\n flush();\n return r.length > 1 ? r : (r.length ? r[0] : null);\n}\nvar matcher = /** @class */ (function () {\n function matcher(mdFlavor, inter, self) {\n this.mdFlavor = mdFlavor;\n this.inter = inter;\n this.self = self;\n }\n matcher.prototype.M = function (value) {\n if (!value)\n return null;\n var m = mdflavors_1.mdMatch(this.mdFlavor, value);\n if (!m)\n return value;\n var middle = null;\n switch (m.tag) {\n case \"inter\":\n middle = this.inter && this.inter(m.body);\n break;\n case \"self\":\n middle = this.self && this.self(m.body);\n break;\n case \"literals\":\n case \"literal\":\n middle = m.body;\n break;\n default:\n middle = React.createElement(m.tag, { key: m.tag + m.body }, this.M(m.body));\n break;\n }\n return flatten([this.M(m.head), middle, this.M(m.tail)]);\n };\n return matcher;\n}());\nfunction rangeHit(node, val) {\n for (var t in node) {\n if (!node.hasOwnProperty(t))\n continue;\n var range = t.match(/^(-?\\d+)\\.\\.(-?\\d+)$/);\n if (range && (+range[1] <= val && val <= +range[2])) {\n return node[t];\n }\n }\n}\nfunction resolveContextPath(node, p, path, context) {\n var key = path[p];\n var trans;\n if (key != null && context[key] != null) {\n trans = get(node, context[key].toString());\n if (trans == null && (+context[key]) === context[key]) {\n trans = rangeHit(node, +context[key]);\n }\n }\n if (trans == null)\n trans = node._;\n if (trans == null)\n trans = first(node);\n if (trans != null && !isString(trans)) {\n return resolveContextPath(trans, p + 1, path, context);\n }\n return trans;\n}\nfunction resolveContext(node, context) {\n if (context == null) {\n return resolveContextPath(node, 0, [], null);\n }\n else if (!isObject(context)) {\n return resolveContextPath(node, 0, ['_'], { _: context });\n }\n else {\n var ctx_keys = [];\n if (node.__) {\n ctx_keys = node.__.split('.');\n }\n else {\n for (var k in context) {\n if (!context.hasOwnProperty(k))\n continue;\n ctx_keys.push(k);\n }\n }\n return resolveContextPath(node, 0, ctx_keys, context);\n }\n}\nvar MDText = /** @class */ (function () {\n function MDText(texts, opt) {\n this.texts = texts;\n this.MDFlavor = 0;\n // public access is deprecated\n this.notFound = undefined;\n this.p = this.factory('p');\n this.span = this.factory('span');\n this.li = this.factory('li');\n this.div = this.factory('div');\n this.button = this.factory('button');\n this.a = this.factory('a');\n this.text = this.factory(null);\n this.setOpts(opt);\n }\n MDText.prototype.setTexts = function (texts, opt) {\n this.texts = texts;\n this.setOpts(opt);\n };\n MDText.prototype.setOpts = function (opt) {\n if (!opt)\n return;\n if (opt.notFound !== undefined)\n this.notFound = opt.notFound;\n if (opt.MDFlavor !== undefined)\n this.MDFlavor = opt.MDFlavor;\n };\n MDText.prototype.interpolate = function (exp, vars) {\n var _a = exp.split(','), vn = _a[0], flags = _a[1];\n var v = get(vars, vn);\n if (v == null) {\n return null;\n }\n else if (React.isValidElement(v)) {\n return React.cloneElement(v, { key: 'r' });\n }\n var vs;\n if (flags && flags.match(/l/)) {\n vs = v.toLocaleString();\n }\n else {\n vs = v.toString();\n }\n return vs;\n };\n MDText.prototype.format = function (value, vars) {\n var _this = this;\n if (!value)\n return value;\n return new matcher(mdflavors_1.mdFlavors[this.MDFlavor], function (exp) { return _this.interpolate(exp, vars); }, function (exp) { return _this.translate(exp, vars); }).M(value);\n };\n MDText.prototype.translate = function (key, options) {\n if (!key)\n return key;\n var trans = get(this.texts, key);\n var context = options && options.context;\n if (trans != null && !(isString(trans) || isFunction(trans))) {\n trans = resolveContext(trans, context);\n }\n if (trans == null) {\n trans = (options && options.notFound !== undefined) ? options.notFound :\n this.notFound !== undefined ? this.notFound :\n key;\n }\n if (isFunction(trans)) {\n trans = trans(key, context);\n }\n return this.format(trans, options);\n };\n MDText.prototype.factory = function (tagF) {\n var _this = this;\n // name High Order Function for React Dev tools\n var MDText = function (props) {\n var text = props.text, tag = props.tag, restProps = __rest(props, [\"text\", \"tag\"]);\n var key;\n var options;\n if (text == null || isString(text)) {\n key = text;\n options = props;\n var notFound = restProps.notFound, context = restProps.context, rest2Props = __rest(restProps, [\"notFound\", \"context\"]);\n restProps = rest2Props;\n }\n else {\n key = text.key;\n options = text;\n }\n var aTag = tagF || tag;\n var translation = _this.translate(key, options);\n return aTag ?\n React.createElement(aTag, restProps, translation) :\n translation;\n };\n return MDText;\n };\n return MDText;\n}());\nexports.MDText = MDText;\nvar singleton = new MDText(null);\nexports[\"default\"] = singleton;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/i18n-react.ts\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 1\n// module chunks = 0","\"use strict\";\nexports.__esModule = true;\nvar R = {\n \"`` \": [/^(.*?(?:(?!`).|^))(``+)\\s(.*?)\\s\\2(?!`)(.*)$/, [1, 3, 4]],\n \"``\": [/^(.*?(?:(?!`).|^))(``+)(?!`)(.*?(?!`).)\\2(?!`)(.*)$/, [1, 3, 4]],\n \"*\": /^(|.*?\\W)\\*(\\S.*?)\\*(|\\W.*)$/,\n \"**\": /^(|.*?\\W)\\*\\*(\\S.*?)\\*\\*(|\\W.*)$/,\n \"_\": /^(|.*?\\W)_(\\S.*?)_(|\\W.*)$/,\n \"__\": /^(|.*?\\W)__(\\S.*?)__(|\\W.*)$/,\n \"~\": /^(|.*?\\W)~(\\S.*?)~(|\\W.*)$/,\n \"~~\": /^(|.*?\\W)~~(\\S.*?)~~(|\\W.*)$/,\n \"[]\": /^(.*?)\\[(.*?)\\](.*)$/,\n \"#\": /^(|.*?(?=\\n))\\n*\\s*#([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"##\": /^(|.*?(?=\\n))\\n*\\s*##([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"###\": /^(|.*?(?=\\n))\\n*\\s*###([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"####\": /^(|.*?(?=\\n))\\n*\\s*####([^#].*?)#*\\s*\\n+([\\S\\s]*)$/,\n \"\\n\": /^(.*?)[^\\S\\n]*\\n()[^\\S\\n]*([\\s\\S]*)$/,\n \"{{}}\": /^(.*?)\\{\\{(.*?)\\}\\}(.*)$/,\n \"{}\": /^(.*?)\\{(.*?)\\}(.*)$/,\n};\nexports.mdFlavors = [\n {\n maybe: /[\\*_\\{\\[\\n]/,\n tags: {\n strong: R[\"*\"],\n em: R[\"_\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n },\n {\n maybe: /[`\\*_~\\{\\[\\n]/,\n tags: {\n literals: R[\"`` \"],\n literal: R[\"``\"],\n strong: R[\"**\"],\n em: R[\"*\"],\n b: R[\"__\"],\n i: R[\"_\"],\n strike: R[\"~~\"],\n u: R[\"~\"],\n p: R[\"[]\"],\n h1: R[\"#\"],\n h2: R[\"##\"],\n h3: R[\"###\"],\n h4: R[\"####\"],\n br: R[\"\\n\"],\n self: R[\"{{}}\"],\n inter: R[\"{}\"],\n }\n }\n];\nfunction mdMatch(md, value) {\n if (!value.match(md.maybe))\n return null;\n var tags = md.tags;\n var match = null;\n for (var ctag in tags) {\n if (!tags.hasOwnProperty(ctag))\n continue;\n var rg = tags[ctag];\n var _a = rg instanceof RegExp ? [rg, [1, 2, 3]] : rg, regex = _a[0], groups = _a[1];\n var cmatch = regex.exec(value);\n if (cmatch) {\n if (match == null || cmatch[groups[0]].length < match.head.length) {\n match = { tag: ctag, head: cmatch[groups[0]], body: cmatch[groups[1]], tail: cmatch[groups[2]] };\n }\n }\n }\n return match;\n}\nexports.mdMatch = mdMatch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/mdflavors.ts\n// module id = 2\n// module chunks = 0"],"sourceRoot":""}
--------------------------------------------------------------------------------