@limetech/lime-elements 39.44.5 → 39.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/{keycodes-B75-uKOK.js → keycodes-k-EdzcMX.js} +4 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js +20 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +84 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +778 -395
- package/dist/cjs/limel-select.cjs.entry.js +377 -13
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markdown-parser-ChnRAxpZ.js → markdown-parser-YH5HSSgF.js} +36 -56
- package/dist/collection/components/list/list.js +19 -0
- package/dist/collection/components/select/select.js +215 -12
- package/dist/collection/components/select/select.template.js +17 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/editor-config.js +12 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/active-state-utils.js +36 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/list-utils.js +270 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/node-utils.js +15 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js +81 -69
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/list-key-handler.js +44 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +4 -3
- package/dist/collection/util/keycodes.js +3 -0
- package/dist/collection/util/typeahead.js +159 -0
- package/dist/esm/{keycodes-rI0IeKpx.js → keycodes-C4_9qUMP.js} +4 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_8.entry.js +20 -1
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +84 -8
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +779 -396
- package/dist/esm/limel-select.entry.js +378 -14
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{markdown-parser-BSQKleVw.js → markdown-parser-DrxxGLF5.js} +36 -56
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a089b580.entry.js → p-03fd2181.entry.js} +1 -1
- package/dist/lime-elements/{p-fc43fb46.entry.js → p-12fe8fe1.entry.js} +6 -6
- package/dist/lime-elements/p-1f29f482.entry.js +1 -0
- package/dist/lime-elements/{p-bf3c78a8.entry.js → p-2b01c1f2.entry.js} +1 -1
- package/dist/lime-elements/{p-758939be.entry.js → p-2e5d5e79.entry.js} +1 -1
- package/dist/lime-elements/{p-3ea159fd.entry.js → p-38393fb4.entry.js} +1 -1
- package/dist/lime-elements/p-9152d7e1.entry.js +23 -0
- package/dist/lime-elements/{p-1e3cdfa1.entry.js → p-9a04a686.entry.js} +1 -1
- package/dist/lime-elements/p-C4_9qUMP.js +1 -0
- package/dist/lime-elements/{p-B0qhUema.js → p-C9xHOCE_.js} +2 -2
- package/dist/lime-elements/{p-6fbf20c6.entry.js → p-e8df7a2e.entry.js} +1 -1
- package/dist/lime-elements/p-f51b5651.entry.js +1 -0
- package/dist/types/components/select/select.d.ts +76 -1
- package/dist/types/components/select/select.template.d.ts +21 -1
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-command-utils/active-state-utils.d.ts +6 -0
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-command-utils/list-utils.d.ts +68 -0
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-command-utils/node-utils.d.ts +10 -0
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-commands.d.ts +10 -0
- package/dist/types/components/text-editor/prosemirror-adapter/plugins/list-key-handler.d.ts +14 -0
- package/dist/types/components.d.ts +36 -0
- package/dist/types/util/keycodes.d.ts +3 -0
- package/dist/types/util/typeahead.d.ts +101 -0
- package/package.json +3 -3
- package/dist/lime-elements/p-552d0733.entry.js +0 -1
- package/dist/lime-elements/p-845cfda7.entry.js +0 -1
- package/dist/lime-elements/p-8f4273e4.entry.js +0 -23
- package/dist/lime-elements/p-rI0IeKpx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-BGxJfR2f.js";import{t as s}from"./p-Cb9R_zmF.js";import{a,E as n}from"./p-C4_9qUMP.js";const l=class{constructor(e){t(this,e),this.cancel=i(this,"cancel"),this.save=i(this,"save"),this.linkChange=i(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=t=>s.get(t,this.language),this.isValid=t=>{try{new URL(t)}catch(t){return!1}return!0},this.handleKeyDown=t=>{var i;t.key===a&&(this.saveButton&&this.saveButton.focus(),t.preventDefault(),this.isValid(null===(i=this.link)||void 0===i?void 0:i.href)&&this.handleSave(t))},this.handleCancel=t=>{t instanceof KeyboardEvent&&t.key!==n||(t.stopPropagation(),t.preventDefault(),this.cancel.emit())},this.handleSave=t=>{t.stopPropagation(),this.save.emit()},this.handleLinkInputAction=t=>{window.open(this.link.href,"_blank"),t.stopPropagation()},this.handleLinkTitleChange=t=>{var i;this.emitLinkChange(t.detail,null===(i=this.link)||void 0===i?void 0:i.href)},this.handleLinkValueChange=t=>{var i;this.emitLinkChange(null===(i=this.link)||void 0===i?void 0:i.text,t.detail)},this.emitLinkChange=(t,i)=>{this.linkChange.emit({text:t,href:i})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const t=this.textInput.shadowRoot.querySelector("input");t&&requestAnimationFrame((()=>{t.focus()}))}}render(){var t,i;const s=this.isValid(this.link.href);return[e("limel-input-field",{key:"0416f2d94ec54c569455938babfebee34bc1b17c",label:this.getTranslation("editor-link-menu.text"),value:(null===(t=this.link)||void 0===t?void 0:t.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown,ref:t=>this.textInput=t}),e("limel-input-field",{key:"6dfb8808eee203e9aa9e87e3bf3720aae217c5e0",label:this.getTranslation("editor-link-menu.link"),value:(null===(i=this.link)||void 0===i?void 0:i.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown}),e("div",{key:"ee392b700a4293eb2b2121d08bfef852f8b4404e",class:"actions"},e("limel-button",{key:"be9f4711edf45a69f8087341e61fc4183c59ba2d",label:this.getTranslation("cancel"),onClick:this.handleCancel}),e("limel-button",{key:"b958cae7915cc42133e5143589d4f454f8bb2ffa",primary:!0,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:t=>this.saveButton=t,slot:"button"}))]}};l.style=":host(limel-text-editor-link-menu){animation:fade 0.2s ease forwards;animation-delay:0.1s;opacity:0;display:flex;flex-direction:column;gap:0.5rem;padding:0.5rem;max-width:calc(100vw - 2rem);border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-16)}.actions{display:flex;justify-content:end;gap:0.5rem}@keyframes fade{0%{scale:0.86;opacity:0}100%{scale:1;opacity:1}}";export{l as limel_text_editor_link_menu}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as r,F as i,a as s}from"./p-BGxJfR2f.js";import{t as a}from"./p-Cb9R_zmF.js";import{d as o,u as n,r as l,a as c,v as u,b as h}from"./p-DMNtoJ8I.js";import{I as p}from"./p-Dpg0OkbJ.js";import"./p-B85MJLTf.js";function d(e,t){const r=e||t;return r&&{pdf:"pdf",jpg:"image",jpeg:"image",heic:"image",bmp:"image",png:"image",gif:"image",svg:"image",svgz:"image",ep:"image",eps:"image",avi:"video",flv:"video",h264:"video",mov:"video",mp4:"video",mwv:"video",mkv:"video",mp3:"audio",wav:"audio",wma:"audio",ogg:"audio",txt:"text",json:"text",html:"text",xml:"text",eml:"email",doc:"office",docx:"office",odt:"office",dot:"office",dotx:"office",docm:"office",dotm:"office",pot:"office",ppt:"office",pptx:"office",odp:"office",potx:"office",potm:"office",pps:"office",ppsx:"office",ppsm:"office",pptm:"office",ppam:"office",pages:"office",xls:"office",xlsx:"office",xlsm:"office",xlsb:"office",ods:"office",csv:"office",numbers:"office"}[r.split(".").pop().toLowerCase()]||"unknown"}class f{constructor(e){this.requestFullscreen=()=>{this.enter&&this.enter()},this.exitFullscreen=()=>{this.exit&&this.exit.bind(window.document)()},this.toggle=()=>{const e=window.document;e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement?this.exitFullscreen():this.requestFullscreen()},this.enter=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.enter&&(this.enter=this.enter.bind(e));const t=window.document;this.exit=t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen}isSupported(){return!!this.enter}}const m=new TextEncoder,g=new Uint8Array(256);for(let e=0;e<64;e++)g["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e)]=e;function b(e){let t=3*Math.ceil(e.length/4);const r=e.length;let i=0;e.length%4==3?t--:e.length%4==2?t-=2:"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);const s=new ArrayBuffer(t),a=new Uint8Array(s);for(let t=0;t<r;t+=4){let r=g[e.charCodeAt(t)],s=g[e.charCodeAt(t+1)],o=g[e.charCodeAt(t+2)],n=g[e.charCodeAt(t+3)];a[i++]=r<<2|s>>4,a[i++]=(15&s)<<4|o>>2,a[i++]=(3&o)<<6|63&n}return s}const v=new Map([["iso-8859-8-i","iso-8859-8"],["iso-8859-8-e","iso-8859-8"]]);function w(e){let t;e=(e||"utf8").trim().toLowerCase(),e=v.get(e)||e;try{t=new TextDecoder(e)}catch(e){t=new TextDecoder("windows-1252")}return t}async function y(e){if("arrayBuffer"in e)return await e.arrayBuffer();const t=new FileReader;return new Promise(((r,i)=>{t.onload=function(e){r(e.target.result)},t.onerror=function(){i(t.error)},t.readAsArrayBuffer(e)}))}function q(e){return(e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70)&&String.fromCharCode(e)}function x(e,t,r){let i,s=e.indexOf("*");if(s>=0&&(e=e.substr(0,s)),"Q"===(t=t.toUpperCase())){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let e=m.encode(r),t=[];for(let r=0,i=e.length;r<i;r++){let s=e[r];if(r<=i-2&&61===s){let i=q(e[r+1]),s=q(e[r+2]);if(i&&s){let e=parseInt(i+s,16);t.push(e),r+=2;continue}}t.push(s)}i=new ArrayBuffer(t.length);let s=new DataView(i);for(let e=0,r=t.length;e<r;e++)s.setUint8(e,t[e])}else i="B"===t?b(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):m.encode(r);return w(e).decode(i)}function k(e){let t=!0;for(;;){let r=(e||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,((e,r,i,s,a)=>t?i!==a||s.length%4!=0||/=$/.test(s)?e:r+"__\0JOIN\0__":e)).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,((e,r,i,s)=>t&&i===s?r+"__\0JOIN\0__":e)).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,((e,t,r,i)=>x(t,r,i)));if(!(t&&r.indexOf("�")>=0))return r;t=!1}}class D{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push("\n")}finalize(){return y(new Blob(this.chunks,{type:"application/octet-stream"}))}}class E{constructor(e){this.decoder=(e=e||{}).decoder||new TextDecoder,this.maxChunkSize=102400,this.chunks=[],this.remainder=""}update(e){let t=this.decoder.decode(e);if(t=t.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=t,this.remainder.length>=this.maxChunkSize){let e,t=4*Math.floor(this.remainder.length/4);t===this.remainder.length?(e=this.remainder,this.remainder=""):(e=this.remainder.substr(0,t),this.remainder=this.remainder.substr(t)),e.length&&this.chunks.push(b(e))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(b(this.remainder)),y(new Blob(this.chunks,{type:"application/octet-stream"}))}}const A=/^=[a-f0-9]{2}$/i,L=/(?==[a-f0-9]{2})/i,S=/=\r?\n/g,T=/=[a-fA-F0-9]?$/;class N{constructor(e){this.decoder=(e=e||{}).decoder||new TextDecoder,this.maxChunkSize=102400,this.remainder="",this.chunks=[]}decodeQPBytes(e){let t=new ArrayBuffer(e.length),r=new DataView(t);for(let t=0,i=e.length;t<i;t++)r.setUint8(t,parseInt(e[t],16));return t}decodeChunks(e){let t=(e=e.replace(S,"")).split(L),r=[];for(let e of t)if("="===e.charAt(0))if(3!==e.length){if(e.length>3){const t=e.substr(0,3);A.test(t)?(r.push(e.substr(1,2)),this.chunks.push(this.decodeQPBytes(r)),r=[],e=e.substr(3),this.chunks.push(e)):(r.length&&(this.chunks.push(this.decodeQPBytes(r)),r=[]),this.chunks.push(e))}}else A.test(e)?r.push(e.substr(1)):(r.length&&(this.chunks.push(this.decodeQPBytes(r)),r=[]),this.chunks.push(e));else r.length&&(this.chunks.push(this.decodeQPBytes(r)),r=[]),this.chunks.push(e);r.length&&this.chunks.push(this.decodeQPBytes(r))}update(e){let t=this.decoder.decode(e)+"\n";if(t=this.remainder+t,t.length<this.maxChunkSize)return void(this.remainder=t);this.remainder="";let r=t.match(T);if(r){if(0===r.index)return void(this.remainder=t);this.remainder=t.substr(r.index),t=t.substr(0,r.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),y(new Blob(this.chunks,{type:"application/octet-stream"}))}}const R=w();class U{constructor(e){if(this.options=e||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0,this.contentType={value:"digest"===(this.options.parentMultipartType||null)?"message/rfc822":"text/plain",default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){this.contentDecoder=/base64/i.test(e)?new E:/quoted-printable/i.test(e)?new N({decoder:w(this.contentType.parsed.params.charset)}):new D}async finalize(){if("finished"===this.state)return;"header"===this.state&&this.processHeaders();let e=this.postalMime.boundaries;for(let t=e.length-1;t>=0;t--)if(e[t].node===this){e.splice(t,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.contentDecoder=!1,this.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}stripComments(e){let t="",r=0,i=!1,s=!1;for(let a=0;a<e.length;a++){const o=e.charAt(a);if(i)0===r&&(t+=o),i=!1;else if("\\"!==o)if('"'!==o||0!==r){if(!s){if("("===o){r++;continue}if(")"===o&&r>0){r--;continue}}0===r&&(t+=o)}else s=!s,t+=o;else i=!0,0===r&&(t+=o)}return t}parseStructuredHeader(e){let t,r={value:!1,params:{}},i=!1,s="",a="value",o=!1,n=!1;for(let l=0,c=(e=this.stripComments(e)).length;l<c;l++)switch(t=e.charAt(l),a){case"key":if("="===t){i=s.trim().toLowerCase(),a="value",s="";break}s+=t;break;case"value":if(n)s+=t;else{if("\\"===t){n=!0;continue}o&&t===o?o=!1:o||'"'!==t?o||";"!==t?s+=t:(!1===i?r.value=s.trim():r.params[i]=s.trim(),a="key",s=""):o=t}n=!1}return s=s.trim(),"value"===a?!1===i?r.value=s:r.params[i]=s:s&&(r.params[s.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),function(e){let t=new Map;Object.keys(e.params).forEach((r=>{let i=r.match(/\*((\d+)\*?)?$/);if(!i)return;let s,a=r.substr(0,i.index).toLowerCase(),o=Number(i[2])||0;t.has(a)?s=t.get(a):(s={charset:!1,values:[]},t.set(a,s));let n=e.params[r];0===o&&"*"===i[0].charAt(i[0].length-1)&&(i=n.match(/^([^']*)'[^']*'(.*)$/))&&(s.charset=i[1]||"utf-8",n=i[2]),s.values.push({nr:o,value:n}),delete e.params[r]})),t.forEach(((t,r)=>{e.params[r]=function(e,t){t=t||"utf-8";let r=[];for(let t=0;t<e.length;t++){let i=e.charAt(t);if("%"===i&&/^[a-f0-9]{2}/i.test(e.substr(t+1,2))){let i=e.substr(t+1,2);t+=2,r.push(parseInt(i,16))}else if(i.charCodeAt(0)>126){i=m.encode(i);for(let e=0;e<i.length;e++)r.push(i[e])}else r.push(i.charCodeAt(0))}const i=new ArrayBuffer(r.length),s=new DataView(i);for(let e=0,t=r.length;e<t;e++)s.setUint8(e,r[e]);return w(t).decode(i)}(t.values.sort(((e,t)=>e.nr-t.nr)).map((e=>e.value)).join(""),t.charset)}))}(r),r}decodeFlowedText(e,t){return e.split(/\r?\n/).reduce(((e,r)=>e.endsWith(" ")&&"-- "!==e&&!e.endsWith("\n-- ")?t?e.slice(0,-1)+r:e+r:e+"\n"+r)).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=w(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){for(let e=this.headerLines.length-1;e>=0;e--){let t=this.headerLines[e];e&&/^\s/.test(t)&&(this.headerLines[e-1]+="\n"+t,this.headerLines.splice(e,1))}this.rawHeaderLines=[];for(let e=this.headerLines.length-1;e>=0;e--){let t=this.headerLines[e],r=t.indexOf(":"),i=r<0?t.trim():t.substr(0,r).trim();this.rawHeaderLines.push({key:i.toLowerCase(),line:t});let s=t.replace(/\s+/g," ");r=s.indexOf(":");let a=r<0?s.trim():s.substr(0,r).trim(),o=r<0?"":s.substr(r+1).trim();switch(this.headers.push({key:a.toLowerCase(),originalKey:a,value:o}),a.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:o,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:o,parsed:{}};break;case"content-disposition":this.contentDisposition={value:o,parsed:{}};break;case"content-id":this.contentId=o;break;case"content-description":this.contentDescription=o}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=!!/^multipart\//i.test(this.contentType.parsed.value)&&this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1),this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:m.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(e){switch(this.state){case"header":if(!e.length)return this.state="body",this.processHeaders();if(this.headerSize+=e.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(R.decode(e));break;case"body":this.contentDecoder.update(e)}}}const B={"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"","⁢":"","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"","​":"","​":"","​":"","≫":"≫","≪":"≪","
":"\n","𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":"\t","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""};function C(e){return e.trim().replace(/[<>"'?&]/g,(e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"}))}function I(e){return[].concat(e.name||[]).concat(e.name?`<${e.address}>`:e.address).join(" ")}function V(e){let t=[],r=(e,i)=>{if(i&&t.push(", "),e.group){let i=";";t.push(`${e.name}:`),e.group.forEach(r),t.push(i)}else t.push(I(e))};return e.forEach(r),t.join("")}function $(e){return`<a href="mailto:${C(e.address)}" class="postal-email-address">${C(e.name||`<${e.address}>`)}</a>`}function j(e){let t=[],r=(e,i)=>{if(i&&t.push('<span class="postal-email-address-separator">, </span>'),e.group){let i=`<span class="postal-email-address-group">${C(e.name)}:</span>`,s='<span class="postal-email-address-group">;</span>';t.push(i),e.group.forEach(r),t.push(s)}else t.push($(e))};return e.forEach(r),t.join(" ")}function z(e){let t=[];if(e.from&&t.push({key:"From",val:I(e.from)}),e.subject&&t.push({key:"Subject",val:e.subject}),e.date){let r="undefined"==typeof Intl?e.date:new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).format(new Date(e.date));t.push({key:"Date",val:r})}e.to&&e.to.length&&t.push({key:"To",val:V(e.to)}),e.cc&&e.cc.length&&t.push({key:"Cc",val:V(e.cc)}),e.bcc&&e.bcc.length&&t.push({key:"Bcc",val:V(e.bcc)});let r=t.map((e=>e.key.length)).reduce(((e,t)=>t>e?t:e),0);t=t.flatMap((e=>{let t=r-e.key.length,i=`${e.key}: ${" ".repeat(t)}`,s=`${" ".repeat(e.key.length+1)} ${" ".repeat(t)}`;return function(e,t){t=t||76;let r,i,s=0,a=(e=(e||"").toString()).length,o="";for(;s<a;){if(r=e.substr(s,t),r.length<t){o+=r;break}(i=r.match(/^[^\n\r]*(\r?\n|\r)/))?(r=i[0],o+=r,s+=r.length):((i=r.match(/(\s+)[^\s]*$/))&&i[0].length-(i[1]||"").length<r.length?r=r.substr(0,r.length-(i[0].length-(i[1]||"").length)):(i=e.substr(s+r.length).match(/^[^\s]+(\s*)/))&&(r+=i[0].substr(0,i[0].length-0)),o+=r,s+=r.length,s<a&&(o+="\r\n"))}return o}(e.val,80).split(/\r?\n/).map((e=>e.trim())).map(((e,t)=>`${t?s:i}${e}`))}));let i=t.map((e=>e.length)).reduce(((e,t)=>t>e?t:e),0),s="-".repeat(i);return`\n${s}\n${t.join("\n")}\n${s}\n`}function O(e){let t=[];if(e.from&&t.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${$(e.from)}</div>`),e.subject&&t.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${C(e.subject)}</div>`),e.date){let r="undefined"==typeof Intl?e.date:new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).format(new Date(e.date));t.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${C(e.date)}">${C(r)}</div>`)}return e.to&&e.to.length&&t.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${j(e.to)}</div>`),e.cc&&e.cc.length&&t.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${j(e.cc)}</div>`),e.bcc&&e.bcc.length&&t.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${j(e.bcc)}</div>`),`<div class="postal-email-header">${t.length?'<div class="postal-email-header-row">':""}${t.join('</div>\n<div class="postal-email-header-row">')}${t.length?"</div>":""}</div>`}class G{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let e=0,t=this.str.length;e<t;e++){let r=this.str.charAt(e),i=e<t-1?this.str.charAt(e+1):null;this.checkChar(r,i)}return this.list.forEach((t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)})),e}checkChar(e,t){if(this.escaped);else{if(e===this.operatorExpecting)return this.node={type:"operator",value:e},t&&![" ","\t","\r","\n",",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",void(this.escaped=!1);if(!this.operatorExpecting&&e in this.operators)return this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],void(this.escaped=!1);if('"'===this.operatorExpecting&&"\\"===e)return void(this.escaped=!0)}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),"\n"===e&&(e=" "),(e.charCodeAt(0)>=33||[" ","\t"].includes(e))&&(this.node.value+=e),this.escaped=!1}}function H(e,t){let r=(t=t||{})._depth||0;if(r>50)return[];let i=new G(e).tokenize(),s=[],a=[],o=[];if(i.forEach((e=>{"operator"!==e.type||","!==e.value&&";"!==e.value?a.push(e):(a.length&&s.push(a),a=[])})),a.length&&s.push(a),s.forEach((e=>{e=function(e,t){let r,i,s,a=!1,o="text",n=[],l={address:[],comment:[],group:[],text:[],textWasQuoted:[]},c=!1;for(i=0,s=e.length;i<s;i++){let t=e[i],r=i?e[i-1]:null;if("operator"===t.type)switch(t.value){case"<":o="address",c=!1;break;case"(":o="comment",c=!1;break;case":":o="group",a=!0,c=!1;break;case'"':c=!c,o="text";break;default:o="text",c=!1}else t.value&&("address"===o&&(t.value=t.value.replace(/^[^<]*<\s*/,"")),r&&r.noBreak&&l[o].length?(l[o][l[o].length-1]+=t.value,"text"===o&&c&&(l.textWasQuoted[l.textWasQuoted.length-1]=!0)):(l[o].push(t.value),"text"===o&&l.textWasQuoted.push(c)))}if(!l.text.length&&l.comment.length&&(l.text=l.comment,l.comment=[]),a){l.text=l.text.join(" ");let e=[];l.group.length&&H(l.group.join(","),{_depth:t+1}).forEach((t=>{t.group?e=e.concat(t.group):e.push(t)})),n.push({name:k(l.text||r&&r.name),group:e})}else{if(!l.address.length&&l.text.length){for(i=l.text.length-1;i>=0;i--)if(!l.textWasQuoted[i]&&l.text[i].match(/^[^@\s]+@[^@\s]+$/)){l.address=l.text.splice(i,1),l.textWasQuoted.splice(i,1);break}let e=function(e){return l.address.length?e:(l.address=[e.trim()]," ")};if(!l.address.length)for(i=l.text.length-1;i>=0&&(l.textWasQuoted[i]||(l.text[i]=l.text[i].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,e).trim(),!l.address.length));i--);}if(!l.text.length&&l.comment.length&&(l.text=l.comment,l.comment=[]),l.address.length>1&&(l.text=l.text.concat(l.address.splice(1))),l.text=l.text.join(" "),l.address=l.address.join(" "),!l.address&&/^=\?[^=]+?=$/.test(l.text.trim())){const e=k(l.text);if(/<[^<>]+@[^<>]+>/.test(e)){const t=H(e);if(t&&t.length)return t}return[{address:"",name:e}]}r={address:l.address||l.text||"",name:k(l.text||l.address||"")},r.address===r.name&&((r.address||"").match(/@/)?r.name="":r.address=""),n.push(r)}return n}(e,r),e.length&&(o=o.concat(e))})),t.flatten){let e=[],t=r=>{r.forEach((r=>{if(r.group)return t(r.group);e.push(r)}))};return t(o),e}return o}function P(e){for(var t,r="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(e),a=s.byteLength,o=a%3,n=a-o,l=0;l<n;l+=3)r+=i[(16515072&(t=s[l]<<16|s[l+1]<<8|s[l+2]))>>18]+i[(258048&t)>>12]+i[(4032&t)>>6]+i[63&t];return 1==o?r+=i[(252&(t=s[n]))>>2]+i[(3&t)<<4]+"==":2==o&&(r+=i[(64512&(t=s[n]<<8|s[n+1]))>>10]+i[(1008&t)>>4]+i[(15&t)<<2]+"="),r}function F(e){return e.replace(/-(.)/g,((e,t)=>t.toUpperCase()))}function M(e,t,r){if(null==e)return t;if("number"!=typeof e||!Number.isInteger(e)||e<0)throw new TypeError(`${r} must be a non-negative integer`);return e}class _{static async parse(e,t){return new _(t).parse(e)}constructor(e,t=0){this.options=e||{},this.mimeOptions={maxNestingDepth:M(this.options.maxNestingDepth,256,"maxNestingDepth"),maxHeadersSize:M(this.options.maxHeadersSize,2097152,"maxHeadersSize")},this.maxRfc822NestingDepth=M(this.options.maxRfc822NestingDepth,10,"maxRfc822NestingDepth"),this.rfc822NestingDepth=t,this.root=this.currentNode=new U({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,t){let r=this.boundaries;if(r.length&&e.length>2&&45===e[0]&&45===e[1])for(let i=r.length-1;i>=0;i--){let s=r[i];if(e.length<s.value.length+2)continue;let a=!0;for(let t=0;t<s.value.length;t++)if(e[t+2]!==s.value[t]){a=!1;break}if(!a)continue;let o=s.value.length+2,n=!1;e.length>=s.value.length+4&&45===e[s.value.length+2]&&45===e[s.value.length+3]&&(n=!0,o=s.value.length+4);let l=!0;for(let t=o;t<e.length;t++)if(32!==e[t]&&9!==e[t]){l=!1;break}if(l)return n?(await s.node.finalize(),this.currentNode=s.node.parentNode||this.root):(await s.node.finalizeChildNodes(),this.currentNode=new U({postalMime:this,parentNode:s.node,parentMultipartType:s.node.contentType.multipart,...this.mimeOptions})),t?this.finalize():void 0}if(this.currentNode.feed(e),t)return this.finalize()}readLine(){let e=this.readPos,t=this.readPos;for(;this.readPos<this.av.length;){const r=this.av[this.readPos++];if(13!==r&&10!==r&&(t=this.readPos),10===r)return{bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length}}async processNodeTree(){let e={},t=new Set,r=this.textMap=new Map,i=this.forceRfc822Attachments(),s=async(e,a,o)=>{if(a=a||!1,o=o||!1,e.contentType.multipart)"alternative"===e.contentType.multipart?a=e:"related"===e.contentType.multipart&&(o=e);else{const s=this.isInlineMessageRfc822(e)&&!i,n=s&&this.rfc822NestingDepth>=this.maxRfc822NestingDepth;if(s&&!n){const i=new _({...this.mimeOptions,maxRfc822NestingDepth:this.maxRfc822NestingDepth,attachmentEncoding:"arraybuffer"},this.rfc822NestingDepth+1);e.subMessage=await i.parse(e.content),r.has(e)||r.set(e,{});let s=r.get(e);!e.subMessage.text&&e.subMessage.html||(s.plain=s.plain||[],s.plain.push({type:"subMessage",value:e.subMessage}),t.add("plain")),e.subMessage.html&&(s.html=s.html||[],s.html.push({type:"subMessage",value:e.subMessage}),t.add("html")),i.textMap&&i.textMap.forEach(((e,t)=>{r.set(t,e)}));for(let t of e.subMessage.attachments||[])this.attachments.push(t)}else if(this.isInlineTextNode(e)){let i=e.contentType.parsed.value.substr(e.contentType.parsed.value.indexOf("/")+1),s=a||e;r.has(s)||r.set(s,{});let o=r.get(s);o[i]=o[i]||[],o[i].push({type:"text",value:e.getTextContent()}),t.add(i)}else if(e.content){const t=e.contentDisposition?.parsed?.params?.filename||e.contentType.parsed.params.name||null,r={filename:t?k(t):null,mimeType:e.contentType.parsed.value,disposition:e.contentDisposition?.parsed?.value||null};switch(o&&e.contentId&&!n&&(r.related=!0),n&&(r.rfc822DepthExceeded=!0),e.contentDescription&&(r.description=e.contentDescription),e.contentId&&(r.contentId=e.contentId),e.contentType.parsed.value){case"text/calendar":case"application/ics":{e.contentType.parsed.params.method&&(r.method=e.contentType.parsed.params.method.toString().toUpperCase().trim());const t=e.getTextContent().replace(/\r?\n/g,"\n").replace(/\n*$/,"\n");r.content=m.encode(t);break}default:r.content=e.content}this.attachments.push(r)}}for(let t of e.childNodes)await s(t,a,o)};await s(this.root,!1,!1),r.forEach((r=>{t.forEach((t=>{if(e[t]||(e[t]=[]),r[t])r[t].forEach((r=>{switch(r.type){case"text":e[t].push(r.value);break;case"subMessage":switch(t){case"html":e[t].push(O(r.value));break;case"plain":e[t].push(z(r.value))}}}));else{let i;switch(t){case"html":i="plain";break;case"plain":i="html"}(r[i]||[]).forEach((r=>{switch(r.type){case"text":switch(t){case"html":e[t].push("<div>"+C(r.value).replace(/\n/g,"<br />")+"</div>");break;case"plain":e[t].push(function(e){return e.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,((e,t)=>{if("string"==typeof B[e])return B[e];if("#"!==t.charAt(0)||";"!==e.charAt(e.length-1))return e;let r;r="x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10);let i="";return r>=55296&&r<=57343||r>1114111?"�":(r>65535&&(r-=65536,i+=String.fromCharCode(r>>>10&1023|55296),r=56320|1023&r),i+=String.fromCharCode(r),i)}))}(r.value.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,"\n").replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,"\n\n").replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,"\n-------------\n").replace(/<[^>]*>/g," ").replace(/\u0001/g,"\n").replace(/[ \t]+/g," ").replace(/^\s+$/gm,"").replace(/\n\n+/g,"\n\n").replace(/^\n+/,"\n").replace(/\n+$/,"\n")))}break;case"subMessage":switch(t){case"html":e[t].push(O(r.value));break;case"plain":e[t].push(z(r.value))}}}))}}))})),Object.keys(e).forEach((t=>{e[t]=e[t].join("\n")})),this.textContent=e}isInlineTextNode(e){if("attachment"===e.contentDisposition?.parsed?.value)return!1;switch(e.contentType.parsed?.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(e){return"message/rfc822"===e.contentType.parsed?.value&&"inline"===(e.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=r=>{r.contentType.multipart||r.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(r.contentType.parsed.value)&&(e=!0);for(let e of r.childNodes)t(e)};return t(this.root),e}async resolveStream(e){let t=0,r=[];const i=e.getReader();for(;;){const{done:e,value:s}=await i.read();if(e)break;r.push(s),t+=s.length}const s=new Uint8Array(t);let a=0;for(let e of r)s.set(e,a),a+=e.length;return s}async parse(e){if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&"function"==typeof e.getReader&&(e=await this.resolveStream(e)),"string"==typeof(e=e||new ArrayBuffer(0))&&(e=m.encode(e)),(e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e))&&(e=await y(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){const e=this.readLine();await this.processLine(e.bytes,e.done)}await this.processNodeTree();const t={headers:this.root.headers.map((e=>({key:e.key,originalKey:e.originalKey,value:e.value}))).reverse()};for(const e of["from","sender"]){const r=this.root.headers.find((t=>t.key===e));if(r&&r.value){const i=H(r.value);i&&i.length&&(t[e]=i[0])}}for(const e of["delivered-to","return-path"]){const r=this.root.headers.find((t=>t.key===e));if(r&&r.value){const i=H(r.value);i&&i.length&&i[0].address&&(t[F(e)]=i[0].address)}}for(const e of["to","cc","bcc","reply-to"]){const r=this.root.headers.filter((t=>t.key===e));let i=[];r.filter((e=>e&&e.value)).map((e=>H(e.value))).forEach((e=>i=i.concat(e||[]))),i&&i.length&&(t[F(e)]=i)}for(const e of["subject","message-id","in-reply-to","references"]){const r=this.root.headers.find((t=>t.key===e));r&&r.value&&(t[F(e)]=k(r.value))}let r=this.root.headers.find((e=>"date"===e.key));if(r){let e=new Date(r.value);e="Invalid Date"===e.toString()?r.value:e.toISOString(),t.date=e}switch(this.textContent?.html&&(t.html=this.textContent.html),this.textContent?.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,t.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let e of t.attachments||[])e?.content&&(e.content=P(e.content),e.encoding="base64");break;case"utf8":let e=new TextDecoder("utf8");for(let r of t.attachments||[])r?.content&&(r.content=e.decode(r.content),r.encoding="utf8");break;default:throw new Error("Unknown attachment encoding")}return t}}var J,Q,Y,Z,K,W,X;const ee=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp","image/bmp","image/x-icon","image/vnd.microsoft.icon"]);const te=null!==(Q=null===(J=o.protocols)||void 0===J?void 0:J.src)&&void 0!==Q?Q:[],re=Object.assign(Object.assign({},o),{clobberPrefix:"",protocols:Object.assign(Object.assign({},o.protocols),{src:[...te,"data"]}),attributes:Object.assign(Object.assign({},o.attributes),{table:[...null!==(Y=o.attributes.table)&&void 0!==Y?Y:[],"cellPadding","cellSpacing","border","dir","width","height"],font:["color","size","face"],meta:["charset","content","name"],colgroup:[...null!==(Z=o.attributes.colgroup)&&void 0!==Z?Z:[],"span"],col:[...null!==(K=o.attributes.col)&&void 0!==K?K:[],"width","span"],"*":[...null!==(W=o.attributes["*"])&&void 0!==W?W:[],"style","className","id","dataRemoteSrc"]}),tagNames:[...null!==(X=o.tagNames)&&void 0!==X?X:[],"html","head","body","title","meta","style","colgroup","col","center","font"]});function ie(e){const t=[/behavior\s*:/gi,/expression\s*\(/gi,/-moz-binding\s*:/gi,/vbscript\s*:/gi,/javascript\s*:/gi];let r=e;for(const e of t)r=r.replaceAll(e,"");return r=r.replaceAll(/@import\s+(?:url\([^)]{0,2000}\)|[^;]{0,2000});?/gi,""),r=r.replaceAll(/url\(\s{0,50}(?:"([^"]{0,2000})"|'([^']{0,2000})'|([^"')\s]{1,2000}))\s{0,50}\)/gi,((e,t,r,i)=>{var s,a;return(e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:")||t.startsWith("cid:")||t.startsWith("#"))||!t.startsWith("//")&&!/^[a-z][a-z0-9+.-]*:/i.test(t)})((null!==(a=null!==(s=null!=t?t:r)&&void 0!==s?s:i)&&void 0!==a?a:"").trim())?e:'url("")'})),r}async function se(e){const t=await async function(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch email (${t.status} ${t.statusText})`);return await t.arrayBuffer()}catch(t){const r=t instanceof Error?t.message:String(t);throw new Error(`Failed to load email from ${e}: ${r}`)}}(e),r=await async function(e,t){try{return await _.parse(t,{attachmentEncoding:"arraybuffer"})}catch(t){const r=t instanceof Error?t.message:String(t);throw new Error(`Failed to parse email from ${e}: ${r}`)}}(e,t),i={subject:r.subject||void 0,from:de(r.from),to:pe(r.to),cc:pe(r.cc),date:ae(r,"date")||r.date||void 0},{attachments:s,cidUrlById:a}=function(e){const t=[],r=new Map;for(const s of e.attachments||[]){const e=oe(s.contentId),a=Boolean(e)&&"attachment"!==s.disposition||s.related||"inline"===s.disposition,o=(i=s.content)instanceof ArrayBuffer?new Uint8Array(i):ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):void 0;if(!a){t.push({filename:s.filename||void 0,mimeType:s.mimeType||void 0,size:null==o?void 0:o.byteLength});continue}const n=Boolean(o);if(!e||!n){t.push({filename:s.filename||void 0,mimeType:s.mimeType||"application/octet-stream",size:null==o?void 0:o.byteLength});continue}const l=le(s.mimeType,o,s.filename),c=ne(o);r.set(e,`data:${l};base64,${c}`)}var i;return{attachments:t,cidUrlById:r}}(r);return s.length>0&&(i.attachments=s),await async function(e,t,r){const i=(t.html||"").trim();if(i){const t=function(e,t){return 0===t.size?e:e.replaceAll(/(src\s*=\s*["']?)cid:([^"'\s>]+)(["']?)/gi,((e,r,i,s)=>{const a=oe(function(e){try{return decodeURIComponent(e)}catch(t){return e}}(i)),o=t.get(a);return o?`${r}${o}${s}`:e}))}(i,r);e.bodyHtml=await async function(e){const t=await n().use(l).use(c,re).use((()=>e=>{u(e,"element",(e=>{!function(e){var t;if((null==e?void 0:e.tagName)&&((null===(t=e.properties)||void 0===t?void 0:t.style)&&"string"==typeof e.properties.style&&(e.properties.style=ie(e.properties.style)),"style"===e.tagName&&Array.isArray(e.children)))for(const t of e.children)"text"===(null==t?void 0:t.type)&&"string"==typeof t.value&&(t.value=ie(t.value))}(e),function(e){var t;if(!(null==e?void 0:e.tagName)||"img"!==e.tagName)return;const r=null===(t=e.properties)||void 0===t?void 0:t.src;if("string"!=typeof r)return;const i=function(e){const t=e.trim();if(!t)return;if(!t.toLowerCase().startsWith("data:"))return;const r=function(e){var t;const r=/^data:([^;,]+)(?:;charset=[^;,]+)?(?:;base64)?,/i.exec(e);return(null===(t=null==r?void 0:r[1])||void 0===t?void 0:t.toLowerCase())||void 0}(t);return r&&ee.has(r)?t:void 0}(r);if(i)return e.properties.src=i,void delete e.properties.dataRemoteSrc;const s=function(e){const t=e.trim(),r=t.toLowerCase();if(r.startsWith("http://")||r.startsWith("https://"))return t}(r);if(s)return e.properties.dataRemoteSrc=s,void delete e.properties.src;delete e.properties.src}(e)}))})).use(h).process(e);return t.toString()}(t)}else e.bodyText=(t.text||"").trim()||void 0}(i,r,a),i}function ae(e,t){const r=(e.headers||[]).find((e=>e.key===t.toLowerCase()));return(null==r?void 0:r.value)||void 0}function oe(e){if(!e)return"";let t=e.trim();return t.toLowerCase().startsWith("cid:")&&(t=t.slice(4).trim()),t.startsWith("<")&&(t=t.slice(1)),t.endsWith(">")&&(t=t.slice(0,-1)),t.trim()}function ne(e){if("function"==typeof btoa){let t="";for(const r of e)t+=String.fromCharCode(r);return btoa(t)}return globalThis.Buffer.from(e).toString("base64")}function le(e,t,r){const i="string"==typeof e?e.trim().toLowerCase():"",s=function(e){var t,r,i,s,a;return null!==(a=null!==(s=null!==(i=null!==(r=null!==(t=function(e){if(ce(e,[137,80,78,71,13,10,26,10]))return"image/png"}(e))&&void 0!==t?t:function(e){if(ce(e,[255,216,255]))return"image/jpeg"}(e))&&void 0!==r?r:function(e){const t=ue(e,0,6);if("GIF87a"===t||"GIF89a"===t)return"image/gif"}(e))&&void 0!==i?i:function(e){const t=ue(e,0,4),r=ue(e,8,12);if("RIFF"===t&&"WEBP"===r)return"image/webp"}(e))&&void 0!==s?s:function(e){if(ce(e,[0,0,1,0]))return"image/x-icon"}(e))&&void 0!==a?a:function(e){if(e.length<5)return;const t=new TextDecoder("utf8",{fatal:!1}).decode(e.slice(0,Math.min(e.length,256))).trimStart().toLowerCase();return t.startsWith("<svg")||t.startsWith("<?xml")&&t.includes("<svg")?"image/svg+xml":void 0}(e)}(t);if(i.startsWith("image/")){if(a=i,!(o=s)||a===o||"image/jpg"===a&&"image/jpeg"===o||"image/vnd.microsoft.icon"===a&&"image/x-icon"===o)return i;if(s)return s}var a,o;if(s)return s;const n=function(e){const t=null==e?void 0:e.trim().toLowerCase();if(!t||!t.includes("."))return;return{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[t.slice(t.lastIndexOf(".")+1)]}(r);return n||i||"application/octet-stream"}function ce(e,t){return!(e.length<t.length)&&t.every(((t,r)=>e[r]===t))}function ue(e,t,r){return e.length<r?"":String.fromCodePoint(...e.slice(t,r))}function he(e){return"string"==typeof e&&e.length>0}function pe(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map((e=>de(e))).filter(he);return t.length>0?t.join(", "):void 0}function de(e){if(!e)return;if(Array.isArray(e))return pe(e);if(e.group&&Array.isArray(e.group)){const t=(e.name||"").trim(),r=e.group.map((e=>de(e))).filter(he).join(", ");return t&&r?`${t}: ${r}`:t||r||void 0}const t=(e.name||"").trim(),r=(e.address||"").trim();if(t&&r){const e=function(e){if(!e)return"";if(!e.includes(",")&&!e.includes('"'))return e;return`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}(t);return`${e} <${r}>`}return t||r||void 0}const fe=class{constructor(s){e(this,s),this.action=t(this,"action"),this.allowFullscreen=!1,this.allowOpenInNewTab=!1,this.allowDownload=!1,this.language="en",this.officeViewer="microsoft-office",this.isFullscreen=!1,this.loading=!0,this.fileUrl="",this.renderPdf=()=>[r("div",{class:"action-menu-for-pdf-files"},this.renderActionMenu()),r("iframe",{src:this.sanitizeUrl(this.fileUrl),loading:"lazy"})],this.renderImage=()=>{var e;return r(i,null,this.renderButtons(),r(p,{image:{src:this.sanitizeUrl(this.fileUrl),alt:null!==(e=this.alt)&&void 0!==e?e:"",referrerpolicy:"no-referrer"}}))},this.renderVideo=()=>r("video",{controls:!0},r("source",{src:this.sanitizeUrl(this.fileUrl)})),this.renderAudio=()=>r("audio",{controls:!0},r("source",{src:this.sanitizeUrl(this.fileUrl)})),this.renderText=()=>{const e=[this.renderNoFileSupportMessage(!1)];return[this.renderButtons(),r("object",{data:this.sanitizeUrl(this.fileUrl),type:"text/plain"},e)]},this.renderEmail=()=>this.email?[this.renderButtons(),r("limel-email-viewer",{email:this.email,fallbackUrl:this.sanitizeUrl(this.fileUrl),language:this.language},r("div",{slot:"fallback"},this.renderNoFileSupportMessage(!1)))]:this.renderFileNotFoundMessage(),this.renderOffice=()=>[r("div",{class:"action-menu-for-office-files"},this.renderActionMenu()),r("iframe",{src:this.getOfficeViewerUrl()+encodeURIComponent(this.sanitizeUrl(this.fileUrl))+"&embedded=true",loading:"lazy"})],this.isOfficeFileAccessibleViaURL=()=>"office"===this.fileType&&!(this.fileUrl.startsWith("http://")||this.fileUrl.startsWith("https://")),this.getOfficeViewerUrl=()=>({"microsoft-office":"https://view.officeapps.live.com/op/embed.aspx?src=","google-drive":"https://docs.google.com/gview?url="}[this.officeViewer]),this.renderNoFileSupportMessage=(e=!0)=>r("div",{class:"no-support",role:"alert"},r("h1",null,"⚠️"),r("p",null,this.getTranslation("file-viewer.message.unsupported-filetype")),r("p",{style:{textAlign:"center",margin:"0 auto"}},this.getTranslation("file-viewer.message.try-other-options")),e&&this.renderDownloadButton()),this.renderFileNotFoundMessage=()=>r("div",{class:"no-support",role:"alert"},r("h1",null,"⚠️"),r("p",null,this.getTranslation("file-viewer.message.file-not-found"))),this.renderButtons=()=>r("div",{class:"buttons"},this.renderActionMenu(),this.renderToggleFullscreenButton(),this.renderDownloadButton(),this.renderOpenInNewTabButton()),this.renderToggleFullscreenButton=()=>{if(!this.allowFullscreen||!this.fullscreen.isSupported())return;const e=this.isFullscreen?"multiply":"fit_to_width",t=this.getTranslation(this.isFullscreen?"file-viewer.exit-fullscreen":"file-viewer.open-in-fullscreen");return[r("button",{class:"button--toggle-fullscreen",id:"tooltip-toggle-fullscreen",role:"button",onClick:this.handleToggleFullscreen},r("limel-icon",{name:e}),r("limel-tooltip",{label:t,elementId:"tooltip-toggle-fullscreen",openDirection:"left"}))]},this.renderDownloadButton=()=>{var e;if(this.allowDownload&&!this.isFullscreen)return r("a",{class:"button--download",id:"tooltip-download",role:"button",download:null!==(e=this.filename)&&void 0!==e?e:"",href:this.sanitizeUrl(this.fileUrl),target:"_blank"},r("limel-icon",{name:"download_2"}),r("limel-tooltip",{label:this.getTranslation("file-viewer.download"),elementId:"tooltip-download",openDirection:"left"}))},this.renderOpenInNewTabButton=()=>{if(this.allowOpenInNewTab&&!this.isFullscreen)return r("a",{class:"button--new-tab",id:"tooltip-new-tab",role:"button",href:this.sanitizeUrl(this.fileUrl),target:"_blank",rel:"noopener noreferrer"},r("limel-icon",{name:"external_link"}),r("limel-tooltip",{label:this.getTranslation("file-viewer.open-in-new-tab"),elementId:"tooltip-new-tab",openDirection:"left"}))},this.renderActionMenu=()=>{if(this.actions&&!this.isFullscreen)return r("limel-menu",{class:"action-menu",items:this.actions,onSelect:this.emitOnAction,"open-direction":"left"},r("button",{class:"button--action",id:"tooltip-more",role:"button",slot:"trigger"},r("limel-icon",{name:"menu_2"}),r("limel-tooltip",{label:this.getTranslation("file-viewer.more-actions"),elementId:"tooltip-more",openDirection:"left"})))},this.createURL=async e=>{this.revokePdfBlobUrl();const t={pdf:this.loadPdf,email:this.loadEmail}[e]||this.loadDefault;try{await t()}finally{this.loading=!1}},this.loadPdf=async()=>{const e=await fetch(this.url);if(!e.ok)throw new Error(`Failed to load PDF (${e.status} ${e.statusText})`);const t=await e.blob();this.fileUrl=URL.createObjectURL(t),this.pdfBlobUrl=this.fileUrl},this.loadEmail=async()=>{try{this.email=await se(this.url),this.fileUrl=this.url}catch(e){this.email=void 0,this.fileUrl=""}},this.loadDefault=async()=>{this.fileUrl=this.url},this.handleToggleFullscreen=()=>{this.fullscreen.isSupported()&&(this.fullscreen.toggle(),this.isFullscreen=!this.isFullscreen)},this.emitOnAction=e=>{e.stopPropagation(),this.action.emit(e.detail)},this.fullscreen=new f(this.HostElement)}disconnectedCallback(){void 0!==this.revokeAnimationFrame&&cancelAnimationFrame(this.revokeAnimationFrame),this.revokeAnimationFrame=requestAnimationFrame((()=>{this.revokePdfBlobUrl(),this.revokeAnimationFrame=void 0}))}connectedCallback(){void 0!==this.revokeAnimationFrame&&(cancelAnimationFrame(this.revokeAnimationFrame),this.revokeAnimationFrame=void 0)}async componentWillLoad(){this.fileType=d(this.filename,this.url),await this.createURL(this.fileType)}render(){return this.isOfficeFileAccessibleViaURL?this.loading?r("limel-spinner",{size:"x-small",limeBranded:!1}):this.renderFileViewer():this.renderNoFileSupportMessage()}async watchUrl(e,t){e!==t&&(this.loading=!0,this.fileType=d(this.filename,this.fileUrl),await this.createURL(this.fileType))}renderFileViewer(){return({pdf:this.renderPdf,image:this.renderImage,video:this.renderVideo,audio:this.renderAudio,text:this.renderText,email:this.renderEmail,office:this.renderOffice}[this.fileType]||this.renderNoFileSupportMessage)()}revokePdfBlobUrl(){this.pdfBlobUrl&&(URL.revokeObjectURL(this.pdfBlobUrl),this.pdfBlobUrl=void 0)}sanitizeUrl(e){if(!(null==e?void 0:e.trim()))return"";try{const t=new URL(e,window.location.href);return["http:","https:","blob:"].includes(t.protocol)?t.href:""}catch(e){return""}}getTranslation(e){return a.get(e,this.language)}get HostElement(){return s(this)}static get watchers(){return{url:[{watchUrl:0}]}}};fe.style='@charset "UTF-8";.buttons{position:absolute;z-index:1;bottom:0.25rem;right:0.25rem;display:flex;flex-direction:column;gap:0.25rem}@media (pointer: coarse){.buttons{gap:0.5rem}}.no-support{display:flex;flex-direction:column;gap:0.5rem;align-items:center;border:1px dashed rgb(var(--contrast-600));border-radius:0.5rem;padding:1.25rem}.no-support h1,.no-support p{margin:0}[class^=button--]{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}[class^=button--]:hover,[class^=button--]:focus,[class^=button--]:focus-visible{will-change:color, background-color, box-shadow, transform}[class^=button--]:hover,[class^=button--]:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}[class^=button--]:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}[class^=button--]:hover,[class^=button--]:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}[class^=button--]:focus{outline:none}[class^=button--]:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}[class^=button--]{display:flex;align-items:center;justify-content:center;border-radius:50%;width:var(--limel-file-viewer-size-of-buttons);height:var(--limel-file-viewer-size-of-buttons);background-color:rgba(var(--contrast-100), 0.8);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}[class^=button--] limel-icon{transition:color 0.2s ease;width:1.25rem;color:rgb(var(--contrast-1200))}[class^=button--]:hover limel-icon{color:rgb(var(--contrast-1400))}.action-menu-for-pdf-files,.action-menu-for-office-files{position:absolute;right:0.75rem}.action-menu-for-pdf-files{bottom:0.75rem}.action-menu-for-office-files{top:0.75rem}:host{--limel-file-viewer-size-of-buttons:2rem;isolation:isolate;position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:100%}*{box-sizing:border-box}img,video,audio,object,iframe{max-height:100%;max-width:100%;box-sizing:border-box}iframe{border:none;width:100%;height:100%;min-height:20rem}img{min-width:7rem;object-fit:contain}video{width:100%;height:auto}audio{width:100%}object{width:100%;height:100%}object[type="application/pdf"]{min-height:20rem}object[type="text/plain"]{border-radius:0.25rem;padding-right:var(--limel-file-viewer-size-of-buttons);overflow-y:auto}:host(:fullscreen){background-color:rgb(var(--color-gray-darker))}:host(:fullscreen) object[type="text/plain"]{max-width:50rem;max-height:calc(100% - 2rem)}:host(:-webkit-full-screen){background-color:rgb(var(--color-gray-darker))}:host(:-webkit-full-screen) object[type="text/plain"]{max-width:50rem;max-height:calc(100% - 2rem)}';export{fe as limel_file_viewer}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ListSeparator } from '../list-item/list-item.types';
|
|
2
2
|
import { Option } from '../select/option.types';
|
|
3
3
|
/**
|
|
4
|
+
* ## Keyboard
|
|
5
|
+
*
|
|
6
|
+
* Typing characters jumps to the option whose text starts with them, the way
|
|
7
|
+
* a native `<select>` does. Characters accumulate for a short while, so typing
|
|
8
|
+
* `n`, `e` finds "Netherlands" rather than the next option starting with `n`.
|
|
9
|
+
* Pressing the same character repeatedly cycles through all options starting
|
|
10
|
+
* with it. This works both while the dropdown is open, and while the closed
|
|
11
|
+
* component has focus — in which case the dropdown opens with the match
|
|
12
|
+
* highlighted. Typing only moves the highlight; the value is not changed until
|
|
13
|
+
* the option is picked with `Enter` or a click.
|
|
14
|
+
*
|
|
4
15
|
* @exampleComponent limel-example-select-basic
|
|
5
16
|
* @exampleComponent limel-example-select-with-icons
|
|
6
17
|
* @exampleComponent limel-example-select-with-separators
|
|
@@ -69,6 +80,13 @@ export declare class Select {
|
|
|
69
80
|
private hasPrimaryComponentMemo;
|
|
70
81
|
protected resetHasChanged(): void;
|
|
71
82
|
protected updateHasPrimaryComponent(): void;
|
|
83
|
+
/**
|
|
84
|
+
* `options` and `required` are the inputs that decide which rows the
|
|
85
|
+
* dropdown renders, and therefore which row an index refers to. When
|
|
86
|
+
* either changes, a buffered typeahead match no longer points at what the
|
|
87
|
+
* user was aiming for.
|
|
88
|
+
*/
|
|
89
|
+
protected resetTypeaheadOnItemsChange(): void;
|
|
72
90
|
private checkValid;
|
|
73
91
|
private mdcSelectHelperText;
|
|
74
92
|
private mdcFloatingLabel;
|
|
@@ -76,6 +94,14 @@ export declare class Select {
|
|
|
76
94
|
private portalId;
|
|
77
95
|
private focusObserver;
|
|
78
96
|
private focusTimeoutId;
|
|
97
|
+
private readonly typeaheadBuffer;
|
|
98
|
+
/**
|
|
99
|
+
* The row a typeahead match wants to focus, when it could not be focused
|
|
100
|
+
* right away — because the dropdown had not opened or rendered yet. It is
|
|
101
|
+
* consumed by `setMenuFocus`, once focus is about to land in the menu.
|
|
102
|
+
*/
|
|
103
|
+
private pendingTypeaheadIndex;
|
|
104
|
+
private list;
|
|
79
105
|
constructor();
|
|
80
106
|
connectedCallback(): void;
|
|
81
107
|
componentWillLoad(): void;
|
|
@@ -88,6 +114,18 @@ export declare class Select {
|
|
|
88
114
|
private setMenuFocus;
|
|
89
115
|
private cancelPendingFocus;
|
|
90
116
|
private focusFirstMenuItem;
|
|
117
|
+
/**
|
|
118
|
+
* Focus the row at a given index in the dropdown.
|
|
119
|
+
*
|
|
120
|
+
* The rows only become focusable once `limel-list` has set up `MDCList`,
|
|
121
|
+
* which is what gives them a `tabindex`. Callers use the return value to
|
|
122
|
+
* fall back to `pendingTypeaheadIndex` when that has not happened yet.
|
|
123
|
+
*
|
|
124
|
+
* @param list - the `limel-list` of the dropdown
|
|
125
|
+
* @param index - the index of the row, as rendered in its `data-index`
|
|
126
|
+
* @returns whether the row could be focused
|
|
127
|
+
*/
|
|
128
|
+
private focusMenuItemAtIndex;
|
|
91
129
|
private setTriggerFocus;
|
|
92
130
|
private getAnchorElement;
|
|
93
131
|
private updatePortalAnchor;
|
|
@@ -95,7 +133,44 @@ export declare class Select {
|
|
|
95
133
|
private openMenu;
|
|
96
134
|
private getFirstNativeAutoSelectOption;
|
|
97
135
|
private closeMenu;
|
|
98
|
-
private
|
|
136
|
+
private readonly handleMenuTriggerKeyDown;
|
|
137
|
+
private readonly setListElement;
|
|
138
|
+
/**
|
|
139
|
+
* Key handler for the dropdown, in the capture phase.
|
|
140
|
+
*
|
|
141
|
+
* `MDCList` listens for `keydown` on the `ul` inside `limel-list`'s shadow
|
|
142
|
+
* root, so capturing on the `limel-list` element itself is the only place
|
|
143
|
+
* a typed character can be stopped before MDC sees it. It has to be
|
|
144
|
+
* stopped: MDC would add it to its own typeahead buffer, which suppresses
|
|
145
|
+
* selection with `Enter` for as long as that buffer lives, and it treats
|
|
146
|
+
* the space bar as a selection.
|
|
147
|
+
*
|
|
148
|
+
* @param event - the key that was pressed
|
|
149
|
+
*/
|
|
150
|
+
private readonly handleListKeyDownCapture;
|
|
151
|
+
/**
|
|
152
|
+
* Move the highlight to the option matching the characters typed so far,
|
|
153
|
+
* the way a native `<select>` does. Never changes the value — the option
|
|
154
|
+
* still has to be picked with `Enter` or a click.
|
|
155
|
+
*
|
|
156
|
+
* @param event - the key that was pressed
|
|
157
|
+
* @param focusedIndex - the row that currently has focus, if any
|
|
158
|
+
* @returns whether the key was handled as typeahead
|
|
159
|
+
*/
|
|
160
|
+
private handleTypeaheadKey;
|
|
161
|
+
/**
|
|
162
|
+
* @param items - the items of the dropdown
|
|
163
|
+
* @param focusedIndex - the row that currently has focus, if any
|
|
164
|
+
* @returns the index a typeahead search should start from
|
|
165
|
+
*/
|
|
166
|
+
private resolveTypeaheadIndex;
|
|
167
|
+
private focusTypeaheadMatch;
|
|
168
|
+
/**
|
|
169
|
+
* @returns the index of the focused row of the dropdown, or
|
|
170
|
+
* `NO_TYPEAHEAD_MATCH` when no row has focus
|
|
171
|
+
*/
|
|
172
|
+
private getFocusedMenuItemIndex;
|
|
173
|
+
private resetTypeahead;
|
|
99
174
|
private handleNativeChange;
|
|
100
175
|
private getOptionsExcludingSeparators;
|
|
101
176
|
private shouldRenderNative;
|
|
@@ -15,7 +15,12 @@ interface SelectTemplateProps {
|
|
|
15
15
|
onNativeChange: (event: Event) => void;
|
|
16
16
|
id: string;
|
|
17
17
|
onMenuChange: (event: CustomEvent<ListItem | ListItem[]>) => void;
|
|
18
|
-
|
|
18
|
+
onTriggerKeyDown: (event: KeyboardEvent) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Stencil calls this with `null` when the `limel-list` goes away — on
|
|
21
|
+
* unmount, and when the native dropdown replaces the menu on mobile.
|
|
22
|
+
*/
|
|
23
|
+
listRef: (element: HTMLLimelListElement | null) => void;
|
|
19
24
|
isOpen: boolean;
|
|
20
25
|
open: () => void;
|
|
21
26
|
close: () => void;
|
|
@@ -24,6 +29,21 @@ interface SelectTemplateProps {
|
|
|
24
29
|
anchor?: HTMLElement;
|
|
25
30
|
}
|
|
26
31
|
export declare const SelectTemplate: FunctionalComponent<SelectTemplateProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Create the items for the dropdown.
|
|
34
|
+
*
|
|
35
|
+
* The returned array is index-aligned with the `data-index` attribute that
|
|
36
|
+
* `limel-list` renders on each row. Separators are included, and occupy an
|
|
37
|
+
* index. Anything that needs to address a row by index — such as the
|
|
38
|
+
* typeahead in `select.tsx` — must derive its indices from this same array.
|
|
39
|
+
*
|
|
40
|
+
* @param options - the options of the select
|
|
41
|
+
* @param value - the currently selected option or options
|
|
42
|
+
* @param selectIsRequired - whether the select requires a value, in which
|
|
43
|
+
* case the "empty" option is left out
|
|
44
|
+
* @returns the items to render in the dropdown
|
|
45
|
+
*/
|
|
46
|
+
export declare function createMenuItems(options: Array<Option | ListSeparator>, value: Option | Option[], selectIsRequired?: boolean): Array<ListItem<Option> | ListSeparator>;
|
|
27
47
|
/**
|
|
28
48
|
*
|
|
29
49
|
* @param options
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MarkType, NodeType } from 'prosemirror-model';
|
|
2
|
+
import { CommandWithActive } from '../menu-commands';
|
|
3
|
+
export declare const setActiveMethodForMark: (command: CommandWithActive, markType: MarkType) => void;
|
|
4
|
+
export declare const setActiveMethodForNode: (command: CommandWithActive, nodeType: NodeType, level?: number) => void;
|
|
5
|
+
export declare const setActiveMethodForWrap: (command: CommandWithActive, nodeType: NodeType) => void;
|
|
6
|
+
//# sourceMappingURL=active-state-utils.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { NodeType } from 'prosemirror-model';
|
|
3
|
+
type Dispatch = (tr: Transaction) => void;
|
|
4
|
+
export type ListContext = {
|
|
5
|
+
kind: 'same-type' | 'other-type';
|
|
6
|
+
listDepth: number;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'no-list';
|
|
9
|
+
listDepth: null;
|
|
10
|
+
singleBlock: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'mixed';
|
|
13
|
+
listDepth: null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Whether the selection touches top-level blocks that cannot become list
|
|
17
|
+
* items (list_item requires a leading paragraph, so headings, blockquotes,
|
|
18
|
+
* code blocks and tables are not listable).
|
|
19
|
+
*
|
|
20
|
+
* @param state - the current editor state
|
|
21
|
+
* @returns true when a non-listable block intersects the selection
|
|
22
|
+
*/
|
|
23
|
+
export declare const selectionHasNonListableBlock: (state: EditorState) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Classifies the selection for the list command ladder.
|
|
26
|
+
*
|
|
27
|
+
* @param state - the current editor state
|
|
28
|
+
* @param listType - the list type the command targets
|
|
29
|
+
* @returns the ladder branch to take, plus the innermost list depth when
|
|
30
|
+
* the selection sits inside a list
|
|
31
|
+
*/
|
|
32
|
+
export declare const resolveListContext: (state: EditorState, listType: NodeType) => ListContext;
|
|
33
|
+
/**
|
|
34
|
+
* Converts the innermost list around the selection to the target list type.
|
|
35
|
+
* bullet_list and ordered_list share the list_item+ content model, so the
|
|
36
|
+
* node can change type in place.
|
|
37
|
+
*
|
|
38
|
+
* @param state - the current editor state
|
|
39
|
+
* @param listDepth - depth of the list node, from resolveListContext
|
|
40
|
+
* @param targetType - the list type to convert to
|
|
41
|
+
* @param dispatch - the dispatch function; omit for a dry-run capability check
|
|
42
|
+
* @returns true when the conversion applies
|
|
43
|
+
*/
|
|
44
|
+
export declare const convertInnermostList: (state: EditorState, listDepth: number, targetType: NodeType, dispatch?: Dispatch) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Turns a mixed top-level selection (paragraphs and lists) into a single
|
|
47
|
+
* list of the target type: paragraph runs are wrapped, lists are converted
|
|
48
|
+
* in place, and adjacent same-type lists are joined. Nesting inside
|
|
49
|
+
* converted lists is preserved.
|
|
50
|
+
*
|
|
51
|
+
* @param state - the current editor state
|
|
52
|
+
* @param targetType - the list type to unify into
|
|
53
|
+
* @param dispatch - the dispatch function; omit for a dry-run capability check
|
|
54
|
+
* @returns true when the unification applies
|
|
55
|
+
*/
|
|
56
|
+
export declare const unifyToList: (state: EditorState, targetType: NodeType, dispatch?: Dispatch) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Wraps a dispatch so that after a list is wrapped around the selection,
|
|
59
|
+
* adjacent top-level lists of the same type are joined with it.
|
|
60
|
+
*
|
|
61
|
+
* @param state - the editor state the wrap command runs on
|
|
62
|
+
* @param targetType - the list type being wrapped
|
|
63
|
+
* @param dispatch - the dispatch function; omitted for a dry-run capability check
|
|
64
|
+
* @returns the wrapped dispatch, or undefined when no dispatch was given
|
|
65
|
+
*/
|
|
66
|
+
export declare const joinAdjacentListsOnDispatch: (state: EditorState, targetType: NodeType, dispatch?: Dispatch) => Dispatch | undefined;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=list-utils.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResolvedPos, NodeType } from 'prosemirror-model';
|
|
2
|
+
/**
|
|
3
|
+
* Finds the depth of the nearest ancestor of a given node type.
|
|
4
|
+
*
|
|
5
|
+
* @param $pos - The resolved position in the document.
|
|
6
|
+
* @param type - The node type to search for.
|
|
7
|
+
* @returns The depth at which the node is found, or null if not found.
|
|
8
|
+
*/
|
|
9
|
+
export declare const findAncestorDepthOfType: ($pos: ResolvedPos, type: NodeType) => number | null;
|
|
10
|
+
//# sourceMappingURL=node-utils.d.ts.map
|
|
@@ -6,6 +6,14 @@ export interface CommandWithActive extends Command {
|
|
|
6
6
|
allowed?: (state: EditorState) => boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const isExternalLink: (url: string) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a command for toggling list types.
|
|
11
|
+
*
|
|
12
|
+
* @param schema - The ProseMirror schema.
|
|
13
|
+
* @param listTypeName - The name of the list type to toggle.
|
|
14
|
+
* @returns A command for toggling list types.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createListCommand: (schema: Schema, listTypeName: string) => CommandWithActive;
|
|
9
17
|
export declare class MenuCommandFactory {
|
|
10
18
|
private schema;
|
|
11
19
|
constructor(schema: Schema);
|
|
@@ -16,6 +24,8 @@ export declare class MenuCommandFactory {
|
|
|
16
24
|
'Mod-Shift-1': CommandWithActive;
|
|
17
25
|
'Mod-Shift-2': CommandWithActive;
|
|
18
26
|
'Mod-Shift-3': CommandWithActive;
|
|
27
|
+
'Mod-Shift-7': CommandWithActive;
|
|
28
|
+
'Mod-Shift-8': CommandWithActive;
|
|
19
29
|
'Mod-Shift-X': CommandWithActive;
|
|
20
30
|
'Mod-`': CommandWithActive;
|
|
21
31
|
'Mod-Shift-C': CommandWithActive;
|