ed-widget 1.56.11-beta.6 → 1.56.11-beta.7
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/ed-widget.js +1 -1
- package/npm/ed-widget.js +1 -1
- package/package.json +1 -1
package/dist/ed-widget.js
CHANGED
|
@@ -1715,7 +1715,7 @@ If anything else comes up, I'm just one message away. 👋`,channelConnecting:"P
|
|
|
1715
1715
|
</div>
|
|
1716
1716
|
</div>`,is_customer_reply:!0},{message:ce,is_auto_response:!0,current_stage:ye}];await mT(600,1e3);const{data:ke}=await N({variables:{inputData:{type:"chat",contact_person_name:R==null?void 0:R.contact_person_name,contact_person_email:R==null?void 0:R.contact_person_email,conversation_activities:Ce,is_initiated_with_ai:x}}}),ge=ke==null?void 0:ke.createAConversationForPortal;ge!=null&&ge.id&&(n(ge==null?void 0:ge.id),E6("easydesk_chat_widget_conversation_id",ge==null?void 0:ge.id,{expires:30}),t==null||t({contact_person_name:R==null?void 0:R.contact_person_name,contact_person_email:R==null?void 0:R.contact_person_email}))}catch(ne){const re={EMAIL_IS_SUPPRESSED:"This email address is currently unreachable"},{message:ce,response:ye}=ne,Ce=re[ce]||((le=ye==null?void 0:ye.data)==null?void 0:le.message);ai("error",Ce,"top-left"),w(!1)}finally{P(!1)}},Q=W=>{const{name:ee,value:X}=W.target;L(le=>({...le,[ee]:X}))},H=D.useMemo(()=>!(R!=null&&R.contact_person_name)||!(R!=null&&R.contact_person_email)||!qv(R==null?void 0:R.contact_person_email)||A||Y||F,[R,A,Y,F]);return T.jsxs("div",{className:"ed-space-y-5 ed-px-5 ed-pt-1",children:[b&&!C&&T.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%]",children:[x?T.jsx(V1,{iconKey:l}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:xl(i==null?void 0:i.name)}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:x?s||"Eden AI":i==null?void 0:i.name}),T.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:gu().format("HH:mm")})]}),T.jsx("div",{className:"ed-py-4",children:T.jsx(sp,{})})]})]}),d&&!C&&T.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%] ed-animate-fadeInUp",children:[x?T.jsx(V1,{iconKey:l}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:xl(i==null?void 0:i.name)}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:x?s||"Eden AI":i==null?void 0:i.name}),T.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:gu().format("HH:mm")})]}),T.jsx("div",{className:"ed-p-2.5 ed-bg-white-light ed-text-[13px] ed-rounded-lg ed-mt-2",children:T.jsx("p",{className:"ed-text-border-dark",children:J?Vr.initial.greetingOnline:Vr.initial.greetingOffline})})]})]}),m&&!C&&T.jsx("div",{className:"ed-max-w-[85%] ed-ml-auto ed-animate-fadeInUp",children:T.jsxs("form",{onSubmit:ae,className:"ed-p-5 ed-rounded-[20px] ed-bg-white-light ed-space-y-5",children:[T.jsxs("div",{className:"ed-space-y-2",children:[T.jsxs("label",{className:"ed-block ed-text-border-dark ed-text-14 ed-font-semibold",children:["Name ",T.jsx("span",{className:"ed-text-red ed-text-14 ed-font-semibold",children:"*"})]}),T.jsx("input",{type:"text",name:"contact_person_name",required:!0,placeholder:"Enter your name",value:R==null?void 0:R.contact_person_name,onChange:Q,disabled:u,className:"ed-w-full ed-p-2.5 ed-px-4 ed-border ed-border-border-light ed-rounded-lg ed-outline-none ed-bg-white ed-text-14 ed-font-normal"})]}),T.jsx("div",{className:"ed-space-y-2",children:T.jsx(qw,{label:"Email",name:"contact_person_email",value:R==null?void 0:R.contact_person_email,onChange:Q,checkEmails:q,onSuppressionChange:U,placeholder:"Enter your email",disabled:u,className:"ed-w-full ed-py-2.5 ed-px-4 ed-pl-4 ed-border ed-border-border-light ed-rounded-lg ed-outline-none ed-bg-white ed-text-14 ed-font-normal",required:!0})}),T.jsx("div",{className:"ed-flex ed-justify-end",children:T.jsx(Zf,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:H,loader:A,callBack:ae})})]})}),C&&T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%]",children:[x?T.jsx(V1,{iconKey:l}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:xl(i==null?void 0:i.name)}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:x?s||"Eden AI bot":i==null?void 0:i.name}),T.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:gu().format("HH:mm")})]}),T.jsx("div",{className:"ed-p-2.5 ed-bg-white-light ed-text-[13px] ed-rounded-lg ed-mt-2",children:T.jsx("p",{className:"ed-text-border-dark",children:J?Vr.initial.greetingOnline:Vr.initial.greetingOffline})})]})]}),T.jsx("div",{className:"ed-max-w-[85%] ed-ml-auto ed-animate-fadeInUp",children:T.jsxs("div",{className:"ed-p-5 ed-rounded-[20px] ed-bg-blue-50 ed-border ed-border-blue-100",style:{borderRadius:"20px",border:"1px solid #e3f2fd",backgroundColor:"#e3f2fd",padding:"20px"},children:[T.jsxs("div",{style:{marginBottom:"20px"},children:[T.jsx("h6",{style:{fontSize:"13px",fontWeight:"600",color:"#3b3b3b",margin:0,padding:0},children:"Name"}),T.jsx("p",{style:{fontSize:"13px",color:"#797979"},children:R==null?void 0:R.contact_person_name})]}),T.jsxs("div",{children:[T.jsx("h6",{style:{fontSize:"13px",fontWeight:"600",color:"#3b3b3b",margin:0,padding:0},children:"Email"}),T.jsx("p",{style:{fontSize:"13px",color:"#797979",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:R==null?void 0:R.contact_person_email})]})]})}),T.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%] ed-animate-fadeIn",children:[x?T.jsx(V1,{iconKey:l}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:xl(i==null?void 0:i.name)}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:x?s||"Eden AI bot":i==null?void 0:i.name}),T.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:gu().format("HH:mm")})]}),T.jsx("div",{className:"ed-py-4",children:T.jsx(sp,{})})]})]})]})]})};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function eV(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function cue(t){if(Array.isArray(t))return t}function fue(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,l,u=[],d=!0,h=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==e);d=!0);}catch(m){h=!0,i=m}finally{try{if(!d&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function due(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1717
1717
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hue(t,e){return cue(t)||fue(t,e)||pue(t,e)||due()}function pue(t,e){if(t){if(typeof t=="string")return eV(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eV(t,e):void 0}}const tV=Object.entries,nV=Object.setPrototypeOf,mue=Object.isFrozen,vue=Object.getPrototypeOf,gue=Object.getOwnPropertyDescriptor;let Aa=Object.freeze,Ra=Object.seal,kp=Object.create,rV=typeof Reflect<"u"&&Reflect,vT=rV.apply,gT=rV.construct;Aa||(Aa=function(e){return e}),Ra||(Ra=function(e){return e}),vT||(vT=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)}),gT||(gT=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const Op=Mi(Array.prototype.forEach),yue=Mi(Array.prototype.lastIndexOf),iV=Mi(Array.prototype.pop),Np=Mi(Array.prototype.push),bue=Mi(Array.prototype.splice),Ec=Array.isArray,U1=Mi(String.prototype.toLowerCase),yT=Mi(String.prototype.toString),aV=Mi(String.prototype.match),z1=Mi(String.prototype.replace),oV=Mi(String.prototype.indexOf),Sue=Mi(String.prototype.trim),Eue=Mi(Number.prototype.toString),Cue=Mi(Boolean.prototype.toString),sV=typeof BigInt>"u"?null:Mi(BigInt.prototype.toString),lV=typeof Symbol>"u"?null:Mi(Symbol.prototype.toString),ua=Mi(Object.prototype.hasOwnProperty),H1=Mi(Object.prototype.toString),ca=Mi(RegExp.prototype.test),rd=_ue(TypeError);function Mi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return vT(t,e,r)}}function _ue(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return gT(t,n)}}function sr(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U1;if(nV&&nV(t,null),!Ec(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=n(i);s!==i&&(mue(e)||(e[r]=s),i=s)}t[i]=!0}return t}function xue(t){for(let e=0;e<t.length;e++)ua(t,e)||(t[e]=null);return t}function ho(t){const e=kp(null);for(const r of tV(t)){var n=hue(r,2);const i=n[0],s=n[1];ua(t,i)&&(Ec(s)?e[i]=xue(s):s&&typeof s=="object"&&s.constructor===Object?e[i]=ho(s):e[i]=s)}return e}function wue(t){switch(typeof t){case"string":return t;case"number":return Eue(t);case"boolean":return Cue(t);case"bigint":return sV?sV(t):"0";case"symbol":return lV?lV(t):"Symbol()";case"undefined":return H1(t);case"function":case"object":{if(t===null)return H1(t);const e=t,n=kl(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:H1(r)}return H1(t)}default:return H1(t)}}function kl(t,e){for(;t!==null;){const r=gue(t,e);if(r){if(r.get)return Mi(r.get);if(typeof r.value=="function")return Mi(r.value)}t=vue(t)}function n(){return null}return n}function Tue(t){try{return ca(t,""),!0}catch{return!1}}const uV=Aa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bT=Aa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ST=Aa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Aue=Aa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ET=Aa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Rue=Aa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cV=Aa(["#text"]),fV=Aa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),CT=Aa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dV=Aa(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),TS=Aa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kue=Ra(/{{[\w\W]*|^[\w\W]*}}/g),Oue=Ra(/<%[\w\W]*|^[\w\W]*%>/g),Nue=Ra(/\${[\w\W]*/g),Mue=Ra(/^data-[\-\w.\u00B7-\uFFFF]+$/),Due=Ra(/^aria-[\-\w]+$/),hV=Ra(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lue=Ra(/^(?:\w+script|data):/i),Pue=Ra(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Iue=Ra(/^html$/i),Fue=Ra(/^[a-z][.\w]*(-[.\w]+)+$/i),pV=Ra(/<[/\w!]/g),mV=Ra(/<[/\w]/g),jue=Ra(/<\/no(script|embed|frames)/i),Vue=Ra(/\/>/i),ts={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Uue=function(){return typeof window>"u"?null:window},zue=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},vV=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cc=function(e,n,r,i){return ua(e,n)&&Ec(e[n])?sr(i.base?ho(i.base):{},e[n],i.transform):r};function gV(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uue();const e=nt=>gV(nt);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==ts.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,i=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,l=t.Node,u=t.Element,d=t.NodeFilter,h=t.NamedNodeMap;h===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const m=t.DOMParser,g=t.trustedTypes,b=u.prototype,y=kl(b,"cloneNode"),C=kl(b,"remove"),w=kl(b,"nextSibling"),x=kl(b,"childNodes"),k=kl(b,"parentNode"),R=kl(b,"shadowRoot"),L=kl(b,"attributes"),N=l&&l.prototype?kl(l.prototype,"nodeType"):null,A=l&&l.prototype?kl(l.prototype,"nodeName"):null;if(typeof s=="function"){const nt=n.createElement("template");nt.content&&nt.content.ownerDocument&&(n=nt.content.ownerDocument)}let P,F="",U,q=!1,Y=0;const te=function(){if(Y>0)throw rd('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},J=function(Z){te(),Y++;try{return P.createHTML(Z)}finally{Y--}},ae=function(Z){te(),Y++;try{return P.createScriptURL(Z)}finally{Y--}},Q=function(){return q||(U=zue(g,i),q=!0),U},H=n,W=H.implementation,ee=H.createNodeIterator,X=H.createDocumentFragment,le=H.getElementsByTagName,ne=r.importNode;let re=vV();e.isSupported=typeof tV=="function"&&typeof k=="function"&&W&&W.createHTMLDocument!==void 0;const ce=kue,ye=Oue,Ce=Nue,ke=Mue,ge=Due,we=Lue,We=Pue,Ge=Fue;let Ye=hV,Pe=null;const fe=sr({},[...uV,...bT,...ST,...ET,...cV]);let Qe=null;const He=sr({},[...fV,...CT,...dV,...TS]);let et=Object.seal(kp(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Je=null,dt=null;const kt=Object.seal(kp(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ut=!0,$t=!0,Et=!1,vt=!0,xe=!1,Re=!0,ot=!1,jt=!1,hr=null,An=null,Vn=!1,tt=!1,ct=!1,pt=!1,tn=!0,dn=!1;const _n="user-content-";let Dn=!0,Ln=!1,pn={},gn=null;const qn=sr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Di=null;const pi=sr({},["audio","video","img","source","image","track"]);let ti=null;const ni=sr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cr="http://www.w3.org/1998/Math/MathML",tr="http://www.w3.org/2000/svg",Mr="http://www.w3.org/1999/xhtml";let pr=Mr,Rn=!1,un=null;const Jn=sr({},[Cr,tr,Mr],yT),_r=Aa(["mi","mo","mn","ms","mtext"]);let xr=sr({},_r);const Wn=Aa(["annotation-xml"]);let _i=sr({},Wn);const Ri=sr({},["title","style","font","a","script"]);let ie=null;const je=["application/xhtml+xml","text/html"],at="text/html";let Ke=null,Ut=null;const Wt=n.createElement("form"),Gt=function(Z){return Z instanceof RegExp||Z instanceof Function},Vt=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ut&&Ut===Z)return;(!Z||typeof Z!="object")&&(Z={}),Z=ho(Z),ie=je.indexOf(Z.PARSER_MEDIA_TYPE)===-1?at:Z.PARSER_MEDIA_TYPE,Ke=ie==="application/xhtml+xml"?yT:U1,Pe=Cc(Z,"ALLOWED_TAGS",fe,{transform:Ke}),Qe=Cc(Z,"ALLOWED_ATTR",He,{transform:Ke}),un=Cc(Z,"ALLOWED_NAMESPACES",Jn,{transform:yT}),ti=Cc(Z,"ADD_URI_SAFE_ATTR",ni,{transform:Ke,base:ni}),Di=Cc(Z,"ADD_DATA_URI_TAGS",pi,{transform:Ke,base:pi}),gn=Cc(Z,"FORBID_CONTENTS",qn,{transform:Ke}),Je=Cc(Z,"FORBID_TAGS",ho({}),{transform:Ke}),dt=Cc(Z,"FORBID_ATTR",ho({}),{transform:Ke}),pn=ua(Z,"USE_PROFILES")?Z.USE_PROFILES&&typeof Z.USE_PROFILES=="object"?ho(Z.USE_PROFILES):Z.USE_PROFILES:!1,ut=Z.ALLOW_ARIA_ATTR!==!1,$t=Z.ALLOW_DATA_ATTR!==!1,Et=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,vt=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=Z.SAFE_FOR_TEMPLATES||!1,Re=Z.SAFE_FOR_XML!==!1,ot=Z.WHOLE_DOCUMENT||!1,tt=Z.RETURN_DOM||!1,ct=Z.RETURN_DOM_FRAGMENT||!1,pt=Z.RETURN_TRUSTED_TYPE||!1,Vn=Z.FORCE_BODY||!1,tn=Z.SANITIZE_DOM!==!1,dn=Z.SANITIZE_NAMED_PROPS||!1,Dn=Z.KEEP_CONTENT!==!1,Ln=Z.IN_PLACE||!1,Ye=Tue(Z.ALLOWED_URI_REGEXP)?Z.ALLOWED_URI_REGEXP:hV,pr=typeof Z.NAMESPACE=="string"?Z.NAMESPACE:Mr,xr=ua(Z,"MATHML_TEXT_INTEGRATION_POINTS")&&Z.MATHML_TEXT_INTEGRATION_POINTS&&typeof Z.MATHML_TEXT_INTEGRATION_POINTS=="object"?ho(Z.MATHML_TEXT_INTEGRATION_POINTS):sr({},_r),_i=ua(Z,"HTML_INTEGRATION_POINTS")&&Z.HTML_INTEGRATION_POINTS&&typeof Z.HTML_INTEGRATION_POINTS=="object"?ho(Z.HTML_INTEGRATION_POINTS):sr({},Wn);const be=ua(Z,"CUSTOM_ELEMENT_HANDLING")&&Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING=="object"?ho(Z.CUSTOM_ELEMENT_HANDLING):kp(null);if(et=kp(null),ua(be,"tagNameCheck")&&Gt(be.tagNameCheck)&&(et.tagNameCheck=be.tagNameCheck),ua(be,"attributeNameCheck")&&Gt(be.attributeNameCheck)&&(et.attributeNameCheck=be.attributeNameCheck),ua(be,"allowCustomizedBuiltInElements")&&typeof be.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=be.allowCustomizedBuiltInElements),Ra(et),xe&&($t=!1),ct&&(tt=!0),pn&&(Pe=sr({},cV),Qe=kp(null),pn.html===!0&&(sr(Pe,uV),sr(Qe,fV)),pn.svg===!0&&(sr(Pe,bT),sr(Qe,CT),sr(Qe,TS)),pn.svgFilters===!0&&(sr(Pe,ST),sr(Qe,CT),sr(Qe,TS)),pn.mathMl===!0&&(sr(Pe,ET),sr(Qe,dV),sr(Qe,TS))),kt.tagCheck=null,kt.attributeCheck=null,ua(Z,"ADD_TAGS")&&(typeof Z.ADD_TAGS=="function"?kt.tagCheck=Z.ADD_TAGS:Ec(Z.ADD_TAGS)&&(Pe===fe&&(Pe=ho(Pe)),sr(Pe,Z.ADD_TAGS,Ke))),ua(Z,"ADD_ATTR")&&(typeof Z.ADD_ATTR=="function"?kt.attributeCheck=Z.ADD_ATTR:Ec(Z.ADD_ATTR)&&(Qe===He&&(Qe=ho(Qe)),sr(Qe,Z.ADD_ATTR,Ke))),ua(Z,"ADD_URI_SAFE_ATTR")&&Ec(Z.ADD_URI_SAFE_ATTR)&&sr(ti,Z.ADD_URI_SAFE_ATTR,Ke),ua(Z,"FORBID_CONTENTS")&&Ec(Z.FORBID_CONTENTS)&&(gn===qn&&(gn=ho(gn)),sr(gn,Z.FORBID_CONTENTS,Ke)),ua(Z,"ADD_FORBID_CONTENTS")&&Ec(Z.ADD_FORBID_CONTENTS)&&(gn===qn&&(gn=ho(gn)),sr(gn,Z.ADD_FORBID_CONTENTS,Ke)),Dn&&(Pe["#text"]=!0),ot&&sr(Pe,["html","head","body"]),Pe.table&&(sr(Pe,["tbody"]),delete Je.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw rd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Me=P;P=Z.TRUSTED_TYPES_POLICY;try{F=J("")}catch(Ct){throw P=Me,Ct}}else Z.TRUSTED_TYPES_POLICY===null?(P=void 0,F=""):(P===void 0&&(P=Q()),P&&typeof F=="string"&&(F=J("")));Aa&&Aa(Z),Ut=Z},Xn=sr({},[...bT,...ST,...Aue]),kn=sr({},[...ET,...Rue]),nr=function(Z,be,Me){return be.namespaceURI===Mr?Z==="svg":be.namespaceURI===Cr?Z==="svg"&&(Me==="annotation-xml"||xr[Me]):!!Xn[Z]},yn=function(Z,be,Me){return be.namespaceURI===Mr?Z==="math":be.namespaceURI===tr?Z==="math"&&_i[Me]:!!kn[Z]},mi=function(Z,be,Me){return be.namespaceURI===tr&&!_i[Me]||be.namespaceURI===Cr&&!xr[Me]?!1:!kn[Z]&&(Ri[Z]||!Xn[Z])},vi=function(Z){let be=k(Z);(!be||!be.tagName)&&(be={namespaceURI:pr,tagName:"template"});const Me=U1(Z.tagName),Ct=U1(be.tagName);return un[Z.namespaceURI]?Z.namespaceURI===tr?nr(Me,be,Ct):Z.namespaceURI===Cr?yn(Me,be,Ct):Z.namespaceURI===Mr?mi(Me,be,Ct):!!(ie==="application/xhtml+xml"&&un[Z.namespaceURI]):!1},Un=function(Z){Np(e.removed,{element:Z});try{k(Z).removeChild(Z)}catch{if(C(Z),!k(Z))throw rd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ft=function(Z){po(Z);const be=x(Z);if(be){const Ct=[];Op(be,_t=>{Np(Ct,_t)}),Op(Ct,_t=>{try{C(_t)}catch{}})}const Me=L(Z);if(Me)for(let Ct=Me.length-1;Ct>=0;--Ct){const _t=Me[Ct],rt=_t&&_t.name;if(typeof rt=="string")try{Z.removeAttribute(rt)}catch{}}},oi=function(Z,be){try{Np(e.removed,{attribute:be.getAttributeNode(Z),from:be})}catch{Np(e.removed,{attribute:null,from:be})}if(be.removeAttribute(Z),Z==="is")if(tt||ct)try{Un(be)}catch{}else try{be.setAttribute(Z,"")}catch{}},Do=function(Z){const be=L(Z);if(be)for(let Me=be.length-1;Me>=0;--Me){const Ct=be[Me],_t=Ct&&Ct.name;if(!(typeof _t!="string"||Qe[Ke(_t)]))try{Z.removeAttribute(_t)}catch{}}},po=function(Z){const be=[Z];for(;be.length>0;){const Me=be.pop();(N?N(Me):Me.nodeType)===ts.element&&Do(Me);const _t=x(Me);if(_t)for(let rt=_t.length-1;rt>=0;--rt)be.push(_t[rt])}},fa=function(Z){if(!Re)return;const be=[Z];for(;be.length>0;){const Me=be.pop(),Ct=N?N(Me):Me.nodeType;if(Ct===ts.processingInstruction||Ct===ts.comment&&ca(mV,Me.data)){try{C(Me)}catch{}continue}if(Ct===ts.element){const rt=Me,rr=Ke(A?A(Me):Me.nodeName);try{rt.hasAttribute&&rt.hasAttribute("patchsrc")&&rt.removeAttribute("patchsrc"),rt.hasAttribute&&rt.hasAttribute("for")&&rr!=="label"&&rr!=="output"&&rt.removeAttribute("for")}catch{}}const _t=x(Me);if(_t)for(let rt=_t.length-1;rt>=0;--rt)be.push(_t[rt])}},Vi=function(Z){let be=null,Me=null;if(Vn)Z="<remove></remove>"+Z;else{const rt=aV(Z,/^[\r\n\t ]+/);Me=rt&&rt[0]}ie==="application/xhtml+xml"&&pr===Mr&&(Z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Z+"</body></html>");const Ct=P?J(Z):Z;if(pr===Mr)try{be=new m().parseFromString(Ct,ie)}catch{}if(!be||!be.documentElement){be=W.createDocument(pr,"template",null);try{be.documentElement.innerHTML=Rn?F:Ct}catch{}}const _t=be.body||be.documentElement;return Z&&Me&&_t.insertBefore(n.createTextNode(Me),_t.childNodes[0]||null),pr===Mr?le.call(be,ot?"html":"body")[0]:ot?be.documentElement:_t},Ui=function(Z){return ee.call(Z.ownerDocument||Z,Z,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},da=function(Z){return Z=z1(Z,ce," "),Z=z1(Z,ye," "),Z=z1(Z,Ce," "),Z},zi=function(Z){var be;Z.normalize();const Me=ee.call(Z.ownerDocument||Z,Z,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ct=Me.nextNode();for(;Ct;)Ct.data=da(Ct.data),Ct=Me.nextNode();const _t=(be=Z.querySelectorAll)===null||be===void 0?void 0:be.call(Z,"template");_t&&Op(_t,rt=>{Li(rt.content)&&zi(rt.content)})},ha=function(Z){const be=A?A(Z):null;return typeof be!="string"||Ke(be)!=="form"?!1:typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||Z.attributes!==L(Z)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function"||Z.nodeType!==N(Z)||Z.childNodes!==x(Z)},Li=function(Z){if(!N||typeof Z!="object"||Z===null)return!1;try{return N(Z)===ts.documentFragment}catch{return!1}},ri=function(Z){if(!N||typeof Z!="object"||Z===null)return!1;try{return typeof N(Z)=="number"}catch{return!1}};function Ur(nt,Z,be){nt.length!==0&&Op(nt,Me=>{Me.call(e,Z,be,Ut)})}const Hi=function(Z,be){return!!(Re&&Z.hasChildNodes()&&!ri(Z.firstElementChild)&&ca(pV,Z.textContent)&&ca(pV,Z.innerHTML)||Re&&Z.namespaceURI===Mr&&be==="style"&&ri(Z.firstElementChild)||Z.nodeType===ts.processingInstruction||Re&&Z.nodeType===ts.comment&&ca(mV,Z.data))},ii=function(Z,be){if(!Je[be]&&ga(be)&&(et.tagNameCheck instanceof RegExp&&ca(et.tagNameCheck,be)||et.tagNameCheck instanceof Function&&et.tagNameCheck(be)))return!1;if(Dn&&!gn[be]){const Me=k(Z),Ct=x(Z);if(Ct&&Me){const _t=Ct.length;for(let rt=_t-1;rt>=0;--rt){const rr=Ln?Ct[rt]:y(Ct[rt],!0);Me.insertBefore(rr,w(Z))}}}return Un(Z),!0},pa=function(Z,be){if(Ur(re.beforeSanitizeElements,Z,null),Z!==be&&k(Z)===null)return!0;if(ha(Z))return Un(Z),!0;const Me=Ke(A?A(Z):Z.nodeName);if(Ur(re.uponSanitizeElement,Z,{tagName:Me,allowedTags:Pe}),Z!==be&&k(Z)===null)return!0;if(Hi(Z,Me))return Un(Z),!0;if(Je[Me]||!(kt.tagCheck instanceof Function&&kt.tagCheck(Me))&&!Pe[Me]){const _t=ii(Z,Me);return _t===!1&&Ur(re.afterSanitizeElements,Z,null),_t}if((N?N(Z):Z.nodeType)===ts.element&&!vi(Z)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&ca(jue,Z.innerHTML))return Un(Z),!0;if(xe&&Z.nodeType===ts.text){const _t=da(Z.textContent);Z.textContent!==_t&&(Np(e.removed,{element:Z.cloneNode()}),Z.textContent=_t)}return Ur(re.afterSanitizeElements,Z,null),!1},ma=function(Z,be,Me){if(dt[be]||Re&&be==="patchsrc"||Re&&be==="for"&&Z!=="label"&&Z!=="output"||tn&&(be==="id"||be==="name")&&(Me in n||Me in Wt))return!1;const Ct=Qe[be]||kt.attributeCheck instanceof Function&&kt.attributeCheck(be,Z);if(!($t&&ca(ke,be))){if(!(ut&&ca(ge,be))){if(Ct){if(!ti[be]){if(!ca(Ye,z1(Me,We,""))){if(!((be==="src"||be==="xlink:href"||be==="href")&&Z!=="script"&&oV(Me,"data:")===0&&Di[Z])){if(!(Et&&!ca(we,z1(Me,We,"")))){if(Me)return!1}}}}}else if(!(ga(Z)&&(et.tagNameCheck instanceof RegExp&&ca(et.tagNameCheck,Z)||et.tagNameCheck instanceof Function&&et.tagNameCheck(Z))&&(et.attributeNameCheck instanceof RegExp&&ca(et.attributeNameCheck,be)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(be,Z))||be==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&ca(et.tagNameCheck,Me)||et.tagNameCheck instanceof Function&&et.tagNameCheck(Me))))return!1}}return!0},va=sr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ga=function(Z){return!va[U1(Z)]&&ca(Ge,Z)},mo=function(Z,be,Me,Ct){if(P&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Me)switch(g.getAttributeType(Z,be)){case"TrustedHTML":return J(Ct);case"TrustedScriptURL":return ae(Ct)}return Ct},Lo=function(Z,be,Me,Ct){try{Me?Z.setAttributeNS(Me,be,Ct):Z.setAttribute(be,Ct),ha(Z)?Un(Z):iV(e.removed)}catch{oi(be,Z)}},Po=function(Z){Ur(re.beforeSanitizeAttributes,Z,null);const be=Z.attributes;if(!be||ha(Z))return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Qe,forceKeepAttr:void 0};let Ct=be.length;const _t=Ke(Z.nodeName);for(;Ct--;){const rt=be[Ct],rr=rt.name,cn=rt.namespaceURI,zr=rt.value,yr=Ke(rr),Gr=zr;let bn=rr==="value"?Gr:Sue(Gr);if(Me.attrName=yr,Me.attrValue=bn,Me.keepAttr=!0,Me.forceKeepAttr=void 0,Ur(re.uponSanitizeAttribute,Z,Me),bn=Me.attrValue,dn&&(yr==="id"||yr==="name")&&oV(bn,_n)!==0&&(oi(rr,Z),bn=_n+bn),Re&&ca(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,bn)){oi(rr,Z);continue}if(yr==="attributename"&&aV(bn,"href")){oi(rr,Z);continue}if(!Me.forceKeepAttr){if(!Me.keepAttr){oi(rr,Z);continue}if(!vt&&ca(Vue,bn)){oi(rr,Z);continue}if(xe&&(bn=da(bn)),!ma(_t,yr,bn)){oi(rr,Z);continue}bn=mo(_t,yr,cn,bn),bn!==Gr&&Lo(Z,rr,cn,bn)}}Ur(re.afterSanitizeAttributes,Z,null)},Bi=function(Z){let be=null;const Me=Ui(Z);for(Ur(re.beforeSanitizeShadowDOM,Z,null);be=Me.nextNode();)if(Ur(re.uponSanitizeShadowNode,be,null),pa(be,Z),Po(be),Li(be.content)&&Bi(be.content),(N?N(be):be.nodeType)===ts.element){const _t=R(be);Li(_t)&&(ns(_t),Bi(_t))}Ur(re.afterSanitizeShadowDOM,Z,null)},ns=function(Z){const be=[{node:Z,shadow:null}];for(;be.length>0;){const Me=be.pop();if(Me.shadow){Bi(Me.shadow);continue}const Ct=Me.node,rt=(N?N(Ct):Ct.nodeType)===ts.element,rr=x(Ct);if(rr)for(let cn=rr.length-1;cn>=0;--cn)be.push({node:rr[cn],shadow:null});if(rt){const cn=A?A(Ct):null;if(typeof cn=="string"&&Ke(cn)==="template"){const zr=Ct.content;Li(zr)&&be.push({node:zr,shadow:null})}}if(rt){const cn=R(Ct);Li(cn)&&be.push({node:null,shadow:cn},{node:cn,shadow:null})}}};return e.sanitize=function(nt){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be=null,Me=null,Ct=null,_t=null;if(Rn=!nt,Rn&&(nt="<!-->"),typeof nt!="string"&&!ri(nt)&&(nt=wue(nt),typeof nt!="string"))throw rd("dirty is not a string, aborting");if(!e.isSupported)return nt;jt?(Pe=hr,Qe=An):Vt(Z),(re.uponSanitizeElement.length>0||re.uponSanitizeAttribute.length>0)&&(Pe=ho(Pe)),re.uponSanitizeAttribute.length>0&&(Qe=ho(Qe)),e.removed=[];const rt=Ln&&typeof nt!="string"&&ri(nt);if(rt){fa(nt);const yr=A?A(nt):nt.nodeName;if(typeof yr=="string"){const Gr=Ke(yr);if(!Pe[Gr]||Je[Gr])throw Ft(nt),rd("root node is forbidden and cannot be sanitized in-place")}if(ha(nt))throw Ft(nt),rd("root node is clobbered and cannot be sanitized in-place");try{ns(nt)}catch(Gr){throw Ft(nt),Gr}}else if(ri(nt))be=Vi("<!---->"),Me=be.ownerDocument.importNode(nt,!0),Me.nodeType===ts.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?be=Me:be.appendChild(Me),ns(Me);else{if(!tt&&!xe&&!ot&&nt.indexOf("<")===-1)return P&&pt?J(nt):nt;if(be=Vi(nt),!be)return tt?null:pt?F:""}be&&Vn&&Un(be.firstChild);const rr=rt?nt:be,cn=Ui(rr);try{for(;Ct=cn.nextNode();)pa(Ct,rr),Po(Ct),Li(Ct.content)&&Bi(Ct.content)}catch(yr){throw rt&&(Ft(nt),Op(e.removed,Gr=>{Gr.element&&po(Gr.element)})),yr}if(rt)return Op(e.removed,yr=>{yr.element&&po(yr.element)}),xe&&zi(nt),nt;if(tt){if(xe&&zi(be),ct)for(_t=X.call(be.ownerDocument);be.firstChild;)_t.appendChild(be.firstChild);else _t=be;return(Qe.shadowroot||Qe.shadowrootmode)&&(_t=ne.call(r,_t,!0)),_t}let zr=ot?be.outerHTML:be.innerHTML;return ot&&Pe["!doctype"]&&be.ownerDocument&&be.ownerDocument.doctype&&be.ownerDocument.doctype.name&&ca(Iue,be.ownerDocument.doctype.name)&&(zr="<!DOCTYPE "+be.ownerDocument.doctype.name+`>
|
|
1718
|
-
`+zr),xe&&(zr=da(zr)),P&&pt?J(zr):zr},e.setConfig=function(){let nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vt(nt),jt=!0,hr=Pe,An=Qe},e.clearConfig=function(){Ut=null,jt=!1,hr=null,An=null,P=U,F=""},e.isValidAttribute=function(nt,Z,be){Ut||Vt({});const Me=Ke(nt),Ct=Ke(Z);return ma(Me,Ct,be)},e.addHook=function(nt,Z){typeof Z=="function"&&ua(re,nt)&&Np(re[nt],Z)},e.removeHook=function(nt,Z){if(ua(re,nt)){if(Z!==void 0){const be=yue(re[nt],Z);return be===-1?void 0:bue(re[nt],be,1)[0]}return iV(re[nt])}},e.removeHooks=function(nt){ua(re,nt)&&(re[nt]=[])},e.removeAllHooks=function(){re=vV()},e}var yV=gV();const Hue=({previewImageInfo:t,setPreviewImageInfo:e,isPrivate:n=!1})=>{const[r,i]=D.useState(1),s=D.useRef(null),l=()=>{e(C6),i(1)};D.useEffect(()=>{const w=x=>{x.key==="Escape"&&l()};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[]);const{fileName:u,isOpen:d,loading:h,error:m,url:g,height:b,width:y}=t||{},C=D.useMemo(()=>g==null?void 0:g.split("?")[0].split("/").pop(),[g]);return T.jsx("div",{children:d&&T.jsxs("div",{className:"ed-overflow-hidden",children:[T.jsx("div",{className:"ed-h-full ed-w-full ed-z-[1000] ed-fixed ed-bg-black/80 ed-inset-0"}),T.jsxs("div",{className:"ed-size-full ed-flex items-center ed-w-full ed-h-full ed-justify-center ed-overflow-hidden ed-fixed ed-top-9 ed-left-0 ed-z-[1100]",children:[h?T.jsx(sp,{}):!m&&g&&T.jsx("div",{ref:s,style:{transform:`scale(${r})`,transformOrigin:"center center",transition:"transform 0.2s ease-out"},children:T.jsx(uo,{alt:"Feedback attachment",className:"ed-max-w-[90vw] ed-max-h-[90vh] ed-object-contain ed-select-none",height:b,src:g,width:y,isPrivate:n})}),m&&T.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-red",children:m})]}),T.jsxs("div",{className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-16 ed-flex ed-items-center ed-gap-3",children:[T.jsx("a",{href:`${g}&dl=${u||C}`,className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",title:"Download",children:T.jsx(Kx,{className:"ed-size-4",strokeWidth:"2"})}),T.jsx("button",{type:"button",className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-5 ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",onClick:l,title:"Close (Esc)",children:T.jsx(ms,{className:"ed-size-4",strokeWidth:"2"})})]}),!h&&!m&&T.jsx("div",{className:"ed-fixed ed-z-[1100] ed-bottom-5 ed-left-1/2 ed-transform -ed-translate-x-1/2",children:T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-bg-black/70 ed-rounded-lg ed-p-3",children:[T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(w=>Math.max(w/1.5,.5)),disabled:r<=.5,title:"Zoom Out",children:T.jsx(Tw,{className:"ed-size-5",strokeWidth:"2"})}),T.jsxs("span",{className:"ed-text-white ed-text-sm ed-min-w-[3rem] ed-text-center ed-font-medium",children:[Math.round(r*100),"%"]}),T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(w=>Math.min(w*1.5,5)),disabled:r>=5,title:"Zoom In",children:T.jsx(xw,{className:"ed-size-5",strokeWidth:"2"})}),T.jsx("div",{className:"ed-w-px ed-h-5 ed-bg-white/30 ed-mx-1"}),T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(1),title:"Reset",children:T.jsx(aw,{className:"ed-size-5",strokeWidth:"2"})})]})})]})})},Bue=({filesData:t=[]})=>{var b;const[e,n]=D.useState(!1),[r,i]=D.useState(C6),s=t==null?void 0:t.filter(y=>/\.(jpg|jpeg|png|gif|webp)$/i.test(y.name)),l=t==null?void 0:t.filter(y=>!/\.(jpg|jpeg|png|gif|webp)$/i.test(y.name)),u=()=>n(!0),d=e?s:s==null?void 0:s.slice(0,2),h=Nt.size(s)-2,m=y=>{try{const C=`${KG()}?id=${y}&download=true`;C&&window.open(C,"_blank")}catch(C){console.error(C)}},g=async y=>{i(C=>({...C,loading:!0}));try{const C=await ON({fit:"scale",isPrivate:!1,needActualSize:!0,path:y==null?void 0:y.key,quality:100});if(C){const w=await JG(C);i(x=>({...x,isOpen:!0,url:C,fileName:y==null?void 0:y.title,image:C,loading:!1,height:w==null?void 0:w.height,width:w==null?void 0:w.width}))}}catch{i({...C6,error:"Failed to load image"})}};return T.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-3",children:[Nt.size(s)>0&&T.jsxs("div",{className:"ed-grid ed-grid-cols-2 ed-gap-2.5",children:[d.map(y=>T.jsx("div",{onClick:()=>g(y),role:"button",tabIndex:0,children:T.jsx(uo,{path:y.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"})},y==null?void 0:y.id)),!e&&h>0&&T.jsxs("div",{role:"button",tabIndex:0,className:"ed-relative cursor-pointer",onClick:u,children:[T.jsx(uo,{path:(b=s[2])==null?void 0:b.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"}),T.jsx("div",{className:"ed-w-full ed-h-full ed-bg-black/15 ed-absolute ed-top-0 ed-left-0 ed-rounded",children:T.jsx("div",{className:"ed-bg-white ed-h-8 ed-w-8 ed-flex ed-items-center ed-justify-center ed-rounded-full ed-absolute ed-top-1/2 ed-left-1/2 ed--translate-x-1/2 ed--translate-y-1/2",children:T.jsxs("span",{className:"ed-text-12 ed-text-border-dark ed-font-semibold ed-truncate",children:["+",h]})})})]})]}),Nt.size(l)>0&&T.jsx("div",{className:"ed-flex ed-flex-col ed-gap-2.5",children:l.map(y=>T.jsxs("div",{className:"ed-p-2.5 ed-bg-white-light ed-rounded-lg ed-flex ed-items-center ed-gap-2 ed-justify-between",children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("div",{className:"ed-flex-shrink-0",children:T.jsx(Ute,{})}),T.jsx("p",{title:y.title,className:"ed-text-12 ed-font-semibold ed-text-border-dark",children:_6(y.title,20)})]}),T.jsx("button",{className:"ed-flex-shrink-0",type:"button",onClick:()=>m(y==null?void 0:y.id),children:T.jsx(Zx,{className:"ed-text-brand-link ed-size-5"})})]},y==null?void 0:y.id))}),(r==null?void 0:r.isOpen)&&T.jsx(Hue,{previewImageInfo:r,setPreviewImageInfo:i})]})},_T=({context:t,emails:e})=>T.jsxs("div",{className:"ed-flex ed-items-start ed-gap-2 ",children:[T.jsxs("p",{className:"ed-text-dark",children:[t,":"]}),T.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-1",children:e.slice(0,3).map((n,r)=>T.jsxs("p",{className:"ed-text-regular ed-flex ed-items-center ed-gap-2",children:[_6(n,30),r===2&&Nt.size(e)-3>0?T.jsx(uT,{classNames:{body:"ed-text-regular"},zIndex:99999999,placement:"top",title:e.join(", "),children:T.jsxs("span",{className:"ed-text-brand ed-cursor-pointer",children:["+",Nt.size(e)-3," more"]})}):""]},n))})]});var AS={exports:{}},que=AS.exports,bV;function $ue(){return bV||(bV=1,(function(t,e){(function(n,r){t.exports=r()})(que,(function(){return function(n,r,i){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(h,m,g,b){return s.fromToBase(h,m,g,b)}i.en.relativeTime=l,s.fromToBase=function(h,m,g,b,y){for(var C,w,x,k=g.$locale().relativeTime||l,R=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],L=R.length,N=0;N<L;N+=1){var A=R[N];A.d&&(C=b?i(h).diff(g,A.d,!0):g.diff(h,A.d,!0));var P=(n.rounding||Math.round)(Math.abs(C));if(x=C>0,P<=A.r||!A.r){P<=1&&N>0&&(A=R[N-1]);var F=k[A.l];y&&(P=y(""+P)),w=typeof F=="string"?F.replace("%d",P):F(P,m,A.l,x);break}}if(m)return w;var U=x?k.future:k.past;return typeof U=="function"?U(w):U.replace("%s",w)},s.to=function(h,m){return u(h,m,this,!0)},s.from=function(h,m){return u(h,m,this)};var d=function(h){return h.$u?i.utc():i()};s.toNow=function(h){return this.to(d(this),h)},s.fromNow=function(h){return this.from(d(this),h)}}}))})(AS)),AS.exports}var Wue=$ue();const Gue=ou(Wue);gu.extend(Gue);const Yue=async(t,e)=>{const{policy:n,file:r}=t||{};return(await Bw(n,r)).success?{name:t==null?void 0:t.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:e,type:"conversation_activity_attachment"}:{}},Kue=async(t,e)=>{var r;const n=[];try{const i=[];for(let s=0;s<t.length;s+=1)(r=t[s])!=null&&r.id||i.push(Yue(t[s],e));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),ai("error","File upload fails","top-left")}return n};function Que(t){if(!t)return"";const e=gu(t),n=gu();return e.isValid()?n.diff(e,"minute")<1?"Just now":e.fromNow():""}const Zue={open:{label:"Open",className:"ed-bg-[#DDF2FF] ed-text-[#1173C8] ed-border ed-border-[#A4D1F1] ed-rounded-full"},resolved:{label:"Resolved",className:"ed-bg-[#DBF8E2] ed-text-[#0E9342] ed-border ed-border-[#96D4AB] ed-rounded-full"}},Jue=t=>{if(!t)return"";if(typeof window>"u")return t;const e=yV.sanitize(t,{FORBID_TAGS:["script"],FORBID_ATTR:["style","class"]}),n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText||""},Xue=(t=[],e=!1)=>{const n=[],r=[],i=[];return Nt.forEach(t,s=>{(s==null?void 0:s.type)==="to_email"&&(e?!(s!=null&&s.is_channel)&&!n.includes(s==null?void 0:s.email)&&n.push(s==null?void 0:s.email):n.push(s==null?void 0:s.email)),(s==null?void 0:s.type)==="cc_email"&&(e?Nt.some(r,{person_email:s==null?void 0:s.email})||r.push({person_email:s==null?void 0:s.email}):r.push(s==null?void 0:s.email)),(s==null?void 0:s.type)==="bcc_email"&&i.push(s==null?void 0:s.email)}),{toEmails:n,ccEmails:r,bccEmails:i}},ece="hh:mm A",SV=({activityMessage:t={},brand:e={},aiAgentName:n="",aiAgentIconKey:r="",isReplying:i=!1})=>{const{emails:s=[],user:l,files:u,message:d,is_customer_reply:h,is_auto_response:m,is_ai_response:g,created_at:b,metadata:y={},isInitiatedWithAi:C=!1}=t||{},[w,x]=D.useState(!1),k=()=>{x(!w)},{toEmails:R,ccEmails:L,bccEmails:N}=Xue(s),A=C&&(y==null?void 0:y.current_stage)!=="agent_chat"&&(g||m)||g,P=D.useMemo(()=>A?(y==null?void 0:y.ai_agent_name)||n||"Eden AI bot":l!=null&&l.id?R0(l==null?void 0:l.first_name,l==null?void 0:l.last_name,l==null?void 0:l.email):(e==null?void 0:e.name)||"",[l==null?void 0:l.id,g,m,y==null?void 0:y.current_stage,n,y==null?void 0:y.ai_agent_name]),F=D.useMemo(()=>l!=null&&l.id?{...(l==null?void 0:l.avatar_file)||{},default_image_name:xl(l==null?void 0:l.first_name,l==null?void 0:l.last_name,l==null?void 0:l.email)}:{key:e==null?void 0:e.logo_icon_key,default_image_name:xl(e==null?void 0:e.name)},[l==null?void 0:l.id]),U=D.useMemo(()=>i||!d?"":yV.sanitize(d,{ADD_ATTR:["class","className","style","target","rel","href"],ADD_TAGS:["div","h6","p","span","a","ul","li"]}),[d,i]),q=!i&&u1(U),Y=Array.isArray(q)||D.isValidElement(q),te=Y?"div":"p",J=D.useMemo(()=>Y?(Array.isArray(q)?q:[q]).some(H=>{var W,ee;return(ee=(W=H==null?void 0:H.props)==null?void 0:W.className)==null?void 0:ee.includes("form-response")}):!1,[q,Y]),ae=()=>q?T.jsxs("div",{className:`ed-p-2.5 ${h?"ed-bg-blue-light":"ed-bg-white-light"} ${J?"ed-p-0 ed-bg-white":""} ed-rounded-lg ed-mt-2 ed-text-[13px]`,children:[T.jsxs(te,{className:`ed-text-border-dark ${J||Y?"":"ed-whitespace-pre-line ed-break-words"}`,children:[Nt.size(s)>0&&T.jsxs("div",{className:"ed-border-b ed-pb-2",children:[T.jsxs("button",{type:"button",onClick:k,className:"ed-flex ed-gap-1 ed-text-regular ed-items-center",children:[T.jsx("span",{children:w?T.jsx(ib,{className:"ed-size-4"}):T.jsx(Jh,{className:"ed-size-4"})})," ",T.jsxs("span",{children:[w?"Hide":"View"," recipient"]})]}),w&&T.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-2 ed-mt-2",children:[Nt.size(R)>0&&T.jsx(_T,{context:"To",emails:R}),Nt.size(L)>0&&T.jsx(_T,{context:"CC",emails:L}),Nt.size(N)>0&&T.jsx(_T,{context:"BCC",emails:N})]})]}),T.jsx("div",{className:"ed-mt-2 ed-text-dark ed-tiptap ProseMirror ed-chat-body",children:q})]}),T.jsx(Bue,{filesData:u})]}):null;return h?T.jsx("div",{className:"ed-max-w-[85%] ed-w-max ed-ml-auto",children:T.jsx(ae,{})}):T.jsxs("div",{className:"ed-flex ed-gap-2.5 ed-my-4 ed-max-w-[85%] ed-w-max",children:[T.jsx("div",{className:"ed-size-7 ed-flex-shrink-0",children:A?T.jsx(V1,{iconKey:r}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full",alt:P,defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:F==null?void 0:F.key,defaultImageName:F==null?void 0:F.default_image_name})}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px] ed-truncate",children:P}),T.jsx("span",{className:"ed-text-border ed-text-[13px] ed-font-medium ed-shrink-0",children:gu(b).format(ece)})]}),i?T.jsx("div",{className:"ed-py-4",children:T.jsx(sp,{})}):T.jsx(ae,{})]})]})},RS={recommend_from_knowledge_base:`<div>
|
|
1718
|
+
`+zr),xe&&(zr=da(zr)),P&&pt?J(zr):zr},e.setConfig=function(){let nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vt(nt),jt=!0,hr=Pe,An=Qe},e.clearConfig=function(){Ut=null,jt=!1,hr=null,An=null,P=U,F=""},e.isValidAttribute=function(nt,Z,be){Ut||Vt({});const Me=Ke(nt),Ct=Ke(Z);return ma(Me,Ct,be)},e.addHook=function(nt,Z){typeof Z=="function"&&ua(re,nt)&&Np(re[nt],Z)},e.removeHook=function(nt,Z){if(ua(re,nt)){if(Z!==void 0){const be=yue(re[nt],Z);return be===-1?void 0:bue(re[nt],be,1)[0]}return iV(re[nt])}},e.removeHooks=function(nt){ua(re,nt)&&(re[nt]=[])},e.removeAllHooks=function(){re=vV()},e}var yV=gV();const Hue=({previewImageInfo:t,setPreviewImageInfo:e,isPrivate:n=!1})=>{const[r,i]=D.useState(1),s=D.useRef(null),l=()=>{e(C6),i(1)};D.useEffect(()=>{const w=x=>{x.key==="Escape"&&l()};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[]);const{fileName:u,isOpen:d,loading:h,error:m,url:g,height:b,width:y}=t||{},C=D.useMemo(()=>g==null?void 0:g.split("?")[0].split("/").pop(),[g]);return T.jsx("div",{children:d&&T.jsxs("div",{className:"ed-overflow-hidden",children:[T.jsx("div",{className:"ed-h-full ed-w-full ed-z-[1000] ed-fixed ed-bg-black/80 ed-inset-0"}),T.jsxs("div",{className:"ed-size-full ed-flex items-center ed-w-full ed-h-full ed-justify-center ed-overflow-hidden ed-fixed ed-top-9 ed-left-0 ed-z-[1100]",children:[h?T.jsx(sp,{}):!m&&g&&T.jsx("div",{ref:s,style:{transform:`scale(${r})`,transformOrigin:"center center",transition:"transform 0.2s ease-out"},children:T.jsx(uo,{alt:"Feedback attachment",className:"ed-max-w-[90vw] ed-max-h-[90vh] ed-object-contain ed-select-none",height:b,src:g,width:y,isPrivate:n})}),m&&T.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-red",children:m})]}),T.jsxs("div",{className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-16 ed-flex ed-items-center ed-gap-3",children:[T.jsx("a",{href:`${g}&dl=${u||C}`,className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",title:"Download",children:T.jsx(Kx,{className:"ed-size-4",strokeWidth:"2"})}),T.jsx("button",{type:"button",className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-5 ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",onClick:l,title:"Close (Esc)",children:T.jsx(ms,{className:"ed-size-4",strokeWidth:"2"})})]}),!h&&!m&&T.jsx("div",{className:"ed-fixed ed-z-[1100] ed-bottom-5 ed-left-1/2 ed-transform -ed-translate-x-1/2",children:T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-bg-black/70 ed-rounded-lg ed-p-3",children:[T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(w=>Math.max(w/1.5,.5)),disabled:r<=.5,title:"Zoom Out",children:T.jsx(Tw,{className:"ed-size-5",strokeWidth:"2"})}),T.jsxs("span",{className:"ed-text-white ed-text-sm ed-min-w-[3rem] ed-text-center ed-font-medium",children:[Math.round(r*100),"%"]}),T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(w=>Math.min(w*1.5,5)),disabled:r>=5,title:"Zoom In",children:T.jsx(xw,{className:"ed-size-5",strokeWidth:"2"})}),T.jsx("div",{className:"ed-w-px ed-h-5 ed-bg-white/30 ed-mx-1"}),T.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(1),title:"Reset",children:T.jsx(aw,{className:"ed-size-5",strokeWidth:"2"})})]})})]})})},Bue=({filesData:t=[]})=>{var b;const[e,n]=D.useState(!1),[r,i]=D.useState(C6),s=t==null?void 0:t.filter(y=>/\.(jpg|jpeg|png|gif|webp)$/i.test(y.name)),l=t==null?void 0:t.filter(y=>!/\.(jpg|jpeg|png|gif|webp)$/i.test(y.name)),u=()=>n(!0),d=e?s:s==null?void 0:s.slice(0,2),h=Nt.size(s)-2,m=y=>{try{const C=`${KG()}?id=${y}&download=true`;C&&window.open(C,"_blank")}catch(C){console.error(C)}},g=async y=>{i(C=>({...C,loading:!0}));try{const C=await ON({fit:"scale",isPrivate:!1,needActualSize:!0,path:y==null?void 0:y.key,quality:100});if(C){const w=await JG(C);i(x=>({...x,isOpen:!0,url:C,fileName:y==null?void 0:y.title,image:C,loading:!1,height:w==null?void 0:w.height,width:w==null?void 0:w.width}))}}catch{i({...C6,error:"Failed to load image"})}};return T.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-3",children:[Nt.size(s)>0&&T.jsxs("div",{className:"ed-grid ed-grid-cols-2 ed-gap-2.5",children:[d.map(y=>T.jsx("div",{onClick:()=>g(y),role:"button",tabIndex:0,children:T.jsx(uo,{path:y.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"})},y==null?void 0:y.id)),!e&&h>0&&T.jsxs("div",{role:"button",tabIndex:0,className:"ed-relative cursor-pointer",onClick:u,children:[T.jsx(uo,{path:(b=s[2])==null?void 0:b.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"}),T.jsx("div",{className:"ed-w-full ed-h-full ed-bg-black/15 ed-absolute ed-top-0 ed-left-0 ed-rounded",children:T.jsx("div",{className:"ed-bg-white ed-h-8 ed-w-8 ed-flex ed-items-center ed-justify-center ed-rounded-full ed-absolute ed-top-1/2 ed-left-1/2 ed--translate-x-1/2 ed--translate-y-1/2",children:T.jsxs("span",{className:"ed-text-12 ed-text-border-dark ed-font-semibold ed-truncate",children:["+",h]})})})]})]}),Nt.size(l)>0&&T.jsx("div",{className:"ed-flex ed-flex-col ed-gap-2.5",children:l.map(y=>T.jsxs("div",{className:"ed-p-2.5 ed-bg-white-light ed-rounded-lg ed-flex ed-items-center ed-gap-2 ed-justify-between",children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("div",{className:"ed-flex-shrink-0",children:T.jsx(Ute,{})}),T.jsx("p",{title:y.title,className:"ed-text-12 ed-font-semibold ed-text-border-dark",children:_6(y.title,20)})]}),T.jsx("button",{className:"ed-flex-shrink-0",type:"button",onClick:()=>m(y==null?void 0:y.id),children:T.jsx(Zx,{className:"ed-text-brand-link ed-size-5"})})]},y==null?void 0:y.id))}),(r==null?void 0:r.isOpen)&&T.jsx(Hue,{previewImageInfo:r,setPreviewImageInfo:i})]})},_T=({context:t,emails:e})=>T.jsxs("div",{className:"ed-flex ed-items-start ed-gap-2 ",children:[T.jsxs("p",{className:"ed-text-dark",children:[t,":"]}),T.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-1",children:e.slice(0,3).map((n,r)=>T.jsxs("p",{className:"ed-text-regular ed-flex ed-items-center ed-gap-2",children:[_6(n,30),r===2&&Nt.size(e)-3>0?T.jsx(uT,{classNames:{body:"ed-text-regular"},zIndex:99999999,placement:"top",title:e.join(", "),children:T.jsxs("span",{className:"ed-text-brand ed-cursor-pointer",children:["+",Nt.size(e)-3," more"]})}):""]},n))})]});var AS={exports:{}},que=AS.exports,bV;function $ue(){return bV||(bV=1,(function(t,e){(function(n,r){t.exports=r()})(que,(function(){return function(n,r,i){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(h,m,g,b){return s.fromToBase(h,m,g,b)}i.en.relativeTime=l,s.fromToBase=function(h,m,g,b,y){for(var C,w,x,k=g.$locale().relativeTime||l,R=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],L=R.length,N=0;N<L;N+=1){var A=R[N];A.d&&(C=b?i(h).diff(g,A.d,!0):g.diff(h,A.d,!0));var P=(n.rounding||Math.round)(Math.abs(C));if(x=C>0,P<=A.r||!A.r){P<=1&&N>0&&(A=R[N-1]);var F=k[A.l];y&&(P=y(""+P)),w=typeof F=="string"?F.replace("%d",P):F(P,m,A.l,x);break}}if(m)return w;var U=x?k.future:k.past;return typeof U=="function"?U(w):U.replace("%s",w)},s.to=function(h,m){return u(h,m,this,!0)},s.from=function(h,m){return u(h,m,this)};var d=function(h){return h.$u?i.utc():i()};s.toNow=function(h){return this.to(d(this),h)},s.fromNow=function(h){return this.from(d(this),h)}}}))})(AS)),AS.exports}var Wue=$ue();const Gue=ou(Wue);gu.extend(Gue);const Yue=async(t,e)=>{const{policy:n,file:r}=t||{};return(await Bw(n,r)).success?{name:t==null?void 0:t.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:e,type:"conversation_activity_attachment"}:{}},Kue=async(t,e)=>{var r;const n=[];try{const i=[];for(let s=0;s<t.length;s+=1)(r=t[s])!=null&&r.id||i.push(Yue(t[s],e));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),ai("error","File upload fails","top-left")}return n};function Que(t){if(!t)return"";const e=gu(t),n=gu();return e.isValid()?n.diff(e,"minute")<1?"Just now":e.fromNow():""}const Zue={open:{label:"Open",className:"ed-bg-[#DDF2FF] ed-text-[#1173C8] ed-border ed-border-[#A4D1F1] ed-rounded-full"},resolved:{label:"Resolved",className:"ed-bg-[#DBF8E2] ed-text-[#0E9342] ed-border ed-border-[#96D4AB] ed-rounded-full"}},Jue=t=>{if(!t)return"";if(typeof window>"u")return t;const e=yV.sanitize(t,{FORBID_TAGS:["script"],FORBID_ATTR:["style","class"]}),n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText||""},Xue=(t=[],e=!1)=>{const n=[],r=[],i=[];return Nt.forEach(t,s=>{(s==null?void 0:s.type)==="to_email"&&(e?!(s!=null&&s.is_channel)&&!n.includes(s==null?void 0:s.email)&&n.push(s==null?void 0:s.email):n.push(s==null?void 0:s.email)),(s==null?void 0:s.type)==="cc_email"&&(e?Nt.some(r,{person_email:s==null?void 0:s.email})||r.push({person_email:s==null?void 0:s.email}):r.push(s==null?void 0:s.email)),(s==null?void 0:s.type)==="bcc_email"&&i.push(s==null?void 0:s.email)}),{toEmails:n,ccEmails:r,bccEmails:i}},ece="hh:mm A",SV=({activityMessage:t={},brand:e={},aiAgentName:n="",aiAgentIconKey:r="",isReplying:i=!1})=>{const{emails:s=[],user:l,files:u,message:d,is_customer_reply:h,is_auto_response:m,is_ai_response:g,created_at:b,metadata:y={},isInitiatedWithAi:C=!1}=t||{},[w,x]=D.useState(!1),k=()=>{x(!w)},{toEmails:R,ccEmails:L,bccEmails:N}=Xue(s),A=g||C&&m,P=D.useMemo(()=>A?(y==null?void 0:y.ai_agent_name)||n||"Eden AI bot":l!=null&&l.id?R0(l==null?void 0:l.first_name,l==null?void 0:l.last_name,l==null?void 0:l.email):(e==null?void 0:e.name)||"",[l==null?void 0:l.id,g,m,y==null?void 0:y.current_stage,n,y==null?void 0:y.ai_agent_name]),F=D.useMemo(()=>l!=null&&l.id?{...(l==null?void 0:l.avatar_file)||{},default_image_name:xl(l==null?void 0:l.first_name,l==null?void 0:l.last_name,l==null?void 0:l.email)}:{key:e==null?void 0:e.logo_icon_key,default_image_name:xl(e==null?void 0:e.name)},[l==null?void 0:l.id]),U=D.useMemo(()=>i||!d?"":yV.sanitize(d,{ADD_ATTR:["class","className","style","target","rel","href"],ADD_TAGS:["div","h6","p","span","a","ul","li"]}),[d,i]),q=!i&&u1(U),Y=Array.isArray(q)||D.isValidElement(q),te=Y?"div":"p",J=D.useMemo(()=>Y?(Array.isArray(q)?q:[q]).some(H=>{var W,ee;return(ee=(W=H==null?void 0:H.props)==null?void 0:W.className)==null?void 0:ee.includes("form-response")}):!1,[q,Y]),ae=()=>q?T.jsxs("div",{className:`ed-p-2.5 ${h?"ed-bg-blue-light":"ed-bg-white-light"} ${J?"ed-p-0 ed-bg-white":""} ed-rounded-lg ed-mt-2 ed-text-[13px]`,children:[T.jsxs(te,{className:`ed-text-border-dark ${J||Y?"":"ed-whitespace-pre-line ed-break-words"}`,children:[Nt.size(s)>0&&T.jsxs("div",{className:"ed-border-b ed-pb-2",children:[T.jsxs("button",{type:"button",onClick:k,className:"ed-flex ed-gap-1 ed-text-regular ed-items-center",children:[T.jsx("span",{children:w?T.jsx(ib,{className:"ed-size-4"}):T.jsx(Jh,{className:"ed-size-4"})})," ",T.jsxs("span",{children:[w?"Hide":"View"," recipient"]})]}),w&&T.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-2 ed-mt-2",children:[Nt.size(R)>0&&T.jsx(_T,{context:"To",emails:R}),Nt.size(L)>0&&T.jsx(_T,{context:"CC",emails:L}),Nt.size(N)>0&&T.jsx(_T,{context:"BCC",emails:N})]})]}),T.jsx("div",{className:"ed-mt-2 ed-text-dark ed-tiptap ProseMirror ed-chat-body",children:q})]}),T.jsx(Bue,{filesData:u})]}):null;return h?T.jsx("div",{className:"ed-max-w-[85%] ed-w-max ed-ml-auto",children:T.jsx(ae,{})}):T.jsxs("div",{className:"ed-flex ed-gap-2.5 ed-my-4 ed-max-w-[85%] ed-w-max",children:[T.jsx("div",{className:"ed-size-7 ed-flex-shrink-0",children:A?T.jsx(V1,{iconKey:r}):T.jsx(uo,{className:"ed-size-7 ed-object-cover ed-rounded-full",alt:P,defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:F==null?void 0:F.key,defaultImageName:F==null?void 0:F.default_image_name})}),T.jsxs("div",{children:[T.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[T.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px] ed-truncate",children:P}),T.jsx("span",{className:"ed-text-border ed-text-[13px] ed-font-medium ed-shrink-0",children:gu(b).format(ece)})]}),i?T.jsx("div",{className:"ed-py-4",children:T.jsx(sp,{})}):T.jsx(ae,{})]})]})},RS={recommend_from_knowledge_base:`<div>
|
|
1719
1719
|
<div style="font-size: 14px; line-height: 1.6;">
|
|
1720
1720
|
{{ai_summary}}
|
|
1721
1721
|
</div>
|
package/npm/ed-widget.js
CHANGED
|
@@ -1514,7 +1514,7 @@ If anything else comes up, I'm just one message away. 👋`,channelConnecting:"P
|
|
|
1514
1514
|
</div>
|
|
1515
1515
|
</div>`,is_customer_reply:!0},{message:q,is_auto_response:!0,current_stage:re}];await gy(600,1e3);const{data:ue}=await _({variables:{inputData:{type:"chat",contact_person_name:C==null?void 0:C.contact_person_name,contact_person_email:C==null?void 0:C.contact_person_email,conversation_activities:se,is_initiated_with_ai:y}}}),ne=ue==null?void 0:ue.createAConversationForPortal;ne!=null&&ne.id&&(n(ne==null?void 0:ne.id),C1("easydesk_chat_widget_conversation_id",ne==null?void 0:ne.id,{expires:30}),e==null||e({contact_person_name:C==null?void 0:C.contact_person_name,contact_person_email:C==null?void 0:C.contact_person_email}))}catch(W){const G={EMAIL_IS_SUPPRESSED:"This email address is currently unreachable"},{message:q,response:re}=W,se=G[q]||((Z=re==null?void 0:re.data)==null?void 0:Z.message);$t("error",se,"top-left"),b(!1)}finally{k(!1)}},U=j=>{const{name:Y,value:B}=j.target;A(Z=>({...Z,[Y]:B}))},P=O.useMemo(()=>!(C!=null&&C.contact_person_name)||!(C!=null&&C.contact_person_email)||!ic(C==null?void 0:C.contact_person_email)||w||V||T,[C,w,V,T]);return S.jsxs("div",{className:"ed-space-y-5 ed-px-5 ed-pt-1",children:[p&&!v&&S.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%]",children:[y?S.jsx($c,{iconKey:a}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:qi(i==null?void 0:i.name)}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:y?o||"Eden AI":i==null?void 0:i.name}),S.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:Co().format("HH:mm")})]}),S.jsx("div",{className:"ed-py-4",children:S.jsx(Ys,{})})]})]}),c&&!v&&S.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%] ed-animate-fadeInUp",children:[y?S.jsx($c,{iconKey:a}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:qi(i==null?void 0:i.name)}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:y?o||"Eden AI":i==null?void 0:i.name}),S.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:Co().format("HH:mm")})]}),S.jsx("div",{className:"ed-p-2.5 ed-bg-white-light ed-text-[13px] ed-rounded-lg ed-mt-2",children:S.jsx("p",{className:"ed-text-border-dark",children:z?Dt.initial.greetingOnline:Dt.initial.greetingOffline})})]})]}),d&&!v&&S.jsx("div",{className:"ed-max-w-[85%] ed-ml-auto ed-animate-fadeInUp",children:S.jsxs("form",{onSubmit:Q,className:"ed-p-5 ed-rounded-[20px] ed-bg-white-light ed-space-y-5",children:[S.jsxs("div",{className:"ed-space-y-2",children:[S.jsxs("label",{className:"ed-block ed-text-border-dark ed-text-14 ed-font-semibold",children:["Name ",S.jsx("span",{className:"ed-text-red ed-text-14 ed-font-semibold",children:"*"})]}),S.jsx("input",{type:"text",name:"contact_person_name",required:!0,placeholder:"Enter your name",value:C==null?void 0:C.contact_person_name,onChange:U,disabled:s,className:"ed-w-full ed-p-2.5 ed-px-4 ed-border ed-border-border-light ed-rounded-lg ed-outline-none ed-bg-white ed-text-14 ed-font-normal"})]}),S.jsx("div",{className:"ed-space-y-2",children:S.jsx(Gg,{label:"Email",name:"contact_person_email",value:C==null?void 0:C.contact_person_email,onChange:U,checkEmails:F,onSuppressionChange:R,placeholder:"Enter your email",disabled:s,className:"ed-w-full ed-py-2.5 ed-px-4 ed-pl-4 ed-border ed-border-border-light ed-rounded-lg ed-outline-none ed-bg-white ed-text-14 ed-font-normal",required:!0})}),S.jsx("div",{className:"ed-flex ed-justify-end",children:S.jsx(La,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:P,loader:w,callBack:Q})})]})}),v&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%]",children:[y?S.jsx($c,{iconKey:a}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:qi(i==null?void 0:i.name)}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:y?o||"Eden AI bot":i==null?void 0:i.name}),S.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:Co().format("HH:mm")})]}),S.jsx("div",{className:"ed-p-2.5 ed-bg-white-light ed-text-[13px] ed-rounded-lg ed-mt-2",children:S.jsx("p",{className:"ed-text-border-dark",children:z?Dt.initial.greetingOnline:Dt.initial.greetingOffline})})]})]}),S.jsx("div",{className:"ed-max-w-[85%] ed-ml-auto ed-animate-fadeInUp",children:S.jsxs("div",{className:"ed-p-5 ed-rounded-[20px] ed-bg-blue-50 ed-border ed-border-blue-100",style:{borderRadius:"20px",border:"1px solid #e3f2fd",backgroundColor:"#e3f2fd",padding:"20px"},children:[S.jsxs("div",{style:{marginBottom:"20px"},children:[S.jsx("h6",{style:{fontSize:"13px",fontWeight:"600",color:"#3b3b3b",margin:0,padding:0},children:"Name"}),S.jsx("p",{style:{fontSize:"13px",color:"#797979"},children:C==null?void 0:C.contact_person_name})]}),S.jsxs("div",{children:[S.jsx("h6",{style:{fontSize:"13px",fontWeight:"600",color:"#3b3b3b",margin:0,padding:0},children:"Email"}),S.jsx("p",{style:{fontSize:"13px",color:"#797979",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:C==null?void 0:C.contact_person_email})]})]})}),S.jsxs("div",{className:"ed-flex ed-gap-4 ed-max-w-[85%] ed-animate-fadeIn",children:[y?S.jsx($c,{iconKey:a}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full ed-flex-shrink-0",defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:i==null?void 0:i.logo_icon_key,defaultImageName:qi(i==null?void 0:i.name)}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px]",children:y?o||"Eden AI bot":i==null?void 0:i.name}),S.jsx("span",{className:"ed-text-border ed-font-medium ed-text-[13px]",children:Co().format("HH:mm")})]}),S.jsx("div",{className:"ed-py-4",children:S.jsx(Ys,{})})]})]})]})]})};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function Sx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TG(e){if(Array.isArray(e))return e}function OG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function NG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1516
1516
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RG(e,t){return TG(e)||OG(e,t)||IG(e,t)||NG()}function IG(e,t){if(e){if(typeof e=="string")return Sx(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sx(e,t):void 0}}const Ex=Object.entries,Cx=Object.setPrototypeOf,PG=Object.isFrozen,MG=Object.getPrototypeOf,LG=Object.getOwnPropertyDescriptor;let er=Object.freeze,tr=Object.seal,pl=Object.create,wx=typeof Reflect<"u"&&Reflect,vy=wx.apply,yy=wx.construct;er||(er=function(t){return t}),tr||(tr=function(t){return t}),vy||(vy=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(n,i)}),yy||(yy=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const ml=Tn(Array.prototype.forEach),FG=Tn(Array.prototype.lastIndexOf),_x=Tn(Array.prototype.pop),gl=Tn(Array.prototype.push),jG=Tn(Array.prototype.splice),na=Array.isArray,eu=Tn(String.prototype.toLowerCase),by=Tn(String.prototype.toString),xx=Tn(String.prototype.match),tu=Tn(String.prototype.replace),Ax=Tn(String.prototype.indexOf),DG=Tn(String.prototype.trim),VG=Tn(Number.prototype.toString),UG=Tn(Boolean.prototype.toString),kx=typeof BigInt>"u"?null:Tn(BigInt.prototype.toString),Tx=typeof Symbol>"u"?null:Tn(Symbol.prototype.toString),Yn=Tn(Object.prototype.hasOwnProperty),nu=Tn(Object.prototype.toString),Kn=Tn(RegExp.prototype.test),Ba=BG(TypeError);function Tn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return vy(e,t,r)}}function BG(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return yy(e,n)}}function wt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eu;if(Cx&&Cx(e,null),!na(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(PG(t)||(t[r]=o),i=o)}e[i]=!0}return e}function zG(e){for(let t=0;t<e.length;t++)Yn(e,t)||(e[t]=null);return e}function Cr(e){const t=pl(null);for(const r of Ex(e)){var n=RG(r,2);const i=n[0],o=n[1];Yn(e,i)&&(na(o)?t[i]=zG(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=Cr(o):t[i]=o)}return t}function HG(e){switch(typeof e){case"string":return e;case"number":return VG(e);case"boolean":return UG(e);case"bigint":return kx?kx(e):"0";case"symbol":return Tx?Tx(e):"Symbol()";case"undefined":return nu(e);case"function":case"object":{if(e===null)return nu(e);const t=e,n=no(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:nu(r)}return nu(e)}default:return nu(e)}}function no(e,t){for(;e!==null;){const r=LG(e,t);if(r){if(r.get)return Tn(r.get);if(typeof r.value=="function")return Tn(r.value)}e=MG(e)}function n(){return null}return n}function WG(e){try{return Kn(e,""),!0}catch{return!1}}const Ox=er(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Sy=er(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ey=er(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),GG=er(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Cy=er(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),YG=er(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nx=er(["#text"]),Rx=er(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),wy=er(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ix=er(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),th=er(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),KG=tr(/{{[\w\W]*|^[\w\W]*}}/g),ZG=tr(/<%[\w\W]*|^[\w\W]*%>/g),QG=tr(/\${[\w\W]*/g),JG=tr(/^data-[\-\w.\u00B7-\uFFFF]+$/),qG=tr(/^aria-[\-\w]+$/),Px=tr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),XG=tr(/^(?:\w+script|data):/i),$G=tr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eY=tr(/^html$/i),tY=tr(/^[a-z][.\w]*(-[.\w]+)+$/i),Mx=tr(/<[/\w!]/g),Lx=tr(/<[/\w]/g),nY=tr(/<\/no(script|embed|frames)/i),rY=tr(/\/>/i),Zr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},iY=function(){return typeof window>"u"?null:window},oY=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Fx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ra=function(t,n,r,i){return Yn(t,n)&&na(t[n])?wt(i.base?Cr(i.base):{},t[n],i.transform):r};function jx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iY();const t=_e=>jx(_e);if(t.version="3.4.12",t.removed=[],!e||!e.document||e.document.nodeType!==Zr.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,a=e.Node,s=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,h=e.trustedTypes,p=s.prototype,m=no(p,"cloneNode"),v=no(p,"remove"),b=no(p,"nextSibling"),y=no(p,"childNodes"),E=no(p,"parentNode"),C=no(p,"shadowRoot"),A=no(p,"attributes"),_=a&&a.prototype?no(a.prototype,"nodeType"):null,w=a&&a.prototype?no(a.prototype,"nodeName"):null;if(typeof o=="function"){const _e=n.createElement("template");_e.content&&_e.content.ownerDocument&&(n=_e.content.ownerDocument)}let k,T="",R,F=!1,V=0;const H=function(){if(V>0)throw Ba('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(D){H(),V++;try{return k.createHTML(D)}finally{V--}},Q=function(D){H(),V++;try{return k.createScriptURL(D)}finally{V--}},U=function(){return F||(R=oY(h,i),F=!0),R},P=n,j=P.implementation,Y=P.createNodeIterator,B=P.createDocumentFragment,Z=P.getElementsByTagName,W=r.importNode;let G=Fx();t.isSupported=typeof Ex=="function"&&typeof E=="function"&&j&&j.createHTMLDocument!==void 0;const q=KG,re=ZG,se=QG,ue=JG,ne=qG,de=XG,Se=$G,Ce=tY;let we=Px,pe=null;const X=wt({},[...Ox,...Sy,...Ey,...Cy,...Nx]);let xe=null;const be=wt({},[...Rx,...wy,...Ix,...th]);let Te=Object.seal(pl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Le=null;const ze=Object.seal(pl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Oe=!0,ct=!0,We=!1,He=!0,le=!1,fe=!0,Pe=!1,ot=!1,Sn=null,At=null,Vt=!1,sn=!1,_t=!1,St=!1,On=!0,En=!1;const Nn="user-content-";let hr=!0,ln=!1,Cn={},Zn=null;const ji=wt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Di=null;const Vi=wt({},["audio","video","img","source","image","track"]);let Qr=null;const pr=wt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),en="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",pn="http://www.w3.org/1999/xhtml";let Zt=pn,Et=!1,vt=null;const mn=wt({},[en,Ht,pn],by),nr=er(["mi","mo","mn","ms","mtext"]);let Rn=wt({},nr);const Ut=er(["annotation-xml"]);let Pr=wt({},Ut);const Jr=wt({},["title","style","font","a","script"]);let yt=null;const Xt=["application/xhtml+xml","text/html"],Ln="text/html";let rt=null,Fn=null;const ro=n.createElement("form"),rr=function(D){return D instanceof RegExp||D instanceof Function},Qn=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fn&&Fn===D)return;(!D||typeof D!="object")&&(D={}),D=Cr(D),yt=Xt.indexOf(D.PARSER_MEDIA_TYPE)===-1?Ln:D.PARSER_MEDIA_TYPE,rt=yt==="application/xhtml+xml"?by:eu,pe=ra(D,"ALLOWED_TAGS",X,{transform:rt}),xe=ra(D,"ALLOWED_ATTR",be,{transform:rt}),vt=ra(D,"ALLOWED_NAMESPACES",mn,{transform:by}),Qr=ra(D,"ADD_URI_SAFE_ATTR",pr,{transform:rt,base:pr}),Di=ra(D,"ADD_DATA_URI_TAGS",Vi,{transform:rt,base:Vi}),Zn=ra(D,"FORBID_CONTENTS",ji,{transform:rt}),ke=ra(D,"FORBID_TAGS",Cr({}),{transform:rt}),Le=ra(D,"FORBID_ATTR",Cr({}),{transform:rt}),Cn=Yn(D,"USE_PROFILES")?D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?Cr(D.USE_PROFILES):D.USE_PROFILES:!1,Oe=D.ALLOW_ARIA_ATTR!==!1,ct=D.ALLOW_DATA_ATTR!==!1,We=D.ALLOW_UNKNOWN_PROTOCOLS||!1,He=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=D.SAFE_FOR_TEMPLATES||!1,fe=D.SAFE_FOR_XML!==!1,Pe=D.WHOLE_DOCUMENT||!1,sn=D.RETURN_DOM||!1,_t=D.RETURN_DOM_FRAGMENT||!1,St=D.RETURN_TRUSTED_TYPE||!1,Vt=D.FORCE_BODY||!1,On=D.SANITIZE_DOM!==!1,En=D.SANITIZE_NAMED_PROPS||!1,hr=D.KEEP_CONTENT!==!1,ln=D.IN_PLACE||!1,we=WG(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:Px,Zt=typeof D.NAMESPACE=="string"?D.NAMESPACE:pn,Rn=Yn(D,"MATHML_TEXT_INTEGRATION_POINTS")&&D.MATHML_TEXT_INTEGRATION_POINTS&&typeof D.MATHML_TEXT_INTEGRATION_POINTS=="object"?Cr(D.MATHML_TEXT_INTEGRATION_POINTS):wt({},nr),Pr=Yn(D,"HTML_INTEGRATION_POINTS")&&D.HTML_INTEGRATION_POINTS&&typeof D.HTML_INTEGRATION_POINTS=="object"?Cr(D.HTML_INTEGRATION_POINTS):wt({},Ut);const ie=Yn(D,"CUSTOM_ELEMENT_HANDLING")&&D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING=="object"?Cr(D.CUSTOM_ELEMENT_HANDLING):pl(null);if(Te=pl(null),Yn(ie,"tagNameCheck")&&rr(ie.tagNameCheck)&&(Te.tagNameCheck=ie.tagNameCheck),Yn(ie,"attributeNameCheck")&&rr(ie.attributeNameCheck)&&(Te.attributeNameCheck=ie.attributeNameCheck),Yn(ie,"allowCustomizedBuiltInElements")&&typeof ie.allowCustomizedBuiltInElements=="boolean"&&(Te.allowCustomizedBuiltInElements=ie.allowCustomizedBuiltInElements),tr(Te),le&&(ct=!1),_t&&(sn=!0),Cn&&(pe=wt({},Nx),xe=pl(null),Cn.html===!0&&(wt(pe,Ox),wt(xe,Rx)),Cn.svg===!0&&(wt(pe,Sy),wt(xe,wy),wt(xe,th)),Cn.svgFilters===!0&&(wt(pe,Ey),wt(xe,wy),wt(xe,th)),Cn.mathMl===!0&&(wt(pe,Cy),wt(xe,Ix),wt(xe,th))),ze.tagCheck=null,ze.attributeCheck=null,Yn(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?ze.tagCheck=D.ADD_TAGS:na(D.ADD_TAGS)&&(pe===X&&(pe=Cr(pe)),wt(pe,D.ADD_TAGS,rt))),Yn(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?ze.attributeCheck=D.ADD_ATTR:na(D.ADD_ATTR)&&(xe===be&&(xe=Cr(xe)),wt(xe,D.ADD_ATTR,rt))),Yn(D,"ADD_URI_SAFE_ATTR")&&na(D.ADD_URI_SAFE_ATTR)&&wt(Qr,D.ADD_URI_SAFE_ATTR,rt),Yn(D,"FORBID_CONTENTS")&&na(D.FORBID_CONTENTS)&&(Zn===ji&&(Zn=Cr(Zn)),wt(Zn,D.FORBID_CONTENTS,rt)),Yn(D,"ADD_FORBID_CONTENTS")&&na(D.ADD_FORBID_CONTENTS)&&(Zn===ji&&(Zn=Cr(Zn)),wt(Zn,D.ADD_FORBID_CONTENTS,rt)),hr&&(pe["#text"]=!0),Pe&&wt(pe,["html","head","body"]),pe.table&&(wt(pe,["tbody"]),delete ke.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ye=k;k=D.TRUSTED_TYPES_POLICY;try{T=z("")}catch(Fe){throw k=ye,Fe}}else D.TRUSTED_TYPES_POLICY===null?(k=void 0,T=""):(k===void 0&&(k=U()),k&&typeof T=="string"&&(T=z("")));er&&er(D),Fn=D},wr=wt({},[...Sy,...Ey,...GG]),mr=wt({},[...Cy,...YG]),io=function(D,ie,ye){return ie.namespaceURI===pn?D==="svg":ie.namespaceURI===en?D==="svg"&&(ye==="annotation-xml"||Rn[ye]):!!wr[D]},Wt=function(D,ie,ye){return ie.namespaceURI===pn?D==="math":ie.namespaceURI===Ht?D==="math"&&Pr[ye]:!!mr[D]},Ui=function(D,ie,ye){return ie.namespaceURI===Ht&&!Pr[ye]||ie.namespaceURI===en&&!Rn[ye]?!1:!mr[D]&&(Jr[D]||!wr[D])},Bi=function(D){let ie=E(D);(!ie||!ie.tagName)&&(ie={namespaceURI:Zt,tagName:"template"});const ye=eu(D.tagName),Fe=eu(ie.tagName);return vt[D.namespaceURI]?D.namespaceURI===Ht?io(ye,ie,Fe):D.namespaceURI===en?Wt(ye,ie,Fe):D.namespaceURI===pn?Ui(ye,ie,Fe):!!(yt==="application/xhtml+xml"&&vt[D.namespaceURI]):!1},Mr=function(D){gl(t.removed,{element:D});try{E(D).removeChild(D)}catch{if(v(D),!E(D))throw Ba("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ir=function(D){oo(D);const ie=y(D);if(ie){const Fe=[];ml(ie,Ue=>{gl(Fe,Ue)}),ml(Fe,Ue=>{try{v(Ue)}catch{}})}const ye=A(D);if(ye)for(let Fe=ye.length-1;Fe>=0;--Fe){const Ue=ye[Fe],Ge=Ue&&Ue.name;if(typeof Ge=="string")try{D.removeAttribute(Ge)}catch{}}},Lr=function(D,ie){try{gl(t.removed,{attribute:ie.getAttributeNode(D),from:ie})}catch{gl(t.removed,{attribute:null,from:ie})}if(ie.removeAttribute(D),D==="is")if(sn||_t)try{Mr(ie)}catch{}else try{ie.setAttribute(D,"")}catch{}},za=function(D){const ie=A(D);if(ie)for(let ye=ie.length-1;ye>=0;--ye){const Fe=ie[ye],Ue=Fe&&Fe.name;if(!(typeof Ue!="string"||xe[rt(Ue)]))try{D.removeAttribute(Ue)}catch{}}},oo=function(D){const ie=[D];for(;ie.length>0;){const ye=ie.pop();(_?_(ye):ye.nodeType)===Zr.element&&za(ye);const Ue=y(ye);if(Ue)for(let Ge=Ue.length-1;Ge>=0;--Ge)ie.push(Ue[Ge])}},_o=function(D){if(!fe)return;const ie=[D];for(;ie.length>0;){const ye=ie.pop(),Fe=_?_(ye):ye.nodeType;if(Fe===Zr.processingInstruction||Fe===Zr.comment&&Kn(Lx,ye.data)){try{v(ye)}catch{}continue}if(Fe===Zr.element){const Ge=ye,Bt=rt(w?w(ye):ye.nodeName);try{Ge.hasAttribute&&Ge.hasAttribute("patchsrc")&&Ge.removeAttribute("patchsrc"),Ge.hasAttribute&&Ge.hasAttribute("for")&&Bt!=="label"&&Bt!=="output"&&Ge.removeAttribute("for")}catch{}}const Ue=y(ye);if(Ue)for(let Ge=Ue.length-1;Ge>=0;--Ge)ie.push(Ue[Ge])}},qr=function(D){let ie=null,ye=null;if(Vt)D="<remove></remove>"+D;else{const Ge=xx(D,/^[\r\n\t ]+/);ye=Ge&&Ge[0]}yt==="application/xhtml+xml"&&Zt===pn&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const Fe=k?z(D):D;if(Zt===pn)try{ie=new d().parseFromString(Fe,yt)}catch{}if(!ie||!ie.documentElement){ie=j.createDocument(Zt,"template",null);try{ie.documentElement.innerHTML=Et?T:Fe}catch{}}const Ue=ie.body||ie.documentElement;return D&&ye&&Ue.insertBefore(n.createTextNode(ye),Ue.childNodes[0]||null),Zt===pn?Z.call(ie,Pe?"html":"body")[0]:Pe?ie.documentElement:Ue},Xr=function(D){return Y.call(D.ownerDocument||D,D,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},yi=function(D){return D=tu(D,q," "),D=tu(D,re," "),D=tu(D,se," "),D},$r=function(D){var ie;D.normalize();const ye=Y.call(D.ownerDocument||D,D,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Fe=ye.nextNode();for(;Fe;)Fe.data=yi(Fe.data),Fe=ye.nextNode();const Ue=(ie=D.querySelectorAll)===null||ie===void 0?void 0:ie.call(D,"template");Ue&&ml(Ue,Ge=>{_r(Ge.content)&&$r(Ge.content)})},bi=function(D){const ie=w?w(D):null;return typeof ie!="string"||rt(ie)!=="form"?!1:typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||D.attributes!==A(D)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function"||D.nodeType!==_(D)||D.childNodes!==y(D)},_r=function(D){if(!_||typeof D!="object"||D===null)return!1;try{return _(D)===Zr.documentFragment}catch{return!1}},In=function(D){if(!_||typeof D!="object"||D===null)return!1;try{return typeof _(D)=="number"}catch{return!1}};function gn(_e,D,ie){_e.length!==0&&ml(_e,ye=>{ye.call(t,D,ie,Fn)})}const ei=function(D,ie){return!!(fe&&D.hasChildNodes()&&!In(D.firstElementChild)&&Kn(Mx,D.textContent)&&Kn(Mx,D.innerHTML)||fe&&D.namespaceURI===pn&&ie==="style"&&In(D.firstElementChild)||D.nodeType===Zr.processingInstruction||fe&&D.nodeType===Zr.comment&&Kn(Lx,D.data))},Fr=function(D,ie){if(!ke[ie]&&so(ie)&&(Te.tagNameCheck instanceof RegExp&&Kn(Te.tagNameCheck,ie)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(ie)))return!1;if(hr&&!Zn[ie]){const ye=E(D),Fe=y(D);if(Fe&&ye){const Ue=Fe.length;for(let Ge=Ue-1;Ge>=0;--Ge){const Bt=ln?Fe[Ge]:m(Fe[Ge],!0);ye.insertBefore(Bt,b(D))}}}return Mr(D),!0},ao=function(D,ie){if(gn(G.beforeSanitizeElements,D,null),D!==ie&&E(D)===null)return!0;if(bi(D))return Mr(D),!0;const ye=rt(w?w(D):D.nodeName);if(gn(G.uponSanitizeElement,D,{tagName:ye,allowedTags:pe}),D!==ie&&E(D)===null)return!0;if(ei(D,ye))return Mr(D),!0;if(ke[ye]||!(ze.tagCheck instanceof Function&&ze.tagCheck(ye))&&!pe[ye]){const Ue=Fr(D,ye);return Ue===!1&&gn(G.afterSanitizeElements,D,null),Ue}if((_?_(D):D.nodeType)===Zr.element&&!Bi(D)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&Kn(nY,D.innerHTML))return Mr(D),!0;if(le&&D.nodeType===Zr.text){const Ue=yi(D.textContent);D.textContent!==Ue&&(gl(t.removed,{element:D.cloneNode()}),D.textContent=Ue)}return gn(G.afterSanitizeElements,D,null),!1},xo=function(D,ie,ye){if(Le[ie]||fe&&ie==="patchsrc"||fe&&ie==="for"&&D!=="label"&&D!=="output"||On&&(ie==="id"||ie==="name")&&(ye in n||ye in ro))return!1;const Fe=xe[ie]||ze.attributeCheck instanceof Function&&ze.attributeCheck(ie,D);if(!(ct&&Kn(ue,ie))){if(!(Oe&&Kn(ne,ie))){if(Fe){if(!Qr[ie]){if(!Kn(we,tu(ye,Se,""))){if(!((ie==="src"||ie==="xlink:href"||ie==="href")&&D!=="script"&&Ax(ye,"data:")===0&&Di[D])){if(!(We&&!Kn(de,tu(ye,Se,"")))){if(ye)return!1}}}}}else if(!(so(D)&&(Te.tagNameCheck instanceof RegExp&&Kn(Te.tagNameCheck,D)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(D))&&(Te.attributeNameCheck instanceof RegExp&&Kn(Te.attributeNameCheck,ie)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(ie,D))||ie==="is"&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&Kn(Te.tagNameCheck,ye)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(ye))))return!1}}return!0},zi=wt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),so=function(D){return!zi[eu(D)]&&Kn(Ce,D)},ia=function(D,ie,ye,Fe){if(k&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!ye)switch(h.getAttributeType(D,ie)){case"TrustedHTML":return z(Fe);case"TrustedScriptURL":return Q(Fe)}return Fe},oa=function(D,ie,ye,Fe){try{ye?D.setAttributeNS(ye,ie,Fe):D.setAttribute(ie,Fe),bi(D)?Mr(D):_x(t.removed)}catch{Lr(ie,D)}},Ao=function(D){gn(G.beforeSanitizeAttributes,D,null);const ie=D.attributes;if(!ie||bi(D))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let Fe=ie.length;const Ue=rt(D.nodeName);for(;Fe--;){const Ge=ie[Fe],Bt=Ge.name,kt=Ge.namespaceURI,wn=Ge.value,cn=rt(Bt),un=wn;let Qt=Bt==="value"?un:DG(un);if(ye.attrName=cn,ye.attrValue=Qt,ye.keepAttr=!0,ye.forceKeepAttr=void 0,gn(G.uponSanitizeAttribute,D,ye),Qt=ye.attrValue,En&&(cn==="id"||cn==="name")&&Ax(Qt,Nn)!==0&&(Lr(Bt,D),Qt=Nn+Qt),fe&&Kn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qt)){Lr(Bt,D);continue}if(cn==="attributename"&&xx(Qt,"href")){Lr(Bt,D);continue}if(!ye.forceKeepAttr){if(!ye.keepAttr){Lr(Bt,D);continue}if(!He&&Kn(rY,Qt)){Lr(Bt,D);continue}if(le&&(Qt=yi(Qt)),!xo(Ue,cn,Qt)){Lr(Bt,D);continue}Qt=ia(Ue,cn,kt,Qt),Qt!==un&&oa(D,Bt,kt,Qt)}}gn(G.afterSanitizeAttributes,D,null)},ti=function(D){let ie=null;const ye=Xr(D);for(gn(G.beforeSanitizeShadowDOM,D,null);ie=ye.nextNode();)if(gn(G.uponSanitizeShadowNode,ie,null),ao(ie,D),Ao(ie),_r(ie.content)&&ti(ie.content),(_?_(ie):ie.nodeType)===Zr.element){const Ue=C(ie);_r(Ue)&&(ko(Ue),ti(Ue))}gn(G.afterSanitizeShadowDOM,D,null)},ko=function(D){const ie=[{node:D,shadow:null}];for(;ie.length>0;){const ye=ie.pop();if(ye.shadow){ti(ye.shadow);continue}const Fe=ye.node,Ge=(_?_(Fe):Fe.nodeType)===Zr.element,Bt=y(Fe);if(Bt)for(let kt=Bt.length-1;kt>=0;--kt)ie.push({node:Bt[kt],shadow:null});if(Ge){const kt=w?w(Fe):null;if(typeof kt=="string"&&rt(kt)==="template"){const wn=Fe.content;_r(wn)&&ie.push({node:wn,shadow:null})}}if(Ge){const kt=C(Fe);_r(kt)&&ie.push({node:null,shadow:kt},{node:kt,shadow:null})}}};return t.sanitize=function(_e){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=null,ye=null,Fe=null,Ue=null;if(Et=!_e,Et&&(_e="<!-->"),typeof _e!="string"&&!In(_e)&&(_e=HG(_e),typeof _e!="string"))throw Ba("dirty is not a string, aborting");if(!t.isSupported)return _e;ot?(pe=Sn,xe=At):Qn(D),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(pe=Cr(pe)),G.uponSanitizeAttribute.length>0&&(xe=Cr(xe)),t.removed=[];const Ge=ln&&typeof _e!="string"&&In(_e);if(Ge){_o(_e);const cn=w?w(_e):_e.nodeName;if(typeof cn=="string"){const un=rt(cn);if(!pe[un]||ke[un])throw ir(_e),Ba("root node is forbidden and cannot be sanitized in-place")}if(bi(_e))throw ir(_e),Ba("root node is clobbered and cannot be sanitized in-place");try{ko(_e)}catch(un){throw ir(_e),un}}else if(In(_e))ie=qr("<!---->"),ye=ie.ownerDocument.importNode(_e,!0),ye.nodeType===Zr.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?ie=ye:ie.appendChild(ye),ko(ye);else{if(!sn&&!le&&!Pe&&_e.indexOf("<")===-1)return k&&St?z(_e):_e;if(ie=qr(_e),!ie)return sn?null:St?T:""}ie&&Vt&&Mr(ie.firstChild);const Bt=Ge?_e:ie,kt=Xr(Bt);try{for(;Fe=kt.nextNode();)ao(Fe,Bt),Ao(Fe),_r(Fe.content)&&ti(Fe.content)}catch(cn){throw Ge&&(ir(_e),ml(t.removed,un=>{un.element&&oo(un.element)})),cn}if(Ge)return ml(t.removed,cn=>{cn.element&&oo(cn.element)}),le&&$r(_e),_e;if(sn){if(le&&$r(ie),_t)for(Ue=B.call(ie.ownerDocument);ie.firstChild;)Ue.appendChild(ie.firstChild);else Ue=ie;return(xe.shadowroot||xe.shadowrootmode)&&(Ue=W.call(r,Ue,!0)),Ue}let wn=Pe?ie.outerHTML:ie.innerHTML;return Pe&&pe["!doctype"]&&ie.ownerDocument&&ie.ownerDocument.doctype&&ie.ownerDocument.doctype.name&&Kn(eY,ie.ownerDocument.doctype.name)&&(wn="<!DOCTYPE "+ie.ownerDocument.doctype.name+`>
|
|
1517
|
-
`+wn),le&&(wn=yi(wn)),k&&St?z(wn):wn},t.setConfig=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qn(_e),ot=!0,Sn=pe,At=xe},t.clearConfig=function(){Fn=null,ot=!1,Sn=null,At=null,k=R,T=""},t.isValidAttribute=function(_e,D,ie){Fn||Qn({});const ye=rt(_e),Fe=rt(D);return xo(ye,Fe,ie)},t.addHook=function(_e,D){typeof D=="function"&&Yn(G,_e)&&gl(G[_e],D)},t.removeHook=function(_e,D){if(Yn(G,_e)){if(D!==void 0){const ie=FG(G[_e],D);return ie===-1?void 0:jG(G[_e],ie,1)[0]}return _x(G[_e])}},t.removeHooks=function(_e){Yn(G,_e)&&(G[_e]=[])},t.removeAllHooks=function(){G=Fx()},t}var Dx=jx();const aY=({previewImageInfo:e,setPreviewImageInfo:t,isPrivate:n=!1})=>{const[r,i]=O.useState(1),o=O.useRef(null),a=()=>{t(w1),i(1)};O.useEffect(()=>{const b=y=>{y.key==="Escape"&&a()};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[]);const{fileName:s,isOpen:c,loading:u,error:d,url:h,height:p,width:m}=e||{},v=O.useMemo(()=>h==null?void 0:h.split("?")[0].split("/").pop(),[h]);return S.jsx("div",{children:c&&S.jsxs("div",{className:"ed-overflow-hidden",children:[S.jsx("div",{className:"ed-h-full ed-w-full ed-z-[1000] ed-fixed ed-bg-black/80 ed-inset-0"}),S.jsxs("div",{className:"ed-size-full ed-flex items-center ed-w-full ed-h-full ed-justify-center ed-overflow-hidden ed-fixed ed-top-9 ed-left-0 ed-z-[1100]",children:[u?S.jsx(Ys,{}):!d&&h&&S.jsx("div",{ref:o,style:{transform:`scale(${r})`,transformOrigin:"center center",transition:"transform 0.2s ease-out"},children:S.jsx(br,{alt:"Feedback attachment",className:"ed-max-w-[90vw] ed-max-h-[90vh] ed-object-contain ed-select-none",height:p,src:h,width:m,isPrivate:n})}),d&&S.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-red",children:d})]}),S.jsxs("div",{className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-16 ed-flex ed-items-center ed-gap-3",children:[S.jsx("a",{href:`${h}&dl=${s||v}`,className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",title:"Download",children:S.jsx(Jm,{className:"ed-size-4",strokeWidth:"2"})}),S.jsx("button",{type:"button",className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-5 ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",onClick:a,title:"Close (Esc)",children:S.jsx(di,{className:"ed-size-4",strokeWidth:"2"})})]}),!u&&!d&&S.jsx("div",{className:"ed-fixed ed-z-[1100] ed-bottom-5 ed-left-1/2 ed-transform -ed-translate-x-1/2",children:S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-bg-black/70 ed-rounded-lg ed-p-3",children:[S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(b=>Math.max(b/1.5,.5)),disabled:r<=.5,title:"Zoom Out",children:S.jsx(kg,{className:"ed-size-5",strokeWidth:"2"})}),S.jsxs("span",{className:"ed-text-white ed-text-sm ed-min-w-[3rem] ed-text-center ed-font-medium",children:[Math.round(r*100),"%"]}),S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(b=>Math.min(b*1.5,5)),disabled:r>=5,title:"Zoom In",children:S.jsx(xg,{className:"ed-size-5",strokeWidth:"2"})}),S.jsx("div",{className:"ed-w-px ed-h-5 ed-bg-white/30 ed-mx-1"}),S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(1),title:"Reset",children:S.jsx(ag,{className:"ed-size-5",strokeWidth:"2"})})]})})]})})},sY=({filesData:e=[]})=>{var p;const[t,n]=O.useState(!1),[r,i]=O.useState(w1),o=e==null?void 0:e.filter(m=>/\.(jpg|jpeg|png|gif|webp)$/i.test(m.name)),a=e==null?void 0:e.filter(m=>!/\.(jpg|jpeg|png|gif|webp)$/i.test(m.name)),s=()=>n(!0),c=t?o:o==null?void 0:o.slice(0,2),u=De.size(o)-2,d=m=>{try{const v=`${hN()}?id=${m}&download=true`;v&&window.open(v,"_blank")}catch(v){console.error(v)}},h=async m=>{i(v=>({...v,loading:!0}));try{const v=await J5({fit:"scale",isPrivate:!1,needActualSize:!0,path:m==null?void 0:m.key,quality:100});if(v){const b=await gN(v);i(y=>({...y,isOpen:!0,url:v,fileName:m==null?void 0:m.title,image:v,loading:!1,height:b==null?void 0:b.height,width:b==null?void 0:b.width}))}}catch{i({...w1,error:"Failed to load image"})}};return S.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-3",children:[De.size(o)>0&&S.jsxs("div",{className:"ed-grid ed-grid-cols-2 ed-gap-2.5",children:[c.map(m=>S.jsx("div",{onClick:()=>h(m),role:"button",tabIndex:0,children:S.jsx(br,{path:m.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"})},m==null?void 0:m.id)),!t&&u>0&&S.jsxs("div",{role:"button",tabIndex:0,className:"ed-relative cursor-pointer",onClick:s,children:[S.jsx(br,{path:(p=o[2])==null?void 0:p.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"}),S.jsx("div",{className:"ed-w-full ed-h-full ed-bg-black/15 ed-absolute ed-top-0 ed-left-0 ed-rounded",children:S.jsx("div",{className:"ed-bg-white ed-h-8 ed-w-8 ed-flex ed-items-center ed-justify-center ed-rounded-full ed-absolute ed-top-1/2 ed-left-1/2 ed--translate-x-1/2 ed--translate-y-1/2",children:S.jsxs("span",{className:"ed-text-12 ed-text-border-dark ed-font-semibold ed-truncate",children:["+",u]})})})]})]}),De.size(a)>0&&S.jsx("div",{className:"ed-flex ed-flex-col ed-gap-2.5",children:a.map(m=>S.jsxs("div",{className:"ed-p-2.5 ed-bg-white-light ed-rounded-lg ed-flex ed-items-center ed-gap-2 ed-justify-between",children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("div",{className:"ed-flex-shrink-0",children:S.jsx(iD,{})}),S.jsx("p",{title:m.title,className:"ed-text-12 ed-font-semibold ed-text-border-dark",children:_1(m.title,20)})]}),S.jsx("button",{className:"ed-flex-shrink-0",type:"button",onClick:()=>d(m==null?void 0:m.id),children:S.jsx(Xm,{className:"ed-text-brand-link ed-size-5"})})]},m==null?void 0:m.id))}),(r==null?void 0:r.isOpen)&&S.jsx(aY,{previewImageInfo:r,setPreviewImageInfo:i})]})},_y=({context:e,emails:t})=>S.jsxs("div",{className:"ed-flex ed-items-start ed-gap-2 ",children:[S.jsxs("p",{className:"ed-text-dark",children:[e,":"]}),S.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-1",children:t.slice(0,3).map((n,r)=>S.jsxs("p",{className:"ed-text-regular ed-flex ed-items-center ed-gap-2",children:[_1(n,30),r===2&&De.size(t)-3>0?S.jsx(uy,{classNames:{body:"ed-text-regular"},zIndex:99999999,placement:"top",title:t.join(", "),children:S.jsxs("span",{className:"ed-text-brand ed-cursor-pointer",children:["+",De.size(t)-3," more"]})}):""]},n))})]});var nh={exports:{}},lY=nh.exports,Vx;function cY(){return Vx||(Vx=1,(function(e,t){(function(n,r){e.exports=r()})(lY,(function(){return function(n,r,i){n=n||{};var o=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(u,d,h,p){return o.fromToBase(u,d,h,p)}i.en.relativeTime=a,o.fromToBase=function(u,d,h,p,m){for(var v,b,y,E=h.$locale().relativeTime||a,C=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],A=C.length,_=0;_<A;_+=1){var w=C[_];w.d&&(v=p?i(u).diff(h,w.d,!0):h.diff(u,w.d,!0));var k=(n.rounding||Math.round)(Math.abs(v));if(y=v>0,k<=w.r||!w.r){k<=1&&_>0&&(w=C[_-1]);var T=E[w.l];m&&(k=m(""+k)),b=typeof T=="string"?T.replace("%d",k):T(k,d,w.l,y);break}}if(d)return b;var R=y?E.future:E.past;return typeof R=="function"?R(b):R.replace("%s",b)},o.to=function(u,d){return s(u,d,this,!0)},o.from=function(u,d){return s(u,d,this)};var c=function(u){return u.$u?i.utc():i()};o.toNow=function(u){return this.to(c(this),u)},o.fromNow=function(u){return this.from(c(this),u)}}}))})(nh)),nh.exports}var uY=cY();const dY=wa(uY);Co.extend(dY);const fY=async(e,t)=>{const{policy:n,file:r}=e||{};return(await Wg(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},hY=async(e,t)=>{var r;const n=[];try{const i=[];for(let o=0;o<e.length;o+=1)(r=e[o])!=null&&r.id||i.push(fY(e[o],t));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),$t("error","File upload fails","top-left")}return n};function pY(e){if(!e)return"";const t=Co(e),n=Co();return t.isValid()?n.diff(t,"minute")<1?"Just now":t.fromNow():""}const mY={open:{label:"Open",className:"ed-bg-[#DDF2FF] ed-text-[#1173C8] ed-border ed-border-[#A4D1F1] ed-rounded-full"},resolved:{label:"Resolved",className:"ed-bg-[#DBF8E2] ed-text-[#0E9342] ed-border ed-border-[#96D4AB] ed-rounded-full"}},gY=e=>{if(!e)return"";if(typeof window>"u")return e;const t=Dx.sanitize(e,{FORBID_TAGS:["script"],FORBID_ATTR:["style","class"]}),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""},vY=(e=[],t=!1)=>{const n=[],r=[],i=[];return De.forEach(e,o=>{(o==null?void 0:o.type)==="to_email"&&(t?!(o!=null&&o.is_channel)&&!n.includes(o==null?void 0:o.email)&&n.push(o==null?void 0:o.email):n.push(o==null?void 0:o.email)),(o==null?void 0:o.type)==="cc_email"&&(t?De.some(r,{person_email:o==null?void 0:o.email})||r.push({person_email:o==null?void 0:o.email}):r.push(o==null?void 0:o.email)),(o==null?void 0:o.type)==="bcc_email"&&i.push(o==null?void 0:o.email)}),{toEmails:n,ccEmails:r,bccEmails:i}},yY="hh:mm A",Ux=({activityMessage:e={},brand:t={},aiAgentName:n="",aiAgentIconKey:r="",isReplying:i=!1})=>{const{emails:o=[],user:a,files:s,message:c,is_customer_reply:u,is_auto_response:d,is_ai_response:h,created_at:p,metadata:m={},isInitiatedWithAi:v=!1}=e||{},[b,y]=O.useState(!1),E=()=>{y(!b)},{toEmails:C,ccEmails:A,bccEmails:_}=vY(o),w=v&&(m==null?void 0:m.current_stage)!=="agent_chat"&&(h||d)||h,k=O.useMemo(()=>w?(m==null?void 0:m.ai_agent_name)||n||"Eden AI bot":a!=null&&a.id?nd(a==null?void 0:a.first_name,a==null?void 0:a.last_name,a==null?void 0:a.email):(t==null?void 0:t.name)||"",[a==null?void 0:a.id,h,d,m==null?void 0:m.current_stage,n,m==null?void 0:m.ai_agent_name]),T=O.useMemo(()=>a!=null&&a.id?{...(a==null?void 0:a.avatar_file)||{},default_image_name:qi(a==null?void 0:a.first_name,a==null?void 0:a.last_name,a==null?void 0:a.email)}:{key:t==null?void 0:t.logo_icon_key,default_image_name:qi(t==null?void 0:t.name)},[a==null?void 0:a.id]),R=O.useMemo(()=>i||!c?"":Dx.sanitize(c,{ADD_ATTR:["class","className","style","target","rel","href"],ADD_TAGS:["div","h6","p","span","a","ul","li"]}),[c,i]),F=!i&&wc(R),V=Array.isArray(F)||O.isValidElement(F),H=V?"div":"p",z=O.useMemo(()=>V?(Array.isArray(F)?F:[F]).some(P=>{var j,Y;return(Y=(j=P==null?void 0:P.props)==null?void 0:j.className)==null?void 0:Y.includes("form-response")}):!1,[F,V]),Q=()=>F?S.jsxs("div",{className:`ed-p-2.5 ${u?"ed-bg-blue-light":"ed-bg-white-light"} ${z?"ed-p-0 ed-bg-white":""} ed-rounded-lg ed-mt-2 ed-text-[13px]`,children:[S.jsxs(H,{className:`ed-text-border-dark ${z||V?"":"ed-whitespace-pre-line ed-break-words"}`,children:[De.size(o)>0&&S.jsxs("div",{className:"ed-border-b ed-pb-2",children:[S.jsxs("button",{type:"button",onClick:E,className:"ed-flex ed-gap-1 ed-text-regular ed-items-center",children:[S.jsx("span",{children:b?S.jsx(Id,{className:"ed-size-4"}):S.jsx(js,{className:"ed-size-4"})})," ",S.jsxs("span",{children:[b?"Hide":"View"," recipient"]})]}),b&&S.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-2 ed-mt-2",children:[De.size(C)>0&&S.jsx(_y,{context:"To",emails:C}),De.size(A)>0&&S.jsx(_y,{context:"CC",emails:A}),De.size(_)>0&&S.jsx(_y,{context:"BCC",emails:_})]})]}),S.jsx("div",{className:"ed-mt-2 ed-text-dark ed-tiptap ProseMirror ed-chat-body",children:F})]}),S.jsx(sY,{filesData:s})]}):null;return u?S.jsx("div",{className:"ed-max-w-[85%] ed-w-max ed-ml-auto",children:S.jsx(Q,{})}):S.jsxs("div",{className:"ed-flex ed-gap-2.5 ed-my-4 ed-max-w-[85%] ed-w-max",children:[S.jsx("div",{className:"ed-size-7 ed-flex-shrink-0",children:w?S.jsx($c,{iconKey:r}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full",alt:k,defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:T==null?void 0:T.key,defaultImageName:T==null?void 0:T.default_image_name})}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px] ed-truncate",children:k}),S.jsx("span",{className:"ed-text-border ed-text-[13px] ed-font-medium ed-shrink-0",children:Co(p).format(yY)})]}),i?S.jsx("div",{className:"ed-py-4",children:S.jsx(Ys,{})}):S.jsx(Q,{})]})]})},rh={recommend_from_knowledge_base:`<div>
|
|
1517
|
+
`+wn),le&&(wn=yi(wn)),k&&St?z(wn):wn},t.setConfig=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qn(_e),ot=!0,Sn=pe,At=xe},t.clearConfig=function(){Fn=null,ot=!1,Sn=null,At=null,k=R,T=""},t.isValidAttribute=function(_e,D,ie){Fn||Qn({});const ye=rt(_e),Fe=rt(D);return xo(ye,Fe,ie)},t.addHook=function(_e,D){typeof D=="function"&&Yn(G,_e)&&gl(G[_e],D)},t.removeHook=function(_e,D){if(Yn(G,_e)){if(D!==void 0){const ie=FG(G[_e],D);return ie===-1?void 0:jG(G[_e],ie,1)[0]}return _x(G[_e])}},t.removeHooks=function(_e){Yn(G,_e)&&(G[_e]=[])},t.removeAllHooks=function(){G=Fx()},t}var Dx=jx();const aY=({previewImageInfo:e,setPreviewImageInfo:t,isPrivate:n=!1})=>{const[r,i]=O.useState(1),o=O.useRef(null),a=()=>{t(w1),i(1)};O.useEffect(()=>{const b=y=>{y.key==="Escape"&&a()};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[]);const{fileName:s,isOpen:c,loading:u,error:d,url:h,height:p,width:m}=e||{},v=O.useMemo(()=>h==null?void 0:h.split("?")[0].split("/").pop(),[h]);return S.jsx("div",{children:c&&S.jsxs("div",{className:"ed-overflow-hidden",children:[S.jsx("div",{className:"ed-h-full ed-w-full ed-z-[1000] ed-fixed ed-bg-black/80 ed-inset-0"}),S.jsxs("div",{className:"ed-size-full ed-flex items-center ed-w-full ed-h-full ed-justify-center ed-overflow-hidden ed-fixed ed-top-9 ed-left-0 ed-z-[1100]",children:[u?S.jsx(Ys,{}):!d&&h&&S.jsx("div",{ref:o,style:{transform:`scale(${r})`,transformOrigin:"center center",transition:"transform 0.2s ease-out"},children:S.jsx(br,{alt:"Feedback attachment",className:"ed-max-w-[90vw] ed-max-h-[90vh] ed-object-contain ed-select-none",height:p,src:h,width:m,isPrivate:n})}),d&&S.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-red",children:d})]}),S.jsxs("div",{className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-16 ed-flex ed-items-center ed-gap-3",children:[S.jsx("a",{href:`${h}&dl=${s||v}`,className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",title:"Download",children:S.jsx(Jm,{className:"ed-size-4",strokeWidth:"2"})}),S.jsx("button",{type:"button",className:"ed-fixed ed-z-[1100] ed-top-5 ed-right-5 ed-text-white ed-hover:text-gray-300 ed-transition-colors ed-bg-black/50 ed-rounded-lg ed-p-2",onClick:a,title:"Close (Esc)",children:S.jsx(di,{className:"ed-size-4",strokeWidth:"2"})})]}),!u&&!d&&S.jsx("div",{className:"ed-fixed ed-z-[1100] ed-bottom-5 ed-left-1/2 ed-transform -ed-translate-x-1/2",children:S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-bg-black/70 ed-rounded-lg ed-p-3",children:[S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(b=>Math.max(b/1.5,.5)),disabled:r<=.5,title:"Zoom Out",children:S.jsx(kg,{className:"ed-size-5",strokeWidth:"2"})}),S.jsxs("span",{className:"ed-text-white ed-text-sm ed-min-w-[3rem] ed-text-center ed-font-medium",children:[Math.round(r*100),"%"]}),S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(b=>Math.min(b*1.5,5)),disabled:r>=5,title:"Zoom In",children:S.jsx(xg,{className:"ed-size-5",strokeWidth:"2"})}),S.jsx("div",{className:"ed-w-px ed-h-5 ed-bg-white/30 ed-mx-1"}),S.jsx("button",{type:"button",className:"ed-text-white ed-hover:text-gray-300 ed-transition-colors",onClick:()=>i(1),title:"Reset",children:S.jsx(ag,{className:"ed-size-5",strokeWidth:"2"})})]})})]})})},sY=({filesData:e=[]})=>{var p;const[t,n]=O.useState(!1),[r,i]=O.useState(w1),o=e==null?void 0:e.filter(m=>/\.(jpg|jpeg|png|gif|webp)$/i.test(m.name)),a=e==null?void 0:e.filter(m=>!/\.(jpg|jpeg|png|gif|webp)$/i.test(m.name)),s=()=>n(!0),c=t?o:o==null?void 0:o.slice(0,2),u=De.size(o)-2,d=m=>{try{const v=`${hN()}?id=${m}&download=true`;v&&window.open(v,"_blank")}catch(v){console.error(v)}},h=async m=>{i(v=>({...v,loading:!0}));try{const v=await J5({fit:"scale",isPrivate:!1,needActualSize:!0,path:m==null?void 0:m.key,quality:100});if(v){const b=await gN(v);i(y=>({...y,isOpen:!0,url:v,fileName:m==null?void 0:m.title,image:v,loading:!1,height:b==null?void 0:b.height,width:b==null?void 0:b.width}))}}catch{i({...w1,error:"Failed to load image"})}};return S.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-3",children:[De.size(o)>0&&S.jsxs("div",{className:"ed-grid ed-grid-cols-2 ed-gap-2.5",children:[c.map(m=>S.jsx("div",{onClick:()=>h(m),role:"button",tabIndex:0,children:S.jsx(br,{path:m.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"})},m==null?void 0:m.id)),!t&&u>0&&S.jsxs("div",{role:"button",tabIndex:0,className:"ed-relative cursor-pointer",onClick:s,children:[S.jsx(br,{path:(p=o[2])==null?void 0:p.key,className:"ed-w-full ed-rounded",defaultImageClasses:"ed-w-full ed-h-20 !ed-rounded"}),S.jsx("div",{className:"ed-w-full ed-h-full ed-bg-black/15 ed-absolute ed-top-0 ed-left-0 ed-rounded",children:S.jsx("div",{className:"ed-bg-white ed-h-8 ed-w-8 ed-flex ed-items-center ed-justify-center ed-rounded-full ed-absolute ed-top-1/2 ed-left-1/2 ed--translate-x-1/2 ed--translate-y-1/2",children:S.jsxs("span",{className:"ed-text-12 ed-text-border-dark ed-font-semibold ed-truncate",children:["+",u]})})})]})]}),De.size(a)>0&&S.jsx("div",{className:"ed-flex ed-flex-col ed-gap-2.5",children:a.map(m=>S.jsxs("div",{className:"ed-p-2.5 ed-bg-white-light ed-rounded-lg ed-flex ed-items-center ed-gap-2 ed-justify-between",children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("div",{className:"ed-flex-shrink-0",children:S.jsx(iD,{})}),S.jsx("p",{title:m.title,className:"ed-text-12 ed-font-semibold ed-text-border-dark",children:_1(m.title,20)})]}),S.jsx("button",{className:"ed-flex-shrink-0",type:"button",onClick:()=>d(m==null?void 0:m.id),children:S.jsx(Xm,{className:"ed-text-brand-link ed-size-5"})})]},m==null?void 0:m.id))}),(r==null?void 0:r.isOpen)&&S.jsx(aY,{previewImageInfo:r,setPreviewImageInfo:i})]})},_y=({context:e,emails:t})=>S.jsxs("div",{className:"ed-flex ed-items-start ed-gap-2 ",children:[S.jsxs("p",{className:"ed-text-dark",children:[e,":"]}),S.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-1",children:t.slice(0,3).map((n,r)=>S.jsxs("p",{className:"ed-text-regular ed-flex ed-items-center ed-gap-2",children:[_1(n,30),r===2&&De.size(t)-3>0?S.jsx(uy,{classNames:{body:"ed-text-regular"},zIndex:99999999,placement:"top",title:t.join(", "),children:S.jsxs("span",{className:"ed-text-brand ed-cursor-pointer",children:["+",De.size(t)-3," more"]})}):""]},n))})]});var nh={exports:{}},lY=nh.exports,Vx;function cY(){return Vx||(Vx=1,(function(e,t){(function(n,r){e.exports=r()})(lY,(function(){return function(n,r,i){n=n||{};var o=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(u,d,h,p){return o.fromToBase(u,d,h,p)}i.en.relativeTime=a,o.fromToBase=function(u,d,h,p,m){for(var v,b,y,E=h.$locale().relativeTime||a,C=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],A=C.length,_=0;_<A;_+=1){var w=C[_];w.d&&(v=p?i(u).diff(h,w.d,!0):h.diff(u,w.d,!0));var k=(n.rounding||Math.round)(Math.abs(v));if(y=v>0,k<=w.r||!w.r){k<=1&&_>0&&(w=C[_-1]);var T=E[w.l];m&&(k=m(""+k)),b=typeof T=="string"?T.replace("%d",k):T(k,d,w.l,y);break}}if(d)return b;var R=y?E.future:E.past;return typeof R=="function"?R(b):R.replace("%s",b)},o.to=function(u,d){return s(u,d,this,!0)},o.from=function(u,d){return s(u,d,this)};var c=function(u){return u.$u?i.utc():i()};o.toNow=function(u){return this.to(c(this),u)},o.fromNow=function(u){return this.from(c(this),u)}}}))})(nh)),nh.exports}var uY=cY();const dY=wa(uY);Co.extend(dY);const fY=async(e,t)=>{const{policy:n,file:r}=e||{};return(await Wg(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},hY=async(e,t)=>{var r;const n=[];try{const i=[];for(let o=0;o<e.length;o+=1)(r=e[o])!=null&&r.id||i.push(fY(e[o],t));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),$t("error","File upload fails","top-left")}return n};function pY(e){if(!e)return"";const t=Co(e),n=Co();return t.isValid()?n.diff(t,"minute")<1?"Just now":t.fromNow():""}const mY={open:{label:"Open",className:"ed-bg-[#DDF2FF] ed-text-[#1173C8] ed-border ed-border-[#A4D1F1] ed-rounded-full"},resolved:{label:"Resolved",className:"ed-bg-[#DBF8E2] ed-text-[#0E9342] ed-border ed-border-[#96D4AB] ed-rounded-full"}},gY=e=>{if(!e)return"";if(typeof window>"u")return e;const t=Dx.sanitize(e,{FORBID_TAGS:["script"],FORBID_ATTR:["style","class"]}),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""},vY=(e=[],t=!1)=>{const n=[],r=[],i=[];return De.forEach(e,o=>{(o==null?void 0:o.type)==="to_email"&&(t?!(o!=null&&o.is_channel)&&!n.includes(o==null?void 0:o.email)&&n.push(o==null?void 0:o.email):n.push(o==null?void 0:o.email)),(o==null?void 0:o.type)==="cc_email"&&(t?De.some(r,{person_email:o==null?void 0:o.email})||r.push({person_email:o==null?void 0:o.email}):r.push(o==null?void 0:o.email)),(o==null?void 0:o.type)==="bcc_email"&&i.push(o==null?void 0:o.email)}),{toEmails:n,ccEmails:r,bccEmails:i}},yY="hh:mm A",Ux=({activityMessage:e={},brand:t={},aiAgentName:n="",aiAgentIconKey:r="",isReplying:i=!1})=>{const{emails:o=[],user:a,files:s,message:c,is_customer_reply:u,is_auto_response:d,is_ai_response:h,created_at:p,metadata:m={},isInitiatedWithAi:v=!1}=e||{},[b,y]=O.useState(!1),E=()=>{y(!b)},{toEmails:C,ccEmails:A,bccEmails:_}=vY(o),w=h||v&&d,k=O.useMemo(()=>w?(m==null?void 0:m.ai_agent_name)||n||"Eden AI bot":a!=null&&a.id?nd(a==null?void 0:a.first_name,a==null?void 0:a.last_name,a==null?void 0:a.email):(t==null?void 0:t.name)||"",[a==null?void 0:a.id,h,d,m==null?void 0:m.current_stage,n,m==null?void 0:m.ai_agent_name]),T=O.useMemo(()=>a!=null&&a.id?{...(a==null?void 0:a.avatar_file)||{},default_image_name:qi(a==null?void 0:a.first_name,a==null?void 0:a.last_name,a==null?void 0:a.email)}:{key:t==null?void 0:t.logo_icon_key,default_image_name:qi(t==null?void 0:t.name)},[a==null?void 0:a.id]),R=O.useMemo(()=>i||!c?"":Dx.sanitize(c,{ADD_ATTR:["class","className","style","target","rel","href"],ADD_TAGS:["div","h6","p","span","a","ul","li"]}),[c,i]),F=!i&&wc(R),V=Array.isArray(F)||O.isValidElement(F),H=V?"div":"p",z=O.useMemo(()=>V?(Array.isArray(F)?F:[F]).some(P=>{var j,Y;return(Y=(j=P==null?void 0:P.props)==null?void 0:j.className)==null?void 0:Y.includes("form-response")}):!1,[F,V]),Q=()=>F?S.jsxs("div",{className:`ed-p-2.5 ${u?"ed-bg-blue-light":"ed-bg-white-light"} ${z?"ed-p-0 ed-bg-white":""} ed-rounded-lg ed-mt-2 ed-text-[13px]`,children:[S.jsxs(H,{className:`ed-text-border-dark ${z||V?"":"ed-whitespace-pre-line ed-break-words"}`,children:[De.size(o)>0&&S.jsxs("div",{className:"ed-border-b ed-pb-2",children:[S.jsxs("button",{type:"button",onClick:E,className:"ed-flex ed-gap-1 ed-text-regular ed-items-center",children:[S.jsx("span",{children:b?S.jsx(Id,{className:"ed-size-4"}):S.jsx(js,{className:"ed-size-4"})})," ",S.jsxs("span",{children:[b?"Hide":"View"," recipient"]})]}),b&&S.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-2 ed-mt-2",children:[De.size(C)>0&&S.jsx(_y,{context:"To",emails:C}),De.size(A)>0&&S.jsx(_y,{context:"CC",emails:A}),De.size(_)>0&&S.jsx(_y,{context:"BCC",emails:_})]})]}),S.jsx("div",{className:"ed-mt-2 ed-text-dark ed-tiptap ProseMirror ed-chat-body",children:F})]}),S.jsx(sY,{filesData:s})]}):null;return u?S.jsx("div",{className:"ed-max-w-[85%] ed-w-max ed-ml-auto",children:S.jsx(Q,{})}):S.jsxs("div",{className:"ed-flex ed-gap-2.5 ed-my-4 ed-max-w-[85%] ed-w-max",children:[S.jsx("div",{className:"ed-size-7 ed-flex-shrink-0",children:w?S.jsx($c,{iconKey:r}):S.jsx(br,{className:"ed-size-7 ed-object-cover ed-rounded-full",alt:k,defaultImageClasses:"ed-w-7 ed-h-7",defaultUserNameTextSize:"ed-text-12",path:T==null?void 0:T.key,defaultImageName:T==null?void 0:T.default_image_name})}),S.jsxs("div",{children:[S.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2",children:[S.jsx("p",{className:"ed-text-border-regular ed-font-medium ed-text-[13px] ed-truncate",children:k}),S.jsx("span",{className:"ed-text-border ed-text-[13px] ed-font-medium ed-shrink-0",children:Co(p).format(yY)})]}),i?S.jsx("div",{className:"ed-py-4",children:S.jsx(Ys,{})}):S.jsx(Q,{})]})]})},rh={recommend_from_knowledge_base:`<div>
|
|
1518
1518
|
<div style="font-size: 14px; line-height: 1.6;">
|
|
1519
1519
|
{{ai_summary}}
|
|
1520
1520
|
</div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ed-widget",
|
|
3
3
|
"description": "A flexible and lightweight EasyDesk chat widget for React apps and websites. Supports both React integration and CDN-based embedding for fast, real-time customer support.",
|
|
4
|
-
"version": "1.56.11-beta.
|
|
4
|
+
"version": "1.56.11-beta.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Gain Solutions AS",
|
|
7
7
|
"license": "MIT",
|