@salla.sa/ui-ai-kit-core 2.2.2 → 2.2.3
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/cjs/ai-card.cjs.entry.js +2 -2
- package/dist/cjs/ai-chat-header.cjs.entry.js +1 -1
- package/dist/cjs/ai-chat-message.cjs.entry.js +1 -1
- package/dist/cjs/ai-conversation-summary.cjs.entry.js +1 -1
- package/dist/cjs/ai-in-chat-browser.cjs.entry.js +1 -1
- package/dist/cjs/ai-link.cjs.entry.js +1 -1
- package/dist/cjs/ai-route-decision.cjs.entry.js +1 -1
- package/dist/cjs/ai-suggestion.cjs.entry.js +2 -2
- package/dist/cjs/ai-voice-input.cjs.entry.js +1 -1
- package/dist/collection/components/ai-card/ai-card.css +22 -0
- package/dist/collection/components/ai-card/ai-card.js +1 -1
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +1 -1
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +1 -1
- package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.js +1 -1
- package/dist/collection/components/ai-in-chat-browser/ai-in-chat-browser.js +1 -1
- package/dist/collection/components/ai-link/ai-link.js +1 -1
- package/dist/collection/components/ai-route-decision/ai-route-decision.js +1 -1
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +2 -2
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +1 -1
- package/dist/components/ai-card.js +1 -1
- package/dist/components/ai-chat-header.js +1 -1
- package/dist/components/ai-chat-message.js +1 -1
- package/dist/components/ai-conversation-summary.js +1 -1
- package/dist/components/ai-in-chat-browser.js +1 -1
- package/dist/components/ai-link.js +1 -1
- package/dist/components/ai-message-input.js +1 -1
- package/dist/components/ai-rating.js +1 -1
- package/dist/components/ai-route-decision.js +1 -1
- package/dist/components/ai-suggestion.js +1 -1
- package/dist/components/ai-voice-input.js +1 -1
- package/dist/components/{p-bGFmyIp1.js → p-BlCeQ9Hu.js} +1 -1
- package/dist/components/p-DCJWSYj-.js +1 -0
- package/dist/esm/ai-card.entry.js +2 -2
- package/dist/esm/ai-chat-header.entry.js +1 -1
- package/dist/esm/ai-chat-message.entry.js +1 -1
- package/dist/esm/ai-conversation-summary.entry.js +1 -1
- package/dist/esm/ai-in-chat-browser.entry.js +1 -1
- package/dist/esm/ai-link.entry.js +1 -1
- package/dist/esm/ai-route-decision.entry.js +1 -1
- package/dist/esm/ai-suggestion.entry.js +2 -2
- package/dist/esm/ai-voice-input.entry.js +1 -1
- package/dist/ui-ai-kit/{p-5f005ec5.entry.js → p-11c960d8.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-278895fd.entry.js → p-2fd7529e.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-d02f2db5.entry.js → p-79309690.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-6bd54e29.entry.js → p-9a8614d0.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-062cad02.entry.js → p-9af03dbd.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-83f46030.entry.js → p-a1ee6005.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-187db371.entry.js → p-a5f53c8c.entry.js} +1 -1
- package/dist/ui-ai-kit/p-cde479ea.entry.js +1 -0
- package/dist/ui-ai-kit/{p-e6236df2.entry.js → p-e1a2a622.entry.js} +1 -1
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-Ba0urr6Q.js +0 -1
- package/dist/ui-ai-kit/p-8fabdbe8.entry.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{r as e,c as t,h as n,H as i}from"./p-VMEwYfaX.js";import{i as r}from"./p-DlD8m3rf.js";
|
|
2
|
-
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:a,setPrototypeOf:o,isFrozen:s,getPrototypeOf:l,getOwnPropertyDescriptor:c}=Object;let{freeze:u,seal:d,create:p}=Object,{apply:f,construct:m}="undefined"!=typeof Reflect&&Reflect;u||(u=function(e){return e}),d||(d=function(e){return e}),f||(f=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return e.apply(t,i)}),m||(m=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const g=D(Array.prototype.forEach),h=D(Array.prototype.lastIndexOf),b=D(Array.prototype.pop),y=D(Array.prototype.push),x=D(Array.prototype.splice),v=D(String.prototype.toLowerCase),w=D(String.prototype.toString),k=D(String.prototype.match),T=D(String.prototype.replace),A=D(String.prototype.indexOf),S=D(String.prototype.trim),E=D(Object.prototype.hasOwnProperty),R=D(RegExp.prototype.test),_=(z=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m(z,t)});var z;function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return f(e,t,i)}}function L(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;o&&o(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(s(t)||(t[i]=e),r=e)}e[r]=!0}return e}function O(e){for(let t=0;t<e.length;t++)E(e,t)||(e[t]=null);return e}function C(e){const t=p(null);for(const[n,i]of a(e))E(e,n)&&(t[n]=Array.isArray(i)?O(i):i&&"object"==typeof i&&i.constructor===Object?C(i):i);return t}function M(e,t){for(;null!==e;){const n=c(e,t);if(n){if(n.get)return D(n.get);if("function"==typeof n.value)return D(n.value)}e=l(e)}return function(){return null}}const $=u(["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"]),F=u(["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"]),I=u(["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"]),B=u(["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"]),N=u(["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"]),P=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),j=u(["#text"]),U=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),W=u(["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","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-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"]),q=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),H=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\$\{[\w\W]*/gm),X=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),V=d(/^aria-[\-\w]+$/),J=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=d(/^(?:\w+script|data):/i),Z=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=d(/^html$/i),te=d(/^[a-z][.\w]*(-[.\w]+)+$/i);var ne=Object.freeze({__proto__:null,ARIA_ATTR:V,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:te,DATA_ATTR:X,DOCTYPE_NAME:ee,ERB_EXPR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:Q,MUSTACHE_EXPR:Y,TMPLIT_EXPR:G});const ie=function(){return"undefined"==typeof window?null:window};var re=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:d,NodeFilter:f,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:z,DOMParser:D,trustedTypes:O}=t,Y=d.prototype,K=M(Y,"cloneNode"),G=M(Y,"remove"),X=M(Y,"nextSibling"),V=M(Y,"childNodes"),Q=M(Y,"parentNode");if("function"==typeof l){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let Z,te="";const{implementation:re,createNodeIterator:ae,createDocumentFragment:oe,getElementsByTagName:se}=i,{importNode:le}=r;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof a&&"function"==typeof Q&&re&&void 0!==re.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:de,TMPLIT_EXPR:pe,DATA_ATTR:fe,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:he,CUSTOM_ELEMENT:be}=ne;let{IS_ALLOWED_URI:ye}=ne,xe=null;const ve=L({},[...$,...F,...I,...N,...j]);let we=null;const ke=L({},[...U,...W,...q,...H]);let Te=Object.seal(p(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}})),Ae=null,Se=null;const Ee=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Re=!0,_e=!0,ze=!1,De=!0,Le=!1,Oe=!0,Ce=!1,Me=!1,$e=!1,Fe=!1,Ie=!1,Be=!1,Ne=!0,Pe=!1,je=!0,Ue=!1,We={},qe=null;const He=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Ke=L({},["audio","video","img","source","image","track"]);let Ge=null;const Xe=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Ze=Qe,et=!1,tt=null;const nt=L({},[Ve,Je,Qe],w);let it=L({},["mi","mo","mn","ms","mtext"]),rt=L({},["annotation-xml"]);const at=L({},["title","style","font","a","script"]);let ot=null;const st=["application/xhtml+xml","text/html"];let lt=null,ct=null;const ut=i.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=C(e),ot=-1===st.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===ot?w:v,xe=E(e,"ALLOWED_TAGS")?L({},e.ALLOWED_TAGS,lt):ve,we=E(e,"ALLOWED_ATTR")?L({},e.ALLOWED_ATTR,lt):ke,tt=E(e,"ALLOWED_NAMESPACES")?L({},e.ALLOWED_NAMESPACES,w):nt,Ge=E(e,"ADD_URI_SAFE_ATTR")?L(C(Xe),e.ADD_URI_SAFE_ATTR,lt):Xe,Ye=E(e,"ADD_DATA_URI_TAGS")?L(C(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,qe=E(e,"FORBID_CONTENTS")?L({},e.FORBID_CONTENTS,lt):He,Ae=E(e,"FORBID_TAGS")?L({},e.FORBID_TAGS,lt):C({}),Se=E(e,"FORBID_ATTR")?L({},e.FORBID_ATTR,lt):C({}),We=!!E(e,"USE_PROFILES")&&e.USE_PROFILES,Re=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,ze=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Ce=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,$e=e.FORCE_BODY||!1,Ne=!1!==e.SANITIZE_DOM,Pe=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||J,Ze=e.NAMESPACE||Qe,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,rt=e.HTML_INTEGRATION_POINTS||rt,Te=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Te.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(_e=!1),Ie&&(Fe=!0),We&&(xe=L({},j),we=p(null),!0===We.html&&(L(xe,$),L(we,U)),!0===We.svg&&(L(xe,F),L(we,W),L(we,H)),!0===We.svgFilters&&(L(xe,I),L(we,W),L(we,H)),!0===We.mathMl&&(L(xe,N),L(we,q),L(we,H))),E(e,"ADD_TAGS")||(Ee.tagCheck=null),E(e,"ADD_ATTR")||(Ee.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ee.tagCheck=e.ADD_TAGS:(xe===ve&&(xe=C(xe)),L(xe,e.ADD_TAGS,lt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ee.attributeCheck=e.ADD_ATTR:(we===ke&&(we=C(we)),L(we,e.ADD_ATTR,lt))),e.ADD_URI_SAFE_ATTR&&L(Ge,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(qe===He&&(qe=C(qe)),L(qe,e.FORBID_CONTENTS,lt)),e.ADD_FORBID_CONTENTS&&(qe===He&&(qe=C(qe)),L(qe,e.ADD_FORBID_CONTENTS,lt)),je&&(xe["#text"]=!0),Ce&&L(xe,["html","head","body"]),xe.table&&(L(xe,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,te=Z.createHTML("")}else void 0===Z&&(Z=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(O,o)),null!==Z&&"string"==typeof te&&(te=Z.createHTML(""));u&&u(e),ct=e}},ft=L({},[...F,...I,...B]),mt=L({},[...N,...P]),gt=function(e){y(n.removed,{element:e});try{Q(e).removeChild(e)}catch(t){G(e)}},ht=function(e,t){try{y(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){y(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Ie)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if($e)e="<remove></remove>"+e;else{const t=k(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&Ze===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=Z?Z.createHTML(e):e;if(Ze===Qe)try{t=(new D).parseFromString(r,ot)}catch(e){}if(!t||!t.documentElement){t=re.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?te:r}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Ze===Qe?se.call(t,Ce?"html":"body")[0]:Ce?t.documentElement:a},yt=function(e){return ae.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},xt=function(e){return e instanceof z&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof c&&e instanceof c};function wt(e,t,i){g(e,(e=>{e.call(n,t,i,ct)}))}const kt=function(e){let t=null;if(wt(ce.beforeSanitizeElements,e,null),xt(e))return gt(e),!0;const i=lt(e.nodeName);if(wt(ce.uponSanitizeElement,e,{tagName:i,allowedTags:xe}),Oe&&e.hasChildNodes()&&!vt(e.firstElementChild)&&R(/<[/\w!]/g,e.innerHTML)&&R(/<[/\w!]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Oe&&8===e.nodeType&&R(/<[/\w]/g,e.data))return gt(e),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(i))&&(!xe[i]||Ae[i])){if(!Ae[i]&&At(i)){if(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,i))return!1;if(Te.tagNameCheck instanceof Function&&Te.tagNameCheck(i))return!1}if(je&&!qe[i]){const t=Q(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let i=n.length-1;i>=0;--i){const r=K(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,X(e))}}return gt(e),!0}return e instanceof d&&!function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});const n=v(e.tagName),i=v(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===i||it[i]):Boolean(ft[n]):e.namespaceURI===Ve?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Je?"math"===n&&rt[i]:Boolean(mt[n]):e.namespaceURI===Qe?!(t.namespaceURI===Je&&!rt[i])&&!(t.namespaceURI===Ve&&!it[i])&&!mt[n]&&(at[n]||!ft[n]):!("application/xhtml+xml"!==ot||!tt[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!R(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,g([ue,de,pe],(e=>{t=T(t,e," ")})),e.textContent!==t&&(y(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt(ce.afterSanitizeElements,e,null),!1):(gt(e),!0)},Tt=function(e,t,n){if(Se[t])return!1;if(Ne&&("id"===t||"name"===t)&&(n in i||n in ut))return!1;if(_e&&!Se[t]&&R(fe,t));else if(Re&&R(me,t));else if(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e));else if(!we[t]||Se[t]){if(!(At(e)&&(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,e)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(e))&&(Te.attributeNameCheck instanceof RegExp&&R(Te.attributeNameCheck,t)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(t,e))||"is"===t&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,n)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(n))))return!1}else if(Ge[t]);else if(R(ye,T(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!Ye[e])if(ze&&!R(ge,T(n,he,"")));else if(n)return!1;return!0},At=function(e){return"annotation-xml"!==e&&k(e,be)},St=function(e){wt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||xt(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const a=t[r],{name:o,namespaceURI:s,value:l}=a,c=lt(o),u=l;let d="value"===o?u:S(u);if(i.attrName=c,i.attrValue=d,i.keepAttr=!0,i.forceKeepAttr=void 0,wt(ce.uponSanitizeAttribute,e,i),d=i.attrValue,!Pe||"id"!==c&&"name"!==c||(ht(o,e),d="user-content-"+d),Oe&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){ht(o,e);continue}if("attributename"===c&&k(d,"href")){ht(o,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){ht(o,e);continue}if(!De&&R(/\/>/i,d)){ht(o,e);continue}Le&&g([ue,de,pe],(e=>{d=T(d,e," ")}));const p=lt(e.nodeName);if(Tt(p,c,d)){if(Z&&"object"==typeof O&&"function"==typeof O.getAttributeType)if(s);else switch(O.getAttributeType(p,c)){case"TrustedHTML":d=Z.createHTML(d);break;case"TrustedScriptURL":d=Z.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,o,d):e.setAttribute(o,d),xt(e)?gt(e):b(n.removed)}catch(t){ht(o,e)}}else ht(o,e)}wt(ce.afterSanitizeAttributes,e,null)},Et=function e(t){let n=null;const i=yt(t);for(wt(ce.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)wt(ce.uponSanitizeShadowNode,n,null),kt(n),St(n),n.content instanceof s&&e(n.content);wt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,a=null,o=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw _("toString is not a function");if("string"!=typeof(e=e.toString()))throw _("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||pt(t),n.removed=[],"string"==typeof e&&(Ue=!1),Ue){if(e.nodeName){const t=lt(e.nodeName);if(!xe[t]||Ae[t])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)i=bt("\x3c!----\x3e"),a=i.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?i=a:i.appendChild(a);else{if(!Fe&&!Le&&!Ce&&-1===e.indexOf("<"))return Z&&Be?Z.createHTML(e):e;if(i=bt(e),!i)return Fe?null:Be?te:""}i&&$e&>(i.firstChild);const u=yt(Ue?e:i);for(;o=u.nextNode();)kt(o),St(o),o.content instanceof s&&Et(o.content);if(Ue)return e;if(Fe){if(Ie)for(l=oe.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(we.shadowroot||we.shadowrootmode)&&(l=le.call(r,l,!0)),l}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&xe["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&R(ee,i.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+d),Le&&g([ue,de,pe],(e=>{d=T(d,e," ")})),Z&&Be?Z.createHTML(d):d},n.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){ct=null,Me=!1},n.isValidAttribute=function(e,t,n){ct||pt({});const i=lt(e),r=lt(t);return Tt(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&y(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=h(ce[e],t);return-1===n?void 0:x(ce[e],n,1)[0]}return b(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const ae={ALLOWED_TAGS:["p","br","strong","em","del","code","pre","ul","ol","li","h2","h3","a","blockquote","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","target","rel"]},oe=class{constructor(n){e(this,n),this.messageCopy=t(this,"messageCopy"),this.messageFeedback=t(this,"messageFeedback"),this.messageRegenerate=t(this,"messageRegenerate")}role="user";content="";format="text";agentName="";timestamp="";showActions=!0;enableRegenerate=!1;feedbackValue=null;messageCopy;messageFeedback;messageRegenerate;copySuccess=!1;copyTimeout;disconnectedCallback(){this.copyTimeout&&clearTimeout(this.copyTimeout)}renderIcon(e,t=16){const i=r[e];return i?n("span",{class:"icon-wrap",innerHTML:`<svg width="${t}" height="${t}" viewBox="${i.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${i.content}</svg>`}):null}parseMarkdown(e){let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");const n=[];return t=t.replace(/```(?:\w+)?\n?([\s\S]*?)```/g,((e,t)=>{const i=n.length;return n.push(`<pre><code>${t}</code></pre>`),`\0BLOCK${i}\0`})),t=t.replace(/((?:^[ \t]*\|.+\|\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim()));if(t.length<2)return e;let i="<table>",r=!1;t.forEach(((e,t)=>{if(/^[\s|:-]+$/.test(e))return r=!0,void(i+="<tbody>");const n=e.split("|").filter(((e,t,n)=>t>0&&t<n.length-1));i+=r||0!==t?`<tr>${n.map((e=>`<td>${e.trim()}</td>`)).join("")}</tr>`:`<thead><tr>${n.map((e=>`<th>${e.trim()}</th>`)).join("")}</tr></thead>`})),r&&(i+="</tbody>"),i+="</table>";const a=n.length;return n.push(i),`\0BLOCK${a}\0`})),t=t.replace(/((?:^> .+\n?)+)/gm,(e=>{const t=e.replace(/^> /gm,"").trim(),i=n.length;return n.push(`<blockquote>${t}</blockquote>`),`\0BLOCK${i}\0`})),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*([^*\n]+)\*/g,"<em>$1</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t=t.replace(/((?:^[ \t]*[-*] .+\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim())).map((e=>`<li>${e.replace(/^[ \t]*[-*] /,"")}</li>`)).join(""),i=n.length;return n.push(`<ul>${t}</ul>`),`\0BLOCK${i}\0`})),t=t.replace(/((?:^[ \t]*\d+\. .+\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim())).map((e=>`<li>${e.replace(/^[ \t]*\d+\. /,"")}</li>`)).join(""),i=n.length;return n.push(`<ol>${t}</ol>`),`\0BLOCK${i}\0`})),t=t.split(/\n{2,}/).map((e=>{const t=e.trim();return t?/^\x00BLOCK\d+\x00$/.test(t)?t:`<p>${t.replace(/\n/g,"<br>")}</p>`:""})).join(""),t=t.replace(/\x00BLOCK(\d+)\x00/g,((e,t)=>n[parseInt(t,10)]||"")),t}getRenderedContent(){if(!this.content)return"";try{return re.sanitize(this.parseMarkdown(this.content),ae)}catch{return re.sanitize(`<p>${this.content.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>")}</p>`,ae)}}getRelativeTime(){if(!this.timestamp)return"";try{const e=new Date(this.timestamp);if(isNaN(e.getTime()))return this.timestamp;const t=Date.now()-e.getTime(),n=Math.floor(t/6e4),i=Math.floor(n/60),r=Math.floor(i/24),a="undefined"!=typeof document&&document.documentElement.lang||"ar",o=new Intl.RelativeTimeFormat(a,{numeric:"auto"});return n<1?o.format(0,"second"):n<60?o.format(-n,"minute"):i<24?o.format(-i,"hour"):o.format(-r,"day")}catch{return this.timestamp}}async handleCopy(){try{await navigator.clipboard.writeText(this.content)}catch(e){}this.copySuccess=!0,this.messageCopy.emit(),this.copyTimeout=setTimeout((()=>this.copySuccess=!1),1500)}handleFeedback(e){this.feedbackValue=this.feedbackValue===e?null:e,this.messageFeedback.emit(e)}renderActionsBar(){return n("div",{class:"actions-bar"},this.enableRegenerate&&n("button",{class:"action-btn",onClick:()=>this.messageRegenerate.emit(),title:"إعادة تحميل"},this.renderIcon("reload",16)),n("button",{class:"action-btn copy-btn"+(this.copySuccess?" copy-success":""),onClick:()=>this.handleCopy(),title:"نسخ"},this.renderIcon("copy",16)),n("div",{class:"feedback-group"},n("button",{class:"feedback-btn thumbs-down-btn"+("down"===this.feedbackValue?" active":""),onClick:()=>this.handleFeedback("down"),title:"غير مفيد"},this.renderIcon("thumbs-down",16)),n("button",{class:"feedback-btn thumbs-up-btn"+("up"===this.feedbackValue?" active":""),onClick:()=>this.handleFeedback("up"),title:"مفيد"},this.renderIcon("thumbs-up",16))))}renderUserMessage(){return n("div",{class:"message-row user-row"},n("div",{class:"bubble user-bubble"},n("div",{class:"message-content",ref:e=>{e&&("markdown"===this.format?e.innerHTML=this.getRenderedContent():e.textContent=this.content)}})))}renderAgentMessage(){const e=this.showActions;return n("div",{class:"message-row agent-row"},n("div",{class:"agent-bubble-wrapper"},n("div",{class:"bubble agent-bubble"},this.content&&n("div",{class:"message-content",ref:e=>{e&&("markdown"===this.format?e.innerHTML=this.getRenderedContent():e.textContent=this.content)}}),n("slot",null),e&&this.renderActionsBar()),(this.agentName||this.timestamp)&&n("div",{class:"agent-info"},this.agentName&&n("span",{class:"agent-info-name"},this.agentName),this.agentName&&this.timestamp&&this.renderIcon("eclipse",10),this.timestamp&&n("span",{class:"agent-info-time"},this.getRelativeTime()))))}render(){return n(i,{key:"b6fe466c9830e69c3ae6f405daa9e77ef3f75aca"},"user"===this.role?this.renderUserMessage():this.renderAgentMessage())}};oe.style=":host{--ai-msg-user-bg:var(--ai-user-bubble-bg);--ai-msg-user-border:1px solid var(--ai-border-default);--ai-msg-agent-bg:var(--ai-agent-bubble-bg);--ai-msg-agent-border:1px solid var(--ai-border-default);--ai-msg-border-radius:16px;--ai-msg-padding:16px;--ai-msg-font-size:14px;--ai-msg-action-active-bg:var(--ai-accent);--ai-user-msg-max-width:80%;--ai-agent-msg-max-width:80%;display:block}.message-row{display:flex}.user-row{flex-direction:column;align-items:flex-end}.user-bubble{background:var(--ai-msg-user-bg);color:var(--ai-text-primary);border:var(--ai-msg-user-border);border-radius:var(--ai-msg-border-radius);padding:var(--ai-msg-padding);font-size:var(--ai-msg-font-size);max-width:var(--ai-user-msg-max-width);line-height:1.5;word-break:break-word;box-shadow:var(--ai-shadow-sm)}.user-row .timestamp{font-size:12px;color:var(--ai-text-secondary);margin-top:4px}.agent-row{flex-direction:row;justify-content:flex-start}.agent-bubble-wrapper{display:flex;flex-direction:column;gap:6px;width:100%;max-width:var(--ai-msg-agent-max-width);min-width:0}.agent-bubble{background:var(--ai-msg-agent-bg);color:var(--ai-text-primary);border:var(--ai-msg-agent-border);border-radius:var(--ai-msg-border-radius);padding:var(--ai-msg-padding);font-size:var(--ai-msg-font-size);line-height:1.6;word-break:break-word;box-shadow:var(--ai-shadow-sm);display:flex;flex-direction:column;gap:12px}.message-content{white-space:pre-wrap}.message-content p{margin:0 0 8px 0}.message-content p:last-child{margin-bottom:0}.message-content h2{font-size:16px;font-weight:700;margin:0 0 8px 0}.message-content h3{font-size:15px;font-weight:600;margin:0 0 6px 0}.message-content strong{font-weight:700}.message-content em{font-style:italic}.message-content code{background:var(--ai-bg-surface);border-radius:4px;padding:1px 5px;font-family:var(--ai-font-family-mono);font-size:13px;color:var(--ai-text-primary)}.message-content pre{background:var(--ai-bg-surface);border-radius:8px;padding:10px 12px;overflow-x:auto;margin:8px 0}.message-content pre code{background:none;padding:0;font-size:13px}.message-content ul,.message-content ol{padding-inline-start:20px;margin:4px 0 8px 0}.message-content li{margin-bottom:3px}.actions-bar{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;height:0;overflow:hidden;opacity:0;pointer-events:none;transition:height 0.15s ease, opacity 0.15s ease}.agent-bubble:hover .actions-bar{height:32px;opacity:1;pointer-events:auto}.action-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--ai-bg-card);border:1px solid var(--ai-border-default);cursor:pointer;color:var(--ai-text-primary);transition:background 0.15s, color 0.15s;padding:0;flex-shrink:0}.action-btn:hover{background:var(--ai-bg-surface)}.action-btn.copy-success{background:var(--ai-msg-action-active-bg);color:var(--ai-accent-text);border-color:var(--ai-accent)}.feedback-group{display:flex;align-items:center;border:1px solid var(--ai-border-default);border-radius:8px;overflow:hidden;background:var(--ai-bg-card)}.feedback-btn{display:flex;align-items:center;justify-content:center;height:32px;padding:0 8px;background:var(--ai-bg-card);border:none;border-inline-start:1px solid var(--ai-border-default);cursor:pointer;color:var(--ai-text-primary);transition:background 0.15s, color 0.15s}.feedback-btn:first-child{border-inline-start:none}.feedback-btn:hover{background:var(--ai-bg-surface)}.feedback-btn.active{background:var(--ai-msg-action-active-bg);color:var(--ai-accent-text)}.icon-wrap{display:flex;align-items:center;justify-content:center;line-height:0}.agent-info{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;color:var(--ai-text-muted)}.agent-info-name,.agent-info-time{font-size:12px;color:inherit;line-height:16px;white-space:nowrap}.agent-info .icon-wrap{display:flex;align-items:center;color:inherit;opacity:0.6;flex-shrink:0}.typing-indicator{display:flex;align-items:center;gap:5px;padding:4px 2px}.typing-dot{width:8px;height:8px;border-radius:50%;background:var(--ai-text-muted);animation:typingBounce 1.2s ease-in-out infinite}.typing-dot:nth-child(2){animation-delay:0.2s}.typing-dot:nth-child(3){animation-delay:0.4s}@keyframes typingBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}.streaming-cursor{display:inline-block;width:2px;height:1em;background:currentColor;vertical-align:text-bottom;margin-inline-start:2px;animation:cursorBlink 0.8s step-start infinite}@keyframes cursorBlink{0%,100%{opacity:1}50%{opacity:0}}";export{oe as ai_chat_message}
|
|
2
|
+
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:a,setPrototypeOf:o,isFrozen:s,getPrototypeOf:l,getOwnPropertyDescriptor:c}=Object;let{freeze:u,seal:d,create:p}=Object,{apply:f,construct:m}="undefined"!=typeof Reflect&&Reflect;u||(u=function(e){return e}),d||(d=function(e){return e}),f||(f=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return e.apply(t,i)}),m||(m=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const g=D(Array.prototype.forEach),h=D(Array.prototype.lastIndexOf),b=D(Array.prototype.pop),y=D(Array.prototype.push),x=D(Array.prototype.splice),v=D(String.prototype.toLowerCase),w=D(String.prototype.toString),k=D(String.prototype.match),T=D(String.prototype.replace),A=D(String.prototype.indexOf),S=D(String.prototype.trim),E=D(Object.prototype.hasOwnProperty),R=D(RegExp.prototype.test),_=(z=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m(z,t)});var z;function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return f(e,t,i)}}function L(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;o&&o(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(s(t)||(t[i]=e),r=e)}e[r]=!0}return e}function O(e){for(let t=0;t<e.length;t++)E(e,t)||(e[t]=null);return e}function C(e){const t=p(null);for(const[n,i]of a(e))E(e,n)&&(t[n]=Array.isArray(i)?O(i):i&&"object"==typeof i&&i.constructor===Object?C(i):i);return t}function M(e,t){for(;null!==e;){const n=c(e,t);if(n){if(n.get)return D(n.get);if("function"==typeof n.value)return D(n.value)}e=l(e)}return function(){return null}}const $=u(["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"]),F=u(["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"]),I=u(["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"]),B=u(["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"]),N=u(["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"]),P=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),j=u(["#text"]),U=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),W=u(["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","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-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"]),q=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),H=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\$\{[\w\W]*/gm),X=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),V=d(/^aria-[\-\w]+$/),J=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=d(/^(?:\w+script|data):/i),Z=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=d(/^html$/i),te=d(/^[a-z][.\w]*(-[.\w]+)+$/i);var ne=Object.freeze({__proto__:null,ARIA_ATTR:V,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:te,DATA_ATTR:X,DOCTYPE_NAME:ee,ERB_EXPR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:Q,MUSTACHE_EXPR:Y,TMPLIT_EXPR:G});const ie=function(){return"undefined"==typeof window?null:window};var re=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:d,NodeFilter:f,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:z,DOMParser:D,trustedTypes:O}=t,Y=d.prototype,K=M(Y,"cloneNode"),G=M(Y,"remove"),X=M(Y,"nextSibling"),V=M(Y,"childNodes"),Q=M(Y,"parentNode");if("function"==typeof l){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let Z,te="";const{implementation:re,createNodeIterator:ae,createDocumentFragment:oe,getElementsByTagName:se}=i,{importNode:le}=r;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof a&&"function"==typeof Q&&re&&void 0!==re.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:de,TMPLIT_EXPR:pe,DATA_ATTR:fe,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:he,CUSTOM_ELEMENT:be}=ne;let{IS_ALLOWED_URI:ye}=ne,xe=null;const ve=L({},[...$,...F,...I,...N,...j]);let we=null;const ke=L({},[...U,...W,...q,...H]);let Te=Object.seal(p(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}})),Ae=null,Se=null;const Ee=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Re=!0,_e=!0,ze=!1,De=!0,Le=!1,Oe=!0,Ce=!1,Me=!1,$e=!1,Fe=!1,Ie=!1,Be=!1,Ne=!0,Pe=!1,je=!0,Ue=!1,We={},qe=null;const He=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Ke=L({},["audio","video","img","source","image","track"]);let Ge=null;const Xe=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Ze=Qe,et=!1,tt=null;const nt=L({},[Ve,Je,Qe],w);let it=L({},["mi","mo","mn","ms","mtext"]),rt=L({},["annotation-xml"]);const at=L({},["title","style","font","a","script"]);let ot=null;const st=["application/xhtml+xml","text/html"];let lt=null,ct=null;const ut=i.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=C(e),ot=-1===st.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===ot?w:v,xe=E(e,"ALLOWED_TAGS")?L({},e.ALLOWED_TAGS,lt):ve,we=E(e,"ALLOWED_ATTR")?L({},e.ALLOWED_ATTR,lt):ke,tt=E(e,"ALLOWED_NAMESPACES")?L({},e.ALLOWED_NAMESPACES,w):nt,Ge=E(e,"ADD_URI_SAFE_ATTR")?L(C(Xe),e.ADD_URI_SAFE_ATTR,lt):Xe,Ye=E(e,"ADD_DATA_URI_TAGS")?L(C(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,qe=E(e,"FORBID_CONTENTS")?L({},e.FORBID_CONTENTS,lt):He,Ae=E(e,"FORBID_TAGS")?L({},e.FORBID_TAGS,lt):C({}),Se=E(e,"FORBID_ATTR")?L({},e.FORBID_ATTR,lt):C({}),We=!!E(e,"USE_PROFILES")&&e.USE_PROFILES,Re=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,ze=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Ce=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,$e=e.FORCE_BODY||!1,Ne=!1!==e.SANITIZE_DOM,Pe=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||J,Ze=e.NAMESPACE||Qe,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,rt=e.HTML_INTEGRATION_POINTS||rt,Te=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Te.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(_e=!1),Ie&&(Fe=!0),We&&(xe=L({},j),we=p(null),!0===We.html&&(L(xe,$),L(we,U)),!0===We.svg&&(L(xe,F),L(we,W),L(we,H)),!0===We.svgFilters&&(L(xe,I),L(we,W),L(we,H)),!0===We.mathMl&&(L(xe,N),L(we,q),L(we,H))),E(e,"ADD_TAGS")||(Ee.tagCheck=null),E(e,"ADD_ATTR")||(Ee.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ee.tagCheck=e.ADD_TAGS:(xe===ve&&(xe=C(xe)),L(xe,e.ADD_TAGS,lt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ee.attributeCheck=e.ADD_ATTR:(we===ke&&(we=C(we)),L(we,e.ADD_ATTR,lt))),e.ADD_URI_SAFE_ATTR&&L(Ge,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(qe===He&&(qe=C(qe)),L(qe,e.FORBID_CONTENTS,lt)),e.ADD_FORBID_CONTENTS&&(qe===He&&(qe=C(qe)),L(qe,e.ADD_FORBID_CONTENTS,lt)),je&&(xe["#text"]=!0),Ce&&L(xe,["html","head","body"]),xe.table&&(L(xe,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,te=Z.createHTML("")}else void 0===Z&&(Z=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(O,o)),null!==Z&&"string"==typeof te&&(te=Z.createHTML(""));u&&u(e),ct=e}},ft=L({},[...F,...I,...B]),mt=L({},[...N,...P]),gt=function(e){y(n.removed,{element:e});try{Q(e).removeChild(e)}catch(t){G(e)}},ht=function(e,t){try{y(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){y(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Ie)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if($e)e="<remove></remove>"+e;else{const t=k(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&Ze===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=Z?Z.createHTML(e):e;if(Ze===Qe)try{t=(new D).parseFromString(r,ot)}catch(e){}if(!t||!t.documentElement){t=re.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?te:r}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Ze===Qe?se.call(t,Ce?"html":"body")[0]:Ce?t.documentElement:a},yt=function(e){return ae.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},xt=function(e){return e instanceof z&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof c&&e instanceof c};function wt(e,t,i){g(e,(e=>{e.call(n,t,i,ct)}))}const kt=function(e){let t=null;if(wt(ce.beforeSanitizeElements,e,null),xt(e))return gt(e),!0;const i=lt(e.nodeName);if(wt(ce.uponSanitizeElement,e,{tagName:i,allowedTags:xe}),Oe&&e.hasChildNodes()&&!vt(e.firstElementChild)&&R(/<[/\w!]/g,e.innerHTML)&&R(/<[/\w!]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Oe&&8===e.nodeType&&R(/<[/\w]/g,e.data))return gt(e),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(i))&&(!xe[i]||Ae[i])){if(!Ae[i]&&At(i)){if(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,i))return!1;if(Te.tagNameCheck instanceof Function&&Te.tagNameCheck(i))return!1}if(je&&!qe[i]){const t=Q(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let i=n.length-1;i>=0;--i){const r=K(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,X(e))}}return gt(e),!0}return e instanceof d&&!function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});const n=v(e.tagName),i=v(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===i||it[i]):Boolean(ft[n]):e.namespaceURI===Ve?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Je?"math"===n&&rt[i]:Boolean(mt[n]):e.namespaceURI===Qe?!(t.namespaceURI===Je&&!rt[i])&&!(t.namespaceURI===Ve&&!it[i])&&!mt[n]&&(at[n]||!ft[n]):!("application/xhtml+xml"!==ot||!tt[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!R(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,g([ue,de,pe],(e=>{t=T(t,e," ")})),e.textContent!==t&&(y(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt(ce.afterSanitizeElements,e,null),!1):(gt(e),!0)},Tt=function(e,t,n){if(Se[t])return!1;if(Ne&&("id"===t||"name"===t)&&(n in i||n in ut))return!1;if(_e&&!Se[t]&&R(fe,t));else if(Re&&R(me,t));else if(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e));else if(!we[t]||Se[t]){if(!(At(e)&&(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,e)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(e))&&(Te.attributeNameCheck instanceof RegExp&&R(Te.attributeNameCheck,t)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(t,e))||"is"===t&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&R(Te.tagNameCheck,n)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(n))))return!1}else if(Ge[t]);else if(R(ye,T(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!Ye[e])if(ze&&!R(ge,T(n,he,"")));else if(n)return!1;return!0},At=function(e){return"annotation-xml"!==e&&k(e,be)},St=function(e){wt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||xt(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const a=t[r],{name:o,namespaceURI:s,value:l}=a,c=lt(o),u=l;let d="value"===o?u:S(u);if(i.attrName=c,i.attrValue=d,i.keepAttr=!0,i.forceKeepAttr=void 0,wt(ce.uponSanitizeAttribute,e,i),d=i.attrValue,!Pe||"id"!==c&&"name"!==c||(ht(o,e),d="user-content-"+d),Oe&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){ht(o,e);continue}if("attributename"===c&&k(d,"href")){ht(o,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){ht(o,e);continue}if(!De&&R(/\/>/i,d)){ht(o,e);continue}Le&&g([ue,de,pe],(e=>{d=T(d,e," ")}));const p=lt(e.nodeName);if(Tt(p,c,d)){if(Z&&"object"==typeof O&&"function"==typeof O.getAttributeType)if(s);else switch(O.getAttributeType(p,c)){case"TrustedHTML":d=Z.createHTML(d);break;case"TrustedScriptURL":d=Z.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,o,d):e.setAttribute(o,d),xt(e)?gt(e):b(n.removed)}catch(t){ht(o,e)}}else ht(o,e)}wt(ce.afterSanitizeAttributes,e,null)},Et=function e(t){let n=null;const i=yt(t);for(wt(ce.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)wt(ce.uponSanitizeShadowNode,n,null),kt(n),St(n),n.content instanceof s&&e(n.content);wt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,a=null,o=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw _("toString is not a function");if("string"!=typeof(e=e.toString()))throw _("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||pt(t),n.removed=[],"string"==typeof e&&(Ue=!1),Ue){if(e.nodeName){const t=lt(e.nodeName);if(!xe[t]||Ae[t])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)i=bt("\x3c!----\x3e"),a=i.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?i=a:i.appendChild(a);else{if(!Fe&&!Le&&!Ce&&-1===e.indexOf("<"))return Z&&Be?Z.createHTML(e):e;if(i=bt(e),!i)return Fe?null:Be?te:""}i&&$e&>(i.firstChild);const u=yt(Ue?e:i);for(;o=u.nextNode();)kt(o),St(o),o.content instanceof s&&Et(o.content);if(Ue)return e;if(Fe){if(Ie)for(l=oe.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(we.shadowroot||we.shadowrootmode)&&(l=le.call(r,l,!0)),l}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&xe["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&R(ee,i.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+d),Le&&g([ue,de,pe],(e=>{d=T(d,e," ")})),Z&&Be?Z.createHTML(d):d},n.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){ct=null,Me=!1},n.isValidAttribute=function(e,t,n){ct||pt({});const i=lt(e),r=lt(t);return Tt(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&y(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=h(ce[e],t);return-1===n?void 0:x(ce[e],n,1)[0]}return b(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const ae={ALLOWED_TAGS:["p","br","strong","em","del","code","pre","ul","ol","li","h2","h3","a","blockquote","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","target","rel"]},oe=class{constructor(n){e(this,n),this.messageCopy=t(this,"messageCopy"),this.messageFeedback=t(this,"messageFeedback"),this.messageRegenerate=t(this,"messageRegenerate")}role="user";content="";format="text";agentName="";timestamp="";showActions=!0;enableRegenerate=!1;feedbackValue=null;messageCopy;messageFeedback;messageRegenerate;copySuccess=!1;copyTimeout;disconnectedCallback(){this.copyTimeout&&clearTimeout(this.copyTimeout)}renderIcon(e,t=16){const i=r[e];return i?n("span",{class:"icon-wrap",innerHTML:`<svg width="${t}" height="${t}" viewBox="${i.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${i.content}</svg>`}):null}parseMarkdown(e){let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");const n=[];return t=t.replace(/```(?:\w+)?\n?([\s\S]*?)```/g,((e,t)=>{const i=n.length;return n.push(`<pre><code>${t}</code></pre>`),`\0BLOCK${i}\0`})),t=t.replace(/((?:^[ \t]*\|.+\|\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim()));if(t.length<2)return e;let i="<table>",r=!1;t.forEach(((e,t)=>{if(/^[\s|:-]+$/.test(e))return r=!0,void(i+="<tbody>");const n=e.split("|").filter(((e,t,n)=>t>0&&t<n.length-1));i+=r||0!==t?`<tr>${n.map((e=>`<td>${e.trim()}</td>`)).join("")}</tr>`:`<thead><tr>${n.map((e=>`<th>${e.trim()}</th>`)).join("")}</tr></thead>`})),r&&(i+="</tbody>"),i+="</table>";const a=n.length;return n.push(i),`\0BLOCK${a}\0`})),t=t.replace(/((?:^> .+\n?)+)/gm,(e=>{const t=e.replace(/^> /gm,"").trim(),i=n.length;return n.push(`<blockquote>${t}</blockquote>`),`\0BLOCK${i}\0`})),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*([^*\n]+)\*/g,"<em>$1</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t=t.replace(/((?:^[ \t]*[-*] .+\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim())).map((e=>`<li>${e.replace(/^[ \t]*[-*] /,"")}</li>`)).join(""),i=n.length;return n.push(`<ul>${t}</ul>`),`\0BLOCK${i}\0`})),t=t.replace(/((?:^[ \t]*\d+\. .+\n?)+)/gm,(e=>{const t=e.trim().split("\n").filter((e=>e.trim())).map((e=>`<li>${e.replace(/^[ \t]*\d+\. /,"")}</li>`)).join(""),i=n.length;return n.push(`<ol>${t}</ol>`),`\0BLOCK${i}\0`})),t=t.split(/\n{2,}/).map((e=>{const t=e.trim();return t?/^\x00BLOCK\d+\x00$/.test(t)?t:`<p>${t.replace(/\n/g,"<br>")}</p>`:""})).join(""),t=t.replace(/\x00BLOCK(\d+)\x00/g,((e,t)=>n[parseInt(t,10)]||"")),t}getRenderedContent(){if(!this.content)return"";try{return re.sanitize(this.parseMarkdown(this.content),ae)}catch{return re.sanitize(`<p>${this.content.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>")}</p>`,ae)}}getRelativeTime(){if(!this.timestamp)return"";try{const e=new Date(this.timestamp);if(isNaN(e.getTime()))return this.timestamp;const t=Date.now()-e.getTime(),n=Math.floor(t/6e4),i=Math.floor(n/60),r=Math.floor(i/24),a="undefined"!=typeof document&&document.documentElement.lang||"ar",o=new Intl.RelativeTimeFormat(a,{numeric:"auto"});return n<1?o.format(0,"second"):n<60?o.format(-n,"minute"):i<24?o.format(-i,"hour"):o.format(-r,"day")}catch{return this.timestamp}}async handleCopy(){try{await navigator.clipboard.writeText(this.content)}catch(e){}this.copySuccess=!0,this.messageCopy.emit(),this.copyTimeout=setTimeout((()=>this.copySuccess=!1),1500)}handleFeedback(e){this.feedbackValue=this.feedbackValue===e?null:e,this.messageFeedback.emit(e)}renderActionsBar(){return n("div",{class:"actions-bar"},this.enableRegenerate&&n("button",{class:"action-btn",onClick:()=>this.messageRegenerate.emit(),title:"إعادة تحميل"},this.renderIcon("reload",16)),n("button",{class:"action-btn copy-btn"+(this.copySuccess?" copy-success":""),onClick:()=>this.handleCopy(),title:"نسخ"},this.renderIcon("copy",16)),n("div",{class:"feedback-group"},n("button",{class:"feedback-btn thumbs-down-btn"+("down"===this.feedbackValue?" active":""),onClick:()=>this.handleFeedback("down"),title:"غير مفيد"},this.renderIcon("thumbs-down",16)),n("button",{class:"feedback-btn thumbs-up-btn"+("up"===this.feedbackValue?" active":""),onClick:()=>this.handleFeedback("up"),title:"مفيد"},this.renderIcon("thumbs-up",16))))}renderUserMessage(){return n("div",{class:"message-row user-row"},n("div",{class:"bubble user-bubble"},n("div",{class:"message-content",ref:e=>{e&&("markdown"===this.format?e.innerHTML=this.getRenderedContent():e.textContent=this.content)}})))}renderAgentMessage(){const e=this.showActions;return n("div",{class:"message-row agent-row"},n("div",{class:"agent-bubble-wrapper"},n("div",{class:"bubble agent-bubble"},this.content&&n("div",{class:"message-content",ref:e=>{e&&("markdown"===this.format?e.innerHTML=this.getRenderedContent():e.textContent=this.content)}}),n("slot",null),e&&this.renderActionsBar()),(this.agentName||this.timestamp)&&n("div",{class:"agent-info"},this.agentName&&n("span",{class:"agent-info-name"},this.agentName),this.agentName&&this.timestamp&&this.renderIcon("eclipse",10),this.timestamp&&n("span",{class:"agent-info-time"},this.getRelativeTime()))))}render(){return n(i,{key:"f8a49971896742ae952d84efb1527ed0db440876"},"user"===this.role?this.renderUserMessage():this.renderAgentMessage())}};oe.style=":host{--ai-msg-user-bg:var(--ai-user-bubble-bg);--ai-msg-user-border:1px solid var(--ai-border-default);--ai-msg-agent-bg:var(--ai-agent-bubble-bg);--ai-msg-agent-border:1px solid var(--ai-border-default);--ai-msg-border-radius:16px;--ai-msg-padding:16px;--ai-msg-font-size:14px;--ai-msg-action-active-bg:var(--ai-accent);--ai-user-msg-max-width:80%;--ai-agent-msg-max-width:80%;display:block}.message-row{display:flex}.user-row{flex-direction:column;align-items:flex-end}.user-bubble{background:var(--ai-msg-user-bg);color:var(--ai-text-primary);border:var(--ai-msg-user-border);border-radius:var(--ai-msg-border-radius);padding:var(--ai-msg-padding);font-size:var(--ai-msg-font-size);max-width:var(--ai-user-msg-max-width);line-height:1.5;word-break:break-word;box-shadow:var(--ai-shadow-sm)}.user-row .timestamp{font-size:12px;color:var(--ai-text-secondary);margin-top:4px}.agent-row{flex-direction:row;justify-content:flex-start}.agent-bubble-wrapper{display:flex;flex-direction:column;gap:6px;width:100%;max-width:var(--ai-msg-agent-max-width);min-width:0}.agent-bubble{background:var(--ai-msg-agent-bg);color:var(--ai-text-primary);border:var(--ai-msg-agent-border);border-radius:var(--ai-msg-border-radius);padding:var(--ai-msg-padding);font-size:var(--ai-msg-font-size);line-height:1.6;word-break:break-word;box-shadow:var(--ai-shadow-sm);display:flex;flex-direction:column;gap:12px}.message-content{white-space:pre-wrap}.message-content p{margin:0 0 8px 0}.message-content p:last-child{margin-bottom:0}.message-content h2{font-size:16px;font-weight:700;margin:0 0 8px 0}.message-content h3{font-size:15px;font-weight:600;margin:0 0 6px 0}.message-content strong{font-weight:700}.message-content em{font-style:italic}.message-content code{background:var(--ai-bg-surface);border-radius:4px;padding:1px 5px;font-family:var(--ai-font-family-mono);font-size:13px;color:var(--ai-text-primary)}.message-content pre{background:var(--ai-bg-surface);border-radius:8px;padding:10px 12px;overflow-x:auto;margin:8px 0}.message-content pre code{background:none;padding:0;font-size:13px}.message-content ul,.message-content ol{padding-inline-start:20px;margin:4px 0 8px 0}.message-content li{margin-bottom:3px}.actions-bar{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;height:0;overflow:hidden;opacity:0;pointer-events:none;transition:height 0.15s ease, opacity 0.15s ease}.agent-bubble:hover .actions-bar{height:32px;opacity:1;pointer-events:auto}.action-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--ai-bg-card);border:1px solid var(--ai-border-default);cursor:pointer;color:var(--ai-text-primary);transition:background 0.15s, color 0.15s;padding:0;flex-shrink:0}.action-btn:hover{background:var(--ai-bg-surface)}.action-btn.copy-success{background:var(--ai-msg-action-active-bg);color:var(--ai-accent-text);border-color:var(--ai-accent)}.feedback-group{display:flex;align-items:center;border:1px solid var(--ai-border-default);border-radius:8px;overflow:hidden;background:var(--ai-bg-card)}.feedback-btn{display:flex;align-items:center;justify-content:center;height:32px;padding:0 8px;background:var(--ai-bg-card);border:none;border-inline-start:1px solid var(--ai-border-default);cursor:pointer;color:var(--ai-text-primary);transition:background 0.15s, color 0.15s}.feedback-btn:first-child{border-inline-start:none}.feedback-btn:hover{background:var(--ai-bg-surface)}.feedback-btn.active{background:var(--ai-msg-action-active-bg);color:var(--ai-accent-text)}.icon-wrap{display:flex;align-items:center;justify-content:center;line-height:0}.agent-info{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;color:var(--ai-text-muted)}.agent-info-name,.agent-info-time{font-size:12px;color:inherit;line-height:16px;white-space:nowrap}.agent-info .icon-wrap{display:flex;align-items:center;color:inherit;opacity:0.6;flex-shrink:0}.typing-indicator{display:flex;align-items:center;gap:5px;padding:4px 2px}.typing-dot{width:8px;height:8px;border-radius:50%;background:var(--ai-text-muted);animation:typingBounce 1.2s ease-in-out infinite}.typing-dot:nth-child(2){animation-delay:0.2s}.typing-dot:nth-child(3){animation-delay:0.4s}@keyframes typingBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}.streaming-cursor{display:inline-block;width:2px;height:1em;background:currentColor;vertical-align:text-bottom;margin-inline-start:2px;animation:cursorBlink 0.8s step-start infinite}@keyframes cursorBlink{0%,100%{opacity:1}50%{opacity:0}}";export{oe as ai_chat_message}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,a as e,h as r,H as a}from"./p-VMEwYfaX.js";const o=class{constructor(e){i(this,e),this.audioRecorded=t(this,"audioRecorded"),this.recordingCancel=t(this,"recordingCancel")}get el(){return e(this)}disabled=!1;showWaveform=!0;autoStart=!1;errorText="";waveformColor="";state="idle";error=null;recordingDuration=0;submitPulse=!1;audioRecorded;recordingCancel;streamRef=null;audioContextRef=null;analyserRef=null;mediaRecorderRef=null;audioChunks=[];recordingStartTime=0;recordingTimer=null;maxTimeoutRef=null;canvasRef;animationFrameId=0;prevHeights=[];componentDidLoad(){this.autoStart&&!this.disabled&&this.startRecording()}disconnectedCallback(){this.cleanup()}cleanup=()=>{this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.maxTimeoutRef&&(clearTimeout(this.maxTimeoutRef),this.maxTimeoutRef=null),this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=0),this.mediaRecorderRef&&"inactive"!==this.mediaRecorderRef.state&&(this.mediaRecorderRef.stop(),this.mediaRecorderRef=null),this.audioContextRef&&(this.audioContextRef.close(),this.audioContextRef=null),this.analyserRef&&(this.analyserRef=null),this.streamRef&&(this.streamRef.getTracks().forEach((i=>i.stop())),this.streamRef=null)};getErrorText(){return this.errorText?this.errorText:"en"===document.documentElement.lang?"Microphone access denied":"تعذّر الوصول للميكروفون"}startRecording=async()=>{try{this.error=null,this.audioChunks=[];const i=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});this.streamRef=i;const t=new AudioContext;if(this.audioContextRef=t,this.showWaveform){const e=t.createAnalyser();e.fftSize=256,e.smoothingTimeConstant=.8,this.analyserRef=e,t.createMediaStreamSource(i).connect(e)}this.setupMediaRecorder(i),this.recordingStartTime=Date.now(),this.recordingDuration=0,this.prevHeights=[],this.state="recording",this.showWaveform&&requestAnimationFrame((()=>{this.drawWaveform()})),this.recordingTimer=window.setInterval((()=>{this.recordingDuration=Math.floor((Date.now()-this.recordingStartTime)/1e3)}),1e3),this.maxTimeoutRef=window.setTimeout((()=>{this.stopRecording()}),6e4)}catch(i){console.error("Error starting recording:",i),this.error=this.getErrorText(),this.state="idle"}};setupMediaRecorder=i=>{const t=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/ogg")?"audio/ogg":"",e=new MediaRecorder(i,t?{mimeType:t}:{});e.ondataavailable=i=>{i.data.size>0&&this.audioChunks.push(i.data)},e.onstop=()=>{const i=new Blob(this.audioChunks,{type:t||"audio/mp4"});this.audioRecorded.emit({blob:i,duration:this.recordingDuration})},this.mediaRecorderRef=e,e.start(100)};stopRecording=()=>{if(this.recordingDuration<1)return this.submitPulse=!0,void setTimeout((()=>{this.submitPulse=!1}),400);this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.maxTimeoutRef&&(clearTimeout(this.maxTimeoutRef),this.maxTimeoutRef=null),this.cleanup(),this.state="idle"};cancelRecording=()=>{this.mediaRecorderRef&&"inactive"!==this.mediaRecorderRef.state&&(this.mediaRecorderRef.ondataavailable=null,this.mediaRecorderRef.onstop=null),this.cleanup(),this.state="idle",this.recordingCancel.emit()};drawWaveform=()=>{if(!this.canvasRef||!this.analyserRef)return;const i=this.canvasRef,t=i.getContext("2d");if(!t)return;const e=this.analyserRef.frequencyBinCount,r=new Uint8Array(e),a=this.waveformColor||getComputedStyle(this.el).getPropertyValue("--ai-waveform-color").trim()||"#9ca3af",o=(i,e,r,a,o)=>{if(t.beginPath(),"function"==typeof t.roundRect)t.roundRect(i,e,r,a,o);else{const s=Math.min(o,r/2,a/2);t.moveTo(i+s,e),t.lineTo(i+r-s,e),t.arcTo(i+r,e,i+r,e+s,s),t.lineTo(i+r,e+a-s),t.arcTo(i+r,e+a,i+r-s,e+a,s),t.lineTo(i+s,e+a),t.arcTo(i,e+a,i,e+a-s,s),t.lineTo(i,e+s),t.arcTo(i,e,i+s,e,s),t.closePath()}},s=()=>{if("recording"!==this.state)return;this.animationFrameId=requestAnimationFrame(s);const n=i.offsetWidth;n>0&&i.width!==n&&(i.width=n);const c=Math.min(100,Math.floor(i.width/3)),d=Math.max(1,Math.floor(e/c));this.prevHeights.length!==c&&(this.prevHeights=new Array(c).fill(4)),this.analyserRef.getByteFrequencyData(r),t.clearRect(0,0,i.width,i.height);const l=i.height/2,h=(i.width-3*c)/2,u=i.height-4;for(let i=0;i<c;i++){let s=0;for(let t=0;t<d;t++){const a=i*d+t;a<e&&(s+=r[a])}const n=Math.min(1,s/d/255);this.prevHeights[i]=.7*this.prevHeights[i]+.3*(4+n*(u-4));const c=this.prevHeights[i],p=h+3*i,b=l-c/2;t.fillStyle=a,o(p,b,1,c,.5),t.fill()}};s()};formatDuration=i=>`${Math.floor(i/60)}:${(i%60).toString().padStart(2,"0")}`;render(){const i=60-this.recordingDuration;return r(a,{key:"
|
|
1
|
+
import{r as i,c as t,a as e,h as r,H as a}from"./p-VMEwYfaX.js";const o=class{constructor(e){i(this,e),this.audioRecorded=t(this,"audioRecorded"),this.recordingCancel=t(this,"recordingCancel")}get el(){return e(this)}disabled=!1;showWaveform=!0;autoStart=!1;errorText="";waveformColor="";state="idle";error=null;recordingDuration=0;submitPulse=!1;audioRecorded;recordingCancel;streamRef=null;audioContextRef=null;analyserRef=null;mediaRecorderRef=null;audioChunks=[];recordingStartTime=0;recordingTimer=null;maxTimeoutRef=null;canvasRef;animationFrameId=0;prevHeights=[];componentDidLoad(){this.autoStart&&!this.disabled&&this.startRecording()}disconnectedCallback(){this.cleanup()}cleanup=()=>{this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.maxTimeoutRef&&(clearTimeout(this.maxTimeoutRef),this.maxTimeoutRef=null),this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=0),this.mediaRecorderRef&&"inactive"!==this.mediaRecorderRef.state&&(this.mediaRecorderRef.stop(),this.mediaRecorderRef=null),this.audioContextRef&&(this.audioContextRef.close(),this.audioContextRef=null),this.analyserRef&&(this.analyserRef=null),this.streamRef&&(this.streamRef.getTracks().forEach((i=>i.stop())),this.streamRef=null)};getErrorText(){return this.errorText?this.errorText:"en"===document.documentElement.lang?"Microphone access denied":"تعذّر الوصول للميكروفون"}startRecording=async()=>{try{this.error=null,this.audioChunks=[];const i=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});this.streamRef=i;const t=new AudioContext;if(this.audioContextRef=t,this.showWaveform){const e=t.createAnalyser();e.fftSize=256,e.smoothingTimeConstant=.8,this.analyserRef=e,t.createMediaStreamSource(i).connect(e)}this.setupMediaRecorder(i),this.recordingStartTime=Date.now(),this.recordingDuration=0,this.prevHeights=[],this.state="recording",this.showWaveform&&requestAnimationFrame((()=>{this.drawWaveform()})),this.recordingTimer=window.setInterval((()=>{this.recordingDuration=Math.floor((Date.now()-this.recordingStartTime)/1e3)}),1e3),this.maxTimeoutRef=window.setTimeout((()=>{this.stopRecording()}),6e4)}catch(i){console.error("Error starting recording:",i),this.error=this.getErrorText(),this.state="idle"}};setupMediaRecorder=i=>{const t=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/ogg")?"audio/ogg":"",e=new MediaRecorder(i,t?{mimeType:t}:{});e.ondataavailable=i=>{i.data.size>0&&this.audioChunks.push(i.data)},e.onstop=()=>{const i=new Blob(this.audioChunks,{type:t||"audio/mp4"});this.audioRecorded.emit({blob:i,duration:this.recordingDuration})},this.mediaRecorderRef=e,e.start(100)};stopRecording=()=>{if(this.recordingDuration<1)return this.submitPulse=!0,void setTimeout((()=>{this.submitPulse=!1}),400);this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.maxTimeoutRef&&(clearTimeout(this.maxTimeoutRef),this.maxTimeoutRef=null),this.cleanup(),this.state="idle"};cancelRecording=()=>{this.mediaRecorderRef&&"inactive"!==this.mediaRecorderRef.state&&(this.mediaRecorderRef.ondataavailable=null,this.mediaRecorderRef.onstop=null),this.cleanup(),this.state="idle",this.recordingCancel.emit()};drawWaveform=()=>{if(!this.canvasRef||!this.analyserRef)return;const i=this.canvasRef,t=i.getContext("2d");if(!t)return;const e=this.analyserRef.frequencyBinCount,r=new Uint8Array(e),a=this.waveformColor||getComputedStyle(this.el).getPropertyValue("--ai-waveform-color").trim()||"#9ca3af",o=(i,e,r,a,o)=>{if(t.beginPath(),"function"==typeof t.roundRect)t.roundRect(i,e,r,a,o);else{const s=Math.min(o,r/2,a/2);t.moveTo(i+s,e),t.lineTo(i+r-s,e),t.arcTo(i+r,e,i+r,e+s,s),t.lineTo(i+r,e+a-s),t.arcTo(i+r,e+a,i+r-s,e+a,s),t.lineTo(i+s,e+a),t.arcTo(i,e+a,i,e+a-s,s),t.lineTo(i,e+s),t.arcTo(i,e,i+s,e,s),t.closePath()}},s=()=>{if("recording"!==this.state)return;this.animationFrameId=requestAnimationFrame(s);const n=i.offsetWidth;n>0&&i.width!==n&&(i.width=n);const c=Math.min(100,Math.floor(i.width/3)),d=Math.max(1,Math.floor(e/c));this.prevHeights.length!==c&&(this.prevHeights=new Array(c).fill(4)),this.analyserRef.getByteFrequencyData(r),t.clearRect(0,0,i.width,i.height);const l=i.height/2,h=(i.width-3*c)/2,u=i.height-4;for(let i=0;i<c;i++){let s=0;for(let t=0;t<d;t++){const a=i*d+t;a<e&&(s+=r[a])}const n=Math.min(1,s/d/255);this.prevHeights[i]=.7*this.prevHeights[i]+.3*(4+n*(u-4));const c=this.prevHeights[i],p=h+3*i,b=l-c/2;t.fillStyle=a,o(p,b,1,c,.5),t.fill()}};s()};formatDuration=i=>`${Math.floor(i/60)}:${(i%60).toString().padStart(2,"0")}`;render(){const i=60-this.recordingDuration;return r(a,{key:"ca20fe9dda634af0da1ef6da59880279f0775a9f"},r("div",{key:"dc3328cc1ef74e9683bc6c34e1d3279b2ca2ffa2",class:"wrapper"},r("div",{key:"b4a4d2799b8c541dc03679686107cc486373e76b",class:"glow"+("recording"===this.state?" visible":""),"aria-hidden":"true"}),r("div",{key:"f4fa8c638e68528dffd96db627bd80d4c7103143",class:"input-container"},"idle"===this.state?r("div",{class:"recording-row"},r("button",{type:"button",class:"submit-button",onClick:this.startRecording,disabled:this.disabled,"aria-label":"Start recording"},r("ai-icon",{name:"mic",size:16})),this.error&&r("div",{class:"error-message",role:"alert"},this.error)):r("div",{class:"recording-row"},r("button",{type:"button",class:"cancel-button",onClick:this.cancelRecording,"aria-label":"Cancel"},r("ai-icon",{name:"cancel",size:14})),r("div",{class:"timer"+(i<=5?" warning":"")},this.formatDuration(this.recordingDuration)),this.showWaveform&&r("canvas",{ref:i=>this.canvasRef=i,class:"waveform",height:"32"}),r("button",{type:"button",class:"submit-button"+(this.submitPulse?" pulse":""),onClick:this.stopRecording,"aria-label":"Send"},r("ai-icon",{name:"arrow-up",size:14}))))))}};o.style=":host{display:block;width:100%}.wrapper{position:relative;padding:var(--Spacing-Sizes-lg, 12px)}.glow{position:absolute;bottom:20px;left:39px;right:39px;height:29px;border-radius:9999px;background:var(--ai-input-glow);filter:blur(20px);opacity:0;pointer-events:none;transition:opacity 0.2s ease}.glow.visible{opacity:0.9}.input-container{position:relative;background-color:var(--ai-bg-input);border-radius:var(--ai-input-border-radius, 9999px);border:1px solid var(--ai-border-default);box-shadow:var(--ai-shadow-sm);padding:var(--ai-input-padding, 12px);overflow:hidden}.recording-row{display:flex;align-items:center;gap:var(--ai-input-gap, 10px)}.cancel-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:32px;max-height:32px;padding:4px 8px;border-radius:32px;border:2px solid var(--ai-border-default);background-color:var(--ai-border-default);color:var(--ai-text-secondary);cursor:pointer;flex-shrink:0;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.cancel-button:hover{background-color:var(--ai-bg-surface);border-color:var(--ai-bg-surface)}.submit-button{display:inline-flex;align-items:center;justify-content:center;height:32px;width:32px;min-width:32px;padding:4px 8px;border-radius:32px;border:2px solid var(--ai-send-button-active-border, var(--ai-accent));background-color:var(--ai-send-button-active-bg, var(--ai-accent));color:var(--ai-accent-text);cursor:pointer;flex-shrink:0;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.submit-button:hover{background-color:var(--ai-send-button-active-hover-bg, var(--ai-accent));border-color:var(--ai-send-button-active-hover-border, var(--ai-accent))}@keyframes pulse-once{0%{transform:scale(1)}40%{transform:scale(1.18)}100%{transform:scale(1)}}.submit-button.pulse{animation:pulse-once 0.35s ease}.timer{font-size:13px;font-weight:500;color:var(--ai-text-secondary);min-width:36px;text-align:center;flex-shrink:0}.timer.warning{color:var(--ai-voice-timer-warning-color, var(--ai-danger-text))}.waveform{flex:1;min-width:0;height:32px}.error-message{position:absolute;bottom:-40px;left:50%;transform:translateX(-50%);background:var(--ai-voice-error-bg, var(--ai-danger-bg));color:var(--ai-voice-error-color, var(--ai-danger-text));font-size:11px;padding:6px 12px;border-radius:6px;white-space:nowrap;box-shadow:var(--ai-shadow-error);border:1px solid var(--ai-voice-error-border, var(--ai-danger-border));z-index:10}";export{o as ai_voice_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,h as d,H as r}from"./p-VMEwYfaX.js";const i=class{constructor(d){a(this,d)}noPadding=!1;noShadow=!1;render(){return d(r,{key:"849dbf8d8eac913c76e71a10cb9b30f9fda3c320"},d("div",{key:"5d9f75428e6d94cf2c3729698e87fd3185c20129",class:{card:!0,"card--no-padding":this.noPadding,"card--no-shadow":this.noShadow}},d("slot",{key:"149e85041e3318ea8e5dfa7ddf67e6236e49e6e8",name:"header"}),d("slot",{key:"774d0408e091a0603e5feac3bc5927cf698b5c8c"}),d("slot",{key:"be0157314b280caa5c9b4f038ca6ca4aec2f8c8f",name:"footer"})))}};i.style=':host{--ai-card-border:1px solid var(--ai-border-default);--ai-card-radius:16px;--ai-card-padding:16px;--ai-card-gap:12px;--ai-card-shadow:var(--ai-shadow-sm);--ai-card-header-padding:16px;--ai-card-footer-padding:16px;display:block}.card{background:var(--ai-bg-card);border:var(--ai-card-border);border-radius:var(--ai-card-radius);padding:var(--ai-card-padding);box-shadow:var(--ai-card-shadow);box-sizing:border-box;overflow:hidden;color:var(--ai-text-primary);width:100%;display:flex;flex-direction:column;gap:var(--ai-card-gap);text-align:start;font-size:14px;line-height:20px}.card--no-padding{padding:0}.card--no-shadow{box-shadow:none}::slotted([slot="header"]){padding:var(--ai-card-header-padding);margin:calc(var(--ai-card-padding) * -1) calc(var(--ai-card-padding) * -1) 0}::slotted([slot="footer"]){padding:var(--ai-card-footer-padding);margin:0 calc(var(--ai-card-padding) * -1) calc(var(--ai-card-padding) * -1)}.card--no-padding ::slotted([slot="header"]){margin:0}.card--no-padding ::slotted([slot="footer"]){margin:0}';export{i as ai_card}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,h as e,H as n}from"./p-VMEwYfaX.js";import{i as a}from"./p-DlD8m3rf.js";const t=class{constructor(e){i(this,e)}label="";href="#";target="_blank";rel="";renderShareIcon(){const i=a.share;return i?e("span",{class:"link__icon",innerHTML:`<svg width="16" height="16" viewBox="${i.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${i.content}</svg>`}):null}render(){const i=this.rel||("_blank"===this.target?"noopener noreferrer":void 0);return e(n,{key:"
|
|
1
|
+
import{r as i,h as e,H as n}from"./p-VMEwYfaX.js";import{i as a}from"./p-DlD8m3rf.js";const t=class{constructor(e){i(this,e)}label="";href="#";target="_blank";rel="";renderShareIcon(){const i=a.share;return i?e("span",{class:"link__icon",innerHTML:`<svg width="16" height="16" viewBox="${i.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${i.content}</svg>`}):null}render(){const i=this.rel||("_blank"===this.target?"noopener noreferrer":void 0);return e(n,{key:"e0e34a4c2a3534a3b449bac613c6f7cb512420d3"},e("span",{key:"5776ddc64676ecaabb4f36a0e9833026dc730c23",class:"link__label"},this.label,e("slot",{key:"436a334a51bea342b839d5fad9743aaf6b66a94d"})),e("a",{key:"3880c1429a8a24a9dee700c9f0592ac673ce68f0",class:"link",href:this.href,target:this.target,rel:i},this.renderShareIcon()))}};t.style=":host{--ai-link-font-size:14px;--ai-link-font-weight:700;--ai-link-line-height:20px;--ai-link-gap:4px;--ai-link-icon-size:16px;display:flex;align-items:center;gap:var(--ai-link-gap)}.link{display:inline-flex;align-items:center;justify-content:flex-end;gap:var(--ai-link-gap);color:var(--ai-accent-dark);font-size:var(--ai-link-font-size);font-weight:var(--ai-link-font-weight);font-family:inherit;line-height:var(--ai-link-line-height);text-decoration:none;white-space:nowrap;cursor:pointer;transition:color 0.15s ease;outline:none}.link:hover{color:var(--ai-accent-dark);text-decoration:underline}.link:focus-visible{outline:2px solid var(--ai-accent);outline-offset:2px;border-radius:4px}.link__icon{display:inline-flex;align-items:center;justify-content:center;width:var(--ai-link-icon-size);height:var(--ai-link-icon-size);flex-shrink:0;line-height:0}.link__label{color:var(--ai-accent-dark);font-weight:bold}";export{t as ai_link}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as
|
|
1
|
+
import{p as e,g as a,b as t}from"./p-VMEwYfaX.js";export{s as setNonce}from"./p-VMEwYfaX.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await a(),t([["p-6a4b66ed",[[513,"ai-message-input",{placeholder:[1],disabled:[4],showVoiceButton:[4,"show-voice-button"],maxLength:[2,"max-length"],isRecording:[4,"is-recording"],inputValue:[32],showVoiceRecorder:[32],isMultiline:[32],setInputValue:[64]},null,{isRecording:[{onIsRecordingChange:0}]}]]],["p-338d55d3",[[513,"ai-rating",{question:[1],subtitle:[1],successMessage:[1,"success-message"],value:[1026],disabled:[4],hovered:[32],submitted:[32]}]]],["p-2fd7529e",[[513,"ai-chat-header",{mode:[1],conversation:[1],agentName:[1,"agent-name"],agentStatus:[1,"agent-status"],agentAvatar:[1,"agent-avatar"],showBack:[4,"show-back"],statusIndicator:[1,"status-indicator"],pageTitle:[1,"page-title"],pageUrl:[1,"page-url"],conversationItems:[16],conversationActiveId:[1,"conversation-active-id"],conversationLoading:[4,"conversation-loading"],conversationError:[4,"conversation-error"],conversationErrorText:[1,"conversation-error-text"],conversationRetryLabel:[1,"conversation-retry-label"],conversationEmptyText:[1,"conversation-empty-text"],conversationDeletingId:[1,"conversation-deleting-id"],titleLoading:[4,"title-loading"],avatarError:[32],dropdownOpen:[32],isFloating:[32]},[[4,"click","handleDocumentClick"]]]]],["p-4359a116",[[513,"ai-agent-error",{headline:[1],message:[1],errorCode:[1,"error-code"],retryable:[4],retryLabel:[1,"retry-label"],dismissible:[4]}]]],["p-1b247096",[[769,"ai-chat-container",{isOpen:[4,"is-open"],position:[1537],width:[1],autoScroll:[4,"auto-scroll"],showWatermark:[4,"show-watermark"],floatHeight:[1,"float-height"],theme:[1],loading:[4],error:[4],errorText:[1,"error-text"],retryLabel:[1,"retry-label"],direction:[513],isMobile:[32],floatLeft:[32],floatTop:[32],scrollToBottom:[64],cyclePosition:[64]},[[0,"headerPositionClick","handleHeaderPositionClick"]],{isOpen:[{isOpenChanged:0}],position:[{positionChanged:0}]}]]],["p-a1ee6005",[[769,"ai-chat-message",{role:[1],content:[1],format:[1],agentName:[1,"agent-name"],timestamp:[1],showActions:[4,"show-actions"],enableRegenerate:[4,"enable-regenerate"],feedbackValue:[1025,"feedback-value"],copySuccess:[32]}]]],["p-11c960d8",[[769,"ai-conversation-summary",{conversation:[1],summary:[1],messageCount:[2,"message-count"],language:[1]}]]],["p-79309690",[[513,"ai-in-chat-browser",{url:[1],pageTitle:[1,"page-title"],isLoading:[32],hasError:[32]},null,{url:[{onUrlChange:0}]}]]],["p-e1a2a622",[[769,"ai-link",{label:[1],href:[1],target:[1],rel:[1]}]]],["p-cae762e0",[[513,"ai-loading",{mode:[1],statusText:[1,"status-text"],thinkingSubtext:[1,"thinking-subtext"],steps:[16],headerTitle:[1,"header-title"],currentAgent:[1,"current-agent"],showAgentBadges:[4,"show-agent-badges"],expanded:[1028],collapsible:[4],_expanded:[32]}]]],["p-9a8614d0",[[513,"ai-route-decision",{selectedAgent:[1,"selected-agent"],agentIcon:[1,"agent-icon"],reason:[1],confidence:[2],detectedLanguage:[1,"detected-language"],expanded:[1028],_expanded:[32]}]]],["p-9af03dbd",[[769,"ai-suggestion",{label:[1],disabled:[4]}]]],["p-a5f53c8c",[[513,"ai-voice-input",{disabled:[4],showWaveform:[4,"show-waveform"],autoStart:[4,"auto-start"],errorText:[1,"error-text"],waveformColor:[1,"waveform-color"],state:[32],error:[32],recordingDuration:[32],submitPulse:[32]}]]],["p-cde479ea",[[769,"ai-card",{noPadding:[4,"no-padding"],noShadow:[4,"no-shadow"]}]]],["p-17e5d542",[[513,"ai-conversation-list",{items:[16],activeId:[1,"active-id"],loading:[4],emptyText:[1,"empty-text"],error:[4],errorText:[1,"error-text"],retryLabel:[1,"retry-label"],deletingId:[1,"deleting-id"]}]]],["p-6b644d32",[[513,"ai-icon",{name:[1],size:[2]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as a,H as d,h as r,d as o,t as i}from"./p-BPkf7wZg.js";const s=a(class extends d{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow()}noPadding=!1;noShadow=!1;render(){return r(o,{key:"849dbf8d8eac913c76e71a10cb9b30f9fda3c320"},r("div",{key:"5d9f75428e6d94cf2c3729698e87fd3185c20129",class:{card:!0,"card--no-padding":this.noPadding,"card--no-shadow":this.noShadow}},r("slot",{key:"f604568228c02514ff0f569cfa4fd706c247652e"})))}static get style(){return":host{--ai-card-border:1px solid var(--ai-border-default);--ai-card-radius:16px;--ai-card-padding:16px;--ai-card-gap:12px;--ai-card-shadow:var(--ai-shadow-sm);display:block}.card{background:var(--ai-bg-card);border:var(--ai-card-border);border-radius:var(--ai-card-radius);padding:var(--ai-card-padding);box-shadow:var(--ai-card-shadow);box-sizing:border-box;overflow:hidden;color:var(--ai-text-primary);width:100%;display:flex;flex-direction:column;gap:var(--ai-card-gap);text-align:start;font-size:14px;line-height:20px}.card--no-padding{padding:0}.card--no-shadow{box-shadow:none}"}},[769,"ai-card",{noPadding:[4,"no-padding"],noShadow:[4,"no-shadow"]}]);function c(){"undefined"!=typeof customElements&&["ai-card"].forEach((a=>{"ai-card"===a&&(customElements.get(i(a))||customElements.define(i(a),s))}))}export{s as A,c as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,h as d,H as r}from"./p-VMEwYfaX.js";const i=class{constructor(d){a(this,d)}noPadding=!1;noShadow=!1;render(){return d(r,{key:"849dbf8d8eac913c76e71a10cb9b30f9fda3c320"},d("div",{key:"5d9f75428e6d94cf2c3729698e87fd3185c20129",class:{card:!0,"card--no-padding":this.noPadding,"card--no-shadow":this.noShadow}},d("slot",{key:"f604568228c02514ff0f569cfa4fd706c247652e"})))}};i.style=":host{--ai-card-border:1px solid var(--ai-border-default);--ai-card-radius:16px;--ai-card-padding:16px;--ai-card-gap:12px;--ai-card-shadow:var(--ai-shadow-sm);display:block}.card{background:var(--ai-bg-card);border:var(--ai-card-border);border-radius:var(--ai-card-radius);padding:var(--ai-card-padding);box-shadow:var(--ai-card-shadow);box-sizing:border-box;overflow:hidden;color:var(--ai-text-primary);width:100%;display:flex;flex-direction:column;gap:var(--ai-card-gap);text-align:start;font-size:14px;line-height:20px}.card--no-padding{padding:0}.card--no-shadow{box-shadow:none}";export{i as ai_card}
|