@ckeditor/ckeditor5-emoji 44.2.0-alpha.3 → 44.2.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/emoji.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={223:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji__categories-list{display:flex;justify-content:space-between;margin:0 var(--ck-spacing-large)}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text{border-width:0;border-bottom:2px solid transparent;font-size:var(--ck-font-size-big);min-height:var(--ck-font-size-big);min-width:var(--ck-font-size-big);padding:0}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text.ck-emoji__category-item.ck-on{border-bottom-color:var(--ck-color-base-active)}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text>span{margin:auto}",""]);const c=o},291:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,":root{--ck-emoji-grid-tile-size:27px}.ck.ck-emoji .ck.ck-emoji__tiles{border-top:1px solid var(--ck-color-base-border);max-height:265px;max-width:100%;overflow-x:hidden;overflow-y:auto}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--ck-emoji-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-small)}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile{border:0;font-size:1.5em;height:var(--ck-emoji-grid-tile-size);min-height:var(--ck-emoji-grid-tile-size);min-width:var(--ck-emoji-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-emoji-grid-tile-size)}@media (prefers-reduced-motion:reduce){.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile{transition:none}}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile:focus:not(.ck-disabled),.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile .ck-button__label{line-height:var(--ck-emoji-grid-tile-size);text-align:center;width:100%}",""]);const c=o},913:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji{width:320px}.ck .ck.ck-emoji__search{align-items:center;display:flex;justify-content:space-between;padding:var(--ck-spacing-large);padding-bottom:var(--ck-spacing-medium)}.ck .ck-fake-emoji-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-emoji-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const c=o},59:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji__skin-tone{margin-left:var(--ck-spacing-standard)}.ck.ck-emoji__skin-tone>.ck.ck-dropdown .ck.ck-list__item{min-width:1em}.ck.ck-emoji__skin-tone>.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:auto}",""]);const c=o},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var c=0;c<this.length;c++){var a=this[c][0];null!=a&&(o[a]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);n&&o[l[0]]||(void 0!==s&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=s),i&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=i):l[2]=i),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},758:e=>{"use strict";e.exports=function(e){return e[1]}},591:e=>{"use strict";var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var s={},o=[],c=0;c<e.length;c++){var a=e[c],u=n.base?a[0]+n.base:a[0],l=s[u]||0,h="".concat(u," ").concat(l);s[u]=l+1;var d=i(h),f={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(f);else{var g=r(f,n);n.byIndex=c,t.splice(c,0,{identifier:h,updater:g,references:1})}o.push(h)}return o}function r(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,r){var s=n(e=e||[],r=r||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var c=i(s[o]);t[c].references--}for(var a=n(e,r),u=0;u<s.length;u++){var l=i(s[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}s=a}}},128:e=>{"use strict";var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}},639:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function n(e,t,n,r){var s;if(n)s="";else{s="",r.supports&&(s+="@supports (".concat(r.supports,") {")),r.media&&(s+="@media ".concat(r.media," {"));var o=void 0!==r.layer;o&&(s+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),s+=r.css,o&&(s+="}"),r.media&&(s+="}"),r.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,s);else{var c=document.createTextNode(s),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(c,a[t]):e.appendChild(c)}}var r={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=r.singletonCounter++,i=r.singleton||(r.singleton=e.insertStyleElement(e));return{update:function(e){n(i,t,!1,e)},remove:function(e){n(i,t,!0,e)}}}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},834:(e,t,i)=>{e.exports=i(237)("./src/typing.js")},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{Emoji:()=>nr,EmojiCommand:()=>En,EmojiMention:()=>Vn,EmojiPicker:()=>ir,EmojiRepository:()=>wn});var e=i(782),t=i(584),r=i(834);function s(e){return Array.isArray?Array.isArray(e):"[object Array]"===d(e)}function o(e){return"string"==typeof e}function c(e){return"number"==typeof e}function a(e){return!0===e||!1===e||function(e){return u(e)&&null!==e}(e)&&"[object Boolean]"==d(e)}function u(e){return"object"==typeof e}function l(e){return null!=e}function h(e){return!e.trim().length}function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const f=Object.prototype.hasOwnProperty;class g{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=p(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function p(e){let t=null,i=null,n=null,r=1,c=null;if(o(e)||s(e))n=e,t=m(e),i=y(e);else{if(!f.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const s=e.name;if(n=s,f.call(e,"weight")&&(r=e.weight,r<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(s));t=m(s),i=y(s),c=e.getFn}return{path:t,id:i,weight:r,src:n,getFn:c}}function m(e){return s(e)?e:e.split(".")}function y(e){return s(e)?e.join("."):e}var k={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(e,t){let i=[],n=!1;const r=(e,t,u)=>{if(l(e))if(t[u]){const h=e[t[u]];if(!l(h))return;if(u===t.length-1&&(o(h)||c(h)||a(h)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(h));else if(s(h)){n=!0;for(let e=0,i=h.length;e<i;e+=1)r(h[e],t,u+1)}else t.length&&r(h,t,u+1)}else i.push(e)};return r(e,o(t)?t.split("."):t,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const b=/[^ ]+/g;class _{constructor({getFn:e=k.getFn,fieldNormWeight:t=k.fieldNormWeight}={}){this.norm=function(e=1,t=3){const i=new Map,n=Math.pow(10,t);return{get(t){const r=t.match(b).length;if(i.has(r))return i.get(r);const s=1/Math.pow(r,.5*e),o=parseFloat(Math.round(s*n)/n);return i.set(r,o),o},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();o(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!l(e)||h(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach(((t,n)=>{let r=t.getFn?t.getFn(e):this.getFn(e,t.path);if(l(r))if(s(r)){let e=[];const t=[{nestedArrIndex:-1,value:r}];for(;t.length;){const{nestedArrIndex:i,value:n}=t.pop();if(l(n))if(o(n)&&!h(n)){let t={v:n,i,n:this.norm.get(n)};e.push(t)}else s(n)&&n.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[n]=e}else if(o(r)&&!h(r)){let e={v:r,n:this.norm.get(r)};i.$[n]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function v(e,t,{getFn:i=k.getFn,fieldNormWeight:n=k.fieldNormWeight}={}){const r=new _({getFn:i,fieldNormWeight:n});return r.setKeys(e.map(p)),r.setSources(t),r.create(),r}function w(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:r=k.distance,ignoreLocation:s=k.ignoreLocation}={}){const o=t/e.length;if(s)return o;const c=Math.abs(n-i);return r?o+c/r:c?1:o}const j=32;function x(e,t,i,{location:n=k.location,distance:r=k.distance,threshold:s=k.threshold,findAllMatches:o=k.findAllMatches,minMatchCharLength:c=k.minMatchCharLength,includeMatches:a=k.includeMatches,ignoreLocation:u=k.ignoreLocation}={}){if(t.length>j)throw new Error(`Pattern length exceeds max of ${j}.`);const l=t.length,h=e.length,d=Math.max(0,Math.min(n,h));let f=s,g=d;const p=c>1||a,m=p?Array(h):[];let y;for(;(y=e.indexOf(t,g))>-1;){let e=w(t,{currentLocation:y,expectedLocation:d,distance:r,ignoreLocation:u});if(f=Math.min(e,f),g=y+l,p){let e=0;for(;e<l;)m[y+e]=1,e+=1}}g=-1;let b=[],_=1,v=l+h;const x=1<<l-1;for(let n=0;n<l;n+=1){let s=0,c=v;for(;s<c;){w(t,{errors:n,currentLocation:d+c,expectedLocation:d,distance:r,ignoreLocation:u})<=f?s=c:v=c,c=Math.floor((v-s)/2+s)}v=c;let a=Math.max(1,d-c+1),y=o?h:Math.min(d+c,h)+l,k=Array(y+2);k[y+1]=(1<<n)-1;for(let s=y;s>=a;s-=1){let o=s-1,c=i[e.charAt(o)];if(p&&(m[o]=+!!c),k[s]=(k[s+1]<<1|1)&c,n&&(k[s]|=(b[s+1]|b[s])<<1|1|b[s+1]),k[s]&x&&(_=w(t,{errors:n,currentLocation:o,expectedLocation:d,distance:r,ignoreLocation:u}),_<=f)){if(f=_,g=o,g<=d)break;a=Math.max(1,2*d-g)}}if(w(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:u})>f)break;b=k}const M={isMatch:g>=0,score:Math.max(.001,_)};if(p){const e=function(e=[],t=k.minMatchCharLength){let i=[],n=-1,r=-1,s=0;for(let o=e.length;s<o;s+=1){let o=e[s];o&&-1===n?n=s:o||-1===n||(r=s-1,r-n+1>=t&&i.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&i.push([n,s-1]),i}(m,c);e.length?a&&(M.indices=e):M.isMatch=!1}return M}function M(e){let t={};for(let i=0,n=e.length;i<n;i+=1){const r=e.charAt(i);t[r]=(t[r]||0)|1<<n-i-1}return t}class V{constructor(e,{location:t=k.location,threshold:i=k.threshold,distance:n=k.distance,includeMatches:r=k.includeMatches,findAllMatches:s=k.findAllMatches,minMatchCharLength:o=k.minMatchCharLength,isCaseSensitive:c=k.isCaseSensitive,ignoreLocation:a=k.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:a},this.pattern=c?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:M(e),startIndex:t})},l=this.pattern.length;if(l>j){let e=0;const t=l%j,i=l-t;for(;e<i;)u(this.pattern.substr(e,j),e),e+=j;if(t){const e=l-j;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return i&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:c,ignoreLocation:a}=this.options;let u=[],l=0,h=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:f})=>{const{isMatch:g,score:p,indices:m}=x(e,t,d,{location:n+f,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:c,includeMatches:i,ignoreLocation:a});g&&(h=!0),l+=p,g&&m&&(u=[...u,...m])}));let d={isMatch:h,score:h?l/this.chunks.length:1};return h&&i&&(d.indices=u),d}}class T{constructor(e){this.pattern=e}static isMultiMatch(e){return E(e,this.multiRegex)}static isSingleMatch(e){return E(e,this.singleRegex)}search(){}}function E(e,t){const i=e.match(t);return i?i[1]:null}class C extends T{constructor(e,{location:t=k.location,threshold:i=k.threshold,distance:n=k.distance,includeMatches:r=k.includeMatches,findAllMatches:s=k.findAllMatches,minMatchCharLength:o=k.minMatchCharLength,isCaseSensitive:c=k.isCaseSensitive,ignoreLocation:a=k.ignoreLocation}={}){super(e),this._bitapSearch=new V(e,{location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends T{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],r=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+r,n.push([t,i-1]);const s=!!n.length;return{isMatch:s,score:s?0:1,indices:n}}}const L=[class extends T{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},S,class extends T{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},C],P=L.length,A=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const O=new Set([C.type,S.type]);class I{constructor(e,{isCaseSensitive:t=k.isCaseSensitive,includeMatches:i=k.includeMatches,minMatchCharLength:n=k.minMatchCharLength,ignoreLocation:r=k.ignoreLocation,findAllMatches:s=k.findAllMatches,location:o=k.location,threshold:c=k.threshold,distance:a=k.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:s,ignoreLocation:r,location:o,threshold:c,distance:a},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(A).filter((e=>e&&!!e.trim())),n=[];for(let e=0,r=i.length;e<r;e+=1){const r=i[e];let s=!1,o=-1;for(;!s&&++o<P;){const e=L[o];let i=e.isMultiMatch(r);i&&(n.push(new e(i,t)),s=!0)}if(!s)for(o=-1;++o<P;){const e=L[o];let i=e.isSingleMatch(r);if(i){n.push(new e(i,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let r=0,s=[],o=0;for(let n=0,c=t.length;n<c;n+=1){const c=t[n];s.length=0,r=0;for(let t=0,n=c.length;t<n;t+=1){const n=c[t],{isMatch:a,indices:u,score:l}=n.search(e);if(!a){o=0,r=0,s.length=0;break}if(r+=1,o+=l,i){const e=n.constructor.type;O.has(e)?s=[...s,...u]:s.push(u)}}if(r){let e={isMatch:!0,score:o/r};return i&&(e.indices=s),e}}return{isMatch:!1,score:1}}}const F=[];function $(e,t){for(let i=0,n=F.length;i<n;i+=1){let n=F[i];if(n.condition(e,t))return new n(e,t)}return new V(e,t)}const R="$and",N="$or",z="$path",B="$val",D=e=>!(!e[R]&&!e[N]),q=e=>({[R]:Object.keys(e).map((t=>({[t]:e[t]})))});function W(e,t,{auto:i=!0}={}){const n=e=>{let r=Object.keys(e);const c=(e=>!!e[z])(e);if(!c&&r.length>1&&!D(e))return n(q(e));if((e=>!s(e)&&u(e)&&!D(e))(e)){const n=c?e[z]:r[0],s=c?e[B]:e[n];if(!o(s))throw new Error((e=>`Invalid value for key ${e}`)(n));const a={keyId:y(n),pattern:s};return i&&(a.searcher=$(s,t)),a}let a={children:[],operator:r[0]};return r.forEach((t=>{const i=e[t];s(i)&&i.forEach((e=>{a.children.push(n(e))}))})),a};return D(e)||(e=q(e)),n(e)}function K(e,t){const i=e.matches;t.matches=[],l(i)&&i.forEach((e=>{if(!l(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let r={indices:i,value:n};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function U(e,t){t.score=e.score}class H{constructor(e,t={},i){this.options={...k,...t},this.options.useExtendedSearch,this._keyStore=new g(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof _))throw new Error("Incorrect 'index' type");this._myIndex=t||v(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){l(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,t.push(r))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:r,sortFn:s,ignoreFieldNorm:a}=this.options;let u=o(e)?o(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=k.ignoreFieldNorm}){e.forEach((e=>{let i=1;e.matches.forEach((({key:e,norm:n,score:r})=>{const s=e?e.weight:null;i*=Math.pow(0===r&&s?Number.EPSILON:r,(s||1)*(t?1:n))})),e.score=i}))}(u,{ignoreFieldNorm:a}),r&&u.sort(s),c(t)&&t>-1&&(u=u.slice(0,t)),function(e,t,{includeMatches:i=k.includeMatches,includeScore:n=k.includeScore}={}){const r=[];return i&&r.push(K),n&&r.push(U),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return r.length&&r.forEach((t=>{t(e,n)})),n}))}(u,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=$(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i,n:r})=>{if(!l(e))return;const{isMatch:s,score:o,indices:c}=t.searchIn(e);s&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:r,indices:c}]})})),n}_searchLogical(e){const t=W(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:r}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:r});return s&&s.length?[{idx:n,item:t,matches:s}]:[]}const r=[];for(let s=0,o=e.children.length;s<o;s+=1){const o=e.children[s],c=i(o,t,n);if(c.length)r.push(...c);else if(e.operator===R)return[]}return r},n=this._myIndex.records,r={},s=[];return n.forEach((({$:e,i:n})=>{if(l(e)){let o=i(t,e,n);o.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},s.push(r[n])),o.forEach((({matches:e})=>{r[n].matches.push(...e)})))}})),s}_searchObjectList(e){const t=$(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach((({$:e,i:n})=>{if(!l(e))return;let s=[];i.forEach(((i,n)=>{s.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),s.length&&r.push({idx:n,item:e,matches:s})})),r}_findMatches({key:e,value:t,searcher:i}){if(!l(t))return[];let n=[];if(s(t))t.forEach((({v:t,i:r,n:s})=>{if(!l(t))return;const{isMatch:o,score:c,indices:a}=i.searchIn(t);o&&n.push({score:c,key:e,value:t,idx:r,norm:s,indices:a})}));else{const{v:r,n:s}=t,{isMatch:o,score:c,indices:a}=i.searchIn(r);o&&n.push({score:c,key:e,value:r,norm:s,indices:a})}return n}}H.version="7.0.0",H.createIndex=v,H.parseIndex=function(e,{getFn:t=k.getFn,fieldNormWeight:i=k.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new _({getFn:t,fieldNormWeight:i});return s.setKeys(n),s.setIndexRecords(r),s},H.config=k,H.parseQuery=W,function(...e){F.push(...e)}(I);const Q="object"==typeof global&&global&&global.Object===Object&&global;var G="object"==typeof self&&self&&self.Object===Object&&self;const J=Q||G||Function("return this")();const X=J.Symbol;var Y=Object.prototype,Z=Y.hasOwnProperty,ee=Y.toString,te=X?X.toStringTag:void 0;const ie=function(e){var t=Z.call(e,te),i=e[te];try{e[te]=void 0;var n=!0}catch(e){}var r=ee.call(e);return n&&(t?e[te]=i:delete e[te]),r};var ne=Object.prototype.toString;const re=function(e){return ne.call(e)};var se=X?X.toStringTag:void 0;const oe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":se&&se in Object(e)?ie(e):re(e)};const ce=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const ae=function(e){if(!ce(e))return!1;var t=oe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const ue=J["__core-js_shared__"];var le,he=(le=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+le:"";const de=function(e){return!!he&&he in e};var fe=Function.prototype.toString;const ge=function(e){if(null!=e){try{return fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var pe=/^\[object .+?Constructor\]$/,me=Function.prototype,ye=Object.prototype,ke=me.toString,be=ye.hasOwnProperty,_e=RegExp("^"+ke.call(be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ve=function(e){return!(!ce(e)||de(e))&&(ae(e)?_e:pe).test(ge(e))};const we=function(e,t){return null==e?void 0:e[t]};const je=function(e,t){var i=we(e,t);return ve(i)?i:void 0};const xe=function(){try{var e=je(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Me=function(e,t,i){"__proto__"==t&&xe?xe(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i};const Ve=function(e,t,i,n){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(n,o,i(o),e)}return n};const Te=function(e){return function(t,i,n){for(var r=-1,s=Object(t),o=n(t),c=o.length;c--;){var a=o[e?c:++r];if(!1===i(s[a],a,s))break}return t}}();const Ee=function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n};const Ce=function(e){return null!=e&&"object"==typeof e};const Se=function(e){return Ce(e)&&"[object Arguments]"==oe(e)};var Le=Object.prototype,Pe=Le.hasOwnProperty,Ae=Le.propertyIsEnumerable;const Oe=Se(function(){return arguments}())?Se:function(e){return Ce(e)&&Pe.call(e,"callee")&&!Ae.call(e,"callee")};const Ie=Array.isArray;const Fe=function(){return!1};var $e="object"==typeof exports&&exports&&!exports.nodeType&&exports,Re=$e&&"object"==typeof module&&module&&!module.nodeType&&module,Ne=Re&&Re.exports===$e?J.Buffer:void 0;const ze=(Ne?Ne.isBuffer:void 0)||Fe;var Be=/^(?:0|[1-9]\d*)$/;const De=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Be.test(e))&&e>-1&&e%1==0&&e<t};const qe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var We={};We["[object Float32Array]"]=We["[object Float64Array]"]=We["[object Int8Array]"]=We["[object Int16Array]"]=We["[object Int32Array]"]=We["[object Uint8Array]"]=We["[object Uint8ClampedArray]"]=We["[object Uint16Array]"]=We["[object Uint32Array]"]=!0,We["[object Arguments]"]=We["[object Array]"]=We["[object ArrayBuffer]"]=We["[object Boolean]"]=We["[object DataView]"]=We["[object Date]"]=We["[object Error]"]=We["[object Function]"]=We["[object Map]"]=We["[object Number]"]=We["[object Object]"]=We["[object RegExp]"]=We["[object Set]"]=We["[object String]"]=We["[object WeakMap]"]=!1;const Ke=function(e){return Ce(e)&&qe(e.length)&&!!We[oe(e)]};const Ue=function(e){return function(t){return e(t)}};var He="object"==typeof exports&&exports&&!exports.nodeType&&exports,Qe=He&&"object"==typeof module&&module&&!module.nodeType&&module,Ge=Qe&&Qe.exports===He&&Q.process,Je=function(){try{var e=Qe&&Qe.require&&Qe.require("util").types;return e||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}();var Xe=Je&&Je.isTypedArray;const Ye=Xe?Ue(Xe):Ke;var Ze=Object.prototype.hasOwnProperty;const et=function(e,t){var i=Ie(e),n=!i&&Oe(e),r=!i&&!n&&ze(e),s=!i&&!n&&!r&&Ye(e),o=i||n||r||s,c=o?Ee(e.length,String):[],a=c.length;for(var u in e)!t&&!Ze.call(e,u)||o&&("length"==u||r&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||De(u,a))||c.push(u);return c};var tt=Object.prototype;const it=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||tt)};const nt=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object);var rt=Object.prototype.hasOwnProperty;const st=function(e){if(!it(e))return nt(e);var t=[];for(var i in Object(e))rt.call(e,i)&&"constructor"!=i&&t.push(i);return t};const ot=function(e){return null!=e&&qe(e.length)&&!ae(e)};const ct=function(e){return ot(e)?et(e):st(e)};const at=function(e,t){return function(i,n){if(null==i)return i;if(!ot(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s<r)&&!1!==n(o[s],s,o););return i}}((function(e,t){return e&&Te(e,t,ct)}));const ut=function(e,t,i,n){return at(e,(function(e,r,s){t(n,e,i(e),s)})),n};const lt=function(){this.__data__=[],this.size=0};const ht=function(e,t){return e===t||e!=e&&t!=t};const dt=function(e,t){for(var i=e.length;i--;)if(ht(e[i][0],t))return i;return-1};var ft=Array.prototype.splice;const gt=function(e){var t=this.__data__,i=dt(t,e);return!(i<0)&&(i==t.length-1?t.pop():ft.call(t,i,1),--this.size,!0)};const pt=function(e){var t=this.__data__,i=dt(t,e);return i<0?void 0:t[i][1]};const mt=function(e){return dt(this.__data__,e)>-1};const yt=function(e,t){var i=this.__data__,n=dt(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function kt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}kt.prototype.clear=lt,kt.prototype.delete=gt,kt.prototype.get=pt,kt.prototype.has=mt,kt.prototype.set=yt;const bt=kt;const _t=function(){this.__data__=new bt,this.size=0};const vt=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i};const wt=function(e){return this.__data__.get(e)};const jt=function(e){return this.__data__.has(e)};const xt=je(J,"Map");const Mt=je(Object,"create");const Vt=function(){this.__data__=Mt?Mt(null):{},this.size=0};const Tt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Et=Object.prototype.hasOwnProperty;const Ct=function(e){var t=this.__data__;if(Mt){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Et.call(t,e)?t[e]:void 0};var St=Object.prototype.hasOwnProperty;const Lt=function(e){var t=this.__data__;return Mt?void 0!==t[e]:St.call(t,e)};const Pt=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Mt&&void 0===t?"__lodash_hash_undefined__":t,this};function At(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}At.prototype.clear=Vt,At.prototype.delete=Tt,At.prototype.get=Ct,At.prototype.has=Lt,At.prototype.set=Pt;const Ot=At;const It=function(){this.size=0,this.__data__={hash:new Ot,map:new(xt||bt),string:new Ot}};const Ft=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const $t=function(e,t){var i=e.__data__;return Ft(t)?i["string"==typeof t?"string":"hash"]:i.map};const Rt=function(e){var t=$t(this,e).delete(e);return this.size-=t?1:0,t};const Nt=function(e){return $t(this,e).get(e)};const zt=function(e){return $t(this,e).has(e)};const Bt=function(e,t){var i=$t(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function Dt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Dt.prototype.clear=It,Dt.prototype.delete=Rt,Dt.prototype.get=Nt,Dt.prototype.has=zt,Dt.prototype.set=Bt;const qt=Dt;const Wt=function(e,t){var i=this.__data__;if(i instanceof bt){var n=i.__data__;if(!xt||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new qt(n)}return i.set(e,t),this.size=i.size,this};function Kt(e){var t=this.__data__=new bt(e);this.size=t.size}Kt.prototype.clear=_t,Kt.prototype.delete=vt,Kt.prototype.get=wt,Kt.prototype.has=jt,Kt.prototype.set=Wt;const Ut=Kt;const Ht=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Qt=function(e){return this.__data__.has(e)};function Gt(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new qt;++t<i;)this.add(e[t])}Gt.prototype.add=Gt.prototype.push=Ht,Gt.prototype.has=Qt;const Jt=Gt;const Xt=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1};const Yt=function(e,t){return e.has(t)};const Zt=function(e,t,i,n,r,s){var o=1&i,c=e.length,a=t.length;if(c!=a&&!(o&&a>c))return!1;var u=s.get(e),l=s.get(t);if(u&&l)return u==t&&l==e;var h=-1,d=!0,f=2&i?new Jt:void 0;for(s.set(e,t),s.set(t,e);++h<c;){var g=e[h],p=t[h];if(n)var m=o?n(p,g,h,t,e,s):n(g,p,h,e,t,s);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!Xt(t,(function(e,t){if(!Yt(f,t)&&(g===e||r(g,e,i,n,s)))return f.push(t)}))){d=!1;break}}else if(g!==p&&!r(g,p,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d};const ei=J.Uint8Array;const ti=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i};const ii=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i};var ni=X?X.prototype:void 0,ri=ni?ni.valueOf:void 0;const si=function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new ei(e),new ei(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ht(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var c=ti;case"[object Set]":var a=1&n;if(c||(c=ii),e.size!=t.size&&!a)return!1;var u=o.get(e);if(u)return u==t;n|=2,o.set(e,t);var l=Zt(c(e),c(t),n,r,s,o);return o.delete(e),l;case"[object Symbol]":if(ri)return ri.call(e)==ri.call(t)}return!1};const oi=function(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e};const ci=function(e,t,i){var n=t(e);return Ie(e)?n:oi(n,i(e))};const ai=function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var o=e[i];t(o,i,e)&&(s[r++]=o)}return s};const ui=function(){return[]};var li=Object.prototype.propertyIsEnumerable,hi=Object.getOwnPropertySymbols;const di=hi?function(e){return null==e?[]:(e=Object(e),ai(hi(e),(function(t){return li.call(e,t)})))}:ui;const fi=function(e){return ci(e,ct,di)};var gi=Object.prototype.hasOwnProperty;const pi=function(e,t,i,n,r,s){var o=1&i,c=fi(e),a=c.length;if(a!=fi(t).length&&!o)return!1;for(var u=a;u--;){var l=c[u];if(!(o?l in t:gi.call(t,l)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=o;++u<a;){var p=e[l=c[u]],m=t[l];if(n)var y=o?n(m,p,l,t,e,s):n(p,m,l,e,t,s);if(!(void 0===y?p===m||r(p,m,i,n,s):y)){f=!1;break}g||(g="constructor"==l)}if(f&&!g){var k=e.constructor,b=t.constructor;k==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f};const mi=je(J,"DataView");const yi=je(J,"Promise");const ki=je(J,"Set");const bi=je(J,"WeakMap");var _i="[object Map]",vi="[object Promise]",wi="[object Set]",ji="[object WeakMap]",xi="[object DataView]",Mi=ge(mi),Vi=ge(xt),Ti=ge(yi),Ei=ge(ki),Ci=ge(bi),Si=oe;(mi&&Si(new mi(new ArrayBuffer(1)))!=xi||xt&&Si(new xt)!=_i||yi&&Si(yi.resolve())!=vi||ki&&Si(new ki)!=wi||bi&&Si(new bi)!=ji)&&(Si=function(e){var t=oe(e),i="[object Object]"==t?e.constructor:void 0,n=i?ge(i):"";if(n)switch(n){case Mi:return xi;case Vi:return _i;case Ti:return vi;case Ei:return wi;case Ci:return ji}return t});const Li=Si;var Pi="[object Arguments]",Ai="[object Array]",Oi="[object Object]",Ii=Object.prototype.hasOwnProperty;const Fi=function(e,t,i,n,r,s){var o=Ie(e),c=Ie(t),a=o?Ai:Li(e),u=c?Ai:Li(t),l=(a=a==Pi?Oi:a)==Oi,h=(u=u==Pi?Oi:u)==Oi,d=a==u;if(d&&ze(e)){if(!ze(t))return!1;o=!0,l=!1}if(d&&!l)return s||(s=new Ut),o||Ye(e)?Zt(e,t,i,n,r,s):si(e,t,a,i,n,r,s);if(!(1&i)){var f=l&&Ii.call(e,"__wrapped__"),g=h&&Ii.call(t,"__wrapped__");if(f||g){var p=f?e.value():e,m=g?t.value():t;return s||(s=new Ut),r(p,m,i,n,s)}}return!!d&&(s||(s=new Ut),pi(e,t,i,n,r,s))};const $i=function e(t,i,n,r,s){return t===i||(null==t||null==i||!Ce(t)&&!Ce(i)?t!=t&&i!=i:Fi(t,i,n,r,e,s))};const Ri=function(e,t,i,n){var r=i.length,s=r,o=!n;if(null==e)return!s;for(e=Object(e);r--;){var c=i[r];if(o&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++r<s;){var a=(c=i[r])[0],u=e[a],l=c[1];if(o&&c[2]){if(void 0===u&&!(a in e))return!1}else{var h=new Ut;if(n)var d=n(u,l,a,e,t,h);if(!(void 0===d?$i(l,u,3,n,h):d))return!1}}return!0};const Ni=function(e){return e==e&&!ce(e)};const zi=function(e){for(var t=ct(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,Ni(r)]}return t};const Bi=function(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}};const Di=function(e){var t=zi(e);return 1==t.length&&t[0][2]?Bi(t[0][0],t[0][1]):function(i){return i===e||Ri(i,e,t)}};const qi=function(e){return"symbol"==typeof e||Ce(e)&&"[object Symbol]"==oe(e)};var Wi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ki=/^\w*$/;const Ui=function(e,t){if(Ie(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!qi(e))||(Ki.test(e)||!Wi.test(e)||null!=t&&e in Object(t))};function Hi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(Hi.Cache||qt),i}Hi.Cache=qt;const Qi=Hi;var Gi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ji=/\\(\\)?/g;const Xi=function(e){var t=Qi(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Gi,(function(e,i,n,r){t.push(n?r.replace(Ji,"$1"):i||e)})),t}));const Yi=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r};var Zi=X?X.prototype:void 0,en=Zi?Zi.toString:void 0;const tn=function e(t){if("string"==typeof t)return t;if(Ie(t))return Yi(t,e)+"";if(qi(t))return en?en.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i};const nn=function(e){return null==e?"":tn(e)};const rn=function(e,t){return Ie(e)?e:Ui(e,t)?[e]:Xi(nn(e))};const sn=function(e){if("string"==typeof e||qi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const on=function(e,t){for(var i=0,n=(t=rn(t,e)).length;null!=e&&i<n;)e=e[sn(t[i++])];return i&&i==n?e:void 0};const cn=function(e,t,i){var n=null==e?void 0:on(e,t);return void 0===n?i:n};const an=function(e,t){return null!=e&&t in Object(e)};const un=function(e,t,i){for(var n=-1,r=(t=rn(t,e)).length,s=!1;++n<r;){var o=sn(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&qe(r)&&De(o,r)&&(Ie(e)||Oe(e))};const ln=function(e,t){return null!=e&&un(e,t,an)};const hn=function(e,t){return Ui(e)&&Ni(t)?Bi(sn(e),t):function(i){var n=cn(i,e);return void 0===n&&n===t?ln(i,e):$i(t,n,3)}};const dn=function(e){return e};const fn=function(e){return function(t){return null==t?void 0:t[e]}};const gn=function(e){return function(t){return on(t,e)}};const pn=function(e){return Ui(e)?fn(sn(e)):gn(e)};const mn=function(e){return"function"==typeof e?e:null==e?dn:"object"==typeof e?Ie(e)?hn(e[0],e[1]):Di(e):pn(e)};const yn=function(e,t){return function(i,n){var r=Ie(i)?Ve:ut,s=t?t():{};return r(i,e,mn(n,2),s)}};var kn=Object.prototype.hasOwnProperty;const bn=yn((function(e,t,i){kn.call(e,i)?e[i].push(t):Me(e,i,[t])})),_n={0:"default",1:"light",2:"medium-light",3:"medium",4:"medium-dark",5:"dark"};class vn extends e.Plugin{static get pluginName(){return"EmojiRepository"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.editor.config.define("emoji",{version:16,skinTone:"default"}),this._database=[],this._databasePromise=new Promise((e=>{this._databasePromiseResolveCallback=e})),this._fuseSearch=null}async init(){const e=this.editor.config.get("emoji.version"),i="https://cdn.ckeditor.com/ckeditor5/data/emoji/{version}/en.json".replace("{version}",`${e}`),n=await async function(e){const i=await fetch(e).then((e=>e.ok?e.json():[])).catch((()=>[]));i.length||(0,t.logWarning)("emoji-database-load-failed");return i}(i);if(!n.length)return this._databasePromiseResolveCallback(!1);const r=function(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.whiteSpace="nowrap",e.style.fontSize="24px",document.body.appendChild(e),e}();return this._database=n.filter((e=>function(e){return 2!==e.group}(e))).filter((e=>vn._isEmojiSupported(e,r))).map((e=>function(e){const t={...e,skins:{default:e.emoji}};e.skins&&e.skins.forEach((e=>{const i=_n[e.tone];t.skins[i]=e.emoji}));return t}(e))),r.remove(),this._fuseSearch=new H(this._database,{keys:[{name:"emoticon",weight:5},{name:"annotation",weight:3},{name:"tags",weight:1}],minMatchCharLength:2,threshold:0,ignoreLocation:!0}),this._databasePromiseResolveCallback(!0)}getEmojiByQuery(e){if(!this._fuseSearch)return[];const t=e.split(/\s/).filter(Boolean);return t.some((e=>e.length>=2))?this._fuseSearch.search({$or:[{emoticon:e},{$and:t.map((e=>({annotation:e})))},{$and:t.map((e=>({tags:e})))}]}).map((e=>e.item)):[]}getEmojiCategories(){if(!this._database.length)return[];const{t:e}=this.editor.locale,t=[{title:e("Smileys & Expressions"),icon:"😀",groupId:0},{title:e("Gestures & People"),icon:"👋",groupId:1},{title:e("Animals & Nature"),icon:"🐻",groupId:3},{title:e("Food & Drinks"),icon:"🍎",groupId:4},{title:e("Travel & Places"),icon:"🚘",groupId:5},{title:e("Activities"),icon:"🏀",groupId:6},{title:e("Objects"),icon:"💡",groupId:7},{title:e("Symbols"),icon:"🟢",groupId:8},{title:e("Flags"),icon:"🏁",groupId:9}],i=bn(this._database,"group");return t.map((e=>({...e,items:i[e.groupId]})))}getSkinTones(){const{t:e}=this.editor.locale;return[{id:"default",icon:"👋",tooltip:e("Default skin tone")},{id:"light",icon:"👋🏻",tooltip:e("Light skin tone")},{id:"medium-light",icon:"👋🏼",tooltip:e("Medium Light skin tone")},{id:"medium",icon:"👋🏽",tooltip:e("Medium skin tone")},{id:"medium-dark",icon:"👋🏾",tooltip:e("Medium Dark skin tone")},{id:"dark",icon:"👋🏿",tooltip:e("Dark skin tone")}]}isReady(){return this._databasePromise}}vn._isEmojiSupported=function(e,t){const i=function(e,t){const i=document.createElement("span");i.textContent=t,e.appendChild(i);const n=i.offsetWidth;return e.removeChild(i),n}(t,e.emoji);return i/1.8<24&&i>=24};const wn=vn;const jn=":",xn=":__EMOJI_SHOW_ALL:",Mn=":__EMOJI_HINT:";class Vn extends e.Plugin{static get requires(){return[wn,r.Typing,"Mention"]}static get pluginName(){return"EmojiMention"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.editor.config.define("emoji",{dropdownLimit:6}),this._emojiDropdownLimit=e.config.get("emoji.dropdownLimit"),this._skinTone=e.config.get("emoji.skinTone");const i=e.config.get("mention.feeds"),n=e.config.get("mergeFields.prefix"),r=i.some((e=>e.marker===jn)),s=!!n&&n[0]===jn;r||s?(0,t.logWarning)("emoji-config-marker-already-used",{marker:jn}):this._setupMentionConfiguration(i)}async init(){const e=this.editor;this._emojiPickerPlugin=e.plugins.has("EmojiPicker")?e.plugins.get("EmojiPicker"):null,this._emojiRepositoryPlugin=e.plugins.get("EmojiRepository"),await this._emojiRepositoryPlugin.isReady()&&e.once("ready",this._overrideMentionExecuteListener.bind(this))}_setupMentionConfiguration(e){const t={marker:jn,dropdownLimit:this._emojiDropdownLimit,itemRenderer:this._customItemRendererFactory(this.editor.t),feed:this._queryEmojiCallbackFactory()};this.editor.config.set("mention.feeds",[...e,t])}_customItemRendererFactory(e){return t=>{const i=document.createElement("button");i.classList.add("ck"),i.classList.add("ck-button"),i.classList.add("ck-button_with-text"),i.id=`mention-list-item-id${t.id.slice(0,-1)}`,i.type="button",i.tabIndex=-1;const n=document.createElement("span");return n.classList.add("ck"),n.classList.add("ck-button__label"),i.appendChild(n),t.id===Mn?(i.classList.add("ck-list-item-button"),i.classList.add("ck-disabled"),n.textContent=e("Keep on typing to see the emoji.")):t.id===xn?n.textContent=e("Show all emoji..."):n.textContent=`${t.text} ${t.id}`,i}}_overrideMentionExecuteListener(){const e=this.editor;e.commands.get("mention").on("execute",((t,i)=>{const n=i[0];if(n.marker===jn&&(t.stop(),n.mention.id!==Mn))if(n.mention.id===xn){const t=[...n.range.getItems()].filter((e=>e.is("$textProxy"))).map((e=>e.data)).reduce(((e,t)=>e+t),"");e.model.change((t=>{e.model.deleteContent(t.createSelection(n.range))}));const i=this._emojiPickerPlugin;i.showUI(t.slice(1)),setTimeout((()=>{i.emojiPickerView.focus()}))}else e.execute("insertText",{text:n.mention.text,range:n.range})}),{priority:"high"})}_queryEmojiCallbackFactory(){return e=>{if(e.startsWith(" "))return[];const t=this._emojiRepositoryPlugin.getEmojiByQuery(e).map((e=>{let t=e.skins[this._skinTone]||e.skins.default;return this._emojiPickerPlugin&&(t=e.skins[this._emojiPickerPlugin.skinTone]||e.skins.default),{id:`:${e.annotation}:`,text:t}}));if(!this._emojiPickerPlugin)return t.slice(0,this._emojiDropdownLimit);const i={id:e.length>1?xn:Mn};return[...t.slice(0,this._emojiDropdownLimit-1),i]}}}var Tn=i(311);class En extends e.Command{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=t.checkChild(i.getFirstPosition(),"$text")}execute(e=""){this.editor.plugins.get("EmojiPicker").showUI(e)}}var Cn=i(591),Sn=i.n(Cn),Ln=i(639),Pn=i.n(Ln),An=i(128),On=i.n(An),In=i(21),Fn=i.n(In),$n=i(51),Rn=i.n($n),Nn=i(291),zn={attributes:{"data-cke":!0}};zn.setAttributes=Fn(),zn.insert=On().bind(null,"head"),zn.domAPI=Pn(),zn.insertStyleElement=Rn();Sn()(Nn.A,zn);Nn.A&&Nn.A.locals&&Nn.A.locals;class Bn extends Tn.View{constructor(e,{categoryName:i,emojiCategories:n,getEmojiByQuery:r,skinTone:s}){super(e),this.set("isEmpty",!0),this.set("categoryName",i),this.set("skinTone",s),this.tiles=this.createCollection(),this.cachedTiles=this.createCollection(),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this._getEmojiByQuery=r,this.emojiCategories=n;const o=this.bindTemplate;this.setTemplate({tag:"div",children:[{tag:"div",attributes:{role:"grid",class:["ck","ck-emoji__grid"]},children:this.tiles}],attributes:{role:"tabpanel",class:["ck","ck-emoji__tiles",o.if("isEmpty","ck-hidden",(e=>e))]}}),(0,Tn.addKeyboardHandlingForGrid)({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>t.global.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy(),this.focusTracker.destroy()}focus(){const e=this.tiles.first;e&&e.focus()}filter(e){const{matchingItems:t,allItems:i}=e?this._getItemsByQuery(e.source):this._getItemsByCategory();return this._updateGrid(t),this.set("isEmpty",0===t.length),{resultsCount:t.length,totalItemsCount:i.length}}_getItemsByQuery(e){return{matchingItems:this._getEmojiByQuery(e),allItems:this.emojiCategories.flatMap((e=>e.items))}}_getItemsByCategory(){const e=this.emojiCategories.find((e=>e.title===this.categoryName)),{items:t}=e;return{matchingItems:t,allItems:t}}_updateGrid(e){[...this.tiles].forEach((e=>{this.focusTracker.remove(e),this.tiles.remove(e)})),e.map((e=>{const t=e.skins[this.skinTone]||e.skins.default;return this.cachedTiles.get(t)||this._createTile(t,e.annotation)})).forEach((e=>{this.tiles.add(e),this.focusTracker.add(e)}))}_createTile(e,t){const i=new Tn.ButtonView(this.locale);return i.viewUid=e,i.extendTemplate({attributes:{class:["ck-emoji__tile"]}}),i.set({label:e,tooltip:t,withText:!0,ariaLabel:t,ariaLabelledBy:void 0}),i.on("execute",(()=>{this.fire("execute",{name:t,emoji:e})})),this.cachedTiles.add(i),i}}var Dn=i(223),qn={attributes:{"data-cke":!0}};qn.setAttributes=Fn(),qn.insert=On().bind(null,"head"),qn.domAPI=Pn(),qn.insertStyleElement=Rn();Sn()(Dn.A,qn);Dn.A&&Dn.A.locals&&Dn.A.locals;class Wn extends Tn.View{constructor(e,{emojiCategories:i,categoryName:n}){super(e),this.buttonViews=this.createCollection(i.map((e=>this._createCategoryButton(e)))),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this.focusCycler=new Tn.FocusCycler({focusables:this.buttonViews,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-emoji__categories-list"],role:"tablist"},children:this.buttonViews}),this.on("change:categoryName",((e,t,i,n)=>{const r=this.buttonViews.find((e=>e.tooltip===n));r&&(r.isOn=!1);this.buttonViews.find((e=>e.tooltip===i)).isOn=!0})),this.set("categoryName",n)}render(){super.render(),this.buttonViews.forEach((e=>{this.focusTracker.add(e)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),this.buttonViews.destroy()}focus(){this.buttonViews.first.focus()}enableCategories(){this.buttonViews.forEach((e=>{e.isEnabled=!0}))}disableCategories(){this.buttonViews.forEach((e=>{e.set({class:"",isEnabled:!1,isOn:!1})}))}_createCategoryButton(e){const t=new Tn.ButtonView,i=t.bindTemplate;return t.extendTemplate({attributes:{"aria-selected":i.to("isOn",(e=>e.toString())),class:["ck-emoji__category-item"]}}),t.set({ariaLabel:e.title,label:e.icon,role:"tab",tooltip:e.title,withText:!0,ariaLabelledBy:void 0}),t.on("execute",(()=>{this.categoryName=e.title})),t.on("change:isEnabled",(()=>{t.isEnabled&&t.tooltip===this.categoryName&&(t.isOn=!0)})),t}}var Kn=/[\\^$.*+?()[\]{}|]/g,Un=RegExp(Kn.source);const Hn=function(e){return(e=nn(e))&&Un.test(e)?e.replace(Kn,"\\$&"):e};class Qn extends Tn.View{constructor(e,{gridView:t,resultsView:i}){super(e),this.gridView=t;const n=e.t;this.inputView=new Tn.SearchTextView(this.locale,{queryView:{label:n("Find an emoji (min. 2 characters)"),creator:Tn.createLabeledInputText},filteredView:this.gridView,infoView:{instance:i}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search"],tabindex:"-1"},children:[this.inputView.queryView]}),this.inputView.delegate("search").to(this)}destroy(){super.destroy(),this.inputView.destroy()}search(e){const t=e?new RegExp(Hn(e),"ig"):null,i=this.gridView.filter(t);this.inputView.fire("search",{query:e,...i})}setInputValue(e){e?this.inputView.queryView.fieldView.value=e:this.inputView.queryView.fieldView.reset()}getInputValue(){return this.inputView.queryView.fieldView.element.value}focus(){this.inputView.focus()}}var Gn=i(59),Jn={attributes:{"data-cke":!0}};Jn.setAttributes=Fn(),Jn.insert=On().bind(null,"head"),Jn.domAPI=Pn(),Jn.insertStyleElement=Rn();Sn()(Gn.A,Jn);Gn.A&&Gn.A.locals&&Gn.A.locals;class Xn extends Tn.View{constructor(e,{skinTone:i,skinTones:n}){super(e),this.set("skinTone",i),this._skinTones=n;const r=(0,e.t)("Select skin tone"),s=(0,Tn.createDropdown)(e),o=new t.Collection;for(const{id:e,icon:t,tooltip:i}of this._skinTones){const n={type:"button",model:new Tn.ViewModel({value:e,label:t,ariaLabel:i,tooltip:i,tooltipPosition:"e",role:"menuitemradio",withText:!0,ariaLabelledBy:void 0})};n.model.bind("isOn").to(this,"skinTone",(t=>t===e)),o.add(n)}(0,Tn.addListToDropdown)(s,o,{ariaLabel:r,role:"menu"}),s.buttonView.set({label:this._getSkinTone().icon,ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),this.dropdownView=s,this.listenTo(s,"execute",(e=>{this.skinTone=e.source.value})),s.buttonView.bind("label").to(this,"skinTone",(()=>this._getSkinTone().icon)),s.buttonView.bind("ariaLabel").to(this,"skinTone",(()=>`${this._getSkinTone().tooltip}, ${r}`)),this.setTemplate({tag:"div",attributes:{class:["ck","ck-emoji__skin-tone"]},children:[s]})}focus(){this.dropdownView.buttonView.focus()}_getSkinTone(){return this._skinTones.find((e=>e.id===this.skinTone))}}class Yn extends Tn.View{constructor(e,{emojiCategories:i,getEmojiByQuery:n,skinTone:r,skinTones:s}){super(e);const o=i[0].title;this.gridView=new Bn(e,{categoryName:o,emojiCategories:i,getEmojiByQuery:n,skinTone:r}),this.infoView=new Tn.SearchInfoView,this.searchView=new Qn(e,{gridView:this.gridView,resultsView:this.infoView}),this.categoriesView=new Wn(e,{emojiCategories:i,categoryName:o}),this.toneView=new Xn(e,{skinTone:r,skinTones:s}),this.items=this.createCollection([this.searchView,this.toneView,this.categoriesView,this.gridView,this.infoView]),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this.focusCycler=new Tn.FocusCycler({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[{tag:"div",children:[this.searchView,this.toneView],attributes:{class:["ck","ck-emoji__search"]}},this.categoriesView,this.gridView,{tag:"div",children:[this.infoView],attributes:{class:["ck","ck-search__results"]}}],attributes:{tabindex:"-1",class:["ck","ck-emoji","ck-search"]}}),this._setupEventListeners()}render(){super.render(),this.focusTracker.add(this.searchView.element),this.focusTracker.add(this.toneView.element),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.focusTracker.add(this.infoView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.searchView.focus()}_setupEventListeners(){const e=this.locale.t;this.searchView.on("search",((e,t)=>{t.query?this.categoriesView.disableCategories():this.categoriesView.enableCategories()})),this.searchView.on("search",((t,i)=>{1===i.query.length?this.infoView.set({primaryText:e("Keep on typing to see the emoji."),secondaryText:e("The query must contain at least two characters."),isVisible:!0}):i.resultsCount?this.infoView.set({isVisible:!1}):this.infoView.set({primaryText:e('No emojis were found matching "%0".',i.query),secondaryText:e("Please try a different phrase or check the spelling."),isVisible:!0})})),this.searchView.on("search",(()=>{this.fire("update")})),this.categoriesView.on("change:categoryName",((e,t,i)=>{this.gridView.categoryName=i,this.searchView.search("")})),this.toneView.on("change:skinTone",((e,t,i)=>{this.gridView.skinTone=i,this.searchView.search(this.searchView.getInputValue())}))}}var Zn=i(913),er={attributes:{"data-cke":!0}};er.setAttributes=Fn(),er.insert=On().bind(null,"head"),er.domAPI=Pn(),er.insertStyleElement=Rn();Sn()(Zn.A,er);Zn.A&&Zn.A.locals&&Zn.A.locals;const tr="emoji-picker";class ir extends e.Plugin{static get requires(){return[wn,Tn.ContextualBalloon,Tn.Dialog,r.Typing]}static get pluginName(){return"EmojiPicker"}static get isOfficialPlugin(){return!0}async init(){const e=this.editor;if(this._balloonPlugin=e.plugins.get("ContextualBalloon"),this._emojiRepositoryPlugin=e.plugins.get("EmojiRepository"),!await this._emojiRepositoryPlugin.isReady())return;const t=new En(e);e.commands.add("emoji",t),e.ui.componentFactory.add("emoji",(()=>{const e=this._createButton(Tn.ButtonView,t);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:emoji",(()=>this._createButton(Tn.MenuBarMenuListItemButtonView,t))),this._setupConversion()}destroy(){super.destroy(),this.emojiPickerView&&this.emojiPickerView.destroy()}get skinTone(){return this.emojiPickerView?this.emojiPickerView.gridView.skinTone:this.editor.config.get("emoji.skinTone")}showUI(e=""){this._showFakeVisualSelection(),this.emojiPickerView||(this.emojiPickerView=this._createEmojiPickerView()),e&&this.emojiPickerView.searchView.setInputValue(e),this.emojiPickerView.searchView.search(e),this._balloonPlugin.hasView(this.emojiPickerView)||this._balloonPlugin.add({view:this.emojiPickerView,position:this._getBalloonPositionData()}),this.emojiPickerView.focus()}_createButton(t,i){const n=new t(this.editor.locale),r=this.editor.locale.t;return n.bind("isEnabled").to(i,"isEnabled"),n.set({label:r("Emoji"),icon:e.icons.emoji,isToggleable:!0}),n.on("execute",(()=>{this.showUI()})),n}_createEmojiPickerView(){const e=new Yn(this.editor.locale,{emojiCategories:this._emojiRepositoryPlugin.getEmojiCategories(),skinTone:this.editor.config.get("emoji.skinTone"),skinTones:this._emojiRepositoryPlugin.getSkinTones(),getEmojiByQuery:e=>this._emojiRepositoryPlugin.getEmojiByQuery(e)});return this.listenTo(e.gridView,"execute",((e,t)=>{const i=this.editor,n=t.emoji;this._hideUI(),i.execute("insertText",{text:n})})),this.listenTo(e,"update",(()=>{this._balloonPlugin.visibleView===e&&this._balloonPlugin.updatePosition()})),e.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),(0,Tn.clickOutsideHandler)({emitter:e,contextElements:[this._balloonPlugin.view.element],callback:()=>this._hideUI(),activator:()=>this._balloonPlugin.visibleView===e}),e}_hideUI(){this._balloonPlugin.remove(this.emojiPickerView),this.emojiPickerView.searchView.setInputValue(""),this.editor.editing.view.focus(),this._hideFakeVisualSelection()}_setupConversion(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:tr,view:{classes:["ck-fake-emoji-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:tr,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-emoji-selection","ck-fake-emoji-selection_collapsed"],i),i}})}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;return{target:()=>e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(tr))t.updateMarker(tr,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(tr,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(tr,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(tr)&&e.change((e=>{e.removeMarker(tr)}))}}class nr extends e.Plugin{static get requires(){return[Vn,ir]}static get pluginName(){return"Emoji"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).emoji=n})();
5
+ */(()=>{var e={223:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji__categories-list{display:flex;justify-content:space-between;margin:0 var(--ck-spacing-large)}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text{border-width:0;border-bottom:2px solid transparent;font-size:var(--ck-font-size-big);min-height:var(--ck-font-size-big);min-width:var(--ck-font-size-big);padding:0}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text.ck-emoji__category-item.ck-on{border-bottom-color:var(--ck-color-base-active)}.ck.ck-emoji__categories-list>.ck.ck-button.ck-button_with-text>span{margin:auto}",""]);const c=o},291:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,":root{--ck-emoji-grid-tile-size:27px}.ck.ck-emoji .ck.ck-emoji__tiles{border-top:1px solid var(--ck-color-base-border);max-height:265px;max-width:100%;overflow-x:hidden;overflow-y:auto}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--ck-emoji-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-small)}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile{border:0;font-size:1.5em;height:var(--ck-emoji-grid-tile-size);min-height:var(--ck-emoji-grid-tile-size);min-width:var(--ck-emoji-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-emoji-grid-tile-size)}@media (prefers-reduced-motion:reduce){.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile{transition:none}}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile:focus:not(.ck-disabled),.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-emoji .ck.ck-emoji__tiles .ck-emoji__tile .ck-button__label{line-height:var(--ck-emoji-grid-tile-size);text-align:center;width:100%}",""]);const c=o},913:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji{width:320px}.ck .ck.ck-emoji__search{align-items:center;display:flex;justify-content:space-between;padding:var(--ck-spacing-large);padding-bottom:var(--ck-spacing-medium)}.ck .ck-fake-emoji-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-emoji-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const c=o},59:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(758),r=i.n(n),s=i(935),o=i.n(s)()(r());o.push([e.id,".ck.ck-emoji__skin-tone{margin-left:var(--ck-spacing-standard)}.ck.ck-emoji__skin-tone>.ck.ck-dropdown .ck.ck-list__item{min-width:1em}.ck.ck-emoji__skin-tone>.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:auto}",""]);const c=o},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var c=0;c<this.length;c++){var a=this[c][0];null!=a&&(o[a]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);n&&o[l[0]]||(void 0!==s&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=s),i&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=i):l[2]=i),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},758:e=>{"use strict";e.exports=function(e){return e[1]}},591:e=>{"use strict";var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var s={},o=[],c=0;c<e.length;c++){var a=e[c],u=n.base?a[0]+n.base:a[0],l=s[u]||0,h="".concat(u," ").concat(l);s[u]=l+1;var d=i(h),f={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(f);else{var g=r(f,n);n.byIndex=c,t.splice(c,0,{identifier:h,updater:g,references:1})}o.push(h)}return o}function r(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,r){var s=n(e=e||[],r=r||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var c=i(s[o]);t[c].references--}for(var a=n(e,r),u=0;u<s.length;u++){var l=i(s[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}s=a}}},128:e=>{"use strict";var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}},639:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function n(e,t,n,r){var s;if(n)s="";else{s="",r.supports&&(s+="@supports (".concat(r.supports,") {")),r.media&&(s+="@media ".concat(r.media," {"));var o=void 0!==r.layer;o&&(s+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),s+=r.css,o&&(s+="}"),r.media&&(s+="}"),r.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,s);else{var c=document.createTextNode(s),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(c,a[t]):e.appendChild(c)}}var r={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=r.singletonCounter++,i=r.singleton||(r.singleton=e.insertStyleElement(e));return{update:function(e){n(i,t,!1,e)},remove:function(e){n(i,t,!0,e)}}}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},834:(e,t,i)=>{e.exports=i(237)("./src/typing.js")},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{Emoji:()=>nr,EmojiCommand:()=>Tn,EmojiMention:()=>Vn,EmojiPicker:()=>ir,EmojiRepository:()=>wn});var e=i(782),t=i(584),r=i(834);function s(e){return Array.isArray?Array.isArray(e):"[object Array]"===d(e)}function o(e){return"string"==typeof e}function c(e){return"number"==typeof e}function a(e){return!0===e||!1===e||function(e){return u(e)&&null!==e}(e)&&"[object Boolean]"==d(e)}function u(e){return"object"==typeof e}function l(e){return null!=e}function h(e){return!e.trim().length}function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const f=Object.prototype.hasOwnProperty;class g{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=p(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function p(e){let t=null,i=null,n=null,r=1,c=null;if(o(e)||s(e))n=e,t=m(e),i=y(e);else{if(!f.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const s=e.name;if(n=s,f.call(e,"weight")&&(r=e.weight,r<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(s));t=m(s),i=y(s),c=e.getFn}return{path:t,id:i,weight:r,src:n,getFn:c}}function m(e){return s(e)?e:e.split(".")}function y(e){return s(e)?e.join("."):e}var k={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(e,t){let i=[],n=!1;const r=(e,t,u)=>{if(l(e))if(t[u]){const h=e[t[u]];if(!l(h))return;if(u===t.length-1&&(o(h)||c(h)||a(h)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(h));else if(s(h)){n=!0;for(let e=0,i=h.length;e<i;e+=1)r(h[e],t,u+1)}else t.length&&r(h,t,u+1)}else i.push(e)};return r(e,o(t)?t.split("."):t,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const b=/[^ ]+/g;class _{constructor({getFn:e=k.getFn,fieldNormWeight:t=k.fieldNormWeight}={}){this.norm=function(e=1,t=3){const i=new Map,n=Math.pow(10,t);return{get(t){const r=t.match(b).length;if(i.has(r))return i.get(r);const s=1/Math.pow(r,.5*e),o=parseFloat(Math.round(s*n)/n);return i.set(r,o),o},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();o(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!l(e)||h(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach(((t,n)=>{let r=t.getFn?t.getFn(e):this.getFn(e,t.path);if(l(r))if(s(r)){let e=[];const t=[{nestedArrIndex:-1,value:r}];for(;t.length;){const{nestedArrIndex:i,value:n}=t.pop();if(l(n))if(o(n)&&!h(n)){let t={v:n,i,n:this.norm.get(n)};e.push(t)}else s(n)&&n.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[n]=e}else if(o(r)&&!h(r)){let e={v:r,n:this.norm.get(r)};i.$[n]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function v(e,t,{getFn:i=k.getFn,fieldNormWeight:n=k.fieldNormWeight}={}){const r=new _({getFn:i,fieldNormWeight:n});return r.setKeys(e.map(p)),r.setSources(t),r.create(),r}function w(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:r=k.distance,ignoreLocation:s=k.ignoreLocation}={}){const o=t/e.length;if(s)return o;const c=Math.abs(n-i);return r?o+c/r:c?1:o}const j=32;function x(e,t,i,{location:n=k.location,distance:r=k.distance,threshold:s=k.threshold,findAllMatches:o=k.findAllMatches,minMatchCharLength:c=k.minMatchCharLength,includeMatches:a=k.includeMatches,ignoreLocation:u=k.ignoreLocation}={}){if(t.length>j)throw new Error(`Pattern length exceeds max of ${j}.`);const l=t.length,h=e.length,d=Math.max(0,Math.min(n,h));let f=s,g=d;const p=c>1||a,m=p?Array(h):[];let y;for(;(y=e.indexOf(t,g))>-1;){let e=w(t,{currentLocation:y,expectedLocation:d,distance:r,ignoreLocation:u});if(f=Math.min(e,f),g=y+l,p){let e=0;for(;e<l;)m[y+e]=1,e+=1}}g=-1;let b=[],_=1,v=l+h;const x=1<<l-1;for(let n=0;n<l;n+=1){let s=0,c=v;for(;s<c;){w(t,{errors:n,currentLocation:d+c,expectedLocation:d,distance:r,ignoreLocation:u})<=f?s=c:v=c,c=Math.floor((v-s)/2+s)}v=c;let a=Math.max(1,d-c+1),y=o?h:Math.min(d+c,h)+l,k=Array(y+2);k[y+1]=(1<<n)-1;for(let s=y;s>=a;s-=1){let o=s-1,c=i[e.charAt(o)];if(p&&(m[o]=+!!c),k[s]=(k[s+1]<<1|1)&c,n&&(k[s]|=(b[s+1]|b[s])<<1|1|b[s+1]),k[s]&x&&(_=w(t,{errors:n,currentLocation:o,expectedLocation:d,distance:r,ignoreLocation:u}),_<=f)){if(f=_,g=o,g<=d)break;a=Math.max(1,2*d-g)}}if(w(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:u})>f)break;b=k}const M={isMatch:g>=0,score:Math.max(.001,_)};if(p){const e=function(e=[],t=k.minMatchCharLength){let i=[],n=-1,r=-1,s=0;for(let o=e.length;s<o;s+=1){let o=e[s];o&&-1===n?n=s:o||-1===n||(r=s-1,r-n+1>=t&&i.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&i.push([n,s-1]),i}(m,c);e.length?a&&(M.indices=e):M.isMatch=!1}return M}function M(e){let t={};for(let i=0,n=e.length;i<n;i+=1){const r=e.charAt(i);t[r]=(t[r]||0)|1<<n-i-1}return t}class V{constructor(e,{location:t=k.location,threshold:i=k.threshold,distance:n=k.distance,includeMatches:r=k.includeMatches,findAllMatches:s=k.findAllMatches,minMatchCharLength:o=k.minMatchCharLength,isCaseSensitive:c=k.isCaseSensitive,ignoreLocation:a=k.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:a},this.pattern=c?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:M(e),startIndex:t})},l=this.pattern.length;if(l>j){let e=0;const t=l%j,i=l-t;for(;e<i;)u(this.pattern.substr(e,j),e),e+=j;if(t){const e=l-j;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return i&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:c,ignoreLocation:a}=this.options;let u=[],l=0,h=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:f})=>{const{isMatch:g,score:p,indices:m}=x(e,t,d,{location:n+f,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:c,includeMatches:i,ignoreLocation:a});g&&(h=!0),l+=p,g&&m&&(u=[...u,...m])}));let d={isMatch:h,score:h?l/this.chunks.length:1};return h&&i&&(d.indices=u),d}}class E{constructor(e){this.pattern=e}static isMultiMatch(e){return T(e,this.multiRegex)}static isSingleMatch(e){return T(e,this.singleRegex)}search(){}}function T(e,t){const i=e.match(t);return i?i[1]:null}class C extends E{constructor(e,{location:t=k.location,threshold:i=k.threshold,distance:n=k.distance,includeMatches:r=k.includeMatches,findAllMatches:s=k.findAllMatches,minMatchCharLength:o=k.minMatchCharLength,isCaseSensitive:c=k.isCaseSensitive,ignoreLocation:a=k.ignoreLocation}={}){super(e),this._bitapSearch=new V(e,{location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends E{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],r=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+r,n.push([t,i-1]);const s=!!n.length;return{isMatch:s,score:s?0:1,indices:n}}}const L=[class extends E{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},S,class extends E{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends E{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends E{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends E{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends E{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},C],P=L.length,A=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const O=new Set([C.type,S.type]);class I{constructor(e,{isCaseSensitive:t=k.isCaseSensitive,includeMatches:i=k.includeMatches,minMatchCharLength:n=k.minMatchCharLength,ignoreLocation:r=k.ignoreLocation,findAllMatches:s=k.findAllMatches,location:o=k.location,threshold:c=k.threshold,distance:a=k.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:s,ignoreLocation:r,location:o,threshold:c,distance:a},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(A).filter((e=>e&&!!e.trim())),n=[];for(let e=0,r=i.length;e<r;e+=1){const r=i[e];let s=!1,o=-1;for(;!s&&++o<P;){const e=L[o];let i=e.isMultiMatch(r);i&&(n.push(new e(i,t)),s=!0)}if(!s)for(o=-1;++o<P;){const e=L[o];let i=e.isSingleMatch(r);if(i){n.push(new e(i,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let r=0,s=[],o=0;for(let n=0,c=t.length;n<c;n+=1){const c=t[n];s.length=0,r=0;for(let t=0,n=c.length;t<n;t+=1){const n=c[t],{isMatch:a,indices:u,score:l}=n.search(e);if(!a){o=0,r=0,s.length=0;break}if(r+=1,o+=l,i){const e=n.constructor.type;O.has(e)?s=[...s,...u]:s.push(u)}}if(r){let e={isMatch:!0,score:o/r};return i&&(e.indices=s),e}}return{isMatch:!1,score:1}}}const F=[];function R(e,t){for(let i=0,n=F.length;i<n;i+=1){let n=F[i];if(n.condition(e,t))return new n(e,t)}return new V(e,t)}const $="$and",N="$or",z="$path",B="$val",D=e=>!(!e[$]&&!e[N]),q=e=>({[$]:Object.keys(e).map((t=>({[t]:e[t]})))});function W(e,t,{auto:i=!0}={}){const n=e=>{let r=Object.keys(e);const c=(e=>!!e[z])(e);if(!c&&r.length>1&&!D(e))return n(q(e));if((e=>!s(e)&&u(e)&&!D(e))(e)){const n=c?e[z]:r[0],s=c?e[B]:e[n];if(!o(s))throw new Error((e=>`Invalid value for key ${e}`)(n));const a={keyId:y(n),pattern:s};return i&&(a.searcher=R(s,t)),a}let a={children:[],operator:r[0]};return r.forEach((t=>{const i=e[t];s(i)&&i.forEach((e=>{a.children.push(n(e))}))})),a};return D(e)||(e=q(e)),n(e)}function K(e,t){const i=e.matches;t.matches=[],l(i)&&i.forEach((e=>{if(!l(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let r={indices:i,value:n};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function U(e,t){t.score=e.score}class H{constructor(e,t={},i){this.options={...k,...t},this.options.useExtendedSearch,this._keyStore=new g(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof _))throw new Error("Incorrect 'index' type");this._myIndex=t||v(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){l(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,t.push(r))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:r,sortFn:s,ignoreFieldNorm:a}=this.options;let u=o(e)?o(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=k.ignoreFieldNorm}){e.forEach((e=>{let i=1;e.matches.forEach((({key:e,norm:n,score:r})=>{const s=e?e.weight:null;i*=Math.pow(0===r&&s?Number.EPSILON:r,(s||1)*(t?1:n))})),e.score=i}))}(u,{ignoreFieldNorm:a}),r&&u.sort(s),c(t)&&t>-1&&(u=u.slice(0,t)),function(e,t,{includeMatches:i=k.includeMatches,includeScore:n=k.includeScore}={}){const r=[];return i&&r.push(K),n&&r.push(U),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return r.length&&r.forEach((t=>{t(e,n)})),n}))}(u,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=R(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i,n:r})=>{if(!l(e))return;const{isMatch:s,score:o,indices:c}=t.searchIn(e);s&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:r,indices:c}]})})),n}_searchLogical(e){const t=W(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:r}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:r});return s&&s.length?[{idx:n,item:t,matches:s}]:[]}const r=[];for(let s=0,o=e.children.length;s<o;s+=1){const o=e.children[s],c=i(o,t,n);if(c.length)r.push(...c);else if(e.operator===$)return[]}return r},n=this._myIndex.records,r={},s=[];return n.forEach((({$:e,i:n})=>{if(l(e)){let o=i(t,e,n);o.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},s.push(r[n])),o.forEach((({matches:e})=>{r[n].matches.push(...e)})))}})),s}_searchObjectList(e){const t=R(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach((({$:e,i:n})=>{if(!l(e))return;let s=[];i.forEach(((i,n)=>{s.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),s.length&&r.push({idx:n,item:e,matches:s})})),r}_findMatches({key:e,value:t,searcher:i}){if(!l(t))return[];let n=[];if(s(t))t.forEach((({v:t,i:r,n:s})=>{if(!l(t))return;const{isMatch:o,score:c,indices:a}=i.searchIn(t);o&&n.push({score:c,key:e,value:t,idx:r,norm:s,indices:a})}));else{const{v:r,n:s}=t,{isMatch:o,score:c,indices:a}=i.searchIn(r);o&&n.push({score:c,key:e,value:r,norm:s,indices:a})}return n}}H.version="7.0.0",H.createIndex=v,H.parseIndex=function(e,{getFn:t=k.getFn,fieldNormWeight:i=k.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new _({getFn:t,fieldNormWeight:i});return s.setKeys(n),s.setIndexRecords(r),s},H.config=k,H.parseQuery=W,function(...e){F.push(...e)}(I);const Q="object"==typeof global&&global&&global.Object===Object&&global;var G="object"==typeof self&&self&&self.Object===Object&&self;const J=Q||G||Function("return this")();const X=J.Symbol;var Y=Object.prototype,Z=Y.hasOwnProperty,ee=Y.toString,te=X?X.toStringTag:void 0;const ie=function(e){var t=Z.call(e,te),i=e[te];try{e[te]=void 0;var n=!0}catch(e){}var r=ee.call(e);return n&&(t?e[te]=i:delete e[te]),r};var ne=Object.prototype.toString;const re=function(e){return ne.call(e)};var se=X?X.toStringTag:void 0;const oe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":se&&se in Object(e)?ie(e):re(e)};const ce=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const ae=function(e){if(!ce(e))return!1;var t=oe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const ue=J["__core-js_shared__"];var le,he=(le=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+le:"";const de=function(e){return!!he&&he in e};var fe=Function.prototype.toString;const ge=function(e){if(null!=e){try{return fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var pe=/^\[object .+?Constructor\]$/,me=Function.prototype,ye=Object.prototype,ke=me.toString,be=ye.hasOwnProperty,_e=RegExp("^"+ke.call(be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ve=function(e){return!(!ce(e)||de(e))&&(ae(e)?_e:pe).test(ge(e))};const we=function(e,t){return null==e?void 0:e[t]};const je=function(e,t){var i=we(e,t);return ve(i)?i:void 0};const xe=function(){try{var e=je(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Me=function(e,t,i){"__proto__"==t&&xe?xe(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i};const Ve=function(e,t,i,n){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(n,o,i(o),e)}return n};const Ee=function(e){return function(t,i,n){for(var r=-1,s=Object(t),o=n(t),c=o.length;c--;){var a=o[e?c:++r];if(!1===i(s[a],a,s))break}return t}}();const Te=function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n};const Ce=function(e){return null!=e&&"object"==typeof e};const Se=function(e){return Ce(e)&&"[object Arguments]"==oe(e)};var Le=Object.prototype,Pe=Le.hasOwnProperty,Ae=Le.propertyIsEnumerable;const Oe=Se(function(){return arguments}())?Se:function(e){return Ce(e)&&Pe.call(e,"callee")&&!Ae.call(e,"callee")};const Ie=Array.isArray;const Fe=function(){return!1};var Re="object"==typeof exports&&exports&&!exports.nodeType&&exports,$e=Re&&"object"==typeof module&&module&&!module.nodeType&&module,Ne=$e&&$e.exports===Re?J.Buffer:void 0;const ze=(Ne?Ne.isBuffer:void 0)||Fe;var Be=/^(?:0|[1-9]\d*)$/;const De=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Be.test(e))&&e>-1&&e%1==0&&e<t};const qe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var We={};We["[object Float32Array]"]=We["[object Float64Array]"]=We["[object Int8Array]"]=We["[object Int16Array]"]=We["[object Int32Array]"]=We["[object Uint8Array]"]=We["[object Uint8ClampedArray]"]=We["[object Uint16Array]"]=We["[object Uint32Array]"]=!0,We["[object Arguments]"]=We["[object Array]"]=We["[object ArrayBuffer]"]=We["[object Boolean]"]=We["[object DataView]"]=We["[object Date]"]=We["[object Error]"]=We["[object Function]"]=We["[object Map]"]=We["[object Number]"]=We["[object Object]"]=We["[object RegExp]"]=We["[object Set]"]=We["[object String]"]=We["[object WeakMap]"]=!1;const Ke=function(e){return Ce(e)&&qe(e.length)&&!!We[oe(e)]};const Ue=function(e){return function(t){return e(t)}};var He="object"==typeof exports&&exports&&!exports.nodeType&&exports,Qe=He&&"object"==typeof module&&module&&!module.nodeType&&module,Ge=Qe&&Qe.exports===He&&Q.process,Je=function(){try{var e=Qe&&Qe.require&&Qe.require("util").types;return e||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}();var Xe=Je&&Je.isTypedArray;const Ye=Xe?Ue(Xe):Ke;var Ze=Object.prototype.hasOwnProperty;const et=function(e,t){var i=Ie(e),n=!i&&Oe(e),r=!i&&!n&&ze(e),s=!i&&!n&&!r&&Ye(e),o=i||n||r||s,c=o?Te(e.length,String):[],a=c.length;for(var u in e)!t&&!Ze.call(e,u)||o&&("length"==u||r&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||De(u,a))||c.push(u);return c};var tt=Object.prototype;const it=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||tt)};const nt=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object);var rt=Object.prototype.hasOwnProperty;const st=function(e){if(!it(e))return nt(e);var t=[];for(var i in Object(e))rt.call(e,i)&&"constructor"!=i&&t.push(i);return t};const ot=function(e){return null!=e&&qe(e.length)&&!ae(e)};const ct=function(e){return ot(e)?et(e):st(e)};const at=function(e,t){return function(i,n){if(null==i)return i;if(!ot(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s<r)&&!1!==n(o[s],s,o););return i}}((function(e,t){return e&&Ee(e,t,ct)}));const ut=function(e,t,i,n){return at(e,(function(e,r,s){t(n,e,i(e),s)})),n};const lt=function(){this.__data__=[],this.size=0};const ht=function(e,t){return e===t||e!=e&&t!=t};const dt=function(e,t){for(var i=e.length;i--;)if(ht(e[i][0],t))return i;return-1};var ft=Array.prototype.splice;const gt=function(e){var t=this.__data__,i=dt(t,e);return!(i<0)&&(i==t.length-1?t.pop():ft.call(t,i,1),--this.size,!0)};const pt=function(e){var t=this.__data__,i=dt(t,e);return i<0?void 0:t[i][1]};const mt=function(e){return dt(this.__data__,e)>-1};const yt=function(e,t){var i=this.__data__,n=dt(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function kt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}kt.prototype.clear=lt,kt.prototype.delete=gt,kt.prototype.get=pt,kt.prototype.has=mt,kt.prototype.set=yt;const bt=kt;const _t=function(){this.__data__=new bt,this.size=0};const vt=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i};const wt=function(e){return this.__data__.get(e)};const jt=function(e){return this.__data__.has(e)};const xt=je(J,"Map");const Mt=je(Object,"create");const Vt=function(){this.__data__=Mt?Mt(null):{},this.size=0};const Et=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Tt=Object.prototype.hasOwnProperty;const Ct=function(e){var t=this.__data__;if(Mt){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Tt.call(t,e)?t[e]:void 0};var St=Object.prototype.hasOwnProperty;const Lt=function(e){var t=this.__data__;return Mt?void 0!==t[e]:St.call(t,e)};const Pt=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Mt&&void 0===t?"__lodash_hash_undefined__":t,this};function At(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}At.prototype.clear=Vt,At.prototype.delete=Et,At.prototype.get=Ct,At.prototype.has=Lt,At.prototype.set=Pt;const Ot=At;const It=function(){this.size=0,this.__data__={hash:new Ot,map:new(xt||bt),string:new Ot}};const Ft=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Rt=function(e,t){var i=e.__data__;return Ft(t)?i["string"==typeof t?"string":"hash"]:i.map};const $t=function(e){var t=Rt(this,e).delete(e);return this.size-=t?1:0,t};const Nt=function(e){return Rt(this,e).get(e)};const zt=function(e){return Rt(this,e).has(e)};const Bt=function(e,t){var i=Rt(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function Dt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Dt.prototype.clear=It,Dt.prototype.delete=$t,Dt.prototype.get=Nt,Dt.prototype.has=zt,Dt.prototype.set=Bt;const qt=Dt;const Wt=function(e,t){var i=this.__data__;if(i instanceof bt){var n=i.__data__;if(!xt||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new qt(n)}return i.set(e,t),this.size=i.size,this};function Kt(e){var t=this.__data__=new bt(e);this.size=t.size}Kt.prototype.clear=_t,Kt.prototype.delete=vt,Kt.prototype.get=wt,Kt.prototype.has=jt,Kt.prototype.set=Wt;const Ut=Kt;const Ht=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Qt=function(e){return this.__data__.has(e)};function Gt(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new qt;++t<i;)this.add(e[t])}Gt.prototype.add=Gt.prototype.push=Ht,Gt.prototype.has=Qt;const Jt=Gt;const Xt=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1};const Yt=function(e,t){return e.has(t)};const Zt=function(e,t,i,n,r,s){var o=1&i,c=e.length,a=t.length;if(c!=a&&!(o&&a>c))return!1;var u=s.get(e),l=s.get(t);if(u&&l)return u==t&&l==e;var h=-1,d=!0,f=2&i?new Jt:void 0;for(s.set(e,t),s.set(t,e);++h<c;){var g=e[h],p=t[h];if(n)var m=o?n(p,g,h,t,e,s):n(g,p,h,e,t,s);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!Xt(t,(function(e,t){if(!Yt(f,t)&&(g===e||r(g,e,i,n,s)))return f.push(t)}))){d=!1;break}}else if(g!==p&&!r(g,p,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d};const ei=J.Uint8Array;const ti=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i};const ii=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i};var ni=X?X.prototype:void 0,ri=ni?ni.valueOf:void 0;const si=function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new ei(e),new ei(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ht(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var c=ti;case"[object Set]":var a=1&n;if(c||(c=ii),e.size!=t.size&&!a)return!1;var u=o.get(e);if(u)return u==t;n|=2,o.set(e,t);var l=Zt(c(e),c(t),n,r,s,o);return o.delete(e),l;case"[object Symbol]":if(ri)return ri.call(e)==ri.call(t)}return!1};const oi=function(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e};const ci=function(e,t,i){var n=t(e);return Ie(e)?n:oi(n,i(e))};const ai=function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var o=e[i];t(o,i,e)&&(s[r++]=o)}return s};const ui=function(){return[]};var li=Object.prototype.propertyIsEnumerable,hi=Object.getOwnPropertySymbols;const di=hi?function(e){return null==e?[]:(e=Object(e),ai(hi(e),(function(t){return li.call(e,t)})))}:ui;const fi=function(e){return ci(e,ct,di)};var gi=Object.prototype.hasOwnProperty;const pi=function(e,t,i,n,r,s){var o=1&i,c=fi(e),a=c.length;if(a!=fi(t).length&&!o)return!1;for(var u=a;u--;){var l=c[u];if(!(o?l in t:gi.call(t,l)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=o;++u<a;){var p=e[l=c[u]],m=t[l];if(n)var y=o?n(m,p,l,t,e,s):n(p,m,l,e,t,s);if(!(void 0===y?p===m||r(p,m,i,n,s):y)){f=!1;break}g||(g="constructor"==l)}if(f&&!g){var k=e.constructor,b=t.constructor;k==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f};const mi=je(J,"DataView");const yi=je(J,"Promise");const ki=je(J,"Set");const bi=je(J,"WeakMap");var _i="[object Map]",vi="[object Promise]",wi="[object Set]",ji="[object WeakMap]",xi="[object DataView]",Mi=ge(mi),Vi=ge(xt),Ei=ge(yi),Ti=ge(ki),Ci=ge(bi),Si=oe;(mi&&Si(new mi(new ArrayBuffer(1)))!=xi||xt&&Si(new xt)!=_i||yi&&Si(yi.resolve())!=vi||ki&&Si(new ki)!=wi||bi&&Si(new bi)!=ji)&&(Si=function(e){var t=oe(e),i="[object Object]"==t?e.constructor:void 0,n=i?ge(i):"";if(n)switch(n){case Mi:return xi;case Vi:return _i;case Ei:return vi;case Ti:return wi;case Ci:return ji}return t});const Li=Si;var Pi="[object Arguments]",Ai="[object Array]",Oi="[object Object]",Ii=Object.prototype.hasOwnProperty;const Fi=function(e,t,i,n,r,s){var o=Ie(e),c=Ie(t),a=o?Ai:Li(e),u=c?Ai:Li(t),l=(a=a==Pi?Oi:a)==Oi,h=(u=u==Pi?Oi:u)==Oi,d=a==u;if(d&&ze(e)){if(!ze(t))return!1;o=!0,l=!1}if(d&&!l)return s||(s=new Ut),o||Ye(e)?Zt(e,t,i,n,r,s):si(e,t,a,i,n,r,s);if(!(1&i)){var f=l&&Ii.call(e,"__wrapped__"),g=h&&Ii.call(t,"__wrapped__");if(f||g){var p=f?e.value():e,m=g?t.value():t;return s||(s=new Ut),r(p,m,i,n,s)}}return!!d&&(s||(s=new Ut),pi(e,t,i,n,r,s))};const Ri=function e(t,i,n,r,s){return t===i||(null==t||null==i||!Ce(t)&&!Ce(i)?t!=t&&i!=i:Fi(t,i,n,r,e,s))};const $i=function(e,t,i,n){var r=i.length,s=r,o=!n;if(null==e)return!s;for(e=Object(e);r--;){var c=i[r];if(o&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++r<s;){var a=(c=i[r])[0],u=e[a],l=c[1];if(o&&c[2]){if(void 0===u&&!(a in e))return!1}else{var h=new Ut;if(n)var d=n(u,l,a,e,t,h);if(!(void 0===d?Ri(l,u,3,n,h):d))return!1}}return!0};const Ni=function(e){return e==e&&!ce(e)};const zi=function(e){for(var t=ct(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,Ni(r)]}return t};const Bi=function(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}};const Di=function(e){var t=zi(e);return 1==t.length&&t[0][2]?Bi(t[0][0],t[0][1]):function(i){return i===e||$i(i,e,t)}};const qi=function(e){return"symbol"==typeof e||Ce(e)&&"[object Symbol]"==oe(e)};var Wi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ki=/^\w*$/;const Ui=function(e,t){if(Ie(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!qi(e))||(Ki.test(e)||!Wi.test(e)||null!=t&&e in Object(t))};function Hi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(Hi.Cache||qt),i}Hi.Cache=qt;const Qi=Hi;var Gi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ji=/\\(\\)?/g;const Xi=function(e){var t=Qi(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Gi,(function(e,i,n,r){t.push(n?r.replace(Ji,"$1"):i||e)})),t}));const Yi=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r};var Zi=X?X.prototype:void 0,en=Zi?Zi.toString:void 0;const tn=function e(t){if("string"==typeof t)return t;if(Ie(t))return Yi(t,e)+"";if(qi(t))return en?en.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i};const nn=function(e){return null==e?"":tn(e)};const rn=function(e,t){return Ie(e)?e:Ui(e,t)?[e]:Xi(nn(e))};const sn=function(e){if("string"==typeof e||qi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const on=function(e,t){for(var i=0,n=(t=rn(t,e)).length;null!=e&&i<n;)e=e[sn(t[i++])];return i&&i==n?e:void 0};const cn=function(e,t,i){var n=null==e?void 0:on(e,t);return void 0===n?i:n};const an=function(e,t){return null!=e&&t in Object(e)};const un=function(e,t,i){for(var n=-1,r=(t=rn(t,e)).length,s=!1;++n<r;){var o=sn(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&qe(r)&&De(o,r)&&(Ie(e)||Oe(e))};const ln=function(e,t){return null!=e&&un(e,t,an)};const hn=function(e,t){return Ui(e)&&Ni(t)?Bi(sn(e),t):function(i){var n=cn(i,e);return void 0===n&&n===t?ln(i,e):Ri(t,n,3)}};const dn=function(e){return e};const fn=function(e){return function(t){return null==t?void 0:t[e]}};const gn=function(e){return function(t){return on(t,e)}};const pn=function(e){return Ui(e)?fn(sn(e)):gn(e)};const mn=function(e){return"function"==typeof e?e:null==e?dn:"object"==typeof e?Ie(e)?hn(e[0],e[1]):Di(e):pn(e)};const yn=function(e,t){return function(i,n){var r=Ie(i)?Ve:ut,s=t?t():{};return r(i,e,mn(n,2),s)}};var kn=Object.prototype.hasOwnProperty;const bn=yn((function(e,t,i){kn.call(e,i)?e[i].push(t):Me(e,i,[t])})),_n={0:"default",1:"light",2:"medium-light",3:"medium",4:"medium-dark",5:"dark"};class vn extends e.Plugin{static get pluginName(){return"EmojiRepository"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.editor.config.define("emoji",{version:16,skinTone:"default"}),this._database=[],this._databasePromise=new Promise((e=>{this._databasePromiseResolveCallback=e})),this._fuseSearch=null}async init(){const e=this.editor.config.get("emoji.version"),i="https://cdn.ckeditor.com/ckeditor5/data/emoji/{version}/en.json".replace("{version}",`${e}`),n=await async function(e){const i=await fetch(e).then((e=>e.ok?e.json():[])).catch((()=>[]));i.length||(0,t.logWarning)("emoji-database-load-failed");return i}(i);if(!n.length)return this._databasePromiseResolveCallback(!1);const r=function(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.whiteSpace="nowrap",e.style.fontSize="24px",document.body.appendChild(e),e}();return this._database=n.filter((e=>function(e){return 2!==e.group}(e))).filter((e=>vn._isEmojiSupported(e,r))).map((e=>function(e){const t={...e,skins:{default:e.emoji}};e.skins&&e.skins.forEach((e=>{const i=_n[e.tone];t.skins[i]=e.emoji}));return t}(e))),r.remove(),this._fuseSearch=new H(this._database,{keys:[{name:"emoticon",weight:5},{name:"annotation",weight:3},{name:"tags",weight:1}],minMatchCharLength:2,threshold:0,ignoreLocation:!0}),this._databasePromiseResolveCallback(!0)}getEmojiByQuery(e){if(!this._fuseSearch)return[];const t=e.split(/\s/).filter(Boolean);return t.some((e=>e.length>=2))?this._fuseSearch.search({$or:[{emoticon:e},{$and:t.map((e=>({annotation:e})))},{$and:t.map((e=>({tags:e})))}]}).map((e=>e.item)):[]}getEmojiCategories(){if(!this._database.length)return[];const{t:e}=this.editor.locale,t=[{title:e("Smileys & Expressions"),icon:"😀",groupId:0},{title:e("Gestures & People"),icon:"👋",groupId:1},{title:e("Animals & Nature"),icon:"🐻",groupId:3},{title:e("Food & Drinks"),icon:"🍎",groupId:4},{title:e("Travel & Places"),icon:"🚘",groupId:5},{title:e("Activities"),icon:"🏀",groupId:6},{title:e("Objects"),icon:"💡",groupId:7},{title:e("Symbols"),icon:"🟢",groupId:8},{title:e("Flags"),icon:"🏁",groupId:9}],i=bn(this._database,"group");return t.map((e=>({...e,items:i[e.groupId]})))}getSkinTones(){const{t:e}=this.editor.locale;return[{id:"default",icon:"👋",tooltip:e("Default skin tone")},{id:"light",icon:"👋🏻",tooltip:e("Light skin tone")},{id:"medium-light",icon:"👋🏼",tooltip:e("Medium Light skin tone")},{id:"medium",icon:"👋🏽",tooltip:e("Medium skin tone")},{id:"medium-dark",icon:"👋🏾",tooltip:e("Medium Dark skin tone")},{id:"dark",icon:"👋🏿",tooltip:e("Dark skin tone")}]}isReady(){return this._databasePromise}}vn._isEmojiSupported=function(e,t){const i=function(e,t){const i=document.createElement("span");i.textContent=t,e.appendChild(i);const n=i.offsetWidth;return e.removeChild(i),n}(t,e.emoji);return i/1.8<24&&i>=24};const wn=vn;const jn=":",xn=":__EMOJI_SHOW_ALL:",Mn=":__EMOJI_HINT:";class Vn extends e.Plugin{static get requires(){return[wn,r.Typing,"Mention"]}static get pluginName(){return"EmojiMention"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.editor.config.define("emoji",{dropdownLimit:6}),this._emojiDropdownLimit=e.config.get("emoji.dropdownLimit"),this._skinTone=e.config.get("emoji.skinTone"),this._setupMentionConfiguration(e)}_setupMentionConfiguration(e){const i=e.config.get("mergeFields.prefix"),n=e.config.get("mention.feeds"),r=!!i&&i[0]===jn;if(n.filter((e=>!e._isEmojiMarker)).some((e=>e.marker===jn))||r)return void(0,t.logWarning)("emoji-config-marker-already-used",{marker:jn});if(n.some((e=>e._isEmojiMarker)))return;const s={_isEmojiMarker:!0,marker:jn,dropdownLimit:this._emojiDropdownLimit,itemRenderer:this._customItemRendererFactory(this.editor.t),feed:this._queryEmojiCallbackFactory()};this.editor.config.set("mention.feeds",[...n,s])}async init(){const e=this.editor;this._emojiPickerPlugin=e.plugins.has("EmojiPicker")?e.plugins.get("EmojiPicker"):null,this._emojiRepositoryPlugin=e.plugins.get("EmojiRepository"),this._isEmojiRepositoryAvailable=await this._emojiRepositoryPlugin.isReady(),this._isEmojiRepositoryAvailable&&e.once("ready",this._overrideMentionExecuteListener.bind(this))}_customItemRendererFactory(e){return t=>{const i=document.createElement("button");i.classList.add("ck"),i.classList.add("ck-button"),i.classList.add("ck-button_with-text"),i.id=`mention-list-item-id${t.id.slice(0,-1)}`,i.type="button",i.tabIndex=-1;const n=document.createElement("span");return n.classList.add("ck"),n.classList.add("ck-button__label"),i.appendChild(n),t.id===Mn?(i.classList.add("ck-list-item-button"),i.classList.add("ck-disabled"),n.textContent=e("Keep on typing to see the emoji.")):t.id===xn?n.textContent=e("Show all emoji..."):n.textContent=`${t.text} ${t.id}`,i}}_overrideMentionExecuteListener(){const e=this.editor;e.commands.get("mention").on("execute",((t,i)=>{const n=i[0];if(n.marker===jn&&(t.stop(),n.mention.id!==Mn))if(n.mention.id===xn){const t=[...n.range.getItems()].filter((e=>e.is("$textProxy"))).map((e=>e.data)).reduce(((e,t)=>e+t),"");e.model.change((t=>{e.model.deleteContent(t.createSelection(n.range))}));const i=this._emojiPickerPlugin;i.showUI(t.slice(1)),setTimeout((()=>{i.emojiPickerView.focus()}))}else e.execute("insertText",{text:n.mention.text,range:n.range})}),{priority:"high"})}_queryEmojiCallbackFactory(){return e=>{if(e.startsWith(" "))return[];if(!this._isEmojiRepositoryAvailable)return[];const t=this._emojiRepositoryPlugin.getEmojiByQuery(e).map((e=>{let t=e.skins[this._skinTone]||e.skins.default;return this._emojiPickerPlugin&&(t=e.skins[this._emojiPickerPlugin.skinTone]||e.skins.default),{id:`:${e.annotation}:`,text:t}}));if(!this._emojiPickerPlugin)return t.slice(0,this._emojiDropdownLimit);const i={id:e.length>1?xn:Mn};return[...t.slice(0,this._emojiDropdownLimit-1),i]}}}var En=i(311);class Tn extends e.Command{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=t.checkChild(i.getFirstPosition(),"$text")}execute(e=""){this.editor.plugins.get("EmojiPicker").showUI(e)}}var Cn=i(591),Sn=i.n(Cn),Ln=i(639),Pn=i.n(Ln),An=i(128),On=i.n(An),In=i(21),Fn=i.n(In),Rn=i(51),$n=i.n(Rn),Nn=i(291),zn={attributes:{"data-cke":!0}};zn.setAttributes=Fn(),zn.insert=On().bind(null,"head"),zn.domAPI=Pn(),zn.insertStyleElement=$n();Sn()(Nn.A,zn);Nn.A&&Nn.A.locals&&Nn.A.locals;class Bn extends En.View{constructor(e,{categoryName:i,emojiCategories:n,getEmojiByQuery:r,skinTone:s}){super(e),this.set("isEmpty",!0),this.set("categoryName",i),this.set("skinTone",s),this.tiles=this.createCollection(),this.cachedTiles=this.createCollection(),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this._getEmojiByQuery=r,this.emojiCategories=n;const o=this.bindTemplate;this.setTemplate({tag:"div",children:[{tag:"div",attributes:{role:"grid",class:["ck","ck-emoji__grid"]},children:this.tiles}],attributes:{role:"tabpanel",class:["ck","ck-emoji__tiles",o.if("isEmpty","ck-hidden",(e=>e))]}}),(0,En.addKeyboardHandlingForGrid)({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>t.global.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy(),this.focusTracker.destroy()}focus(){const e=this.tiles.first;e&&e.focus()}filter(e){const{matchingItems:t,allItems:i}=e?this._getItemsByQuery(e.source):this._getItemsByCategory();return this._updateGrid(t),this.set("isEmpty",0===t.length),{resultsCount:t.length,totalItemsCount:i.length}}_getItemsByQuery(e){return{matchingItems:this._getEmojiByQuery(e),allItems:this.emojiCategories.flatMap((e=>e.items))}}_getItemsByCategory(){const e=this.emojiCategories.find((e=>e.title===this.categoryName)),{items:t}=e;return{matchingItems:t,allItems:t}}_updateGrid(e){[...this.tiles].forEach((e=>{this.focusTracker.remove(e),this.tiles.remove(e)})),e.map((e=>{const t=e.skins[this.skinTone]||e.skins.default;return this.cachedTiles.get(t)||this._createTile(t,e.annotation)})).forEach((e=>{this.tiles.add(e),this.focusTracker.add(e)}))}_createTile(e,t){const i=new En.ButtonView(this.locale);return i.viewUid=e,i.extendTemplate({attributes:{class:["ck-emoji__tile"]}}),i.set({label:e,tooltip:t,withText:!0,ariaLabel:t,ariaLabelledBy:void 0}),i.on("execute",(()=>{this.fire("execute",{name:t,emoji:e})})),this.cachedTiles.add(i),i}}var Dn=i(223),qn={attributes:{"data-cke":!0}};qn.setAttributes=Fn(),qn.insert=On().bind(null,"head"),qn.domAPI=Pn(),qn.insertStyleElement=$n();Sn()(Dn.A,qn);Dn.A&&Dn.A.locals&&Dn.A.locals;class Wn extends En.View{constructor(e,{emojiCategories:i,categoryName:n}){super(e),this.buttonViews=this.createCollection(i.map((e=>this._createCategoryButton(e)))),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this.focusCycler=new En.FocusCycler({focusables:this.buttonViews,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-emoji__categories-list"],role:"tablist"},children:this.buttonViews}),this.on("change:categoryName",((e,t,i,n)=>{const r=this.buttonViews.find((e=>e.tooltip===n));r&&(r.isOn=!1);this.buttonViews.find((e=>e.tooltip===i)).isOn=!0})),this.set("categoryName",n)}render(){super.render(),this.buttonViews.forEach((e=>{this.focusTracker.add(e)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),this.buttonViews.destroy()}focus(){this.buttonViews.first.focus()}enableCategories(){this.buttonViews.forEach((e=>{e.isEnabled=!0}))}disableCategories(){this.buttonViews.forEach((e=>{e.set({class:"",isEnabled:!1,isOn:!1})}))}_createCategoryButton(e){const t=new En.ButtonView,i=t.bindTemplate;return t.extendTemplate({attributes:{"aria-selected":i.to("isOn",(e=>e.toString())),class:["ck-emoji__category-item"]}}),t.set({ariaLabel:e.title,label:e.icon,role:"tab",tooltip:e.title,withText:!0,ariaLabelledBy:void 0}),t.on("execute",(()=>{this.categoryName=e.title})),t.on("change:isEnabled",(()=>{t.isEnabled&&t.tooltip===this.categoryName&&(t.isOn=!0)})),t}}var Kn=/[\\^$.*+?()[\]{}|]/g,Un=RegExp(Kn.source);const Hn=function(e){return(e=nn(e))&&Un.test(e)?e.replace(Kn,"\\$&"):e};class Qn extends En.View{constructor(e,{gridView:t,resultsView:i}){super(e),this.gridView=t;const n=e.t;this.inputView=new En.SearchTextView(this.locale,{queryView:{label:n("Find an emoji (min. 2 characters)"),creator:En.createLabeledInputText},filteredView:this.gridView,infoView:{instance:i}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search"],tabindex:"-1"},children:[this.inputView.queryView]}),this.inputView.delegate("search").to(this)}destroy(){super.destroy(),this.inputView.destroy()}search(e){const t=e?new RegExp(Hn(e),"ig"):null,i=this.gridView.filter(t);this.inputView.fire("search",{query:e,...i})}setInputValue(e){e?this.inputView.queryView.fieldView.value=e:this.inputView.queryView.fieldView.reset()}getInputValue(){return this.inputView.queryView.fieldView.element.value}focus(){this.inputView.focus()}}var Gn=i(59),Jn={attributes:{"data-cke":!0}};Jn.setAttributes=Fn(),Jn.insert=On().bind(null,"head"),Jn.domAPI=Pn(),Jn.insertStyleElement=$n();Sn()(Gn.A,Jn);Gn.A&&Gn.A.locals&&Gn.A.locals;class Xn extends En.View{constructor(e,{skinTone:i,skinTones:n}){super(e),this.set("skinTone",i),this._skinTones=n;const r=(0,e.t)("Select skin tone"),s=(0,En.createDropdown)(e),o=new t.Collection;for(const{id:e,icon:t,tooltip:i}of this._skinTones){const n={type:"button",model:new En.ViewModel({value:e,label:t,ariaLabel:i,tooltip:i,tooltipPosition:"e",role:"menuitemradio",withText:!0,ariaLabelledBy:void 0})};n.model.bind("isOn").to(this,"skinTone",(t=>t===e)),o.add(n)}(0,En.addListToDropdown)(s,o,{ariaLabel:r,role:"menu"}),s.buttonView.set({label:this._getSkinTone().icon,ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),this.dropdownView=s,this.listenTo(s,"execute",(e=>{this.skinTone=e.source.value})),s.buttonView.bind("label").to(this,"skinTone",(()=>this._getSkinTone().icon)),s.buttonView.bind("ariaLabel").to(this,"skinTone",(()=>`${this._getSkinTone().tooltip}, ${r}`)),this.setTemplate({tag:"div",attributes:{class:["ck","ck-emoji__skin-tone"]},children:[s]})}focus(){this.dropdownView.buttonView.focus()}_getSkinTone(){return this._skinTones.find((e=>e.id===this.skinTone))}}class Yn extends En.View{constructor(e,{emojiCategories:i,getEmojiByQuery:n,skinTone:r,skinTones:s}){super(e);const o=i[0].title;this.gridView=new Bn(e,{categoryName:o,emojiCategories:i,getEmojiByQuery:n,skinTone:r}),this.infoView=new En.SearchInfoView,this.searchView=new Qn(e,{gridView:this.gridView,resultsView:this.infoView}),this.categoriesView=new Wn(e,{emojiCategories:i,categoryName:o}),this.toneView=new Xn(e,{skinTone:r,skinTones:s}),this.items=this.createCollection([this.searchView,this.toneView,this.categoriesView,this.gridView,this.infoView]),this.focusTracker=new t.FocusTracker,this.keystrokes=new t.KeystrokeHandler,this.focusCycler=new En.FocusCycler({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[{tag:"div",children:[this.searchView,this.toneView],attributes:{class:["ck","ck-emoji__search"]}},this.categoriesView,this.gridView,{tag:"div",children:[this.infoView],attributes:{class:["ck","ck-search__results"]}}],attributes:{tabindex:"-1",class:["ck","ck-emoji","ck-search"]}}),this._setupEventListeners()}render(){super.render(),this.focusTracker.add(this.searchView.element),this.focusTracker.add(this.toneView.element),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.focusTracker.add(this.infoView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.searchView.focus()}_setupEventListeners(){const e=this.locale.t;this.searchView.on("search",((e,t)=>{t.query?this.categoriesView.disableCategories():this.categoriesView.enableCategories()})),this.searchView.on("search",((t,i)=>{1===i.query.length?this.infoView.set({primaryText:e("Keep on typing to see the emoji."),secondaryText:e("The query must contain at least two characters."),isVisible:!0}):i.resultsCount?this.infoView.set({isVisible:!1}):this.infoView.set({primaryText:e('No emojis were found matching "%0".',i.query),secondaryText:e("Please try a different phrase or check the spelling."),isVisible:!0})})),this.searchView.on("search",(()=>{this.fire("update"),this.gridView.element.scrollTo(0,0)})),this.categoriesView.on("change:categoryName",((e,t,i)=>{this.gridView.categoryName=i,this.searchView.search("")})),this.toneView.on("change:skinTone",((e,t,i)=>{this.gridView.skinTone=i,this.searchView.search(this.searchView.getInputValue())}))}}var Zn=i(913),er={attributes:{"data-cke":!0}};er.setAttributes=Fn(),er.insert=On().bind(null,"head"),er.domAPI=Pn(),er.insertStyleElement=$n();Sn()(Zn.A,er);Zn.A&&Zn.A.locals&&Zn.A.locals;const tr="emoji-picker";class ir extends e.Plugin{static get requires(){return[wn,En.ContextualBalloon,En.Dialog,r.Typing]}static get pluginName(){return"EmojiPicker"}static get isOfficialPlugin(){return!0}async init(){const e=this.editor;if(this._balloonPlugin=e.plugins.get("ContextualBalloon"),this._emojiRepositoryPlugin=e.plugins.get("EmojiRepository"),!await this._emojiRepositoryPlugin.isReady())return;const t=new Tn(e);e.commands.add("emoji",t),e.ui.componentFactory.add("emoji",(()=>{const e=this._createButton(En.ButtonView,t);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:emoji",(()=>this._createButton(En.MenuBarMenuListItemButtonView,t))),this._setupConversion()}destroy(){super.destroy(),this.emojiPickerView&&this.emojiPickerView.destroy()}get skinTone(){return this.emojiPickerView?this.emojiPickerView.gridView.skinTone:this.editor.config.get("emoji.skinTone")}showUI(e=""){this._showFakeVisualSelection(),this.emojiPickerView||(this.emojiPickerView=this._createEmojiPickerView()),e&&this.emojiPickerView.searchView.setInputValue(e),this.emojiPickerView.searchView.search(e),this._balloonPlugin.hasView(this.emojiPickerView)||this._balloonPlugin.add({view:this.emojiPickerView,position:this._getBalloonPositionData()}),this.emojiPickerView.focus()}_createButton(t,i){const n=new t(this.editor.locale),r=this.editor.locale.t;return n.bind("isEnabled").to(i,"isEnabled"),n.set({label:r("Emoji"),icon:e.icons.emoji,isToggleable:!0}),n.on("execute",(()=>{this.showUI()})),n}_createEmojiPickerView(){const e=new Yn(this.editor.locale,{emojiCategories:this._emojiRepositoryPlugin.getEmojiCategories(),skinTone:this.editor.config.get("emoji.skinTone"),skinTones:this._emojiRepositoryPlugin.getSkinTones(),getEmojiByQuery:e=>this._emojiRepositoryPlugin.getEmojiByQuery(e)});return this.listenTo(e.gridView,"execute",((e,t)=>{const i=this.editor,n=t.emoji;this._hideUI(),i.execute("insertText",{text:n})})),this.listenTo(e,"update",(()=>{this._balloonPlugin.visibleView===e&&this._balloonPlugin.updatePosition()})),e.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),(0,En.clickOutsideHandler)({emitter:e,contextElements:[this._balloonPlugin.view.element],callback:()=>this._hideUI(),activator:()=>this._balloonPlugin.visibleView===e}),e}_hideUI(){this._balloonPlugin.remove(this.emojiPickerView),this.emojiPickerView.searchView.setInputValue(""),this.editor.editing.view.focus(),this._hideFakeVisualSelection()}_setupConversion(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:tr,view:{classes:["ck-fake-emoji-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:tr,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-emoji-selection","ck-fake-emoji-selection_collapsed"],i),i}})}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;return{target:()=>e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(tr))t.updateMarker(tr,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(tr,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(tr,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(tr)&&e.change((e=>{e.removeMarker(tr)}))}}class nr extends e.Plugin{static get requires(){return[Vn,ir]}static get pluginName(){return"Emoji"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).emoji=n})();
package/dist/index.js CHANGED
@@ -369,11 +369,18 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
369
369
  });
370
370
  this._emojiDropdownLimit = editor.config.get('emoji.dropdownLimit');
371
371
  this._skinTone = editor.config.get('emoji.skinTone');
372
- const mentionFeedsConfigs = editor.config.get('mention.feeds');
372
+ this._setupMentionConfiguration(editor);
373
+ }
374
+ /**
375
+ * Initializes the configuration for emojis in the mention feature.
376
+ * If the marker used by emoji mention is already registered, it displays a warning.
377
+ * If emoji mention configuration is detected, it does not register it for a second time.
378
+ */ _setupMentionConfiguration(editor) {
373
379
  const mergeFieldsPrefix = editor.config.get('mergeFields.prefix');
374
- const markerAlreadyUsed = mentionFeedsConfigs.some((config)=>config.marker === EMOJI_MENTION_MARKER);
375
- const isMarkerUsedByMergeFields = mergeFieldsPrefix ? mergeFieldsPrefix[0] === EMOJI_MENTION_MARKER : false;
376
- if (markerAlreadyUsed || isMarkerUsedByMergeFields) {
380
+ const mentionFeedsConfigs = editor.config.get('mention.feeds');
381
+ const isEmojiMarkerUsedByMergeFields = mergeFieldsPrefix ? mergeFieldsPrefix[0] === EMOJI_MENTION_MARKER : false;
382
+ const isEmojiMarkerUsedByMention = mentionFeedsConfigs.filter((config)=>!config._isEmojiMarker).some((config)=>config.marker === EMOJI_MENTION_MARKER);
383
+ if (isEmojiMarkerUsedByMention || isEmojiMarkerUsedByMergeFields) {
377
384
  /**
378
385
  * The `marker` in the `emoji` config is already used by other plugin configuration.
379
386
  *
@@ -384,24 +391,12 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
384
391
  });
385
392
  return;
386
393
  }
387
- this._setupMentionConfiguration(mentionFeedsConfigs);
388
- }
389
- /**
390
- * @inheritDoc
391
- */ async init() {
392
- const editor = this.editor;
393
- this._emojiPickerPlugin = editor.plugins.has('EmojiPicker') ? editor.plugins.get('EmojiPicker') : null;
394
- this._emojiRepositoryPlugin = editor.plugins.get('EmojiRepository');
395
- // Skip overriding the `mention` command listener if the emoji repository is not ready.
396
- if (!await this._emojiRepositoryPlugin.isReady()) {
394
+ const isEmojiConfigDefined = mentionFeedsConfigs.some((config)=>config._isEmojiMarker);
395
+ if (isEmojiConfigDefined) {
397
396
  return;
398
397
  }
399
- editor.once('ready', this._overrideMentionExecuteListener.bind(this));
400
- }
401
- /**
402
- * Initializes the configuration for emojis in the mention feature.
403
- */ _setupMentionConfiguration(mentionFeedsConfigs) {
404
398
  const emojiMentionFeedConfig = {
399
+ _isEmojiMarker: true,
405
400
  marker: EMOJI_MENTION_MARKER,
406
401
  dropdownLimit: this._emojiDropdownLimit,
407
402
  itemRenderer: this._customItemRendererFactory(this.editor.t),
@@ -412,6 +407,18 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
412
407
  emojiMentionFeedConfig
413
408
  ]);
414
409
  }
410
+ /**
411
+ * @inheritDoc
412
+ */ async init() {
413
+ const editor = this.editor;
414
+ this._emojiPickerPlugin = editor.plugins.has('EmojiPicker') ? editor.plugins.get('EmojiPicker') : null;
415
+ this._emojiRepositoryPlugin = editor.plugins.get('EmojiRepository');
416
+ this._isEmojiRepositoryAvailable = await this._emojiRepositoryPlugin.isReady();
417
+ // Override the `mention` command listener if the emoji repository is ready.
418
+ if (this._isEmojiRepositoryAvailable) {
419
+ editor.once('ready', this._overrideMentionExecuteListener.bind(this));
420
+ }
421
+ }
415
422
  /**
416
423
  * Returns the `itemRenderer()` callback for mention config.
417
424
  */ _customItemRendererFactory(t) {
@@ -486,6 +493,10 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
486
493
  if (searchQuery.startsWith(' ')) {
487
494
  return [];
488
495
  }
496
+ // If the repository plugin is not available, return an empty feed to avoid confusion. See: #17842.
497
+ if (!this._isEmojiRepositoryAvailable) {
498
+ return [];
499
+ }
489
500
  const emojis = this._emojiRepositoryPlugin.getEmojiByQuery(searchQuery).map((emoji)=>{
490
501
  let text = emoji.skins[this._skinTone] || emoji.skins.default;
491
502
  if (this._emojiPickerPlugin) {
@@ -1188,6 +1199,7 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
1188
1199
  // Emit an update event to react to balloon dimensions changes.
1189
1200
  this.searchView.on('search', ()=>{
1190
1201
  this.fire('update');
1202
+ this.gridView.element.scrollTo(0, 0);
1191
1203
  });
1192
1204
  // Update the grid of emojis when the selected category is changed.
1193
1205
  this.categoriesView.on('change:categoryName', (ev, args, categoryName)=>{