PageSourceSearch

https://languagetool.org/js/_new/chunks/languagetool-ca-external-react.js?id=b37d561aef9af568

js languagetool.org collected 2026-10-01 08:55:36 UTC 1,495,710 bytes, 727 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9f0a73c9-b90f-4358-8b11-a64be1ea3957",e._sentryDebugIdIdentifier="sentry-dbid-9f0a73c9-b90f-4358-8b11-a64be1ea3957")}catch(e){}{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=Object.assign({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:lt-website":!0})}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"0733af71da75634df4ba84aaf1562ac15bbafc36"};(self.webpackChunk_languagetool_web_website=self.webpackChunk_languagetool_web_website||[]).push([[1514],{44630:(e,t,n)=>{var s,r=n(88538);self,s=(e,t,n,s)=>(()=>{var i={
vendor: 10,248 bytes, lines 1-4
1"../../../node_modules/@advanced-toolbox/adapters/dist/iframe/host.mjs":
2/*!*****************************************************************************!*\
3  !*** ../../../node_modules/@advanced-toolbox/adapters/dist/iframe/host.mjs ***!
4  \*****************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ToolboxAdapterIframeHost:()=>l});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),r=n(/*! ../messages/embed.mjs */"../../../node_modules/@advanced-toolbox/adapters/dist/messages/embed.mjs"),i=n(/*! ../messages/host.mjs */"../../../node_modules/@advanced-toolbox/adapters/dist/messages/host.mjs"),o=n(/*! ../utils.mjs */"../../../node_modules/@advanced-toolbox/adapters/dist/utils.mjs");const a=new WeakMap;class l{mount;textfield;eventTarget;selectedSkill;iframe;listeners=[];renderOptions;messageChannel;textContextMessageBuffer;isKeyboardNavigationEnabled;isIdle=!1;iframeWindow;shouldCaptureInputOnIdleEnd;isInitialization=!0;initialIframeFeedbackTimeoutId;focusDeferTimeoutId;blurDeferTimeoutId;renderBuffer;onRender;isRendered=!1;releaseInputCapturing;hasToolboxFocus=!1;hasCustomEditContext=!1;customEditContextHost=null;currentEditContext=null;customEditContext=null;handleMonitoringEvent;handleApply;handleSetTextHighlight;handlePluginSelect;handleRemoveTextHighlight;handleSelectionChange;handleClose;selectedText="";static init({mount:e,textfield:t,eventTarget:n,url:s,options:r,iframeOptions:i,selectedSkill:o}){return new l(e,t,n,o,s,r,i)}constructor(e,t,n,s,r,l,c){this.mount=e,this.textfield=t,this.eventTarget=n,this.selectedSkill=s;const{onRender:d,onApply:h,onMonitoringEvent:u,setTextHighlight:g,onPluginSelect:m,removeTextHighlight:p,onSelectionChange:_,close:E,...f}=l;let T=a.get(e);T||(T=e.attachShadow({mode:"open"}),a.set(e,T)),this.textContextMessageBuffer=o.MessageBuffer.create((e=>this.postMessage({type:i.TYPE_TOOLBOX_UPDATE_TEXT_CONTEXT,payload:{context:e}}))),this.renderOptions=f,this.onRender=d,this.hasToolboxFocus=!0===f.focusSearchField,this.isKeyboardNavigationEnabled=!0===f.enableInitialFocus,this.handleApply=h,this.handleMonitoringEvent=u,this.handleSetTextHighlight=g,this.handlePluginSelect=m,this.handleRemoveTextHighlight=p,this.handleSelectionChange=_,this.handleClose=E,this.messageChannel=new MessageChannel,this.iframe=e.ownerDocument.createElement("iframe"),this.iframe.addEventListener("load",(()=>{if(!this.iframe.contentWindow)throw new Error("[toolbox] Failed to retrieve the iframe's window object.");const e={type:"TOOLBOX_CONNECT",payload:{options:c}};this.iframeWindow=this.iframe.contentWindow,this.iframeWindow.postMessage(e,r,[this.messageChannel.port2]),this.bindListeners()}),{once:!0}),this.iframe.src=r,this.iframe.id="tb-host-frame",this.iframe.loading="eager",this.iframe.allow="microphone *; storage-access *;",this.iframe.style.visibility="hidden",this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none",T.append(this.iframe)}updateTextContext(e){this.textContextMessageBuffer.push(e)}setIdle(e){this.isIdle=e,e?(this.unbindListeners(!0),(0,s.isFunction)(this.releaseInputCapturing)&&(this.shouldCaptureInputOnIdleEnd=!0,this.releaseInputCapturing())):(this.bindListeners(!0),this.shouldCaptureInputOnIdleEnd&&this.captureInput(),this.shouldCaptureInputOnIdleEnd=void 0)}sendMessage(e){this.messageChannel.port1.postMessage(e)}unmount(){this.textContextMessageBuffer.empty(),this.handleApply=this.handleMonitoringEvent=this.handleSetTextHighlight=this.handleRemoveTextHighlight=this.handleSelectionChange=this.handleClose=void 0,this.releaseInputCapturing?.(),this.unbindListeners(),this.iframe.remove()}renderDeferred(){const e={type:i.TYPE_TOOLBOX_RENDER,payload:{options:this.renderOptions,selectedSkill:this.selectedSkill}};this.postMessage(e)}handleRender(){this.isRendered?console.warn("[toolbox] Received subsequent render success message."):(this.isRendered=!0,this.iframe.style.visibility="",this.textContextMessageBuffer.flush(),this.onRender?.())}assertDefaultView(e){if(!e)throw new Error("[toolbox] Iframe host mount node is not associated with any global object.")}handleFocusIn=(e=!0)=>{(0,s.isNumber)(this.focusDeferTimeoutId)&&clearTimeout(this.focusDeferTimeoutId),this.hasToolboxFocus?e&&(this.focusDeferTimeoutId=self.setTimeout((()=>this.handleFocusIn(!1)),50)):(this.hasToolboxFocus=!0,this.captureInput())};handleFocusOut=(e=!0)=>{(0,s.isNumber)(this.blurDeferTimeoutId)&&clearTimeout(this.blurDeferTimeoutId),this.hasToolboxFocus?(this.hasToolboxFocus=!1,this.releaseInputCapturing?.()):e&&(this.blurDeferTimeoutId=self.setTimeout((()=>this.handleFocusOut(!1)),50))};handleMessage=e=>{let t=!1;switch(!0){case(0,r.isReadyMessage)(e.data):this.renderDeferred(),t=!0;break;case(0,r.isRenderedMessage)(e.data):this.handleRender?.(),t=!0;break;case(0,r.isMonitoringEventMessage)(e.data):this.handleMonitoringEvent?.(e.data.payload),t=!0;break;case(0,r.isApplyMessage)(e.data):this.handleApply?.(e.data.payload),t=!0;break;case(0,r.isSetTextHighlightMessage)(e.data):this.handleSetTextHighlight?.(e.data.payload.type,e.data.payload.selection,e.data.payload.isPreview),t=!0;break;case(0,r.isPluginSelectMessage)(e.data):this.handlePluginSelect?.(e.data.payload.pluginId,e.data.payload.skillId),t=!0;break;case(0,r.isRemoveTextHighlightMessage)(e.data):this.handleRemoveTextHighlight?.(),t=!0;break;case(0,r.isCloseMessage)(e.data):this.handleClose?.(),t=!0;break;case(0,r.isSelectionChangeMessage)(e.data):this.selectedText=e.data.payload.text,t=!0,this.handleSelectionChange?.(e.data.payload.text);break;case(0,r.isWriteToClipboardMessage)(e.data):this.writeToClipboard(e.data.payload),t=!0;break;case(0,r.isInputFocusInMessage)(e.data):this.handleFocusIn(),t=!0;break;case(0,r.isInputFocusOutMessage)(e.data):this.handleFocusOut(),t=!0}t&&(0,s.isNumber)(this.initialIframeFeedbackTimeoutId)&&(this.assertDefaultView(this.mount.ownerDocument.defaultView),this.mount.ownerDocument.defaultView.clearTimeout(this.initialIframeFeedbackTimeoutId),this.initialIframeFeedbackTimeoutId=void 0)};postMessage(e){this.messageChannel.port1.postMessage(e)}async writeToClipboard(e){let t="ok";try{await navigator.clipboard.write([new ClipboardItem(e)])}catch(e){console.error("[toolbox] Failed to write to clipboard.",e),t="error"}this.postMessage({type:"TOOLBOX_CLIPBOARD_WRITE_RESULT",payload:{status:t}})}bindListeners(e=!1){this.assertDefaultView(this.mount.ownerDocument.defaultView);const t=this.eventTarget||this.mount.ownerDocument,n=e=>{if(e.isComposing||229===e.keyCode)return;if((0,s.isProgrammaticBackwardDeletion)(e))return;const t={hasFocus:this.hasToolboxFocus,isKbdNavigationEnabled:this.isKeyboardNavigationEnabled};(0,s.shouldPreventKeyboardEventPropagation)(e,t)&&e.stopImmediatePropagation(),(0,s.shouldPreventKeyboardEventDefault)(e,t)&&e.preventDefault();const n=Object.freeze(Object.assign(Object.create(null),{isTrusted:e.isTrusted,key:e.key,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey}));this.postMessage({type:i.TYPE_TOOLBOX_KEYBOARD_EVENT,payload:n})};t.addEventListener("keydown",n,!0),this.listeners.push((()=>t.removeEventListener("keydown",n,!0))),this.isInitialization&&(this.initialIframeFeedbackTimeoutId=this.mount.ownerDocument.defaultView.setTimeout((()=>{console.warn("[toolbox] Didn't get any initial message from the iframe within 5 seconds."),this.handleMonitoringEvent?.({name:"toolbox:error",data:"no_response_from_toolbox"}),this.initialIframeFeedbackTimeoutId=void 0}),5e3),this.isInitialization=!1),e||(this.messageChannel.port1.addEventListener("message",this.handleMessage),this.messageChannel.port1.start())}unbindListeners(e=!1){this.listeners.forEach((e=>e())),this.listeners.length=0,this.assertDefaultView(this.mount.ownerDocument.defaultView),this.mount.ownerDocument.defaultView.clearTimeout(this.initialIframeFeedbackTimeoutId),this.initialIframeFeedbackTimeoutId=void 0,e||(this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.messageChannel.port1.removeEventListener("message",this.handleMessage))}setCustomEditContext(){if(this.customEditContext)return;const e=this.textfield.ownerDocument.defaultView;if("EditContext"in e&&"editContext"in this.textfield)try{this.currentEditContext=this.textfield.editContext??null,this.customEditContext=new e.EditContext,this.textfield.editContext=this.customEditContext}catch{}}restoreCustomEditContext(){if("editContext"in this.textfield&&this.textfield?.editContext&&this.textfield.editContext===this.customEditContext)try{this.textfield.editContext=this.currentEditContext,this.customEditContext=null,this.currentEditContext=null}catch{}}captureInput(){if((0,s.isFunction)(this.releaseInputCapturing))return;const e=this.eventTarget||this.mount.ownerDocument,t=e=>{e.stopImmediatePropagation(),e.preventDefault()},n=e=>{e.stopImmediatePropagation(),e.preventDefault(),e.clipboardData?.setData("text/plain",this.selectedText),this.postMessage({type:i.TYPE_TOOLBOX_CLIPBOARD_EVENT,payload:{type:"copy",detail:{}}})},r=e=>{e.stopImmediatePropagation(),e.preventDefault(),e.clipboardData?.setData("text/plain",this.selectedText),this.postMessage({type:i.TYPE_TOOLBOX_CLIPBOARD_EVENT,payload:{type:"cut",detail:{}}})},o=e=>{e.stopImmediatePropagation(),this.postMessage({type:i.TYPE_TOOLBOX_CLIPBOARD_EVENT,payload:{type:"paste",detail:{data:e.clipboardData?.getData("text")}}})},a=e=>{e.isTrusted&&e.preventDefault()},l="editContext"in this.textfield,c=(d=this.textfield)instanceof d.ownerDocument.defaultView.SVGElement?()=>{}:(0,s.bindCompositionFlow)(this.textfield,((e,t)=>{const n={partialChar:e,composedChar:t};this.postMessage({type:i.TYPE_TOOLBOX_COMPOSITION_EVENT,payload:n})}),l);var d;e.addEventListener("keyup",t,!0),e.addEventListener("copy",n,!0),e.addEventListener("cut",r,!0),e.addEventListener("paste",o,!0),e.addEventListener("beforeinput",a,!0),this.setCustomEditContext(),this.releaseInputCapturing=()=>{this.releaseInputCapturing=void 0,e.removeEventListener("keyup",t,!0),e.removeEventListener("copy",n,!0),e.removeEventListener("cut",r,!0),e.removeEventListener("paste",o,!0),e.removeEventListener("beforeinput",a,!0),this.restoreCustomEditContext(),c()}}}},
vendor: 2,091 bytes, lines 4-7
4"../../../node_modules/@advanced-toolbox/adapters/dist/messages/embed.mjs":
5/*!********************************************************************************!*\
6  !*** ../../../node_modules/@advanced-toolbox/adapters/dist/messages/embed.mjs ***!
7  \********************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_TOOLBOX_APPLY:()=>d,TYPE_TOOLBOX_CLOSE:()=>f,TYPE_TOOLBOX_INPUT_FOCUS_IN:()=>x,TYPE_TOOLBOX_INPUT_FOCUS_OUT:()=>A,TYPE_TOOLBOX_MONITORING_EVENT:()=>l,TYPE_TOOLBOX_PLUGIN_SELECT:()=>u,TYPE_TOOLBOX_READY:()=>r,TYPE_TOOLBOX_REMOVE_TEXT_HIGHLIGHT:()=>_,TYPE_TOOLBOX_RENDERED:()=>o,TYPE_TOOLBOX_SELECTION_CHANGE:()=>C,TYPE_TOOLBOX_SET_TEXT_HIGHLIGHT:()=>m,TYPE_TOOLBOX_WRITE_TO_CLIPBOARD:()=>S,isApplyMessage:()=>h,isCloseMessage:()=>T,isInputFocusInMessage:()=>y,isInputFocusOutMessage:()=>k,isMonitoringEventMessage:()=>c,isPluginSelectMessage:()=>g,isReadyMessage:()=>i,isRemoveTextHighlightMessage:()=>E,isRenderedMessage:()=>a,isSelectionChangeMessage:()=>v,isSetTextHighlightMessage:()=>p,isWriteToClipboardMessage:()=>b});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs");const r="TOOLBOX_READY",i=e=>(0,s.isObject)(e)&&"type"in e&&e.type===r,o="TOOLBOX_RENDERED",a=e=>(0,s.isObject)(e)&&"type"in e&&e.type===o,l="TOOLBOX_MONITORING_EVENT",c=e=>(0,s.isObject)(e)&&"type"in e&&e.type===l,d="TOOLBOX_APPLY",h=e=>(0,s.isObject)(e)&&"type"in e&&e.type===d,u="TOOLBOX_PLUGIN_SELECT",g=e=>(0,s.isObject)(e)&&"type"in e&&e.type===u,m="TOOLBOX_SET_TEXT_HIGHLIGHT",p=e=>(0,s.isObject)(e)&&"type"in e&&e.type===m,_="TOOLBOX_REMOVE_TEXT_HIGHLIGHT",E=e=>(0,s.isObject)(e)&&"type"in e&&e.type===_,f="TOOLBOX_CLOSE",T=e=>(0,s.isObject)(e)&&"type"in e&&e.type===f,C="TOOLBOX_SELECTION_CHANGE",v=e=>(0,s.isObject)(e)&&"type"in e&&e.type===C,S="TOOLBOX_WRITE_TO_CLIPBOARD",b=e=>(0,s.isObject)(e)&&"type"in e&&e.type===S,x="TYPE_TOOLBOX_INPUT_FOCUS_IN",y=e=>(0,s.isObject)(e)&&"type"in e&&e.type===x,A="TYPE_TOOLBOX_INPUT_FOCUS_OUT",k=e=>(0,s.isObject)(e)&&"type"in e&&e.type===A},
vendor: 1,441 bytes, lines 7-10
7"../../../node_modules/@advanced-toolbox/adapters/dist/messages/host.mjs":
8/*!*******************************************************************************!*\
9  !*** ../../../node_modules/@advanced-toolbox/adapters/dist/messages/host.mjs ***!
10  \*******************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_TOOLBOX_CLIPBOARD_EVENT:()=>d,TYPE_TOOLBOX_CLIPBOARD_WRITE_RESULT:()=>m,TYPE_TOOLBOX_COMPOSITION_EVENT:()=>u,TYPE_TOOLBOX_CONNECT:()=>r,TYPE_TOOLBOX_KEYBOARD_EVENT:()=>l,TYPE_TOOLBOX_RENDER:()=>o,TYPE_TOOLBOX_UPDATE_TEXT_CONTEXT:()=>_,isClipboardEventMessage:()=>h,isClipboardWriteResultMessage:()=>p,isCompositionEventMessage:()=>g,isConnectMessage:()=>i,isKeyboardEventMessage:()=>c,isRenderMessage:()=>a,isTextContextUpdateMessage:()=>E});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs");const r="TOOLBOX_CONNECT",i=e=>(0,s.isObject)(e)&&"type"in e&&e.type===r,o="TOOLBOX_RENDER",a=e=>(0,s.isObject)(e)&&"type"in e&&e.type===o,l="TOOLBOX_KEYBOARD_EVENT",c=e=>(0,s.isObject)(e)&&"type"in e&&e.type===l,d="TOOLBOX_CLIPBOARD_EVENT",h=e=>(0,s.isObject)(e)&&"type"in e&&e.type===d,u="TOOLBOX_COMPOSITION_EVENT",g=e=>(0,s.isObject)(e)&&"type"in e&&e.type===u,m="TOOLBOX_CLIPBOARD_WRITE_RESULT",p=e=>(0,s.isObject)(e)&&"type"in e&&e.type===m,_="TOOLBOX_UPDATE_TEXT_CONTEXT",E=e=>(0,s.isObject)(e)&&"type"in e&&e.type===_},
vendor: 745 bytes, lines 10-13
10"../../../node_modules/@advanced-toolbox/adapters/dist/utils.mjs":
11/*!***********************************************************************!*\
12  !*** ../../../node_modules/@advanced-toolbox/adapters/dist/utils.mjs ***!
13  \***********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MessageBuffer:()=>r,css:()=>s});const s=String.raw;class r{callback;buffer=[];flushed=!1;static create(e){return new this(e)}constructor(e){this.callback=e}push(e){this.buffer.push(e)}flush(){if(!this.flushed)for(this.flushed=!0,this.buffer.push=(...e)=>{const[t]=e;return this.callback(t),0};this.buffer.length;){const e=this.buffer.pop();e&&this.buffer.push(e)}}empty(){this.buffer.length=0,this.flushed=!0}}},
vendor: 195,549 bytes, lines 13-16
13"../../../node_modules/@advanced-toolbox/components/dist/index.js":
14/*!************************************************************************!*\
15  !*** ../../../node_modules/@advanced-toolbox/components/dist/index.js ***!
16  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ApplyButton:()=>E,ContentInfoProvider:()=>B,ErrorBoundary:()=>G,EscButton:()=>f,FakeBeforeInputEvent:()=>y,FakeInput:()=>M,HotKeyLabel:()=>z,Icon:()=>m,ListGroup:()=>J,MonitoringContextProvider:()=>X,Tooltip:()=>ce,Unless:()=>C,When:()=>T,fakeInputStateRestorer:()=>x,useContentInfoGetState:()=>F,useContentInfoSetState:()=>U,useMonitoringContext:()=>K});var s=n(/*! @advanced-toolbox/elements */"../../../node_modules/@advanced-toolbox/elements/dist/index.mjs"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! react */"react"),o=n(/*! react/jsx-runtime */"react/jsx-runtime"),a=Object.defineProperty,l=e=>{throw TypeError(e)},c=(e,t,n)=>((e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>t.has(e)||l("Cannot "+n),h=(e,t,n)=>(d(e,t,"read from private field"),n?n.call(e):t.get(e)),u=(e,t,n)=>t.has(e)?l("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),g=(e,t,n,s)=>(d(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),m=({name:e,className:t})=>{const n=(0,i.useMemo)((()=>(e=>{switch(e){case"activities":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<circle cx="10.875" cy="10" r="8.5" stroke="currentColor"/>\n\t<path d="M2.875 6.5C3.54167 7.5 4.375 9.5 6.375 9.5C12.875 9.5 13.375 3.5 16.375 3.5" stroke="currentColor"/>\n\t<path d="M4.2373 15.4999C4.76389 14.9346 5.4427 14.4999 6.37506 14.4999C10.1111 14.4999 11.865 16.4822 13.2507 18.168" stroke="currentColor"/>\n\t<path d="M9.27119 1.63477C7.16938 3.79618 5.875 6.74686 5.875 9.99985C5.875 13.2456 7.16362 16.1904 9.25717 18.3505" stroke="currentColor"/>\n\t<path d="M2.375 11.024C4.42938 11.6584 6.6123 12 8.875 12C12.6774 12 16.2546 11.0354 19.375 9.3374" stroke="currentColor"/>\n</svg>\n';case"add":return'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 10 10" fill="none">\n  <path d="M4.99984 9.08268C4.83456 9.08268 4.69602 9.02678 4.58421 8.91497C4.47241 8.80317 4.4165 8.66463 4.4165 8.49935V5.58268H1.49984C1.33456 5.58268 1.19602 5.52678 1.08421 5.41497C0.972407 5.30317 0.916504 5.16463 0.916504 4.99935C0.916504 4.83407 0.972407 4.69553 1.08421 4.58372C1.19602 4.47192 1.33456 4.41602 1.49984 4.41602H4.4165V1.49935C4.4165 1.33407 4.47241 1.19553 4.58421 1.08372C4.69602 0.971918 4.83456 0.916016 4.99984 0.916016C5.16512 0.916016 5.30366 0.971918 5.41546 1.08372C5.52727 1.19553 5.58317 1.33407 5.58317 1.49935V4.41602H8.49984C8.66512 4.41602 8.80366 4.47192 8.91546 4.58372C9.02727 4.69553 9.08317 4.83407 9.08317 4.99935C9.08317 5.16463 9.02727 5.30317 8.91546 5.41497C8.80366 5.52678 8.66512 5.58268 8.49984 5.58268H5.58317V8.49935C5.58317 8.66463 5.52727 8.80317 5.41546 8.91497C5.30366 9.02678 5.16512 9.08268 4.99984 9.08268Z" fill="currentColor"/>\n</svg>';case"ai-pencil":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.69446 13.4767V15.8331C5.69446 16.0663 5.77777 16.2661 5.93606 16.4243C6.09435 16.5825 6.2943 16.6658 6.52757 16.6658H8.87695C8.98526 16.6658 9.09356 16.6492 9.20187 16.5992C9.30184 16.5576 9.40182 16.4993 9.48513 16.416L16.8832 9.02186C17.0498 8.85532 17.1748 8.67213 17.2498 8.47229C17.3247 8.27244 17.3664 8.06428 17.3664 7.85611C17.3664 7.63129 17.3247 7.4148 17.2498 7.20663C17.1748 6.99846 17.0498 6.81526 16.8832 6.66538L15.7335 5.49964C15.5669 5.33311 15.3752 5.20821 15.167 5.12494C14.9587 5.04167 14.7421 5.00003 14.5255 5.00003C14.3089 5.00003 14.0922 5.04167 13.8923 5.12494C13.6924 5.20821 13.5174 5.32478 13.3591 5.47466L5.94439 12.8688C5.86108 12.9521 5.80276 13.0437 5.76111 13.1519C5.71945 13.2519 5.69446 13.3601 5.69446 13.4767ZM8.52705 15.0005H7.36069V13.8347L13.0092 8.17252L14.2006 9.36326L8.53538 15.0005H8.52705Z" fill="currentColor"/>\n<path d="M6.95992 8.76552L6.16012 10.5372C5.97789 10.9321 5.41095 10.9321 5.22871 10.5372L4.42891 8.7554L2.65721 7.9556C2.26237 7.77337 2.26237 7.21655 2.65721 7.03432L4.43904 6.23452L5.23884 4.46281C5.42107 4.06798 5.97789 4.06798 6.16012 4.46281L6.95992 6.24464L8.73162 7.04444C9.12646 7.22667 9.12646 7.7835 8.73162 7.96573L6.95992 8.76552Z" fill="#008847"/>\n</svg>\n';case"ai-stars":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="#8337FB" fill-rule="evenodd" d="M12.483 5.793c-.133-.493-.833-.493-.966 0l-.316 1.174a6 6 0 0 1-4.234 4.234l-1.174.316c-.493.133-.493.833 0 .966l1.174.316a6 6 0 0 1 4.234 4.234l.316 1.174c.133.493.833.493.966 0l.316-1.174a6 6 0 0 1 4.234-4.234l1.174-.316c.493-.133.493-.833 0-.966l-1.174-.316a6 6 0 0 1-4.234-4.234l-.316-1.174Z" clip-rule="evenodd"/><path fill="currentColor" d="M5.166 2.24c.092-.341.576-.341.668 0A4.148 4.148 0 0 0 8.76 5.166c.34.092.34.576 0 .668A4.148 4.148 0 0 0 5.834 8.76c-.092.34-.576.34-.668 0A4.148 4.148 0 0 0 2.24 5.834c-.341-.092-.341-.576 0-.668A4.148 4.148 0 0 0 5.166 2.24Z"/></svg>';case"arrow-right":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.41634 16.0833C9.26356 15.9306 9.1837 15.7361 9.17676 15.5C9.16981 15.2639 9.24273 15.0694 9.39551 14.9167L13.4788 10.8333H4.16634C3.93023 10.8333 3.73231 10.7535 3.57259 10.5938C3.41287 10.434 3.33301 10.2361 3.33301 10C3.33301 9.76389 3.41287 9.56597 3.57259 9.40625C3.73231 9.24653 3.93023 9.16667 4.16634 9.16667H13.4788L9.39551 5.08333C9.24273 4.93056 9.16981 4.73611 9.17676 4.5C9.1837 4.26389 9.26356 4.06944 9.41634 3.91667C9.56912 3.76389 9.76356 3.6875 9.99968 3.6875C10.2358 3.6875 10.4302 3.76389 10.583 3.91667L16.083 9.41667C16.1663 9.48611 16.2254 9.57292 16.2601 9.67708C16.2948 9.78125 16.3122 9.88889 16.3122 10C16.3122 10.1111 16.2948 10.2153 16.2601 10.3125C16.2254 10.4097 16.1663 10.5 16.083 10.5833L10.583 16.0833C10.4302 16.2361 10.2358 16.3125 9.99968 16.3125C9.76356 16.3125 9.56912 16.2361 9.41634 16.0833Z" fill="currentColor"/>\n</svg>\n';case"magic-wand":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M2.84928 4.7779L3.44913 3.44913L4.7779 2.84928C5.07403 2.7126 5.07403 2.29499 4.7779 2.15831L3.44913 1.55847L2.84928 0.222096C2.7126 -0.0740319 2.29499 -0.0740319 2.15831 0.222096L1.55847 1.55087L0.222096 2.15072C-0.0740319 2.2874 -0.0740319 2.70501 0.222096 2.84169L1.55087 3.44153L2.15072 4.7779C2.2874 5.07403 2.7126 5.07403 2.84928 4.7779ZM15.4491 3.44913L14.8493 4.7779C14.7126 5.07403 14.2874 5.07403 14.1507 4.7779L13.5509 3.44153L12.2221 2.84169C11.926 2.70501 11.926 2.2874 12.2221 2.15072L13.5585 1.55087L14.1583 0.222096C14.295 -0.0740319 14.7126 -0.0740319 14.8493 0.222096L15.4491 1.55847L16.7779 2.15831C17.074 2.29499 17.074 2.7126 16.7779 2.84928L15.4491 3.44913ZM19.7 16.9L16.9 19.7C16.7 19.9 16.4583 20 16.175 20C15.8917 20 15.65 19.9 15.45 19.7L5.3 9.55C5.1 9.35 5 9.10833 5 8.825C5 8.54166 5.1 8.30001 5.3 8.10001L8.1 5.3C8.3 5.1 8.54167 5 8.825 5C9.10833 5 9.35 5.1 9.55 5.3L19.7 15.45C19.9 15.65 20 15.8917 20 16.175C20 16.4583 19.9 16.7 19.7 16.9ZM10 11.4L16.15 17.6L17.6 16.15L11.4 10L10 11.4ZM3.44913 14.4491L2.84928 15.7779C2.7126 16.074 2.2874 16.074 2.15072 15.7779L1.55087 14.4415L0.222096 13.8417C-0.0740319 13.705 -0.0740319 13.2874 0.222096 13.1507L1.55847 12.5509L2.15831 11.2221C2.29499 10.926 2.7126 10.926 2.84928 11.2221L3.44913 12.5585L4.7779 13.1583C5.07403 13.295 5.07403 13.7126 4.7779 13.8493L3.44913 14.4491Z" fill="currentColor"/>\n</svg>\n';case"circle-check":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 13.866 6.13401 17 10 17C13.866 17 17 13.866 17 10ZM13.7809 8.62469C14.1259 8.19343 14.056 7.56414 13.6247 7.21913C13.1934 6.87412 12.5641 6.94404 12.2191 7.37531L8.91708 11.5029L7.70711 10.2929C7.31658 9.90237 6.68342 9.90237 6.29289 10.2929C5.90237 10.6834 5.90237 11.3166 6.29289 11.7071L8.29289 13.7071C8.49403 13.9082 8.77129 14.0142 9.0553 13.9985C9.33931 13.9827 9.60318 13.8468 9.78087 13.6247L13.7809 8.62469Z" fill="currentColor"/></svg>\n';case"copy":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.16667 18.3327C3.70833 18.3327 3.31597 18.1695 2.98958 17.8431C2.66319 17.5167 2.5 17.1243 2.5 16.666V5.83268C2.5 5.59657 2.57986 5.39865 2.73958 5.23893C2.89931 5.07921 3.09722 4.99935 3.33333 4.99935C3.56944 4.99935 3.76736 5.07921 3.92708 5.23893C4.08681 5.39865 4.16667 5.59657 4.16667 5.83268V16.666H12.5C12.7361 16.666 12.934 16.7459 13.0938 16.9056C13.2535 17.0653 13.3333 17.2632 13.3333 17.4993C13.3333 17.7355 13.2535 17.9334 13.0938 18.0931C12.934 18.2528 12.7361 18.3327 12.5 18.3327H4.16667ZM7.5 14.9993C7.04167 14.9993 6.64931 14.8362 6.32292 14.5098C5.99653 14.1834 5.83333 13.791 5.83333 13.3327V3.33268C5.83333 2.87435 5.99653 2.48199 6.32292 2.1556C6.64931 1.82921 7.04167 1.66602 7.5 1.66602H15C15.4583 1.66602 15.8507 1.82921 16.1771 2.1556C16.5035 2.48199 16.6667 2.87435 16.6667 3.33268V13.3327C16.6667 13.791 16.5035 14.1834 16.1771 14.5098C15.8507 14.8362 15.4583 14.9993 15 14.9993H7.5ZM7.5 13.3327H15V3.33268H7.5V13.3327Z" fill="currentColor"/>\n</svg>\n';case"dropdown-caret":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M9.99989 11.8284L13.1819 8.64645C13.3771 8.45118 13.6937 8.45118 13.889 8.64645C14.0842 8.84171 14.0842 9.15829 13.889 9.35355L10.3534 12.8891C10.1582 13.0843 9.8416 13.0843 9.64634 12.8891L6.1108 9.35355C5.91554 9.15829 5.91554 8.84171 6.1108 8.64645C6.30606 8.45118 6.62265 8.45118 6.81791 8.64645L9.99989 11.8284Z" fill="currentColor"/>\n</svg>\n';case"edit":return'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor"><path clip-rule="evenodd" d="m7.87879 14.9495 9.89951-9.89947c.3905-.39052.3905-1.02369 0-1.41421l-1.4142-1.41422c-.3905-.39052-1.0237-.39052-1.4142 0l-9.89953 9.8995-1.13652 2.6519c-.3556.8297.48334 1.6686 1.31306 1.313zm-1.98514-2.2575-1.06066 2.4749 2.47487-1.0607 8.04574-8.04568-1.4142-1.41421zm8.75285-8.7528 1.4142 1.41422 1.0105-1.0105-1.4142-1.41421z" fill-rule="evenodd"/><path d="m3.5 4.99983c-.82843 0-1.5.67158-1.5 1.5v9.99997c0 .8285.67157 1.5 1.5 1.5h10c.8284 0 1.5-.6715 1.5-1.5v-5.5c0-.2761.2239-.5.5-.5s.5.2239.5.5v5.5c0 1.3807-1.1193 2.5-2.5 2.5h-10c-1.38071 0-2.5-1.1193-2.5-2.5v-9.99997c0-1.38071 1.11929-2.5 2.5-2.5h5.5c.27614 0 .5.22386.5.5 0 .27615-.22386.5-.5.5z"/></g></svg>\n';case"enter":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11 4H13.0004C15.2093 4 17 5.7907 17 7.99963V7.99963C17 10.2086 15.2093 11.9993 13.0004 11.9993H3M3 11.9993L7 8M3 11.9993L7 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';case"flag":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M4.625 19V12M4.625 12V1.99994C11.113 0.14622 11.5876 5.16508 17.1959 3.52047C17.8848 3.31845 18.625 3.79861 18.625 4.51653V12.3406C18.625 12.7406 18.3869 13.106 18.0124 13.2466C11.6187 15.6465 11.4146 10.0601 4.625 12Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';case"food":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<g clip-path="url(#clip0_734_4954)">\n\t\t<path d="M2.625 11H7.51945C7.9143 11 8.30031 11.1169 8.62885 11.3359L10.0156 12.2604C10.6874 12.7083 11.5626 12.7083 12.2344 12.2604L13.6212 11.3359C13.9497 11.1169 14.3357 11 14.7306 11H17.625" stroke="currentColor"/>\n\t\t<path d="M2.625 14C1.79657 14 1.125 13.3284 1.125 12.5C1.125 11.6716 1.79657 11 2.625 11" stroke="currentColor"/>\n\t\t<path d="M17.625 14C18.4534 14 19.125 13.3284 19.125 12.5C19.125 11.6716 18.4534 11 17.625 11" stroke="currentColor"/>\n\t\t<path d="M2.625 14H17.625" stroke="currentColor"/>\n\t\t<path d="M2.125 14V14C2.125 15.6569 3.46815 17 5.125 17H15.125C16.7819 17 18.125 15.6569 18.125 14V14" stroke="currentColor"/>\n\t\t<path d="M2.125 11V9H18.125V11" stroke="currentColor"/>\n\t\t<path d="M2.125 9V9C2.125 5.68629 4.81129 3 8.125 3H12.125C15.4387 3 18.125 5.68629 18.125 9V9" stroke="currentColor"/>\n\t\t<circle cx="5.625" cy="6.5" r="0.5" fill="currentColor"/>\n\t\t<circle cx="14.625" cy="6.5" r="0.5" fill="currentColor"/>\n\t\t<rect x="9.125" y="6" width="2" height="1" rx="0.5" fill="currentColor"/>\n\t</g>\n\t<defs>\n\t\t<clipPath id="clip0_734_4954">\n\t\t\t<rect width="20" height="20" fill="white" transform="translate(0.125)"/>\n\t\t</clipPath>\n\t</defs>\n</svg>\n';case"info":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10ZM3.5 10C3.5 6.41015 6.41015 3.5 10 3.5C13.5899 3.5 16.5 6.41015 16.5 10C16.5 13.5899 13.5899 16.5 10 16.5C6.41015 16.5 3.5 13.5899 3.5 10ZM9 9.5C9 9.22386 9.22386 9 9.5 9H10.5C10.7761 9 11 9.22386 11 9.5C11 9.77614 10.7761 10 10.5 10V13C10.7761 13 11 13.2239 11 13.5C11 13.7761 10.7761 14 10.5 14H9.5C9.22386 14 9 13.7761 9 13.5C9 13.2239 9.22386 13 9.5 13V10C9.22386 10 9 9.77614 9 9.5ZM11 7C11 7.55228 10.5523 8 10 8C9.44772 8 9 7.55228 9 7C9 6.44772 9.44772 6 10 6C10.5523 6 11 6.44772 11 7Z" fill="currentColor"/>\n</svg>\n';case"magnifier":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n  <path d="m16.9,18.3l-5.6,-5.6c-0.5,0.4 -1.08,0.72 -1.73,0.95c-0.64,0.23 -1.34,0.35 -2.07,0.35c-1.82,0 -3.35,-0.63 -4.61,-1.89c-1.26,-1.26 -1.89,-2.79 -1.89,-4.61c0,-1.82 0.63,-3.35 1.89,-4.61c1.26,-1.26 2.79,-1.89 4.61,-1.89c1.82,0 3.35,0.63 4.61,1.89c1.26,1.26 1.89,2.79 1.89,4.61c0,0.73 -0.12,1.43 -0.35,2.07c-0.23,0.65 -0.55,1.23 -0.95,1.73l5.62,5.63c0.19,0.18 0.28,0.4 0.28,0.67c0,0.27 -0.1,0.5 -0.3,0.7c-0.18,0.18 -0.42,0.27 -0.7,0.27c-0.28,0 -0.52,-0.09 -0.7,-0.27zm-9.4,-6.3c1.25,0 2.31,-0.44 3.19,-1.31c0.87,-0.88 1.31,-1.94 1.31,-3.19c0,-1.25 -0.44,-2.31 -1.31,-3.19c-0.88,-0.87 -1.94,-1.31 -3.19,-1.31c-1.25,0 -2.31,0.44 -3.19,1.31c-0.87,0.88 -1.31,1.94 -1.31,3.19c0,1.25 0.44,2.31 1.31,3.19c0.88,0.87 1.94,1.31 3.19,1.31z" fill="currentColor"/>\n</svg>\n';case"nature":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M5.74989 15.0001C0.869443 10.1195 5.51667 2.38076 16.9016 2.94362C17.3894 2.96774 17.7822 3.36053 17.8063 3.84834C18.3692 15.2333 10.6303 19.8806 5.74989 15.0001Z" stroke="currentColor"/>\n\t<path d="M5.75 15L7.75 13M15.75 5L7.75 13M7.75 9V13M7.75 13H11.75" stroke="currentColor" stroke-linecap="round"/>\n\t<path d="M10.75 7V10H13.75" stroke="currentColor" stroke-linecap="round"/>\n\t<path d="M13.75 4.5V7H16.25M5.75 15C4.75 15.5 3.75 17 3.25 18" stroke="currentColor" stroke-linecap="round"/>\n</svg>\n';case"objects":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<rect x="2.75" y="2.5" width="15" height="15" rx="3.5" stroke="currentColor"/>\n\t<path d="M10.25 10C10.25 11.3807 9.13071 12.5 7.75 12.5C6.36929 12.5 5.25 11.3807 5.25 10C5.25 8.61929 6.36929 7.5 7.75 7.5C9.13071 7.5 10.25 8.61929 10.25 10ZM10.25 10C10.25 11.3807 11.3693 12.5 12.75 12.5C14.1307 12.5 15.25 11.3807 15.25 10C15.25 8.61929 14.1307 7.5 12.75 7.5C11.3693 7.5 10.25 8.61929 10.25 10Z" stroke="currentColor"/>\n</svg>\n';case"smileys":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M10.375 18C14.7933 18 18.375 14.4183 18.375 10C18.375 5.58172 14.7933 2 10.375 2C5.95672 2 2.375 5.58172 2.375 10C2.375 14.4183 5.95672 18 10.375 18ZM10.375 19C15.3456 19 19.375 14.9706 19.375 10C19.375 5.02944 15.3456 1 10.375 1C5.40444 1 1.375 5.02944 1.375 10C1.375 14.9706 5.40444 19 10.375 19Z" fill="currentColor"/>\n\t<circle cx="7.875" cy="8.5" r="1" stroke="currentColor"/>\n\t<circle cx="12.875" cy="8.5" r="1" stroke="currentColor"/>\n\t<path d="M5.85461 11.4721C5.22279 11.2585 4.61032 11.7986 4.87839 12.4093C5.80639 14.5234 7.91828 16 10.375 16C12.8318 16 14.9437 14.5234 15.8717 12.4093C16.1398 11.7986 15.5273 11.2585 14.8955 11.4721V11.4721C11.9633 12.4631 8.78675 12.4631 5.85461 11.4721V11.4721Z" stroke="currentColor" stroke-linejoin="round"/>\n</svg>\n';case"star":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2213 3.81124C9.97368 3.68903 9.67386 3.7907 9.55165 4.03833L8.09725 6.98528L7.98091 7.221L7.72078 7.2588L4.46863 7.73136C4.35981 7.74717 4.25924 7.79842 4.18248 7.87716C3.98973 8.0749 3.99378 8.39146 4.19152 8.58421L6.5448 10.8781L6.73303 11.0616L6.6886 11.3207L6.13306 14.5597C6.11448 14.668 6.13213 14.7795 6.1833 14.8769C6.3118 15.1213 6.61412 15.2152 6.85854 15.0867L9.76735 13.5575L10 13.4352L10.2327 13.5575L13.1415 15.0867C13.2388 15.1379 13.3503 15.1556 13.4587 15.137C13.7309 15.0903 13.9137 14.8318 13.867 14.5597L13.3114 11.3207L13.267 11.0616L13.4552 10.8781L15.8085 8.58421C15.8873 8.50745 15.9385 8.40688 15.9543 8.29806C15.994 8.02479 15.8047 7.77107 15.5314 7.73136L12.2793 7.2588L12.0191 7.221L11.9028 6.98528L10.4484 4.03833C10.3997 3.93972 10.3199 3.85991 10.2213 3.81124ZM8.65492 3.59576C9.02155 2.85288 9.92099 2.54787 10.6639 2.91451C10.9597 3.0605 11.1991 3.29994 11.3451 3.59576L12.6832 6.30699L15.6752 6.74175C16.495 6.86088 17.063 7.62204 16.9439 8.44186C16.8965 8.76832 16.7428 9.07003 16.5065 9.30029L14.3415 11.4107L14.8526 14.3906C14.9926 15.2071 14.4442 15.9826 13.6277 16.1226C13.3026 16.1784 12.9681 16.1254 12.6762 15.9719L10 14.5649L7.32388 15.9719C6.59061 16.3574 5.68367 16.0755 5.29817 15.3422C5.14466 15.0502 5.09169 14.7157 5.14746 14.3906L5.65855 11.4107L3.49351 9.30029C2.90029 8.72204 2.88815 7.77237 3.4664 7.17915C3.69666 6.94292 3.99838 6.78919 4.32483 6.74175L7.31684 6.30699L8.65492 3.59576Z" fill="currentColor"/>\n</svg>\n';case"travel":return'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<g clip-path="url(#clip0_734_4966)">\n\t\t<path d="M15.613 2.91495L16.6737 2.5614C17.4554 2.30081 18.1992 3.04455 17.9386 3.82631L17.585 4.88697C17.5359 5.03425 17.4532 5.16807 17.3434 5.27785L15.1062 7.51508C14.8451 7.77623 14.7491 8.16004 14.8566 8.51335L17.0371 15.6776C17.1133 15.9281 17.0799 16.1992 16.9452 16.4238C16.5732 17.0438 15.6659 17.0175 15.3304 16.377L12.7817 11.5113C12.4861 10.9469 11.7451 10.7992 11.2557 11.207L8.28264 13.6846C8.07889 13.8544 7.95094 14.0981 7.92693 14.3623L7.6799 17.0796C7.64081 17.5096 7.28027 17.8388 6.84849 17.8388C6.4654 17.8388 6.13148 17.5781 6.03857 17.2065L5.63508 15.5925C5.5455 15.2342 5.26575 14.9545 4.90747 14.8649L3.29349 14.4614C2.92185 14.3685 2.66113 14.0346 2.66113 13.6515C2.66113 13.2197 2.99038 12.8592 3.42039 12.8201L6.1377 12.573C6.40183 12.549 6.6456 12.4211 6.81539 12.2173L9.29293 9.24428C9.7008 8.75484 9.55309 8.01389 8.98872 7.71827L4.12294 5.16953C3.48244 4.83403 3.45617 3.92679 4.07618 3.55478C4.30075 3.42004 4.57186 3.38667 4.82241 3.46292L11.9866 5.64333C12.3399 5.75086 12.7237 5.65491 12.9849 5.39376L15.2221 3.15653C15.3319 3.04675 15.4657 2.96404 15.613 2.91495Z" stroke="currentColor"/>\n\t</g>\n\t<defs>\n\t\t<clipPath id="clip0_734_4966">\n\t\t\t<rect width="20" height="20" fill="white" transform="translate(0.5)"/>\n\t\t</clipPath>\n\t</defs>\n</svg>\n';case"loading":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M10 17C13.866 17 17 13.866 17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10" stroke="currentColor" stroke-width="2"/>\n</svg>\n';case"giphy":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M4.53994 3.25049H14.7416V16.75H4.53906L4.53994 3.25049Z" fill="black"/>\n<path d="M2.5 2.74951H4.53962V17.25H2.5V2.74951Z" fill="#04FF8E"/>\n<path d="M14.7402 6.75049H16.7799V17.2505H14.7402V6.75049Z" fill="#8E2EFF"/>\n<path d="M2.5 16.7495H16.78V18.7498H2.5V16.7495Z" fill="#00C5FF"/>\n<path d="M2.5 1.25H10.6603V3.25025H2.5V1.25Z" fill="#FFF152"/>\n<path d="M14.7403 5.24963V3.25025H12.6998V1.25H10.6602V7.24988H16.7799V5.24963" fill="#FF5B5B"/>\n<path d="M14.7402 9.25025V7.25H16.7799" fill="#551C99"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.6601 1.25V3.25025H8.61963" fill="#999131"/>\n</svg>\n';case"paraphrase":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="#008847" fill-rule="evenodd" d="M10 4c-1.657 0-3.156.67-4.243 1.757a1 1 0 0 1-1.414-1.414A8 8 0 0 1 17.99 9.596l.303-.303a1 1 0 1 1 1.414 1.414l-2 2a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414l.278.278A6 6 0 0 0 10 4ZM2.293 7.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1-1.414 1.414l-.278-.278a6 6 0 0 0 10.228 3.814 1 1 0 0 1 1.414 1.414A8 8 0 0 1 2.01 10.404l-.303.303A1 1 0 0 1 .293 9.293l2-2Z" clip-rule="evenodd"/><path fill="currentColor" d="M8 7a1 1 0 0 0 0 2h4a1 1 0 1 0 0-2H8ZM8 11a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2H8Z"/></svg>';case"synonym":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="M3 7a1 1 0 0 0 0 2h7a1 1 0 1 0 0-2H3ZM3 11a1 1 0 1 0 0 2h7a1 1 0 1 0 0-2H3Z"/><path fill="#008847" d="M19.114 9.24 15.09 5.792c-.71-.608-1.791.002-1.637.924l.52 3.12a.997.997 0 0 1 0 .33l-.52 3.12c-.154.922.927 1.532 1.637.924l4.024-3.45a1 1 0 0 0 0-1.518Z"/></svg>';case"paste":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M8 1a1 1 0 0 0-1 1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h2a1 1 0 1 0 0-2H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h1a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1h1a1 1 0 0 1 1 1v1a1 1 0 1 0 2 0V5a3 3 0 0 0-3-3h-1a1 1 0 0 0-1-1H8Z" clip-rule="evenodd"/><path fill="#008847" d="M12 10a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v5h.877a.5.5 0 0 1 .372.835l-3.006 3.34a1 1 0 0 1-1.486 0l-3.006-3.34a.5.5 0 0 1 .372-.835H12v-5Z"/></svg>';case"redo":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00012 10C4.00012 12.7614 6.2387 15 9.00012 15C9.55241 15 10.0001 15.4477 10.0001 16C10.0001 16.5523 9.55241 17 9.00012 17C5.13413 17 2.00012 13.866 2.00012 10C2.00012 6.13401 5.13413 3 9.00012 3C12.8661 3 16.0001 6.13401 16.0001 10V10.3916L17.0988 9.29289C17.4893 8.90237 18.1225 8.90237 18.513 9.29289C18.9035 9.68342 18.9035 10.3166 18.513 10.7071L15.6846 13.5355C15.2941 13.9261 14.6609 13.9261 14.2704 13.5355L14.2641 13.5292L11.4419 10.707C11.0514 10.3165 11.0514 9.68336 11.4419 9.29284C11.8325 8.90231 12.4656 8.90231 12.8562 9.29284L14.0001 10.4368V10C14.0001 7.23858 11.7615 5 9.00012 5C6.2387 5 4.00012 7.23858 4.00012 10Z" fill="currentColor"/>\n</svg>\n';case"translate":return'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">\n  <g>\n    <path d="M7.58 13.068L4.404 16.214c-.216.216-.454.316-.715.301-.261-.015-.496-.126-.704-.334-.216-.216-.324-.454-.324-.715s.108-.499.324-.715l3.208-3.167c-.578-.622-1.093-1.22-1.543-1.793-.45-.573-.819-1.158-1.107-1.754h2.391c.187.319.402.615.644.888.243.273.584.662 1.025 1.166.512-.599.973-1.181 1.382-1.746.409-.565.741-1.161.995-1.787H1.912c-.283 0-.524-.099-.722-.297-.199-.198-.298-.438-.298-.72s.099-.522.298-.715c.198-.201.439-.301.722-.301h4.729v-.979c0-.283.099-.524.297-.722.198-.199.438-.298.72-.298s.522.099.723.298c.201.198.301.439.301.722v.979h4.729c.283 0 .524.099.723.297.198.198.298.438.298.72s-.1.523-.298.724c-.199.201-.44.301-.723.301h-1.18c-.313.919-.754 1.781-1.321 2.586-.567.804-1.208 1.614-1.922 2.428l1.331 1.298-.784 2.142L7.58 13.068z" fill="currentColor"/>\n    <path d="M15.364 9.275c.247 0 .47.073.67.217.201.144.347.336.437.575l2.835 7.853c.121.344.074.663-.139.957-.213.293-.502.44-.868.44-.226 0-.434-.067-.625-.199-.191-.132-.322-.306-.393-.521l-.412-1.223h-3.888l-.442 1.252c-.07.21-.196.377-.377.503-.181.125-.382.188-.601.188-.372 0-.657-.149-.854-.445-.197-.297-.234-.613-.113-.949l2.814-7.856c.09-.239.236-.431.436-.575.2-.145.423-.217.67-.217h.85zm-1.718 6.183h2.551l-1.234-3.632-1.317 3.632z" fill="#008847"/>\n  </g>\n</svg>\n';case"trash":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 5V4C8 3.44772 8.44772 3 9 3H11C11.5523 3 12 3.44772 12 4V5H16V6H4V5H8ZM9 5H11V4H9V5ZM6 15.3333V7H5V15.3333C5 16.2538 5.74619 17 6.66667 17H13.3333C14.2538 17 15 16.2538 15 15.3333V7H14V15.3333C14 15.7015 13.7015 16 13.3333 16H6.66667C6.29848 16 6 15.7015 6 15.3333ZM8 7H9V15H8V7ZM12 7H11V15H12V7Z" fill="currentColor"/></svg>\n';case"snippet-create":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M2 5a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm0 4a1 1 0 0 1 1-1h5a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1Zm0 4a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Z" clip-rule="evenodd"/><path fill="#E34935" d="M11 9a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v5.826a1 1 0 0 1-1.65.759L14.5 14l-1.85 1.585a1 1 0 0 1-1.65-.76V9Z"/></svg>';case"snippet-insert":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="M2 5a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1ZM2 9a1 1 0 0 1 1-1h5a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1ZM2 13a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Z"/><path fill="#008847" d="M11 9.174a1 1 0 0 1 1.65-.76L14.5 10l1.85-1.585a1 1 0 0 1 1.65.76v4.91a1 1 0 0 1-.293.708l-2.5 2.5a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1-.293-.707V9.174Z"/></svg>';case"check":return'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M6.36642 11.7166C6.27753 11.7166 6.1942 11.7026 6.11642 11.6746C6.03865 11.647 5.96642 11.5999 5.89976 11.5333L3.03309 8.6666C2.91087 8.54438 2.85242 8.38593 2.85776 8.19127C2.86353 7.99705 2.92753 7.83882 3.04976 7.7166C3.17198 7.59438 3.32753 7.53327 3.51642 7.53327C3.70531 7.53327 3.86087 7.59438 3.98309 7.7166L6.36642 10.0999L12.0164 4.44993C12.1386 4.32771 12.2971 4.2666 12.4918 4.2666C12.686 4.2666 12.8442 4.32771 12.9664 4.44993C13.0886 4.57216 13.1498 4.73038 13.1498 4.9246C13.1498 5.11927 13.0886 5.27771 12.9664 5.39994L6.83309 11.5333C6.76642 11.5999 6.6942 11.647 6.61642 11.6746C6.53865 11.7026 6.45531 11.7166 6.36642 11.7166Z" fill="currentColor"/>\n</svg>\n';case"mic":return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path\n\t\td="M11.9996 14C11.1662 14 10.4579 13.7083 9.87457 13.125C9.29124 12.5417 8.99957 11.8333 8.99957 11V5C8.99957 4.16667 9.29124 3.45833 9.87457 2.875C10.4579 2.29167 11.1662 2 11.9996 2C12.8329 2 13.5412 2.29167 14.1246 2.875C14.7079 3.45833 14.9996 4.16667 14.9996 5V11C14.9996 11.8333 14.7079 12.5417 14.1246 13.125C13.5412 13.7083 12.8329 14 11.9996 14ZM11.9996 21C11.7162 21 11.4787 20.9042 11.2871 20.7125C11.0954 20.5208 10.9996 20.2833 10.9996 20V17.925C9.44957 17.7083 8.1329 17.0583 7.04957 15.975C5.96624 14.8917 5.3079 13.5917 5.07457 12.075C5.02457 11.7917 5.09957 11.5417 5.29957 11.325C5.49957 11.1083 5.76624 11 6.09957 11C6.3329 11 6.54124 11.0875 6.72457 11.2625C6.9079 11.4375 7.02457 11.65 7.07457 11.9C7.29124 13.0667 7.8579 14.0417 8.77457 14.825C9.69124 15.6083 10.7662 16 11.9996 16C13.2329 16 14.3079 15.6083 15.2246 14.825C16.1412 14.0417 16.7079 13.0667 16.9246 11.9C16.9746 11.65 17.0954 11.4375 17.2871 11.2625C17.4787 11.0875 17.6912 11 17.9246 11C18.2412 11 18.4996 11.1083 18.6996 11.325C18.8996 11.5417 18.9746 11.7917 18.9246 12.075C18.6912 13.5917 18.0329 14.8917 16.9496 15.975C15.8662 17.0583 14.5496 17.7083 12.9996 17.925V20C12.9996 20.2833 12.9037 20.5208 12.7121 20.7125C12.5204 20.9042 12.2829 21 11.9996 21ZM11.9996 12C12.2829 12 12.5204 11.9042 12.7121 11.7125C12.9037 11.5208 12.9996 11.2833 12.9996 11V5C12.9996 4.71667 12.9037 4.47917 12.7121 4.2875C12.5204 4.09583 12.2829 4 11.9996 4C11.7162 4 11.4787 4.09583 11.2871 4.2875C11.0954 4.47917 10.9996 4.71667 10.9996 5V11C10.9996 11.2833 11.0954 11.5208 11.2871 11.7125C11.4787 11.9042 11.7162 12 11.9996 12Z"\n\t\tfill="currentColor"/>\n</svg>\n';case"flag-de-at":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g fill-rule="evenodd"><path fill="#fff" d="M512 512H0V0h512z"/><path fill="#df0000" d="M512 512H0V341.3h512zm0-341.2H0V.1h512z"/></g></svg>';case"flag-de-ch":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g fill-rule="evenodd" stroke-width="1pt"><path fill="#d52b1e" d="M0 0h512v512H0z"/><g fill="#fff"><path d="M96 208h320v96H96z"/><path d="M208 96h96v320h-96z"/></g></g></svg>';case"flag-de-de":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#ffce00" d="M0 341.3h512V512H0z"/><path d="M0 0h512v170.7H0z"/><path fill="#d00" d="M0 170.7h512v170.6H0z"/></svg>';case"flag-en-au":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g stroke-width="1pt"><path fill="#006" d="M0 0h512v512H0z"/><path fill="#fff" d="M0 0v28l307 222h38.7v-28L38.7 0H0zm345.7 0v28l-307 222H0v-28L307 0h38.7z"/><path fill="#fff" d="M144 0v250h57.6V0H144zM0 83.3v83.4h345.7V83.3H0z"/><path fill="#c00" d="M0 100v50h345.7v-50H0zM155.6 0v250H190V0h-34.5zM0 250l115.2-83.3H141L25.8 250H0zM0 0l115.2 83.3H89.5L0 18.6V0zm204.7 83.3L319.9 0h25.8L230.5 83.3h-25.8zm141 166.7l-115.2-83.3h25.7l89.5 64.7V250z"/><path fill="#fff" fill-rule="evenodd" d="M54.9 368.6L95.5 384l13.4-41.4 13.3 41.4 40.7-15.4-24.1 36.3 37.4 22.2-43.3 3.7 6 43.1-30-31.5-30 31.5 6-43-43.4-3.8L79 404.9m325 71.5l-19 1.6 2.7 18.8-13-13.7-13 13.7L364 478l-18.8-1.6 16.3-9.6L351 451l17.7 6.7 5.8-18 5.7 18L398 451l-10.4 15.8m16.2-270.4L385 198l2.6 18.8-13-13.7-13 13.7L364 198l-18.8-1.6 16.3-9.6L351 171l17.7 6.7 5.8-18 5.7 18L398 171l-10.4 15.8m-88.8 123.4l-18.8 1.6 2.6 18.7-13-13.7-13 13.7 2.5-18.7-18.8-1.6 16.3-9.7-10.5-15.7 17.7 6.7 5.8-18 5.7 18 17.7-6.7-10.4 15.7M497 282.2l-18.8 1.6 2.6 18.7-13-13.7-13 13.7 2.5-18.7-18.8-1.6 16.3-9.7-10.5-15.7 17.7 6.7 5.8-18 5.8 18 17.6-6.7-10.4 15.7M416.6 355l-10.3 6.4 2.9-11.8-9.3-7.8 12-.9 4.7-11.2L421 341l12.1 1-9.2 7.7 2.9 11.8"/></g></svg>';case"flag-en-ca":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#fff" d="M81.1 0h362.3v512H81.1z"/><path fill="red" d="M-100 0H81.1v512H-100zm543.4 0h181.1v512H443.4zM135.3 247.4l-14 4.8 65.4 57.5c5 14.8-1.7 19.1-6 26.9l71-9-1.8 71.5 14.8-.5-3.3-70.9 71.2 8.4c-4.4-9.3-8.3-14.2-4.3-29l65.4-54.5-11.4-4.1c-9.4-7.3 4-34.8 6-52.2 0 0-38.1 13.1-40.6 6.2l-9.9-18.5-34.6 38c-3.8 1-5.4-.6-6.3-3.8l16-79.7-25.4 14.3c-2.1.9-4.2 0-5.6-2.4l-24.5-49-25.2 50.9c-1.9 1.8-3.8 2-5.4.8l-24.2-13.6 14.5 79.2c-1.1 3-3.9 4-7.1 2.3l-33.3-37.8c-4.3 7-7.3 18.4-13 21-5.7 2.3-25-4.9-37.9-7.7 4.4 15.9 18.2 42.3 9.5 51z"/></svg>';case"flag-en-gb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><clipPath id="a"><path fill-opacity=".7" d="M250 0h500v500H250z"/></clipPath></defs><g clip-path="url(#a)" transform="translate(-256) scale(1.024)"><g stroke-width="1pt"><path fill="#006" d="M0 0h1000v500H0z"/><path fill="#fff" d="M0 0v55.9L888.2 500H1000v-55.9L111.8.1H0zm1000 0v55.9L111.8 500H0v-55.9L888.2 0H1000z"/><path fill="#fff" d="M416.7 0v500h166.6V0H416.7zM0 166.7v166.6h1000V166.7H0z"/><path fill="#c00" d="M0 200v100h1000V200H0zM450 0v500h100V0H450zM0 500l333.3-166.7H408L74.5 500H0zM0 0l333.3 166.7h-74.5L0 37.3V0zm592.1 166.7L925.5 0h74.5L666.7 166.7H592zm408 333.3L666.6 333.3h74.5L1000 462.7V500z"/></g></g></svg>';case"flag-en-us":return'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><g clip-path="url(#clip0)"><path fill="#fff" d="M0 0h20v20H0z"/><path fill="#E32939" d="M0 0h20v2H0zM0 4h20v2H0zM0 8h20v2H0zM0 12h20v2H0zM0 16h20v2H0z"/><path fill="#02237A" fill-rule="evenodd" d="M0 0h10v10H0V0z" clip-rule="evenodd"/></g><defs><clipPath id="clip0"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>';case"flag-es":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#c60b1e" d="M0 0h512v512H0z"/><path fill="#ffc400" d="M0 128h512v256H0z"/><path fill="#ad1519" d="M171.7 227.6s-.5 0-.8-.2a12.1 12.1 0 0 1-1.1-1l-.7-.5-.7-.9s-.7-1.2-.4-2c.4-1 1-1.3 1.5-1.6.5-.3 1.6-.6 1.6-.6l1.2-.5 1.3-.3.6-.3.9-.1 1.1-.3 1.7.1h5.1a41 41 0 0 0 3.6 1.2c.6.1 1.9.3 2.4.6.6.3 1 .8 1.3 1.1.3.4.3.8.4 1.1v1.1l-.5.9-.6 1-.8.7s-.6.5-1.1.5c-.5 0-5.1-.9-8.2-.9-3 0-7.8.9-7.8.9"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M171.7 227.6s-.5 0-.8-.2a12.1 12.1 0 0 1-1.1-1l-.7-.5-.7-.9s-.7-1.2-.4-2c.4-1 1-1.3 1.5-1.6.5-.3 1.6-.6 1.6-.6l1.2-.5 1.3-.3.6-.3.9-.1 1.1-.3 1.7.1h5.1a41 41 0 0 0 3.6 1.2c.6.1 1.9.3 2.4.6.6.3 1 .8 1.3 1.1.3.4.3.8.4 1.1v1.1l-.5.9-.6 1-.8.7s-.6.5-1.1.5c-.5 0-5.1-.9-8.2-.9-3 0-7.8.9-7.8.9z"/><path fill="#c8b100" d="M178.2 220.9c0-1.5.6-2.6 1.4-2.6.8 0 1.4 1.1 1.4 2.6 0 1.4-.6 2.5-1.4 2.5-.8 0-1.4-1.1-1.4-2.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M178.2 220.9c0-1.5.6-2.6 1.4-2.6.8 0 1.4 1.1 1.4 2.6 0 1.4-.6 2.5-1.4 2.5-.8 0-1.4-1.1-1.4-2.5z"/><path fill="#c8b100" d="M179 220.9c0-1.3.3-2.4.6-2.4.4 0 .7 1 .7 2.4 0 1.3-.3 2.3-.7 2.3-.3 0-.6-1-.6-2.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M179 220.9c0-1.3.3-2.4.6-2.4.4 0 .7 1 .7 2.4 0 1.3-.3 2.3-.7 2.3-.3 0-.6-1-.6-2.3z"/><path fill="#c8b100" d="M178.7 218.2c0-.5.4-1 .9-1s1 .5 1 1-.5.9-1 .9a1 1 0 0 1-1-1"/><path fill="#c8b100" d="M180.3 217.8v.6h-1.5v-.6h.5v-1.3h-.7v-.6h.7v-.6h.6v.6h.6v.6h-.6v1.3h.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M180.3 217.8v.6h-1.5v-.6h.5v-1.3h-.7v-.6h.7v-.6h.6v.6h.6v.6h-.6v1.3h.4"/><path fill="#c8b100" d="M181 217.8v.6h-2.7v-.6h1v-1.3h-.7v-.6h.7v-.6h.6v.6h.6v.6h-.6v1.3h1"/><path fill="none" stroke="#000" stroke-width=".3" d="M181 217.8v.6h-2.7v-.6h1v-1.3h-.7v-.6h.7v-.6h.6v.6h.6v.6h-.6v1.3h1"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.9 217.3a.9.9 0 0 1 .6.9c0 .5-.4.9-.9.9s-1-.4-1-1c0-.3.4-.7.8-.8"/><path fill="#c8b100" d="M179.6 227.4h-5v-1.2l-.3-1.2-.2-1.6c-1.4-1.8-2.6-3-3-2.7 0-.4.2-.6.4-.8 1.2-.7 3.7 1 5.6 3.9l.5.7h4l.5-.7c1.9-2.9 4.4-4.6 5.6-3.9.2.2.4.4.5.8-.5-.3-1.7.9-3 2.7l-.3 1.6-.2 1.2-.1 1.2h-5"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.6 227.4h-5v-1.2l-.3-1.2-.2-1.6c-1.4-1.8-2.6-3-3-2.7 0-.4.2-.6.4-.8 1.2-.7 3.7 1 5.6 3.9l.5.7h4l.5-.7c1.9-2.9 4.4-4.6 5.6-3.9.2.2.4.4.5.8-.5-.3-1.7.9-3 2.7l-.3 1.6-.2 1.2-.1 1.2h-5z"/><path fill="none" stroke="#000" stroke-width=".3" d="M171.3 220.6c1-.5 3 1.2 4.8 3.8m11.9-3.8c-1-.5-3.1 1.2-4.9 3.8"/><path fill="#c8b100" d="M172.3 229.6a4.8 4.8 0 0 0-.6-1c2-.7 4.8-1 7.9-1 3 0 5.9.3 7.9 1l-.6.9-.3.8c-1.8-.6-4.2-.8-7-.8-2.9 0-5.6.3-7 .8l-.3-.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M172.3 229.6a4.8 4.8 0 0 0-.6-1c2-.7 4.8-1 7.9-1 3 0 5.9.3 7.9 1l-.6.9-.3.8c-1.8-.6-4.2-.8-7-.8-2.9 0-5.6.3-7 .8l-.3-.7"/><path fill="#c8b100" d="M179.6 232.2a27 27 0 0 0 6.2-.7c.7-.2 1.1-.5 1-.8 0-.2-.1-.3-.3-.4a25.8 25.8 0 0 0-7-.9c-2.6 0-5.3.4-6.8.9-.2 0-.3.2-.4.4 0 .3.4.6 1 .8 1 .3 3.8.7 6.3.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.6 232.2a27 27 0 0 0 6.2-.7c.7-.2 1.1-.5 1-.8 0-.2-.1-.3-.3-.4a25.8 25.8 0 0 0-7-.9c-2.6 0-5.3.4-6.8.9-.2 0-.3.2-.4.4 0 .3.4.6 1 .8 1 .3 3.8.7 6.3.7z"/><path fill="#c8b100" d="M187.6 227.4l-.6-.5s-.6.3-1.3.2c-.7-.1-1-1-1-1s-.8.7-1.5.6c-.6 0-1-.6-1-.6s-.8.5-1.4.5c-.7 0-1.3-.9-1.3-.9s-.6.9-1.2 1c-.7 0-1.2-.6-1.2-.6s-.3.6-1 .7c-.9.1-1.6-.6-1.6-.6s-.5.7-1 1c-.6.1-1.3-.4-1.3-.4l-.2.5-.3.2.2.4a32.5 32.5 0 0 1 15.5.1l.2-.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M187.6 227.4l-.6-.5s-.6.3-1.3.2c-.7-.1-1-1-1-1s-.8.7-1.5.6c-.6 0-1-.6-1-.6s-.8.5-1.4.5c-.7 0-1.3-.9-1.3-.9s-.6.9-1.2 1c-.7 0-1.2-.6-1.2-.6s-.3.6-1 .7c-.9.1-1.6-.6-1.6-.6s-.5.7-1 1c-.6.1-1.3-.4-1.3-.4l-.2.5-.3.2.2.4a32.5 32.5 0 0 1 15.5.1l.2-.6z"/><path fill="#c8b100" d="M179.6 224.8h.3a1.1 1.1 0 0 0 1 1.5c.6 0 1-.3 1.2-.8l.1-.4v.5c.1.5.6.9 1.2.9a1.1 1.1 0 0 0 1.1-1.1v-.1l.4-.4.2.4a1 1 0 0 0-.1.5c0 .6.5 1 1 1 .4 0 .8-.1 1-.4l.2-.3v.4c0 .3.2.6.5.7 0 0 .4 0 1-.4l.8-.8v.5s-.5.8-1 1.1l-1 .3c-.3-.1-.5-.4-.7-.7a1.6 1.6 0 0 1-.8.3c-.6 0-1.2-.4-1.4-1a1.6 1.6 0 0 1-1.2.6 2 2 0 0 1-1.3-.6 1.6 1.6 0 0 1-1.1.4c-.6 0-1.1-.3-1.4-.7-.3.4-.8.7-1.4.7a1.6 1.6 0 0 1-1-.4c-.4.3-.9.6-1.4.6a1.6 1.6 0 0 1-1.2-.5c-.2.5-.8.8-1.4.8-.3 0-.6 0-.8-.2-.1.3-.4.6-.7.7a2 2 0 0 1-1-.3 4.4 4.4 0 0 1-1-1.1v-.5l.9.8c.5.4.9.4.9.4.4 0 .5-.4.5-.7v-.4l.2.3c.2.3.6.5 1 .5.5 0 1-.5 1-1a1 1 0 0 0 0-.6l.1-.4.4.4c0 .7.5 1.2 1 1.2.7 0 1.2-.4 1.2-1v-.3l.2.3c.2.5.6.8 1.1.8.7 0 1.2-.5 1.2-1.1a1 1 0 0 0-.1-.4h.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.6 224.8h.3a1.1 1.1 0 0 0 1 1.5c.6 0 1-.3 1.2-.8l.1-.4v.5c.1.5.6.9 1.2.9a1.1 1.1 0 0 0 1.1-1.1v-.1l.4-.4.2.4a1 1 0 0 0-.1.5c0 .6.5 1 1 1 .4 0 .8-.1 1-.4l.2-.3v.4c0 .3.2.6.5.7 0 0 .4 0 1-.4l.8-.8v.5s-.5.8-1 1.1l-1 .3c-.3-.1-.5-.4-.7-.7a1.6 1.6 0 0 1-.8.3c-.6 0-1.2-.4-1.4-1a1.6 1.6 0 0 1-1.2.6 2 2 0 0 1-1.3-.6 1.6 1.6 0 0 1-1.1.4c-.6 0-1.1-.3-1.4-.7-.3.4-.8.7-1.4.7a1.6 1.6 0 0 1-1-.4c-.4.3-.9.6-1.4.6a1.6 1.6 0 0 1-1.2-.5c-.2.5-.8.8-1.4.8-.3 0-.6 0-.8-.2-.1.3-.4.6-.7.7a2 2 0 0 1-1-.3 4.4 4.4 0 0 1-1-1.1v-.5l.9.8c.5.4.9.4.9.4.4 0 .5-.4.5-.7v-.4l.2.3c.2.3.6.5 1 .5.5 0 1-.5 1-1a1 1 0 0 0 0-.6l.1-.4.4.4c0 .7.5 1.2 1 1.2.7 0 1.2-.4 1.2-1v-.3l.2.3c.2.5.6.8 1.1.8.7 0 1.2-.5 1.2-1.1a1 1 0 0 0-.1-.4h.3z"/><path fill="#c8b100" d="M179.6 227.6c-3.1 0-5.9.3-7.9 1l-.3-.2c0-.2 0-.3.2-.4 2-.6 4.8-1 8-1s6 .4 8 1l.2.3c0 .2-.2.3-.3.2-2-.6-4.8-1-8-1"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M179.6 227.6c-3.1 0-5.9.3-7.9 1l-.3-.2c0-.2 0-.3.2-.4 2-.6 4.8-1 8-1s6 .4 8 1l.2.3c0 .2-.2.3-.3.2-2-.6-4.8-1-8-1z"/><path fill="#fff" d="M176.6 228.7c0-.3.2-.5.5-.5.2 0 .4.2.4.5 0 .2-.2.4-.5.4s-.4-.2-.4-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M176.6 228.7c0-.3.2-.5.5-.5.2 0 .4.2.4.5 0 .2-.2.4-.5.4s-.4-.2-.4-.4z"/><path fill="#ad1519" d="M179.6 228.8h-1a.3.3 0 0 1-.3-.3c0-.1.1-.3.3-.3h2a.3.3 0 0 1 .4.3.3.3 0 0 1-.4.3h-1"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.6 228.8h-1a.3.3 0 0 1-.3-.3c0-.1.1-.3.3-.3h2a.3.3 0 0 1 .4.3.3.3 0 0 1-.4.3h-1"/><path fill="#058e6e" d="M174.7 229.2h-.7c-.2.1-.4 0-.4-.2a.3.3 0 0 1 .2-.3l.7-.1.8-.2c.2 0 .3.1.4.3 0 .2-.1.3-.3.4h-.8"/><path fill="none" stroke="#000" stroke-width=".3" d="M174.7 229.2h-.7c-.2.1-.4 0-.4-.2a.3.3 0 0 1 .2-.3l.7-.1.8-.2c.2 0 .3.1.4.3 0 .2-.1.3-.3.4h-.8"/><path fill="#ad1519" d="M171.8 229.7l.3-.5.7.1-.4.6-.6-.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M171.8 229.7l.3-.5.7.1-.4.6-.6-.2"/><path fill="#fff" d="M181.7 228.7c0-.3.2-.5.4-.5.3 0 .5.2.5.5 0 .2-.2.4-.5.4s-.4-.2-.4-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M181.7 228.7c0-.3.2-.5.4-.5.3 0 .5.2.5.5 0 .2-.2.4-.5.4s-.4-.2-.4-.4z"/><path fill="#058e6e" d="M184.5 229.2h.8c.1.1.3 0 .3-.2a.3.3 0 0 0-.2-.3l-.8-.1-.7-.2c-.2 0-.3.1-.4.3 0 .2.1.3.3.4h.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M184.5 229.2h.8c.1.1.3 0 .3-.2a.3.3 0 0 0-.2-.3l-.8-.1-.7-.2c-.2 0-.3.1-.4.3 0 .2.1.3.3.4h.7"/><path fill="#ad1519" d="M187.3 229.7l-.2-.5h-.7l.3.6h.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M187.3 229.7l-.2-.5h-.7l.3.6h.7"/><path fill="#ad1519" d="M179.6 231.6c-2.5 0-4.8-.2-6.5-.7a27.2 27.2 0 0 1 6.5-.7c2.5 0 4.7.3 6.5.7-1.8.5-4 .7-6.5.7"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M179.6 231.6c-2.5 0-4.8-.2-6.5-.7a27.2 27.2 0 0 1 6.5-.7c2.5 0 4.7.3 6.5.7-1.8.5-4 .7-6.5.7z"/><path fill="#c8b100" d="M187.4 226.2c.1-.2 0-.4 0-.4-.2 0-.4 0-.5.2 0 .2 0 .4.2.5.1 0 .3-.1.3-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M187.4 226.2c.1-.2 0-.4 0-.4-.2 0-.4 0-.5.2 0 .2 0 .4.2.5.1 0 .3-.1.3-.3z"/><path fill="#c8b100" d="M182.5 225.2c0-.2 0-.3-.2-.4-.2 0-.3.2-.3.4s0 .3.2.4c.1 0 .3-.2.3-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M182.5 225.2c0-.2 0-.3-.2-.4-.2 0-.3.2-.3.4s0 .3.2.4c.1 0 .3-.2.3-.4z"/><path fill="#c8b100" d="M176.7 225.2c0-.2 0-.3.2-.4.2 0 .3.2.3.4s0 .3-.2.4l-.3-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M176.7 225.2c0-.2 0-.3.2-.4.2 0 .3.2.3.4s0 .3-.2.4l-.3-.4z"/><path fill="#c8b100" d="M171.8 226.2c-.1-.2 0-.4.1-.4s.3 0 .4.2c0 .2 0 .4-.2.5-.1 0-.3-.1-.3-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M171.8 226.2c-.1-.2 0-.4.1-.4s.3 0 .4.2c0 .2 0 .4-.2.5-.1 0-.3-.1-.3-.3z"/><path fill="#c8b100" d="M179.6 222.4l-.9.5.7 1.4.2.2.2-.2.7-1.4-1-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M179.6 222.4l-.9.5.7 1.4.2.2.2-.2.7-1.4-1-.5"/><path fill="#c8b100" d="M177.7 224.5l.4.6 1.3-.4.2-.2-.2-.2-1.3-.4-.4.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M177.7 224.5l.4.6 1.3-.4.2-.2-.2-.2-1.3-.4-.4.6"/><path fill="#c8b100" d="M181.5 224.5l-.4.6-1.3-.4-.2-.2.1-.2 1.4-.4.4.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M181.5 224.5l-.4.6-1.3-.4-.2-.2.1-.2 1.4-.4.4.6"/><path fill="#c8b100" d="M173.9 223l-.7.6.9 1.2.2.1.2-.2.3-1.4-1-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M173.9 223l-.7.6.9 1.2.2.1.2-.2.3-1.4-1-.3"/><path fill="#c8b100" d="M172.4 225.3l.5.5 1.3-.7v-.4h-1.5l-.3.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M172.4 225.3l.5.5 1.3-.7v-.4h-1.5l-.3.6"/><path fill="#c8b100" d="M176.2 224.6l-.3.6-1.4-.1-.2-.2.1-.2 1.3-.7.5.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M176.2 224.6l-.3.6-1.4-.1-.2-.2.1-.2 1.3-.7.5.6"/><path fill="#c8b100" d="M171 225.5v.7l-1.5.1h-.2v-.3l1.1-1 .6.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M171 225.5v.7l-1.5.1h-.2v-.3l1.1-1 .6.5"/><path fill="#c8b100" d="M173.8 225c0-.4.2-.6.5-.6s.5.2.5.5a.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M173.8 225c0-.4.2-.6.5-.6s.5.2.5.5a.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5z"/><path fill="#c8b100" d="M185.3 223l.7.6-.9 1.2-.2.1-.2-.2-.3-1.4 1-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M185.3 223l.7.6-.9 1.2-.2.1-.2-.2-.3-1.4 1-.3"/><path fill="#c8b100" d="M186.8 225.3l-.6.5-1.2-.7-.1-.2.2-.2h1.4l.3.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M186.8 225.3l-.6.5-1.2-.7-.1-.2.2-.2h1.4l.3.6"/><path fill="#c8b100" d="M183 224.6l.3.6 1.4-.1.2-.2-.1-.2-1.3-.7-.5.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M183 224.6l.3.6 1.4-.1.2-.2-.1-.2-1.3-.7-.5.6"/><path fill="#c8b100" d="M188 225.5v.7l1.5.1h.2v-.3l-1.1-1-.6.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M188 225.5v.7l1.5.1h.2v-.3l-1.1-1-.6.5"/><path fill="#c8b100" d="M179 224.5a.5.5 0 0 1 .6-.5c.3 0 .5.2.5.5a.5.5 0 0 1-.5.4.5.5 0 0 1-.5-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M179 224.5a.5.5 0 0 1 .6-.5c.3 0 .5.2.5.5a.5.5 0 0 1-.5.4.5.5 0 0 1-.5-.4z"/><path fill="#c8b100" d="M184.4 225a.5.5 0 0 1 .5-.6.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M184.4 225a.5.5 0 0 1 .5-.6.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5z"/><path fill="#c8b100" d="M169.1 226.3l-.7-.8-.7-.3s.3-.3.6-.3l.5.2v-.2s.3 0 .4.4v1"/><path fill="none" stroke="#000" stroke-width=".3" d="M169.1 226.3l-.7-.8-.7-.3s.3-.3.6-.3l.5.2v-.2s.3 0 .4.4v1z"/><path fill="#c8b100" d="M169.1 226l.6.1c.2.2.2.4 0 .5s-.3.1-.4 0c-.2-.2-.3-.4-.2-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M169.1 226l.6.1c.2.2.2.4 0 .5s-.3.1-.4 0c-.2-.2-.3-.4-.2-.5z"/><path fill="#c8b100" d="M189.9 226.3l.7-.8.7-.3s-.3-.3-.6-.3a.6.6 0 0 0-.5.2v-.2s-.3 0-.4.4v.7l.1.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M189.9 226.3l.7-.8.7-.3s-.3-.3-.6-.3a.6.6 0 0 0-.5.2v-.2s-.3 0-.4.4v.7l.1.3z"/><path fill="#c8b100" d="M189.9 226l-.5.1c-.2.2-.3.4-.2.5h.6c.2-.2.2-.4.1-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M189.9 226l-.5.1c-.2.2-.3.4-.2.5h.6c.2-.2.2-.4.1-.5z"/><path fill="#c8b100" d="M168.2 238h22.9v-6h-22.9v6z"/><path fill="none" stroke="#000" stroke-width=".4" d="M168.2 238h22.9v-6h-22.9v6z"/><path fill="#c8b100" d="M170.6 242l.5-.1h17.5c-.6-.2-1-.7-1-1.3 0-.6.5-1.2 1-1.4a1.8 1.8 0 0 1-.5.1h-17a1.5 1.5 0 0 1-.5 0c.7.2 1 .7 1 1.3 0 .6-.4 1.1-1 1.3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M170.6 242l.5-.1h17.5c-.6-.2-1-.7-1-1.3 0-.6.5-1.2 1-1.4a1.8 1.8 0 0 1-.5.1h-17a1.5 1.5 0 0 1-.5 0c.7.2 1 .7 1 1.3 0 .6-.4 1.1-1 1.3z"/><path fill="#c8b100" d="M171 241.9h17.2c.5 0 1 .3 1 .8 0 .4-.5.8-1 .8H171c-.6 0-1.1-.4-1.1-.8 0-.5.5-.8 1-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M171 241.9h17.2c.5 0 1 .3 1 .8 0 .4-.5.8-1 .8H171c-.6 0-1.1-.4-1.1-.8 0-.5.5-.8 1-.8z"/><path fill="#c8b100" d="M171 238h17.2c.5 0 1 .2 1 .6 0 .4-.5.7-1 .7H171c-.6 0-1-.3-1-.7 0-.4.4-.7 1-.7"/><path fill="none" stroke="#000" stroke-width=".4" d="M171 238h17.2c.5 0 1 .2 1 .6 0 .4-.5.7-1 .7H171c-.6 0-1-.3-1-.7 0-.4.4-.7 1-.7z"/><path fill="#005bbf" d="M195.6 338.6a8.7 8.7 0 0 1-4-.9 8.9 8.9 0 0 0-4-.8c-1.6 0-3 .3-4 .8a8.8 8.8 0 0 1-4 1 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8c-1 .6-2.4 1-4 1v2.4a8.9 8.9 0 0 0 4-1 8.8 8.8 0 0 1 4-.8 9 9 0 0 1 3.9.9 9 9 0 0 0 4 .9 9 9 0 0 0 4-.9 9 9 0 0 1 4-.9c1.5 0 3 .4 4 .9a8.6 8.6 0 0 0 4 .9v-2.5"/><path fill="none" stroke="#000" stroke-width=".4" d="M195.6 338.6a8.7 8.7 0 0 1-4-.9 8.9 8.9 0 0 0-4-.8c-1.6 0-3 .3-4 .8a8.8 8.8 0 0 1-4 1 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8c-1 .6-2.4 1-4 1v2.4a8.9 8.9 0 0 0 4-1 8.8 8.8 0 0 1 4-.8 9 9 0 0 1 3.9.9 9 9 0 0 0 4 .9 9 9 0 0 0 4-.9 9 9 0 0 1 4-.9c1.5 0 3 .4 4 .9a8.6 8.6 0 0 0 4 .9v-2.5z"/><path fill="#ccc" d="M195.6 341a8.7 8.7 0 0 1-4-.8 8.9 8.9 0 0 0-4-.8c-1.6 0-3 .3-4 .8a9 9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8c-1.5 0-2.9.3-3.9.9a9 9 0 0 1-4 .9v2.4a8.9 8.9 0 0 0 4-.9 8.6 8.6 0 0 1 4-.8 9 9 0 0 1 3.9.8 8.7 8.7 0 0 0 4 1 8.9 8.9 0 0 0 4-1 9 9 0 0 1 4-.8 8.9 8.9 0 0 1 4 .9 9 9 0 0 0 4 .9V341"/><path fill="none" stroke="#000" stroke-width=".4" d="M195.6 341a8.7 8.7 0 0 1-4-.8 8.9 8.9 0 0 0-4-.8c-1.6 0-3 .3-4 .8a9 9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8c-1.5 0-2.9.3-3.9.9a9 9 0 0 1-4 .9v2.4a8.9 8.9 0 0 0 4-.9 8.6 8.6 0 0 1 4-.8 9 9 0 0 1 3.9.8 8.7 8.7 0 0 0 4 1 8.9 8.9 0 0 0 4-1 9 9 0 0 1 4-.8 8.9 8.9 0 0 1 4 .9 9 9 0 0 0 4 .9V341"/><path fill="#005bbf" d="M195.6 343.6a8.7 8.7 0 0 1-4-1 8.9 8.9 0 0 0-4-.8 9 9 0 0 0-4 .9 8.9 8.9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.9 8.9 0 0 1-4 1v2.4c1.5 0 3-.3 4-.9a8.7 8.7 0 0 1 4-.8 9 9 0 0 1 3.9.8 9 9 0 0 0 8 0 9 9 0 0 1 4-.8c1.5 0 3 .3 4 .8 1 .6 2.4 1 4 1v-2.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M195.6 343.6a8.7 8.7 0 0 1-4-1 8.9 8.9 0 0 0-4-.8 9 9 0 0 0-4 .9 8.9 8.9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.9 8.9 0 0 1-4 1v2.4c1.5 0 3-.3 4-.9a8.7 8.7 0 0 1 4-.8 9 9 0 0 1 3.9.8 9 9 0 0 0 8 0 9 9 0 0 1 4-.8c1.5 0 3 .3 4 .8 1 .6 2.4 1 4 1v-2.6"/><path fill="#ccc" d="M195.6 348.5a8.6 8.6 0 0 1-4-1 9 9 0 0 0-4-.7 9 9 0 0 0-4 .8 8.9 8.9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.7 9 9 0 0 0-3.9.8 9 9 0 0 1-4 .9V346a9 9 0 0 0 4-.9 8.8 8.8 0 0 1 4-.8 9 9 0 0 1 3.9.8c1 .6 2.4 1 4 1a9 9 0 0 0 4-1 9 9 0 0 1 4-.8 9 9 0 0 1 4 .8c1 .6 2.4 1 4 1v2.4"/><path fill="none" stroke="#000" stroke-width=".4" d="M195.6 348.5a8.6 8.6 0 0 1-4-1 9 9 0 0 0-4-.7 9 9 0 0 0-4 .8 8.9 8.9 0 0 1-4 .9 8.7 8.7 0 0 1-4-1 9 9 0 0 0-4-.7 9 9 0 0 0-3.9.8 9 9 0 0 1-4 .9V346a9 9 0 0 0 4-.9 8.8 8.8 0 0 1 4-.8 9 9 0 0 1 3.9.8c1 .6 2.4 1 4 1a9 9 0 0 0 4-1 9 9 0 0 1 4-.8 9 9 0 0 1 4 .8c1 .6 2.4 1 4 1v2.4"/><path fill="#005bbf" d="M195.6 351a8.7 8.7 0 0 1-4-1 8.8 8.8 0 0 0-4-.8 9 9 0 0 0-4 .9 9 9 0 0 1-4 .8 8.7 8.7 0 0 1-4-.9 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8c-1 .6-2.4 1-4 1v-2.5c1.5 0 3-.4 4-1a8.8 8.8 0 0 1 4-.7 9 9 0 0 1 3.9.8 9 9 0 0 0 4 .9 8.9 8.9 0 0 0 4-.9 9 9 0 0 1 4-.8 9 9 0 0 1 4 .8 9 9 0 0 0 4 .9v2.5"/><path fill="none" stroke="#000" stroke-width=".4" d="M195.6 351a8.7 8.7 0 0 1-4-1 8.8 8.8 0 0 0-4-.8 9 9 0 0 0-4 .9 9 9 0 0 1-4 .8 8.7 8.7 0 0 1-4-.9 9 9 0 0 0-4-.8 9 9 0 0 0-3.9.8c-1 .6-2.4 1-4 1v-2.5c1.5 0 3-.4 4-1a8.8 8.8 0 0 1 4-.7 9 9 0 0 1 3.9.8 9 9 0 0 0 4 .9 8.9 8.9 0 0 0 4-.9 9 9 0 0 1 4-.8 9 9 0 0 1 4 .8 9 9 0 0 0 4 .9v2.5z"/><path fill="#c8b100" d="M170.6 328.5l.2.6c0 1.5-1.3 2.7-3 2.7h23.6c-1.6 0-2.9-1.2-2.9-2.7l.1-.6a1.4 1.4 0 0 1-.5 0h-17.5"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M170.6 328.5l.2.6c0 1.5-1.3 2.7-3 2.7h23.6c-1.6 0-2.9-1.2-2.9-2.7l.1-.6a1.4 1.4 0 0 1-.5 0h-17.5z"/><path fill="#c8b100" d="M171 327h17.2c.5 0 1 .3 1 .7 0 .5-.5.8-1 .8H171c-.6 0-1.1-.3-1.1-.8 0-.4.5-.8 1-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M171 327h17.2c.5 0 1 .3 1 .7 0 .5-.5.8-1 .8H171c-.6 0-1.1-.3-1.1-.8 0-.4.5-.8 1-.8z"/><path fill="#c8b100" d="M168 337.8h23.3v-6H168v6z"/><path fill="none" stroke="#000" stroke-width=".4" d="M168 337.8h23.3v-6H168v6z"/><path fill="#ad1519" d="M166 305.8c-2.2 1.3-3.8 2.7-3.5 3.4 0 .6.8 1 1.9 1.8 1.6 1.1 2.6 3.2 1.8 4.1a5.9 5.9 0 0 0-.1-9.3"/><path fill="none" stroke="#000" stroke-width=".4" d="M166 305.8c-2.2 1.3-3.8 2.7-3.5 3.4 0 .6.8 1 1.9 1.8 1.6 1.1 2.6 3.2 1.8 4.1a5.9 5.9 0 0 0-.1-9.3z"/><path fill="#ccc" d="M171.3 326h16.6v-81.6h-16.6V326z"/><path fill="none" stroke="#000" stroke-width=".4" d="M183.1 244.5V326m2-81.4V326m-13.8 0h16.6v-81.5h-16.6V326z"/><path fill="#ad1519" d="M205 275a52.8 52.8 0 0 0-17-3 51.6 51.6 0 0 0-8 .8c-9.9 1.7-17.5 5.6-16.9 8.9v.2l-3.7-8.7c-.7-3.6 7.7-8 18.8-9.8a57 57 0 0 1 9.8-.8c7 0 13.2.9 16.9 2.3v10"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M205 275a52.8 52.8 0 0 0-17-3 51.6 51.6 0 0 0-8 .8c-9.9 1.7-17.5 5.6-16.9 8.9v.2l-3.7-8.7c-.7-3.6 7.7-8 18.8-9.8a57 57 0 0 1 9.8-.8c7 0 13.2.9 16.9 2.3v10"/><path fill="#ad1519" d="M171.3 285.1c-4.7-.3-7.8-1.5-8.2-3.5-.3-1.5 1.3-3.2 4-4.7 1.3.1 2.7.3 4.2.3v8"/><path fill="none" stroke="#000" stroke-width=".4" d="M171.3 285.1c-4.7-.3-7.8-1.5-8.2-3.5-.3-1.5 1.3-3.2 4-4.7 1.3.1 2.7.3 4.2.3v8"/><path fill="#ad1519" d="M188 279c2.8.4 5 1 6 2l.2.1c.5 1-2 3.3-6.3 5.8v-8"/><path fill="none" stroke="#000" stroke-width=".4" d="M188 279c2.8.4 5 1 6 2l.2.1c.5 1-2 3.3-6.3 5.8v-8"/><path fill="#ad1519" d="M160.9 300.9c-.4-1.3 4-4 10.4-6.3 3-1 5.3-2.1 8.3-3.4 8.9-4 15.4-8.4 14.6-10l-.1-.2c.5.4 1.2 8.4 1.2 8.4.8 1.5-5.2 6-13.3 9.8-2.6 1.3-8.1 3.3-10.7 4.2-4.7 1.6-9.3 4.7-8.9 5.8l-1.5-8.3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M160.9 300.9c-.4-1.3 4-4 10.4-6.3 3-1 5.3-2.1 8.3-3.4 8.9-4 15.4-8.4 14.6-10l-.1-.2c.5.4 1.2 8.4 1.2 8.4.8 1.5-5.2 6-13.3 9.8-2.6 1.3-8.1 3.3-10.7 4.2-4.7 1.6-9.3 4.7-8.9 5.8l-1.5-8.3z"/><path fill="#c8b100" d="M170.1 271c2-.7 3.4-1.6 2.7-3.2-.4-1-1.4-1.2-3-.7l-2.8 1 2.5 6.2.9-.3.8-.3-1-2.7zm-1.2-3l.7-.2c.6-.3 1.3 0 1.5.8.3.5.2 1.1-.5 1.6a4.7 4.7 0 0 1-.7.3l-1-2.5m7.7-2.6l-.8.3h-1l1.5 6.5 4.5-.9-.2-.4v-.4l-2.7.7-1.3-5.8m9 5.6l2.9-6.8a5.4 5.4 0 0 1-1.1 0 58.5 58.5 0 0 1-2 5c-.8-1.6-1.7-3.1-2.4-4.7l-1 .1h-1.1l3.7 6.5.5-.1h.5m9.4-5l.5-.9a3.7 3.7 0 0 0-1.9-.6c-1.8-.2-2.8.6-3 1.7-.2 2.3 3.4 2.1 3.3 3.7-.1.6-.8.9-1.6.8-.8 0-1.4-.5-1.5-1.2h-.2a8 8 0 0 1-.5 1.2c.5.3 1.2.5 1.9.6 1.8.2 3.3-.6 3.4-1.8.2-2.2-3.4-2.3-3.3-3.6 0-.6.5-1 1.4-.8.7 0 1.1.4 1.3 1h.2"/><path fill="#ad1519" d="M332.4 225.7s-.8.8-1.3 1c-.6 0-1.3-.6-1.3-.6s-.5.5-1.1.7c-.6.1-1.4-.7-1.4-.7s-.6.8-1.2 1c-.5.2-1.1-.2-1.1-.2s-.2.4-.7.6h-.5l-.6-.5-.7-.7-.6-.2-.3-1.1-.1-.6c-.1-.7.9-1.4 2.4-1.8.8-.2 1.5-.1 2 0a6 6 0 0 1 3.3-.8 6 6 0 0 1 3.2.7 5.9 5.9 0 0 1 3-.7c1.5 0 2.7.3 3.3.8a4.2 4.2 0 0 1 2.1 0c1.5.4 2.5 1.1 2.4 1.8v.6l-.4 1-.6.3-.7.8-.6.3s-.3.2-.5.1c-.5-.2-.7-.6-.7-.6s-.6.4-1.2.2c-.5-.2-1-1-1-1s-.9.8-1.5.7c-.6-.2-1.1-.7-1.1-.7s-.7.6-1.2.5c-.6 0-1.4-.9-1.4-.9"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.4 225.7s-.8.8-1.3 1c-.6 0-1.3-.6-1.3-.6s-.5.5-1.1.7c-.6.1-1.4-.7-1.4-.7s-.6.8-1.2 1c-.5.2-1.1-.2-1.1-.2s-.2.4-.7.6h-.5l-.6-.5-.7-.7-.6-.2-.3-1.1-.1-.6c-.1-.7.9-1.4 2.4-1.8.8-.2 1.5-.1 2 0a6 6 0 0 1 3.3-.8 6 6 0 0 1 3.2.7 5.9 5.9 0 0 1 3-.7c1.5 0 2.7.3 3.3.8a4.2 4.2 0 0 1 2.1 0c1.5.4 2.5 1.1 2.4 1.8v.6l-.4 1-.6.3-.7.8-.6.3s-.3.2-.5.1c-.5-.2-.7-.6-.7-.6s-.6.4-1.2.2c-.5-.2-1-1-1-1s-.9.8-1.5.7c-.6-.2-1.1-.7-1.1-.7s-.7.6-1.2.5c-.6 0-1.4-.9-1.4-.9z"/><path fill="#c8b100" d="M331 221.4c0-1.1.6-2 1.3-2 .8 0 1.4.9 1.4 2s-.6 2-1.4 2c-.8 0-1.4-.9-1.4-2"/><path fill="none" stroke="#000" stroke-width=".3" d="M331 221.4c0-1.1.6-2 1.3-2 .8 0 1.4.9 1.4 2s-.6 2-1.4 2c-.8 0-1.4-.9-1.4-2z"/><path fill="#c8b100" d="M331.7 221.4c0-1 .3-1.9.7-1.9.3 0 .6.9.6 1.9 0 1-.3 1.8-.7 1.8-.3 0-.6-.8-.6-1.8"/><path fill="none" stroke="#000" stroke-width=".3" d="M331.7 221.4c0-1 .3-1.9.7-1.9.3 0 .6.9.6 1.9 0 1-.3 1.8-.7 1.8-.3 0-.6-.8-.6-1.8z"/><path fill="#c8b100" d="M325 229.6a4.8 4.8 0 0 0-.5-1c2-.7 4.7-1 7.8-1 3.1 0 6 .3 8 1l-.6.9-.4.8c-1.8-.6-4.1-.8-7-.8-2.8 0-5.6.3-7 .8l-.2-.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M325 229.6a4.8 4.8 0 0 0-.5-1c2-.7 4.7-1 7.8-1 3.1 0 6 .3 8 1l-.6.9-.4.8c-1.8-.6-4.1-.8-7-.8-2.8 0-5.6.3-7 .8l-.2-.7"/><path fill="#c8b100" d="M332.3 232.2c2.5 0 5.3-.4 6.3-.7.7-.2 1-.5 1-.8 0-.2-.2-.3-.4-.4a25.7 25.7 0 0 0-6.9-.9 26 26 0 0 0-6.8.9c-.2 0-.4.2-.4.4 0 .3.3.6 1 .8 1 .3 3.7.7 6.2.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.3 232.2c2.5 0 5.3-.4 6.3-.7.7-.2 1-.5 1-.8 0-.2-.2-.3-.4-.4a25.7 25.7 0 0 0-6.9-.9 26 26 0 0 0-6.8.9c-.2 0-.4.2-.4.4 0 .3.3.6 1 .8 1 .3 3.7.7 6.2.7z"/><path fill="#fff" d="M338.4 222.3a.5.5 0 0 1 .4-.5c.3 0 .5.2.5.5 0 .2-.2.4-.5.4a.5.5 0 0 1-.4-.4"/><path fill="none" stroke="#000" stroke-width=".2" d="M338.4 222.3a.5.5 0 0 1 .4-.5c.3 0 .5.2.5.5 0 .2-.2.4-.5.4a.5.5 0 0 1-.4-.4zm-.3-1.6a.5.5 0 0 1 .5-.4c.2 0 .4.2.4.4s-.2.5-.4.5a.5.5 0 0 1-.5-.4zm-1.1-1a.5.5 0 0 1 .4-.3c.3 0 .5.1.5.4s-.2.4-.5.4a.5.5 0 0 1-.4-.4zm-1.5-.4c0-.2.2-.4.5-.4a.5.5 0 0 1 .4.4.5.5 0 0 1-.4.5c-.3 0-.5-.2-.5-.5zm-1.5 0a.5.5 0 0 1 .5-.4c.3 0 .5.2.5.5s-.2.4-.5.4a.5.5 0 0 1-.5-.4z"/><path fill="none" stroke="#000" stroke-linecap="round" stroke-width=".3" d="M343 225.3a3 3 0 0 0 .2-1.1 3 3 0 0 0-3-3 2.8 2.8 0 0 0-1.3.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M337.8 223.2l.3-.9c0-1.2-1.3-2.1-2.7-2.1-.7 0-1.3.1-1.7.4"/><path fill="none" stroke="#000" stroke-width=".2" d="M343.4 224c0-.3.2-.5.4-.5s.5.2.5.4-.2.5-.5.5c-.2 0-.4-.2-.4-.5zm-.2-1.7c0-.2.2-.4.5-.4.2 0 .4.2.4.4s-.2.4-.5.4c-.2 0-.4-.1-.4-.4zm-1-1.2a.5.5 0 0 1 .4-.5c.3 0 .5.2.5.5s-.2.4-.5.4a.5.5 0 0 1-.5-.4zm-1.5-.7c0-.2.3-.4.5-.4.3 0 .5.2.5.4a.5.5 0 0 1-.5.5.5.5 0 0 1-.4-.5zm-1.4 0c0-.2.2-.4.4-.4s.5.2.5.5-.2.4-.5.4-.4-.2-.4-.4z"/><path fill="#c8b100" d="M340.3 227.4l-.6-.5s-.6.3-1.3.2c-.7-.1-1-1-1-1s-.7.7-1.4.6c-.7 0-1.1-.6-1.1-.6s-.7.5-1.4.5c-.6 0-1.2-.9-1.2-.9s-.7.9-1.3 1c-.6 0-1.1-.6-1.1-.6s-.3.6-1.1.7c-.8.1-1.5-.6-1.5-.6s-.5.7-1 1c-.6.1-1.3-.4-1.3-.4l-.2.5-.4.2.2.4a32.5 32.5 0 0 1 15.5.1l.2-.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M340.3 227.4l-.6-.5s-.6.3-1.3.2c-.7-.1-1-1-1-1s-.7.7-1.4.6c-.7 0-1.1-.6-1.1-.6s-.7.5-1.4.5c-.6 0-1.2-.9-1.2-.9s-.7.9-1.3 1c-.6 0-1.1-.6-1.1-.6s-.3.6-1.1.7c-.8.1-1.5-.6-1.5-.6s-.5.7-1 1c-.6.1-1.3-.4-1.3-.4l-.2.5-.4.2.2.4a32.5 32.5 0 0 1 15.5.1l.2-.6z"/><path fill="#fff" d="M325.3 222.3a.5.5 0 0 1 .5-.5.5.5 0 0 1 .4.5.5.5 0 0 1-.4.4c-.3 0-.5-.2-.5-.4"/><path fill="none" stroke="#000" stroke-width=".2" d="M325.3 222.3a.5.5 0 0 1 .5-.5.5.5 0 0 1 .4.5.5.5 0 0 1-.4.4c-.3 0-.5-.2-.5-.4zm.3-1.6a.5.5 0 0 1 .4-.4.5.5 0 0 1 .5.4.5.5 0 0 1-.5.5.4.4 0 0 1-.4-.4zm1.1-1c0-.1.2-.3.5-.3s.5.1.5.4-.2.4-.5.4a.5.5 0 0 1-.5-.4zm1.5-.4c0-.2.2-.4.4-.4s.5.2.5.4c0 .3-.2.5-.5.5-.2 0-.4-.2-.4-.5zm1.5 0a.5.5 0 0 1 .4-.4.5.5 0 0 1 .5.5c0 .2-.2.4-.5.4a.5.5 0 0 1-.4-.4z"/><path fill="none" stroke="#000" stroke-linecap="round" stroke-width=".3" d="M321.7 225.3a3 3 0 0 1-.3-1.1 3 3 0 0 1 3-3c.4 0 1 .2 1.3.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M326.9 223.2l-.3-.9c0-1.2 1.2-2.1 2.7-2.1.6 0 1.2.1 1.6.4"/><path fill="none" stroke="#000" stroke-width=".2" d="M320.3 224c0-.3.2-.5.5-.5s.5.2.5.4a.5.5 0 0 1-.5.5c-.3 0-.5-.2-.5-.5zm.2-1.7c0-.2.2-.4.5-.4s.4.2.4.4-.2.4-.4.4a.5.5 0 0 1-.5-.4zm1-1.2c0-.3.3-.5.5-.5a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.4.5.5 0 0 1-.4-.4zm1.5-.7a.5.5 0 0 1 .4-.4c.3 0 .5.2.5.4a.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5zm1.4 0c0-.2.2-.4.5-.4a.5.5 0 0 1 .4.5c0 .2-.2.4-.4.4s-.5-.2-.5-.4z"/><path fill="#c8b100" d="M332.4 224.8h.2v.4c0 .6.5 1 1.1 1 .5 0 1-.2 1.1-.7l.2-.4v.5c0 .5.6.9 1.1.9a1.1 1.1 0 0 0 1.2-1.1.7.7 0 0 0 0-.1l.3-.4.2.4a1 1 0 0 0 0 .5c0 .6.4 1 1 1a1.1 1.1 0 0 0 1-.4l.1-.3v.4c0 .3.2.6.5.7 0 0 .4 0 1-.4l.8-.8v.5s-.5.8-1 1.1c-.2.1-.6.3-1 .3-.3-.1-.5-.4-.6-.7a1.6 1.6 0 0 1-.8.3c-.7 0-1.3-.4-1.5-1a1.6 1.6 0 0 1-1.2.6 1.7 1.7 0 0 1-1.3-.6c-.3.3-.7.4-1 .4a1.7 1.7 0 0 1-1.5-.7 1.7 1.7 0 0 1-2.4.3 1.7 1.7 0 0 1-1.3.6c-.5 0-1-.2-1.2-.5-.2.5-.8.8-1.5.8-.3 0-.5 0-.8-.2-.1.3-.3.6-.7.7a2 2 0 0 1-1-.3l-1-1.1v-.5l1 .8c.4.4.8.4.8.4.4 0 .5-.4.5-.7v-.4l.3.3c.2.3.5.5.9.5.6 0 1-.5 1-1a1 1 0 0 0 0-.6l.2-.4.3.4c0 .7.5 1.2 1.1 1.2.6 0 1.1-.4 1.2-1v-.3l.2.3c.1.5.6.8 1 .8a1.1 1.1 0 0 0 1.2-1.5h.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.4 224.8h.2v.4c0 .6.5 1 1.1 1 .5 0 1-.2 1.1-.7l.2-.4v.5c0 .5.6.9 1.1.9a1.1 1.1 0 0 0 1.2-1.1.7.7 0 0 0 0-.1l.3-.4.2.4a1 1 0 0 0 0 .5c0 .6.4 1 1 1a1.1 1.1 0 0 0 1-.4l.1-.3v.4c0 .3.2.6.5.7 0 0 .4 0 1-.4l.8-.8v.5s-.5.8-1 1.1c-.2.1-.6.3-1 .3-.3-.1-.5-.4-.6-.7a1.6 1.6 0 0 1-.8.3c-.7 0-1.3-.4-1.5-1a1.6 1.6 0 0 1-1.2.6 1.7 1.7 0 0 1-1.3-.6c-.3.3-.7.4-1 .4a1.7 1.7 0 0 1-1.5-.7 1.7 1.7 0 0 1-2.4.3 1.7 1.7 0 0 1-1.3.6c-.5 0-1-.2-1.2-.5-.2.5-.8.8-1.5.8-.3 0-.5 0-.8-.2-.1.3-.3.6-.7.7a2 2 0 0 1-1-.3l-1-1.1v-.5l1 .8c.4.4.8.4.8.4.4 0 .5-.4.5-.7v-.4l.3.3c.2.3.5.5.9.5.6 0 1-.5 1-1a1 1 0 0 0 0-.6l.2-.4.3.4c0 .7.5 1.2 1.1 1.2.6 0 1.1-.4 1.2-1v-.3l.2.3c.1.5.6.8 1 .8a1.1 1.1 0 0 0 1.2-1.5h.2z"/><path fill="#c8b100" d="M332.3 227.6c-3 0-5.8.3-7.8 1l-.4-.2.2-.4c2-.6 4.9-1 8-1s6 .4 8 1c.2 0 .3.2.2.3 0 .2-.2.3-.3.2-2-.6-4.8-1-7.9-1"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.3 227.6c-3 0-5.8.3-7.8 1l-.4-.2.2-.4c2-.6 4.9-1 8-1s6 .4 8 1c.2 0 .3.2.2.3 0 .2-.2.3-.3.2-2-.6-4.8-1-7.9-1z"/><path fill="#fff" d="M329.4 228.7c0-.3.2-.5.4-.5s.5.2.5.5c0 .2-.3.4-.5.4s-.5-.2-.5-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M329.4 228.7c0-.3.2-.5.4-.5s.5.2.5.5c0 .2-.3.4-.5.4s-.5-.2-.5-.4z"/><path fill="#ad1519" d="M332.4 228.8h-1c-.2 0-.4-.1-.4-.3 0-.1.2-.3.4-.3h2a.3.3 0 0 1 .3.3c0 .2-.1.3-.3.3h-1"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.4 228.8h-1c-.2 0-.4-.1-.4-.3 0-.1.2-.3.4-.3h2a.3.3 0 0 1 .3.3c0 .2-.1.3-.3.3h-1"/><path fill="#058e6e" d="M327.4 229.2h-.7a.3.3 0 0 1-.4-.2.3.3 0 0 1 .3-.3l.7-.1.7-.2c.2 0 .4.1.4.3 0 .2 0 .3-.3.4h-.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M327.4 229.2h-.7a.3.3 0 0 1-.4-.2.3.3 0 0 1 .3-.3l.7-.1.7-.2c.2 0 .4.1.4.3 0 .2 0 .3-.3.4h-.7"/><path fill="#ad1519" d="M324.5 229.7l.4-.5.6.1-.4.6-.6-.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M324.5 229.7l.4-.5.6.1-.4.6-.6-.2"/><path fill="#fff" d="M334.4 228.7c0-.3.2-.5.5-.5.2 0 .4.2.4.5 0 .2-.2.4-.4.4s-.5-.2-.5-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M334.4 228.7c0-.3.2-.5.5-.5.2 0 .4.2.4.5 0 .2-.2.4-.4.4s-.5-.2-.5-.4z"/><path fill="#058e6e" d="M337.3 229.2h.7c.2.1.3 0 .4-.2a.3.3 0 0 0-.3-.3l-.7-.1-.7-.2c-.2 0-.4.1-.4.3 0 .2 0 .3.3.4h.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M337.3 229.2h.7c.2.1.3 0 .4-.2a.3.3 0 0 0-.3-.3l-.7-.1-.7-.2c-.2 0-.4.1-.4.3 0 .2 0 .3.3.4h.7"/><path fill="#ad1519" d="M340.1 229.7l-.3-.5h-.7l.4.6h.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M340.1 229.7l-.3-.5h-.7l.4.6h.6"/><path fill="#ad1519" d="M332.3 231.6a27.1 27.1 0 0 1-6.4-.7 27.9 27.9 0 0 1 13 0 27.1 27.1 0 0 1-6.6.7"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M332.3 231.6a27.1 27.1 0 0 1-6.4-.7 27.9 27.9 0 0 1 13 0 27.1 27.1 0 0 1-6.6.7z"/><path fill="#c8b100" d="M340.2 226.2l-.1-.4c-.2 0-.3 0-.4.2l.1.5c.2 0 .3-.1.4-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M340.2 226.2l-.1-.4c-.2 0-.3 0-.4.2l.1.5c.2 0 .3-.1.4-.3z"/><path fill="#c8b100" d="M335.2 225.2c0-.2 0-.3-.2-.4-.1 0-.3.2-.3.4s0 .3.2.4c.2 0 .3-.2.3-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M335.2 225.2c0-.2 0-.3-.2-.4-.1 0-.3.2-.3.4s0 .3.2.4c.2 0 .3-.2.3-.4z"/><path fill="#c8b100" d="M329.5 225.2c0-.2 0-.3.2-.4.1 0 .3.2.3.4s0 .3-.2.4c-.2 0-.3-.2-.3-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M329.5 225.2c0-.2 0-.3.2-.4.1 0 .3.2.3.4s0 .3-.2.4c-.2 0-.3-.2-.3-.4z"/><path fill="#c8b100" d="M324.5 226.2l.1-.4c.2 0 .3 0 .4.2l-.1.5c-.2 0-.3-.1-.4-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M324.5 226.2l.1-.4c.2 0 .3 0 .4.2l-.1.5c-.2 0-.3-.1-.4-.3z"/><path fill="#c8b100" d="M332.3 222.4l-.8.5.6 1.4.2.2.3-.2.6-1.4-.9-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.3 222.4l-.8.5.6 1.4.2.2.3-.2.6-1.4-.9-.5"/><path fill="#c8b100" d="M330.4 224.5l.4.6 1.4-.4.1-.2-.1-.2-1.4-.4-.4.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M330.4 224.5l.4.6 1.4-.4.1-.2-.1-.2-1.4-.4-.4.6"/><path fill="#c8b100" d="M334.3 224.5l-.4.6-1.4-.4-.1-.2.1-.2 1.4-.4.4.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M334.3 224.5l-.4.6-1.4-.4-.1-.2.1-.2 1.4-.4.4.6"/><path fill="#c8b100" d="M326.6 223l-.7.6 1 1.2.2.1.1-.2.3-1.4-.9-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M326.6 223l-.7.6 1 1.2.2.1.1-.2.3-1.4-.9-.3"/><path fill="#c8b100" d="M325.2 225.3l.5.5 1.2-.7.1-.2-.1-.2h-1.5l-.2.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M325.2 225.3l.5.5 1.2-.7.1-.2-.1-.2h-1.5l-.2.6"/><path fill="#c8b100" d="M329 224.6l-.3.6-1.4-.1-.2-.2v-.2l1.3-.7.6.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M329 224.6l-.3.6-1.4-.1-.2-.2v-.2l1.3-.7.6.6"/><path fill="#c8b100" d="M323.8 225.5l-.1.7-1.5.1h-.2v-.3l1.2-1 .6.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M323.8 225.5l-.1.7-1.5.1h-.2v-.3l1.2-1 .6.5"/><path fill="#c8b100" d="M326.6 225a.5.5 0 0 1 .5-.6.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M326.6 225a.5.5 0 0 1 .5-.6.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5z"/><path fill="#c8b100" d="M338 223l.8.6-1 1.2-.2.1-.1-.2-.3-1.4.9-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M338 223l.8.6-1 1.2-.2.1-.1-.2-.3-1.4.9-.3"/><path fill="#c8b100" d="M339.5 225.3l-.5.5-1.3-.7v-.2l.1-.2h1.5l.2.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M339.5 225.3l-.5.5-1.3-.7v-.2l.1-.2h1.5l.2.6"/><path fill="#c8b100" d="M335.7 224.6l.3.6 1.4-.1.2-.2v-.2l-1.3-.7-.6.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M335.7 224.6l.3.6 1.4-.1.2-.2v-.2l-1.3-.7-.6.6"/><path fill="#c8b100" d="M340.7 225.5l.1.7 1.4.1h.3v-.3l-1.2-1-.6.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M340.7 225.5l.1.7 1.4.1h.3v-.3l-1.2-1-.6.5"/><path fill="#c8b100" d="M331.8 224.5c0-.3.3-.5.5-.5s.5.2.5.5c0 .2-.2.4-.5.4a.5.5 0 0 1-.5-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M331.8 224.5c0-.3.3-.5.5-.5s.5.2.5.5c0 .2-.2.4-.5.4a.5.5 0 0 1-.5-.4z"/><path fill="#c8b100" d="M337.1 225a.5.5 0 0 1 .5-.6c.3 0 .5.2.5.5s-.2.5-.5.5a.5.5 0 0 1-.5-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M337.1 225a.5.5 0 0 1 .5-.6c.3 0 .5.2.5.5s-.2.5-.5.5a.5.5 0 0 1-.5-.5z"/><path fill="#c8b100" d="M331.4 219c0-.4.4-.8 1-.8s.9.4.9.9-.4.9-1 .9a1 1 0 0 1-.9-1"/><path fill="#c8b100" d="M333 218.8v.6h-1.5v-.6h.5v-1.4h-.6v-.6h.6v-.5h.7v.5h.6v.6h-.6v1.4h.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M333 218.8v.6h-1.5v-.6h.5v-1.4h-.6v-.6h.6v-.5h.7v.5h.6v.6h-.6v1.4h.3z"/><path fill="#c8b100" d="M333.7 218.8v.6H331v-.6h1v-1.4h-.7v-.6h.6v-.5h.7v.5h.6v.6h-.6v1.4h1"/><path fill="none" stroke="#000" stroke-width=".3" d="M332.6 218.2a.9.9 0 0 1 .7.9c0 .5-.4.9-1 .9a1 1 0 0 1-.9-1c0-.3.3-.7.7-.8"/><path fill="#c8b100" d="M321.9 226.3l-.7-.8-.7-.3s.3-.3.6-.3l.5.2v-.2s.2 0 .3.4c.2.3 0 .7 0 .7v.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M321.9 226.3l-.7-.8-.7-.3s.3-.3.6-.3l.5.2v-.2s.2 0 .3.4c.2.3 0 .7 0 .7v.3z"/><path fill="#c8b100" d="M321.9 226l.5.1c.2.2.3.4.1.5h-.5c-.2-.2-.2-.4-.1-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M321.9 226l.5.1c.2.2.3.4.1.5h-.5c-.2-.2-.2-.4-.1-.5z"/><path fill="#c8b100" d="M342.6 226.3l.7-.8.7-.3s-.3-.3-.6-.3a.6.6 0 0 0-.5.2v-.2s-.3 0-.4.4v.7l.1.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M342.6 226.3l.7-.8.7-.3s-.3-.3-.6-.3a.6.6 0 0 0-.5.2v-.2s-.3 0-.4.4v.7l.1.3z"/><path fill="#c8b100" d="M342.6 226l-.5.1c-.2.2-.2.4-.1.5.1.2.3.1.5 0 .2-.2.3-.4.1-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M342.6 226l-.5.1c-.2.2-.2.4-.1.5.1.2.3.1.5 0 .2-.2.3-.4.1-.5z"/><path fill="#c8b100" d="M321 238h22.8v-6h-22.9v6z"/><path fill="none" stroke="#000" stroke-width=".4" d="M321 238h22.8v-6h-22.9v6z"/><path fill="#c8b100" d="M341.4 242a1 1 0 0 0-.4-.1h-17.6c.6-.2 1-.7 1-1.3 0-.6-.5-1.2-1-1.4l.4.1h17.6c-.7.2-1 .7-1 1.3 0 .6.4 1.1 1 1.3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M341.4 242a1 1 0 0 0-.4-.1h-17.6c.6-.2 1-.7 1-1.3 0-.6-.5-1.2-1-1.4l.4.1h17.6c-.7.2-1 .7-1 1.3 0 .6.4 1.1 1 1.3z"/><path fill="#c8b100" d="M323.9 241.9h17c.6 0 1.1.3 1.1.8 0 .4-.5.8-1 .8h-17.1c-.6 0-1-.4-1-.8 0-.5.4-.8 1-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M323.9 241.9h17c.6 0 1.1.3 1.1.8 0 .4-.5.8-1 .8h-17.1c-.6 0-1-.4-1-.8 0-.5.4-.8 1-.8z"/><path fill="#c8b100" d="M323.9 238h17c.6 0 1.1.2 1.1.6 0 .4-.5.7-1 .7h-17.1c-.6 0-1.1-.3-1.1-.7 0-.4.5-.7 1-.7"/><path fill="none" stroke="#000" stroke-width=".4" d="M323.9 238h17c.6 0 1.1.2 1.1.6 0 .4-.5.7-1 .7h-17.1c-.6 0-1.1-.3-1.1-.7 0-.4.5-.7 1-.7z"/><path fill="#005bbf" d="M316.4 338.6c1.6 0 3-.3 4-.9a8.9 8.9 0 0 1 4-.8c1.5 0 3 .3 4 .8 1 .6 2.5 1 4 1a8.7 8.7 0 0 0 4-1 9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v2.4a8.9 8.9 0 0 1-4-1 8.8 8.8 0 0 0-4-.8c-1.5 0-2.8.4-3.9.9a8.8 8.8 0 0 1-4 .9 9 9 0 0 1-4-.9 9 9 0 0 0-4-.9c-1.5 0-3 .4-4 .9a8.6 8.6 0 0 1-4 .9v-2.5"/><path fill="none" stroke="#000" stroke-width=".4" d="M316.4 338.6c1.6 0 3-.3 4-.9a8.9 8.9 0 0 1 4-.8c1.5 0 3 .3 4 .8 1 .6 2.5 1 4 1a8.7 8.7 0 0 0 4-1 9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v2.4a8.9 8.9 0 0 1-4-1 8.8 8.8 0 0 0-4-.8c-1.5 0-2.8.4-3.9.9a8.8 8.8 0 0 1-4 .9 9 9 0 0 1-4-.9 9 9 0 0 0-4-.9c-1.5 0-3 .4-4 .9a8.6 8.6 0 0 1-4 .9v-2.5z"/><path fill="#ccc" d="M316.4 341a8.7 8.7 0 0 0 4-.8 8.9 8.9 0 0 1 4-.8c1.5 0 3 .3 4 .8a9 9 0 0 0 4 .9c1.6 0 3-.4 4-1a8.9 8.9 0 0 1 4-.8 8 8 0 0 1 3.9.9 8.9 8.9 0 0 0 4 .9v2.4a8.9 8.9 0 0 1-4-.9 8.6 8.6 0 0 0-4-.8c-1.5 0-2.8.3-3.9.8a8.7 8.7 0 0 1-4 1 8.9 8.9 0 0 1-4-1 9 9 0 0 0-4-.8 8.9 8.9 0 0 0-4 .9 8.6 8.6 0 0 1-4 .9V341"/><path fill="none" stroke="#000" stroke-width=".4" d="M316.4 341a8.7 8.7 0 0 0 4-.8 8.9 8.9 0 0 1 4-.8c1.5 0 3 .3 4 .8a9 9 0 0 0 4 .9c1.6 0 3-.4 4-1a8.9 8.9 0 0 1 4-.8 8 8 0 0 1 3.9.9 8.9 8.9 0 0 0 4 .9v2.4a8.9 8.9 0 0 1-4-.9 8.6 8.6 0 0 0-4-.8c-1.5 0-2.8.3-3.9.8a8.7 8.7 0 0 1-4 1 8.9 8.9 0 0 1-4-1 9 9 0 0 0-4-.8 8.9 8.9 0 0 0-4 .9 8.6 8.6 0 0 1-4 .9V341"/><path fill="#005bbf" d="M316.4 343.6c1.6 0 3-.4 4-1a8.9 8.9 0 0 1 4-.8 9 9 0 0 1 4 .9c1 .5 2.5.9 4 .9 1.6 0 3-.4 4-1a9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v2.4a8.9 8.9 0 0 1-4-.9 8.7 8.7 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.7 8.7 0 0 1-4 1 9 9 0 0 1-4-1 9 9 0 0 0-4-.8c-1.5 0-3 .3-4 .8a8.6 8.6 0 0 1-4 1v-2.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M316.4 343.6c1.6 0 3-.4 4-1a8.9 8.9 0 0 1 4-.8 9 9 0 0 1 4 .9c1 .5 2.5.9 4 .9 1.6 0 3-.4 4-1a9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v2.4a8.9 8.9 0 0 1-4-.9 8.7 8.7 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.7 8.7 0 0 1-4 1 9 9 0 0 1-4-1 9 9 0 0 0-4-.8c-1.5 0-3 .3-4 .8a8.6 8.6 0 0 1-4 1v-2.6"/><path fill="#ccc" d="M316.4 348.5a8.6 8.6 0 0 0 4-1 9 9 0 0 1 4-.7 9 9 0 0 1 4 .8c1 .5 2.5.9 4 .9 1.6 0 3-.4 4-1a9 9 0 0 1 4-.7c1.5 0 2.8.3 3.9.8 1 .5 2.5.9 4 .9V346a8.8 8.8 0 0 1-4-.9 8.8 8.8 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.7 8.7 0 0 1-4 1 9 9 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-4 .8 8.7 8.7 0 0 1-4 1v2.4"/><path fill="none" stroke="#000" stroke-width=".4" d="M316.4 348.5a8.6 8.6 0 0 0 4-1 9 9 0 0 1 4-.7 9 9 0 0 1 4 .8c1 .5 2.5.9 4 .9 1.6 0 3-.4 4-1a9 9 0 0 1 4-.7c1.5 0 2.8.3 3.9.8 1 .5 2.5.9 4 .9V346a8.8 8.8 0 0 1-4-.9 8.8 8.8 0 0 0-4-.8 9 9 0 0 0-3.9.8 8.7 8.7 0 0 1-4 1 9 9 0 0 1-4-1 9 9 0 0 0-4-.8 9 9 0 0 0-4 .8 8.7 8.7 0 0 1-4 1v2.4"/><path fill="#005bbf" d="M316.4 351c1.6 0 3-.4 4-1a8.8 8.8 0 0 1 4-.8 9 9 0 0 1 4 .9c1 .5 2.5.8 4 .8 1.6 0 3-.3 4-.9a9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v-2.5a8.8 8.8 0 0 1-4-1 8.8 8.8 0 0 0-4-.7c-1.5 0-2.8.3-3.9.8a8.8 8.8 0 0 1-4 .9 8.9 8.9 0 0 1-4-.9 9 9 0 0 0-4-.8 8.9 8.9 0 0 0-4 .8 8.7 8.7 0 0 1-4 .9v2.5"/><path fill="none" stroke="#000" stroke-width=".4" d="M316.4 351c1.6 0 3-.4 4-1a8.8 8.8 0 0 1 4-.8 9 9 0 0 1 4 .9c1 .5 2.5.8 4 .8 1.6 0 3-.3 4-.9a9 9 0 0 1 4-.8c1.5 0 2.8.3 3.9.8 1 .6 2.5 1 4 1v-2.5a8.8 8.8 0 0 1-4-1 8.8 8.8 0 0 0-4-.7c-1.5 0-2.8.3-3.9.8a8.8 8.8 0 0 1-4 .9 8.9 8.9 0 0 1-4-.9 9 9 0 0 0-4-.8 8.9 8.9 0 0 0-4 .8 8.7 8.7 0 0 1-4 .9v2.5z"/><path fill="#c8b100" d="M341.4 328.5l-.2.6c0 1.5 1.3 2.7 3 2.7h-23.6c1.6 0 2.9-1.2 2.9-2.7a2.8 2.8 0 0 0 0-.6h17.9"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M341.4 328.5l-.2.6c0 1.5 1.3 2.7 3 2.7h-23.6c1.6 0 2.9-1.2 2.9-2.7a2.8 2.8 0 0 0 0-.6h17.9z"/><path fill="#c8b100" d="M323.9 327h17c.6 0 1.1.3 1.1.7 0 .5-.5.8-1 .8h-17.1c-.6 0-1-.3-1-.8 0-.4.4-.8 1-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M323.9 327h17c.6 0 1.1.3 1.1.7 0 .5-.5.8-1 .8h-17.1c-.6 0-1-.3-1-.8 0-.4.4-.8 1-.8z"/><path fill="#c8b100" d="M320.7 337.8H344v-6h-23.4v6z"/><path fill="none" stroke="#000" stroke-width=".4" d="M320.7 337.8H344v-6h-23.4v6z"/><path fill="#ad1519" d="M346 305.8c2.2 1.3 3.8 2.7 3.6 3.4-.2.6-1 1-2 1.8-1.6 1.1-2.6 3.2-1.8 4.1a5.9 5.9 0 0 1 .1-9.3"/><path fill="none" stroke="#000" stroke-width=".4" d="M346 305.8c2.2 1.3 3.8 2.7 3.6 3.4-.2.6-1 1-2 1.8-1.6 1.1-2.6 3.2-1.8 4.1a5.9 5.9 0 0 1 .1-9.3z"/><path fill="#ccc" d="M324 326h16.7v-81.6h-16.6V326z"/><path fill="none" stroke="#000" stroke-width=".4" d="M336.2 244.4v81.4m1.8-81.4v81.4m-14 .2h16.7v-81.6h-16.6V326z"/><path fill="#ad1519" d="M307 275a53 53 0 0 1 25-2.2c9.9 1.7 17.5 5.6 16.9 8.9v.2s3.7-8.4 3.7-8.7c.7-3.6-7.7-8-18.8-9.8a57 57 0 0 0-9.8-.8c-7 0-13.2.9-16.9 2.3v10"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M307 275a53 53 0 0 1 25-2.2c9.9 1.7 17.5 5.6 16.9 8.9v.2s3.7-8.4 3.7-8.7c.7-3.6-7.7-8-18.8-9.8a57 57 0 0 0-9.8-.8c-7 0-13.2.9-16.9 2.3v10"/><path fill="#ad1519" d="M340.8 285.1c4.6-.3 7.7-1.5 8-3.5.4-1.5-1.2-3.2-4-4.7-1.2.1-2.6.3-4 .3v8"/><path fill="none" stroke="#000" stroke-width=".4" d="M340.8 285.1c4.6-.3 7.7-1.5 8-3.5.4-1.5-1.2-3.2-4-4.7-1.2.1-2.6.3-4 .3v8"/><path fill="#ad1519" d="M324 279c-2.8.4-5 1-6 2l-.2.1c-.5 1 2 3.3 6.3 5.8v-8"/><path fill="none" stroke="#000" stroke-width=".4" d="M324 279c-2.8.4-5 1-6 2l-.2.1c-.5 1 2 3.3 6.3 5.8v-8"/><path fill="#ad1519" d="M351.1 300.9c.4-1.3-4-4-10.4-6.3-3-1-5.3-2.1-8.3-3.4-8.8-4-15.4-8.4-14.6-10l.1-.2c-.4.4-1.2 8.4-1.2 8.4-.8 1.5 5.2 6 13.3 9.8 2.6 1.3 8.1 3.3 10.7 4.2 4.7 1.6 9.3 4.7 8.9 5.8l1.5-8.3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M351.1 300.9c.4-1.3-4-4-10.4-6.3-3-1-5.3-2.1-8.3-3.4-8.8-4-15.4-8.4-14.6-10l.1-.2c-.4.4-1.2 8.4-1.2 8.4-.8 1.5 5.2 6 13.3 9.8 2.6 1.3 8.1 3.3 10.7 4.2 4.7 1.6 9.3 4.7 8.9 5.8l1.5-8.3z"/><path fill="#c8b100" d="M317.5 271.3c.6-2.4 1.4-4.7 2.2-7a5.7 5.7 0 0 1-.5.1 5.4 5.4 0 0 1-.6 0c-.4 1.8-.9 3.4-1.5 5.1l-2.9-4.4-1 .2-1 .1a140 140 0 0 1 4.2 6h1.1m6.3-7H322l-.2 6.5h4.6v-.8a32 32 0 0 1-2.7.1v-5.9m7.3 1.1l2.1.3v-.4l.1-.4-6.2-.5v.8h2.2l-.6 6h1l.8.1.6-5.9m2.5 6.5c.3 0 .6 0 1 .2l.8.2.7-3h.1l.5 1.2 1 2.3c.3 0 .7 0 1 .2l1.1.2-.3-.6-1.5-3.1c1.2 0 2-.4 2.3-1.3.1-.7-.1-1.2-.7-1.6a6 6 0 0 0-1.9-.6l-2.5-.5-1.6 6.4m3.2-5.6c.8.2 1.7.3 1.7 1.1a2 2 0 0 1 0 .5c-.3 1-1 1.3-2.3 1l.6-2.6m8.7 7.6l-.3 2.1.9.5.9.5.6-7.4a3.6 3.6 0 0 1-.8-.4l-6.6 4.1.6.3.4.3 1.8-1.4 2.5 1.4zm-1.9-1.7l2.2-1.4-.3 2.4-1.9-1"/><path fill="none" stroke="#000" stroke-width=".1" d="M230.3 205.3c0-1.2 1-2.1 2.2-2.1 1.3 0 2.3.9 2.3 2 0 1.2-1 2.2-2.3 2.2a2.2 2.2 0 0 1-2.2-2.1z"/><path fill="#ad1519" stroke="#000" stroke-width=".3" d="M255.3 187.1c6.8 0 13 1 16.8 2.6a32 32 0 0 0 8.6 2.2c2.6.3 5 .4 7 .2 2.9 0 6.9.8 11 2.6a29.2 29.2 0 0 1 8 5l-1.7 1.5-.4 4-4.4 5-2.2 2-5.3 4-2.6.3-.8 2.3-33.7-4-33.8 4-.9-2.3-2.6-.2-5.2-4.2-2.2-1.9-4.4-5-.5-4-1.6-1.5a29.5 29.5 0 0 1 8-5c4-1.8 8-2.6 10.9-2.6 2 .2 4.4.1 7-.2a32 32 0 0 0 8.6-2.2c4-1.6 9.6-2.6 16.4-2.6z"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M255.9 231.6c-12.6 0-23.8-1.5-31.9-4-.6 0-.9-.6-.8-1.2a1.2 1.2 0 0 1 .8-1.2 120 120 0 0 1 31.9-4c12.5.1 23.8 1.6 31.8 4 .6.2.9.7.9 1.2 0 .6-.3 1.1-1 1.3a119 119 0 0 1-31.7 4"/><path fill="#ad1519" d="M255.8 230a121 121 0 0 1-29.3-3.4c7.8-2 18-3.2 29.3-3.2a123 123 0 0 1 29.5 3.2c-7.8 2-18.1 3.4-29.5 3.4"/><path fill="none" stroke="#000" stroke-width=".1" d="M256.7 230v-6.7m-1.9 6.7v-6.7"/><path fill="none" stroke="#000" stroke-width=".2" d="M253.1 230v-6.7m-1.7 6.7v-6.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M249.9 230v-6.7m-2.9 6.4v-6.2m1.4 6.2v-6.4"/><path fill="none" stroke="#000" stroke-width=".4" d="M244.3 229.4v-5.7m1.4 5.9v-6m-5 5.4v-4.9m1.2 5V224m1.2 5.4V224"/><path fill="none" stroke="#000" stroke-width=".5" d="M239.4 229v-4.8m-1.1 4.6v-4.5"/><path fill="none" stroke="#000" stroke-width=".6" d="M237 228.7v-4.2m-2.6 3.8V225m1.4 3.5v-3.7"/><path fill="none" stroke="#000" stroke-width=".7" d="M233.1 228v-2.9m-1.2 2.7v-2.4"/><path fill="none" stroke="#000" stroke-width=".8" d="M230.6 227.5v-2m-1.4 1.8v-1.4"/><path fill="none" stroke="#000" stroke-width=".9" d="M227.8 227v-.7"/><path fill="none" stroke="#000" stroke-width=".1" d="M264 229.7v-6.2m-3.2 6.4v-6.6m-2.2 6.6v-6.6"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M255.8 221.3a115 115 0 0 0-32.2 4c.7-.3.6-1-.2-3.2-1-2.6-2.6-2.5-2.6-2.5a130 130 0 0 1 35-4.3c13.8 0 26.2 1.7 35.1 4.3 0 0-1.5-.1-2.5 2.5-.9 2.1-1 3-.3 3.3-8-2.5-19.6-4.1-32.3-4.1"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M255.8 215.3a131 131 0 0 0-35 4.3c-.5.2-1.2 0-1.4-.6a1.1 1.1 0 0 1 .8-1.4c8.9-2.7 21.6-4.4 35.6-4.4 14.1 0 26.9 1.7 35.8 4.4.6.2.9.9.7 1.4-.2.6-.8.8-1.4.6-8.9-2.6-21.3-4.2-35-4.3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".4" d="M255.8 230a121 121 0 0 1-29.3-3.4c7.8-2 18-3.2 29.3-3.2a123 123 0 0 1 29.5 3.2c-7.8 2-18.1 3.4-29.5 3.4z"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M246 218.5c0-.6.5-1.1 1.1-1.1.7 0 1.2.5 1.2 1 0 .6-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M255.9 219.3h-3.4c-.6 0-1.1-.5-1.1-1 0-.6.5-1.1 1-1.1h6.9a1 1 0 0 1 1.1 1c0 .6-.5 1.1-1.1 1.1h-3.4"/><path fill="#058e6e" stroke="#000" stroke-width=".4" d="M239 220.2l-2.5.3c-.6 0-1.2-.3-1.2-1a1 1 0 0 1 1-1.1l2.4-.3 2.5-.3a1.1 1.1 0 0 1 1.2 1c0 .5-.4 1-1 1.1l-2.5.3"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M229.1 220.4c0-.5.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M221.6 222.4l1.3-1.7 3.4.5-2.7 2-2-.8"/><path fill="#058e6e" stroke="#000" stroke-width=".4" d="M272.8 220.2l2.4.3c.6 0 1.2-.3 1.3-1a1 1 0 0 0-1-1.1l-2.5-.3-2.4-.3c-.7 0-1.2.4-1.3 1 0 .5.4 1 1 1.1l2.5.3"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M263.4 218.5c0-.6.6-1.1 1.2-1.1s1.1.5 1.1 1c0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.2-1m17 2c0-.6.5-1.1 1-1.1a1 1 0 0 1 1.2 1c0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M290 222.4l-1.2-1.7-3.4.5 2.8 2 1.9-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M225.1 227c8-2.3 18.7-3.6 30.7-3.7 12 0 22.9 1.4 30.8 3.7"/><path fill="#c8b100" d="M230.4 196l1.5 1.1 2.1-3.4a7.9 7.9 0 0 1-3.8-7.6c.2-4.5 5.6-8.1 12.5-8.1 3.5 0 6.7 1 9 2.5l.2-1.9a18.6 18.6 0 0 0-9.2-2.3c-8 0-14.1 4.4-14.4 9.8a9.5 9.5 0 0 0 3.3 8l-1.2 2"/><path fill="none" stroke="#000" stroke-width=".4" d="M230.4 196l1.5 1.1 2.1-3.4a7.9 7.9 0 0 1-3.8-7.6c.2-4.5 5.6-8.1 12.5-8.1 3.5 0 6.7 1 9 2.5l.2-1.9a18.6 18.6 0 0 0-9.2-2.3c-8 0-14.1 4.4-14.4 9.8a9.5 9.5 0 0 0 3.3 8l-1.2 2"/><path fill="#c8b100" d="M230.5 196a9.8 9.8 0 0 1-4.3-7.7c0-3.5 2.2-6.6 5.7-8.6a9.1 9.1 0 0 0-3.6 6.4 9.5 9.5 0 0 0 3.3 8l-1 2"/><path fill="none" stroke="#000" stroke-width=".4" d="M230.5 196a9.8 9.8 0 0 1-4.3-7.7c0-3.5 2.2-6.6 5.7-8.6a9.1 9.1 0 0 0-3.6 6.4 9.5 9.5 0 0 0 3.3 8l-1 2"/><path fill="#c8b100" d="M206.8 199.6a9.4 9.4 0 0 1-2.5-6.3c0-1.4.4-2.8 1-4 2.1-4.5 9-7.8 17.1-7.8 2.2 0 4.4.2 6.3.7-.4.5-.8 1-1 1.5a27.2 27.2 0 0 0-5.3-.5c-7.4 0-13.6 3-15.4 6.8a7.5 7.5 0 0 0-.8 3.3 7.8 7.8 0 0 0 2.9 6l-2.7 4.4-1.5-1.2 1.9-3"/><path fill="none" stroke="#000" stroke-width=".4" d="M206.8 199.6a9.4 9.4 0 0 1-2.5-6.3c0-1.4.4-2.8 1-4 2.1-4.5 9-7.8 17.1-7.8 2.2 0 4.4.2 6.3.7-.4.5-.8 1-1 1.5a27.2 27.2 0 0 0-5.3-.5c-7.4 0-13.6 3-15.4 6.8a7.5 7.5 0 0 0-.8 3.3 7.8 7.8 0 0 0 2.9 6l-2.7 4.4-1.5-1.2 1.9-3z"/><path fill="#c8b100" d="M209.5 184.8a11.3 11.3 0 0 0-4.2 4.4 9.2 9.2 0 0 0-1 4.1c0 2.4 1 4.6 2.5 6.3l-1.7 2.6a11.1 11.1 0 0 1-2.4-6.8c0-4.3 2.7-8.1 6.8-10.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M209.5 184.8a11.3 11.3 0 0 0-4.2 4.4 9.2 9.2 0 0 0-1 4.1c0 2.4 1 4.6 2.5 6.3l-1.7 2.6a11.1 11.1 0 0 1-2.4-6.8c0-4.3 2.7-8.1 6.8-10.6z"/><path fill="#c8b100" d="M255.8 175.4c1.7 0 3.3 1.2 3.7 2.8.2 1.4.4 3 .4 4.7v1.2c0 3.6.6 6.7 1.3 8.7l-5.5 5.2-5.5-5.2c.7-2 1.2-5.1 1.3-8.7v-1.2c0-1.7.2-3.3.5-4.7.3-1.6 2-2.8 3.7-2.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M255.8 175.4c1.7 0 3.3 1.2 3.7 2.8.2 1.4.4 3 .4 4.7v1.2c0 3.6.6 6.7 1.3 8.7l-5.5 5.2-5.5-5.2c.7-2 1.2-5.1 1.3-8.7v-1.2c0-1.7.2-3.3.5-4.7.3-1.6 2-2.8 3.7-2.8z"/><path fill="#c8b100" d="M255.8 177a2 2 0 0 1 1.9 1.5 30.6 30.6 0 0 1 .4 4.5v1.1c0 3.4.5 6.4 1.2 8.2l-3.6 3.5-3.6-3.5c.7-1.8 1.2-4.8 1.2-8.2V183c0-1.6.2-3.1.5-4.5.2-.8 1-1.4 2-1.4"/><path fill="none" stroke="#000" stroke-width=".4" d="M255.8 177a2 2 0 0 1 1.9 1.5 30.6 30.6 0 0 1 .4 4.5v1.1c0 3.4.5 6.4 1.2 8.2l-3.6 3.5-3.6-3.5c.7-1.8 1.2-4.8 1.2-8.2V183c0-1.6.2-3.1.5-4.5.2-.8 1-1.4 2-1.4z"/><path fill="#c8b100" d="M281 196l-1.4 1.1-2.2-3.4a7.9 7.9 0 0 0 3.9-7.6c-.2-4.5-5.7-8.1-12.5-8.1a16 16 0 0 0-9 2.5 24.5 24.5 0 0 0-.3-1.9 18.6 18.6 0 0 1 9.3-2.3c7.9 0 14 4.4 14.4 9.8a9.5 9.5 0 0 1-3.3 8l1.1 1.9"/><path fill="none" stroke="#000" stroke-width=".4" d="M281 196l-1.4 1.1-2.2-3.4a7.9 7.9 0 0 0 3.9-7.6c-.2-4.5-5.7-8.1-12.5-8.1a16 16 0 0 0-9 2.5 24.5 24.5 0 0 0-.3-1.9 18.6 18.6 0 0 1 9.3-2.3c7.9 0 14 4.4 14.4 9.8a9.5 9.5 0 0 1-3.3 8l1.1 1.9"/><path fill="#c8b100" d="M280.9 196c2.7-2 4.4-4.7 4.4-7.7 0-3.5-2.3-6.6-5.7-8.6a9 9 0 0 1 3.6 7.3c0 2.8-1.3 5.4-3.3 7.2l1 1.9"/><path fill="none" stroke="#000" stroke-width=".4" d="M280.9 196c2.7-2 4.4-4.7 4.4-7.7 0-3.5-2.3-6.6-5.7-8.6a9 9 0 0 1 3.6 7.3c0 2.8-1.3 5.4-3.3 7.2l1 1.9"/><path fill="#c8b100" d="M304.7 199.6a9.3 9.3 0 0 0 1.5-10.3c-2.2-4.5-9-7.8-17.2-7.8a28.4 28.4 0 0 0-6.3.7c.5.5.8 1 1.1 1.5a27.1 27.1 0 0 1 5.2-.5c7.5 0 13.7 3 15.5 6.8.5 1 .8 2.1.8 3.3a7.8 7.8 0 0 1-3 6l2.8 4.4 1.4-1.2-1.8-3"/><path fill="none" stroke="#000" stroke-width=".4" d="M304.7 199.6a9.3 9.3 0 0 0 1.5-10.3c-2.2-4.5-9-7.8-17.2-7.8a28.4 28.4 0 0 0-6.3.7c.5.5.8 1 1.1 1.5a27.1 27.1 0 0 1 5.2-.5c7.5 0 13.7 3 15.5 6.8.5 1 .8 2.1.8 3.3a7.8 7.8 0 0 1-3 6l2.8 4.4 1.4-1.2-1.8-3z"/><path fill="#c8b100" d="M302 184.8a11.3 11.3 0 0 1 4.2 4.4 9.3 9.3 0 0 1 1 4.1c0 2.4-1 4.6-2.5 6.3l1.6 2.6a11.1 11.1 0 0 0 2.5-6.8c0-4.3-2.7-8.1-6.9-10.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M302 184.8a11.3 11.3 0 0 1 4.2 4.4 9.3 9.3 0 0 1 1 4.1c0 2.4-1 4.6-2.5 6.3l1.6 2.6a11.1 11.1 0 0 0 2.5-6.8c0-4.3-2.7-8.1-6.9-10.6z"/><path fill="#fff" d="M253.8 193.5c0-1 .9-1.9 2-1.9 1 0 1.9.9 1.9 1.9a1.9 1.9 0 0 1-2 1.8 1.9 1.9 0 0 1-2-1.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M253.8 193.5c0-1 .9-1.9 2-1.9 1 0 1.9.9 1.9 1.9a1.9 1.9 0 0 1-2 1.8 1.9 1.9 0 0 1-2-1.8z"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M253.8 189.8a1.9 1.9 0 0 1 2-1.8 1.9 1.9 0 0 1 1.9 1.9 1.9 1.9 0 0 1-2 1.8 1.9 1.9 0 0 1-2-1.8m.5-4c0-.8.7-1.4 1.5-1.4.9 0 1.6.6 1.6 1.5 0 .8-.7 1.4-1.6 1.4-.8 0-1.5-.6-1.5-1.4m.4-3.6c0-.5.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1m.1-3.1c0-.5.4-.9 1-.9s.8.4.8.9-.4.8-.9.8-.9-.3-.9-.8"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M255.9 204.6l1.3.2a5 5 0 0 0 4.8 6.4 5 5 0 0 0 4.8-3.3s.4-1.7.6-1.7c.2 0 .2 1.9.3 1.9.3 2.4 2.5 4 5 4a4.9 4.9 0 0 0 5-5.4l1.5-1.5.9 2a4.3 4.3 0 0 0-.5 2 4.7 4.7 0 0 0 4.8 4.6 5 5 0 0 0 4-2l1-1.3v1.6c0 1.5.7 3 2.2 3.2 0 0 1.8.1 4.1-1.7a28 28 0 0 0 3.7-3.4l.2 1.9s-2 3-4 4.2c-1.2.7-3 1.4-4.4 1.1-1.5-.2-2.6-1.4-3.1-2.7a7.2 7.2 0 0 1-3.6 1 7 7 0 0 1-6.5-4 7.5 7.5 0 0 1-11-.3 7.4 7.4 0 0 1-5 1.9 7.4 7.4 0 0 1-6.1-3.1 7.3 7.3 0 0 1-6.1 3 7.4 7.4 0 0 1-5-1.8 7.5 7.5 0 0 1-11 .3 7 7 0 0 1-6.5 4 7.1 7.1 0 0 1-3.6-1c-.6 1.3-1.6 2.5-3.1 2.8-1.4.2-3.2-.5-4.3-1.2-2.2-1.2-4.1-4.3-4.1-4.3l.2-1.8s1.3 1.5 3.6 3.4c2.4 1.8 4.2 1.7 4.2 1.7 1.5-.2 2.2-1.7 2.2-3.2v-1.6l1 1.3a4.9 4.9 0 0 0 4 2c2.6 0 4.8-2 4.8-4.6 0-.7-.2-1.4-.5-2l.8-2 1.6 1.5v.6a4.9 4.9 0 0 0 5 4.8c2.5 0 4.7-1.7 5-4 0 0 0-1.9.2-1.9s.7 1.8.7 1.7a5 5 0 0 0 4.8 3.3 4.9 4.9 0 0 0 4.8-6.4l1.3-.2"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M290.5 210.8c.3-.8 0-1.7-.6-1.8-.6-.2-1.4.3-1.6 1.2-.3.8 0 1.7.5 1.8.6.2 1.4-.3 1.7-1.2m-22-4.2c.2-.9-.2-1.6-.9-1.7-.6-.1-1.2.5-1.3 1.4-.1 1 .3 1.7 1 1.8.6 0 1.2-.6 1.3-1.5m-25.4 0c-.1-.9.3-1.6 1-1.7.6-.1 1.2.5 1.3 1.4.1 1-.3 1.7-1 1.8-.6 0-1.2-.6-1.3-1.5m-22 4.3c-.2-.9 0-1.7.7-2 .6-.1 1.3.4 1.6 1.3.3.8 0 1.7-.6 1.9-.6.1-1.3-.4-1.6-1.2"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M230.8 196.3a5.5 5.5 0 0 1 2.4 3s0-.2.7-.6c.6-.3 1.1-.3 1.1-.3l-.2 1.4c-.1.3-.1 1.4-.4 2.3a7.8 7.8 0 0 1-.6 1.8 2 2 0 0 0-1.6-.5 2 2 0 0 0-1.4 1s-.7-.6-1.2-1.4l-1.2-2.2-.7-1.2h1.1c.7.1 1 .3 1 .3a5.2 5.2 0 0 1 1-3.7"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M231.3 206.7a1.9 1.9 0 0 1-.7-1.1 1.7 1.7 0 0 1 .2-1.3l-1.9-.7c-.7-.2-2-.2-2.4-.2h-1.2l.3.6.5.7a5.4 5.4 0 0 0-3 2.2 5.6 5.6 0 0 0 3.6 1l-.2.8v.7l1-.4c.4-.2 1.6-.6 2.2-1 .9-.6 1.6-1.3 1.6-1.3m2.9-.5a1.8 1.8 0 0 0 .2-1.2 1.8 1.8 0 0 0-.7-1.1s.7-.8 1.5-1.3l2.3-1 1-.4v.6l-.2.9a5.6 5.6 0 0 1 3.7 1 5.4 5.4 0 0 1-3.1 2.1 7.1 7.1 0 0 0 .8 1.4h-1.2c-.4 0-1.7 0-2.4-.3-1-.2-2-.7-2-.7"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M230.3 205.3c0-1.2 1-2.1 2.2-2.1 1.3 0 2.3.9 2.3 2 0 1.2-1 2.2-2.3 2.2a2.2 2.2 0 0 1-2.2-2.1"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M255.8 192.9a6 6 0 0 1 2 3.9s.2-.3 1-.6 1.2-.1 1.2-.1l-.5 1.4c-.2.4-.4 1.6-.9 2.6a8.8 8.8 0 0 1-1 1.8 2.3 2.3 0 0 0-1.8-.7c-.6 0-1.3.3-1.7.7 0 0-.6-.7-1-1.8-.5-1-.7-2.2-.9-2.6l-.6-1.4s.6-.1 1.3.2c.8.2 1 .5 1 .5a6 6 0 0 1 2-4"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M254.2 204.6a2 2 0 0 1-.6-1.3c0-.6.2-1 .6-1.4 0 0-1-.7-2-1.1-.8-.4-2.2-.6-2.6-.7l-1.3-.3.1.7.4 1c-1.5 0-2.9.8-3.9 1.8a6.3 6.3 0 0 0 4 1.8l-.5 1-.2.6 1.4-.2 2.6-.7 2-1.2m3.3 0c.3-.3.5-.8.5-1.3a2 2 0 0 0-.5-1.4s1-.7 2-1.1c.8-.4 2.2-.6 2.6-.7l1.3-.3-.2.7a7.6 7.6 0 0 1-.4 1 6 6 0 0 1 4 1.8 6.3 6.3 0 0 1-4 1.8l.4 1 .2.6-1.3-.2-2.6-.7a13 13 0 0 1-2-1.2m23.5-8.4a5.5 5.5 0 0 0-2.4 3.1l-.7-.6c-.6-.3-1.1-.3-1.1-.3l.2 1.4.3 2.3.7 1.8a2 2 0 0 1 1.6-.5 2 2 0 0 1 1.4 1l1.2-1.4 1.2-2.2.7-1.2h-1.2c-.7.1-.9.3-.9.3a5.2 5.2 0 0 0-1-3.7"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M280.5 206.7c.3-.3.6-.7.7-1.1a1.8 1.8 0 0 0-.2-1.3l1.8-.7c.8-.2 2-.2 2.5-.2h1.1l-.2.6-.6.7a5.4 5.4 0 0 1 3.1 2.2 5.6 5.6 0 0 1-3.6 1l.2.8v.7l-1-.4-2.3-1a11.5 11.5 0 0 1-1.5-1.3m-2.9-.5a1.8 1.8 0 0 1-.3-1.2c.1-.5.4-.9.7-1.1 0 0-.7-.8-1.5-1.3-.6-.4-1.8-.9-2.2-1l-1-.4v.6c0 .5.2.9.2.9a5.6 5.6 0 0 0-3.7 1c.7 1 1.8 1.8 3 2.1l-.4.8a4 4 0 0 0-.3.6h1.2c.4 0 1.7 0 2.4-.3 1-.2 1.9-.7 1.9-.7"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M277 205.3c0-1.2 1-2.1 2.2-2.1 1.3 0 2.3.9 2.3 2 0 1.2-1 2.2-2.3 2.2a2.2 2.2 0 0 1-2.2-2.1m24.8 4.6c-.5-.5-1.6-.4-2.4.3-.8.7-1 1.7-.5 2.2s1.6.5 2.4-.2c.8-.7 1-1.7.5-2.3"/><path fill="#c8b100" stroke="#000" stroke-width=".4" d="M298.7 211.3c0-.4.4-.8.7-1.1.8-.7 2-.8 2.4-.3l.2.3s1.2-2.1 2.5-2.9 3.6-.5 3.6-.5a3 3 0 0 0-3.1-3c-1 0-2 .5-2.5 1.2l-.3-1.1s-1.4.3-2 1.8c-.6 1.7 0 4 0 4s-.3-1-.8-1.7a8.5 8.5 0 0 0-2.6-1.7l-1.4-.8v1.5a8.4 8.4 0 0 0-4 .5 5 5 0 0 0 2.7 2.3l-.8.8-.5.5 1.4.2c.4 0 1.8.3 2.7.2a15.7 15.7 0 0 0 1.8-.2m-85.6 0a2.3 2.3 0 0 0-.8-1.1c-.8-.7-1.9-.8-2.4-.3a1.1 1.1 0 0 0-.2.3s-1-2.1-2.4-2.9-3.6-.5-3.6-.5a3 3 0 0 1 3-3c1 0 2 .5 2.6 1.2l.2-1.1s1.4.3 2 1.9c.7 1.6 0 3.9 0 3.9s.4-1 .9-1.7 1.8-1.4 2.5-1.7l1.4-.8a7.4 7.4 0 0 0 0 1.5 8.4 8.4 0 0 1 4 .5 5 5 0 0 1-2.7 2.3l.9.8.4.5-1.3.2c-.4 0-1.9.3-2.7.2a15.7 15.7 0 0 1-1.8-.2"/><path fill="#ad1519" stroke="#000" stroke-width=".4" d="M210 210c.5-.6 1.5-.5 2.3.2.9.7 1 1.7.6 2.2-.6.6-1.6.5-2.4-.2-.9-.7-1.1-1.7-.6-2.3m43.7-6.6c0-1.2 1-2.1 2.3-2.1s2.2.9 2.2 2-1 2.2-2.3 2.2a2.2 2.2 0 0 1-2.2-2.1"/><path fill="#005bbf" stroke="#000" stroke-width=".3" d="M251.2 171.3c0-2.4 2-4.3 4.6-4.3 2.5 0 4.5 2 4.5 4.3a4.4 4.4 0 0 1-4.5 4.3 4.4 4.4 0 0 1-4.6-4.3"/><path fill="#c8b100" stroke="#000" stroke-width=".3" d="M254.6 159.3v2.3H252v2.3h2.5v6.8h-3.2l-.2.6c0 .6.2 1.2.4 1.7h8.3a4.1 4.1 0 0 0 .4-1.7l-.2-.6h-3V164h2.4v-2.3H257v-2.3h-2.5z"/><path fill="#ccc" d="M256.2 352.6a87.4 87.4 0 0 1-37.8-8.8 24.2 24.2 0 0 1-13.7-21.6V288h102.8v34c0 9.5-5.4 17.7-13.7 21.8a86.4 86.4 0 0 1-37.6 8.7"/><path fill="none" stroke="#000" stroke-width=".5" d="M256.2 352.6a87.4 87.4 0 0 1-37.8-8.8 24.2 24.2 0 0 1-13.7-21.6V288h102.8v34c0 9.5-5.4 17.7-13.7 21.8a86.4 86.4 0 0 1-37.6 8.7z"/><path fill="#ccc" d="M256 288h51.5v-57H256v57z"/><path fill="none" stroke="#000" stroke-width=".5" d="M256 288h51.5v-57H256v57z"/><path fill="#ad1519" d="M256 322.1a25 25 0 0 1-25.6 24.4c-14.2 0-25.8-11-25.8-24.4V288H256v34"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M215.8 342.3c1.7.8 3.9 2.2 6.2 2.8l-.1-58.3h-6v55.4z"/><path fill="#c8b100" stroke="#000" stroke-linejoin="round" stroke-width=".5" d="M204.5 321.7a26 26 0 0 0 6 16v-50.6h-5.9v34.6z"/><path fill="#c7b500" stroke="#000" stroke-width=".5" d="M227.3 346.4c2.4.2 4.1.2 6 0v-59.6h-6v59.6z"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M238.6 345a20.3 20.3 0 0 0 6.2-2.6v-55.6h-6l-.2 58.3z"/><path fill="#ad1519" d="M204.6 288H256v-57h-51.4v57z"/><path fill="none" stroke="#000" stroke-width=".5" d="M204.6 288H256v-57h-51.4v57z"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M250.4 337.1c2.5-2.2 4.9-7.3 5.7-13l.2-37.3h-6V337z"/><path fill="none" stroke="#000" stroke-width=".5" d="M256 322.1a25 25 0 0 1-25.6 24.4c-14.2 0-25.8-11-25.8-24.4V288H256v34"/><path fill="#ad1519" d="M307.6 288v34a25.1 25.1 0 0 1-25.8 24.4c-14.2 0-25.8-11-25.8-24.4v-34h51.6"/><path fill="none" stroke="#000" stroke-width=".5" d="M307.6 288v34a25.1 25.1 0 0 1-25.8 24.4c-14.2 0-25.8-11-25.8-24.4v-34h51.6"/><path fill="#c8b100" d="M265.4 313.7l.1.6c0 .6-.5 1.1-1.2 1.1-.6 0-1.2-.5-1.2-1.1 0-.2 0-.4.2-.5h-1.7a2.7 2.7 0 0 0 1.9 3v4.1h1.7v-4.1a2.7 2.7 0 0 0 1.8-1.7h4.7v-1.4h-6.3m23.1 0v1.4h-4.2a2.7 2.7 0 0 1-.3.6l5 5.6-1.4 1-4.9-5.6-.2.1v9.3h-1.8v-9.3l-.2-.1-5 5.6-1.4-1 5.1-5.7a2.3 2.3 0 0 1-.2-.5h-4.4v-1.4h14zm2.8 0v1.4h4.8c.2.8.9 1.4 1.7 1.7v4.1h1.8v-4.1a2.7 2.7 0 0 0 2-2.5l-.2-.6h-1.6a1.2 1.2 0 0 1-1 1.7c-.8 0-1.3-.5-1.3-1.1l.1-.5h-6.3m-7 23.5a16.6 16.6 0 0 0 3.8-1l.9 1.4a18.8 18.8 0 0 1-4.6 1.3 2.8 2.8 0 0 1-2.8 2 2.8 2.8 0 0 1-2.7-2 18.7 18.7 0 0 1-4.8-1.3l.8-1.5c1.3.6 2.7 1 4.2 1.2a2.7 2.7 0 0 1 1.6-1.5v-7.1h1.8v7.1a3 3 0 0 1 1.7 1.4zm-11.8-2.4l-.9 1.5a17.8 17.8 0 0 1-3.9-3.3 3 3 0 0 1-2.6-.5 2.5 2.5 0 0 1-.4-3.7l.2-.2a16.3 16.3 0 0 1-1.4-5.1h1.8a14 14 0 0 0 1.1 4.4 3.1 3.1 0 0 1 1.5.1l4.4-4.8 1.3 1-4.4 4.9a2.5 2.5 0 0 1 0 3 16.2 16.2 0 0 0 3.2 2.7zm-6.5-5a1.2 1.2 0 0 1 1.7-.2 1 1 0 0 1 0 1.6 1.3 1.3 0 0 1-1.6.2 1.1 1.1 0 0 1-.1-1.6zm-2.2-4.8l-1.8-.4-.3-4.6 1.8-.6v2.6c0 1 0 2 .2 3zm1.4-5.7l1.8.4v2.3c0-.8.3 2.3.3 2.3l-1.8.6-.3-2.9v-2.7zm6 14.6a16.7 16.7 0 0 0 5.1 2.7l.4-1.7a14.6 14.6 0 0 1-4.3-2.1l-1.2 1m-1 1.6a18.6 18.6 0 0 0 5.2 2.7l-1.3 1.3a20 20 0 0 1-4.2-2.2l.4-1.8m2.3-10l1.7.7 3.2-3.5-1-1.5-3.9 4.2m-1.3-1l-1-1.5 3.1-3.5 1.7.7-3.8 4.3m19.3 10.5l.9 1.5a17.8 17.8 0 0 0 3.8-3.3c1 .3 2 .1 2.7-.5a2.5 2.5 0 0 0 .3-3.7l-.1-.2c.7-1.6 1.2-3.3 1.3-5.1h-1.7a14.2 14.2 0 0 1-1.2 4.4 3.1 3.1 0 0 0-1.5.1l-4.3-4.8-1.3 1 4.3 4.9a2.5 2.5 0 0 0 .1 3 16 16 0 0 1-3.3 2.7zm6.5-5a1.2 1.2 0 0 0-1.7-.2 1.1 1.1 0 0 0-.1 1.6c.4.5 1.2.6 1.7.1a1 1 0 0 0 0-1.6zm2.2-4.8l1.8-.5.2-4.5-1.7-.6v2.6l-.3 3zm-1.5-5.7l-1.8.4v2.3c0-.8-.3 2.3-.3 2.3l1.9.6.2-2.9v-2.7m-6 14.6a16.8 16.8 0 0 1-5 2.7l-.5-1.7a14.6 14.6 0 0 0 4.3-2.1l1.3 1m.9 1.6a18.6 18.6 0 0 1-5.2 2.7l1.3 1.3a20 20 0 0 0 4.3-2.2l-.4-1.8m-2.4-10l-1.7.7-3.1-3.5 1-1.5 3.8 4.2m1.4-1l1-1.5-3.2-3.5-1.7.7 3.8 4.3m-21.4-9.3l.5 1.7h4.8l.6-1.7h-5.9m22.5 0l-.5 1.7h-4.8l-.5-1.7h5.9m-12.4 23.3c0-.6.5-1.1 1.2-1.1.6 0 1.1.5 1.1 1.1 0 .7-.5 1.2-1.2 1.2s-1.2-.6-1.2-1.2zm2-8.2l1.8-.5V325l-1.8-.5v5.6m-1.8 0l-1.8-.5V325l1.8-.5v5.6"/><path fill="#c8b100" d="M261.6 313.8c.2-1 1-1.7 1.9-2V306h1.7v5.7c.9.3 1.6.9 1.8 1.7h4.7v.3h-6.3a1.2 1.2 0 0 0-1-.6 1.2 1.2 0 0 0-1.1.6h-1.7m13 0v-.3h4.4l.2-.4-5.4-6 1.3-1 5.3 5.8h.3v-8h1.7v7.9h.3l5.2-5.8 1.3 1-5.2 5.9.3.6h4.2v.3h-13.9zm23 0a1.2 1.2 0 0 1 1.1-.6c.5 0 .9.2 1 .6h1.7a2.7 2.7 0 0 0-1.8-2V306h-1.8v5.7a2.7 2.7 0 0 0-1.8 1.7h-4.6v.3h6.3m-32.2-16l6.5 7.3 1.3-1-6.5-7.3.3-.6h4.7v-1.6h-4.7a2.8 2.8 0 0 0-2.7-1.9 2.7 2.7 0 0 0-2.8 2.7c0 1.1.8 2.1 1.9 2.5v5.6h1.7v-5.6h.3zm34 .1v5.6h-1.7v-5.6a2.6 2.6 0 0 1-.4-.2L291 305l-1.3-1 6.5-7.5a2.4 2.4 0 0 1-.1-.3h-4.8v-1.6h4.8a2.8 2.8 0 0 1 2.6-1.9c1.6 0 2.8 1.2 2.8 2.7 0 1.2-.8 2.2-2 2.5zm-17 0v3.4h-1.8V298a2.7 2.7 0 0 1-1.8-1.7h-4.3v-1.6h4.3a2.8 2.8 0 0 1 2.6-1.9c1.3 0 2.3.8 2.7 1.9h4.3v1.6h-4.3a2.7 2.7 0 0 1-1.7 1.7zm-19 4.1l-1.8.5v4.6l1.8.5V302m1.8 0l1.8.5v4.6l-1.8.5V302m32.5 0l-1.8.5v4.6l1.8.5V302m1.8 0l1.8.5v4.6l-1.8.5V302m-27.3 1l1.7-.8 3.2 3.5-1 1.5-3.9-4.2m-1.3 1l-1 1.5 3 3.5 1.8-.7-3.8-4.3m19.7-1.2l-1.8-.7-3 3.5 1 1.5 3.8-4.3m1.3 1l1 1.6-3 3.5-1.8-.7 3.8-4.3m-21.7 9.6l.5-1.7h4.8l.6 1.7h-5.9m-7-18.1c0-.6.5-1.2 1.1-1.2.7 0 1.2.5 1.2 1.2s-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm12.8.8l-.5 1.7h-4.8l-.5-1.7h5.8m0-1.7l-.5-1.7h-4.8l-.5 1.7h5.8m16.7 19l-.5-1.7h-4.8l-.5 1.7h5.9m4.6-18.1c0-.6.6-1.2 1.2-1.2.7 0 1.2.5 1.2 1.2s-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm-17.2 0c0-.6.6-1.2 1.2-1.2s1.2.5 1.2 1.2-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm6.7.8l.6 1.7h4.8l.5-1.7H287m0-1.6l.5-1.8h4.9l.5 1.7H287m-6.3 5.4l-1.8.5v4.6l1.8.5v-5.6m1.7 0l1.8.5v4.6l-1.8.5v-5.6"/><path fill="none" stroke="#c8b100" stroke-width=".3" d="M284.2 337.3a16.6 16.6 0 0 0 4-1l.8 1.4a18.8 18.8 0 0 1-4.6 1.3 2.8 2.8 0 0 1-2.8 2 2.8 2.8 0 0 1-2.7-2 18.7 18.7 0 0 1-4.8-1.3l.8-1.5c1.3.6 2.7 1 4.2 1.1a2.7 2.7 0 0 1 1.6-1.4v-7.2h1.8v7.2a2.8 2.8 0 0 1 1.7 1.4zm-5-21.7a2.4 2.4 0 0 1-.2-.5h-4.4v-1.6h4.4c0-.2 0-.3.2-.4l-5.4-6 1.3-1 5.3 5.8a2.2 2.2 0 0 1 .3-.1V304h1.7v7.7l.3.1 5.2-5.9 1.3 1-5.2 6 .3.6h4.2v1.6h-4.2l-.3.6 5 5.6-1.4 1-4.9-5.6-.2.1v9.3h-1.8v-9.3l-.2-.1-5 5.6-1.4-1 5.1-5.7m-13.7-17.7l6.5 7.2 1.3-1-6.5-7.3.3-.6h4.7v-1.7h-4.7a2.8 2.8 0 0 0-2.7-1.8 2.7 2.7 0 0 0-2.8 2.7c0 1.1.8 2.1 1.9 2.5v5.5h1.7V298h.3zm7 37l-.9 1.5a17.8 17.8 0 0 1-3.9-3.3c-.9.3-1.9.1-2.6-.5a2.5 2.5 0 0 1-.3-3.7v-.2a16.3 16.3 0 0 1-1.3-5.1h1.8a14 14 0 0 0 1.1 4.4 3.1 3.1 0 0 1 1.5.1l4.4-4.8 1.3 1-4.3 4.9a2.5 2.5 0 0 1-.1 3 16.2 16.2 0 0 0 3.3 2.7zm-9-14v-4a2.7 2.7 0 0 1-2-2.6c0-1.2.9-2.2 2-2.6v-5.6h1.7v5.7c.9.2 1.5.9 1.8 1.7h4.7v1.6H267a2.7 2.7 0 0 1-1.8 1.7v4.1h-1.7m2.5 9a1.2 1.2 0 0 1 1.7-.2c.5.4.5 1.1 0 1.6a1.3 1.3 0 0 1-1.6.1 1.1 1.1 0 0 1-.1-1.6zm-2.2-4.9l-1.8-.4-.3-4.5 1.8-.6v2.6c0 1 0 2 .3 3zm1.5-5.6l1.7.4a64.3 64.3 0 0 0 .3 4.6l-1.8.6-.3-2.9v-2.7zm5.9 14.6a16.7 16.7 0 0 0 5.1 2.7l.4-1.7a14.6 14.6 0 0 1-4.3-2.2l-1.2 1.2m-1 1.5a18.6 18.6 0 0 0 5.3 2.7l-1.4 1.2a20 20 0 0 1-4.2-2.1l.4-1.8"/><path fill="none" stroke="#c8b100" stroke-width=".3" d="M272.6 325.4l1.7.8 3.2-3.5-1-1.5-3.9 4.2m-1.3-1l-1-1.5 3.1-3.5 1.7.7-3.8 4.3m-8.2-10.1c0-.7.6-1.2 1.2-1.2.7 0 1.2.5 1.2 1.2 0 .6-.5 1.1-1.2 1.1-.6 0-1.2-.5-1.2-1.1zm27.5 20.6l.8 1.5a17.8 17.8 0 0 0 4-3.3c.8.3 1.8.1 2.6-.5a2.5 2.5 0 0 0 .3-3.7l-.2-.2c.8-1.6 1.2-3.3 1.4-5.1h-1.7a14.2 14.2 0 0 1-1.2 4.4 3.1 3.1 0 0 0-1.5.1l-4.3-4.8-1.4 1 4.4 4.9a2.5 2.5 0 0 0 .1 3 16 16 0 0 1-3.3 2.7zm9-14v-4.1a2.7 2.7 0 0 0 2-2.5 2.7 2.7 0 0 0-2-2.6v-5.6h-1.8v5.7c-.8.2-1.5.9-1.8 1.7h-4.7v1.6h4.8a2.7 2.7 0 0 0 1.7 1.7v4.1h1.8zm-2.5 9a1.2 1.2 0 0 0-1.7-.2 1.1 1.1 0 0 0-.1 1.6c.4.5 1.1.6 1.7.1a1 1 0 0 0 0-1.6zm2.2-4.8l1.8-.4.2-4.6-1.7-.6v2.6l-.3 3zm-1.5-5.7l-1.8.4v2.3c0-.8-.3 2.3-.3 2.3l1.9.6.2-2.9v-2.7m1.8-21.5v5.5h-1.8V298a2.4 2.4 0 0 1-.4-.2L291 305l-1.3-1.1 6.5-7.4a2.5 2.5 0 0 1-.1-.3h-4.8v-1.7h4.8a2.8 2.8 0 0 1 2.6-1.8c1.6 0 2.8 1.2 2.8 2.7 0 1.2-.8 2.2-2 2.5zm-17.2 0v3.4h-1.7v-3.4a2.7 2.7 0 0 1-1.8-1.7h-4.3v-1.7h4.3a2.8 2.8 0 0 1 2.6-1.8c1.3 0 2.3.8 2.7 1.8h4.3v1.7h-4.3a2.7 2.7 0 0 1-1.7 1.7zm9.5 36a16.8 16.8 0 0 1-5.2 2.8l-.4-1.7a14.6 14.6 0 0 0 4.3-2.1l1.3 1m.9 1.6a18.6 18.6 0 0 1-5.2 2.7l1.3 1.3a20 20 0 0 0 4.3-2.2l-.4-1.8M263.5 302l-1.8.5v4.6l1.8.5V302m1.8 0l1.8.5v4.6l-1.8.5V302m32.5 0l-1.8.5v4.6l1.8.5V302"/><path fill="none" stroke="#c8b100" stroke-width=".3" d="M299.6 302l1.8.5v4.6l-1.8.5V302m-9.2 23.4l-1.7.8-3.1-3.5 1-1.5 3.8 4.2m1.3-1l1-1.5-3-3.5-1.8.7 3.8 4.3m-19.4-21.5l1.7-.7 3.1 3.5-1 1.5-3.8-4.3M271 304l-1 1.5 3 3.5 1.8-.8-3.8-4.2m19.7-1.2l-1.8-.7-3 3.5 1 1.5 3.8-4.3m1.3 1l1 1.5-3 3.5-1.8-.7 3.8-4.2m-21.7 9.6l.5-1.7h4.8l.6 1.7h-5.9m0 1.6l.5 1.7h4.8l.6-1.7h-5.9m-7-19.7c0-.7.5-1.2 1.1-1.2.7 0 1.2.5 1.2 1.2s-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm12.8.8l-.5 1.7h-4.8l-.5-1.7h5.8m0-1.7l-.5-1.7h-4.8l-.5 1.7h5.8m21.4 19.8c0-.6.5-1.2 1.2-1.2s1.2.5 1.2 1.2c0 .6-.5 1.1-1.2 1.1s-1.2-.5-1.2-1.1zm-4.7-.8l-.5-1.7h-4.8l-.5 1.7h5.9m0 1.6l-.6 1.7h-4.8l-.5-1.7h5.9m-12.4 23.3c0-.6.5-1.1 1.2-1.1.6 0 1.1.5 1.1 1.1 0 .7-.5 1.2-1.2 1.2s-1.2-.5-1.2-1.2zm2-8.2l1.8-.5V325l-1.8-.5v5.6m-1.8 0l-1.8-.5V325l1.8-.5v5.6m16.8-34.8c0-.7.6-1.2 1.2-1.2.7 0 1.2.5 1.2 1.2s-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm-17.2 0c0-.7.6-1.2 1.2-1.2.7 0 1.2.5 1.2 1.2s-.5 1.1-1.2 1.1c-.6 0-1.2-.5-1.2-1.1zm6.7.8l.6 1.7h4.8l.5-1.7H287m0-1.7l.6-1.7h4.8l.5 1.7H287m-6.3 5.4l-1.8.5v4.5l1.8.5V300m1.7 0l1.8.5v4.5l-1.8.5V300"/><path fill="#058e6e" d="M278.8 314.3a2.7 2.7 0 0 1 2.8-2.6c1.6 0 2.8 1.1 2.8 2.6a2.7 2.7 0 0 1-2.8 2.7 2.7 2.7 0 0 1-2.8-2.7"/><path fill="#db4446" d="M282.3 245v-.6l.1-.4s-1.6.2-2.5 0a6.3 6.3 0 0 1-2.5-1.4c-.8-.7-1.1-1-1.7-1.2-1.4-.2-2.4.4-2.4.4s1 .4 1.8 1.4a5 5 0 0 0 2 1.5c.6.2 2.7 0 3.3.1l1.9.2"/><path fill="none" stroke="#000" stroke-width=".4" d="M282.3 245v-.6l.1-.4s-1.6.2-2.5 0a6.3 6.3 0 0 1-2.5-1.4c-.8-.7-1.1-1-1.7-1.2-1.4-.2-2.4.4-2.4.4s1 .4 1.8 1.4a5 5 0 0 0 2 1.5c.6.2 2.7 0 3.3.1l1.9.2z"/><path fill="#ed72aa" stroke="#000" stroke-width=".4" d="M290 242.7v1.4c.1.7-.2 1.3 0 1.7l.2 1c.2.2.3.9.3.9l-.8-.6-.6-.4v1c.1.3.3 1 .6 1.3.3.3.9 1 1 1.4.3.4.2 1.4.2 1.4s-.4-.7-.9-.9l-1.3-.6s.9.8.9 1.6c0 .7-.4 1.6-.4 1.6s-.3-.7-.8-1.1l-1.2-1s.5 1.2.5 2v2.6s-.5-.7-1-1l-1-.8c0-.2.5.7.6 1.2 0 .5.3 2.4 2 4.8 1 1.4 2.4 3.8 5.6 3 3.2-.8 2-5 1.3-7-.6-2-1-4.3-1-5 .1-.8.7-3 .6-3.5a8.5 8.5 0 0 1 .1-3.4c.4-1.3.8-1.9 1-2.4l.5-1.4v-1.4l.8 1.5.1 1.5s.1-1.1 1-1.7c1-.6 2-1.2 2.2-1.5l.4-.5s-.1 2-.7 2.7l-1.8 2.2s.8-.3 1.3-.3h.9s-.7.5-1.5 1.6c-.8 1.2-.5 1.3-1 2.3-.7 1-1.1 1-1.9 1.6-1 1-.5 4.5-.3 5 .1.5 2 4.9 2 6 .1 1 .3 3.3-1.6 4.9-1.2 1-3.1 1-3.6 1.2-.4.3-1.3 1.2-1.3 3s.7 2.1 1.2 2.6c.5.4 1.2.2 1.3.5l.5.8c.2.2.4.5.3.8 0 .4-1 1.3-1.2 2-.3.6-1 2.2-1 2.5 0 .2 0 1 .3 1.4 0 0 .9 1 .2 1.3-.4.1-.8-.3-1-.2l-1 .4c-.3 0-.3-.2-.4-.8l-.1-.7c-.3 0-.4.2-.4.5 0 .2 0 .9-.3.9s-.6-.5-.9-.6c-.2 0-.8-.2-.9-.5 0-.3.4-.9.8-1 .4 0 .8-.3.5-.5-.2-.2-.5-.2-.7 0s-.8 0-.8-.3.1-.7 0-.8c0-.2-.4-.6.2-.9.6-.3.8.3 1.4.2.6-.1 1-.3 1.1-.7.2-.3.2-1-.2-1.5s-.8-.5-1-.8l-.3-1v2.4l-.8-.9c-.3-.3-.6-1.4-.6-1.4v1.4c0 .4.4.7.2.9-.1.1-.8-.8-1-.9-.2-.1-.8-.6-1-1l-.6-1.5c0-.2-.2-1.4 0-1.6l.4-1.2h-1.4c-.8 0-1.3-.2-1.6.3-.3.5-.2 1.6.2 3 .4 1.3.6 2 .5 2.2a4 4 0 0 1-.8 1l-1-.1c-.2-.1-.5-.3-1.2-.3h-1.4c-.3 0-1-.4-1.2-.3-.3 0-.8.3-.7.7.2.6-.2.8-.5.7l-1-.2c-.3-.1-.9 0-.8-.4 0-.5.2-.5.4-.8.2-.3.3-.5 0-.5h-.7c-.2.2-.5.6-.7.5-.3-.2-.5-.5-.5-1.1 0-.7-.7-1.3 0-1.3.6 0 1.4.5 1.5.2.2-.4 0-.5-.3-.8-.3-.3-.7-.5-.3-.8l.8-.6c.2-.1.4-.8.7-.6.7.3 0 .7.7 1.4.6.7 1 1 2.1.9 1-.1 1.4-.3 1.4-.6l-.2-1 .2-1s-.5.3-.6.6l-.5.8v-2.1l-.2-.9-.3 1-.1 1s-.7-.5-.5-1.5v-2.1c.3-.4.9-1.7 2.2-1.8h2.8l2.1-.3s-3-1.5-3.7-2c-.7-.5-1.8-1.7-2.1-2.2-.4-.6-.7-1.6-.7-1.6s-.5 0-1 .3a5.3 5.3 0 0 0-1.3 1l-.7 1v-2s-.4 1.3-1 1.8l-1.5 1.2v-1l.2-1s-.5.8-1.2 1-1.9 0-2 .5c0 .5.2 1.1 0 1.4-.1.4-.5.6-.5.6s-.4-.4-.8-.4-.7.2-.7.2-.4-.4-.2-.7c0-.3.7-.7.5-.9-.1-.1-.6.1-.9.2-.3.2-.9.3-.8-.2 0-.4.2-.7 0-1-.1-.3 0-.6.2-.6.2-.1 1.2 0 1.3-.2 0-.3-.3-.5-.9-.7-.6-.1-.9-.5-.6-.8l.6-.6c.1-.3.2-.8.7-.6.6.3.5.9 1 1 .6.3 2 0 2.3-.1l1.5-1 1.7-1.2-1.1-.8-1-1.1a8.8 8.8 0 0 0-2-.7c-.5 0-1.8-.5-1.8-.5l.8-.3c.2-.2.7-.6.9-.6h.3-1.5c-.3-.2-1-.6-1.3-.6h-.9s.8-.4 1.4-.5l1.2-.1s-1-.3-1.3-.6l-.6-1c-.2-.2-.3-.6-.6-.6s-.9.4-1.2.3c-.3 0-.5-.2-.6-.7v-.5c-.2-.3-.7-.8-.2-1h1.4c.1-.2-.5-.7-.8-1-.4-.1-1-.4-.7-.7l.8-.6c.2-.3.4-1 .8-.7.3.2.9 1.3 1.1 1.2.3-.1.4-.9.3-1.2 0-.3 0-1 .3-.9.3 0 .5.5 1 .5.4 0 1.1-.1 1 .2 0 .4-.3.8-.6 1.1a1.6 1.6 0 0 0-.2 1.6 4 4 0 0 0 1.2 1.5c.4.3 1.3.5 1.8.8.6.4 1.9 1.4 2.3 1.5l.9.3s.5-.2 1.1-.2c.7 0 2.2.1 2.8-.1.6-.3 1.3-.7 1.1-1.2-.2-.5-1.5-1-1.4-1.4.1-.4.6-.4 1.4-.5.8 0 1.8.2 2-1 .2-1 .3-1.6-.8-1.9-1.1-.2-2-.3-2.1-1-.2-.8-.4-1-.2-1.3.2-.2.6-.3 1.5-.3.8-.1 1.7-.1 2-.3.2-.2.3-.7.6-1l1.5-.3s1.5.7 3 1.7c1.2 1 2.3 2.3 2.3 2.3"/><path d="M279.3 242l-.2-.7-.1-.3s.9 0 .9.2c0 .3-.3.3-.4.4 0 .2-.2.3-.2.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M279.3 242l-.2-.7-.1-.3s.9 0 .9.2c0 .3-.3.3-.4.4 0 .2-.2.3-.2.3z"/><path d="M283.4 240.5v-.5s.7 0 1.1.3c.6.4 1 1 1 1-.2.2-.6-.2-1-.3h-.4c-.2 0-.3 0-.4-.2v-.3h-.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M283.4 240.5v-.5s.7 0 1.1.3c.6.4 1 1 1 1-.2.2-.6-.2-1-.3h-.4c-.2 0-.3 0-.4-.2v-.3h-.3z"/><path fill="none" stroke="#000" stroke-width=".3" d="M289 246.7l-.4-.7a8 8 0 0 1-.2-.5"/><path fill="#db4446" d="M267.9 241.8s.5.3.8.3l.9.1s.2-.5.1-1c-.2-1.2-1.3-1.4-1.3-1.4s.3.7.1 1c-.2.6-.6 1-.6 1"/><path fill="none" stroke="#000" stroke-width=".4" d="M267.9 241.8s.5.3.8.3l.9.1s.2-.5.1-1c-.2-1.2-1.3-1.4-1.3-1.4s.3.7.1 1c-.2.6-.6 1-.6 1z"/><path fill="#db4446" d="M265.5 242.8s-.4-.8-1.3-.7c-1 .1-1.6.9-1.6.9h1.3c.4.3.5 1 .5 1l.7-.6.4-.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M265.5 242.8s-.4-.8-1.3-.7c-1 .1-1.6.9-1.6.9h1.3c.4.3.5 1 .5 1l.7-.6.4-.6z"/><path fill="#db4446" d="M264.4 246s-.8.1-1.2.6c-.5.5-.4 1.5-.4 1.5s.5-.6 1-.6l1.2.2-.3-.9c0-.3-.3-.8-.3-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M264.4 246s-.8.1-1.2.6c-.5.5-.4 1.5-.4 1.5s.5-.6 1-.6l1.2.2-.3-.9c0-.3-.3-.8-.3-.8z"/><path d="M279.3 245.9l.4-.5.3.5h-.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M279.3 245.9l.4-.5.3.5h-.7"/><path d="M280.2 245.9l.4-.6.4.5h-.8"/><path fill="none" stroke="#000" stroke-width=".3" d="M280.2 245.9l.4-.6.4.5h-.8"/><path d="M279.8 242.5l.8.3-.7.4-.1-.7"/><path fill="none" stroke="#000" stroke-width=".3" d="M279.8 242.5l.8.3-.7.4-.1-.7"/><path d="M280.8 242.8l.8.2-.6.4-.2-.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M280.8 242.8l.8.2-.6.4-.2-.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M275.2 249.2s-.9.3-1.2.7c-.3.6-.3 1.1-.3 1.1s.7-.6 1.6-.3l1.3.3c.4 0 1.3-.4 1.3-.4s-.7.9-.6 1.5c0 .6.2.9.1 1.2 0 .7-.5 1.6-.5 1.6l1-.3a4.9 4.9 0 0 0 1.8-.9l1-1s-.2 1 0 1.5l.2 1.7s.4-.5.8-.7c.2 0 .8-.4 1-.7l.3-1s0 .8.4 1.3c.3.4.7 1.8.7 1.8s.3-.9.6-1.3c.3-.3.7-.8.7-1v-1l.4 1m-11.7.6s.5-.9 1-1.2l1.2-.8 1-.4m1 5.3l1.4-.8a4.2 4.2 0 0 0 1.2-1.2"/><path fill="#db4446" d="M267 256.4s-.4-.5-1.2-.3c-.7 0-1.2 1-1.2 1l1-.2c.4.2.6.5.6.5l.5-.4.3-.6"/><path fill="none" stroke="#000" stroke-width=".4" d="M267 256.4s-.4-.5-1.2-.3c-.7 0-1.2 1-1.2 1l1-.2c.4.2.6.5.6.5l.5-.4.3-.6z"/><path fill="#db4446" d="M266.2 259.4s-.7 0-1.2.4c-.6.4-.6 1.2-.6 1.2s.5-.4 1-.3l.8.2.1-.6c.1-.4-.1-.9-.1-.9"/><path fill="none" stroke="#000" stroke-width=".4" d="M266.2 259.4s-.7 0-1.2.4c-.6.4-.6 1.2-.6 1.2s.5-.4 1-.3l.8.2.1-.6c.1-.4-.1-.9-.1-.9z"/><path fill="#db4446" d="M267.6 262.2s0 .8.4 1.3c.4.6 1.2.6 1.2.6l-.3-.8c-.1-.4.3-.7.3-.7s-.4-.4-.7-.4h-.8"/><path fill="none" stroke="#000" stroke-width=".4" d="M267.6 262.2s0 .8.4 1.3c.4.6 1.2.6 1.2.6l-.3-.8c-.1-.4.3-.7.3-.7s-.4-.4-.7-.4h-.8zm17.1 1.4s2.1 1.3 2 2.4c0 1-1.1 2.4-1.1 2.4"/><path fill="#db4446" d="M275.2 269.4s-.5-.6-1.3-.6c-.7 0-1.5.7-1.5.7s1 0 1.2.2l.4.7.6-.3.6-.7"/><path fill="none" stroke="#000" stroke-width=".4" d="M275.2 269.4s-.5-.6-1.3-.6c-.7 0-1.5.7-1.5.7s1 0 1.2.2l.4.7.6-.3.6-.7z"/><path fill="#db4446" d="M273 272.3s-1-.1-1.5.4-.4 1.4-.4 1.4.6-.7 1-.6c.6 0 1.2.3 1.2.3l-.2-.8a14 14 0 0 0-.2-.7"/><path fill="none" stroke="#000" stroke-width=".4" d="M273 272.3s-1-.1-1.5.4-.4 1.4-.4 1.4.6-.7 1-.6c.6 0 1.2.3 1.2.3l-.2-.8a14 14 0 0 0-.2-.7z"/><path fill="#db4446" d="M275 275.4s-.5.6-.1 1.1c.3.6 1 .8 1 .8s-.2-.4-.1-.8.7-.8.7-.8l-1.5-.3"/><path fill="none" stroke="#000" stroke-width=".4" d="M275 275.4s-.5.6-.1 1.1c.3.6 1 .8 1 .8s-.2-.4-.1-.8.7-.8.7-.8l-1.5-.3z"/><path fill="#db4446" d="M287.7 276.6s-.8-.2-1.3 0c-.5.3-.8 1.5-.8 1.5s.7-.6 1.3-.6l1 .3v-.8a2.8 2.8 0 0 0-.2-.4"/><path fill="none" stroke="#000" stroke-width=".4" d="M287.7 276.6s-.8-.2-1.3 0c-.5.3-.8 1.5-.8 1.5s.7-.6 1.3-.6l1 .3v-.8a2.8 2.8 0 0 0-.2-.4z"/><path fill="#db4446" d="M288.1 279.7s-.6.6-.4 1.2a7.3 7.3 0 0 0 .6 1s0-.7.3-1c.3-.3 1-.3 1-.3l-.7-.6-.8-.3"/><path fill="none" stroke="#000" stroke-width=".4" d="M288.1 279.7s-.6.6-.4 1.2a7.3 7.3 0 0 0 .6 1s0-.7.3-1c.3-.3 1-.3 1-.3l-.7-.6-.8-.3z"/><path fill="#db4446" d="M291.3 280.6s-.3.8.3 1.3c.6.6 1.1.6 1.1.6s-.5-.8-.3-1.3c.1-.4.5-.7.5-.7l-.8-.2-.8.3"/><path fill="none" stroke="#000" stroke-width=".4" d="M291.3 280.6s-.3.8.3 1.3c.6.6 1.1.6 1.1.6s-.5-.8-.3-1.3c.1-.4.5-.7.5-.7l-.8-.2-.8.3z"/><path fill="#ffd691" stroke="#000" stroke-width=".5" d="M258.7 337.5c2.1.6 3.2 2.2 3.2 4 0 2.5-2.3 4.3-5.4 4.3-3 0-5.6-1.8-5.6-4.2 0-1.9 1-4 3.2-4 0 0 0-.3-.3-.6l-.6-.7h1.3l.7.5.6-.7c.3-.4.7-.6.7-.6l.6.7.3.6s.4-.4.8-.5l.9-.3-.3.7-.1.8"/><path fill="#058e6e" stroke="#000" stroke-width=".5" d="M256 348.5s-4-2.8-5.8-3.1c-2.3-.5-4.8-.1-5.9-.2l1.9 1.5a11 11 0 0 0 3.5 2c3.3.8 6.3-.2 6.3-.2m1.2.2s2.6-2.7 5.3-3c3.3-.5 5.4.2 6.6.5 0 0-1 .5-1.6 1-.5.3-2 1.5-4.2 1.6-2.2 0-4.7-.3-5.1-.2l-1 .1"/><path fill="#ad1519" stroke="#000" stroke-width=".5" d="M256.4 345.4a5.2 5.2 0 0 1 0-7.6 5.2 5.2 0 0 1 1.7 3.8 5.2 5.2 0 0 1-1.7 3.8"/><path fill="#058e6e" stroke="#000" stroke-width=".5" d="M255.4 351s.6-1.6.7-3l-.2-2.2h.8s.4 1.2.4 2.2l-.2 2.5-.7.1-.8.3"/><path fill="#fff" d="M307 203.4c0-.6.4-1 1-1 .7 0 1.2.4 1.2 1s-.5 1.1-1.2 1.1a1 1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M307 203.4c0-.6.4-1 1-1 .7 0 1.2.4 1.2 1s-.5 1.1-1.2 1.1a1 1 0 0 1-1-1z"/><path fill="#fff" d="M308.4 200.7c0-.6.6-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M308.4 200.7c0-.6.6-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M309.5 197.6c0-.6.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M309.5 197.6c0-.6.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M309.6 194.2c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1-.7 0-1.2-.4-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M309.6 194.2c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1-.7 0-1.2-.4-1.2-1z"/><path fill="#fff" d="M308.8 190.9c0-.6.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M308.8 190.9c0-.6.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M307 187.8c0-.5.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M307 187.8c0-.5.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M304.7 185.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .5-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M304.7 185.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .5-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M302 183.3c0-.6.6-1 1.2-1s1.1.4 1.1 1-.5 1-1.1 1a1 1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M302 183.3c0-.6.6-1 1.2-1s1.1.4 1.1 1-.5 1-1.1 1a1 1 0 0 1-1.1-1z"/><path fill="#fff" d="M298.9 181.6c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M298.9 181.6c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M295.5 180.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M295.5 180.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M291.8 179.8c0-.6.5-1.1 1.1-1.1.7 0 1.2.5 1.2 1 0 .7-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M291.8 179.8c0-.6.5-1.1 1.1-1.1.7 0 1.2.5 1.2 1 0 .7-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1z"/><path fill="#fff" d="M288.3 179.6c0-.6.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.2 1a1.1 1.1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M288.3 179.6c0-.6.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.2 1a1.1 1.1 0 0 1-1-1z"/><path fill="#fff" d="M284.9 179.7c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M284.9 179.7c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M281.4 179.7c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M281.4 179.7c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M283.1 182.7c0-.6.5-1.1 1.1-1.1.7 0 1.2.5 1.2 1 0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.2-1m.7 3.2c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1m.2 3.3c0-.6.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1m-1 3c0-.6.4-1.1 1-1.1a1 1 0 0 1 1.2 1c0 .7-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.2-1m-1.9 2.7c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="#fff" d="M278.8 177.6c0-.5.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M278.8 177.6c0-.5.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M275.7 176c0-.7.5-1.1 1.1-1.1.7 0 1.2.4 1.2 1s-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M275.7 176c0-.7.5-1.1 1.1-1.1.7 0 1.2.4 1.2 1s-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M272.3 175c0-.7.5-1.1 1.2-1.1.6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M272.3 175c0-.7.5-1.1 1.2-1.1.6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M268.8 174.3c0-.6.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1-1.2 1a1.1 1.1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M268.8 174.3c0-.6.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1-1.2 1a1.1 1.1 0 0 1-1-1z"/><path fill="#fff" d="M265.4 174.4c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M265.4 174.4c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M261.8 175c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M261.8 175c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M258.5 176.1c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M258.5 176.1c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M202.3 203.4c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1.1-1 1.1a1 1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M202.3 203.4c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1.1-1 1.1a1 1 0 0 1-1.2-1z"/><path fill="#fff" d="M200.8 200.7c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1 1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M200.8 200.7c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1 1 0 0 1-1.1-1z"/><path fill="#fff" d="M199.7 197.6c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M199.7 197.6c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M199.6 194.2c0-.6.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1-1.2 1c-.6 0-1-.4-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M199.6 194.2c0-.6.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1-1.2 1c-.6 0-1-.4-1-1z"/><path fill="#fff" d="M200.4 190.9c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M200.4 190.9c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M202.2 187.8c0-.5.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M202.2 187.8c0-.5.5-1 1-1a1 1 0 0 1 1.2 1c0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M204.5 185.4c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1 0 .5-.5 1-1.1 1-.6 0-1.1-.4-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M204.5 185.4c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1 0 .5-.5 1-1.1 1-.6 0-1.1-.4-1.1-1z"/><path fill="#fff" d="M207.2 183.3c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1 1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M207.2 183.3c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1 1 0 0 1-1.2-1z"/><path fill="#fff" d="M210.3 181.6c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M210.3 181.6c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M213.7 180.4c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M213.7 180.4c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M217.4 179.8c0-.6.5-1.1 1.1-1.1a1 1 0 0 1 1.1 1c0 .7-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M217.4 179.8c0-.6.5-1.1 1.1-1.1a1 1 0 0 1 1.1 1c0 .7-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M220.9 179.6c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M220.9 179.6c0-.6.5-1 1.1-1 .6 0 1.1.4 1.1 1s-.5 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M224.3 179.7c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M224.3 179.7c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M227.8 179.7c0-.6.5-1 1.1-1 .6 0 1.2.4 1.2 1s-.5 1-1.2 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M227.8 179.7c0-.6.5-1 1.1-1 .6 0 1.2.4 1.2 1s-.5 1-1.2 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" stroke="#000" stroke-width=".4" d="M226 182.7c0-.6.6-1.1 1.2-1.1s1.1.5 1.1 1c0 .6-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1m-.7 3.2c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1c-.6 0-1.1-.4-1.1-1m-.2 3.3c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1m1 3c0-.6.6-1.1 1.2-1.1a1 1 0 0 1 1.1 1c0 .7-.5 1.1-1.1 1.1a1.1 1.1 0 0 1-1.1-1m1.9 2.7c0-.6.5-1 1-1 .7 0 1.2.4 1.2 1s-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="#fff" d="M230.4 177.6c0-.5.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M230.4 177.6c0-.5.5-1 1.1-1 .7 0 1.2.4 1.2 1s-.5 1.1-1.2 1.1a1.1 1.1 0 0 1-1-1z"/><path fill="#fff" d="M233.5 176c0-.7.5-1.1 1.1-1.1.6 0 1.1.4 1.1 1s-.5 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M233.5 176c0-.7.5-1.1 1.1-1.1.6 0 1.1.4 1.1 1s-.5 1.1-1 1.1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M236.9 175c0-.7.5-1.1 1-1.1s1.2.4 1.2 1-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M236.9 175c0-.7.5-1.1 1-1.1s1.2.4 1.2 1-.5 1-1.1 1a1.1 1.1 0 0 1-1.1-1z"/><path fill="#fff" d="M240.4 174.3c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M240.4 174.3c0-.6.5-1 1.1-1a1 1 0 0 1 1.1 1c0 .6-.5 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#fff" d="M243.8 174.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1 1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M243.8 174.4c0-.6.5-1 1.2-1a1 1 0 0 1 1 1c0 .6-.4 1-1 1a1 1 0 0 1-1.2-1z"/><path fill="#fff" d="M247.4 175c0-.6.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.2 1a1.1 1.1 0 0 1-1-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M247.4 175c0-.6.5-1 1.1-1a1 1 0 0 1 1.2 1c0 .6-.5 1-1.2 1a1.1 1.1 0 0 1-1-1z"/><path fill="#fff" d="M250.7 176.1c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1"/><path fill="none" stroke="#000" stroke-width=".4" d="M250.7 176.1c0-.6.5-1 1.2-1 .6 0 1 .4 1 1s-.4 1-1 1a1.1 1.1 0 0 1-1.2-1z"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M222.3 244.1h-1v-1h-1.6v3.9h1.6v2.6h-3.5v7.5h1.9v15.2h-3.8v7.8h29v-7.8h-3.7v-15.2h1.9v-7.5h-3.6V247h1.7v-3.8h-1.7v1h-1v-1H237v1h-1.2v-1h-1.6v3.8h1.6v2.6h-3.5v-8.3h1.9v-3.8h-1.9v1h-1v-1h-1.6v1h-1v-1h-1.9v3.8h2v8.3H225V247h1.7v-3.8H225v1h-1v-1h-1.8v1zm-6.4 36h29m-29-1.9h29m-29-1.9h29m-29-1.9h29m-29-2.1h29m-25.2-1.7h21.5m-21.5-1.9h21.5m-21.5-2h21.5m-21.5-2h21.5m-21.5-1.9h21.5m-21.5-1.9h21.5m-21.5-1.9h21.5m-23.4-1.9H243m-25.3-1.8H243m-25.3-2H243m-25.3-1.8H243m-21.8-2h18.2m-10.9-1.8h3.6m-3.5-2h3.5m-3.5-1.8h3.5m-3.5-1.9h3.5m-5.4-2.4h7.3m-12.8 8h3.8m-5.4-2.3h7m-7 34.8v-1.9m0-1.9v-1.9m-2 2v1.8m3.6 0v-1.9m2 3.8v-1.9m0-1.9v-1.9m0-2.1v-1.7m0-1.9v-2m-2 7.7v-2.1m-3.5 2.1v-2.1m7.3 0v2.1m1.7-2.1v-1.7m-5.5-1.9v2m3.8-2v2m3.5-2v2m-1.8-2v-2m1.8-2v2m0-5.8v2m-1.8-3.9v2m1.8-3.8v1.8m-3.5-1.9v2m-3.8-2v2m-1.6-3.8v1.9m3.5-2v2m3.6-2v2m1.9-3.8v1.9m-3.6-2v2m-3.8-2v2m-1.6-3.8v1.9m7-2v2m-3.5-5.7v1.9m16.3-2h-3.7m5.4-2.3H234m7 34.8v-1.9m0-1.9v-1.9m2 2v1.8m-3.6 0v-1.9m-1.9 3.8v-1.9m0-1.9v-1.9m0-2.1v-1.7m0-1.9v-2m2 7.7v-2.1m3.5 2.1v-2.1m-7.3 0v2.1m-1.7-2.1v-1.7m5.4-1.9v2m-3.7-2v2m-3.6-2v2m1.9-2v-2m-1.9-2v2m0-5.8v2m1.9-3.9v2m-1.9-3.8v1.8m3.6-1.9v2m3.8-2v2m1.6-3.8v1.9m-3.5-2v2m-3.6-2v2m-1.9-3.8v1.9m3.6-2v2m3.7-2v2m1.7-3.8v1.9m-7.1-2v2m3.6-5.7v1.9m-7.4 19.1v-2m0-5.8V259m0 5.7v-1.9m0-5.7v-1.8m0-2v-1.8m0-3.8v-2m0-1.8V242m-9 5h3.8m3.6-5.7h3.5m3.6 5.7h3.7"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M235.3 280.1v-5c0-1-.5-3.8-5-3.8-4.3 0-4.7 2.9-4.7 3.8v5h9.7z"/><path fill="#c8b100" stroke="#000" stroke-width=".5" d="M227.2 275.4l-2.3-.3c0-1 .2-2.3 1-2.8l2 1.7c-.2.2-.7.9-.7 1.4zm6.4 0l2.4-.3c0-1-.3-2.3-1-2.8l-2 1.7c.1.2.6.9.6 1.4zm-2.4-2.4l1.2-2.1a5.6 5.6 0 0 0-2-.5c-.6 0-1.5.2-2 .5l1.2 2.1h1.6zm-4.4-6v-5c0-1.4-1-2.6-2.6-2.6-1.7 0-2.6 1.2-2.6 2.6v5.2h5.2zm7.3 0v-5c0-1.4 1-2.6 2.6-2.6s2.6 1.2 2.6 2.6v5.2h-5.2zm-1.9-12.7l.5-4.7h-4.5l.2 4.7h3.8zm3.5 0l-.4-4.7h4.7l-.5 4.7h-3.8zm-10.6 0l.2-4.7h-4.5l.5 4.7h3.8z"/><path fill="#0039f0" d="M233.6 280.1v-4.3c0-.7-.4-2.8-3.3-2.8a2.9 2.9 0 0 0-3 2.8v4.3h6.3zm-7.3-13.5v-4.5c0-1.2-.7-2.4-2.1-2.4s-2.2 1.2-2.2 2.4v4.5h4.3zm8.3 0v-4.5c0-1.2.7-2.4 2.1-2.4s2.1 1.2 2.1 2.4v4.5h-4.2z"/><path fill="#ad1519" d="M239.5 287.8c0-10.4 7.5-18.8 16.6-18.8s16.7 8.4 16.7 18.7c0 10.4-7.5 18.8-16.7 18.8s-16.6-8.4-16.6-18.7"/><path fill="none" stroke="#000" stroke-width=".6" d="M239.5 287.8c0-10.4 7.5-18.8 16.6-18.8s16.7 8.4 16.7 18.7c0 10.4-7.5 18.8-16.7 18.8s-16.6-8.4-16.6-18.7z"/><path fill="#005bbf" d="M244.4 287.7c0-7.6 5.3-13.7 11.7-13.7 6.5 0 11.8 6.1 11.8 13.7s-5.3 13.7-11.7 13.7c-6.5 0-11.8-6.1-11.8-13.7"/><path fill="none" stroke="#000" stroke-width=".6" d="M244.4 287.7c0-7.6 5.3-13.7 11.7-13.7 6.5 0 11.8 6.1 11.8 13.7s-5.3 13.7-11.7 13.7c-6.5 0-11.8-6.1-11.8-13.7z"/><path fill="#c8b100" d="M250.6 278.3s-1.4 1.5-1.4 2.9.6 2.6.6 2.6a1.5 1.5 0 0 0-1.4-1 1.5 1.5 0 0 0-1.6 1.5l.3.8.5 1c.2-.4.5-.6 1-.6.6 0 1 .5 1 1v.3h-1.2v1h1.1l-.8 1.7 1-.4 1 1 .8-1 1 .4-.7-1.6h1v-1.1h-1.2a1 1 0 0 1 0-.3c0-.5.5-1 1-1s1 .2 1 .6l.6-1 .2-.8c0-.8-.6-1.5-1.5-1.5-.7 0-1.2.4-1.4 1 0 0 .5-1.2.5-2.6 0-1.4-1.4-3-1.4-3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M250.6 278.3s-1.4 1.5-1.4 2.9.6 2.6.6 2.6a1.5 1.5 0 0 0-1.4-1 1.5 1.5 0 0 0-1.6 1.5l.3.8.5 1c.2-.4.5-.6 1-.6.6 0 1 .5 1 1v.3h-1.2v1h1.1l-.8 1.7 1-.4 1 1 .8-1 1 .4-.7-1.6h1v-1.1h-1.2a1 1 0 0 1 0-.3c0-.5.5-1 1-1s1 .2 1 .6l.6-1 .2-.8c0-.8-.6-1.5-1.5-1.5-.7 0-1.2.4-1.4 1 0 0 .5-1.2.5-2.6 0-1.4-1.4-3-1.4-3z"/><path fill="#c8b100" d="M248.4 287.9h4.5v-1.1h-4.5v1z"/><path fill="none" stroke="#000" stroke-width=".3" d="M248.4 287.9h4.5v-1.1h-4.5v1z"/><path fill="#c8b100" d="M261.5 278.3s-1.4 1.5-1.4 2.9.6 2.6.6 2.6c-.2-.6-.8-1-1.4-1-.9 0-1.6.7-1.6 1.5l.3.8.5 1c.1-.4.5-.6 1-.6a1 1 0 0 1 1 1 1 1 0 0 1 0 .3h-1.2v1h1.1l-.8 1.7 1-.4.9 1 .9-1 1 .4-.8-1.6h1.1v-1.1h-1.2a.9.9 0 0 1 0-.3c0-.5.5-1 1-1s.9.2 1 .6l.6-1 .2-.8c0-.8-.7-1.5-1.5-1.5-.7 0-1.3.4-1.5 1 0 0 .6-1.2.6-2.6 0-1.4-1.4-3-1.4-3"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M261.5 278.3s-1.4 1.5-1.4 2.9.6 2.6.6 2.6c-.2-.6-.8-1-1.4-1-.9 0-1.6.7-1.6 1.5l.3.8.5 1c.1-.4.5-.6 1-.6a1 1 0 0 1 1 1 1 1 0 0 1 0 .3h-1.2v1h1.1l-.8 1.7 1-.4.9 1 .9-1 1 .4-.8-1.6h1.1v-1.1h-1.2a.9.9 0 0 1 0-.3c0-.5.5-1 1-1s.9.2 1 .6l.6-1 .2-.8c0-.8-.7-1.5-1.5-1.5-.7 0-1.3.4-1.5 1 0 0 .6-1.2.6-2.6 0-1.4-1.4-3-1.4-3z"/><path fill="#c8b100" d="M259.3 287.9h4.5v-1.1h-4.5v1z"/><path fill="none" stroke="#000" stroke-width=".3" d="M259.3 287.9h4.5v-1.1h-4.5v1z"/><path fill="#c8b100" d="M256 287.6s-1.3 1.5-1.3 3c0 1.4.6 2.6.6 2.6a1.5 1.5 0 0 0-1.5-1 1.5 1.5 0 0 0-1.5 1.4l.2.8.5 1c.2-.3.6-.5 1-.5.6 0 1.1.4 1.1 1a1 1 0 0 1 0 .3h-1.2v1h1l-.8 1.7 1.1-.5.9 1 .8-1 1.1.5-.8-1.7h1.1v-1h-1.2a1 1 0 0 1 0-.3c0-.6.4-1 1-1 .5 0 .9.2 1 .5l.5-1c.1-.2.3-.5.3-.8 0-.8-.7-1.4-1.6-1.4a1.5 1.5 0 0 0-1.4 1s.6-1.2.6-2.7c0-1.4-1.4-2.9-1.4-2.9"/><path fill="none" stroke="#000" stroke-linejoin="round" stroke-width=".3" d="M256 287.6s-1.3 1.5-1.3 3c0 1.4.6 2.6.6 2.6a1.5 1.5 0 0 0-1.5-1 1.5 1.5 0 0 0-1.5 1.4l.2.8.5 1c.2-.3.6-.5 1-.5.6 0 1.1.4 1.1 1a1 1 0 0 1 0 .3h-1.2v1h1l-.8 1.7 1.1-.5.9 1 .8-1 1.1.5-.8-1.7h1.1v-1h-1.2a1 1 0 0 1 0-.3c0-.6.4-1 1-1 .5 0 .9.2 1 .5l.5-1c.1-.2.3-.5.3-.8 0-.8-.7-1.4-1.6-1.4a1.5 1.5 0 0 0-1.4 1s.6-1.2.6-2.7c0-1.4-1.4-2.9-1.4-2.9z"/><path fill="#c8b100" d="M253.8 297.2h4.5v-1h-4.5v1z"/><path fill="none" stroke="#000" stroke-width=".3" d="M253.8 297.2h4.5v-1h-4.5v1z"/><path fill="#c8b100" d="M289.4 238.3h-.3a1.6 1.6 0 0 1-.3.4c-.3.2-.7.3-.9 0a.5.5 0 0 1-.1-.4.5.5 0 0 1-.5 0c-.3-.1-.4-.5-.2-.8l.1-.2v-.3h-.3l-.1.3c-.3.2-.6.3-.8.1a.6.6 0 0 1-.1-.2h-.2c-.5.2-.7-1-.8-1.3l-.1.3v1.3a7 7 0 0 1-.3 1.2c.8.2 2 .8 3 1.7a9.6 9.6 0 0 1 2.5 2.5l1.2-.6c.6-.2 1.4-.2 1.4-.2l.2-.2c-.3 0-1.6.1-1.6-.4l.1-.2a.7.7 0 0 1-.3 0c-.2-.2-.2-.5 0-.8h.2v-.4h-.3l-.2.1c-.3.3-.7.3-.9 0a.5.5 0 0 1 0-.4.6.6 0 0 1-.6 0 .6.6 0 0 1 0-.9 1.6 1.6 0 0 1 .2-.3v-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M289.4 238.3h-.3a1.6 1.6 0 0 1-.3.4c-.3.2-.7.3-.9 0a.5.5 0 0 1-.1-.4.5.5 0 0 1-.5 0c-.3-.1-.4-.5-.2-.8l.1-.2v-.3h-.3l-.1.3c-.3.2-.6.3-.8.1a.6.6 0 0 1-.1-.2h-.2c-.5.2-.7-1-.8-1.3l-.1.3v1.3a7 7 0 0 1-.3 1.2c.8.2 2 .8 3 1.7a9.6 9.6 0 0 1 2.5 2.5l1.2-.6c.6-.2 1.4-.2 1.4-.2l.2-.2c-.3 0-1.6.1-1.6-.4l.1-.2a.7.7 0 0 1-.3 0c-.2-.2-.2-.5 0-.8h.2v-.4h-.3l-.2.1c-.3.3-.7.3-.9 0a.5.5 0 0 1 0-.4.6.6 0 0 1-.6 0 .6.6 0 0 1 0-.9 1.6 1.6 0 0 1 .2-.3v-.3z"/><path d="M287 239h.3s.1.2 0 .2h-.2v-.2"/><path fill="none" stroke="#000" stroke-width=".1" d="M287 239h.3s.1.2 0 .2h-.2v-.2z"/><path d="M288 239.8l-.3-.2v-.2h.2l.3.3.3.2s.1.1 0 .2h-.1l-.4-.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M288 239.8l-.3-.2v-.2h.2l.3.3.3.2s.1.1 0 .2h-.1l-.4-.3"/><path d="M286.3 238.6l-.3-.2s-.1 0 0-.1h.1l.3.1.2.2.1.1h-.2l-.2-.1"/><path fill="none" stroke="#000" stroke-width=".1" d="M286.3 238.6l-.3-.2s-.1 0 0-.1h.1l.3.1.2.2.1.1h-.2l-.2-.1"/><path d="M285.2 237.9h.2l.1.2h-.2l-.1-.2"/><path fill="none" stroke="#000" stroke-width=".1" d="M285.2 237.9h.2l.1.2h-.2l-.1-.2z"/><path d="M289.1 240.6v-.3h-.3v.3h.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M289.1 240.6v-.3h-.3v.3h.3z"/><path d="M289.7 241.2l.2.2c0 .1.2.1.2 0l-.2-.3-.2-.2h-.2v.1l.2.2"/><path fill="none" stroke="#000" stroke-width=".1" d="M289.7 241.2l.2.2c0 .1.2.1.2 0l-.2-.3-.2-.2h-.2v.1l.2.2"/><path d="M290.7 242v-.2h-.3v.3h.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M290.7 242v-.2h-.3v.3h.3z"/><path fill="#c8b100" d="M287.9 235.9h-.6l-.2.9.1.1h.2l.7-.5-.2-.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M287.9 235.9h-.6l-.2.9.1.1h.2l.7-.5-.2-.5"/><path fill="#c8b100" d="M286.2 236.4v.5l1 .2v-.3l-.5-.7-.5.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M286.2 236.4v.5l1 .2v-.3l-.5-.7-.5.3"/><path fill="#c8b100" d="M288.2 237.5l-.5.3-.6-.8v-.1h1.1v.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M288.2 237.5l-.5.3-.6-.8v-.1h1.1v.6"/><path fill="#c8b100" d="M287 236.8a.3.3 0 0 1 .3-.1.3.3 0 0 1 .1.4.3.3 0 0 1-.3 0 .3.3 0 0 1-.2-.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M287 236.8a.3.3 0 0 1 .3-.1.3.3 0 0 1 .1.4.3.3 0 0 1-.3 0 .3.3 0 0 1-.2-.3z"/><path fill="#c8b100" d="M284.8 235.9l-.3-.8a2 2 0 0 0-.4-.4s.4-.2.9.1c.4.3 0 .9 0 .9l-.2.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M284.8 235.9l-.3-.8a2 2 0 0 0-.4-.4s.4-.2.9.1c.4.3 0 .9 0 .9l-.2.2z"/><path fill="#c8b100" d="M285.8 236.2l-.4.4-.7-.6v-.3h1l.1.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M285.8 236.2l-.4.4-.7-.6v-.3h1l.1.5"/><path fill="#c8b100" d="M284.6 235.8l.3-.2c.1 0 .2.2.1.3 0 .2-.2.3-.3.3 0 0-.1-.2 0-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M284.6 235.8l.3-.2c.1 0 .2.2.1.3 0 .2-.2.3-.3.3 0 0-.1-.2 0-.4z"/><path fill="#c8b100" d="M290.2 237.3h-.6l-.3.8v.2h.2l.9-.4-.2-.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M290.2 237.3h-.6l-.3.8v.2h.2l.9-.4-.2-.6"/><path fill="#c8b100" d="M288.5 237.6l-.1.6.9.2h.1v-.2l-.4-.8-.5.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M288.5 237.6l-.1.6.9.2h.1v-.2l-.4-.8-.5.2"/><path fill="#c8b100" d="M290.3 239l-.6.2-.4-.8v-.2h.1l1 .2-.1.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M290.3 239l-.6.2-.4-.8v-.2h.1l1 .2-.1.6"/><path fill="#c8b100" d="M289.1 238.1c.1-.1.3-.1.4 0a.3.3 0 0 1 .1.4.3.3 0 0 1-.4 0 .3.3 0 0 1 0-.4"/><path fill="none" stroke="#000" stroke-width=".3" d="M289.1 238.1c.1-.1.3-.1.4 0a.3.3 0 0 1 .1.4.3.3 0 0 1-.4 0 .3.3 0 0 1 0-.4z"/><path fill="#c8b100" d="M292.2 239.2l.1.6-.9.3h-.1v-.2l.3-.8.6.1"/><path fill="none" stroke="#000" stroke-width=".3" d="M292.2 239.2l.1.6-.9.3h-.1v-.2l.3-.8.6.1"/><path fill="#c8b100" d="M292 240.8l-.5.2-.3-.9v-.1h.2l.8.3-.1.5"/><path fill="none" stroke="#000" stroke-width=".3" d="M292 240.8l-.5.2-.3-.9v-.1h.2l.8.3-.1.5"/><path fill="#c8b100" d="M290.5 239.3l-.2.5.9.3h.1v-.1l-.2-.9-.6.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M290.5 239.3l-.2.5.9.3h.1v-.1l-.2-.9-.6.2"/><path fill="#c8b100" d="M291.5 240.3a.3.3 0 0 0 0-.4.3.3 0 0 0-.5 0 .3.3 0 0 0 0 .3.3.3 0 0 0 .4 0"/><path fill="none" stroke="#000" stroke-width=".3" d="M291.5 240.3a.3.3 0 0 0 0-.4.3.3 0 0 0-.5 0 .3.3 0 0 0 0 .3.3.3 0 0 0 .4 0z"/><path fill="#c8b100" d="M292.9 242.1l.8.1a2 2 0 0 1 .5.3s.1-.5-.3-.8c-.4-.3-.9.2-.9.2l-.1.2"/><path fill="none" stroke="#000" stroke-width=".3" d="M292.9 242.1l.8.1a2 2 0 0 1 .5.3s.1-.5-.3-.8c-.4-.3-.9.2-.9.2l-.1.2z"/><path fill="#c8b100" d="M292.3 241.2l-.3.5.8.5v-.1h.2l-.1-1h-.6"/><path fill="none" stroke="#000" stroke-width=".3" d="M292.3 241.2l-.3.5.8.5v-.1h.2l-.1-1h-.6"/><path fill="#c8b100" d="M293 242.2s.2-.2.1-.3h-.4c-.1 0-.2.2-.1.3h.3"/><path fill="none" stroke="#000" stroke-width=".3" d="M293 242.2s.2-.2.1-.3h-.4c-.1 0-.2.2-.1.3h.3zm40.7-23.4v.6H331v-.6h1v-1.4h-.7v-.6h.6v-.5h.7v.5h.6v.6h-.6v1.4h1"/><path fill="none" d="M179.3 231.6v-1.3m-.3 1.3v-1.3m-.3 1.3v-1.3m-.4 1.3v-1.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M178 231.6v-1.3m-.5 1.2v-1.2m.2 1.2v-1.2m-.7 1.2v-1.1m.2 1v-1m-.9 1v-1m.2 1v-1m.2 1v-1m-.7 1v-1m-.2.9v-.8m-.2.8v-.8m-.6.8v-.7m.3.7v-.7m-.5.6v-.6m-.2.5v-.4m-.3.3v-.3m-.3.3v-.2"/><path fill="none" stroke="#000" stroke-width=".2" d="M173.8 231v-.1"/><path fill="none" d="M180.8 231.5v-1.2m-.7 1.2v-1.2m-.4 1.3v-1.3m152.6 1.3v-1.3m-.3 1.3v-1.3m-.4 1.3v-1.3m-.4 1.3v-1.3"/><path fill="none" stroke="#000" stroke-width=".1" d="M331 231.6v-1.3m-.6 1.2v-1.1m.3 1.1v-1.2m-.8 1.2v-1.1m.2 1.1v-1.2m-.9 1.1v-1m.2 1v-1m.3 1v-1m-.7 1v-1m-.3 1v-.9m-.2.8v-.8m-.5.8v-.7m.2.7v-.7m-.5.6v-.5m-.2.5v-.5m-.3.4v-.4m-.2.3v-.2"/><path fill="none" stroke="#000" stroke-width=".2" d="M326.7 231v-.1"/><path fill="none" d="M333.7 231.5v-1.2m-.6 1.3v-1.3m-.5 1.3v-1.3"/></svg>';case"flag-fr":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g fill-rule="evenodd" stroke-width="1pt"><path fill="#fff" d="M0 0h512v512H0z"/><path fill="#00267f" d="M0 0h170.7v512H0z"/><path fill="#f31830" d="M341.3 0H512v512H341.3z"/></g></svg>';case"flag-nl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g fill-rule="evenodd" stroke-width="1pt" transform="scale(.48166 .71932)"><rect width="1063" height="708.7" fill="#fff" rx="0" ry="0"/><rect width="1063" height="236.2" y="475.6" fill="#21468b" rx="0" ry="0"/><path fill="#ae1c28" d="M0 0h1063v236.2H0z"/></g></svg>';case"flag-pt-br":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g stroke-width="1pt"><path fill="#229e45" fill-rule="evenodd" d="M0 0h512v512H0z"/><path fill="#f8e509" fill-rule="evenodd" d="M261.4 405.4l229.8-149.2L260 106.6l-230.7 150 232 148.8z"/><path fill="#2b49a3" fill-rule="evenodd" d="M361.5 256a97.2 97.2 0 1 1-194.3-.2 97.2 97.2 0 0 1 194.3.2z"/><path fill="#ffffef" fill-rule="evenodd" d="M232.3 314.2l-3-1.8-3.1 1.6.7-3.5-2.4-2.5 3.4-.4 1.6-3.2 1.5 3.3 3.4.6-2.6 2.4m65.7 20l-3-1.8-3.2 1.6.7-3.5-2.4-2.5 3.5-.4 1.6-3.2 1.4 3.3 3.4.6-2.5 2.4m-27.6-22.9l-2.6-1.5-2.7 1.3.6-3-2-2.2 2.9-.3 1.4-2.7 1.2 2.8 3 .5-2.2 2m66.2-6.4l-2.6-1.5-2.6 1.3.6-2.9-2-2.1 2.9-.4 1.3-2.6 1.3 2.7 2.9.5-2.2 2m-66.6-16.7l-3-1.8-3.1 1.6.7-3.5-2.4-2.5 3.4-.4 1.6-3.1 1.5 3.2 3.4.6-2.6 2.4M188 245l-3-1.8-3 1.6.6-3.5-2.4-2.5 3.5-.4 1.6-3.2 1.4 3.3 3.4.6-2.5 2.4m10.1 43.5l-3-1.7-3.1 1.5.7-3.4-2.4-2.6 3.4-.4 1.6-3 1.5 3.1 3.4.7-2.6 2.3m100.6-51.3l-2.6-1.5-2.8 1.3.6-3-2-2.3 3-.3 1.4-2.8 1.3 2.9 3 .5-2.3 2.1m-5 29.2L290 255l-2.1 1 .4-2.4-1.6-1.7 2.4-.3 1.1-2.2 1 2.3 2.4.4-1.8 1.6m-108.4 38.5l-2-1.2-2.1 1 .4-2.3-1.6-1.7 2.4-.2 1-2 1 2 2.3.5-1.7 1.6m152.6 11.5l-1.7-.8-1.7.7.4-1.7-1.3-1.3 1.9-.2.9-1.5.7 1.6 1.9.3-1.4 1.2"/><path fill="#ffffef" fill-rule="evenodd" d="M183.5 292.3l-2-1.2-2.1 1 .5-2.3-1.7-1.7 2.3-.2 1.1-2 1 2 2.3.5-1.7 1.6"/><path fill="#ffffef" fill-rule="evenodd" d="M183.5 292.3l-2-1.2-2.1 1 .5-2.3-1.7-1.7 2.3-.2 1.1-2 1 2 2.3.5-1.7 1.6m32.2 2.3l-2-1.2-2 1 .4-2.3-1.6-1.7 2.3-.2 1-2.1 1 2.1 2.3.5-1.7 1.6m-3.7 13l-2-1.2-2 1 .4-2.3-1.6-1.7 2.3-.3 1-2 1 2 2.3.5-1.7 1.6m66.7-17l-2-1.2-2.1 1 .4-2.3-1.6-1.7 2.3-.2 1.1-2.1 1 2.1 2.2.4-1.7 1.6m-19.1 2.4l-2-1.2-2.1 1 .5-2.3-1.6-1.7 2.3-.2 1-2.1 1 2.1 2.3.4-1.7 1.6m-52.5-4.4l-1.2-.7-1.3.6.2-1.5-1-1 1.5-.2.7-1.3.5 1.4 1.5.2-1 1M333.2 310l-2-1.1-2.1 1 .5-2.3-1.6-1.7 2.3-.3 1-2 1 2 2.3.5-1.7 1.6m-16 4.4l-1.6-1-1.7 1 .4-2-1.4-1.4 2-.2.8-1.7.8 1.7 2 .4-1.5 1.3m8 1.8l-1.6-1-1.6.9.3-1.8-1.2-1.3 1.8-.2.8-1.6.7 1.6 1.8.3-1.3 1.3m22.2-17.4l-1.5-.9-1.6.8.4-1.7-1.2-1.3 1.7-.2.8-1.5.7 1.6 1.7.3-1.3 1.2M317 322.9l-2-1.1-2 1 .5-2.2-1.6-1.5 2.2-.3 1.1-1.9 1 2 2.1.4-1.6 1.4m.4 10.9l-1.8-1-1.8.9.4-2.2-1.4-1.5 2-.3 1-1.9.8 2 2 .4-1.5 1.4M302.3 312l-1.5-.9-1.6.8.4-1.8-1.2-1.2 1.7-.2.8-1.6.7 1.6 1.7.3-1.3 1.2m-13.5 1.8l-1.5-.9-1.6.8.4-1.8-1.2-1.2 1.7-.2.8-1.6.7 1.6 1.7.3-1.2 1.2M265 291.4l-1.5-.9-1.6.8.4-1.7-1.2-1.3 1.7-.2.8-1.5.7 1.6 1.7.3-1.3 1.1m2.9 43.5l-1.3-.7-1.3.7.3-1.5-1-1 1.4-.3.7-1.3.6 1.4 1.5.2-1.1 1m-35.2-66l-3-1.7-3.1 1.5.7-3.4-2.4-2.6 3.4-.4 1.6-3.1 1.5 3.2 3.4.6-2.6 2.4"/><path fill="#fff" fill-rule="evenodd" d="M355.1 291a95 95 0 0 0 4.4-15.1c-51.6-45.4-109.2-68.7-182-63.9a95 95 0 0 0-6.4 15.9 233 233 0 0 1 184 63z"/><path fill="#309e3a" d="M331.9 265.4l1.8 1a2.6 2.6 0 0 0-.2 1.8c.1.4.5.9 1 1.2.6.4 1.1.6 1.6.6.4 0 .8-.3 1-.6.1-.2.2-.4.1-.7l-.3-.8-1.2-1.3a5.9 5.9 0 0 1-1.4-2.3 2.8 2.8 0 0 1 1.6-3.3 2.9 2.9 0 0 1 1.7-.2 5.3 5.3 0 0 1 2 .9 6 6 0 0 1 2 2.4 3 3 0 0 1-.5 2.6l-1.8-1.1c.2-.5.3-1 .2-1.4-.1-.3-.5-.7-1-1-.5-.4-1-.5-1.4-.5a.8.8 0 0 0-.6.3.8.8 0 0 0-.1.7c0 .4.5 1 1.2 1.7l1.5 2a3 3 0 0 1-.2 3.2 3.1 3.1 0 0 1-1.4 1.1 3 3 0 0 1-1.9.2 6 6 0 0 1-2.1-1 4.6 4.6 0 0 1-2-2.5c-.3-.9-.2-1.9.4-3zm-8.8-5.7l2 1a2.6 2.6 0 0 0-.2 1.6c.1.5.5 1 1 1.3.6.4 1.1.5 1.6.4.4 0 .8-.2 1-.6a1 1 0 0 0 .1-.6c0-.3-.1-.5-.4-.8l-1.2-1.3a6 6 0 0 1-1.5-2.2 2.8 2.8 0 0 1 .3-2.4 2.8 2.8 0 0 1 1.2-1 3 3 0 0 1 1.7-.2c.6 0 1.2.3 2 .8 1 .7 1.8 1.4 2 2.3a3 3 0 0 1-.3 2.6l-1.9-1.1c.3-.5.3-1 .2-1.3-.2-.4-.5-.7-1-1a2.4 2.4 0 0 0-1.5-.5.8.8 0 0 0-.6.4.8.8 0 0 0 0 .7c0 .3.5.9 1.2 1.7.8.7 1.3 1.4 1.6 1.8a3 3 0 0 1-.1 3.3 3.2 3.2 0 0 1-3.2 1.4 6.1 6.1 0 0 1-2.2-.9 4.7 4.7 0 0 1-2.1-2.4 4.1 4.1 0 0 1 .3-3zm-10.8-3l5.6-9 6.7 4-1 1.6-4.8-3-1.3 2 4.6 2.8-1 1.6-4.5-2.8-1.5 2.5 5 3-.9 1.6-6.9-4.2zm-15.8-12.9l.9-1.6 4 2.2-1.9 3.7a7.2 7.2 0 0 1-4.8-.6 5.8 5.8 0 0 1-2.2-2 4.5 4.5 0 0 1-.8-2.6c0-1 .3-1.9.8-2.8a6.1 6.1 0 0 1 2-2.3c.7-.6 1.7-.9 2.7-.9.7 0 1.6.3 2.5.7a5 5 0 0 1 2.3 2.2c.4.8.5 1.7.3 2.7l-2.1-.6a2.2 2.2 0 0 0-.2-1.5 2.5 2.5 0 0 0-1.2-1.1 2.9 2.9 0 0 0-2.4-.3c-.7.3-1.4 1-2 2a4.8 4.8 0 0 0-.5 3c.2.8.7 1.4 1.6 1.8l1.3.4h1.3l.6-1.2-2.2-1.2zm-68.8-17l1.6-10.6 3.2.5.8 7.5 3-7 3.1.5-1.5 10.6-2-.3 1.2-8.3-3.3 8-2-.3-.9-8.7-1.2 8.4-2-.3zm-10.7-1.3l1-10.6 7.8.7-.1 1.8-5.8-.5-.2 2.3 5.3.5-.1 1.8-5.3-.5-.3 3 5.9.5-.2 1.8-8-.8z"/><g stroke-opacity=".5"><path fill="#309e3a" d="M181.4 218.8c0-1 .2-2 .5-2.7l1-1.4 1.5-1a5.8 5.8 0 0 1 2.3-.3 5 5 0 0 1 3.7 1.6c1 1 1.3 2.3 1.3 4 0 1.8-.6 3.1-1.5 4a5 5 0 0 1-3.8 1.4 5 5 0 0 1-3.7-1.5 5 5 0 0 1-1.3-4z"/><path fill="#f7ffff" d="M183.6 218.8c0 1.2.2 2.2.8 2.8.5.7 1.2 1 2 1a3 3 0 0 0 2.2-.9c.5-.6.8-1.5.9-2.7 0-1.3-.2-2.2-.8-2.8a2.7 2.7 0 0 0-2-1c-1 0-1.7.3-2.2.9-.6.6-.9 1.5-1 2.7z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M194 224.4l.1-10.7h4.5c1.2 0 2 .2 2.5.4s1 .5 1.2 1 .5 1 .5 1.7c0 .8-.3 1.4-.7 2-.5.5-1.2.8-2.2 1 .5.2.9.5 1.2.8l1.2 1.8 1.3 2H201l-1.5-2.3a16 16 0 0 0-1.2-1.6 1.6 1.6 0 0 0-.6-.4 3.5 3.5 0 0 0-1-.2h-.5v4.5H194z"/><path fill="#fff" d="M196.2 218.2h1.6a8.1 8.1 0 0 0 2 0l.5-.5c.2-.2.3-.5.3-.8 0-.4-.1-.7-.3-.9a1.3 1.3 0 0 0-.8-.4h-3.2v2.6z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M206.2 214.2l3.9.2a7.6 7.6 0 0 1 2 .3 4 4 0 0 1 1.5 1 5 5 0 0 1 1 1.9c.2.7.2 1.5.2 2.5a5.3 5.3 0 0 1-1.7 4.1c-.4.3-.9.6-1.5.8h-2l-4-.1.6-10.7z"/><path fill="#fff" d="M208.2 216.1l-.3 7 1.6.2h1.3l.9-.5c.3-.2.4-.5.6-1l.3-2-.1-1.8c-.2-.5-.3-.8-.6-1a2 2 0 0 0-1-.6 9.6 9.6 0 0 0-1.7-.2h-1z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M258.5 233.3l2.5-10.4 3.3.8c1.3.3 2.1.6 2.5.8.5.3 1 .7 1.2 1.3.3.7.3 1.4.1 2.2a3 3 0 0 1-1.9 2.3 3 3 0 0 1-1.1.3 12 12 0 0 1-2.2-.4l-1.4-.3-1 3.9-2-.5z"/><path fill="#fff" d="M262.6 225.2l-.7 3 1.2.2c.8.2 1.4.3 1.7.2a1.4 1.4 0 0 0 1.2-1l-.1-1.1a1.5 1.5 0 0 0-.8-.7l-1.5-.4-1-.2z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M268.4 236.3l3.5-10.1 4.3 1.5a8 8 0 0 1 2.2 1c.4.4.7.9.9 1.5s0 1.1-.2 1.7c-.2.8-.7 1.3-1.3 1.6a3 3 0 0 1-2.3.3l.8 1.2.6 2 .5 2.4-2.4-.8-.7-2.7a14.5 14.5 0 0 0-.6-1.9 1.6 1.6 0 0 0-.4-.6 3.4 3.4 0 0 0-1-.5l-.4-.1-1.5 4.2-2-.7z"/><path fill="#fff" d="M272.4 231.2l1.5.5 1.9.5c.3 0 .5 0 .7-.2l.5-.7v-1a1.3 1.3 0 0 0-.6-.6l-1.5-.5-1.6-.6-.9 2.6z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M280.9 235.9a6.8 6.8 0 0 1 1.3-2.5c.3-.5.8-.8 1.3-1.1a4.2 4.2 0 0 1 1.6-.5c.7 0 1.5 0 2.3.3a5 5 0 0 1 3.2 2.5c.6 1.2.7 2.7.1 4.3a5.6 5.6 0 0 1-2.5 3.5 5 5 0 0 1-4 .2 5 5 0 0 1-3.2-2.5 5.5 5.5 0 0 1-.1-4.2z"/><path fill="#fff" d="M283 236.5c-.3 1.1-.3 2 0 2.8.4.8 1 1.3 1.8 1.6.8.2 1.5.1 2.2-.3.7-.4 1.3-1.2 1.7-2.4.3-1.2.3-2.1 0-2.9a2.7 2.7 0 0 0-1.8-1.5 2.7 2.7 0 0 0-2.3.3c-.7.4-1.2 1.2-1.6 2.4z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M301.7 250.8l4.9-9.5 4 2c1 .6 1.7 1 2 1.4.4.5.6 1 .7 1.5s0 1.2-.4 1.7c-.3.7-.8 1.2-1.5 1.5-.7.2-1.4.2-2.3-.1.3.4.5.9.6 1.3l.3 2.1.2 2.5-2.3-1.2-.3-2.8-.3-2a1.6 1.6 0 0 0-.4-.6 3.5 3.5 0 0 0-.9-.6l-.4-.2-2 4-1.9-1z"/><path fill="#fff" d="M306.4 246.3l1.4.7 1.8.8c.3 0 .5 0 .7-.2a1.5 1.5 0 0 0 .8-1.5 1.3 1.3 0 0 0-.6-.7 21 21 0 0 0-1.3-.8l-1.5-.7-1.3 2.4z"/></g><g stroke-opacity=".5"><path fill="#309e3a" d="M341.2 270.3c.6-1 1.2-1.6 2-2a5 5 0 0 1 1.6-.7 4.2 4.2 0 0 1 1.6 0c.7.1 1.5.4 2.2 1a5 5 0 0 1 2.3 3.3 6 6 0 0 1-1.1 4.1 5.6 5.6 0 0 1-3.5 2.6 5 5 0 0 1-3.9-.9 5 5 0 0 1-2.3-3.3 5.5 5.5 0 0 1 1-4.1z"/><path fill="#fff" d="M343 271.4c-.6 1-.9 2-.8 2.8a3 3 0 0 0 1.3 2 2.7 2.7 0 0 0 2.2.4c.8-.2 1.6-.8 2.3-1.9.7-1 1-1.9.8-2.7 0-.8-.5-1.4-1.2-2s-1.5-.6-2.3-.4c-.8.2-1.5.8-2.2 1.8z"/></g><path fill="#309e3a" d="M246.4 229l1.7-7.6 5.6 1.3-.3 1.3-4-1-.4 1.7 3.7.9-.3 1.3-3.7-1-.5 2.1 4.2 1-.3 1.3-5.7-1.3z"/></g></svg>';case"flag-pt-pt":return'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><path fill="red" d="M204.8 0H512v512H204.7z"/><path fill="#060" d="M0 0h204.8v512H-.1z"/><g fill="#ff0" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width=".6"><path stroke-width=".7" d="M293.8 326.6c-34.4-1-192-99.4-193-115.1l8.6-14.5C125 219.7 286.2 315.4 302 312l-8.2 14.6"/><path stroke-width=".7" d="M107.6 195c-3.1 8.3 41.1 35.6 94.3 68 53.2 32.3 99 52.3 102.5 49.5l1.5-2.9c-.6 1-2.2 1.3-4.6.6-14.4-4.2-51.9-21.4-98.3-49.5s-86.8-54.1-93-65.1a6.7 6.7 0 0 1-.7-3.3h-.2l-1.3 2.3-.2.4zm187 132c-.6 1.1-1.7 1.1-3.7 1-12.9-1.5-52-20.5-98-48.1-53.8-32.2-98.2-61.5-93.3-69.1l1.3-2.4.2.1c-4.3 13 87.6 65.5 93 68.9 53.1 33 98 52.2 102 47.2l-1.5 2.4z"/><path stroke-width=".7" d="M205 221c34.3-.3 76.8-4.7 101.2-14.4L301 198c-14.5 8-57.1 13.3-96.3 14-46.4-.4-79.1-4.7-95.5-15.7l-5 9.1c30.2 12.7 61 15.5 100.8 15.6"/><path stroke-width=".7" d="M307.7 206.8c-.9 1.3-16.8 6.8-40.3 10.8a416 416 0 0 1-62.6 4.6 444.3 444.3 0 0 1-60-3.8c-24.5-3.9-37.3-9.3-42-11.2l1.2-2.3a186 186 0 0 0 41.3 11 438.9 438.9 0 0 0 59.5 3.7 417.8 417.8 0 0 0 62.1-4.6c24-3.9 37.2-8.9 39-11.2l1.8 3zM303 198c-2.6 2-15.6 6.7-38.4 10.3a414 414 0 0 1-59.5 4.2 400 400 0 0 1-57.4-3.7c-23.3-3-35.6-8.5-40-10.1l1.3-2.3c3.4 1.8 15.4 6.6 39 10a423 423 0 0 0 57.1 3.5 408.6 408.6 0 0 0 59-4.2c23-3.2 35.4-9 37.3-10.5l1.6 2.8zM92 262.4c21.2 11.4 68.1 17.2 112.6 17.6 40.5 0 93.3-6.3 113-16.8l-.6-11.4c-6.1 9.7-62.6 19-112.8 18.6-50.2-.4-96.8-8.2-112.3-18.2v10.2"/><path stroke-width=".7" d="M318.7 260.8v2.7c-3 3.6-21.6 9-44.9 12.7a463.2 463.2 0 0 1-69.7 4.8c-27.4 0-49.2-2-66.2-4.6a164.8 164.8 0 0 1-47.3-12.7v-3.2c10.4 6.9 38.3 11.9 47.7 13.4 16.8 2.6 38.5 4.5 65.8 4.5 28.7 0 51.7-2 69.3-4.7 16.8-2.4 40.6-8.7 45.3-12.9zm0-9.7v2.8c-3 3.5-21.6 8.9-44.9 12.6a463.2 463.2 0 0 1-69.7 4.8c-27.4 0-49.2-2-66.1-4.5A165 165 0 0 1 90.6 254v-3.2c10.4 6.9 38.3 12 47.7 13.4 16.9 2.6 38.6 4.6 65.8 4.6 28.7 0 51.7-2 69.3-4.8 16.8-2.4 40.6-8.7 45.3-12.9zm-114.2 73.5c-48.6-.3-90.3-13.2-99.1-15.4l6.4 10c15.5 6.6 56.2 16.4 93.2 15.3s69.3-4 92-15l6.6-10.5c-15.5 7.3-68.3 15.6-99 15.6"/><path d="M299.5 317.1a152.6 152.6 0 0 1-3 4.4 258.9 258.9 0 0 1-34.7 8.9 315 315 0 0 1-57.2 5.2c-43.1-.6-78.4-9-95-16.2l-1.4-2.3.3-.4 2.2.9a305.5 305.5 0 0 0 94.1 15.5c20 .1 40-2.3 56.1-5.1 24.8-5 34.8-8.7 37.9-10.4l.7-.5zm5.7-9.4h.1a302 302 0 0 1-2.2 3.8c-5.7 2-21.3 6.6-44 9.8-15 2-24.3 4-54 4.6a371 371 0 0 1-100.5-15l-1.2-2.5a424.4 424.4 0 0 0 101.7 15c27.2-.6 38.8-2.6 53.6-4.7 26.5-4 39.8-8.4 43.8-9.7a3 3 0 0 0-.1-.2l2.8-1.1z"/><path stroke-width=".7" d="M305.8 253.4c.2 32-16.2 60.8-29.4 73.5a106 106 0 0 1-72.3 30c-32.3.6-62.7-20.5-70.9-29.7-16-18.1-29-41-29.4-72 2-35 15.7-59.3 35.6-76a106.3 106.3 0 0 1 68.4-24.2c25.4.7 55.2 13.2 75.7 38 13.4 16.2 19.3 33.8 22.3 60.5zM204.4 143.8c62 0 113 50.5 113 112.3a113 113 0 0 1-113 112.3c-62 0-112.6-50.4-112.6-112.3s50.6-112.3 112.6-112.3"/><path stroke-width=".7" d="M204.7 143.4c62 0 112.6 50.7 112.6 112.7s-50.6 112.7-112.6 112.7A113 113 0 0 1 92 256a113 113 0 0 1 112.7-112.7zM94.5 256.1c0 60.6 49.8 110.2 110.2 110.2 60.4 0 110.1-49.6 110.1-110.2S265.1 146 204.7 146A110.6 110.6 0 0 0 94.5 256.1z"/><path stroke-width=".7" d="M204.8 152.8c56.5 0 103.1 46.5 103.1 103.2 0 56.8-46.6 103.2-103.1 103.2A103.6 103.6 0 0 1 101.5 256c0-56.7 46.6-103.2 103.2-103.2zM104 256c0 55.4 45.5 100.7 100.8 100.7 55.2 0 100.7-45.3 100.7-100.7 0-55.4-45.5-100.7-100.8-100.7S104 200.6 104 256z"/><path stroke-width=".7" d="M209.3 143h-9.7v226.4h9.7z"/><path stroke-width=".7" d="M208.3 141.7h2.5v229h-2.5v-229zm-9.6 0h2.5v229h-2.5v-229z"/><path stroke-width=".7" d="M317.4 260.5V252l-6.8-6.3-38.7-10.3-55.8-5.7-67 3.4-47.9 11.4-9.6 7.2v8.3l24.4-11 58-9h55.8l41 4.5 28.4 6.9z"/><path stroke-width=".7" d="M204.7 238.7a394 394 0 0 1 72.9 6.5c21.1 4.2 36 9.5 41 15.4v3c-6-7.4-26-12.8-41.5-16-20.3-3.9-46-6.4-72.4-6.4-28 0-54 2.7-74 6.6-16 3.2-37.4 9.5-40.1 15.8v-3c1.5-4.4 17.4-10.9 39.8-15.4a405 405 0 0 1 74.3-6.5zm0-9.7a396 396 0 0 1 73 6.5c21 4.2 36 9.5 41 15.5v2.9c-6.1-7.4-26.2-12.8-41.6-15.9-20.3-4-46-6.5-72.4-6.5a402 402 0 0 0-73.8 6.6c-15.5 3-37.8 9.6-40.3 15.8v-3c1.5-4.3 17.8-11 39.8-15.3a405 405 0 0 1 74.3-6.6zm-.5-49.3c41.9-.2 78.5 5.9 95.2 14.5l6.1 10.5c-14.5-7.8-54-16-101.3-14.7-38.5.2-79.6 4.2-100.3 15.2l7.3-12.2c17-8.8 57-13.2 93-13.3"/><path stroke-width=".7" d="M204.7 188.4c24 0 47 1.3 65.4 4.6 17.1 3.2 33.5 8 35.8 10.6l1.8 3.2c-5.7-3.7-19.8-7.9-38-11.3a367.2 367.2 0 0 0-65-4.5c-27 0-48 1.3-66 4.5-19 3.5-32.2 8.6-35.5 11l1.8-3.3c6.3-3.3 16.4-7.2 33.3-10.2 18.6-3.4 39.7-4.4 66.4-4.6zm0-9.6a371 371 0 0 1 63.1 4.4c13.9 2.7 27.6 6.9 32.7 10.6l2.6 4.2c-4.5-5-21.4-9.7-36.4-12.3-17.4-3-39.1-4.2-62-4.4-24 0-46.2 1.5-63.4 4.6-16.4 3.2-27 6.9-31.5 9.8l2.3-3.6c6.2-3.2 16.2-6.2 28.8-8.7 17.3-3.1 39.7-4.6 63.8-4.6zm56 124.1a293.3 293.3 0 0 0-56-4.2c-69.9.8-92.4 14.3-95.2 18.4l-5.2-8.5C122 295.7 160 288.5 205 289.2c23.3.4 43.4 2 60.4 5.2l-4.8 8.5"/><path d="M204.3 297.5c19.4.3 38.5 1 57 4.5l-1.4 2.4a297.6 297.6 0 0 0-55.5-4.3c-25.8-.2-52 2.2-74.6 8.7-7.2 2-19 6.6-20.3 10.4l-1.3-2.2c.4-2.2 7.6-6.9 21-10.6 26-7.5 50.3-8.7 75-9zm.9-9.8a351 351 0 0 1 61.1 5.3l-1.4 2.5a319 319 0 0 0-59.6-5.2c-25.9 0-53.3 1.9-78.3 9.1-8 2.4-22 7.4-22.4 11.4l-1.3-2.3c.3-3.6 12.3-8.4 23.2-11.6a285 285 0 0 1 78.7-9.2z"/><path stroke-width=".7" d="M304.4 309.9l-8.4 13-24.1-21.4-62.6-42-70.5-38.8-36.7-12.5 7.8-14.5 2.7-1.4 22.8 5.7 75 38.7 43.3 27.3 36.3 26 14.8 17.1z"/><path stroke-width=".7" d="M100.8 208.5c6.5-4.3 53.7 16.7 103 46.5 49.3 29.9 96.4 63.6 92.2 70l-1.4 2.1-.7.5c.2 0 .9-1 0-3.3-2.2-6.9-35.5-33.5-91-67-54-32.2-99-51.6-103.5-46l1.4-2.8zm205.3 101.2c4-8-39.7-41-94-73.1-55.5-31.5-95.6-50-102.9-44.5l-1.6 3c0 .1 0-.2.4-.5 1.3-1.1 3.5-1 4.5-1 12.6.1 48.6 16.6 99 45.6 22.1 12.8 93.4 58.6 93.1 71.4 0 1.1.1 1.3-.3 1.9l1.8-2.8z"/></g><g transform="translate(-68.3 28.4) scale(1.13778)"><path fill="#fff" stroke="#000" stroke-width=".7" d="M180.6 211a58.7 58.7 0 0 0 17.5 41.7 59 59 0 0 0 41.8 17.6 59.4 59.4 0 0 0 42-17.4 59 59 0 0 0 17.4-41.8v-79.2l-118.7-.2V211z"/><path fill="red" stroke="#000" stroke-width=".5" d="M182.8 211.1a56.4 56.4 0 0 0 16.8 40 57 57 0 0 0 40.2 16.8 56.9 56.9 0 0 0 40.2-16.6 56.4 56.4 0 0 0 16.7-40v-77H183v76.8m91-53.7v48.9l-.1 5.1a33.2 33.2 0 0 1-10 24 34 34 0 0 1-24 10c-9.4 0-17.7-4-23.9-10.2a34 34 0 0 1-10-24v-54l68 .2z"/><g id="e"><g id="d" fill="#ff0" stroke="#000" stroke-width=".5"><path stroke="none" d="M190.2 154.4c.1-5.5 4-6.8 4-6.8.1 0 4.3 1.4 4.3 6.9h-8.3"/><path d="M186.8 147.7l-.7 6.3h4.2c0-5.2 4-6 4-6 .1 0 4 1.1 4.1 6h4.2l-.8-6.4h-15zm-1 6.4h17c.3 0 .6.3.6.7 0 .5-.3.8-.6.8h-17c-.3 0-.6-.3-.6-.8 0-.4.3-.7.7-.7z"/><path d="M192 154c0-3.3 2.3-4.2 2.3-4.2s2.3 1 2.3 4.2H192m-5.8-9h16.3c.3 0 .6.4.6.8 0 .3-.3.6-.6.6h-16.3c-.3 0-.6-.3-.6-.7 0-.3.3-.6.6-.6zm.4 1.5H202c.3 0 .6.3.6.7 0 .4-.3.7-.6.7h-15.5c-.4 0-.6-.3-.6-.7 0-.4.2-.7.6-.7zm5-10.6h1.2v.8h.9v-.8h1.3v.9h.9v-1h1.2v2c0 .4-.2.6-.5.6h-4.4c-.3 0-.6-.2-.6-.5v-2zm4.6 2.7l.3 6.4h-4.3l.3-6.5h3.7"/><path id="a" d="M191 141.6v3.4h-4v-3.4h4z"/><use width="100%" height="100%" x="10.6" xlink:href="#a"/><path id="b" d="M186.3 139h1.2v1h.9v-1h1.2v1h.9v-1h1.2v2c0 .4-.2.6-.5.6h-4.3a.6.6 0 0 1-.6-.6v-2z"/><use width="100%" height="100%" x="10.6" xlink:href="#b"/><path fill="#000" stroke="none" d="M193.9 140.6c0-.6.9-.6.9 0v1.6h-.9v-1.6"/><path id="c" fill="#000" stroke="none" d="M188.6 142.8c0-.6.8-.6.8 0v1.2h-.8v-1.2"/><use width="100%" height="100%" x="10.6" xlink:href="#c"/></g><use width="100%" height="100%" y="46.3" xlink:href="#d"/><use width="100%" height="100%" transform="rotate(-45.2 312.8 180)" xlink:href="#d"/></g><use width="100%" height="100%" x="45.7" xlink:href="#d"/><use width="100%" height="100%" transform="matrix(-1 0 0 1 479.8 0)" xlink:href="#e"/><g id="f" fill="#fff"><path fill="#039" d="M232.6 202.4a8.3 8.3 0 0 0 2.2 5.7 7.2 7.2 0 0 0 5.3 2.4c2.1 0 4-1 5.3-2.4a8.3 8.3 0 0 0 2.2-5.7v-10.8h-15v10.8"/><circle cx="236.1" cy="195.7" r="1.5"/><circle cx="244.4" cy="195.7" r="1.5"/><circle cx="240.2" cy="199.7" r="1.5"/><circle cx="236.1" cy="203.9" r="1.5"/><circle cx="244.4" cy="203.9" r="1.5"/></g><use width="100%" height="100%" y="-26" xlink:href="#f"/><use width="100%" height="100%" x="-20.8" xlink:href="#f"/><use width="100%" height="100%" x="20.8" xlink:href="#f"/><use width="100%" height="100%" y="25.8" xlink:href="#f"/></g></svg>';case"flag-not-found":return'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="none" viewBox="0 0 10 10"><path fill="#DEE3ED" d="M0 0h10v10H0z"/><path fill="#5E636E" d="M4.363 6.254c0-.365.045-.655.133-.871.089-.216.25-.429.484-.637.237-.21.395-.381.473-.512a.812.812 0 0 0 .117-.418c0-.44-.203-.66-.61-.66a.62.62 0 0 0-.464.18c-.114.117-.174.28-.18.488H3.184c.005-.497.165-.886.48-1.168.318-.281.75-.422 1.297-.422.552 0 .98.134 1.285.403.305.265.457.642.457 1.129 0 .221-.05.43-.148.629-.1.195-.272.412-.52.652l-.316.3c-.198.19-.311.413-.34.669l-.016.238h-1zm-.113 1.2c0-.175.059-.319.176-.43a.634.634 0 0 1 .457-.172.62.62 0 0 1 .453.171c.12.112.18.256.18.43a.564.564 0 0 1-.176.426.626.626 0 0 1-.457.168.64.64 0 0 1-.461-.168.57.57 0 0 1-.172-.426z"/></svg>';case"lock":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M4.99967 18.3335C4.54134 18.3335 4.14898 18.1703 3.82259 17.8439C3.4962 17.5175 3.33301 17.1252 3.33301 16.6668V8.3335C3.33301 7.87516 3.4962 7.4828 3.82259 7.15641C4.14898 6.83002 4.54134 6.66683 4.99967 6.66683H5.83301V5.00016C5.83301 3.84739 6.23926 2.86475 7.05176 2.05225C7.86426 1.23975 8.8469 0.833496 9.99967 0.833496C11.1525 0.833496 12.1351 1.23975 12.9476 2.05225C13.7601 2.86475 14.1663 3.84739 14.1663 5.00016V6.66683H14.9997C15.458 6.66683 15.8504 6.83002 16.1768 7.15641C16.5031 7.4828 16.6663 7.87516 16.6663 8.3335V16.6668C16.6663 17.1252 16.5031 17.5175 16.1768 17.8439C15.8504 18.1703 15.458 18.3335 14.9997 18.3335H4.99967ZM4.99967 16.6668H14.9997V8.3335H4.99967V16.6668ZM9.99967 14.1668C10.458 14.1668 10.8504 14.0036 11.1768 13.6772C11.5031 13.3509 11.6663 12.9585 11.6663 12.5002C11.6663 12.0418 11.5031 11.6495 11.1768 11.3231C10.8504 10.9967 10.458 10.8335 9.99967 10.8335C9.54134 10.8335 9.14898 10.9967 8.82259 11.3231C8.4962 11.6495 8.33301 12.0418 8.33301 12.5002C8.33301 12.9585 8.4962 13.3509 8.82259 13.6772C9.14898 14.0036 9.54134 14.1668 9.99967 14.1668ZM7.49967 6.66683H12.4997V5.00016C12.4997 4.30572 12.2566 3.71544 11.7705 3.22933C11.2844 2.74322 10.6941 2.50016 9.99967 2.50016C9.30523 2.50016 8.71495 2.74322 8.22884 3.22933C7.74273 3.71544 7.49967 4.30572 7.49967 5.00016V6.66683Z" fill="currentColor"/>\n</svg>\n';case"diamond":return'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M3.53845 1.86703C3.6317 1.7312 3.78589 1.65002 3.95065 1.65002H12.2095C12.3784 1.65002 12.536 1.73536 12.6283 1.87688L14.64 4.96142C14.7516 5.13247 14.7479 5.35418 14.6308 5.52144L8.59546 14.1369C8.50312 14.2687 8.35296 14.348 8.19202 14.35C8.03108 14.3519 7.87904 14.2763 7.78352 14.1468L1.43059 5.53131C1.30417 5.35987 1.30024 5.12718 1.4208 4.95157L3.53845 1.86703ZM3.95065 3.03343L5.11854 4.73457H2.78277L3.95065 3.03343ZM2.82294 5.73457L7.103 11.5389L5.67632 5.73457H2.82294ZM7.01806 4.73457L8.18595 3.03343L9.35386 4.73457H7.01806ZM9.66585 5.73457L8.18595 11.7553L6.70608 5.73457H9.66585ZM9.30915 11.3752L10.6956 5.73457H13.2605L9.30915 11.3752ZM13.2982 4.73457H11.2003L12.2209 3.08279L13.2982 4.73457ZM11.3128 2.65002H9.13571L10.2816 4.31903L11.3128 2.65002ZM7.23619 2.65002H4.90041L6.0683 4.35116L7.23619 2.65002Z" fill="currentColor"/>\n</svg>\n';case"briefcase":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M11.7809 2.50275C12.9831 2.50285 13.9587 3.47041 13.9587 4.6629V4.93829H16.8249C17.6572 4.93829 18.3297 5.61329 18.3298 6.43048V16.0047C18.3296 16.8302 17.6487 17.4969 16.8249 17.4969H3.17157C2.33933 17.4969 1.66681 16.8219 1.66669 16.0047V6.43048C1.66679 5.60497 2.34773 4.93831 3.17157 4.93829H6.01337V4.6629C6.01337 3.47035 6.98885 2.50275 8.1911 2.50275H11.7809ZM16.6315 11.2176C15.0089 11.9681 12.696 12.6516 10.0309 12.6766C7.29857 12.6766 4.99578 11.9848 3.33954 11.2176V15.8211H16.6315V11.2176ZM6.00458 6.60626V6.61407H3.33954V9.35822C4.85286 10.1588 7.17246 11.0086 10.0309 11.0086C12.8304 10.9836 15.1518 10.1421 16.6315 9.35822V6.60626H6.00458ZM11.2429 8.61505C11.7052 8.61505 12.0837 8.99068 12.0837 9.44904C12.0836 9.90732 11.7051 10.282 11.2429 10.282H8.74677C8.2845 10.282 7.90602 9.90732 7.90594 9.44904C7.90594 8.99068 8.28445 8.61505 8.74677 8.61505H11.2429ZM8.18231 4.17072C7.91331 4.17076 7.68622 4.38773 7.68622 4.6629H7.67841V4.93829H12.2682V4.6629C12.2682 4.39604 12.0496 4.17072 11.7722 4.17072H8.18231Z" fill="currentColor"/>\n</svg>\n';case"color-palette":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5553 6.85544C18.7053 4.00544 16.6853 2.34543 15.8553 1.75543C13.0453 -0.224567 9.14527 -0.554564 5.93527 0.915437C1.65527 2.86544 -0.79473 7.80544 0.235269 12.3854C0.945269 15.5454 3.30527 18.2854 6.25527 19.3754C7.20527 19.7254 8.45527 19.9954 9.67527 19.9954C11.1253 19.9954 12.5253 19.6154 13.2653 18.5154C13.9144 17.5467 13.6559 16.6078 13.466 15.9181L13.4653 15.9154C13.3053 15.3354 13.2153 14.9554 13.3853 14.5154C13.6953 13.7354 14.5753 13.4054 15.9953 12.9454L16.0199 12.9374C17.514 12.4494 19.2086 11.8958 19.8153 10.1554C20.1953 9.05543 19.9253 8.13544 19.5353 6.85544H19.5553ZM17.9453 9.49544C17.6853 10.2554 16.8053 10.5854 15.4053 11.0354C13.9153 11.5154 12.2253 12.0654 11.5453 13.7654C11.1169 14.8412 11.3633 15.7583 11.5432 16.4276L11.5453 16.4354C11.7053 17.0254 11.7353 17.2054 11.6153 17.3754C11.1053 18.1254 8.84527 18.1754 6.94527 17.4854C4.61527 16.6354 2.74527 14.4554 2.18527 11.9454C1.37527 8.32544 3.38527 4.27543 6.76527 2.72543C7.84527 2.23543 9.01527 1.99544 10.1753 1.99544C11.7953 1.99544 13.3953 2.46544 14.7053 3.38544C15.2153 3.74544 16.9453 5.10544 17.6453 7.42544C17.9853 8.54544 18.1153 9.01544 17.9453 9.49544ZM8.6048 3.90543C7.8548 4.08543 7.3848 4.83543 7.5648 5.58543C7.7448 6.33543 8.4948 6.80544 9.2448 6.62544C9.9948 6.44544 10.4648 5.69544 10.2848 4.94544C10.1048 4.19544 9.3548 3.72543 8.6048 3.90543ZM12.1449 6.86543C11.9649 6.11543 12.4349 5.36543 13.1849 5.18543C13.9349 5.00543 14.6849 5.47543 14.8649 6.22543C15.0449 6.97543 14.5749 7.72543 13.8249 7.90543C13.0749 8.08543 12.3249 7.61543 12.1449 6.86543ZM6.31573 12.1755C5.56573 12.3555 5.09573 13.1055 5.27573 13.8555C5.45573 14.6055 6.20573 15.0755 6.95573 14.8955C7.70573 14.7155 8.17573 13.9655 7.99574 13.2155C7.81573 12.4655 7.06573 11.9955 6.31573 12.1755ZM6.79554 8.12543C6.97554 8.87543 6.50554 9.62543 5.75554 9.80543C5.00554 9.98543 4.25554 9.51543 4.07554 8.76543C3.89554 8.01543 4.36554 7.26543 5.11554 7.08543C5.86554 6.90543 6.61554 7.37543 6.79554 8.12543Z" fill="currentColor"/>\n</svg>\n';case"expand":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M5.49866 5.31242C5.80698 4.95472 6.33182 4.92907 6.67346 5.25187C7.01513 5.57478 7.04039 6.12453 6.73206 6.48234L4.39026 9.17863H7.80725L7.79065 9.18742C8.24891 9.18751 8.62366 9.58052 8.62366 10.0605C8.62358 10.5403 8.24886 10.9334 7.79065 10.9335H4.39905L6.71545 13.5341C7.03195 13.8832 7.00674 14.433 6.67346 14.7646C6.51517 14.9214 6.30691 14.9999 6.10706 14.9999C5.88209 14.9999 5.6653 14.9039 5.49866 14.7206L1.88245 10.6542C1.59078 10.3226 1.59078 9.80714 1.88245 9.4755L5.49866 5.31242ZM13.3405 5.2255C13.6821 4.90274 14.207 4.92926 14.5153 5.28703L18.1324 9.45011L18.1158 9.44133C18.4153 9.77289 18.4072 10.2876 18.1158 10.6191L14.4987 14.6864C14.332 14.8695 14.1151 14.9648 13.8903 14.9648C13.6903 14.9647 13.4822 14.8865 13.3239 14.7294C12.9905 14.4065 12.9652 13.848 13.2819 13.4989L15.5983 10.8984H12.2067C11.7485 10.8981 11.3737 10.5052 11.3737 10.0253C11.3738 9.54559 11.7486 9.15345 12.2067 9.15324H15.6237L13.2819 6.45597C12.9737 6.09815 12.9989 5.54834 13.3405 5.2255Z" fill="currentColor"/>\n</svg>\n';case"globe":return'\n<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n  <path d="M10 18.33c-1.14 0-2.22-.22-3.23-.66a8.33 8.33 0 01-2.66-1.79 8.33 8.33 0 01-1.79-2.77A8.17 8.17 0 011.67 10c0-1.15.22-2.23.66-3.24.44-1.01 1.04-1.89 1.8-2.65.76-.76 1.64-1.36 2.65-1.8A8.17 8.17 0 0110 1.67c1.15 0 2.23.22 3.24.66 1.01.44 1.89 1.04 2.65 1.8.76.76 1.36 1.64 1.8 2.65.44 1.01.66 2.09.66 3.24 0 1.14-.22 2.22-.66 3.23-.44 1.01-1.04 1.89-1.8 2.65-.76.76-1.64 1.36-2.65 1.8-1.01.44-2.09.66-3.24.66zm0-1.71c.36-.5.67-1.02.94-1.56.27-.54.49-1.12.65-1.73H8.42c.17.61.38 1.19.65 1.73.27.54.58 1.06.94 1.56zm-2.17-.33c-.25-.46-.47-.93-.65-1.42-.19-.49-.34-1-.47-1.53H4.25a6.58 6.58 0 003.58 2.95zm4.34 0a6.58 6.58 0 003.58-2.95H13.29c-.13.53-.28 1.04-.47 1.53-.19.49-.4.96-.65 1.42zM3.54 11.67h2.84c-.04-.28-.07-.55-.09-.83-.02-.27-.03-.55-.03-.84s.01-.57.03-.84c.02-.27.05-.54.09-.83H3.54c-.07.28-.12.55-.15.83-.04.27-.06.55-.06.84s.02.57.06.84c.03.28.08.55.15.83zm4.5 0h3.92c.04-.28.07-.55.09-.83.02-.27.03-.55.03-.84s-.01-.57-.03-.84c-.02-.27-.05-.54-.09-.83H8.04c-.04.28-.07.55-.09.83-.02.27-.03.55-.03.84s.01.57.03.84c.02.28.05.55.09.83zm5.58 0h2.84c.07-.28.12-.55.15-.83.04-.27.06-.55.06-.84s-.02-.57-.06-.84c-.03-.27-.08-.55-.15-.83h-2.84c.04.28.07.55.09.83.02.27.03.55.03.84s-.01.57-.03.84c-.02.28-.05.55-.09.83zM13.29 6.67h2.46a6.58 6.58 0 00-3.58-2.96c.25.46.47.93.65 1.42.19.49.34 1 .47 1.54zm-4.87 0h3.17c-.17-.61-.38-1.19-.65-1.73-.27-.54-.58-1.06-.94-1.56-.36.5-.67 1.02-.94 1.56-.27.54-.49 1.12-.65 1.73zm-4.17 0h2.46c.13-.54.28-1.05.47-1.54.18-.49.4-.96.65-1.42A6.58 6.58 0 004.25 6.67z" fill="currentColor"/>\n</svg>\n';case"goal":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M19.0205 5.72429C18.7808 5.22479 18.1914 5.01498 17.6919 5.24475C17.1924 5.48451 16.9826 6.07393 17.2124 6.57343C17.7119 7.64236 17.9716 8.78122 17.9716 9.98002C17.9716 14.3956 14.3853 17.982 9.96979 17.982C5.55431 17.982 1.96798 14.3956 1.96798 9.98002C1.96798 5.56444 5.55431 1.97803 9.96979 1.97803C11.7679 1.97803 13.4762 2.57743 14.8748 3.65635L13.0866 5.45455C12.1775 4.82518 11.1086 4.48552 9.97978 4.48552C6.94289 4.48552 4.47542 6.95305 4.47542 9.99001C4.47542 13.027 6.94289 15.4945 9.97978 15.4945C13.2187 15.4945 15.4841 12.7862 15.4841 9.68032C15.4542 9.13087 14.9647 8.7013 14.4252 8.74126C13.8758 8.77123 13.4562 9.24076 13.4862 9.8002C13.4862 11.7784 12.0439 13.5065 9.97978 13.5065C8.04176 13.5065 6.47337 11.9381 6.47337 10C6.47337 8.06195 8.04176 6.49351 9.97978 6.49351C10.5692 6.49351 11.1286 6.65335 11.6381 6.92308L9.28049 9.29071C8.89089 9.68032 8.89089 10.3097 9.28049 10.7093C9.68008 11.0889 10.2994 11.0889 10.699 10.7093L19.6599 1.72828C20.0495 1.33867 20.0495 0.709298 19.6599 0.319688C19.2703 -0.0699227 18.6409 -0.0699227 18.2513 0.319688L16.3233 2.25775C14.5451 0.79921 12.3274 0 9.99976 0C4.48541 0 0 4.48552 0 10C0 15.5145 4.48541 20 9.99976 20C15.5141 20 19.9995 15.5145 19.9995 10C19.9995 8.5115 19.6798 7.08292 19.0505 5.74425L19.0205 5.72429Z" fill="currentColor"/>\n</svg>\n';case"humanize":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 8.55342C2 5.35398 4.46808 2 9.31351 2C13.4898 2 16.627 5.13707 16.627 9.31351C16.627 10.1146 16.9151 10.9018 17.1952 11.5512C17.3127 11.8238 17.4413 12.0987 17.5613 12.3556L17.6396 12.5233L17.6922 12.6365H16.2969C15.7446 12.6365 15.2969 13.0843 15.2969 13.6365V16.6252C14.4855 16.6151 13.3601 16.6071 12.6389 16.627L12.6358 16.6271C12.2783 16.6381 11.9459 16.7895 11.7023 17.0305C11.4559 17.2743 11.3064 17.6035 11.3064 17.9596V18.9572C11.3064 19.5095 11.7541 19.9572 12.3064 19.9572C12.8587 19.9572 13.3064 19.5095 13.3064 18.9572V18.6164C14.127 18.6101 15.1588 18.6226 15.7722 18.632C16.6095 18.6448 17.2969 17.9699 17.2969 17.1308V14.6365H18.5059C19.4503 14.6365 20.3132 13.7779 19.882 12.6641C19.7525 12.3294 19.5992 11.9937 19.4528 11.6792L19.3682 11.4981C19.249 11.2428 19.1361 11.0014 19.0317 10.7593C18.7671 10.1455 18.627 9.67893 18.627 9.31351C18.627 4.03247 14.5944 0 9.31351 0C3.33838 0 0 4.27472 0 8.55342C0 10.6513 1.04103 12.2316 2.11301 13.5819L2.11514 13.5846C2.96945 14.6607 3.8189 15.7613 4.00748 17.2948C4.05705 17.6979 4.03866 18.0965 4.01822 18.5395C4.01186 18.6774 4.00529 18.8198 4.00052 18.9678C3.98272 19.5198 4.41577 19.9817 4.96777 19.9995C5.51977 20.0173 5.98168 19.5842 5.99948 19.0322C6.00236 18.943 6.00726 18.8412 6.01263 18.7298C6.03486 18.2682 6.06509 17.6408 5.99252 17.0507C5.73069 14.9214 4.54621 13.4299 3.71505 12.3833L3.67944 12.3384C2.6651 11.0607 2 9.93873 2 8.55342Z" fill="currentColor"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M6 10C6.19911 10 6.39142 9.97091 6.57292 9.91673L8.25589 12.0205C8.09295 12.31 8 12.6441 8 13C8 14.1046 8.89543 15 10 15C11.1046 15 12 14.1046 12 13C12 12.5398 11.8445 12.1158 11.5833 11.7778L12.6414 9.96793C12.7577 9.989 12.8776 10 13 10C14.1046 10 15 9.10457 15 8C15 6.89543 14.1046 6 13 6C12.1607 6 11.4421 6.51704 11.1454 7.25L7.85462 7.25C7.55793 6.51704 6.83935 6 6 6C4.89543 6 4 6.89543 4 8C4 9.10457 4.89543 10 6 10ZM6 8.5C6.27614 8.5 6.5 8.27614 6.5 8C6.5 7.72386 6.27614 7.5 6 7.5C5.72386 7.5 5.5 7.72386 5.5 8C5.5 8.27614 5.72386 8.5 6 8.5ZM9.42708 11.0833L7.74411 8.97955C7.78561 8.90581 7.82258 8.82916 7.85462 8.75H11.1454C11.2052 8.89769 11.2821 9.03661 11.3736 9.1643L10.2884 11.0206C10.1942 11.007 10.0979 11 10 11C9.80089 11 9.60858 11.0291 9.42708 11.0833ZM13 8.5C13.2761 8.5 13.5 8.27614 13.5 8C13.5 7.72386 13.2761 7.5 13 7.5C12.7239 7.5 12.5 7.72386 12.5 8C12.5 8.27614 12.7239 8.5 13 8.5ZM10.5 13C10.5 13.2761 10.2761 13.5 10 13.5C9.72386 13.5 9.5 13.2761 9.5 13C9.5 12.7239 9.72386 12.5 10 12.5C10.2761 12.5 10.5 12.7239 10.5 13Z" fill="currentColor"/>\n</svg>\n';case"mic-wire":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8614 1.75419C14.7181 1.93696 15.5165 2.3939 16.0904 3.05022C16.8139 3.83948 17.0302 4.93612 17.0718 5.40137C17.1466 6.26539 16.9304 7.15434 16.4729 7.89375C16.0155 8.63315 15.3169 9.22301 14.4935 9.53872C13.8169 9.81142 13.0812 9.8776 12.3644 9.76303L6.75878 14.0582C6.40115 14.3739 5.91046 14.5567 5.39481 14.5567C5.23679 14.5567 5.08708 14.5401 4.93738 14.5069C4.91243 14.5567 4.87916 14.5982 4.84589 14.6398C4.34688 15.2546 4.57975 16.1934 5.31996 16.5257C5.85224 16.7666 6.47601 16.7001 6.95007 16.3678L11.5909 13.0945C12.6638 12.3385 14.1359 12.5296 14.9842 13.5431C15.8741 14.6149 15.7327 16.2017 14.6599 17.0906L13.4622 18.0876C13.1129 18.3784 12.5889 18.3368 12.2895 17.9796C11.9984 17.6306 12.04 17.1072 12.3977 16.8082L13.5953 15.8112C13.9612 15.5121 14.0111 14.9721 13.7034 14.6066C13.4206 14.2659 12.9133 14.1995 12.5474 14.457L7.90652 17.7303C6.95007 18.4033 5.70253 18.5196 4.63797 18.046C2.91637 17.2817 2.35913 15.0884 3.54013 13.6013C3.54845 13.5847 3.56509 13.5681 3.58172 13.5598C3.51518 13.4434 3.45697 13.3188 3.39875 13.1776C3.27399 12.8536 3.24073 12.6043 3.25736 12.2886C3.29063 11.7237 3.54845 11.2003 3.97261 10.8264L8.92118 5.86661C8.90455 5.14382 9.06257 4.41272 9.41188 3.78132C9.83604 3.0253 10.5014 2.40221 11.2998 2.03666C12.0899 1.67942 13.0048 1.57141 13.8614 1.75419ZM14.8345 4.14687C14.2568 3.50049 13.3202 3.18634 12.4808 3.39085L15.3003 6.56448C15.6002 5.7299 15.4195 4.81679 14.8345 4.14687ZM5.0455 12.7456C5.22847 12.92 5.51124 12.9699 5.71085 12.7871L10.9505 8.77439L9.75287 7.42019L5.13698 12.0477C4.94569 12.2139 4.85421 12.5462 5.05381 12.7456H5.0455ZM10.6012 5.8583L12.6056 8.12637H12.6139C13.1628 8.21776 13.7284 8.12637 14.2107 7.85221L11.0669 4.32134C10.7509 4.77827 10.5762 5.29336 10.6012 5.8583Z" fill="currentColor"/>\n</svg>\n';case"pencil":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M15.8327 16.6691C16.2904 16.6692 16.6646 17.0434 16.6647 17.5011C16.6647 17.9589 16.2905 18.3341 15.8327 18.3341H4.1774C3.71952 18.3341 3.34439 17.9589 3.34439 17.5011C3.3445 17.0434 3.71958 16.6691 4.1774 16.6691H15.8327ZM12.2145 2.09586C12.7888 1.52127 13.7125 1.52127 14.2868 2.09586L16.234 4.04411C16.8083 4.61871 16.8083 5.54373 16.234 6.11832C13.3405 9.01347 10.4068 11.8678 7.50357 14.7531C7.34546 14.9113 7.12912 14.9953 6.91275 14.9953H6.89615L4.19107 14.9367C3.74164 14.9283 3.37564 14.57 3.37564 14.1203L3.33365 11.3976C3.32533 11.1729 3.41684 10.9562 3.57486 10.798C6.46268 7.90531 9.32504 4.98695 12.2145 2.09586ZM5.0065 11.7228L5.03189 13.2961L6.57975 13.3293L13.0631 6.88395L11.4489 5.26872L5.0065 11.7228Z" fill="currentColor"/>\n</svg>\n';case"scholar-hat":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M18.3298 8.04271C18.3298 7.70938 18.1631 7.40938 17.888 7.23438L10.5192 2.64271C10.2191 2.45105 9.83569 2.45105 9.5356 2.64271L2.11676 7.23438C1.83334 7.40938 1.66663 7.70938 1.66663 8.04271C1.66663 8.37605 1.83334 8.68438 2.11676 8.85938L3.85894 9.92605V13.6427C3.85894 13.876 3.94229 14.101 4.10067 14.2927C5.95955 16.4177 7.93513 17.501 9.97739 17.501C10.0524 17.501 10.1358 17.501 10.2108 17.501C13.345 17.376 15.429 14.7594 15.8208 14.2344C15.9458 14.0677 16.0042 13.8677 16.0042 13.651V10.0094L16.6544 9.60938V16.376C16.6627 16.8344 17.0378 17.2094 17.4963 17.2094C17.9547 17.2094 18.3298 16.8344 18.3298 16.376C18.3298 16.376 18.3215 8.12605 18.3215 8.05105L18.3298 8.04271ZM14.3453 13.4094C13.8535 14.0094 12.2697 15.7344 10.1441 15.8177C8.60199 15.8844 7.05154 15.051 5.52609 13.376V10.9344L9.52726 13.376C9.67731 13.4677 9.84402 13.5177 10.0107 13.5177C10.1775 13.5177 10.3442 13.476 10.4942 13.3844L14.337 11.026V13.4177L14.3453 13.4094ZM10.0191 11.7177L3.97564 8.03438L10.0191 4.29271L16.0292 8.03438L10.0191 11.7177Z" fill="currentColor"/>\n</svg>\n';case"shorten":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t<path d="M3.62726 5.23368C3.96904 4.90993 4.49451 4.93658 4.80304 5.2952V5.28641L8.42218 9.46122C8.72223 9.79379 8.71397 10.3103 8.42218 10.6429L4.80304 14.721C4.6363 14.9047 4.4197 15.0013 4.19464 15.0013C3.99454 15.0012 3.78567 14.9224 3.62726 14.7649C3.29386 14.4411 3.26944 13.8806 3.58624 13.5306L5.89581 10.9231H2.50226C2.04367 10.9231 1.66827 10.5285 1.66827 10.0472C1.66846 9.56597 2.04379 9.17215 2.50226 9.17215H5.92023L3.56964 6.46805C3.26115 6.10925 3.28545 5.5575 3.62726 5.23368ZM15.2083 5.28739C15.5168 4.92857 16.0422 4.90205 16.3841 5.22586C16.7256 5.54969 16.75 6.10055 16.4417 6.45926L14.0989 9.16434H17.5179L17.5013 9.17313C17.9597 9.17335 18.3343 9.56692 18.3343 10.0481C18.3342 10.5292 17.9596 10.9229 17.5013 10.9231H14.1077L16.4251 13.5315C16.7417 13.8815 16.7172 14.4324 16.3841 14.7649C16.2257 14.9224 16.0168 15.0012 15.8167 15.0013C15.5916 15.0013 15.3751 14.9048 15.2083 14.721L11.5892 10.6429C11.2975 10.3103 11.2974 9.79372 11.5892 9.46122L15.2083 5.28739Z" fill="currentColor"/>\n</svg>\n';case"swap":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n  <path d="M5.35384 13.3333L6.91634 14.8958C7.06912 15.0486 7.14551 15.2396 7.14551 15.4688C7.14551 15.6979 7.06912 15.8958 6.91634 16.0625C6.74967 16.2292 6.55176 16.3125 6.32259 16.3125C6.09342 16.3125 5.89551 16.2292 5.72884 16.0625L2.74967 13.0833C2.66634 13 2.60731 12.9097 2.57259 12.8125C2.53787 12.7153 2.52051 12.6111 2.52051 12.5C2.52051 12.3889 2.53787 12.2847 2.57259 12.1875C2.60731 12.0903 2.66634 12 2.74967 11.9167L5.74967 8.91667C5.91634 8.75 6.11079 8.67014 6.33301 8.67708C6.55523 8.68403 6.74967 8.77083 6.91634 8.9375C7.06912 9.10417 7.14898 9.29861 7.15592 9.52083C7.16287 9.74306 7.08301 9.9375 6.91634 10.1042L5.35384 11.6667H10.4997C10.7358 11.6667 10.9337 11.7465 11.0934 11.9062C11.2531 12.066 11.333 12.2639 11.333 12.5C11.333 12.7361 11.2531 12.934 11.0934 13.0938C10.9337 13.2535 10.7358 13.3333 10.4997 13.3333H5.35384ZM15.6455 8.33333H10.4997C10.2636 8.33333 10.0656 8.25347 9.90592 8.09375C9.7462 7.93403 9.66634 7.73611 9.66634 7.5C9.66634 7.26389 9.7462 7.06597 9.90592 6.90625C10.0656 6.74653 10.2636 6.66667 10.4997 6.66667H15.6455L14.083 5.10417C13.9302 4.95139 13.8538 4.76042 13.8538 4.53125C13.8538 4.30208 13.9302 4.10417 14.083 3.9375C14.2497 3.77083 14.4476 3.6875 14.6768 3.6875C14.9059 3.6875 15.1038 3.77083 15.2705 3.9375L18.2497 6.91667C18.333 7 18.392 7.09028 18.4268 7.1875C18.4615 7.28472 18.4788 7.38889 18.4788 7.5C18.4788 7.61111 18.4615 7.71528 18.4268 7.8125C18.392 7.90972 18.333 8 18.2497 8.08333L15.2497 11.0833C15.083 11.25 14.8886 11.3299 14.6663 11.3229C14.4441 11.316 14.2497 11.2292 14.083 11.0625C13.9302 10.8958 13.8504 10.7014 13.8434 10.4792C13.8365 10.2569 13.9163 10.0625 14.083 9.89583L15.6455 8.33333Z" fill="currentColor"/>\n</svg>';case"img-generator":return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.084 15.3359L10.434 13.1359C10.284 12.9359 10.084 12.8359 9.83398 12.8359C9.58398 12.8359 9.38398 12.9359 9.23398 13.1359L7.43398 15.5359C7.30065 15.7026 7.28398 15.8776 7.38398 16.0609C7.48398 16.2443 7.63398 16.3359 7.83398 16.3359H16.834C17.034 16.3359 17.184 16.2443 17.284 16.0609C17.384 15.8776 17.3673 15.7026 17.234 15.5359L15.4287 12.4954C15.3666 12.3909 15.2785 12.3042 15.1729 12.2439C14.865 12.068 14.4743 12.1488 14.2615 12.4325L12.084 15.3359ZM5.83398 20.3359C5.28398 20.3359 4.81315 20.1401 4.42148 19.7484C4.02982 19.3568 3.83398 18.8859 3.83398 18.3359V5.33594C3.83398 4.78594 4.02982 4.3151 4.42148 3.92344C4.81315 3.53177 5.28398 3.33594 5.83398 3.33594H11.834C12.1173 3.33594 12.3548 3.43177 12.5465 3.62344C12.7382 3.8151 12.834 4.0526 12.834 4.33594C12.834 4.61927 12.7382 4.85677 12.5465 5.04844C12.3548 5.2401 12.1173 5.33594 11.834 5.33594H5.83398V18.3359H18.834V12.0109C18.834 11.7276 18.9298 11.4901 19.1215 11.2984C19.3132 11.1068 19.5507 11.0109 19.834 11.0109C20.1173 11.0109 20.3548 11.1068 20.5465 11.2984C20.7382 11.4901 20.834 11.7276 20.834 12.0109V18.3359C20.834 18.8859 20.6382 19.3568 20.2465 19.7484C19.8548 20.1401 19.384 20.3359 18.834 20.3359H5.83398Z" fill="currentColor"/>\n<path d="M20.3526 6.85454L19.3928 8.98058C19.1742 9.45439 18.4938 9.45439 18.2751 8.98058L17.3154 6.84239L15.1893 5.88264C14.7155 5.66396 14.7155 4.99577 15.1893 4.77709L17.3275 3.81734L18.2873 1.69129C18.506 1.21749 19.1742 1.21749 19.3928 1.69129L20.3526 3.82948L22.4786 4.78924C22.9524 5.00792 22.9524 5.67611 22.4786 5.89479L20.3526 6.85454Z" fill="#008847"/>\n</svg>\n';case"arrow-down-solid":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.41575 11.9193L7.24908 9.7526C6.9852 9.48872 6.92617 9.18663 7.072 8.84635C7.21783 8.50608 7.47825 8.33594 7.85325 8.33594H12.1449C12.5199 8.33594 12.7803 8.50608 12.9262 8.84635C13.072 9.18663 13.013 9.48872 12.7491 9.7526L10.5824 11.9193C10.4991 12.0026 10.4088 12.0651 10.3116 12.1068C10.2144 12.1484 10.1102 12.1693 9.99908 12.1693C9.88797 12.1693 9.78381 12.1484 9.68658 12.1068C9.58936 12.0651 9.49908 12.0026 9.41575 11.9193Z" fill="currentColor"/>\n</svg>\n\n';case"edit-pencil":return'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.16667 15.8307H5.33333L12.5208 8.64323L11.3542 7.47656L4.16667 14.6641V15.8307ZM16.0833 7.4349L12.5417 3.9349L13.7083 2.76823C14.0278 2.44878 14.4201 2.28906 14.8854 2.28906C15.3507 2.28906 15.7431 2.44878 16.0625 2.76823L17.2292 3.9349C17.5486 4.25434 17.7153 4.63976 17.7292 5.09115C17.7431 5.54253 17.5903 5.92795 17.2708 6.2474L16.0833 7.4349ZM3.33333 17.4974C3.09722 17.4974 2.89931 17.4175 2.73958 17.2578C2.57986 17.0981 2.5 16.9002 2.5 16.6641V14.3099C2.5 14.1988 2.52083 14.0911 2.5625 13.987C2.60417 13.8828 2.66667 13.7891 2.75 13.7057L11.3333 5.1224L14.875 8.66406L6.29167 17.2474C6.20833 17.3307 6.11458 17.3932 6.01042 17.4349C5.90625 17.4766 5.79861 17.4974 5.6875 17.4974H3.33333Z" fill="currentColor"/>\n</svg>\n';case"chevron-left":return'<svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.875 10.875L0.275 6.275C0.175 6.175 0.104167 6.06667 0.0625 5.95C0.0208333 5.83333 0 5.70833 0 5.575C0 5.44167 0.0208333 5.31667 0.0625 5.2C0.104167 5.08333 0.175 4.975 0.275 4.875L4.875 0.275C5.05833 0.0916667 5.29167 0 5.575 0C5.85833 0 6.09167 0.0916667 6.275 0.275C6.45833 0.458333 6.55 0.691667 6.55 0.975C6.55 1.25833 6.45833 1.49167 6.275 1.675L2.375 5.575L6.275 9.475C6.45833 9.65833 6.55 9.89167 6.55 10.175C6.55 10.4583 6.45833 10.6917 6.275 10.875C6.09167 11.0583 5.85833 11.15 5.575 11.15C5.29167 11.15 5.05833 11.0583 4.875 10.875Z" fill="currentColor"/>\n</svg>\n\n';case"chevron-right":return'<svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M0.275 10.875C0.0916667 10.6917 0 10.4583 0 10.175C0 9.89167 0.0916667 9.65833 0.275 9.475L4.175 5.575L0.275 1.675C0.0916667 1.49167 0 1.25833 0 0.975C0 0.691667 0.0916667 0.458333 0.275 0.275C0.458333 0.0916667 0.691667 0 0.975 0C1.25833 0 1.49167 0.0916667 1.675 0.275L6.275 4.875C6.375 4.975 6.44583 5.08333 6.4875 5.2C6.52917 5.31667 6.55 5.44167 6.55 5.575C6.55 5.70833 6.52917 5.83333 6.4875 5.95C6.44583 6.06667 6.375 6.175 6.275 6.275L1.675 10.875C1.49167 11.0583 1.25833 11.15 0.975 11.15C0.691667 11.15 0.458333 11.0583 0.275 10.875Z" fill="currentColor"/>\n</svg>\n';case"reload":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10.0007 16.6693C8.13954 16.6693 6.56315 16.0234 5.27148 14.7318C3.97982 13.4401 3.33398 11.8637 3.33398 10.0026C3.33398 8.14149 3.97982 6.5651 5.27148 5.27344C6.56315 3.98177 8.13954 3.33594 10.0007 3.33594C10.959 3.33594 11.8757 3.53385 12.7507 3.92969C13.6257 4.32552 14.3757 4.89149 15.0007 5.6276V4.16927C15.0007 3.93316 15.0805 3.73524 15.2402 3.57552C15.4 3.4158 15.5979 3.33594 15.834 3.33594C16.0701 3.33594 16.268 3.4158 16.4277 3.57552C16.5875 3.73524 16.6673 3.93316 16.6673 4.16927V8.33594C16.6673 8.57205 16.5875 8.76997 16.4277 8.92969C16.268 9.08941 16.0701 9.16927 15.834 9.16927H11.6673C11.4312 9.16927 11.2333 9.08941 11.0736 8.92969C10.9138 8.76997 10.834 8.57205 10.834 8.33594C10.834 8.09983 10.9138 7.90191 11.0736 7.74219C11.2333 7.58247 11.4312 7.5026 11.6673 7.5026H14.334C13.8895 6.72483 13.2819 6.11372 12.5111 5.66927C11.7402 5.22483 10.9034 5.0026 10.0007 5.0026C8.61176 5.0026 7.43121 5.48872 6.45898 6.46094C5.48676 7.43316 5.00065 8.61372 5.00065 10.0026C5.00065 11.3915 5.48676 12.572 6.45898 13.5443C7.43121 14.5165 8.61176 15.0026 10.0007 15.0026C10.9451 15.0026 11.8097 14.763 12.5944 14.2839C13.3791 13.8047 13.9868 13.1623 14.4173 12.3568C14.5284 12.1623 14.6847 12.0269 14.8861 11.9505C15.0875 11.8741 15.2923 11.8707 15.5007 11.9401C15.7229 12.0095 15.8826 12.1554 15.9798 12.3776C16.077 12.5998 16.0701 12.8082 15.959 13.0026C15.3895 14.1137 14.577 15.0026 13.5215 15.6693C12.4659 16.3359 11.2923 16.6693 10.0007 16.6693Z" fill="currentColor"/>\n</svg>\n';case"download":return'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M15.834 15.8311C16.2942 15.8311 16.667 16.2038 16.667 16.6641C16.667 17.1243 16.2942 17.4971 15.834 17.4971H4.16699C3.7069 17.4969 3.33398 17.1242 3.33398 16.6641C3.33398 16.2039 3.7069 15.8312 4.16699 15.8311H15.834ZM12.208 1.66406C12.9692 1.66409 13.9032 2.19142 13.9033 3.19336V7.40918H14.9707C15.6062 7.40926 16.1897 7.71916 16.4844 8.24902C16.7998 8.81634 16.7121 9.52962 16.1758 10.0176L11.1943 14.5469C10.8448 14.8647 10.3968 14.9973 9.98828 14.9971C9.57974 14.9967 9.13129 14.8635 8.78223 14.5449L3.82324 10.0156C3.28805 9.52682 3.20165 8.81343 3.51758 8.24707C3.81261 7.71826 4.39557 7.40931 5.03027 7.40918H6.09961V3.19336C6.09968 2.19154 7.03285 1.66421 7.79395 1.66406H12.208ZM7.79395 3.33105C7.78362 3.33107 7.77404 3.33103 7.76562 3.33203V9.07617H5.2666L9.9043 13.3125C9.90577 13.3135 9.91112 13.3168 9.9209 13.3203C9.93747 13.3262 9.96132 13.331 9.98926 13.3311C10.0171 13.3311 10.0409 13.3262 10.0576 13.3203C10.0673 13.3169 10.0726 13.3136 10.0742 13.3125L14.7334 9.07617H12.2363V3.33203C12.2279 3.33103 12.2184 3.33106 12.208 3.33105H7.79395Z" fill="currentColor"/>\n</svg>\n';case"thumbs-up":return'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.66732 14.0036V5.33698L8.66732 1.37031C8.83398 1.20365 9.03121 1.10642 9.25898 1.07865C9.48676 1.05087 9.70621 1.09253 9.91732 1.20365C10.1284 1.31476 10.284 1.47031 10.384 1.67031C10.484 1.87031 10.5062 2.07587 10.4507 2.28698L9.70065 5.33698H14.0007C14.3562 5.33698 14.6673 5.47031 14.934 5.73698C15.2007 6.00365 15.334 6.31476 15.334 6.67031V8.00365C15.334 8.08142 15.3229 8.16476 15.3007 8.25365C15.2784 8.34254 15.2562 8.42587 15.234 8.50365L13.234 13.2036C13.134 13.4259 12.9673 13.6148 12.734 13.7703C12.5007 13.9259 12.2562 14.0036 12.0007 14.0036H4.66732ZM6.00065 5.90365V12.6703H12.0007L14.0007 8.00365V6.67031H8.00065L8.90065 3.00365L6.00065 5.90365ZM2.66732 14.0036C2.30065 14.0036 1.98676 13.8731 1.72565 13.612C1.46454 13.3509 1.33398 13.037 1.33398 12.6703V6.67031C1.33398 6.30365 1.46454 5.98976 1.72565 5.72865C1.98676 5.46754 2.30065 5.33698 2.66732 5.33698H4.66732V6.67031H2.66732V12.6703H4.66732V14.0036H2.66732Z" fill="currentColor"/>\n</svg>\n';case"thumbs-down":return'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M1.99935 10.6667C1.64379 10.6667 1.33268 10.5333 1.06602 10.2667C0.799349 10 0.666016 9.68889 0.666016 9.33333V8C0.666016 7.92222 0.677127 7.83889 0.699349 7.75C0.721571 7.66111 0.743793 7.57778 0.766016 7.5L2.76602 2.8C2.86602 2.57778 3.03268 2.38889 3.26602 2.23333C3.49935 2.07778 3.74379 2 3.99935 2H11.3327V10.6667L7.33268 14.6333C7.16602 14.8 6.96879 14.8972 6.74102 14.925C6.51324 14.9528 6.29379 14.9111 6.08268 14.8C5.87157 14.6889 5.71602 14.5333 5.61602 14.3333C5.51602 14.1333 5.49379 13.9278 5.54935 13.7167L6.29935 10.6667H1.99935ZM9.99935 10.1V3.33333H3.99935L1.99935 8V9.33333H7.99935L7.09935 13L9.99935 10.1ZM13.3327 2C13.6993 2 14.0132 2.13056 14.2743 2.39167C14.5355 2.65278 14.666 2.96667 14.666 3.33333V9.33333C14.666 9.7 14.5355 10.0139 14.2743 10.275C14.0132 10.5361 13.6993 10.6667 13.3327 10.6667H11.3327V9.33333H13.3327V3.33333H11.3327V2H13.3327Z" fill="currentColor"/>\n</svg>\n';default:(0,r.assertNever)(e,"Unknown icon: ")}})(e).replace("<svg",'<svg class="tb_icon__svg_1xm3qcg1"')),[e]);return(0,o.jsx)(s.Span,{className:(0,r.classes)(t,"tb_icon_1xm3qcg0"),dangerouslySetInnerHTML:{__html:n}})};m.displayName="<Icon />";var p="tb_button_zcjgg10",_="tb_button__decoration_zcjgg11",E=({className:e,tabIndex:t,label:n,isDisabled:i,mode:a,testId:l="tb-action-button-apply",onClick:c})=>{const d="metaKey"===(0,r.getMetaKey)("Enter")?"⌘":"Ctrl";return(0,o.jsxs)(s.Div,{className:(0,r.classes)(p,"tb_apply-button_zcjgg14",!!i&&"tb_button--disabled_zcjgg18",e),onClick:()=>null==c?void 0:c(),"data-tb-tabindex":t,"data-testid":l,children:[n,(0,o.jsx)(s.Span,{className:(0,r.classes)(_,"tb_apply-button__decoration_zcjgg15","⌘"===d&&"tb_apply-button__decoration--macos_zcjgg17","withMeta"===a&&"tb_apply-button__decoration--with-meta_zcjgg16"),"data-tb-meta-key-symbol":"withMeta"===a?d:void 0,children:(0,o.jsx)(m,{name:"enter"})})]})},f=({label:e,testId:t="tb-action-button-escape",onClick:n})=>(0,o.jsxs)(s.Div,{className:(0,r.classes)(p,"tb_esc-button_zcjgg12"),"data-testid":t,onClick:n,children:[e,(0,o.jsx)(s.Span,{className:(0,r.classes)(_,"tb_esc-button__decoration_zcjgg13"),children:"ESC"})]}),T=({condition:e,children:t})=>{if(e)return(0,o.jsx)(o.Fragment,{children:t})};T.displayName="<When />";var C=({condition:e,children:t})=>(0,o.jsx)(T,{condition:!e,children:t});C.displayName="<Unless />";var v,S,b="tb_textfield__inner_yto9xr3",x=new class{constructor(){c(this,"debouncedSave"),c(this,"TTL_MS",5e3),this.debouncedSave=new r.Debounce(this.saveToStorage.bind(this),100)}saveValue(e,t){t.trim()&&this.debouncedSave.call(e,t)}getStoredValueById(e){try{const t=this.getStorageKey(e),n=this.getTimestampKey(e),s=sessionStorage.getItem(t),r=sessionStorage.getItem(n);if(!s||!r)return"";const i=parseInt(r,10);return Date.now()-i>this.TTL_MS?(this.clearValueById(e),""):s}catch(e){return console.warn("[Toolbox] Failed to load temporary state:",e),""}}clearValueById(e){try{const t=this.getStorageKey(e),n=this.getTimestampKey(e);sessionStorage.removeItem(t),sessionStorage.removeItem(n)}catch(e){console.warn("[Toolbox] Failed to clear temporary state:",e)}}clearAllValues(){try{for(let e=sessionStorage.length-1;e>=0;e--){const t=sessionStorage.key(e);t&&(t.endsWith("-temp-value")||t.endsWith("-temp-ts"))&&sessionStorage.removeItem(t)}}catch(e){console.warn("[Toolbox] Failed to clear all temporary states:",e)}}getStorageKey(e){return`${e}-temp-value`}getTimestampKey(e){return`${e}-temp-ts`}saveToStorage(e,t){try{const n=this.getStorageKey(e),s=this.getTimestampKey(e),r=Date.now();sessionStorage.setItem(n,t),sessionStorage.setItem(s,r.toString())}catch(e){console.warn("[Toolbox] Failed to save temporary state:",e)}}},y=class{constructor(e,t=!1){this.data=e,c(this,"name","beforeinput"),u(this,v,!1),u(this,S,!1),g(this,v,t)}get shiftKey(){return h(this,v)}get defaultPrevented(){return h(this,S)}preventDefault(){h(this,S)||g(this,S,!0)}};v=new WeakMap,S=new WeakMap,c(y,"BACKSPACE","⌫"),c(y,"DELETE","␡"),c(y,"ENTER","⏎");var A=["Shift","Meta","Alt","Control","Escape","CapsLock","Dead"],k=(e,t,n)=>{const s=Math.min(t,n),r=Math.max(t,n);return{data:e.slice(s,r),from:s,to:r}},w=(e,t,n,s)=>{switch(!0){case t===n&&"left"===s:return[[...e.slice(0,t-1),...e.slice(t)],t-1];case t===n&&"right"===s:return[[...e.slice(0,t),...e.slice(t+1)],t];default:{const{from:s,to:r}=k(e,t,n);return[[...e.slice(0,s),...e.slice(r)],s]}}},R=(e,t,n,s)=>{const{from:i,to:o}=k(e,n,s),a=(0,r.splitGraphemes)(t);return[[...e.slice(0,i),...a,...e.slice(o)],i+a.length]},L=({id:e,text:t,caretPosition:n,selectionEnd:a,hasFocus:l})=>{const c=(0,i.useRef)(null),d=t.concat([{value:" "}]);return(0,i.useEffect)((()=>{var e;if(!(null==(e=c.current)?void 0:e.parentElement))return;const t=(e=>{const[,t=""]=e.trim().match(/^var\((--[^,)\s]+)/)||[];return t})("var(--tb_height_yto9xr0)");let n=parseInt(getComputedStyle(c.current.parentElement).getPropertyValue(t),10);n=Number.isNaN(n)?0:n;const{offsetHeight:s,offsetWidth:r,offsetTop:i,offsetLeft:o}=c.current,{scrollTop:a,scrollLeft:l,offsetHeight:d,offsetWidth:h}=c.current.parentElement;d>=n&&h>1&&(i<a||a+d<i+s||o<l||l+h<o+r)&&c.current.scrollIntoView({behavior:"smooth",block:"end"})}),[n]),d.map((({value:t,isPartial:i},d,h)=>{var u;const g=(()=>{switch(!0){case n===a:return!1;case n<a:return d>=n&&d<a;case n>a:return d<n&&d>=a}})(),m="\n"===(null==(u=h[d+1])?void 0:u.value)?d+1:-1,p=l&&m===n,_=l&&!p&&d===n,E=l&&n>a,f=d<h.length-1?{"data-tb-input-char":e}:{},T=l&&g?{"data-tb-char-value":t}:{},C=p||_?{ref:c}:{};return t.match(/^[\r\n]$/)&&(t=" \n"),(0,o.jsx)(s.Span,{className:(0,r.classes)("tb_textfield__char_yto9xr6",_&&!E&&"tb_textfield__char-with-caret_yto9xr9 tb_textfield__caret_yto9xr8",_&&E&&"tb_textfield__caret--static_yto9xrb tb_textfield__caret_yto9xr8",l&&g&&!_&&"tb_textfield__char-with-selection_yto9xra",l&&g&&_&&"tb_textfield__char-with-caret-and-selection_yto9xrd tb_textfield__caret--static_yto9xrb",l&&i&&"tb_textfield__char--partial_yto9xr7"),...f,...T,...C,children:t},`${t}-${d}`)}))};L.displayName="<Chars />";var M=(0,i.forwardRef)((({className:e,autofocus:t,submitOnEnter:n,onBeforeInput:a,onInput:l,onFocus:c,onBlur:d,value:h,testId:u,placeholder:g="",multiline:m=!1,disabled:p=!1,storageId:_},E)=>{const f=(0,i.useRef)(!1),[T,C]=(0,i.useState)((0,r.splitGraphemes)(h)),[[v,S],M]=(0,i.useState)([T.length,T.length]),[I,P]=(0,i.useState)(""),N=(0,i.useMemo)((()=>{const e=T.map((e=>({value:e})));if(!I)return e;if(v!==S)throw new Error("[toolbox] Cannot insert partial character when there is still a text selection.");return[...e.slice(0,v-1),{value:I,isPartial:!0},...e.slice(v-1)]}),[v,S,I,T]),O=(0,i.useRef)(crypto.randomUUID()),[D,H]=(0,i.useState)(!0===t),U=(0,i.useRef)(null),F=(0,i.useRef)(!1),B=(0,i.useMemo)((()=>k(T,v,S)),[T,v,S]),G=(0,i.useMemo)((()=>_||null),[_]),j=(0,i.useCallback)((e=>{let t;if(v!==S){const{from:e,to:n}=k(T,v,S);t=e+1,C([...T.slice(0,e),...T.slice(n)])}else t=v+1;M([t,t]),P(e)}),[v,S,T]),W=(0,i.useCallback)((e=>{let t=new y(e);null==a||a(t);const n=t.defaultPrevented;if(t=null,n)return;const s=(0,r.splitGraphemes)(e),i=Math.max(0,s.length-1),o=v+i,c=v-Math.max(1,s.length-1),d=[...T.slice(0,c),...s,...T.slice(c)];null==l||l(d.join("")),M([o,o]),P(""),C(d)}),[T,v,a,l]),$=(0,i.useCallback)((()=>{I&&P("")}),[I]),z=D?{"data-tb-input-focus":""}:{},V=m?{"data-tb-input-multiline":""}:{},K=p?{"data-tb-disabled":""}:{},X=n?{"data-tb-submit-on-enter":""}:{};return(0,i.useImperativeHandle)(E,(()=>({setSelection(e,t){M([t,e])}})),[M]),(0,i.useEffect)((()=>{if(U.current&&D)return((e,{doc:t})=>{const n=()=>{var t;return null==(t=e.onCopy)?void 0:t.call(e)},s=t=>{var n;return e.onPaste(null!=(n=t.detail.data)?n:"")},i=()=>e.onCut();return t.addEventListener(r.EVENT_TYPE_COPY,n,!0),t.addEventListener(r.EVENT_TYPE_PASTE,s,!0),t.addEventListener(r.EVENT_TYPE_CUT,i,!0),()=>{t.removeEventListener(r.EVENT_TYPE_COPY,n,!0),t.removeEventListener(r.EVENT_TYPE_PASTE,s,!0),t.removeEventListener(r.EVENT_TYPE_CUT,i,!0)}})({onCut:()=>{if(B.data.length){const[e,t]=w(T,v,S,"left");null==l||l(e.join("")),C(e),M([t,t])}},onPaste:e=>{if(e){const[t,n]=R(T,e,v,S);let s=new y(e);null==a||a(s);const r=s.defaultPrevented;if(s=null,r)return;null==l||l(t.join("")),C(t),M([n,n])}}},{doc:U.current.ownerDocument})}),[B.data,v,S,T,D,a,l]),(0,i.useEffect)((()=>{if(U.current&&D&&!p)return((e,{ignoredKeys:t,doc:n})=>{const s=n=>{var s,i,o,a,l,c,d,h,u,g,m,p,_,E,f,T,C;const v=[n.detail.key,{shiftKey:n.detail.shiftKey}];switch(!0){case"ArrowUp"===n.detail.key:return void(null==(s=e.onArrowUp)||s.call(e,...v));case"ArrowDown"===n.detail.key:return void(null==(i=e.onArrowdown)||i.call(e,...v));case"ArrowLeft"===n.detail.key:switch(!0){case(0,r.hasMetaKey)(n.detail):null==(o=e.onJumpToLineStart)||o.call(e,...v);break;case n.detail.altKey:null==(a=e.onJumpToWordStart)||a.call(e,...v);break;default:null==(l=e.onArrowLeft)||l.call(e,...v)}return;case"ArrowRight"===n.detail.key:switch(!0){case(0,r.hasMetaKey)(n.detail):null==(c=e.onJumpToLineEnd)||c.call(e,...v);break;case n.detail.altKey:null==(d=e.onJumpToWordEnd)||d.call(e,...v);break;default:null==(h=e.onArrowRight)||h.call(e,...v)}return;case(0,r.isSelectAll)(n.detail):return void(null==(u=e.onSelectAll)||u.call(e,...v));case t.includes(n.detail.key):case(0,r.hasMetaKey)(n.detail):case(0,r.isFunctionKey)(n.detail.key):return;case"Enter"===n.detail.key:return void(null==(g=e.onEnter)||g.call(e,...v));case"Escape"===n.detail.key:return void(null==(m=e.onEscape)||m.call(e,...v));case"Tab"===n.detail.key:return void(null==(p=e.onTab)||p.call(e,...v));case"Backspace"===n.detail.key:n.detail.isTrusted&&(null==(_=e.onBackspace)||_.call(e,...v));break;case"Delete"===n.detail.key:null==(E=e.onDelete)||E.call(e,...v);break;case"Home"===n.detail.key:null==(f=e.onJumpToLineStart)||f.call(e,...v);break;case"End"===n.detail.key:null==(T=e.onJumpToLineEnd)||T.call(e,...v);break;case["Unidentified","Process","Dead","PageDown","PageUp","AltGraph"].includes(n.detail.key):return;default:null==(C=e.onCommonCharacter)||C.call(e,...v)}};return n.addEventListener(r.EVENT_TYPE_KEYBOARD,s,!0),()=>{n.removeEventListener(r.EVENT_TYPE_KEYBOARD,s,!0)}})({onArrowdown:()=>{m||M([T.length,T.length])},onArrowLeft:(e,t)=>{const n=Math.max(0,v-1),s=t.shiftKey?S:n;M([n,s])},onArrowRight:(e,t)=>{const n=Math.min(T.length,v+1),s=t.shiftKey?S:n;M([n,s])},onArrowUp:()=>{m||M([0,0])},onBackspace:(e,t)=>{if(v>0){const[e,n]=w(T,v,S,"left");let s=new y(y.BACKSPACE,t.shiftKey);null==a||a(s);const r=s.defaultPrevented;if(s=null,r)return;null==l||l(e.join("")),C(e),M([n,n])}},onDelete:(e,t)=>{if(v<T.length||((e,t,n)=>{const s=Math.min(t,n),r=Math.max(t,n)-s;return e.length>0&&e.length===r})(T,v,S)){const[e,n]=w(T,v,S,"right");let s=new y(y.DELETE,t.shiftKey);null==a||a(s);const r=s.defaultPrevented;if(s=null,r)return;null==l||l(e.join("")),C(e),M([n,n])}},onEnter:(e,t)=>{if(!m||n&&!t.shiftKey)return;const[s,r]=R(T,"\n",v,v);let i=new y(y.ENTER,t.shiftKey);null==a||a(i);const o=i.defaultPrevented;i=null,o||(null==l||l(s.join("")),C(s),M([r,r]))},onEscape:()=>$(),onTab:(e,{shiftKey:t})=>{var n;((e,t)=>{if(!e)return;const n=e.querySelector("[data-tb-input-focus]"),s=Array.from(e.querySelectorAll("[data-tb-input]"));if(!n||s.length<2)return;const i=s.findIndex((e=>e===n)),o=(()=>{switch(!0){case"next"===t&&i+1===s.length:return 0;case"next"===t:return i+1;case"previous"===t&&i-1<0:return s.length-1;case"previous"===t:return i-1;default:throw new Error(`Failed to get neighboring index for ${i} in ${t} direction.`)}})(),a=s[o],{offsetWidth:l,offsetHeight:c}=a,d=DOMRect.fromRect({x:l-2,y:c-2,width:l,height:c});if((0,r.simulateMouseDown)(a,d),(0,r.simulateMouseUp)(a,d),!a.hasAttribute("data-tb-input-multiline"))return;let h=a;const u=e.createTreeWalker(a,NodeFilter.SHOW_ELEMENT);let g,m;do{const{scrollHeight:e,offsetHeight:t}=h;if(e>t){g=h,m=e-t;break}}while(h=u.nextNode());g&&m&&g.scrollTo(0,m)})(null==(n=U.current)?void 0:n.ownerDocument,t?"previous":"next")},onSelectAll:()=>{M([T.length,0])},onJumpToWordStart:(e,{shiftKey:t})=>{const n=((e,t)=>{let n=t-1,s=!0;for(;n>=0;n--){const t=e[n];if(/[^\S]/.test(t)){if(!s)break}else s=!1}return Math.min(n+1,e.length)})(T,v);M([n,t?S:n])},onJumpToWordEnd:(e,{shiftKey:t})=>{const n=((e,t)=>{const n=e.length;let s=t,r=!0;for(;s<n;s++){const t=e[s];if(/[^\S]/.test(t)){if(!r)break}else r=!1}return Math.max(s,0)})(T,v);M([n,t?S:n])},onJumpToLineStart:(e,{shiftKey:t})=>{m||M([0,t?S:0])},onJumpToLineEnd:(e,{shiftKey:t})=>{if(m)return;const n=T.length;M([n,t?S:n])},onCommonCharacter:(e,t)=>{const[n,s]=(()=>{if(v!==S)return R(T,e,v,S);if(v===T.length){const t=[...T,e];return[t,t.length]}return R(T,e,v,v)})();let r=new y(e,t.shiftKey);null==a||a(r);const i=r.defaultPrevented;r=null,i||(null==l||l(n.join("")),C(n),M([s,s]))}},{doc:U.current.ownerDocument,ignoredKeys:A,isMultiline:m})}),[T,v,S,D,m,p,n,a,l,$]),(0,i.useEffect)((()=>{if(!U.current)return;const e=U.current.ownerDocument,t=e=>{var t;const n=e.target,s=Boolean(n&&(null==(t=U.current)?void 0:t.contains(n)));if(F.current=!0,$(),n&&0===e.button&&(H(s&&!p),!s||D||p?D&&!s&&(null==d||d()):null==c||c(),s&&!p))if(n.getAttribute("data-tb-input-char")===O.current){const t=((e,t)=>{const{x:n,width:s}=e.getBoundingClientRect();return t<n+s/2?"left":"right"})(n,e.x),s=Array.from(n.parentElement.children).indexOf(n),r="left"===t?s:s+1;M([r,r])}else if(0===T.length)M([0,0]);else{let t=T.length;if(m&&e.isTrusted)try{const s=n.closest(`[class*="${b}"]`),i=((e,t)=>{const n=(0,r.xpathSelectorAll)('//*[text() = " " or text() = " " or text() = " \n"]',e.ownerDocument,e).reverse(),s=(e=>{const[t,...n]=e,s=t.offsetTop+t.offsetHeight;let r=0;for(const e of n)if(e.offsetTop+e.offsetHeight>s){r=e.offsetTop-s;break}return r})([...n].reverse()),{top:i}=e.getBoundingClientRect();for(const e of n){const n=e.offsetTop+i-Math.ceil(s/2),r=e.offsetHeight+n+s;if(n<=t&&r>=t)return e}return null})(s,e.y),o=i?Array.from(s.children).indexOf(i):t-1,a=T.length===o+1;t=Math.max(0,a?o+1:o)}catch(e){console.error("[toolbox] Failed to retrieve line end in fake input.",e)}M([t,t])}},n=e=>{if(!F.current)return;const{from:t,to:n}=B,s=t===v?"left":"right",i=(0,r.isHtmlElement)(e.target)&&e.target.getAttribute("data-tb-input-char")===O.current?e.target:null;if(!i)return;let o=(e=>Array.from(e.parentElement.children).indexOf(e))(i);"right"===s&&(o+=1),[t,n].includes(o)||(o>t?M([o,t]):o<n&&M([o,n]))},s=()=>{F.current=!1};return e.addEventListener("mousedown",t,!0),e.addEventListener("mousemove",n,!0),e.addEventListener("mouseup",s,!0),()=>{e.removeEventListener("mousedown",t,!0),e.removeEventListener("mousemove",n,!0),e.removeEventListener("mouseup",s,!0)}}),[B,D,p,d,c,v,S,m,T,$]),(0,i.useEffect)((()=>(p&&D&&H(!1),!p&&D&&document.dispatchEvent(new CustomEvent(r.EVENT_TYPE_FOCUSIN,{})),()=>{!p&&D&&document.dispatchEvent(new CustomEvent(r.EVENT_TYPE_FOCUSOUT,{}))})),[p,D]),(0,i.useEffect)((()=>{var e;null==(e=U.current)||e.ownerDocument.dispatchEvent(new CustomEvent(r.EVENT_TYPE_SELECTION_CHANGE,{detail:{text:B.data.join("")}}))}),[B.data]),(0,i.useEffect)((()=>C((e=>e.join("")===h?e:(0,r.splitGraphemes)(h)))),[h]),(0,i.useEffect)((()=>{const e=T.join("");U.current&&U.current["tb-value"]!==e&&(U.current["tb-value"]=e)}),[T]),(0,i.useEffect)((()=>{if(!G||f.current)return;const e=x.getStoredValueById(G);if(e&&!h){const t=(0,r.splitGraphemes)(e);null==l||l(e),C(t),M([t.length,t.length])}f.current=!0}),[G,h,l]),(0,i.useEffect)((()=>{if(G)if(T.length){const e=T.join("");x.saveValue(G,e)}else x.clearValueById(G)}),[T,G,h]),((e,t,n)=>{(0,i.useEffect)((()=>{if(!e)return;const s=({detail:e})=>{e.composedChar?n(e.composedChar):t(e.partialChar)};return document.addEventListener(r.EVENT_TYPE_COMPOSITION,s,!0),()=>{document.removeEventListener(r.EVENT_TYPE_COMPOSITION,s,!0)}}),[e,t,n])})(D,j,W),(0,o.jsxs)(s.Div,{className:(0,r.classes)(e,"tb_textfield_yto9xr2"),ref:U,onContextMenu:e=>e.stopImmediatePropagation(),"data-testid":u,"data-tb-allow-mouse-interaction":!0,"data-tb-input":!0,...z,...V,...K,...X,children:[(0,o.jsx)(s.Div,{className:(0,r.classes)(b,!m&&"tb_textfield__inner--single-line_yto9xr4",m&&"tb_textfield__inner--multiline_yto9xr5"),children:(0,o.jsx)(L,{id:O.current,text:N,caretPosition:v,selectionEnd:S,hasFocus:D})}),Boolean(N.length)||!g||(0,o.jsx)(s.Div,{className:"tb_textfield__placeholder_yto9xre",children:g})]})}));M.displayName="<FakeInput />";var I="tb_content-info--hidden_1p8vdp51",P=(0,s.elementFactory)("tb-plugin-content-info"),N={isLoading:!1,message:""},O=(0,i.createContext)({setState:()=>{}});O.displayName="<ContentInfoSetter />";var D=(0,i.createContext)({state:{...N}});D.displayName="<ContentInfoGetter />";var H=(e,t)=>({...e,...t}),U=()=>{const{setState:e}=(0,i.useContext)(O);return e},F=()=>{const{state:e}=(0,i.useContext)(D);return e},B=({children:e})=>{const[t,n]=(0,i.useReducer)(H,N),a=(0,i.useCallback)((()=>{var e;null==(e=t.button)||e.onClick()}),[t]);return(0,o.jsx)(O.Provider,{value:{setState:n},children:(0,o.jsxs)(D.Provider,{value:{state:t},children:[(0,o.jsxs)(P,{className:(0,r.classes)("tb_content-info__info_1p8vdp53",!t.message&&I),children:[t.isLoading&&(0,o.jsx)(m,{name:"loading",className:"tb_content-info__loading_1p8vdp52"}),(0,o.jsx)(s.Div,{className:(0,r.classes)("tb_content-info__text_1p8vdp56",t.isLoading&&"tb_content-info__text--emphasized_1p8vdp57"),children:t.message}),t.button&&(0,o.jsx)(s.Span,{className:"tb_content-info__button_1p8vdp54",onClick:a,children:t.button.label})]}),(0,o.jsx)(s.Div,{className:(0,r.classes)("tb_content-info__content_1p8vdp55",!!t.message&&I),children:e})]})})};B.displayName="<ContentInfoProvider />";var G=class extends i.Component{constructor(){super(...arguments),c(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError(e)}render(){return!1===this.state.hasError?this.props.children:null}};c(G,"displayName","<ErrorBoundary />");var j="tb_hot-key-label__hidden-unless-focussed_1llw9cke",W="tb_hot-key-label__symbol_1llw9ckb",$=(e,t)=>{switch(t){case"danger":return e.danger;case"common":return e.common;case"locked":return e.locked;case"success":return e.success;default:throw new Error(`[Toolbox] Unknown hot key label type "${t}"`)}},z=({hotKeyIndex:e,tbArrowIndex:t,className:n,children:a,type:l="common",dataTestId:c,disabled:d,onClick:h,onClickOnce:u,onMouseEnter:g,onMouseLeave:p,onFocusIn:_,onFocusOut:E})=>{(({onClick:e,onClickOnce:t})=>{if(!e&&!t)throw new Error("[toolbox] Hot Key Label needs a click handler (either `onClick` or `onClickOnce`).")})({onClick:h,onClickOnce:u});const f=(0,i.useRef)(!1),C="metaKey"===(0,r.getMetaKey)(String(e))?"⌘":"Ctrl",v=$({danger:"tb_hot-key-label__content--danger_1llw9ck4 tb__1llw9ck1",common:"tb_hot-key-label__content--common_1llw9ck2 tb__1llw9ck1",success:"tb_hot-key-label__content--success_1llw9ck5 tb__1llw9ck1",locked:"tb_hot-key-label__content--locked_1llw9ck3 tb__1llw9ck1"},l),S=$({danger:"tb_hot-key-label__meta-key--danger_1llw9ck9 tb__1llw9ck6",common:"tb_hot-key-label__meta-key--common_1llw9ck7 tb__1llw9ck6",locked:"tb_hot-key-label__meta-key--locked_1llw9ck8 tb__1llw9ck6",success:"tb_hot-key-label__meta-key--success_1llw9cka tb__1llw9ck6"},l),b=(0,i.useCallback)((e=>{if(d||f.current)return;const t=h||u;t===u&&(f.current=!0),null==t||t(e)}),[d,h,u]),x=d?{"data-tb-disabled":""}:void 0;return(0,o.jsxs)(s.Div,{className:(0,r.classes)("tb_hot-key-label_1llw9ck0",n),onClick:b,onMouseEnter:g,onMouseLeave:p,onTbFocusIn:_,onTbFocusOut:E,"data-tb-arrowindex":t,"data-tb-hot-key":e,"data-testid":c,...x,children:[(0,o.jsx)(s.Div,{className:v,children:a}),(0,o.jsx)(T,{condition:"locked"===l,children:(0,o.jsx)(s.Span,{className:S,children:(0,o.jsx)(s.Span,{className:"tb_hot-key-label__meta-key__symbol--lock_1llw9ckg",children:(0,o.jsx)(m,{name:"lock"})})})}),(0,o.jsx)(T,{condition:"locked"!==l,children:(0,o.jsxs)(s.Span,{className:(0,r.classes)(S,e>9&&j),children:[(0,o.jsx)(s.Span,{className:(0,r.classes)(W,"⌘"!==C&&"tb_hot-key-label__meta-key__symbol--ctrl_1llw9ckd","⌘"===C&&"tb_hot-key-label__meta-key__symbol--mac_1llw9ckc",e>9&&j),children:C}),(0,o.jsx)(s.Span,{className:(0,r.classes)(W,e>9&&j),children:e}),(0,o.jsx)(s.Span,{className:"tb_hot-key-label__meta-key__symbol--enter_1llw9ckf",children:(0,o.jsx)(m,{name:"enter"})})]})})]})},V=(0,i.createContext)({emit:()=>{}}),K=()=>{const{emit:e}=(0,i.useContext)(V);return e},X=({emit:e,children:t})=>(0,o.jsx)(V.Provider,{value:{emit:e},children:t});X.displayName="<MonitoringContextProvider />";var q=["“","”","„","»","«",'"',"'"].join(""),Y=new RegExp(`^[^${q}]*([${q}])`),Z=new RegExp(`([${q}])[^${q}]*$`),J=({caption:e,isProminent:t,truncateQuote:n,children:a})=>{const l=(0,i.useMemo)((()=>((e="")=>{const t=e.match(Y),n=e.match(Z),s=(null==t?void 0:t[1])&&(null==n?void 0:n[1])?e.indexOf(t[1]):-1,r=(null==t?void 0:t[1])&&(null==n?void 0:n[1])?e.lastIndexOf(n[1]):-1,i=s<r,o=s>-1&&i?e.slice(0,s):e,a=s>-1&&r>-1&&i?e.slice(s+1,r):"",l=r>-1&&i?e.slice(r+1):"";return{prefix:o,openingQuote:t?t[1]:"",highlight:a,closingQuote:n?n[1]:"",suffix:l}})(e)),[e]);return(0,o.jsxs)(o.Fragment,{children:[!!l.prefix&&(0,o.jsxs)(s.Div,{className:(0,r.classes)("tb_list-group-caption_yjfgj20",t&&"tb_list-group-caption--prominent_yjfgj23",!!l.highlight&&n&&"tb_list-group-caption--with-highlight_yjfgj21 tb_list-group-caption_yjfgj20"),children:[l.prefix.trimEnd()," ",(0,o.jsx)(T,{condition:!!l.openingQuote,children:l.openingQuote}),(0,o.jsx)(T,{condition:!!l.highlight,children:(0,o.jsx)(s.Span,{className:(0,r.classes)(n&&"tb_list-group-caption__highlight_yjfgj22"),children:l.highlight})}),(0,o.jsx)(T,{condition:!!l.closingQuote,children:l.closingQuote})," ",l.suffix.trimStart()]}),a]})},Q={top:"tb_tooltip__arrow--placement_top_1bc2eqyj","top-start":"tb_tooltip__arrow--placement_top-start_1bc2eqyk","top-end":"tb_tooltip__arrow--placement_top-end_1bc2eqyl",bottom:"tb_tooltip__arrow--placement_bottom_1bc2eqym","bottom-start":"tb_tooltip__arrow--placement_bottom-start_1bc2eqyn","bottom-end":"tb_tooltip__arrow--placement_bottom-end_1bc2eqyo",left:"tb_tooltip__arrow--placement_left_1bc2eqyp","left-start":"tb_tooltip__arrow--placement_left-start_1bc2eqyq","left-end":"tb_tooltip__arrow--placement_left-end_1bc2eqyr",right:"tb_tooltip__arrow--placement_right_1bc2eqys","right-start":"tb_tooltip__arrow--placement_right-start_1bc2eqyt","right-end":"tb_tooltip__arrow--placement_right-end_1bc2eqyu"},ee={default:"tb_tooltip__arrow--variant_default_1bc2eqyh",custom:"tb_tooltip__arrow--variant_custom_1bc2eqyi"},te={default:"tb_tooltip__bubble--variant_default_1bc2eqy2",custom:"tb_tooltip__bubble--variant_custom_1bc2eqy3"},ne={top:"tb_tooltip__placement_top_1bc2eqy4","top-start":"tb_tooltip__placement_top-start_1bc2eqy5","top-end":"tb_tooltip__placement_top-end_1bc2eqy6",bottom:"tb_tooltip__placement_bottom_1bc2eqy7","bottom-start":"tb_tooltip__placement_bottom-start_1bc2eqy8","bottom-end":"tb_tooltip__placement_bottom-end_1bc2eqy9",left:"tb_tooltip__placement_left_1bc2eqya","left-start":"tb_tooltip__placement_left-start_1bc2eqyb","left-end":"tb_tooltip__placement_left-end_1bc2eqyc",right:"tb_tooltip__placement_right_1bc2eqyd","right-start":"tb_tooltip__placement_right-start_1bc2eqye","right-end":"tb_tooltip__placement_right-end_1bc2eqyf"},se="tb_tooltip__trigger_1bc2eqyv",re=!0,ie="default",oe="top",ae=!0,le=!0,ce=({title:e,children:t,variant:n=ie,placement:a=oe,disablePortal:l=ae,container:c,getElement:d,hasWrapper:h=le,showTooltip:u=!0,mandatory:g=!1,zIndex:m,maxWidth:p,arrow:_=re,className:E})=>{const[f,T]=(0,i.useState)(!1),C=(g||u)&&f&&!(null==(v=e)||"string"==typeof v&&""===v.trim());var v;const S=(0,i.useMemo)((()=>{const e={};return"number"==typeof m&&(e.zIndex=m),"number"==typeof p?e.maxWidth=`${p}px`:"string"==typeof p&&(e.maxWidth=p),e}),[m,p]),b=()=>T(!0),x=()=>T(!1),y={onMouseEnter:b,onMouseLeave:x,onFocus:b,onBlur:x,"aria-haspopup":!0,"aria-expanded":C},A=(0,o.jsxs)(s.Div,{role:"tooltip",className:(0,r.classes)("tb_tooltip__bubble_1bc2eqy0",te[n],ne[a],C&&"tb_tooltip__bubble--visible_1bc2eqy1",E),style:S,children:[e,_&&(0,o.jsx)(s.Div,{className:(0,r.classes)("tb_tooltip__arrow_1bc2eqyg",ee[n],Q[a])})]}),k=h?(0,o.jsxs)(s.Span,{className:se,...y,children:[t,A]}):(0,i.isValidElement)(t)?(0,o.jsxs)(o.Fragment,{children:[(0,i.cloneElement)(t,y),(0,o.jsx)(s.Div,{className:se,children:A})]}):(0,o.jsxs)(s.Span,{className:se,...y,children:[t,A]});return(0,o.jsx)(o.Fragment,{children:k})};ce.displayName="<Tooltip />"},
vendor: 3,296 bytes, lines 16-19
16"../../../node_modules/@advanced-toolbox/elements/dist/base.mjs":
17/*!**********************************************************************!*\
18  !*** ../../../node_modules/@advanced-toolbox/elements/dist/base.mjs ***!
19  \**********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Div:()=>o,Span:()=>a,elementFactory:()=>i});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs");const i=e=>{const t=({children:t,className:n,...i},o)=>{const{onChange:a,onInput:l,onClick:c,onContextMenu:d,onMouseDown:h,onMouseUp:u,onMouseOver:g,onMouseOut:m,onMouseEnter:p,onMouseLeave:_,onMouseMove:E,onPointerDown:f,onPointerUp:T,onScroll:C,onTbFocusIn:v,onTbFocusOut:S,"data-tb-arrowindex":b,...x}=i,y=e.includes("-")?{class:n}:{className:n},A=(0,r.isUndefined)(b)?{}:{"data-tb-arrowindex":b},k=(0,s.useRef)([]),w=(e=>Object.entries(e).filter((e=>!e[0].startsWith("onkey")||(console.warn("[toolbox] Native keyboard events aren't supported; listen to 'tb-event.keyboard' on the `document` instead."),!1))).filter((([e,t])=>(0,r.isFunction)(t))).map((([e,t])=>[e.replace("on","").toLowerCase(),t])))({onChange:a,onInput:l,onClick:c,onContextMenu:d,onMouseDown:h,onMouseUp:u,onMouseOver:g,onMouseOut:m,onMouseEnter:p,onMouseLeave:_,onMouseMove:E,onPointerDown:f,onPointerUp:T,onScroll:C}),R=(0,s.useRef)(null),L=(0,s.useMemo)((()=>o||R),[o,R]);return(0,s.useEffect)((()=>{if((0,r.isFunction)(L))return void console.warn("[Toolbox] Element <%s /> got passed a function into the `ref` property. `ref` functions are not supported. Pass in the result of `useRef(…)` instead.",e);const t=k.current,n=L?.current;return n&&w.map((([e,t])=>{if(["mouseenter","mouseleave"].includes(e)){const s=e=>{const n=(0,r.getEventTarget)(e);n&&t((0,r.createToolboxEventObject)(e,n))};n.addEventListener(e,s),k.current.push((()=>n.removeEventListener(e,s)))}else k.current.push((0,r.bindCapturedEvent)(n,e,t))})),()=>t.forEach((e=>e()))}),[w,k,L]),(0,s.useEffect)((()=>{if(!(0,r.isFunction)(v)&&!(0,r.isFunction)(S))return;if((0,r.isFunction)(L))return void console.warn("[Toolbox] Element <%s /> got passed a function into the `ref` property. `ref` functions are not supported. Pass in the result of `useRef(…)` instead.",e);if((0,r.isUndefined)(b))return void console.warn("[Toolbox] Cannot listen to focusin/focusout events on non-focusable element <%s />; add `data-tb-arrowindex` to make it focusable.",e);if((0,r.isBoolean)(b))return void console.warn("[Toolbox] Cannot listen to focusin/focusout events on focusable wrapper element <%s />; bind listener to focusable child elements instead.",e);const t=Number(b);if(!Number.isInteger(t)||t<-1)return void console.warn('[Toolbox] Element <%s data-tb-arrowindex="%s" /> received invalid non-numerical/negative `data-tb-arrowindex` value.',e,b);const n=L?.current;if(!n)return;const s=e=>v?.(e),i=e=>S?.(e);return n.addEventListener(r.EVENT_TYPE_FOCUSIN,s,!0),n.addEventListener(r.EVENT_TYPE_FOCUSOUT,i,!0),()=>{n.removeEventListener(r.EVENT_TYPE_FOCUSIN,s,!0),n.removeEventListener(r.EVENT_TYPE_FOCUSOUT,i,!0)}}),[b,v,S]),(0,s.createElement)(e,{ref:L,...y,...A,...x},t)};return t.displayName=`Comp(<${e} />)`,(0,s.forwardRef)(t)},o=i("div"),a=i("span")},
vendor: 493 bytes, lines 19-22
19"../../../node_modules/@advanced-toolbox/elements/dist/index.mjs":
20/*!***********************************************************************!*\
21  !*** ../../../node_modules/@advanced-toolbox/elements/dist/index.mjs ***!
22  \***********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Div:()=>s.Div,Span:()=>s.Span,elementFactory:()=>s.elementFactory});var s=n(/*! ./base.mjs */"../../../node_modules/@advanced-toolbox/elements/dist/base.mjs")},
vendor: 413 bytes, lines 22-25
22"../../../node_modules/@advanced-toolbox/lang.js/dist/context.mjs":
23/*!************************************************************************!*\
24  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/context.mjs ***!
25  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{I18nContext:()=>s});const s=(0,n(/*! react */"react").createContext)(null)},
vendor: 790 bytes, lines 25-28
25"../../../node_modules/@advanced-toolbox/lang.js/dist/helpers.mjs":
26/*!************************************************************************!*\
27  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/helpers.mjs ***!
28  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{flattenTranslationDict:()=>s,transformMessageStructure:()=>r});const s=e=>{const t=Object.entries(e),n={};for(const[e,{message:s}]of t)n[e]=s;return n},r=(e,t)=>{const n={};for(const[r,i]of Object.entries(e))for(const[e,o]of Object.entries(i)){if(t&&t!==e)throw new Error(`[toolbox] i18n got configured with the namespace "${t}", but found a different namespace "${e}" in the translation data. Please align both values.`);n[`${r}.${e}`]=s(o)}return n}},
vendor: 661 bytes, lines 28-31
28"../../../node_modules/@advanced-toolbox/lang.js/dist/hook.mjs":
29/*!*********************************************************************!*\
30  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/hook.mjs ***!
31  \*********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useI18n:()=>i});var s=n(/*! react */"react"),r=n(/*! ./context.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/context.mjs");const i=()=>{const e=(0,s.useContext)(r.I18nContext);return(0,s.useMemo)((()=>({get:(t,n)=>e.get(t,n),choice:(t,n,s)=>e.choice(t,n,s),getLocale:()=>e.getLocale(),has:t=>e.has(t),util:e.util})),[])}},
vendor: 1,950 bytes, lines 31-34
31"../../../node_modules/@advanced-toolbox/lang.js/dist/index.mjs":
32/*!**********************************************************************!*\
33  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/index.mjs ***!
34  \**********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{I18nProvider:()=>f,createI18n:()=>E,useI18n:()=>p.useI18n});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! ../i18n/de.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/de.json"),o=n(/*! ../i18n/en.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/en.json"),a=n(/*! ../i18n/es.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/es.json"),l=n(/*! ../i18n/fr.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/fr.json"),c=n(/*! ../i18n/nl.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/nl.json"),d=n(/*! ../i18n/pt-br.json */"../../../node_modules/@advanced-toolbox/lang.js/i18n/pt-br.json"),h=n(/*! ./context.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/context.mjs"),u=n(/*! ./helpers.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/helpers.mjs"),g=n(/*! ./lang.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/lang.mjs"),m=n(/*! ./util.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/util.mjs"),p=n(/*! ./hook.mjs */"../../../node_modules/@advanced-toolbox/lang.js/dist/hook.mjs");const _={de:i,en:o,es:a,fr:l,nl:c,"pt-br":d},E=(e,t,n="")=>{(0,r.assertUiLanguage)(e);const s=new g.LangWithCustomPlaceholders({locale:e,fallback:r.DEFAULT_UI_LANGUAGE,messages:(0,u.transformMessageStructure)(_,"lang")},"lang");return new g.LangWithUtil({locale:e,fallback:r.DEFAULT_UI_LANGUAGE,messages:(0,u.transformMessageStructure)(t,n)},n,new m.I18nUtil(s))},f=({i18n:e,children:t})=>(0,s.createElement)(h.I18nContext.Provider,{value:e},t)},
vendor: 1,483 bytes, lines 34-37
34"../../../node_modules/@advanced-toolbox/lang.js/dist/lang.mjs":
35/*!*********************************************************************!*\
36  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/lang.mjs ***!
37  \*********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LangWithCustomPlaceholders:()=>i,LangWithUtil:()=>o});var s=n(/*! lang.js */"../../../node_modules/lang.js/src/lang.js"),r=n(/*! snarkdown */"../../../node_modules/snarkdown/dist/snarkdown.es.js");class i extends s{namespace;keys=new Map;constructor(e,t){super(e),this.namespace=t}has(e,t){return super.has(this._nsKey(e),t)}get(e,t,n){return(0,r.default)(super.get(this._nsKey(e),t,n))}trans(e,t){return(0,r.default)(super.trans(this._nsKey(e),t))}choice(e,t,n,s){return(0,r.default)(super.choice(this._nsKey(e),t,n,s))}transChoice(e,t,n){return(0,r.default)(super.transChoice(this._nsKey(e),t,n))}_nsKey(e){let t=this.keys.get(e);if(!t){const n=this.namespace+".";t=this.namespace&&!e.startsWith(n)?n+e:e,this.keys.set(e,t)}return t}_applyReplacements(e,t){return Object.keys(t).sort(this._sortReplacementKeys).forEach((function(n){e=e.replace(new RegExp("%{"+n+"}","gi"),(function(e){const s=t[n];return e===e.toUpperCase()?s.toUpperCase():e===e.replace(/\w/i,(function(e){return e.toUpperCase()}))?s.charAt(0).toUpperCase()+s.slice(1):s}))})),e}}class o extends i{i18nUtil;constructor(e,t,n){super(e,t),this.i18nUtil=n}get util(){return this.i18nUtil}}},
vendor: 445 bytes, lines 37-40
37"../../../node_modules/@advanced-toolbox/lang.js/dist/util.mjs":
38/*!*********************************************************************!*\
39  !*** ../../../node_modules/@advanced-toolbox/lang.js/dist/util.mjs ***!
40  \*********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{I18nUtil:()=>s});class s{i18n;constructor(e){this.i18n=e}getLanguageNameByCode=e=>this.i18n.get(`language-name.${e}`)}},
vendor: 2,688 bytes, lines 40-43
40"../../../node_modules/@advanced-toolbox/lang.js/i18n/de.json":
41/*!********************************************************************!*\
42  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/de.json ***!
43  \********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Arabisch"},"language-name.as":{"message":"Assamesisch"},"language-name.bn":{"message":"Bengali"},"language-name.bs":{"message":"Bosnisch"},"language-name.ceb":{"message":"Cebuano"},"language-name.cs":{"message":"Tschechisch"},"language-name.da":{"message":"Dänisch"},"language-name.de":{"message":"Deutsch"},"language-name.de-ch":{"message":"Deutsch (Schweiz)"},"language-name.de-de":{"message":"Deutsch"},"language-name.el":{"message":"Griechisch"},"language-name.en":{"message":"Englisch"},"language-name.en-gb":{"message":"Englisch (UK)"},"language-name.en-us":{"message":"Englisch (US)"},"language-name.es":{"message":"Spanisch"},"language-name.fa":{"message":"Persisch"},"language-name.fi":{"message":"Finnisch"},"language-name.fr":{"message":"Französisch"},"language-name.gu":{"message":"Gujarati"},"language-name.he":{"message":"Hebräisch"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Kroatisch"},"language-name.hu":{"message":"Ungarisch"},"language-name.id":{"message":"Indonesisch"},"language-name.it":{"message":"Italienisch"},"language-name.ja":{"message":"Japanisch"},"language-name.kn":{"message":"Kannada"},"language-name.ko":{"message":"Koreanisch"},"language-name.ml":{"message":"Malayalam"},"language-name.mr":{"message":"Marathi"},"language-name.ms":{"message":"Malaiisch"},"language-name.ne":{"message":"Nepalesisch"},"language-name.nl":{"message":"Niederländisch"},"language-name.no":{"message":"Norwegisch"},"language-name.or":{"message":"Odia"},"language-name.pa":{"message":"Punjabi"},"language-name.pl":{"message":"Polnisch"},"language-name.pt":{"message":"Portugiesisch"},"language-name.ro":{"message":"Rumänisch"},"language-name.ru":{"message":"Russisch"},"language-name.sa":{"message":"Sanskrit"},"language-name.si":{"message":"Singhalesisch"},"language-name.sl":{"message":"Slowenisch"},"language-name.sr":{"message":"Serbisch"},"language-name.sv":{"message":"Schwedisch"},"language-name.ta":{"message":"Tamil"},"language-name.te":{"message":"Telugu"},"language-name.th":{"message":"Thai"},"language-name.tl":{"message":"Tagalog"},"language-name.tr":{"message":"Türkisch"},"language-name.uk":{"message":"Ukrainisch"},"language-name.ur":{"message":"Urdu"},"language-name.vi":{"message":"Vietnamesisch"},"language-name.zh":{"message":"Chinesisch (vereinfacht)"}}}')},
vendor: 2,588 bytes, lines 43-46
43"../../../node_modules/@advanced-toolbox/lang.js/i18n/en.json":
44/*!********************************************************************!*\
45  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/en.json ***!
46  \********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Arabic"},"language-name.as":{"message":"Assamese"},"language-name.bn":{"message":"Bengali"},"language-name.bs":{"message":"Bosnian"},"language-name.ceb":{"message":"Cebuano"},"language-name.cs":{"message":"Czech"},"language-name.da":{"message":"Danish"},"language-name.de":{"message":"German"},"language-name.de-ch":{"message":"German (Swiss)"},"language-name.de-de":{"message":"German"},"language-name.el":{"message":"Greek"},"language-name.en":{"message":"English"},"language-name.en-gb":{"message":"English (UK)"},"language-name.en-us":{"message":"English (US)"},"language-name.es":{"message":"Spanish"},"language-name.fa":{"message":"Persian"},"language-name.fi":{"message":"Finnish"},"language-name.fr":{"message":"French"},"language-name.gu":{"message":"Gujarati"},"language-name.he":{"message":"Hebrew"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Croatian"},"language-name.hu":{"message":"Hungarian"},"language-name.id":{"message":"Indonesian"},"language-name.it":{"message":"Italian"},"language-name.ja":{"message":"Japanese"},"language-name.kn":{"message":"Kannada"},"language-name.ko":{"message":"Korean"},"language-name.ml":{"message":"Malayalam"},"language-name.mr":{"message":"Marathi"},"language-name.ms":{"message":"Malay"},"language-name.ne":{"message":"Nepali"},"language-name.nl":{"message":"Dutch"},"language-name.no":{"message":"Norwegian"},"language-name.or":{"message":"Odia"},"language-name.pa":{"message":"Punjabi"},"language-name.pl":{"message":"Polish"},"language-name.pt":{"message":"Portuguese"},"language-name.ro":{"message":"Romanian"},"language-name.ru":{"message":"Russian"},"language-name.sa":{"message":"Sanskrit"},"language-name.si":{"message":"Sinhala"},"language-name.sl":{"message":"Slovenian"},"language-name.sr":{"message":"Serbian"},"language-name.sv":{"message":"Swedish"},"language-name.ta":{"message":"Tamil"},"language-name.te":{"message":"Telugu"},"language-name.th":{"message":"Thai"},"language-name.tl":{"message":"Tagalog"},"language-name.tr":{"message":"Turkish"},"language-name.uk":{"message":"Ukrainian"},"language-name.ur":{"message":"Urdu"},"language-name.vi":{"message":"Vietnamese"},"language-name.zh":{"message":"Chinese (simplified)"}}}')},
vendor: 2,612 bytes, lines 46-49
46"../../../node_modules/@advanced-toolbox/lang.js/i18n/es.json":
47/*!********************************************************************!*\
48  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/es.json ***!
49  \********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Árabe"},"language-name.as":{"message":"Asamés"},"language-name.bn":{"message":"Bengalí"},"language-name.bs":{"message":"Bosnio"},"language-name.ceb":{"message":"Cebuano"},"language-name.cs":{"message":"Checo"},"language-name.da":{"message":"Danés"},"language-name.de":{"message":"Alemán"},"language-name.de-ch":{"message":"Alemán (suizo)"},"language-name.de-de":{"message":"Alemán"},"language-name.el":{"message":"Griego"},"language-name.en":{"message":"Inglés"},"language-name.en-gb":{"message":"Inglés (Reino Unido)"},"language-name.en-us":{"message":"Inglés (EE. UU.)"},"language-name.es":{"message":"Español"},"language-name.fa":{"message":"Persa"},"language-name.fi":{"message":"Finlandés"},"language-name.fr":{"message":"Francés"},"language-name.gu":{"message":"Guyaratí"},"language-name.he":{"message":"Hebreo"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Croata"},"language-name.hu":{"message":"Húngaro"},"language-name.id":{"message":"Indonesio"},"language-name.it":{"message":"Italiano"},"language-name.ja":{"message":"Japonés"},"language-name.kn":{"message":"Canarés"},"language-name.ko":{"message":"Coreano"},"language-name.ml":{"message":"Malabar"},"language-name.mr":{"message":"Maratí"},"language-name.ms":{"message":"Malayo"},"language-name.ne":{"message":"Nepalí"},"language-name.nl":{"message":"Holandés"},"language-name.no":{"message":"Noruego"},"language-name.or":{"message":"Oriya"},"language-name.pa":{"message":"Punyabí"},"language-name.pl":{"message":"Polaco"},"language-name.pt":{"message":"Portugués"},"language-name.ro":{"message":"Rumano"},"language-name.ru":{"message":"Ruso"},"language-name.sa":{"message":"Sánscrito"},"language-name.si":{"message":"Cingalés"},"language-name.sl":{"message":"Esloveno"},"language-name.sr":{"message":"Serbio"},"language-name.sv":{"message":"Sueco"},"language-name.ta":{"message":"Tamil"},"language-name.te":{"message":"Télugu"},"language-name.th":{"message":"Tailandés"},"language-name.tl":{"message":"Tagalo"},"language-name.tr":{"message":"Turco"},"language-name.uk":{"message":"Ucraniano"},"language-name.ur":{"message":"Urdu"},"language-name.vi":{"message":"Vietnamita"},"language-name.zh":{"message":"Chino (simplificado)"}}}')},
vendor: 2,645 bytes, lines 49-52
49"../../../node_modules/@advanced-toolbox/lang.js/i18n/fr.json":
50/*!********************************************************************!*\
51  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/fr.json ***!
52  \********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Arabe"},"language-name.as":{"message":"Assamais"},"language-name.bn":{"message":"Bengali"},"language-name.bs":{"message":"Bosniaque"},"language-name.ceb":{"message":"Cebuano"},"language-name.cs":{"message":"Tchèque"},"language-name.da":{"message":"Danois"},"language-name.de":{"message":"Allemand"},"language-name.de-ch":{"message":"Allemand (Suisse)"},"language-name.de-de":{"message":"Allemand"},"language-name.el":{"message":"Grec"},"language-name.en":{"message":"Anglais"},"language-name.en-gb":{"message":"Anglais (Royaume-Uni)"},"language-name.en-us":{"message":"Anglais (États-Unis)"},"language-name.es":{"message":"Espagnol"},"language-name.fa":{"message":"Persan"},"language-name.fi":{"message":"Finlandais"},"language-name.fr":{"message":"Français"},"language-name.gu":{"message":"Gujarati"},"language-name.he":{"message":"Hébreu"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Croate"},"language-name.hu":{"message":"Hongrois"},"language-name.id":{"message":"Indonésien"},"language-name.it":{"message":"Italien"},"language-name.ja":{"message":"Japonais"},"language-name.kn":{"message":"Kannada"},"language-name.ko":{"message":"Coréen"},"language-name.ml":{"message":"Malayalam"},"language-name.mr":{"message":"Marathi"},"language-name.ms":{"message":"Malais"},"language-name.ne":{"message":"Népalais"},"language-name.nl":{"message":"Néerlandais"},"language-name.no":{"message":"Norvégien"},"language-name.or":{"message":"Odia"},"language-name.pa":{"message":"Pendjabi"},"language-name.pl":{"message":"Polonais"},"language-name.pt":{"message":"Portugais"},"language-name.ro":{"message":"Roumain"},"language-name.ru":{"message":"Russe"},"language-name.sa":{"message":"Sanskrit"},"language-name.si":{"message":"Cinghalais"},"language-name.sl":{"message":"Slovène"},"language-name.sr":{"message":"Serbe"},"language-name.sv":{"message":"Suédois"},"language-name.ta":{"message":"Tamoul"},"language-name.te":{"message":"Télougou"},"language-name.th":{"message":"Thaïlandais"},"language-name.tl":{"message":"Tagalog"},"language-name.tr":{"message":"Turc"},"language-name.uk":{"message":"Ukrainien"},"language-name.ur":{"message":"Ourdou"},"language-name.vi":{"message":"Vietnamien"},"language-name.zh":{"message":"Chinois (simplifié)"}}}')},
vendor: 2,605 bytes, lines 52-55
52"../../../node_modules/@advanced-toolbox/lang.js/i18n/nl.json":
53/*!********************************************************************!*\
54  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/nl.json ***!
55  \********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Arabisch"},"language-name.as":{"message":"Assamees"},"language-name.bn":{"message":"Bengaals"},"language-name.bs":{"message":"Bosnisch"},"language-name.ceb":{"message":"Cebuaans"},"language-name.cs":{"message":"Tsjechisch"},"language-name.da":{"message":"Deens"},"language-name.de":{"message":"Duits"},"language-name.de-ch":{"message":"Duits (Zwitsers)"},"language-name.de-de":{"message":"Duits"},"language-name.el":{"message":"Grieks"},"language-name.en":{"message":"Engels"},"language-name.en-gb":{"message":"Engels (VK)"},"language-name.en-us":{"message":"Engels (VS)"},"language-name.es":{"message":"Spaans"},"language-name.fa":{"message":"Perzisch"},"language-name.fi":{"message":"Fins"},"language-name.fr":{"message":"Frans"},"language-name.gu":{"message":"Gujarati"},"language-name.he":{"message":"Hebreeuws"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Kroatisch"},"language-name.hu":{"message":"Hongaars"},"language-name.id":{"message":"Indonesisch"},"language-name.it":{"message":"Italiaans"},"language-name.ja":{"message":"Japans"},"language-name.kn":{"message":"Kannada"},"language-name.ko":{"message":"Koreaans"},"language-name.ml":{"message":"Malayalam"},"language-name.mr":{"message":"Marathi"},"language-name.ms":{"message":"Maleis"},"language-name.ne":{"message":"Nepalees"},"language-name.nl":{"message":"Nederlands"},"language-name.no":{"message":"Noors"},"language-name.or":{"message":"Odia"},"language-name.pa":{"message":"Punjabi"},"language-name.pl":{"message":"Pools"},"language-name.pt":{"message":"Portugees"},"language-name.ro":{"message":"Roemeens"},"language-name.ru":{"message":"Russisch"},"language-name.sa":{"message":"Sanskriet"},"language-name.si":{"message":"Singalees"},"language-name.sl":{"message":"Sloveens"},"language-name.sr":{"message":"Servisch"},"language-name.sv":{"message":"Zweeds"},"language-name.ta":{"message":"Tamil"},"language-name.te":{"message":"Telugu"},"language-name.th":{"message":"Thais"},"language-name.tl":{"message":"Tagalog"},"language-name.tr":{"message":"Turks"},"language-name.uk":{"message":"Oekraïens"},"language-name.ur":{"message":"Urdu"},"language-name.vi":{"message":"Vietnamees"},"language-name.zh":{"message":"Chinees (vereenvoudigd)"}}}')},
vendor: 2,641 bytes, lines 55-58
55"../../../node_modules/@advanced-toolbox/lang.js/i18n/pt-br.json":
56/*!***********************************************************************!*\
57  !*** ../../../node_modules/@advanced-toolbox/lang.js/i18n/pt-br.json ***!
58  \***********************************************************************/e=>{"use strict";e.exports=JSON.parse('{"lang":{"language-name.ar":{"message":"Árabe"},"language-name.as":{"message":"Assamês"},"language-name.bn":{"message":"Bengali"},"language-name.bs":{"message":"Bósnio"},"language-name.ceb":{"message":"Cebuano"},"language-name.cs":{"message":"Tcheco"},"language-name.da":{"message":"Dinamarquês"},"language-name.de":{"message":"Alemão"},"language-name.de-ch":{"message":"Alemão (Suíço)"},"language-name.de-de":{"message":"Alemão"},"language-name.el":{"message":"Grego"},"language-name.en":{"message":"Inglês"},"language-name.en-gb":{"message":"Inglês (Reino Unido)"},"language-name.en-us":{"message":"Inglês (EUA)"},"language-name.es":{"message":"Espanhol"},"language-name.fa":{"message":"Persa"},"language-name.fi":{"message":"Finlandês"},"language-name.fr":{"message":"Francês"},"language-name.gu":{"message":"Gujarate"},"language-name.he":{"message":"Hebraico"},"language-name.hi":{"message":"Hindi"},"language-name.hr":{"message":"Croata"},"language-name.hu":{"message":"Húngaro"},"language-name.id":{"message":"Indonésio"},"language-name.it":{"message":"Italiano"},"language-name.ja":{"message":"Japonês"},"language-name.kn":{"message":"Canarês"},"language-name.ko":{"message":"Coreano"},"language-name.ml":{"message":"Malaiala"},"language-name.mr":{"message":"Marata"},"language-name.ms":{"message":"Malaio"},"language-name.ne":{"message":"Nepalês"},"language-name.nl":{"message":"Holandês"},"language-name.no":{"message":"Norueguês"},"language-name.or":{"message":"Oriá"},"language-name.pa":{"message":"Punjabi"},"language-name.pl":{"message":"Polonês"},"language-name.pt":{"message":"Português"},"language-name.ro":{"message":"Romeno"},"language-name.ru":{"message":"Russo"},"language-name.sa":{"message":"Sânscrito"},"language-name.si":{"message":"Cingalês"},"language-name.sl":{"message":"Esloveno"},"language-name.sr":{"message":"Sérvio"},"language-name.sv":{"message":"Sueco"},"language-name.ta":{"message":"Tâmil"},"language-name.te":{"message":"Télugo"},"language-name.th":{"message":"Tailandês"},"language-name.tl":{"message":"Tagalo"},"language-name.tr":{"message":"Turco"},"language-name.uk":{"message":"Ucraniano"},"language-name.ur":{"message":"Urdu"},"language-name.vi":{"message":"Vietnamita"},"language-name.zh":{"message":"Chinês (simplificado)"}}}')},
vendor: 26,632 bytes, lines 58-61
58"../../../node_modules/@advanced-toolbox/plugin-emoji-picker/dist/index.js":
59/*!*********************************************************************************!*\
60  !*** ../../../node_modules/@advanced-toolbox/plugin-emoji-picker/dist/index.js ***!
61  \*********************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ToolboxPluginEmojiPicker:()=>$,ToolboxPluginEmojiPickerAdapter:()=>G});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/components */"../../../node_modules/@advanced-toolbox/components/dist/index.js"),i=n(/*! @advanced-toolbox/lang.js */"../../../node_modules/@advanced-toolbox/lang.js/dist/index.mjs"),o=n(/*! @advanced-toolbox/plugin */"../../../node_modules/@advanced-toolbox/plugin/dist/index.mjs"),a=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),l=n(/*! @advanced-toolbox/elements */"../../../node_modules/@advanced-toolbox/elements/dist/index.mjs"),c=n(/*! react/jsx-runtime */"react/jsx-runtime"),d=Object.defineProperty,h=(e,t,n)=>((e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),u="userPreferredSkinTone",g=(0,s.createContext)({}),m=Object.assign((0,s.createContext)({allEmojis:[],contextEmojis:[]}),{mapEmojiValueToObject:(e,t)=>t.map((t=>e.find((({emoji:e})=>e===t)))).filter((e=>!!e))});function p(e,t){return e.map((e=>function(e,t){var n;return e.skins&&e.skins.length&&null!=(n=e.skins.find((e=>e.tone===t)))?n:e}(e,t))).filter((e=>e.emoji.length<=4))}function _(e,t){return!(!t||"Default"===t)&&!!e.tone&&(Array.isArray(e.tone)?e.tone.includes(t):e.tone===t)}function E(e){return e.filter(((e,t,n)=>n.findIndex((t=>e===t))===t))}function f(e){return(0,c.jsx)(l.Div,{className:"tb_skin-tone-menu_1rvif8x0",children:e.options.map(((t,n)=>(0,c.jsx)(l.Span,{"data-testid":`icon-${n}`,className:"tb_skin-tone-menu__item_1rvif8x1",onClick:()=>e.onSelectSkinTone(t.tone),children:t.emoji},n)))})}var T="raised hand",C={"custom-smileys-emotion-and-people-body":()=>(0,c.jsx)(r.Icon,{name:"smileys"}),"custom-objects-and-symbols":()=>(0,c.jsx)(r.Icon,{name:"objects"}),activities:()=>(0,c.jsx)(r.Icon,{name:"activities"}),"animals-nature":()=>(0,c.jsx)(r.Icon,{name:"nature"}),flags:()=>(0,c.jsx)(r.Icon,{name:"flag"}),"food-drink":()=>(0,c.jsx)(r.Icon,{name:"food"}),"travel-places":()=>(0,c.jsx)(r.Icon,{name:"travel"}),custom:()=>(0,c.jsx)(r.Icon,{name:"star"})};function v(e){return{...e,icon:C[e.key]}}function S(e){const t=(0,r.useMonitoringContext)(),{allEmojis:n}=(0,s.useContext)(m),[i,o]=(0,s.useState)(!1),a=e.groups.map(v),d=e.userPreferredSkinTone,h=function(e){var t,n;const s=e.find((e=>e.label===T));if(!s)return console.warn("could not find emoji in the dataset. emoji label name: ",T),[];const r=null!=(n=null==(t=s.skins)?void 0:t.map((e=>({emoji:e.emoji,tone:e.tone}))))?n:[];return[{emoji:s.emoji,tone:"Default"},...r]}(n),u=d?h.find((e=>e.tone===d)):h.find((e=>"Default"===e.tone)),{activeEmojiSection:g}=((e,t)=>{const[n,r]=(0,s.useState)({groupKey:"custom",intersectionRatio:1});return(0,s.useEffect)((()=>{const n=e.map((e=>e.groupHeadingRef.current)).filter((e=>Boolean(e)));if(!t||!n.length)return;const s=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.dataset.groupKey;r((e=>e.groupKey!==t?{groupKey:t,intersectionRatio:1}:e))}}))}),{threshold:.99,root:t,rootMargin:"0px 0px -70% 0px"});return n.forEach((e=>s.observe(e))),()=>s.disconnect()}),[e,t]),{activeEmojiSection:n.groupKey}})(e.groups,e.scrollAreaRef);return(0,c.jsxs)(l.Div,{className:"tb__wzddyk5","data-tb-tabindex":!0,"data-tb-arrowdirection":"horizontal",children:[(0,c.jsx)(l.Div,{className:"tb__wzddyk6",children:a.map(((t,n)=>(0,c.jsx)(l.Span,{"data-tb-arrowindex":n,className:g===t.key?"tb__wzddyk8 tb__wzddyk7 tb__wzddyk0":"tb__wzddyk7 tb__wzddyk0",onClick:()=>e.onGroupClicked(t.groupRef.current),children:(0,c.jsx)(t.icon,{})},t.key)))}),(0,c.jsxs)(l.Div,{"data-tb-arrowindex":a.length,className:"tb__wzddyk2",onClick:()=>{o((e=>!e))},children:[i&&(0,c.jsx)(l.Div,{className:"tb_skin-tone_wzddyk1",children:(0,c.jsx)(f,{onSelectSkinTone:n=>{t({name:"toolbox:action",data:`plugin_emoji_picker:skin-tone-changed:${n}`}),o(!1),e.onSelectSkinTone(n)},options:h})}),(0,c.jsx)(l.Div,{className:"tb__wzddyk3",children:(0,c.jsxs)(l.Div,{className:"tb__wzddyk4 tb__wzddyk0",children:[(0,c.jsx)(l.Span,{children:u&&u.emoji}),(0,c.jsx)(r.Icon,{name:"dropdown-caret"})]})})]})]})}var b="FREQUENTLY_USED",x=["😊","😃","❤️","👍️","🙏","🔥","🥳","🎉","😘","🥰","😍","🤣","😂","😭","☺️","🥺","🤗","🫶","🚀","💪","👌","⭐️","✅️","💩","✨️","👀","🫡","🤷"],y=Object.fromEntries(x.map((e=>[e,0])));function A(e,t,n=1/0){const s=Object.entries(t);return s.sort(((e,t)=>t[1]-e[1])),s.slice(0,30).map((([e])=>e)).map((t=>e.find((e=>e.emoji===t)))).filter((e=>void 0!==e)).slice(0,n)}function k(e){const{allEmojis:t}=(0,s.useContext)(m),n=(0,s.useContext)(g),[r,i]=(0,s.useState)({});return(0,s.useEffect)((()=>{n.read(b).then((e=>{const t=!e||!Object.entries(e).length;i(t?y:e)})).finally(e)}),[e,n]),{frequentlyUsedEmojis:A(t,r),updateFrequentlyUsedEmojisMap:e=>{const t={...r,[e.emoji]:(r[e.emoji]||0)+1};n.write(b,t).then((()=>{i(t)}))}}}function w(e){return(0,c.jsx)(l.Div,{style:{"--tb-grid-cols":`${M}`},className:"tb__snfw090","data-tb-tabindex":!0,"data-tb-arrowdirection":"grid","data-testid":`emoji-group-${e.groupKey}`,children:e.emojis.map(((t,n)=>(0,c.jsx)(l.Span,{"data-testid":`emoji-${e.groupKey}-${e.tbTabIndex+n}`,"data-tb-arrowindex":e.tbTabIndex+n,className:"tb__snfw091",title:t.label,onClick:()=>e.onEmojiSelected(t),children:t.emoji},n)))})}var R="tb__1qlf0rw0",L="tb__1qlf0rw1",M=7;function I(e){const{userPreferredSkinTone:t,onEmojiSelected:n,customGroup:r}=e,{allEmojis:i,contextEmojis:o}=(0,s.useContext)(m),{frequentlyUsedEmojis:a,updateFrequentlyUsedEmojisMap:d}=k(e.onLoadFrequentlyUsedEmojis),h=(0,s.useCallback)((e=>{var s,r,i;const o=null!=(i=null==(r=null==(s=e.skins)?void 0:s.find((e=>_(e,t))))?void 0:r.emoji)?i:e.emoji;d(e),n(o)}),[t,n,d]),u=((e,t,n)=>{const{allEmojis:r}=(0,s.useContext)(m),i=e.sort(((e,t)=>e.order-t.order));function o(e){return p("custom-smileys-emotion-and-people-body"===e.key?r.filter((e=>0===e.group||1===e.group)):"custom-objects-and-symbols"===e.key?r.filter((e=>7===e.group||8===e.group)):r.filter((t=>t.group===e.order)),t)}return Object.values(i.reduce(((e,t)=>(e[t.key]||(e[t.key]={groupKey:t.key,groupName:t.message,groupRef:t.groupRef,groupHeadingRef:t.groupHeadingRef,emojis:o(t),onSelect:n}),e)),{}))})(e.commonGroups,t,h),g=(0,s.useMemo)((()=>{const e=r.children.find((({key:e})=>"context-sensitive"===e)),n=r.children.find((({key:e})=>"frequently-used"===e)),s=[{groupKey:n.key,groupName:n.message,emojis:p(a,t),onSelect:h}];return o.length&&s.unshift({groupKey:e.key,groupName:e.message,emojis:m.mapEmojiValueToObject(i,o),onSelect:h}),{groupKey:r.key,groupRef:r.groupRef,groupHeadingRef:r.groupHeadingRef,children:s}}),[r.children,r.key,r.groupRef,r.groupHeadingRef,t,a,h,i,o]);if("active"!==e.pluginState)return null;const E=function(e){const t=new Map;let n=0,s=0;for(let r=0;r<e.length;r++){const i=e[r];if(0===r){t.set(i.groupKey,0);continue}const o=e[r-1];n+=o.emojis.length;const a=o.emojis.length%M,l=M-a,c=n+s+l;s+=l,t.set(i.groupKey,c)}return t}([...g.children,...u]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.Div,{ref:g.groupRef,className:R,children:g.children.map(((t,n)=>(0,c.jsxs)(s.Fragment,{children:[(0,c.jsx)(l.Div,{className:L,"data-group-key":0===n?g.groupKey:void 0,ref:0===n?g.groupHeadingRef:void 0,children:t.groupName}),(0,c.jsx)(w,{tbTabIndex:E.get(t.groupKey),emojis:t.emojis,groupKey:t.groupKey,userPreferredSkinTone:e.userPreferredSkinTone,onEmojiSelected:t.onSelect})]},t.groupKey)))}),u.map((t=>(0,c.jsxs)(l.Div,{ref:t.groupRef,className:R,children:[(0,c.jsx)(l.Div,{ref:t.groupHeadingRef,className:L,"data-group-key":t.groupKey,children:t.groupName}),(0,c.jsx)(w,{tbTabIndex:E.get(t.groupKey),emojis:t.emojis,groupKey:t.groupKey,userPreferredSkinTone:e.userPreferredSkinTone,onEmojiSelected:t.onSelect})]},t.groupKey)))]})}var P=(0,l.elementFactory)("tb-emoji-grid-list");function N(e){const t=(0,i.useI18n)(),n=(0,s.useRef)(null),r=[{key:"custom-smileys-emotion-and-people-body",order:0,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"animals-nature",order:3,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"food-drink",order:4,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"travel-places",order:5,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"activities",order:6,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"custom-objects-and-symbols",order:7,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)},{key:"flags",order:9,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null)}].map((e=>({...e,message:t.get(`emoji-picker.group-caption.${e.key}`)}))),o={key:"custom",order:-1,groupRef:(0,s.useRef)(null),groupHeadingRef:(0,s.useRef)(null),children:[{key:"context-sensitive",message:t.get("group-caption.context-sensitive")},{key:"frequently-used",message:t.get("group-caption.frequently-used")}]},a=[o,...r];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(P,{className:"tb__de0iuk1",ref:n,"data-tb-tabindex":!0,"data-tb-arrowdirection":"grid","data-tb-grid-columns":M,children:(0,c.jsx)(I,{customGroup:o,commonGroups:r,pluginState:e.pluginState,userPreferredSkinTone:e.userPreferredSkinTone,onEmojiSelected:e.onEmojiSelected,onLoadFrequentlyUsedEmojis:e.onLoadFrequentlyUsedEmojis})}),"active"===e.pluginState&&n.current&&(0,c.jsx)(S,{userPreferredSkinTone:e.userPreferredSkinTone,onSelectSkinTone:e.onSelectSkinTone,groups:a,onGroupClicked:e=>{e&&function(e,t){const n=e||t.ownerDocument.body,s=n.getBoundingClientRect(),r=t.getBoundingClientRect().top-s.top;n.scrollBy({top:r,behavior:"instant"})}(n.current,e)},scrollAreaRef:n.current})]})}function O(e){const t=(0,i.useI18n)(),n=(0,r.useMonitoringContext)(),{updateFrequentlyUsedEmojisMap:s}=k();return(0,c.jsxs)(l.Div,{className:"tb__1dxk9uq0","data-tb-tabindex":"true","data-tb-arrowdirection":"grid","data-tb-grid-columns":"7",children:[(0,c.jsx)(l.Span,{className:"tb__1dxk9uq1",children:t.get("search-result.caption",{search:e.search})}),(0,c.jsx)(w,{tbTabIndex:0,emojis:e.emojis,userPreferredSkinTone:e.userPreferredSkinTone,onEmojiSelected:t=>{var r,i,o;n({name:"toolbox:action",data:"plugin_emoji_picker:successful-search-hit"});const a=null!=(o=null==(i=null==(r=t.skins)?void 0:r.find((t=>_(t,e.userPreferredSkinTone))))?void 0:i.emoji)?o:t.emoji;s(t),e.onEmojiSelected(a)},groupKey:"search"})]})}var D=(0,l.elementFactory)("tb-emoji-picker"),H=({emojis:e,search:t,storage:n,pluginState:o,emojiSearchFn:a,onEmojiSelected:l,onLoadFrequentlyUsedEmojis:d})=>{const h=(0,i.useI18n)(),[g,_]=(0,s.useState)([]),{userPreferredSkinTone:E,setUserPreferredSkinTone:f}=function(e){const[t,n]=(0,s.useState)("Default");return(0,s.useEffect)((()=>{e.read(u).then((e=>{e&&n(e)}))}),[e]),{userPreferredSkinTone:t,setUserPreferredSkinTone:t=>{e.write(u,t).then((()=>{n(t)}))}}}(n),T=(0,r.useContentInfoSetState)();return(0,s.useEffect)((()=>{let n;n=t&&""!==t.trim()?m.mapEmojiValueToObject(e,a(t)):p(e,E),n.length?T({message:""}):T({message:h.get("info.empty")}),_(n)}),[h,e,t,a,T,E]),(0,c.jsx)(D,{className:"tb__de0iuk0",children:t?(0,c.jsx)(O,{emojis:g,search:t,userPreferredSkinTone:E,onEmojiSelected:l}):(0,c.jsx)(N,{pluginState:o,userPreferredSkinTone:E,onSelectSkinTone:f,onEmojiSelected:l,onLoadFrequentlyUsedEmojis:d})})},U=(0,s.forwardRef)(((e,t)=>{const[n,o]=(0,s.useState)(""),[a,l]=(0,s.useState)(e.initialPluginState);return(0,s.useImperativeHandle)(t,(()=>({updateSearch:e=>o(e),updatePluginState:e=>l(e)})),[]),(0,c.jsx)(r.ContentInfoProvider,{children:(0,c.jsx)(r.MonitoringContextProvider,{emit:e.sendMonitoringEvent,children:(0,c.jsx)(i.I18nProvider,{i18n:e.i18n,children:(0,c.jsx)(g.Provider,{value:e.storage,children:(0,c.jsx)(m.Provider,{value:{allEmojis:e.emojis,contextEmojis:e.contextEmojis},children:(0,c.jsx)(H,{search:n,pluginState:a,...e})})})})})})})),F={"😂":1,"❤️":2,"🤣":3,"👍":4,"😭":5,"🙏":6,"😘":7,"🥰":8,"😍":9,"😊":10,"🎉":11,"😁":12,"💕":13,"🥺":14,"😅":15,"🔥":16,"🙂":17,"🤦":18,"♥️":19,"🤷":20,"🙄":21,"😆":22,"🤗":23,"😉":24,"🎂":25,"🤔":26,"👏":27,"😳":29,"🥳":30,"😎":32,"👌":33,"💜":34,"😔":35,"💪":36,"✨":37,"💖":38,"👀":39,"😋":40,"😏":41,"😢":42,"👉":43,"💗":44,"😩":45,"💯":46,"🌹":47,"💞":48,"🎈":49,"💙":50,"😃":51,"😡":52,"💐":53,"😜":54,"🙈":55,"🤞":56,"😄":57,"🤤":58,"🙌":59,"🤪":60,"❣️":61,"😀":62,"💋":63,"💀":64,"👇":65,"💔":66,"😌":67,"💓":68,"🤩":69,"🙃":70,"😬":71,"😱":72,"😴":73,"🤭":74,"😐":75,"🌞":76,"😒":77,"😇":78,"🌸":79,"😈":80,"🎵":81,"✌️":82,"🎊":83,"🥵":84,"😞":85,"💚":86,"☀️":87,"🖤":88,"💰":89,"😚":90,"👑":91,"🎁":92,"💥":93,"🙋":94,"☹️":95,"😑":96,"😵":97,"👈":98,"💩":99,"✅":100},B=class{constructor(e,t){var n,s;h(this,"keywordDictionary"),h(this,"stopWords"),h(this,"frequentlyUsedEmojis"),this.keywordDictionary=e,this.stopWords=t.stopWords,this.frequentlyUsedEmojis=null!=(s=null==(n=t.frequentlyUsedEmojis)?void 0:n.map((({emoji:e})=>e)))?s:[]}getSanitizedString(e){return e.split(/[\s,.!?;:"(){}[\]<>]+/).filter(Boolean).map((e=>e.replace(/[^\w\s]|_/g,"").toLowerCase())).filter((e=>e.length>1&&!this.stopWords.includes(e))).join(" ")}getEmojiSuggestions(e){const t=this.getAllContextEmojis(e);return E(this.sortEmojisByPopularity(t).concat(this.frequentlyUsedEmojis)).slice(0,6)}getContextEmojis(e){const t=this.getAllContextEmojis(e);return E(this.sortEmojisByPopularity(t)).slice(0,2*M)}getEmojisForSearchFn(){return e=>E(this.getAllContextEmojis(e,!1))}getAllContextEmojis(e,t=!0){const n=this.getSanitizedString(e);return this.keywordDictionary.reduce(((e,[s,r])=>{const i=this.getMatchingEmojis(n,s,r,t);return i&&e.push(...i),e}),[])}sortEmojisByPopularity(e){return e.filter((e=>Object.keys(F).includes(e))).sort(((e,t)=>F[e]-F[t]))}getMatchingEmojis(e,t,n,s){let r;return t.includes(" ")&&t.split(" ").every((({length:e})=>e>4))&&e.includes(t)?r=n:s||e.length<3?e.match(new RegExp(`\\b${(0,a.escapeForRegEx)(t)}\\b`))&&(r=n):t.match(new RegExp(`\\b${(0,a.escapeForRegEx)(e)}`))&&(r=n),r}},G=class{constructor(e){h(this,"config"),this.assertEmojiLocales(e.emojiLocales),this.config=e}getEmojiDataBaseUrl(){const e=this.config.emojiDataBaseUrl.endsWith("/")?"":"/";return this.config.emojiDataBaseUrl+e}getEmojiLocales(){return this.config.emojiLocales}assertEmojiLocales(e){const t=[];for(const n of e)"string"==typeof n&&2===n.length||t.push(n);if(t.length)throw new Error(`[Toolbox] Retrieved invalid emoji locales: ${JSON.stringify(t)}.`)}},j={de:{"emoji-picker":{caption:{message:"Emoji einfügen"},"group-caption.activities":{message:"Aktivitäten"},"group-caption.animals-nature":{message:"Tiere & Natur"},"group-caption.context-sensitive":{message:"Empfohlen basierend auf Ihrem Text"},"group-caption.custom-objects-and-symbols":{message:"Objekte & Symbole"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Smileys & Menschen"},"group-caption.flags":{message:"Flaggen"},"group-caption.food-drink":{message:"Essen & Trinken"},"group-caption.frequently-used":{message:"Häufig verwendet"},"group-caption.travel-places":{message:"Reisen & Orte"},"info.empty":{message:"Nichts gefunden"},name:{message:"Emoji-Picker"},"quickview.suggestion.stopwords":{message:"ein, eine, einen, einem, einer, und, als, bei, beim, aber, durch, kann, für, von, in, von, auf, am, an, oder, der, die, das, den, dem, des, zu, mit, zu"},"search-placeholder":{message:"Emojis suchen …"},"search-result.caption":{message:'Ergebnisse für "%{search}"'}}},en:{"emoji-picker":{caption:{message:"Insert emoji"},"group-caption.activities":{message:"Activities"},"group-caption.animals-nature":{message:"Animals & Nature"},"group-caption.context-sensitive":{message:"Recommended based on your text"},"group-caption.custom-objects-and-symbols":{message:"Objects & Symbols"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Smileys & People"},"group-caption.flags":{message:"Flags"},"group-caption.food-drink":{message:"Food & Drink"},"group-caption.frequently-used":{message:"Frequently used"},"group-caption.travel-places":{message:"Travel & Places"},"info.empty":{message:"Nothing found"},name:{message:"Emoji Picker"},"quickview.suggestion.stopwords":{message:"a, an, and, as, at, but, by, can, for, from, in, of, on, or, the, to, with"},"search-placeholder":{message:"Search emojis …"},"search-result.caption":{message:"Results for '%{search}'"}}},es:{"emoji-picker":{caption:{message:"Insertar emoji"},"group-caption.activities":{message:"Actividades"},"group-caption.animals-nature":{message:"Animales y naturaleza"},"group-caption.context-sensitive":{message:"Recomendado con base en tu texto"},"group-caption.custom-objects-and-symbols":{message:"Objetos y símbolos"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Emoticonos y personas"},"group-caption.flags":{message:"Banderas"},"group-caption.food-drink":{message:"Comida y bebida"},"group-caption.frequently-used":{message:"De uso frecuente"},"group-caption.travel-places":{message:"Viajes y lugares"},"info.empty":{message:"Sin resultados"},name:{message:"Seleccionador de emojis"},"quickview.suggestion.stopwords":{message:"un, una, y, como, en, a, pero, por, poder, para, de, desde, sobre, o, el, la, los, las, hacia, con"},"search-placeholder":{message:"Buscar emojis…"},"search-result.caption":{message:"Resultados para '%{search}'"}}},fr:{"emoji-picker":{caption:{message:"Insérer un émoji"},"group-caption.activities":{message:"Activités"},"group-caption.animals-nature":{message:"Animaux et nature"},"group-caption.context-sensitive":{message:"Recommandé en fonction de votre texte"},"group-caption.custom-objects-and-symbols":{message:"Objets et symboles"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Smileys et personnes"},"group-caption.flags":{message:"Drapeaux"},"group-caption.food-drink":{message:"Aliments & Boissons"},"group-caption.frequently-used":{message:"Les plus utilisés"},"group-caption.travel-places":{message:"Voyages et lieux"},"info.empty":{message:"Aucun résultat"},name:{message:"Liste d’émojis"},"quickview.suggestion.stopwords":{message:"un, une, et, comme, à, mais, par, peut, pour, de, dans, de, sur, ou, le, à, avec"},"search-placeholder":{message:"Recherche d’émojis…"},"search-result.caption":{message:"Résultats de recherche pour '%{search}'"}}},nl:{"emoji-picker":{caption:{message:"Emoji invoegen"},"group-caption.activities":{message:"Activiteiten"},"group-caption.animals-nature":{message:"Dieren & Natuur"},"group-caption.context-sensitive":{message:"Aanbevolen op basis van uw tekst"},"group-caption.custom-objects-and-symbols":{message:"Objecten en symbolen"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Smileys & Mensen"},"group-caption.flags":{message:"Vlaggen"},"group-caption.food-drink":{message:"Eten & Drinken"},"group-caption.frequently-used":{message:"Vaak gebruikt"},"group-caption.travel-places":{message:"Reizen & Plaatsen"},"info.empty":{message:"Niets gevonden"},name:{message:"Emoji-kiezer"},"quickview.suggestion.stopwords":{message:"een, en, als, bij, maar, door, kan, voor, van, in, van, op, of, de, naar, met"},"search-placeholder":{message:"Zoek emoji’s …"},"search-result.caption":{message:"Resultaten voor '%{search}'"}}},"pt-br":{"emoji-picker":{caption:{message:"Inserir emoji"},"group-caption.activities":{message:"Atividades"},"group-caption.animals-nature":{message:"Animais e Natureza"},"group-caption.context-sensitive":{message:"Recomendado com base no seu texto"},"group-caption.custom-objects-and-symbols":{message:"Objetos e Símbolos"},"group-caption.custom-smileys-emotion-and-people-body":{message:"Smileys e Pessoas"},"group-caption.flags":{message:"Bandeiras"},"group-caption.food-drink":{message:"Comidas e Bebidas"},"group-caption.frequently-used":{message:"Usado com frequência"},"group-caption.travel-places":{message:"Viagens e Lugares"},"info.empty":{message:"Nada foi encontrado"},name:{message:"Seletor de emojis"},"quickview.suggestion.stopwords":{message:"um, e, como, em, mas, por, pode, para, de, ou, o, a, com"},"search-placeholder":{message:"Pesquisar emojis…"},"search-result.caption":{message:"Resultados para '%{search}'"}}}},W=class e extends o.PluginBase{constructor(e){super(),this.config=e,h(this,"connection"),h(this,"mount"),h(this,"i18n"),h(this,"viewApi"),h(this,"sendMonitoringEvent"),h(this,"unbindMessageListener"),h(this,"locale","en"),h(this,"initialEmojiRequest"),h(this,"initialEmojiKeywordsRequest"),h(this,"emojis"),h(this,"emojiKeywordDictionary"),h(this,"unmountReactApp"),h(this,"debounce"),h(this,"handleMessageUpdate",(({type:e,payload:t})=>{switch(e){case"toolbox:PLUGIN_RENDER":this.render(t.options);break;case"toolbox:UPDATE_SEARCH":this.updateSearch(t.search);break;case"toolbox:ABORT":this.handleAbort();break;default:throw new Error(`[Toolbox] Unexpected message "${Object(t).type} || <unknown>" from Toolbox`)}})),this.i18n=(0,i.createI18n)(e.language,j,"emoji-picker"),this.locale=this.getEmojiLocale()}static get STORAGE_NS(){return"emoji_picker"}static get ID(){return"@advanced-toolbox/plugin-emoji-picker"}static addAdapter(e){this.adapter=e}static registerReactDomRenderer(e){this.reactDomRenderer=e}get id(){return e.ID}get name(){return this.i18n.get("name")}get stopWordsByLocale(){return this.i18n.get("quickview.suggestion.stopwords").split(",").map((e=>e.trim()))}getTopLevelEntries(e){const{selection:t}=e.context,n=[];return t.start===t.end&&n.push({id:this.id,name:`${this.id}/emoji`,caption:this.i18n.get("caption"),type:"skill"}),n}unmount(){var e,t,n,s,r,i,o;null==(t=null==(e=this.initialEmojiRequest)?void 0:e.abort)||t.call(e),null==(s=null==(n=this.initialEmojiKeywordsRequest)?void 0:n.abort)||s.call(n),null==(r=this.unmountReactApp)||r.call(this),null==(i=this.unbindMessageListener)||i.call(this),null==(o=this.debounce)||o.cancelCall(),this.sendMonitoringEvent=void 0,this.unmountReactApp=this.mount=this.unbindMessageListener=this.initialEmojiRequest=this.initialEmojiKeywordsRequest=this.debounce=this.connection=void 0}async getEmojisKeywordsDataset(t){let n=[];try{this.initialEmojiKeywordsRequest=new AbortController;const s=await fetch(e.adapter.getEmojiDataBaseUrl()+"keywords/"+t+"/data.json",{signal:this.initialEmojiKeywordsRequest.signal}),r=await s.json();if(!Array.isArray(r))throw new Error("[Toolbox] Received unexpected result when fetching the emoji data.");n=r}catch(e){"AbortError"!==Object(e).name&&console.error("Error fetching emojis:",e)}finally{this.initialEmojiKeywordsRequest=void 0}return n}async getEmojisDataset(t){let n=[];try{this.initialEmojiRequest=new AbortController;const s=await fetch(e.adapter.getEmojiDataBaseUrl()+"emojis/"+t+"/data.json",{signal:this.initialEmojiRequest.signal}),r=await s.json();if(!Array.isArray(r))throw new Error("[Toolbox] Received unexpected result when fetching the emoji data.");n=r}catch(e){"AbortError"!==Object(e).name&&console.error("Error fetching emojis:",e)}finally{this.initialEmojiRequest=void 0}return n}connect(e,t){this.unmountReactApp||(this.connection=e,this.mount=t,this.unbindMessageListener=e.onMessage(this.handleMessageUpdate),this.sendMonitoringEvent=t=>e.emit((0,o.createMonitoringEventMessage)(t)),e.emit((0,o.createUpdateStateMessage)("initializing")))}async render(t){if(!this.mount||!this.connection||!this.sendMonitoringEvent)throw new Error(`[Toolbox] Failed to render the plugin. Reason: Plugin(${this.id}) is not connected correctly.`);this.connection.emit((0,o.createUpdateUiOptionsMessage)({searchEnabled:!0,searchPlaceholder:this.i18n.get("search-placeholder"),primaryActionHidden:!t.enableToolboxInitialFocus})),this.emojis=await this.getEmojisDataset(this.getEmojiLocale()),this.viewApi=(0,s.createRef)(),this.emojiKeywordDictionary=await this.getEmojisKeywordsDataset(this.getEmojiLocale());const n=new B(this.emojiKeywordDictionary,{stopWords:this.stopWordsByLocale}),i=this.getSubjectFromContext(t.context),l=(0,s.createElement)(U,{onEmojiSelected:e=>{var n,s;null==(n=this.sendMonitoringEvent)||n.call(this,{name:"toolbox:action",data:"plugin_emoji_picker:emoji-selected"});const r=(0,a.optionallySurroundWithWhiteSpace)(e,t.context,!0),i=(0,o.createSelectMessage)({"text/plain":r,"text/html":r},(0,a.getSelectionInfoFromContext)(t.context));null==(s=this.connection)||s.emit(i)},onLoadFrequentlyUsedEmojis:()=>{var e,t,n;null==(t=null==(e=this.viewApi)?void 0:e.current)||t.updatePluginState("active"),null==(n=this.connection)||n.emit((0,o.createUpdateStateMessage)("active"))},i18n:this.i18n,emojis:this.emojis,sendMonitoringEvent:this.sendMonitoringEvent,contextEmojis:n.getContextEmojis(i),storage:this.config.storage,ref:this.viewApi,initialPluginState:"initializing",emojiSearchFn:n.getEmojisForSearchFn()}),c=(0,s.createElement)(r.ErrorBoundary,{onError:()=>{var e;return null==(e=this.connection)?void 0:e.emit((0,o.createUpdateStateMessage)("exception"))}},l);this.unmountReactApp=e.reactDomRenderer(c,this.mount),this.connection.emit((0,o.createUpdateStateMessage)("loading"))}getEmojiLocale(){const[t]=this.config.language.toLocaleLowerCase().split(/[-_]/);return e.adapter.getEmojiLocales().includes(t)?t:(console.warn("[toolbox] Selected emoji locale '%s' is not supported. Please add the respective dataset. Defaulting to 'en'.",t),"en")}handleAbort(){var e;null==(e=this.connection)||e.emit((0,o.createAbortMessage)())}updateSearch(e){var t,n;(null==(t=this.viewApi)?void 0:t.current)&&!this.debounce&&(this.debounce=new a.Debounce(this.viewApi.current.updateSearch,500)),null==(n=this.debounce)||n.call(e)}getSubjectFromContext(e){let{subject:t}=(0,a.getSubjectFromContext)(e,"sentence");const n=e.text.trim();return!t&&n&&(t=n.slice(0,e.selection.start).trim()),t}async getSuggestions(e){let t=this.emojis;(null==t?void 0:t.length)||(t=await this.getEmojisDataset(this.locale));const n=[];for(const e of x){const s=t.find((t=>t.emoji===e));s&&n.push(s)}return[...A(t,await this.config.storage.read(b)||{},e),...n].map((({emoji:e,label:t})=>({emoji:e,title:t})))}};h(W,"adapter"),h(W,"reactDomRenderer");var $=W},
vendor: 68,638 bytes, lines 61-64
61"../../../node_modules/@advanced-toolbox/plugin-paraphraser/dist/index.js":
62/*!********************************************************************************!*\
63  !*** ../../../node_modules/@advanced-toolbox/plugin-paraphraser/dist/index.js ***!
64  \********************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ToolboxPluginParaphraser:()=>J,ToolboxPluginParaphraserAdapter:()=>F});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/lang.js */"../../../node_modules/@advanced-toolbox/lang.js/dist/index.mjs"),i=n(/*! @advanced-toolbox/plugin */"../../../node_modules/@advanced-toolbox/plugin/dist/index.mjs"),o=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),a=n(/*! @advanced-toolbox/components */"../../../node_modules/@advanced-toolbox/components/dist/index.js"),l=n(/*! @advanced-toolbox/elements */"../../../node_modules/@advanced-toolbox/elements/dist/index.mjs"),c=n(/*! react/jsx-runtime */"react/jsx-runtime"),d=n(/*! diff */"../../../node_modules/diff/lib/index.mjs"),h=Object.defineProperty,u=(e,t,n)=>((e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),g=(0,s.createContext)({mode:"standard",subject:"",textLocale:null,type:"word",selectedCustomMode:"",setSelectedCustomMode:()=>{}}),m="tb_tab-mode-selector__dropdown-option_h6e7r2b",p="tb_tab-mode-selector__text_h6e7r20 tab-mode-selector__dropdown-option-text",_="tb_tab-mode-selector__dropdown-option-text-span_h6e7r2f",E=({onChange:e,selectedMode:t,allModes:n,customModes:i,selectedCustomMode:d})=>{const h=(0,r.useI18n)(),u=(0,a.useMonitoringContext)(),g=(0,s.useRef)(null),[E,f]=(0,s.useState)(!1),{visibleModes:T,hiddenModes:C,hiddenCustomModes:v}=(0,s.useMemo)((()=>{let e=n.slice(0,3);g.current&&!e.includes(g.current)&&(e=[...n.slice(0,2),g.current]);const s="custom"===t?`custom-${d}`:t;!e.includes(s)&&n.includes(t)&&("custom-"!==s&&(g.current=s),e=[...e.slice(0,2),s]);const r=n.filter((t=>!e.includes(t))),o=i.map((e=>`custom-${e}`)).filter((t=>!e.includes(t)));return{visibleModes:e,hiddenModes:r,hiddenCustomModes:o}}),[n,i,t,d]),S=e=>{let t=e;return e.startsWith("custom-")&&(t=e.split("custom-")[1]||"custom"),h.has(`skill.mode.${t}`)?h.get(`skill.mode.${t}`):t},b=t=>{let n=t,s="";t.startsWith("custom-")&&(n="custom",s=t.replace("custom-","")),e(n,s),u({name:"toolbox:action",data:`plugin_paraphraser:mode-switch-to:${n}`})},x=e=>{b(e),f(!1)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.When,{condition:E,children:(0,c.jsx)(l.Div,{className:"tb_tab-mode-selector__backdrop_h6e7r21",onMouseDown:()=>{f(!1)}})}),(0,c.jsxs)(l.Div,{className:"tb_tab-mode-selector__container_h6e7r22",children:[T.map((e=>(0,c.jsx)(l.Div,{className:(0,o.classes)("tb__h6e7r23 tb_tab-mode-selector__text_h6e7r20 tab-mode-selector__tab",(t===e||"custom"===t&&e.startsWith("custom-"))&&"tb_tab-mode-selector__tab--active_h6e7r24"),onClick:()=>b(e),children:(0,c.jsx)("span",{className:"tb_tab-mode-selector__tab-text_h6e7r2h",children:S(e)})},e))),(0,c.jsx)(a.When,{condition:C.length>0,children:(0,c.jsxs)(l.Div,{className:"tb_tab-mode-selector__dropdown-container_h6e7r28",children:[(0,c.jsx)(l.Div,{className:(0,o.classes)("tb_tab-mode-selector__more-button_h6e7r26",E&&"tb_tab-mode-selector__more-button--expanded_h6e7r27"),onClick:()=>f(!E),children:(0,c.jsx)(a.Icon,{name:"dropdown-caret",className:"tb_tab-mode-selector__icon_h6e7r25"})}),(0,c.jsx)(a.When,{condition:E,children:(0,c.jsx)(l.Div,{className:"tb_tab-mode-selector__dropdown_h6e7r29",children:C.map((e=>(0,c.jsxs)(s.Fragment,{children:[(0,c.jsxs)(a.When,{condition:"custom"===e,children:[(0,c.jsx)(a.When,{condition:!!v.length,children:(0,c.jsx)(l.Div,{className:"tb_tab-mode-selector__border-divider_h6e7r2a"})}),v.map((e=>(0,c.jsx)(l.Div,{className:m,onClick:()=>x(e),children:(0,c.jsx)(l.Div,{className:p,title:S(e),children:(0,c.jsx)("span",{className:_,children:S(e)})})},e))),(0,c.jsx)(l.Div,{className:(0,o.classes)(m,"tb_tab-mode-selector__custom-option-container_h6e7r2c"),onClick:()=>x(e),children:(0,c.jsxs)(l.Div,{className:(0,o.classes)(p,"tb_tab-mode-selector__custom-option_h6e7r2d"),children:[S(e),(0,c.jsx)(a.Icon,{name:"add",className:"tb_tab-mode-selector__custom-option-icon_h6e7r2g"})]})})]}),(0,c.jsx)(a.When,{condition:"custom"!==e,children:(0,c.jsx)(l.Div,{className:m,onClick:()=>x(e),children:(0,c.jsx)(l.Div,{className:p,title:S(e),children:(0,c.jsx)("span",{className:_,children:S(e)})})})})]},e)))})})]})})]})]})},f="tb_type-selector__dropdown-option_of5lz88",T="tb_type-selector__text_of5lz80 type-selector__dropdown-option-text",C=({currentType:e,typeOption:t,onSelect:n})=>{const i=(0,r.useI18n)(),[d,h]=(0,s.useState)(!1),u=()=>{h(!1)},g=e=>"sentence"===e?i.get("type.sentence"):i.get("type.phrase"),m=g(e),p=g(t);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.When,{condition:d,children:(0,c.jsx)(l.Div,{className:"tb_type-selector__backdrop_of5lz81",onMouseDown:u})}),(0,c.jsxs)(l.Div,{className:"tb_type-selector__dropdown-container_of5lz82",children:[(0,c.jsxs)(l.Div,{className:(0,o.classes)("tb__of5lz83 tb_type-selector__text_of5lz80 type-selector__trigger",d&&"tb_type-selector__trigger--expanded_of5lz84"),onClick:()=>h(!d),children:[(0,c.jsx)("span",{className:"tb_type-selector__trigger-text_of5lz85",children:m}),(0,c.jsx)(a.Icon,{name:"dropdown-caret",className:"tb_type-selector__trigger-icon_of5lz86"})]}),(0,c.jsx)(a.When,{condition:d,children:(0,c.jsxs)(l.Div,{className:"tb_type-selector__dropdown_of5lz87",children:[(0,c.jsx)(l.Div,{className:(0,o.classes)(f,"tb_type-selector__dropdown-option--selected_of5lz89"),onClick:u,children:(0,c.jsx)(l.Div,{className:T,title:m,children:m})}),(0,c.jsx)(l.Div,{className:f,onClick:()=>{n(),h(!1)},children:(0,c.jsx)(l.Div,{className:T,title:p,children:p})})]})})]})]})},v=(0,s.forwardRef)((({i18n:e,allModes:t,previousCustomModes:n,selectedCustomMode:i,mode:d,subject:h,textLocale:u,type:m,sendMonitoringEvent:p,onError:_,children:f,onSkillChange:T,secondaryType:v},S)=>{const[b,x]=(0,s.useState)(d),[y,A]=(0,s.useState)(v),[k,w]=(0,s.useState)(h),[R,L]=(0,s.useState)(u),[M,I]=(0,s.useState)(i),[P,N]=(0,s.useState)(n.slice(0,3)),O=(0,s.useCallback)(((e,t)=>{x(e),I(t)}),[]),D=(0,s.useMemo)((()=>t.map((e=>e.name))),[t]),H=(0,s.useMemo)((()=>({subject:k,mode:b,textLocale:R,type:m,selectedCustomMode:M,setSelectedCustomMode:e=>{I(e),e&&N((t=>t.includes(e)?t:[e,...t].slice(0,3)))}})),[k,b,R,m,M,I]),U=(0,o.isString)(b)&&t.length>1;return(0,s.useImperativeHandle)(S,(()=>({updateSubject(e,t){w(e),L(t)},updateSecondaryType:A})),[]),(0,c.jsx)(a.ErrorBoundary,{onError:_,children:(0,c.jsx)(a.MonitoringContextProvider,{emit:p,children:(0,c.jsx)(r.I18nProvider,{i18n:e,children:(0,c.jsxs)(l.Div,{className:"tb_paraphraser-frame_137oi9x0",children:[(0,c.jsxs)(l.Div,{className:"tb_paraphraser-frame__heading_137oi9x1",children:[(0,c.jsx)(a.When,{condition:!U,children:(0,c.jsx)("span",{className:"tb_paraphraser-frame__heading-text_137oi9x2",children:e.get("heading.sub-sentence",{subject:h})})}),(0,c.jsx)(a.When,{condition:U,children:(0,c.jsx)(E,{allModes:D,selectedMode:b,onChange:O,selectedCustomMode:M,customModes:P})}),(0,c.jsx)(a.When,{condition:!!T&&!!y,children:(0,c.jsx)(C,{currentType:m,typeOption:y,onSelect:T})})]}),(0,c.jsx)(a.ContentInfoProvider,{children:(0,c.jsx)(g.Provider,{value:H,children:f})})]})})})})}));function S({onSelectSuggestion:e}){const t=(0,r.useI18n)(),n=(0,s.useMemo)((()=>t.get("custom.suggestions.options").split(",").map((e=>e.trim())).filter((e=>e.length>0))),[t]);return(0,c.jsx)(l.Div,{className:"tb_custom-mode-input__suggestions-wrapper_z9gi422",children:(0,c.jsxs)(l.Div,{className:"tb_custom-mode-input__suggestions-content_z9gi423",children:[(0,c.jsx)(l.Div,{className:"tb_custom-mode-input__suggestions-label_z9gi424",children:t.get("custom.suggestions.title")}),(0,c.jsx)(l.Div,{className:"tb_custom-mode-input__suggestions-container_z9gi425",children:n.map(((t,n)=>(0,c.jsx)(l.Div,{className:"tb_custom-mode-input__suggestion-button_z9gi426",onClick:()=>e(t),"data-tb-tabindex":n+3,children:t},`suggestion-${t}-${n}`)))})]})})}v.displayName="<Frame />";var b=(0,s.forwardRef)((({value:e,emitStateChange:t,onUpdateCustomMode:n,toggleSubmitButtonLabel:i,togglePrimaryActionHidden:d},h)=>{const u=(0,r.useI18n)(),g=(0,a.useContentInfoSetState)(),[m,p]=(0,s.useState)(e),_=m.length>140,E=(0,s.useCallback)((e=>{t("active"),n(e)}),[t,n]),f=(0,s.useCallback)((()=>!1),[]);return(0,s.useEffect)((()=>{t(_?"initializing":"active")}),[_,t]),(0,s.useEffect)((()=>{g({isLoading:!1,message:""}),t("active"),i("submit"),d(!1)}),[i,d,t,g]),(0,s.useImperativeHandle)(h,(()=>({abort:f})),[f]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.FakeInput,{value:m,className:"tb_custom-mode-input__text-input_z9gi420",multiline:!0,autofocus:!0,submitOnEnter:!0,onInput:e=>{p(e)},placeholder:u.get("placeholder.custom-input"),testId:"tb-paraphraser-prompt",storageId:`${J.ID}-custom-mode`}),(0,c.jsxs)(l.Div,{className:(0,o.classes)("tb_custom-mode-input__character-counter_z9gi427",_&&"tb_custom-mode-input__count-exceeded_z9gi428"),children:[m.length,"/",140]}),(0,c.jsx)(S,{onSelectSuggestion:E}),(0,c.jsx)(l.Div,{className:"tb_custom-mode-input__invisible-submit_z9gi421",onClick:()=>{_||n(m)},"data-tb-tabindex":"2","data-tb-focussed":!0})]})}));b.displayName="<CustomModeInputComponent />";var x=()=>{const{mode:e}=(0,s.useContext)(g);return e},y=()=>{const{subject:e}=(0,s.useContext)(g);return e},A=()=>{const{type:e}=(0,s.useContext)(g);return e},k=()=>{const{textLocale:e}=(0,s.useContext)(g);return e},w=({suggestion:e,icon:t})=>(0,c.jsxs)(c.Fragment,{children:[!!t&&(0,c.jsx)(a.Icon,{name:t,className:"tb_phrase-suggestion__icon_8j4w460"}),(0,c.jsx)(l.Div,{className:"tb_phrase-suggestion__item_8j4w461",children:e})]}),R="tb-sentence-pphr-copy";function L({sourceText:e,suggestion:t,hasCopyButton:n,isWritingToClipboard:r}){const i=n?l.Div:s.Fragment,h=r?"circle-check":"copy",u=(0,s.useMemo)((()=>d.diffWords(e,t,{ignoreWhitespace:!1,ignoreCase:!1})),[t,e]);return(0,c.jsxs)(l.Div,{className:(0,o.classes)("tb_sentence-suggestion__item_1a2jpsg0",n&&"tb_sentence-suggestion__item--with-copy_1a2jpsg1"),children:[(0,c.jsx)(i,{children:u.map(((e,t)=>{const n=e.added?"tb_sentence-suggestion__diff--added_1a2jpsg2":e.removed?"tb_sentence-suggestion__diff--removed_1a2jpsg3":void 0;return(0,c.jsx)(l.Span,{className:n,children:e.value},`${e.value}-${t}`)}))}),n&&(0,c.jsx)(l.Div,{className:(0,o.classes)("tb_sentence-suggestion__copy_1a2jpsg5",r&&"tb_sentence-suggestion__copy--pinned_1a2jpsg4"),"data-id":R,children:(0,c.jsx)(a.Icon,{name:h})})]})}function M({suggestion:e,subject:t,index:n,mode:r,type:i,onCopy:l,onSelectSuggestion:d}){const h=!!l,[u,g]=(0,s.useState)(!1),m=(0,s.useCallback)((e=>{h&&!u&&(g(!0),l({"text/html":e,"text/plain":e}).then((e=>{if("ok"===e)return(0,o.wait)(1500)})).catch((e=>console.warn("[toolbox] Failed to write pphr result to clipboard.",e))).finally((()=>g(!1))))}),[h,u,l]),p=(0,s.useCallback)((t=>{if(t.target&&(0,o.isElementNode)(t.target)&&t.target.closest(`[data-id="${R}"]`))return t.stopImmediatePropagation(),void m(e.to);d(e.to,r)}),[r,e,d,m]);return(0,c.jsxs)(a.HotKeyLabel,{dataTestId:`paraphrase-suggestion-${e.uuid}`,tbArrowIndex:n,hotKeyIndex:n+1,className:"tb_paraphrase-result-list__item_1pmwcrb1",onClickOnce:p,children:["sentence"===i&&(0,c.jsx)(L,{sourceText:t,suggestion:e.to,hasCopyButton:h,isWritingToClipboard:u}),"sentence"!==i&&(0,c.jsx)(w,{suggestion:e.to,icon:"word"===i?"synonym":void 0})]})}function I({userCustomMode:e,onSelectSuggestion:t,emitStateChange:n,rewrite:i,toggleSubmitButtonLabel:d,togglePrimaryActionHidden:h,onCopy:u}){const g=x(),m=A();!function(e,t){if("sentence"===e&&(0,o.isUndefined)(t))throw new Error("[Toolbox] Paraphrasing mode is required for paraphrasing type 'sentence'.")}(m,g);const p=y(),_=(0,r.useI18n)(),E=k(),[f,T]=(0,s.useState)([]),C=(0,a.useContentInfoSetState)(),[v,S]=(0,s.useState)("initial"),b=(0,s.useRef)(0),w=(0,s.useRef)(null),R=(0,a.useMonitoringContext)(),L=(0,s.useCallback)((()=>{var t,s;if(!p.trim())return void C({isLoading:!1,message:_.get("info.emptySourceText")});C({isLoading:!0,message:_.get("info.loading")}),h(!0),n("loading"),null==(s=null==(t=w.current)?void 0:t.abort)||s.call(t),w.current=null;const r=i(m,g,e);if((0,o.isUndefined)(r))throw new Error(`[Toolbox] Paraphrase type "${m}" for "${g}" not supported for the current text selection.`);w.current=r,r.getData().then((e=>[null,e]),(e=>[(0,o.isError)(e)?e:new Error((0,o.safeToString)(e)),null])).then((([e,t])=>{if(w.current!==r)return;const{status:s="error",data:i=[]}=t||{},o=!i.length&&"success"===s;if(e||"success"!==s){if(e&&console.error("Paraphraser Plugin: Failed to fetch suggestions.",e),b.current>3)return C({isLoading:!1,message:_.get("info.emptyApiResponse")}),void R({name:"toolbox:error",data:`plugin_paraphraser:${m}_${g}_${E}_failed_response`});S("retry"),d("retry"),h(!1),C({isLoading:!1,message:_.get("info.failedApiResponse")}),n("active")}else o?(C({isLoading:!1,message:_.get("info.emptyApiResponse")}),R({name:"toolbox:error",data:`plugin_paraphraser:${m}_${g}_${E}_empty_response`})):(T(i),C({isLoading:!1,message:""}),n("active"))})).finally((()=>{w.current===r&&(w.current=null)}))}),[p,C,_,n,i,m,e,g,E,d,h,R]),I=(0,s.useCallback)((()=>{"retry"===v&&(b.current+=1,L(),S("initial"),R({name:"toolbox:error",data:`plugin_paraphraser:${m}_retry_request`}))}),[L,R,m,v]);return(0,s.useEffect)((()=>{h(!0),L()}),[L,h]),(0,s.useEffect)((()=>()=>{var e,t;null==(t=null==(e=w.current)?void 0:e.abort)||t.call(e)}),[]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.Div,{className:"tb_paraphrase-result-list_1pmwcrb0","data-tb-tabindex":!0,children:f.map(((e,n)=>(0,c.jsx)(M,{index:n,mode:g,subject:p,suggestion:e,type:m,onSelectSuggestion:t,onCopy:u},`suggestion-${e.uuid}`)))}),(0,c.jsx)(l.Div,{className:"tb_paraphrase-result-list-submit_1pmwcrb2",onClick:I,"data-tb-tabindex":"2","data-tb-focussed":!0})]})}function P({link:e,mode:t,emitStateChange:n,togglePrimaryActionHidden:i,saleConfig:o}){var d;const h=(0,a.useContentInfoSetState)();(0,s.useEffect)((()=>{h({isLoading:!1,message:""}),n("active"),i(!0)}),[i,n,h]);const u=(0,r.useI18n)(),g=u.has(`paraphraser.upselling.${t}.text`)?u.get(`paraphraser.upselling.${t}.text`):u.get("paraphraser.upselling.default.text"),m=u.has(`paraphraser.upselling.${t}.description`)?u.get(`paraphraser.upselling.${t}.description`):u.get("paraphraser.upselling.default.description"),p=null!=(d=null==o?void 0:o.ctaText)?d:u.get("paraphraser.upselling.cta"),_=null==o?void 0:o.message;return(0,c.jsxs)(l.Div,{className:"tb_paraphrase-upselling__container_16q68a70",children:[(0,c.jsx)(l.Div,{className:"tb_paraphrase-upselling__main-text_16q68a71",children:g}),(0,c.jsx)(l.Div,{className:"tb_paraphrase-upselling__description_16q68a72",children:m}),(0,c.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tb_paraphrase-upselling__button_16q68a74",children:[(0,c.jsx)(a.Icon,{name:"diamond"}),p]}),_&&(0,c.jsx)(l.Div,{className:"tb_paraphrase-upselling__sale-message_16q68a73",children:_})]})}function N({onCopy:e,text:t,hotKeyIndex:n=1,tbArrowIndex:i=0,className:l}){const[d,h]=(0,s.useState)("initial"),u=(0,s.useRef)(),g=(0,r.useI18n)(),m=(0,a.useContentInfoSetState)(),p=(0,a.useMonitoringContext)(),_="done"===d?"circle-check":"copy",E="done"===d?"copy.success":"copy.initial";return(0,s.useEffect)((()=>()=>clearTimeout(u.current)),[]),(0,c.jsx)(a.When,{condition:!!e,children:(0,c.jsxs)(a.HotKeyLabel,{className:(0,o.classes)("tb_copy-cta__copy-button_1niyxg30",l,"active"===d&&"tb_copy-cta__copy-button--disabled_1niyxg31","done"===d&&"tb_copy-cta__copy-button--success_1niyxg32"),hotKeyIndex:n,onClick:async()=>{if((0,o.isFunction)(e)){h("active");try{if("error"===await e({"text/plain":t,"text/html":t}))throw new Error("Writing to clipboard failed for unknown reasons.");h("done"),u.current=window.setTimeout((()=>{h("initial")}),2e3)}catch(e){if(Object(e).name===o.MessageConnectorAbortError.name)return void h("initial");console.error("[Toolbox] Failed to write result to clipboard.",e),h("error"),m({message:g.get("error.copy.message")})}p({name:"toolbox:action",data:"plugin_paraphraser:copy_result"})}},tbArrowIndex:i,children:[(0,c.jsx)(a.Icon,{name:_}),g.get(E)]})})}var O=({sentences:e})=>{const t=(0,s.useMemo)((()=>{const t=e.filter((e=>"processing"===e.state||"success"===e.state)).length;return e.length>0?t/e.length*100:0}),[e]);return(0,c.jsxs)(l.Div,{className:"tb_tpr__outer-container_b1j7sn0",children:[(0,c.jsx)(l.Div,{className:"tb_tpr__container_b1j7sn1",children:e.map(((t,n)=>{var s;return(0,c.jsxs)("span",{className:(0,o.classes)("processing"===t.state&&"tb_tpr__sentence-processing_b1j7sn5","success"===t.state&&"tb_tpr__sentence-success_b1j7sn6","initial"===t.state&&"tb_tpr__sentence-initial_b1j7sn4"),children:[null!=(s=t.suggestion)?s:t.text,n<e.length-1?" ":null]},`sentence-${t}-${n}`)}))}),(0,c.jsx)(l.Div,{className:"tb_tpr__loading-bar-container_b1j7sn2",children:(0,c.jsx)(l.Div,{className:"tb_tpr__loading-bar_b1j7sn3",style:{width:`${t}%`}})})]})};function D(e,t){switch(t.type){case"INITIALIZE_STATE":return{sentences:t.payload.ranges.map((e=>({initialRange:e,state:"initial",suggestion:void 0,text:t.payload.text.substring(e[0],e[1])}))),currentProcessingRangeIndex:0,mode:t.payload.mode};case"UPDATE_SENTENCE_SUCCESS":{const n=[...e.sentences];n[t.payload.index]={...n[t.payload.index],state:"success",suggestion:t.payload.suggestion};const s=e.currentProcessingRangeIndex+1<e.sentences.length?e.currentProcessingRangeIndex+1:e.currentProcessingRangeIndex;return{...e,sentences:n,currentProcessingRangeIndex:s}}case"UPDATE_SENTENCE_PROCESSING":{const n=[...e.sentences];return n[t.payload.index]={...n[t.payload.index],state:"processing"},{...e,sentences:n}}case"UPDATE_SENTENCE_RETRY":{const n=[...e.sentences];return n[t.payload.index]={...n[t.payload.index],isRetry:!0,state:"failed"},{...e,sentences:n}}case"RESET_STATE":return{currentProcessingRangeIndex:-1,sentences:[],mode:void 0};default:return e}}function H(e){const{userCustomMode:t,textRange:n,sentenceRanges:i,text:d,rewrite:h,emitStateChange:u,onSelectSuggestion:g,toggleSubmitButtonLabel:m,togglePrimaryActionHidden:p,onCopy:_}=e,E=x();!function(e){if((0,o.isUndefined)(e))throw new Error("[Toolbox] Paraphrasing mode is required for paraphrasing type 'text'.")}(E),function(e){if((0,o.isUndefined)(e))throw new Error("[Toolbox] Text range is required for paraphrasing type 'text'.")}(n);const f=y(),T=(0,r.useI18n)(),C=k(),[v,S]=(0,s.useState)(""),b=(0,a.useContentInfoSetState)(),[A,w]=(0,s.useState)("processing"),[R,L]=(0,s.useReducer)(D,{currentProcessingRangeIndex:-1,sentences:[],mode:void 0}),M=(0,a.useMonitoringContext)(),I=(0,s.useRef)(null),P=(0,s.useMemo)((()=>function(e,t){return e&&t?t.filter((t=>t[0]>=e[0]&&t[1]<=e[1])):[]}(n,i)),[n,i]),H=(0,s.useMemo)((()=>function(e){const[[t]]=e;return e.map((([e,n])=>[e-t,n-t]))}(P)),[P]),U=(0,s.useCallback)((()=>{S(""),g(v,E)}),[g,v,E]),F=(0,s.useCallback)((()=>{if(n&&d){if(u("loading"),m("submit"),f.length>1e4)return b({isLoading:!1,message:T.get("paraphraser.info.subjectTooLong")}),void M({name:"toolbox:error",data:"plugin_paraphraser:text_subject_too_long"});w("processing"),L({type:"INITIALIZE_STATE",payload:{mode:E,ranges:P,text:d}})}}),[n,d,u,m,f.length,E,P,b,T,M]);return(0,s.useEffect)((()=>{var e,n;const s=R.currentProcessingRangeIndex;if(-1===s)return;const r=R.sentences[s];if("processing"===r.state)return;if(R.sentences.every((e=>"success"===e.state)))return S(((e,t)=>e.reduce(((n,s,r)=>{var i,o;const a=null!=(o=null==(i=e[r-1])?void 0:i.initialRange[1])?o:-1;return n+(-1===a?"":t.slice(a,s.initialRange[0]))+s.suggestion}),""))(R.sentences,d)),b({isLoading:!1,message:""}),u("active"),L({type:"RESET_STATE"}),void w("initial");const i="text",a=!0===r.isRetry;null==(n=null==(e=I.current)?void 0:e.abort)||n.call(e),I.current=null;const l=h(i,E,t,H[s]);if((0,o.isUndefined)(l))throw new Error(`[Toolbox] Paraphrase type "${i}" for "${E}" not supported for the current text selection.`);I.current=l,L({type:"UPDATE_SENTENCE_PROCESSING",payload:{index:s}}),l.getData().then((e=>[null,e]),(e=>[(0,o.isError)(e)?e:new Error((0,o.safeToString)(e)),null])).then((([e,t])=>{if(I.current!==l)return;const{status:n="error",data:i=[]}=t||{},o=!i.length&&"success"===n,c=e||"success"!==n,d=e=>L({type:"UPDATE_SENTENCE_SUCCESS",payload:{index:s,suggestion:e}});c||o?(e&&console.error("[Toolbox] Paraphraser Plugin: Failed to fetch suggestions.",e),a||o?(d(r.text),M({name:"toolbox:error",data:`plugin_paraphraser:text_${E}_${C}_`+(c?"failed_response":"empty_response")})):(L({type:"UPDATE_SENTENCE_RETRY",payload:{index:s}}),M({name:"toolbox:action",data:"plugin_paraphraser:text_retry_request"}))):d(i[0].to)})).finally((()=>{I.current===l&&(I.current=null)}))}),[E,C,u,T,h,b,R,m,M,t,i,H,d]),(0,s.useEffect)((()=>{p(!1),F()}),[F,p]),(0,s.useEffect)((()=>()=>{var e,t;null==(t=null==(e=I.current)?void 0:e.abort)||t.call(e)}),[]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.When,{condition:"processing"===A,children:(0,c.jsx)(O,{sentences:R.sentences})}),(0,c.jsxs)(a.When,{condition:"initial"===A,children:[(0,c.jsx)(a.FakeInput,{value:v,className:"tb_text-rephraser__text-input_3ebpvc0",multiline:!0,autofocus:!0,submitOnEnter:!0,onInput:e=>{S(e)},placeholder:T.get("paraphraser.placeholder.selection-result-input"),testId:"tb-paraphraser-rephraser-input",storageId:`${J.ID}-rephraser`}),(0,c.jsx)(l.Div,{className:"tb_text-rephraser__invisible-submit_3ebpvc1",onClick:U,"data-tb-tabindex":"2","data-tb-focussed":!0}),(0,c.jsx)(N,{onCopy:_,text:v,className:"tb_text-rephraser__copy-button_3ebpvc2"})]})]})}var U=(0,s.forwardRef)((({upsellingLink:e,emitStateChange:t,onSelectSuggestion:n,rewrite:r,toggleSubmitButtonLabel:i,togglePrimaryActionHidden:l,sentenceRanges:d,textRange:h,text:u,allModes:m,onCopy:p,saleConfig:_},E)=>{var f;const T=x(),C=A(),v=(()=>{const{selectedCustomMode:e}=(0,s.useContext)(g);return e})(),S=(0,o.usePrevious)(v),y=(()=>{const{setSelectedCustomMode:e}=(0,s.useContext)(g);return e})(),k=(0,s.useRef)(null),w=(0,a.useContentInfoSetState)(),R=(0,s.useCallback)((e=>{y(e)}),[y]),L=(0,s.useCallback)(((e,t)=>{n(e,t)}),[n]),M=(0,s.useCallback)((()=>{let e=!1;return"custom"===T&&v&&(w({message:"",isLoading:!1}),t("active"),y(""),e=!0),e}),[T,v,w,t,y]);return(0,s.useImperativeHandle)(E,(()=>({abort:M})),[M]),e&&(null==(f=m.find((({name:e})=>e===T)))?void 0:f.isPremium)?(0,c.jsx)(P,{link:e,mode:T,emitStateChange:t,togglePrimaryActionHidden:l,saleConfig:_}):"custom"!==T||v?"text"===C?(0,c.jsx)(H,{toggleSubmitButtonLabel:i,emitStateChange:t,onSelectSuggestion:L,rewrite:r,sentenceRanges:d,textRange:h,text:u,userCustomMode:v,togglePrimaryActionHidden:l,onCopy:p}):(0,c.jsx)(I,{userCustomMode:v,emitStateChange:t,onSelectSuggestion:L,rewrite:r,toggleSubmitButtonLabel:i,togglePrimaryActionHidden:l,onCopy:p}):(0,c.jsx)(b,{ref:k,value:S||"",emitStateChange:t,toggleSubmitButtonLabel:i,togglePrimaryActionHidden:l,onUpdateCustomMode:R})}));U.displayName="<View />";var F=class{constructor(e){var t,n;u(this,"sentence"),u(this,"phrase"),u(this,"word"),u(this,"getSupportedSynonymLocalesFn"),u(this,"getSupportedPhrasalLocalesFn"),u(this,"getSupportedSentenceLocalesFn"),u(this,"sentenceModes"),u(this,"wordModes"),u(this,"phraseModes"),u(this,"upselling"),u(this,"saleConfig"),u(this,"showSynonymQuickView"),this.sentence=e.sentence,this.phrase=e.phrase,this.word=e.word,this.getSupportedSynonymLocalesFn=e.getSupportedSynonymLocales,this.getSupportedPhrasalLocalesFn=e.getSupportedPhrasalLocales,this.getSupportedSentenceLocalesFn=e.getSupportedSentenceLocales,this.sentenceModes=this.normalizeModes(e.customSentenceModes),this.wordModes=this.normalizeModes(e.customWordModes),this.phraseModes=this.normalizeModes(e.customPhraseModes),this.upselling=null!=(t=e.upselling)?t:{upsellingLink:""},this.showSynonymQuickView=null!=(n=e.showSynonymQuickView)&&n,this.saleConfig=e.saleConfig}getUpsellingLink(){return this.upselling.upsellingLink}getSaleConfig(){return this.saleConfig}getSentenceModes(){return this.sentenceModes}getWordModes(){return this.wordModes}getPhraseModes(){return this.phraseModes}shouldShowSynonymQuickView(){return this.showSynonymQuickView}get rewriteSentence(){return(0,o.isFunction)(this.sentence)?(e,t)=>{var n;return null==(n=this.sentence)?void 0:n.call(this,{subject:e,context:t})}:void 0}get rewritePhrase(){return(0,o.isFunction)(this.phrase)?(e,t)=>{var n;return null==(n=this.phrase)?void 0:n.call(this,{subject:e,context:t})}:void 0}get rewriteWord(){return(0,o.isFunction)(this.word)?(e,t)=>{var n;return null==(n=this.word)?void 0:n.call(this,{subject:e,context:t})}:void 0}getSupportedSentenceLocales(){return this.getSupportedSentenceLocalesFn().map((e=>(0,o.sanitizeLocale)(e)))}getSupportedPhrasalLocales(){return this.getSupportedPhrasalLocalesFn().map((e=>(0,o.sanitizeLocale)(e)))}getSupportedSynonymLocales(){return this.getSupportedSynonymLocalesFn().map((e=>(0,o.sanitizeLocale)(e)))}normalizeModes(e){return e?e.map((e=>({order:Number.MAX_SAFE_INTEGER,isPremium:!1,...e}))):[]}},B={de:{paraphraser:{"caption.group.synonyms":{message:"Synonyme für „%{subject}“"},"caption.phrase":{message:"Selektion umformulieren"},"caption.selection":{message:"Selektion umformulieren"},"caption.sentence":{message:"Satz umformulieren"},"caption.word":{message:"Synonym finden"},"copy.initial":{message:"Ergebnis kopieren"},"copy.success":{message:"Kopiert!"},"custom-caption.word.empty":{message:"Es wurden keine Synonyme gefunden."},"custom-caption.word.failed":{message:"Beim Laden der Synonyme ist ein Fehler aufgetreten."},"custom.mode.title":{message:"Eigener Modus"},"custom.suggestions.options":{message:"Freundlich, elegant geschrieben, anschaulich, voller Redewendungen, wie Shakespeare"},"custom.suggestions.title":{message:"Vorschläge"},"error.copy.message":{message:"Text konnte nicht kopiert werden."},"heading.selection":{message:"Selektion umformulieren"},"heading.sentence":{message:"Satz umformulieren"},"heading.sentence.custom":{message:'Umformulieren: Eigener Modus "%{userCustomMode}"'},"heading.sub-sentence":{message:'Ergebnisse für "%{subject}"'},"heading.text":{message:"Selektion umformulieren"},"info.emptyApiResponse":{message:"Nichts gefunden"},"info.emptySourceText":{message:"Nichts umzuformulieren …"},"info.failedApiResponse":{message:"Vorschläge konnten nicht geladen werden. Bitte erneut probieren …"},"info.loading":{message:"Inhalt wird geladen …"},"info.subjectTooLong":{message:"Der Text überschreitet die Grenze von 10.000 Zeichen."},name:{message:"Umformulieren"},"placeholder.custom-input":{message:"Einen eigenen Umformulierungsmodus erstellen"},"placeholder.selection-result-input":{message:"Text eingeben …"},"primary-action.back":{message:"Zurück"},"primary-action.retry":{message:"Erneut probieren"},"primary-action.submit":{message:"Einfügen"},"secondary-action.back-to-ai-tools":{message:"Zurück zu KI-Tools"},"skill.default":{message:"Umformulieren"},"skill.mode.academic":{message:"Akademisch"},"skill.mode.creative":{message:"Kreativ"},"skill.mode.custom":{message:"Personalisiert"},"skill.mode.direct":{message:"Du-Form"},"skill.mode.expand":{message:"Erweitern"},"skill.mode.fluency":{message:"Lesefluss"},"skill.mode.formal":{message:"Formell"},"skill.mode.natural":{message:"Menschlich"},"skill.mode.polite":{message:"Sie-Form"},"skill.mode.shorten":{message:"Kürzen"},"skill.mode.simple":{message:"Einfach"},"skill.mode.standard":{message:"Standard"},"skills.heading.custom":{message:"Ihre eigenen Modi"},"skills.heading.premiumModes":{message:"Alle Premium-Modi freischalten"},"type.phrase":{message:"Phrase"},"type.sentence":{message:"Satz"},"upselling.academic.description":{message:"Der akademische Modus drückt den Text in einer technischeren und wissenschaftlicheren Weise aus"},"upselling.academic.text":{message:"Vermitteln Sie Ihr Wissen"},"upselling.creative.description":{message:"Der kreative Modus formuliert Text auf originelle Weise um"},"upselling.creative.text":{message:"Sagen Sie es mit Schnörkeln"},"upselling.cta":{message:"Premium holen"},"upselling.custom.description":{message:"Erstellen Sie einen eigenen Modus und schreiben Sie den Text so um, dass er einer beliebigen Beschreibung entspricht."},"upselling.custom.text":{message:"Definieren Sie den Tonfall"},"upselling.default.description":{message:"Schreiben Sie den Text so um, dass er jedem Ton, Stil oder Zweck entspricht"},"upselling.default.text":{message:"Machen Sie Ihre Texte noch besser"},"upselling.expand.description":{message:"Der ausführliche Modus macht Ihren Text länger"},"upselling.expand.text":{message:"Sagen Sie mehr"},"upselling.formal.description":{message:"Der formale Modus drückt den Text auf eine anspruchsvollere Weise aus"},"upselling.formal.text":{message:"Wollen Sie professionell klingen?"},"upselling.heading":{message:"Alle Premium-Modi freischalten"},"upselling.shorten.description":{message:"Der Verkürzungsmodus vermittelt die Bedeutung eines Textes in prägnanter Form"},"upselling.shorten.text":{message:"Fassen Sie sich kurz"},"upselling.simple.description":{message:"Der einfache Modus stellt den Text auf leicht verständliche Weise dar"},"upselling.simple.text":{message:"Vereinfachen Sie es"}}},en:{paraphraser:{"caption.group.synonyms":{message:"Synonyms for “%{subject}”"},"caption.phrase":{message:"Rewrite selection"},"caption.selection":{message:"Rewrite selection"},"caption.sentence":{message:"Rewrite sentence"},"caption.word":{message:"Find synonym"},"copy.initial":{message:"Copy result"},"copy.success":{message:"Copied!"},"custom-caption.word.empty":{message:"No synonyms have been found."},"custom-caption.word.failed":{message:"Failed to load synonyms."},"custom.mode.title":{message:"Custom Mode"},"custom.suggestions.options":{message:"Friendly, well written, descriptive, filled with idioms, like Shakespeare"},"custom.suggestions.title":{message:"Suggestions"},"error.copy.message":{message:"Failed to copy text."},"heading.selection":{message:"Rewrite selection"},"heading.sentence":{message:"Rewrite sentence"},"heading.sentence.custom":{message:'Rewrite: Custom Mode "%{userCustomMode}"'},"heading.sub-sentence":{message:'Results for "%{subject}"'},"heading.text":{message:"Rewrite selection"},"info.emptyApiResponse":{message:"Nothing found"},"info.emptySourceText":{message:"Nothing to Rewrite …"},"info.failedApiResponse":{message:"Sorry, failed to load suggestions. Please retry..."},"info.loading":{message:"Loading content …"},"info.subjectTooLong":{message:"Sorry, your text exceeds the limit of 10,000 characters."},name:{message:"Paraphraser"},"placeholder.custom-input":{message:"Enter a custom paraphrasing mode"},"placeholder.selection-result-input":{message:"Enter text …"},"primary-action.back":{message:"Back"},"primary-action.retry":{message:"Retry"},"primary-action.submit":{message:"Insert"},"secondary-action.back-to-ai-tools":{message:"Back to AI Tools"},"skill.default":{message:"Rewrite"},"skill.mode.academic":{message:"Academic"},"skill.mode.creative":{message:"Creative"},"skill.mode.custom":{message:"Custom"},"skill.mode.direct":{message:"“Du” form"},"skill.mode.expand":{message:"Longer"},"skill.mode.fluency":{message:"Fluent"},"skill.mode.formal":{message:"Formal"},"skill.mode.natural":{message:"Humanize"},"skill.mode.polite":{message:"“Sie” form"},"skill.mode.shorten":{message:"Shorter"},"skill.mode.simple":{message:"Simple"},"skill.mode.standard":{message:"Standard"},"skills.heading.custom":{message:"Your past custom modes"},"skills.heading.premiumModes":{message:"Unlock all premium modes"},"type.phrase":{message:"Phrase"},"type.sentence":{message:"Sentence"},"upselling.academic.description":{message:"Academic mode expresses text in a more technical and scholarly way"},"upselling.academic.text":{message:"Share your knowledge"},"upselling.creative.description":{message:"Creative mode rephrases text in an original and innovative way"},"upselling.creative.text":{message:"Say it with a flourish"},"upselling.cta":{message:"Get Premium"},"upselling.custom.description":{message:"Create a Custom mode and rewrite text to match any description"},"upselling.custom.text":{message:"Define your voice"},"upselling.default.description":{message:"Rewrite text to match any tone, style, or purpose"},"upselling.default.text":{message:"Upgrade your writing"},"upselling.expand.description":{message:"Expand mode increases the length of text"},"upselling.expand.text":{message:"Stretch your words"},"upselling.formal.description":{message:"Formal mode rephrases text in a more sophisticated way"},"upselling.formal.text":{message:"Want to sound professional?"},"upselling.heading":{message:"Unlock all premium modes"},"upselling.shorten.description":{message:"Shorten mode conveys the meaning of text concisely"},"upselling.shorten.text":{message:"Keep it short"},"upselling.simple.description":{message:"Simple mode presents text in a way that's easy to understand"},"upselling.simple.text":{message:"Simplify things"}}},es:{paraphraser:{"caption.group.synonyms":{message:"Sinónimos para “%{subject}”"},"caption.phrase":{message:"Parafrasear selección"},"caption.selection":{message:"Parafrasear selección"},"caption.sentence":{message:"Parafrasear oración"},"caption.word":{message:"Buscar sinónimos"},"copy.initial":{message:"Copiar resultado"},"copy.success":{message:"¡Copiado!"},"custom-caption.word.empty":{message:"No se han encontrado sinónimos."},"custom-caption.word.failed":{message:"Fallo al cargar sinónimos."},"custom.mode.title":{message:"Modo personalizado"},"custom.suggestions.options":{message:"Amable, bien escrito, descriptivo, lleno de modismos, estilo Shakespeare"},"custom.suggestions.title":{message:"Sugerencias"},"error.copy.message":{message:"Error al copiar texto"},"heading.selection":{message:"Parafrasear selección"},"heading.sentence":{message:"Parafrasear oración"},"heading.sentence.custom":{message:'Reescribir: Modo personalizado "%{userCustomMode}"'},"heading.sub-sentence":{message:'Resultados para "%{subject}"'},"heading.text":{message:"Parafrasear selección"},"info.emptyApiResponse":{message:"Sin resultados"},"info.emptySourceText":{message:"Nada que parafrasear…"},"info.failedApiResponse":{message:"Lo sentimos, hubo un error al cargar las sugerencias. Inténtalo de nuevo..."},"info.loading":{message:"Cargando contenido…"},"info.subjectTooLong":{message:"Lo sentimos, el texto supera los 10 000 caracteres."},name:{message:"Parafrasear"},"placeholder.custom-input":{message:"Añadir un modo de parafraseo personalizado"},"placeholder.selection-result-input":{message:"Añadir texto…"},"primary-action.back":{message:"Volver"},"primary-action.retry":{message:"Volver a intentar"},"primary-action.submit":{message:"Introducir"},"secondary-action.back-to-ai-tools":{message:"Volver a Herramientas de IA"},"skill.default":{message:"Parafrasear"},"skill.mode.academic":{message:"Académico"},"skill.mode.creative":{message:"Creativo"},"skill.mode.custom":{message:"Personalizado"},"skill.mode.direct":{message:"Forma « Du »"},"skill.mode.expand":{message:"Ampliar"},"skill.mode.fluency":{message:"Fluido"},"skill.mode.formal":{message:"Formal"},"skill.mode.natural":{message:"Humanizar"},"skill.mode.polite":{message:"Forma « Sie »"},"skill.mode.shorten":{message:"Acortar"},"skill.mode.simple":{message:"Simple"},"skill.mode.standard":{message:"Estándar"},"skills.heading.custom":{message:"Tus modos personalizados anteriores"},"skills.heading.premiumModes":{message:"Activa todos los modos premium"},"type.phrase":{message:"Frase"},"type.sentence":{message:"Oración"},"upselling.academic.description":{message:"El modo académico reformula el texto de forma más técnica y culta"},"upselling.academic.text":{message:"Comparte tu conocimiento"},"upselling.creative.description":{message:"El modo creativo parafrasea el texto de forma original e innovadora"},"upselling.creative.text":{message:"Exprésalo de forma más creativa"},"upselling.cta":{message:"Hazte Premium"},"upselling.custom.description":{message:"Crea un modo personalizado y parafrasea el texto de acuerdo a la descripción"},"upselling.custom.text":{message:"Define tu estilo"},"upselling.default.description":{message:"Reescribe el texto para que coincida con cualquier tono, estilo o propósito"},"upselling.default.text":{message:"Mejora tu escritura"},"upselling.expand.description":{message:"El modo ampliar aumenta la longitud del texto"},"upselling.expand.text":{message:"Extiende tus palabras"},"upselling.formal.description":{message:"El modo formal reescribe el texto de manera más elaborada"},"upselling.formal.text":{message:"¿Quieres sonar profesional?"},"upselling.heading":{message:"Desbloquea todos los modos premium"},"upselling.shorten.description":{message:"El modo abreviado transmite el significado del texto de forma concisa"},"upselling.shorten.text":{message:"Manténlo breve"},"upselling.simple.description":{message:"El modo simple presenta el texto de forma sencilla"},"upselling.simple.text":{message:"Simplifica las cosas"}}},fr:{paraphraser:{"caption.group.synonyms":{message:"Synonymes pour « %{subject} »"},"caption.phrase":{message:"Reformuler la sélection"},"caption.selection":{message:"Reformuler la sélection"},"caption.sentence":{message:"Reformuler une phrase"},"caption.word":{message:"Trouver un synonyme"},"copy.initial":{message:"Copier le résultat"},"copy.success":{message:"Copié !"},"custom-caption.word.empty":{message:"Aucun synonyme n'a été trouvé."},"custom-caption.word.failed":{message:"Échec du chargement des synonymes."},"custom.mode.title":{message:"Mode personnalisé"},"custom.suggestions.options":{message:"Bien écrit, descriptif, adapté : votre texte, tout nouveau, tout beau."},"custom.suggestions.title":{message:"Suggestions"},"error.copy.message":{message:"Échec de copie du texte."},"heading.selection":{message:"Reformuler la sélection"},"heading.sentence":{message:"Reformuler une phrase"},"heading.sentence.custom":{message:"Reformulation : Mode personnalisé « %{userCustomMode} »"},"heading.sub-sentence":{message:"Résultats pour « %{subject} »"},"heading.text":{message:"Reformuler la sélection"},"info.emptyApiResponse":{message:"Aucun résultat"},"info.emptySourceText":{message:"Aucune reformulation disponible..."},"info.failedApiResponse":{message:"Le chargement des suggestions a échoué. Veuillez réessayer."},"info.loading":{message:"Chargement du contenu …"},"info.subjectTooLong":{message:"Votre texte dépasse la limite de 10 000 caractères."},name:{message:"Reformuler"},"placeholder.custom-input":{message:"Ajouter un mode de reformulation personnalisé"},"placeholder.selection-result-input":{message:"Ajouter du texte..."},"primary-action.back":{message:"Retour"},"primary-action.retry":{message:"Réessayer"},"primary-action.submit":{message:"Soumettre"},"secondary-action.back-to-ai-tools":{message:"Retour aux outils d'IA"},"skill.default":{message:"Reformuler"},"skill.mode.academic":{message:"Académique"},"skill.mode.creative":{message:"Créatif"},"skill.mode.custom":{message:"Personnaliser"},"skill.mode.direct":{message:"Forme « Du »"},"skill.mode.expand":{message:"Plus long"},"skill.mode.fluency":{message:"Idiomatique"},"skill.mode.formal":{message:"Formel"},"skill.mode.natural":{message:"Humaniser"},"skill.mode.polite":{message:"Vouvoiement"},"skill.mode.shorten":{message:"Plus court"},"skill.mode.simple":{message:"Simple"},"skill.mode.standard":{message:"Standard"},"skills.heading.custom":{message:"Vos anciens modes personnalisés"},"skills.heading.premiumModes":{message:"Accéder à tous les modes Premium"},"type.phrase":{message:"Expression"},"type.sentence":{message:"Phrase"},"upselling.academic.description":{message:"Le mode académique offre des suggestions adaptées à la rédaction de textes techniques et académiques."},"upselling.academic.text":{message:"À bonne école."},"upselling.creative.description":{message:"Le mode créatif propose de nombreuses suggestions pour rendre votre texte plus original et plus impactant."},"upselling.creative.text":{message:"Dites-le avec des mots."},"upselling.cta":{message:"Obtenir la formule Premium"},"upselling.custom.description":{message:"Créez un mode entièrement personnalisé et reformulez vos textes afin qu’ils correspondent à n’importe quelle description."},"upselling.custom.text":{message:"Vos mots. Et rien que les vôtres."},"upselling.default.description":{message:"Reformule le texte pour qu’il corresponde à n’importe quel ton, style ou objectif."},"upselling.default.text":{message:"Des textes optimisés, partout."},"upselling.expand.description":{message:"Le mode étendu permet d’étoffer la longueur de vos textes pour des écrits parfaits."},"upselling.expand.text":{message:"Des textes à ralloooooonge"},"upselling.formal.description":{message:"Le mode formel reformule votre texte de manière optimale, pour des écrits professionnels irréprochables.."},"upselling.formal.text":{message:"Les écrits professionnels ? Trop facile."},"upselling.heading":{message:"Accéder à tous les modes Premium"},"upselling.shorten.description":{message:"Le mode concis raccourcit vos écrits pour n’en garder que le meilleur."},"upselling.shorten.text":{message:"La concision qui a tout bon."},"upselling.simple.description":{message:"Le mode simple facilite la compréhension de vos écrits en vous proposant des alternatives claires et percutantes. Tout simplement."},"upselling.simple.text":{message:"Des écrits simplifiés, maintenant."}}},nl:{paraphraser:{"caption.group.synonyms":{message:'Synoniemen voor "%{subject}"'},"caption.phrase":{message:"Herschrijf selectie"},"caption.selection":{message:"Herschrijf selectie"},"caption.sentence":{message:"Herschrijf zin"},"caption.word":{message:"Zoek synoniem"},"copy.initial":{message:"Resultaat kopiëren"},"copy.success":{message:"Gekopieerd!"},"custom-caption.word.empty":{message:"Geen synoniemen gevonden."},"custom-caption.word.failed":{message:"Synoniemen laden is mislukt."},"custom.mode.title":{message:"Aangepaste modus"},"custom.suggestions.options":{message:"Vriendelijk, goed geschreven, beschrijvend, vol idiomen, zoals Shakespeare"},"custom.suggestions.title":{message:"Suggesties"},"error.copy.message":{message:"Het kopiëren van de tekst is mislukt."},"heading.selection":{message:"Herschrijf selectie"},"heading.sentence":{message:"Herschrijf zin"},"heading.sentence.custom":{message:'Herschrijf: aangepaste modus "%{userCustomMode}"'},"heading.sub-sentence":{message:'Resultaten voor "%{subject}"'},"heading.text":{message:"Herschrijf selectie"},"info.emptyApiResponse":{message:"Niets gevonden"},"info.emptySourceText":{message:"Niets te herschrijven…"},"info.failedApiResponse":{message:"Sorry, het laden van de suggesties is mislukt. Probeer het opnieuw…"},"info.loading":{message:"Inhoud laden …"},"info.subjectTooLong":{message:"Helaas, uw tekst overschrijdt de limiet van 10.000 tekens."},name:{message:"Herschrijver"},"placeholder.custom-input":{message:"Voer een aangepaste herschrijfmodus in"},"placeholder.selection-result-input":{message:"Voer tekst in …"},"primary-action.back":{message:"Terug"},"primary-action.retry":{message:"Probeer opnieuw"},"primary-action.submit":{message:"Indienen"},"secondary-action.back-to-ai-tools":{message:"Terug naar AI-tools"},"skill.default":{message:"Herschrijf"},"skill.mode.academic":{message:"Academisch"},"skill.mode.creative":{message:"Creatief"},"skill.mode.custom":{message:"Aangepast"},"skill.mode.direct":{message:'"Du"-vorm'},"skill.mode.expand":{message:"Langer"},"skill.mode.fluency":{message:"Vlot"},"skill.mode.formal":{message:"Formeel"},"skill.mode.natural":{message:"Menselijker maken"},"skill.mode.polite":{message:'"Sie"-vorm'},"skill.mode.shorten":{message:"Korter"},"skill.mode.simple":{message:"Eenvoudig"},"skill.mode.standard":{message:"Standaard"},"skills.heading.custom":{message:"Uw vorige aangepaste modi"},"skills.heading.premiumModes":{message:"Ontgrendel alle premiummodi"},"type.phrase":{message:"Zin"},"type.sentence":{message:"Zin"},"upselling.academic.description":{message:"De Academische modus helpt u de tekst op een technische en wetenschappelijke manier uit te drukken"},"upselling.academic.text":{message:"Deel uw kennis"},"upselling.creative.description":{message:"Creatieve modus herschrijft tekst op een originele en vernieuwende manier"},"upselling.creative.text":{message:"Zeg het met flair"},"upselling.cta":{message:"Kies Premium"},"upselling.custom.description":{message:"Maak uw eigen aangepast modus en herschrijf tekst die bij iedere beschrijving past."},"upselling.custom.text":{message:"Definiëer uw stem"},"upselling.default.description":{message:"Herschrijf de tekst zodat deze bij elke toon, stijl of doel past"},"upselling.default.text":{message:"Verbeter je schrijfstijl"},"upselling.expand.description":{message:"De modus Langer verlengt de tekst"},"upselling.expand.text":{message:"Verleng uw woorden"},"upselling.formal.description":{message:"Formele modus herschrijft tekst op een verfijnde manier."},"upselling.formal.text":{message:"Wilt u professioneel overkomen?"},"upselling.heading":{message:"Ontgrendel alle premiummodi"},"upselling.shorten.description":{message:"De modus Korter brengt de betekenis van de tekst bondig over"},"upselling.shorten.text":{message:"Houd het kort"},"upselling.simple.description":{message:"De modus Eenvoudig presenteert tekst op een manier die gemakkelijk te begrijpen is"},"upselling.simple.text":{message:"Maak het eenvoudiger"}}},"pt-br":{paraphraser:{"caption.group.synonyms":{message:"Sinônimos para “%{subject}”"},"caption.phrase":{message:"Reescrever seleção"},"caption.selection":{message:"Reescrever seleção"},"caption.sentence":{message:"Reescrever frase"},"caption.word":{message:"Encontrar sinônimo"},"copy.initial":{message:"Copiar resultado"},"copy.success":{message:"Copiado!"},"custom-caption.word.empty":{message:"Nenhum sinônimo foi encontrado."},"custom-caption.word.failed":{message:"Falha ao carregar sinônimos."},"custom.mode.title":{message:"Modo Personalizado"},"custom.suggestions.options":{message:"Amigável, bem escrito, descritivo, cheio de expressões idiomáticas, como Shakespeare"},"custom.suggestions.title":{message:"Sugestões"},"error.copy.message":{message:"Falha ao copiar o texto."},"heading.selection":{message:"Reescrever seleção"},"heading.sentence":{message:"Reescrever frase"},"heading.sentence.custom":{message:'Reescrever: Modo Personalizado "%{userCustomMode}"'},"heading.sub-sentence":{message:'Resultados para "%{subject}"'},"heading.text":{message:"Reescrever seleção"},"info.emptyApiResponse":{message:"Nada foi encontrado"},"info.emptySourceText":{message:"Nada para parafrasear…"},"info.failedApiResponse":{message:"Desculpe, não foi possível carregar as sugestões. Tente novamente..."},"info.loading":{message:"Carregando conteúdo…"},"info.subjectTooLong":{message:"Desculpe, seu texto excede o limite de 10.000 caracteres."},name:{message:"Parafraseador"},"placeholder.custom-input":{message:"Insira um modo de reescrita personalizado"},"placeholder.selection-result-input":{message:"Digite algum texto…"},"primary-action.back":{message:"Voltar"},"primary-action.retry":{message:"Tentar de novo"},"primary-action.submit":{message:"Inserir"},"secondary-action.back-to-ai-tools":{message:"Voltar para Ferramentas de IA"},"skill.default":{message:"Reescrever"},"skill.mode.academic":{message:"Acadêmico"},"skill.mode.creative":{message:"Criativo"},"skill.mode.custom":{message:"Personalizado"},"skill.mode.direct":{message:"Forma “Du”"},"skill.mode.expand":{message:"Expandir"},"skill.mode.fluency":{message:"Fluente"},"skill.mode.formal":{message:"Formal"},"skill.mode.natural":{message:"Humanizar"},"skill.mode.polite":{message:"Forma “Sie”"},"skill.mode.shorten":{message:"Encurtar"},"skill.mode.simple":{message:"Simples"},"skill.mode.standard":{message:"Padrão"},"skills.heading.custom":{message:"Seus modos personalizados anteriores"},"skills.heading.premiumModes":{message:"Desbloqueie todos os modos premium"},"type.phrase":{message:"Frase"},"type.sentence":{message:"Frase"},"upselling.academic.description":{message:"O modo acadêmico reformula os textos de forma técnica e acadêmica"},"upselling.academic.text":{message:"Compartilhe seu conhecimento"},"upselling.creative.description":{message:"O modo criativo reformula o texto de forma original e inovadora"},"upselling.creative.text":{message:"Diga com floreios"},"upselling.cta":{message:"Assinar Premium"},"upselling.custom.description":{message:"Crie um modo Personalizado e reescreva o texto para corresponder a qualquer descrição"},"upselling.custom.text":{message:"Defina seu tom"},"upselling.default.description":{message:"Reescreva o texto para corresponder a qualquer tom, estilo ou propósito"},"upselling.default.text":{message:"Aprimore sua escrita"},"upselling.expand.description":{message:"O modo expandir aumenta o comprimento do texto"},"upselling.expand.text":{message:"Alongue suas palavras"},"upselling.formal.description":{message:"O modo formal reformula o texto de uma forma mais sofisticada"},"upselling.formal.text":{message:"Quer soar profissional?"},"upselling.heading":{message:"Desbloqueie todos os modos premium"},"upselling.shorten.description":{message:"O modo encurtar transmite o significado do texto de forma concisa"},"upselling.shorten.text":{message:"Seja breve"},"upselling.simple.description":{message:"O modo simples apresenta o texto de uma forma fácil de entender"},"upselling.simple.text":{message:"Simplifique as coisas"}}}},G=[{order:0,name:"standard",isPremium:!1}],j="paraphraser_plugin_custom_modes_3",W="paraphraser_plugin_last_used_mode",$="paraphraser_plugin_used_modes_count",z="@advanced-toolbox/plugin-paraphraser",V=`${z}/sentence`,K=`${z}/phrase`,X=`${z}/word`,q=`${z}/text`,Y=new Set([V,K,X,q]),Z=class e extends i.PluginBase{constructor(t){if(super(),this.config=t,u(this,"mount"),u(this,"connection"),u(this,"sendMonitoringEvent"),u(this,"adapter"),u(this,"unbindMessageListener"),u(this,"frameApi"),u(this,"viewApi"),u(this,"clipboardWrite"),u(this,"i18n"),u(this,"textContext"),u(this,"selectedSkill"),u(this,"textSelectionContext"),u(this,"unmountReactApp"),u(this,"handleMessageUpdate",(({type:e,payload:t})=>{var n;switch(e){case"toolbox:PLUGIN_RENDER":this.render(t.options);break;case"toolbox:UPDATE_TEXT_CONTEXT":if(!this.textContext)return;this.textContext=t.context,this.handleTextContextUpdate(t.context);break;case"toolbox:ABORT":this.handleAbort();break;case"toolbox:CLIPBOARD_WRITE_RESULT":null==(n=this.clipboardWrite)||n.receive(t.status);break;default:throw new Error(`[Toolbox] Unexpected message "${Object(t).type} || <unknown>" from Toolbox`)}})),u(this,"paraphrase",((e,t,n,s)=>{var r;if((0,o.isUndefined)(this.textSelectionContext))throw new Error("[toolbox] Paraphrasing text selection context is missing.");if((0,o.isUndefined)(this.textContext))throw new Error("[toolbox] Text context is missing.");const i=(0,o.sanitizeLocale)(null!=(r=this.textContext.locale)?r:"");if(!i)throw new Error("[toolbox] Text locale is missing.");const{textSelectionContext:a}=this,l=e=>{const t=(()=>{const t=(0,o.getLanguageCode)(i);if(["sentence","text"].includes(e))return t;const n="phrase"===e?this.adapter.getSupportedPhrasalLocales():this.adapter.getSupportedSynonymLocales();switch(!0){case n.includes(i):return i;case n.includes(t):return t;default:throw new Error(`[toolbox] Received unsupported locale "${i}" for paraphrasing.`)}})();return{before:a.beforeText,after:a.afterText,range:a.range,language:t}};switch(this.saveModesUsageToStorage(t,n),e){case"sentence":if(!(0,o.isFunction)(this.adapter.rewriteSentence))throw new Error("[toolbox] Sentence paraphrasing is not supported.");if((0,o.isUndefined)(t))throw new Error("[toolbox] The paraphrase mode is missing.");return this.adapter.rewriteSentence(a.subject,{mode:t,userCustomMode:n,...l("sentence")});case"phrase":if(!(0,o.isFunction)(this.adapter.rewritePhrase))throw new Error("[toolbox] Phrasal paraphrasing is not supported.");return this.adapter.rewritePhrase(a.subject,{...l("phrase"),mode:t,userCustomMode:n});case"word":if(!(0,o.isFunction)(this.adapter.rewriteWord))throw new Error("[toolbox] Synonyms aren't supported.");return this.adapter.rewriteWord(a.subject,{...l("word"),mode:t,userCustomMode:n});case"text":if(!(0,o.isFunction)(this.adapter.rewriteSentence))throw new Error("[toolbox] Sentence paraphrasing is not supported.");if((0,o.isUndefined)(t))throw new Error("[toolbox] The paraphrase mode is missing.");if(!Array.isArray(s)||2!==s.length)throw new Error("[toolbox] The paraphrase range is missing or invalid.");return this.adapter.rewriteSentence(a.subject.substring(s[0],s[1]),{mode:t,userCustomMode:n,...l("text")});default:return}})),!e.adapter)throw new Error("[Toolbox -> Paraphraser] Missing branded network adapter. Please pass in via `ToolboxPluginParaphraser.addAdapter(...)`.");this.adapter=e.adapter,e.adapter=void 0,this.i18n=(0,r.createI18n)(t.language,B,"paraphraser")}static get STORAGE_NS(){return"paraphraser"}static get ID(){return z}static addAdapter(e){this.adapter=e}static getPreselectedSkillId(e,t){const{wordRange:n,phraseRange:s,sentenceRange:r,textRange:i,locale:a,selection:l}=e,c=(0,o.sanitizeLocale)(null!=a?a:"");if(!c)return null;const d=(0,o.getLanguageCode)(c),h=t.synonym.some((e=>(0,o.getLanguageCode)(e)===d)),u=t.phrase.some((e=>(0,o.getLanguageCode)(e)===d)),g=l.start===l.end;return Array.isArray(n)&&h&&!g?X:Array.isArray(s)&&u?K:Array.isArray(r)?V:Array.isArray(i)?q:null}static isTextSkill(e){return e===q}static isSentenceSkill(e){return e===V}static isPhraseSkill(e){return e===K}static isSynonymSkill(e){return null==e?void 0:e.startsWith(X+"-")}static registerReactDomRenderer(e){this.reactDomRenderer=e}static async getLastUsedMode(e){try{return await(0,o.namespaceStorage)(this.STORAGE_NS,e).read(W)}catch(e){console.warn("[toolbox] Failed to read last used pphr mode from Pphr class.",e)}}get id(){return z}get name(){return this.i18n.get("name")}getTopLevelEntries(e){const{selection:t,sentenceRange:n,locale:s}=e.context,r=(0,o.sanitizeLocale)(null!=s?s:"");if(!r)return[];const{subject:i,type:a,range:l}=(0,o.getSubjectFromContext)(e.context);if(!a)return[];const c=(0,o.getLanguageCode)(r),d=this.adapter.getSupportedSentenceLocales().some((e=>(0,o.getLanguageCode)(e)===c)),h=this.adapter.getSupportedPhrasalLocales().some((e=>(0,o.getLanguageCode)(e)===c)),u=this.adapter.getSupportedSynonymLocales().some((e=>(0,o.getLanguageCode)(e)===c)),g=t.start===t.end,m=new Set,p=Array.isArray(n)&&(0,o.isFunction)(this.adapter.rewriteSentence)&&d?{id:this.id,caption:this.i18n.get("skill.default"),type:"skill",highlight:{type:"sentence",range:e.context.sentenceRange},icon:"paraphrase",name:`${this.id}/sentence`}:null;if(p&&("sentence"===a||this.hasSelectedWholeSentence(e.context)))return[p];if(g&&p&&m.add(p),p&&"word"===a&&m.add(p),"text"===a&&(0,o.isFunction)(this.adapter.rewriteSentence)){const e={id:this.id,caption:this.i18n.get("skill.default"),type:"skill",icon:"paraphrase",name:`${this.id}/text`};i.length<=1e4&&(e.highlight={type:"sentence",range:l}),m.add(e)}return this.getSubSentenceSkills(e.context,a,l,i,r,{isLocaleSupportingPhrasalParaphrasing:h,isLocaleSupportingSynonyms:u}).concat([...m])}getSearchPromptEntries(e,t){const n=this.getTopLevelEntries(e);if((0,o.isPromise)(n))return[];const s=[];for(const e of n)!(0,o.isPromise)(e)&&(0,o.isString)(e.caption)&&s.push(e);const r=new RegExp(`^${(0,o.escapeForRegEx)(t)}`,"i"),i=[];for(const t of s){if(!Y.has(t.name))continue;const n=this.getAllAvailableModes(t.name,!0).map((({name:n,isPremium:s})=>{const r=[this.i18n.get("skill.default"),this.i18n.has(`skill.mode.${n}`)?this.i18n.get(`skill.mode.${n}`):null].filter(Boolean).join(" → ");return{...t,name:`${t.name}-${n}`,isLocked:s&&!e.user.isPremium,caption:r}}));i.push(...n)}return i.filter((({caption:e})=>e.split(/\P{L}+/u).some((e=>!!e.match(r)))))}async getRecentlyUsedCustomModes(e=4){const t=await this.config.storage.read(j);return t?Object.entries(t).map((([e,t])=>({sentenceParaphraseCustomMode:e,lastUsed:t}))).filter((e=>void 0!==e.lastUsed)).sort(((e,t)=>t.lastUsed-e.lastUsed)).slice(0,e).map((e=>e.sentenceParaphraseCustomMode)):[]}async sortModesBasedOnUsage(e){const t=[...e].sort(((e,t)=>{var n,s;return"custom"===e.name&&"custom"!==t.name?1:"custom"===t.name&&"custom"!==e.name?-1:(null!=(n=e.order)?n:0)-(null!=(s=t.order)?s:0)}));if(t.length<4)return[...t];const n=await this.config.storage.read($)||{},s=Object.entries(n).filter((([e,n])=>n>5&&t.some((t=>t.name===e&&"custom"!==e)))).map((([e,t])=>({name:e,usage:t}))).sort(((e,t)=>t.usage-e.usage)),r={tenPlusUsage:[],sevenPlusUsage:[],fivePlusUsage:[]};s.forEach((({name:e,usage:t})=>{t>=10?r.tenPlusUsage.push(e):t>=7?r.sevenPlusUsage.push(e):r.fivePlusUsage.push(e)}));const i=[...r.tenPlusUsage,t[0].name].filter(Boolean)[0],o=[...r.tenPlusUsage,...r.sevenPlusUsage,t[0].name,t[1].name].filter((e=>e&&e!==i))[0],a=[...r.tenPlusUsage,...r.sevenPlusUsage,...r.fivePlusUsage,t[0].name,t[1].name,t[2].name].filter(Boolean).filter((e=>e&&![i,o].includes(e)))[0],l=[i,o,a].filter(Boolean);return[...l.map((e=>t.find((t=>t.name===e)))).filter(Boolean),...t.filter((e=>!l.includes(e.name)))]}getAllAvailableModes(e,t){const n=this.getSelectionTypeForSkillId(e),s=(()=>{switch(!0){case"sentence"===n||"text"===n:return this.adapter.getSentenceModes();case"phrase"===n:return this.adapter.getPhraseModes();case"word"===n:return this.adapter.getWordModes();default:return[]}})();return t?[...G,...s]:[...G,...s.filter((e=>!e.isPremium))]}connect(e,t){this.unmountReactApp||(this.connection=e,this.mount=t,this.unbindMessageListener=e.onMessage(this.handleMessageUpdate),this.sendMonitoringEvent=t=>e.emit((0,i.createMonitoringEventMessage)(t)),e.emit((0,i.createUpdateStateMessage)("initializing")))}getOptionalSecondaryType(){if(!this.textContext||!this.selectedSkill)return;const e=this.getSelectionTypeForSkillId(this.selectedSkill);return"text"!==e?"phrase"!==e&&(0,o.getSubjectFromContext)(this.textContext,"phrase").subject?"phrase":"word"!==e&&(0,o.getSubjectFromContext)(this.textContext,"word").subject?"word":"sentence"!==e&&(0,o.getSubjectFromContext)(this.textContext,"sentence").subject?"sentence":void 0:void 0}async mountPluginView(t,n,r){var a,l;if(!(this.mount&&this.connection&&this.sendMonitoringEvent&&this.textContext))throw new Error(`[Toolbox] Failed to render the plugin. Reason: Plugin(${this.id}) is not connected correctly.`);this.selectedSkill=await this.getSelectedSkill(t);const{type:c,textSelectionContext:d}=this.getSubjectFromContext(this.textContext,this.selectedSkill);this.textSelectionContext=d,this.frameApi=(0,s.createRef)(),this.viewApi=(0,s.createRef)();const h=this.mapSkillIdToParaphraseMode(this.selectedSkill,c),u=()=>this.getSelectionRangeForType(c),g=e=>{var t;return null==(t=this.connection)?void 0:t.emit((0,i.createUpdateUiOptionsMessage)({primaryActionHidden:e}))},m=e=>{var t;let n="";switch(e){case"word":n=X;break;case"phrase":n=K;break;case"sentence":n=V;break;default:throw new Error(`[toolbox] Pphr plugin erroneously trying to switch skill to "${e}".`)}null==(t=this.connection)||t.emit((0,i.createChangeSkillMessage)(this.id,n))};g(!0);const p=await this.getRecentlyUsedCustomModes(3),_=this.getCustomMode(n,this.selectedSkill,p),E=await this.sortModesBasedOnUsage(this.getAllAvailableModes(this.selectedSkill,!0)),f=this.getOptionalSecondaryType(),T=f?()=>{var e,t;const s=this.baseSkillForType(f);null==(e=this.sendMonitoringEvent)||e.call(this,{name:"toolbox:action",data:`plugin_paraphraser:selection-switch-to:${f}`}),null==(t=this.unmountReactApp)||t.call(this),this.mountPluginView(s,n,r),m(f)}:void 0,C={i18n:this.i18n,sendMonitoringEvent:this.sendMonitoringEvent,allModes:E,previousCustomModes:p,selectedCustomMode:_,subject:this.textSelectionContext.subject,textLocale:this.textContext.locale,onError:()=>{var e;return null==(e=this.connection)?void 0:e.emit((0,i.createUpdateStateMessage)("exception"))},mode:h,type:c,onSkillChange:T,secondaryType:f},S=(0,s.createElement)(v,{...C,ref:this.frameApi},(0,s.createElement)(U,{ref:this.viewApi,allModes:E,upsellingLink:r?null:this.adapter.getUpsellingLink(),rewrite:this.paraphrase,onSelectSuggestion:(e,t)=>{var n,s,r;const[a,l]=u();null==(n=this.sendMonitoringEvent)||n.call(this,{name:"toolbox:action",data:`plugin_paraphraser:suggestion-selected:${t}:${c}`});const d={"text/plain":e,"text/html":e},h=(0,o.sanitizeLocale)(null!=(r=null==(s=this.textContext)?void 0:s.locale)?r:"")||void 0;this.connection.emit((0,i.createSelectMessage)(d,{value:this.textSelectionContext.subject,start:a,end:l},h))},toggleSubmitButtonLabel:e=>{var t;return null==(t=this.connection)?void 0:t.emit((0,i.createUpdateUiOptionsMessage)({primaryActionLabel:this.i18n.get(`primary-action.${e}`)}))},togglePrimaryActionHidden:g,emitStateChange:e=>{var t;return null==(t=this.connection)?void 0:t.emit((0,i.createUpdateStateMessage)(e))},sentenceRanges:this.textContext.sentenceRanges,textRange:this.textContext.textRange,text:this.textContext.text,onCopy:null==(a=this.clipboardWrite)?void 0:a.send,saleConfig:this.adapter.getSaleConfig()}));this.unmountReactApp=e.reactDomRenderer(S,this.mount),this.connection.emit((0,i.createSetTextHighlightMessage)(c,u())),null==(l=this.connection)||l.emit((0,i.createUpdateUiOptionsMessage)({secondaryActionLabel:this.i18n.get("secondary-action.back-to-ai-tools")}))}baseSkillForType(e){if("sentence"===e)return V;if("phrase"===e)return K;if("word"===e)return X;if("text"===e)return q;throw new Error(`[Toolbox] Unsupported selection type "${e}".`)}async render(e){this.canWriteToClipboard()&&(this.clipboardWrite=o.MessageConnector.create({sendMessage:e=>{var t;return null==(t=this.connection)?void 0:t.emit((0,i.createWriteToClipboardMessage)(e))},fallback:"error"})),this.textContext=e.context,await this.mountPluginView(e.skill,e.meta,e.user.isPremium)}getSubjectFromContext(e,t){const n=this.getSelectionTypeForSkillId(t),s=(()=>{const{wordRange:t,phraseRange:s,sentenceRange:r,...i}=e,o={phraseRange:void 0,wordRange:void 0,sentenceRange:void 0,...i};switch(n){case"sentence":return{...o,sentenceRange:r};case"phrase":return{...o,phraseRange:s};case"word":return{...o,wordRange:t};default:return o}})(),r=(0,o.getSubjectFromContext)(s),[i,a]=(0,o.findBoundingSentenceIndices)(r.range,e.sentenceRanges),l={...r,beforeText:i>-1?e.text.slice(Math.min(e.sentenceRanges[i][0],r.range[0]),r.range[0]):"",afterText:a>-1?e.text.slice(r.range[1],Math.max(r.range[1],e.sentenceRanges[a][1])):""};if(!l.type||!l.subject)throw new Error("[Toolbox] Missing the necessary input data from the Toolbox context to do paraphrasing.");return{type:n,textSelectionContext:l}}handleTextContextUpdate(e){var t,n,s,r,o;if(!this.selectedSkill)return void console.warn("[toolbox] Paraphraser context has been updated while its custom content isn't rendered.");const{type:a,textSelectionContext:l}=this.getSubjectFromContext(e,this.selectedSkill);this.textSelectionContext=l,null==(n=null==(t=this.frameApi)?void 0:t.current)||n.updateSubject(l.subject,e.locale),null==(r=null==(s=this.frameApi)?void 0:s.current)||r.updateSecondaryType(this.getOptionalSecondaryType());const c=this.getSelectionRangeForType(a);this.connection.emit((0,i.createSetTextHighlightMessage)(a,c)),null===e.locale&&(null==(o=this.sendMonitoringEvent)||o.call(this,{name:"toolbox:error",data:"plugin_paraphraser:context_update_language_is_null"}))}async saveModesUsageToStorage(e,t){if("custom"===e){const e=null==t?void 0:t.trim();if(!e)return;let n=await this.config.storage.read(j);n={...n,[e]:Date.now()};const s=Object.entries(n).sort((([,e],[,t])=>t-e)).slice(0,4);await this.config.storage.write(j,Object.fromEntries(s))}if(e){await this.config.storage.write(W,e);let t=await this.config.storage.read($)||{};t={...t,[e]:(t[e]||0)+1},await this.config.storage.write($,t)}}async getSelectedSkill(e){const t=[V,K,X,q].includes(e),n=this.getAllAvailableModes(e,!0);if(t){const t=await this.config.storage.read(W);if(t&&n.some((e=>e.name===t)))return`${e}-${t}`}else{const t=this.mapSkillIdToParaphraseMode(e,this.getSelectionTypeForSkillId(e));if(n.some((e=>e.name===t)))return e}const[{name:s}]=n;return`${e}-${s}`}getCustomMode(e,t,n){if((0,o.isObject)(e)&&(0,o.isString)(e.customMode))return e.customMode;if(t.endsWith("-custom")){const[e=""]=n;return e}return""}canWriteToClipboard(){var e,t;const{isSafari:n}=(0,o.assessOperatingSystem)(self.navigator.userAgent);if(n)return!1;if(null==(e=this.config.environment.uri)?void 0:e.startsWith("https:"))return!0;try{return"localhost"===new URL(null!=(t=this.config.environment.uri)?t:"").hostname}catch{return!1}}handleAbort(){var e,t,n;!0===(null==(t=null==(e=this.viewApi)?void 0:e.current)?void 0:t.abort())||null==(n=this.connection)||n.emit((0,i.createAbortMessage)())}unmount(){var e,t,n;null==(e=this.connection)||e.emit((0,i.createRemoveTextHighlightMessage)()),null==(t=this.unmountReactApp)||t.call(this),this.sendMonitoringEvent=void 0,null==(n=this.unbindMessageListener)||n.call(this),this.unmountReactApp=this.mount=this.unbindMessageListener=this.textContext=this.selectedSkill=this.frameApi=this.viewApi=this.clipboardWrite=this.connection=void 0}mapSkillIdToParaphraseMode(e,t){const n=`${this.id}/${t}-`;try{return e.split(n)[1].trim()}catch(t){return console.error(`Failed to extract paraphraser mode from skill Id. Error: ${t}`),console.warn("(%s) Selected skill id is not a valid, default to standard mode. Provided: %s",this.id,e),"standard"}}hasSelectedWholeSentence(e){const{selection:t,wordRange:n,sentenceRange:s}=e,r=Array.isArray(n);if(!s||r)return!1;if(t.start===t.end)return!1;const[i,o]=s,a=Math.max(o-i,0),l=Math.max(t.end-t.start,0);return Math.round(l/a*100)>=75}getSubSentenceSkills(e,t,n,s,r,i){const{isLocaleSupportingPhrasalParaphrasing:a,isLocaleSupportingSynonyms:l}=i,c=[];if((0,o.isFunction)(this.adapter.rewriteWord)&&(d=s,"word"===t&&!((0,o.isUrl)(d)||(0,o.containsEmojisOnly)(d)||(0,o.containsNumber)(d)))&&l){const t={id:this.id,type:"skill",name:`${this.id}/word-standard`,highlight:{type:"word",range:n},icon:"synonym"},i={getItems:()=>{const{textSelectionContext:i}=this.getSubjectFromContext(e,t.name);this.textSelectionContext=i,this.textContext=e;const o=this.paraphrase("word");return this.textSelectionContext=this.textContext=void 0,o?o.getData().then((({status:e,data:t})=>{if("error"===e)throw new Error("[toolbox] Failed to retrieve synonyms from API.");return t.map((({to:e})=>({selection:n,locale:r,subject:s,suggestion:e})))})):Promise.resolve([])},messages:{empty:this.i18n.get("custom-caption.word.empty"),failed:this.i18n.get("custom-caption.word.failed")}},o=this.adapter.shouldShowSynonymQuickView()?{...t,groupName:this.i18n.get("caption.group.synonyms",{subject:s}),caption:i}:{...t,caption:this.i18n.get("caption.word")};c.unshift(o)}var d;return"phrase"===t&&(0,o.isFunction)(this.adapter.rewritePhrase)&&a&&c.unshift({id:this.id,caption:this.i18n.get("skill.default"),type:"skill",name:`${this.id}/phrase`,highlight:{type:"phrase",range:n},icon:"paraphrase"}),c}getSelectionTypeForSkillId(e){switch(!0){case e.startsWith(V):return"sentence";case e.startsWith(K):return"phrase";case e.startsWith(X):return"word";case e.startsWith(q):return"text";default:throw new Error(`[Toolbox] Could not retrieve text selection type from skill ID "${e}".`)}}getSelectionRangeForType(e){if(!this.textContext)throw new Error("[toolbox] Current text context is missing.");let t;switch(e){case"sentence":t=this.textContext.sentenceRange;break;case"phrase":if(!this.textContext.phraseRange)throw new Error('[Toolbox] Got selection type "phrase" without a phrase range.');t=this.textContext.phraseRange;break;case"word":if(!this.textContext.wordRange)throw new Error('[Toolbox] Got selection type "word" without a word range.');t=this.textContext.wordRange;break;case"text":if(!this.textContext.textRange)throw new Error('[Toolbox] Got selection type "text" without a text range.');t=this.textContext.textRange;break;default:t=null}if(!t)throw new Error(`[Toolbox] Failed to retrieve selection range for type "${e}".`);return t}};u(Z,"adapter"),u(Z,"reactDomRenderer");var J=Z},
vendor: 1,265 bytes, lines 64-67
64"../../../node_modules/@advanced-toolbox/plugin/dist/index.mjs":
65/*!*********************************************************************!*\
66  !*** ../../../node_modules/@advanced-toolbox/plugin/dist/index.mjs ***!
67  \*********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{PluginBase:()=>s,createAbortMessage:()=>u,createChangeSkillMessage:()=>g,createCloseMessage:()=>l,createMonitoringEventMessage:()=>d,createRemoveTextHighlightMessage:()=>o,createSelectMessage:()=>r,createSetTextHighlightMessage:()=>i,createUpdateStateMessage:()=>a,createUpdateUiOptionsMessage:()=>c,createWriteToClipboardMessage:()=>h});class s{}const r=(e,t,n)=>({type:"plugin:SELECT",payload:{result:e,selection:t,locale:n}}),i=(e,t)=>({type:"plugin:SET_TEXT_HIGHLIGHT",payload:{type:e,range:t}}),o=()=>({type:"plugin:REMOVE_TEXT_HIGHLIGHT",payload:{}}),a=e=>({type:"plugin:UPDATE_STATE",payload:{state:e}}),l=()=>({type:"plugin:CLOSE",payload:{}}),c=e=>({type:"plugin:UPDATE_UI_OPTIONS",payload:{uiOptions:e}}),d=e=>({type:"plugin:MONITORING_EVENT",payload:{event:e}}),h=e=>({type:"plugin:WRITE_TO_CLIPBOARD",payload:e}),u=()=>({type:"plugin:ABORT",payload:null}),g=(e,t)=>({type:"plugin:CHANGE_SKILL",payload:{pluginId:e,skillId:t}})},
vendor: 542 bytes, lines 67-70
67"../../../node_modules/@advanced-toolbox/react-dom-adapater-18/dist/index.mjs":
68/*!************************************************************************************!*\
69  !*** ../../../node_modules/@advanced-toolbox/react-dom-adapater-18/dist/index.mjs ***!
70  \************************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{reactDomRenderer:()=>r});var s=n(/*! react-dom/client */"react-dom/client");const r=(e,t)=>{const n=(0,s.createRoot)(t);return n.render(e),()=>n.unmount()}},
vendor: 2,430 bytes, lines 70-73
70"../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs":
71/*!************************************************************************!*\
72  !*** ../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs ***!
73  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{AI_ERROR_TYPE_AMBIGUOUS_PROMPT:()=>L,AI_ERROR_TYPE_INVALID_PROMPT:()=>M,AI_ERROR_TYPE_SERVER_ERROR:()=>I,AI_SUBJECT_MAX_LENGTH:()=>P,AI_TYPE_ALTER_PHRASE:()=>A,AI_TYPE_ALTER_SENTENCE:()=>k,AI_TYPE_ALTER_TEXT:()=>w,AI_TYPE_REFINE_TEXT:()=>R,AI_TYPE_TEXT_GENERATION:()=>x,AI_TYPE_TEXT_GENERATION_WITH_CONTEXT:()=>y,DEFAULT_UI_LANGUAGE:()=>s,EMOJIS_REGEXP:()=>o,EVENT_TYPE_COMPOSITION:()=>p,EVENT_TYPE_COPY:()=>E,EVENT_TYPE_CUT:()=>f,EVENT_TYPE_FOCUSIN:()=>v,EVENT_TYPE_FOCUSOUT:()=>S,EVENT_TYPE_KEYBOARD:()=>_,EVENT_TYPE_PASTE:()=>T,EVENT_TYPE_SELECTION_CHANGE:()=>C,IMAGE_LIKE_ELEMENT_SELECTOR:()=>g,MODIFIER_LETTERS:()=>N,NBSP:()=>l,NORMALIZE_WHITESPACES_REGEXP:()=>u,NUMERICAL_KEYS:()=>m,SMART_QUOTES:()=>c,SPACE:()=>a,SPECIAL_REGEX_CHARS:()=>b,UI_LANGUAGES:()=>r,VISIBLE_WHITE_SPACE_REGEXP:()=>i,WHITESPACE_WITHOUT_NBSP_REGEXP:()=>h});const s="en",r=["de","en","es","fr","nl","pt-br"],i=/\u00A0|\u0020|\u2009|\u202F/,o=/^([\udc00-\udfff\ud800-\udb7f]|\u200d|\ufe0e|\ufe0f|\p{Emoji_Presentation}|\p{Emoji_Modifier_Base}|\p{Emoji_Modifier}|\p{Emoji})+$/u,a=String.fromCharCode(32),l=String.fromCharCode(160),c=["“","”","„","»","«"],d="\b\t          ‏ ",h=new RegExp("^["+d+"]$"),u=new RegExp("["+d+"]","g"),g='img, image, object, a, [style*="background-image:"]',m=["1","2","3","4","5","6","7","8","9"],p="tb-event.composition",_="tb-event.keyboard",E="tb-event.copy",f="tb-event.cut",T="tb-event.paste",C="tb-event.selection-change",v="tb-event.focusin",S="tb-event.focusout",b=/[\\^$.*+?()[\]{}|]/g,x="toolbox-text-generation",y="toolbox-text-generation-with-context",A="toolbox-alter-phrase",k="toolbox-alter-sentence",w="toolbox-alter-text",R="toolbox-refine-text",L="|a7s|",M="|i5d|",I="|err|",P=1e4,N=["^","`","¨","¯","´","¸","˂","˃","˄","˅","ˆ","˒","˓","˔","˕","˖","˗","˘","˙","˚","˛","˜","˝","˞","˟","˥","˦","˧","˨","˩","˪","˫","˭","˯","˰","˱","˲","˳","˴","˵","˶","˷","˸","˹","˺","˻","˼","˽","˾","˿","͵","΄","΅","᾽","᾿","῀","῁","῍","῎","῏","῝","῞","῟","῭","΅","`","´","῾"]},
vendor: 1,137 bytes, lines 73-76
73"../../../node_modules/@advanced-toolbox/utils/dist/debounce.mjs":
74/*!***********************************************************************!*\
75  !*** ../../../node_modules/@advanced-toolbox/utils/dist/debounce.mjs ***!
76  \***********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Debounce:()=>s});class s{_wrappedFunc;_delay;_maxDelay;_args;_delayTimeoutId;_maxDelayTimeoutId;constructor(e,t=250,n=0){this._wrappedFunc=e,this._delay=t,this._maxDelay=n,this._args=null,this._delayTimeoutId=null,this._maxDelayTimeoutId=null}callImmediately=()=>{this._args&&this._wrappedFunc(...this._args),this.cancelCall()};call(...e){this.cancelCall(!0),this._args=e,this._delayTimeoutId=self.setTimeout(this.callImmediately,this._delay),this._maxDelay>0&&null===this._maxDelayTimeoutId&&(this._maxDelayTimeoutId=self.setTimeout(this.callImmediately,this._maxDelay))}cancelCall(e=!1){this._args=null,null!==this._delayTimeoutId&&(clearTimeout(this._delayTimeoutId),this._delayTimeoutId=null),e||null===this._maxDelayTimeoutId||(clearTimeout(this._maxDelayTimeoutId),this._maxDelayTimeoutId=null)}}},
vendor: 7,166 bytes, lines 76-79
76"../../../node_modules/@advanced-toolbox/utils/dist/events.mjs":
77/*!*********************************************************************!*\
78  !*** ../../../node_modules/@advanced-toolbox/utils/dist/events.mjs ***!
79  \*********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{bindCapturedEvent:()=>u,bindCompositionFlow:()=>g,createToolboxEventObject:()=>h,getEventTarget:()=>d,getMetaKey:()=>p,hasMetaKey:()=>_,isFunctionKey:()=>m,isHotKeyPress:()=>T,isProgrammaticBackwardDeletion:()=>C,isSelectAll:()=>E,shouldPreventKeyboardEventDefault:()=>v,shouldPreventKeyboardEventPropagation:()=>S,simulateDelete:()=>i,simulateMouseDown:()=>a,simulateMouseUp:()=>l,simulatePasteImage:()=>c,simulateUndo:()=>o});var s=n(/*! ./constants.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs"),r=n(/*! ./misc.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/misc.mjs");async function i(e){const t=e.ownerDocument.defaultView;let n;const s=function(e,t=self){const n=new t.KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,keyCode:8,which:8,location:0,key:"Backspace"});return e.dispatchEvent(n)}(e,t);if(s){const s=new t.InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteContentBackward"});let r=!0;n="deleteContentBackward"===s.inputType,n&&(r=e.dispatchEvent(s)),r&&e.ownerDocument.execCommand("delete",!1)}await(0,r.rAF)(),function(e,t=self){const n=new t.KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,keyCode:8,which:8,location:0,key:"Backspace"});e.dispatchEvent(n)}(e,t),await(0,r.rAF)()}async function o(e){const t=e.ownerDocument.defaultView,n=function(e,t=self){const n=new t.KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,keyCode:90,which:90,location:0,key:"z",metaKey:!0});return e.dispatchEvent(n)}(e,t);let s;if(n){const n=new t.InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"historyUndo"});let r=!0;s="historyUndo"===n.inputType,s&&(r=e.dispatchEvent(n)),r&&e.ownerDocument.execCommand("undo",!1)}await(0,r.rAF)(),function(e,t=self){const n=new t.KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,keyCode:90,which:90,location:0,key:"z",metaKey:!0});e.dispatchEvent(n)}(e,t),await(0,r.rAF)()}function a(e,t){const n=new e.ownerDocument.defaultView.MouseEvent("mousedown",{bubbles:!0,cancelable:!1,clientX:t.x,clientY:t.y+t.height/2});return e.dispatchEvent(n)}function l(e,t){const n=new e.ownerDocument.defaultView.MouseEvent("mouseup",{bubbles:!0,cancelable:!1,clientX:t.x+t.width,clientY:t.y+t.height/2});return e.dispatchEvent(n)}async function c(e,t){const n=e.ownerDocument.defaultView,i=t["text/plain"],o=()=>(0,r.xpathSelectorAll)(`//*[contains(text(), "${i}")]`,e.ownerDocument,e).concat([...e.querySelectorAll(s.IMAGE_LIKE_ELEMENT_SELECTOR),...e.ownerDocument.images]),a=o(),l=i.split("/").pop(),[c]=Object.entries(t).filter((([e])=>e.startsWith("image/"))).slice(0,1).map((([e,t])=>{if((0,r.isString)(t)){const s=t.split(";base64,").pop();if((0,r.isUndefined)(s))throw new Error(`[toolbox] Failed to base64-decode string "${s}".`);const i=n.Uint8Array.from(atob(s),(e=>{const t=e.codePointAt(0);if(!(0,r.isNumber)(t))throw new Error("[Toolbox] Retrieved invalid bit while converting image string into binary data.");return t}));t=new n.Blob([i],{type:e})}return[e,t]})).map((([e,t])=>new n.File([t],l,{type:e})));if(!c)throw new Error(`Did not find an "image/*" entry in the data for file ${l}`);const d=new n.DataTransfer;if(d.setData("text/html",`<meta charset='utf-8'>${t["text/html"]}`),d.items.add(c),e.dispatchEvent(new n.ClipboardEvent("paste",{clipboardData:d,cancelable:!1,bubbles:!0,composed:!0}))){const t=new n.InputEvent("beforeinput",{dataTransfer:d,data:null,inputType:"insertFromPaste",cancelable:!1,composed:!0,bubbles:!0});"insertFromPaste"===t.inputType&&e.dispatchEvent(t)}await(0,r.wait)(500);const h=self!==e.ownerDocument.defaultView,u=location.href.includes("docs.google.com/document/d/")&&h,g=location.href.includes("docs.google.com/presentation/d/")&&h;if(u||g)return!0;const m=o();return!!m.length&&m.some((e=>!a.includes(e)))}function d(e){const[t=e.target]=e.composedPath?.()||[];return t}function h(e,t){return Object.defineProperties(Object.create(null),{type:{value:e.type,configurable:!1,writable:!1},target:{value:t,configurable:!1,writable:!1},originalEvent:{value:event,configurable:!1,writable:!1},preventDefault:{value:()=>e.preventDefault(),configurable:!1,writable:!1},stopPropagation:{value:()=>e.stopPropagation(),configurable:!1,writable:!1},stopImmediatePropagation:{value:()=>e.stopImmediatePropagation(),configurable:!1,writable:!1}})}function u(e,t,n){const s=(0,r.isDocumentNode)(e)?e:e.ownerDocument,i=t=>{const s=d(t);if(s&&((0,r.isElementNode)(s)||(0,r.isTextNode)(s))&&(0,r.elementContains)(e,s)){const e=h(t,s);n(e)}};return s.defaultView.addEventListener(t,i,!0),()=>s.defaultView.removeEventListener(t,i,!0)}const g=(e,t,n=!1)=>{let s="",i="";const a=()=>{};let l=a;const c=(0,r.getEditContext)(e),d=e=>{e.stopImmediatePropagation(),(0,r.matchesDiacriticalSymbol)(e.data)&&(s=e.data,i="",t(s,i))},h=r=>{r.stopImmediatePropagation(),s="",i=r.data,t(s,i),n||(o(e),l()),c?c.removeEventListener("compositionend",h,!0):(e.removeEventListener("compositionupdate",d,!0),e.removeEventListener("compositionend",h,!0))},u=n=>{n.stopImmediatePropagation(),c?(s=n.data,i="",t(s,i),c.addEventListener("compositionend",h,!0)):(l=(()=>{switch(!0){case"TEXTAREA"===e.nodeName:{const t=e,{selectionStart:n,selectionEnd:s,selectionDirection:r}=t;return()=>{try{t.setSelectionRange(n,s,r)}catch{}}}case"contentEditable"in e&&"true"===e.contentEditable:{const t=e.ownerDocument,n=t.defaultView.getSelection();if(!n||n.anchorOffset===n.focusOffset)return a;const{startOffset:s,endOffset:r,startContainer:i,endContainer:o,commonAncestorContainer:l}=n.getRangeAt(0).cloneRange();return()=>{try{const e=t.createRange();e.selectNodeContents(l),e.setStart(i,s),e.setEnd(o,r),n.removeAllRanges(),n.addRange(e)}catch{}}}default:return a}})(),e.addEventListener("compositionupdate",d,!0),e.addEventListener("compositionend",h,!0))};return c?c.addEventListener("compositionstart",u,!0):e.addEventListener("compositionstart",u,!0),()=>{c?c.removeEventListener("compositionstart",u,!0):e.removeEventListener("compositionstart",u,!0)}},m=e=>Boolean(e.match(/^F\d{1,2}$/)),p=e=>{const{isMacOS:t,isSafari:n}=(0,r.assessOperatingSystem)(self.navigator.userAgent);return n&&s.NUMERICAL_KEYS.includes(e)?"ctrlKey":t?"metaKey":"ctrlKey"},_=e=>e[p(e.key)],E=e=>_(e)&&!e.shiftKey&&"a"===e.key,f=e=>_(e)&&!e.shiftKey&&"z"===e.key,T=e=>_(e)&&!e.shiftKey&&s.NUMERICAL_KEYS.includes(e.key),C=e=>"Backspace"===e.key&&!e.isTrusted,v=(e,t)=>{const{hasFocus:n,isKbdNavigationEnabled:s}=t;switch(!0){case E(e)&&n:case T(e):case"Tab"===e.key&&!_(e)&&n:case"Enter"===e.key&&!_(e)&&!e.shiftKey:return!0;case e.key.startsWith("Arrow"):return n||s;case f(e):case _(e):case m(e.key):case C(e):return!1;case"Escape"===e.key&&!e.shiftKey:return!0;default:return n}},S=(e,t)=>{const{hasFocus:n,isKbdNavigationEnabled:s}=t;switch(!0){case f(e):return!1;case"Enter"===e.key:return!0;case e.key.startsWith("Arrow"):return n||s;default:return n}}},
vendor: 5,924 bytes, lines 79-82
79"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs":
80/*!********************************************************************!*\
81  !*** ../../../node_modules/@advanced-toolbox/utils/dist/index.mjs ***!
82  \********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{AI_ERROR_TYPE_AMBIGUOUS_PROMPT:()=>o.AI_ERROR_TYPE_AMBIGUOUS_PROMPT,AI_ERROR_TYPE_INVALID_PROMPT:()=>o.AI_ERROR_TYPE_INVALID_PROMPT,AI_ERROR_TYPE_SERVER_ERROR:()=>o.AI_ERROR_TYPE_SERVER_ERROR,AI_SUBJECT_MAX_LENGTH:()=>o.AI_SUBJECT_MAX_LENGTH,AI_TYPE_ALTER_PHRASE:()=>o.AI_TYPE_ALTER_PHRASE,AI_TYPE_ALTER_SENTENCE:()=>o.AI_TYPE_ALTER_SENTENCE,AI_TYPE_ALTER_TEXT:()=>o.AI_TYPE_ALTER_TEXT,AI_TYPE_REFINE_TEXT:()=>o.AI_TYPE_REFINE_TEXT,AI_TYPE_TEXT_GENERATION:()=>o.AI_TYPE_TEXT_GENERATION,AI_TYPE_TEXT_GENERATION_WITH_CONTEXT:()=>o.AI_TYPE_TEXT_GENERATION_WITH_CONTEXT,DEFAULT_UI_LANGUAGE:()=>o.DEFAULT_UI_LANGUAGE,Debounce:()=>s.Debounce,EVENT_TYPE_COMPOSITION:()=>o.EVENT_TYPE_COMPOSITION,EVENT_TYPE_COPY:()=>o.EVENT_TYPE_COPY,EVENT_TYPE_CUT:()=>o.EVENT_TYPE_CUT,EVENT_TYPE_FOCUSIN:()=>o.EVENT_TYPE_FOCUSIN,EVENT_TYPE_FOCUSOUT:()=>o.EVENT_TYPE_FOCUSOUT,EVENT_TYPE_KEYBOARD:()=>o.EVENT_TYPE_KEYBOARD,EVENT_TYPE_PASTE:()=>o.EVENT_TYPE_PASTE,EVENT_TYPE_SELECTION_CHANGE:()=>o.EVENT_TYPE_SELECTION_CHANGE,MessageConnector:()=>i.MessageConnector,MessageConnectorAbortError:()=>i.MessageConnectorAbortError,NUMERICAL_KEYS:()=>o.NUMERICAL_KEYS,UI_LANGUAGES:()=>o.UI_LANGUAGES,assertNever:()=>l.assertNever,assertUiLanguage:()=>h.assertUiLanguage,assessOperatingSystem:()=>l.assessOperatingSystem,bindCapturedEvent:()=>c.bindCapturedEvent,bindCompositionFlow:()=>c.bindCompositionFlow,blobbifyString:()=>l.blobbifyString,classes:()=>l.classes,containsEmojisOnly:()=>l.containsEmojisOnly,containsNumber:()=>l.containsNumber,createToolboxEventObject:()=>c.createToolboxEventObject,elementContains:()=>l.elementContains,escapeForRegEx:()=>l.escapeForRegEx,findBoundingSentenceIndices:()=>l.findBoundingSentenceIndices,getEditContext:()=>l.getEditContext,getEventTarget:()=>c.getEventTarget,getLanguageCode:()=>h.getLanguageCode,getMetaKey:()=>c.getMetaKey,getPageContext:()=>u.getPageContext,getSelectionInfoFromContext:()=>l.getSelectionInfoFromContext,getSelectionSegmentsFromContext:()=>l.getSelectionSegmentsFromContext,getSubjectFromContext:()=>l.getSubjectFromContext,hasMetaKey:()=>c.hasMetaKey,indexOfZWC:()=>a.indexOfZWC,insertTextIntoContentEditable:()=>l.insertTextIntoContentEditable,isArticleJS:()=>d.isArticleJS,isBoolean:()=>l.isBoolean,isCodeMirror:()=>d.isCodeMirror,isContentEditable:()=>d.isContentEditable,isDocumentNode:()=>l.isDocumentNode,isDraftJS:()=>d.isDraftJS,isElementNode:()=>l.isElementNode,isError:()=>l.isError,isFunction:()=>l.isFunction,isFunctionKey:()=>c.isFunctionKey,isGoogleDocsCanvas:()=>d.isGoogleDocsCanvas,isGutenberg:()=>d.isGutenberg,isHorde:()=>d.isHorde,isHotKeyPress:()=>c.isHotKeyPress,isHtmlElement:()=>l.isHtmlElement,isLTEditor:()=>d.isLTEditor,isMedium:()=>d.isMedium,isNotion:()=>d.isNotion,isNumber:()=>l.isNumber,isNumeric:()=>l.isNumeric,isObject:()=>l.isObject,isOdooEditor:()=>d.isOdooEditor,isOpenXchangeEditor:()=>d.isOpenXchangeEditor,isProgrammaticBackwardDeletion:()=>c.isProgrammaticBackwardDeletion,isPromise:()=>l.isPromise,isSelectAll:()=>c.isSelectAll,isSlateEditor:()=>d.isSlateEditor,isString:()=>l.isString,isTextNode:()=>l.isTextNode,isThunderbird:()=>d.isThunderbird,isTinyMCE:()=>d.isTinyMCE,isToolboxTextSelectionType:()=>l.isToolboxTextSelectionType,isTrixEditor:()=>d.isTrixEditor,isUiLanguage:()=>h.isUiLanguage,isUndefined:()=>l.isUndefined,isUrl:()=>l.isUrl,isWhiteSpace:()=>l.isWhiteSpace,isWikpedia:()=>d.isWikpedia,isWriterDuet:()=>d.isWriterDuet,isZWC:()=>a.isZWC,matchesDiacriticalSymbol:()=>l.matchesDiacriticalSymbol,namespaceStorage:()=>l.namespaceStorage,normalizeWhiteSpaces:()=>l.normalizeWhiteSpaces,optionallySurroundWithWhiteSpace:()=>l.optionallySurroundWithWhiteSpace,rAF:()=>l.rAF,removeAsteriskPairs:()=>l.removeAsteriskPairs,removeZWC:()=>a.removeZWC,safeToString:()=>l.safeToString,sanitizeLocale:()=>h.sanitizeLocale,selectText:()=>l.selectText,shouldPreventKeyboardEventDefault:()=>c.shouldPreventKeyboardEventDefault,shouldPreventKeyboardEventPropagation:()=>c.shouldPreventKeyboardEventPropagation,simulateDelete:()=>c.simulateDelete,simulateMouseDown:()=>c.simulateMouseDown,simulateMouseUp:()=>c.simulateMouseUp,simulatePasteImage:()=>c.simulatePasteImage,simulateUndo:()=>c.simulateUndo,sliceWithEllipsis:()=>l.sliceWithEllipsis,splitGraphemes:()=>l.splitGraphemes,stringifyBlob:()=>l.stringifyBlob,stripHtml:()=>l.stripHtml,useAsynchronousImage:()=>r.useAsynchronousImage,useCaptureEnterWithMeta:()=>r.useCaptureEnterWithMeta,useColorScheme:()=>r.useColorScheme,useDebounce:()=>r.useDebounce,useImageUriCSPState:()=>r.useImageUriCSPState,usePrevious:()=>r.usePrevious,verifyUiLanguage:()=>h.verifyUiLanguage,wait:()=>l.wait,xpathSelectorAll:()=>l.xpathSelectorAll});var s=n(/*! ./debounce.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/debounce.mjs"),r=n(/*! ./react-hooks.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/react-hooks.mjs"),i=n(/*! ./message-connector.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/message-connector.mjs"),o=n(/*! ./constants.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs"),a=n(/*! ./zwc.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/zwc.mjs"),l=n(/*! ./misc.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/misc.mjs"),c=n(/*! ./events.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/events.mjs"),d=n(/*! ./is-editor.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/is-editor.mjs"),h=n(/*! ./language.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/language.mjs"),u=n(/*! ./page-context.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/page-context.mjs")},
vendor: 2,579 bytes, lines 82-85
82"../../../node_modules/@advanced-toolbox/utils/dist/is-editor.mjs":
83/*!************************************************************************!*\
84  !*** ../../../node_modules/@advanced-toolbox/utils/dist/is-editor.mjs ***!
85  \************************************************************************/(e,t,n)=>{"use strict";function s(e){return Boolean(e.closest(".DraftEditor-editorContainer"))||/(facebook|messenger)\.com/.test(location.host)&&(e.hasAttribute("aria-describedBy")||["textfield","textbox"].includes(e.getAttribute("role")||""))&&e.hasAttribute("contenteditable")||!!e.querySelector("div[data-contents=true]")&&e.classList.contains("notranslate")}function r(e){return e.classList.contains("mce-content-body")||e.classList.contains("mceContentBody")}function i(e){try{const t=e.ownerDocument.defaultView.frameElement;return!!t&&t.classList.contains("arx-editor-frame")}catch(e){return!1}}function o(e){return!!e.closest("div.CodeMirror")||e.classList.contains("cm-content")}function a(e){return e.hasAttribute("data-slate-editor")}function l(e){return e.classList.contains("odoo-editor-editable")}function c(e){return location.href.includes("writerduet.com")}function d(e){return!!e.closest("[data-app-name='io.ox/office/text']")}function h(e){return e.classList.contains("editor-rich-text__editable")||e.classList.contains("block-editor-writing-flow")||e.classList.contains("block-editor-rich-text__editable")}function u(e){return"trix-editor"===e.nodeName.toLowerCase()}function g(e){return e.classList.contains("lt-textarea__textarea")}function m(e){return e.classList.contains("kix-canvas-tile-content")}function p(e){return self!==self.parent&&e.ownerDocument&&e===e.ownerDocument.body&&e.ownerDocument.documentElement.isContentEditable&&e.classList.contains("cke_show_borders")}function _(e){return location.host.includes("medium.com")&&"true"===e.getAttribute("g_editable")}function E(e){return e.classList.contains("ve-ce-rootNode")}function f(e){return location.href.startsWith("about:blank?compose")&&"BODY"===e.tagName&&"on"===document.designMode}function T(e){return location.href.includes("notion.so")}n.r(t),n.d(t,{isArticleJS:()=>i,isCodeMirror:()=>o,isContentEditable:()=>C,isDraftJS:()=>s,isGoogleDocsCanvas:()=>m,isGutenberg:()=>h,isHorde:()=>p,isLTEditor:()=>g,isMedium:()=>_,isNotion:()=>T,isOdooEditor:()=>l,isOpenXchangeEditor:()=>d,isSlateEditor:()=>a,isThunderbird:()=>f,isTinyMCE:()=>r,isTrixEditor:()=>u,isWikpedia:()=>E,isWriterDuet:()=>c});const C=e=>e.hasAttribute("contenteditable")||"isContentEditable"in e&&!0===e.isContentEditable},
vendor: 882 bytes, lines 85-88
85"../../../node_modules/@advanced-toolbox/utils/dist/language.mjs":
86/*!***********************************************************************!*\
87  !*** ../../../node_modules/@advanced-toolbox/utils/dist/language.mjs ***!
88  \***********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{assertUiLanguage:()=>a,getLanguageCode:()=>i,isUiLanguage:()=>o,sanitizeLocale:()=>r,verifyUiLanguage:()=>l});var s=n(/*! ./constants.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs");const r=e=>e.replace("_","-").toLocaleLowerCase(),i=e=>r(e).split("-")[0],o=e=>s.UI_LANGUAGES.includes(String(e)),a=e=>{if(!o(e))throw new Error(`[toolbox] Value "${e}" is not a supported Toolbox UI language.`)},l=e=>{const t=String(e),n=r(t),[a]=i(t);switch(!0){case o(n):return n;case o(a):return a;default:return s.DEFAULT_UI_LANGUAGE}}},
vendor: 1,087 bytes, lines 88-91
88"../../../node_modules/@advanced-toolbox/utils/dist/message-connector.mjs":
89/*!********************************************************************************!*\
90  !*** ../../../node_modules/@advanced-toolbox/utils/dist/message-connector.mjs ***!
91  \********************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MessageConnector:()=>r,MessageConnectorAbortError:()=>s});class s extends Error{static name="MessageConnectorAbortError";constructor(){super("[toolbox] ping-pong aborted due to new incoming message."),this.name=s.name}}class r{sendMessage;fallback;timeout;resolver;abort;static create({sendMessage:e,fallback:t,timeout:n=1e3}){return new r(e,t,n)}constructor(e,t,n){this.sendMessage=e,this.fallback=t,this.timeout=n}send=e=>{this.abort?.();const t=new Promise((e=>{this.resolver=e})),n=new Promise((e=>setTimeout((()=>e(this.fallback)),this.timeout))),r=new Promise(((e,t)=>{this.abort=()=>t(new s)}));return this.sendMessage(e),Promise.race([t,n,r])};receive=e=>{this.resolver?.(e),this.resolver=this.abort=void 0}}},
vendor: 8,475 bytes, lines 91-94
91"../../../node_modules/@advanced-toolbox/utils/dist/misc.mjs":
92/*!*******************************************************************!*\
93  !*** ../../../node_modules/@advanced-toolbox/utils/dist/misc.mjs ***!
94  \*******************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{assertNever:()=>o,assessOperatingSystem:()=>I,blobbifyString:()=>L,classes:()=>w,containsEmojisOnly:()=>U,containsNumber:()=>F,elementContains:()=>H,escapeForRegEx:()=>y,findBoundingSentenceIndices:()=>D,getEditContext:()=>$,getSelectionInfoFromContext:()=>V,getSelectionSegmentsFromContext:()=>O,getSubjectFromContext:()=>N,insertTextIntoContentEditable:()=>P,isBoolean:()=>g,isDocumentNode:()=>_,isElementNode:()=>E,isError:()=>l,isFunction:()=>d,isHtmlElement:()=>f,isNumber:()=>u,isNumeric:()=>m,isObject:()=>a,isPromise:()=>p,isString:()=>h,isTextNode:()=>T,isToolboxTextSelectionType:()=>X,isUndefined:()=>c,isUrl:()=>v,isWhiteSpace:()=>C,matchesDiacriticalSymbol:()=>W,namespaceStorage:()=>q,normalizeWhiteSpaces:()=>S,optionallySurroundWithWhiteSpace:()=>B,rAF:()=>x,removeAsteriskPairs:()=>K,safeToString:()=>i,selectText:()=>k,sliceWithEllipsis:()=>z,splitGraphemes:()=>j,stringifyBlob:()=>R,stripHtml:()=>A,wait:()=>M,xpathSelectorAll:()=>b});var s=n(/*! ./constants.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/constants.mjs");const r=e=>Object.prototype.toString.call(e),i=e=>{try{return String(e)}catch{return r(e)}};function o(e,t="Unexpected value: "){throw new Error(t+e)}function a(e){return"object"==typeof e&&null!==e&&"[object Object]"===r(e)}function l(e){return"[object Error]"===r(e)}function c(e){return void 0===e}function d(e){return"function"==typeof e}function h(e){return"string"==typeof e}function u(e){return"number"==typeof e}function g(e){return"boolean"==typeof e}function m(e){const t=parseInt(e,10);let n=t;return e.includes(".")&&(n=Math.floor(parseFloat(e)),n=Number.isNaN(n)?t:n),Number.isInteger(t)&&t===n}function p(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"then"in e&&"function"==typeof e.then}function _(e){return"number"==typeof e.nodeType&&e.nodeType===e.DOCUMENT_NODE}function E(e){return"number"==typeof e.nodeType&&e.nodeType===e.ELEMENT_NODE}const f=(e,t)=>!!e&&(t?"nodeName"in e&&e.nodeName.toLowerCase()===t:"nodeType"in e&&e.nodeType===e.ELEMENT_NODE);function T(e){return"number"==typeof e.nodeType&&e.nodeType===e.TEXT_NODE}function C(e){return" "===e||" "===e||s.WHITESPACE_WITHOUT_NBSP_REGEXP.test(e)}const v=e=>new RegExp("^"+["^(https?:\\/\\/)?","((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|","((\\d{1,3}\\.){3}\\d{1,3})|","localhost|","\\[(::1|([a-f\\d]{1,4}:){7}[a-f\\d]{1,4})\\])","(\\:\\d+)?","(\\/[-a-z\\d%@_.~+&:]*)*","(\\?[;&a-z\\d%@_.,~+&:=-\\[\\]]*)?","(\\#[-a-z\\d_]*)?$"].join("")+"$","i").test(String(e));function S(e){return e.replace(s.NORMALIZE_WHITESPACES_REGEXP," ")}function b(e,t,n=t){const s=t.evaluate(e,n,null,XPathResult.UNORDERED_NODE_ITERATOR_TYPE,null),r=[];let i;for(;i=s.iterateNext();)r.push(i);return r}function x(){return new Promise((e=>requestAnimationFrame((()=>e()))))}function y(e){return e.match(s.SPECIAL_REGEX_CHARS)?e.replace(s.SPECIAL_REGEX_CHARS,"\\$&"):e}function A(e){return Object.assign(document.createElement("div"),{innerHTML:e}).textContent}function k(e,t=0,n){const s=e.nodeValue?.length??0;let r="number"==typeof n?n:s;t=Math.max(t,0),r=Math.min(r,s);const i=self.getSelection(),o=new Range;return o.setStart(e,t),o.setEnd(e,r),i?.removeAllRanges(),i?.addRange(o),o}function w(...e){return e.map((e=>h(e)?e.trim():e)).filter((e=>!0===Boolean(e)&&!0!==e)).filter(((e,t,n)=>n.indexOf(e)===t)).join(" ")}function R(e){return new Promise(((t,n)=>{const s=new FileReader;s.onloadend=()=>{h(s.result)?t(s.result):n(new Error("[Toolbox] Got invalid result from reading blob."))},s.onerror=()=>n(new Error("[Toolbox] Failed to read the blob.")),s.readAsDataURL(e)}))}function L(e,t){const n=atob(e),s=[];for(let e=0;e<n.length;e+=512){const t=n.slice(e,e+512),r=new Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const i=new Uint8Array(r);s.push(i)}return new Blob(s,{type:t})}const M=(e=25)=>new Promise((t=>setTimeout((()=>t()),e))),I=e=>({isMacOS:e.includes("Mac OS"),isSafari:(e.includes("Safari/")||e.includes("AppleWebKit"))&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("Edg/")&&!e.includes("OPR/")});async function P(e,t,n,s=10){const r=e.ownerDocument.defaultView,i=[];t.split("\n").forEach(((e,t,n)=>{e&&i.push(e),t+1<n.length&&i.push("\n")}));for(let t=0;t<i.length;t++){const o=i[t],a="\n"===o,l=a?"insertLineBreak":"insertText",c={bubbles:!0,cancelable:!0,inputType:l,data:o};if(a){const t={bubbles:!0,cancelable:!0,code:"Enter",key:"Enter",charCode:0,detail:0,location:0,keyCode:13,which:13,shiftKey:!0};if(!e.dispatchEvent(new KeyboardEvent("keydown",t))){await M(10);continue}const n={...t,charCode:13,which:13};if(!e.dispatchEvent(new KeyboardEvent("keypress",n))){await M(10);continue}}if("StaticRange"in self&&"getTargetRanges"in InputEvent.prototype)try{if(!n||t>0){const e=r.getSelection();e&&e.rangeCount>0&&(c.targetRanges=[new StaticRange(e.getRangeAt(0))])}else c.targetRanges=[new StaticRange(n)]}catch(e){}const d=new InputEvent("beforeinput",c);let h=!0;const u=d.inputType===l,{isSafari:g}=I(r.navigator.userAgent),m=!g;u&&m&&(h=e.dispatchEvent(d));let p=!0;if("TextEvent"in self&&m){const t={bubbles:!0,cancelable:!0,inputType:l,data:o};try{const n=new self.InputEvent("textInput",t);p=e.dispatchEvent(n)}catch{}}h&&p&&e.ownerDocument.execCommand(l,!1,o),await M(s)}}function N(e,t){t??=(()=>{switch(!0){case Array.isArray(e.wordRange):return"word";case Array.isArray(e.phraseRange):return"phrase";case Array.isArray(e.sentenceRange):return"sentence";case Array.isArray(e.textRange):return"text";default:return}})();const n=(()=>{switch(!0){case"word"===t:return e.wordRange;case"phrase"===t:return e.phraseRange;case"sentence"===t:return e.sentenceRange;case"text"===t:return e.textRange;default:return}})(),s=e.text;if(!n)return{subject:"",range:[-1,-1],beforeText:s.slice(0,e.selection.start),afterText:s.slice(e.selection.end),type:t};const[r,i]=n.map((e=>Math.max(e,0)));return{beforeText:s.slice(0,r),afterText:s.slice(i),subject:s.slice(r,i),range:n,type:t}}const O=e=>{const{text:t,selection:n}=e;return{beforeText:t.slice(0,n.start),afterText:t.slice(n.end),selectedText:t.slice(n.start,n.end)}};function D([e,t],n){if(!n.length)return[-1,-1];let s=[...n].reverse().findIndex((([e])=>e<=t));if(s=-1===s?0:n.length-1-s,e===t)return[s,s];let r=n.findIndex((([,t])=>e<=t));return r=-1===r?n.length-1:r,[r,s]}function H(e,t){const n=t.getRootNode();return e.getRootNode()!==n?"host"in n&&H(e,n.host):e.contains(t)}function U(e){return!!e.match(s.EMOJIS_REGEXP)&&!e.match(/[0-9]/g)}function F(e){return!!e.match(/[0-9]/g)}function B(e,t,n=!1){const{left:r,right:i}=function(e,t=!1){const{text:n,selection:r,locale:i}=e,o=n.split(""),a={left:!1,right:!1};if(o.every((e=>e.match(/^[^\S]+$/))))return a;const l=Math.max(0,r.start),c=Math.min(o.length,r.end),d=o[l-1]||"",h=t&&U(d);a.left=!!d&&!d.match(s.VISIBLE_WHITE_SPACE_REGEXP)&&!h&&"\n"!==d;const u=new RegExp(`[.,${i?.startsWith("fr")?"":";:!?"}]`),g=o[c]||"",m=t&&U(g);return a.right=!(!g||g.match(s.VISIBLE_WHITE_SPACE_REGEXP)||m||g.match(u)||"\n"===g),a}(t,n);return[r?s.SPACE:"",e,i?s.SPACE:""].join("")}const G=Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):{segment:e=>[...e].map((e=>({segment:e}))),resolvedOptions:()=>({locale:"",granularity:"grapheme"})},j=e=>Array.from(G.segment(e),(e=>e.segment)),W=e=>{let t=parseInt("0300",16);const n=parseInt("036F",16);if(s.MODIFIER_LETTERS.includes(e))return!0;for(;t<n;t++){const n=[" ",String.fromCharCode(t)].join("");if(e.normalize("NFD")===n)return!0}return!1};function $(e){return"editContext"in e&&e.editContext&&"EditContext"===Object.getPrototypeOf(e.editContext).constructor.name?e.editContext:null}const z=(e,t)=>e.length>t?e.slice(0,t)+"…":e,V=e=>({start:e.selection.start,end:e.selection.end,value:e.selection.text}),K=e=>{const t=[...e];let n=-1;for(let s=0;s<e.length;s++){const r=e[s];"\n"===r&&n>-1?n=-1:"*"===r&&"*"===e[s+1]&&(-1===n?n=s:(t.splice(n,2,null,null),t.splice(s,2,null,null),n=-1))}return t.filter((e=>null!==e))},X=e=>!!h(e)&&["word","phrase","sentence","text"].includes(e),q=(e,t)=>{const n=t=>[e,t].join(".");return{delete:e=>t.delete(n(e)),read:e=>t.read(n(e)),write:(e,s)=>t.write(n(e),s)}}},
vendor: 758 bytes, lines 94-97
94"../../../node_modules/@advanced-toolbox/utils/dist/page-context.mjs":
95/*!***************************************************************************!*\
96  !*** ../../../node_modules/@advanced-toolbox/utils/dist/page-context.mjs ***!
97  \***************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{getPageContext:()=>s});const s=(e,t)=>{let n="",s=null;try{const{hostname:s}=new URL(e),r=(e=>(new DOMParser).parseFromString(e,"text/html"))(t);"mail.google.com"===s?n=(e=>{const t=e.querySelector('input[name="uet"]');return t?.value.trim()?(n=t.value,n.replace(/[\t\n]+/g," ")).trim():"";var n})(r):console.warn("[toolbox] Page source retrieval hasn't been set up for %s yet.",s)}catch(e){s=e}return[s,n]}},
vendor: 2,253 bytes, lines 97-100
97"../../../node_modules/@advanced-toolbox/utils/dist/react-hooks.mjs":
98/*!**************************************************************************!*\
99  !*** ../../../node_modules/@advanced-toolbox/utils/dist/react-hooks.mjs ***!
100  \**************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useAsynchronousImage:()=>d,useCaptureEnterWithMeta:()=>l,useColorScheme:()=>o,useDebounce:()=>c,useImageUriCSPState:()=>a,usePrevious:()=>h});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! ./misc.mjs */"../../../node_modules/@advanced-toolbox/utils/dist/misc.mjs");function o(e){const[t,n]=(0,s.useState)("light");return(0,s.useEffect)((()=>{const t=e.current?.closest("tb-toolbox"),s=String(t?.getAttribute("data-tb-color-scheme"));["light","dark"].includes(s)&&n(s)}),[e]),t}function a(e,t){const[n,r]=(0,s.useState)("pending");return(0,s.useEffect)((()=>{if(!e?.defaultView||!t)return;let n,s,o=!0;const a=new Promise((e=>{s=e})),l=e=>{e.blockedURI===t&&(s("blocked"),clearTimeout(n),n=void 0,o=!1)},c=new Promise((t=>{n=window.setTimeout((()=>{t("allowed"),e.removeEventListener("securitypolicyviolation",l,{capture:!0}),o=!1}),50)}));return e.addEventListener("securitypolicyviolation",l,{capture:!0,once:!0}),Promise.race([a,c]).then((e=>r(e))),Object.assign(new e.defaultView.Image,{src:t}),()=>{o&&e.removeEventListener("securitypolicyviolation",l,{capture:!0}),(0,i.isNumber)(n)&&clearTimeout(n)}}),[e,t]),n}const l=(e,t)=>{(0,s.useEffect)((()=>{const n=e=>{"Enter"===e.detail.key&&(0,r.hasMetaKey)(e.detail)&&t()};return e.addEventListener(r.EVENT_TYPE_KEYBOARD,n,!0),()=>{e.removeEventListener(r.EVENT_TYPE_KEYBOARD,n,!0)}}),[e,t])},c=(e,t)=>{const[n,r]=(0,s.useState)(e);return(0,s.useEffect)((()=>{const n=window.setTimeout((()=>r(e)),t);return()=>clearTimeout(n)}),[e,t]),n},d=e=>{const[t,n]=(0,s.useState)(""),r=(0,s.useRef)(!1);return(0,s.useEffect)((()=>{r.current||(r.current=!0,e().then((({default:e})=>n(e))).catch((e=>console.warn("[toolbox] Failed to load image.",e))).finally((()=>{r.current=!1})))}),[e]),t},h=e=>{const t=(0,s.useRef)();return(0,s.useEffect)((()=>{t.current=e}),[e]),t.current}},
vendor: 585 bytes, lines 100-103
100"../../../node_modules/@advanced-toolbox/utils/dist/zwc.mjs":
101/*!******************************************************************!*\
102  !*** ../../../node_modules/@advanced-toolbox/utils/dist/zwc.mjs ***!
103  \******************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{indexOfZWC:()=>l,isZWC:()=>a,removeZWC:()=>c});const s="​‌‍­⁠‪‫‬‭",r=new RegExp("^["+s+"]$"),i=new RegExp("["+s+"]"),o=new RegExp("["+s+"]","g"),a=e=>r.test(e),l=e=>{const t=e.match(i);return t&&Number.isInteger(t.index)?t.index:-1},c=e=>e.replace(o,"")},
vendor: 23,463 bytes, lines 103-106
103"../../../node_modules/diff/lib/index.mjs":
104/*!************************************************!*\
105  !*** ../../../node_modules/diff/lib/index.mjs ***!
106  \************************************************/(e,t,n)=>{"use strict";function s(){}function r(e,t,n,s,r){for(var i,o=[];t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();for(var a=0,l=o.length,c=0,d=0;a<l;a++){var h=o[a];if(h.removed)h.value=e.join(s.slice(d,d+h.count)),d+=h.count;else{if(!h.added&&r){var u=n.slice(c,c+h.count);u=u.map((function(e,t){var n=s[d+t];return n.length>e.length?n:e})),h.value=e.join(u)}else h.value=e.join(n.slice(c,c+h.count));c+=h.count,h.added||(d+=h.count)}}return o}n.r(t),n.d(t,{Diff:()=>s,applyPatch:()=>W,applyPatches:()=>$,canonicalize:()=>D,convertChangesToDMP:()=>me,convertChangesToXML:()=>pe,createPatch:()=>X,createTwoFilesPatch:()=>K,diffArrays:()=>U,diffChars:()=>o,diffCss:()=>k,diffJson:()=>O,diffLines:()=>S,diffSentences:()=>y,diffTrimmedLines:()=>b,diffWords:()=>E,diffWordsWithSpace:()=>C,formatPatch:()=>V,merge:()=>Z,parsePatch:()=>G,reversePatch:()=>ge,structuredPatch:()=>z}),s.prototype={diff:function(e,t){var n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=s.callback;"function"==typeof s&&(i=s,s={});var o=this;function a(e){return e=o.postProcess(e,s),i?(setTimeout((function(){i(e)}),0),!0):e}e=this.castInput(e,s),t=this.castInput(t,s),e=this.removeEmpty(this.tokenize(e,s));var l=(t=this.removeEmpty(this.tokenize(t,s))).length,c=e.length,d=1,h=l+c;null!=s.maxEditLength&&(h=Math.min(h,s.maxEditLength));var u=null!==(n=s.timeout)&&void 0!==n?n:1/0,g=Date.now()+u,m=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(m[0],t,e,0,s);if(m[0].oldPos+1>=c&&p+1>=l)return a(r(o,m[0].lastComponent,t,e,o.useLongestToken));var _=-1/0,E=1/0;function f(){for(var n=Math.max(_,-d);n<=Math.min(E,d);n+=2){var i=void 0,h=m[n-1],u=m[n+1];h&&(m[n-1]=void 0);var g=!1;if(u){var f=u.oldPos-n;g=u&&0<=f&&f<l}var T=h&&h.oldPos+1<c;if(g||T){if(i=!T||g&&h.oldPos<u.oldPos?o.addToPath(u,!0,!1,0,s):o.addToPath(h,!1,!0,1,s),p=o.extractCommon(i,t,e,n,s),i.oldPos+1>=c&&p+1>=l)return a(r(o,i.lastComponent,t,e,o.useLongestToken));m[n]=i,i.oldPos+1>=c&&(E=Math.min(E,n-1)),p+1>=l&&(_=Math.max(_,n+1))}else m[n]=void 0}d++}if(i)!function e(){setTimeout((function(){if(d>h||Date.now()>g)return i();f()||e()}),0)}();else for(;d<=h&&Date.now()<=g;){var T=f();if(T)return T}},addToPath:function(e,t,n,s,r){var i=e.lastComponent;return i&&!r.oneChangePerToken&&i.added===t&&i.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,s,r){for(var i=t.length,o=n.length,a=e.oldPos,l=a-s,c=0;l+1<i&&a+1<o&&this.equals(n[a+1],t[l+1],r);)l++,a++,c++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!r.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,l},equals:function(e,t,n){return n.comparator?n.comparator(e,t):e===t||n.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join("")},postProcess:function(e){return e}};var i=new s;function o(e,t,n){return i.diff(e,t,n)}function a(e,t){var n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function l(e,t){var n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function c(e,t,n){if(e.slice(0,t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(t),"; this is a bug"));return n+e.slice(t.length)}function d(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(t),"; this is a bug"));return e.slice(0,-t.length)+n}function h(e,t){return c(e,t,"")}function u(e,t){return d(e,t,"")}function g(e,t){return t.slice(0,function(e,t){var n=0;e.length>t.length&&(n=e.length-t.length);var s=t.length;e.length<t.length&&(s=e.length);var r=Array(s),i=0;r[0]=0;for(var o=1;o<s;o++){for(t[o]==t[i]?r[o]=r[i]:r[o]=i;i>0&&t[o]!=t[i];)i=r[i];t[o]==t[i]&&i++}i=0;for(var a=n;a<e.length;a++){for(;i>0&&e[a]!=t[i];)i=r[i];e[a]==t[i]&&i++}return i}(e,t))}var m="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",p=new RegExp("[".concat(m,"]+|\\s+|[^").concat(m,"]"),"ug"),_=new s;function E(e,t,n){return null==(null==n?void 0:n.ignoreWhitespace)||n.ignoreWhitespace?_.diff(e,t,n):C(e,t,n)}function f(e,t,n,s){if(t&&n){var r=t.value.match(/^\s*/)[0],i=t.value.match(/\s*$/)[0],o=n.value.match(/^\s*/)[0],m=n.value.match(/\s*$/)[0];if(e){var p=a(r,o);e.value=d(e.value,o,p),t.value=h(t.value,p),n.value=h(n.value,p)}if(s){var _=l(i,m);s.value=c(s.value,m,_),t.value=u(t.value,_),n.value=u(n.value,_)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),s&&(s.value=s.value.replace(/^\s*/,""));else if(e&&s){var E=s.value.match(/^\s*/)[0],f=t.value.match(/^\s*/)[0],T=t.value.match(/\s*$/)[0],C=a(E,f);t.value=h(t.value,C);var v=l(h(E,C),T);t.value=u(t.value,v),s.value=c(s.value,E,v),e.value=d(e.value,E,E.slice(0,E.length-v.length))}else if(s){var S=s.value.match(/^\s*/)[0],b=g(t.value.match(/\s*$/)[0],S);t.value=u(t.value,b)}else if(e){var x=g(e.value.match(/\s*$/)[0],t.value.match(/^\s*/)[0]);t.value=h(t.value,x)}}_.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},_.tokenize=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n.intlSegmenter){if("word"!=n.intlSegmenter.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');t=Array.from(n.intlSegmenter.segment(e),(function(e){return e.segment}))}else t=e.match(p)||[];var s=[],r=null;return t.forEach((function(e){/\s/.test(e)?null==r?s.push(e):s.push(s.pop()+e):/\s/.test(r)?s[s.length-1]==r?s.push(s.pop()+e):s.push(r+e):s.push(e),r=e})),s},_.join=function(e){return e.map((function(e,t){return 0==t?e:e.replace(/^\s+/,"")})).join("")},_.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,s=null,r=null;return e.forEach((function(e){e.added?s=e:e.removed?r=e:((s||r)&&f(n,r,s,e),n=e,s=null,r=null)})),(s||r)&&f(n,r,s,null),e};var T=new s;function C(e,t,n){return T.diff(e,t,n)}T.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(m,"]+|[^\\S\\n\\r]+|[^").concat(m,"]"),"ug");return e.match(t)||[]};var v=new s;function S(e,t,n){return v.diff(e,t,n)}function b(e,t,n){var s=function(e,t){if("function"==typeof e)t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(n,{ignoreWhitespace:!0});return v.diff(e,t,s)}v.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var n=[],s=e.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(var r=0;r<s.length;r++){var i=s[r];r%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n},v.equals=function(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),s.prototype.equals.call(this,e,t,n)};var x=new s;function y(e,t,n){return x.diff(e,t,n)}x.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var A=new s;function k(e,t,n){return A.diff(e,t,n)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){var s,r,i;s=e,r=t,i=n[t],(r=L(r))in s?Object.defineProperty(s,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[r]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function I(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}A.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var N=new s;function O(e,t,n){return N.diff(e,t,n)}function D(e,t,n,s,r){var i,o;for(t=t||[],n=n||[],s&&(e=s(r,e)),i=0;i<t.length;i+=1)if(t[i]===e)return n[i];if("[object Array]"===Object.prototype.toString.call(e)){for(t.push(e),o=new Array(e.length),n.push(o),i=0;i<e.length;i+=1)o[i]=D(e[i],t,n,s,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"===M(e)&&null!==e){t.push(e),o={},n.push(o);var a,l=[];for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&l.push(a);for(l.sort(),i=0;i<l.length;i+=1)o[a=l[i]]=D(e[a],t,n,s,a);t.pop(),n.pop()}else o=e;return o}N.useLongestToken=!0,N.tokenize=v.tokenize,N.castInput=function(e,t){var n=t.undefinedReplacement,s=t.stringifyReplacer,r=void 0===s?function(e,t){return void 0===t?n:t}:s;return"string"==typeof e?e:JSON.stringify(D(e,null,null,r),r,"  ")},N.equals=function(e,t,n){return s.prototype.equals.call(N,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)};var H=new s;function U(e,t,n){return H.diff(e,t,n)}function F(e){return Array.isArray(e)?e.map(F):R(R({},e),{},{hunks:e.hunks.map((function(e){return R(R({},e),{},{lines:e.lines.map((function(t,n){var s;return t.startsWith("\\")||t.endsWith("\r")||null!==(s=e.lines[n+1])&&void 0!==s&&s.startsWith("\\")?t:t+"\r"}))})}))})}function B(e){return Array.isArray(e)?e.map(B):R(R({},e),{},{hunks:e.hunks.map((function(e){return R(R({},e),{},{lines:e.lines.map((function(e){return e.endsWith("\r")?e.substring(0,e.length-1):e}))})}))})}function G(e){var t=e.split(/\n/),n=[],s=0;function r(){var e={};for(n.push(e);s<t.length;){var r=t[s];if(/^(\-\-\-|\+\+\+|@@)\s/.test(r))break;var a=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(r);a&&(e.index=a[1]),s++}for(i(e),i(e),e.hunks=[];s<t.length;){var l=t[s];if(/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(l))break;if(/^@@/.test(l))e.hunks.push(o());else{if(l)throw new Error("Unknown line "+(s+1)+" "+JSON.stringify(l));s++}}}function i(e){var n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[s]);if(n){var r="---"===n[1]?"old":"new",i=n[2].split("\t",2),o=i[0].replace(/\\\\/g,"\\");/^".*"$/.test(o)&&(o=o.substr(1,o.length-2)),e[r+"FileName"]=o,e[r+"Header"]=(i[1]||"").trim(),s++}}function o(){var e=s,n=t[s++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),r={oldStart:+n[1],oldLines:void 0===n[2]?1:+n[2],newStart:+n[3],newLines:void 0===n[4]?1:+n[4],lines:[]};0===r.oldLines&&(r.oldStart+=1),0===r.newLines&&(r.newStart+=1);for(var i=0,o=0;s<t.length&&(o<r.oldLines||i<r.newLines||null!==(a=t[s])&&void 0!==a&&a.startsWith("\\"));s++){var a,l=0==t[s].length&&s!=t.length-1?" ":t[s][0];if("+"!==l&&"-"!==l&&" "!==l&&"\\"!==l)throw new Error("Hunk at line ".concat(e+1," contained invalid line ").concat(t[s]));r.lines.push(t[s]),"+"===l?i++:"-"===l?o++:" "===l&&(i++,o++)}if(i||1!==r.newLines||(r.newLines=0),o||1!==r.oldLines||(r.oldLines=0),i!==r.newLines)throw new Error("Added line count did not match for hunk at line "+(e+1));if(o!==r.oldLines)throw new Error("Removed line count did not match for hunk at line "+(e+1));return r}for(;s<t.length;)r();return n}function j(e,t,n){var s=!0,r=!1,i=!1,o=1;return function a(){if(s&&!i){if(r?o++:s=!1,e+o<=n)return e+o;i=!0}if(!r)return i||(s=!0),t<=e-o?e-o++:(r=!0,a())}}function W(e,t){var n,s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t&&(t=G(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}(r.autoConvertLineEndings||null==r.autoConvertLineEndings)&&(!(s=e).includes("\r\n")||s.startsWith("\n")||s.match(/[^\r]\n/)||(n=t,Array.isArray(n)||(n=[n]),n.some((function(e){return e.hunks.some((function(e){return e.lines.some((function(e){return!e.startsWith("\\")&&e.endsWith("\r")}))}))})))?function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some((function(e){return e.hunks.some((function(e){return e.lines.some((function(e){return e.endsWith("\r")}))}))}))&&e.every((function(e){return e.hunks.every((function(e){return e.lines.every((function(t,n){var s;return t.startsWith("\\")||t.endsWith("\r")||(null===(s=e.lines[n+1])||void 0===s?void 0:s.startsWith("\\"))}))}))}))}(t)&&(t=B(t)):t=F(t));var i=e.split("\n"),o=t.hunks,a=r.compareLine||function(e,t,n,s){return t===s},l=r.fuzzFactor||0,c=0;if(l<0||!Number.isInteger(l))throw new Error("fuzzFactor must be a non-negative integer");if(!o.length)return e;for(var d="",h=!1,u=!1,g=0;g<o[o.length-1].lines.length;g++){var m=o[o.length-1].lines[g];"\\"==m[0]&&("+"==d[0]?h=!0:"-"==d[0]&&(u=!0)),d=m}if(h){if(u){if(!l&&""==i[i.length-1])return!1}else if(""==i[i.length-1])i.pop();else if(!l)return!1}else if(u)if(""!=i[i.length-1])i.push("");else if(!l)return!1;function p(e,t,n){for(var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=0,d=!1;s<e.length;s++){var h=e[s],u=h.length>0?h[0]:" ",g=h.length>0?h.substr(1):h;if("-"===u){if(!a(t+1,i[t],u,g))return n&&null!=i[t]?(o[l]=i[t],p(e,t+1,n-1,s,!1,o,l+1)):null;t++,c=0}if("+"===u){if(!r)return null;o[l]=g,l++,c=0,d=!0}if(" "===u){if(c++,o[l]=i[t],!a(t+1,i[t],u,g))return d||!n?null:i[t]&&(p(e,t+1,n-1,s+1,!1,o,l+1)||p(e,t+1,n-1,s,!1,o,l+1))||p(e,t,n-1,s+1,!1,o,l);l++,r=!0,d=!1,t++}}return l-=c,t-=c,o.length=l,{patchedLines:o,oldLineLastI:t-1}}for(var _=[],E=0,f=0;f<o.length;f++){for(var T=o[f],C=void 0,v=i.length-T.oldLines+l,S=void 0,b=0;b<=l;b++){for(var x=j(S=T.oldStart+E-1,c,v);void 0!==S&&!(C=p(T.lines,S,b));S=x());if(C)break}if(!C)return!1;for(var y=c;y<S;y++)_.push(i[y]);for(var A=0;A<C.patchedLines.length;A++){var k=C.patchedLines[A];_.push(k)}c=C.oldLineLastI+1,E=S+1-T.oldStart}for(var w=c;w<i.length;w++)_.push(i[w]);return _.join("\n")}function $(e,t){"string"==typeof e&&(e=G(e));var n=0;!function s(){var r=e[n++];if(!r)return t.complete();t.loadFile(r,(function(e,n){if(e)return t.complete(e);var i=W(n,r,t);t.patched(r,i,(function(e){if(e)return t.complete(e);s()}))}))}()}function z(e,t,n,s,r,i,o){if(o||(o={}),"function"==typeof o&&(o={callback:o}),void 0===o.context&&(o.context=4),o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!o.callback)return l(S(n,s,o));var a=o.callback;function l(n){if(n){n.push({value:"",lines:[]});for(var s=[],a=0,l=0,c=[],d=1,h=1,u=function(){var e,t,r,i=n[g],u=i.lines||(e=i.value,t=e.endsWith("\n"),r=e.split("\n").map((function(e){return e+"\n"})),t?r.pop():r.push(r.pop().slice(0,-1)),r);if(i.lines=u,i.added||i.removed){var m;if(!a){var p=n[g-1];a=d,l=h,p&&(c=o.context>0?f(p.lines.slice(-o.context)):[],a-=c.length,l-=c.length)}(m=c).push.apply(m,I(u.map((function(e){return(i.added?"+":"-")+e})))),i.added?h+=u.length:d+=u.length}else{if(a)if(u.length<=2*o.context&&g<n.length-2){var _;(_=c).push.apply(_,I(f(u)))}else{var E,T=Math.min(u.length,o.context);(E=c).push.apply(E,I(f(u.slice(0,T))));var C={oldStart:a,oldLines:d-a+T,newStart:l,newLines:h-l+T,lines:c};s.push(C),a=0,l=0,c=[]}d+=u.length,h+=u.length}},g=0;g<n.length;g++)u();for(var m=0,p=s;m<p.length;m++)for(var _=p[m],E=0;E<_.lines.length;E++)_.lines[E].endsWith("\n")?_.lines[E]=_.lines[E].slice(0,-1):(_.lines.splice(E+1,0,"\\ No newline at end of file"),E++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:i,hunks:s}}function f(e){return e.map((function(e){return" "+e}))}}S(n,s,R(R({},o),{},{callback:function(e){var t=l(e);a(t)}}))}function V(e){if(Array.isArray(e))return e.map(V).join("\n");var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":"\t"+e.oldHeader)),t.push("+++ "+e.newFileName+(void 0===e.newHeader?"":"\t"+e.newHeader));for(var n=0;n<e.hunks.length;n++){var s=e.hunks[n];0===s.oldLines&&(s.oldStart-=1),0===s.newLines&&(s.newStart-=1),t.push("@@ -"+s.oldStart+","+s.oldLines+" +"+s.newStart+","+s.newLines+" @@"),t.push.apply(t,s.lines)}return t.join("\n")+"\n"}function K(e,t,n,s,r,i,o){var a;if("function"==typeof o&&(o={callback:o}),null===(a=o)||void 0===a||!a.callback){var l=z(e,t,n,s,r,i,o);if(!l)return;return V(l)}var c=o.callback;z(e,t,n,s,r,i,R(R({},o),{},{callback:function(e){e?c(V(e)):c()}}))}function X(e,t,n,s,r,i){return K(e,e,t,n,s,r,i)}function q(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Y(e){var t=ue(e.lines),n=t.oldLines,s=t.newLines;void 0!==n?e.oldLines=n:delete e.oldLines,void 0!==s?e.newLines=s:delete e.newLines}function Z(e,t,n){e=J(e,n),t=J(t,n);var s={};(e.index||t.index)&&(s.index=e.index||t.index),(e.newFileName||t.newFileName)&&(Q(e)?Q(t)?(s.oldFileName=ee(s,e.oldFileName,t.oldFileName),s.newFileName=ee(s,e.newFileName,t.newFileName),s.oldHeader=ee(s,e.oldHeader,t.oldHeader),s.newHeader=ee(s,e.newHeader,t.newHeader)):(s.oldFileName=e.oldFileName,s.newFileName=e.newFileName,s.oldHeader=e.oldHeader,s.newHeader=e.newHeader):(s.oldFileName=t.oldFileName||e.oldFileName,s.newFileName=t.newFileName||e.newFileName,s.oldHeader=t.oldHeader||e.oldHeader,s.newHeader=t.newHeader||e.newHeader)),s.hunks=[];for(var r=0,i=0,o=0,a=0;r<e.hunks.length||i<t.hunks.length;){var l=e.hunks[r]||{oldStart:1/0},c=t.hunks[i]||{oldStart:1/0};if(te(l,c))s.hunks.push(ne(l,o)),r++,a+=l.newLines-l.oldLines;else if(te(c,l))s.hunks.push(ne(c,a)),i++,o+=c.newLines-c.oldLines;else{var d={oldStart:Math.min(l.oldStart,c.oldStart),oldLines:0,newStart:Math.min(l.newStart+o,c.oldStart+a),newLines:0,lines:[]};se(d,l.oldStart,l.lines,c.oldStart,c.lines),i++,r++,s.hunks.push(d)}}return s}function J(e,t){if("string"==typeof e){if(/^@@/m.test(e)||/^Index:/m.test(e))return G(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return z(void 0,void 0,t,e)}return e}function Q(e){return e.newFileName&&e.newFileName!==e.oldFileName}function ee(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function te(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function ne(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function se(e,t,n,s,r){var i={offset:t,lines:n,index:0},o={offset:s,lines:r,index:0};for(ae(e,i,o),ae(e,o,i);i.index<i.lines.length&&o.index<o.lines.length;){var a=i.lines[i.index],l=o.lines[o.index];if("-"!==a[0]&&"+"!==a[0]||"-"!==l[0]&&"+"!==l[0])if("+"===a[0]&&" "===l[0]){var c;(c=e.lines).push.apply(c,I(ce(i)))}else if("+"===l[0]&&" "===a[0]){var d;(d=e.lines).push.apply(d,I(ce(o)))}else"-"===a[0]&&" "===l[0]?ie(e,i,o):"-"===l[0]&&" "===a[0]?ie(e,o,i,!0):a===l?(e.lines.push(a),i.index++,o.index++):oe(e,ce(i),ce(o));else re(e,i,o)}le(e,i),le(e,o),Y(e)}function re(e,t,n){var s,r,i=ce(t),o=ce(n);if(de(i)&&de(o)){var a,l;if(q(i,o)&&he(n,i,i.length-o.length))return void(a=e.lines).push.apply(a,I(i));if(q(o,i)&&he(t,o,o.length-i.length))return void(l=e.lines).push.apply(l,I(o))}else if(r=o,(s=i).length===r.length&&q(s,r)){var c;return void(c=e.lines).push.apply(c,I(i))}oe(e,i,o)}function ie(e,t,n,s){var r,i=ce(t),o=function(e,t){for(var n=[],s=[],r=0,i=!1,o=!1;r<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],l=t[r];if("+"===l[0])break;if(i=i||" "!==a[0],s.push(l),r++,"+"===a[0])for(o=!0;"+"===a[0];)n.push(a),a=e.lines[++e.index];l.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}if("+"===(t[r]||"")[0]&&i&&(o=!0),o)return n;for(;r<t.length;)s.push(t[r++]);return{merged:s,changes:n}}(n,i);o.merged?(r=e.lines).push.apply(r,I(o.merged)):oe(e,s?o:i,s?i:o)}function oe(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function ae(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var s=t.lines[t.index++];e.lines.push(s),t.offset++}}function le(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function ce(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var s=e.lines[e.index];if("-"===n&&"+"===s[0]&&(n="+"),n!==s[0])break;t.push(s),e.index++}return t}function de(e){return e.reduce((function(e,t){return e&&"-"===t[0]}),!0)}function he(e,t,n){for(var s=0;s<n;s++){var r=t[t.length-n+s].substr(1);if(e.lines[e.index+s]!==" "+r)return!1}return e.index+=n,!0}function ue(e){var t=0,n=0;return e.forEach((function(e){if("string"!=typeof e){var s=ue(e.mine),r=ue(e.theirs);void 0!==t&&(s.oldLines===r.oldLines?t+=s.oldLines:t=void 0),void 0!==n&&(s.newLines===r.newLines?n+=s.newLines:n=void 0)}else void 0===n||"+"!==e[0]&&" "!==e[0]||n++,void 0===t||"-"!==e[0]&&" "!==e[0]||t++})),{oldLines:t,newLines:n}}function ge(e){return Array.isArray(e)?e.map(ge).reverse():R(R({},e),{},{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map((function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map((function(e){return e.startsWith("-")?"+".concat(e.slice(1)):e.startsWith("+")?"-".concat(e.slice(1)):e}))}}))})}function me(e){for(var t,n,s=[],r=0;r<e.length;r++)n=(t=e[r]).added?1:t.removed?-1:0,s.push([n,t.value]);return s}function pe(e){for(var t=[],n=0;n<e.length;n++){var s=e[n];s.added?t.push("<ins>"):s.removed&&t.push("<del>"),t.push((r=s.value,r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"))),s.added?t.push("</ins>"):s.removed&&t.push("</del>")}var r;return t.join("")}H.tokenize=function(e){return e.slice()},H.join=H.removeEmpty=function(e){return e}},
vendor: 5,947 bytes, lines 106-117
106"../../../node_modules/lang.js/src/lang.js":
107/*!*************************************************!*\
108  !*** ../../../node_modules/lang.js/src/lang.js ***!
109  \*************************************************/function(e,t){var n,s,r;
110/*!
111 *  Lang.js for Laravel localization in JavaScript.
112 *
113 *  @version 1.1.12
114 *  @license MIT https://github.com/rmariuzzo/Lang.js/blob/master/LICENSE
115 *  @site    https://github.com/rmariuzzo/Lang.js
116 *  @author  Rubens Mariuzzo <[email protected]>
117 */!function(){"use strict";s=[],void 0===(r="function"==typeof(n=function(){function e(){if("undefined"!=typeof document&&document.documentElement)return document.documentElement.lang}function t(e){return"-Inf"===e?-1/0:"+Inf"===e||"Inf"===e||"*"===e?1/0:parseInt(e,10)}var n=/^({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])$/,s=/({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])/,r={locale:"en"},i=function(t){t=t||{},this.locale=t.locale||e()||r.locale,this.fallback=t.fallback,this.messages=t.messages};return i.prototype.setMessages=function(e){this.messages=e},i.prototype.getLocale=function(){return this.locale||this.fallback},i.prototype.setLocale=function(e){this.locale=e},i.prototype.getFallback=function(){return this.fallback},i.prototype.setFallback=function(e){this.fallback=e},i.prototype.has=function(e,t){return!("string"!=typeof e||!this.messages)&&null!==this._getMessage(e,t)},i.prototype.get=function(e,t,n){if(!this.has(e,n))return e;var s=this._getMessage(e,n);return null===s?e:(t&&(s=this._applyReplacements(s,t)),s)},i.prototype.trans=function(e,t){return this.get(e,t)},i.prototype.choice=function(e,t,n,r){(n=void 0!==n?n:{}).count=t;var i=this.get(e,n,r);if(null==i)return i;for(var o=i.split("|"),a=[],l=0;l<o.length;l++)if(o[l]=o[l].trim(),s.test(o[l])){var c=o[l].split(/\s/);a.push(c.shift()),o[l]=c.join(" ")}if(1===o.length)return i;for(var d=0;d<a.length;d++)if(this._testInterval(t,a[d]))return o[d];return r=r||this._getLocale(e),o[this._getPluralForm(t,r)]},i.prototype.transChoice=function(e,t,n){return this.choice(e,t,n)},i.prototype._parseKey=function(e,t){if("string"!=typeof e||"string"!=typeof t)return null;var n=e.split("."),s=n[0].replace(/\//g,".");return{source:t+"."+s,sourceFallback:this.getFallback()+"."+s,entries:n.slice(1)}},i.prototype._getMessage=function(e,t){if(t=t||this.getLocale(),e=this._parseKey(e,t),void 0===this.messages[e.source]&&void 0===this.messages[e.sourceFallback])return null;var n=this.messages[e.source],s=e.entries.slice(),r=s.join(".");if("string"!=typeof(n=void 0!==n?this._getValueInKey(n,r):void 0)&&this.messages[e.sourceFallback])for(n=this.messages[e.sourceFallback],s=e.entries.slice(),r="";s.length&&void 0!==n;)n[r=r?r.concat(".",s.shift()):s.shift()]&&(n=n[r],r="");return"string"!=typeof n?null:n},i.prototype._getValueInKey=function(e,t){if("string"==typeof e[t])return e[t];for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),s=0,r=n.length;s<r;++s){var i=n.slice(0,s+1).join("."),o=n.slice(s+1,n.length).join(".");if(e[i])return this._getValueInKey(e[i],o)}return e},i.prototype._getLocale=function(e){return e=this._parseKey(e,this.locale),this.messages[e.source]?this.locale:this.messages[e.sourceFallback]?this.fallback:null},i.prototype._findMessageInTree=function(e,t){for(;e.length&&void 0!==t;){var n=e.join(".");if(t[n]){t=t[n];break}t=t[e.shift()]}return t},i.prototype._sortReplacementKeys=function(e,t){return t.length-e.length},i.prototype._applyReplacements=function(e,t){return Object.keys(t).sort(this._sortReplacementKeys).forEach((function(n){e=e.replace(new RegExp(":"+n,"gi"),(function(e){var s=t[n];return e===e.toUpperCase()?s.toUpperCase():e===e.replace(/\w/i,(function(e){return e.toUpperCase()}))?s.charAt(0).toUpperCase()+s.slice(1):s}))})),e},i.prototype._testInterval=function(e,s){if("string"!=typeof s)throw"Invalid interval: should be a string.";var r=(s=s.trim()).match(n);if(!r)throw"Invalid interval: "+s;if(!r[2]){var i=(r=r.filter((function(e){return!!e})))[1],o=t(r[2]);o===1/0&&(o=-1/0);var a=t(r[3]),l=r[4];return("["===i?e>=o:e>o)&&("]"===l?e<=a:e<a)}for(var c=r[2].split(","),d=0;d<c.length;d++)if(parseInt(c[d],10)===e)return!0;return!1},i.prototype._getPluralForm=function(e,t){switch(t){case"az":case"bo":case"dz":case"id":case"ja":case"jv":case"ka":case"km":case"kn":case"ko":case"ms":case"th":case"tr":case"vi":case"zh":default:return 0;case"af":case"bn":case"bg":case"ca":case"da":case"de":case"el":case"en":case"eo":case"es":case"et":case"eu":case"fa":case"fi":case"fo":case"fur":case"fy":case"gl":case"gu":case"ha":case"he":case"hu":case"is":case"it":case"ku":case"lb":case"ml":case"mn":case"mr":case"nah":case"nb":case"ne":case"nl":case"nn":case"no":case"om":case"or":case"pa":case"pap":case"ps":case"pt":case"so":case"sq":case"sv":case"sw":case"ta":case"te":case"tk":case"ur":case"zu":return 1==e?0:1;case"am":case"bh":case"fil":case"fr":case"gun":case"hi":case"hy":case"ln":case"mg":case"nso":case"xbr":case"ti":case"wa":return 0===e||1===e?0:1;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2;case"cs":case"sk":return 1==e?0:e>=2&&e<=4?1:2;case"ga":return 1==e?0:2==e?1:2;case"lt":return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2;case"sl":return e%100==1?0:e%100==2?1:e%100==3||e%100==4?2:3;case"mk":return e%10==1?0:1;case"mt":return 1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3;case"lv":return 0===e?0:e%10==1&&e%100!=11?1:2;case"pl":return 1==e?0:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?1:2;case"cy":return 1==e?0:2==e?1:8==e||11==e?2:3;case"ro":return 1==e?0:0===e||e%100>0&&e%100<20?1:2;case"ar":return 0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11&&e%100<=99?4:5}},i})?n.apply(t,s):n)||(e.exports=r)}()},
vendor: 2,177 bytes, lines 117-120
117"../../../node_modules/snarkdown/dist/snarkdown.es.js":
118/*!************************************************************!*\
119  !*** ../../../node_modules/snarkdown/dist/snarkdown.es.js ***!
120  \************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function r(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function i(e){return(e+"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function o(e,t){var n,a,l,c,d,h=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t|  {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|(  \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,u=[],g="",m=t||{},p=0;function _(e){var t=s[e[1]||""],n=u[u.length-1]==e;return t?t[1]?(n?u.pop():u.push(e),t[0|n]):t[0]:e}function E(){for(var e="";u.length;)e+=_(u[u.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return m[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");l=h.exec(e);)a=e.substring(p,l.index),p=h.lastIndex,n=l[0],a.match(/[^\\](\\\\)*\\$/)||((d=l[3]||l[4])?n='<pre class="code '+(l[4]?"poetry":l[2].toLowerCase())+'"><code'+(l[2]?' class="language-'+l[2].toLowerCase()+'"':"")+">"+r(i(d).replace(/^\n+|\n+$/g,""))+"</code></pre>":(d=l[6])?(d.match(/\./)&&(l[5]=l[5].replace(/^\d+/gm,"")),c=o(r(l[5].replace(/^\s*[>*+.-]/gm,""))),">"==d?d="blockquote":(d=d.match(/\./)?"ol":"ul",c=c.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+d+">"+c+"</"+d+">"):l[8]?n='<img src="'+i(l[8])+'" alt="'+i(l[7])+'">':l[10]?(g=g.replace("<a>",'<a href="'+i(l[11]||m[a.toLowerCase()])+'">'),n=E()+"</a>"):l[9]?n="<a>":l[12]||l[14]?n="<"+(d="h"+(l[14]?l[14].length:l[13]>"="?1:2))+">"+o(l[12]||l[15],m)+"</"+d+">":l[16]?n="<code>"+i(l[16])+"</code>":(l[17]||l[1])&&(n=_(l[17]||"--"))),g+=a,g+=n;return(g+e.substring(p)+E()).replace(/^\n+|\n+$/g,"")}},
120"./background/dictionarySync.ts":
121/*!**************************************!*\
122  !*** ./background/dictionarySync.ts ***!
123  \**************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{DictionarySync:()=>c});var s=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),r=n(/*! ../common/storageController */"./common/storageController.ts"),i=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),o=n(/*! ../common/utils */"./common/utils.ts"),a=n(/*! ../config/config */"./config/config.ts"),l=n(/*! ../core/utils */"./core/utils.ts");
124/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
125class c{static init(){this._isInitialized||(this._storageController=r.StorageControllerFactory.create(),this._startSync(),this._isInitialized=!0)}static _startSync(){this._storageController.onReady((()=>{if(!this._isSyncCapable())return;const{isDictionarySynced:e}=this._storageController.getSettings();e?this.downloadAll():this.checkForInitialSync()}))}static _isSyncCapable(){if(!this._storageController.isReady())return!1;if("extension"!==s.EnvironmentAdapter.getType())return!1;if(this._storageController.hasCustomServer())return!1;const{username:e,password:t,token:n}=this._storageController.getSettings();return e&&(t||n)}static disableSync(){return this._storageController.updateSettings({isDictionarySynced:!1})}static checkForInitialSync(){this._storageController.onReady((()=>{const{isDictionarySynced:e,dictionary:t}=this._storageController.getSettings();if(e)return;if(!this._isSyncCapable())return;i.TrackerAdapter.trackEvent("Action","dict_sync:started");const n=t.slice(0),s=t.length;this.addBatch(n).then((()=>this.downloadList())).then((e=>{const t=e.filter((e=>n.includes(e))).length,r=t/s;r<.9&&s-t>=10?i.TrackerAdapter.trackEvent("Action","dict_sync:failed_comparison",String(r)):this._storageController.updateSettings({isDictionarySynced:!0,dictionary:e}).then((()=>{i.TrackerAdapter.trackEvent("Action","dict_sync:succeeded")})).catch((()=>{i.TrackerAdapter.trackEvent("Action","dict_sync:failed_storage")}))})).catch((e=>{console.error(e),i.TrackerAdapter.trackEvent("Action","dict_sync:failed_sync",String(e))}))}))}static addBatch(e){if(this._syncing)return Promise.reject("already syncing");if(!this._isSyncCapable())return Promise.reject("not capable of syncing");if(e.length>this.MAX_WORDS)return i.TrackerAdapter.trackEvent("Action","too_many_words_for_dictionary_batch_add",String(e.length)),Promise.reject("too many words");this._syncing=!0;const t=this._chunkBatches(e);let n=0;return new Promise(((e,s)=>{const r=()=>{const i=t.shift();if(!i?.length&&!t.length)return this._syncing=!1,void e();const a=this._filterValidWords(i);a.length?this.addWord(a).then((()=>(0,o.wait)(1400))).then(r).catch((e=>++n>4?(this._syncing=!1,void s(e)):r())):r()};r()}))}static _filterValidWords(e){return(Array.isArray(e)?e:[e]).filter((e=>Boolean(e?.trim()&&!e.trim().match(/\s/)&&!e.match(this.EMOJI_REGEXP))))}static _chunkBatches(e){const t=[],n=e.slice(0,this.MAX_WORDS);let s;for(;(s=n.splice(0,this.BATCH_SIZE))&&s.length>0;)t.push(s);return t}static removeBatch(e){return this._deleting?Promise.reject():this._isSyncCapable()?(i.TrackerAdapter.trackEvent("Action","dict_batch_delete:started",String(e.length)),e=e.slice(0,this.MAX_WORDS),this._deleting=!0,new Promise(((t,n)=>{const s=()=>
125{if(void 0===e.shift()&&!e.length)return this._deleting=!1,i.TrackerAdapter.trackEvent("Action","dict_batch_delete:succeeded"),void t();const r=this._filterValidWords(e);r.length?this.removeWord(r).then((()=>(0,o.wait)(1500))).then(s).catch((e=>{this._deleting=!1,i.TrackerAdapter.trackEvent("Action","dict_batch_delete:failed",e&&e.message),n(e)})):s()};s()}))):Promise.reject()}static downloadAll(){this._deleting||this._storageController.onReady((()=>{if(!this._isSyncCapable())return;const{isDictionarySynced:e}=this._storageController.getSettings();e&&this.downloadList().then((e=>{this._storageController.updateSettings({dictionary:e})})).catch((()=>null))}))}static _getBaseUrl(){const e=new URL("/enterprise/v1/dictionary/words",a.PREMIUM_SERVER_URL);return e.searchParams.append("type","personal"),e}static _getHeaders(){const{username:e,token:t}=this._storageController.getSettings(),n=new Headers;if(!e||!t)return[n,new Error("User must be authenticated for interacting with the dictionary")];{const s=btoa(`${e}:${t}`);n.append("Authorization",`Basic ${s}`),n.append("Content-Type","application/json")}return[n,null]}static addWord(e,t=!1){const n=this._getBaseUrl(),[s,r]=this._getHeaders(),a=(Array.isArray(e)?e:[e]).map((e=>e.trim()));return r?Promise.reject(r):fetch(n.toString(),{method:"POST",body:JSON.stringify({words:a}),headers:s}).then((e=>e.ok?Promise.resolve():Promise.reject(new Error(`Status: ${e.status}`)))).catch((n=>t?(i.TrackerAdapter.trackEvent("Action","dict_sync_add:failed",a.slice(0,3).concat(["…"]).join(",")),Promise.reject(n)):(0,o.wait)(5e3).then((()=>this.addWord(e,!0)))))}static removeWord(e,t=!1){const n=this._getBaseUrl(),[s,r]=this._getHeaders(),a=(Array.isArray(e)?e:[e]).map((e=>e.trim()));return r?Promise.reject(r):fetch(n.toString(),{method:"DELETE",body:JSON.stringify({words:a}),headers:s}).then((e=>e.ok?Promise.resolve():Promise.reject(new Error(`Status: ${e.status}`)))).catch((n=>t?(i.TrackerAdapter.trackEvent("Action","dict_sync_remove:failed",a.slice(0,3).concat(["…"]).join(",")),Promise.reject(n)):(0,o.wait)(5e3).then((()=>this.removeWord(e,!0)))))}static downloadList(){const e=this._getBaseUrl(),[t,n]=this._getHeaders();return n?Promise.reject(n):(e.searchParams.append("limit",String(2e3)),fetch(e.toString(),{method:"GET",headers:t}).then((e=>e.ok?e.json():Promise.reject(new Error(`[${e.status}] Download request failed`)))).then((e=>(0,l.isObject)(e)&&"words"in e&&Array.isArray(e?.words)?Promise.resolve(e.words.filter((e=>"string"==typeof e))):Promise.reject(new Error("Empty response while loading dictionary")))).catch((e=>(i.TrackerAdapter.trackSampledEvent("Action","dict_download:failed",e&&e.message),Promise.reject(e)))))}}c.MAX_WORDS=5e3,c.BATCH_SIZE=250,c._isInitialized=!1,c._syncing=!1,c._deleting=!1,c.EMOJI_REGEXP=/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]/},
125"./background/synonyms.ts":
126/*!********************************!*\
127  !*** ./background/synonyms.ts ***!
128  \********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Synonyms:()=>l});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/utils */"./core/utils.ts");
129/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
130const i='([.…,:;?!"”“„)(]+)',o=new RegExp("^"+i),a=new RegExp(i+"$");class l{static load(e,t,n){return-1===s.SUPPORTED_SYNONYM_LANGUAGES.indexOf(t)?Promise.reject(new Error("Sorry, synonyms are not supported in this language.")):this._request(e,t,n)}static async abort(){this._abortCurrentRequest()}static _request(e,t,n){const s=this._getFromCache(e.word,e.beforeText,e.afterText,t,n);return s?Promise.resolve(s):(this._abortCurrentRequest(),clearTimeout(this._timeout),this._abortController=new AbortController,this._timeout=self.setTimeout((()=>this._abortCurrentRequest),this.HTTP_TIMEOUT),("en"===t?this._requestFromNewServer(this._abortController,e,t,n):this._requestFromOldServer(this._abortController,e,t,n)).finally((()=>{this._abortController=null,clearTimeout(this._timeout)})))}static _requestFromOldServer(e,t,n,s){const r=t.word,i=this._prepareWord(t.word),o=new URL(`https://synonyms.languagetool.org/synonyms/${n}/${i}`);o.searchParams.set("before",t.beforeText),o.searchParams.set("after",t.afterText),s&&o.searchParams.set("motherTongue",s);const a={method:"get",mode:"cors",signal:e.signal};return fetch(o.toString(),a).then((e=>e.json())).then((e=>{if(!e||!e.synsets)throw new Error("Error loading synonyms.");const o=this._buildSynonymSets(i,r,e),a={dataSource:e.dataSource,synonymSets:o,genders:e.genders};return this._setInCache(t.word,t.beforeText,t.afterText,n,s,a),a}))}static _requestFromNewServer(e,t,n,i){let l=t.word;const c=t.afterText.match(o);c&&(l+=c[1]);const d=t.beforeText.match(a);return d&&(l=d[1]+l),fetch(s.NEW_SYNONYMS_URL,{method:"POST",signal:e.signal,headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({message:{text:t.sentence,phrases:[l],mode:0,indices:[t.beforeText?t.beforeText.split(" ").length:0]},response_queue:"string",meta:{traceID:"string",userID:"string",product:"string",clientStatus:"string"}})}).then((e=>e.json())).then((e=>{if(!(e&&"OK"===e.message&&e.data&&e.data.suggestions&&Array.isArray(e.data.suggestions[l])))throw new Error("Unexpected response");let s=[];if(e.data.suggestions[l].forEach((e=>{d&&c?e.startsWith(d[1])&&e.endsWith(c[1])&&s.push(e.replace(a,"").replace(o,"")):c?e.endsWith(c[1])&&!e.includes(c[1]+" ")&&s.push(e.replace(a,"")):d?e.startsWith(d[1])&&!e.includes(" "+d[1])&&s.push(e.replace(o,"")):s.push(e.replace(a,""))})),!s.length)return Promise.reject(new Error("No synonyms found"));s=(0,r.uniq)(s),s.length=Math.min(s.length,12);const h={synonymSets:[{title:"",type:"",synonyms:s.filter((e=>e!==l)).map((e=>({word:e,hints:[]})))}],genders:[]};return this._setInCache(t.word,t.beforeText,t.afterText,n,i,h),h})).catch((s=>"AbortError"!==s?.name?this._requestFromOldServer(e,t,n,i):Promise.reject(s)))}static _prepareWord(e){return e=e.trim(),(0,r.isAllUppercase)(e)?e.charAt(0)+e.substr(1).toLowerCase():e}static _containsSynonymObj(e,t){return e.some((e=>e.word===t.word))}static _buildSynonymSets(e,t,n){const s=[],i=(0,r.isAllUppercase)(t)&&t.length>3;return n.synsets.forEach((n=>{if(!n.terms.length)return;let r="",o="";n.terms[0].term.match(this.IS_ONLY_HINT_REGEXP)?(r=`${t} ${n.terms[0].term}`,o=n.terms[0].term.replace(/[\(\)]/g,""),n.terms.shift()):r=n.terms[0].term;const a=[];if(n.terms.forEach((t=>{let n=Array.from(t.term.match(this.HINT_REGEXP)||[]);if(n=n.map((e=>e.replace(this.TERM_REGEXP,"").trim())),n=n.filter((e=>!e.match(/similar/))),n.indexOf("(antonym)")>-1)return;let s=t.term.replace(this.HINT_REGEXP,"").trim();s.match(/[\!\?\,\:\;]/)||s.toLowerCase()!==e.toLowerCase()&&(i&&(s=s.toUpperCase()),s.trim()&&a.push({word:s,hints:n}))})),!a.length)return;const l=s.find((e=>e.type===o&&e.title===r&&e.synonyms.find((e=>this._containsSynonymObj(a,e)))));
130if(l)a.forEach((e=>{this._containsSynonymObj(l.synonyms,e)||l.synonyms.push(e)}));else{if(o&&s.filter((e=>e.type===o)).length>=3)return;s.push({title:r,type:o,synonyms:a})}})),s}static _abortCurrentRequest(){this._abortController&&(this._abortController.abort(),this._abortController=null)}static _getFromCache(e,t,n,s,r){const i=this._cache.find((i=>i.word===e&&i.beforeText===t&&i.afterText===n&&i.language===s&&i.motherTongue===r));if(i)return i.result}static _setInCache(e,t,n,s,r,i){this._cache.unshift({word:e,beforeText:t,afterText:n,language:s,motherTongue:r,result:i}),this._cache.length=Math.min(this._cache.length,100)}}l.HTTP_TIMEOUT=5e3,l._abortController=null,l._cache=[],l.IS_ONLY_HINT_REGEXP=/^\s*\([^\)]+\)\s*$/,l.TERM_REGEXP=/\sterm/,l.HINT_REGEXP=/(\s|^)\((.+?)\)/g,l.emptySynonymResult={synonymSets:[],dataSource:{licenseUrl:"",sourceName:"",sourceUrl:""},genders:null}},
130"./common/advancedToolboxAdapter.ts":
131/*!******************************************!*\
132  !*** ./common/advancedToolboxAdapter.ts ***!
133  \******************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdvancedToolboxAdapter:()=>a,AdvancedToolboxAdapterBaseClass:()=>o});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),r=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ../init/config */"./init/config.ts");class o{}const a=class{static init(e){this._instance=e}static getUiLanguage(){const e=i.default.get(i.ConfigKey.LOLLIPOP_CONFIG).TOOLBOX_AVAILABLE_UI_LANGUAGES,t=(0,s.verifyUiLanguage)(r.EnvironmentAdapter.getUILanguageCode());return e.includes(t)?t:"en"}static getToolboxEnvironment(e){return this._instance.getToolboxEnvironment(e)}static getToolboxConfig(e){return this._instance.getToolboxConfig(e)}static preApplyToolboxResult(e){return this._instance.preApplyToolboxResult(e)}static canSeeLollipop(e){return this._instance.canSeeLollipop(e)}static isUsedForRephrasing(){return this._instance.isUsedForRephrasing()}static isPremiumParaphraseMode(e,t){return this._instance.isPremiumParaphraseMode(e,t)}static getParaphraserSkill(e){return this._instance.getParaphraserSkill(e)}static getLastUsedParaphraserMode(){return this._instance.getLastUsedParaphraserMode()}static isParaphraserSentenceSkill(e){return this._instance.isParaphraserSentenceSkill(e)}}},
133"./common/browserDetector.ts":
134/*!***********************************!*\
135  !*** ./common/browserDetector.ts ***!
136  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{BrowserDetector:()=>s});
137/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
138class s{static _contructor(){if(this._isInitialized)return;s._isChromium=navigator.userAgent.includes("Chrome/")||navigator.userAgent.includes("Chromium/"),s._isFirefox=navigator.userAgent.includes("Firefox/"),s._isThunderbird=navigator.userAgent.includes("Thunderbird/"),s._isOpera=navigator.userAgent.includes("OPR/"),s._isEdge=navigator.userAgent.includes("Edg/"),s._isOldEdge=navigator.userAgent.includes("Edge/"),s._isSafari=(navigator.userAgent.includes("Safari/")||navigator.userAgent.includes("AppleWebKit"))&&!s._isChromium&&!s._isEdge&&!s._isOpera,s._isYaBrowser=navigator.userAgent.includes("YaBrowser/"),s._isChrome=s._isChromium&&!s._isOpera&&!s._isEdge&&!s._isOldEdge&&!s._isYaBrowser;const e=navigator.userAgent.match(/Chrome\/(\d+)/);e&&(s._isUnsupportedChrome=parseInt(e[1])<67&&!navigator.userAgent.includes("Edge/"));const t=navigator.userAgent.match(/Firefox\/(\d+)/);t&&(s._isUnsupportedFirefox=parseInt(t[1])<60),this._isInitialized=!0}static getOS(){return navigator.userAgent.includes("Macintosh")?"Mac":navigator.userAgent.includes("Windows")?"Windows":navigator.userAgent.includes("CrOS")?"CrOS":navigator.userAgent.includes("Linux")?"Linux":"Other"}static isChromium(){return s._isChromium}static isChrome(){return s._isChrome}static isThunderbird(){return s._isThunderbird}static isFirefox(){return s._isFirefox}static isOpera(){return s._isOpera}static isEdge(){return s._isEdge}static isSafari(){return s._isSafari}static isYaBrowser(){return s._isYaBrowser}static isUnsupportedChrome(){return s._isUnsupportedChrome}static isUnsupportedFirefox(){return s._isUnsupportedFirefox}static isUnsupportedBrowser(){return s.isUnsupportedChrome()||s.isUnsupportedFirefox()}static getBrowserName(){return s.isChrome()?"Chrome":s.isFirefox()?"Firefox":s.isOpera()?"Opera":s.isEdge()?"Edge":s.isSafari()?"Safari":s.isYaBrowser()?"Yandex":"Unknown Browser"}static getUserAgentIdentifier(){let e="webextension";return this.isChrome()?e+="-chrome":this.isFirefox()?e+="-firefox":this.isOpera()?e+="-opera":this.isEdge()?e+="-edge":this.isYaBrowser()?e+="-chrome":this.isSafari()?e+="-safari":e+="-unknown",e+"-ng"}static isTouchDevice(){if(!("ontouchstart"in self))return!1;const e=navigator.userAgent.includes("Android");return this.isIOS()||e}static isIOS(){const e=navigator.userAgent.includes("iPhone OS"),t=navigator.userAgent.includes("Macintosh")&&Boolean(navigator.maxTouchPoints&&navigator.maxTouchPoints>2);return e||t}static isIOSTouchDevice(){return"ontouchstart"in self&&this.isIOS()}static isMacApp(){return navigator.userAgent.includes("AppleWebKit/")&&navigator.userAgent.includes("LanguageTool/")&&!navigator.userAgent.includes("Chrome/")&&!navigator.userAgent.includes("Chromium/")}static isWindowsApp(){return navigator.userAgent.includes("LanguageToolWindows/")}}s._isChromium=!1,s._isChrome=!1,s._isFirefox=!1,s._isThunderbird=!1,s._isOpera=!1,s._isOldEdge=!1,s._isEdge=!1,s._isSafari=!1,s._isYaBrowser=!1,s._isUnsupportedChrome=!1,s._isUnsupportedFirefox=!1,s._isInitialized=!1,s._contructor()},
138"./common/calculateTextScore.ts":
139/*!**************************************!*\
140  !*** ./common/calculateTextScore.ts ***!
141  \**************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextScore:()=>s});class s{calculateTextScore(e,t,n,s){if(e<100)return 0;let r=0,i=0,o=0;const a=e=>{e.isSpellingError?o++:e.isStyleError?i++:r++};t.forEach(a),n.forEach(a),s.forEach(a);const l=3*r+4*o+2*i;return Math.max(0,Math.floor((e-l)/e*100))}}},
141"./common/dictionary.ts":
142/*!******************************!*\
143  !*** ./common/dictionary.ts ***!
144  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Dictionary:()=>o});var s=n(/*! ../core/utils */"./core/utils.ts"),r=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ./storageController */"./common/storageController.ts");
145/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
146class o{static _update(e){return this._storageController.updateSettings({dictionary:e})}static init(e,t=[]){this._isInitialized||(this._storageController=e||i.StorageControllerFactory.create(),this._defaultWords=t,this._isInitialized=!0)}static get(){let e=this._storageController.getSettings().dictionary;return Array.isArray(e)||(e=[]),this._defaultWords.length&&(e=e.concat(this._defaultWords),e=(0,s.uniq)(e)),e}static getSorted(){return this.get().sort(((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())))}static add(e){const t=this.get();return t.push(e.trim()),r.EnvironmentAdapter.addWordToDictionary(e),this._update(t)}static addBatch(e){const t=this.get();return e.forEach((e=>{e&&e.trim()&&!e.trim().match(/\s/)&&t.push(e.trim())})),r.EnvironmentAdapter.addWordsToDictionary(e),this._update(t)}static remove(e){const t=this.get(),n=t.indexOf(e);return-1===n?Promise.resolve():(t.splice(n,1),r.EnvironmentAdapter.removeWordFromDictionary(e),this._update(t))}static clear(){return r.EnvironmentAdapter.clearDictionary(),this._update([])}}o._isInitialized=!1},
146"./common/domMeasurement.ts":
147/*!**********************************!*\
148  !*** ./common/domMeasurement.ts ***!
149  \**********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{DomMeasurement:()=>o});var s=n(/*! ../core/utils */"./core/utils.ts"),r=n(/*! ./browserDetector */"./common/browserDetector.ts"),i=n(/*! ./utils */"./common/utils.ts");
150/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
151class o{constructor(e=document){this._window=e.defaultView,this._document=e,this.clearCache()}_getElementCache(e){let t=this._elementCache.get(e);return t||(t={},this._elementCache.set(e,t)),t}_consolidateSVGTransformMatrix(e){const t={a:1,b:0,c:0,d:1,e:0,f:0};for(let n=0;n<e.transform.baseVal.length;n++){const s=e.transform.baseVal[n];1===s.type?(t.a=s.matrix.a,t.b=s.matrix.b,t.c=s.matrix.c,t.d=s.matrix.d,t.e=s.matrix.e,t.f=s.matrix.f):2===s.type?(t.e=s.matrix.e,t.f=s.matrix.f):3===s.type?(t.a=s.matrix.a,t.d=s.matrix.d):5===s.type?t.b=s.matrix.b:6===s.type&&(t.c=s.matrix.c)}return t}clearCache(){this._documentVisibleBox=null,this._documentGap=null,this._documentScroll=null,this._elementCache=new WeakMap}_contains(e,t){return e&&e!==t&&(0,i.isParent)(e,t)}contains(e,t){return this._contains(e,t)}_getComputedStyle(e,t,n){let s,r;return"object"==typeof t?(s=t,r=""):(s=n,r=t),s.computedStyle||(s.computedStyle=new Map),s.computedStyle.has(r)||s.computedStyle.set(r,this._window.getComputedStyle(e,r||null)),s.computedStyle.get(r)}getComputedStyle(e,t=""){return this._getComputedStyle(e,t,this._getElementCache(e))}_getComputedStyleMap(e,t){return e.computedStyleMap?(t.computedStyleMap||(t.computedStyleMap=e.computedStyleMap()),t.computedStyleMap):null}getComputedStyleMap(e){return this._getComputedStyleMap(e,this._getElementCache(e))}getInlineStyle(e,t){return e.style instanceof CSSStyleDeclaration?e.style.getPropertyValue(t):""}getStyle(e,t,n){let s,r;return"string"==typeof n?(s=t,r=n):(s="",r=t),this.getStyles(e,s,[r])[r]}getStyles(e,t,n){const s="string"==typeof t?t:"",i=this._getElementCache(e),o=this._getComputedStyle(e,s,i);let a=null;if(Array.isArray(t))a=t;else if(Array.isArray(n))a=n;else{a=[];for(let e=0;e<o.length;e++)a.push(o[e])}const l={};for(const t of a)if("line-height"===t||"lineHeight"===t){const n=this.getInlineStyle(e,t);n&&n.includes("px")?l[t]=n:l[t]=o[t]||""}else if("font"!==t||o[t])if("transform"===t&&e instanceof SVGGElement&&r.BrowserDetector.isSafari()&&e.hasAttribute("transform")){const n=this._consolidateSVGTransformMatrix(e);l[t]=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, ${n.e}, ${n.f})`}else l[t]="zoom"===t?o[t]||"1":o[t]||"";else{const n=o["font-style"],s=o["font-variant"],r=o["font-weight"],i=o["font-size"],a=this.getInlineStyle(e,"line-height")||o["line-height"]||"",c=o["font-family"];l[t]=`${n} ${s} ${r} ${i} ${a?"/ "+a:""} ${c}`}return l}getExactStyle(e,t){return this.getExactStyles(e,[t])[t]}getExactStyles(e,t){const n=this._getElementCache(e),s=this._getComputedStyleMap(e,n);if(s){const e={};for(const n of t){const t=s.get(n);t?"number"==typeof(r=t).value&&"string"==typeof r.unit?"number"===t.unit?e[n]=t.value.toString():e[n]=t.value+t.unit:e[n]=t.toString():e[n]=""}return e}return this.getStyles(e,t);var r}setStyle(e,t,n,s=!1){Array.isArray(e)||(e=[e]);const r={[t]:n};this.setStyles(e,r,s)}setStyles(e,t,n=!1){Array.isArray(e)||(e=[e]);for(const s of e)for(const e in t){let r=t[e].trim();const i=n||o.IMPORTANT_REG_EXP.test(r);r=r.replace(o.IMPORTANT_REG_EXP,""),s.style.setProperty(e,r,i?"important":"")}}copyStyles(e,t,n,s=!1){const r=this.getStyles(e,n);this.setStyles(t,r,s)}resetStyles(e,t,n=!1){Array.isArray(e)||(e=[e]);let s="";for(const e in t){let r=t[e].trim();n&&!o.IMPORTANT_REG_EXP.test(r)&&(r+=" !important"),s+=`${e}: ${r};`}for(const t of e)t.style.cssText=s}removeStyle(e,t){Array.isArray(e)||(e=[e]),this.removeStyles(e,[t])}removeStyles(e,t){Array.isArray(e)||(e=[e]);for(const n of e)for(const e of t)n.style.removeProperty(e)}getBoundingClientRect(e){return this._getBoundingClientRect(e,this._getElementCache(e))}_getBoundingClientRect(e,t){return t.boundingClientRect||(t.boun
151dingClientRect=(0,s.deepClone)(e.getBoundingClientRect())),t.boundingClientRect}getRelativeClientRect(e,t){const n=this._getBoundingClientRect(e,this._getElementCache(e)),s=this._getBoundingClientRect(t,this._getElementCache(t)),r=n.top-s.top,i=n.left-s.left,o=n.width,a=n.height;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}_getBorderBox(e,t,n,s){const r="borderBox"+(t?"WithScroll":"")+(n?"WithScale":"");if(!s[r]){const i=this._getBoundingClientRect(e,s);let{top:o,left:a,width:l,height:c}=i;if(n){const t=this.getZoom(e);o*=t,a*=t,l*=t,c*=t}else{const t=this._getScaleFactor(e,s);l/=t.x,c/=t.y}if(t){const t=this.getDocumentScroll();if(o+=t.top,a+=t.left,this._document.body&&this._contains(this._document.body,e)){const e=this.getDocumentGap();o-=e.top,a-=e.left}}s[r]={top:o,right:a+l,bottom:o+c,left:a,width:l,height:c}}return s[r]}getBorderBox(e,t=!0,n=!0){return this._getBorderBox(e,t,n,this._getElementCache(e))}_getPaddingBox(e,t,n,s){const r="paddingBox"+(t?"WithScroll":"")+(n?"WithScale":"");if(!s[r]){let{top:i,left:o,width:a,height:l}=this._getBorderBox(e,t,n,s),c={x:1,y:1};n&&(c=this._getScaleFactor(e,s));const d=n?this._getZoom(e,s):1,h=this._getComputedStyle(e,s),u=(parseFloat(h["border-top-width"])||0)*c.y*d,g=(parseFloat(h["border-right-width"])||0)*c.x*d,m=(parseFloat(h["border-bottom-width"])||0)*c.y*d,p=(parseFloat(h["border-left-width"])||0)*c.x*d;let _=0,E=0;if("BackCompat"!==this._document.compatMode||e!==this._document.body||e!==this._document.scrollingElement){let{width:t,height:n}=this._getClientWidthAndHeight(e,s);t=t*c.x*d,n=n*c.y*d;let r=a;r%1>0&&"offsetWidth"in e&&(r=e.offsetWidth*c.x*d);let i=l;i%1>0&&"offsetHeight"in e&&(i=e.offsetHeight*c.y*d),_=r-p-t-g,E=i-u-n-m,_<1&&(_=0),E<1&&(E=0)}i+=u,o+=p,a=a-p-_-g,l=l-u-E-m,this._isRTL(e,s)&&(o+=_),s[r]={top:i,right:o+a,bottom:i+l,left:o,width:a,height:l,border:{top:u,right:g,bottom:m,left:p}}}return s[r]}getPaddingBox(e,t=!0,n=!0){return this._getPaddingBox(e,t,n,this._getElementCache(e))}_getContentBox(e,t,n,s){const r="contentBox"+(t?"WithScroll":"")+(n?"WithScale":"");if(!s[r]){let{top:i,left:o,width:a,height:l,border:c}=this._getPaddingBox(e,t,n,s),d={x:1,y:1};n&&(d=this._getScaleFactor(e,s));const h=n?this._getZoom(e,s):1,u=this._getComputedStyle(e,s),g=(parseFloat(u["padding-top"])||0)*d.y*h,m=(parseFloat(u["padding-right"])||0)*d.x*h,p=(parseFloat(u["padding-bottom"])||0)*d.y*h,_=(parseFloat(u["padding-left"])||0)*d.x*h;i+=g,o+=_,a=a-_-m,l=l-g-p,s[r]={top:i,right:o+a,bottom:i+l,left:o,width:a,height:l,border:c,padding:{top:g,right:m,bottom:p,left:_}}}return s[r]}getContentBox(e,t=!0,n=!0){return this._getContentBox(e,t,n,this._getElementCache(e))}_getClientWidthAndHeight(e,t){let n=e.clientWidth,s=e.clientHeight;if(0===n&&0===s&&"offsetWidth"in e){const r=this._getComputedStyle(e,t);"inline"===r.display&&(n=e.offsetWidth-parseInt(r["border-left-width"])-parseInt(r["border-right-width"]),s=e.offsetHeight-parseInt(r["border-top-width"])-parseInt(r["border-bottom-width"]))}return{width:n,height:s}}_getScrollDimensions(e,t,n){const s="scrollDimensions"+(t?"WithScale":"");if(!n[s]){let r=e.scrollWidth,i=e.scrollHeight;if(0===r&&(0===i||0===e.clientHeight)){const t=this._getClientWidthAndHeight(e,n);r=t.width,i=t.height}if(t){const t=this._getScaleFactor(e,n),s=this._getZoom(e,n);r=r*t.x*s,i=i*t.y*s}n[s]={width:r,height:i}}return n[s]}getScrollDimensions(e,t=!0){return this._getScrollDimensions(e,t,this._getElementCache(e))}_getScrollPosition(e,t,n,s){const r="scrollPosition"+(t?"WithScale":"")+(n?"WithZoom":"");if(!s[r]){let i={x:1,y:1};t&&(i=this._getScaleFactor(e,s));const o=n?this._getZoom(e,s):1,a=e===this._document.body&&"BackCompat"===this._document.compatMode,l=a?0:e.scrollTop*i.y*o,c=a?0:e.scrollLeft*i.x*o;s[r]={top:l,left:c}}return s[r]}getScrollPosition(e,t=!0,n=t){return this._getScrollPosition(e,t,n,this._getElementCache(e))}_isPositionFixed(e,t){if(void 0===t.isPositionFixed){t.isPositionFixed=!1;let n=e;for(;n;){if("fixed"===this.getStyle(n,"position")){t.isPositionFixed=!0;break}n=n.parentElement}}return t.isPositionFixed}isPositionFixed(e){return this._isPositionFixed(e,this._getElementCache(e))}_getContainingBlock(e,t,n){const s="absolute"===t,i=s?"containingBlockForAbsolutePosition":"containingBlockForFixedPosition";let o=n[i];if(void 0===o){o=null;const t=[document.documentElement,document.body],n=["layout","paint","strict","content"],i=["transform","perspective"];let a=e;for(;a&&!t.includes(a);){const e=this.getStyles(a,["position","transform","perspective","will-change","filter","contain","container-type","backdrop-filter"]);if(s&&"static"!==e.position||"none"!==e.transform||"none"!==e.perspective||"none"!==e.filter||n.includes(e.contain)||i.includes(e["will-change"])||"normal"!==e["container-type"]||"none"!==e["backdrop-filter"]&&""!==e["backdrop-filter"]||r.BrowserDetector.isFirefox()&&"filter"===e["will-change"]){o=this.getPaddingBox(a);break}a=a.parentElement}}return n[i]=o,o}getContainingBlock(e,t="absolute"){return this._getContainingBlock(e,t,this._getElementCache(e))}getScaleFactor(e){return this._getScaleFactor(e,this._getElementCache(e))}_getScaleFactor(e,t){if(void 0===t.scaleFactor){if(e instanceof SVGElement){let t=1;const n=e.getAttribute("transform")||"",s=/scale\((\d+(\.\d+)?)\)/.exec(n);return s&&(t=+s[1]),{x:t,y:t}}{const n=this._getBoundingClientRect(e,t),s=e.offsetWidth,r=e.offsetHeight;t.scaleFactor={x:1,y:1},n.width>0&&s>0&&Math.abs(n.width-s)>1&&(t.scaleFactor.x=n.width/s),n.height>0&&r>0&&Math.abs(n.height-r)>1&&(t.scaleFactor.y=n.height/r)}}return t.scaleFactor}_getZoom(e,t){if(r.BrowserDetector.isFirefox()||r.BrowserDetector.isThunderbird())return 1;if("number"!=typeof t.zoom){let n=1,s=e;for(;s&&s!==this._document.documentElement;)n*=+this.getStyle(s,"zoom"),s=s.parentNode instanceof ShadowRoot&&s.parentNode.host instanceof HTMLElement?s.parentNode.host:s.parentElement;t.zoom=n}return t.zoom}getZoom(e){return this._getZoom(e,this._getElementCache(e))}_getStackingContextWithZIndex(e){const t=this.getComputedStyle(e),n=parseInt(t.zIndex||"");if(isNaN(n))return null;if(t.position&&o.NON_STATIC_POSITIONS.indexOf(t.position)>-1)return{zIndex:n};if(e.parentElement){const t=this.getComputedStyle(e.parentElement);if("flex"===t.display||"grid"===t.display)return{zIndex:n}}return null}getZIndex(e,t=this._document.documentElement){let n="auto",s=e;if(!s.ownerDocument)return"auto";const r=s.ownerDocument.defaultView;if(!r)throw new Error("Failed to retrieve the current element's window object.");const{Element:i,ShadowRoot:o}=r;for(;s&&s!==this._document&&s!==t&&s instanceof i;){const e=this._getStackingContextWithZIndex(s);e&&(n=e.zIndex),s=s.parentNode instanceof o?s.parentNode.host:s.parentElement}return n}_isRTL(e,t){return"boolean"!=typeof t.isRTL&&(t.isRTL="rtl"===this.getStyle(e,"direction")),t.isRTL}isRTL(e){return this._isRTL(e,this._getElementCache(e))}isStackingContext(e){const t=this.getComputedStyle(e);return!!(t.position&&o.NON_STATIC_POSITIONS.indexOf(t.position)>
151-1)||"none"!==t.transform||"none"!==t.filter||"none"!==t.clipPath||"none"!==t.perspective||Number(t.opacity)<1}_getTextClientRects(e){const t=this._document.createRange();return t.setStart(e.node,e.start),t.setEnd(e.node,e.end),Array.from(t.getClientRects())}getTextBoundingBoxes(e,t,n=!0,s=!1){Array.isArray(e)||(e=[e]);const r=[];let i=0,a=0;if(n){const e=this.getDocumentScroll();if(i+=e.top,a+=e.left,this._document.body&&this._contains(this._document.body,t)){const e=this.getDocumentGap();i-=e.top,a-=e.left}}for(const t of e)try{const e=this._getTextClientRects(t);for(const t of e){if(!s&&t.width<o.MIN_TEXT_BOX_WIDTH)continue;const e=r[r.length-1],n=t.top+i,l=t.right+a,c=t.bottom+i,d=t.left+a,h=t.width,u=t.height;e&&e.right===d&&e.top===n&&e.bottom===c&&e.height===u?(e.right=l,e.width=e.width+h):r.push({top:n,right:l,bottom:c,left:d,width:h,height:u})}}catch(e){}return r}getRelativeTextBoundingBoxes(e,t,n=this.getScrollPosition(t)){Array.isArray(e)||(e=[e]);const s=[],r=this.getPaddingBox(t,!1,!1),i=r.left-n.left,a=r.top-n.top;for(const t of e)try{const e=this._getTextClientRects(t);for(const t of e){if(t.width<o.MIN_TEXT_BOX_WIDTH)continue;const e=s[s.length-1],n=t.top-a,r=t.right-i,l=t.bottom-a,c=t.left-i,d=t.width,h=t.height;e&&e.right===c&&e.top===n&&e.bottom===l&&e.height===h?(e.right=r,e.width=e.width+d):s.push({top:n,right:r,bottom:l,left:c,width:d,height:h})}}catch(e){console.error("LT range error",e)}const l=this.getScaleFactor(t);for(const e of s)e.top=Math.round(e.top/l.y),e.right=Math.round(e.right/l.x),e.bottom=Math.round(e.bottom/l.y),e.left=Math.round(e.left/l.x),e.width=e.right-e.left,e.height=e.bottom-e.top;return s}getRelativeTextBoundingBox(e,t){const n=this.getRelativeTextBoundingBoxes(e,t),s=Math.min(...n.map((e=>e.top))),r=Math.max(...n.map((e=>e.right))),i=Math.max(...n.map((e=>e.bottom))),o=Math.min(...n.map((e=>e.left)));return{top:s,right:r,bottom:i,left:o,width:r-o,height:i-s}}_hasRelativePosition(e,t){const n=this._getComputedStyle(e,t).position||"static";return o.NON_STATIC_POSITIONS.indexOf(n)>-1}getDocumentGap(){if(!this._documentGap&&(this._documentGap={top:0,left:0},this._document.body&&this._hasRelativePosition(this._document.body,this._getElementCache(this._document.body)))){const e=this.getBorderBox(this._document.documentElement),t=this.getBorderBox(this._document.body);let n=this._document.documentElement.offsetTop,s=this._document.documentElement.offsetLeft;if(r.BrowserDetector.isFirefox()||r.BrowserDetector.isThunderbird()){let e=null;0===n&&(e=this.getComputedStyle(this._document.documentElement),n=parseInt(e["margin-top"])||0),0===s&&(e=e||this.getComputedStyle(this._document.documentElement),s=parseInt(e["margin-left"])||0)}const i=t.top-e.top+n,o=t.left-e.left+s,a=this.getComputedStyle(this._document.body),l=parseFloat(a["border-top-width"])||0,c=parseFloat(a["border-left-width"])||0;this._documentGap={top:i+l,left:o+c}}return this._documentGap}getDocumentVisibleBox(){if(!this._documentVisibleBox){const e=this.getDocumentScroll();let t=this._document.documentElement.clientHeight,n=this._document.documentElement.clientWidth;r.BrowserDetector.isThunderbird()&&(t=self.innerHeight,n=self.innerWidth),this._documentVisibleBox={top:e.top,right:e.left+n,bottom:e.top+t,left:e.left,width:n,height:t}}return this._documentVisibleBox}getDocumentScroll(){if(!this._documentScroll){const e=this._document.documentElement&&this._document.documentElement.scrollTop||this._document.body&&this._document.body.scrollTop||0,t=this._document.documentElement&&this._document.documentElement.scrollLeft||this._document.body&&this._document.body.scrollLeft||0;this._documentScroll={top:e,left:t}}return this._documentScroll}_isScrollable(e,t,n){if("boolean"==typeof n.isScrollable?.[t])return n.isScrollable?.[t];n.isScrollable??(n.isScrollable={});const s=this.getComputedStyle(e);return"x"===t?(n.isScrollable.x=e.scrollWidth>e.clientWidth||"scroll"===s.overflowX,n.isScrollable.x):"y"===t?(n.isScrollable.y=e.scrollHeight>e.clientHeight||"scroll"===s.overflowY,n.isScrollable.y):void 0}isScrollable(e,t){return this._isScrollable(e,t,this._getElementCache(e))}}o.IMPORTANT_REG_EXP=/!important$/,o.TRANSFORM_MATRIX_REG_EXP=/(?:matrix|scale)\(([\d\.]+),/,o.NON_STATIC_POSITIONS=["relative","fixed","absolute","sticky"],o.MIN_TEXT_BOX_WIDTH=.1},
151"./common/editors/ckEditor.ts":
152/*!************************************!*\
153  !*** ./common/editors/ckEditor.ts ***!
154  \************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CKEditor:()=>i});var s=n(/*! ../../config/config */"./config/config.ts"),r=n(/*! ../../content/ceElementInspector */"./content/ceElementInspector.ts");
155/*! (C) Copyright 2023 LanguageTooler GmbH. All rights reserved. */
156class i{static isEditor(e){return this.isVersion4(e)||this.isVersion5(e)}static isVersion4(e){return e.matches(i.CKEDITOR4_SELECTOR)}static isVersion5(e){return"string"==typeof e.className&&e.className.includes(i.CKEDITOR5_CLASS_NAME_PART)}isIgnoredElement(e,t){const n=e.tagName.toUpperCase();return!!r.CEElementInspector.SKIPPING_TAGS.includes(n)||"BLOCKQUOTE"===n||"none"===t.display||!!(e.classList.contains("ck-widget__selection-handle")||e.classList.contains("ck-widget__resizer")||e.classList.contains("ck-widget__type-around"))||("false"===e.getAttribute("contenteditable")||"false"===e.getAttribute("spellcheck")?!(e.classList.contains("cke_widget_mention-box")||e.classList.contains("ck-user__marker")||e.classList.contains("ck-user__marker-line")||e.classList.contains("ck-widget")&&e.classList.contains("table")||e instanceof HTMLElement&&"inline"===t.display&&(!e.firstElementChild||1===e.childElementCount&&e.offsetWidth>0)):!("SUP"!==n||!e.textContent)&&r.CEElementInspector.SUP_REGEXP.test(e.textContent.trim()))}getReplacementText(e){return e.classList.contains("ck-widget")&&e.classList.contains("image-inline")?s.INVISIBLE_SEPARATOR:null}getLangAttribute(){return""}initHighlighterContainer(e){e.setAttribute("data-cke-temp","1")}initToolbarContainer(e){e.setAttribute("data-cke-temp","1")}static getDelayBeforeInsertingText(){return 10}}i.CKEDITOR4_SELECTOR=".cke_editable",i.CKEDITOR5_CLASS_NAME_PART="ck-editor_"},
156"./common/editors/codemirror/codeMirror5Editor.ts":
157/*!********************************************************!*\
158  !*** ./common/editors/codemirror/codeMirror5Editor.ts ***!
159  \********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CodeMirror5Editor:()=>l});var s=n(/*! ../../../content/ceElementWrapper */"./content/ceElementWrapper.ts"),r=n(/*! ../../../content/editors/codemirror/codeMirror5CEElementEditorWrapper */"./content/editors/codemirror/codeMirror5CEElementEditorWrapper.ts"),i=n(/*! ../../../content/editors/codemirror/codeMirror5TextAreaEditorWrapper */"./content/editors/codemirror/codeMirror5TextAreaEditorWrapper.ts"),o=n(/*! ../../environmentAdapter */"./common/environmentAdapter.ts"),a=n(/*! ../../utils */"./common/utils.ts");
160/*! (C) Copyright 2022 LanguageTooler GmbH. All rights reserved. */
161class l{static _isTextAreaEditor(e){const t=e.closest(l.EDITOR_CONTAINER_SELECTOR);return!!t&&(0,a.contains)(t,l.EDITOR_TEXTAREA_SELECTOR)}static _isCEElementEditor(e){if("true"!==e.getAttribute("contenteditable"))return!1;const t=e.closest(l.EDITOR_CONTAINER_SELECTOR);return!!t&&!(0,a.contains)(t,l.EDITOR_TEXTAREA_SELECTOR)}static isEditorPart(e){return e.matches(this.EDITOR_TEXTAREA_SELECTOR)}static getEditor(e){const t=e.closest(this.EDITOR_CONTAINER_SELECTOR);if(!t)return[];const n=t.querySelector(this.EDITOR_SELECTOR);return n?[n]:[]}static isEditor(e){return this._isTextAreaEditor(e)||this._isCEElementEditor(e)}static isTextMode(e){const t="LanguageTool_isTextMode",n=e.ownerDocument;o.EnvironmentAdapter.executeScript(n,`\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst TEXT_MODES = [\n\t\t\t\t\t\t\t"null",\n\t\t\t\t\t\t\t"htmlmixed",\n\t\t\t\t\t\t\t"htmlembedded",\n\t\t\t\t\t\t\t"markdown",\n\t\t\t\t\t\t\t"mbox",\n\t\t\t\t\t\t\t"textile",\n\t\t\t\t\t\t\t"tiddlywiki",\n\t\t\t\t\t\t\t"tiki",\n\t\t\t\t\t\t\t"xml",\n\t\t\t\t\t\t\t"mediawiki",\n\t\t\t\t\t\t\t"mw-tag-nowiki",\n\t\t\t\t\t\t\t"mw-tag-pre",\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tconst modes = Object.keys(CodeMirror.modes);\n\t\t\t\t\t\tconst isTextMode = modes.every(mode => TEXT_MODES.includes(mode));\n\t\t\t\t\t\tdocument.body.dataset.${t} = isTextMode;\n\t\t\t\t\t} catch(e) { }\n\t\t\t\t`);const s=n.body.dataset[t]||"";if(n.body.dataset[t]="",location.hostname.endsWith("epd.de"))return!0;if("true"===s)return!0;if("false"===s)return!1;const r=e.closest(l.EDITOR_CONTAINER_SELECTOR);return!!r&&(!Array.from(r.classList).some((e=>e.startsWith("cm-s")&&"cm-s-default"!==e))&&!(0,a.contains)(r,this.LINE_NUMBERS_SELECTOR))}static hasFocus(e){return this.isEditor(e)}constructor(e){this._inputArea=e}_isEditorRTL(){return this._inputArea.matches(l.RTL_EDITOR_SELECTOR)}getInputAreaWrapperKeyboardEventTarget(){return l._isTextAreaEditor(this._inputArea)?this._inputArea.closest(l.EDITOR_CONTAINER_SELECTOR)||this._inputArea:(l._isCEElementEditor(this._inputArea),this._inputArea)}getScrollContainer(){return this._inputArea.closest(l.EDITOR_SCROLL_CONTAINER_SELECTOR)}addScrollEventListener(e){const t=this.getScrollContainer();t?.addEventListener("scroll",e)}removeScrollEventListener(e){const t=this.getScrollContainer();t?.removeEventListener("scroll",e)}getInputAreaWrapper(e,t){return l._isTextAreaEditor(this._inputArea)?new i.CodeMirror5TextAreaEditorWrapper(this._inputArea,e,t):l._isCEElementEditor(this._inputArea)?new r.CodeMirror5CEElementEditorWrapper(this._inputArea,e,t):new s.CEElementWrapper(this._inputArea,e,t)}getToolbarPosition(e,t,n,s,r){const i=(0,a.closestElement)(this._inputArea,l.EDITOR_CONTAINER_SELECTOR),o=this._isEditorRTL(),c=e.getPosition(i,t,n,s,o,r);return c?(c.top&&(c.top=function(e,t){const n=parseInt(e);if(isNaN(n))return e;const r=t.querySelector(l.HORIZONTAL_SCROLLBAR_SELECTOR);if(!r)return e;const{height:i}=s.getBorderBox(r,!1,!1);return n-i+"px"}(c.top,i)),c.left&&(c.left=function(e,t,n){const r=parseInt(e);if(isNaN(r))return e;if(n){const n=t.querySelector(l.SIZER_SELECTOR);if(!n)return e;const i=parseInt(s.getStyle(n,"margin-left"));return isNaN(i),r+i+"px"}{const n=t.querySelector(l.VERTICAL_SCROLLBAR_SELECTOR);if(!n)return e;const{width:i}
161=s.getBorderBox(n,!1,!1);return r-i+"px"}}(c.left,i,o)),c):c}}l.EDITOR_CONTAINER_SELECTOR="div.CodeMirror",l.EDITOR_SCROLL_CONTAINER_SELECTOR="div.CodeMirror div.CodeMirror-scroll",l.EDITOR_TEXTAREA_SELECTOR="div.CodeMirror textarea",l.EDITOR_SELECTOR="div.CodeMirror div.CodeMirror-scroll div.CodeMirror-code",l.LINE_NUMBERS_SELECTOR="div.CodeMirror-gutter-wrapper",l.RTL_EDITOR_SELECTOR=".CodeMirror-rtl",l.HORIZONTAL_SCROLLBAR_SELECTOR="div.CodeMirror div.CodeMirror-hscrollbar, div.CodeMirror div.CodeMirror-simplescroll-horizontal, div.CodeMirror div.CodeMirror-overlayscroll-horizontal",l.VERTICAL_SCROLLBAR_SELECTOR="div.CodeMirror div.CodeMirror-vscrollbar, div.CodeMirror div.CodeMirror-simplescroll-vertical, div.CodeMirror div.CodeMirror-overlayscroll-vertical",l.SIZER_SELECTOR="div.CodeMirror div.CodeMirror-sizer"},
161"./common/editors/codemirror/codeMirror6Editor.ts":
162/*!********************************************************!*\
163  !*** ./common/editors/codemirror/codeMirror6Editor.ts ***!
164  \********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CodeMirror6Editor:()=>a});var s,r=n(/*! ../../../content/editors/codemirror/codeMirror6EditorWrapper */"./content/editors/codemirror/codeMirror6EditorWrapper.ts"),i=n(/*! ../../mutationObservers/filteringMutationObserver */"./common/mutationObservers/filteringMutationObserver.ts"),o=n(/*! ../../utils */"./common/utils.ts");class a{static isEditor(e){return!!e.matches(this.EDITOR_SELECTOR)&&!("true"===e.getAttribute("aria-readonly"))}static isTextMode(e){const t=["markdown"],n=e.dataset.language;if(n)return t.includes(n);if(e.querySelectorAll(s.LINE_SELECTOR).length>=10){const t=Array.from(e.querySelectorAll(this.HIGHLIGHTING_ELEMENTS_SELECTOR));for(const e of t)if(Array.from(e.classList).some((e=>e.length<3)))return!1;return!0}const r=e.closest(s.EDITOR_CONTAINER_SELECTOR);return!!r&&!(0,o.contains)(r,this.LINE_NUMBERS_SELECTOR)}static createMutationObserver(e){return new i.FilteringMutationObserver(e,this._isMutationIgnored)}constructor(e){this._inputArea=e}isElementIgnored(e){return!!e.classList.contains("cm-placeholder")||!(!e.matches(s.LINE_SELECTOR)||(e.previousElementSibling&&!e.previousElementSibling.matches(s.GAP_ELEMENT_SELECTOR)||!e.nextElementSibling?.matches(s.GAP_ELEMENT_SELECTOR))&&(e.nextElementSibling&&!e.nextElementSibling.matches(s.GAP_ELEMENT_SELECTOR)||!e.previousElementSibling?.matches(s.GAP_ELEMENT_SELECTOR)))&&this._inputArea.querySelectorAll(s.LINE_SELECTOR).length>1}getCacheInvalidationRules(e){return Object.assign({},e,{isSkippingElement:{self:{attributes:["class"]},parent:{childList:!0},sibling:{attributes:["contenteditable"]}},replacementText:{},parsedText:{self:{characterData:!0}},paragraphLastValuableNode:{self:{attributes:["id","style"],characterData:!0},ancestor:{attributes:["id","style"]},blockSibling:{attributes:["id","style"],characterData:!0},any:{attributes:["class"],childList:!0}},isBRElementRelevant:{self:{attributes:["id","style"]},ancestor:{attributes:["id","style"]},blockSibling:{attributes:["id","style"],characterData:!0},any:{attributes:["class"],childList:!0}},isParagraphNonEmpty:{self:{attributes:["id","style"]},ancestor:{attributes:["id","style"]},descendant:{attributes:[],characterData:!0},any:{attributes:["class"],childList:!0}}})}addScrollEventListener(e){const t=this.getScrollContainer();t?.addEventListener("scroll",e)}removeScrollEventListener(e){const t=this.getScrollContainer();t?.removeEventListener("scroll",e)}getInputAreaWrapper(e,t){return new r.CodeMirror6EditorWrapper(this._inputArea,e,t)}getScrollContainer(){return this._inputArea.closest(s.EDITOR_SCROLL_CONTAINER_SELECTOR)}}s=a,a.EDITOR_CONTAINER_SELECTOR="div.cm-editor",a.EDITOR_SCROLL_CONTAINER_SELECTOR="div.cm-scroller",a.EDITOR_SELECTOR="div.cm-editor div.cm-scroller div.cm-content[contenteditable=true]",a.LINE_NUMBERS_SELECTOR="div.cm-lineNumbers",a.LINE_SELECTOR="div.cm-line",a.HIGHLIGHTING_ELEMENTS_SELECTOR="div.cm-line *[class]",a.GAP_ELEMENT_SELECTOR="div[contenteditable=false][style*='height'], div.cm-gap[style*='height']",a._isMutationIgnored=e=>{const t=e.target;return!!(0,o.isElementNode)(t)&&!!(s.isEditor(t)&&"attributes"===e.type&&"style"===e.attributeName||t.matches(s.LINE_SELECTOR)&&"attributes"===e.type&&"class"===e.attributeName)}},
164"./common/editors/cue.ts":
165/*!*******************************!*\
166  !*** ./common/editors/cue.ts ***!
167  \*******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Cue:()=>r});var s=n(/*! ../../common/utils */"./common/utils.ts");class r{static isCueURL(){return location.href.includes("/cue-web")}static isCUEApp(){return!!document.querySelector("cue-app")}static isEditorPart(e){return(this.isCueURL()||this.isCUEApp())&&!(!e.hasAttribute("contenteditable")||!(0,s.closestElement)(e,this.EDITOR_SELECTOR))}static isEditor(e){return(this.isCueURL()||this.isCUEApp())&&e.matches(this.EDITOR_SELECTOR)}static getEditor(e){const t=(this.isCueURL()||this.isCUEApp())&&(0,s.closestElement)(e,this.EDITOR_SELECTOR);return t?[t]:[]}static hasFocus(e){return e.matches(":focus")||!!e.querySelector("[contenteditable]:focus")}static isElementIgnored(e){return!!this.IGNORED_TAG_NAMES.includes(e.tagName.toLowerCase())||!!(e.classList.contains("dragHandle")||e.classList.contains("paste-placeholder")||e.classList.contains("selection-fragment")||e.classList.contains("selection-drag-handle")||e.classList.contains("storyline-lock-label"))}}r.EDITOR_SELECTOR="[aria-label='editor'][role='main']",r.IGNORED_TAG_NAMES=["button","cue-insert-menu","cue-read-only-story-element-overlay","cue-read-only-storyline-overlay","cue-count-story-element-overlay","cue-inheritance-state-story-element-overlay","cue-story-element-actions-menu","cue-rte-toolbar-buttons","cue-field-editors","cue-in-use-by","cue-field-lock","cue-embed"]},
167"./common/editors/editorjs.ts":
168/*!************************************!*\
169  !*** ./common/editors/editorjs.ts ***!
170  \************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EditorJS:()=>r});var s=n(/*! ../../common/utils */"./common/utils.ts");class r{static isEditorPart(e){return!(!e.hasAttribute("contenteditable")||!(0,s.closestElement)(e,this.EDITOR_SELECTOR))}static isEditor(e){return e.matches(this.EDITOR_SELECTOR)}static getEditor(e){const t=(0,s.closestElement)(e,this.EDITOR_SELECTOR);return t?[t]:[]}static hasFocus(e){return e.matches(":focus")||!!e.querySelector("[contenteditable]:focus")}}r.EDITOR_SELECTOR=".codex-editor"},
170"./common/editors/fonto.ts":
171/*!*********************************!*\
172  !*** ./common/editors/fonto.ts ***!
173  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Fonto:()=>i});var s=n(/*! ../mutationObservers/filteringMutationObserver */"./common/mutationObservers/filteringMutationObserver.ts"),r=n(/*! ../utils */"./common/utils.ts");
174/*! (C) Copyright 2023 LanguageTooler GmbH. All rights reserved. */
175class i{static _isUneditableElement(e){let t=e;do{if(t.matches(i.EDITABLE_ELEMENT_SELECTOR))return!1;if(t.matches(i.UNEDITABLE_ELEMENT_SELECTOR))return!0;t=t.parentElement}while(t);return!0}static _hasEditableElement(e){return!!e.querySelector(i.EDITABLE_ELEMENT_SELECTOR)}static _isSubscriptElement(e){return e.matches(i.SUBSCRIPT_ELEMENT_SELECTOR)}static _isSuperscriptElement(e){return e.matches(i.SUPERSCRIPT_ELEMENT_SELECTOR)}static _isMathPhrase(e){return e.matches(i.INLINE_FRAME_ELEMENT_SELECTOR)&&(0,r.contains)(e,i.MATH_PHRASE_ICON_ELEMENT_SELECTOR)}static _isInlineCode(e){return e.matches(i.SOURCE_CODE_INLINE_ELEMENT_SELECTOR)}static _isCodeBlock(e){return e.matches(i.BLOCK_FRAME_ELEMENT_SELECTOR)&&!(0,r.contains)(e,i.BLOCK_FRAME_ELEMENT_SELECTOR)&&(0,r.contains)(e,i.SOURCE_CODE_BLOCK_TITLE_ELEMENT_SELECTOR)}static _isOrderedListItemPrefix(e){return 1===e.childElementCount&&2===e.firstElementChild.childElementCount&&e.firstElementChild.firstElementChild.matches(i.LIST_ITEM_NUMBER_ELEMENT_SELECTOR)&&i.NUMBER_REG_EXP.test(e.firstElementChild.firstElementChild.textContent||"")}static _isUnorderedListItemPrefix(e){return 1===e.childElementCount&&1===e.firstElementChild.childElementCount&&e.firstElementChild.firstElementChild.matches(i.LIST_ITEM_MARKER_ELEMENT_SELECTOR)&&i.LIST_ITEM_MARKER_CHARS.includes(e.firstElementChild.firstElementChild.textContent||"")}static _isListItemPrefix(e){return e.matches(i.LIST_ITEM_PREFIX_ELEMENT_SELECTOR)&&(i._isOrderedListItemPrefix(e)||i._isUnorderedListItemPrefix(e))}static isEditorPart(e){return!!(0,r.closestElement)(e,i.EDITOR_SELECTOR)}static getEditor(e){const t=(0,r.closestElement)(e,i.EDITOR_SELECTOR);return t?[t]:[]}static hasFocus(e){return i.isEditor(e)}static isEditor(e){return e.matches(i.EDITOR_SELECTOR)}constructor(e){this._inputArea=e}createMutationObserver(e){return new s.FilteringMutationObserver(e,i._isMutationIgnored)}isElementIgnored(e){return!((!i._isUneditableElement(e)||i._hasEditableElement(e))&&!i._isSubscriptElement(e)&&!i._isSuperscriptElement(e)&&!i._isMathPhrase(e)&&!i._isInlineCode(e)&&!i._isCodeBlock(e))}isElementListItem(e){return e.matches(i.LIST_ITEM_ELEMENT_SELECTOR)&&2===e.childElementCount&&i._isListItemPrefix(e.children[0])&&e.children[1].matches(i.LIST_ITEM_CONTENT_ELEMENT_SELECTOR)}getHighlighterTargetElement(){return this._inputArea.parentElement?.matches(i.HIGHLIGHTER_TARGET_ELEMENT_SELECTOR)?this._inputArea.parentElement:this._inputArea}getToolbarPosition(e,t,n,s,r,o,a){const l=t.querySelector(i.TOOLBAR_BOUNDARY_ELEMENT_SELECTOR)||t;return e.getPosition(l,n,s,r,o,a)}filterErrors(e){return e.filter((e=>!i.DISABLED_RULES.includes(e.rule.id)))}}i.EDITOR_SELECTOR="cv-sheet-frame[contenteditable='true']",i.EDITABLE_ELEMENT_SELECTOR="[contenteditable='true']",i.UNEDITABLE_ELEMENT_SELECTOR="[contenteditable='false']",i.SUBSCRIPT_ELEMENT_SELECTOR="cv-content[cv-baseline='subscript']",i.SUPERSCRIPT_ELEMENT_SELECTOR="cv-content[cv-baseline='superscript']",i.INLINE_FRAME_ELEMENT_SELECTOR="cv-inline-frame[cv-layout='inline']",i.BLOCK_FRAME_ELEMENT_SELECTOR="cv-frame[cv-layout='block']",i.MATH_PHRASE_ICON_ELEMENT_SELECTOR="cv-inline-before[contenteditable=false] > cv-icon-widget > cv-icon.far.fa-sigma",i.SOURCE_CODE_INLINE_ELEMENT_SELECTOR="cv-inline-frame[cv-font-stack='monospaced-content'][cv-inline-frame-background='null'][cv-inline-frame-border='null'][cv-layout='inline']",i.SOURCE_CODE_BLOCK_TITLE_ELEMENT_SELECTOR="cv-block-boundary > cv-block-body > cv-content > cv-group-with-block[cv-output-class='custom-sourcecode'] > cv-block-boundary > cv-block-header > cv-block-header-right[contenteditable='false'] > cv-inline-label-widget",i.LIST_ITEM_ELEMENT_SELECTOR="cv-block-boundary > cv-block-body",i.LIST_ITEM_PREFIX_ELEMENT_SELECTOR="cv-block-before[contenteditable='false']",i.LIST_ITEM_CONTENT_ELEMENT_SELECTOR="cv-content",i.LIST_ITEM_NUMBER_ELEMENT_SELECTOR="cv-numbering-widget > cv-number",i.LIST_ITEM_MARKER_ELEMENT_SELECTOR="cv-bulleting-widget > cv-bullet",i.NUMBER_REG_EXP=/^\d+$/,i.LIST_ITEM_MARKER_CHARS=["●","○","■"],i.HIGHLIGHTER_TARGET_ELEMENT_SELECTOR="fx-templated-view-content",i.TOOLBAR_BOUNDARY_ELEMENT_SELECTOR="cv-block-boundary",i.DISABLED_RULES=["GERMAN_QUOTES"],i._isMutationIgnored=e=>"attributes"===e.type&&"class"===e.attributeName},
175"./common/editors/google/googleEditor.ts":
176/*!***********************************************!*\
177  !*** ./common/editors/google/googleEditor.ts ***!
178  \***********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{GoogleEditor:()=>c});var s=n(/*! ../../browserDetector */"./common/browserDetector.ts"),r=n(/*! ../../utils */"./common/utils.ts"),i=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),o=n(/*! ../../../init/config */"./init/config.ts"),a=n(/*! ../../i18nManager */"./common/i18nManager.ts");const l=o.default.get(o.ConfigKey.EXTN_PREFIX);class c{static _escapeWhitespaces(e){if(!e)return e;const t=e=>" ".repeat(e.length);return s.BrowserDetector.isFirefox()&&(e=e.replace(/(^ +)|( +$)/gm,t)),e=e.replace(/ {2,}/g,t)}static getIframeWindow(){const e=document.querySelector(".docs-texteventtarget-iframe");return e&&e.contentWindow||null}static getIframeContentEditable(){const e=this.getIframeWindow();return e?e.document.querySelector("[contenteditable=true]"):null}static async insertText({html:e,text:t}){const n=this.getIframeWindow();if(!n)return Promise.reject();const i=this.getIframeContentEditable();if(!i)return Promise.reject();if(""===t)return this.simulateBackspaceKey(),void await(0,r.wait)(50);e=this._escapeWhitespaces(e),t=this._escapeWhitespaces(t);const o=s.BrowserDetector.isChromium()||s.BrowserDetector.isFirefox();if(t.trim()&&o)return void await(0,r.insertHtmlByPaste)(i,{"text/html":e||t,"text/plain":t},void 0,50);const a=this._splitTextInLines(t);for(const e of a)if("\n"!==e){if((0,r.simulatePaste)(i,{"text/plain":e}))if(o)n.document.execCommand("insertText",!1,e);else{const t=e.replace(/^\s/," ").replace(/\s$/," ");i.textContent=t;const s=new n.InputEvent("input",{bubbles:!0,cancelable:!1,inputType:"insertTextFromPaste",data:t});i.dispatchEvent(s)}await(0,r.wait)(50)}else this.simulateEnterKey(),await(0,r.wait)(50)}static simulateEscapeKey(){const e={key:"Escape",keyCode:27,which:27,code:"Escape",bubbles:!0,cancelable:!0};document.dispatchEvent(new KeyboardEvent("keydown",e)),document.dispatchEvent(new KeyboardEvent("keyup",e))}static simulateBackspaceKey(){const e=this.getIframeWindow();if(!e)return Promise.reject();const t=this.getIframeContentEditable();if(!t)return Promise.reject();const n=new e.KeyboardEvent("keydown",{key:"Backspace",keyCode:8,which:8,code:"Backspace",bubbles:!0,cancelable:!0});t.dispatchEvent(n)}static simulateArrowRightKey(){const e=this.getIframeWindow();if(!e)return Promise.reject();const t=this.getIframeContentEditable();if(!t)return Promise.reject();const n={key:"ArrowRight",keyCode:39,which:39,code:"ArrowRight",bubbles:!0,cancelable:!0,detail:1337};t.dispatchEvent(new e.KeyboardEvent("keydown",n)),t.dispatchEvent(new e.KeyboardEvent("keyup",n))}static simulateEnterKey(){const e=this.getIframeWindow();if(!e)return Promise.reject();const t=this.getIframeContentEditable();if(!t)return Promise.reject();const n={bubbles:!0,cancelable:!0,code:"Enter",key:"Enter",charCode:0,detail:0,location:0,keyCode:13,which:13};if(!t.dispatchEvent(new e.KeyboardEvent("keydown",n)))return!1;const s={...n,charCode:13};return t.dispatchEvent(new e.KeyboardEvent("keypress",s))}static _splitTextInLines(e){const t=[];return e.split("\n").forEach(((e,n,s)=>{e&&t.push(e),n+1<s.length&&t.push("\n")})),t}static _renderContextMenuItem(e){if(!o.default.get(o.ConfigKey.GDOCS_MENU_BUTTONS))return;if(this._removeContextMenuItem(),!e.querySelector(".docs-icon-editors-ia-accessibility-person, .docs-icon-editors-ia-dictionary, .docs-icon-editors-ia-link"))return;const t=e.querySelector(".goog-menuitem.apps-menuitem:not([aria-hidden=true]):not([aria-disabled=true])"),n=e.querySelector(".goog-menuitem.apps-menuitem:not([aria-hidden=true]) ~ .apps-hoverable-menu-separator-container:not([aria-hidden=true])")||e.querySelector(".goog-menuitem.apps-menuitem:not([aria-hidden=true]) ~ .goog-menuseparator:not([aria-hidden=true])");if(!n||!t)return;const s=n.cloneNode(!0);s.removeAttribute("id"),s.setAttribute(this.MENUITEM_ATTRIBUTE,"separator");const i=t.cloneNode(!0);i.removeAttribute("id"),i.setAttribute(this.MENUITEM_ATTRIBUTE,"toolbox");const c=i.querySelector(".goog-menuitem-label");if(!c)return;const d=i.querySelector(".goog-menuitem-icon"),h=i.querySelector(".docs-icon-img");if(!h||!d)return;h.remove(),d.classList.add(`${l}-gdocs-menuitem-icon`);const u=()=>i.classList.add("goog-menuitem-highlight"),g=()=>i.classList.remove("goog-menuitem-highlight","goog-menuitem-active"),m=()=>i.classList.add("goog-menuitem-active"),p=()=>i.classList.remove("goog-menuitem-active"),_=()=>{this.simulateEscapeKey(),(0,r.dispatchCustomEvent)(document,this.eventNames.contextMenuItemClicked)};i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",g),i.addEventListener("mousedown",m),i.addEventListener("mouseup",p),i.addEventListener("click",_),this._unbindContextMenuEventListeners=()=>{i.removeEventListener("mouseenter",u),i.removeEventListener("mouseleave",g),i.removeEventListener("mousedown",m),i.removeEventListener("mouseup",p),i.removeEventListener("click",_)},c.textContent=a.i18nManager.getMessage("toolboxTooltip");const E=i.querySelector(".goog-menuitem-accel");E?.remove(),n.parentNode.insertBefore(s,n),n.parentNode.insertBefore(i,n)}static _removeContextMenuItem(){document.querySelectorAll(`[${this.MENUITEM_ATTRIBUTE}='toolbox'], [${this.MENUITEM_ATTRIBUTE}='separator']`).forEach((e=>{e.remove()})),this._unbindContextMenuEventListeners?.(),this._unbindContextMenuEventListeners=void 0}static async insertImage(e){if(!Object.keys(e).find((e=>e.startsWith("image/"))))throw new Error("Expected to get an image to paste; but not find one.");const t=this.getIframeContentEditable();if(!t)return Promise.reject();await(0,i.simulatePasteImage)(t,e)||await this.insertText({text:e["text/plain"]})}}c.eventNames={contextMenuItemClicked:`${l}-gdocs.toolboxItemClicked`},c.MENUITEM_ATTRIBUTE=`data-${l}-menuitem`,c._unbindContextMenuEventListeners=void 0},
178"./common/editors/google/utils.ts":
179/*!****************************************!*\
180  !*** ./common/editors/google/utils.ts ***!
181  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{getKixSelectionRectsForBlueCaret:()=>i});const s={r:79,g:148,b:252},r={r:118,g:167,b:250};function i(e){return e.length&&e[0]?e.filter((e=>function(e){const t=e.getAttribute("fill");return!!t&&function(e){if(!e)return!1;const t=e.replace(/\s+/g," ").match(/rgba?\(([\d\s,./]+)\)/i);if(!t||t.length<2)return!1;const n=t[1].trim().split(/[,\s/]+/).map(Number).filter((e=>!Number.isNaN(e))),[i,o,a]=n,{r:l,g:c,b:d}=s,{r:h,g:u,b:g}=r;return i===l&&o===c&&a===d||i===h&&o===u&&a===g}(t)}(e))):[]}},
181"./common/editors/gutenberg.ts":
182/*!*************************************!*\
183  !*** ./common/editors/gutenberg.ts ***!
184  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Gutenberg:()=>i});var s=n(/*! ../../content/ceElementInspector */"./content/ceElementInspector.ts"),r=n(/*! ../utils */"./common/utils.ts");
185/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
186class i{static _isEditableElement(e){return!(e.matches(this.UNEDITABLE_ELEMENT_SELECTOR)&&!(0,r.contains)(e,this.EDITABLE_ELEMENT_SELECTOR))}static _isIgnoredWidget(e){return!!this.UNEDITABLE_WIDGET_SELECTORS.some((t=>e.matches(t)))||!(!this.WIDGET_WITH_PLACEHOLDER_SELECTORS.some((t=>e.matches(t)))||!e.querySelector(this.PLACEHOLDER_SELECTOR))}static isEditorPart(e){return!!(0,r.closestElement)(e,this.EDITOR_SELECTOR)}static isEditor(e){return e.matches(this.EDITOR_SELECTOR)}static getEditor(e){const t=(0,r.closestElement)(e,this.EDITOR_SELECTOR);return t?[t]:[]}static hasFocus(e){return i.isEditor(e)}static isElementIgnored(e,t){const n=e.tagName.toUpperCase();return!!s.CEElementInspector.SKIPPING_TAGS.includes(n)||"none"===t.display||!this._isEditableElement(e)||!!e.matches(this.MEDIA_PLACEHOLDER_SELECTOR)||!!e.matches(this.TINY_MCE_TOOLBAR_SELECTOR)||!!this._isIgnoredWidget(e)||!("SUP"!==n||!e.textContent)&&s.CEElementInspector.SUP_REGEXP.test(e.textContent.trim())}static isElementEditable(e){return this._isEditableElement(e)}}i.EDITOR_SELECTOR=".block-editor-writing-flow, .block-editor-iframe__body",i.UNEDITABLE_ELEMENT_SELECTOR="[contenteditable='false']",i.EDITABLE_ELEMENT_SELECTOR="[contenteditable='true']",i.MEDIA_PLACEHOLDER_SELECTOR="div.block-editor-media-placeholder",i.TINY_MCE_TOOLBAR_SELECTOR=".block-library-classic__toolbar",i.UNEDITABLE_WIDGET_SELECTORS=["div[data-type='core/nextpage']","div[data-type='core/archives']","div[data-type='core/calendar']","div[data-type='core/categories']","div[data-type='core/html']","div[data-type='core/latest-comments']","ul[data-type='core/latest-posts']","ul[data-type='core/page-list']","div[data-type='core/rss']","div[data-type='core/search']","div[data-type='core/shortcode']","ul[data-type='core/social-links']","div[data-type='core/tag-cloud']","nav[data-type='core/navigation']","div[data-type='core/site-logo']","h1[data-type='core/site-title']","div[data-type='core/query']","div[data-type='core/avatar']","figure[data-type='core/image']","h2[data-type='core/post-title']","figure[data-type='core/post-featured-image']","div[data-type='core/post-content']","div[data-type='core/post-author']","div[data-type='core/comments-query-loop']","div[data-type='core/loginout']","div[data-type='core/term-description']","h1[data-type='core/query-title']","div[data-type='core/post-author-biography']","div[data-type='core/post-author-name']","div[data-type='core/post-comments-count']","div[data-type='core/post-comments-form']","div[data-type='core/post-comments-link']"],i.WIDGET_WITH_PLACEHOLDER_SELECTORS=["div[data-type='core/post-excerpt'] > p.wp-block-post-excerpt__more-text","div[data-type='core/post-navigation-link']","a[data-type='core/read-more']"],i.PLACEHOLDER_SELECTOR="[data-rich-text-placeholder]"},
186"./common/editors/livingDocs.ts":
187/*!**************************************!*\
188  !*** ./common/editors/livingDocs.ts ***!
189  \**************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LivingDocs:()=>i});var s=n(/*! ../../content/ceElementInspector */"./content/ceElementInspector.ts"),r=n(/*! ../utils */"./common/utils.ts");class i{static isEditorPart(e){return!!(0,r.closestElement)(e,"[doc-component]")}static getEditor(e){if(this.isIframe(e))return[e.ownerDocument.body];const t=(0,r.closestElement)(e,i.EDITOR_SELECTOR);return t?[t]:[]}static isEditor(e){return this.isIframe(e)?e===e.ownerDocument.body:e.matches(i.EDITOR_SELECTOR)}static hasFocus(e){return i.isEditor(e)}static isElementIgnored(e,t){const n=e.getAttribute("doc-component")||"";if(this.IGNORED_COMPONENTS.includes(n)||n.includes("oembed"))return!0;const r=e.tagName.toUpperCase();return!!s.CEElementInspector.SKIPPING_TAGS.includes(r)||"none"===t.display}static isIframe(e){return location.href.startsWith("about:srcdoc")&&self!==self.top&&!!e.ownerDocument.querySelector(".doc-section")}}i.EDITOR_SELECTOR="article[doc-component='article-container']",i.IGNORED_COMPONENTS=["image","lead-media","audio-reference","related-articles-list","reference-list","video-reference","fotoshow-reference"]},
189"./common/editors/proseMirror.ts":
190/*!***************************************!*\
191  !*** ./common/editors/proseMirror.ts ***!
192  \***************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ProseMirror:()=>o});var s=n(/*! ../../config/config */"./config/config.ts"),r=n(/*! ../../content/ceElementInspector */"./content/ceElementInspector.ts"),i=n(/*! ../mutationObservers/filteringMutationObserver */"./common/mutationObservers/filteringMutationObserver.ts");
193/*! (C) Copyright 2023 LanguageTooler GmbH. All rights reserved. */
194class o{static _isMutationIgnored(e,t){return t.target===e&&"attributes"===t.type&&"class"===t.attributeName}static isEditor(e){return e.matches(o.EDITOR_SELECTOR)}static createMutationObserver(e,t){return new i.FilteringMutationObserver(t,(t=>o._isMutationIgnored(e,t)))}static _isDragHandler(e){return"block-ctrl-decorator-widget"===e.getAttribute("data-testid")||"true"===e.getAttribute("data-blocks-drag-handle-container")}static _isZeroWidthWidget(e){return e instanceof HTMLElement&&e.className.includes("ProseMirror-widget")&&0===e.offsetWidth}static _isUserMention(e){return e.hasAttribute("data-mention-id")||e.hasAttribute("usertype")||"mention"===e.getAttribute("data-prosemirror-node-name")}static getReplacementText(e,t){return t&&(this._isDragHandler(e)||this._isZeroWidthWidget(e))?"":t&&this._isUserMention(e)?s.INVISIBLE_SEPARATOR:null}static isElementIgnored(e,t){const n=e.tagName.toUpperCase();return!!r.CEElementInspector.SKIPPING_TAGS.includes(n)||"BLOCKQUOTE"===n||"none"===t.display||("false"===e.getAttribute("contenteditable")||"false"===e.getAttribute("spellcheck")?!(!this._isUserMention(e)&&(e.classList.contains("prosemirror-tag-node")||!e.className.includes("placeholder")&&!this._isDragHandler(e)&&!this._isZeroWidthWidget(e)&&e instanceof HTMLElement&&"inline"===t.display&&(!e.firstElementChild||1===e.childElementCount&&e.offsetWidth>0))):!("SUP"!==n||!e.textContent)&&r.CEElementInspector.SUP_REGEXP.test(e.textContent.trim()))}static getDelayBeforeInsertingText(){return 10}}o.EDITOR_SELECTOR=".ProseMirror"},
194"./common/editors/selectionManager.ts":
195/*!********************************************!*\
196  !*** ./common/editors/selectionManager.ts ***!
197  \********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{addSelectionEventCE:()=>a,addSelectionEventGdocs:()=>o});var s=n(/*! ../browserDetector */"./common/browserDetector.ts"),r=n(/*! ../utils */"./common/utils.ts");const i=(e,t,n)=>{let r=!1;const i="Backspace"===e&&"Chrome"===s.BrowserDetector.getBrowserName(),o="a"===e&&"Mac"===s.BrowserDetector.getOS()?t:n;return(i||o)&&(r=!0),r};function o(e,t){const n=new MutationObserver((e=>{e.some((e=>!("childList"!==e.type||"SVG"!==e.target.nodeName.toUpperCase()||!e.target.parentElement?.classList.contains("kix-canvas-tile-selection"))))&&t()}));return n.observe(e,{attributes:!0,childList:!0,subtree:!0}),{destroy:()=>{n.disconnect()}}}function a(e,t){const n=()=>{const n=e.ownerDocument,s=(0,r.getActiveElement)(n);s&&(e===s||e.contains(s))&&t()},s=e=>{i(e.key,e.metaKey,e.ctrlKey)&&t(e)};return e.ownerDocument.addEventListener("selectionchange",n,!0),e.addEventListener("keydown",s,!0),{destroy:()=>{e.ownerDocument.removeEventListener("selectionchange",n,!0),e.removeEventListener("keydown",s,!0)}}}},
197"./common/environmentAdapter.ts":
198/*!**************************************!*\
199  !*** ./common/environmentAdapter.ts ***!
200  \**************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EnvironmentAdapter:()=>d,EnvironmentAdapterBaseClass:()=>c});var s=n(/*! ../core/context/utils */"./core/context/utils.ts"),r=n(/*! ../init/config */"./init/config.ts"),i=n(/*! ./writtingSession */"./common/writtingSession.ts"),o=n(/*! ../core/utils */"./core/utils.ts");
201/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
202const a=r.default.get(r.ConfigKey.EXTN_PREFIX);function l(e,t,n){const s=new CustomEvent(t,{detail:n,cancelable:!0});return e.dispatchEvent(s)}class c{}c.eventNames={sentenceRangesChecked:`${a}-environmentAdapter.sentenceRangesChecked`,incrementalCheckResponseReceived:`${a}-environmentAdapter.incrementalCheckResponseReceived`};const d=class{static _onMessage(e){switch(!0){case"sentence-splitter-response"===e.command:{const{checkTimestamp:t,sentenceRangesCheckedText:n,sentenceRangesCheckResult:s,sentenceRanges:r}=e.payload;return this.updateSentenceRanges(n,s,t,r),Promise.resolve()}case"reintialize-writing-session"===e.command:{const{sessionId:t}=e.payload;return t?i.WrittingSession.getInstance((0,o.getCurrentUrl)()).reIntializeWritingSession(t):Promise.reject("writing session not found")}case e.command===s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_SYNC_ACK:{const{payload:t}=e;return this.onEditorStateSyncAck(t),Promise.resolve()}case e.command===s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_FORCE_SYNC:{const{payload:t}=e;return this.onEditorStateForceSync(t),Promise.resolve()}case e.command===s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC:{const{payload:t}=e;return this.onEditorSurroundingContextForceSync(t),Promise.resolve()}case"incremental-check-response"===e.command:{const{currentCheckedText:t,data:n,instanceId:s,paragraph:r,previousCheckedText:i}=e.payload;return this.incrementalCheck(s,n,t,i,r),Promise.resolve()}}}static init(e){this._instance?this._instance=e:(this._instance=e,this.addEventListener())}static onEditorStateForceSync(e){l(document,s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_FORCE_SYNC,e)}static onEditorSurroundingContextForceSync(e){l(document,s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC,e)}static onEditorStateSyncAck(e){l(document,s.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_SYNC_ACK,e)}static isProductionEnvironment(){return this._instance.isProductionEnvironment()}static addEventListener(){return this._instance.addEventListener((e=>this._onMessage(e)))}static isRuntimeConnected(){return this._instance.isRuntimeConnected()}static getVersion(){return this._instance.getVersion()}static getTrackingId(){return this._instance.getTrackingId()}static getPinnedState(){return this._instance.getPinnedState()}static shouldTrack(){return this._instance.shouldTrack()}static getType(){return this._instance.getType()}static getBeforeUnloadEventName(){return this._instance.getBeforeUnloadEventName()}static getURL(e){return this._instance.getURL(e)}static getUILanguageCode(){return this._instance.getUILanguageCode()}static openWindow(e){return this._instance.openWindow(e)}static canLoadContentScripts(e){return this._instance.canLoadContentScripts(e)}static loadContentScripts(e,t){return this._instance.loadContentScripts(e,t)}static loadStylesheets(e,t){return this._instance.loadStylesheets(e,t)}static injectShadowStyles(e){return this._instance.injectShadowStyles(e)}static initializeLTAssistant(e,t={}){return this._instance.initializeLTAssistant(e,t)}static getPreferredLanguages(){return this._instance.getPreferredLanguages()}static startDictionarySync(){return this._instance.startDictionarySync()}static addWordToDictionary(e){return this._instance.addWordToDictionary(e)}static addWordsToDictionary(e){return this._instance.addWordsToDictionary(e)}static removeWordFromDictionary(e){return this._instance.removeWordFromDictionary(e)}static clearDictionary(){return this._instance.clearDictionary()}static updateDictionary(){return this._instance.updateDictionary()}static updateSentenceRanges(e,t,n,s){this._instance.updateSentenceRanges(e,t,n,s)}static incrementalCheck(e,t,n,s,r){this._instance.incrementalCheck(e,t,n,s,r)}static injectExecutor(){return this._instance.injectExecutor()}static destroyExecutor(){return this._instance.destroyExecutor()}static executeScript(e,t){return this._instance.executeScript(e,t)}static linkInputAreaProperties(e){return this._instance.linkInputAreaProperties(e)}static ping(){return this._instance.ping()}static loadSynonyms(e,t,n){return this._instance.loadSynonyms(e,t,n)}static abortSynonymsRequest(){return this._instance.abortSynonymsRequest()}static loadPhrases(e,t,n,s,r,i){return this._instance.loadPhrases(e,t,n,s,r,i)}static initializeUserActivity(e){return this._instance.initializeUserActivity(e)}static sendUserActivityPings(e){return this._instance.sendUserActivityPings(e)}static updateUserActivityTextStatistics(e,t){return this._instance.updateUserActivityTextStatistics(e,t)}static updateUserActivityAppliedSuggestions(e,t,n){return this._instance.updateUserActivityAppliedSuggestions(e,t,n)}static updateUserActivityAppliedRewritings(e){return this._instance.updateUserActivityAppliedRewritings(e)}static updateUserActivityMeta(e,t){return this._instance.updateUserActivityMeta(e,t)}static sendUserActivity(e){return this._instance.sendUserActivity(e)}static destroyUserActivity(e){return this._instance.destroyUserActivity(e)}static abortPhraseRequests(e){return this._instance.abortPhraseRequests(e)}static abortTranslateRequest(e){this._instance.abortTranslateRequest(e)}static abortGenerateImageRequest(e){return this._instance.abortGenerateImageRequest(e)}static loadSplitSentence(e,t,n,s,r){return this._instance.loadSplitSentence(e,t,n,s,r)}static trackEvent(e,t){return this._instance.trackEvent(e,t)}static pageLoaded(e,t,n,s,r){return this._instance.pageLoaded(e,t,n,s,r)}static ltAssistantStatusChanged(e,t){return"number"==typeof e?this._instance.ltAssistantStatusChanged(e,t):this._instance.ltAssistantStatusChanged(e)}static check(e,t,n,s,r,i,o,a,l){return this._instance.check(e,t,n,s,r,i,o,a,l)}static createWritingSession(e,t){return this._instance.createWritingSession(e,t)}static fetchRecommendationForSentence(e){return this._instance.fetchRecommendationForSentence(e)}static unlockRecommendation(e){return this._instance.unlockRecommendation(e)}static translateText(e){return this._instance.translateText(e)}static generateImage(e){return this._instance.generateImage(e)}static isOptionsPageSupported(){return this._instance.isOptionsPageSupported()}static openOptionsPage(e,t){return this._instance.openOptionsPage(e,t)}static isFeedbackFormSupported(){return this._instance.isFeedbackFormSupported()}static openFeedbackForm(e,t,n){return this._instance.openFeedbackForm(e,t,n)}static openPremiumPage(e,t=0,n=0,s=0,r="",i){return this._instance.openPremiumPage(e,t,n,s,r,i)}static updateSurroundingTextContext(e){return this._instance.updateSurroundingTextContext(e)}static forceSyncEditorState(e){return this._instance.forceSyncEditorState(e)}static checkForPaidSubscription(){return this._instance.checkForPaidSubscription()}static canUseShadowDom(){return this._instance.canUseShadowDom()}static abortAllRequests(e){return this._instance.abortAllRequests(e)}static getTermsOfServiceInfo(e){return this._instance.getTermsOfServiceInfo(e)}static acceptTermsOfService(e){return this._instance.acceptTermsOfService(e)}static syncUserData(){return this._instance.syncUserData()}}},
202"./common/eventBus.ts":
203/*!****************************!*\
204  !*** ./common/eventBus.ts ***!
205  \****************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventBus:()=>s});
206/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
207class s{constructor(){this._eventHandlers=new Map}subscribe(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,[]),this._eventHandlers.get(e).push(t)}unsubscribe(e,t){const n=this._eventHandlers.get(e)?.indexOf(t)??-1;n>-1&&(this._eventHandlers.get(e).splice(n,1),this._eventHandlers.get(e).length||this._eventHandlers.delete(e))}fire(e,t){const n=this._eventHandlers.get(e);n&&n.forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}destroy(){this._eventHandlers.clear()}}},
207"./common/getBlogUrl.ts":
208/*!******************************!*\
209  !*** ./common/getBlogUrl.ts ***!
210  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),r=n(/*! ./languageManager */"./common/languageManager.ts");const i={"post/premium-vs-free-product-updates/":{de:"de/beitrag/produkt-premium-kostenlos/",fr:"fr/poste/premium/"}},o=Object.prototype.hasOwnProperty;function a(e,t){if(!o.call(i,e))throw new Error(`The blog post "${e}" does not exist.`);const n=r.LanguageManager.getPrimaryLanguageCode(t??s.EnvironmentAdapter.getUILanguageCode()),a=o.call(i[e],n)?i[e][n]:e;return new URL(`/insights/${a}`,"https://languagetool.org").toString()}},
210"./common/getExtensionAPI.ts":
211/*!***********************************!*\
212  !*** ./common/getExtensionAPI.ts ***!
213  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{getExtensionAPI:()=>i});var s=n(/*! webextension-polyfill */"?bb06"),r=n.n(s);function i(){return r()}},
213"./common/i18nManager.ts":
214/*!*******************************!*\
215  !*** ./common/i18nManager.ts ***!
216  \*******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{i18nManager:()=>l,i18nManagerBaseClass:()=>a});var s,r=n(/*! ../init/config */"./init/config.ts"),i=function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})};
217/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
218const o=r.default.get(r.ConfigKey.EXTN_PREFIX);class a{}a.eventNames={localeChanged:`${o}-i18nManager.localeChanged`};const l=(i(s=class{static init(e){this._instance=e}static addEventListener(e,t){this._instance.addEventListener(e,t)}static setLocale(e){this._instance.setLocale(e)}static getMessage(e,t){return this._instance.getMessage(e,t)}static getLanguageNameForCode(e){return this.getMessage(this._languageCodeToTranslationKeyMap[e])}},"i18nManager"),s._languageCodeToTranslationKeyMap={ar:"ar",ast:"ast","ast-es":"ast",be:"be","be-by":"be",br:"br","br-fr":"br",ca:"ca","ca-es":"ca","ca-es-valencia":"ca_ES_valencia","crh-ua":"crh","da-dk":"da_DK",de:"de","de-at":"de_AT","de-ch":"de_CH","de-de":"de_DE",el:"el","el-gr":"el",en:"en","en-au":"en_AU","en-ca":"en_CA","en-gb":"en_GB","en-nz":"en_NZ","en-us":"en_US","en-za":"en_ZA",eo:"eo",es:"es","es-es":"es",fa:"fa",ga:"ga","ga-ie":"ga",fr:"fr","fr-fr":"fr",gl:"gl","gl-es":"gl",it:"it",ja:"ja","ja-jp":"ja",km:"km","km-kh":"km",nl:"nl",no:"no",pl:"pl","pl-pl":"pl",pt:"pt","pt-ao":"pt_AO","pt-br":"pt_BR","pt-mz":"pt_MZ","pt-pt":"pt_PT",ro:"ro","ro-ro":"ro","ru-ru":"ru",sk:"sk","sk-sk":"sk",sl:"sl","sl-si":"sl",sv:"sv",ta:"ta","ta-in":"ta",tl:"tl","tl-ph":"tl",uk:"uk","uk-ua":"uk",zh:"zh","zh-cn":"zh"},s)},
218"./common/languageManager.ts":
219/*!***********************************!*\
220  !*** ./common/languageManager.ts ***!
221  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LanguageManager:()=>l});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/utils */"./core/utils.ts"),i=n(/*! ../init/config */"./init/config.ts"),o=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),a=n(/*! ./i18nManager */"./common/i18nManager.ts");
222/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
223class l{static get SUPPORTED_LANGUAGES(){return this._supportedLanguages||(this._supportedLanguages=i.default.get(i.ConfigKey.SUPPORTED_LANGUAGES).map((e=>({code:e,name:a.i18nManager.getLanguageNameForCode(e)}))),this._supportedLanguages.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),this._isSubscribed||(a.i18nManager.addEventListener(a.i18nManagerBaseClass.eventNames.localeChanged,(()=>this._supportedLanguages=null)),this._isSubscribed=!0)),this._supportedLanguages}static isLanguageVariant(e){return e.code.includes("-")}static getPrimaryLanguageCode(e){return e.split("-")[0]}static formatLanguageCode(e){const t=e.split("-");return 1===t.length?t[0]:2===t.length?t[0]+"-"+t[1].toUpperCase():t[0]+"-"+t[1].toUpperCase()+"-"+t[2]}static getUserLanguageCode(){for(const e of navigator.languages)if(e.includes("-")&&e.startsWith(navigator.language))return e;return navigator.language}static getUserLanguageCodes(){const e=Array.from(navigator.languages,(e=>this.getPrimaryLanguageCode(e).toLowerCase()));try{e.push(this.getPrimaryLanguageCode(o.EnvironmentAdapter.getUILanguageCode()).toLowerCase())}catch(e){}return(0,r.uniq)(e)}static getPreferredLanguageVariant(e){const t={"en-in":"en-us","en-ie":"en-gb"},n=navigator.languages||[];for(let s of n){s=s.toLowerCase(),s=t[s]||s;for(const t of e){const e=t.toLowerCase();if(s.length>2&&s===e)return t}}return null}static getLanguagesForGeoIPCountry(){return new Promise((function(e,t){let n=!1;const s=self.setTimeout((()=>{n=!0,t(new Error("geoip timeout"))}),15e3);fetch("https://languagetool.org/webextension/init",{method:"GET",mode:"cors",referrerPolicy:"no-referrer",headers:{Accept:"application/json"}}).then((e=>e.json())).then((t=>{if(!n){const n=(t.geoIpCountry||"").toUpperCase();e({geoIpLanguages:t.geoIpLanguages||[],geoIpCountry:n}),clearTimeout(s)}})).catch((e=>{console.error(e),n||(t(e),clearTimeout(s))}))}))}static getSynonymsRequestLanguage(e){let t=this.getPrimaryLanguageCode(e);return"de-ch"===e.toLowerCase()?t="de-CH":"pt-br"===e.toLowerCase()&&(t="pt-BR"),s.SUPPORTED_SYNONYM_LANGUAGES.includes(t)?t:null}}l._supportedLanguages=null,l._isSubscribed=!1,l.ALL_LANGUAGES=[{code:"af",name:"Afrikaans"},{code:"ak",name:"Akan"},{code:"am",name:"አማርኛ"},{code:"an",name:"aragonés"},{code:"ar",name:"عربي"},{code:"as",name:"অসমীয়া"},{code:"ast",name:"Asturianu"},{code:"be",name:"Беларуская"},{code:"bg",name:"Български"},{code:"bm",name:"Bamanankan"},{code:"bn",name:"বাংলা"},{code:"br",name:"Brezhoneg"},{code:"bs",name:"босански"},{code:"ca",name:"Català"},{code:"cs",name:"čeština"},{code:"cy",name:"Cymraeg"},{code:"da",name:"Dansk"},{code:"de",name:"Deutsch"},{code:"el",name:"Ελληνικά"},{code:"en",name:"English"},{code:"eo",name:"Esperanto"},{code:"es",name:"Español"},{code:"et",name:"Eesti keel"},{code:"eu",name:"Euskara"},{code:"fa",name:"فارسی"},{code:"fi",name:"suomi"},{code:"fj",name:"Vosa vaka-Viti"},{code:"fr",name:"Français"},{code:"ga",name:"Gaeilge"},{code:"gd",name:"Gàidhlig"},{code:"gl",name:"Galego"},{code:"gn",name:"Avañe'ẽ"},{code:"gu",name:"ગુજરાતી"},{code:"ha",name:"هَرْشَن هَوْسَ‎"},{code:"he",name:"עברית"},{code:"hi",name:"हिन्दी"},{code:"hr",name:"hrvatski"},{code:"hu",name:"magyar"},{code:"hy",name:"Հայերեն"},{code:"ia",name:"Interlingua"},{code:"id",name:"Bahasa Indonesia"},{code:"ig",name:"Ásụ̀sụ̀ Ìgbò"},{code:"is",name:"íslenska"},{code:"it",name:"Italiano"},{code:"ja",name:"日本語"},{code:"kk",name:"Қазақ"},{code:"km",name:"ខ្មែរ"},{code:"kn",name:"ಕನ್ನಡ"},{code:"ko",name:"한국어"},{code:"ku",name:"Kurdî"},{code:"ks",name:"كشمیری"},{code:"la",name:"Latina"},{code:"lg",name:"Luganda"},{code:"lo",name:"ພາສາລາວ"},{code:"lt",name:"Lietuvių"},{code:"lv",name:"Latviešu"},{code:"mg",name:"malagasy"},{code:"mi",name:"Māori"},{code:"ml",name:"മലയാളം"},{code:"mk",name:"Македонски"},{code:"mn",name:"Монгол"},{code:"mr",name:"मराठी"},{code:"ms",name:"Melayu"},{code:"my",name:"မြန်မာဘာသာ"},{code:"nb",name:"Norsk bokmål"},{code:"ne",name:"नेपाली"},{code:"nn",name:"Norsk nynorsk"},{code:"no",name:"Norsk"},{code:"nl",name:"Nederlands"},{code:"nr",name:"isiNdebele"},{code:"oc",name:"Occitano"},{code:"or",name:"ଓଡ଼ିଆ"},{code:"pa",name:"ਪੰਜਾਬੀ"},{code:"pl",name:"Polski"},{code:"ps",name:"پښتو"},{code:"pt",name:"Português"},{code:"rm",name:"rumantsch"},{code:"ro",name:"românesc"},{code:"ru",name:"Русский"},{code:"rw",name:"Ikinyarwanda"},{code:"sa",name:"संस्कृत"}
223,{code:"si",name:"සිංහල"},{code:"sk",name:"slovenčina"},{code:"sl",name:"Slovenščina"},{code:"so",name:"Soomaali"},{code:"sr",name:"Српски"},{code:"ss",name:"siSwati"},{code:"st",name:"Sesotho"},{code:"sv",name:"Svenska"},{code:"ta",name:"தமிழ்"},{code:"te",name:"తెలుగు"},{code:"th",name:"ภาษาไทย"},{code:"tl",name:"Tagalog"},{code:"fil",name:"Filipino"},{code:"tr",name:"Türkçe"},{code:"ts",name:"Xitsonga"},{code:"tt",name:"Tatarça"},{code:"uk",name:"Українська"},{code:"ur",name:"اُردو"},{code:"uz",name:"Oʻzbek tili"},{code:"ve",name:"Tshivenḓa"},{code:"vi",name:"Tiếng Việt"},{code:"yo",name:"عِدعِ يوْرُبا"},{code:"zh",name:"中文"},{code:"zu",name:"isiZulu"}],l.POPULAR_LANGUAGES=["de","en","es","fr","nl","pl","pt","ru","uk","zh","it","hi"]},
223"./common/localStorageWrapper.ts":
224/*!***************************************!*\
225  !*** ./common/localStorageWrapper.ts ***!
226  \***************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LocalStorageWrapper:()=>i});var s=n(/*! ../init/config */"./init/config.ts");const r=s.default.get(s.ConfigKey.EXTN_PREFIX);class i{static set(e,t){const n=this.getAll()||[],s=n.findIndex((t=>t.key===e));for(s>-1?n[s].value=t:n.push({key:e,value:t});JSON.stringify(n).length>this.MAX_BYTE_SIZE;)n.shift();try{localStorage.setItem(this.ROOT_KEY,JSON.stringify(n))}catch(e){}}static get(e){try{const t=localStorage.getItem(this.ROOT_KEY),n=t?JSON.parse(t):null;if(!n)return null;const s=n.find((t=>t.key===e));return s&&s.value?s.value:null}catch(e){return null}}static getAll(){try{const e=localStorage.getItem(this.ROOT_KEY),t=e?JSON.parse(e):null;return t||[]}catch(e){return[]}}static remove(e){const t=this.getAll()||[],n=t.findIndex((t=>t.key===e));if(n>-1){t.splice(n,1);try{localStorage.setItem(this.ROOT_KEY,JSON.str
226ingify(t))}catch(e){}}}}i.ROOT_KEY=`__${r}_host_storage`,i.MAX_BYTE_SIZE=1048576},
226"./common/localizationData.ts":
227/*!************************************!*\
228  !*** ./common/localizationData.ts ***!
229  \************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LOCALIZATION_DATA:()=>s});
230/*! (C) Copyright 2021 LanguageTooler GmbH. All rights reserved. */
231const s={ca:{accessDeniedError2:{message:"El servidor ha enviat un missatge d’accés denegat. Reviseu l’adreça electrònica i la contrasenya en els paràmetres i torneu-ho a provar."},addLanguage:{message:"Afegeix llengua"},addToDictionaryCaption:{message:'Afegeix "$word$" al diccionari personal',placeholders:{word:{content:"$1",example:"foobar"}}},additionalErrorSuggestionApplyButtonLabel:{message:"Aplica"},aiTextCursor:{message:"Cursor de text amb IA"},aiTextCursorPopupSettingDescription:{message:"Converteix el cursor de text intermitent en una potent eina de productivitat."},aiTextCursorSettingDescription:{message:'Converteix el cursor de text intermitent en una potent eina de productivitat. Proporciona un accés ràpid a característiques avançades com ara <strong>IA generativa, traducció, selector d\'emoji, GIF</strong> <a href="https://languagetool.org/text-cursor" target="_blank">i molt més</a>.'},appDesc:{message:"Milloreu els textos a l’instant amb el corrector gramatical i l’eina de reformulació de LanguageTool"},appDescThunderbird:{message:"Reviseu l’ortografia i la gramàtica en els vostres correus"},appName:{message:"Corrector gramatical i reformulador amb IA - LanguageTool"},ar:{message:"àrab"},ast:{message:"asturià"},attachScreenshot:{message:"Adjunta la captura de pantalla de la pàgina"},autoCheckDesc:{message:"Revisió automàtica en tots els dominis per defecte"},autoCheckOnDomainsDesc:{message:"Revisa el text automàticament en aquests dominis:"},be:{message:"bielorús"},br:{message:"bretó"},ca:{message:"català"},ca_ES_valencia:{message:"català (valencià)"},cardContentShowAll:{message:"Mostra’ls tots"},cardContentShowSubset:{message:"Mostra’n menys"},cardMessageLoadingTimeCaption:{message:"Espereu un moment, estem fent unes comprovacions"},cardMessageLoadingTimeText:{message:"Aquest procés s'està allargant més del normal. Podeu tancar la targeta de moment i tornar més tard. Gràcies per la paciència!"},cardSelectorLabelAITools:{message:"Eines d'IA"},cardSelectorLabelChecker:{message:"Corrector"},cardSelectorLabelParaphraser:{message:"Reformulació"},changelogDiscountExpires:{message:"L’oferta caduca d'aquí a"},changelogTitle:{message:"Noves funcions de LanguageTool"},close:{message:"Tanca"},cloudServer:{message:"Servidor en el núvol (languagetool.org)"},confirm:{message:"Entesos, som-hi"},connectionProblem:{message:"No es pot connectar a $serverUrl$. Comproveu la connexió a internet o torneu a intentar-ho d’aquí a una estona.",placeholders:{serverUrl:{content:"$1",example:"https://api.languagetool.org/v2"}}},contextMenuValidate:{message:"Revisa ortografia i gramàtica..."},contextMenuValidateInEditor:{message:"Revisa el text en l’editor"},continue:{message:"Continua"},correctAllQuotes:{message:"Corregeix totes les cometes"},crh:{message:"Tàtar de Crimea"},customSuggestionError:{message:"Guia d’estil"},da:{message:"danès"},da_DK:{message:"danès (Dinamarca)"},de:{message:"alemany"},de_AT:{message:"alemany (Àustria)"},de_CH:{message:"alemany (Suïssa)"},de_DE:{message:"alemany (Alemanya)"},de_DE_x_simple_language:{message:"alemany (alemany fàcil)"},defaultServerLink:{message:"Fes servir el servidor per defecte"},deleteWord:{message:"Suprimeix"},desktopAppAction:{message:"Baixa-ho GRATIS"},desktopAppHeadlineMac:{message:"Corregiu textos a les vostres aplicacions preferides"},desktopAppHeadlineWindows:{message:"Corregiu textos a les vostres aplicacions preferides"},desktopAppTextMac:{message:"LanguageTool per a Mac corregeix l'escriptura directament a Apple Mail, Pages, Word, Slack i moltes altres aplicacions."},desktopAppTextWindows:{message:"LanguageTool per a Windows ja està disponible i us corregeix l'escriptura a Outlook, Word i moltes altres aplicacions."},dialogAllLanguages:{message:"Tots els idiomes:"},dialogCounterCharactersOption:{message:"Caràcters"},dialogCounterCharactersPlural:{message:"$number$ caràcters",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterCharactersSingular:{message:"1 caràcter"},dialogCounterSentencesOption:{message:"Frases"},dialogCounterSentencesPlural:{message:"$number$ frases",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterSentencesSingular:{message:"1 frase"},dialogCounterWordsOption:{message:"Paraules"},dialogCounterWordsPlural:{message:"$number$ paraula",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterWordsSingular:{message:"1 paraula"},dialogDisableMenuDisableChecking:{message:"Desactiva en aquest lloc web"},dialogDisableMenuPauseChecking:{message:"Desactiva sols fins a una altra visita"},dialogEnableInDialogHeadline:{message:"El complement és desactivat"},dialogEnableInDialogText:{message:"Feu clic per a activar la revisió ortogràfica i gramatical"},dialogFailStateHeadline:{message:"Ai..."},dialogFailStateText:{message:"Ha fallat alguna cosa. Torneu a intentar-ho."},dialogMainMenuPickyMode:{message:"Mode perfeccionista"},dialogMainMenuPickyModeInfo:{message:"Activeu el mode perfeccionista per a millorar la vostra escriptura."},dialogMainMenuPremiumMistake:{message:"Suggeriments prèmium"},dialogMainMenuRegularMistake:{message:"Suggeriments"},dialogMainMenuTextScore:{message:"Valoració del text"},dialogNeedsLanguageHintHeadline:{message:"No s’ha pogut detectar la llengua"},dialogNeedsLanguageHintIgnore:{message:"Ignora-ho de moment"},dialogNeedsLanguageHintText:{message:"No hem pogut detectar la llengua del text. Establiu-la manualment o bé continueu provant."},dialogPositionMenuDefault:{message:"per defecte"},dialogPositionMenuLeft:{message:"esquerra"},dialogPositionMenuRight:{message:"dreta"},dialogPremiumButton:{message:"Més informació"},dialogPremiumHeadlinePlural:{message:"$count$ problemes més d’escriptura trobats",placeholders:{count:{content:"$1",example:"7"}}},dialogPremiumHeadlineSingular:{message:"S’ha trobat un problema més d’escriptura"},dialogPremiumText:{message:"Obteniu encara més suggeriments d’estil, de puntuació i de gramàtica amb LanguageTool Prèmium"},dialogRecommendedLanguages:{message:"Recomanat per a vós:"},dialogScrollHintHeadline:{message:"Suggeriments"},dialogScrollHintText:{message:"Desplaceu-vos pel document per a veure més suggeriments"},dialogScrollToLink:{message:"Mostra-ho en el text"},dialogSelectLanguageLabel:{message:"Selecciona la llengua"},dialogTextTooLongButton:{message:"Més informació"},dialogTextTooLongHeadline:{message:"Aquest text és una mica llarg"},dialogTextTooLongPremiumText:{message:"LanguageTool Prèmium només mostrarà els errors dels textos de menys de $count$ caràcters.",placeholders:{count:{content:"$1",example:"150,000"}}},dialogTextTooLongText:{message:"Actualitzeu a prèmium i obtindreu suggeriments avançats de gramàtica i estil per a texts llargs."},dialogTextTooShortHeadline:{message:"El text és massa curt"},dialogTextTooShortText:{message:"Introduïu com a mínim 5 caràcters per a començar a revisar."},dialogTooltipDisableChecking:{message:"Desactiva la revisió"},dialogTooltipHelp:{message:"Ajuda"},dialogTooltipHelpCenter:{message:"Ves al centre d’ajuda"},dialogTooltipPosition:{message:"Posició del quadre de diàleg"},dialogTooltipSaveText:{message:"Desa el text"}
231,dialogTooltipSendFeedback:{message:"Envieu comentaris"},dialogTooltipSettings:{message:"Configuració"},dialogTooltipUserStatistics:{message:"Estadístiques d’ús"},dialogUnsupportedLanguageHeadline:{message:"No funciona amb aquesta llengua"},dialogUnsupportedLanguageLabel:{message:"Llengua no admesa"},dialogUnsupportedLanguageText:{message:"LanguageTool admet més de trenta idiomes (per exemple, català, anglès, alemany, espanyol, francès, portuguès, neerlandès o rus)."},disableLollipop:{message:"Desactiva el cursor de text amb IA"},dismissSuggestions:{message:"Ignora"},domainsDesc:{message:"Inhabiliteu la comprovació en alguns llocs web"},edgeWebstoreSiteNotSupported:{message:"LanguageTool no funciona en el lloc web d’extensions d’Edge. Funciona en molts altres llocs (p. ex. Facebook, Gmail, Twitter, LinkedIn)."},editorCardNextIssue:{message:"Error següent"},editorCardNextSentence:{message:"Frase següent"},editorCardPreviousSentence:{message:"Frase anterior"},el:{message:"grec"},en:{message:"anglès"},en_AU:{message:"anglès (Austràlia)"},en_CA:{message:"anglès (Canadà)"},en_GB:{message:"anglès (Regne Unit)"},en_NZ:{message:"anglès (Nova Zelanda)"},en_US:{message:"anglès (EUA)"},en_ZA:{message:"anglès (Sud-àfrica)"},enableEverywhereButton:{message:"Activa per a tots els camps de text"},enableHereButton:{message:"Activa només per a aquest camp de text"},enableInDialog:{message:"Feu clic per a habilitar la revisió <br>ortogràfica i gramatical"},enableRuleTooltip:{message:"Feu clic per a habilitar la regla"},eo:{message:"esperanto"},errorCardAllDoneCaption:{message:"Bé! No s’ha trobat cap error!"},errorCardAllDoneDescription:{message:"Molt bona feina."},errorCardHiddenMatchButton:{message:"Desbloca-ho tot"}
231,errorCardHiddenMatchCaption:{message:"Una mostra de la versió Prèmium"},errorCardKeyboardInstructions:{message:"Seleccioneu amb $enter$ o $shiftEnter$ per a saltar al següent",placeholders:{enter:{content:"$1",example:"Enter"},shiftEnter:{content:"$2",example:"Shift + Enter"}}},errorCardPremiumTeaserCaptionPlural:{message:"S’han trobat $count$ coincidències ocultes més",placeholders:{count:{content:"$1",example:"7"}}},errorCardPremiumTeaserCaptionSingular:{message:"S’ha trobat una coincidència oculta més"},errorCardPremiumTeaserCta:{message:"Desbloca totes les coincidències ocultes"},errorCardPremiumTeaserGrammarSuggestions:{message:"Suggeriments de <lt-em>gramàtica</lt-em> ocults"},errorCardPremiumTeaserPunctuationSuggestions:{message:"Suggeriments de <lt-em>puntuació</lt-em> ocults"},errorCardPremiumTeaserReadMore:{message:"Més informació"},errorCardPremiumTeaserStyleSuggestions:{message:"Suggeriments d’<lt-em>estil</lt-em> ocults"},errorCardPremiumTeaserText:{message:"Hi ha més coincidències en aquest text que només pot trobar el LanguageTool Prèmium."},errorCardTurnOffPickyModeButton:{message:"Desactiva-ho aquí"},errorCardTurnOffPickyModeCaption:{message:"Suggeriment perfeccionista"},errorsIgnoredByDictionary:{message:"S’han ignorat $countIgnoredByDictionary$ paraules",placeholders:{countIgnoredByDictionary:{content:"$1",example:"1"}}},errorsIgnoredByDictionarySingular:{message:"S’ha ignorat una paraula"},errorsIgnoredByRules:{message:"$countIgnoredByRules$ regles s’han ignorat",placeholders:{countIgnoredByRules:{content:"$1",example:"1"}}},errorsIgnoredByRulesSingular:{message:"S’ha ignorat una regla"},es:{message:"espanyol"},eu:{message:"basc"},experimentalLink:{message:"Configuració avançada (sols per a usuaris professionals)"},extensionUpdatedHeadline:{message:"L’extensió s’ha actualitzat."},extensionUpdatedText:{message:"Feu clic en la icona $iconHtml$ en la barra d’eines del vostre navegador o torneu a carregar la pàgina per a habilitar la correcció ortogràfica i gramatical de nou.",placeholders:{iconHtml:{content:"$1",example:"<span class='lt-placeholder-icon'></span>"}}},fa:{message:"persa"},feedbackButton:{message:"Envia el missatge a LanguageTool"},feedbackDirectMail:{message:"Si voleu enviar-nos captures de pantalla, ho podeu fer amb un correu electrònic a $email$.",placeholders:{email:{content:"$1",example:"[email protected]"}}},feedbackError:{message:"No s’ha pogut enviar el missatge. Torneu-ho a provar més tard."},feedbackHeadline:{message:"Envieu els vostres comentaris a LanguageTool"},feedbackPrivacyPolicy:{message:"Política de privacitat"},feedbackSenderPlaceholder:{message:"Introduïu la vostra adreça de correu electrònic…"},feedbackSuccess:{message:"Gràcies pels vostres comentaris."},feedbackTextPlaceholder:{message:"Introduïu els vostres comentaris…"},fixSentenceCardHeadlineApply:{message:"Corregeix tota la frase"},fixSentenceCardHeadlineLoading:{message:"S’està cercant una correcció de la frase…"},fixSentenceCardHeadlineMissing:{message:"No s’ha trobat cap correcció"},forcePreferredLanguagesOptionLabel:{message:"Utilitza sempre només aquestes llengües per a la detecció automàtica de llengua"},fr:{message:"francès"},ga:{message:"irlandès"},generalSettingsHeadline:{message:"Configuració general"},gl:{message:"gallec"},googleDocsDisableButton:{message:"Deshabilita LanguageTool en aquest document"},googleDocsEnableButton:{message:"Habilita LanguageTool"},googleDocsEnableHint:{message:"Podeu habilitar de nou aquí el corrector gramatical i d’estil LanguageTool"},googleDocsNewTeaserHeadline:{message:"Ha arribat LanguageTool per a Google Docs!"},googleDocsNewTeaserText:{message:"En el lateral de cada pàgina podeu veure quants problemes detecta LanguageTool."},googleDocsPagelessModeUnsupported:{message:'El nou mode "sense pàgina" de moment no està disponible. Ja hi estem treballant.'},googleSlidesDisableButton:{message:"Desactiva LanguageTool en aquesta presentació."},googleSlidesEnableButton:{message:"Activa LanguageTool"},googleSlidesEnableHint:{message:"Aquí podeu reactivar la revisió gramatical i d’estil de LanguageTool"},googleSlidesNewTeaserHeadline:{message:"Ja és aquí LanguageTool per a Google Slides!"},googleSlidesNewTeaserText:{message:"Al costat de cada diapositiva, ara podeu veure quants problemes ha detectat LanguageTool."},grammarError:{message:"Gramàtica"},haveAccountDesc:{message:"Crea un compte gratuït en"},historicPremiumErrorsButton:{message:"Més informació"},historicPremiumErrorsHeadline:{message:"Ho sabíeu?"},historicPremiumErrorsText:{message:"Podríeu haver evitat <strong>$count$ problemes de gramàtica i d’estil</strong> en els darrers dies amb LanguageTool Prèmium.",placeholders:{count:{content:"$1",example:"9"}}},historicPremiumErrorsText2:{message:"<strong>$count$ problemes de gramàtica i d’estil</strong> podrien haver-se evitat en els darrers dies amb LanguageTool Prèmium.",placeholders:{count:{content:"$1",example:"9"}}},ignoreDomainsCheckDesc:{message:"No facis revisió automàtica en aquests dominis:"},ignoreHere:{message:"Ignora-ho en aquest text"},ignoredRules:{message:"Aquestes regles s’han desactivat. Feu clic en una regla per a activar-la de nou:"},ignoredRulesDesc:{message:"Regles desactivades"},incompleteResult:{message:"Els resultats són incomplets: la revisió del text s’ha aturat perquè hi ha massa errors."},invalidUsernameOrPassword:{message:"Error: Comproveu l’adreça electrònica i la contrasenya en els paràmetres"},is:{message:"islandès"},it:{message:"italià"},ja:{message:"japonès"},km:{message:"khmer"},landingPageTrialEndingDaysPlural:{message:"$count$ dies",placeholders:{count:{content:"$1",example:"7"}}},landingPageTrialEndingDaysSingular:{message:"1 dia"},language:{message:"Llengua:"},languageOptionsLink:{message:"Opcions de llengua"},languagetoolNotSupported:{message:"L’extensió no funciona en aquest lloc web, perquè el lloc web ofereix la mateixa funcionalitat."},localServer:{message:"Servidor local (localhost): requereix un servidor de LanguageTool que s’executi localment"},localServerDocs:{message:"Documentació"},lt:{message:"lituà"},managedLoginButton1:{message:"Inicia la sessió"},managedLoginButton2:{message:"Inicieu la sessió amb el vostre compte corporatiu"},managedLoginDescription:{message:"Inicieu la sessió amb el vostre compte corporatiu per a utilitzar LanguageTool."},managedLoginHeadline:{message:"Inici de sessió"},messagePopupTurnOnPrimaryButton:{message:"Entesos!"},messagePopupTurnOnSecondaryButton:{message:"Reactiva la revisió de text"},messagePopupTurnOnheadline:{message:"La verificació ortogràfica és desactivada per a aquesta pàgina"},messagePopupTurnOntext:{message:'Per a reactivar-la, feu clic en la icona de LT en la vostra barra d’eines i en el botó "Revisa ortografia i gramàtica".'},ml:{message:"malaiàlam"},moreDetails:{message:"Més informació..."},motherTongueDesc:{message:"Llengua materna"},motherTongueExpl:{message:"Establiu la llengua materna si voleu que us advertim sobre falsos amics quan reviseu texts no escrits en la vostra llengua materna."},msOnlineOfficeNotSupported:{message:'Microsoft Word Online no és compatible amb aquesta extensió: només cal que instal·leu <a target="_blank" href="$url$">aquesta extensió</a>.',placeholders:{url:{content:"$1",example:"https://appsource.microsoft.com/de-de/product/office/WA104381727"}}},nl:{message:"neerlandès"},no:{message:"noruec"},noErrorsFound2:{message:"Bé! No s’ha trobat cap error!"},noErrorsFoundText:{message:"Molt bona feina."},notificationLollipopUndoDescription:{message:"Per a tornar a activar el cursor de text amb IA, aneu als paràmetres."},notificationLollipopUndoLabel:{message:"S'ha desactivat el cursor de text amb IA"},notificationUndoDescription:{message:"Premeu %{cmd} per a desfer"},notificationUndoLabel:{message:"S'ha aplicat la reformulació"},onboardLanguageSelectorCta:{message:"Comença a usar LanguageTool"},onboardLanguageSelectorDescription:{message:"Per a oferir els suggeriments més adequats, ens cal saber quins idiomes soleu usar."},onboardLanguageSelectorHeading:{message:"Trieu els idiomes en què soleu escriure"},onboardingHeadline:{message:"Millorarà la vostra escriptura"},onboardingIntro:{message:"Els vostres texts es revisaran en la major part dels camps de text mentre escriviu."},onboardingIntroThunderbird:{message:"El text es revisarà mentre redacteu els correus."},onboardingNote1:{message:"Torneu a carregar <strong>totes les pàgines web obertes</strong> per a activar l’extensió"},onboardingNote2:{message:"Aquesta extensió no funciona amb camps de text en <strong>Chrome Web Store</strong> o en <strong>addons.mozilla.org</strong>"},onboardingNote3:{message:"Per a desactivar l’extensió en un lloc web, feu clic en la <strong>icona LT de la barra d’eines del navegador</strong>."},onboardingNote4:{message:"Es poden demanar <strong>sinònims</strong> fent doble clic sobre una paraula en un camp de text (p. ex. Gmail, Facebook o Google Docs)."},onboardingNoteThunderbird1:{message:"Comenceu un missatge nou per a activar l’extensió."},onboardingNoteThunderbird2:{message:"Per a desactivar l’extensió, feu clic en la icona de LT dalt a la dreta de la finestra de redacció de correus."},openCardAndToolboxHotkeyDesc:{message:"Dreceres de teclat"},openCardHotkeyAlt:{message:"Alt"},openCardHotkeyCtrl:{message:"Ctrl"},openCardHotkeyDesc:{message:"Drecera de teclat"},openCardHotkeyExpl:{message:"Premeu aquesta tecla <strong>dues vegades ràpidament</strong> en qualsevol moment per a fer servir les nostres eines d'IA."},openCardHotkeyOff:{message:"Apagat"},openCardHotkeyShift:{message:"Majús"},openToolboxHotkeyExpl:{message:"Premeu aquesta tecla <strong>dues vegades ràpidament</strong> en qualsevol moment per a fer servir les nostres eines d'IA."},otherServer:{message:"Un altre servidor: requereix un servidor LanguageTool en execució"},overleafNewTeaserHeadline:{message:"Ja és aquí LanguageTool per a Overleaf!"},overleafNewTeaserText:{message:"Desplaceu-vos pel text per a veure suggeriments d’ortografia, gramàtica i estil."},oxfordSpellingOptionLabel:{message:"Ortografia d’Oxford"},password:{message:"Contrasenya:"},personalDictionaryMultipleWordError:{message:"Les expressions de múltiples paraules són actives sols per a usuaris que tenen un compte de LanguageTool"},phrasesCardCaption:{message:"Reformulacions"},phrasesCardConfirmationButton:{message:"Accepto la política de privacitat"},phrasesCardConfirmationHeading:{message:"Reformuleu les vostres frases amb IA."},phrasesCardConfirmationText:{message:'Necessiteu un text més curt, més fluid o més formal? Tenim la solució. Consulteu la nostra <a target="_blank" href="$privacyUrl$" rel="noopener">política de privacitat</a> sobre el processament de dades.',placeholders:{privacyUrl:{content:"$1",example:"https://languagetool.org/legal/privacy"}}},phrasesCardFilterEmpty:{message:"Tots els resultats"},phrasesCardGeneralError:{message:"Hi ha hagut un error carregant les frases"},phrasesCardHeadline:{message:"Alternatives generades amb IA"},phrasesCardLabelFluency:{message:"Fluid"},phrasesCardLabelFormality:{message:"Formal"},phrasesCardLabelGeneral:{message:"Reformulat"},phrasesCardLabelParaphrase:{message:"Fluid"},phrasesCardLabelShortened:{message:"Concís"},phrasesCardLabelSimplicity:{message:"Simple"},phrasesCardNoResult:{message:"Per desgràcia, no hi ha reformulacions disponibles per a aquesta frase."},phrasesCardNoSentence:{message:"No s’ha pogut detectar cap frase."},phrasesCardNotSupportedHeading:{message:"La reformulació de frases no està disponible… de moment"},phrasesCardNotSupportedText:{message:"La reformulació de frases no està disponible per a aquesta llengua, però sí per a l’anglès i el castellà, entre d’altres. <strong>Treballem de valent</strong> perquè estigui disponible per a altres llengües tan aviat com sigui possible."},phrasesCardRephrasingLimitPlural:{message:"Limitat a <strong>$count$</strong> frases més avui",placeholders:{count:{content:"$1",example:"3"}}},phrasesCardRephrasingLimitSingular:{message:"Limitat a <strong>una</strong> frase més avui"},phrasesCardRephrasingLimitUnlock:{message:"Desbloqueu la reformulació sense límits!"},phrasesCardSentencePrefix:{message:"Original"},phrasesCardTimeoutError:{message:"El servidor no ha respost a temps."},pl:{message:"polonès"},popupGeneralSettingsHeadline:{message:"Configuració general"},popupGlobalSettingsHeadline:{message:"Configuració general"},popupGlobalSettingsHeadlineInfo:{message:"Tots els llocs web"},popupOnboardingHeadline:{message:"Benvingut! Ara podeu utilitzar LanguageTool:"},popupOnboardingStep1:{message:"Feu clic en qualsevol camp de text de múltiples línies (p. ex. en Gmail, Facebook…)."},popupOnboardingStep2:{message:"Trobareu una icona com $icon1Html$ o $icon2Html$ a la cantonada inferior dreta.",placeholders:{icon1Html:{content:"$1",example:"<span class='icon-1'></span>"},icon2Html:{content:"$2",example:"<span class='icon-2'></span>"}}},popupOnboardingStep3:{message:"Escriviu un text. Els problemes d’escriptura seran <u>subratllats</u>."},popupOnboardingStep4:{message:"Feu clic en una paraula subratllada per a obtenir suggeriments."},popupOpenEditorButton:{message:"Obre l’editor per a comprovar el text"},popupOptionCaseText:{message:"Revisa majúscules i minúscules"},popupOptionCheckText:{message:"Activa LanguageTool"},popupOptionContextMenu:{message:"Mostra en el menú de clic dret"},popupOptionContextMenuDescription:{message:"Només cal que seleccioneu text en qualsevol lloc web, feu clic dret i comproveu si hi ha errors gramaticals."},popupOptionPickyMode:{message:"Mode perfeccionista"},popupOptionPickyModeDescription:{message:"Per a un estil i una tipografia perfectes."},popupOptionRephrasing:{message:"Funcionalitat de reformulació"},popupOptionRephrasingDescription:{message:"Reescriviu frases senceres amb IA. Només cal que situeu el ratolí sobre el símbol de la cantonada inferior dreta d’un camp de text i feu clic en la icona de reformulació per a obtenir suggeriments per a la frase actual."},popupOptionSynonyms:{message:"Activa el doble clic"},popupOptionSynonymsDescription:{message:"Feu doble clic en qualsevol paraula en un camp de text per a veure sinònims."},popupOptionValidate:{message:"Revisa el text seleccionat"},popupOptionValidateInEditor:{message:"Revisa el text seleccionat en l’editor"},popupPremiumHeadline:{message:"Escriviu com un professional"},popupPremiumLink:{message:"Més informació"},popupPremiumText:{message:"Actualitzeu a LanguageTool Prèmium per a trobar no sols més errors de gramàtica i puntuació sinó també d’estil."},popupSettingsHeadline:{message:"Configuració del lloc web"},popupSettingsHeadlineInfo:{message:"Lloc web actual"},popupSettingsHover:{message:"Més configuració avançada"},popupTrialEndedDescription:{message:"Actualitzeu per a continuar fent servir aquesta extensió del navegador i millorar la qualitat dels vostres textos al web."},popupTrialEndedHeadline:{message:"La vostra prova prèmium s'ha acabat"},popupTrialEndingInDays:{message:"La vostra prova prèmium s'acaba d'aquí a <strong>$count$ dies</strong>",placeholders:{count:{content:"$1",example:"14"}}},popupTrialEndingToday:{message:"La vostra prova prèmium s'acaba <strong>avui</strong>"},popupTrialEndingTomorrow:{message:"La vostra prova prèmium s'acaba <strong>demà</strong>"},popupUserStatisticsHover:{message:"Mostra les estadístiques d’ús"},poweredBy:{message:"Funciona amb <b>LanguageTool</b>"},premiumErrorsButton:{message:"Més informació"}
231,premiumErrorsTextPlural:{message:"El vostre text conté <strong>$count$ problemes d’escriptura avançats</strong>",placeholders:{count:{content:"$1",example:"7"}}},premiumErrorsTextSingular:{message:"El vostre text conté <strong>un problema d’escriptura avançat</strong>"},privacyHeadline:{message:"Benvingut/da a LanguageTool"},privacyLinkForDefaultServer:{message:'Per a més informació, consulteu <a href="$privacyUrl$" target="_blank">la nostra política de privacitat</a>.',placeholders:{privacyUrl:{content:"$1",example:"https://languagetool.org/privacy/"}}},privacyListSwitchable:{message:"La comprovació es pot <strong>desactivar en qualsevol moment</strong>"},privacyListUnsaved:{message:"<strong>El text no s’emmagatzemarà</strong>"},privacyNoteForDefaultServer:{message:'Aquesta extensió comprovarà el text enviant-lo a <a href="$serverUrl$" target="_blank">$serverHost$</a> amb una connexió xifrada.',placeholders:{serverUrl:{content:"$1",example:"https://languagetool.org"},serverHost:{content:"$2",example:"LanguageTool.org"}}},privacyNoteForOtherServer:{message:"Aquesta extensió revisarà el vostre text enviant-lo a $serverUrl$. Per a tornar al servidor per defecte, visiteu la pàgina d’opcions de l’extensió.",placeholders:{serverUrl:{content:"$1",example:"http://localhost:8081/"}}},privacyNoteSlogan:{message:"El vostre assistent d’escriptura"},privacyPolicy:{message:"Política de privacitat"},pt:{message:"portuguès"},pt_AO:{message:"portuguès (Angola pre-AO)"},pt_BR:{message:"portuguès (Brasil post-AO)"},pt_CV:{message:"portuguès (Cap Verd)"},pt_MZ:{message:"portuguès (Moçambic pre-AO)"},pt_PT:{message:"portuguès (Portugal post-AO)"},pt_PT_post_reform:{message:"portuguès (Portugal, post-AO)"},pt_PT_pre_reform:{message:"portuguès (Portugal, pre-AO)"},punctuationError:{message:"Puntuació"},ratingHeadline:{message:"Us agrada el corrector?"},ratingText:{message:"Doneu-nos la vostra opinió"},ratingThankYou:{message:"Gràcies."},ratingUnhappyQuestion:{message:"Expliqueu-nos per què no esteu satisfet."},removeExtraWhitespace:{message:"Suprimeix espais en blanc sobrants"},rephrasingTeaserCaption:{message:"En necessites més de seguida?"},rephrasingTeaserCountdownSuffix:{message:"$count$ reformulacions",placeholders:{count:{content:"$1",example:"3"}}},rephrasingTeaserCountdownText:{message:"Obteniu-ne més demà"},rephrasingTeaserCta:{message:"Desbloqueu tots els avantatges prèmium"},rephrasingTeaserDescription:{message:"Beneficieu-vos de reformulacions il·limitades i molt més:"},rephrasingTeaserListItem1:{message:"<strong>Reviseu fins a $count$</strong> caràcters en un sol text",placeholders:{count:{content:"$1",example:"3"}}},rephrasingTeaserListItem2:{message:"<strong>Suggeriments d’estil avançats</strong> per a uns textos encara millors"},rephrasingTeaserListItem3:{message:"<strong>Reformulacions il·limitades</strong> per a fer que el vostre text sigui més versàtil"},replaceWithWhitespace:{message:"Substitueix per un espai en blanc"},reportAnIssue:{message:"Envieu comentaris"},reviewChromeHeadline:{message:"Ens faríeu una valoració en la botiga de Chrome?"},reviewEdgeHeadline:{message:"Ens donareu una qualificació a la botiga de complements d’Edge?"},reviewFirefoxHeadline:{message:"Ens faríeu una valoració en la botiga de Firefox?"},reviewLink:{message:"Qualifiqueu ara"},reviewOperaHeadline:{message:"Ens faríeu una valoració en la botiga de complements d’Opera?"},reviewSafariHeadline:{message:"Ens donaríeu una qualificació a l’App Store?"},ro:{message:"romanès"},ru:{message:"rus"},save:{message:"Desa"},sendFeedback:{message:"Envia comentaris"},sentenceSplittingCardApplyButtonLabel:{message:"Aplica"},sentenceSplittingCardHeadlineApply:{message:"Suggeriment:"},sentenceSplittingCardHeadlineLoading:{message:"S’està dividint la frase..."},sentenceSplittingCardHeadlineMissing:{message:"No s’ha trobat cap suggeriment"},serverNotAvailable:{message:"El servidor local no està disponible"},serverText:{message:"Servidor de LanguageTool:"},serverUrlIsInvalid:{message:"L’URL no és vàlid"},settingsAccountBulletListEditor:{message:"Useu l’editor com a entorn d’escriptura lliure de distraccions."},settingsAccountBulletListSave:{message:"Deseu els textos per a més tard. "},settingsAccountBulletListSync:{message:"Sincronitzeu la configuració i el diccionari personal en diferents navegadors i dispositius."},settingsAccountDescription:{message:"Inicieu la sessió i obteniu aquests avantatges:"},settingsAccountHeadline:{message:"Compte"},settingsAccountSubheadline:{message:"Inicieu la sessió amb el vostre compte de LanguageTool"},settingsAddAutoCheckDomainHint:{message:"El domini encara no s’ha afegit. Premeu Retorn per a afegir-lo."},settingsAddDomainHint:{message:"El domini encara no s’ha afegit. Premeu RETORN per a afegir-lo."},settingsAddIgnoredDomainHint:{message:"El domini encara no s’ha afegit. Premeu Retorn per a afegir-lo."},settingsAddOrFilterAutoCheckDomains:{message:"Afegiu o cerqueu un domini…"},settingsAddOrFilterDomains:{message:"Afegiu o cerqueu un domini…"},settingsAddOrFilterIgnoredDomains:{message:"Afegiu o cerqueu un domini …"},settingsAddOrFilterWords:{message:"Afegiu o cerqueu una paraula…"},settingsAddWordHint:{message:"Aquesta paraula encara no existeix en el diccionari. Premeu RETORN per a afegir-la."},settingsAreYouSure:{message:"Esteu segur? No es podrà desfer."},settingsCheckForPaidSubscriptionError:{message:"S'ha produït un error en comprovar l’estat de la vostra subscripció"},settingsClearAll:{message:"Desmarca-ho tot"},settingsCopyDictionary:{message:"Copia al porta-retalls"},settingsCopyDictionarySuccessful:{message:"S’ha copiat al porta-retalls"},settingsDeleteAutoCheckDomain:{message:"Esborra el domini"},settingsDeleteIgnoredDomain:{message:"Esborra el domini"},settingsDictionaryHeadline:{message:"Diccionari personal"},settingsDomainInvalid:{message:"Introduïu un domini vàlid que encara no s’hagi afegit."},settingsEmptyAutoCheckDomains:{message:"Encara no heu activat la revisió automàtica en cap lloc web"},settingsEmptyDictionary:{message:"El diccionari personal és buit"},settingsEmptyDomainList:{message:"Encara no heu desactivat cap domini"},settingsEmptyIgnoredDomains:{message:"Encara no heu desactivat la revisió automàtica en cap lloc web"},settingsEmptyIgnoredRules:{message:"Encara no heu desactivat cap regla. Podeu desactivar regles quan apareguin en un text."},settingsEnableAllRules:{message:"Activa-ho tot"},settingsEnableDomain:{message:"Habilita el domini"},settingsExperimentalSuccess:{message:"La configuració s’ha desat correctament."},settingsForgotPasswordLink:{message:"Heu oblidat la contrasenya?"},settingsHeadline:{message:"Configuració"},settingsImprintLink:{message:"Crèdits"},settingsLanguageVariantsDescription:{message:"Per a oferir-vos els suggeriments més adequats, digueu-nos quina varietat de la llengua useu."},settingsLanguageVariantsHeadline:{message:"Varietats de llengües"},settingsLoggedInAs:{message:"Heu iniciat la sessió com a $email$.",placeholders:{email:{content:"$1",example:"<strong>[email protected]</strong>"}}},settingsLoginButton:{message:"Inicia la sessió"},settingsLoginError:{message:"No s’ha pogut iniciar la sessió. Comproveu l’adreça electrònica i la contrasenya."},settingsLoginSuccess:{message:"Heu iniciat la sessió"},settingsLogoutButton:{message:"Tanca la sessió"},settingsLogoutSuccess:{message:"Heu tancat la sessió"},settingsManageAccountButton:{message:"Gestiona el compte"},settingsPasswordPlaceholder:{message:"Contrasenya"},settingsPreferredLanguagesCompleteList:{message:"Tots els idiomes"},settingsPreferredLanguagesDescription:{message:"Establiu les llengües en què soleu escriure. Això ajuda LanguageTool a detectar automàticament la llengua correcta."},settingsPreferredLanguagesHeadline:{message:"Idiomes preferits"},settingsPreferredLanguagesPopularList:{message:"Idiomes populars"},settingsPremiumButton:{message:"Descobriu LanguageTool Prèmium"},settingsPremiumFeaturesActivated:{message:"Totes les funcions <strong>prèmium</strong> són activades."},settingsPremiumHeadline:{message:"Milloreu la vostra escriptura"},settingsPremiumLearnMore:{message:"Per què hem fet aquest canvi"},settingsPremiumText:{message:"Trobeu problemes de gramàtica, d’estil i puntuació avançats o reviseu texts de fins a 150.000 caràcters."},settingsPrivacyPolicyLink:{message:"Política de privacitat"},settingsServerUrlDisabled:{message:"Només podreu establir un servidor personalitzat quan tanqueu la sessió del vostre compte de LanguageTool."},settingsTermsOfServiceLink:{message:"Condicions del servei"},settingsTrialEndedDescription:{message:"Actualitzeu per a mantenir l'accés a aquest complement del navegador i millorar la qualitat dels vostres textos."},settingsTrialEndedHeadline:{message:"La vostra prova de LanguageTool Prèmium s'ha acabat"},settingsTrialEndingInDays:{message:"La vostra prova de LanguageTool Prèmium s'acaba d'aquí a $count$ dies",placeholders:{count:{content:"$1",example:"14"}}},settingsTrialEndingToday:{message:"La vostra prova de LanguageTool Prèmium s'acaba avui"},settingsTrialEndingTomorrow:{message:"La vostra prova de LanguageTool Prèmium s'acaba demà"},settingsUnknownError:{message:"S’ha produït un error inesperat"},siteDisabledPerGroupPolicy:{message:"La correcció està desactivada en aquest lloc segons la política de grup."},siteTemporarilyUnsupported:{message:"Disculpeu, LanguageTool ha desactivat temporalment el suport per a aquest lloc web. Treballem en una solució. Hauria de ser qüestió de dies."},sk:{message:"eslovac"},skip:{message:"Omet"},sl:{message:"eslovè"},spellingError:{message:"Ortografia"},sr:{message:"serbi"},sr_BA:{message:"serbi (Bòsnia)"},sr_HR:{message:"serbi (Croàcia)"},sr_ME:{message:"serbi (Montenegro)"},sr_RS:{message:"serbi (Sèrbia)"},statusIconEnableLT:{message:"Habiliteu LanguageTool: revisió ortogràfica i gramatical"},statusIconError:{message:"Error"},statusIconMoreErrors:{message:"Els resultats són incomplets: la comprovació del text s’ha aturat perquè hi ha massa errors."},statusIconPermissionRequired:{message:"No es pot revisar el text: confirmeu la política de privacitat primer."},statusIconReload:{message:"L’extensió s’ha actualitzat. Torneu a carregar la pàgina per a habilitar la revisió ortogràfica i gramatical."},statusIconToolTip:{message:"LanguageTool: revisió ortogràfica i gramatical"},suggestionError:{message:"Estil"},suggestionOnlyVisibleToPremiumButton:{message:"Obteniu tots els avantatges de prèmium"},suggestionOnlyVisibleToPremiumText:{message:"Això és un suggeriment avançat que sols està disponible en la versió prèmium de LanguageTool. Actualitzeu a prèmium per a obtenir suggeriments com aquest i molts més."},sv:{message:"suec"},switchToAmericanEnglish:{message:"Canvia a anglès americà"},switchToAustralianEnglish:{message:"Canvia a anglès d’Austràlia"},switchToBritishEnglish:{message:"Canvia a anglès britànic"},switchToCanadianEnglish:{message:"Canvia a anglès del Canadà"},switchToNewZealandEnglish:{message:"Canvia a anglès de Nova Zelanda"},switchToSouthAfricanEnglish:{message:"Canvia a anglès de Sud-àfrica"},synonymsCardGeneralError:{message:"Hi ha hagut un error carregant els sinònims"},synonymsCardHeadline:{message:"Sinònims"},synonymsCardLanguageNotSupported:{message:"Encara no hi ha servei per als sinònims d’aquesta llengua."},synonymsCardLess:{message:"menys"},synonymsCardLoadMoreAlternatives:{message:"mostra’n més"},synonymsCardLoading:{message:"Carregant…"},synonymsCardMore:{message:"més"},synonymsCardNoSynonymsAvailable:{message:"No hi ha sinònims disponibles per a aquesta paraula"},synonymsCardProvidedBy:{message:"Proveït per <strong>LanguageTool</strong>"},synonymsCardTabSentence:{message:"Frase"},synonymsCardTabWord:{message:"Paraula"},synonymsCardTooltipReadText:{message:"Pronuncia la paraula"},synonymsTutorialHeadline:{message:"Com podeu obtenir sinònims"},synonymsTutorialText:{message:"Obteniu els sinònims de qualsevol paraula fent-hi doble clic. Funciona en tots els camps de text compatibles amb LanguageTool."},ta:{message:"tàmil"},termsOfServiceUpdateAcceptButton:{message:"Ho accepto"},termsOfServiceUpdateHeadline:{message:"Actualització de les condicions del servei i de la política de privacitat de LanguageTool"},termsOfServiceUpdateSkipButton:{message:"Més tard"},termsOfServiceUpdateText:{message:"Reviseu l'actualització de les <lt-em>Condicions del servei</lt-em> i de la <lt-em>Política de privacitat</lt-em> de LanguageTool, vigent a partir del 19 de desembre de 2024. Si feu clic a «$button$», accepteu les condicions del servei actualitzades de LanguageTool i reconeixeu que heu llegit la política de privacitat actualitzada.",placeholders:{button:{content:"$1",example:"I accept"}}},termsOfServiceUpdateTextLoggedOut:{message:"Reviseu l'actualització de les <lt-em>Condicions del servei</lt-em> i de la <lt-em>Política de privacitat</lt-em> de LanguageTool, vigent a partir del 19 de desembre de 2024. Reviseu l'actualització de les Condicions del servei i de la Política de privacitat de LanguageTool, vigent a partir del 19 de desembre de 2024. Si continueu utilitzant els productes i serveis de LanguageTool a partir del 19 de desembre, accepteu l'actualització de les Condicions del servei i reconeixeu que heu llegit la Política de privacitat actualitzada."},termsOfServiceUpdateUnderstoodButton:{message:"Entesos"},textTooLong:{message:"Aquest text és massa llarg per a ser revisat."},timeoutError:{message:"S'ha esgotat el temps d’espera. Torneu-ho a provar més tard ($serverUrl$).",placeholders:{serverUrl:{content:"$1",example:"https://languagetool.org:8081/"}}},tl:{message:"tagàlog"},tooManyErrors:{message:"Fa l’efecte que aquest text conté massa errors. ¿Segur que heu seleccionat la llengua correcta?"},tooManyRequests:{message:"S’ha superat el límit de sol·licituds. Espereu un minut i LanguageTool estarà disponible de nou."},toolbarDisableMenuDisableChecking:{message:"Desactiva en aquest lloc web"},toolbarDisableMenuPauseChecking:{message:"Desactiva sols fins a una altra visita"},toolbarTooltipDisableChecking:{message:"Desactiva la revisió"},toolbarTooltipRephrasing:{message:"Reformula la frase"},toolbarTooltipRephrasingUnsupportedLanguage:{message:"Actualment, la reformulació de frases no està disponible en aquesta llengua."},toolboxKeyboardShortcut:{message:"o premeu $shortcut$ dues vegades",placeholders:{shortcut:{content:"$1",example:"CTRL"}}},toolboxOnboardingCtaLabel:{message:"Comença →"},toolboxOnboardingHeading:{message:"Comenceu amb el cursor de text amb IA!"},toolboxOnboardingLearnMore:{message:"Més informació"},toolboxOnboardingMessage:{message:"Ara podeu fer servir les nostres eines a tot arreu on escriviu. Només cal que feu clic en el cursor de text amb IA per a reformular text, editar amb IA o afegir emojis i GIF."},toolboxTooltip:{message:"Utilitza les eines d'IA"},tr:{message:"turc"},trialOnboardingDescription:{message:"Ara s'han habilitat totes les característiques prèmium al complement per al navegador. Totalment de franc, sense <strong>costos ocults</strong>."},trialOnboardingEndInfo1:{message:"La prova prèmium acaba automàticament"},trialOnboardingEndInfo2:{message:"No cal que feu res. No se us cobrarà. Si voleu continuar utilitzant el complement de LanguageTool per al navegador, podeu obtenir una subscripció prèmium <a>aquí</a>."},trialOnboardingHeadline:{message:"Gaudiu de LanguageTool Prèmium — Gratuït durant 14 dies"},trialOnboardingLogin:{message:"<a>Inicieu la sessió</a> si ja teniu un compte prèmium"},trialOnboardingTimeline:{message:"Cronologia:"}
231,trialOnboardingToday:{message:"Avui"},trialOnboardingTodayInfo1:{message:"Totes les característiques prèmium desbloquejades"},trialOnboardingTodayInfo2:{message:"Traieu el màxim profit de LanguageTool: IA generativa, correcció gramatical avançada, traducció, reformulació i molt més."},tryAgain:{message:"Intenteu-ho de nou"},turnOffPickyMode:{message:"Desactiva el mode perfeccionista en aquest text"},turnOffRule:{message:"Desactiva la regla a tot arreu"},turnOffRulePicky:{message:"Els suggeriments gramaticals no es poden desactivar en el mode perfeccionista."},turnOnHint:{message:"Podeu tornar a activar l’extensió aquí"},uk:{message:"ucraïnès"},unknownError:{message:"S’ha produït un error en revisar el text. Una manera de resoldre el problema és reiniciar el navegador."},upgradeTeaserDiscount:{message:"Estalvieu un $percent$%",placeholders:{percent:{content:"$1",example:"20"}}},upgradeTeaserDiscountHeadline:{message:"Oferta per temps limitat"},username:{message:"Adreça electrònica:"},validatorHasMistakesHeadlinePlural:{message:"$count$ errors trobats",placeholders:{count:{content:"$1",example:"7"}}},validatorHasMistakesHeadlineSingular:{message:"S’ha trobat un error"},validatorHasMistakesText:{message:"Feu clic en les paraules ressaltades per a corregir-les."},validatorHasPremiumErrorsButton:{message:"Més informació"},validatorHasPremiumErrorsHeadlinePlural:{message:"El text conté $count$ problemes de redacció avançats",placeholders:{count:{content:"$1",example:"7"}}},validatorHasPremiumErrorsHeadlineSingular:{message:"El text conté un problema de redacció avançat"},validatorHasPremiumErrorsText:{message:"Actualitzeu a LanguageTool Prèmium per a trobar molts més errors de gramàtica, estil i puntuació."},validatorLoadingHint:{message:"Revisant el text…"},validatorNoMistakesHeadline:{message:"Enhorabona, no s’ha trobat cap error!"},validatorNoTextStatus:{message:"Escriviu o enganxeu el text per a revisar-lo"},validatorPlaceholder:{message:"Introduïu o enganxeu el text aquí…"},validatorPremiumButton:{message:"Actualització"},validatorPremiumHeadline:{message:"Trobeu més problemes d’escriptura i esdevindreu un escriptor més bo."},validatorPremiumReason1:{message:"Una revisió més completa de gramàtica, puntuació i estil"},validatorPremiumReason2:{message:"Reviseu texts més llargs (de fins a 150.000 caràcters)"},validatorPremiumReason3:{message:"Detecció automàtica de nombres invàlids (p. ex. IBAN, ISBN…)"},validatorPremiumReason4:{message:"Accés complet a aquest complement del navegador"},validatorTextTooLongStatus:{message:"Aquest text és massa llarg per a ser revisat."},validatorTrialEndedText:{message:"Actualitzeu per a desbloquejar aquests i més avantatges prèmium:"},variantCaDesc:{message:"Assumeix aquesta variant de català:"},variantDeDesc:{message:"Assumeix aquesta variant d’alemany:"},variantEnDesc:{message:"Assumeix aquesta variant d’anglès:"},variantPtDesc:{message:"Assumeix aquesta variant de portuguès:"},webstoreSiteNotSupported:{message:"Google Chrome impedeix a les extensions accedir a Chrome Web Store. Funciona en qualsevol altre lloc on escrigueu (p. ex. Facebook, Gmail, Twitter, LinkedIn)."},zh:{message:"xinès"}},en:{accessDeniedError2:{message:"The server sent an “Access denied” message—please check your e-mail and password in the settings and try again."},addLanguage:{message:"Add language"},addToDictionaryCaption:{message:"Add “$word$” to personal dictionary",placeholders:{word:{content:"$1",example:"foobar"}}},additionalErrorSuggestionApplyButtonLabel:{message:"Apply"},aiTextCursor:{message:"AI Text Cursor"},aiTextCursorPopupSettingDescription:{message:"Turns your blinking text cursor into a productivity powerhouse."},aiTextCursorSettingDescription:{message:'Turns your blinking text cursor into a context-sensitive productivity powerhouse. Provides quick access to advanced features like <strong>generative AI, translation, emoji picker, GIFs,</strong> <a href="https://languagetool.org/text-cursor" target="_blank">and many more</a>.'},appDesc:{message:"Instantly Enhance Your Texts with LanguageTool’s Grammar Checker and Paraphrasing Tool"},appDescThunderbird:{message:"Check your e-mails for spelling and grammar issues"},appName:{message:"AI Grammar Checker & Paraphraser – LanguageTool"},ar:{message:"Arabic"},ast:{message:"Asturian"},attachScreenshot:{message:"Attach screenshot of the page"},autoCheckDesc:{message:"Auto-check on all domains by default"},autoCheckOnDomainsDesc:{message:"Auto-check text on these domains:"},be:{message:"Belarusian"},br:{message:"Breton"},ca:{message:"Catalan"},ca_ES_valencia:{message:"Catalan (Valencian)"},cardContentShowAll:{message:"Show all"},cardContentShowSubset:{message:"Show less"}
231,cardMessageLoadingTimeCaption:{message:"Hang tight – we’re checking things over"},cardMessageLoadingTimeText:{message:"This process is taking longer than usual. You can close the card for now and check back later. Thanks for your patience!"},cardSelectorLabelAITools:{message:"AI Tools"},cardSelectorLabelChecker:{message:"Correct"},cardSelectorLabelParaphraser:{message:"Paraphrase"},changelogDiscountExpires:{message:"Offer expires in"},changelogTitle:{message:"New LanguageTool features"},close:{message:"Close"},cloudServer:{message:"Cloud server (languagetool.org)"},confirm:{message:"Okay, got it"},connectionProblem:{message:"Cannot connect to $serverUrl$—please check your internet connection or try again in a minute",placeholders:{serverUrl:{content:"$1",example:"https://api.languagetool.org/v2"}}},contextMenuValidate:{message:"Check spelling and grammar…"},contextMenuValidateInEditor:{message:"Check text in Editor"},continue:{message:"Continue"},correctAllQuotes:{message:"Correct all quotes"},crh:{message:"Crimean Tatar"},customSuggestionError:{message:"Style Guide"},da:{message:"Danish"},da_DK:{message:"Danish (Denmark)"},de:{message:"German"},de_AT:{message:"German (Austrian)"},de_CH:{message:"German (Swiss)"},de_DE:{message:"German (Germany)"},de_DE_x_simple_language:{message:"German (Simple Language)"},defaultServerLink:{message:"Use default"},deleteWord:{message:"Delete"},desktopAppAction:{message:"Download for FREE"},desktopAppHeadlineMac:{message:"Check Texts in Your Favorite Apps"},desktopAppHeadlineWindows:{message:"Check Texts in Your Favorite Apps"},desktopAppTextMac:{message:"LanguageTool for Mac corrects your writing directly in Apple Mail, Pages, Word, Slack, and many more applications."},desktopAppTextWindows:{message:"LanguageTool for Windows is now available and corrects your writing directly in Outlook, Word, and many more applications."},dialogAllLanguages:{message:"All languages:"},dialogCounterCharactersOption:{message:"Characters"},dialogCounterCharactersPlural:{message:"$number$ characters",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterCharactersSingular:{message:"1 character"},dialogCounterSentencesOption:{message:"Sentences"},dialogCounterSentencesPlural:{message:"$number$ sentences",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterSentencesSingular:{message:"1 sentence"},dialogCounterWordsOption:{message:"Words"},dialogCounterWordsPlural:{message:"$number$ words",placeholders:{number:{content:"$1",example:"20"}}},dialogCounterWordsSingular:{message:"1 word"},dialogDisableMenuDisableChecking:{message:"Disable on this website"},dialogDisableMenuPauseChecking:{message:"Only disable until next visit"},dialogEnableInDialogHeadline:{message:"Add-on is disabled"},dialogEnableInDialogText:{message:"Click to enable Spelling and Grammar Check."},dialogFailStateHeadline:{message:"Oops…"},dialogFailStateText:{message:"Something went wrong. Please try again."},dialogMainMenuPickyMode:{message:"Picky mode"},dialogMainMenuPickyModeInfo:{message:"Enable the picky mode to perfect your writing."},dialogMainMenuPremiumMistake:{message:"Premium suggestions"},dialogMainMenuRegularMistake:{message:"Suggestions"},dialogMainMenuTextScore:{message:"Text score"},dialogNeedsLanguageHintHeadline:{message:"Language could not be detected"},dialogNeedsLanguageHintIgnore:{message:"Ignore for now"},dialogNeedsLanguageHintText:{message:"The language of your text could not be detected. Either set it manually or keep on typing."},dialogPositionMenuDefault:{message:"Default"},dialogPositionMenuLeft:{message:"Left"},dialogPositionMenuRight:{message:"Right"},dialogPremiumButton:{message:"Learn more"},dialogPremiumHeadlinePlural:{message:"$count$ more writing issues found",placeholders:{count:{content:"$1",example:"7"}}},dialogPremiumHeadlineSingular:{message:"1 more writing issue found"},dialogPremiumText:{message:"Get even more style, punctuation, and grammar suggestions by using LanguageTool Premium"},dialogRecommendedLanguages:{message:"Recommended for you:"},dialogScrollHintHeadline:{message:"Suggestions"},dialogScrollHintText:{message:"Scroll through your text to see more suggestions"},dialogScrollToLink:{message:"Show in text"},dialogSelectLanguageLabel:{message:"Select language"},dialogTextTooLongButton:{message:"Learn more"},dialogTextTooLongHeadline:{message:"This text is a little long"},dialogTextTooLongPremiumText:{message:"LanguageTool Premium will only show mistakes for text that is under $count$ characters.",placeholders:{count:{content:"$1",example:"150,000"}}},dialogTextTooLongText:{message:"Upgrade to Premium and get advanced grammar as well as style suggestions for long texts."},dialogTextTooShortHeadline:{message:"Text is too short"},dialogTextTooShortText:{message:"Please enter at least 5 characters to start checking for issues"},dialogTooltipDisableChecking:{message:"Disable checking"},dialogTooltipHelp:{message:"Help"},dialogTooltipHelpCenter:{message:"Go to help center"},dialogTooltipPosition:{message:"Dialog position"},dialogTooltipSaveText:{message:"Save text"},dialogTooltipSendFeedback:{message:"Send feedback"},dialogTooltipSettings:{message:"Settings"},dialogTooltipUserStatistics:{message:"Usage statistics"},dialogUnsupportedLanguageHeadline:{message:"This language is not supported"},dialogUnsupportedLanguageLabel:{message:"Unsupported language"},dialogUnsupportedLanguageText:{message:"LanguageTool supports 30+ other languages (e.g., English, German, Spanish, French, Portuguese, Dutch, or Russian)."},disableLollipop:{message:"Disable the AI Text Cursor"},dismissSuggestions:{message:"Ignore"},domainsDesc:{message:"Disable checking on some websites"},edgeWebstoreSiteNotSupported:{message:"Sorry, LanguageTool doesn’t work on the website of the Edge Add-on Store. It works anyw
231here else you write (e.g., Facebook, Gmail, Twitter, LinkedIn)."},editorCardNextIssue:{message:"Next issue"},editorCardNextSentence:{message:"Next sentence"},editorCardPreviousSentence:{message:"Previous sentence"},el:{message:"Greek"},en:{message:"English"},en_AU:{message:"English (Australian)"},en_CA:{message:"English (Canadian)"},en_GB:{message:"English (British)"},en_NZ:{message:"English (New Zealand)"},en_US:{message:"English (American)"},en_ZA:{message:"English (South Africa)"},enableEverywhereButton:{message:"Enable for every text field"},enableHereButton:{message:"Enable only for this text field"},enableInDialog:{message:"Click to enable Spelling<br>and Grammar Check"},enableRuleTooltip:{message:"Click to enable rule"},eo:{message:"Esperanto"},errorCardAllDoneCaption:{message:"Yay, no errors found!"},errorCardAllDoneDescription:{message:"You can be proud of yourself"},errorCardHiddenMatchButton:{message:"Unlock all"},errorCardHiddenMatchCaption:{message:"A taste of Premium"},errorCardKeyboardInstructions:{message:"Select via $enter$ or $shiftEnter$ to jump to next",placeholders:{enter:{content:"$1",example:"Enter"},shiftEnter:{content:"$2",example:"Shift + Enter"}}},errorCardPremiumTeaserCaptionPlural:{message:"$count$ more hidden matches found",placeholders:{count:{content:"$1",example:"7"}}},errorCardPremiumTeaserCaptionSingular:{message:"1 more hidden match found"},errorCardPremiumTeaserCta:{message:"Unlock all hidden matches"},errorCardPremiumTeaserGrammarSuggestions:{message:"Hidden <lt-em>Grammar</lt-em> suggestions"},errorCardPremiumTeaserPunctuationSuggestions:{message:"Hidden <lt-em>Punctuation</lt-em> suggestions"},errorCardPremiumTeaserReadMore:{message:"Read more"},errorCardPremiumTeaserStyleSuggestions:{message:"Hidden <lt-em>Style</lt-em> suggestions"},errorCardPremiumTeaserText:{message:"There are more matches in this text only LanguageTool Premium is able to find."},errorCardTurnOffPickyModeButton:{message:"Disable here"},errorCardTurnOffPickyModeCaption:{message:"Picky Suggestion"},errorsIgnoredByDictionary:{message:"$countIgnoredByDictionary$ words have been ignored",placeholders:{countIgnoredByDictionary:{content:"$1",example:"1"}}},errorsIgnoredByDictionarySingular:{message:"1 word has been ignored"},errorsIgnoredByRules:{message:"$countIgnoredByRules$ rules have been ignored",placeholders:{countIgnoredByRules:{content:"$1",example:"1"}}},errorsIgnoredByRulesSingular:{message:"1 rule has been ignored"},es:{message:"Spanish"},eu:{message:"Basque"},experimentalLink:{message:"Advanced settings (only for professional users)"},extensionUpdatedHeadline:{message:"This extension has been updated"},extensionUpdatedText:{message:"Please click on the $iconHtml$ icon in your browser’s toolbar or reload the page to enable spell and grammar checking again.",placeholders:{iconHtml:{content:"$1",example:"<span class='lt-placeholder-icon'></span>"}}},fa:{message:"Persian"},feedbackButton:{message:"Send message to LanguageTool"},feedbackDirectMail:{message:"If you want to send screenshots, you can also e-mail us via $email$.",placeholders:{email:{content:"$1",example:"[email protected]"}}},feedbackError:{message:"Sorry. Could not send your message. Please try again later."},feedbackHeadline:{message:"Send your feedback to LanguageTool"},feedbackPrivacyPolicy:{message:"Privacy Policy"},feedbackSenderPlaceholder:{message:"Enter your e-mail address …"},feedbackSuccess:{message:"Thanks for sending us your feedback."},feedbackTextPlaceholder:{message:"Enter your feedback …"},fixSentenceCardHeadlineApply:{message:"Correct complete sentence"},fixSentenceCardHeadlineLoading:{message:"Looking for sentence fix…"},fixSentenceCardHeadlineMissing:{message:"Sorry, found no fix"},forcePreferredLanguagesOptionLabel:{message:"Always only use these languages for automatic language detection"},fr:{message:"French"},ga:{message:"Irish"},generalSettingsHeadline:{message:"General settings"},gl:{message:"Galician"},googleDocsDisableButton:{message:"Disable LanguageTool in this doc"},googleDocsEnableButton:{message:"Enable LanguageTool"},googleDocsEnableHint:{message:"You can re-enable LanguageTool’s grammar and style checker here"},googleDocsNewTeaserHeadline:{message:"LanguageTool for Google Docs is here!"},googleDocsNewTeaserText:{message:"Next to each page you can now see how many issues LanguageTool has detected."},googleDocsPagelessModeUnsupported:{message:"The new “pageless” mode is currently not supported. We are already working on it."},googleSlidesDisableButton:{message:"Disable LanguageTool in this presentation"},googleSlidesEnableButton:{message:"Enable LanguageTool"},googleSlidesEnableHint:{message:"You can re-enable LanguageTool’s grammar and style checker here"},googleSlidesNewTeaserHeadline:{message:"LanguageTool for Google Slides is here!"},googleSlidesNewTeaserText:{message:"Next to each slide, LanguageTool shows you how many issues have been detected."},grammarError:{message:"Grammar"},haveAccountDesc:{message:"Create a free account at"},historicPremiumErrorsButton:{message:"Learn more"},historicPremiumErrorsHeadline:{message:"Did you know?"},historicPremiumErrorsText:{message:"You could have avoided <strong>$count$ grammar & style issues</strong> in the last days with LanguageTool Premium.",placeholders:{count:{content:"$1",example:"9"}}},historicPremiumErrorsText2:{message:"<strong>$count$ grammar and style issues</strong> could have been avoided in the last days with LanguageTool Premium.",placeholders:{count:{content:"$1",example:"9"}}},ignoreDomainsCheckDesc:{message:"Don’t auto-check on these domains:"},ignoreHere:{message:"Ignore in this text"}
231,ignoredRules:{message:"These rules have been turned off, click a rule to turn it on again:"},ignoredRulesDesc:{message:"Disabled rules"},incompleteResult:{message:"Results are incomplete: Text checking was stopped due to too many errors."},invalidUsernameOrPassword:{message:"Error: Please check your e-mail and password in the settings"},is:{message:"Icelandic"},it:{message:"Italian"},ja:{message:"Japanese"},km:{message:"Khmer"},landingPageTrialEndingDaysPlural:{message:"$count$ days",placeholders:{count:{content:"$1",example:"7"}}},landingPageTrialEndingDaysSingular:{message:"1 day"},language:{message:"Language:"},languageOptionsLink:{message:"Language options"},languagetoolNotSupported:{message:"The extension doesn’t work on this website, as the website offers the same functionality"},localServer:{message:"Local server (localhost)—requires LanguageTool server running locally"},localServerDocs:{message:"documentation"},lt:{message:"Lithuanian"},managedLoginButton1:{message:"Log in"},managedLoginButton2:{message:"Log in with your corporate account"},managedLoginDescription:{message:"Please log in with your corporate account in order to use LanguageTool."},managedLoginHeadline:{message:"Log in"},messagePopupTurnOnPrimaryButton:{message:"Got it!"},messagePopupTurnOnSecondaryButton:{message:"Reactivate text checking"},messagePopupTurnOnheadline:{message:"Spell checking is disabled for this page"},messagePopupTurnOntext:{message:"To reactivate it, click on the LanguageTool icon in your toolbar and click on the “Check Grammar and Spelling” toggle button"},ml:{message:"Malayalam"},moreDetails:{message:"More details…"},motherTongueDesc:{message:"Mother tongue"},motherTongueExpl:{message:"Set mother tongue if you want to be warned about false friends when checking texts not written in your mother tongue."},msOnlineOfficeNotSupported:{message:"Sorry, Microsoft Word Online is not supported by this extension—just install <a target='_blank' href='$url$'>this extension</a> instead.",placeholders:{url:{content:"$1",example:"https://appsource.microsoft.com/de-de/product/office/WA104381727"}}},nl:{message:"Dutch"},no:{message:"Norwegian"},noErrorsFound2:{message:"Yay, no errors found!"},noErrorsFoundText:{message:"You can be proud of yourself"},notificationLollipopUndoDescription:{message:"To re-enable the AI Text Cursor, go to settings to turn it back on."},notificationLollipopUndoLabel:{message:"AI Text Cursor disabled"},notificationUndoDescription:{message:"Press %{cmd} to undo"},notificationUndoLabel:{message:"Paraphrasing applied"},onboardLanguageSelectorCta:{message:"Start using LanguageTool"},onboardLanguageSelectorDescription:{message:"To provide you the best suggestions, we need to know what languages you use most often."},onboardLanguageSelectorHeading:{message:"Select the languages you typically write"},onboardingHeadline:{message:"Your writing will now be improved"},onboardingIntro:{message:"Your text will now be checked in most text fields while you type."},onboardingIntroThunderbird:{message:"Your text will now be checked while you compose your e-mails."},onboardingNote1:{message:"Reload <strong>already opened tabs</strong> to activate the extension"},onboardingNote2:{message:"This extension does not work with text fields in the <strong>Chrome Web Store</strong> or on <strong>addons.mozilla.org</strong>"},onboardingNote3:{message:"To disable the extension for a website, click the <strong>LT icon in the browser toolbar</strong>"},onboardingNote4:{message:"<strong>Synonyms</strong> can be requested by double-clicking a word in a text field (e.g., on Gmail, Facebook, or Google Docs)"},onboardingNoteThunderbird1:{message:"Start a new email to activate the extension."},onboardingNoteThunderbird2:{message:"To disable the extension, click the LT icon in the top-right of the email composing window."},openCardAndToolboxHotkeyDesc:{message:"Keyboard shortcuts"},openCardHotkeyAlt:{message:"Alt"},openCardHotkeyCtrl:{message:"Ctrl"},openCardHotkeyDesc:{message:"Keyboard shortcut"},openCardHotkeyExpl:{message:"Press this key <strong>twice quickly</strong> at any time to use AI Tools."},openCardHotkeyOff:{message:"Off"},openCardHotkeyShift:{message:"Shift"},openToolboxHotkeyExpl:{message:"Press this key <strong>twice quickly</strong> at any time to use our AI Tools."},otherServer:{message:"Other server—requires LanguageTool server running there"},overleafNewTeaserHeadline:{message:"LanguageTool for Overleaf is here!"},overleafNewTeaserText:{message:"Scroll through your text to see spelling, grammar, and style suggestions."},oxfordSpellingOptionLabel:{message:"Prefer Oxford spelling"},password:{message:"Password:"},personalDictionaryMultipleWordError:{message:"Multi-word expressions are only supported for users who have a LanguageTool account"},phrasesCardCaption:{message:"Paraphrases"},phrasesCardConfirmationButton:{message:"Accept Privacy Policy"},phrasesCardConfirmationHeading:{message:"Paraphrase your sentences with A.I."},phrasesCardConfirmationText:{message:"You need a shorter, more fluent, or more formal text? We’ve got you covered. Please consult our <a target='_blank' href='$privacyUrl$' rel='noopener'>Privacy Policy</a> regarding data processing.",placeholders:{privacyUrl:{content:"$1",example:"https://languagetool.org/legal/privacy"}}},phrasesCardFilterEmpty:{message:"All results"},phrasesCardGeneralError:{message:"There was an error loading phrases"},phrasesCardHeadline:{message:"AI-generated alternatives"},phrasesCardLabelFluency:{message:"Fluent"},phrasesCardLabelFormality:{message:"Formal"},phrasesCardLabelGeneral:{message:"Paraphrased"},phrasesCardLabelParaphrase:{message:"Fluent"},phrasesCardLabelShortened:{message:"Concise"},phrasesCardLabelSimplicity:{message:"Simple"},phrasesCardNoResult:{message:"Unfortunately, no paraphrasing option could be generated for this sentence."},phrasesCardNoSentence:{message:"Could not detect sentence."},phrasesCardNotSupportedHeading:{message:"Sentence paraphrasing not available… yet"},phrasesCardNotSupportedText:{message:"Sentence paraphrasing is currently not available for this language (but for English, Spanish, …). We’re <strong>working hard</strong> to make it available for other languages as soon as possible."},phrasesCardRephrasingLimitPlural:{message:"Limited to <strong>$count$</strong> more sentences today",placeholders:{count:{content:"$1",example:"3"}}},phrasesCardRephrasingLimitSingular:{message:"Limited to <strong>one</strong> more sentence today"},phrasesCardRephrasingLimitUnlock:{message:"Unlock unlimited!"},phrasesCardSentencePrefix:{message:"Original"},phrasesCardTimeoutError:{message:"The server did not respond in time."},pl:{message:"Polish"},popupGeneralSettingsHeadline:{message:"General settings"},popupGlobalSettingsHeadline:{message:"Global settings"},popupGlobalSettingsHeadlineInfo:{message:"All websites"},popupOnboardingHeadline:{message:"Welcome! You can now use LanguageTool:"},popupOnboardingStep1:{message:"Click in any multi-line text field (e.g., on Gmail, Facebook, …)"},popupOnboardingStep2:{message:"You will find an icon that looks like $icon1Html$ or $icon2Html$ in the bottom-right corner",placeholders:{icon1Html:{content:"$1",example:"<span class='icon-1'></span>"},icon2Html:{content:"$2",example:"<span class='icon-2'></span>"}}},popupOnboardingStep3:{message:"Type some text. Writing issues will be <u>underlined</u>"},popupOnboardingStep4:{message:"Click on an underlined word to get suggestions"},popupOpenEditorButton:{message:"Open Editor to check text"},popupOptionCaseText:{message:"Check upper and lower case"},popupOptionCheckText:{message:"Enable LanguageTool"},popupOptionContextMenu:{message:"Show in right-click menu"},popupOptionContextMenuDescription:{message:"Simply select text on any website, right click, and check it for grammar mistakes."},popupOptionPickyMode:{message:"Picky mode"},popupOptionPickyModeDescription:{message:"For perfect style, tonality, and typography"},popupOptionRephrasing:{message:"Paraphrasing functionality"},popupOptionRephrasingDescription:{message:"Rewrite entire sentences with AI. Simply place your mouse over the symbol located in the bottom-right corner of every text field and click the paraphrasing icon to get suggestions for the current sentence."},popupOptionSynonyms:{message:"Enable double-click"}
231,popupOptionSynonymsDescription:{message:"Double-click a word in a multiline text field to see synonyms and paraphrased sentences."},popupOptionValidate:{message:"Check selected text"},popupOptionValidateInEditor:{message:"Check selected text in Editor"},popupPremiumHeadline:{message:"Write like a Pro"},popupPremiumLink:{message:"Learn more"},popupPremiumText:{message:"Upgrade to LanguageTool Premium to not only find more grammar and punctuation errors, but also text style issues."},popupSettingsHeadline:{message:"Settings for this website"},popupSettingsHeadlineInfo:{message:"Current website"},popupSettingsHover:{message:"More advanced settings"},popupTrialEndedDescription:{message:"Upgrade to keep using this browser extension and enhance your writing quality across the web."},popupTrialEndedHeadline:{message:"Your Premium trial has ended"},popupTrialEndingInDays:{message:"Your Premium trial ends in <strong>$count$ days</strong>",placeholders:{count:{content:"$1",example:"14"}}},popupTrialEndingToday:{message:"Your Premium trial ends <strong>today</strong>"},popupTrialEndingTomorrow:{message:"Your Premium trial ends <strong>tomorrow</strong>"},popupUserStatisticsHover:{message:"Show usage statistics"},poweredBy:{message:"Powered by <b>LanguageTool</b>"},premiumErrorsButton:{message:"Learn more"},premiumErrorsTextPlural:{message:"Your text contains <strong>$count$ advanced writing issues</strong>",placeholders:{count:{content:"$1",example:"7"}}},premiumErrorsTextSingular:{message:"Your text contains <strong>one advanced writing issue</strong>"},privacyHeadline:{message:"Welcome to LanguageTool"},privacyLinkForDefaultServer:{message:"For details, see <a href='$privacyUrl$' target='_blank'>our privacy policy</a>",placeholders:{privacyUrl:{content:"$1",example:"https://languagetool.org/privacy/"}}},privacyListSwitchable:{message:"Checking can be <strong>disabled at any time</strong>"},privacyListUnsaved:{message:"<strong>Your text will not be stored</strong>"},privacyNoteForDefaultServer:{message:"This extension will check your text by sending it to <a href='$serverUrl$' target='_blank'>$serverHost$</a> over an encrypted connection.",placeholders:{serverUrl:{content:"$1",example:"https://languagetool.org"},serverHost:{content:"$2",example:"LanguageTool.org"}}},privacyNoteForOtherServer:{message:"This extension will check your text by sending it to $serverUrl$. To switch back to the default server, please visit the extension’s options page.",placeholders:{serverUrl:{content:"$1",example:"http://localhost:8081/"}}},privacyNoteSlogan:{message:"Your writing assistant"},privacyPolicy:{message:"Privacy Policy"},pt:{message:"Portuguese"},pt_AO:{message:"Portuguese (Angola preAO)"},pt_BR:{message:"Portuguese (Brazil posAO)"},pt_CV:{message:"Portuguese (Cape Verde)"},pt_MZ:{message:"Portuguese (Mozambique preAO)"},pt_PT:{message:"Portuguese (Portugal posAO)"},pt_PT_post_reform:{message:"Portuguese (Portugal posAO)"},pt_PT_pre_reform:{message:"Portuguese (Portugal preAO)"},punctuationError:{message:"Punctuation"},ratingHeadline:{message:"How do you like LanguageTool?"},ratingText:{message:"Give us your feedback"},ratingThankYou:{message:"Thank you."},ratingUnhappyQuestion:{message:"Please tell us why you are unhappy"},removeExtraWhitespace:{message:"Remove extra white space"},rephrasingTeaserCaption:{message:"Need more right away?"},rephrasingTeaserCountdownSuffix:{message:"$count$ Paraphrasings",placeholders:{count:{content:"$1",example:"3"}}},rephrasingTeaserCountdownText:{message:"Get more tomorrow"}
231,rephrasingTeaserCta:{message:"Unlock all Premium benefits"},rephrasingTeaserDescription:{message:"Benefit from unlimited paraphrasing and much more:"},rephrasingTeaserListItem1:{message:"<strong>Check up to $count$</strong> characters in a single text",placeholders:{count:{content:"$1",example:"3"}}},rephrasingTeaserListItem2:{message:"<strong>Advanced style suggestions</strong> for even better texts"},rephrasingTeaserListItem3:{message:"<strong>Unlimited paraphrasing</strong> to make your text more versatile"},replaceWithWhitespace:{message:"Replace with white space"},reportAnIssue:{message:"Send feedback"},reviewChromeHeadline:{message:"Would you give us a rating in the Chrome Store?"},reviewEdgeHeadline:{message:"Would you give us a rating in the Edge Add-ons Store?"},reviewFirefoxHeadline:{message:"Would you give us a rating in the Firefox Store?"},reviewLink:{message:"Rate now"},reviewOperaHeadline:{message:"Would you give us a rating in the Opera Add-ons Store?"},reviewSafariHeadline:{message:"Would you give us a rating in the App Store?"},ro:{message:"Romanian"},ru:{message:"Russian"},save:{message:"Save"},sendFeedback:{message:"Send feedback"},sentenceSplittingCardApplyButtonLabel:{message:"Apply"},sentenceSplittingCardHeadlineApply:{message:"Suggestion:"},sentenceSplittingCardHeadlineLoading:{message:"Splitting the sentence…"},sentenceSplittingCardHeadlineMissing:{message:"Sorry, no suggestion found"},serverNotAvailable:{message:"Local server not available"},serverText:{message:"LanguageTool server:"},serverUrlIsInvalid:{message:"This URL is not valid"},settingsAccountBulletListEditor:{message:"Use the editor as a distraction-free writing environment"},settingsAccountBulletListSave:{message:"Save texts for later "},settingsAccountBulletListSync:{message:"Synchronize your settings and personal dictionary across multiple browsers and devices"},settingsAccountDescription:{message:"Log in and benefit from the following advantages:"},settingsAccountHeadline:{message:"Account"},settingsAccountSubheadline:{message:"Log in with your LanguageTool account"},settingsAddAutoCheckDomainHint:{message:"This domain hasn’t been added yet. Press RETURN to add it."},settingsAddDomainHint:{message:"This domain hasn’t been added yet. Press RETURN to add it."},settingsAddIgnoredDomainHint:{message:"This domain hasn’t been added yet. Press RETURN to add it."},settingsAddOrFilterAutoCheckDomains:{message:"Add or find domain …"},settingsAddOrFilterDomains:{message:"Add or find domain …"},settingsAddOrFilterIgnoredDomains:{message:"Add or find domain …"},settingsAddOrFilterWords:{message:"Add or find word …"},settingsAddWordHint:{message:"This word doesn’t exist yet in your dictionary. Press RETURN to add it."},settingsAreYouSure:{message:"Are you sure? There’s no undo."},settingsCheckForPaidSubscriptionError:{message:"Checking your subscription status failed"},settingsClearAll:{message:"Clear all"},settingsCopyDictionary:{message:"Copy to clipboard"},settingsCopyDictionarySuccessful:{message:"Copied to clipboard"},settingsDeleteAutoCheckDomain:{message:"Delete domain"},settingsDeleteIgnoredDomain:{message:"Delete domain"},settingsDictionaryHeadline:{message:"Personal dictionary"},settingsDomainInvalid:{message:"Please enter a valid domain that hasn’t been added yet."},settingsEmptyAutoCheckDomains:{message:"You haven’t enabled auto-check on any websites yet"},settingsEmptyDictionary:{message:"Your personal dictionary is currently empty"},settingsEmptyDomainList:{message:"You haven’t disabled any websites yet"},settingsEmptyIgnoredDomains:{message:"You haven’t disabled auto-check on any websites yet"},settingsEmptyIgnoredRules:{message:"You haven’t disabled any rules yet. You can disable rules once they appear in a text."},settingsEnableAllRules:{message:"Enable all"},settingsEnableDomain:{message:"Enable domain"},settingsExperimentalSuccess:{message:"Your settings have been successfully saved."},settingsForgotPasswordLink:{message:"Forgot your password?"},settingsHeadline:{message:"Settings"},settingsImprintLink:{message:"Imprint"},settingsLanguageVariantsDescription:{message:"To always provide you with the best suggestions, please let us know which variant of the individual languages you speak."},settingsLanguageVariantsHeadline:{message:"Language variants"},settingsLoggedInAs:{message:"You’re logged in as $email$.",placeholders:{email:{content:"$1",example:"<strong>[email protected]</strong>"}}},settingsLoginButton:{message:"Login"},settingsLoginError:{message:"You couldn’t be logged in. Please check your e-mail and password."},settingsLoginSuccess:{message:"You are now logged in"},settingsLogoutButton:{message:"Logout"},settingsLogoutSuccess:{message:"You have logged out"},settingsManageAccountButton:{message:"Manage account"},settingsPasswordPlaceholder:{message:"Password"},settingsPreferredLanguagesCompleteList:{message:"All languages"},settingsPreferredLanguagesDescription:{message:"Set the languages you usually use to write texts. This helps LanguageTool in automatically detecting the right language."},settingsPreferredLanguagesHeadline:{message:"Preferred languages"},settingsPreferredLanguagesPopularList:{message:"Popular languages"},settingsPremiumButton:{message:"Discover LanguageTool Premium"},settingsPremiumFeaturesActivated:{message:"All <strong>premium features</strong> are activated."},settingsPremiumHeadline:{message:"Upgrade your writing game"},settingsPremiumLearnMore:{message:"Why we made this change"},settingsPremiumText:{message:"Find advanced grammar, style, and punctuation issues or check texts with up to 150,000 characters."},settingsPrivacyPolicyLink:{message:"Privacy Policy"},settingsServerUrlDisabled:{message:"You can only set a custom server when you log out of your LanguageTool account."},settingsTermsOfServiceLink:{message:"Terms of Service"},settingsTrialEndedDescription:{message:"Upgrade to maintain access to this browser add-on and enhance the quality of your writing."},settingsTrialEndedHeadline:{message:"Your LanguageTool Premium trial has ended"},settingsTrialEndingInDays:{message:"Your LanguageTool Premium trial ends in $count$ days",placeholders:{count:{content:"$1",example:"14"}}},settingsTrialEndingToday:{message:"Your LanguageTool Premium trial ends today"},settingsTrialEndingTomorrow:{message:"Your LanguageTool Premium trial ends tomorrow"},settingsUnknownError:{message:"An unexpected error happened"},siteDisabledPerGroupPolicy:{message:"Checking on this site is disabled per Group Policy."},siteTemporarilyUnsupported:{message:"Sorry, LanguageTool has temporarily disabled support for this website. We are currently working on a fix. It should only be a matter of days."},sk:{message:"Slovak"},skip:{message:"Skip"},sl:{message:"Slovenian"},spellingError:{message:"Spelling"},sr:{message:"Serbian"},sr_BA:{message:"Serbian (Bosnia)"},sr_HR:{message:"Serbian (Croatia)"}
231,sr_ME:{message:"Serbian (Montenegro)"},sr_RS:{message:"Serbian (Serbia)"},statusIconEnableLT:{message:"Enable LanguageTool—Spelling and Grammar Check"},statusIconError:{message:"Error"},statusIconMoreErrors:{message:"Results are incomplete: Text checking was stopped due to too many errors."},statusIconPermissionRequired:{message:"Cannot check text—confirm privacy policy first"},statusIconReload:{message:"The extension has been updated. Please reload page to enable spell and grammar checking."},statusIconToolTip:{message:"LanguageTool—Spelling and Grammar Check"},suggestionError:{message:"Style"},suggestionOnlyVisibleToPremiumButton:{message:"Access all benefits of Premium"},suggestionOnlyVisibleToPremiumText:{message:"This is an advanced suggestion that is only available in the Premium version of LanguageTool. Upgrade to Premium to get suggestions like this and many more."},sv:{message:"Swedish"},switchToAmericanEnglish:{message:"Switch to American English"},switchToAustralianEnglish:{message:"Switch to Australian English"},switchToBritishEnglish:{message:"Switch to British English"},switchToCanadianEnglish:{message:"Switch to Canadian English"},switchToNewZealandEnglish:{message:"Switch to New Zealand English"},switchToSouthAfricanEnglish:{message:"Switch to South African English"},synonymsCardGeneralError:{message:"There was an error loading synonyms"},synonymsCardHeadline:{message:"Synonyms"},synonymsCardLanguageNotSupported:{message:"Synonyms for this language aren’t supported yet."},synonymsCardLess:{message:"less"},synonymsCardLoadMoreAlternatives:{message:"load more alternatives"},synonymsCardLoading:{message:"Loading …"},synonymsCardMore:{message:"more"},synonymsCardNoSynonymsAvailable:{message:"No synonyms available for this word"},synonymsCardProvidedBy:{message:"Provided by <strong>LanguageTool</strong>"},synonymsCardTabSentence:{message:"Sentence"},synonymsCardTabWord:{message:"Word"},synonymsCardTooltipReadText:{message:"Pronounce word"},synonymsTutorialHeadline:{message:"How to get synonyms"},synonymsTutorialText:{message:"Get synonyms for any word by double-clicking on it. Works in every text field that LanguageTool supports."},ta:{message:"Tamil"},termsOfServiceUpdateAcceptButton:{message:"I accept"},termsOfServiceUpdateHeadline:{message:"Update to LanguageTool’s Service Terms and Privacy Policy"},termsOfServiceUpdateSkipButton:{message:"Later"},termsOfServiceUpdateText:{message:"Please review LanguageTool’s updated <lt-em>Service Terms</lt-em> and <lt-em>Privacy Policy</lt-em>, effective December 19, 2024. By clicking “$button$”, you agree to LanguageTool’s updated Service Terms and acknowledge reading its updated Privacy Policy.",placeholders:{button:{content:"$1",example:"I accept"}}},termsOfServiceUpdateTextLoggedOut:{message:"Please review LanguageTool’s updated <lt-em>Service Terms</lt-em> and <lt-em>Privacy Policy</lt-em>, effective December 19, 2024. Please review LanguageTool’s updated Service Terms and Privacy Policy, effective December 19, 2024. By continuing to use LanguageTool’s products and services on or after December 19, you agree to the updated Service Terms and acknowledge that you have read the updated Privacy Policy."},termsOfServiceUpdateUnderstoodButton:{message:"Got it"},textTooLong:{message:"Sorry, this text is too long to be checked."},timeoutError:{message:"Timeout from server—please try again later ($serverUrl$)",placeholders:{serverUrl:{content:"$1",example:"https://languagetool.org:8081/"}}},tl:{message:"Tagalog"},tooManyErrors:{message:"This text seems to contain too many issues. Are you sure that the correct language is selected?"},tooManyRequests:{message:"Request limit exceeded—please wait a minute and LanguageTool should be available again."},toolbarDisableMenuDisableChecking:{message:"Disable on this website"},toolbarDisableMenuPauseChecking:{message:"Only disable until next visit"},toolbarTooltipDisableChecking:{message:"Disable checking"},toolbarTooltipRephrasing:{message:"Paraphrase sentence"},toolbarTooltipRephrasingUnsupportedLanguage:{message:"Sentence paraphrasing is currently not available in this language."},toolboxKeyboardShortcut:{message:"or press $shortcut$ twice",placeholders:{shortcut:{content:"$1",example:"CTRL"}}},toolboxOnboardingCtaLabel:{message:"Start →"},toolboxOnboardingHeading:{message:"Start using the AI Text Cursor!"},toolboxOnboardingLearnMore:{message:"Learn more"},toolboxOnboardingMessage:{message:"Get ready for enhanced productivity and creativity: Simply click on the AI Text Cursor to rephrase text, edit using AI, or add emojis and GIFs."},toolboxTooltip:{message:"Show AI Tools"},tr:{message:"Turkish"},trialOnboardingDescription:{message:"Inside the browser add-on, all premium features are now enabled for you. Abs
231olutely free, with <strong>no hidden fees</strong>."},trialOnboardingEndInfo1:{message:"Premium trial ends automatically"},trialOnboardingEndInfo2:{message:"You don't have to do anything. You will not be charged. If you want to continue using the LanguageTool browser add-on, you can subscribe to Premium <a>here</a>."},trialOnboardingHeadline:{message:"Experience LanguageTool Premium — Free for 14 Days"},trialOnboardingLogin:{message:"<a>Log in</a> if you already have a Premium account"},trialOnboardingTimeline:{message:"Timeline:"},trialOnboardingToday:{message:"Today"},trialOnboardingTodayInfo1:{message:"All premium features unlocked"},trialOnboardingTodayInfo2:{message:"Get the most out of LanguageTool: Generative AI, advanced grammar checking, translation, paraphrasing, and much more."},tryAgain:{message:"Try again"},turnOffPickyMode:{message:"Turn off picky mode in this text"},turnOffRule:{message:"Turn off rule everywhere"},turnOffRulePicky:{message:"Grammar suggestions cannot be turned off in picky mode"},turnOnHint:{message:"You can enable the extension again here"},uk:{message:"Ukrainian"},unknownError:{message:"Sorry, something went wrong while checking your text. Restarting your browser might solve this."},upgradeTeaserDiscount:{message:"Save $percent$%",placeholders:{percent:{content:"$1",example:"20"}}},upgradeTeaserDiscountHeadline:{message:"Limited-Time Offer"},username:{message:"E-Mail:"},validatorHasMistakesHeadlinePlural:{message:"$count$ writing issues found",placeholders:{count:{content:"$1",example:"7"}}},validatorHasMistakesHeadlineSingular:{message:"One writing issue found"},validatorHasMistakesText:{message:"Click on the highlighted words to correct them."},validatorHasPremiumErrorsButton:{message:"Learn more"},validatorHasPremiumErrorsHeadlinePlural:{message:"Your text contains $count$ advanced writing issues",placeholders:{count:{content:"$1",example:"7"}}},validatorHasPremiumErrorsHeadlineSingular:{message:"Your text contains one advanced writing issue"},validatorHasPremiumErrorsText:{message:"Upgrade to LanguageTool Premium to find many more grammar, style, and punctuation mistakes"},validatorLoadingHint:{message:"Checking text …"},validatorNoMistakesHeadline:{message:"Congrats, no errors found!"},validatorNoTextStatus:{message:"Type or paste your text to check it"},validatorPlaceholder:{message:"Please enter or paste your text here …"},validatorPremiumButton:{message:"Upgrade"},validatorPremiumHeadline:{message:"Find more writing issues and become a better writer"},validatorPremiumReason1:{message:"More sophisticated grammar, punctuation, and style checking"},validatorPremiumReason2:{message:"Check longer texts (up to 150,000 characters)"},validatorPremiumReason3:{message:"Auto-detection for invalid numbers (e.g., IBAN, ISBN, …)"},validatorPremiumReason4:{message:"Full access to this browser add-on"},validatorTextTooLongStatus:{message:"Sorry, this text is too long to be checked."},validatorTrialEndedText:{message:"Upgrade to unlock these and more Premium benef
231its:"},variantCaDesc:{message:"Interpret Catalan as:"},variantDeDesc:{message:"Interpret German as:"},variantEnDesc:{message:"Interpret English as:"},variantPtDesc:{message:"Interpret Portuguese as:"},webstoreSiteNotSupported:{message:"Sorry, LanguageTool doesn’t work on the website of the Chrome Web Store. It works anywhere else you write (e.g., Facebook, Gmail, Twitter, LinkedIn)."},zh:{message:"Chinese"}}}},
231"./common/mutationObservers/aggregatingMutationObserver.ts":
232/*!*****************************************************************!*\
233  !*** ./common/mutationObservers/aggregatingMutationObserver.ts ***!
234  \*****************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{AggregatingMutationObserver:()=>s});class s{static _aggregateMutations(e){const t=[],n=new Map,s=new Map,r=new Map;for(const t of e)if("attributes"===t.type){const e=t.target;let s=n.get(e);s||(s=new Map,n.set(e,s));const r=(t.attributeNamespace??"")+"="+t.attributeName;s.has(r)||s.set(r,t.oldValue)}else if("characterData"===t.type){const e=t.target;s.has(e)||s.set(e,t.oldValue)}else if("childList"===t.type){const e=t.target;let n=r.get(e);n||(n=[],r.set(e,n)),n.push(t)}for(const[e,s]of n.entries())for(const[n,r]of s.entries()){const s=n.split("="),i=""!==s[0]?s[0]:null,o=s[1];e.getAttributeNS(i,o)!==r&&t.push({addedNodes:[],attributeName:o,attributeNamespace:i,oldValue:r,removedNodes:[],target:e,type:"attributes"})}for(const[e,n]of s.entries())e.textContent!==n&&t.push({addedNodes:[],attributeName:null,attributeNamespace:null,oldValue:n,removedNodes:[],target:e,type:"characterData"});for(const[e,n]of r.entries()){const s=new Set,r=new Set;for(const e of n){for(let t=0;t<e.addedNodes.length;t++){const n=e.addedNodes[t];r.has(n)?r.delete(n):s.add(n)}for(let t=0;t<e.removedNodes.length;t++){const n=e.removedNodes[t];s.has(n)?s.delete(n):r.add(n)}}0===s.size&&0===r.size||t.push({addedNodes:Array.from(s),attributeName:null,attributeNamespace:null,oldValue:null,removedNodes:Array.from(r),target:e,type:"childList"})}return t}constructor(e){this._onMutations=this._onMutations.bind(this),this._callback=e,this._mutationObserver=new MutationObserver(this._onMutations)}_onMutations(e){const t=this._processMutations(e);t.length>0&&this._callback(t,this)}_processMutations(e){return s._aggregateMutations(e)}observe(e,t={}){const n=Object.assign({},t);n.attributes&&(n.attributeOldValue=!0),n.characterData&&(n.characterDataOldValue=!0),this._mutationObserver.observe(e,n)}disconnect(){this._mutationObserver.disconnect()}takeRecords(){const e=this._mutationObserver.takeRecords();return this._processMutations(e)}}},
234"./common/mutationObservers/filteringMutationObserver.ts":
235/*!***************************************************************!*\
236  !*** ./common/mutationObservers/filteringMutationObserver.ts ***!
237  \***************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{FilteringMutationObserver:()=>r});var s=n(/*! ./aggregatingMutationObserver */"./common/mutationObservers/aggregatingMutationObserver.ts");
238/*! (C) Copyright 2021 LanguageTooler GmbH. All rights reserved. */class r extends s.AggregatingMutationObserver{constructor(e,t){super(e),this._isIgnored=t}_processMutations(e){return super._processMutations(e).filter((e=>!this._isIgnored(e)))}}},
238"./common/smoothscroll.js":
239/*!********************************!*\
240  !*** ./common/smoothscroll.js ***!
241  \********************************/()=>{!function(){"use strict";
242/*! *****************************************************************************
243    Copyright (c) Microsoft Corporation. All rights reserved.
244    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
245    this file except in compliance with the License. You may obtain a copy of the
246    License at http://www.apache.org/licenses/LICENSE-2.0
247
248    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
249    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
250    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
251    MERCHANTABLITY OR NON-INFRINGEMENT.
252
253    See the Apache Version 2.0 License for specific language governing permissions
254    and limitations under the License.
255    ***************************************************************************** */var e,t=function(){return t=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)},n=function(e){return.5*(1-Math.cos(Math.PI*e))},s=function(){return Date.now()},r=function(e){var t=(s()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();var i=(e.timingFunc||n)(t),o=e.startX+(e.targetX-e.startX)*i,a=e.startY+(e.targetY-e.startY)*i;e.method(o,a),e.rafId=requestAnimationFrame((function(){r(e)}))},i=function(t,n,i){var o=(void 0===e&&(e=Element.prototype.scroll||Element.prototype.scrollTo||function(e,t){this.scrollLeft=e,this.scrollTop=t}),e).bind(t);if(void 0!==n.left||void 0!==n.top){var a=t.scrollLeft,l=t.scrollTop,c=n.left,d=void 0===c?a:c,h=n.top,u=void 0===h?l:h;if("smooth"!==n.behavior)return o(d,u);var g=t.style.scrollBehavior;t.style.scrollBehavior="auto";var m=function(){window.removeEventListener("wheel",_),window.removeEventListener("touchmove",_),t.style.scrollBehavior=g},p={timeStamp:s(),duration:n.duration,startX:a,startY:l,targetX:d,targetY:u,rafId:0,method:o,timingFunc:n.timingFunc,callback:function(){m(),i&&i()}},_=function(){cancelAnimationFrame(p.rafId),m()};window.addEventListener("wheel",_,{passive:!0,once:!0}),window.addEventListener("touchmove",_,{passive:!0,once:!0}),r(p)}},o=function(e,t,n,s){var r=0===t&&n||1===t&&!n?e.inline:e.block;return"center"===r?1:"nearest"===r?0:"start"===r?0===t?s?5:4:2:"end"===r?0===t?s?4:5:3:n?0===t?0:2:0===t?4:0};function a(e,t,n,s,r,i,o,a){return i<e&&o>t||i>e&&o<t?0:i<=e&&a<=n||o>=t&&a>=n?i-e-s:o>t&&a<n||i<e&&a>n?o-t+r:0}var l=function(e){return"visible"!==e&&"clip"!==e},c=function(e){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var t=getComputedStyle(e);return l(t.overflowY)||l(t.overflowX)}return!1},d=function(e){var t=e.parentNode;return t&&(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?t.host:t)},h=function(e){try{const n=e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentElement:e.startContainer,s=(t=n,Array.from(window.top.document.querySelectorAll("iframe, frame")).find((e=>e.contentDocument===t.ownerDocument)));if(!s)return!1;const r=window.top.innerWidth||window.top.document.documentElement.clientWidth,i=window.top.innerHeight||window.top.document.documentElement.clientHeight,o=s.getBoundingClientRect(),a=e.getBoundingClientRect(),l=o.left+a.left,c=o.top+a.top,d=o.left+a.left+a.width,h=o.top+a.top+a.height;return c>=0&&h<=i&&l>=0&&d<=r}catch(e){return!1}var t};window.scrollRangeIntoView=function(e,n,s){for(var r,l,u=document.scrollingElement||document.documentElement,g=[],m=e.startContainer,p=d(m);null!==p;p=d(p)){if(p===u){g.push(p);break}p===document.body&&c(p)&&!c(document.documentElement)||c(p)&&g.push(p)}var _=window.visualViewport?window.visualViewport.width:innerWidth,E=window.visualViewport?window.visualViewport.height:innerHeight,f=window.scrollX||window.pageXOffset,T=window.scrollY||window.pageYOffset,C=e.getBoundingClientRect(),v=C.height,S=C.width,b=C.top,x=C.right,y=C.bottom,A=C.left,k=getComputedStyle(m instanceof HTMLElement?m:m.parentNode),w=k.writingMode||k.webkitWritingMode||k.getPropertyValue("-ms-writing-mode")||"horizontal-tb",R=["horizontal-tb","lr","lr-tb","rl"].some((function(e){return e===w})),L=["vertical-rl","tb-rl"].some((function(e){return e===w})),M=o(n,0,R,L),I=o(n,1,R,L),P=function(){switch(I){case 2:case 0:return b;case 3:return y;default:return b+v/2}}(),N=function(){switch(M){case 1:return A+S/2;case 5:return x;default:return A}}(),O=[],D=function(e){var s=e.getBoundingClientRect(),r=s.height,o=s.width,l=s.top,c=s.right,d=s.bottom,h=s.left,g=getComputedStyle(e),m=parseInt(g.borderLeftWidth,10),p=parseInt(g.borderTopWidth,10),C=parseInt(g.borderRightWidth,10),b=parseInt(g.borderBottomWidth,10),x=0,y=0,A="offsetWidth"in e?e.offsetWidth-e.clientWidth-m-C:0,k="offsetHeight"in e?e.offsetHeight-e.clientHeight-p-b:0;if(u===e){switch(I){case 2:x=P;break;case 3:x=P-E;break;case 1:x=P-E/2;break;case 0:x=a(T,T+E,E,p,b,T+P,T+P+v,v)}switch(M){case 4:y=N;break;case 5:y=N-_;break;case 1:y=N-_/2;break;case 0:y=a(f,f+_,_,m,C,f+N,f+N+S,S)}x=Math.max(0,x+T),y=Math.max(0,y+f)}else{switch(I){case 2:x=P-l-p;break;case 3:x=P-d+b+k;break;case 1:x=P-(l+r/2)+k/2;break;case 0:x=a(l,d,r,p,b+k,P,P+v,v)}
255switch(M){case 4:y=N-h-m;break;case 5:y=N-c+C+A;break;case 1:y=N-(h+o/2)+A/2;break;case 0:y=a(h,c,o,m,C+A,N,N+S,S)}var w=e.scrollLeft,R=e.scrollTop;x=Math.max(0,Math.min(R+x,e.scrollHeight-r+k)),y=Math.max(0,Math.min(w+y,e.scrollWidth-o+A)),P+=R-x,N+=w-y}O.push((function(s){return i(e,t(t({},n),{top:x,left:y}),s)}))};try{for(var H=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],s=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),U=H.next();!U.done;U=H.next())D(U.value)}catch(e){r={error:e}}finally{try{U&&!U.done&&(l=H.return)&&l.call(H)}finally{if(r)throw r.error}}const F=function(){try{return window.self!==window.top}catch(e){return!0}}();let B=O.length;O.forEach((function(t){return t((function(){0==--B&&(!n.skipIframePositionCheck&&F?setTimeout((()=>{h(e)?s():((e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentElement:e.startContainer).scrollIntoView({behavior:"auto"}),setTimeout(s,0))})):s())}))}))}}()},
255"./common/standaloneAdvancedToolboxAdapter.ts":
256/*!****************************************************!*\
257  !*** ./common/standaloneAdvancedToolboxAdapter.ts ***!
258  \****************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandaloneAdvancedToolboxAdapter:()=>c});var s=n(/*! ./advancedToolboxAdapter */"./common/advancedToolboxAdapter.ts"),i=n(/*! @advanced-toolbox/plugin-emoji-picker */"../../../node_modules/@advanced-toolbox/plugin-emoji-picker/dist/index.js"),o=n(/*! @advanced-toolbox/react-dom-adapater-18 */"../../../node_modules/@advanced-toolbox/react-dom-adapater-18/dist/index.mjs"),a=n(/*! ./toolboxStorageAdapter */"./common/toolboxStorageAdapter.ts"),l=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts");class c extends s.AdvancedToolboxAdapterBaseClass{preApplyToolboxResult(e){return Promise.resolve()}getToolboxEnvironment({isDev:e,source:t,uri:n}){return{type:"script",textField:"plain",capabilites:["plain"],id:"languagetool-standalone",debug:e,source:t,uri:n}}getToolboxConfig(e){const t=l.EnvironmentAdapter.getURL(r.env.EMOJI_DATA_BASE_PATH??"/"),n=(()=>{try{const e=r.env.EMOJI_LOCALES??[];if(!Array.isArray(e))throw new Error(`Expected 'EMOJI_LOCALES' to be an array; retrieved ${typeof r.env.EMOJI_LOCALES}.`);return e}catch(e){return console.error("Failed to retrieve emoji locales.",e),[]}})();return i.ToolboxPluginEmojiPicker.addAdapter(new i.ToolboxPluginEmojiPickerAdapter({emojiDataBaseUrl:t,emojiLocales:n})),{environment:e.environment,storage:a.default.create(),plugins:[i.ToolboxPluginEmojiPicker],language:e.uiLanguage,reactDomRenderer:o.reactDomRenderer,urls:{privacy:"https://languagetool.org/legal/privacy",terms:"https://languagetool.org/legal/terms",reportContent:"https://www.learneo.com/legal/illegal-content-notice",copyrightPolicy:"",communityGuidelines:""}}}canSeeLollipop(){return!1}isUsedForRephrasing(){return!1}isPremiumParaphraseMode(e,t){return!1}getParaphraserSkill(e){return null}isParaphraserSentenceSkill(e){return!1}async getLastUsedParaphraserMode(){}}},
258"./common/standaloneEnvironmentAdapter.ts":
259/*!************************************************!*\
260  !*** ./common/standaloneEnvironmentAdapter.ts ***!
261  \************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandaloneEnvironmentAdapter:()=>m});var s=n(/*! ../background/dictionarySync */"./background/dictionarySync.ts"),r=n(/*! ../core/Rephrasings */"./core/Rephrasings.ts"),i=n(/*! ../background/synonyms */"./background/synonyms.ts"),o=n(/*! ../core/Checker */"./core/Checker.ts"),a=n(/*! ../core/utils */"./core/utils.ts"),l=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),c=n(/*! ./languageManager */"./common/languageManager.ts"),d=n(/*! ./storageController */"./common/storageController.ts"),h=n(/*! ./trackerAdapter */"./common/trackerAdapter.ts"),u=n(/*! ./utils */"./common/utils.ts"),g=n(/*! ../core/userActivity */"./core/userActivity.ts");
262/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
263class m extends l.EnvironmentAdapterBaseClass{createWritingSession(e,t){throw new Error("Method not implemented.")}incrementalCheck(e,t,n,s,r){throw new Error("Method not implemented.")}constructor(){super(),this._storageController=d.StorageControllerFactory.create();const e=document.currentScript.src;this._widgetBaseURL=e.trim().replace(/[^/]*\.js(\?.*)?$/i,"")}isProductionEnvironment(){return!0}isRuntimeConnected(){return!0}getVersion(){return"standalone"}getTrackingId(){return"20"}shouldTrack(){return"1"!==navigator.doNotTrack&&/languagetool(plus)?\.(org|com)/.test(location.host)}getPinnedState(){return Promise.resolve(null)}getType(){return"standalone"}getBeforeUnloadEventName(){return"beforeunload"}getURL(e){return e.startsWith("/")||(e="/"+e),this._widgetBaseURL+e}getUILanguageCode(){return"en-US"}openWindow(e){self.open(e,"_blank")}canLoadContentScripts(){return!0}loadContentScripts(e,t){const n=e.document.head||e.document.documentElement;switch(t){case"js":{const t=[];for(const s of m.JS_FILE_RELATIVE_PATHS){const r=new Promise(((t,r)=>{const i=e.document.createElement("script");i.onload=t,i.onerror=r,i.setAttribute("src",this.getURL(s)),n.appendChild(i)}));t.push(r)}return Promise.all(t)}case"css":for(const t of m.CSS_FILE_RELATIVE_PATHS){const s=e.document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("href",this.getURL(t)),n.appendChild(s)}}return Promise.resolve()}loadStylesheets(e,t){return(Array.isArray(t)?t.map((e=>[null,e])):Object.entries(t)).forEach((([t,n])=>{const s=e.document.head||e.document.documentElement,r=e.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",this.getURL(n)),t&&r.setAttribute("id",t),s.appendChild(r)})),Promise.resolve()}injectShadowStyles(e){for(const t of m.CSS_FILE_RELATIVE_PATHS){const n=this.getURL(t);if(!e.querySelector(`link[href="${n}"]`)){const t=document.createElement("link");t.rel="stylesheet",t.href=n,e.append(t)}}}initializeLTAssistant(e,t={}){return"function"==typeof e.LTAssistant&&new e.LTAssistant(t),Promise.resolve()}injectExecutor(){return Promise.resolve()}destroyExecutor(){}addEventListener(){}updateSentenceRanges(){}executeScript(e,t){try{e.defaultView?.eval(t)}catch(e){}}linkInputAreaProperties(){}ping(){return Promise.resolve()}getPreferredLanguages(e=!1){const t=this._storageController.getSettings();let n=[];return t.motherTongue&&n.push(t.motherTongue),n=n.concat(c.LanguageManager.getUserLanguageCodes()).concat(t.geoIpLanguages),n.push("en"),n=n.map((e=>"nb"===e?"no":"fil"===e?"tl":e)),e||(n=n.map((e=>t[`${e}Variant`]||e))),Promise.resolve((0,a.uniq)(n))}startDictionarySync(){return Promise.resolve()}updateDictionary(){return Promise.resolve()}addWordToDictionary(e){return s.DictionarySync.addWord(e),Promise.resolve()}addWordsToDictionary(e){return Promise.resolve()}removeWordFromDictionary(e){return Promise.resolve()}clearDictionary(){return Promise.resolve()}loadSynonyms(e,t,n){return i.Synonyms.load(e,t,n)}abortSynonymsRequest(){return i.Synonyms.abort()}loadPhrases(e,t,n,s,i,o){return r.Rephrasings.load(e,t,n,s,i,o)}abortPhraseRequests(e){return r.Rephrasings.abort(e)}abortTranslateRequest(e){throw console.log("Implement abortTranslateRequest",e),new Error("Translate text not implemented for standalone environment")}abortGenerateImageRequest(e){throw console.log("Implement abortGenerateImageRequest",e),new Error("Abort generate image not implemented for standalone environment")}generateImage(e){throw console.log("Implement generateImage",e),new Error("Generate image not implemented for standalone environment")}initializeUserActivity(e){return g.initializeUserActivity(e)}sendUserActivityPings(e){return g.handleUserActivityPings(e)}updateUserActivityTextStatistics(e,t){return g.updateTextStatistics(e,t)}updateUserActivityAppliedSuggestions(e,t,n){return g.updateAppliedSuggestions(e,t,n)}updateUserActivityAppliedRewritings(e){return g.updateAppliedRewritings(e)}updateUserActivityMeta(e,t){return g.updateMeta(e,t)}sendUserActivity(e){return g.sendUserActivity(e)}destroyUserActivity(e){return g.sendAndDestroyUserActivity(e)}loadSplitSentence(e,t,n,s,i){return r.Rephrasings.requestSplitSentence(e,t,n,s,i)}trackEvent(e,t){return h.TrackerAdapter.trackEvent("Action",e,t),Promise.resolve()}
263pageLoaded(e,t,n,s,r){return Promise.resolve()}ltAssistantStatusChanged(e,t){return Promise.resolve()}async check(e,t,n,s,r,i){const a=await this.getPreferredLanguages(!0);e.inputArea instanceof HTMLElement&&e.inputArea.lang&&a.push(c.LanguageManager.getPrimaryLanguageCode(e.inputArea.lang));const{username:l,password:d,token:h,motherTongue:u,enVariant:g,deVariant:p,ptVariant:_,caVariant:E,dictionary:f,apiServerUrl:T}=this._storageController.getSettings(),{hasPaidSubscription:C,showRuleId:v}=this._storageController.getUIState();let S,b=null;l&&h?b={email:l,token:h}:l&&d&&(b={email:l,password:d});let x=!0;r.trialAccessToken&&!C&&(x=!1,S=r.trialAccessToken);const y={instanceId:s.instanceId,user:b,isPremium:C,apiServerUrl:T,accessToken:S,languageVariants:{en:g,de:p,pt:_,ca:E},dictionary:f,disabledRules:this._storageController.getIgnoredRuleIds(),preferredLanguages:a,motherTongue:u,writingGoalId:i,checkLevel:s.checkLevel,recipientInfo:s.recipientInfo,ignoreCapitalizationErrorsAtLineStart:r.ignoreCapitalizationErrorsAtLineStart,allowIncompleteResults:!e.forceLanguage,skipTextLevelCheck:!r.checkTextLevel,enableHiddenMatches:x,debug:v,userAgent:"standalone",version:this.getVersion(),testGroups:r.testGroups};return o.Checker.checkWithServerLanguageDetection(t,e.forceLanguage?e.language:null,y,n).then((({textLevelResult:s,paragraphLevelResult:r})=>{let i=null,o=s.language||e.language;const a=!(!o||o.name!==m.UNSUPPORTED_LANGUAGE_NAME);return a&&(i=(s.language||e.language)?.code||"",o=null),{isSuccessful:!0,instanceId:e.id,text:t,changedParagraphs:n,language:o,isUnsupportedLanguage:a,isIncompleteResult:r.isIncompleteResult,textLevelErrors:s.errors,textLevelPremiumErrors:s.premiumErrors,textLevelPremiumPickyErrors:s.premiumPickyErrors,textLevelPickyErrors:s.pickyErrors,paragraphLevelErrors:r.errors,paragraphLevelPremiumErrors:r.premiumErrors,paragraphLevelPremiumPickyErrors:r.premiumPickyErrors,paragraphLevelPickyErrors:r.pickyErrors,paragraphLevelSentenceRanges:r.sentenceRanges,unsupportedLanguageCode:i}})).catch((t=>{if(!t||"AbortError"!==t.reason)return{isSuccessful:!1,instanceId:e.id,error:{reason:t.reason,status:t.status,response:t.response,stack:t.stack}}}))}fetchRecommendationForSentence(e){return console.log("Implement this",e),Promise.resolve({instanceId:e.instanceId})}unlockRecommendation(e){return console.log("Implement this",e),Promise.reject(new Error("Unlock recommendation not implemented for standalone environment"))}translateText(e){return console.log("Implement this",e),Promise.reject(new Error("Translate text not implemented for standalone environment"))}isOptionsPageSupported(){return!1}openOptionsPage(e,t){return console.error("Options page is not supported."),Promise.resolve()}isFeedbackFormSupported(){return!1}openFeedbackForm(e,t,n){return console.error("Feedback form is not supported."),Promise.resolve()}openPremiumPage(e,t=0,n=0,s=0,r="",i){const o=(0,u.getPremiumUrl)(e,t,n,s,r,i);return this.openWindow(o),Promise.resolve()}updateSurroundingTextContext(e){return Promise.resolve({})}forceSyncEditorState(e){return Promise.resolve({editorId:e.editorId,isSuccessful:!1})}checkForPaidSubscription(){return this._storageController.checkForPaidSubscription().then((e=>({initialCommand:"CHECK_FOR_PAID_SUBSCRIPTION",isSuccessful:!0,hasPaidSubscription:e})),(e=>({initialCommand:"CHECK_FOR_PAID_SUBSCRIPTION",isSuccessful:!1,error:e})))}canUseShadowDom(){return!1}abortAllRequests(e){return e.checkRequestController&&e.checkRequestController.abort(),e.recommendationRequestAbortController.abort&&e.recommendationRequestAbortController.abort(),o.Checker.cancelAllRequests(e.id),Promise.resolve()}getTermsOfServiceInfo(){return Promise.resolve({initialCommand:"GET_TERMS_OF_SERVICE_INFO",isSuccessful:!0,isAcceptanceRequired:!1,hasAccepted:!1})}acceptTermsOfService(){return Promise.resolve()}syncUserData(){return Promise.resolve()}}m.JS_FILE_RELATIVE_PATHS=["languagetool.js"],m.CSS_FILE_RELATIVE_PATHS=["styles/fonts.css","styles/styles.css"],m.UNSUPPORTED_LANGUAGE_NAME="NoopLanguage"},
263"./common/standaloneI18nManager.ts":
264/*!*****************************************!*\
265  !*** ./common/standaloneI18nManager.ts ***!
266  \*****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandaloneI18nManager:()=>o});var s=n(/*! ./eventBus */"./common/eventBus.ts"),r=n(/*! ./i18nManager */"./common/i18nManager.ts"),i=n(/*! ./localizationData */"./common/localizationData.ts");
267/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
268class o extends r.i18nManagerBaseClass{static _formatString(e,t){return e.replace(/\$(\d+)/g,((e,n)=>{const s=+n-1;return s<t.length?t[s]+"":""}))}static _replacePlaceholders(e,t,n){const s=Object.keys(t||{});return(e=o._formatString(e,n)).replace(/\$([a-z0-9_@]+)\$/gi,((e,r)=>{const i=r.toLowerCase(),a=s.find((e=>e.toLowerCase()===i));if(!a)return"";const l=t[a];return o._formatString(l.content,n)}))}constructor(){super(),this._eventBus=new s.EventBus,this._localeCode="en"}addEventListener(e,t){this._eventBus.subscribe(e,t)}setLocale(e){this._localeCode!==e&&(this._localeCode=e,this._eventBus.fire(r.i18nManagerBaseClass.eventNames.localeChanged))}getMessage(e,t=[]){let n=null;if(i.LOCALIZATION_DATA[this._localeCode]&&(n=i.LOCALIZATION_DATA[this._localeCode][e]),!n){const t=this._localeCode.split("_")[0];i.LOCALIZATION_DATA[t]&&(n=i.LOCALIZATION_DATA[t][e])}return n||(n=i.LOCALIZATION_DATA.en[e]),n?(Array.isArray(t)||(t=[t]),o._replacePlaceholders(n.message,n.placeholders||{},t)):""}}},
268"./common/standaloneStorageController.ts":
269/*!***********************************************!*\
270  !*** ./common/standaloneStorageController.ts ***!
271  \***********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandaloneStorageController:()=>l});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/Checker */"./core/Checker.ts"),i=n(/*! ../core/utils */"./core/utils.ts"),o=n(/*! ./localStorageWrapper */"./common/localStorageWrapper.ts"),a=n(/*! ./storageController */"./common/storageController.ts");
272/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
273class l extends a.StorageController{constructor(){super(),this._setUniqueId(),this._loadData()}_setUniqueId(){this._uniqueId=a.StorageController._generateUniqueId();try{const e=(document.cookie||"").match(/_pk_id\.\d+\.[a-z0-9\-]+=([a-z0-9]{16})\./);e&&(this._uniqueId=e[1])}catch{}if(self._paq){const e=this;self._paq.push([function(){const t=this.getVisitorId();t&&16===t.length&&(e._uniqueId=t)}])}}_loadData(){const e={};o.LocalStorageWrapper.getAll().forEach((t=>{this._canPersistSetting(t.key)&&(e[t.key]=t.value)})),this._settings=a.StorageController._combineObjects(a.StorageController.DEFAULT_SETTINGS,e),this._privacySettings={allowRemoteCheck:!0,acceptedTermsOfServiceVersion:s.CURRENT_TERMS_OF_SERVICE_VERSION,lastTermsOfServiceModalShown:null,hasMLDataCollectionEnabled:!0,hasStatisticsCollectionEnabled:!0,hasOptedIntoThirdPartyAiGrammarChecking:!0,hasOptedIntoThirdPartyAiParaphrasing:!0},this._testFlags=a.StorageController._combineObjects(a.StorageController.DEFAULT_TEST_FLAGS,e),this._uiState={hasSeenPrivacyConfirmationDialog:!0,hasPaidSubscription:!1,hasPaidSubscriptionEnded:!1,hasRated:!0,hasUsedValidator:!1,hasSeenOnboarding:!1,hasSeenNewGoogleDocsTeaser:!0,hasSeenNewGoogleSlidesTeaser:!0,hasSeenGoogleDocsMenuBarHint:!0,lastChangelogNov2024Seen:null,changelogNov2024CountdownEnd:null,changelogNov2024Coupon:null,showRuleId:!1,dialogPosition:"default",countMode:"characters",hasSeenTurnOnMessagePopup:!1,isDarkModeEnabled:!1,skipFixAllConfirmation:!1,skipFixAllOverLimitConfirmation:!1,hasClickedLollipop:!1}}isReady(){return!0}onReady(e){e(this)}getUniqueId(){return this._uniqueId}getSettings(){return(0,i.clone)(this._settings)}_canPersistSetting(e){return("dictionary"!==e||!this.hasLanguageToolAccount())&&l.PERSISTED_SETTINGS.includes(e)}updateSettings(e){for(const t in e)if(!a.StorageController.DEFAULT_SETTINGS.hasOwnProperty(t))throw new Error(`Unknown setting ${t}`);const t={};for(const n in e)t[n]={oldValue:(0,i.clone)(this._settings[n]),newValue:(0,i.clone)(e[n])};Object.assign(this._settings,(0,i.clone)(e));for(const t in e)this._canPersistSetting(t)&&(void 0===e[t]?o.LocalStorageWrapper.remove(t):o.LocalStorageWrapper.set(t,e[t]));return this._eventBus.fire(a.StorageController.eventNames.settingsChanged,t),Promise.resolve()}getCheckSettings(e){return{isDomainDisabled:!1,isEditorGroupDisabled:!1,isAutoCheckEnabled:!0}}hasLanguageToolAccount(){return Boolean(this._settings&&this._settings.username&&!this.hasCustomServer())}hasCustomServer(){return Boolean(this._settings&&this._settings.apiServerUrl&&this._settings.apiServerUrl.trim()&&this._settings.apiServerUrl!==s.MAIN_SERVER_URL&&this._settings.apiServerUrl!==s.PREMIUM_SERVER_URL)}getCustomServerUrl(){if(this.hasCustomServer())return this._settings.apiServerUrl}hasCustomLogin(){return!1}getManagedSettings(){return(0,i.clone)(a.StorageController.DEFAULT_MANAGED_SETTINGS)}getConfiguration(){return(0,i.clone)(a.StorageController.DEFAULT_REMOTE_CONFIGURATION)}updateRemoteConfiguration(e){return Promise.resolve()}isDomainSupported(e){return!0}isDomainExcludedByGroupPolicy(e){return!1}getPrivacySettings(){return(0,i.clone)(this._privacySettings)}updatePrivacySettings(e){return Promise.resolve()}getStatistics(){return(0,i.clone)(a.StorageController.DEFAULT_STATISTICS)}updateStatistics(e){return Promise.resolve()}getUIState(){return(0,i.clone)(this._uiState)}updateUIState(e){for(const t in e)if(!a.StorageController.DEFAULT_UI_STATE.hasOwnProperty(t))throw new Error(`Unknown ui state ${t}`);const t={};for(const n in e)t[n]={oldValue:(0,i.clone)(this._uiState[n]),newValue:(0,i.clone)(e[n])};return Object.assign(this._uiState,(0,i.clone)(e)),this._eventBus.fire(a.StorageController.eventNames.uiStateChanged,t),Promise.resolve()}checkForPaidSubscription(){const e=this.getCustomServerUrl(),{username:t,password:n,token:s}=this.getSettings();return r.Checker.checkForPaidSubscription(t,n,s,e).then((e=>(e?(this.enablePaidSubscription(),this.grantUnlimitedRephrasings()):(this.disablePaidSubscription(),this.restrictRephrasings()),e)))}getTestFlags(){return(0,i.clone)(this._testFlags)}updateTestFlags(e){return Object.assign(this._testFlags,(0,i.clone)(e)),Promise.resolve()}getActiveCoupon(){return null}isRelevantForChangelogCoupon(){return{status:!1,reason:7}}startChangelogCoupon(){}isChangelogCouponRunning(){return!1}canStartChangelogCoupon(){return!1}getTrialSettings(){return{trialToken:null,trialStartedAt:null,lastTrialTokenAttempt:null,trialUserType:null,isTrialSupportedInCountry:!1,hasSeenTrialPage:!1}}updateTrialSettings(e){return Promise.resolve()}getCopyPasteInfo(){return{copiedFrom:null,copiedAt:null,copiedText:""}}
273updateCopyPasteInfo(e){return Promise.resolve()}}l.PERSISTED_SETTINGS=["enVariant","deVariant","ptVariant","caVariant","dictionary","ignoredRules","remainingRephrasingsAmount","remainingRephrasingsDate"]},
273"./common/standaloneToolboxStorageAdapter.ts":
274/*!***************************************************!*\
275  !*** ./common/standaloneToolboxStorageAdapter.ts ***!
276  \***************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandaloneToolboxStorageAdapter:()=>r});
277/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
278const s="lt-toolbox-data";class r{async read(e){const t=self.localStorage.getItem(this._key(e))||"null";if(null!==t)return JSON.parse(t)}async write(e,t){try{return self.localStorage.setItem(this._key(e),JSON.stringify(t)),!0}catch(t){return console.error("Failed to write `%s` to storage.",this._key(e),t),!1}}async delete(e){try{return self.localStorage.removeItem(this._key(e)),!0}catch(t){return console.error("Failed to delete `%s` from storage.",this._key(e),t),!1}}_key(e){return[s,e].join(".")}}},
278"./common/storageController.ts":
279/*!*************************************!*\
280  !*** ./common/storageController.ts ***!
281  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{StorageController:()=>h,StorageControllerFactory:()=>u});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/utils */"./core/utils.ts"),i=n(/*! ./eventBus */"./common/eventBus.ts"),o=n(/*! ./languageManager */"./common/languageManager.ts"),a=n(/*! ../init/config */"./init/config.ts"),l=n(/*! ./advancedToolboxAdapter */"./common/advancedToolboxAdapter.ts"),c=n(/*! ./trial */"./common/trial.ts");
282/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
283const d=a.default.get(a.ConfigKey.EXTN_PREFIX);class h{static get DEFAULT_SETTINGS(){return null===this.DEFAULT_SETTINGS_CACHED&&(this.DEFAULT_SETTINGS_CACHED={apiServerUrl:s.MAIN_SERVER_URL,autoCheck:!0,knownEmail:"",username:"",password:"",token:"",userId:null,motherTongue:"",geoIpLanguages:[],geoIpCountry:"",preferredLanguages:[],forcePreferredLanguages:!1,enVariant:o.LanguageManager.getPreferredLanguageVariant(["en-US","en-GB","en-AU","en-CA","en-NZ","en-ZA"])||"en-US",deVariant:o.LanguageManager.getPreferredLanguageVariant(["de-DE","de-AT","de-CH"])||"de-DE",ptVariant:o.LanguageManager.getPreferredLanguageVariant(["pt-PT","pt-BR","pt-MZ","pt-AO"])||"pt-BR",caVariant:"ca-ES",dictionary:[],hasSynonymsEnabled:!1,hasPickyModeEnabledGlobally:!1,openCardHotkey:"",isDictionarySynced:!1,ignoredRules:[],disabledDomains:[],disabledEditorGroups:[],ignoreCheckOnDomains:[],disableRecommendationOnDomains:[],autoCheckOnDomains:[],remainingRephrasingsAmount:null,remainingRephrasingsDate:null,hasRephrasingEnabled:!0,hasContextMenuOptionEnabled:!0,hasLollipopEnabled:!1,lastMigration:null,translateLanguages:[]}),this.DEFAULT_SETTINGS_CACHED}static _combineObjects(e,t){const n=(0,r.deepClone)(e);for(const e in n)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}static _dec2hex(e){return("0"+e.toString(16)).substr(-2)}static _generateUniqueId(){const e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e,h._dec2hex).join("")}static _isListContainsDomain(e,t){return(0,r.isDomainInList)(e,t)}static getDefaultSettings(){return(0,r.deepClone)(h.DEFAULT_SETTINGS)}static getDefaultPrivacySettings(){return(0,r.clone)(h.DEFAULT_PRIVACY_SETTINGS)}constructor(){this._eventBus=new i.EventBus,this._onReadyCallbacks=[]}addEventListener(e,t){this._eventBus.subscribe(e,t)}removeEventListener(e,t){this._eventBus.unsubscribe(e,t)}disableDomain(e){const t=(0,r.normalizeDomain)(e),n=this.getSettings(),s="object"==typeof n.disabledDomains?n.disabledDomains:[];return s.push(t),this.updateSettings({disabledDomains:s})}enableDomain(e){const t=(0,r.normalizeDomain)(e),n=this.getSettings();let s="object"==typeof n.disabledDomains?n.disabledDomains:[];return s=s.filter((e=>{const n=(0,r.normalizeDomain)(e);return n!==t&&!t.endsWith("."+n)})),this.updateSettings({disabledDomains:s})}addToDomainSettings(e,t){const n=(0,r.normalizeDomain)(e),s=this.getSettings()[t]||[];return s.push(n),this.updateSettings({[t]:(0,r.uniq)(s)})}removeFromDomainSettings(e,t){const n=(0,r.normalizeDomain)(e);let s=this.getSettings()[t]||[];return s=s.filter((e=>{const t=(0,r.normalizeDomain)(e);return t!==n&&!n.endsWith("."+t)})),this.updateSettings({[t]:s})}isInternalTester(){const e=this.getSettings();return this.getUIState().showRuleId||s.EMPLOYEE_EMAIL_REGEXP.test(e.username)||"[email protected]"===e.username}disableEditorGroup(e,t){const n=(0,r.normalizeDomain)(e),s=this.getSettings(),i="object"==typeof s.disabledEditorGroups?s.disabledEditorGroups:[];return i.push({domain:n,editorGroupId:t}),this.updateSettings({disabledEditorGroups:i})}enableEditorGroup(e,t){const n=(0,r.normalizeDomain)(e),s=this.getSettings(),i="object"==typeof s.disabledEditorGroups?s.disabledEditorGroups:[],o=i.filter((e=>!(e.domain===n&&e.editorGroupId===t)));return o.length!==i.length?this.updateSettings({disabledEditorGroups:o}):Promise.resolve()}enableDomainAndEditorGroup(e,t){return this.getCheckSettings(e,t).isEditorGroupDisabled&&this.enableEditorGroup(e,t),this.enableDomain(e)}
283grantUnlimitedRephrasings(){return this.updateSettings({remainingRephrasingsAmount:null,remainingRephrasingsDate:null})}restrictRephrasings(){const{remainingRephrasingsAmount:e,remainingRephrasingsDate:t}=this.getSettings();return this.updateSettings({remainingRephrasingsAmount:e??s.MAX_FREEMIUM_REPHRASINGS_PER_DAY,remainingRephrasingsDate:t||(new Date).toISOString()})}enablePaidSubscription(){return this.updateUIState({hasPaidSubscription:!0,hasPaidSubscriptionEnded:!1})}disablePaidSubscription(){const{hasPaidSubscription:e,hasPaidSubscriptionEnded:t}=this.getUIState();return this.updateUIState({hasPaidSubscription:!1,hasPaidSubscriptionEnded:t||!0===e})}isPremium(){return this.getUIState().hasPaidSubscription||c.Trial.isRunning()}getIgnoredRuleIds(){return this.getManagedSettings().disableIgnoredRules?[]:this.getSettings().ignoredRules.map((e=>e.id))}hasIgnoredRule(e){return this.getIgnoredRuleIds().includes(e)}addIgnoredRule(e){const{ignoredRules:t}=this.getSettings();this.hasIgnoredRule(e.id)||this.updateSettings({ignoredRules:[...t,e]})}async removeIgnoredRule(e){if(this.hasIgnoredRule(e)){const t=this.getSettings().ignoredRules.filter((t=>t.id!==e));await this.updateSettings({ignoredRules:t})}}hasRephrasingEnabled(){return!this.hasCustomServer()&&!c.Trial.isFunctionalityLocked()&&(!!l.AdvancedToolboxAdapter.canSeeLollipop(this)||this.getSettings().hasRephrasingEnabled)}destroy(){this._eventBus.destroy(),this._onReadyCallbacks=[]}}h.eventNames={settingsChanged:`${d}-storageController.settingsChanged`,userCredentialsChanged:`${d}-storageController.userCredentialsChanged`,configurationChanged:`${d}-storageController.configurationChanged`,privacySettingsChanged:`${d}-storageController.privacySettingsChanged`,uiStateChanged:`${d}-storageController.uiStateChanged`},h.DEFAULT_SETTINGS_CACHED=null,h.DEFAULT_MANAGED_SETTINGS={apiServerUrl:"",loginUrl:"",disablePrivacyConfirmation:!1,disablePersonalDictionary:!1,disableIgnoredRules:!1,disableOpenInEditor:!1,allowedURLs:[]},h.DEFAULT_REMOTE_CONFIGURATION={unsupportedDomains:[]},h.DEFAULT_PRIVACY_SETTINGS={allowRemoteCheck:!1,hasStatisticsCollectionEnabled:!0,hasMLDataCollectionEnabled:!1,acceptedTermsOfServiceVersion:null,lastTermsOfServiceModalShown:null,hasOptedIntoThirdPartyAiGrammarChecking:!0,hasOptedIntoThirdPartyAiParaphrasing:!0},h.DEFAULT_STATISTICS={sessionCount:0,appliedSuggestions:0,appliedSynonyms:0,hiddenErrors:[],firstVisit:null,lastActivity:null,ratingValue:null,premiumClicks:0,lastPing:null,hasInstalledQBExtension:!1},h.DEFAULT_UI_STATE={hasSeenPrivacyConfirmationDialog:!1,hasPaidSubscription:!1,hasPaidSubscriptionEnded:!1,hasRated:!1,hasUsedValidator:!1,hasSeenOnboarding:!1,hasSeenNewGoogleDocsTeaser:!1,hasSeenNewGoogleSlidesTeaser:!1,hasSeenGoogleDocsMenuBarHint:!1,lastChangelogNov2024Seen:null,changelogNov2024CountdownEnd:null,changelogNov2024Coupon:null,showRuleId:!1,dialogPosition:"default",countMode:"characters",hasSeenTurnOnMessagePopup:!1,isDarkModeEnabled:!1,skipFixAllConfirmation:!1,skipFixAllOverLimitConfirmation:!1,hasClickedLollipop:!1},h.DEFAULT_TEST_FLAGS={testGroups:{},experiments:{}},h.DEFAULT_TRIAL_SETTINGS={isTrialSupportedInCountry:!1,trialToken:null,trialStartedAt:null,lastTrialTokenAttempt:null,trialUserType:null,hasSeenTrialPage:!1},h.DEFAULT_COPY_PASTE_INFO={copiedText:"",copiedAt:null,copiedFrom:null};class u{static init(e){this._instanceCtor=e}static create(){return this._instanceCtor()}}},
283"./common/textStatistics.ts":
284/*!**********************************!*\
285  !*** ./common/textStatistics.ts ***!
286  \**********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TextStatistics:()=>r});var s=n(/*! ../core/utils */"./core/utils.ts");class r{constructor(e,t){this._allWords=null,this._text=e,this._normalizedText=this.normalizeText(e),this._sentenceRanges=t}updateText(e,t){this._text=e,this._normalizedText=this.normalizeText(e),this._sentenceRanges=t,this._allWords=null}normalizeText(e){return e=(e=(e=(e=e.replace(/([a-zèéêáàâ0-9])['’`´‘]([a-z])/gi,"$1$2")).replace(/[\-_–"“”„'’`´‘˚^°\+\*\.\!\?…\:,;=\)\(\[\]%¡¿‽#<>•\/]/g," ")).replace(/\s+/g," ")).replace(/(^\s*)|(\s*$)/g,"")}_filterEmptySentenceRanges(e){return e.filter((e=>e.end-e.start>0))}getAllWords(){return this._normalizedText?(this._allWords||(this._allWords=this._normalizedText.replace(/([0-9])[\.,]([0-9])/g,"$1$2").split(/\s/)),this._allWords):[]}countWords(){return this.getAllWords().length}countUniqueWords(){const e=this.getAllWords();return(0,s.uniq)(e).length}getAllSentences(){return this._sentenceRanges}countSentences(){return this.getAllSentences().length}getReadingTime(){return Math.round(this.countWords()/200)}getSpeakingTime(){return Math.round(this.countWords()/130)}countCharacters(){return this._text.trim().length}uniq(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&t.push(e)})),t}}},
286"./common/toolboxStorageAdapter.ts":
287/*!*****************************************!*\
288  !*** ./common/toolboxStorageAdapter.ts ***!
289  \*****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=n(/*! ../core/utils */"./core/utils.ts");
290/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */class r{static init(e){r._impl=e}static create(){return(0,s.isUndefined)(r._instance)&&(r._instance=new r),r._instance}constructor(){if((0,s.isUndefined)(r._impl))throw new Error("ToolboxStorageAdapter needs to be initialized with a strorage implementation first.");this._storageController=r._impl,r._impl=void 0}async write(e,t){try{await this._storageController.write(e,t)}catch(e){return console.log("Failed to store Toolbox data.",e),!1}return!0}async read(e){return await this._storageController.read(e)}async delete(e){try{await this._storageController.delete(e)}catch(t){return console.log('Failed to delete key "%s" from Toolbox.',e,t),!1}return!0}}},
290"./common/tracker.ts":
291/*!***************************!*\
292  !*** ./common/tracker.ts ***!
293  \***************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Tracker:()=>d});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/utils */"./core/utils.ts"),i=n(/*! ./browserDetector */"./common/browserDetector.ts"),o=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),a=n(/*! ./languageManager */"./common/languageManager.ts"),l=n(/*! ./storageController */"./common/storageController.ts"),c=n(/*! ./trial */"./common/trial.ts");
294/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
295class d{constructor(){this.TRACKING_BASE_URL="https://analytics.languagetoolplus.com/matomo/piwik.php",this.TRACKING_BASE_PAGE_URL="https://fake/",this.ACTIVITY_TRACK_INTERVAL=864e5,this.PING_TRACK_INTERVAL=6048e5,this.MAX_TIME=6e4,this.THROTTLE_REQUESTS=10,this._isInitialized=!1,this._loggedErrors=null,this._errorCount=0}initialize(){if(this._isInitialized)return;this.TRACKING_SITE_ID=o.EnvironmentAdapter.getTrackingId(),this.VERSION=o.EnvironmentAdapter.getVersion(),this._storageController=l.StorageControllerFactory.create();const e=o.EnvironmentAdapter.getURL("/");self.addEventListener("error",(t=>{const n=t.message,s=t.filename,i=t.lineno,o=t.error;if(!s||!s.startsWith(e))return;if("string"!=typeof n)return;if(n.includes("ResizeObserver"))return;const a=o&&(0,r.generateStackTrace)(o);a?this.trackError("js",n,a):this.trackError("js",n,`${s}:${i}`)})),this._isInitialized=!0}getCustomDimensions(){const e=this._storageController.getSettings(),t=this._storageController.getUIState(),n=this._storageController.getTestFlags(),s=this._storageController.getPrivacySettings();return{dimension2:this.VERSION,dimension3:String(t.hasPaidSubscription),dimension4:String(Boolean(e.username&&(e.password||e.token))),dimension5:e.preferredLanguages.join(","),dimension6:String(e.hasPickyModeEnabledGlobally),dimension13:t.showRuleId?"{}":JSON.stringify(n.testGroups),dimension15:String(s.acceptedTermsOfServiceVersion||"none"),dimension16:String(e.hasLollipopEnabled),dimension17:String(c.Trial.getStatus()),dimension18:String(c.Trial.getUserType()),dimension19:String(c.Trial.getStartWeek())}}_getTrackingUrlForPageView(e){return e=(e=e.replace(/^(chrome|moz|safari|edge)-extension:\/\/.+?\//i,"")).replace(/^[a-z0-9]{8}\//i,"/"),e=`${this.TRACKING_BASE_PAGE_URL}${e}`,new Promise(((t,n)=>{this._storageController.onReady((()=>{const{firstVisit:n,sessionCount:s}=this._storageController.getStatistics(),r=this._storageController.getUniqueId(),i=new URL(this.TRACKING_BASE_URL),o=[self.screen?.width??0,self.screen?.height??0],a={idsite:this.TRACKING_SITE_ID,rec:"1",url:e,rand:String(Date.now()),apiv:"1",res:o.join("x"),_id:String(r),_idts:String(n),_idvc:String(s),...this.getCustomDimensions()};for(const[e,t]of Object.entries(a))i.searchParams.append(e,t);t(i.toString())}))}))}_getTrackingUrlForEvent(e,t,n="",s){return s=s||this.TRACKING_BASE_PAGE_URL,new Promise(((r,i)=>{this._storageController.onReady((()=>{const{firstVisit:i,sessionCount:o}=this._storageController.getStatistics(),a=this._storageController.getUniqueId(),l=new URL(this.TRACKING_BASE_URL),c=[self.screen?.width??0,self.screen?.height??0],d={idsite:this.TRACKING_SITE_ID,rec:"1",url:s||"",action_name:t,rand:String(Date.now()),apiv:"1",res:c.join("x"),_id:a,_idts:String(i),_idvc:String(o),e_c:e,e_a:t,e_n:n??"",...this.getCustomDimensions()};for(const[e,t]of Object.entries(d))l.searchParams.append(e,t);r(l.toString())}))}))}_sendRequest(e){!o.EnvironmentAdapter.shouldTrack()||this._storageController.hasCustomServer()||this._storageController.hasCustomLogin()||navigator.webdriver||(0,r.fetchWithTimeout)(e,{mode:"no-cors",referrerPolicy:"no-referrer",keepalive:"standalone"===o.EnvironmentAdapter.getType()},1e4).catch((()=>null))}trackPageView(e){e=e||(0,r.getCurrentUrl)(),this._getTrackingUrlForPageView(e).then((t=>
295{o.EnvironmentAdapter.isProductionEnvironment()?this._sendRequest(t):console.log("LT_Tracking Page view tracking disabled in dev mode",{pageUrl:e,trackingUrl:t})})).catch((e=>{console.log("LT could not track because:",e&&e.message)}))}trackDisabledRule(e,t,n,r){if(!e.match(/^de|en|nl|es|fr|ca|pt/i))return;const i=r?s.PACKAGE.PREMIUM:s.PACKAGE.BASIC,a=e+":"+t,l=n,c=new URL(this.TRACKING_BASE_URL);c.searchParams.append("idsite","18"),c.searchParams.append("rec","1"),c.searchParams.append("url",this.TRACKING_BASE_PAGE_URL),c.searchParams.append("action_name",i),c.searchParams.append("rand",String(Date.now())),c.searchParams.append("apiv","1"),c.searchParams.append("_id",this._storageController.getUniqueId()),c.searchParams.append("e_c",i),c.searchParams.append("e_a",a),c.searchParams.append("e_n",n),o.EnvironmentAdapter.isProductionEnvironment()?this._sendRequest(c.toString()):console.log("LT_Tracking Event tracking disabled in dev mode",{actionCategory:i,action:a,actionName:l,trackingUrl:c})}trackDictionaryEvent(e,t,n){if(!e.match(/^de|en|nl|es|fr|it|pt|ru|ca|pl/i))return;const s=n?"TemporaryIgnored":"PersistentlyIgnored",r=`${e}:add_word`,i=t,a=new URL(this.TRACKING_BASE_URL);a.searchParams.append("idsite","19"),a.searchParams.append("rec","1"),a.searchParams.append("url",this.TRACKING_BASE_PAGE_URL),a.searchParams.append("action_name",s),a.searchParams.append("rand",String(Date.now())),a.searchParams.append("apiv","1"),a.searchParams.append("_id",this._storageController.getUniqueId()),a.searchParams.append("e_c",s),a.searchParams.append("e_a",r),a.searchParams.append("e_n",t),o.EnvironmentAdapter.isProductionEnvironment()?this._sendRequest(a.toString()):console.log("LT_Tracking Event tracking disabled in dev mode",{actionCategory:s,action:r,actionName:i,trackingUrl:a})}trackEvent(e,t,n,s){this._getTrackingUrlForEvent(e,t,n,s).then((s=>{o.EnvironmentAdapter.isProductionEnvironment()?this._sendRequest(s):console.log("LT_Tracking Event tracking disabled in dev mode",{actionCategory:e,action:t,actionName:n,trackingUrl:s})})).catch((e=>{console.log("LT could not track because:",e&&e.message)}))}trackInstall(){this.trackEvent("Action","install",a.LanguageManager.getPrimaryLanguageCode(navigator.language))}trackActivity(){this._storageController.onReady((()=>{const e=Date.now(),{sessionCount:t,lastActivity:n,lastPing:s}=this._storageController.getStatistics();(!n||e-n>this.ACTIVITY_TRACK_INTERVAL)&&this._storageController.updateStatistics({sessionCount:t+1,lastActivity:e}).then((()=>{this.trackUserActivity()})),(!s||e-s>this.PING_TRACK_INTERVAL)&&this._storageController.updateStatistics({lastPing:e}).then((()=>{this.trackEvent("Stat","ping")}))}))}trackUserActivity(){this._storageController.onReady((()=>{const{username:e}=this._storageController.getSettings();if(!e||this._storageController.hasCustomServer())return;const t=new FormData;t.append("email",e),t.append("useragent",i.BrowserDetector.getUserAgentIdentifier()),(0,r.fetchWithTimeout)(s.PING_URL,{method:"POST",mode:"cors",credentials:"omit",body:t},1e4).catch((()=>null))}))}trackError(e,t,n=""){try{if(i.BrowserDetector.isUnsupportedBrowser())return;if(this._errorCount++,this._errorCount>s.MAX_EXCEPTION_COUNT)return;if("string"!=typeof t)return;if(this._loggedErrors)if(this._loggedErrors.length<this.THROTTLE_REQUESTS)this._loggedErrors.push(Date.now());else{const e=Date.now();if(!(e-this._loggedErrors[0]>=this.MAX_TIME))return;this._loggedErrors.push(e),this._loggedErrors.splice(0,1)}else this._loggedErrors=[Date.now()];let o="JS-Error";"message"===e?o="Message-Error":"http"===e?o="HTTP-Error":"other"===e&&(o="Other-Error");let a=(0,r.getCurrentUrl)();a=a.replace(/^moz-extension:\/\/[a-z0-9\-]+\//,"moz-extension://xxxx-xxxx-xxxx-xxxx/"),a.match(/(chrome|moz|safari)\-extension:/)||(a=void 0),this.trackEvent(o,t,n||a,a)}catch(e){console.error("Error while logging error from language tool",e)}}trackStat(e,t){0===Math.floor(10*Math.random())&&this.trackEvent("Stat",e,t)}trackToolboxEvent(e,t){this.trackEvent("Lollipop",t.name,t.data)}trackPerformanceMetrics(){}trackHealthMetrics(){}trackUserTextChangeMetrics(){}trackFixAllMetrics(){}trackUnderlineMismatchMetrics(){}trackEmptyTextDiffMetrics(){}}},
295"./common/trackerAdapter.ts":
296/*!**********************************!*\
297  !*** ./common/trackerAdapter.ts ***!
298  \**********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TrackerAdapter:()=>r});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs");const r=class{static init(e){this._instance=e,e.initialize()}static initialize(){this._instance.initialize()}static trackPageView(e){this._instance.trackPageView(e)}static trackDisabledRule(e,t,n,s){return this._instance.trackDisabledRule(e,t,n,s)}static trackDictionaryEvent(e,t,n){return this._instance.trackDictionaryEvent(e,t,n)}static trackEvent(e,t,n,s){this._instance.trackEvent(e,t,n,s)}static trackSampledEvent(e,t,n,s=100){const r=this._getSampledAction(t,s);r&&this.trackEvent(e,r,n)}static trackInstall(){this._instance.trackInstall()}static trackActivity(){this._instance.trackActivity()}static trackUserActivity(){this._instance.trackUserActivity()}static trackError(e,t,n){this._instance.trackError(e,t,n)}static trackStat(e,t){this._instance.trackStat(e,t)}static trackPerformanceMetrics(e){this._instance.trackPerformanceMetrics(e)}static trackUserTextChangeMetrics(e){this._instance.trackUserTextChangeMetrics(e)}static trackHealthMetrics(e){this._instance.trackHealthMetrics(e)}static trackFixAllMetrics(e){this._instance.trackFixAllMetrics(e)}static trackUnderlineMismatchMetrics(e){this._instance.trackUnderlineMismatchMetrics(e)}static trackEmptyTextDiffMetrics(e){this._instance.trackEmptyTextDiffMetrics(e)}static trackToolboxEvent(e,t,n){const r=(0,s.isNumber)(n)?this._getSampledAction(t.name,n):t.name;r&&this._instance.trackToolboxEvent(e,{name:r,data:t.data,meta:t.meta})}static _getSampledAction(e,t){if(Math.random()*t<1)return t>1&&(e+=`:sampling_${t}`),e}}},
298"./common/trial.ts":
299/*!*************************!*\
300  !*** ./common/trial.ts ***!
301  \*************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Trial:()=>d});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ./browserDetector */"./common/browserDetector.ts"),i=n(/*! ./storageController */"./common/storageController.ts"),o=n(/*! ../init/config */"./init/config.ts"),a=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),l=n(/*! ./utils */"./common/utils.ts");const c=["UA","BY","NG","ET","EG","CD","CG","TZ","KE","UG","DZ","SD","MA","AO","MZ","TN","CI","DJ","SZ","MU","GQ","GA","BW","SO","CD","ER","MG","ID","PK","BD","VN","MM","PH","UZ","MY","NP","KZ","KH","UZ","TH","YE","SY","JO","BR","PE","VE","EC","SV","DO","BO","SR","AR","HN","BZ","CR","PA","GT","NI","GY","UY","HT","JM","TT","CU"];class d{static init(){this._storageController=this._storageController||i.StorageControllerFactory.create()}static isEligible(){if(!o.default.get(o.ConfigKey.SUPPORTS_TRIAL))return!1;if("extension"!==a.EnvironmentAdapter.getType())return!1;if(!a.EnvironmentAdapter.isRuntimeConnected())return!1;if(navigator.webdriver)return!1;if(!r.BrowserDetector.isChromium()&&!r.BrowserDetector.isFirefox())return!1;if((this._storageController?.hasCustomLogin()||this._storageController?.hasCustomServer())&&!this._storageController?.isInternalTester())return!1;const{hasPaidSubscription:e}=this._storageController.getUIState();return!e&&!!this._storageController.getTrialSettings().isTrialSupportedInCountry&&!!this._storageController.getPrivacySettings().allowRemoteCheck}static isRunning(){if(!this.isEligible())return!1;const{trialStartedAt:e}=this._storageController.getTrialSettings();return!!e&&e+s.TRIAL_DURATION>=Date.now()}static getStartDate(){const{trialStartedAt:e}=this._storageController.getTrialSettings();return e?new Date(e):null}static getEndDate(){const{trialStartedAt:e}=this._storageController.getTrialSettings();return e?new Date(e+s.TRIAL_DURATION):null}static hasEnded(){const{trialStartedAt:e}=this._storageController.getTrialSettings();return!!e&&e+s.TRIAL_DURATION<Date.now()}static isFunctionalityLocked(){return this.isEligible()&&this.hasEnded()}static hasUpgraded(){const{trialStartedAt:e}=this._storageController.getTrialSettings(),{hasPaidSubscription:t}=this._storageController.getUIState();return Boolean(e&&t)}static canStart(){return this.isEligible()&&!this._storageController.getTrialSettings().trialStartedAt}static getRemainingDays(){if(!this.isRunning())return null;const e=this.getEndDate();if(!e)return null;const t=new Date;return(e.getTime()-t.getTime())/1e3/60/60/24}static start(e){return this.canStart()?this._storageController.updateTrialSettings({trialUserType:e,trialStartedAt:Date.now()}):Promise.reject("Cannot start, isEligible:"+this.isEligible()+" isRunning:"+this.isRunning())}static getCoupon(){if(!this.isRunning()&&!this.isFunctionalityLocked())return null;const e=this.getEndDate();if(!e)return null;if((new Date).getTime()-e.getTime()>7776e6)return null;const t=this._getCountryCode();return c.includes(t)?{code:s.TRIAL_50_DISCOUNT_CODE,percent:50}:{code:s.TRIAL_DISCOUNT_CODE,percent:20}}static _getCountryCode(){return(this._storageController.getSettings().geoIpCountry||"").toUpperCase()}static getToken(){return this._storageController.getTrialSettings().trialToken?.jwt||null}static getStartWeek(){const e=this.getStartDate();return e?e.getFullYear()+"_"+(0,l.getWeekNumber)(e):null}static getStatus(){return this.hasUpgraded()?"upgraded":this.isRunning()?"started":this.hasEnded()?"ended":this.isEligible()?"eligible":"ineligible"}static getUserType(){const{trialUserType:e}=this._storageController.getTrialSettings();return e}}},
301"./common/tweakNames.ts":
302/*!******************************!*\
303  !*** ./common/tweakNames.ts ***!
304  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TWEAK_NAMES:()=>s});const s={DEFAULT:"default",INFOMAKER_WRITER:"Infomaker Writer",GITHUB:"GitHub",GITLAB:"GitLab",OPENAI_CHATGPT:"OpenAI ChatGpt",GMX_MAIL:"GMX Mail",AOL_MAIL:"AOL Mail",ATLASSIAN:"Atlassian",ATLASSIAN_JIRA:"Atlassian Jira",CHECK24:"Check24",BASECAMP:"Basecamp",CUE:"Cue",DROPBOX_PAPER:"Dropbox Paper",DROPBOX:"Dropbox",DEEPL:"Deepl",FONTO:"Fonto",MSN:"MSN",REEDSY:"Reedsy",FACEBOOK:"Facebook",GOOGLE_ADS:"Google Ads",GOOGLE_CROWDSOURCE:"Google Crowdsource",GOOGLE_GEMINI:"Google Gemini",GOOGLE_DOCS_PAGINATED:"Google Docs Paginated",GOOGLE_DOCS_PAGELESS:"Google Docs Pageless",GOOGLE_SLIDES:"Google Slides",GOOGLE_KEEP:"Google Keep",GMAIL:"Gmail",GOOGLE_TRANSLATE:"Google Translate",HOOTSUITE:"Hootsuite",KARBONHQ:"KarbonHQ",LINKEDIN:"LinkedIn",LIVEWORKSHEETS:"Liveworksheets",MAILRU:"Mail.ru",MAILBOX_ORG:"Mailbox.org",SPIEGEL_CMS:"Spiegel CMS",MINDS:"Minds",NOTION_COMMENT:"Notion Comment",NOTION_EDITOR_LEAF:"Notion Editor Leaf",NOTION_BOARD_LEAF:"Notion Board Leaf",NOTION_EDITOR:"Notion Editor",OTRS:"OTRS",OVERLEAF:"Overleaf",OUTLOOK:"Outlook",MICROSOFT_TEAMS:"Microsoft Teams",SHAREPOINT:"SharePoint",PROTONMAIL:"ProtonMail",RAMBLER:"Rambler",REVERSO:"Reverso",ROAM_RESEARCH:"Roam Research",SLACK:"Slack",PIPEDRIVE:"Pipedrive",TABTTER:"Tabtter",TONLINE:"T-Online",MISSIVE:"Missive",TELEGRAM:"Telegram",ADA:"Ada",TRELLO:"Trello",TWITCH:"Twitch",TWITTER:"Twitter",UPWORK:"Upwork",VK:"VK",WHATSAPP:"WhatsApp",YAHOO_MAIL:"Yahoo Mail",YANDEX:"Yandex",YANDEX_ZEN:"Yandex Zen",YOUTUBE:"YouTube",ZOHO_MAIL:"Zoho Mail",DYNAMICS:"Dynamics",ZOHO_SOCIAL:"Zoho Social",XING:"Xing",WIKIPEDIA:"Wikipedia",MASTODON:"Mastodon",HEY:"Hey",THUNDERBIRD:"Thunderbird",FRESHDESK:"Freshdesk",ZEIT_EDITOR:"Zeit Editor",ZEIT_SINGLE_LINE_INPUT:"Zeit Single Line Input",JANITORAI:"JanitorAI",CKEDITOR:"CKEditor",CODEMIRROR5:"CodeMirror 5",CODEMIRROR6:"CodeMirror 6",GUTENBERG:"Gutenberg",LIVINGDOCS:"Livingdocs",PROSEMIRROR:"ProseMirror",QUILL:"Quill",TINYMCE:"TinyMCE",ASANA:"Asana",TRIX:"Trix",EDITOR_JS:"EditorJS"}},
304"./common/tweaksManager.ts":
305/*!*********************************!*\
306  !*** ./common/tweaksManager.ts ***!
307  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TweaksManager:()=>L});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../content/cardController */"./content/cardController.ts"),i=n(/*! ../content/ceElementInspector */"./content/ceElementInspector.ts"),o=n(/*! ../content/ceElementWrapper */"./content/ceElementWrapper.ts"),a=n(/*! ../content/dialog */"./content/dialog.ts"),l=n(/*! ../content/formElementMirror */"./content/formElementMirror.ts"),c=n(/*! ../content/formElementWrapper */"./content/formElementWrapper.ts"),d=n(/*! ../content/toolbar */"./content/toolbar.ts"),h=n(/*! ../core/textReplacingRules */"./core/textReplacingRules.ts"),u=n(/*! ../core/utils */"./core/utils.ts"),g=n(/*! ../init/config */"./init/config.ts"),m=n(/*! ../lollipop/Lollipop */"./lollipop/Lollipop.ts"),p=n(/*! ../react/components/card-base/draggable */"./react/components/card-base/draggable.ts"),_=n(/*! ./editors/codemirror/codeMirror5Editor */"./common/editors/codemirror/codeMirror5Editor.ts"),E=n(/*! ./editors/codemirror/codeMirror6Editor */"./common/editors/codemirror/codeMirror6Editor.ts"),f=n(/*! ./editors/fonto */"./common/editors/fonto.ts"),T=n(/*! ./editors/livingDocs */"./common/editors/livingDocs.ts"),C=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts"),v=n(/*! ./editors/gutenberg */"./common/editors/gutenberg.ts"),S=n(/*! ./utils */"./common/utils.ts"),b=n(/*! ./mutationObservers/aggregatingMutationObserver */"./common/mutationObservers/aggregatingMutationObserver.ts"),x=n(/*! ../content/termsOfService */"./content/termsOfService.ts"),y=n(/*! ./tweakNames */"./common/tweakNames.ts"),A=n(/*! ../content/toolbarUtils */"./content/toolbarUtils.ts"),k=n(/*! ./browserDetector */"./common/browserDetector.ts"),w=n(/*! ./editors/editorjs */"./common/editors/editorjs.ts"),R=n(/*! ./editors/cue */"./common/editors/cue.ts");
308/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
309class L{static _testString(e,t,n=!1){Array.isArray(t)||(t=[t]);for(const s of t)if("string"==typeof s){if(e===s||n&&e.startsWith(s))return!0}else if(s.test(e))return!0;return!1}static getEmail(e){const t=L.EMAIL_REGEXP.exec(e);return t?t[0].replace(L.EMAIL_DOMAIN_REGEXP,"@replaced.domain").trim():""}static getFullName(e){return e.replace(L.EMAIL_REGEXP,"").replace(L.ADDRESS_SPECIAL_CHARS_REGEXP,"").trim()}static isRuleApplicable(e,t,n){let s=!0;if("hostname"in e.precondition){const t=e.precondition.hostname;s=n.some((e=>L._testString(e,t)))}else"url"in e.precondition&&(s=L._testString(t,e.precondition.url));return s&&e.precondition.isMatch&&(s=e.precondition.isMatch(n,t)),s}static getSiteTweaks(e){const t=(0,u.getDomain)(e,"");if(!t)return L.DEFAULT_SITE_TWEAKS;const n=(0,u.getSubdomains)(t);for(const t of L.SITE_TWEAKS_RULES)if(L.isRuleApplicable(t,e,n))return Object.assign({},L.DEFAULT_SITE_TWEAKS,t);return L.DEFAULT_SITE_TWEAKS}static getInputAreaTweaks(e,t){const n=L.DEFAULT_INPUT_AREA_TWEAKS_FACTORY(t),s=(0,u.getDomain)(e,""),r=s?(0,u.getSubdomains)(s):[];for(const s of L.INPUT_AREA_TWEAKS_RULES){let i=!0;if("hostname"in s.precondition){const e=s.precondition.hostname;i=r.some((t=>L._testString(t,e)))}else"url"in s.precondition&&(i=L._testString(e,s.precondition.url));if(i&&s.precondition.isMatch&&(i=s.precondition.isMatch(t)),i)return Object.assign({},n,s.create(t,n))}return n}}L.EMAIL_REGEXP=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi,L.EMAIL_DOMAIN_REGEXP=/@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i,L.ADDRESS_SPECIAL_CHARS_REGEXP=/["'`<>]/g,L.NON_COMPATIBLE_TAGS=["TR","TH","TD","THEAD","TBODY","TFOOT","CAPTION","IFRAME"],L.INLINE_DISPLAY_VALUES=["inline","inline-block","inline-flex"],L.DEFAULT_SITE_TWEAKS={isSupported:e=>!0,unsupportedMessage:()=>"",isBeta:()=>!1,init(){document.documentElement.setAttribute(g.default.get(g.ConfigKey.INSTALLED_ATTRIBUTE),"true")},destroy(){document.documentElement&&document.documentElement.removeAttribute(g.default.get(g.ConfigKey.INSTALLED_ATTRIBUTE))},persistTemporarySettings:()=>!1,onNewElement(e){},getInitElements(e){if(_.CodeMirror5Editor.isEditorPart(e))return _.CodeMirror5Editor.getEditor(e);
309if(f.Fonto.isEditorPart(e))return f.Fonto.getEditor(e);if(v.Gutenberg.isEditorPart(e))return v.Gutenberg.getEditor(e);if(w.EditorJS.isEditorPart(e))return w.EditorJS.getEditor(e);if(R.Cue.isEditorPart(e))return R.Cue.getEditor(e);if(T.LivingDocs.isEditorPart(e))return T.LivingDocs.getEditor(e);const t=e.closest(`[${s.EDITOR_GROUP_ATTRIBUTE}]`);return t?[t]:[e]},shouldDisableOtherSpellCheckers:e=>!k.BrowserDetector.isSafari(),isElementCompatible(e){const t=g.default.get(g.ConfigKey.EXTN_PREFIX);if(L.NON_COMPATIBLE_TAGS.includes(e.tagName))return!1;if(_.CodeMirror5Editor.isEditor(e))return _.CodeMirror5Editor.isTextMode(e);if(f.Fonto.isEditor(e))return!0;if(v.Gutenberg.isEditor(e))return!0;if(w.EditorJS.isEditor(e))return!0;if(R.Cue.isEditor(e))return!0;if(T.LivingDocs.isEditor(e))return!0;if(e.hasAttribute(s.EDITOR_GROUP_ATTRIBUTE))return!0;if(!(0,S.isFormElement)(e)&&!(0,S.isCEElement)(e)||e.readOnly)return!1;if("true"===e.getAttribute(`data-${t}-active`))return!0;if("false"===e.getAttribute(`data-${t}-active`))return!1;const n=(0,S.isInCEElement)(e),r=(0,S.isCERootElement)(e)||(0,S.isFormElement)(e);if(n&&!r)return!1;if("false"===document.documentElement.getAttribute(`data-${t}-active`))return!1;if((0,S.isTextInput)(e))return!1;if(E.CodeMirror6Editor.isEditor(e))return E.CodeMirror6Editor.isTextMode(e);if(e.classList.contains("ck-editor__nested-editable")&&e.parentElement&&e.parentElement.closest(".cke_editable"))return!1;if(e.parentElement&&e.parentElement.closest(".ql-editor"))return!1;if((0,S.isHorde)(e))return!0;if((0,S.isArticleJS)(e))return!1;if((0,S.isSlateEditor)(e)&&"true"===e.getAttribute("contenteditable"))return!0;if(e.classList.contains("cke_editable"))return!0;if(e.classList.contains("ve-ce-documentNode"))return!0;if(e.classList.contains("fr-element")&&!e.classList.contains("wsc-instance"))return!0;if(e.parentElement&&e.parentElement.classList.contains("wp-block-code"))return!1;const i=e.ownerDocument;if((0,S.isTinyMCE)(e)){const t="_isTinymceSpellcheckerActivated";return C.EnvironmentAdapter.executeScript(i,`\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (window.parent.tinymce.get(document.body.dataset.id).plugins.tinymcespellchecker) {\n\t\t\t\t\t\t\tdocument.body.dataset.${t} = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t`),!e.dataset[t]}if(!(self.innerHeight>=20&&self.innerWidth>=100))return!1;const o=g.default.get(g.ConfigKey.IGNORE_EDITOR_WITH_ATTRIBUTES)?.find((t=>"false"===e.getAttribute(t)));return!(o&&!e.lang&&!e.getAttribute(g.default.get(g.ConfigKey.TMP_ID_ATTRIBUTE)))&&("0"!==self.getComputedStyle(e).opacity&&!("true"===e.getAttribute("aria-readonly")))},hasFocus:e=>_.CodeMirror5Editor.isEditor(e)?_.CodeMirror5Editor.hasFocus(e):f.Fonto.isEditor(e)?f.Fonto.hasFocus(e):v.Gutenberg.isEditor(e)?v.Gutenberg.hasFocus(e):w.EditorJS.isEditor(e)?w.EditorJS.hasFocus(e):R.Cue.isEditor(e)?R.Cue.hasFocus(e):T.LivingDocs.isEditor(e)?T.LivingDocs.hasFocus(e):!(!e.hasAttribute(s.EDITOR_GROUP_ATTRIBUTE)||!e.contains((0,S.getActiveElement)()))||(0,S.hasFocus)(e),getEditorId(e,t){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const n=Date.now(),s=performance.now(),r=Math.random().toString(36).substring(2,15),i=Math.random().toString(36).substring(2,15);return`${n}-${s.toString(36)}-${r}-${i}`},getEditorGroupId(e){try{return new URL(e).pathname}catch(e){return"unknown"}},getClickEvent:()=>"click",isClickEventIgnored:e=>!e.isTrusted,getSelectedText:()=>(0,S.getSelectedText)(),getSelectedHTML:()=>(0,S.getSelectedHTML)()},L.DEFAULT_MIRROR_TWEAKS_FACTORY=function(e){const t=Boolean(e.previousElementSibling&&"wpTextbox0"===e.previousElementSibling.id),n=Boolean(e.parentElement?.parentElement&&"vaadin-text-area"===e.parentElement.tagName.toLowerCase()&&"vaadin-message-input"===e.parentElement.parentElement.tagName.toLowerCase()),s=Boolean(e.parentElement&&"vaadin-text-area"===e.parentElement.tagName.toLowerCase());return{getTargetElement:()=>n?e.parentElement?.parentElement??e:t||s?e.parentNode??e:e}},L.DEFAULT_MIRROR_FACTORY=function(e,t,n){return(0,S.isFormElement)(e)?new l.FormElementMirror(e,t,n):null},L.DEFAULT_INPUT_AREA_WRAPPER_TWEAKS_FACTORY=function(e){const t=(0,u.getCurrentUrl)(),n=L.getInputAreaTweaks(t,e).getEditorCardTweaks(),r=n.getRoot(e.ownerDocument,e),o=(0,S.getFrameElement)(self),a=o&&n.shouldRenderOutsideFrame(o),l=(0,S.getFirstScrollableAncestor)(e,r,Boolean(a));return{createMutationObserver:e=>new b.AggregatingMutationObserver(e),createSurroundingTextContextObserver(e){},getParsingDetector(){const t=document.body&&document.body.dataset&&document.body.dataset.id&&document.body.dataset.id.includes("ZmHtmlEditor");let n=location.href.includes("/owa/")||!!document.querySelector(".owa-font-compose");try{n=n||self.parent.location.href.includes("/owa/")||!!self.parent.document.querySelector(".owa-font-compose")}catch(e){}let r=!1;
309try{r=!!self.parent.document.title.match(/roundcube/i)||!!self.parent.location.href.match(/_action=compose/i)}catch(e){}const o=(0,S.isTinyMCE)(e),a=(0,S.isLTEditor)(e),l=(0,S.isDraftJS)(e),c=e.hasAttribute(s.EDITOR_GROUP_ATTRIBUTE);return{createMutationObserver:e=>new b.AggregatingMutationObserver(e),isIgnored(e,t){const n=e.tagName.toUpperCase();return!!i.CEElementInspector.SKIPPING_TAGS.includes(n)||"BLOCKQUOTE"===n&&!a||!(!c||!("isContentEditable"in e)||e.isContentEditable||e.querySelector("[contenteditable=''], [contenteditable='true']"))||"none"===t.display||("false"===e.getAttribute("contenteditable")||"false"===e.getAttribute("spellcheck")?!(o&&e.classList.contains("user-hover")||!e.classList.contains("pasted-word-bullet-point")&&e instanceof HTMLElement&&"inline"===t.display&&(!e.firstElementChild||1===e.childElementCount&&e.offsetWidth>0)):"SUP"===n&&e.textContent?i.CEElementInspector.SUP_REGEXP.test(e.textContent.trim()):!(!l||"PRE"!==e.tagName||!e.classList.contains("public-DraftStyleDefault-pre")))},isSignature:e=>t?!!(e.dataset&&e.dataset.marker&&e.dataset.marker.includes("_SIG_")):n?"signature"===e.id.toLowerCase():!!r&&"_rc_sig"===e.id,isQuote:e=>t?!!(e.dataset&&e.dataset.marker&&e.dataset.marker.includes("_QUOTED_")):!!n&&("divRplyFwdMsg"===e.id||!!e.previousElementSibling&&"divRplyFwdMsg"===e.previousElementSibling.id),isListItem:(e,t)=>"list-item"===t.display,isBlock:(e,t)=>i.CEElementInspector.DISPLAY_BLOCK_VALUES.includes(t.display||""),getReplacementText(e,t,n){if(!L.INLINE_DISPLAY_VALUES.includes(n.display))return"";const r=e.tagName.toUpperCase();return"BR"===r?"":t&&("IMG"===r||"CODE"===r||"false"===e.getAttribute("spellcheck")||e instanceof HTMLElement&&"false"===e.contentEditable)?s.INVISIBLE_SEPARATOR:""},sanitizeText:(e,t,n)=>(e=(0,u.removeZWC)(e),e=(0,u.normalizeWhiteSpaces)(e)),isReplaceableCharsPair:(e,t)=>" "===e&&(0,u.isWhiteSpace)(t),isSkippableChar:e=>(0,u.isZWC)(e)||(0,u.isWhiteSpace)(e)}},getCacheInvalidationRules:()=>({isSkippingElement:{self:{attributes:[],childList:!0},parent:{childList:!0},ancestor:{attributes:["id","class","style"]},descendant:{attributes:["id","class","style"],characterData:!0,childList:!0},sibling:{attributes:["id"]}},replacementText:{self:{attributes:["id","class","style","contenteditable","spellcheck","data-mention-id","usertype"],childList:!0},ancestor:{attributes:["id","class","style"]},descendant:{attributes:["id","class","style"],characterData:!0,childList:!0}},isListItem:{self:{attributes:["id","class","style"]},ancestor:{attributes:["id","class","style"]}},isBlock:{self:{attributes:["id","class","style"]},ancestor:{attributes:["id","class","style"]}},parsingOptions:{self:{attributes:["id","class","style"]},ancestor:{attributes:["id","class","style"]}},parsedText:{self:{characterData:!0},ancestor:{attributes:["id","class","style"]}},blockParent:{self:{attributes:["id","class","style"]},ancestor:{attributes:["id","class","style"]}},paragraphLastValuableNode:{self:{attributes:[],characterData:!0,childList:!0},parent:{childList:!0},ancestor:{attributes:["id","class","style"]},sibling:{attributes:["id"]},blockSibling:{attributes:[],characterData:!0,childList:!0}},isBRElementRelevant:{self:{attributes:[]},parent:{childList:!0},ancestor:{attributes:["id","class","style"]},sibling:{attributes:["id"]},blockSibling:{attributes:[],characterData:!0,childList:!0}},isTextEndsWithLineBreak:{any:{attributes:[],characterData:!0,childList:!0}},hasText:{self:{attributes:["id","class","style"],childList:!0},ancestor:{attributes:["id","class","style"]},descendant:{attributes:[],characterData:!0,childList:!0}},isParagraphNonEmpty:{self:{attributes:["id","class","style"],childList:!0},parent:{childList:!0},ancestor:{attributes:["id","class","style"]},descendant:{attributes:[],characterData:!0,childList:!0}}}),getLangAttribute:()=>e instanceof HTMLElement&&e.lang?e.lang:"",getKeyboardEventTarget:()=>e,getScrollContainer:()=>l,addScrollEventListener(t){e.addEventListener("scroll",t),"BODY"===e.nodeName&&self.addEventListener("scroll",t),l?.addEventListener("scroll",t)},removeScrollEventListener(t){e.removeEventListener("scroll",t),self.removeEventListener("scroll",t),l?.removeEventListener("scroll",t)},addCompositionStartListener(e){this.getKeyboardEventTarget().ownerDocument.addEventListener("compositionstart",e,!0)},removeCompositionStartListener(e){this.getKeyboardEventTarget().ownerDocument.removeEventListener("compositionstart",e,!0)},addCompositionEndListener(e){this.getKeyboardEventTarget().ownerDocument.addEventListener("compositionend",e,!0)},removeCompositionEndListener(e){this.getKeyboardEventTarget().ownerDocument.removeEventListener("compositionend",e,!0)},getDelayBeforeInsertingText:()=>(0,S.isOpenXchangeEditor)(e)||(0,S.isTrixEditor)(e)||(0,S.isInfomakerWriter)(e)?201:0,getSelectedText:()=>(0,S.getSelectedText)(),getSelection(){const t=(0,S.getSelectionNear)(e);return t?{startNode:t.anchorNode,startOffset:t.anchorOffset,endNode:t.focusNode,endOffset:t.focusOffset,isCollapsed:(0,S.isSelectionCollapsed)(t)}:null}}},L.DEFAULT_INPUT_AREA_WRAPPER_FACTORY=function(e,t,n,s){if((0,S.isFormElement)(e)){if(!t)throw new Error("No mirror instance for FormElementWrapper.");return new c.FormElementWrapper(e,t,n,s)}return new o.CEElementWrapper(e,n,s)},L.DEFAULT_INPUT_AREA_TWEAKS_FACTORY=function(e){return{name:y.TWEAK_NAMES.DEFAULT,init(){},initWritingSession:()=>Promise.resolve(""),destroy(){}
309,onDestroy(t,n){(0,S.onElementDisabled)(e,t,n),(0,S.onElementRemoved)(e,t)},getMirror(t){const n=L.DEFAULT_MIRROR_TWEAKS_FACTORY(e);return L.DEFAULT_MIRROR_FACTORY(e,n,t)},getInputAreaWrapper(t,n){const s=L.DEFAULT_INPUT_AREA_WRAPPER_TWEAKS_FACTORY(e);return L.DEFAULT_INPUT_AREA_WRAPPER_FACTORY(e,t,s,n)},getSurroundingContext:async e=>Promise.resolve(""),getHighlighterTweaks(t,n){const s=Boolean(t.firstElementChild&&t.firstElementChild.hasAttribute("data-contents")),r=t.classList.contains("ms-rtestate-write"),i=Boolean(t.classList.contains("control-contenteditable__area")&&t.closest(".js-control-contenteditable, .js-control-contenteditable-amojo")),o=Boolean(t.closest(".app-Talk, .app-talk")),a=Boolean(t.closest(".ce-redactor .ce-block .ce-block__content")),l=(0,u.getCurrentUrl)().includes("ebay")&&Boolean(t.classList.contains("se-rte-editor__rich")||"richEditor"===t.getAttribute("datatestid"));return{getTargetElement:()=>n?t:s&&t.parentNode&&t.parentNode.parentNode?t.parentNode:r?t.closest("table[id*=WikiField]")||t:l?t.parentElement||t:i?t.closest(".js-control-contenteditable, .js-control-contenteditable-amojo")||t:o?t.closest(".new-message-form")?t.parentElement:t:a&&t.closest(".ce-block__content")||t,initContainer(e){},addScrollEventListener(t){e.addEventListener("scroll",t)},removeScrollEventListener(t){e.removeEventListener("scroll",t)},getClickableElement:()=>t,createMutationObserver:e=>new b.AggregatingMutationObserver(e),getZIndex(e,t){const n=parseInt(t.getStyle(e,"z-index"))||0;return n>0||t.isStackingContext(e)?n+1:"auto"},getVisibleBox:e=>e.getPaddingBox(t,!0,!1),getScrollableElementSize:t=>t.getScrollDimensions(e,!1),getScrollPosition:(t,n,s)=>t.getScrollPosition(e,n,s),getTextBoxes:(e,n,s)=>e.getRelativeTextBoundingBoxes(n,t,s),supportsCanvas:()=>!0,isClickIgnored:e=>!1,toElementCoordinates(e,n,s){const r=s.getPaddingBox(t,!1),i=s.getScaleFactor(t),o=s.getZoom(t);return{x:Math.round((e.x-r.left+n.left)/i.x/o),y:Math.round((e.y-r.top+n.top)/i.y/o)}},toPageCoordinates(e,n,s){const r=s.getPaddingBox(t),i=s.getScaleFactor(t),o=s.getZoom(t),a=Math.round((e.top-n.top)*i.y*o+r.top),l=Math.round((e.left-n.left)*i.x*o+r.left),c=Math.round(e.width*i.x*o),d=Math.round(e.height*i.y*o);return{top:a,right:l+c,bottom:a+d,left:l,width:c,height:d}}}},getToolbarAppearance(){const t=new Set(["HTML","BODY"]),n=[a.Dialog.CONTAINER_ELEMENT_NAME,r.default.CONTAINER_ELEMENT_NAME,d.Toolbar.MENU_ELEMENT_NAME,p.default.BACKDROP_ELEMENT_NAME,m.default.CONTAINER_ELEMENT_NAME,x.TermsOfService.MODAL_ELEMENT_NAME].join(", "),s="chat-input-control"===e.id&&e.classList.contains("window__chatInputControl"),i=e.hasAttribute("data-garden-container-id"),o=(0,S.isGutenberg)(e),l=(0,S.isHorde)(e);return{isPerformanceCritical:()=>!1,getRoot(t){if("BODY"===e.tagName)return t.documentElement;const n=e.closest("[popover]");if(n)return n;try{const t=e.closest("dialog[open]:modal");if(t)return t}catch(e){}return t.body},hasBoundingContainer(e,n){let s=e;for(;s&&!t.has(s.tagName);){const e=n.getStyles(s,["overflow-x","overflow-y"]);if("visible"!==e["overflow-x"]||"visible"!==e["overflow-y"])return!0;s=s.parentElement}return!1},initContainer(e){},getClassName:()=>null,isHorizontal:()=>!0,isVisible(t,n,r=32){if(s||i)return!1;const a=g.default.get(g.ConfigKey.SHOW_TOOLBAR_ON_EMPTY_INPUT_AREA);let c=!0;if(c=(0,S.isTextArea)(e)||(0,S.isTextInput)(e)?!e.value.trim():!e.textContent.trim(),o&&c&&!a)return!1;if(l)return!0;const d=n.getPaddingBox(e);return!(c&&d.height<r&&!a)&&d.width>=160&&d.height>=18},getZIndex:(e,t,n)=>n.getZIndex(e,t),getPosition(e,t,s,r,i,o,a=18,l=44){const c=e.ownerDocument.documentElement,d=e.ownerDocument.body;if(e===d)return{fixed:!0,left:(i?6:c.clientWidth-o.width-6)+"px"};const h=c.clientHeight,u=(0,S.getVisibleTopAndBottom)(e,r,h,n),g=u.bottom-u.top;if(g<a)return null;let m=r.getPaddingBox(e);if("IFRAME"===e.tagName){let t=null;try{t=e.contentWindow.document.documentElement}catch(e){}if(!t)return null;i=r.isRTL(t.ownerDocument.body),m=(0,S.resizeBox)(m,t.clientWidth,t.clientHeight)}const p=r.getContainingBlock(t);p&&(m=(0,S.moveBox)(m,-p.left,-p.top));const _=r.getScaleFactor(s),E=r.getZoom(s),f=_.x*E,T=_.y*E,C=i?m.left/f+6:m.right/f-6-o.width,v=m.height>=250;let b=c.scrollTop||d.scrollTop;b=b%1==.5?Math.floor(b):b;const x=b+h;if(v){const e=Math.round(m.top);if(e+u.bottom>=x&&e+o.height+12<x)return{fixed:!0,left:Math.round(C)+"px"}}let y=(m.top+u.bottom)/T-6-o.height;if(g<=l&&(y=(m.top+u.bottom-g/2)/T-o.height/2),y>x)return null;const A=x-o.height-8;return y=Math.min(y,A),{fixed:!1,left:Math.round(C)+"px",top:Math.round(y)+"px"}},shouldRenderOutsideFrame:t=>e===e.ownerDocument.body,getXDisplacementRequiredToAvoidOverlap:(e,t)=>
309(0,A.getXDisplacementRequiredToAvoidOverlap)(e,t),isSmallInputArea:e=>e.clientHeight<50&&e.clientWidth<450}},getEditorCardTweaks:()=>({getRoot(t,n){if("BODY"===n.nodeName)return t.documentElement;const s=n.closest("[popover]");if(s)return s;try{const t=e.closest("dialog[open]:modal");if(t)return t}catch(e){}return t.documentElement??t.body},isRootElementNested:(e,t)=>t!==e.documentElement&&t!==e.body,getKeyboardEventTarget:()=>e.ownerDocument,shouldRenderOutsideFrame:t=>e===e.ownerDocument.body,shouldUpdatePositionOnScroll:()=>!1,shouldAllowCyclicNavigation:()=>!0}),getDialogAppearance:()=>({isPositionVisible:()=>!0,canDisplayAllSuggestions:()=>!0}),getMessagePopupAppearance:()=>({isVisible:()=>!0}),isClickOnInputArea:t=>t.target instanceof Node&&e.contains(t.target),isHoverOnInputArea:t=>t.target instanceof Node&&e.contains(t.target),shouldHideErrorCard(e,t,n){if(t)return e!==t&&!!e.card?.isDetached;{const t=document.querySelector(r.default.CONTAINER_ELEMENT_NAME);return!(t&&(0,S.isParent)(t,n))&&!1===e.card?.isDetached}},getMaxTextLength:e=>e.hasCustomServer()?s.MAX_TEXT_LENGTH_CUSTOM_SERVER:e.isPremium()?s.MAX_TEXT_LENGTH_PREMIUM:s.MAX_TEXT_LENGTH,getReplacedParts:e=>(0,u.getReplacedParts)(e,h.DEFAULT_TEXT_REPLACING_RULES),isEditorTextEmpty:e=>""===e,getRecipientInfo(){try{const t="BODY"===e.tagName&&"tinymce"===e.id,n="TEXTAREA"===e.tagName&&"composebody"===e.id;if(t||n){const e=self.parent.document.getElementById("_from"),t=self.parent.document.getElementById("compose-subject"),n=self.parent.document.getElementById("_to");if(e&&t&&n){const e=L.getEmail(n.value),t=L.getFullName(n.value);return Promise.resolve({address:e,fullName:t})}}}catch(e){}return Promise.resolve({address:"",fullName:""})},canCorrectMultipleErrorsAtOnce:e=>!0,getFixAllErrorsLimit:()=>(0,S.isCEElement)(e)?s.DEFAULT_MAX_FIX_ALL_ERRORS_COUNT:Number.MAX_SAFE_INTEGER,canCollectErrorMeta:()=>!0,getCheckOptions(e,t,n){const r=n.getTestFlags();return{throttlingLimit:s.CHECK_THROTTLING_LIMIT,checkTextLevel:t.length<=s.TEXT_LEVEL_MAX_LENGTH_PER_REQUEST,ignoreCapitalizationErrorsAtLineStart:!(0,S.isFormElement)(e.inputArea),testGroups:r.testGroups}},filterErrors:(e,t,n)=>n,replaceText(e){const{offset:t,length:n,replacementText:s,editor:r,useCustomWaitTime:i=!1,replacementHtml:o}=e;return r.inputAreaWrapper.replaceText(t,n,s,i,o)}}},L.SITE_TWEAKS_RULES=[],L.INPUT_AREA_TWEAKS_RULES=[]},
309"./common/utils.ts":
310/*!*************************!*\
311  !*** ./common/utils.ts ***!
312  \*************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MOUSE_IN_CARD_OPEN_DELAY:()=>vn,MOUSE_OUT_CARD_CLOSE_DELAY:()=>Sn,addUseCaptureEvent:()=>J,areCssContentScriptsLoadedIntoShadowRoot:()=>Ke,areCssContentScriptsLoadedIntoWindow:()=>Ve,areRectsSimilarSize:()=>k,areTextBoxesOnSameLine:()=>Rn,assert:()=>Mt,canElementHostShadowRoot:()=>ve,clamp:()=>Cn,classes:()=>$,closestElement:()=>M,contains:()=>R,containsSimilarErrors:()=>hn,createContainerElement:()=>w,createPromise:()=>Gt,createSafeScriptElement:()=>Je,createShadowRoot:()=>Se,createStylesheet:()=>$e,dataURItoBlob:()=>Ze,debugUITest:()=>Pt,defaultHighlightInteractionConfig:()=>bn,dispatchCustomEvent:()=>X,escapeHTMLInHighlightedPhrase:()=>mn,fadeOut:()=>B,fadeOutAndRemove:()=>G,filterNonBreakingSpaceErrors:()=>it,filterURLs:()=>Ft,findMinWords:()=>Nn,getActiveElement:()=>_e,getAutoLoginUrl:()=>nt,getBoundingBox:()=>v,getClosestXBox:()=>C,getCommonParent:()=>I,getConfigForMultipleErrorCorrection:()=>dn,getCurrentWordEndIndex:()=>On,getEditContext:()=>V,getEventTarget:()=>K,getFirstScrollableAncestor:()=>In,getFocusedElement:()=>pe,getFrameElement:()=>N,getHistoricPremiumErrors:()=>vt,getHostnames:()=>Bt,getParentCEElement:()=>Re,getPosition:()=>ye,getPremiumUrl:()=>St,getPreviousTextNode:()=>Ge,getRangeAtPoint:()=>oe,getRangeAtPointExcludingSpecifiedElements:()=>ie,getRectOverlapPercentage:()=>A,getScrollableAncestors:()=>ee,getSelectedHTML:()=>ce,getSelectedText:()=>le,getSelectionNear:()=>be,getShadowRoot:()=>fe,getTextWordCount:()=>wn,getTopMostDocumentObject:()=>Ln,getVisibleTopAndBottom:()=>U,getWeekNumber:()=>Rt,goToLogin:()=>st,goToManagedLogin:()=>tt,hasDarkBackground:()=>j,hasFirefoxDesignMode:()=>D,hasFocus:()=>H,hasGrammarMistakes:()=>un,hasSpellingMistakes:()=>gn,hasTextNodeChildWithContent:()=>P,hasValidSentenceRange:()=>de,hexToUuid:()=>At,highlightChangesInPhrase:()=>Tn,highlightChangesInSingleWord:()=>En,injectShadowStyles:()=>Xe,insertHtmlByPaste:()=>Z,isArticleJS:()=>zt,isCEElement:()=>ke,isCERootElement:()=>we,isCodeMirror:()=>Vt,isDialogLikeElement:()=>Pn,isDocumentNode:()=>Ne,isDraftJS:()=>Wt,isElement:()=>L,isElementNode:()=>De,isElementOnTop:()=>et,isElementScrollable:()=>Q,isElementWithInlineStyle:()=>Fe,isExtensionRuntimeError:()=>bt,isFixAppliedToText:()=>Bn,isFormElement:()=>Me,isFragmentNode:()=>Oe,isGoogleDocsCanvas:()=>tn,isGoogleSlides:()=>nn,isGutenberg:()=>Jt,isHorde:()=>sn,isInCEElement:()=>Le,isInDocument:()=>Ee,isInfomakerWriter:()=>Kt,isLTAvailable:()=>ze,isLTEditor:()=>en,isListOfURLs:()=>Ut,isMedium:()=>rn,isMultiSentenceSelected:()=>he,isNotion:()=>ln,isOdooEditor:()=>qt,isOpenXchangeEditor:()=>Zt,isParent:()=>z,isPointInsideRect:()=>b,isRectContainsRect:()=>T,isRectsEqual:()=>f,isRectsIntersect:()=>S,isSameRange:()=>ae,isScrollable:()=>O,isSelectionCollapsed:()=>xe,isShadowRoot:()=>Be,isSlateEditor:()=>Xt,isTextArea:()=>Ie,isTextElement:()=>Ue,isTextInput:()=>Pe,isTextNode:()=>He,isThunderbird:()=>an,isTinyMCE:()=>$t,isTrixEditor:()=>Qt,isValidCardInteractionType:()=>kn,isValidErrorInteractionType:()=>xn,isValidRootElement:()=>Ae,isValidURL:()=>Ht,isVisible:()=>F,isWikpedia:()=>on,isWriterDuet:()=>Yt,isYesterdayOrEarlier:()=>wt,loadExtensionStyles:()=>qe,loadStaticFile:()=>je,loadStylesheet:()=>We,makeElementsInert:()=>re,moveBox:()=>y,normalizeSelection:()=>ue,observeScrollableAncestors:()=>te,onElementDisabled:()=>ne,onElementRemoved:()=>se,onScrollEnd:()=>W,openPopup:()=>Ye,optionalEventDetail:()=>me,optionallySanitizeDanglingSelection:()=>ge,padRightWithHex:()=>yt,parseColor:()=>Ct,redactEmailAddress:()=>Lt,resizeBox:()=>x,setAnimationFrameInterval:()=>p,setAnimationFrameTimeout:()=>m,shouldUseCSSCustomHighlightsApi:()=>cn,shuffle:()=>kt,simpleTextHash:()=>Un,simulateMouseClick:()=>Qe,simulatePaste:()=>Y,trackHealthMetric:()=>Dn,trackHealthMetricSampled:()=>Hn,trackPerformanceMetrics:()=>Mn,trackUserTextChangeMetrics:()=>Gn,translateElement:()=>_,translateSection:()=>E,validateTextErrorsAsync:()=>Fn,wait:()=>g,waitForEditorToRetrieveSentenceRanges:()=>jt});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/ErrorProcessor */"./core/ErrorProcessor.ts"),i=n(/*! ../core/utils */"./core/utils.ts"),o=n(/*! ../init/config */"./init/config.ts"),a=n(/*! ./browserDetector */"./common/browserDetector.ts"),l=n(/*! ./domMeasurement */"./common/domMeasurement.ts"),c=n(/*! ./getExtensionAPI */"./common/getExtensionAPI.ts"),d=n(/*! ./i18nManager */"./common/i18nManager.ts"),h=n(/
312*! ./trackerAdapter */"./common/trackerAdapter.ts");
313/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
314const u=o.default.get(o.ConfigKey.EXTN_PREFIX);function g(e=25,t){return new Promise(((n,s)=>{const r=setTimeout((()=>{o(),n()}),e),i=()=>{const e=new DOMException(t.reason||"`wait` was aborted","AbortError");clearTimeout(r),o(),s(e)},o=()=>{t&&t.removeEventListener("abort",i)};t?.aborted?i():t&&t.addEventListener("abort",i)}))}function m(e,t){let n=null,s=!1;const r=self.setTimeout((()=>{s||(n=requestAnimationFrame((()=>e())))}),t);return{destroy:()=>{s=!0,clearTimeout(r),n&&cancelAnimationFrame(n)}}}function p(e,t){let n=null,s=!1;const r=()=>{n=m((()=>{s||(e(),r())}),t)};return r(),{destroy:()=>{s=!0,n&&(n.destroy(),n=null)}}}function _(e,t){"string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={key:t}),t.isHTML?e.innerHTML=d.i18nManager.getMessage(t.key,t.interpolations):t.attr&&t.attr in e?e[t.attr]=d.i18nManager.getMessage(t.key,t.interpolations):t.attr?e.setAttribute(t.attr,d.i18nManager.getMessage(t.key,t.interpolations)):e.textContent=d.i18nManager.getMessage(t.key,t.interpolations)}function E(e){Array.from(e.querySelectorAll("[data-t]")).forEach((e=>{_(e,e.getAttribute("data-t"))})),Array.from(e.querySelectorAll("[data-t-placeholder]")).forEach((e=>{_(e,{key:e.getAttribute("data-t-placeholder"),attr:"placeholder"})})),Array.from(e.querySelectorAll("[data-t-html]")).forEach((e=>{_(e,{key:e.getAttribute("data-t-html"),isHTML:!0})})),Array.from(e.querySelectorAll("[data-t-title]")).forEach((e=>{_(e,{key:e.getAttribute("data-t-title"),attr:"title"})})),Array.from(e.querySelectorAll("[data-t-attr]")).forEach((e=>{const[t,n]=(e=>{const t=String(e.getAttribute("data-t-attr"));try{const e=JSON.parse(t);if((e=>Array.isArray(e)&&"string"==typeof e[0]&&"string"==typeof e[1]&&2===e.length)(e))return e;throw Error()}catch{return["",""]}})(e);t&&n&&_(e,{key:n,attr:t})}))}function f(e,t,n=0){return 0===n?e.top===t.top&&e.right===t.right&&e.bottom===t.bottom&&e.left===t.left:Math.abs(e.top-t.top)<=n&&Math.abs(e.right-t.right)<=n&&Math.abs(e.bottom-t.bottom)<=n&&Math.abs(e.left-t.left)<=n}function T(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function C(e,t){const n=t.left+t.width/2;let s=null,r=Number.MAX_SAFE_INTEGER;for(const t of e){const e=Math.min(Math.abs(n-t.left),Math.abs(n-t.right));e<=r&&(s=t,r=e)}return s}function v(e){if(!e.length)return null;const t={left:Math.min(...e.map((e=>e.left))),top:Math.min(...e.map((e=>e.top))),right:Math.max(...e.map((e=>e.right))),bottom:Math.max(...e.map((e=>e.bottom)))};return{...t,width:t.right-t.left,height:t.bottom-t.top}}function S(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}function b(e,t,n=0){return"object"==typeof t&&(n=t.y,t=t.x),e.left<=t&&t<=e.right&&e.top<=n&&n<=e.bottom}function x(e,t,n){return Object.assign({},e,{right:e.left+t,bottom:e.top+n,width:t,height:n})}function y(e,t,n){return Object.assign({},e,{top:e.top+n,right:e.right+t,bottom:e.bottom+n,left:e.left+t})}function A(e,t){return Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top))/(t.width*t.height)*100}function k(e,t,n=10){const s=n/100,r=Math.abs(e.width-t.width)/Math.max(e.width,t.width),i=Math.abs(e.height-t.height)/Math.max(e.height,t.height);return r<=s&&i<=s}function w(e,t){const n=e.createElement(t);return n.setAttribute("contenteditable","false"),navigator.userAgent.includes("Mac OS")&&n.classList.add(`${u}--mac-os`),a.BrowserDetector.isThunderbird()&&n.classList.add(`${u}--thunderbird`),n}function R(e,t){return"object"==typeof t?e!==t&&e.contains(t):!!L(e)&&!!e.querySelector(t)}function L(e){return e instanceof(e?.ownerDocument?.defaultView?.Element||Element)}function M(e,t){const n=e.closest(t);if(n)return n;if(!e.getRootNode)return null;const s=e.getRootNode();return Be(s)?M(s.host,t):null}function I(e,t){let n=e.parentElement;for(;n;){if(R(n,t))return n;n=n.parentElement}return null}function P(e){return Array.from(e.childNodes).some((e=>Boolean(e.nodeType===Node.TEXT_NODE&&e.nodeValue&&e.nodeValue.trim())))}function N(e){return e.frameElement}function O(e){const t=self.getComputedStyle(e);return"auto"===t.overflowY||"scroll"===t.overflowY}function D(e){return Boolean(e.ownerDocument&&"on"===e.ownerDocument.designMode&&a.BrowserDetector.isFirefox())}function H(e){return e.matches(":focus")||"BODY"===e.nodeName&&D(e)&&e.ownerDocument.hasFocus()}const U=(()=>{const e=(e,t,n,s)=>{const r=e.ownerDocument;let i=r.elementFromPoint(n,s);return!!i&&(!(e!==i&&!e.contains(i))||!!t.length&&(t.find((e=>e.contains(i)))&&(i=r.elementsFromPoint(n,s).find((e=>!1===t.some((t=>t.contains(e)))))||null),Boolean(i&&(e===i||e.contains(i)))))};return(t,n,s,r)=>{const i=n.getPaddingBox(t,!1),o=t.ownerDocument.contains(t);if(Be(t.getRootNode()))return{top:0,bottom:i.height};if(i.bottom<0||i.top>s||!o)return{top:0,bottom:0};let a=[];r&&(a=Array.from(t.ownerDocument.querySelectorAll(r)));const l=i.left+Math.round(i.width/100*33),c=Math.max(i.top,0);let d=c;for(;;){if(e(t,a,l,d)){if(d===c)break;for(;d--;)if(!e(t,a,l,d)){d++;break}break}if(d===i.bottom)break;d=Math.min(i.bottom,d+6)}const h=Math.min(i.bottom,s);let u=h;for(;;){if(e(t,a,l,u-1)){if(u===h)break;for(;u++<h;)if(!e(t,a,l,u-1)){u--;break}break}if(u===d)break;u=Math.max(d,u-6)}return{top:Math.round(Math.max(0,d-i.top)),bottom:Math.round(Math.max(0,u-i.top))}}})();function F(e){return(e.offsetWidth>0||e.offsetHeight>
3140)&&"hidden"!==new l.DomMeasurement(document).getStyle(e,"visibility")}function B(e,t){let n=1;const s=new l.DomMeasurement(e.ownerDocument),r=p((()=>{if(n-=.08,n<=0)return r.destroy(),void(t&&t());s.setStyles(e,{opacity:n+" !important"})}),16)}function G(e,t){if(!e.ownerDocument)return;let n=1;const s=new l.DomMeasurement(e.ownerDocument),r=p((()=>{if(n-=.08,n<=0)return e.remove(),r.destroy(),void(t&&t());s.setStyles(e,{opacity:n+" !important"})}),16)}function j(e){let t=20,n=e;for(;--t;){const e=self.getComputedStyle(n);if(e.backgroundImage&&"none"!==e.backgroundImage)return!1;const t=Ct(e.backgroundColor);if(t&&t.opacity>=.25)return t.lightness<=35;if(!n.parentElement)return!1;n=n.parentElement}return!1}function W(e,t){let n;const s=()=>{self.clearTimeout(n),n=self.setTimeout((()=>(self.clearTimeout(n),e.removeEventListener("scroll",r,!0),void t())),200)},r=()=>{s()};s(),e.addEventListener("scroll",r,!0)}function $(...e){return e.map((e=>"string"==typeof e?e.trim():e)).filter(Boolean).filter(((e,t,n)=>n.indexOf(e)===t)).join(" ")}function z(e,t){let n=t;for(;n&&n.parentNode;){if(n===e||n.parentNode===e)return!0;n=n.parentNode instanceof DocumentFragment?n.parentNode.host:n.parentNode}return!1}function V(e){return"editContext"in e&&e.editContext&&"EditContext"===Object.getPrototypeOf(e.editContext).constructor.name?e.editContext:null}function K(e){if("function"==typeof e.composedPath){const t=e.composedPath();if(t[0])return t[0]}return e.target}function X(e,t,n){const s=new CustomEvent(t,{detail:n,cancelable:!0});return e.dispatchEvent(s)}function q(e,t){Object.entries(t).filter((([e,t])=>
314"string"==typeof t)).forEach((([t,n])=>e?.setData(t,n)))}function Y(e,t){const n=e.ownerDocument.defaultView,s=t["text/html"]?"text/html":"text/plain",r={clipboardData:new n.DataTransfer,cancelable:!0,bubbles:!0};let i;a.BrowserDetector.isFirefox()||a.BrowserDetector.isThunderbird()?(r.data=t[s],r.dataType=s,i=new n.ClipboardEvent("paste",r)):(i=new n.ClipboardEvent("paste",r),q(i.clipboardData,t));let o=e.dispatchEvent(i);if(o){const r=new n.InputEvent("beforeinput",{data:t[s],inputType:"insertFromPaste",cancelable:!0,bubbles:!0});q(r.dataTransfer,t),"insertFromPaste"===r.inputType&&(o=e.dispatchEvent(r))}return o}async function Z(e,t,n,s=10){let r=Y(e,t);if(r){const s=new DataTransfer;s.setData("text/plain",t["text/plain"]),s.setData("text/html",t["text/html"]);const i={bubbles:!0,cancelable:!0,inputType:"",data:t["text/plain"],dataTransfer:s};n&&(i.targetRanges=[new StaticRange(n)]),r=e.ownerDocument.dispatchEvent(new InputEvent("input",i)),r&&e.ownerDocument.execCommand("insertHTML",!1,t["text/html"])}await g(s)}function J(e,t,n){const s=Ne(e)?e:e.ownerDocument,r=t=>{const s=K(t);(De(s)||He(s))&&e.contains(s)&&n(t)};return s.defaultView?.addEventListener(t,r,!0),{destroy(){s.defaultView?.removeEventListener(t,r,!0)}}}function Q(e,t){const n=t.getStyles(e,["overflow-x","overflow-y"]),s=n["overflow-x"],r=n["overflow-y"];return"auto"===r||"scroll"===r||"auto"===s||"scroll"===s}function ee(e,t=new l.DomMeasurement(e.ownerDocument)){const n=[];let s=e.parentElement;const r=e.ownerDocument.defaultView;for(;s;)Q(s,t)&&n.push(s),s=s.parentNode instanceof r.ShadowRoot&&s.parentNode.host instanceof r.HTMLElement?s.parentNode.host:s.parentElement;return n.push(r),n}function te(e,t,n){const s=ee(e,n);let r=!1;const i=()=>{r||(r=!0,requestAnimationFrame((()=>{r=!1,t()})))};return s.forEach((e=>{e.addEventListener("scroll",i)})),{destroy(){s.forEach((e=>{e.removeEventListener("scroll",i)})),r=!0}}}const ne=(()=>{let e;const t=[];return(n,s,r)=>{t.push({element:n,callback:s}),e=e||self.setInterval((()=>{const n=[];t.forEach((e=>{!e.element.readOnly&&!e.element.disabled&&F(e.element)&&r(e.element)||(n.push(e),e.callback(e.element))})),n.forEach((e=>{t.splice(t.indexOf(e),1)})),t.length||(clearInterval(e),e=null)}),600)}})(),se=(()=>{let e=null,t=[];
314function n(n){if(!n.some((e=>e.removedNodes.length>0)))return;const r=[];for(const e of t)Ee(e.element)||(e.callback(e.element),r.push(e),e.signal?.removeEventListener("abort",s));t=t.filter((e=>!r.includes(e))),t.length||(e.disconnect(),e=null)}function s(n){t=t.filter((e=>e.signal===n.currentTarget)),t.length||(e.disconnect(),e=null)}return(r,i,o)=>{t.push({element:r,callback:i,signal:o}),e||(e=new MutationObserver(n),e.observe(document.documentElement,{childList:!0,subtree:!0})),o?.addEventListener("abort",s)}})(),re=e=>{const t=[];return document.querySelectorAll(e.join(",")).forEach((e=>{e.hasAttribute("inert")||(t.push(e),e.setAttribute("inert",""))})),{restoreInertedElements:()=>{t.forEach((e=>{e.removeAttribute("inert")}))}}};function ie(e,t=[`${u}-card`]){const{restoreInertedElements:n}=re(t),s=oe(e);return n(),s}function oe(e){if(document.caretRangeFromPoint)return document.caretRangeFromPoint(e.x,e.y);if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.x,e.y);if(!t||!t.offsetNode)return null;try{const e=new Range;return e.setStart(t.offsetNode,t.offset),e.setEnd(t.offsetNode,t.offset),e}catch(e){return null}}return null}function ae(e,t){return!(!e||!t||e.startContainer!==t.startContainer||e.startOffset!==t.startOffset||e.endOffset!==t.endOffset||e.endContainer!==t.endContainer)}function le(){const e=self,t=_e(),n=t?t.tagName.toLowerCase():null;return"textarea"===n||"input"===n&&/^(?:text|search|password|tel|url)$/i.test(t.type)&&"number"==typeof t.selectionStart?t.value.slice(t.selectionStart,t.selectionEnd):e.getSelection&&e.getSelection()?e.getSelection().toString():""}function ce(){const e=document.activeElement,t=e?e.tagName.toLowerCase():null;if("textarea"===t||"input"===t&&/^(?:text|search|password|tel|url)$/i.test(e.type)&&"number"==typeof e.selectionStart)return;const n=self.getSelection();if(!n||0===n.rangeCount)return;const s=n.getRangeAt(0).cloneContents(),r=document.createElement("div");return r.appendChild(s),r.innerHTML}function de(e,t,n){const s=o.default.get(o.ConfigKey.MULTI_SENTENCE_SELECTION_FOR_PARAPHRASE_ALLOWED),i=/^[^\S\r\n]*$/,a=Math.min(n.start,n.end??n.start),l=Math.max(n.start,n.end??n.start),c=t?[...t]:[];r.ErrorProcessor.sortSentenceRanges(c);const d=c.length?c[0].start:0;if(l<d){const t=e.substring(a,d);return i.test(t)}if(!s){for(let t=0;t<c.length;t++){const n=c[t],s=0==t?-1:c[t-1].end,r=t===c.length-1?e.length+1:c[t+1].start,o=n.start<=a&&a<=n.end||s<a&&a<n.start&&i.test(e.substring(a,n.start))||n.end<a&&a<r&&i.test(e.substring(n.end,a)),d=n.start<=l&&l<=n.end||n.end<l&&l<r&&i.test(e.substring(n.end,l));if(o&&d)return!0}return!1}return!0}function he(e,t){const{start:n,end:s=n}=t||{start:-1};return!(!e||-1===n)&&e.map((e=>Array.isArray(e)?e:[e.start,e.end])).findIndex((([e,t])=>n>=e&&s<=t))<0}function ue(e){const{start:t,end:n=t}=e;return{start:Math.min(t,n),end:Math.max(t,n)}}function ge(e,t,n,s=!1){const i=/^\s*$/,o=(()=>{try{return new RegExp("^[^\\r\\n\\p{L}]+$","u")}catch{return new RegExp("^[^\\r\\na-záàâóòìíéèùúâôîêûäöüß]+$","i")}})(),{start:a,end:l}=ue(n);if([a,l].every((e=>-1===e)))return{start:-1,end:-1};const c=t?[...t]:[];let d=null,h=null;r.ErrorProcessor.sortSentenceRanges(c);const u=c.length,g=u?c[0].start:0;if(l<g){const t=e.substring(a,g);if(i.test(t))return{start:g,end:g}}for(let t=0;t<u;t++){const n=c[t],r=u-1===t,g=0===t?-1:c[t-1].end,m=t===u-1?e.length+1:c[t+1].start,p=g<a&&a<n.start&&i.test(e.substring(a,n.start)),_=n.end<a&&a<m&&o.test(e.substring(n.end,a)),E=l<n.start,f=n.end<l&&l<=m&&l>=a&&o.test(e.substring(n.end,l)),T=a>n.end&&l<m,C=T&&l===a,v=T&&o.test(e.substring(n.end,a)),S=l!==a||C||r;if(T&&!v?(d=s?n.start:a,h=l):(p&&!E?d=n.start:_&&f&&S&&(d=n.end),f&&S&&(h=n.end)),null!==d&&null!==h)break}return d??(d=a),h??(h=l),{start:d,end:h}}function me(e){return e.detail instanceof Object?e.detail:null}function pe(e=document){let t=e.querySelector(":focus");for(;t&&t.shadowRoot;)t=t.shadowRoot.querySelector(":focus");return t}function _e(e=document){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ee(e){if(e.ownerDocument&&e.ownerDocument.contains(e))return!0;let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof DocumentFragment?t.parentNode.host:t.parentNode}return!1}function fe(e){let t=e&&e.parentNode;for(;t;){if("[object ShadowRoot]"===t.toString())return t;t=t.parentNode}return null}const Te=new Set(["article","aside","blockquote","body","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"]),Ce=/^[a-z].*-.*$/;function ve(e){if(e.shadowRoot)return!1;for(let t=0;t<e.children.length;t++)if(e.children[t].hasAttribute("slot"))return!1;const t=e.tagName.toLowerCase();return Te.has(t)||Ce.test(t)}function Se(e,t){try{const n=[];for(const s of Array.from(e.children))Fe(s)&&n.push([s,t.getStyle(s,"display")]);const s=e.attachShadow({mode:"closed"}),r=e.ownerDocument.createElement("slot");r.style.all="inherit",r.style.display="contents",s.appendChild(r);for(const[e,s]of n)t.getStyle(e,"display")!==s&&t.setStyle(e,"display",s,!0);return s}catch{return null}}function be(e){if(a.BrowserDetector.isFirefox())return e.ownerDocument.getSelection();const t=fe(e);return t&&"getSelection"in t&&(0,i.isFunction)(t.getSelection)?t.getSelection():self.getSelection()}function xe(e){let t=e.isCollapsed;return t&&e.anchorNode===e.focusNode&&e.anchorOffset!==e.focusOffset&&(t=!1),e.toString().length>0&&(t=!1),t}function ye(e,t){const n=t.compareDocumentPosition(e);return 4&n?"after":2&n?"before":null}function Ae(e){const t="object"==typeof e&&null!==e&&"ownerDocument"in e?e.ownerDocument:null,n=t?.defaultView||null;return null!==n&&(e instanceof n.HTMLElement||e instanceof n.SVGElement)}function ke(e){return e instanceof HTMLElement&&(e.isContentEditable||"BODY"===e.nodeName&&D(e))}function we(e){return e instanceof HTMLElement&&(!(!e.isContentEditable||!e.hasAttribute("contenteditable"))||!("BODY"!==e.n
314odeName||!D(e)))}function Re(e){const t=e.parentElement?.closest("[contenteditable=''], [contenteditable=true]");return t||null}function Le(e){return!!Re(e)}function Me(e){return Ie(e)||Pe(e)}function Ie(e){return e instanceof HTMLTextAreaElement}function Pe(e){return e instanceof HTMLInputElement&&("text"===e.type||"search"===e.type)}function Ne(e){return e.nodeType===Node.DOCUMENT_NODE}function Oe(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function De(e){return e.nodeType===Node.ELEMENT_NODE}function He(e){return e.nodeType===Node.TEXT_NODE}function Ue(e){return e.nodeType===Node.ELEMENT_NODE&&"text"===e.tagName.toLowerCase()}function Fe(e){return e.style instanceof CSSStyleDeclaration}function Be(e){return Oe(e)&&"ShadowRoot"===Object.getPrototypeOf(e).constructor.name}function Ge(e,t,n=e.parentElement){if(!t.contains(n)||!n?.getRootNode())return null;const s=e.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_TEXT);let r=null;for(;s.nextNode();){const t=s.currentNode;if(t===e)break;r=t}return r||Ge(e,t,n.parentElement)}function je(e){return fetch(e).then((e=>e.text()))}function We(e){const t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",(document.head||document.body).appendChild(t)}function $e(e){const t=document.createElement("style");return t.type="text/css",t.appendChild(document.createTextNode(e)),(document.head||document.body).appendChild(t),t}function ze(e){try{return e.document.documentElement.hasAttribute(o.default.get(o.ConfigKey.INSTALLED_ATTRIBUTE))}catch(e){}return!1}function Ve(e){const t=e.document.createElement("div");t.className=`${u}-test-element`,e.document.documentElement.appendChild(t);const n="absolute"===e.getComputedStyle(t).position;return t.remove(),n}function Ke(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return!0;const t=e.ownerDocument.createElement("div");t.className=`${u}-test-element`,e.appendChild(t);const n="absolute"===e.ownerDocument.defaultView.getComputedStyle(t).position;return t.remove(),n}function Xe(e,t){const n=t||"content/styles/shadow.css",s=(0,c.getExtensionAPI)().runtime.getURL(n);if(!e.querySelector(`[href="${s}"]`)){const t=document.createElement("link");t.href=s,t.rel="stylesheet",e.append(t)}}function qe(e){const t=self,n=(t.chrome||t.browser).runtime;(n.getManifest().content_scripts||[]).forEach((t=>{t.css&&t.css.forEach((t=>{const s=e.createElement("link");s.rel="stylesheet",s.href=n.getURL(t),e.head.appendChild(s)}))}))}function Ye(e,t,n,s=Date.now().toString()){const r=self,i=void 0!==r.screenLeft?r.screenLeft:r.screenX,o=void 0!==r.screenTop?r.screenTop:r.screenY,a=r.innerWidth?r.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,l=r.innerHeight?r.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,c=a/r.screen.availWidth,d=(a-t)/2/c+i,h=(l-n)/2/c+o;return r.open(e,s,`\n      scrollbars=yes,\n\t  resizable=yes,\n      width=${t/c},\n      height=${n/c},\n      top=${h},\n      left=${d}\n      `)}function Ze(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";
314")[0],s=new ArrayBuffer(t.length),r=new Uint8Array(s);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return new Blob([s],{type:n})}function Je(){const e=document.createElement("script");return e.setAttribute("data-cookieconsent","ignore"),e.setAttribute("data-uc-allowed","true"),e}function Qe(e,t={}){const n=new MouseEvent("click",Object.assign({},t,{view:self,button:0,bubbles:!0,cancelable:!0}));e.dispatchEvent(n)}function et(e,t,n,s,r){const i=Math.max(t.left,s.left),o=Math.max(t.top,s.top),a=Math.min(t.right,s.right),l=Math.min(t.bottom,s.bottom);if(i>=a||o>=l)return!1;const c=(i+a)/2,d=(o+l)/2,h=r.elementsFromPoint(c,d),u=h.indexOf(e),g=h.indexOf(n);return-1!==u&&-1!==g&&u<g}const tt=function(){let e,t=null;const n=t=>{t.origin.match(/^chrome|moz|safari/)&&e(t.data)};return function(s,r){const i=self;let o=null;e=function(e){const[t,n]=JSON.parse(e);t&&n&&(a(),r(t,n))};const a=function(){t&&clearInterval(t),i.removeEventListener("message",n);try{(0,c.getExtensionAPI)().storage.local.remove("managedLoginCredentials")}catch(e){}try{o&&o.close()}catch(e){}};a(),t=self.setInterval((()=>{(0,c.getExtensionAPI)().storage.local.get("managedLoginCredentials").then((t=>{t.managedLoginCredentials&&e(t.managedLoginCredentials)})).catch((()=>null))}),400),i.addEventListener("message",n);const l=(0,c.getExtensionAPI)().runtime.getURL("/welcome/managedLoginRedirectUri.html"),d=new URL(s);d.searchParams.set("redirect_uri",l),o=Ye(d.toString(),640,480)}}(),nt=function(e,t,n){const r=new URL(s.AUTO_LOGIN_URL);return r.searchParams.set("email",e),r.searchParams.set("addon_token",t),n&&r.searchParams.set("temp_text_id",n),r.toString()},st=function(){const e="GET_LOGIN_CREDENTIALS";let t,n=null;const s=e=>{t(e.data)};return function(r,i){const o=self;let a=null;t=function(t){const{data:n,type:s}=Object(t);if(s!==e||"string"!=typeof n)return;const[r,o]=JSON.parse(n);r&&o&&(l(),i(r,o))};const l=function(){n&&clearInterval(n),o.removeEventListener("message",s);try{(0,c.getExtensionAPI)().storage.local.remove("loginCredentials")}catch(e){}try{a&&a.close()}catch(e){}};l(),n=self.setInterval((()=>{(0,c.getExtensionAPI)().storage.local.get("loginCredentials").then((n=>{n.loginCredentials&&t({type:e,data:n.loginCredentials})})).catch((()=>null))}),400),o.addEventListener("message",s);const d=(0,c.getExtensionAPI)().runtime.getURL("/welcome/loginRedirectUri.html"),h=new URL(r);h.searchParams.set("callback_uri",d),a=Ye(h.toString(),640,480,"lt-login-"+Date.now())}}(),rt=/\u00A0/g;function it(e){return e.filter((e=>!e.fixes[0]||e.fixes[0].value.replace(rt," ")!==e.originalPhrase))}const ot=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,at=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,lt=/^rgba?\((\d{1,3}), (\d{1,3}), (\d{1,3})(?:, (\d(?:\.\d+)?))?\)/i,ct=/^lab\((none|\d+(?:\.\d+)?) (none|-?\d+(?:\.\d+)?) (none|-?\d+(?:\.\d+)?)(?: \/ (none|1|0(?:\.\d+)?))?\)$/i,dt=/^lch\((none|\d+(?:\.\d+)?) (none|\d+(?:\.\d+)?) (none|\d+(?:\.\d+)?)(?: \/ (none|1|0(?:\.\d+)?))?\)$/i,ht=/^oklab\((none|0(?:\.\d+)?) (none|-?0(?:\.\d+)?) (none|-?0(?:\.\d+)?)(?: \/ (none|1|0(?:\.\d+)?))?\)$/i,ut=/^oklch\((none|1|0(?:\.\d+)?) (none|0(?:\.\d+)?) (none|\d+(?:\.\d+)?)(?: \/ (none|1|0(?:\.\d+)?))?\)$/i;function gt(e,t,n){const s=Math.abs(e),r=Math.abs(t),i=Math.abs(n);return[255*(s>.0031308?Math.sign(e)*(1.055*Math.pow(s,1/2.4)-.055):12.92*e),255*(r>.0031308?Math.sign(t)*(1.055*Math.pow(r,1/2.4)-.055):12.92*t),255*(i>.0031308?Math.sign(n)*(1.055*Math.pow(i,1/2.4)-.055):12.92*n)]}function mt(e,t,n){return function(e,t,n){return gt(3.1341359569958707*e-1.6173863321612538*t-.4906619460083532*n,-.978795502912089*e+1.916254567259524*t+.03344273116131949*n,.07195537988411677*e-.2289768264158322*t+1.405386058324125*n)}(...function(e,t,n){const s=Math.pow(29,3)/Math.pow(3,3),r=Math.pow(6,3)/Math.pow(29,3),i=(e+16)/116,o=t/500+i,a=i-n/200,l=Math.pow(o,3),c=Math.pow(i,3),d=Math.pow(a,3);return[.3457*(l>r?l:(116*o-16)/s)/.3585,c>r?c:(116*i-16)/s,.2958*(d>r?d:(116*a-16)/s)/.3585]}(e,t,n))}function pt(e,t,n){return[e,t*Math.cos(n/180*Math.PI),t*Math.sin(n/180*Math.PI)]}function _t(e,t,n){return gt(...function(e,t,n){const s=Math.pow(.9999999984505198*e+.3963377921737678*t+.2158037580607588*n,3),r=Math.pow(1.0000000088817607*e-.1055613423236563*t-.0638541747717059*n,3),i=Math.pow(1.00000005467241*e-.0894841820949657*t-1.2914855378640917*n,3);return[4.076741661347994*s-3.307711590408193*r+.230969928729428*i,-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*i,-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*i]}
314(e,t,n))}function Et(e,t,n){const s=Math.max(e,t,n)/255,r=Math.min(e,t,n)/255;return Math.round((s+r)/2*100)}function ft(e,t,n){return Et(...mt(e,t,n))}function Tt(e,t,n){return Et(..._t(e,t,n))}function Ct(e){if(Array.isArray(e))return{opacity:4===e.length?e[3]:1,lightness:Et(e[0],e[1],e[2])};if(!e)return null;if("transparent"===e)return{opacity:0,lightness:100};let t=ot.exec(e)||at.exec(e);if(t)return{opacity:t[4]?parseInt(t[4].padEnd(2,t[4]),16)/255:1,lightness:Et(parseInt(t[1].padEnd(2,t[1]),16),parseInt(t[2].padEnd(2,t[2]),16),parseInt(t[3].padEnd(2,t[3]),16))};if(t=lt.exec(e),t)return{opacity:t[4]?parseFloat(t[4]):1,lightness:Et(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]))};if(t=ct.exec(e),t)return{opacity:t[4]?"none"===t[4]?0:parseFloat(t[4]):1,lightness:ft("none"===t[1]?0:parseFloat(t[1]),"none"===t[2]?0:parseFloat(t[2]),"none"===t[3]?0:parseFloat(t[3]))};if(t=dt.exec(e),t){const e=t[4]?"none"===t[4]?0:parseFloat(t[4]):1,n=function(e,t,n){return ft(...pt(e,t,n))}("none"===t[1]?0:parseFloat(t[1]),"none"===t[2]?0:parseFloat(t[2]),"none"===t[3]?0:parseFloat(t[3]));return{opacity:e,lightness:n}}if(t=ht.exec(e),t)return{opacity:t[4]?"none"===t[4]?0:parseFloat(t[4]):1,lightness:Tt("none"===t[1]?0:parseFloat(t[1]),"none"===t[2]?0:parseFloat(t[2]),"none"===t[3]?0:parseFloat(t[3]))};if(t=ut.exec(e),t){const e=t[4]?"none"===t[4]?0:parseFloat(t[4]):1,n=function(e,t,n){return Tt(...pt(e,t,n))}("none"===t[1]?0:parseFloat(t[1]),"none"===t[2]?0:parseFloat(t[2]),"none"===t[3]?0:parseFloat(t[3]));return{opacity:e,lightness:n}}return null}function vt(e){const t=300;let n=0;const s=Date.now();let r=0;for(const i of e.hiddenErrors){const e=+new Date(i.day);if(s-e>864e6)break;if(r=e,n+=i.count,n>t){n=t;break}}let i=String(n);return n>=t&&(i="300+"),{hiddenErrorsCount:n,hiddenErrorsCountStr:i,dayCount:Math.ceil((s-r)/1e3/60/60/24)}}function St(e,t=0,n=0,s=0,r="",i){const o=new URL("https://languagetool.org/premium");return o.searchParams.set("utm_campaign",e),i&&o.searchParams.set("textLang",i),r&&o.searchParams.set("historicMatches",r),t&&o.searchParams.set("grammarMatches",String(t)),s&&o.searchParams.set("punctuationMatches",String(s)),n&&o.searchParams.set("styleMatches",String(n)),o.toString()}function bt(e){return e.startsWith("Invocation of form runtime.connect(null, ) doesn't match definition runtime.connect")||e.startsWith("Extension context invalidated")}const xt=Array.from({length:16},((e,t)=>t.toString(16)));function yt(e,t){const n=e.length,s=Math.max(0,t-n);return e+Array.from({length:s},(()=>{const e=Math.floor(Math.random()*xt.length);return xt[e]})).join("")}function At(e){if(e.length>24)throw new Error(`Given unique ID "${e}" exceeds length of 24`);const t=e.slice(0,12),n=e.slice(12,20),s=e.slice(20,24);return[yt(n,12),yt(s,4),"4A96","BEA4",yt(t,12)].join("-")}function kt(e){return Array(e.length).fill(null).map(((e,t)=>[Math.random(),t])).sort((([e],[t])=>e-t)).map((([,t])=>e[t]))}function wt(e){const t=new Date,n=e.getDate()<t.getDate(),s=e.getMonth()<t.getMonth(),r=e.getFullYear()<t.getFullYear();return e.getTime()<t.getTime()&&(n||s||r)}function Rt(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),n=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-n);const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-s.getTime())/864e5+1)/7)}function Lt(e){const t=[".","-","+"];return e.split("").map(((e,n,s)=>{const r=0===n,i=n===s.length-1,o=t.includes(e),a=t.includes(s[n-1])||t.includes(s[n+1]);switch(!0){case r:case i:case o:case a:return e;default:return"*"}})).join("")}function Mt(e,t){if(!1===Boolean(e))throw new Error(t||`Invalid value ${e}`)}let It=0;function Pt(e,t="left"){if(!0!==navigator.webdriver)throw new Error("debugUITest() must not run outside of automated UI tests.");if(!1===("file:"===location.protocol||["localhost","127.0.0.1","0.0.0.0"].includes(location.hostname)))return;const n=new l.DomMeasurement,s=document.createElement("div");n.setStyles(s,{position:"fixed",top:16*It+++"px",left:"left"===t?"0px":"auto",right:"right"===t?"0px":"auto",background:"rgba(0, 0, 0, .8)",color:"white","line-height":"16px","font-size":"12px","border-top":"1px solid white","pointer-events":"none"},!0),s.textContent=e,document.body.append(s)}const Nt=/^(https?:\/\/)?localhost(:[0-9]{1,5})?(\/.*)?$/i,Ot=/^(https?:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,15}(:[0-9]{1,5})?(\/.*)?$/i,Dt=/^(?:https?:\/\/)?(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}(?::[0-9]{1,5})?$/;function Ht(e){return Nt.test(e)||Ot.test(e)||Dt.test(e)}function Ut(e){return e.length>0&&e.every((e=>Ht(e)))}function Ft(e){return e.filter((e=>Ht(e)))}function Bt(e){return Ft(e).map((e=>{try{return(0,i.getDomain)(e)}catch{return null}})).filter((e=>!!e))}
314function Gt(){if((0,i.isFunction)(Promise.withResolvers))return Promise.withResolvers();let e=()=>{},t=()=>{};const n=new Promise(((n,s)=>{e=n,t=s}));return{resolve:e,reject:t,promise:n}}function jt(e,t=s.CHECK_REQUEST_TIMEOUT){if(!e.isSentenceRangesChecking)return Promise.resolve();let n=0;const{promise:r,resolve:i,reject:o}=Gt(),a=()=>{n+=1,20*n>t?o():e.isSentenceRangesChecking?self.setTimeout(a,20):i()};return a(),r}function Wt(e){return Boolean(e.closest(".DraftEditor-editorContainer"))||/(facebook|messenger)\.com/.test(location.host)&&(e.hasAttribute("aria-describedBy")||["textfield","textbox"].includes(e.getAttribute("role")||""))&&e.hasAttribute("contenteditable")||!!e.querySelector("div[data-contents=true]")&&e.classList.contains("notranslate")}function $t(e){return e.classList.contains("mce-content-body")||e.classList.contains("mceContentBody")}function zt(e){try{const t=e.ownerDocument.defaultView.frameElement;return!!t&&t.classList.contains("arx-editor-frame")}catch(e){return!1}}function Vt(e){return!!e.closest("div.CodeMirror")||e.classList.contains("cm-content")}function Kt(e){return location.host.includes("infomaker")&&e.classList.contains("sc-container-editor")}function Xt(e){return e.hasAttribute("data-slate-editor")}function qt(e){return e.classList.contains("odoo-editor-editable")}function Yt(e){return location.href.includes("writerduet.com")}function Zt(e){return!!e.closest("[data-app-name='io.ox/office/text']")}function Jt(e){return e.classList.contains("editor-rich-text__editable")||e.classList.contains("block-editor-writing-flow")||e.classList.contains("block-editor-rich-text__editable")}function Qt(e){return"trix-editor"===e.nodeName.toLowerCase()}function en(e){return e.classList.contains("lt-textarea__textarea")}function tn(e){return e.classList.contains("kix-canvas-tile-content")}function nn(e){const{hostname:t,pathname:n}=e.ownerDocument.defaultView?.location||{};return"docs.google.com"===t&&n?.startsWith("/presentation/")}function sn(e){return self!==self.parent&&e.ownerDocument&&e===e.ownerDocument.body&&e.ownerDocument.documentElement.isContentEditable&&e.classList.contains("cke_show_borders")}function rn(e){return location.host.includes("medium.com")&&"true"===e.getAttribute("g_editable")}function on(e){return e.classList.contains("ve-ce-rootNode")}function an(e){return location.href.startsWith("about:blank?compose")&&"BODY"===e.tagName&&"on"===document.designMode}function ln(e){return location.href.includes("notion.so")}function cn(){return location.host.includes("mail.google.com")&&!!(self.Highlight&&self.CSS&&self.CSS.highlights)&&!!o.default.get(o.ConfigKey.USE_CSS_CUSTOM_HIGHLIGHTS)}function dn(e,t){for(const n of s.ERRORS_THAT_CAN_BE_CORRECTED_ALL_AT_ONCE){if(n.ruleId!==e.rule.id)continue;const s=n.suggestions.find((e=>e.match.test(t)));if(s)return{suggestion:s,ruleId:e.rule.id}}}function hn(e,t){return e.some((e=>e.rule.id===t.rule.id&&e.start!==t.start))}function un(e){return e.displayedErrors.concat(e.displayedPremiumErrors).some((e=>!1===e.isPunctuationError&&!1===e.isSpellingError&&!1===e.isStyleError&&!1===e.isCustomError))}function gn(e){return e.displayedErrors.concat(e.displayedPremiumErrors).some((e=>e.isSpellingError))}function mn(e){let t=(0,i.escapeHTML)(e);return["<lt-strong>","</lt-strong>","<lt-em>","</lt-em>"].forEach((e=>{t=t.split((0,i.escapeHTML)(e)).join(e)})),t}function pn(e,t){return t.length<5?`<lt-strong>${t}</lt-strong>`:En(e,t)||`<lt-strong>${t}</lt-strong>`}const _n=/^[a-zäöüß][^-]{1,2}-[a-zäöüß0-9]+$/i;function En(e,t){if(_n.test(e)&&_n.test(t)){const n=e.split("-"),s=t.split("-");if(n[0]!==s[0]&&n[1]===s[1])return`<lt-strong>${s[0]}</lt-strong>-${s[1]}`}if(t.length>2&&t.startsWith(e))return`${e}<lt-strong>${t.substring(e.length)}</lt-strong>`;if(t.length>2&&t.endsWith(e))return`<lt-strong>${t.substring(0,t.lastIndexOf(e))}</lt-strong>${e}`;if((0,i.capitalize)(e)===t)return`<lt-strong>${t.charAt(0)}</lt-strong>${t.substring(1)}`;if(e+","===t)return e+"<lt-strong>,</lt-strong>";if(", "+e===t)return"<lt-strong>, </lt-strong>"+e;if(t.length>2&&e.length>2)for(let n=0;n<t.length;
314n++)if(t[n]!==e[n]){if(t.substring(n+1)&&t.substring(n+1)===e.substring(n+1))return`${t.substring(0,n)}<lt-strong>${t[n]}</lt-strong>${t.substring(n+1)}`;if(t[n+1]&&t[n+1]!==e[n+1]&&t.substring(n+2)&&t.substring(n+2)===e.substring(n+2)&&t.length>3)return`${t.substring(0,n)}<lt-strong>${t[n]}${t[n+1]}</lt-strong>${t.substring(n+2)}`;if(t.substring(n+1)&&t.substring(n+1)===e.substring(n))return["-","'","’"].includes(t[n])?`${t.substring(0,n-1)}<lt-strong>${t.substring(n-1,n+2)}</lt-strong>${t.substring(n+2)}`:`${t.substring(0,n)}<lt-strong>${t[n]}</lt-strong>${t.substring(n+1)}`;if(t.substring(n+2)&&t.substring(n+1)===e.substring(n+2)&&t.substring(n)!==e.substring(n+1))return`${t.substring(0,n)}<lt-strong>${t[n]}</lt-strong>${t.substring(n+1)}`;break}if(e.length>=2&&t.length>2&&t.startsWith(e.substring(0,2))){let n=2;for(;n<=t.length&&t[n]===e[n];n++);if(n<t.length)return t.substring(n)===e.substring(n+1)&&t.substring(n).length>2?`${t.substring(0,n-1)}<lt-strong>${t.substring(n-1,n+1)}</lt-strong>${t.substring(n+1)}`:["-","'","’","₂","²","₃","³"].includes(t.substring(n))?`${t.substring(0,n-1)}<lt-strong>${t.substring(n-1)}</lt-strong>`:`${t.substring(0,n)}<lt-strong>${t.substring(n)}</lt-strong>`}return null}const fn=/[ \u00A0]+/;function Tn(e,t){const n=e.split(fn),s=t.split(fn);if(n.join(" ")===s.join(" "))return`<lt-em>${t}</lt-em>`;if(!s[0]||!s[s.length-1])return`<lt-em>${t}</lt-em>`;if(1===n.length&&2===s.length&&s[0]===n[0])return`${s[0]} <lt-strong>${s[1]}</lt-strong>`;if(n.length>0&&s.length===n.length+1&&s.slice(1).join(" ")===n.join(" "))return`<lt-strong>${s[0]}</lt-strong> ${s.slice(1).join(" ")}`;if(1===n.length&&2===s.length&&(0,i.capitalize)(s[1])===n[0])return`<lt-strong>${s[0]}</lt-strong> <lt-strong>${s[1].substring(0,1)}</lt-strong>${s[1].substring(1)}`;if(s.length>2&&n.length+1===s.length&&n[0]===s[0]&&n[1]!==s[1]&&n.slice(1).join(" ")===s.slice(2).join(" "))return`${s[0]} ${pn(n[1],s[1])} ${s.slice(2).join(" ")}`;if(3===s.length&&2===n.length&&n[0]!==s[0]&&n[1]!==s[1]&&n[1]===s[2])return`<lt-strong>${s[0]} ${s[1]}</lt-strong> ${s[2]}`;if(s.length>2&&n.length+1===s.length&&n[0]!==s[0]&&n.join(" ")===s.slice(1).join(" "))return`${pn(n[0],s[0])} ${s.slice(1).join(" ")}`;if(2===n.length&&s.length>2&&n[0]===s[0]&&n[1]===s[1])return`${s[0]} ${s[1]} <lt-strong>${s.slice(2).join(" ")}</lt-strong>`;if(n.length>=2&&s.length>=2&&n[0]===s[0]&&n[1]!==s[1]&&n.slice(2).join(" ")===s.slice(2).join(" "))return`${s[0]} ${pn(n[1],s[1])} ${s.slice(2).join(" ")}`.trim();if(2===n.length&&s.length>2&&n[0]===s[0]&&n[1]!==s[1])return`${s[0]} <lt-strong>${s.slice(1).join(" ")}</lt-strong>`;if(n.length===s.length&&s.length>1){let e=0;const t=s.map(((t,s)=>{if(t===n[s])return t;let r=En(n[s],t);return r||(e++,r=`<lt-strong>${t}</lt-strong>`),r})).join(" ");return e===s.length?`<lt-em>${s.join(" ")}</lt-em>`:t}return 1===n.length&&1===s.length?En(n[0],s[0])||`<lt-em>${s[0]}</lt-em>`:`<lt-em>${t}</lt-em>`}function Cn(e,t,n){return Math.min(Math.max(t,e),n)}const vn=250,Sn=350,bn={correct:"click",rephrase:"dblclick",recommendation:"click",mouseInCardOpenDelay:vn,mouseOutCardCloseDelay:Sn};function xn(e,t,n){const s=n||bn;return e&&e.isRecommendation?Array.isArray(s?.recommendation)?s?.recommendation.includes(t):s?.recommendation===t:s?.correct===t}const yn=new Map([["paraphrase","rephrase"],["correct","correct"]]),An=new Map([["hover","hover"],["click","click"],["toolbar","click"],["dblClick","click"],["dblPress","click"]]);function kn(e,t,n){const s=n||bn;if(!e)return!1;if("system"!==e.getTriggerType())return"click"===An.get(e.getTriggerType());const r=e.mode;if(r){const e=yn.get(r);if(void 0!==e)return[].concat(s[e]).some((e=>An.get(e)===t))}return!1}function wn(e){return e?.trim().length?e?.trim().split(" ").length:0}function Rn(e,t){return e.bottom>=t.top&&e.top<=t.bottom}const Ln=()=>(()=>{try{return self.top.document}catch{return document}})(),Mn=({type:e,editor:t,currentText:n,changedParagraphs:s,initStartTime:r,changeStartTime:i,requestTime:o,responseTime:a,endTime:l,newDisplayedErrors:c,oldDisplayedErrors:d,isTriggeredByMaxDebounced:u=!1,isTriggeredForRecommendationOnAppliedFix:g=!1,appliedFixId:m="",errorInfo:p,textChangeActionType:_,sentParagraphsCount:E=0})=>{let f=0,T=0;
314s.forEach((e=>{const t=wn(e.text);f+=t,T=t>0?T+1:T}));const C=e=>({id:e.id,isPicky:e.isPicky,isSpellingError:e.isSpellingError,isStyleError:e.isStyleError,isCustomError:e.isCustomError,isPunctuationError:e.isPunctuationError,isRecommendation:e.isRecommendation,ruleId:e.rule.id,start:e.start,end:e.end,error_type_id:e?.rule?.category?.id??"",modelId:t.metaData?.textErrors.errorModelId??""}),v=d.filter((e=>!c.find((t=>t.id===e.id)))).map(C),S=c.filter((e=>!d.find((t=>t.id===e.id)))).map(C),b=t.displayedErrors.map(C);("error_migration"!==e&&"add_to_personal_dictionary"!==e&&"ignore_rules"!==e||0!==v.length||0!==S.length)&&h.TrackerAdapter.trackPerformanceMetrics({type:e,endTime:l,initStartTime:r,changeStartTime:i,requestTime:o,responseTime:a,totalWordCount:wn(n),changedParaWordCount:f,changedParagraphsCount:E||T,editorId:t.id,removedErrors:v,newErrors:S,displayedErrors:b,isTriggeredByMaxDebounced:u,isTriggeredForRecommendationOnAppliedFix:g,appliedFixId:m,errorInfo:p,textChangeActionType:_})};function In(e,t,n){const s=new l.DomMeasurement(e.ownerDocument);let r=null,i=e.parentElement;if(n)return null;for(;i;){if(Q(i,s)){r=i;break}if(Pn(i)||"fixed"===s.getStyle(i,"position"))break;i=i.parentElement}return r?.contains(t)?null:r}function Pn(e){const t=e.getAttribute("role");return"DIALOG"===e.tagName||"dialog"===t||"alertdialog"===t||"true"===e.getAttribute("aria-modal")}function Nn(e,t,n){const s=e.split(/\s+/),r=[];let i=0;for(const e of s){if(r.push(e),i+=e.length,r.length>=n&&i>=t)break;i++}return r.join(" ")}function On(e,t){const n=e.slice(t).search(/\s/);return-1===n?e.length:t+n}const Dn=(e,t)=>{h.TrackerAdapter.trackHealthMetrics({metricName:e,metricValue:t})},Hn=(e,t,n=10)=>{0===Math.floor(Math.random()*n)&&h.TrackerAdapter.trackHealthMetrics({metricName:e,metricValue:t})},Un=e=>{let t=0;if(0===e.length)return"0";for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t.toString(36)},Fn=(e,t,n)=>{setTimeout((()=>{e.forEach((e=>{if(void 0===e.id)return;const s=t.substring(e.start,e.start+e.length),r=e.originalPhrase,i=s===r||e.originalSentence===s;i||console.log(`text error mismatch!! ${e.id}:`,{actualText:s,expectedText:r,isMatch:i,errorStart:e.start,errorLength:e.length}),n({error:e,actualText:s,expectedText:r,isMatch:i})}))}),0)},Bn=(e,t,n,s,r)=>{const a=o.default.get(o.ConfigKey.NORMALIZE_SPACE),l=t.slice(0,s)+n+t.slice(r);return a?(0,i.normalizeSpaceAndEncoding)(l)===(0,i.normalizeSpaceAndEncoding)(e):l===e},Gn=e=>{const t=e.currentText.length-e.previousText.length;h.TrackerAdapter.trackUserTextChangeMetrics({type:"text_change_metrics",triggeredBy:e.triggeredBy,triggeredAt:e.triggeredAt,triggerToProcessDelay:e.triggerToProcessDelay,changedCharactersCount:t,previousText:e.previousText,currentText:e.currentText})}},
314"./common/writtingSession.ts":
315/*!***********************************!*\
316  !*** ./common/writtingSession.ts ***!
317  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{WrittingSession:()=>r});var s=n(/*! ./environmentAdapter */"./common/environmentAdapter.ts");class r{constructor(){this.sessions=new Map,this.editorToSession=new Map,this.uniqueIdentifierToSession=new Map,this.hostOrigin="",this.hostUrl="",this.ongoingReinitializationPromises=new Map,this.ongoingSessionCreationPromises=new Map}static getInstance(e){if(!r.instance&&(r.instance=new r,e))try{const t=new URL(e);r.instance.hostOrigin=t.origin,r.instance.hostUrl=e}catch(t){console.warn("Invalid URL provided, using as-is:",e),r.instance.hostOrigin=e}return r.instance}setHostUrl(e){try{const t=new URL(e);this.hostOrigin=t.origin}catch(t){console.warn("Invalid URL provided, using as-is:",e),this.hostOrigin=e}}getHostUrl(){return this.hostOrigin}async createWritingSession(e,t){if(this.uniqueIdentifierToSession.has(t)){const n=this.uniqueIdentifierToSession.get(t),s=this.sessions.get(n);return s.editorIds.has(e)||(this.removeEditorFromSession(e),s.editorIds.add(e),this.editorToSession.set(e,s.sessionId)),s.sessionId}let n=this.ongoingSessionCreationPromises.get(t);if(n){const t=await n,s=this.sessions.get(t);s&&!s.editorIds.has(e)&&(this.removeEditorFromSession(e),s.editorIds.add(e),this.editorToSession.set(e,t))}else n=this.performSessionCreation(e,t).finally((()=>{this.ongoingSessionCreationPromises.delete(t)})),this.ongoingSessionCreationPromises.set(t,n);return n}joinSession(e,t){const n=this.sessions.get(t);if(n)return this.removeEditorFromSession(e),n.editorIds.add(e),this.editorToSession.set(e,t),n}removeEditorFromSession(e){const t=this.editorToSession.get(e);if(t){const n=this.sessions.get(t);if(n&&(n.editorIds.delete(e),0===n.editorIds.size)){this.sessions.delete(t);for(const[e,n]of this.uniqueIdentifierToSession.entries())if(n===t){this.uniqueIdentifierToSession.delete(e);break}}this.editorToSession.delete(e)}}updateSurroundingContent(e,t){const n=this.sessions.get(e);n&&(n.surroundingContent=t)}getSession(e){const t=this.editorToSession.get(e);if(t)return this.sessions.get(t)}getEditorsInSameSession(e){const t=this.getSession(e);return t?Array.from(t.editorIds):[]}getSessionById(e){return this.sessions.get(e)}async generateSessionId(e,t){return await s.EnvironmentAdapter.createWritingSession(t,e)}async reIntializeWritingSession(e){let t=this.ongoingReinitializationPromises.get(e);return t||(t=this.performReinitialization(e).finally((()=>{this.ongoingReinitializationPromises.delete(e)})),this.ongoingReinitializationPromises.set(e,t)),t}async performReinitialization(e){const t=this.findUniqueIdentifierFromWritingSession(e);return t?await s.EnvironmentAdapter.createWritingSession(this.hostUrl,t):(console.error("No unique identifier found for sessionId:",e),"")}async performSessionCreation(e,t){const n=await this.generateSessionId(t,this.hostUrl);if(!n)return"";const s={sessionId:n,editorIds:new Set([e]),surroundingContent:""};return this.removeEditorFromSession(e),this.sessions.set(n,s),this.uniqueIdentifierToSession.set(t,n),this.editorToSession.set(e,n),n}findUniqueIdentifierFromWritingSession(e){for(const[t,n]of this.uniqueIdentifierToSession)if(n===e)return t}}},
317"./components/hint/hint.ts":
318/*!*********************************!*\
319  !*** ./components/hint/hint.ts ***!
320  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Hint:()=>s});class s{constructor(e,t,n,s,r,i){this._className=e,this._type=t,this._headline=n,this._description=s,this._position=r,this._parentElement=i,this._document=i.ownerDocument,this._render()}_render(){this._element=this._document.createElement("lt-div"),this._element.classList.add(s.CONTAINER_CLASS_NAME,"lt-position--"+this._position,"lt-hint--"+this._type),this._className&&this._element.classList.add("lt-hint--"+this._className);const e=document.createElement("lt-div");e.className="lt-hint__headline",e.textContent=this._headline,this._element.appendChild(e);const t=document.createElement("lt-div");t.className="lt-hint__text",t.textContent=this._description,this._element.appendChild(t),this._close=document.createElement("lt-span"),this._close.className="lt-hint__close",this._element.appendChild(this._close),this._parentElement.appendChild(this._element)}getElement(){return this._element}getClose(){return this._close}}s.CONTAINER_CLASS_NAME="lt-hint"},
320"./components/icon/icon.ts":
321/*!*********************************!*\
322  !*** ./components/icon/icon.ts ***!
323  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Icon:()=>s});class s{constructor(e,t,n,s,r=!0){this._className=e,this._label=t,this._parentElement=s,this._toolTip=n,this._document=s.ownerDocument,this._render(r)}_render(e){if(this._element=this._document.createElement("lt-div"),this._element.classList.add("lt-icon","lt-icon--"+this._className),this._element.classList.toggle("lt-icon--clickable",e),this._element.setAttribute("data-lt-prevent-focus",""),this._parentElement.appendChild(this._element),this._icon=this._document.createElement("lt-span"),this._icon.classList.add("lt-icon__icon","lt-icon__"+this._className),this._element.appendChild(this._icon),this._toolTip){const e=this._document.createElement("lt-div");e.classList.add("lt-icon__tooltip","lt-icon__tooltip--"+this._toolTip.position,"lt-icon__tooltip--"+this._className),e.textContent=this._toolTip.label,this._element.appendChild(e)}if(this._label){const e=this._document.createElement("lt-span");e.classList.add("lt-icon__label"),e.textContent=this._label,this._element.appendChild(e)}}setIcon(e){this._icon.className="",this._icon.classList.add("lt-icon__icon","lt-icon__"+e)}getElement(){return this._element}}},
323"./components/menu/menu.ts":
324/*!*********************************!*\
325  !*** ./components/menu/menu.ts ***!
326  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Menu:()=>s});class s{constructor(e,t,n,s,r,i,o=null){this._className=e,this._parentElement=n,this._dialog=s,this._appendElement=o,this._optionElements=[],this._options=t,this._document=n.ownerDocument,this._position=r,this._isSelectable=i,this._render()}_render(){this._overlay=this._document.createElement("lt-div"),this._overlay.setAttribute("data-lt-prevent-focus",""),this._overlay.classList.add("lt-menu-overlay","lt-menu-overlay--"+this._className),this._dialog.appendChild(this._overlay),this._element=this._document.createElement("lt-div"),this._element.setAttribute("data-lt-prevent-focus",""),this._element.classList.add("lt-menu","lt-menu--"+this._className,"lt-menu--position-"+this._position),this._parentElement.appendChild(this._element),this._options.forEach((e=>{const t=this._document.createElement("lt-div");t.classList.add("lt-menu__item","lt-menu__item--"+e.className,"lt-icon__"+e.className),e.isClickable&&t.classList.add("lt-menu__item--clickable"),this._isSelectable&&t.classList.add("lt-menu__item--selectable"),this._element.appendChild(t);const n=this._document.createElement("lt-span");if(n.classList.add("lt-menu__item__label","lt-menu__item__label--"+e.className),n.textContent=e.label,t.appendChild(n),e.info){const n=this._document.createElement("lt-span");n.classList.add("lt-menu__item__info","lt-menu__item__info--"+e.className),n.textContent=e.info,t.appendChild(n)}if(e.tag){const n=this._document.createElement("lt-span");n.classList.add("lt-menu__item__tag","lt-menu__item__tag--"+e.className),n.textContent=e.tag,t.appendChild(n)}this._optionElements.push(t)})),this._appendElement&&this._element.appendChild(this._appendElement)}show(){this._parentElement.classList.add("lt-menu-visible"),this._element.classList.add("lt-menu--show"),this._overlay.classList.add("lt-menu--show")}hide(){this._parentElement.classList.remove("lt-menu-visible"),this._element.classList.remove("lt-menu--show"),this._overlay.classList.remove("lt-menu--show")}getElement(){return this._element}getAllOptions(){return this._optionElements}getActiveOptions(){return this._optionElements}getOverlay(){return this._overlay}setInfo(e,t){if(e>=0&&e<this._optionElements.length){const n=this._optionElements[e].querySelector(".lt-menu__item__info");n&&(n.textContent=t)}}toggleActive(e,t,n){n&&this.getAllOptions().forEach((e=>{e.classList.remove("lt-menu__item--active")})),e>=0&&e<this._optionElements.length&&(t?this._optionElements[e].classList.add("lt-menu__item--active"):this._optionElements[e].classList.remove("lt-menu__item--active"))}toogleVisibility(e,t){e>=0&&e<this._optionElements.length&&(t?this._optionElements[e].classList.remove("lt-menu__item--hidden"):this._optionElements[e].classList.add("lt-menu__item--hidden"))}}},
326"./components/messagePopup/messagePopup.ts":
327/*!*************************************************!*\
328  !*** ./components/messagePopup/messagePopup.ts ***!
329  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MessagePopup:()=>c});var s=n(/*! ../../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../../common/i18nManager */"./common/i18nManager.ts"),i=n(/*! ../../common/storageController */"./common/storageController.ts"),o=n(/*! ../../common/utils */"./common/utils.ts"),a=n(/*! ../../init/config */"./init/config.ts");const l=a.default.get(a.ConfigKey.EXTN_PREFIX);class c{static _cacheMessages(){c.MESSAGES={DISABLED_MESSAGE_HEADLINE:r.i18nManager.getMessage("messagePopupTurnOnheadline"),DISABLED_MESSAGE_TEXT:r.i18nManager.getMessage("messagePopupTurnOntext"),DISABLED_MESSAGE_PRIMARY_BUTTON:r.i18nManager.getMessage("messagePopupTurnOnPrimaryButton"),DISABLED_MESSAGE_SECONDARY_BUTTON:r.i18nManager.getMessage("messagePopupTurnOnSecondaryButton")}}static init(){c._isInitialized||(c._cacheMessages(),c._isInitialized=!0)}constructor(e,t,n){this._autoDestroy=()=>{this._autoDestroyTimeout=self.setTimeout(this.destroy.bind(this),2e4)},this._document=e,this._uiOptions=n,this._controls={},this._eventListeners=[],this._render().then((()=>{n.destroysAutomatically&&this._autoDestroy()}))}async _render(){if(this._controls.container)return;this._controls.container=(0,o.createContainerElement)(this._document,c.CONTAINER_ELEMENT_NAME),this._controls.container.classList.add("lt-message-container","lt-message-container--"+this._uiOptions.className),document.firstElementChild?.appendChild(this._controls.container);const e=e=>{e.stopImmediatePropagation()};this._eventListeners.push((0,o.addUseCaptureEvent)(this._controls.container,"mousedown",(t=>{t.target instanceof HTMLElement&&t.target.closest("[data-lt-prevent-focus]")&&t.preventDefault(),e(t)})),(0,o.addUseCaptureEvent)(this._controls.container,"mouseup",e),(0,o.addUseCaptureEvent)(this._controls.container,"pointerdown",e),(0,o.addUseCaptureEvent)(this._controls.container,"pointerup",e),(0,o.addUseCaptureEvent)(this._controls.container,"focusin",e),(0,o.addUseCaptureEvent)(this._controls.container,"focusout",e)),this._controls.container.addEventListener("click",e);const t=this._document.createElement("lt-div");if(t.classList.add("lt-message-container__illustration"),s.BrowserDetector.isSafari()&&t.classList.add("lt-message-container__illustration--safari"),this._controls.container.appendChild(t),this._uiOptions.isClosable&&(this._controls.closeButton=this._document.createElement("lt-div"),this._controls.closeButton.className="lt-message-container__close lt-icon__close_small",this._controls.closeButton.setAttribute("data-lt-prevent-focus",""),this._controls.container.appendChild(this._controls.closeButton),this._eventListeners.push((0,o.addUseCaptureEvent)(this._controls.closeButton,"click",this._onCloseButtonClicked.bind(this)))),this._uiOptions.destroysAutomatically){const e=this._document.createElement("lt-div");e.className="lt-message-container__progressbar",this._controls.container.appendChild(e)}const n=this._document.createElement("lt-div");n.className="lt-message-container__text-wrapper",this._controls.container.appendChild(n);const r=this._document.createElement("lt-span");r.className="lt-message-container__text-wrapper__headline",r.textContent=c.MESSAGES.DISABLED_MESSAGE_HEADLINE,n.appendChild(r);const i=this._document.createElement("lt-span");if(i.className="lt-message-container__text-wrapper__text",i.textContent=c.MESSAGES.DISABLED_MESSAGE_TEXT,n.appendChild(i),this._uiOptions.hasPrimaryButton||this._uiOptions.hasSecondaryButton){const e=this._document.createElement("lt-div");e.className="lt-message-container__button-wrapper",this._controls.container.appendChild(e),this._uiOptions.hasPrimaryButton&&(this._controls.primaryButton=this._document.createElement("lt-div"),this._controls.primaryButton.className="lt-message-container__button-wrapper__primary",this._controls.primaryButton.setAttribute("data-lt-prevent-focus",""),this._controls.primaryButton.textContent=c.MESSAGES.DISABLED_MESSAGE_PRIMARY_BUTTON,e.appendChild(this._controls.primaryButton),this._eventListeners.push((0,o.addUseCaptureEvent)(this._controls.primaryButton,"click",this._onPrimaryButtonClicked.bind(this)))),this._uiOptions.hasSecondaryButton&&(this._controls.secondaryButton=this._document.createElement("lt-div"),this._controls.secondaryButton.className="lt-message-container__button-wrapper__secondary",this._controls.secondaryButton.setAttribute("data-lt-prevent-focus",""),this._controls.secondaryButton.textContent=c.MESSAGES.DISABLED_MESSAGE_SECONDARY_BUTTON,e.appendChild(this._controls.secondaryButton),this._eventListeners.push((0,o.addUseCaptureEvent)(this._controls.secondaryButton,"click",this._onSecondaryButtonClicked.bind(this))))}}_onPrimaryButtonClicked(e){e.stopImmediatePropagation(),i.StorageControllerFactory.create().onReady((e=>{e.updateUIState({hasSeenTurnOnMessagePopup:!0}),e.destroy()})),this.destroy()}_onSecondaryButtonClicked(e){e.stopImmediatePropagation();const t={message:this};(0,o.dispatchCustomEvent)(document,c.eventNames.turnOn,t),this.destroy()}_onCloseButtonClicked(e){e.stopImmediatePropagation(),i.StorageControllerFactory.create().onReady((e=>{e.updateUIState({hasSeenTurnOnMessagePopup:!0}),e.destroy()})),this.destroy()}_onUnload(){this.destroy()}destroy(){(0,o.fadeOutAndRemove)(this._controls.container),this._controls={},self.removeEventListener("pagehide",this._onUnload,!0),this._eventListeners.forEac
329h((e=>{e.destroy()})),this._eventListeners=[];const e={message:this};self.clearTimeout(this._autoDestroyTimeout),(0,o.dispatchCustomEvent)(document,c.eventNames.destroyed,e)}}c.CONTAINER_ELEMENT_NAME="lt-message",c.eventNames={destroyed:`${l}-message.destroyed`,turnOn:`${l}-message.turn-on`},c._isInitialized=!1},
329"./components/packageBadge/packageBadge.ts":
330/*!*************************************************!*\
331  !*** ./components/packageBadge/packageBadge.ts ***!
332  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{PackageBadge:()=>s});class s{constructor(e,t,n,s){this._className=e,this._type=t,this._size=n,this._parentElement=s,this._document=s.ownerDocument,this._render()}_render(){this._element=this._document.createElement("lt-div"),this._element.classList.add("lt-package-badge","lt-package-badge--"+this._type,"lt-package-badge--"+this._size),this._element.textContent=this._type,this._parentElement.appendChild(this._element)}getElement(){return this._element}}},
332"./components/premiumTeaser/premiumTeaser.ts":
333/*!***************************************************!*\
334  !*** ./components/premiumTeaser/premiumTeaser.ts ***!
335  \***************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{PremiumTeaser:()=>a});var s=n(/*! ../../common/environmentAdapter */"./common/environmentAdapter.ts"),r=n(/*! ../../common/storageController */"./common/storageController.ts"),i=n(/*! ../../common/trackerAdapter */"./common/trackerAdapter.ts"),o=n(/*! ../../common/utils */"./common/utils.ts");class a{constructor(e,t,n=null,s=null,i=null,o,a=null,l){this._learnMoreLink=null,this._teaserButtonElement=null,this._learnMoreLinkElement=null,this._listeners=[],this._parentElement=e,this._headline=n,this._text=s,this._buttonText=i,this._trackingEvent=t,this._linkParameters=o,this._learnMoreLink=a,this._document=e.ownerDocument,this._onClick=l,this._storageController=r.StorageControllerFactory.create(),this._element=this._document.createElement("lt-div"),this._element.className="lt-premium-errors-teaser",this._parentElement.appendChild(this._element),this._render()}_render(){i.TrackerAdapter.trackEvent("Action",this._trackingEvent),this._storageController.onReady((()=>{if(!this._headline&&!this._text&&!this._buttonText)return;const e=this._document.createElement("lt-div");if(e.className="lt-premium-errors-teaser__content",this._element.appendChild(e),this._headline){const t=this._document.createElement("lt-span");t.className="lt-premium-errors-teaser__content__headline",t.textContent=this._headline,e.appendChild(t)}if(this._text){const t=this._document.createElement("lt-span");t.className="lt-premium-errors-teaser__content__text",t.innerHTML=this._text,e.appendChild(t)}const t=this._document.createElement("lt-div");if(t.className="lt-premium-errors-teaser__content__button-wrapper",e.appendChild(t),this._buttonText){const e=this._document.createElement("lt-span");e.className="lt-premium-errors-teaser__content__button",e.textContent=this._buttonText,t.appendChild(e),this._teaserButtonElement=e}if(this._learnMoreLink){const e=this._document.createElement("lt-span");e.className="lt-premium-errors-teaser__content__link",e.textContent=this._learnMoreLink.text,t.appendChild(e),this._learnMoreLinkElement=e}this._observe()}))}_observe(){let e=this._element;this._learnMoreLinkElement&&this._teaserButtonElement?e=this._teaserButtonElement:this._element.classList.add("lt-premium-errors-teaser--clickable"),this._listeners.push((0,o.addUseCaptureEvent)(e,"click",(e=>{i.TrackerAdapter.trackEvent("Action",`${this._trackingEvent}:click`),e.stopImmediatePropagation(),e.preventDefault(),this._onClick?this._onClick():s.EnvironmentAdapter.openPremiumPage(this._linkParameters.campaign,this._linkParameters.hiddenGrammarMatches,this._linkParameters.hiddenStyleMatches,this._linkParameters.hiddenPunctuationMatches,this._linkParameters.historicMatches)}))),this._learnMoreLinkElement&&this._listeners.push((0,o.addUseCaptureEvent)(this._learnMoreLinkElement,"click",(e=>{i.TrackerAdapter.trackEvent("Action",`${this._trackingEvent}:click`),e.stopImmediatePropagation(),e.preventDefault(),s.EnvironmentAdapter.openWindow(this._learnMoreLink.url)})))}destroy(){this._listeners.forEach((({destroy:e})=>e())),this._timerElement?.destroy()}}},
335"./components/ratingTeaser/ratingTeaser.ts":
336/*!*************************************************!*\
337  !*** ./components/ratingTeaser/ratingTeaser.ts ***!
338  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{RatingTeaser:()=>h});var s=n(/*! ../../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../../common/environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ../../common/i18nManager */"./common/i18nManager.ts"),o=n(/*! ../../common/languageManager */"./common/languageManager.ts"),a=n(/*! ../../common/storageController */"./common/storageController.ts"),l=n(/*! ../../common/trackerAdapter */"./common/trackerAdapter.ts"),c=n(/*! ../../common/utils */"./common/utils.ts"),d=n(/*! ../../core/utils */"./core/utils.ts");class h{constructor(e,t,n){this._listeners=[],this._parentElement=e,this._componentName=t,this._url=n,this._document=e.ownerDocument,this._storageController=a.StorageControllerFactory.create(),this._element=this._document.createElement("lt-div"),this._element.className="lt-rating-teaser",this._parentElement.appendChild(this._element),this.render()}_sendRating(e){l.TrackerAdapter.trackEvent("Stat",`rating:${o.LanguageManager.getPrimaryLanguageCode(navigator.language)}`,e),this._storageController.updateStatistics({ratingValue:e}),this._storageController.updateUIState({hasRated:!0}),"like"===e?s.BrowserDetector.isChrome()||s.BrowserDetector.isFirefox()||s.BrowserDetector.isOpera()||s.BrowserDetector.isEdge()||s.BrowserDetector.isSafari()?this._showReviewContainer():this._showThanksContainer():"dislike"===e&&(this._showThanksContainer(),this._openFeedbackForm(i.i18nManager.getMessage("ratingUnhappyQuestion")),l.TrackerAdapter.trackEvent("Stat","dislike_host",(0,d.getCurrentDomain)()))}_showReviewContainer(){this._element.classList.remove("lt-rating-teaser--thanks-visible"),this._element.classList.add("lt-rating-teaser--review-visible")}_showThanksContainer(){this._element.classList.remove("lt-rating-teaser--review-visible"),this._element.classList.add("lt-rating-teaser--thanks-visible")}_openFeedbackForm(e){r.EnvironmentAdapter.openFeedbackForm(this._url,e)}_openReviewPage(){r.EnvironmentAdapter.openWindow(this._reviewUrl),l.TrackerAdapter.trackEvent("Action","dialog:rating_teaser:click")}render(){const e=this._document.createElement("lt-div");e.className="lt-rating-teaser__intro",this._element.appendChild(e);const t=this._document.createElement("lt-div");t.className="lt-rating-teaser__intro__question";const n=this._document.createElement("lt-div");n.className="lt-rating-teaser__intro__headline",n.innerText=i.i18nManager.getMessage("ratingHeadline"),t.appendChild(n);const r=this._document.createElement("lt-div");r.innerText=i.i18nManager.getMessage("ratingText"),t.appendChild(r),e.appendChild(t);const o=this._document.createElement("lt-div");o.className="lt-rating-teaser__intro__options";const a=this._document.createElement("lt-div");a.className="lt-rating-teaser__intro__option",a.setAttribute("data-lt-emotion","like"),o.appendChild(a);const d=this._document.createElement("lt-div");d.className="lt-rating-teaser__intro__option",d.setAttribute("data-lt-emotion","dislike"),o.appendChild(d),e.appendChild(o);const h=this._document.createElement("lt-div");h.className="lt-rating-teaser__review",this._element.appendChild(h);const u=this._document.createElement("lt-div");u.className="lt-rating-teaser__review__text",h.appendChild(u),s.BrowserDetector.isFirefox()?(0,c.translateElement)(u,"reviewFirefoxHeadline"):s.BrowserDetector.isOpera()?(0,c.translateElement)(u,"reviewOperaHeadline"):s.BrowserDetector.isEdge()?(0,c.translateElement)(u,"reviewEdgeHeadline"):s.BrowserDetector.isSafari()?(0,c.translateElement)(u,"reviewSafariHeadline"):(0,c.translateElement)(u,"reviewChromeHeadline");const g=this._document.createElement("lt-a");g.className="lt-rating-teaser__review__link",g.innerText=i.i18nManager.getMessage("reviewLink"),h.appendChild(g);const m=this._document.createElement("lt-div");m.className="lt-rating-teaser__thanks",m.innerText=i.i18nManager.getMessage("ratingThankYou"),this._element.appendChild(m),this._listeners.push((0,c.addUseCaptureEvent)(a,"click",(e=>{e.stopImmediatePropagation(),this._sendRating("like")}))),this._listeners.push((0,c.addUseCaptureEvent)(d,"click",(e=>{e.stopImmediatePropagation(),this._sendRating("dislike")}))),this._listeners.push((0,c.addUseCaptureEvent)(h,"click",(e=>{e.stopImmediatePropagation(),this._openReviewPage()}))),s.BrowserDetector.isChrome()?(this._element.classList.add("lt-rating-teaser--chrome"),this._reviewUrl="https://chromewebstore.google.com/detail/grammatik-und-rechtschrei/oldceeleldhonbafppcapldpdifcinji/reviews"):s.BrowserDetector.isFirefox()?(this._element.classList.add("lt-rating-teaser--firefox"),this._reviewUrl="https://addons.mozilla.org/firefox/addon/languagetool/"):s.BrowserDetector.isOpera()?(this._element.classList.add("lt-rating-teaser--opera"),this._reviewUrl="https://addons.opera.com/extensions/details/grammar-and-spell-checker-languagetool/"):s.BrowserDetector.isEdge()?(this._element.classList.add("lt-rating-teaser--edge"),this._reviewUrl="https://microsoftedge.microsoft.com/addons/detail/hfjadhjooeceemgojogkhlppanjkbobc"):s.BrowserDetector.isSafari()&&(this._element.classList.add("lt-rating-teaser--safari"),this._reviewUrl="https://appstoreconnect.apple.com/apps/1534275760/appstore"),l.TrackerAdapter.trackEvent("Action",`${this._componentName}:rating_teaser`)}
338destroy(){this._listeners.forEach((({destroy:e})=>e()))}}},
338"./components/score/score.ts":
339/*!***********************************!*\
340  !*** ./components/score/score.ts ***!
341  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Score:()=>s});class s{constructor(e,t,n){this._className=e,this._parentElement=t,this._toolTip=n,this._document=t.ownerDocument,this._render()}_render(){this._element=this._document.createElement("lt-div"),this._element.classList.add("lt-score","lt-score--"+this._className),this._element.setAttribute("data-lt-prevent-focus",""),this._parentElement.appendChild(this._element),this._progressLabel=this._document.createElement("lt-span"),this._progressLabel.classList.add("lt-score__label"),this._progressLabel.setAttribute("data-lt-prevent-focus",""),this._progressLabel.textContent="0";const e=this._document.createElement("lt-div");e.classList.add("lt-icon__tooltip","lt-icon__tooltip--"+this._toolTip.position,"lt-icon__tooltip--"+this._className),e.textContent=this._toolTip.label,this._element.appendChild(e),this._element.appendChild(this._progressLabel)}setScore(e){e>0?(this._progressLabel.textContent=e.toString(),this._updateProgress(e),this._element.classList.remove("lt-score--hidden")):this._element.classList.add("lt-score--hidden")}_updateProgress(e){let t="",n="";e<50?(t="linear-gradient(90deg, #DEE3ED 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0))",n="linear-gradient("+(90+3.6*e)+"deg, #1976F0 50%, #DEE3ED 50%, #DEE3ED)"):(t="linear-gradient("+(3.6*(e-50)-90)+"deg, #1976F0 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0))",n="linear-gradient(270deg, #1976F0 50%, #DEE3ED 50%, #DEE3ED)"),this._element.setAttribute("style","background-image: "+t+", "+n+" !important")}}},
341"./components/select/select.ts":
342/*!*************************************!*\
343  !*** ./components/select/select.ts ***!
344  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Select:()=>i});var s=n(/*! ../../common/domMeasurement */"./common/domMeasurement.ts"),r=n(/*! ../../common/utils */"./common/utils.ts");class i{constructor(e,t,n){this._listeners=[],this._isHidden=!1,this.stopPropagation=e=>e.stopImmediatePropagation(),this._className=e,this._parentElement=t,this._select=n,this._document=t.ownerDocument,this._currentSelection=this._document.createElement("lt-span"),this._render()}destroy(){this._listeners.forEach((({destroy:e})=>e()))}_render(){this._selectorWrapper=this._document.createElement("lt-div"),this._selectorWrapper.classList.add("lt-dialog__selector-wrapper","lt-dialog__selector-wrapper--"+this._className,"lt-icon__chevron_down"),this._parentElement.appendChild(this._selectorWrapper),this._currentSelection.classList.add("lt-dialog__current-selection","lt-dialog__current-selection--"+this._className),this._selectorWrapper.appendChild(this._currentSelection),this._select.classList.add("lt-dialog__selector","lt-dialog__selector--"+this._className),this._selectorWrapper.appendChild(this._select),this._listeners.push((0,r.addUseCaptureEvent)(this._selectorWrapper,"click",this.stopPropagation))}setActive(e,t,n){this._currentSelection.textContent=e||"",this._select.value=t,new s.DomMeasurement(this._document).setStyles(this._currentSelection,n)}addOption(e){this._select.prepend(e)}updateOptionLabel(e,t){this._select.querySelectorAll("option[value="+e+"]")[0].textContent=t}getSelect(){return this._select}getValue(){return this._select.value}toggleHighlight(e){this._selectorWrapper.classList.toggle("lt-dialog__selector-wrapper--highlight",e)}hide(){this._isHidden||(this._selectorWrapper.classList.add("lt-dialog__selector-wrapper--hidden"),this._isHidden=!0)}show(){this._isHidden&&(this._selectorWrapper.classList.remove("lt-dialog__selector-wrapper--hidden"),this._isHidden=!1)}}},
344"./components/toggle/toggle.ts":
345/*!*************************************!*\
346  !*** ./components/toggle/toggle.ts ***!
347  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Toggle:()=>s});class s{constructor(e,t,n,s){this._className=e,this._label=t,this._info=n,this._parentElement=s,this._document=s.ownerDocument,this._render()}_render(){this._element=this._document.createElement("lt-div"),this._element.setAttribute("data-lt-prevent-focus",""),this._element.classList.add("lt-toggle-item","lt-toggle--"+this._className,"lt-icon__"+this._className),this._parentElement.appendChild(this._element);const e=this._document.createElement("lt-div");e.classList.add("lt-toggle-item__title","lt-toggle-item__title--"+this._className);const t=this._document.createElement("lt-span");t.classList.add("lt-toggle-item__title__label"),t.textContent=this._label,e.appendChild(t),this._info&&(this._infoElement=this._document.createElement("lt-span"),this._infoElement.classList.add("lt-toggle-item__title__info"),this._infoElement.textContent=this._info,e.appendChild(this._infoElement)),this._element.appendChild(e);const n=this._document.createElement("lt-div");n.classList.add("lt-toggle-item__toggle","lt-toggle-item__toggle--"+this._className),this._element.appendChild(n);const s=this._document.createElement("lt-div");s.classList.add("lt-toggle-item__toggle__dot"),n.appendChild(s)}set(e){e?this._element.classList.add("lt-toggle-item---checked"):this._element.classList.remove("lt-toggle-item---checked")}setInfo(e){this._infoElement.textContent=e}getElement(){return this._element}}},
347"./components/undoNotification/undoNotification.ts":
348/*!*********************************************************!*\
349  !*** ./components/undoNotification/undoNotification.ts ***!
350  \*********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{UndoNotification:()=>a});var s=n(/*! ../../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../../common/utils */"./common/utils.ts"),i=n(/*! ../../init/config */"./init/config.ts");const o=i.default.get(i.ConfigKey.EXTN_PREFIX);class a{static init(e){e.customRender&&(a._customRender=e.customRender)}static create(e){return a._instance&&a._instance._remove(),a._instance=new a(e),a._instance._render(),a._instance}constructor({language:e,label:t,description:n,parentElement:s,lifetime:r,undo:i}){this.TRANSITION_DURATION=250,this._listeners=[],this._hideTimeout=null,this._unscheduleHiding=()=>{"number"==typeof this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null)},this._rescheduleHiding=()=>{null===this._hideTimeout&&this._scheduleHiding()},this._handleMousedown=e=>{e.stopImmediatePropagation(),e.preventDefault()},this._handleClick=e=>{e.stopImmediatePropagation(),this._undo(),this._hide()},this._handleKeydown=e=>{"z"===e.key&&e.getModifierState(this._getModifierKeyName())&&this._hide()},this._parentElement=s,this._language=e,this._label=t,this._description=n,this._lifetime=r,this._undo=i,this._document=s.ownerDocument}show(){a._customRender||(requestAnimationFrame((()=>{this._element?.classList.add("lt-undo-notification--visible")})),this._scheduleHiding())}_render(){if(a._customRender)return void a._customRender(this);this._element=(0,r.createContainerElement)(this._document,a.CONTAINER_ELEMENT_NAME),this._element.classList.add("lt-undo-notification"),this._element.style.setProperty("--transition-duration",`${this.TRANSITION_DURATION}ms`),this._element.dataset.ltTestid="undo";const e=this._document.createElement("lt-span");e.classList.add("lt-undo-notification__content");const t=this._document.createElement("lt-span");t.classList.add("lt-undo-notification__label"),t.textContent=this._label;const n=this._getLocalizedCommand(this._language),s=this._document.createElement("lt-span");s.classList.add("lt-undo-notification__description"),s.innerHTML=this._description.replace("%{cmd}",`<lt-span class="lt-undo-notification__description__cmd">${n}</lt-span>`),this._button=this._document.createElement("lt-span"),this._button.classList.add("lt-undo-notification__button"),this._listeners.push((0,r.addUseCaptureEvent)(this._button,"click",this._handleClick)),this._listeners.push((0,r.addUseCaptureEvent)(this._button,"mousedown",this._handleMousedown)),this._listeners.push((0,r.addUseCaptureEvent)(this._button,"mouseup",this._handleMousedown)),this._listeners.push((0,r.addUseCaptureEvent)(this._button,"pointerdown",this._handleMousedown)),this._listeners.push((0,r.addUseCaptureEvent)(this._button,"pointerup",this._handleMousedown)),this._button.dataset.ltTestid="undo-button",e.appendChild(t),e.appendChild(s),this._element.appendChild(e),this._element.appendChild(this._button),this._listeners.push((0,r.addUseCaptureEvent)(this._element,"mouseover",this._unscheduleHiding)),this._listeners.push((0,r.addUseCaptureEvent)(this._element,"mouseout",this._rescheduleHiding)),this._parentElement.appendChild(this._element),this._listeners.push((0,r.addUseCaptureEvent)(this._document,"keydown",this._handleKeydown))}_remove(){a._customRender||this._element&&this._button&&(this._listeners.forEach((({destroy:e})=>e())),this._parentElement.removeChild(this._element),this._element=void 0)}_scheduleHiding(){this._hideTimeout=self.setTimeout(this._hide.bind(this),this.TRANSITION_DURATION+(this._lifetime??0))}_hide(){a._customRender||(this._element?.classList.remove("lt-undo-notification--visible"),this._element?.classList.add("lt-undo-notification--hiding"),setTimeout((()=>this._remove()),this.TRANSITION_DURATION))}_getLocalizedCommand(e){let t=e.startsWith("de")?"Strg":"Ctrl";return t="Mac"===s.BrowserDetector.getOS()?"⌘":t,`${t} + Z`}
350_getModifierKeyName(){return"Mac"===s.BrowserDetector.getOS()?"Meta":"Control"}}a.CONTAINER_ELEMENT_NAME=`${o}-notification`,a._instance=null},
350"./config/config.ts":
351/*!**************************!*\
352  !*** ./config/config.ts ***!
353  \**************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ACCOUNT_STATUS_RECHECK_INTERVAL:()=>o,AUTO_LOGIN_URL:()=>C,BASE_REPHRASING_SERVER_URL:()=>b,BASE_SERVER_URL:()=>S,CHECK_DELAY:()=>Y,CHECK_MAX_DELAY:()=>Z,CHECK_RECOMMENDATION_DELAY:()=>ne,CHECK_REQUEST_TIMEOUT:()=>p,CHECK_THROTTLING_LIMIT:()=>_,CLIENT_LOGIN_URL:()=>I,COLORS:()=>ue,COLORS_ON_DARK:()=>ge,COUNTRY_COUPON_MAPPING:()=>xe,COUPON_INTERVAL:()=>ye,CURRENT_TERMS_OF_SERVICE_VERSION:()=>$e,DEFAULT_MAX_FIX_ALL_ERRORS_COUNT:()=>X,DICTIONARY_SYNC_INTERVAL:()=>h,EDITOR_GROUP_ATTRIBUTE:()=>Xe,EMPLOYEE_EMAIL_REGEXP:()=>he,ERRORS_THAT_CAN_BE_CORRECTED_ALL_AT_ONCE:()=>Le,EXTENSION_HEALTH_RECHECK_INTERVAL:()=>r,EXTERNAL_CONFIG_RELOAD_INTERVAL:()=>a,EXTERNAL_CONFIG_URL:()=>M,FEEDBACK_SERVER_URL:()=>L,FIX_SENTENCE_MIN_ERROR_AMOUNT:()=>Se,HOVER_DELAY:()=>ie,HOVER_MAX_DELAY:()=>oe,HTTP_ERROR_ABORT:()=>Fe,HTTP_ERROR_GENERIC:()=>je,HTTP_ERROR_PAYLOAD_TOO_LARGE:()=>Be,HTTP_ERROR_TIMEOUT:()=>Ge,IFRAME_INITILIZATION_RECHECK_INTERVAL:()=>d,IMMEDIATE_CHECK_ON_PASTE_ACTION:()=>Ce,INSTALL_URL:()=>f,INVISIBLE_SEPARATOR:()=>Ke,LOCAL_SERVER_URL:()=>R,LOLLIPOP_DILATE_SCHEDULE_TIMEOUT:()=>re,MAIN_FALLBACK_SERVER_URL:()=>A,MAIN_SERVER_RECHECK_INTERVAL:()=>F,MAIN_SERVER_URL:()=>y,MASCOT_NAME:()=>Re,MAX_BURST_BUFFER_SIZE:()=>te,MAX_EXCEPTION_COUNT:()=>pe,MAX_FIXES_COUNT:()=>me,MAX_FREEMIUM_REPHRASINGS_PER_DAY:()=>Ne,MAX_PHRASE_LENGTH_IN_WORDS:()=>ve,MAX_TEXT_LENGTH:()=>j,MAX_TEXT_LENGTH_CUSTOM_SERVER:()=>K,MAX_TEXT_LENGTH_PERFORMANCE_DEGRADATION:()=>z,MAX_TEXT_LENGTH_PREMIUM:()=>V,MAX_USAGE_COUNT_ONBOARDING:()=>_e,MIN_TEXT_LENGTH:()=>B,NARROW_WHITESPACE_REGEXP:()=>De,NEW_SYNONYMS_URL:()=>D,PACKAGE:()=>Ae,PARAGRAPH_LEVEL_CHUNK_LENGTH:()=>q,PICKY_RULES_THAT_ARE_CONSIDERED_ANNOYING:()=>ke,PING_INTERVAL:()=>l,PING_URL:()=>P,PREMIUM_FALLBACK_SERVER_URL:()=>w,PREMIUM_SERVER_URL:()=>k,PRIVACY_POLICY_URL:()=>Ve,QB_EXTENSION_DETECTION_SELECTOR:()=>ht,QUOTE_AT_BEGINNING_REGEXP:()=>Ue,QUOTE_AT_END_REGEXP:()=>He,RELIABLE_MOTHER_TONGUES:()=>Pe,RENDER_INTERVAL:()=>g,REPHRASE_MODE_ACADEMIC:()=>Qe,REPHRASE_MODE_CREATIVE:()=>et,REPHRASE_MODE_EXPAND:()=>tt,REPHRASE_MODE_FLUENCY:()=>Je,REPHRASE_MODE_FORMALITY:()=>Ze,REPHRASE_MODE_HUMANIZE:()=>st,REPHRASE_MODE_SHORTEN:()=>nt,REPHRASE_MODE_SIMPLICITY:()=>Ye,REPHRASE_MODE_STANDARD:()=>qe,RTL_LANGUAGES:()=>Ie,RULES_ALLOWED_TO_BE_SENT_TO_API:()=>we,SELECTION_MODIFIER_KEYS:()=>it,SEND_AND_DESTROY_COMPLETED_USER_ACTIVITIES_INTERVAL:()=>ce,SENTENCE_END_CHARS:()=>rt,SERVER_MAX_TEXT_LENGTH_BASIC:()=>W,SHORT_TEXT_MAX_LENGTH:()=>G,SPLIT_SENTENCE_LIMIT:()=>E,STATISTICS_URL:()=>O,STOPPED_TYPING_TIMEOUT:()=>se,SUPPORTED_FIX_COMPLETE_SENTENCE_LANGUAGES:()=>Te,SUPPORTED_REPHRASE_LANGUAGES:()=>Ee,SUPPORTED_SENTENCE_SPLITTING_LANGUAGES:()=>fe,SUPPORTED_SYNONYM_LANGUAGES:()=>be,SWITCH_TO_FALLBACK_SERVER_ERRORS:()=>U,SYNC_USER_DATA_INTERVAL:()=>c,TERMS_OF_SERVICE_API_URL:()=>H,TERMS_OF_SERVICE_URL:()=>ze,TEXT_LEVEL_MAX_LENGTH_PER_REQUEST:()=>$,TOOLBAR_DECREASE_SIZE_INTERVAL:()=>m,TOOLBOX_THEME:()=>We,TRACK_RULE_EVENT_LANGUAGES:()=>Me,TRAILING_WHITESPACE_REGEXP:()=>Oe,TRANSLATE_SUPPORTED_LANGUAGES_FETCH_INTERVAL:()=>de,TRANSLATOR_BASE_URL:()=>x,TRIAL_50_DISCOUNT_CODE:()=>dt,TRIAL_DISCOUNT_CODE:()=>ct,TRIAL_DURATION:()=>ot,TRIAL_PAGE_CHECK_INTERVAL:()=>u,TRIAL_TOKEN_EXPIRY_TIME:()=>lt,TRIAL_TOKEN_USAGE_LIMIT:()=>at,TYPING_BURST_SESSION_INACTIVITY_DELAY:()=>J,UI_MODE_RECHECK_INTERVAL:()=>i,UNINSTALL_URL:()=>T,USER_ACTIVITY_DESTRUCTION_DELAY:()=>le,USER_ACTIVITY_PING_INTERVAL_LENGTH:()=>ae,USER_DATA_URL:()=>v,VALID_MAX_CHARACTERS_DELTA_ALLOWED:()=>ee,VALID_MIN_CHARACTERS_CHANGE_PER_TYPING_BURST:()=>Q,WEBAPI_URL:()=>N});var s=n(/*! ../init/config */"./init/config.ts");
354/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */const r=3e3,i=6e4,o=36e5,a=144e5,l=864e5,c=864e5,d=1500,h=72e5,u=108e5,g=300,m=900,p=5e4,_=30,E=500,f="https://languagetool.org/webextension/welcome",T="https://languagetool.org/webextension/uninstall",C="https://languagetool.org/webextension/login",v="https://languagetool.org/webextension/user",S="https://api.languagetool.org",b="https://rewriting.languagetoolplus.com",x="https://prod-translator.languagetool.org/translator",y=`${S}/v2`,A="https://api-fallback.languagetool.org/v2",k="https://api.languagetoolplus.com/v2",w="https://languagetoolplus.com/api/v2",R="http://localhost:8081/v2",L="https://languagetool.org/send-feedback/",M="https://languagetool.org/webextension_config.json",I="https://languagetool.org/client-login",P="https://languagetool.org/ping",N="https://languagetool.org/webapi",O="https://api.languagetoolplus.com/statistics/api/store",D="https://qb-grammar-en.languagetool.org/phrasal-paraphraser/subscribe",H="https://languagetool.org/users/privacy-policy/",U=[502,503,504],F=18e4,B=4,G=50,j=s.default.get(s.ConfigKey.MAX_TEXT_LENGTH_ALLOWED),W=19500,$=W,z=4e4,V=15e4,K=Number.MAX_SAFE_INTEGER,X=150,q=5e3,Y=1500,Z=4e3,J=3e3,Q=1,ee=10,te=20,ne=3e3,se=2e3,re=3e3,ie=50,oe=200,ae=2e4,le=3e5,ce=6e5,de=864e5,he=/@(languagetool(er)?|quillbot|scribbr|learneo|coursehero|symbolab|litcharts|spellboy)\.(com|org|de|nl)$/i,ue={get GRAMMAR(){return s.default.get(s.ConfigKey.COLORS_GRAMMAR)},get STYLE(){return s.default.get(s.ConfigKey.COLORS_STYLE)},get PARAPHRASE(){return s.default.get(s.ConfigKey.COLORS_PARAPHRASE)},get LONG_SENTENCE(){return{UNDERLINE:"#D2CBFF",BACKGROUND:"rgba(210,203,255,0.2)",EMPHASIZE:"rgba(210,203,255,0.1)"}},get IGNORED_RANGE(){return{UNDERLINE:"#00bbe6",BACKGROUND:"rgb(92, 222, 251, 0.2)",EMPHASIZE:"rgb(154, 232, 250, 0.1)"}},get RECOMMENDATION(){return s.default.get(s.ConfigKey.COLORS_RECOMMENDATION)},get RECOMMENDATION_TEASE(){return s.default.get(s.ConfigKey.COLORS_RECOMMENDATION_TEASE)},get SPELLING(){return s.default.get(s.ConfigKey.COLORS_SPELLING)},get SYNONYMS(){return{UNDERLINE:"#0042d7"}},get NEW_SENTENCE(){return{BACKGROUND:"rgba(30, 225, 151, 0.2)"}},get DISABLED(){return{UNDERLINE:"rgba(0, 0, 0, 0.2)",BACKGROUND:"rgba(0, 0, 0, 0.2)",EMPHASIZE:"rgba(0, 0, 0, 0.2)",TITLE:"rgba(0, 0, 0, 0.2)"}}},ge={...ue,DISABLED:{UNDERLINE:"rgba(255, 255, 255, 0.3)",BACKGROUND:"rgba(255, 255, 255, 0.3)",EMPHASIZE:"rgba(255, 255, 255, 0.3)",TITLE:"rgba(255, 255, 255, 0.3)"}}
354,me=5,pe=6,_e=5,Ee=["en","de","fr","nl","es","pt-BR","pt-PT"],fe=["en"],Te=["en"],Ce=!1,ve=10,Se=3,be=["de","de-CH","ru","sv","pt","pt-BR","el","en","eo","it","fr","es","uk","sk","sl","pl","da","ro","nl","ca"],xe={UKRAINE:{countries:["UA","BY"],percent:50},"ITALY-DISCOUNT":{countries:["IT"],percent:20},"SPAIN-DISCOUNT":{countries:["ES"],percent:20},SOUTH_EUROPE:{countries:["RO","AL","GR","ME","EE","LT","LV","BG","CY","MT","SK","SI","RS","HR","XK","HU","MD","TR","PT"],percent:20},AFRICA:{countries:["NG","ET","EG","CD","CG","TZ","KE","UG","DZ","SD","MA","AO","MZ","TN","CI","DJ","SZ","MU","GQ","GA","BW","SO","CD","ER","MG"],percent:50},ASIA:{countries:["ID","PK","BD","VN","MM","PH","UZ","MY","NP","KZ","KH","UZ","TH","YE","SY","JO"],percent:50},LATIN_AMERICA:{countries:["PE","VE","EC","SV","DO","BO","SR","AR","HN","BZ","CR","PA","GT","NI","GY","UY","HT","JM","TT","CU"],percent:50},BRAZIL:{countries:["BR"],percent:50}},ye=7776e6,Ae={BASIC:"Basic",PREMIUM:"Premium"},ke=["EN_QUOTES","PASSIVE_VOICE","DASH_RULE","SENTENCE_FRAGMENT","PONCTUATION_DOUBLE","TOO_LONG_SENTENCE","COMETES_TIPOGRAFIQUES","APOSTROF_TIPOGRAFIC","FALSCHE_VERWENDUNG_DES_BINDESTRICHS","HALBGEVIERTSTRICH","PARAGRAF_LEERZEICHEN","TYPOGRAFISCHE_APOSTROPHE","TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN","TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN_CH","TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN_2","PUNCTUATION_PARAGRAPH_END","FINAL_STOPS","FINAL_PUNCTUATION","SMART_QUOTES","PT_SMART_QUOTES","DASH_SPACE_RULES","HIPHEN_SPACE_RULES","BRAK_KROPKI","DYWIZ","CUDZYSLOW_DRUKARSKI","TYPOGRAFISCHE_AANHALINGSTEKENS","TYPOGRAFISCHE_AANHALINGSTEKENS_2","EINDE_ZIN_ONVERWACHT","BACKTICK","GEDACHTESTREEPJE","OPTIONAL_HYPHEN","COMILLAS_TIPOGRAFICAS","COMETES_TIPOGRAFIQUES","GL_SMART_QUOTES"],we=["OXFORD_SPELLING_Z_NOT_S"],Re="jeremy",Le=[{ruleId:"FALSCHES_ANFUEHRUNGSZEICHEN",suggestions:[{match:/[„“]/,message:"Alle <lt-em>“</lt-em>…<lt-em>”</lt-em> zu <lt-em>„</lt-em>…<lt-em>“</lt-em> ändern"}]},{ruleId:"TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN",suggestions:[{match:/[„“]/,message:"Alle <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> zu <lt-em>„</lt-em>…<lt-em>“</lt-em> ändern"},{match:/(^»)|(«$)/,message:"Alle <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> zu <lt-em>»</lt-em>…<lt-em>«</lt-em> ändern"}]},{ruleId:"TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN_CH",suggestions:[{match:/[„“]/,message:"Alle <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> zu <lt-em>„</lt-em>…<lt-em>“</lt-em> ändern"},{match:/(^«)|(»$)/,message:"Alle <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> zu <lt-em>«</lt-em>…<lt-em>»</lt-em> ändern"}]},{ruleId:"TYPOGRAFISCHE_ANFUEHRUNGSZEICHEN_2",suggestions:[{match:/[‚‘]/,message:"Alle <lt-em>'</lt-em>…<lt-em>'</lt-em> zu <lt-em>‚</lt-em>…<lt-em>‘</lt-em> ändern"},{match:/[„“]/,message:"Alle <lt-em>'</lt-em>…<lt-em>'</lt-em> zu <lt-em>„</lt-em>…<lt-em>“</lt-em> ändern"}]},{ruleId:"TYPOGRAFISCHE_APOSTROPHE",suggestions:[{match:/’/,message:"Alle Apostrophe zu <lt-em>’</lt-em> ändern"}]},{ruleId:"EN_QUOTES",suggestions:[{match:/[“”]/,message:"Change all <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> to <lt-em>“</lt-em>…<lt-em>”</lt-em>"}]},{ruleId:"WRONG_APOSTROPHE",suggestions:[{match:/'/,message:"Use <lt-em>'</lt-em> for all bad apostrophes"},{match:/’/,message:"Use <lt-em>’</lt-em> for all bad apostrophes"}]},{ruleId:"PARAGRAF_LEERZEICHEN",suggestions:[{match:/§\u00A0/,message:"Alle Leerzeichen nach <lt-em>§</lt-em> ändern"}]},{ruleId:"CONSISTENCYRULE_JE_F",suggestions:[{match:/[^e]$/,message:"Remplacer tous les <lt-em>je</lt-em> vers le masculin"}]},{ruleId:"CONSISTENCYRULE_JE_M",suggestions:[{match:/e$/,message:"Remplacer tous les <lt-em>je</lt-em> vers le féminin"}]},{ruleId:"COMILLAS_TIPOGRAFICAS",suggestions:[{match:/[“”]/,message:"Cambiar todas las <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> por <lt-em>“</lt-em>…<lt-em>”</lt-em>"},{match:/(^«)|(»$)/,message:"Cambiar todas las <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> por <lt-em>«</lt-em>…<lt-em>»</lt-em>"}]},{ruleId:"COMETES_TIPOGRAFIQUES",suggestions:[{match:/[“”]/,message:"Canvia totes les <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> per <lt-em>“</lt-em>…<lt-em>”</lt-em>"},{match:/(^«)|(»$)/,message:"Canvia totes les <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> per <lt-em>«</lt-em>…<lt-em>»</lt-em>"}]},{ruleId:"TYPOGRAFISCHE_AANHALINGSTEKENS",suggestions:[{match:/[„“]/,message:"Alle <lt-em>&quot;</lt-em>…<lt-em>&quot;</lt-em> veranderen in <lt-em>„</lt-em>…<lt-em>“</lt-em>"}]},{ruleId:"PT_SMART_QUOTES",suggestions:[{match:/[“”]/,message:"Corrigir todas as aspas."}]},{ruleId:"GL_SMART_QUOTES",suggestions:[{match:/[“”]/,message:"Corrixir todas as comiñas."}]}],Me=["en","de","es","ca","fr","nl","pt"],Ie=["ar","he","fa","ur","ku","az"],Pe=["de","fr"],Ne=3,Oe=/^[ \u00A0]|[ \u00A0]$/g,De=/\u202F/g,He=/[\"“”„]$/,Ue=/^[\"“”„]/,Fe="E_ABORT",Be="E_PAYLOAD_TOO_LARGE",Ge="E_TIMEOUT",je="E_GENERIC",We={borderRadiusSmall:4,borderRadiusMedium:8,borderRadiusLarge:12,light:{colorBrandDefault:"#239AFF",colorBrandMedium:"#5EB5FF",colorBrandSubtle:"#ECF6FF",colorBrandBold:"#1976F0",colorTextDefault:"#2F3237",colorTextBold:"#1D1E20",colorTextSubtle:"#5E636E",colorTextStark:"#000000",colorTextInverseDefault:"#F1F3F9",colorTextInverseBold:"#FFFFFF",colorTextSelected:"#239AFF",colorTextLinkDefault:"#239AFF",colorTextLinkPressed:"#1976F0",colorTextLinkInverse:"#FFFFFF",colorTextDisabled:"#8F96A3",colorTextErrorBold:"#D01941",colorTextWarningBold:"#AB7D05",colorTextInfoBold:"#1976F0",colorTextHighlightBold:"#3729C1",colorTextSuccessBold:"#08905D",colorBorderDefault:"#DEE3ED",colorBorderSubtle:"#F1F3F9",colorBorderMedium:"#C2C9D6",colorBorderBold:"#8F96A3",colorBorderHover:"#5E636E",colorBorderSelected:"#1976F0",colorBackgroun
354dDefault:"#FFFFFF",colorBackgroundPaper:"#FFFFFF",colorBackgroundElevated:"#FFFFFF",colorBackgroundSunken:"#F1F3F9",colorBackgroundNeutralDefault:"#F1F3F9",colorBackgroundNeutralMedium:"#C2C9D6",colorBackgroundNeutralMuted:"#DEE3ED",colorBackgroundHighlightSubtle:"#ECF6FF",colorBackgroundInfoSubtle:"#ECF6FF",colorBackgroundWarningSubtle:"#FFF6E0",colorBackgroundSuccessSubtle:"#E2FFF4",colorBackgroundErrorSubtle:"#FFEEF2",colorBackgroundInverseDefault:"#1D1E20",colorBackgroundInverseBold:"#111213",colorBackgroundDisabled:"#DBDBDB",colorIconDefault:"#2F3237",colorIconBold:"#1D1E20",colorIconSubtle:"#5E636E",colorIconInverseDefault:"#F1F3F9",colorIconInverseBold:"#FFFFFF",colorIconSelected:"#239AFF",colorIconDisabled:"#8F96A3",colorIconBoldest:"#000000"},dark:{colorBrandDefault:"#5EB5FF",colorBrandMedium:"#239AFF",colorBrandSubtle:"#041A37",colorBrandBold:"#BADFFF",colorTextDefault:"#F1F3F9",colorTextBold:"#F8F9FC",colorTextSubtle:"#DEE3ED",colorTextStark:"#FFFFFF",colorTextInverseDefault:"#2F3237",colorTextInverseBold:"#000000",colorTextSelected:"#5EB5FF",colorTextLinkDefault:"#5EB5FF",colorTextLinkPressed:"#BADFFF",colorTextLinkInverse:"#111213",colorTextDisabled:"#C2C9D6",colorTextErrorBold:"#FF7A94",colorTextWarningBold:"#DEC850",colorTextInfoBold:"#5EB5FF",colorTextHighlightBold:"#9E94FE",colorTextSuccessBold:"#1EE197",colorBorderDefault:"#2F3237",colorBorderSubtle:"#1D1E20",colorBorderMedium:"#5E636E",colorBorderBold:"#8F96A3",colorBorderHover:"#C2C9D6",colorBorderSelected:"#5EB5FF",colorBackgroundDefault:"#111213",colorBackgroundPaper:"#2F3237",colorBackgroundElevated:"2F3237",colorBackgroundSunken:"#2F3237",colorBackgroundNeutralDefault:"#2F3237",colorBackgroundNeutralMedium:"#8F96A3",colorBackgroundNeutralMuted:"#5E636E",colorBackgroundHighlightSubtle:"#041A37",colorBackgroundInfoSubtle:"#041A37",colorBackgroundWarningSubtle:"#2B2003",colorBackgroundSuccessSubtle:"#021B12",colorBackgroundErrorSubtle:"#26020A",colorBackgroundInverseDefault:"#C2C9D6",colorBackgroundInverseBold:"#F1F3F9",colorBackgroundDisabled:"#434343",colorIconDefault:"#F1F3F9",colorIconBold:"#F8F9FC",colorIconSubtle:"#DEE3ED",colorIconInverseDefault:"#2F3237",colorIconInverseBold:"#111213",colorIconSelected:"#5EB5FF",colorIconDisabled:"#C2C9D6",colorIconBoldest:"#FFFFFF"},fontFamily:{macos:"LanguageTool-mac",win:"LanguageTool-win"},fontSizes:{xSmall:10,small:12,medium:14,large:16,xLarge:18}},$e="2024-11-19",ze="https://languagetool.org/legal/terms",Ve="https://languagetool.org/legal/privacy",Ke="⁣",Xe=`data-${s.default.get(s.ConfigKey.EXTN_PREFIX)}-editor-group`,qe="standard",Ye="simple",Ze="formal",Je="fluency",Qe="academic",et="creative",tt="expand",nt="shorten",st="natural",rt=[".","!","?"],it=["Shift","Control","Alt","Meta"],ot=12096e5,at=8e3,lt=288e5,ct="TRIAL",dt="TRIAL_50",ht="[data-qb-installed=true]"},
354"./content/Diff.ts":
355/*!*************************!*\
356  !*** ./content/Diff.ts ***!
357  \*************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Diff:()=>i,createDiff:()=>a});const s=/^[a-zA-Z\u{C0}-\u{FF}\u{D8}-\u{F6}\u{F8}-\u{2C6}\u{2C8}-\u{2D7}\u{2DE}-\u{2FF}\u{1E00}-\u{1EFF}]+$/u,r=/\S/;class i{static isRewrite(e){const t=e.filter((({added:e})=>!0===e)).map((({value:e})=>e)).join("").length,n=i.toNewString(e).length;return function(e){let t=0,n=!1;for(let s=0;s<e.length;s+=1)n?n=!1:("boolean"==typeof e[s].added&&"boolean"==typeof e[s+1]?.removed||"boolean"==typeof e[s].removed&&"boolean"==typeof e[s+1]?.added)&&(t+=1,n=!0);return t}(e)>1&&t/n>=.7}static toNewString(e){return e.filter((({removed:e})=>!1===Boolean(e))).map((({value:e})=>e)).join("")}static ignoreCaseChangeAtBeginning(e){const[t,n,s,r]=e,i=!0===n.added&&"string"==typeof n.value&&!0===r?.removed&&r?.value?.trim().endsWith(n.value.toLocaleLowerCase());if(!0!==t.removed||!1===i||""!==s?.value?.trim?.())return e;const o=r?.value?.replace(String(n.value).toLocaleLowerCase(),"").replace(/\s+$/," ");return[{value:(t.value?`${t.value} `:"")+o,count:r?.count??0,removed:!0},{value:n.value+s.value,count:0},...e.slice(4)]}static simplifyReplacements(e){const t=[],n=[],{length:s}=e;e:for(let r=0;r<s;r+=1)if(!n.includes(r)){t:for(let t=r+1;t<s;t+=1){const s=e[r],i=e[t];if(void 0===i.added&&void 0===i.removed){if(""===i.value?.trim())continue t;break t}const o=!0===s.removed&&!0===i.added,a=!0===s.added&&!0===i.removed;if(o)continue e;if(a){n.push(t);break t}}t.push(e[r])}return t.forEach((e=>{e.removed&&e.value&&(e.value=e.value.trimEnd())})),t}compute(e,t){const n=this.removeEmpty(this.tokenize(e)),s=this.removeEmpty(this.tokenize(t)),r=s.length,i=n.length;let a=1;const l=r+i,c=[{newPos:-1,components:[]}],d=this.extractCommon(c[0],s,n,0);if(c[0].newPos+1>=r&&d+1>=i)return[{value:this.join(s),count:s.length}];const h=()=>{for(let t=-1*a;t<=a;t+=2){let a;const l=c[t-1],d=c[t+1];let h=(d?d.newPos:0)-t;l&&(c[t-1]=void 0);const u=l&&l.newPos+1<r,g=d&&0<=h&&h<i;if(u||g){if(!u||g&&l.newPos<d.newPos?(a={newPos:(e=d).newPos,components:e.components.slice(0)},this.pushComponent(a.components,void 0,!0)):(a=l,a.newPos++,this.pushComponent(a.components,!0,void 0)),h=this.extractCommon(a,s,n,t),a.newPos+1>=r&&h+1>=i)return o(this,a.components,s,n);c[t]=a}else c[t]=void 0}var e;a++};for(;a<=l;){const e=h();if(e)return e}}pushComponent(e,t,n){const s=e[e.length-1];s&&s.added===t&&s.removed===n?e[e.length-1]={count:s.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})}extractCommon(e,t,n,s){const r=t.length,i=n.length;let o=e.newPos,a=o-s,l=0;for(;o+1<r&&a+1<i&&this.equals(t[o+1],n[a+1]);)o++,a++,l++;return l&&e.components.push({count:l}),e.newPos=o,a}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}equals(e,t){return e===t||!r.test(e)&&!r.test(t)}tokenize(e){const t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/);for(let e=0;e<t.length-1;e++)!t[e+1]&&t[e+2]&&s.test(t[e])&&s.test(t[e+2])&&(t[e]+=t[e+2],t.splice(e+1,2),e--);return t}join(e){return e.join("")}}function o(e,t,n,s){let r=0;const i=t.length;let o=0,a=0;for(;r<i;r++){const i=t[r];if(i.removed){if(i.value=e.join(s.slice(a,a+i.count)),a+=i.count,r&&t[r-1].added){const e=t[r-1];t[r-1]=t[r],t[r]=e}}else{if(i.added)i.value=e.join(n.slice(o,o+i.count));else{const t=n.slice(o,o+i.count).map(((e,t)=>{const n=s[a+t];return n.length>e.length?n:e}));i.value=e.join(t)}o+=i.count,i.added||(a+=i.count)}}const l=t[i-1];return i>1&&"string"==typeof l.value&&(l.added||l.removed)&&e.equals("",l.value)&&(t[i-2].value+=l.value,t.pop()),t}function a(e,t){return(new i).compute(e,t)||[]}},
357"./content/cardController.ts":
358/*!***********************************!*\
359  !*** ./content/cardController.ts ***!
360  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var s=n(/*! react */"react"),r=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),i=n(/*! ../common/utils */"./common/utils.ts"),o=n(/*! ../config/config */"./config/config.ts"),a=n(/*! ../core/utils */"./core/utils.ts"),l=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),c=n(/*! ../common/languageManager */"./common/languageManager.ts"),d=n(/*! ../react/views/editor-card/editor-card */"./react/views/editor-card/editor-card.tsx"),h=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),u=n(/*! ../init/config */"./init/config.ts"),g=n(/*! ./highlightStylingType */"./content/highlightStylingType.ts"),m=n(/*! ../common/advancedToolboxAdapter */"./common/advancedToolboxAdapter.ts"),p=n(/*! ../common/trial */"./common/trial.ts");const _={get TARGET_BOX_HORIZONTAL_MARGIN(){return u.default.get(u.ConfigKey.CARD_LAYOUT).TARGET_BOX_HORIZONTAL_MARGIN},get TARGET_BOX_VERTICAL_MARGIN(){return u.default.get(u.ConfigKey.CARD_LAYOUT).TARGET_BOX_VERTICAL_MARGIN},get HEADER_HEIGHT(){return u.default.get(u.ConfigKey.CARD_LAYOUT).HEADER_HEIGHT},get FOOTER_HEIGHT(){return u.default.get(u.ConfigKey.CARD_LAYOUT).FOOTER_HEIGHT},get KEYBOARD_HINT_HEIGHT(){return u.default.get(u.ConfigKey.CARD_LAYOUT).KEYBOARD_HINT_HEIGHT},get MIN_HEIGHT_PARAPHRASE(){return u.default.get(u.ConfigKey.CARD_LAYOUT).MIN_HEIGHT_PARAPHRASE},get MIN_HEIGHT_TOOLBOX(){return u.default.get(u.ConfigKey.CARD_LAYOUT).MIN_HEIGHT_TOOLBOX},get MAX_HEIGHT_TOOLBOX(){return u.default.get(u.ConfigKey.CARD_LAYOUT).MAX_HEIGHT_TOOLBOX}},E=new Map([["paraphrase","wide"],["correct","narrow"],["toolbox","wide"]]),f=u.default.get(u.ConfigKey.EXTN_PREFIX);class T{constructor({mode:e,storageController:t,inputArea:n,tweaks:o,targetBox:l,enableKeyboard:c,disablePremiumTeaser:d,user:h,isPremium:u,inhouseOnly:g,anchorSelection:p,getText:_,getSentenceRanges:E,getInputAreaScrollContainer:f,customEditorCard:C,triggerType:v,onCardHovered:S,canToolboxJumpToNextSentence:b}){this._renderOutsideIframe=!1,this._positionMode=null,this._containerElement=null,this._cardRef=(0,s.createRef)(),this._isDetached=!1,this._forceCardOpen=!1,this._showToolboxSentenceNavigation=!1,this._onForceCardOpenChange=e=>{this._forceCardOpen=e},this._onWindowScroll=()=>{this._updateContainerPosition(!0)},this._onToolboxApply=e=>{const t={card:this,result:e};(0,i.dispatchCustomEvent)(document,T.eventNames.applyToolboxResult,t)},this._onToolboxPluginSelect=(e,t)=>{const n=this._isPremium,s=m.AdvancedToolboxAdapter.isParaphraserSentenceSkill(t),r=m.AdvancedToolboxAdapter.isPremiumParaphraseMode(t,{inhouseOnly:this._inhouseOnly,textLocale:this._language??void 0});this._showToolboxSentenceNavigation=this._canToolboxJumpToNextSentence&&s&&(n||!r)},this._onToolboxTextHighlight=(e,t,n)=>{const[s,r]=t;let i=n?"none":"vertical";switch("text"===e&&(e="sentence",i="none"),e){case"sentence":this._sentenceSelection={start:s,end:r};break;case"phrase":this._phraseSelection={start:s,end:r};break;case"word":this._wordSelection={start:s,end:r};break;default:throw new Error(`Retrieved unknonw Toolbox text selection type "${e}".`)}this._dispatchHighlight(e,i),this._cardRef.current?.updateSentenceNavigationVisibility("sentence"===e&&this._showToolboxSentenceNavigation&&!0!==n)},this._onToolboxClearTextHighlight=()=>{this._phraseSelection=void 0,this.currentTextHighlightType=void 0,this._dispatchHighlight(),this._cardRef.current?.updateSentenceNavigationVisibility(!1)},this._onUnload=()=>{this.destroy()},this._id=(0,a.uuidv4)(),this._currentMode=e,this._storageController=t,this._inputArea=n,this._tweaks=o,this._targetBox=l,this._enableKeyboard=c,this._disablePremiumTeaser=d,this._user=h,this._isPremium=u,this._inhouseOnly=g,this._anchorSelection=p,this._triggerType=v,this._canToolboxJumpToNextSentence=b??!1,this._getText=_,this._getSentenceRanges=E,this._getInputAreaScrollContainer=f,this._onCardHovered=S,C&&(this._customEditorCard=C),this._referenceArea=n,this._keyboardEventTarget=this._tweaks.getKeyboardEventTarget(),this._document=this._inputArea.ownerDocument,this._sentenceSelection=this._getSentenceSelection(p);const x=(0,i.getFrameElement)(self);x&&this._tweaks.shouldRenderOutsideFrame(x)&&(0,i.isLTAvailable)(self.parent)&&(this._referenceArea=x,this._document=this._referenceArea.ownerDocument,this._renderOutsideIframe=!0,self.addEventListener("pagehide",this._onUnload,!0)),this._rootElement=this._tweaks.getRoot(this._document,this._referenceArea),this._isRo
360otElementNested=this._tweaks.isRootElementNested(this._document,this._rootElement),this._domMeasurement=new r.DomMeasurement(this._document),this._isRootElementNested&&!this._domMeasurement.isPositionFixed(this._rootElement)&&self.addEventListener("scroll",this._onWindowScroll),this._fetchTargetBoxOnceIfRequired()}updateTargetBox(e,t="full"){const n=e||this._targetBox;if(n){const e="vertical"===t&&this._targetBox?this._targetBox.left:n.left;this._targetBox={...n,left:e}}else this._targetBox=void 0;this._cardRef.current?.updatePosition()}updateSelection(e){(0,a.isObject)(e)&&(this._sentenceSelection=this._getSentenceSelection(e))}getSelection(e){if(["paraphrase","toolbox","correct"].includes(String(this._currentMode)))switch(e){case"word":return this._wordSelection;case"phrase":return this._phraseSelection;case"sentence":return this._sentenceSelection;default:throw new Error(`Unknown rephrase type "${e}"`)}}getTriggerType(){return this._triggerType}setLanguage(e){this._language=e}setRephraseCardArguments(e,t){this._rephraseCardArguments=e,this._anchorSelection=t,this._sentenceSelection=this._getSentenceSelection(t,u.default.get(u.ConfigKey.STRIP_WRAPPING_QUOTES_FROM_SENTENCE))||this._sentenceSelection}setErrorCardArguments(e){if(this._errorCardArguments=e,e.error){const t={start:e.error.start,end:e.error.end};this._sentenceSelection=this._getSentenceSelection(t),this._wordSelection=t}}getErrorCardArguments(){return this._errorCardArguments}setToolboxCardArguments(e,t){this._toolboxCardArguments=e,this._anchorSelection=t,this._sentenceSelection=this._getSentenceSelection(this._anchorSelection),this._cardRef.current?.updateCanChangeMode(!!e.error)}changeMode(e,t,n){const s=this._currentMode;this._currentMode=e;const r=this._getCurrentContentProps(),i=E.get(e);r&&(this._targetBox=t||this._targetBox,i&&this._cardRef.current?.updateCardType(i),this._updateContent?.(s,e,r,this._id),this._container?.setAttribute(`data-${f}-mode`,e),this._dispatchHighlight(),this._triggerType=n||this._triggerType)}hideLoadingScreen(e=!0){const t=this._getCurrentContentProps();if(!t){if(!1===[this._triggerType.toLowerCase(),this._toolboxCardArguments?.triggerType].includes("dblclick")){const e={container:!!this._containerElement,parent:!!this._containerElement?.parentElement,selection:!!this._anchorSelection,focus:!!(0,i.getFocusedElement)(this._keyboardEventTarget),host:document.domain,mode:this._currentMode,outer_focus:(()=>{switch(!0){case this._document===self.document:return"-";case!!(0,i.getFocusedElement)(self.document):return!0;default:return!1}})()};h.TrackerAdapter.trackError("other","editor-card:hide-loading:props-missing",Object.entries(e).map((([e,t])=>[e,"boolean"==typeof t?Number(t):t])).map((e=>e.join(":"))).join("; "))}return this.destroy(),!1}return this._updateContent?.(void 0,this._currentMode,t,this._id),this._dispatchHighlight(void 0,e?void 0:"none"),e&&this._cardRef.current?.updatePosition(),!0}switchError({error:e,displayedErrors:t,canCorrectMultipleAtOnce:n},s){if("correct"===this._currentMode&&this._errorCardArguments){if(this._errorCardArguments={...this._errorCardArguments,canCorrectMultipleAtOnce:Boolean(n),error:e,displayedErrors:t},this._targetBox=s||this._targetBox,e){const t=e.start+Math.floor((e.end-e.start)/2);this._anchorSelection={start:t}}const r=this._getErrorContentProps();r&&(this._updateContent?.("correct","correct",r,this._id),this._dispatchHighlight())}}switchSentence(e,t={}){if(this._anchorSelection=e,"toolbox"===this._currentMode&&this._toolboxCardArguments){if(this._sentenceSelection=this._getSentenceSelection(this._anchorSelection),!this._sentenceSelection)return;const e=this._getCurrentToolboxTextContext();e&&(this._updateTextContext?.(e),setTimeout((()=>{this._setCardIdle?.(!1)}),0))}if(this._rephraseCardArguments){this._rephraseCardArguments={...this._rephraseCardArguments,...t};const e=this._getRephraseContentProps();e&&(this._updateContent?.("paraphrase","paraphrase",e,this._id),this._dispatchHighlight())}}isGoingToNextSentence(){return this._showToolboxSentenceNavigation}render(){return this._initiateRendering()}
360shouldCloseOnProgrammaticScroll(){return"toolbox"!==this.mode}setToolboxResultApplying(){return new Promise((e=>{"toolbox"===this.mode&&(this._setCardIdle?.(!0),requestAnimationFrame((()=>e())))}))}isScrollingProgrammatically(){return"number"==typeof this._scrollingTimeoutId}destroy(){if(this._renderPromise?.finally((()=>{this._card?.unmount()})),this.currentTextHighlightType=void 0,this._dispatchHighlight(),this._container){this._container.remove(),this._container=null;const e={card:this,error:this._errorCardArguments?.error,shouldUpdateHighlight:"paraphrase"===this._currentMode};(0,i.dispatchCustomEvent)(document,T.eventNames.destroyed,e)}self.removeEventListener("pagehide",this._onUnload,!0),self.removeEventListener("scroll",this._onWindowScroll)}get highlightStylingType(){switch(this._currentMode){case"paraphrase":switch(this.currentTextHighlightType){case"word":return g.HighlightStylingType.selection_paraphrase_word;case"phrase":return g.HighlightStylingType.selection_paraphrase_phrase;case"sentence":return g.HighlightStylingType.selection_paraphrase_sentence;case"text":return g.HighlightStylingType.selection_paraphrase_text;default:return}case"toolbox":switch(this.currentTextHighlightType){case"word":return g.HighlightStylingType.selection_toolbox_word;case"phrase":return g.HighlightStylingType.selection_toolbox_phrase;case"sentence":return g.HighlightStylingType.selection_toolbox_sentence;case"text":return g.HighlightStylingType.selection_toolbox_text;default:return}case"correct":return"sentence"===this.currentTextHighlightType?g.HighlightStylingType.selection_paraphrase_sentence:g.HighlightStylingType.unstyled;default:return g.HighlightStylingType.unstyled}}get underlineColor(){if(!["paraphrase","toolbox","correct"].includes(String(this._currentMode)))return"";const e="paraphrase"===this._currentMode?o.COLORS.SYNONYMS.UNDERLINE:o.COLORS.STYLE.UNDERLINE;switch(this.currentTextHighlightType){case"word":case"phrase":return e;case"sentence":case"text":return o.COLORS.PARAPHRASE.UNDERLINE;default:throw new Error(`Unknown RephraseCard type "${this.currentTextHighlightType}"`)}}get backgroundColor(){if(!["paraphrase","toolbox","correct"].includes(String(this._currentMode)))return"";const e="paraphrase"===this._currentMode?"":o.COLORS.STYLE.BACKGROUND;switch(this.currentTextHighlightType){case"word":return e;case"phrase":case"sentence":case"text":return o.COLORS.PARAPHRASE.BACKGROUND;default:throw new Error(`Unknown RephraseCard type "${this.currentTextHighlightType}"`)}}get id(){return this._id}get mode(){return this._currentMode}get forceCardOpen(){return this._forceCardOpen}get isDetached(){return this._isDetached}get _showRuleId(){const{showRuleId:e}=this._storageController.getUIState();return e}get _container(){return this._containerElement||(this._containerElement=(0,i.createContainerElement)(this._document,T.CONTAINER_ELEMENT_NAME),this._containerElement.style.display="none",this._containerElement.setAttribute(`data-${f}-adjust-appearance`,"true"),this._containerElement.setAttribute(`data-${f}-mode`,this._currentMode),this._containerElement.classList.add(`${f}-card`),this._containerElement.classList.toggle(`${f}-card--fixed`,this._isRootElementNested),this._containerElement.addEventListener("click",(e=>e.stopPropagation())),this._containerElement.addEventListener("mousemove",(()=>this._onCardHovered?.(this))),(0,i.hasDarkBackground)(this._inputArea)?this._containerElement.setAttribute(`data-${f}-force-appearance`,"dark"):this._containerElement.setAttribute(`data-${f}-force-appearance`,"light")),this._containerElement}set _container(e){this._containerElement=e}_updateContainerPosition(e=!1){(0,i.assert)(this._container),e&&this._domMeasurement.clearCache();const t=this._domMeasurement.getDocumentScroll();this._domMeasurement.setStyles(this._container,{left:`-${t.left}px`,top:`-${t.top}px`},!0)}_position(e,t=!1){if((0,i.assert)(this._container),(0,i.assert)(this._targetBox),!e)return;this._domMeasurement.clearCache();const n={...this._targetBox},s=this._domMeasurement.getDocumentVisibleBox(),o=this._document.elementFromPoint(n.left-s.left+10,n.bottom-s.top+10),a=this._checkHasOverlayUnderTargetBox((()=>Boolean(o)&&!this._inputArea.contains(o)&&!(0,i.isParent)(o,this._inputArea)&&!this._container?.contains(o)));this._updateContainerPosition(),!1===this._card?.isInDOM()&&this._card.appendTo(this._rootElement),this._domMeasurement.clearCache();const l=this._domMeasurement.getBorderBox(e);if(this._renderOutsideIframe){let e=document.createElement(`${f}-span`);e.style.position="absolute",e.style.left=n.left+"px",e.style.top=n.top+"px",document.documentElement.appendChild(e);const t=e.getBoundingClientRect();e.remove(),e=null;const s=new r.DomMeasurement(this._document).getContentBox(this._referenceArea);
360n.left=s.left+t.left,n.top=s.top+t.top,n.bottom=s.top+t.top+n.height,n.right=s.left+t.left+n.width}let{left:c,top:d,baseMaxHeight:h,contentMaxHeight:u}=["paraphrase","toolbox"].includes(this._currentMode)||"TOO_LONG_SENTENCE"===this._errorCardArguments?.error?.rule.id?this._getAdvancedPosition(l,n,s):this._getDefaultPosition(l,n,s,a);if(!t){const t=this._domMeasurement.getScaleFactor(this._rootElement),n=this._domMeasurement.getZoom(this._rootElement);c/=t.x*n,d/=t.y*n,e.style.left=Math.round(c)+"px",e.style.top=Math.round(d)+"px"}"toolbox"===this._currentMode?(e.style.removeProperty(`--${f}-comp-card-base-max-height`),e.style.removeProperty(`--${f}-comp-card-content-max-height`),e.style.setProperty(`--${f}-comp-card-base-height`,Math.round(h)+"px"),e.style.setProperty(`--${f}-comp-card-content-height`,Math.round(u)+"px")):(e.style.removeProperty(`--${f}-comp-card-base-height`),e.style.removeProperty(`--${f}-comp-card-content-height`),e.style.setProperty(`--${f}-comp-card-base-max-height`,Math.round(h)+"px"),e.style.setProperty(`--${f}-comp-card-content-max-height`,Math.round(u)+"px"))}_getPositionMode(){return this._positionMode}_getAdvancedPosition(e,t,n){const s=t.top-n.top,r=n.height+n.top-t.bottom,{min:o,max:a}=this._getMinMaxHeightByMode(),l="above"===this._positionMode||"below"!==this._positionMode&&s>r&&s>=o,c=(t,n)=>{clearTimeout(this._scrollingTimeoutId),this._scrollingTimeoutId=void 0;let s=n-_.TARGET_BOX_VERTICAL_MARGIN;if(!this._showToolboxSentenceNavigation||!this._container)return[s,0,void 0];let r=this._document.documentElement,i=this._getInputAreaScrollContainer();i||this._renderOutsideIframe||(i=this._domMeasurement.isScrollable(this._inputArea,"y")?this._inputArea:null),i&&(r=i);const{clientHeight:o,scrollHeight:a,scrollTop:l}=r,c=a-o-l,d=e.height,h=d-s,u=h>0;let g=l;if("above"===t&&u&&l>0){const e=Math.max(0,Math.min(h,l));g=l-e,s=d-(h-e)}if("below"===t&&u&&c>0){const e=Math.max(0,Math.min(h,c));g=l+e,s=d-(h-e)}const m=l!==g;return m&&(this._scrollingTimeoutId=self.setTimeout((()=>this._scrollingTimeoutId=void 0),50),r.scroll({behavior:"instant",top:g})),[s,r===this._document.documentElement?0:l-g,m?g:void 0]},d=e=>{"number"==typeof e&&(n.top=e)};let h,u=0,g=t.bottom+_.TARGET_BOX_VERTICAL_MARGIN;const m=Math.min(t.left,n.width-e.width)-_.TARGET_BOX_HORIZONTAL_MARGIN;if(l){const[r,i,o]=c("above",s);u=i,h=r,d(o),g=Math.max(n.top,t.top-e.height-_.TARGET_BOX_VERTICAL_MARGIN),this._positionMode="above"}else{const[e,t,n]=c("below",r);u=t,h=e,d(n),this._positionMode="below"}g+=u,h=(0,i.clamp)(o,h,a);let p=h-_.HEADER_HEIGHT;return this._enableKeyboard&&"toolbox"!==this._currentMode&&(p-=_.KEYBOARD_HINT_HEIGHT),this.isDetached&&"toolbox"!==this._currentMode&&(p-=_.FOOTER_HEIGHT),h===o&&(this._positionMode=null,this._showToolboxSentenceNavigation)?this._getAdvancedPosition(e,t,n):{contentMaxHeight:p,baseMaxHeight:h,top:g,left:m}}_getDefaultPosition(e,t,n,s){const r=Math.min(t.left,n.width-e.width)-_.TARGET_BOX_HORIZONTAL_MARGIN;let i=t.bottom+_.TARGET_BOX_VERTICAL_MARGIN;if("below"===this._positionMode||0===e.height)return{baseMaxHeight:600,contentMaxHeight:600,top:i,left:r};const o=e.height<t.top;return i+e.height>n.bottom||s&&o||"above"===this._positionMode?(i=Math.max(n.top,t.top-e.height-_.TARGET_BOX_VERTICAL_MARGIN),this._positionMode="above"):this._positionMode="below",{baseMaxHeight:600,contentMaxHeight:600,top:i,left:r}}_moveIntoViewport(e){if(!e||!this._isDetached)return;this._domMeasurement.clearCache();const t=this._domMeasurement.getScaleFactor(this._rootElement),n=this._domMeasurement.getZoom(this._rootElement),s=t.x*n,r=t.y*n,{height:i,width:o}=this._domMeasurement.getDocumentVisibleBox(),{top:a,left:l}=this._domMeasurement.getDocumentScroll(),{left:c,top:d,height:h,width:u}=this._domMeasurement.getBorderBox(e),g={};let m=!1;if(o-l-(c+u)<0){const e=Math.round((o-u-1)/s);g.left=`${e}px`,m=!0}if(d-a<0){const e=Math.round((i-h-1)/r);g.bottom=`${e}px`,m=!0}m&&this._domMeasurement.setStyles(e,g,!0)}_fetchTargetBoxOnceIfRequired(){(0,a.isUndefined)(this._targetBox)&&"paraphrase"===this._currentMode&&Promise.resolve().then((()=>this._dispatchHighlight("sentence"))),this._fetchTargetBoxOnceIfRequired=()=>{}}_initiateRendering(){return new Promise((e=>{const t=this._renderPromise||Promise.resolve();this._renderPromise=t.then((()=>
360{if(!(0,a.isObject)(this._card))return this._render().then(e);this._renderPromise=void 0}))}))}async _render(){if((0,i.assert)(this._container),!this._targetBox)return;const e=this._getCurrentContentProps(),t=E.get(this._currentMode)||"narrow",n=["correct","paraphrase"].includes(this._currentMode);this._card=await(0,d.default)(this._container,{cardId:this._id,mode:this._currentMode,type:t,triggerType:this._triggerType,keyboardNavigationEnabled:!0===this._enableKeyboard,disablePremiumTeaser:this._disablePremiumTeaser,keyboardEventTarget:this._keyboardEventTarget,root:this._container,isPremium:this._isPremium,backdropRoot:this._rootElement,onClose:()=>this._onCloseClicked(),onPremiumClick:e=>this._onPremiumClick(e),onDetachCard:()=>this._onDetachCard(),onNavigateError:e=>this._onNavigateError(e),onNavigateSentence:e=>this._onNavigateSentence(e),updatePosition:(e,t)=>this._position(e,t),getPositionMode:()=>this._getPositionMode(),moveIntoViewport:e=>this._moveIntoViewport(e),forwardUpdateContentFn:e=>this._setUpdateContentFn(e),forwardUpdateTextContextFn:e=>this._setUpdateTextContextFn(e),forwardSetCardIdleFn:e=>this._setCardIdleFn(e),onModeChange:e=>this._onToggleCardMode(e),onForceCardOpenChange:this._onForceCardOpenChange,customEditorCard:this._customEditorCard,canSeeLollipop:m.AdvancedToolboxAdapter.canSeeLollipop(this._storageController),initialContentProps:e,canChangeMode:n,onSentenceHighlightChange:e=>this._handleSentenceHighlightChange(e)},this._cardRef),this._cardRef.current?.updatePosition()}_getErrorContentProps(e=!1){if(!this._errorCardArguments||!this._language)return null;const{error:t,disableAddingWord:n,disableIgnoringRule:s,displayedErrors:r,premiumErrors:i}=this._errorCardArguments,d=c.LanguageManager.getPrimaryLanguageCode(this._language),h=o.SUPPORTED_SENTENCE_SPLITTING_LANGUAGES.some((e=>d.toLowerCase().startsWith(e.toLowerCase()))),u=this._storageController.getUniqueId(),g=this._storageController.hasCustomServer(),m="HIDDEN_RULE"===t?.rule.id,_=h&&!g&&"TOO_LONG_SENTENCE"===t?.rule.id&&t.end-t.start<=o.SPLIT_SENTENCE_LIMIT,E=this._getFixSentencePayloadByError(t,r),f={type:"correct",onPremiumTeaserClick:e=>this._onPremiumTeaserClick(e),onSplitSentenceClick:(e,t)=>this._onSplitSentenceClick(e,t),onFixSentenceClick:(e,t,n)=>this._onFixSentenceClick(e,t,n),onFixSentenceMouseOver:e=>this._onFixSentenceMouseOver(e),onFixSentenceMouseOut:()=>this._onFixSentenceMouseOut(),changeLanguageAction:this._getChangeLanguageAction(t),errorType:this._getErrorType(t),fixes:this._getFixes(t),inhouseOnly:this._inhouseOnly,user:this._user,errorId:t?.rule.id,title:t?.shortDescription,description:t?.description,originalPhrase:t?.originalPhrase,showRuleId:this._showRuleId,trialRemainingDays:p.Trial.getRemainingDays(),isIdle:e,language:d,uniqueId:u,isHiddenMatch:m,displayedErrors:r,premiumErrors:i,showSentenceSplittingSuggestion:_,error:t,allowCyclicNavigation:this._tweaks.shouldAllowCyclicNavigation()};return t&&(this._wordSelection={start:t.start,end:t.end},f.onUnlockCard=e=>this._onUnlockSuggestion(t,e)),E&&(f.fixSentencePayload=E),t?.isSpellingError?(n||(0,a.includesWhiteSpace)(t.originalPhrase)||(f.onAddToDictionaryClick=e=>this._onAddToDictionaryClick(t,!e.isTrusted&&e.shiftKey)),f.onIgnoreWordTemporarily=e=>this._onTemporarilyIgnoreWordClick(t,!e.isTrusted&&e.shiftKey)):t&&(s||m||t.isCustomError||(f.onIgnoreRule=e=>this._onIgnoreRuleClick(t,!e.isTrusted&&e.shiftKey)),f.onIgnoreRuleTemporarily=e=>this._onTemporarilyIgnoreRuleClick(t,!e.isTrusted&&e.shiftKey)),t?.isPicky&&"extension"===l.EnvironmentAdapter.getType()&&!m&&(f.onTurnOffPickyMode=()=>this._onTurnOffPickyMode()),t?.rule.urls?.[0].value&&(f.onMoreDetailsClick=()=>this._onMoreDetailsClick(t)),f}_getRephraseContentProps(e=!1){if(!this._rephraseCardArguments||!this._language)return null;const t=this._language,{remainingRephrasings:n,highlightType:s}=this._rephraseCardArguments;if(this.currentTextHighlightType=s,this._sentenceSelection=this._getSentenceSelection(this._anchorSelection,u.default.get(u.ConfigKey.STRIP_WRAPPING_QUOTES_FROM_SENTENCE)),!this._sentenceSelection)return null;this._originalSentence=this._getText().slice(this._sentenceSelection.start,this._sentenceSelection.end);const{motherTongue:r,hasRephrasingEnabled:i}=this._storageController.getSettings(),a=this._getWordContext(this._anchorSelection);let l;if(this._word=a?.word,this._wordSelection=a?{start:a.position.start,end:a.position.end}:void 0,"phrase"===s){const t=this._getPhrasalContext(this._anchorSelection);this._word=this._word||t?.phrase,this._wordSelection=!this._wordSelection&&t?{start:t.position.start,end:t.position.end}:this._wordSelection,this._phraseSelection=!this._phraseSelection&&t?{start:t.position.start,end:t.position.end}:this._phraseSelection,l=t?{onPhrasalClick:e=>this._onPhraseClick(e),language:this._language,isIdle:e,phrasalContext:t,motherTongue:r}:void 0}const d=o.SUPPORTED_REPHRASE_LANGUAGES.some((e=>c.LanguageManager.getPrimaryLanguageCode(e)===c.LanguageManager.getPrimaryLanguageCode(t))),h=this._storageController.getUniqueId(),g=a?{onSynonymClick:e=>this._onSynonymClick(e),language:this._language,isIdle:e,wordContext:a,motherTongue:r}:void 0,m=i?{highlightSentence:()=>this._dispatchHighlight(),onPhraseClick:e=>this._onPhraseClick(e),sentence:this._originalSentence,inhouseOnly:this._inhouseOnly,user:this._user,language:this._language,showRuleId:this._showRuleId,isIdle:e,isEnabled:d,remainingRephrasings:n,uniqueId:h,selection:this._sentenceSelection}:void 0;return{type:"paraphrase",sentenceRanges:this._getSentenceRanges(),synonymsData:g,paraphrasingsData:m,phrasalData:l}}_getToolboxContentProps(e=!1){if(!this._toolboxCardArguments||!this._anchorSelection)return null;const t=(0,i.getFocusedElement)(this._keyboardEventTarget);if(!t)return null;const n=this._getSentenceRanges()?.map((({start:e,end:t})=>[e,t]))||[],s=this._getCurrentToolboxTextContext(),{SUPPORTS_DARK_MODE:r,DEEP_LINK_INTO_TOOLBOX:a}=u.default.get(u.ConfigKey.LOLLIPOP_CONFIG),{triggerType:c,inhouseOnly:d}=this._toolboxCardArguments,{motherTongue:h,preferredLanguages:g}=this._storageController.getSettings(),p={isAuthenticated:!!this._user?.email,isPremium:this._isPremium,motherTongue:h||l.EnvironmentAdapter.getUILanguageCode(),preferredLanguages:g},_=this._document.documentElement.outerHTML,E=(()=>{let e=self.location.href;try{self.top&&self.top.location!==self.location&&(e=self.top.location.href)}catch{}return e})(),f=m.AdvancedToolboxAdapter.getUiLanguage(),T="gc-card"===c||"toolbar"===c&&a?m.AdvancedToolboxAdapter.getParaphraserSkill(s):null,C=m.AdvancedToolboxAdapter.isParaphraserSentenceSkill(T);return this._showToolboxSentenceNavigation=C&&this._canToolboxJumpToNextSentence,{type:"toolbox",theme:o.TOOLBOX_THEME,textfieldElement:t,hasDarkBackgroun
360d:r&&(0,i.hasDarkBackground)(this._inputArea),editorText:this._getText(),close:()=>this.destroy(),onApply:this._onToolboxApply,setTextHighlight:this._onToolboxTextHighlight,onPluginSelect:this._onToolboxPluginSelect,removeTextHighlight:this._onToolboxClearTextHighlight,sentenceRanges:n,selectedSkill:T,inhouseOnly:d,textContext:s,pageSource:_,pageUri:E,triggerType:c,uiLanguage:f,isIdle:e,user:p}}_getCurrentToolboxTextContext(){const e=(0,i.normalizeSelection)(this._anchorSelection),t=this._getText(),n=t.slice(e.start,e.end),s=this._getSentenceRanges()?.map((({start:e,end:t})=>[e,t]))||[],{textRange:r,sentenceRange:o,phraseRange:a,wordRange:l}=this._getToolboxContentRanges(e,s);return{text:t,locale:this._language,direction:this._domMeasurement.isRTL(this._inputArea)?"rtl":"ltr",selection:{...e,text:n},sentenceRanges:s,sentenceRange:o,phraseRange:a,wordRange:l,textRange:r}}_getCurrentContentProps(e=!1){switch(this._currentMode){case"correct":return this._getErrorContentProps(e);case"paraphrase":return this._getRephraseContentProps(e);case"toolbox":return this._getToolboxContentProps(e);default:throw new Error(`Got unexpected Editor Card mode "${this._currentMode}".`)}}_setCardIsIdle(){this._isDetached&&this._setCardIdle?.(!0)}_getChangeLanguageAction(e){if(1===e?.fixes.length&&(e.description.match(/i[ns]\s+(chiefly\s)?((North\s)?American|British)\s+English/i)||e.description.match(/Change\s+British\s+English\s+spelling\s+to/i)||"EN_GB_SIMPLE_REPLACE"===e.rule.id)){const{geoIpCountry:t}=this._storageController.getSettings();let n=null,s=null;if(e.description.match(/is\s+(chiefly\s)?British English/)||e.description.match(/Change\s+British\s+English\s+spelling\s+to/i)||e?.description.startsWith("In American English")?"CA"===t?(s="en-ca",n="switchToSouthAfricanEnglish"):"AU"===t?(s="en-au",n="switchToAustralianEnglish"):"NZ"===t?(s="en-nz",n="switchToNewZealandEnglish"):"ZA"===t?(s="en-za",n="switchToSouthAfricanEnglish"):(s="en-gb",n="switchToBritishEnglish"):(e.description.match(/is\s+(chiefly\s)?(North\s)?American English/)||e.description.includes("is a common American expression")||e.description.startsWith("In British English"))&&(s="en-us",n="switchToAmericanEnglish"),n&&s)return{onClick:this._onLanguageChange.bind(this,s,e),labelId:n}}}_onFixClick(e,t,n){const s={card:this,selectNextError:n||this.isDetached,error:t,fixIndex:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.fixSelected,s)}_onCorrectAll(e,t){const n={card:this,selectedError:t,selectNextError:this.isDetached,config:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.correctAll,n)}_onLanguageChange(e,t){const n={card:this,language:e,error:t};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.languageChanged,n)}_onMoreDetailsClick(e){let t;if(t=e.rule.urls?.[0].value){const e={card:this,url:t};(0,i.dispatchCustomEvent)(document,T.eventNames.moreDetailsClicked,e)}}_onPremiumClick(e){const t={card:this,isCardDetached:this.isDetached,subject:e};(0,i.dispatchCustomEvent)(document,T.eventNames.premiumClick,t)}_onDetachCard(){this._isDetached=!0,h.TrackerAdapter.trackEvent("Action","editor_card:detach")}_onNavigateError(e){if(!this._errorCardArguments?.error)return;const{start:t,end:n}=this._errorCardArguments.error,s={card:this,selection:{start:t,end:n},direction:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.navigateError,s)}_onNavigateSentence(e){if(!this._sentenceSelection)return;const t={card:this,selection:this._sentenceSelection,direction:e};this._setCardIsIdle(),this.currentTextHighlightType="sentence",(0,i.dispatchCustomEvent)(document,T.eventNames.navigateSentence,t)}_onPremiumTeaserClick(e){const t={card:this,campaign:e??"addon2-errorcard-match"};(0,i.dispatchCustomEvent)(document,T.eventNames.premiumTeaserClicked,t)}_onAddToDictionaryClick(e,t){const n={card:this,selectNextError:t||this.isDetached,error:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.addToDictionaryClicked,n)}_onUnlockSuggestion(e,t){const n={card:this,error:e,onUnlockComplete:async e=>{await t(e),this.hideLoadingScreen(!1)}};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.unlockSuggestion,n)}_onTemporarilyIgnoreWordClick(e,t){const n={card:this,selectNextError:t||this.isDetached,error:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.temporarilyIgnoreWordClicked,n)}_onIgnoreRuleClick(e,t){const n={card:this,selectNextError:t||this.isDetached,error:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.ignoreRuleClicked,n)}_onTemporarilyIgnoreRuleClick(e,t){const n={card:this,selectNextError:t||this.isDetached,error:e};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.temporarilyIgnoreRuleClicked,n)}_onTurnOffPickyMode(){if(!this._wordSelection)return;const e={card:this,selection:this._wordSelection};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.turnOffPickyModeClicked,e)}_onPhraseClick(e){const t=this._phraseSelection||this._sentenceSelection;(0,i.assert)(t),(0,i.assert)(this._language);const n={card:this,phrase:e.text,reverted:!1,selection:t,language:this._language,label:e.label,selectNextSentence:e.selectNextSentence??!1};this.isDetached&&(n.selectSentenceAfter=!0),this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.phraseSelected,n),this._phraseSelection=this._phraseSelection&&{start:t.start,end:t.start+e.text.length},this._sentenceSelection=this._sentenceSelection&&{start:t.start,end:t.start+e.text.length}}_onSynonymClick(e){(0,i.assert)(this._word),(0,i.assert)(this._wordSelection);const t={card:this,word:this._word,selection:this._wordSelection,synonym:e};this.isDetached&&(t.selectSynonymReplacement=!0),this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.synonymSelected,t)}_onSplitSentenceClick(e,t){(0,i.assert)(this._errorCardArguments?.error),(0,i.assert)(this._language);const n={...this._errorCardArguments.error,fixes:[{value:e.text}]},s={card:this,sentence:e.text,reverted:!1,label:e.label,language:this._language,selectNextError:t||this.isDetached,error:n};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.splitSentenceSelected,s)}_onFixSentenceClick({start:e,end:t,includedErrors:n,selectedErrorId:s},r,o){(0,i.assert)(this._errorCardArguments?.error),(0,i.assert)(this._language);const a={card:this,language:this._language,selectNextError:o,includedErrors:n,selectedErrorId:s,sentence:r,start:e,end:t};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.fixSentenceSelected,a)}_onFixSentenceMouseOver(e){const t={card:this,includedErrorIds:e};(0,i.dispatchCustomEvent)(document,T.eventNames.fixSentenceShowHightlight,t)}_onFixSentenceMouseOut(){const e={card:this};(0,i.dispatchCustomEvent)(document,T.eventNames.fixSentenceRemoveHightlight,e)}_onToggleCardMode({mode:e,textHighlightType:t,triggerType:n,toolboxTriggerType:s,requiresPositionUpdate:r}){(0,i.assert)(this._anchorSelection,"The anchor selection must be defined for switching to a different card mode");const o=this._currentMode,a=this._triggerType;if(n&&(this._triggerType=n),"gc-card"===s&&"sentence"===t&&(this._showToolboxSentenceNavigation=this._canToolboxJumpToNextSentence,"correct"===this._currentMode&&"hover"===a&&this._errorCardArguments?.error)){const{error:e}=this._errorCardArguments,t=this._errorCardArguments.error.start+Math.floor((e.end-e.start)/2);this._anchorSelection={start:t}}"sentence"===t?(this._phraseSelection=void 0,this._wordSelection=void 0):"phrase"===t?(this._wordSelection=void 0,this._sentenceSelection=void 0):"word"===t&&(this._phraseSelection=void 0,this._sentenceSelection=void 0),r&&(this._currentMode=e,this._positionMode=null,this._cardRef.current?.updatePosition());const l={card:this,selection:this._anchorSelection,currentMode:e,previousMode:o,textHighlightType:t,toolboxTriggerType:s};this._setCardIsIdle(),(0,i.dispatchCustomEvent)(document,T.eventNames.toggleMode,l)}_onCloseClicked(){this.destroy()}_dispatchHighlight(e,t){(0,a.isString)(e)&&(this.currentTextHighlightType=e);const n={card:this,updateCardPosition:t};(0,i.dispatchCustomEvent)(document,T.eventNames.highlight,n)}_handleSentenceHighlightChange(e){e?this._dispatchHighlight("sentence","none"):(this.currentTextHighlightType=void 0,this._dispatchHighlight())}_setUpdateContentFn(e){this._updateContent=e}_setUpdateTextContextFn(e){this._updateTextContext=e}_setCardIdleFn(e){this._setCardIdle=e}_getErrorType(e){if(!(0,a.isUndefined)(e))return(0,a.getErrorType)(e)}_getFixes(e){return(0,a.isUndefined)(e)?[]:e.fixes.slice(0,o.MAX_FIXES_COUNT).flatMap(((t,n)=>{(0,i.assert)(this._errorCardArguments);
360const s={text:"",title:t.shortDescription,prefix:t.prefix,suffix:t.suffix,fixValue:t.value,onClick:t=>this._onFixClick(n,e,!t.isTrusted&&t.shiftKey)};if(t.value.match(o.TRAILING_WHITESPACE_REGEXP)&&!t.value.match(/^\s*[\-–—:;]\s*$/))s.text=t.value.replace(o.TRAILING_WHITESPACE_REGEXP,"·");else{const n=t.value.replace(o.NARROW_WHITESPACE_REGEXP," ");e.fixes.length>3&&e.isSpellingError?s.text=n:(s.type="highlight",s.html=(0,i.escapeHTMLInHighlightedPhrase)((0,i.highlightChangesInPhrase)(e.originalPhrase,n)))}""===t.value&&e.originalPhrase.match(/[a-z0-9]{2,}/)?(s.type="remove",s.text=e.originalPhrase,s.html=void 0):""===t.value?(s.type="delete",s.text="",s.html=void 0):e.language.code.startsWith("en")&&"–"===t.value&&"-"===e.originalPhrase.trim()?(s.type="insert-en-dash",s.text="",s.html=void 0):e.language.code.startsWith("en")&&" — "===t.value&&"-"===e.originalPhrase.trim()?(s.type="insert-em-dash-with-space",s.text="",s.html=void 0):e.language.code.startsWith("en")&&"—"===t.value&&"-"===e.originalPhrase.trim()?(s.type="insert-em-dash",s.text="",s.html=void 0):" "===t.value&&/^\s\s+$/.test(e.originalPhrase)?(s.type="remove-whitespace",s.text="",s.html=void 0):" "===t.value&&/^[-]+$/.test(e.originalPhrase)&&(s.type="replace-hyphen",s.text="",s.html=void 0);const r=(0,i.getConfigForMultipleErrorCorrection)(e,t.value);return this._errorCardArguments.canCorrectMultipleAtOnce&&r?[s,{text:"",html:r.suggestion.message,type:"correct-all",onClick:()=>this._onCorrectAll(r,e)}]:s}))}_getFixSentencePayloadByError(e,t){if((0,i.assert)(this._language),Date.now()>0)return null;if(!e)return null;const n=c.LanguageManager.getPrimaryLanguageCode(this._language),s=!1===o.SUPPORTED_FIX_COMPLETE_SENTENCE_LANGUAGES.includes(n),r=this._storageController.hasCustomServer();if(s||r)return null;const l=(0,a.getSentenceRangeBySelection)(this._getSentenceRanges(),{start:e.start,end:e.end});if(!l)return null;const d=t.filter((e=>{const t=["grammar","punctuation","spelling"].includes((0,a.getErrorType)(e));return 1===e.fixes.length&&e.start>=l.start&&e.end<=l.end&&t})).sort((({start:e},{start:t})=>e>t?1:-1));return d.length<o.FIX_SENTENCE_MIN_ERROR_AMOUNT||!(0,a.isString)(e.id)?null:{start:l.start,end:l.end,content:this._getText().slice(l.start,l.end),includedErrors:d,selectedErrorId:e.id}}_getWordContext(e,t=!0){const n=this._getSentenceRanges(),s=this._getText();if(!e||!n||!s)return null;const{start:r,end:o}=(0,i.normalizeSelection)(e);return r<0?null:(0,a.getWordContext)(s,r,o,n,t)}_getPhrasalContext(e){const t=this._getSentenceRanges(),n=this._getText();if(!e||!t||!n)return null;if(e.start<0)return null;const s=(0,a.getPhrasalContext)(n,e.start,e.end,t);return!s||/^[^\S]*$/.test(s.phrase)?null:s}_getSentenceSelection(e,t=!1){if(!e)return;const n=this._getText(),s=this._getSentenceRanges(),r=(0,i.optionallySanitizeDanglingSelection)(n,s,e);if(!(0,i.hasValidSentenceRange)(n,s,r))return;const l=(0,a.getSentenceRangeBySelection)(s,r);if("number"!=typeof l?.start||"number"!=typeof l?.end)return;let{start:c,end:d}=l;const h=n.slice(c,c+1),u=n.slice(d-1,d);return t&&h.match(o.QUOTE_AT_BEGINNING_REGEXP)&&u.match(o.QUOTE_AT_END_REGEXP)&&(c+=1,d-=1),{start:c,end:d}}_getRelevantToolboxSentenceRange(e,t,n){if(!t||!n)return;const s=e.findIndex((e=>e[0]===t[0]&&e[1]===t[1]));return s===e.findIndex((e=>e[0]===n[0]&&e[1]===n[1]))&&s>=0?t:void 0}_getToolboxContentRanges(e,t){const n=t[0],s=t[t.length-1];let r,i;-1===e.start?r=void 0:(r=t.find((([t,n])=>t<=e.start&&n>=e.start)),r||(r=(e.start===e.end?[...t].reverse().find((([,t])=>t<e.end)):t.find((([t])=>t>e.start)))??n)),e.start===e.end?i=r:(i=t.find((([t,n])=>t<=e.end&&n>=e.end)),i||(i=[...t].reverse().find((([,t])=>t<e.end))??s));const a=this._getRelevantToolboxSentenceRange(t,r,i),c=!a&&r&&i?[r[0],i[1]]:void 0,d={sentenceRange:a},h=this._getWordContext(e,!1),u=this._getPhrasalContext(e),g=Number.isInteger(a?.[0])&&a?.[0]===u?.position.start&&Number.isInteger(a?.[1])&&a?.[1]===u?.position.end;if(c&&(d.textRange=c),!h&&!u)return d;const m=!!u,p=m&&Array.isArray(r)&&Number.isInteger(u?.position.end)&&u.position.end>r[1]||Array.isArray(i)&&u&&u.position.start<i[0],_=u?.phrase??"",E="extension"===l.EnvironmentAdapter.getType()&&m&&!p&&!g&&_.split(/[^\S]+/).length<=o.MAX_PHRASE_LENGTH_IN_WORDS;return h&&e.end<=h.position.end+2?d.wordRange=[h.position.start,h.position.end]:E&&(d.phraseRange=[u.position.start,u.position.end]),d}_checkHasOverlayUnderTargetBox(e){"number"==typeof this._overlayUnderTargetBoxTimeoutId&&(clearTimeout(this._overlayUnderTargetBoxTimeoutId),this._overlayUnderTargetBoxTimeoutId=void 0);const t=!0===this._hasOverlayUnderTargetBox||e();return this._hasOverlayUnderTargetBox=t,self.setTimeout((()=>{this._hasOverlayUnderTargetBox=void 0}),200),t}_getMinMaxHeightByMode(){return"toolbox"===this._currentMode?{min:_.MIN_HEIGHT_TOOLBOX,max:_.MAX_HEIGHT_TOOLBOX}:{min:_.MIN_HEIGHT_PARAPHRASE,max:1/0}}}T.CONTAINER_ELEMENT_NAME=`${f}-card`,T.BLOCK_ID="editor-card",T.eventNames={addToDictionaryClicked:`${f}-card.addToDictionaryClicked`,ignoreRuleClicked:`${f}-card.ignoreRuleClicked`,temporarilyIgnoreWordClicked:`${f}-card.temporarilyIgnoreWordClicked`,temporarilyIgnoreRuleClicked:`${f}-card.temporarilyIgnoreRuleClicked`,turnOffPickyModeClicked:`${f}-card.turnOffPickyModeClicked`,moreDetailsClicked:`${f}-card.moreDetailsClicked`,fixSelected:`${f}-card.fixSelected`,languageChanged:`${f}-card.languageSwitched`,premiumClick:`${f}-card.premiumClick`,premiumTeaserClicked:`${f}-card.premiumTeaserClicked`,navigateError:`${f}-card.navigateError`,navigateSentence:`${f}-card.navigateSentence`,destroyed:`${f}-card.destroyed`,correctAll:`${f}-card.correctAll`,synonymSelected:`${f}-card.synonymSelected`,phraseSelected:`${f}-card.phraseSelected`,splitSentenceSelected:`${f}-card.splitSentenceSelected`,fixSentenceSelected:`${f}-card.fixSentenceSelected`,fixSentenceShowHightlight:`${f}-card.fixSentenceShowHightlight`,fixSentenceRemoveHightlight:`${f}-card.fixSentenceRemoveHightlight`,toggleMode:`${f}-card.toggleMode`,highlight:`${f}-card.highlight`,applyToolboxResult:`${f}-card.applyToolboxResult`,unlockSuggestion:`${f}-card.unlockSuggestion`};const C=T},
360"./content/ceElementInspector.ts":
361/*!***************************************!*\
362  !*** ./content/ceElementInspector.ts ***!
363  \***************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CEElementInspector:()=>i});var s=n(/*! ../common/utils */"./common/utils.ts"),r=n(/*! ./domWalker */"./content/domWalker.ts");
364/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
365class i{static _replaceLineBreaks(e){return e.replace(i.LINE_BREAKS_REGEXP," ")}static _joinWhitespaces(e){return e.replace(i.WHITESPACE_REGEXP," ")}static _isBlankString(e){return!e.trim()}constructor(e,t,n){if(this._ceElement=e,this._parsingDetector=t,this._cacheInvalidationRules=n||{},this._enableCache=!!n,this._enableCache){this._nodePropertiesCache={isTextNode:{propertyName:"isTextNode",map:new WeakMap},isElementNode:{propertyName:"isElementNode",map:new WeakMap},computedStyle:{propertyName:"computedStyle",map:new WeakMap},isSkippingElement:{propertyName:"isSkippingElement",map:new WeakMap},replacementText:{propertyName:"replacementText",map:new WeakMap},isBr:{propertyName:"isBr",map:new WeakMap},isListItem:{propertyName:"isListItem",map:new WeakMap},isBlock:{propertyName:"isBlock",map:new WeakMap},parsingOptions:{propertyName:"parsingOptions",map:new WeakMap},parsedText:{propertyName:"parsedText",map:new WeakMap},blockParent:{propertyName:"blockParent",map:new WeakMap},paragraphLastValuableNode:{propertyName:"paragraphLastValuableNode",map:new WeakMap},isBRElementRelevant:{propertyName:"isBRElementRelevant",map:new WeakMap},isTextEndsWithLineBreak:{propertyName:"isTextEndsWithLineBreak",map:new WeakMap},hasText:{propertyName:"hasText",map:new WeakMap},isParagraphNonEmpty:{propertyName:"isParagraphNonEmpty",map:new WeakMap}},this.isTextNode=this.createCachedMethod(this.isTextNode,"isTextNode"),this.isElementNode=this.createCachedMethod(this.isElementNode,"isElementNode"),this.getComputedStyle=this.createCachedMethod(this.getComputedStyle,"computedStyle"),this.isSkippingElement=this.createCachedMethod(this.isSkippingElement,"isSkippingElement"),this.getReplacementText=this.createCachedMethod(this.getReplacementText,"replacementText"),this.isBr=this.createCachedMethod(this.isBr,"isBr"),this.isListItem=this.createCachedMethod(this.isListItem,"isListItem"),this.isBlock=this.createCachedMethod(this.isBlock,"isBlock"),this.getParsingOptions=this.createCachedMethod(this.getParsingOptions,"parsingOptions"),this.getParsedText=this.createCachedMethod(this.getParsedText,"parsedText"),this.getBlockParent=this.createCachedMethod(this.getBlockParent,"blockParent"),this.getParagraphLastValuableNode=this.createCachedMethod(this.getParagraphLastValuableNode,"paragraphLastValuableNode"),this.isBRElementRelevant=this.createCachedMethod(this.isBRElementRelevant,"isBRElementRelevant"),this.isTextEndsWithLineBreak=this.createCachedMethod(this.isTextEndsWithLineBreak,"isTextEndsWithLineBreak"),this.hasText=this.createCachedMethod(this.hasText,"hasText"),this.isParagraphNonEmpty=this.createCachedMethod(this.isParagraphNonEmpty,"isParagraphNonEmpty"),this._onCEElementChange=this._onCEElementChange.bind(this),this._ceElementObserver=this._parsingDetector.createMutationObserver(this._onCEElementChange);const e={attributes:!0,characterData:!0,childList:!0,subtree:!0};this._ceElementObserver.observe(this._ceElement,e)}}createCachedMethod(e,t){const n=this._nodePropertiesCache[t];return t=>{let s=n.map.get(t);return void 0===s&&(s=e.call(this,t),n.map.set(t,s)),s}}_deleteCacheForNode(e){const t=Object.values(this._nodePropertiesCache);if(t.forEach((t=>t.map.delete(e))),!this.isTextNode(e)){const n=r.DOMWalker.create(e);for(;n.next();)t.forEach((e=>e.map.delete(n.currentNode)))}}_checkRuleConditions(e,t){if(!e)return!1;switch(t.type){case"attributes":return!!e.attributes&&(0===e.attributes.length||e.attributes.includes(t.attributeName));case"characterData":return!!e.characterData;case"childList":return!!e.childList}return!1}_onCEElementChange(e){for(const t of e){const e=t.target;if(!this._ceElement.contains(e)){this._deleteCacheForNode(e);continue}
365"childList"===t.type&&t.removedNodes.forEach((e=>this._deleteCacheForNode(e)));const n=this.getBlockParent(e);for(const[s,i]of Object.entries(this._cacheInvalidationRules)){const o=this._nodePropertiesCache[s];if(this._checkRuleConditions(i.any,t))o.map=new WeakMap;else{if(this._checkRuleConditions(i.self,t)&&o.map.delete(e),this._checkRuleConditions(i.parent,t))for(let t=0;t<e.childNodes.length;t++)o.map.delete(e.childNodes[t]);if(this._checkRuleConditions(i.ancestor,t)){const t=r.DOMWalker.create(e);for(;t.next();)o.map.delete(t.currentNode)}if(this._checkRuleConditions(i.descendant,t)){let t=e.parentElement;for(;t&&t!==this._ceElement;)o.map.delete(t),t=t.parentElement}if(this._checkRuleConditions(i.sibling,t)){const t=e.parentElement;if(t)for(let e=0;e<t.childNodes.length;e++)o.map.delete(t.childNodes[e])}if(this._checkRuleConditions(i.blockSibling,t)){const e=r.DOMWalker.create(n);for(;e.next();)o.map.delete(e.currentNode)}}}}}_hasTextBefore(e,t){let n=e.previousSibling;for(;n&&this.isTextNode(n);){const e=this.getParsingOptions(n),t=this.getParsedText(n);if(e.preserveWhitespaces&&t||!i._isBlankString(t))return!0;n=n.previousSibling}const s=r.DOMWalker.create(t);let o=!1,a=!1;for(;s.next(o);){const t=s.currentNode;if(o=!1,this.isElementNode(t)){if(t===e)break;this.getReplacementText(t)&&(a=!0),this.isSkippingElement(t)?o=!0:this.isBlock(t)&&(a=!1,o=!0)}else if(this.isTextNode(t)){const e=this.getParsingOptions(t),n=this.getParsedText(t);(e.preserveWhitespaces&&n||!i._isBlankString(n))&&(a=!0)}}return a}invalidateCache(){this._ceElementObserver&&this._onCEElementChange(this._ceElementObserver.takeRecords())}isTextNode(e){return(0,s.isTextNode)(e)}isElementNode(e){return(0,s.isElementNode)(e)}getComputedStyle(e){return self.getComputedStyle(e)}isSkippingElement(e){return this._ceElement!==e&&(this._parsingDetector.isIgnored(e,this.getComputedStyle(e))||this._parsingDetector.isSignature(e)||this._parsingDetector.isQuote(e))}getReplacementText(e){const t=this.getComputedStyle(e),n=this._parsingDetector.isIgnored(e,t);return this._parsingDetector.getReplacementText(e,n,t)}isBr(e){return"BR"===e.tagName}isListItem(e){return this._parsingDetector.isListItem(e,this.getComputedStyle(e))}isBlock(e){return this._parsingDetector.isBlock(e,this.getComputedStyle(e))}getParsingOptions(e){const t=this.isElementNode(e)?e:e.parentNode;if(this._parsingDetector.getParsingOptions)return this._parsingDetector.getParsingOptions(t);const n=this.getComputedStyle(t).whiteSpace||"";return{element:t,preserveLineBreaks:i.PRESERVE_LINEBREAKS_VALUES.includes(n),preserveWhitespaces:i.PRESERVE_WHITESPACES_VALUES.includes(n)}}getParsedText(e){const t=this.getParsingOptions(e);let n=e.nodeValue;return t.preserveLineBreaks||(n=i._replaceLineBreaks(n)),n=this._parsingDetector.sanitizeText(n,e,t.element),t.preserveWhitespaces||(n=i._joinWhitespaces(n)),n}isReplaceableCharsPair(e,t){return" "===e&&"\n"===t||this._parsingDetector.isReplaceableCharsPair(e,t)}isSkippableChar(e){return" "===e||"\n"===e||this._parsingDetector.isSkippableChar(e)}getBlockParent(e){let t=this.isElementNode(e)?e:e.parentElement;for(;t!==this._ceElement&&!this.isBlock(t);)t=t.parentElement;return t}getParagraphLastValuableNode(e){const t=this.getBlockParent(e),n=r.DOMWalker.create(t,e);let s=!1,o=null;do{const e=n.currentNode;if(s=!1,this.isElementNode(e))if(this.getReplacementText(e)&&(o=e),this.isSkippingElement(e))s=!0;else{if(this.isBlock(e))return o;if(this.isBr(e))return o}else if(this.isTextNode(e)){const t=this.getParsingOptions(e),n=this.getParsedText(e);(t.preserveWhitespaces&&n||!i.BLANK_STRING_REGEXP.test(n))&&(o=e)}}while(n.next(s));return o}isBRElementRelevant(e){const t=this.getBlockParent(e),n=r.DOMWalker.create(t,e);let s,o=!1;for(;n.next(o);){const r=n.currentNode;if(o=!1,this.isElementNode(r)){if(this.getReplacementText(r))return!0;if(this.isSkippingElement(r))o=!0;else{if(this.isBr(r))return!0;if(this.isBlock(r)&&(void 0===s&&(s=this._hasTextBefore(e,t)),s))return!1}}else if(this.isTextNode(r)){const e=this.getParsingOptions(r),t=this.getParsedText(r);
365if(e.preserveWhitespaces&&t||!i._isBlankString(t))return!0}}return void 0===s&&(s=this._hasTextBefore(e,t)),!s}isTextEndsWithLineBreak(e){const t=r.DOMWalker.create(this._ceElement,e);let n=!!(0,s.isElementNode)(e)&&this.isSkippingElement(e),o=!1;for(;t.next(n);){const r=t.currentNode;if(n=!1,this.isElementNode(r)){if(this.getReplacementText(r)){const t=this.getBlockParent(e);return!(0,s.contains)(t,r)}if(this.isSkippingElement(r))n=!0;else if(this.isBlock(r)){if(this.isParagraphNonEmpty(r))return!0;o=!0}else if(this.isBr(r)&&this.isBRElementRelevant(r)){if(o)return!0;const t=this.getBlockParent(e);return!(0,s.contains)(t,r)}}else if(this.isTextNode(r)){const t=this.getParsingOptions(r),n=this.getParsedText(r);if(t.preserveWhitespaces&&n||!i._isBlankString(n)){if(o)return!0;{const t=this.getBlockParent(e);return!(0,s.contains)(t,r)}}}}return!1}hasText(e){const t=r.DOMWalker.create(e);let n=!1;for(;t.next(n);){const e=t.currentNode;if(n=!1,this.isElementNode(e)){if(this.getReplacementText(e))return!0;this.isSkippingElement(e)&&(n=!0)}else if(this.isTextNode(e)){const t=this.getParsingOptions(e),n=this.getParsedText(e);if(t.preserveWhitespaces&&n||!i._isBlankString(n))return!0}}return!1}isParagraphNonEmpty(e){const t=r.DOMWalker.create(e);let n=!1;for(;t.next(n);){const e=t.currentNode;if(n=!1,this.isElementNode(e)){if(this.getReplacementText(e))return!0;if(this.isSkippingElement(e))n=!0;else{if(this.isBlock(e))return!1;if(this.isBr(e)&&this.isBRElementRelevant(e))return!0}}else if(this.isTextNode(e)){const t=this.getParsingOptions(e),n=this.getParsedText(e);if(t.preserveWhitespaces&&n||!i._isBlankString(n))return!0}}return!1}destroy(){this._ceElementObserver&&this._ceElementObserver.disconnect()}}i.DISPLAY_BLOCK_VALUES=["block","list-item","table","table-caption","table-row","table-cell","flex","grid","flow-root"],i.SKIPPING_TAGS=["CODE","NOSCRIPT","OBJECT","SCRIPT","STYLE","TEMPLATE","VAR","CANVAS","IMG","SVG","SELECT"],i.PRESERVE_LINEBREAKS_VALUES=["pre","pre-wrap","pre-line","break-spaces"],i.PRESERVE_WHITESPACES_VALUES=["pre","pre-wrap","break-spaces"],i.LINE_BREAKS_REGEXP=/\n/g,i.WHITESPACE_REGEXP=/  +/g,i.BLANK_STRING_REGEXP=/^[ \uFEFF]*$/,i.SUP_REGEXP=/^[\[\(]?\d+[\]\)]?/},
365"./content/ceElementWrapper.ts":
366/*!*************************************!*\
367  !*** ./content/ceElementWrapper.ts ***!
368  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CEElementWrapper:()=>m});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),r=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),i=n(/*! ../common/editors/ckEditor */"./common/editors/ckEditor.ts"),o=n(/*! ../common/utils */"./common/utils.ts"),a=n(/*! ../core/utils */"./core/utils.ts"),l=n(/*! ./ceElementInspector */"./content/ceElementInspector.ts"),c=n(/*! ./domWalker */"./content/domWalker.ts"),d=n(/*! ./eventMuffler */"./content/eventMuffler.ts"),h=n(/*! ./inputAreaWrapper */"./content/inputAreaWrapper.ts"),u=n(/*! ../init/config */"./init/config.ts"),g=n(/*! ../common/editors/proseMirror */"./common/editors/proseMirror.ts");
369/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
370class m extends h.InputAreaWrapper{static _simulateMouseDown(e,t){const n=new MouseEvent("mousedown",{clientX:t.x,clientY:t.y+t.height/2,bubbles:!0,cancelable:!0,buttons:1,button:0,which:1,detail:1});return e.dispatchEvent(n)}static _simulateMouseUp(e,t){const n=new MouseEvent("mouseup",{clientX:t.x+t.width,clientY:t.y+t.height/2,bubbles:!0,cancelable:!1,buttons:0,button:0,which:1,detail:1});return e.dispatchEvent(n)}static _simulateMouseMove(e,t,n=!1){const s={bubbles:!0,cancelable:!1,clientX:t.x+t.width,clientY:t.y+t.height/2};n&&(s.buttons=1);const r=new MouseEvent("mousemove",s);return e.dispatchEvent(r)}static _simulateBackspaceDown(e){const t=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,keyCode:8,which:8,location:0,key:"Backspace"});return e.dispatchEvent(t)}static _simulateBackspaceUp(e){const t=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,keyCode:8,which:8,location:0,key:"Backspace"});return e.dispatchEvent(t)}constructor(e,t,n){super(e,t,n),this._onClick=e=>{const t={inputAreaWrapper:this};(0,o.dispatchCustomEvent)(document,h.InputAreaWrapper.eventNames.click,t)},this._onDblClick=e=>{this._dispatchDblClickEvent(this._inputArea,e.clientX,e.clientY)},this._onScroll=e=>{const t=(0,o.isElement)(e.target)?e.target:this._inputArea;let n=0,s=0;if("BODY"===t.nodeName?(n=document.body&&document.body.scrollTop||document.documentElement&&document.documentElement.scrollTop||0,s=document.body&&document.body.scrollLeft||document.documentElement&&document.documentElement.scrollLeft||0):(n=t.scrollTop,s=t.scrollLeft),this._scrollTop===n&&this._scrollLeft===s)return;this._scrollTop=n,this._scrollLeft=s;const r={inputAreaWrapper:this};(0,o.dispatchCustomEvent)(document,h.InputAreaWrapper.eventNames.scroll,r)},this._ceElementInspector=new l.CEElementInspector(e,this._tweaks.getParsingDetector(),this._tweaks.getCacheInvalidationRules()),this._scrollTop=this._inputArea.scrollTop,this._scrollLeft=this._inputArea.scrollLeft,this._updateText(),this._inputArea.addEventListener("dblclick",this._onDblClick),this._inputArea.addEventListener("click",this._onClick),this._tweaks.addScrollEventListener(this._onScroll),this._inputAreaObserver=this._tweaks.createMutationObserver(this._onInput),h.InputAreaWrapper._isWritingContextEnabled&&this._tweaks.createSurroundingTextContextObserver(this._debouncedOnSurroundingTextContextChange),this._inputAreaObserver.observe(this._inputArea,m.INPUT_AREA_OBSERVER_CONFIG)}_hasSpaceBefore(e){if(e<=0)return!1;const t=this.getTextRanges(e-1,1)[0];return Boolean(t&&t.node.nodeValue&&m.VISIBLE_WHITE_SPACE_REGEXP.test(t.node.nodeValue.substring(t.start,t.end)))}_hasSpaceAfter(e){const t=this.getTextRanges(e,1)[0];return Boolean(t&&t.node.nodeValue&&m.VISIBLE_WHITE_SPACE_REGEXP.test(t.node.nodeValue.substring(t.start,t.end)))}_offsetInRawText(e,t,n){n=Math.min(e.length,n);let s=0,r=0;do{const i=e[s],o=t[r];if(i===o)r++;else if(this._ceElementInspector.isReplaceableCharsPair(o,i))r++;else if(!this._ceElementInspector.isSkippableChar(i))break;if(r>n)break;s++}while(s<e.length);return s}_offsetInParsedText(e,t,n){let s=0,r=0;for(;s<n;){const n=e[s],i=t[r];
370if(n===i)r++;else if(this._ceElementInspector.isReplaceableCharsPair(i,n))r++;else if(!this._ceElementInspector.isSkippableChar(n))break;s++}return r}_updateText(){const e=[];let t=0,n=null,s=!0,r=!1,i=!1;const l=c.DOMWalker.create(this._inputArea);let d=!1;do{const c=l.currentNode;null===n&&(n=this._ceElementInspector.getParagraphLastValuableNode(c)),d=!1;let g=!1,p="";if((0,o.isElementNode)(c))if(p=this._ceElementInspector.getReplacementText(c),!p&&this._ceElementInspector.isListItem(c)&&(p=u.default.get(u.ConfigKey.BULLET_POINT_PARSING_PREFIX),this._ceElementInspector.hasText(c)||(p+=h.InputAreaWrapper.PARAGRAPH_SEPARATOR)),s=s&&""===p,r=(0,a.isEndsWithWhitespace)(p),c===n&&(n=null,this._ceElementInspector.isTextEndsWithLineBreak(c)&&(s=!0,r=!1,p+=h.InputAreaWrapper.PARAGRAPH_SEPARATOR)),this._ceElementInspector.isSkippingElement(c)){if(d=!0,n=null,!p)continue}else this._ceElementInspector.isBlock(c)?(n=null,s=!0,r=!1):this._ceElementInspector.isBr(c)&&(n=null,s=!0,r=!1,!p&&this._ceElementInspector.isBRElementRelevant(c)&&(p="\n"));else if((0,o.isTextNode)(c)&&(g=!0,p=this._ceElementInspector.getParsedText(c),p)){const e=null===n||n===c;this._ceElementInspector.getParsingOptions(c).preserveWhitespaces||((s||r)&&(p=p.replace(m.LEADING_WHITESPACES_REGEXP,"")),e&&(p=p.replace(m.TRAILING_WHITESPACES_REGEXP,""))),s=s&&""===p,r=(0,a.isEndsWithWhitespace)(p),c===n&&(n=null,this._ceElementInspector.isTextEndsWithLineBreak(c)&&(s=!0,r=!1,p+=h.InputAreaWrapper.PARAGRAPH_SEPARATOR))}const _=g?c.nodeValue:"";if(e.push({node:c,isTextNode:g,rawText:_,parsedText:p,parsedTextOffset:t}),t+=p.length,this.hasReachedMaxTextLength(e)){i=!0;break}}while(l.next(d));let g="";for(const t of e)g+=t.parsedText;const p=this._text!==g||this._isTextTooLong!==i;return this._text=g,this._textChunks=e,this._isTextTooLong=i,p}_getTextPosition(e){const t=this._getTextChunkIndex(e);if(-1===t)return null;const n=this._textChunks[t];return e-=n.parsedTextOffset,{textNode:n.node,offset:this._offsetInRawText(n.rawText,n.parsedText,e)}}_getRangeFromTextSelection(e,t){const n=this.getTextRanges(e,t);if(n.length)try{const e=new Range;return e.setStart(n[0].node,n[0].start),e.setEnd(n[n.length-1].node,n[n.length-1].end),e}catch{}}_getTextOffset(e,t){if(e===this._inputArea&&-1===t)return-1;let n=null,s=0,r=!1;if((0,o.isElementNode)(e)){const s=c.DOMWalker.create(this._inputArea);do{const i=s.currentNode;if(this._textChunks.find((e=>e.node===i))&&(n=i),i===e.childNodes[t]){r=n!==i;break}}while(s.next());if(!n)return-1}else(0,o.isTextNode)(e)&&(n=e,s=t);const i=this._textChunks.find((e=>e.node===n));return i?i.parsedTextOffset+(r?i.parsedText.length:this._offsetInParsedText(i.rawText,i.parsedText,s)):-1}async simulateDelete(){if(m._simulateBackspaceDown(this._inputArea)){const e=new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteContentBackward"});let t=!0;"deleteContentBackward"===e.inputType&&!r.BrowserDetector.isSafari()&&(t=this._inputArea.dispatchEvent(e)),t&&document.execCommand("delete",!1)}await(0,o.wait)(),m._simulateBackspaceUp(this._inputArea),await(0,o.wait)()}async insertText({html:e,text:t,range:n},r=!1){const i=this.getFocussedElement(),a=r?m.TREATMENT_WAIT_TIME_AFTER_INSERTING_TEXT:void 0;e?await(0,o.insertHtmlByPaste)(this.getFocussedElement(),{"text/html":e,"text/plain":t},n,a):await(0,s.insertTextIntoContentEditable)(i,t,n,a)}async _selectText(e,t,n,s){this.focus();const r=e.ownerDocument.createRange();r.setStart(e,t),r.setEnd(e,t);const i=r.getBoundingClientRect(),a=n.ownerDocument.createRange();a.setStart(n,s),a.setEnd(n,s);const l=a.getBoundingClientRect(),c=e.parentElement||this._inputArea,d=n.parentElement||this._inputArea;m._simulateMouseDown(c,i),m._simulateMouseMove(c,i,!0);const h=n.nodeValue?.length??0;t=Math.max(t,0),s=Math.min(s,h),g.ProseMirror.isEditor(this._inputArea)&&await(0,o.wait)(0);const u=self.getSelection(),p=e.ownerDocument.createRange();return p.setStart(e,t),p.setEnd(n,s),u?.removeAllRanges(),u?.addRange(p),g.ProseMirror.isEditor(this._inputArea)&&await(0,o.wait)(0),m._simulateMouseMove(d,l,!0),m._simulateMouseUp(d,l),p}resetText(){this._inputAreaObserver.disconnect();const e=c.DOMWalker.create(this._inputArea);do{const t=e.currentNode;(0,o.isTextNode)(t)&&(t.textContent=t.textContent)}while(e.next());this._inputAreaObserver.observe(this._inputArea,m.INPUT_AREA_OBSERVER_CONFIG)}findReplacementPosition(e,t,n){return""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1),{offset:e,length:t}}async replaceText(e,t,n,s=!1){if(e<0)return Promise.resolve();const r=this.getParagraphTextRanges(e,t),i=n.split(h.InputAreaWrapper.PARAGRAPH_SEPARATOR);r.length===i.length&&i.length>1?await this._replaceParagraphs(r,i):await this._replacePhrase(e,t,n,s),this.simulateChange(),this.simulateKeyUp()}async _replaceParagraphs(e,t){for(let n=0;n<t.length;n++){let s=t[n];const r=e[n];if(!s.trim())continue;const i=u.default.get(u.ConfigKey.BULLET_POINT_PARSING_PREFIX);i&&s.startsWith(i)&&r.textRanges[0]&&r.textRanges[0].node.parentElement?.closest("li")&&(s=s.slice(i.length)),await this._replaceTextRanges(r.textRanges,s)}}async _replacePhrase(e,t,n,s=!1){const r=e+n.length;""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1);const i=this.getTextRanges(e,t);if(!i.length)return Promise.resolve();await this._replaceTextRanges(i,n,s),await this.setSelection({start:r})}async _replaceTextRanges(e,t,n=!1){await(0,o.wait)(n?m.TREATMENT_WAIT_TIME_BEFORE_SELECTION:m.DEFAULT_WAIT_TIME_BEFORE_SELECTION);const s=e[0],a=e[e.length-1],l=await this._selectText(s.node,s.start,a.node,a.end),c=s===a&&s.start===a.end,h=new d.EventMuffler(["mouseout","mouseover","mousemove","mousedown","mouseup","pointerout","pointerover","pointermove","pointerdown","pointerup","click","dblclick"]);try{h.mute(),await(0,o.wait)(this._tweaks.getDelayBeforeInsertingText())}finally{h.unmute()}if((0,o.isGutenberg)(this._inputArea)&&m.SMART_QUOTES.includes(t))await this.simulateDelete(),await this.insertText({text:t,range:l});else if(t||c)if((0,o.isOpenXchangeEditor)(this._inputArea)||(0,o.isOdooEditor)(this._inputArea))(0,o.simulatePaste)(this._inputArea,{"text/plain":t});else if(0===s.start&&t.includes(" ")&&t.length>1&&(0,o.isDraftJS)(this._inputArea)){const e=t.split(" "),n=e[0],s=" "+e.slice(1).join(" ");await this.insertText({text:n}),await this.insertText({text:s})}else(r.BrowserDetector.isSafari()||r.BrowserDetector.isFirefox())&&(0,o.isTrixEditor)(this._inputArea)?(0,o.simulatePaste)(this._inputArea,{"text/plain":t}):r.BrowserDetector.isSafari()&&i.CKEditor.isVersion5(this._inputArea)?(await(0,o.wait)(50),(0,o.simulatePaste)(this._inputArea,{"text/plain":t})):await this.insertText({text:t,range:l},n);else await(0,o.wait)(0),await this.simulateDelete();await(0,o.wait)(0)}getFocussedElement(){const e=this._inputArea.querySelector("[contenteditable]:focus");return e||this._inputArea}async insertImage(e){if(!Object.keys(e).find((e=>e.startsWith("image/"))))throw new Error("Expected to get an image to paste; but not find one.");const t=this.getFocussedElement();await(0,s.simulatePasteImage)(t,e)||await this.insertText({text:e["text/plain"]})}_trimSelectionEnd(e){if(!e.endNode)return e;if((0,o.isTextNode)(e.endNode)&&e.endNode!==e.startNode&&0===e.startOffset&&0===e.endOffset){const t=(0,o.getPreviousTextNode)(e.endNode,this._inputArea);t&&(e.endNode=t,e.endOffset=t.data.trim().length)}return e}getSelection(e=!1){let t=this._tweaks.getSelection();if(!t?.startNode)return null;if(e&&(t=this._trimSelectionEnd(t)),!this._inputArea.contains(t.startNode))return null;const n=this._getTextOffset(t.startNode,t.startOffset);return{start:n,end:t.isCollapsed||!t.endNode?n:this._getTextOffset(t.endNode,t.endOffset)}}setSelection(e){const t=e.start,n=void 0===e.end?t:e.end;this.focus();const s=this._getTextPosition(t);
370if(!s)return;const r=self.getSelection();r.removeAllRanges();const i=new Range;if(i.setStart(s.textNode,s.offset),t!==n){const e=this._getTextPosition(n);if(!e)return;i.setEnd(e.textNode,e.offset)}else i.collapse(!1);r.addRange(i)}getWordAtPoint(e,t){const n=(0,o.getRangeAtPoint)({x:e,y:t});if(!n||!this._inputArea.contains(n.startContainer))return null;const s=n.getBoundingClientRect();if(!(Math.abs(s.left-e)<30&&(Math.abs(s.top-t)<30||Math.abs(s.bottom-t)<30)))return null;const r=this._getTextOffset(n.startContainer,n.startOffset),i=this.getText();return(0,a.getWordPosition)(i,r,r)||(0,a.getNumberPosition)(i,r)}scrollToText(e,t,n="smooth",s="nearest",r=!1,i,o=140,a=140){if(e<0)return;if(r&&this.isTextRangeInViewport(e,t))return void i?.();this._isScrollingProgrammatically=!0;let l=!1;const c=()=>{self.removeEventListener("wheel",c),setTimeout((()=>{l||(this._isScrollingProgrammatically=!1,l=!0,i?.())}),50)},d=this._getRangeFromTextSelection(e,t);if(d)try{const e=d.getBoundingClientRect();if("smart"===s){if(e.top>o&&self.innerHeight-e.bottom>a)return void c();s="center"}self.addEventListener("wheel",c),self.scrollRangeIntoView(d,{behavior:n,block:s},c)}catch(e){}else i?.()}isTextRangeInViewport(e,t){if(!this.getTextRanges(e,t).length)return!1;const n=this._getRangeFromTextSelection(e,t);if(!n)return!1;const s=n.getBoundingClientRect(),r=this._inputArea.getBoundingClientRect();if(!(0,o.isRectsIntersect)(s,r))return!1;const i=n.getClientRects(),a=i[0],l=i[i.length-1],c={x:a.left+a.width/2,y:a.top+a.height/2},d={x:l.left+l.width/2,y:l.top+l.height/2},h=(0,o.getRangeAtPointExcludingSpecifiedElements)(c),u=(0,o.getRangeAtPointExcludingSpecifiedElements)(d);return Boolean(h&&this._inputArea.contains(h.commonAncestorContainer)&&u&&this._inputArea.contains(u.commonAncestorContainer))}focus(){if(!this._inputArea.querySelector(":focus")&&!this._inputArea.matches(":focus"))if((0,o.isCERootElement)(this._inputArea)&&"focus"in this._inputArea)this._inputArea.focus();else{const e=this._inputArea.querySelector("[contenteditable=''], [contenteditable=true]");e&&"focus"in e&&e.focus()}}destroy(){super.destroy(),this._inputArea.removeEventListener("dblclick",this._onDblClick),this._inputArea.removeEventListener("click",this._onClick),this._tweaks.removeScrollEventListener(this._onScroll),this._ceElementInspector.de
370stroy(),this._inputAreaObserver&&this._inputAreaObserver.disconnect()}}m.VISIBLE_WHITE_SPACE_REGEXP=/\u00A0|\u0020|\u2009|\u202F/,m.LEADING_WHITESPACES_REGEXP=new RegExp(/^ /),m.TRAILING_WHITESPACES_REGEXP=new RegExp(/ $/),m.SMART_QUOTES=["“","”","„","»","«"],m.INPUT_AREA_OBSERVER_CONFIG={attributeFilter:["id","class","style"],attributes:!0,characterData:!0,childList:!0,subtree:!0},m.DEFAULT_WAIT_TIME_BEFORE_SELECTION=50,m.TREATMENT_WAIT_TIME_BEFORE_SELECTION=0,m.TREATMENT_WAIT_TIME_AFTER_INSERTING_TEXT=0},
370"./content/checkStatus.ts":
371/*!********************************!*\
372  !*** ./content/checkStatus.ts ***!
373  \********************************/(e,t,n)=>{"use strict";
374/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
375var s;n.r(t),n.d(t,{CHECK_STATUS:()=>s}),function(e){e.PERMISSION_REQUIRED="PERMISSION_REQUIRED",e.TRIAL_ENDED="TRIAL_ENDED",e.DISABLED="DISABLED",e.DISCONNECTED="DISCONNECTED",e.TEXT_TOO_SHORT="TEXT_TOO_SHORT",e.TEXT_TOO_LONG="TEXT_TOO_LONG",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETED="COMPLETED",e.UNSUPPORTED_LANGUAGE="UNSUPPORTED_LANGUAGE",e.NEEDS_LANGUAGE_HINT="NEEDS_LANGUAGE_HINT",e.FAILED="FAILED"}(s||(s={}))},
375"./content/copyPasteTracker.ts":
376/*!*************************************!*\
377  !*** ./content/copyPasteTracker.ts ***!
378  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s,r=n(/*! ../core/utils */"./core/utils.ts"),i=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts");class o{static init(e){this._isInitialized||this._isDestroyed||(this._isInitialized=!0,this._storageController=e,this._observe())}static _observe(){document.addEventListener("copy",this._setCopyPasteInfo,!0),document.addEventListener("paste",this._trackCopyPasteInfo,!0)}static _clearCopyPasteInfo(){this._storageController.updateCopyPasteInfo({copiedAt:null,copiedFrom:null,copiedText:""})}static _prepareText(e){return(0,r.removeZWC)(e.slice(0,1e3)).trim()}static destroy(){this._isDestroyed=!0,document.removeEventListener("copy",this._setCopyPasteInfo,!0),document.removeEventListener("paste",this._trackCopyPasteInfo,!0)}}s=o,o._isInitialized=!1,o._isDestroyed=!1,o._setCopyPasteInfo=e=>{if(!e.isTrusted)return;const t=s._prepareText(e.target?.ownerDocument?.defaultView?.getSelection()?.toString()||""),n=(0,r.getMainPageDomain)();t&&!n.startsWith("about:")?s._storageController.updateCopyPasteInfo({copiedAt:Date.now(),copiedFrom:n,copiedText:t}):s._clearCopyPasteInfo()},o._trackCopyPasteInfo=e=>{if(e.isTrusted)try{const t=s._prepareText(e.clipboardData?.getData("text/plain")||"");if(!t)return;const n=s._storageController.getCopyPasteInfo(),o=(0,r.getMainPageDomain)();!o.startsWith("about:")&&n.copiedAt&&n.copiedFrom!==o&&Date.now()-n.copiedAt<6e4&&(0,r.getStringSimilarity)(n.copiedText,t)>.75&&i.TrackerAdapter.trackSampledEvent("Lollipop","copy_paste",`${n.copiedFrom} -> ${o}`,250),s._clearCopyPasteInfo()}catch(e){console.log("error tracking copy paste info",e)}};const a=o},
378"./content/debounce.ts":
379/*!*****************************!*\
380  !*** ./content/debounce.ts ***!
381  \*****************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Debounce:()=>s});
382/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
383class s{constructor(e,t=250,n=0){this.callImmediately=(e=!1)=>{this._args&&(this._wrappedFunc.metaArgs={isMaxDebounceCall:e,invokedAt:this._invokedAt??Date.now()},this._wrappedFunc(...this._args)),this.cancelCall()},this._wrappedFunc=e,this._wrappedFunc.metaArgs={isMaxDebounceCall:!1,invokedAt:0},this._delay=t,this._maxDelay=n,this._args=null,this._delayTimeoutId=null,this._maxDelayTimeoutId=null,this._invokedAt=null}call(...e){this.cancelCall(!0),this._args=e,this._invokedAt=Date.now(),this._delayTimeoutId=self.setTimeout((()=>this.callImmediately(!1)),this._delay),this._maxDelay>0&&null===this._maxDelayTimeoutId&&(this._maxDelayTimeoutId=self.setTimeout((()=>this.callImmediately(!0)),this._maxDelay))}cancelCall(e=!1){this._args=null,this._invokedAt=null,null!==this._delayTimeoutId&&(clearTimeout(this._delayTimeoutId),this._delayTimeoutId=null),e||null===this._maxDelayTimeoutId||(clearTimeout(this._maxDelayTimeoutId),this._maxDelayTimeoutId=null)}}},
383"./content/dialog.ts":
384/*!***************************!*\
385  !*** ./content/dialog.ts ***!
386  \***************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Dialog:()=>w});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),r=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),i=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),o=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),a=n(/*! ../common/i18nManager */"./common/i18nManager.ts"),l=n(/*! ../common/languageManager */"./common/languageManager.ts"),c=n(/*! ../common/storageController */"./common/storageController.ts"),d=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),h=n(/*! ../common/utils */"./common/utils.ts"),u=n(/*! ../components/icon/icon */"./components/icon/icon.ts"),g=n(/*! ../components/menu/menu */"./components/menu/menu.ts"),m=n(/*! ../components/packageBadge/packageBadge */"./components/packageBadge/packageBadge.ts"),p=n(/*! ../components/premiumTeaser/premiumTeaser */"./components/premiumTeaser/premiumTeaser.ts"),_=n(/*! ../components/ratingTeaser/ratingTeaser */"./components/ratingTeaser/ratingTeaser.ts"),E=n(/*! ../components/score/score */"./components/score/score.ts"),f=n(/*! ../components/select/select */"./components/select/select.ts"),T=n(/*! ../components/toggle/toggle */"./components/toggle/toggle.ts"),C=n(/*! ../config/config */"./config/config.ts"),v=n(/*! ../core/utils */"./core/utils.ts"),S=n(/*! ../init/config */"./init/config.ts"),b=n(/*! ../react/components/card-base/draggable */"./react/components/card-base/draggable.ts"),x=n(/*! ./checkStatus */"./content/checkStatus.ts"),y=n(/*! ./debounce */"./content/debounce.ts"),A=n(/*! ../common/trial */"./common/trial.ts");
387/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
388const k=S.default.get(S.ConfigKey.EXTN_PREFIX);class w{static _cacheMessages(e){w.MESSAGES={EXTENSION_UPDATED_HEADLINE:a.i18nManager.getMessage("extensionUpdatedHeadline"),EXTENSION_UPDATED_TEXT:a.i18nManager.getMessage("extensionUpdatedText",[`<${k}-span class='${k}-dialog__icon'></${k}-span>`]),INCOMPLETE_RESULT:a.i18nManager.getMessage("incompleteResult"),POWERED_BY:a.i18nManager.getMessage("poweredBy"),FEEDBACK:a.i18nManager.getMessage("sendFeedback"),DELETE:a.i18nManager.getMessage("deleteWord"),ENABLE_HEADLINE:a.i18nManager.getMessage("dialogEnableInDialogHeadline"),ENABLE_TEXT:a.i18nManager.getMessage("dialogEnableInDialogText"),ENABLE_EVERYWHERE_BUTTON:a.i18nManager.getMessage("enableEverywhereButton"),ENABLE_HERE_BUTTON:a.i18nManager.getMessage("enableHereButton"),OPTIONS_TITLE:a.i18nManager.getMessage("settingsHeadline"),NO_ERRORS:a.i18nManager.getMessage("noErrorsFound2"),NO_ERRORS_TEXT:a.i18nManager.getMessage("noErrorsFoundText"),TEXT_TOO_LONG_HEADLINE:a.i18nManager.getMessage("dialogTextTooLongHeadline"),TEXT_TOO_LONG_TEXT:a.i18nManager.getMessage("dialogTextTooLongText"),TEXT_TOO_LONG_PREMIUM_TEXT:a.i18nManager.getMessage("dialogTextTooLongPremiumText",[C.MAX_TEXT_LENGTH_PREMIUM.toLocaleString(e)]),SCROLL_HINT_HEADLINE:a.i18nManager.getMessage("dialogScrollHintHeadline"),SCROLL_HINT_TEXT:a.i18nManager.getMessage("dialogScrollHintText"),TEXT_TOO_LONG_BUTTON:a.i18nManager.getMessage("dialogTextTooLongButton"),TEXT_TOO_SHORT_TEXT:a.i18nManager.getMessage("dialogTextTooShortText"),TEXT_TOO_SHORT_HEADLINE:a.i18nManager.getMessage("dialogTextTooShortHeadline"),TEXT_SCORE_MENU_ITEM:a.i18nManager.getMessage("dialogMainMenuTextScore"),REGULAR_MISTAKE_MENU_ITEM:a.i18nManager.getMessage("dialogMainMenuRegularMistake"),PREMIUM_MISTAKE_MENU_ITEM:a.i18nManager.getMessage("dialogMainMenuPremiumMistake"),PICKY_MODE_MENU_ITEM:a.i18nManager.getMessage("dialogMainMenuPickyMode"),PICKY_MODE_MENU_ITEM_INFO:a.i18nManager.getMessage("dialogMainMenuPickyModeInfo"),COUNTER_CHARACTERS_OPTION:a.i18nManager.getMessage("dialogCounterCharactersOption"),COUNTER_WORDS_OPTION:a.i18nManager.getMessage("dialogCounterWordsOption"),COUNTER_SENTENCES_OPTION:a.i18nManager.getMessage("dialogCounterSentencesOption"),POSITION_DEFAULT_MENU_ITEM:a.i18nManager.getMessage("dialogPositionMenuDefault"),POSITION_RIGHT_MENU_ITEM:a.i18nManager.getMessage("dialogPositionMenuRight"),POSITION_LEFT_MENU_ITEM:a.i18nManager.getMessage("dialogPositionMenuLeft"),FAIL_STATE_HEADLINE:a.i18nManager.getMessage("dialogFailStateHeadline"),FAIL_STATE_TEXT:a.i18nManager.getMessage("dialogFailStateText"),HEADLINE_SPELLING_ERROR:a.i18nManager.getMessage("spellingError"),HEADLINE_CUSTOM_SUGGESTION_ERROR:a.i18nManager.getMessage("customSuggestionError"),HEADLINE_SUGGESTION_ERROR:a.i18nManager.getMessage("suggestionError"),HEADLINE_PUNCTUATION_ERROR:a.i18nManager.getMessage("punctuationError"),HEADLINE_GRAMMAR_ERROR:a.i18nManager.getMessage("grammarError"),SELECT_LANGUAGE_LABEL:a.i18nManager.getMessage("dialogSelectLanguageLabel"),UNSUPPORTED_LANGUAGE_LABEL:a.i18nManager.getMessage("dialogUnsupportedLanguageLabel"),UNSUPPORTED_LANGUAGE_HEADLINE:a.i18nManager.getMessage("dialogUnsupportedLanguageHeadline"),UNSUPPORTED_LANGUAGE_TEXT:a.i18nManager.getMessage("dialogUnsupportedLanguageText"),ALL_LANGUAGES:a.i18nManager.getMessage("dialogAllLanguages"),RECOMMENDED_LANGUAGES:a.i18nManager.getMessage("dialogRecommendedLanguages"),SCROLL_TO_LINK:a.i18nManager.getMessage("dialogScrollToLink"),SEND_FEEDBACK_TOOLTIP:a.i18nManager.getMessage("dialogTooltipSendFeedback"),HELP_TOOLTIP:a.i18nManager.getMessage("dialogTooltipHelp"),HELP_CENTER_TOOLTIP:a.i18nManager.getMessage("dialogTooltipHelpCenter"),IGNORE_RULE_TOOLTIP:a.i18nManager.getMessage("ignoreHere"),DISABLE_CHECKING_TOOLTIP:a.i18nManager.getMessage("dialogTooltipDisableChecking"),DISABLE_CHECKING_MENU_ITEM:a.i18nManager.getMessage("dialogDisableMenuDisableChecking"),PAUSE_CHECKING_MENU_ITEM:a.i18nManager.getMessage("dialogDisableMenuPauseChecking"),DIALOG_POSITION_TOOLTIP:a.i18nManager.getMessage("dialogTooltipPosition"),SETTINGS_TOOLTIP:a.i18nManager.getMessage("dialogTooltipSettings"),USER_STATISTICS_TOOLTIP:a.i18nManager.getMessage("dialogTooltipUserStatistics"),SAVE_TEXT_TOOLTIP:a.i18nManager.getMessage("dialogTooltipSaveText"),NEEDS_LANGUAGE_HINT_HEADLINE:a.i18nManager.getMessage("dialogNeedsLanguageHintHeadline"),NEEDS_LANGUAGE_HINT_TEXT:a.i18nManager.getMessage("dialogNeedsLanguageHintText"),NEEDS_LANGUAGE_HINT_IGNORE:a.i18nManager.getMessage("dialogNeedsLanguageHintIgnore"),TRIAL_ENDED_HEADLINE:a.i18nManager.getMessage("popupTrialEndedHeadline"),TRIAL_ENDED_TEXT:a.i18nManager.getMessage("popupTrialEndedDescription"),TRIAL_ENDED_BUTTON:a.i18nManager.getMessage("dialogTextTooLongButton"),LANGUAGES:l.LanguageManager.SUPPORTED_LANGUAGES}}static init(e){w._isInitialized||(w._cacheMessages(l.LanguageManager.getUserLanguageCode()),w._isInitialized=!0,e?.customRender&&(w._customRender=e.customRender),e?.customDragHandleRender&&(w._customDragHandleRender=e.customDragHandleRender))}constructor({toolbarContainer:e,appearence:t,languageCode:n,state:s,uiOptions:r,backdropRoot:i}){this._menus=[],this._allDisplyedErrorsCount=0,this._dragInstance=null,this._isDialogVisible=()=>o.EnvironmentAdapter.isRuntimeConnected()&&this._appearance.isPositionVisible(),this._getCorrectPosition=(e=null)=>{const t=this._controls.container.ownerDocument.body.offsetWidth;return this._isDialogVisible()&&t>400?e||this._uiOptions.dialogPosition:"default"},this._isSmallSize=()=>!this._appearance.canDisplayAllSuggestions(),this._toolbarContainer=e,this._appearance=t,this._uiOptions=r,this._document=this._toolbarContainer.ownerDocument,this._languageCode=n,this._onCloseClick=this._onCloseClick.bind(this),this._onUnload=this._onUnload.bind(this),self.addEventListener("pagehide",this._onUnload,!0),this._controls={},this._eventListeners=[],this._backdropRoot=i,this._render().then((()=>{this.setCurrentLanguage(n||l.LanguageManager.getUserLanguageCode()),this.updateState(s),"coordinates"===r.dialogPosition&&this._moveToInitialPosition()})),this._eventListeners.push((0,h.addUseCaptureEvent)(document,"keydown",this._onKeydown.bind(this))),this._inApplyFixMo
388de=!1,this._inInsignificantChangeMode=!0,this._shouldShowRatingTeaser=!s.displayedPremiumErrors.length&&!this._controls.teaserElement&&!this._uiOptions.disableRatingTeaser&&o.EnvironmentAdapter.isRuntimeConnected()}async _render(){if(this._controls.container)return;if(w._customRender){this._createContainerLayout(),this._destroyCustomRender=w._customRender({context:this,root:this._controls.container,mountInNode:this._controls.content,getDragInstance:()=>this._dragInstance,position:this._getCorrectPosition(this._uiOptions.dialogPosition),isSmallSize:this._isSmallSize});const e=this._uiOptions.draggable&&"coordinates"===this._getCorrectPosition(this._uiOptions.dialogPosition)?this._getDraggableMountNode():this._getNonDraggableMountNode();return void this._mountDialogInDOM(e)}this._controls.container=(0,h.createContainerElement)(this._document,w.CONTAINER_ELEMENT_NAME);const e=e=>{e.stopImmediatePropagation()};this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.container,"mousedown",(t=>{t.target===this._controls.languageSelector.getSelect()&&(document.addEventListener("blur",e,!0),setTimeout((()=>{document.removeEventListener("blur",e,!0)}),10)),t.target===this._controls.countSelector.getSelect()&&(document.addEventListener("blur",e,!0),setTimeout((()=>{document.removeEventListener("blur",e,!0)}),10)),t.target instanceof HTMLElement&&t.target.closest("[data-lt-prevent-focus]")&&t.preventDefault(),e(t)})),(0,h.addUseCaptureEvent)(this._controls.container,"mouseup",e),(0,h.addUseCaptureEvent)(this._controls.container,"pointerdown",e),(0,h.addUseCaptureEvent)(this._controls.container,"pointerup",e),(0,h.addUseCaptureEvent)(this._controls.container,"focusin",e),(0,h.addUseCaptureEvent)(this._controls.container,"focusout",e),(0,h.addUseCaptureEvent)(this._controls.container,"click",(e=>{e.preventDefault(),e.stopPropagation()}))),this._controls.innerContainer=this._document.createElement(`${k}-div`),this._controls.innerContainer.classList.add(`${k}-dialog__container`,"notranslate"),this._uiOptions.dialogWidth&&this._controls.innerContainer.style.setProperty("width",`${this._uiOptions.dialogWidth}px`,"important"),r.BrowserDetector.isSafari()&&this._controls.innerContainer.classList.add(`${k}-dialog__container--safari`),this._appearance.canDisplayAllSuggestions()||this._controls.innerContainer.classList.add(`${k}-dialog__container--small`),this._controls.container.appendChild(this._controls.innerContainer),this._controls.header=this._document.createElement(`${k}-div`),this._controls.header.className=`${k}-dialog__header`,this._controls.innerContainer.appendChild(this._controls.header);const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__header__logo-wrapper`,this._controls.logo=this._document.createElement(`${k}-div`),this._controls.logo.classList.add(`${k}-dialog__logo`,`${k}-icon__lt`),t.appendChild(this._controls.logo),this._uiOptions.isPremium||A.Trial.isFunctionalityLocked()||(this._controls.packageBadge=new m.PackageBadge(null,"basic","default",t),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.packageBadge.getElement(),"click",this._onBadgeClicked.bind(this)))),this._controls.header.appendChild(t),this._controls.headerScoreProgress=this._document.createElement(`${k}-div`),this._controls.headerScoreProgress.className=`${k}-dialog__header__progress-score`,this._controls.header.appendChild(this._controls.headerScoreProgress),this._controls.headerScoreProgressBar=this._document.createElement(`${k}-div`),this._controls.headerScoreProgressBar.className=`${k}-dialog__header__progress-score__bar`,this._controls.headerScoreProgress.appendChild(this._controls.headerScoreProgressBar),this._controls.headerControlsWrapper=this._document.createElement(`${k}-div`),this._controls.headerControlsWrapper.className=`${k}-dialog__header__controls-wrapper`;const n=this._document.createElement("select");if(w.MESSAGES.LANGUAGES.forEach((e=>{const t=this._document.createElement("option");t.value=e.code,t.textContent=e.name,n.appendChild(t)})),o.EnvironmentAdapter.isRuntimeConnected()){const e=await o.EnvironmentAdapter.getPreferredLanguages();if(!n||!e.length)return;const t=n.value,s=this._document.createElement("optgroup");
388s.label=w.MESSAGES.ALL_LANGUAGES,Array.from(n.children).forEach((e=>{s.append(e)}));const r=this._document.createElement("optgroup");r.label=w.MESSAGES.RECOMMENDED_LANGUAGES,e.forEach((e=>{const t=l.LanguageManager.SUPPORTED_LANGUAGES.find((t=>t.code.startsWith(e.toLowerCase())));if(t){const e=this._document.createElement("option");e.value=t.code,e.textContent=t.name,r.appendChild(e)}})),n.append(r),n.append(s),n.value=t}if(this._controls.languageSelector=new f.Select("language-select",this._controls.headerControlsWrapper,n),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.languageSelector.getSelect(),"change",this._onLanguageChange.bind(this))),this._isDialogVisible()){const e=this._document.createElement(`${k}-div`);e.className=`${k}-icon-group`,this._controls.headerControlsWrapper.appendChild(e);const t={label:w.MESSAGES.DIALOG_POSITION_TOOLTIP,position:"bottom-right"};this._controls.positionIcon=new u.Icon(this._uiOptions.dialogPosition,null,t,e);const n=[{className:"default",label:w.MESSAGES.POSITION_DEFAULT_MENU_ITEM,info:null,tag:null,isClickable:!0},{className:"right",label:w.MESSAGES.POSITION_RIGHT_MENU_ITEM,info:null,tag:null,isClickable:!0},{className:"left",label:w.MESSAGES.POSITION_LEFT_MENU_ITEM,info:null,tag:null,isClickable:!0}];this._controls.positionMenu=new g.Menu("position",n,this._controls.positionIcon.getElement(),this._controls.innerContainer,"bottom",!0),this._menus.push(this._controls.positionMenu);const s=this._controls.positionMenu.getAllOptions();this._eventListeners.push((0,h.addUseCaptureEvent)(s[0],"click",this._onPositionDialogClick.bind(this)),(0,h.addUseCaptureEvent)(s[1],"click",this._onPositionRightClick.bind(this)),(0,h.addUseCaptureEvent)(s[2],"click",this._onPositionLeftClick.bind(this)),(0,h.addUseCaptureEvent)(this._controls.positionMenu.getOverlay(),"click",this._onPositionOverlayClick.bind(this)),(0,h.addUseCaptureEvent)(this._controls.positionIcon.getElement(),"click",this._onPositionIconClick.bind(this)))}this._controls.closeIcon=new u.Icon("close_filled",null,null,this._controls.headerControlsWrapper),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.closeIcon.getElement(),"click",this._onCloseClick)),this._controls.headerControlsWrapper.appendChild(this._controls.closeIcon.getElement()),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.logo,"click",this._gotoLanguageTool.bind(this))),this._controls.content=this._document.createElement(`${k}-div`),this._controls.content.className=`${k}-dialog__content`,this._controls.innerContainer.appendChild(this._controls.content),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.content,"scroll",this._onContentScroll.bind(this))),this._controls.contentTop=this._document.createElement(`${k}-div`),this._controls.contentTop.className=`${k}-dialog__content__top`,this._controls.content.appendChild(this._controls.contentTop),this._controls.contentMain=this._document.createElement(`${k}-div`),this._controls.contentMain.className=`${k}-dialog__content__main`,this._controls.content.appendChild(this._controls.contentMain),this._controls.contentBottom=this._document.createElement(`${k}-div`),this._controls.contentBottom.className=`${k}-dialog__content__bottom`,this._controls.content.appendChild(this._controls.contentBottom),this._controls.footer=this._document.createElement(`${k}-div`),this._controls.footer.className=`${k}-dialog__footer`,this._controls.loadingBar=this._document.createElement(`${k}-div`),this._controls.loadingBar.className=`${k}-dialog__footer__loading-bar-container`;const s=this._document.createElement(`${k}-div`);s.classList.add(`${k}-dialog__footer__loading-bar-container__loading-bar`,`${k}-dialog__footer__loading-bar-container__loading-bar--loading-bar-1`);const i=this._document.createElement(`${k}-div`);i.classList.add(`${k}-dialog__footer__loading-bar-container__loading-bar`,`${k}-dialog__footer__loading-bar-container__loading-bar--loading-bar-2`);const a=this._document.createElement(`${k}-div`);a.classList.add(`${k}-dialog__footer__loading-bar-container__loading-bar`,`${k}-dialog__footer__loading-bar-container__loading-bar--loading-bar-3`),this._controls.loadingBar.appendChild(s),this._controls.loadingBar.appendChild(i),this._controls.loadingBar.appendChild(a),this._controls.footer.appendChild(this._controls.loadingBar);const c=[{label:w.MESSAGES.COUNTER_CHARACTERS_OPTION,value:"characters"},{label:w.MESSAGES.COUNTER_WORDS_OPTION,value:"words"},{label:w.MESSAGES.COUNTER_SENTENCES_OPTION,value:"sentences"}],d=this._document.createElement("select");if(c.forEach((e=>{const t=this._document.createElement("option");t.value=e.value,t.textContent=e.label,d.appendChild(t)})),this._controls.countSelector=new f.Select("countSelect",this._controls.footer,d),this._controls.footerControlsWrapper=this._document.createElement(`${k}-div`),this._controls.footerControlsWrapper.className=`${k}
388-dialog__footer__controls-wrapper`,this._controls.footer.appendChild(this._controls.footerControlsWrapper),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.countSelector.getSelect(),"change",this._onCountChange.bind(this))),this._uiOptions.disableHelpCenter||this._uiOptions.disableFeedbackForm)if(this._uiOptions.disableFeedbackForm){if(!this._uiOptions.disableHelpCenter){const e={label:w.MESSAGES.HELP_CENTER_TOOLTIP,position:"top-right"};this._controls.sendFeedback=new u.Icon("help",null,e,this._controls.footerControlsWrapper),this._controls.footerControlsWrapper.appendChild(this._controls.sendFeedback.getElement()),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.sendFeedback.getElement(),"click",this._gotoHelpCenter.bind(this)))}}else{const e={label:w.MESSAGES.SEND_FEEDBACK_TOOLTIP,position:"top-right"};this._controls.sendFeedback=new u.Icon("feedback",null,e,this._controls.footerControlsWrapper),this._controls.footerControlsWrapper.appendChild(this._controls.sendFeedback.getElement()),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.sendFeedback.getElement(),"click",this._showFeedbackForm.bind(this)))}else{const e={label:w.MESSAGES.HELP_TOOLTIP,position:"top-right"};this._controls.sendFeedback=new u.Icon("help",null,e,this._controls.footerControlsWrapper),this._controls.footerControlsWrapper.appendChild(this._controls.sendFeedback.getElement());const t=[{className:"help",label:w.MESSAGES.HELP_CENTER_TOOLTIP,info:null,tag:null,isClickable:!0,isSelectable:!1},{className:"feedback",label:w.MESSAGES.SEND_FEEDBACK_TOOLTIP,info:null,tag:null,isClickable:!0}];this._controls.helpMenu=new g.Menu("help",t,this._controls.sendFeedback.getElement(),this._controls.innerContainer,"top",!1,null),this._menus.push(this._controls.helpMenu);const n=this._controls.helpMenu.getAllOptions();this._eventListeners.push((0,h.addUseCaptureEvent)(n[0],"click",this._gotoHelpCenter.bind(this)),(0,h.addUseCaptureEvent)(n[1],"click",this._showFeedbackForm.bind(this)),(0,h.addUseCaptureEvent)(this._controls.helpMenu.getOverlay(),"click",this._onHelpOverlayClick.bind(this)),(0,h.addUseCaptureEvent)(this._controls.sendFeedback.getElement(),"click",this._onHelpIconClick.bind(this)))}if(this._uiOptions.showUserStatisticsLink){const e={label:w.MESSAGES.USER_STATISTICS_TOOLTIP,position:"top-right"},t=new u.Icon("user-statistics",null,e,this._controls.footerControlsWrapper);this._eventListeners.push((0,h.addUseCaptureEvent)(t.getElement(),"click",this._onUserStatisticsClick.bind(this)))}if(!this._uiOptions.disableTurnOff){const e={label:w.MESSAGES.DISABLE_CHECKING_TOOLTIP,position:"top-right"};this._controls.disableIcon=new u.Icon("disable_circle",null,e,this._controls.footerControlsWrapper);const t=[{className:"pause",label:w.MESSAGES.PAUSE_CHECKING_MENU_ITEM,info:null,tag:null,isClickable:!0},{className:"disable_circle",label:w.MESSAGES.DISABLE_CHECKING_MENU_ITEM,info:null,tag:null,isClickable:!0}];this._controls.disableMenu=new g.Menu("disable",t,this._controls.disableIcon.getElement(),this._controls.innerContainer,"top",!1),this._menus.push(this._controls.disableMenu);const n=this._controls.disableMenu.getAllOptions();this._eventListeners.push((0,h.addUseCaptureEvent)(n[0],"click",this._onPauseCheckingClick.bind(this)),(0,h.addUseCaptureEvent)(n[1],"click",this._onTurnOffClick.bind(this)),(0,h.addUseCaptureEvent)(this._controls.disableMenu.getOverlay(),"click",this._onDisableOverlayClick.bind(this)),(0,h.addUseCaptureEvent)(this._controls.disableIcon.getElement(),"click",this._onDisableIconClicked.bind(this)))}if(!this._uiOptions.disableOptionsPage){const e={label:w.MESSAGES.SETTINGS_TOOLTIP,position:"top-right"};this._controls.optionsIcon=new u.Icon("options",null,e,this._controls.footerControlsWrapper),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.optionsIcon.getElement(),"click",this._onOptionsClick.bind(this)))}this._controls.incompleteResult=this._document.createElement(`${k}-div`),this._controls.incompleteResult.className=`${k}-dialog__incomplete-result`,this._controls.incompleteResult.textContent=w.MESSAGES.INCOMPLETE_RESULT,this._controls.footer.appendChild(this._controls.incompleteResult),this._controls.pointer=this._document.createElement(`${k}-span`),this._controls.pointer.className=`${k}-dialog__pointer`,this._controls.innerContainer.appendChild(this._controls.pointer),this._toolbarContainer.appendChild(this._controls.container),this._toolbarContainer.classList.add(`${k}-toolbar--dialog-opened`,`${k}-toolbar--dialog-attached`),o.EnvironmentAdapter.isRuntimeConnected()&&(this._controls.innerContainer.appendChild(this._controls.footer),this._controls.header.appendChild(this._controls.headerControlsWrapper));const p=this._toolbarContainer.querySelector(`.${k}
388-toolbar__premium-icon-dot--has-notification`);p&&p.classList.remove(`${k}-toolbar__premium-icon-dot--has-notification`)}_position(e=null,t=!1){const n=t&&e?e:this._getCorrectPosition(e);if(this._uiOptions.dialogPosition=n,this._controls.innerContainer.classList.remove(`${k}-dialog__container--fixed-right`),this._controls.innerContainer.classList.remove(`${k}-dialog__container--fixed-left`),"default"===n){!this._controls.positionMenu||this._controls.positionMenu.toggleActive(0,!0,!0);let e=this._controls.innerContainer.getBoundingClientRect();const t=document.doctype?this._document.documentElement.clientWidth:Math.min(this._document.documentElement.clientWidth,document.body.clientWidth);e.right>=t-w.SPACE_TO_SCREEN_EDGE&&this._alignToBottom(),e=this._controls.innerContainer.getBoundingClientRect();const n=document.doctype?this._document.documentElement.clientHeight:Math.min(this._document.documentElement.clientHeight,document.body.clientHeight);e.bottom>=n&&this._alignToTop(),e=this._controls.innerContainer.getBoundingClientRect(),e.top<=w.SPACE_TO_SCREEN_EDGE&&this._alignToBottom(),e.top<0&&!(0,h.isScrollable)(document.body)&&!(0,h.isScrollable)(document.documentElement)&&this._alignToBottom()}else"right"===n?(!this._controls.positionMenu||this._controls.positionMenu.toggleActive(1,!0,!0),this._controls.innerContainer.style.removeProperty("right"),this._controls.innerContainer.style.removeProperty("left"),this._controls.innerContainer.classList.remove(`${k}-dialog__container-top`),this._controls.innerContainer.classList.remove(`${k}-dialog__container-bottom`),this._controls.innerContainer.classList.add(`${k}-dialog__container--fixed-right`)):"left"===n?(!this._controls.positionMenu||this._controls.positionMenu.toggleActive(2,!0,!0),this._controls.innerContainer.style.removeProperty("right"),this._controls.innerContainer.style.removeProperty("left"),this._controls.innerContainer.classList.remove(`${k}-dialog__container-top`),this._controls.innerContainer.classList.remove(`${k}-dialog__container-bottom`),this._controls.innerContainer.classList.add(`${k}-dialog__container--fixed-left`)):"coordinates"===n&&(this._controls.innerContainer.classList.remove(`${k}-dialog__container--fixed-right`),this._controls.innerContainer.classList.remove(`${k}-dialog__container--fixed-left`),this._controls.innerContainer.classList.remove(`${k}-dialog__container-top`),this._controls.innerContainer.classList.remove(`${k}-dialog__container-bottom`));this._toolbarContainer.classList.toggle(`${k}-toolbar--dialog-attached`,"default"===n)}_alignToBottom(){const e=new i.DomMeasurement(this._document);this._controls.innerContainer.classList.remove(`${k}-dialog__container-top`),this._controls.innerContainer.classList.add(`${k}-dialog__container-bottom`);const t=this._controls.innerContainer.getBoundingClientRect();if(t.left<=w.SPACE_TO_SCREEN_EDGE){const n=parseInt(e.getStyle(this._controls.innerContainer,"right"),10)+t.left-w.SPACE_TO_SCREEN_EDGE,s=parseInt(e.getStyle(this._controls.pointer,"right"),10)-t.left+w.SPACE_TO_SCREEN_EDGE;e.setStyles(this._controls.innerContainer,{right:n+"px !important",left:"auto !important"}),e.setStyles(this._controls.pointer,{right:s+"px !important",left:"auto !important"})}if(t.right>this._document.documentElement.clientWidth){e.setStyles(this._controls.innerContainer,{right:"0px !important",left:"auto !important"});const n=parseInt(e.getStyle(this._controls.pointer,"right"),10)+(this._controls.innerContainer.getBoundingClientRect().right-t.right);e.setStyles(this._controls.pointer,{right:n+"px !important",left:"auto !important"})}}_alignToTop(){this._controls.innerContainer.classList.remove(`${k}-dialog__container-bottom`),this._controls.innerContainer.classList.add(`${k}-dialog__container-top`);const e=this._controls.innerContainer.getBoundingClientRect(),t=new i.DomMeasurement(this._document);if(this._controls.innerContainer.classList.add(`${k}-dialog__container-hide`),e.right>=this._document.documentElement.clientWidth-w.SPACE_TO_SCREEN_EDGE){const n=parseInt(t.getStyle(this._controls.innerContainer,"left"),10)-(e.right-this._document.documentElement.clientWidth)-w.SPACE_TO_SCREEN_EDGE,s=parseInt(t.getStyle(this._controls.pointer,"left"),10)+(e.right-this._document.documentElement.clientWidth)+w.SPACE_TO_SCREEN_EDGE;
388t.setStyles(this._controls.innerContainer,{left:n+"px !important",right:"auto !important"}),t.setStyles(this._controls.pointer,{left:s+"px !important",right:"auto !important"})}this._controls.innerContainer.classList.remove(`${k}-dialog__container-hide`)}_removeTeaser(){this._controls.teaserElement&&(this._controls.teaserElement.remove(),this._controls.teaserElement=void 0)}_updateContent(){if(!this._controls.content)return;if(w._customRender)return void this._position(this._uiOptions.dialogPosition);this.closeAllMenus();const e=this._state.checkStatus;this._controls.content.classList.remove(`${k}-dialog__has-errors`),this._controls.content.classList.remove(`${k}-dialog__is-loading`),this._controls.contentMain.innerHTML="",this._controls.contentTop.innerHTML="",this._controls.contentBottom.innerHTML="",this.updateCounter(this._state.countOptions);const t=(this._inApplyFixMode||this._inInsignificantChangeMode)&&e===x.CHECK_STATUS.IN_PROGRESS&&this._allDisplyedErrorsCount>0;this._showLoadingBar(t);const n=e===x.CHECK_STATUS.NEEDS_LANGUAGE_HINT;if(this._controls.languageSelector.toggleHighlight(n),t?(this._renderHeadline(),this._renderPickyMode(),this._renderCompletedState()):e===x.CHECK_STATUS.IN_PROGRESS?(this._renderHeadline(),this._renderPickyMode(),this._renderInProgressState()):e===x.CHECK_STATUS.COMPLETED?(this._renderHeadline(),this._renderPickyMode(),this._renderCompletedState()):e===x.CHECK_STATUS.DISABLED?this._renderDisabledState():e===x.CHECK_STATUS.TEXT_TOO_SHORT?(this._renderHeadline(),this._renderPickyMode(),this._renderTextTooShortState(),this._renderPremiumErrorsTeaser(),this._renderTrialRunningState()):e===x.CHECK_STATUS.TEXT_TOO_LONG?this._renderTextTooLongState():e===x.CHECK_STATUS.UNSUPPORTED_LANGUAGE?(this._renderHeadline(),this._renderPickyMode(),this._renderLanguageUnsupportedState()):e===x.CHECK_STATUS.DISCONNECTED?this._renderDisconnectedState():e===x.CHECK_STATUS.FAILED?this._renderFailedState():e===x.CHECK_STATUS.TRIAL_ENDED?this._renderTrialEndedState():n&&this._renderNeedsLanguageHintState(),e===x.CHECK_STATUS.COMPLETED&&this._controls.mainHeadline){this._controls.headerScoreProgressBar.style.width=this._state.textScore+"%",this._controls.textScore.setScore(this._state.textScore);const e=this._state.displayedErrors.length||0,t=this._state.displayedPremiumErrors.length||0;this._allDisplyedErrorsCount=e+t,this._controls.errorsCounter.textContent=this._allDisplyedErrorsCount.toString()}this._position()}_showLoadingBar(e){e!==this._isLoadingBarShown&&(e?this._controls.loadingBar.classList.remove(`${k}-dialog__footer__loading-bar-container--hidden`):this._controls.loadingBar.classList.add(`${k}-dialog__footer__loading-bar-container--hidden`),this._isLoadingBarShown=e)}_getCountString(e,t){if(!o.EnvironmentAdapter.isRuntimeConnected())return"";const n={words:[a.i18nManager.getMessage("dialogCounterWordsSingular"),a.i18nManager.getMessage("dialogCounterWordsPlural",[(0,v.formatNumber)(e.counts.words,o.EnvironmentAdapter.getUILanguageCode())])],sentences:[a.i18nManager.getMessage("dialogCounterSentencesSingular"),a.i18nManager.getMessage("dialogCounterSentencesPlural",[(0,v.formatNumber)(e.counts.sentences,o.EnvironmentAdapter.getUILanguageCode())])],characters:[a.i18nManager.getMessage("dialogCounterCharactersSingular"),a.i18nManager.getMessage("dialogCounterCharactersPlural",[(0,v.formatNumber)(e.counts.characters,o.EnvironmentAdapter.getUILanguageCode())])]},s=e.counts[t];return 0===s?n[t][1]:1===s?n[t][0]:n[t][1]}_renderHeadline(){this._controls.mainHeadline=this._document.createElement(`${k}-div`),this._controls.mainHeadline.classList.add(`${k}-dialog__content-top__menu`),this._controls.mainHeadline.setAttribute("data-lt-prevent-focus","");const e=this._document.createElement(`${k}-span`);e.className=`${k}-dialog__main-headline`;const t=this._document.createElement(`${k}-span`);t.className=`${k}-dialog__main-headline__headline`,t.textContent=w.MESSAGES.REGULAR_MISTAKE_MENU_ITEM,this._controls.errorsCounter=this._document.createElement(`${k}-span`),this._controls.errorsCounter.className=`${k}-dialog__main-headline__counter`,this._controls.errorsCounter.textContent=this._allDisplyedErrorsCount.toString(),e.appendChild(t),e.appendChild(this._controls.errorsCounter),this._controls.mainHeadline.appendChild(e)}_renderPickyMode(){const e={label:w.MESSAGES.TEXT_SCORE_MENU_ITEM,position:"bottom-right"};this._controls.textScore=new E.Score(`${k}-dialog__main-headline__score`,this._controls.mainHeadline,e),this._controls.textScore.setScore(this._state.textScore),this._controls.contentTop.appendChild(this._controls.mainHeadline),this._controls.pickyToggle=new T.Toggle("picky_mode",w.MESSAGES.PICKY_MODE_MENU_ITEM,"",this._controls.contentTop),this._controls.pickyToggle.set(this._state.isPickyModeEnabled),this._eventListeners.push((0,h.addUseCaptureEvent)(this._controls.pickyToggle.getElement(),"click",this._onTogglePickyMode.bind(this)))}_renderInProgressState(){this._controls.content.classList.add(`${k}-dialog__is-loading`);const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog-skeleton ${k}-dialog-skeleton--error-card`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog-skeleton ${k}-dialog-skeleton--error-card`,this._controls.contentMain.appendChild(e),this._controls.contentMain.appendChild(t)}_renderCompletedState(){this._state.displayedErrors&&this._state.displayedErrors.length?this._appearance.canDisplayAllSuggestions()?(this._renderErrors(),this._renderIgnoredErrorsStats(),this._renderTrialRunningState()):this._renderScrollHint():this._state.displayedPremiumErrors&&this._state.displayedPremiumErrors.length?(this._removeTeaser(),this._renderPremiumState()):(this._removeTeaser(),this._renderNoErrorsState(),this._renderIgnoredErrorsStats()),this._controls.incompleteResult.classList.toggle(`${k}-dialog__incomplete-result-show`,!!this._state.isIncompleteResult)}_renderErrors(){this._controls.content.classList.add(`${k}-dialog__has-errors`),this._state.displayedPremiumErrors&&this._state.displayedPremiumErrors.length&&this._renderPremiumErrorsTeaser(),this._state.displayedErrors.forEac
388h((e=>{const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__error-item`;const n={label:w.MESSAGES.IGNORE_RULE_TOOLTIP,position:"top-right"},s=new u.Icon("trash",null,n,t);this._eventListeners.push((0,h.addUseCaptureEvent)(s.getElement(),"click",(n=>{e.isSpellingError?this._onTemporarilyIgnoreWordClick(e,n):this._onTemporarilyIgnoreRuleClick(e,n),t.remove()})));const r=this._document.createElement(`${k}-div`);r.className=`${k}-dialog__error-headline`,e.isPicky&&t.classList.add(`${k}-dialog__error-item--picky-mistake`),e.isCustomError?(r.textContent=e.shortDescription||w.MESSAGES.HEADLINE_SUGGESTION_ERROR,t.classList.add(`${k}-dialog__error-item--custom-suggestion`)):e.isSpellingError?(r.textContent=w.MESSAGES.HEADLINE_SPELLING_ERROR,t.classList.add(`${k}-dialog__error-item--spelling-mistake`)):e.isStyleError?(r.textContent=e.shortDescription||w.MESSAGES.HEADLINE_SUGGESTION_ERROR,t.classList.add(`${k}-dialog__error-item--style-suggestion`)):e.isPunctuationError?(r.textContent=e.shortDescription||w.MESSAGES.HEADLINE_PUNCTUATION_ERROR,t.classList.add(`${k}-dialog__error-item--punctuation-mistake`)):(r.textContent=e.shortDescription||w.MESSAGES.HEADLINE_GRAMMAR_ERROR,t.classList.add(`${k}-dialog__error-item--grammar-mistake`)),t.append(r),t.addEventListener("mouseenter",(()=>this._onErrorHighlighted(e.id))),t.addEventListener("mouseleave",(()=>this._onErrorHighlighted(null)));const i=this._document.createElement(`${k}-div`);i.className=`${k}-dialog__original-phrase`,t.appendChild(i);const o=this._document.createElement(`${k}-div`);o.className=`${k}-dialog__original-phrase__header`,i.appendChild(o);const a=this._document.createElement(`${k}-div`);a.className=`${k}-dialog__original-phrase__header__title`,a.textContent=e.originalPhrase,o.appendChild(a);const l=new u.Icon("scroll-to-link",w.MESSAGES.SCROLL_TO_LINK,null,o);this._eventListeners.push((0,h.addUseCaptureEvent)(l.getElement(),"click",(t=>{t.stopImmediatePropagation(),this._onErrorSelected(e.id)})));const c=this._document.createElement(`${k}-div`);c.className=`${k}-dialog__original-phrase__long-context-phrase`,c.innerHTML=e.longContextPhrase,i.appendChild(c),this._renderFixes(e,t),this._renderDescription(e,t),this._renderActions(e,t),this._controls.contentMain.appendChild(t)}))}_renderFixes(e,t){const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__fix-container`,t.appendChild(n);const s=Math.min(e.fixes.length,C.MAX_FIXES_COUNT);for(let r=0;r<s;r++){const i=e.fixes[r],o=this._document.createElement(`${k}-div`);if(o.title=i.shortDescription||"",o.className=`${k}-dialog__fix`,o.setAttribute("data-lt-prevent-focus",""),i.value.match(C.TRAILING_WHITESPACE_REGEXP)&&!i.value.match(/^\s*[\-–—:;]\s$/))o.textContent=i.value.replace(C.TRAILING_WHITESPACE_REGEXP,"·");else{const t=i.value.replace(C.NARROW_WHITESPACE_REGEXP," ");s>3&&e.isSpellingError?o.textContent=t:(o.classList.add(`${k}-dialog__fix--highlighted`),o.innerHTML=(0,h.escapeHTMLInHighlightedPhrase)((0,h.highlightChangesInPhrase)(e.originalPhrase,t)))}""===i.value&&e.originalPhrase.match(/[a-z0-9]{2,}/)?(o.classList.add(`${k}-dialog__fix--remove`),o.classList.remove(`${k}-dialog__fix--highlighted`),o.textContent=e.originalPhrase):""===i.value&&(o.classList.add(`${k}-dialog__fix--delete`),o.classList.remove(`${k}-dialog__fix--highlighted`),o.textContent=w.MESSAGES.DELETE),this._eventListeners.push((0,h.addUseCaptureEvent)(o,"click",(n=>{this._onFixClick(e,r,n),t.remove()}))),n.appendChild(o);const a=(0,h.getConfigForMultipleErrorCorrection)(e,i.value);if(this._uiOptions.canCorrectMultipleErrorsAtOnce&&(0,h.containsSimilarErrors)(this._state.errors,e)&&a){const t=this._document.createElement(`${k}-span`);t.classList.add(`${k}-dialog__fix--correct-all`),t.setAttribute("data-lt-prevent-focus",""),t.innerHTML=a.suggestion.message;const s=this._onCorrectAll.bind(this,e,a);this._eventListeners.push((0,h.addUseCaptureEvent)(t,"click",s)),n.appendChild(t),n.appendChild(this._document.createElement("br"))}i.value.length>=14&&t.classList.add(`${k}-dialog__long-fix`)}}_renderActions(e,t){if(e.isSpellingError){if(!this._uiOptions.disableAddingWord&&!(0,v.includesWhiteSpace)(e.originalPhrase)){const n=this._document.createElement(`${k}-div`);n.classList.add(`${k}-dialog__add-to-dictionary`,`${k}-icon__dictionary`),n.setAttribute("data-lt-prevent-focus",""),n.textContent=a.i18nManager.getMessage("addToDictionaryCaption",e.originalPhrase),this._eventListeners.push((0,h.addUseCaptureEvent)(n,"click",(n=>{this._onAddToDictionaryClick(e,n),t.remove()}))),t.appendChild(n)}}else if(!this._uiOptions.disableIgnoringRule&&!e.isCustomError){const n=this._document.createElement(`${k}-div`);n.classList.add(`${k}-dialog__ignore-rule`),n.classList.add(`${k}-icon__ignore`),n.setAttribute("data-lt-prevent-focus",""),n.classList.add(`${k}-icon__ignore`),n.textContent=a.i18nManager.getMessage("turnOffRule"),this._eventListeners.push((0,h.addUseCaptureEvent)(n,"click",(n=>{this._onIgnoreRuleClick(e,n),t.remove()}))),t.appendChild(n)}}_renderDescription(e,t){const n=this._document.createElement(`${k}-div`);if(n.className=`${k}-dialog__error-text`,n.setAttribute("data-lt-prevent-focus",""),n.textContent=e.description,t.append(n),e.rule.urls&&e.rule.urls.length>0){const t=this._document.createElement(`${k}-span`);t.classList.add(`${k}-dialog__more-details`,`${k}-icon__info`),t.setAttribute("data-lt-prevent-focus",""),t.title=a.i18nManager.getMessage("moreDetails"),this._eventListeners.push((0,h.addUseCaptureEvent)(t,"click",(t=>{this._onMoreDetailsClick(e.rule.urls[0],t)}))),n.appendChild(t)}}_renderScrollHint(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__scroll-hint__headline`,t.textContent=w.MESSAGES.SCROLL_HINT_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__scroll-hint__text`,n.textContent=w.MESSAGES.SCROLL_HINT_TEXT,e.appendChild(t),e.appendChild(n),this._controls.contentMain.appendChild(e),this._shouldShowRatingTeaser?this._renderRatingTeaser():this._renderPremiumErrorsTeaser()}_renderTextTooShortState(){this._removeTeaser();const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__text-too-short__headline`,t.innerHTML=w.MESSAGES.TEXT_TOO_SHORT_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__text-too-short__text`,n.innerHTML=w.MESSAGES.TEXT_TOO_SHORT_TEXT,e.appendChild(t),e.appendChild(n),this._controls.contentMain.appendChild(e)}_renderNoErrorsState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__no-errors__headline`,t.textContent=w.MESSAGES.NO_ERRORS;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__no-errors__text`,n.textContent=w.MESSAGES.NO_ERRORS_TEXT,e.appendChild(t),e.appendChild(n),this._controls.contentMain.appendChild(e),this._shouldShowRatingTeaser?this._renderRatingTeaser():this._renderPremiumErrorsTeaser()}_renderIgnoredErrorsStats(){if(!this._state.ignoredErrorsStats)return;if(0===this._state.ignoredErrorsStats.byDictionary&&0===this._state.ignoredErrorsStats.byRules)return;const e=this._document.createElement(`${k}-div`);if(this._state.displayedErrors&&this._state.displayedErrors.length?e.className=`${k}-dialog__ignored-errors-item`:e.className=`${k}-dialog__ignored-errors-message`,this._state.ignoredErrorsStats.byDictionary>0&&!this._uiOptions.disableAddingWord){const t=1===this._state.ignoredErrorsStats.byDictionary?"errorsIgnoredByDictionarySingular":"errorsIgnoredByDictionary",n=a.i18nManager.getMessage(t,[this._state.ignoredErrorsStats.byDictionary]),s=document.createElement(`${k}-span`);s.textContent=n,s.dataset.type="byDictionary",e.appendChild(s)}if(this._state.ignoredErrorsStats.byRules>0&&!this._uiOptions.disableIgnoringRule){if(this._state.ignoredErrorsStats.byDictionary>0){const t=document.createElement(`${k}-span`);t.textContent=", ",e.appendChild(t)}const t=1===this._state.ignoredErrorsStats.byRules?"errorsIgnoredByRulesSingular":"errorsIgnoredByRules",n=a.i18nManager.getMessage(t,[this._state.ignoredErrorsStats.byRules]),s=document.createElement(`${k}-span`);s.textContent=n,s.dataset.type="byRules",e.appendChild(s)}this._controls.contentMain.appendChild(e),this._eventListeners.push((0,h.addUseCaptureEvent)(e,"click",this._onIgnoredErrorsClick.bind(this)))}_renderRatingTeaser(){this._ratingTeaser=new _.RatingTeaser(this._controls.contentBottom,"dialog",(0,v.getCurrentUrl)().substr(0,150))}_renderPremiumErrorsTeaser(){this._controls.teaserElement||o.EnvironmentAdapter.isRuntimeConnected()&&c.StorageControllerFactory.create().onReady((e=>{if(e.isPremium())return;const t=e.getStatistics(),n=(0,h.getHistoricPremiumErrors)(t);if(this._state.displayedPremiumErrors.length){const e=this._state.displayedPremiumErrors.filter((e=>!e.isStyleError&&!e.isPunctuationError)).length,t=this._state.displayedPremiumErrors.filter((e=>e.isPunctuationError)).length,n=this._state.displayedPremiumErrors.filter((e=>e.isStyleError)).length,s="dialog:premium_teaser",r=1===e+t+n?a.i18nManager.getMessage("premiumErrorsTextSingular"):a.i18nManager.getMessage("premiumErrorsTextPlural",[this._state.displayedPremiumErrors.length]),i=a.i18nManager.getMessage("premiumErrorsButton");this._premiumTeaser=new p.PremiumTeaser(this._controls.contentTop,s,null,r,i,{campaign:"addon2-dialog-premium-errors",hiddenGrammarMatches:e,hiddenStyleMatches:n,hiddenPunctuationMatches:t,textLanguage:this._languageCode||void 0})}else if(n.hiddenErrorsCount>5){const e="dialog:historic_premium_teaser",t=a.i18nManager.getMessage("historicPremiumErrorsHeadline"),s=a.i18nManager.getMessage("historicPremiumErrorsText2",[n.hiddenErrorsCount,n.dayCount]),r=a.i18nManager.getMessage("historicPremiumErrorsButton");this._premiumTeaser=new p.PremiumTeaser(this._controls.contentBottom,e,t,s,r,{campaign:"addon2-dialog-historic-premium-errors",historicMatches:n.hiddenErrorsCountStr})}e.destroy()}))}_renderPremiumState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__premium__headline`,t.textContent=1===this._state.displayedPremiumErrors.length?a.i18nManager.getMessage("dialogPremiumHeadlineSingular"):a.i18nManager.getMessage("dialogPremiumHeadlinePlural",[this._state.displayedPremiumErrors.length]);const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__premium__text`,n.textContent=a.i18nManager.getMessage("dialogPremiumText");const s=this._document.createElement(`${k}-div`);s.className=`${k}-dialog__premium__button ${k}-icon__new_window`,s.textContent=a.i18nManager.getMessage("dialogPremiumButton"),this._eventListeners.push((0,h.addUseCaptureEvent)(s,"click",(e=>{e.stopImmediatePropagation();const t={dialog:this,campaign:"addon2-dialog-premium"};(0,h.dispatchCustomEvent)(document,w.eventNames.premiumTeaserClicked,t),d.TrackerAdapter.trackEvent("Action","dialog:premium:click")}))),e.appendChild(t),e.appendChild(n),e.appendChild(s),this._controls.contentMain.appendChild(e)}_renderDisabledState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__enable-text__headline`,t.textContent=w.MESSAGES.ENABLE_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__enable-everywhere`,n.innerHTML=w.MESSAGES.ENABLE_EVERYWHERE_BUTTON,this._eventListeners.push((0,h.addUseCaptureEvent)(n,"click",this._enableEverywhere.bind(this)));const s=this._document.createElement(`${k}-div`);s.className=`${k}-dialog__enable-here`,s.innerHTML=w.MESSAGES.ENABLE_HERE_BUTTON,this._eventListeners.push((0,h.addUseCaptureEvent)(s,"click",this._enableHere.bind(this))),e.appendChild(t),e.appendChild(n),e.appendChild(s),this._controls.contentMain.appendChild(e)}_renderTextTooLongState(){const e=this._document.createElement(`${k}-div`);if(e.className=`${k}-dialog__text-wrapper`,this._controls.contentMain.appendChild(e),this._uiOptions.isPremium){const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__text-too-long__headline`,t.textContent=w.MESSAGES.TEXT_TOO_LONG_HEADLINE;const n=this._document.createElement(`${k}-div`);return n.className=`${k}-dialog__text-too-long__text`,n.textContent=w.MESSAGES.TEXT_TOO_LONG_PREMIUM_TEXT,e.appendChild(t),void e.appendChild(n)}const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__premium__headline`,t.textContent=w.MESSAGES.TEXT_TOO_LONG_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__premium__text`,n.textContent=w.MESSAGES.TEXT_TOO_LONG_TEXT;const s=this._document.createElement(`${k}-div`);s.className=`${k}-dialog__premium__button ${k}-icon__new_window`,s.textContent=w.MESSAGES.TEXT_TOO_LONG_BUTTON,this._eventListeners.push((0,h.addUseCaptureEvent)(s,"click",(e=>{e.stopImmediatePropagation(),o.EnvironmentAdapter.openPremiumPage("addon2-dialog-text-too-long"),d.TrackerAdapter.trackEvent("Action","dialog:text_too_long:click")}))),e.appendChild(t),e.appendChild(n),e.appendChild(s)}_renderLanguageUnsupportedState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__language-unsupported__headline`,t.textContent=w.MESSAGES.UNSUPPORTED_LANGUAGE_HEADLINE;const n=this._document.createElement(`${k}-div`);if(n.className=`${k}-dialog__language-unsupported__text`,n.textContent=w.MESSAGES.UNSUPPORTED_LANGUAGE_TEXT,e.appendChild(t),e.appendChild(n),this._controls.contentMain.appendChild(e),this._controls.languageSelector){const e=this._document.createElement("option");e.disabled=!0,e.selected=!0,e.textContent=w.MESSAGES.UNSUPPORTED_LANGUAGE_LABEL,this._controls.languageSelector.addOption(e);
388const t=o.EnvironmentAdapter.getURL("/assets/images/flags/not_found.svg");this._controls.languageSelector.setActive(w.MESSAGES.SELECT_LANGUAGE_LABEL,"",{"background-image":`url('${t}') !important`})}}_renderDisconnectedState(){this._controls.footer.remove(),this._controls.headerControlsWrapper.remove();const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.innerHTML=w.MESSAGES.EXTENSION_UPDATED_HEADLINE,t.className=`${k}-dialog__reload-headline`,this._controls.contentMain.appendChild(t);const n=this._document.createElement(`${k}-div`);n.innerHTML=w.MESSAGES.EXTENSION_UPDATED_TEXT,n.className=`${k}-dialog__reload__text`,this._controls.contentMain.appendChild(n),e.appendChild(t),e.appendChild(n),this._controls.contentMain.appendChild(e)}_renderFailedState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__exception-headline`,t.textContent=w.MESSAGES.FAIL_STATE_HEADLINE,e.appendChild(t);const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__exception__text`,n.textContent=this._state.checkErrorMessage||w.MESSAGES.FAIL_STATE_TEXT,e.appendChild(n),this._controls.contentMain.appendChild(e)}_renderTrialEndedState(){if(!A.Trial.isFunctionalityLocked())return;const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`,this._controls.contentMain.appendChild(e);const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__premium__headline`,t.textContent=w.MESSAGES.TRIAL_ENDED_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__premium__text`,n.textContent=w.MESSAGES.TRIAL_ENDED_TEXT;const s=this._document.createElement(`${k}-div`);s.className=`${k}-dialog__premium__button ${k}-icon__new_window`,s.textContent=w.MESSAGES.TRIAL_ENDED_BUTTON,this._eventListeners.push((0,h.addUseCaptureEvent)(s,"click",(e=>{e.stopImmediatePropagation(),o.EnvironmentAdapter.openPremiumPage("addon2-dialog-trial-ended"),d.TrackerAdapter.trackEvent("Action","dialog:trial_ended:click")}))),e.appendChild(t),e.appendChild(n),e.appendChild(s),this._controls.languageSelector?.hide()}_renderTrialRunningState(){if(!A.Trial.isRunning())return;let e="";const t=A.Trial.getRemainingDays();e=t>2?a.i18nManager.getMessage("popupTrialEndingInDays",[String(Math.round(t))]):t>1?a.i18nManager.getMessage("popupTrialEndingTomorrow"):a.i18nManager.getMessage("popupTrialEndingToday"),this._premiumTeaser=new p.PremiumTeaser(this._controls.contentTop,"dialog:trial_running",null,e,a.i18nManager.getMessage("premiumErrorsButton"),{campaign:"addon2-dialog-trial-running"},null,(()=>{o.EnvironmentAdapter.openOptionsPage(void 0,"dialog-teaser-trial-running")}))}_renderNeedsLanguageHintState(){const e=this._document.createElement(`${k}-div`);e.className=`${k}-dialog__text-wrapper`;const t=this._document.createElement(`${k}-div`);t.className=`${k}-dialog__needs-language-hint__headline`,t.textContent=w.MESSAGES.NEEDS_LANGUAGE_HINT_HEADLINE;const n=this._document.createElement(`${k}-div`);n.className=`${k}-dialog__needs-language-hint__text`,n.textContent=w.MESSAGES.NEEDS_LANGUAGE_HINT_TEXT;const s=this._document.createElement(`${k}-div`);s.className=`${k}-dialog__needs-language-hint__button`,s.textContent=w.MESSAGES.NEEDS_LANGUAGE_HINT_IGNORE,e.appendChild(t),e.appendChild(n),e.appendChild(s),this._controls.contentMain.appendChild(e),this._eventListeners.push((0,h.addUseCaptureEvent)(s,"click",(()=>{const e={dialog:this,language:this._controls.languageSelector.getValue()};d.TrackerAdapter.trackEvent("Action","dialog:ignore_language_hint"),(0,h.dispatchCustomEvent)(document,w.eventNames.languageChanged,e)})))}_onUnload(){this.destroy()}_onKeydown(e){"Escape"===e.key&&(this.destroy(),e.currentTarget?.addEventListener("keyup",(e=>e.stopImmediatePropagation()),{capture:!0,once:!0}),e.stopImmediatePropagation())}_onLanguageChange(e){e.stopImmediatePropagation();const t={dialog:this,language:this._controls.languageSelector.getValue()};this.setCurrentLanguage(this._controls.languageSelector.getValue()),(0,h.dispatchCustomEvent)(document,w.eventNames.languageChanged,t)}_onTogglePickyMode(e){e.stopImmediatePropagation(),this._state.isPickyModeEnabled=!this._state.isPickyModeEnabled,this.setInsignificantChangeMode(!1);const t={dialog:this,isEnabled:this._state.isPickyModeEnabled};(0,h.dispatchCustomEvent)(document,w.eventNames.togglePickyMode,t)}_onCountChange(e){e.stopImmediatePropagation(),this._state.countOptions.mode=this._controls.countSelector.getValue(),this.updateCounter(this._state.countOptions);const t={dialog:this,countMode:this._controls.countSelector.getValue()};(0,h.dispatchCustomEvent)(document,w.eventNames.countChanged,t)}_onCloseClick(e){e.stopImmediatePropagation(),this._onUnload()}_onHelpIconClick(e){e.stopImmediatePropagation(),this._controls.helpMenu.show()}_onHelpOverlayClick(e){e.stopImmediatePropagation(),this._controls.helpMenu.hide()}
388_onPositionIconClick(e){e.stopImmediatePropagation(),this._controls.positionMenu.show()}_onPositionOverlayClick(e){e.stopImmediatePropagation(),this._controls.positionMenu.hide()}_onPositionRightClick(e){e.stopImmediatePropagation();const t={dialog:this,newPosition:"right"};this._controls.positionMenu.hide(),this._controls.positionIcon.setIcon("right"),this._position("right"),(0,h.dispatchCustomEvent)(document,w.eventNames.positionChangeClicked,t)}_onPositionLeftClick(e){e.stopImmediatePropagation();const t={dialog:this,newPosition:"left"};this._controls.positionMenu.hide(),this._controls.positionIcon.setIcon("left"),this._position("left"),(0,h.dispatchCustomEvent)(document,w.eventNames.positionChangeClicked,t)}_onPositionDialogClick(e){e.stopImmediatePropagation();const t={dialog:this,newPosition:"default"};this._controls.positionMenu.hide(),this._controls.positionIcon.setIcon("default"),this._position("default"),(0,h.dispatchCustomEvent)(document,w.eventNames.positionChangeClicked,t)}_onTurnOffClick(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.turnOff,t)}_onPauseCheckingClick(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.pauseChecking,t)}_onDisableIconClicked(e){e.stopImmediatePropagation(),this._controls.disableMenu.show()}_onDisableOverlayClick(e){e.stopImmediatePropagation(),this._controls.disableMenu.hide()}_onBadgeClicked(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.badgeClicked,t)}_onOptionsClick(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.openOptions,t)}_onUserStatisticsClick(e){e.stopImmediatePropagation(),o.EnvironmentAdapter.openWindow("https://languagetool.com/editor/statistics")}_onContentScroll(e){this._controls.content.scrollTop>50?this._controls.headerScoreProgress.classList.add("show"):this._controls.headerScoreProgress.classList.remove("show")}_onIgnoredErrorsClick(e){e.stopImmediatePropagation();let t="personalDictionary";if(e.target){const n=e.target;n.dataset&&"byRules"===n.dataset.type&&(t="ignoredRules")}const n={dialog:this,target:t,ref:"dialog-ignored-errors"};(0,h.dispatchCustomEvent)(document,w.eventNames.openOptions,n)}_gotoLanguageTool(e){e.stopImmediatePropagation();let t="https://languagetool.org/?utm_campaign=addon2-dialog";r.BrowserDetector.isSafari()&&(t+="&hidePremium=true"),o.EnvironmentAdapter.openWindow(t)}_gotoHelpCenter(e){e.stopImmediatePropagation(),this._controls.helpMenu.hide(),o.EnvironmentAdapter.openWindow("https://help.languagetool.org/")}_showFeedbackForm(e){e.stopImmediatePropagation();const t={dialog:this};this._controls.helpMenu.hide(),(0,h.dispatchCustomEvent)(document,w.eventNames.showFeedbackForm,t)}_onErrorHighlighted(e){const t={dialog:this,errorId:e};(0,h.dispatchCustomEvent)(document,w.eventNames.errorHighlighted,t)}_onErrorSelected(e){const t={dialog:this,errorId:e};(0,h.dispatchCustomEvent)(document,w.eventNames.errorSelected,t)}_onMoreDetailsClick(e,t){t.stopImmediatePropagation();const n={dialog:this,url:e.value};(0,h.dispatchCustomEvent)(document,w.eventNames.moreDetailsClicked,n)}_onCorrectAll(e,t,n){n.stopImmediatePropagation();const s={dialog:this,config:t,selectedError:e};(0,h.dispatchCustomEvent)(document,w.eventNames.correctAll,s)}_onFixClick(e,t,n){n.stopImmediatePropagation(),this._inApplyFixMode=!0;const s={dialog:this,error:e,fixIndex:t,selectNextError:!1};(0,h.dispatchCustomEvent)(document,w.eventNames.fixSelected,s)}_onAddToDictionaryClick(e,t){t.stopImmediatePropagation(),this._inApplyFixMode=!0;const n={dialog:this,error:e,selectNextError:!1};(0,h.dispatchCustomEvent)(document,w.eventNames.addToDictionaryClicked,n)}_onUnlockSuggestion(e,t,n){n.stopImmediatePropagation();const s={dialog:this,error:e,onUnlockComplete:t};(0,h.dispatchCustomEvent)(document,w.eventNames.unlockSuggestion,s)}_onIgnoreRuleClick(e,t){t.stopImmediatePropagation(),this._inApplyFixMode=!0;const n={dialog:this,error:e,selectNextError:!1};(0,h.dispatchCustomEvent)(document,w.eventNames.ignoreRuleClicked,n)}_onTemporarilyIgnoreWordClick(e,t){t.stopImmediatePropagation(),this._inApplyFixMo
388de=!0;const n={dialog:this,error:e,selectNextError:!1};(0,h.dispatchCustomEvent)(document,w.eventNames.temporarilyIgnoreWordClicked,n)}_onTemporarilyIgnoreRuleClick(e,t){t.stopImmediatePropagation(),this._inApplyFixMode=!0;const n={dialog:this,error:e,selectNextError:!1};(0,h.dispatchCustomEvent)(document,w.eventNames.temporarilyIgnoreRuleClicked,n)}_enableEverywhere(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.enableEverywhere,t)}_enableHere(e){e.stopImmediatePropagation();const t={dialog:this};(0,h.dispatchCustomEvent)(document,w.eventNames.enableHere,t)}getCurrentPosition(){return this._uiOptions.dialogPosition}updateState(e){(0,v.deepEqual)(this._state,e,!1)||(this._state=Object.assign(this._state||{},e),this._updateContent())}setCurrentLanguage(e){if(!o.EnvironmentAdapter.isRuntimeConnected())return;e=e.toLowerCase();const t=l.LanguageManager.SUPPORTED_LANGUAGES.find((t=>t.code===e))||l.LanguageManager.SUPPORTED_LANGUAGES.find((t=>e.startsWith(t.code)))||l.LanguageManager.SUPPORTED_LANGUAGES.find((e=>"en-us"===e.code)),n=o.EnvironmentAdapter.getURL("/assets/images/flags/"+t.code+".svg");this._controls.languageSelector&&this._controls.languageSelector.setActive(this._shortenLanguageName(t.name),t.code,{"background-image":`url('${n}') !important`})}_shortenLanguageName(e){return e.split(" ",1)[0]}updateCounter(e){this._controls.countSelector&&(this._state.checkStatus!==x.CHECK_STATUS.TEXT_TOO_LONG&&this._state.checkStatus!==x.CHECK_STATUS.TEXT_TOO_SHORT&&this._state.checkStatus!==x.CHECK_STATUS.TRIAL_ENDED?(this._controls.countSelector.show(),this._controls.countSelector.setActive(this._getCountString(e,e.mode),e.mode,{}),this._controls.countSelector.updateOptionLabel("characters",this._getCountString(e,"characters")),this._controls.countSelector.updateOptionLabel("sentences",this._getCountString(e,"sentences")),this._controls.countSelector.updateOptionLabel("words",this._getCountString(e,"words"))):this._controls.countSelector.hide())}setInsignificantChangeMode(e){this._inInsignificantChangeMode=e}setApplyFixMode(e){this._inApplyFixMode=e}closeAllMenus(){this._menus.forEach((e=>{e.hide()}))}fadeOut(){this._controls.innerContainer.classList.add(`${k}-dialog--faded`)}fadeIn(){this._controls.innerContainer.classList.remove(`${k}-dialog--faded`)}destroy(){(0,h.fadeOutAndRemove)(this._controls.container,(()=>{this._toolbarContainer.classList.remove(`${k}-toolbar--dialog-opened`,`${k}-toolbar--dialog-attached`,`${k}-toolbar--dialog-attached--draggable`,`${k}-toolbar--dialog-attached--dragged`),this._dragInstance?.destroy(),this._dragInstance=null})),this._destroyCustomRender?.(),this._destroyDragHandleRender?.(),this._controls.languageSelector?.destroy(),this._ratingTeaser?.destroy(),this._controls={},self.removeEventListener("pagehide",this._onUnload,!0),this._eventListeners.forEach((e=>{e.destroy()})),this._eventListeners=[];const e={dialog:this};this._premiumTeaser?.destroy(),(0,h.dispatchCustomEvent)(document,w.eventNames.destroyed,e)}_applyDrag(e){const t=new b.default({parent:this._controls.innerContainer,backdropRoot:"coordinates"===e?this._getDraggableMountNode():this._getNonDraggableMountNode(),handle:this._controls.dragHandler,reMountOnDragStart:"coordinates"!==e,onStateUpdate:e=>{if(e.isDetached&&this._detachFromToolbarAttachInBackdrop(),e.isDragging){const t={dialog:this,newPosition:"coordinates",coordinates:e.coordinates};this._toolbarContainer.classList.add(`${k}-toolbar--dialog-attached--dragged`),this._positionChangeToCoordinates(t)}}});t.init(),this._dragInstance=t}_renderDragHandler(){this._controls.innerContainer.classList.add(`${k}-dialog__container--draggable`),this._controls.dragContainer=this._document.createElement("div"),this._controls.dragContainer.classList.add(`${k}-dialog__drag-container`),this._controls.dragHandler=this._document.createElement("div"),this._controls.dragHandler.classList.add(`${k}-dialog__drag-handler`),w._customDragHandleRender&&(this._destroyDragHandleRender=w._customDragHandleRender({context:this,root:this._controls.container,mountInNode:this._controls.dragHandler,position:this._getCorrectPosition(this._uiOptions.dialogPosition),isSmallSize:this._isSmallSize})),this._controls.dragContainer.appendChild(this._controls.dragHandler),this._controls.innerContainer.insertBefore(this._controls.dragContainer,this._controls.innerContainer.firstChild),this._dragInstance||this._applyDrag(this._getCorrectPosition(this._uiOptions.dialogPosition))}_getDraggableMountNode(){return this._backdropRoot||this._toolbarContainer.ownerDocument.body}_getNonDraggableMountNode(){return this._toolbarContainer}_createContainerLayout(){this._controls.container=(0,h.createContainerElement)(this._document,w.CONTAINER_ELEMENT_NAME),this._controls.innerContainer=this._document.createElement(`${k}-div`),this._controls.innerContainer.classList.add(`${k}-dialog__container`,"notranslate"),this._uiOptions.dialogWidth&&this._controls.innerContainer.style.setProperty("width",`${this._uiOptions.dialogWidth}px`,"important"),this._controls.container.appendChild(this._controls.innerContainer),this._controls.content=this._document.createElement(`${k}-div`),this._controls.content.className=`${k}-dialog__content`,this._controls.pointer=this._document.createElement(`${k}-span`),this._controls.pointer.className=`${k}-dialog__pointer`,r.BrowserDetector.isSafari()&&this._controls.innerContainer.classList.add(`${k}-dialog__container--safari`),this._uiOptions.draggable&&this._renderDragHandler()}_getNormalizedCoordinates(e){const t=this._controls.innerContainer.getBoundingClientRect();let n;if(e){const s=new i.DomMeasurement(this._document);n=R(function(e,t){const{width:n,height:s}=t;let{top:r,left:i,bottom:o,right:a,width:l,height:c}=e;{const e=!(0,v.isUndefined)(r),t=!(0,v.isUndefined)(i);e||(0,v.isUndefined)(o)||(r=s-o-c),t||(0,v.isUndefined)(a)||(i=n-a-l)}if(!(0,v.isUndefined)(r)){const e=r+c+w.SPACE_TO_SCREEN_EDGE-s;e>0&&(r-=e)}if(!(0,v.isUndefined)(i)){const e=i+l+w.SPACE_TO_SCREEN_EDGE-n;e>0&&(i-=e)}return{top:Math.max(r,0),left:Math.max(i,0)}}({...L(e),width:t.width,height:t.height},s.getDocumentVisibleBox()))}else n=R(function(e,t,n){const{clientHeight:s,clientWidth:r}=n,i=e.left-t.width-w.SPACE_TO_SCREEN_EDGE,o=e.left+e.width+t.width+w.SPACE_TO_SCREEN_EDGE,a=e.top-t.height-w.SPACE_TO_SCREEN_EDGE,l=e.top+e.height+t.height+w.SPACE_TO_SCREEN_EDGE,c=o<=r,d=l<=s;let h,u;return i>=0?h=i:c&&(h=o),a>=0?u=a:d&&(u=l),{top:u,left:h}}(this._toolbarContainer.getBoundingClientRect(),t,{clientWidth:document.doctype?this._document.documentElement.clientWidth:Math.min(this._document.documentElement.clientWidth,document.body.clientWidth),clientHeight:document.doctype?this._document.documentElement.clientHeight:Math.min(this._document.documentElement.clientHeight,document.body.clientHeight)}));return n}_moveToInitialPosition(){const e={position:"fixed",...this._getNormalizedCoordinates(this._state.coordinates)},t=new i.DomMeasurement(this._document);this._controls.innerContainer.classList.add(`${k}-dialog__container-hide`),t.setStyles(this._controls.innerContainer,e,!0),this._controls.innerContainer.classList.remove(`${k}-dialog__container-hide`)}_mountDialogInDOM(e){this._controls.header&&this._controls.innerContainer.appendChild(this._controls.header),this._controls.content&&this._controls.innerContainer.appendChild(this._controls.content),this._controls.pointer&&this._controls.innerContainer.appendChild(this._controls.pointer),this._controls.footer&&o.EnvironmentAdapter.isRuntimeConnected()&&this._controls.innerContainer.appendChild(this._controls.footer),e.appendChild(this._controls.container),this._toolbarContainer.classList.add(`${k}-toolbar--dialog-opened`,`${k}-toolbar--dialog-attached`)}static getValidatedCoordinates(e){if(e?.top||e?.left||e?.bottom||e?.right)return e}_detachFromToolbarAttachInBackdrop(){if(this._uiOptions.draggable&&(0,s.elementContains)(this._toolbarContainer,this._controls.container)){const e=this._controls.innerContainer.getBoundingClientRect(),t=R({top:e.top,left
388:e.left}),{x:n,y:s}=this._dragInstance?.getPreviousCoords()||{};if(this._dragInstance?.destroy(),this._dragInstance=null,this._applyDrag("coordinates"),this._getDraggableMountNode().appendChild(this._controls.container),this._controls.innerContainer.classList.add(`${k}-dialog__container-hide`),new i.DomMeasurement(this._document).setStyles(this._controls.innerContainer,{position:"fixed",...t},!0),this._controls.innerContainer.classList.remove(`${k}-dialog__container-hide`),null!==this._dragInstance&&void 0!==n&&void 0!==s){const e=new MouseEvent("mouseover",{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:s});this._dragInstance.getDragHandle().dispatchEvent(e);const t=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:s});this._dragInstance.getDragHandle().dispatchEvent(t)}}}_positionChangeToCoordinates(e){this._debounceUpdate||(this._debounceUpdate=new y.Debounce((()=>{(0,h.dispatchCustomEvent)(document,w.eventNames.positionChangeClicked,e)}))),this._debounceUpdate.call(),this._position("coordinates",!0)}changeVisiblity(e){e?this._controls.innerContainer.classList.remove(`${k}-dialog__container-hide`):this._controls.innerContainer.classList.add(`${k}-dialog__container-hide`)}}function R(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,`${t}px`])))}function L(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,parseFloat(t)])).filter((([e,t])=>!Number.isNaN(t))))}w.CONTAINER_ELEMENT_NAME=`${k}-dialog`,w.SPACE_TO_SCREEN_EDGE=5,w.eventNames={turnOff:`${k}-dialog.turnOff`,pauseChecking:`${k}-dialog.pauseChecking`,enableHere:`${k}-dialog.enableHere`,enableEverywhere:`${k}-dialog.enableEverywhere`,languageChanged:`${k}-dialog.languageChanged`,countChanged:`${k}-dialog.countChanged`,errorSelected:`${k}-dialog.errorSelected`,errorHighlighted:`${k}-dialog.errorHighlighted`,addToDictionaryClicked:`${k}-dialog.addToDictionaryClicked`,ignoreRuleClicked:`${k}
388-dialog.ignoreRuleClicked`,temporarilyIgnoreWordClicked:`${k}-dialog.temporarilyIgnoreWordClicked`,temporarilyIgnoreRuleClicked:`${k}-dialog.temporarilyIgnoreRuleClicked`,moreDetailsClicked:`${k}-dialog.moreDetailsClicked`,fixSelected:`${k}-dialog.fixSelected`,openOptions:`${k}-dialog.openOptions`,showFeedbackForm:`${k}-dialog.showFeedbackForm`,destroyed:`${k}-dialog.destroyed`,togglePickyMode:`${k}-dialog.togglePickyMode`,positionChangeClicked:`${k}-dialog.positionChangeClicked`,badgeClicked:`${k}-dialog.badgeClicked`,premiumTeaserClicked:`${k}-dialog.premiumTeaserClicked`,correctAll:`${k}-dialog.correctAll`,unlockSuggestion:`${k}-card.unlockSuggestion`},w._isInitialized=!1},
388"./content/domWalker.ts":
389/*!******************************!*\
390  !*** ./content/domWalker.ts ***!
391  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{DOMWalker:()=>s});
392/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
393class s{static create(e,t=e){return e===t?new s.TreeWalkerWrapper(e):new s.CustomWalker(e,t)}}s.TreeWalkerWrapper=class extends s{constructor(e){super(),this._treeWalker=document.createTreeWalker(e),this._currentNode=e}get currentNode(){return this._currentNode}next(e=!1){if(e){for(;!this._treeWalker.nextSibling();)if(!this._treeWalker.parentNode())return null;this._currentNode=this._treeWalker.currentNode}else try{const e=this._treeWalker.nextNode();if(!e)return null;this._currentNode=e}catch(e){return null}return this._currentNode}},s.CustomWalker=class extends s{get currentNode(){return this._currentNode}constructor(e,t){super(),this._rootNode=e,this._currentNode=t}next(e=!1){if(!e&&this._currentNode.firstChild)this._currentNode=this._currentNode.firstChild;else{if(this._currentNode===this._rootNode)return null;if(this._currentNode.nextSibling)this._currentNode=this._currentNode.nextSibling;else{let e=this._currentNode;for(;!e.nextSibling;){if(!e.parentNode||e.parentNode===this._rootNode)return null;e=e.parentNode}this._currentNode=e.nextSibling}}return this._currentNode}}},
393"./content/editors/codemirror/codeMirror5CEElementEditorWrapper.ts":
394/*!*************************************************************************!*\
395  !*** ./content/editors/codemirror/codeMirror5CEElementEditorWrapper.ts ***!
396  \*************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CodeMirror5CEElementEditorWrapper:()=>o});var s=n(/*! ../../../common/utils */"./common/utils.ts"),r=n(/*! ../../ceElementWrapper */"./content/ceElementWrapper.ts"),i=n(/*! ../../eventMuffler */"./content/eventMuffler.ts");
397/*! (C) Copyright 2022 LanguageTooler GmbH. All rights reserved. */
398class o extends r.CEElementWrapper{findReplacementPosition(e,t,n){return""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1),{offset:e,length:t}}async replaceText(e,t,n,o){if(e<0)return Promise.resolve();""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1);const a=this._inputArea.ownerDocument.createRange();let l=null,c=null;for(let n=this._getTextChunkIndex(e);n<this._textChunks.length;n++){const{node:s,isTextNode:r,rawText:i,parsedText:o,parsedTextOffset:d}=this._textChunks[n];if(r){if(e>=d&&e<d+o.length){const t=this._offsetInRawText(i,o,e-d);a.setStart(s,t),l=s}if(e+t>=d&&e+t<=d+o.length){const n=this._offsetInRawText(i,o,e+t-d);a.setEnd(s,n),c=s;break}}}if(!l||!c)return Promise.resolve();const d=a.getBoundingClientRect(),h=new i.EventMuffler(["mouseout","mouseover","mousemove","mousedown","mouseup","pointerout","pointerover","pointermove","pointerdown","pointerup","click","dblclick"]);try{r.CEElementWrapper._simulateMouseDown(l.parentElement||this._inputArea,d),h.mute(),await(0,s.wait)(25),h.unmute(),r.CEElementWrapper._simulateMouseMove(c.parentElement||this._inputArea,d),r.CEElementWrapper._simulateMouseUp(c.parentElement||this._inputArea,d);const i=self.getSelection();i.removeAllRanges(),i.addRange(a),h.mute(),await(0,s.wait)(125),h.unmute(),!n&&t>0?await this.simulateDelete():(0,s.simulatePaste)(this._inputArea,{"text/plain":n}),h.mute(),await(0,s.wait)(100),h.unmute(),this.setSelection({start:e+n.length})}finally{h.unmute()}}}},
398"./content/editors/codemirror/codeMirror5TextAreaEditorWrapper.ts":
399/*!************************************************************************!*\
400  !*** ./content/editors/codemirror/codeMirror5TextAreaEditorWrapper.ts ***!
401  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CodeMirror5TextAreaEditorWrapper:()=>o});var s=n(/*! ../../../common/utils */"./common/utils.ts"),r=n(/*! ../../ceElementWrapper */"./content/ceElementWrapper.ts"),i=n(/*! ../../domWalker */"./content/domWalker.ts");
402/*! (C) Copyright 2022 LanguageTooler GmbH. All rights reserved. */
403class o extends r.CEElementWrapper{_getSelectionElements(){const e=this._inputArea.closest(o.EDITOR_CONTAINER_SELECTOR);if(!e)return[];const t=Array.from(e.querySelectorAll(o.SELECTION_ELEMENTS_SELECTOR)).map((e=>({element:e,rect:e.getBoundingClientRect()})));return t.sort(((e,t)=>e.rect.top===t.rect.top?e.rect.left-t.rect.left:e.rect.top-t.rect.top)),t.map((e=>e.element))}_getCursorElements(){const e=this._inputArea.closest(o.EDITOR_CONTAINER_SELECTOR);return e?Array.from(e.querySelectorAll(o.CURSOR_ELEMENTS_SELECTOR)):[]}_getTextNodeAtPoint(e,t,n,r=!1){e+=r?-1:1;let o=null,a=.25;do{if(o=document.elementFromPoint(e,t+n*a),"SPAN"===o?.nodeName){const n=new Range,r=i.DOMWalker.create(o);for(;r.next();){const i=r.currentNode;if((0,s.isTextNode)(i)){n.setStart(i,0),n.setEnd(i,i.textContent?.length||0);const r=n.getBoundingClientRect();if((0,s.isPointInsideRect)(r,e,t))return i}}}a+=.25}while(a<1);return null}_getSelectionOffset(e,t=!1){const n=e.getBoundingClientRect(),s=this._getTextNodeAtPoint(t?n.right:n.left,n.top,n.height,t);if(!s?.textContent)return null;let r=Number.MAX_VALUE,i=0;const o=new Range;t?o.setStart(s,0):o.setEnd(s,s.textContent.length);for(let e=0;e<=s.textContent.length;e++){let a=0;if(t?(o.setEnd(s,e),a=Math.abs(o.getBoundingClientRect().right-n.right)):(o.setStart(s,e),a=Math.abs(o.getBoundingClientRect().left-n.left)),!(a<r))break;r=a,i=e}return{node:s,offset:i}}findReplacementPosition(e,t,n){return""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1),{offset:e,length:t}}async replaceText(e,t,n,i){if(e<0)return Promise.resolve();const a=this._inputArea.closest(o.EDITOR_CONTAINER_SELECTOR);if(!a)return Promise.resolve();const l=a.querySelector(o.PASTE_TEXTAREA_SELECTOR);if(!l)return Promise.resolve();""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1);const c=this._inputArea.ownerDocument.createRange();let d=null,h=null;for(let n=this._getTextChunkIndex(e);n<this._textChunks.length;n++){const{node:s,isTextNode:r,rawText:i,parsedText:o,parsedTextOffset:a}=this._textChunks[n];if(r){if(e>=a&&e<a+o.length){const t=this._offsetInRawText(i,o,e-a);c.setStart(s,t),d=s}if(e+t>=a&&e+t<=a+o.length){const n=this._offsetInRawText(i,o,e+t-a);c.setEnd(s,n),h=s;break}}}if(!d||!h)return Promise.resolve();let u=c.getBoundingClientRect();r.CEElementWrapper._simulateMouseDown(d.parentElement||this._inputArea,u),u=c.getBoundingClientRect(),r.CEElementWrapper._simulateMouseMove(h.parentElement||this._inputArea,u,!0),r.CEElementWrapper._simulateMouseUp(h.parentElement||this._inputArea,u),!n&&t>0?await this.simulateDelete():((0,s.simulatePaste)(l,{"text/plain":n}),l.value=""),this.setSelection({start:e+n.length})}getSelection(){let e=null,t=null;const n=this._getSelectionElements(),s=this._getCursorElements();if(n.length?(e=this._getSelectionOffset(n[0]),t=this._getSelectionOffset(n[n.length-1],!0)):1===s.length&&(e=this._getSelectionOffset(s[0]),t=e),!e||!t)return null;const r=this._getTextOffset(e.node,e.offset);return{start:r,end:e===t?r:this._getTextOffset(t.node,t.offset)}}}o.EDITOR_CONTAINER_SELECTOR="div.CodeMirror",o.PASTE_TEXTAREA_SELECTOR="div.CodeMirror textarea",o.SELECTION_ELEMENTS_SELECTOR="div.CodeMirror-lines div.CodeMirror-selected",o.CURSOR_ELEMENTS_SELECTOR="div.CodeMirror-cursors div.CodeMirror-cursor"},
403"./content/editors/codemirror/codeMirror6EditorWrapper.ts":
404/*!****************************************************************!*\
405  !*** ./content/editors/codemirror/codeMirror6EditorWrapper.ts ***!
406  \****************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CodeMirror6EditorWrapper:()=>l});var s=n(/*! ../../../common/utils */"./common/utils.ts"),r=n(/*! ../../../core/utils */"./core/utils.ts"),i=n(/*! ../../ceElementWrapper */"./content/ceElementWrapper.ts"),o=n(/*! ../../domWalker */"./content/domWalker.ts"),a=n(/*! ../../inputAreaWrapper */"./content/inputAreaWrapper.ts");
407/*! (C) Copyright 2022 LanguageTooler GmbH. All rights reserved. */
408class l extends i.CEElementWrapper{_updateText(){const e=[];let t=0,n=null,l=!0,c=!1,d=!1;const h=o.DOMWalker.create(this._inputArea);let u=!1;do{const o=h.currentNode;null===n&&(n=this._ceElementInspector.getParagraphLastValuableNode(o)),u=!1;let g=!1,m="";if((0,s.isElementNode)(o))if(m=this._ceElementInspector.getReplacementText(o),o===n&&(n=null,this._ceElementInspector.isTextEndsWithLineBreak(o)&&(l=!0,c=!1,m+=a.InputAreaWrapper.PARAGRAPH_SEPARATOR)),this._ceElementInspector.isSkippingElement(o)){if(u=!0,n=null,!m)continue}else this._ceElementInspector.isBlock(o)?(n=null,l=!0,c=!1):this._ceElementInspector.isBr(o)&&(n=null,l=!0,c=!1,!m&&this._ceElementInspector.isBRElementRelevant(o)&&(m=a.InputAreaWrapper.PARAGRAPH_SEPARATOR));else if((0,s.isTextNode)(o)&&(g=!0,m=this._ceElementInspector.getParsedText(o),m)){const e=null===n||n===o;this._ceElementInspector.getParsingOptions(o).preserveWhitespaces||((l||c)&&(m=m.replace(i.CEElementWrapper.LEADING_WHITESPACES_REGEXP,"")),e&&(m=m.replace(i.CEElementWrapper.TRAILING_WHITESPACES_REGEXP,""))),l=l&&""===m,c=(0,r.isEndsWithWhitespace)(m),n===o&&(n=null,this._ceElementInspector.isTextEndsWithLineBreak(o)&&(l=!0,c=!1,m+=a.InputAreaWrapper.PARAGRAPH_SEPARATOR))}if(e.push({node:o,isTextNode:g,rawText:g?o.nodeValue:"",parsedText:m,parsedTextOffset:t}),t+=m.length,this.hasReachedMaxTextLength(e)){d=!0;break}}while(h.next(u));let g="";for(const t of e)g+=t.parsedText;const m=this._text!==g||this._isTextTooLong!==d;return this._text=g,this._textChunks=e,this._isTextTooLong=d,m}}},
408"./content/eventMuffler.ts":
409/*!*********************************!*\
410  !*** ./content/eventMuffler.ts ***!
411  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventMuffler:()=>s});
412/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
413class s{static _eventCallback(e){return e.stopImmediatePropagation(),e.preventDefault(),!1}constructor(e){this._isMuted=!1,Array.isArray(e)||(e=[e]),this._eventNames=e}mute(){if(!this._isMuted){for(const e of this._eventNames)document.addEventListener(e,s._eventCallback,{capture:!0});this._isMuted=!0}}unmute(){if(this._isMuted){for(const e of this._eventNames)document.removeEventListener(e,s._eventCallback,{capture:!0});this._isMuted=!1}}}},
413"./content/formElementMirror.ts":
414/*!**************************************!*\
415  !*** ./content/formElementMirror.ts ***!
416  \**************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{FormElementMirror:()=>d});var s=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),i=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),o=n(/*! ../common/utils */"./common/utils.ts"),a=n(/*! ../config/config */"./config/config.ts"),l=n(/*! ../core/utils */"./core/utils.ts"),c=n(/*! ./mirror */"./content/mirror.ts");
417/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
418class d extends c.Mirror{constructor(e,t,n){super(e,t),this._shadowRoot=null,this._firefoxHackEnabled=!1,this._render=()=>{if(!this._mimickedElement.parentElement)return;this._domMeasurement.clearCache();const e=this._domMeasurement.getContentBox(this._mimickedElement,!1,!1),t=this._domMeasurement.getContentBox(this._mimickedElement,!1);if(!this._container){this._container=(0,o.createContainerElement)(document,d.CONTAINER_ELEMENT_NAME),this._container.style.display="none";const e=this._tweaks.getTargetElement().getAttribute("slot");if(e&&this._container.setAttribute("slot",e),this._wrapper=document.createElement("lt-div"),this._wrapper.setAttribute("spellcheck","false"),this._wrapper.className="lt-mirror__wrapper notranslate",this._canvas=document.createElement("lt-div"),this._canvas.className="lt-mirror__canvas",this._textContainer=document.createElement("lt-span"),this._canvas.appendChild(this._textContainer),this._wrapper.appendChild(this._canvas),this._container.appendChild(this._wrapper),this._canUseShadowDom())try{this._shadowRoot=this._getShadowRoot(this._mimickedElement.parentElement)}catch{}(s.BrowserDetector.isFirefox()||s.BrowserDetector.isThunderbird())&&(this._elementInlineLineHeight=this._domMeasurement.getInlineStyle(this._mimickedElement,"line-height"),this._elementComputedLineHeight=this._domMeasurement.getStyle(this._mimickedElement,"line-height"),this._domMeasurement.getStyle(this._mimickedElement,"transition-property").match(/all|line\-height/)||(this._firefoxHackEnabled=!0));const t=this._domMeasurement.getStyle(this._mimickedElement.parentElement,"display");c.Mirror.FLEX_GRID_DISPLAY_VALUES.includes(t)&&this._container.classList.add("lt-mirror--grid-item")}this._firefoxHackEnabled&&(this._mimickedElement.style.lineHeight===this._elementComputedLineHeight?this._domMeasurement.setStyles(this._mimickedElement,{"line-height":this._elementInlineLineHeight||""}):this._elementInlineLineHeight=this._domMeasurement.getInlineStyle(this._mimickedElement,"lineHeight"),this._elementComputedLineHeight=this._domMeasurement.getStyle(this._mimickedElement,"line-height"),this._elementComputedLineHeight.includes("px")&&this._domMeasurement.setStyles(this._mimickedElement,{"line-height":this._elementComputedLineHeight}));const n=this._domMeasurement.getStyles(this._mimickedElement,d.MIMICKED_ELEMENT_COPIED_PROPERTIES);n["font-size"]=this._getWrapperFontSizeValue(n["font-size"]),n["line-height"]=this._domMeasurement.getExactStyle(this._mimickedElement,"line-height"),n["white-space"]=this._getWrapperWhiteSpaceValue(n["white-space"]),(0,l.isSameObjects)(n,this._wrapperStyles)||(this._domMeasurement.resetStyles(this._wrapper,n,!0),this._wrapperStyles=n),this._updateText(),this._addContainer(),this._domMeasurement.setStyles(this._wrapper,{width:e.width+"px",height:e.height+"px"},!0);const r=this._domMeasurement.getContentBox(this._wrapper,!1);if(r.width>0&&r.height>0){const e=t.left-r.left;if(Math.abs(e)>.05){const t=this._domMeasurement.getScaleFactor(this._wrapper),n=this._domMeasurement.getZoom(this._wrapper),s=t.x*n;let r=parseFloat(this._domMeasurement.getStyle(this._wrapper,"margin-left"));r=(r*s+e)/s,this._domMeasurement.setStyles(this._wrapper,{"margin-left":r+"px"},!0)}const n=t.top-r.top;if(Math.abs(n)>.05){const e=this._domMeasurement.getScaleFactor(this._wrapper),t=this._domMeasurement.getZoom(this._wrapper),s=e.y*t;let r=parseFloat(this._domMeasurement.getStyle(this._wrapper,"margin-top"));r=(r*s+n)/s,this._domMeasurement.setStyles(this._wrapper,{"margin-top":r+"px"},!0)}}const i=this._domMeasurement.getScrollDimensions(this._mimickedElement,!1);let a=i.width-e.padding.left-e.padding.right;const h=i.height-e.padding.top-e.padding.bottom;a===Math.round(e.width)&&(a=e.width),this._domMeasurement.setStyles(this._canvas,{width:a+"px",height:h+"px","align-content":this._domMeasurement.getStyle(this._mimickedElement,"align-content")},!0),this._updateScrolling(!1)},this._updateText=()=>{let e=this._mimickedElement.value;this._currentText!==e&&(this._currentText=e,e.endsWith("\n")&&(e+="​"),this._textContainer.textContent=e,this._updateScrolling(),this._dispatchInput())},this._onMimickedElementBeforeInput=e=>{e.defaultPrevented&&this._updateText()},this._onMimickedElementScroll=()=>{requestAnimationFrame((()=>{this._updateScrolling()}))},this._onSelectionChange=e=>{this._mimickedElement===e.target&&this._updateText()},this._onMimickedElementClick=e=>{void 0!==e.clientX&&void 0!==e.clientY&&this._dispatchClick(e)},this._onMimickedElementMousemove=e=>{void 0!==e.clientX&&void 0!==e.clientY&&this._dispatchMousemove(e)},this._useShadowDom=n,this._domMeasurement=new r.DomMeasurement(this._mimickedElement.ownerDocument),this._render(),this._mimickedElement.addEventListener("scroll",this._onMimickedElementScroll),this._mimickedElement.addEventListener("click",this._onMimickedElementClick),this._mimickedElement.addEventListener("input",this._updateText),this._mimickedElement.addEventListener("mousemove",this._onMimickedElementMousemove),this._mimickedElement.addEventListener("beforeinput",this._onMimickedElementBeforeInput),this._mimickedElement.addEventListener("keypress",this._onMimickedElementBeforeInput),this._mimickedElement.ownerDocument.addEventListener("selectionchange",this._onSelectionChange,!0),self.ResizeObserver&&(this._mimickedElementResizeObserver=new self.ResizeObserver(this._render),this._mimickedElementResizeObserver.observe(this._mimickedElement)),this._renderInterval=(0,o.setAnimationFrameInterval)(this._render,a.RENDER_INTERVAL)}_dispatchClick(e){const t=new MouseEvent(c.Mirror.eventNames.click,{view:self,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,bubbles:!0,cancelable:!0});this._wrapper.dispatchEvent(t)}
418_dispatchMousemove(e){const t=new MouseEvent(c.Mirror.eventNames.mousemove,{view:self,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,bubbles:!0,cancelable:!0});this._wrapper.dispatchEvent(t)}_dispatchInput(){const e=new Event(c.Mirror.eventNames.input,{bubbles:!0,cancelable:!0});this._addContainer(),this._wrapper.dispatchEvent(e)}_canUseShadowDom(){if(!this._useShadowDom)return!1;const e=this._mimickedElement.parentElement;return!!e&&(0,o.canElementHostShadowRoot)(e)}_getShadowRoot(e){if(d._shadowRoots.has(e)){const t=d._shadowRoots.get(e);return i.EnvironmentAdapter.injectShadowStyles(t),t}const t=(0,o.createShadowRoot)(e,this._domMeasurement);return t&&(i.EnvironmentAdapter.injectShadowStyles(t),d._shadowRoots.set(e,t)),t}_addContainer(){if(this._shadowRoot)this._shadowRoot.contains(this._container)||this._shadowRoot.prepend(this._container);else{const e=this._tweaks.getTargetElement();e.previousElementSibling!==this._container&&e.parentNode&&(e.parentNode.insertBefore(this._container,e),i.EnvironmentAdapter.linkInputAreaProperties(this._container.ownerDocument))}}_getTextZoom(e=!1){return e&&this._domMeasurement.clearCache(),this._container&&(s.BrowserDetector.isFirefox()||s.BrowserDetector.isThunderbird())?(this._measurer||(this._measurer=document.createElement("lt-div"),this._measurer.className="lt-mirror__measurer",this._container.appendChild(this._measurer)),(Number.parseInt(this._domMeasurement.getStyle(this._measurer,"font-size"))||0)/100):1}_getWrapperFontSizeValue(e){const t=this._getTextZoom();return 1===t?e:(Number.parseFloat(e)||0)/t+"px"}_getWrapperWhiteSpaceValue(e){if(s.BrowserDetector.isChromium()){if("normal"===e)return"pre-wrap";if("nowrap"===e)return"pre"}return e}_updateScrolling(e=!0){e&&this._domMeasurement.clearCache();const t=this._domMeasurement.getScrollPosition(this._mimickedElement,!1),n=this._domMeasurement.getScrollPosition(this._mimickedElement,!0,!1),s=this._domMeasurement.getScrollPosition(this._mimickedElement);this._domMeasurement.setStyles(this._canvas,{"margin-top":-t.top+"px","margin-left":-t.left+"px"},!0),this._wrapper.dataset.ltScrollTop=t.top.toString(),this._wrapper.dataset.ltScrollLeft=t.left.toString(),this._wrapper.dataset.ltScrollTopScaled=n.top.toString(),this._wrapper.dataset.ltScrollLeftScaled=n.left.toString(),this._wrapper.dataset.ltScrollTopScaledAndZoomed=s.top.toString(),this._wrapper.dataset.ltScrollLeftScaledAndZoomed=s.left.toString()}isShadowDomUsed(){return!!this._shadowRoot}getCloneElement(){return this._wrapper}getTextElement(){return this._textContainer}hasTextAtPoint(e){return(this._shadowRoot||document).elementFromPoint(e.x,e.y)===this._textContainer}enableRangeMeasurements(){this._wrapper.classList.add("lt-mirror-enable-range-measurement")}disableRangeMeasurements(){this._wrapper.classList.remove("lt-mirror-enable-range-measurement")}destroy(){if(this._mimickedElement.removeEventListener("input",this._updateText),this._mimickedElement.removeEventListener("scroll",this._onMimickedElementScroll),this._mimickedElement.removeEventListener("click",this._onMimickedElementClick),this._mimickedElement.removeEventListener("mousemove",this._onMimickedElementMousemove),this._mimickedElement.removeEventListener("beforeinput",this._onMimickedElementBeforeInput),this._mimickedElement.removeEventListener("keypress",this._onMimickedElementBeforeInput),this._mimickedElement.ownerDocument.removeEventListener("selectionchange",this._onSelectionChange,!0),this._renderInterval&&this._renderInterval.destroy(),this._container&&this._container.remove(),this._shadowRoot){const e=Array.from(this._shadowRoot.children);for(const t of e)"SLOT"!==t.tagName.toUpperCase()&&t.remove()}this._mimickedElementResizeObserver&&this._mimickedElementResizeObserver.disconnect(),this._domMeasurement.clearCache()}}d.CONTAINER_ELEMENT_NAME="lt-mirror",d.MIMICKED_ELEMENT_COPIED_PROPERTIES=["border","border-radius","border-top-width","border-right-width","border-left-width","border-bottom-width","border-top-style","border-right-style","border-left-style","border-bottom-style","direction","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-weight","hyphens","letter-spacing","line-break","margin","margin-top","margin-left","margin-bottom","margin-right","padding","padding-top","padding-left","padding-right","padding-bottom","text-align","text-decoration","text-indent","text-rendering","text-transform","transform","transform-origin","unicode
418-bidi","white-space","word-spacing","word-wrap","writing-mode","zoom","-webkit-locale","-webkit-rtl-ordering"],d._shadowRoots=new WeakMap},
418"./content/formElementWrapper.ts":
419/*!***************************************!*\
420  !*** ./content/formElementWrapper.ts ***!
421  \***************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{FormElementWrapper:()=>d});var s=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../common/utils */"./common/utils.ts"),i=n(/*! ../core/utils */"./core/utils.ts"),o=n(/*! ./ceElementInspector */"./content/ceElementInspector.ts"),a=n(/*! ./domWalker */"./content/domWalker.ts"),l=n(/*! ./inputAreaWrapper */"./content/inputAreaWrapper.ts"),c=n(/*! ./mirror */"./content/mirror.ts");
422/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
423class d extends l.InputAreaWrapper{constructor(e,t,n,s){super(e,n,s),this._scrollToInterval=null,this._onDblClick=async e=>{this._dispatchDblClickEvent(this._mirrorElement,e.clientX,e.clientY)},this._onScroll=()=>{const e=this._inputArea.scrollTop,t=this._inputArea.scrollLeft;if(this._scrollTop===e&&this._scrollLeft===t)return;this._scrollTop=e,this._scrollLeft=t;const n={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,l.InputAreaWrapper.eventNames.scroll,n)},this._onClick=()=>{const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,l.InputAreaWrapper.eventNames.click,e)},this._mirror=t,this._mirrorElement=t.getCloneElement(),this._ceElementInspector=new o.CEElementInspector(this._mirrorElement,this._tweaks.getParsingDetector()),this._scrollTop=this._inputArea.scrollTop,this._scrollLeft=this._inputArea.scrollLeft,this._updateText(),this._inputArea.addEventListener("dblclick",this._onDblClick),this._inputArea.addEventListener("click",this._onClick),this._tweaks.addScrollEventListener(this._onScroll),this._mirrorElement.addEventListener(c.Mirror.eventNames.input,this._onInput)}_hasSpaceBefore(e){if(e<=0||0===this._textChunks.length)return!1;const t=this._textChunks[0],n=this._offsetInRawText(t.rawText,t.parsedText,e-1),s=this._offsetInRawText(t.rawText,t.parsedText,e);return d.VISIBLE_WHITE_SPACE_REGEXP.test(t.rawText.substring(n,s))}_hasSpaceAfter(e){if(0===this._textChunks.length)return!1;const t=this._textChunks[0],n=this._offsetInRawText(t.rawText,t.parsedText,e),s=this._offsetInRawText(t.rawText,t.parsedText,e+1);return d.VISIBLE_WHITE_SPACE_REGEXP.test(t.rawText.substring(n,s))}_offsetInRawText(e,t,n){n=Math.min(e.length,n);const s=(0,i.indexOfZWC)(e);if(-1===s||n<s)return n;let r=s,o=s;do{if((0,i.isZWC)(e[r])||o++,o>n)break;r++}while(r<e.length);return r}_offsetInParsedText(e,t,n){let s=0;for(let t=0;t<Math.min(e.length,n);t++)(0,i.isZWC)(e[t])&&s++;return n-s}_updateText(){const e=[];let t="",n=!1;const s=this._mirror.getTextElement().firstChild;if(s){const r=s.textContent||"";if(t=this._ceElementInspector.getParsedText(s),t.length>this._maxTextLength){const e=this._truncateText(t);n=e.length<t.length,t=e}e.push({node:s,isTextNode:!0,rawText:r,parsedText:t,parsedTextOffset:0})}const r=this._text!==t||this._isTextTooLong!==n;return this._text=t,this._textChunks=e,this._isTextTooLong=n,r}_truncateText(e){let t="";const n=e.split("\n");for(let e=0;e<n.length&&(e>0&&(t+="\n"),t+=n[e],!(t.length>this._maxTextLength));e++);return t.length>this._generousMaxTextLength&&(t=t.substring(0,this.getReasonableTextCutOffIndex(t,this._generousMaxTextLength))),t}_getTextOffset(e,t){let n=null,s=0;if((0,r.isElementNode)(e)){const i=a.DOMWalker.create(this._mirrorElement);do{const s=i.currentNode;if(s===e.childNodes[t])break;(0,r.isTextNode)(s)&&s.textContent&&(n=s)}while(i.next());if(!n)return-1;s=n.textContent.length}else(0,r.isTextNode)(e)&&(n=e,s=t);const i=this._textChunks.find((e=>e.node===n));return i?i.parsedTextOffset+this._offsetInParsedText(i.rawText,i.parsedText,s):-1}getTextBoxes(e,t){const n=0===t,s=this.getTextRanges(e,t,n);return s.length?(this._domMeasurement.clearCache(),this._domMeasurement.getTextBoundingBoxes(s,this._mirrorElement,n)):[]}resetText(){const e=this._inputArea.value;this._inputArea.value="",this._inputArea.value=e}findReplacementPosition(e,t,n){return""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1),{offset:e,length:t}}replaceText(e,t,n,r){if(e<0||0===this._textChunks.length)return Promise.resolve();const i=e+n.length;""===n&&(this._hasSpaceBefore(e)||0===e)&&this._hasSpaceAfter(e+t)&&(e=Math.max(e-1,0),t+=1),this.setSelection({start:e,end:e+t});const o=document.execCommand("insertText",!1,n),a=(s.BrowserDetector.isFirefox()||s.BrowserDetector.isThunderbird())&&n.includes(d.NBSP);if(o){if(a){const t=this._inputArea.value,s=this._textChunks[0],r=this._offsetInRawText(t,s.parsedText,e),i=this._offsetInRawText(t,s.parsedText,e+n.length),o=t.substring(0,r)+n+t.substring(i);this._inputArea.value=o}}else{const s=this._textChunks[0],r=this._offsetInRawText(s.rawText,s.parsedText,e),i=this._offsetInRawText(s.rawText,s.parsedText,e+t),o=s.rawText.substring(0,r)+n+s.rawText.substring(i);this._inputArea.value=o}return this.setSelection({start:i}),o||this.simulateInput(n),Promise.resolve()}insertImage(e){return this.insertText({text:e["text/plain"]})}insertText({text:e}){const t=this.getSelection();if(!t)return Promise.reject();if(!document.execCommand("insertText",!1,e)){const n=this._textChunks[0],s=this._offsetInRawText(n.rawText,n.parsedText,t.start),r=n.rawText.substring(0,s)+e+n.rawText.substring(s);this._inputArea.value=r,this.setSelection({start:t.start+e.length}),this.simulateInput(e)}return Promise.resolve()}getSelection(){if(this._inputArea!==(0,r.getActiveElement)())return null;const e=this.getText();return{start:this._offsetInParsedText(this._inputArea.value,e,this._inputArea.selectionStart),end:this._offsetInParsedText(this._inputArea.value,e,this._inputArea.selectionEnd)}}setSelection(e){const t=e.start,n=void 0===e.end?t:e.end;if(this._inputArea.focus(),0===this._textChunks.length)return;const s=this._textChunks[0];this._inputArea.selectionStart=this._offsetInRawText(s.rawText,s.parsedText,t),this._inputArea.selectionEnd=this._offsetInRawText(s.rawText,s.parsedText,n)}getWordAtPoint(e,t){this._mirror.enableRangeMeasurements();const n=(0,r.getRangeAtPoint)({x:e,y:t});if(this._mirror.disableRangeMeasurements(),!n||!this._mirrorElement.contains(n.startContainer)||n.startContainer.nodeType!==this._inputArea.ownerDocument.TEXT_NODE)return null;const s=this._getTextOffset(n.startContainer,n.startOffset),o=this.getText();return(0,i.getWordPosition)(o,s,s)||(0,i.getNumberPosition)(o,s)}scrollToText(e,t,n="smooth",s="nearest",i=!1,o){if(i&&this.isTextRangeInViewport(e,t))return void o?.();const a="smooth"===n?300:0;function l(e,t,n,s){return(e/=s/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}if(e<0)return;"smart"===s&&(s="center"),this._isScrollingProgrammatically=!0;const c=()=>{setTimeout((()=>{this._isScrollingProgrammatically=!1,o?.()}),50)};this._scrollToInterval&&(this._scrollToInterval.destroy(),this._scrollToInterval=null);const h=this._inputArea.scrollTop,u=this._inputArea.scrollLeft;this._domMeasurement.clearCache();const g=this.getTextRanges(e,t),m=this._domMeasurement.getRelativeTextBoundingBox(g,this._mirrorElement),p=this._inputArea.getBoundingClientRect();let _=this._inputArea.scrollTop+m.top;"center"===s&&(_-=this._inputArea.clientHeight/2,_-=m.height/2),p.top<0&&(_+=p.top);let E=this._inputArea.scrollLeft+m.left;p.left<0&&(E+=p.left);const f=_-h,T=E-u;let C=0;this._scrollToInterval=(0,r.setAnimationFrameInterval)((()=>{C+=d.SCROLL_TO_FRAME_INTERVAL;const e=l(C,h,f,a),t=l(C,u,T,a);this._inputArea.scrollTop=e,this._inputArea.scrollLeft=t,C>=a&&(this._scrollToInterval&&(this._scrollToInterval.destroy(),this._scrollToInterval=null),c())}),d.SCROLL_TO_FRAME_INTERVAL)}isTextRangeInViewport(e,t){this._domMeasurement.clearCache();const n=this.getTextRanges(e,t),{top:s,bottom:r,left:i}=this._domMeasurement.getRelativeTextBoundingBox(n,this._mirrorElement),{height:o}=this._inputArea.getBoundingClientRect();return!(s<0||r>o||i<0)}focus(){this._inputArea.focus()}destroy(){super.destroy(),this._inputArea.removeEventListener("dblclick",this._onDblClick),this._inputArea.removeEventListener("click",this._onClick),this._tweaks.removeScrollEventListener(this._onScroll),this._mirrorElement.removeEventListener(c.Mirror.eventNames.input,this._onInput),this._ceElementInspector.de
423stroy(),this._scrollToInterval&&this._scrollToInterval.destroy()}}d.SCROLL_TO_FRAME_INTERVAL=20,d.NBSP=String.fromCharCode(160),d.VISIBLE_WHITE_SPACE_REGEXP=/\u00A0|\u0020|\u2009|\u202F/},
423"./content/highlightStylingType.ts":
424/*!*****************************************!*\
425  !*** ./content/highlightStylingType.ts ***!
426  \*****************************************/(e,t,n)=>{"use strict";var s;n.r(t),n.d(t,{HighlightStylingType:()=>s}),function(e){e.unstyled="unstyled",e.grammar_error="grammar-error",e.grammar_error_emphasized="grammar-error-emphasized",e.grammar_error_selected="grammar-error-selected",e.too_long_sentence_error="too-long-sentence-error",e.too_long_sentence_error_emphasized="too-long-sentence-error-emphasized",e.too_long_sentence_error_selected="too-long-sentence-error-selected",e.ignored_range_error="ignored-range-error",e.ignored_range_error_emphasized="ignored-range-error-emphasized",e.ignored_range_error_selected="ignored-range-error-selected",e.spelling_error="spelling-error",e.spelling_error_emphasized="spelling-error-emphasized",e.spelling_error_selected="spelling-error-selected",e.style_error="style-error",e.style_error_emphasized="style-error-emphasized",e.style_error_selected="style-error-selected",e.selection_lollipop_text="selection-lollipop-text",e.selection_paraphrase_word="selection-paraphrase-word",e.selection_paraphrase_phrase="selection-paraphrase-phrase",e.selection_paraphrase_sentence="selection-paraphrase-sentence",e.selection_paraphrase_text="selection-paraphrase-text",e.selection_toolbox_word="selection-toolbox-word",e.selection_toolbox_phrase="selection-toolbox-phrase",e.selection_toolbox_sentence="selection-toolbox-sentence",e.selection_toolbox_text="selection-toolbox-text",e.sentence_from_hover="sentence-from-hover",e.word_from_hover="word-from-hover",e.sentence_from_caret="sentence-from-caret",e.word_from_caret="word-from-caret",e.flash="flash",e.recommendation_tease="recommendation-tease",e.recommendation_tease_dotted="recommendation-tease-dotted",e.recommendation_tease_selected="recommendation-tease-selected",e.recommendation_tease_selected_dotted="recommendation-tease-selected-dotted",e.recommendation_tease_selected_no_underline="recommendation-tease-selected-no-underline",e.recommendation_tease_selected_no_background="recommendation-tease-selected-no-background",e.recommendation_tease_selected_dotted_no_background="recommendation-tease-selected-dotted-no-background",e.recommendation_tease_emphasized="recommendation-tease-emphasized",e.recommendation_tease_emphasized_dotted="recommendation-tease-emphasized-dotted",e.recommendation_tease_emphasized_no_underline="recommendation-tease-emphasized-no-underline",e.recommendation_tease_emphasized_no_background="recommendation-tease-emphasized-no-background",e.recommendation_tease_emphasized_dotted_no_background="recommendation-tease-emphasized-dotted-no-background",e.paid_recommendation="paid-recommendation",e.paid_recommendation_dotted="paid-recommendation-dotted",e.paid_recommendation_selected="paid-recommendation-selected",e.paid_recommendation_selected_dotted="paid-recommendation-selected-dotted",e.paid_recommendation_selected_no_underline="paid-recommendation-selected-no-underline",e.paid_recommendation_selected_no_background="paid-recommendation-selected-no-background",e.paid_recommendation_selected_dotted_no_background="paid-recommendation-selected-dotted-no-background",e.paid_recommendation_emphasized="paid-recommendation-emphasized",e.recommendation_optional="recommendation-optional",e.recommendation_optional_selected_paid="recommendation-optional-selected-paid",e.recommendation_optional_selected_tease="recommendation-optional-selected-tease",e.paid_recommendation_emphasized_dotted="paid-recommendation-emphasized-dotted",e.paid_recommendation_emphasized_no_underline="paid-recommendation-emphasized-no-underline",e.paid_recommendation_emphasized_no_background="paid-recommendation-emphasized-no-background",e.paid_recommendation_emphasized_dotted_no_background="paid-recommendation-emphasized-dotted-no-background"}(s||(s={}))},
426"./content/highlighter.ts":
427/*!********************************!*\
428  !*** ./content/highlighter.ts ***!
429  \********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Highlighter:()=>g});var s=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),r=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),i=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),o=n(/*! ../common/utils */"./common/utils.ts"),a=n(/*! ../config/config */"./config/config.ts"),l=n(/*! ../init/config */"./init/config.ts"),c=n(/*! ./debounce */"./content/debounce.ts"),d=n(/*! ./highlightStylingType */"./content/highlightStylingType.ts"),h=n(/*! ./mirror */"./content/mirror.ts");
430/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
431const u=l.default.get(l.ConfigKey.EXTN_PREFIX);class g{constructor(e,t,n,l,d,m,p,_,E){this._shadowRoot=null,this._highlightingAreas=[],this._width=0,this._height=0,this._currentZIndex="auto",this._lastScrollingTimeStamp=0,this._supportsCanvas=!0,this.SCROLL_END_DEBOUNCE_DELAY=100,this._useCssCustomHighlightsApi=!0,this._touchStartDetails=null,this._isScrolling=!1,this._currentHoveredBlockId=null,this._isInteractionModeRewrite=!1,this._setScrollEnd=new c.Debounce((()=>{this._isScrolling=!1}),this.SCROLL_END_DEBOUNCE_DELAY),this._paintedBlockRangesMap=new Map,this._render=(e=!1)=>{if(!this._element.parentElement||!this._inputArea.parentElement)return;this._domMeasurement.clearCache();const t=this._inputArea.ownerDocument,n=this._tweaks.getTargetElement();if(!n.parentNode)return;if(!this._container){this._container=(0,o.createContainerElement)(t,g.CONTAINER_ELEMENT_NAME),this._container.style.display="none";const e=n.getAttribute("slot");if(e&&this._container.setAttribute("slot",e),this._tweaks.initContainer(this._container),this._wrapper=t.createElement(`${u}-div`),this._wrapper.setAttribute("spellcheck","false"),this._wrapper.className=`${u}-highlighter__wrapper`,this._scrollElement=t.createElement(`${u}-div`),this._scrollElement.className=`${u}-highlighter__scroll-element`,this._wrapper.appendChild(this._scrollElement),this._container.appendChild(this._wrapper),n.parentElement){const e=this._domMeasurement.getStyle(n.parentElement,"display");if(g.FLEX_GRID_DISPLAY_VALUES.includes(e)&&this._container.classList.add(`${u}-highlighter--grid-item`),this._canUseShadowDom(n))try{this._shadowRoot=this._getShadowRoot(n.parentElement)}catch{}}}const s={};if(this._inputArea===t.body&&t.scrollingElement===t.documentElement&&"BackCompat"!==t.compatMode){const e=this._domMeasurement.getStyles(this._inputArea,["overflow-x","overflow-y"]);s["overflow-x"]="hidden"===e["overflow-x"]?"hidden":"visible",s["overflow-y"]="hidden"===e["overflow-y"]?"hidden":"visible"}const r=this._tweaks.getVisibleBox(this._domMeasurement);s.width=r.width+"px",s.height=r.height+"px";const a=this._domMeasurement.getStyles(this._element,["transform","transform-origin","zoom"]);s.transform=a.transform,s["transform-origin"]=a["transform-origin"],s.zoom=a.zoom,this._domMeasurement.setStyles(this._wrapper,s,!0);const l=this._isMirror?this._inputArea:n,c=this._tweaks.getZIndex(l,this._domMeasurement);c!==this._currentZIndex&&("auto"!==c&&c>0?(this._currentZIndex=c,this._domMeasurement.setStyles(this._container,{"z-index":String(c)},!0)):"auto"!==this._currentZIndex&&(this._currentZIndex="auto",this._domMeasurement.setStyles(this._container,{"z-index":"auto"},!0))),this._applyScrolling(),this._shadowRoot?this._shadowRoot.contains(this._container)||this._shadowRoot.prepe
431nd(this._container):n.parentNode&&n.previousElementSibling!==this._container&&(n.parentNode.insertBefore(this._container,n),this._isMirror||i.EnvironmentAdapter.linkInputAreaProperties(this._container.ownerDocument));const d=this._domMeasurement.getPaddingBox(this._wrapper,!0,!1);if(0!==d.height||0!==d.height){const e=r.top-d.top;if(Math.abs(e)>.05){const t=this._domMeasurement.getScaleFactor(this._inputArea.parentElement);let n=parseFloat(this._domMeasurement.getStyle(this._wrapper,"margin-top"));n+=e/t.y,this._domMeasurement.setStyles(this._wrapper,{"margin-top":n+"px"},!0)}const t=r.left-d.left;if(Math.abs(t)>.05){const e=this._domMeasurement.getScaleFactor(this._inputArea.parentElement);let n=parseFloat(this._domMeasurement.getStyle(this._wrapper,"margin-left"));n+=t/e.x,this._domMeasurement.setStyles(this._wrapper,{"margin-left":n+"px"},!0)}}const h=this._tweaks.getScrollableElementSize(this._domMeasurement);if(this._width!==h.width||this._height!==h.height){this._width=h.width,this._height=h.height;const t=this._width-r.width;t<1&&t>0&&(this._width=r.width);const n=this._height-r.height;n<1&&n>0&&(this._height=r.height),this._domMeasurement.setStyles(this._scrollElement,{width:this._width+"px",height:this._height+"px"},!0),this._updateHighlightedAreas(),e?this._redraw(!1):this._throttledRedraw(!1)}},this._redraw=(e=!0)=>{if(e&&this._domMeasurement.clearCache(),!this._highlightingAreas.length)return;this._highlightedText=this._inputAreaWrapper.getText();const t=this._getScrollPosition(!0,!1,!1),n=this._tweaks.getScrollableElementSize(this._domMeasurement);for(let e=0;e<this._highlightedBlocks.length;e++){const s=this._highlightedBlocks[e],r=this._getPrevUnderLinedHighlightBlock(e),i=this._getNextUnderLinedHighlightBlock(e);s.textRanges=this._inputAreaWrapper.getTextRanges(s.offset,s.length),s.textBoxes=this._tweaks.getTextBoxes(this._domMeasurement,s.textRanges,t),s.textBoxes.forEach(((e,t)=>{const a=0===t,l=t===s.textBoxes.length-1;let c=e.width<10?3:1,d=!1;if(a&&r?.textBoxes?.length){const t=r.textBoxes[r.textBoxes.length-1];(0,o.areTextBoxesOnSameLine)(t,e)&&(t.right>=e.left||e.left-t.right<c)&&(d=!0)}if(!d&&l&&i?.textBoxes?.length){const t=i.textBoxes[0];(0,o.areTextBoxesOnSameLine)(e,t)&&(t.left<=e.right||t.left-e.right<c)&&(d=!0)}d&&(c=e.width<10?1:0),e.left=Math.max(0,e.left-c),e.right=Math.min(n.width,e.right+c),e.width=e.right-e.left,e.top=Math.max(0,e.top),e.bottom=Math.min(n.height,e.bottom),e.height=e.bottom-e.top}))}!i.EnvironmentAdapter.isProductionEnvironment()&&navigator.webdriver&&console.log("Highlighted blocks:",this._highlightedBlocks),this._useCssCustomHighlightsApi?this._redrawWithHighlightsApi():this._redrawWithCanvas(n)},this._onScrollableElementScroll=()=>{if(this._isScrolling=!0,this._setScrollEnd.call(),!this._container)return;const e=Date.now(),t=this._isHighlightingDisabled||!!this._tweaks.scrollingThrottleLimit&&e-this._lastScrollingTimeStamp<this._tweaks.scrollingThrottleLimit;this._lastScrollingTimeStamp=e,t?(this.disableHighlighting(),this._enableHighlightingDebounce.call()):requestAnimationFrame((()=>{this._applyScrolling()}))},this._onCEElementTouchStart=e=>{e.touches&&e.touches[0]&&(this._touchStartDetails={timestamp:Date.now(),x:e.touches[0].clientX,y:e.touches[0].clientY})},this._onCEEElementTouchEnd=e=>{if(!e.changedTouches||1!==e.changedTouches.length)return;if(!this._touchStartDetails)return;const t=Date.now()-this._touchStartDetails.timestamp;if(this._touchStartDetails=null,t>300)return;const n=e.changedTouches[0];this._handleClick(e,n.clientX,n.clientY,!0)},this._onCEElementClick=e=>{this._tweaks.isClickIgnored(e)||this._handleClick(e,e.clientX,e.clientY,!1)},this._handleClick=(e,t,n,s=!1)=>{if(this._isMirror&&e.stopImmediatePropagation(),!this._container)return;if(this._isHighlightingDisabled)return;this._domMeasurement.clearCache();let r={x:t,y:n};r=this._tweaks.toElementCoordinates(r,this._getScrollPosition(),this._domMeasurement);let i=this._highlightedBlocks.length;const a=this._getScrollPosition(!1);for(;i--;){const t=this._highlightedBlocks[i];if(t.textBoxes&&t.textBoxes.some((e=>(0,o.isPointInsideRect)(e,r)))){const n=t.textBoxes[t.textBoxes.length-1],r={highlighter:this,blockId:t.id,clickedBox:this._tweaks.toPageCoordinates(n,a,this._domMeasurement),highlightedBlock:t};return void((0,o.dispatchCustomEvent)(document,g.eventNames.blockClicked,r)&&s&&e.preventDefault())}}},this._debouncedHandleMouseMove=e=>{this._handleMouseMoveDebounce.call(e)},this._handleMouseMove=e=>{if(this._isScrolling)return;if(e.buttons>0)return;const t=e.clientX,n=e.clientY;if(!this._container)return;this._domMeasurement.clearCache();let s={x:t,y:n};s=this._tweaks.toElementCoordinates(s,this._getScrollPosition(),this._domMeasurement);const r=this._highlightedBlocks.filter((e=>e.textBoxes?.length&&(e.simulateSelection||e.isEmphasized||e.isUnderlined)));let i=r.length;if(!i)return;const a=this._getScrollPosition(!1);for(;i--;){const e=r[i];if(!e.textBoxes)continue;const t=e.textBoxes.find((e=>(0,o.isPointInsideRect)(e,s)));if(t&&e.isUnderlined){if(e.id===this._currentHoveredBlockId)return;const n={highlighter:this,blockId:e.id,hoveredBox:this._tweaks.toPageCoordinates(t,a,this._domMeasurement),mouseIn:!0,mouseOut:!!this._currentHoveredBlockId,highlightedBlock:e};return this._currentHoveredBlockId=e.id,void(0,o.dispatchCustomEvent)(document,g.eventNames.blockHovered,n)}}if(this._currentHoveredBlockId){this._currentHoveredBlockId=null;const e={highlighter:this,mouseIn:!1,mouseOut:!0};(0,o.dispatchCustomEvent)(document,g.eventNames.blockHovered,e)}},this._onContentChanged=e=>{if(!this._container)return;const t=this._inputAreaWrapper.getText(),n=e.some((e=>"attributes"===e.type||!(this._isMirror&&!this._tweaks.observeSubtreeMutations)&&(!!Array.from(e.addedNodes||[]).some((e=>e.nodeType===document.ELEMENT_NODE))||!!Array.from(e.removedNodes||[]).some((e=>e.nodeType===document.ELEMENT_NODE)))));(this._highlightedText!==t||n)&&this._throttledRedraw()},this.disableHighlighting=()=>{this._isHighlightingDisabled||(this._isHighlightingDisabled=!0,this._wrapper&&this._wrapper.classList.add(`${u}-highlighter__wrapper-invisible`))},this.enableHighlighting=()=>{this._isHighlightingDisabled&&(this._isHighlightingDisabled=!1,this._wrapper&&(this._redraw(),this._wrapper.classList.remove(`${u}-highlighter__wrapper-invisible`)))},this.getCurrentTextBoxes=(e,t)=>{const n=this._getScrollPosition(!0,!1,!1),s=this._inputAreaWrapper.getTextRanges(e,t);return this._tweaks.getTextBoxes(this._domMeasurement,s,n).map((e=>this._tweaks.toPageCoordinates(e,n,this._domMeasurement)))},this._inputArea=e,this._inputAreaWrapper=t,this._element=n,this._isMirror=l,this._tweaks=d,this._clickableElement=this._tweaks.getClickableElement(),this._clickEvent=m,this._useShadowDom=p,this._highlightInteraction={...o.defaultHighlightInteractionConfig,..._},this._useCssCustomHighlightsApi=Boolean(E),this._highlightedText="",this._highlightedBlocks=[],this._supportsCanvas=this._tweaks.supportsCanvas(),this._domMeasurement=new r.DomMeasurement(e.ownerDocument),this._redrawDebounce=new c.Debounce(this._redraw,250,500),this._enableHighlightingDebounce=new c.Debounce(this.enableHighlighting,this._tweaks.scrollingThrottleLimit||0),this._handleMouseMoveDebounce=new c.Debounce(this._handleMouseMove,0,0),this._tweaks.addScrollEventListener(this._onScrollableElementScroll),"standalone"===i.Env
431ironmentAdapter.getType()&&s.BrowserDetector.isIOSTouchDevice()?(this._clickableElement.addEventListener("touchstart",this._onCEElementTouchStart,!0),this._clickableElement.addEventListener("touchend",this._onCEEElementTouchEnd,!0)):("hover"===this._highlightInteraction.correct&&(this._clickableElement.addEventListener("mousemove",this._debouncedHandleMouseMove,!0),this._clickableElement.addEventListener(h.Mirror.eventNames.mousemove,this._debouncedHandleMouseMove,!0)),this._clickableElement.addEventListener(this._clickEvent,this._onCEElementClick,!0)),this._clickableElement.addEventListener(h.Mirror.eventNames.click,this._onCEElementClick,!0),this._contentChangedObserver=this._tweaks.createMutationObserver(this._onContentChanged);const f=["style"];this._tweaks.attributeMutations&&f.push(...this._tweaks.attributeMutations),l||f.push("class","size","face","align");const T={attributeFilter:f,attributes:!0,characterData:!0,childList:!0,subtree:this._tweaks.observeSubtreeMutations??!l};this._contentChangedObserver.observe(this._element,T),self.ResizeObserver&&(this._ceElementResizeObserver=new self.ResizeObserver((()=>this._render())),this._ceElementResizeObserver.observe(this._element)),this._renderInterval=(0,o.setAnimationFrameInterval)(this._render,a.RENDER_INTERVAL),this._render()}_createHighlightInstanceForStylingType(e){const t=new self.Highlight;return self.CSS.highlights.set(`${u}-highlighter-${e}`,t),t}_getScrollPosition(e=!0,t=e,n=!0){if(this._isMirror){let n=0,s=0;return e?(n=t?+this._element.dataset.ltScrollTopScaledAndZoomed:+this._element.dataset.ltScrollTopScaled,s=t?+this._element.dataset.ltScrollLeftScaledAndZoomed:+this._element.dataset.ltScrollLeftScaled):(n=+this._element.dataset.ltScrollTop,s=+this._element.dataset.ltScrollLeft),{top:n,left:s}}return n&&this._domMeasurement.clearCache(),this._tweaks.getScrollPosition(this._domMeasurement,e,t)}_canUseShadowDom(e){if(!this._useShadowDom)return!1;const t=e.parentElement;return!!t&&(0,o.canElementHostShadowRoot)(t)}_getShadowRoot(e){if(g._shadowRoots.has(e)){const t=g._shadowRoots.get(e);return i.EnvironmentAdapter.injectShadowStyles(t),t}const t=(0,o.createShadowRoot)(e,this._domMeasurement);return t&&(i.EnvironmentAdapter.injectShadowStyles(t),g._shadowRoots.set(e,t)),t}setUnderlineOpacity(e){this._highlightingAreas.forEach((t=>{const n=t.image||t.canvas;this._domMeasurement.setStyles(n,{opacity:String(e)})}))}disableCssCustomHighlightsApi(){this._useCssCustomHighlightsApi=!1,this._clearHighlightsRegistryRanges()}_updateHighlightedAreas(){const e=[];for(let t=0;t<this._width;t+=g.CANVAS_MAX_WIDTH)for(let n=0;n<this._height;n+=g.CANVAS_MAX_HEIGHT){const s={top:n,right:t+g.CANVAS_MAX_WIDTH,bottom:n+g.CANVAS_MAX_HEIGHT,left:t,width:g.CANVAS_MAX_WIDTH,height:g.CANVAS_MAX_HEIGHT};let r=this._highlightingAreas.find((e=>(0,o.isRectsEqual)(e.cell,s)));if(!r){const e=this._inputArea.ownerDocument.createElement("canvas");if(e.className=`${u}-highlighter__canvas`,e.width=0,e.height=0,this._domMeasurement.setStyles(e,{display:"none"}),r={cell:s,canvas:e,context:e.getContext("2d"),drawnItems:new Map},!this._supportsCanvas){const e=this._inputArea.ownerDocument.createElement("img");e.className=`${u}-highlighter__canvas`,e.width=0,e.height=0,this._domMeasurement.setStyles(e,{display:"none"}),r.image=e}}e.push(r)}for(const t of this._highlightingAreas){const n=t.image||t.canvas;!e.includes(t)&&n.parentElement&&n.parentElement.removeChild(n)}this._highlightingAreas=e}_throttledRedraw(e=!0){this._inputAreaWrapper.getText().length>a.MAX_TEXT_LENGTH_PERFORMANCE_DEGRADATION?this._redrawDebounce.call(e):this._redraw(e)}_getColorsForHighlightStylingType(e,t){const n=(0,o.hasDarkBackground)(this._inputArea),s=(e,s)=>t?(n?a.COLORS_ON_DARK.DISABLED:a.COLORS.DISABLED)[s]||a.COLORS.DISABLED.UNDERLINE:e[s];let r="transparent",i="transparent";switch(e){case d.HighlightStylingType.grammar_error:r=s(a.COLORS.GRAMMAR,"UNDERLINE");break;case d.HighlightStylingType.grammar_error_emphasized:r=s(a.COLORS.GRAMMAR,"SELECTED_UNDERLINE"),i=s(a.COLORS.GRAMMAR,"EMPHASIZE");break;case d.HighlightStylingType.grammar_error_selected:r=s(a.COLORS.GRAMMAR,"SELECTED_UNDERLINE"),i=s(a.COLORS.GRAMMAR,"BACKGROUND");break;case d.HighlightStylingType.too_long_sentence_error:r=s(a.COLORS.LONG_SENTENCE,"UNDERLINE");break;case d.HighlightStylingType.too_long_sentence_error_selected:r=s(a.COLORS.LONG_SENTENCE,"UNDERLINE"),i=s(a.COLORS.LONG_SENTENCE,"BACKGROUND");break;case d.HighlightStylingType.too_long_sentence_error_emphasized:r=s(a.COLORS.LONG_SENTENCE,"UNDERLINE"),i=s(a.COLORS.LONG_SENTENCE,"EMPHASIZE");break;case d.HighlightStylingType.ignored_range_error:r=s(a.COLORS.IGNORED_RANGE,"UNDERLINE");break;case d.HighlightStylingType.ignored_range_error_selected:r=s(a.COLORS.IGNORED_RANGE,"UNDERLINE"),i=s(a.COLORS.IGNORED_RANGE,"BACKGROUND");break;case d.HighlightStylingType.ignored_range_error_emphasized:r=s(a.COLORS.IGNORED_RANGE,"UNDERLINE"),i=s(a.COLORS.IGNORED_RANGE,"EMPHASIZE");break;case d.HighlightStylingType.spelling_error:r=s(a.COLORS.SPELLING,"UNDERLINE");break;case d.HighlightStylingType.spelling_error_emphasized:r=s(a.COLORS.SPELLING,"SELECTED_UNDERLINE"),i=s(a.COLORS.SPELLING,"EMPHASIZE");break;case d.HighlightStylingType.spelling_error_selected:r=s(a.COLORS.SPELLING,"SELECTED_UNDERLINE"),i=s(a.COLORS.SPELLING,"BACKGROUND");break;case d.HighlightStylingType.style_error:r=s(a.COLORS.STYLE,"UNDERLINE");break;case d.HighlightStylingType.style_error_emphasized:r=s(a.COLORS.STYLE,"SELECTED_UNDERLINE"),i=s(a.COLORS.STYLE,"EMPHASIZE");break;case d.HighlightStylingType.style_error_selected:r=s(a.COLORS.STYLE,"SELECTED_UNDERLINE"),i=s(a.COLORS.STYLE,"BACKGROUND");break;case d.HighlightStylingType.sentence_from_hover:r="transparent",i=a.COLORS.STYLE.EMPHASIZE;break;case d.HighlightStylingType.word_from_hover:r="transparent",i=a.COLORS.STYLE.BACKGROUND;break;case d.HighlightStylingType.sentence_from_caret:r=a.COLORS.STYLE.UNDERLINE,i=a.COLORS.STYLE.EMPHASIZE;break;case d.HighlightStylingType.word_from_caret:r="transparent",i=a.COLORS.STYLE.BACKGROUND;break;case d.HighlightStylingType.flash:r="transparent",i=a.COLORS.NEW_SENTENCE.BACKGROUND;break;case d.HighlightStylingType.selection_paraphrase_word:r=a.COLORS.SYNONYMS.UNDERLINE,i="transparent";break;case d.HighlightStylingType.selection_paraphrase_phrase:r=a.COLORS.SYNONYMS.UNDERLINE,i=a.COLORS.PARAPHRASE.BACKGROUND;break;case d.HighlightStylingType.selection_paraphrase_sentence:case d.HighlightStylingType.selection_paraphrase_text:r=a.COLORS.PARAPHRASE.UNDERLINE,i=a.COLORS.PARAPHRASE.BACKGROUND;break;case d.HighlightStylingType.selection_toolbox_word:r="transparent",i=a.COLORS.STYLE.BACKGROUND;break;case d.HighlightStylingType.selection_toolbox_phrase:case d.HighlightStylingType.selection_toolbox_sentence:case d.HighlightStylingType.selection_toolbox_text:case d.HighlightStylingType.selection_lollipop_text:r="transparent",i=a.COLORS.PARAPHRASE.BACKGROUND;break;case d.HighlightStylingType.paid_recommendation:r=s(a.COLORS.RECOMMENDATION,"UNDERLINE");break;case d.HighlightStylingType.paid_recommendation_emphasized:r=s(a.COLORS.RECOMMENDATION,"SELECTED_UNDERLINE"),i=s(a.COLORS.RECOMMENDATION,"EMPHASIZE");break;case d.HighlightStylingType.paid_recommendation_selected:r=s(a.COLORS.RECOMMENDATION,"SELECTED_UNDERLINE"),i=s(a.COLORS.RECOMMENDATION,"BACKGROUND");break;case d.HighlightStylingType.paid_recommendation_emphasized_no_underline:r="transparent",i=s(a.COLORS.RECOMMENDATION,"EMPHASIZE");break;case d.HighlightStylingType.paid_recommendation_emphasized_no_background:r=s(a.COLORS.RECOMMENDATION,"SELECTED_UNDERLINE"),i="transparent";break;case d.HighlightStylingType.paid_recommendation_selected_no_underline:r="transparent",i=s(a.COLORS.RECOMMENDATION,"BACKGROUND");break;case d.HighlightStylingType.paid_recommendation_selected_no_background:r=s(a.COLORS.RECOMMENDATION,"SELECTED_UNDERLINE"),i="transparent";break;case d.HighlightStylingType.recommendation_tease:r=s(a.COLORS.RECOMMENDATION_TEASE,"UNDERLINE");break;case d.HighlightStylingType.recommendation_tease_emphasized:r=s(a.COLORS.RECOMMENDATION_TEASE,"SELECTED_UNDERLINE"),i=s(a.COLORS.RECOMMENDATION_TEASE,"EMPHASIZE");break;case d.HighlightStylingType.recommendation_tease_selected:r=s(a.COLORS.RECOMMENDATION_TEASE,"SELECTED_UNDERLINE"),i=s(a.COLORS.RECOMMENDATION_TEASE,"BACKGROUND");break;case d.HighlightStylingType.recommendation_tease_emphasized_no_underline:r="transparent",i=s(a.COLORS.RECOMMENDATION_TEASE,"EMPHASIZE");break;case d.HighlightStylingType.recommendation_tease_selected_no_underline:r="transparent",i=s(a.COLORS.RECOMMENDATION_TEASE,"BACKGROUND");break;case d.HighlightStylingType.recommendation_tease_selected_no_background:case d.HighlightStylingType.recommendation_tease_emphasized_no_background:r=s(a.COLORS.RECOMMENDATION_TEASE,"SELECTED_UNDERLINE"),i="transparent";break;case d.HighlightStylingType.unstyled:r="transparent",i="transparent";break;default:r=s(a.COLORS.GRAMMAR,"UNDERLINE"),i=s(a.COLORS.GRAMMAR,"BACKGROUND")}return{backgroundColor:i,underlineColor:r}}_getPrevUnderLinedHighlightBlock(e){if(e<=0||e>=this._highlightedBlocks.length)return null;for(let t=e-1;t>=0;t--){const e=this._highlightedBlocks[t];if(e.isUnderlined)return e}return null}_getNextUnderLinedHighlightBlock(e){if(e<0||e>=this._highlightedBlocks.length-1)return null;for(let t=e+1;t<this._highlightedBlocks.length;t++){const e=this._highlightedBlocks[t];if(e.isUnderlined)return e}return null}_redrawWithCanvas(e){const t=[];for(const n of this._highlightedBlocks){if(!n.textBoxes)continue;const s=this._getColorsForHighlightStylingType(n.highlightStylingType,this._isInteractionModeRewrite),r=s.underlineColor,
431i=s.backgroundColor;for(const s of n.textBoxes){if(n.simulateSelection&&t.push({top:s.bottom-g.DEFAULT_UNDERLINE_THICKNESS/2,right:s.right,bottom:s.bottom+g.DEFAULT_UNDERLINE_THICKNESS/2,left:s.left,width:s.width,height:g.DEFAULT_UNDERLINE_THICKNESS,color:r,textBox:s}),n.isEmphasized){const e=s.bottom-g.DEFAULT_UNDERLINE_THICKNESS/2;t.push({top:s.top,right:s.right,bottom:e,left:s.left,width:s.width,height:e-s.top,color:i,textBox:s})}if(n.isUnderlined){const i=n.underlineThickness??g.DEFAULT_UNDERLINE_THICKNESS;let o=s.bottom-i/2,a=s.bottom+i/2;a>e.height&&(o-=1,a-=1),n.isEllipsis&&s===n?.textBoxes?.[n?.textBoxes?.length-1]?(t.push({top:o,right:s.right-12,bottom:a,left:s.left,width:s.width-12,height:i,color:r,textBox:s}),t.push({top:o,right:s.right-5,bottom:a,left:s.right-7,width:2,height:i,color:r,textBox:s}),t.push({top:o,right:s.right,bottom:a,left:s.right-2,width:2,height:i,color:r,textBox:s})):t.push({top:o,right:s.right,bottom:a,left:s.left,width:s.width,height:i,color:r,textBox:s})}}}for(const e of this._highlightingAreas){const n=t.filter(o.isRectsIntersect.bind(null,e.cell));if(!n.length){delete e.canvasBox,e.drawnItems.clear();const t=e.image||e.canvas;t.parentElement&&t.parentElement.removeChild(t);continue}const s={top:Number.MAX_VALUE,right:0,bottom:0,left:Number.MAX_VALUE,width:0,height:0};for(const e of n)s.top=Math.min(s.top,e.top,e.textBox.top),s.right=Math.max(s.right,e.right,e.textBox.right),s.bottom=Math.max(s.bottom,e.bottom,e.textBox.bottom),s.left=Math.min(s.left,e.left,e.textBox.left);s.top=Math.max(e.cell.top,s.top),s.right=Math.min(e.cell.right,s.right),s.bottom=Math.min(e.cell.bottom,s.bottom),s.left=Math.max(e.cell.left,s.left),s.width=s.right-s.left,s.height=s.bottom-s.top;const r=!e.canvasBox||e.canvasBox.width<s.width||e.canvasBox.height<s.height||e.canvasBox.width*e.canvasBox.height/(s.width*s.height)>=2,i=!r&&!(0,o.isRectContainsRect)(e.canvasBox,s);if(r){const t=!e.canvasBox||e.canvasBox.top!==s.top||e.canvasBox.left!==s.left;e.canvas.width=s.width,e.canvas.height=s.height,e.image&&(e.image.width=s.width,e.image.height=s.height),e.canvasBox=s,e.drawnItems.clear();const n=e.image||e.canvas;t&&this._domMeasurement.setStyles(n,{top:e.canvasBox.top+"px",left:e.canvasBox.left+"px"},!0),n.parentElement||this._scrollElement.appendChild(n)}else if(i){const t=e.image||e.canvas;e.canvasBox.top=s.top,e.canvasBox.right=s.left+e.canvasBox.width,e.canvasBox.bottom=s.top+e.canvasBox.height,e.canvasBox.left=s.left,this._domMeasurement.setStyles(t,{top:e.canvasBox.top+"px",left:e.canvasBox.left+"px"},!0)}const a=new Map;for(const t of n){const n=Math.max(t.left-e.canvasBox.left,0),s=Math.min(t.right-e.canvasBox.left,e.canvasBox.width),r=Math.max(t.top-e.canvasBox.top,0),i=Math.min(t.bottom-e.canvasBox.top,e.canvasBox.height),o=s-n,l=i-r,c={top:r,right:s,bottom:i,left:n,width:o,height:l,color:t.color},d={x:n,y:r,w:o,h:l,c:t.color};a.set(JSON.stringify(d),c)}let l=[],c=!1;for(const[t,n]of a)e.drawnItems.delete(t)||(l.push(n),c=!0);let d=Array.from(e.drawnItems.values());const h=d.length;if(h>0&&(c=!0),h>20&&(e.canvas.width=e.canvasBox.width,l=Array.from(a.values()),d=[]),e.drawnItems=a,!c)continue;const u=Array.from(a.values());for(const t of d){e.context.clearRect(t.left,t.top,t.width,t.height);for(const e of u)if((0,o.isRectsIntersect)(e,t)){const n=Math.max(e.top,t.top),s=Math.min(e.right,t.right),r=Math.min(e.bottom,t.bottom),i=Math.max(e.left,t.left);if(0==s-i||0==r-n)continue;const a={top:n,right:s,bottom:r,left:i,width:s-i,height:r-n,color:e.color};l.some((e=>e.color===a.color&&(0,o.isRectsEqual)(e,a)))||l.push(a)}}for(const e of l){let t=!1;for(const n of u)if(t){if((0,o.isRectsIntersect)(n,e)){const t=Math.max(n.top,e.top),s=Math.min(n.right,e.right),r=Math.min(n.bottom,e.bottom),i=Math.max(n.left,e.left);l.push({top:t,right:s,bottom:r,left:i,width:s-i,height:r-t,color:n.color})}}else t=e===n}for(const t of l)e.context.fillStyle=t.color,e.context.fillRect(t.left,t.top,t.width,t.height);e.image&&(e.image.src=e.canvas.toDataURL())}}_redrawWithHighlightsApi(){const e=this._createHighlightedBlockRangesMap(this._handleEllipsisWithCssHighlights(this._highlightedBlocks)),t=this._deleteOldRangesFromRegistry(e);this._addNewRangesToRegistry(e,t)}_handleEllipsisWithCssHighlights(e){const t=[];for(const n of e)if(n.isEllipsis&&n.textRanges?.length){const e=n.textRanges?.[
431n.textRanges.length-1];e.end=e.end-2,t.push({...n});const s=e.end,r=s+2;t.push({...n,highlightStylingType:this._getDottedHighlightStylingType(n.highlightStylingType),textRanges:[{...e,start:s,end:r}]})}else t.push(n);return t}_getDottedHighlightStylingType(e){switch(e){case d.HighlightStylingType.recommendation_tease:return d.HighlightStylingType.recommendation_tease_dotted;case d.HighlightStylingType.paid_recommendation:return d.HighlightStylingType.paid_recommendation_dotted;case d.HighlightStylingType.recommendation_tease_selected:return d.HighlightStylingType.recommendation_tease_selected_dotted;case d.HighlightStylingType.paid_recommendation_selected:return d.HighlightStylingType.paid_recommendation_selected_dotted;case d.HighlightStylingType.recommendation_tease_emphasized:return d.HighlightStylingType.recommendation_tease_emphasized_dotted;case d.HighlightStylingType.paid_recommendation_emphasized:return d.HighlightStylingType.paid_recommendation_emphasized_dotted;case d.HighlightStylingType.recommendation_tease_selected_no_background:return d.HighlightStylingType.recommendation_tease_selected_dotted_no_background;case d.HighlightStylingType.paid_recommendation_selected_no_background:return d.HighlightStylingType.paid_recommendation_selected_dotted_no_background;case d.HighlightStylingType.recommendation_tease_emphasized_no_background:return d.HighlightStylingType.recommendation_tease_emphasized_dotted_no_background;case d.HighlightStylingType.paid_recommendation_emphasized_no_background:return d.HighlightStylingType.paid_recommendation_emphasized_dotted_no_background;default:return e}}_createHighlightedBlockRangesMap(e){const t=new Map;for(const n of e)n.textRanges?.forEach((e=>{let s=t.get(e.node);s||(s=[]),s.push({range:e,highlightStylingType:n.highlightStylingType}),t.set(e.node,s)}));return t}_deleteOldRangesFromRegistry(e){const t=[],n=[];for(const s of[...this._paintedBlockRangesMap.values()].flat()){const r=s.range,i=this._shouldRetainRangeInRegistry(r,s.highlightStylingType,e);i?t.push(i):n.push(s)}return n.forEach((e=>{const t=e.range.startContainer,n=e.highlightStylingType,s=e.range,r=self.CSS.highlights.get(`${u}-highlighter-${n}`);r&&r.delete(s);const i=this._paintedBlockRangesMap.get(t);if(!i)return;const o=i.filter((e=>e.range!==s));0===o.length?this._paintedBlockRangesMap.delete(t):this._paintedBlockRangesMap.set(t,o)})),t}_shouldRetainRangeInRegistry(e,t,n){const s=n.get(e.startContainer);if(s){for(const n of s)if(n.range.node===e.startContainer&&n.range.start===e.startOffset&&n.range.end===e.endOffset&&t===n.highlightStylingType)return n.range;return!1}return!1}_addNewRangesToRegistry(e,t){for(const n of[...e.values()].flat()){const e=n.highlightStylingType,s=n.range;let r=self.CSS.highlights.get(`${u}-highlighter-${e}`);if(r||(r=this._createHighlightInstanceForStylingType(e)),!t.includes(s)){const t=new StaticRange({startContainer:s.node,startOffset:s.start,endContainer:s.node,endOffset:s.end});let n=this._paintedBlockRangesMap.get(s.node);n||(n=[]),n.push({range:t,highlightStylingType:e}),this._paintedBlockRangesMap.set(s.node,n),r.add(t)}}}_applyScrolling(){const e=this._getScrollPosition(!1),t=-e.top+"px",n=-e.left+"px";this._domMeasurement.setStyles(this._scrollElement,{top:t,left:n},!0)}setCurrentHoveredBlockId(e){this._currentHoveredBlockId=e}highlight(e=[],t=!1,n=!1){this._highlightedBlocks=e,this._isInteractionModeRewrite=n,t?this._redraw():this._throttledRedraw()}getTextBoxes(e){const t=this._highlightedBlocks.find((t=>t.id===e));if(!t||!t.textBoxes)return[];const n=this._getScrollPosition(!1);return t.textBoxes.map((e=>this._tweaks.toPageCoordinates(e,n,this._domMeasurement)))}destroy(){if(this._tweaks.removeScrollEventListener(this._onScrollableElementScroll),this._clickableElement.removeEventListener(h.Mirror.eventNames.click,this._onCEElementClick),this._clickableElement.removeEventListener("touchstart",this._onCEElementTouchStart,!0),"hover"===this._highlightInteraction.correct&&(this._clickableElement.removeEventListener("mousemove",this._debouncedHandleMouseMove,!0),this._clickableElement.removeEventListener(h.Mirror.eventNames.mousemove,this._debouncedHandleMouseMove,!0)),this._clickableElement.removeEventListener(this._clickEvent,this._onCEElementClick,!0),this._clickableElement.removeEventListener("touchend",this._onCEEElementTouchEnd,!0),this._contentChangedObserver.disconnect(),this._renderInterval&&this._renderInterval.destroy(),this._container&&this._container.remove(),this._shadowRoot){const e=Array.from(this._shadowRoot.children),t=g.CONTAINER_ELEMENT_NAME.toUpperCase();if(!e.some((e=>e.tagName.toUpperCase()===t)))for(const t of e)"SLOT"!==t.tagName.toUpperCase()&&t.remove()}this._ceElementResizeObserver&&this._ceElementResizeObserver.disconnect(),this._setScrollEnd.cancelCall(),this._redrawDebounce.cancelCall(),this._enableHighlightingDebounce.cancelCall(),this._handleMouseMoveDebounce.cancelCall(),this._domMeasurement.clearCache(),this._clearHighlightsRegistryRanges()}_clearHighlightsRegistryRanges(){for(const e of[...this._paintedBlockRangesMap.values()].flat()){const t=e.highlightStylingType,n=self.CSS.highlights.get(`${u}-highlighter-${t}`);
431n&&n.delete(e.range)}this._paintedBlockRangesMap.clear()}}g.CONTAINER_ELEMENT_NAME=`${u}-highlighter`,g.FLEX_GRID_DISPLAY_VALUES=["grid","inline-grid","flex","inline-flex"],g.CANVAS_MAX_WIDTH=1024,g.CANVAS_MAX_HEIGHT=1024,g.DEFAULT_UNDERLINE_THICKNESS=2,g._shadowRoots=new WeakMap,g.eventNames={blockClicked:`${u}-highlighter.blockClicked`,blockHovered:`${u}-highlighter.blockHovered`}},
431"./content/highlighterUtil.ts":
432/*!************************************!*\
433  !*** ./content/highlighterUtil.ts ***!
434  \************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{handleConflictingHighlights:()=>r});const s=(e,t,n,s)=>!(t<=n||e>=s),r=e=>{if(!e||0===e.length)return e;const t=[...e].sort(((e,t)=>{if(s(e.offset,e.offset+e.length,t.offset,t.offset+t.length)){const n=e.highlightStylingType.includes("recommendation");if(n!==t.highlightStylingType.includes("recommendation"))return n?1:-1}return e.offset+e.length-(t.offset+t.length)})),n=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s.isUnderlined){n.push(s);continue}const r=o(s,t.slice(0,e));if(r.length>0){let e=a(s,r);s.isEmphasized&&(e=e.map((e=>({...e,isEmphasized:!1}))),e.push({...s,isEmphasized:!0,isUnderlined:!1})),n.push(...e)}else n.push(s)}return n};function i(e){return e.highlightStylingType.includes("recommendation")}function o(e,t){const n=e.offset,r=e.offset+e.length;return t.filter((t=>{if(!t.isUnderlined)return!1;const i=t.offset,o=t.offset+t.length;if(s(n,r,i,o)){const s=Math.max(n,i),a=Math.min(r,o);return console.log("Conflicting offsets found:"),console.log(`  Current block: ${e.id} (offset: ${n}-${r})`),console.log(`  Conflicting block: ${t.id} (offset: ${i}-${o})`),console.log(`  Conflict range: ${s}-${a}`),console.log("  Conflict length: "+(a-s)),console.log("---"),!0}return!1}))}function a(e,t){const n=[];if(i(e)){const s=l(e,t);n.push(...s)}return t.forEach((t=>{if(i(t)){const s=l(t,[e]);n.push(...s)}})),n}function l(e,t){const n=e.offset,s=e.offset+e.length,r=t.map((e=>{const t=e.offset,r=e.offset+e.length,i=Math.max(n,t),o=Math.min(s,r);return i<o?{start:i,end:o}:null})).filter((e=>null!==e));r.sort(((e,t)=>e.start-t.start));const i=r.reduce(((e,t)=>{if(0===e.length)e.push(t);else{const n=e[e.length-1];t.start<=n.end?n.end=Math.max(n.end,t.end):e.push(t)}return e}),[]);let o=n;const a=[];for(const t of i)o<t.start&&a.push({...e,id:`${e.id}`,offset:o,length:t.start-o,isUnderlined:!0}),o=t.end;return o<s&&a.push({...e,id:`${e.id}`,offset:o,length:s-o,isUnderlined:!0}),a}},
434"./content/inputAreaWrapper.ts":
435/*!*************************************!*\
436  !*** ./content/inputAreaWrapper.ts ***!
437  \*************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{InputAreaWrapper:()=>u,ParaTypes:()=>h});var s=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),r=n(/*! ../common/utils */"./common/utils.ts"),i=n(/*! ../core/utils */"./core/utils.ts"),o=n(/*! ../init/config */"./init/config.ts"),a=n(/*! ../common/editors/selectionManager */"./common/editors/selectionManager.ts"),l=n(/*! ./debounce */"./content/debounce.ts"),c=n(/*! ../config/config */"./config/config.ts");
438/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
439const d=o.default.get(o.ConfigKey.EXTN_PREFIX);var h;!function(e){e.GENERIC="GENERIC",e.BULLET_POINT="BULLET_POINT",e.HEADING="HEADING",e.INCOMPLETE_SENTENCE="INCOMPLETE_SENTENCE",e.BOLD="BOLD",e.ITALIC="ITALIC"}(h||(h={}));class u{static setIsWritingContextEnabled(e){this._isWritingContextEnabled=e}constructor(e,t,n){this._isScrollingProgrammatically=!1,this._isTextTooLong=!1,this._selectionChangeListener=null,this._keyboardShortcut=null,this._lastKeyUp=null,this._lastKeyDown=null,this._lastKeyPress=null,this._compositionPhase=null,this._onBlur=()=>{const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,u.eventNames.blur,e)},this._isWhiteSpace=e=>" "===e||" "===e,this._onCompositionStart=()=>{if(null!==this._compositionPhase)return;this._compositionPhase="started";const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,u.eventNames.compositionStart,e)},this._onCompositionEnd=()=>{"started"===this._compositionPhase&&(this._compositionPhase="ended")},this._onCompositionDone=e=>{if("ended"===this._compositionPhase&&((0,r.assert)("keyup"===e.type),"ended"===this._compositionPhase)){this._compositionPhase=null;const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,u.eventNames.compositionEnd,e)}},this._onKeyPress=e=>{if(!e.isTrusted||e.defaultPrevented)return;const t=e.key,n=this._lastKeyPress?.key||"",s=(0,i.isLetter)(n)||(0,i.isNumeric)(n);if(s&&(this._isWhiteSpace(t)||(0,i.isDoubleQuotationMark)(t))){const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,u.eventNames.wordWritten,e)}else if(c.SENTENCE_END_CHARS.includes(t)&&!c.SENTENCE_END_CHARS.includes(n)&&n){const e={inputAreaWrapper:this,isWordCompleted:s};(0,r.dispatchCustomEvent)(document,u.eventNames.sentenceWritten,e)}this._lastKeyPress={key:t,location:e.location,timestamp:e.timeStamp}},this._onKeyDown=e=>{if(e.defaultPrevented)return;if(!e.isTrusted&&!navigator.webdriver)return;const{ctrlKey:t,metaKey:n,altKey:s,shiftKey:i,key:o,code:a}=e,l={inputAreaWrapper:this,eventDetails:{ctrlKey:t,metaKey:n,altKey:s,shiftKey:i,code:a,key:o}};(0,r.dispatchCustomEvent)(document,u.eventNames.keydown,l),this._lastKeyDown={timestamp:e.timeStamp,key:e.key,location:e.location},this.isKeyboardShortcut(e)||(this._lastKeyUp=null)},this._onKeyUp=e=>{const t=e.timeStamp,n=this._lastKeyDown&&this._lastKeyDown.key===e.key&&this._lastKeyDown.location===e.location,s=this._lastKeyDown&&t-this._lastKeyDown.timestamp<250;if(this.isKeyboardShortcut(e)&&n&&s)if(this._lastKeyUp&&t-this._lastKeyUp.timestamp<400&&this._lastKeyUp.location===e.location){this._lastKeyUp=null,e.preventDefault(),e.stopImmediatePropagation();const t={inputAreaWrapper:this,key:e.key};(0,r.dispatchCustomEvent)(document,u.eventNames.keyboardShortcut,t)}else this._lastKeyUp={key:e.key,timestamp:t,location:e.location};else this._lastKeyUp=null},this._onPaste=e=>{if(!e.isTrusted)return;const t=e.clipboardData,n=t?t.getData("Text"):"",s={inputAreaWrapper:this,isSignificantTextChange:n.length>200,pastedData:n};(0,r.dispatchCustomEvent)(document,u.eventNames.paste,s)},this._onInput=()=>{const e=this._text;if(!this._updateText())return;const t={inputAreaWrapper:this,previousText:e,text:this._text};(0,r.dispatchCustomEvent)(document,u.eventNames.textChanged,t)},this._onSurroundingTextContextChange=e=>{const t={inputAreaWrapper:this,changes:e};(0,r.dispatchCustomEvent)(document,u.eventNames.surroundingTextContextChanged,t)},this._onSurroundingTextContextChangeDebounce=new l.Debounce(this._onSurroundingTextContextChange,750),this._debouncedOnSurroundingTextContextChange=e=>{this._onSurroundingTextContextChangeDebounce.call(e)},this._onSelectionChange=()=>{const e={inputAreaWrapper:this};(0,r.dispatchCustomEvent)(document,u.eventNames.selectionChanged,e)},this._inputArea=e,this._tweaks=t,this._keyboardShortcut=n?.keyboardShortcut||null,this._domMeasurement=new s.DomMeasurement(e.ownerDocument),this._setMaxTextLength(n?.maxTextLength||Number.MAX_SAFE_INTEGER),this._keyboardEventTarget=this._tweaks.getKeyboardEventTarget(),this._inputArea.addEventListener("blur",this._onBlur,!0),this._keyboardEventTarget.addEventListener("paste",this._onPaste,!0),this._keyboardEventTarget.addEventListener("keyup",this._onKeyUp,!0),this._keyboardEventTarget.addEventListener("keydown",this._onKeyDown,!0),this._keyboardEventTarget.addEventListener("keypress",this._onKeyPress,!0),this._tweaks.addCompositionStartListener(this._onCompositionStart),this._tweaks.addCompositionEndListener(this._onCompositionEnd),this._keyboardEventTarget.addEventListener("keyup",this._onCompositionDone,!0),this._addSelectionChangeListener()}getSelectedText(){return this._tweaks.getSelectedText()}
439getScrollContainer(){return this._tweaks.getScrollContainer()}isKeyboardShortcut(e){return"Shift"===this._keyboardShortcut?"Shift"===e.key&&!e.metaKey&&!e.altKey&&!e.ctrlKey:"Control"===this._keyboardShortcut?"Control"===e.key&&!e.shiftKey&&!e.altKey&&!e.metaKey:"Alt"===this._keyboardShortcut&&"Alt"===e.key&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey}_getTextChunkIndex(e,t=!1){for(let n=0;n<this._textChunks.length;n++){const s=this._textChunks[n];if(e>=s.parsedTextOffset&&e<s.parsedTextOffset+s.parsedText.length&&(!t||s.isTextNode))return n}const n=this._textChunks[this._textChunks.length-1];return n&&e===n.parsedTextOffset+n.parsedText.length?this._textChunks.length-1:-1}_detectTripleClick(e){return new Promise((t=>{const n=()=>{e.removeEventListener("click",r),self.clearTimeout(s)},s=self.setTimeout((()=>{n(),t(!1)}),250),r=e=>{3===e.detail&&(n(),t(!0))};e.addEventListener("click",r,{once:!0})}))}async _dispatchDblClickEvent(e,t,n){const s=(0,i.removeZWC)(this._tweaks.getSelectedText()),o=this.getSelection();if(!s||!o)return;const a=this.getTextRanges(o.start,o.end-o.start);if(!a.length)return;this._domMeasurement.clearCache();const l=this._domMeasurement.getTextBoundingBoxes(a,e),c=this._domMeasurement.getTextBoundingBoxes(a,e,!1);if(!l.length)return;if(!c.some((e=>(0,r.isPointInsideRect)(e,t,n))))return;if(await this._detectTripleClick(this._inputArea))return;const d={inputAreaWrapper:this,selectedText:s,selection:o,clickedRectangles:l};(0,r.dispatchCustomEvent)(document,u.eventNames.dblclick,d)}hasReachedMaxTextLength(e){const t=e[e.length-1];if(!t)return!1;const n=t.parsedTextOffset+t.parsedText.length;return!!(t.parsedText.endsWith(u.PARAGRAPH_SEPARATOR)&&n>this._maxTextLength)||n>this._generousMaxTextLength&&(t.parsedText=t.parsedText.substring(0,this.getReasonableTextCutOffIndex(t.parsedText,this._generousMaxTextLength-t.parsedTextOffset)),!0)}getReasonableTextCutOffIndex(e,t){let n=-1;for(const s of c.SENTENCE_END_CHARS){const r=e.indexOf(s,t);r>=0&&(n<0||r<n)&&(n=r)}return n>=0&&n-t<500?n+1:t}simulateKeyUp(){try{const e=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,keyCode:17,which:17,charCode:0,location:1,key:"Control",code:"ControlLeft"});this._inputArea.dispatchEvent(e)}catch(e){}}simulateInput(e=""){const t=new InputEvent("input",{bubbles:!0,cancelable:!1,inputType:"insertText",data:e});this._inputArea.dispatchEvent(t)}simulateChange(){const e=new Event("change",{bubbles:!0,cancelable:!1});this._inputArea.dispatchEvent(e)}isScrollingProgrammatically(){return this._isScrollingProgrammatically}getLangAttribute(){return this._tweaks.getLangAttribute()}getText(){return this._text}getTextChunks(){return this._textChunks}isTextTooLong(){return this._isTextTooLong}getRteMap(){return this._rteMap}getMode(){return"edit"}getTextRanges(e,t,n=!1,s=!1){if(e<0)return[];const r=this._getTextChunkIndex(e);if(-1===r)return[];let i=[];for(let n=r;n<this._textChunks.length;n++){const{node:s,isTextNode:r,rawText:o,parsedText:a,parsedTextOffset:l}=this._textChunks[n],c=Math.max(e-l,0),d=l>e?e+t-l:t;if(d<0)break;if(!r)continue;const h=this._offsetInRawText(o,a,c),u=this._offsetInRawText(o,a,c+d);i.push({node:s,text:o,start:h,end:u})}return i=this._filterEmptyRanges(i,n,s),i}_filterEmptyRanges(e,t,n){return e.filter(((s,r)=>s.start!==s.end||t&&0===r||n&&r===e.length-1))}getParagraphTextRanges(e,t){const n=[],s=this._getTextChunkIndex(e);if(-1===s)return[];const r=e,i=e+t;let o=!1,a={offset:e,length:0};for(let e=s;e<this._textChunks.length;e++){const{isTextNode:t,parsedText:s,parsedTextOffset:l}=this._textChunks[e];if(!t)continue;const c=l+s.length;if(l>=i)break;o&&(a={offset:l,length:0},o=!1),a.length+=l<r?c-r:c>i?i-l:s.length,s.endsWith(u.PARAGRAPH_SEPARATOR)&&(n.push({textRanges:this.getTextRanges(a.offset,a.length)}),o=!0)}return o||n.push({textRanges:this.getTextRanges(a.offset,a.length)}),n}getTextBoxes(e,t){const n=0===t,s=this.getTextRanges(e,t,n);return s.length?(this._domMeasurement.clearCache(),this._domMeasurement.getTextBoundingBoxes(s,this._inputArea,!0,n)):[]}getSelectionWithFallback(e=!1){return this.getSelection(e)}_addSelectionChangeListener(){this._selectionChangeListener=(0,a.addSelectionEventCE)(this._inputArea,this._onSelectionChange)}_removeSelectionChangeListener(){this._selectionChangeListener&&(this._selectionChangeListener.destroy(),this._selectionChangeListener=null)}updateMaxTextLength(e){this._setMaxTextLength(e),this._updateText()}_setMaxTextLength(e){this._maxTextLength=e,this._generousMaxTextLength=e+1e3}setKeyboardShortcut(e){this._keyboardShortcut=e}destroy(){this._textChunks=[],this._text="",this._inputArea.removeEventListener("blur",this._onBlur,!0),this._keyboardEventTarget.removeEventListener("paste",this._onPaste,!0),this._keyboardEventTarget.removeEventListener("keyup",this._onKeyUp,!0),this._keyboardEventTarget.removeEventListener("keydown",this._onKeyDown,!0),this._keyboardEventTarget.removeEventListener("keypress",this._onKeyPress,!0),this._tweaks.removeCompositionStartListener(this._onCompositionStart),this._tweaks.removeCompositionEndListener(this._onCompositionEnd),this._keyboardEventTarget.removeEventListener("keyup",this._onCompositionDone,!0),this._onSurroundingTextContextChangeDebounce?.cancelCall(),this._removeSelectionChangeListener()}}u.PARAGRAPH_SEPARATOR="\n\n",u.eventNames={blur:`${d}-inputAreaWrapper.blur`,click:`${d}-inputAreaWrapper.click`,scroll:`${d}-inputAreaWrapper.scroll`,paste:`${d}-inputAreaWrapper.paste`,textChanged:`${d}-inputAreaWrapper.textChanged`,surroundingTextContextChanged:`${d}-inputAreaWrapper.surroundingTextContextChanged`,dblclick:`${d}-inputAreaWrapper.dblclick`,keyboardShortcut:`${d}
439-inputAreaWrapper.keyboardShortcut`,wordWritten:`${d}-inputAreaWrapper.newWordWritten`,sentenceWritten:`${d}-inputAreaWrapper.newSentenceWritten`,selectionChanged:`${d}-inputAreaWrapper.selectionChanged`,compositionStart:`${d}-inputAreaWrapper.compositionStart`,compositionEnd:`${d}-inputAreaWrapper.compositionEnd`,keydown:`${d}-inputAreaWrapper.keydown`},u._isWritingContextEnabled=!1},
439"./content/ltAssistant.ts":
440/*!********************************!*\
441  !*** ./content/ltAssistant.ts ***!
442  \********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{LTAssistant:()=>ee});var s=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),r=n(/*! ../background/synonyms */"./background/synonyms.ts"),i=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),o=n(/*! ../common/calculateTextScore */"./common/calculateTextScore.ts"),a=n(/*! ../common/dictionary */"./common/dictionary.ts"),l=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),c=n(/*! ../common/i18nManager */"./common/i18nManager.ts"),d=n(/*! ../common/languageManager */"./common/languageManager.ts"),h=n(/*! ../common/localStorageWrapper */"./common/localStorageWrapper.ts"),u=n(/*! ../common/storageController */"./common/storageController.ts"),g=n(/*! ../common/textStatistics */"./common/textStatistics.ts"),m=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),p=n(/*! ../common/tweaksManager */"./common/tweaksManager.ts"),_=n(/*! ../common/utils */"./common/utils.ts"),E=n(/*! ../components/messagePopup/messagePopup */"./components/messagePopup/messagePopup.ts"),f=n(/*! ../components/undoNotification/undoNotification */"./components/undoNotification/undoNotification.ts"),T=n(/*! ../config/config */"./config/config.ts"),C=n(/*! ../core/ErrorProcessor */"./core/ErrorProcessor.ts"),v=n(/*! ../core/utils */"./core/utils.ts"),S=n(/*! ../lollipop/Lollipop */"./lollipop/Lollipop.ts"),b=n(/*! ./cardController */"./content/cardController.ts"),x=n(/*! ./checkStatus */"./content/checkStatus.ts"),y=n(/*! ./debounce */"./content/debounce.ts"),A=n(/*! ./dialog */"./content/dialog.ts"),k=n(/*! ./Diff */"./content/Diff.ts"),w=n(/*! ./highlighter */"./content/highlighter.ts"),R=n(/*! ./inputAreaWrapper */"./content/inputAreaWrapper.ts"),L=n(/*! ./toolbar */"./content/toolbar.ts"),M=n(/*! ./userActivityMonitor */"./content/userActivityMonitor.ts"),I=n(/*! ../init/config */"./init/config.ts"),P=n(/*! ./requestAbortController */"./content/requestAbortController.ts"),N=n(/*! ../common/advancedToolboxAdapter */"./common/advancedToolboxAdapter.ts"),O=n(/*! ./highlightStylingType */"./content/highlightStylingType.ts"),D=n(/*! ../react/components/toolbox-content/toolbox-content */"./react/components/toolbox-content/toolbox-content.tsx"),H=n(/*! ./recommendationController */"./content/recommendationController.ts"),U=n(/*! ./shadowDomEventsPropagator */"./content/shadowDomEventsPropagator.ts"),F=n(/*! ./termsOfService */"./content/termsOfService.ts"),B=n(/*! @advanced-toolbox/plugin-paraphraser */"../../../node_modules/@advanced-toolbox/plugin-paraphraser/dist/index.js"),G=n(/*! ./recommendationUtils */"./content/recommendationUtils.ts"),j=n(/*! ./typingSpeedController */"./content/typingSpeedController.ts"),W=n(/*! ../common/editors/google/googleEditor */"./common/editors/google/googleEditor.ts"),$=n(/*! ./sentenceRangesUtils */"./content/sentenceRangesUtils.ts"),z=n(/*! ../core/context/changesController */"./core/context/changesController.ts"),V=n(/*! ../core/context/utils */"./core/context/utils.ts"),K=n(/*! ../common/writtingSession */"./common/writtingSession.ts"),X=n(/*! ../core/textUtils */"./core/textUtils.ts"),q=n(/*! ../core/TextCollection */"./core/TextCollection.ts"),Y=n(/*! ./highlighterUtil */"./content/highlighterUtil.ts"),Z=n(/*! ./copyPasteTracker */"./content/copyPasteTracker.ts"),J=n(/*! ../common/trial */"./common/trial.ts");
443/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
444const Q=I.default.get(I.ConfigKey.EXTN_PREFIX);class ee{static getErrorType(e){return(0,v.getErrorType)(e)}static _isPendingError(e,t){if(0===e.contextForSureMatch)return!1;const n=t.substr(e.end,100).split("\n")[0],s=ee.COMPLETED_SENTENCE_REGEXP.test(n)||ee.PUNCTIUATION_CHAR_REGEXP.test(e.originalPhrase);return-1===e.contextForSureMatch&&!s||!s&&n.split(/\s+/).length-1<=e.contextForSureMatch}static _isErrorSelected(e,t){return!(!t||t.start!==e.start&&t.end!==e.end)}
444static _getSentenceCountInChangedParagraph(e,t,n){let s=t.sentenceRanges||[];s=s.sort(((e,t)=>e.start-t.start));const r=e.oldOffset??e.offset,i=e.oldText?.length??e.text.length,o=r+i,[a]=C.ErrorProcessor.migrateOffsetsToOriginalText([{start:r,length:i,end:o}],n);if(!a)return 0;const l=a.start,c=(0,v.getSentenceIndexByOffset)(s,{start:l}),d=e.oldText||e.text,h=(0,v.getSentenceIndexByOffset)(s,{start:l+d?.trimEnd()?.length-1});return void 0!==h&&void 0!==c?h-c+1:0}static _getChangedParagraphs(e,t){return(0,v.getChangedParagraphs)(e,t)}constructor(e={},t=p.TweaksManager.DEFAULT_SITE_TWEAKS){if(this._pageLevelWritingGoalId=null,this._suggestionRangeMetrics={trackedMismatches:new Set,cache:{previousErrorsLength:void 0,previousTextHash:void 0}},this._spellcheckingAttributesData=new Map,this._editors=[],this._messages=[],this._checkExtensionRuntimeHealthIntervalId=void 0,this._fixMissingStylesheetsIntervalId=void 0,this._initElementTimeouts=new Map,this._activeEditorId=null,this._userActiveEditorId=null,this._writingSessionMetadata=new Map,this._monitorUninitializedInputAreasIntervalId=void 0,this._isComposingCharacter=!1,this._isDestroyed=!1,this._init=()=>{if("string"==typeof this._options.apiServerUrl&&this._storageController.updateSettings({apiServerUrl:this._options.apiServerUrl}),"boolean"==typeof this._options.enableSynonyms&&this._storageController.updateSettings({hasSynonymsEnabled:this._options.enableSynonyms}),"boolean"==typeof this._options.enablePickyModeGlobally&&this._storageController.updateSettings({hasPickyModeEnabledGlobally:this._options.enablePickyModeGlobally}),"boolean"==typeof this._options.enableStatisticsCollection&&this._storageController.updatePrivacySettings({hasStatisticsCollectionEnabled:this._options.enableStatisticsCollection}),"boolean"==typeof this._options.disableExternalRephrasings&&this._storageController.updatePrivacySettings({hasOptedIntoThirdPartyAiParaphrasing:!this._options.disableExternalRephrasings}),this._options.dev&&this._storageController.updateUIState({showRuleId:!0}),"object"==typeof this._options.testGroups&&this._storageController.updateTestFlags({testGroups:this._options.testGroups}),this.updateLanguageOptions({motherTongue:this._options.motherTongue,preferredLanguages:this._options.preferredLanguages,preferredVariants:this._options.preferredVariants}),this._options.user&&this.updateUser({email:this._options.user.email,token:this._options.user.token,premium:this._options.user.premium,apiServerUrl:this._options.apiServerUrl}),this._onPageLoaded(),this._tweaks.isSupported(this._pageInfo)&&this._storageController.isDomainSupported((0,v.getCurrentDomain)())){if(this._isRemoteCheckAllowed=this._storageController.getPrivacySettings().allowRemoteCheck,this._checkExtensionRuntimeHealthIntervalId=self.setInterval(this._checkExtensionRuntimeHealth,T.EXTENSION_HEALTH_RECHECK_INTERVAL),this._options.initElements){const e=Array.isArray(this._options.initElements)?this._options.initElements:[this._options.initElements];for(const t of e)this._initElement(t)}if(!this._options.ignoreFocus){const e=(0,_.getFocusedElement)();e&&this._initElement(e,!0),document.body&&(0,_.hasFirefoxDesignMode)(document.body)&&this._initElement(document.body,!0)}self.__ltLastActiveElement&&(this._initElement(self.__ltLastActiveElement),self.__ltLastActiveElement=null),this._tweaks.onNewElement(((e,t)=>{this._initElement(e,t)})),this._checkForUninitializedInputAreas(),self.innerHeight>14&&"extension"===l.EnvironmentAdapter.getType()&&(this._fixMissingStylesheetsIntervalId=self.setInterval((()=>{this._fixIframeWithoutStylesheets()}),T.IFRAME_INITILIZATION_RECHECK_INTERVAL)),self.addEventListener("pageshow",this._onPageLoaded),self.addEventListener("pagehide",this._onPageHide),document.addEventListener("visibilitychange",this._onVisiblityChange,!0),document.addEventListener("focus",this._onDocumentFocus,!0),document.addEventListener(U.ShadowDomEventsPropagator.eventNames.focus,this._onDocumentFocus,!0),document.addEventListener("mousemove",this._onDocumentMousemove,!0),document.addEventListener("focusout",this._onDocumentFocusout,!0),document.addEventListener(U.ShadowDomEventsPropagator.eventNames.focusout,this._onDocumentFocusout,!0),document.addEventListener("keyup",this._onDocumentKeyup,!0),document.addEventListener(this._tweaks.getClickEvent(),this._onDocumentClick,!0),self.frameElement?.ownerDocument&&self.frameElement.ownerDocument.addEventListener("click",this._onDocumentClick,!0),document.addEventListener(l.EnvironmentAdapterBaseClass.eventNames.sentenceRangesChecked,this.onCheckSentenceRangesChecked),document.addEventListener(l.EnvironmentAdapterBaseClass.eventNames.incrementalCheckResponseReceived,this.onIncrementalCheckResponseReceived),document.addEventListener(R.InputAreaWrapper.eventNames.scroll,this._onInputScroll),document.addEventListener(R.InputAreaWrapper.eventNames.paste,this._onInputPaste),document.addEventListener(R.InputAreaWrapper.eventNames.textChanged,this._onInputTextChanged),document.addEventListener(R.InputAreaWrapper.eventNames.surroundingTextContextChanged,this._onInputSurroundingTextContextChanged),document.addEventListener("session-id-created",this._onWritingSessionCreated),document.addEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_SYNC_ACK,this._onEditorStateSyncAck),document.addEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_FORCE_SYNC,this._onEditorStateForceSync),document.addEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC,this._onEditorSurroundingContextForceSync),document.addEventListener(R.InputAreaWrapper.eventNames.selectionChanged,this._onSelectionChanged),("dblclick"===this._options.highlightInteraction?.rephrase||this._options.highlightInteraction?.rephrase.includes("dblclick"))&&document.addEventListener(R.InputAreaWrapper.eventNames.dblclick,this._onInputDblClick),document.addEventListener(R.InputAreaWrapper.eventNames.keyboardShortcut,this._onKeyboardShortcut),document.addEventListener(R.InputAreaWrapper.eventNames.wordWritten,this._onWordWritten),document.addEventListener(R.InputAreaWrapper.eventNames.sentenceWritten,this._onSentenceWritten),document.addEventListener(R.InputAreaWrapper.eventNames.compositionStart,this._onCompositionStart),document.addEventListener(R.InputAreaWrapper.eventNames.compositionEnd,this._onCompositionEnd),document.addEventListener(R.InputAreaWrapper.eventNames.keydown,this._onInputKeyDown),document.addEventListener(R.InputAreaWrapper.eventNames.click,this._onInputClick),document.addEventListener(R.InputAreaWrapper.eventNames.blur,this._onInputBlur),("hover"===this._options.highlightInteraction?.correct||"hover"===this._options.highlightInteraction?.recommendation||this._options.highlightInteraction?.recommendation.includes("hover"))&&document.addEventListener(w.Highlighter.eventNames.blockHovered,this._onHiglighterBlockMouseMove),document.addEventListener(w.Highlighter.eventNames.blockClicked,this._onHiglighterBlockCl
444icked),document.addEventListener(L.Toolbar.eventNames.permissionRequiredIconClicked,this._onToolbarPermissionRequiredIconClicked),document.addEventListener(L.Toolbar.eventNames.visibilityChanged,this._onToolbarVisibilityChange),document.addEventListener(L.Toolbar.eventNames.toggleDialog,this._onToolbarToggleDialog),document.addEventListener(L.Toolbar.eventNames.languageChanged,this._onToolbarLanguageChanged),document.addEventListener(L.Toolbar.eventNames.showRephrasingCard,this._onRephrasingIconClick),document.addEventListener(L.Toolbar.eventNames.turnOff,this._onTurnOffClickedToolbar),document.addEventListener(L.Toolbar.eventNames.pauseChecking,this._onPauseCheckingClickedToolbar),document.addEventListener(L.Toolbar.eventNames.fixAllErrors,this._onToolbarFixAllErrors),document.addEventListener(A.Dialog.eventNames.positionChangeClicked,this._onPositionChangeClicked),document.addEventListener(A.Dialog.eventNames.enableHere,this._onDialogEnableHere),document.addEventListener(A.Dialog.eventNames.togglePickyMode,this._onPickyModeToggle),document.addEventListener(A.Dialog.eventNames.enableEverywhere,this._onDialogEnableEverywhere),document.addEventListener(A.Dialog.eventNames.languageChanged,this._onDialogLanguageChanged),document.addEventListener(A.Dialog.eventNames.countChanged,this._onDialogCountChanged),document.addEventListener(A.Dialog.eventNames.errorSelected,this._onDialogErrorSelected),document.addEventListener(A.Dialog.eventNames.errorHighlighted,this._onDialogErrorHighlighted),document.addEventListener(A.Dialog.eventNames.addToDictionaryClicked,this._onAddToDictionary),document.addEventListener(A.Dialog.eventNames.ignoreRuleClicked,this._onIgnoreRule),document.addEventListener(A.Dialog.eventNames.temporarilyIgnoreWordClicked,this._onTemporarilyIgnoreWord),document.addEventListener(A.Dialog.eventNames.temporarilyIgnoreRuleClicked,this._onTemporarilyIgnoreRule),document.addEventListener(A.Dialog.eventNames.moreDetailsClicked,this._onMoreDetailsClicked),document.addEventListener(A.Dialog.eventNames.fixSelected,this._onFixSelected),document.addEventListener(A.Dialog.eventNames.openOptions,this._onDialogOpenOptions),document.addEventListener(A.Dialog.eventNames.showFeedbackForm,this._onDialogShowFeedbackForm),document.addEventListener(A.Dialog.eventNames.destroyed,this._onDialogDestroyed),document.addEventListener(A.Dialog.eventNames.badgeClicked,this._onBadgeClicked),document.addEventListener(A.Dialog.eventNames.turnOff,this._onTurnOffClickedDialog),document.addEventListener(A.Dialog.eventNames.pauseChecking,this._onPauseCheckingClickedDialog),document.addEventListener(A.Dialog.eventNames.premiumTeaserClicked,this._onDialogPremiumTeaserClicked),document.addEventListener(A.Dialog.eventNames.correctAll,this._onCorrectAll),document.addEventListener(A.Dialog.eventNames.unlockSuggestion,this._onUnlockSuggestion),document.addEventListener(b.default.eventNames.addToDictionaryClicked,this._onAddToDictionary),document.addEventListener(b.default.eventNames.ignoreRuleClicked,this._onIgnoreRule),document.addEventListener(b.default.eventNames.temporarilyIgnoreWordClicked,this._onTemporarilyIgnoreWord),document.addEventListener(b.default.eventNames.temporarilyIgnoreRuleClicked,this._onTemporarilyIgnoreRule),document.addEventListener(b.default.eventNames.moreDetailsClicked,this._onMoreDetailsClicked),document.addEventListener(b.default.eventNames.fixSelected,this._onFixSelected),document.addEventListener(b.default.eventNames.premiumClick,this._onEditorCardPremiumClick),document.addEventListener(b.default.eventNames.languageChanged,this._onErrorCardLanguageChanged),document.addEventListener(b.default.eventNames.turnOffPickyModeClicked,this._onErrorCardPickyModeTurnedOff),document.addEventListener(b.default.eventNames.premiumTeaserClicked,this._onErrorCardPremiumTeaserClicked),document.addEventListener(b.default.eventNames.destroyed,this._onEditorCardDestroyed),document.addEventListener(b.default.eventNames.correctAll,this._onCorrectAll),document.addEventListener(b.default.eventNames.synonymSelected,this._onSynonymSelected),document.addEventListener(b.default.eventNames.phraseSelected,this._onPhraseSelected),document.addEventListener(b.default.eventNames.splitSentenceSelected,this._onSplitSentenceSelected),document.addEventListener(b.default.eventNames.fixSentenceSelected,this._onFixSentenceSelected),document.addEventListener(b.default.eventNames.fixSentenceShowHightlight,this._onFixSentenceShowHighlight),document.addEventListener(b.default.eventNames.fixSentenceRemoveHightlight,this._onFixSentenceRemoveHighlight),document.addEventListener(b.default.eventNames.toggleMode,this._onToggleCardMode),document.addEventListener(b.default.eventNames.highlight,this._onEditorCardHighlight),document.addEventListener(b.default.eventNames.navigateError,this._onNavigateError),document.addEventListener(b.default.eventNames.navigateSentence,this._onNavigateSentence),document.addEventListener(b.default.eventNames.applyToolboxResult,this._onApplyToolboxResult),document.addEventListener(b.default.eventNames.unlockSuggestion,this._onUnlockSuggestion),document.addEventListener(E.MessagePopup.eventNames.destroyed,this._onMessagePopupDestroyed),document.addEventListener(E.MessagePopup.eventNames.turnOn,this._onTurnOnClicked),document.addEventListener(
444D.ToolboxEventNames.turnOffLollipop,this._onLollipopTurnOffClicked),document.addEventListener(W.GoogleEditor.eventNames.contextMenuItemClicked,this._onGoogleEditorContextMenuItemClicked),this._storageController.addEventListener(u.StorageController.eventNames.settingsChanged,this._onSettingsChanged),this._storageController.addEventListener(u.StorageController.eventNames.privacySettingsChanged,this._onPrivacySettingsChanged),this._storageController.addEventListener(u.StorageController.eventNames.uiStateChanged,this._onUiStateChanged),this._options.onInit&&this._options.onInit(this),Math.random()<1e-4&&this._pingBackround()}},this.editorSelectionChanged=e=>{e.appliedChange||(e.selectedText=e.inputAreaWrapper.getSelectedText(),this._updateState(e))},this._onSelectionChanged=e=>{const t=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));t&&(t.appliedChange?(t.selectedText="",this._updateState(t)):t.selectionChangeDebounce.call(t))},this._updateState=e=>{const t=e.language?.code||"";let n=this._recommendationController.getRecommendationStatus({editor:e}),s="";e.checkError&&(s=this._getCheckErrorMessage(e.checkError),n=x.CHECK_STATUS.FAILED);const r=this._getCheckStatus(e);if(e.checkStatus=r,e.recommendationStatus=n,this._updateToolbarState(e),e.dialog){const t=new g.TextStatistics(e.inputAreaWrapper.getText(),e.currentSentenceRanges||[]),i=(new o.TextScore).calculateTextScore(t.countWords(),e.errors,e.premiumErrors,e.pickyErrors),a={checkStatus:r,recommendationStatus:n,errors:e.errors,pickyErrors:e.pickyErrors,displayedPremiumErrors:e.displayedPremiumErrors,displayedErrors:e.displayedErrors,isIncompleteResult:e.isIncompleteResult,ignoredErrorsStats:this._getIgnoredErrorsStats(e.errors),checkErrorMessage:s,textScore:i,countOptions:this._getCountOptions(e),isPickyModeEnabled:"picky"===e.checkLevel};e.dialog.updateState(a)}e.displayedHiddenErrorCount=Math.max(e.displayedHiddenErrorCount,e.premiumErrors.length);const i={checkStatus:r,recommendationStatus:n,languageCode:t,unsupportedLanguageCode:e.unsupportedLanguageCode||null,errors:e.errors,pickyErrors:e.pickyErrors,premiumErrors:e.premiumErrors,premiumPickyErrors:e.premiumPickyErrors,displayedErrors:e.displayedErrors,recommendationErrors:e.recommendationErrors,displayedPremiumErrors:e.displayedPremiumErrors,isIncompleteResult:e.isIncompleteResult,errorMessage:s,checkedText:e.checkedText,sentenceRanges:e.currentSentenceRanges,originalSentenceRanges:e.sentenceRanges,currentText:e.inputAreaWrapper.getText(),synonyms:e.synonyms,rephrasings:e.rephrasings,writingGoalId:e.writingGoalId,editorId:e.id,inputAreaMatchedTweaksName:e.inputAreaTweaks.name,showOptionalError:e.showOptionalError};(e.callbacks.onUpdate||this._isValidatorPage())&&((0,_.dispatchCustomEvent)(e.inputArea,ee.events.UPDATE,i),e.callbacks.onUpdate&&e.callbacks.onUpdate(i)),this._options&&this._options.onCurrentActiveEditorStateUpdate&&this._userActiveEditorId===e.id&&this._options.onCurrentActiveEditorStateUpdate(i)},this._sendCheckRequest=async(e,t,n,s)=>{const r=e.inputAreaTweaks.getReplacedParts(t),i=(0,v.getValuableText)(t,r),o=this._sendCheckRequest.metaArgs,{isMaxDebounceCall:a}=o??{isMaxDebounceCall:!1},c=this._getBeforeUserTextChangeActionType({editor:e});if(i.text===e.checkedText.text)return this._onCheckAborted(e,e.checkedText,i),void(i.text===e.recommendationCheckedText.text&&this._recommendationController.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:i,appliedFix:null}));const d=Date.now(),h=new z.ChangesController;let u,g;e.textCollection.updateText(i),u=this._options.incrementallyPaint?e.textCollection.getChangedParagraphs():ee._getChangedParagraphs(e.checkedText.text,i.text),n&&1===u.length?g=ee._getSentenceCountInChangedParagraph(u[0],e,e.checkedText.usedParts):n=void 0;const p=(0,v.getCurrentUrl)(),E=await e.inputAreaTweaks.getRecipientInfo(),f=e.inputAreaWrapper.getLangAttribute();let T=[];const C=0===e.lastEditorContentSavedTimestamp,S=C?d:e.lastEditorContentSavedTimestamp;e.lastEditorContentSavedText===i.text?T=[h.createNoChangeOperation(S)]:C?(T=h.generateParagraphChangeOTOperations(e.lastEditorContentSavedText,i.text,S),this._options.incrementallyPaint&&(u=e.textCollection.getChangedParagraphs(),T.forEach((e=>{e.id=u.find((t=>t.offset===e.start))?.id||""})))):T=h.generateTextChangeOperations(e.lastEditorContentSavedText,i.text,S);const b={instanceId:e.id,pageUrl:p,checkLevel:e.checkLevel,elementLanguage:f,recipientInfo:E,rteMap:e.inputAreaWrapper.getRteMap(),appliedFix:n,changedParagraphsSentencesLength:g,disableRecommendations:!0,appliedFixAll:!!s,checkTimestamp:d,lastEditorContentSavedTimestamp:e.lastEditorContentSavedTimestamp,valuableText:i},x=e.inputAreaTweaks.getCheckOptions(e,t,this._storageController);this._options.trialAccessToken&&(x.trialAccessToken=this._options.trialAccessToken);try{const s=await Promise.race([l.EnvironmentAdapter.check(e,i.text,u,b,x,e.writingGoalId,T,i,e.checkedText),e.checkRequestController.signal]),r=Date.now();if(!s||"Aborted"===s)return;if(s.isSuccessful){if(this._options.incrementallyPaint?this._onCheckCompletedIncremental(s,i,d,a,c):this._onCheckCompleted(s,i,d,a,c),s.areErrorsSuppressed&&n&&!n?.isRecommendation&&"REPHRASING"!==n?.ruleId){const{start:t,end:s,replacementText:r}=n,o=(0,_.isFixAppliedToText)(e.inputAreaWrapper.getText(),e.recommendationCheckedText.originalText,r,t,s
444);return void(this.isOverlappingErrorsEnabled()&&o?e.checkedRecommendationTextErrors=this._recommendationController.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:i,appliedFix:n}):this._recommendationController.onApplyFixPipeline({editor:e,valuableText:i,appliedFix:n}))}if(!o)return;if(n?.isRecommendation||"REPHRASING"===n?.ruleId)return void this._recommendationController.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:i,appliedFix:n});if(d!==e.lastCheckTimestamp)return;const l=(s?.paragraphLevelSentenceRanges||[]).filter((e=>"failure"===e?.checkStatus));this._recommendationController.onReviewModePipeline({editor:e,text:t,checkCallMetaArgs:o,checkResponseReceivedTimestamp:r,ignoreSentenceRanges:l})}else this._onCheckFailed(s)}catch(t){e.isChecking=!1,console.error(t),m.TrackerAdapter.trackError("message",t.message,"CHECK_TEXT"),t.message&&(0,_.isExtensionRuntimeError)(t.message)?this._handleUnhealthyExtensionRuntime():(e.checkError={reason:"UnknownError",status:0},this._updateState(e))}},this.disableEditorHighlightAndResetUnderlineOpacity=(e,t)=>{const n=t??this._editors.find((t=>t.id===e));n&&(n.hideUnderlines=!0,n.highlighter.setUnderlineOpacity(1),this._highlight(n))},this.disableAllEditorHighlights=()=>{this._editors.forEach((e=>{this.disableEditorHighlightAndResetUnderlineOpacity(e.id,e)}))},this.enableEditorHighlight=e=>{const t=this._editors.find((t=>t.id===e));t&&(t.hideUnderlines=!1,this._highlight(t))},this.setEditorUnderlineOpacity=(e,t)=>{const n=this._editors.find((t=>t.id===e));n&&n.highlighter.setUnderlineOpacity(t??1)},this.disableCssCustomHighlightsApiForEditor=e=>{const t=this._editors.find((t=>t.id===e));t&&t.highlighter.disableCssCustomHighlightsApi()},this.disableHighlightForEditorsWithDialog=()=>{this._editors.forEach((e=>{e.dialog&&this.disableEditorHighlightAndResetUnderlineOpacity(e.id,e)}))},this.mergeAndDisplayErrors=(e,t=!0)=>{const n=this._editors.find((t=>t.id===e.instanceId));if(!n||!n.isAutoCheckEnabled)return;const{errors:s,premiumErrors:r,recommendationErrors:i,valuableCurrentText:o}=this.mergeAndMigrateErrors(n,t,{errors:e,existingCheckedText:n.checkedText,newCheckedText:n.checkedText,existingRecommendationCheckedText:n.recommendationCheckedText,newRecommendationCheckedText:n.recommendationCheckedText},!1,!1,!1);this._updateDisplayedErrors(n,o,s,r,i),this._highlight(n),this._updateState(n)},this.removeDuplicateErrors=e=>{const t=new Map;for(const n of e){const e=`${n.start}-${n.end}-${n.rule.id}`;t.has(e)||t.set(e,n)}return Array.from(t.values())},this.removeDuplicateSentenceRanges=e=>{const t=new Map;for(const n of e){const e=`${n.start}-${n.end}`;t.has(e)||t.set(e,n)}return Array.from(t.values())},this.onCheckSentenceRangesChecked=async e=>{const{sentenceRangesCheckedText:t,sentenceRangesCheckResult:n,checkTimestamp:s,sentenceRanges:r}=e.detail;this.updateSentenceRanges(t,n,s,r)},this.onIncrementalCheckResponseReceived=e=>{const{instanceId:t,data:n,currentCheckedText:s,previousCheckedText:r,paragraph:i}=e.detail;n.areErrorsSuppressed||this.mergeAndDisplayIncrementalErrors(t,n,s,r,i)},this.updateSentenceRanges=(e,t,n,s)=>{if("string"!=typeof e.text)return;if(!t||"object"!=typeof t)return;if("number"!=typeof n||n<0)return;if(void 0!==s&&!Array.isArray(s))return;const r=this._editors.find((e=>e.id===t.instanceId));if(r)try{if(n<=r.lastSentenceRangesCheckTimestamp)return r.isSentenceRangesChecking=!1,void this._updateState(r);if(t.isUnsupportedLanguage)return r.isSentenceRangesChecking=!1,void this._updateState(r);if(t.language&&!r.language&&(r.language=t.language),t.language&&t.language.code.toLowerCase()!==r.language.code.toLowerCase())return r.isSentenceRangesChecking=!1,void this._updateState(r);let i=!1;if(!s){const o=(0,$.mergeAndMigrateSentenceRanges)(r.sentenceRanges,{paragraphLevelSentenceRanges:t.paragraphLevelSentenceRanges||[],existingCheckedText:r.sentenceRangesCheckedText,newCheckedText:e,existingRecommendationCheckedText:r.recommendationCheckedText,newRecommendationCheckedText:r.recommendationCheckedText},r.showPickyAsHiddenMatch,!1,!1);s=o,i=!0,r.sentenceRanges=o,r.sentenceRangesCheckedText=e,r.checkedTextSentenceRanges=o,r.lastSentenceRangesCheckTimestamp=n}if(s){const t=r.inputAreaWrapper.getText(),n=r.inputAreaTweaks.getReplacedParts(t),i=(0,v.getValuableText)(t,n);s=C.ErrorProcessor.migrateOffsetsToValuableText(s,e.usedParts),s=C.ErrorProcessor.migrateOffsetsBetweenTexts(s,e.text,i.text),s=C.ErrorProcessor.migrateOffsetsToOriginalText(s,i.usedParts),C.ErrorProcessor.sortSentenceRanges(s),r.currentSentenceRanges=s}r.isSentenceRangesChecking=!1,i&&this._updateState(r)}catch(e){console.error("updateSentenceRanges: Error processing sentence ranges",e),m.TrackerAdapter.trackError("js","updateSentenceRanges_error",e?.message??"unknown error"),r.isSentenceRangesChecking=!1,this._updateState(r)}},this.mergeAndMigrateErrors=(e,t,n,s,r,i,o=!0)=>{const a=o?e.sentenceRanges:[];let{errors:l,pickyErrors:c,premiumErrors:d,premiumPickyErrors:h,recommendationErrors:u=[],sentenceRanges:g}=C.ErrorProcessor.merge({existing:{errors:e.errors,pickyErrors:e.pickyErrors,premiumErrors:e.premiumErrors,premiumPickyErrors:e.premiumPickyErrors,recommendationErrors:e.recommendationErrors,sentenceRanges:a},new:{textLevel:{errors:n.errors.textLevelErrors||[],pickyErrors:n.errors.textLevelPickyErrors||[],premiumErrors:n.errors.textLevelPremiumErrors||[],premiumPickyErrors:n.errors.textLevelPremiumPickyErrors||[]},paragraphLevel:{errors:i?[]:n.errors.paragraphLevelErrors||[],pickyErrors:n.errors.paragraphLevelPickyErrors||[],premiumErrors:n.errors.paragraphLevelPremiumErrors||[],premiumPickyErrors:n.errors.paragraphLevelPremiumPickyErrors||[],recommendationErrors:i&&n.errors.paragraphLevelErrors||[],...n.errors.paragraphLevelSentenceRanges&&{sentenceRanges:o?n.errors.paragraphLevelSentenceRanges:[]}}},existingCheckedText:n.existingCheckedText,newCheckedText:n.newCheckedText,existingRecommendationCheckedText:n.existingRecommendationCheckedText,newRecommendationCheckedText:n.newRecommendationCheckedText},s,r,i);e.errors=this.removeDuplicateErrors(l),e.checkedTextErrors=this.removeDuplicateErrors(l),e.pickyErrors=this.removeDuplicateErrors(c),e.premiumErrors=this.removeDuplicateErrors(d),e.premiumPickyErrors=this.removeDuplicateErrors(h),e.recommendationErrors=this.removeDuplicateErrors(u),t||(e.checkedText=n.newCheckedText,i&&(e.recommendationCheckedText=n.newRecommendationCheckedText,e.checkedRecommendationTextErrors=e.recommendationErrors),e.isIncompleteResult=n.errors.isIncompleteResult,e.needsLanguageHintFromUser=!1===e.forceLanguage&&this._needsLanguageHintFromUser(l,n.newCheckedText.text));const m=e.inputAreaWrapper.getText(),p=e.inputAreaTweaks.getReplacedParts(m),_=(0,v.getValuableText)(m,p);return l=C.ErrorProcessor.migrateOffsetsToValuableText(l,e.checkedText.usedParts),l=C.ErrorProcessor.migrateOffsetsBetweenTexts(l,e.checkedText.text,_.text),l=C.ErrorProcessor.migrateOffsetsToOriginalText(l,_.usedParts),u=C.ErrorProcessor.migrateOffsetsToValuableText(u,e.re
444commendationCheckedText.usedParts),u=C.ErrorProcessor.migrateOffsetsBetweenTexts(u,e.recommendationCheckedText.text,_.text,!1,!0,r),u=C.ErrorProcessor.migrateOffsetsToOriginalText(u,_.usedParts),this.isOverlappingErrorsEnabled()||(u=this._recommendationController.filterOutOverlappingError(l,u)),e.recommendationErrors=(0,v.deepClone)(e.recommendationErrors).filter((e=>u.find((t=>t.id===e.id)))),{errors:l,premiumErrors:d,sentenceRanges:g,recommendationErrors:u,valuableCurrentText:_}},this._updateDisplayedErrors=(e,t,n,s,r)=>{const{isVisiblyErrorFree:i}=e;n=(n=e.inputAreaTweaks.filterErrors(e,t,n)).filter(((t,s)=>{if(["DOUBLES_ESPACES","DOPPELTES_LEERZEICHEN","CONSECUTIVE_SPACES","DOBLE_ESPACIO","DUBBELE_SPATIE"].includes(t.rule.id))return 2===t.length&&t.originalPhrase.length===t.length&&((0,_.isFormElement)(e.inputArea)||(0,_.isGoogleDocsCanvas)(e.inputArea)||ee.CONSECUTIVE_SPACE_REGEXP.test(t.originalPhrase));if(["COMMA_PARENTHESIS_WHITESPACE"].includes(t.rule.id))return t.originalPhrase.length===t.length;if(t.rule.id.endsWith("UNPAIRED_BRACKETS")||t.rule.id.endsWith("UNPAIRED_QUOTES")){const e=n[s+1],r=n[s-1];if(e&&0===t.fixes.length&&"„"===t.originalPhrase&&ee.QUOTATION_RULE_IDS_REGEXP.test(e.rule.id)&&"”"===e.originalPhrase)return!1;if(e&&0===t.fixes.length&&"„"===t.originalPhrase&&ee.QUOTATION_RULE_IDS_REGEXP.test(e.rule.id)&&'"'===e.originalPhrase)return!1;if(r&&e&&0===t.fixes.length&&"“"===t.originalPhrase&&ee.QUOTATION_RULE_IDS_REGEXP.test(e.rule.id)&&'"'===r.originalPhrase)return!1}return!0}));const{ignoredRules:o}=this._storageController.getSettings(),l=e.inputAreaWrapper.getSelection(),c=e.displayedErrors;e.displayedErrors=[],e.pendingErrors=[],e.displayedPremiumErrors=[];const d=a.Dictionary.get();for(const t of n)if(!((0,v.isErrorIgnoredByDictionary)(t,e.ignoredWords)||(0,v.isErrorIgnoredByDictionary)(t,d)||(0,v.isErrorRuleIgnored)(t,o)||(0,v.isErrorRuleIgnored)(t,e.ignoredRules))){if(e.isUserTyping&&(ee._isPendingError(t,e.checkedText.originalText)||ee._isErrorSelected(t,l))&&!c.some((e=>e.start===t.start&&e.end===t.end||e.id===t.id&&e.originalPhrase===t.originalPhrase))){e.pendingErrors.push(t);continue}e.displayedErrors.push(t)}let h=r;if(this.isOverlappingErrorsEnabled()){const t=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.sentenceRanges||[],e.sentenceRangesCheckedText.originalText,e.inputAreaWrapper.getText(),!1,!0,!0),s=(0,G.identifySentencesWithGrammarErrors)(e,t,n),i=(0,G.updatePhrasalRecommendationOffsets)(r,t);h=(0,G.filterPhrasalRecommendationsByGrammarErrors)(i,t,s)}for(const t of h)(0,v.isErrorIgnoredByDictionary)(t,e.ignoredWords)||(0,v.isErrorIgnoredByDictionary)(t,d)||(0,v.isErrorRuleIgnored)(t,o)||(0,v.isErrorRuleIgnored)(t,e.ignoredRules)||e.displayedErrors.push(t);if(C.ErrorProcessor.sortErrorsByOffset(e.displayedErrors),this._options.filterErrors&&(n=this._options.filterErrors(e.displayedErrors,e.id),e.displayedErrors=n),e.isVisiblyErrorFree=0===e.displayedErrors.length,e.displayedPremiumErrors=[...s],null!==e.selectErrorAfter){const t=this._getErrorAfter(e,e.selectErrorAfter);e.selectErrorAfter=null,t?this._scrollToError(e,t,"auto",!1===e.isCorrectingMultiple,!0):e.card?.switchError({displayedErrors:[]})}else if(!0===e.card?.isDetached&&"correct"===e.card.mode&&!0!==e.isCorrectingMultiple)if(e.displayedErrors.length>0){let t;if(i){const{start:n=0}=e.inputAreaWrapper.getSelection()||{};t=this._getErrorAfter(e,n)}else e.selectedErrorId&&(t=e.displayedErrors.find((({id:t})=>t===e.selectedErrorId)));const{error:n,canCorrectMultipleAtOnce:s}=t?this._getErrorCardData(e,t):{canCorrectMultipleAtOnce:!1,error:void 0};n&&(e.selectedErrorId=n?.id||null,e.card?.switchError({displayedErrors:e.displayedErrors,error:n,canCorrectMultipleAtOnce:s}),this._highlight(e))}else e.card?.switchError({displayedErrors:[]});else e.selectedErrorId&&(e.displayedErrors.some((({id:t})=>t===e.selectedErrorId))||this._hideAllEditorCards({ignoreDetachedEditorCard:!0}))},this._highlight=(e,t=!1,n=[])=>{const s=this._options.onBeforeErrorHighlight?.(e.selectedErrorId);if(s)return;const r=(e.hideUnderlines?[]:e.displayedErrors).flatMap((t=>{let s=!1;t.isOptional&&(s=!e.showOptionalError);const r=t.id===e.selectedErrorId||!!this._options.emphasizeErrors||n.includes(String(t.id)),i=t.id===e.selectedErrorId;let o,a=O.HighlightStylingType.grammar_error;return i?a=O.HighlightStylingType.grammar_error_selected:r&&(a=O.HighlightStylingType.grammar_error_emphasized),t.rule.id.startsWith("TOO_LONG_SENTENCE")?a=i?O.HighlightStylingType.too_long_sentence_error_selected:r?O.HighlightStylingType.too_long_sentence_error_emphasized:O.HighlightStylingType.too_long_sentence_error:"IGNORED_RANGE"===t.rule.id?a=i?O.HighlightStylingType.ignored_range_error_selected:r?O.HighlightStylingType.ignored_range_error_emphasized:O.HighlightStylingType.ignored_range_error:t.isRecommendation&&this._options.canOpenRecommendation?.(t)?s?a=i?O.HighlightStylingType.recommendation_optional_selected_paid:O.HighlightStylingType.recommendation_optional:i?(a=O.HighlightStylingType.paid_recommendation_selected,o=I.default.get(I.ConfigKey.SELECTED_UNDERLINE_THICKNESS)):r?(a=O.HighlightStylingType.paid_recommendation_emphasized,o=I.default.get(I.ConfigKey.SELECTED_UNDERLINE_THICKNESS)):a=O.HighlightStylingType.paid_recommendation:t.isRecommendation?s?a=i?O.HighlightStylingType.recommendation_optional_selected_tease:O.HighlightStylingType.recommendation_optional:i?(a=O.HighlightStylingType.recommendation_tease_selected,o=I.default.get(I.ConfigKey.SELECTED_UNDERLINE_THICKNESS)):r?(a=O.HighlightStylingType.recommendation_tease_emphasized,o=I.default.get(I.ConfigKey.SELECTED_UNDERLINE_THICKNESS)):a=O.HighlightStylingType.recommendation_tease:t.isSpellingError?a=i?O.HighlightStylingType.spelling_error_selected:r?O.HighlightStylingType.spelling_error_emphasized:O.HighlightStylingType.spelling_error:(t.isStyleError||t.isCustomError)&&(a=i?O.HighlightStylingType.style_error_selected:r?O.HighlightStylingType.style_error_emphasized:O.HighlightStylingType.style_error),t.isRecommendation&&I.default.get(I.ConfigKey.SHOW_PARTIAL_RECO_UNDERLINE)&&"RECOMMENDATION"===t.rule.issueType?(0,G.getRecommendationHighlighterBlock)(t,o,a,r,e.highlighter.getCurrentTextBoxes,s):[{id:t.id,offset:t.start,length:t.length,isUnderlined:!s,isEmphasized:r,highlightStylingType:a,underlineThickness:o}]}));let i,o,a,l;if(e.card?.currentTextHighlightType&&(i=b.default.BLOCK_ID,o=e.card.getSelection(e.card.currentTextHighlightType),a=e.card.highlightStylingType,l=e.card.backgroundColor),o&&(0,v.isString)(i)&&a&&(0,v.isString)(l)&&r.push({id:i,offset:o.start,length:o.end-o.start,isEmphasized:""!==l,isUnderlined:!1,simulateSelection:!0,highlightStylingType:a}),e.flashHighlight&&r.push(e.flashHighlight),e.lollipopTextHighlight&&r.push(e.lollipopTextHighlight),e.lineHighlights&&this._isInteractionModeRewrite(e)&&r.push(...e.lineHighlights),this.isOverlappingErrorsEnabled()){const n=(0,Y.handleConflictingHighlights)(r);e.highlighter.highlight(n,t,this._isInteractionModeRewrite(e))}else e.highlighter.highlight(r,t,this._isInteractionModeRewrite(e));this._trackSuggestionRangeMismatches(e)},this._showErrorCard=async(e,t,n,s,r=!1)=>{const i=this._options.onBeforeShowErrorCard?.(t);if(i)return;const o=this._storageController.isPremium(),{username:a,token:l}=this._storageController.getSettings(),c=a?{email:a,token:l}:void 0,h=!(0,_.isGoogleSlides)(e.inputArea),{start:u,end:g=u}=e.inputAreaWrapper.getSelection()||{start:t.start},p={mode:"correct",storageController:this._storageController,inputArea:e.inputArea,tweaks:e.inputAreaTweaks.getEditorCardTweaks(),disablePremiumTeaser:this._options.disablePremiumTeaser||this._storageController.hasCustomServer()||o,anchorSelection:{start:u,end:g},getText:()=>e.inputAreaWrapper.getText(),getSentenceRanges:()=>e.currentSentenceRanges,getInputAreaScrollContainer:()=>
444e.inputAreaWrapper.getScrollContainer(),onCardHovered:this._onEditorCardHovered,customEditorCard:this._options.customEditorCard,canToolboxJumpToNextSentence:h,enableKeyboard:r,inhouseOnly:!1,triggerType:s,targetBox:n,user:c,isPremium:o};e.card=new b.default(p),this._fadeAllDialogs(),e.lollipop?.resetDilate(),clearTimeout(e.lollipopDilateScheduleTimeoutId),e.lollipopDilateScheduleTimeoutId=void 0,e.lollipop?.disableProximityHandler();const E=d.LanguageManager.getPrimaryLanguageCode(t.language.code),f=this._getErrorCardData(e,t);e.card.setLanguage(E),e.card.setErrorCardArguments(f),e.card.render(),this._updateState(e),!t.isSpellingError&&T.TRACK_RULE_EVENT_LANGUAGES.includes(E)&&m.TrackerAdapter.trackEvent("Action",`${E}:open_rule`,t.rule.id)},this._showAndHighlightErrorCard=async(e,t,n,s,r=!1)=>{const i=e.displayedErrors.find((e=>e.id===t.id));i&&(e.selectedErrorId=t.id,this._highlight(e),await this._showErrorCard(e,i,n,s,r))},this._onEditorCardHovered=e=>{if(e){const t=this._editors.find((t=>t.card===e));this._debounceHideAllHighLightedBlock.cancelCall(),t&&t.selectedErrorId&&t?.highlighter.setCurrentHoveredBlockId(t.selectedErrorId)}},this._checkExtensionRuntimeHealth=()=>{l.EnvironmentAdapter.isRuntimeConnected()||this._handleUnhealthyExtensionRuntime()},this._handleUnhealthyExtensionRuntime=()=>{this._options.onUnhealthyExtensionRuntimeDetected&&this._options.onUnhealthyExtensionRuntimeDetected()||(this._isConnected=!1,this._hideAllEditorCards(),this._editors.forEach((e=>{e.highlighter&&e.highlighter.destroy(),e.lollipop&&(e.lollipop.destroy(),e.lollipop=null),this._recommendationController.cancelAnyDeferredTimerPipeline({editor:e}),this._updateState(e)})),clearInterval(this._checkExtensionRuntimeHealthIntervalId))},this._onPageLoaded=()=>{this._pageInfo=this._getPageInfo();let e=!0,t="",n=!0;if(this._tweaks.isSupported(this._pageInfo))if(this._storageController.isDomainSupported((0,v.getCurrentDomain)())){const e=this._getCheckSettings();n=!e.isDomainDisabled&&!e.isEditorGroupDisabled}else e=!1,t=c.i18nManager.getMessage("siteCannotBeSupported");else e=!1,t=this._tweaks.unsupportedMessage();const s=matchMedia("(prefers-color-scheme: dark)").matches;l.EnvironmentAdapter.pageLoaded(n,e,this._tweaks.isBeta(),t,s)},this._onPageHide=()=>{this._editors.forEach((e=>{this._savePremiumErrorCount(e)}))},this._onVisiblityChange=()=>{this._editors.forEach((e=>{"hidden"===document.visibilityState&&e.userActivity?.send()}))},this._isFocusOnAnyValidEditor=e=>{if(!e.parentElement)return;let t=!1;const n=this._tweaks.getInitElements(e);for(const e of n)if(this._tweaks.isElementCompatible(e)){t=!0;break}t&&this._options.onValidEditorFocus&&this._options.onValidEditorFocus()},this._onDocumentFocus=async e=>{if(this._options.ignoreFocus)return;const t=(0,_.getEventTarget)(e);if(!t)return;this._isFocusOnAnyValidEditor(t),t instanceof HTMLElement?this._initElement(t,!0):e.target===document&&document.body&&(0,_.hasFirefoxDesignMode)(document.body)&&this._initElement(document.body,!0);const n=this._initElementTimeouts.get(t);if(n)try{await n.promise}catch{}const s=this._editors.find((e=>e.inputArea===t));this._options.onDocumentFocus&&this._options.onDocumentFocus(e,s);for(const e of this._editors)e.inputAreaTweaks.shouldHideErrorCard(e,s,t)&&e.card?.destroy()},this._onDocumentMousemove=e=>{const t=this._editors.find((e=>e.isUserTyping)),n=this._editors.find((t=>t.inputAreaTweaks.isHoverOnInputArea(e)));if(t&&this._endTypingModeAndUpdateState(t),n&&this._isInteractionModeRewrite(n)&&!1===i.BrowserDetector.isTouchDevice()&&n.hoverDebounce.call(n,{x:e.clientX,y:e.clientY}),!n){const e=this._editors.find((e=>!!e.card));e&&(this._debounceHideAllHighLightedBlock.call(e,"click"),e?.highlighter.setCurrentHoveredBlockId(null))}},this._onDocumentMouseleave=e=>{this._editors.filter((e=>Array.isArray(e.lineHighlights))).forEach((e=>this._removeSentenceHighlights(e,"hover")))},this._onDocumentFocusout=e=>{const t=this._editors.find((e=>e.isUserTyping));t&&this._endTypingModeAndUpdateState(t)},this._onDocumentKeyup=e=>
444{if(["Meta","Ctrl","Alt"].includes(e.key)||(e.ctrlKey||e.metaKey)&&!["v","x"].includes(e.key))return;const t=this._editors.find((({inputArea:t})=>e.target instanceof Node&&t.contains(e.target)));t&&(this._isInteractionModeCorrection(t)||(l.EnvironmentAdapter.abortPhraseRequests("rewrite"),this._removeSentenceHighlights(this._clearRewritingData(t))))},this._onDocumentClick=e=>{if(this._tweaks.isClickEventIgnored(e))return;const t=e.target,n=this._editors.find((t=>t.inputAreaTweaks.isClickOnInputArea(e)));this._options.onDocumentClick&&this._options.onDocumentClick(e,n);const r=!(!t||!(0,_.closestElement)(t,b.default.CONTAINER_ELEMENT_NAME)),o=!!(t&&e.view&&(0,s.elementContains)(e.view.document,t))&&!r,a=!!n&&(0,_.isValidCardInteractionType)(n?.card,"click",this._options.highlightInteraction);if(a||n||!o||this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),n?.card&&!a)return;if(o){const e=this._editors.some((e=>"toolbox"===e.card?.mode));this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),e&&(n?.card?.id?this._trackSampledToolboxEvent(n.card.id,{name:"toolbox:closeOnOutsideClick",data:""}):this._trackSampledLollipopEvent("toolbox:closeOnOutsideClick"))}const l=!(!t||!(0,_.closestElement)(t,`${A.Dialog.CONTAINER_ELEMENT_NAME}, ${L.Toolbar.CONTAINER_ELEMENT_NAME}`));let c=!l;{const e=n?.dialog&&this._options.dialog?.showOnEditorInteraction,r=n?.inputArea&&t&&(0,s.elementContains)(n.inputArea,t);e&&r&&(c=!1)}if(c&&this._hideAllDialogs(),!(!t||!(0,_.closestElement)(t,`${E.MessagePopup.CONTAINER_ELEMENT_NAME}`))||this._hideAllMessagePopups(),!l&&!r&&(this._editors.filter((e=>{const t=!0!==e.card?.isDetached,n="click"===this._options.highlightInteraction?.correct||"click"===this._options.highlightInteraction?.recommendation||this._options.highlightInteraction?.recommendation.includes("click");return t&&n})).forEach((e=>this._unselectError(e))),n)){if(this._updateState(n),!n.lineHighlights.some((e=>"LINE_HIGHLIGHT_SENTENCE_FROM_HOVER"===e.id))&&!1===i.BrowserDetector.isTouchDevice())return n.lineHighlights=[],void this._highlight(n,!0);this._isInteractionModeRewrite(n)&&this._highlightSentenceFromClick(n)}},this._onCompositionStart=e=>{const t=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));"toolbox"===t?.card?.mode&&(this._isComposingCharacter=!0)},this._onCompositionEnd=()=>{this._isComposingCharacter=!1},this._onInputBlur=e=>{if(!e.detail)return;const{inputAreaWrapper:t}=e.detail,n=this._editors.find((e=>e.inputAreaWrapper===t));n&&(this._cancelScheduledPasteHandler(n),clearTimeout(n.lollipopDilateScheduleTimeoutId),n.lollipopDilateScheduleTimeoutId=void 0)},this._onInputClick=e=>{if(!e.detail)return;const{inputAreaWrapper:t}=e.detail,n=this._editors.find((e=>e.inputAreaWrapper===t));n&&(this._cancelScheduledPasteHandler(n),this._scheduleLollipopDilate(n))},this._onInputKeyDown=e=>{if(!e.detail)return;const{inputAreaWrapper:t,eventDetails:n}=e.detail,s=this._editors.find((e=>e.inputAreaWrapper===t));s&&(this._scheduleLollipopDilateOnKeyDown(s,n),this._cancelScheduledPasteHandler(s),this._closeToolboxOnKeydown(e.detail,s))},this._scheduleLollipopDilateOnKeyDown=(e,t)=>{t.ctrlKey||t.metaKey||t.altKey||["Backspace","Delete","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)&&this._scheduleLollipopDilate(e)},this._onRephrasingIconClick=e=>{const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));if(!t)return;if(["paraphrase","toolbox"].includes(String(t.card?.mode)))return void m.TrackerAdapter.trackEvent("Action","rephrasing_icon:unnecessary_click");const n=t.inputAreaWrapper.getSelectionWithFallback()||{start:0},s=(0,_.optionallySanitizeDanglingSelection)(t.inputAreaWrapper.getText(),t.currentSentenceRanges,n,!0);let r="sentence";if(("toolbar"===this._options.highlightInteraction?.rephrase||this._options.highlightInteraction?.rephrase.includes("toolbar"))&&(this._options.isPhraseSelectionAllowed?.(t)??1)&&s&&0!==s?.start&&0!==s?.end&&s?.start!==s?.end){if((0,v.getWordContext)(t.inputAreaWrapper.getText(),s.start,s.end))r="word";else if(this._options.phrasalParaphraseEnabled&&!(0,_.isMultiSentenceSelected)(t.currentSentenceRanges,s)){const e=(0,v.getPhrasalContext)(t.inputAreaWrapper.getText(),s.start,s.end,t.currentSentenceRanges);r=Boolean(e?.phrase?.trim())?"phrase":r}t.card&&(t.card.currentTextHighlightType=r)}const i=t.inputAreaWrapper.getSelectionWithFallback();let o;if(o="phrase"===r||"word"===r?s:(0,v.getSentenceRangeBySelection)(t.currentSentenceRanges,s),N.AdvancedToolboxAdapter.isUsedForRephrasing()&&(o??(o={start:Math.max(i?.start??0,0)})),!o){if(!I.default.get(I.ConfigKey.MULTI_SENTENCE_SELECTION_FOR_PARAPHRASE_ALLOWED))return;if(o=(0,v.getFirstSentenceRangeInSelection)(t.currentSentenceRanges,s),!o)return}m.TrackerAdapter.trackEvent("Action","toolbar:rephrase"),this._scrollToSentence(t,o,!0,r),t.dialog?.destroy()},this.getCurrentActiveEditorState=e=>{if(e||(e=this._editors.find((e=>e.id===this._userActiveEditorId))),!e)return null;const t=this._getCheckStatus(e),n=this._recommendationController.getRecommendationStatus({editor:e}),s=e.language?.code||"";let r="";return e.checkError&&(r=this._getCheckErrorMessage(e.checkError)),{checkStatus:t,recommendationStatus:n,languageCode:s,unsupportedLanguageCode:e.unsupportedLanguageCode||null,errors:e.errors,pickyErrors:e.pickyErrors,premiumErrors:e.premiumErrors,premiumPickyErrors:e.premiumPickyErrors,recommendationErrors:e.recommendationErrors,displayedErrors:e.displayedErrors,displayedPremiumErrors:e.displayedPremiumErrors,isIncompleteResult:e.isIncompleteResult,errorMessage:r,checkedText:e.checkedText,sentenceRanges:e.currentSentenceRanges,originalSentenceRanges:e.sentenceRanges,currentText:e.inputAreaWrapper.getText(),synonyms:e.synonyms,rephrasings:e.rephrasings,writingGoalId:e.writingGoalId,editorId:e.id,metaData:e.metaData,inputAreaMatchedTweaksName:e.inputAreaTweaks.name,showOptionalError:e.showOptionalError}},this._onActiveEditorIdUpdate=e=>{const t=this.getCurrentActiveEditorState(e);t&&this._options&&this._options.onCurrentActiveEditorStateUpdate&&this._options.onCurrentActiveEditorStateUpdate(t)},this._onInputDblClick=e=>{if(!e.detail)return;const{hasSynonymsEnabled:t}=this._storageController.getSettings(),{allowRemoteCheck:n}=this._storageController.getPrivacySettings();if(!t||!n||this._storageController.hasCustomServer())return;if(J.Trial.isFunctionalityLocked()&&!this._isValidatorPage())return;const s=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));if(!s)return;if(this._activeEditorId=s.id,this._isInteractionModeRewrite(s))return;const{selection:r,clickedRectangles:i}=e.detail,o=(0,v.getWordContext)(s.inputAreaWrapper.getText(),r.start,r.end)?"word":"sentence";if(s.card&&(s.card.currentTextHighlightType=o),N.AdvancedToolboxAdapter.isUsedForRephrasing())this._openToolbox(s,"dblclick");else{if("correct"===s.card?.mode)return void this._toggleCardMode({previousMode:"correct",currentMode:"paraphrase",anchorSelection:r,triggerType:"dblClick",highlightType:
444o,editor:s});if("paraphrase"===s.card?.mode)return void s.card.switchSentence(r,{highlightType:o});this._showRephraseCard(s,i,r,"dblClick",void 0,o)}},this._resetBeforeUserTextChangeActionType=({editor:e})=>{e.beforeUserTextChangeActionType=null},this._getBeforeUserTextChangeActionType=({editor:e})=>e.beforeUserTextChangeActionType?e.beforeUserTextChangeActionType:"input_change",this._getBeforeUserTextChangeActionTimestamp=({editor:e})=>"paste"===e.beforeUserTextChangeActionType?e.lastPasteActionTimestamp:e.lastInputChangeTimestamp,this._triggerCheckRequestImmediatelyOnTextChange=({editor:e})=>"paste"===this._getBeforeUserTextChangeActionType({editor:e})&&Boolean(this._options.sendCheckRequestConfig?.triggerImmediateCheckOnPaste),this._onWritingSessionCreated=e=>{if(!e.detail||!e.detail.editorId||!e.detail.sessionId)return;const t=this._editors.find((t=>t.id===e.detail.editorId));t&&(t.writingSessionId=e.detail.sessionId,this._updateState(t))},this._onInputSurroundingTextContextChanged=e=>{if(!e.detail||!e.detail.inputAreaWrapper)return;const t=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));if(!t||!t.writingSessionId)return;const n=t.writingSessionId,s=this._writingSessionMetadata.get(n),r=s?.surroundingTextContext??"",i=e.detail.changes[0].newTextContent,o=s?.lastTimestamp??null;this._dispatchUpdateSurroundingTextContext({writingSessionId:n,oldContext:r,newContext:i,lastTimestamp:o})},this._onInputTextChanged=e=>{if(!e.detail||!e.detail.inputAreaWrapper)return;const t=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));if(!t)return void this._hideAllEditorCards();if(t.lastInputChangeTimestamp=Date.now(),t.initStartTime=0,this._activeEditorId=t.id,"toolbox"===t.card?.mode&&this._isComposingCharacter)return;null===t.selectErrorAfter&&null===t.selectSentenceAfter&&requestAnimationFrame((()=>this._hideAllEditorCards({ignoreDetachedEditorCard:!0}))),t.lollipop?.resetDilate(),clearTimeout(t.lollipopDilateScheduleTimeoutId),t.lollipopDilateScheduleTimeoutId=void 0,t.isApplyingFix||this._startTypingMode(t),t.dialog&&t.dialog.setInsignificantChangeMode(!this._isSignificantTextChange(e.detail.previousText,e.detail.text));const n=(0,v.deepClone)(t.displayedErrors),s=e.detail.text,r=e.detail.previousText,i=!0;this._recommendationController.cancelAnyDeferredTimerPipeline({editor:t});const o=this._getBeforeUserTextChangeActionType({editor:t});if(this._checkEditor(t,s,i,!1)){this._endTypingMode(t);const e=t.inputAreaTweaks.getReplacedParts(s),i=(0,v.getValuableText)(s,e);this._updateDisplayedErrors(t,t.checkedText,t.errors,t.premiumErrors,t.recommendationErrors);const o=ee._getChangedParagraphs(t.checkedText.text,i.text);t.lastEditorContentSavedTimestamp>0&&t.inputAreaTweaks.isEditorTextEmpty(s)&&!t.inputAreaTweaks.isEditorTextEmpty(r)&&this._editorStateForceSync({editorId:t.id,syncFor:"content"}),this._options.incrementallyPaint&&this.incrementallyReconcileCurrentTextDiffs(t),(0,_.trackPerformanceMetrics)({type:"error_migration",editor:t,currentText:s,changedParagraphs:o,initStartTime:t.initStartTime,changeStartTime:t.lastCheckTimestamp,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:t.displayedErrors,oldDisplayedErrors:n,appliedFixId:""})}else{const e=t.inputAreaTweaks.getReplacedParts(s),i=(0,v.getValuableText)(s,e),a=I.default.get(I.ConfigKey.NORMALIZE_SPACE),l=(0,v.getParagraphsDiff)(t.checkedText.originalText,s,a);this._options.incrementallyPaint&&this.incrementallyReconcileCurrentTextDiffs(t);const c=C.ErrorProcessor.migrateOffsetsBetweenTexts(t.errors,l,!1,t.isApplyingFix),d=C.ErrorProcessor.migrateOffsetsBetweenTexts(t.premiumErrors,t.checkedText.originalText,s);let h=[];if(this.isOverlappingErrorsEnabled()){const e=t.isApplyingFixAll?void 0:t.appliedChange;h=e&&!e?.isRecommendation&&"REPHRASING"!==e?.ruleId?this._recommendationController.onTextChangePipeline({editor:t,currentText:s,previousText:r,preserveAllErrors:!0})?.migratedRecommendationErrors:this._recommendationController.onTextChangePipeline({editor:t,currentText:s,previousText:r,preserveAllErrors:!1})?.migratedRecommendationErrors}else h=this._recommendationController.onTextChangePipeline({editor:t,currentText:s,previousText:r,preserveAllErrors:!1})?.migratedRecommendationErrors;const u=ee._getChangedParagraphs(t.checkedText.text,i.text);this._updateDisplayedErrors(t,i,c,d,h);const g=t.isApplyingFixAll?void 0:t.appliedChange;(0,_.trackPerformanceMetrics)({type:g?"error_fixed":"error_migration",editor:t,currentText:s,changedParagraphs:u,initStartTime:t.initStartTime,changeStartTime:t.lastCheckTimestamp,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:t.displayedErrors,oldDisplayedErrors:n,appliedFixId:g?.errorId??""}),t.currentSentenceRanges=C.ErrorProcessor.migrateOffsetsBetweenTexts(t.sentenceRanges||[],t.sentenceRangesCheckedText.originalText,s),t.isSentenceRangesChecking=!0,(0,_.trackUserTextChangeMetrics)({triggeredBy:o,triggeredAt:this._getBeforeUserTextChangeActionTimestamp({editor:t}),triggerToProcessDelay:t.lastInputChangeTimestamp-this._getBeforeUserTextChangeActionTimestamp({editor:t}),previousText:r,currentText:s});const m=this._triggerCheckRequestImmediatelyOnTextChange({editor:t});if(g){const{start:e,end:n,replacementText:r,textBeforeCorrection:i=t.checkedText.originalText}=g;(0,_.isFixAppliedToText)(s,i,r,e,n)?(delete g.textBeforeCorrection,t.appliedChange=void 0,t.checkDebounce.call(t,s,g)):t.checkDebounce.call(t,s)}else t.isApplyingFixAll||(t.checkDebounce.call(t,s),m&&t.checkDebounce.callImmediately())}this._options.typingSpeedConfig?.enabled&&t.typingSpeedController.onChange({previousText:r,currentText:s,currentTime:Date.now(),endBurst:"paste"===o||
444!!t.appliedChange,endBurstReason:"paste"===o?"content pasted":t.appliedChange?"change applied":void 0}),this._resetBeforeUserTextChangeActionType({editor:t}),t.lineHighlights=[],t.rephrasings.state=null,t.rephrasings.source=null,t.rephrasings.selection={},t.synonyms.state=null,t.synonyms.source=null,t.synonyms.selection={},this._highlight(t),this._updateState(t),this._isConnected&&t.userActivity?.detectNewText(s)},this._onSentenceWritten=e=>{if(!e.detail)return;const{inputAreaWrapper:t,isWordCompleted:n}=e.detail,s=this._editors.find((e=>e.inputAreaWrapper===t));s?.userActivity?.incrementSentenceWritten(n)},this._onWordWritten=e=>{if(!e.detail)return;const{inputAreaWrapper:t}=e.detail,n=this._editors.find((e=>e.inputAreaWrapper===t));n?.userActivity?.incrementWordWritten()},this._onInputPaste=e=>{if(!e.detail)return;const{inputAreaWrapper:t,isSignificantTextChange:n,pastedData:s}=e.detail;this._hideAllEditorCards({ignoreDetachedEditorCard:!n});const r=this._editors.find((e=>e.inputAreaWrapper===t));r&&(this._activeEditorId=r.id,r.dialog&&r.dialog.setInsignificantChangeMode(!n),s&&s.length?(r.beforeUserTextChangeActionType="paste",r.lastPasteActionTimestamp=Date.now(),this._pasteHandlerAfterTimeout(r,s)):(r.beforeUserTextChangeActionType=null,r.lastPasteActionTimestamp=0,(0,_.trackHealthMetric)("empty_content_pasted",5e3)))},this._pasteHandlerAfterTimeout=(e,t)=>{this._toolboxAdoptionExperimentVersion()&&(clearTimeout(e.lollipopDilateScheduleTimeoutId),e.lollipopDilateScheduleTimeoutId=void 0,e.pasteHandlerTimeoutId=self.setTimeout((()=>{const n=e.inputAreaWrapper.getSelection();!n||n.start<1||(this._options.zenMode||e.lollipop?.dilate("paste_event",!0),e.pastedTextOffset={length:t.length,start:n.start-t.length,end:n.end})}),100))},this._cancelScheduledPasteHandler=e=>{clearTimeout(e.pasteHandlerTimeoutId),e.pasteHandlerTimeoutId=void 0,e.pastedTextOffset=void 0},this._onInputScroll=e=>{if(!e.detail)return;const t=e.detail.inputAreaWrapper;requestAnimationFrame((()=>{const e=this._editors.find((e=>t===e.inputAreaWrapper));e&&e.card&&(!e.inputAreaWrapper.isScrollingProgrammatically()&&!e.card.isScrollingProgrammatically()||e.card.shouldCloseOnProgrammaticScroll())&&(this._updateCardPositionOnScroll(e)||this._hideAllEditorCards({ignoreDetachedEditorCard:!0}))}))},this._onKeyboardShortcut=e=>{if(!e.detail)return;const t=this._editors.find((t=>t.inputAreaWrapper===e.detail.inputAreaWrapper));if(!t)return;this._activeEditorId=t.id;const n=t.inputAreaWrapper.getSelection();if(!n)return;if(I.default.get(I.ConfigKey.KEYBOARD_SHORTCUT_ONLY_OPENS_TOOLBOX))return void this._openToolbox(t,"keyboard");const s=t.displayedErrors.find((e=>e.start<=n.start&&n.start<=e.end));if(s){if(s.id===t.selectedErrorId)return;const e=t.highlighter.getTextBoxes(s.id);if(e.length)if(this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),t.selectedErrorId=s.id,this._highlight(t,!0),t.card){const n=t.inputAreaTweaks.canCorrectMultipleErrorsAtOnce(t)&&(0,_.containsSimilarErrors)(t.displayedErrors,s);t.card.switchError({error:s,displayedErrors:t.displayedErrors,canCorrectMultipleAtOnce:n},e[0])}else this._showErrorCard(t,s,e[0],"dblPress",!0)}else{if(this._storageController.hasCustomServer())return;if(N.AdvancedToolboxAdapter.isUsedForRephrasing())return void this._openToolbox(t,"keyboard");const e=(0,v.getWordContext)(t.inputAreaWrapper.getText(),n.start);if(e){const s=[t.card?.getSelection("word")?.start].filter(v.isNumber),r=[t.card?.getSelection("word")?.end].filter(v.isNumber);if(s.includes(e.position.start)&&r.includes(e.position.end))return;this._hideAllEditorCards({ignoreDetachedEditorCard:!0});const i=e.position.start,o=e.position.end-i,a=t.inputAreaWrapper.getTextBoxes(i,o);t.card?t.card.switchSentence(n):this._showRephraseCard(t,a,n,"dblPress",!0,"word")}}},this._onHiglighterBlockClicked=e=>{if(!this._editors.length)return;if(!e.detail||b.default.BLOCK_ID===e.detail.blockId)return void e.preventDefault();const t=this._editors.find((t=>t.highlighter===e.detail.highlighter));if(!t)return e.preventDefault(),this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),void this._hideAllDialogs();const n=t.displayedErrors.find((t=>t.id===e.detail.blockId))||t.displayedPremiumErrors.find((t=>t.id===e.detail.blockId));this._activeEditorId=t.id,this._userActiveEditorId!==t.id&&(this._userActiveEditorId=t.id,this._onActiveEditorIdUpdate(t));let s=!1;if(this._options.onErrorClicked&&n&&(s=this._options.onErrorClicked?.(n,e.detail.highlightedBlock)),s)return;let r=!0;if(this._options.dialog?.showOnEditorInteraction&&t?.dialog&&(r=!1),(0,_.isValidErrorInteractionType)(n,"click",this._options.highlightInteraction)){if
444(this._debounceShowErrorCard.cancelCall(),this._debounceHideAllHighLightedBlock.cancelCall(),this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),r&&this._hideAllDialogs(),this._isInteractionModeRewrite(t)&&!0!==t.card?.isDetached)return;if(!n)return void e.preventDefault();if(t.temporaryDisabledErrorId===n.id&&"click"===t.temporaryDisabledErrorTriggerType)return void e.preventDefault();if(!l.EnvironmentAdapter.isRuntimeConnected())return void e.preventDefault();if((0,_.getSelectedText)().trim())return void e.preventDefault();t.selectedErrorId=n.id;let s=!1;if(t.callbacks.onErrorClick&&(s=t.callbacks.onErrorClick(n)),!s)if(t.card){const s=this._getErrorCardData(t,n);"correct"===t.card.mode?t.card.switchError({displayedErrors:t.displayedErrors,canCorrectMultipleAtOnce:s.canCorrectMultipleAtOnce,error:n},e.detail.clickedBox):(t.card.setErrorCardArguments(s),t.card.changeMode("correct",e.detail.clickedBox))}else this._showErrorCard(t,n,e.detail.clickedBox,"click");this._highlight(t)}else t.selectedErrorId!==n?.id&&this._hideAllEditorCards({ignoreDetachedEditorCard:!0})},this._isHoverCardOpen=e=>{if("paraphrase"===e?.card?.mode)return!1;if("toolbox"===e.card?.mode)return!1;if(e?.card?.forceCardOpen)return!1;if(!this._editors.length)return!1;const t=e.displayedErrors.find((t=>t.id===e.selectedErrorId)),n=(0,_.isValidCardInteractionType)(e?.card,"click",this._options.highlightInteraction);return!t||!n},this._hideAllHighLightedBlock=(e,t)=>{this._hideAllEditorCards({ignoreDetachedEditorCard:!0,ignoreEditorCardInteractionType:t}),this._debounceShowErrorCard.cancelCall(),this._unselectError(e)},this._debounceShowErrorCard=new y.Debounce(this._showAndHighlightErrorCard,_.defaultHighlightInteractionConfig.mouseInCardOpenDelay),this._debounceHideAllHighLightedBlock=new y.Debounce(this._hideAllHighLightedBlock,_.defaultHighlightInteractionConfig.mouseOutCardCloseDelay),this._onHighighterMouseOut=e=>{e.card?this._debounceHideAllHighLightedBlock.call(e,"click"):this._unselectError(e),this._debounceShowErrorCard.cancelCall()},this.shouldShowErrorCardOnHover=(e,t)=>!(!t||!(0,_.isValidErrorInteractionType)(t,"hover",this._options.highlightInteraction))||e.selectedErrorId!==t.id,this._onHiglighterBlockMouseMove=e=>{const t=this._editors.find((t=>t.highlighter===e.detail.highlighter));if(!t)return void e.preventDefault();if(this._activeEditorId=t.id,e.detail&&b.default.BLOCK_ID!==e.detail.blockId||e.preventDefault(),e.detail.mouseOut&&!e.detail.mouseIn)return this._onHighighterMouseOut(t),void(this._options.onErrorHovered&&this._options.onErrorHovered(null));const n=t.isApplyingFix;if(this._isHoverCardOpen(t)&&!n){const n=e?.detail?.blockId,s=this.isOverlappingErrorsEnabled()&&n?ee.ERROR_BLOCK_ID_REGEX.test(n)?n:"":n;let r;if(s&&(r=t.displayedErrors.find((e=>e.id===s))||t.displayedPremiumErrors.find((e=>e.id===s))),r&&this.shouldShowErrorCardOnHover(t,r)){if(!l.EnvironmentAdapter.isRuntimeConnected())return void e.preventDefault();if(this._debounceHideAllHighLightedBlock.call(t),this._debounceHideAllHighLightedBlock.callImmediately(),this._options.onErrorHovered&&this._options.onErrorHovered(r,e.detail.highlightedBlock))return;return t.selectedErrorId=r.id,t.lollipop?.disableProximityHandlerForAShortMoment(!0),t.lollipop?.disableHoverForAShortMoment(),this._debounceShowErrorCard.call(t,r,e.detail.hoveredBox,"hover"),void this._highlight(t)}}else t?.highlighter.setCurrentHoveredBlockId(null);e.preventDefault()},this._onActiveElementUpdate=e=>{const t=this._editors.find((t=>t.inputArea===e));t&&this._userActiveEditorId!==t.id&&(this._userActiveEditorId=t.id,this._onActiveEditorIdUpdate(t))},this._onToolbarPermissionRequiredIconClicked=e=>{const t=this._storageController.getPrivacySettings(),n=this._storageController.getStatistics().appliedSuggestions>0;I.default.get(I.ConfigKey.TERMS_OF_SERVICE_MODAL_ENABLED)&&t.acceptedTermsOfServiceVersion!==T.CURRENT_TERMS_OF_SERVICE_VERSION&&n?(F.TermsOfService.showModal(e.detail.toolbar.getContainer()),m.TrackerAdapter.trackEvent("Action","toolbar:show_tos_modal")):(l.EnvironmentAdapter.openWindow(T.INSTALL_URL+"?v="+l.EnvironmentAdapter.getVersion()),m.TrackerAdapter.trackEvent("Action","toolbar:open_install_url"))},this._onToolbarVisibilityChange=e=>{if((0,v.isUndefined)(e.detail)||(0,v.isUndefined)(e.detail.toolbar)||!(0,v.isBoolean)(e.detail.visiblity))return;const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));t?.dialog&&t.dialog.changeVisiblity(e.detail.visiblity)},this._onToolbarToggleDialog=e=>{if(!e.detail)return;const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));if(!t)return;let n=t.checkStatus;n===x.CHECK_STATUS.COMPLETED&&t.displayedErrors.length>0?n="HAS_ERRORS":n===x.CHECK_STATUS.COMPLETED&&t.premiumErrors.length>0&&(n="HAS_ONLY_PREMIUM_ERRORS"),m.TrackerAdapter.trackEvent("Action","dialog:opened",n);const s=!t.dialog;this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),this._hideAllDialogs(!0),s&&this._showDialog(t)}
444,this._onTurnOffClickedDialog=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&this._turnOffEditor(t)},this._onTurnOffClickedToolbar=e=>{const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));t&&this._turnOffEditor(t)},this._onPauseCheckingClickedDialog=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&this._pauseEditor(t)},this._onPauseCheckingClickedToolbar=e=>{const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));t&&this._pauseEditor(t)},this._onTurnOnClicked=e=>{this._onTurnOnClickedImpl(e)},this._onTurnOnClickedImpl=e=>{const t=(0,v.getMainPageDomain)(),n=this._tweaks.getEditorGroupId((0,v.getCurrentUrl)());this._storageController.enableDomainAndEditorGroup(t,n),l.EnvironmentAdapter.ltAssistantStatusChanged({enabled:!0});const s=(0,_.getActiveElement)();s instanceof HTMLElement&&this._initElement(s,!0),m.TrackerAdapter.trackEvent("Action","check_trigger:turn_on")},this._onLollipopTurnOffClicked=()=>{if(this._options.undoNotificationDisabled)return;const e=(0,_.getTopMostDocumentObject)();(0,_.wait)(500).then((()=>f.UndoNotification.create({language:N.AdvancedToolboxAdapter.getUiLanguage(),parentElement:e.body,label:c.i18nManager.getMessage("notificationLollipopUndoLabel"),description:c.i18nManager.getMessage("notificationLollipopUndoDescription"),lifetime:4e3,undo:()=>{m.TrackerAdapter.trackEvent("Lollipop","enable_lollipop:undo"),this._storageController.updateSettings({hasLollipopEnabled:!0})}}).show()))},this._onGoogleEditorContextMenuItemClicked=async()=>{await Promise.all([this._loadLollipopStyles(),(0,_.wait)(100)]);for(const e of this._editors)if(e.inputAreaWrapper.getSelection(!0)){this._openToolbox(e,"contextmenu");break}},this._onPositionChangeClicked=e=>{if("coordinates"===e.detail.newPosition){h.LocalStorageWrapper.set("dialog:position",e.detail.newPosition);const t=A.Dialog.getValidatedCoordinates(e.detail.coordinates);t&&h.LocalStorageWrapper.set("dialog:coordinates",{top:t.top||"",bottom:t.bottom||"",left:t.left||"",right:t.right||""})}else this._storageController.updateUIState({dialogPosition:e.detail.newPosition})},this._onDialogEnableHere=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&(this._enableEditor(t),m.TrackerAdapter.trackEvent("Action","check_trigger:manually_triggered"))},this._onPickyModeToggle=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&this._togglePickyMode(t,e.detail.isEnabled)},this._onDialogEnableEverywhere=e=>{this._storageController.updateSettings({autoCheck:!0,ignoreCheckOnDomains:[]}),m.TrackerAdapter.trackEvent("Action","enable_everywhere")},this.dialogLanguageChanged=e=>{const t=this._editors.find((e=>e.id===this._userActiveEditorId));t&&this._setLanguage(t,e)},this._onDialogLanguageChanged=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&this._setLanguage(t,e.detail.language)},this._onToolbarLanguageChanged=e=>{const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));t&&this._setLanguage(t,e.detail.language)},this._onDialogCountChanged=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));if(t&&t.dialog){t.countMode=e.detail.countMode,this._storageController.updateUIState({countMode:e.detail.countMode});const n=this._getCountOptions(t);t.dialog.updateCounter(n)}},this._onErrorCardLanguageChanged=e=>{const t=this._editors.find((t=>t.card===e.detail.card));t&&(this._setLanguage(t,e.detail.language),m.TrackerAdapter.trackEvent("Action","check_trigger:switch_language_variant"))},this._onErrorCardPickyModeTurnedOff=e=>{const t=this._editors.find((t=>t.card===e.detail.card));t&&(this._togglePickyMode(t,!1),t.card?.isDetached&&(t.selectErrorAfter=e.detail.selection.start))},this._onDialogErrorHighlighted=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));if(!t)return;const n=t.displayedErrors.find((t=>t.id===e.detail.errorId));n&&(t.selectedErrorId=n.id,this._highlight(t))},this._onDialogErrorSelected=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));if(!t||this._isInteractionModeRewrite(t))return;const n=t.displayedErrors.find((t=>t.id===e.detail.errorId));n&&this._scrollToError(t,n,"auto",!0)},this._onAddToDictionary=e=>{const{error:t,selectNextError:n}=e.detail;let s;if("dialog"in e.detail){const t=e.detail.dialog;s=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;s=this._editors.find((e=>e.card===t))}this._addToDictionaryBase(s,t,n)},this._onIgnoreRule=e=>{const{error:t,selectNextError:n}=e.detail;let s;if("dialog"in e.detail){const t=e.detail.dialog;s=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;s=this._editors.find((e=>e.card===t))}const r="card"in e.detail;this._ignoreRule(s,t,n,r)},this._onTemporarilyIgnoreWord=e=>{const{error:t,selectNextError:n}=e.detail;let s;if("dialog"in e.detail){const t=e.detail.dialog;s=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;s=this._editors.find((e=>e.card===t))}this._temporarilyIgnoreWordBase(s,t,n)},this._onTemporarilyIgnoreRule=e=>{const{error:t,selectNextError:n}=e.detail;let s;if("dialog"in e.detail){const t=e.detail.dialog;s=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;s=this._editors.find((e=>e.card===t))}const r="card"in e.detail;this._onTemporarilyIgnoreRuleBase(s,t,n,r)},this._onMoreDetailsClicked=e=>{let t;if("dialog"in e.detail){const{dialog:n}=e.detail;t=this._editors.find((e=>e.dialog===n))}else if("card"in e.detail){const{card:n}=e.detail;t=this._editors.find((e=>e.card===n))}t&&(l.EnvironmentAdapter.openWindow(e.detail.url),m.TrackerAdapter.trackEvent("Action","show_rule_details",e.detail.url))},this._onFixSelected=e=>{if(!e.detail)return void this._hideAllEditorCards();const{error:t,selectNextError:n,fixIndex:s}=e.detail;let r;if("dialog"in e.detail){const t=e.detail.dialog;r=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;r=this._editors.find((e=>e.card===t))}const i="card"in e.detail;this._fixSelectedError(r,t,s,n,i)},this._onToolbarFixAllErrors=async e=>{const t=this._editors.find((t=>t.toolbar===e.detail.toolbar));t&&await this._fixAllErrors(t)},this.fixAllErrors=async e=>{(e=e??this._editors.find((e=>e.id===this._userActiveEditorId)))&&await this._fixAllErrors(e)},this._onDialogOpenOptions=e=>{l.EnvironmentAdapter.openOptionsPage(e.detail.target,e.detail.ref)},this._onDialogShowFeedbackForm=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));if(!t)return;const n=t.inputArea.cloneNode(!1);try{n.innerText=`${t.inputAreaWrapper.getText().length} chars, ${t.language?t.language.code:"unknown lang"}`}catch(e){}l.EnvironmentAdapter.openFeedbackForm((0,v.getCurrentUrl)(),"",n.outerHTML||"")},this._onDialogDestroyed=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));t&&(t.dialog=null,null===t.card&&this._unselectError(t))},this._onBadgeClicked=()=>{this._hideAllEditorCards();let e=!1;this._options.onPremiumTeaserClick&&(e=this._options.onPremiumTeaserClick()),e||l.EnvironmentAdapter.openOptionsPage(void 0,"editorcard"),m.TrackerAdapter.trackEvent("Action","check_trigger:badge:clicked",String(`premium:${this._storageController.isPremium()}`))},this._onDialogPremiumTeaserClicked=e=>{const t=this._editors.find((t=>t.dialog===e.detail.dialog));if(!t)return;let n=!1;this._options.onPremiumTeaserClick&&(n=this._options.onPremiumTeaserClick()),n||this._openPremiumPage(t,e.detail.campaign)},this._onErrorCardPremiumTeaserClicked=e=>{if(!e.detail)return;const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;let n=!1;this._options.onPremiumTeaserClick&&(n=this._options.onPremiumTeaserClick()),n||!e.detail.campaign.includes("trial")?n||this._openPremiumPage(t,e.detail.campaign):l.EnvironmentAdapter.openOptionsPage(void 0,"error-card-trial-running")},this._onToggleCardMode=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;const{selection:n,textHighlightType:s,currentMode:r,previousMode:i,toolboxTriggerType:o}=e.detail;m.TrackerAdapter.trackEvent("Action","toggle_card_mode",r),this._toggleCardMode({editor:t,currentMode:r,previousMode:i,anchorSelection:n,highlightType:s,toolboxTriggerType:o})},this._onEditorCardPremiumClick=e=>{const{subject:t,isCardDetached:n}=e.detail;this._hideAllEditorCards({ignoreDetachedEditorCard:n});let s=`https://languagetool.org/?utm_campaign=addon2-editor-card-${t}`;i.BrowserDetector.isSafari()&&(s+="&hidePremium=true"),l.EnvironmentAdapter.openWindow(s),m.TrackerAdapter.trackEvent("Action",`check_trigger:${t}:clicked`,String(`premium:${this._storageController.isPremium()}`))},this._onMessagePopupDestroyed=e=>{const t=this._messages.indexOf(e.detail.message);-1!==t&&this._messages.splice(t,1)},this._onCorrectAll=e=>{let t,n=!1;if("dialog"in e.detail){const n=e.detail.dialog;t=this._editors.find((e=>e.dialog===n))}else if("card"in e.detail){const s=e.detail.card;n=e.detail.selectNextError,t=this._editors.find((e=>e.card===s))}if(this._hideAllEditorCards({ignoreDetachedEditorCard:n}),!t)return;const{config:s,selectedError:r}=e.detail,i=t.displayedErrors.filter((e=>e.rule.id===s.ruleId&&e.fixes.some((e=>s.suggestion.match.test(e.value))))),o=i.indexOf(r);t.selectErrorAfter=n?r.start:null;let a=0;const l=i.slice(o).concat(i.slice(0,o)).map(((e,t,n)=>{t===n.length-o&&(a=0);const r=e.fixes.find((e=>s.suggestion.match.test(e.value)));if(!r)return e;const i=r.value.length-e.originalPhrase.length,l=e.start+a,c=l+e.length;return a+=i,{...e,start:l,end:c}}));this._correctMultipleErrors(t,l,s),m.TrackerAdapter.trackEvent("Action","apply_multiple_at_once",s.ruleId)},this._onSynonymSelected=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(this._hideAllEditorCards({ignoreDetachedEditorCard:t?.card?.isDetached}),!t)return;const{word:n,synonym:s,selection:r,selectSynonymReplacement:i}=e.detail;this._applySynonym(t,{source:n,replacement:s,selection:r}),i&&(t.selectSynonymReplacement=r.start+s.length-1)},this._onPhraseSelected=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;const{selection:n,phrase:s,selectSentenceAfter:r,language:i,selectNextSentence:o=!1}=e.detail,a=t.inputAreaWrapper.getText().slice(n.start,n.end);t.selectSentenceAfter=r?n.start:null,t.selectSentenceAfter=o?n.end+(s.length-a.length):t.selectSentenceAfter,this._applyRephrasing(t,{source:a,replacement:s,selection:n},{label:e.detail.label??"unknown",reverted:e.detail.reverted,selectSentenceAfter:r,language:i}),r||this._displayUndoNotification({editor:t,selection:n,sentence:s,initialText:a,trackingAction:"rephrasesV3"})},this._onSplitSentenceSelected=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;const{sentence:n,error:s,language:r}=e.detail,i={start:s.start,end:s.end},o=t.checkedText.text.slice(i.start,i.end),a=0===this._getEditorGroup(t.groupId).flatMap((({dis
444playedErrors:e})=>e)).filter((({id:e})=>e!==s.id)).length;t.selectErrorAfter=e.detail.selectNextError?s.start:null,(null===t.selectErrorAfter||a)&&t.card?.switchError({displayedErrors:t.displayedErrors}),this._applySentenceSuggestion(t,{source:o,replacement:n,selection:i},{label:e.detail.label??"unknown",reverted:e.detail.reverted,language:r},s,"sentence-splitting"),this._displayUndoNotification({editor:t,selection:i,sentence:n,initialText:o,trackingAction:"sentence-splitting"})},this._onFixSentenceSelected=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;const{sentence:n,start:s,end:r,language:i,includedErrors:o,selectedErrorId:a}=e.detail,l={start:s,end:r},c=t.checkedText.text.slice(s,r),d=[...o].map((({id:e})=>String(e))),[h]=d.reverse(),u=this._getEditorGroup(t.groupId).flatMap((({displayedErrors:e})=>e)),g=u.filter((({id:e})=>!1===d.includes(String(e)))),m=u.find((({id:e})=>h===e)),p=u.find((({id:e})=>a===e));if(!p||!m)return;const _=0===g.length;t.selectErrorAfter=e.detail.selectNextError?m.start:null,(null===t.selectErrorAfter||_)&&t.card?.switchError({displayedErrors:t.displayedErrors}),this._applySentenceSuggestion(t,{source:c,replacement:n,selection:l},{label:"fix-sentence",reverted:!1,language:i},p,"fix-sentence"),this._displayUndoNotification({trackingAction:"fix-sentence",editor:t,selection:l,sentence:n,initialText:c})},this._onFixSentenceShowHighlight=e=>{const t=this._editors.find((t=>t.card===e.detail.card));t&&this._highlight(t,!0,e.detail.includedErrorIds)},this._onFixSentenceRemoveHighlight=e=>{const t=this._editors.find((t=>t.card===e.detail.card));t&&this._highlight(t,!0)},this._onEditorCardDestroyed=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;const n=t.card?.getTriggerType();t.retrieveLanguageAbortController?.abort("card has been closed"),t.retrieveLanguageAbortController=null,t.card=null,t.dialog?.fadeIn(),t.lollipop?.unfreezeClickState(),t.lollipop?.enableProximityHandler(),this._removeLollipopTextHighlight(t),this._updateState(t),!0===e.detail.shouldUpdateHighlight&&this._highlight(t),t.selectedErrorId===e.detail.error?.id&&(t.temporaryDisabledErrorId=t.selectedErrorId,t.temporaryDisabledErrorTriggerType=n||null,setTimeout((()=>{t.temporaryDisabledErrorId=null,t.temporaryDisabledErrorTriggerType=null}),500),this._unselectError(t))},this._onSettingsChanged=e=>{if(e.dictionary)for(const e of this._editors){const t=(0,v.deepClone)(e.displayedErrors);this._rerenderHighlightForEditor(e),(0,_.trackPerformanceMetrics)({type:"add_to_personal_dictionary",editor:e,currentText:e.checkedText.text,changedParagraphs:[],initStartTime:e.initStartTime,changeStartTime:e.lastCheckTimestamp,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:e.displayedErrors,oldDisplayedErrors:t})}if(e.ignoredRules)for(const e of this._editors){const t=(0,v.deepClone)(e.displayedErrors);this._rerenderHighlightForEditor(e),(0,_.trackPerformanceMetrics)({type:"ignore_rules",editor:e,currentText:e.checkedText.text,changedParagraphs:[],initStartTime:e.initStartTime,changeStartTime:e.lastCheckTimestamp,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:e.displayedErrors,oldDisplayedErrors:t})}if(e.hasPickyModeEnabledGlobally&&this._editors.forEach((e=>{this._resetEditor(e),this._endTypingMode(e),this._checkEditor(e),this._highlight(e),this._setCheckLevel(e,this._storageController.getSettings().hasPickyModeEnabledGlobally?"picky":"hidden-picky"),this._updateState(e)})),e.autoCheck||e.autoCheckOnDomains||e.disabledDomains||e.ignoreCheckOnDomains||e.disabledEditorGroups){const e=this._getCheckSettings();e.isDomainDisabled||e.isEditorGroupDisabled?(Array.from(this._editors).forEach((e=>this._destroyEditor(e))),this._stopCheckingForUninitializedInputAreas()):e.isAutoCheckEnabled?(this._editors.filter((e=>!e.isAutoCheckEnabled)).forEach((e=>this._enableEditor(e))),this._checkForUninitializedInputAreas()):e.isAutoCheckEnabled||(this._hideAllDialogs(),this._editors.forEach((e=>this._disableEditor(e))))}if(e.disableRecommendationOnDomains){const e=this._getCheckSettings();this._editors.filter((t=>t.isRecommendationsDisabled!==e.isRecommendationsDisabled)).forEac
444h((t=>{t.isRecommendationsDisabled=e.isRecommendationsDisabled,this._resetEditor(t),this._endTypingMode(t),this._checkEditor(t),this._highlight(t),this._updateState(t)}))}e.hasLollipopEnabled&&(e.hasLollipopEnabled.newValue?this._editors.forEach((e=>{e.lollipop||this._initLollipop(e)})):this._editors.forEach((e=>{e.lollipop&&(e.lollipop.destroy(),e.lollipop=null)}))),e.openCardHotkey&&this._editors.forEach((t=>t.inputAreaWrapper.setKeyboardShortcut(e.openCardHotkey.newValue||null)))},this._onPrivacySettingsChanged=e=>{this._options.onPrivacySettingsChanged&&this._options.onPrivacySettingsChanged(e)||e.allowRemoteCheck&&e.allowRemoteCheck.newValue&&(this._isRemoteCheckAllowed=!0,this._editors.forEach((e=>{this._checkEditor(e),this._updateState(e)})))},this.toggleEditors=(e,t=this._editors)=>{this._isRemoteCheckAllowed=this._storageController.getPrivacySettings().allowRemoteCheck,t.forEach((t=>{e?this._enableEditor(t):this._disableEditor(t)}))},this._onUiStateChanged=e=>{(e.hasPaidSubscription||e.trialStartedAt)&&(this._editors.forEach((e=>{this._resetEditor(e),this._updateMaxTextLength(e),this._checkEditor(e),this._highlight(e),this._updateState(e)})),this._storageController.isPremium()?this._storageController.grantUnlimitedRephrasings():this._storageController.restrictRephrasings())},this._onEditorCardHighlight=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t)return;"sentence"!==t.card?.currentTextHighlightType||t.card?.getSelection("sentence")||t.card?.updateSelection(t.inputAreaWrapper.getSelection()),this._highlight(t);const n=e.detail.updateCardPosition??"full";if("none"!==n){const e=(0,_.getBoundingBox)(t.highlighter.getTextBoxes(b.default.BLOCK_ID));t.card?.updateTargetBox(e,n)}},this._onNavigateError=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t?.card)return;const{direction:n,selection:s}=e.detail,r=t.displayedErrors.find((e=>e.start===s.start&&s.end===e.end));if(!r)return;let i=null;switch(n){case"previous":i=this._getErrorBefore(t,r?.start);break;case"next":i=this._getErrorAfter(t,r?.start);break;default:throw new Error(`Unknown card navigation direction "${n}"`)}i&&this._scrollToError(t,i,"smart",!0)},this._onNavigateSentence=e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t?.card)return;const{direction:n,selection:s}=e.detail,r=this._getNeighborSentence(t,s,n);r?(t.inputAreaWrapper.setSelection({start:r.end}),this._scrollToSentence(t,r)):"toolbox"===t.card?.mode&&(t.card.destroy(),t.card=null)},this._editorStateSyncAck=e=>{const t=this._editors.find((t=>t.id===e.editorId));t&&"content"===e.ackFor&&(t.lastEditorContentSavedText=e.savedText,t.lastEditorContentSavedTimestamp=e.ackTimestamp)},this._editorStateForceSync=async e=>{const t=this._editors.find((t=>t.id===e.editorId));if(t)try{if("content"===e.syncFor){const n=new z.ChangesController,s=t.inputAreaWrapper.getText(),r=[n.createInsertionOperation(0,s,t.lastEditorContentSavedTimestamp)],i=await l.EnvironmentAdapter.forceSyncEditorState({syncFor:e.syncFor,editorId:t.id,saveOperations:r,writingSessionId:t.writingSessionId});if(!i.isSuccessful)return;if("content"===i.ackFor){const e={savedText:s,ackFor:"content",ackTimestamp:i.ackTimestamp,editorId:i.editorId};this._editorStateSyncAck(e)}}}catch(e){console.error("Error in force sync editor state",e)}},this._onEditorSurroundingContextForceSync=e=>{const{writingSessionId:t}=e.detail,n=this._editors.find((e=>e.writingSessionId===t));if(!n||!t)return;if(!this._writingSessionMetadata.get(t))return;const{inputAreaTweaks:s,inputArea:r}=n;s.getSurroundingContext(r).then((e=>{const n=this._writingSessionMetadata.get(t),s=n?.surroundingTextContext??"",r=n?.lastTimestamp??null;this._dispatchUpdateSurroundingTextContext({writingSessionId:t,oldContext:s,newContext:e,lastTimestamp:r,isForceSync:!0})}))},this._onEditorStateSyncAck=e=>{e.detail&&e.detail.editorId&&this._editorStateSyncAck(e.detail)},this._onEditorStateForceSync=async e=>{e.detail&&e.detail.editorId&&await this._editorStateForceSync(e.detail)},this.underLineOnOptionalError=(e,t)=>{const n=t?.toolbar,s=n&&this._editors.find((e=>e.toolbar===n));s?s.showOptionalError!==e&&(s.showOptionalError=e,this._highlight(s),this._updateState(s)):this._editors.forEac
444h((t=>{t.showOptionalError!==e&&(t.showOptionalError=e,this._highlight(t),this._updateState(t))}))},this._onUnlockSuggestion=async e=>{const{error:t,onUnlockComplete:n}=e.detail;let s;if("dialog"in e.detail){const t=e.detail.dialog;s=this._editors.find((e=>e.dialog===t))}else if("card"in e.detail){const t=e.detail.card;s=this._editors.find((e=>e.card===t))}if(s&&t?.id)return this._unlockSuggestionBase(t,s,n)},this._unlockSuggestionBase=(e,t,n)=>this._recommendationController.unlockSuggestion(e,t).then((e=>n?.(e||!1))).catch((e=>n?.(e))).finally((()=>this._updateState(t))),this._onApplyToolboxResult=async e=>{const t=this._editors.find((t=>t.card===e.detail.card));if(!t?.card)return;const n=t.card.id,{plugin:s,skill:r,selection:i,subject:o,locale:a}=e.detail.result,{start:l,end:c,value:h}=i,u=Object.keys(o).some((e=>e.startsWith("image/"))),g=o["text/plain"],p=o["text/html"],_=r.startsWith(s)?r:[s,r].join("#"),E=l===c;if(t.card.isGoingToNextSentence()?(t.selectSentenceAfter=i.end+(g.length-h.length),await t.card.setToolboxResultApplying(),t.lollipop?.stopBlinking()):this._hideAllEditorCards(),await N.AdvancedToolboxAdapter.preApplyToolboxResult(e.detail.result),u)t.appliedChange={originalText:"",replacementText:"",start:l,end:c,ruleCategory:{id:"toolboxImage",name:"toolboxImage"},ruleId:"TOOLBOXIMAGE",isRecommendation:!1},await t.inputAreaWrapper.insertImage(o),t.appliedChange=void 0,m.TrackerAdapter.trackToolboxEvent(n,{name:"insert_image",data:s});else if(E)t.appliedChange={originalText:"",replacementText:g,start:l,end:c,ruleCategory:{id:"toolboxText",name:"toolboxText"},ruleId:"TOOLBOXTEXT",isRecommendation:!1},await t.inputAreaWrapper.insertText({html:p,text:g}),t.appliedChange=void 0,m.TrackerAdapter.trackToolboxEvent(n,{name:"insert_text",data:s});else{if(m.TrackerAdapter.trackToolboxEvent(n,{name:"replace_text",data:s}),s===B.ToolboxPluginParaphraser.ID&&(t.appliedChange={originalText:h,replacementText:g,start:l,end:c,ruleCategory:{id:"phrasing",name:"phrasing"},ruleId:"REPHRASING",isRecommendation:!1},r.includes("/sentence")?m.TrackerAdapter.trackEvent("Action","rephrasesV3:selected","toolbox"):r.includes("/word")&&m.TrackerAdapter.trackEvent("Action","synonyms:applied",a?d.LanguageManager.getPrimaryLanguageCode(a):"unknown")),await t.inputAreaTweaks.replaceText({offset:l,length:c-l,replacementText:g,editor:t}),s===B.ToolboxPluginParaphraser.ID){t.checkDebounce.callImmediately(),t.userActivity?.incrementRewritingsApplied(),this._flashHighlight({editor:t,color:T.COLORS.NEW_SENTENCE.BACKGROUND,duration:1500,offset:l,length:g.length}),this._displayUndoNotification({trackingAction:"rephrasesV3",editor:t,selection:i,sentence:g,initialText:h});const e=_.split("/").pop()?.includes("phrase")?"rephrasesV3":"fix-sentence";this._displayUndoNotification({trackingAction:e,editor:t,selection:i,sentence:g,initialText:h})}t.appliedChange=void 0}m.TrackerAdapter.trackToolboxEvent(n,{name:"apply_toolbox_result",data:_})},this._getNeighborSentence=(e,t,n)=>{let s;switch(n){case"previous":s=this._getSentenceBefore(e,t);break;case"next":s=this._getSentenceAfter(e,t);break;default:throw new Error(`Unknown card navigation direction "${n}"`)}return s},this._onDestroy=e=>{const t=(0,_.optionalEventDetail)(e)?.type;t?t===l.EnvironmentAdapter.getType()&&this.destroy():this.destroy()},this._displayUndoNotification=e=>{if(this._options.undoNotificationDisabled)return;const{editor:t,selection:n,sentence:s,initialText:r,trackingAction:i}=e,o=(0,_.getTopMostDocumentObject)();(0,_.wait)(500).then((()=>f.UndoNotification.create({language:t.language?.code??"en",parentElement:o.body,label:c.i18nManager.getMessage("notificationUndoLabel"),description:c.i18nManager.getMessage("notificationUndoDescription"),lifetime:4e3,undo:()=>{t.inputAreaTweaks.replaceText({offset:n.start,length:s.length,replacementText:r,editor:t}),m.TrackerAdapter.trackEvent("Action",`${i}:undo`,d.LanguageManager.getPrimaryLanguageCode(t.language?t.language.code:"unknown"))}}).show()))},this._onLollipopMouseEnter=(e,t)=>{this._trackSampledLollipopEvent("hover",e),this._toolboxAdoptionExperimentVersion()&&t.pastedTextOffset&&this._showLollipopTextHighlight(t,{offset:t.pastedTextOffset.start,length:t.pastedTextOffset.length})},this._onLollipopMouseLeave=e=>{this._toolboxAdoptionExperimentVersion()&&"toolbox"!==e.card?.mode&&this._removeLollipopTextHighlight(e)},this._onLollipopSelectionEnd=(e,t)=>{"b"===this._toolboxAdoptionExperimentVersion()&&("dblclick"===t&&this._storageController.getSettings().hasSynonymsEnabled||this._openToolbox(e,"automatic",void 0,!0))},this._onLollipopMouseDilate=e=>{this._trackSampledLollipopEvent("dilation",e)},this._showLollipopTextHighlight=(e,t)=>
444{const{offset:n,length:s}=t;e.lollipopTextHighlight={id:"LOLLIPOP_TEXT_HIGHLIGHT",offset:n,length:s,isEmphasized:!0,isUnderlined:!1,highlightStylingType:O.HighlightStylingType.selection_lollipop_text},this._highlight(e,!0)},this._removeLollipopTextHighlight=e=>{e.lollipopTextHighlight&&(e.lollipopTextHighlight=void 0,this._highlight(e))},this._onLollipopClick=async(e,t)=>{const n=e.inputAreaWrapper.getSelection(!0);if(!n)return void m.TrackerAdapter.trackEvent("Lollipop","open_toolbox:no_selection_found",document.domain);let s="text_selected";const r=n.start===n.end,i=0===e.inputAreaWrapper.getText().trim().length;e.lollipop?.isPulsating?s="pulsating":i?s="text_empty":r&&(s="collapsed"),m.TrackerAdapter.trackEvent("Lollipop","click",s),this._openToolbox(e,t,e.pastedTextOffset,!0)},this.toggleDialog=(e,t=!0)=>{const n=this._editors.find((e=>e.id===this._userActiveEditorId));t&&this._hideAllEditorCards({ignoreDetachedEditorCard:!0}),e?n&&this._showDialog(n):this._hideAllDialogs(!0)},!document.documentElement||"HTML"!==document.documentElement.nodeName)return;this._options=Object.assign({},e),this._options.sendCheckRequestConfig={delay:T.CHECK_DELAY,maxDelay:T.CHECK_MAX_DELAY,triggerImmediateCheckOnPaste:T.IMMEDIATE_CHECK_ON_PASTE_ACTION,...this._options.sendCheckRequestConfig},this._options.sendCheckRecommendationRequestConfig={delay:T.CHECK_RECOMMENDATION_DELAY,...this._options.recommendationBehaviourConfig},this._options.recommendationBehaviourConfig={isContextualHighlightDisabled:!1,...this._options.recommendationBehaviourConfig},this._options.writingContextConfig={enabled:!1,...this._options.writingContextConfig},this._options.overlappingErrorsConfig={enabled:!1,...this._options.overlappingErrorsConfig},this._options.highlightInteraction={..._.defaultHighlightInteractionConfig,...this._options.highlightInteraction},this._debounceShowErrorCard=new y.Debounce(this._showAndHighlightErrorCard,this._options.highlightInteraction.mouseInCardOpenDelay),this._debounceHideAllHighLightedBlock=new y.Debounce(this._hideAllHighLightedBlock,this._options.highlightInteraction.mouseOutCardCloseDelay),"string"==typeof this._options.localeCode&&c.i18nManager.setLocale(this._options.localeCode),document.addEventListener(ee.events.DESTROY,this._onDestroy),l.EnvironmentAdapter.injectExecutor().catch((()=>null)),this._tweaks=t,this._tweaks.init(),this._tweaks.onActiveElementUpdate?.(this._onActiveElementUpdate),this._temporaryDisabledEditorGroups=[],this._isConnected=!0,this._pageInfo=this._getPageInfo(),this._storageController=u.StorageControllerFactory.create(),this._storageController.onReady(this._init),a.Dictionary.init(this._storageController,this._options.dictionary),Z.default.init(this._storageController);const n={handleUnhealthyExtensionRuntime:this._handleUnhealthyExtensionRuntime,updateDisplayedErrors:this._updateDisplayedErrors,updateState:this._updateState,highlight:this._highlight,mergeAndMigrateErrors:this.mergeAndMigrateErrors,rerenderHighlightForEditor:this._rerenderHighlightForEditor.bind(this),overlappingErrorsConfig:this._options.overlappingErrorsConfig};this._recommendationController=new H.RecommendationController(n,{...this._options.sendCheckRecommendationRequestConfig,...this._options.recommendationBehaviourConfig}),R.InputAreaWrapper.setIsWritingContextEnabled(this._isWritingContextEnabled())}_getPageInfo(){return{url:document.location.href,title:document.title,favIconUrl:document.querySelector("link[rel='icon']")?.getAttribute("href")??"/favicon.ico"}}_loadLollipopStyles(){if(this._areLollipopStylesLoaded)return Promise.resolve();const e=l.EnvironmentAdapter.loadStylesheets(self,[I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).LOLLIPOP_CSS_PATH]);return this._areLollipopStylesLoaded=!0,e}_hasLollipopEnabled(){return this._storageController.getSettings().hasLollipopEnabled&&this._storageController.getPrivacySettings().allowRemoteCheck&&!J.Trial.isFunctionalityLocked()&&"extension"===l.EnvironmentAdapter.getType()&&N.AdvancedToolboxAdapter.canSeeLollipop(this._storageController)}_preloadImages(){const e=document.createElement("lt-preload-images");e.setAttribute("contenteditable","false"),document.documentElement.appendChild(e),self.getComputedStyle(e).position,e.remove()}_pingBackround(){l.EnvironmentAdapter.ping().then((()=>m.TrackerAdapter.trackEvent("Stat","background_ping","success"))).catch((e=>m.TrackerAdapter.trackEvent("Stat","background_ping","error:"+e.toString())))}_isSignificantTextChange(e,t){return Math.abs(t.length-e.length)>200}_getCheckSettings(){const e=(0,v.getMainPageDomain)();return this._storageController.getCheckSettings(e,this._tweaks.getEditorGroupId((0,v.getCurrentUrl)()))}_getEditorGroup(e){return this._editors.filter((t=>t.groupId===e))}async _fixIframeWithoutStylesheets(){if(!document.activeElement||"IFRAME"!==document.activeElement.nodeName)return;const e=document.activeElement.contentWindow;let t=!1;try{t=!!e.location.href}catch(e){}t&&"complete"===e.document.readyState&&e.document.documentElement&&(e.__ltCssLoaded||((0,_.areCssContentScriptsLoadedIntoWindow)(e)?e.__ltCssLoaded=!0:e.document.body&&(e.__ltCssLoaded=!0,l.EnvironmentAdapter.loadContentScripts(e,"css"))))}
444_initElement(e,t=!1){if(!e.parentElement)return;if(I.default.get(I.ConfigKey.DISABLE_WHEN_QB_EXTENSION_IS_PRESENT)&&document.querySelector(T.QB_EXTENSION_DETECTION_SELECTOR)&&this._storageController.getStatistics().hasInstalledQBExtension)return;let n=!0;const s=this._storageController.getManagedSettings(),r=(0,_.filterURLs)(s.allowedURLs),i=(0,v.getCurrentUrl)(),o=this._tweaks.getInitElements(e);for(const s of o){if(this._editors.some((({inputArea:e})=>e===s))){const e=this._editors.find((({inputArea:e})=>e===s));this._activeEditorId=e?.id||null;continue}if(!this._tweaks.isElementCompatible(s))continue;if(r.length&&!(0,v.isDomainInList)(r,i)){n=!1;continue}const o=this._tweaks.getEditorGroupId(i);if(this._temporaryDisabledEditorGroups.includes(o))continue;const a=this._getCheckSettings();if(a.isDomainDisabled||a.isEditorGroupDisabled)continue;let c=null;if("extension"===l.EnvironmentAdapter.getType()&&(c=(0,_.getShadowRoot)(e))&&!(0,_.areCssContentScriptsLoadedIntoShadowRoot)(c)&&(0,_.injectShadowStyles)(c),this._initElementTimeouts.has(s)){const{id:e,reject:t}=this._initElementTimeouts.get(s);clearTimeout(e),t()}a.isAutoCheckEnabled&&this._disableOtherSpellCheckers(s);const d=(0,_.createPromise)(),h=(e=!1)=>{s.removeEventListener("blur",u);const{id:t,reject:n,resolve:r}=this._initElementTimeouts.get(s)||{};clearTimeout(t),e?n?.():r?.(),this._initElementTimeouts.delete(s)},u=()=>{h(!0),this._enableOtherSpellCheckers(s)};s.addEventListener("blur",u),this._initElementTimeouts.set(s,{...d,id:self.setTimeout((()=>{h(),!t||this._tweaks.hasFocus(s)?this.initElement(s):this._enableOtherSpellCheckers(s)}),150)})}n||l.EnvironmentAdapter.ltAssistantStatusChanged({enabled:!1})}incrementallyReconcileCurrentTextDiffs(e){const t=e.inputAreaWrapper.getText(),n=e.inputAreaTweaks.getReplacedParts(t),s=(0,v.getValuableText)(t,n),r=I.default.get(I.ConfigKey.NORMALIZE_SPACE),i=(0,v.getParagraphsDiff)(e.checkedText.text??"",s.text,r);e.textCollection.updateText(s);const o=X.DiffUtil.groupParagraphsByOperation(i.filter((e=>!(""===e.oldText&&""===e.newText||null===e.oldText&&""===e.newText))));e.textCollection.addDiffs(o)}initElement(e,t){const n=(0,_.isValidRootElement)(e)?e:null;if(!n)throw new Error("Failed to initialize LTAssistent; given element is not a valid DOM element.");if(this._editors.some((e=>e.inputArea===n)))throw"LanguageTool is already initialized on this element.";if(!this._storageController.isReady())throw"LTAssistant is not ready initialized yet.";"extension"===l.EnvironmentAdapter.getType()&&this._preloadImages();const s=(0,v.getCurrentUrl)(),i=String(t&&t.id||this._tweaks.getEditorId(n,s)),o=this._tweaks.getEditorGroupId(s),a=p.TweaksManager.getInputAreaTweaks(s,n),c=l.EnvironmentAdapter.canUseShadowDom(),u=a.getMirror(c),g=t?.maxTextLength||a.getMaxTextLength(this._storageController),m=this._storageController.getSettings().openCardHotkey,E=a.getInputAreaWrapper(u,{maxTextLength:g,keyboardShortcut:m}),f=u?u.getCloneElement():null,C=new w.Highlighter(n,E,f||n,!!u,a.getHighlighterTweaks(f||n,!!u),this._tweaks.getClickEvent(),c,this._options.highlightInteraction,(0,_.shouldUseCSSCustomHighlightsApi)());let S=null;"false"!==n.getAttribute("data-lt-toolbar")&&(S=new L.Toolbar({inputArea:n,inputAreaMatchedTweaksName:a.name,appearence:a.getToolbarAppearance(),mirror:u,enableRephrasing:this._storageController.hasRephrasingEnabled(),shouldOpenToolbox:N.AdvancedToolboxAdapter.isUsedForRephrasing()})),a.init();let b={words:t&&t.dictionary||[],rules:t&&t.ignoredRules||[]};this._tweaks.persistTemporarySettings()&&(b=h.LocalStorageWrapper.get(`ignored:${o}`)||b);let A=this._storageController.getSettings().hasPickyModeEnabledGlobally?"picky":"hidden-picky";const k=this._getCheckSettings().isRecommendationsDisabled;this._tweaks.persistTemporarySettings()&&(A=h.LocalStorageWrapper.get(`checkLevel:${o}`)||A);let R=null,I=!1;if(this._tweaks.persistTemporarySettings()){const e=h.LocalStorageWrapper.get(`forcedLanguage:${i}`);if(e){const t=d.LanguageManager.SUPPORTED_LANGUAGES.find((t=>t.code===e));t&&(R=t,I=!0)}}const O=(t&&t.language||"").toLowerCase(),{username:D,token:H}=this._storageController.getSettings(),{hasStatisticsCollectionEnabled:U}=this._storageController.getPrivacySettings(),F=U&&this._isConnected&&this._storageController.hasLanguageToolAccount()?new M.UserActivityMonitor(D,H,R,t?.writingGoalId||null,t?.checkLevel||A,E.getText()):null,B=(0,v.getDefaultTextSubset)(),G={id:i,groupId:o,checkLevel:t&&t.checkLevel||A,showPickyAsHiddenMatch:t&&t.showPickyAsHiddenMatch||!1,inputArea:n,inputAreaTweaks:a,countMode:this._storageController.getUIState().countMode,mirror:u,inputAreaWrapper:E,highlighter:C,toolbar:S,unsupportedLanguageCode:null,card:null,dialog:null,ignoredRules:b.rules||[],ignoredWords:b.
444words||[],checkDebounce:new y.Debounce(this._sendCheckRequest,this._options.sendCheckRequestConfig?.delay,this._options.sendCheckRequestConfig?.maxDelay),selectionChangeDebounce:new y.Debounce(this.editorSelectionChanged,100),checkStatus:x.CHECK_STATUS.COMPLETED,recommendationStatus:x.CHECK_STATUS.COMPLETED,deferredRecommendationPipelineTimerId:null,language:R,forceLanguage:I,userActivity:F,isLanguageSupported:!0,isAutoCheckEnabled:this._getCheckSettings().isAutoCheckEnabled,isRecommendationsDisabled:k,isUserTyping:!1,isChecking:!1,isApplyingFix:!1,isTextTooShort:!1,isTextTooLong:!1,needsLanguageHintFromUser:!1,checkError:null,lastCheckTimestamp:0,lastSentenceRangesCheckTimestamp:0,lastDefaultRecommendationPipelineCheckTimestamp:0,lastForcedRecommendationPipelineCheckTimestamp:0,checkedText:B,recommendationCheckedText:B,sentenceRangesCheckedText:B,initStartTime:Date.now(),isIncompleteResult:!1,errors:[],recommendationErrors:[],checkedTextErrors:[],checkedRecommendationTextErrors:[],checkedTextSentenceRanges:void 0,pickyErrors:[],premiumErrors:[],premiumPickyErrors:[],pendingErrors:[],displayedErrors:[],displayedPremiumErrors:[],displayedHiddenErrorCount:0,selectedErrorId:null,selectErrorAfter:null,selectSentenceAfter:null,selectSynonymReplacement:null,temporaryDisabledErrorId:null,temporaryDisabledErrorTriggerType:null,typingTimeoutId:void 0,maxTextLength:g,sentenceRanges:void 0,currentSentenceRanges:void 0,writingGoalId:t?.writingGoalId||this._pageLevelWritingGoalId||null,simplifyRephrasingDiff:!0===t?.simplifyRephrasingDiff,callbacks:{onDictionaryAdd:t&&t.onDictionaryAdd,onRuleIgnore:t&&t.onRuleIgnore,onTemporaryIgnore:t&&t.onTemporaryIgnore,onUpdate:t&&t.onUpdate,onErrorClick:t&&t.onErrorClick,onBeforeErrorCorrect:t&&t.onBeforeErrorCorrect,onBeforeRephrasingApply:t&&t.onBeforeRephrasingApply},tracking:{hasTracked:!1,hasEnoughText:!1,languageCode:null},hoverDebounce:new y.Debounce(this._highlightSentenceFromHover.bind(this),T.HOVER_DELAY,T.HOVER_MAX_DELAY),interactionMode:"correction",synonyms:{state:null,source:null,result:r.Synonyms.emptySynonymResult,selection:{}},rephrasings:{state:null,result:[],source:null,selection:{}},lineHighlights:[],isRewriteModeDisabled:!1,isCorrectingMultiple:!1,isVisiblyErrorFree:null,lollipop:null,appliedChange:void 0,checkRequestController:new P.RequestAbortController,recommendationRequestAbortController:new P.RequestAbortController,isApplyingFixAll:!1,selectedText:"",initOptions:t,isSentenceRangesChecking:!1,lastPasteActionTimestamp:0,pastedTextOffset:void 0,beforeUserTextChangeActionType:null,lastInputChangeTimestamp:0,typingSpeedController:new j.TypingSpeedController({...this._options.typingSpeedConfig||{}}),lastEditorContentSavedText:"",lastEditorContentSavedTimestamp:0,showOptionalError:this._options.showOptionalError??!1,textCollection:new q.TextCollection({paragraphs:q.Collection.from([]),sentences:q.Collection.from([])}),lollipopDilateScheduleTimeoutId:void 0,pasteHandlerTimeoutId:void 0,hideUnderlines:!1};if(O){const e=d.LanguageManager.SUPPORTED_LANGUAGES.find((e=>e.code===O));e&&(G.language=e,G.forceLanguage=!0)}return this._activeEditorId=i,this._userActiveEditorId=this._userActiveEditorId?this._userActiveEditorId:i,this._initLollipop(G),this._options.incrementallyPaint&&this.incrementallyReconcileCurrentTextDiffs(G),this._editors.push(G),this._storageController.getPrivacySettings().hasMLDataCollectionEnabled&&this._initWritingSession(G,s),this._checkEditor(G),this._updateState(G),this._options.onEditorIntialized?.(G),a.onDestroy((()=>this._destroyEditor(G)),"extension"===l.EnvironmentAdapter.getType()?this._tweaks.isElementCompatible:()=>!0),{addWord:e=>this._temporarilyIgnoreWord(G,e),addToDictionary:e=>this._addToDictionary(G,e),ignoreRule:e=>this._temporarilyIgnoreRule(G,e),clearIgnoredRules:()=>this._clearTemporarilyIgnoredRules(G),clearWords:()=>this._clearWords(G),getText:()=>G.inputAreaWrapper.getText(),getLanguage:()=>G.language,setLanguage:e=>this._setLanguage(G,e.toLowerCase()),setCheckLevel:e=>this._setCheckLevel(G,e),getCheckLevel:()=>G.checkLevel,getElement:()=>G.inputArea,getDisplayedErrors:()=>G.displayedErrors,getDisplayedPremiumErrors:()=>G.premiumErrors,getStatus:()=>G.checkStatus,getRecommendationStatus:()=>G.recommendationStatus,getSelection:()=>G.inputAreaWrapper.getSelection(),setSelection:e=>G.inputAreaWrapper.setSelection(e),highlightPreviousSentence:e=>this._highlightNeighborSentence(G,"previous",e),highlightNextSentence:e=>this._highlightNeighborSentence(G,"next",e),getTextBoxes:e=>G.highlighter.getTextBoxes(e.id),applyFix:(e,t)=>this._applyFix(G,e,t),scrollToError:(e,t=!1,n="nearest",s,r)=>this._scrollToError(G,e,n,t,s,r),setInteractionMode:e=>this._setInteractionMode(G,e),getInteractionMode:()=>G.interactionMode,applySynonym:e=>this._applySynonym(G,e),applyRephrasing:(e,t)=>
444this._applyRephrasing(G,e,t),disableRewriteMode:()=>this._disableRewriteMode(G),enableRewriteMode:()=>this._enableRewriteMode(G),getRemainingRephrasings:()=>this._getRemainingRephrasings(),updateWritingGoalId:e=>this._setWritingGoalId(G,e),removeWritingGoalId:()=>this._setWritingGoalId(G),unlockSuggestion:(e,t)=>this._unlockSuggestionBase(e,G,t),destroy:()=>this._destroyEditor(G)}}_isWritingContextEnabled(){return!!this._options.writingContextConfig?.enabled}isOverlappingErrorsEnabled(){return!!this._options.overlappingErrorsConfig?.enabled}_initWritingSession(e,t=(0,v.getCurrentUrl)()){if(!this._isWritingContextEnabled())return;const{id:n,inputAreaTweaks:s,inputArea:r}=e;s.initWritingSession(n,t).then((e=>{e&&s.getSurroundingContext(r).then((t=>{const n=this._writingSessionMetadata.get(e),s=n?.surroundingTextContext??"",r=n?.lastTimestamp??null;this._dispatchUpdateSurroundingTextContext({writingSessionId:e,oldContext:s,newContext:t,lastTimestamp:r})}))})).catch((e=>{console.error("Failed to initialize writing session",e)}))}getEditorMode(){const e=this._editors.find((e=>e.id===this._activeEditorId));if(!e)return null;e.inputAreaWrapper.getMode()}highlightError(e,t=[],n=this._userActiveEditorId){const s=this._editors.find((e=>e.id===n));s&&(s.selectedErrorId=e,this._highlight(s,!1,t))}highlightSuggestion(e,t){return(0,_.highlightChangesInPhrase)(e,t)}updateLanguageOptions(e){if(Array.isArray(e.preferredVariants)){const t={};for(const n of e.preferredVariants){const e=d.LanguageManager.getPrimaryLanguageCode(n);"en"===e?t.enVariant=n:"de"===e?t.deVariant=n:"pt"===e?t.ptVariant=n:"ca"===e&&(t.caVariant=n)}this._storageController.updateSettings(t)}e.motherTongue&&this._storageController.updateSettings({motherTongue:e.motherTongue}),e.preferredLanguages&&this._storageController.updateSettings({geoIpLanguages:e.preferredLanguages,preferredLanguages:e.preferredLanguages})}updateUser(e){this._storageController.updateSettings({username:e.email,token:e.token,apiServerUrl:e.apiServerUrl||T.PREMIUM_SERVER_URL}),"premium"in e?e.premium?(this._storageController.enablePaidSubscription(),this._storageController.grantUnlimitedRephrasings()):(this._storageController.disablePaidSubscription(),this._storageController.restrictRephrasings()):"standalone"===l.EnvironmentAdapter.getType()&&this._storageController.checkForPaidSubscription()}setLocale(e){c.i18nManager.setLocale(e)}_setInteractionMode(e,t){e.interactionMode!==t&&(e.interactionMode=t,e.lineHighlights=[],"rewrite"===e.interactionMode?(document.addEventListener("mouseleave",this._onDocumentMouseleave,!0),document.addEventListener(U.ShadowDomEventsPropagator.eventNames.mouseleave,this._onDocumentMouseleave,!0)):(document.removeEventListener("mouseleave",this._onDocumentMouseleave,!0),document.removeEventListener(U.ShadowDomEventsPropagator.eventNames.mouseleave,this._onDocumentMouseleave,!0)),this._highlight(e,!0),this._clearRewritingData(e))}_isInteractionModeCorrection(e){return"correction"===e.interactionMode}_isInteractionModeRewrite(e){return"rewrite"===e.interactionMode}_disableRewriteMode(e){e.isRewriteModeDisabled=!0,this._removeSentenceHighlights(e)}_enableRewriteMode(e){!0===e.isRewriteModeDisabled&&(e.isRewriteModeDisabled=!1,e.rephrasings={state:null,result:[],source:null,selection:{}},this._highlightSentenceFromClick(e))}_disableOtherSpellCheckers(e){if(!this._tweaks.shouldDisableOtherSpellCheckers(e))return;if(this._spellcheckingAttributesData.get(e))return;const t={spellcheck:e.getAttribute("spellcheck"),"data-gramm":e.getAttribute("data-gramm")},n="lt-"+Math.round(999999*Math.random());e.setAttribute(ee.TMP_ID_ATTRIBUTE_NAME,String(n)),e.setAttribute("spellcheck","false"),e.setAttribute("data-gramm","false");let s=0;const r=new MutationObserver((()=>{if("false"!==e.getAttribute("spellcheck")||"false"!==e.getAttribute("data-gramm")){if(++s>2)return;e.setAttribute("spellcheck","false"),e.setAttribute("data-gramm","false")}}));r.observe(e,{attributes:!0,attributeFilter:["spellcheck","data-gramm"]}),this._spellcheckingAttributesData.set(e,{originalValues:t,mutationObserver:r})}
444_enableOtherSpellCheckers(e){const t=this._spellcheckingAttributesData.get(e);if(!t)return;t.mutationObserver.disconnect();const n=e.getAttribute(ee.TMP_ID_ATTRIBUTE_NAME),s=Array.from(e.ownerDocument.querySelectorAll(`[${ee.TMP_ID_ATTRIBUTE_NAME}="${n}"]`));s.includes(e)||s.push(e);for(const e in t.originalValues){const n=t.originalValues[e];t.originalValues[e]?s.forEach((t=>{t.setAttribute(e,n)})):s.forEach((t=>{t.removeAttribute(e)}))}s.forEach((e=>{e.removeAttribute(ee.TMP_ID_ATTRIBUTE_NAME)})),this._spellcheckingAttributesData.delete(e)}_getCheckStatus(e){let t=x.CHECK_STATUS.COMPLETED;return this._isConnected?this._isRemoteCheckAllowed?J.Trial.isFunctionalityLocked()&&!this._isValidatorPage()?t=x.CHECK_STATUS.TRIAL_ENDED:e.isAutoCheckEnabled?e.isUserTyping||e.isChecking?t=x.CHECK_STATUS.IN_PROGRESS:e.checkError?t=x.CHECK_STATUS.FAILED:e.isTextTooShort?t=x.CHECK_STATUS.TEXT_TOO_SHORT:e.isTextTooLong?t=x.CHECK_STATUS.TEXT_TOO_LONG:e.isLanguageSupported?e.needsLanguageHintFromUser&&!e.forceLanguage&&(t=x.CHECK_STATUS.NEEDS_LANGUAGE_HINT):t=x.CHECK_STATUS.UNSUPPORTED_LANGUAGE:t=x.CHECK_STATUS.DISABLED:t=x.CHECK_STATUS.PERMISSION_REQUIRED:t=x.CHECK_STATUS.DISCONNECTED,t}_updateToolbarState(e){if(!e.toolbar)return;const t=this._getCheckStatus(e),n=t===x.CHECK_STATUS.FAILED?x.CHECK_STATUS.FAILED:this._recommendationController.getRecommendationStatus({editor:e}),s=e.language?e.language.code:"",r=e.checkError?this._getCheckErrorMessage(e.checkError):"",i=this._getFixAllErrorsMetadata(e),o=this._storageController.isPremium(),a={premiumErrorsCount:e.displayedPremiumErrors.length,isIncompleteResult:e.isIncompleteResult,showNotification:this._storageController.canStartChangelogCoupon(),text:e.inputAreaWrapper.getText(),sentenceRanges:e.currentSentenceRanges,selection:e.inputAreaWrapper.getSelection(),checkErrorMessage:r,languageCode:s,checkStatus:t,recommendationStatus:n,isPremium:o,errors:e.displayedErrors,fixAllMetadata:i,selectedText:e.selectedText,showOptionalError:e.showOptionalError,isSentenceRangesChecking:e.isSentenceRangesChecking};e.toolbar.updateState(a)}_isValidatorPage(){return location.href.includes("/validator/validator.html")}_getCheckErrorMessage(e){const t=(e.url||"<unknown>").replace(/\?.*/,"");switch(e.reason){case"ConnectionError":return c.i18nManager.getMessage("connectionProblem",t)+" (#1, code="+e.status+")";case"TimeoutError":return c.i18nManager.getMessage("connectionProblem",t)+" (#1, timeout)";case"TooManyErrors":return c.i18nManager.getMessage("tooManyErrors");case"TextTooLong":return c.i18nManager.getMessage("textTooLong");case"TooManyRequests":return c.i18nManager.getMessage("tooManyRequests");case"InvalidCredentials":return c.i18nManager.getMessage("invalidUsernameOrPassword");case"AccessDenied":return c.i18nManager.getMessage("accessDeniedError2");default:return c.i18nManager.getMessage("unknownError")+" ("+e.status+")"}}_getCountOptions(e){const t=new g.TextStatistics(e.inputAreaWrapper.getText(),e.currentSentenceRanges||[]);return{mode:e.countMode,counts:{characters:e.checkedText.originalText.length,sentences:t.countSentences(),words:t.getAllWords().length}}}_togglePickyMode(e,t){const n=t?"picky":"hidden-picky",s=e.groupId;if(this._getEditorGroup(s).forEach((e=>{this._setCheckLevel(e,n),this._updateState(e)})),this._tweaks.persistTemporarySettings()){const e=`checkLevel:${s}`;h.LocalStorageWrapper.set(e,n)}}_setLanguage(e,t){const n=e.language;let s=null;if("auto"===t)e.language=null,e.forceLanguage=!1,this._tweaks.persistTemporarySettings()&&h.LocalStorageWrapper.remove(`forcedLanguage:${e.id}`);else{if(s=d.LanguageManager.SUPPORTED_LANGUAGES.find((e=>e.code===t))||null,!s)throw new Error(`LTAssistant: Language '${t}' is not supported.`);e.language=s,e.forceLanguage=!0,this._tweaks.persistTemporarySettings()&&h.LocalStorageWrapper.set(`forcedLanguage:${e.id}`,s.code)}const{preferredLanguages:r}=this._storageController.getSettings();if(s&&"NEEDS_LANGUAGE_HINT"===e.checkStatus){const e=d.LanguageManager.getPrimaryLanguageCode(s.code);r.includes(e)||(r.push(d.LanguageManager.getPrimaryLanguageCode(s.code)),this._storageController.updateSettings({preferredLanguages:r}),m.TrackerAdapter.trackEvent("Action","dialog:set_language_from_hint",e))}s&&!r.length&&this._storageController.updateSettings({preferredLanguages:[d.LanguageManager.getPrimaryLanguageCode(s.code)]});const i=e.checkedText.text;if(this._resetEditor(e),this._endTypingMode(e),this._checkEditor(e,!1),this._highlight(e),this._updateState(e),n&&n.code){const e=n?.detectedLanguage?.source||"unknown";if(d.LanguageManager.getPrimaryLanguageCode(n.code)===d.LanguageManager.getPrimaryLanguageCode(t)?m.TrackerAdapter.trackEvent("Action","switch_language_variant",`${n.code} -> ${t}`):i.length>=2*T.SHORT_TEXT_MAX_LENGTH?m.TrackerAdapter.trackEvent("Action","switch_language:long_text:"+e,`${n.code} -> ${t}`):i.length>=T.SHORT_TEXT_MAX_LENGTH?(m.TrackerAdapter.trackEvent("Action","switch_language:medium_text:"+e,`${n.code} -> ${t}`),m.TrackerAdapter.trackSampledEvent("Debug","incorrect_lang_detect:"+e,i,5)):(m.TrackerAdapter.trackEvent("Action","switch_language:short_text:"+e,`${n.code} -> ${t}`),m.TrackerAdapter.trackSampledEvent("Debug","incorrect_lang_detect:"+e,i,5)),s&&d.LanguageManager.isLanguageVariant(n)&&d.LanguageManager.isLanguageVariant(s)){const e=d.LanguageManager.getPrimaryLanguageCode(n.code),t=d.LanguageManager.getPrimaryLanguageCode(s.code);
444if(e===t&&n.code!==s.code){const e=d.LanguageManager.formatLanguageCode(s.code);"en"===t?this._storageController.updateSettings({enVariant:e}):"de"===t?this._storageController.updateSettings({deVariant:e}):"pt"===t?this._storageController.updateSettings({ptVariant:e}):"ca"===t&&this._storageController.updateSettings({caVariant:e})}}}else m.TrackerAdapter.trackEvent("Action","switch_language",`unknown -> ${t}`)}_setCheckLevel(e,t){this._resetEditor(e),e.checkLevel=t,this._checkEditor(e),m.TrackerAdapter.trackEvent("Action","set_check_level",t)}_setWritingGoalId(e,t=null){this._resetEditor(e),e.writingGoalId=t,this._updateState(e),this._checkEditor(e)}setWritingGoalId(e=null,t=this._userActiveEditorId){const n=this._editors.find((e=>e.id===t));n&&this._setWritingGoalId(n,e)}setPageLevelWritingGoalId(e=null){this._pageLevelWritingGoalId=e,this._editors.forEach((t=>{this._setWritingGoalId(t,e)}))}_updateMaxTextLength(e){e.inputAreaWrapper.updateMaxTextLength(e.initOptions?.maxTextLength||e.inputAreaTweaks.getMaxTextLength(this._storageController))}_resetEditor(e,t={}){l.EnvironmentAdapter.abortAllRequests(e);const n=(0,v.getDefaultTextSubset)();e.isChecking=!1,e.isApplyingFix=!1,e.isApplyingFixAll=!1,e.isTextTooShort=!1,e.isTextTooLong=!1,e.checkError=null,e.lastCheckTimestamp=0,e.lastSentenceRangesCheckTimestamp=0,e.lastForcedRecommendationPipelineCheckTimestamp=0,e.lastDefaultRecommendationPipelineCheckTimestamp=0,e.checkedText=n,this._options.incrementallyPaint&&(e.textCollection.resetCollection(),this.incrementallyReconcileCurrentTextDiffs(e)),e.recommendationCheckedText=n,e.sentenceRangesCheckedText=n,e.isIncompleteResult=!1,e.errors=[],e.recommendationErrors=[],e.checkedTextErrors=[],e.checkedRecommendationTextErrors=[],e.selectedText="",e.checkedTextSentenceRanges=void 0,e.pickyErrors=[],e.premiumErrors=[],e.pendingErrors=[],e.displayedErrors=[],e.displayedPremiumErrors=[],e.selectedErrorId=null,e.selectErrorAfter=null,e.selectSentenceAfter=null,e.sentenceRanges=void 0,e.currentSentenceRanges=void 0,e.isCorrectingMultiple=!1,e.isVisiblyErrorFree=null,e.selectedText="",e.isSentenceRangesChecking=!1,e.recommendationStatus=x.CHECK_STATUS.COMPLETED,e.lastPasteActionTimestamp=0,e.pastedTextOffset=void 0,e.beforeUserTextChangeActionType=null,e.lastInputChangeTimestamp=0,e.showOptionalError=this._options.showOptionalError??!1,e.unsupportedLanguageCode=null,t.keepCard||(e.card?.destroy(),e.card=null),e.checkRequestController=new P.RequestAbortController,e.recommendationRequestAbortController=new P.RequestAbortController,e.appliedChange=void 0,this._recommendationController.cancelAnyDeferredTimerPipeline({editor:e})}_checkEditor(e,t,n,s=!0){let r;if(void 0===t&&void 0===n?(r=e.inputAreaWrapper.getText(),n=!1):"boolean"==typeof t&&void 0===n?(r=e.inputAreaWrapper.getText(),n=t):r="string"==typeof t&&"boolean"==typeof n?t:e.inputAreaWrapper.getText(),!this._isConnected)return!0;if(!this._isRemoteCheckAllowed||!e.isAutoCheckEnabled)return!0;if(J.Trial.isFunctionalityLocked()&&!this._isValidatorPage())return!0;const i=r.trim();if(i.length<T.MIN_TEXT_LENGTH||ee.NO_LETTERS_REGEXP.test(i))return e.forceLanguage||(e.language=null,e.isLanguageSupported=!0),this._resetEditor(e),e.isTextTooShort=!0,e.checkDebounce.cancelCall(),!0;let o=this._storageController.isPremium();return"boolean"==typeof this._options.checkTextUntilMaxLengthReached&&(o=this._options.checkTextUntilMaxLengthReached),e.inputAreaWrapper.isTextTooLong()&&!o?(e.forceLanguage||(e.language=null,e.isLanguageSupported=!0),this._resetEditor(e),e.isTextTooLong=!0,e.checkDebounce.cancelCall(),!0):(e.isLanguageSupported||(e.isLanguageSupported=!0,e.forceLanguage||(e.language=null)),e.isChecking=!0,e.recommendationStatus=e.isRecommendationsDisabled?x.CHECK_STATUS.DISABLED:x.CHECK_STATUS.IN_PROGRESS,e.isTextTooShort=!1,e.isTextTooLong=e.inputAreaWrapper.isTextTooLong(),s&&(e.checkDebounce.call(e,r),n||e.checkDebounce.callImmediately()),!1)}_onCheckCompleted(e,t,n,s,r){const i=this._editors.find((t=>t.id===e.instanceId));if(!i)return;if(!i.isAutoCheckEnabled)return;if(n<i.lastCheckTimestamp)return;const o=Date.now(),a=i.needsLanguageHintFromUser,l=this._storageController.isPremium();if(i.checkError=null,i.isChecking=!1,i.lastCheckTimestamp=n,e?.metaData&&(i.metaData={...i.metaData,textErrors:{...i.metaData?.textErrors||{},...e.metaData.textErrors||{}}}),e.isUnsupportedLanguage)return this._resetEditor(i,{keepCard:"toolbox"===i.card?.mode}),this._endTypingMode(i),i.language=null,i.unsupportedLanguageCode=e.unsupportedLanguageCode,i.isLanguageSupported=!1,i.checkedText=t,this._highlight(i),(0,_.trackPerformanceMetrics)({type:"check_unsupported_language",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:o,endTime:Date.now(),newDisplayedErrors:[],oldDisplayedErrors:[],isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo}),void this._updateState(i);if(e.language&&!i.language&&(i.language=e.language),t.originalText.length>T.MIN_TEXT_LENGTH&&(i.tracking.languageCode=e.language?e.language.code:null,i.tracking.hasEnoughText=!0),e.language&&i.dialog&&i.dialog.setCurrentLanguage(e.language.code),e.language&&e.language.code.toLowerCase()!==i.language.code.toLowerCase())return this._resetEditor(i),i.language=e.language,this._checkEditor(i),this._highlight(i),(0,_.trackPerformanceMetrics)({type:"check_reset",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,newDisplayedErrors:[],oldDisplayedErrors:[],initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:o,endTime:Date.now(),isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo}),void this._updateState(i);const c=(0,v.deepClone)(i.displayedErrors),d=i.lastSentenceRangesCheckTimestamp<n,{errors:h,premiumErrors:u,recommendationErrors:g,sentenceRanges:m,valuableCurrentText:p}=this.mergeAndMigrateErrors(i,!1,{errors:e,existingCheckedText:i.checkedText,newCheckedText:t,existingRecommendationCheckedText:i.recommendationCheckedText,newRecommendationCheckedText:i.recommendationCheckedText},i.showPickyAsHiddenMatch&&!l,e.areErrorsSuppressed,!1,d);d&&(this.updateSentenceRanges(t,e,n,m),i.sentenceRanges=m,i.sentenceRangesCheckedText=t,i.checkedTextSentenceRanges=m,i.lastSentenceRangesCheckTimestamp=n),i.checkedTextErrors=h,this._updateDisplayedErrors(i,p,h,u,g),this._updateHighlightedSentence(i),this._updateHighlightedSynonym(i),0===i.pendingErrors.length&&this._endTypingMode(i);const E=!1===a&&!0===i.needsLanguageHintFromUser,f=!0===a&&!1===i.needsLanguageHintFromUser;
444E?i.highlighter.disableHighlighting():f&&i.highlighter.enableHighlighting(),this._highlight(i),e.areErrorsSuppressed||(0,_.trackPerformanceMetrics)({type:"check_completed",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:o,endTime:Date.now(),newDisplayedErrors:i.displayedErrors,oldDisplayedErrors:c,isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo,textChangeActionType:r}),this._updateState(i),i.userActivity?.updateMeta({checkLevel:i.checkLevel,language:i.language?.code,writingGoalId:i.writingGoalId}),i.inputAreaTweaks.canCollectErrorMeta(i)&&i.userActivity?.updateErrorMeta({pickyErrors:i.pickyErrors.length,hiddenMatches:l?0:i.premiumErrors.length})}_onCheckCompletedIncremental(e,t,n,s,r){const i=this._editors.find((t=>t.id===e.instanceId));if(!i)return;if(!i.isAutoCheckEnabled)return;let o=!1;if(n<i.lastCheckTimestamp)return;n>i.lastCheckTimestamp&&(o=!0);const a=Date.now(),l=i.needsLanguageHintFromUser,c=this._storageController.isPremium();if(i.checkError=null,i.isChecking=!1,i.lastCheckTimestamp=n,e?.metaData&&(i.metaData={...i.metaData,textErrors:{...i.metaData?.textErrors||{},...e.metaData.textErrors||{}}}),e.isUnsupportedLanguage)return this._resetEditor(i,{keepCard:"toolbox"===i.card?.mode}),this._endTypingMode(i),i.language=null,i.unsupportedLanguageCode=e.unsupportedLanguageCode,i.isLanguageSupported=!1,i.checkedText=t,this._highlight(i),(0,_.trackPerformanceMetrics)({type:"check_unsupported_language",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:a,endTime:Date.now(),newDisplayedErrors:[],oldDisplayedErrors:[],isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo}),void this._updateState(i);if(e.language&&!i.language&&(i.language=e.language),t.originalText.length>T.MIN_TEXT_LENGTH&&(i.tracking.languageCode=e.language?e.language.code:null,i.tracking.hasEnoughText=!0),e.language&&i.dialog&&i.dialog.setCurrentLanguage(e.language.code),e.language&&e.language.code.toLowerCase()!==i.language.code.toLowerCase())return this._resetEditor(i),i.language=e.language,this._checkEditor(i),this._highlight(i),(0,_.trackPerformanceMetrics)({type:"check_reset",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,newDisplayedErrors:[],oldDisplayedErrors:[],initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:a,endTime:Date.now(),isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo}),void this._updateState(i);const d=(0,v.deepClone)(i.displayedErrors),h=i.lastSentenceRangesCheckTimestamp<n;if(e.areErrorsSuppressed||o){const{sentenceRanges:s}=this.mergeAndMigrateErrors(i,!1,{errors:e,existingCheckedText:i.checkedText,newCheckedText:t,existingRecommendationCheckedText:i.recommendationCheckedText,newRecommendationCheckedText:i.recommendationCheckedText},i.showPickyAsHiddenMatch&&!c,e.areErrorsSuppressed,!1,h);h&&(this.updateSentenceRanges(t,e,n,s),i.sentenceRanges=s,i.sentenceRangesCheckedText=t,i.checkedTextSentenceRanges=s,i.lastSentenceRangesCheckTimestamp=n),i.checkedText=t}i.checkedTextErrors=i.errors,this._updateHighlightedSentence(i),this._updateHighlightedSynonym(i),0===i.pendingErrors.length&&this._endTypingMode(i);const u=!1===l&&!0===i.needsLanguageHintFromUser,g=!0===l&&!1===i.needsLanguageHintFromUser;u?i.highlighter.disableHighlighting():g&&i.highlighter.enableHighlighting(),this._highlight(i),e.areErrorsSuppressed||(0,_.trackPerformanceMetrics)({type:"check_completed",editor:i,currentText:e.text,changedParagraphs:e?.changedParagraphs,initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,responseTime:a,endTime:Date.now(),newDisplayedErrors:i.displayedErrors,oldDisplayedErrors:d,isTriggeredByMaxDebounced:s,errorInfo:e.metaData?.errorInfo,textChangeActionType:r}),this._updateState(i),i.userActivity?.updateMeta({checkLevel:i.checkLevel,language:i.language?.code,writingGoalId:i.writingGoalId}),i.inputAreaTweaks.canCollectErrorMeta(i)&&i.userActivity?.updateErrorMeta({pickyErrors:i.pickyErrors.length,hiddenMatches:c?0:i.premiumErrors.length})}_updateCurrentErrors(e){const t=e.inputAreaWrapper.getText(),n=e.inputAreaTweaks.getReplacedParts(t),s=(0,v.getValuableText)(t,n);e.errors=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.errors,e.checkedText.originalText,s.originalText),e.premiumErrors=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.premiumErrors,e.checkedText.originalText,s.originalText),e.sentenceRanges&&(e.sentenceRanges=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.sentenceRanges,e.checkedText.originalText,s.originalText))}mergeAndDisplayIncrementalErrors(e,t,n,s,r){if(!this._options.incrementallyPaint)return;const i=this._editors.find((t=>t.id===e));if(i&&t){const s=i.inputAreaWrapper.getText(),o=i.inputAreaTweaks.getReplacedParts(s),a=(0,v.getValuableText)(s,o),l=i.textCollection.paragraph.getById(t.metaData?.paragraphId);if(!l)return;if(!(l.data.newOffset===r.offset&&l.data.newText===r.text&&l.data.oldOffset===r.oldOffset&&l.data.oldText===r.oldText||l.data.oldOffset===r.offset&&l.data.newText===r.text&&null===l.data.textDiff))return;const{errors:c,premiumErrors:d,recommendationErrors:h}=this.mergeAndMigrateErrors(i,!1,{errors:{instanceId:e,paragraphLevelErrors:t.errors,paragraphLevelPremiumErrors:t.premiumErrors,paragraphLevelPremiumPickyErrors:t.premiumPickyErrors,paragraphLevelPickyErrors:t.pickyErrors,paragraphLevelSentenceRanges:t.sentenceRanges},existingCheckedText:i.checkedText,newCheckedText:n,existingRecommendationCheckedText:i.recommendationCheckedText,newRecommendationCheckedText:i.recommendationCheckedText},!1,!1,!1,!1),u=(0,v.deepClone)(i.displayedErrors),g=this._getBeforeUserTextChangeActionType({editor:i});this._updateDisplayedErrors(i,a,this.removeDuplicateErrors(c),this.removeDuplicateErrors(d),this.removeDuplicateErrors(h)),this._highlight(i),0!==t.metaData?.paragraphStats?.index||t.metaData.isFromCac
444he||(0,_.trackPerformanceMetrics)({type:"first_incremental_paint",editor:i,currentText:a.originalText,changedParagraphs:[r],sentParagraphsCount:t.metaData.totalChangedParagraphs,initStartTime:i.initStartTime,changeStartTime:i.lastCheckTimestamp,requestTime:t.metaData?.paragraphStats?.requestTime,responseTime:t.metaData?.paragraphStats?.responseTime,endTime:Date.now(),newDisplayedErrors:i.displayedErrors,oldDisplayedErrors:u,errorInfo:t.metaData?.errorInfo,textChangeActionType:g}),this._updateState(i)}}_needsLanguageHintFromUser(e,t){if("extension"!==l.EnvironmentAdapter.getType())return!1;const n=e.filter((e=>{if(e.isSpellingError){const t=e.originalPhrase.toLowerCase();if(e.fixes.some((e=>t===e.value.toLowerCase())))return!1;const n=(0,v.removeDiacritics)(e.originalPhrase.toLowerCase());return!e.fixes.some((e=>n===(0,v.removeDiacritics)(e.value.toLowerCase())))}return!1}));return!(n.length<3||t.length>T.SHORT_TEXT_MAX_LENGTH)&&n.reduce(((e,{length:t})=>e+t),0)/t.length>.4}_onCheckAborted(e,t,n){e.isChecking=!1,e.pendingErrors=[],this._endTypingMode(e);let s=e.errors;n.text===e.checkedText.text&&e.checkedTextErrors.length>0&&(e.currentSentenceRanges=e.checkedTextSentenceRanges,s=e.checkedTextErrors),e.errors=C.ErrorProcessor.migrateErrorsBetweenSameOriginalTexts(s,t,n),e.checkedTextErrors=C.ErrorProcessor.migrateErrorsBetweenSameOriginalTexts(s,t,n),e.pickyErrors=C.ErrorProcessor.migrateErrorsBetweenSameOriginalTexts(e.pickyErrors,t,n),e.premiumErrors=C.ErrorProcessor.migrateErrorsBetweenSameOriginalTexts(e.premiumErrors,t,n),e.checkedText=n,e.checkedTextErrors=e.errors,e.lastCheckTimestamp=Date.now();const r=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,n.originalText,!1,!0);this._updateDisplayedErrors(e,n,e.errors,e.premiumErrors,r),this._highlight(e),this._updateState(e)}_onCheckFailed(e){const t=this._editors.find((t=>t.id===e.instanceId));t&&(this._resetEditor(t),t.checkError=e.error,e&&e.error&&e.error.response&&void 0!==e.error.status?e.error.response.includes("too many errors")?m.TrackerAdapter.trackError("http",`${e.error.status}: Too many errors`):e.error.response.includes("Client request limit")?m.TrackerAdapter.trackError("http",`${e.error.status}: Client Request Limit`):e.error.response.includes("ErrorRateTooHigh")?m.TrackerAdapter.trackError("http",`${e.error.status}: Error Rate Too High`):e.error.response.includes("Client request size limit")?m.TrackerAdapter.trackError("http",`${e.error.status}: Client Request Size Limit`):e.error.response.includes("oo many recent timeouts")?m.TrackerAdapter.trackError("http",`${e.error.status}: Too Many Recent Timeouts`):e.error.response.match(/(application|page|site|request) (is )?blocked/i)||e.error.response.match(/has been blocked|cannot be accessed/)||e.error.response.match(/noncompliant action/i)||e.error.response.match(/watchguard http proxy/i)||e.error.response.match(/due to corporate security/i)||e.error.response.match(/sitio web bloqueado/i)||e.error.response.match(/blocked by parental control/i)||e.error.response.match(/sophos.+web protection/i)||e.error.response.match(/blockedwebsites\.html/i)||e.error.response.match(/block-webcat/i)||e.error.response.match(/system policy has denied access/i)||e.error.response.match(/access to this site has been restricted/i)||e.error.response.match(/urlblocked/i)||e.error.response.match(/block\.opendns\.com/i)?m.TrackerAdapter.trackError("http",`${e.error.status}: Application blocked by proxy`):e.error.reason?.includes("InvalidCredentials")?m.TrackerAdapter.trackError("http",`${e.error.status}: Invalid Credentials`):m.TrackerAdapter.trackError("http",`${e.error.status}: ${e.error.reason} - ${e.error.response}`):e.error.status||e.error.reason?m.TrackerAdapter.trackError("http",`${e.error.status}: ${e.error.reason}`):m.TrackerAdapter.trackError("http",JSON.stringify(e)),this._highlight(t),this._updateState(t))}_startTypingMode(e){e.isUserTyping=!0,e.pastedTextOffset=void 0,this._scheduleLollipopDilate(e),clearTimeout(e.typingTimeoutId),e.typingTimeoutId=self.setTimeout((()=>this._endTypingModeAndUpdateState(e)),T.STOPPED_TYPING_TIMEOUT)}_endTypingModeAndUpdateState(e){this._endTypingMode(e);const t=e.inputAreaWrapper.getText(),n=e.inputAreaTweaks.getReplacedParts(t),s=(0,v.getValuableText)(t,n),r=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.errors,e.checkedText.originalText,t),i=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.premiumErrors,e.checkedText.originalText,t),o=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,t,!1,!0);this._updateDisplayedErrors(e,s,r,i,o),this._highlight(e),this._updateState(e)}_endTypingMode(e){e.isUserTyping=!1,clearTimeout(e.typingTimeoutId)}_scheduleLollipopDilate(e){if(!this._toolboxAdoptionExperimentVersion()||this._options.zenMode)return;clearTimeout(e.lollipopDilateScheduleTimeoutId);const t=this._shouldLollipopPulsate(e,!1);e.lollipopDilateScheduleTimeoutId=self.setTimeout((()=>{const{lollipop:n}=e;if(!n||n.isPulsating||n.isDilated)return;if(t)return n.startPulsating(),void this._trackSampledLollipopEvent("pulsate");const s=this._lollipopDilateReason(e);s&&n.dilate(s,!0)}),t?50:T.LOLLIPOP_DILATE_SCHEDULE_TIMEOUT)}_lollipopDilateReason(e){const t=e.inputAreaWrapper.getSelection();if(!t||t.start!==t.end)return null;const n=t.start;if(-1===n)return"idle-unknown";const s=e.inputAreaWrapper.getText(),r=s.slice(n),i=r.indexOf("\n");if((i<0?r:r.slice(0,i)).trimEnd().length)return null;const o=n<=0?0:s.lastIndexOf("\n",n-1)+1,a=s.slice(o,n),l=a.trimEnd(),c=l.slice(-1);return c.length?T.SENTENCE_END_CHARS.includes(c)&&a.length>l.length?"idle-sentence_end":null:"idle-new_line"}_rerenderHighlightForEditor(e){const t=e.inputAreaWrapper.getText(),n=e.inputAreaTweaks.getReplacedParts(t),s=(0,v.getValuableText)(t,n),r=s.text!==e.checkedText.text,i=s.text!==e.recommendationCheckedText.text;if(r||i){let n=e.errors,r=e.premiumErrors,i=e.recommendationErrors;s.text!==e.checkedText.text&&(n=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.errors,e.checkedText.originalText,t,!1,e.isApplyingFix),r=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.premiumErrors,e.checkedText.originalText,t)),s.text!==e.recommendationCheckedText.text&&(i=C.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,t,!1,!0)),this._updateDisplayedErrors(e,s,n,r,i)}else this._updateDisplayedErrors(e,s,e.errors,e.premiumErrors,e.recommendationErrors);this._highlight(e),this._updateState(e)}rerenderHighlights(e){if(e){const t=this._editors.find((t=>t.id===e));t&&this._rerenderHighlightForEditor(t)}
444else this._editors.forEach((e=>{e&&this._rerenderHighlightForEditor(e)}))}getUserActiveEditorId(){return this._userActiveEditorId}_updateHighlightedSentence(e){if(null===e.selectSentenceAfter)return;const t=this._getSentenceAfter(e,{start:e.selectSentenceAfter,end:e.selectSentenceAfter});e.selectSentenceAfter=null,t?(e.inputAreaWrapper.setSelection({start:t.end}),this._scrollToSentence(e,t)):"toolbox"===e.card?.mode&&(e.card.destroy(),e.card=null)}_updateHighlightedSynonym(e){if(null===e.selectSynonymReplacement)return;const t=(0,v.getWordContext)(e.inputAreaWrapper.getText(),e.selectSynonymReplacement);e.selectSynonymReplacement=null,t&&e.card?.switchSentence(t.position)}_flashHighlight(e){e.editor.flashHighlight={id:"FLASH",offset:e.offset,length:e.length,isEmphasized:!0,isUnderlined:!0,highlightStylingType:O.HighlightStylingType.flash},this._highlight(e.editor,!0),setTimeout((()=>{e.editor.flashHighlight=null,this._highlight(e.editor)}),e.duration)}_enableEditor(e){e.isAutoCheckEnabled=!0,this._disableOtherSpellCheckers(e.inputArea),e.inputAreaWrapper.resetText(),this._resetEditor(e),this._checkEditor(e),this._updateState(e),e.lollipop?e.lollipop.enable():this._initLollipop(e)}_toolboxAdoptionExperimentVersion(){const{experiments:e}=this._storageController.getTestFlags();if(!e?.ext_toolbox_adoption?.value)return null;const t=e.ext_toolbox_adoption.value.toLocaleLowerCase();return["b","c"].includes(t)?t:null}_disableEditor(e){e.isAutoCheckEnabled=!1,this._enableOtherSpellCheckers(e.inputArea),e.inputAreaWrapper.resetText(),this._resetEditor(e),this._endTypingMode(e),this._highlight(e),this._updateState(e),e.lollipop?.disable()}_trackEditor(e){(l.EnvironmentAdapter.isRuntimeConnected()||e.tracking.hasTracked)&&(e.tracking.hasTracked=!0,Math.random()<.01&&e.tracking.hasEnoughText&&l.EnvironmentAdapter.trackEvent(`saw_premium_icon_1perc:${!!e.displayedHiddenErrorCount}`,e.tracking.languageCode))}_destroyEditor(e){const t=this._editors.indexOf(e);if(-1===t)return;this._isConnected&&l.EnvironmentAdapter.abortAllRequests(e),this._activeEditorId===e.id&&(this._activeEditorId=null),this._userActiveEditorId===e.id&&(this._userActiveEditorId=null),this._editors.splice(t,1),e.inputAreaWrapper.destroy(),e.highlighter.destroy(),e.inputAreaTweaks.destroy(),e.toolbar?.destroy(),clearTimeout(e.typingTimeoutId),clearTimeout(e.lollipopDilateScheduleTimeoutId),clearTimeout(e.pasteHandlerTimeoutId),e.mirror?.destroy(),e.card?.destroy(),e.dialog?.destroy(),e.userActivity?.destroy(),e.lollipop?.destroy();const n=this._initElementTimeouts.get(e.inputArea);n&&(this._initElementTimeouts.delete(e.inputArea),clearTimeout(n.id),n.reject()),this._enableOtherSpellCheckers(e.inputArea),this._savePremiumErrorCount(e),this._trackEditor(e),this._recommendationController.cancelAnyDeferredTimerPipeline({editor:e}),e.hoverDebounce.cancelCall(),e.checkDebounce.cancelCall(),e.selectionChangeDebounce.cancelCall(),e.typingSpeedController.flushAllBurstSessions("editorDestroyed")}getErrorAfter(e,t){const n=this._editors.find((e=>t?e.id===t:e.id===this._userActiveEditorId));return n?this._getErrorAfter(n,e):null}_getErrorAt(e,t){const n=e.displayedErrors.find((e=>e.start<=t&&e.end>=t));return n||null}_getErrorAfter(e,t){let n=null;const{displayedErrors:s}=e;C.ErrorProcessor.sortErrorsByOffset(s);for(const e of s)e.start<=t||(null===n||e.start<n.start)&&(n=e);return null===n&&s.length>0&&(n=s[0]),n}getErrorBefore(e,t){const n=this._editors.find((e=>t?e.id===t:e.id===this._userActiveEditorId));return n?this._getErrorBefore(n,e):null}_getErrorBefore(e,t){let n=null;const{displayedErrors:s}=e,r=s.length-1;C.ErrorProcessor.sortErrorsByOffset(s);for(const e of s)e.start>=t||(null===n||e.start>n.start)&&(n=e);return null===n&&s.length>0&&(n=s[r]),n}_getSentenceBefore({currentSentenceRanges:e,card:t},n){if(!e?.length)return;C.ErrorProcessor.sortSentenceRanges(e),e.reverse();const s=e.find((({end:e})=>e<=n.start));return"toolbox"===t?.mode?s:s||e[0]}_getSentenceAfter({currentSentenceRanges:e,card:t},n){if(!e?.length)return;C.ErrorProcessor.sortSentenceRanges(e);const s=e.find((({start:e})=>e>=n.end));return"toolbox"===t?.mode?s:s||e[0]}_hideAllEditorCards(e){const t=e?.activeEditorId||(this._activeEditorId?this._activeEditorId:void 0);
444this._editors.forEach((n=>{if(!e?.ignoreDetachedEditorCard||!1===n.card?.isDetached||n.id!==t){let t=!1;e?.ignoreEditorCardInteractionType&&(t=(0,_.isValidCardInteractionType)(n?.card,e?.ignoreEditorCardInteractionType,this._options.highlightInteraction)),t||(n.card?.destroy(),n.card=null)}n.dialog?.fadeIn(),n.lollipop?.unfreezeClickState()}))}_getRephraseCardData(e,t="word"){return{hasGrammarMistakes:(0,_.hasGrammarMistakes)(e),hasSpellingMistakes:(0,_.hasSpellingMistakes)(e),highlightType:t,remainingRephrasings:this._getRemainingRephrasings()}}_getErrorCardData(e,t){const{premiumErrors:n,displayedErrors:s}=e,r=void 0!==t&&e.inputAreaTweaks.canCorrectMultipleErrorsAtOnce(e)&&(0,_.containsSimilarErrors)(e.displayedErrors,t),i=this._storageController.getManagedSettings();return{canCorrectMultipleAtOnce:r,disableIgnoringRule:void 0!==this._options.disableRuleIgnore?this._options.disableRuleIgnore:i.disableIgnoredRules,disableAddingWord:void 0!==this._options.disableDictionaryAdd?this._options.disableDictionaryAdd:i.disablePersonalDictionary,displayedErrors:s,premiumErrors:n,error:t}}_getToolboxCardData(e,t="mouse"){const n=e.inputAreaWrapper.getSelection(),{hasOptedIntoThirdPartyAiParaphrasing:s}=this._storageController.getPrivacySettings();return{triggerType:t,inhouseOnly:!s,error:(()=>{if(!n)return;const{start:t,end:s=t}=n;return t===s&&this._getErrorAt(e,t)||void 0})()}}async _showRephraseCard(e,t,n,s,r=!1,i="word"){if(!l.EnvironmentAdapter.isRuntimeConnected())return;const o=(0,v.getSentenceRangeBySelection)(e.currentSentenceRanges,n)?Promise.resolve():(0,_.waitForEditorToRetrieveSentenceRanges)(e).catch((()=>!0)),{hasOptedIntoThirdPartyAiParaphrasing:a}=this._storageController.getPrivacySettings(),c=!a,h=this._storageController.isPremium(),{username:u,token:g}=this._storageController.getSettings(),p=u?{email:u,token:g}:void 0;e.card=new b.default({mode:"paraphrase",storageController:this._storageController,inputArea:e.inputArea,tweaks:e.inputAreaTweaks.getEditorCardTweaks(),targetBox:(0,_.getBoundingBox)(t),disablePremiumTeaser:this._options.disablePremiumTeaser||this._storageController.hasCustomServer()||h,anchorSelection:n,getText:()=>e.inputAreaWrapper.getText(),getSentenceRanges:()=>e.currentSentenceRanges,getInputAreaScrollContainer:()=>e.inputAreaWrapper.getScrollContainer(),customEditorCard:this._options.customEditorCard,onCardHovered:this._onEditorCardHovered,enableKeyboard:r,inhouseOnly:c,triggerType:s,user:p,isPremium:h}),await e.card.render();const[E,f]=await Promise.all([this._retrieveLanguageFromEditor(e),o]);if(!E||f)return e.card?.destroy(),void m.TrackerAdapter.trackError("other","editor-card:paraphrase:failed",f?"check request timeout":"missing language");if(!e.card)return;const T=d.LanguageManager.getPrimaryLanguageCode(E),C=this._getRephraseCardData(e,i);e.card.setLanguage(T),e.card.setRephraseCardArguments(C,n),e.card.hideLoadingScreen()&&(e.lollipop?.resetDilate(),clearTimeout(e.lollipopDilateScheduleTimeoutId),e.lollipopDilateScheduleTimeoutId=void 0,e.lollipop?.disableProximityHandler(),this._updateState(e),m.TrackerAdapter.trackEvent("Action","editor-card:paraphrase:open",d.LanguageManager.getPrimaryLanguageCode(e.language?.code||"unknown")))}async _showToolboxCard(e,t,n,s="mouse",r=!1){if(!l.EnvironmentAdapter.isRuntimeConnected())return;const i=(0,v.getSentenceRangeBySelection)(e.currentSentenceRanges,t)?Promise.resolve():(0,_.waitForEditorToRetrieveSentenceRanges)(e).catch((()=>!0)),{hasOptedIntoThirdPartyAiParaphrasing:o}=this._storageController.getPrivacySettings(),a=!o,c=this._storageController.isPremium(),h=this._getTargetBoxForCardMode(e,"toolbox",r),{username:u,token:g}=this._storageController.getSettings(),p=u?{email:u,token:g}:void 0,E=!(0,_.isGoogleSlides)(e.inputArea);e.card=new b.default({mode:"toolbox",storageController:this._storageController,inputArea:e.inputArea,tweaks:e.inputAreaTweaks.getEditorCardTweaks(),enableKeyboard:"keyboard"===s,disablePremiumTeaser:this._options.disablePremiumTeaser||this._storageController.hasCustomServer()||c,customEditorCard:this._options.customEditorCard,anchorSelection:t,getText:()=>e.inputAreaWrapper.getText(),getSentenceRanges:()=>e.currentSentenceRanges,getInputAreaScrollContainer:()=>
444e.inputAreaWrapper.getScrollContainer(),canToolboxJumpToNextSentence:E,inhouseOnly:a,targetBox:h,user:p,isPremium:c,triggerType:n,onCardHovered:this._onEditorCardHovered}),await e.card.render();const[f,T]=await Promise.all([this._retrieveLanguageFromEditor(e),i]);if(T)return e.card?.destroy(),void m.TrackerAdapter.trackError("other","editor-card:toolbox:failed",T?"check request timeout":"missing language");if(!e.card)return;const C=f?d.LanguageManager.formatLanguageCode(f):null,S=this._getToolboxCardData(e,s);e.card.setLanguage(C),e.card.setToolboxCardArguments(S,t),e.card.hideLoadingScreen()&&(this._updateState(e),this._trackSampledToolboxEvent(e.card.id,{name:"toolbox:open",data:s}))}_hideAllMessagePopups(){this._messages.forEach((e=>{e&&e.destroy()}))}_showDialog(e){if(!e.toolbar)return;const t=e.language&&e.language.code,n=new g.TextStatistics(e.inputAreaWrapper.getText(),e.currentSentenceRanges||[]),s=(new o.TextScore).calculateTextScore(n.countWords(),e.errors,e.premiumErrors,e.pickyErrors),{coordinates:r,dialogPosition:i}=this._getDialogProps(),a={checkStatus:e.checkStatus,recommendationStatus:e.recommendationStatus,displayedErrors:e.displayedErrors,errors:e.errors,pickyErrors:e.pickyErrors,displayedPremiumErrors:e.displayedPremiumErrors,isIncompleteResult:e.isIncompleteResult,ignoredErrorsStats:this._getIgnoredErrorsStats(e.errors),checkErrorMessage:e.checkError?this._getCheckErrorMessage(e.checkError):"",textScore:s,countOptions:this._getCountOptions(e),isPickyModeEnabled:"picky"===e.checkLevel,coordinates:r},c=this._storageController.getManagedSettings(),d=void 0!==this._options.disableRuleIgnore?this._options.disableRuleIgnore:c.disableIgnoredRules,h=void 0!==this._options.disableDictionaryAdd?this._options.disableDictionaryAdd:c.disablePersonalDictionary,u={showUserStatisticsLink:this._storageController.hasLanguageToolAccount()&&this._storageController.getPrivacySettings().hasStatisticsCollectionEnabled,disableOptionsPage:!l.EnvironmentAdapter.isOptionsPageSupported(),disableTurnOff:!1,disableFeedbackForm:!l.EnvironmentAdapter.isFeedbackFormSupported()||!!c.loginUrl,disableHelpCenter:!1,disableRatingTeaser:this._storageController.getUIState().hasRated||J.Trial.isRunning()||J.Trial.isFunctionalityLocked(),disableIgnoringRule:d,disableAddingWord:h,dialogPosition:i,isPremium:this._storageController.isPremium(),canCorrectMultipleErrorsAtOnce:e.inputAreaTweaks.canCorrectMultipleErrorsAtOnce(e),draggable:this._options.dialog?.draggable,dialogWidth:this._options.dialog?.width},m=e.inputAreaTweaks.getEditorCardTweaks(),p=e.inputArea,_=e.toolbar?.getContainer(),E=m.getRoot(_.ownerDocument,p);e.dialog=new A.Dialog({toolbarContainer:_,appearence:e.inputAreaTweaks.getDialogAppearance(),languageCode:t,state:a,uiOptions:u,backdropRoot:E}),e.lollipop?.resetDilate(),clearTimeout(e.lollipopDilateScheduleTimeoutId),e.lollipopDilateScheduleTimeoutId=void 0}_hideAllDialogs(e=!1){this._editors.forEach((t=>{t.toolbar&&t.toolbar.toggleDisableMenu(!1),t.dialog&&(t.dialog.setApplyFixMode(!1),t.dialog.closeAllMenus(),"default"!==t.dialog.getCurrentPosition()&&l.EnvironmentAdapter.isRuntimeConnected()&&!e||t.dialog.destroy(),this._options.onDialogClose&&this._options.onDialogClose())}))}_fadeAllDialogs(){this._editors.forEach((e=>{e.dialog&&e.dialog.fadeOut()}))}_savePremiumErrorCount(e){if(!e.displayedHiddenErrorCount||!l.EnvironmentAdapter.isRuntimeConnected())return;const t=(new Date).toDateString(),{hiddenErrors:n}=this._storageController.getStatistics();n[0]&&n[0].day===t?n[0].count+=e.displayedHiddenErrorCount:n.unshift({day:t,count:e.displayedHiddenErrorCount}),n.length=Math.min(n.length,62),this._storageController.updateStatistics({hiddenErrors:n})}_getIgnoredErrorsStats(e){const{ignoredRules:t}=this._storageController.getSettings(),n=a.Dictionary.get(),s=[],r=[];return e.forEach((e=>{e.isSpellingError&&(0,v.isErrorIgnoredByDictionary)(e,n)&&!s.includes(e.originalPhrase)&&s.push(e.originalPhrase),e.isSpellingError||!(0,v.isErrorRuleIgnored)(e,t)||r.includes(e.rule.id)||r.push(e.rule.id)})),{byDictionary:s.length,byRules:r.length}}_destroyExecutor(){(0,_.dispatchCustomEvent)(document,"lt-execute-destroy")}
444destroy(){Array.from(this._editors).forEach((e=>this._destroyEditor(e))),this._spellcheckingAttributesData.forEach(((e,t)=>this._enableOtherSpellCheckers(t))),this._tweaks&&document.removeEventListener(this._tweaks.getClickEvent(),this._onDocumentClick,!0),this._destroyExecutor(),document.removeEventListener("visibilitychange",this._onVisiblityChange,!0),document.removeEventListener("session-id-created",this._onWritingSessionCreated),document.removeEventListener("focus",this._onDocumentFocus,!0),document.removeEventListener(U.ShadowDomEventsPropagator.eventNames.focus,this._onDocumentFocus,!0),document.removeEventListener("mousemove",this._onDocumentMousemove,!0),document.removeEventListener("focusout",this._onDocumentFocusout,!0),document.removeEventListener(U.ShadowDomEventsPropagator.eventNames.focusout,this._onDocumentFocusout,!0),document.removeEventListener("keyup",this._onDocumentKeyup,!0),document.removeEventListener(l.EnvironmentAdapterBaseClass.eventNames.sentenceRangesChecked,this.onCheckSentenceRangesChecked),document.removeEventListener(l.EnvironmentAdapterBaseClass.eventNames.incrementalCheckResponseReceived,this.onIncrementalCheckResponseReceived),self.frameElement?.ownerDocument&&self.frameElement.ownerDocument.removeEventListener("click",this._onDocumentClick,!0),document.removeEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_SYNC_ACK,this._onEditorStateSyncAck),document.removeEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_STATE_FORCE_SYNC,this._onEditorStateForceSync),document.removeEventListener(V.EDITOR_CONTEXT_EVENT_NAMES.EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC,this._onEditorSurroundingContextForceSync),document.removeEventListener(R.InputAreaWrapper.eventNames.scroll,this._onInputScroll),document.removeEventListener(R.InputAreaWrapper.eventNames.paste,this._onInputPaste),document.removeEventListener(R.InputAreaWrapper.eventNames.textChanged,this._onInputTextChanged),document.removeEventListener(R.InputAreaWrapper.eventNames.surroundingTextContextChanged,this._onInputSurroundingTextContextChanged),document.removeEventListener(R.InputAreaWrapper.eventNames.selectionChanged,this._onSelectionChanged),document.removeEventListener(R.InputAreaWrapper.eventNames.keydown,this._onInputKeyDown),document.removeEventListener(R.InputAreaWrapper.eventNames.click,this._onInputClick),document.removeEventListener(R.InputAreaWrapper.eventNames.blur,this._onInputBlur),("dblclick"===this._options.highlightInteraction?.rephrase||this._options.highlightInteraction?.rephrase.includes("dblclick"))&&document.removeEventListener(R.InputAreaWrapper.eventNames.dblclick,this._onInputDblClick),document.removeEventListener(R.InputAreaWrapper.eventNames.keyboardShortcut,this._onKeyboardShortcut),document.removeEventListener(R.InputAreaWrapper.eventNames.wordWritten,this._onWordWritten),document.removeEventListener(R.InputAreaWrapper.eventNames.sentenceWritten,this._onSentenceWritten),document.removeEventListener(R.InputAreaWrapper.eventNames.compositionStart,this._onCompositionStart),document.removeEventListener(R.InputAreaWrapper.eventNames.compositionEnd,this._onCompositionEnd),("hover"===this._options.highlightInteraction?.correct||"hover"===this._options.highlightInteraction?.recommendation||this._options.highlightInteraction?.recommendation.includes("hover"))&&document.removeEventListener(w.Highlighter.eventNames.blockHovered,this._onHiglighterBlockMouseMove),document.removeEventListener(w.Highlighter.eventNames.blockClicked,this._onHiglighterBlockClicked),document.removeEventListener(L.Toolbar.eventNames.permissionRequiredIconClicked,this._onToolbarPermissionRequiredIconClicked),document.removeEventListener(L.Toolbar.eventNames.visibilityChanged,this._onToolbarVisibilityChange),document.removeEventListener(L.Toolbar.eventNames.toggleDialog,this._onToolbarToggleDialog),document.removeEventListener(L.Toolbar.eventNames.languageChanged,this._onToolbarLanguageChanged),document.removeEventListener(L.Toolbar.eventNames.showRephrasingCard,this._onRephrasingIconClick),document.removeEventListener(L.Toolbar.eventNames.turnOff,this._onTurnOffClickedToolbar),document.removeEventListener(L.Toolbar.eventNames.pauseChecking,this._onPauseCheckingClickedToolbar),document.removeEventListener(L.Toolbar.eventNames.fixAllErrors,this._onToolbarFixAllErrors),document.removeEventListener(A.Dialog.eventNames.enableHere,this._onDialogEnableHere),document.removeEventListener(A.Dialog.eventNames.positionChangeClicked,this._onPositionChangeClicked),document.removeEventListener(A.Dialog.eventNames.togglePickyMode,this._onPickyModeToggle),document.removeEventListener(A.Dialog.eventNames.enableEverywhere,this._onDialogEnableEverywhere),document.removeEventListener(A.Dialog.eventNames.languageChanged,this._onDialogLanguageChanged),document.removeEventListener(A.Dialog.eventNames.countChanged,this._onDialogCountChanged),document.removeEventListener(A.Dialog.eventNames.errorSelected,this._onDialogErrorSelected),document.removeEventListener(A.Dialog.eventNames.errorHighlighted,this._onDialogErrorHighlighted),document.removeEventListener(A.Dialog.eventNames.addToDictionaryClicked,this._onAddToDictionary),document.removeEventListener(A.Dialog.eventNames.unlockSuggestion,this._onUnlockSuggestion),document.removeEventListener(A.Dialog.eventNames.ignoreRuleClicked,this._onIgnoreRule),document.removeEventListener(A.Dialog.eventNames.temporarilyIgnoreWordClicked,this._onTemporarilyIgnoreWord),document.removeEventListener(A.Dialog.eventNames.temporarilyIgnoreRuleClicked,this._onTemporarilyIgnoreRule),document.removeEventListener(A.Dialog.eventNames.moreDetailsClicked,this._onMoreDetailsClicked),document.removeEventListener(A.Dialog.eventNames.fixSelected,this._onFixSelected),document.removeEventListener(A.Dialog.eventNames.openOptions,this._onDialogOpenOptions),document.removeEventListener(A.Dialog.eventNames.showFeedbackForm,this._onDialogShowFeedbackForm),document.removeEventListener(A.Dialog.eventNames.destroyed,this._onDialogDestroyed),document.removeEventListener(A.Dialog.eventNames.badgeClicked,this._onBadgeClicked),document.removeEventListener(A.Dialog.eventNames.turnOff,this._onTurnOffClickedDialog),document.removeEventListener(A.Dialog.eventNames.pauseChecking,this._onPauseCheckingClickedDialog),document.removeEventListener(A.Dialog.eventNames.premiumTeaserClicked,this._onDialogPremiumTeaserClicked),document.removeEventListener(A.Dialog.eventNames.correctAll,this._onCorrectAll),document.removeEventListener(b.default.eventNames.addToDictionaryClicked,this._onAddToDictionary),document.removeEventListener(b.default.eventNames.ignoreRuleClicked,this._onIgnoreRule),document.removeEventListener(b.default.eventNames.temporarilyIgnoreWordClicked,this._onTemporarilyIgnoreWord),document.removeEventListener(b.default.eventNames.temporarilyIgnoreRuleClicked,this._onTemporarilyIgnoreRule),document.removeEventListener(b.default.eventNames.moreDetailsClicked,this._onMoreDetailsClicked),document.removeEventListener(b.default.eventNames.fixSelected,this._onFixSelected),document.removeEventListener(b.default.eventNames.premiumClick,this._onEditorCardPremiumClick),document.removeEventListener(b.default.eventNames.languageChanged,this._onErrorCardLanguageChanged),document.removeEventListener(b.default.eventNames.turnOffPickyModeClicked,this._onErrorCardPickyModeTurnedOff),document.removeEventListener(b.default.eventNames.premiumTeaserClicked,this._onErrorCardPremiumTeaserClicked),document.removeEventListener(b.default.eventNames.destroyed,this._onEditorCardDestroyed),document.removeEventListener(b.default.eventNames.correctAll,this._onCorrectAll),document.removeEventListener(b.default.eventNames.synonymSelected,this._onSynonymSelected),document.removeEventListener(b.default.eventNames.phraseSelected,this._onPhraseSelected),document.removeEventListener(b.default.eventNames.splitSentenceSelected,this._onSplitSentenceSelected),document.removeEventListener(b.default.eventNames.fixSentenceSelected,this._onFixSentenceSelected),document.removeEventListener(b.default.eventNames.fixSentenceShowHightlight,this._onFixSentenceShowHighlight),document.removeEventListener(b.default.eventNames.fixSentenceRemoveHightlight,this._onFixSentenceRemoveHighlight),document.removeEventListener(b.default.eventNames.toggleMode,this._onToggleCardMode),document.removeEventListener(b.default.eventNames.highlight,this._onEditorCardHighlight),document.removeEventListener(b.default.eventNames.navigateError,this._onNavigateError),document.removeEventListener(b.default.eventNames.navigateSentence,this._onNavigateSentence),document.removeEventListener(b.default.eventNames.applyToolboxResult,this._onApplyToolboxResult),document.removeEventListener(b.default.eventNames.unlockSuggestion,this._onUnlockSuggestion),document.removeEventListener(E.MessagePopup.eventNames.destroyed,this._onMessagePopupDestroyed),document.removeEventListener(E.MessagePopup.eventNames.turnOn,this._onTurnOnClicked),document.removeEventListener(ee.events.DESTROY,this._onDestroy),document.removeEventListener(
444D.ToolboxEventNames.turnOffLollipop,this._onLollipopTurnOffClicked),document.removeEventListener(W.GoogleEditor.eventNames.contextMenuItemClicked,this._onGoogleEditorContextMenuItemClicked),self.removeEventListener("pageshow",this._onPageLoaded),self.removeEventListener("pagehide",this._onPageHide),this._storageController&&this._storageController.destroy(),this._tweaks&&this._tweaks.destroy(),clearInterval(this._checkExtensionRuntimeHealthIntervalId),clearInterval(this._fixMissingStylesheetsIntervalId),this._stopCheckingForUninitializedInputAreas(),this._suggestionRangeMetrics.trackedMismatches.clear(),this._suggestionRangeMetrics.cache.previousErrorsLength=void 0,this._suggestionRangeMetrics.cache.previousTextHash=void 0,this._options&&this._options.onDestroy&&this._options.onDestroy(),Z.default.destroy(),this._isDestroyed=!0}findEditor(e){return this._editors.find((t=>t.id===e||t===e||t.toolbar===e||t.dialog===e))}setActiveEditor(e){const t=this.findEditor(e);t&&this._userActiveEditorId!==t.id&&(this._userActiveEditorId=t.id,this._onActiveEditorIdUpdate(t),this._updateState(t))}async _dispatchUpdateSurroundingTextContext(e){const{writingSessionId:t,oldContext:n,newContext:s,lastTimestamp:r,currentTimestamp:i=Date.now(),isForceSync:o=!1}=e,a=document.createElement("div");a.innerHTML=n;const l=a.textContent||a.innerText||"";a.innerHTML=s;const c=a.textContent||a.innerText||"";if(n===s||l===c)return;const d=this._writingSessionMetadata.get(t);if(d?.pendingUpdate&&await d.pendingUpdate,(this._writingSessionMetadata.get(t)?.surroundingTextContext??"")===s)return;const h=this._performUpdateSurroundingTextContext({writingSessionId:t,oldTextContext:n,newTextContext:s,lastTimestamp:r,currentTimestamp:i,contextType:/<\/?[a-z][\s\S]*>/i.test(s)?"html":"text",isForceSync:o});this._writingSessionMetadata.set(t,{...d,writingSessionId:t,lastTimestamp:d?.lastTimestamp??null,surroundingTextContext:d?.surroundingTextContext??"",pendingUpdate:h}),await h}async _performUpdateSurroundingTextContext(e){const{writingSessionId:t,oldTextContext:n,newTextContext:s,lastTimestamp:r,currentTimestamp:i,contextType:o,isForceSync:a}=e;try{const e=await l.EnvironmentAdapter.updateSurroundingTextContext({writingSessionId:t,oldTextContext:n,newTextContext:s,lastTimestamp:r,currentTimestamp:i,contextType:o,isForceSync:a});if(e?.error)return void("EXPIRED_WRITING_SESSION"===e.errorCode&&await K.WrittingSession.getInstance((0,v.getCurrentUrl)()).reIntializeWritingSession(t));this._writingSessionMetadata.set(t,{writingSessionId:t,lastTimestamp:e?.ackTimestamp??i,surroundingTextContext:s})}catch(e){const n=this._writingSessionMetadata.get(t);throw n&&this._writingSessionMetadata.set(t,{...n,pendingUpdate:void 0}),e}}_updateCardPositionOnScroll(e){if(!e.card||!e.card.mode||e.card.isDetached)return!1;if(!e.inputAreaTweaks.getEditorCardTweaks().shouldUpdatePositionOnScroll())return!1;const t=this._getTargetBoxForCardMode(e,e.card.mode);if(!t)return!1;const n=e=>{const t=e.nodeName.toLowerCase();return!!e.closest(b.default.CONTAINER_ELEMENT_NAME)||t.startsWith(S.default.NODE_NAME_PREFIX)};e.inputArea.setAttribute(`data-${Q}-disable-pointer-events`,"");const s=document.elementsFromPoint(t.left,t.top).find((e=>!n(e))),r=document.elementsFromPoint(t.left,t.bottom).find((e=>!n(e)));return e.inputArea.removeAttribute(`data-${Q}-disable-pointer-events`),!!(s&&r&&e.inputArea.contains(s)&&e.inputArea.contains(r))&&(e.card.updateTargetBox(t),!0)}_closeToolboxOnKeydown({eventDetails:e},t){"toolbox"===t.card?.mode&&e.key.startsWith("Arrow")&&(t.card.destroy(),t.card=null)}_getTargetBoxForCardMode(e,t,n=!1){if("correct"===t){if(e.selectedErrorId)return e.highlighter.getTextBoxes(e.selectedErrorId)[0]||null}else if("toolbox"===t){if(e.lollipop)return n?e.lollipop.getPosition():e.lollipop.getSelectionRects()[0]||null;try{const t={mirror:e.mirror?.getTextElement(),brandIcon:"",brandIconGdocs:""},n=new S.default(e.inputArea,t),s=n.getSelectionRects();return n.destroy(),s[0]||null}catch(t){const n=e.inputAreaWrapper.getSelection();return n?e.inputAreaWrapper.getTextBoxes(n?.start,n?.end-n?.start)[0]:null}}else if("paraphrase"===t)return(0,_.getBoundingBox)(e.highlighter.getTextBoxes(b.default.BLOCK_ID));return null}_turnOffEditor(e){const t=(0,v.getMainPageDomain)();
444this._storageController.disableDomain(t),l.EnvironmentAdapter.ltAssistantStatusChanged({enabled:!1});const n=e.groupId;if(Array.from(this._editors).forEach((e=>{e.groupId===n&&this._destroyEditor(e)})),m.TrackerAdapter.trackEvent("Action","check_trigger:turn_off"),!this._storageController.getUIState().hasSeenTurnOnMessagePopup&&e.inputAreaTweaks.getMessagePopupAppearance().isVisible()){const t={className:"enable-spelling",hasPrimaryButton:!0,hasSecondaryButton:!0,isClosable:!0,destroysAutomatically:!0},n=new E.MessagePopup(document,e.inputAreaTweaks.getMessagePopupAppearance(),t);this._messages.push(n)}}_pauseEditor(e){const t=e.groupId;Array.from(this._editors).forEach((e=>{e.groupId===t&&this._destroyEditor(e)})),this._temporaryDisabledEditorGroups.push(e.groupId),m.TrackerAdapter.trackEvent("Action","check_trigger:pause")}onTurnOnExtensionClicked(){this._onTurnOnClickedImpl()}_scrollToError(e,t,n,s,r,i){let o,a,l="nearest",c=!1,d=!1;"string"==typeof n&&(l=n),"boolean"==typeof s&&(c=s),"boolean"==typeof r&&(d=r),"number"==typeof r&&(o=r),"number"==typeof i&&(a=i);let h=!0;if(this._options.dialog?.showOnHighlightScroll&&(h=!1),h&&this._hideAllDialogs(),"auto"===l){const t=e.inputArea.ownerDocument.documentElement.clientHeight;l=t<400?"nearest":"center"}return new Promise((n=>{e.inputAreaWrapper.scrollToText(t.start,t.length,"smooth",l,!1,(()=>{e.selectedErrorId=t.id,this._highlight(e,!0);const s=e.inputAreaWrapper.getTextBoxes(t.start,t.length);if(c&&s.length)if(e.card){const n=e.inputAreaTweaks.canCorrectMultipleErrorsAtOnce(e)&&(0,_.containsSimilarErrors)(e.displayedErrors,t),r=t.start+Math.floor((t.end-t.start)/2);e.inputAreaWrapper.setSelection({start:r}),e.card.switchError({displayedErrors:e.displayedErrors,error:t,canCorrectMultipleAtOnce:n},s[0])}else this._showErrorCard(e,t,s[0],"system",d);n(s)}),o,a)}))}scrollToError(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));n&&this._scrollToError(n,e,"auto",t)}_scrollToSentence(e,t,n=!0,s){return new Promise((r=>{const{start:i,end:o=i}=t,a=e.inputAreaWrapper.getTextBoxes(i,o-i),l=e.inputArea.ownerDocument.documentElement.clientHeight<400?"nearest":"center";e.inputAreaWrapper.scrollToText(i,Math.max(o-i,1),"smooth",l,!0,(()=>{return t=()=>{if(e.card){const t=(0,v.isString)(e.card.currentTextHighlightType)?{highlightType:e.card.currentTextHighlightType}:void 0;e.card.switchSentence({start:i,end:o},{remainingRephrasings:this._getRemainingRephrasings(),...t})}else n&&(N.AdvancedToolboxAdapter.isUsedForRephrasing()?((0,_.hasFocus)(e.inputArea)||e.inputAreaWrapper.focus(),this._openToolbox(e,"toolbar")):this._showRephraseCard(e,a,{start:i,end:o},"system",void 0,s||"sentence"));r()},void(e.inputAreaWrapper.getSelection()?t():(e.inputAreaWrapper.setSelection({start:i}),setTimeout((()=>t()),20)));var t}))}))}getSelectedErrorId(e){const t=this._editors.find((t=>e?t.id===e:t.id===this._userActiveEditorId));return t?t.selectedErrorId:null}selectError(e){const t=this._editors.find((e=>e.id===this._userActiveEditorId));t&&(t.selectedErrorId=e)}unselectError(){const e=this._editors.find((e=>e.id===this._userActiveEditorId));e&&this._unselectError(e)}_unselectError(e){null!==e.selectedErrorId&&(e.selectedErrorId=null,this._highlight(e))}addToDictionary(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));this._addToDictionaryBase(n,e,t)}_addToDictionaryBase(e,t,n){const s=t.originalPhrase;if(this._hideAllEditorCards({ignoreDetachedEditorCard:n}),!e)return;const r=this._getEditorGroup(e.groupId).flatMap((({displayedErrors:e})=>e)).filter((e=>!1===(0,v.isErrorIgnoredByDictionary)(e,[s])));e.selectErrorAfter=n&&r.length>0?t.start:null,e.isVisiblyErrorFree=0===r.length,this._addToDictionary(e,s);const i=d.LanguageManager.getPrimaryLanguageCode(t.language.code);m.TrackerAdapter.trackDictionaryEvent(i,t.originalPhrase,!1),m.TrackerAdapter.trackEvent("Action",`${i}:add_word_to_dict`)}async _addToDictionary(e,t){let n=!1;this._options.onDictionaryAdd&&(n=this._options.onDictionaryAdd(t,e.inputArea)),e.callbacks.onDictionaryAdd&&(n=e.callbacks.onDictionaryAdd(t)),n||await a.Dictionary.add(t)}ignoreRule(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));this._ignoreRule(n,e,t)}
444updateAllEditorToolbar(){this._editors.forEach((e=>{e.toolbar&&this._updateToolbarState(e)}))}_ignoreRule(e,t,n,s=!1){if(this._hideAllEditorCards({ignoreDetachedEditorCard:n}),!e)return;const r=d.LanguageManager.getPrimaryLanguageCode(t.language.code),i={id:t.rule.id,language:r,description:t.rule.description,turnOffDate:new Date};let o=!1;this._options.onRuleIgnore&&(o=this._options.onRuleIgnore(i,e.inputArea,t)),e.callbacks.onRuleIgnore&&(o=e.callbacks.onRuleIgnore(i,t)),o||this._storageController.addIgnoredRule(i);const a=this._getEditorGroup(e.groupId).flatMap((({displayedErrors:e})=>e)).filter((({rule:e,language:n})=>!1===Boolean(e.id===t.rule.id&&d.LanguageManager.getPrimaryLanguageCode(n.code)===r)));e.selectErrorAfter=n&&a.length>0?t.start:null,e.isVisiblyErrorFree=0===a.length,T.TRACK_RULE_EVENT_LANGUAGES.includes(r)&&(m.TrackerAdapter.trackDisabledRule(r,t.rule.id,`[${t.rule.subId||"0"}] ${t.contextPhrase}`,t.rule.isPremium),s&&m.TrackerAdapter.trackEvent("Action",`${r}:disable_rule`,t.rule.id))}temporarilyIgnoreWord(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));this._temporarilyIgnoreWordBase(n,e,t)}_temporarilyIgnoreWordBase(e,t,n){if(this._hideAllEditorCards({ignoreDetachedEditorCard:n}),!e)return;const{originalPhrase:s}=t,r=d.LanguageManager.getPrimaryLanguageCode(t.language.code),i=this._getEditorGroup(e.groupId).flatMap((({displayedErrors:e})=>e)).filter((e=>!1===(0,v.isErrorIgnoredByDictionary)(e,[s])));if(e.callbacks.onTemporaryIgnore){const n={id:t.rule.id,phrase:s,language:r};e.callbacks.onTemporaryIgnore(n,t)}e.selectErrorAfter=n&&i.length>0?t.start:null,e.isVisiblyErrorFree=0===i.length,this._temporarilyIgnoreWord(e,s),m.TrackerAdapter.trackDictionaryEvent(r,s,!0),m.TrackerAdapter.trackEvent("Action",`${r}:temp_ignore_word`)}_temporarilyIgnoreWord(e,t){const n=e.groupId;if(this._tweaks.persistTemporarySettings()){const e=`ignored:${n}`,s=h.LocalStorageWrapper.get(e)||{words:[],rules:[]};s.words.push(t),h.LocalStorageWrapper.set(e,s)}this._getEditorGroup(n).forEach((e=>{e.ignoredWords.push(t),this._rerenderHighlightForEditor(e)}))}temporarilyIgnoreRule(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));this._onTemporarilyIgnoreRuleBase(n,e,t)}_onTemporarilyIgnoreRuleBase(e,t,n,s=!1){if(this._hideAllEditorCards({ignoreDetachedEditorCard:n}),!e)return;const r=e.groupId,i=d.LanguageManager.getPrimaryLanguageCode(t.language.code),o={id:t.rule.id,language:i};if(!T.PICKY_RULES_THAT_ARE_CONSIDERED_ANNOYING.some((e=>t.rule.id.includes(e)))&&t.originalPhrase.length<1e3&&(o.phrase=t.originalPhrase),this._tweaks.persistTemporarySettings()){const e=`ignored:${r}`,t=h.LocalStorageWrapper.get(e)||{words:[],rules:[]};t.rules.push(o),h.LocalStorageWrapper.set(e,t)}const a=this._getEditorGroup(r),l=a.flatMap((({displayedErrors:e})=>e)).filter((({rule:e,language:n})=>!1===Boolean(e.id===t.rule.id&&d.LanguageManager.getPrimaryLanguageCode(n.code)===i)));e.callbacks.onTemporaryIgnore&&e.callbacks.onTemporaryIgnore(o,t),e.selectErrorAfter=n&&l.length>0?t.start:null,e.isVisiblyErrorFree=0===l.length,a.forEach((e=>this._temporarilyIgnoreRule(e,o))),"HIDDEN_RULE"!==t.rule.id&&T.TRACK_RULE_EVENT_LANGUAGES.includes(i)&&(m.TrackerAdapter.trackDisabledRule(i,t.rule.id,`[${t.rule.subId||"0"}] ${t.contextPhrase}`,t.rule.isPremium),s&&m.TrackerAdapter.trackEvent("Action",`${i}:temp_disable_rule`,t.rule.id))}_temporarilyIgnoreRule(e,t){const n=(0,v.deepClone)(e.displayedErrors);e.ignoredRules.push(t),this._rerenderHighlightForEditor(e),(0,_.trackPerformanceMetrics)({type:"ignore_rules",editor:e,currentText:e.checkedText.text,changedParagraphs:[],initStartTime:e.initStartTime,changeStartTime:e.lastCheckTimestamp,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:e.displayedErrors,oldDisplayedErrors:n})}_clearTemporarilyIgnoredRules(e){e.ignoredRules=[],this._rerenderHighlightForEditor(e)}_clearWords(e){e.ignoredWords=[],this._rerenderHighlightForEditor(e)}fixSelectedError(e,t,n){const s=this._editors.find((e=>e.id===this._userActiveEditorId));this._fixSelectedError(s,e,t,n)}async _fixSelectedError(e,t,n,s,r=!1,i=!1,o=!1){if(this._hideAllEditorCards({ignoreDetachedEditorCard:s}),!e)return;const{offset:a,length:l}=e.inputAreaWrapper.findReplacementPosition(t.start,t.end-t.start,t.fixes[n].value);e.appliedChange={originalText:t.originalPhrase,replacementText:t.fixes[n].value,start:a,end:a+l,ruleCategory:t.rule.category,ruleId:t.rule.id,isRecommendation:t.isRecommendation,textBeforeCorrection:i?e.inputAreaWrapper.getText():void 0,errorId:t.id,ruleIssueType:t.rule.
444issueType};const c=1===e.displayedErrors.length&&e.displayedErrors[0].id===t.id;e.selectErrorAfter=s?t.start:null,c&&e.card?.switchError({displayedErrors:e.displayedErrors});const h=d.LanguageManager.getPrimaryLanguageCode(t.language.code);r&&!t.isSpellingError&&T.TRACK_RULE_EVENT_LANGUAGES.includes(h)&&m.TrackerAdapter.trackEvent("Action",`${h}:apply_rule`,t.rule.id),await this._applyFix(e,t,n,i,o),e.appliedChange=void 0,e.isVisiblyErrorFree=c}_getFixAllErrorsMetadata(e){const t=this._getFixableErrorsForFixAll(e).length,n=e.inputAreaTweaks.getFixAllErrorsLimit(e);return{limitForEditor:n,fixableErrorCount:t,totalErrorCount:e.displayedErrors.length,fixableErrorsOverLimit:t>n}}getFixAllErrorsMetadata(e){if(e=e??this._editors.find((e=>e.id===this._userActiveEditorId)))return this._getFixAllErrorsMetadata(e)}_getFixableErrorsForFixAll(e){const t=I.default.get(I.ConfigKey.FIX_ALL_CONFIG),n=t.FIX_GC_ERRORS,s=t.FIX_STYLE_ERRORS,r=t.FIX_RECOMMENDATIONS;return e.displayedErrors.filter((e=>1===e.fixes.length&&!!(n||e.isStyleError||e.isRecommendation||e.isSpellingError)&&(e.isStyleError?s:!e.isRecommendation||r)))}async _fixAllErrors(e){const t=e.inputAreaTweaks.getFixAllErrorsLimit(e);if(t<=0)return;let n=this._getFixableErrorsForFixAll(e);if(!n)return;const s=Math.min(n?.length||0,t);e.isApplyingFixAll=!0;const r=performance.now();try{for(let t=s-1;t>=0&&(n=this._getFixableErrorsForFixAll(e),!e.isUserTyping);t--){if(!n||!n.length)return;const s=n[t];if(!s)return;const r=0;await this._fixSelectedError(e,s,r,!1,!1,!0,!0)}const t=performance.now()-r,i=Math.round(t/s);s>0&&m.TrackerAdapter.trackFixAllMetrics({timeTaken:t,errorCount:s,averageTimePerError:i,fixAllVersion:"v2"})}catch(e){console.error("fix all failed",e)}e.isApplyingFixAll=!1,n=this._getFixableErrorsForFixAll(e);const i=0===n.length&&!1===e.isUserTyping;e.checkDebounce.call(e,e.inputAreaWrapper.getText(),void 0,i),e.checkDebounce.callImmediately()}async _applyFix(e,t,n,s=!1,r=!1){const i=t.fixes[n],o=i.value,a=i.htmlValue,l={offset:t.start,length:t.length,replacementText:o,editor:e,useCustomWaitTime:r,replacementHtml:a};e.callbacks.onBeforeErrorCorrect&&e.callbacks.onBeforeErrorCorrect(t,n),this._endTypingMode(e),this._removeError(e,t),e.isApplyingFix=!0;const c=await e.inputAreaTweaks.replaceText(l);return e.isApplyingFix=!1,s||this._afterApplyFix(e,(0,v.getErrorType)(t),t.rule.isPremium),c}_afterApplyFix(e,t,n){this._checkEditor(e,e.inputAreaWrapper.getText(),!1,!1)||e.checkDebounce.callImmediately();const{appliedSuggestions:s}=this._storageController.getStatistics();this._storageController.updateStatistics({appliedSuggestions:s+1}),e.userActivity?.incrementSuggestionsApplied(t,n),this._trackFaultyTextReplacement(e)}_removeError(e,t){t.isRecommendation?e.recommendationErrors=e.recommendationErrors.filter((e=>e.id&&t.id&&e.id!==t.id)):e.errors=e.errors.filter((e=>e.id&&t.id&&e.id!==t.id))}_toggleCardMode(e){const{editor:t,currentMode:n,previousMode:s,anchorSelection:r,highlightType:i,triggerType:o,toolboxTriggerType:a}=e,l=("toolbox"===s||"correct"===s&&"gc-card"===a?this._getErrorAt(t,r.start):this._getErrorAfter(t,r.start-1))||void 0,c="correct"===n&&(0,v.isNumber)(l?.start)&&(0,v.isNumber)(l?.end)?{start:l.start,end:l.end}:r;let d,h,u;if(t.inputAreaWrapper.setSelection({start:c.start??c.end}),"paraphrase"===n){const e=this._getRephraseCardData(t,"sentence");if(this._unselectError(t),t.card?.setRephraseCardArguments(e,c),t.card&&i&&t.card?.currentTextHighlightType!==i){t.card.currentTextHighlightType=i;const e=t.inputAreaWrapper.getSelectionWithFallback()||{start:0},n=(0,_.optionallySanitizeDanglingSelection)(t.inputAreaWrapper.getText(),t.currentSentenceRanges,c||e),s=(0,v.getSentenceRangeBySelection)(t.currentSentenceRanges,n);s&&(c.end=s.end,c.start=s.start)}const n=c.end??c.start;d=this._scrollToSentence(t,{start:c.start,end:n}),h=this._getTargetBoxForCardMode(t,"paraphrase",!1)??void 0}else if("toolbox"===n){const e=this._getToolboxCardData(t,a);this._unselectError(t),t.card?.setToolboxCardArguments(e,c),d=this._scrollToSentence(t,{start:c.start},!1),h=this._getTargetBoxForCardMode(t,"toolbox",!1)??void 0}else if(l){const e=this._getErrorCardData(t,l);t.selectedErrorId=l.id||null,u=l.id,t.card?.setErrorCardArguments(e),d=this._scrollToError(t,l,"center",!0)}else{const e=this._getErrorCardData(t);
444t.selectedErrorId=null,t.card?.setErrorCardArguments(e),d=Promise.resolve()}d.then((()=>{const e=u?t.highlighter.getTextBoxes(u)[0]:h;t.card?.changeMode(n,e,o)}))}_openPremiumPage(e,t){const n=e.displayedPremiumErrors.filter((e=>!e.isStyleError&&!e.isPunctuationError)).length,s=e.displayedPremiumErrors.filter((e=>e.isPunctuationError)).length,r=e.displayedPremiumErrors.filter((e=>e.isStyleError)).length,i=e.language&&e.language.code||void 0;l.EnvironmentAdapter.openPremiumPage(t,n,r,s,"",i)}_correctMultipleErrors(e,t,n){const{selectErrorAfter:s}=e,r=t[0];let i=!1;e.isCorrectingMultiple=!0;const o=e=>{e.isTrusted&&!i&&(i=!0,a())},a=()=>{e.inputArea.removeEventListener("keydown",o),e.isCorrectingMultiple=!1,e.selectErrorAfter=s,this._afterApplyFix(e,(0,v.getErrorType)(r),r.rule.isPremium)};e.inputArea.addEventListener("keydown",o);const l=(s=!1)=>{if(i)return;const r=t.shift();if(!r)return void a();let o=Promise.resolve();s||(o=o.then((()=>(0,_.wait)(150))).then((()=>i?Promise.reject():this._scrollToError(e,r,"center")))),o=o.then((()=>
444{if(i)return Promise.reject();const t=r.fixes.findIndex((e=>n.suggestion.match.test(e.value)));return-1===t?Promise.resolve():this._applyFix(e,r,t,!0)})).then((()=>l())).catch((()=>a()))};l(!0)}_applySynonym(e,t){const{source:n,selection:{start:s,end:r}}=t;if(!n||"number"!=typeof s)return;e.callbacks.onBeforeRephrasingApply&&e.callbacks.onBeforeRephrasingApply(t);const i=n.replace(n.trim(),t.replacement),o=r??s,{offset:a,length:l}=e.inputAreaWrapper.findReplacementPosition(s,o-s,i);e.appliedChange={originalText:n,replacementText:i,start:a,end:a+l,ruleCategory:{id:"phrasing",name:"phrasing"},ruleId:"REPHRASING",isRecommendation:!1},e.inputAreaTweaks.replaceText({offset:s,length:o-s,replacementText:i,editor:e}).finally((()=>{e.appliedChange=void 0})),this._temporarilyIgnoreWord(e,t.replacement),(0,_.wait)(100).then((()=>e.checkDebounce.callImmediately()));const{appliedSynonyms:c}=this._storageController.getStatistics();this._storageController.updateStatistics({appliedSynonyms:c+1}),m.TrackerAdapter.trackEvent("Action","synonyms:applied",d.LanguageManager.getPrimaryLanguageCode(e.language?.code||"unknown"))}_applyRephrasing(e,t,n){const{replacement:s,selection:{start:r,end:i},source:o}=t;if(!s||"number"!=typeof r||"number"!=typeof i)return;!0!==n.reverted&&this._updateRemainingRephrasings(),e.callbacks.onBeforeRephrasingApply&&e.callbacks.onBeforeRephrasingApply(t);const{offset:a,length:l}=e.inputAreaWrapper.findReplacementPosition(r,i-r,s);e.appliedChange={originalText:o,replacementText:s,start:a,end:a+l,ruleCategory:{id:"phrasing",name:"phrasing"},ruleId:"REPHRASING",isRecommendation:!1},e.lineHighlights=[],e.inputAreaTweaks.replaceText({offset:r,length:i-r,replacementText:s,editor:e}).then((()=>{!0!==n.selectSentenceAfter&&this._flashHighlight({editor:e,color:T.COLORS.NEW_SENTENCE.BACKGROUND,duration:1500,offset:r,length:s.length}),e.checkDebounce.callImmediately()})).finally((()=>{e.appliedChange=void 0})),e.userActivity?.incrementRewritingsApplied();const c=d.LanguageManager.getPrimaryLanguageCode(e.language?.code||"unknown"),h=!0===n.reverted?"reverted":"selected";m.TrackerAdapter.trackEvent("Action",`rephrasesV3:${h}`,`${c}:${n.label}`)}_applySentenceSuggestion(e,t,n,s,r){const{replacement:i,selection:{start:o,end:a}}=t;if(!i||"number"!=typeof o||"number"!=typeof a)return;e.callbacks.onBeforeErrorCorrect&&e.callbacks.onBeforeErrorCorrect(s,0),e.lineHighlights=[],e.inputAreaTweaks.replaceText({offset:o,length:a-o,replacementText:i,editor:e}).then((()=>{this._flashHighlight({editor:e,color:T.COLORS.NEW_SENTENCE.BACKGROUND,duration:1500,offset:o,length:i.length}),e.checkDebounce.callImmediately()}));const l=!0===n.reverted?"reverted":"selected";m.TrackerAdapter.trackEvent("Action",`${n.language}:apply_rule`,s.rule.id),m.TrackerAdapter.trackEvent("Action",`${r}:${l}`,`${n.language}:${n.label}`)}onUnlockSuggestion(e,t){const n=this._editors.find((e=>e.id===this._userActiveEditorId));if(n)return this._unlockSuggestionBase(e,n,t)}_retrieveLanguageFromEditor(e){if(!e.isLanguageSupported||e.isTextTooLong)return Promise.resolve();const[t,n]=[333,31];return e.retrieveLanguageAbortController=new AbortController,(0,v.waitFor)((()=>e.language?e.language.code:e.isTextTooShort?d.LanguageManager.getUserLanguageCodes()[0]||"en":e.errors[0]?e.errors[0].language.code:void 0),t,n,e.retrieveLanguageAbortController.signal).catch((e=>{"AbortError"!==e?.name&&m.TrackerAdapter.trackError("js","failed_to_get_language_from_editor",e?.message??void 0)})).finally((()=>{e.retrieveLanguageAbortController=null}))}async _loadRephrasings(e,t){if(e.isRewriteModeDisabled)return;const n=await this._retrieveLanguageFromEditor(e);if(!n)return;const s=d.LanguageManager.getPrimaryLanguageCode(n),{username:r,token:i,remainingRephrasingsAmount:o}=this._storageController.getSettings(),a=r?{email:r,token:i}:void 0;if(0===o)return e.rephrasings={...e.rephrasings,state:"limit_reached"},this._updateState(e),void m.TrackerAdapter.trackEvent("Action","rephrasesV3:limit_reached",s);const{hasOptedIntoThirdPartyAiParaphrasing:c}=this._storageController.getPrivacySettings(),h=!c;let u=!1,g=!1,p="unknown error";const{rephrases:_}=await l.EnvironmentAdapter.loadPhrases(this._storageController.getUniqueId(),t,s,h,a).catch((e=>(g=e.message===T.HTTP_ERROR_ABORT,u=!0,p=g?"request_aborted":p,{rephrases:[]}))),E=_.map((n=>{let s=(0,k.createDiff)(t,n.text);return e.simplifyRephrasingDiff&&(s=k.Diff.simplifyReplacements(s)),Object.assign(n,{diff:k.Diff.isRewrite(s)?null:s})}
444));g||(e.rephrasings={...e.rephrasings,state:u?"failed":"succeeded",result:E,source:t},this._updateState(e),!1===u?m.TrackerAdapter.trackEvent("Action","rephrasesV3:request_succeeded",s):m.TrackerAdapter.trackError("http","rephrasesV3:request_failed",`${s}:${p}`),e.rephrasings.result.length||m.TrackerAdapter.trackEvent("Action","rephrasesV3:request_empty",s))}async _loadSynonyms(e,t){const n=d.LanguageManager.getSynonymsRequestLanguage(e.language?.code||"");if(!n)return;let s=!1;const{motherTongue:i}=this._storageController.getSettings(),o=await l.EnvironmentAdapter.loadSynonyms(t,n,i).catch((e=>(m.TrackerAdapter.trackError("http",e.message,"src/content/ltAssistant.ts"),s=!0,r.Synonyms.emptySynonymResult)));e.synonyms={...e.synonyms,result:o,state:s?"failed":"succeeded"},this._updateState(e)}_highlightSentenceFromHover(e,t){if(e.isRewriteModeDisabled)return;const n=e.inputAreaWrapper.getSelection(),s=e.lineHighlights.find((({id:e})=>"LINE_HIGHLIGHT_SENTENCE_FROM_CARET"===e)),r=s?s.offset:Number.POSITIVE_INFINITY,i=s?s.offset+s.length:Number.NEGATIVE_INFINITY,o=e=>e&&r<=e.start&&i>=e.end,a=e.inputAreaWrapper.getWordAtPoint(t.x,t.y),l=e.currentSentenceRanges?.find((({start:e,end:t})=>{const s=o({start:e,end:t});return(null===n||!1===s)&&a&&a.start>=e&&a.end<=t}));e.lineHighlights=e.lineHighlights.filter((({id:e})=>e.endsWith("_FROM_CARET")))||[],l&&e.lineHighlights.push({id:"LINE_HIGHLIGHT_SENTENCE_FROM_HOVER",isEmphasized:!0,isUnderlined:!1,offset:l.start,length:l.length,highlightStylingType:O.HighlightStylingType.sentence_from_hover}),o(a)&&e.lineHighlights.push({id:"LINE_HIGHLIGHT_WORD_FROM_HOVER",isEmphasized:!0,isUnderlined:!1,offset:a.start,length:a.end-a.start,highlightStylingType:O.HighlightStylingType.word_from_hover}),this._highlight(e,!0)}_highlightSentenceFromClick(e){if(e.isRewriteModeDisabled)return;const t=e.inputAreaWrapper.getSelection(),n=t&&t.start===t.end,{position:s,word:r,...i}=n&&(0,v.getWordContext)(e.inputAreaWrapper.getText(),t.start,t.end,e.sentenceRanges)||{position:null,word:null,beforeText:"",afterText:""},o=(0,v.getSentenceRangeBySelection)(e.currentSentenceRanges,t?{start:t.start}:void 0);if(e.lineHighlights=[],o&&(e.lineHighlights.push({id:"LINE_HIGHLIGHT_SENTENCE_FROM_CARET",isEmphasized:!0,isUnderlined:!0,offset:o.start,length:o.length,highlightStylingType:O.HighlightStylingType.sentence_from_caret}),s&&e.lineHighlights.push({id:"LINE_HIGHLIGHT_WORD_FROM_CARET",isEmphasized:!0,isUnderlined:!0,offset:s.start,length:s.end-s.start,highlightStylingType:O.HighlightStylingType.word_from_caret})),this._highlight(e,!0),o&&!1===e.isUserTyping){const t=e.checkedText.text.slice(o.start,o.end),{length:n,...a}=o,l=e.rephrasings.source!==t,c=!1===l&&e.rephrasings.selection.start!==a.start;e.rephrasings.selection=a,(!e.rephrasings.source||l||c)&&(e.rephrasings={...e.rephrasings,state:"loading",source:t},this._loadRephrasings(e,t)),s&&(e.synonyms.selection=s,e.synonyms.source&&e.synonyms.source===r||(e.synonyms={...e.synonyms,state:"loading",source:r},this._loadSynonyms(e,{word:r,position:s,...i}))),this._updateState(e)}}_highlightNeighborSentence(e,t,n){const s=e.lineHighlights.findIndex((({id:e})=>e.endsWith("LINE_HIGHLIGHT_SENTENCE_FROM_CARET")));if(s<0)return;const r=e.lineHighlights[s];e.lineHighlights.splice(s,1);const i={start:r?.offset,end:r?.offset+r?.length},o=this._getNeighborSentence(e,i,t);o&&(e.lineHighlights.push({id:"LINE_HIGHLIGHT_SENTENCE_FROM_CARET",isEmphasized:!0,isUnderlined:!0,offset:o.start,length:o.end-o.start,highlightStylingType:O.HighlightStylingType.sentence_from_caret}),"previous"===t?e.inputAreaWrapper.setSelection({start:o.start,end:o.end}):e.inputAreaWrapper.setSelection({start:o.end}),this._scrollToSentence(e,o,n),this._highlightSentenceFromClick(e))}_removeSentenceHighlights(e,t="all"){if(this._isInteractionModeRewrite(e)){const{length:n}=e.lineHighlights;e.lineHighlights=e.lineHighlights.filter((({id:e})=>{switch(t){case"hover":return!1===e.endsWith("_FROM_HOVER");case"caret":return!1===e.endsWith("_FROM_CARET");default:return!1}})),e.lineHighlights.length<n&&(e.hoverDebounce.cancelCall(),this._highlight(e,!0),this._updateState(e))}}_clearRewritingData(e){const t=Object.assign(e,{synonyms:{state:null,source:null,result:r.Synonyms.emptySynonymResult,selection:{}},rephrasings:{state:null,result:[],source:null,selection:{}}});return this._updateState(t),t}_getRemainingRephrasings(){if(this._storageController.isPremium())return null;const{remainingRephrasingsAmount:e,remainingRephrasingsDate:t}=this._storageController.getSettings(),n="string"==typeof t?new Date(t):new Date,s=(0,_.isYesterdayOrEarlier)(n),r={};return(null===e||s)&&(r.remainingRephrasingsAmount=T.MAX_FREEMIUM_REPHRASINGS_PER_DAY),(null===t||s)&&(r.remainingRephrasingsDate=(new Date).toISOString()),Object.keys(r).length&&this._storageController.updateSettings(r),this._storageController.getSettings().remainingRephrasingsAmount}_updateRemainingRephrasings(){const{remainingRephrasingsAmount:e}=this._storageController.getSettings();e&&this._storageController.updateSettings({remainingRephrasingsAmount:Math.max(0,e-1)})}hasTemporarilyDisabledInputAreas(){return!!this._temporaryDisabledEditorGroups.length||this._getCheckSettings().isEditorGroupDisabled}
444resetEditor(){this._editors.forEach((e=>{this._resetEditor(e),this._endTypingMode(e),this._checkEditor(e,!0),this._highlight(e),this._updateState(e)}))}hideAllEditorCards(){this._hideAllEditorCards()}showRephraseCard(e,t="word",n="system"){const s=this._editors.find((e=>e.id===this._userActiveEditorId));if(!s)return;const{start:r,end:i=r}=e;if("correct"===s.card?.mode)return void this._toggleCardMode({editor:s,previousMode:"correct",currentMode:"paraphrase",anchorSelection:e});const o=s.inputAreaWrapper.getTextBoxes(r,i-r);this._showRephraseCard(s,o,e,n,!1,t)}clearTemporarilyDisabledInputAreas(){this._temporaryDisabledEditorGroups.length=0,this._storageController.enableEditorGroup((0,v.getMainPageDomain)(),this._tweaks.getEditorGroupId((0,v.getCurrentUrl)())),document.activeElement instanceof HTMLElement&&this._initElement(document.activeElement)}_shouldLollipopPulsate(e,t){let n=e.inputAreaWrapper.getText();return t&&(n=n.trim()),!(this._options.zenMode||0!==n.length||"toolbox"===e.card?.mode||this._storageController.getUIState().hasClickedLollipop&&!this._toolboxAdoptionExperimentVersion())}setZenMode(e,t){this._options.zenMode=e,(t?[t]:this._editors).forEach((t=>{e?(t.lollipop?.setProximityThreshold(0),t.lollipop?.setForceSuppressDilateOnSystemEvents(!0),t.lollipop?.stopPulsating()):(this.enableEditorHighlight(t.id),this.setEditorUnderlineOpacity(t.id),t.lollipop?.setProximityThreshold(20),t.lollipop?.setForceSuppressDilateOnSystemEvents(!1),this._startLollipopPulsating(t))}))}_initLollipop(e){if(!this._isConnected)return null;if(!N.AdvancedToolboxAdapter.canSeeLollipop(this._storageController))return null;if(!(e.inputArea instanceof HTMLElement||e.inputArea instanceof SVGElement))return null;if(location.href.includes("/webextension/welcome/finish"))return null;if(!this._hasLollipopEnabled())return null;if(!S.default.supports(e.inputArea))return null;if(!e.isAutoCheckEnabled)return null;if(e.lollipop)return null;this._loadLollipopStyles();const t=e.mirror?.getTextElement();let n=this._storageController.getSettings().openCardHotkey;"Control"===n&&(n=l.EnvironmentAdapter.getUILanguageCode().startsWith("de")?"STRG":"CTRL");const s=n?` <lt-span class="lt-lpop__tooltip__hint">(${c.i18nManager.getMessage("toolboxKeyboardShortcut",n)})</lt-span>`:"",r=this._toolboxAdoptionExperimentVersion(),i={mirror:t,tooltip:`<lt-span class="lt-lpop__tooltip">${c.i18nManager.getMessage("toolboxTooltip")}${s}</lt-span>`,theme:I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).LOLLIPOP_THEME,brandIcon:l.EnvironmentAdapter.getURL(I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).LOLLIPOP_CIRCLE_IMAGE_PATH),brandIconGdocs:l.EnvironmentAdapter.getURL(I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).LOLLIPOP_CIRCLE_GDOCS_IMAGE_PATH),...!!r&&{dilateProximityThreshold:20},..."c"===r&&{shouldDilateOnSelection:!0},..."c"===r&&!this._storageController.getSettings().hasSynonymsEnabled&&{shouldDilateOnSelectionWithDoubleClick:!0}},o=new S.default(e.inputArea,i);return o.on("click",(t=>{const n=t.event.type.startsWith("key")?"keyboard":"mouse";this._onLollipopClick(e,n)})),o.on("mouseenter",(t=>{this._onLollipopMouseEnter(t.lollipopStateBeforeMouseEnter,e)})),o.on("mouseleave",(()=>{this._onLollipopMouseLeave(e)})),o.on("dilate",(e=>{this._onLollipopMouseDilate(e.dilateReason)})),o.on("selectionend",(t=>{this._onLollipopSelectionEnd(e,t.trigger)})),e.lollipop=o,this.setZenMode(this._options.zenMode??!1,e),o}_startLollipopPulsating(e){this._shouldLollipopPulsate(e,!0)&&(e.lollipop?.startPulsating(),this._trackSampledLollipopEvent("pulsate"))}_trackSampledLollipopEvent(e,t){const n=I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).TRACKING_SAMPLING_RATE;m.TrackerAdapter.trackSampledEvent("Lollipop",e,t,n)}_trackSampledToolboxEvent(e,t){const n=I.default.get(I.ConfigKey.LOLLIPOP_CONFIG).TRACKING_SAMPLING_RATE;m.TrackerAdapter.trackToolboxEvent(e,t,n)}_openToolbox(e,t,n,s=!1){const r=n||e.inputAreaWrapper.getSelection(!0);r?(m.TrackerAdapter.trackSampledEvent("Toolbox","trigger_type",t),this._hideAllEditorCards(),e.lollipop?.stopPulsating(),e.lollipop?.resetDilate(),clearTimeout(e.lollipopDilateScheduleTimeoutId),e.lollipopDilateScheduleTimeoutId=void 0,e.lollipop?.freezeClickState(),this._showToolboxCard(e,r,"click",t,s)):m.TrackerAdapter.trackEvent("Toolbox","no_selection_found",document.domain)}showingCurrentEditorDialog(){const e=this._editors.find((e=>e.id===this._userActiveEditorId));return Boolean(e?.dialog)}showingEditorDialog(){const e=this._editors.find((e=>e.dialog));return Boolean(e)}_getDialogProps(){const e=h.LocalStorageWrapper.get("dialog:coordinates"),t=h.LocalStorageWrapper.get("dialog:position"),n=A.Dialog.getValidatedCoordinates(e);return this._options.dialog?.draggable&&n&&"coordinates"===t?{coordinates:n,dialogPosition:t}:{coordinates:void 0,dialogPosition:this._storageController.getUIState().dialogPosition}}getDialogProps(){if(this._editors.find((e=>e.id===this._userActiveEditorId)))return this._getDialogProps()}_checkForUninitializedInputAreas(){this._options.ignoreFocus||(this._monitorUninitializedInputAreasIntervalId&&this._stopCheckingForUninitializedInputAreas(),this._monitorUninitializedInputAreasIntervalId=self.setInterval((()=>{const e=(0,_.getActiveElement)();(e instanceof HTMLElement||e instanceof SVGElement)&&this._initElement(e)}),750))}_stopCheckingForUninitializedInputAreas(){clearInterval(this._monitorUninitializedInputAreasIntervalId),this._monitorUninitializedInputAreasIntervalId=void 0}_trackFaultyTextReplacement(e){const t=e.appliedChange;if(!t)return;const n=e.inputAreaWrapper.getText(),{start:s,end:r,replacementText:i,textBeforeCorrection:o=e.checkedText.originalText}=t;(0,_.isFixAppliedToText)(n,o,i,s,r)||(0,_.trackHealthMetric)("incorrect_text_replacement",1)}isEditorTextTooLong(e=this._userActiveEditorId){const t=this._editors.find((t=>t.id===e));return!!t&&t.inputAreaWrapper.isTextTooLong()}
444_trackSuggestionRangeMismatches(e){const t=e.displayedErrors,n=e.inputAreaWrapper.getText(),s=(0,_.simpleTextHash)(n);void 0!==this._suggestionRangeMetrics.cache.previousErrorsLength&&void 0!==this._suggestionRangeMetrics.cache.previousTextHash&&t.length===this._suggestionRangeMetrics.cache.previousErrorsLength&&s===this._suggestionRangeMetrics.cache.previousTextHash||(this._suggestionRangeMetrics.cache.previousErrorsLength=t.length,this._suggestionRangeMetrics.cache.previousTextHash=s,(0,_.validateTextErrorsAsync)(t,n,(e=>{if(!e.isMatch){const t=`${e.error.id}:${e.error.start}:${e.error.length}:${e.actualText}:${e.expectedText}`,n=`${e.error.id}`;this._suggestionRangeMetrics.trackedMismatches.has(t)||(this._suggestionRangeMetrics.trackedMismatches.add(t),(0,_.trackHealthMetric)("suggestion_range_mismatch",1)),this._suggestionRangeMetrics.trackedMismatches.has(n)||(this._suggestionRangeMetrics.trackedMismatches.add(n),(0,_.trackHealthMetric)("suggestion_range_mismatch_unique_id",1),m.TrackerAdapter.trackUnderlineMismatchMetrics({offset:e.error.start,length:e.error.length,actualText:e.actualText,expectedText:e.expectedText}))}})))}}ee.events={UPDATE:`_${Q}-state-updated`,DESTROY:`_${Q}-destroy`},ee.PUNCTIUATION_CHAR_REGEXP=/^[.!?]$/,ee.QUOTATION_RULE_IDS_REGEXP=/UNPAIRED_BRACKETS|UNPAIRED_QUOTES|FALSCHES_ANFUEHRUNGSZEICHEN/,ee.CONSECUTIVE_SPACE_REGEXP=/^(\u00A0 | \u00A0|\u00A0\u00A0)$/,ee.COMPLETED_SENTENCE_REGEXP=/^[^\n]*?[.!?]($|\s)/,ee.NO_LETTERS_REGEXP=/^[0-9,\.\-\:\;\+\*\/\\\%#\=\_]+$/,ee.TMP_ID_ATTRIBUTE_NAME=I.default.get(I.ConfigKey.TMP_ID_ATTRIBUTE),ee.ERROR_BLOCK_ID_REGEX=/^error:\d+(?:_part_0)?$/},
444"./content/mirror.ts":
445/*!***************************!*\
446  !*** ./content/mirror.ts ***!
447  \***************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Mirror:()=>i});var s=n(/*! ../init/config */"./init/config.ts");
448/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */const r=s.default.get(s.ConfigKey.EXTN_PREFIX);class i{constructor(e,t){this._mimickedElement=e,this._tweaks=t}}i.eventNames={input:`${r}-mirror.input`,click:`${r}-mirror.click`,mousemove:`${r}-mirror.mousemove`},i.FLEX_GRID_DISPLAY_VALUES=["grid","inline-grid","flex","inline-flex"]},
448"./content/recommendationController.ts":
449/*!*********************************************!*\
450  !*** ./content/recommendationController.ts ***!
451  \*********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{RecommendationController:()=>c});var s=n(/*! ../core/ErrorProcessor */"./core/ErrorProcessor.ts"),r=n(/*! ../core/utils */"./core/utils.ts"),i=n(/*! ../config/config */"./config/config.ts"),o=n(/*! ../common/utils */"./common/utils.ts"),a=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),l=n(/*! ./checkStatus */"./content/checkStatus.ts");class c{constructor(e,t={}){this._reRequestRecommendationForSentence=async(e,t)=>{const{preSentenceRange:n,postSentenceRange:s}=this._getPreAndPostSentenceRange({sentenceRanges:t.currentSentenceRanges||[],targetSentenceRange:e}),i=t.inputAreaWrapper.getText(),o=t.inputAreaTweaks.getReplacedParts(i),l=(0,r.getValuableText)(i,o),c=this._getChangedParagraphs("",l.text),d=this._getParagraphForSentenceRange({paragraphs:c,sentenceRange:e}),h=this._migrateSentenceInfoToCheckTextRanges([{preSentence:n,postSentence:s,sentence:e,paragraph:d}],t.checkedText.usedParts);return(await a.EnvironmentAdapter.fetchRecommendationForSentence({editorText:l.text,sentencesInfo:h,instanceId:t.id,language:t.language,isForcedRecommendation:!0,rteMap:t.inputAreaWrapper.getRteMap(),writingGoalId:t.writingGoalId})).paragraphLevelErrors||[]},this._updateFixesValue=(e,t,n,s)=>{["recommendationErrors","displayedErrors","errors"].forEach((r=>{const i=s[r],o=i.findIndex((e=>e.id===t));if(-1!==o&&i[o].fixes[0]){const t=[...i];t[o].fixes[0].value=e,t[o].isLocked=n,s[r]=t}}))},this.unlockSuggestion=async(e,t)=>{if((0,o.trackHealthMetric)("sneak-peek-unlock-error",-1),!e.id)return void(0,o.trackHealthMetric)("sneak-peek-unlock-error",0);if(e.id&&e.isLocked&&e.fixes[0].value&&(0,o.trackHealthMetric)("sneak-peek-unlock-error",15),await this._tryUnlockRecommendation(e,t))return(0,o.trackHealthMetric)("sneak-peek-unlock-error",100),!0;const n=e.start,s=e.end,r=t.currentSentenceRanges.find((e=>e.start<=n&&s-1<=e.end));if(!r)return void(0,o.trackHealthMetric)("sneak-peek-unlock-error",21);const i=await this._reRequestRecommendationForSentence(r,t),a=i.find((e=>e.start===n&&e.end===s));if(!a)throw t.recommendationErrors=t.recommendationErrors.filter((t=>t.id!==e.id)),t.errors=t.errors.filter((t=>t.id!==e.id)),t.displayedErrors=t.displayedErrors.filter((t=>t.id!==e.id)),i.length?(0,o.trackHealthMetric)("sneak-peek-unlock-error",22):(0,o.trackHealthMetric)("sneak-peek-unlock-error",23),Error("Recommendation not found for the range");if(a.isLocked&&a.fixes[0].value){this._updateFixesValue(a.fixes[0].value,e.id,a.isLocked,t);const n=t.displayedErrors.find((t=>t.id===e.id));if(n)return this._tryUnlockRecommendation(n,t);(0,o.trackHealthMetric)("sneak-peek-unlock-error",24)}else(0,o.trackHealthMetric)("sneak-peek-unlock-error",25)},this._options={isContextualHighlightDisabled:!1,delay:i.CHECK_RECOMMENDATION_DELAY,...t},this._controllerOptions=e,this._overlappingErrorsConfig=e.overlappingErrorsConfig}_isOverlappingErrorsEnabled(){return!!this._overlappingErrorsConfig?.enabled}filterOutOverlappingError(e,t){const n=[];for(const s of t)e.some((e=>e.start>=s.start&&e.start<=s.end))||n.push(s);return n}_filterErrorsOnTextChange({editor:e,errors:t,sentenceRanges:n,currentText:s,previousText:i}){const o=(0,r.getTextsDiff)(i,s);if(!t.length)return[];if(!o)return t;const a=e.appliedChange?e.appliedChange:void 0;let l,c=o.from,d="modification";""!==o.oldFragment&&""===o.newFragment?(c=o.from+o.oldFragment.length,d="deletion",o.oldFragment.endsWith("\n\n")&&(c-=1)):""===o.oldFragment&&""!==o.newFragment?(c=o.from,d="insertion",o.newFragment.endsWith("\n\n")&&(c-=1)):(c=o.from+o.oldFragment.length,d="modification"),l=a?n.find((e=>a.start>=e.start&&a.end<=e.end)):n.find((e=>c>=e.start&&c<=e.end));const{postSentenceRange:h,preSentenceRange:u}=this._getPreAndPostSentenceRange({sentenceRanges:n,targetSentenceRange:l});if("insertion"===d&&l&&l.end===o.from&&!h&&(l=void 0),a&&a.isRecommendation&&a.ruleIssueType===r.RULE_ISSUE_TYPES.PHRASAL_RECOMMENDATION&&(l=void 0),this._options.isContextualHighlightDisabled){const e=[];return t.forEach((t=>{const n=l&&t.start>=l.start&&t.end<=l.end,s=u&&t.start>=u.start&&t.end<=u.end,r=h&&t.start>=h.start&&t.end<=h.end;n||s||r||e.push(t)})),e}return t.filter((e=>!(l&&e.start>=l.start&&e.end<=l.end)))}_getErrorFreeSentenceRange({sentenceRanges:e,errors:t,recommendationErrors:n}){const s=[];return e.length?(e.forEach((e=>{const r=t.some((t=>t.start>=e.start&&t.end-1<=e.end)),i=n.some((t=>t.start>=e.start&&t.end<=e.end));r||i||s.push(e)})),s):[]}_getPreAndPostSentenceRange({sentenceRanges:e,targetSentenceRange:t}){if(!t)return{preSentenceRange:void 0,postSentenceRange:void 0};const n=e.filter((e=>e.end<=t.start-1)),s=e.filter((e=>e.start>=t.end+1));let r,i;if(n.length>1){const e=n[n.length-1],t=n[n.length-2];r={...e,start:t.start,length:e.end-t.start}}else 1===n.length&&(r=n[0]);if(s.length>1){const e=s[0],t=s[1];i={...e,end:t.end,length:t.end-e.start}}else 1===s.length&&(i=s[0]);return{preSentenceRange:r,postSentenceRange:i}}_getParagraphForSentenceRange({paragraphs:e,sentenceRange:t}){return e.find((e=>t.start>=e.offset&&t.end<=e.offset+e.text.length))}_getChangedParagraphRecommendationSentenceRanges({changedParagraphs:e,sentenceRanges:t}){if(!e.length)return t;const n=e.map((e=>({start:e.offset,end:e.offset+e.text.length}))),s=[];for(const e of n){const n=t.filter((t=>t.start>=e.start&&t.end<=e.end));s.push(...n)}return s}_discardErrorsForChangedContext({editor:e,valuableText:t,sentencesInfo:n,errors:i}){const o=e.inputAreaWrapper.getText(),a=[],l=new Set,c=t.text,d=o;if(c===d)return i.map((e=>{if(e.rule.issueType===r.RULE_ISSUE_TYPES.PHRASAL_RECOMMENDATION){const t=n.find((t=>e.start>=t.sentence.start&&e.end<=t.sentence.end));if(t){const n=e.start-t.sentence.start;return this._isOverlappingErrorsEnabled()?{...e,start:t.sentence.start,end:t.sentence.end,relativeOffset:n}:{...e,relativeOffset:n}}}return e}));function h(e){const t=`${e.start}-${e.end}`;if(l.has(t))return!0;const n=0===s.ErrorProcessor.migrateOffsetsBetweenTexts([e],c,d,!1,!0).length;return n&&l.add(t),n}function u(e){const{sentence:t,preSentence:n,postSentence:s}=e,r=h(t),i=n?h(n):d.slice(t.start,t.end)!==c.slice(t.start,t.end),o=s?h(s):d.slice(t.end
451).trim().length>0;return i||r||o}for(const e of i){const t=n.find((t=>e.start>=t.sentence.start&&e.end<=t.sentence.end));if(t&&!u(t))if(e.rule.issueType===r.RULE_ISSUE_TYPES.PHRASAL_RECOMMENDATION){const n=e.start-t.sentence.start;a.push({...e,relativeOffset:n})}else a.push(e)}return a}_migrateSentenceInfoToCheckTextRanges(e,t){return e.map((e=>{const n=e.preSentence?s.ErrorProcessor.migrateOffsetsToValuableText([e.preSentence],t)[0]:void 0,r=e.postSentence?s.ErrorProcessor.migrateOffsetsToValuableText([e.postSentence],t)[0]:void 0,i=s.ErrorProcessor.migrateOffsetsToValuableText([e.sentence],t)[0];return{...e,preSentence:n??e.preSentence,postSentence:r??e.postSentence,sentence:i??e.sentence}}))}async _sendRecommendationRequestForSentence({editor:e,valuableText:t,sentencesInfo:n,isForcedRecommendation:s}){if(e.isRecommendationsDisabled)return;const r=Date.now();e.recommendationStatus=l.CHECK_STATUS.IN_PROGRESS,this._controllerOptions.updateState(e);try{const i=this._migrateSentenceInfoToCheckTextRanges(n,e.checkedText.usedParts),o=await Promise.race([a.EnvironmentAdapter.fetchRecommendationForSentence({editorText:t.text,sentencesInfo:i,instanceId:e.id,language:e.language,isForcedRecommendation:s,rteMap:e.inputAreaWrapper.getRteMap(),writingGoalId:e.writingGoalId,writingSessionId:e.writingSessionId}),e.recommendationRequestAbortController.signal]);if(!o||"Aborted"===o)return;if(e.id!==o.instanceId)return;const l=this._discardErrorsForChangedContext({editor:e,sentencesInfo:n,valuableText:t,errors:o.paragraphLevelErrors||[]});o.paragraphLevelErrors=l,this._onRecommendationCompleted({editor:e,result:o,valuableText:t,isForcedRecommendation:s,recommendationTimestamp:r})}catch(t){if(console.log("Error fetching recommendation for sentence",t),e.recommendationStatus=l.CHECK_STATUS.COMPLETED,"Aborted"===t.message)return;t.message&&(0,o.isExtensionRuntimeError)(t.message)?this._controllerOptions.handleUnhealthyExtensionRuntime():this._controllerOptions.updateState(e)}}async _sendRecommendationRequest({editor:e,text:t,isForcedRecommendation:n,ignoreSentenceRanges:i}){if(e.isRecommendationsDisabled)return;const o=e.inputAreaTweaks.getReplacedParts(t),a=(0,r.getValuableText)(t,o);if(a.text===e.recommendationCheckedText.text)return void this.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:a,appliedFix:null});const l=this._getChangedParagraphs(e.recommendationCheckedText.text,a.text),c=this._getChangedParagraphRecommendationSentenceRanges({changedParagraphs:l,sentenceRanges:e.sentenceRanges||[]}).filter((e=>!i.find((t=>e.start===t.start&&e.end===t.end)))),d=s.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors||[],e.recommendationCheckedText.originalText,a.text,!1,!0),h=this._getErrorFreeSentenceRange({sentenceRanges:c,errors:this._isOverlappingErrorsEnabled()?[]:e.errors,recommendationErrors:d});s.ErrorProcessor.sortSentenceRanges(e.sentenceRanges||[]);const u=h.map((t=>{const{preSentenceRange:n,postSentenceRange:s}=this._getPreAndPostSentenceRange({sentenceRanges:e.sentenceRanges||[],targetSentenceRange:t});return{preSentence:n,postSentence:s,sentence:t,paragraph:this._getParagraphForSentenceRange({paragraphs:l,sentenceRange:t})}}));if(0!=u.length)await this._sendRecommendationRequestForSentence({editor:e,valuableText:a,sentencesInfo:u,isForcedRecommendation:n});else{const t={instanceId:e.id,textLevelErrors:[],textLevelPremiumErrors:[],textLevelPremiumPickyErrors:[],textLevelPickyErrors:[],paragraphLevelErrors:[],paragraphLevelPremiumErrors:[],paragraphLevelPremiumPickyErrors:[],paragraphLevelPickyErrors:[]};this._onRecommendationCompleted({editor:e,result:t,valuableText:a,isForcedRecommendation:n,recommendationTimestamp:Date.now()})}}_getLatestCheckTimestampForPipeline({editor:e,pipelineType:t}){return t?"forced"===t?e.lastForcedRecommendationPipelineCheckTimestamp:e.lastDefaultRecommendationPipelineCheckTimestamp:Math.max(e.lastDefaultRecommendationPipelineCheckTimestamp,e.lastForcedRecommendationPipelineCheckTimestamp)}_categorizeRecommendationSuccessProcessing({editor:e,isForcedRecommendation:t,recommendationTimestamp:n}){return n<this._getLatestCheckTimestampForPipeline({editor:e,pipelineType:"default"})?"discard":n<this._getLatestCheckTimestampForPipeline({editor:e,pipelineType:"forced"})?"incremental":"default"}_getChangedParagraphs(e,t){return(0,r.getChangedParagraphs)(e,t)}_onRecommendationCompleted({editor:e,result:t,valuableText:n,isForcedRecommendation:i,recommendationTimestamp:a}
451){if(!e.isAutoCheckEnabled)return;e.recommendationStatus=l.CHECK_STATUS.COMPLETED;const c=this._categorizeRecommendationSuccessProcessing({editor:e,isForcedRecommendation:i,recommendationTimestamp:a});if("discard"===c)return;if("incremental"===c){const r=s.ErrorProcessor.migrateOffsetsBetweenTexts(t.paragraphLevelErrors||[],n.text,e.recommendationCheckedText.originalText,!1,!0);t.paragraphLevelErrors=r}const{errors:d,premiumErrors:h,recommendationErrors:u,valuableCurrentText:g}=this._controllerOptions.mergeAndMigrateErrors(e,"incremental"===c,{errors:t,existingCheckedText:e.checkedText,newCheckedText:e.checkedText,existingRecommendationCheckedText:e.recommendationCheckedText,newRecommendationCheckedText:"incremental"===c?e.recommendationCheckedText:n},!1,!1,!0);i?e.lastForcedRecommendationPipelineCheckTimestamp=a:e.lastDefaultRecommendationPipelineCheckTimestamp=a;const m=(0,r.deepClone)(e.displayedErrors);(0,o.trackPerformanceMetrics)({type:"recommendation_check_completed",changedParagraphs:[],editor:e,currentText:n.text,initStartTime:e.initStartTime,changeStartTime:a,responseTime:Date.now(),endTime:Date.now(),newDisplayedErrors:e.displayedErrors,oldDisplayedErrors:m,isTriggeredByMaxDebounced:!1,isTriggeredForRecommendationOnAppliedFix:i});const p=u;this._controllerOptions.updateDisplayedErrors(e,g,d,h,p),this._controllerOptions.highlight(e),this._controllerOptions.updateState(e)}cancelAnyDeferredTimerPipeline({editor:e}){e.deferredRecommendationPipelineTimerId&&(self.clearTimeout(e.deferredRecommendationPipelineTimerId),e.deferredRecommendationPipelineTimerId=null)}getRecommendationStatus({editor:e}){return e.recommendationStatus}cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:t,valuableText:n,appliedFix:r,updateErrors:i=!0}){e.recommendationStatus=l.CHECK_STATUS.COMPLETED;let o=e.recommendationErrors;const a=[...e.checkedRecommendationTextErrors];if(r?.isRecommendation){const i=e.checkedRecommendationTextErrors.filter((e=>e.id&&r.errorId&&e.id!==r.errorId));o=s.ErrorProcessor.migrateOffsetsBetweenTexts(i,t.text,n.text,!1,!0),e.recommendationErrors=o,e.checkedRecommendationTextErrors=o,e.recommendationCheckedText=n}if(n.text===e.recommendationCheckedText.text&&(o=e.checkedRecommendationTextErrors),r&&!r.isRecommendation&&this._isOverlappingErrorsEnabled()?e.recommendationErrors=s.ErrorProcessor.migrateOffsetsBetweenTexts(o,t.text,n.text,!1,!0,!0):r?.isRecommendation||(e.recommendationErrors=s.ErrorProcessor.migrateOffsetsBetweenTexts(o,t.text,n.text,!1,!0)),e.recommendationCheckedText=n,e.checkedRecommendationTextErrors=e.recommendationErrors,this._isOverlappingErrorsEnabled()&&r&&!r?.isRecommendation&&"REPHRASING"!==r?.ruleId){const t=a.filter((t=>!e.checkedRecommendationTextErrors.find((e=>e.id===t.id)))).filter((e=>"PHRASAL_RECOMMENDATION"===e.rule.issueType));e.checkedRecommendationTextErrors.push(...t)}return e.lastForcedRecommendationPipelineCheckTimestamp=Date.now(),e.lastDefaultRecommendationPipelineCheckTimestamp=Date.now(),i&&this._controllerOptions.rerenderHighlightForEditor(e),e.recommendationErrors}onTextChangePipeline({editor:e,currentText:t,previousText:n,preserveAllErrors:i}){const o=e.inputAreaTweaks.getReplacedParts(t),a=(0,r.getValuableText)(t,o);if(a.text===e.recommendationCheckedText.text)return{migratedRecommendationErrors:this.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:a,appliedFix:null,updateErrors:!1})};if(i)return{migratedRecommendationErrors:s.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,t,!1,!0,!0)};const l=s.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,n,!1,!0),c=this._filterErrorsOnTextChange({editor:e,errors:l,sentenceRanges:e.currentSentenceRanges||[],currentText:t,previousText:n});e.recommendationErrors=(0,r.deepClone)(e.recommendationErrors).filter((e=>c.find((t=>t.id===e.id))));const d=e.appliedChange;let h=!1;return d&&!d.isRecommendation&&(h=!0),{migratedRecommendationErrors:s.ErrorProcessor.migrateOffsetsBetweenTexts(e.recommendationErrors,e.recommendationCheckedText.originalText,t,!1,!0,h)}}
451onReviewModePipeline({editor:e,text:t,checkCallMetaArgs:n,checkResponseReceivedTimestamp:s,ignoreSentenceRanges:r}){if(n.isMaxDebounceCall)return;if(!this._options.delay||0===e.lastDefaultRecommendationPipelineCheckTimestamp)return void this._sendRecommendationRequest({editor:e,text:t,isForcedRecommendation:!1,ignoreSentenceRanges:r});if(e.inputAreaWrapper.getText()!==t)return;const i=s-n.invokedAt;if(i>=this._options.delay)this._sendRecommendationRequest({editor:e,text:t,isForcedRecommendation:!1,ignoreSentenceRanges:r});else{const n=this._options.delay-i;e.deferredRecommendationPipelineTimerId=self.setTimeout((()=>{this._sendRecommendationRequest({editor:e,text:t,isForcedRecommendation:!1,ignoreSentenceRanges:r}),e.deferredRecommendationPipelineTimerId=null}),n)}}async onApplyFixPipeline({editor:e,valuableText:t,appliedFix:n}){if(!n||e.isRecommendationsDisabled)return void(e.recommendationStatus=l.CHECK_STATUS.COMPLETED);const s=!e.isSentenceRangesChecking&&(0,r.getChangedSentence)(e.sentenceRanges||[],n.start);if(s)if(e.errors.filter((e=>e.start>=s.start&&e.end-1<=s.end)).length)this.cancelPipelineAndUpdateState({editor:e,valuableRecommendationText:e.recommendationCheckedText,valuableText:t,appliedFix:null});else{const n=this._getChangedParagraphs(e.recommendationCheckedText.text,t.text),{preSentenceRange:r,postSentenceRange:i}=this._getPreAndPostSentenceRange({sentenceRanges:e.sentenceRanges||[],targetSentenceRange:s}),o=this._getParagraphForSentenceRange({paragraphs:n,sentenceRange:s});await this._sendRecommendationRequestForSentence({editor:e,valuableText:t,sentencesInfo:[{sentence:s,preSentence:r,postSentence:i,paragraph:o}],isForcedRecommendation:!0})}else e.recommendationStatus=l.CHECK_STATUS.COMPLETED}async _tryUnlockRecommendation(e,t){const n=e.fixes[0].value;if(e.id&&e.isLocked&&n){(0,o.trackHealthMetric)("sneak-peek-unlock-error",16);const s=await a.EnvironmentAdapter.unlockRecommendation({lockId:n,metaData:{instanceId:t.id}});if("string"==typeof s?.recommendation)return this._updateFixesValue(s.recommendation,e.id,!1,t),!0;(0,o.trackHealthMetric)("sneak-peek-unlock-error",11)}}}},
451"./content/recommendationUtils.ts":
452/*!****************************************!*\
453  !*** ./content/recommendationUtils.ts ***!
454  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{filterPhrasalRecommendationsByGrammarErrors:()=>g,getRecommendationHighlighterBlock:()=>l,identifySentencesWithGrammarErrors:()=>h,isErrorInSentence:()=>m,updatePhrasalRecommendationOffsets:()=>u});var s=n(/*! ./highlightStylingType */"./content/highlightStylingType.ts"),r=n(/*! ../common/utils */"./common/utils.ts"),i=n(/*! ../init/config */"./init/config.ts"),o=n(/*! ../core/utils */"./core/utils.ts"),a=n(/*! ../core/ErrorProcessor */"./core/ErrorProcessor.ts");function l(e,t,n,s,i,o=!1){const a=(0,r.findMinWords)(e.originalPhrase,14,3),l={id:e.id,underlineThickness:t},h=[];if(e?.rule.phraseDiff&&e?.rule.phraseDiff.length>0)return s&&h.push({...l,highlightStylingType:c(n),offset:e.start,length:e.length,isUnderlined:!1,isEmphasized:s}),e?.rule.phraseDiff.forEach((e=>{h.push({...l,highlightStylingType:d(n),offset:e.sourceStart,length:e.sourceEnd-e.sourceStart,isUnderlined:!o,isEmphasized:!1})})),h;if(a.length!==e.originalPhrase.length){const t=i(e.start,a.length);if(1===t.length)return s&&h.push({...l,highlightStylingType:c(n),offset:e.start,length:e.length,isUnderlined:!1,isEmphasized:s}),h.push({...l,highlightStylingType:d(n),offset:e.start,length:a.length,isUnderlined:!o,isEmphasized:!1,isEllipsis:!0}),h;if(t.length>1){for(let t=6;t>0;t--)if(1===i(e.start+a.length-t,6).length&&e.start+a.length-t+6<e.end){h.push({...l,highlightStylingType:d(n),offset:e.start,length:(0,r.getCurrentWordEndIndex)(e.originalPhrase,a.length-t+6),isUnderlined:!o,isEmphasized:!1,isEllipsis:!0});break}const t=0===h.length;return(t&&!o||s)&&h.push({...l,highlightStylingType:t?n:c(n),offset:e.start,length:e.length,isUnderlined:t,isEmphasized:s}),h}}return[{id:e.id,offset:e.start,length:e.length,isUnderlined:!o,isEmphasized:s,highlightStylingType:n,underlineThickness:t}]}function c(e){return e===s.HighlightStylingType.paid_recommendation_emphasized?s.HighlightStylingType.paid_recommendation_emphasized_no_underline:e===s.HighlightStylingType.paid_recommendation_selected?s.HighlightStylingType.paid_recommendation_selected_no_underline:e===s.HighlightStylingType.recommendation_tease_emphasized?s.HighlightStylingType.recommendation_tease_emphasized_no_underline:e===s.HighlightStylingType.recommendation_tease_selected?s.HighlightStylingType.recommendation_tease_selected_no_underline:e}function d(e){return e===s.HighlightStylingType.paid_recommendation_emphasized?s.HighlightStylingType.paid_recommendation_emphasized_no_background:e===s.HighlightStylingType.paid_recommendation_selected?s.HighlightStylingType.paid_recommendation_selected_no_background:e===s.HighlightStylingType.recommendation_tease_emphasized?s.HighlightStylingType.recommendation_tease_emphasized_no_background:e===s.HighlightStylingType.recommendation_tease_selected?s.HighlightStylingType.recommendation_tease_selected_no_background:e}function h(e,t,n){const s=new Set;if(!t?.length)return s;const r=i.default.get(i.ConfigKey.NORMALIZE_SPACE),l=(0,o.getParagraphsDiff)(e.checkedText.originalText,e.inputAreaWrapper.getText(),r),c=a.ErrorProcessor.migrateOffsetsBetweenTexts(n,l,!1,!0);for(const e of c)for(let n=0;n<t.length;n++)if(m(e,t[n])){s.add(n);break}return s}function u(e,t){if(!e.length||!t.length)return e;const n=a.ErrorProcessor.sortByLastSentenceRanges(t);return e.map((e=>{if(e.rule.issueType!==o.RULE_ISSUE_TYPES.PHRASAL_RECOMMENDATION)return e;const t=n.find((t=>e.start>=t.start&&e.end<=t.end));if(!t)return e;const s=e.relativeOffset??0,r=t.start+s,i=e.originalPhrase.length;return{...e,start:r,end:r+i,length:i}}))}function g(e,t,n){return 0!==n.size&&t.length?e.filter((e=>{if("PHRASAL_RECOMMENDATION"!==e.rule.issueType)return!0;const s=t.findIndex((t=>m(e,t)));return-1===s||!n.has(s)})):e}function m(e,t){return e.start<t.end&&e.end>t.start}},
454"./content/requestAbortController.ts":
455/*!*******************************************!*\
456  !*** ./content/requestAbortController.ts ***!
457  \*******************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{RequestAbortController:()=>s});class s{constructor(){this._abortPromise=new Promise((e=>{this._resolve=e}))}abort(){this._resolve("Aborted")}get signal(){return this._abortPromise}}},
457"./content/sentenceRangesUtils.ts":
458/*!****************************************!*\
459  !*** ./content/sentenceRangesUtils.ts ***!
460  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeAndMigrateSentenceRanges:()=>r});var s=n(/*! ../core/ErrorProcessor */"./core/ErrorProcessor.ts");function r(e,t,n,r,i){const{sentenceRanges:o}=s.ErrorProcessor.merge({existing:{errors:[],pickyErrors:[],premiumErrors:[],premiumPickyErrors:[],recommendationErrors:[],sentenceRanges:e||[]},new:{textLevel:{errors:[],pickyErrors:[],premiumErrors:[],premiumPickyErrors:[]},paragraphLevel:{errors:[],pickyErrors:[],premiumErrors:[],premiumPickyErrors:[],recommendationErrors:[],...t.paragraphLevelSentenceRanges&&{sentenceRanges:t.paragraphLevelSentenceRanges}}},existingCheckedText:t.existingCheckedText,newCheckedText:t.newCheckedText,existingRecommendationCheckedText:t.existingRecommendationCheckedText,newRecommendationCheckedText:t.newRecommendationCheckedText},n,r,i);return o||[]}},
460"./content/shadowDomEventsPropagator.ts":
461/*!**********************************************!*\
462  !*** ./content/shadowDomEventsPropagator.ts ***!
463  \**********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ShadowDomEventsPropagator:()=>l});var s,r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! ../init/config */"./init/config.ts"),o=n(/*! ../common/utils */"./common/utils.ts");const a=i.default.get(i.ConfigKey.EXTN_PREFIX);class l{static _getShadowRoots(e){const t=[];for(e=e.getRootNode();e instanceof ShadowRoot;)t.push(e),e=e.host.getRootNode();return t}static _initNode(e){const t=this._getShadowRoots(e);for(const e of t)this._initializedShadowRoots.has(e)||(e.addEventListener("focus",this._shadowRootFocusEventHandler,!0),e.addEventListener("focusin",this._shadowRootFocusEventHandler,!0),e.addEventListener("blur",this._shadowRootBlurEventHandler,!0),e.addEventListener("focusout",this._shadowRootBlurEventHandler,!0),e.addEventListener("mouseleave",this._shadowRootMouseEventHandler,!0),(0,o.onElementRemoved)(e.host,this._deinitHost,this._removeElementAbortController.signal),this._initializedShadowRoots.add(e))}static _deinitShadowRoot(e){e&&(e.removeEventListener("focus",this._shadowRootFocusEventHandler,!0),e.removeEventListener("focusin",this._shadowRootFocusEventHandler,!0),e.removeEventListener("blur",this._shadowRootBlurEventHandler,!0),e.removeEventListener("focusout",this._shadowRootBlurEventHandler,!0),e.removeEventListener("mouseleave",this._shadowRootMouseEventHandler,!0),this._initializedShadowRoots.delete(e))}static _createEvent(e){const t=this.eventNames[e.type];if(!t)return null;if(e instanceof FocusEvent){const n={bubbles:e.bubbles,cancelable:e.cancelable,composed:!0,detail:e.detail,view:e.view,which:e.detail};return new FocusEvent(t,n)}if(e instanceof MouseEvent){const n={bubbles:e.bubbles,cancelable:e.cancelable,composed:!0,detail:e.detail,view:e.view,which:e.which,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,movementX:e.movementX,movementY:e.movementY,relatedTarget:e.relatedTarget,screenX:e.screenX,screenY:e.screenY};return new MouseEvent(t,n)}return null}static init(){this._initialized||(document.addEventListener("focus",this._documentFocusEventHandler,!0),document.addEventListener("blur",this._documentBlurEventHandler,!0),this._removeElementAbortController=new AbortController,this._initializedShadowRoots=new Set,this._initialized=!0)}static destroy(){this._initialized&&(document.removeEventListener("focus",this._documentFocusEventHandler,!0),document.removeEventListener("blur",this._documentBlurEventHandler,!0),this._removeElementAbortController.abort(),this._removeElementAbortController=null,this._initializedShadowRoots.forEach((e=>{this._deinitShadowRoot(e)})),this._initializedShadowRoots=null,this._initialized=!1)}}s=l,l.eventNames={focus:`${a}-shadow-focus`,blur:`${a}-shadow-blur`,focusin:`${a}-shadow-focusin`,focusout:`${a}-shadow-focusout`,mouseleave:`${a}-shadow-mouseleave`},l._removeElementAbortController=null,l._initializedShadowRoots=null,l._initialized=!1,l._focusedElement=null,l._deinitHost=e=>{s._deinitShadowRoot(e.shadowRoot)},l._documentFocusEventHandler=e=>{if(!s._initialized)return;const t=(0,r.getEventTarget)(e);t&&(s._focusedElement=t,s._initNode(t))},l._documentBlurEventHandler=e=>{s._initialized&&(s._focusedElement=null)},l._shadowRootFocusEventHandler=e=>{if(!s._initialized)return;const t=(0,r.getEventTarget)(e);if(!t||s._focusedElement===t)return;s._initNode(t),"focusin"===e.type&&(s._focusedElement=t);const n=s._createEvent(e);n&&t.dispatchEvent(n)},l._shadowRootBlurEventHandler=e=>{if(!s._initialized)return;const t=(0,r.getEventTarget)(e);if(!t||s._focusedElement!==t)return;"focusout"===e.type&&(s._focusedElement=null);const n=s._createEvent(e);n&&t.dispatchEvent(n)},l._shadowRootMouseEventHandler=e=>{if(!s._initialized)return;const t=(0,r.getEventTarget)(e);if(!t)return;const n=s._createEvent(e);n&&t.dispatchEvent(n)}},
463"./content/termsOfService.ts":
464/*!***********************************!*\
465  !*** ./content/termsOfService.ts ***!
466  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TermsOfService:()=>u});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../common/storageController */"./common/storageController.ts"),i=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),o=n(/*! ../init/config */"./init/config.ts"),a=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),l=n(/*! ../common/utils */"./common/utils.ts"),c=n(/*! ../common/i18nManager */"./common/i18nManager.ts"),d=n(/*! ../common/browserDetector */"./common/browserDetector.ts");const h=o.default.get(o.ConfigKey.EXTN_PREFIX);class u{static init(){this._storageController=r.StorageControllerFactory.create(),this._hasShownModal=!1}static _waitForStorageController(){return new Promise((e=>{this._storageController.onReady((()=>{e()}))}))}static canProactivelyShowModal(e){const t=e.getBoundingClientRect();return self.innerHeight>320&&self.innerWidth>320&&t.right>300&&!navigator.webdriver}static shouldProactivelyShowModal(){return this._waitForStorageController().then((()=>
466{if(Math.random()>.2)return Promise.resolve(!1);if(!o.default.get(o.ConfigKey.TERMS_OF_SERVICE_MODAL_ENABLED))return Promise.resolve(!1);if(this._hasShownModal)return Promise.resolve(!1);if("extension"!==a.EnvironmentAdapter.getType())return Promise.resolve(!1);if(this._storageController.hasCustomServer())return Promise.resolve(!1);if(this._storageController.hasCustomLogin())return Promise.resolve(!1);const e=this._storageController.getPrivacySettings();if(e.acceptedTermsOfServiceVersion===s.CURRENT_TERMS_OF_SERVICE_VERSION)return Promise.resolve(!1);if(this._storageController.getManagedSettings().disablePrivacyConfirmation)return Promise.resolve(!1);const t=new Date,n=new Date((new Date).getTime()-864e5);if(e.lastTermsOfServiceModalShown){const s=new Date(e.lastTermsOfServiceModalShown),r=s.toDateString()===t.toDateString(),i=s.toDateString()===n.toDateString();if(r||i)return Promise.resolve(!1)}return this._storageController.hasLanguageToolAccount()?a.EnvironmentAdapter.getTermsOfServiceInfo(s.CURRENT_TERMS_OF_SERVICE_VERSION).then((e=>(e.hasAccepted&&this._storageController.updatePrivacySettings({acceptedTermsOfServiceVersion:s.CURRENT_TERMS_OF_SERVICE_VERSION}),Promise.resolve(!e.hasAccepted&&e.isAcceptanceRequired)))).catch((()=>(i.TrackerAdapter.trackError("http","failed_loading_tos_info"),Promise.resolve(!1)))):Promise.resolve(!0)}))}static async showModal(e){this.hideModal(),this._hasShownModal=!0,await this._storageController.updatePrivacySettings({lastTermsOfServiceModalShown:Date.now()});const t=e.ownerDocument;this._modal=(0,l.createContainerElement)(t,this.MODAL_ELEMENT_NAME),this._modal.className="lt-modal";const n=t.createElement("lt-div");n.className="lt-modal__headline",n.textContent=c.i18nManager.getMessage("termsOfServiceUpdateHeadline"),this._modal.append(n);const r=t.createElement("lt-div");if(r.className="lt-modal__text",this._modal.append(r),this._storageController.hasLanguageToolAccount()){r.innerHTML=c.i18nManager.getMessage("termsOfServiceUpdateText",c.i18nManager.getMessage("termsOfServiceUpdateAcceptButton"));const e=t.createElement("lt-span");e.className="lt-modal__secondary-button",e.textContent=c.i18nManager.getMessage("termsOfServiceUpdateSkipButton"),this._modal.append(e);const n=t.createElement("lt-span");n.className="lt-modal__primary-button",n.textContent=c.i18nManager.getMessage("termsOfServiceUpdateAcceptButton"),this._modal.append(n),this._eventListeners.push((0,l.addUseCaptureEvent)(n,"click",(()=>{this.markAsAccepted()})),(0,l.addUseCaptureEvent)(e,"click",(()=>{this.skipModal()})))}else{r.innerHTML=c.i18nManager.getMessage("termsOfServiceUpdateTextLoggedOut");const e=t.createElement("lt-span");e.className="lt-modal__primary-button",e.textContent=c.i18nManager.getMessage("termsOfServiceUpdateUnderstoodButton"),this._modal.append(e),this._eventListeners.push((0,l.addUseCaptureEvent)(e,"click",(()=>{this.markAsAccepted()})))}const[o,a]=Array.from(r.querySelectorAll("lt-em"));o&&this._eventListeners.push((0,l.addUseCaptureEvent)(o,"click",(e=>{self.open(s.TERMS_OF_SERVICE_URL,"_blank"),i.TrackerAdapter.trackEvent("Action","open_terms_of_service"),e.stopImmediatePropagation(),e.preventDefault()}))),a&&this._eventListeners.push((0,l.addUseCaptureEvent)(a,"click",(e=>{self.open(s.PRIVACY_POLICY_URL,"_blank"),i.TrackerAdapter.trackEvent("Action","open_privacy_policy"),e.stopImmediatePropagation(),e.preventDefault()}))),e.classList.add(`${h}-toolbar--modal-opened`),e.append(this._modal),this._positionModal(e),i.TrackerAdapter.trackEvent("Action","show_tos_modal")}static _positionModal(e){if(d.BrowserDetector.isThunderbird())return;const t=e.getBoundingClientRect(),n=this._modal.getBoundingClientRect(),s=t.top;(e.ownerDocument.defaultView.innerHeight-t.bottom>s||s<n.height)&&this._modal?.classList.add("lt-modal--position-at-bottom")}static async markAsAccepted(){await this._storageController.updatePrivacySettings({acceptedTermsOfServiceVersion:s.CURRENT_TERMS_OF_SERVICE_VERSION,allowRemoteCheck:!0}),this._storageController.hasLanguageToolAccount()&&a.EnvironmentAdapter.acceptTermsOfService(s.CURRENT_TERMS_OF_SERVICE_VERSION),this.hideModal(),i.TrackerAdapter.trackEvent("Action","accept_tos_modal")}static skipModal(){this.hideModal(),i.TrackerAdapter.trackEvent("Action","hide_tos_modal")}static async hideModal(){this._modal?.parentElement?.classList.remove(`${h}-toolbar--modal-opened`),this._modal?.remove(),this._eventListeners.forEac
466h((e=>{e.destroy()}))}}u._eventListeners=[],u.MODAL_ELEMENT_NAME="lt-modal"},
466"./content/toolbar.ts":
467/*!****************************!*\
468  !*** ./content/toolbar.ts ***!
469  \****************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Toolbar:()=>T});var s=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),r=n(/*! ../common/i18nManager */"./common/i18nManager.ts"),i=n(/*! ../common/utils */"./common/utils.ts"),o=n(/*! ../react/views/icon/icon */"./react/views/icon/icon.tsx"),a=n(/*! ../react/views/menu/menu */"./react/views/menu/menu.tsx"),l=n(/*! ../config/config */"./config/config.ts"),c=n(/*! ../core/utils */"./core/utils.ts"),d=n(/*! ./checkStatus */"./content/checkStatus.ts"),h=n(/*! ../common/browserDetector */"./common/browserDetector.ts"),u=n(/*! ../common/languageManager */"./common/languageManager.ts"),g=n(/*! ../init/config */"./init/config.ts"),m=n(/*! ../components/hint/hint */"./components/hint/hint.ts"),p=n(/*! ./dialog */"./content/dialog.ts"),_=n(/*! ./termsOfService */"./content/termsOfService.ts");
470/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
471const E=g.default.get(g.ConfigKey.EXTN_PREFIX);var f;!function(e){e.Supported="supported",e.NotSupported="not supported",e.NotDetected="not detected"}(f||(f={}));class T{static _cacheMessages(){T.MESSAGES={STATUS_ICON_RELOAD_MESSAGE:r.i18nManager.getMessage("statusIconReload"),STATUS_ICON_PERMISSION_REQUIRED:r.i18nManager.getMessage("statusIconPermissionRequired"),STATUS_ICON_TEXT_TOO_LONG:r.i18nManager.getMessage("textTooLong"),STATUS_ICON_TRIAL_ENDED:r.i18nManager.getMessage("popupTrialEndedHeadline"),STATUS_ICON_DISABLED:r.i18nManager.getMessage("statusIconEnableLT"),STATUS_ICON_FAIL:r.i18nManager.getMessage("statusIconError"),STATUS_ICON_MORE_ERRORS:r.i18nManager.getMessage("statusIconMoreErrors"),STATUS_ICON_LANGUAGE_UNSUPPORTED:r.i18nManager.getMessage("dialogUnsupportedLanguageHeadline"),PREMIUM_ICON_TOOLTIP:r.i18nManager.getMessage("dialogMainMenuPremiumMistake"),REPHRASING_TOOLTIP:r.i18nManager.getMessage("toolbarTooltipRephrasing"),TOOLBOX_TOOLTIP:r.i18nManager.getMessage("toolboxTooltip"),REPHRASING_LANGUAGE_UNSUPPORTED_TOOLTIP:r.i18nManager.getMessage("toolbarTooltipRephrasingUnsupportedLanguage"),DISABLE_CHECKING_TOOLTIP:r.i18nManager.getMessage("toolbarTooltipDisableChecking"),DISABLE_CHECKING_MENU_ITEM:r.i18nManager.getMessage("toolbarDisableMenuDisableChecking"),PAUSE_CHECKING_MENU_ITEM:r.i18nManager.getMessage("toolbarDisableMenuPauseChecking")}}static init(e={}){T._isInitialized||(T._cacheMessages(),r.i18nManager.addEventListener(r.i18nManagerBaseClass.eventNames.localeChanged,T._cacheMessages.bind(T)),e.customRender&&(T._customRender=e.customRender),T._isInitialized=!0)}constructor(e){this._isTyping=!1,this._isTypingTimeout=null,this._isScrolling=!1,this._isScrollingTimeout=null,this._extrasRendered=null,this._wasToolbarSmall=!1,this._pauseDecreaseSizeCheck=!1,this._currentStyles=null,this._renderOutsideIframe=!1,this._isTermsOfServiceModalRendered=!1,this._xDisplacementRequiredToAvoidOverlap=null,this._updateIsScrolling=()=>{this._isScrollingTimeout&&(self.clearTimeout(this._isScrollingTimeout),this._isScrollingTimeout=null),this._isScrolling=!0,this._isScrollingTimeout=self.setTimeout((()=>{this._isScrolling=!1}),4e3)},this._updateIsTyping=()=>{this._isTypingTimeout&&(self.clearTimeout(this._isTypingTimeout),this._isTypingTimeout=null),this._isTyping=!0,this._isTypingTimeout=self.setTimeout((()=>{this._isTyping=!1,this._render()}),4e3)},this._changeVisiblity=e=>{(0,i.dispatchCustomEvent)(document,T.eventNames.visibilityChanged,{visiblity:e,toolbar:this})},this._fixAllErrors=()=>{const e={toolbar:this};(0,i.dispatchCustomEvent)(document,T.eventNames.fixAllErrors,e)},this._onLanguageChange=e=>{const t={toolbar:this,language:e};(0,i.dispatchCustomEvent)(document,T.eventNames.languageChanged,t)},this._onMouseEnter=async e=>{const t=e.target;this._waitForExtrasToBeRendered().then((()=>{(0,i.isElement)(t)&&[p.Dialog.CONTAINER_ELEMENT_NAME,_.TermsOfService.MODAL_ELEMENT_NAME].includes(t.nodeName.toLowerCase())?this._onMouseLeave(e,!0):t===this._controls.wrapper&&(this._containsHint()||this._controls.wrapper?.classList.add(`${E}-toolbar__wrapper--expanded`))}))},this._onMouseLeave=(e,t)=>
471{const n=e.target;this._waitForExtrasToBeRendered().then((()=>{(n===this._controls.wrapper||t)&&(this._isDisableMenuOpen&&!t||this._controls.wrapper?.classList.remove(`${E}-toolbar__wrapper--expanded`))}))},this._onUnload=()=>{this.destroy()},this._getToolbarEventDetail=()=>({toolbar:this}),this._toggleDialog=e=>{const t=e||this._getToolbarEventDetail();(0,i.dispatchCustomEvent)(document,T.eventNames.toggleDialog,t)},this._getToolbarCustomRenderProps=()=>({onLanguageChange:this._onLanguageChange.bind(this),toggleDialog:this._toggleDialog.bind(this),fixAllErrors:this._fixAllErrors.bind(this),isDisabledRephraseForThisSelection:this._isDisabledRephraseForThisSelection.bind(this),isHorizontal:this._isHorizontal.bind(this),preventFocusStealing:this._preventFocusStealing.bind(this),showRephrasingCard:this._showRephrasingCard.bind(this),isDialogAttached:this._isDialogAttached.bind(this),setVisible:e=>this._visible=e,getWasToolbarSmall:()=>this._wasToolbarSmall,getState:()=>this._state,getControls:()=>this._controls,getAppearance:()=>this._appearance,getRoot:()=>this._root,getDocument:()=>this._document,getFixAllMetaData:()=>this._fixAllMetadata,getInputArea:()=>this._inputArea,getInputAreaMatchedTweaksName:()=>this._inputAreaMatchedTweaksName,getIsUserTyping:()=>this._isTyping,getToolbar:()=>this,selectedText:this.selectedText,selection:this._state.selection,setPauseDecreaseSizeCheck:this._setPauseDecreaseSizeCheck.bind(this)});const{inputArea:t,appearence:n,mirror:r=null,enableRephrasing:o,shouldOpenToolbox:a,state:c={checkStatus:d.CHECK_STATUS.IN_PROGRESS,recommendationStatus:d.CHECK_STATUS.IN_PROGRESS,premiumErrorsCount:0,isIncompleteResult:!1,checkErrorMessage:"",showNotification:!1,text:"",sentenceRanges:void 0,errors:[],isPremium:!1,fixAllMetadata:void 0,selectedText:"",showOptionalError:!1,isSentenceRangesChecking:!1}}=e;this._inputArea=t,this._targetElement=t,this._document=t.ownerDocument,this._appearance=n,this._mirror=r,this._enableRephrasing=o,this._shouldOpenToolbox=a,this._inputAreaMatchedTweaksName=e.inputAreaMatchedTweaksName;const h=(0,i.getFrameElement)(self);h&&this._appearance.shouldRenderOutsideFrame(h)&&(0,i.isLTAvailable)(self.parent)&&(this._targetElement=h,this._document=this._targetElement.ownerDocument,this._renderOutsideIframe=!0,self.addEventListener("pagehide",this._onUnload,!0)),this._domMeasurement=new s.DomMeasurement(this._document),this._root=this._appearance.getRoot(this._document),this._rootElement=this._root instanceof ShadowRoot?this._root.host:this._root,this._hasBoundingContainer=this._appearance.hasBoundingContainer(this._rootElement,this._domMeasurement),this._controls={container:null,wrapper:null,extras:null,disableIcon:void 0,rephrasingIcon:void 0,rephrasingIconUnsupportedLanguage:void 0,statusIcon:null,statusIconTooltip:null,premiumIcon:null,premiumIconDot:null,divider:null,disableMenu:void 0,premiumIconTooltip:null},this._visible=!1,this._isDisableMenuOpen=!1,this._isSizeDecreased=!1,this._isRTL=this._domMeasurement.isRTL(this._targetElement),this._eventListeners=[],this.updateState(c,!0);const u=this._appearance.isPerformanceCritical();this._renderInterval=(0,i.setAnimationFrameInterval)((()=>this._updateDisplaying(!0)),u?2*l.RENDER_INTERVAL:l.RENDER_INTERVAL),u||(this._decreaseSizeInterval=(0,i.setAnimationFrameInterval)((()=>this._decreaseSizeIfNeeded()),l.TOOLBAR_DECREASE_SIZE_INTERVAL)),this._scrollObserver=(0,i.observeScrollableAncestors)(this._targetElement,(()=>{this._updateDisplaying(!1),this._updateIsScrolling()}),this._domMeasurement),this._inputArea.addEventListener("input",this._updateIsTyping,!0),this._inputArea.addEventListener("paste",this._updateIsTyping,!0)}_isDisabledRephraseForThisSelection(){return this._state.selection&&!(0,i.hasValidSentenceRange)(this._state.text,this._state.sentenceRanges,this._state.selection)}_waitForExtrasToBeRendered(){return this._extrasRendered||(this._extrasRendered=this._renderExtras().then((()=>this._updateClassNames())).then((()=>(0,i.wait)(0)))),this._extrasRendered}_renderStatusIcon(){if(this._controls.container)return;this._controls.container=(0,i.createContainerElement)(this._document,T.CONTAINER_ELEMENT_NAME),this._controls.container.style.display="none",this._controls.container.classList.toggle(`${E}-toolbar--fixed`,this._hasBoundingContainer),this._controls.container.setAttribute("data-lt-adjust-appearance","true"),this._appearance.initContainer(this._controls.container),this._controls.wrapper=this._document.createElement(`${E}-div`),this._controls.wrapper.classList.add(`${E}-toolbar__wrapper`),this._controls.wrapper.addEventListener("mouseenter",this._onMouseEnter,!0),this._controls.wrapper.addEventListener("mouseleave",this._onMouseLeave,!0),(0,i.hasDarkBackgroun
471d)(this._inputArea)?this._controls.container.setAttribute(`data-${E}-force-appearance`,"dark"):this._controls.container.setAttribute(`data-${E}-force-appearance`,"light");const e=this._appearance.getClassName();e&&this._controls.wrapper.classList.add(e);const t=this._document.createElement(`${E}-div`),n=`${E}-icon__tooltip `+(this._appearance.isHorizontal()?this._isRTL?`${E}-icon__tooltip--top-left`:`${E}-icon__tooltip--top-right`:`${E}-icon__tooltip--right-center`);t.className=n,t.textContent=T.MESSAGES.PREMIUM_ICON_TOOLTIP,this._controls.premiumIconTooltip=t,this._controls.statusIcon=this._document.createElement(`${E}-div`),this._controls.premiumIconDot=this._document.createElement(`${E}-div`),this._controls.statusIconTooltip=this._document.createElement(`${E}-span`),this._controls.statusIconTooltip.className=n,this._controls.statusIcon.append(this._controls.statusIconTooltip),this._preventFocusStealing(this._controls.statusIcon),this._preventFocusStealing(this._controls.premiumIconDot),this._eventListeners.push((0,i.addUseCaptureEvent)(this._controls.wrapper,"click",this._onClick.bind(this))),this._controls.wrapper.appendChild(this._controls.statusIcon),this._controls.wrapper.appendChild(this._controls.premiumIconDot),this._controls.container.appendChild(this._controls.wrapper),this._visible=!0}_updateClassNames(){const e=[`${E}-toolbar__disable-icon`],t=[`${E}-toolbar__rephrasing-icon`],n=[`${E}-toolbar__rephrasing-icon`,`${E}-toolbar__rephrasing-icon--disabled`],s=[`${E}-toolbar__status-icon`],r=[`${E}-toolbar__premium-icon`],o=[`${E}-toolbar__premium-icon-dot`];let a="";switch(this._controls.wrapper?.classList.toggle(`${E}-toolbar--small`,this._wasToolbarSmall),this._controls.wrapper?.classList.toggle(`${E}-toolbar__wrapper--rtl`,this._isRTL),this._controls.rephrasingIcon&&(this._shouldOpenToolbox?n.push(`${E}-toolbar__rephrasing-icon--hidden`):(this._state.selection&&(0,i.hasValidSentenceRange)(this._state.text,this._state.sentenceRanges,this._state.selection)&&this._getLanguageSupport()!==f.NotDetected||t.push(`${E}-toolbar__rephrasing-icon--disabled`),this._getLanguageSupport()===f.NotSupported?t.push(`${E}-toolbar__rephrasing-icon--hidden`):n.push(`${E}-toolbar__rephrasing-icon--hidden`))),this._controls.extras?.classList.toggle(`${E}-toolbar__extras--hide`,[d.CHECK_STATUS.DISABLED,d.CHECK_STATUS.DISCONNECTED,d.CHECK_STATUS.PERMISSION_REQUIRED].includes(this._state.checkStatus)),this._state.checkStatus){case d.CHECK_STATUS.IN_PROGRESS:s.push(`${E}-toolbar__status-icon--loading`);case d.CHECK_STATUS.COMPLETED:case d.CHECK_STATUS.TEXT_TOO_SHORT:0===this._state.errors.length?s.push(`${E}-toolbar__status-icon--has-no-errors`):(s.push(`${E}-toolbar__status-icon--has-errors`),this._state.isIncompleteResult?(s.push(`${E}-toolbar__status-icon--has-more-errors`),a=T.MESSAGES.STATUS_ICON_MORE_ERRORS):this._state.errors.length>99?s.push(`${E}-toolbar__status-icon--has-99plus-errors`):s.push(`${E}-toolbar__status-icon--has-${this._state.errors.length}-errors`)),this._state.premiumErrorsCount>0&&(s.includes(`${E}-toolbar__status-icon--has-errors`)&&(r.push(`${E}-toolbar__premium-icon--visible`),this._wasToolbarSmall||o.push(`${E}-toolbar__premium-icon-dot--visible`)),s.push(`${E}-toolbar__status-icon--has-premium-errors`),this._state.premiumErrorsCount<99?(s.push(`${E}-toolbar__status-icon--has-${this._state.premiumErrorsCount}-premium-errors`),r.push(`${E}-toolbar__premium-icon--has-${this._state.premiumErrorsCount}-errors`)):(s.push(`${E}-toolbar__status-icon--has-99plus-premium-errors`),r.push(`${E}-toolbar__premium-icon--has-99plus-errors`))),this._state.showNotification&&0===this._state.premiumErrorsCount&&o.push(`${E}-toolbar__premium-icon-dot--has-notification`),this._state.checkStatus!==d.CHECK_STATUS.TEXT_TOO_SHORT||this._shouldOpenToolbox||t.push(`${E}-toolbar__rephrasing-icon--disabled`);break;case d.CHECK_STATUS.PERMISSION_REQUIRED:s.push(`${E}-toolbar__status-icon--needs-attention`),a=T.MESSAGES.STATUS_ICON_PERMISSION_REQUIRED;break;case d.CHECK_STATUS.DISABLED:s.push(`${E}-toolbar__status-icon--disabled`,`${E}-icon__disable`),a=T.MESSAGES.STATUS_ICON_DISABLED;break;case d.CHECK_STATUS.TRIAL_ENDED:s.push(`${E}-toolbar__status-icon--trial-ended`),a=T.MESSAGES.STATUS_ICON_TRIAL_ENDED;break;case d.CHECK_STATUS.TEXT_TOO_LONG:this._state.isPremium?s.push(`${E}-toolbar__status-icon--needs-attention`):s.push(`${E}-toolbar__status-icon--text-too-long`),a=T.MESSAGES.STATUS_ICON_TEXT_TOO_LONG;break;case d.CHECK_STATUS.UNSUPPORTED_LANGUAGE:s.push(`${E}-toolbar__status-icon--language-unsupported`),a=T.MESSAGES.STATUS_ICON_LANGUAGE_UNSUPPORTED;break;case d.CHECK_STATUS.FAILED:s.push(`${E}-toolbar__status-icon--failed`),a=this._state.checkErrorMessage||T.MESSAGES.STATUS_ICON_FAIL;break;case d.CHECK_STATUS.DISCONNECTED:s.push(`${E}-toolbar__status-icon--disconnected`),a=T.MESSAGES.STATUS_ICON_RELOAD_MESSAGE;break;case d.CHECK_STATUS.NEEDS_LANGUAGE_HINT:s.push(`${E}-toolbar__status-icon--needs-language-hint`)}this._controls.statusIcon.className=s.join(" "),this._controls.statusIconTooltip.textContent=a,this._controls.premiumIconDot.className=o.join(" "),this._controls.premiumIcon&&(this._controls.premiumIcon.className=r.join(" ")),this._controls.disableIcon&&(this._controls.disableIcon.element.className=e.join(" ")),this._controls.rephrasingIcon&&(this._controls.rephrasingIcon.element.className=t.join(" ")),this._controls.rephrasingIconUnsupportedLanguage&&(this._controls.rephrasingIconUnsupportedLanguage.element.className=n.join(" "))}_render(){T._customRender?T._customRender(this._getToolbarCustomRenderProps()):this._destroyed||(this._renderStatusIcon(),this._renderTermsOfServiceModal(),this._updateClassNames(),!this._root||!this._controls.container||this._root.contains(this._controls.container)&&"before"!==(0,i.getPosition)(this._controls.container,this._inputArea)||this._root.children[this._root.children.length-1]===this._controls.container||this._root.appendChild(this._controls.container))}_renderTermsOfServiceModal(){this._isTermsOfServiceModalRendered||_.TermsOfService.canProactivelyShowModal(this._controls.wrapper)&&(this._isTermsOfServiceModalRendered=!0,_.TermsOfService.shouldProactivelyShowModal().then((e=>{e&&!this._destroyed&&this._controls.wrapper&&_.TermsOfService.showModal(this._controls.wrapper)})))}_renderExtras(){if(this._controls.extras)return Promise.resolve();if(!this._controls.wrapper)return Promise.resolve();if(this._destroyed)return Promise.resolve();this._controls.extras=this._document.createElement(`${E}-div`),this._controls.extras.classList.add(`${E}-toolbar__extras`),this._controls.divider=this._document.createElement(`${E}-div`),this._controls.divider.className=`${E}-toolbar__divider`,this._controls.premiumIcon=this._document.createElement(`${E}-div`),this._controls.premiumIcon.addEventListener("mouseenter",(()=>this._updateExtrasClassnameOnMouseOver())),this._controls.premiumIcon.addEventListener("mouseleave",(()=>this._updateExtrasClassnameOnMouseOut())),this._preventFocusStealing(this._controls.premiumIcon),this._controls.extras.append(this._controls.divider),this._controls.extras.append(this._controls.premiumIcon),this._controls.wrapper.prepend(this._controls.extras);const e={label:T.MESSAGES.DISABLE_CHECKING_TOOLTIP,position:this._appearance.isHorizontal()?"top-right":"right-center"},t={label:this._shouldOpenToolbox?T.MESSAGES.TOOLBOX_TOOLTIP:T.MESSAGES.REPHRASING_TOOLTIP,position:this._appearance.isHorizontal()?"top-right":"right-center"},n={label:T.MESSAGES.REPHRASING_LANGUAGE_UNSUPPORTED_TOOLTIP,position:this._appearance.isHorizontal()?"top-right":"right-center"},s=[];return s.push((0,o.default)(this._document.createElement(`${E}-span`),{name:"disable",preventFocus:!0,tooltip:e,onClick:()=>h.BrowserDetector.isThunderbird()?this._onPauseCheckingClick():this.toggleDisableMenu(),onMouseOut:()=>this._updateExtrasClassnameOnMouseOut(),onMouseOver:()=>this._updateExtrasClassnameOnMouseOver()}).then((e=>{e.element.className=`${E}
471-toolbar__disable-icon`,this._controls.disableIcon=e,e.prependTo(this._controls.extras),this._preventFocusStealing(e.element)}))),this._enableRephrasing&&(s.push((0,o.default)(this._document.createElement(`${E}-span`),{name:"ai-tools",preventFocus:!0,tooltip:t,onClick:()=>this._showRephrasingCard(),onMouseOut:()=>this._updateExtrasClassnameOnMouseOut(),onMouseOver:()=>this._updateExtrasClassnameOnMouseOver()}).then((e=>{e.element.className=`${E}-toolbar__rephrasing-icon`,this._controls.rephrasingIcon=e,e.appendTo(this._controls.extras),this._preventFocusStealing(e.element)}))),s.push((0,o.default)(this._document.createElement(`${E}-span`),{name:"ai-tools",preventFocus:!0,tooltip:n,onClick:()=>this._showRephrasingCard(),onMouseOut:()=>this._updateExtrasClassnameOnMouseOut(),onMouseOver:()=>this._updateExtrasClassnameOnMouseOver()}).then((e=>{e.element.className=`${E}-toolbar__rephrasing-icon ${E}-toolbar__rephrasing-icon--disabled`,this._controls.rephrasingIconUnsupportedLanguage=e,e.appendTo(this._controls.extras),this._preventFocusStealing(e.element)})))),Promise.all(s)}_preventFocusStealing(e){this._eventListeners.push((0,i.addUseCaptureEvent)(e,"mousedown",(e=>{e.stopImmediatePropagation(),e.preventDefault()})),(0,i.addUseCaptureEvent)(e,"mouseup",(e=>{e.stopImmediatePropagation()})),(0,i.addUseCaptureEvent)(e,"pointerdown",(e=>{e.stopImmediatePropagation()})),(0,i.addUseCaptureEvent)(e,"pointerup",(e=>{e.stopImmediatePropagation()})))}_updateDisplaying(e=!1){if(this._destroyed)return;if(!this._controls.wrapper)return;if(this._renderOutsideIframe&&!(0,i.isInDocument)(this._targetElement))return void this._hide();if(this._domMeasurement.clearCache(),!this._appearance.isVisible(this._targetElement,this._domMeasurement))return void this._hide();this._isRTL=this._domMeasurement.isRTL(this._targetElement);const t=this._appearance.getPosition(this._targetElement,this._controls.container,this._rootElement,this._domMeasurement,this._isRTL,T.TOOLBAR_SIZE),n={isRTL:this._isRTL};if([this._controls.disableIcon,this._controls.rephrasingIcon,this._controls.rephrasingIconUnsupportedLanguage].map((e=>e?.element.dispatchEvent(new CustomEvent(o.EVENT_SET_TEXT_DIRECTION,{detail:n})))),!t)return void this._hide();const s={left:this._xDisplacementRequiredToAvoidOverlap&&t.left?`calc(${t.left} - ${this._xDisplacementRequiredToAvoidOverlap}px)`:t.left||""};t.fixed?(s.position="fixed !important",t.top?(s.top=`${t.top} !important`,s.bottom="auto !important"):(s.top="auto !important",s.bottom="12px !important")):(s.position="absolute !important",s.top=`${t.top} !important`,s.bottom="auto !important"),e&&(s["z-index"]=(this._appearance.getZIndex(this._targetElement,this._rootElement,this._domMeasurement)||"auto").toString()),(0,c.isSameObjects)(this._currentStyles,s)?this._show():(this._currentStyles=s,this._domMeasurement.setStyles(this._controls.wrapper,s),null===this._xDisplacementRequiredToAvoidOverlap&&this._controls.wrapper?this._fixToolbarOverlapsAndRender(this._controls.wrapper,s):this._render())}_hide(){this._controls.wrapper&&this._visible&&(this._visible=!1,this._controls.wrapper.classList.add(`${E}-toolbar__wrapper--hide`),this._changeVisiblity(!1))}_show(){this._controls.wrapper&&(this._visible||(this._visible=!0,this._controls.wrapper.classList.remove(`${E}-toolbar__wrapper--hide`),this._changeVisiblity(!0)))}async toggleDisableMenu(e){if(this._isDisableMenuOpen=void 0===e?!this._isDisableMenuOpen:e,this._controls.wrapper?.classList.toggle(`${E}-toolbar__wrapper--expanded`,this._isDisableMenuOpen),this._isDisableMenuOpen){const e=await(0,a.default)(this._document,{isActive:this._isDisableMenuOpen,position:"top",menuItems:[{label:T.MESSAGES.PAUSE_CHECKING_MENU_ITEM,name:"pause",isClickable:!0,onClick:this._onPauseCheckingClick.bind(this)},{label:T.MESSAGES.DISABLE_CHECKING_MENU_ITEM,name:"disable_circle",isClickable:!0,onClick:this._onTurnOffClick.bind(this)}]});this._unmountDisableMenu(),e.appendTo(this._controls.wrapper),this._controls.disableMenu=e}else this._unmountDisableMenu()}_unmountDisableMenu(){this._controls.disableMenu&&(this._controls.disableMenu.unmount(),this._controls.disableMenu.element.remove())}_updateExtrasClassnameOnMouseOut(){clearTimeout(this._extrasMouseoverTimeout),this._controls.extras?.classList.remove(`${E}-toolbar__extras--mouseover`),this._controls.premiumIcon?.removeChild(this._controls.premiumIconTooltip)}_updateExtrasClassnameOnMouseOver(){this._extrasMouseoverTimeout=self.setTimeout((()=>this._controls.extras?.classList.toggle(`${E}-toolbar__extras--mouseover`,!this._isDisableMenuOpen)),250),this._controls.premiumIcon?.appendChild(this._controls.premiumIconTooltip)}_showRephrasingCard(){const e={toolbar:this};(0,i.dispatchCustomEvent)(document,T.eventNames.showRephrasingCard,e)}_containsHint(){return!!this._controls.wrapper?.querySelector(`.${m.Hint.CONTAINER_CLASS_NAME}`)}_isDialogAttached(){return!!this._controls.wrapper?.classList.contains(`${E}-toolbar--dialog-attached`)}_setPauseDecreaseSizeCheck(e){this._pauseDecreaseSizeCheck=e}_decreaseSizeIfNeeded(){if(this._pauseDecreaseSizeCheck)return;if(!this._controls.wrapper)return;if(!this._visible)return;if(this._destroyed)return;let e=this._domMeasurement.getBorderBox(this._controls.wrapper,!1);if(this._renderOutsideIframe){const t=this._domMeasurement.getContentBox(this._targetElement,!1);e=(0,i.moveBox)(e,-t.left,-t.top)}e.top<0||e.bottom>
471self.innerHeight||this._isDialogAttached()||(this._isToolbarOverlapText(e)?(this._wasToolbarSmall=!0,this._decreaseSize()):this._isTyping||this._isScrolling||(this._wasToolbarSmall=!1,this._increaseSize()))}_isToolbarOverlapText(e){const t=(e,t)=>{if(!e||t.some((t=>(0,i.isSameRange)(t,e))))return!1;if(!(0,i.contains)(this._mirror?.getCloneElement()||this._inputArea,e.startContainer)||this._isInToolbar(e.startContainer))return!1;const s=e.getBoundingClientRect();return!(!this._isValidRangeRect(s)||!(0,i.isRectsIntersect)(s,n))},n={left:e.left-6,top:e.top,right:e.right,bottom:e.bottom-2},s=[];for(let t=0;t<5;t++){const n=e.top+e.height*t/4;s.push({x:Math.round(e.left)-1,y:Math.round(n)})}const r={x:Math.round(e.left)-1,y:Math.round(e.top)-1},o={x:Math.round(e.right)+1,y:Math.round(e.top)-1},a={x:Math.round(e.left)-1,y:Math.round(e.bottom)+1},l={x:Math.round(e.right)+1,y:Math.round(e.bottom)+1};if(s.push(r,o,a,l),this._mirror?.isShadowDomUsed()){this._mirror.enableRangeMeasurements();const e=s.some((e=>this._mirror.hasTextAtPoint(e)));return this._mirror.disableRangeMeasurements(),e}this._mirror?.enableRangeMeasurements();const c=[];for(const e of s){const n=(0,i.getRangeAtPoint)(e);if(t(n,c))return this._mirror?.disableRangeMeasurements(),!0;c.push(n)}const d=c[Math.floor(2.5)];let h=null;return d&&d.startOffset>0&&(h=new Range,h.setStart(d.startContainer,d.startOffset-1),h.setEnd(d.startContainer,d.startOffset-1)),t(h,c)?(this._mirror?.disableRangeMeasurements(),!0):(this._mirror?.disableRangeMeasurements(),!1)}
471_isValidRangeRect(e){return e.width<40}_isInToolbar(e){return!!this._controls.container&&this._controls.container.contains(e)}_decreaseSize(){this._controls.wrapper&&(this._isSizeDecreased||(this._isSizeDecreased=!0,this._controls.wrapper.classList.add(`${E}-toolbar--small`),this._render()))}_increaseSize(){this._controls.wrapper&&this._isSizeDecreased&&(this._isSizeDecreased=!1,this._controls.wrapper.classList.remove(`${E}-toolbar--small`),this._render())}_onClick(e){const t=(0,i.getEventTarget)(e);if(![this._controls.wrapper,this._controls.statusIcon,this._controls.premiumIcon,this._controls.premiumIconDot].includes(t))return;const n=this._getToolbarEventDetail();e.stopImmediatePropagation(),this._state.checkStatus===d.CHECK_STATUS.PERMISSION_REQUIRED?(0,i.dispatchCustomEvent)(document,T.eventNames.permissionRequiredIconClicked,n):(this._wasToolbarSmall=this._isSizeDecreased,this._toggleDialog(n))}_onTurnOffClick(e){e.stopImmediatePropagation();const t={toolbar:this};(0,i.dispatchCustomEvent)(document,T.eventNames.turnOff,t),this.toggleDisableMenu()}_onPauseCheckingClick(e){e?.stopImmediatePropagation();const t={toolbar:this};(0,i.dispatchCustomEvent)(document,T.eventNames.pauseChecking,t),this.toggleDisableMenu()}_isHorizontal(){return this._appearance.isHorizontal()}_getLanguageSupport(){return this._state.languageCode?l.SUPPORTED_REPHRASE_LANGUAGES.some((e=>u.LanguageManager.getPrimaryLanguageCode(e)===u.LanguageManager.getPrimaryLanguageCode(this._state.languageCode)))?f.Supported:f.NotSupported:f.NotDetected}updateState(e,t=!1){const n=void 0===e.checkStatus?this._state.checkStatus:e.checkStatus,s=void 0===e.recommendationStatus?this._state.recommendationStatus:e.recommendationStatus;let r=0;n!==d.CHECK_STATUS.COMPLETED&&n!==d.CHECK_STATUS.IN_PROGRESS||(r=e.premiumErrorsCount);const i=e.isIncompleteResult;let o="";n===d.CHECK_STATUS.FAILED&&(o=void 0===e.checkErrorMessage?this._state.checkErrorMessage:e.checkErrorMessage),this._state={checkStatus:n,recommendationStatus:s,premiumErrorsCount:r,isIncompleteResult:i,checkErrorMessage:o,showNotification:e.showNotification,text:e.text,sentenceRanges:e.sentenceRanges,selection:e.selection,languageCode:e.languageCode,errors:e.errors,fixAllMetadata:e.fixAllMetadata,isPremium:e.isPremium,selectedText:e.selectedText,showOptionalError:e.showOptionalError,isSentenceRangesChecking:e.isSentenceRangesChecking},this._fixAllMetadata=this._state.fixAllMetadata,this.selectedText=this._state.selectedText,this._animationFrame=requestAnimationFrame((()=>{this._render(),this._updateDisplaying(t)}))}getContainer(){return this._controls.wrapper}destroy(){this._destroyed=!0,this._eventListeners.forEach((e=>{e.destroy()})),this._eventListeners=[];for(const e in this._controls)this._controls[e]&&(this._controls[e].element?(this._controls[e].unmount?.(),this._controls[e].element.remove()):this._controls[e].remove(),this._controls[e]=null);this._domMeasurement.clearCache(),this._renderInterval&&this._renderInterval.destroy(),this._decreaseSizeInterval&&this._decreaseSizeInterval.destroy(),self.removeEventListener("pagehide",this._onUnload,!0),this._inputArea.removeEventListener("input",this._updateIsTyping,!0),this._inputArea.removeEventListener("paste",this._updateIsTyping,!0),cancelAnimationFrame(this._animationFrame),this._isTypingTimeout&&self.clearTimeout(this._isTypingTimeout),this._isScrollingTimeout&&self.clearTimeout(this._isScrollingTimeout),this._extrasMouseoverTimeout&&self.clearTimeout(this._extrasMouseoverTimeout),this._scrollObserver&&this._scrollObserver.destroy()}_fixToolbarOverlapsAndRender(e,t){this._domMeasurement.setStyles(e,{opacity:"0","pointer-events":"none"},!0),this._render(),this._xDisplacementRequiredToAvoidOverlap=this._appearance.getXDisplacementRequiredToAvoidOverlap(e,this._inputArea),this._xDisplacementRequiredToAvoidOverlap?(t.left=`calc(${t.left} - ${this._xDisplacementRequiredToAvoidOverlap}px)`,this._currentStyles=t,this._domMeasurement.setStyles(e,{opacity:"1","pointer-events":"all",left:t.left},!0)):0===this._xDisplacementRequiredToAvoidOverlap&&this._domMeasurement.setStyles(e,{opacity:"1","pointer-events":"all"},!0)}}T.CONTAINER_ELEMENT_NAME=`${E}-toolbar`,T.MENU_ELEMENT_NAME=`${E}-comp-menu`,T.TOOLBAR_SIZE=g.default.get(g.ConfigKey.TOOLBAR_SIZE),T.eventNames={languageChanged:`${E}
471-toolbar.languageChanged`,permissionRequiredIconClicked:`${E}-toolbar.permissionRequiredIconClicked`,toggleDialog:`${E}-toolbar.toggleDialog`,showRephrasingCard:`${E}-toolbar.showRephrasingCard`,turnOff:`${E}-toolbar.turnOff`,pauseChecking:`${E}-toolbar.pauseChecking`,fixAllErrors:`${E}-toolbar.fixAllErrors`,visibilityChanged:`${E}-toolbar.visibilityChanged`},T._isInitialized=!1},
471"./content/toolbarUtils.ts":
472/*!*********************************!*\
473  !*** ./content/toolbarUtils.ts ***!
474  \*********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{getXDisplacementRequiredToAvoidOverlap:()=>r});var s=n(/*! ../common/utils */"./common/utils.ts");function r(e,t){const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return null;try{return i(e,t,t.getBoundingClientRect(),n)}catch(e){return 0}}function i(e,t,n,r,a=0,l=new WeakMap){const c=e.ownerDocument,d=r.x,h=r.x+r.width/2,u=r.x+r.width,g=r.y;function m(e){let t=l.get(e);return t||(t=e.getBoundingClientRect(),l.set(e,t)),t}let p=[...new Set([...c.elementsFromPoint(d,g),...c.elementsFromPoint(h,g),...c.elementsFromPoint(u,g)])].filter((e=>{if("true"!==(i=e).contentEditable&&"TEXTAREA"!==i.tagName&&"INPUT"!==i.tagName&&"IFRAME"!==i.tagName&&"BODY"!==i.tagName&&"HTML"!==i.tagName){const i=o(e,d,h,u,g,m);if(i.width*i.height<n.width*n.height&&!(0,s.areRectsSimilarSize)(i,n)&&(0,s.isElementOnTop)(e,i,t,n,c)&&(0,s.getRectOverlapPercentage)(r,i)>=10)return l.set(e,i),!0}var i;return!1}));p=p.filter((t=>!e.contains(t)&&!p.some((e=>e!==t&&e.contains(t)))));let _=0,E=new DOMRect(r.x,r.y,r.width,r.height);for(const e of p){const t=o(e,d,h,u,g,m);let n=0;(0,s.getRectOverlapPercentage)(E,t)>=10&&(n=Math.abs(t.x-E.x-E.width)),0!==n&&(_+=n,E=new DOMRect(E.x-n,E.y,E.width,E.height))}return 0===_||(a<1&&(_+=i(e,t,n,E,a+1,l)),0!==a||(_+=5,(0,s.isRectContainsRect)(n,E)))?_:0}function o(e,t,n,s,r,i){let o;if(e.shadowRoot){const a=e.shadowRoot.elementFromPoint(t,r)||e.shadowRoot.elementFromPoint(n,r)||e.shadowRoot.elementFromPoint(s,r);a&&(o=i(a))}else o=i(e);return o}},
474"./content/typingSpeedController.ts":
475/*!******************************************!*\
476  !*** ./content/typingSpeedController.ts ***!
477  \******************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{TypingSpeedController:()=>i});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../core/utils */"./core/utils.ts");class i{constructor(e){this._config={inactivityThreshold:s.TYPING_BURST_SESSION_INACTIVITY_DELAY,minCharsPerBurst:s.VALID_MIN_CHARACTERS_CHANGE_PER_TYPING_BURST,flushMaxBufferSize:s.MAX_BURST_BUFFER_SIZE,allowedDeltaOfChange:s.VALID_MAX_CHARACTERS_DELTA_ALLOWED,onBurstFlushCallback:()=>{},onBurstEndCallback:()=>{},...e},this._burstTimeoutId=null,this._burstData=[],this._reset()}_reset(){this._startedAt=0,this._lastChangeTimeStamp=0,this._totalTypedChars=0,this._isBursting=!1}_getAllBursts(){return this._burstData}_getBurstSessionBifurcationInBuffer(){const e=this._getAllBursts();return 0===e.length?{validBursts:[],ignoredBursts:[]}:{validBursts:e.filter((e=>e.charCount>=this._config.minCharsPerBurst)),ignoredBursts:e.filter((e=>e.charCount<this._config.minCharsPerBurst))}}_getOverAllCpm(e){if(0===e.length)return 0;const t=e.reduce(((e,t)=>e+t.charCount),0),n=e.reduce(((e,t)=>e+t.durationMs),0);return 0===n?0:parseFloat((t/n*6e4).toFixed(2))}_getWeightedCpm(e){let t=0,n=0;for(const s of e)t+=s.charCount,n+=s.cpm*s.charCount;return t>0?parseFloat((n/t).toFixed(2)):0}_getAverageBurstDuration(e){return e.length?e.reduce(((e,t)=>e+t.durationMs),0)/e.length:0}_startNewBurst(e){this._startedAt=e,this._isBursting=!0}_checkAndFlushOnMaxBufferSize(){const{validBursts:e}=this._getBurstSessionBifurcationInBuffer();return e.length>=this._config.flushMaxBufferSize&&(this.flushAllBurstSessions("maxBufferSizeReached"),!0)}_endCurrentBurst(e,t="unknown"){if(!this._startedAt||!this._isBursting)return;const n=e-this._startedAt,s=n>0?this._totalTypedChars/(n/6e4):0,r={startedAt:this._startedAt,charCount:this._totalTypedChars,durationMs:n,cpm:parseFloat(s.toFixed(2)),endedAt:e,endReason:t};try{this._config.onBurstEndCallback(r)}catch(e){console.error("Error invoking onBurstEndCallback",e)}this._burstData.push(r),this._isBursting=!1,this._burstTimeoutId&&(self.clearTimeout(this._burstTimeoutId),this._burstTimeoutId=null),this._checkAndFlushOnMaxBufferSize(),this._reset()}flushAllBurstSessions(e){const{validBursts:t,ignoredBursts:n}=this._getBurstSessionBifurcationInBuffer(),s=this._getOverAllCpm(t),r=this._getWeightedCpm(t);try{this._config.onBurstFlushCallback({overallCpm:s,weightedCpm:r,validBursts:t,ignoredBursts:n,totalInActivityPause:t.length+n.length,flushReason:e,avgIgnoredBurstDuration:this._getAverageBurstDuration(n),avgValidBurstDuration:this._getAverageBurstDuration(t)})}catch(e){console.error("Error on onBurstFlushCallback ")}this._burstData=[]}onChange({previousText:e,currentText:t,currentTime:n=Date.now(),endBurst:s=!1,endBurstReason:i}){if(s)return void this._endCurrentBurst(n,i);const o=(0,r.getTextsDiff)(e,t);if(!o)return void this._endCurrentBurst(n,"no change detected");const a=Math.max(o.oldFragment.length,o.newFragment.length);a>=this._config.allowedDeltaOfChange?this._endCurrentBurst(n,"changes exceed the max delta of allowed change"):(this._burstTimeoutId&&self.clearTimeout(this._burstTimeoutId),this._isBursting||this._startNewBurst(n),this._totalTypedChars+=a,this._lastChangeTimeStamp=n,this._burstTimeoutId=self.setTimeout((()=>{this._endCurrentBurst(this._lastChangeTimeStamp,"inactivity")}),this._config.inactivityThreshold))}}},
477"./content/userActivityMonitor.ts":
478/*!****************************************!*\
479  !*** ./content/userActivityMonitor.ts ***!
480  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{UserActivityMonitor:()=>m});var s=n(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),r=n(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),i=n(/*! ../core/utils */"./core/utils.ts"),o=n(/*! ../common/languageManager */"./common/languageManager.ts"),a=n(/*! ../config/config */"./config/config.ts");const l=[];let c;const d=()=>{s.EnvironmentAdapter.isRuntimeConnected()&&s.EnvironmentAdapter.sendUserActivityPings(l)},h=[];let u=!1;const g=()=>{h.forEach((e=>e()))};class m{constructor(e,t,n,r,o,m){var p,_;this._hiddenMatches=0,this._pickyErrors=0,this._email=e,this._token=t,this._currentText=m.trim(),this._isNewText=""===this._currentText,this._activityId=(0,i.uuidv4)(),s.EnvironmentAdapter.initializeUserActivity({uuid:this._activityId,source:s.EnvironmentAdapter.getType(),email:this._email,token:this._token,language:n?.code,writingGoalId:r,checkLevel:o}),this._unregisterPing=(p=this._activityId,l.push(p),c||(c=self.setInterval(d,a.USER_ACTIVITY_PING_INTERVAL_LENGTH)),()=>{const e=l.indexOf(p);-1!==e&&l.splice(e,1),l.length||(self.clearInterval(c),c=void 0)}),this._unregisterBeforeUnloadListener=(_=()=>this.send(),h.push(_),u||(u=!0,self.addEventListener(s.EnvironmentAdapter.getBeforeUnloadEventName(),g,!0)),()=>{const e=h.indexOf(_);-1!==e&&h.splice(e,1),h.length||(self.removeEventListener(s.EnvironmentAdapter.getBeforeUnloadEventName(),g,!0),u=!1)})}async detectNewText(e){e=e.trim(),""!==this._currentText&&""===e&&(this._isNewText=!0),this._currentText=e}async updateErrorMeta({pickyErrors:e,hiddenMatches:t}){if(!e&&!t)return;const n=Math.max(0,e-this._pickyErrors),r=Math.max(0,t-this._hiddenMatches);(n||r)&&(s.EnvironmentAdapter.updateUserActivityTextStatistics(this._activityId,{hiddenMatches:r,pickyErrors:n}),this._pickyErrors=e,this._hiddenMatches=t)}async incrementWordWritten(){const e={words:1};this._isNewText&&(e.texts=1,this._isNewText=!1),s.EnvironmentAdapter.updateUserActivityTextStatistics(this._activityId,e)}async incrementSentenceWritten(e){const t={sentences:1,words:Number(e)};this._isNewText&&(t.texts=1,this._isNewText=!1),s.EnvironmentAdapter.updateUserActivityTextStatistics(this._activityId,t)}async incrementSuggestionsApplied(e,t){s.EnvironmentAdapter.updateUserActivityAppliedSuggestions(this._activityId,e,t)}async incrementRewritingsApplied(){s.EnvironmentAdapter.updateUserActivityAppliedRewritings(this._activityId)}async updateMeta(e){e.language&&(e.language=o.LanguageManager.getPrimaryLanguageCode(e.language)),s.EnvironmentAdapter.updateUserActivityMeta(this._activityId,e)}async send(){try{const e=await s.EnvironmentAdapter.sendUserActivity(this._activityId);["success","no_update"].includes(e)||r.TrackerAdapter.trackError("http",`user_activity_update_${e}`)}catch(e){r.TrackerAdapter.trackError("js",e.message||"Failed to send User Activity")}}async destroy(){try{const e=await s.EnvironmentAdapter.destroyUserActivity(this._activityId);!["success","no_update"].includes(e)&&Math.random()<.01&&r.TrackerAdapter.trackError("http",`user_activity_destroy_${e}`)}catch(e){r.TrackerAdapter.trackError("js",e.message||"Failed to destroy User Activity")}this._unregisterBeforeUnloadListener(),this._unregisterPing()}}},
480"./core/Checker.ts":
481/*!*************************!*\
482  !*** ./core/Checker.ts ***!
483  \*************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Checker:()=>a});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ../init/config */"./init/config.ts"),i=n(/*! ./LanguageDetector */"./core/LanguageDetector.ts"),o=n(/*! ./utils */"./core/utils.ts");
484/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
485class a{static getServerBaseUrl(e,t=!1,n=!0){const r=n&&(t?this._useFallbackServerForParagraphLevelRequests:this._useFallbackServerForTextLevelRequests)&&!e.apiServerUrl;return e.apiServerUrl&&!this._isLanguageToolServer(e.apiServerUrl)?e.apiServerUrl:e.isPremium||e.user||e.apiServerUrl===s.PREMIUM_SERVER_URL?r?s.PREMIUM_FALLBACK_SERVER_URL:s.PREMIUM_SERVER_URL:r?s.MAIN_FALLBACK_SERVER_URL:s.MAIN_SERVER_URL}static _getServerFullUrl(e,t=!1){const n=this.getServerBaseUrl(e,t),s=n.endsWith("/")?"":"/",r=new URL(n+s+"check");return r.searchParams.set("c","1"),r.searchParams.set("instanceId",e.instanceId),e.version&&r.searchParams.set("v",e.version),r.toString()}static _abortTextLevelCheckRequest(e){this._textLevelAbortControllers.has(e)&&(this._textLevelAbortControllers.get(e).abort(),this._textLevelAbortControllers.delete(e))}static _abortParagraphLevelCheckRequest(e){this._paragraphLevelAbortControllers.has(e)&&(this._paragraphLevelAbortControllers.get(e).abort(),this._paragraphLevelAbortControllers.delete(e))}static _abortLanguageDetectionRequest(e){this._languageDetectionAbortControllers.has(e)&&(this._languageDetectionAbortControllers.get(e).abort(),this._languageDetectionAbortControllers.delete(e))}static _abortRecommendationRequest(e){const t=this._recommendationAbortControllers.get(e);t&&(t.abort(),this._recommendationAbortControllers.delete(e))}static abortTextLevelCheck(e){this._abortTextLevelCheckRequest(e)}static abortParagraphLevelCheck(e){this._abortParagraphLevelCheckRequest(e)}static abortLanguageDetection(e){this._abortLanguageDetectionRequest(e)}static abortRecommendation(e){this._abortRecommendationRequest(e)}static _prepareText(e){return e.replace(this.ZWNJ_REGEXP,this.ZWS)}static _joinInChunks(e,t=s.PARAGRAPH_LEVEL_CHUNK_LENGTH){const n=[];let r=0,i=[];return e.forEach((e=>{r>t&&(r=0,i=[]),i.push(e),r+=e.text.length,n.includes(i)||n.push(i)})),n}static _getRequestData(e,t,n){const r=new URLSearchParams,i={text:e};n.recipientInfo&&(n.recipientInfo.address||n.recipientInfo.fullName)&&(i.metaData={EmailToAddress:n.recipientInfo.address,FullName:n.recipientInfo.fullName}),r.append("data",JSON.stringify(i));const o=Boolean(n.isPremium||!n.apiServerUrl||n.apiServerUrl&&n.apiServerUrl.startsWith(s.PREMIUM_SERVER_URL)||n.apiServerUrl&&!this._isLanguageToolServer(n.apiServerUrl));if(o&&n.user&&"password"in n.user?(r.append("username",n.user.email),r.append("password",n.user.password)):o&&n.user&&"token"in n.user&&(r.append("username",n.user.email),r.append("tokenV2",n.user.token)),r.append("textSessionId",n.instanceId),!n.isPremium&&n.enableHiddenMatches&&r.append("enableHiddenRules","true"),n.motherTongue&&s.RELIABLE_MOTHER_TONGUES.includes(n.motherTongue)&&r.append("motherTongue",n.motherTongue),"normal"!==n.checkLevel&&r.append("level",n.checkLevel.replace("hidden-","")),t)r.append("language",t.code);else{r.append("language","auto"),r.append("noopLanguages",n.preferredLanguages.join(","));const e=this._getPreferredVariants(n.languageVariants);e.length>0&&r.append("preferredVariants",e.toString())}if(n.testGroups){const e=[];for(const[t,s]of Object.entries(n.testGroups))s&&e.push(t);e.length&&r.append("abtest",e.join(","))}if(r.append("preferredLanguages",n.preferredLanguages.join(",")),n.forcePreferredLanguages&&r.append("forcePreferredLanguages","true"),n.writingGoalId){const e=this.HIGH_LEVEL_GOALS.find((e=>e.id===n.writingGoalId));e&&r.append("toneTags",e.tags.join(","))}const a=["WHITESPACE_RULE"].concat(n.disabledRules.filter((e=>s.RULES_ALLOWED_TO_BE_SENT_TO_API.includes(e))));return r.append("disabledRules",a.join(",")),n.userAgent&&r.append("useragent",n.userAgent),r}static _getHeaders(e){if(!e.accessToken)return;const t=new Headers;return t.append("Authorization",`Bearer ${e.accessToken}`),t}static _getPreferredVariants(e){return Object.values(e)}static _getTextLevelRequestData(e,t,n){const s=this._getRequestData(e,t,n);
485return s.append("mode","textLevelOnly"),s}static _getParagraphLevelCheckRequestData(e,t,n){const s=this._getRequestData(e,t,n);return s.append("mode","allButTextLevelOnly"),s.append("allowIncompleteResults",String(n.allowIncompleteResults||!1)),s}static async _sendRequest(e,t,n=s.CHECK_REQUEST_TIMEOUT){const r=fetch(e,t).catch((t=>{throw"AbortError"===t.name?{reason:"AbortError",status:0,response:t.message||""}:{reason:"ConnectionError",status:0,url:e.replace(/\?.*/,""),response:t.message||""}})).then(this._checkForException).then((e=>e.json())),i=new Promise(((t,s)=>{setTimeout((()=>{s({reason:"TimeoutError",status:0,url:e.replace(/\?.*/,""),response:""})}),n)}));return Promise.race([r,i])}static _isConnectionOrServerIssue(e){return s.SWITCH_TO_FALLBACK_SERVER_ERRORS.includes(e.status)||["ConnectionError","TimeoutError"].includes(e.reason)}static _getGraphemesCount(e,t,n=0){for(let s=n;s<e.length;s++){if(t<=0)return s-n;t-=e[s].length}return e.length-n}static _getCodepointsCount(e,t,n=0){let s=0;for(let r=n;r<Math.min(e.length,n+t);r++)s+=e[r].length;return s}static _correctMatches(e,t,n){if(t!==n){const s=(0,o.splitGraphemes)(t),r=(0,o.splitGraphemes)(n);for(const t of e){const e=a._getGraphemesCount(s,t.offset),n=a._getGraphemesCount(s,t.length,e);t.offset=a._getCodepointsCount(r,e),t.length=a._getCodepointsCount(r,n,e)}}return e}static _getLeftText(e,t,n,s=15,r=!1,i=[],o="auto",a=!1){let l=Math.max(t-s,0);if(r&&i.length>0){const e=i.find((e=>t>=e.start&&t<=e.end));e&&(l=a?e.start:Math.max(l,e.start))}if(n){const n=e.lastIndexOf("\n",t);n>=l&&(l=n+1)}let c=e.substring(l,t).replace(this.NON_ALPHANUMERIC_AT_BEGINNING_REGEXP,""),d=!1;return d="always"===o?0!==l:"never"!==o&&!(0===l||n&&"\n"===e[l-1]||r&&i.some((e=>l===e.start))),d&&(c="..."+c),c}static _getRightText(e,t,n,s=15,r=!1,i=[],o="auto",a=!1){let l=Math.min(t+s,e.length);if(r&&i.length>0){const e=i.find((e=>t>=e.start&&t<=e.end));e&&(l=a?e.end:Math.min(l,e.end))}if(n){const n=e.indexOf("\n",t);-1!==n&&n<=l&&(l=n)}let c=e.substring(t,l).replace(this.NON_ALPHANUMERIC_AT_END_REGEXP,""),d=!1;return d="always"===o?l!==e.length:"never"!==o&&!(l===e.length||n&&"\n"===e[l]||r&&i.some((e=>l===e.end))),d&&(c+="..."),c}static _transformMatches(e,t,n,s=!1,r,i=[]){return e.map((e=>{const l=e.rule.id.startsWith("DB_"),c=this.SPELLING_RULES_ID.some((t=>e.rule.id.includes(t))),d=this.STYLE_ISSUE_TYPES.some((t=>e.rule.issueType===t)),h="typographical"===e.rule.issueType&&"CASING"!==e.rule.category.id||"PUNCTUATION"===e.rule.category.id||"TYPOGRAPHY"===e.rule.category.id||e.rule.category.id.includes("KOMMA"),u=Boolean(e.rule.tags&&e.rule.tags.includes("picky")),g="RECOMMENDATION"===e.rule.issueType||"PHRASAL_RECOMMENDATION"===e.rule.issueType,m=!1===e.rule.showInline,p=t.substr(e.offset,e.length),_=r?.strictByParagraph??s,E=r?.useSentenceAwareContext??!1,f=r?.shortContext,T=f?.maxContextLength??15,C=f?.ellipsisMode??"auto",v=f?.forceCompleteSentences??!1,S=r?.longContext,b=S?.maxContextLength??60,x=S?.ellipsisMode??"auto",y=S?.forceCompleteSentences??!1,A=`${a._getLeftText(t,e.offset,_,T,E,i,C,v)}|${p}|${a._getRightText(t,e.offset+e.length,_,T,E,i,C,v)}`,k=a._getLeftText(t,e.offset,!0,b,E,i,x,y),w=a._getRightText(t,e.offset+e.length,!0,b,E,i,x,y),R=`${(0,o.escapeHTML)(k)}<lt-em>${(0,o.escapeHTML)(p)}</lt-em>${(0,o.escapeHTML)(w)}`;let L="";e.shortMessage&&e.shortMessage.length<60&&e.shortMessage!==e.message&&(L=e.shortMessage.replace(this.PUNCTUATION_AT_END,""));const M=e.replacements.map((e=>({value:e.value,htmlValue:e.htmlValue,prefix:e.prefix,suffix:e.suffix,type:e.type,shortDescription:e.shortDescription})));return{isParagraphLevelCheck:s,rule:e.rule,isCustomError:l,isSpellingError:c,isStyleError:d,isPunctuationError:h,isPicky:u,isRecommendation:g,isOptional:m,contextForSureMatch:e.contextForSureMatch,language:{code:n.code,name:n.name},description:e.message,shortDescription:L,goodExample:e.goodExample,badExample:e.badExample,start:e.offset,end:e.offset+e.length,length:e.length,originalPhrase:p,contextPhrase:A,longContextPhrase:R,fixes:M,isLocked:e.isLocked}}))}
485static _adjustErrors(e,t,n){const r=n.recipientInfo?n.recipientInfo.fullName.split(" ").filter((e=>e)):[];return e.filter((e=>{if(!e.isPicky&&e.rule.id.startsWith("QB_NEW_")&&1===e.fixes.length&&e.originalPhrase+"."===e.fixes[0].value&&(e.end===t.length||"\n"===t.substring(e.end,e.end+1))&&(e.isPicky=!0,!n.checkLevel.includes("picky")))return!1;if(e.originalPhrase.startsWith(s.INVISIBLE_SEPARATOR)){const t=e.originalPhrase.length;if(e.originalPhrase=(0,o.trimInvisibleSeparatorAtStart)(e.originalPhrase),e.start+=t-e.originalPhrase.length,e.fixes[0]&&e.originalPhrase===e.fixes[0].value)return!1}if(e.originalPhrase.endsWith(s.INVISIBLE_SEPARATOR)){const t=e.originalPhrase.length;if(e.originalPhrase=(0,o.trimInvisibleSeparatorAtEnd)(e.originalPhrase),e.end-=t-e.originalPhrase.length,e.fixes[0]&&e.originalPhrase===e.fixes[0].value)return!1}if(e.fixes=e.fixes.filter((t=>t.value!=="("+e.originalPhrase+")"&&t.value!==e.originalPhrase&&"(suggestion limit reached)"!==t.value&&"(se ha alcanzado el límite de sugerencias)"!==t.value&&"(Vorschlagslimit erreicht)"!==t.value)),e.language.code.startsWith("en")&&(0,o.isAllUppercase)(e.originalPhrase)&&!/[a-z]/i.test(e.contextPhrase)&&e.fixes.forEach((t=>{t.value.toLowerCase()!==e.originalPhrase.toLowerCase()&&(t.value=t.value.toUpperCase())})),"PT_CLICHE_REPLACE"!==e.rule.id&&"PT_WORDINESS_REPLACE"!==e.rule.id||e.fixes.forEach((t=>{(t.value.startsWith("REFORMULAR")||t.value.startsWith("APAGAR")||t.value.startsWith("ESPECIFICAR"))&&(e.description=e.description.replace(/\sÉ preferível dizer.+(REFORMULAR|APAGAR|ESPECIFICAR).+$/,""),t.value="")})),this.EMAIL_SIGNATURE_SEPARATOR_REGEXP.test(e.originalPhrase))return!1;if(this.INVISIBLE_PHRASE_REGEXP.test(e.originalPhrase))return!1;if(e.rule.id.endsWith("WORD_REPEAT_BEGINNING_RULE")&&this.ONLY_NUMBERS_REGEXP.test(e.originalPhrase))return!1;if("LEERZEICHEN_HINTER_DOPPELPUNKT"===e.rule.id&&this.COLON_WHITESPACE_REGEXP.test(e.originalPhrase))return!1;const i=t.substring(e.start-25,e.start),a=t.substr(e.end,25);if(n.ignoreCapitalizationErrorsAtLineStart&&"UPPERCASE_SENTENCE_START"===e.rule.id&&this.PREVENT_MID_SENTENCE_CAPITALIZATION.test(i))return!1;if(n.ignoreCapitalizationErrorsAtLineStart&&"PUNCTUATION_PARAGRAPH_END"===e.rule.id&&this.PREVENT_MID_SENTENCE_PUNCTUATION.test(a))return!1;if("DE_CASE"===e.rule.id&&this.BULLET_POINT_REGEXP.test(i))return!1;if("DE_CASE"===e.rule.id&&this.NUMBER_WITH_PARENTHESIS_AT_END_REGEXP.test(i))return!1;if("DE_CASE"===e.rule.id&&this.PIPE_AT_END_REGEXP.test(i))return!1;if("DE_CASE"===e.rule.id&&this.MARKDOWN_HEADLINE_REGEXP.test(i))return!1;if("DE_CASE"===e.rule.id&&this.EMOJI_SENTENCE_START_REGEXP.test(i))return!1;if("LEERZEICHEN_HINTER_DOPPELPUNKT"===e.rule.id&&this.MARKDOWN_INLINE_FORMAT_AT_BEGINNING_REGEXP.test(a))return!1;if("LEERZEICHEN_HINTER_DOPPELPUNKT"===e.rule.id&&this.WIKI_MARKUP_AT_END_REGEXP.test(i))return!1;if(e.rule.id.endsWith("UNPAIRED_BRACKETS")&&this.ONE_LETTER_AT_END_REGEXP.test(i))return!1;if(e.rule.id.endsWith("UNPAIRED_BRACKETS")&&this.NUMBER_WITH_DOT_AT_END_REGEXP.test(i))return!1;if("SENTENCE_WHITESPACE"===e.rule.id&&i.endsWith("{!"))return!1;if("SENTENCE_WHITESPACE"===e.rule.id&&this.SINGLE_UPPERCASE_LETTER_REGEXP.test(e.originalPhrase)&&this.ABBREVIATION_AT_END_REGEXP.test(i))return!1;if("SENTENCE_WHITESPACE"===e.rule.id&&"net"===e.originalPhrase.toLowerCase())return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&this.NET_AT_BEGINNING_REGEXP.test(a))return!1;if(e.rule.id.startsWith("AI_")&&1===e.fixes.length&&e.originalPhrase.replace(this.INVISIBLE_CHARS_REGEXP,"")===e.fixes[0].value)return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&e.originalPhrase.endsWith(")")&&i.endsWith(this.ZWS))return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&e.originalPhrase.endsWith(".")&&this.FILE_TYPE_AT_BEGINNING_REGEXP.test(a))return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&i.endsWith("(")&&(",)"===e.originalPhrase||".)"===e.originalPhrase))return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&i.endsWith("\n")&&[")","}","]","."].includes(e.originalPhrase))return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&a.startsWith("/"))return!1;if("COMMA_PARENTHESIS_WHITESPACE"===e.rule.id&&e.originalPhrase.includes(this.ZWS))return!1;if("WORT1_BINDESTRICH_SPACE_WORT2"===e.rule.id&&e.originalPhrase.endsWith(this.ZWS))return!1;if("MULTIPLICATION_SIGN"===e.rule.id&&(this.AT_LEAST_TWO_LETTERS_AT_END_REGEXP.test(i)||!a||this.PUNCTUATION_AT_BEGINNING_REGEXP.test(a)))return!1;if("ZBEDNA_SPACJA_PRZED"===e.rule.id&&e.originalPhrase.includes(this.ZWS))return!1;if("UNLIKELY_OPENING_PUNCTUATION"===e.rule.id&&this.PUNCTUATION_
485SPACE_AT_END_REGEXP.test(i))return!1;if("WORD_CONTAINS_UNDERSCORE"===e.rule.id&&(!this.LOWERCASE_REGEXP.test(e.originalPhrase)||e.originalPhrase.includes("-")||e.originalPhrase.includes("__")||this.SLASH_AT_END_REGEXP.test(i)||this.SLASH_AT_BEGINNING_REGEXP.test(a)))return!1;if("WORD_CONTAINS_UNDERSCORE"===e.rule.id&&i.endsWith("[")&&a.startsWith("]"))return!1;if("WORD_CONTAINS_UNDERSCORE"===e.rule.id&&s.QUOTE_AT_END_REGEXP.test(i)&&s.QUOTE_AT_BEGINNING_REGEXP.test(a))return!1;if("WORD_CONTAINS_UNDERSCORE"===e.rule.id&&(i.endsWith("=")||i.endsWith("&")||i.endsWith("?")))return!1;if(["APOS_INCORRECT","LOOSE_ACCENTS"].includes(e.rule.id)&&"`"===e.originalPhrase)return!1;if(["_2_AANH_B","FALSCHES_ANFUEHRUNGSZEICHEN_2"].includes(e.rule.id)&&"``"===e.originalPhrase)return!1;if("DASH_RULE"===e.rule.id&&a.startsWith(" [")&&(!i||i.endsWith("\n")))return!1;if(e.isSpellingError&&e.originalPhrase.length>6&&e.fixes.length>4&&e.language.code.startsWith("de")&&(e.fixes.length=4),e.isSpellingError||"WORD_CONTAINS_UNDERSCORE"===e.rule.id){const t=e.originalPhrase.charAt(0),s=e.originalPhrase.toLowerCase();if((0,o.isErrorIgnoredByDictionary)(e,n.dictionary))return!1;if((a.startsWith("_")||i.endsWith("_"))&&!e.language.code.startsWith("de"))return!1;if(e.originalPhrase.startsWith("$")&&a.startsWith("}")&&i.endsWith("{"))return!1;if(e.originalPhrase.startsWith("$")&&e.originalPhrase.endsWith("$"))return!1;if(this.HTML_ENTITIES.includes(e.originalPhrase)&&i.endsWith("&")||this.HTML_ENTITIES_WITH_AND.includes(e.originalPhrase)||this.HTML_ENTITIES_WITH_AND.includes("&"+e.originalPhrase))return!1;if(this.COMMON_TLDS.some(((e,t)=>s.endsWith("."+e)||this.COMMON_TLD_WITH_DOT_REGEXPS[t].test(a))))return!1;if(this.DOT_WITH_PREFIX_REGEXP.test(i)&&this.COMMON_TLDS.includes(s))return!1;if(this.COMMON_FILE_TYPES.some(((e,t)=>s.endsWith("."+e)||this.COMMON_FILE_TYPE_WITH_DOT_REGEXPS[t].test(a))))return!1;if(this.DOT_WITH_PREFIX_REGEXP.test(i)&&this.COMMON_FILE_TYPES.includes(s))return!1;const l="@"===t||this.MENTION_SYMBOL_AT_BEGINNING_REGEXP.test(i),c="#"===t||this.HASH_SYMBOL_AT_BEGINNING_REGEXP.test(i);if(l||c)return!1;if(r.some((t=>t===e.originalPhrase)))return!1;if(this.WAVY_DASH_REGEXP.test(e.originalPhrase))return!1;for(const t of r)if(t.toLowerCase()===e.originalPhrase.toLowerCase()&&!e.fixes.some((e=>e.value===t))){e.fixes.unshift({value:t});break}}return!0}))}static _processResponse(e,t,n,s,i,o=!1,a=!1,l=!1){e.matches=this._correctMatches(e.matches,n,s);let c=this._transformMatches(e.matches,s,e.language,o,i?.contextConfig,t);c=this._adjustErrors(c,s,i);let d=[];const h=[],u=[];if(t=this._correctMatches(t.filter((({start:e,end:t})=>t-e>-1)).map((({start:e,end:t,detectedLanguages:n,checkStatus:s})=>({offset:e,length:t-e,detectedLanguages:n,checkStatus:s}))),n,s).map((({offset:e,length:t,detectedLanguages:n,checkStatus:s})=>({start:e,end:e+t,length:t,detectedLanguages:n,checkStatus:s}))),a)return{errors:[],premiumErrors:[],pickyErrors:[],premiumPickyErrors:[],sentenceRanges:t};if(l){const e=r.default.get(r.ConfigKey.FIX_ALL_CONFIG);return{errors:c.filter((t=>!(!t.isRecommendation||e.FIX_RECOMMENDATIONS)||!(!t.isStyleError||e.FIX_STYLE_ERRORS)||!e.FIX_GC_ERRORS)),premiumErrors:[],pickyErrors:[],premiumPickyErrors:[],sentenceRanges:t}}return i.debug&&c.forEach((e=>{e.description=(e.rule.isPremium?"prem:":"")+e.rule.id+"["+(e.rule.subId||"")+"] "+e.description})),e.hiddenMatches&&(d=d.concat(this._transformMatches(e.hiddenMatches,s,e.language,o,i?.contextConfig,t))),"hidden-picky"===i.checkLevel&&(c=c.filter((e=>!e.isPicky||(u.push(e),!1))),e.hiddenMatches&&(d=d.filter((e=>!e.isPicky||(h.push(e),!1))))),{errors:c,premiumErrors:d,pickyErrors:u,premiumPickyErrors:h,sentenceRanges:t}}static _correctErrorOffsets(e,t){const n=[];let s=0;for(const r of e){const e=r.text.length;for(const i of t)if(i.start>=s&&i.end<=s+e){const e=Object.assign({},i);e.start=e.start-s+r.offset,e.end=e.start+e.length,e.rule?.phraseDiff?.forEach((e=>{e.sourceStart=e.sourceStart-s+r.offset,e.sourceEnd=e.sourceEnd-s+r.offset,e.targetEnd=e.targetEnd-s+r.offset,e.targetStart=e.targetStart-s+r.offset})),n.push(e)}s+=e+2}return n}static async checkTextLevel(e,t,n){e=this._prepareText(e);const r=Boolean(n.adapter);if(!e.trim()||r)return{language:t,errors:[],premiumErrors:[],pickyErrors:[],premiumPickyErrors:[]};this._abortTextLevelCheckRequest(n.instanceId),this._textLevelAbortControllers.set(n.instanceId,new AbortController),this._useFallbackServerForTextLevelRequests&&Date.now()-this._mainServerUnavailabilityTimeStamp>=s.MAIN_SERVER_RECHECK_INTERVAL&&(this._useFallbackServerForTextLevelRequests=!1);const i=e.normalize(),o=this._getServerFullUrl(n,!1),a={method:"post",mode:"cors",credentials:"omit",body:this._getTextLevelRequestData(i,t,n),headers:this._getHeaders(n),signal:this._textLevelAbortControllers.get(n.instanceId).signal};return this._sendRequest(o,a).then((t=>{const{errors:s,premiumErrors:r,pickyErrors:o,premiumPickyErrors:a}=this._processResponse(t,[],i,e,n);return{language:{code:t.language.code,name:t.language.name,detectedLanguage:t.language.detectedLanguage},errors:s,premiumErrors:r,pickyErrors:o,premiumPickyErrors:a}})).catch((s=>{if(this._isConnectionOrServerIssue(s)&&(this._abortTextLevelCheckRequest(n.instanceId),!n.apiServerUrl&&!this._useFallbackServerForTextLevelRequests))return this._useFallbackServerForTextLevelRequests=!0,this._mainServerUnavailabilityTimeStamp=Date.now(),this.checkTextLevel(e,t,n);throw s}))}static _buildSentenceRanges(e,t){if(!t.extendedSentenceRanges&&!t.sentenceRanges)return[];let n=t.extendedSentenceRanges;n||(n=(t.sentenceRanges||[]).map((e=>({from:e[0],to:e[1],detectedLanguages:[{language:t.language.code.split("-")[0],rate:1}]}))));const s=n.map((e=>({start:e.from,end:e.to,length:e.to-e.from,detectedLanguages:e.detectedLanguages.map((e=>({language:e.language,confidence:e.rate}))),checkStatus:e.checkStatus})));return(0,o.trimSentenceRanges)(s,e)}static cancelAllRequests(e){this._abortParagraphLevelCheckRequest(e),this._abortLanguageDetectionRequest(e),this._abortTextLevelCheckRequest(e),this._abortRecommendationRequest(e)}static async checkParagraphLevel(e,t,n,i,a,l,c,d="server"){if(e.forEach((e=>{e.text=this._prepareText(e.text)})),!e.some((e=>!!e.text.trim()))){const s={input:{acceptChangeType:o.AcceptChangeType.GC,language:t?.code,paragraphs:e,editorCompleteText:i||"",preferredVariants:this._getPreferredVariants(n.languageVariants),disableRecommendations:n.disableRecommendations,replacementText:l?.replacementText,hasUserAppliedFix:!1,changedParagraphsSentencesLength:a,appliedFixAll:c,writingGoal:n.writingGoalId,changedContent:n.changedContent||[],shouldUseOnDeviceLangDetection:"client"===d},signal:this._paragraphLevelAbortControllers.get(n.instanceId).signal,handleResponseCallback:(t,s)=>{if("editor_content_save_ack"===s)n?.handleResponseCallback?.(t,"editor_content_save_ack");else{const r=this._postProcessParagraphLevelCheckResult(t,e,e.map((e=>e.text)).join("\n\n").normalize(),e.map((e=>e.text)).join("\n\n"),n,h,a,c);n.handleResponseCallback?.(r,s)}},metaData:{instanceId:n.instanceId,tabId:n.tabId,hostUrl:n.hostUrl||"",hostCategory:n.hostCategory,writingSessionId:n.writingSessionId,lastEditorContentSavedTimestamp:n.lastEditorContentSavedTimestamp}};return n?.adapter?.grammarCheck?.(s),{language:t,errors:[],premiumErrors:[],pickyErrors:[],premiumPickyErrors:[],isIncompleteResult:!1,areErrorsSuppressed:!1}}this._abortParagraphLevelCheckRequest(n.instanceId),this._paragraphLevelAbortControllers.set(n.instanceId,new AbortController),this._useFallbackServerForParagraphLevelRequests&&Date.now()-this._mainServerUnavailabilityTimeStamp>=s.MAIN_SERVER_RECHECK_INTERVAL&&(this._useFallbackServerForParagraphLevelRequests=!1);let h=!1;if(l&&l.ruleId){const e=r.default.get(r.ConfigKey.AI_RULE_ID_REGEX);h=e.test(l.ruleId)}const u=this._getServerFullUrl(n,!0);let g=[e];n.adapter||(g=this._joinInChunks(e));const m=[];for(const e of g){const s=e.map((e=>e.text)).join("\n\n"),r=s.normalize(),g={method:"post",mode:"cors",credentials:"omit",body:this._getParagraphLevelCheckRequestData(r,t,n),headers:this._getHeaders(n),signal:this._paragraphLevelAbortControllers.get(n.instanceId).signal},p=(t,i)=>{if("editor_content_save_ack"===i)n.handleResponseCallback?.(t,"editor_content_save_ack");else{const o=this._postProcessParagraphLevelCheckResult(t,e,r,s,n,h,a,c);n.handleResponseCallback?.(o,i)}};let _;_="REPHRASING"===l?.ruleId?o.AcceptChangeType.REPHRASING:l?.isRecommendation?o.AcceptChangeType.GC_RECOMMENDATION:o.AcceptChangeType.GC;const E={input:{acceptChangeType:_,language:t?.code,paragraphs:e,editorCompleteText:i||"",preferredVariants:this._getPreferredVariants(n.languageVariants),disableRecommendations:n.disableRecommendations,replacementText:l?.replacementText,hasUserAppliedFix:!!l&&h,changedParagraphsSentencesLength:a,appliedFixAll:c,writingGoal:n.writingGoalId,changedContent:n.changedContent||[],responseType:n.responseType,shouldUseOnDeviceLangDetection:"client"===d},signal:this._paragraphLevelAbortControllers.get(n.instanceId).signal,handleResponseCallback:p,metaData:{instanceId:n.instanceId,tabId:n.tabId,hostUrl:n.hostUrl||"",hostCategory:n.hostCategory,writingSessionId:n.writingSessionId,lastEditorContentSavedTimestamp:n.lastEditorContentSavedTimestamp}},f=(n.adapter?n.adapter?.grammarCheck(E):this._sendRequest(u,g)).then((t=>this._postProcessParagraphLevelCheckResult(t,e,r,s,n,h,a,c)));m.push(f)}return Promise.all(m).then((e=>{const t=e[0].language,n=e[0].areErrorsSuppressed,s=e[0].metaData;return{language:t,errors:Array.prototype.concat.apply([],e.map((e=>e.errors))),premiumErrors:Array.prototype.concat.apply([],e.map((e=>e.premiumErrors))),premiumPickyErrors:Array.prototype.concat.apply([],e.map((e=>e.premiumPickyErrors))),pickyErrors:Array.prototype.concat.apply([],e.map((e=>e.pickyErrors))),isIncompleteResult:e.some((e=>e.isIncompleteResult)),sentenceRanges:Array.prototype.concat.apply([],e.filter((e=>
485Boolean(e.sentenceRanges))).map((e=>e.sentenceRanges))),areErrorsSuppressed:n,metaData:s}})).catch((s=>{if(this._isConnectionOrServerIssue(s)&&(this._abortParagraphLevelCheckRequest(n.instanceId),(!n.apiServerUrl||this._isLanguageToolServer(n.apiServerUrl))&&!this._useFallbackServerForParagraphLevelRequests))return this._useFallbackServerForParagraphLevelRequests=!0,this._mainServerUnavailabilityTimeStamp=Date.now(),this.checkParagraphLevel(e,t,n,i);throw s}))}static _postProcessParagraphLevelCheckResult(e,t,n,s,r,i,o,a){const{language:l,warnings:c}=e,d=e.ignoreRanges||[];r.debug&&d.length&&(e.matches=this._filterErrorsInIgnoredRanges(e.matches,d),e.hiddenMatches&&(e.hiddenMatches=this._filterErrorsInIgnoredRanges(e.hiddenMatches,d)),this._addIgnoredRangeMatches(n,e.matches,d));let h=this._buildSentenceRanges(n,e);const u=r.adapter?.grammarCheck?i:i&&1===t.length&&h.length===o,{errors:g,premiumErrors:m,pickyErrors:p,premiumPickyErrors:_,...E}=this._processResponse(e,h,n,s,r,!0,u,a);h=E.sentenceRanges;const f=this._correctErrorOffsets(t,g),T=this._correctErrorOffsets(t,m),C=this._correctErrorOffsets(t,p),v=this._correctErrorOffsets(t,_);return h=this._correctErrorOffsets(t,h),{language:{code:l.code,name:l.name,confidence:l.confidence},errors:f,premiumErrors:T,pickyErrors:C,premiumPickyErrors:v,isIncompleteResult:!!c&&c.incompleteResults,areErrorsSuppressed:u,sentenceRanges:h,metaData:e?.metaData}}static async checkRecommendation(e,t){e.isForcedRecommendation||this._abortRecommendationRequest(e.instanceId);const n=new AbortController;this._recommendationAbortControllers.set(e.instanceId,n);const s={input:{language:e.language.code,texts:e.texts,priorities:e.priorities,writingGoal:e.writingGoal||"",editorText:e.originalText||"",editorTextRteMap:e.originalTextRteMap||{}},metaData:{...t?.metaData}};if(t?.adapter){const r=await t.adapter.recommendation(s,{...t.options,signal:t.options?.signal||n.signal});let i=[];return t.contextConfig?.useSentenceAwareContext&&e.texts.length>0&&(i=e.texts.map((t=>{const n=t.offset,s=t.offset+t.text.length;return{start:n,end:s,length:s-n,detectedLanguages:[{language:e.language.code.split("-")[0],confidence:1}]}}))),this._transformMatches(r.matches||[],e.originalText,e.language,!0,t.contextConfig,i)}return new Promise((e=>{e([])}))}static async unlockRecommendation(e,t){return await(t.adapter?.unlockRecommendation({lockId:e,metaData:t.metaData}))}static translateText(e,t){return t.adapter.translate(e)}static _filterErrorsInIgnoredRanges(e,t){return e.filter((e=>{const n=e.offset,s=e.offset+e.length;return!t.some((e=>n>=e.from&&n<=e.to||s>=e.from&&s<=e.to))}))}static _addIgnoredRangeMatches(e,t,n){n.forEach((n=>{let s=n.to-n.from;const r=e.substring(n.from,n.to).match(/\s+$/);r&&(s-=r[0].length);const i={offset:n.from,length:s,rule:{id:"IGNORED_RANGE",category:{id:"IGNORED_RANGE",name:"Ignored Range"},issueType:"ignoredRange",description:"",isPremium:!1},contextForSureMatch:0,message:"This text is in a different language than the rest of the text.",shortMessage:"Different language: "+n.language.code,replacements:[]};t.push(i)}))}static async detectLanguage(e,t,n){e=this._prepareText(e);const r=Boolean(n.adapter);if(!e.trim()||t||r)return{language:t,errors:[],premiumErrors:[],pickyErrors:[],premiumPickyErrors:[]};this._abortLanguageDetectionRequest(n.instanceId),this._languageDetectionAbortControllers.set(n.instanceId,new AbortController),this._useFallbackServerForLanguageDetection&&Date.now()-this._mainServerUnavailabilityTimeStamp>=s.MAIN_SERVER_RECHECK_INTERVAL&&(this._useFallbackServerForLanguageDetection=!1);const i=e.substr(0,1e3).normalize(),o=this._getServerFullUrl(n,!1),a={method:"post",mode:"cors",credentials:"omit",body:this._getTextLevelRequestData(i,t,n),headers:this._getHeaders(n),signal:this._languageDetectionAbortControllers.get(n.instanceId).signal};return this._sendRequest(o,a).then((e=>({language:{code:e.language.code,name:e.language.name},errors:[],premiumErrors:[],premiumPickyErrors:[],pickyErrors:[]}))).catch((s=>{if(this._isConnectionOrServerIssue(s)&&(this._abortLanguageDetectionRequest(n.instanceId),(!n.apiServerUrl||this._isLanguageToolServer(n.apiServerUrl))&&!this._useFallbackServerForLanguageDetection))return this._useFallbackServerForLanguageDetection=!0,this._mainServerUnavailabilityTimeStamp=Date.now(),this.detectLanguage(e,t,n);throw s}))}static _isLanguageToolServer(e){return!!e&&(e.includes("api.languagetool.org")||e.includes("languagetool.org/api")||e.includes("api.languagetoolplus.com"))}static checkForPaidSubscription(e,t,n,r=s.PREMIUM_SERVER_URL){return new Promise(((s,i)=>{r+=r.endsWith("/")?"check":"/check";const o=new URLSearchParams;o.append("language","en-us"),o.append("data",JSON.stringify({text:"The languagetool testrule 8634756."})),e&&t?(o.append("username",e),o.append("password",t)):e&&n&&(o.append("username",e),o.append("tokenV2",n));const a={method:"post",mode:"cors",credentials:"omit",body:o};this._sendRequest(r,a).then((e=>{const t=e.matches.some((e=>"PREMIUM_FAKE_RULE"===e.rule.id));s(t)})).catch(i)}))}static addWordToDictionary(e,t){if(Boolean(t.adapter))return;const n=this.getServerBaseUrl(t),s=n.endsWith("/")?"":"/",r=new URL(n+s+"words/add");if(t.user&&"token"in t.user)r.searchParams.set("username",t.user.email),r.searchParams.set("tokenV2",t.user.token);else{if(!t.user||!("password"in t.user))return Promise.reject(new Error("Not logged-in for adding words to dictionary"));r.searchParams.set("username",t.user.email),r.searchParams.set("password",t.user.password)}return r.searchParams.set("word",e.trim()),fetch(r.toString(),{method:"POST"}).then((e=>e.ok?Promise.resolve():Promise.reject(new Error(`Status: ${e.status}`))))}static getLanguageVariant(e,t){return"en"===(e=e.toLowerCase())?t.languageVariants.en||"en-us":"de"===e?t.languageVariants.de||"de-de":"pt"===e?t.languageVariants.pt||"pt-pt":"ca"===e?t.languageVariants.ca||"ca-es":r.default.get(r.ConfigKey.SUPPORTED_LANGUAGES).find((t=>t===e||t.startsWith(e+"-")))||e}static check(e,t,n,s,r,i,o,a,l){return"client"===a?this.checkWithClientLanguageDetection(e,t,n,s,r,i,o,l):this.checkWithServerLanguageDetection(e,t,n,s,r,i,o)}static async checkWithClientLanguageDetection(e,t,n,s,r,o,l,c){if(!t){let a=null,d=null;try{a=await i.default.detect(e,n.preferredLanguages,n.forcePreferredLanguages)}catch(e){d=e.message}if(!a)return c&&c(d||"Could not detect language"),this.checkWithServerLanguageDetection(e,t,n,s,r,o,l);if(t={code:this.getLanguageVariant(a.language,n),name:""},!this.isSupportedLanguage(t.code))return{textLevelResult:{...this.EMPTY_ERRORS_RESPONSE,language:{code:"zz",name:"NoopLanguage"}},paragraphLevelResult:{...this.EMPTY_ERRORS_RESPONSE,sentenceRanges:[],isIncompleteResult:!1,areErrorsSuppressed:!1,language:{code:"zz",name:"NoopLanguage"}}}}const d=[];
485n.skipTextLevelCheck?d.push(Promise.resolve({...this.EMPTY_ERRORS_RESPONSE,language:t})):d.push(a.checkTextLevel(e,t,n)),d.push(a.checkParagraphLevel(s,t,n,e,r,o,l));const[h,u]=await Promise.all(d);return h.language&&(h.language.detectedLanguage={...t,source:"client"}),{textLevelResult:h,paragraphLevelResult:u}}static isSupportedLanguage(e){return r.default.get(r.ConfigKey.SUPPORTED_LANGUAGES).some((t=>t===e.toLowerCase()))}static async checkWithServerLanguageDetection(e,t,n,s,r,i,o){const l=[n.skipTextLevelCheck?a.detectLanguage(e,t,n):a.checkTextLevel(e,t,n),a.checkParagraphLevel(s,t,n,e,r,i,o)],[c,d]=await Promise.all(l);return c.language?.detectedLanguage&&(c.language.detectedLanguage.source="server"),{textLevelResult:c,paragraphLevelResult:d}}}a.SPELLING_RULES_ID=["SPELLER_RULE","MORFOLOGIK_RULE","HUNSPELL","SPELLING_RULE","ORTHOGRAPHY"],a.EMPTY_ERRORS_RESPONSE={errors:[],pickyErrors:[],premiumErrors:[],premiumPickyErrors:[]},a.STYLE_ISSUE_TYPES=["style","locale-violation","register"],a.EMAIL_SIGNATURE_SEPARATOR_REGEXP=/^[‐|\-]{2,}|[‐|\-]{2,}$/,a.ONLY_NUMBERS_REGEXP=/^[0-9]+$/,a.COLON_WHITESPACE_REGEXP=/^[;:]\s/,a.ONE_LETTER_AT_END_REGEXP=/(\s|^|\()[a-z]\.?\s?$/i,a.NUMBER_WITH_DOT_AT_END_REGEXP=/\d\.?\s?$/,a.NUMBER_WITH_PARENTHESIS_AT_END_REGEXP=/\d\.?\)\s$/,a.PUNCTUATION_AT_END=/(\.|\!)$/,a.BULLET_POINT_REGEXP=/(\u25b6\ufe0e|\u25BA|\*|-|–|\u2606|\u2605|\u25cf|\u2022|\u25e6|\u27A4|\u2714)\s+$/,a.LOWERCASE_REGEXP=/[a-z]/,a.DOT_WITH_PREFIX_REGEXP=/\w\.$/,a.SLASH_AT_END_REGEXP=/(\/|\\)$/,a.AT_LEAST_TWO_LETTERS_AT_END_REGEXP=/[a-z]{2}$/i,a.SLASH_AT_BEGINNING_REGEXP=/^(\/|\\)/,a.PUNCTUATION_AT_BEGINNING_REGEXP=/^\s?[\.\!\?,:…]/,a.PUNCTUATION_SPACE_AT_END_REGEXP=/[\.…\?\!]\s+/,a.MARKDOWN_HEADLINE_REGEXP=/^#{1,6}\s/m,a.MARKDOWN_INLINE_FORMAT_AT_BEGINNING_REGEXP=/^[\*\~\_\^\+\%\@]/m,a.WIKI_MARKUP_AT_END_REGEXP=/\[\[[a-z]+$/,a.PIPE_AT_END_REGEXP=/\|\s+$/,a.MENTION_SYMBOL_AT_BEGINNING_REGEXP=/@[a-z\.\-]*$/i,a.HASH_SYMBOL_AT_BEGINNING_REGEXP=/#[a-z\.\-]*$/i,a.EMOJI_SENTENCE_START_REGEXP=/(\.|!|\?|^)\s?(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])\s+/,a.ABBREVIATION_AT_END_REGEXP=/(\s|\(|^)[A-Z]\.$/,a.NET_AT_BEGINNING_REGEXP=/^net\b/i,a.SINGLE_UPPERCASE_LETTER_REGEXP=/^[A-Z]$/,a.NON_ALPHANUMERIC_AT_BEGINNING_REGEXP=/^[^a-z0-9äöüßáàâéèêíìîóòôúùû\.\?\!,\:\;¿¡]+/i,a.NON_ALPHANUMERIC_AT_END_REGEXP=/[^a-z0-9äöüßáàâéèêíìîóòôúùû\.\?\!,\:\;¿¡]+$/i,a.HTML_ENTITIES=["amp","nbsp","gt","lt","bull","euro","copy","laquo","raquo","hellip","middot"],a.HTML_ENTITIES_WITH_AND=a.HTML_ENTITIES.map((e=>`&${e}`)),a.WAVY_DASH_REGEXP=/^\u3030+$/,a.INVISIBLE_PHRASE_REGEXP=/^[\u2063\uFEFF]+$/,a.INVISIBLE_CHARS_REGEXP=/[\u2063\uFEFF]/g,a.ZWNJ_REGEXP=/\u200B|\u200C/g,a.ZWS="\ufeff",a.PREVENT_MID_SENTENCE_CAPITALIZATION=/[\wáàâóòìíéèùúâôîêûäöüß,\)][\u0020\u00A0\uFEFF]*\n\n\n?[\u0020\u00A0\uFEFF"„»«“‘]*$/,a.PREVENT_MID_SENTENCE_PUNCTUATION=/^[\u0020\u00A0\uFEFF]*\n\n\n?[a-záàâóòìíéèùúâôîêûäöüß,\)]/,a.COMMON_TLDS=["com","co","org","net","de","info","biz","es","fr","be","in","gov","nl","ca","com.br","br","at","us","au","ru","pl","ly","it","cat","edu","jp","ko","cn","se","no","mil","ch","dk","com.mx","mx","eu","co.uk","uk","ir","cz","ua","kr","gr","tw","nz","co.nz","za","ro","vn","io","tr","me","fi","tv","xyz","pt","ie","app"],a.COMMON_TLD_WITH_DOT_REGEXPS=a.COMMON_TLDS.map((e=>new RegExp(`^\\.${e.replace(".","\\.")}\\b`,"i"))),a.COMMON_FILE_TYPES=["jpeg","jpg","gif","png","bmp","indd","stl","svg","ai","sketch","ico","ics","env","amf","ps","psd","tiff","tif","mp3","wav","midi","mid","aif","mpa","ogg","wma","wpl","cda","7z","arj","deb","pkg","plist","rar","rpm","tar.gz","tar","zip","bin","dmg","iso","toast","vcd","csv","dat","db","log","mdb","sav","sql","xml","apk","bat","bin","cgi","com","exe","gadget","jar","py","js","jsx","json","wsf","ts","tsx","fnt","fon","otf","ttf","woff","woff2","rb","java","php","html","asp","aspx","cer","cfm","cgi","pl","css","scss","htm","jsp","part","rss","xhtml","key","odp","pps","ppt","pptx","class","cpp","cs","h","sh","swift","vb","ods","odt","xlr","xls","xlsx","xlt","xltx","bak","cab","cfg","cpl","cur","dll","dmp","msi","ini","tmp","3g2","3gp","avi","flv","h264","m4v","mkv","mov","mp4","mpg","mpeg","rm","swf","vob","wmv","doc","docx","dot","dotx","pdf","rtf","srx","text","tex","wks","wps","wpd","txt","yaml","yml","csl","md","adm"],a.COMMON_FILE_TYPE_WITH_DOT_REGEXPS=a.COMMON_FILE_TYPES.map((e=>new RegExp(`^[\\wáàâóòìíéèùúâôîêûäöüß\\-\\.\\(\\)]*?\\.${e}\\b`,"i"))),a.FILE_TYPE_AT_BEGINNING_REGEXP=new RegExp(`(${a.COMMON_FILE_TYPES.join("|")})\b`,"i"),a.HIGH_LEVEL_GOALS=[{id:"professional",tags:["clarity","confident","formal","general","positive","professional"]},{id:"scientific",tags:["academic","clarity","formal","general","objective","povrem","scientific"]},{id:"persuasive",tags:["clarity","confident","general","persuasive","positive"]},{id:"personal",tags:["clarity","general","informal","positive","povadd"]},{id:"creative",tags:["clarity","general"]}],a._textLevelAbortControllers=new Map,a._paragraphLevelAbortControllers=new Map,a._languageDetectionAbortControllers=new Map,a._recommendationAbortControllers=new Map,a._useFallbackServerForTextLevelRequests=!1,a._useFallbackServerForParagraphLevelRequests=!1,a._useFallbackServerForLanguageDetection=!1,a._mainServerUnavailabilityTimeStamp=0,a._checkForException=e=>e.ok?e:e.text().catch((()=>"")).then((t=>{const n=t.toLowerCase();if(n.includes("too many error"))throw{reason:"TooManyErrors",status:e.status,response:t};if(413===e.status||n.includes("text exceeds the limit"))throw{reason:"TextTooLong",status:e.status,response:t};if(t.toLowerCase().includes("checking took longer than"))throw{reason:"TimeoutError",status:e.status,url:e.url?e.url.replace(/\?.*/,"?..."):"unknown",response:t};if(429===e.status)throw{reason:"TooManyRequests",status:e.status,response:t};if(403===e.status){if(n.includes("client request size limit")||n.includes("client request limit")||n.includes("ip request limit")||n.includes("ip request size limit"))throw{reason:"TooManyRequests",status:e.status,response:t};if(n.includes("authexception"))throw{reason:"InvalidCredentials",status:e.status,response:t};throw{reason:"AccessDenied",status:e.status,response:t}}if(n.includes("checking took longer than"))throw{reason:"TimeoutError",status:e.status,url:e.url?e.url.replace(/\?.*/,"?..."):"unknown",response:t};throw{reason:"UnknownError",status:e.status,response:t}}))},
485"./core/ErrorProcessor.ts":
486/*!********************************!*\
487  !*** ./core/ErrorProcessor.ts ***!
488  \********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ErrorProcessor:()=>i});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ./utils */"./core/utils.ts");class i{static merge(e,t=!1,n=!1,r=!1){let{errors:i,pickyErrors:o,premiumErrors:a,premiumPickyErrors:l,sentenceRanges:c=[],recommendationErrors:d=[]}=this.filterAndMigrateErrors(e.existing.errors,e.existing.pickyErrors,e.existing.premiumErrors,e.existing.premiumPickyErrors,e.existing.recommendationErrors,e.existing.sentenceRanges,e.existingCheckedText,e.newCheckedText,e.existingRecommendationCheckedText,e.newRecommendationCheckedText,n,r);this.mergeParagraphLevelErrors(i,o,a,l,d,c,e.new.paragraphLevel.errors,e.new.paragraphLevel.pickyErrors,e.new.paragraphLevel.premiumErrors,e.new.paragraphLevel.premiumPickyErrors,e.new.paragraphLevel.recommendationErrors||[],e.new.paragraphLevel.sentenceRanges),this.mergeTextLevelErrors(i,o,a,l,e.new.textLevel.errors,e.new.textLevel.pickyErrors,e.new.textLevel.premiumErrors,e.new.textLevel.premiumPickyErrors);const h=this.getDuplicateErrors(e.existing,e.existingCheckedText,e.newCheckedText,e.existingRecommendationCheckedText,e.newRecommendationCheckedText);return this.sortErrors(i,o,a,l,d),this.setIdsOnErrors(i,o,a,l,d,h),i=this.migrateOffsetsToOriginalText(i,e.newCheckedText.usedParts),o=this.migrateOffsetsToOriginalText(o,e.newCheckedText.usedParts),a=this.migrateOffsetsToOriginalText(a,e.newCheckedText.usedParts),l=this.migrateOffsetsToOriginalText(l,e.newCheckedText.usedParts),d=this.migrateOffsetsToOriginalText(d,e.newRecommendationCheckedText.usedParts),c=this.migrateOffsetsToOriginalText(c,e.newCheckedText.usedParts),t&&(o=o.filter((e=>!s.PICKY_RULES_THAT_ARE_CONSIDERED_ANNOYING.includes(e.rule.id))),o.forEach((e=>{e.rule.id="HIDDEN_RULE",e.fixes=[]})),a=[...a,...l,...o],l=[],o=[],this.sortErrorsByOffset(a)),{errors:i,pickyErrors:o,premiumErrors:a,premiumPickyErrors:l,recommendationErrors:d,sentenceRanges:c}}static getDuplicateErrors(e,t,n,s,i){let{errors:o,pickyErrors:a,premiumErrors:l,premiumPickyErrors:c,recommendationErrors:d=[]}=e;o=this.migrateOffsetsToValuableText(o,t.usedParts),a=this.migrateOffsetsToValuableText(a,t.usedParts),l=this.migrateOffsetsToValuableText(l,t.usedParts),c=this.migrateOffsetsToValuableText(c,t.usedParts),d=this.migrateOffsetsToValuableText(d,s.usedParts);const h=(0,r.getParagraphsDiff)(t.text,n.text),u=(0,r.getParagraphsDiff)(s.text,i.text),g=(e,t)=>{if(!e.isParagraphLevelCheck)return!0;const n=(0,r.binarySearch)(t,(t=>{const n=t.oldOffset;if(null===t.oldText)return e.start>=n?1:-1;const s=t.oldOffset+t.oldText.length+1;return(0,r.compareNumberAndSegment)(e.start,n,s,!0)}));return!(!n||!n.textDiff)||void 0};return o=o.filter((e=>g(e,h))),a=a.filter((e=>g(e,h))),l=l.filter((e=>g(e,h))),c=c.filter((e=>g(e,h))),d=d.filter((e=>g(e,u))),o=this.migrateOffsetsBetweenTexts(o,h),a=this.migrateOffsetsBetweenTexts(a,h),l=this.migrateOffsetsBetweenTexts(l,h),c=this.migrateOffsetsBetweenTexts(c,h),d=this.migrateOffsetsBetweenTexts(d,u),{errors:o,pickyErrors:a,premiumErrors:l,premiumPickyErrors:c,recommendationErrors:d}}static migrateOffsetsToValuableText(e,t){const n=[];for(const s of e){const e=(0,r.binarySearch)(t,(e=>(0,r.compareNumberAndSegment)(s.start,e.originalStart,e.originalEnd,!0))),i=(0,r.binarySearch)(t,(e=>(0,r.compareNumberAndSegment)(s.end,e.originalStart,e.originalEnd)));if(!e||!i)continue;const o=(0,r.deepClone)(s);o.start-=e.posDiff,o.end-=i.posDiff,o.length=o.end-o.start,n.push(o)}return n}static migrateOffsetsBetweenTexts(e,t,n,s,i,o){let a,l=!1,c=!1,d=!1;"string"==typeof t&&"string"==typeof n?(a=(0,r.getParagraphsDiff)(t,n),l="boolean"==typeof s&&s,c="boolean"==typeof i&&i,d="boolean"==typeof o&&o):(a=t,l="boolean"==typeof n&&n,c="boolean"==typeof s&&s,d="boolean"==typeof i&&i);const h=[];for(const t of e){const e=(0,r.binarySearch)(a,(e=>{const n=e.oldOffset;if(null===e.oldText)return t.start>=n?1:-1;const s=e.oldOffset+e.oldText.length+1;return(0,r.compareNumberAndSegment)(t.start,n,s,!0)})),n=(0,r.deepClone)(t);if(e){if(e.textDiff){if(l)continue;
488{const t=e.oldOffset+e.textDiff.from,s=t+e.textDiff.oldFragment.length,i=!c;if((0,r.isIntersect)(t,s,n.start,n.end,i)){if(d){if(!(t>=n.start&&s<=n.end))continue;{const s=e.textDiff.newFragment.length-e.textDiff.oldFragment.length;n.end>=t&&(n.end=n.end+s),n.length=n.end-n.start,n?.rule?.phraseDiff?.forEach((e=>{e.sourceStart>t&&(e.sourceStart+=s),e.sourceEnd>t&&(e.sourceEnd+=s)})),h.push(n)}}continue}if(n.start>=s){const t=e.textDiff.newFragment.length-e.textDiff.oldFragment.length;n.start+=t,n.end+=t,n?.rule?.phraseDiff?.forEach((e=>{e.sourceStart+=t,e.sourceEnd+=t,e.targetEnd+=t,e.targetStart+=t}))}}}n.start+=e.newOffset-e.oldOffset,n.end=n.start+n.length,n?.rule?.phraseDiff?.forEach((t=>{const n=t.sourceEnd-t.sourceStart,s=t.targetEnd-t.targetStart;t.sourceStart+=e.newOffset-e.oldOffset,t.sourceEnd=t.sourceStart+n,t.targetStart+=e.newOffset-e.oldOffset,t.targetEnd=t.targetStart+s}))}h.push(n)}return h}static migrateOffsetsToOriginalText(e,t){const n=[];for(const s of e){const e=(0,r.binarySearch)(t,(e=>(0,r.compareNumberAndSegment)(s.start,e.start,e.end,!0))),i=(0,r.binarySearch)(t,(e=>(0,r.compareNumberAndSegment)(s.end,e.start,e.end)));if(!e||!i)continue;const o=(0,r.deepClone)(s);o.start+=e.posDiff,o.end+=i.posDiff,o.length=o.end-o.start,n.push(o)}return n}static filterAndMigrateErrors(e,t,n,s,i,o,a,l,c,d,h=!1,u=!1){u?i=(i||[]).filter((e=>e.isParagraphLevelCheck)):(e=e.filter((e=>e.isParagraphLevelCheck)),t=t.filter((e=>e.isParagraphLevelCheck)),n=n.filter((e=>e.isParagraphLevelCheck)),s=s.filter((e=>e.isParagraphLevelCheck))),e=this.migrateOffsetsToValuableText(e,a.usedParts),t=this.migrateOffsetsToValuableText(t,a.usedParts),n=this.migrateOffsetsToValuableText(n,a.usedParts),s=this.migrateOffsetsToValuableText(s,a.usedParts),i=this.migrateOffsetsToValuableText(i||[],c.usedParts),o=this.migrateOffsetsToValuableText(o||[],a.usedParts);const g=(0,r.getParagraphsDiff)(a.text,l.text),m=(0,r.getParagraphsDiff)(c.text,d.text);return h?(e=this.migrateOffsetsBetweenTexts(e,a.text,l.text,!1,!0),t=this.migrateOffsetsBetweenTexts(t,a.text,l.text),n=this.migrateOffsetsBetweenTexts(n,a.text,l.text),s=this.migrateOffsetsBetweenTexts(s,a.text,l.text),i=this.migrateOffsetsBetweenTexts(i,c.text,d.text,!1,!0),o=this.migrateOffsetsBetweenTexts(o,a.text,l.text,!1,!0,!0)):(e=this.migrateOffsetsBetweenTexts(e,g,!0),t=this.migrateOffsetsBetweenTexts(t,g,!0),n=this.migrateOffsetsBetweenTexts(n,g,!0),s=this.migrateOffsetsBetweenTexts(s,g,!0),i=this.migrateOffsetsBetweenTexts(i,m,!1,!1),o=this.migrateOffsetsBetweenTexts(o,g,!0)),{errors:e,pickyErrors:t,premiumErrors:n,premiumPickyErrors:s,recommendationErrors:i,sentenceRanges:o}}static mergeParagraphLevelErrors(e,t,n,s,r,i,o,a,l,c,d,h=[]){e.push(...o),t.push(...a),n.push(...l),s.push(...c),r.push(...d),i.push(...h)}static mergeTextLevelErrors(e,t,n,s,r,i,o,a){for(const t of r)e.some((e=>e.start===t.start&&e.end===t.end))||e.push(t);for(const e of i)t.some((t=>t.start===e.start&&t.end===e.end))||t.push(e);for(const e of o)n.some((t=>t.start===e.start&&t.end===e.end))||n.push(e);for(const e of a)s.some((t=>t.start===e.start&&t.end===e.end))||s.push(e)}static sortErrors(e,t,n,s,r){this.sortErrorsByOffset(e),this.sortErrorsByOffset(t),this.sortErrorsByOffset(n),this.sortErrorsByOffset(s),this.sortErrorsByOffset(r)}static sortErrorsByOffset(e){e.sort(((e,t)=>e.start===t.start?e.isParagraphLevelCheck?1:-1:e.start>t.start?1:-1))}static migrateErrorsBetweenSameOriginalTexts(e,t,n){const s=[];for(const i of e){let e=i.start,o=i.end,a=(0,r.binarySearch)(t.usedParts,(t=>(0,r.compareNumberAndSegment)(e,t.originalStart,t.originalEnd,!0))),l=(0,r.binarySearch)(t.usedParts,(e=>(0,r.compareNumberAndSegment)(o,e.originalStart,e.originalEnd)));if(!a||!l)continue;if(e-=a.posDiff,o-=l.posDiff,a=(0,r.binarySearch)(n.usedParts,(t=>(0,r.compareNumberAndSegment)(e,t.start,t.end,!0))),l=(0,r.binarySearch)(n.usedParts,(e=>(0,r.compareNumberAndSegment)(o,e.start,e.end))),!a||!l)continue;e+=a.posDiff,o+=l.posDiff;const c=(0,r.deepClone)(i);c.start=e,c.end=o,c.length=o-e,s.push(c)}return s}static setIdsOnErrors(e,t,n,s,r,o){function a(e,t){if(e.id)return;const n=t.find((t=>{return s=e,(n=t).start===s.start&&n.end===s.end&&n.isParagraphLevelCheck===s.isParagraphLevelCheck;var n,s}));e.id=n?n.id:"error:"+ ++i.INCREMENTAL_ID}e.forEach((e=>a(e,o.errors))),t.forEach((e=>
488a(e,o.pickyErrors))),n.forEach((e=>a(e,o.premiumErrors))),s.forEach((e=>a(e,o.premiumPickyErrors))),r.forEach((e=>a(e,o.recommendationErrors||[])))}static sortSentenceRanges(e){e.sort((({start:e},{start:t})=>e-t))}static sortByLastSentenceRanges(e){const t=[...e];return t.sort((({start:e},{start:t})=>t-e)),t}}i.INCREMENTAL_ID=0},
488"./core/LanguageDetector.ts":
489/*!**********************************!*\
490  !*** ./core/LanguageDetector.ts ***!
491  \**********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(/*! ./utils */"./core/utils.ts"),r=n(/*! ./language/detectLanguageForShortText */"./core/language/detectLanguageForShortText.ts"),i=n(/*! ./language/detectLanguageFromUnicode */"./core/language/detectLanguageFromUnicode.ts"),o=n(/*! ../config/config */"./config/config.ts"),a=n(/*! ./language-detection/TextNormalizer */"./core/language-detection/TextNormalizer.ts");const l=o.SHORT_TEXT_MAX_LENGTH,c=["haw","hmn","co","fy","gd","cbk","und"],d={fil:"tl"};class h{static supported(e=[]){return self.LanguageDetector&&"function"==typeof self.LanguageDetector.create&&"function"==typeof self.LanguageDetector.availability&&!e.includes("uk")&&!e.includes("br")&&!e.includes("ast")&&!e.includes("crh")&&this.isAtLeastChromeVersion(138)}static isAtLeastChromeVersion(e){return navigator.userAgent.includes("Chrome/")&&Number((navigator.userAgent.match(/Chrome\/(\d+)/)||[void 0,0])[1])>=e&&!navigator.userAgent.includes("Chromium/")&&!navigator.userAgent.includes("Edge/")&&!navigator.userAgent.includes("Edg/")&&!navigator.userAgent.includes("YaBrowser/")&&!navigator.userAgent.includes("OPR/")&&!navigator.userAgent.includes("Brave/")}static async init(){if(this.supported()&&["downloadable","available"].includes(await self.LanguageDetector.availability()))try{this._browserLanguageDetector=this._browserLanguageDetector||await self.LanguageDetector.create()}catch(e){}}static async detectRaw(e){if("unavailable"===await self.LanguageDetector.availability())throw new Error("Language detection unavailable");this._browserLanguageDetector=this._browserLanguageDetector||await self.LanguageDetector.create();const t=await this._browserLanguageDetector.detect(e);return t?.length>0?t.map((e=>({language:e.detectedLanguage,confidence:e.confidence}))):null}static async detect(e,t,n=!1){if(!this.supported(t))throw new Error("Language detection unsupported");if("unavailable"===await self.LanguageDetector.availability())throw new Error("Language detection unavailable");let s=this.normalizeText(e);s||(s=e.trim()),s=s.slice(0,1e4);let i=this.normalizeLanguages(t);i.length&&s.length<l&&!n&&(i=this.addLanguagesToDetect(i,s));const o=(0,r.detectLanguageForShortText)(s,t);if(o)return{language:o,confidence:.99};this._browserLanguageDetector=this._browserLanguageDetector||await self.LanguageDetector.create();let a=await this._browserLanguageDetector.detect(s);return a=a.filter((e=>!c.includes(e.detectedLanguage)&&!e.detectedLanguage.endsWith("-Latn"))),!n&&1===a.length&&a[0].confidence>.9&&s.length>10&&s.split(" ").length>1?{language:this.mapToSupportedLanguageCode(a[0].detectedLanguage),confidence:a[0].confidence}:(!t.includes("gl")&&(t.includes("pt")||t.includes("ca")||t.includes("es"))&&(a=a.filter((e=>"gl"!==e.detectedLanguage))),i.length&&(s.length<l||n)&&(a=a.filter((e=>i.includes(e.detectedLanguage.toLowerCase())))),a[0]?{language:this.mapToSupportedLanguageCode(this.getPrimaryLanguageCode(a[0].detectedLanguage)),confidence:a[0].confidence}:null)}static normalizeText(e){return a.default.normalize(e)}static addLanguagesToDetect(e,t){return e=(0,s.uniq)(e.concat((0,i.default)(t))),t.includes("ß")&&!e.includes("de")&&e.push("de"),!t.includes("ł")&&!t.includes("Ł")||e.includes("pl")||e.push("pl"),!t.includes("¡")&&!t.includes("¿")||e.includes("es")||e.push("es"),e}static mapToSupportedLanguageCode(e){return d[e]||e}static normalizeLanguages(e){return e.map((e=>this.getPrimaryLanguageCode(e)))}static getPrimaryLanguageCode(e){return e.split("-")[0].toLowerCase()}}},
491"./core/Rephrasings.ts":
492/*!*****************************!*\
493  !*** ./core/Rephrasings.ts ***!
494  \*****************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Rephrasings:()=>l});var s=n(/*! ./utils */"./core/utils.ts"),r=n(/*! ../config/config */"./config/config.ts");const i={accept:"application/json","content-type":"application/json"};function o(e){return(0,s.isObject)(e)&&!1===Object.values(e).some((e=>"number"!=typeof e))}function a(e){return!!(0,s.isObject)(e)&&[["text"],["score",o],["label"],["origin"],["uuid"]].reduce(((t,[n,r=s.isString])=>!!(t&&(0,s.isFunction)(r)&&String(n)in e)&&r(e[String(n)])),!0)}class l{static async load(e,t,n,s,r,i){const o=[i,t.trim()].join("@"),l=this._rewriteCache.get(o),c=this._history.get(t)??null;if(l)return Promise.resolve({rephrases:l,previousSentence:c});let d="/rewriting/rewrite";i&&(d+="/"+function(e){switch(e){case"simple":return"simplicity";case"formal":return"formality";case"natural":return"humanize";default:return e}}(i));const h=(await this._request("rewrite",d,e,t,n,s,r)).filter((e=>a(e))).map((({text:e,score:t,label:n,origin:s,uuid:r})=>({text:e,score:t,label:n,origin:s,uuid:r}))).filter((({text:e},t,n)=>n.findIndex((({text:t})=>e===t))===t));return h.length>0&&this._rewriteCache.set(o,h),{rephrases:h,previousSentence:c}}static abort(e){const t=void 0===e?["rewrite"]:[e];for(const e of t){const t=this._abortControllers.get(e)||[];this._abortCurrentRequests(t),this._abortControllers.set(e,[])}}static async _request(e,t,n,o,a,l,c){this.abort(e);const d=JSON.stringify({text:o,offset:0,length:0,count:"rewrite"===e?5:1,userID:n,language:a.slice(0,2),inhouseOnly:l,email:c?.email,token:c?.token,p:!0}),h=new AbortController,u=this._abortControllers.get(e)||[];i["X-LT-checksum"]=await(0,s.generateChecksum)(),i["X-LT-p"]="1",u.push(h),this._abortControllers.set(e,u);const g=await fetch(r.BASE_REPHRASING_SERVER_URL+t,{method:"post",signal:h.signal,mode:"cors",headers:i,body:d});if(!1===g.ok){const e=(()=>{switch(g.status){case 413:return"PayloadTooLarge";case 524:return"ServerTimeout";default:return`ServerFailure (${g.status})`}})();throw new Error(e)}const m=await g.json(),{rewrites:p=[]}=m||{};return p}static async requestSplitSentence(e,t,n,s,r){const i=this._splitSentenceCache.get(t.trim());if(i)return Promise.resolve(i);const[o]=await this._request("sentence-splitting","/rewriting/rewrite/sentence_splitting",e,t,n,s,r);return a(o)?(this._splitSentenceCache.set(t.trim(),o),o):null}static _abortCurrentRequests(e){for(const t of e)t.abort()}}l._rewriteCache=new Map,l._splitSentenceCache=new Map,l._history=new Map,l._abortControllers=new Map([["rewrite",[]],["sentence-splitting",[]]])},
494"./core/TextCollection.ts":
495/*!********************************!*\
496  !*** ./core/TextCollection.ts ***!
497  \********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Collection:()=>o,CollectionItem:()=>i,TextCollection:()=>a});var s=n(/*! ./textUtils */"./core/textUtils.ts"),r=n(/*! ./utils */"./core/utils.ts");class i{constructor(e,t,n){this.start=e,this.end=t,this.data=n,this.id=(0,r.uuidv4)()}setData(e){this.data="function"==typeof e?e(this.data):e}update(e,t,n){this.start=e,this.end=t,this.setData((e=>({...e,...n})))}toObject(){return{start:this.start,end:this.end,data:(0,r.deepClone)(this.data),id:this.id}}static from(e){const t=new i(e.start,e.end,e.data);return t.update(e.start,e.end),t}}class o{constructor(e){this.items=[],this.items=e||[]}isEmpty(){return 0===this.items.length}add(e,t,n,s=(0,r.uuidv4)()){const o=new i(e,t,n);return o.id=s,this.items.push(o),this.items.sort(((e,t)=>e.start-t.start)),o}remove(e){const t=this.items.findIndex((t=>t.id===e));this.items[t]&&this.items.splice(t,1)}static from(e){const t=e.map((e=>{const t=new i(e.start,e.end,e.data);return t.id=e.id,t}));return new o(t)}getList(){return this.items.map((e=>e.toObject()))}getById(e){return this.items.find((t=>t.id===e))}getByIds(e){return this.items.filter((t=>e.includes(t.id)))}}class a{constructor(e){this.text=(0,r.getDefaultTextSubset)(),e.paragraphs?this.paragraph=e.paragraphs:this.paragraph=new o}static _isMatchingParagraph(e,t,n){if(n.insertion&&(t.data.oldOffset===e.oldOffset&&t.data.newText===e.newText&&t.data.oldText===e.oldText&&t.data.newOffset===e.newOffset||t.data.oldOffset===e.oldOffset&&t.data.newText!==e.newText&&t.data.oldText===e.oldText&&t.data.newOffset===e.newOffset))return!0;if(n.change){if(t.data.newOffset===e.oldOffset&&(t.data.newText===e.oldText||t.data.oldText===e.oldText))return!0;if(t.data.newText===e.oldText||t.data.oldText===e.oldText)return!0}if(n.shiftAndChange){if(t.data.newOffset===e.oldOffset&&(t.data.newText===e.oldText||t.data.oldText===e.oldText))return!0;if(!(t.data.newText!==e.oldText&&t.data.oldText!==e.oldText||t.data.newOffset!==e.oldOffset&&t.data.oldOffset!==e.newOffset))return!0;if(t.data.newText===e.oldText&&(t.data.oldOffset===e.oldOffset&&t.data.newOffset===e.newOffset&&e.newText===e.oldText||t.data.oldOffset===e.oldOffset&&e.newText!==e.oldText))return!0;if(t.data.newText===e.newText&&t.data.oldText===e.oldText&&t.data.oldOffset===e.oldOffset&&e.newOffset!=e.newOffset)return!0;if(t.data.newText===e.newText&&t.data.oldText===e.oldText&&t.data.oldOffset===e.oldOffset&&e.newOffset==e.newOffset)return!0;if(t.data.newText!==e.newText&&t.data.oldText===e.oldText&&t.data.oldOffset===e.oldOffset&&e.newOffset==e.newOffset)return!0}if((t.data.newOffset===e.oldOffset||t.data.oldOffset===e.oldOffset)&&t.data.newText===e.newText&&n.shift)return!0;if(n.deletion){if((t.data.newText===e.oldText&&t.data.oldText===e.newText||t.data.oldText===e.newText&&t.data.newText===e.oldText)&&(t.data.oldOffset===e.newOffset||t.data.newOffset===e.newOffset||t.data.newOffset===e.oldOffset))return!0;if(t.data.newText===e.oldText&&!e.newText&&t.data.newOffset===e.oldOffset)return!0;if(t.data.oldText===e.oldText&&t.data.newText===e.oldText&&!e.newText&&t.data.oldOffset===e.oldOffset)return!0;if(t.data.oldText===e.oldText&&t.data.newText!==t.data.oldText&&!e.newText&&t.data.oldOffset===e.oldOffset)return!0}return!1}static _findParagraph(e,t,n){return t.items.find((t=>a._isMatchingParagraph(e,t,n)))}resetCollection(){this.paragraph=new o,this.text=(0,r.getDefaultTextSubset)()}updateText(e=(0,r.getDefaultTextSubset)()){this.text=e}addDiffs(e){this.latestDiffs=e;const t=this.paragraph,{deletions:n,shiftAndChanges:r,changes:i,insertions:o,shifts:l}=e;for(const e of n){const n=a._findParagraph(e,t,{deletion:!0});n&&(e.id=n.id,t.remove(n.id))}for(const e of o){const n=a._findParagraph(e,t,{insertion:!0});if(n&&(e.id=n.id),(0,s.toParagraph)(e)){const s=e.newText||"",r=e.newOffset,i=r+s.length;if(n)n.update(r,i,e),e.id=n.id;else{const n=t.add(r,i,e,e.id);e.id=n.id}}}for(const e of r){const n=a._findParagraph(e,t,{shiftAndChange:!0});if(n&&(e.id=n.id),(0,s.toParagraph)(e)){const s=e.newText||"",r=e.newOffset,i=r+s.length;if(n)n.update(r,i,e),e.id=n.id;else{const n=t.add(r,i,e,e.id);e.id=n.id}}}for(const e of l){const n=a._findParagraph(e,t,{shift:!0});if(n&&n.data.newText===e.newText){const t=e.newText||"",s=e.newOffset,r=s+t.length;n.update(s,r,e),e.id=n.id}else{const n=e.newText||"",s=e.newOffset,r=s+n.length,i=t.add(s,r,e,e.id);e.id=i.id}}for(const e of i){const n=a._findParagraph(e,t,{change:!0});if(n&&(e.id=n.id),(0,s.toParagraph)(e)){const s=e.newText||"",r=e.newOffset,i=r+s.length;if(n)n.update(r,i,e),e.id=n.id;else{const n=t.add(r,i,e,e.id);e.id=n.id}}}this.paragraph=t}getChangedParagraphs(){return this.latestDiffs&&(this.latestDiffs.changes.length||this.latestDiffs.insertions.length||this.latestDiffs.shiftAndChanges.length)?[...this.latestDiffs.changes.map((e=>(0,s.toParagraph)(e))),...this.latestDiffs.insertions.map((e=>(0,s.toParagraph)(e))),...this.latestDiffs.shiftAndChanges.map((e=>(0,s.toParagraph)(e)))].filter((e=>null!==e)):[]}}},
497"./core/context/changesController.ts":
498/*!*******************************************!*\
499  !*** ./core/context/changesController.ts ***!
500  \*******************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ChangesController:()=>r});var s=n(/*! ../utils */"./core/utils.ts");class r{constructor(){}_splitPreservingNewlines(e){const t=[],n=/([^\n]+)|(\n)/g;let s;for(;null!==(s=n.exec(e));)t.push(s[0]);return t}_getTextDiff(e,t){if(e===t)return[];let n=0;const s=Math.min(e.length,t.length);for(;n<s&&e[n]===t[n];)n++;let r=0;const i=e.length-1,o=t.length-1;for(;r<s-n&&e[i-r]===t[o-r];)r++;const a=e.substring(n,e.length-r),l=t.substring(n,t.length-r),c=[];return 0===a.length&&l.length>0?c.push({type:"insert",start:n,end:n,text:l}):a.length>0&&0===l.length?c.push({type:"delete",start:n,end:n+a.length,text:""}):a.length>0&&l.length>0&&c.push({type:"replace",start:n,end:n+a.length,text:l}),c}_getParagraphsDiff(e,t){const n=[],r=this._splitPreservingNewlines(e),i=this._splitPreservingNewlines(t);let o=0;const a=Math.max(r.length,i.length);for(o=0;o<a&&r[o]===i[o];o++);let l=0;const c=Math.min(r.length,i.length);for(;o+l<c&&r[r.length-l-1]===i[i.length-l-1];)l++;let d=0;for(let e=0;e<o;e++)d+=r[e].length;let h=d;for(let e=o;e<a-l;e++){const t=e<r.length-l?r[e]:null,o=e<i.length-l?i[e]:null;t===o&&d===h||n.push({oldText:t,newText:o,oldOffset:d,newOffset:h,textDiff:(0,s.getTextsDiff)(t||"",o||"")}),null!==t&&(d+=t.length),null!==o&&(h+=o.length)}if(d!==h)for(let e=l-1;e>=0;e--){const t=r[r.length-e-1],s=i[i.length-e-1];n.push({oldText:t,newText:s,oldOffset:d,newOffset:h,textDiff:null}),d+=t.length,h+=s.length}return n}createInsertionOperation(e,t,n=Date.now()){return{type:"insert",start:e,end:void 0,text:t,lastTimestamp:n,currentTimestamp:n+1}}createDeletionOperation(e,t,n=Date.now()){return{type:"delete",start:e,end:t,text:"",lastTimestamp:n,currentTimestamp:n+1}}createReplacementOperation(e,t,n,s=Date.now()){return{type:"replace",start:e,end:t,text:n,lastTimestamp:s,currentTimestamp:s+1}}createNoChangeOperation(e=Date.now()){return{type:"no-change",start:-1,end:-1,text:"",lastTimestamp:e,currentTimestamp:e}}generateParagraphChangeOTOperations(e,t,n=Date.now()){const s=this._getParagraphsDiff(e,t),r=[];let i=n;if(e===t)return r;let o=0;for(let e=0;e<s.length;e++){const t=s[e];if(t.oldText===t.newText)continue;const{oldText:n,newText:a,oldOffset:l}=t;if(null===n&&null!==a){const e=l+o,t=this.createInsertionOperation(e,a,i);r.push(t),o+=a.length}else if(null!==n&&null===a){const e=this.createDeletionOperation(l+o,l+o+n.length,i);r.push(e),o-=n.length}else if(null!==n&&null!==a){const e=this.createReplacementOperation(l+o,l+o+n.length,a,i);r.push(e),o+=a.length-n.length}i+=1}return r}generateTextChangeOperations(e,t,n=Date.now()){const s=[];let r=n;if(e===t)return s;const i=this._getTextDiff(e,t);for(let e=0;e<i.length;e++){const t=i[e];if("insert"===t.type){const e=this.createInsertionOperation(t.start,t.text,r);s.push(e)}else if("delete"===t.type){const e=this.createDeletionOperation(t.start,t.end,r);s.push(e)}else if("replace"===t.type){const e=this.createReplacementOperation(t.start,t.end,t.text,r);s.push(e)}r+=1}return s}}},
500"./core/context/utils.ts":
501/*!*******************************!*\
502  !*** ./core/context/utils.ts ***!
503  \*******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EDITOR_CONTEXT_EVENT_NAMES:()=>s});const s={EDITOR_STATE_SYNC_ACK:"EDITOR_STATE_SYNC_ACK",EDITOR_STATE_FORCE_SYNC:"EDITOR_STATE_FORCE_SYNC",EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC:"EDITOR_SURROUNDING_CONTEXT_FORCE_SYNC"}},
503"./core/language-detection/TextNormalizer.ts":
504/*!***************************************************!*\
505  !*** ./core/language-detection/TextNormalizer.ts ***!
506  \***************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});const s=/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,r=/\b(?:(https?|ftp|mailto|tel|wss):\/\/|www\.|(chrome|moz|safari)(-extension)?:\/\/|file:\/\/)[^\s]+/gi,i=/@[A-Z0-9._-]+/gi,o=/[\-~\$]?[0-9]+/g,a=/^([0-9a-z]+\.)(\s|$)/gim,l=/[\u25CF\u25CB\u25C6\u27A2\u25A0\u25A1\u2605\u274F\u2794\u21B5\u2756\u25AA\u2751\u2022]+(\s|$)/gim,c=/^[-*](\s|$)/gim,d=/\b([0-9]+[.,][0-9]+[.,][0-9]+[.,][0-9]+|[0-9]+[.,][0-9]+[.,][0-9]+|[0-9]+[.,][0-9]+)\b/g,h=/(?<=(\s|^))(:\-?[\)(DPpoO]|;\-?\)|(xo|xO|XO){1,10}|xD|XD|\<3)(?=(\s|$))/g,u=/[\u2665\u2661\u2764]+/g,g=/\b[A-Z\-]{1,10}[\-_]?\d{2,100}\b/gi,m=/\u203D/g,p=/(\!{2,50}|\?{2,50}|(\?\!){2,50}|\.{4,50}|\-{2,10}|\:{2,50}|\;{2,50}|…{2,50}|\_{2,50}|\,{2,50}|\<{2,50}|\>{2,50}|\#{2,50}|\*{2,50}|\+{2,50}|\={2,50}|\/{2,50}|\\{2,50}|\%{2,50}|\~{2,50})/g,_=/[—–-]+/g,E=/\u2011+/g,f=/[\uFEFF\u200B\u200C\u200D\u00AD\u2060\u2063\u202A\u202B\u202C\u202D]+/g,T=/\s+/g,C=/^\/[a-z\-_]+/gm,v=/(?<=(\s|^))#[a-z0-9]+/gi,S=/(?<=(\s|^))[#%_\$€§*><~]+(?=(\s|$))/g,b=/\b[a-z0-9-_\/\.]+\.(com?|de|co\.uk|ch|at|fr|org|dk|se|no|info|net|eu|ai|io|nl|pl|ru|com\.br|br|pt|it|ca|com\.mx|mx|cn|mp[43]|jpe?g|gif|php|html?|s?css|jsx?|mov|png|web[mp]|pdf|docx?|xlsx?|pptx?|txt|rtf|bmp|svg|odt|zip|rar|gz|tar|app|dmg|exe|cad|psd|dotx?|tiff?|tsx?|woff|xml|csv|wav|ogg|pkg|rpm|iso|sql|php|email|eml|msi|otf|ttf|aspx?|py|java|swift|ods|sys|log|avi|wmv|m4v|sh)\b/gi,x=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF]|[\uFE00-\uFE0F]|[\u2B50-\u2B52])/g;class y{static normalize(e){return e=this.stripEmojis(e),e=this.stripEmailAddresses(e),e=this.stripURLs(e),e=this.stripSmileys(e),e=this.stripBulletPoints(e),e=this.stripFileNamesAndDomains(e),e=this.stripTokensWithNumbers(e),e=this.stripNumbers(e),e=this.stripMentions(e),e=this.stripUnicodeHearts(e),e=this.stripInvisibleWhitespace(e),e=this.stripChatCommands(e),e=this.stripHashTags(e),e=this.stripRepeatedWords(e),e=this.stripLeftoverChars(e),e=this.normalizePunctuation(e),e=this.normalizeHyphens(e),(e=this.normalizeWhitespace(e)).trim()}static stripEmojis(e){return e.replace(x,"")}static stripEmailAddresses(e){return e.replace(s,"")}static stripURLs(e){return e.replace(r,"")}static stripFileNamesAndDomains(e){return e.replace(b,"")}static stripBulletPoints(e){return e.replace(a,"").replace(l,"").replace(c,"")}static stripMentions(e){return e.replace(i,"")}static stripSmileys(e){return e.replace(h,"")}static stripUnicodeHearts(e){return e.replace(u,"")}static stripTokensWithNumbers(e){return e.replace(g,"")}static stripHashTags(e){return e.replace(v,"")}static stripNumbers(e){return e.replace(d,"").replace(o,"")}static stripInvisibleWhitespace(e){return e.replace(f,"")}static stripChatCommands(e){return e.replace(C,"")}static stripLeftoverChars(e){return e.replace(S,"")}static stripRepeatedWords(e){try{return e.replace(new RegExp("(?<![\\p{L}])([\\p{L}]+(?:-[\\p{L}]+)*)(?:\\s+\\1)+(?![\\p{L}])","giu"),"$1")}catch(t){return e.replace(/(^|[^a-zäöüß-])([a-zäöüß]+(?:-[a-zäöüß]+)*)(?:\s+\2)+(?![a-zäöüß-])/gi,"$1$2")}}static normalizeHyphens(e){return e.replace(_,"-").replace(E,"-")}static normalizePunctuation(e){return e.replace(m,"!").replace(p,((e,t)=>t.charAt(0)))}static normalizeWhitespace(e){return e.replace(T,(e=>e.includes("\n")?"\n":" "))}}},
506"./core/language/detectLanguageForShortText.ts":
507/*!*****************************************************!*\
508  !*** ./core/language/detectLanguageForShortText.ts ***!
509  \*****************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{detectLanguageForShortText:()=>d});const s={hallo:"de",moin:"de",viele:"de",servus:"de",gruezi:"de",kacke:"de",und:"de","und los":"de","na denn":"de",gut:"de",eins:"de",nie:"de",immer:"de",neein:"de",neeein:"de",neeeein:"de",stimmts:"de",das:"de",den:"de",hier:"de",sowas:"de","och nö":"de","hey du":"de","na gut":"de","hallo leute":"de","hey leute":"de",nagut:"de",ahoi:"de",bald:"de",juhu:"de",juchu:"de",alter:"de",fertig:"de",korrekt:"de",digga:"de",diggah:"de",digger:"de",gratis:"de",schade:"de",nicht:"de",meins:"de",willkommen:"de",schuldigung:"de",tschuldigung:"de",entschuldigung:"de",hö:"de",höhö:"de",sicher:"de",bitte:"de",klappt:"de",krass:"de",funzt:"de",hä:"de",häh:"de",hähä:"de",passt:"de",nee:"de",tschö:"de",tschöh:"de",du:"de",sie:"de",prima:"de",grüezi:"de",grüzi:"de",komme:"de",jepp:"de",japp:"de",anbei:"de","guten tag":"de","gute tag":"de","dank dir":"de",oha:"de",herr:"de",frau:"de",ja:"de",oja:"de",jo:"de",nö:"de",nöö:"de",nööö:"de",geil:"de",klasse:"de",nix:"de","oh ja":"de","oh je":"de",ohje:"de",oje:"de",wieso:"de",wann:"de",achso:"de",was:"de",ups:"de",hihi:"de",hihihi:"de",bitteschön:"de","bitte schön":"de",dankeschön:"de","danke schön":"de","besten dank":"de","vielen dank":"de","ja klar":"de","ja, klar":"de",au:"de",aua:"de",tja:"de",bäh:"de",ähm:"de",ähem:"de",hoppla:"de",uff:"de",zack:"de",bumm:"de",pfui:"de",hurra:"de",puh:"de",mist:"de",hi:"en",hey:"en",wassup:"en",wazzup:"en",yo:"en",oh:"en",done:"en",dollar:"en",yay:"en",yep:"en",nope:"en",please:"en",pls:"en",damn:"en",dammit:"en",shit:"en",bad:"en",usa:"en",rofl:"en",lol:"en",wtf:"en",huh:"en",thx:"en",ugh:"en",like:"en",ouch:"en",boo:"en",booo:"en",boooo:"en",no:"en",noo:"en",nooo:"en",noooo:"en",nooooo:"en","see ya":"en","see you":"en","love u":"en",yea:"en",hooray:"en",best:"en",jeez:"en",yeez:"en",geez:"en",woah:"en",omg:"en",gosh:"en",si:"es","mui bien":"es",oye:"es",vale:"es",que:"es",anda:"es",orale:"es",correcto:"es",ay:"es",eh:"es",claro:"es",hala:"es",bien:"es",cabron:"es",joder:"es",culo:"es",pendejo:"es","maldita sea":"es",hostia:"es",como:"es",cómo:"es",ajá:"es",aja:"es","como dice":"es",carajo:"es",jajaja:"es",jejeje:"es",perdon:"es",donde:"es",dale:"es",portada:"es",oi:"pt",ola:"pt",olá:"pt",tchau:"pt",adeus:"pt",beleza:"pt","ate logo":"pt","e ai":"pt","e aí":"pt",xau:"pt",oba:"pt",nossa:"pt",poxa:"pt",então:"pt",entao:"pt",uau:"pt",bom:"pt",certo:"pt",ufa:"pt",eita:"pt",otimo:"pt",ótimo:"pt","está ótimo":"pt","esta otimo":"pt","cruz credo":"pt",salut:"fr",coucou:"fr",daccord:"fr",accord:"fr",bonne:"fr",bonsoir:"fr","bon jour":"fr","bon soir":"fr","d'acc":"fr","d´acc":"fr","d`acc":"fr",allo:"fr",merde:"fr",ouf:"fr",aie:"fr",bon:"fr",zut:"fr",boum:"fr",donc:"fr",mince:"fr",comment:"fr",pardon:"fr",quand:"fr",beurk:"fr",putain:"fr",connard:"fr","a propos":"fr","quand meme":"fr","oh la la":"fr","miam miam":"fr","merci beacoup":"fr","ca va":"fr",dag:"nl",hoi:"nl",goedemorgen:"nl",welkom:"nl",dank:"nl","dank u":"nl","dank je":"nl",bedankt:"nl",verdorie:"nl",godverdomme:"nl",verdomme:"nl",klote:"nl",kloten:"nl",kak:"nl",kut:"nl",lul:"nl",flikker:"nl",hé:"nl",czesc:"pl","bon dia":"ca","si us plau":"ca","moltes gràcies":"ca","moltes gracies":"ca","com estàs":"ca","com estas":"ca","fins aviat":"ca",gràcies:"ca",gracies:"ca",perdó:"ca",enhorabona:"ca",índex:"ca"},r=/^([Hh]allo|[Ll]ieber?|[Mm]oin|[Nn]a|[Ss]ervus|[Dd]anke|Grüe?zi|Gruezi|Herr|Frau|Fräulein)\s[A-ZÄÖÜ][a-zäüß]/,i=/(\b|^)(guten\s(tag|abend|morgen)|sehr\sgeehrter?)(\b|$)/,o=/^ol[aáà]\s|((\b|^)(boa\snoite|bom\sdia)(\b|$))/,a=/(\b|^)(bon\sdia|moltes\sgr[aà]cies|bona\ssort|no\spassa\sres|com\sest[àa]s)(\b|$)/,l=/^[¿¡.…]+$/,c=/[!.:;…?,]+$/;function d(e,t){if(e.length>50)return null;const n=e.trim(),d=n.replace(l,"").replace(c,"").trim().toLowerCase();if(t.includes("de")&&(r.test(n)||i.test(d)))return"de";if(t.includes("pt")&&o.test(d))return"pt";if(t.includes("ca")&&a.test(d))return"ca";const h=s[d];return h&&t.includes(h)?h:null}},
509"./core/language/detectLanguageFromUnicode.ts":
510/*!****************************************************!*\
511  !*** ./core/language/detectLanguageFromUnicode.ts ***!
512  \****************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});const s=.5,r=(e,t,n)=>e>=t&&e<=n;function i(e,t=50){e=e.slice(0,t);let n=0,i=0,o=0,a=0,l=0,c=0,d=0,h=0,u=0,g=0,m=0;for(let t=0;t<e.length;t++){const s=e[t]??"",p=s.charCodeAt(0);/\s/.test(s)||/\d/.test(s)||"."===s||m++,r(p,1536,1791)&&n++,r(p,1024,1279)&&i++,(r(p,19968,40959)||r(p,12352,12447)||r(p,12448,12543))&&o++,r(p,6016,6143)&&a++,r(p,2946,3066)&&l++,(r(p,880,1023)||r(p,7936,8191))&&c++,r(p,2304,2431)&&d++,r(p,3584,3711)&&h++,(r(p,1424,1535)||r(p,64285,64320))&&u++,(r(p,44032,55215)||r(p,4352,4607)||r(p,12592,12687)||r(p,43360,43391)||r(p,55216,55295))&&g++}if(0===m)return[];const p=e=>e/m,_=[];return p(n)>=s&&_.push("ar","fa"),p(i)>=s&&_.push("ru","uk","be"),p(o)>=s&&_.push("zh","ja"),p(a)>=s&&_.push("km"),p(l)>=s&&_.push("ta"),p(c)>=s&&_.push("el"),p(d)>=s&&_.push("hi","mr"),p(h)>=s&&_.push("th"),p(u)>=s&&_.push("he"),p(g)>=s&&_.push("ko"),_}},
512"./core/textReplacingRules.ts":
513/*!************************************!*\
514  !*** ./core/textReplacingRules.ts ***!
515  \************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_TEXT_REPLACING_RULES:()=>r});var s=n(/*! ../config/config */"./config/config.ts");const r=[{pattern:/^[ \t]*>.*$/gm,preserveNewlineChars:!1},{pattern:/\s?<code\b[^>]*>[^]*?<\/code>/gi,preserveNewlineChars:!0},{pattern:/(^|\s|\s\()(_|~~)?(\*\*)([^\s\*](?:.*?\S)?)(\*\*)(\2)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!1,!0,!1,!0,!1,!1]},{pattern:/(^|\s|\s\()(\*|~~)?(__)([^\s_](?:.*?\S)?)(__)(\2)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!1,!0,!1,!0,!1,!1]},{pattern:/(^|\s|\s\()(__|~~)?(\*)([^\s\*](?:.*?\S)?)(\*)(\2)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!1,!0,!1,!0,!1,!1]},{pattern:/(^|\s|\s\()(\*\*|~~)?(_)([^\s_](?:.*?\S)?)(_)(\2)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!1,!0,!1,!0,!1,!1]},{pattern:/(^|\s|\s\()(\*\*\*)([^\s\*](?:.*?\S)?)(\*\*\*)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!0,!1,!0,!1]},{pattern:/(^|\s|\s\()(___)([^\s_](?:.*?\S)?)(___)([\s.!?,:;\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!0,!1,!0,!1]},{pattern:/(^|\s|\s\()(\*|\*\*|_|__)?(~~)([^\s~](?:.*?\S)?)(~~)(\2)([\s.!?,:;
515\)]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!1,!0,!1,!0,!1,!1]},{pattern:/(^|[^`])(```)(?!`)([^]*?[^`])(```)(?=[^`]|$)/gm,preserveNewlineChars:!0,excludedParts:[/^\s$/,!0,!0,!0]},{pattern:/(!\[(?:(?:Uploading\s)?(?:Screen\sShot\s|Bildschirmfoto\s)?)?)([^\[\]]+)(\]\(\s*[^()"'\s]*\s*\))/g,preserveNewlineChars:!0,excludedParts:[!0,!1,!0]},{pattern:/(!\[)([^\[\]]+)(\]\(\s*[^()"'\s]+)(\s+)(["'])([^]*?)(\5\s*\))/g,preserveNewlineChars:!0,excludedParts:[!0,!1,!0,!1,!0,!1,!0]},{pattern:/(\[)([^\[\]]+)(\]\(\s*[^()"'\s]+\s*\))/g,preserveNewlineChars:!0,excludedParts:[!0,!1,!0]},{pattern:/(\[)([^\[\]]+)(\]\(\s*[^()"'\s]+)(\s+)(["'])([^]*?)(\5\s*\))/g,preserveNewlineChars:!0,excludedParts:[!0,!1,!0,!1,!0,!1,!0]},{pattern:/\s?\[code\][^]*?\[\/code\]/gi,preserveNewlineChars:!0},{pattern:/\s?{code(:[a-z0-9#]+)?}[^]*?{code}/gi,preserveNewlineChars:!0},{pattern:/(^|\s)(~)([^\s~](?:.*?\S)?)(~)([\s.!?,:;]|$)/g,preserveNewlineChars:!1,excludedParts:[!1,!0,!1,!0,!1]},{pattern:/(^[-*])(\s\[(\s|x)\])(?=\s)/gim,replacingText:`*${s.INVISIBLE_SEPARATOR}`},{pattern:/(^\d+\.)(\s\[(\s|x)\])(?=\s)/gim,replacingText:`*${s.INVISIBLE_SEPARATOR}`},{pattern:/^(h[1-6]|bq|bc|p|pre|###|notextile)\./gim,preserveNewlineChars:!1},{pattern:/(\[\[)([a-z:][^|\]\n]*)(\]\])/gi,preserveNewlineChars:!1,excludedParts:[!0,!1,!0]},{pattern:/(\[\[[a-z:][^|\]\n]*\|)([^\]\n]+)(]])/gi,preserveNewlineChars:!1,excludedParts:[!0,!1,!0]},{pattern:/(^|\s+)([:;|=][-~^]?[()\[\]\\/|@$*#&XxDOoPp])(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)([8B%][-~^][D()\[\]])(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)([:;%|=][-~^]?3)(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)([()[\]\\/|@$*#&XxDOo][-~^]?[:;%|])(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)([xX]D)(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)(<[\\/]?3)(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/(^|\s+)\(([-+!?ynxi]|(\*[rgby]?)|on|off|flag|flagoff)\)(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,preserveNewlineChars:!0},{pattern:/<([a-z]+:)?br(\s[^>]*)?\/?>/gi,replacingText:"\n"},{pattern:/&(amp|quot|lt|gt);/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<!-- .*? -->/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<([a-z]+:)?(html|xml|base|head|link|meta|style|title|body|address|article|aside|footer|header|h1|h2|h3|h4|h5|h6|main|nav|section|blockquote|dd|div|dl|dt|figcaption|figure|hr|li|ol|p|pre|ul|a|abbr|b|bdi|bdo|cite|code|data|dfn|em|i|kbd|mark|q|rp|rt|ruby|s|samp|small|span|strong|sub|sup|time|u|var|wbr|area|audio|img|map|track|video|embed|iframe|object|param|picture|portal|source|svg|canvas|noscript|script|del|ins|caption|col|colgroup|table|tbody|td|tfoot|th|thead|tr|button|datalist|fieldset|form|input|label|legend|meter|optgroup|option|output|progress|select|textarea|details|dialog|menu|summary|slot|template|acronym|applet|basefont|bgsound|big|blink|center|content|dir|font|frame|frameset|hgroup|image|keygen|marquee|menuitem|nobr|noembed|noframes|plaintext|rb|rtc|shadow|spacer|strike|tt|xmp)(\s[^>]*)?>/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<\/([a-z]+:)?(html|xml|base|head|link|meta|style|title|body|address|article|aside|footer|header|h1|h2|h3|h4|h5|h6|main|nav|section|blockquote|dd|div|dl|dt|figcaption|figure|hr|li|ol|p|pre|ul|a|abbr|b|bdi|bdo|cite|code|data|dfn|em|i|kbd|mark|q|rp|rt|ruby|s|samp|small|span|strong|sub|sup|time|u|var|wbr|area|audio|img|map|track|video|embed|iframe|object|param|picture|portal|source|svg|canvas|noscript|script|del|ins|caption|col|colgroup|table|tbody|td|tfoot|th|thead|tr|button|datalist|fieldset|form|input|label|legend|meter|optgroup|option|output|progress|select|textarea|details|dialog|menu|summary|slot|template|acronym|applet|basefont|bgsound|big|blink|center|content|dir|font|frame|frameset|hgroup|image|keygen|marquee|menuitem|nobr|noembed|noframes|plaintext|rb|rtc|shadow|spacer|strike|tt|xmp)>/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<([a-z]+:)?(a|altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform|circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feC
515olorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern|image|line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata|missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|script|set|solidcolor|stop|style|svg|switch|symbol|text|textPath|title|tref|tspan|unknown|use|view|vkern)(\s[^>]*)?>/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<\/([a-z]+:)?(a|altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform|circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern|image|line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata|missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|script|set|solidcolor|stop|style|svg|switch|symbol|text|textPath|title|tref|tspan|unknown|use|view|vkern)>/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/<([a-z]+:)?[a-z][^>]*?\/>/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/(<)((?:[a-z]+:)?[a-z][^\s>]*)(\s[^>]*)?(>)(?=([^]*?)(<\/\2>))/gi,getReplacedParts:e=>{if("code"===e[2].toLowerCase())return[];const t=e.index,n=e[1].length+e[2].length+(e[3]?e[3].length:0)+e[4].length,r=t+n+e[5].length,i=e[6].length;return[{offset:t,length:1,replacingText:s.INVISIBLE_SEPARATOR},{offset:t+1,length:n-1},{offset:r,length:1,replacingText:s.INVISIBLE_SEPARATOR},{offset:r+1,length:i-1}]}},{pattern:/\[(img|url|email|post|quote|list|youtube|vimeo|googlemaps|googlewidget|code|modalurl|topic|highlight|left|center|right|font|size|color|s|u|i|b|style|table|tr|td)\b[^\]\n]*\]/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/\[\/(img|url|email|post|quote|list|youtube|vimeo|googlemaps|googlewidget|code|modalurl|topic|highlight|left|center|right|font|size|color|s|u|i|b|style|table|tr|td)\]/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/{{[\/\^\!#]?[a-z0-9_\-]+}}/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/{{{[\/\^\!#]?[a-z0-9_\-]+}}}/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/\[[a-z0-9_\-]+\s[a-z0-9_\-]+=.+?\]/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/(^|\s|\s\()`([^`\n]+)`([\s.!?,:;\)]|$)/g,getReplacedParts:e=>{const t=e.index+e[1].length+1,n=e[2].length;return[{offset:t,length:1,replacingText:s.INVISIBLE_SEPARATOR},{offset:t+1,length:n-1}]}},{pattern:/{(color|code|noformat|quote)(:[a-z0-9#]+)?}/gi,replacingText:s.INVISIBLE_SEPARATOR},{pattern:/(^|\s+)(\:\w+\:)(\s+(?=[,.!?)]|$)|(?=[\s,.!?)]|$))/gm,replacingText:s.INVISIBLE_SEPARATOR}]},
515"./core/textUtils.ts":
516/*!***************************!*\
517  !*** ./core/textUtils.ts ***!
518  \***************************/(e,t,n)=>{"use strict";function s(e){let t=null;return(e.oldText!==e.newText&&null!==e.newText||e.oldText==e.newText&&null==e.textDiff&&e.oldOffset!==e.newOffset)&&(t={id:e.id??void 0,text:e.newText,offset:e.newOffset,oldText:e.oldText,oldOffset:e.oldOffset}),t}n.r(t),n.d(t,{DiffUtil:()=>r,toParagraph:()=>s});class r{static _isDelete(e){return null!==e.oldText&&null===e.newText}static _isInsert(e){return null===e.oldText&&null!==e.newText}static _hasTextBeforeAndAfter(e){return null!==e.oldText&&null!==e.newText}static _isShift(e){return r._hasTextBeforeAndAfter(e)&&e.oldOffset!==e.newOffset&&e.oldText===e.newText}static _isChange(e){return r._hasTextBeforeAndAfter(e)&&e.oldOffset===e.newOffset&&e.oldText!==e.newText}static _isShiftAndChange(e){return r._hasTextBeforeAndAfter(e)&&e.oldOffset!==e.newOffset&&e.oldText!==e.newText}static groupParagraphsByOperation(e){const t=[],n=[],s=[],i=[],o=[];for(const a of e)r._isDelete(a)?i.push(a):r._isInsert(a)?o.push(a):r._isShiftAndChange(a)?t.push(a):r._isShift(a)?n.push(a):r._isChange(a)?s.push(a):console.error("debug::: should not happen:: failed to classify diff",a);return{shifts:n,changes:s,shiftAndChanges:t,deletions:i,insertions:o}}}},
518"./core/userActivity.ts":
519/*!******************************!*\
520  !*** ./core/userActivity.ts ***!
521  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{handleUserActivityPings:()=>c,init:()=>a,initializeUserActivity:()=>l,sendAndDestroyCompletedUserActivities:()=>p,sendAndDestroyUserActivity:()=>m,sendUserActivity:()=>_,updateAppliedRewritings:()=>u,updateAppliedSuggestions:()=>h,updateMeta:()=>g,updateTextStatistics:()=>d});var s=n(/*! ../config/config */"./config/config.ts"),r=n(/*! ./utils */"./core/utils.ts");const i=()=>({spelling:0,grammar:0,style:0,punctuation:0,typography:0});let o=(()=>{const e={};return{set:(t,n)=>(e[t]=n,Promise.resolve()),get:t=>Promise.resolve(e[t]),getAll:()=>Promise.resolve(e),delete:t=>(delete e[t],Promise.resolve())}})();function a(e){e&&(o=e)}async function l(e){return o.set(e.uuid,{email:e.email,token:e.token,source:e.source,suggestions:i(),statistics:{words:0,sentences:0,texts:0,hiddenMatches:0,premiumMatches:0,pickyErrors:0},meta:{language:e.language,writingGoalId:e.writingGoalId,checkLevel:e.checkLevel},rewritings:0,lastPing:Date.now()})}async function c(e){e.forEach((async e=>{const t=await o.get(e);t&&(t.lastPing=Date.now(),await o.set(e,t))}))}async function d(e,t){const n=await o.get(e);if(!n)return;const s=Object.entries(t).reduce(((e,[t,n])=>(e[t]+=n,e)),n.statistics);await o.set(e,{...n,statistics:s,lastPing:Date.now()})}async function h(e,t,n){if(function(e){return"custom"===e}(t))return;const s=await o.get(e);if(!s)return;const r=s.statistics.premiumMatches+Number(n);await o.set(e,{...s,suggestions:{...s.suggestions,[t]:s.suggestions[t]+1},statistics:{...s.statistics,premiumMatches:r},lastPing:Date.now()})}async function u(e){const t=await o.get(e);t&&await o.set(e,{...t,rewritings:t.rewritings+1,lastPing:Date.now()})}async function g(e,t){const n=await o.get(e);n&&await o.set(e,{...n,meta:t,lastPing:Date.now()})}async function m(e){if(!await o.get(e))throw console.error("Failed to destroy activity; no User Activity found for UUID:",e),new Error("Failed to destroy activity; no User Activity found for UUID");const t=await _(e);return await o.delete(e),t}async function p(){const e=Date.now();let t=3;const n=await o.getAll();for(const r in n)if(e-n[r].lastPing>s.USER_ACTIVITY_DESTRUCTION_DELAY&&(await m(r),! --t))break}async function _(e){const t=await o.get(e);if(!t)return"unknown_uuid";try{const n={source:t.source,data:{rewritings:t.rewritings,...t.statistics,...t.suggestions,...t.meta}};if(!function({data:e}){const t=["checkLevel","writingGoalId","language"];return Object.entries(e).filter((([e])=>!1===t.includes(e))).some((([,e])=>Boolean(e)))&&(0,r.isString)(e.language)}(n))return"no_update";await async function(e){let t=await o.get(e);t&&(t={...t,suggestions:i(),statistics:{words:0,sentences:0,texts:0,hiddenMatches:0,premiumMatches:0,pickyErrors:0},rewritings:0},await o.set(e,t))}(e);const a={method:"POST",referrerPolicy:"no-referrer",credentials:"omit",mode:"cors",headers:{Authorization:`Basic ${btoa([t.email,t.token].join(":"))}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)};return"standalone"===t.source&&(a.keepalive=!0),await(0,r.fetchWithTimeout)(s.STATISTICS_URL,a,3e4),"success"}catch{return"error"}}},
521"./core/utils.ts":
522/*!***********************!*\
523  !*** ./core/utils.ts ***!
524  \***********************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{AcceptChangeType:()=>Me,RULE_ISSUE_TYPES:()=>Je,binarySearch:()=>ie,binarySearchIndex:()=>oe,capitalize:()=>N,clone:()=>ue,compareNumberAndSegment:()=>Fe,compareSegments:()=>Be,deepClone:()=>ge,deepEqual:()=>de,escapeHTML:()=>se,fetchWithTimeout:()=>We,fill:()=>ce,filterRangesContainedIn:()=>je,formatNumber:()=>ye,generateChecksum:()=>Ze,generateHash:()=>$e,generateStackTrace:()=>pe,getChangedParagraphs:()=>qe,getChangedSentence:()=>Qe,getCountdown:()=>_e,getCurrentDomain:()=>be,getCurrentHostUrl:()=>xe,getCurrentLocationInfo:()=>Se,getCurrentUrl:()=>Ce,getDefaultTextSubset:()=>Xe,getDomain:()=>ve,getErrorType:()=>Le,getFirstSentenceRangeInSelection:()=>j,getLastSentenceRangeInSelection:()=>W,getMainPageDomain:()=>Ae,getNumberPosition:()=>Y,getParagraphsDiff:()=>ne,getPhrasalContext:()=>K,getPhrasePosition:()=>V,getRandomNumberInRange:()=>ae,getReplacedParts:()=>J,getSentenceIndexByOffset:()=>G,getSentenceRangeBySelection:()=>B,getStringSimilarity:()=>Ne,getSubdomains:()=>ke,getTextsDiff:()=>ee,getValuableText:()=>Q,getWordContext:()=>z,getWordPosition:()=>$,includesWhiteSpace:()=>b,indexOfZWC:()=>k,isAllUppercase:()=>H,isBoolean:()=>E,isCapitalized:()=>O,isDateInFuture:()=>He,isDomainInList:()=>Re,isDoubleQuotationMark:()=>a,isEmoji:()=>h,isEmptyObject:()=>re,isEndsWithWhitespace:()=>i,isErrorIgnoredByDictionary:()=>Ie,isErrorRuleIgnored:()=>Pe,isFunction:()=>m,isIntersect:()=>Ue,isLetter:()=>d,isNumber:()=>_,isNumeric:()=>f,isObject:()=>u,isRangeContainedIn:()=>Ge,isSameObjects:()=>he,isString:()=>p,isTextsCompletelyDifferent:()=>te,isUndefined:()=>g,isWhiteSpace:()=>C,isZWC:()=>y,matchAll:()=>r,normalizeDomain:()=>we,normalizeSpace:()=>Ve,normalizeSpaceAndEncoding:()=>Ke,normalizeWhiteSpaces:()=>S,pad:()=>Ee,removeDiacritics:()=>Oe,removeZWC:()=>R,splitGraphemes:()=>Te,startsWithUppercase:()=>D,stripHTMLTags:()=>U,toLowercaseFirstChar:()=>F,trimInvisibleSeparatorAtEnd:()=>P,trimInvisibleSeparatorAtStart:()=>M,trimSentenceRanges:()=>q,tryThese:()=>De,uniq:()=>le,uuidv4:()=>ze,waitFor:()=>me});var s=n(/*! ../config/config */"./config/config.ts");
525/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */function r(e,t){if("function"==typeof e.matchAll)return Array.from(e.matchAll(t));const n=[];let s=t.exec(e);for(;s;)n.push(s),s=t.exec(e);return n}function i(e){return e.length>0&&" "===e[e.length-1]}const o=['"',"„","“","”","«","»"];function a(e){return o.includes(e)}let l,c;try{l=new RegExp("\\p{L}","u")}catch(e){l=/[a-zäöüß]/i}function d(e){return l.test(e)}try{c=new RegExp("(?:\\p{Emoji}|\\u200d|\\ufe0e|\\ufe0f)","u")}catch(e){c=/_^/}function h(e){return c.test(e)}const u=e=>!!e&&Object.getPrototypeOf(e)===Object.prototype,g=e=>void 0===e,m=e=>"function"==typeof e,p=e=>"string"==typeof e,_=e=>"number"==typeof e,E=e=>"boolean"==typeof e,f=e=>Number.isInteger(parseInt(e,10)),T=["\b","\t"," "," "," "," "," "," "," "," "," "," ","‏"," "];function C(e){return" "===e||T.includes(e)}const v=new RegExp("["+T.join("")+"]","g");function S(e){return e.replace(v," ")}function b(e){return/\s/.test(e)}const x=["­","​","‌","‍","‪","‫","‬","‭","⁠","\ufeff"];function y(e){return x.includes(e)}const A=new RegExp("["+x.join("")+"]");function k(e){const t=e.match(A);return t?t.index:-1}const w=new RegExp("["+x.join("")+"]","g");function R(e){return e.replace(w,"")}const L=new RegExp("^"+s.INVISIBLE_SEPARATOR+"+");function M(e){return e.replace(L,"")}const I=new RegExp(s.INVISIBLE_SEPARATOR+"+$");function P(e){return e.replace(I,"")}function N(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function O(e){const t=e.charAt(0);return t.toUpperCase()===t}function D(e){const t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()}
525const H=function(){const e=/^[A-ZÈÉÊÁÀÂÓÒÔÚÙÛÍÌÎÄÜÖ]+[A-ZÈÉÊÁÀÂÓÒÔÚÙÛÍÌÎÄÜÖ\-!?#@=%().:;<>'’´`"”“*+,\s]+[A-ZÈÉÊÁÀÂÓÒÔÍÌÎÄÜÖ]$/;return function(t){return e.test(t)}}();function U(e){return e.replace(/<[^>]*>/g,"")}function F(e){return e.charAt(0).toLowerCase()+e.substr(1)}function B(e,t){const{start:n,end:s=n}=t||{start:-1};if(!e||-1===n)return;const r=e.map((e=>Array.isArray(e)?e:[e.start,e.end])).findIndex((([e,t])=>n>=e&&s<=t));return r<0?void 0:e[r]}function G(e,t){const{start:n,end:s=n}=t||{start:-1};if(!e||-1===n)return;const r=e.map((e=>Array.isArray(e)?e:[e.start,e.end])).findIndex((([e,t])=>n>=e&&s<=t));return r<0?void 0:r}function j(e,t){const{start:n}=t||{start:-1};if(!e||-1===n)return;const s=e.sort(((e,t)=>e.start-t.start)).find((e=>{if(n<=e.end&&n>=e.start)return!0}));return s||void 0}function W(e,t){const{end:n}=t||{end:-1};if(!e||void 0===n||-1===n)return;const s=e.sort(((e,t)=>e.start-t.start)).find((e=>{if(n<=e.end&&n>=e.start)return!0}));return s||void 0}let $,z,V,K;!function(){const e=/(?:\S+\s+){0,4}\S+$/,t=/^\S+(?:\s+\S+){0,4}/;$=(e,t,n=t,s=!0)=>{const[r,i]=(()=>{try{const e=s?"":["\\p{Emoji}","\\u200d","\\ufe0e","\\ufe0f"].join("");return[new RegExp("^\\s*(-?[\\p{L}#*"+e+"]+){0,3}-?\\s*$","u"),new RegExp("^\\s*[\\p{L}#*"+e+"]+(-[\\p{L}#*"+e+"]+){0,3}\\s*$","u")]}catch{return[/^\s*(-?[a-zäöüß#*]+){0,3}-?\s*$/i,/^\s*[a-zäöüß#*]+(-[a-zäöüß#*]+){0,3}\s*$/i]}})(),o=e=>!s&&h(e),a=e.substring(t,n),[{length:l=0}]=a.match(/^[^\S]*/),[{length:c=0}]=a.match(/[^\S]*$/);if(!r.test(a))return null;const u=(()=>{const n=t+l,s=e.substring(0,n).split(/[^\S]+/);return Te(s[s.length-1]).reverse()})(),g=(()=>{const t=n-c,[s]=e.substring(t).split(/[^\S]+/);return Te(s)})(),m=Math.max(u.length,g.length);let p=!1,_=!1,E=t,f=n;for(let e=0;e<m;e++){const t=u[e],n=t&&(d(t)||o(t)||"-"===t),s=g[e],r=s&&(d(s)||o(s)||"-"===s);if(n&&!p?E-=t.length:p=!0,r&&!_?f+=s.length:_=!0,p&&_)break}l>0&&(E+=l),c>0&&(f-=c);const T=e.substring(E,f);return i.test(T)?{start:E,end:f}:null},z=(n,s,r=s,i,o=!0)=>{const a=$(n,s,r,o);if(!a)return null;const l=B(i,{start:s,end:r});let c="",d="",h="";if(l)h=n.substring(l.start,l.end).trim(),c=n.slice(l.start,a.start).trim(),d=n.slice(a.end,l.end).trim();else{const s=e.exec(n.substring(0,a.start).trim());c=s?s[0]:"",c=c.replace(/^.+\n\n/,"");const r=t.exec(n.substring(a.end).trim());d=r?r[0]:"",d=d.replace(/\n\n.+/,"")}return{word:n.substring(a.start,a.end),position:a,sentence:h,beforeText:c,afterText:d}}}(),function(){let e;const t=[['"','"'],["'","'"],["“","”"],["„","“"],["‘","’"],["‚","‘"],["«","»"],["»","«"],["`","`"],["´","´"],["{","}"],["[","]"],["(",")"],["<",">"]],n="[^\\S]",s="[.,:;¡!¿?]",r="[\\udc00-\\udfff\\ud800-\\udb7f\\u200d\\ufe0e\\ufe0f\\p{Emoji_Presentation}\\p{Emoji_Modifier}\\p{Emoji}]";let i,o,a,l;const c=/(?:\S+\s+){0,4}\S+$/,d=/^\S+(?:\s+\S+){0,4}/;try{const t=[n,s,r].join("|");i=new RegExp(`(?:${t})`,"u"),o=new RegExp(`^(?:${t})*`,"u"),a=new RegExp(`(?:${t})*$`,"u"),e=new RegExp("^\\s*\\p{L}+(-\\p{L}+)*\\s*$","u"),l=new RegExp("^\\p{L}+$","u")}catch{const t=[n,s].join("|");i=new RegExp(`(?:${t})`),o=new RegExp(`^(?:${t})*`),a=new RegExp(`(?:${t})*$`),e=/^\s*[a-zäöüß]+(-[a-zäöüß]+)*\s*$/i,l=/^[a-zäöüß]+$/i}V=(s,r,c=r,d)=>{const h=s.substring(r,c),u=r===c,g=u?s.substring(r-1,c):"",m=u?s.substring(r,c+1):"",p=!!u&&0===[g,m].filter((e=>!!e.match(l))).length,_=h.split(new RegExp(`${n}+`)).length>5,[E=""]=h.match(o),[f=""]=h.match(a),T=E.length,C=f.length,v=[E.trim(),f.trim()];if(p||_)return null;const S=j(d,{start:r,end:c})?.start||0,b=W(d,{start:r,end:c})?.end||s.length-1;let x=r+T;for(;x>S;){const[e]=s[x-1].match(i)||[];if(e){0===T&&(v[0]+=e.trim());break}x--}let y=c-1-C;for(;y<b-1;){const[e]=s[y+1].match(i)||[];if(e){0===C&&(v[1]+=s[y+1].trim());break}y++}if(y+=1,x===S&&y===b)return null;const A=s.substring(x,y);if(A.split(e).length>=6)return null;let k=!1,w=!1;for(const[e,n]of t){k||!A.startsWith(e)||A.slice(1).includes(n)||(x+=1,k=!0,v[0]+=A[0]);const t=A.length-1;w||!A.endsWith(n)||A.slice(0,t).includes(e)||(y-=1,w=!0,v[1]+=A[t])}return{start:x,end:y,omittedCharacters:v}},K=(e,t,n=t,s)=>{let r=V(e,t,n,s);if(!r)return null;const i=B(s,{start:t,end:n});r=(()=>
525{if(!i)return r;const t=e.slice(i.start,r.start),n=e.slice(r.end,i.end),s=!t||!!t.match(/^[¡¿]+$/),o=!n||!!n.match(/^[.!?]+$/);return s&&o&&(r={start:i.start,end:i.end,omittedCharacters:["",""]}),r})();let o="",a="",l="";if(i)l=e.substring(i.start,i.end).trim(),o=e.slice(i.start,r.start).trim(),a=e.slice(r.end,i.end).trim();else{const t=c.exec(e.substring(0,r.start).trim());o=t?t[0]:"",o=o.replace(/^.+\n\n/,"");const n=d.exec(e.substring(r.end).trim());a=n?n[0]:"",a=a.replace(/\n\n.+/,"")}return K.trackOmittedCharacters?.(r.omittedCharacters),{phrase:e.substring(r.start,r.end),position:{start:r.start,end:r.end},sentence:l,beforeText:o,afterText:a}}}();const X=e=>{const t=s.INVISIBLE_SEPARATOR.charCodeAt(0).toString(16),n=new RegExp(`^(?:[^\\S]|•|\\u${t})+$`),r=new RegExp(`^(?:[^\\S]|\\u${t})+$`),i=e.split("").reverse().join(""),o=Math.floor(e.length/2);let a,l,c=0,d=0;for(let t=0;t<o;t++){const s=e.charAt(t),o=i.charAt(t);if(!0!==a&&s.match(n)?(c+=1,a=!1):a=!0,!0!==l&&o.match(r)?(d+=1,l=!1):l=!0,a&&l)break}return[c,d]},q=(e,t)=>{const n=new RegExp(s.INVISIBLE_SEPARATOR,"g"),r=[];for(const s of e){const{start:e,end:i}=s,o=t.substring(e,i);if(!o.replace(n,"").trim())continue;const[a,l]=X(o),c=e+a,d=c+o.length-a-l,h=d-c;r.push({start:c,end:d,length:h,detectedLanguages:s.detectedLanguages,checkStatus:s.checkStatus})}return r};function Y(e,t){let n=f(e[t]),s=t,r=t;if(n){for(;s>0&&(n=f(e[s]),n);)s--;for(;r<e.length&&(n=f(e[r]),n);)r++}return s===r?null:{start:s,end:r}}function Z(e,t,n){const s=[],r=e.substring(t,t+n);let i=0,o=r.indexOf("\n");for(;-1!==o;)s.push({offset:t+i,length:o-i}),i=o+1,o=r.indexOf("\n",o+1);return s.push({offset:t+i,length:r.length-i}),s}function J(e,t){const n=[];for(const s of t){const t=r(e,s.pattern);if("preserveNewlineChars"in s)for(const r of t){let t=r.index;if(void 0===s.excludedParts){const i=r[0].length;s.preserveNewlineChars?n.push(...Z(e,t,i)):n.push({offset:t,length:i})}else for(let i=0;i<s.excludedParts.length;i++){if(void 0===r[i+1])continue;const o=r[i+1].length,a=s.excludedParts[i];("boolean"==typeof a?a:a.test(r[i+1]))&&(s.preserveNewlineChars?n.push(...Z(e,t,o)):n.push({offset:t,length:o})),t+=o}}else if("replacingText"in s)for(const e of t){const t=e.index,r=e[0].length;n.push({offset:t,length:s.replacingText.length,replacingText:s.replacingText}),n.push({offset:t+s.replacingText.length,length:r-s.replacingText.length})}else if("getReplacedParts"in s)for(const e of t)n.push(...s.getReplacedParts(e))}return n}function Q(e,t){if(0===t.length)return{text:e,originalText:e,usedParts:[{start:0,end:e.length,originalStart:0,originalEnd:e.length,posDiff:0,length:e.length,text:e}],ignoredParts:[]};t=function(e,t){const n=[];n.length=t,ce(n,!1);const s=[];
525s.length=t;const r=[];r.length=t,ce(r,0);for(const t of e)if("replacingText"in t)for(let e=0;e<t.replacingText.length;e++)s[t.offset+e]=t.replacingText[e],r[t.offset+e]=t.offsetShift||0;else ce(n,!0,t.offset,t.offset+t.length);for(let e=0;e<t;e++)n[e]&&(s[e]=void 0,r[e]=0);const i=[];let o=0;for(;o<t;)if(n[o]){let e=o;for(;e<t&&n[e];)e++;i.push({offset:o,length:e-o}),o=e}else o++;for(o=0;o<t;)if(void 0!==s[o]){const e=r[o];let t=o;for(;t<s.length&&r[t]===e&&void 0!==s[t];)t++;const n=s.slice(o,t).join("");i.push({offset:o,length:t-o,replacingText:n,offsetShift:e}),o=t}else o++;return i.sort(((e,t)=>e.offset-t.offset)),i}(t,e.length);const n=[];let s=0,r=0;for(const i of t){if(r<i.offset){const t=i.offset-r;n.push({start:s,end:s+t,originalStart:r,originalEnd:r+t,posDiff:r-s,length:t,text:e.substr(r,t)}),s+=t}if("replacingText"in i){let e=i.offset;e+=i.offsetShift||0,n.push({start:s,end:s+i.length,originalStart:e,originalEnd:e+i.length,posDiff:e-s,length:i.length,text:i.replacingText.padEnd(i.length," ")}),s+=i.length}r=i.offset+i.length}if(r<e.length){const t=e.length-r;n.push({start:s,end:s+t,originalStart:r,originalEnd:r+t,posDiff:r-s,length:t,text:e.substr(r)})}const i=n.map((e=>e.text)).join(""),o=[];for(const e of t)if("replacingText"in e){const t=e.offsetShift||0;0!==t&&o.push({start:e.offset,end:e.offset+t}),e.length!==e.replacingText.length+t&&o.push({start:e.offset+t+e.replacingText.length,end:e.offset+e.length})}else o.push({start:e.offset,end:e.offset+e.length});return{text:i,originalText:e,usedParts:n,ignoredParts:o}}function ee(e,t){if(e===t)return null;let n=0;const s=Math.max(e.length,t.length);for(n=0;n<s&&e[n]===t[n];n++);let r=0;const i=Math.min(e.length,t.length);for(;n+r<i&&e[e.length-r-1]===t[t.length-r-1];)r++;return{from:n,oldFragment:e.substring(n,e.length-r),newFragment:t.substring(n,t.length-r)}}function te(e,t){const n=e.split("\n"),s=t.split("\n");for(const e of n)if(s.some((t=>t===e)))return!1;return!0}function ne(e,t,n=!1){const s=[];n&&(e=Ke(e),t=Ke(t));const r=e.split("\n"),i=t.split("\n");let o=0;const a=Math.max(r.length,i.length);for(o=0;o<a&&r[o]===i[o];o++);let l=0;const c=Math.min(r.length,i.length);for(;o+l<c&&r[r.length-l-1]===i[i.length-l-1];)l++;let d=0;for(let e=0;e<o;e++)d+=r[e].length+1;let h=d;for(let e=o;e<a-l;e++){const t=e<r.length-l?r[e]:null,n=e<i.length-l?i[e]:null;t===n&&d===h||s.push({oldText:t,newText:n,oldOffset:d,newOffset:h,textDiff:ee(t||"",n||"")}),null!==t&&(d+=t.length+1),null!==n&&(h+=n.length+1)}if(d!==h)for(let e=l-1;e>=0;e--){const t=r[r.length-e-1],n=i[i.length-e-1];s.push({oldText:t,newText:n,oldOffset:d,newOffset:h,textDiff:null}),d+=t.length+1,h+=n.length+1}return s}function se(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#x60;").replace(/\//g,"&#x2F;")}function re(e){return 0===Object.keys(e).length&&e.constructor===Object}function ie(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+Math.ceil((s-n)/2),i=t(e[r]);if(i>0)n=r+1;else{if(!(i<0)){for(let n=r;n>0;n--)if(0!==t(e[n-1]))return e[n];return e[0]}s=r-1}}return null}function oe(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+Math.ceil((s-n)/2),i=e[r];if(i<t)n=r+1;else{if(!(i>t)){for(let n=r;n>0;n--)if(e[n-1]!==t)return n;return 0}s=r-1}}return-1}function ae(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function le(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&t.push(e)})),t}function ce(e,t,n=0,s=e.length){for(let r=n;r<s;r++)e[r]=t}function de(e,t,n=!0,s=new WeakSet){if(e===t)return!0;if(null==e||"object"!=typeof e||null==t||"object"!=typeof t)return!1;if(s.has(e))return!0;if(s.add(e),e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!de(i,t.get(r),n,s))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!de(e[r],t[r],n,s))return!1;return!0}if(Array.isArray(e)||Array.isArray(t))return!1;const r=Object.keys(e).filter((t=>!!n||void 0!==e[t])),i=Object.keys(t).filter((e=>!!n||void 0!==t[e]));if(r.length!==i.length)return!1;for(const o of r){if(!i.includes(o))return!1;if(!de(e[o],t[o],n,s))return!1}return!0}function he(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}function ue(e){return null===e||"object"!=typeof e?e:e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e):Array.isArray(e)?Array.from(e):Object.assign({},e)}function ge(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);const t=Array.isArray(e)?[]:{};for(const n in e)t[n]=ge(e[n]);return t}function me(e,t=400,n=15,s){return new Promise(((r,i)=>{let o=0;const a=()=>{const e=new DOMException(s?.reason||"`waitFor` was aborted","AbortError");clearInterval(d),l(),i(e)},l=()=>s?.removeEventListener("abort",a),c=()=>{let t;try{t=e()}catch(e){return l(),void i(e)}null!=t&&(clearInterval(d),l(),r(t)),++o>=n&&(clearInterval(d),l(),i(new Error("`waitFor` timed out")))},d=self.setInterval(c,t);s?.addEventListener("abort",a),c()}))}function pe(e){if(!e.stack)return;const t=[];
525if(e.stack.split(/\n/).forEach((e=>{const n=e.match(/([\w_<>]+)\s+\(.+?([\w_\-]+\.(js|html))/);n&&t.push(`${n[2]}:${n[1]}`)})),!t.length){const n=e.stack.match(/([\w_\-]+\.(js|html))/);n&&t.push(n[1])}return t.join(",").substr(0,140)}function _e(e){let t=e-Date.now();t<0&&(t=0);const n=Math.floor(t/1e3%60),s=Math.floor(t/1e3/60%60);return`${Ee(Math.floor(t/1e3/60/60))}:${Ee(s)}:${Ee(n)}`}function Ee(e){const t=e.toString();return 1===t.length?"0"+t:t}let fe=null;function Te(e){return Intl.Segmenter?(fe||(fe=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Array.from(fe.segment(e),(e=>e.segment))):[...e]}function Ce(){if("about:blank"===location.href||"about:srcdoc"===location.href)try{return(self.opener||self.parent).location.href}catch(e){}return location.href}function ve(e,t=e){if(e.startsWith("about:blank"))return"blank";if(e.startsWith("about:srcdoc"))return"srcdoc";if(e.startsWith("file:"))return"file";e&&!/^([a-z\-]+:\/\/)/i.test(e)&&(e="http://"+e);try{return new URL(e).hostname}catch(e){return t}}function Se(e){const t=document.location||document.defaultView.location;if(t&&t.hostname){const n=e(t);return"string"==typeof n?n.replace(/^www\./,""):n}try{if(self.parent!==self){const t=e(self.parent.location);return"string"==typeof t?t.replace(/^www\./,""):t}}catch(e){}return t.href.startsWith("about:blank")?"blank":t.href.startsWith("about:srcdoc")?"srcdoc":t.href.startsWith("file:")?"file":""}function be(){return Se((e=>e.hostname))}function xe(){return Se((e=>e.href))}function ye(e,t){return e.toLocaleString(t)}function Ae(){let e;return self.parent!==self&&document.referrer&&(e=ve(document.referrer)),e||(e=be()),e}function ke(e){const t=[e];for(;e.split(".").length>2;){const n=e.indexOf(".");e=e.substr(n+1),t.push(e)}return t}function we(e){return ve(e).toLowerCase().trim().replace(/^www\./,"")}function Re(e,t){const n=we(t);return(e||[]).some((e=>{const t=we(e);return t===n||n.endsWith("."+t)}))}const Le=e=>e.isSpellingError?"spelling":e.isStyleError?"style":"TYPOGRAPHY"===e.rule.category.id?"typography":e.isPunctuationError?"punctuation":"grammar";var Me;!function(e){e.GC="GC",e.GC_RECOMMENDATION="GC_RECOMMENDATION",e.REPHRASING="PPHR"}(Me||(Me={}));const Ie=function(){const e=/^\w+\.$/;return(t,n)=>{if(!t.isSpellingError)return!1;let s=t.originalPhrase;if(e.test(s)&&(s=s.substring(0,s.length-1)),n.includes(s))return!0;if(D(s)){const e=F(s);if(n.includes(e))return!0}return!1}}();function Pe(e,t){const n=e.language.code.split("-")[0];return t.some((t=>!(t.id!==e.rule.id||"*"!==t.language&&t.language!==n||!t.id.includes("FRENCH_WHITESPACE")&&t.phrase&&!(t.id.includes("TOO_LONG_SENTENCE")&&Ne(t.phrase,e.originalPhrase)>.75)&&t.phrase.toLowerCase()!==e.originalPhrase.toLowerCase())))}function Ne(e,t,n=2,s=!1){if(s||(e=e.toLowerCase(),t=t.toLowerCase()),e.length<n||t.length<n)return 0;const r=new Map;for(let t=0;t<e.length-(n-1);t++){const s=e.substr(t,n);r.set(s,r.has(s)?r.get(s)+1:1)}let i=0;for(let e=0;e<t.length-(n-1);e++){const s=t.substr(e,n),o=r.has(s)?r.get(s):0;o>0&&(r.set(s,o-1),i++)}return 2*i/(e.length+t.length-2*(n-1))}const Oe=function(){const e=/[\u0300-\u036f]/g,t=/\u0142/g,n=/\u00F8/g;return function(s){return s.normalize("NFD").replace(e,"").replace(t,"l").replace(n,"o")}}();function De(...e){for(let t=0;t<e.length;t++){const n=e[t];try{return n()}catch(e){}}}function He(e){return e>Date.now()}function Ue(e,t,n,s,r=!1){return r?e<=s&&t>=n:e<s&&t>n}function Fe(e,t,n,s=!1){if(s){if(t<=e&&e<n)return 0}else if(t<=e&&e<=n)return 0;return e-t}function Be(e,t,n=!1){return Ue(e.start,e.end,t.start,t.end,n)?0:e.start-t.start}function Ge(e,t){return t.start<=e.start&&t.end>=e.end}function je(e,t){return e.filter((e=>t.some((t=>Ge(e,t)))))}async function We(e,t,n,s){if(t.signal)throw new Error("cannot fetchWithTimeout if 'signal' is already set");const r=s??new AbortController;t.signal=r.signal;const i=self.setTimeout((()=>{s?.signal.removeEventListener("abort",o),r.abort()}),n),o=()=>{clearTimeout(i)};return s?.signal.addEventListener("abort",o),await fetch(e,t).finally((()=>{clearTimeout(i)}))}async function $e(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map((e=>e.toString(16).padStart(2,"0"))).join("")}function ze(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(Number(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16)))}const Ve=e=>e.replace(/ /g," ").normalize(),Ke=e=>S(e).replace(/[\u00A0]/g," ").normalize(),Xe=()=>({text:"",originalText:"",usedParts:[{start:0,end:0,originalStart:0,originalEnd:0,posDiff:0,length:0,text:""}],ignoredParts:[]});function qe(e,t){return ne(e,t).filter((e=>e.oldText!==e.newText&&null!==e.newText)).map((e=>({text:e.newText,offset:e.newOffset,oldText:e.oldText,oldOffset:e.oldOffset})))}let Ye="claudia";async function Ze(){const e=function(){const e=(typeof s).indexOf("o")>-1;return Ye=e?s.MASCOT_NAME:Ye,("__"+Ye+"::"+~~(+new Date/1e3)).substring(2,64)}();return await $e(e)}const Je={RECOMMENDATION:"RECOMMENDATION",PHRASAL_RECOMMENDATION:"PHRASAL_RECOMMENDATION"},Qe=(e,t)=>{let n;for(let s=e.length-1;s>=0;s--)if(e[s].start<=t&&e[s].end>=t){n=e[s];break}return n}},
525"./init/config.ts":
526/*!************************!*\
527  !*** ./init/config.ts ***!
528  \************************/(e,t,n)=>{"use strict";var s;n.r(t),n.d(t,{ConfigKey:()=>s,ExtnConfig:()=>i,default:()=>o}),function(e){e.CHROME_EXTENSION_ID="CHROME_EXTENSION_ID",e.SHOW_PARTIAL_RECO_UNDERLINE="SHOW_PARTIAL_RECO_UNDERLINE",e.EXTN_PREFIX="EVENT_PREFIX",e.COLORS_GRAMMAR="COLORS_GRAMMAR",e.CARD_LAYOUT="CARD_LAYOUT",e.COLORS_SPELLING="COLORS_SPELLING",e.COLORS_STYLE="COLORS_LONG_SENTENCE",e.SUPPORTED_LANGUAGES="SUPPORTED_LANGUAGES",e.INSTALLED_ATTRIBUTE="INSTALLED_ATTRIBUTE",e.SITE_INIT_ATTRIBUTE="SITE_INIT_ATTRIBUTE",e.INPUT_AREA_INIT_ATTRIBUTE="INPUT_AREA_INIT_ATTRIBUTE",e.TMP_ID_ATTRIBUTE="TMP_ID_ATTRIBUTE",e.AI_RULE_ID_REGEX="AI_RULE_ID_REGEX",e.COLORS_PARAPHRASE="COLORS_PARAPHRASE",e.COLORS_RECOMMENDATION="COLORS_RECOMMENDATION",e.COLORS_RECOMMENDATION_TEASE="COLORS_RECOMMENDATION_TEASE",e.VALID_START_SENTENCE_REGEX="VALID_START_SENTENCE_REGEX",e.VALID_END_SENTENCE_REGEX="VALID_END_SENTENCE_REGEX",e.MULTI_SENTENCE_SELECTION_FOR_PARAPHRASE_ALLOWED="MULTI_SENTENCE_SELECTION_FOR_PARAPHRASE_ALLOWED",e.MAX_TEXT_LENGTH_ALLOWED_FOR_PAGELESS="MAX_TEXT_LENGTH_ALLOWED_FOR_PAGELESS",e.MAX_TEXT_LENGTH_ALLOWED="MAX_TEXT_LENGTH_ALLOWED",e.SELECTED_UNDERLINE_THICKNESS="SELECTED_UNDERLINE_THICKNESS",e.BULLET_POINT_PARSING_PREFIX="BULLET_POINT_PARSING_PREFIX",e.TOOLBAR_SIZE="TOOLBAR_SIZE",e.FIX_ALL_CONFIG="FIX_ALL_CONFIG",e.IGNORE_EDITOR_WITH_ATTRIBUTES="IGNORE_EDITOR_WITH_ATTRIBUTES",e.SHOW_TOOLBAR_ON_EMPTY_INPUT_AREA="SHOW_TOOLBAR_ON_EMPTY_INPUT_AREA",e.MAIN_CONTENT_SCRIPT_FILENAME="MAIN_CONTENT_SCRIPT_FILENAME",e.SPECIAL_INTRODUCTORY_TEASER_ENABLED="SPECIAL_INTRODUCTORY_TEASER_ENABLED",e.TERMS_OF_SERVICE_MODAL_ENABLED="TERMS_OF_SERVICE_MODAL_ENABLED",e.LOLLIPOP_CONFIG="LOLLIPOP_CONFIG",e.KEYBOARD_SHORTCUT_ONLY_OPENS_TOOLBOX="KEYBOARD_SHORTCUT_ONLY_OPENS_TOOLBOX",e.NORMALIZE_SPACE="NORMALIZE_SPACE",e.USE_CSS_CUSTOM_HIGHLIGHTS="USE_CSS_CUSTOM_HIGHLIGHTS",e.STRIP_WRAPPING_QUOTES_FROM_SENTENCE="STRIP_WRAPPING_QUOTES_FROM_SENTENCE",e.GDOCS_MENU_BUTTONS="GDOCS_MENU_BUTTONS",e.SUPPORTS_TRIAL="SUPPORTS_TRIAL",e.DISABLE_WHEN_QB_EXTENSION_IS_PRESENT="DISABLE_WHEN_QB_EXTENSION_IS_PRESENT"}(s||(s={}));const r={[s.CHROME_EXTENSION_ID]:"oldceeleldhonbafppcapldpdifcinji",[s.NORMALIZE_SPACE]:!1,[s.SHOW_PARTIAL_RECO_UNDERLINE]:!1,[s.EXTN_PREFIX]:"lt",[s.COLORS_GRAMMAR]:{UNDERLINE:"#f2b24c",SELECTED_UNDERLINE:"#f2b24c",BACKGROUND:"rgba(242,179,77,0.3)",EMPHASIZE:"rgba(241,179,76,0.1)"},[s.COLORS_SPELLING]:{UNDERLINE:"#EB5757",SELECTED_UNDERLINE:"#EB5757",BACKGROUND:"rgba(235,88,88,0.2)",EMPHASIZE:"rgba(239,88,88,0.1)"},[s.COLORS_STYLE]:{UNDERLINE:"#8F7FFF",SELECTED_UNDERLINE:"#8F7FFF",BACKGROUND:"rgba(142,128,255,0.2)",EMPHASIZE:"rgba(138,128,255,0.2)",TITLE:"#5C4CFF"},[s.COLORS_PARAPHRASE]:{UNDERLINE:"#8F7FFF",BACKGROUND:"rgba(142,128,255,0.2)",EMPHASIZE:"rgba(138,128,255,0.2)",TITLE:"#5C4CFF"},[s.COLORS_RECOMMENDATION]:{UNDERLINE:"#80B3E2",SELECTED_UNDERLINE:"#0067C5",BACKGROUND:"rgba(0, 103, 199, 0.16)",EMPHASIZE:"rgba(0, 103, 199, 0.16)"},[s.COLORS_RECOMMENDATION_TEASE]:{UNDERLINE:"#CF9F0280",SELECTED_UNDERLINE:"#CF9F02",BACKGROUND:"rgba(242,181,24,0.16)",EMPHASIZE:"rgba(242,181,24,0.16)"},[s.SUPPORTED_LANGUAGES]:["ar","ast-es","be-by","br-fr","ca-es","ca-es-valencia","crh-ua","da-dk","de-at","de-ch","de-de","el-gr","en-au","en-ca","en-gb","en-nz","en-us","en-za","eo","es","fa","ga-ie","fr","gl-es","it","ja-jp","km-kh","nl","no","pl-pl","pt-ao","pt-br","pt-mz","pt-pt","ro-ro","ru-ru","sk-sk","sl-si","sv","ta-in","tl-ph","uk-ua","zh-cn"],[s.CARD_LAYOUT]:{TARGET_BOX_HORIZONTAL_MARGIN:0,TARGET_BOX_VERTICAL_MARGIN:5,HEADER_HEIGHT:36,FOOTER_HEIGHT:36,KEYBOARD_HINT_HEIGHT:60,MIN_HEIGHT_PARAPHRASE:200,MIN_HEIGHT_TOOLBOX:230,MAX_HEIGHT_TOOLBOX:368},[s.INSTALLED_ATTRIBUTE]:"data-lt-installed",[s.SITE_INIT_ATTRIBUTE]:"data-lt-site",[s.INPUT_AREA_INIT_ATTRIBUTE]:"data-lt-tweaks",[s.TMP_ID_ATTRIBUTE]:"data-lt-tmp-id",[s.AI_RULE_ID_REGEX]:/^(QB|AI)_/,[s.VALID_START_SENTENCE_REGEX]:"[^•]",[s.VALID_END_SENTENCE_REGEX]:".",[s.MULTI_SENTENCE_SELECTION_FOR_PARAPHRASE_ALLOWED]:!1,[s.MAX_TEXT_LENGTH_ALLOWED_FOR_PAGELESS]:15e3,[s.MAX_TEXT_LENGTH_ALLOWED]:1e4,[s.SELECTED_UNDERLINE_THICKNESS]:2,[s.BULLET_POINT_PARSING_PREFIX]:"• ",[s.TOOLBAR_SIZE]:{width:20,height:20},[s.FIX_ALL_CONFIG]:{FIX_GC_ERRORS:!0,FIX_RECOMMENDATIONS:!1,FIX_STYLE_ERRORS:!1}
528,[s.IGNORE_EDITOR_WITH_ATTRIBUTES]:["spellcheck"],[s.SHOW_TOOLBAR_ON_EMPTY_INPUT_AREA]:!1,[s.MAIN_CONTENT_SCRIPT_FILENAME]:"/content.js",[s.SPECIAL_INTRODUCTORY_TEASER_ENABLED]:!0,[s.TERMS_OF_SERVICE_MODAL_ENABLED]:!1,[s.LOLLIPOP_CONFIG]:{LOLLIPOP_THEME:"purple",LOLLIPOP_CSS_PATH:"/content/styles/lollipop.css",ONBOARDING_IMAGE_PATH:"/assets/images/toolbox/lollipop-onboarding-lt.webp",ONBOARDING_BORDER_RADIUS:"8px",LOLLIPOP_CIRCLE_IMAGE_PATH:"/assets/images/toolbox/lollipop-icon.svg",LOLLIPOP_CIRCLE_GDOCS_IMAGE_PATH:"/assets/images/toolbox/lollipop-icon-gdocs.svg",SUPPORTS_DARK_MODE:!0,ONBOARDING_LANDING_PAGE_URL:"https://languagetool.org/text-cursor",TOOLBOX_IFRAME_PATH:"/toolbox/toolbox.html",TOOLBOX_AVAILABLE_UI_LANGUAGES:["de","en","es","fr","nl","pt-br"],TRACKING_SAMPLING_RATE:100,DEEP_LINK_INTO_TOOLBOX:!1},[s.KEYBOARD_SHORTCUT_ONLY_OPENS_TOOLBOX]:!1,[s.STRIP_WRAPPING_QUOTES_FROM_SENTENCE]:!0,[s.USE_CSS_CUSTOM_HIGHLIGHTS]:!1,[s.GDOCS_MENU_BUTTONS]:!0,[s.SUPPORTS_TRIAL]:!0,[s.DISABLE_WHEN_QB_EXTENSION_IS_PRESENT]:!0};class i{constructor(){this.extnConfig=r}static getInstance(){return this.instance||self._qb_lt_config||(this.instance=new i,self._qb_lt_config=this.instance),this.instance||self._qb_lt_config}get(e){return this.extnConfig[e]}set(e,t){this.extnConfig[e]=t}setAll(e){this.extnConfig=e}getAll(){return this.extnConfig}}const o=i.getInstance()},
528"./lollipop/Lollipop.ts":
529/*!******************************!*\
530  !*** ./lollipop/Lollipop.ts ***!
531  \******************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>R});var s,r=n(/*! ../common/domMeasurement */"./common/domMeasurement.ts"),i=n(/*! ../common/utils */"./common/utils.ts"),o=n(/*! ../config/config */"./config/config.ts"),a=n(/*! ./adapter/ContentEditable */"./lollipop/adapter/ContentEditable.ts"),l=n(/*! ./adapter/FormElement */"./lollipop/adapter/FormElement.ts"),c=n(/*! ./adapter/GoogleDocs */"./lollipop/adapter/GoogleDocs.ts"),d=n(/*! ./adapter/GoogleSlides */"./lollipop/adapter/GoogleSlides.ts"),h=n(/*! ./util/EventBus */"./lollipop/util/EventBus.ts"),u=n(/*! ./util/detectOS */"./lollipop/util/detectOS.ts"),g=n(/*! ./util/looksLikeAPlaceholder */"./lollipop/util/looksLikeAPlaceholder.ts"),m=n(/*! ./util/supportsCSSAnchorPositioning */"./lollipop/util/supportsCSSAnchorPositioning.ts");const p="data-lpop-blinking",_="data-lpop-pulsating",E="data-lpop-hoverable",f="data-lpop-hovered",T="data-lpop-mousedown",C="data-lpop-clicked",v="data-lpop-size",S="data-lpop-circle-position",b="data-lpop-extended-selection",x="data-lpop-animation-disabled",y="--lpop-original-caret-color",A=(0,u.default)(),k="Mac"===A?"metaKey":"ctrlKey";class w extends h.EventBus{constructor(e,t){if(super(),this.positionInterval=null,this.selectionType="unknown",this.currentPosition={left:0,top:0,height:20,width:1},this.clipPath=[0,0,0,0],this.isEnabled=!0,this.isVisible=!1,this.isDestroyed=!1,this.isBlinking=!1,this.isPulsating=!1,this.isDilated=!1,this.isClicked=!1,this.hasTextFieldFocus=!1,this.isExtendedSelection=!1,this.isMouseDownOutsideOfLollipop=!1,this.isCursorDragging=!1,this.isMouseOverLollipop=!1,this.isSuppressedProximityHandler=!1,this.isHoverEnabled=!1,this.circlePosition="bottom",this.caretColor="#000000",this.devicePixelRatio=self.devicePixelRatio,this.isForceSuppressDilateOnSystemEvents=!1,this.eventListeners=[],this.isTyping=!1,this.pressedSelectionModifierKeys=new Set,this.currentMouseMoveListener=null,this.currentMouseUpListener=null,this.additionalStylesElement=null,this.updatePositionInterval=()=>{(Math.random()<.5||this.devicePixelRatio!==self.devicePixelRatio)&&(this.devicePixelRatio=self.devicePixelRatio,this.position(!1,!1))},this.onDocumentMouseDown=e=>{e.target instanceof Element&&this.lollipopContainer.contains(e.target)||(this.resetDilate(),this.unfreezeClickState(!0),this.isMouseDownOutsideOfLollipop=!0,this.disableProximityHandler())},this.onDocumentMouseMove=e=>{e.target instanceof Element&&(this.lollipopContainer.contains(e.target)||(this.isMouseDownOutsideOfLollipop&&(this.isCursorDragging=!0),this.mouseClientCoords={x:e.clientX,y:e.clientY},this.handleMouseProximityToLollipop()))},this.onDocumentMouseUp=e=>{this.isMouseDownOutsideOfLollipop=!1,this.enableProximityHandler();let t=null;this.isCursorDragging&&(this.isCursorDragging=!1,t="drag"),2===e.detail&&(t="dblclick"),3===e.detail&&(t="trplclick"),t&&this.checkAndTriggerSelectionEnd(t)},this.onContextMenu=()=>{this.isMouseDownOutsideOfLollipop=!1,this.isDilated||this.disableProximityHandler()},this.onDocumentClick=e=>{e.detail>1&&this.disableHoverForAShortMoment()},this.onMouseEnter=()=>{if(this.isMouseOverLollipop||!this.isHoverEnabled)return;this.isMouseOverLollipop=!0,this.enableProximityHandler();let e="collapsed";this.isPulsating?e="pulsating":this.isDilated?e="dilated":this.isClicked&&(e="clicked"),this.dilate("mouse_enter"),this.showTooltip(),this.fire("mouseenter",{lollipopStateBeforeMouseEnter:e})},this.onMouseLeave=()=>{this.isMouseOverLollipop&&(this.isMouseOverLollipop=!1,this.lollipopContainer.removeAttribute(T),this.scheduleShrinkIfNeeded(),this.hideTooltip(),this.fire("mouseleave"))},this.onMouseDown=e=>{e.stopImmediatePropagation(),e.preventDefault(),this.lollipopContainer.setAttribute(T,"")},this.onClick=e=>{this.lollipopContainer.removeAttribute(T),e.preventDefault(),e.stopPropagation(),this.click(e),this.isPulsating&&this.stopPulsating()},this.onSelectionChange=()=>{this.position()},this.onMutation=()=>{this.position(this.isTyping,this.isTyping)},this.onWindowResize=()=>{this.position(!1,!1)},this.onVisibilityChange=()=>{"visible"===document.visibilityState&&this.position(!1,!1)},this.onFocus=()=>{this.hasTextFieldFocus=!0,this.enableHover(),this.position()},this.onBlur=()=>{this.hasTextFieldFocus=!1,this.resetDilate(),this.hide(),this.pressedSelectionModifierKeys.clear(),self.clearTimeout(this.selectionEndCheckTimeout),this.selectionEndCheckTimeout=void 0},this.onKeyDown=e=>
531{o.SELECTION_MODIFIER_KEYS.includes(e.key)&&this.pressedSelectionModifierKeys.add(e.key),e[k]&&"a"===e.key?this.setSelectionType("all"):e[k]&&"ArrowRight"===e.key?this.setSelectionType("end-of-line"):e[k]&&"ArrowLeft"===e.key?this.setSelectionType("beginning-of-line"):this.setSelectionType("unknown")},this.onKeyUp=e=>{o.SELECTION_MODIFIER_KEYS.includes(e.key)&&this.pressedSelectionModifierKeys.delete(e.key),this.isVisible&&this.isEnabled&&e.isTrusted&&this.checkAndTriggerSelectionEnd("keyboard")},this.onScroll=e=>{this.position(!1,!0)},this.onResize=e=>{this.position(!1,!0)},this.onTyping=e=>{this.isTyping=!0,this.resetDilate(),this.stopPulsating(),self.clearTimeout(this.isTypingTimeout),this.isTypingTimeout=self.setTimeout((()=>{this.isTyping=!1}),200)},this.onDoubleClick=()=>{this.setSelectionType("word")},this.onTripleClick=()=>{this.setSelectionType("paragraph")},e.classList.contains("whenContentEditable")&&location.hostname.includes("notion.so")&&(e=e.closest(".notion-frame")||e),s.textFieldElements.includes(e))throw new Error("Lollipop is already attached to this element!");this.textFieldElement=e,this.options=t,this.dilateProximityThreshold=t.dilateProximityThreshold??10,this.domMeasurement=new r.DomMeasurement(this.textFieldElement.ownerDocument),this.adapter=this.getAdapter(),this.adapter.on("focus",this.onFocus),this.adapter.on("blur",this.onBlur),this.adapter.on("dblclick",this.onDoubleClick),this.adapter.on("trplclick",this.onTripleClick),this.adapter.on("selectionchange",this.onSelectionChange),this.adapter.on("mutation",this.onMutation),this.adapter.on("keydown",this.onKeyDown),this.adapter.on("keyup",this.onKeyUp),this.adapter.on("scroll",this.onScroll),this.adapter.on("resize",this.onResize),this.adapter.on("typing",this.onTyping),s.textFieldElements.push(e),this.scrollObserver=(0,i.observeScrollableAncestors)(this.textFieldElement,(()=>{this.position(!1,!1)}),this.domMeasurement),this.textFieldElement.ownerDocument.addEventListener("visibilitychange",this.onVisibilityChange,!0),this.textFieldElement.ownerDocument.addEventListener("mousedown",this.onDocumentMouseDown,!0),this.textFieldElement.ownerDocument.addEventListener("mousemove",this.onDocumentMouseMove,!0),this.textFieldElement.ownerDocument.addEventListener("mouseup",this.onDocumentMouseUp,!0),this.textFieldElement.ownerDocument.addEventListener("click",this.onDocumentClick,!0),this.textFieldElement.ownerDocument.addEventListener("contextmenu",this.onContextMenu,!0),this.textFieldElement.ownerDocument.defaultView.addEventListener("resize",this.onWindowResize,!0),this.root=t?.root?t?.root:this.getRootElement();const{container:n,circle:a,tooltip:l}=this.buildLollipop();this.lollipopContainer=n,this.lollipopCircle=a,this.lollipopTooltip=l,this.startPositioningInterval(),this.checkVisibility()}disable(){this.isEnabled&&(this.isEnabled=!1,this.hide(),this.fire("disable"))}setProximityThreshold(e=10){e<10&&(e=10),this.dilateProximityThreshold=e}setForceSuppressDilateOnSystemEvents(e=!0){this.isForceSuppressDilateOnSystemEvents=e}enable(){this.isEnabled||this.isDestroyed||(this.isEnabled=!0,this.position(),this.fire("enable"))}freezeClickState(){this.isClicked||(this.isClicked=!0,this.lollipopContainer.setAttribute(C,""))}unfreezeClickState(e=!1){this.isClicked&&(e&&this.disableAnimationForAShortMoment(),this.isClicked=!1,this.lollipopContainer.removeAttribute(C))}getPosition(){return this.domMeasurement.clearCache(),this.domMeasurement.getBorderBox(this.lollipopContainer)}getSelection(){return this.adapter.getSelection()}destroy(){if(this.isDestroyed)return;this.cleanupAdditionalStyles(),this.adapter.destroy(),this.textFieldElement.ownerDocument.removeEventListener("visibilitychange",this.onVisibilityChange,!0),this.textFieldElement.ownerDocument.removeEventListener("mousedown",this.onDocumentMouseDown,!0),this.textFieldElement.ownerDocument.removeEventListener("mousemove",this.onDocumentMouseMove,!0),this.textFieldElement.ownerDocument.removeEventListener("mouseup",this.onDocumentMouseUp,!0),this.textFieldElement.ownerDocument.removeEventListener("click",this.onDocumentClick,!0),this.textFieldElement.ownerDocument.removeEventListener("contextmenu",this.onContextMenu,!0),this.textFieldElement.ownerDocument.defaultView.removeEventListener("resize",this.onWindowResize,!0),this.eventListeners.forEac
531h((e=>e.destroy())),this.adapter.enableNativeCaret(),this.remove(),this.resetDocumentMouseListeners(),this.stopPositioningInterval(),self.clearTimeout(this.blinkingTimeout),self.clearTimeout(this.isTypingTimeout),self.clearTimeout(this.selectionTypeResetTimeout),self.clearTimeout(this.tooltipTimeout),self.clearTimeout(this.dilateTimeout),self.clearTimeout(this.shrinkTimeout),self.clearTimeout(this.selectionEndCheckTimeout),self.clearTimeout(this.disableHoverTimeout),self.clearTimeout(this.proximityDilateSuppressionTimeout),this.scrollObserver.destroy(),this.fire("destroy"),this.off();const e=s.textFieldElements.indexOf(this.textFieldElement);e>-1&&s.textFieldElements.splice(e,1),this.hasTextFieldFocus=!1,this.isEnabled=!1,this.isVisible=!1,this.isDestroyed=!0,this.mouseClientCoords=void 0}getAdapter(){if(l.default.matches(this.textFieldElement)){if(!this.options?.mirror)throw new Error("No mirror element given. It is required to support <textarea>");return new l.default(this.textFieldElement,this.options.mirror,this.domMeasurement)}if(a.default.matches(this.textFieldElement))return new a.default(this.textFieldElement,this.domMeasurement);if(c.default.matches(this.textFieldElement))return new c.default(this.textFieldElement,this.domMeasurement);if(d.default.matches(this.textFieldElement))return new d.default(this.textFieldElement,this.domMeasurement);throw new Error("No lollipop adapter matches")}getRootElement(){if("BODY"===this.textFieldElement.tagName)return document.documentElement;const e=this.textFieldElement.closest("[popover]");if(e)return e;try{const e=this.textFieldElement.closest("dialog[open]:modal");if(e)return e}catch(e){}return document.body}getSelectionRects(){this.domMeasurement.clearCache();let{top:e,left:t}=this.domMeasurement.getDocumentScroll();const{body:n}=this.lollipopContainer.ownerDocument;if(this.domMeasurement.contains(n,this.lollipopContainer)){const n=this.domMeasurement.getDocumentGap();e-=n.top,t-=n.left}return(this.adapter.getSelection()?.rects||[]).map((({top:n,left:s,width:r,height:i})=>{const o=n+e,a=s+t;return{top:o,left:a,right:a+r,bottom:o+i,width:r,height:i}}))}startPositioningInterval(){this.positionInterval&&self.clearInterval(this.positionInterval),this.positionInterval=self.setInterval(this.updatePositionInterval,200)}stopPositioningInterval(){this.positionInterval&&(self.clearInterval(this.positionInterval),this.positionInterval=null)}checkVisibility(){this.adapter.hasFocus()&&(this.hasTextFieldFocus=!0,this.enableHover(),this.position())}buildLollipop(){const e=this.textFieldElement.ownerDocument.createElement(s.CONTAINER_ELEMENT_NAME);e.addEventListener("mousedown",(e=>{e.stopImmediatePropagation(),e.preventDefault()})),e.setAttribute("data-lpop-os",A),e.setAttribute("contenteditable","false"),e.setAttribute("spellcheck","false"),e.setAttribute("data-lpop-adapter-name",this.adapter.getAdapterName());const t=this.textFieldElement.ownerDocument.createElement(`${s.NODE_NAME_PREFIX}circle`);t.addEventListener("mouseenter",this.onMouseEnter,!0),t.addEventListener("mouseleave",this.onMouseLeave,!0),t.addEventListener("mousedown",this.onMouseDown,!0),t.addEventListener("click",this.onClick,!0),this.eventListeners.push((0,i.addUseCaptureEvent)(t,"mousedown",this.onMouseDown),(0,i.addUseCaptureEvent)(t,"mouseup",(e=>{e.stopImmediatePropagation()})),(0,i.addUseCaptureEvent)(t,"pointerdown",(e=>{e.stopImmediatePropagation()})),(0,i.addUseCaptureEvent)(t,"pointerup",(e=>{e.stopImmediatePropagation()}))),this.setTheme(e,this.options?.theme||"purple"),e.setAttribute(S,this.circlePosition),e.style.setProperty(y,this.caretColor),e.style.setProperty("--lpop-circle-image",`url(${this.options?.brandIcon})`),e.style.setProperty("--lpop-circle-image-gdocs",`url(${this.options?.brandIconGdocs})`),e.append(t);const n=this.buildTooltipElement();return n&&e.append(n),this.insertAdditionalStyles(),{container:e,circle:t,tooltip:n}}insertAdditionalStyles(){if(this.additionalStylesElement)return;const e=this.adapter.getAdditionalStyles();if(!e||!e.trim())return;const t=this.textFieldElement.ownerDocument;this.additionalStylesElement=t.createElement("style"),this.additionalStylesElement.textContent=e,t.head.append(this.additionalStylesElement)}cleanupAdditionalStyles(){this.additionalStylesElement&&(this.additionalStylesElement.remove(),this.additionalStylesElement=null)}setTheme(e,t){e.setAttribute("data-lpop-theme",t);const n="green"===t?"#178733":"#5c4cff",s="green"===t?"#0C6124":"#3729c1";e.style.setProperty("--lpop-theme-color",n),e.style.setProperty("--lpop-theme-color-dark",s)}buildTooltipElement(){if(!this.options?.tooltip||!(0,m.default)())return null;const e=this.textFieldElement.ownerDocument.createElement(s.TOOLTIP_ELEMENT_NAME);return e.setAttribute("popover","manual"),e.innerHTML=this.options.tooltip,e}handleMouseProximityToLollipop(){if(this.isSuppressedProximityHandler||this.isPulsating||this.isClicked||!this.mouseClientCoords)return;const{x:e,y:t}=this.mouseClientCoords,n=this.currentPosition.left+this.currentPosition.width/2;let s;s="top"===this.circlePosition?this.currentPosition.top:this.currentPosition.top+this.currentPosition.height;let r=!1;r="bottom"===this.circlePosition?t<=s+10:t>=s-10,r&&Math.sqrt(Math.pow(e-n,2)+Math.pow(t-s,2))<=this.dilateProximityThreshold?this.scheduleDilateIfNeeded("proximity"):this.resetDilate()}dilate(e,t=!1){this.cancelScheduledDilate(),this.cancelScheduledResetDilate(),this.isPulsating||this.isClicked||this.isForceSuppressDilateO
531nSystemEvents&&!["mouse_enter","proximity"].includes(e)||(t&&this.disableProximityHandler(),this.isDilated||(this.stopBlinking(),this.enableHover(),this.isDilated=!0,this.lollipopContainer.setAttribute(f,""),this.fire("dilate",{dilateReason:e})))}resetDilate(){this.cancelScheduledDilate(),this.cancelScheduledResetDilate(),this.enableProximityHandler(),this.isDilated&&(this.isDilated=!1,this.lollipopContainer.removeAttribute(f),this.startBlinking())}scheduleDilateIfNeeded(e,t,n=200){this.cancelScheduledResetDilate(),this.dilateTimeout||this.isDilated||(this.dilateTimeout=self.setTimeout((()=>{this.dilateTimeout=void 0,"proximity"===e&&this.isSuppressedProximityHandler||this.dilate(e,t)}),n))}scheduleShrinkIfNeeded(){this.cancelScheduledDilate(),!this.shrinkTimeout&&this.isDilated&&(this.shrinkTimeout=self.setTimeout((()=>{this.resetDilate(),this.shrinkTimeout=void 0}),200))}cancelScheduledResetDilate(){self.clearTimeout(this.shrinkTimeout),this.shrinkTimeout=void 0}cancelScheduledDilate(){self.clearTimeout(this.dilateTimeout),this.dilateTimeout=void 0}showTooltip(){!this.isClicked&&this.lollipopTooltip&&(this.tooltipTimeout=self.setTimeout((()=>{try{this.lollipopTooltip.showPopover()}catch(e){}}),1e3))}hideTooltip(){this.lollipopTooltip&&(self.clearTimeout(this.tooltipTimeout),this.lollipopTooltip.hidePopover())}click(e){this.fire("click",{event:e})}setSelectionType(e){this.selectionType=e,self.clearTimeout(this.selectionTypeResetTimeout),this.selectionTypeResetTimeout=self.setTimeout((()=>{this.selectionType="unknown"}),100)}setCirclePosition(e){e!==this.circlePosition&&(this.lollipopContainer.setAttribute(S,e),this.circlePosition=e,this.disableAnimationForAShortMoment())}show(){!this.isEnabled||this.isDestroyed||this.isVisible||(this.isVisible=!0,this.adapter.disableNativeCaret(),this.insert(),this.fire("show"))}hide(){this.isVisible&&(this.isVisible=!1,this.adapter.enableNativeCaret(),this.remove(),this.fire("hide"))}insert(){this.textFieldElement.parentElement&&(!this.root||this.root.contains(this.lollipopContainer)&&"before"!==(0,i.getPosition)(this.lollipopContainer,this.textFieldElement)||this.root.children[this.root.children.length-1]===this.lollipopContainer||this.root.appendChild(this.lollipopContainer))}remove(){this.lollipopContainer.remove()}setCaretColor(e){this.caretColor!==e&&(this.lollipopContainer.style.setProperty(y,e),this.caretColor=e)}stopBlinking(){self.clearTimeout(this.blinkingTimeout),this.isBlinking&&(this.lollipopContainer.removeAttribute(p),this.isBlinking=!1)}startPulsating(){this.isPulsating||(this.isPulsating=!0,this.lollipopContainer.setAttribute(_,""),this.resetDilate())}stopPulsating(){this.isPulsating&&(this.disableAnimationForAShortMoment(),this.lollipopContainer.removeAttribute(_),this.isPulsating=!1)}startBlinking(){this.isBlinking||(this.lollipopContainer.setAttribute(p,""),this.isBlinking=!0)}restartBlinking(){this.stopBlinking(),this.blinkingTimeout=self.setTimeout((()=>this.startBlinking()),50)}disableHover(){this.isHoverEnabled&&(this.lollipopContainer.removeAttribute(E),this.isHoverEnabled=!1)}enableHover(){this.isHoverEnabled||(this.lollipopContainer.setAttribute(E,""),this.isHoverEnabled=!0)}disableHoverUntilMouseHasMoved(){self.clearTimeout(this.disableHoverTimeout),this.disableHover(),this.resetDocumentMouseListeners();let e=0;this.currentMouseMoveListener=t=>{e+=Math.abs(t.movementX)||Math.abs(t.movementY),e>4&&(this.resetDocumentMouseListeners(),this.enableHover())},this.textFieldElement.ownerDocument.addEventListener("mousemove",this.currentMouseMoveListener,!0)}disableHoverUntilMouseHasBeenReleased(){self.clearTimeout(this.disableHoverTimeout),this.disableHover(),this.resetDocumentMouseListeners(),this.currentMouseUpListener=e=>{this.resetDocumentMouseListeners(),this.enableHover()},this.textFieldElement.ownerDocument.addEventListener("mouseup",this.currentMouseUpListener,{capture:!0,once:!0}),this.textFieldElement.ownerDocument.addEventListener("contextmenu",this.currentMouseUpListener,{capture:!0,once:!0})}disableHoverForAShortMoment(){this.disableHover(),self.clearTimeout(this.disableHoverTimeout),this.disableHoverTimeout=self.setTimeout((()=>this.enableHover()),400)}disableProximityHandler(){this.isSuppressedProximityHandler=!0,self.clearTimeout(this.proximityDilateSuppressionTimeout),this.cancelScheduledDilate(),this.cancelScheduledResetDilate()}enableProximityHandler(e){this.isSuppressedProximityHandler=!1,self.clearTimeout(this.proximityDilateSuppressionTimeout),e&&this.handleMouseProximityToLollipop()}disableProximityHandlerForAShortMoment(e){this.disableProximityHandler(),this.proximityDilateSuppressionTimeout=self.setTimeout((()=>{this.enableProximityHandler(e)}),400)}disableAnimation(){this.lollipopContainer.setAttribute(x,"")}
531enableAnimation(){this.lollipopContainer.removeAttribute(x)}disableAnimationForAShortMoment(){this.disableAnimation(),self.clearTimeout(this.disableAnimationTimeout),this.disableAnimationTimeout=self.setTimeout((()=>this.enableAnimation()),400)}enableExtendedSelection(){this.isExtendedSelection||(this.lollipopContainer.setAttribute(b,""),this.isExtendedSelection=!0)}disableExtendedSelection(){this.isExtendedSelection&&(this.lollipopContainer.removeAttribute(b),this.isExtendedSelection=!1)}resetDocumentMouseListeners(){this.currentMouseMoveListener&&(this.textFieldElement.ownerDocument.removeEventListener("mousemove",this.currentMouseMoveListener,!0),this.currentMouseMoveListener=null),this.currentMouseUpListener&&(this.textFieldElement.ownerDocument.removeEventListener("mouseup",this.currentMouseUpListener,!0),this.textFieldElement.ownerDocument.removeEventListener("contextmenu",this.currentMouseUpListener,!0),this.currentMouseUpListener=null)}position(e=!0,t=!0){if(!this.isEnabled)return!1;if(!this.hasTextFieldFocus)return this.hide(),!1;const n=this.adapter.getSelection();return n&&n.rects.length?(this.domMeasurement.clearCache(),n.isCollapsed?this.positionForCollapsedSelection(n,e,t):this.positionForExtendedSelection(n),this.currentPosition.height>200||this.isOverlappedByOutsideElement()?(this.hide(),!1):(this.show(),this.clip(),!0)):(this.hide(),!1)}move(e,t,n,s){const r=n,i=s,o=e,a=t,l=this.currentPosition.left!==o||this.currentPosition.top!==a||this.currentPosition.height!==r||this.currentPosition.width!==i;return!!l&&(this.currentPosition={left:o,top:a,height:r,width:i},this.domMeasurement.setStyles(this.lollipopContainer,{left:o+"px",top:a+"px",height:r+"px"},!0),this.fire("move"),l)}positionForCollapsedSelection(e,t=!0,n=!0){this.disableExtendedSelection();const s=e.rects[0],r=this.move(s.left,s.top,s.height,s.width);r&&!0===t&&this.restartBlinking(),this.setCaretColor(e.caretColor||""),this.setCirclePosition("bottom"),this.adjustCircleSize(s.height),r||this.isTyping||(n=!1),n&&this.disableHoverUntilMouseHasMoved()}positionForExtendedSelection(e){const t=e.rects[0],n=e.rects[e.rects.length-1];let s=n,r=s.right,i=s.top,o="bottom";const a=this.lollipopContainer.ownerDocument.defaultView.innerHeight,l=this.lollipopContainer.ownerDocument.defaultView.innerWidth,c=t.top+3<0||t.left+3<0||t.right-3>l,d=n.bottom-3>a||n.right-3>l||n.left+3<0,h=this.domMeasurement.getBoundingClientRect(this.textFieldElement),u=t.top+3<h.top,g=n.bottom-3>h.bottom;!c&&!u||d||g?!d&&!g||c||u?"left"===e.direction&&(s=t,r=s.left,i=s.top,o="top"):(s=t,r=s.left,i=s.top,o="top"):(s=n,r=s.right,i=s.top,o="bottom"),this.move(r,i,s.height,0),this.setCirclePosition(o),this.adjustCircleSize(s.height),this.enableExtendedSelection(),this.isMouseDownOutsideOfLollipop&&this.disableHoverUntilMouseHasBeenReleased()}adjustCircleSize(e){e>=20?this.lollipopContainer.setAttribute(v,"large"):e<=12?this.lollipopContainer.setAttribute(v,"small"):this.lollipopContainer.removeAttribute(v)}isOverlappedByOutsideElement(){let e=Math.round(this.currentPosition.left+this.currentPosition.width/2);const t=Math.round(this.currentPosition.top+this.currentPosition.height/2),n=this.domMeasurement.getBoundingClientRect(this.textFieldElement),s=Math.abs(e-n.left)<2,r=Math.abs(e-n.right)<2;s?e+=1:r&&(e-=1);const i=this.textFieldElement.ownerDocument.elementFromPoint(e,t);return!!i&&(!this.adapter.shouldAllowOverlapBy(i)&&!this.textFieldElement.contains(i)&&!(0,g.default)(i,this.textFieldElement,this.domMeasurement))}clip(){if(this.adapter.isContentOverflowing())return void this.setClipPath([0,0,0,0]);const e=this.domMeasurement.getBoundingClientRect(this.lollipopContainer),t=this.adapter.getPaddingRect();let n=0,s=0,r=0,i=0;const o=e.bottom-e.top,a=e.right-e.left,l=e.top-t.top;l<0&&this.adapter.getScrollState().top>=2&&(n=Math.min(Math.abs(l),o));const c=t.right-e.right;c<0&&this.adapter.getScrollState().right>=2&&(s=Math.min(Math.abs(c),a));const d=t.bottom-e.bottom;d<0&&this.adapter.getScrollState().bottom>=2&&(r=Math.min(Math.abs(d),o));const h=e.left-t.left;h<0&&this.adapter.getScrollState().left>=2&&(i=Math.min(Math.abs(h),a)),this.setClipPath([n,s,r,i])}setClipPath(e){const t=e.join(",");if(t===this.clipPath?.join(","))return;this.clipPath=e;let n="";"0,0,0,0"!==t&&(n=`inset(${e.map((e=>(Math.round(e)||-20)+"px")).join(" ")})`),this.domMeasurement.setStyles(this.lollipopContainer,{"clip-path":n},!0)}
531checkAndTriggerSelectionEnd(e){self.clearTimeout(this.selectionEndCheckTimeout),this.pressedSelectionModifierKeys.size||(this.selectionEndCheckTimeout=self.setTimeout((()=>{const t=this.getSelection();t&&!t.isCollapsed&&this.onSelectionEnd(t,e),this.selectionEndCheckTimeout=void 0}),50))}onSelectionEnd(e,t){if(this.options?.shouldDilateOnSelection&&"dblclick"!==t||this.options?.shouldDilateOnSelectionWithDoubleClick&&"dblclick"===t){const e="text_selection-"+("keyboard"===t?"keyboard":"mouse");this.dilate(e,!0)}this.fire("selectionend",{selection:e,trigger:t})}static supports(e){return a.default.matches(e)||l.default.matches(e)||c.default.matches(e)||d.default.matches(e)}}s=w,w.NODE_NAME_PREFIX="lpop-",w.CONTAINER_ELEMENT_NAME=`${s.NODE_NAME_PREFIX}container`,w.TOOLTIP_ELEMENT_NAME=`${s.NODE_NAME_PREFIX}tooltip`,w.textFieldElements=[];const R=w},
531"./lollipop/adapter/ContentEditable.ts":
532/*!*********************************************!*\
533  !*** ./lollipop/adapter/ContentEditable.ts ***!
534  \*********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>b});var s=n(/*! ../../common/editors/selectionManager */"./common/editors/selectionManager.ts"),r=n(/*! ../Lollipop */"./lollipop/Lollipop.ts"),i=n(/*! ../util/EventBus */"./lollipop/util/EventBus.ts"),o=n(/*! ../util/getSelectionDirection */"./lollipop/util/getSelectionDirection.ts"),a=n(/*! ../util/isElementNode */"./lollipop/util/isElementNode.ts"),l=n(/*! ../util/isFirstChild */"./lollipop/util/isFirstChild.ts"),c=n(/*! ../util/isSelectionCollapsed */"./lollipop/util/isSelectionCollapsed.ts"),d=n(/*! ../util/isTextNode */"./lollipop/util/isTextNode.ts"),h=n(/*! ../util/detectOS */"./lollipop/util/detectOS.ts"),u=n(/*! ../util/getDistanceBetweenTwoCoordinates */"./lollipop/util/getDistanceBetweenTwoCoordinates.ts"),g=n(/*! ../../common/utils */"./common/utils.ts"),m=n(/*! ../util/getClientRects */"./lollipop/util/getClientRects.ts"),p=n(/*! ../util/isWindow */"./lollipop/util/isWindow.ts"),_=n(/*! ../util/trimSimpleWhiteSpaceAtEnd */"./lollipop/util/trimSimpleWhiteSpaceAtEnd.ts"),E=n(/*! ../../common/mutationObservers/filteringMutationObserver */"./common/mutationObservers/filteringMutationObserver.ts");const f=new Map,T=["Control","Shift","Alt","Meta","CapsLock","Escape"],C="data-lpop-hide-native-caret",v="Mac"===(0,h.default)();class S extends i.EventBus{constructor(e,t){super(),this.ifSelectionChangesCallbacks=[],this.lastSelectionEvent=null,this.onSelectionChange=()=>{this.fireSelectionChangeCallbacks(),this.fire("selectionchange")},this.onScroll=()=>{this.fire("scroll")},this.onResize=()=>{this.fire("resize")},this.onClick=e=>{3===e.detail?this.fire("trplclick"):2===e.detail&&this.fire("dblclick")},this.onMousedown=e=>{this.ifSelectionChanges((()=>{this.setLastSelectionEvent(e)})),this.fire("mousedown")},this.onKeydown=e=>{this.ifSelectionChanges((()=>{this.setLastSelectionEvent(e)})),this.fire("keydown",e),T.includes(e.key)||this.fire("typing")},this.onKeyup=e=>{this.fire("keyup",e)},this.onFocus=e=>{const t=this.textFieldElement.ownerDocument.defaultView;e.target instanceof t.Element&&(this.textFieldElement===e.target||this.textFieldElement.contains(e.target))&&this.fire("focus",e)},this.onBlur=e=>{const t=this.textFieldElement.ownerDocument.defaultView;e.target instanceof t.Element&&(this.textFieldElement===e.target||this.textFieldElement.contains(e.target))&&this.fire("blur",e)},this.onMutation=e=>{this.fire("mutation")},this.isIgnoredMutation=e=>{if(this.isIgnoredAttributeMutation(e))return!0;if("childList"===e.type){const t=Array.from(e.removedNodes).filter((e=>!e.nodeName.toLowerCase().startsWith(r.default.NODE_NAME_PREFIX))),n=Array.from(e.addedNodes).filter((e=>!e.nodeName.toLowerCase().startsWith(r.default.NODE_NAME_PREFIX)));if(!t.length&&!n.length)return!1}return!1},this.textFieldElement=e,this.domMeasurement=t,this.editorType=S.getEditorType(e),this.observe()}hasFocus(){return this.textFieldElement.isContentEditable?this.textFieldElement.matches(":focus"):Boolean(this.textFieldElement.querySelector(":focus"))}destroy(){this.enableNativeCaret(),this.off(),this.unobserve()}clearCache(){this.domMeasurement.clearCache()}getPaddingRect(){return this.domMeasurement.getPaddingBox(this.textFieldElement,!1,!1)}getScrollState(){const e=this.domMeasurement.getScrollDimensions(this.textFieldElement,!1),t=this.domMeasurement.getScrollPosition(this.textFieldElement,!1,!1),n=this.domMeasurement.getPaddingBox(this.textFieldElement,!1,!1);return{top:t.top,right:Math.max(e.width-(t.left+n.border.left+n.width),0),bottom:Math.max(e.height-(t.top+n.border.top+n.height),0),left:t.left}}getCaretHeightForFont(e,t){const n=e+":"+t;let s=f.get(n);if(!s){const i=this.textFieldElement.ownerDocument,o=i.createElement(`${r.default.NODE_NAME_PREFIX}div`);o.style.display="block",o.style.position="absolute",o.style.left="-999px",o.style.top="-999px",o.style.lineHeight="100px";const a=i.createElement(`${r.default.NODE_NAME_PREFIX}span`);a.textContent="A",a.style.display="inline",a.style.fontSize=String(e)+"px",a.style.fontFamily=t,o.append(a),i.body.append(o),s=a.getBoundingClientRect().height,o.remove(),f.set(n,s)}return s}getSelection(){const e=this.textFieldElement.ownerDocument,t=e.defaultView?.getSelection();if(!t||0===t.rangeCount)return null;const n=t.getRangeAt(0);if(!this.isRangeInTextField(n))return null;if(!this.isRangeInEditableText(n))return null;if(!this.isRangeInSupportedElement(n))return null;if("\n"===t.toString())return null;const s=(0,c.default)(t);let r=(0,m.default)(n);if(r=s?this.selectRectForCollapsedRange(r,n.startContainer,n.startOffset):this.adjustRectsForExtendedRange(r,n),!r.length)if(s&&0===n.startOffset&&0===n.endOffset&&n.startContainer===n.endContainer&&(0,a.default)(n.startContainer))r=this.guessRects(n.startContainer);else if(s&&0===n.startOffset&&0===n.endOffset&&n.startContainer.parentElement&&(0,d.default)(n.startContainer)&&(0,l.default)(n.startContainer))r=this.guessRects(n.startContainer.parentElement);else if(s&&n.startContainer===n.endContainer&&(0,a.default)(n.startContainer)&&n.startOffset===n.endOffset&&n.startOffset>0){const e=n.startContainer.childNodes,t=e[n.startOffset];if(t&&(0,a.default)(t)){const e=t.getClientRects()[0];r=!e||e.height<=1?[]:[{top:e.top,right:e.left,bottom:e.bottom,left:e.left,width:0,height:e.height}]}else if(t&&(0,d.default)(t)){const e=new Range;e.setStart(t,0),e.setEnd(t,0),r=(0,m.default)(e)}
534else if(!t){const t=e[n.startOffset-1];if(t&&(0,d.default)(t)){const e=new Range;e.setStart(t,(t.nodeValue||"").length),e.setEnd(t,(t.nodeValue||"").length),r=(0,m.default)(e)}else if(t&&(0,a.default)(t)){const e=t.getClientRects()[0];r=!e||e.height<=1?[]:[{top:e.top,right:e.right,bottom:e.bottom,left:e.right,width:0,height:e.height}]}}}else if(s&&n.startContainer===n.endContainer&&(0,d.default)(n.startContainer)&&n.startOffset===n.endOffset&&n.startOffset===n.startContainer.length&&n.startContainer.parentElement&&n.startContainer.parentElement.nextSibling){let e=null;if((0,d.default)(n.startContainer.parentElement.nextSibling)?e=n.startContainer.parentElement.nextSibling:n.startContainer.parentElement.nextSibling.firstChild&&(0,d.default)(n.startContainer.parentElement.nextSibling.firstChild)&&(e=n.startContainer.parentElement.nextSibling.firstChild),e){const t=new Range;t.setStart(e,0),t.setEnd(e,0),r=(0,m.default)(t)}}let i=null;return s&&n.startContainer&&(i=this.getCaretColor(n.startContainer)),{isCollapsed:s,direction:(0,o.default)(t),rects:r,caretColor:i}}selectRectForCollapsedRange(e,t,n){if(e.length<2&&n>0&&"keydown"===this.lastSelectionEvent?.type&&"line_end"===this.lastSelectionEvent.direction&&(0,d.default)(t)&&n<(0,_.default)(t.nodeValue||"").length&&this.isWhiteSpaceNormal(t)){const s=this.textFieldElement.ownerDocument.createRange();s.setStart(t,n-1),s.setEnd(t,n-1),s.collapse();const r=(0,m.default)(s);return 1===r.length&&s.collapsed?r:e}if(2!==e.length)return e;const s=e[0],r=e[e.length-1];if("keydown"===this.lastSelectionEvent?.type){if("line_end"===this.lastSelectionEvent.direction)return[s];if("line_start"===this.lastSelectionEvent.direction)return[r];if("right"===this.lastSelectionEvent.direction)return[r];if("left"===this.lastSelectionEvent.direction)return[r];if(["down","up"].includes(this.lastSelectionEvent.direction)&&this.lastSelectionEvent.previousSelection?.rects?.length){const e=this.lastSelectionEvent.previousSelection.rects[0];return[this.getClosestRect(s,r,e.left,e.top)]}}else if("mousedown"===this.lastSelectionEvent?.type)return[this.getClosestRect(s,r,this.lastSelectionEvent.left,this.lastSelectionEvent.top)];return[e[1]]}adjustRectsForExtendedRange(e,t){if(!e.length)return[];let n=e.filter((e=>e.width>0));n.length||(n=e);const s=n[0],r=this.getElementForNode(t.startContainer);if(r){const e=parseFloat(this.domMeasurement.getStyle(r,"line-height"));if(e>s.height){const t=e-s.height;s.top-=t/2,s.bottom+=t/2,s.height=e}}if(1===e.length)return n;const i=e[e.length-1],o=this.getElementForNode(t.endContainer);if(o){const e=parseFloat(this.domMeasurement.getStyle(o,"line-height"));if(e>i.height){const t=e-i.height;i.top-=t/2,i.bottom+=t/2,i.height=e}}return n}getClosestRect(e,t,n,s){return(0,u.default)(e.left,e.top+e.height/2,n,s)<(0,u.default)(t.left,t.top+t.height/2,n,s)?e:t}getElementForAttributeSetting(){return"CKEditor5"===this.editorType&&this.textFieldElement.parentElement?this.textFieldElement.parentElement:this.textFieldElement}disableNativeCaret(){this.getElementForAttributeSetting().setAttribute(C,"")}enableNativeCaret(){this.getElementForAttributeSetting().removeAttribute(C)}getAdapterName(){return"contenteditable"}isContentOverflowing(){return this.textFieldElement!==this.textFieldElement.ownerDocument.body&&(this.textFieldElement.scrollHeight>this.textFieldElement.clientHeight||this.textFieldElement.scrollWidth>this.textFieldElement.clientWidth)&&this.isOverflowVisible()}isRangeInTextField(e){return this.textFieldElement===e.startContainer||this.textFieldElement.contains(e.startContainer)}isRangeInEditableText(e){const t=this.textFieldElement.ownerDocument;if(!t.activeElement||!t.activeElement.isContentEditable)return!1;const n=this.getElementForNode(e.startContainer);if(!n)return!1;if(!this.textFieldElement.contains(n))return!1;const s=n.closest("[contenteditable]");return!(s&&!s.isContentEditable)}isRangeInSupportedElement(e){const t=this.getElementForNode(e.startContainer);if("ProseMirror"===this.editorType){if(t?.closest(".cm-editor"))return!1;if(t?.closest(".ProseMirror-hideselection"))return!1}return!0}isWhiteSpaceNormal(e){const t=this.getElementForNode(e);return t instanceof HTMLElement&&"normal"===this.domMeasurement.getStyle(t,"white-space")}guessRects(e){const t=e.getBoundingClientRect(),n=this.domMeasurement.getStyle(e,"display"),s=this.domMeasurement.getStyle(e,"text-align"),r=this.domMeasurement.getStyle(e,"text-align"),i=parseFloat(this.domMeasurement.getStyle(e,"text-indent"))||0,o=parseFloat(this.domMeasurement.getStyle(e,"line-height"))||0,a=parseFloat(this.domMeasurement.getStyle(e,"padding-left"))||0,l=parseFloat(this.domMeasurement.getStyle(e,"padding-right"))||0,c=parseFloat(this.domMeasurement.getStyle(e,"padding-top"))||0,d=parseFloat(this.domMeasurement.getStyle(e,"padding-bottom"))||0,h=parseFloat(this.domMeasurement.getStyle(e,"border-left-width"))||0,u=parseFloat(this.domMeasurement.getStyle(e,"border-right-width"))||0,g=parseFloat(this.domMeasurement.getStyle(e,"border-top-width"))||0,m=parseFloat(this.domMeasurement.getStyle(e,"border-bottom-width"))||0,p=parseFloat(this.domMeasurement.getStyle(e,"font-size"))||0,_=this.domMeasurement.getStyle(e,"font-family");let E=i;"center"===s?E=Math.max(1,t.width-a-l-h-u)/2+i:("right"===s||"start"===s&&"rtl"===r||"end"===s&&"ltr"===r)&&(E=Math.max(0,t.width-a-l-h-u-1));let f=this.getCaretHeightForFont(p,_),T=0===o?0:(o-f)/2;if("inline"===n){const t=e.getClientRects();t.length&&t[0].height>0&&(f=t[0].height-c-d-g-m,T=0),"center"===(e.parentElement?this.domMeasurement.getStyle(e.parentElement,"align-content"):"normal")&&(T=0-f/2-c-g)}const C=t.top+g+c+T,v=t.left+h+a+E;return[{left:v,top:C,right:v,bottom:C+f,width:0,height:f}]}observe(){this.selectionChangeEventBinding=(0,s.addSelectionEventCE)(this.textFieldElement,this.onSelectionChange),this.textFieldElement.addEventListener("scroll",this.onScroll,!0),this.textFieldElement.addEventListener("click",this.onClick,!0),this.textFieldElement.addEventListener("mousedown",this.onMousedown,!0),this.textFieldElement.addEventListener("keydown",this.onKeydown,!0),this.textFieldElement.addEventListener("keyup",this.onKeyup,!0),this.textFieldElement.ownerDocument.addEventListener("focusin",this.onFocus,!0),this.textFieldElement.ownerDocument.addEventListener("focusout",this.onBlur,!0),this.resizeObserver=new ResizeObserver(this.onResize),this.resizeObserver.observe(this.textFieldElement),this.mutationObserver=new E.FilteringMutationObserver(this.onMutation,this.isIgnoredMutation),this.mutationObserver.observe(this.textFieldElement,{childList:!0,subtree:!0,attributes:!0,characterData:!0}
534)}unobserve(){this.selectionChangeEventBinding?.destroy(),this.textFieldElement.removeEventListener("scroll",this.onScroll,!0),this.textFieldElement.removeEventListener("click",this.onClick,!0),this.textFieldElement.removeEventListener("mousedown",this.onMousedown,!0),this.textFieldElement.removeEventListener("keydown",this.onKeydown,!0),this.textFieldElement.removeEventListener("keyup",this.onKeyup,!0),this.textFieldElement.ownerDocument.removeEventListener("focusin",this.onFocus,!0),this.textFieldElement.ownerDocument.removeEventListener("focusout",this.onBlur,!0),this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}ifSelectionChanges(e){const t=self.setTimeout((()=>{const t=this.ifSelectionChangesCallbacks.findIndex((t=>t.callback===e));t>-1&&this.ifSelectionChangesCallbacks.splice(t,1)}),10);this.ifSelectionChangesCallbacks.push({callback:e,timeout:t})}fireSelectionChangeCallbacks(){this.ifSelectionChangesCallbacks.forEach((e=>{self.clearTimeout(e.timeout),e.callback()})),this.ifSelectionChangesCallbacks.length=0}isIgnoredAttributeMutation(e){return"attributes"===e.type&&(e.attributeName?.startsWith("data-lpop-")||e.attributeName?.startsWith("data-lt-tmp-id")||e.attributeName?.startsWith("aria-")||"spellcheck"===e.attributeName||"lang"===e.attributeName||"data-gramm"===e.attributeName)}setLastSelectionEvent(e){const t=e instanceof self.KeyboardEvent,n=e instanceof self.MouseEvent,s=e.metaKey&&v,r=t&&e.altKey&&s&&e.key.includes("Arrow"),i=t&&e.shiftKey;r||i?this.lastSelectionEvent=null:n?this.lastSelectionEvent={type:"mousedown",top:e.clientY,left:e.clientX}:t&&"ArrowLeft"===e.key?this.lastSelectionEvent={type:"keydown",direction:s?"line_start":"left",previousSelection:null}:t&&"ArrowRight"===e.key?this.lastSelectionEvent={type:"keydown",direction:s?"line_end":"right",previousSelection:null}:t&&"ArrowDown"===e.key?this.lastSelectionEvent={type:"keydown",direction:"down",previousSelection:this.getSelection()}:t&&"ArrowUp"===e.key?this.lastSelectionEvent={type:"keydown",direction:"up",previousSelection:this.getSelection()}:t&&"Home"===e.key?v&&this.canScrollUp()?this.lastSelectionEvent=null:this.lastSelectionEvent={type:"keydown",direction:"line_start",previousSelection:this.getSelection()}:t&&"End"===e.key?v&&this.canScrollDown()?this.lastSelectionEvent=null:this.lastSelectionEvent={type:"keydown",direction:"line_end",previousSelection:this.getSelection()}:this.lastSelectionEvent=null}getElementForNode(e){return e.nodeType===Node.ELEMENT_NODE?e:e.parentElement}canScrollDown(){const e=[this.textFieldElement,...(0,g.getScrollableAncestors)(this.textFieldElement)],t=this.textFieldElement.ownerDocument.defaultView;return e.some((e=>{if((0,p.default)(e)){const n=t.document.scrollingElement;if(!n)return!1;e=n}return e.scrollTop+e.clientHeight<e.scrollHeight}))}canScrollUp(){const e=[this.textFieldElement,...(0,g.getScrollableAncestors)(this.textFieldElement)],t=this.textFieldElement.ownerDocument.defaultView;return e.some((e=>{if((0,p.default)(e)){const n=t.document.scrollingElement;if(!n)return!1;e=n}return e.scrollTop>0}))}getCaretColor(e){const t=this.getElementForNode(e);if(!t)return null;const n=this.domMeasurement.getStyle(t,"color");return S.isTransparentColor(n)?"#000000":n}isOverflowVisible(){const e=this.domMeasurement.getStyles(this.textFieldElement,["overflow-x","overflow-y"]);return"visible"===e["overflow-x"]||"visible"===e["overflow-y"]}shouldAllowOverlapBy(e){return!1}getAdditionalStyles(){return""}static isTransparentColor(e){return"rgba(0,0,0,0)"===e.replace(/\s/g,"")||"transparent"===e}static hasAlreadyTransparentCaret(e){const t=e.ownerDocument.defaultView;return!!t&&this.isTransparentColor(t.getComputedStyle(e).caretColor)}static isCodeMirror(e){return e.classList.contains("cm-content")}static isProseMirror(e){return e.classList.contains("ProseMirror")}static isCKEditor5(e){return e.parentElement?.classList.contains("ck-editor__main")}static getEditorType(e){return this.isCodeMirror(e)?"CodeMirror":this.isProseMirror(e)?"ProseMirror":this.isCKEditor5(e)?"CKEditor5":"unknown"}static matches(e){return e instanceof HTMLElement&&!this.hasAlreadyTransparentCaret(e)&&!this.isCodeMirror(e)&&Boolean(e.isContentEditable||"on"===e.ownerDocument.designMode||e.querySelector("[contenteditable='true'], [contenteditable='']"))}}const b=S},
534"./lollipop/adapter/FormElement.ts":
535/*!*****************************************!*\
536  !*** ./lollipop/adapter/FormElement.ts ***!
537  \*****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(/*! ../../common/editors/selectionManager */"./common/editors/selectionManager.ts"),r=n(/*! ../../common/index */"./common/mutationObservers/filteringMutationObserver.ts"),i=n(/*! ../util/getClientRects */"./lollipop/util/getClientRects.ts"),o=n(/*! ../util/isFirefox */"./lollipop/util/isFirefox.ts"),a=n(/*! ./ContentEditable */"./lollipop/adapter/ContentEditable.ts");const l=(0,o.default)();class c extends a.default{constructor(e,t,n){super(e,n),this.selectionDirection="unknown",this.selection={start:0,end:0},this.mirror=t,this.observeMirror(),this.updateSelection()}observe(){this.selectionChangeEventBinding=(0,s.addSelectionEventCE)(this.textFieldElement,this.onSelectionChange),this.textFieldElement.addEventListener("scroll",this.onScroll,!0),this.textFieldElement.addEventListener("click",this.onClick,!0),this.textFieldElement.addEventListener("keydown",this.onKeydown,!0),this.textFieldElement.addEventListener("keyup",this.onKeyup,!0),this.textFieldElement.ownerDocument.addEventListener("focusin",this.onFocus,!0),this.textFieldElement.ownerDocument.addEventListener("focusout",this.onBlur,!0)}observeMirror(){this.resizeObserver=new ResizeObserver(this.onResize),this.resizeObserver.observe(this.mirror),this.mutationObserver=new r.FilteringMutationObserver(this.onMutation,(()=>!1)),this.mutationObserver.observe(this.mirror,{childList:!0,characterData:!0,attributes:!1,subtree:!0})}unobserve(){this.selectionChangeEventBinding.destroy(),this.textFieldElement.removeEventListener("scroll",this.onScroll,!0),this.textFieldElement.removeEventListener("click",this.onClick,!0),this.textFieldElement.removeEventListener("keydown",this.onKeydown,!0),this.textFieldElement.removeEventListener("keyup",this.onKeyup,!0),this.textFieldElement.ownerDocument.removeEventListener("focusin",this.onFocus,!0),this.textFieldElement.ownerDocument.removeEventListener("focusout",this.onBlur,!0)}unobserveMirror(){this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}hasFocus(){return this.textFieldElement.matches(":focus")}destroy(){this.off(),this.unobserve(),this.unobserveMirror()}getAdapterName(){return"formelement"}getSelection(){this.updateSelection();const e=this.selection.start===this.selection.end;let t=[];try{t=this.getRects()}catch(e){}e&&(t=this.selectRectForCollapsedRange(t,this.textFieldElement,this.selection.start));const n=e?this.getCaretColor(this.textFieldElement):null;return{isCollapsed:e,direction:this.selectionDirection,rects:t,caretColor:n}}shouldAllowOverlapBy(e){return!1}getAdditionalStyles(){return""}isContentOverflowing(){return!1}isWhiteSpaceNormal(){return!1}getRects(){const e=this.mirror.firstChild;if(!e)return this.guessRects(this.mirror);let t=[];const n=e.nodeValue||"",s=n.substring(Math.max(this.selection.start-1,0),this.selection.end),r=n.substring(this.selection.start,Math.min(this.selection.end+1,n.length));if(this.selection.start===n.length&&n.endsWith("\n"))return[];if(n.endsWith("\n​")&&this.selection.start===n.length-1&&this.selection.start===this.selection.end){const n=new Range;n.setStart(e,this.selection.start+1),n.setEnd(e,this.selection.end+1),t=(0,i.default)(n),n.collapsed&&2===t.length&&(t=[t[1]])}else if(l&&this.selection.start===this.selection.end&&"\n"===s&&"\n"===r){const n=new Range;n.setStart(e,this.selection.start+1),n.setEnd(e,this.selection.end+1),t=(0,i.default)(n)}else{const n=new Range;n.setStart(e,this.selection.start),n.setEnd(e,this.selection.end),t=(0,i.default)(n)}return t.length||n?t:this.guessRects(this.mirror)}updateSelection(){const e=this.textFieldElement.selectionStart,t=this.textFieldElement.selectionEnd,n=this.selection.start,s=this.selection.end;e!==n&&t!==s?this.selectionDirection="unknown":e<n&&t===s?this.selectionDirection="left":t>s&&e===n&&(this.selectionDirection="right"),this.selection={start:e,end:t}}static matches(e){return"TEXTAREA"===e.tagName}}const d=c},
537"./lollipop/adapter/GoogleDocs.ts":
538/*!****************************************!*\
539  !*** ./lollipop/adapter/GoogleDocs.ts ***!
540  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var s=n(/*! ../../common/editors/selectionManager */"./common/editors/selectionManager.ts"),r=n(/*! ../../common/utils */"./common/utils.ts"),i=n(/*! ../util/EventBus */"./lollipop/util/EventBus.ts"),o=n(/*! ../../common/editors/google/utils */"./common/editors/google/utils.ts"),a=n(/*! ../../content/debounce */"./content/debounce.ts");const l="data-lpop-hide-gdocs-caret",c=["Control","Shift","Alt","Meta","CapsLock","Escape"],d=".kix-rotatingtilemanager-content, .kix-rotatingtilemanager",h=".kix-cursor",u=".docs-texteventtarget-iframe";class g extends i.EventBus{constructor(e,t){super(),this.scrollState={top:0,right:0,bottom:0,left:0},this._hasFocus=!1,this._checkKixCursorInterval=null,this._checkFocusDebounceTimeout=100,this._checkDebounceTimeoutMaxDelay=250,this.onCursorMutation=e=>{this.checkFocus.call(!0),this.fire("selectionchange")},this.onSelectionMutation=()=>{this.checkFocus.call(!0),this.fire("selectionchange")},this.onTextFieldMutation=e=>{e.filter((e=>e.target!==this.textFieldElement)).length&&this.fire("mutation")},this.onKeyup=e=>{this.fire("keyup",e)},this.onKeydown=e=>{this.fire("keydown",e),c.includes(e.key)||this.fire("typing")},this.checkFocus=new a.Debounce(((e=!1)=>{this.domMeasurement.clearCache();const t=this.isKixCursorVisible(),n=this.hasBlueSelectionColor();if(!t&&!n)return void this.setFocus(!1,e);const s=this.domMeasurement.getStyle(this.kixCursor,"animation-name").includes("blink"),i=this.domMeasurement.getBoundingClientRect(this.kixCursor),o=this.domMeasurement.getBoundingClientRect(this.textFieldElement);if(!s&&!n)return void this.setFocus(!1,e);const a=(0,r.isRectsIntersect)(o,i);this.setFocus(a,e)}),this._checkFocusDebounceTimeout,this._checkDebounceTimeoutMaxDelay),this.textFieldElement=e,this.domMeasurement=t,this.setKixCursor(),this.kixContainer=this.textFieldElement.closest(d),this.kixIframe=this.textFieldElement.ownerDocument.querySelector(u),this.observe(),this.checkFocus.call(),this.checkFocus.callImmediately()}setKixCursor(){this.kixCursor=this.textFieldElement.ownerDocument.querySelector(h),this.kixCursorCaret=this.textFieldElement.ownerDocument.querySelector("#kix-current-user-cursor-caret")}hasFocus(){return this._hasFocus}getSelection(){const e=this._getKixSelectionRectsForBlueCaret(),t=this.getSelectionDirection(e),n=this.getRects(e),s=0===e.length;let r=null;return s&&(r=this.getKixCursorColor()),{isCollapsed:s,direction:t,rects:n,caretColor:r}}getPaddingRect(){return this.domMeasurement.getPaddingBox(this.textFieldElement,!1,!1)}getScrollState(){return this.scrollState}disableNativeCaret(){g.enabledInstances.includes(this)||g.enabledInstances.push(this),this.kixCursor.setAttribute(l,"")}enableNativeCaret(){const e=g.enabledInstances.indexOf(this);e>-1&&g.enabledInstances.splice(e,1),g.enabledInstances.length||this.kixCursor.removeAttribute(l)}getAdapterName(){return"gdocs"}destroy(){this._checkKixCursorInterval&&self.clearInterval(this._checkKixCursorInterval),this.enableNativeCaret(),this.checkFocus.cancelCall(),this.selectionChangeEventBinding?.destroy(),this.cursorMutationObserver?.disconnect(),this.textFieldMutationObserver?.disconnect(),this.kixIframe.contentWindow?.document.removeEventListener("keyup",this.onKeyup,!0),this.kixIframe.contentWindow?.document.removeEventListener("keydown",this.onKeydown,!0),this.off()}shouldAllowOverlapBy(e){return e===this.textFieldElement.parentElement||e.classList.contains("kix-domviewscroller-inner")}getAdditionalStyles(){return".docs-bubble-material.docs-bubble.docs-material.inlineFabBubbleContainer,.docs-bubble-material.docs-bubble.docs-material.aiTextRefineOnPasteBubbleContainer { margin-left: 25px !important; } "}isContentOverflowing(){return!1}initCursorMutationObserver(){this.cursorMutationObserver&&this.cursorMutationObserver.disconnect(),this.cursorMutationObserver=new MutationObserver(this.onCursorMutation),this.cursorMutationObserver.observe(this.kixCursor,{attributes:!0,attributeFilter:["style"]})}observe(){this.initCursorMutationObserver(),this._checkKixCursorInterval=self.setInterval((()=>{this.textFieldElement.ownerDocument.contains(this.kixCursor)||this.textFieldElement.ownerDocument.querySelector(h)&&(this.setKixCursor(),this.initCursorMutationObserver(),this.checkFocus.c
540all(!0))}),750),this.selectionChangeEventBinding=(0,s.addSelectionEventGdocs)(this.kixContainer,this.onSelectionMutation),this.textFieldMutationObserver=new MutationObserver(this.onTextFieldMutation),this.textFieldMutationObserver.observe(this.textFieldElement,{attributes:!0,childList:!0,subtree:!0}),this.kixIframe.contentWindow?.document.addEventListener("keyup",this.onKeyup,!0),this.kixIframe.contentWindow?.document.addEventListener("keydown",this.onKeydown,!0)}setFocus(e,t=!1){this._hasFocus!==e&&(this._hasFocus=e,t&&this.fire(e?"focus":"blur"))}hasBlueSelectionColor(){return this._getKixSelectionRectsForBlueCaret().length}isKixCursorVisible(){return 0!==parseFloat(this.kixCursor.style.opacity)&&"hidden"!==this.kixCursor.style.visibility&&"none"!==this.kixCursor.style.display&&this.kixCursor.ownerDocument.contains(this.kixCursor)}getKixSelectionRects(){return Array.from(this.textFieldElement.ownerDocument.querySelectorAll(".kix-canvas-tile-selection svg > rect, .kix-canvas-tile-selection svg > g > rect"))}_getKixSelectionRectsForBlueCaret(){const e=this.getKixSelectionRects();return(0,o.getKixSelectionRectsForBlueCaret)(e)}getSelectionDirection(e){if(!e.length)return"right";const t=e[0],n=this.kixCursorCaret.getBoundingClientRect(),s=t.getBoundingClientRect(),r=n.right<s.right&&Math.abs(n.left+n.width/2-s.left)<=3,i=Math.abs(n.top-s.top)<=2||n.top>s.top&&n.bottom<s.bottom;return r&&i?"left":"right"}getRects(e){if(e.length)return e.map((e=>{const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}));{const e=this.kixCursorCaret.getBoundingClientRect();return[{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}]}}getKixCursorColor(){return this.kixCursorCaret.ownerDocument.defaultView.getComputedStyle(this.kixCursorCaret).borderColor||"rgb(0,0,0)"}static matches(e){return e instanceof HTMLElement&&/docs\.google\.com\/document\/d\//.test(location.href)&&!!e.ownerDocument.querySelector(h)&&!!e.closest(d)&&!!e.ownerDocument.querySelector(u)&&(e.classList.contains("kix-canvas-tile-content")||e.classList.contains("kix-rotatingtilemanager"))}}g.enabledInstances=[];const m=g},
540"./lollipop/adapter/GoogleSlides.ts":
541/*!******************************************!*\
542  !*** ./lollipop/adapter/GoogleSlides.ts ***!
543  \******************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var s=n(/*! ../util/EventBus */"./lollipop/util/EventBus.ts");const r="sketchy-text-selection-overlay",i="data-lpop-hide-gslides-caret",o=["Control","Shift","Alt","Meta","CapsLock","Escape"];class a extends s.EventBus{constructor(e,t){super(),this._hasFocus=!1,this._isCaretElementVisible=!1,this.lastSelection=null,this.scrollState={top:0,right:0,bottom:0,left:0},this.onKeyup=e=>{this.fire("keyup",e)},this.onKeydown=e=>{this.fire("keydown",e),o.includes(e.key)||this.fire("typing")},this.onTextFieldMutation=e=>{const t=this.isSelectionChange(e),n=this.isTextChange(e);t&&this.checkFocus(!0),n&&this.fire("mutation"),t&&this.fire("selectionchange")},this.textFieldElement=e,this.domMeasurement=t,this.kixIframe=document.querySelector(".docs-texteventtarget-iframe"),this.liveSelectionRects=document.getElementsByClassName(r),this._isCaretElementVisible=!!this.getCaretElement(),this.observe(),this.checkFocus()}getSelection(){let e=[],t=!0,n=null,s="unknown";if(this.liveSelectionRects.length){if(e=Array.from(this.liveSelectionRects,(e=>this.getBoundingClientRect(e))),t=!1,this.lastSelection){const t=e[0],n=e[e.length-1];s=this.lastSelection.start.y-t.top>1||this.lastSelection.start.x-t.left>1?"left":n.bottom-this.lastSelection.end.y>1||n.right-this.lastSelection.end.x>1?"right":this.lastSelection.direction}}else{const s=this.getCaretElement();s&&(t=!0,n=s.getAttribute("fill"),e=[this.getBoundingClientRect(s)])}return e.length?(this.lastSelection={start:{x:e[0].left,y:e[0].top},end:{x:e[e.length-1].right,y:e[e.length-1].bottom},direction:s},{direction:s,isCollapsed:t,caretColor:n,rects:e}):(this.lastSelection=null,null)}hasFocus(){return this._hasFocus}getPaddingRect(){return this.domMeasurement.getPaddingBox(this.textFieldElement,!1,!1)}getAdapterName(){return"gslides"}getAdditionalStyles(){return""}isContentOverflowing(){return!1}getScrollState(){return this.scrollState}shouldAllowOverlapBy(e){return!1}enableNativeCaret(){this.textFieldElement.removeAttribute(i)}disableNativeCaret(){this.textFieldElement.setAttribute(i,"")}destroy(){this.textFieldMutationObserver.disconnect(),this.kixIframe.contentWindow?.document.removeEventListener("keyup",this.onKeyup,!0),this.kixIframe.contentWindow?.document.removeEventListener("keydown",this.onKeydown,!0),this.enableNativeCaret(),this.off()}checkFocus(e=!1){this.domMeasurement.clearCache();const t=!!this.getCaretElement()||this.liveSelectionRects.length>0;this.setFocus(t,e)}setFocus(e,t=!1){this._hasFocus!==e&&(this._hasFocus=e,t&&this.fire(e?"focus":"blur"))}getBoundingClientRect(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}observe(){this.textFieldMutationObserver=new MutationObserver(this.onTextFieldMutation),this.textFieldMutationObserver.observe(this.textFieldElement,{attributes:!0,childList:!0,subtree:!0}),this.kixIframe.contentWindow?.document.addEventListener("keyup",this.onKeyup,!0),this.kixIframe.contentWindow?.document.addEventListener("keydown",this.onKeydown,!0)}getCaretElement(){return document.querySelector('g[id^="editor"] rect[x][y][width][height][style*="opacity: 1"]:not([fill="#B80672"]):not([fill="#137333"]):not([fill="#9334E6"]):not([fill="#007780"])')}isSelectionChange(e){if(!e.length)return!1;const t=this.getCaretElement(),n=!!t;return this._isCaretElementVisible!==n?(this._isCaretElementVisible=n,!0):e.some((e=>e.target===t||(e.addedNodes.length?Array.from(e.addedNodes).some((e=>this.isSelectionNode(e,t))):e.removedNodes.length?Array.from(e.removedNodes).some((e=>this.isSelectionNode(e,t))):void 0)))}isTextChange(e){return e.some((e=>e.target instanceof SVGGElement&&e.target.classList.contains("sketchy-text-content")&&(e.addedNodes.length||e.removedNodes.length)||"characterData"===e.type&&e.target instanceof SVGTextElement))}isSelectionNode(e,t){return e instanceof SVGRectElement&&(e===t||e.classList.contains(r))}static matches(e){return/docs\.google\.com\/presentation\/d\//.test(location.href)&&e instanceof SVGElement&&!!e.querySelector("g[id^='editor']")}}const l=a},
543"./lollipop/util/EventBus.ts":
544/*!***********************************!*\
545  !*** ./lollipop/util/EventBus.ts ***!
546  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventBus:()=>s});
547/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
548class s{constructor(){this._eventHandlers=new Map}on(e,t){this._eventHandlers.has(e)||this._eventHandlers.set(e,[]),this._eventHandlers.get(e).push(t)}fire(e,t){const n=this._eventHandlers.get(e);n&&n.forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}off(){this._eventHandlers.clear()}}},
548"./lollipop/util/detectOS.ts":
549/*!***********************************!*\
550  !*** ./lollipop/util/detectOS.ts ***!
551  \***********************************/(e,t,n)=>{"use strict";function s(){return navigator.userAgent.includes("Macintosh")?"Mac":navigator.userAgent.includes("Windows")?"Windows":navigator.userAgent.includes("CrOS")?"CrOS":navigator.userAgent.includes("Linux")?"Linux":"Other"}n.r(t),n.d(t,{default:()=>s})},
551"./lollipop/util/getClientRects.ts":
552/*!*****************************************!*\
553  !*** ./lollipop/util/getClientRects.ts ***!
554  \*****************************************/(e,t,n)=>{"use strict";function s(e){return Array.from(e.getClientRects(),(e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height})))}n.r(t),n.d(t,{default:()=>s})},
554"./lollipop/util/getDistanceBetweenTwoCoordinates.ts":
555/*!***********************************************************!*\
556  !*** ./lollipop/util/getDistanceBetweenTwoCoordinates.ts ***!
557  \***********************************************************/(e,t,n)=>{"use strict";function s(e,t,n,s){return Math.hypot(e-n,t-s)}n.r(t),n.d(t,{default:()=>s})},
557"./lollipop/util/getSelectionDirection.ts":
558/*!************************************************!*\
559  !*** ./lollipop/util/getSelectionDirection.ts ***!
560  \************************************************/(e,t,n)=>{"use strict";function s(e){if(!e.anchorNode||!e.focusNode)return"unknown";const t=e.anchorNode.compareDocumentPosition(e.focusNode);let n="right";return(!t&&e.anchorOffset>e.focusOffset||t===Node.DOCUMENT_POSITION_PRECEDING)&&(n="left"),n}n.r(t),n.d(t,{default:()=>s})},
560"./lollipop/util/isElementNode.ts":
561/*!****************************************!*\
562  !*** ./lollipop/util/isElementNode.ts ***!
563  \****************************************/(e,t,n)=>{"use strict";function s(e){return e.nodeType===Node.ELEMENT_NODE}n.r(t),n.d(t,{default:()=>s})},
563"./lollipop/util/isFirefox.ts":
564/*!************************************!*\
565  !*** ./lollipop/util/isFirefox.ts ***!
566  \************************************/(e,t,n)=>{"use strict";function s(){return navigator.userAgent.includes("Firefox/")}n.r(t),n.d(t,{default:()=>s})},
566"./lollipop/util/isFirstChild.ts":
567/*!***************************************!*\
568  !*** ./lollipop/util/isFirstChild.ts ***!
569  \***************************************/(e,t,n)=>{"use strict";function s(e){return e.parentNode?.firstChild===e}n.r(t),n.d(t,{default:()=>s})},
569"./lollipop/util/isSelectionCollapsed.ts":
570/*!***********************************************!*\
571  !*** ./lollipop/util/isSelectionCollapsed.ts ***!
572  \***********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=n(/*! ./isElementNode */"./lollipop/util/isElementNode.ts");function r(e){let t=e.isCollapsed;t&&e.anchorNode===e.focusNode&&e.anchorOffset!==e.focusOffset&&(t=!1);const n=0===e.toString().length;return n&&e.anchorNode&&e.focusNode&&(0,s.default)(e.anchorNode)&&(0,s.default)(e.focusNode)&&0===e.anchorOffset&&1===e.focusOffset&&(t=!0),n||(t=!1),t}},
572"./lollipop/util/isTextNode.ts":
573/*!*************************************!*\
574  !*** ./lollipop/util/isTextNode.ts ***!
575  \*************************************/(e,t,n)=>{"use strict";function s(e){return e.nodeType===Node.TEXT_NODE}n.r(t),n.d(t,{default:()=>s})},
575"./lollipop/util/isWindow.ts":
576/*!***********************************!*\
577  !*** ./lollipop/util/isWindow.ts ***!
578  \***********************************/(e,t,n)=>{"use strict";function s(e){return"document"in e&&"setInterval"in e&&"location"in e}n.r(t),n.d(t,{default:()=>s})},
578"./lollipop/util/looksLikeAPlaceholder.ts":
579/*!************************************************!*\
580  !*** ./lollipop/util/looksLikeAPlaceholder.ts ***!
581  \************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=n(/*! ../../common/domMeasurement */"./common/domMeasurement.ts");function r(e,t,n=new s.DomMeasurement(e.ownerDocument)){if(t.textContent?.trim())return!1;if(!((e.textContent||"").length>3))return!1;const r=n.getBoundingClientRect(e),i=n.getBoundingClientRect(t);return r.top-i.top<=30&&r.top-i.top>-10&&r.left-i.left<=30&&r.left-i.left>-10}},
581"./lollipop/util/supportsCSSAnchorPositioning.ts":
582/*!*******************************************************!*\
583  !*** ./lollipop/util/supportsCSSAnchorPositioning.ts ***!
584  \*******************************************************/(e,t,n)=>{"use strict";function s(){const e=document.createElement("span");return"positionAnchor"in e.style&&"showPopover"in e}n.r(t),n.d(t,{default:()=>s})},
584"./lollipop/util/trimSimpleWhiteSpaceAtEnd.ts":
585/*!****************************************************!*\
586  !*** ./lollipop/util/trimSimpleWhiteSpaceAtEnd.ts ***!
587  \****************************************************/(e,t,n)=>{"use strict";function s(e){return e.replace(/[\n\t ]+$/,"")}n.r(t),n.d(t,{default:()=>s})},
587"./react/components/additional-error-suggestion/additional-error-suggestion.tsx":
588/*!**************************************************************************************!*\
589  !*** ./react/components/additional-error-suggestion/additional-error-suggestion.tsx ***!
590  \**************************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../../../common/utils */"./common/utils.ts"),a=n(/*! ../card-content/card-content */"./react/components/card-content/card-content.tsx"),l=n(/*! ../icon/icon */"./react/components/icon/icon.tsx"),c=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),d=n(/*! ../../../core/utils */"./core/utils.ts");const h=({suggestion:e,caption:t,isLoading:n,isIdle:h,error:u,showRuleId:g,children:m,onClick:p,onSuggestionMouseOver:_,onSuggestionMouseOut:E})=>{const{isInDOM:f}=(0,i.useRootContext)(),{updateCardPosition:T,moveCardIntoViewport:C}=(0,c.useBaseCardContext)(),v=!(n||!u&&e),S=(0,r.useMemo)((()=>function(){const a=(0,i.useI18nContext)(),c=(0,r.useMemo)((()=>a("additionalErrorSuggestionApplyButtonLabel")),[]),d=!u&&!!e,h=(()=>{switch(!0){case v:return t.missing;case n:return t.loading;case d:return t.apply;default:throw new Error("Invalid state of Additional Error Suggestion")}})();return(0,s.jsxs)(i.Div,{className:"lt-comp-additional-error-suggestion__header",children:[(0,s.jsx)(i.Span,{className:(0,o.classes)("lt-comp-additional-error-suggestion__caption",n&&"lt-comp-additional-error-suggestion__caption--loading",v&&"lt-comp-additional-error-suggestion__caption--missing"),children:h}),d&&(0,s.jsxs)(i.Span,{className:"lt-comp-additional-error-suggestion__apply","data-lt-tabindex":"0",onClick:p,onMouseOver:_,onMouseOut:E,children:[c," ",(0,s.jsx)(l.default,{name:"insert",compact:!0})]})]})}),[u,t,e,n,v,p,_,E]),b=(0,r.useMemo)((()=>function({children:e}){return(0,s.jsx)(a.default,{caption:(0,s.jsx)(S,{}),className:(0,o.classes)("lt-comp-additional-error-suggestion",v&&"lt-comp-additional-error-suggestion--missing"),isLoading:n,noPadding:!0,isIdle:h,children:e})}),[S,v,n,h]);return(0,r.useEffect)((()=>{f&&(0,d.isObject)(e)&&T()}),[f,e,T]),(0,r.useEffect)(C,[e,C]),n||u||!e?(0,s.jsx)(b,{}):(0,s.jsx)(b,{children:(0,s.jsxs)(i.Div,{className:"lt-comp-additional-error-suggestion__suggestion","data-lt-testid":"additional-error-suggestion",onClick:p,onMouseOver:_,onMouseOut:E,children:[g&&(0,s.jsx)(i.Span,{className:"lt-comp-additional-error-suggestion__suggestion__origin",children:e.label}),(0,s.jsx)(i.Div,{className:"lt-comp-additional-error-suggestion__suggestion__content",children:m})]})})}},
590"./react/components/card-base/card-base.tsx":
591/*!**************************************************!*\
592  !*** ./react/components/card-base/card-base.tsx ***!
593  \**************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>x});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! react-dom */"react-dom"),o=n(/*! ../../../common/i18nManager */"./common/i18nManager.ts"),a=n(/*! ../../../common/utils */"./common/utils.ts"),l=n(/*! ../../../core/utils */"./core/utils.ts"),c=n(/*! ../keyboard-navigation/keyboard-navigation */"./react/components/keyboard-navigation/keyboard-navigation.tsx"),d=n(/*! ../keyboard-navigation-hint/keyboard-navigation-hint */"./react/components/keyboard-navigation-hint/keyboard-navigation-hint.tsx"),h=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),u=n(/*! ../../index */"./react/index.ts"),g=n(/*! ./hooks */"./react/components/card-base/hooks.ts"),m=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts"),p=n(/*! ../toolbox-content/toolbox-content */"./react/components/toolbox-content/toolbox-content.tsx"),_=n(/*! ../../../init/config */"./init/config.ts"),E=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts");const f={menubar:"no",statusbar:"no",width:"660",height:"690",left:"20",top:"20",noopener:"yes",noreferrer:"yes"},T=_.default.get(_.ConfigKey.EXTN_PREFIX),C=(0,u.elementFactory)("comp-card-base"),v=({cardId:e,onDisableLollipopSelected:t})=>{const[n,i]=(0,r.useState)(!1),{current:a}=(0,r.useRef)({close:o.i18nManager.getMessage("close"),sendFeedback:o.i18nManager.getMessage("sendFeedback"),disableLollipop:o.i18nManager.getMessage("disableLollipop"),learnMore:o.i18nManager.getMessage("toolboxOnboardingLearnMore")}),{getSettings:l}=(0,u.useStorageContext)(),{hasLollipopEnabled:c}=l(),d=(0,h.default)((()=>{i(!n),n||m.TrackerAdapter.trackToolboxEvent(e,{name:"toolbox:open_kebab",data:""})})),g=(0,h.default)((()=>{i(!1),t()})),p=(0,h.default)((()=>{const t=new URL("https://docs.google.com/forms/d/e/1FAIpQLSc-URuQ81hhAa8ti80CXIG_x-PSoNfcjOoqDyuJ8eOLtYzxIQ/viewform"),n=E.EnvironmentAdapter.getVersion();t.searchParams.set("entry.1107064358",n),i(!1),m.TrackerAdapter.trackToolboxEvent(e,{name:"toolbox:open_feedback",data:""}),self.open(t.toString(),"_blank",Object.entries(f).map((e=>e.join("="))).join(","))})),T=(0,h.default)((()=>{i(!1),m.TrackerAdapter.trackToolboxEvent(e,{name:"toolbox:learn_more",data:""}),self.open(_.default.get(_.ConfigKey.LOLLIPOP_CONFIG).ONBOARDING_LANDING_PAGE_URL,"_blank")})),C=(0,h.default)((()=>{i(!1)}));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__selector",children:[(0,s.jsx)(u.Div,{className:"lt-comp-card-base__kebab-menu-icon lt-icon__kebab-menu","data-lt-testid":"card-kebab-menu",onClick:d,children:(0,s.jsx)(u.Span,{className:"lt-comp-card-base__btn__label",children:a.close})}),n&&(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__selector__menu lt-comp-card-base__selector__menu--right",children:[c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector__menu-item lt-comp-card-base__selector__menu-item--learn-more",onClick:T,children:a.learnMore}),(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector__menu-item lt-comp-card-base__selector__menu-item--disable",onClick:g,children:a.disableLollipop})]}),(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector__menu-item lt-comp-card-base__selector__menu-item--feedback",onClick:p,children:a.sendFeedback})]})]}),n&&(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector-backdrop",onClick:C})]})},S=({mode:e,canSeeLollipop:t,onModeChange:n})=>{const{hasRephrasingEnabled:i}=(0,u.useStorageContext)(),[l,c]=(0,r.useState)(!1),{current:d}=(0,r.useRef)({paraphraser:o.i18nManager.getMessage("cardSelectorLabelParaphraser"),checker:o.i18nManager.getMessage("cardSelectorLabelChecker"),toolbox:o.i18nManager.getMessage("cardSelectorLabelAITools")}),g=(0,r.useMemo)((()=>{switch(e){case"correct":return d.checker;case"paraphrase":return d.paraphraser;case"toolbox":return d.toolbox;default:throw new Error(`Unexpected mode "${e}"`)}}),[e]),m=(0,h.default)((()=>c(!l))),p=(0,h.default)((()=>{c(!1),n?.({mode:"paraphrase"})})),_=(0,h.default)((()=>{c(!1),n?.({mode:"correct"})})),E=(0,h.default)((()=>{c(!1),n?.({mode:"toolbox"})})),f=(0,h.default)((()=>{c(!1)})),T=(0,r.useMemo)((()=>{const n=[{name:"correct",caption:d.checker,handleClick:_}];return t?n.push({name:"toolbox",caption:d.toolbox,handleClick:E}):n.push({name:"paraphrase",caption:d.paraphraser,handleClick:p}),n.sort((({name:t})=>t===e?-1:1))}),[e,t,p,_,E]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__selector",children:[(0,s.jsx)(u.Div,{className:(0,a.classes)("lt-comp-card-base__selector__label",l&&"lt-comp-card-base__selector__label--active",!i()&&"lt-comp-card-base__selector__label--disabled"),onClick:i()?m:void 0,children:g}),l&&(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector__menu",children:T.map((({name:t,caption:n,handleClick:r})=>(0,s.jsx)(u.Div,{className:(0,a.classes)("lt-comp-card-base__selector__menu-item","lt-comp-card-base__selector__menu-item--"+t,e===t&&"lt-comp-card-base__selector__menu-item--current"),onClick:r,children:n},t)))})]}),l&&(0,s.jsx)(u.Div,{className:"lt-comp-card-base__selector-backdrop",onClick:f})]})},b=(0,r.forwardRef)(((e,t)=>(0,s.jsx)(u.Div,{className:"lt-comp-card-base__draggable",children:(0,s.jsx)(u.Div,{className:"lt-comp-card-base__draggable__handle",ref:t,children:(0,s.jsx)("svg",{width:"20",height:"8",viewBox:"0 0 20 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"lt-comp-card-base__draggable__handle__graphic",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.6 3.2C2.48366 3.2 3.2 2.48366 3.2 1.6C3.2 0.716344 2.48366 0 1.6 0C0.716344 0 0 0.716344 0 1.6C0 2.48366 0.716344 3.2 1.6 3.2ZM7.2 3.2C8.08366 3.2 8.8 2.48366 8.8 1.6C8.8 0.716344 8.08366 0 7.2 0C6.31634 0 5.6 0.716344 5.6 1.6C5.6 2.48366 6.31634 3.2 7.2 3.2ZM14.4 1.6C14.4 2.48366 13.6837 3.2 12.8 3.2C11.9163 3.2 11.2 2.48366 11.2 1.6C11.2 0.716344 11.9163 0 12.8 0C13.6837 0 14.4 0.716344 14.4 1.6ZM18.4 3.2C19.2837 3.2 20 2.48366 20 1.6C20 0.716344 19.2837 0 18.4 0C17.5163 0 16.8 0.716344 16.8 1.6C16.8 2.48366 17.5163 3.2 18.4 3.2ZM3.2 6.4C3.2 7.28366 2.48366 8 1.6 8C0.716344 8 0 7.28366 0 6.4C0 5.51634 0.716344 4.8 1.6 4.8C2.48366 4.8 3.2 5.51634 3.2 6.4ZM7.2 8C8.08366 8 8.8 7.28366 8.8 6.4C8.8 5.51634 8.08366 4.8 7.2 4.8C6.31634 4.8 5.6 5.51634 5.6 6.4C5.6 7.28366 6.31634 8 7.2 8ZM14.4 6.4C14.4 7.28366 13.6837 8 12.8 8C11.9163 8 11.2 7.28366 11.2 6.4C11.2 5.51634 11.9163 4.8 12.8 4.8C13.6837 4.8 14.4 5.51634 14.4 6.4ZM18.4 8C19.2837 8 20 7.28366 20 6.4C20 5.51634 19.2837 4.8 18.4 4.8C17.5163 4.8 16.8 5.51634 16.8 6.4C16.8 7.28366 17.5163 8 18.4 8Z",fill:"currentColor"})})})}))),x=(0,r.forwardRef)((function({canChangeMode:e,cardId:t,root:n,mode:o,type:_,isPremium:E,disablePremiumTeaser:f,className:x,keyboardNavigationEnabled:y,keyboardEventTarget:A,backdropRoot:k,canSeeLollipop:w,onModeChange:R,onClose:L,onPremiumClick:M,onDetachCard:I,updatePosition:P,moveIntoViewport:N,onNavigateSentence:O,children:D},H){const U=(0,u.useI18nContext)(),F=(0,u.useStorageContext)(),{current:B}=(0,r.useRef)({close:U("close"),toolbox:U("cardSelectorLabelAITools")}),G=(0,r.useRef)(null),j=(0,r.useRef)(null),W=(0,r.useRef)(null),$=(0,r.useRef)(null),z=G.current?.parentElement,[V,K]=(0,r.useState)(_),[X,q]=(0,r.useState)(e),[Y,Z]=(0,r.useState)({top:-1,left:-1}
593),[J,Q]=(0,r.useState)(!1),[ee,te]=(0,r.useState)({top:-1,right:-1}),[ne,se]=(0,r.useState)(!1),[re,ie]=(0,r.useState)(!1),oe=(0,r.useMemo)((()=>(0,l.isFunction)(R)?e=>R?.(e):void 0),[R]),ae=(0,r.useMemo)((()=>X&&(0,l.isFunction)(oe)),[X,oe]),le=(0,r.useCallback)((()=>{if(j.current){const{left:e,top:t,width:n,height:s}=j.current.getBoundingClientRect(),{offsetWidth:r}=j.current.ownerDocument.documentElement;Z({top:t+s,right:r-e-n})}if(W.current){const{left:e,top:t,height:n}=W.current.getBoundingClientRect();te({top:t+n,left:e})}}),[]),ce=(0,r.useCallback)((()=>{le(),Q(!0)}),[le]),de=(0,r.useCallback)((()=>{le(),se(!0)}),[le]),he=(0,r.useCallback)((()=>{if("toolbox"!==o)throw new Error(`Sentence navigation feature unhandled for mode "${o}"`);O("previous"),m.TrackerAdapter.trackToolboxEvent(t,{name:"toolbox:previous_sentence",data:""})}),[t,o,O]),ue=(0,r.useCallback)((()=>{if("toolbox"!==o)throw new Error(`Sentence navigation feature unhandled for mode "${o}"`);O("next"),m.TrackerAdapter.trackToolboxEvent(t,{name:"toolbox:next_sentence",data:""})}),[t,o,O]),ge=(0,r.useMemo)((()=>"toolbox"===o?B.toolbox:"LanguageTool"),[o]),[me,{adjustPosition:pe,destroyDomMeasurementCache:_e}]=(0,g.useDraggable)(G.current,$.current,k),Ee=(0,r.useCallback)((()=>P?.(G.current,me.isDetached)),[P,me.isDetached]),fe=(0,r.useCallback)((()=>{N(G.current),_e()}),[N,_e]),Te=!1===E&&!0!==f,Ce=(0,h.default)((()=>{L(),m.TrackerAdapter.trackToolboxEvent(t,{name:"toolbox:closeCross",data:""})})),ve=(0,h.default)((()=>{M?.("logo")})),Se=(0,h.default)((()=>{M?.("badge")})),be=(0,r.useCallback)((()=>{F.updateSettings({hasLollipopEnabled:!1}),m.TrackerAdapter.trackToolboxEvent(t,{name:"disable_lollipop:toolbox",data:""}),(0,a.dispatchCustomEvent)(document,p.ToolboxEventNames.turnOffLollipop)}),[t,F]),xe=e=>{const t={[`--${T}-tooltip-left-opacity`]:J?"1":"0",[`--${T}-tooltip-right-opacity`]:ne?"1":"0"};for(const n of Object.keys(e))e[n]>-1&&(t[`--${T}-tooltip-offset-${n}`]=e[n]+"px");return t};return(0,r.useImperativeHandle)(H,(()=>({updatePosition:Ee,updateCardType:K,updateCanChangeMode:q,updateSentenceNavigationVisibility:ie})),[Ee]),(0,r.useEffect)((()=>{me.isDetached&&I()}),[me.isDetached,I]),(0,g.useUpdatePositionOnModeChange)(o,Ee),(0,l.isUndefined)(o)?(0,s.jsxs)(C,{className:(0,a.classes)("notranslate",x,"lt-comp-card-base--narrow"),"data-lt-testid":"card-container",ref:G,children:[(0,s.jsx)(u.Div,{className:"lt-comp-card-base__header",children:(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__header__left",children:[(0,s.jsx)(u.Div,{className:"lt-comp-card-base__logo"}),(0,s.jsx)(u.Div,{className:"lt-comp-card-base__caption",children:"LanguageTool"})]})}),D]}):(0,s.jsx)(c.default,{enableKeyboard:y,keyboardEventTarget:A,root:n,mode:o,onClose:L,children:(0,s.jsx)(g.BaseCardContextProvider,{value:{isDetached:me.isDetached,adjustPosition:pe,updateCardPosition:Ee,moveCardIntoViewport:fe},children:(0,s.jsxs)(C,{className:(0,a.classes)("notranslate",x,me.isDraggable&&"lt-comp-card-base--draggable",me.isDragging&&"lt-comp-card-base--dragging",me.isDetached&&"lt-comp-card-base--detached",me.isInSnapProximity&&"lt-comp-card-base--in-snap-proximity",me.isResetting&&"lt-comp-card-base--resetting","wide"===V&&"lt-comp-card-base--wide","narrow"===V&&"lt-comp-card-base--narrow"),"data-lt-testid":"card-container",ref:G,children:[(0,s.jsx)(b,{ref:$}),(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__header",children:[(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__header__left",children:[(0,s.jsx)(u.Div,{className:(0,a.classes)("lt-comp-card-base__logo",Te&&"lt-comp-card-base__logo--clickable"),onClick:Te?ve:void 0}),ae?(0,s.jsx)(S,{mode:o,canSeeLollipop:w,onModeChange:oe}):(0,s.jsx)(u.Div,{className:"lt-comp-card-base__caption",children:ge})]}),(0,s.jsxs)(u.Div,{className:"lt-comp-card-base__header__right",children:["toolbox"===o&&(0,s.jsxs)(s.Fragment,{children:[re&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Div,{className:"lt-comp-card-base__btn lt-icon__arrow_left",onClick:he,onMouseOver:ce,onMouseOut:()=>Q(!1),ref:j,"data-lt-testid":"previous-sentence",children:z&&(0,i.createPortal)((0,s.jsx)(u.Span,{className:"lt-comp-card-base__btn-tooltip lt-comp-card-base__btn-tooltip--left",style:xe(Y),children:U("editorCardPreviousSentence")}),z)}),(0,s.jsx)(u.Div,{className:"lt-comp-card-base__btn lt-icon__arrow_right",onClick:ue,onMouseOver:de,onMouseOut:()=>se(!1),ref:W,"data-lt-testid":"next-sentence",children:z&&(0,i.createPortal)((0,s.jsx)(u.Span,{className:"lt-comp-card-base__btn-tooltip lt-comp-card-base__btn-tooltip--right",style:xe(ee),children:U("editorCardNextSentence")}),z)})]}),(0,s.jsx)(v,{cardId:t,onDisableLollipopSelected:be})]}),Te&&(0,s.jsx)(u.Span,{className:"lt-comp-card-base__badge","data-lt-testid":"badge-basic",onClick:Se,children:"Basic"}),(0,s.jsx)(u.Div,{className:"lt-comp-card-base__btn lt-icon__close_small",onClick:Ce,"data-lt-testid":"card-close",children:(0,s.jsx)(u.Span,{className:"lt-comp-card-base__btn__label",children:B.close})})]})]}),y&&"toolbox"!==o&&(0,s.jsx)(d.default,{className:"lt-comp-editor-card__keyboard-hint"}),D]})})})}))},
593"./react/components/card-base/custom-card-base.tsx":
594/*!*********************************************************!*\
595  !*** ./react/components/card-base/custom-card-base.tsx ***!
596  \*********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../../../common/utils */"./common/utils.ts"),a=n(/*! ../../../init/config */"./init/config.ts"),l=n(/*! ./hooks */"./react/components/card-base/hooks.ts");const c=(0,i.elementFactory)("comp-card-base"),d=a.default.get(a.ConfigKey.EXTN_PREFIX),h=(0,r.forwardRef)((function({updatePosition:e,onToolboxSentenceNavigationVisibilityChange:t,children:n,isHidden:i,mode:a,...h},u){const g=(0,r.useRef)(null),m=a?{"data-qb-mode":a}:void 0,p=(0,r.useCallback)((()=>{e?.(g.current)}),[e]);return(0,r.useImperativeHandle)(u,(()=>({updatePosition:p,updateCardType:()=>{},updateCanChangeMode:()=>{},updateSentenceNavigationVisibility:t})),[p]),(0,l.useUpdatePositionOnModeChange)(a,p),(0,l.useDeferInitialUpdatePosition)(g.current,p),(0,s.jsx)(c,{...h,...m,ref:g,className:(0,o.classes)(h.className,i&&`${d}-comp-card-base--hidden`),children:n})}))},
596"./react/components/card-base/draggable.ts":
597/*!*************************************************!*\
598  !*** ./react/components/card-base/draggable.ts ***!
599  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var s=n(/*! ../../../common/domMeasurement */"./common/domMeasurement.ts"),r=n(/*! ../../../common/utils */"./common/utils.ts"),i=n(/*! ../../../core/utils */"./core/utils.ts"),o=n(/*! ../../../init/config */"./init/config.ts");const a=o.default.get(o.ConfigKey.EXTN_PREFIX);class l{constructor({parent:e,handle:t,backdropRoot:n,onStateUpdate:o,reMountOnDragStart:a=!1}){this._onStateUpdate=new Set,this._isDraggingEnabled=!1,this._isDraggable=!1,this._isDragging=!1,this._isDetached=!1,this._isInSnapProximity=!1,this._isResetting=!1,this._reMountOnDragStart=!1,this._coordinates={position:"",top:"",bottom:"",left:"",right:""},this._postReset=()=>{this._isResetting=!1,this._update()},this._updateDocumentBox=()=>{this._domMeasurement.clearCache(),this._documentBox=this._domMeasurement.getDocumentVisibleBox()},this._handleScreenResize=()=>{if(this._updateDocumentBox(),!this._isDetached)return;const{top:e,right:t}=this._domMeasurement.getContentBox(this._parent),n=Math.min(this._documentBox.width-t,0),s=Math.min(e,0);if(!n&&!s)return;const r=this._domMeasurement.getComputedStyle(this._parent),i=parseInt(r.left,10),o=parseInt(r.bottom,10),a={};n<0&&!Number.isNaN(i)&&(a.left=`${i+n}px`,this._coordinates.left=a.left),s<0&&!Number.isNaN(o)&&(a.bottom=`${o+s}px`,this._coordinates.bottom=a.bottom),this._domMeasurement.setStyles(this._parent,a,!0)},this._handleDocumentLeave=e=>{this._handleMouseUp(e)},this._handleMouseOver=e=>{this._stopPropagation(e),this._isDraggingEnabled||this._isResetting||(0,i.isFunction)(this._destroyBackdrop)||(this._isDraggingEnabled=!0,this._update(),(0,i.isUndefined)(this._mouseOutBinding)&&(this._mouseOutBinding=(0,r.addUseCaptureEvent)(this._handle,"mouseout",this._handleMouseOut)),this._mouseDownBinding=(0,r.addUseCaptureEvent)(this._handle,"mousedown",this._handleMouseDown))},this._handleMouseOut=e=>{this._stopPropagation(e),this._isResetting||this._isDragging||(this._isDraggingEnabled=!1,this._update(),this._mouseOutBinding?.destroy(),this._mouseOutBinding=void 0,this._mouseDownBinding?.destroy(),this._mouseDownBinding=void 0)},this._handleMouseDown=e=>{if(0===e.button){if(this._stopPropagation(e),this._isDraggable=!0,this._previousCoords={x:e.x,y:e.y},this._update(),this._destroyBackdrop=this._insertBackdrop(),!this._backdrop)throw new Error("Failed to insert drag backdrop");this._mouseOutBinding?.destroy(),this._mouseOutBinding=void 0,this._mouseUpBinding=(0,r.addUseCaptureEvent)(this._backdrop,"mouseup",this._handleMouseUp),this._mouseMoveBinding=(0,r.addUseCaptureEvent)(this._backdrop,"mousemove",this._handleMouseMove.bind(this)),this._parent.ownerDocument.addEventListener("mouseleave",this._handleDocumentLeave)}},this._handleMouseUp=e=>{this._stopPropagation(e),this._isDraggable=!1,this._update(),(0,i.isUndefined)(this._mouseOutBinding)&&(this._mouseOutBinding=(0,r.addUseCaptureEvent)(this._handle,"mouseout",this._handleMouseOut)),this._destroyBackdrop?.(),this._destroyBackdrop=void 0,this._mouseUpBinding?.destroy(),this._mouseUpBinding=void 0,this._mouseMoveBinding?.destroy(),this._mouseMoveBinding=void 0,this._parent.ownerDocument.removeEventListener("mouseleave",this._handleDocumentLeave)},this._handleMouseMove=e=>{if(this._stopPropagation(e),this._reMountOnDragStart)this._isDetached=!0;else{this._switchToFixedPositioning();const{x:t,y:n}=this._getDelta(e.x,e.y),s=this._getFencedHorizontalValue(t),r=this._getFencedVerticalValue(n);(0,i.isNumber)(this._timeout)&&clearTimeout(this._timeout),this._isDetached=!0,this._isDragging=!0,this._isInSnapProximity=this._isPromiximityBelow({x:s,y:r},l.CARD_SNAP_BACK_PROXIMITY_THRESHOLD),this._timeout=self.setTimeout((()=>{this._isInSnapProximity?this._reset():(this._isDragging=!1,this._update())}),200);const o={left:`${s}px`,bottom:`${r}px`};this._coordinates.bottom=o.bottom,this._coordinates.left=o.left,this._domMeasurement.setStyles(this._parent,o,!0)}this._update()},this._parent=e,this._handle=t,this._backdropRoot=n,this._reMountOnDragStart=a,this._onStateUpdate.add(o),this._domMeasurement=new s.DomMeasurement(e.ownerDocument),this._documentBox=this._domMeasurement.getDocumentVisibleBox()}subscribeUpdates(e){return this._onStateUpdate.add(e),()=>this.unsubscribeUpdates(e)}unsubscribeUpdates(e){this._onStateUpdate.delete(e)}init(){self.addEventListener("resize",this._handleScreenResize),self.addEventListener("scroll",this._updateDocumentBox),this._mouseOverBinding=(0,r.addUseCaptureEvent)(this._handle,"mouseover",this._handleMouseOver),this._handle.setAttribute(l.ATTR_HANDLE,"true")}destroy(){self.removeEventListener("resize",this._handleScreenResize),self.removeEventListener("scroll",this._updateDocumentBox),this._destroyBackdrop?.(),this._onStateUpdate.clear(),this._parent.removeEventListener("transitionend",this._postReset),clearTimeout(this._timeout),this._mouseOverBinding?.destroy(),this._mouseOutBinding?.destroy(),this._mouseDownBinding?.destroy(),this._mouseUpBinding?.destroy(),this._mouseMoveBinding?.destroy()}adjustPosition(){const{height:e}=this._domMeasurement.getContentBox(this._parent);this._domMeasurement.clearCache(),this._adjustPositionBottom(this._parent.offsetHeight,e)}destroyDomMeasurementCache(){this._domMeasurement.clearCache()}_reset(){this._parent.addEventListener("transitionend",this._postReset,{once:!0}),this._domMeasurement.removeStyle(this._parent,"transform"),this._resetPositioning(),this._isDraggingEnabled=!1,this._isDraggable=!1,this._isDragging=!1,this._isDetached=!1,this._isInSnapProximity=!1,this._isResetting=!0,this._update()}
599_update(){const e={isDraggingEnabled:this._isDraggingEnabled,isDraggable:this._isDraggable,isDragging:this._isDragging,isDetached:this._isDetached,isInSnapProximity:this._isInSnapProximity,isResetting:this._isResetting,coordinates:this._coordinates};this._onStateUpdate.forEach((t=>t(e)))}_stopPropagation(e){e.stopImmediatePropagation(),e.preventDefault()}_switchToFixedPositioning(){if(this._isDetached)return;const e=this._domMeasurement.getComputedStyle(this._parent),t={},n=(0,i.isString)(this._parent.style.top);"fixed"!==e.position&&(t.position="fixed",this._coordinates.position=t.position);const{top:s}=this._domMeasurement.getDocumentScroll(),{height:r}=this._domMeasurement.getDocumentVisibleBox(),o=this._domMeasurement.getBorderBox(this._parent);t.bottom=r-(o.top-s+this._parent.offsetHeight)+"px",this._coordinates.bottom=t.bottom,n&&(this._domMeasurement.removeStyle(this._parent,"top"),this._coordinates.top=""),this._domMeasurement.setStyles(this._parent,t,!0)}_resetPositioning(){if(!this._isDetached)return;const{top:e}=this._domMeasurement.getContentBox(this._parent,!0);this._domMeasurement.removeStyles(this._parent,["position","bottom"]),this._coordinates.position="",this._coordinates.bottom="",this._coordinates.top=`${e}px`,this._domMeasurement.setStyles(this._parent,{top:`${e}px`},!0)}_adjustPositionBottom(e,t){const n=parseInt(this._domMeasurement.getComputedStyle(this._parent).bottom,10),s=e-t;this._domMeasurement.setStyles(this._parent,{bottom:n-s+"px"},!0)}_getDelta(e,t){if(!this._previousCoords)return{x:0,y:0};const n=e-this._previousCoords.x,s=t-this._previousCoords.y;return this._previousCoords={x:e,y:t},{x:n,y:s}}_getFencedHorizontalValue(e){const t=parseInt(this._domMeasurement.getStyle(this._parent,"left"),10),n=Number.isNaN(t)?1:t+e,s=this._documentBox.right-this._domMeasurement.getContentBox(this._parent).width-1;return(0,r.clamp)(1,n,s)}_getFencedVerticalValue(e){const t=parseInt(this._domMeasurement.getStyle(this._parent,"bottom"),10),n=Number.isNaN(t)?1:t-e,s=this._documentBox.height-this._domMeasurement.getContentBox(this._parent).height-1;return(0,r.clamp)(1,n,s)}_isPromiximityBelow({x:e,y:t},n){return!1}_insertBackdrop(){const{ownerDocument:e}=this._parent,t=this._backdrop=(0,r.createContainerElement)(e,l.BACKDROP_ELEMENT_NAME),n=["over","out","down"].flatMap((e=>[`mouse${e}`,`pointer${e}`])).map((e=>(0,r.addUseCaptureEvent)(t,e,this._stopPropagation))),s=parseInt(this._domMeasurement.getStyle(this._parent,"z-index"));return this._domMeasurement.setStyles(t,{display:"block",position:"fixed",top:"0",right:"0",bottom:"0",left:"0","z-index":s.toString(),"user-select":"none",overflow:"hidden",cursor:"grabbing"},!0),this._domMeasurement.setStyles(this._parent,{"z-index":String(s-1)},!0),this._backdropRoot.append(t),()=>{n.forEach((({destroy:e})=>e())),this._backdrop?.remove(),this._backdrop=void 0}}getPreviousCoords(){return this._previousCoords}getDragHandle(){return this._handle}get isDragging(){return this._isDragging}}l.BACKDROP_ELEMENT_NAME=`${a}-dragging-backdrop`,l.ATTR_HANDLE=`data-${a}-drag-handle`,l.CARD_SNAP_BACK_PROXIMITY_THRESHOLD=30;const c=l},
599"./react/components/card-base/hooks.ts":
600/*!*********************************************!*\
601  !*** ./react/components/card-base/hooks.ts ***!
602  \*********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{BaseCardContextProvider:()=>a,useBaseCardContext:()=>l,useDeferInitialUpdatePosition:()=>u,useDraggable:()=>d,useUpdatePositionOnModeChange:()=>h});var s=n(/*! react */"react"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! ./draggable */"./react/components/card-base/draggable.ts");const o=(0,s.createContext)({isDetached:!1,updateCardPosition:()=>{},moveCardIntoViewport:()=>{},adjustPosition:()=>{}});o.displayName="LTUpdateCardPositionContext";const a=o.Provider,l=()=>(0,s.useContext)(o),c=(e,t)=>{const n=Object.entries(t);let s=!1;for(const[t,r]of n)if(r!==e[t]){s=!0;break}return s?{...e,...t}:e},d=(e,t,n)=>{const r=(0,s.useRef)(null),o=(0,s.useRef)({adjustPosition:()=>{},destroyDomMeasurementCache:()=>{}}),[a,l]=(0,s.useReducer)(c,{isDraggingEnabled:!1,isDraggable:!1,isDragging:!1,isDetached:!1,isInSnapProximity:!1,isResetting:!1});return(0,s.useEffect)((()=>{if(!e||!t||Boolean(r.current))return;const s=r.current=new i.default({onStateUpdate:l,backdropRoot:n,parent:e,handle:t});return s.init(),o.current={adjustPosition:()=>s.adjustPosition(),destroyDomMeasurementCache:()=>s.destroyDomMeasurementCache()},()=>s?.destroy()}),[e,t,n]),[a,o.current]},h=(e,t)=>{const n=(0,s.useRef)(!0);(0,s.useEffect)((()=>{n.current?n.current=!1:t?.()}),[e,t])},u=(e,t)=>{const n=(0,s.useRef)(!1);(0,s.useEffect)((()=>{if(n.current||!(0,r.isFunction)(t)||!e)return;n.current=!0;let s=!0;const i=new ResizeObserver((n=>{for(const r of n){const{width:n,height:o}=r.contentRect;r.target===e&&n>0&&o>0&&(i.disconnect(),t(),s=!1)}}));return i.observe(e),()=>{s&&i.disconnect()}}),[e,t])}},
602"./react/components/card-content/card-content.tsx":
603/*!********************************************************!*\
604  !*** ./react/components/card-content/card-content.tsx ***!
605  \********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{CardContentFooter:()=>g,CardContentTitle:()=>h,CardContentToggleMore:()=>u,default:()=>m});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/utils */"./common/utils.ts"),o=n(/*! ../../../core/utils */"./core/utils.ts"),a=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),l=n(/*! ../../index */"./react/index.ts"),c=n(/*! ../icon/icon */"./react/components/icon/icon.tsx");const d=(0,l.elementFactory)("comp-card-content"),h=({prefix:e,children:t})=>(0,s.jsxs)(l.Div,{className:"lt-comp-card-content__title",children:[e&&(0,s.jsx)(l.Div,{className:"lt-comp-card-content__title__prefix",children:e}),t]}),u=({showAll:e,className:t,"data-lt-testid":n,onToggle:o})=>{const c=(0,l.useI18nContext)(),{current:d}=(0,r.useRef)({cardContentShowAll:c("cardContentShowAll"),cardContentShowSubset:c("cardContentShowSubset")}),h=(0,a.default)((()=>{o()})),u=(0,r.useMemo)((()=>e?(0,s.jsx)("svg",{width:"12",height:"2",viewBox:"0 0 12 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M1 1L11 1",stroke:"currentColor",strokeLinecap:"round"})}):(0,s.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6 1L6 11M1 6L11 6",stroke:"currentColor",strokeLinecap:"round"})})),[e]),g=e?d.cardContentShowSubset:d.cardContentShowAll;return(0,s.jsxs)(l.Div,{className:(0,i.classes)("lt-comp-card-content__toggle-more",t),onClick:h,"data-lt-testid":n,"data-lt-tabindex":"0",children:[(0,s.jsx)(l.Span,{className:"lt-comp-card-content__toggle-more__label",children:g}),u]})},g=({className:e,children:t})=>(0,s.jsx)(l.Div,{className:(0,i.classes)("lt-comp-card-content__footer",e),children:t}),m=({className:e,noPadding:t,stacked:n,title:a=null,footer:h,caption:u,controls:g=[],isLoading:m=!1,isIdle:p=!1,children:_})=>{const E=g.filter((e=>null!==e)),f=(0,r.useMemo)((()=>!1===(0,o.isUndefined)(u)||Number(E?.length)>0),[u,E]);return(0,s.jsxs)(d,{className:e,children:[a,(0,s.jsxs)(l.Div,{className:(0,i.classes)("lt-comp-card-content__wrap",!0!==t&&"lt-comp-card-content__wrap--padding",Boolean(n)&&"lt-comp-card-content__wrap--stacked",m&&"lt-comp-card-content__wrap--loading",p&&"lt-comp-card-content__wrap--idle"),children:[f&&(0,s.jsxs)(l.Div,{className:"lt-comp-card-content__header",children:[!1===(0,o.isUndefined)(u)?(0,s.jsx)(l.Span,{className:"lt-comp-card-content__caption","data-lt-selectable":"true",children:u}):(0,s.jsx)(l.Span,{}),Number(E?.length)>0&&(0,s.jsx)(l.Div,{className:"lt-comp-card-content__controls",children:E.map((({icon:e,key:t,className:n,"data-lt-testid":r,onClick:a,tooltip:l})=>(0,s.jsx)(c.default,{name:e,className:(0,i.classes)("lt-comp-card-content__control",n),compact:!0,tooltipInPortal:!0,"data-lt-tabindex":(0,o.isFunction)(a)?"0":void 0,"data-lt-testid":r,onClick:a,tooltip:l},t)))})]}),(0,s.jsx)(l.Div,{className:(0,i.classes)("lt-comp-card-content__content",!0!==t&&"lt-comp-card-content__content--padding"),children:_}),h,p&&(0,s.jsx)(l.Div,{className:"lt-comp-card-content__idle","data-lt-testid":"card-idle"})]})]})}},
605"./react/components/countdown/countdown.tsx":
606/*!**************************************************!*\
607  !*** ./react/components/countdown/countdown.tsx ***!
608  \**************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/utils */"./common/utils.ts"),o=n(/*! ../../../core/utils */"./core/utils.ts"),a=n(/*! ../../index */"./react/index.ts");const l=(0,a.elementFactory)("comp-countdown"),c=e=>Math.max(0,e-Date.now()),d=(e,t)=>{const[n,s]=(0,r.useState)(c(e));return(0,r.useEffect)((()=>{let n=self.setInterval((()=>{const r=c(e);s(r),0===r&&"number"==typeof n&&(self.clearInterval(n),n=null,t?.())}),1e3);return()=>{"number"==typeof n&&self.clearInterval(n)}}),[e,t]),i=n,{seconds:Math.floor(i/1e3%60),minutes:Math.floor(i/1e3/60%60),hours:Math.floor(i/1e3/60/60)};var i},h=({expires:e,digitClass:t,dividerClass:n,onExpired:r})=>{const{seconds:c,minutes:h,hours:u}=d(e,r);return(0,s.jsxs)(l,{children:[(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-countdown__digit",t),children:(0,o.pad)(u)}),(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-countdown__divider",n),children:":"}),(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-countdown__digit",t),children:(0,o.pad)(h)}),(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-countdown__divider",n),children:":"}),(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-countdown__digit",t),children:(0,o.pad)(c)})]})}},
608"./react/components/diff/diff.tsx":
609/*!****************************************!*\
610  !*** ./react/components/diff/diff.tsx ***!
611  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/utils */"./common/utils.ts"),o=n(/*! ../../../content/Diff */"./content/Diff.ts"),a=n(/*! ../../index */"./react/index.ts");const l=(0,a.elementFactory)("comp-diff"),c=e=>{switch(!0){case!0===e.removed:return"lt-comp-diff__item--removed";case!0===e.added:return"lt-comp-diff__item--added";default:return}},d=({from:e,to:t,className:n,isSentenceSplitting:d})=>{const h=(0,r.useMemo)((()=>o.Diff.simplifyReplacements((0,o.createDiff)(e,t))),[e,t]),u=(0,r.useMemo)((()=>h.findIndex((e=>"."===e.value))),[h]);return o.Diff.isRewrite(h)&&!d?(0,s.jsx)(l,{children:o.Diff.toNewString(h)}):(0,s.jsx)(l,{className:n,children:h.map(((e,t)=>e.value?e.removed?null:(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(a.Span,{className:(0,i.classes)("lt-comp-diff__item",c(e)),children:e.value}),d&&t===u&&(0,s.jsx)(a.Div,{className:"lt-comp-diff__item-divider"})]},((e,t)=>[e.value,!0===e.added&&"added",!0===e.removed&&"removed",!e.added&&!e.removed&&"static",t].filter(Boolean).join("-"))(e,t)):null))})}},
611"./react/components/editor-card/context.ts":
612/*!*************************************************!*\
613  !*** ./react/components/editor-card/context.ts ***!
614  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EditorCardContextProvider:()=>i,useEditorCardContext:()=>o});var s=n(/*! react */"react");const r=(0,s.createContext)({isLoading:!1,disablePremiumTeaser:!1}),i=r.Provider,o=()=>(0,s.useContext)(r)},
614"./react/components/editor-card/custom-editor-card.tsx":
615/*!*************************************************************!*\
616  !*** ./react/components/editor-card/custom-editor-card.tsx ***!
617  \*************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../card-base/custom-card-base */"./react/components/card-base/custom-card-base.tsx");const o=(0,r.forwardRef)((function({initialContentProps:e,mode:t,root:n,forwardUpdateContentFn:o,forwardUpdateTextContextFn:a,forwardSetCardIdleFn:l,customEditorCard:c,...d},h){const[u,g]=(0,r.useState)(!1),[m,p]=(0,r.useState)({className:"",mode:t,onToolboxSentenceNavigationVisibilityChange:g});return(0,s.jsx)(i.default,{...d,...m,ref:h,children:c?.render?.({isToolboxSentenceNavigationVisible:u,initialContentProps:e,mode:t,root:n,forwardUpdateContentFn:o,forwardUpdateTextContextFn:a,forwardSetCardIdleFn:l,cardBaseProps:d,cardBaseRef:h,setCustomBaseCardProps:p})})}))},
617"./react/components/editor-card/editor-card.tsx":
618/*!******************************************************!*\
619  !*** ./react/components/editor-card/editor-card.tsx ***!
620  \******************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>E});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../card-base/card-base */"./react/components/card-base/card-base.tsx"),o=n(/*! ../error-content/error-content */"./react/components/error-content/error-content.tsx"),a=n(/*! ../rephrase-content/rephrase-content */"./react/components/rephrase-content/rephrase-content.tsx"),l=n(/*! ../toolbox-content/toolbox-content */"./react/components/toolbox-content/toolbox-content.tsx"),c=n(/*! ../loading-content/loading-content */"./react/components/loading-content/loading-content.tsx"),d=n(/*! ../scrollable-area/scrollable-area */"./react/components/scrollable-area/scrollable-area.tsx"),h=n(/*! ./context */"./react/components/editor-card/context.ts"),u=n(/*! ../../index */"./react/index.ts"),g=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),m=n(/*! ../../../common/utils */"./common/utils.ts"),p=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts");const _=({mode:e,isIdle:t,userCanNavigate:n,disableNavigatePrevBtn:i,disableNavigateNextBtn:o,onNavigateError:a,onNavigateSentence:l})=>{const{isDetached:c,adjustPosition:d}=(0,g.useBaseCardContext)(),h=(0,r.useRef)(null),_=(0,r.useCallback)((()=>{if(!i)switch(e){case"correct":a("previous"),p.TrackerAdapter.trackEvent("Action","editor_card:previous_error");break;case"paraphrase":l("previous"),p.TrackerAdapter.trackEvent("Action","editor_card:previous_sentence");break;default:throw new Error(`Unknown mode "${e}"`)}}),[e,i,a,l]),E=(0,r.useCallback)((()=>{if(!o)switch(e){case"correct":a("next"),p.TrackerAdapter.trackEvent("Action","editor_card:next_error");break;case"paraphrase":l("next"),p.TrackerAdapter.trackEvent("Action","editor_card:next_sentence");break;default:throw new Error(`Unknown mode "${e}"`)}}),[e,o,a,l]),f=(0,r.useMemo)((()=>
620"correct"===e?"editorCardNextIssue":"editorCardNextSentence"),[e]);return(0,r.useEffect)((()=>{!1===h.current&&!0===c&&d(),h.current=c}),[c,d]),c&&n&&e?(0,s.jsx)(u.Div,{className:"lt-comp-editor-base__footer",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Div,{className:(0,m.classes)("lt-comp-editor-base__footer__btn lt-comp-editor-base__footer__btn--prev",t&&"lt-comp-editor-base__footer__btn--idle",i&&"lt-comp-editor-base__footer__btn--disable"),onClick:_,"data-lt-testid":"previous-issue",children:(0,s.jsx)(u.Span,{className:"lt-comp-editor-base__footer__icon lt-icon__arrow_left--blue"})}),(0,s.jsxs)(u.Div,{className:(0,m.classes)("lt-comp-editor-base__footer__btn lt-comp-editor-base__footer__btn--next",t&&"lt-comp-editor-base__footer__btn--idle",o&&"lt-comp-editor-base__footer__btn--disable"),onClick:E,"data-lt-testid":"next-issue",children:[(0,s.jsx)(u.default.Tr,{name:f}),(0,s.jsx)(u.Span,{className:"lt-comp-editor-base__footer__icon lt-icon__arrow_right--blue"})]})]})}):null},E=(0,r.forwardRef)((function({initialContentProps:e,mode:t,root:n,forwardUpdateContentFn:u,forwardUpdateTextContextFn:g,forwardSetCardIdleFn:m,...p},E){const[f,T]=(0,r.useState)(e),[C,v]=(0,r.useState)(),[S,b]=(0,r.useState)(t),{current:x}=(0,r.useRef)(((e,t,n)=>{v(e),b(t),T(n)})),y=(0,r.useCallback)((e=>{(0,l.isToolboxContentBaseProps)(f)&&T({...f,textContext:e})}),[f]),A=(0,r.useCallback)((e=>{(0,l.isToolboxContentBaseProps)(f)||(0,o.isErrorContentProps)(f)?T({...f,isIdle:e}):(0,a.isRephraseContentProps)(f)&&f.paraphrasingsData&&T({...f,paraphrasingsData:{...f.paraphrasingsData,isIdle:e}})}),[f]),k=((e,t,n,i)=>{const d=(0,r.useCallback)((()=>{if(null===n)return(0,s.jsx)(c.default,{});if("paraphrase"===t&&(0,a.isRephraseContentProps)(n))return"correct"===e&&n.synonymsData&&(n.synonymsData.wordIsErroneous=!0),(0,s.jsx)(a.default,{...n});if("correct"===t&&(0,o.isErrorContentProps)(n))return(0,s.jsx)(o.default,{...n});if("toolbox"===t&&(0,l.isToolboxContentBaseProps)(n))return(0,s.jsx)(l.default,{...n,cardId:i});throw new Error(`Invalid card mode "${t}" passed in`)}),[e,t,n,i]),[h,u]=(0,r.useState)(d());return(0,r.useEffect)((()=>{u(d())}),[d]),h})(C,S,f,p.cardId),w=(0,r.useMemo)((()=>(0,o.isErrorContentProps)(f)?f.displayedErrors.length>1:!!(0,a.isRephraseContentProps)(f)&&!!f.paraphrasingsData&&Number(f.sentenceRanges?.length)>1),[f]),R=(0,r.useMemo)((()=>{if((0,o.isErrorContentProps)(f)&&!f.allowCyclicNavigation){const e=f.error?.id;if(!e)return{prev:!1,next:!1};const t=f.displayedErrors;return{prev:t[0].id===e,next:t[t.length-1].id===e}}return{prev:!1,next:!1}}),[f]),L=R.prev,M=R.next,I=(0,r.useMemo)((()=>(0,l.isToolboxContentBaseProps)(f)||(0,l.isToolboxContentBaseProps)(f)?!0===f.isIdle:!!(0,a.isRephraseContentProps)(f)&&!0===f.paraphrasingsData?.isIdle),[f]);return(0,r.useEffect)((()=>{u(x)}),[u,x]),(0,r.useEffect)((()=>{g(y)}),[g,y]),(0,r.useEffect)((()=>{m(A)}),[m,A]),(0,s.jsx)(h.EditorCardContextProvider,{value:{disablePremiumTeaser:p.disablePremiumTeaser,isLoading:null===f},children:(0,s.jsxs)(i.default,{...p,mode:S,ref:E,root:n,children:[(0,s.jsx)(d.default,{scrollerClassName:"lt-comp-editor-card__content",children:k}),(0,s.jsx)(_,{mode:S,isIdle:I,userCanNavigate:w,disableNavigatePrevBtn:L,disableNavigateNextBtn:M,onNavigateError:p.onNavigateError,onNavigateSentence:p.onNavigateSentence})]})})}))},
620"./react/components/error-boundary/error-boundary.tsx":
621/*!************************************************************!*\
622  !*** ./react/components/error-boundary/error-boundary.tsx ***!
623  \************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var s=n(/*! react */"react"),r=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts");class i extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){const[,n="<unknown>"]=String(t?.componentStack).match(/^[^at]+at\s+([^\s]+)/)||[];r.TrackerAdapter.trackError("js","react_error_boundary",`[${n}] ${e.message}`)}render(){return this.state.hasError?null:this.props.children}}const o=i},
623"./react/components/error-content/error-content.tsx":
624/*!**********************************************************!*\
625  !*** ./react/components/error-content/error-content.tsx ***!
626  \**********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A,isErrorContentProps:()=>C});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),o=n(/*! ../../../common/utils */"./common/utils.ts"),a=n(/*! ../../../core/utils */"./core/utils.ts"),l=n(/*! ../../index */"./react/index.ts"),c=n(/*! ../card-content/card-content */"./react/components/card-content/card-content.tsx"),d=n(/*! ../mascot-says/mascot-says */"./react/components/mascot-says/mascot-says.tsx"),h=n(/*! ./hooks */"./react/components/error-content/hooks.ts"),u=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts"),g=n(/*! ../../../common/getBlogUrl */"./common/getBlogUrl.ts"),m=n(/*! ../icon/icon */"./react/components/icon/icon.tsx"),p=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),_=n(/*! ../editor-card/context */"./react/components/editor-card/context.ts"),E=n(/*! ../sentence-splitting-content/sentence-splitting-content */"./react/components/sentence-splitting-content/sentence-splitting-content.tsx"),f=n(/*! ../keyboard-navigation/hooks */"./react/components/keyboard-navigation/hooks.ts"),T=n(/*! ../fix-sentence-content/fix-sentence-content */"./react/components/fix-sentence-content/fix-sentence-content.tsx");function C(e){return(0,i.isObject)(e)&&"type"in e&&"correct"===e.type}const v=({fix:e})=>{const t=(0,h.useFixLabel)(e.type,e.text),n=(0,p.default)(e.onClick),r={className:(0,o.classes)("lt-error-content__suggestion","highlight"===e.type&&"lt-error-content__suggestion--highlight","remove"===e.type&&"lt-error-content__suggestion--remove","delete"===e.type&&"lt-error-content__suggestion--delete",["replace-hyphen","insert-em-dash","insert-em-dash-with-space","insert-en-dash","remove-whitespace"].includes(String(e.type))&&"lt-error-content__suggestion--optional","correct-all"===e.type&&"lt-error-content__suggestion--correct-all"),title:e.title,"data-lt-tabindex":"0","data-lt-testid":"error-fix",onClick:n};return e.html?(0,s.jsx)(l.Span,{...r,dangerouslySetInnerHTML:{__html:e.html}}):(0,s.jsxs)(l.Span,{...r,children:[e.prefix&&(0,s.jsx)(l.Span,{className:"lt-error-content__suggestion-hint",children:e.prefix}),t,e.suffix&&(0,s.jsx)(l.Span,{className:"lt-error-content__suggestion-hint",children:e.suffix})]})},S=({onIgnoreWordTemporarily:e,onIgnoreRuleTemporarily:t})=>{const n=(0,r.useMemo)((()=>({className:"lt-error-content__dismiss","data-lt-tabindex":"0",children:(0,s.jsx)(l.default.Tr,{name:"dismissSuggestions"})})),[]),i=(0,p.default)((t=>e?.(t))),o=(0,p.default)((e=>t?.(e)));switch(!0){case(0,a.isFunction)(e):return(0,s.jsx)(l.Span,{...n,"data-lt-testid":"temporarily-ignore-word",onClick:i});case(0,a.isFunction)(t):return(0,s.jsx)(l.Span,{...n,"data-lt-testid":"temporarily-ignore-rule",onClick:o});default:return null}},b=({fixes:e,changeLanguageAction:t})=>{const n=(0,h.useChangeLanguageActionLabel)(t),i=(0,p.default)((()=>{t?.onClick()}));return(0,s.jsxs)(s.Fragment,{children:[e.map((e=>(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(v,{fix:e}),"correct-all"===e.type&&(0,s.jsx)("br",{})]},e.text+e.html))),t&&(0,s.jsx)(l.Span,{className:"lt-error-content__suggestion lt-error-content__suggestion--optional",onClick:i,"data-lt-tabindex":"0","data-lt-testid":"error-fix",children:n})]})},x=({premiumErrors:e,disablePremiumTeaser:t,onPremiumTeaserClick:n})=>{const i=(0,l.useI18nContext)(),{current:o}=(0,r.useRef)({errorCardAllDoneCaption:i("errorCardAllDoneCaption"),errorCardAllDoneDescription:i("errorCardAllDoneDescription"),errorCardPremiumTeaserCaptionSingular:i("errorCardPremiumTeaserCaptionSingular"),errorCardPremiumTeaserText:i("errorCardPremiumTeaserText"),errorCardPremiumTeaserReadMore:i("errorCardPremiumTeaserReadMore"),errorCardPremiumTeaserGrammarSuggestions:i("errorCardPremiumTeaserGrammarSuggestions"),errorCardPremiumTeaserStyleSuggestions:i("errorCardPremiumTeaserStyleSuggestions"),errorCardPremiumTeaserPunctuationSuggestions:i("errorCardPremiumTeaserPunctuationSuggestions"),errorCardPremiumTeaserCta:i("errorCardPremiumTeaserCta")}),a=(0,r.useMemo)((()=>i("errorCardPremiumTeaserCaptionPlural",[e.length])),[i,e]),{length:c}=e.filter((e=>!e.isPunctuationError&&!e.isStyleError&&!e.isSpellingError)),{length:h}=e.filter((e=>e.isStyleError)),{length:m}=e.filter((e=>e.isPunctuationError)),{length:_}=[c,h,m].filter((e=>e>0)),E=(0,p.default)((()=>{u.EnvironmentAdapter.openWindow((0,g.default)("post/premium-vs-free-product-updates/"))})),f=(0,p.default)((()=>{n?.("addon2-errorcard-hidden-matches")}));return e.length&&!0!==t?(0,s.jsxs)(l.Div,{className:"lt-error-teaser",children:[(0,s.jsx)(l.Div,{className:"lt-error-teaser__caption",children:1===e.length?o.errorCardPremiumTeaserCaptionSingular:a}),(0,s.jsxs)(l.Div,{className:"lt-error-teaser__content",children:[(0,s.jsx)(l.Span,{className:"lt-error-teaser__text",children:o.errorCardPremiumTeaserText}),(0,s.jsx)(s.Fragment,{children:" "}),(0,s.jsx)(l.Span,{className:"lt-error-teaser__read-more",onClick:E,children:o.errorCardPremiumTeaserReadMore})]}),_>1&&(0,s.jsxs)(l.Div,{children:[c>0&&(0,s.jsxs)(l.Div,{className:"lt-error-teaser__stats-row",children:[(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-key",dangerouslySetInnerHTML:{__html:o.errorCardPremiumTeaserGrammarSuggestions}}),(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-value",children:c})]}),h>0&&(0,s.jsxs)(l.Div,{className:"lt-error-teaser__stats-row",children:[(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-key",dangerouslySetInnerHTML:{__html:o.errorCardPremiumTeaserStyleSuggestions}}),(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-value",children:h})]}),m>0&&(0,s.jsxs)(l.Div,{className:"lt-error-teaser__stats-row",children:[(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-key",dangerouslySetInnerHTML:{__html:o.errorCardPremiumTeaserPunctuationSuggestions}}),(0,s.jsx)(l.Span,{className:"lt-error-teaser__stats-value",children:m})]})]}),(0,s.jsx)(l.Div,{className:"lt-error-teaser__cta",onClick:f,children:o.errorCardPremiumTeaserCta})]}):(0,s.jsx)(d.default,{type:"happy",caption:o.errorCardAllDoneCaption,text:o.errorCardAllDoneDescription})},y=({isHiddenMatch:e,trialRemainingDays:t,onPremiumTeaserClick:n,onTurnOffPickyMode:i})=>{const d=(0,l.useI18nContext)(),{current:h}=(0,r.useRef)({popupTrialEndingInDays:d("popupTrialEndingInDays",[String(Math.round(t||0))]),popupTrialEndingTomorrow:d("popupTrialEndingTomorrow"),popupTrialEndingToday:d("popupTrialEndingToday"),dialogPremiumButton:d("dialogPremiumButton"),errorCardHiddenMatchButton:d("errorCardHiddenMatchButton"),errorCardHiddenMatchCaption:d("errorCardHiddenMatchCaption"),errorCardTurnOffPickyModeButton:d("errorCardTurnOffPickyModeButton"),errorCardTurnOffPickyModeCaption:d("errorCardTurnOffPickyModeCaption")});let u,g,p,_,E;switch(!0){case"number"==typeof t&&t<6:p=t>2?(0,a.stripHTMLTags)(h.popupTrialEndingInDays):t>1?(0,a.stripHTMLTags)(h.popupTrialEndingTomorrow):(0,a.stripHTMLTags)(h.popupTrialEndingToday),u="lt-error-content__footer--trial",g="",_=h.dialogPremiumButton,E=e=>{e.stopImmediatePropagation(),n?.("addon2-error-card-trial-running")};break;case e&&(0,a.isFunction)(n):u="lt-error-content__footer--premium",g="premium--small",p=h.errorCardHiddenMatchCaption,_=h.errorCardHiddenMatchButton,E=e=>{e.stopImmediatePropagation(),n?.()};break;case(0,a.isFunction)(i):u="lt-error-content__footer--picky",g="picky--blue",p=h.errorCardTurnOffPickyModeCaption,_=h.errorCardTurnOffPickyModeButton,E=e=>{e.stopImmediatePropagation(),i?.(e)};break;default:return null}return(0,s.jsxs)(c.CardContentFooter,{className:(0,o.classes)("lt-error-content__footer",u),children:[(0,s.jsxs)(l.Div,{className:"lt-error-content__footer__caption",onClick:_?void 0:E,children:[g&&(0,s.jsx)(m.default,{name:g,compact:!0}),p]}),_&&(0,s.jsx)(l.Div,{className:"lt-error-content__footer__btn",onClick:E,children:_})]})},A=({showSentenceSplittingSuggestion:e,errorId:t,errorType:n,title:i,description:o,originalPhrase:d,fixes:u,changeLanguageAction:g,isHiddenMatch:m,trialRemainingDays:C,premiumErrors:v,language:A,inhouseOnly:k,uniqueId:w,showRuleId:R,user:L,isIdle:M,fixSentencePayload:I,onSplitSentenceClick:P,onFixSentenceClick:N,onFixSentenceMouseOver:O,onFixSentenceMouseOut:D,onMoreDetailsClick:H,onPremiumTeaserClick:U,onAddToDictionaryClick:F,onIgnoreWordTemporarily:B,onIgnoreRule:G,onIgnoreRuleTemporarily:j,onTurnOffPickyMode:W})=>{const{isInDOM:$}=(0,l.useRootContext)(),{disablePremiumTeaser:z}=(0,_.useEditorCardContext)(),V=(0,r.useMemo)((()=>(0,a.isString)(o)&&(0,a.isString)(d)),[o,d]),K=(0,r.useMemo)((()=>!1===V&&v.length>0),[V,v]),X=(0,h.useCaption)(i,n,e,V,K,z),q=(0,l.useI18nContext)(),{current:Y}=(0,r.useRef)({turnOffRule:q("turnOffRule"),moreDetails:q("moreDetails"),turnOffPickyMode:q("turnOffPickyMode")}),Z=(0,r.useRef)(0),{setFocusIndex:J,setButtonGroupHash:Q}=(0,f.useKeyboardNavigationContext)(),ee=(0,a.isString)(d)&&e,te=(0,p.default)((e=>{F?.(e)})),ne=(0,a.isFunction)(F)?{key:"add-to-dictionary",icon:"dictionary","data-lt-testid":"add-to-dictionary",onClick:te,tooltip:{label:q("addToDictionaryCaption",d),position:"top-right"}}
626:null,se=(0,p.default)((e=>{G?.(e)})),re=(0,a.isFunction)(G)?{key:"add-to-dictionary",icon:"ignore","data-lt-testid":"ignore-rule",onClick:se,tooltip:{label:Y.turnOffRule,position:"top-right"}}:null,ie=(0,p.default)((()=>{H?.()})),oe=(0,a.isFunction)(H)?{key:"more-details",icon:"info","data-lt-testid":"more-details",onClick:ie,tooltip:{label:Y.moreDetails,position:"top-right"}}:null,ae=(0,r.useMemo)((()=>(0,s.jsx)(y,{isHiddenMatch:m,trialRemainingDays:C,onPremiumTeaserClick:U,onTurnOffPickyMode:W})),[m,C,U,W]);let le;if(V&&(le=[oe,re,ne]),K&&!0!==z&&(le=[{icon:"premium",key:"premium-icon",className:"lt-error-content__premium-icon"}]),Z.current=le?.filter(Boolean).length??0,(0,a.isUndefined)(X)&&V)throw new Error("Either `caption` or `errorType` need to be passed into the ErrorContent component");return(0,r.useEffect)((()=>{if(!$)return;const e=u.map((e=>e.text||e.html)).concat([String(t)]).join("_");(0,a.isNumber)(Z.current)&&(J(Z.current),Z.current=null),Q(e)}),[$,t,u,Q,J]),(0,s.jsxs)(l.Div,{children:[(0,s.jsxs)(c.default,{caption:X,controls:le,footer:ae,isIdle:M,children:[(0,s.jsx)(l.Div,{className:"lt-error-content__description","data-lt-selectable":"true",children:o}),(0,s.jsxs)(l.Div,{className:"lt-error-content__actions-list",children:[(0,s.jsx)(b,{fixes:u,changeLanguageAction:g}),(0,s.jsx)(S,{onIgnoreWordTemporarily:B,onIgnoreRuleTemporarily:j})]}),!ee&&!V&&(0,s.jsx)(x,{premiumErrors:v,disablePremiumTeaser:z,onPremiumTeaserClick:U})]}),(0,a.isString)(d)&&ee&&(0,s.jsx)(E.default,{inhouseOnly:k,uniqueId:w,showRuleId:R,sentence:d,language:A,isIdle:M,user:L,onSuggestionClick:P}),!ee&&I&&(0,s.jsx)(T.default,{sentence:I,isIdle:M,showRuleId:R,onSuggestionClick:N,onSuggestionMouseOver:O,onSuggestionMouseOut:D})]})}},
626"./react/components/error-content/hooks.ts":
627/*!*************************************************!*\
628  !*** ./react/components/error-content/hooks.ts ***!
629  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useCaption:()=>i,useChangeLanguageActionLabel:()=>a,useFixLabel:()=>o});var s=n(/*! react */"react"),r=n(/*! ../../index */"./react/index.ts");const i=(e,t,n,i,o,a)=>{const l=(0,r.useI18nContext)(),{current:c}=(0,s.useRef)({spellingError:l("spellingError"),customSuggestionError:l("customSuggestionError"),suggestionError:l("suggestionError"),punctuationError:l("punctuationError"),grammarError:l("grammarError")});return(0,s.useMemo)((()=>{switch(!0){case o&&!0!==a:return"Premium";case o&&a:case!n&&!i:return"";case Boolean(e)&&"spelling"!==t:return e;case"custom"===t:return c.customSuggestionError;case"spelling"===t:return c.spellingError;case"style"===t:return c.suggestionError;case"punctuation"===t:return c.punctuationError;default:return c.grammarError}}),[c,e,t,n,i,o,a])},o=(e,t)=>{const n=(0,r.useI18nContext)(),{current:i}=(0,s.useRef)({deleteWord:n("deleteWord"),removeExtraWhitespace:n("removeExtraWhitespace"),replaceWithWhitespace:n("replaceWithWhitespace")});switch(!0){case"delete"===e:return i.deleteWord;case"insert-em-dash-with-space"===e:return"Use em dash (—) with spaces";case"insert-em-dash"===e:return"Use em dash (—)";case"insert-en-dash"===e:return"Use en dash (–)";case"remove-whitespace"===e:return i.removeExtraWhitespace;case"replace-hyphen"===e:return i.replaceWithWhitespace;default:return t}},a=e=>{const t=(0,r.useI18nContext)(),{current:n}=(0,s.useRef)({switchToCanadianEnglish:t("switchToCanadianEnglish"),switchToAustralianEnglish:t("switchToAustralianEnglish"),switchToNewZealandEnglish:t("switchToNewZealandEnglish"),switchToSouthAfricanEnglish:t("switchToSouthAfricanEnglish"),switchToBritishEnglish:t("switchToBritishEnglish"),switchToAmericanEnglish:t("switchToAmericanEnglish")});if(!e)return"";if(e?.label)return e?.label;if(!e?.labelId)throw new Error("Either `label` or `labelId` need to be passed into the ChangeLanguageAction component");return n[e.labelId]}},
629"./react/components/fix-sentence-content/fix-sentence-content.tsx":
630/*!************************************************************************!*\
631  !*** ./react/components/fix-sentence-content/fix-sentence-content.tsx ***!
632  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../additional-error-suggestion/additional-error-suggestion */"./react/components/additional-error-suggestion/additional-error-suggestion.tsx"),o=n(/*! ../../index */"./react/index.ts"),a=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts");const l=({sentence:e,isIdle:t,showRuleId:n,onSuggestionClick:l,onSuggestionMouseOver:c,onSuggestionMouseOut:d})=>{const h=(0,o.useI18nContext)(),{current:u}=(0,r.useRef)({apply:h("fixSentenceCardHeadlineApply"),loading:h("fixSentenceCardHeadlineLoading"),missing:h("fixSentenceCardHeadlineMissing")}),g=(0,r.useMemo)((()=>(e=>{const t=(e=>{const t=[],n=e.includedErrors.length-1;for(let s=0;s<=n;s++){const r=e.includedErrors[s],i=s<n?e.includedErrors[s+1]:void 0,o={prefix:"",suffix:""};0===s&&(o.prefix=e.content.slice(0,r.start)),o.suffix=i?e.content.slice(r.end,i.start):e.content.slice(r.end),t.push(o)}return t})(e);let n=e.includedErrors.length-1,s="";for(;n>=0;n--){const r=t[n]||{prefix:"",suffix:""},i=e.includedErrors[n].fixes[0].value;s=r.prefix+i+r.suffix+s}return s})(e)),[e]),m=(0,a.default)((t=>{g&&l(e,g,!t.isTrusted&&t.shiftKey)})),p=(0,a.default)((()=>c(e.includedErrors.map((({id:e})=>String(e)))))),_=(0,a.default)((()=>d()));return(0,s.jsx)(i.default,{caption:u,error:null,isIdle:t,isLoading:!1,showRuleId:n,suggestion:{text:e.content,label:"fix-sentence",uuid:"<irrelevant>",origin:"<none>",score:{a:1}},onClick:m,onSuggestionMouseOver:p,onSuggestionMouseOut:_,children:(0,s.jsx)(o.Div,{className:"lt-comp-fix-sentence-suggestion",children:g})})}},
632"./react/components/icon/icon.tsx":
633/*!****************************************!*\
634  !*** ./react/components/icon/icon.tsx ***!
635  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/utils */"./common/utils.ts"),o=n(/*! ../../index */"./react/index.ts"),a=n(/*! ../../../common/domMeasurement */"./common/domMeasurement.ts"),l=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),c=n(/*! ../../../core/utils */"./core/utils.ts");const d=(0,o.elementFactory)("comp-icon"),h=["light","dark"],u=e=>{const t="data-lt-force-appearance",n=e.closest(`[${t}]`),s=n?.getAttribute(t);if(r=s,!h.includes(String(r)))throw new Error(`Failed to retrieve appearance for element <${e.tagName.toLowerCase()} class="${e.className}" />`);var r;return s},g=(e,t)=>{if(!0!==t)return e;switch(e){case"left-bottom":return"right-bottom";case"bottom-left":return"bottom-right";case"left-top":return"right-top";case"top-left":return"top-right";case"right-bottom":return"left-bottom";case"bottom-right":return"bottom-left";case"right-top":return"left-top";case"top-right":return"top-left";case"left-center":return"right-center";case"right-center":return"left-center";default:return e}},m=({"data-lt-tabindex":e,"data-lt-testid":t,tooltipInPortal:n,...h})=>{const m=(0,r.useRef)(null),p=(0,r.useRef)(null),_=(0,r.useRef)(null),E=(0,r.useRef)(null),f=(0,r.useRef)(null),T=(0,r.useRef)(null),[C,v]=(0,r.useState)(!1),[S,b]=(0,r.useState)(!1),x=(0,l.default)((e=>{h.tooltip&&v(!1),h.onClick?.(e)}));return(0,r.useEffect)((()=>{!0===C&&p.current&&m.current&&((e,t)=>{const n=t.getBoundingClientRect(),s=e.getBoundingClientRect().toJSON(),{innerWidth:r,innerHeight:o}=t.ownerDocument.defaultView;if(s.left<0){const t={...s,left:8,right:s.right+Math.abs(s.left)+8};(0,i.isRectsIntersect)(n,t)?(e.style.setProperty("left",`${n.width+8}px`,"important"),e.style.setProperty("right","unset","important")):e.style.setProperty("right",s.left-8+"px","important")}if(s.right>r){const t={...s,left:s.left-s.right+r-8,right:r-8};(0,i.isRectsIntersect)(n,t)?(e.style.setProperty("right",`${n.width+8}px`,"important"),e.style.setProperty("left","unset","important")):e.style.setProperty("left",r-s.right-8+"px","important")}if(s.top<0){const t={...s,top:8,bottom:s.bottom+Math.abs(s.top)+8};(0,i.isRectsIntersect)(n,t)?(e.style.setProperty("top",`${n.height+s.height+8}px`,"important"),e.style.setProperty("bottom","unset","important")):e.style.setProperty("bottom",s.top-8+"px","important")}if(s.bottom>o){const t={...s,top:s.top-s.bottom+o-8,bottom:o-8};(0,i.isRectsIntersect)(n,t)?(e.style.setProperty("bottom",`${n.height+s.height+8}px`,"important"),e.style.setProperty("top","unset","important")):e.style.setProperty("top",o-s.bottom-8+"px","important")}})(p.current,m.current)}),[C]),(0,r.useEffect)((()=>{if(!0===S&&p.current&&!E.current){const e=p.current.ownerDocument,t=u(p.current);f.current=f.current||new a.DomMeasurement(e);const{left:n,top:s}=p.current.getBoundingClientRect(),{animation:r}=f.current.getComputedStyle(p.current);_.current||(_.current=p.current.cloneNode(!0),f.current.setStyles(p.current,{visibility:"hidden"},!0)),E.current=((e,t)=>{const n=(0,i.createContainerElement)(e,"lt-portal");return n.style.display="none",n.setAttribute("data-lt-adjust-appearance","true"),n.setAttribute("data-lt-force-appearance",t),n})(e,t),f.current.setStyles(E.current,{position:"fixed",left:`${n}px`,top:`${s}px`,"z-index":"2147483647"},!0),f.current.setStyles(_.current,{animation:r},!0),E.current.appendChild(_.current),document.body.appendChild(E.current)}return!1===S&&E.current&&(E.current.remove(),E.current=null),()=>{E.current?.remove()}}),[S,p,_,E,f]),(0,s.jsxs)(d,{onClick:(0,c.isFunction)(h.onClick)?x:void 0,onMouseOver:e=>{h.onMouseOver?.(e),T.current=self.setTimeout((()=>{h.tooltip&&v(!0),n&&b(!0)}),200)},onMouseOut:e=>{h.onMouseOut?.(e),h.tooltip&&v(!1),n&&b(!1),T.current&&(clearTimeout(T.current),T.current=null)},ref:m,className:(0,i.classes)(`lt-icon--${h.name}`,h.compact&&"lt-icon--compact",h.className,"function"==typeof h.onClick&&"lt-icon--clickable"),"data-lt-prevent-focus":h.preventFocus,"data-lt-tabindex":e,"data-lt-testid":t,children:[(0,s.jsx)(o.Span,{className:(0,i.classes)("lt-icon__icon",`lt-icon__${h.name}`)}),C&&h.tooltip&&(0,s.jsx)(o.Div,{className:(0,i.classes)("lt-icon__tooltip",`lt-icon__tooltip--${g(h.tooltip.position,h.isRTL)}`,`lt-icon__tooltip--${h.name}`),ref:p,children:h.tooltip.label}),h.label&&(0,s.jsx)(o.Span,{className:"lt-icon__label",children:h.label})]})}},
635"./react/components/keyboard-navigation-hint/keyboard-navigation-hint.tsx":
636/*!********************************************************************************!*\
637  !*** ./react/components/keyboard-navigation-hint/keyboard-navigation-hint.tsx ***!
638  \********************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts");const o=(0,i.elementFactory)("comp-keyboard-navigation-hint"),a=({className:e})=>{const t=(0,i.useI18nContext)(),{current:n}=(0,r.useRef)({errorCardKeyboardInstructions:t("errorCardKeyboardInstructions",["<lt-em>Enter</lt-em>","<lt-em>&#8679;</lt-em> <lt-em>Enter</lt-em>"])});return(0,s.jsx)(o,{className:e,dangerouslySetInnerHTML:{__html:n.errorCardKeyboardInstructions}})}},
638"./react/components/keyboard-navigation/context.ts":
639/*!*********************************************************!*\
640  !*** ./react/components/keyboard-navigation/context.ts ***!
641  \*********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{KeyboardNavigationContext:()=>r});var s=n(/*! react */"react");const r=(0,s.createContext)({isEnabled:!1,setFocusIndex:()=>{},getFocusIndex:()=>0,setButtonGroupHash:()=>{}})},
641"./react/components/keyboard-navigation/hooks.ts":
642/*!*******************************************************!*\
643  !*** ./react/components/keyboard-navigation/hooks.ts ***!
644  \*******************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useKeyboardNavigationContext:()=>i});var s=n(/*! react */"react"),r=n(/*! ./context */"./react/components/keyboard-navigation/context.ts");const i=()=>{const{isEnabled:e,setFocusIndex:t,setButtonGroupHash:n,getFocusIndex:i}=(0,s.useContext)(r.KeyboardNavigationContext);return{isEnabled:e,setFocusIndex:t,setButtonGroupHash:n,getFocusIndex:i}}},
644"./react/components/keyboard-navigation/keyboard-navigation.tsx":
645/*!**********************************************************************!*\
646  !*** ./react/components/keyboard-navigation/keyboard-navigation.tsx ***!
647  \**********************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/domMeasurement */"./common/domMeasurement.ts"),o=n(/*! ../../../common/utils */"./common/utils.ts"),a=n(/*! ./context */"./react/components/keyboard-navigation/context.ts"),l=n(/*! ../editor-card/context */"./react/components/editor-card/context.ts");const c=e=>e.filter((e=>e.dataset.ltTabindex&&Number(e.dataset.ltTabindex)>-1)),d=e=>Array.from(e.querySelectorAll("[data-lt-tabindex]")),h=({keyboardEventTarget:e,enableKeyboard:t,root:n,mode:h,children:u,onClose:g})=>{const[m,p]=(0,r.useState)(""),{isLoading:_}=(0,l.useEditorCardContext)(),E=(0,r.useRef)(0),f=(0,r.useMemo)((()=>new i.DomMeasurement(e)),[e]),T=(0,r.useCallback)((e=>{E.current=e}),[]),C=(0,r.useCallback)((()=>E.current),[]),v=(0,r.useCallback)((()=>{const e=d(n);if(!e)return;for(const t of e)t.classList.remove("lt-card__button-focused");
647if(void 0===E.current||!e[E.current])return;const t=c(e)[E.current];t&&(t.classList.add("lt-card__button-focused"),t.scrollIntoView({block:"nearest",inline:"nearest"}))}),[e]);return(0,r.useEffect)((()=>{const{destroy:s}=(0,o.addUseCaptureEvent)(e,"keydown",(e=>{const s=!0===_||"toolbox"!==h;if("Escape"===e.key&&s)return g(e),e.target?.addEventListener("keyup",(e=>e.stopImmediatePropagation()),{once:!0,capture:!0}),void e.stopImmediatePropagation();const r=d(n);if(!t||void 0===E.current||!r?.length)return;const i=c(r);let a=e.key;switch("Tab"===e.key&&(a=e.shiftKey?"ArrowLeft":"ArrowRight"),a){case"ArrowLeft":for(let e=1;e<i.length;e++){let t=E.current-e;if(t<0&&(t+=i.length),(0,o.isVisible)(i[t])){E.current=t;break}}v(),e.stopImmediatePropagation(),e.preventDefault();break;case"ArrowRight":for(let e=1;e<i.length;e++){let t=E.current+e;if(t>=i.length&&(t-=i.length),(0,o.isVisible)(i[t])){E.current=t;break}}v(),e.stopImmediatePropagation(),e.preventDefault();break;case"ArrowUp":{const t=i.map((e=>(0,o.isVisible)(e)?f.getBorderBox(e):null)),n=t[E.current];if(!n)return;const s=t.filter((e=>"number"==typeof e?.bottom&&e?.bottom<=n.top)),r=Math.max(...s.map((e=>e.top))),a=s.filter((e=>e.top===r)),l=(0,o.getClosestXBox)(a,n);if(l)E.current=t.indexOf(l);else for(let e=i.length-1;e>=0;e--)if((0,o.isVisible)(i[e])){E.current=e;break}v(),e.stopImmediatePropagation(),e.preventDefault();break}case"ArrowDown":{const t=i.map((e=>(0,o.isVisible)(e)?f.getBorderBox(e):null)),n=t[E.current];if(!n)return;const s=t.filter((e=>"number"==typeof e?.top&&e?.top>=n.bottom)),r=Math.min(...s.map((e=>e.top))),a=s.filter((e=>e.top===r)),l=(0,o.getClosestXBox)(a,n);if(l)E.current=t.indexOf(l);else for(let e=0;e<i.length;e++)if((0,o.isVisible)(i[e])){E.current=e;break}v(),e.stopImmediatePropagation(),e.preventDefault();break}case"Enter":i[E.current]&&((0,o.simulateMouseClick)(i[E.current],{shiftKey:e.shiftKey}),requestAnimationFrame((()=>v()))),e.stopImmediatePropagation(),e.preventDefault()}}));return()=>s()}),[e,t,m,E,f,_,v,g]),(0,r.useEffect)((()=>{if(!t)return;let e;if(!c(d(n)).length)return e=new MutationObserver((t=>{for(const s of t)"childList"===s.type&&c(d(n)).length&&(e?.disconnect(),e=void 0,v())})),e.observe(n,{childList:!0,subtree:!0}),()=>{e?.disconnect()};v()}),[n,t,e,m,v]),(0,r.useEffect)((()=>{f.clearCache()}),[m,f]),(0,s.jsx)(a.KeyboardNavigationContext.Provider,{value:{isEnabled:t,setFocusIndex:T,getFocusIndex:C,setButtonGroupHash:p},children:u})}},
647"./react/components/loading-content/loading-content.tsx":
648/*!**************************************************************!*\
649  !*** ./react/components/loading-content/loading-content.tsx ***!
650  \**************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),a=n(/*! ../card-content/card-content */"./react/components/card-content/card-content.tsx"),l=n(/*! ../../../common/utils */"./common/utils.ts");const c=()=>{const e=(0,i.useI18nContext)(),{updateCardPosition:t}=(0,o.useBaseCardContext)(),[n,c]=(0,r.useState)(!1),{current:d}=(0,r.useRef)({cardMessageLoadingTimeCaption:e("cardMessageLoadingTimeCaption"),cardMessageLoadingTimeText:e("cardMessageLoadingTimeText")});return(0,r.useEffect)((()=>{const e=self.setTimeout((()=>c(!0)),1e4);return()=>clearTimeout(e)}),[]),(0,r.useEffect)(t,[t]),(0,s.jsx)(a.default,{children:(0,s.jsxs)(i.Div,{className:(0,l.classes)("lt-comp-loading-content",n&&"lt-comp-loading-content--has-message"),children:[!n&&(0,s.jsx)(i.Div,{className:"lt-comp-loading-content__spinner lt-icon__loading"}),n&&(0,s.jsxs)(i.Div,{children:[(0,s.jsx)(i.Div,{className:"lt-comp-loading-content__caption",children:d.cardMessageLoadingTimeCaption}),(0,s.jsx)(i.Div,{className:"lt-comp-loading-content__text",children:d.cardMessageLoadingTimeText})]})]})})}},
650"./react/components/mascot-says/mascot-says.tsx":
651/*!******************************************************!*\
652  !*** ./react/components/mascot-says/mascot-says.tsx ***!
653  \******************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! ../../../common/utils */"./common/utils.ts"),i=n(/*! ../../index */"./react/index.ts");const o=(0,i.elementFactory)("comp-mascot-says"),a=({type:e,caption:t,html:n,text:a})=>(Boolean(n)&&Boolean(a)&&console.warn("<MascotSays /> Got `html` and `text`; will display `html`"),(0,s.jsxs)(o,{children:[(0,s.jsx)(i.Div,{className:(0,r.classes)("lt-comp-mascot-says__image","happy"===e&&"lt-comp-mascot-says__image--happy","sad"===e&&"lt-comp-mascot-says__image--sad","error"===e&&"lt-comp-mascot-says__image--error")}),(0,s.jsx)(i.Div,{className:"lt-comp-mascot-says__caption",children:t}),n&&(0,s.jsx)(i.Div,{className:"lt-comp-mascot-says__text",dangerouslySetInnerHTML:{__html:n}}),!n&&a&&(0,s.jsx)(i.Div,{className:"lt-comp-mascot-says__text",children:a})]}))},
653"./react/components/menu/menu.tsx":
654/*!****************************************!*\
655  !*** ./react/components/menu/menu.tsx ***!
656  \****************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! ../../../common/utils */"./common/utils.ts"),i=n(/*! ../../index */"./react/index.ts");const o=(0,i.elementFactory)("comp-menu"),a=e=>{const{isActive:t,position:n,menuItems:a}=e;return(0,s.jsx)(o,{className:(0,r.classes)(t&&"lt-menu--show","top"===n&&"lt-menu--position-top","bottom"===n&&"lt-menu--position-bottom"),"data-lt-prevent-focus":!0,children:a.map((e=>(0,s.jsx)(i.Div,{className:(0,r.classes)("lt-menu__item","pause"===e.name&&"lt-menu__item--pause","pause"===e.name&&"lt-icon__pause","disable"===e.name&&"lt-menu__item--disable","disable"===e.name&&"lt-icon__disable","disable_circle"===e.name&&"lt-menu__item--disable_circle","disable_circle"===e.name&&"lt-icon__disable_circle",e.isClickable&&"lt-menu__item--clickable"),onClick:t=>((e,t)=>{t.isClickable&&t.onClick(e)})(t,e),onMouseDown:e=>e.preventDefault(),children:(0,s.jsx)(i.Span,{className:(0,r.classes)("lt-menu__item__label","pause"===e.name&&"lt-menu__item__label--pause","disable"===e.name&&"lt-menu__item__label--disable","disable_circle"===e.name&&"lt-menu__item__label--disable_circle"),children:e.label})},e.label)))})}},
656"./react/components/paraphrasing-content/hooks.ts":
657/*!********************************************************!*\
658  !*** ./react/components/paraphrasing-content/hooks.ts ***!
659  \********************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useLoadParaphrasings:()=>u,useUpdateKeyboardNavigation:()=>g});var s=n(/*! react */"react"),r=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ../../../common/languageManager */"./common/languageManager.ts"),o=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts"),a=n(/*! ../../../common/utils */"./common/utils.ts"),l=n(/*! ../../index */"./react/index.ts"),c=n(/*! ../../../config/config */"./config/config.ts"),d=n(/*! ../keyboard-navigation/hooks */"./react/components/keyboard-navigation/hooks.ts"),h=n(/*! ./util */"./react/components/paraphrasing-content/util.ts");const u=({uniqueId:e,sentence:t,language:n,inhouseOnly:d,shouldLoadData:h,user:u})=>{const g=(0,l.useI18nContext)(),{current:m}=(0,s.useRef)({phrasesCardGeneralError:g("phrasesCardGeneralError"),phrasesCardTimeoutError:g("phrasesCardTimeoutError")}),[p,_]=(0,s.useState)(),[E,f]=(0,s.useState)(!1),T=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(!1!==h)return f(!0),T.current=null,r.EnvironmentAdapter.loadPhrases((0,a.hexToUuid)(e),t,n,d,u).then((e=>{_(e),f(!1),o.TrackerAdapter.trackEvent("Action","rephrasesV3:request_succeeded",i.LanguageManager.getPrimaryLanguageCode(n))})).catch((e=>{if(e?.message===c.HTTP_ERROR_ABORT)return;const t=e?.message===c.HTTP_ERROR_TIMEOUT?m.phrasesCardTimeoutError:m.phrasesCardGeneralError;T.current=new Error(t),f(!1),o.TrackerAdapter.trackError("http","rephrasesV3:request_failed",`${i.LanguageManager.getPrimaryLanguageCode(n)}:${e.message}`)})),()=>{r.EnvironmentAdapter.abortPhraseRequests("rewrite")}}),[e,t,n,d,h,u,m.phrasesCardGeneralError,m.phrasesCardTimeoutError]),[p,E,T.current]},g=({phrases:e,shouldShowAllResults:t,showAll:n})=>{const{setButtonGroupHash:r,setFocusIndex:i,getFocusIndex:o}=(0,d.useKeyboardNavigationContext)(),a=(0,s.useRef)(!1);return(0,s.useEffect)((()=>{if(!e)return;if(!1===n&&a.current){const t=o(),{length:n}=e,s=(0,h.showAllResultsInitally)(e)?h.MAX_RESULTS+1:h.MAX_RESULTS;i(t-(n-s)),a.current=!1}const s=e.slice(0,n||t?e.length:h.MAX_RESULTS).map((({uuid:e})=>e)).join("-");r(s)}),[e,n,t,r,i,o]),a}},
659"./react/components/paraphrasing-content/paraphrasing-content.tsx":
660/*!************************************************************************!*\
661  !*** ./react/components/paraphrasing-content/paraphrasing-content.tsx ***!
662  \************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>x});var s=n(/*! react */"react"),r=n(/*! react/jsx-runtime */"react/jsx-runtime"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../card-content/card-content */"./react/components/card-content/card-content.tsx"),a=n(/*! ./hooks */"./react/components/paraphrasing-content/hooks.ts"),l=n(/*! ./util */"./react/components/paraphrasing-content/util.ts"),c=n(/*! ../diff/diff */"./react/components/diff/diff.tsx"),d=n(/*! ../../../common/utils */"./common/utils.ts"),h=n(/*! ../../../core/utils */"./core/utils.ts"),u=n(/*! ../rephrasing-teaser/rephrasing-teaser */"./react/components/rephrasing-teaser/rephrasing-teaser.tsx"),g=n(/*! ../mascot-says/mascot-says */"./react/components/mascot-says/mascot-says.tsx"),m=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),p=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts"),_=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts");const E="https://languagetool.org/premium?utm_campaign=addon2-rewriting",f=e=>(0,h.uniq)(e?.rephrases.map((({label:e})=>e.split("-").shift())).filter((e=>v.includes(e)))||[]),T=()=>{const e=(0,r.jsxs)(i.Div,{className:"lt-comp-paraphrasing-content__loading","data-lt-testid":"loading-skeleton",children:[(0,r.jsx)(i.Span,{className:"lt-comp-paraphrasing-content__loading__line"}),(0,r.jsx)(i.Span,{className:"lt-comp-paraphrasing-content__loading__line"})]});return(0,r.jsx)(r.Fragment,{children:["one","two","three"].map((t=>(0,r.jsx)(s.Fragment,{children:e},t)))})},C=({sentence:e,label:t,origin:n,score:s,text:o,uuid:a,isLast:l,isFirst:h,isRuleDeveloperDebugMode:u,onPhraseClick:g})=>{const m=(0,_.default)((()=>{g({label:t,origin:n,score:s,text:o,uuid:a})}));return(0,r.jsxs)(i.Div,{className:(0,d.classes)("lt-comp-paraphrasing-content__item",h&&"lt-comp-paraphrasing-content__item--first-element",l&&"lt-comp-paraphrasing-content__item--last-element"),onClick:m,"data-lt-testid":"rephrase-suggestion","data-lt-tabindex":"0",children:[u&&(0,r.jsx)(i.Span,{className:"lt-comp-paraphrasing-content__item__origin",children:t}),(0,r.jsx)(c.default,{from:e,to:o,className:"lt-comp-paraphrasing-content__item__diff"})]})},v=["formality","general","paraphrase","shortened","simplicity"],S=({type:e,current:t,onChange:n,getLabel:s})=>{const o=(0,_.default)((()=>n(e)));return(0,r.jsx)(i.Div,{className:(0,d.classes)("lt-comp-paraphrasing-content__filter__list__item",e===t&&"lt-comp-paraphrasing-content__filter__list__item--current"),onClick:o,children:s(e)})},b=({hidden:e,current:t,isIdle:n,availableFilters:o,onChange:a})=>{const{updateCardPosition:l,moveCardIntoViewport:c}=(0,m.useBaseCardContext)(),h=(0,i.useI18nContext)(),{current:u}=(0,s.useRef)({phrasesCardLabelFormality:h("phrasesCardLabelFormality"),phrasesCardLabelParaphrase:h("phrasesCardLabelParaphrase"),phrasesCardLabelShortened:h("phrasesCardLabelShortened"),phrasesCardLabelSimplicity:h("phrasesCardLabelSimplicity"),phrasesCardLabelGeneral:h("phrasesCardLabelGeneral"),phrasesCardFilterEmpty:h("phrasesCardFilterEmpty")}),{current:g}=(0,s.useRef)((e=>{switch(e){case"formality":return u.phrasesCardLabelFormality;case"general":return u.phrasesCardLabelGeneral;case"paraphrase":return u.phrasesCardLabelParaphrase;case"shortened":return u.phrasesCardLabelShortened;case"simplicity":return u.phrasesCardLabelSimplicity;default:return u.phrasesCardFilterEmpty}})),[p,E]=(0,s.useState)(!1),f=(0,_.default)((()=>E(!1))),T=null===t?2:1,C=!0===e||!o||o.length<T;return(0,s.useLayoutEffect)(l,[C,l]),(0,s.useEffect)(c,[C,c]),C?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.Div,{className:(0,d.classes)("lt-comp-paraphrasing-content__filter",n&&"lt-comp-paraphrasing-content__filter--idle"),children:[(0,r.jsx)(i.Div,{className:"lt-comp-paraphrasing-content__filter__label",onClick:()=>E(!0),children:g(t)}),(0,r.jsx)(i.Div,{className:(0,d.classes)("lt-comp-paraphrasing-content__filter__list",p&&"lt-comp-paraphrasing-content__filter__list--visble"),children:[null,...o].map((e=>(0,r.jsx)(S,{type:e,current:t,onChange:a,getLabel:g}
662,String(e))))})]}),p&&(0,r.jsx)(i.Div,{className:"lt-comp-paraphrasing-content__filter-backdrop",onClick:f})]})},x=({inhouseOnly:e,isEnabled:t,language:n,sentence:c,uniqueId:h,user:_,remainingRephrasings:v,noDistanceTop:S,showRuleId:x,isIdle:y,onPhraseClick:A,highlightSentence:k})=>{const{updateCardPosition:w,moveCardIntoViewport:R}=(0,m.useBaseCardContext)(),L=(0,i.useI18nContext)(),{current:M}=(0,s.useRef)({phrasesCardHeadline:L("phrasesCardHeadline"),phrasesCardSentencePrefix:L("phrasesCardSentencePrefix"),synonymsCardLoading:L("synonymsCardLoading"),phrasesCardNoSentence:L("phrasesCardNoSentence"),phrasesCardNoResult:L("phrasesCardNoResult"),phrasesCardNotSupportedHeading:L("phrasesCardNotSupportedHeading"),phrasesCardNotSupportedText:L("phrasesCardNotSupportedText"),phrasesCardRephrasingLimitSingular:L("phrasesCardRephrasingLimitSingular"),phrasesCardGeneralError:L("phrasesCardGeneralError")}),[I,P,N]=(0,a.useLoadParaphrasings)({shouldLoadData:t&&(null===v||v>0),inhouseOnly:e,language:n,sentence:c,uniqueId:h,user:_}
662),[O,D]=(0,s.useState)(null),[H,U]=(0,s.useState)(!1),F=I?.rephrases.filter((({label:e})=>!O||e.startsWith(O))),B=(0,l.showAllResultsInitally)(F),G=!1===B&&Array.isArray(F)&&F.length>l.MAX_RESULTS,j=(0,a.useUpdateKeyboardNavigation)({phrases:F,showAll:H,shouldShowAllResults:B}),W=(0,s.useMemo)((()=>(0,r.jsxs)(o.CardContentTitle,{children:[(0,r.jsx)(i.Span,{className:"lt-comp-paraphrasing-content__title",children:M.phrasesCardHeadline}),(0,r.jsx)(b,{hidden:!I||0===I.rephrases.length,current:O,isIdle:y,availableFilters:f(I),onChange:D})]})),[I,O,y,D,M.phrasesCardHeadline]),$=(0,s.useMemo)((()=>function({children:e}){return(0,r.jsx)(o.default,{title:W,className:(0,d.classes)("lt-comp-paraphrasing-content",S&&"lt-comp-paraphrasing-content--no-distance-top"),noPadding:!0,isIdle:y,children:e})}),[W,S,y]),z=()=>{self.open(E,"_blank")};return(0,s.useEffect)((()=>{p.TrackerAdapter.trackEvent("Action","rephrasesV3:open",n+":"+(t?"enabled":"disabled"))}),[n,t]),(0,s.useEffect)((()=>{const e=O||"default";p.TrackerAdapter.trackEvent("Action","rephrasesV3:set_filter",e)}),[O]),(0,s.useLayoutEffect)(k,[k]),(0,s.useEffect)((()=>{U(!1)}),[I]),(0,s.useLayoutEffect)(w,[I,H,O,w]),(0,s.useEffect)(R,[I,H,O,R]),(0,s.useEffect)((()=>D(null)),[c]),t?0===v?(0,r.jsx)(o.default,{className:"lt-comp-paraphrasing-content",isIdle:y,children:(0,r.jsx)(u.default,{language:n,onCtaClick:z})}):P?(0,r.jsx)($,{children:(0,r.jsx)(T,{})}):N||!F?(0,r.jsx)($,{children:(0,r.jsx)(g.default,{type:"error",caption:N?.message||M.phrasesCardGeneralError})}):0===F.length?(0,r.jsx)($,{children:(0,r.jsx)(g.default,{caption:M.phrasesCardNoResult})}):(0,r.jsxs)($,{children:[(0,r.jsx)(i.Div,{className:"lt-comp-paraphrasing-content__items","data-lt-testid":"rephrase-list",children:F.slice(0,H?F.length:l.MAX_RESULTS).map(((e,t,{length:n},r=n-1)=>(0,s.createElement)(C,{...e,key:e.uuid,sentence:c,isLast:t===r&&!1===G,isFirst:0===t,isRuleDeveloperDebugMode:x,onPhraseClick:A})))}),G&&(0,r.jsx)(o.CardContentToggleMore,{className:"lt-comp-paraphrasing-content__toggle-more",onToggle:()=>{U(!H),j.current=!0},showAll:Boolean(H)})]}):(0,r.jsx)($,{children:(0,r.jsx)(g.default,{type:"sad",caption:M.phrasesCardNotSupportedHeading,html:M.phrasesCardNotSupportedText})})}},
662"./react/components/paraphrasing-content/util.ts":
663/*!*******************************************************!*\
664  !*** ./react/components/paraphrasing-content/util.ts ***!
665  \*******************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MAX_RESULTS:()=>s,showAllResultsInitally:()=>r});const s=3,r=e=>Array.isArray(e)&&e.length<=s+1},
665"./react/components/rephrase-content/rephrase-content.tsx":
666/*!****************************************************************!*\
667  !*** ./react/components/rephrase-content/rephrase-content.tsx ***!
668  \****************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d,isRephraseContentProps:()=>c});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../paraphrasing-content/paraphrasing-content */"./react/components/paraphrasing-content/paraphrasing-content.tsx"),a=n(/*! ../synonyms-content/synonyms-content */"./react/components/synonyms-content/synonyms-content.tsx");const l=(0,i.elementFactory)("comp-rephrase-content");function c(e){return(0,r.isObject)(e)&&"type"in e&&"paraphrase"===e.type}const d=({synonymsData:e,paraphrasingsData:t})=>(0,s.jsxs)(l,{children:[e&&(0,s.jsx)(a.default,{...e}),t&&(0,s.jsx)(o.default,{noDistanceTop:void 0===e,...t})]})},
668"./react/components/rephrasing-teaser/rephrasing-teaser.tsx":
669/*!******************************************************************!*\
670  !*** ./react/components/rephrasing-teaser/rephrasing-teaser.tsx ***!
671  \******************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../config/config */"./config/config.ts"),o=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),a=n(/*! ../../index */"./react/index.ts"),l=n(/*! ../countdown/countdown */"./react/components/countdown/countdown.tsx");const c=(0,a.elementFactory)("comp-rephrasing-teaser"),d=({language:e,onCtaClick:t})=>{const n=(0,a.useI18nContext)(),{current:d}=(0,r.useRef)({rephrasingTeaserCountdownText:n("rephrasingTeaserCountdownText"),rephrasingTeaserCountdownSuffix:n("rephrasingTeaserCountdownSuffix",[i.MAX_FREEMIUM_REPHRASINGS_PER_DAY]),rephrasingTeaserCaption:n("rephrasingTeaserCaption"),rephrasingTeaserDescription:n("rephrasingTeaserDescription"),rephrasingTeaserListItem1:n("rephrasingTeaserListItem1",[i.MAX_TEXT_LENGTH_PREMIUM.toLocaleString(e||void 0)]),rephrasingTeaserListItem2:n("rephrasingTeaserListItem2"),rephrasingTeaserListItem3:n("rephrasingTeaserListItem3"),rephrasingTeaserCta:n("rephrasingTeaserCta")}),h=(()=>{const{current:e}=(0,r.useRef)(new Date);return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),e.getTime()})(),u=[d.rephrasingTeaserListItem1,d.rephrasingTeaserListItem2,d.rephrasingTeaserListItem3],g=(0,o.default)((()=>{t()}));return(0,s.jsxs)(c,{children:[(0,s.jsxs)(a.Div,{className:"lt-comp-rephrasing-teaser__header",children:[(0,s.jsxs)(a.Div,{className:"lt-comp-rephrasing-teaser__countdown",children:[d.rephrasingTeaserCountdownText,(0,s.jsx)(a.Span,{className:"lt-comp-rephrasing-teaser__countdown__suffix",children:d.rephrasingTeaserCountdownSuffix})]}),(0,s.jsx)(l.default,{expires:h,digitClass:"lt-comp-rephrasing-teaser__timer__digit",dividerClass:"lt-comp-rephrasing-teaser__timer__divider"})]}),(0,s.jsx)(a.Div,{className:"lt-comp-rephrasing-teaser__caption",children:d.rephrasingTeaserCaption}),(0,s.jsx)(a.Div,{className:"lt-comp-rephrasing-teaser__description",children:d.rephrasingTeaserDescription}),(0,s.jsx)(a.Div,{className:"lt-comp-rephrasing-teaser__list",children:u.map((e=>(0,s.jsx)(a.Span,{className:"lt-comp-rephrasing-teaser__list-item",dangerouslySetInnerHTML:{__html:e}},e)))}),(0,s.jsx)(a.Span,{className:"lt-comp-rephrasing-teaser__cta",onClick:g,children:d.rephrasingTeaserCta})]})}},
671"./react/components/scrollable-area/scrollable-area.tsx":
672/*!**************************************************************!*\
673  !*** ./react/components/scrollable-area/scrollable-area.tsx ***!
674  \**************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../../common/utils */"./common/utils.ts"),o=n(/*! ../../index */"./react/index.ts");const a=(0,o.elementFactory)("comp-scrollable-area"),l=({scrollerClassName:e,children:t})=>{const n=(0,r.useRef)(null),[l,c]=(0,r.useState)(!1),[d,h]=(0,r.useState)(!1),[u,g]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=n.current,t=()=>{h(null!==e&&e.scrollTop>0),g(null!==e&&e.scrollTop+e.offsetHeight===e.scrollHeight)};return e&&e.addEventListener("scroll",t),()=>{e&&e.removeEventListener("scroll",t)}}),[n]),(0,r.useEffect)((()=>{const e=n.current;let t;return e&&(t=new ResizeObserver((()=>{c((e=>e.clientHeight<e.scrollHeight&&(0,i.isScrollable)(e))(e))})),t.observe(e)),()=>{e&&t?.unobserve(e)}}),[n]),(0,s.jsxs)(a,{className:"lt-comp-scrollable-area",children:[d&&(0,s.jsx)(o.Div,{className:"lt-comp-scrollable-area__shadow lt-comp-scrollable-area__shadow--top"}),(0,s.jsx)(o.Div,{className:(0,i.classes)("lt-comp-scrollable-area__scroller",e),ref:n,children:t}),l&&!1===u&&(0,s.jsx)(o.Div,{className:"lt-comp-scrollable-area__shadow lt-comp-scrollable-area__shadow--bottom"})]})}},
674"./react/components/sentence-splitting-content/hooks.ts":
675/*!**************************************************************!*\
676  !*** ./react/components/sentence-splitting-content/hooks.ts ***!
677  \**************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useLoadSplitSentence:()=>d});var s=n(/*! react */"react"),r=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ../../../common/languageManager */"./common/languageManager.ts"),o=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts"),a=n(/*! ../../../common/utils */"./common/utils.ts"),l=n(/*! ../../index */"./react/index.ts"),c=n(/*! ../../../config/config */"./config/config.ts");const d=({uniqueId:e,sentence:t,language:n,inhouseOnly:d,user:h})=>{const[u,g]=(0,s.useState)(null),[m,p]=(0,s.useState)(!0),[_,E]=(0,s.useState)(null),f=(0,l.useI18nContext)(),{current:T}=(0,s.useRef)({phrasesCardGeneralError:f("phrasesCardGeneralError"),phrasesCardTimeoutError:f("phrasesCardTimeoutError")});return(0,s.useEffect)((()=>(r.EnvironmentAdapter.loadSplitSentence((0,a.hexToUuid)(e),t,n,d,h).then((e=>{g(e);const t=i.LanguageManager.getPrimaryLanguageCode(n);e?o.TrackerAdapter.trackEvent("Action","sentence-splitting:request_succeeded",t):o.TrackerAdapter.trackEvent("Action","sentence-splitting:empty_result",t)})).catch((e=>{if(e?.message===c.HTTP_ERROR_ABORT)return;const t=e?.message===c.HTTP_ERROR_TIMEOUT?T.phrasesCardTimeoutError:T.phrasesCardGeneralError;E(new Error(t)),o.TrackerAdapter.trackError("http","sentence-splitting:request_failed",`${i.LanguageManager.getPrimaryLanguageCode(n)}:${e.message}`)})).finally((()=>p(!1))),()=>{r.EnvironmentAdapter.abortPhraseRequests("sentence-splitting")})),[e,t,n,d,h,T.phrasesCardTimeoutError,T.phrasesCardGeneralError]),[u,m,_]}},
677"./react/components/sentence-splitting-content/sentence-splitting-content.tsx":
678/*!************************************************************************************!*\
679  !*** ./react/components/sentence-splitting-content/sentence-splitting-content.tsx ***!
680  \************************************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../diff/diff */"./react/components/diff/diff.tsx"),a=n(/*! ./hooks */"./react/components/sentence-splitting-content/hooks.ts"),l=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts"),c=n(/*! ../additional-error-suggestion/additional-error-suggestion */"./react/components/additional-error-suggestion/additional-error-suggestion.tsx");const d=({inhouseOnly:e,language:t,sentence:n,uniqueId:d,isIdle:h,user:u,showRuleId:g,onSuggestionClick:m})=>{const p=(0,i.useI18nContext)(),{current:_}=(0,r.useRef)({apply:p("sentenceSplittingCardHeadlineApply"),loading:p("sentenceSplittingCardHeadlineLoading"),missing:p("sentenceSplittingCardHeadlineMissing")}),[E,f,T]=(0,a.useLoadSplitSentence)({inhouseOnly:e,language:t,sentence:n,uniqueId:d,user:u}),C=(0,l.default)((e=>{E&&m(E,!e.isTrusted&&e.shiftKey)}));return(0,s.jsx)(c.default,{suggestion:E,caption:_,error:T,isIdle:h,isLoading:f,showRuleId:g,onClick:C,children:E?.text&&(0,s.jsx)(o.default,{from:n,to:E?.text,isSentenceSplitting:!0})})}},
680"./react/components/synonyms-content/hooks.ts":
681/*!****************************************************!*\
682  !*** ./react/components/synonyms-content/hooks.ts ***!
683  \****************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{useLoadSynonyms:()=>d,useTitle:()=>c,useUpdateKeyboardNavigation:()=>h});var s=n(/*! react */"react"),r=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts"),i=n(/*! ../keyboard-navigation/hooks */"./react/components/keyboard-navigation/hooks.ts"),o=n(/*! ./util */"./react/components/synonyms-content/util.ts"),a=n(/*! ../../../common/languageManager */"./common/languageManager.ts");class l extends Error{constructor(){super("The current language is not supported."),this.name="NotSupportedError"}}const c=(e,t)=>(0,s.useMemo)((()=>{if(!t)return"…";const n=t.genders?.length?(e=>{const[t,...n]=e[0].display.split(/\s+/);return[e.map((({display:e})=>e.split(/\s+/).shift())).join("/"),n.join(" ")].join(" ")})(t.genders):e,[s,r]=n.trim().split(/'| /),i=r?[s,n.includes("'")?"' ":"",r].join(""):s;let o=t.genders?.map((({displayType:e})=>e)).filter(Boolean).join("/");return o=o?` (${o})`:"",i+o}),[e,t]),d=(e,t,n)=>{const[i,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),[h,u]=(0,s.useState)();return(0,s.useEffect)((()=>{if(a.LanguageManager.getSynonymsRequestLanguage(t))return o(!0),r.EnvironmentAdapter.loadSynonyms(e,t,n).then((e=>{d(e)})).catch((e=>u(e))).finally((()=>o(!1))),()=>{r.EnvironmentAdapter.abortSynonymsRequest()};u(new l)}),[e,t,n]),[c,i,h]},h=({synonyms:e,showAll:t})=>{const{setButtonGroupHash:n,setFocusIndex:r}=(0,i.useKeyboardNavigationContext)();(0,s.useEffect)((()=>{if(!e?.synonymSets.length)return;if(!1===t){const[t]=e.synonymSets,n=(0,o.showFullSynonymSetInitially)(t)?t.synonyms.length:o.MAX_INITIAL_SYNONYMS;r(n-1)}const s=e.synonymSets.slice(0,t?e.synonymSets.length:1).flatMap((({synonyms:e})=>e.map((({word:e})=>e)))).join("-");n(s)}),[e,t,n,r])}},
683"./react/components/synonyms-content/synonyms-content.tsx":
684/*!****************************************************************!*\
685  !*** ./react/components/synonyms-content/synonyms-content.tsx ***!
686  \****************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>E});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../card-content/card-content */"./react/components/card-content/card-content.tsx"),o=n(/*! ../../../common/utils */"./common/utils.ts"),a=n(/*! ../../index */"./react/index.ts"),l=n(/*! ./hooks */"./react/components/synonyms-content/hooks.ts"),c=n(/*! ./util */"./react/components/synonyms-content/util.ts"),d=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),h=n(/*! ../../../core/utils */"./core/utils.ts"),u=n(/*! ../../hooks/use-stop-propagation */"./react/hooks/use-stop-propagation.ts");const g=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Div,{className:"lt-comp-synonyms-content__loading__caption"}),(0,s.jsxs)(a.Div,{className:"lt-comp-synonyms-content__loading__wrapper",children:[(0,s.jsx)(a.Span,{className:"lt-comp-synonyms-content__loading__button"}),(0,s.jsx)(a.Span,{className:"lt-comp-synonyms-content__loading__button"}),(0,s.jsx)(a.Span,{className:"lt-comp-synonyms-content__loading__button"})]})]}),m=({word:e,onSynonymClick:t})=>{const n=(0,u.default)((()=>{t(e)}));return(0,s.jsx)(a.Span,{className:"lt-comp-synonyms-content__item__button",onClick:n,"data-lt-tabindex":"0","data-lt-testid":"synonym",children:e})},p=({alternatives:e,synonymsSource:t,showAll:n,onSynonymClick:i})=>{const{updateCardPosition:o,moveCardIntoViewport:l}=(0,d.useBaseCardContext)(),h=(0,u.default)((()=>{t&&self.open(t.url,"_blank")}));return(0,r.useLayoutEffect)(o,[t,n,o]),(0,r.useEffect)(l,[t,n,l]),(0,s.jsxs)(s.Fragment,{children:[e.slice(0,n?e.length:c.MAX_INITIAL_SYNONYMS).map((({word:e},t)=>(0,s.jsx)(m,{word:e,onSynonymClick:i},`${e}-${t}`))),t&&(0,s.jsxs)(a.Div,{className:"lt-comp-synonyms-content__item__source",children:["Source:"," ",(0,s.jsx)(a.Span,{className:"lt-comp-synonyms-content__item__source__link",onClick:h,children:t.name})]})]})},_=({notSupported:e,noResults:t})=>{const n=(0,r.useMemo)((()=>function({children:e}){return(0,s.jsx)(a.Div,{className:"lt-comp-synonyms-content__no-result",children:e})}),[]);switch(!0){case e:return(0,s.jsx)(n,{children:(0,s.jsx)(a.default.Tr,{name:"synonymsCardLanguageNotSupported"})});case t:return(0,s.jsx)(n,{children:(0,s.jsx)(a.default.Tr,{name:"synonymsCardNoSynonymsAvailable"})});default:return null}},E=({wordContext:e,language:t,motherTongue:n,wordIsErroneous:u,isIdle:m,onSynonymClick:E})=>{const{updateCardPosition:f,moveCardIntoViewport:T}=(0,d.useBaseCardContext)(),[C,v]=(0,r.useState)(null),S=(0,a.useI18nContext)(),{current:b}=(0,r.useRef)({synonymsCardHeadline:S("synonymsCardHeadline")}),[x,y,A]=(0,l.useLoadSynonyms)(e,t,n),k=(0,r.useMemo)((()=>{if((0,h.isString)(t)&&!t.startsWith("de")&&x?.dataSource)return{name:x.dataSource.sourceName,url:x.dataSource.sourceUrl}}),[t,x]),w=(0,l.useTitle)(e.word,x),R=(0,s.jsx)(i.CardContentTitle,{prefix:b.synonymsCardHeadline,children:w}),L=!1===y&&0===x?.synonymSets.length,M="NotSupportedError"===A?.name,I=(0,r.useMemo)((()=>x&&x.synonymSets.length>1),[x]),P=C?"collapse-synonyms-list":"show-all-synonyms";return(0,l.useUpdateKeyboardNavigation)({synonyms:x,showAll:C}),(0,r.useLayoutEffect)(f,[x,C,y,I,f]),(0,r.useEffect)(T,[x,C,y,I,T]),(0,r.useEffect)((()=>v(null)),[e]),y&&!0!==u?(0,s.jsx)(i.default,{title:R,isIdle:m,children:(0,s.jsx)(g,{})}):L&&u?null:(0,s.jsxs)(i.default,{title:R,isIdle:m,children:[(0,s.jsx)(_,{noResults:L,notSupported:M}),x?.synonymSets.slice(0,C?x.synonymSets.length:1).map(((e,t,{length:n},r=n-1)=>(0,s.jsxs)(a.Div,{className:(0,o.classes)("lt-comp-synonyms-content__item",I&&"lt-comp-synonyms-content__item--border",0===t&&"lt-comp-synonyms-content__item--first",t===r&&"lt-comp-synonyms-content__item--last"),children:[(0,s.jsx)(a.Div,{className:"lt-comp-synonyms-content__item__title",children:e.title}),(0,s.jsx)(p,{alternatives:e.synonyms,showAll:C||(0,c.showFullSynonymSetInitially)(e)||!1===I,synonymsSource:t!==r||!C&&!1!==I?void 0:k,onSynonymClick:E})]},e.title+e.synonyms.map((({word:e,hints:t})=>`${e}-${t.length}
686`))))),I&&(0,s.jsx)(i.CardContentToggleMore,{className:"lt-comp-synonyms-content__toggle-more","data-lt-testid":P,onToggle:()=>v(!C),showAll:Boolean(C)})]})}},
686"./react/components/synonyms-content/util.ts":
687/*!***************************************************!*\
688  !*** ./react/components/synonyms-content/util.ts ***!
689  \***************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{MAX_INITIAL_SYNONYMS:()=>r,showFullSynonymSetInitially:()=>i});var s=n(/*! ../../../core/utils */"./core/utils.ts");const r=3,i=e=>(0,s.isObject)(e)&&e.synonyms.length<=r+1},
689"./react/components/toolbox-content/toolbox-content.tsx":
690/*!**************************************************************!*\
691  !*** ./react/components/toolbox-content/toolbox-content.tsx ***!
692  \**************************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{ToolboxEventNames:()=>p,default:()=>f,isToolboxContentBaseProps:()=>_});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! @advanced-toolbox/adapters/iframe/host */"../../../node_modules/@advanced-toolbox/adapters/dist/iframe/host.mjs"),o=n(/*! @advanced-toolbox/utils */"../../../node_modules/@advanced-toolbox/utils/dist/index.mjs"),a=n(/*! ../../index */"./react/index.ts"),l=n(/*! ../../../common/utils */"./common/utils.ts"),c=n(/*! ../../../init/config */"./init/config.ts"),d=n(/*! ../../../common/trackerAdapter */"./common/trackerAdapter.ts"),h=n(/*! ../../../common/environmentAdapter */"./common/environmentAdapter.ts"),u=n(/*! ../card-base/hooks */"./react/components/card-base/hooks.ts"),g=n(/*! ../keyboard-navigation/hooks */"./react/components/keyboard-navigation/hooks.ts");const m=c.ExtnConfig.getInstance().get(c.ConfigKey.EXTN_PREFIX),p={turnOffLollipop:`${m}-message.lollipop-turn-off`};function _(e){return(0,o.isObject)(e)&&"type"in e&&"toolbox"===e.type}const E=(0,a.elementFactory)("comp-toolbox-content"),f=({cardId:e,triggerType:t,pageSource:n,pageUri:o,uiLanguage:a,user:p,theme:_,textContext:f,textfieldElement:T,hasDarkBackground:C,sentenceRanges:v,selectedSkill:S,editorText:b,inhouseOnly:x,isIdle:y,close:A,onApply:k,setTextHighlight:w,onPluginSelect:R,removeTextHighlight:L})=>{const{isEnabled:M}=(0,g.useKeyboardNavigationContext)(),{moveCardIntoViewport:I}=(0,u.useBaseCardContext)(),P=(0,r.useMemo)((()=>c.ExtnConfig.getInstance().get(c.ConfigKey.LOLLIPOP_CONFIG)),[]),N=(0,r.useMemo)((()=>h.EnvironmentAdapter.getURL(P.TOOLBOX_IFRAME_PATH)),[P]),O=(0,r.useRef)(null),[D,H]=(0,r.useState)(null),U=(0,r.useRef)(f),F=(0,r.useRef)(!1),B=(0,r.useCallback)((t=>d.TrackerAdapter.trackToolboxEvent(e,t)),[e]);return(0,r.useEffect)((()=>{D&&f!==U.current&&D.updateTextContext(f)}),[f,D]),(0,r.useEffect)((()=>{y?(D?.setIdle(!0),F.current=!0):F.current&&(D?.setIdle(!1),F.current=!1)}),[D,y]),(0,r.useEffect)((()=>{const e=M?"keyboard":t,{current:s}=U,r=C?"dark":"light",l={setTextHighlight:(e,t,n)=>w(e,t,n),onMonitoringEvent:B,enableInitialFocus:"keyboard"===e,focusSearchField:!["dblclick","keyboard"].includes(e),colorScheme:r,onPluginSelect:R,context:s,theme:_,user:p,close:A,onApply:k,removeTextHighlight:L};if(O.current){const t=[],c={sentenceRanges:v.map((([e,n])=>({detectedLanguages:[...t],length:n-e,start:e,end:n}))),uri:o,triggerType:e,colorScheme:r,editorText:b,inhouseOnly:x,uiLanguage:a,pageSource:n};s.locale&&(c.textLocale=s.locale);const d={textfield:T,mount:O.current,url:N,iframeOptions:c,options:l};S&&(d.selectedSkill=S),T.ownerDocument!==O.current.ownerDocument&&(d.eventTarget=T.ownerDocument);const h=i.ToolboxAdapterIframeHost.init(d);return H(h),setTimeout((()=>I())),()=>{h.unmount()}}}),[p,n,o,_,A,k,B,w,L,C,T,N,v,x,b,a,S,t,M,R,I]),(0,r.useEffect)((()=>{S&&B({name:"toolbox:action",data:`select_plugin:${S}`})}),[S,B]),(0,s.jsx)(E,{className:(0,l.classes)(y&&`${m}-toolbox-content--is-idle`),ref:O})}},
692"./react/hooks/use-stop-propagation.ts":
693/*!*********************************************!*\
694  !*** ./react/hooks/use-stop-propagation.ts ***!
695  \*********************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=n(/*! react */"react");const r=e=>(0,s.useCallback)((t=>{t.stopImmediatePropagation(),e(t)}),[e])},
695"./react/index.ts":
696/*!************************!*\
697  !*** ./react/index.ts ***!
698  \************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{Div:()=>h,Span:()=>u,default:()=>g,elementFactory:()=>d,useI18nContext:()=>p,useRootContext:()=>m,useStorageContext:()=>_});var s=n(/*! react */"react"),r=n(/*! react-dom/client */"react-dom/client"),i=n(/*! ../common/utils */"./common/utils.ts"),o=n(/*! ../core/utils */"./core/utils.ts"),a=n(/*! ./components/error-boundary/error-boundary */"./react/components/error-boundary/error-boundary.tsx"),l=n(/*! ../init/config */"./init/config.ts");const c=`${l.default.get(l.ConfigKey.EXTN_PREFIX)}-`,d=e=>{const t=({children:t,className:n,style:r,...a},l)=>{const{onChange:d,onInput:h,onClick:u,onMouseDown:g,onMouseUp:m,onMouseOver:p,onMouseOut:_,onMouseEnter:E,onMouseLeave:f,onMouseMove:T,onPointerDown:C,onPointerUp:v,onScroll:S,onKeyDown:b,onKeyPress:x,onKeyUp:y,...A}=a,k=(0,s.useRef)([]),w=(e=>Object.entries(e).filter((([e,t])=>(0,o.isFunction)(t))).map((([e,t])=>[e.replace("on","").toLowerCase(),t])))({onChange:d,onInput:h,onClick:u,onMouseDown:g,onMouseUp:m,onMouseOver:p,onMouseOut:_,onMouseEnter:E,onMouseLeave:f,onMouseMove:T,onPointerDown:C,onPointerUp:v,onScroll:S,onKeyDown:b,onKeyPress:x,onKeyUp:y}),R=(0,s.useRef)(null),L=(0,s.useMemo)((()=>l||R),[l,R]);return(0,s.useEffect)((()=>{const e=k.current;return L.current&&w.map((([e,t])=>k.current.push((0,i.addUseCaptureEvent)(L.current,e,t)))),()=>e.forEach((({destroy:e})=>e()))}),[w,k,L]),(0,s.useEffect)((()=>{if(!r)return;const e=Object.entries(r);for(const[t,n]of e)L.current.style.setProperty(t,n,"important")}),[L,r]),(0,s.createElement)(c+e,{class:n,ref:L,...A},t)};return t.displayName="COMPONENT_PREFIX + name",(0,s.forwardRef)(t)},h=d("div"),u=d("span");class g{static get RootContext(){return this._rootContext||(this._rootContext=(0,s.createContext)({isInDOM:!1}),this._rootContext.displayName="Lt-RootContext"),this._rootContext}static get I18nContext(){return this._i18nContext||(this._i18nContext=(0,s.createContext)({getMessage:()=>""}),this._i18nContext.displayName="Lt-I18nContext"),this._i18nContext}static get StorageContext(){return this._storageContext||(this._storageContext=(0,s.createContext)({getSettings:()=>({}),getPrivacySettings:()=>({}),hasCustomServer:()=>!1,hasRephrasingEnabled:()=>!1,updateSettings:async()=>{},updatePrivacySettings:async()=>{},addEventListener:()=>{},getCheckSettings:()=>({}),getUIState:()=>({}),updateUIState:async()=>{}}),this._storageContext.displayName="Lt-StorageContext"),this._storageContext}static get Tr(){if(!this._Tr){const e=({name:e,substitutions:t})=>{const n=this._getMessage(e,t);return(0,s.createElement)(s.Fragment,null,n)};e.displayName="LTReact.Tr",this._Tr=(0,s.memo)(e)}return this._Tr}static init(e,t){this._i18nManager=e,this._storageController=t}static createView(e,t,n){return new Promise((o=>{const l=(e=>{if((0,i.isElementNode)(e))return e;if((0,i.isDocumentNode)(e))return e.createElement("lt-span");throw new Error("Passed in base is neither document nor element.")})(e),c=(0,r.createRoot)(l);c.render((0,s.createElement)((()=>
698{const[r,d]=(0,s.useState)(l.parentNode?.nodeType===l.ELEMENT_NODE),h=(0,s.useRef)(r),u=(0,s.useRef)([]),m=(0,s.useCallback)((e=>{null===e||r||(e.append(l),h.current=!0,d(!0))}),[r]),p=(0,s.useCallback)((e=>{null===e||r||(e.prepend(l),h.current=!0,d(!0))}),[r]);return(0,s.useEffect)((()=>{this._storageController.onReady((()=>{o({element:l,appendTo:m,prependTo:p,isInDOM:()=>h.current,unmount:()=>c.unmount()})}))}),[m,p]),(0,s.useEffect)((()=>{const t=u.current;return u.current.push(...(e=>["mousedown","mouseup","pointerdown","pointerup"].map((t=>(0,i.addUseCaptureEvent)(e,t,(e=>{const t=e.target,n=!!t?.closest("[data-tb-allow-mouse-interaction]");"true"===t?.dataset.ltDragHandle||n||e.stopImmediatePropagation(),[t?.dataset.ltSelectable,t?.dataset.ltDragHandle].includes("true")||n||e.preventDefault()})))))(e)),()=>t.forEach((({destroy:e})=>e()))}),[u]),(0,s.createElement)(a.default,null,(0,s.createElement)(g.RootContext.Provider,{value:{isInDOM:r}},(0,s.createElement)(g.I18nContext.Provider,{value:{getMessage:this._getMessage.bind(this)}},(0,s.createElement)(g.StorageContext.Provider,{value:{getSettings:this._storageController.getSettings.bind(this._storageController),getPrivacySettings:this._storageController.getPrivacySettings.bind(this._storageController),hasCustomServer:this._storageController.hasCustomServer.bind(this._storageController),hasRephrasingEnabled:this._storageController.hasRephrasingEnabled.bind(this._storageController),updateSettings:this._storageController.updateSettings.bind(this._storageController),updatePrivacySettings:this._storageController.updatePrivacySettings.bind(this._storageController),addEventListener:this._storageController.addEventListener.bind(this._storageController),getCheckSettings:this._storageController.getCheckSettings.bind(this._storageController),getUIState:this._storageController.getUIState.bind(this._storageController),updateUIState:this._storageController.updateUIState.bind(this._storageController)}},(0,s.createElement)(t,n)))))})))}))}static _getMessage(e,t){return this._i18nManager.getMessage(e,t)}}const m=()=>(0,s.useContext)(g.RootContext),p=()=>{const{getMessage:e}=(0,s.useContext)(g.I18nContext);return e},_=()=>(0,s.useContext)(g.StorageContext)},
698"./react/views/editor-card/editor-card.tsx":
699/*!*************************************************!*\
700  !*** ./react/views/editor-card/editor-card.tsx ***!
701  \*************************************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../components/editor-card/editor-card */"./react/components/editor-card/editor-card.tsx"),o=n(/*! ../../index */"./react/index.ts"),a=n(/*! ../../components/editor-card/custom-editor-card */"./react/components/editor-card/custom-editor-card.tsx");const l=(0,r.forwardRef)((function(e,t){return e.customEditorCard?(0,s.jsx)(a.default,{...e,ref:t}):(0,s.jsx)(i.default,{...e,ref:t})}));async function c(e,t,n=(0,r.createRef)()){return await o.default.createView(e,l,Object.assign(t,{ref:n,root:e}))}l.displayName="EditorCard"},
701"./react/views/icon/icon.tsx":
702/*!***********************************!*\
703  !*** ./react/views/icon/icon.tsx ***!
704  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{EVENT_SET_TEXT_DIRECTION:()=>l,default:()=>d});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! react */"react"),i=n(/*! ../../index */"./react/index.ts"),o=n(/*! ../../components/icon/icon */"./react/components/icon/icon.tsx"),a=n(/*! ../../../common/utils */"./common/utils.ts");const l="lt-icon-view.set-text-direction",c=({root:e,onClick:t,onMouseOver:n,onMouseOut:i,...a})=>{const[c,d]=(0,r.useState)();return(0,r.useEffect)((()=>{const t=e=>{d(e.detail.isRTL)};return e?.addEventListener(l,t),()=>{e?.removeEventListener(l,t)}}),[e,d]),(0,s.jsx)(o.default,{...a,isRTL:c,onClick:t,onMouseOver:n,onMouseOut:i})};async function d(e,t){const n=(0,a.isDocumentNode)(e)?t:{...t,root:e};return await i.default.createView(e,c,n)}c.displayName="IconView"},
704"./react/views/menu/menu.tsx":
705/*!***********************************!*\
706  !*** ./react/views/menu/menu.tsx ***!
707  \***********************************/(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var s=n(/*! react/jsx-runtime */"react/jsx-runtime"),r=n(/*! ../../index */"./react/index.ts"),i=n(/*! ../../components/menu/menu */"./react/components/menu/menu.tsx");const o=e=>(0,s.jsx)(i.default,{...e});async function a(e,t){return await r.default.createView(e,o,t)}o.displayName="MenuView"}
707,"?bb06":
708/*!***************************************!*\
709  !*** webextension-polyfill (ignored) ***!
710  \***************************************/()=>{},react:
711/*!************************************************************************!*\
712  !*** external {"commonjs":"react","commonjs2":"react","root":"React"} ***!
713  \************************************************************************/t=>{"use strict";t.exports=e},"react-dom":
714/*!***********************************************************************************!*\
715  !*** external {"commonjs":"react-dom","commonjs2":"react-dom","root":"ReactDOM"} ***!
716  \***********************************************************************************/e=>{"use strict";e.exports=n},"react-dom/client":
717/*!*******************************************************************************************************!*\
718  !*** external {"commonjs":"react-dom/client","commonjs2":"react-dom/client","root":"ReactDOMClient"} ***!
719  \*******************************************************************************************************/e=>{"use strict";e.exports=s},"react/jsx-runtime":
720/*!**********************************************************************************************************!*\
721  !*** external {"commonjs":"react/jsx-runtime","commonjs2":"react/jsx-runtime","root":"ReactJSXRuntime"} ***!
722  \**********************************************************************************************************/e=>{"use strict";e.exports=t}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";
723/*!****************************!*\
724  !*** ./init/standalone.ts ***!
725  \****************************/a.r(l),a.d(l,{LTAssistant:()=>h.LTAssistant});var e=a(/*! ../common/environmentAdapter */"./common/environmentAdapter.ts"),t=a(/*! ../common/i18nManager */"./common/i18nManager.ts"),n=a(/*! ../common/standaloneEnvironmentAdapter */"./common/standaloneEnvironmentAdapter.ts"),s=a(/*! ../common/standaloneI18nManager */"./common/standaloneI18nManager.ts"),r=a(/*! ../common/standaloneStorageController */"./common/standaloneStorageController.ts"),i=a(/*! ../common/storageController */"./common/storageController.ts"),o=a(/*! ../common/trackerAdapter */"./common/trackerAdapter.ts"),c=a(/*! ../components/messagePopup/messagePopup */"./components/messagePopup/messagePopup.ts"),d=a(/*! ../content/dialog */"./content/dialog.ts"),h=a(/*! ../content/ltAssistant */"./content/ltAssistant.ts"),u=a(/*! ../content/toolbar */"./content/toolbar.ts"),g=(a(/*! ../common/smoothscroll */"./common/smoothscroll.js"),a(/*! ../background/dictionarySync */"./background/dictionarySync.ts")),m=a(/*! ../react/index */"./react/index.ts"),p=a(/*! ../core/userActivity */"./core/userActivity.ts"),_=a(/*! ../common/tracker */"./common/tracker.ts"),E=a(/*! ../common/toolboxStorageAdapter */"./common/toolboxStorageAdapter.ts"),f=a(/*! ../common/standaloneToolboxStorageAdapter */"./common/standaloneToolboxStorageAdapter.ts"),T=a(/*! ../common/standaloneAdvancedToolboxAdapter */"./common/standaloneAdvancedToolboxAdapter.ts"),C=a(/*! ../content/termsOfService */"./content/termsOfService.ts"),v=a(/*! ../common/advancedToolboxAdapter */"./common/advancedToolboxAdapter.ts"),S=a(/*! ../common/trial */"./common/trial.ts");
726/*! (C) Copyright 2020 LanguageTooler GmbH. All rights reserved. */
727t.i18nManager.init(new s.StandaloneI18nManager);const b=new r.StandaloneStorageController;i.StorageControllerFactory.init((e=>(e&&b.onReady(e),b))),E.default.init(new f.StandaloneToolboxStorageAdapter),e.EnvironmentAdapter.init(new n.StandaloneEnvironmentAdapter),v.AdvancedToolboxAdapter.init(new T.StandaloneAdvancedToolboxAdapter),S.Trial.init(),o.TrackerAdapter.init(new _.Tracker),g.DictionarySync.init(),c.MessagePopup.init(),u.Toolbar.init(),d.Dialog.init(
727),C.TermsOfService.init(),p.init(),m.default.init(t.i18nManager,b),document.documentElement.setAttribute("data-lt-script-installed","true")})(),l=l.LTAssistant})(),e.exports=s(n(63696),n(62540),n(78325),n(7470))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.