@qwanyx/stack 0.2.45 → 0.2.46
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/dist/components/AudioEditor.d.ts +3 -1
- package/dist/index.cjs.js +39 -39
- package/dist/index.esm.js +2778 -2776
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Pa=Object.defineProperty;var Oa=(r,e,t)=>e in r?Pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jr=(r,e,t)=>Oa(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),
|
|
2
|
-
`)}finalize(){return
|
|
3
|
-
`;if(t=this.remainder+t,t.length<this.maxChunkSize){this.remainder=t;return}this.remainder="";let n=t.match(Va);if(n){if(n.index===0){this.remainder=t;return}this.remainder=t.substr(n.index),t=t.substr(0,n.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),
|
|
1
|
+
"use strict";var Pa=Object.defineProperty;var Oa=(r,e,t)=>e in r?Pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jr=(r,e,t)=>Oa(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),Oi=require("react-dom");function Ma(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const vs=Ma(D);class Ia{constructor(e){jr(this,"config");jr(this,"defaultUploadOptions",{maxSizeMB:10,maxImageDimension:0,imageQuality:.9});if(!e.system_id)throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");this.config=e}async callGraph(e,t={}){const n={coprocessor:"graph",method:e,system_id:this.config.system_id,params:t};try{const s=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(n)});if(!s.ok){const i=await s.text();throw new Error(`API error (${s.status}): ${i}`)}const o=await s.json();if(!o.success&&o.error)throw new Error(o.error);return o}catch(s){throw console.error("Graph API call failed:",s),s}}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getChildren(e){return(await this.callGraph("get_children",{parent_id:e})).result||[]}async getNode(e){return(await this.callGraph("get_node",{node_id:e})).result||null}async addNode(e){const t={...e,created:e.created||new Date().toISOString(),modified:new Date().toISOString()},n=await this.callGraph("add_node",t);if(!n.result)throw new Error("Failed to add node");return n.result}async updateNode(e,t){const n={node_id:e,updates:{...t,modified:new Date().toISOString()}},s=await this.callGraph("update_node",n);if(!s.result)throw new Error("Failed to update node");return s.result}async deleteNode(e,t=!1){return(await this.callGraph("delete_node",{node_id:e,cascade:t})).success===!0}async getChildrenWithEdges(e,t="children",n,s){return(await this.callGraph("get_children_with_edges",{node_id:e,display_mode:t,edge_type:n,node_type:s})).result||[]}async addEdge(e,t,n="link",s){return await this.callGraph("add_edge",{source_id:e,target_id:t,edge_type:n,data:s})}async deleteEdge(e,t,n){return await this.callGraph("delete_edge",{source_id:e,target_id:t,edge_type:n})}async getEdges(e,t,n){return(await this.callGraph("get_edges",{source_id:e,edge_type:t,target_id:n})).result||[]}async getAncestors(e){return(await this.callGraph("get_ancestors",{node_id:e})).ancestors||[]}async getTree(e,t=10){return(await this.callGraph("get_tree",{root_id:e,max_depth:t})).tree||[]}async moveNode(e,t){const n=await this.callGraph("move",{node_id:e,new_parent_id:t});if(!n.node)throw new Error("Failed to move node");return n.node}async searchNodes(e,t){return(await this.callGraph("search",{query:e,type:t})).nodes||[]}async getNodesByType(e){return(await this.callGraph("get_nodes_by_type",{type:e})).result||[]}fileToBase64(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result.split(",")[1];t(i)},s.onerror=()=>n(new Error("Failed to read file")),s.readAsDataURL(e)})}async resizeImage(e,t,n){return e.type.startsWith("image/")?new Promise(s=>{const o=new Image,i=URL.createObjectURL(e);o.onload=()=>{if(URL.revokeObjectURL(i),o.width<=t&&o.height<=t){s(e);return}let l,a;o.width>o.height?(l=t,a=Math.round(o.height/o.width*t)):(a=t,l=Math.round(o.width/o.height*t));const u=document.createElement("canvas");u.width=l,u.height=a;const c=u.getContext("2d");if(!c){s(e);return}c.drawImage(o,0,0,l,a);const d=e.type==="image/png"?"image/png":"image/jpeg";u.toBlob(f=>{if(f){const h=new File([f],e.name,{type:d});s(h)}else s(e)},d,n)},o.onerror=()=>{URL.revokeObjectURL(i),s(e)},o.src=i}):e}async uploadFile(e,t,n,s={}){const o={...this.defaultUploadOptions,...s};try{let i=n;o.maxImageDimension>0&&n.type.startsWith("image/")&&(i=await this.resizeImage(n,o.maxImageDimension,o.imageQuality));const l=o.maxSizeMB*1024*1024;if(i.size>l)return{success:!1,error:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: ${o.maxSizeMB} MB`};const a=await this.fileToBase64(i),u=await this.callGraph("upload_file",{node_id:e,filename:t,content:a});return u.success?{success:!0,path:u.path}:{success:!1,error:u.error||"Upload failed"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Upload failed"}}}async listFiles(e){var s;return(((s=(await this.callGraph("list_files",{node_id:e})).result)==null?void 0:s.files)||[]).map(o=>({filename:o.name,path:o.path}))}async deleteFile(e,t){return{success:(await this.callGraph("delete_file",{node_id:e,filename:t})).success||!1}}getFileUrl(e,t){return`${this.config.baseUrl}/files/${this.config.system_id}/${e}/${t}`}}const Dr=new TextEncoder,Mi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zr=new Uint8Array(256);for(var wn=0;wn<Mi.length;wn++)zr[Mi.charCodeAt(wn)]=wn;function Os(r){let e=Math.ceil(r.length/4)*3;const t=r.length;let n=0;r.length%4===3?e--:r.length%4===2?e-=2:r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const s=new ArrayBuffer(e),o=new Uint8Array(s);for(let i=0;i<t;i+=4){let l=zr[r.charCodeAt(i)],a=zr[r.charCodeAt(i+1)],u=zr[r.charCodeAt(i+2)],c=zr[r.charCodeAt(i+3)];o[n++]=l<<2|a>>4,o[n++]=(a&15)<<4|u>>2,o[n++]=(u&3)<<6|c&63}return s}function Gr(r){r=r||"utf8";let e;try{e=new TextDecoder(r)}catch{e=new TextDecoder("windows-1252")}return e}async function rs(r){if("arrayBuffer"in r)return await r.arrayBuffer();const e=new FileReader;return new Promise((t,n)=>{e.onload=function(s){t(s.target.result)},e.onerror=function(s){n(e.error)},e.readAsArrayBuffer(r)})}function Ii(r){return r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70?String.fromCharCode(r):!1}function $a(r,e,t){let n=r.indexOf("*");n>=0&&(r=r.substr(0,n)),e=e.toUpperCase();let s;if(e==="Q"){t=t.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=Dr.encode(t),i=[];for(let a=0,u=o.length;a<u;a++){let c=o[a];if(a<=u-2&&c===61){let d=Ii(o[a+1]),f=Ii(o[a+2]);if(d&&f){let h=parseInt(d+f,16);i.push(h),a+=2;continue}}i.push(c)}s=new ArrayBuffer(i.length);let l=new DataView(s);for(let a=0,u=i.length;a<u;a++)l.setUint8(a,i[a])}else e==="B"?s=Os(t.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=Dr.encode(t);return Gr(r).decode(s)}function Kr(r){let e=!0;for(;;){let t=(r||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,i,l)=>e&&o===l&&i.length%4===0&&!/=$/.test(i)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,i)=>e&&o===i?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,i)=>$a(s,o,i));if(e&&t.indexOf("�")>=0)e=!1;else return t}}function za(r,e){e=e||"utf-8";let t=[];for(let o=0;o<r.length;o++){let i=r.charAt(o);if(i==="%"&&/^[a-f0-9]{2}/i.test(r.substr(o+1,2))){let l=r.substr(o+1,2);o+=2,t.push(parseInt(l,16))}else if(i.charCodeAt(0)>126){i=Dr.encode(i);for(let l=0;l<i.length;l++)t.push(i[l])}else t.push(i.charCodeAt(0))}const n=new ArrayBuffer(t.length),s=new DataView(n);for(let o=0,i=t.length;o<i;o++)s.setUint8(o,t[o]);return Gr(e).decode(n)}function qa(r){let e=new Map;Object.keys(r.params).forEach(t=>{let n=t.match(/\*((\d+)\*?)?$/);if(!n)return;let s=t.substr(0,n.index).toLowerCase(),o=Number(n[2])||0,i;e.has(s)?i=e.get(s):(i={charset:!1,values:[]},e.set(s,i));let l=r.params[t];o===0&&n[0].charAt(n[0].length-1)==="*"&&(n=l.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",l=n[2]),i.values.push({nr:o,value:l}),delete r.params[t]}),e.forEach((t,n)=>{r.params[n]=za(t.values.sort((s,o)=>s.nr-o.nr).map(s=>s.value).join(""),t.charset)})}class Ua{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push(`
|
|
2
|
+
`)}finalize(){return rs(new Blob(this.chunks,{type:"application/octet-stream"}))}}class Wa{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(e){let t=this.decoder.decode(e);if(/[^a-zA-Z0-9+\/]/.test(t)&&(t=t.replace(/[^a-zA-Z0-9+\/]+/g,"")),this.remainder+=t,this.remainder.length>=this.maxChunkSize){let n=Math.floor(this.remainder.length/4)*4,s;n===this.remainder.length?(s=this.remainder,this.remainder=""):(s=this.remainder.substr(0,n),this.remainder=this.remainder.substr(n)),s.length&&this.chunks.push(Os(s))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Os(this.remainder)),rs(new Blob(this.chunks,{type:"application/octet-stream"}))}}const $i=/^=[a-f0-9]{2}$/i,Ga=/(?==[a-f0-9]{2})/i,Ka=/=\r?\n/g,Va=/=[a-fA-F0-9]?$/;class Ha{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(e){let t=new ArrayBuffer(e.length),n=new DataView(t);for(let s=0,o=e.length;s<o;s++)n.setUint8(s,parseInt(e[s],16));return t}decodeChunks(e){e=e.replace(Ka,"");let t=e.split(Ga),n=[];for(let s of t){if(s.charAt(0)!=="="){n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s);continue}if(s.length===3){$i.test(s)?n.push(s.substr(1)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s));continue}if(s.length>3){const o=s.substr(0,3);$i.test(o)?(n.push(s.substr(1,2)),this.chunks.push(this.decodeQPBytes(n)),n=[],s=s.substr(3),this.chunks.push(s)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s))}}n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[])}update(e){let t=this.decoder.decode(e)+`
|
|
3
|
+
`;if(t=this.remainder+t,t.length<this.maxChunkSize){this.remainder=t;return}this.remainder="";let n=t.match(Va);if(n){if(n.index===0){this.remainder=t;return}this.remainder=t.substr(n.index),t=t.substr(0,n.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),rs(new Blob(this.chunks,{type:"application/octet-stream"}))}}class zi{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:"text/plain",default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){/base64/i.test(e)?this.contentDecoder=new Wa:/quoted-printable/i.test(e)?this.contentDecoder=new Ha({decoder:Gr(this.contentType.parsed.params.charset)}):this.contentDecoder=new Ua}async finalize(){if(this.state==="finished")return;this.state==="header"&&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.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}parseStructuredHeader(e){let t={value:!1,params:{}},n=!1,s="",o="value",i=!1,l=!1,a;for(let u=0,c=e.length;u<c;u++)switch(a=e.charAt(u),o){case"key":if(a==="="){n=s.trim().toLowerCase(),o="value",s="";break}s+=a;break;case"value":if(l)s+=a;else if(a==="\\"){l=!0;continue}else i&&a===i?i=!1:!i&&a==='"'?i=a:!i&&a===";"?(n===!1?t.value=s.trim():t.params[n]=s.trim(),o="key",s=""):s+=a;l=!1;break}return s=s.trim(),o==="value"?n===!1?t.value=s:t.params[n]=s:s&&(t.params[s.toLowerCase()]=""),t.value&&(t.value=t.value.toLowerCase()),qa(t),t}decodeFlowedText(e,t){return e.split(/\r?\n/).reduce((n,s)=>/ $/.test(n)&&!/(^|\n)-- $/.test(n)?t?n.slice(0,-1)+s:n+s:n+`
|
|
4
4
|
`+s).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=Gr(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];if(e&&/^\s/.test(t))this.headerLines[e-1]+=`
|
|
5
|
-
`+t,this.headerLines.splice(e,1);else{t=t.replace(/\s+/g," ");let n=t.indexOf(":"),s=n<0?t.trim():t.substr(0,n).trim(),o=n<0?"":t.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:o}),s.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;break}}}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):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Dr.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(Gr().decode(e));break;case"body":this.contentDecoder.update(e)}}}const
|
|
6
|
-
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""};function Ja(r){return r.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,t)=>{if(typeof zi[e]=="string")return zi[e];if(t.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;t.charAt(1)==="x"?n=parseInt(t.substr(2),16):n=parseInt(t.substr(1),10);var s="";return n>=55296&&n<=57343||n>1114111?"�":(n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}function er(r){return r.trim().replace(/[<>"'?&]/g,e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"})}function Qa(r){return"<div>"+er(r).replace(/\n/g,"<br />")+"</div>"}function Ya(r){return r=r.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
5
|
+
`+t,this.headerLines.splice(e,1);else{t=t.replace(/\s+/g," ");let n=t.indexOf(":"),s=n<0?t.trim():t.substr(0,n).trim(),o=n<0?"":t.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:o}),s.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;break}}}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):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Dr.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(Gr().decode(e));break;case"body":this.contentDecoder.update(e)}}}const qi={"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"","⁢":"","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"","​":"","​":"","​":"","≫":"≫","≪":"≪","
":`
|
|
6
|
+
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""};function Ja(r){return r.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,t)=>{if(typeof qi[e]=="string")return qi[e];if(t.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;t.charAt(1)==="x"?n=parseInt(t.substr(2),16):n=parseInt(t.substr(1),10);var s="";return n>=55296&&n<=57343||n>1114111?"�":(n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}function tr(r){return r.trim().replace(/[<>"'?&]/g,e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"})}function Qa(r){return"<div>"+tr(r).replace(/\n/g,"<br />")+"</div>"}function Ya(r){return r=r.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
7
7
|
`).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
|
|
8
8
|
|
|
9
9
|
`).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,`
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
|
|
14
14
|
`).replace(/^\n+/,`
|
|
15
15
|
`).replace(/\n+$/,`
|
|
16
|
-
`),r=Ja(r),r}function
|
|
17
|
-
`)}return o}function
|
|
16
|
+
`),r=Ja(r),r}function il(r){return[].concat(r.name||[]).concat(r.name?`<${r.address}>`:r.address).join(" ")}function Cs(r){let e=[],t=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(t),e.push(i)}else e.push(il(n))};return r.forEach(t),e.join("")}function ol(r){return`<a href="mailto:${tr(r.address)}" class="postal-email-address">${tr(r.name||`<${r.address}>`)}</a>`}function ws(r){let e=[],t=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${tr(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(t),e.push(i)}else e.push(ol(n))};return r.forEach(t),e.join(" ")}function Xa(r,e,t){r=(r||"").toString(),e=e||76;let n=0,s=r.length,o="",i,l;for(;n<s;){if(i=r.substr(n,e),i.length<e){o+=i;break}if(l=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=l[0],o+=i,n+=i.length;continue}else(l=i.match(/(\s+)[^\s]*$/))&&l[0].length-(l[1]||"").length<i.length?i=i.substr(0,i.length-(l[0].length-(l[1]||"").length)):(l=r.substr(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+l[0].substr(0,l[0].length-0));o+=i,n+=i.length,n<s&&(o+=`\r
|
|
17
|
+
`)}return o}function Ui(r){let e=[];if(r.from&&e.push({key:"From",val:il(r.from)}),r.subject&&e.push({key:"Subject",val:r.subject}),r.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},l=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",i).format(new Date(r.date));e.push({key:"Date",val:l})}r.to&&r.to.length&&e.push({key:"To",val:Cs(r.to)}),r.cc&&r.cc.length&&e.push({key:"Cc",val:Cs(r.cc)}),r.bcc&&r.bcc.length&&e.push({key:"Bcc",val:Cs(r.bcc)});let t=e.map(i=>i.key.length).reduce((i,l)=>l>i?l:i,0);e=e.flatMap(i=>{let l=t-i.key.length,a=`${i.key}: ${" ".repeat(l)}`,u=`${" ".repeat(i.key.length+1)} ${" ".repeat(l)}`;return Xa(i.val,80).split(/\r?\n/).map(d=>d.trim()).map((d,f)=>`${f?u:a}${d}`)});let n=e.map(i=>i.length).reduce((i,l)=>l>i?l:i,0),s="-".repeat(n);return`
|
|
18
18
|
${s}
|
|
19
19
|
${e.join(`
|
|
20
20
|
`)}
|
|
21
21
|
${s}
|
|
22
|
-
`}function
|
|
22
|
+
`}function Wi(r){let e=[];if(r.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${ol(r.from)}</div>`),r.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${tr(r.subject)}</div>`),r.date){let n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},s=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",n).format(new Date(r.date));e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${tr(r.date)}">${tr(s)}</div>`)}return r.to&&r.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${ws(r.to)}</div>`),r.cc&&r.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${ws(r.cc)}</div>`),r.bcc&&r.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${ws(r.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
|
|
23
23
|
<div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function Za(r,e){let t=!1,n="text",s,o=[],i={address:[],comment:[],group:[],text:[],textWasQuoted:[]},l,a,u=!1;for(l=0,a=r.length;l<a;l++){let c=r[l],d=l?r[l-1]:null;if(c.type==="operator")switch(c.value){case"<":n="address",u=!1;break;case"(":n="comment",u=!1;break;case":":n="group",t=!0,u=!1;break;case'"':u=!u,n="text";break;default:n="text",u=!1;break}else c.value&&(n==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),d&&d.noBreak&&i[n].length?(i[n][i[n].length-1]+=c.value,n==="text"&&u&&(i.textWasQuoted[i.textWasQuoted.length-1]=!0)):(i[n].push(c.value),n==="text"&&i.textWasQuoted.push(u)))}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),t){i.text=i.text.join(" ");let c=[];i.group.length&&Vr(i.group.join(","),{_depth:e+1}).forEach(f=>{f.group?c=c.concat(f.group):c.push(f)}),o.push({name:Kr(i.text||s&&s.name),group:c})}else{if(!i.address.length&&i.text.length){for(l=i.text.length-1;l>=0;l--)if(!i.textWasQuoted[l]&&i.text[l].match(/^[^@\s]+@[^@\s]+$/)){i.address=i.text.splice(l,1),i.textWasQuoted.splice(l,1);break}let c=function(d){return i.address.length?d:(i.address=[d.trim()]," ")};if(!i.address.length)for(l=i.text.length-1;l>=0&&!(!i.textWasQuoted[l]&&(i.text[l]=i.text[l].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),i.address.length));l--);}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),i.address.length>1&&(i.text=i.text.concat(i.address.splice(1))),i.text=i.text.join(" "),i.address=i.address.join(" "),!i.address&&/^=\?[^=]+?=$/.test(i.text.trim())){const c=Vr(Kr(i.text));if(c&&c.length)return c}if(!i.address&&t)return[];s={address:i.address||i.text||"",name:Kr(i.text||i.address||"")},s.address===s.name&&((s.address||"").match(/@/)?s.name="":s.address=""),o.push(s)}return o}class eu{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 t=0,n=this.str.length;t<n;t++){let s=this.str.charAt(t),o=t<n-1?this.str.charAt(t+1):null;this.checkChar(s,o)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},t&&![" "," ","\r",`
|
|
24
24
|
`,",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],this.escaped=!1;return}else if(['"',"'"].includes(this.operatorExpecting)&&e==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),e===`
|
|
25
|
-
`&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const tu=50;function Vr(r,e){e=e||{};let t=e._depth||0;if(t>tu)return[];let s=new eu(r).tokenize(),o=[],i=[],l=[];if(s.forEach(a=>{a.type==="operator"&&(a.value===","||a.value===";")?(i.length&&o.push(i),i=[]):i.push(a)}),i.length&&o.push(i),o.forEach(a=>{a=Za(a,t),a.length&&(l=l.concat(a))}),e.flatten){let a=[],u=c=>{c.forEach(d=>{if(d.group)return u(d.group);a.push(d)})};return u(l),a}return l}function ru(r){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(r),s=n.byteLength,o=s%3,i=s-o,l,a,u,c,d,f=0;f<i;f=f+3)d=n[f]<<16|n[f+1]<<8|n[f+2],l=(d&16515072)>>18,a=(d&258048)>>12,u=(d&4032)>>6,c=d&63,e+=t[l]+t[a]+t[u]+t[c];return o==1?(d=n[i],l=(d&252)>>2,a=(d&3)<<4,e+=t[l]+t[a]+"=="):o==2&&(d=n[i]<<8|n[i+1],l=(d&64512)>>10,a=(d&1008)>>4,u=(d&15)<<2,e+=t[l]+t[a]+t[u]+"="),e}const nu=256,su=2*1024*1024;class
|
|
25
|
+
`&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const tu=50;function Vr(r,e){e=e||{};let t=e._depth||0;if(t>tu)return[];let s=new eu(r).tokenize(),o=[],i=[],l=[];if(s.forEach(a=>{a.type==="operator"&&(a.value===","||a.value===";")?(i.length&&o.push(i),i=[]):i.push(a)}),i.length&&o.push(i),o.forEach(a=>{a=Za(a,t),a.length&&(l=l.concat(a))}),e.flatten){let a=[],u=c=>{c.forEach(d=>{if(d.group)return u(d.group);a.push(d)})};return u(l),a}return l}function ru(r){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(r),s=n.byteLength,o=s%3,i=s-o,l,a,u,c,d,f=0;f<i;f=f+3)d=n[f]<<16|n[f+1]<<8|n[f+2],l=(d&16515072)>>18,a=(d&258048)>>12,u=(d&4032)>>6,c=d&63,e+=t[l]+t[a]+t[u]+t[c];return o==1?(d=n[i],l=(d&252)>>2,a=(d&3)<<4,e+=t[l]+t[a]+"=="):o==2&&(d=n[i]<<8|n[i+1],l=(d&64512)>>10,a=(d&1008)>>4,u=(d&15)<<2,e+=t[l]+t[a]+t[u]+"="),e}const nu=256,su=2*1024*1024;class Rn{static parse(e,t){return new Rn(t).parse(e)}constructor(e){this.options=e||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||nu,maxHeadersSize:this.options.maxHeadersSize||su},this.root=this.currentNode=new zi({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 n=this.boundaries;if(n.length&&e.length>2&&e[0]===45&&e[1]===45)for(let s=n.length-1;s>=0;s--){let o=n[s];if(e.length!==o.value.length+2&&e.length!==o.value.length+4)continue;let i=e.length===o.value.length+4;if(i&&(e[e.length-2]!==45||e[e.length-1]!==45))continue;let l=!0;for(let a=0;a<o.value.length;a++)if(e[a+2]!==o.value[a]){l=!1;break}if(l)return i?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new zi({postalMime:this,parentNode:o.node,...this.mimeOptions})),t?this.finalize():void 0}if(this.currentNode.feed(e),t)return this.finalize()}readLine(){let e=this.readPos,t=this.readPos,n=()=>({bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){const s=this.av[this.readPos++];if(s!==13&&s!==10&&(t=this.readPos),s===10)return n()}return n()}async processNodeTree(){let e={},t=new Set,n=this.textMap=new Map,s=this.forceRfc822Attachments(),o=async(i,l,a)=>{if(l=l||!1,a=a||!1,i.contentType.multipart)i.contentType.multipart==="alternative"?l=i:i.contentType.multipart==="related"&&(a=i);else if(this.isInlineMessageRfc822(i)&&!s){const u=new Rn;i.subMessage=await u.parse(i.content),n.has(i)||n.set(i,{});let c=n.get(i);(i.subMessage.text||!i.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:i.subMessage}),t.add("plain")),i.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:i.subMessage}),t.add("html")),u.textMap&&u.textMap.forEach((d,f)=>{n.set(f,d)});for(let d of i.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(i)){let u=i.contentType.parsed.value.substr(i.contentType.parsed.value.indexOf("/")+1),c=l||i;n.has(c)||n.set(c,{});let d=n.get(c);d[u]=d[u]||[],d[u].push({type:"text",value:i.getTextContent()}),t.add(u)}else if(i.content){const u=i.contentDisposition.parsed.params.filename||i.contentType.parsed.params.name||null,c={filename:u?Kr(u):null,mimeType:i.contentType.parsed.value,disposition:i.contentDisposition.parsed.value||null};switch(a&&i.contentId&&(c.related=!0),i.contentDescription&&(c.description=i.contentDescription),i.contentId&&(c.contentId=i.contentId),i.contentType.parsed.value){case"text/calendar":case"application/ics":{i.contentType.parsed.params.method&&(c.method=i.contentType.parsed.params.method.toString().toUpperCase().trim());const d=i.getTextContent().replace(/\r?\n/g,`
|
|
26
26
|
`).replace(/\n*$/,`
|
|
27
|
-
`);c.content=Dr.encode(d);break}default:c.content=i.content}this.attachments.push(c)}for(let u of i.childNodes)await o(u,l,a)};await o(this.root,!1,[]),n.forEach(i=>{t.forEach(l=>{if(e[l]||(e[l]=[]),i[l])i[l].forEach(a=>{switch(a.type){case"text":e[l].push(a.value);break;case"subMessage":switch(l){case"html":e[l].push(
|
|
28
|
-
`)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)t(s)};return t(this.root),e}async resolveStream(e){let t=0,n=[];const s=e.getReader();for(;;){const{done:l,value:a}=await s.read();if(l)break;n.push(a),t+=a.length}const o=new Uint8Array(t);let i=0;for(let l of n)o.set(l,i),i+=l.length;return o}async parse(e){var s,o;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=Dr.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await es(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 i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();const t={headers:this.root.headers.map(i=>({key:i.key,value:i.value})).reverse()};for(const i of["from","sender"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);a&&a.length&&(t[i]=a[0])}}for(const i of["delivered-to","return-path"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);if(a&&a.length&&a[0].address){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a[0].address}}}for(const i of["to","cc","bcc","reply-to"]){const l=this.root.headers.filter(u=>u.key===i);let a=[];if(l.filter(u=>u&&u.value).map(u=>Vr(u.value)).forEach(u=>a=a.concat(u||[])),a&&a.length){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a}}for(const i of["subject","message-id","in-reply-to","references"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=i.replace(/\-(.)/g,(u,c)=>c.toUpperCase());t[a]=Kr(l.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);!i||i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),t.date=i}switch((s=this.textContent)!=null&&s.html&&(t.html=this.textContent.html),(o=this.textContent)!=null&&o.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let l of t.attachments||[])l!=null&&l.content&&(l.content=ru(l.content),l.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let l of t.attachments||[])l!=null&&l.content&&(l.content=i.decode(l.content),l.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return t}}class ol{constructor(e){jr(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,t,n={}){const s={coprocessor:e,method:t,system_id:this.config.system_id,params:{user_id:this.config.system_id,...n}};try{const o=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`API error (${o.status}): ${l}`)}const i=await o.json();if(!i.success&&i.error)throw new Error(i.error);return i.result}catch(o){throw console.error("API call failed:",o),o}}async callMail(e,t={}){return this.callCoprocessor("mail",e,t)}async callEmail(e,t={}){return this.callCoprocessor("email",e,t)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,t=150,n){return this.callMail("list_emails",{account_id:e,limit:t,folder:n})}async deleteEmails(e,t,n=!0){return this.callMail("delete_emails",{account_id:e,uids:t,expunge:n})}async imapExec(e,t){return this.callMail("imap_exec",{account_id:e,commands:t})}async trashEmails(e,t,n="INBOX"){const s=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const o of s){const i=[`SELECT "${n}"`,...t.map(u=>`UID MOVE ${u} "${o}"`)],a=(await this.imapExec(e,i)).responses.filter(u=>u.ok&&u.command==="UID MOVE").length;if(a>0)return{success:!0,moved:a}}return{success:!1,moved:0}}async archiveEmails(e,t,n="INBOX"){const s=[`SELECT "${n}"`,...t.map(l=>`UID STORE ${l} +FLAGS (\\Deleted)`),"EXPUNGE"],i=(await this.imapExec(e,s)).responses.filter(l=>l.ok&&l.command==="UID STORE").length;return{success:i>0,archived:i}}async listFolders(e){const n=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return n!=null&&n.ok&&n.folders?{success:!0,folders:n.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,t="INBOX",n=150){const s=await this.imapExec(e,[`SELECT ${t}`,"FETCH 1:* (UID INTERNALDATE)"]),o=s.responses.find(h=>h.command==="SELECT");if(!(o!=null&&o.ok))throw new Error(`Failed to select folder: ${(o==null?void 0:o.error)||"Unknown error"}`);const i=s.responses.find(h=>h.command==="FETCH");if(!(i!=null&&i.ok)||!i.messages)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const a=[...i.messages].sort((h,g)=>{const m=h.internalDate?new Date(h.internalDate).getTime():0;return(g.internalDate?new Date(g.internalDate).getTime():0)-m}).slice(0,n).map(h=>h.uid).filter(Boolean);if(a.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const c=(await this.imapExec(e,[`SELECT ${t}`,`UID FETCH ${a.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(h=>h.command==="UID FETCH");if(!(c!=null&&c.ok)||!c.messages)throw new Error(`Failed to fetch details: ${(c==null?void 0:c.error)||"Unknown error"}`);const d=new Map;for(const h of c.messages)h.uid&&d.set(h.uid,h);const f=a.map(h=>{var E,C,k,v,b;const g=d.get(h);if(!g)return null;const m=((E=g.flags)==null?void 0:E.some(S=>S.includes("Seen")))||!1,y=((k=(C=g.envelope)==null?void 0:C.from)==null?void 0:k.email)||"Unknown",w=((v=g.envelope)==null?void 0:v.subject)||"(No subject)",x=((b=g.envelope)==null?void 0:b.date)||"";return{uid:h,from:y,subject:w,date:x,seen:m}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:f}}async getEmail(e,t,n="INBOX"){return this.callMail("get_email",{account_id:e,uid:t,folder:n})}async getAttachment(e,t,n,s="INBOX"){return this.callMail("get_attachment",{account_id:e,uid:t,attachment_index:n,folder:s})}async searchContactEmails(e,t,n=50){return this.callMail("search_contact_emails",{account_id:e,contact_email:t,limit:n})}async getEmailParsed(e,t,n="INBOX"){var g,m,y,w,x,E;const o=(await this.imapExec(e,[`SELECT "${n}"`,`UID FETCH ${t} (FLAGS BODY[])`])).responses.find(C=>C.command==="UID FETCH");if(!(o!=null&&o.ok)||!((g=o.messages)!=null&&g[0]))return console.error("Failed to fetch raw email:",o==null?void 0:o.error),null;const i=o.messages[0],l=i.body||i.raw;if(!l)return console.error("No raw email content in response"),null;const u=await new jn().parse(l);console.log("[MailClient] Parsed email - attachments count:",((m=u.attachments)==null?void 0:m.length)||0),console.log("[MailClient] Parsed attachments:",(y=u.attachments)==null?void 0:y.map(C=>({filename:C.filename,mimeType:C.mimeType,contentId:C.contentId})));const c=new Map;for(const C of u.attachments||[])if(C.contentId){const k=this.contentToBase64(C.content),v=`data:${C.mimeType};base64,${k}`,b=C.contentId.replace(/^<|>$/g,"");c.set(b,v),c.set(`<${b}>`,v)}let d=u.html||"";d&&c.size>0&&(d=d.replace(/src=["']cid:([^"']+)["']/gi,(C,k)=>{const v=c.get(k)||c.get(`<${k}>`);return v?`src="${v}"`:C}));const f=((w=i.flags)==null?void 0:w.some(C=>C.toLowerCase().includes("seen")))||!1,h=((x=u.from)==null?void 0:x.address)||((E=u.from)==null?void 0:E.name)||"Unknown";return{uid:t,from:h,subject:u.subject||"(No subject)",date:u.date||"",body:d||u.text||"",html:d,text:u.text||"",seen:f,attachments:(u.attachments||[]).map(C=>({filename:C.filename||"attachment",mimeType:C.mimeType||"application/octet-stream",size:this.getContentSize(C.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const t=e instanceof Uint8Array?e:new Uint8Array(e);let n="";for(let s=0;s<t.byteLength;s++)n+=String.fromCharCode(t[s]);return btoa(n)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const t={to:e.to,subject:e.subject,body:e.body};return e.html&&(t.html=e.html),e.from&&(t.from=e.from),e.smtpConfig&&(t.smtp_config=e.smtpConfig),this.callEmail("send",t)}async sendEmail(e,t){var n,s;try{const o=await this.getSettings(),i=((n=o.accounts)==null?void 0:n.find(u=>u.id===e))||((s=o.accounts)==null?void 0:s[0]);if(!(i!=null&&i.smtp))return{success:!1,error:"No SMTP configuration found for account"};const l={to:Array.isArray(t.to)?t.to:[t.to],subject:t.subject,body:t.text||"",html:t.html,from:i.email,smtp_config:{host:i.smtp.host,port:parseInt(i.smtp.port,10)||587,username:i.smtp.user,password:i.smtp.password}};t.in_reply_to&&(l.in_reply_to=t.in_reply_to),t.attachments&&t.attachments.length>0&&(l.attachments=t.attachments);const a=await this.callEmail("send",l);return{success:(a==null?void 0:a.sent)??!1,message_id:a==null?void 0:a.message_id,error:a==null?void 0:a.error}}catch(o){return{success:!1,error:o instanceof Error?o.message:String(o)}}}}const ws="qwanyx_auth_token",Ds="qwanyx_refresh_token";class ll{static setToken(e){typeof window<"u"&&localStorage.setItem(ws,e)}static getToken(){return typeof window<"u"?localStorage.getItem(ws):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(ws),localStorage.removeItem(Ds))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(Ds,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(Ds):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class al{constructor(e){jr(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o!=null&&t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""}async request(e,t={}){const{method:n="GET",headers:s={},body:o,params:i}=t,l=`${this.config.baseUrl}/${e}${this.buildQueryString(i)}`,a={...this.config.headers,...ll.getAuthHeader(),...s},u={method:n,headers:a};o&&n!=="GET"&&(u.body=JSON.stringify(o));try{const c=new AbortController,d=setTimeout(()=>c.abort(),this.config.timeout),f=await fetch(l,{...u,signal:c.signal});if(clearTimeout(d),!f.ok){const h=await f.json().catch(()=>({message:f.statusText}));throw new Error(h.message||`HTTP ${f.status}`)}return await f.json()}catch(c){throw c instanceof Error?c:new Error("An unexpected error occurred")}}async get(e,t){return this.request(e,{method:"GET",params:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,params:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,params:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,params:n})}async delete(e,t){return this.request(e,{method:"DELETE",params:t})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let Ln=null;function iu(r){return Ln=new al(r),Ln}function oi(){if(!Ln)throw new Error("API client not initialized. Call initializeApiClient() first.");return Ln}function ul(r,e,t={}){const{enabled:n=!0,refetchOnMount:s=!0,onSuccess:o,onError:i}=t,[l,a]=D.useState(null),[u,c]=D.useState(n),[d,f]=D.useState(null),h=D.useCallback(async()=>{if(n){c(!0),f(null);try{const m=await oi().get(r,e);a(m),o==null||o(m)}catch(g){const m=g instanceof Error?g:new Error("Unknown error");f(m),i==null||i(m)}finally{c(!1)}}},[r,JSON.stringify(e),n,o,i]);return D.useEffect(()=>{s&&h()},[h,s]),{data:l,loading:u,error:d,refetch:h}}function ou(r,e="POST",t={}){const{onSuccess:n,onError:s}=t,[o,i]=D.useState(null),[l,a]=D.useState(!1),[u,c]=D.useState(null),d=D.useCallback(async h=>{a(!0),c(null);try{const g=oi();let m;switch(e){case"POST":m=await g.post(r,h);break;case"PUT":m=await g.put(r,h);break;case"PATCH":m=await g.patch(r,h);break;case"DELETE":m=await g.delete(r);break;default:throw new Error(`Unsupported method: ${e}`)}return i(m),n==null||n(m,h),m}catch(g){const m=g instanceof Error?g:new Error("Unknown error");return c(m),s==null||s(m,h),null}finally{a(!1)}},[r,e,n,s]),f=D.useCallback(()=>{i(null),c(null),a(!1)},[]);return{data:o,loading:l,error:u,mutate:d,reset:f}}var Os={exports:{}},Lr={};/**
|
|
27
|
+
`);c.content=Dr.encode(d);break}default:c.content=i.content}this.attachments.push(c)}for(let u of i.childNodes)await o(u,l,a)};await o(this.root,!1,[]),n.forEach(i=>{t.forEach(l=>{if(e[l]||(e[l]=[]),i[l])i[l].forEach(a=>{switch(a.type){case"text":e[l].push(a.value);break;case"subMessage":switch(l){case"html":e[l].push(Wi(a.value));break;case"plain":e[l].push(Ui(a.value));break}break}});else{let a;switch(l){case"html":a="plain";break;case"plain":a="html";break}(i[a]||[]).forEach(u=>{switch(u.type){case"text":switch(l){case"html":e[l].push(Qa(u.value));break;case"plain":e[l].push(Ya(u.value));break}break;case"subMessage":switch(l){case"html":e[l].push(Wi(u.value));break;case"plain":e[l].push(Ui(u.value));break}break}})}})}),Object.keys(e).forEach(i=>{e[i]=e[i].join(`
|
|
28
|
+
`)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)t(s)};return t(this.root),e}async resolveStream(e){let t=0,n=[];const s=e.getReader();for(;;){const{done:l,value:a}=await s.read();if(l)break;n.push(a),t+=a.length}const o=new Uint8Array(t);let i=0;for(let l of n)o.set(l,i),i+=l.length;return o}async parse(e){var s,o;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=Dr.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await rs(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 i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();const t={headers:this.root.headers.map(i=>({key:i.key,value:i.value})).reverse()};for(const i of["from","sender"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);a&&a.length&&(t[i]=a[0])}}for(const i of["delivered-to","return-path"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);if(a&&a.length&&a[0].address){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a[0].address}}}for(const i of["to","cc","bcc","reply-to"]){const l=this.root.headers.filter(u=>u.key===i);let a=[];if(l.filter(u=>u&&u.value).map(u=>Vr(u.value)).forEach(u=>a=a.concat(u||[])),a&&a.length){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a}}for(const i of["subject","message-id","in-reply-to","references"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=i.replace(/\-(.)/g,(u,c)=>c.toUpperCase());t[a]=Kr(l.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);!i||i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),t.date=i}switch((s=this.textContent)!=null&&s.html&&(t.html=this.textContent.html),(o=this.textContent)!=null&&o.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let l of t.attachments||[])l!=null&&l.content&&(l.content=ru(l.content),l.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let l of t.attachments||[])l!=null&&l.content&&(l.content=i.decode(l.content),l.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return t}}class ll{constructor(e){jr(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,t,n={}){const s={coprocessor:e,method:t,system_id:this.config.system_id,params:{user_id:this.config.system_id,...n}};try{const o=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`API error (${o.status}): ${l}`)}const i=await o.json();if(!i.success&&i.error)throw new Error(i.error);return i.result}catch(o){throw console.error("API call failed:",o),o}}async callMail(e,t={}){return this.callCoprocessor("mail",e,t)}async callEmail(e,t={}){return this.callCoprocessor("email",e,t)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,t=150,n){return this.callMail("list_emails",{account_id:e,limit:t,folder:n})}async deleteEmails(e,t,n=!0){return this.callMail("delete_emails",{account_id:e,uids:t,expunge:n})}async imapExec(e,t){return this.callMail("imap_exec",{account_id:e,commands:t})}async trashEmails(e,t,n="INBOX"){const s=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const o of s){const i=[`SELECT "${n}"`,...t.map(u=>`UID MOVE ${u} "${o}"`)],a=(await this.imapExec(e,i)).responses.filter(u=>u.ok&&u.command==="UID MOVE").length;if(a>0)return{success:!0,moved:a}}return{success:!1,moved:0}}async archiveEmails(e,t,n="INBOX"){const s=[`SELECT "${n}"`,...t.map(l=>`UID STORE ${l} +FLAGS (\\Deleted)`),"EXPUNGE"],i=(await this.imapExec(e,s)).responses.filter(l=>l.ok&&l.command==="UID STORE").length;return{success:i>0,archived:i}}async listFolders(e){const n=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return n!=null&&n.ok&&n.folders?{success:!0,folders:n.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,t="INBOX",n=150){const s=await this.imapExec(e,[`SELECT ${t}`,"FETCH 1:* (UID INTERNALDATE)"]),o=s.responses.find(h=>h.command==="SELECT");if(!(o!=null&&o.ok))throw new Error(`Failed to select folder: ${(o==null?void 0:o.error)||"Unknown error"}`);const i=s.responses.find(h=>h.command==="FETCH");if(!(i!=null&&i.ok)||!i.messages)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const a=[...i.messages].sort((h,g)=>{const m=h.internalDate?new Date(h.internalDate).getTime():0;return(g.internalDate?new Date(g.internalDate).getTime():0)-m}).slice(0,n).map(h=>h.uid).filter(Boolean);if(a.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const c=(await this.imapExec(e,[`SELECT ${t}`,`UID FETCH ${a.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(h=>h.command==="UID FETCH");if(!(c!=null&&c.ok)||!c.messages)throw new Error(`Failed to fetch details: ${(c==null?void 0:c.error)||"Unknown error"}`);const d=new Map;for(const h of c.messages)h.uid&&d.set(h.uid,h);const f=a.map(h=>{var E,w,k,x,b;const g=d.get(h);if(!g)return null;const m=((E=g.flags)==null?void 0:E.some(S=>S.includes("Seen")))||!1,y=((k=(w=g.envelope)==null?void 0:w.from)==null?void 0:k.email)||"Unknown",C=((x=g.envelope)==null?void 0:x.subject)||"(No subject)",v=((b=g.envelope)==null?void 0:b.date)||"";return{uid:h,from:y,subject:C,date:v,seen:m}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:f}}async getEmail(e,t,n="INBOX"){return this.callMail("get_email",{account_id:e,uid:t,folder:n})}async getAttachment(e,t,n,s="INBOX"){return this.callMail("get_attachment",{account_id:e,uid:t,attachment_index:n,folder:s})}async searchContactEmails(e,t,n=50){return this.callMail("search_contact_emails",{account_id:e,contact_email:t,limit:n})}async getEmailParsed(e,t,n="INBOX"){var g,m,y,C,v,E;const o=(await this.imapExec(e,[`SELECT "${n}"`,`UID FETCH ${t} (FLAGS BODY[])`])).responses.find(w=>w.command==="UID FETCH");if(!(o!=null&&o.ok)||!((g=o.messages)!=null&&g[0]))return console.error("Failed to fetch raw email:",o==null?void 0:o.error),null;const i=o.messages[0],l=i.body||i.raw;if(!l)return console.error("No raw email content in response"),null;const u=await new Rn().parse(l);console.log("[MailClient] Parsed email - attachments count:",((m=u.attachments)==null?void 0:m.length)||0),console.log("[MailClient] Parsed attachments:",(y=u.attachments)==null?void 0:y.map(w=>({filename:w.filename,mimeType:w.mimeType,contentId:w.contentId})));const c=new Map;for(const w of u.attachments||[])if(w.contentId){const k=this.contentToBase64(w.content),x=`data:${w.mimeType};base64,${k}`,b=w.contentId.replace(/^<|>$/g,"");c.set(b,x),c.set(`<${b}>`,x)}let d=u.html||"";d&&c.size>0&&(d=d.replace(/src=["']cid:([^"']+)["']/gi,(w,k)=>{const x=c.get(k)||c.get(`<${k}>`);return x?`src="${x}"`:w}));const f=((C=i.flags)==null?void 0:C.some(w=>w.toLowerCase().includes("seen")))||!1,h=((v=u.from)==null?void 0:v.address)||((E=u.from)==null?void 0:E.name)||"Unknown";return{uid:t,from:h,subject:u.subject||"(No subject)",date:u.date||"",body:d||u.text||"",html:d,text:u.text||"",seen:f,attachments:(u.attachments||[]).map(w=>({filename:w.filename||"attachment",mimeType:w.mimeType||"application/octet-stream",size:this.getContentSize(w.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const t=e instanceof Uint8Array?e:new Uint8Array(e);let n="";for(let s=0;s<t.byteLength;s++)n+=String.fromCharCode(t[s]);return btoa(n)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const t={to:e.to,subject:e.subject,body:e.body};return e.html&&(t.html=e.html),e.from&&(t.from=e.from),e.smtpConfig&&(t.smtp_config=e.smtpConfig),this.callEmail("send",t)}async sendEmail(e,t){var n,s;try{const o=await this.getSettings(),i=((n=o.accounts)==null?void 0:n.find(u=>u.id===e))||((s=o.accounts)==null?void 0:s[0]);if(!(i!=null&&i.smtp))return{success:!1,error:"No SMTP configuration found for account"};const l={to:Array.isArray(t.to)?t.to:[t.to],subject:t.subject,body:t.text||"",html:t.html,from:i.email,smtp_config:{host:i.smtp.host,port:parseInt(i.smtp.port,10)||587,username:i.smtp.user,password:i.smtp.password}};t.in_reply_to&&(l.in_reply_to=t.in_reply_to),t.attachments&&t.attachments.length>0&&(l.attachments=t.attachments);const a=await this.callEmail("send",l);return{success:(a==null?void 0:a.sent)??!1,message_id:a==null?void 0:a.message_id,error:a==null?void 0:a.error}}catch(o){return{success:!1,error:o instanceof Error?o.message:String(o)}}}}const Ds="qwanyx_auth_token",Ss="qwanyx_refresh_token";class al{static setToken(e){typeof window<"u"&&localStorage.setItem(Ds,e)}static getToken(){return typeof window<"u"?localStorage.getItem(Ds):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(Ds),localStorage.removeItem(Ss))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(Ss,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(Ss):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class ul{constructor(e){jr(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o!=null&&t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""}async request(e,t={}){const{method:n="GET",headers:s={},body:o,params:i}=t,l=`${this.config.baseUrl}/${e}${this.buildQueryString(i)}`,a={...this.config.headers,...al.getAuthHeader(),...s},u={method:n,headers:a};o&&n!=="GET"&&(u.body=JSON.stringify(o));try{const c=new AbortController,d=setTimeout(()=>c.abort(),this.config.timeout),f=await fetch(l,{...u,signal:c.signal});if(clearTimeout(d),!f.ok){const h=await f.json().catch(()=>({message:f.statusText}));throw new Error(h.message||`HTTP ${f.status}`)}return await f.json()}catch(c){throw c instanceof Error?c:new Error("An unexpected error occurred")}}async get(e,t){return this.request(e,{method:"GET",params:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,params:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,params:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,params:n})}async delete(e,t){return this.request(e,{method:"DELETE",params:t})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let Pn=null;function iu(r){return Pn=new ul(r),Pn}function li(){if(!Pn)throw new Error("API client not initialized. Call initializeApiClient() first.");return Pn}function cl(r,e,t={}){const{enabled:n=!0,refetchOnMount:s=!0,onSuccess:o,onError:i}=t,[l,a]=D.useState(null),[u,c]=D.useState(n),[d,f]=D.useState(null),h=D.useCallback(async()=>{if(n){c(!0),f(null);try{const m=await li().get(r,e);a(m),o==null||o(m)}catch(g){const m=g instanceof Error?g:new Error("Unknown error");f(m),i==null||i(m)}finally{c(!1)}}},[r,JSON.stringify(e),n,o,i]);return D.useEffect(()=>{s&&h()},[h,s]),{data:l,loading:u,error:d,refetch:h}}function ou(r,e="POST",t={}){const{onSuccess:n,onError:s}=t,[o,i]=D.useState(null),[l,a]=D.useState(!1),[u,c]=D.useState(null),d=D.useCallback(async h=>{a(!0),c(null);try{const g=li();let m;switch(e){case"POST":m=await g.post(r,h);break;case"PUT":m=await g.put(r,h);break;case"PATCH":m=await g.patch(r,h);break;case"DELETE":m=await g.delete(r);break;default:throw new Error(`Unsupported method: ${e}`)}return i(m),n==null||n(m,h),m}catch(g){const m=g instanceof Error?g:new Error("Unknown error");return c(m),s==null||s(m,h),null}finally{a(!1)}},[r,e,n,s]),f=D.useCallback(()=>{i(null),c(null),a(!1)},[]);return{data:o,loading:l,error:u,mutate:d,reset:f}}var Ms={exports:{}},Lr={};/**
|
|
29
29
|
* @license React
|
|
30
30
|
* react-jsx-runtime.production.min.js
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ ${s}
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var
|
|
36
|
+
*/var Gi;function lu(){if(Gi)return Lr;Gi=1;var r=D,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(l,a,u){var c,d={},f=null,h=null;u!==void 0&&(f=""+u),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(c in a)n.call(a,c)&&!o.hasOwnProperty(c)&&(d[c]=a[c]);if(l&&l.defaultProps)for(c in a=l.defaultProps,a)d[c]===void 0&&(d[c]=a[c]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:s.current}}return Lr.Fragment=t,Lr.jsx=i,Lr.jsxs=i,Lr}var Rr={};/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-jsx-runtime.development.js
|
|
39
39
|
*
|
|
@@ -41,41 +41,41 @@ ${s}
|
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var
|
|
45
|
-
`+
|
|
46
|
-
`),
|
|
47
|
-
`),Te=
|
|
48
|
-
`+
|
|
44
|
+
*/var Ki;function au(){return Ki||(Ki=1,process.env.NODE_ENV!=="production"&&function(){var r=D,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),g=Symbol.iterator,m="@@iterator";function y(_){if(_===null||typeof _!="object")return null;var O=g&&_[g]||_[m];return typeof O=="function"?O:null}var C=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(_){{for(var O=arguments.length,G=new Array(O>1?O-1:0),Z=1;Z<O;Z++)G[Z-1]=arguments[Z];E("error",_,G)}}function E(_,O,G){{var Z=C.ReactDebugCurrentFrame,pe=Z.getStackAddendum();pe!==""&&(O+="%s",G=G.concat([pe]));var be=G.map(function(ie){return String(ie)});be.unshift("Warning: "+O),Function.prototype.apply.call(console[_],console,be)}}var w=!1,k=!1,x=!1,b=!1,S=!1,A;A=Symbol.for("react.module.reference");function z(_){return!!(typeof _=="string"||typeof _=="function"||_===n||_===o||S||_===s||_===u||_===c||b||_===h||w||k||x||typeof _=="object"&&_!==null&&(_.$$typeof===f||_.$$typeof===d||_.$$typeof===i||_.$$typeof===l||_.$$typeof===a||_.$$typeof===A||_.getModuleId!==void 0))}function N(_,O,G){var Z=_.displayName;if(Z)return Z;var pe=O.displayName||O.name||"";return pe!==""?G+"("+pe+")":G}function j(_){return _.displayName||"Context"}function P(_){if(_==null)return null;if(typeof _.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof _=="function")return _.displayName||_.name||null;if(typeof _=="string")return _;switch(_){case n:return"Fragment";case t:return"Portal";case o:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof _=="object")switch(_.$$typeof){case l:var O=_;return j(O)+".Consumer";case i:var G=_;return j(G._context)+".Provider";case a:return N(_,_.render,"ForwardRef");case d:var Z=_.displayName||null;return Z!==null?Z:P(_.type)||"Memo";case f:{var pe=_,be=pe._payload,ie=pe._init;try{return P(ie(be))}catch{return null}}}return null}var R=Object.assign,I=0,J,ae,le,te,Ce,ue,_e;function Ee(){}Ee.__reactDisabledLog=!0;function Pe(){{if(I===0){J=console.log,ae=console.info,le=console.warn,te=console.error,Ce=console.group,ue=console.groupCollapsed,_e=console.groupEnd;var _={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:_,log:_,warn:_,error:_,group:_,groupCollapsed:_,groupEnd:_})}I++}}function Oe(){{if(I--,I===0){var _={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},_,{value:J}),info:R({},_,{value:ae}),warn:R({},_,{value:le}),error:R({},_,{value:te}),group:R({},_,{value:Ce}),groupCollapsed:R({},_,{value:ue}),groupEnd:R({},_,{value:_e})})}I<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=C.ReactCurrentDispatcher,qe;function Me(_,O,G){{if(qe===void 0)try{throw Error()}catch(pe){var Z=pe.stack.trim().match(/\n( *(at )?)/);qe=Z&&Z[1]||""}return`
|
|
45
|
+
`+qe+_}}var ye=!1,je;{var ut=typeof WeakMap=="function"?WeakMap:Map;je=new ut}function Ot(_,O){if(!_||ye)return"";{var G=je.get(_);if(G!==void 0)return G}var Z;ye=!0;var pe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=de.current,de.current=null,Pe();try{if(O){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Ye){Z=Ye}Reflect.construct(_,[],ie)}else{try{ie.call()}catch(Ye){Z=Ye}_.call(ie.prototype)}}else{try{throw Error()}catch(Ye){Z=Ye}_()}}catch(Ye){if(Ye&&Z&&typeof Ye.stack=="string"){for(var se=Ye.stack.split(`
|
|
46
|
+
`),Ve=Z.stack.split(`
|
|
47
|
+
`),Te=se.length-1,Ne=Ve.length-1;Te>=1&&Ne>=0&&se[Te]!==Ve[Ne];)Ne--;for(;Te>=1&&Ne>=0;Te--,Ne--)if(se[Te]!==Ve[Ne]){if(Te!==1||Ne!==1)do if(Te--,Ne--,Ne<0||se[Te]!==Ve[Ne]){var lt=`
|
|
48
|
+
`+se[Te].replace(" at new "," at ");return _.displayName&<.includes("<anonymous>")&&(lt=lt.replace("<anonymous>",_.displayName)),typeof _=="function"&&je.set(_,lt),lt}while(Te>=1&&Ne>=0);break}}}finally{ye=!1,de.current=be,Oe(),Error.prepareStackTrace=pe}var pr=_?_.displayName||_.name:"",Xt=pr?Me(pr):"";return typeof _=="function"&&je.set(_,Xt),Xt}function At(_,O,G){return Ot(_,!1)}function Mt(_){var O=_.prototype;return!!(O&&O.isReactComponent)}function Ke(_,O,G){if(_==null)return"";if(typeof _=="function")return Ot(_,Mt(_));if(typeof _=="string")return Me(_);switch(_){case u:return Me("Suspense");case c:return Me("SuspenseList")}if(typeof _=="object")switch(_.$$typeof){case a:return At(_.render);case d:return Ke(_.type,O,G);case f:{var Z=_,pe=Z._payload,be=Z._init;try{return Ke(be(pe),O,G)}catch{}}}return""}var tt=Object.prototype.hasOwnProperty,It={},$t=C.ReactDebugCurrentFrame;function yt(_){if(_){var O=_._owner,G=Ke(_.type,_._source,O?O.type:null);$t.setExtraStackFrame(G)}else $t.setExtraStackFrame(null)}function xt(_,O,G,Z,pe){{var be=Function.call.bind(tt);for(var ie in _)if(be(_,ie)){var se=void 0;try{if(typeof _[ie]!="function"){var Ve=Error((Z||"React class")+": "+G+" type `"+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof _[ie]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ve.name="Invariant Violation",Ve}se=_[ie](O,ie,Z,G,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Te){se=Te}se&&!(se instanceof Error)&&(yt(pe),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Z||"React class",G,ie,typeof se),yt(null)),se instanceof Error&&!(se.message in It)&&(It[se.message]=!0,yt(pe),v("Failed %s type: %s",G,se.message),yt(null))}}}var it=Array.isArray;function bt(_){return it(_)}function V(_){{var O=typeof Symbol=="function"&&Symbol.toStringTag,G=O&&_[Symbol.toStringTag]||_.constructor.name||"Object";return G}}function ge(_){try{return fe(_),!1}catch{return!0}}function fe(_){return""+_}function we(_){if(ge(_))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",V(_)),fe(_)}var U=C.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0},Y,L;function B(_){if(tt.call(_,"ref")){var O=Object.getOwnPropertyDescriptor(_,"ref").get;if(O&&O.isReactWarning)return!1}return _.ref!==void 0}function H(_){if(tt.call(_,"key")){var O=Object.getOwnPropertyDescriptor(_,"key").get;if(O&&O.isReactWarning)return!1}return _.key!==void 0}function X(_,O){typeof _.ref=="string"&&U.current}function Q(_,O){{var G=function(){Y||(Y=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};G.isReactWarning=!0,Object.defineProperty(_,"key",{get:G,configurable:!0})}}function re(_,O){{var G=function(){L||(L=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};G.isReactWarning=!0,Object.defineProperty(_,"ref",{get:G,configurable:!0})}}var xe=function(_,O,G,Z,pe,be,ie){var se={$$typeof:e,type:_,key:O,ref:G,props:ie,_owner:be};return se._store={},Object.defineProperty(se._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(se,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.defineProperty(se,"_source",{configurable:!1,enumerable:!1,writable:!1,value:pe}),Object.freeze&&(Object.freeze(se.props),Object.freeze(se)),se};function ne(_,O,G,Z,pe){{var be,ie={},se=null,Ve=null;G!==void 0&&(we(G),se=""+G),H(O)&&(we(O.key),se=""+O.key),B(O)&&(Ve=O.ref,X(O,pe));for(be in O)tt.call(O,be)&&!T.hasOwnProperty(be)&&(ie[be]=O[be]);if(_&&_.defaultProps){var Te=_.defaultProps;for(be in Te)ie[be]===void 0&&(ie[be]=Te[be])}if(se||Ve){var Ne=typeof _=="function"?_.displayName||_.name||"Unknown":_;se&&Q(ie,Ne),Ve&&re(ie,Ne)}return xe(_,se,Ve,pe,Z,U.current,ie)}}var ee=C.ReactCurrentOwner,Be=C.ReactDebugCurrentFrame;function De(_){if(_){var O=_._owner,G=Ke(_.type,_._source,O?O.type:null);Be.setExtraStackFrame(G)}else Be.setExtraStackFrame(null)}var ve;ve=!1;function he(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function Ue(){{if(ee.current){var _=P(ee.current.type);if(_)return`
|
|
49
49
|
|
|
50
|
-
Check the render method of \``+_+"`."}return""}}function
|
|
50
|
+
Check the render method of \``+_+"`."}return""}}function We(_){return""}var rt={};function Tt(_){{var O=Ue();if(!O){var G=typeof _=="string"?_:_.displayName||_.name;G&&(O=`
|
|
51
51
|
|
|
52
|
-
Check the top-level render call using <`+
|
|
52
|
+
Check the top-level render call using <`+G+">.")}return O}}function ot(_,O){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var G=Tt(O);if(rt[G])return;rt[G]=!0;var Z="";_&&_._owner&&_._owner!==ee.current&&(Z=" It was passed a child from "+P(_._owner.type)+"."),De(_),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',G,Z),De(null)}}function Bt(_,O){{if(typeof _!="object")return;if(bt(_))for(var G=0;G<_.length;G++){var Z=_[G];he(Z)&&ot(Z,O)}else if(he(_))_._store&&(_._store.validated=!0);else if(_){var pe=y(_);if(typeof pe=="function"&&pe!==_.entries)for(var be=pe.call(_),ie;!(ie=be.next()).done;)he(ie.value)&&ot(ie.value,O)}}}function Fr(_){{var O=_.type;if(O==null||typeof O=="string")return;var G;if(typeof O=="function")G=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===a||O.$$typeof===d))G=O.propTypes;else return;if(G){var Z=P(O);xt(G,_.props,"prop",Z,_)}else if(O.PropTypes!==void 0&&!ve){ve=!0;var pe=P(O);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",pe||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yt(_){{for(var O=Object.keys(_.props),G=0;G<O.length;G++){var Z=O[G];if(Z!=="children"&&Z!=="key"){De(_),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Z),De(null);break}}_.ref!==null&&(De(_),v("Invalid attribute `ref` supplied to `React.Fragment`."),De(null))}}var vn={};function hr(_,O,G,Z,pe,be){{var ie=z(_);if(!ie){var se="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ve=We();Ve?se+=Ve:se+=Ue();var Te;_===null?Te="null":bt(_)?Te="array":_!==void 0&&_.$$typeof===e?(Te="<"+(P(_.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):Te=typeof _,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Te,se)}var Ne=ne(_,O,G,pe,be);if(Ne==null)return Ne;if(ie){var lt=O.children;if(lt!==void 0)if(Z)if(bt(lt)){for(var pr=0;pr<lt.length;pr++)Bt(lt[pr],_);Object.freeze&&Object.freeze(lt)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Bt(lt,_)}if(tt.call(O,"key")){var Xt=P(_),Ye=Object.keys(O).filter(function(Ra){return Ra!=="key"}),_s=Ye.length>0?"{key: someKey, "+Ye.join(": ..., ")+": ...}":"{key: someKey}";if(!vn[Xt+_s]){var La=Ye.length>0?"{"+Ye.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
53
53
|
let props = %s;
|
|
54
54
|
<%s {...props} />
|
|
55
55
|
React keys must be passed directly to JSX without using spread:
|
|
56
56
|
let props = %s;
|
|
57
|
-
<%s key={someKey} {...props} />`,
|
|
57
|
+
<%s key={someKey} {...props} />`,_s,Xt,La,Xt),vn[Xt+_s]=!0}}return _===n?Yt(Ne):Fr(Ne),Ne}}function Cn(_,O,G){return hr(_,O,G,!0)}function bs(_,O,G){return hr(_,O,G,!1)}var Fa=bs,ja=Cn;Rr.Fragment=n,Rr.jsx=Fa,Rr.jsxs=ja}()),Rr}process.env.NODE_ENV==="production"?Ms.exports=lu():Ms.exports=au();var p=Ms.exports;class Fn{static filter(e,t){return e.filter(t)}static filterBy(e,t,n){return e.filter(s=>s[t]===n)}static filterByFields(e,t){return e.filter(n=>Object.entries(t).every(([s,o])=>n[s]===o))}static sort(e,t,n="asc"){return[...e].sort((s,o)=>{const i=s[t],l=o[t];if(i===l)return 0;let a=0;return i>l&&(a=1),i<l&&(a=-1),n==="asc"?a:-a})}static search(e,t,n){if(!t.trim())return e;const s=t.toLowerCase();return e.filter(o=>n.some(i=>{const l=o[i];return l==null?!1:String(l).toLowerCase().includes(s)}))}static paginate(e,t,n){const s=(t-1)*n,o=s+n;return{data:e.slice(s,o),total:e.length,page:t,totalPages:Math.ceil(e.length/n)}}static groupBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]||(n[o]=[]),n[o].push(s),n},{})}static unique(e,t){const n=e.map(s=>s[t]);return[...new Set(n)]}static countBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]=(n[o]||0)+1,n},{})}static pipe(e,t){return t.reduce((n,s)=>s(n),e)}}function uu({endpoint:r,params:e,layout:t="list",title:n,emptyMessage:s="No items found",renderItem:o,keyExtractor:i=(m,y)=>m.id||m._id||String(y),searchable:l=!1,searchFields:a=[],searchPlaceholder:u="Search...",filters:c=[],pageSize:d=20,onItemClick:f,onRefresh:h,theme:g={}}){const{data:m,loading:y,error:C,refetch:v}=cl(r,e),[E,w]=D.useState(""),[k,x]=D.useState({}),[b,S]=D.useState(1),A=D.useMemo(()=>{if(!m)return{data:[],total:0,totalPages:0};let R=m;return l&&E&&a.length>0&&(R=Fn.search(R,E,a)),Object.keys(k).length>0&&(R=Fn.filterByFields(R,k)),Fn.paginate(R,b,d)},[m,E,k,b,d,l,a]);D.useEffect(()=>{S(1)},[E,k]);const z=()=>{w(""),x({}),S(1),v(),h==null||h()},N={background:g.background||"#ffffff",cardBackground:g.cardBackground||"#f9fafb",text:g.text||"#111827",textSecondary:g.textSecondary||"#6b7280",border:g.border||"#e5e7eb",primary:g.primary||"#3b82f6"},P=o||(R=>p.jsxs("div",{style:{padding:"16px",cursor:f?"pointer":"default"},children:[p.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:N.text},children:R.title||R.name||R.label||"Untitled"}),R.description&&p.jsx("div",{style:{fontSize:"13px",color:N.textSecondary,marginTop:"4px"},children:R.description})]}));return y&&!m?p.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"48px",color:N.textSecondary},children:"Loading..."}):C?p.jsxs("div",{style:{padding:"24px",textAlign:"center",color:"#ef4444"},children:[p.jsx("div",{style:{fontWeight:500,marginBottom:"8px"},children:"Error"}),p.jsx("div",{style:{fontSize:"14px"},children:C.message}),p.jsx("button",{onClick:z,style:{marginTop:"16px",padding:"8px 16px",background:N.primary,color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Retry"})]}):p.jsxs("div",{style:{background:N.background,borderRadius:"12px",overflow:"hidden"},children:[(n||l||c.length>0)&&p.jsxs("div",{style:{padding:"16px",borderBottom:`1px solid ${N.border}`},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:l||c.length>0?"12px":"0"},children:[n&&p.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:N.text},children:n}),p.jsx("button",{onClick:z,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${N.border}`,borderRadius:"6px",color:N.textSecondary,cursor:"pointer",fontSize:"13px"},children:"Refresh"})]}),l&&p.jsx("input",{type:"text",placeholder:u,value:E,onChange:R=>w(R.target.value),style:{width:"100%",padding:"8px 12px",border:`1px solid ${N.border}`,borderRadius:"8px",fontSize:"14px",outline:"none"}})]}),p.jsx("div",{style:{display:t==="grid"?"grid":"flex",flexDirection:t==="list"?"column":void 0,gridTemplateColumns:t==="grid"?"repeat(auto-fill, minmax(250px, 1fr))":void 0,gap:t==="list"?"0":"16px",padding:t==="list"?"0":"16px"},children:A.data.length===0?p.jsx("div",{style:{padding:"48px",textAlign:"center",color:N.textSecondary},children:s}):A.data.map((R,I)=>p.jsx("div",{onClick:()=>f==null?void 0:f(R),style:{background:N.cardBackground,borderRadius:t==="list"?"0":"8px",borderBottom:t==="list"?`1px solid ${N.border}`:"none",transition:"all 0.15s ease"},onMouseEnter:J=>{f&&(J.currentTarget.style.background=N.border)},onMouseLeave:J=>{J.currentTarget.style.background=N.cardBackground},children:P(R,I)},i(R,I)))}),A.totalPages>1&&p.jsxs("div",{style:{padding:"16px",borderTop:`1px solid ${N.border}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[p.jsxs("div",{style:{fontSize:"13px",color:N.textSecondary},children:["Page ",b," of ",A.totalPages]}),p.jsxs("div",{style:{display:"flex",gap:"8px"},children:[p.jsx("button",{onClick:()=>S(R=>Math.max(1,R-1)),disabled:b===1,style:{padding:"6px 12px",border:`1px solid ${N.border}`,borderRadius:"6px",background:"white",cursor:b===1?"not-allowed":"pointer",opacity:b===1?.5:1},children:"Previous"}),p.jsx("button",{onClick:()=>S(R=>Math.min(A.totalPages,R+1)),disabled:b===A.totalPages,style:{padding:"6px 12px",border:`1px solid ${N.border}`,borderRadius:"6px",background:"white",cursor:b===A.totalPages?"not-allowed":"pointer",opacity:b===A.totalPages?.5:1},children:"Next"})]})]})]})}function cu({item:r,onClick:e,title:t=i=>i.title||i.name||i.label||"Untitled",subtitle:n=i=>i.description||i.subtitle||"",image:s=i=>i.image||i.thumbnail||i.photo,badge:o=i=>i.badge||i.tag||i.type}){const i=t(r),l=n(r),a=s(r),u=o(r);return p.jsxs("div",{onClick:e,className:`
|
|
58
58
|
flex items-center gap-4 p-4 border-b border-gray-200
|
|
59
59
|
hover:bg-gray-50 transition-colors
|
|
60
60
|
${e?"cursor-pointer":""}
|
|
61
|
-
`,children:[a&&p.jsx("div",{className:"flex-shrink-0",children:p.jsx("img",{src:a,alt:i,className:"w-16 h-16 object-cover rounded-lg"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h3",{className:"font-medium text-gray-900 truncate",children:i}),u&&p.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&p.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&p.jsx("div",{className:"flex-shrink-0 text-gray-400",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function du({item:r,onClose:e,title:t=o=>o.title||o.name||o.label||"Detail",image:n=o=>o.image||o.thumbnail||o.photo,fields:s=[]}){if(!r)return null;const o=t(r),i=n(r);return p.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:p.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[p.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),e&&p.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"p-6",children:[i&&p.jsx("div",{className:"mb-6",children:p.jsx("img",{src:i,alt:o,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&p.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),p.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&p.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&p.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:p.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const fu={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function hu({nodes:r,cardCount:e=2,minInterval:t=1e3,maxInterval:n=3e3,onCardClick:s,cardSize:o="medium",className:i=""}){const l=Math.min(Math.max(e,1),5),[a,u]=D.useState([]),[c,d]=D.useState([]),[f,h]=D.useState(Array(l).fill(!1)),[g,m]=D.useState(Array(l).fill(!1)),y=D.useRef([]),w=D.useCallback(v=>{const b=r.filter(T=>!v.includes(T._id));if(b.length===0)return null;const S=Math.floor(Math.random()*b.length);return b[S]},[r]),x=D.useCallback(()=>Math.random()*(n-t)+t,[t,n]);D.useEffect(()=>{if(r.length===0){u([]),d([]);return}const v=[],b=[],S=[];for(let T=0;T<l&&T<r.length;T++){const $=w(S);$&&(v.push($),S.push($._id))}for(let T=0;T<v.length;T++){const $=[v[T]._id,...v.filter((j,R)=>R!==T).map(j=>j._id)],N=w($);N?b.push(N):b.push(v[T])}u(v),d(b)},[r,l,w]);const E=D.useCallback(v=>{const b=x(),S=setTimeout(()=>{h(T=>{const $=[...T];return $[v]=!$[v],$}),setTimeout(()=>{m(T=>{const $=[...T];return $[v]=!$[v],$}),setTimeout(()=>{const T=!g[v];T&&u($=>{const N=[...$];return N[v]=c[v],N}),d($=>{const N=[...$],R=[(T?c[v]:a[v])._id,...a.filter((M,X)=>X!==v).map(M=>M._id),...$.filter((M,X)=>X!==v).map(M=>M._id)],L=w(R);return L&&(N[v]=L),N}),setTimeout(()=>{E(v)},150)},200)},150)},b);y.current[v]=S},[x,w,a,c,g]),C=D.useRef(!1);D.useEffect(()=>{if(!(a.length===0||r.length<=1)&&!C.current){C.current=!0;for(let v=0;v<a.length;v++)E(v);return()=>{y.current.forEach(v=>clearTimeout(v)),y.current=[],C.current=!1}}},[a.length,r.length]);const k=v=>{s&&s(v)};return r.length===0?p.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:p.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):a.length===0?p.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:p.jsx("p",{className:"text-gray-500",children:"Loading..."})}):p.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${i}`,children:a.map((v,b)=>{const S=c[b],T=g[b];return p.jsx("div",{className:`relative ${fu[o]}`,style:{perspective:"1000px"},onClick:()=>k(T?S:v),children:p.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${f[b]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[p.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?0:1},children:p.jsxs("div",{style:{transform:f[b]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[p.jsx("img",{src:v.data.image,alt:v.title,className:"w-full h-full object-cover"}),p.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:p.jsx("p",{className:"text-white text-sm font-medium truncate",children:v.title})})]})}),S&&p.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?1:0},children:p.jsxs("div",{style:{transform:f[b]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[p.jsx("img",{src:S.data.image,alt:S.title,className:"w-full h-full object-cover"}),p.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:p.jsx("p",{className:"text-white text-sm font-medium truncate",children:S.title})})]})})]})},`slot-${b}`)})})}function gr(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,o)=>{try{if(s.toUpperCase()==="B"){const i=atob(o);return decodeURIComponent(escape(i))}else if(s.toUpperCase()==="Q"){const i=o.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(i))}}catch(i){console.warn("MIME decode error:",i)}return t}).replace(/\s+/g," ").trim()}const pu={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function gu({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:o=!0,showDetail:i=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:h,onDelete:g,onError:m,onLoad:y,renderItem:w,renderDetail:x,renderActions:E,renderEmpty:C,renderLoading:k,theme:v={}}){const b={...pu,...v},[S,T]=D.useState([]),[$,N]=D.useState(!1),[j,R]=D.useState(null),[L,M]=D.useState(new Set),[X,ce]=D.useState(null),[se,ie]=D.useState(null),[be,he]=D.useState(null),[_e,Se]=D.useState(!1),[Re,Ee]=D.useState(""),ve=a!==void 0?a:Re,Ue=A=>{u?u(A):Ee(A)},Ie=D.useMemo(()=>{if(!ve.trim())return S;const A=ve.toLowerCase();return S.filter(z=>gr(z.from).toLowerCase().includes(A)||gr(z.subject).toLowerCase().includes(A))},[S,ve]),pe=D.useMemo(()=>e?new ol({baseUrl:r,system_id:e}):null,[r,e]),Pe=D.useCallback(async()=>{if(pe){N(!0),R(null);try{const A=await pe.listEmails(t,n,s);A!=null&&A.messages&&(T(A.messages),y==null||y(A.messages))}catch(A){const z=A instanceof Error?A:new Error("Failed to fetch emails");R(z.message),m==null||m(z)}N(!1)}},[pe,t,n,s,m,y]);D.useEffect(()=>{T([]),M(new Set),ie(null),R(null),a===void 0&&Ee(""),d&&Pe()},[s,d]);const ot=D.useCallback(async A=>{if(pe){ie(A),he(null),Se(!0);try{const z=await pe.getEmailParsed(t,A.uid,s||"INBOX");z!=null&&z.body&&he(z.body)}catch(z){console.error("Failed to fetch email body:",z)}Se(!1)}},[pe,t,s]),xt=D.useCallback(A=>{f==null||f(A),i&&ot(A)},[f,i,ot]),Ot=D.useCallback((A,z,H)=>{if(!o){f==null||f(A),i&&ot(A);return}const Y=A.uid;if(H.shiftKey&&X!==null){const ee=Math.min(X,z),le=Math.max(X,z),re=S.slice(ee,le+1).map(we=>we.uid),te=new Set(re);M(te),h==null||h(Array.from(te))}else if(H.ctrlKey||H.metaKey)M(ee=>{const le=new Set(ee);return le.has(Y)?le.delete(Y):le.add(Y),h==null||h(Array.from(le)),le}),ce(z);else{const ee=new Set([Y]);M(ee),ce(z),h==null||h(Array.from(ee))}},[o,X,S,L,f,h,i]),tt=D.useCallback(async()=>{if(!pe||L.size===0)return;const A=s||"INBOX";try{const z=await pe.trashEmails(t,Array.from(L),A);if(console.log("Trash result:",z),z.success&&z.moved>0){T(Y=>Y.filter(ee=>!L.has(ee.uid)));const H=Array.from(L);M(new Set),g==null||g(H)}else R("Failed to move emails to trash")}catch(z){const H=z instanceof Error?z:new Error("Trash failed");console.error("Trash error:",H),R(H.message),m==null||m(H)}},[pe,t,L,s,g,m]),rt=D.useCallback(async()=>{if(!pe||L.size===0)return;const A=s||"INBOX";try{const z=await pe.archiveEmails(t,Array.from(L),A);if(console.log("Archive result:",z),z.success&&z.archived>0){T(Y=>Y.filter(ee=>!L.has(ee.uid)));const H=Array.from(L);M(new Set),g==null||g(H)}else R("Failed to archive emails")}catch(z){const H=z instanceof Error?z:new Error("Archive failed");console.error("Archive error:",H),R(H.message),m==null||m(H)}},[pe,t,L,s,g,m]),lt=D.useCallback(()=>{if(L.size===S.length)M(new Set),h==null||h([]);else{const A=new Set(S.map(z=>z.uid));M(A),h==null||h(Array.from(A))}},[S,L.size,h]),Mt=D.useCallback(()=>{M(new Set),h==null||h([])},[h]),It={delete:tt,archive:rt,refresh:Pe,selectAll:lt,clearSelection:Mt},bt=A=>{if(!A)return"";const z=new Date(A),H=new Date;return z.toDateString()===H.toDateString()?z.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):z.toLocaleDateString([],{month:"short",day:"numeric"})},at=(A,z)=>p.jsx("div",{style:{padding:"12px 16px",background:z?b.selectedBackground:A.seen?b.cardBackground:b.unreadBackground,borderBottom:`1px solid ${b.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:"14px",fontWeight:A.seen?400:600,color:b.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(A.from).split("@")[0]}),p.jsx("div",{style:{fontSize:"14px",fontWeight:A.seen?400:500,color:A.seen?b.textSecondary:b.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(A.subject)||"(No subject)"})]}),p.jsx("div",{style:{fontSize:"12px",color:b.textSecondary,flexShrink:0},children:bt(A.date)})]})}),ut=A=>p.jsxs("div",{style:{padding:"24px"},children:[p.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:b.text},children:gr(A.subject)||"(No subject)"}),p.jsxs("div",{style:{fontSize:"14px",color:b.textSecondary,marginBottom:"16px"},children:["From: ",gr(A.from)," • ",new Date(A.date).toLocaleString()]}),_e?p.jsx("div",{style:{fontSize:"14px",color:b.textSecondary},children:"Loading..."}):be?p.jsx("div",{style:{fontSize:"14px",color:b.text},dangerouslySetInnerHTML:{__html:be}}):p.jsx("div",{style:{fontSize:"14px",color:b.textSecondary},children:"No content available"})]}),_t=(A,z)=>p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:b.cardBackground,borderBottom:`1px solid ${b.border}`},children:[p.jsx("button",{onClick:z.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:b.text},children:A.length===S.length?"Deselect All":"Select All"}),A.length>0&&p.jsxs(p.Fragment,{children:[p.jsxs("span",{style:{fontSize:"13px",color:b.textSecondary},children:[A.length," selected"]}),p.jsx("button",{onClick:z.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),p.jsx("button",{onClick:z.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),p.jsx("div",{style:{flex:1}}),p.jsx("button",{onClick:z.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),W=()=>p.jsx("div",{style:{padding:"48px",textAlign:"center",color:b.textSecondary},children:c}),me=()=>p.jsx("div",{style:{padding:"48px",textAlign:"center",color:b.textSecondary},children:"Loading..."}),Ce=w||at,O=x||ut,B=E||_t,Q=C||W,J=k||me;return $&&S.length===0?p.jsx("div",{style:{background:b.background,width:"100%",height:"100%"},children:J()}):p.jsxs("div",{style:{display:"flex",background:b.background,width:"100%",height:"100%"},children:[p.jsxs("div",{style:{flex:i&&se?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:i&&se?`1px solid ${b.border}`:"none",overflow:"hidden"},children:[o&&B(Array.from(L),It),l&&p.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${b.border}`,background:b.background},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:b.textSecondary,strokeWidth:"2",children:[p.jsx("circle",{cx:"11",cy:"11",r:"8"}),p.jsx("path",{d:"M21 21l-4.35-4.35"})]}),p.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:ve,onChange:A=>Ue(A.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:b.text}}),ve&&p.jsx("button",{onClick:()=>Ue(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:b.textSecondary,strokeWidth:"2",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),j&&p.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:b.danger,fontSize:"14px",borderBottom:`1px solid ${b.border}`},children:j}),p.jsx("div",{style:{flex:1,overflowY:"auto"},children:Ie.length===0?Q():Ie.map((A,z)=>p.jsx("div",{onClick:H=>Ot(A,z,H),onDoubleClick:()=>xt(A),children:Ce(A,L.has(A.uid))},A.uid))})]}),i&&se&&p.jsx("div",{style:{flex:1,overflowY:"auto"},children:O(se)})]})}function mu({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:o=[],emptyMessage:i="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=D.useState(new Set),[d,f]=D.useState(-1),h=r.filter(C=>u.has(C.id)),g=d>=0&&d<h.length?h[d]:null,m=D.useCallback(C=>{c(k=>{const v=new Set(k);return v.has(C)?v.delete(C):v.add(C),t==null||t(Array.from(v)),v})},[t]),y=D.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const C=new Set(r.map(k=>k.id));c(C),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(k=>k.id))}},[r,u.size,t,n]),w=D.useCallback(()=>{if(h.length===0)return;const C=d<=0?h.length-1:d-1;f(C),n==null||n(h[C],C)},[h,d,n]),x=D.useCallback(()=>{if(h.length===0)return;const C=d>=h.length-1?0:d+1;f(C),n==null||n(h[C],C)},[h,d,n]),E=D.useCallback(C=>{s==null||s(C,h,g)},[s,h,g]);return D.useEffect(()=>{h.length===0?f(-1):d>=h.length?f(h.length-1):d<0&&h.length>0&&(f(0),n==null||n(h[0],0))},[h.length,d,n]),r.length===0?p.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:i}):p.jsxs("div",{className:`space-y-2 ${a}`,children:[p.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[l&&p.jsxs("button",{onClick:y,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[p.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),p.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&p.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),h.length>1&&p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{onClick:w,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:p.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),p.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",h.length]}),p.jsx("button",{onClick:x,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:p.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),p.jsx("div",{className:"space-y-1",children:r.map(C=>{const k=u.has(C.id),v=(g==null?void 0:g.id)===C.id;return p.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${v?"bg-blue-50 ring-1 ring-blue-200":k?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(C.id),children:[p.jsx("span",{className:`material-icons text-lg ${k?"text-blue-500":"text-neutral-300"}`,children:k?"check_box":"check_box_outline_blank"}),p.jsx("div",{className:"flex-1 min-w-0",children:e(C,k,v)})]},C.id)})}),o.length>0&&u.size>0&&p.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:o.map(C=>{var v;const k=((v=C.disabled)==null?void 0:v.call(C,h))??!1;return p.jsxs("button",{onClick:()=>E(C.id),disabled:k,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${k?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[C.icon&&p.jsx("span",{className:"material-icons text-sm",children:C.icon}),C.label]},C.id)})})]})}function yu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xu=yu(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const cl=D.createContext(null);function bu(r,e){return{getTheme:function(){return e??null}}}function mt(){const r=D.useContext(cl);return r==null&&xu(8),r}function an(r){return{}}const li={},_u={},dl={},tr={},vr={},en={},Cr={},ts={},Ms={},tn={},rn={},pt={},ai={},ui={},vu={},fl={},Cu={},hl={},wu={},pl={},gl={},Rn={},Du={},ml={},yl={},xl={},Su={},Eu={},ku={},Ki={},bl={},Au={},_l={},vl={},Tu={},rs={},ci={},Is={},Bu={},Nu={},Cn={},wn={},Fu={},ju={},Lu={},yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ru=yt&&"documentMode"in document?document.documentMode:null,dt=yt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Kt=yt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Pn=!(!yt||!("InputEvent"in window)||Ru)&&"getTargetRanges"in new window.InputEvent("input"),ns=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pu=yt&&/Android/.test(navigator.userAgent),Cl=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ou=yt&&Pu&&Cl,di=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Cl,cn=1,Ht=3,sr=0,wl=1,Sr=2,Mu=0,Iu=1,$u=2,On=4,Mn=8,fi=128,zu=112|(3|On|Mn)|fi,hi=1,pi=2,gi=3,mi=4,yi=5,xi=6,ss=ns||un||di?" ":"",jt=`
|
|
61
|
+
`,children:[a&&p.jsx("div",{className:"flex-shrink-0",children:p.jsx("img",{src:a,alt:i,className:"w-16 h-16 object-cover rounded-lg"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h3",{className:"font-medium text-gray-900 truncate",children:i}),u&&p.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&p.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&p.jsx("div",{className:"flex-shrink-0 text-gray-400",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function du({item:r,onClose:e,title:t=o=>o.title||o.name||o.label||"Detail",image:n=o=>o.image||o.thumbnail||o.photo,fields:s=[]}){if(!r)return null;const o=t(r),i=n(r);return p.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:p.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[p.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),e&&p.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"p-6",children:[i&&p.jsx("div",{className:"mb-6",children:p.jsx("img",{src:i,alt:o,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&p.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),p.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&p.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&p.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:p.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const fu={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function hu({nodes:r,cardCount:e=2,minInterval:t=1e3,maxInterval:n=3e3,onCardClick:s,cardSize:o="medium",className:i=""}){const l=Math.min(Math.max(e,1),5),[a,u]=D.useState([]),[c,d]=D.useState([]),[f,h]=D.useState(Array(l).fill(!1)),[g,m]=D.useState(Array(l).fill(!1)),y=D.useRef([]),C=D.useCallback(x=>{const b=r.filter(A=>!x.includes(A._id));if(b.length===0)return null;const S=Math.floor(Math.random()*b.length);return b[S]},[r]),v=D.useCallback(()=>Math.random()*(n-t)+t,[t,n]);D.useEffect(()=>{if(r.length===0){u([]),d([]);return}const x=[],b=[],S=[];for(let A=0;A<l&&A<r.length;A++){const z=C(S);z&&(x.push(z),S.push(z._id))}for(let A=0;A<x.length;A++){const z=[x[A]._id,...x.filter((j,P)=>P!==A).map(j=>j._id)],N=C(z);N?b.push(N):b.push(x[A])}u(x),d(b)},[r,l,C]);const E=D.useCallback(x=>{const b=v(),S=setTimeout(()=>{h(A=>{const z=[...A];return z[x]=!z[x],z}),setTimeout(()=>{m(A=>{const z=[...A];return z[x]=!z[x],z}),setTimeout(()=>{const A=!g[x];A&&u(z=>{const N=[...z];return N[x]=c[x],N}),d(z=>{const N=[...z],P=[(A?c[x]:a[x])._id,...a.filter((I,J)=>J!==x).map(I=>I._id),...z.filter((I,J)=>J!==x).map(I=>I._id)],R=C(P);return R&&(N[x]=R),N}),setTimeout(()=>{E(x)},150)},200)},150)},b);y.current[x]=S},[v,C,a,c,g]),w=D.useRef(!1);D.useEffect(()=>{if(!(a.length===0||r.length<=1)&&!w.current){w.current=!0;for(let x=0;x<a.length;x++)E(x);return()=>{y.current.forEach(x=>clearTimeout(x)),y.current=[],w.current=!1}}},[a.length,r.length]);const k=x=>{s&&s(x)};return r.length===0?p.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:p.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):a.length===0?p.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:p.jsx("p",{className:"text-gray-500",children:"Loading..."})}):p.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${i}`,children:a.map((x,b)=>{const S=c[b],A=g[b];return p.jsx("div",{className:`relative ${fu[o]}`,style:{perspective:"1000px"},onClick:()=>k(A?S:x),children:p.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${f[b]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[p.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:A?0:1},children:p.jsxs("div",{style:{transform:f[b]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[p.jsx("img",{src:x.data.image,alt:x.title,className:"w-full h-full object-cover"}),p.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:p.jsx("p",{className:"text-white text-sm font-medium truncate",children:x.title})})]})}),S&&p.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:A?1:0},children:p.jsxs("div",{style:{transform:f[b]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[p.jsx("img",{src:S.data.image,alt:S.title,className:"w-full h-full object-cover"}),p.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:p.jsx("p",{className:"text-white text-sm font-medium truncate",children:S.title})})]})})]})},`slot-${b}`)})})}function gr(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,o)=>{try{if(s.toUpperCase()==="B"){const i=atob(o);return decodeURIComponent(escape(i))}else if(s.toUpperCase()==="Q"){const i=o.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(i))}}catch(i){console.warn("MIME decode error:",i)}return t}).replace(/\s+/g," ").trim()}const pu={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function gu({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:o=!0,showDetail:i=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:h,onDelete:g,onError:m,onLoad:y,renderItem:C,renderDetail:v,renderActions:E,renderEmpty:w,renderLoading:k,theme:x={}}){const b={...pu,...x},[S,A]=D.useState([]),[z,N]=D.useState(!1),[j,P]=D.useState(null),[R,I]=D.useState(new Set),[J,ae]=D.useState(null),[le,te]=D.useState(null),[Ce,ue]=D.useState(null),[_e,Ee]=D.useState(!1),[Pe,Oe]=D.useState(""),de=a!==void 0?a:Pe,qe=L=>{u?u(L):Oe(L)},Me=D.useMemo(()=>{if(!de.trim())return S;const L=de.toLowerCase();return S.filter(B=>gr(B.from).toLowerCase().includes(L)||gr(B.subject).toLowerCase().includes(L))},[S,de]),ye=D.useMemo(()=>e?new ll({baseUrl:r,system_id:e}):null,[r,e]),je=D.useCallback(async()=>{if(ye){N(!0),P(null);try{const L=await ye.listEmails(t,n,s);L!=null&&L.messages&&(A(L.messages),y==null||y(L.messages))}catch(L){const B=L instanceof Error?L:new Error("Failed to fetch emails");P(B.message),m==null||m(B)}N(!1)}},[ye,t,n,s,m,y]);D.useEffect(()=>{A([]),I(new Set),te(null),P(null),a===void 0&&Oe(""),d&&je()},[s,d]);const ut=D.useCallback(async L=>{if(ye){te(L),ue(null),Ee(!0);try{const B=await ye.getEmailParsed(t,L.uid,s||"INBOX");B!=null&&B.body&&ue(B.body)}catch(B){console.error("Failed to fetch email body:",B)}Ee(!1)}},[ye,t,s]),Ot=D.useCallback(L=>{f==null||f(L),i&&ut(L)},[f,i,ut]),At=D.useCallback((L,B,H)=>{if(!o){f==null||f(L),i&&ut(L);return}const X=L.uid;if(H.shiftKey&&J!==null){const Q=Math.min(J,B),re=Math.max(J,B),xe=S.slice(Q,re+1).map(ee=>ee.uid),ne=new Set(xe);I(ne),h==null||h(Array.from(ne))}else if(H.ctrlKey||H.metaKey)I(Q=>{const re=new Set(Q);return re.has(X)?re.delete(X):re.add(X),h==null||h(Array.from(re)),re}),ae(B);else{const Q=new Set([X]);I(Q),ae(B),h==null||h(Array.from(Q))}},[o,J,S,R,f,h,i]),Mt=D.useCallback(async()=>{if(!ye||R.size===0)return;const L=s||"INBOX";try{const B=await ye.trashEmails(t,Array.from(R),L);if(console.log("Trash result:",B),B.success&&B.moved>0){A(X=>X.filter(Q=>!R.has(Q.uid)));const H=Array.from(R);I(new Set),g==null||g(H)}else P("Failed to move emails to trash")}catch(B){const H=B instanceof Error?B:new Error("Trash failed");console.error("Trash error:",H),P(H.message),m==null||m(H)}},[ye,t,R,s,g,m]),Ke=D.useCallback(async()=>{if(!ye||R.size===0)return;const L=s||"INBOX";try{const B=await ye.archiveEmails(t,Array.from(R),L);if(console.log("Archive result:",B),B.success&&B.archived>0){A(X=>X.filter(Q=>!R.has(Q.uid)));const H=Array.from(R);I(new Set),g==null||g(H)}else P("Failed to archive emails")}catch(B){const H=B instanceof Error?B:new Error("Archive failed");console.error("Archive error:",H),P(H.message),m==null||m(H)}},[ye,t,R,s,g,m]),tt=D.useCallback(()=>{if(R.size===S.length)I(new Set),h==null||h([]);else{const L=new Set(S.map(B=>B.uid));I(L),h==null||h(Array.from(L))}},[S,R.size,h]),It=D.useCallback(()=>{I(new Set),h==null||h([])},[h]),$t={delete:Mt,archive:Ke,refresh:je,selectAll:tt,clearSelection:It},yt=L=>{if(!L)return"";const B=new Date(L),H=new Date;return B.toDateString()===H.toDateString()?B.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):B.toLocaleDateString([],{month:"short",day:"numeric"})},xt=(L,B)=>p.jsx("div",{style:{padding:"12px 16px",background:B?b.selectedBackground:L.seen?b.cardBackground:b.unreadBackground,borderBottom:`1px solid ${b.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:"14px",fontWeight:L.seen?400:600,color:b.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(L.from).split("@")[0]}),p.jsx("div",{style:{fontSize:"14px",fontWeight:L.seen?400:500,color:L.seen?b.textSecondary:b.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(L.subject)||"(No subject)"})]}),p.jsx("div",{style:{fontSize:"12px",color:b.textSecondary,flexShrink:0},children:yt(L.date)})]})}),it=L=>p.jsxs("div",{style:{padding:"24px"},children:[p.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:b.text},children:gr(L.subject)||"(No subject)"}),p.jsxs("div",{style:{fontSize:"14px",color:b.textSecondary,marginBottom:"16px"},children:["From: ",gr(L.from)," • ",new Date(L.date).toLocaleString()]}),_e?p.jsx("div",{style:{fontSize:"14px",color:b.textSecondary},children:"Loading..."}):Ce?p.jsx("div",{style:{fontSize:"14px",color:b.text},dangerouslySetInnerHTML:{__html:Ce}}):p.jsx("div",{style:{fontSize:"14px",color:b.textSecondary},children:"No content available"})]}),bt=(L,B)=>p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:b.cardBackground,borderBottom:`1px solid ${b.border}`},children:[p.jsx("button",{onClick:B.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:b.text},children:L.length===S.length?"Deselect All":"Select All"}),L.length>0&&p.jsxs(p.Fragment,{children:[p.jsxs("span",{style:{fontSize:"13px",color:b.textSecondary},children:[L.length," selected"]}),p.jsx("button",{onClick:B.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),p.jsx("button",{onClick:B.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),p.jsx("div",{style:{flex:1}}),p.jsx("button",{onClick:B.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${b.border}`,borderRadius:"6px",cursor:"pointer",color:b.textSecondary},children:p.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),V=()=>p.jsx("div",{style:{padding:"48px",textAlign:"center",color:b.textSecondary},children:c}),ge=()=>p.jsx("div",{style:{padding:"48px",textAlign:"center",color:b.textSecondary},children:"Loading..."}),fe=C||xt,we=v||it,U=E||bt,T=w||V,Y=k||ge;return z&&S.length===0?p.jsx("div",{style:{background:b.background,width:"100%",height:"100%"},children:Y()}):p.jsxs("div",{style:{display:"flex",background:b.background,width:"100%",height:"100%"},children:[p.jsxs("div",{style:{flex:i&&le?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:i&&le?`1px solid ${b.border}`:"none",overflow:"hidden"},children:[o&&U(Array.from(R),$t),l&&p.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${b.border}`,background:b.background},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:b.textSecondary,strokeWidth:"2",children:[p.jsx("circle",{cx:"11",cy:"11",r:"8"}),p.jsx("path",{d:"M21 21l-4.35-4.35"})]}),p.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:de,onChange:L=>qe(L.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:b.text}}),de&&p.jsx("button",{onClick:()=>qe(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:b.textSecondary,strokeWidth:"2",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),j&&p.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:b.danger,fontSize:"14px",borderBottom:`1px solid ${b.border}`},children:j}),p.jsx("div",{style:{flex:1,overflowY:"auto"},children:Me.length===0?T():Me.map((L,B)=>p.jsx("div",{onClick:H=>At(L,B,H),onDoubleClick:()=>Ot(L),children:fe(L,R.has(L.uid))},L.uid))})]}),i&&le&&p.jsx("div",{style:{flex:1,overflowY:"auto"},children:we(le)})]})}function mu({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:o=[],emptyMessage:i="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=D.useState(new Set),[d,f]=D.useState(-1),h=r.filter(w=>u.has(w.id)),g=d>=0&&d<h.length?h[d]:null,m=D.useCallback(w=>{c(k=>{const x=new Set(k);return x.has(w)?x.delete(w):x.add(w),t==null||t(Array.from(x)),x})},[t]),y=D.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const w=new Set(r.map(k=>k.id));c(w),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(k=>k.id))}},[r,u.size,t,n]),C=D.useCallback(()=>{if(h.length===0)return;const w=d<=0?h.length-1:d-1;f(w),n==null||n(h[w],w)},[h,d,n]),v=D.useCallback(()=>{if(h.length===0)return;const w=d>=h.length-1?0:d+1;f(w),n==null||n(h[w],w)},[h,d,n]),E=D.useCallback(w=>{s==null||s(w,h,g)},[s,h,g]);return D.useEffect(()=>{h.length===0?f(-1):d>=h.length?f(h.length-1):d<0&&h.length>0&&(f(0),n==null||n(h[0],0))},[h.length,d,n]),r.length===0?p.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:i}):p.jsxs("div",{className:`space-y-2 ${a}`,children:[p.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[l&&p.jsxs("button",{onClick:y,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[p.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),p.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&p.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),h.length>1&&p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{onClick:C,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:p.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),p.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",h.length]}),p.jsx("button",{onClick:v,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:p.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),p.jsx("div",{className:"space-y-1",children:r.map(w=>{const k=u.has(w.id),x=(g==null?void 0:g.id)===w.id;return p.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${x?"bg-blue-50 ring-1 ring-blue-200":k?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(w.id),children:[p.jsx("span",{className:`material-icons text-lg ${k?"text-blue-500":"text-neutral-300"}`,children:k?"check_box":"check_box_outline_blank"}),p.jsx("div",{className:"flex-1 min-w-0",children:e(w,k,x)})]},w.id)})}),o.length>0&&u.size>0&&p.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:o.map(w=>{var x;const k=((x=w.disabled)==null?void 0:x.call(w,h))??!1;return p.jsxs("button",{onClick:()=>E(w.id),disabled:k,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${k?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[w.icon&&p.jsx("span",{className:"material-icons text-sm",children:w.icon}),w.label]},w.id)})})]})}function yu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xu=yu(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const dl=D.createContext(null);function bu(r,e){return{getTheme:function(){return e??null}}}function gt(){const r=D.useContext(dl);return r==null&&xu(8),r}function an(r){return{}}const ai={},_u={},fl={},rr={},vr={},en={},Cr={},ns={},Is={},tn={},rn={},ht={},ui={},ci={},vu={},hl={},Cu={},pl={},wu={},gl={},ml={},On={},Du={},yl={},xl={},bl={},Su={},Eu={},ku={},Vi={},_l={},Au={},vl={},Cl={},Tu={},ss={},di={},$s={},Bu={},Nu={},Dn={},Sn={},Fu={},ju={},Lu={},mt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ru=mt&&"documentMode"in document?document.documentMode:null,ct=mt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Vt=mt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Mn=!(!mt||!("InputEvent"in window)||Ru)&&"getTargetRanges"in new window.InputEvent("input"),is=mt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=mt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pu=mt&&/Android/.test(navigator.userAgent),wl=mt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ou=mt&&Pu&&wl,fi=mt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!wl,cn=1,Jt=3,ir=0,Dl=1,Sr=2,Mu=0,Iu=1,$u=2,In=4,$n=8,hi=128,zu=112|(3|In|$n)|hi,pi=1,gi=2,mi=3,yi=4,xi=5,bi=6,os=is||un||fi?" ":"",jt=`
|
|
62
62
|
|
|
63
|
-
`,qu=Kt?" ":ss,Dl="֑-߿יִ-﷽ﹰ-ﻼ",Sl="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Uu=new RegExp("^[^"+Sl+"]*["+Dl+"]"),Wu=new RegExp("^[^"+Dl+"]*["+Sl+"]"),ir={bold:1,code:16,highlight:fi,italic:2,strikethrough:On,subscript:32,superscript:64,underline:Mn},Gu={directionless:1,unmergeable:2},Vi={center:pi,end:xi,justify:mi,left:hi,right:gi,start:yi},Ku={[pi]:"center",[xi]:"end",[mi]:"justify",[hi]:"left",[gi]:"right",[yi]:"start"},Vu={normal:0,segmented:2,token:1},Hu={[Mu]:"normal",[$u]:"segmented",[Iu]:"token"};function Ju(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var q=Ju(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function In(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const Qu=100;let $s=!1,bi=0;function Yu(r){bi=r.timeStamp}function Ss(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&os(r,t)!==void 0}function Xu(r,e,t){const n=it(t._window);let s=null,o=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,o=n.focusOffset);const i=r.nodeValue;i!==null&&Di(e,i,s,o,!1)}function Zu(r,e,t){if(I(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===Ht&&t.isAttached()}function ec(r,e,t,n){for(let s=r;s&&!hc(s);s=fn(s)){const o=os(s,e);if(o!==void 0){const i=We(o,t);if(i)return ge(i)?void 0:[s,i]}else if(s===n)return[n,Ll(t)]}}function El(r,e,t){$s=!0;const n=performance.now()-bi>Qu;try{Ze(r,()=>{const s=V()||function(f){return f.getEditorState().read(()=>{const h=V();return h!==null?h.clone():null})}(r),o=new Map,i=r.getRootElement(),l=r._editorState,a=r._blockCursorElement;let u=!1,c="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,m=h.target,y=ec(m,r,l,i);if(!y)continue;const[w,x]=y;if(g==="characterData")n&&U(x)&&Zu(s,m,x)&&Xu(m,x,r);else if(g==="childList"){u=!0;const E=h.addedNodes;for(let v=0;v<E.length;v++){const b=E[v],S=Fl(b),T=b.parentNode;if(T!=null&&b!==a&&S===null&&!Ss(b,T,r)){if(Kt){const $=b.innerText||b.nodeValue;$&&(c+=$)}T.removeChild(b)}}const C=h.removedNodes,k=C.length;if(k>0){let v=0;for(let b=0;b<k;b++){const S=C[b];(Ss(S,m,r)||a===S)&&(m.appendChild(S),v++)}k!==v&&o.set(w,x)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,r);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const w=g[y],x=w.parentNode;x==null||w.nodeName!=="BR"||Ss(w,m,r)||x.removeChild(w)}}t.takeRecords()}s!==null&&(u&&(s.dirty=!0,Et(s)),Kt&&Ml(r)&&s.insertRawText(c))})}finally{$s=!1}}function kl(r){const e=r._observer;e!==null&&El(r,e.takeRecords(),e)}function Al(r){(function(e){bi===0&&as(e).addEventListener("textInput",Yu,!0)})(r),r._observer=new MutationObserver((e,t)=>{El(r,e,t)})}function Hi(r,e){const t=r.__mode,n=r.__format,s=r.__style,o=e.__mode,i=e.__format,l=e.__style;return!(t!==null&&t!==o||n!==null&&n!==i||s!==null&&s!==l)}function Ji(r,e){const t=r.mergeWithSibling(e),n=Ae()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Qi(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&U(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Hi(e,n)){n=Ji(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&U(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Hi(n,t)){n=Ji(n,t);break}break}t.remove()}}else n.remove()}function Tl(r){return Yi(r.anchor),Yi(r.focus),r}function Yi(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),U(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!F(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let tc=1;const rc=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function _i(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return ge(Er(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&is(e)==null)}function dn(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!_i(e)&&Bl(e)===r}catch{return!1}}function vi(r){return r instanceof hs}function Bl(r){let e=r;for(;e!=null;){const t=is(e);if(vi(t))return t;e=fn(e)}return null}function is(r){return r?r.__lexicalEditor:null}function Zt(r){return r.isToken()||r.isSegmented()}function nc(r){return r.nodeType===Ht}function $n(r){let e=r;for(;e!=null;){if(nc(e))return e;e=e.firstChild}return null}function zn(r,e,t){const n=ir[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function Nl(r){return U(r)||nr(r)||ge(r)}function sc(r,e){if(e!=null)return void(r.__key=e);Qe(),ia();const t=Ae(),n=Rt(),s=""+tc++;n._nodeMap.set(s,r),F(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=wl,r.__key=s}function rr(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),o=r.getNextSibling();if(s===null)if(o!==null){const i=o.getWritable();n.__first=o.__key,i.__prev=null}else n.__first=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(o===null)if(s!==null){const i=s.getWritable();n.__last=s.__key,i.__next=null}else n.__last=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function qn(r){ia();const e=r.getLatest(),t=e.__parent,n=Rt(),s=Ae(),o=n._nodeMap,i=s._dirtyElements;t!==null&&function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent}}(t,o,i);const l=e.__key;s._dirtyType=wl,F(r)?i.set(l,!0):s._dirtyLeaves.add(l)}function qe(r){Qe();const e=Ae(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=We(t);n!==null&&n.getWritable()}if(r!==null){const n=We(r);n!==null&&n.getWritable()}}}function Ut(){return yn()?null:Ae()._compositionKey}function We(r,e){const t=(e||Rt())._nodeMap.get(r);return t===void 0?null:t}function Fl(r,e){const t=os(r,Ae());return t!==void 0?We(t,e):null}function os(r,e){return r[`__lexicalKey_${e._key}`]}function Er(r,e){let t=r;for(;t!=null;){const n=Fl(t,e);if(n!==null)return n;t=fn(t)}return null}function jl(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Xi(r){return r.read(()=>De().getTextContent())}function De(){return Ll(Rt())}function Ll(r){return r._nodeMap.get("root")}function Et(r){Qe();const e=Rt();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function br(r){const e=Ae(),t=function(n,s){let o=n;for(;o!=null;){const i=os(o,s);if(i!==void 0)return i;o=fn(o)}return null}(r,e);return t===null?r===e.getRootElement()?We("root"):null:We(t)}function Zi(r,e){return e?r.getTextContentSize():0}function Rl(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function Ci(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Pl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ol(r){return r.nodeType===Ht?r.nodeValue:null}function wi(r,e,t){const n=it(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:o,focusOffset:i}=n;if(s!==null){let l=Ol(s);const a=Er(s);if(l!==null&&U(a)){if(l===ss&&t){const u=t.length;l=t,o=u,i=u}l!==null&&Di(a,l,o,i,r)}}}function Di(r,e,t,n,s){let o=r;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let l=e;(i||s)&&e[e.length-1]===ss&&(l=e.slice(0,-1));const a=o.getTextContent();if(s||l!==a){if(l===""){if(qe(null),ns||un||di)o.remove();else{const m=Ae();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const u=o.getParent(),c=mn(),d=o.getTextContentSize(),f=Ut(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!i||I(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===r.__key&&c.focus.offset===d&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const g=V();if(!I(g)||t===null||n===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,n),o.isSegmented()){const m=je(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function ic(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(o){const i=o.getPreviousSibling();return(U(i)||F(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function eo(r){return r==="ArrowLeft"}function to(r){return r==="ArrowRight"}function qr(r,e){return dt?r:e}function ro(r){return r==="Enter"}function Pr(r){return r==="Backspace"}function Or(r){return r==="Delete"}function no(r,e,t){return r.toLowerCase()==="a"&&qr(e,t)}function oc(){const r=De();Et(Tl(r.select(0,r.getChildrenSize())))}function Hr(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const o=In(s);return t[e]=o,o}return s}function Si(r,e,t,n,s){if(t.size===0)return;const o=n.__type,i=n.__key,l=e.get(o);l===void 0&&q(33,o);const a=l.klass;let u=r.get(a);u===void 0&&(u=new Map,r.set(a,u));const c=u.get(i),d=c==="destroyed"&&s==="created";(c===void 0||d)&&u.set(i,d?"updated":s)}function so(r,e,t){const n=r.getParent();let s=t,o=r;return n!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=n):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=n)),o.getChildAtIndex(e?s-1:s)}function nn(r,e){const t=r.offset;if(r.type==="element")return so(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?so(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Ml(r){const e=as(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function G(r,e,t){return aa(r,e,t)}function ls(r){return!Ve(r)&&!r.isLastChild()&&!r.isInline()}function Un(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&q(75,e),t}function fn(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Jr(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function as(r){const e=r._window;return e===null&&q(78),e}function lc(r){let e=r.getParentOrThrow();for(;e!==null;){if(kt(e))return e;e=e.getParentOrThrow()}return e}function kt(r){return Ve(r)||F(r)&&r.isShadowRoot()}function Tt(r){const e=Ae(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&q(200,r.constructor.name,t);const{replace:s,replaceWithKlass:o}=n;if(s!==null){const i=s(r),l=i.constructor;return o!==null?i instanceof o||q(201,o.name,o.getType(),l.name,l.getType(),r.constructor.name,t):i instanceof r.constructor&&l!==r.constructor||q(202,l.name,l.getType(),r.constructor.name,t),i.__key===r.__key&&q(203,r.constructor.name,t,l.name,l.getType()),i}return r}function Es(r,e){!Ve(r.getParent())||F(e)||ge(e)||q(99)}function ks(r){return(ge(r)||F(r)&&!r.canBeEmpty())&&!r.isInline()}function Ei(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function ac(r,e,t){let n=r._blockCursorElement;if(I(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,o=s.getNode(),i=s.offset;let l=!1,a=null;if(i===o.getChildrenSize())ks(o.getChildAtIndex(i-1))&&(l=!0);else{const u=o.getChildAtIndex(i);if(u!==null&&ks(u)){const c=u.getPreviousSibling();(c===null||ks(c))&&(l=!0,a=r.getElementByKey(u.__key))}}if(l){const u=r.getElementByKey(o.__key);return n===null&&(r._blockCursorElement=n=function(c){const d=c.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=In(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(r._config)),e.style.caretColor="transparent",void(a===null?u.appendChild(n):u.insertBefore(n,a))}}n!==null&&Ei(n,r,e)}function it(r){return yt?(r||window).getSelection():null}function uc(r){return Lt(r)&&r.tagName==="A"}function Lt(r){return r.nodeType===1}function io(r){return r.nodeType===11}function zs(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function Wn(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function zt(r){if(ge(r)&&!r.isInline())return!0;if(!F(r)||kt(r))return!1;const e=r.getFirstChild(),t=e===null||nr(e)||U(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Mr(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function cc(){return Ae()}const oo=new WeakMap,dc=new Map;function fc(r){if(!r._readOnly&&r.isEmpty())return dc;r._readOnly||q(192);let e=oo.get(r);if(!e){e=new Map,oo.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let o=e.get(s);o||(o=new Map,e.set(s,o)),o.set(t,n)}}return e}function ki(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function Ai(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function hc(r){return r.__lexicalUnmanaged===!0}function Il(r,e,t,n,s,o){let i=r.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(F(i)&&Il(i,l,t,n,s,o),t.has(l)||o.delete(l),s.push(l)),i=i.getNextSibling()}}let Vt,He,sn,us,qs,Us,or,gt,Ws,on,Le="",Ke="",Ct=null,ft="",Ft="",$l=!1,ln=!1,Nn=null;function Gn(r,e){const t=or.get(r);if(e!==null){const n=Vs(r);n.parentNode===e&&e.removeChild(n)}if(gt.has(r)||He._keyToDOMMap.delete(r),F(t)){const n=Vn(t,or);Gs(n,0,n.length-1,null)}t!==void 0&&Si(on,sn,us,t,"destroyed")}function Gs(r,e,t,n){let s=e;for(;s<=t;++s){const o=r[s];o!==void 0&&Gn(o,n)}}function Xt(r,e){r.setProperty("text-align",e)}const pc="40px";function zl(r,e){const t=Vt.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||pc;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function ql(r,e){const t=r.style;e===0?Xt(t,""):e===hi?Xt(t,"left"):e===pi?Xt(t,"center"):e===gi?Xt(t,"right"):e===mi?Xt(t,"justify"):e===yi?Xt(t,"start"):e===xi&&Xt(t,"end")}function Kn(r,e){const t=gt.get(r);t===void 0&&q(60);const n=t.createDOM(Vt,He);if(function(s,o,i){const l=i._keyToDOMMap;(function(a,u,c){a[`__lexicalKey_${u._key}`]=c})(o,i,s),l.set(s,o)}(r,n,He),U(t)?n.setAttribute("data-lexical-text","true"):ge(t)&&n.setAttribute("data-lexical-decorator","true"),F(t)){const s=t.__indent,o=t.__size;if(s!==0&&zl(n,s),o!==0){const l=o-1;(function(a,u,c,d){const f=Ke;Ke="",Ks(a,c,0,u,c.getDOMSlot(d)),Wl(c,d),Ke=f})(Vn(t,gt),l,t,n)}const i=t.__format;i!==0&&ql(n,i),t.isInline()||Ul(null,t,n),ls(t)&&(Le+=jt,Ft+=jt)}else{const s=t.getTextContent();if(ge(t)){const o=t.decorate(He,Vt);o!==null&&Gl(r,o),n.contentEditable="false"}else U(t)&&(t.isDirectionless()||(Ke+=s));Le+=s,Ft+=s}return e!==null&&e.insertChild(n),Si(on,sn,us,t,"created"),n}function Ks(r,e,t,n,s){const o=Le;Le="";let i=t;for(;i<=n;++i){Kn(r[i],s);const l=gt.get(r[i]);l!==null&&U(l)&&(Ct===null&&(Ct=l.getFormat()),ft===""&&(ft=l.getStyle()))}ls(e)&&(Le+=jt),s.element.__lexicalTextContent=Le,Le=o+Le}function lo(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return nr(n)?"line-break":ge(n)&&n.isInline()?"decorator":null}return"empty"}return null}function Ul(r,e,t){const n=lo(r,or),s=lo(e,gt);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Wl(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==Ke||n!==Nn){const o=Ke==="",i=o?Nn:(s=Ke,Uu.test(s)?"rtl":Wu.test(s)?"ltr":null);if(i!==n){const l=e.classList,a=Vt.theme;let u=n!==null?a[n]:void 0,c=i!==null?a[i]:void 0;if(u!==void 0){if(typeof u=="string"){const d=In(u);u=a[n]=d}l.remove(...u)}if(i===null||o&&i==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const d=In(c);c=a[i]=d}c!==void 0&&l.add(...c)}e.dir=i}ln||(r.getWritable().__dir=i)}Nn=i,e.__lexicalDirTextContent=Ke,e.__lexicalDir=i}var s}function gc(r,e,t){const n=Ke;var s;Ke="",Ct=null,ft="",function(o,i,l){const a=Le,u=o.__size,c=i.__size;Le="";const d=l.element;if(u===1&&c===1){const f=o.__first,h=i.__first;if(f===h)Ur(f,d);else{const m=Vs(f),y=Kn(h,null);try{d.replaceChild(y,m)}catch(w){if(typeof w=="object"&&w!=null){const x=`${w.toString()} Parent: ${d.tagName}, new child: {tag: ${y.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;throw new Error(x)}throw w}Gn(f,null)}const g=gt.get(h);U(g)&&(Ct===null&&(Ct=g.getFormat()),ft===""&&(ft=g.getStyle()))}else{const f=Vn(o,or),h=Vn(i,gt);if(f.length!==u&&q(227),h.length!==c&&q(228),u===0)c!==0&&Ks(h,i,0,c-1,l);else if(c===0){if(u!==0){const g=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Gs(f,0,u-1,g?null:d),g&&(d.textContent="")}}else(function(g,m,y,w,x,E){const C=w-1,k=x-1;let v,b,S=E.getFirstChild(),T=0,$=0;for(;T<=C&&$<=k;){const R=m[T],L=y[$];if(R===L)S=As(Ur(L,E.element)),T++,$++;else{v===void 0&&(v=new Set(m)),b===void 0&&(b=new Set(y));const X=b.has(R),ce=v.has(L);if(X)if(ce){const se=Un(He,L);se===S?S=As(Ur(L,E.element)):(E.withBefore(S).insertChild(se),Ur(L,E.element)),T++,$++}else Kn(L,E.withBefore(S)),$++;else S=As(Vs(R)),Gn(R,E.element),T++}const M=gt.get(L);M!==null&&U(M)&&(Ct===null&&(Ct=M.getFormat()),ft===""&&(ft=M.getStyle()))}const N=T>C,j=$>k;if(N&&!j){const R=y[k+1],L=R===void 0?null:He.getElementByKey(R);Ks(y,g,$,k,E.withBefore(L))}else j&&!N&&Gs(m,T,C,E.element)})(i,f,h,u,c,l)}ls(i)&&(Le+=jt),d.__lexicalTextContent=Le,Le=a+Le}(r,e,e.getDOMSlot(t)),Wl(e,t),kr(s=e)&&Ct!=null&&Ct!==s.__textFormat&&!ln&&(s.setTextFormat(Ct),s.setTextStyle(ft)),function(o){kr(o)&&ft!==""&&ft!==o.__textStyle&&!ln&&o.setTextStyle(ft)}(e),Ke=n}function Vn(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&q(101),t.push(n),n=s.__next}return t}function Ur(r,e){const t=or.get(r);let n=gt.get(r);t!==void 0&&n!==void 0||q(61);const s=$l||Us.has(r)||qs.has(r),o=Un(He,r);if(t===n&&!s){if(F(t)){const i=o.__lexicalTextContent;i!==void 0&&(Le+=i,Ft+=i);const l=o.__lexicalDirTextContent;l!==void 0&&(Ke+=l)}else{const i=t.getTextContent();U(t)&&!t.isDirectionless()&&(Ke+=i),Ft+=i,Le+=i}return o}if(t!==n&&s&&Si(on,sn,us,n,"updated"),n.updateDOM(t,o,Vt)){const i=Kn(r,null);return e===null&&q(62),e.replaceChild(i,o),Gn(r,null),i}if(F(t)&&F(n)){const i=n.__indent;i!==t.__indent&&zl(o,i);const l=n.__format;l!==t.__format&&ql(o,l),s&&(gc(t,n,o),Ve(n)||n.isInline()||Ul(t,n,o)),ls(n)&&(Le+=jt,Ft+=jt)}else{const i=n.getTextContent();if(ge(n)){const l=n.decorate(He,Vt);l!==null&&Gl(r,l)}else U(n)&&!n.isDirectionless()&&(Ke+=i);Le+=i,Ft+=i}if(!ln&&Ve(n)&&n.__cachedText!==Ft){const i=n.getWritable();i.__cachedText=Ft,n=i}return o}function Gl(r,e){let t=He._pendingDecorators;const n=He._decorators;if(t===null){if(n[r]===e)return;t=jl(He)}t[r]=e}function As(r){let e=r.nextSibling;return e!==null&&e===He._blockCursorElement&&(e=e.nextSibling),e}function mc(r,e,t,n,s,o){Le="",Ft="",Ke="",$l=n===Sr,Nn=null,He=t,Vt=t._config,sn=t._nodes,us=He._listeners.mutation,qs=s,Us=o,or=r._nodeMap,gt=e._nodeMap,ln=e._readOnly,Ws=new Map(t._keyToDOMMap);const i=new Map;return on=i,Ur("root",null),He=void 0,sn=void 0,qs=void 0,Us=void 0,or=void 0,gt=void 0,Vt=void 0,Ws=void 0,on=void 0,i}function Vs(r){const e=Ws.get(r);return e===void 0&&q(75,r),e}const Nt=Object.freeze({}),Hs=30,Js=[["keydown",function(r,e){if(Qr=r.timeStamp,Kl=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:o,altKey:i}=r;if(!G(e,vu,r)&&t!=null){if(function(l,a,u,c){return to(l)&&!a&&!c&&!u}(t,s,i,o))G(e,fl,r);else if(function(l,a,u,c,d){return to(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))G(e,Cu,r);else if(function(l,a,u,c){return eo(l)&&!a&&!c&&!u}(t,s,i,o))G(e,hl,r);else if(function(l,a,u,c,d){return eo(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))G(e,wu,r);else if(function(l,a,u){return function(c){return c==="ArrowUp"}(l)&&!a&&!u}(t,s,o))G(e,pl,r);else if(function(l,a,u){return function(c){return c==="ArrowDown"}(l)&&!a&&!u}(t,s,o))G(e,gl,r);else if(function(l,a){return ro(l)&&a}(t,n))Yr=!0,G(e,Rn,r);else if(function(l){return l===" "}(t))G(e,Du,r);else if(function(l,a){return dt&&a&&l.toLowerCase()==="o"}(t,s))r.preventDefault(),Yr=!0,G(e,vr,!0);else if(function(l,a){return ro(l)&&!a}(t,n))Yr=!1,G(e,Rn,r);else if(function(l,a,u,c){return dt?!a&&!u&&(Pr(l)||l.toLowerCase()==="h"&&c):!(c||a||u)&&Pr(l)}(t,i,o,s))Pr(t)?G(e,ml,r):(r.preventDefault(),G(e,tr,!0));else if(function(l){return l==="Escape"}(t))G(e,yl,r);else if(function(l,a,u,c,d){return dt?!(u||c||d)&&(Or(l)||l.toLowerCase()==="d"&&a):!(a||c||d)&&Or(l)}(t,s,n,i,o))Or(t)?G(e,xl,r):(r.preventDefault(),G(e,tr,!1));else if(function(l,a,u){return Pr(l)&&(dt?a:u)}(t,i,s))r.preventDefault(),G(e,tn,!0);else if(function(l,a,u){return Or(l)&&(dt?a:u)}(t,i,s))r.preventDefault(),G(e,tn,!1);else if(function(l,a){return dt&&a&&Pr(l)}(t,o))r.preventDefault(),G(e,rn,!0);else if(function(l,a){return dt&&a&&Or(l)}(t,o))r.preventDefault(),G(e,rn,!1);else if(function(l,a,u,c){return l.toLowerCase()==="b"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"bold");else if(function(l,a,u,c){return l.toLowerCase()==="u"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"underline");else if(function(l,a,u,c){return l.toLowerCase()==="i"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"italic");else if(function(l,a,u,c){return l==="Tab"&&!a&&!u&&!c}(t,i,s,o))G(e,Su,r);else if(function(l,a,u,c){return l.toLowerCase()==="z"&&!a&&qr(u,c)}(t,n,o,s))r.preventDefault(),G(e,ai,void 0);else if(function(l,a,u,c){return dt?l.toLowerCase()==="z"&&u&&a:l.toLowerCase()==="y"&&c||l.toLowerCase()==="z"&&c&&a}(t,n,o,s))r.preventDefault(),G(e,ui,void 0);else{const l=e._editorState._selection;l===null||I(l)?!Kt&&no(t,o,s)&&(r.preventDefault(),G(e,Is,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="c"&&(dt?c:d)}(t,n,o,s)?(r.preventDefault(),G(e,rs,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="x"&&(dt?c:d)}(t,n,o,s)?(r.preventDefault(),G(e,ci,r)):no(t,o,s)&&(r.preventDefault(),G(e,Is,r))}(function(l,a,u,c){return l||a||u||c})(s,n,i,o)&&G(e,Lu,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&Ze(e,()=>{ge(Er(t))||(Ys=!0)})}],["compositionstart",function(r,e){Ze(e,()=>{const t=V();if(I(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();qe(n.key),(r.timeStamp<Qr+Hs||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||U(s)&&s.getStyle()!==t.style)&&G(e,Cr,qu)}})}],["compositionend",function(r,e){Kt?Ir=!0:Ze(e,()=>{Ts(e,r.data)})}],["input",function(r,e){r.stopPropagation(),Ze(e,()=>{const t=V(),n=r.data,s=Ql(r);if(n!=null&&I(t)&&Jl(t,s,n,r.timeStamp,!1)){Ir&&(Ts(e,n),Ir=!1);const o=t.anchor.getNode(),i=it(e._window);if(i===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;Pn&&!t.isCollapsed()&&U(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,a)+n+o.getTextContent().slice(a+u)===Ol(i.anchorNode)||G(e,Cr,n);const c=n.length;Kt&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),ns||un||di||!e.isComposing()||(Qr=0,qe(null))}else wi(!1,e,n!==null?n:void 0),Ir&&(Ts(e,n||void 0),Ir=!1);Qe(),kl(Ae())}),xr=null}],["click",function(r,e){Ze(e,()=>{const t=V(),n=it(e._window),s=mn();if(n){if(I(t)){const o=t.anchor,i=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Ve(i)&&De().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(F(i)?i.select(0):i.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const o=n.anchorNode;if(o!==null){const i=o.nodeType;(i===cn||i===Ht)&&Et(Bi(s,n,e,r))}}}G(e,dl,r)})}],["cut",Nt],["copy",Nt],["dragstart",Nt],["dragover",Nt],["dragend",Nt],["paste",Nt],["focus",Nt],["blur",Nt],["drop",Nt]];Pn&&Js.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,o=Ql(t);s==="deleteCompositionText"||Kt&&Ml(n)||s!=="insertCompositionText"&&Ze(n,()=>{const i=V();if(s==="deleteContentBackward"){if(i===null){const h=mn();if(!I(h))return;Et(h.clone())}if(I(i)){const h=i.anchor.key===i.focus.key;if(l=t.timeStamp,Kl==="MediaLast"&&l<Qr+Hs&&n.isComposing()&&h){if(qe(null),Qr=0,setTimeout(()=>{Ze(n,()=>{qe(null)})},Hs),I(i)){const g=i.anchor.getNode();g.markDirty(),i.format=g.getFormat(),U(g)||q(142),i.style=g.getStyle()}}else{qe(null),t.preventDefault();const g=i.anchor.getNode(),m=g.getTextContent(),y=g.canInsertTextAfter(),w=i.anchor.offset===0&&i.focus.offset===m.length;Ou&&h&&!w&&y||G(n,tr,!0)}return}}var l;if(!I(i))return;const a=t.data;xr!==null&&wi(!1,n,xr),i.dirty&&xr===null||!i.isCollapsed()||Ve(i.anchor.getNode())||o===null||i.applyDOMRange(o),xr=null;const u=i.anchor,c=i.focus,d=u.getNode(),f=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":G(n,Cr,t);break;case"insertFromComposition":qe(null),G(n,Cr,t);break;case"insertLineBreak":qe(null),G(n,vr,!1);break;case"insertParagraph":qe(null),Yr&&!un?(Yr=!1,G(n,vr,!1)):G(n,en,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":G(n,ts,t);break;case"deleteByComposition":(function(h,g){return h!==g||F(h)||F(g)||!h.isToken()||!g.isToken()})(d,f)&&G(n,Ms,t);break;case"deleteByDrag":case"deleteByCut":G(n,Ms,t);break;case"deleteContent":G(n,tr,!1);break;case"deleteWordBackward":G(n,tn,!0);break;case"deleteWordForward":G(n,tn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":G(n,rn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":G(n,rn,!1);break;case"formatStrikeThrough":G(n,pt,"strikethrough");break;case"formatBold":G(n,pt,"bold");break;case"formatItalic":G(n,pt,"italic");break;case"formatUnderline":G(n,pt,"underline");break;case"historyUndo":G(n,ai,void 0);break;case"historyRedo":G(n,ui,void 0)}else{if(a===`
|
|
64
|
-
`)t.preventDefault(),
|
|
65
|
-
`){const n=
|
|
66
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const n=t.parentElement;if(n!==null&&
|
|
63
|
+
`,qu=Vt?" ":os,Sl="֑-߿יִ-﷽ﹰ-ﻼ",El="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Uu=new RegExp("^[^"+El+"]*["+Sl+"]"),Wu=new RegExp("^[^"+Sl+"]*["+El+"]"),or={bold:1,code:16,highlight:hi,italic:2,strikethrough:In,subscript:32,superscript:64,underline:$n},Gu={directionless:1,unmergeable:2},Hi={center:gi,end:bi,justify:yi,left:pi,right:mi,start:xi},Ku={[gi]:"center",[bi]:"end",[yi]:"justify",[pi]:"left",[mi]:"right",[xi]:"start"},Vu={normal:0,segmented:2,token:1},Hu={[Mu]:"normal",[$u]:"segmented",[Iu]:"token"};function Ju(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $=Ju(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function zn(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const Qu=100;let zs=!1,_i=0;function Yu(r){_i=r.timeStamp}function Es(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&as(r,t)!==void 0}function Xu(r,e,t){const n=at(t._window);let s=null,o=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,o=n.focusOffset);const i=r.nodeValue;i!==null&&Si(e,i,s,o,!1)}function Zu(r,e,t){if(M(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===Jt&&t.isAttached()}function ec(r,e,t,n){for(let s=r;s&&!hc(s);s=fn(s)){const o=as(s,e);if(o!==void 0){const i=Ge(o,t);if(i)return me(i)?void 0:[s,i]}else if(s===n)return[n,Rl(t)]}}function kl(r,e,t){zs=!0;const n=performance.now()-_i>Qu;try{nt(r,()=>{const s=K()||function(f){return f.getEditorState().read(()=>{const h=K();return h!==null?h.clone():null})}(r),o=new Map,i=r.getRootElement(),l=r._editorState,a=r._blockCursorElement;let u=!1,c="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,m=h.target,y=ec(m,r,l,i);if(!y)continue;const[C,v]=y;if(g==="characterData")n&&q(v)&&Zu(s,m,v)&&Xu(m,v,r);else if(g==="childList"){u=!0;const E=h.addedNodes;for(let x=0;x<E.length;x++){const b=E[x],S=jl(b),A=b.parentNode;if(A!=null&&b!==a&&S===null&&!Es(b,A,r)){if(Vt){const z=b.innerText||b.nodeValue;z&&(c+=z)}A.removeChild(b)}}const w=h.removedNodes,k=w.length;if(k>0){let x=0;for(let b=0;b<k;b++){const S=w[b];(Es(S,m,r)||a===S)&&(m.appendChild(S),x++)}k!==x&&o.set(C,v)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,r);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const C=g[y],v=C.parentNode;v==null||C.nodeName!=="BR"||Es(C,m,r)||v.removeChild(C)}}t.takeRecords()}s!==null&&(u&&(s.dirty=!0,Dt(s)),Vt&&Il(r)&&s.insertRawText(c))})}finally{zs=!1}}function Al(r){const e=r._observer;e!==null&&kl(r,e.takeRecords(),e)}function Tl(r){(function(e){_i===0&&cs(e).addEventListener("textInput",Yu,!0)})(r),r._observer=new MutationObserver((e,t)=>{kl(r,e,t)})}function Ji(r,e){const t=r.__mode,n=r.__format,s=r.__style,o=e.__mode,i=e.__format,l=e.__style;return!(t!==null&&t!==o||n!==null&&n!==i||s!==null&&s!==l)}function Qi(r,e){const t=r.mergeWithSibling(e),n=Ae()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Yi(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ji(e,n)){n=Qi(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ji(n,t)){n=Qi(n,t);break}break}t.remove()}}else n.remove()}function Bl(r){return Xi(r.anchor),Xi(r.focus),r}function Xi(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),q(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!F(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let tc=1;const rc=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function vi(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return me(Er(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&ls(e)==null)}function dn(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!vi(e)&&Nl(e)===r}catch{return!1}}function Ci(r){return r instanceof gs}function Nl(r){let e=r;for(;e!=null;){const t=ls(e);if(Ci(t))return t;e=fn(e)}return null}function ls(r){return r?r.__lexicalEditor:null}function er(r){return r.isToken()||r.isSegmented()}function nc(r){return r.nodeType===Jt}function qn(r){let e=r;for(;e!=null;){if(nc(e))return e;e=e.firstChild}return null}function Un(r,e,t){const n=or[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function Fl(r){return q(r)||sr(r)||me(r)}function sc(r,e){if(e!=null)return void(r.__key=e);Xe(),oa();const t=Ae(),n=Rt(),s=""+tc++;n._nodeMap.set(s,r),F(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=Dl,r.__key=s}function nr(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),o=r.getNextSibling();if(s===null)if(o!==null){const i=o.getWritable();n.__first=o.__key,i.__prev=null}else n.__first=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(o===null)if(s!==null){const i=s.getWritable();n.__last=s.__key,i.__next=null}else n.__last=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function Wn(r){oa();const e=r.getLatest(),t=e.__parent,n=Rt(),s=Ae(),o=n._nodeMap,i=s._dirtyElements;t!==null&&function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent}}(t,o,i);const l=e.__key;s._dirtyType=Dl,F(r)?i.set(l,!0):s._dirtyLeaves.add(l)}function ze(r){Xe();const e=Ae(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=Ge(t);n!==null&&n.getWritable()}if(r!==null){const n=Ge(r);n!==null&&n.getWritable()}}}function Wt(){return yn()?null:Ae()._compositionKey}function Ge(r,e){const t=(e||Rt())._nodeMap.get(r);return t===void 0?null:t}function jl(r,e){const t=as(r,Ae());return t!==void 0?Ge(t,e):null}function as(r,e){return r[`__lexicalKey_${e._key}`]}function Er(r,e){let t=r;for(;t!=null;){const n=jl(t,e);if(n!==null)return n;t=fn(t)}return null}function Ll(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Zi(r){return r.read(()=>Se().getTextContent())}function Se(){return Rl(Rt())}function Rl(r){return r._nodeMap.get("root")}function Dt(r){Xe();const e=Rt();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function br(r){const e=Ae(),t=function(n,s){let o=n;for(;o!=null;){const i=as(o,s);if(i!==void 0)return i;o=fn(o)}return null}(r,e);return t===null?r===e.getRootElement()?Ge("root"):null:Ge(t)}function eo(r,e){return e?r.getTextContentSize():0}function Pl(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function wi(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ol(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ml(r){return r.nodeType===Jt?r.nodeValue:null}function Di(r,e,t){const n=at(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:o,focusOffset:i}=n;if(s!==null){let l=Ml(s);const a=Er(s);if(l!==null&&q(a)){if(l===os&&t){const u=t.length;l=t,o=u,i=u}l!==null&&Si(a,l,o,i,r)}}}function Si(r,e,t,n,s){let o=r;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let l=e;(i||s)&&e[e.length-1]===os&&(l=e.slice(0,-1));const a=o.getTextContent();if(s||l!==a){if(l===""){if(ze(null),is||un||fi)o.remove();else{const m=Ae();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const u=o.getParent(),c=mn(),d=o.getTextContentSize(),f=Wt(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!i||M(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===r.__key&&c.focus.offset===d&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const g=K();if(!M(g)||t===null||n===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,n),o.isSegmented()){const m=Le(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function ic(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(o){const i=o.getPreviousSibling();return(q(i)||F(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function to(r){return r==="ArrowLeft"}function ro(r){return r==="ArrowRight"}function qr(r,e){return ct?r:e}function no(r){return r==="Enter"}function Pr(r){return r==="Backspace"}function Or(r){return r==="Delete"}function so(r,e,t){return r.toLowerCase()==="a"&&qr(e,t)}function oc(){const r=Se();Dt(Bl(r.select(0,r.getChildrenSize())))}function Hr(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const o=zn(s);return t[e]=o,o}return s}function Ei(r,e,t,n,s){if(t.size===0)return;const o=n.__type,i=n.__key,l=e.get(o);l===void 0&&$(33,o);const a=l.klass;let u=r.get(a);u===void 0&&(u=new Map,r.set(a,u));const c=u.get(i),d=c==="destroyed"&&s==="created";(c===void 0||d)&&u.set(i,d?"updated":s)}function io(r,e,t){const n=r.getParent();let s=t,o=r;return n!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=n):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=n)),o.getChildAtIndex(e?s-1:s)}function nn(r,e){const t=r.offset;if(r.type==="element")return io(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?io(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Il(r){const e=cs(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function W(r,e,t){return ua(r,e,t)}function us(r){return!Je(r)&&!r.isLastChild()&&!r.isInline()}function Gn(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&$(75,e),t}function fn(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Jr(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function cs(r){const e=r._window;return e===null&&$(78),e}function lc(r){let e=r.getParentOrThrow();for(;e!==null;){if(St(e))return e;e=e.getParentOrThrow()}return e}function St(r){return Je(r)||F(r)&&r.isShadowRoot()}function kt(r){const e=Ae(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&$(200,r.constructor.name,t);const{replace:s,replaceWithKlass:o}=n;if(s!==null){const i=s(r),l=i.constructor;return o!==null?i instanceof o||$(201,o.name,o.getType(),l.name,l.getType(),r.constructor.name,t):i instanceof r.constructor&&l!==r.constructor||$(202,l.name,l.getType(),r.constructor.name,t),i.__key===r.__key&&$(203,r.constructor.name,t,l.name,l.getType()),i}return r}function ks(r,e){!Je(r.getParent())||F(e)||me(e)||$(99)}function As(r){return(me(r)||F(r)&&!r.canBeEmpty())&&!r.isInline()}function ki(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function ac(r,e,t){let n=r._blockCursorElement;if(M(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,o=s.getNode(),i=s.offset;let l=!1,a=null;if(i===o.getChildrenSize())As(o.getChildAtIndex(i-1))&&(l=!0);else{const u=o.getChildAtIndex(i);if(u!==null&&As(u)){const c=u.getPreviousSibling();(c===null||As(c))&&(l=!0,a=r.getElementByKey(u.__key))}}if(l){const u=r.getElementByKey(o.__key);return n===null&&(r._blockCursorElement=n=function(c){const d=c.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=zn(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(r._config)),e.style.caretColor="transparent",void(a===null?u.appendChild(n):u.insertBefore(n,a))}}n!==null&&ki(n,r,e)}function at(r){return mt?(r||window).getSelection():null}function uc(r){return Lt(r)&&r.tagName==="A"}function Lt(r){return r.nodeType===1}function oo(r){return r.nodeType===11}function qs(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function Kn(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function qt(r){if(me(r)&&!r.isInline())return!0;if(!F(r)||St(r))return!1;const e=r.getFirstChild(),t=e===null||sr(e)||q(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Mr(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function cc(){return Ae()}const lo=new WeakMap,dc=new Map;function fc(r){if(!r._readOnly&&r.isEmpty())return dc;r._readOnly||$(192);let e=lo.get(r);if(!e){e=new Map,lo.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let o=e.get(s);o||(o=new Map,e.set(s,o)),o.set(t,n)}}return e}function Ai(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function Ti(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function hc(r){return r.__lexicalUnmanaged===!0}function $l(r,e,t,n,s,o){let i=r.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(F(i)&&$l(i,l,t,n,s,o),t.has(l)||o.delete(l),s.push(l)),i=i.getNextSibling()}}let Ht,Qe,sn,ds,Us,Ws,lr,pt,Gs,on,Re="",He="",_t=null,dt="",Ft="",zl=!1,ln=!1,jn=null;function Vn(r,e){const t=lr.get(r);if(e!==null){const n=Hs(r);n.parentNode===e&&e.removeChild(n)}if(pt.has(r)||Qe._keyToDOMMap.delete(r),F(t)){const n=Jn(t,lr);Ks(n,0,n.length-1,null)}t!==void 0&&Ei(on,sn,ds,t,"destroyed")}function Ks(r,e,t,n){let s=e;for(;s<=t;++s){const o=r[s];o!==void 0&&Vn(o,n)}}function Zt(r,e){r.setProperty("text-align",e)}const pc="40px";function ql(r,e){const t=Ht.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||pc;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function Ul(r,e){const t=r.style;e===0?Zt(t,""):e===pi?Zt(t,"left"):e===gi?Zt(t,"center"):e===mi?Zt(t,"right"):e===yi?Zt(t,"justify"):e===xi?Zt(t,"start"):e===bi&&Zt(t,"end")}function Hn(r,e){const t=pt.get(r);t===void 0&&$(60);const n=t.createDOM(Ht,Qe);if(function(s,o,i){const l=i._keyToDOMMap;(function(a,u,c){a[`__lexicalKey_${u._key}`]=c})(o,i,s),l.set(s,o)}(r,n,Qe),q(t)?n.setAttribute("data-lexical-text","true"):me(t)&&n.setAttribute("data-lexical-decorator","true"),F(t)){const s=t.__indent,o=t.__size;if(s!==0&&ql(n,s),o!==0){const l=o-1;(function(a,u,c,d){const f=He;He="",Vs(a,c,0,u,c.getDOMSlot(d)),Gl(c,d),He=f})(Jn(t,pt),l,t,n)}const i=t.__format;i!==0&&Ul(n,i),t.isInline()||Wl(null,t,n),us(t)&&(Re+=jt,Ft+=jt)}else{const s=t.getTextContent();if(me(t)){const o=t.decorate(Qe,Ht);o!==null&&Kl(r,o),n.contentEditable="false"}else q(t)&&(t.isDirectionless()||(He+=s));Re+=s,Ft+=s}return e!==null&&e.insertChild(n),Ei(on,sn,ds,t,"created"),n}function Vs(r,e,t,n,s){const o=Re;Re="";let i=t;for(;i<=n;++i){Hn(r[i],s);const l=pt.get(r[i]);l!==null&&q(l)&&(_t===null&&(_t=l.getFormat()),dt===""&&(dt=l.getStyle()))}us(e)&&(Re+=jt),s.element.__lexicalTextContent=Re,Re=o+Re}function ao(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return sr(n)?"line-break":me(n)&&n.isInline()?"decorator":null}return"empty"}return null}function Wl(r,e,t){const n=ao(r,lr),s=ao(e,pt);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Gl(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==He||n!==jn){const o=He==="",i=o?jn:(s=He,Uu.test(s)?"rtl":Wu.test(s)?"ltr":null);if(i!==n){const l=e.classList,a=Ht.theme;let u=n!==null?a[n]:void 0,c=i!==null?a[i]:void 0;if(u!==void 0){if(typeof u=="string"){const d=zn(u);u=a[n]=d}l.remove(...u)}if(i===null||o&&i==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const d=zn(c);c=a[i]=d}c!==void 0&&l.add(...c)}e.dir=i}ln||(r.getWritable().__dir=i)}jn=i,e.__lexicalDirTextContent=He,e.__lexicalDir=i}var s}function gc(r,e,t){const n=He;var s;He="",_t=null,dt="",function(o,i,l){const a=Re,u=o.__size,c=i.__size;Re="";const d=l.element;if(u===1&&c===1){const f=o.__first,h=i.__first;if(f===h)Ur(f,d);else{const m=Hs(f),y=Hn(h,null);try{d.replaceChild(y,m)}catch(C){if(typeof C=="object"&&C!=null){const v=`${C.toString()} Parent: ${d.tagName}, new child: {tag: ${y.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;throw new Error(v)}throw C}Vn(f,null)}const g=pt.get(h);q(g)&&(_t===null&&(_t=g.getFormat()),dt===""&&(dt=g.getStyle()))}else{const f=Jn(o,lr),h=Jn(i,pt);if(f.length!==u&&$(227),h.length!==c&&$(228),u===0)c!==0&&Vs(h,i,0,c-1,l);else if(c===0){if(u!==0){const g=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Ks(f,0,u-1,g?null:d),g&&(d.textContent="")}}else(function(g,m,y,C,v,E){const w=C-1,k=v-1;let x,b,S=E.getFirstChild(),A=0,z=0;for(;A<=w&&z<=k;){const P=m[A],R=y[z];if(P===R)S=Ts(Ur(R,E.element)),A++,z++;else{x===void 0&&(x=new Set(m)),b===void 0&&(b=new Set(y));const J=b.has(P),ae=x.has(R);if(J)if(ae){const le=Gn(Qe,R);le===S?S=Ts(Ur(R,E.element)):(E.withBefore(S).insertChild(le),Ur(R,E.element)),A++,z++}else Hn(R,E.withBefore(S)),z++;else S=Ts(Hs(P)),Vn(P,E.element),A++}const I=pt.get(R);I!==null&&q(I)&&(_t===null&&(_t=I.getFormat()),dt===""&&(dt=I.getStyle()))}const N=A>w,j=z>k;if(N&&!j){const P=y[k+1],R=P===void 0?null:Qe.getElementByKey(P);Vs(y,g,z,k,E.withBefore(R))}else j&&!N&&Ks(m,A,w,E.element)})(i,f,h,u,c,l)}us(i)&&(Re+=jt),d.__lexicalTextContent=Re,Re=a+Re}(r,e,e.getDOMSlot(t)),Gl(e,t),kr(s=e)&&_t!=null&&_t!==s.__textFormat&&!ln&&(s.setTextFormat(_t),s.setTextStyle(dt)),function(o){kr(o)&&dt!==""&&dt!==o.__textStyle&&!ln&&o.setTextStyle(dt)}(e),He=n}function Jn(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&$(101),t.push(n),n=s.__next}return t}function Ur(r,e){const t=lr.get(r);let n=pt.get(r);t!==void 0&&n!==void 0||$(61);const s=zl||Ws.has(r)||Us.has(r),o=Gn(Qe,r);if(t===n&&!s){if(F(t)){const i=o.__lexicalTextContent;i!==void 0&&(Re+=i,Ft+=i);const l=o.__lexicalDirTextContent;l!==void 0&&(He+=l)}else{const i=t.getTextContent();q(t)&&!t.isDirectionless()&&(He+=i),Ft+=i,Re+=i}return o}if(t!==n&&s&&Ei(on,sn,ds,n,"updated"),n.updateDOM(t,o,Ht)){const i=Hn(r,null);return e===null&&$(62),e.replaceChild(i,o),Vn(r,null),i}if(F(t)&&F(n)){const i=n.__indent;i!==t.__indent&&ql(o,i);const l=n.__format;l!==t.__format&&Ul(o,l),s&&(gc(t,n,o),Je(n)||n.isInline()||Wl(t,n,o)),us(n)&&(Re+=jt,Ft+=jt)}else{const i=n.getTextContent();if(me(n)){const l=n.decorate(Qe,Ht);l!==null&&Kl(r,l)}else q(n)&&!n.isDirectionless()&&(He+=i);Re+=i,Ft+=i}if(!ln&&Je(n)&&n.__cachedText!==Ft){const i=n.getWritable();i.__cachedText=Ft,n=i}return o}function Kl(r,e){let t=Qe._pendingDecorators;const n=Qe._decorators;if(t===null){if(n[r]===e)return;t=Ll(Qe)}t[r]=e}function Ts(r){let e=r.nextSibling;return e!==null&&e===Qe._blockCursorElement&&(e=e.nextSibling),e}function mc(r,e,t,n,s,o){Re="",Ft="",He="",zl=n===Sr,jn=null,Qe=t,Ht=t._config,sn=t._nodes,ds=Qe._listeners.mutation,Us=s,Ws=o,lr=r._nodeMap,pt=e._nodeMap,ln=e._readOnly,Gs=new Map(t._keyToDOMMap);const i=new Map;return on=i,Ur("root",null),Qe=void 0,sn=void 0,Us=void 0,Ws=void 0,lr=void 0,pt=void 0,Ht=void 0,Gs=void 0,on=void 0,i}function Hs(r){const e=Gs.get(r);return e===void 0&&$(75,r),e}const Nt=Object.freeze({}),Js=30,Qs=[["keydown",function(r,e){if(Qr=r.timeStamp,Vl=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:o,altKey:i}=r;if(!W(e,vu,r)&&t!=null){if(function(l,a,u,c){return ro(l)&&!a&&!c&&!u}(t,s,i,o))W(e,hl,r);else if(function(l,a,u,c,d){return ro(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))W(e,Cu,r);else if(function(l,a,u,c){return to(l)&&!a&&!c&&!u}(t,s,i,o))W(e,pl,r);else if(function(l,a,u,c,d){return to(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))W(e,wu,r);else if(function(l,a,u){return function(c){return c==="ArrowUp"}(l)&&!a&&!u}(t,s,o))W(e,gl,r);else if(function(l,a,u){return function(c){return c==="ArrowDown"}(l)&&!a&&!u}(t,s,o))W(e,ml,r);else if(function(l,a){return no(l)&&a}(t,n))Yr=!0,W(e,On,r);else if(function(l){return l===" "}(t))W(e,Du,r);else if(function(l,a){return ct&&a&&l.toLowerCase()==="o"}(t,s))r.preventDefault(),Yr=!0,W(e,vr,!0);else if(function(l,a){return no(l)&&!a}(t,n))Yr=!1,W(e,On,r);else if(function(l,a,u,c){return ct?!a&&!u&&(Pr(l)||l.toLowerCase()==="h"&&c):!(c||a||u)&&Pr(l)}(t,i,o,s))Pr(t)?W(e,yl,r):(r.preventDefault(),W(e,rr,!0));else if(function(l){return l==="Escape"}(t))W(e,xl,r);else if(function(l,a,u,c,d){return ct?!(u||c||d)&&(Or(l)||l.toLowerCase()==="d"&&a):!(a||c||d)&&Or(l)}(t,s,n,i,o))Or(t)?W(e,bl,r):(r.preventDefault(),W(e,rr,!1));else if(function(l,a,u){return Pr(l)&&(ct?a:u)}(t,i,s))r.preventDefault(),W(e,tn,!0);else if(function(l,a,u){return Or(l)&&(ct?a:u)}(t,i,s))r.preventDefault(),W(e,tn,!1);else if(function(l,a){return ct&&a&&Pr(l)}(t,o))r.preventDefault(),W(e,rn,!0);else if(function(l,a){return ct&&a&&Or(l)}(t,o))r.preventDefault(),W(e,rn,!1);else if(function(l,a,u,c){return l.toLowerCase()==="b"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,ht,"bold");else if(function(l,a,u,c){return l.toLowerCase()==="u"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,ht,"underline");else if(function(l,a,u,c){return l.toLowerCase()==="i"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,ht,"italic");else if(function(l,a,u,c){return l==="Tab"&&!a&&!u&&!c}(t,i,s,o))W(e,Su,r);else if(function(l,a,u,c){return l.toLowerCase()==="z"&&!a&&qr(u,c)}(t,n,o,s))r.preventDefault(),W(e,ui,void 0);else if(function(l,a,u,c){return ct?l.toLowerCase()==="z"&&u&&a:l.toLowerCase()==="y"&&c||l.toLowerCase()==="z"&&c&&a}(t,n,o,s))r.preventDefault(),W(e,ci,void 0);else{const l=e._editorState._selection;l===null||M(l)?!Vt&&so(t,o,s)&&(r.preventDefault(),W(e,$s,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="c"&&(ct?c:d)}(t,n,o,s)?(r.preventDefault(),W(e,ss,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="x"&&(ct?c:d)}(t,n,o,s)?(r.preventDefault(),W(e,di,r)):so(t,o,s)&&(r.preventDefault(),W(e,$s,r))}(function(l,a,u,c){return l||a||u||c})(s,n,i,o)&&W(e,Lu,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&nt(e,()=>{me(Er(t))||(Xs=!0)})}],["compositionstart",function(r,e){nt(e,()=>{const t=K();if(M(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();ze(n.key),(r.timeStamp<Qr+Js||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||q(s)&&s.getStyle()!==t.style)&&W(e,Cr,qu)}})}],["compositionend",function(r,e){Vt?Ir=!0:nt(e,()=>{Bs(e,r.data)})}],["input",function(r,e){r.stopPropagation(),nt(e,()=>{const t=K(),n=r.data,s=Yl(r);if(n!=null&&M(t)&&Ql(t,s,n,r.timeStamp,!1)){Ir&&(Bs(e,n),Ir=!1);const o=t.anchor.getNode(),i=at(e._window);if(i===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;Mn&&!t.isCollapsed()&&q(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,a)+n+o.getTextContent().slice(a+u)===Ml(i.anchorNode)||W(e,Cr,n);const c=n.length;Vt&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),is||un||fi||!e.isComposing()||(Qr=0,ze(null))}else Di(!1,e,n!==null?n:void 0),Ir&&(Bs(e,n||void 0),Ir=!1);Xe(),Al(Ae())}),xr=null}],["click",function(r,e){nt(e,()=>{const t=K(),n=at(e._window),s=mn();if(n){if(M(t)){const o=t.anchor,i=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Je(i)&&Se().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(F(i)?i.select(0):i.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const o=n.anchorNode;if(o!==null){const i=o.nodeType;(i===cn||i===Jt)&&Dt(Ni(s,n,e,r))}}}W(e,fl,r)})}],["cut",Nt],["copy",Nt],["dragstart",Nt],["dragover",Nt],["dragend",Nt],["paste",Nt],["focus",Nt],["blur",Nt],["drop",Nt]];Mn&&Qs.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,o=Yl(t);s==="deleteCompositionText"||Vt&&Il(n)||s!=="insertCompositionText"&&nt(n,()=>{const i=K();if(s==="deleteContentBackward"){if(i===null){const h=mn();if(!M(h))return;Dt(h.clone())}if(M(i)){const h=i.anchor.key===i.focus.key;if(l=t.timeStamp,Vl==="MediaLast"&&l<Qr+Js&&n.isComposing()&&h){if(ze(null),Qr=0,setTimeout(()=>{nt(n,()=>{ze(null)})},Js),M(i)){const g=i.anchor.getNode();g.markDirty(),i.format=g.getFormat(),q(g)||$(142),i.style=g.getStyle()}}else{ze(null),t.preventDefault();const g=i.anchor.getNode(),m=g.getTextContent(),y=g.canInsertTextAfter(),C=i.anchor.offset===0&&i.focus.offset===m.length;Ou&&h&&!C&&y||W(n,rr,!0)}return}}var l;if(!M(i))return;const a=t.data;xr!==null&&Di(!1,n,xr),i.dirty&&xr===null||!i.isCollapsed()||Je(i.anchor.getNode())||o===null||i.applyDOMRange(o),xr=null;const u=i.anchor,c=i.focus,d=u.getNode(),f=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":W(n,Cr,t);break;case"insertFromComposition":ze(null),W(n,Cr,t);break;case"insertLineBreak":ze(null),W(n,vr,!1);break;case"insertParagraph":ze(null),Yr&&!un?(Yr=!1,W(n,vr,!1)):W(n,en,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":W(n,ns,t);break;case"deleteByComposition":(function(h,g){return h!==g||F(h)||F(g)||!h.isToken()||!g.isToken()})(d,f)&&W(n,Is,t);break;case"deleteByDrag":case"deleteByCut":W(n,Is,t);break;case"deleteContent":W(n,rr,!1);break;case"deleteWordBackward":W(n,tn,!0);break;case"deleteWordForward":W(n,tn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":W(n,rn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":W(n,rn,!1);break;case"formatStrikeThrough":W(n,ht,"strikethrough");break;case"formatBold":W(n,ht,"bold");break;case"formatItalic":W(n,ht,"italic");break;case"formatUnderline":W(n,ht,"underline");break;case"historyUndo":W(n,ui,void 0);break;case"historyRedo":W(n,ci,void 0)}else{if(a===`
|
|
64
|
+
`)t.preventDefault(),W(n,vr,!1);else if(a===jt)t.preventDefault(),W(n,en,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(h)}else a!=null&&Ql(i,o,a,t.timeStamp,!0)?(t.preventDefault(),W(n,Cr,a)):xr=a;Hl=t.timeStamp}})}(r,e)]);let Qr=0,Vl=null,Hl=0,xr=null;const Qn=new WeakMap;let Ys=!1,Xs=!1,Yr=!1,Ir=!1,Jl=[0,"",0,"root",0];function Ql(r,e,t,n,s){const o=r.anchor,i=r.focus,l=o.getNode(),a=Ae(),u=at(a._window),c=u!==null?u.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==i.key||!q(l)||(!s&&(!Mn||Hl<n+50)||l.isDirty()&&h<2||Pl(t))&&o.offset!==i.offset&&!l.isComposing()||er(l)||l.isDirty()&&h>1||(s||!Mn)&&f!==null&&!l.isComposing()&&c!==qn(f)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==r.format||l.getStyle()!==r.style||ic(r,l)}function uo(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===Jt&&e!==0&&e!==r.nodeValue.length}function co(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:o,focusOffset:i}=r;Ys&&(Ys=!1,uo(n,s)&&uo(o,i))||nt(e,()=>{if(!t)return void Dt(null);if(!dn(e,n,o))return;const l=K();if(M(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(l.dirty=!0);const c=cs(e).event,d=c?c.timeStamp:performance.now(),[f,h,g,m,y]=Jl,C=Se(),v=e.isComposing()===!1&&C.getTextContent()==="";if(d<y+200&&a.offset===g&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")q(u)||$(141),l.format=u.getFormat(),l.style=u.getStyle();else if(a.type==="element"&&!v){const E=a.getNode();l.style="",E instanceof Tr&&E.getChildrenSize()===0?(l.format=E.getTextFormat(),l.style=E.getTextStyle()):l.format=0}}else{const c=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),m=g?i:s,y=g?s:i,C=g?d:c,v=g?c:d;let E=zu,w=!1;for(let k=0;k<h;k++){const x=f[k],b=x.getTextContentSize();if(q(x)&&b!==0&&!(k===0&&x.__key===C&&m===b||k===h-1&&x.__key===v&&y===0)&&(w=!0,E&=x.getFormat(),E===0))break}l.format=w?E:0}}W(e,ai,void 0)})}function Yl(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function Bs(r,e){const t=r._compositionKey;if(ze(null),t!==null&&e!=null){if(e===""){const n=Ge(t),s=qn(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&q(n)&&Si(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
65
|
+
`){const n=K();if(M(n)){const s=n.focus;return n.anchor.set(s.key,s.offset,s.type),void W(r,On,null)}}}Di(!0,r,e)}function Xl(r){let e=r.__lexicalEventHandles;return e===void 0&&(e=[],r.__lexicalEventHandles=e),e}const wr=new Map;function Zl(r){const e=r.target,t=at(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const n=Nl(t.anchorNode);if(n===null)return;Xs&&(Xs=!1,nt(n,()=>{const u=mn(),c=t.anchorNode;if(c===null)return;const d=c.nodeType;d!==cn&&d!==Jt||Dt(Ni(u,t,n,r))}));const s=wi(n),o=s[s.length-1],i=o._key,l=wr.get(i),a=l||o;a!==n&&co(t,a,!1),co(t,n,!0),n!==o?wr.set(i,n):l&&wr.delete(i)}function fo(r){r._lexicalHandled=!0}function ho(r){return r._lexicalHandled===!0}function yc(r){const e=r.ownerDocument,t=Qn.get(e);t===void 0&&$(162);const n=t-1;n>=0||$(164),Qn.set(e,n),n===0&&e.removeEventListener("selectionchange",Zl);const s=ls(r);Ci(s)?(function(i){if(i._parentEditor!==null){const l=wi(i),a=l[l.length-1]._key;wr.get(a)===i&&wr.delete(a)}else wr.delete(i._key)}(s),r.__lexicalEditor=null):s&&$(198);const o=Xl(r);for(let i=0;i<o.length;i++)o[i]();r.__lexicalEventHandles=[]}function Zs(r,e,t){Xe();const n=r.__key,s=r.getParent();if(s===null)return;const o=function(l){const a=K();if(!M(a)||!F(l))return a;const{anchor:u,focus:c}=a,d=u.getNode(),f=c.getNode();return Jr(d,l)&&u.set(l.__key,0,"element"),Jr(f,l)&&c.set(l.__key,0,"element"),a}(r);let i=!1;if(M(o)&&e){const l=o.anchor,a=o.focus;l.key===n&&(Xn(l,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0),a.key===n&&(Xn(a,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0)}else vt(o)&&e&&r.isSelected()&&r.selectPrevious();if(M(o)&&e&&!i){const l=r.getIndexWithinParent();nr(r),Yn(o,s,l,-1)}else nr(r);t||St(s)||s.canBeEmpty()||!s.isEmpty()||Zs(s,e),e&&Je(s)&&s.isEmpty()&&s.selectEnd()}class fs{static getType(){$(64,this.name)}static clone(e){$(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,sc(this,e)}getType(){return this.__type}isInline(){$(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Ge(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||K();if(t==null)return!1;const n=t.getNodes().some(s=>s.__key===this.__key);if(q(this))return n;if(M(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(me(this)&&this.isInline()&&s){const o=t.isBackward()?t.focus:t.anchor,i=o.getNode();if(o.offset===i.getChildrenSize()&&i.is(s)&&i.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Ge(e)}getParentOrThrow(){const e=this.getParent();return e===null&&$(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(St(t))return F(e)||e===this&&me(e)||$(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&$(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Ge(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Ge(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();F(this)&&t.unshift(this),F(e)&&n.unshift(e);const s=t.length,o=n.length;if(s===0||o===0||t[s-1]!==n[o-1])return null;const i=new Set(n);for(let l=0;l<s;l++){const a=t[l];if(i.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,s=0,o=this;for(;;){const i=o.getParentOrThrow();if(i===t){n=o.getIndexWithinParent();break}o=i}for(o=e;;){const i=o.getParentOrThrow();if(i===t){s=o.getIndexWithinParent();break}o=i}return n<s}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;n!==null;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],s=new Set;let o=this;for(;o!==null;){const i=o.__key;if(s.has(i)||(s.add(i),n.push(o)),o===e)break;const l=F(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const u=o.getParentOrThrow();if(s.has(u.__key)||n.push(u),u===e)break;let c=null,d=u;do{if(d===null&&$(68),c=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;c!==null||s.has(d.__key)||n.push(d)}while(c===null);o=c}return t||n.reverse(),n}isDirty(){const e=Ae()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=Ge(this.__key);return e===null&&$(113),e}getWritable(){Xe();const e=Rt(),t=Ae(),n=e._nodeMap,s=this.__key,o=this.getLatest(),i=t._cloneNotNeeded,l=K();if(l!==null&&l.setCachedNodes(null),i.has(s))return Wn(o),o;const a=Ai(o);return i.add(s),Wn(a),n.set(s,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){$(70)}updateDOM(e,t,n){$(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){$(72)}static importJSON(e){$(18,this.name)}static transform(){return null}remove(e){Zs(this,!0,e)}replace(e,t){Xe();let n=K();n!==null&&(n=n.clone()),ks(this,e);const s=this.getLatest(),o=this.__key,i=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;nr(l);const c=s.getPreviousSibling(),d=s.getNextSibling(),f=s.__prev,h=s.__next,g=s.__parent;if(Zs(s,!1,!0),c===null?a.__first=i:c.getWritable().__next=i,l.__prev=f,d===null?a.__last=i:d.getWritable().__prev=i,l.__next=h,l.__parent=g,a.__size=u,t&&(F(this)&&F(l)||$(139),this.getChildren().forEach(m=>{l.append(m)})),M(n)){Dt(n);const m=n.anchor,y=n.focus;m.key===o&&yo(m,l),y.key===o&&yo(y,l)}return Wt()===o&&ze(i),l}insertAfter(e,t=!0){Xe(),ks(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.getParent(),i=K();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(nr(s),M(i)){const g=o.__key,m=i.anchor,y=i.focus;l=m.type==="element"&&m.key===g&&m.offset===h+1,a=y.type==="element"&&y.key===g&&y.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),d=s.__key,f=n.__next;if(u===null?c.__last=d:u.getWritable().__prev=d,c.__size++,n.__next=d,s.__next=f,s.__prev=n.__key,s.__parent=n.__parent,t&&M(i)){const h=this.getIndexWithinParent();Yn(i,c,h+1);const g=c.__key;l&&i.anchor.set(g,h+2,"element"),a&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Xe(),ks(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.__key;nr(s);const i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,u=this.getIndexWithinParent();i===null?l.__first=o:i.getWritable().__next=o,l.__size++,n.__prev=o,s.__prev=a,s.__next=n.__key,s.__parent=n.__parent;const c=K();return t&&M(c)&&Yn(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return Fe()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Xe();const n=this.getPreviousSibling(),s=this.getParentOrThrow();if(n===null)return s.select(0,0);if(F(n))return n.select();if(!q(n)){const o=n.getIndexWithinParent()+1;return s.select(o,o)}return n.select(e,t)}selectNext(e,t){Xe();const n=this.getNextSibling(),s=this.getParentOrThrow();if(n===null)return s.select();if(F(n))return n.select(0,0);if(!q(n)){const o=n.getIndexWithinParent();return s.select(o,o)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class hn extends fs{static getType(){return"linebreak"}static clone(e){return new hn(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
66
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const n=t.parentElement;if(n!==null&&Kn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&En(s)){const o=n.lastChild;if(o===t||o.previousSibling===t&&En(o))return!0}}return!1}(e)||function(t){const n=t.parentElement;if(n!==null&&Kn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&En(s))return!1;const o=n.lastChild;if(o===t||o.previousSibling===t&&En(o))return!0}return!1}(e)?null:{conversion:xc,priority:0}}}static importJSON(e){return ar()}exportJSON(){return{type:"linebreak",version:1}}}function xc(r){return{node:ar()}}function ar(){return kt(new hn)}function sr(r){return r instanceof hn}function En(r){return r.nodeType===Jt&&/^( |\t|\r?\n)+$/.test(r.textContent||"")}function Ns(r,e){return 16&e?"code":e&hi?"mark":32&e?"sub":64&e?"sup":null}function Fs(r,e){return 1&e?"strong":2&e?"em":"span"}function ea(r,e,t,n,s){const o=n.classList;let i=Hr(s,"base");i!==void 0&&o.add(...i),i=Hr(s,"underlineStrikethrough");let l=!1;const a=e&$n&&e&In;i!==void 0&&(t&$n&&t&In?(l=!0,a||o.add(...i)):a&&o.remove(...i));for(const u in or){const c=or[u];if(i=Hr(s,u),i!==void 0)if(t&c){if(l&&(u==="underline"||u==="strikethrough")){e&c&&o.remove(...i);continue}e&c&&(!a||u!=="underline")&&u!=="strikethrough"||o.add(...i)}else e&c&&o.remove(...i)}}function ta(r,e,t){const n=e.firstChild,s=t.isComposing(),o=r+(s?os:"");if(n==null)e.textContent=o;else{const i=n.nodeValue;if(i!==o)if(s||Vt){const[l,a,u]=function(c,d){const f=c.length,h=d.length;let g=0,m=0;for(;g<f&&g<h&&c[g]===d[g];)g++;for(;m+g<f&&m+g<h&&c[f-m-1]===d[h-m-1];)m++;return[g,f-g-m,d.slice(g,h-m)]}(i,o);a!==0&&n.deleteData(l,a),n.insertData(l,u)}else n.nodeValue=o}}function po(r,e,t,n,s,o){ta(s,r,e);const i=o.theme.text;i!==void 0&&ea(0,0,n,r,i)}function kn(r,e){const t=document.createElement(e);return t.appendChild(r),t}class Ar extends fs{static getType(){return"text"}static clone(e){return new Ar(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Hu[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Wt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=or[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Un(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,s=Ns(0,n),o=Fs(0,n),i=s===null?o:s,l=document.createElement(i);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(a=document.createElement(o),l.appendChild(a)),po(a,this,0,n,this.__text,e);const u=this.__style;return u!==""&&(l.style.cssText=u),l}updateDOM(e,t,n){const s=this.__text,o=e.__format,i=this.__format,l=Ns(0,o),a=Ns(0,i),u=Fs(0,o),c=Fs(0,i);if((l===null?u:l)!==(a===null?c:a))return!0;if(l===a&&u!==c){const m=t.firstChild;m==null&&$(48);const y=document.createElement(c);return po(y,this,0,i,s,n),t.replaceChild(y,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&$(49)),ta(s,d,this);const f=n.theme.text;f!==void 0&&o!==i&&ea(0,o,i,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Cc,priority:0}),b:()=>({conversion:_c,priority:0}),code:()=>({conversion:zt,priority:0}),em:()=>({conversion:zt,priority:0}),i:()=>({conversion:zt,priority:0}),s:()=>({conversion:zt,priority:0}),span:()=>({conversion:bc,priority:0}),strong:()=>({conversion:zt,priority:0}),sub:()=>({conversion:zt,priority:0}),sup:()=>({conversion:zt,priority:0}),u:()=>({conversion:zt,priority:0})}}static importJSON(e){const t=Le(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Lt(t)||$(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=kn(t,"b")),this.hasFormat("italic")&&(t=kn(t,"i")),this.hasFormat("strikethrough")&&(t=kn(t,"s")),this.hasFormat("underline")&&(t=kn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?or[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Gu[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Un(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Vu[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Xe();let n=e,s=t;const o=K(),i=this.getTextContent(),l=this.__key;if(typeof i=="string"){const a=i.length;n===void 0&&(n=a),s===void 0&&(s=a)}else n=0,s=0;if(!M(o))return sa(l,n,l,s,"text","text");{const a=Wt();a!==o.anchor.key&&a!==o.focus.key||ze(l),o.setTextNodeRange(this,n,this,s)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,s){const o=this.getWritable(),i=o.__text,l=n.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const u=K();if(s&&M(u)){const d=e+l;u.setTextNodeRange(o,d,o,d)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Xe();const t=this.getLatest(),n=t.getTextContent(),s=t.__key,o=Wt(),i=new Set(e),l=[],a=n.length;let u="";for(let k=0;k<a;k++)u!==""&&i.has(k)&&(l.push(u),u=""),u+=n[k];u!==""&&l.push(u);const c=l.length;if(c===0)return[];if(l[0]===n)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),y=t.__detail;let C=!1;t.isSegmented()?(h=Le(d),h.__format=g,h.__style=m,h.__detail=y,C=!0):(h=t.getWritable(),h.__text=d);const v=K(),E=[h];let w=d.length;for(let k=1;k<c;k++){const x=l[k],b=x.length,S=Le(x).getWritable();S.__format=g,S.__style=m,S.__detail=y;const A=S.__key,z=w+b;if(M(v)){const N=v.anchor,j=v.focus;N.key===s&&N.type==="text"&&N.offset>w&&N.offset<=z&&(N.key=A,N.offset-=w,v.dirty=!0),j.key===s&&j.type==="text"&&j.offset>w&&j.offset<=z&&(j.key=A,j.offset-=w,v.dirty=!0)}o===s&&ze(A),w=z,E.push(S)}if(f!==null){(function(b){const S=b.getPreviousSibling(),A=b.getNextSibling();S!==null&&Wn(S),A!==null&&Wn(A)})(this);const k=f.getWritable(),x=this.getIndexWithinParent();C?(k.splice(x,0,E),this.remove()):k.splice(x,1,E),M(v)&&Yn(v,f,x,c-1)}return E}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||$(50);const n=this.__key,s=e.__key,o=this.__text,i=o.length;Wt()===s&&ze(n);const l=K();if(M(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===s&&(Do(d,t,n,e,i),l.dirty=!0),f!==null&&f.key===s&&(Do(f,t,n,e,i),l.dirty=!0)}const a=e.__text,u=t?a+o:o+a;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function bc(r){return{forChild:Bi(r.style),node:null}}function _c(r){const e=r,t=e.style.fontWeight==="normal";return{forChild:Bi(e.style,t?void 0:"bold"),node:null}}const go=new WeakMap;function vc(r){return r.nodeName==="PRE"||r.nodeType===cn&&r.style!==void 0&&r.style.whiteSpace!==void 0&&r.style.whiteSpace.startsWith("pre")}function Cc(r){const e=r;r.parentElement===null&&$(129);let t=e.textContent||"";if(function(n){let s,o=n.parentNode;const i=[n];for(;o!==null&&(s=go.get(o))===void 0&&!vc(o);)i.push(o),o=o.parentNode;const l=s===void 0?o:s;for(let a=0;a<i.length;a++)go.set(i[a],l);return l}(e)!==null){const n=t.split(/(\r?\n|\t)/),s=[],o=n.length;for(let i=0;i<o;i++){const l=n[i];l===`
|
|
67
67
|
`||l===`\r
|
|
68
|
-
`?s.push(
|
|
69
|
-
`),c=!f.isEmpty();else if(c=!1,
|
|
68
|
+
`?s.push(ar()):l===" "?s.push(gn()):l!==""&&s.push(Le(l))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let n=e,s=!0;for(;n!==null&&(n=mo(n,!1))!==null;){const o=n.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let n=e,s=!0;for(;n!==null&&(n=mo(n,!0))!==null;)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:Le(t)}}function mo(r,e){let t=r;for(;;){let n;for(;(n=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=n,t.nodeType===cn){const o=t.style.display;if(o===""&&!qs(t)||o!==""&&!o.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(t.nodeType===Jt)return t;if(t.nodeName==="BR")return null}}const wc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function zt(r){const e=wc[r.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Bi(r.style,e),node:null}}function Le(r=""){return kt(new Ar(r))}function q(r){return r instanceof Ar}function Bi(r,e){const t=r.fontWeight,n=r.textDecoration.split(" "),s=t==="700"||t==="bold",o=n.includes("line-through"),i=r.fontStyle==="italic",l=n.includes("underline"),a=r.verticalAlign;return u=>(q(u)&&(s&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),a!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),a!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class pn extends Ar{static getType(){return"tab"}static clone(e){return new pn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=gn();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){$(126)}setDetail(e){$(127)}setMode(e){$(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function gn(){return kt(new pn)}function Dc(r){return r instanceof pn}class Sc{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const s=this.offset,o=e.offset;if(F(t)){const i=t.getDescendantByIndex(s);t=i??t}if(F(n)){const i=n.getDescendantByIndex(o);n=i??n}return t===n?s<o:t.isBefore(n)}getNode(){const e=Ge(this.key);return e===null&&$(20),e}set(e,t,n){const s=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,yn()||(Wt()===o&&ze(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function Et(r,e,t){return new Sc(r,e,t)}function js(r,e){let t=e.__key,n=r.offset,s="element";if(q(e)){s="text";const o=e.getTextContentSize();n>o&&(n=o)}else if(!F(e)){const o=e.getNextSibling();if(q(o))t=o.__key,n=0,s="text";else{const i=e.getParent();i&&(t=i.__key,n=e.getIndexWithinParent()+1)}}r.set(t,n,s)}function yo(r,e){if(F(e)){const t=e.getLastDescendant();F(t)||q(t)?js(r,t):js(r,e)}else js(r,e)}function Ut(r,e,t,n){r.key=e,r.offset=t,r.type=n}class hs{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!vt(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(s=>n.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new hs(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,s=t[n-1];let o;if(q(s))o=s.select();else{const i=s.getIndexWithinParent()+1;o=s.getParentOrThrow().select(i,i)}o.insertNodes(e);for(let i=0;i<n;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,n=[];for(const s of t){const o=Ge(s);o!==null&&n.push(o)}return yn()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function M(r){return r instanceof Qt}class Qt{constructor(e,t,n,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!M(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,n=this.focus,s=t.isBefore(n),o=s?t:n,i=s?n:t;let l=o.getNode(),a=i.getNode();const u=o.offset,c=i.offset;if(F(l)){const f=l.getDescendantByIndex(u);l=f??l}if(F(a)){let f=a.getDescendantByIndex(c);f!==null&&f!==l&&a.getChildAtIndex(c)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?F(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),yn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,n,s){Ut(this.anchor,e.__key,t,"text"),Ut(this.focus,n.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],n=e[e.length-1],s=this.anchor,o=this.focus,i=s.isBefore(o),[l,a]=ei(this);let u="",c=!0;for(let d=0;d<e.length;d++){const f=e[d];if(F(f)&&!f.isInline())c||(u+=`
|
|
69
|
+
`),c=!f.isEmpty();else if(c=!1,q(f)){let h=f.getTextContent();f===t?f===n?s.type==="element"&&o.type==="element"&&o.offset!==s.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=i?h.slice(l):h.slice(a):f===n&&(h=i?h.slice(0,a):h.slice(0,l)),u+=h}else!me(f)&&!sr(f)||f===n&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){const t=Ae(),n=t.getEditorState()._selection,s=na(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(s===null)return;const[o,i]=s;Ut(this.anchor,o.key,o.offset,o.type),Ut(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Qt(Et(e.key,e.offset,e.type),Et(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Un(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=or[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],s=t.length;for(let o=0;o<s;o++){const i=t[o];i===`
|
|
70
70
|
`||i===`\r
|
|
71
|
-
`?n.push(lr()):i===" "?n.push(gn()):n.push(je(i))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,s=this.format,o=this.style;let i=t,l=n;!this.isCollapsed()&&n.isBefore(t)&&(i=n,l=t),i.type==="element"&&function(y,w,x,E){const C=y.getNode(),k=C.getChildAtIndex(y.offset),v=je(),b=Ve(C)?Fe().append(v):v;v.setFormat(x),v.setStyle(E),k===null?C.append(b):k.insertBefore(b),y.is(w)&&w.set(v.__key,0,"text"),y.set(v.__key,0,"text")}(i,l,s,o);const a=i.offset;let u=l.offset;const c=this.getNodes(),d=c.length;let f=c[0];U(f)||q(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let m=c[d-1];if(d===1&&l.type==="element"&&(u=h,l.set(i.key,u,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let y=f.getNextSibling();if(U(y)&&y.canInsertTextBefore()&&!Zt(y)||(y=je(),y.setFormat(s),y.setStyle(o),g.canInsertTextAfter()?f.insertAfter(y):g.insertAfter(y)),y.select(0,0),f=y,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let y=f.getPreviousSibling();if(U(y)&&!Zt(y)||(y=je(),y.setFormat(s),g.canInsertTextBefore()?f.insertBefore(y):g.insertBefore(y)),y.select(),f=y,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const y=je(f.getTextContent());y.setFormat(s),f.replace(y),f=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||F(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),ta(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const E=je(e);return E.select(),void f.replace(E)}const y=f.getFormat(),w=f.getStyle();if(a!==u||y===s&&w===o){if(Dc(f)){const E=je(e);return E.setFormat(s),E.setStyle(o),E.select(),void f.replace(E)}}else{if(f.getTextContent()!==""){const E=je(e);if(E.setFormat(s),E.setStyle(o),E.select(),a===0)f.insertBefore(E,!1);else{const[C]=f.splitText(a);C.insertAfter(E,!1)}return void(E.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(s),f.setStyle(o)}const x=u-a;f=f.spliceText(a,x,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=y,this.style=w))}else{const y=new Set([...f.getParentKeys(),...m.getParentKeys()]),w=F(f)?f:f.getParentOrThrow();let x=F(m)?m:m.getParentOrThrow(),E=m;if(!w.is(x)&&x.isInline())do E=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(u!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<u)if(U(m)&&!m.isToken()&&u!==m.getTextContentSize()){if(m.isSegmented()){const S=je(m.getTextContent());m.replace(S),m=S}Ve(l.getNode())||l.type!=="text"||(m=m.spliceText(0,u,"")),y.add(m.__key)}else{const S=m.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?m.remove():S.remove()}else y.add(m.__key);const C=x.getChildren(),k=new Set(c),v=w.is(x),b=w.isInline()&&f.getNextSibling()===null?w:f;for(let S=C.length-1;S>=0;S--){const T=C[S];if(T.is(f)||F(T)&&T.isParentOf(f))break;T.isAttached()&&(!k.has(T)||T.is(E)?v||b.insertAfter(T,!1):T.remove())}if(!v){let S=x,T=null;for(;S!==null;){const $=S.getChildren(),N=$.length;(N===0||$[N-1].is(T))&&(y.delete(S.__key),T=S),S=S.getParent()}}if(f.isToken())if(a===h)f.select();else{const S=je(e);S.select(),f.replace(S)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let S=1;S<d;S++){const T=c[S],$=T.__key;y.has($)||T.remove()}}}removeText(){if(this.isCollapsed())return;const{anchor:e,focus:t}=this,n=this.getNodes(),s=this.isBackward()?t:e,o=this.isBackward()?e:t;let i=s.getNode(),l=o.getNode();const a=Mr(i,zt),u=Mr(l,zt);U(i)&&i.isToken()&&s.offset<i.getTextContentSize()&&(s.offset=0),o.offset>0&&U(l)&&l.isToken()&&(o.offset=l.getTextContentSize()),n.forEach(d=>{Jr(i,d)||Jr(l,d)||d.getKey()===i.getKey()||d.getKey()===l.getKey()||d.remove()});const c=(d,f)=>{if(d.getTextContent()==="")d.remove();else if(f!==0&&Zt(d)){const h=je(d.getTextContent());return h.setFormat(d.getFormat()),h.setStyle(d.getStyle()),d.replace(h)}};if(i===l&&U(i)){const d=Math.abs(t.offset-e.offset);return i.spliceText(s.offset,d,"",!0),void c(i,d)}if(U(i)){const d=i.getTextContentSize()-s.offset;i.spliceText(s.offset,d,""),i=c(i,d)||i}U(l)&&(l.spliceText(0,o.offset,""),l=c(l,o.offset)||l),i.isAttached()&&U(i)?i.selectEnd():l.isAttached()&&U(l)&&l.selectStart(),F(a)&&F(u)&&a!==u&&(a.append(...u.getChildren()),u.remove(),o.set(s.key,s.offset,s.type))}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void qe(null);const n=this.getNodes(),s=[];for(const C of n)U(C)&&s.push(C);const o=C=>{n.forEach(k=>{if(kr(k)){const v=k.getFormatFlags(e,C);k.setTextFormat(v)}})},i=s.length;if(i===0)return this.toggleFormat(e),qe(null),void o(t);const l=this.anchor,a=this.focus,u=this.isBackward(),c=u?a:l,d=u?l:a;let f=0,h=s[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(f=1,h=s[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);o(m);const y=i-1;let w=s[y];const x=d.type==="text"?d.offset:w.getTextContentSize();if(h.is(w)){if(g===x)return;if(Zt(h)||g===0&&x===h.getTextContentSize())h.setFormat(m);else{const C=h.splitText(g,x),k=g===0?C[0]:C[1];k.setFormat(m),c.type==="text"&&c.set(k.__key,0,"text"),d.type==="text"&&d.set(k.__key,x-g,"text")}return void(this.format=m)}g===0||Zt(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const E=w.getFormatFlags(e,m);x>0&&(x===w.getTextContentSize()||Zt(w)||([w]=w.splitText(x)),w.setFormat(E));for(let C=f+1;C<y;C++){const k=s[C],v=k.getFormatFlags(e,E);k.setFormat(v)}c.type==="text"&&c.set(h.__key,g,"text"),d.type==="text"&&d.set(w.__key,x,"text"),this.format=m|E}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=V();return I(g)||q(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Mr(t,zt),s=e[e.length-1];if(F(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=js(this);n.splice(g,0,e),s.selectEnd()}return}if(!e.some(g=>(F(g)||ge(g))&&!g.isInline())){F(n)||q(211,t.constructor.name,t.getType());const g=js(this);return n.splice(g,0,e),void s.selectEnd()}const o=function(g){const m=Fe();let y=null;for(let w=0;w<g.length;w++){const x=g[w],E=nr(x);if(E||ge(x)&&x.isInline()||F(x)&&x.isInline()||U(x)||x.isParentRequired()){if(y===null&&(y=x.createParentElementNode(),m.append(y),E))continue;y!==null&&y.append(x)}else m.append(x),y=null}return m}(e),i=o.getLastDescendant(),l=o.getChildren(),a=!F(n)||!n.isEmpty()?this.insertParagraph():null,u=l[l.length-1];let c=l[0];var d;F(d=c)&&zt(d)&&!d.isEmpty()&&F(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(F(n)||q(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=l[1]),c&&(n===null&&q(212,t.constructor.name,t.getType()),function(g,m,y){const w=m.getParentOrThrow().getLastChild();let x=m;const E=[m];for(;x!==w;)x.getNextSibling()||q(140),x=x.getNextSibling(),E.push(x);let C=g;for(const k of E)C=C.insertAfter(k)}(n,c));const f=Mr(i,zt);a&&F(f)&&(a.canMergeWhenEmpty()||zt(u))&&(f.append(...a.getChildren()),a.remove()),F(n)&&n.isEmpty()&&n.remove(),i.selectEnd();const h=F(n)?n.getLastChild():null;nr(h)&&f!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=Fe();return De().splice(this.anchor.offset,0,[i]),i.select(),i}const e=js(this),t=Mr(this.anchor.getNode(),zt);F(t)||q(213);const n=t.getChildAtIndex(e),s=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=lr();if(this.insertNodes([t]),e){const n=t.getParentOrThrow(),s=t.getIndexWithinParent();n.select(s,s)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,s=this.anchor,o=this.focus;let i=e[0],l=e[n];const[a,u]=Zs(this);if(t===0)return[];if(t===1){if(U(i)&&!this.isCollapsed()){const d=a>u?u:a,f=a>u?a:u,h=i.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[i]}const c=s.isBefore(o);if(U(i)){const d=c?a:u;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(U(l)){const d=l.getTextContent().length,f=c?u:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[n]=l)}return e}modify(e,t,n){const s=this.focus,o=this.anchor,i=e==="move",l=nn(s,t);if(ge(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=vo();return h.add(l.__key),void Et(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(U(f)){const h=f.__key,g=t?f.getTextContent().length:0;return s.set(h,g,"text"),void(i&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return F(f)?(m=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),s.set(m,g,"element"),void(i&&o.set(m,g,"element"))}}const a=Ae(),u=it(a._window);if(!u)return;const c=a._blockCursorElement,d=a._rootElement;if(d===null||c===null||!F(l)||l.isInline()||l.canBeEmpty()||Ei(c,a,d),function(f,h,g,m){f.modify(h,g,m)}(u,e,t?"backward":"forward",n),u.rangeCount>0){const f=u.getRangeAt(0),h=this.anchor.getNode(),g=Ve(h)?h:lc(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const m=this.getNodes(),y=[];let w=!1;for(let x=0;x<m.length;x++){const E=m[x];Jr(E,g)?y.push(E):w=!0}if(w&&y.length>0)if(t){const x=y[0];F(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=y[y.length-1];F(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}u.anchorNode===f.startContainer&&u.anchorOffset===f.startOffset||function(x){const E=x.focus,C=x.anchor,k=C.key,v=C.offset,b=C.type;qt(C,E.key,E.offset,E.type),qt(E,k,v,b),x._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&F(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(F(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let s=n.getNode();if(this.forwardDeletion(n,s,e))return;const o=this.focus,i=nn(o,e);if(ge(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&F(s)&&s.getChildrenSize()===0){s.remove();const l=vo();l.add(i.__key),Et(l)}else i.remove(),Ae().dispatchCommand(li,void 0);return}if(!e&&F(i)&&F(s)&&s.isEmpty())return s.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(s=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,u=l.getTextContentSize();if(l.is(s)||e&&a!==u||!e&&a!==0)return void xo(l,e,a)}else if(s!==null&&s.isSegmented()){const a=n.offset,u=s.getTextContentSize();if(s.is(l)||e&&a!==0||!e&&a!==u)return void xo(s,e,a)}(function(a,u){const c=a.anchor,d=a.focus,f=c.getNode(),h=d.getNode();if(f===h&&c.type==="text"&&d.type==="text"){const g=c.offset,m=d.offset,y=g<m,w=y?g:m,x=y?m:g,E=x-1;w!==E&&(Rl(f.getTextContent().slice(w,x))||(u?d.offset=E:c.offset=E))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&Ve(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),this.isCollapsed()&&this.anchor.offset===0&&this.modify("extend",e,"character"),t){const n=e?this.anchor:this.focus;n.set(n.key,n.offset+1,n.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function wt(r){return r instanceof ds}function yo(r){const e=r.offset;if(r.type==="text")return e;const t=r.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Zs(r){const e=r.getStartEndPoints();if(e===null)return[0,0];const[t,n]=e;return t.type==="element"&&n.type==="element"&&t.key===n.key&&t.offset===n.offset?[0,0]:[yo(t),yo(n)]}function xo(r,e,t){const n=r,s=n.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,l=0;for(let u=0;u<o;u++){const c=u===o-1;if(l=i,i+=s[u].length,e&&i===t||i>t||c){s.splice(u,1),c&&(l=void 0);break}}const a=s.join("").trim();a===""?n.remove():(n.setTextContent(a),n.select(l,l))}function bo(r,e,t,n){let s,o=e;if(r.nodeType===cn){let i=!1;const l=r.childNodes,a=l.length,u=n._blockCursorElement;o===a&&(i=!0,o=a-1);let c=l[o],d=!1;if(c===u)c=l[o+1],d=!0;else if(u!==null){const f=u.parentNode;r===f&&e>Array.prototype.indexOf.call(f.children,u)&&o--}if(s=br(c),U(s))o=Zi(s,i);else{let f=br(r);if(f===null)return null;if(F(f)){const h=n.getElementByKey(f.getKey());h===null&&q(214),[f,o]=f.getDOMSlot(h).resolveChildIndex(f,h,r,e),F(f)||q(215),i&&o>=f.getChildrenSize()&&(o=Math.max(0,f.getChildrenSize()-1));let m=f.getChildAtIndex(o);if(F(m)&&function(y,w,x){const E=y.getParent();return x===null||E===null||!E.canBeEmpty()||E!==x.getNode()}(m,0,t)){const y=i?m.getLastDescendant():m.getFirstDescendant();y===null?f=m:(m=y,f=F(m)?m:m.getParentOrThrow()),o=0}U(m)?(s=m,f=null,o=Zi(m,i)):m!==f&&i&&!d&&(F(f)||q(216),o=Math.min(f.getChildrenSize(),o+1))}else{const h=f.getIndexWithinParent();o=e===0&&ge(f)&&br(r)===f?h:h+1,f=f.getParentOrThrow()}if(F(f))return At(f.__key,o,"element")}}else s=br(r);return U(s)?At(s.__key,o,"text"):null}function _o(r,e,t){const n=r.offset,s=r.getNode();if(n===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&F(i)&&i.isInline()){const l=i.getPreviousSibling();U(l)&&(r.key=l.__key,r.offset=l.getTextContent().length)}}else F(o)&&!t&&o.isInline()?(r.key=o.__key,r.offset=o.getChildrenSize(),r.type="element"):U(o)&&(r.key=o.__key,r.offset=o.getTextContent().length)}else if(n===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&F(o)&&o.isInline())r.key=o.__key,r.offset=0,r.type="element";else if((t||e)&&o===null&&F(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();U(l)&&(r.key=l.__key,r.offset=0)}}}function ta(r,e,t){if(r.type==="text"&&e.type==="text"){const n=r.isBefore(e),s=r.is(e);_o(r,n,s),_o(e,!n,s),s&&(e.key=r.key,e.offset=r.offset,e.type=r.type);const o=Ae();if(o.isComposing()&&o._compositionKey!==r.key&&I(t)){const i=t.anchor,l=t.focus;qt(r,i.key,i.offset,i.type),qt(e,l.key,l.offset,l.type)}}}function ra(r,e,t,n,s,o){if(r===null||t===null||!dn(s,r,t))return null;const i=bo(r,e,I(o)?o.anchor:null,s);if(i===null)return null;const l=bo(t,n,I(o)?o.focus:null,s);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const a=br(r),u=br(t);if(ge(a)&&ge(u))return null}return ta(i,l,o),[i,l]}function ei(r){return F(r)&&!r.isInline()}function na(r,e,t,n,s,o){const i=Rt(),l=new Jt(At(r,e,s),At(t,n,o),0,"");return l.dirty=!0,i._selection=l,l}function Ec(){const r=At("root",0,"element"),e=At("root",0,"element");return new Jt(r,e,0,"")}function vo(){return new ds(new Set)}function Bi(r,e,t,n){const s=t._window;if(s===null)return null;const o=n||s.event,i=o?o.type:void 0,l=i==="selectionchange",a=!$s&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let u,c,d,f;if(I(r)&&!a)return r.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&I(r)&&!dn(t,u,c))return r.clone();const h=ra(u,d,c,f,t,r);if(h===null)return null;const[g,m]=h;return new Jt(g,m,I(r)?r.format:0,I(r)?r.style:"")}function V(){return Rt()._selection}function mn(){return Ae()._editorState._selection}function Jn(r,e,t,n=1){const s=r.anchor,o=r.focus,i=s.getNode(),l=o.getNode();if(!e.is(i)&&!e.is(l))return;const a=e.__key;if(r.isCollapsed()){const u=s.offset;if(t<=u&&n>0||t<u&&n<0){const c=Math.max(0,u+n);s.set(a,c,"element"),o.set(a,c,"element"),Co(r)}}else{const u=r.isBackward(),c=u?o:s,d=c.getNode(),f=u?s:o,h=f.getNode();if(e.is(d)){const g=c.offset;(t<=g&&n>0||t<g&&n<0)&&c.set(a,Math.max(0,g+n),"element")}if(e.is(h)){const g=f.offset;(t<=g&&n>0||t<g&&n<0)&&f.set(a,Math.max(0,g+n),"element")}}Co(r)}function Co(r){const e=r.anchor,t=e.offset,n=r.focus,s=n.offset,o=e.getNode(),i=n.getNode();if(r.isCollapsed()){if(!F(o))return;const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),n.set(u.__key,c,"text")}}else{if(F(o)){const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(F(i)){const l=i.getChildrenSize(),a=s>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(s);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),n.set(u.__key,c,"text")}}}}function Qn(r,e,t,n,s){let o=null,i=0,l=null;n!==null?(o=n.__key,U(n)?(i=n.getTextContentSize(),l="text"):F(n)&&(i=n.getChildrenSize(),l="element")):s!==null&&(o=s.__key,U(s)?l="text":F(s)&&(l="element")),o!==null&&l!==null?r.set(o,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),r.set(t.__key,i,"element"))}function wo(r,e,t,n,s){r.type==="text"?(r.key=t,e||(r.offset+=s)):r.offset>n.getIndexWithinParent()&&(r.offset-=1)}function kc(r,e,t,n,s,o,i){const l=n.anchorNode,a=n.focusNode,u=n.anchorOffset,c=n.focusOffset,d=document.activeElement;if(s.has("collaboration")&&d!==o||d!==null&&_i(d))return;if(!I(e))return void(r!==null&&dn(t,l,a)&&n.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,m=h.key,y=Un(t,g),w=Un(t,m),x=f.offset,E=h.offset,C=e.format,k=e.style,v=e.isCollapsed();let b=y,S=w,T=!1;if(f.type==="text"){b=$n(y);const M=f.getNode();T=M.getFormat()!==C||M.getStyle()!==k}else I(r)&&r.anchor.type==="text"&&(T=!0);var $,N,j,R,L;if(h.type==="text"&&(S=$n(w)),b!==null&&S!==null&&(v&&(r===null||T||I(r)&&(r.format!==C||r.style!==k))&&($=C,N=k,j=x,R=g,L=performance.now(),Hl=[$,N,j,R,L]),u!==x||c!==E||l!==b||a!==S||n.type==="Range"&&v||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{n.setBaseAndExtent(b,x,S,E)}catch{}if(!s.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const M=e instanceof Jt&&e.anchor.type==="element"?b.childNodes[x]||null:n.rangeCount>0?n.getRangeAt(0):null;if(M!==null){let X;if(M instanceof Text){const ce=document.createRange();ce.selectNode(M),X=ce.getBoundingClientRect()}else X=M.getBoundingClientRect();(function(ce,se,ie){const be=ie.ownerDocument,he=be.defaultView;if(he===null)return;let{top:_e,bottom:Se}=se,Re=0,Ee=0,ve=ie;for(;ve!==null;){const Ue=ve===be.body;if(Ue)Re=0,Ee=as(ce).innerHeight;else{const pe=ve.getBoundingClientRect();Re=pe.top,Ee=pe.bottom}let Ie=0;if(_e<Re?Ie=-(Re-_e):Se>Ee&&(Ie=Se-Ee),Ie!==0)if(Ue)he.scrollBy(0,Ie);else{const pe=ve.scrollTop;ve.scrollTop+=Ie;const Pe=ve.scrollTop-pe;_e-=Pe,Se-=Pe}if(Ue)break;ve=fn(ve)}})(t,X,o)}}Qs=!0}}function sa(r){let e=V()||mn();e===null&&(e=De().selectEnd()),e.insertNodes(r)}function js(r){let e=r;r.isCollapsed()||e.removeText();const t=V();I(t)&&(e=t),I(e)||q(161);const n=e.anchor;let s=n.getNode(),o=n.offset;for(;!zt(s);)[s,o]=Ac(s,o);return o}function Ac(r,e){const t=r.getParent();if(!t){const s=Fe();return De().append(s),s.select(),[De(),0]}if(U(r)){const s=r.splitText(e);if(s.length===0)return[t,r.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!F(r)||e===0)return[t,r.getIndexWithinParent()];const n=r.getChildAtIndex(e);if(n){const s=new Jt(At(r.__key,e,"element"),At(r.__key,e,"element"),0,""),o=r.insertNewAfter(s);o&&o.append(n,...n.getNextSiblings())}return[t,r.getIndexWithinParent()+1]}let Oe=null,Me=null,Ye=!1,Ls=!1,Fn=0;const Do={characterData:!0,childList:!0,subtree:!0};function yn(){return Ye||Oe!==null&&Oe._readOnly}function Qe(){Ye&&q(13)}function ia(){Fn>99&&q(14)}function Rt(){return Oe===null&&q(195,oa()),Oe}function Ae(){return Me===null&&q(196,oa()),Me}function oa(){let r=0;const e=new Set,t=hs.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=is(s);if(vi(o))r++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let n=` Detected on the page: ${r} compatible editor(s) with version ${t}`;return e.size&&(n+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),n}function Tc(){return Me}function So(r,e,t){const n=e.__type,s=function(l,a){const u=l._nodes.get(a);return u===void 0&&q(30,a),u}(r,n);let o=t.get(n);o===void 0&&(o=Array.from(s.transforms),t.set(n,o));const i=o.length;for(let l=0;l<i&&(o[l](e),e.isAttached());l++);}function Eo(r,e){return r!==void 0&&r.__key!==e&&r.isAttached()}function la(r,e){if(!e)return;const t=r._updateTags;let n=e;Array.isArray(e)||(n=[e]);for(const s of n)t.add(s)}function Bc(r){return Ni(r,Ae()._nodes)}function Ni(r,e){const t=r.type,n=e.get(t);n===void 0&&q(17,t);const s=n.klass;r.type!==s.getType()&&q(18,s.name);const o=s.importJSON(r),i=r.children;if(F(o)&&Array.isArray(i))for(let l=0;l<i.length;l++){const a=Ni(i[l],e);o.append(a)}return o}function ko(r,e,t){const n=Oe,s=Ye,o=Me;Oe=e,Ye=!0,Me=r;try{return t()}finally{Oe=n,Ye=s,Me=o}}function Wt(r,e){const t=r._pendingEditorState,n=r._rootElement,s=r._headless||n===null;if(t===null)return;const o=r._editorState,i=o._selection,l=t._selection,a=r._dirtyType!==sr,u=Oe,c=Ye,d=Me,f=r._updating,h=r._observer;let g=null;if(r._pendingEditorState=null,r._editorState=t,!s&&a&&h!==null){Me=r,Oe=t,Ye=!1,r._updating=!0;try{const v=r._dirtyType,b=r._dirtyElements,S=r._dirtyLeaves;h.disconnect(),g=mc(o,t,r,v,b,S)}catch(v){if(v instanceof Error&&r._onError(v),Ls)throw v;return fa(r,null,n,t),Al(r),r._dirtyType=Sr,Ls=!0,Wt(r,o),void(Ls=!1)}finally{h.observe(n,Do),r._updating=f,Oe=u,Ye=c,Me=d}}t._readOnly||(t._readOnly=!0);const m=r._dirtyLeaves,y=r._dirtyElements,w=r._normalizedNodes,x=r._updateTags,E=r._deferred;a&&(r._dirtyType=sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set,r._updateTags=new Set),function(v,b){const S=v._decorators;let T=v._pendingDecorators||S;const $=b._nodeMap;let N;for(N in T)$.has(N)||(T===S&&(T=jl(v)),delete T[N])}(r,t);const C=s?null:it(r._window);if(r._editable&&C!==null&&(a||l===null||l.dirty)){Me=r,Oe=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const v=r._blockCursorElement;v!==null&&Ei(v,r,n),kc(i,l,r,C,x,n)}ac(r,n,l),h!==null&&h.observe(n,Do)}finally{Me=d,Oe=u}}g!==null&&function(v,b,S,T,$){const N=Array.from(v._listeners.mutation),j=N.length;for(let R=0;R<j;R++){const[L,M]=N[R],X=b.get(M);X!==void 0&&L(X,{dirtyLeaves:T,prevEditorState:$,updateTags:S})}}(r,g,x,m,o),I(l)||l===null||i!==null&&i.is(l)||r.dispatchCommand(li,void 0);const k=r._pendingDecorators;k!==null&&(r._decorators=k,r._pendingDecorators=null,Xr("decorator",r,!0,k)),function(v,b,S){const T=Xi(b),$=Xi(S);T!==$&&Xr("textcontent",v,!0,$)}(r,e||o,t),Xr("update",r,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,normalizedNodes:w,prevEditorState:e||o,tags:x}),function(v,b){if(v._deferred=[],b.length!==0){const S=v._updating;v._updating=!0;try{for(let T=0;T<b.length;T++)b[T]()}finally{v._updating=S}}}(r,E),function(v){const b=v._updates;if(b.length!==0){const S=b.shift();if(S){const[T,$]=S;ua(v,T,$)}}}(r)}function Xr(r,e,t,...n){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[r]);for(let i=0;i<o.length;i++)o[i].apply(null,n)}finally{e._updating=s}}function aa(r,e,t){if(r._updating===!1||Me!==r){let s=!1;return r.update(()=>{s=aa(r,e,t)}),s}const n=Ci(r);for(let s=4;s>=0;s--)for(let o=0;o<n.length;o++){const i=n[o]._commands.get(e);if(i!==void 0){const l=i[s];if(l!==void 0){const a=Array.from(l),u=a.length;for(let c=0;c<u;c++)if(a[c](t,r)===!0)return!0}}}return!1}function Ao(r,e){const t=r._updates;let n=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s;let l;if(i!==void 0){if(l=i.onUpdate,i.skipTransforms&&(n=!0),i.discrete){const a=r._pendingEditorState;a===null&&q(191),a._flushSync=!0}l&&r._deferred.push(l),la(r,i.tag)}o()}}return n}function ua(r,e,t){const n=r._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,la(r,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&r._deferred.push(s);const l=r._editorState;let a=r._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=r._pendingEditorState=ca(a||l),u=!0),a._flushSync=i;const c=Oe,d=Ye,f=Me,h=r._updating;Oe=a,Ye=!1,r._updating=!0,Me=r;try{u&&(r._headless?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=function(w){const x=w.getEditorState()._selection,E=it(w._window);return I(x)||x==null?Bi(x,E,w,null):x.clone()}(r));const m=r._compositionKey;e(),o=Ao(r,o),function(w,x){const E=x.getEditorState()._selection,C=w._selection;if(I(C)){const k=C.anchor,v=C.focus;let b;if(k.type==="text"&&(b=k.getNode(),b.selectionTransform(E,C)),v.type==="text"){const S=v.getNode();b!==S&&S.selectionTransform(E,C)}}}(a,r),r._dirtyType!==sr&&(o?function(w,x){const E=x._dirtyLeaves,C=w._nodeMap;for(const k of E){const v=C.get(k);U(v)&&v.isAttached()&&v.isSimpleText()&&!v.isUnmergeable()&&Qi(v)}}(a,r):function(w,x){const E=x._dirtyLeaves,C=x._dirtyElements,k=w._nodeMap,v=Ut(),b=new Map;let S=E,T=S.size,$=C,N=$.size;for(;T>0||N>0;){if(T>0){x._dirtyLeaves=new Set;for(const j of S){const R=k.get(j);U(R)&&R.isAttached()&&R.isSimpleText()&&!R.isUnmergeable()&&Qi(R),R!==void 0&&Eo(R,v)&&So(x,R,b),E.add(j)}if(S=x._dirtyLeaves,T=S.size,T>0){Fn++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map;for(const j of $){const R=j[0],L=j[1];if(R!=="root"&&!L)continue;const M=k.get(R);M!==void 0&&Eo(M,v)&&So(x,M,b),C.set(R,L)}S=x._dirtyLeaves,T=S.size,$=x._dirtyElements,N=$.size,Fn++}x._dirtyLeaves=E,x._dirtyElements=C}(a,r),Ao(r),function(w,x,E,C){const k=w._nodeMap,v=x._nodeMap,b=[];for(const[S]of C){const T=v.get(S);T!==void 0&&(T.isAttached()||(F(T)&&Il(T,S,k,v,b,C),k.has(S)||C.delete(S),b.push(S)))}for(const S of b)v.delete(S);for(const S of E){const T=v.get(S);T===void 0||T.isAttached()||(k.has(S)||E.delete(S),v.delete(S))}}(l,a,r._dirtyLeaves,r._dirtyElements)),m!==r._compositionKey&&(a._flushSync=!0);const y=a._selection;if(I(y)){const w=a._nodeMap,x=y.anchor.key,E=y.focus.key;w.get(x)!==void 0&&w.get(E)!==void 0||q(19)}else wt(y)&&y._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&r._onError(m),r._pendingEditorState=l,r._dirtyType=Sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),void Wt(r)}finally{Oe=c,Ye=d,Me=f,r._updating=h,Fn=0}r._dirtyType!==sr||function(m,y){const w=y.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(w))return!0}else if(w!==null)return!0;return!1}(a,r)?a._flushSync?(a._flushSync=!1,Wt(r)):u&&rc(()=>{Wt(r)}):(a._flushSync=!1,u&&(n.clear(),r._deferred=[],r._pendingEditorState=null))}function Ze(r,e,t){r._updating?r._updates.push([e,t]):ua(r,e,t)}class Zr{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Zr(this.element,e,this.after)}withAfter(e){return new Zr(this.element,this.before,e)}withElement(e){return new Zr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&q(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&q(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&q(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(un||ns);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,s=this.before,o=document.createElement("br");if(n.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",n.insertBefore(i,o),n.__lexicalLineBreak=i}else n.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,s){if(n===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,s))]}const o=To(t,n);o.push(s);const i=To(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<i.length;a++){const u=o[a],c=i[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}}function To(r,e){const t=[];let n=e;for(;n!==r&&n!==null;n=e.parentNode){let s=0;for(let o=n.previousSibling;o!==null;o=n.previousSibling)s++;t.push(s)}return n!==r&&q(225),t.reverse()}class Pt extends cs{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ku[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=Ae()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(U(t)&&e.push(t),F(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;F(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;F(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const o=t[n-1];return F(o)&&o.getLastDescendant()||o||null}const s=t[e];return F(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:We(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&q(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:We(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&q(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,s;if(e<t/2){for(n=this.getFirstChild(),s=0;n!==null&&s<=e;){if(s===e)return n;n=n.getNextSibling(),s++}return null}for(n=this.getLastChild(),s=t-1;n!==null&&s>=e;){if(s===e)return n;n=n.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContent(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContentSize(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Vi[e];return!!(this.getFormat()&t)}return!1}select(e,t){Qe();const n=V();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(U(a)||F(a))return a.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const a=this.getLastChild();if(U(a)||F(a))return a.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const l=this.__key;return I(n)?(n.anchor.set(l,s,"element"),n.focus.set(l,o,"element"),n.dirty=!0,n):na(l,s,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Vi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const s=n.length,o=this.getChildrenSize(),i=this.getWritable();e+t<=o||q(226,String(e),String(t),String(o));const l=i.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=o-t+s;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){g===null&&q(100);const y=g.getNextSibling(),w=g.__key;rr(g.getWritable()),u.push(w),g=y}}let h=d;for(let g=0;g<s;g++){const m=n[g];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const y=m.getWritable();y.__parent===l&&f--,rr(y);const w=m.__key;if(h===null)i.__first=w,y.__prev=null;else{const x=h.getWritable();x.__next=w,y.__prev=x.__key}m.__key===l&&q(76),y.__parent=l,a.push(w),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(c!==null){const g=c.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=c.__key}else g.__prev=null}if(i.__size=f,u.length){const g=V();if(I(g)){const m=new Set(u),y=new Set(a),{anchor:w,focus:x}=g;Bo(w,m,y)&&Qn(w,w.getNode(),this,d,c),Bo(x,m,y)&&Qn(x,x.getNode(),this,d,c),f!==0||this.canBeEmpty()||kt(this)||this.remove()}}return i}getDOMSlot(e){return new Zr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px")}return{element:t}}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let s=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(n.insertChild(i),s=i):s!==i&&n.replaceChild(i,s),s=s.nextSibling)}}}function F(r){return r instanceof Pt}function Bo(r,e,t){let n=r.getNode();for(;n;){const s=n.__key;if(e.has(s)&&!t.has(s))return!0;n=n.getParent()}return!1}class Nc extends cs{constructor(e){super(e)}decorate(e,t){q(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ge(r){return r instanceof Nc}class xn extends Pt{static getType(){return"root"}static clone(){return new xn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){const e=this.__cachedText;return!yn()&&Ae()._dirtyType!==sr||e===null?super.getTextContent():e}remove(){q(52)}replace(e){q(53)}insertBefore(e){q(54)}insertAfter(e){q(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];F(n)||ge(n)||q(56)}return super.append(...e)}static importJSON(e){const t=De();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Ve(r){return r instanceof xn}function ca(r){return new fs(new Map(r._nodeMap))}function Fi(){return new fs(new Map([["root",new xn]]))}function da(r){const e=r.exportJSON(),t=r.constructor;if(e.type!==t.getType()&&q(130,t.name),F(r)){const n=e.children;Array.isArray(n)||q(59,t.name);const s=r.getChildren();for(let o=0;o<s.length;o++){const i=da(s[o]);n.push(i)}}return e}class fs{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ko(t&&t.editor||null,this,e)}clone(e){const t=new fs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return ko(null,this,()=>({root:da(De())}))}}class ji extends Pt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Tr extends Pt{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ir[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return zn(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Tr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Hr(e.theme,"paragraph");return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Fc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Fe();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Fe();n.setTextFormat(e.format),n.setTextStyle(e.style);const s=this.getDirection();return n.setDirection(s),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(e.length===0||U(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Fc(r){const e=Fe();return r.style&&(e.setFormat(r.style.textAlign),Ai(r,e)),{node:e}}function Fe(){return Tt(new Tr)}function kr(r){return r instanceof Tr}const ue=0,_r=1,jc=4;function fa(r,e,t,n){const s=r._keyToDOMMap;s.clear(),r._editorState=Fi(),r._pendingEditorState=n,r._compositionKey=null,r._dirtyType=sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),r._normalizedNodes=new Set,r._updateTags=new Set,r._updates=[],r._blockCursorElement=null;const o=r._observer;o!==null&&(o.disconnect(),r._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function Lc(r){const e=r||{},t=Tc(),n=e.theme||{},s=r===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=Fi(),l=e.namespace||(s!==null?s._config.namespace:Pl()),a=e.editorState,u=[xn,Ar,hn,pn,Tr,ji,...e.nodes||[]],{onError:c,html:d}=e,f=e.editable===void 0||e.editable;let h;if(r===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let y=u[m],w=null,x=null;if(typeof y!="function"){const v=y;y=v.replace,w=v.with,x=v.withKlass||null}const E=y.getType(),C=y.transform(),k=new Set;C!==null&&k.add(C),h.set(E,{exportDOM:d&&d.export?d.export.get(y):void 0,klass:y,replace:w,replaceWithKlass:x,transforms:k})}}const g=new hs(i,s,h,{disableEvents:o,namespace:l,theme:n},c||console.error,function(m,y){const w=new Map,x=new Set,E=C=>{Object.keys(C).forEach(k=>{let v=w.get(k);v===void 0&&(v=[],w.set(k,v)),v.push(C[k])})};return m.forEach(C=>{const k=C.klass.importDOM;if(k==null||x.has(k))return;x.add(k);const v=k.call(C.klass);v!==null&&E(v)}),y&&E(y),w}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=Sr),g}class hs{constructor(e,t,n,s,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=sr,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Pl(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&q(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&q(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every(l=>l.size===0)&&s.delete(e)}}registerMutationListener(e,t,n){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,s);const i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,s),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&q(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,s=fc(n).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),s=[n],o=n.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);s.push(a)}var i,l;return i=this,l=e.getType(),Ze(i,()=>{const a=Rt();if(a.isEmpty())return;if(l==="root")return void De().markDirty();const u=a._nodeMap;for(const[,c]of u)c.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return G(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Hr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,fa(this,t,e,s),t!==null&&(this._config.disableEvents||yc(t),n!=null&&t.classList.remove(...n)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=Sr,Al(this),this._updateTags.add("history-merge"),Wt(this),this._config.disableEvents||function(l,a){const u=l.ownerDocument,c=Hn.get(u);(c===void 0||c<1)&&u.addEventListener("selectionchange",Xl),Hn.set(u,(c||0)+1),l.__lexicalEditor=a;const d=Yl(l);for(let f=0;f<Js.length;f++){const[h,g]=Js[f],m=typeof g=="function"?y=>{fo(y)||(co(y),(a.isEditable()||h==="click")&&g(y,a))}:y=>{if(fo(y))return;co(y);const w=a.isEditable();switch(h){case"cut":return w&&G(a,ci,y);case"copy":return G(a,rs,y);case"paste":return w&&G(a,ts,y);case"dragstart":return w&&G(a,_l,y);case"dragover":return w&&G(a,vl,y);case"dragend":return w&&G(a,Tu,y);case"focus":return w&&G(a,Fu,y);case"blur":return w&&G(a,ju,y);case"drop":return w&&G(a,bl,y)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),n!=null&&e.classList.add(...n)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Xr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&q(38);let n=e;n._readOnly&&(n=ca(e),n._selection=e._selection?e._selection.clone():null),kl(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),Wt(this)),this._pendingEditorState=n,this._dirtyType=Sr,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||Wt(this)}parseEditorState(e,t){return function(n,s,o){const i=Fi(),l=Oe,a=Ye,u=Me,c=s._dirtyElements,d=s._dirtyLeaves,f=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Oe=i,Ye=!1,Me=s;try{const g=s._nodes;Ni(n.root,g),o&&o(),i._readOnly=!0}catch(g){g instanceof Error&&s._onError(g)}finally{s._dirtyElements=c,s._dirtyLeaves=d,s._cloneNotNeeded=f,s._dirtyType=h,Oe=l,Ye=a,Me=u}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Wt(this),this.getEditorState().read(e,{editor:this})}update(e,t){Ze(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Ze(this,()=>{const s=V(),o=De();s!==null?s.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=it(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Xr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}hs.version="0.21.0+prod.esm";const ha=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Rc=ha?D.useLayoutEffect:D.useEffect,En={tag:"history-merge"};function Pc({initialConfig:r,children:e}){const t=D.useMemo(()=>{const{theme:n,namespace:s,nodes:o,onError:i,editorState:l,html:a}=r,u=bu(null,n),c=Lc({editable:r.editable,html:a,namespace:s,nodes:o,onError:d=>i(d,c),theme:n});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=De();if(h.isEmpty()){const g=Fe();h.append(g);const m=ha?document.activeElement:null;(V()!==null||m!==null&&m===d.getRootElement())&&g.select()}},En);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,En);break}case"object":d.setEditorState(f,En);break;case"function":d.update(()=>{De().isEmpty()&&f(d)},En)}}}(c,l),[c,u]},[]);return Rc(()=>{const n=r.editable,[s]=t;s.setEditable(n===void 0||n)},[]),p.jsx(cl.Provider,{value:t,children:e})}const Oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Mc(r){return{initialValueFn:()=>r.isEditable(),subscribe:e=>r.registerEditableListener(e)}}function Ic(){return function(r){const[e]=mt(),t=D.useMemo(()=>r(e),[e,r]),[n,s]=D.useState(()=>t.initialValueFn()),o=D.useRef(n);return Oc(()=>{const{initialValueFn:i,subscribe:l}=t,a=i();return o.current!==a&&(o.current=a,s(a)),l(u=>{o.current=u,s(u)})},[t,r]),n}(Mc)}function $c(){return De().getTextContent()}function zc(r,e=!0){if(r)return!1;let t=$c();return e&&(t=t.trim()),t===""}function qc(r){if(!zc(r,!1))return!1;const e=De().getChildren(),t=e.length;if(t>1)return!1;for(let n=0;n<t;n++){const s=e[n];if(ge(s))return!1;if(F(s)){if(!kr(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let l=0;l<i;l++){const a=o[n];if(!U(a))return!1}}}return!0}function pa(r){return()=>qc(r)}function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}Uc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gc=Wc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Kc=new Map;function Vc(r){const e={};if(!r)return e;const t=r.split(";");for(const n of t)if(n!==""){const[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function ga(r,e){const t=r.getStartEndPoints();if(e.isSelected(r)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[n,s]=t,o=r.isBackward(),i=n.getNode(),l=s.getNode(),a=e.is(i),u=e.is(l);if(a||u){const[c,d]=Zs(r),f=i.is(l),h=e.is(o?l:i),g=e.is(o?i:l);let m,y=0;return f?(y=c>d?d:c,m=c>d?c:d):h?(y=o?d:c,m=void 0):g&&(y=0,m=o?c:d),e.__text=e.__text.slice(y,m),e}}return e}function Hc(r){const e=r.getStyle(),t=Vc(e);Kc.set(e,t)}function Jc(r,e){if(r===null)return;const t=r.getStartEndPoints(),n=t?t[0]:null;if(n!==null&&n.key==="root"){const i=e(),l=De(),a=l.getFirstChild();return void(a?a.replace(i,!0):l.append(i))}const s=r.getNodes(),o=n!==null&&function(i,l){let a=i;for(;a!==null&&a.getParent()!==null&&!l(a);)a=a.getParentOrThrow();return l(a)?a:null}(n.getNode(),jo);o&&s.indexOf(o)===-1&&s.push(o);for(let i=0;i<s.length;i++){const l=s[i];if(!jo(l))continue;F(l)||Gc(178);const a=e();a.setFormat(l.getFormatType()),a.setIndent(l.getIndent()),l.replace(a,!0)}}function No(r,e){const t=nn(r.focus,e);return ge(t)&&!t.isIsolated()||F(t)&&!t.isInline()&&!t.canBeEmpty()}function Qc(r,e,t,n){r.modify(e?"extend":"move",t,n)}function Yc(r){const e=r.anchor.getNode();return(Ve(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function Fo(r,e,t){const n=Yc(r);Qc(r,e,t?!n:n,"character")}function jo(r){if(ge(r)||!F(r)||kt(r))return!1;const e=r.getFirstChild(),t=e===null||nr(e)||U(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Xc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zc=Xc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ma=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ed=ma&&"documentMode"in document?document.documentMode:null;!(!ma||!("InputEvent"in window)||ed)&&"getTargetRanges"in new window.InputEvent("input");function ya(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}function ur(...r){return()=>{for(let e=r.length-1;e>=0;e--)r[e]();r.length=0}}function bn(r,...e){const t=ya(...e);t.length>0&&r.classList.add(...t)}function xa(r,...e){const t=ya(...e);t.length>0&&r.classList.remove(...t)}function td(r,e){let t=r;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function rd(r){const e=ps(r,t=>F(t)&&!t.isInline());return F(e)||Zc(4,r.__key),e}const ps=(r,e)=>{let t=r;for(;t!==De()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Gt(r,e){return r!==null&&Object.getPrototypeOf(r).constructor.name===e.name}function nd(r){const e=window.location.origin,t=n=>{if(n.origin!==e)return;const s=r.getRootElement();if(document.activeElement!==s)return;const o=n.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[u,c,d,f,h,g]=a;r.update(()=>{const m=V();if(I(m)){const y=m.anchor;let w=y.getNode(),x=0,E=0;if(U(w)&&u>=0&&c>=0&&(x=u,E=u+c,m.setTextNodeRange(w,x,w,E)),x===E&&d===""||(m.insertRawText(d),w=y.getNode()),U(w)){x=f,E=f+h;const C=w.getTextContentSize();x=x>C?C:x,E=E>C?C:E,m.setTextNodeRange(w,x,w,E)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function ba(r,e){const t=e.body?e.body.childNodes:[];let n=[];const s=[];for(let o=0;o<t.length;o++){const i=t[o];if(!Ca.has(i.nodeName)){const l=wa(i,r,s,!1);l!==null&&(n=n.concat(l))}}return function(o){for(const i of o)i.getNextSibling()instanceof ji&&i.insertAfter(lr());for(const i of o){const l=i.getChildren();for(const a of l)i.insertBefore(a);i.remove()}}(s),n}function _a(r,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),n=De().getChildren();for(let s=0;s<n.length;s++)va(r,n[s],t,e);return t.innerHTML}function va(r,e,t,n=null){let s=n===null||e.isSelected(n);const o=F(e)&&e.excludeFromCopy("html");let i=e;if(n!==null){let h=ki(e);h=U(h)&&n!==null?ga(n,h):h,i=h}const l=F(i)?i.getChildren():[],a=r._nodes.get(i.getType());let u;u=a&&a.exportDOM!==void 0?a.exportDOM(r,i):i.exportDOM(r);const{element:c,after:d}=u;if(!c)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=va(r,g,f,n);!s&&F(e)&&m&&e.extractWithChild(g,n,"html")&&(s=!0)}if(s&&!o){if((Lt(c)||io(c))&&c.append(f),t.append(c),d){const h=d.call(i,c);h&&(io(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(f);return s}const Ca=new Set(["STYLE","SCRIPT"]);function wa(r,e,t,n,s=new Map,o){let i=[];if(Ca.has(r.nodeName))return i;let l=null;const a=function(g,m){const{nodeName:y}=g,w=m._htmlConversions.get(y.toLowerCase());let x=null;if(w!==void 0)for(const E of w){const C=E(g);C!==null&&(x===null||(x.priority||0)<=(C.priority||0))&&(x=C)}return x!==null?x.conversion:null}(r,e),u=a?a(r):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of s)if(l=m(l,o),!l)break;l&&i.push(...Array.isArray(g)?g:[l])}u.forChild!=null&&s.set(r.nodeName,u.forChild)}const d=r.childNodes;let f=[];const h=(l==null||!kt(l))&&(l!=null&&ei(l)||n);for(let g=0;g<d.length;g++)f.push(...wa(d[g],e,t,h,new Map(s),l));return c!=null&&(f=c(f)),Wn(r)&&(f=sd(r,f,h?()=>{const g=new ji;return t.push(g),g}:Fe)),l==null?f.length>0?i=i.concat(f):Wn(r)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:zs(g.nextSibling)&&zs(g.previousSibling)}(r)&&(i=i.concat(lr())):F(l)&&l.append(...f),i}function sd(r,e,t){const n=r.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const l=e[i];if(ei(l))n&&!l.getFormat()&&l.setFormat(n),s.push(l);else if(o.push(l),i===e.length-1||i<e.length-1&&ei(e[i+1])){const a=t();a.setFormat(n),a.append(...o),s.push(a),o=[]}}return s}function id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yn=id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function od(r,e=V()){return e==null&&Yn(166),I(e)&&e.isCollapsed()||e.getNodes().length===0?"":_a(r,e)}function ld(r,e=V()){return e==null&&Yn(166),I(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ad(r,e))}function Lo(r,e,t){const n=r.getData("application/x-lexical-editor");if(n)try{const i=JSON.parse(n);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return Ro(t,ud(i.nodes),e)}catch{}const s=r.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:a=>a}).createHTML(l):l}(s),"text/html");return Ro(t,ba(t,i),e)}catch{}const o=r.getData("text/plain")||r.getData("text/uri-list");if(o!=null)if(I(e)){const i=o.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const a=V();if(I(a)){const u=i[l];u===`
|
|
71
|
+
`?n.push(ar()):i===" "?n.push(gn()):n.push(Le(i))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,s=this.format,o=this.style;let i=t,l=n;!this.isCollapsed()&&n.isBefore(t)&&(i=n,l=t),i.type==="element"&&function(y,C,v,E){const w=y.getNode(),k=w.getChildAtIndex(y.offset),x=Le(),b=Je(w)?Fe().append(x):x;x.setFormat(v),x.setStyle(E),k===null?w.append(b):k.insertBefore(b),y.is(C)&&C.set(x.__key,0,"text"),y.set(x.__key,0,"text")}(i,l,s,o);const a=i.offset;let u=l.offset;const c=this.getNodes(),d=c.length;let f=c[0];q(f)||$(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let m=c[d-1];if(d===1&&l.type==="element"&&(u=h,l.set(i.key,u,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let y=f.getNextSibling();if(q(y)&&y.canInsertTextBefore()&&!er(y)||(y=Le(),y.setFormat(s),y.setStyle(o),g.canInsertTextAfter()?f.insertAfter(y):g.insertAfter(y)),y.select(0,0),f=y,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let y=f.getPreviousSibling();if(q(y)&&!er(y)||(y=Le(),y.setFormat(s),g.canInsertTextBefore()?f.insertBefore(y):g.insertBefore(y)),y.select(),f=y,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const y=Le(f.getTextContent());y.setFormat(s),f.replace(y),f=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||F(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),ra(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const E=Le(e);return E.select(),void f.replace(E)}const y=f.getFormat(),C=f.getStyle();if(a!==u||y===s&&C===o){if(Dc(f)){const E=Le(e);return E.setFormat(s),E.setStyle(o),E.select(),void f.replace(E)}}else{if(f.getTextContent()!==""){const E=Le(e);if(E.setFormat(s),E.setStyle(o),E.select(),a===0)f.insertBefore(E,!1);else{const[w]=f.splitText(a);w.insertAfter(E,!1)}return void(E.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(s),f.setStyle(o)}const v=u-a;f=f.spliceText(a,v,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=y,this.style=C))}else{const y=new Set([...f.getParentKeys(),...m.getParentKeys()]),C=F(f)?f:f.getParentOrThrow();let v=F(m)?m:m.getParentOrThrow(),E=m;if(!C.is(v)&&v.isInline())do E=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(u!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<u)if(q(m)&&!m.isToken()&&u!==m.getTextContentSize()){if(m.isSegmented()){const S=Le(m.getTextContent());m.replace(S),m=S}Je(l.getNode())||l.type!=="text"||(m=m.spliceText(0,u,"")),y.add(m.__key)}else{const S=m.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?m.remove():S.remove()}else y.add(m.__key);const w=v.getChildren(),k=new Set(c),x=C.is(v),b=C.isInline()&&f.getNextSibling()===null?C:f;for(let S=w.length-1;S>=0;S--){const A=w[S];if(A.is(f)||F(A)&&A.isParentOf(f))break;A.isAttached()&&(!k.has(A)||A.is(E)?x||b.insertAfter(A,!1):A.remove())}if(!x){let S=v,A=null;for(;S!==null;){const z=S.getChildren(),N=z.length;(N===0||z[N-1].is(A))&&(y.delete(S.__key),A=S),S=S.getParent()}}if(f.isToken())if(a===h)f.select();else{const S=Le(e);S.select(),f.replace(S)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let S=1;S<d;S++){const A=c[S],z=A.__key;y.has(z)||A.remove()}}}removeText(){if(this.isCollapsed())return;const{anchor:e,focus:t}=this,n=this.getNodes(),s=this.isBackward()?t:e,o=this.isBackward()?e:t;let i=s.getNode(),l=o.getNode();const a=Mr(i,qt),u=Mr(l,qt);q(i)&&i.isToken()&&s.offset<i.getTextContentSize()&&(s.offset=0),o.offset>0&&q(l)&&l.isToken()&&(o.offset=l.getTextContentSize()),n.forEach(d=>{Jr(i,d)||Jr(l,d)||d.getKey()===i.getKey()||d.getKey()===l.getKey()||d.remove()});const c=(d,f)=>{if(d.getTextContent()==="")d.remove();else if(f!==0&&er(d)){const h=Le(d.getTextContent());return h.setFormat(d.getFormat()),h.setStyle(d.getStyle()),d.replace(h)}};if(i===l&&q(i)){const d=Math.abs(t.offset-e.offset);return i.spliceText(s.offset,d,"",!0),void c(i,d)}if(q(i)){const d=i.getTextContentSize()-s.offset;i.spliceText(s.offset,d,""),i=c(i,d)||i}q(l)&&(l.spliceText(0,o.offset,""),l=c(l,o.offset)||l),i.isAttached()&&q(i)?i.selectEnd():l.isAttached()&&q(l)&&l.selectStart(),F(a)&&F(u)&&a!==u&&(a.append(...u.getChildren()),u.remove(),o.set(s.key,s.offset,s.type))}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void ze(null);const n=this.getNodes(),s=[];for(const w of n)q(w)&&s.push(w);const o=w=>{n.forEach(k=>{if(kr(k)){const x=k.getFormatFlags(e,w);k.setTextFormat(x)}})},i=s.length;if(i===0)return this.toggleFormat(e),ze(null),void o(t);const l=this.anchor,a=this.focus,u=this.isBackward(),c=u?a:l,d=u?l:a;let f=0,h=s[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(f=1,h=s[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);o(m);const y=i-1;let C=s[y];const v=d.type==="text"?d.offset:C.getTextContentSize();if(h.is(C)){if(g===v)return;if(er(h)||g===0&&v===h.getTextContentSize())h.setFormat(m);else{const w=h.splitText(g,v),k=g===0?w[0]:w[1];k.setFormat(m),c.type==="text"&&c.set(k.__key,0,"text"),d.type==="text"&&d.set(k.__key,v-g,"text")}return void(this.format=m)}g===0||er(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const E=C.getFormatFlags(e,m);v>0&&(v===C.getTextContentSize()||er(C)||([C]=C.splitText(v)),C.setFormat(E));for(let w=f+1;w<y;w++){const k=s[w],x=k.getFormatFlags(e,E);k.setFormat(x)}c.type==="text"&&c.set(h.__key,g,"text"),d.type==="text"&&d.set(C.__key,v,"text"),this.format=m|E}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=K();return M(g)||$(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Mr(t,qt),s=e[e.length-1];if(F(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Ls(this);n.splice(g,0,e),s.selectEnd()}return}if(!e.some(g=>(F(g)||me(g))&&!g.isInline())){F(n)||$(211,t.constructor.name,t.getType());const g=Ls(this);return n.splice(g,0,e),void s.selectEnd()}const o=function(g){const m=Fe();let y=null;for(let C=0;C<g.length;C++){const v=g[C],E=sr(v);if(E||me(v)&&v.isInline()||F(v)&&v.isInline()||q(v)||v.isParentRequired()){if(y===null&&(y=v.createParentElementNode(),m.append(y),E))continue;y!==null&&y.append(v)}else m.append(v),y=null}return m}(e),i=o.getLastDescendant(),l=o.getChildren(),a=!F(n)||!n.isEmpty()?this.insertParagraph():null,u=l[l.length-1];let c=l[0];var d;F(d=c)&&qt(d)&&!d.isEmpty()&&F(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(F(n)||$(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=l[1]),c&&(n===null&&$(212,t.constructor.name,t.getType()),function(g,m,y){const C=m.getParentOrThrow().getLastChild();let v=m;const E=[m];for(;v!==C;)v.getNextSibling()||$(140),v=v.getNextSibling(),E.push(v);let w=g;for(const k of E)w=w.insertAfter(k)}(n,c));const f=Mr(i,qt);a&&F(f)&&(a.canMergeWhenEmpty()||qt(u))&&(f.append(...a.getChildren()),a.remove()),F(n)&&n.isEmpty()&&n.remove(),i.selectEnd();const h=F(n)?n.getLastChild():null;sr(h)&&f!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=Fe();return Se().splice(this.anchor.offset,0,[i]),i.select(),i}const e=Ls(this),t=Mr(this.anchor.getNode(),qt);F(t)||$(213);const n=t.getChildAtIndex(e),s=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=ar();if(this.insertNodes([t]),e){const n=t.getParentOrThrow(),s=t.getIndexWithinParent();n.select(s,s)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,s=this.anchor,o=this.focus;let i=e[0],l=e[n];const[a,u]=ei(this);if(t===0)return[];if(t===1){if(q(i)&&!this.isCollapsed()){const d=a>u?u:a,f=a>u?a:u,h=i.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[i]}const c=s.isBefore(o);if(q(i)){const d=c?a:u;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(q(l)){const d=l.getTextContent().length,f=c?u:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[n]=l)}return e}modify(e,t,n){const s=this.focus,o=this.anchor,i=e==="move",l=nn(s,t);if(me(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=Co();return h.add(l.__key),void Dt(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(q(f)){const h=f.__key,g=t?f.getTextContent().length:0;return s.set(h,g,"text"),void(i&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return F(f)?(m=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),s.set(m,g,"element"),void(i&&o.set(m,g,"element"))}}const a=Ae(),u=at(a._window);if(!u)return;const c=a._blockCursorElement,d=a._rootElement;if(d===null||c===null||!F(l)||l.isInline()||l.canBeEmpty()||ki(c,a,d),function(f,h,g,m){f.modify(h,g,m)}(u,e,t?"backward":"forward",n),u.rangeCount>0){const f=u.getRangeAt(0),h=this.anchor.getNode(),g=Je(h)?h:lc(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const m=this.getNodes(),y=[];let C=!1;for(let v=0;v<m.length;v++){const E=m[v];Jr(E,g)?y.push(E):C=!0}if(C&&y.length>0)if(t){const v=y[0];F(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{const v=y[y.length-1];F(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}u.anchorNode===f.startContainer&&u.anchorOffset===f.startOffset||function(v){const E=v.focus,w=v.anchor,k=w.key,x=w.offset,b=w.type;Ut(w,E.key,E.offset,E.type),Ut(E,k,x,b),v._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&F(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(F(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let s=n.getNode();if(this.forwardDeletion(n,s,e))return;const o=this.focus,i=nn(o,e);if(me(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&F(s)&&s.getChildrenSize()===0){s.remove();const l=Co();l.add(i.__key),Dt(l)}else i.remove(),Ae().dispatchCommand(ai,void 0);return}if(!e&&F(i)&&F(s)&&s.isEmpty())return s.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(s=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,u=l.getTextContentSize();if(l.is(s)||e&&a!==u||!e&&a!==0)return void bo(l,e,a)}else if(s!==null&&s.isSegmented()){const a=n.offset,u=s.getTextContentSize();if(s.is(l)||e&&a!==0||!e&&a!==u)return void bo(s,e,a)}(function(a,u){const c=a.anchor,d=a.focus,f=c.getNode(),h=d.getNode();if(f===h&&c.type==="text"&&d.type==="text"){const g=c.offset,m=d.offset,y=g<m,C=y?g:m,v=y?m:g,E=v-1;C!==E&&(Pl(f.getTextContent().slice(C,v))||(u?d.offset=E:c.offset=E))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&Je(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),this.isCollapsed()&&this.anchor.offset===0&&this.modify("extend",e,"character"),t){const n=e?this.anchor:this.focus;n.set(n.key,n.offset+1,n.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function vt(r){return r instanceof hs}function xo(r){const e=r.offset;if(r.type==="text")return e;const t=r.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function ei(r){const e=r.getStartEndPoints();if(e===null)return[0,0];const[t,n]=e;return t.type==="element"&&n.type==="element"&&t.key===n.key&&t.offset===n.offset?[0,0]:[xo(t),xo(n)]}function bo(r,e,t){const n=r,s=n.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,l=0;for(let u=0;u<o;u++){const c=u===o-1;if(l=i,i+=s[u].length,e&&i===t||i>t||c){s.splice(u,1),c&&(l=void 0);break}}const a=s.join("").trim();a===""?n.remove():(n.setTextContent(a),n.select(l,l))}function _o(r,e,t,n){let s,o=e;if(r.nodeType===cn){let i=!1;const l=r.childNodes,a=l.length,u=n._blockCursorElement;o===a&&(i=!0,o=a-1);let c=l[o],d=!1;if(c===u)c=l[o+1],d=!0;else if(u!==null){const f=u.parentNode;r===f&&e>Array.prototype.indexOf.call(f.children,u)&&o--}if(s=br(c),q(s))o=eo(s,i);else{let f=br(r);if(f===null)return null;if(F(f)){const h=n.getElementByKey(f.getKey());h===null&&$(214),[f,o]=f.getDOMSlot(h).resolveChildIndex(f,h,r,e),F(f)||$(215),i&&o>=f.getChildrenSize()&&(o=Math.max(0,f.getChildrenSize()-1));let m=f.getChildAtIndex(o);if(F(m)&&function(y,C,v){const E=y.getParent();return v===null||E===null||!E.canBeEmpty()||E!==v.getNode()}(m,0,t)){const y=i?m.getLastDescendant():m.getFirstDescendant();y===null?f=m:(m=y,f=F(m)?m:m.getParentOrThrow()),o=0}q(m)?(s=m,f=null,o=eo(m,i)):m!==f&&i&&!d&&(F(f)||$(216),o=Math.min(f.getChildrenSize(),o+1))}else{const h=f.getIndexWithinParent();o=e===0&&me(f)&&br(r)===f?h:h+1,f=f.getParentOrThrow()}if(F(f))return Et(f.__key,o,"element")}}else s=br(r);return q(s)?Et(s.__key,o,"text"):null}function vo(r,e,t){const n=r.offset,s=r.getNode();if(n===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&F(i)&&i.isInline()){const l=i.getPreviousSibling();q(l)&&(r.key=l.__key,r.offset=l.getTextContent().length)}}else F(o)&&!t&&o.isInline()?(r.key=o.__key,r.offset=o.getChildrenSize(),r.type="element"):q(o)&&(r.key=o.__key,r.offset=o.getTextContent().length)}else if(n===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&F(o)&&o.isInline())r.key=o.__key,r.offset=0,r.type="element";else if((t||e)&&o===null&&F(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();q(l)&&(r.key=l.__key,r.offset=0)}}}function ra(r,e,t){if(r.type==="text"&&e.type==="text"){const n=r.isBefore(e),s=r.is(e);vo(r,n,s),vo(e,!n,s),s&&(e.key=r.key,e.offset=r.offset,e.type=r.type);const o=Ae();if(o.isComposing()&&o._compositionKey!==r.key&&M(t)){const i=t.anchor,l=t.focus;Ut(r,i.key,i.offset,i.type),Ut(e,l.key,l.offset,l.type)}}}function na(r,e,t,n,s,o){if(r===null||t===null||!dn(s,r,t))return null;const i=_o(r,e,M(o)?o.anchor:null,s);if(i===null)return null;const l=_o(t,n,M(o)?o.focus:null,s);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const a=br(r),u=br(t);if(me(a)&&me(u))return null}return ra(i,l,o),[i,l]}function ti(r){return F(r)&&!r.isInline()}function sa(r,e,t,n,s,o){const i=Rt(),l=new Qt(Et(r,e,s),Et(t,n,o),0,"");return l.dirty=!0,i._selection=l,l}function Ec(){const r=Et("root",0,"element"),e=Et("root",0,"element");return new Qt(r,e,0,"")}function Co(){return new hs(new Set)}function Ni(r,e,t,n){const s=t._window;if(s===null)return null;const o=n||s.event,i=o?o.type:void 0,l=i==="selectionchange",a=!zs&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let u,c,d,f;if(M(r)&&!a)return r.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&M(r)&&!dn(t,u,c))return r.clone();const h=na(u,d,c,f,t,r);if(h===null)return null;const[g,m]=h;return new Qt(g,m,M(r)?r.format:0,M(r)?r.style:"")}function K(){return Rt()._selection}function mn(){return Ae()._editorState._selection}function Yn(r,e,t,n=1){const s=r.anchor,o=r.focus,i=s.getNode(),l=o.getNode();if(!e.is(i)&&!e.is(l))return;const a=e.__key;if(r.isCollapsed()){const u=s.offset;if(t<=u&&n>0||t<u&&n<0){const c=Math.max(0,u+n);s.set(a,c,"element"),o.set(a,c,"element"),wo(r)}}else{const u=r.isBackward(),c=u?o:s,d=c.getNode(),f=u?s:o,h=f.getNode();if(e.is(d)){const g=c.offset;(t<=g&&n>0||t<g&&n<0)&&c.set(a,Math.max(0,g+n),"element")}if(e.is(h)){const g=f.offset;(t<=g&&n>0||t<g&&n<0)&&f.set(a,Math.max(0,g+n),"element")}}wo(r)}function wo(r){const e=r.anchor,t=e.offset,n=r.focus,s=n.offset,o=e.getNode(),i=n.getNode();if(r.isCollapsed()){if(!F(o))return;const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),n.set(u.__key,c,"text")}}else{if(F(o)){const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(F(i)){const l=i.getChildrenSize(),a=s>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(s);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),n.set(u.__key,c,"text")}}}}function Xn(r,e,t,n,s){let o=null,i=0,l=null;n!==null?(o=n.__key,q(n)?(i=n.getTextContentSize(),l="text"):F(n)&&(i=n.getChildrenSize(),l="element")):s!==null&&(o=s.__key,q(s)?l="text":F(s)&&(l="element")),o!==null&&l!==null?r.set(o,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),r.set(t.__key,i,"element"))}function Do(r,e,t,n,s){r.type==="text"?(r.key=t,e||(r.offset+=s)):r.offset>n.getIndexWithinParent()&&(r.offset-=1)}function kc(r,e,t,n,s,o,i){const l=n.anchorNode,a=n.focusNode,u=n.anchorOffset,c=n.focusOffset,d=document.activeElement;if(s.has("collaboration")&&d!==o||d!==null&&vi(d))return;if(!M(e))return void(r!==null&&dn(t,l,a)&&n.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,m=h.key,y=Gn(t,g),C=Gn(t,m),v=f.offset,E=h.offset,w=e.format,k=e.style,x=e.isCollapsed();let b=y,S=C,A=!1;if(f.type==="text"){b=qn(y);const I=f.getNode();A=I.getFormat()!==w||I.getStyle()!==k}else M(r)&&r.anchor.type==="text"&&(A=!0);var z,N,j,P,R;if(h.type==="text"&&(S=qn(C)),b!==null&&S!==null&&(x&&(r===null||A||M(r)&&(r.format!==w||r.style!==k))&&(z=w,N=k,j=v,P=g,R=performance.now(),Jl=[z,N,j,P,R]),u!==v||c!==E||l!==b||a!==S||n.type==="Range"&&x||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{n.setBaseAndExtent(b,v,S,E)}catch{}if(!s.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const I=e instanceof Qt&&e.anchor.type==="element"?b.childNodes[v]||null:n.rangeCount>0?n.getRangeAt(0):null;if(I!==null){let J;if(I instanceof Text){const ae=document.createRange();ae.selectNode(I),J=ae.getBoundingClientRect()}else J=I.getBoundingClientRect();(function(ae,le,te){const Ce=te.ownerDocument,ue=Ce.defaultView;if(ue===null)return;let{top:_e,bottom:Ee}=le,Pe=0,Oe=0,de=te;for(;de!==null;){const qe=de===Ce.body;if(qe)Pe=0,Oe=cs(ae).innerHeight;else{const ye=de.getBoundingClientRect();Pe=ye.top,Oe=ye.bottom}let Me=0;if(_e<Pe?Me=-(Pe-_e):Ee>Oe&&(Me=Ee-Oe),Me!==0)if(qe)ue.scrollBy(0,Me);else{const ye=de.scrollTop;de.scrollTop+=Me;const je=de.scrollTop-ye;_e-=je,Ee-=je}if(qe)break;de=fn(de)}})(t,J,o)}}Ys=!0}}function ia(r){let e=K()||mn();e===null&&(e=Se().selectEnd()),e.insertNodes(r)}function Ls(r){let e=r;r.isCollapsed()||e.removeText();const t=K();M(t)&&(e=t),M(e)||$(161);const n=e.anchor;let s=n.getNode(),o=n.offset;for(;!qt(s);)[s,o]=Ac(s,o);return o}function Ac(r,e){const t=r.getParent();if(!t){const s=Fe();return Se().append(s),s.select(),[Se(),0]}if(q(r)){const s=r.splitText(e);if(s.length===0)return[t,r.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!F(r)||e===0)return[t,r.getIndexWithinParent()];const n=r.getChildAtIndex(e);if(n){const s=new Qt(Et(r.__key,e,"element"),Et(r.__key,e,"element"),0,""),o=r.insertNewAfter(s);o&&o.append(n,...n.getNextSiblings())}return[t,r.getIndexWithinParent()+1]}let Ie=null,$e=null,Ze=!1,Rs=!1,Ln=0;const So={characterData:!0,childList:!0,subtree:!0};function yn(){return Ze||Ie!==null&&Ie._readOnly}function Xe(){Ze&&$(13)}function oa(){Ln>99&&$(14)}function Rt(){return Ie===null&&$(195,la()),Ie}function Ae(){return $e===null&&$(196,la()),$e}function la(){let r=0;const e=new Set,t=gs.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=ls(s);if(Ci(o))r++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let n=` Detected on the page: ${r} compatible editor(s) with version ${t}`;return e.size&&(n+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),n}function Tc(){return $e}function Eo(r,e,t){const n=e.__type,s=function(l,a){const u=l._nodes.get(a);return u===void 0&&$(30,a),u}(r,n);let o=t.get(n);o===void 0&&(o=Array.from(s.transforms),t.set(n,o));const i=o.length;for(let l=0;l<i&&(o[l](e),e.isAttached());l++);}function ko(r,e){return r!==void 0&&r.__key!==e&&r.isAttached()}function aa(r,e){if(!e)return;const t=r._updateTags;let n=e;Array.isArray(e)||(n=[e]);for(const s of n)t.add(s)}function Bc(r){return Fi(r,Ae()._nodes)}function Fi(r,e){const t=r.type,n=e.get(t);n===void 0&&$(17,t);const s=n.klass;r.type!==s.getType()&&$(18,s.name);const o=s.importJSON(r),i=r.children;if(F(o)&&Array.isArray(i))for(let l=0;l<i.length;l++){const a=Fi(i[l],e);o.append(a)}return o}function Ao(r,e,t){const n=Ie,s=Ze,o=$e;Ie=e,Ze=!0,$e=r;try{return t()}finally{Ie=n,Ze=s,$e=o}}function Gt(r,e){const t=r._pendingEditorState,n=r._rootElement,s=r._headless||n===null;if(t===null)return;const o=r._editorState,i=o._selection,l=t._selection,a=r._dirtyType!==ir,u=Ie,c=Ze,d=$e,f=r._updating,h=r._observer;let g=null;if(r._pendingEditorState=null,r._editorState=t,!s&&a&&h!==null){$e=r,Ie=t,Ze=!1,r._updating=!0;try{const x=r._dirtyType,b=r._dirtyElements,S=r._dirtyLeaves;h.disconnect(),g=mc(o,t,r,x,b,S)}catch(x){if(x instanceof Error&&r._onError(x),Rs)throw x;return ha(r,null,n,t),Tl(r),r._dirtyType=Sr,Rs=!0,Gt(r,o),void(Rs=!1)}finally{h.observe(n,So),r._updating=f,Ie=u,Ze=c,$e=d}}t._readOnly||(t._readOnly=!0);const m=r._dirtyLeaves,y=r._dirtyElements,C=r._normalizedNodes,v=r._updateTags,E=r._deferred;a&&(r._dirtyType=ir,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set,r._updateTags=new Set),function(x,b){const S=x._decorators;let A=x._pendingDecorators||S;const z=b._nodeMap;let N;for(N in A)z.has(N)||(A===S&&(A=Ll(x)),delete A[N])}(r,t);const w=s?null:at(r._window);if(r._editable&&w!==null&&(a||l===null||l.dirty)){$e=r,Ie=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const x=r._blockCursorElement;x!==null&&ki(x,r,n),kc(i,l,r,w,v,n)}ac(r,n,l),h!==null&&h.observe(n,So)}finally{$e=d,Ie=u}}g!==null&&function(x,b,S,A,z){const N=Array.from(x._listeners.mutation),j=N.length;for(let P=0;P<j;P++){const[R,I]=N[P],J=b.get(I);J!==void 0&&R(J,{dirtyLeaves:A,prevEditorState:z,updateTags:S})}}(r,g,v,m,o),M(l)||l===null||i!==null&&i.is(l)||r.dispatchCommand(ai,void 0);const k=r._pendingDecorators;k!==null&&(r._decorators=k,r._pendingDecorators=null,Xr("decorator",r,!0,k)),function(x,b,S){const A=Zi(b),z=Zi(S);A!==z&&Xr("textcontent",x,!0,z)}(r,e||o,t),Xr("update",r,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,normalizedNodes:C,prevEditorState:e||o,tags:v}),function(x,b){if(x._deferred=[],b.length!==0){const S=x._updating;x._updating=!0;try{for(let A=0;A<b.length;A++)b[A]()}finally{x._updating=S}}}(r,E),function(x){const b=x._updates;if(b.length!==0){const S=b.shift();if(S){const[A,z]=S;ca(x,A,z)}}}(r)}function Xr(r,e,t,...n){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[r]);for(let i=0;i<o.length;i++)o[i].apply(null,n)}finally{e._updating=s}}function ua(r,e,t){if(r._updating===!1||$e!==r){let s=!1;return r.update(()=>{s=ua(r,e,t)}),s}const n=wi(r);for(let s=4;s>=0;s--)for(let o=0;o<n.length;o++){const i=n[o]._commands.get(e);if(i!==void 0){const l=i[s];if(l!==void 0){const a=Array.from(l),u=a.length;for(let c=0;c<u;c++)if(a[c](t,r)===!0)return!0}}}return!1}function To(r,e){const t=r._updates;let n=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s;let l;if(i!==void 0){if(l=i.onUpdate,i.skipTransforms&&(n=!0),i.discrete){const a=r._pendingEditorState;a===null&&$(191),a._flushSync=!0}l&&r._deferred.push(l),aa(r,i.tag)}o()}}return n}function ca(r,e,t){const n=r._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,aa(r,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&r._deferred.push(s);const l=r._editorState;let a=r._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=r._pendingEditorState=da(a||l),u=!0),a._flushSync=i;const c=Ie,d=Ze,f=$e,h=r._updating;Ie=a,Ze=!1,r._updating=!0,$e=r;try{u&&(r._headless?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=function(C){const v=C.getEditorState()._selection,E=at(C._window);return M(v)||v==null?Ni(v,E,C,null):v.clone()}(r));const m=r._compositionKey;e(),o=To(r,o),function(C,v){const E=v.getEditorState()._selection,w=C._selection;if(M(w)){const k=w.anchor,x=w.focus;let b;if(k.type==="text"&&(b=k.getNode(),b.selectionTransform(E,w)),x.type==="text"){const S=x.getNode();b!==S&&S.selectionTransform(E,w)}}}(a,r),r._dirtyType!==ir&&(o?function(C,v){const E=v._dirtyLeaves,w=C._nodeMap;for(const k of E){const x=w.get(k);q(x)&&x.isAttached()&&x.isSimpleText()&&!x.isUnmergeable()&&Yi(x)}}(a,r):function(C,v){const E=v._dirtyLeaves,w=v._dirtyElements,k=C._nodeMap,x=Wt(),b=new Map;let S=E,A=S.size,z=w,N=z.size;for(;A>0||N>0;){if(A>0){v._dirtyLeaves=new Set;for(const j of S){const P=k.get(j);q(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&Yi(P),P!==void 0&&ko(P,x)&&Eo(v,P,b),E.add(j)}if(S=v._dirtyLeaves,A=S.size,A>0){Ln++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map;for(const j of z){const P=j[0],R=j[1];if(P!=="root"&&!R)continue;const I=k.get(P);I!==void 0&&ko(I,x)&&Eo(v,I,b),w.set(P,R)}S=v._dirtyLeaves,A=S.size,z=v._dirtyElements,N=z.size,Ln++}v._dirtyLeaves=E,v._dirtyElements=w}(a,r),To(r),function(C,v,E,w){const k=C._nodeMap,x=v._nodeMap,b=[];for(const[S]of w){const A=x.get(S);A!==void 0&&(A.isAttached()||(F(A)&&$l(A,S,k,x,b,w),k.has(S)||w.delete(S),b.push(S)))}for(const S of b)x.delete(S);for(const S of E){const A=x.get(S);A===void 0||A.isAttached()||(k.has(S)||E.delete(S),x.delete(S))}}(l,a,r._dirtyLeaves,r._dirtyElements)),m!==r._compositionKey&&(a._flushSync=!0);const y=a._selection;if(M(y)){const C=a._nodeMap,v=y.anchor.key,E=y.focus.key;C.get(v)!==void 0&&C.get(E)!==void 0||$(19)}else vt(y)&&y._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&r._onError(m),r._pendingEditorState=l,r._dirtyType=Sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),void Gt(r)}finally{Ie=c,Ze=d,$e=f,r._updating=h,Ln=0}r._dirtyType!==ir||function(m,y){const C=y.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(C))return!0}else if(C!==null)return!0;return!1}(a,r)?a._flushSync?(a._flushSync=!1,Gt(r)):u&&rc(()=>{Gt(r)}):(a._flushSync=!1,u&&(n.clear(),r._deferred=[],r._pendingEditorState=null))}function nt(r,e,t){r._updating?r._updates.push([e,t]):ca(r,e,t)}class Zr{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Zr(this.element,e,this.after)}withAfter(e){return new Zr(this.element,this.before,e)}withElement(e){return new Zr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&$(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(un||is);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,s=this.before,o=document.createElement("br");if(n.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",n.insertBefore(i,o),n.__lexicalLineBreak=i}else n.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,s){if(n===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,s))]}const o=Bo(t,n);o.push(s);const i=Bo(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<i.length;a++){const u=o[a],c=i[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}}function Bo(r,e){const t=[];let n=e;for(;n!==r&&n!==null;n=e.parentNode){let s=0;for(let o=n.previousSibling;o!==null;o=n.previousSibling)s++;t.push(s)}return n!==r&&$(225),t.reverse()}class Pt extends fs{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ku[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=Ae()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(q(t)&&e.push(t),F(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;F(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;F(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const o=t[n-1];return F(o)&&o.getLastDescendant()||o||null}const s=t[e];return F(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Ge(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&$(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Ge(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&$(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,s;if(e<t/2){for(n=this.getFirstChild(),s=0;n!==null&&s<=e;){if(s===e)return n;n=n.getNextSibling(),s++}return null}for(n=this.getLastChild(),s=t-1;n!==null&&s>=e;){if(s===e)return n;n=n.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContent(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContentSize(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Hi[e];return!!(this.getFormat()&t)}return!1}select(e,t){Xe();const n=K();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(q(a)||F(a))return a.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const a=this.getLastChild();if(q(a)||F(a))return a.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const l=this.__key;return M(n)?(n.anchor.set(l,s,"element"),n.focus.set(l,o,"element"),n.dirty=!0,n):sa(l,s,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Hi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const s=n.length,o=this.getChildrenSize(),i=this.getWritable();e+t<=o||$(226,String(e),String(t),String(o));const l=i.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=o-t+s;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){g===null&&$(100);const y=g.getNextSibling(),C=g.__key;nr(g.getWritable()),u.push(C),g=y}}let h=d;for(let g=0;g<s;g++){const m=n[g];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const y=m.getWritable();y.__parent===l&&f--,nr(y);const C=m.__key;if(h===null)i.__first=C,y.__prev=null;else{const v=h.getWritable();v.__next=C,y.__prev=v.__key}m.__key===l&&$(76),y.__parent=l,a.push(C),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(c!==null){const g=c.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=c.__key}else g.__prev=null}if(i.__size=f,u.length){const g=K();if(M(g)){const m=new Set(u),y=new Set(a),{anchor:C,focus:v}=g;No(C,m,y)&&Xn(C,C.getNode(),this,d,c),No(v,m,y)&&Xn(v,v.getNode(),this,d,c),f!==0||this.canBeEmpty()||St(this)||this.remove()}}return i}getDOMSlot(e){return new Zr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px")}return{element:t}}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let s=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(n.insertChild(i),s=i):s!==i&&n.replaceChild(i,s),s=s.nextSibling)}}}function F(r){return r instanceof Pt}function No(r,e,t){let n=r.getNode();for(;n;){const s=n.__key;if(e.has(s)&&!t.has(s))return!0;n=n.getParent()}return!1}class Nc extends fs{constructor(e){super(e)}decorate(e,t){$(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function me(r){return r instanceof Nc}class xn extends Pt{static getType(){return"root"}static clone(){return new xn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){$(51)}getTextContent(){const e=this.__cachedText;return!yn()&&Ae()._dirtyType!==ir||e===null?super.getTextContent():e}remove(){$(52)}replace(e){$(53)}insertBefore(e){$(54)}insertAfter(e){$(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];F(n)||me(n)||$(56)}return super.append(...e)}static importJSON(e){const t=Se();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Je(r){return r instanceof xn}function da(r){return new ps(new Map(r._nodeMap))}function ji(){return new ps(new Map([["root",new xn]]))}function fa(r){const e=r.exportJSON(),t=r.constructor;if(e.type!==t.getType()&&$(130,t.name),F(r)){const n=e.children;Array.isArray(n)||$(59,t.name);const s=r.getChildren();for(let o=0;o<s.length;o++){const i=fa(s[o]);n.push(i)}}return e}class ps{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Ao(t&&t.editor||null,this,e)}clone(e){const t=new ps(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Ao(null,this,()=>({root:fa(Se())}))}}class Li extends Pt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Tr extends Pt{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=or[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return Un(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Tr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Hr(e.theme,"paragraph");return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Fc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Fe();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Fe();n.setTextFormat(e.format),n.setTextStyle(e.style);const s=this.getDirection();return n.setDirection(s),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(e.length===0||q(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Fc(r){const e=Fe();return r.style&&(e.setFormat(r.style.textAlign),Ti(r,e)),{node:e}}function Fe(){return kt(new Tr)}function kr(r){return r instanceof Tr}const ce=0,_r=1,jc=4;function ha(r,e,t,n){const s=r._keyToDOMMap;s.clear(),r._editorState=ji(),r._pendingEditorState=n,r._compositionKey=null,r._dirtyType=ir,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),r._normalizedNodes=new Set,r._updateTags=new Set,r._updates=[],r._blockCursorElement=null;const o=r._observer;o!==null&&(o.disconnect(),r._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function Lc(r){const e=r||{},t=Tc(),n=e.theme||{},s=r===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=ji(),l=e.namespace||(s!==null?s._config.namespace:Ol()),a=e.editorState,u=[xn,Ar,hn,pn,Tr,Li,...e.nodes||[]],{onError:c,html:d}=e,f=e.editable===void 0||e.editable;let h;if(r===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let y=u[m],C=null,v=null;if(typeof y!="function"){const x=y;y=x.replace,C=x.with,v=x.withKlass||null}const E=y.getType(),w=y.transform(),k=new Set;w!==null&&k.add(w),h.set(E,{exportDOM:d&&d.export?d.export.get(y):void 0,klass:y,replace:C,replaceWithKlass:v,transforms:k})}}const g=new gs(i,s,h,{disableEvents:o,namespace:l,theme:n},c||console.error,function(m,y){const C=new Map,v=new Set,E=w=>{Object.keys(w).forEach(k=>{let x=C.get(k);x===void 0&&(x=[],C.set(k,x)),x.push(w[k])})};return m.forEach(w=>{const k=w.klass.importDOM;if(k==null||v.has(k))return;v.add(k);const x=k.call(w.klass);x!==null&&E(x)}),y&&E(y),C}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=Sr),g}class gs{constructor(e,t,n,s,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=ir,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ol(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&$(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&$(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every(l=>l.size===0)&&s.delete(e)}}registerMutationListener(e,t,n){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,s);const i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,s),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&$(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,s=fc(n).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),s=[n],o=n.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);s.push(a)}var i,l;return i=this,l=e.getType(),nt(i,()=>{const a=Rt();if(a.isEmpty())return;if(l==="root")return void Se().markDirty();const u=a._nodeMap;for(const[,c]of u)c.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return W(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Hr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,ha(this,t,e,s),t!==null&&(this._config.disableEvents||yc(t),n!=null&&t.classList.remove(...n)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=Sr,Tl(this),this._updateTags.add("history-merge"),Gt(this),this._config.disableEvents||function(l,a){const u=l.ownerDocument,c=Qn.get(u);(c===void 0||c<1)&&u.addEventListener("selectionchange",Zl),Qn.set(u,(c||0)+1),l.__lexicalEditor=a;const d=Xl(l);for(let f=0;f<Qs.length;f++){const[h,g]=Qs[f],m=typeof g=="function"?y=>{ho(y)||(fo(y),(a.isEditable()||h==="click")&&g(y,a))}:y=>{if(ho(y))return;fo(y);const C=a.isEditable();switch(h){case"cut":return C&&W(a,di,y);case"copy":return W(a,ss,y);case"paste":return C&&W(a,ns,y);case"dragstart":return C&&W(a,vl,y);case"dragover":return C&&W(a,Cl,y);case"dragend":return C&&W(a,Tu,y);case"focus":return C&&W(a,Fu,y);case"blur":return C&&W(a,ju,y);case"drop":return C&&W(a,_l,y)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),n!=null&&e.classList.add(...n)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Xr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&$(38);let n=e;n._readOnly&&(n=da(e),n._selection=e._selection?e._selection.clone():null),Al(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),Gt(this)),this._pendingEditorState=n,this._dirtyType=Sr,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||Gt(this)}parseEditorState(e,t){return function(n,s,o){const i=ji(),l=Ie,a=Ze,u=$e,c=s._dirtyElements,d=s._dirtyLeaves,f=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Ie=i,Ze=!1,$e=s;try{const g=s._nodes;Fi(n.root,g),o&&o(),i._readOnly=!0}catch(g){g instanceof Error&&s._onError(g)}finally{s._dirtyElements=c,s._dirtyLeaves=d,s._cloneNotNeeded=f,s._dirtyType=h,Ie=l,Ze=a,$e=u}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Gt(this),this.getEditorState().read(e,{editor:this})}update(e,t){nt(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),nt(this,()=>{const s=K(),o=Se();s!==null?s.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=at(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Xr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}gs.version="0.21.0+prod.esm";const pa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Rc=pa?D.useLayoutEffect:D.useEffect,An={tag:"history-merge"};function Pc({initialConfig:r,children:e}){const t=D.useMemo(()=>{const{theme:n,namespace:s,nodes:o,onError:i,editorState:l,html:a}=r,u=bu(null,n),c=Lc({editable:r.editable,html:a,namespace:s,nodes:o,onError:d=>i(d,c),theme:n});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=Se();if(h.isEmpty()){const g=Fe();h.append(g);const m=pa?document.activeElement:null;(K()!==null||m!==null&&m===d.getRootElement())&&g.select()}},An);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,An);break}case"object":d.setEditorState(f,An);break;case"function":d.update(()=>{Se().isEmpty()&&f(d)},An)}}}(c,l),[c,u]},[]);return Rc(()=>{const n=r.editable,[s]=t;s.setEditable(n===void 0||n)},[]),p.jsx(dl.Provider,{value:t,children:e})}const Oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Mc(r){return{initialValueFn:()=>r.isEditable(),subscribe:e=>r.registerEditableListener(e)}}function Ic(){return function(r){const[e]=gt(),t=D.useMemo(()=>r(e),[e,r]),[n,s]=D.useState(()=>t.initialValueFn()),o=D.useRef(n);return Oc(()=>{const{initialValueFn:i,subscribe:l}=t,a=i();return o.current!==a&&(o.current=a,s(a)),l(u=>{o.current=u,s(u)})},[t,r]),n}(Mc)}function $c(){return Se().getTextContent()}function zc(r,e=!0){if(r)return!1;let t=$c();return e&&(t=t.trim()),t===""}function qc(r){if(!zc(r,!1))return!1;const e=Se().getChildren(),t=e.length;if(t>1)return!1;for(let n=0;n<t;n++){const s=e[n];if(me(s))return!1;if(F(s)){if(!kr(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let l=0;l<i;l++){const a=o[n];if(!q(a))return!1}}}return!0}function ga(r){return()=>qc(r)}function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}Uc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gc=Wc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Kc=new Map;function Vc(r){const e={};if(!r)return e;const t=r.split(";");for(const n of t)if(n!==""){const[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function ma(r,e){const t=r.getStartEndPoints();if(e.isSelected(r)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[n,s]=t,o=r.isBackward(),i=n.getNode(),l=s.getNode(),a=e.is(i),u=e.is(l);if(a||u){const[c,d]=ei(r),f=i.is(l),h=e.is(o?l:i),g=e.is(o?i:l);let m,y=0;return f?(y=c>d?d:c,m=c>d?c:d):h?(y=o?d:c,m=void 0):g&&(y=0,m=o?c:d),e.__text=e.__text.slice(y,m),e}}return e}function Hc(r){const e=r.getStyle(),t=Vc(e);Kc.set(e,t)}function Jc(r,e){if(r===null)return;const t=r.getStartEndPoints(),n=t?t[0]:null;if(n!==null&&n.key==="root"){const i=e(),l=Se(),a=l.getFirstChild();return void(a?a.replace(i,!0):l.append(i))}const s=r.getNodes(),o=n!==null&&function(i,l){let a=i;for(;a!==null&&a.getParent()!==null&&!l(a);)a=a.getParentOrThrow();return l(a)?a:null}(n.getNode(),Lo);o&&s.indexOf(o)===-1&&s.push(o);for(let i=0;i<s.length;i++){const l=s[i];if(!Lo(l))continue;F(l)||Gc(178);const a=e();a.setFormat(l.getFormatType()),a.setIndent(l.getIndent()),l.replace(a,!0)}}function Fo(r,e){const t=nn(r.focus,e);return me(t)&&!t.isIsolated()||F(t)&&!t.isInline()&&!t.canBeEmpty()}function Qc(r,e,t,n){r.modify(e?"extend":"move",t,n)}function Yc(r){const e=r.anchor.getNode();return(Je(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function jo(r,e,t){const n=Yc(r);Qc(r,e,t?!n:n,"character")}function Lo(r){if(me(r)||!F(r)||St(r))return!1;const e=r.getFirstChild(),t=e===null||sr(e)||q(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Xc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zc=Xc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ya=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ed=ya&&"documentMode"in document?document.documentMode:null;!(!ya||!("InputEvent"in window)||ed)&&"getTargetRanges"in new window.InputEvent("input");function xa(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}function cr(...r){return()=>{for(let e=r.length-1;e>=0;e--)r[e]();r.length=0}}function bn(r,...e){const t=xa(...e);t.length>0&&r.classList.add(...t)}function ba(r,...e){const t=xa(...e);t.length>0&&r.classList.remove(...t)}function td(r,e){let t=r;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function rd(r){const e=ms(r,t=>F(t)&&!t.isInline());return F(e)||Zc(4,r.__key),e}const ms=(r,e)=>{let t=r;for(;t!==Se()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Kt(r,e){return r!==null&&Object.getPrototypeOf(r).constructor.name===e.name}function nd(r){const e=window.location.origin,t=n=>{if(n.origin!==e)return;const s=r.getRootElement();if(document.activeElement!==s)return;const o=n.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[u,c,d,f,h,g]=a;r.update(()=>{const m=K();if(M(m)){const y=m.anchor;let C=y.getNode(),v=0,E=0;if(q(C)&&u>=0&&c>=0&&(v=u,E=u+c,m.setTextNodeRange(C,v,C,E)),v===E&&d===""||(m.insertRawText(d),C=y.getNode()),q(C)){v=f,E=f+h;const w=C.getTextContentSize();v=v>w?w:v,E=E>w?w:E,m.setTextNodeRange(C,v,C,E)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function _a(r,e){const t=e.body?e.body.childNodes:[];let n=[];const s=[];for(let o=0;o<t.length;o++){const i=t[o];if(!wa.has(i.nodeName)){const l=Da(i,r,s,!1);l!==null&&(n=n.concat(l))}}return function(o){for(const i of o)i.getNextSibling()instanceof Li&&i.insertAfter(ar());for(const i of o){const l=i.getChildren();for(const a of l)i.insertBefore(a);i.remove()}}(s),n}function va(r,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),n=Se().getChildren();for(let s=0;s<n.length;s++)Ca(r,n[s],t,e);return t.innerHTML}function Ca(r,e,t,n=null){let s=n===null||e.isSelected(n);const o=F(e)&&e.excludeFromCopy("html");let i=e;if(n!==null){let h=Ai(e);h=q(h)&&n!==null?ma(n,h):h,i=h}const l=F(i)?i.getChildren():[],a=r._nodes.get(i.getType());let u;u=a&&a.exportDOM!==void 0?a.exportDOM(r,i):i.exportDOM(r);const{element:c,after:d}=u;if(!c)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=Ca(r,g,f,n);!s&&F(e)&&m&&e.extractWithChild(g,n,"html")&&(s=!0)}if(s&&!o){if((Lt(c)||oo(c))&&c.append(f),t.append(c),d){const h=d.call(i,c);h&&(oo(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(f);return s}const wa=new Set(["STYLE","SCRIPT"]);function Da(r,e,t,n,s=new Map,o){let i=[];if(wa.has(r.nodeName))return i;let l=null;const a=function(g,m){const{nodeName:y}=g,C=m._htmlConversions.get(y.toLowerCase());let v=null;if(C!==void 0)for(const E of C){const w=E(g);w!==null&&(v===null||(v.priority||0)<=(w.priority||0))&&(v=w)}return v!==null?v.conversion:null}(r,e),u=a?a(r):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of s)if(l=m(l,o),!l)break;l&&i.push(...Array.isArray(g)?g:[l])}u.forChild!=null&&s.set(r.nodeName,u.forChild)}const d=r.childNodes;let f=[];const h=(l==null||!St(l))&&(l!=null&&ti(l)||n);for(let g=0;g<d.length;g++)f.push(...Da(d[g],e,t,h,new Map(s),l));return c!=null&&(f=c(f)),Kn(r)&&(f=sd(r,f,h?()=>{const g=new Li;return t.push(g),g}:Fe)),l==null?f.length>0?i=i.concat(f):Kn(r)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:qs(g.nextSibling)&&qs(g.previousSibling)}(r)&&(i=i.concat(ar())):F(l)&&l.append(...f),i}function sd(r,e,t){const n=r.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const l=e[i];if(ti(l))n&&!l.getFormat()&&l.setFormat(n),s.push(l);else if(o.push(l),i===e.length-1||i<e.length-1&&ti(e[i+1])){const a=t();a.setFormat(n),a.append(...o),s.push(a),o=[]}}return s}function id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zn=id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function od(r,e=K()){return e==null&&Zn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?"":va(r,e)}function ld(r,e=K()){return e==null&&Zn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ad(r,e))}function Ro(r,e,t){const n=r.getData("application/x-lexical-editor");if(n)try{const i=JSON.parse(n);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return Po(t,ud(i.nodes),e)}catch{}const s=r.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:a=>a}).createHTML(l):l}(s),"text/html");return Po(t,_a(t,i),e)}catch{}const o=r.getData("text/plain")||r.getData("text/uri-list");if(o!=null)if(M(e)){const i=o.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const a=K();if(M(a)){const u=i[l];u===`
|
|
72
72
|
`||u===`\r
|
|
73
|
-
`?a.insertParagraph():u===" "?a.insertNodes([gn()]):a.insertText(u)}}}else e.insertRawText(o)}function Ro(r,e,t){r.dispatchCommand(_u,{nodes:e,selection:t})||t.insertNodes(e)}function Da(r,e,t,n=[]){let s=e===null||t.isSelected(e);const o=F(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let u=ki(t);u=U(u)&&e!==null?ga(e,u):u,i=u}const l=F(i)?i.getChildren():[],a=function(u){const c=u.exportJSON(),d=u.constructor;if(c.type!==d.getType()&&Yn(58,d.name),F(u)){const f=c.children;Array.isArray(f)||Yn(59,d.name)}return c}(i);if(U(i)){const u=i.__text;u.length>0?a.text=u:s=!1}for(let u=0;u<l.length;u++){const c=l[u],d=Da(r,e,c,a.children);!s&&F(t)&&d&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)n.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const c=a.children[u];n.push(c)}return s}function ad(r,e){const t=[],n=De().getChildren();for(let s=0;s<n.length;s++)Da(r,e,n[s],t);return{namespace:r._config.namespace,nodes:t}}function ud(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t],s=Bc(n);U(s)&&Hc(s),e.push(s)}return e}let mr=null;async function Po(r,e,t){if(mr!==null)return!1;if(e!==null)return new Promise((a,u)=>{r.update(()=>{a(Oo(r,e,t))})});const n=r.getRootElement(),s=r._window==null?window.document:r._window.document,o=it(r._window);if(n===null||o===null)return!1;const i=s.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(s.createTextNode("#")),n.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),o.removeAllRanges(),o.addRange(l),new Promise((a,u)=>{const c=r.registerCommand(rs,d=>(Gt(d,ClipboardEvent)&&(c(),mr!==null&&(window.clearTimeout(mr),mr=null),a(Oo(r,d,t))),!0),jc);mr=window.setTimeout(()=>{c(),mr=null,a(!1)},50),s.execCommand("copy"),i.remove()})}function Oo(r,e,t){if(t===void 0){const s=it(r._window);if(!s)return!1;const o=s.anchorNode,i=s.focusNode;if(o!==null&&i!==null&&!dn(r,o,i))return!1;const l=V();if(l===null)return!1;t=dd(l)}e.preventDefault();const n=e.clipboardData;return n!==null&&(fd(n,t),!0)}const cd=[["text/html",od],["application/x-lexical-editor",ld]];function dd(r=V()){const e={"text/plain":r?r.getTextContent():""};if(r){const t=cc();for(const[n,s]of cd){const o=s(t,r);o!==null&&(e[n]=o)}}return e}function fd(r,e){for(const t in e){const n=e[t];n!==void 0&&r.setData(t,n)}}function Mo(r,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(r,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(r,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Br=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hd=Br&&"documentMode"in document?document.documentMode:null,pd=!(!Br||!("InputEvent"in window)||hd)&&"getTargetRanges"in new window.InputEvent("input"),gd=Br&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Io=Br&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,md=Br&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yd=Br&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!md,$o=an();class gs extends Pt{static getType(){return"quote"}static clone(e){return new gs(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return bn(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:xd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Li();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=Fe(),s=this.getDirection();return n.setDirection(s),this.insertAfter(n,t),n}collapseAtStart(){const e=Fe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Li(){return Tt(new gs)}class ms extends Pt{static getType(){return"heading"}static clone(e){return new ms(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];bn(n,o)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:yr,priority:0}),h2:e=>({conversion:yr,priority:0}),h3:e=>({conversion:yr,priority:0}),h4:e=>({conversion:yr,priority:0}),h5:e=>({conversion:yr,priority:0}),h6:e=>({conversion:yr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&zo(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>zo(e)?{conversion:t=>({node:Wr("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Wr(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&n===s.getTextContentSize()||!e?Fe():Wr(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),n===0&&!this.isEmpty()&&e){const l=Fe();l.select(),this.replace(l,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Fe():Wr(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function zo(r){return r.nodeName.toLowerCase()==="span"&&r.style.fontSize==="26pt"}function yr(r){const e=r.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Wr(e),r.style!==null&&(Ai(r,t),t.setFormat(r.style.textAlign))),{node:t}}function xd(r){const e=Li();return r.style!==null&&(e.setFormat(r.style.textAlign),Ai(r,e)),{node:e}}function Wr(r){return Tt(new ms(r))}function kn(r){let e=null;if(Gt(r,DragEvent)?e=r.dataTransfer:Gt(r,ClipboardEvent)&&(e=r.clipboardData),e===null)return[!1,[],!1];const t=e.types,n=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[n,Array.from(e.files),s]}function qo(r){const e=V();if(!I(e))return!1;const t=new Set,n=e.getNodes();for(let s=0;s<n.length;s++){const o=n[s],i=o.getKey();if(t.has(i))continue;const l=ps(o,u=>F(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),r(l))}return t.size>0}function An(r){const e=Er(r);return ge(e)}function bd(r){return ur(r.registerCommand(dl,e=>{const t=V();return!!wt(t)&&(t.clear(),!0)},0),r.registerCommand(tr,e=>{const t=V();return!!I(t)&&(t.deleteCharacter(e),!0)},ue),r.registerCommand(tn,e=>{const t=V();return!!I(t)&&(t.deleteWord(e),!0)},ue),r.registerCommand(rn,e=>{const t=V();return!!I(t)&&(t.deleteLine(e),!0)},ue),r.registerCommand(Cr,e=>{const t=V();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const n=e.dataTransfer;if(n!=null)Lo(n,t,r);else if(I(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ue),r.registerCommand(Ms,()=>{const e=V();return!!I(e)&&(e.removeText(),!0)},ue),r.registerCommand(pt,e=>{const t=V();return!!I(t)&&(t.formatText(e),!0)},ue),r.registerCommand(Au,e=>{const t=V();if(!I(t)&&!wt(t))return!1;const n=t.getNodes();for(const s of n){const o=ps(s,i=>F(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},ue),r.registerCommand(vr,e=>{const t=V();return!!I(t)&&(t.insertLineBreak(e),!0)},ue),r.registerCommand(en,()=>{const e=V();return!!I(e)&&(e.insertParagraph(),!0)},ue),r.registerCommand(Eu,()=>(sa([gn()]),!0),ue),r.registerCommand(ku,()=>qo(e=>{const t=e.getIndent();e.setIndent(t+1)}),ue),r.registerCommand(Ki,()=>qo(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),ue),r.registerCommand(pl,e=>{const t=V();if(wt(t)&&!An(e.target)){const n=t.getNodes();if(n.length>0)return n[0].selectPrevious(),!0}else if(I(t)){const n=nn(t.focus,!0);if(!e.shiftKey&&ge(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},ue),r.registerCommand(gl,e=>{const t=V();if(wt(t)){const n=t.getNodes();if(n.length>0)return n[0].selectNext(0,0),!0}else if(I(t)){if(function(s){const o=s.focus;return o.key==="root"&&o.offset===De().getChildrenSize()}(t))return e.preventDefault(),!0;const n=nn(t.focus,!1);if(!e.shiftKey&&ge(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},ue),r.registerCommand(hl,e=>{const t=V();if(wt(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!I(t))return!1;if(No(t,!0)){const n=e.shiftKey;return e.preventDefault(),Fo(t,n,!0),!0}return!1},ue),r.registerCommand(fl,e=>{const t=V();if(wt(t)&&!An(e.target)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),s[0].selectNext(0,0),!0}if(!I(t))return!1;const n=e.shiftKey;return!!No(t,!1)&&(e.preventDefault(),Fo(t,n,!1),!0)},ue),r.registerCommand(ml,e=>{if(An(e.target))return!1;const t=V();if(!I(t))return!1;const{anchor:n}=t,s=n.getNode();return t.isCollapsed()&&n.offset===0&&!Ve(s)&&rd(s).getIndent()>0?(e.preventDefault(),r.dispatchCommand(Ki,void 0)):(!Io||navigator.language!=="ko-KR")&&(e.preventDefault(),r.dispatchCommand(tr,!0))},ue),r.registerCommand(xl,e=>{if(An(e.target))return!1;const t=V();return!!I(t)&&(e.preventDefault(),r.dispatchCommand(tr,!1))},ue),r.registerCommand(Rn,e=>{const t=V();if(!I(t))return!1;if(e!==null){if((Io||gd||yd)&&pd)return!1;if(e.preventDefault(),e.shiftKey)return r.dispatchCommand(vr,!1)}return r.dispatchCommand(en,void 0)},ue),r.registerCommand(yl,()=>{const e=V();return!!I(e)&&(r.blur(),!0)},ue),r.registerCommand(bl,e=>{const[,t]=kn(e);if(t.length>0){const s=Mo(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,l=Er(i);if(l!==null){const a=Ec();if(U(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const c=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(c,d,"element"),a.focus.set(c,d,"element")}const u=Tl(a);Et(u)}r.dispatchCommand($o,t)}return e.preventDefault(),!0}const n=V();return!!I(n)},ue),r.registerCommand(_l,e=>{const[t]=kn(e),n=V();return!(t&&!I(n))},ue),r.registerCommand(vl,e=>{const[t]=kn(e),n=V();if(t&&!I(n))return!1;const s=Mo(e.clientX,e.clientY);if(s!==null){const o=Er(s.node);ge(o)&&e.preventDefault()}return!0},ue),r.registerCommand(Is,()=>(oc(),!0),ue),r.registerCommand(rs,e=>(Po(r,Gt(e,ClipboardEvent)?e:null),!0),ue),r.registerCommand(ci,e=>(async function(t,n){await Po(n,Gt(t,ClipboardEvent)?t:null),n.update(()=>{const s=V();I(s)?s.removeText():wt(s)&&s.getNodes().forEach(o=>o.remove())})}(e,r),!0),ue),r.registerCommand(ts,e=>{const[,t,n]=kn(e);return t.length>0&&!n?(r.dispatchCommand($o,t),!0):_i(e.target)?!1:V()!==null&&(function(s,o){s.preventDefault(),o.update(()=>{const i=V(),l=Gt(s,InputEvent)||Gt(s,KeyboardEvent)?null:s.clipboardData;l!=null&&i!==null&&Lo(l,i,o)},{tag:"paste"})}(e,r),!0)},ue))}const ti=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Uo(r){return r.getEditorState().read(pa(r.isComposing()))}function _d({contentEditable:r,placeholder:e=null,ErrorBoundary:t}){const[n]=mt(),s=function(o,i){const[l,a]=D.useState(()=>o.getDecorators());return ti(()=>o.registerDecoratorListener(u=>{Pi.flushSync(()=>{a(u)})}),[o]),D.useEffect(()=>{a(o.getDecorators())},[o]),D.useMemo(()=>{const u=[],c=Object.keys(l);for(let d=0;d<c.length;d++){const f=c[d],h=p.jsx(i,{onError:m=>o._onError(m),children:p.jsx(D.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&u.push(Pi.createPortal(h,g,f))}return u},[i,l,o])}(n,t);return function(o){ti(()=>ur(bd(o),nd(o)),[o])}(n),p.jsxs(p.Fragment,{children:[r,p.jsx(vd,{content:e}),s]})}function vd({content:r}){const[e]=mt(),t=function(s){const[o,i]=D.useState(()=>Uo(s));return ti(()=>{function l(){const a=Uo(s);i(a)}return l(),ur(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),o}(e),n=Ic();return t?typeof r=="function"?r(n):r:null}const Sa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Cd({editor:r,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:g,id:m,role:y="textbox",spellCheck:w=!0,style:x,tabIndex:E,"data-testid":C,...k},v){const[b,S]=D.useState(r.isEditable()),T=D.useCallback(N=>{N&&N.ownerDocument&&N.ownerDocument.defaultView?r.setRootElement(N):r.setRootElement(null)},[r]),$=D.useMemo(()=>function(...N){return j=>{N.forEach(R=>{typeof R=="function"?R(j):R!=null&&(R.current=j)})}}(v,T),[T,v]);return Sa(()=>(S(r.isEditable()),r.registerEditableListener(N=>{S(N)})),[r]),p.jsx("div",{"aria-activedescendant":b?e:void 0,"aria-autocomplete":b?t:"none","aria-controls":b?n:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":b&&y==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":u,"aria-multiline":c,"aria-owns":b?d:void 0,"aria-readonly":!b||void 0,"aria-required":f,autoCapitalize:h,className:g,contentEditable:b,"data-testid":C,id:m,ref:$,role:b?y:void 0,spellCheck:w,style:x,tabIndex:E,...k})}const wd=D.forwardRef(Cd);function Wo(r){return r.getEditorState().read(pa(r.isComposing()))}const Dd=D.forwardRef(Sd);function Sd(r,e){const{placeholder:t,...n}=r,[s]=mt();return p.jsxs(p.Fragment,{children:[p.jsx(wd,{editor:s,...n,ref:e}),t!=null&&p.jsx(Ed,{editor:s,content:t})]})}function Ed({content:r,editor:e}){const t=function(i){const[l,a]=D.useState(()=>Wo(i));return Sa(()=>{function u(){const c=Wo(i);a(c)}return u(),ur(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(e),[n,s]=D.useState(e.isEditable());if(D.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof r=="function"?o=r(n):r!==null&&(o=r),o===null?null:p.jsx("div",{"aria-hidden":!0,children:o})}const Tn=0,ri=1,ni=2,ht=0,kd=1,Go=2,Ad=3,Td=4;function Bd(r,e,t,n,s){if(r===null||t.size===0&&n.size===0&&!s)return ht;const o=e._selection,i=r._selection;if(s)return kd;if(!(I(o)&&I(i)&&i.isCollapsed()&&o.isCollapsed()))return ht;const l=function(w,x,E){const C=w._nodeMap,k=[];for(const v of x){const b=C.get(v);b!==void 0&&k.push(b)}for(const[v,b]of E){if(!b)continue;const S=C.get(v);S===void 0||Ve(S)||k.push(S)}return k}(e,t,n);if(l.length===0)return ht;if(l.length>1){const w=e._nodeMap,x=w.get(o.anchor.key),E=w.get(i.anchor.key);return x&&E&&!r._nodeMap.has(x.__key)&&U(x)&&x.__text.length===1&&o.anchor.offset===1?Go:ht}const a=l[0],u=r._nodeMap.get(a.__key);if(!U(u)||!U(a)||u.__mode!==a.__mode)return ht;const c=u.__text,d=a.__text;if(c===d)return ht;const f=o.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return ht;const g=f.offset,m=h.offset,y=d.length-c.length;return y===1&&m===g-1?Go:y===-1&&m===g+1?Ad:y===-1&&m===g?Td:ht}function Nd(r,e){let t=Date.now(),n=ht;return(s,o,i,l,a,u)=>{const c=Date.now();if(u.has("historic"))return n=ht,t=c,ni;const d=Bd(s,o,l,a,r.isComposing()),f=(()=>{const h=i===null||i.editor===r,g=u.has("history-push");if(!g&&h&&u.has("history-merge"))return Tn;if(s===null)return ri;const m=o._selection;return l.size>0||a.size>0?g===!1&&d!==ht&&d===n&&c<t+e&&h||l.size===1&&function(y,w,x){const E=w._nodeMap.get(y),C=x._nodeMap.get(y),k=w._selection,v=x._selection;return!(I(k)&&I(v)&&k.anchor.type==="element"&&k.focus.type==="element"&&v.anchor.type==="text"&&v.focus.type==="text"||!U(E)||!U(C)||E.__parent!==C.__parent)&&JSON.stringify(w.read(()=>E.exportJSON()))===JSON.stringify(x.read(()=>C.exportJSON()))}(Array.from(l)[0],s,o)?Tn:ri:m!==null?Tn:ni})();return t=c,n=d,f}}function Ko(r){r.undoStack=[],r.redoStack=[],r.current=null}function Fd(r,e,t){const n=Nd(r,t);return ur(r.registerCommand(ai,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(a.length!==0){const u=i.current,c=a.pop();u!==null&&(l.push(u),o.dispatchCommand(Cn,!0)),a.length===0&&o.dispatchCommand(wn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ue),r.registerCommand(ui,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(l.length!==0){const u=i.current;u!==null&&(a.push(u),o.dispatchCommand(wn,!0));const c=l.pop();l.length===0&&o.dispatchCommand(Cn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ue),r.registerCommand(Bu,()=>(Ko(e),!1),ue),r.registerCommand(Nu,()=>(Ko(e),r.dispatchCommand(Cn,!1),r.dispatchCommand(wn,!1),!0),ue),r.registerUpdateListener(({editorState:o,prevEditorState:i,dirtyLeaves:l,dirtyElements:a,tags:u})=>{const c=e.current,d=e.redoStack,f=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&o===h)return;const g=n(i,o,c,l,a,u);if(g===ri)d.length!==0&&(e.redoStack=[],r.dispatchCommand(Cn,!1)),c!==null&&(f.push({...c}),r.dispatchCommand(wn,!0));else if(g===ni)return;e.current={editor:r,editorState:o}}))}function jd(){return{current:null,redoStack:[],undoStack:[]}}function Ld({delay:r,externalHistoryState:e}){const[t]=mt();return function(n,s,o=1e3){const i=D.useMemo(()=>s||jd(),[s]);D.useEffect(()=>Fd(n,i,o),[o,n,i])}(t,e,r),null}const Rd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Pd({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:e=!1,onChange:t}){const[n]=mt();return Rd(()=>{if(t)return n.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:l,tags:a})=>{e&&o.size===0&&i.size===0||r&&a.has("history-merge")||l.isEmpty()||t(s,n,a)})},[n,r,e,t]),null}function si(r,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},si(r,e)}var Vo={error:null},Od=function(r){var e,t;function n(){for(var o,i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return(o=r.call.apply(r,[this].concat(l))||this).state=Vo,o.resetErrorBoundary=function(){for(var u,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];o.props.onReset==null||(u=o.props).onReset.apply(u,d),o.reset()},o}t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,si(e,t),n.getDerivedStateFromError=function(o){return{error:o}};var s=n.prototype;return s.reset=function(){this.setState(Vo)},s.componentDidCatch=function(o,i){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,i)},s.componentDidUpdate=function(o,i){var l,a,u,c,d=this.state.error,f=this.props.resetKeys;d!==null&&i.error!==null&&((u=o.resetKeys)===void 0&&(u=[]),(c=f)===void 0&&(c=[]),u.length!==c.length||u.some(function(h,g){return!Object.is(h,c[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},s.render=function(){var o=this.state.error,i=this.props,l=i.fallbackRender,a=i.FallbackComponent,u=i.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(_s.isValidElement(u))return u;if(typeof l=="function")return l(c);if(a)return _s.createElement(a,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},n}(_s.Component);function Md({children:r,onError:e}){return p.jsx(Od,{fallback:p.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:r})}function Id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Dt=Id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function $d(r){let e=1,t=r.getParent();for(;t!=null;){if(ke(t)){const n=t.getParent();if(ae(n)){e++,t=n.getParent();continue}Dt(40)}return e}return e}function ii(r){let e=r.getParent();ae(e)||Dt(40);let t=e;for(;t!==null;)t=t.getParent(),ae(t)&&(e=t);return e}function Ea(r){let e=[];const t=r.getChildren().filter(ke);for(let n=0;n<t.length;n++){const s=t[n],o=s.getFirstChild();ae(o)?e=e.concat(Ea(o)):e.push(s)}return e}function St(r){return ke(r)&&ae(r.getFirstChild())}function Ho(r){return et().append(r)}function ka(r,e){return ke(r)&&(e.length===0||e.length===1&&r.is(e[0])&&r.getChildrenSize()===0)}function Jo(r,e){r.update(()=>{const t=V();if(t!==null){const n=t.getNodes();if(I(t)){const o=t.getStartEndPoints();o===null&&Dt(143);const[i]=o,l=i.getNode(),a=l.getParent();if(ka(l,n)){const u=Xe(e);if(kt(a)){l.replace(u);const c=et();F(l)&&(c.setFormat(l.getFormatType()),c.setIndent(l.getIndent())),u.append(c)}else if(ke(l)){const c=l.getParentOrThrow();ar(u,c.getChildren()),c.replace(u)}return}}const s=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(!F(i)||!i.isEmpty()||ke(i)||s.has(i.getKey())){if(Nl(i)){let l=i.getParent();for(;l!=null;){const a=l.getKey();if(ae(l)){if(!s.has(a)){const u=Xe(e);ar(u,l.getChildren()),l.replace(u),s.add(a)}break}{const u=l.getParent();if(kt(u)&&!s.has(a)){s.add(a),Qo(l,e);break}l=u}}}}else Qo(i,e)}}})}function ar(r,e){r.splice(r.getChildrenSize(),0,e)}function Qo(r,e){if(ae(r))return r;const t=r.getPreviousSibling(),n=r.getNextSibling(),s=et();let o;if(ar(s,r.getChildren()),ae(t)&&e===t.getListType())t.append(s),ae(n)&&e===n.getListType()&&(ar(t,n.getChildren()),n.remove()),o=t;else if(ae(n)&&e===n.getListType())n.getFirstChildOrThrow().insertBefore(s),o=n;else{const i=Xe(e);i.append(s),r.replace(i),o=i}return s.setFormat(r.getFormatType()),s.setIndent(r.getIndent()),r.remove(),o}function Ri(r,e){const t=r.getLastChild(),n=e.getFirstChild();t&&n&&St(t)&&St(n)&&(Ri(t.getFirstChild(),n.getFirstChild()),n.remove());const s=e.getChildren();s.length>0&&r.append(...s),e.remove()}function zd(r){r.update(()=>{const e=V();if(I(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(ka(s,n))t.add(ii(s));else for(let o=0;o<n.length;o++){const i=n[o];if(Nl(i)){const l=td(i,cr);l!=null&&t.add(ii(l))}}for(const o of t){let i=o;const l=Ea(o);for(const a of l){const u=Fe();ar(u,a.getChildren()),i.insertAfter(u),i=u,a.__key===e.anchor.key&&e.anchor.set(u.getKey(),0,"element"),a.__key===e.focus.key&&e.focus.set(u.getKey(),0,"element"),a.remove()}o.remove()}}})}function qd(r){const e=new Set;if(St(r)||e.has(r.getKey()))return;const t=r.getParent(),n=r.getNextSibling(),s=r.getPreviousSibling();if(St(n)&&St(s)){const o=s.getFirstChild();if(ae(o)){o.append(r);const i=n.getFirstChild();ae(i)&&(ar(o,i.getChildren()),n.remove(),e.add(n.getKey()))}}else if(St(n)){const o=n.getFirstChild();if(ae(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(r)}}else if(St(s)){const o=s.getFirstChild();ae(o)&&o.append(r)}else if(ae(t)){const o=et(),i=Xe(t.getListType());o.append(i),i.append(r),s?s.insertAfter(o):n?n.insertBefore(o):t.append(o)}}function Ud(r){if(St(r))return;const e=r.getParent(),t=e?e.getParent():void 0;if(ae(t?t.getParent():void 0)&&ke(t)&&ae(e)){const n=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(r.is(n))t.insertBefore(r),e.isEmpty()&&t.remove();else if(r.is(s))t.insertAfter(r),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=et(),l=Xe(o);i.append(l),r.getPreviousSiblings().forEach(c=>l.append(c));const a=et(),u=Xe(o);a.append(u),ar(u,r.getNextSiblings()),t.insertBefore(i),t.insertAfter(a),t.replace(r)}}}function Wd(){const r=V();if(!I(r)||!r.isCollapsed())return!1;const e=r.anchor.getNode();if(!ke(e)||e.getChildrenSize()!==0)return!1;const t=ii(e),n=e.getParent();ae(n)||Dt(40);const s=n.getParent();let o;if(kt(s))o=Fe(),t.insertAfter(o);else{if(!ke(s))return!1;o=et(),s.insertAfter(o)}o.select();const i=e.getNextSiblings();if(i.length>0){const l=Xe(n.getListType());if(kr(o))o.insertAfter(l);else{const a=et();a.append(l),o.insertAfter(a)}i.forEach(a=>{a.remove(),l.append(a)})}return function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const u=a.getParent();if(u==null||!ke(a)&&!ae(a))break;a=u}a.remove()}(e),!0}function Xn(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}class cr extends Pt{static getType(){return"listitem"}static clone(e){return new cr(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return ae(n)&&n.getListType()==="check"&&Xo(t,this,null),t.value=this.__value,Yo(t,e.theme,this),t}updateDOM(e,t,n){const s=this.getParent();return ae(s)&&s.getListType()==="check"&&Xo(t,this,e),t.value=this.__value,Yo(t,n.theme,this),!1}static transform(){return e=>{if(ke(e)||Dt(144),e.__checked==null)return;const t=e.getParent();ae(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Gd,priority:0})}}static importJSON(e){const t=et();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(F(n)&&this.canMergeWith(n)){const s=n.getChildren();this.append(...s),n.remove()}else super.append(n)}return this}replace(e,t){if(ke(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!ae(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const s=Xe(n.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}n.insertAfter(e),e.insertAfter(s)}return t&&(F(e)||Dt(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(ae(n)||Dt(39),ke(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(n.insertAfter(e,t),s.length!==0){const o=Xe(n.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&St(t)&&St(n)&&(Ri(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=et(this.__checked==null&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=Fe();this.getChildren().forEach(i=>t.append(i));const n=this.getParentOrThrow(),s=n.getParentOrThrow(),o=ke(s);if(n.getChildrenSize()===1)if(o)n.remove(),s.select();else{n.insertBefore(t),n.remove();const i=e.anchor,l=e.focus,a=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(a,i.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return ae(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;ke(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&Dt(117),(e=Math.floor(e))>=0||Dt(199);let t=this.getIndent();for(;t!==e;)t<e?(qd(this),t++):(Ud(this),t--);return this}canInsertAfter(e){return ke(e)}canReplaceWith(e){return ke(e)}canMergeWith(e){return kr(e)||ke(e)}extractWithChild(e,t){if(!I(t))return!1;const n=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Xe("bullet")}canMergeWhenEmpty(){return!0}}function Yo(r,e,t){const n=[],s=[],o=e.list,i=o?o.listitem:void 0;let l;if(o&&o.nested&&(l=o.nested.listitem),i!==void 0&&n.push(...Xn(i)),o){const a=t.getParent(),u=ae(a)&&a.getListType()==="check",c=t.getChecked();u&&!c||s.push(o.listitemUnchecked),u&&c||s.push(o.listitemChecked),u&&n.push(c?o.listitemChecked:o.listitemUnchecked)}if(l!==void 0){const a=Xn(l);t.getChildren().some(u=>ae(u))?n.push(...a):s.push(...a)}s.length>0&&xa(r,...s),n.length>0&&bn(r,...n)}function Xo(r,e,t,n){ae(e.getFirstChild())?(r.removeAttribute("role"),r.removeAttribute("tabIndex"),r.removeAttribute("aria-checked")):(r.setAttribute("role","checkbox"),r.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||r.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Gd(r){if(r.classList.contains("task-list-item")){for(const t of r.children)if(t.tagName==="INPUT")return Kd(t)}const e=r.getAttribute("aria-checked");return{node:et(e==="true"||e!=="false"&&void 0)}}function Kd(r){return r.getAttribute("type")!=="checkbox"?{node:null}:{node:et(r.hasAttribute("checked"))}}function et(r){return Tt(new cr(void 0,r))}function ke(r){return r instanceof cr}class Nr extends Pt{static getType(){return"list"}static clone(e){const t=e.__listType||tl[e.__tag];return new Nr(t,e.__start,e.__key)}constructor(e,t,n){super(n);const s=tl[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,s=document.createElement(n);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,Zo(s,e.theme,this),s}updateDOM(e,t,n){return e.__tag!==this.__tag||(Zo(t,n.theme,this),!1)}static transform(){return e=>{ae(e)||Dt(163),function(t){const n=t.getNextSibling();ae(n)&&t.getListType()===n.getListType()&&Ri(t,n)}(e),function(t){const n=t.getListType()!=="check";let s=t.getStart();for(const o of t.getChildren())ke(o)&&(o.getValue()!==s&&o.setValue(s),n&&o.getLatest().__checked!=null&&o.setChecked(void 0),ae(o.getFirstChild())||s++)}(e)}}static importDOM(){return{ol:()=>({conversion:el,priority:0}),ul:()=>({conversion:el,priority:0})}}static importJSON(e){const t=Xe(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config,e);return t&&Lt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(ke(n))super.append(n);else{const s=et();if(ae(n))s.append(n);else if(F(n))if(n.isInline())s.append(n);else{const o=je(n.getTextContent());s.append(o)}else s.append(n);super.append(s)}}return this}extractWithChild(e){return ke(e)}}function Zo(r,e,t){const n=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],l=$d(t)-1,a=l%i.length,u=i[a],c=o[t.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&n.push(c),h!==void 0&&t.__listType==="check"&&n.push(h),u!==void 0){n.push(...Xn(u));for(let g=0;g<i.length;g++)g!==a&&s.push(t.__tag+g)}if(d!==void 0){const g=Xn(d);l>1?n.push(...g):s.push(...g)}}s.length>0&&xa(r,...s),n.length>0&&bn(r,...n)}function Vd(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];if(ke(n)){e.push(n);const s=n.getChildren();s.length>1&&s.forEach(o=>{ae(o)&&e.push(Ho(o))})}else e.push(Ho(n))}return e}function el(r){const e=r.nodeName.toLowerCase();let t=null;return e==="ol"?t=Xe("number",r.start):e==="ul"&&(t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list"))return!0;for(const s of n.childNodes)if(Lt(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(r)?Xe("check"):Xe("bullet")),{after:Vd,node:t}}const tl={ol:"number",ul:"bullet"};function Xe(r,e=1){return Tt(new Nr(r,e))}function ae(r){return r instanceof Nr}const Aa=an(),Ta=an(),Hd=an();function Jd(r){return ur(r.registerCommand(Ta,()=>(Jo(r,"number"),!0),_r),r.registerCommand(Aa,()=>(Jo(r,"bullet"),!0),_r),r.registerCommand(Hd,()=>(zd(r),!0),_r),r.registerCommand(en,()=>!!Wd(),_r))}function Qd(){const[r]=mt();return D.useEffect(()=>{if(!r.hasNodes([Nr,cr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),function(e){D.useEffect(()=>Jd(e),[e])}(r),null}const Yd=new Set(["http:","https:","mailto:","sms:","tel:"]);class dr extends Pt{static getType(){return"link"}static clone(e){return new dr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),bn(t,e.theme.link),t}updateDOM(e,t,n){if(t instanceof HTMLAnchorElement){const s=this.__url,o=this.__target,i=this.__rel,l=this.__title;s!==e.__url&&(t.href=s),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Xd,priority:1})}}static importJSON(e){const t=Zn(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Yd.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=Zn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!I(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Xd(r){let e=null;if(uc(r)){const t=r.textContent;(t!==null&&t!==""||r.children.length>0)&&(e=Zn(r.getAttribute("href")||"",{rel:r.getAttribute("rel"),target:r.getAttribute("target"),title:r.getAttribute("title")}))}return{node:e}}function Zn(r,e){return Tt(new dr(r,e))}function $r(r){return r instanceof dr}class _n extends dr{constructor(e,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new _n(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=rl(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(F(n)){const s=rl(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(s),s}return null}}function rl(r,e){return Tt(new _n(r,e))}function Zd(r){return r instanceof _n}const nl=an();function Rs(r,e={}){const{target:t,title:n}=e,s=e.rel===void 0?"noreferrer":e.rel,o=V();if(!I(o))return;const i=o.extract();if(r===null)i.forEach(l=>{const a=ps(l,u=>!Zd(u)&&$r(u));if(a){const u=a.getChildren();for(let c=0;c<u.length;c++)a.insertBefore(u[c]);a.remove()}});else{if(i.length===1){const u=function(c,d){let f=c;for(;f!==null&&f.getParent()!==null&&!d(f);)f=f.getParentOrThrow();return d(f)?f:null}(i[0],$r);if(u!==null)return u.setURL(r),t!==void 0&&u.setTarget(t),s!==null&&u.setRel(s),void(n!==void 0&&u.setTitle(n))}let l=null,a=null;i.forEach(u=>{const c=u.getParent();if(c!==a&&c!==null&&(!F(u)||u.isInline())){if($r(c))return a=c,c.setURL(r),t!==void 0&&c.setTarget(t),s!==null&&a.setRel(s),void(n!==void 0&&a.setTitle(n));if(c.is(l)||(l=c,a=Zn(r,{rel:s,target:t,title:n}),$r(c)?u.getPreviousSibling()===null?c.insertBefore(a):c.insertAfter(a):u.insertBefore(a)),$r(u)){if(u.is(a))return;if(a!==null){const d=u.getChildren();for(let f=0;f<d.length;f++)a.append(d[f])}u.remove()}else a!==null&&a.append(u)}})}}function ef({validateUrl:r,attributes:e}){const[t]=mt();return D.useEffect(()=>{if(!t.hasNodes([dr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return ur(t.registerCommand(nl,n=>{if(n===null)return Rs(n),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(Rs(n,e),!0);{const{url:s,target:o,rel:i,title:l}=n;return Rs(s,{...e,rel:i,target:o,title:l}),!0}},_r),r!==void 0?t.registerCommand(ts,n=>{const s=V();if(!I(s)||s.isCollapsed()||!Gt(n,ClipboardEvent))return!1;const o=n;if(o.clipboardData===null)return!1;const i=o.clipboardData.getData("text");return!!r(i)&&!s.getNodes().some(l=>F(l))&&(t.dispatchCommand(nl,{...e,url:i}),n.preventDefault(),!0)},_r):()=>{})},[t,r,e]),null}const tf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6"},rf={paragraph:"mail-editor-paragraph",text:{bold:"mail-editor-bold",italic:"mail-editor-italic",underline:"mail-editor-underline"},list:{ul:"mail-editor-ul",ol:"mail-editor-ol",listitem:"mail-editor-li"},link:"mail-editor-link",quote:"mail-editor-quote",heading:{h1:"mail-editor-h1",h2:"mail-editor-h2",h3:"mail-editor-h3"}};function nf({theme:r,disabled:e,onAiRestructure:t,onAiProofread:n,onAiRewrite:s,aiProcessing:o,aiProcessingAction:i,onAiAction:l,hasContent:a}){const[u]=mt(),[c,d]=D.useState(!1),f=D.useRef(null),h=t||n||s,g=D.useCallback(()=>{u.dispatchCommand(pt,"bold")},[u]),m=D.useCallback(()=>{u.dispatchCommand(pt,"italic")},[u]),y=D.useCallback(()=>{u.dispatchCommand(pt,"underline")},[u]),w=D.useCallback(()=>{u.dispatchCommand(Aa,void 0)},[u]),x=D.useCallback(()=>{u.dispatchCommand(Ta,void 0)},[u]),E=D.useCallback(()=>{u.update(()=>{const b=V();I(b)&&Jc(b,()=>Li())})},[u]),C={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",borderRadius:"4px",cursor:e?"not-allowed":"pointer",color:e?r.textSecondary:r.text,fontSize:"14px",fontWeight:600,opacity:e?.5:1},k=`
|
|
73
|
+
`?a.insertParagraph():u===" "?a.insertNodes([gn()]):a.insertText(u)}}}else e.insertRawText(o)}function Po(r,e,t){r.dispatchCommand(_u,{nodes:e,selection:t})||t.insertNodes(e)}function Sa(r,e,t,n=[]){let s=e===null||t.isSelected(e);const o=F(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let u=Ai(t);u=q(u)&&e!==null?ma(e,u):u,i=u}const l=F(i)?i.getChildren():[],a=function(u){const c=u.exportJSON(),d=u.constructor;if(c.type!==d.getType()&&Zn(58,d.name),F(u)){const f=c.children;Array.isArray(f)||Zn(59,d.name)}return c}(i);if(q(i)){const u=i.__text;u.length>0?a.text=u:s=!1}for(let u=0;u<l.length;u++){const c=l[u],d=Sa(r,e,c,a.children);!s&&F(t)&&d&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)n.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const c=a.children[u];n.push(c)}return s}function ad(r,e){const t=[],n=Se().getChildren();for(let s=0;s<n.length;s++)Sa(r,e,n[s],t);return{namespace:r._config.namespace,nodes:t}}function ud(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t],s=Bc(n);q(s)&&Hc(s),e.push(s)}return e}let mr=null;async function Oo(r,e,t){if(mr!==null)return!1;if(e!==null)return new Promise((a,u)=>{r.update(()=>{a(Mo(r,e,t))})});const n=r.getRootElement(),s=r._window==null?window.document:r._window.document,o=at(r._window);if(n===null||o===null)return!1;const i=s.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(s.createTextNode("#")),n.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),o.removeAllRanges(),o.addRange(l),new Promise((a,u)=>{const c=r.registerCommand(ss,d=>(Kt(d,ClipboardEvent)&&(c(),mr!==null&&(window.clearTimeout(mr),mr=null),a(Mo(r,d,t))),!0),jc);mr=window.setTimeout(()=>{c(),mr=null,a(!1)},50),s.execCommand("copy"),i.remove()})}function Mo(r,e,t){if(t===void 0){const s=at(r._window);if(!s)return!1;const o=s.anchorNode,i=s.focusNode;if(o!==null&&i!==null&&!dn(r,o,i))return!1;const l=K();if(l===null)return!1;t=dd(l)}e.preventDefault();const n=e.clipboardData;return n!==null&&(fd(n,t),!0)}const cd=[["text/html",od],["application/x-lexical-editor",ld]];function dd(r=K()){const e={"text/plain":r?r.getTextContent():""};if(r){const t=cc();for(const[n,s]of cd){const o=s(t,r);o!==null&&(e[n]=o)}}return e}function fd(r,e){for(const t in e){const n=e[t];n!==void 0&&r.setData(t,n)}}function Io(r,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(r,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(r,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Br=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hd=Br&&"documentMode"in document?document.documentMode:null,pd=!(!Br||!("InputEvent"in window)||hd)&&"getTargetRanges"in new window.InputEvent("input"),gd=Br&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),$o=Br&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,md=Br&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yd=Br&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!md,zo=an();class ys extends Pt{static getType(){return"quote"}static clone(e){return new ys(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return bn(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:xd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Ri();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=Fe(),s=this.getDirection();return n.setDirection(s),this.insertAfter(n,t),n}collapseAtStart(){const e=Fe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Ri(){return kt(new ys)}class xs extends Pt{static getType(){return"heading"}static clone(e){return new xs(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];bn(n,o)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:yr,priority:0}),h2:e=>({conversion:yr,priority:0}),h3:e=>({conversion:yr,priority:0}),h4:e=>({conversion:yr,priority:0}),h5:e=>({conversion:yr,priority:0}),h6:e=>({conversion:yr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&qo(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>qo(e)?{conversion:t=>({node:Wr("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Lt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Wr(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&n===s.getTextContentSize()||!e?Fe():Wr(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),n===0&&!this.isEmpty()&&e){const l=Fe();l.select(),this.replace(l,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Fe():Wr(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function qo(r){return r.nodeName.toLowerCase()==="span"&&r.style.fontSize==="26pt"}function yr(r){const e=r.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Wr(e),r.style!==null&&(Ti(r,t),t.setFormat(r.style.textAlign))),{node:t}}function xd(r){const e=Ri();return r.style!==null&&(e.setFormat(r.style.textAlign),Ti(r,e)),{node:e}}function Wr(r){return kt(new xs(r))}function Tn(r){let e=null;if(Kt(r,DragEvent)?e=r.dataTransfer:Kt(r,ClipboardEvent)&&(e=r.clipboardData),e===null)return[!1,[],!1];const t=e.types,n=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[n,Array.from(e.files),s]}function Uo(r){const e=K();if(!M(e))return!1;const t=new Set,n=e.getNodes();for(let s=0;s<n.length;s++){const o=n[s],i=o.getKey();if(t.has(i))continue;const l=ms(o,u=>F(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),r(l))}return t.size>0}function Bn(r){const e=Er(r);return me(e)}function bd(r){return cr(r.registerCommand(fl,e=>{const t=K();return!!vt(t)&&(t.clear(),!0)},0),r.registerCommand(rr,e=>{const t=K();return!!M(t)&&(t.deleteCharacter(e),!0)},ce),r.registerCommand(tn,e=>{const t=K();return!!M(t)&&(t.deleteWord(e),!0)},ce),r.registerCommand(rn,e=>{const t=K();return!!M(t)&&(t.deleteLine(e),!0)},ce),r.registerCommand(Cr,e=>{const t=K();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const n=e.dataTransfer;if(n!=null)Ro(n,t,r);else if(M(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ce),r.registerCommand(Is,()=>{const e=K();return!!M(e)&&(e.removeText(),!0)},ce),r.registerCommand(ht,e=>{const t=K();return!!M(t)&&(t.formatText(e),!0)},ce),r.registerCommand(Au,e=>{const t=K();if(!M(t)&&!vt(t))return!1;const n=t.getNodes();for(const s of n){const o=ms(s,i=>F(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},ce),r.registerCommand(vr,e=>{const t=K();return!!M(t)&&(t.insertLineBreak(e),!0)},ce),r.registerCommand(en,()=>{const e=K();return!!M(e)&&(e.insertParagraph(),!0)},ce),r.registerCommand(Eu,()=>(ia([gn()]),!0),ce),r.registerCommand(ku,()=>Uo(e=>{const t=e.getIndent();e.setIndent(t+1)}),ce),r.registerCommand(Vi,()=>Uo(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),ce),r.registerCommand(gl,e=>{const t=K();if(vt(t)&&!Bn(e.target)){const n=t.getNodes();if(n.length>0)return n[0].selectPrevious(),!0}else if(M(t)){const n=nn(t.focus,!0);if(!e.shiftKey&&me(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},ce),r.registerCommand(ml,e=>{const t=K();if(vt(t)){const n=t.getNodes();if(n.length>0)return n[0].selectNext(0,0),!0}else if(M(t)){if(function(s){const o=s.focus;return o.key==="root"&&o.offset===Se().getChildrenSize()}(t))return e.preventDefault(),!0;const n=nn(t.focus,!1);if(!e.shiftKey&&me(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},ce),r.registerCommand(pl,e=>{const t=K();if(vt(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!M(t))return!1;if(Fo(t,!0)){const n=e.shiftKey;return e.preventDefault(),jo(t,n,!0),!0}return!1},ce),r.registerCommand(hl,e=>{const t=K();if(vt(t)&&!Bn(e.target)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),s[0].selectNext(0,0),!0}if(!M(t))return!1;const n=e.shiftKey;return!!Fo(t,!1)&&(e.preventDefault(),jo(t,n,!1),!0)},ce),r.registerCommand(yl,e=>{if(Bn(e.target))return!1;const t=K();if(!M(t))return!1;const{anchor:n}=t,s=n.getNode();return t.isCollapsed()&&n.offset===0&&!Je(s)&&rd(s).getIndent()>0?(e.preventDefault(),r.dispatchCommand(Vi,void 0)):(!$o||navigator.language!=="ko-KR")&&(e.preventDefault(),r.dispatchCommand(rr,!0))},ce),r.registerCommand(bl,e=>{if(Bn(e.target))return!1;const t=K();return!!M(t)&&(e.preventDefault(),r.dispatchCommand(rr,!1))},ce),r.registerCommand(On,e=>{const t=K();if(!M(t))return!1;if(e!==null){if(($o||gd||yd)&&pd)return!1;if(e.preventDefault(),e.shiftKey)return r.dispatchCommand(vr,!1)}return r.dispatchCommand(en,void 0)},ce),r.registerCommand(xl,()=>{const e=K();return!!M(e)&&(r.blur(),!0)},ce),r.registerCommand(_l,e=>{const[,t]=Tn(e);if(t.length>0){const s=Io(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,l=Er(i);if(l!==null){const a=Ec();if(q(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const c=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(c,d,"element"),a.focus.set(c,d,"element")}const u=Bl(a);Dt(u)}r.dispatchCommand(zo,t)}return e.preventDefault(),!0}const n=K();return!!M(n)},ce),r.registerCommand(vl,e=>{const[t]=Tn(e),n=K();return!(t&&!M(n))},ce),r.registerCommand(Cl,e=>{const[t]=Tn(e),n=K();if(t&&!M(n))return!1;const s=Io(e.clientX,e.clientY);if(s!==null){const o=Er(s.node);me(o)&&e.preventDefault()}return!0},ce),r.registerCommand($s,()=>(oc(),!0),ce),r.registerCommand(ss,e=>(Oo(r,Kt(e,ClipboardEvent)?e:null),!0),ce),r.registerCommand(di,e=>(async function(t,n){await Oo(n,Kt(t,ClipboardEvent)?t:null),n.update(()=>{const s=K();M(s)?s.removeText():vt(s)&&s.getNodes().forEach(o=>o.remove())})}(e,r),!0),ce),r.registerCommand(ns,e=>{const[,t,n]=Tn(e);return t.length>0&&!n?(r.dispatchCommand(zo,t),!0):vi(e.target)?!1:K()!==null&&(function(s,o){s.preventDefault(),o.update(()=>{const i=K(),l=Kt(s,InputEvent)||Kt(s,KeyboardEvent)?null:s.clipboardData;l!=null&&i!==null&&Ro(l,i,o)},{tag:"paste"})}(e,r),!0)},ce))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Wo(r){return r.getEditorState().read(ga(r.isComposing()))}function _d({contentEditable:r,placeholder:e=null,ErrorBoundary:t}){const[n]=gt(),s=function(o,i){const[l,a]=D.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(u=>{Oi.flushSync(()=>{a(u)})}),[o]),D.useEffect(()=>{a(o.getDecorators())},[o]),D.useMemo(()=>{const u=[],c=Object.keys(l);for(let d=0;d<c.length;d++){const f=c[d],h=p.jsx(i,{onError:m=>o._onError(m),children:p.jsx(D.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&u.push(Oi.createPortal(h,g,f))}return u},[i,l,o])}(n,t);return function(o){ri(()=>cr(bd(o),nd(o)),[o])}(n),p.jsxs(p.Fragment,{children:[r,p.jsx(vd,{content:e}),s]})}function vd({content:r}){const[e]=gt(),t=function(s){const[o,i]=D.useState(()=>Wo(s));return ri(()=>{function l(){const a=Wo(s);i(a)}return l(),cr(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),o}(e),n=Ic();return t?typeof r=="function"?r(n):r:null}const Ea=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Cd({editor:r,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:g,id:m,role:y="textbox",spellCheck:C=!0,style:v,tabIndex:E,"data-testid":w,...k},x){const[b,S]=D.useState(r.isEditable()),A=D.useCallback(N=>{N&&N.ownerDocument&&N.ownerDocument.defaultView?r.setRootElement(N):r.setRootElement(null)},[r]),z=D.useMemo(()=>function(...N){return j=>{N.forEach(P=>{typeof P=="function"?P(j):P!=null&&(P.current=j)})}}(x,A),[A,x]);return Ea(()=>(S(r.isEditable()),r.registerEditableListener(N=>{S(N)})),[r]),p.jsx("div",{"aria-activedescendant":b?e:void 0,"aria-autocomplete":b?t:"none","aria-controls":b?n:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":b&&y==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":u,"aria-multiline":c,"aria-owns":b?d:void 0,"aria-readonly":!b||void 0,"aria-required":f,autoCapitalize:h,className:g,contentEditable:b,"data-testid":w,id:m,ref:z,role:b?y:void 0,spellCheck:C,style:v,tabIndex:E,...k})}const wd=D.forwardRef(Cd);function Go(r){return r.getEditorState().read(ga(r.isComposing()))}const Dd=D.forwardRef(Sd);function Sd(r,e){const{placeholder:t,...n}=r,[s]=gt();return p.jsxs(p.Fragment,{children:[p.jsx(wd,{editor:s,...n,ref:e}),t!=null&&p.jsx(Ed,{editor:s,content:t})]})}function Ed({content:r,editor:e}){const t=function(i){const[l,a]=D.useState(()=>Go(i));return Ea(()=>{function u(){const c=Go(i);a(c)}return u(),cr(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(e),[n,s]=D.useState(e.isEditable());if(D.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof r=="function"?o=r(n):r!==null&&(o=r),o===null?null:p.jsx("div",{"aria-hidden":!0,children:o})}const Nn=0,ni=1,si=2,ft=0,kd=1,Ko=2,Ad=3,Td=4;function Bd(r,e,t,n,s){if(r===null||t.size===0&&n.size===0&&!s)return ft;const o=e._selection,i=r._selection;if(s)return kd;if(!(M(o)&&M(i)&&i.isCollapsed()&&o.isCollapsed()))return ft;const l=function(C,v,E){const w=C._nodeMap,k=[];for(const x of v){const b=w.get(x);b!==void 0&&k.push(b)}for(const[x,b]of E){if(!b)continue;const S=w.get(x);S===void 0||Je(S)||k.push(S)}return k}(e,t,n);if(l.length===0)return ft;if(l.length>1){const C=e._nodeMap,v=C.get(o.anchor.key),E=C.get(i.anchor.key);return v&&E&&!r._nodeMap.has(v.__key)&&q(v)&&v.__text.length===1&&o.anchor.offset===1?Ko:ft}const a=l[0],u=r._nodeMap.get(a.__key);if(!q(u)||!q(a)||u.__mode!==a.__mode)return ft;const c=u.__text,d=a.__text;if(c===d)return ft;const f=o.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return ft;const g=f.offset,m=h.offset,y=d.length-c.length;return y===1&&m===g-1?Ko:y===-1&&m===g+1?Ad:y===-1&&m===g?Td:ft}function Nd(r,e){let t=Date.now(),n=ft;return(s,o,i,l,a,u)=>{const c=Date.now();if(u.has("historic"))return n=ft,t=c,si;const d=Bd(s,o,l,a,r.isComposing()),f=(()=>{const h=i===null||i.editor===r,g=u.has("history-push");if(!g&&h&&u.has("history-merge"))return Nn;if(s===null)return ni;const m=o._selection;return l.size>0||a.size>0?g===!1&&d!==ft&&d===n&&c<t+e&&h||l.size===1&&function(y,C,v){const E=C._nodeMap.get(y),w=v._nodeMap.get(y),k=C._selection,x=v._selection;return!(M(k)&&M(x)&&k.anchor.type==="element"&&k.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"||!q(E)||!q(w)||E.__parent!==w.__parent)&&JSON.stringify(C.read(()=>E.exportJSON()))===JSON.stringify(v.read(()=>w.exportJSON()))}(Array.from(l)[0],s,o)?Nn:ni:m!==null?Nn:si})();return t=c,n=d,f}}function Vo(r){r.undoStack=[],r.redoStack=[],r.current=null}function Fd(r,e,t){const n=Nd(r,t);return cr(r.registerCommand(ui,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(a.length!==0){const u=i.current,c=a.pop();u!==null&&(l.push(u),o.dispatchCommand(Dn,!0)),a.length===0&&o.dispatchCommand(Sn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ce),r.registerCommand(ci,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(l.length!==0){const u=i.current;u!==null&&(a.push(u),o.dispatchCommand(Sn,!0));const c=l.pop();l.length===0&&o.dispatchCommand(Dn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ce),r.registerCommand(Bu,()=>(Vo(e),!1),ce),r.registerCommand(Nu,()=>(Vo(e),r.dispatchCommand(Dn,!1),r.dispatchCommand(Sn,!1),!0),ce),r.registerUpdateListener(({editorState:o,prevEditorState:i,dirtyLeaves:l,dirtyElements:a,tags:u})=>{const c=e.current,d=e.redoStack,f=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&o===h)return;const g=n(i,o,c,l,a,u);if(g===ni)d.length!==0&&(e.redoStack=[],r.dispatchCommand(Dn,!1)),c!==null&&(f.push({...c}),r.dispatchCommand(Sn,!0));else if(g===si)return;e.current={editor:r,editorState:o}}))}function jd(){return{current:null,redoStack:[],undoStack:[]}}function Ld({delay:r,externalHistoryState:e}){const[t]=gt();return function(n,s,o=1e3){const i=D.useMemo(()=>s||jd(),[s]);D.useEffect(()=>Fd(n,i,o),[o,n,i])}(t,e,r),null}const Rd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Pd({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:e=!1,onChange:t}){const[n]=gt();return Rd(()=>{if(t)return n.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:l,tags:a})=>{e&&o.size===0&&i.size===0||r&&a.has("history-merge")||l.isEmpty()||t(s,n,a)})},[n,r,e,t]),null}function ii(r,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},ii(r,e)}var Ho={error:null},Od=function(r){var e,t;function n(){for(var o,i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return(o=r.call.apply(r,[this].concat(l))||this).state=Ho,o.resetErrorBoundary=function(){for(var u,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];o.props.onReset==null||(u=o.props).onReset.apply(u,d),o.reset()},o}t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),n.getDerivedStateFromError=function(o){return{error:o}};var s=n.prototype;return s.reset=function(){this.setState(Ho)},s.componentDidCatch=function(o,i){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,i)},s.componentDidUpdate=function(o,i){var l,a,u,c,d=this.state.error,f=this.props.resetKeys;d!==null&&i.error!==null&&((u=o.resetKeys)===void 0&&(u=[]),(c=f)===void 0&&(c=[]),u.length!==c.length||u.some(function(h,g){return!Object.is(h,c[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},s.render=function(){var o=this.state.error,i=this.props,l=i.fallbackRender,a=i.FallbackComponent,u=i.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(vs.isValidElement(u))return u;if(typeof l=="function")return l(c);if(a)return vs.createElement(a,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},n}(vs.Component);function Md({children:r,onError:e}){return p.jsx(Od,{fallback:p.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:r})}function Id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ct=Id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function $d(r){let e=1,t=r.getParent();for(;t!=null;){if(ke(t)){const n=t.getParent();if(oe(n)){e++,t=n.getParent();continue}Ct(40)}return e}return e}function oi(r){let e=r.getParent();oe(e)||Ct(40);let t=e;for(;t!==null;)t=t.getParent(),oe(t)&&(e=t);return e}function ka(r){let e=[];const t=r.getChildren().filter(ke);for(let n=0;n<t.length;n++){const s=t[n],o=s.getFirstChild();oe(o)?e=e.concat(ka(o)):e.push(s)}return e}function wt(r){return ke(r)&&oe(r.getFirstChild())}function Jo(r){return st().append(r)}function Aa(r,e){return ke(r)&&(e.length===0||e.length===1&&r.is(e[0])&&r.getChildrenSize()===0)}function Qo(r,e){r.update(()=>{const t=K();if(t!==null){const n=t.getNodes();if(M(t)){const o=t.getStartEndPoints();o===null&&Ct(143);const[i]=o,l=i.getNode(),a=l.getParent();if(Aa(l,n)){const u=et(e);if(St(a)){l.replace(u);const c=st();F(l)&&(c.setFormat(l.getFormatType()),c.setIndent(l.getIndent())),u.append(c)}else if(ke(l)){const c=l.getParentOrThrow();ur(u,c.getChildren()),c.replace(u)}return}}const s=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(!F(i)||!i.isEmpty()||ke(i)||s.has(i.getKey())){if(Fl(i)){let l=i.getParent();for(;l!=null;){const a=l.getKey();if(oe(l)){if(!s.has(a)){const u=et(e);ur(u,l.getChildren()),l.replace(u),s.add(a)}break}{const u=l.getParent();if(St(u)&&!s.has(a)){s.add(a),Yo(l,e);break}l=u}}}}else Yo(i,e)}}})}function ur(r,e){r.splice(r.getChildrenSize(),0,e)}function Yo(r,e){if(oe(r))return r;const t=r.getPreviousSibling(),n=r.getNextSibling(),s=st();let o;if(ur(s,r.getChildren()),oe(t)&&e===t.getListType())t.append(s),oe(n)&&e===n.getListType()&&(ur(t,n.getChildren()),n.remove()),o=t;else if(oe(n)&&e===n.getListType())n.getFirstChildOrThrow().insertBefore(s),o=n;else{const i=et(e);i.append(s),r.replace(i),o=i}return s.setFormat(r.getFormatType()),s.setIndent(r.getIndent()),r.remove(),o}function Pi(r,e){const t=r.getLastChild(),n=e.getFirstChild();t&&n&&wt(t)&&wt(n)&&(Pi(t.getFirstChild(),n.getFirstChild()),n.remove());const s=e.getChildren();s.length>0&&r.append(...s),e.remove()}function zd(r){r.update(()=>{const e=K();if(M(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(Aa(s,n))t.add(oi(s));else for(let o=0;o<n.length;o++){const i=n[o];if(Fl(i)){const l=td(i,dr);l!=null&&t.add(oi(l))}}for(const o of t){let i=o;const l=ka(o);for(const a of l){const u=Fe();ur(u,a.getChildren()),i.insertAfter(u),i=u,a.__key===e.anchor.key&&e.anchor.set(u.getKey(),0,"element"),a.__key===e.focus.key&&e.focus.set(u.getKey(),0,"element"),a.remove()}o.remove()}}})}function qd(r){const e=new Set;if(wt(r)||e.has(r.getKey()))return;const t=r.getParent(),n=r.getNextSibling(),s=r.getPreviousSibling();if(wt(n)&&wt(s)){const o=s.getFirstChild();if(oe(o)){o.append(r);const i=n.getFirstChild();oe(i)&&(ur(o,i.getChildren()),n.remove(),e.add(n.getKey()))}}else if(wt(n)){const o=n.getFirstChild();if(oe(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(r)}}else if(wt(s)){const o=s.getFirstChild();oe(o)&&o.append(r)}else if(oe(t)){const o=st(),i=et(t.getListType());o.append(i),i.append(r),s?s.insertAfter(o):n?n.insertBefore(o):t.append(o)}}function Ud(r){if(wt(r))return;const e=r.getParent(),t=e?e.getParent():void 0;if(oe(t?t.getParent():void 0)&&ke(t)&&oe(e)){const n=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(r.is(n))t.insertBefore(r),e.isEmpty()&&t.remove();else if(r.is(s))t.insertAfter(r),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=st(),l=et(o);i.append(l),r.getPreviousSiblings().forEach(c=>l.append(c));const a=st(),u=et(o);a.append(u),ur(u,r.getNextSiblings()),t.insertBefore(i),t.insertAfter(a),t.replace(r)}}}function Wd(){const r=K();if(!M(r)||!r.isCollapsed())return!1;const e=r.anchor.getNode();if(!ke(e)||e.getChildrenSize()!==0)return!1;const t=oi(e),n=e.getParent();oe(n)||Ct(40);const s=n.getParent();let o;if(St(s))o=Fe(),t.insertAfter(o);else{if(!ke(s))return!1;o=st(),s.insertAfter(o)}o.select();const i=e.getNextSiblings();if(i.length>0){const l=et(n.getListType());if(kr(o))o.insertAfter(l);else{const a=st();a.append(l),o.insertAfter(a)}i.forEach(a=>{a.remove(),l.append(a)})}return function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const u=a.getParent();if(u==null||!ke(a)&&!oe(a))break;a=u}a.remove()}(e),!0}function es(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}class dr extends Pt{static getType(){return"listitem"}static clone(e){return new dr(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return oe(n)&&n.getListType()==="check"&&Zo(t,this,null),t.value=this.__value,Xo(t,e.theme,this),t}updateDOM(e,t,n){const s=this.getParent();return oe(s)&&s.getListType()==="check"&&Zo(t,this,e),t.value=this.__value,Xo(t,n.theme,this),!1}static transform(){return e=>{if(ke(e)||Ct(144),e.__checked==null)return;const t=e.getParent();oe(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Gd,priority:0})}}static importJSON(e){const t=st();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(F(n)&&this.canMergeWith(n)){const s=n.getChildren();this.append(...s),n.remove()}else super.append(n)}return this}replace(e,t){if(ke(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!oe(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const s=et(n.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}n.insertAfter(e),e.insertAfter(s)}return t&&(F(e)||Ct(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(oe(n)||Ct(39),ke(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(n.insertAfter(e,t),s.length!==0){const o=et(n.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&wt(t)&&wt(n)&&(Pi(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=st(this.__checked==null&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=Fe();this.getChildren().forEach(i=>t.append(i));const n=this.getParentOrThrow(),s=n.getParentOrThrow(),o=ke(s);if(n.getChildrenSize()===1)if(o)n.remove(),s.select();else{n.insertBefore(t),n.remove();const i=e.anchor,l=e.focus,a=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(a,i.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return oe(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;ke(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&Ct(117),(e=Math.floor(e))>=0||Ct(199);let t=this.getIndent();for(;t!==e;)t<e?(qd(this),t++):(Ud(this),t--);return this}canInsertAfter(e){return ke(e)}canReplaceWith(e){return ke(e)}canMergeWith(e){return kr(e)||ke(e)}extractWithChild(e,t){if(!M(t))return!1;const n=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return et("bullet")}canMergeWhenEmpty(){return!0}}function Xo(r,e,t){const n=[],s=[],o=e.list,i=o?o.listitem:void 0;let l;if(o&&o.nested&&(l=o.nested.listitem),i!==void 0&&n.push(...es(i)),o){const a=t.getParent(),u=oe(a)&&a.getListType()==="check",c=t.getChecked();u&&!c||s.push(o.listitemUnchecked),u&&c||s.push(o.listitemChecked),u&&n.push(c?o.listitemChecked:o.listitemUnchecked)}if(l!==void 0){const a=es(l);t.getChildren().some(u=>oe(u))?n.push(...a):s.push(...a)}s.length>0&&ba(r,...s),n.length>0&&bn(r,...n)}function Zo(r,e,t,n){oe(e.getFirstChild())?(r.removeAttribute("role"),r.removeAttribute("tabIndex"),r.removeAttribute("aria-checked")):(r.setAttribute("role","checkbox"),r.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||r.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Gd(r){if(r.classList.contains("task-list-item")){for(const t of r.children)if(t.tagName==="INPUT")return Kd(t)}const e=r.getAttribute("aria-checked");return{node:st(e==="true"||e!=="false"&&void 0)}}function Kd(r){return r.getAttribute("type")!=="checkbox"?{node:null}:{node:st(r.hasAttribute("checked"))}}function st(r){return kt(new dr(void 0,r))}function ke(r){return r instanceof dr}class Nr extends Pt{static getType(){return"list"}static clone(e){const t=e.__listType||rl[e.__tag];return new Nr(t,e.__start,e.__key)}constructor(e,t,n){super(n);const s=rl[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,s=document.createElement(n);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,el(s,e.theme,this),s}updateDOM(e,t,n){return e.__tag!==this.__tag||(el(t,n.theme,this),!1)}static transform(){return e=>{oe(e)||Ct(163),function(t){const n=t.getNextSibling();oe(n)&&t.getListType()===n.getListType()&&Pi(t,n)}(e),function(t){const n=t.getListType()!=="check";let s=t.getStart();for(const o of t.getChildren())ke(o)&&(o.getValue()!==s&&o.setValue(s),n&&o.getLatest().__checked!=null&&o.setChecked(void 0),oe(o.getFirstChild())||s++)}(e)}}static importDOM(){return{ol:()=>({conversion:tl,priority:0}),ul:()=>({conversion:tl,priority:0})}}static importJSON(e){const t=et(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config,e);return t&&Lt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(ke(n))super.append(n);else{const s=st();if(oe(n))s.append(n);else if(F(n))if(n.isInline())s.append(n);else{const o=Le(n.getTextContent());s.append(o)}else s.append(n);super.append(s)}}return this}extractWithChild(e){return ke(e)}}function el(r,e,t){const n=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],l=$d(t)-1,a=l%i.length,u=i[a],c=o[t.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&n.push(c),h!==void 0&&t.__listType==="check"&&n.push(h),u!==void 0){n.push(...es(u));for(let g=0;g<i.length;g++)g!==a&&s.push(t.__tag+g)}if(d!==void 0){const g=es(d);l>1?n.push(...g):s.push(...g)}}s.length>0&&ba(r,...s),n.length>0&&bn(r,...n)}function Vd(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];if(ke(n)){e.push(n);const s=n.getChildren();s.length>1&&s.forEach(o=>{oe(o)&&e.push(Jo(o))})}else e.push(Jo(n))}return e}function tl(r){const e=r.nodeName.toLowerCase();let t=null;return e==="ol"?t=et("number",r.start):e==="ul"&&(t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list"))return!0;for(const s of n.childNodes)if(Lt(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(r)?et("check"):et("bullet")),{after:Vd,node:t}}const rl={ol:"number",ul:"bullet"};function et(r,e=1){return kt(new Nr(r,e))}function oe(r){return r instanceof Nr}const Ta=an(),Ba=an(),Hd=an();function Jd(r){return cr(r.registerCommand(Ba,()=>(Qo(r,"number"),!0),_r),r.registerCommand(Ta,()=>(Qo(r,"bullet"),!0),_r),r.registerCommand(Hd,()=>(zd(r),!0),_r),r.registerCommand(en,()=>!!Wd(),_r))}function Qd(){const[r]=gt();return D.useEffect(()=>{if(!r.hasNodes([Nr,dr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),function(e){D.useEffect(()=>Jd(e),[e])}(r),null}const Yd=new Set(["http:","https:","mailto:","sms:","tel:"]);class fr extends Pt{static getType(){return"link"}static clone(e){return new fr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),bn(t,e.theme.link),t}updateDOM(e,t,n){if(t instanceof HTMLAnchorElement){const s=this.__url,o=this.__target,i=this.__rel,l=this.__title;s!==e.__url&&(t.href=s),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Xd,priority:1})}}static importJSON(e){const t=ts(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Yd.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=ts(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!M(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Xd(r){let e=null;if(uc(r)){const t=r.textContent;(t!==null&&t!==""||r.children.length>0)&&(e=ts(r.getAttribute("href")||"",{rel:r.getAttribute("rel"),target:r.getAttribute("target"),title:r.getAttribute("title")}))}return{node:e}}function ts(r,e){return kt(new fr(r,e))}function $r(r){return r instanceof fr}class _n extends fr{constructor(e,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new _n(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=nl(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(F(n)){const s=nl(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(s),s}return null}}function nl(r,e){return kt(new _n(r,e))}function Zd(r){return r instanceof _n}const sl=an();function Ps(r,e={}){const{target:t,title:n}=e,s=e.rel===void 0?"noreferrer":e.rel,o=K();if(!M(o))return;const i=o.extract();if(r===null)i.forEach(l=>{const a=ms(l,u=>!Zd(u)&&$r(u));if(a){const u=a.getChildren();for(let c=0;c<u.length;c++)a.insertBefore(u[c]);a.remove()}});else{if(i.length===1){const u=function(c,d){let f=c;for(;f!==null&&f.getParent()!==null&&!d(f);)f=f.getParentOrThrow();return d(f)?f:null}(i[0],$r);if(u!==null)return u.setURL(r),t!==void 0&&u.setTarget(t),s!==null&&u.setRel(s),void(n!==void 0&&u.setTitle(n))}let l=null,a=null;i.forEach(u=>{const c=u.getParent();if(c!==a&&c!==null&&(!F(u)||u.isInline())){if($r(c))return a=c,c.setURL(r),t!==void 0&&c.setTarget(t),s!==null&&a.setRel(s),void(n!==void 0&&a.setTitle(n));if(c.is(l)||(l=c,a=ts(r,{rel:s,target:t,title:n}),$r(c)?u.getPreviousSibling()===null?c.insertBefore(a):c.insertAfter(a):u.insertBefore(a)),$r(u)){if(u.is(a))return;if(a!==null){const d=u.getChildren();for(let f=0;f<d.length;f++)a.append(d[f])}u.remove()}else a!==null&&a.append(u)}})}}function ef({validateUrl:r,attributes:e}){const[t]=gt();return D.useEffect(()=>{if(!t.hasNodes([fr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return cr(t.registerCommand(sl,n=>{if(n===null)return Ps(n),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(Ps(n,e),!0);{const{url:s,target:o,rel:i,title:l}=n;return Ps(s,{...e,rel:i,target:o,title:l}),!0}},_r),r!==void 0?t.registerCommand(ns,n=>{const s=K();if(!M(s)||s.isCollapsed()||!Kt(n,ClipboardEvent))return!1;const o=n;if(o.clipboardData===null)return!1;const i=o.clipboardData.getData("text");return!!r(i)&&!s.getNodes().some(l=>F(l))&&(t.dispatchCommand(sl,{...e,url:i}),n.preventDefault(),!0)},_r):()=>{})},[t,r,e]),null}const tf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6"},rf={paragraph:"mail-editor-paragraph",text:{bold:"mail-editor-bold",italic:"mail-editor-italic",underline:"mail-editor-underline"},list:{ul:"mail-editor-ul",ol:"mail-editor-ol",listitem:"mail-editor-li"},link:"mail-editor-link",quote:"mail-editor-quote",heading:{h1:"mail-editor-h1",h2:"mail-editor-h2",h3:"mail-editor-h3"}};function nf({theme:r,disabled:e,onAiRestructure:t,onAiProofread:n,onAiRewrite:s,aiProcessing:o,aiProcessingAction:i,onAiAction:l,hasContent:a}){const[u]=gt(),[c,d]=D.useState(!1),f=D.useRef(null),h=t||n||s,g=D.useCallback(()=>{u.dispatchCommand(ht,"bold")},[u]),m=D.useCallback(()=>{u.dispatchCommand(ht,"italic")},[u]),y=D.useCallback(()=>{u.dispatchCommand(ht,"underline")},[u]),C=D.useCallback(()=>{u.dispatchCommand(Ta,void 0)},[u]),v=D.useCallback(()=>{u.dispatchCommand(Ba,void 0)},[u]),E=D.useCallback(()=>{u.update(()=>{const b=K();M(b)&&Jc(b,()=>Ri())})},[u]),w={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",borderRadius:"4px",cursor:e?"not-allowed":"pointer",color:e?r.textSecondary:r.text,fontSize:"14px",fontWeight:600,opacity:e?.5:1},k=`
|
|
74
74
|
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
75
75
|
background: ${r.border};
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
78
|
-
`).map(_e=>`<p>${_e||"<br>"}</p>`).join(""),
|
|
77
|
+
`,x=()=>{setTimeout(()=>{var b;(b=f.current)!=null&&b.contains(document.activeElement)||d(!1)},150)};return p.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[p.jsx("style",{children:k}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px"},children:[p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:g,disabled:e,style:w,title:"Bold (Ctrl+B)",children:"B"}),p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:m,disabled:e,style:{...w,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:y,disabled:e,style:{...w,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),p.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:C,disabled:e,style:w,title:"Bullet List",children:p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[p.jsx("circle",{cx:"4",cy:"6",r:"2"}),p.jsx("circle",{cx:"4",cy:"12",r:"2"}),p.jsx("circle",{cx:"4",cy:"18",r:"2"}),p.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),p.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),p.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:v,disabled:e,style:w,title:"Numbered List",children:p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[p.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),p.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),p.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),p.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),p.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),p.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),p.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),p.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:E,disabled:e,style:w,title:"Quote",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:p.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]}),h&&p.jsxs("div",{style:{position:"relative"},ref:f,children:[p.jsx("button",{type:"button",onClick:()=>d(!c),disabled:o||!a||e,onBlur:x,style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",fontSize:"13px",color:o||!a?r.textSecondary:"#9333ea",background:"transparent",border:"none",borderRadius:"4px",cursor:o||!a||e?"not-allowed":"pointer",opacity:o||!a?.5:1},children:o?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"material-icons",style:{fontSize:"16px",animation:"spin 1s linear infinite"},children:"hourglass_empty"}),i==="restructure"&&"Restructuring...",i==="proofread"&&"Proofreading...",i==="rewrite"&&"Rewriting..."]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"material-icons",style:{fontSize:"16px"},children:"auto_fix_high"}),"AI",p.jsx("span",{className:"material-icons",style:{fontSize:"14px"},children:"expand_more"})]})}),c&&!o&&p.jsxs("div",{style:{position:"absolute",right:0,top:"100%",marginTop:"4px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:50,minWidth:"200px",padding:"4px 0"},children:[t&&p.jsxs("button",{type:"button",onClick:()=>{l==null||l("restructure"),d(!1)},style:{width:"100%",padding:"8px 12px",textAlign:"left",fontSize:"14px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:b=>b.currentTarget.style.background="#f3f4f6",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:[p.jsx("span",{className:"material-icons",style:{fontSize:"18px",color:"#3b82f6"},children:"format_list_bulleted"}),p.jsxs("div",{children:[p.jsx("div",{style:{fontWeight:500},children:"Restructure"}),p.jsx("div",{style:{fontSize:"12px",color:"#6b7280"},children:"Organize & clarify"})]})]}),n&&p.jsxs("button",{type:"button",onClick:()=>{l==null||l("proofread"),d(!1)},style:{width:"100%",padding:"8px 12px",textAlign:"left",fontSize:"14px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:b=>b.currentTarget.style.background="#f3f4f6",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:[p.jsx("span",{className:"material-icons",style:{fontSize:"18px",color:"#22c55e"},children:"spellcheck"}),p.jsxs("div",{children:[p.jsx("div",{style:{fontWeight:500},children:"Proofread"}),p.jsx("div",{style:{fontSize:"12px",color:"#6b7280"},children:"Fix grammar & spelling"})]})]}),s&&p.jsxs("button",{type:"button",onClick:()=>{l==null||l("rewrite"),d(!1)},style:{width:"100%",padding:"8px 12px",textAlign:"left",fontSize:"14px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:b=>b.currentTarget.style.background="#f3f4f6",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:[p.jsx("span",{className:"material-icons",style:{fontSize:"18px",color:"#9333ea"},children:"brush"}),p.jsxs("div",{children:[p.jsx("div",{style:{fontWeight:500},children:"Rewrite"}),p.jsx("div",{style:{fontSize:"12px",color:"#6b7280"},children:"Your voice & style"})]})]})]})]})]})}function sf({html:r,isExternalUpdate:e,onImportComplete:t}){const[n]=gt(),s=D.useRef(!1);return D.useEffect(()=>{r&&(s.current&&!e||(s.current=!0,n.update(()=>{const o=Se();o.clear();const i=Fe();o.append(i),i.select();const a=new DOMParser().parseFromString(r,"text/html"),c=_a(n,a).filter(d=>d.getParent()===null);c.length>0&&ia(c),i.getTextContent()===""&&o.getChildrenSize()>1&&i.remove(),o.selectEnd()},{discrete:!0}),t(),setTimeout(()=>{n.focus()},0)))},[r,e,n,t]),null}function of({text:r,trigger:e}){const[t]=gt(),n=D.useRef(void 0);return D.useEffect(()=>{if(e===void 0||e===n.current||!r)return;n.current=e;const s=r.trim();s&&(t.update(()=>{const o=K();if(M(o))o.insertText(s);else{const i=Se(),l=i.getLastChild();if(l){l.selectEnd();const a=K();M(a)&&a.insertText(s)}else{const a=Fe(),u=Le(s);a.append(u),i.append(a)}}}),setTimeout(()=>{t.focus()},0))},[r,e,t]),null}function lf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return p.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[p.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),p.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary,maxHeight:"200px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:r.body}})]})}function Na({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:l="200px",externalUpdate:a,insertText:u,insertTextTrigger:c,onAiRestructure:d,onAiProofread:f,onAiRewrite:h,aiProcessing:g,aiProcessingAction:m,renderAboveToolbar:y}){const C={...tf,...s},[v,E]=D.useState(!1),w=D.useRef(void 0),[k,x]=D.useState(r),[b,S]=D.useState(!1),[A,z]=D.useState(null),N=g??b,j=m??A;D.useEffect(()=>{a!==void 0&&a!==w.current&&(w.current=a,E(!0))},[a]);const P=D.useCallback(()=>{E(!1)},[]),R=ue=>ue.replace(/<[^>]*>/g,"").trim(),I=ue=>ue.split(`
|
|
78
|
+
`).map(_e=>`<p>${_e||"<br>"}</p>`).join(""),J=async ue=>{const _e=R(k);if(!_e)return;const Ee=ue==="restructure"?d:ue==="proofread"?f:h;if(Ee){S(!0),z(ue);try{const Pe=await Ee(_e),Oe=I(Pe);x(Oe),e==null||e(Oe),w.current=Date.now(),E(!0)}catch(Pe){console.error(`AI ${ue} failed:`,Pe)}finally{S(!1),z(null)}}},ae=R(k).length>0,le={namespace:"MailEditor",theme:rf,onError:ue=>{console.error("Lexical error:",ue)},nodes:[Nr,dr,fr,_n,xs,ys],editable:!o},te=D.useCallback((ue,_e)=>{ue.read(()=>{const Ee=va(_e,null);x(Ee),e==null||e(Ee)})},[e]),Ce=`
|
|
79
79
|
.mail-editor-paragraph {
|
|
80
80
|
margin: 0 0 8px 0;
|
|
81
81
|
line-height: 1.5;
|
|
@@ -97,15 +97,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
97
97
|
margin: 4px 0;
|
|
98
98
|
}
|
|
99
99
|
.mail-editor-link {
|
|
100
|
-
color: ${
|
|
100
|
+
color: ${C.primary};
|
|
101
101
|
text-decoration: underline;
|
|
102
102
|
}
|
|
103
103
|
.mail-editor-quote {
|
|
104
104
|
margin: 8px 0;
|
|
105
105
|
padding: 8px 16px;
|
|
106
|
-
border-left: 3px solid ${
|
|
107
|
-
background: ${
|
|
108
|
-
color: ${
|
|
106
|
+
border-left: 3px solid ${C.quoteBorder};
|
|
107
|
+
background: ${C.quoteBackground};
|
|
108
|
+
color: ${C.textSecondary};
|
|
109
109
|
}
|
|
110
110
|
.mail-editor-h1 {
|
|
111
111
|
font-size: 24px;
|
|
@@ -128,7 +128,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
128
128
|
padding: 16px;
|
|
129
129
|
font-size: 14px;
|
|
130
130
|
line-height: 1.6;
|
|
131
|
-
color: ${
|
|
131
|
+
color: ${C.text};
|
|
132
132
|
}
|
|
133
133
|
.mail-editor-content:focus {
|
|
134
134
|
outline: none;
|
|
@@ -137,7 +137,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
137
137
|
position: absolute;
|
|
138
138
|
top: 16px;
|
|
139
139
|
left: 16px;
|
|
140
|
-
color: ${
|
|
140
|
+
color: ${C.textSecondary};
|
|
141
141
|
pointer-events: none;
|
|
142
142
|
font-size: 14px;
|
|
143
143
|
}
|
|
@@ -145,9 +145,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
145
145
|
from { transform: rotate(0deg); }
|
|
146
146
|
to { transform: rotate(360deg); }
|
|
147
147
|
}
|
|
148
|
-
`;return p.jsxs("div",{className:i,style:{border:`1px solid ${
|
|
148
|
+
`;return p.jsxs("div",{className:i,style:{border:`1px solid ${C.border}`,borderRadius:"8px",background:C.background,overflow:"hidden",display:"flex",flexDirection:"column",height:"100%",minHeight:l},children:[p.jsx("style",{children:Ce}),y,p.jsxs(Pc,{initialConfig:le,children:[p.jsx(nf,{theme:C,disabled:o,onAiRestructure:d,onAiProofread:f,onAiRewrite:h,aiProcessing:N,aiProcessingAction:j,onAiAction:J,hasContent:ae}),p.jsx("div",{style:{position:"relative",flex:1,display:"flex",flexDirection:"column"},children:p.jsx(_d,{contentEditable:p.jsx(Dd,{className:"mail-editor-content",style:{outline:"none",flex:1,minHeight:"100px",padding:"16px",fontSize:"14px",lineHeight:1.6,color:C.text}}),placeholder:p.jsx("div",{className:"mail-editor-placeholder",children:t}),ErrorBoundary:Md})}),p.jsx(Qd,{}),p.jsx(ef,{}),p.jsx(Ld,{}),p.jsx(Pd,{onChange:te}),p.jsx(sf,{html:v?k:r,isExternalUpdate:v,onImportComplete:P}),p.jsx(of,{text:u,trigger:c})]}),n&&p.jsx(lf,{replyTo:n,theme:C})]})}const af={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6",inputBackground:"#ffffff",inputBorder:"#d1d5db",inputFocus:"#3b82f6",buttonPrimary:"#3b82f6",buttonPrimaryHover:"#2563eb",buttonSecondary:"#f3f4f6",buttonSecondaryHover:"#e5e7eb",attachmentBackground:"#f9fafb",attachmentBorder:"#e5e7eb"};function uf({to:r="",subject:e="",body:t="",replyTo:n,onSend:s,onCancel:o,onBodyChange:i,externalUpdate:l,insertText:a,insertTextTrigger:u,theme:c={},disabled:d=!1,showCcBcc:f=!1,placeholder:h="Write your message...",className:g="",minHeight:m="200px",sendButtonText:y="Send",hideCancelButton:C=!1,onAiRestructure:v,onAiProofread:E,onAiRewrite:w,renderAboveToolbar:k}){const x={...af,...c},[b,S]=D.useState(r),[A,z]=D.useState(""),[N,j]=D.useState(""),[P,R]=D.useState(e),[I,J]=D.useState(t),[ae,le]=D.useState([]),[te,Ce]=D.useState(!1),[ue,_e]=D.useState(""),[Ee,Pe]=D.useState(f),[Oe,de]=D.useState(!1),qe=D.useRef(void 0);D.useEffect(()=>{l!==void 0&&l!==qe.current&&(qe.current=l,J(t),de(!0))},[l,t]);const Me=V=>{J(V),de(!1),i==null||i(V)},ye=D.useRef(null),[je,ut]=D.useState(!1),Ot=V=>{const ge=V.target.files;if(ge){const fe=Array.from(ge);console.log("[MailComposer] Files selected:",fe.map(we=>({name:we.name,size:we.size,type:we.type}))),le(we=>[...we,...fe])}ye.current&&(ye.current.value="")},At=V=>{V.preventDefault(),V.stopPropagation(),ut(!0)},Mt=V=>{V.preventDefault(),V.stopPropagation(),ut(!1)},Ke=V=>{if(V.preventDefault(),V.stopPropagation(),ut(!1),V.dataTransfer.files&&V.dataTransfer.files.length>0){const ge=Array.from(V.dataTransfer.files);console.log("[MailComposer] Files dropped:",ge.map(fe=>({name:fe.name,size:fe.size,type:fe.type}))),le(fe=>[...fe,...ge])}else console.log("[MailComposer] Drop event but no files:",V.dataTransfer.types)},tt=V=>V.type.startsWith("image/")?"image":V.type==="application/pdf"?"picture_as_pdf":V.type.includes("spreadsheet")||V.type.includes("excel")?"table_chart":V.type.includes("document")||V.type.includes("word")?"description":"attach_file",It=V=>{le(ge=>ge.filter((fe,we)=>we!==V))},$t=V=>V<1024?`${V} B`:V<1024*1024?`${(V/1024).toFixed(1)} KB`:`${(V/(1024*1024)).toFixed(1)} MB`,yt=async()=>{if(!b.trim()){_e("Recipient email is required");return}if(!P.trim()){_e("Subject is required");return}Ce(!0),_e("");try{const V=await Promise.all(ae.map(async we=>{const U=await we.arrayBuffer(),T=btoa(new Uint8Array(U).reduce((Y,L)=>Y+String.fromCharCode(L),""));return{filename:we.name,content_type:we.type||"application/octet-stream",data:T,size:we.size}})),ge=I.replace(/>\n+</g,"><").replace(/<p class="[^"]*"><\/p>/g,"<br>").trim(),fe={to:b.trim(),cc:A.trim()||void 0,bcc:N.trim()||void 0,subject:P.trim(),html:ge,attachments:V,inReplyTo:n==null?void 0:n.messageId};console.log("[MailComposer] Sending email - to:",fe.to,"subject:",fe.subject,"attachmentsCount:",fe.attachments.length),fe.attachments.length>0&&fe.attachments.forEach((we,U)=>{var T;console.log(`[MailComposer] Attachment ${U+1}:`,we.filename,"size:",we.size,"type:",we.content_type,"data length:",((T=we.data)==null?void 0:T.length)||0)}),await s(fe),S(""),z(""),j(""),R(""),J(""),le([])}catch(V){_e(V instanceof Error?V.message:"Failed to send email")}finally{Ce(!1)}},xt={width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${x.inputBorder}`,borderRadius:"6px",background:x.inputBackground,color:x.text,outline:"none"},it={display:"block",fontSize:"12px",fontWeight:500,color:x.textSecondary,marginBottom:"4px",textTransform:"uppercase"},bt=(V,ge=!1)=>({padding:"10px 20px",fontSize:"14px",fontWeight:500,border:"none",borderRadius:"6px",cursor:ge?"not-allowed":"pointer",opacity:ge?.6:1,background:V?x.buttonPrimary:x.buttonSecondary,color:V?"#ffffff":x.text,display:"flex",alignItems:"center",gap:"8px"});return p.jsxs("div",{className:g,style:{display:"flex",flexDirection:"column",gap:"16px",padding:"16px",background:x.background},children:[ue&&p.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"6px",color:"#dc2626",fontSize:"14px"},children:ue}),p.jsxs("div",{children:[p.jsx("label",{style:it,children:"To"}),p.jsx("input",{type:"email",value:b,onChange:V=>S(V.target.value),placeholder:"recipient@example.com",disabled:d||te,style:xt})]}),!Ee&&p.jsx("button",{type:"button",onClick:()=>Pe(!0),disabled:d||te,style:{background:"none",border:"none",padding:0,fontSize:"12px",color:x.primary,cursor:"pointer",textAlign:"left"},children:"+ Add CC/BCC"}),Ee&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{style:it,children:"CC"}),p.jsx("input",{type:"email",value:A,onChange:V=>z(V.target.value),placeholder:"cc@example.com",disabled:d||te,style:xt})]}),p.jsxs("div",{children:[p.jsx("label",{style:it,children:"BCC"}),p.jsx("input",{type:"email",value:N,onChange:V=>j(V.target.value),placeholder:"bcc@example.com",disabled:d||te,style:xt})]})]}),p.jsxs("div",{children:[p.jsx("label",{style:it,children:"Subject"}),p.jsx("input",{type:"text",value:P,onChange:V=>R(V.target.value),placeholder:"Email subject",disabled:d||te,style:xt})]}),p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:p.jsx(Na,{value:I,onChange:Me,placeholder:h,replyTo:n,theme:x,disabled:d||te,minHeight:m,externalUpdate:Oe?l:void 0,insertText:a,insertTextTrigger:u,onAiRestructure:v,onAiProofread:E,onAiRewrite:w,renderAboveToolbar:k})})}),p.jsxs("div",{children:[p.jsx("label",{style:{...it,marginBottom:"8px"},children:"Attachments"}),p.jsx("input",{ref:ye,type:"file",multiple:!0,onChange:Ot,style:{display:"none"}}),p.jsxs("div",{onClick:()=>{var V;return(V=ye.current)==null?void 0:V.click()},onDragOver:At,onDragLeave:Mt,onDrop:Ke,style:{width:"100%",padding:"24px 16px",border:`2px dashed ${je?x.primary:x.border}`,borderRadius:"8px",background:je?`${x.primary}10`:"transparent",color:je?x.primary:x.textSecondary,cursor:d||te?"not-allowed":"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",marginBottom:ae.length>0?"12px":0},children:[p.jsx("span",{className:"material-icons",style:{fontSize:"24px"},children:je?"file_download":"attach_file"}),p.jsx("span",{style:{fontSize:"14px"},children:je?"Drop files here":"Drop files or click to add"})]}),ae.length>0&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:ae.map((V,ge)=>p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:x.attachmentBackground,borderRadius:"8px"},children:[p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:x.textSecondary},children:tt(V)}),p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:x.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:V.name}),p.jsx("div",{style:{fontSize:"12px",color:x.textSecondary},children:$t(V.size)})]}),p.jsx("button",{type:"button",onClick:()=>It(ge),disabled:d||te,style:{background:"none",border:"none",padding:"4px",cursor:"pointer",color:x.textSecondary,display:"flex",borderRadius:"4px"},children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px"},children:"close"})})]},`${V.name}-${ge}`))})]}),p.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px"},children:[!C&&o&&p.jsx("button",{type:"button",onClick:o,disabled:d||te,style:bt(!1,d||te),children:"Cancel"}),p.jsxs("button",{type:"button",onClick:yt,disabled:d||te||!b.trim()||!P.trim(),style:bt(!0,d||te||!b.trim()||!P.trim()),children:[p.jsx("span",{className:"material-icons",style:{fontSize:"18px",animation:te?"spin 1s linear infinite":"none"},children:te?"sync":"send"}),te?"Sending...":y]})]}),p.jsx("style",{children:`
|
|
149
149
|
@keyframes spin {
|
|
150
150
|
from { transform: rotate(0deg); }
|
|
151
151
|
to { transform: rotate(360deg); }
|
|
152
152
|
}
|
|
153
|
-
`})]})}const cf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",chipBackground:"#f3f4f6",chipText:"#374151",hoverBackground:"#f9fafb"};function df({options:r,value:e,onChange:t,placeholder:n="Search or select...",allowCreate:s=!0,onCreate:o,allowDelete:i=!1,onDelete:l,label:a,disabled:u=!1,max:c=0,theme:d={},className:f=""}){const h={...cf,...d},[g,m]=D.useState(!1),[y,w]=D.useState(""),x=D.useRef(null),E=D.useRef(null);D.useEffect(()=>{function N(j){x.current&&!x.current.contains(j.target)&&(m(!1),w(""))}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const C=r.filter(N=>{var j;return((j=N.label)==null?void 0:j.toLowerCase().includes(y.toLowerCase()))&&!e.includes(N.id)}),k=s&&y.trim()&&!r.some(N=>{var j;return((j=N.label)==null?void 0:j.toLowerCase())===y.toLowerCase()}),v=e.map(N=>r.find(j=>j.id===N)).filter(Boolean),b=D.useCallback(N=>{var j;c>0&&e.length>=c||(t([...e,N]),w(""),(j=E.current)==null||j.focus())},[e,t,c]),S=D.useCallback(N=>{t(e.filter(j=>j!==N))},[e,t]),T=D.useCallback(async()=>{if(!k)return;const N=await(o==null?void 0:o(y.trim()));N&&b(N.id),w("")},[k,y,o,b]),$=D.useCallback(N=>{N.key==="Enter"?(N.preventDefault(),k?T():C.length>0&&b(C[0].id)):N.key==="Backspace"&&!y&&e.length>0?S(e[e.length-1]):N.key==="Escape"&&(m(!1),w(""))},[k,C,y,e,T,b,S]);return p.jsxs("div",{ref:x,className:f,style:{position:"relative"},children:[a&&p.jsx("label",{style:{display:"block",fontSize:"12px",textTransform:"uppercase",color:h.textSecondary,marginBottom:"4px"},children:a}),p.jsxs("div",{onClick:()=>!u&&m(!0),style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 12px",border:`1px solid ${g?h.primary:h.border}`,borderRadius:"8px",background:u?h.hoverBackground:h.background,cursor:u?"not-allowed":"text",minHeight:"42px",alignItems:"center"},children:[v.map(N=>p.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",fontSize:"13px",background:N.color||h.chipBackground,color:N.color?"#fff":h.chipText},children:[N.label,!u&&p.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),S(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"0 2px",fontSize:"14px",color:"inherit",opacity:.7},children:"×"})]},N.id)),p.jsx("input",{ref:E,type:"text",value:y,onChange:N=>{w(N.target.value),g||m(!0)},onFocus:()=>m(!0),onKeyDown:$,placeholder:v.length===0?n:"",disabled:u||c>0&&e.length>=c,style:{flex:1,minWidth:"60px",border:"none",outline:"none",fontSize:"14px",background:"transparent",color:h.text}})]}),g&&!u&&p.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:h.background,border:`1px solid ${h.border}`,borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto",zIndex:50},children:C.length===0&&!k?p.jsx("div",{style:{padding:"12px",fontSize:"14px",color:h.textSecondary,textAlign:"center"},children:y?"No matches":"No options available"}):p.jsxs(p.Fragment,{children:[C.map(N=>p.jsxs("div",{onClick:()=>b(N.id),style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.text,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseEnter:j=>{j.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:j=>{j.currentTarget.style.background=""},children:[N.label,i&&l&&p.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),l(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",fontSize:"14px",color:h.textSecondary,opacity:.5},onMouseEnter:j=>{j.currentTarget.style.opacity="1",j.currentTarget.style.color="#ef4444"},onMouseLeave:j=>{j.currentTarget.style.opacity="0.5",j.currentTarget.style.color=h.textSecondary||""},children:"×"})]},N.id)),k&&p.jsxs("div",{onClick:T,style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.primary,borderTop:C.length>0?`1px solid ${h.border}`:"none"},onMouseEnter:N=>{N.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:N=>{N.currentTarget.style.background=""},children:['+ Create "',y.trim(),'"']})]})})]})}function ff({items:r,columns:e,getItemId:t,getItemColumn:n,getItemOrder:s,renderItem:o,onItemMove:i,onItemReorder:l,onItemClick:a,renderColumnHeader:u,renderColumnFooter:c,className:d="",columnClassName:f="",itemClassName:h=""}){const[g,m]=D.useState(null),[y,w]=D.useState(null),[x,E]=D.useState(null),C=D.useRef(null),k=e.reduce((j,R)=>{let L=r.filter(M=>n(M)===R.id);return s&&(L=L.sort((M,X)=>s(M)-s(X))),j[R.id]=L,j},{}),v=D.useCallback((j,R)=>{const L=t(R),M=n(R);m(L),C.current=M,j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/plain",L),requestAnimationFrame(()=>{const X=j.target;X.style.opacity="0.5"})},[t,n]),b=D.useCallback(j=>{const R=j.target;R.style.opacity="1",m(null),w(null),E(null),C.current=null},[]),S=D.useCallback((j,R,L)=>{j.preventDefault(),j.dataTransfer.dropEffect="move",w(R),E(L)},[]),T=D.useCallback(j=>{const R=j.relatedTarget;R!=null&&R.closest("[data-kanban-column]")||(w(null),E(null))},[]),$=D.useCallback((j,R,L)=>{if(j.preventDefault(),!g)return;const M=C.current;M===R?l==null||l(g,R,L):M&&i(g,M,R,L),m(null),w(null),E(null),C.current=null},[g,i,l]),N=(j,R)=>p.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[j.color&&p.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:j.color}}),p.jsx("span",{className:"font-medium text-sm text-neutral-700",children:j.label})]}),p.jsx("span",{className:"text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full",children:R})]});return p.jsx("div",{className:`flex gap-4 overflow-x-auto pb-4 ${d}`,style:{minHeight:"400px"},children:e.map(j=>{const R=k[j.id]||[],L=y===j.id;return p.jsxs("div",{"data-kanban-column":j.id,className:`flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,onDragOver:M=>{M.preventDefault(),g&&!L&&w(j.id)},onDragLeave:T,onDrop:M=>$(M,j.id,x??R.length),children:[p.jsx("div",{className:"flex-shrink-0 border-b border-neutral-200",children:u?u(j,R.length):N(j,R.length)}),p.jsxs("div",{className:`flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${L?"bg-blue-50":""}`,children:[R.map((M,X)=>{const ce=t(M),se=g===ce,ie=L&&x===X&&!se;return p.jsxs("div",{children:[ie&&p.jsx("div",{className:"h-1 bg-blue-500 rounded-full mb-2 mx-1"}),p.jsx("div",{draggable:!0,onDragStart:be=>v(be,M),onDragEnd:b,onDragOver:be=>S(be,j.id,X),onClick:()=>a==null?void 0:a(M),className:`cursor-grab active:cursor-grabbing transition-all ${se?"opacity-50 scale-95":""} ${h}`,children:o(M,se)})]},ce)}),p.jsx("div",{className:"min-h-[40px] flex-1",onDragOver:M=>{M.preventDefault(),S(M,j.id,R.length)},children:L&&x===R.length&&p.jsx("div",{className:"h-1 bg-blue-500 rounded-full mx-1 mt-1"})}),R.length===0&&L&&p.jsx("div",{className:"h-20 border-2 border-dashed border-blue-300 rounded-lg bg-blue-50/50 flex items-center justify-center",children:p.jsx("span",{className:"text-sm text-blue-400",children:"Drop here"})})]}),c&&p.jsx("div",{className:"flex-shrink-0 border-t border-neutral-200 p-2",children:c(j)})]},j.id)})})}const hf={background:"#ffffff",hourLineColor:"#e5e7eb",halfHourLineColor:"#f3f4f6",hourTextColor:"#9ca3af",currentTimeColor:"#ef4444",allDayBackground:"#f9fafb",allDayBorder:"#e5e7eb"};function pf(r){const e=r.match(/^(\d{1,2}):(\d{2})$/);return e?{hours:parseInt(e[1],10),minutes:parseInt(e[2],10)}:null}function gf(r){const e=r%12||12,t=r<12?"AM":"PM";return`${e} ${t}`}function mf(r){const e=new Date;return r.getDate()===e.getDate()&&r.getMonth()===e.getMonth()&&r.getFullYear()===e.getFullYear()}function yf({items:r,date:e,startHour:t=7,endHour:n=22,hourHeight:s=60,getItemTime:o,getItemDuration:i,getItemIsAllDay:l,getItemId:a,renderItem:u,onItemClick:c,onTimeSlotClick:d,showCurrentTime:f=!0,className:h="",theme:g={}}){const m={...hf,...g},{allDayItems:y,timedItems:w}=D.useMemo(()=>{const b=[],S=[];for(const T of r)l(T)?b.push(T):S.push(T);return{allDayItems:b,timedItems:S}},[r,l]),x=D.useMemo(()=>{const b=[];for(let S=t;S<=n;S++)b.push(S);return b},[t,n]),E=(n-t+1)*s,C=D.useCallback(b=>{const S=o(b);if(!S)return null;const T=pf(S);if(!T)return null;const{hours:$,minutes:N}=T,j=Math.max(t,Math.min(n,$)),R=$<t?0:N,L=(j-t)*s+R/60*s,M=i(b),X=Math.max(20,M/60*s);return{top:L,height:X}},[o,i,t,n,s]),k=D.useMemo(()=>{if(!f||!mf(e))return null;const b=new Date,S=b.getHours(),T=b.getMinutes();return S<t||S>n?null:(S-t)*s+T/60*s},[e,f,t,n,s]),v=D.useCallback(b=>{if(!d)return;const S=b.currentTarget.getBoundingClientRect(),$=(b.clientY-S.top)/s*60,N=Math.floor($/60)+t,j=Math.round($%60/15)*15,R=Math.min(n,Math.max(t,N)),L=j>=60?0:j,M=`${R.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;d(M)},[d,s,t,n]);return p.jsxs("div",{className:h,style:{background:m.background},children:[y.length>0&&p.jsxs("div",{style:{padding:"8px 0 8px 60px",borderBottom:`1px solid ${m.allDayBorder}`,background:m.allDayBackground},children:[p.jsx("div",{style:{fontSize:"11px",color:m.hourTextColor,marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"All Day"}),p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:y.map(b=>p.jsx("div",{onClick:()=>c==null?void 0:c(b),style:{cursor:c?"pointer":"default"},children:u(b)},a(b)))})]}),p.jsxs("div",{style:{position:"relative",height:E},children:[x.map((b,S)=>p.jsxs("div",{style:{position:"absolute",top:S*s,left:0,right:0},children:[p.jsx("div",{style:{position:"absolute",left:0,top:-8,width:"50px",textAlign:"right",paddingRight:"10px",fontSize:"11px",color:m.hourTextColor},children:gf(b)}),p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,height:"1px",background:m.hourLineColor}}),S<x.length-1&&p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:s/2,height:"1px",background:m.halfHourLineColor}})]},b)),p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,bottom:0,cursor:d?"pointer":"default"},onClick:v}),k!==null&&p.jsxs("div",{style:{position:"absolute",left:"55px",right:0,top:k,zIndex:20,pointerEvents:"none"},children:[p.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:m.currentTimeColor,marginLeft:"-5px",marginTop:"-5px",position:"absolute"}}),p.jsx("div",{style:{marginLeft:"5px",height:"2px",background:m.currentTimeColor}})]}),w.map(b=>{const S=C(b);return S?p.jsx("div",{style:{position:"absolute",left:"64px",right:"8px",top:S.top,height:S.height,zIndex:10,cursor:c?"pointer":"default"},onClick:T=>{T.stopPropagation(),c==null||c(b)},children:u(b)},a(b)):null})]})]})}function xf({onComplete:r,onCancel:e,onTranscribe:t,transcribing:n,variant:s="widget",hideSaveButton:o=!1}){const i=s==="widget",[l,a]=D.useState("idle"),[u,c]=D.useState(0),[d,f]=D.useState(0),[h,g]=D.useState(!1),[m,y]=D.useState(0),[w,x]=D.useState(null),[E,C]=D.useState(!1),[k,v]=D.useState(null),b=D.useRef(null),S=D.useRef(null),T=D.useRef(null),$=D.useRef(null),N=D.useRef(null),j=D.useRef([]),R=D.useRef(null),L=D.useRef(null),M=D.useRef(null),X=D.useRef(null),ce=D.useRef(!1),se=D.useRef([]),ie=D.useRef(null),be=D.useRef(null),he=D.useRef([]),_e=D.useRef([]),Se=D.useRef("insert"),Re=D.useRef(!1),Ee=D.useRef(0),ve=D.useRef(0),Ue=D.useRef(0),Ie=O=>{const B=Math.floor(O/60),Q=Math.floor(O%60);return`${B.toString().padStart(2,"0")}:${Q.toString().padStart(2,"0")}`},pe=async O=>{const B=await O.arrayBuffer(),Q=new AudioContext,J=await Q.decodeAudioData(B);return await Q.close(),J},Pe=O=>{const B=O.numberOfChannels,Q=O.sampleRate,J=1,A=16,z=A/8,H=B*z,Y=Q*H,ee=O.length*H,le=new ArrayBuffer(44+ee),re=new DataView(le),te=(ye,de)=>{for(let $e=0;$e<de.length;$e++)re.setUint8(ye+$e,de.charCodeAt($e))};te(0,"RIFF"),re.setUint32(4,36+ee,!0),te(8,"WAVE"),te(12,"fmt "),re.setUint32(16,16,!0),re.setUint16(20,J,!0),re.setUint16(22,B,!0),re.setUint32(24,Q,!0),re.setUint32(28,Y,!0),re.setUint16(32,H,!0),re.setUint16(34,A,!0),te(36,"data"),re.setUint32(40,ee,!0);const we=[];for(let ye=0;ye<B;ye++)we.push(O.getChannelData(ye));let Be=44;for(let ye=0;ye<O.length;ye++)for(let de=0;de<B;de++){const $e=Math.max(-1,Math.min(1,we[de][ye])),ze=$e<0?$e*32768:$e*32767;re.setInt16(Be,ze,!0),Be+=2}return new Blob([le],{type:"audio/wav"})},ot=async(O,B,Q,J)=>{const A=new AudioContext,z=O.sampleRate,H=Math.max(O.numberOfChannels,B.numberOfChannels),Y=Math.min(Q,O.length),ee=Math.max(0,O.length-Q),le=J==="insert"?Y+B.length+ee:Y+B.length,re=A.createBuffer(H,le,z);for(let te=0;te<H;te++){const we=re.getChannelData(te),Be=te<O.numberOfChannels?O.getChannelData(te):O.getChannelData(0);for(let de=0;de<Y;de++)we[de]=Be[de];const ye=te<B.numberOfChannels?B.getChannelData(te):B.getChannelData(0);for(let de=0;de<B.length;de++)we[Y+de]=ye[de];if(J==="insert")for(let de=0;de<ee;de++)we[Y+B.length+de]=Be[Q+de]}return await A.close(),re},xt=D.useCallback(()=>{const O=b.current;if(!O)return;const B=O.getContext("2d");if(!B)return;const Q=O.getBoundingClientRect(),J=Q.width,A=Q.height,z=se.current,H=d||u||1,Y=l==="recording"?u:m;B.fillStyle="#2d3b35",B.fillRect(0,0,J,A);const ee=8,le="rgba(0, 0, 0, 0.4)",re=B.createLinearGradient(0,0,0,ee);re.addColorStop(0,le),re.addColorStop(1,"transparent"),B.fillStyle=re,B.fillRect(0,0,J,ee);const te=B.createLinearGradient(0,A-ee,0,A);te.addColorStop(0,"transparent"),te.addColorStop(1,le),B.fillStyle=te,B.fillRect(0,A-ee,J,ee);const we=B.createLinearGradient(0,0,ee,0);we.addColorStop(0,le),we.addColorStop(1,"transparent"),B.fillStyle=we,B.fillRect(0,0,ee,A);const Be=B.createLinearGradient(J-ee,0,J,0);Be.addColorStop(0,"transparent"),Be.addColorStop(1,le),B.fillStyle=Be,B.fillRect(J-ee,0,ee,A),B.strokeStyle="#5a6b62",B.lineWidth=1,B.beginPath(),B.moveTo(0,A/2),B.lineTo(J,A/2),B.stroke();const ye=J/2;if(z.length>0)if(l==="recording")for(let ze=0;ze<z.length;ze++){const nt=z.length-1-ze,vt=ye-nt*4;if(vt<-3||vt>J)continue;const ct=z[ze]*(A/2-12),Bt=A/2-ct;B.fillStyle="#10b981",B.fillRect(vt,Bt,3,ct*2)}else{const ze=H>0?Y/H*z.length:0;for(let nt=0;nt<z.length;nt++){const vt=ze-nt,ct=ye-vt*4;if(ct<-3||ct>J)continue;const Bt=z[nt]*(A/2-12),fr=A/2-Bt;B.fillStyle=nt<=ze?"#10b981":"#4b5563",B.fillRect(ct,fr,3,Bt*2)}}B.strokeStyle="#ef4444",B.lineWidth=1,B.beginPath(),B.moveTo(ye,0),B.lineTo(ye,A),B.stroke(),B.fillStyle="#fff",B.font="bold 18px monospace",B.textAlign="center",B.fillText(Ie(Y),ye,A-6),l==="recording"&&(B.fillStyle="#ef4444",B.beginPath(),B.arc(20,20,8,0,Math.PI*2),B.fill(),B.fillStyle="#fff",B.font="10px sans-serif",B.textAlign="left",B.fillText("REC",34,24)),B.textAlign="left"},[l,m,u,d]),Ot=()=>{const O=N.current;if(!O||!ce.current)return;const B=O.frequencyBinCount,Q=new Uint8Array(B);O.getByteTimeDomainData(Q);let J=0;for(let H=0;H<B;H++){const Y=(Q[H]-128)/128;J+=Y*Y}const A=Math.sqrt(J/B),z=Math.min(1,A*3);se.current.push(z),xt(),ce.current&&(L.current=requestAnimationFrame(Ot))},tt=async()=>{try{x(null),C(!1),ie.current===null&&(se.current=[]);const O=await navigator.mediaDevices.getUserMedia({audio:!0});T.current=O;const B=new AudioContext;$.current=B;const Q=B.createAnalyser();Q.fftSize=2048,N.current=Q,B.createMediaStreamSource(O).connect(Q);const A=new MediaRecorder(O);S.current=A,j.current=[],A.ondataavailable=z=>{z.data.size>0&&j.current.push(z.data)},A.onstop=async()=>{try{if(ce.current=!1,j.current.length===0){x("No audio was recorded. Please try again."),a("idle"),O.getTracks().forEach(re=>re.stop());return}const z=new Blob(j.current,{type:"audio/webm"});let H,Y;if(ie.current!==null&&be.current)try{const re=await pe(z),te=be.current.sampleRate,we=Math.floor(ie.current*te),Be=await ot(be.current,re,we,Se.current);H=Pe(Be),Y=Be.length/Be.sampleRate,Se.current==="insert"&&(se.current=[...se.current,..._e.current]),ie.current=null,be.current=null,he.current=[],_e.current=[]}catch{H=z,Y=Ee.current>0?Ee.current:1}else H=z,Y=Ee.current>0?Ee.current:1;X.current=H;const ee=URL.createObjectURL(H),le=new Audio(ee);le.ontimeupdate=()=>{y(le.currentTime)},le.onended=()=>{g(!1)},M.current=le,f(Y),y(Y),a("editing"),O.getTracks().forEach(re=>re.stop())}catch{x("Failed to process recording"),a("idle")}},A.start(100),ce.current=!0,a("recording"),c(0),Ee.current=0,R.current=setInterval(()=>{Ee.current+=1,c(Ee.current)},1e3)}catch{x("Could not access microphone. Please allow microphone access.")}},rt=()=>{ce.current=!1,C(!1),v(null),L.current&&(cancelAnimationFrame(L.current),L.current=null),R.current&&(clearInterval(R.current),R.current=null),S.current&&S.current.state!=="inactive"&&S.current.stop()},lt=O=>{const B=b.current;if(!B)return;const Q=d||u;if(Q<=0)return;const J=se.current;if(J.length===0)return;const A=B.getBoundingClientRect(),z=O-ve.current,H=4,Y=A.width/B.width,ee=J.length/Q*H,le=-z/(ee*Y),re=Ue.current+le,te=Math.max(0,Math.min(re,Q));M.current&&(M.current.currentTime=te),y(te)},Mt=()=>{M.current&&(M.current.currentTime=0),y(0)},It=()=>{const O=d||u;M.current&&(M.current.currentTime=O),y(O)},bt=()=>{const O=M.current;O&&(h?(O.pause(),y(O.currentTime),g(!1)):(O.currentTime=m,O.play().catch(()=>{}),g(!0)))},at=async O=>{if(!X.current){tt();return}try{M.current&&(M.current.pause(),g(!1)),Se.current=O,be.current=await pe(X.current);const B=d||u;ie.current=m;const Q=B>0?m/B:0,J=Math.floor(Q*se.current.length);he.current=se.current.slice(0,J),_e.current=se.current.slice(J),se.current=[...he.current],tt()}catch{x("Failed to prepare recording. Please try again.")}},ut=()=>{M.current&&(M.current.pause(),M.current=null),X.current=null,be.current=null,ie.current=null,he.current=[],g(!1),y(0),f(0),c(0),tt()},_t=()=>{X.current?r(X.current,d||u):alert("No audio recorded yet!")};if(D.useEffect(()=>{l==="recording"&&b.current&&N.current&&ce.current&&(L.current=requestAnimationFrame(Ot))},[l]),D.useEffect(()=>{const O=b.current;if(!O)return;const B=()=>{const Q=window.devicePixelRatio||1,J=O.getBoundingClientRect();O.width=J.width*Q,O.height=J.height*Q;const A=O.getContext("2d");A&&A.scale(Q,Q)};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]),D.useEffect(()=>{if(l==="idle"){const O=b.current;if(!O)return;const B=O.getContext("2d");if(!B)return;const Q=O.getBoundingClientRect(),J=Q.width,A=Q.height;B.fillStyle="#2d3b35",B.fillRect(0,0,J,A);const z=8,H="rgba(0, 0, 0, 0.4)",Y=B.createLinearGradient(0,0,0,z);Y.addColorStop(0,H),Y.addColorStop(1,"transparent"),B.fillStyle=Y,B.fillRect(0,0,J,z);const ee=B.createLinearGradient(0,A-z,0,A);ee.addColorStop(0,"transparent"),ee.addColorStop(1,H),B.fillStyle=ee,B.fillRect(0,A-z,J,z);const le=B.createLinearGradient(0,0,z,0);le.addColorStop(0,H),le.addColorStop(1,"transparent"),B.fillStyle=le,B.fillRect(0,0,z,A);const re=B.createLinearGradient(J-z,0,J,0);re.addColorStop(0,"transparent"),re.addColorStop(1,H),B.fillStyle=re,B.fillRect(J-z,0,z,A),B.strokeStyle="#5a6b62",B.lineWidth=1,B.beginPath(),B.moveTo(0,A/2),B.lineTo(J,A/2),B.stroke();const te=J/2;B.strokeStyle="#ef4444",B.lineWidth=1,B.beginPath(),B.moveTo(te,0),B.lineTo(te,A),B.stroke(),B.fillStyle="#fff",B.font="bold 18px monospace",B.textAlign="center",B.fillText("00:00",te,A-6)}},[l]),D.useEffect(()=>()=>{ce.current=!1,R.current&&clearInterval(R.current),L.current&&cancelAnimationFrame(L.current),T.current&&T.current.getTracks().forEach(O=>O.stop()),$.current&&$.current.state!=="closed"&&$.current.close()},[]),D.useEffect(()=>{if(l==="editing"&&h){let O;const B=()=>{const Q=M.current;if(Q&&h){const J=b.current;if(J){const A=J.getContext("2d");if(A){const z=J.getBoundingClientRect(),H=z.width,Y=z.height,ee=se.current,le=d||u||1,re=Q.currentTime;A.fillStyle="#2d3b35",A.fillRect(0,0,H,Y);const te=8,we="rgba(0, 0, 0, 0.4)",Be=A.createLinearGradient(0,0,0,te);Be.addColorStop(0,we),Be.addColorStop(1,"transparent"),A.fillStyle=Be,A.fillRect(0,0,H,te);const ye=A.createLinearGradient(0,Y-te,0,Y);ye.addColorStop(0,"transparent"),ye.addColorStop(1,we),A.fillStyle=ye,A.fillRect(0,Y-te,H,te);const de=A.createLinearGradient(0,0,te,0);de.addColorStop(0,we),de.addColorStop(1,"transparent"),A.fillStyle=de,A.fillRect(0,0,te,Y);const $e=A.createLinearGradient(H-te,0,H,0);$e.addColorStop(0,"transparent"),$e.addColorStop(1,we),A.fillStyle=$e,A.fillRect(H-te,0,te,Y),A.strokeStyle="#5a6b62",A.lineWidth=1,A.beginPath(),A.moveTo(0,Y/2),A.lineTo(H,Y/2),A.stroke();const ze=H/2,nt=3,vt=4,ct=le>0?re/le*ee.length:0;for(let Qt=0;Qt<ee.length;Qt++){const ys=ct-Qt,hr=ze-ys*vt;if(hr<-nt||hr>H)continue;const Fr=ee[Qt]*(Y/2-12),xs=Y/2-Fr;A.fillStyle=Qt<=ct?"#10b981":"#4b5563",A.fillRect(hr,xs,nt,Fr*2)}A.strokeStyle="#ef4444",A.lineWidth=1,A.beginPath(),A.moveTo(ze,0),A.lineTo(ze,Y),A.stroke(),A.fillStyle="#fff",A.font="bold 18px monospace",A.textAlign="center";const Bt=Math.floor(re/60),fr=Math.floor(re%60);A.fillText(`${Bt.toString().padStart(2,"0")}:${fr.toString().padStart(2,"0")}`,ze,Y-6),A.textAlign="left"}}O=requestAnimationFrame(B)}};return O=requestAnimationFrame(B),()=>cancelAnimationFrame(O)}},[l,h,d,u]),D.useEffect(()=>{l==="editing"&&!h&&xt()},[l,m,h,xt]),w)return p.jsxs("div",{style:{border:"1px solid #fecaca",borderRadius:"12px",padding:"16px",background:"#fef2f2"},children:[p.jsx("p",{style:{fontSize:"14px",color:"#dc2626",marginBottom:"12px"},children:w}),p.jsx("button",{onClick:()=>{x(null),tt()},style:{padding:"8px 16px",fontSize:"14px",background:"#171717",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},children:"Try Again"})]});const W={padding:"8px",borderRadius:"8px",border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s"},me={...W,opacity:.3,cursor:"not-allowed"},Ce=i?{border:"1px solid #e5e5e5",borderRadius:"12px",overflow:"hidden",background:"white"}:{overflow:"hidden",background:"white",flexShrink:0};return p.jsxs("div",{style:Ce,children:[p.jsx("canvas",{ref:b,style:{width:"100%",height:"32px",cursor:"pointer",flexShrink:0},onMouseDown:O=>{if(l==="editing"){Re.current=!0,ve.current=O.clientX,Ue.current=m;const B=J=>{Re.current&<(J.clientX)},Q=()=>{Re.current=!1,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",Q)};window.addEventListener("mousemove",B),window.addEventListener("mouseup",Q)}}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:i?"6px 8px":"4px",borderTop:"1px solid #d4d4d4",background:"linear-gradient(to bottom, #e0e0e0 0%, #c8c8c8 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(0,0,0,0.1)",flexShrink:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[p.jsx("button",{onClick:Mt,disabled:l==="idle"||l==="recording",style:l==="idle"||l==="recording"?me:W,title:"Go to start",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"first_page"})}),p.jsx("button",{onClick:()=>{if(l==="recording"){const O=S.current;O&&(O.state==="recording"?(O.pause(),C(!0)):O.state==="paused"&&(O.resume(),C(!1)))}else bt()},disabled:l==="idle",style:l==="idle"?me:W,title:h||l==="recording"&&!E?"Pause":"Play",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:h||l==="recording"&&!E?"pause":"play_arrow"})}),p.jsx("button",{onClick:It,disabled:l==="idle"||l==="recording",style:l==="idle"||l==="recording"?me:W,title:"Go to end",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"last_page"})}),p.jsx("div",{style:{width:"1px",height:"24px",margin:"0 4px",background:"linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(0,0,0,0.15))"}}),p.jsx("button",{onClick:()=>{k==="insert"?rt():l==="idle"?(v("insert"),tt()):l==="editing"&&(v("insert"),at("insert"))},disabled:l==="recording"&&k!=="insert"||h,style:l==="recording"&&k!=="insert"||h?me:W,title:k==="insert"?"Stop recording":"Insert recording",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:k==="insert"?"#ef4444":"#171717"},children:"add"})}),p.jsx("button",{onClick:()=>{k==="mic"?rt():l==="idle"?(v("mic"),tt()):l==="editing"&&(v("mic"),at("replace"))},disabled:l==="recording"&&k!=="mic"||h,style:l==="recording"&&k!=="mic"||h?me:W,title:k==="mic"?"Stop recording":"Record",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:k==="mic"?"#ef4444":"#171717"},children:"mic"})}),p.jsx("button",{onClick:()=>{k==="startover"?rt():l==="editing"&&(v("startover"),ut())},disabled:l==="idle"||l==="recording"&&k!=="startover"||h,style:l==="idle"||l==="recording"&&k!=="startover"||h?me:W,title:k==="startover"?"Stop recording":"Start over",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:k==="startover"?"#ef4444":"#171717"},children:"refresh"})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t&&p.jsx("button",{onClick:()=>X.current&&t(X.current),disabled:l!=="editing"||n,style:l!=="editing"||n?me:W,title:n?"Transcribing...":"Transcribe audio",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:n?"hourglass_empty":"subtitles"})}),!o&&p.jsx("button",{onClick:_t,disabled:l!=="editing",style:l!=="editing"?me:W,title:"Save recording",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"save"})})]})]})]})}exports.AnimatedCardFlip=hu;exports.ApiClient=al;exports.AudioEditor=xf;exports.AuthManager=ll;exports.Card=cu;exports.ComboBox=df;exports.DataOperations=Bn;exports.Detail=du;exports.GraphClient=Ia;exports.KanbanBoard=ff;exports.Mail=gu;exports.MailClient=ol;exports.MailComposer=uf;exports.MailEditor=Ba;exports.SelectableList=mu;exports.Stack=uu;exports.Timeline=yf;exports.getApiClient=oi;exports.initializeApiClient=iu;exports.useMutation=ou;exports.useQuery=ul;
|
|
153
|
+
`})]})}const cf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",chipBackground:"#f3f4f6",chipText:"#374151",hoverBackground:"#f9fafb"};function df({options:r,value:e,onChange:t,placeholder:n="Search or select...",allowCreate:s=!0,onCreate:o,allowDelete:i=!1,onDelete:l,label:a,disabled:u=!1,max:c=0,theme:d={},className:f=""}){const h={...cf,...d},[g,m]=D.useState(!1),[y,C]=D.useState(""),v=D.useRef(null),E=D.useRef(null);D.useEffect(()=>{function N(j){v.current&&!v.current.contains(j.target)&&(m(!1),C(""))}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const w=r.filter(N=>{var j;return((j=N.label)==null?void 0:j.toLowerCase().includes(y.toLowerCase()))&&!e.includes(N.id)}),k=s&&y.trim()&&!r.some(N=>{var j;return((j=N.label)==null?void 0:j.toLowerCase())===y.toLowerCase()}),x=e.map(N=>r.find(j=>j.id===N)).filter(Boolean),b=D.useCallback(N=>{var j;c>0&&e.length>=c||(t([...e,N]),C(""),(j=E.current)==null||j.focus())},[e,t,c]),S=D.useCallback(N=>{t(e.filter(j=>j!==N))},[e,t]),A=D.useCallback(async()=>{if(!k)return;const N=await(o==null?void 0:o(y.trim()));N&&b(N.id),C("")},[k,y,o,b]),z=D.useCallback(N=>{N.key==="Enter"?(N.preventDefault(),k?A():w.length>0&&b(w[0].id)):N.key==="Backspace"&&!y&&e.length>0?S(e[e.length-1]):N.key==="Escape"&&(m(!1),C(""))},[k,w,y,e,A,b,S]);return p.jsxs("div",{ref:v,className:f,style:{position:"relative"},children:[a&&p.jsx("label",{style:{display:"block",fontSize:"12px",textTransform:"uppercase",color:h.textSecondary,marginBottom:"4px"},children:a}),p.jsxs("div",{onClick:()=>!u&&m(!0),style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 12px",border:`1px solid ${g?h.primary:h.border}`,borderRadius:"8px",background:u?h.hoverBackground:h.background,cursor:u?"not-allowed":"text",minHeight:"42px",alignItems:"center"},children:[x.map(N=>p.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",fontSize:"13px",background:N.color||h.chipBackground,color:N.color?"#fff":h.chipText},children:[N.label,!u&&p.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),S(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"0 2px",fontSize:"14px",color:"inherit",opacity:.7},children:"×"})]},N.id)),p.jsx("input",{ref:E,type:"text",value:y,onChange:N=>{C(N.target.value),g||m(!0)},onFocus:()=>m(!0),onKeyDown:z,placeholder:x.length===0?n:"",disabled:u||c>0&&e.length>=c,style:{flex:1,minWidth:"60px",border:"none",outline:"none",fontSize:"14px",background:"transparent",color:h.text}})]}),g&&!u&&p.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:h.background,border:`1px solid ${h.border}`,borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto",zIndex:50},children:w.length===0&&!k?p.jsx("div",{style:{padding:"12px",fontSize:"14px",color:h.textSecondary,textAlign:"center"},children:y?"No matches":"No options available"}):p.jsxs(p.Fragment,{children:[w.map(N=>p.jsxs("div",{onClick:()=>b(N.id),style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.text,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseEnter:j=>{j.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:j=>{j.currentTarget.style.background=""},children:[N.label,i&&l&&p.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),l(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",fontSize:"14px",color:h.textSecondary,opacity:.5},onMouseEnter:j=>{j.currentTarget.style.opacity="1",j.currentTarget.style.color="#ef4444"},onMouseLeave:j=>{j.currentTarget.style.opacity="0.5",j.currentTarget.style.color=h.textSecondary||""},children:"×"})]},N.id)),k&&p.jsxs("div",{onClick:A,style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.primary,borderTop:w.length>0?`1px solid ${h.border}`:"none"},onMouseEnter:N=>{N.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:N=>{N.currentTarget.style.background=""},children:['+ Create "',y.trim(),'"']})]})})]})}function ff({items:r,columns:e,getItemId:t,getItemColumn:n,getItemOrder:s,renderItem:o,onItemMove:i,onItemReorder:l,onItemClick:a,renderColumnHeader:u,renderColumnFooter:c,className:d="",columnClassName:f="",itemClassName:h=""}){const[g,m]=D.useState(null),[y,C]=D.useState(null),[v,E]=D.useState(null),w=D.useRef(null),k=e.reduce((j,P)=>{let R=r.filter(I=>n(I)===P.id);return s&&(R=R.sort((I,J)=>s(I)-s(J))),j[P.id]=R,j},{}),x=D.useCallback((j,P)=>{const R=t(P),I=n(P);m(R),w.current=I,j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/plain",R),requestAnimationFrame(()=>{const J=j.target;J.style.opacity="0.5"})},[t,n]),b=D.useCallback(j=>{const P=j.target;P.style.opacity="1",m(null),C(null),E(null),w.current=null},[]),S=D.useCallback((j,P,R)=>{j.preventDefault(),j.dataTransfer.dropEffect="move",C(P),E(R)},[]),A=D.useCallback(j=>{const P=j.relatedTarget;P!=null&&P.closest("[data-kanban-column]")||(C(null),E(null))},[]),z=D.useCallback((j,P,R)=>{if(j.preventDefault(),!g)return;const I=w.current;I===P?l==null||l(g,P,R):I&&i(g,I,P,R),m(null),C(null),E(null),w.current=null},[g,i,l]),N=(j,P)=>p.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[j.color&&p.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:j.color}}),p.jsx("span",{className:"font-medium text-sm text-neutral-700",children:j.label})]}),p.jsx("span",{className:"text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full",children:P})]});return p.jsx("div",{className:`flex gap-4 overflow-x-auto pb-4 ${d}`,style:{minHeight:"400px"},children:e.map(j=>{const P=k[j.id]||[],R=y===j.id;return p.jsxs("div",{"data-kanban-column":j.id,className:`flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,onDragOver:I=>{I.preventDefault(),g&&!R&&C(j.id)},onDragLeave:A,onDrop:I=>z(I,j.id,v??P.length),children:[p.jsx("div",{className:"flex-shrink-0 border-b border-neutral-200",children:u?u(j,P.length):N(j,P.length)}),p.jsxs("div",{className:`flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${R?"bg-blue-50":""}`,children:[P.map((I,J)=>{const ae=t(I),le=g===ae,te=R&&v===J&&!le;return p.jsxs("div",{children:[te&&p.jsx("div",{className:"h-1 bg-blue-500 rounded-full mb-2 mx-1"}),p.jsx("div",{draggable:!0,onDragStart:Ce=>x(Ce,I),onDragEnd:b,onDragOver:Ce=>S(Ce,j.id,J),onClick:()=>a==null?void 0:a(I),className:`cursor-grab active:cursor-grabbing transition-all ${le?"opacity-50 scale-95":""} ${h}`,children:o(I,le)})]},ae)}),p.jsx("div",{className:"min-h-[40px] flex-1",onDragOver:I=>{I.preventDefault(),S(I,j.id,P.length)},children:R&&v===P.length&&p.jsx("div",{className:"h-1 bg-blue-500 rounded-full mx-1 mt-1"})}),P.length===0&&R&&p.jsx("div",{className:"h-20 border-2 border-dashed border-blue-300 rounded-lg bg-blue-50/50 flex items-center justify-center",children:p.jsx("span",{className:"text-sm text-blue-400",children:"Drop here"})})]}),c&&p.jsx("div",{className:"flex-shrink-0 border-t border-neutral-200 p-2",children:c(j)})]},j.id)})})}const hf={background:"#ffffff",hourLineColor:"#e5e7eb",halfHourLineColor:"#f3f4f6",hourTextColor:"#9ca3af",currentTimeColor:"#ef4444",allDayBackground:"#f9fafb",allDayBorder:"#e5e7eb"};function pf(r){const e=r.match(/^(\d{1,2}):(\d{2})$/);return e?{hours:parseInt(e[1],10),minutes:parseInt(e[2],10)}:null}function gf(r){const e=r%12||12,t=r<12?"AM":"PM";return`${e} ${t}`}function mf(r){const e=new Date;return r.getDate()===e.getDate()&&r.getMonth()===e.getMonth()&&r.getFullYear()===e.getFullYear()}function yf({items:r,date:e,startHour:t=7,endHour:n=22,hourHeight:s=60,getItemTime:o,getItemDuration:i,getItemIsAllDay:l,getItemId:a,renderItem:u,onItemClick:c,onTimeSlotClick:d,showCurrentTime:f=!0,className:h="",theme:g={}}){const m={...hf,...g},{allDayItems:y,timedItems:C}=D.useMemo(()=>{const b=[],S=[];for(const A of r)l(A)?b.push(A):S.push(A);return{allDayItems:b,timedItems:S}},[r,l]),v=D.useMemo(()=>{const b=[];for(let S=t;S<=n;S++)b.push(S);return b},[t,n]),E=(n-t+1)*s,w=D.useCallback(b=>{const S=o(b);if(!S)return null;const A=pf(S);if(!A)return null;const{hours:z,minutes:N}=A,j=Math.max(t,Math.min(n,z)),P=z<t?0:N,R=(j-t)*s+P/60*s,I=i(b),J=Math.max(20,I/60*s);return{top:R,height:J}},[o,i,t,n,s]),k=D.useMemo(()=>{if(!f||!mf(e))return null;const b=new Date,S=b.getHours(),A=b.getMinutes();return S<t||S>n?null:(S-t)*s+A/60*s},[e,f,t,n,s]),x=D.useCallback(b=>{if(!d)return;const S=b.currentTarget.getBoundingClientRect(),z=(b.clientY-S.top)/s*60,N=Math.floor(z/60)+t,j=Math.round(z%60/15)*15,P=Math.min(n,Math.max(t,N)),R=j>=60?0:j,I=`${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`;d(I)},[d,s,t,n]);return p.jsxs("div",{className:h,style:{background:m.background},children:[y.length>0&&p.jsxs("div",{style:{padding:"8px 0 8px 60px",borderBottom:`1px solid ${m.allDayBorder}`,background:m.allDayBackground},children:[p.jsx("div",{style:{fontSize:"11px",color:m.hourTextColor,marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"All Day"}),p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:y.map(b=>p.jsx("div",{onClick:()=>c==null?void 0:c(b),style:{cursor:c?"pointer":"default"},children:u(b)},a(b)))})]}),p.jsxs("div",{style:{position:"relative",height:E},children:[v.map((b,S)=>p.jsxs("div",{style:{position:"absolute",top:S*s,left:0,right:0},children:[p.jsx("div",{style:{position:"absolute",left:0,top:-8,width:"50px",textAlign:"right",paddingRight:"10px",fontSize:"11px",color:m.hourTextColor},children:gf(b)}),p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,height:"1px",background:m.hourLineColor}}),S<v.length-1&&p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:s/2,height:"1px",background:m.halfHourLineColor}})]},b)),p.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,bottom:0,cursor:d?"pointer":"default"},onClick:x}),k!==null&&p.jsxs("div",{style:{position:"absolute",left:"55px",right:0,top:k,zIndex:20,pointerEvents:"none"},children:[p.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:m.currentTimeColor,marginLeft:"-5px",marginTop:"-5px",position:"absolute"}}),p.jsx("div",{style:{marginLeft:"5px",height:"2px",background:m.currentTimeColor}})]}),C.map(b=>{const S=w(b);return S?p.jsx("div",{style:{position:"absolute",left:"64px",right:"8px",top:S.top,height:S.height,zIndex:10,cursor:c?"pointer":"default"},onClick:A=>{A.stopPropagation(),c==null||c(b)},children:u(b)},a(b)):null})]})]})}function xf({onComplete:r,onCancel:e,onTranscribe:t,transcribing:n,variant:s="widget",hideSaveButton:o=!1,maxDuration:i=180}){const l=s==="widget",[a,u]=D.useState("idle"),[c,d]=D.useState(0),[f,h]=D.useState(0),[g,m]=D.useState(!1),[y,C]=D.useState(0),[v,E]=D.useState(null),[w,k]=D.useState(!1),[x,b]=D.useState(null),S=D.useRef(null),A=D.useRef(null),z=D.useRef(null),N=D.useRef(null),j=D.useRef(null),P=D.useRef([]),R=D.useRef(null),I=D.useRef(null),J=D.useRef(null),ae=D.useRef(null),le=D.useRef(!1),te=D.useRef([]),Ce=D.useRef(null),ue=D.useRef(null),_e=D.useRef([]),Ee=D.useRef([]),Pe=D.useRef("insert"),Oe=D.useRef(!1),de=D.useRef(0),qe=D.useRef(0),Me=D.useRef(0),ye=U=>{const T=Math.floor(U/60),Y=Math.floor(U%60);return`${T.toString().padStart(2,"0")}:${Y.toString().padStart(2,"0")}`},je=async U=>{const T=await U.arrayBuffer(),Y=new AudioContext,L=await Y.decodeAudioData(T);return await Y.close(),L},ut=U=>{const T=U.numberOfChannels,Y=U.sampleRate,L=1,B=16,H=B/8,X=T*H,Q=Y*X,re=U.length*X,xe=new ArrayBuffer(44+re),ne=new DataView(xe),ee=(ve,he)=>{for(let Ue=0;Ue<he.length;Ue++)ne.setUint8(ve+Ue,he.charCodeAt(Ue))};ee(0,"RIFF"),ne.setUint32(4,36+re,!0),ee(8,"WAVE"),ee(12,"fmt "),ne.setUint32(16,16,!0),ne.setUint16(20,L,!0),ne.setUint16(22,T,!0),ne.setUint32(24,Y,!0),ne.setUint32(28,Q,!0),ne.setUint16(32,X,!0),ne.setUint16(34,B,!0),ee(36,"data"),ne.setUint32(40,re,!0);const Be=[];for(let ve=0;ve<T;ve++)Be.push(U.getChannelData(ve));let De=44;for(let ve=0;ve<U.length;ve++)for(let he=0;he<T;he++){const Ue=Math.max(-1,Math.min(1,Be[he][ve])),We=Ue<0?Ue*32768:Ue*32767;ne.setInt16(De,We,!0),De+=2}return new Blob([xe],{type:"audio/wav"})},Ot=async(U,T,Y,L)=>{const B=new AudioContext,H=U.sampleRate,X=Math.max(U.numberOfChannels,T.numberOfChannels),Q=Math.min(Y,U.length),re=Math.max(0,U.length-Y),xe=L==="insert"?Q+T.length+re:Q+T.length,ne=B.createBuffer(X,xe,H);for(let ee=0;ee<X;ee++){const Be=ne.getChannelData(ee),De=ee<U.numberOfChannels?U.getChannelData(ee):U.getChannelData(0);for(let he=0;he<Q;he++)Be[he]=De[he];const ve=ee<T.numberOfChannels?T.getChannelData(ee):T.getChannelData(0);for(let he=0;he<T.length;he++)Be[Q+he]=ve[he];if(L==="insert")for(let he=0;he<re;he++)Be[Q+T.length+he]=De[Y+he]}return await B.close(),ne},At=D.useCallback(()=>{const U=S.current;if(!U)return;const T=U.getContext("2d");if(!T)return;const Y=U.getBoundingClientRect(),L=Y.width,B=Y.height,H=te.current,X=f||c||1,Q=a==="recording"?c:y;T.fillStyle="#2d3b35",T.fillRect(0,0,L,B);const re=8,xe="rgba(0, 0, 0, 0.4)",ne=T.createLinearGradient(0,0,0,re);ne.addColorStop(0,xe),ne.addColorStop(1,"transparent"),T.fillStyle=ne,T.fillRect(0,0,L,re);const ee=T.createLinearGradient(0,B-re,0,B);ee.addColorStop(0,"transparent"),ee.addColorStop(1,xe),T.fillStyle=ee,T.fillRect(0,B-re,L,re);const Be=T.createLinearGradient(0,0,re,0);Be.addColorStop(0,xe),Be.addColorStop(1,"transparent"),T.fillStyle=Be,T.fillRect(0,0,re,B);const De=T.createLinearGradient(L-re,0,L,0);De.addColorStop(0,"transparent"),De.addColorStop(1,xe),T.fillStyle=De,T.fillRect(L-re,0,re,B),T.strokeStyle="#5a6b62",T.lineWidth=1,T.beginPath(),T.moveTo(0,B/2),T.lineTo(L,B/2),T.stroke();const ve=L/2;if(H.length>0)if(a==="recording")for(let We=0;We<H.length;We++){const rt=H.length-1-We,Tt=ve-rt*4;if(Tt<-3||Tt>L)continue;const ot=H[We]*(B/2-12),Bt=B/2-ot;T.fillStyle="#10b981",T.fillRect(Tt,Bt,3,ot*2)}else{const We=X>0?Q/X*H.length:0;for(let rt=0;rt<H.length;rt++){const Tt=We-rt,ot=ve-Tt*4;if(ot<-3||ot>L)continue;const Bt=H[rt]*(B/2-12),Fr=B/2-Bt;T.fillStyle=rt<=We?"#10b981":"#4b5563",T.fillRect(ot,Fr,3,Bt*2)}}T.strokeStyle="#ef4444",T.lineWidth=1,T.beginPath(),T.moveTo(ve,0),T.lineTo(ve,B),T.stroke(),T.fillStyle="#fff",T.font="bold 18px monospace",T.textAlign="center",T.fillText(ye(Q),ve,B-6),a==="recording"&&(T.fillStyle="#ef4444",T.beginPath(),T.arc(20,20,8,0,Math.PI*2),T.fill(),T.fillStyle="#fff",T.font="10px sans-serif",T.textAlign="left",T.fillText("REC",34,24)),T.textAlign="left"},[a,y,c,f]),Mt=()=>{const U=j.current;if(!U||!le.current)return;const T=U.frequencyBinCount,Y=new Uint8Array(T);U.getByteTimeDomainData(Y);let L=0;for(let X=0;X<T;X++){const Q=(Y[X]-128)/128;L+=Q*Q}const B=Math.sqrt(L/T),H=Math.min(1,B*3);te.current.push(H),At(),le.current&&(I.current=requestAnimationFrame(Mt))},Ke=async()=>{try{E(null),k(!1),Ce.current===null&&(te.current=[]);const U=await navigator.mediaDevices.getUserMedia({audio:!0});z.current=U;const T=new AudioContext;N.current=T;const Y=T.createAnalyser();Y.fftSize=2048,j.current=Y,T.createMediaStreamSource(U).connect(Y);const B=new MediaRecorder(U);A.current=B,P.current=[],B.ondataavailable=H=>{H.data.size>0&&P.current.push(H.data)},B.onstop=async()=>{try{if(le.current=!1,P.current.length===0){E("No audio was recorded. Please try again."),u("idle"),U.getTracks().forEach(ne=>ne.stop());return}const H=new Blob(P.current,{type:"audio/webm"});let X,Q;if(Ce.current!==null&&ue.current)try{const ne=await je(H),ee=ue.current.sampleRate,Be=Math.floor(Ce.current*ee),De=await Ot(ue.current,ne,Be,Pe.current);X=ut(De),Q=De.length/De.sampleRate,Pe.current==="insert"&&(te.current=[...te.current,...Ee.current]),Ce.current=null,ue.current=null,_e.current=[],Ee.current=[]}catch{X=H,Q=de.current>0?de.current:1}else X=H,Q=de.current>0?de.current:1;ae.current=X;const re=URL.createObjectURL(X),xe=new Audio(re);xe.ontimeupdate=()=>{C(xe.currentTime)},xe.onended=()=>{m(!1)},J.current=xe,h(Q),C(Q),u("editing"),U.getTracks().forEach(ne=>ne.stop())}catch{E("Failed to process recording"),u("idle")}},B.start(100),le.current=!0,u("recording"),d(0),de.current=0,R.current=setInterval(()=>{de.current+=1,d(de.current),de.current>=i&&(A.current&&A.current.state!=="inactive"&&A.current.stop(),le.current=!1,b(null),R.current&&(clearInterval(R.current),R.current=null),I.current&&(cancelAnimationFrame(I.current),I.current=null),setTimeout(()=>{alert(`Maximum recording time of ${Math.floor(i/60)} minutes reached.`)},100))},1e3)}catch{E("Could not access microphone. Please allow microphone access.")}},tt=()=>{le.current=!1,k(!1),b(null),I.current&&(cancelAnimationFrame(I.current),I.current=null),R.current&&(clearInterval(R.current),R.current=null),A.current&&A.current.state!=="inactive"&&A.current.stop()},It=U=>{const T=S.current;if(!T)return;const Y=f||c;if(Y<=0)return;const L=te.current;if(L.length===0)return;const B=T.getBoundingClientRect(),H=U-qe.current,X=4,Q=B.width/T.width,re=L.length/Y*X,xe=-H/(re*Q),ne=Me.current+xe,ee=Math.max(0,Math.min(ne,Y));J.current&&(J.current.currentTime=ee),C(ee)},$t=()=>{J.current&&(J.current.currentTime=0),C(0)},yt=()=>{const U=f||c;J.current&&(J.current.currentTime=U),C(U)},xt=()=>{const U=J.current;U&&(g?(U.pause(),C(U.currentTime),m(!1)):(U.currentTime=y,U.play().catch(()=>{}),m(!0)))},it=async U=>{if(!ae.current){Ke();return}try{J.current&&(J.current.pause(),m(!1)),Pe.current=U,ue.current=await je(ae.current);const T=f||c;Ce.current=y;const Y=T>0?y/T:0,L=Math.floor(Y*te.current.length);_e.current=te.current.slice(0,L),Ee.current=te.current.slice(L),te.current=[..._e.current],Ke()}catch{E("Failed to prepare recording. Please try again.")}},bt=()=>{J.current&&(J.current.pause(),J.current=null),ae.current=null,ue.current=null,Ce.current=null,_e.current=[],m(!1),C(0),h(0),d(0),Ke()},V=()=>{ae.current?r(ae.current,f||c):alert("No audio recorded yet!")};if(D.useEffect(()=>{a==="recording"&&S.current&&j.current&&le.current&&(I.current=requestAnimationFrame(Mt))},[a]),D.useEffect(()=>{const U=S.current;if(!U)return;const T=()=>{const Y=window.devicePixelRatio||1,L=U.getBoundingClientRect();U.width=L.width*Y,U.height=L.height*Y;const B=U.getContext("2d");B&&B.scale(Y,Y)};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),D.useEffect(()=>{if(a==="idle"){const U=S.current;if(!U)return;const T=U.getContext("2d");if(!T)return;const Y=U.getBoundingClientRect(),L=Y.width,B=Y.height;T.fillStyle="#2d3b35",T.fillRect(0,0,L,B);const H=8,X="rgba(0, 0, 0, 0.4)",Q=T.createLinearGradient(0,0,0,H);Q.addColorStop(0,X),Q.addColorStop(1,"transparent"),T.fillStyle=Q,T.fillRect(0,0,L,H);const re=T.createLinearGradient(0,B-H,0,B);re.addColorStop(0,"transparent"),re.addColorStop(1,X),T.fillStyle=re,T.fillRect(0,B-H,L,H);const xe=T.createLinearGradient(0,0,H,0);xe.addColorStop(0,X),xe.addColorStop(1,"transparent"),T.fillStyle=xe,T.fillRect(0,0,H,B);const ne=T.createLinearGradient(L-H,0,L,0);ne.addColorStop(0,"transparent"),ne.addColorStop(1,X),T.fillStyle=ne,T.fillRect(L-H,0,H,B),T.strokeStyle="#5a6b62",T.lineWidth=1,T.beginPath(),T.moveTo(0,B/2),T.lineTo(L,B/2),T.stroke();const ee=L/2;T.strokeStyle="#ef4444",T.lineWidth=1,T.beginPath(),T.moveTo(ee,0),T.lineTo(ee,B),T.stroke(),T.fillStyle="#fff",T.font="bold 18px monospace",T.textAlign="center",T.fillText("00:00",ee,B-6)}},[a]),D.useEffect(()=>()=>{le.current=!1,R.current&&clearInterval(R.current),I.current&&cancelAnimationFrame(I.current),z.current&&z.current.getTracks().forEach(U=>U.stop()),N.current&&N.current.state!=="closed"&&N.current.close()},[]),D.useEffect(()=>{if(a==="editing"&&g){let U;const T=()=>{const Y=J.current;if(Y&&g){const L=S.current;if(L){const B=L.getContext("2d");if(B){const H=L.getBoundingClientRect(),X=H.width,Q=H.height,re=te.current,xe=f||c||1,ne=Y.currentTime;B.fillStyle="#2d3b35",B.fillRect(0,0,X,Q);const ee=8,Be="rgba(0, 0, 0, 0.4)",De=B.createLinearGradient(0,0,0,ee);De.addColorStop(0,Be),De.addColorStop(1,"transparent"),B.fillStyle=De,B.fillRect(0,0,X,ee);const ve=B.createLinearGradient(0,Q-ee,0,Q);ve.addColorStop(0,"transparent"),ve.addColorStop(1,Be),B.fillStyle=ve,B.fillRect(0,Q-ee,X,ee);const he=B.createLinearGradient(0,0,ee,0);he.addColorStop(0,Be),he.addColorStop(1,"transparent"),B.fillStyle=he,B.fillRect(0,0,ee,Q);const Ue=B.createLinearGradient(X-ee,0,X,0);Ue.addColorStop(0,"transparent"),Ue.addColorStop(1,Be),B.fillStyle=Ue,B.fillRect(X-ee,0,ee,Q),B.strokeStyle="#5a6b62",B.lineWidth=1,B.beginPath(),B.moveTo(0,Q/2),B.lineTo(X,Q/2),B.stroke();const We=X/2,rt=3,Tt=4,ot=xe>0?ne/xe*re.length:0;for(let Yt=0;Yt<re.length;Yt++){const vn=ot-Yt,hr=We-vn*Tt;if(hr<-rt||hr>X)continue;const Cn=re[Yt]*(Q/2-12),bs=Q/2-Cn;B.fillStyle=Yt<=ot?"#10b981":"#4b5563",B.fillRect(hr,bs,rt,Cn*2)}B.strokeStyle="#ef4444",B.lineWidth=1,B.beginPath(),B.moveTo(We,0),B.lineTo(We,Q),B.stroke(),B.fillStyle="#fff",B.font="bold 18px monospace",B.textAlign="center";const Bt=Math.floor(ne/60),Fr=Math.floor(ne%60);B.fillText(`${Bt.toString().padStart(2,"0")}:${Fr.toString().padStart(2,"0")}`,We,Q-6),B.textAlign="left"}}U=requestAnimationFrame(T)}};return U=requestAnimationFrame(T),()=>cancelAnimationFrame(U)}},[a,g,f,c]),D.useEffect(()=>{a==="editing"&&!g&&At()},[a,y,g,At]),v)return p.jsxs("div",{style:{border:"1px solid #fecaca",borderRadius:"12px",padding:"16px",background:"#fef2f2"},children:[p.jsx("p",{style:{fontSize:"14px",color:"#dc2626",marginBottom:"12px"},children:v}),p.jsx("button",{onClick:()=>{E(null),Ke()},style:{padding:"8px 16px",fontSize:"14px",background:"#171717",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},children:"Try Again"})]});const ge={padding:"8px",borderRadius:"8px",border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s"},fe={...ge,opacity:.3,cursor:"not-allowed"},we=l?{border:"1px solid #e5e5e5",borderRadius:"12px",overflow:"hidden",background:"white"}:{overflow:"hidden",background:"white",flexShrink:0};return p.jsxs("div",{style:we,children:[p.jsx("canvas",{ref:S,style:{width:"100%",height:"32px",cursor:"pointer",flexShrink:0},onMouseDown:U=>{if(a==="editing"){Oe.current=!0,qe.current=U.clientX,Me.current=y;const T=L=>{Oe.current&&It(L.clientX)},Y=()=>{Oe.current=!1,window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",Y)};window.addEventListener("mousemove",T),window.addEventListener("mouseup",Y)}}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l?"6px 8px":"4px",borderTop:"1px solid #d4d4d4",background:"linear-gradient(to bottom, #e0e0e0 0%, #c8c8c8 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(0,0,0,0.1)",flexShrink:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[p.jsx("button",{onClick:$t,disabled:a==="idle"||a==="recording",style:a==="idle"||a==="recording"?fe:ge,title:"Go to start",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"first_page"})}),p.jsx("button",{onClick:()=>{if(a==="recording"){const U=A.current;U&&(U.state==="recording"?(U.pause(),k(!0)):U.state==="paused"&&(U.resume(),k(!1)))}else xt()},disabled:a==="idle",style:a==="idle"?fe:ge,title:g||a==="recording"&&!w?"Pause":"Play",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:g||a==="recording"&&!w?"pause":"play_arrow"})}),p.jsx("button",{onClick:yt,disabled:a==="idle"||a==="recording",style:a==="idle"||a==="recording"?fe:ge,title:"Go to end",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"last_page"})}),p.jsx("div",{style:{width:"1px",height:"24px",margin:"0 4px",background:"linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(0,0,0,0.15))"}}),p.jsx("button",{onClick:()=>{x==="insert"?tt():a==="idle"?(b("insert"),Ke()):a==="editing"&&(b("insert"),it("insert"))},disabled:a==="recording"&&x!=="insert"||g,style:a==="recording"&&x!=="insert"||g?fe:ge,title:x==="insert"?"Stop recording":"Insert recording",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:x==="insert"?"#ef4444":"#171717"},children:"add"})}),p.jsx("button",{onClick:()=>{x==="mic"?tt():a==="idle"?(b("mic"),Ke()):a==="editing"&&(b("mic"),it("replace"))},disabled:a==="recording"&&x!=="mic"||g,style:a==="recording"&&x!=="mic"||g?fe:ge,title:x==="mic"?"Stop recording":"Record",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:x==="mic"?"#ef4444":"#171717"},children:"mic"})}),p.jsx("button",{onClick:()=>{x==="startover"?tt():a==="editing"&&(b("startover"),bt())},disabled:a==="idle"||a==="recording"&&x!=="startover"||g,style:a==="idle"||a==="recording"&&x!=="startover"||g?fe:ge,title:x==="startover"?"Stop recording":"Start over",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:x==="startover"?"#ef4444":"#171717"},children:"refresh"})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t&&p.jsx("button",{onClick:()=>ae.current&&t(ae.current),disabled:a!=="editing"||n,style:a!=="editing"||n?fe:ge,title:n?"Transcribing...":"Transcribe audio",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:n?"hourglass_empty":"subtitles"})}),!o&&p.jsx("button",{onClick:V,disabled:a!=="editing",style:a!=="editing"?fe:ge,title:"Save recording",children:p.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"save"})})]})]})]})}exports.AnimatedCardFlip=hu;exports.ApiClient=ul;exports.AudioEditor=xf;exports.AuthManager=al;exports.Card=cu;exports.ComboBox=df;exports.DataOperations=Fn;exports.Detail=du;exports.GraphClient=Ia;exports.KanbanBoard=ff;exports.Mail=gu;exports.MailClient=ll;exports.MailComposer=uf;exports.MailEditor=Na;exports.SelectableList=mu;exports.Stack=uu;exports.Timeline=yf;exports.getApiClient=li;exports.initializeApiClient=iu;exports.useMutation=ou;exports.useQuery=cl;
|