"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GRAPHEMS=exports.EnumRunesCode=exports.EnumCodeUnits=void 0,exports.betweenInclusive=betweenInclusive,exports.codePointFromSurrogatePair=codePointFromSurrogatePair,exports.runes=exports.default=runes,exports.isDiacriticalMark=isDiacriticalMark,exports.isFirstOfSurrogatePair=isFirstOfSurrogatePair,exports.isFitzpatrickModifier=isFitzpatrickModifier,exports.isGraphem=isGraphem,exports.isRegionalIndicator=isRegionalIndicator,exports.isVariationSelector=isVariationSelector,exports.isZeroWidthJoiner=isZeroWidthJoiner,exports.nextUnits=nextUnits,exports.substring=exports.substr=substring,function(r){r[r.HIGH_SURROGATE_START=55296]="HIGH_SURROGATE_START",r[r.HIGH_SURROGATE_END=56319]="HIGH_SURROGATE_END",r[r.LOW_SURROGATE_START=56320]="LOW_SURROGATE_START",r[r.REGIONAL_INDICATOR_START=127462]="REGIONAL_INDICATOR_START",r[r.REGIONAL_INDICATOR_END=127487]="REGIONAL_INDICATOR_END",r[r.FITZPATRICK_MODIFIER_START=127995]="FITZPATRICK_MODIFIER_START",r[r.FITZPATRICK_MODIFIER_END=127999]="FITZPATRICK_MODIFIER_END",r[r.VARIATION_MODIFIER_START=65024]="VARIATION_MODIFIER_START",r[r.VARIATION_MODIFIER_END=65039]="VARIATION_MODIFIER_END",r[r.DIACRITICAL_MARKS_START=8400]="DIACRITICAL_MARKS_START",r[r.DIACRITICAL_MARKS_END=8447]="DIACRITICAL_MARKS_END",r[r.ZWJ=8205]="ZWJ"}(i||(exports.EnumRunesCode=i={}));var i,r,t=exports.GRAPHEMS=Object.freeze([776,2359,2367,2984,3007,3021,3633,3635,3648,3657,4352,4449,4520]);function runes(r){if("string"!=typeof r)throw new TypeError("string cannot be undefined or null");for(var i=[],e=0,t=0;e<r.length;)isGraphem(r[e+(t+=nextUnits(e+t,r))])&&t++,isVariationSelector(r[e+t])&&t++,isDiacriticalMark(r[e+t])&&t++,isZeroWidthJoiner(r[e+t])?t++:(i.push(r.substring(e,e+t)),e+=t,t=0);return i}function nextUnits(r,i){var e=i[r];return isFirstOfSurrogatePair(e)&&r!==i.length-1?(e=e+i[r+1],i=i.substring(r+2,r+5),isRegionalIndicator(e)&&isRegionalIndicator(i)||isFitzpatrickModifier(i)?4:2):1}function isFirstOfSurrogatePair(r){return r&&betweenInclusive(r[0].charCodeAt(0),55296,56319)}function isRegionalIndicator(r){return betweenInclusive(codePointFromSurrogatePair(r),127462,127487)}function isFitzpatrickModifier(r){return betweenInclusive(codePointFromSurrogatePair(r),127995,127999)}function isVariationSelector(r){return"string"==typeof r&&betweenInclusive(r.charCodeAt(0),65024,65039)}function isDiacriticalMark(r){return"string"==typeof r&&betweenInclusive(r.charCodeAt(0),8400,8447)}function isGraphem(r){return"string"==typeof r&&t.includes(r.charCodeAt(0))}function isZeroWidthJoiner(r){return"string"==typeof r&&8205===r.charCodeAt(0)}function codePointFromSurrogatePair(r){return(r.charCodeAt(0)-55296<<10)+(r.charCodeAt(1)-56320)+65536}function betweenInclusive(r,i,e){return i<=r&&r<=e}function substring(r,i,e){var t=runes(r);return void 0===i?r:i>=t.length?"":(r=t.length-i,t.slice(i,t=i+r<(t=i+(void 0===e?r:e))?void 0:t).join(""))}!function(r){r[r.unit_1=1]="unit_1",r[r.unit_2=2]="unit_2",r[r.unit_4=4]="unit_4"}(r||(exports.EnumCodeUnits=r={}));