@molin.ai/shop-ai 0.7.0 → 0.7.2
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.
|
@@ -28,7 +28,7 @@ var ep=Object.defineProperty;var ha=n=>{throw TypeError(n)};var tp=(n,e,t)=>e in
|
|
|
28
28
|
`);this.state="open",this.src=""}};C(ar,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",ar);var lr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ur=n=>(...e)=>({_$litDirective$:n,values:e}),yn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this.t=e,this._$AM=t,this.i=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Jp}=Ra;var _l=()=>document.createComment(""),_n=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(_l(),r),o=i.insertBefore(_l(),r);t=new Jp(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let u=l.nextSibling;i.insertBefore(l,r),l=u}}}return t},Rt=(n,e,t=n)=>(n._$AI(e,t),n),Yp={},bl=(n,e=Yp)=>n._$AH=e,wl=n=>n._$AH,cr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var xl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},ti=ur(class extends yn{constructor(n){if(super(n),n.type!==lr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=wl(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],u,c,p=0,f=r.length-1,d=0,g=s.length-1;for(;p<=f&&d<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[d])l[d]=Rt(r[p],s[d]),p++,d++;else if(a[f]===o[g])l[g]=Rt(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=Rt(r[p],s[g]),_n(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[d])l[d]=Rt(r[f],s[d]),_n(n,r[p],r[f]),f--,d++;else if(u===void 0&&(u=xl(o,d,g),c=xl(a,p,f)),u.has(a[p]))if(u.has(a[f])){let m=c.get(o[d]),E=m!==void 0?r[m]:null;if(E===null){let L=_n(n,r[p]);Rt(L,s[d]),l[d]=L}else l[d]=Rt(E,s[d]),_n(n,r[p],E),r[m]=null;d++}else cr(r[f]),f--;else cr(r[p]),p++;for(;d<=g;){let m=_n(n,l[g+1]);Rt(m,s[d]),l[d++]=m}for(;p<=f;){let m=r[p++];m!==null&&cr(m)}return this.ut=o,bl(n,l),nt}});function kl(n,e,t){return n?e(n):t?.(n)}var pr,Sl,fr=class fr extends z(U){constructor(){super();b(this,pr);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?N:D`
|
|
29
29
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
|
|
30
30
|
${kl(this.examples.title,()=>D`
|
|
31
|
-
<h2 class="mt-14
|
|
31
|
+
<h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
|
|
32
32
|
<span>${this.examples.title}</span>
|
|
33
33
|
<svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
|
|
34
34
|
<path
|
|
@@ -164,7 +164,7 @@ var ep=Object.defineProperty;var ha=n=>{throw TypeError(n)};var tp=(n,e,t)=>e in
|
|
|
164
164
|
</div>
|
|
165
165
|
</div>
|
|
166
166
|
`;default:throw new Error(`Unknown side: ${this.side}`)}}};C(dr,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",dr);var ii,Ne,rt,ri,Zs,hr=class{constructor(e,t){b(this,ri);b(this,ii);b(this,Ne);b(this,rt);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");S(this,ii,e),h(this,ii).addController(this),S(this,Ne,t)}connect(e){S(this,Ne,e),S(this,rt,$(this,ri,Zs).call(this))}hostConnected(){setTimeout(()=>{S(this,rt,$(this,ri,Zs).call(this))},0)}hostDisconnected(){h(this,rt)?.close(1e3,"lit_host_disconnected"),S(this,rt,void 0)}send(e){h(this,rt)?.send(e)}close(e,t){h(this,rt)?.close(e,t)}render(e={}){switch(h(this,rt)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,rt)?.readyState===WebSocket.OPEN}};ii=new WeakMap,Ne=new WeakMap,rt=new WeakMap,ri=new WeakSet,Zs=function(){let e=new WebSocket(h(this,Ne).url());return h(this,Ne).onClose&&(e.onclose=h(this,Ne).onClose),h(this,Ne).onOpen&&(e.onopen=h(this,Ne).onOpen),h(this,Ne).onError&&(e.onerror=h(this,Ne).onError),h(this,Ne).onMessage&&(e.onmessage=h(this,Ne).onMessage),e};var Rl="664df22d-d461-42d6-801e-f70247e2cd7c",me,ye,st,kn,Sn,we,Qt,Pl,Ol,Fl,Ml,vr=class{constructor(e,t){b(this,we);b(this,me);b(this,ye);b(this,st);C(this,"isStreaming",!1);C(this,"typingIndicator");C(this,"ranOutOfCredits",!1);C(this,"messages",[]);C(this,"conversationId","");b(this,kn,0);b(this,Sn);C(this,"isLiveMode",!1);S(this,me,e),S(this,ye,t),S(this,st,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return $(this,we,Qt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return $(this,we,Qt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,we,Qt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,we,Qt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,we,Qt).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,st).close(1e3,"closed by user")}retry(){clearTimeout(h(this,Sn)),S(this,Sn,setTimeout(()=>{h(this,ye).onReconnect?.(),S(this,st,this.initWS())},1e3*h(this,kn))),va(this,kn)._++}initWS(){return new hr(h(this,me),{url:()=>h(this,ye).url(this.conversationId,{}),onOpen:e=>$(this,we,Pl).call(this,e),onMessage:e=>$(this,we,Ol).call(this,JSON.parse(e.data)),onError:e=>$(this,we,Fl).call(this,e),onClose:e=>$(this,we,Ml).call(this,e)})}hostConnected(){this.conversationId=h(this,ye).restoreConversationState?.()?.conversationId||"",this.messages=h(this,ye).restoreConversationState?.()?.messages||[]}reset(){$(this,we,Qt).call(this,{type:"NEW_CHAT"}),h(this,ye).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,me).requestUpdate()}hostDisconnected(){clearTimeout(h(this,Sn))}reconnectSocket(){h(this,st).close(1e3,"destroy"),S(this,st,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};me=new WeakMap,ye=new WeakMap,st=new WeakMap,kn=new WeakMap,Sn=new WeakMap,we=new WeakSet,Qt=function(e,{expectStreaming:t=!1}={}){return h(this,st).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,me).requestUpdate()),h(this,st).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Pl=function(e){S(this,kn,0)},Ol=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),h(this,me).requestUpdate(),h(this,ye).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,h(this,me).requestUpdate(),h(this,ye).onMessageDone?.(e,t),h(this,ye).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"ERROR":{h(this,ye).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,ye).onConnect?.(e.conversationId),h(this,ye).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,me).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,me).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Rl)||this.messages.push({id:Rl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,me).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,me).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Fl=function(e){console.error("onError",e),h(this,ye).onError?.(e)},Ml=function(e){h(this,me).isConnected&&!h(this,st).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onClose?.()};var si,En,Pt,Zt,mr,Dl,gr=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,mr);b(this,si);b(this,En);b(this,Pt);b(this,Zt,!1);C(this,"timeoutMs");S(this,si,e),S(this,En,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,Zt)}hostDisconnected(){clearTimeout(h(this,Pt)),S(this,Pt,void 0)}onInput(e){if(h(this,si).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,Pt)),S(this,Pt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,Zt)||$(this,mr,Dl).call(this)}}typingStopped(){clearTimeout(h(this,Pt)),S(this,Zt,!1),h(this,En).typingStopped()}};si=new WeakMap,En=new WeakMap,Pt=new WeakMap,Zt=new WeakMap,mr=new WeakSet,Dl=function(){S(this,Zt,!0),h(this,En).typingStarted()};function Ll(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function Nl(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var eo;function Qp(n){return{lang:n?.lang??eo?.lang,message:n?.message,abortEarly:n?.abortEarly??eo?.abortEarly,abortPipeEarly:n?.abortPipeEarly??eo?.abortPipeEarly}}var Zp;function ef(n){return Zp?.get(n)}var tf;function nf(n){return tf?.get(n)}var rf;function sf(n,e){return rf?.get(n)?.get(e)}function $n(n){let e=typeof n;return e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e==="object"||e==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":e}function Ot(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??$n(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=n.kind==="schema",c=r?.message??n.message??sf(n.reference,l.lang)??(u?nf(l.lang):null)??i.message??ef(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}function of(n,e){let t=[...new Set(n)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var af=class extends Error{constructor(e){super(e[0].message);C(this,"issues");this.name="ValiError",this.issues=e}};function to(n,e){return{kind:"validation",type:"max_value",reference:to,async:!1,expects:`<=${n instanceof Date?n.toJSON():$n(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Ot(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():$n(t.value)}),t}}}function no(n,e){return{kind:"validation",type:"min_value",reference:no,async:!1,expects:`>=${n instanceof Date?n.toJSON():$n(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Ot(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():$n(t.value)}),t}}}function lf(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function yt(n,e){return{kind:"schema",type:"array",reference:yt,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Ot(this,"type",t,i);return t}}}function Ce(n){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Ot(this,"type",e,t),e}}}function He(n){return{kind:"schema",type:"number",reference:He,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ot(this,"type",e,t),e}}}function re(n,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Ot(this,"type",t,i);return t}}}function A(n,...e){let t={kind:"schema",type:"optional",reference:A,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=lf(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function Cn(n,e){return{kind:"schema",type:"picklist",reference:Cn,expects:of(n.map($n),"|"),async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Ot(this,"type",t,i),t}}}function j(n){return{kind:"schema",type:"string",reference:j,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Ot(this,"type",e,t),e}}}function jl(n,e,t){let i=n._run({typed:!1,value:e},Qp(t));if(i.issues)throw new af(i.issues);return i.value}function ql(...n){return{...n[0],pipe:n,_run(e,t){for(let i of n)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i._run(e,t))}return e}}}var Qv=re({wsApiUrl:j(),url:j(),logoUrl:A(j()),title:j(),status:j(),color:j(),showStillLearningBanner:A(Ce()),allowedOrigins:A(yt(j())),input:re({placeholder:j()}),bubble:re({imageUrl:A(j()),position:re({bottom:A(j()),right:A(j()),left:A(j())}),mobilePosition:A(re({bottom:A(j()),right:A(j()),left:A(j())}))}),examples:re({title:j(),items:yt(j())}),instructions:re({items:yt(j())}),popup:A(re({mobileEnabled:A(Ce()),desktopEnabled:A(Ce()),delayMs:A(He()),text:A(j()),mobileTitleText:A(j()),mobileButtonText:A(j())})),tryItOut:A(re({mobileEnabled:A(Ce()),desktopEnabled:A(Ce()),text:A(j())})),contactDetails:A(re({email:A(j()),phone:A(j()),socialMedia:A(re({facebook:A(j()),instagram:A(j()),twitter:A(j())}))})),neverShowStillLearningBanner:A(Ce()),hidden:A(Ce()),newChatTitle:A(j()),webhookURL:A(j()),automatedResponse:A(re({enabled:A(Ce()),text:A(j()),latencyThresholdMs:A(He())})),removePoweredBy:A(Ce()),claimable:A(Ce()),feed:A(j()),scraper:A(Cn(["netkazan","jateknet","grandopet","insportline","partocean","google-rev1"])),platform:A(Cn(["shopify","shoprenter","unas","scraper"])),workingHours:A(re({dailyAvailability:yt(re({dayOfWeek:ql(He(),no(0),to(6)),startTime:j(),endTime:j(),isActive:Ce()})),userTimeZone:A(j())})),planOverrides:A(re({maxProducts:A(He()),conversations:A(He()),faqs:A(re({max:A(He()),questionLength:A(He()),answerLength:A(He())}))})),omitGeneralGuidelines:A(Ce()),forceStripe:A(Ce()),products:A(re({blocklistUrls:A(yt(j()))})),autoRefresh:A(re({enabled:A(Ce()),intervalMins:A(He())})),lang:A(j())});var oi=class extends yn{constructor(e){if(super(e),this.it=N,e.type!==lr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===nt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};oi.directiveName="unsafeHTML",oi.resultType=1;var Bl=ur(oi);var uf="\xB7 \xB7 \xB7",cf=re({conversationId:A(j()),messages:A(yt(re({id:j(),timestamp:He(),role:Cn(["user","assistant","support"]),content:j(),content_html:A(j())})))}),se,yr,li,ae,ot,Hl,zl,Wl,Vl,Gl,Xl,Jl,ro,_r=class _r extends z(U){constructor(){super();b(this,se);b(this,li,new gr(this,{typingStarted:()=>h(this,ae).sendUserTypingStart(),typingStopped:()=>h(this,ae).sendUserTypingStop()}));b(this,ae,new vr(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&h(this,se,ro)?.scrollTo(0,h(this,se,ro).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(h(this,se,yr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,se,yr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,se,yr))||"{}"),i=jl(cf,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));b(this,ot,"single");this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,ae).conversationId}get messages(){return h(this,ae).messages}render(){console.assert(this.config,"config is required");let t=Ll(this.messages,i=>{try{let r=new Date(i.timestamp),s=Math.floor(r.getUTCMinutes()/5)*5;return r.setUTCMinutes(s,0,0),r.valueOf().toString()}catch(r){console.error(r)}});return D`
|
|
167
|
-
<div class="relative mx-auto h-full font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:p-1.5 sm:before:rounded-[36px]">
|
|
167
|
+
<div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
|
|
168
168
|
<div class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
|
|
169
169
|
<mw-chat-header
|
|
170
170
|
class="absolute left-1.5 right-1.5 top-1.5"
|
|
@@ -181,7 +181,7 @@ var ep=Object.defineProperty;var ha=n=>{throw TypeError(n)};var tp=(n,e,t)=>e in
|
|
|
181
181
|
</div>
|
|
182
182
|
|
|
183
183
|
<!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
|
|
184
|
-
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto
|
|
184
|
+
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
|
|
185
185
|
${this.config?.showStillLearningBanner?D`
|
|
186
186
|
<div class="flex justify-center">
|
|
187
187
|
<div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
|
|
@@ -229,7 +229,7 @@ var ep=Object.defineProperty;var ha=n=>{throw TypeError(n)};var tp=(n,e,t)=>e in
|
|
|
229
229
|
</div>
|
|
230
230
|
|
|
231
231
|
<mw-chat-background
|
|
232
|
-
class="
|
|
232
|
+
class="flex-grow"
|
|
233
233
|
.examples="${this.messages.length>0?[]:this.config.examples}"
|
|
234
234
|
color="${this.config.color}"
|
|
235
235
|
@mw:example-click="${$(this,se,zl)}"></mw-chat-background>
|