rosaenlg
Version:
A complete Natural Language Generation library based on Pug
135 lines (134 loc) • 149 kB
JavaScript
/**
* Bundle of RosaeNLG, for OTHER (render only)
* Version: 4.4.0
* SPDX-License-Identifier: Apache-2.0
* Copyright 2020, Ludan Stoecklé
* Generated: 2024-12-27
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rosaenlg_OTHER={})}(this,(function(e){"use strict";console.log("using RosaeNLG (Apache 2.0) version 4.4.0 for OTHER (render only)");var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}function n(e){return e&&e.default||e}var u=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.ValueManager=void 0;t.ValueManager=class{constructor(e,t,r,n,u,s,a,i,o,l){this.spy=void 0,this.languageImpl=e,this.refsManager=t,this.genderNumberManager=r,this.randomManager=n,this.adjectiveManager=u,this.helper=s,this.possessiveManager=a,this.synManager=i,this.simplifiedStringsCache=new Map,this.saveRollbackManager=o,this.constants=l}setSpy(e){this.spy=e}getSpy(){return this.spy}valueOfFirstParam(e,t){if("number"==typeof e)this.getSpy().appendPugHtml(this.valueNumber(e,t));else if("string"==typeof e)this.getSpy().appendPugHtml(this.valueString(e,t));else if(e instanceof Date)this.getSpy().appendPugHtml(this.valueDate(e,t?t.dateFormat:void 0));else if(e.isAnonymous);else if("object"==typeof e)this.valueObject(e,t);else{if("function"!=typeof e){const t=new Error;throw t.name="TypeError",t.message=`value not possible on: ${JSON.stringify(e)}`,t}e(t)}}value(e,t){if(null==e){const e=new Error;throw e.name="InvalidArgumentError",e.message="first parameter of value is null or undefined",e}if(function(e){return"string"==typeof e&&"<"===e.charAt(0)&&">"===e.charAt(e.length-1)}(e))return void this.valueSimplifiedString(e.substring(1,e.length-1),t);if(t&&t.owner){const r=Object.assign({},t);return r.owner=null,void this.possessiveManager.thirdPossession(t.owner,e,r)}const r=this.synManager.synFctHelper(e);this.valueOfFirstParam(r,t),t&&t.represents&&(this.genderNumberManager.setRefGender(t.represents,r,t),t.number&&this.genderNumberManager.setRefNumber(t.represents,t.number))}valueDate(e,t){if(this.saveRollbackManager.isEvaluatingEmpty)return"SOME_DATE";{const r=this.languageImpl.getFormattedDate(e,t),n=new RegExp(`[^${this.constants.tousCaracteresMinMajRe}].*`);return r.replace(n,"<protect>$&</protect>")}}valueSimplifiedString(e,t){if(this.saveRollbackManager.isEvaluatingEmpty)return void this.getSpy().appendPugHtml("SOME_STRING");let r;if(r=this.simplifiedStringsCache.get(e),!r)try{if(r=this.languageImpl.parseSimplifiedString(e),r.unknownNoun){if("M"!=r.gender&&"F"!=r.gender&&"N"!=r.gender){const e=new Error;throw e.name="NotFoundInDict",e.message=`${r.noun} is not in dict. Indicate a gender, M F or N!`,e}r.unknownNoun=!1}this.simplifiedStringsCache.set(e,r)}catch(t){const r=new Error;throw r.name="ParseError",r.message=`could not parse <${e}>: ${t.message}`,r}const n=Object.assign({},r,t);delete n.noun,t&&t.debug&&console.log(`DEBUG: <${e}> => ${JSON.stringify(r)} - final: ${r.noun} ${JSON.stringify(n)}`),this.value(r.noun,n)}getAdjPos(e){let t;if(e&&e.adjPos&&(t=e.adjPos,t&&"AFTER"!=t&&"BEFORE"!=t)){const e=new Error;throw e.name="InvalidArgumentError",e.message="adjective position must be either AFTER or BEFORE",e}return t||(t=this.languageImpl.defaultAdjPos),t}getAdjStringFromList(e,t,r,n,u){if(!r||0===r.length)return"";const s=[];for(const n of r)s.push(this.adjectiveManager.getAgreeAdj(n,e,{gender:t.gender,genderOwned:t.genderOwned,number:t.number,numberOwned:t.numberOwned,case:t.case,det:t.det,adjPos:u}));let a=null;if(s.length>1){let e;e=null!=n?n:this.languageImpl.getDefaultLastSeparatorForAdjectives(),a=this.helper.getSeparatingSpace()+e+this.helper.getSeparatingSpace()}switch(s.length){case 1:return s[0];case 2:return s.join(a);default:return s.slice(0,s.length-1).join(", ")+a+s[s.length-1]}}getAdjBeforeAndAfter(e,t){const r={before:"",after:""};if(t&&t.adj)if(t.adj.BEFORE||t.adj.AFTER){const n=t.adj;r.before=this.getAdjStringFromList(e,t,n.BEFORE,n.SEP_BEFORE,"BEFORE"),r.after=this.getAdjStringFromList(e,t,n.AFTER,n.SEP_AFTER,"AFTER")}else{let n=null;const u=this.getAdjPos(t);if("string"==typeof t.adj||t.adj instanceof String)n=this.getAdjStringFromList(e,t,[t.adj],void 0,u);else{if(!Array.isArray(t.adj)){const e=new Error;throw e.name="InvalidArgumentError",e.message="adj param has an invalid structure",e}n=this.getAdjStringFromList(e,t,t.adj,void 0,u)}switch(u){case"BEFORE":r.before=n;break;case"AFTER":r.after=n}}return r}valueString(e,t){if(this.saveRollbackManager.isEvaluatingEmpty)return"SOME_STRING";if(!t)return e;this.languageImpl.hasCase&&(t.case=t.case||this.languageImpl.defaultCase),(t.det||t.adj||t.possessiveAdj||t.represents)&&(t.genderOwned=this.genderNumberManager.getRefGender(e,t)),t.numberOwned=this.genderNumberManager.getRefNumber(null,t)||"S";const r=this.getAdjBeforeAndAfter(e,t),n=this.languageImpl.getSubstantive(e,t.numberOwned,t.case);let u="";t.possessiveAdj&&(u=this.adjectiveManager.getAgreeAdj(t.possessiveAdj,e,t));const s=this.languageImpl.getFormattedNominalGroup(u,r.before,n,r.after);let a="";if(t&&t.det){const e={genderOwned:t.genderOwned,numberOwned:t.numberOwned,genderOwner:t.genderOwner,numberOwner:t.numberOwner,personOwner:t.personOwner,case:t.case,dist:t.dist,after:s.trim(),useTheWhenPlural:t.useTheWhenPlural,adjectiveAfterDet:""!==r.before,forceDes:t.FORCE_DES};a=this.languageImpl.getDet(t.det,e)}return a?a+this.helper.getSeparatingSpace()+s:s}valueObject(e,t){this.refsManager.getNextRef(e)&&(this.randomManager.setRndNextPos(this.refsManager.getNextRef(e).rndNextPos),this.refsManager.deleteNextRef(e)),t&&"ref"===t.REPRESENTANT?this.valueRef(e,t):t&&"refexpr"===t.REPRESENTANT||this.refsManager.hasTriggeredRef(e)&&e.refexpr?this.valueRefexpr(e,t):this.valueRef(e,t)}valueRefexpr(e,t){null!==e.refexpr&&e.refexpr(e,t)}valueRef(e,t){if(!e.ref){const t=new Error;throw t.name="InvalidArgumentError",t.message=`${JSON.stringify(e)} has no ref mixin`,t}e.ref(e,t),this.refsManager.setTriggeredRef(e)}valueNumberAsIs(e){return this.helper.protectString(e.toString())}valueNumberFormat(e,t){return this.helper.protectString(this.languageImpl.getFormatNumberWithNumeral(e,t.FORMAT))}getGenderFromParams(e){return null!=e.agree?this.genderNumberManager.getRefGender(e.agree,e):"M"}valueNumberTextual(e,t){const r=this.getGenderFromParams(t);return this.languageImpl.getTextualNumber(e,r)}valueNumberOrdinalNumber(e,t){const r=this.getGenderFromParams(t);return this.helper.protectString(this.languageImpl.getOrdinalNumber(e,r))}valueNumberOrdinalTextual(e,t){if(e%1!=0){const t=new Error;throw t.name="InvalidArgumentError",t.message=`ORDINAL_TEXTUAL must be an integer, here ${e}`,t}const r=null!=t.agree?this.genderNumberManager.getRefGender(t.agree,t):"M";return this.languageImpl.getOrdinal(e,r)}valueNumber(e,t){if(this.saveRollbackManager.isEvaluatingEmpty)return"SOME_NUMBER";if(t){if(t.AS_IS)return this.valueNumberAsIs(e);if(t.FORMAT)return this.valueNumberFormat(e,t);if(t.TEXTUAL)return this.valueNumberTextual(e,t);if(t.ORDINAL_NUMBER)return this.valueNumberOrdinalNumber(e,t);if(t.ORDINAL_TEXTUAL)return this.valueNumberOrdinalTextual(e,t)}return this.helper.protectString(this.languageImpl.getStdFormatedNumber(e))}}})),s=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.SynManager=void 0;t.SynManager=class{constructor(e,t,r,n){this.spy=void 0,this.randomManager=e,this.saveRollbackManager=t,this.defaultSynoMode=n.defaultSynoMode,this.helper=r,this.synoSeq=new Map,this.synoTriggered=new Map}setSpy(e){this.spy=e}getSpy(){return this.spy}getSynoSeq(){return this.synoSeq}setSynoSeq(e){this.synoSeq=e}getSynoTriggered(){return this.synoTriggered}setSynoTriggered(e){this.synoTriggered=e}getSynoTriggeredOn(e){return this.synoTriggered.get(e)||[]}getNextSeqNotIn(e,t,r){const n=this.synoSeq.get(e);function u(e){return e>=t?1:e+1}let s=u(n||0);for(;r.indexOf(s)>-1;)s=u(s);return s}synFct(e){return 1==e.length?e[0]:e[Math.floor(this.randomManager.getNextRnd()*e.length)]}synFctHelper(e){return Array.isArray(e)?this.synFct(e):e}simpleSyn(e){const t=this.synFct(e);this.helper.insertValEscaped(t)}getToTest(e,t,r,n,u,s){switch(e){case"sequence":return{index:this.getNextSeqNotIn(r,n,s),exclude:s};case"once":{const e=this.randomManager.randomNotIn(n,u,s);if(e)return{index:e,exclude:s};{const e=this.getSynoTriggeredOn(r),t=s.filter((function(t){return-1==e.indexOf(t)})),a=[];if(e.length>1){const r=e[e.length-1];a.push(r),t.push(r)}return this.synoTriggered.set(r,a),{index:this.randomManager.randomNotIn(n,u,t),exclude:t}}}case"random":return{index:this.randomManager.randomNotIn(n,u,s),exclude:s}}}runSynz(e,t,r,n,u){const s=n.mode||this.defaultSynoMode;if(-1===["sequence","random","once"].indexOf(s)){const e=new Error;throw e.name="InvalidArgumentError",e.message=`invalid synonym mode: ${s}`,e}let a=null,i=null;if(u)a=u;else{if(a=[],"once"===s){const e=this.getSynoTriggeredOn(t);a=a.concat(e)}n.force&&(i=n.force)}if(null==i){const u=this.getToTest(s,e,t,r,n,a);i=u.index,a=u.exclude}if(null!=i){this.saveRollbackManager.saveSituation("isEmpty");const u=this.getSpy().getPugHtml();if(e(i,n),this.helper.htmlHasNotChanged(u))a.push(i),this.saveRollbackManager.rollback(),this.runSynz(e,t,r,n,a);else switch(this.saveRollbackManager.rollback(),this.helper.insertSeparatingSpaceIfRequired(),e(i,n),this.helper.insertSeparatingSpaceIfRequired(),s){case"random":break;case"sequence":this.synoSeq.set(t,i);break;case"once":{const e=this.synoTriggered.get(t)||[];e.push(i),this.synoTriggered.set(t,e);break}}}}}})),a=Object.freeze({__proto__:null,default:"This is virtual ./LanguageSynEnglish/OTHER/false!"}),i=Object.freeze({__proto__:null,default:"This is virtual ./LanguageSynFrench/OTHER/false!"}),o=Object.freeze({__proto__:null,default:"This is virtual ./LanguageSynGerman/OTHER/false!"}),l=Object.freeze({__proto__:null,default:"This is virtual ./LanguageSynItalian/OTHER/false!"}),D=Object.freeze({__proto__:null,default:"This is virtual ./LanguageSynSpanish/OTHER/false!"}),g=/\s+/g,c=/'/,d=/([a-z]+)('s)$/i,h=/([a-z]+s)(')$/i,f=[{regex:/"[^"]*"/g,category:"quoted_phrase"},{regex:/(?:https?:\/\/)(?:[\da-z\.-]+)\.(?:[a-z\.]{2,6})(?:[\/\w\.\-\?#=]*)*\/?/gi,category:"url"},{regex:/[-!#$%&'*+\/=?^\w{|}~](?:\.?[-!#$%&'*+\/=?^\w`{|}~])*@[a-z0-9](?:-?\.?[a-z0-9])*(?:\.[a-z](?:-?[a-z0-9])*)+/gi,category:"email"},{regex:/@\w+/g,category:"mention"},{regex:/#[a-z][a-z0-9]*/gi,category:"hashtag"},{regex:/#[\u0900-\u0963\u0970-\u097F][\u0900-\u0963\u0970-\u097F\u0966-\u096F0-9]*/gi,category:"hashtag"},{regex:/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g,category:"emoji"},{regex:/:-?[dps\*\/\[\]{}\(\)]|;-?[/(/)d]|<3/gi,category:"emoticon"},{regex:/(?:\d|[01]\d|2[0-3]):?(?:[0-5][0-9])?\s?(?:[ap]\.?m\.?|hours|hrs)/gi,category:"time"},{regex:/1\dth|[04-9]th|1st|2nd|3rd|[02-9]1st|[02-9]2nd|[02-9]3rd|[02-9][04-9]th|\d+\d[04-9]th|\d+\d1st|\d+\d2nd|\d+\d3rd/g,category:"ordinal"},{regex:/\d+\/\d+|\d(?:[\.,-\/]?\d)*(?:\.\d+)?/g,category:"number"},{regex:/[\u0966-\u096F]+\/[\u0966-\u096F]+|[\u0966-\u096F](?:[\.,-\/]?[\u0966-\u096F])*(?:\.[\u0966-\u096F]+)?/g,category:"number"},{regex:/[₿₽₹₨$£¥€₩]/g,category:"currency"},{regex:/[a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF][a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF']*/gi,category:"word"},{regex:/[\u0900-\u094F\u0951-\u0963\u0970-\u097F]+/gi,category:"word"},{regex:/[’'‘’`“”"\[\]\(\){}…,\.!;\?\-:\u0964\u0965]/g,category:"punctuation"},{regex:/[\u0950~@#%\^\+=\*\|\/<>&]/g,category:"symbol"}],m={emoticon:"c",email:"e",emoji:"j",hashtag:"h",mention:"m",number:"n",ordinal:"o",quoted_phrase:"q",currency:"r",time:"t",url:"u",word:"w",alien:"z"},p=function(){var e=f.slice(0),t=[],r=Object.create(null),n=function(e,t){var r,n="This is virtual ./eng-contractions.js/OTHER/false!"[e];return void 0===n?(r=e.match(d))||(r=e.match(h))?(t.push({value:r[1],tag:"word"}),t.push({value:r[2],tag:"word"})):t.push({value:e,tag:"word"}):(t.push(Object.assign({},n[0])),t.push(Object.assign({},n[1])),n[2]&&t.push(Object.assign({},n[2]))),t},u=function(e,r){var s,a,i,o=e.trim();if(r.length)for(s=function(e,t){var r,u,s,a,i=e.match(t.regex),o=e.split(t.regex),l=[],D=t.category,g=0;for(i=i||[],u=0,s=o.length;u<s;u+=1)(a=(a=o[u]).trim())&&l.push(a),g<i.length&&("word"===D?(r=i[g],c.test(r)?l=n(r,l):l.push({value:r,tag:D})):l.push({value:i[g],tag:D})),g+=1;return l}(o,r[0]),a=0,i=s.length;a<i;a+=1)"string"==typeof s[a]?u(s[a],r.slice(1)):t.push(s[a]);else e.split(g).forEach((function(e){t.push({value:e.trim(),tag:"alien"})}))},s=function(t){e="object"==typeof t&&Object.keys(t).length?f.filter((function(e){var r=t[e.category];return null==r||!!r})):[];const r=Object.create(null);return e.forEach((function(e){r[e.category]=!0})),m={emoticon:"c",email:"e",emoji:"j",hashtag:"h",mention:"m",number:"n",ordinal:"o",quoted_phrase:"q",currency:"r",time:"t",url:"u",word:"w",alien:"z"},Object.keys(r).length},a=function(e,t){if(m[e])throw new Error("Tag "+e+" already exists");m[e]=t};return s({quoted_phrase:!1}),r.defineConfig=s,r.tokenize=function(r){return t=[],u(r,e),t},r.getTokensFP=function(){var e=[];return t.forEach((function(t){e.push(m[t.tag]?m[t.tag]:t.value)})),e.join("")},r.addTag=a,r.addRegex=function(t,r,n){if(!m[r]&&!n)throw new Error("Tag "+r+" doesn't exist; Provide a 'fingerprintCode' to add it as a tag.");m[r]||a(r,n),e.unshift({regex:t,category:r})},r},E=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.Constants=void 0;const r="aeiouy",n={a:"àáâãäå",A:"ÀÁÂ",e:"èéêë",E:"ÈÉÊË",i:"ìíîï",I:"ÌÍÎÏ",o:"òóôõöø",O:"ÒÓÔÕÖØ",u:"ùúûü",U:"ÙÚÛÜ",y:"ÿ",c:"ç",C:"Ç",n:"ñ",N:"Ñ"};class u{constructor(e){this.toutesConsonnes="bcdfghjklmnpqrstvwxz",this.spaceOrNonBlockingClass="[\\s¤☞☜]",this.allPunctList=e,this.toutesVoyellesMinuscules=this.getToutesVoyellesMinuscules(),this.tousCaracteresMinusculesRe=this.getTousCaracteresMinusculesRe(),this.toutesVoyellesMajuscules=this.toutesVoyellesMinuscules.toUpperCase(),this.toutesVoyellesMinMaj=this.toutesVoyellesMinuscules+this.toutesVoyellesMajuscules,this.tousCaracteresMajusculesRe=this.tousCaracteresMinusculesRe.toUpperCase(),this.tousCaracteresMinMajRe=this.tousCaracteresMinusculesRe+"0-9"+this.tousCaracteresMajusculesRe+"\\-",this.stdBetweenWithParenthesis=`(${this.spaceOrNonBlockingClass}+|$)`,this.stdBeforeWithParenthesis=`([\\s¤☛☚☞☜${this.allPunctList}])`}getToutesVoyellesMinuscules(){let e=r;for(const t of r)e+=n[t];return e}getTousCaracteresMinusculesRe(){return"a-z"+this.toutesVoyellesMinuscules}getInBetween(e){return e?"§[\\s¤]*":""}}t.Constants=u,u.stdPunctList="\\.:!\\?;,…"})),b=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.DictManager=void 0;t.DictManager=class{constructor(e,t,r){this.iso2=e,this.validPropsWord=t,this.validPropsAdj=r,this.wordsData={},this.adjsData={}}setEmbeddedWords(e){this.wordsData=e}setEmbeddedAdj(e){this.adjsData=e}getWordData(){return this.wordsData}getAdjsData(){return this.adjsData}getAdjsWordsData(){return Object.assign(Object.assign({},this.adjsData),this.wordsData)}isValidPropWord(e){return this.validPropsWord.indexOf(e)>-1}isValidPropAdj(e){return this.validPropsAdj.indexOf(e)>-1}checkProp(e,t){if("word"===e&&!this.isValidPropWord(t)||"adj"===e&&!this.isValidPropAdj(t)){const r=new Error;throw r.name="InvalidArgumentError",r.message=`invalid property ${t} as ${e} in ${this.iso2}`,r}}setAdjData(e,t){this.adjsData[e]||(this.adjsData[e]={});const r=Object.keys(t);for(const n of r)this.checkProp("adj",n),this.adjsData[e][n]=t[n]}setWordData(e,t){this.wordsData[e]||(this.wordsData[e]={});const r=Object.keys(t);for(const n of r)this.checkProp("word",n),this.wordsData[e][n]=t[n]}}})),F=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageCommon=void 0;t.LanguageCommon=class{constructor(){this.iso2=null,this.validPropsWord=null,this.validPropsAdj=null,this.allPunctList=E.Constants.stdPunctList,this.constants=null,this.dictManager=null}init(){this.dictManager=new b.DictManager(this.iso2,this.validPropsWord,this.validPropsAdj),this.constants=new E.Constants(this.allPunctList)}setIso2(e){const t=new Error;throw t.name="InvalidArgumentException",t.message="cannot set iso2",t}getIso2(){return this.iso2}}})),v=Object.freeze({__proto__:null,default:"This is virtual ./LanguageCommonEnglish/OTHER/false!"}),C=Object.freeze({__proto__:null,default:"This is virtual ./LanguageCommonFrench/OTHER/false!"}),T=Object.freeze({__proto__:null,default:"This is virtual ./LanguageCommonGerman/OTHER/false!"}),O=Object.freeze({__proto__:null,default:"This is virtual ./LanguageCommonItalian/OTHER/false!"}),y=Object.freeze({__proto__:null,default:"This is virtual ./LanguageCommonSpanish/OTHER/false!"}),x=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageCommonOther=void 0;class r extends F.LanguageCommon{constructor(){super()}setIso2(e){this.iso2=e}}t.LanguageCommonOther=r})),M=n(v),S=n(C),j=n(T),R=n(O),w=n(y),A=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.buildLanguageCommon=t.getIso2fromLocale=void 0,t.getIso2fromLocale=function(e){if(e&&5==e.length)return e.substring(0,2);{const t=new Error;throw t.name="InvalidArgumentException",t.message=`${e} is not a valid locale, should be xx_YY (e.g. en_US)`,t}},t.buildLanguageCommon=function(e){let t;switch(e){case"en":t=new M.LanguageCommonEnglish,t.init();break;case"fr":t=new S.LanguageCommonFrench,t.init();break;case"de":t=new j.LanguageCommonGerman,t.init();break;case"it":t=new R.LanguageCommonItalian,t.init();break;case"es":t=new w.LanguageCommonSpanish,t.init();break;default:t=new x.LanguageCommonOther,t.setIso2(e),t.init()}return t}})),B=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.getIso2fromLocale=t.buildLanguageCommon=t.Constants=t.DictManager=t.LanguageCommonOther=t.LanguageCommonSpanish=t.LanguageCommonItalian=t.LanguageCommonGerman=t.LanguageCommonFrench=t.LanguageCommonEnglish=t.LanguageCommon=void 0,Object.defineProperty(t,"LanguageCommon",{enumerable:!0,get:function(){return F.LanguageCommon}}),Object.defineProperty(t,"LanguageCommonEnglish",{enumerable:!0,get:function(){return M.LanguageCommonEnglish}}),Object.defineProperty(t,"LanguageCommonFrench",{enumerable:!0,get:function(){return S.LanguageCommonFrench}}),Object.defineProperty(t,"LanguageCommonGerman",{enumerable:!0,get:function(){return j.LanguageCommonGerman}}),Object.defineProperty(t,"LanguageCommonItalian",{enumerable:!0,get:function(){return R.LanguageCommonItalian}}),Object.defineProperty(t,"LanguageCommonSpanish",{enumerable:!0,get:function(){return w.LanguageCommonSpanish}}),Object.defineProperty(t,"LanguageCommonOther",{enumerable:!0,get:function(){return x.LanguageCommonOther}}),Object.defineProperty(t,"DictManager",{enumerable:!0,get:function(){return b.DictManager}}),Object.defineProperty(t,"Constants",{enumerable:!0,get:function(){return E.Constants}}),Object.defineProperty(t,"buildLanguageCommon",{enumerable:!0,get:function(){return A.buildLanguageCommon}}),Object.defineProperty(t,"getIso2fromLocale",{enumerable:!0,get:function(){return A.getIso2fromLocale}})})),P=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.addCaps=t.quotes=t.parenthesis=t.cleanSpacesPunctuation=t.duplicatePunctuation=t.EATSPACE=void 0,t.EATSPACE="EATSPACE",t.duplicatePunctuation=function(e,t){let r=e;r=r.replace(/\.\.\./g,"…");const n=new RegExp(`([${t.constants.allPunctList}])((?:${t.constants.spaceOrNonBlockingClass}*[${B.Constants.stdPunctList}])*)`,"g");return r=r.replace(n,(function(e,t,r){const n=new RegExp(`[${B.Constants.stdPunctList}]`,"g");return`${t}${r.replace(n,(()=>""))}`})),r},t.cleanSpacesPunctuation=function(e,r){let n=e;if(n=n.replace(/\s{2,}/g," "),n=r.cleanSpacesPunctuation(n),r.cleanSpacesPunctuationDoDefault){const e=new RegExp(`(${r.constants.spaceOrNonBlockingClass}*)([${B.Constants.stdPunctList}])(${r.constants.spaceOrNonBlockingClass}*)`,"g");n=n.replace(e,((e,t,r,n)=>`${t.replace(/\s/g,"")}${r} ${n.replace(/\s/g,"")}`))}n=n.replace(/\s+☚/g,"☚"),n=n.replace(/☛\s+/g,"☛"),n=n.replace(/\s+☚/g,"☚"),n=n.trim();const u=new RegExp(`[\\s¤]*${t.EATSPACE}[\\s¤]*`,"g");return n=n.replace(u,""),n=r.cleanSpacesPunctuationCorrect(n),n},t.parenthesis=function(e,t){let r=e;r=r.replace(/\(\s+/g,"("),r=r.replace(/\s+\)/g,")");const n=new RegExp("["+t.constants.tousCaracteresMinMajRe+"]\\(","g");r=r.replace(n,(e=>e.charAt(0)+" ("));const u=new RegExp("\\)["+t.constants.tousCaracteresMinMajRe+"]","g");return r=r.replace(u,(e=>") "+e.charAt(1))),r},t.quotes=function(e){let t=e,r=!1;return t=t.replace(/(\s*)"(\s*)/g,(()=>r?(r=!1,'" '):(r=!0,' "'))),r&&console.log('WARNING: did find a starting " but not the ending one'),t=t.replace(/\(\s*"/g,(()=>' ("')),t=t.replace(/"\s*\)/g,(()=>'") ')),t},t.addCaps=function(e,t){let r=e;{const e=new RegExp(`(${"[\\.!\\?¡¿]"})(${t.constants.spaceOrNonBlockingClass}*)([${t.constants.tousCaracteresMinMajRe}])`,"g");r=r.replace(e,((e,t,r,n)=>`${t}${r.replace(/\s/g,"")} ${n.toUpperCase()}`))}r=t.addCapsSpecific(r);{const e=new RegExp(`([☛☚])(${t.constants.spaceOrNonBlockingClass}*)([${t.constants.tousCaracteresMinMajRe}])`,"g");r=r.replace(e,((e,t,r,n)=>`${t}${r.replace(/ /g,"")}${n.toUpperCase()}`))}return r}})),H=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.specialSpacesToNormalSpaces=t.cleanStructAfterUnprotect=t.cleanStruct=t.joinLines=void 0,t.joinLines=function(e){return e.replace(/[\n\r]/g," ")},t.cleanStruct=function(e,t){let r=e;const n=new RegExp(`☚([${t.allPunctList}\\s]+)☛`,"g");r=r.replace(n,(()=>"☚☛"));const u=new RegExp(`☚([${t.allPunctList}\\s]+)☚`,"g");return r=r.replace(u,(()=>"☚☚")),r=r.replace(/(\s*)(☞[☞\s]*)\s+/g,((e,t,r)=>`${t}${r.replace(/\s/g,"")}`)),r=r.replace(/\s+([☜\s]*☜)(\s*)/g,((e,t,r)=>`${t.replace(/\s/g,"")}${r}`)),r},t.cleanStructAfterUnprotect=function(e){let t=e;return t=t.replace(/<p>\.<\/p>/g,""),t},t.specialSpacesToNormalSpaces=function(e){return e.replace(/¤/g," ")}})),_=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.titlecase=void 0,t.titlecase=function(e,t){let r=e;const n=new RegExp("_TITLECASE_\\s*(.*?)\\s*_TITLECASE_","g");return r=r.replace(n,((e,r)=>t.titlecase(r))),r}})),I=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.protectBlocks=t.unprotect=t.ProtectMapping=void 0;class r{constructor(e,t){this.protectedString=e,this.mappings=t}}t.ProtectMapping=r,t.unprotect=function(e,t){let r=e;for(const e in t){const n=/¤/g;r=r.replace(e,t[e].replace(n,""))}return r},t.protectBlocks=function(e){const t={};let n=0;const u=e.replace(/§([^§]*)§/g,(function(e,r){const u="XESCAPED_SEQ_"+ ++n;return t[u]=r,u}));return new r(u,t)}})),N=r((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.processProtectHtmlTags=void 0;const r="<protect>",n="</protect>";function u(e,t=0,s=0){if(t>=e.length){if(s>0){const e=new Error;throw e.name="InternalError",e.message="<protect> tag without ending </protect> tag",e}return e}const a=e.indexOf(r,t),i=e.indexOf(n,t);if(0===s){if(-1!==i&&-1===a){const e=new Error;throw e.name="InternalError",e.message="unexpected </protect> tag",e}if(-1!==i&&i<a){const e=new Error;throw e.name="InternalError",e.message="unexpected </protect> tag",e}return-1===a&&-1===i?e:u(e,a+r.length,1)}if(-1===i){const e=new Error;throw e.name="InternalError",e.message="<protect> tag without ending </protect> tag",e}if(-1===a||i<a){if(1===s)return u(e,i+n.length,0);return u(e.substring(0,i)+e.substring(i+n.length),i,s-1)}return u(e.substring(0,a)+e.substring(a+r.length),a,s+1)}t.processProtectHtmlTags=function(e){return u(e).replace(/<protect>/g,"§").replace(/<\/protect>/g,"§")}})),k=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.changeRenderDebug=t.unProtectHtmlEscapeSeq=t.protectHtmlEscapeSeq=t.replacePlaceholders=t.replaceHtml=t.inlineElts=t.blockLevelElts=void 0,t.blockLevelElts=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","head","body","hr","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video","li_block","ul_block","ol_block"],t.inlineElts=["a","abbr","acronym","b","bdo","big","br","button","cite","code","dfn","em","i","img","input","kbd","label","map","object","output","q","samp","script","select","small","span","strong","sub","sup","textarea","time","tt","var","li_inline","ul_inline","ol_inline"],t.replaceHtml=function(e){const r={replaced:e,elts:[]};return r.replaced=r.replaced.replace(/<(\/?)([a-zA-Z1-9_-]+).*?>/g,(function(e,n,u){return"protect"===u?"/"===n?"</protect>":"<protect>":(r.elts.push(e),t.blockLevelElts.indexOf(u)>-1?"/"===n?"☚":"☛":"/"===n?"☜":"☞")})),r},t.replacePlaceholders=function(e,t){const r=e.replace(/[☛☚☞☜]/g,(function(){const e=t.shift();if(void 0===e){const e=new Error;throw e.name="InternalError",e.message="There are not enough html tags",e}return function(e){return(0,H.specialSpacesToNormalSpaces)(e.replace("_block","").replace("_inline",""))}(e)}));if(t.length>0){const e=new Error;throw e.name="InternalError",e.message=`There are left html tags: ${t}`,e}return r};const r={AMPROTECT:"&",LTPROTECT:"<",GTPROTECT:">"};t.protectHtmlEscapeSeq=function(e){let t=e;for(const e in r)t=t.replace(r[e],e);return t},t.unProtectHtmlEscapeSeq=function(e){let t=e;for(const e in r)t=t.replace(e,r[e]);return t},t.changeRenderDebug=function(e){return e.replace(/<span class="rosaenlg-debug" id="(.*?)"><\/span>/g,(function(e,t){return`<span class="rosaenlg-debug">${t}</span>`}))}})),L=Object.freeze({__proto__:null,default:"This is virtual ./LanguageFilterFrench/OTHER/false!"}),W=Object.freeze({__proto__:null,default:"This is virtual ./LanguageFilterSpanish/OTHER/false!"}),$=Object.freeze({__proto__:null,default:"This is virtual ./LanguageFilterEnglish/OTHER/false!"}),Y=Object.freeze({__proto__:null,default:"This is virtual ./LanguageFilterItalian/OTHER/false!"}),G=Object.freeze({__proto__:null,default:"This is virtual ./LanguageFilterGerman/OTHER/false!"}),U=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageFilter=void 0;t.LanguageFilter=class{constructor(e){this.cleanSpacesPunctuationDoDefault=null,this.languageCommon=e,this.dictManager=e.dictManager,this.constants=e.constants}contractions(e){return e}beforeProtect(e){return e}justBeforeUnprotect(e){return e}titlecase(e){const t=new Error;throw t.name="InvalidArgumentError",t.message=`titlecase is not available for ${this.languageCommon.getIso2()}`,t}cleanSpacesPunctuation(e){return e}cleanSpacesPunctuationCorrect(e){return e}addCapsSpecific(e){return e}contract2elts(e,t,r,n){const u=`[${e.substring(0,1)}|${e.substring(0,1).toUpperCase()}]${e.substring(1)}`,s=new RegExp(`${this.constants.stdBeforeWithParenthesis}(${u})${this.constants.stdBetweenWithParenthesis}${t}${this.constants.stdBetweenWithParenthesis}`,"g");return n.replace(s,(function(e,t,n,u,s){return`${t}${n.substring(0,1).toLowerCase()!=n.substring(0,1)?r.substring(0,1).toUpperCase()+r.substring(1):r}${u}${s}`}))}}})),V=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageFilterOther=void 0;class r extends U.LanguageFilter{constructor(e){super(e),this.cleanSpacesPunctuationDoDefault=!0}protectRawNumbers(e){return e}}t.LanguageFilterOther=r})),z=n(L),q=n(W),Q=n($),X=n(Y),Z=n(G),K=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.languageFilterFromLanguageCommon=void 0,t.languageFilterFromLanguageCommon=function(e){switch(e.getIso2()){case"fr":return new z.LanguageFilterFrench(e);case"de":return new Z.LanguageFilterGerman(e);case"it":return new X.LanguageFilterItalian(e);case"en":return new Q.LanguageFilterEnglish(e);case"es":return new q.LanguageFilterSpanish(e);default:return new V.LanguageFilterOther(e)}}})),J=r((function(e,r){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
var n=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),u=t&&t.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return u(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.filter=r.EATSPACE=r.inlineHtmlElts=r.blockLevelHtmlElts=void 0;const a=s(P),i=s(H),o=s(I),l=s(k);r.blockLevelHtmlElts=l.blockLevelElts,r.inlineHtmlElts=l.inlineElts,r.EATSPACE=a.EATSPACE,r.filter=function(e,t,r){const n=(0,K.languageFilterFromLanguageCommon)(t);let u=e;u=l.protectHtmlEscapeSeq(u);const s=l.replaceHtml(u);u=s.replaced,u="START. "+u,u=n.protectRawNumbers(u),u=(0,N.processProtectHtmlTags)(u),u=n.beforeProtect(u);const D=o.protectBlocks(u);return u=D.protectedString,u=i.joinLines(u),u=i.specialSpacesToNormalSpaces(u),u=a.duplicatePunctuation(u,n),u=n.contractions(u),u=i.cleanStruct(u,n.constants),u=a.parenthesis(u,n),u=a.quotes(u),u=a.cleanSpacesPunctuation(u,n),u=a.addCaps(u,n),u=function(e){let t=e;const r="Addventa",n=new RegExp(r,"g");return t=t.replace(n,r+" 👍"),t}(u),u=(0,_.titlecase)(u,n),u=n.justBeforeUnprotect(u),u=o.unprotect(u,D.mappings),u=u.replace(/^START([☞\s\.]+)/,((e,t)=>`${t.replace(/[\s\.]*/g,"")}`)),u=l.replacePlaceholders(u,s.elts),r.renderDebug&&(u=l.changeRenderDebug(u)),u=i.cleanStructAfterUnprotect(u),u=l.unProtectHtmlEscapeSeq(u),u=u.trim(),u}})),ee=r((function(e,r){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.LanguageSyn=void 0;const u=n(p);r.LanguageSyn=class{constructor(e,t){this.iso2=e,this.stemmer=t}extractWords(e){const t=new u.default;t.defineConfig({currency:!1,number:!1,punctuation:!1,symbol:!1,time:!1});const r=t.tokenize(e),n=[];return r.forEach((e=>{"alien"!=e.tag&&-1==J.blockLevelHtmlElts.indexOf(e.value)&&-1==J.inlineHtmlElts.indexOf(e.value)&&n.push(e.value)})),n}}})),te=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageSynOther=void 0;class r extends ee.LanguageSyn{constructor(e){super(e,null)}getStandardStopWords(){return[]}}t.LanguageSynOther=r})),re=n(a),ne=n(i),ue=n(o),se=n(l),ae=n(D),ie=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.buildLanguageSyn=t.getIso2fromLocale=void 0,t.getIso2fromLocale=function(e){return e.substring(0,2)},t.buildLanguageSyn=function(e){let t;switch(e){case"en":t=new re.LanguageSynEnglish;break;case"fr":t=new ne.LanguageSynFrench;break;case"de":t=new ue.LanguageSynGerman;break;case"it":t=new se.LanguageSynItalian;break;case"es":t=new ae.LanguageSynSpanish;break;default:t=new te.LanguageSynOther(e)}return t}})),oe=r((function(e,t){
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.SynOptimizer=void 0;t.SynOptimizer=class{constructor(e){this.languageSyn=(0,ie.buildLanguageSyn)((0,ie.getIso2fromLocale)(e))}getStopWords(e,t,r){let n;return n=r?r.slice(0):this.languageSyn.getStandardStopWords(),t&&(n=n.filter((e=>!t.includes(e)))),e&&(n=n.concat(e)),n.map((e=>e.toLowerCase()))}scoreAlternative(e,t,r,n,u,s){const a=this.getStopWords(t,r,n),i=this.getStemmedWords(e,a);s&&(s.filteredAlt=i);const o=this.getWordsWithPos(i,u,s);s&&(s.wordsWithPos={},Object.keys(o).forEach((e=>{o[e].length>1&&(s.wordsWithPos[e]=o[e])})));const l=this.getScore(o);return s&&(s.score=l),l}getStemmedWords(e,t){return this.languageSyn.extractWords(e).map((e=>e.toLowerCase())).filter((e=>!t.includes(e))).map((e=>this.stemWord(e)))}getBest(e,t,r,n,u){const s=[];return e.forEach((e=>{s.push(this.scoreAlternative(e,t,r,n,u,null))})),s.indexOf(Math.min(...s))}getScore(e){let t=0;return Object.keys(e).forEach((r=>{const n=e[r];for(let e=1;e<n.length;e++)t+=1/(n[e]-n[e-1])})),t}stemWord(e){return this.languageSyn.stemmer?this.