@htmlbricks/hb-messages-box 0.61.40 → 0.61.42

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/main.iife.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(ce){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const wr=1,yr=4,Er=8,br=16,Sr=2,Tr="[",Nr="]",mt={},S=Symbol(),xr="http://www.w3.org/1999/xhtml",he=!1;var ve=Array.isArray,Ar=Array.prototype.indexOf,Or=Array.from,At=Object.keys,at=Object.defineProperty,z=Object.getOwnPropertyDescriptor,Rr=Object.getOwnPropertyDescriptors,Pr=Object.prototype,Cr=Array.prototype,_e=Object.getPrototypeOf,de=Object.isExtensible;function pe(t){for(var e=0;e<t.length;e++)t[e]()}function kr(){var t,e,r=new Promise((n,s)=>{t=n,e=s});return{promise:r,resolve:t,reject:e}}const O=2,Bt=4,Ut=8,$t=16,Z=32,W=64,ge=128,M=256,Ot=512,N=1024,L=2048,V=4096,ut=8192,Q=16384,me=32768,Ir=65536,$e=1<<17,Mr=1<<18,ft=1<<19,Lr=1<<20,Ht=1<<21,Gt=1<<22,tt=1<<23,Rt=Symbol("$state"),we=Symbol("legacy props"),jr=Symbol(""),Wt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},qr=3,ye=8;function Dr(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Fr(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Yr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Br(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ur(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Hr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Gr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Wr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Vt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}let E=!1;function ot(t){E=t}let x;function ct(t){if(t===null)throw Vt(),mt;return x=t}function Ee(){return ct(Et(x))}function Xt(t){if(E){if(Et(x)!==null)throw Vt(),mt;x=t}}function be(t){return t===this.v}function Vr(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Se(t){return!Vr(t,this.v)}let Xr=!1,F=null;function Pt(t){F=t}function Te(t,e=!1,r){F={p:F,c:null,e:null,s:t,x:null,l:null}}function Ne(t){var e=F,r=e.e;if(r!==null){e.e=null;for(var n of r)_n(n)}return t!==void 0&&(e.x=t),F=e.p,t??{}}function xe(){return!0}const Kr=new WeakMap;function Jr(t){var e=m;if(e===null)return $.f|=tt,t;if((e.f&me)===0){if((e.f&ge)===0)throw!e.parent&&t instanceof Error&&Ae(t),t;e.b.error(t)}else Kt(t,e)}function Kt(t,e){for(;e!==null;){if((e.f&ge)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&Ae(t),t}function Ae(t){const e=Kr.get(t);e&&(at(t,"message",{value:e.message}),at(t,"stack",{value:e.stack}))}let wt=[],Jt=[];function Oe(){var t=wt;wt=[],pe(t)}function zr(){var t=Jt;Jt=[],pe(t)}function Zr(t){wt.length===0&&queueMicrotask(Oe),wt.push(t)}function Qr(){wt.length>0&&Oe(),Jt.length>0&&zr()}function tn(){const t=m.b;return t===null&&Dr(),t}function Ct(t){var e=O|L,r=$!==null&&($.f&O)!==0?$:null;return m===null||r!==null&&(r.f&M)!==0?e|=M:m.f|=ft,{ctx:F,deps:null,effects:null,equals:be,f:e,fn:t,reactions:null,rv:0,v:S,wv:0,parent:r??m,ac:null}}function en(t,e){let r=m;r===null&&Fr();var n=r.b,s=void 0,i=te(S),l=null,a=!$;return mn(()=>{try{var u=t();l&&Promise.resolve(u).catch(()=>{})}catch(h){u=Promise.reject(h)}var f=()=>u;s=l?.then(f,f)??Promise.resolve(u),l=s;var o=T,c=n.is_pending();a&&(n.update_pending_count(1),c||o.increment());const _=(h,p=void 0)=>{l=null,c||o.activate(),p?p!==Wt&&(i.f|=tt,ee(i,p)):((i.f&tt)!==0&&(i.f^=tt),ee(i,h)),a&&(n.update_pending_count(-1),c||o.decrement()),Ce()};if(s.then(_,h=>_(null,h||"unknown")),o)return()=>{queueMicrotask(()=>o.neuter())}}),new Promise(u=>{function f(o){function c(){o===s?u(i):f(s)}o.then(c,c)}f(s)})}function rn(t){const e=Ct(t);return Xe(e),e}function nn(t){const e=Ct(t);return e.equals=Se,e}function Re(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)K(e[r])}}function sn(t){for(var e=t.parent;e!==null;){if((e.f&O)===0)return e;e=e.parent}return null}function zt(t){var e,r=m;B(sn(t));try{Re(t),e=Qe(t)}finally{B(r)}return e}function Pe(t){var e=zt(t);if(t.equals(e)||(t.v=e,t.wv=ze()),!_t){var r=(J||(t.f&M)!==0)&&t.deps!==null?V:N;C(t,r)}}function ln(t,e,r){const n=Ct;if(e.length===0){r(t.map(n));return}var s=T,i=m,l=an(),a=tn();Promise.all(e.map(u=>en(u))).then(u=>{s?.activate(),l();try{r([...t.map(n),...u])}catch(f){(i.f&Q)===0&&Kt(f,i)}s?.deactivate(),Ce()}).catch(u=>{a.error(u)})}function an(){var t=m,e=$,r=F,n=T;return function(){B(t),k(e),Pt(r),n?.activate()}}function Ce(){B(null),k(null),Pt(null)}const Zt=new Set;let T=null,ke=new Set,kt=[];function Ie(){const t=kt.shift();kt.length>0&&queueMicrotask(Ie),t()}let et=[],It=null,Qt=!1,Mt=!1;class rt{current=new Map;#e=new Map;#t=new Set;#r=0;#f=null;#o=!1;#s=[];#l=[];#i=[];#n=[];#a=[];#c=[];#h=[];skipped_effects=new Set;process(e){et=[];for(const s of e)this.#_(s);if(this.#s.length===0&&this.#r===0){this.#v();var r=this.#i,n=this.#n;this.#i=[],this.#n=[],this.#a=[],T=null,Le(r),Le(n),T===null?T=this:Zt.delete(this),this.#f?.resolve()}else this.#u(this.#i),this.#u(this.#n),this.#u(this.#a);for(const s of this.#s)dt(s);for(const s of this.#l)dt(s);this.#s=[],this.#l=[]}#_(e){e.f^=N;for(var r=e.first;r!==null;){var n=r.f,s=(n&(Z|W))!==0,i=s&&(n&N)!==0,l=i||(n&ut)!==0||this.skipped_effects.has(r);if(!l&&r.fn!==null){if(s)r.f^=N;else if((n&Bt)!==0)this.#n.push(r);else if((n&N)===0)if((n&Gt)!==0){var a=r.b?.is_pending()?this.#l:this.#s;a.push(r)}else qt(r)&&((r.f&$t)!==0&&this.#a.push(r),dt(r));var u=r.first;if(u!==null){r=u;continue}}var f=r.parent;for(r=r.next;r===null&&f!==null;)r=f.next,f=f.parent}}#u(e){for(const r of e)((r.f&L)!==0?this.#c:this.#h).push(r),C(r,N);e.length=0}capture(e,r){this.#e.has(e)||this.#e.set(e,r),this.current.set(e,e.v)}activate(){T=this}deactivate(){T=null;for(const e of ke)if(ke.delete(e),e(),T!==null)break}neuter(){this.#o=!0}flush(){et.length>0?Me():this.#v(),T===this&&(this.#r===0&&Zt.delete(this),this.deactivate())}#v(){if(!this.#o)for(const e of this.#t)e();this.#t.clear()}increment(){this.#r+=1}decrement(){if(this.#r-=1,this.#r===0){for(const e of this.#c)C(e,L),yt(e);for(const e of this.#h)C(e,V),yt(e);this.#i=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#f??=kr()).promise}static ensure(){if(T===null){const e=T=new rt;Zt.add(T),Mt||rt.enqueue(()=>{T===e&&e.flush()})}return T}static enqueue(e){kt.length===0&&queueMicrotask(Ie),kt.unshift(e)}}function ht(t){var e=Mt;Mt=!0;try{for(var r;;){if(Qr(),et.length===0&&(T?.flush(),et.length===0))return It=null,r;Me()}}finally{Mt=e}}function Me(){var t=vt;Qt=!0;try{var e=0;for(We(!0);et.length>0;){var r=rt.ensure();if(e++>1e3){var n,s;un()}r.process(et),X.clear()}}finally{Qt=!1,We(t),It=null}}function un(){try{Yr()}catch(t){Kt(t,It)}}let nt=null;function Le(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Q|ut))===0&&qt(n)&&(nt=[],dt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?He(n):n.fn=null),nt?.length>0)){X.clear();for(const s of nt)dt(s);nt=[]}}nt=null}}function yt(t){for(var e=It=t;e.parent!==null;){e=e.parent;var r=e.f;if(Qt&&e===m&&(r&$t)!==0)return;if((r&(W|Z))!==0){if((r&N)===0)return;e.f^=N}}et.push(e)}const X=new Map;function te(t,e){var r={f:0,v:t,reactions:null,equals:be,rv:0,wv:0};return r}function j(t,e){const r=te(t);return Xe(r),r}function fn(t,e=!1,r=!0){const n=te(t);return e||(n.equals=Se),n}function q(t,e,r=!1){$!==null&&(!Y||($.f&$e)!==0)&&xe()&&($.f&(O|$t|Gt|$e))!==0&&!H?.includes(t)&&Wr();let n=r?st(e):e;return ee(t,n)}function ee(t,e){if(!t.equals(e)){var r=t.v;_t?X.set(t,e):X.set(t,r),t.v=e;var n=rt.ensure();n.capture(t,r),(t.f&O)!==0&&((t.f&L)!==0&&zt(t),C(t,(t.f&M)===0?N:V)),t.wv=ze(),je(t,L),m!==null&&(m.f&N)!==0&&(m.f&(Z|W))===0&&(I===null?Tn([t]):I.push(t))}return e}function re(t){q(t,t.v+1)}function je(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var i=r[s],l=i.f,a=(l&L)===0;a&&C(i,e),(l&O)!==0?je(i,V):a&&((l&$t)!==0&&nt!==null&&nt.push(i),yt(i))}}function st(t){if(typeof t!="object"||t===null||Rt in t)return t;const e=_e(t);if(e!==Pr&&e!==Cr)return t;var r=new Map,n=ve(t),s=j(0),i=it,l=a=>{if(it===i)return a();var u=$,f=it;k(null),Je(i);var o=a();return k(u),Je(f),o};return n&&r.set("length",j(t.length)),new Proxy(t,{defineProperty(a,u,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Hr();var o=r.get(u);return o===void 0?o=l(()=>{var c=j(f.value);return r.set(u,c),c}):q(o,f.value,!0),!0},deleteProperty(a,u){var f=r.get(u);if(f===void 0){if(u in a){const o=l(()=>j(S));r.set(u,o),re(s)}}else q(f,S),re(s);return!0},get(a,u,f){if(u===Rt)return t;var o=r.get(u),c=u in a;if(o===void 0&&(!c||z(a,u)?.writable)&&(o=l(()=>{var h=st(c?a[u]:S),p=j(h);return p}),r.set(u,o)),o!==void 0){var _=P(o);return _===S?void 0:_}return Reflect.get(a,u,f)},getOwnPropertyDescriptor(a,u){var f=Reflect.getOwnPropertyDescriptor(a,u);if(f&&"value"in f){var o=r.get(u);o&&(f.value=P(o))}else if(f===void 0){var c=r.get(u),_=c?.v;if(c!==void 0&&_!==S)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return f},has(a,u){if(u===Rt)return!0;var f=r.get(u),o=f!==void 0&&f.v!==S||Reflect.has(a,u);if(f!==void 0||m!==null&&(!o||z(a,u)?.writable)){f===void 0&&(f=l(()=>{var _=o?st(a[u]):S,h=j(_);return h}),r.set(u,f));var c=P(f);if(c===S)return!1}return o},set(a,u,f,o){var c=r.get(u),_=u in a;if(n&&u==="length")for(var h=f;h<c.v;h+=1){var p=r.get(h+"");p!==void 0?q(p,S):h in a&&(p=l(()=>j(S)),r.set(h+"",p))}if(c===void 0)(!_||z(a,u)?.writable)&&(c=l(()=>j(void 0)),q(c,st(f)),r.set(u,c));else{_=c.v!==S;var d=l(()=>st(f));q(c,d)}var y=Reflect.getOwnPropertyDescriptor(a,u);if(y?.set&&y.set.call(o,f),!_){if(n&&typeof u=="string"){var b=r.get("length"),v=Number(u);Number.isInteger(v)&&v>=b.v&&q(b,v+1)}re(s)}return!0},ownKeys(a){P(s);var u=Reflect.ownKeys(a).filter(c=>{var _=r.get(c);return _===void 0||_.v!==S});for(var[f,o]of r)o.v!==S&&!(f in a)&&u.push(f);return u},setPrototypeOf(){Gr()}})}var qe,De,Fe,Ye;function ne(){if(qe===void 0){qe=window,De=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fe=z(e,"firstChild").get,Ye=z(e,"nextSibling").get,de(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),de(r)&&(r.__t=void 0)}}function se(t=""){return document.createTextNode(t)}function Lt(t){return Fe.call(t)}function Et(t){return Ye.call(t)}function ie(t,e){if(!E)return Lt(t);var r=Lt(x);return r===null&&(r=x.appendChild(se())),ct(r),r}function on(t,e=1,r=!1){let n=E?x:t;for(var s;e--;)s=n,n=Et(n);if(!E)return n;if(r&&n?.nodeType!==qr){var i=se();return n===null?s?.after(i):n.before(i),ct(i),i}return ct(n),n}function cn(t){t.textContent=""}function le(t){var e=$,r=m;k(null),B(null);try{return t()}finally{k(e),B(r)}}function hn(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function U(t,e,r,n=!0){var s=m;s!==null&&(s.f&ut)!==0&&(t|=ut);var i={ctx:F,deps:null,nodes_start:null,nodes_end:null,f:t|L,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{dt(i),i.f|=me}catch(u){throw K(i),u}else e!==null&&yt(i);if(n){var l=i;if(r&&l.deps===null&&l.teardown===null&&l.nodes_start===null&&l.first===l.last&&(l.f&ft)===0&&(l=l.first),l!==null&&(l.parent=s,s!==null&&hn(l,s),$!==null&&($.f&O)!==0&&(t&W)===0)){var a=$;(a.effects??=[]).push(l)}}return i}function vn(t){const e=U(Ut,null,!1);return C(e,N),e.teardown=t,e}function _n(t){return U(Bt|Lr,t,!1)}function dn(t){rt.ensure();const e=U(W|ft,t,!0);return()=>{K(e)}}function pn(t){rt.ensure();const e=U(W|ft,t,!0);return(r={})=>new Promise(n=>{r.outro?bn(e,()=>{K(e),n(void 0)}):(K(e),n(void 0))})}function gn(t){return U(Bt,t,!1)}function mn(t){return U(Gt|ft,t,!0)}function $n(t,e=0){return U(Ut|e,t,!0)}function jt(t,e=[],r=[]){ln(e,r,n=>{U(Ut,()=>t(...n.map(P)),!0)})}function wn(t,e=!0){return U(Z|ft,t,!0,e)}function Be(t){var e=t.teardown;if(e!==null){const r=_t,n=$;Ve(!0),k(null);try{e.call(null)}finally{Ve(r),k(n)}}}function Ue(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&le(()=>{s.abort(Wt)});var n=r.next;(r.f&W)!==0?r.parent=null:K(r,e),r=n}}function yn(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&Z)===0&&K(e),e=r}}function K(t,e=!0){var r=!1;(e||(t.f&Mr)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(En(t.nodes_start,t.nodes_end),r=!0),Ue(t,e&&!r),Dt(t,0),C(t,Q);var n=t.transitions;if(n!==null)for(const i of n)i.stop();Be(t);var s=t.parent;s!==null&&s.first!==null&&He(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function En(t,e){for(;t!==null;){var r=t===e?null:Et(t);t.remove(),t=r}}function He(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function bn(t,e){var r=[];Ge(t,r,!0),Sn(r,()=>{K(t),e&&e()})}function Sn(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var s of t)s.out(n)}else e()}function Ge(t,e,r){if((t.f&ut)===0){if(t.f^=ut,t.transitions!==null)for(const l of t.transitions)(l.is_global||r)&&e.push(l);for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Ir)!==0||(n.f&Z)!==0;Ge(n,e,i?r:!1),n=s}}}let vt=!1;function We(t){vt=t}let _t=!1;function Ve(t){_t=t}let $=null,Y=!1;function k(t){$=t}let m=null;function B(t){m=t}let H=null;function Xe(t){$!==null&&(H===null?H=[t]:H.push(t))}let A=null,R=0,I=null;function Tn(t){I=t}let Ke=1,bt=0,it=bt;function Je(t){it=t}let J=!1;function ze(){return++Ke}function qt(t){var e=t.f;if((e&L)!==0)return!0;if((e&V)!==0){var r=t.deps,n=(e&M)!==0;if(r!==null){var s,i,l=(e&Ot)!==0,a=n&&m!==null&&!J,u=r.length;if((l||a)&&(m===null||(m.f&Q)===0)){var f=t,o=f.parent;for(s=0;s<u;s++)i=r[s],(l||!i?.reactions?.includes(f))&&(i.reactions??=[]).push(f);l&&(f.f^=Ot),a&&o!==null&&(o.f&M)===0&&(f.f^=M)}for(s=0;s<u;s++)if(i=r[s],qt(i)&&Pe(i),i.wv>t.wv)return!0}(!n||m!==null&&!J)&&C(t,N)}return!1}function Ze(t,e,r=!0){var n=t.reactions;if(n!==null&&!H?.includes(t))for(var s=0;s<n.length;s++){var i=n[s];(i.f&O)!==0?Ze(i,e,!1):e===i&&(r?C(i,L):(i.f&N)!==0&&C(i,V),yt(i))}}function Qe(t){var e=A,r=R,n=I,s=$,i=J,l=H,a=F,u=Y,f=it,o=t.f;A=null,R=0,I=null,J=(o&M)!==0&&(Y||!vt||$===null),$=(o&(Z|W))===0?t:null,H=null,Pt(t.ctx),Y=!1,it=++bt,t.ac!==null&&(le(()=>{t.ac.abort(Wt)}),t.ac=null);try{t.f|=Ht;var c=t.fn,_=c(),h=t.deps;if(A!==null){var p;if(Dt(t,R),h!==null&&R>0)for(h.length=R+A.length,p=0;p<A.length;p++)h[R+p]=A[p];else t.deps=h=A;if(!J||(o&O)!==0&&t.reactions!==null)for(p=R;p<h.length;p++)(h[p].reactions??=[]).push(t)}else h!==null&&R<h.length&&(Dt(t,R),h.length=R);if(xe()&&I!==null&&!Y&&h!==null&&(t.f&(O|V|L))===0)for(p=0;p<I.length;p++)Ze(I[p],t);return s!==null&&s!==t&&(bt++,I!==null&&(n===null?n=I:n.push(...I))),(t.f&tt)!==0&&(t.f^=tt),_}catch(d){return Jr(d)}finally{t.f^=Ht,A=e,R=r,I=n,$=s,J=i,H=l,Pt(a),Y=u,it=f}}function Nn(t,e){let r=e.reactions;if(r!==null){var n=Ar.call(r,t);if(n!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[n]=r[s],r.pop())}}r===null&&(e.f&O)!==0&&(A===null||!A.includes(e))&&(C(e,V),(e.f&(M|Ot))===0&&(e.f^=Ot),Re(e),Dt(e,0))}function Dt(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Nn(t,r[n])}function dt(t){var e=t.f;if((e&Q)===0){C(t,N);var r=m,n=vt;m=t,vt=!0;try{(e&$t)!==0?yn(t):Ue(t),Be(t);var s=Qe(t);t.teardown=typeof s=="function"?s:null,t.wv=Ke;var i;he&&Xr&&(t.f&L)!==0&&t.deps}finally{vt=n,m=r}}}function P(t){var e=t.f,r=(e&O)!==0;if($!==null&&!Y){var n=m!==null&&(m.f&Q)!==0;if(!n&&!H?.includes(t)){var s=$.deps;if(($.f&Ht)!==0)t.rv<bt&&(t.rv=bt,A===null&&s!==null&&s[R]===t?R++:A===null?A=[t]:(!J||!A.includes(t))&&A.push(t));else{($.deps??=[]).push(t);var i=t.reactions;i===null?t.reactions=[$]:i.includes($)||i.push($)}}}else if(r&&t.deps===null&&t.effects===null){var l=t,a=l.parent;a!==null&&(a.f&M)===0&&(l.f^=M)}if(_t){if(X.has(t))return X.get(t);if(r){l=t;var u=l.v;return((l.f&N)===0&&l.reactions!==null||tr(l))&&(u=zt(l)),X.set(l,u),u}}else r&&(l=t,qt(l)&&Pe(l));if((t.f&tt)!==0)throw t.v;return t.v}function tr(t){if(t.v===S)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(X.has(e)||(e.f&O)!==0&&tr(e))return!0;return!1}function xn(t){var e=Y;try{return Y=!0,t()}finally{Y=e}}const An=-7169;function C(t,e){t.f=t.f&An|e}const On=new Set,er=new Set;function Rn(t,e,r,n={}){function s(i){if(n.capture||St.call(e,i),!i.cancelBubble)return le(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Zr(()=>{e.addEventListener(t,s,n)}):e.addEventListener(t,s,n),s}function Pn(t,e,r,n,s){var i={capture:n,passive:s},l=Rn(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&vn(()=>{e.removeEventListener(t,l,i)})}let rr=null;function St(t){var e=this,r=e.ownerDocument,n=t.type,s=t.composedPath?.()||[],i=s[0]||t.target;rr=t;var l=0,a=rr===t&&t.__root;if(a){var u=s.indexOf(a);if(u!==-1&&(e===document||e===window)){t.__root=e;return}var f=s.indexOf(e);if(f===-1)return;u<=f&&(l=u)}if(i=s[l]||t.target,i!==e){at(t,"currentTarget",{configurable:!0,get(){return i||r}});var o=$,c=m;k(null),B(null);try{for(var _,h=[];i!==null;){var p=i.assignedSlot||i.parentNode||i.host||null;try{var d=i["__"+n];if(d!=null&&(!i.disabled||t.target===i))if(ve(d)){var[y,...b]=d;y.apply(i,[t,...b])}else d.call(i,t)}catch(v){_?h.push(v):_=v}if(t.cancelBubble||p===e||p===null)break;i=p}if(_){for(let v of h)queueMicrotask(()=>{throw v});throw _}}finally{t.__root=e,delete t.currentTarget,k(o),B(c)}}}function Cn(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ae(t,e){var r=m;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function kn(t,e){var r=(e&Sr)!==0,n,s=!t.startsWith("<!>");return()=>{if(E)return ae(x,null),x;n===void 0&&(n=Cn(s?t:"<!>"+t),n=Lt(n));var i=r||De?document.importNode(n,!0):n.cloneNode(!0);return ae(i,i),i}}function nr(t,e){if(E){m.nodes_end=x,Ee();return}t!==null&&t.before(e)}const In=["touchstart","touchmove"];function Mn(t){return In.includes(t)}function sr(t,e){return ir(t,e)}function Ln(t,e){ne(),e.intro=e.intro??!1;const r=e.target,n=E,s=x;try{for(var i=Lt(r);i&&(i.nodeType!==ye||i.data!==Tr);)i=Et(i);if(!i)throw mt;ot(!0),ct(i),Ee();const l=ir(t,{...e,anchor:i});if(x===null||x.nodeType!==ye||x.data!==Nr)throw Vt(),mt;return ot(!1),l}catch(l){if(l instanceof Error&&l.message.split(`
2
- `).some(a=>a.startsWith("https://svelte.dev/e/")))throw l;return l!==mt&&console.warn("Failed to hydrate: ",l),e.recover===!1&&Br(),ne(),cn(r),ot(!1),sr(t,e)}finally{ot(n),ct(s)}}const pt=new Map;function ir(t,{target:e,anchor:r,props:n={},events:s,context:i,intro:l=!0}){ne();var a=new Set,u=c=>{for(var _=0;_<c.length;_++){var h=c[_];if(!a.has(h)){a.add(h);var p=Mn(h);e.addEventListener(h,St,{passive:p});var d=pt.get(h);d===void 0?(document.addEventListener(h,St,{passive:p}),pt.set(h,1)):pt.set(h,d+1)}}};u(Or(On)),er.add(u);var f=void 0,o=pn(()=>{var c=r??e.appendChild(se());return wn(()=>{if(i){Te({});var _=F;_.c=i}s&&(n.$$events=s),E&&ae(c,null),f=t(c,n)||{},E&&(m.nodes_end=x),i&&Ne()}),()=>{for(var _ of a){e.removeEventListener(_,St);var h=pt.get(_);--h===0?(document.removeEventListener(_,St),pt.delete(_)):pt.set(_,h)}er.delete(u),c!==r&&c.parentNode?.removeChild(c)}});return ue.set(f,o),f}let ue=new WeakMap;function jn(t,e){const r=ue.get(t);return r?(ue.delete(t),r(e)):Promise.resolve()}function qn(t,e){gn(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,n.appendChild(s)}})}function Dn(t,e,r){var n=""+t;return n}function Fn(t,e){return t==null?null:String(t)}function Yn(t,e,r,n,s,i){var l=t.__className;if(E||l!==r||l===void 0){var a=Dn(r);(!E||a!==t.getAttribute("class"))&&(a==null?t.removeAttribute("class"):t.className=a),t.__className=r}return i}function lr(t,e,r,n){var s=t.__style;if(E||s!==e){var i=Fn(e);(!E||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}return n}const Bn=Symbol("is custom element"),Un=Symbol("is html");function Hn(t,e,r,n){var s=Gn(t);E&&(s[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||s[e]!==(s[e]=r)&&(e==="loading"&&(t[jr]=r),r==null?t.removeAttribute(e):typeof r!="string"&&ar(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function lt(t,e,r){var n=$,s=m;let i=E;E&&ot(!1),k(null),B(null);try{e!=="style"&&(fe.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.tagName.toLowerCase())?ar(t).includes(e):r&&typeof r=="object")?t[e]=r:Hn(t,e,r==null?r:String(r))}finally{k(n),B(s),i&&ot(!0)}}function Gn(t){return t.__attributes??={[Bn]:t.nodeName.includes("-"),[Un]:t.namespaceURI===xr}}var fe=new Map;function ar(t){var e=t.getAttribute("is")||t.nodeName,r=fe.get(e);if(r)return r;fe.set(e,r=[]);for(var n,s=t,i=Element.prototype;i!==s;){n=Rr(s);for(var l in n)n[l].set&&r.push(l);s=_e(s)}return r}let Ft=!1;function Wn(t){var e=Ft;try{return Ft=!1,[t(),Ft]}finally{Ft=e}}function Tt(t,e,r,n){var s=(r&Er)!==0,i=(r&br)!==0,l=n,a=!0,u=()=>(a&&(a=!1,l=i?xn(n):n),l),f;if(s){var o=Rt in t||we in t;f=z(t,e)?.set??(o&&e in t?v=>t[e]=v:void 0)}var c,_=!1;s?[c,_]=Wn(()=>t[e]):c=t[e],c===void 0&&n!==void 0&&(c=u(),f&&(Ur(),f(c)));var h;if(h=()=>{var v=t[e];return v===void 0?u():(a=!0,v)},(r&yr)===0)return h;if(f){var p=t.$$legacy;return(function(v,G){return arguments.length>0?((!G||p||_)&&f(G?h():v),v):h()})}var d=!1,y=((r&wr)!==0?Ct:nn)(()=>(d=!1,h()));s&&P(y);var b=m;return(function(v,G){if(arguments.length>0){const Nt=G?P(y):s?st(v):v;return q(y,Nt),d=!0,l!==void 0&&(l=Nt),v}return _t&&d||(b.f&Q)!==0?y.v:P(y)})}function Vn(t){return new Xn(t)}class Xn{#e;#t;constructor(e){var r=new Map,n=(i,l)=>{var a=fn(l,!1,!1);return r.set(i,a),a};const s=new Proxy({...e.props||{},$$events:{}},{get(i,l){return P(r.get(l)??n(l,Reflect.get(i,l)))},has(i,l){return l===we?!0:(P(r.get(l)??n(l,Reflect.get(i,l))),Reflect.has(i,l))},set(i,l,a){return q(r.get(l)??n(l,a),a),Reflect.set(i,l,a)}});this.#t=(e.hydrate?Ln:sr)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&ht(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||at(this,i,{get(){return this.#t[i]},set(l){this.#t[i]=l},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{jn(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...s)=>r.call(this,...s);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let ur;typeof HTMLElement=="function"&&(ur=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),nr(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Kn(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Yt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Vn({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=dn(()=>{$n(()=>{this.$$r=!0;for(const n of At(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Yt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Yt(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return At(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Yt(t,e,r,n){const s=r[t]?.type;if(e=s==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(s){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Kn(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Jn(t,e,r,n,s,i){let l=class extends ur{constructor(){super(t,r,s),this.$$p_d=e}static get observedAttributes(){return At(e).map(a=>(e[a].attribute||a).toLowerCase())}};return At(e).forEach(a=>{at(l.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(u){u=Yt(a,u,e),this.$$d[a]=u;var f=this.$$c;if(f){var o=z(f,a)?.get;o?f[a]=u:f.$set({[a]:u})}}})}),n.forEach(a=>{at(l.prototype,a,{get(){return this.$$c?.[a]}})}),t.element=l,l}const fr={version:"0.61.40"};function zn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gt={},oe,or;function Zn(){if(or)return oe;or=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
3
- `,f="/",o="*",c="",_="comment",h="declaration";oe=function(d,y){if(typeof d!="string")throw new TypeError("First argument must be a string");if(!d)return[];y=y||{};var b=1,v=1;function G(w){var g=w.match(e);g&&(b+=g.length);var D=w.lastIndexOf(u);v=~D?w.length-D:v+w.length}function Nt(){var w={line:b,column:v};return function(g){return g.position=new dr(w),gr(),g}}function dr(w){this.start=w,this.end={line:b,column:v},this.source=y.source}dr.prototype.content=d;function pr(w){var g=new Error(y.source+":"+b+":"+v+": "+w);if(g.reason=w,g.filename=y.source,g.line=b,g.column=v,g.source=d,!y.silent)throw g}function xt(w){var g=w.exec(d);if(g){var D=g[0];return G(D),d=d.slice(D.length),g}}function gr(){xt(r)}function mr(w){var g;for(w=w||[];g=$r();)g!==!1&&w.push(g);return w}function $r(){var w=Nt();if(!(f!=d.charAt(0)||o!=d.charAt(1))){for(var g=2;c!=d.charAt(g)&&(o!=d.charAt(g)||f!=d.charAt(g+1));)++g;if(g+=2,c===d.charAt(g-1))return pr("End of comment missing");var D=d.slice(2,g-2);return v+=2,G(D),d=d.slice(g),v+=2,w({type:_,comment:D})}}function ns(){var w=Nt(),g=xt(n);if(g){if($r(),!xt(s))return pr("property missing ':'");var D=xt(i),is=w({type:h,property:p(g[0].replace(t,c)),value:D?p(D[0].replace(t,c)):c});return xt(l),is}}function ss(){var w=[];mr(w);for(var g;g=ns();)g!==!1&&(w.push(g),mr(w));return w}return gr(),ss()};function p(d){return d?d.replace(a,c):c}return oe}var cr;function Qn(){if(cr)return gt;cr=1;var t=gt&&gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=r;var e=t(Zn());function r(n,s){var i=null;if(!n||typeof n!="string")return i;var l=(0,e.default)(n),a=typeof s=="function";return l.forEach(function(u){if(u.type==="declaration"){var f=u.property,o=u.value;a?s(f,o,u):o&&(i=i||{},i[f]=o)}}),i}return gt}var ts=Qn();const hr=zn(ts);hr.default;function vr(t){const e=t?.repoName.split("/")?.[1]||t?.repoName;if(!e)throw new Error("wrong componentPath "+t?.repoName);if(!t?.version)throw new Error("wrong version "+t?.version);const r=t?.iifePath||"main.iife.js";if(!document.getElementById(e+"-script"))try{const n=document.createElement("script");if(n.id=e+"-script",n.src=`https://cdn.jsdelivr.net/npm/${t.repoName}@${t.version}/${r}`,t?.local)n.src=`${t.local}`;else if(location.href.includes("localhost:6006")){const s=e.split("-")[0];n.src=`http://localhost:6006/webcomponents/${e.replace(s+"-","")}/${r}`}document.head.appendChild(n)}catch(n){console.warn(n)}}var es=kn('<div id="compocontainer" class="svelte-eh0hqt"><div id="list" class="svelte-eh0hqt"><hb-messages-list></hb-messages-list></div> <div id="prompt" class="svelte-eh0hqt"><hb-messages-send></hb-messages-send></div></div>',2);const rs={hash:"svelte-eh0hqt",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
4
- @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host {font-family:"Roboto", sans-serif;display:block;overflow:hidden;height:fit-content;min-height:100px;}#compocontainer.svelte-eh0hqt {display:grid;grid-template-areas:"messages" "prompt";overflow:hidden;grid-template-rows:1fr 180px;height:100%;min-height:200px;}#list.svelte-eh0hqt {overflow-y:auto;grid-area:messages;min-height:0;height:100%;}#list.svelte-eh0hqt hb-messages-list:where(.svelte-eh0hqt) {height:100%;display:block;}#prompt.svelte-eh0hqt {grid-area:prompt;width:90%;max-width:1600px;margin:0 auto;}.msglist.svelte-eh0hqt {width:90%;max-width:1400px;margin:0 auto;}`};function _r(t,e){Te(e,!0),qn(t,rs);function r(v,G){e.$$host.dispatchEvent(new CustomEvent(v,{detail:G}))}let n=Tt(e,"id",7,""),s=Tt(e,"messages",7),i=Tt(e,"authors",7),l=Tt(e,"options",7),a=Tt(e,"message",23,()=>({text:""})),u=j(""),f=j("");st({});let o=rn(()=>{if(typeof a()=="string")try{a(JSON.parse(a()))}catch(v){console.error("error parsing message",v)}return a()?.text?a().text:""});function c(v){if(!v?.file&&!v?.text)return console.warn("no message to received",v);r("sendMessage",v),q(o,v.text),q(o,"")}vr({repoName:"@htmlbricks/hb-messages-list",version:fr.version}),vr({repoName:"@htmlbricks/hb-messages-send",version:fr.version});var _={get id(){return n()},set id(v=""){n(v),ht()},get messages(){return s()},set messages(v){s(v),ht()},get authors(){return i()},set authors(v){i(v),ht()},get options(){return l()},set options(v){l(v),ht()},get message(){return a()},set message(v={text:""}){a(v),ht()}},h=es(),p=ie(h),d=ie(p);lt(d,"id","message-list"),jt(()=>lt(d,"messages",s())),jt(()=>lt(d,"authors",i())),jt(()=>lt(d,"options",l())),lr(d,P(u)),Yn(d,1,"msglist svelte-eh0hqt"),lt(d,"part","msglist"),Xt(p);var y=on(p,2),b=ie(y);return jt(()=>lt(b,"text",P(o))),lt(b,"part","msgsend"),lr(b,P(f)),Xt(y),Xt(h),Pn("sendMessage",b,v=>c(v.detail)),nr(t,h),Ne(_)}customElements.define("hb-messages-box",Jn(_r,{id:{},messages:{},authors:{},options:{},message:{}},[],[],!0)),ce.Component=_r,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})})(this["messages-box"]=this["messages-box"]||{});
1
+ (function(he){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const bn=1,Tn=4,Sn=8,Nn=16,xn=2,On="[",An="]",wt={},T=Symbol(),Rn="http://www.w3.org/1999/xhtml",ve=!1;var de=Array.isArray,Pn=Array.prototype.indexOf,Cn=Array.from,At=Object.keys,ut=Object.defineProperty,z=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyDescriptors,kn=Object.prototype,Mn=Array.prototype,_e=Object.getPrototypeOf,ge=Object.isExtensible;function pe(t){for(var e=0;e<t.length;e++)t[e]()}function In(){var t,e,n=new Promise((r,i)=>{t=r,e=i});return{promise:n,resolve:t,reject:e}}const A=2,Ut=4,Wt=8,$t=16,Z=32,G=64,me=128,M=256,Rt=512,N=1024,I=2048,V=4096,ot=8192,Q=16384,we=32768,Dn=65536,$e=1<<17,jn=1<<18,ft=1<<19,qn=1<<20,Ht=1<<21,Gt=1<<22,tt=1<<23,Pt=Symbol("$state"),ye=Symbol("legacy props"),Fn=Symbol(""),Vt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Yn=3,Ee=8;function Bn(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Un(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Wn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Hn(){throw new Error("https://svelte.dev/e/hydration_failed")}function Gn(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Vn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Xn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Jn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Xt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}let E=!1;function ct(t){E=t}let x;function ht(t){if(t===null)throw Xt(),wt;return x=t}function be(){return ht(bt(x))}function Jt(t){if(E){if(bt(x)!==null)throw Xt(),wt;x=t}}function Te(t){return t===this.v}function Kn(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Se(t){return!Kn(t,this.v)}let zn=!1,F=null;function Ct(t){F=t}function Ne(t,e=!1,n){F={p:F,c:null,e:null,s:t,x:null,l:null}}function xe(t){var e=F,n=e.e;if(n!==null){e.e=null;for(var r of n)gr(r)}return t!==void 0&&(e.x=t),F=e.p,t??{}}function Oe(){return!0}const Zn=new WeakMap;function Qn(t){var e=m;if(e===null)return w.f|=tt,t;if((e.f&we)===0){if((e.f&me)===0)throw!e.parent&&t instanceof Error&&Ae(t),t;e.b.error(t)}else Kt(t,e)}function Kt(t,e){for(;e!==null;){if((e.f&me)!==0)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t instanceof Error&&Ae(t),t}function Ae(t){const e=Zn.get(t);e&&(ut(t,"message",{value:e.message}),ut(t,"stack",{value:e.stack}))}let yt=[],zt=[];function Re(){var t=yt;yt=[],pe(t)}function tr(){var t=zt;zt=[],pe(t)}function er(t){yt.length===0&&queueMicrotask(Re),yt.push(t)}function nr(){yt.length>0&&Re(),zt.length>0&&tr()}function rr(){const t=m.b;return t===null&&Bn(),t}function Lt(t){var e=A|I,n=w!==null&&(w.f&A)!==0?w:null;return m===null||n!==null&&(n.f&M)!==0?e|=M:m.f|=ft,{ctx:F,deps:null,effects:null,equals:Te,f:e,fn:t,reactions:null,rv:0,v:T,wv:0,parent:n??m,ac:null}}function ir(t,e){let n=m;n===null&&Un();var r=n.b,i=void 0,s=ee(T),a=null,l=!w;return $r(()=>{try{var u=t();a&&Promise.resolve(u).catch(()=>{})}catch(h){u=Promise.reject(h)}var o=()=>u;i=a?.then(o,o)??Promise.resolve(u),a=i;var f=S,c=r.is_pending();l&&(r.update_pending_count(1),c||f.increment());const v=(h,_=void 0)=>{a=null,c||f.activate(),_?_!==Vt&&(s.f|=tt,ne(s,_)):((s.f&tt)!==0&&(s.f^=tt),ne(s,h)),l&&(r.update_pending_count(-1),c||f.decrement()),Le()};if(i.then(v,h=>v(null,h||"unknown")),f)return()=>{queueMicrotask(()=>f.neuter())}}),new Promise(u=>{function o(f){function c(){f===i?u(s):o(i)}f.then(c,c)}o(i)})}function sr(t){const e=Lt(t);return Je(e),e}function ar(t){const e=Lt(t);return e.equals=Se,e}function Pe(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)J(e[n])}}function lr(t){for(var e=t.parent;e!==null;){if((e.f&A)===0)return e;e=e.parent}return null}function Zt(t){var e,n=m;B(lr(t));try{Pe(t),e=tn(t)}finally{B(n)}return e}function Ce(t){var e=Zt(t);if(t.equals(e)||(t.v=e,t.wv=Ze()),!_t){var n=(K||(t.f&M)!==0)&&t.deps!==null?V:N;C(t,n)}}function ur(t,e,n){const r=Lt;if(e.length===0){n(t.map(r));return}var i=S,s=m,a=or(),l=rr();Promise.all(e.map(u=>ir(u))).then(u=>{i?.activate(),a();try{n([...t.map(r),...u])}catch(o){(s.f&Q)===0&&Kt(o,s)}i?.deactivate(),Le()}).catch(u=>{l.error(u)})}function or(){var t=m,e=w,n=F,r=S;return function(){B(t),L(e),Ct(n),r?.activate()}}function Le(){B(null),L(null),Ct(null)}const Qt=new Set;let S=null,ke=new Set,kt=[];function Me(){const t=kt.shift();kt.length>0&&queueMicrotask(Me),t()}let et=[],Mt=null,te=!1,It=!1;class nt{current=new Map;#e=new Map;#t=new Set;#n=0;#o=null;#f=!1;#i=[];#a=[];#s=[];#r=[];#l=[];#c=[];#h=[];skipped_effects=new Set;process(e){et=[];for(const i of e)this.#d(i);if(this.#i.length===0&&this.#n===0){this.#v();var n=this.#s,r=this.#r;this.#s=[],this.#r=[],this.#l=[],S=null,De(n),De(r),S===null?S=this:Qt.delete(this),this.#o?.resolve()}else this.#u(this.#s),this.#u(this.#r),this.#u(this.#l);for(const i of this.#i)gt(i);for(const i of this.#a)gt(i);this.#i=[],this.#a=[]}#d(e){e.f^=N;for(var n=e.first;n!==null;){var r=n.f,i=(r&(Z|G))!==0,s=i&&(r&N)!==0,a=s||(r&ot)!==0||this.skipped_effects.has(n);if(!a&&n.fn!==null){if(i)n.f^=N;else if((r&Ut)!==0)this.#r.push(n);else if((r&N)===0)if((r&Gt)!==0){var l=n.b?.is_pending()?this.#a:this.#i;l.push(n)}else qt(n)&&((n.f&$t)!==0&&this.#l.push(n),gt(n));var u=n.first;if(u!==null){n=u;continue}}var o=n.parent;for(n=n.next;n===null&&o!==null;)n=o.next,o=o.parent}}#u(e){for(const n of e)((n.f&I)!==0?this.#c:this.#h).push(n),C(n,N);e.length=0}capture(e,n){this.#e.has(e)||this.#e.set(e,n),this.current.set(e,e.v)}activate(){S=this}deactivate(){S=null;for(const e of ke)if(ke.delete(e),e(),S!==null)break}neuter(){this.#f=!0}flush(){et.length>0?Ie():this.#v(),S===this&&(this.#n===0&&Qt.delete(this),this.deactivate())}#v(){if(!this.#f)for(const e of this.#t)e();this.#t.clear()}increment(){this.#n+=1}decrement(){if(this.#n-=1,this.#n===0){for(const e of this.#c)C(e,I),Et(e);for(const e of this.#h)C(e,V),Et(e);this.#s=[],this.#r=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#o??=In()).promise}static ensure(){if(S===null){const e=S=new nt;Qt.add(S),It||nt.enqueue(()=>{S===e&&e.flush()})}return S}static enqueue(e){kt.length===0&&queueMicrotask(Me),kt.unshift(e)}}function vt(t){var e=It;It=!0;try{for(var n;;){if(nr(),et.length===0&&(S?.flush(),et.length===0))return Mt=null,n;Ie()}}finally{It=e}}function Ie(){var t=dt;te=!0;try{var e=0;for(Ve(!0);et.length>0;){var n=nt.ensure();if(e++>1e3){var r,i;fr()}n.process(et),X.clear()}}finally{te=!1,Ve(t),Mt=null}}function fr(){try{Wn()}catch(t){Kt(t,Mt)}}let rt=null;function De(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(Q|ot))===0&&qt(r)&&(rt=[],gt(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?He(r):r.fn=null),rt?.length>0)){X.clear();for(const i of rt)gt(i);rt=[]}}rt=null}}function Et(t){for(var e=Mt=t;e.parent!==null;){e=e.parent;var n=e.f;if(te&&e===m&&(n&$t)!==0)return;if((n&(G|Z))!==0){if((n&N)===0)return;e.f^=N}}et.push(e)}const X=new Map;function ee(t,e){var n={f:0,v:t,reactions:null,equals:Te,rv:0,wv:0};return n}function D(t,e){const n=ee(t);return Je(n),n}function cr(t,e=!1,n=!0){const r=ee(t);return e||(r.equals=Se),r}function j(t,e,n=!1){w!==null&&(!Y||(w.f&$e)!==0)&&Oe()&&(w.f&(A|$t|Gt|$e))!==0&&!W?.includes(t)&&Jn();let r=n?it(e):e;return ne(t,r)}function ne(t,e){if(!t.equals(e)){var n=t.v;_t?X.set(t,e):X.set(t,n),t.v=e;var r=nt.ensure();r.capture(t,n),(t.f&A)!==0&&((t.f&I)!==0&&Zt(t),C(t,(t.f&M)===0?N:V)),t.wv=Ze(),je(t,I),m!==null&&(m.f&N)!==0&&(m.f&(Z|G))===0&&(k===null?xr([t]):k.push(t))}return e}function re(t){j(t,t.v+1)}function je(t,e){var n=t.reactions;if(n!==null)for(var r=n.length,i=0;i<r;i++){var s=n[i],a=s.f,l=(a&I)===0;l&&C(s,e),(a&A)!==0?je(s,V):l&&((a&$t)!==0&&rt!==null&&rt.push(s),Et(s))}}function it(t){if(typeof t!="object"||t===null||Pt in t)return t;const e=_e(t);if(e!==kn&&e!==Mn)return t;var n=new Map,r=de(t),i=D(0),s=st,a=l=>{if(st===s)return l();var u=w,o=st;L(null),ze(s);var f=l();return L(u),ze(o),f};return r&&n.set("length",D(t.length)),new Proxy(t,{defineProperty(l,u,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Vn();var f=n.get(u);return f===void 0?f=a(()=>{var c=D(o.value);return n.set(u,c),c}):j(f,o.value,!0),!0},deleteProperty(l,u){var o=n.get(u);if(o===void 0){if(u in l){const f=a(()=>D(T));n.set(u,f),re(i)}}else j(o,T),re(i);return!0},get(l,u,o){if(u===Pt)return t;var f=n.get(u),c=u in l;if(f===void 0&&(!c||z(l,u)?.writable)&&(f=a(()=>{var h=it(c?l[u]:T),_=D(h);return _}),n.set(u,f)),f!==void 0){var v=P(f);return v===T?void 0:v}return Reflect.get(l,u,o)},getOwnPropertyDescriptor(l,u){var o=Reflect.getOwnPropertyDescriptor(l,u);if(o&&"value"in o){var f=n.get(u);f&&(o.value=P(f))}else if(o===void 0){var c=n.get(u),v=c?.v;if(c!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(l,u){if(u===Pt)return!0;var o=n.get(u),f=o!==void 0&&o.v!==T||Reflect.has(l,u);if(o!==void 0||m!==null&&(!f||z(l,u)?.writable)){o===void 0&&(o=a(()=>{var v=f?it(l[u]):T,h=D(v);return h}),n.set(u,o));var c=P(o);if(c===T)return!1}return f},set(l,u,o,f){var c=n.get(u),v=u in l;if(r&&u==="length")for(var h=o;h<c.v;h+=1){var _=n.get(h+"");_!==void 0?j(_,T):h in l&&(_=a(()=>D(T)),n.set(h+"",_))}if(c===void 0)(!v||z(l,u)?.writable)&&(c=a(()=>D(void 0)),j(c,it(o)),n.set(u,c));else{v=c.v!==T;var g=a(()=>it(o));j(c,g)}var y=Reflect.getOwnPropertyDescriptor(l,u);if(y?.set&&y.set.call(f,o),!v){if(r&&typeof u=="string"){var b=n.get("length"),d=Number(u);Number.isInteger(d)&&d>=b.v&&j(b,d+1)}re(i)}return!0},ownKeys(l){P(i);var u=Reflect.ownKeys(l).filter(c=>{var v=n.get(c);return v===void 0||v.v!==T});for(var[o,f]of n)f.v!==T&&!(o in l)&&u.push(o);return u},setPrototypeOf(){Xn()}})}var qe,Fe,Ye,Be;function ie(){if(qe===void 0){qe=window,Fe=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Ye=z(e,"firstChild").get,Be=z(e,"nextSibling").get,ge(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ge(n)&&(n.__t=void 0)}}function se(t=""){return document.createTextNode(t)}function Dt(t){return Ye.call(t)}function bt(t){return Be.call(t)}function ae(t,e){if(!E)return Dt(t);var n=Dt(x);return n===null&&(n=x.appendChild(se())),ht(n),n}function hr(t,e=1,n=!1){let r=E?x:t;for(var i;e--;)i=r,r=bt(r);if(!E)return r;if(n&&r?.nodeType!==Yn){var s=se();return r===null?i?.after(s):r.before(s),ht(s),s}return ht(r),r}function vr(t){t.textContent=""}function le(t){var e=w,n=m;L(null),B(null);try{return t()}finally{L(e),B(n)}}function dr(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function U(t,e,n,r=!0){var i=m;i!==null&&(i.f&ot)!==0&&(t|=ot);var s={ctx:F,deps:null,nodes_start:null,nodes_end:null,f:t|I,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{gt(s),s.f|=we}catch(u){throw J(s),u}else e!==null&&Et(s);if(r){var a=s;if(n&&a.deps===null&&a.teardown===null&&a.nodes_start===null&&a.first===a.last&&(a.f&ft)===0&&(a=a.first),a!==null&&(a.parent=i,i!==null&&dr(a,i),w!==null&&(w.f&A)!==0&&(t&G)===0)){var l=w;(l.effects??=[]).push(a)}}return s}function _r(t){const e=U(Wt,null,!1);return C(e,N),e.teardown=t,e}function gr(t){return U(Ut|qn,t,!1)}function pr(t){nt.ensure();const e=U(G|ft,t,!0);return()=>{J(e)}}function mr(t){nt.ensure();const e=U(G|ft,t,!0);return(n={})=>new Promise(r=>{n.outro?Sr(e,()=>{J(e),r(void 0)}):(J(e),r(void 0))})}function wr(t){return U(Ut,t,!1)}function $r(t){return U(Gt|ft,t,!0)}function yr(t,e=0){return U(Wt|e,t,!0)}function jt(t,e=[],n=[]){ur(e,n,r=>{U(Wt,()=>t(...r.map(P)),!0)})}function Er(t,e=!0){return U(Z|ft,t,!0,e)}function Ue(t){var e=t.teardown;if(e!==null){const n=_t,r=w;Xe(!0),L(null);try{e.call(null)}finally{Xe(n),L(r)}}}function We(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&le(()=>{i.abort(Vt)});var r=n.next;(n.f&G)!==0?n.parent=null:J(n,e),n=r}}function br(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Z)===0&&J(e),e=n}}function J(t,e=!0){var n=!1;(e||(t.f&jn)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(Tr(t.nodes_start,t.nodes_end),n=!0),We(t,e&&!n),Ft(t,0),C(t,Q);var r=t.transitions;if(r!==null)for(const s of r)s.stop();Ue(t);var i=t.parent;i!==null&&i.first!==null&&He(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function Tr(t,e){for(;t!==null;){var n=t===e?null:bt(t);t.remove(),t=n}}function He(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Sr(t,e){var n=[];Ge(t,n,!0),Nr(n,()=>{J(t),e&&e()})}function Nr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var i of t)i.out(r)}else e()}function Ge(t,e,n){if((t.f&ot)===0){if(t.f^=ot,t.transitions!==null)for(const a of t.transitions)(a.is_global||n)&&e.push(a);for(var r=t.first;r!==null;){var i=r.next,s=(r.f&Dn)!==0||(r.f&Z)!==0;Ge(r,e,s?n:!1),r=i}}}let dt=!1;function Ve(t){dt=t}let _t=!1;function Xe(t){_t=t}let w=null,Y=!1;function L(t){w=t}let m=null;function B(t){m=t}let W=null;function Je(t){w!==null&&(W===null?W=[t]:W.push(t))}let O=null,R=0,k=null;function xr(t){k=t}let Ke=1,Tt=0,st=Tt;function ze(t){st=t}let K=!1;function Ze(){return++Ke}function qt(t){var e=t.f;if((e&I)!==0)return!0;if((e&V)!==0){var n=t.deps,r=(e&M)!==0;if(n!==null){var i,s,a=(e&Rt)!==0,l=r&&m!==null&&!K,u=n.length;if((a||l)&&(m===null||(m.f&Q)===0)){var o=t,f=o.parent;for(i=0;i<u;i++)s=n[i],(a||!s?.reactions?.includes(o))&&(s.reactions??=[]).push(o);a&&(o.f^=Rt),l&&f!==null&&(f.f&M)===0&&(o.f^=M)}for(i=0;i<u;i++)if(s=n[i],qt(s)&&Ce(s),s.wv>t.wv)return!0}(!r||m!==null&&!K)&&C(t,N)}return!1}function Qe(t,e,n=!0){var r=t.reactions;if(r!==null&&!W?.includes(t))for(var i=0;i<r.length;i++){var s=r[i];(s.f&A)!==0?Qe(s,e,!1):e===s&&(n?C(s,I):(s.f&N)!==0&&C(s,V),Et(s))}}function tn(t){var e=O,n=R,r=k,i=w,s=K,a=W,l=F,u=Y,o=st,f=t.f;O=null,R=0,k=null,K=(f&M)!==0&&(Y||!dt||w===null),w=(f&(Z|G))===0?t:null,W=null,Ct(t.ctx),Y=!1,st=++Tt,t.ac!==null&&(le(()=>{t.ac.abort(Vt)}),t.ac=null);try{t.f|=Ht;var c=t.fn,v=c(),h=t.deps;if(O!==null){var _;if(Ft(t,R),h!==null&&R>0)for(h.length=R+O.length,_=0;_<O.length;_++)h[R+_]=O[_];else t.deps=h=O;if(!K||(f&A)!==0&&t.reactions!==null)for(_=R;_<h.length;_++)(h[_].reactions??=[]).push(t)}else h!==null&&R<h.length&&(Ft(t,R),h.length=R);if(Oe()&&k!==null&&!Y&&h!==null&&(t.f&(A|V|I))===0)for(_=0;_<k.length;_++)Qe(k[_],t);return i!==null&&i!==t&&(Tt++,k!==null&&(r===null?r=k:r.push(...k))),(t.f&tt)!==0&&(t.f^=tt),v}catch(g){return Qn(g)}finally{t.f^=Ht,O=e,R=n,k=r,w=i,K=s,W=a,Ct(l),Y=u,st=o}}function Or(t,e){let n=e.reactions;if(n!==null){var r=Pn.call(n,t);if(r!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[r]=n[i],n.pop())}}n===null&&(e.f&A)!==0&&(O===null||!O.includes(e))&&(C(e,V),(e.f&(M|Rt))===0&&(e.f^=Rt),Pe(e),Ft(e,0))}function Ft(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)Or(t,n[r])}function gt(t){var e=t.f;if((e&Q)===0){C(t,N);var n=m,r=dt;m=t,dt=!0;try{(e&$t)!==0?br(t):We(t),Ue(t);var i=tn(t);t.teardown=typeof i=="function"?i:null,t.wv=Ke;var s;ve&&zn&&(t.f&I)!==0&&t.deps}finally{dt=r,m=n}}}function P(t){var e=t.f,n=(e&A)!==0;if(w!==null&&!Y){var r=m!==null&&(m.f&Q)!==0;if(!r&&!W?.includes(t)){var i=w.deps;if((w.f&Ht)!==0)t.rv<Tt&&(t.rv=Tt,O===null&&i!==null&&i[R]===t?R++:O===null?O=[t]:(!K||!O.includes(t))&&O.push(t));else{(w.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[w]:s.includes(w)||s.push(w)}}}else if(n&&t.deps===null&&t.effects===null){var a=t,l=a.parent;l!==null&&(l.f&M)===0&&(a.f^=M)}if(_t){if(X.has(t))return X.get(t);if(n){a=t;var u=a.v;return((a.f&N)===0&&a.reactions!==null||en(a))&&(u=Zt(a)),X.set(a,u),u}}else n&&(a=t,qt(a)&&Ce(a));if((t.f&tt)!==0)throw t.v;return t.v}function en(t){if(t.v===T)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(X.has(e)||(e.f&A)!==0&&en(e))return!0;return!1}function Ar(t){var e=Y;try{return Y=!0,t()}finally{Y=e}}const Rr=-7169;function C(t,e){t.f=t.f&Rr|e}const Pr=new Set,nn=new Set;function Cr(t,e,n,r={}){function i(s){if(r.capture||St.call(e,s),!s.cancelBubble)return le(()=>n?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?er(()=>{e.addEventListener(t,i,r)}):e.addEventListener(t,i,r),i}function Lr(t,e,n,r,i){var s={capture:r,passive:i},a=Cr(t,e,n,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&_r(()=>{e.removeEventListener(t,a,s)})}let rn=null;function St(t){var e=this,n=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;rn=t;var a=0,l=rn===t&&t.__root;if(l){var u=i.indexOf(l);if(u!==-1&&(e===document||e===window)){t.__root=e;return}var o=i.indexOf(e);if(o===-1)return;u<=o&&(a=u)}if(s=i[a]||t.target,s!==e){ut(t,"currentTarget",{configurable:!0,get(){return s||n}});var f=w,c=m;L(null),B(null);try{for(var v,h=[];s!==null;){var _=s.assignedSlot||s.parentNode||s.host||null;try{var g=s["__"+r];if(g!=null&&(!s.disabled||t.target===s))if(de(g)){var[y,...b]=g;y.apply(s,[t,...b])}else g.call(s,t)}catch(d){v?h.push(d):v=d}if(t.cancelBubble||_===e||_===null)break;s=_}if(v){for(let d of h)queueMicrotask(()=>{throw d});throw v}}finally{t.__root=e,delete t.currentTarget,L(f),B(c)}}}function kr(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ue(t,e){var n=m;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function Mr(t,e){var n=(e&xn)!==0,r,i=!t.startsWith("<!>");return()=>{if(E)return ue(x,null),x;r===void 0&&(r=kr(i?t:"<!>"+t),r=Dt(r));var s=n||Fe?document.importNode(r,!0):r.cloneNode(!0);return ue(s,s),s}}function sn(t,e){if(E){m.nodes_end=x,be();return}t!==null&&t.before(e)}const Ir=["touchstart","touchmove"];function Dr(t){return Ir.includes(t)}function an(t,e){return ln(t,e)}function jr(t,e){ie(),e.intro=e.intro??!1;const n=e.target,r=E,i=x;try{for(var s=Dt(n);s&&(s.nodeType!==Ee||s.data!==On);)s=bt(s);if(!s)throw wt;ct(!0),ht(s),be();const a=ln(t,{...e,anchor:s});if(x===null||x.nodeType!==Ee||x.data!==An)throw Xt(),wt;return ct(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==wt&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Hn(),ie(),vr(n),ct(!1),an(t,e)}finally{ct(r),ht(i)}}const pt=new Map;function ln(t,{target:e,anchor:n,props:r={},events:i,context:s,intro:a=!0}){ie();var l=new Set,u=c=>{for(var v=0;v<c.length;v++){var h=c[v];if(!l.has(h)){l.add(h);var _=Dr(h);e.addEventListener(h,St,{passive:_});var g=pt.get(h);g===void 0?(document.addEventListener(h,St,{passive:_}),pt.set(h,1)):pt.set(h,g+1)}}};u(Cn(Pr)),nn.add(u);var o=void 0,f=mr(()=>{var c=n??e.appendChild(se());return Er(()=>{if(s){Ne({});var v=F;v.c=s}i&&(r.$$events=i),E&&ue(c,null),o=t(c,r)||{},E&&(m.nodes_end=x),s&&xe()}),()=>{for(var v of l){e.removeEventListener(v,St);var h=pt.get(v);--h===0?(document.removeEventListener(v,St),pt.delete(v)):pt.set(v,h)}nn.delete(u),c!==n&&c.parentNode?.removeChild(c)}});return oe.set(o,f),o}let oe=new WeakMap;function qr(t,e){const n=oe.get(t);return n?(oe.delete(t),n(e)):Promise.resolve()}function Fr(t,e){wr(()=>{var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,r.appendChild(i)}})}function Yr(t,e,n){var r=""+t;return r}function Br(t,e){return t==null?null:String(t)}function Ur(t,e,n,r,i,s){var a=t.__className;if(E||a!==n||a===void 0){var l=Yr(n);(!E||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):t.className=l),t.__className=n}return s}function un(t,e,n,r){var i=t.__style;if(E||i!==e){var s=Br(e);(!E||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}return r}const Wr=Symbol("is custom element"),Hr=Symbol("is html");function Gr(t,e,n,r){var i=Vr(t);E&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||i[e]!==(i[e]=n)&&(e==="loading"&&(t[Fn]=n),n==null?t.removeAttribute(e):typeof n!="string"&&on(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function at(t,e,n){var r=w,i=m;let s=E;E&&ct(!1),L(null),B(null);try{e!=="style"&&(fe.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.tagName.toLowerCase())?on(t).includes(e):n&&typeof n=="object")?t[e]=n:Gr(t,e,n==null?n:String(n))}finally{L(r),B(i),s&&ct(!0)}}function Vr(t){return t.__attributes??={[Wr]:t.nodeName.includes("-"),[Hr]:t.namespaceURI===Rn}}var fe=new Map;function on(t){var e=t.getAttribute("is")||t.nodeName,n=fe.get(e);if(n)return n;fe.set(e,n=[]);for(var r,i=t,s=Element.prototype;s!==i;){r=Ln(i);for(var a in r)r[a].set&&n.push(a);i=_e(i)}return n}let Yt=!1;function Xr(t){var e=Yt;try{return Yt=!1,[t(),Yt]}finally{Yt=e}}function Nt(t,e,n,r){var i=(n&Sn)!==0,s=(n&Nn)!==0,a=r,l=!0,u=()=>(l&&(l=!1,a=s?Ar(r):r),a),o;if(i){var f=Pt in t||ye in t;o=z(t,e)?.set??(f&&e in t?d=>t[e]=d:void 0)}var c,v=!1;i?[c,v]=Xr(()=>t[e]):c=t[e],c===void 0&&r!==void 0&&(c=u(),o&&(Gn(),o(c)));var h;if(h=()=>{var d=t[e];return d===void 0?u():(l=!0,d)},(n&Tn)===0)return h;if(o){var _=t.$$legacy;return(function(d,H){return arguments.length>0?((!H||_||v)&&o(H?h():d),d):h()})}var g=!1,y=((n&bn)!==0?Lt:ar)(()=>(g=!1,h()));i&&P(y);var b=m;return(function(d,H){if(arguments.length>0){const xt=H?P(y):i?it(d):d;return j(y,xt),g=!0,a!==void 0&&(a=xt),d}return _t&&g||(b.f&Q)!==0?y.v:P(y)})}function Jr(t){return new Kr(t)}class Kr{#e;#t;constructor(e){var n=new Map,r=(s,a)=>{var l=cr(a,!1,!1);return n.set(s,l),l};const i=new Proxy({...e.props||{},$$events:{}},{get(s,a){return P(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===ye?!0:(P(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,l){return j(n.get(a)??r(a,l),l),Reflect.set(s,a,l)}});this.#t=(e.hydrate?jr:an)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&vt(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||ut(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{qr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,n){this.#e[e]=this.#e[e]||[];const r=(...i)=>n.call(this,...i);return this.#e[e].push(r),()=>{this.#e[e]=this.#e[e].filter(i=>i!==r)}}$destroy(){this.#t.$destroy()}}let fn;typeof HTMLElement=="function"&&(fn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const r=this.$$l_u.get(e);r&&(r(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(r){return i=>{const s=document.createElement("slot");r!=="default"&&(s.name=r),sn(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=zr(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=t(r),e.default=!0):e[r]=t(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Bt(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Jr({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=pr(()=>{yr(()=>{this.$$r=!0;for(const r of At(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=Bt(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const s=this.$$c.$on(r,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Bt(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return At(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Bt(t,e,n,r){const i=n[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function zr(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Zr(t,e,n,r,i,s){let a=class extends fn{constructor(){super(t,n,i),this.$$p_d=e}static get observedAttributes(){return At(e).map(l=>(e[l].attribute||l).toLowerCase())}};return At(e).forEach(l=>{ut(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(u){u=Bt(l,u,e),this.$$d[l]=u;var o=this.$$c;if(o){var f=z(o,l)?.get;f?o[l]=u:o.$set({[l]:u})}}})}),r.forEach(l=>{ut(a.prototype,l,{get(){return this.$$c?.[l]}})}),t.element=a,a}const cn={version:"0.61.42"};function Qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mt={},ce,hn;function ti(){if(hn)return ce;hn=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
3
+ `,o="/",f="*",c="",v="comment",h="declaration";ce=function(g,y){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];y=y||{};var b=1,d=1;function H($){var p=$.match(e);p&&(b+=p.length);var q=$.lastIndexOf(u);d=~q?$.length-q:d+$.length}function xt(){var $={line:b,column:d};return function(p){return p.position=new mn($),$n(),p}}function mn($){this.start=$,this.end={line:b,column:d},this.source=y.source}mn.prototype.content=g;function wn($){var p=new Error(y.source+":"+b+":"+d+": "+$);if(p.reason=$,p.filename=y.source,p.line=b,p.column=d,p.source=g,!y.silent)throw p}function Ot($){var p=$.exec(g);if(p){var q=p[0];return H(q),g=g.slice(q.length),p}}function $n(){Ot(n)}function yn($){var p;for($=$||[];p=En();)p!==!1&&$.push(p);return $}function En(){var $=xt();if(!(o!=g.charAt(0)||f!=g.charAt(1))){for(var p=2;c!=g.charAt(p)&&(f!=g.charAt(p)||o!=g.charAt(p+1));)++p;if(p+=2,c===g.charAt(p-1))return wn("End of comment missing");var q=g.slice(2,p-2);return d+=2,H(q),g=g.slice(p),d+=2,$({type:v,comment:q})}}function ai(){var $=xt(),p=Ot(r);if(p){if(En(),!Ot(i))return wn("property missing ':'");var q=Ot(s),ui=$({type:h,property:_(p[0].replace(t,c)),value:q?_(q[0].replace(t,c)):c});return Ot(a),ui}}function li(){var $=[];yn($);for(var p;p=ai();)p!==!1&&($.push(p),yn($));return $}return $n(),li()};function _(g){return g?g.replace(l,c):c}return ce}var vn;function ei(){if(vn)return mt;vn=1;var t=mt&&mt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=n;var e=t(ti());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var a=(0,e.default)(r),l=typeof i=="function";return a.forEach(function(u){if(u.type==="declaration"){var o=u.property,f=u.value;l?i(o,f,u):f&&(s=s||{},s[o]=f)}}),s}return mt}var ni=ei();const dn=Qr(ni);dn.default;var lt={},_n;function ri(){if(_n)return lt;_n=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.LanguageTranslator=void 0,lt.getChildStyleToPass=t,lt.addComponent=e;function t(r,i){var s,a,l="";try{if(r&&i?.length&&(!((s=Object.keys(r))===null||s===void 0)&&s.length)&&(!((a=i?.filter(function(v){return Object.keys(r).includes(v.name)}))===null||a===void 0)&&a.length))for(var u=function(v){var h=i?.filter(function(_){return _.name===v&&_.defaultValue!==r[v]});h&&(l+="".concat(v,":").concat(r[v],";"))},o=0,f=Object.keys(r);o<f.length;o++){var c=f[o];u(c)}}catch(v){console.error("error getting child style to pass",v)}finally{return l}}function e(r){var i,s=((i=r?.repoName.split("/"))===null||i===void 0?void 0:i[1])||r?.repoName;if(!s)throw new Error("wrong componentPath "+r?.repoName);if(!r?.version)throw new Error("wrong version "+r?.version);var a=r?.iifePath||"main.iife.js";if(!document.getElementById(s+"-script"))try{var l=document.createElement("script");if(l.id=s+"-script",l.src="https://cdn.jsdelivr.net/npm/".concat(r.repoName,"@").concat(r.version,"/").concat(a),r?.local)l.src="".concat(r.local);else if(location.href.includes("localhost:6006")){var u=s.split("-")[0];l.src="http://localhost:6006/webcomponents/".concat(s.replace(u+"-",""),"/").concat(a)}document.head.appendChild(l)}catch(o){console.warn(o)}}var n=(function(){function r(i){if(this.lang="",!i?.dictionary)throw new Error("no dictionary provided");this.dictionary=i.dictionary,this.setLang(i?.lang)}return r.prototype.setLang=function(i){i||(i=r.getDefaultLang()),this.lang=i},r.prototype.translateWord=function(i,s){return r.getDictionaryWord(i,this.dictionary,s||this.lang)},r.prototype.translateDate=function(i,s,a){return r.formatDate(i,s,a||this.lang)},r.getDefaultLang=function(){var i,s,a,l,u,o="en";return navigator?.languages&&(!((a=(s=(i=navigator.languages[0])===null||i===void 0?void 0:i.split("-")[0])===null||s===void 0?void 0:s.toLowerCase())===null||a===void 0)&&a.length)&&(o=(u=(l=navigator.languages[0])===null||l===void 0?void 0:l.split("-")[0])===null||u===void 0?void 0:u.toLowerCase()),o},r.getDictionaryWord=function(i,s,a){var l;if(!i)throw new Error("no wordKey provided");if(!s)throw new Error("no dictionary provided");if(a&&(!((l=s[a])===null||l===void 0)&&l[i]))return s[a][i];var u="",o=r.getDefaultLang();if(!a||o!==a){var f=s?.[o];f?.[i]&&(u=f[i])}return u},r.formatDate=function(i,s,a){if(!i)throw new Error("no date provided");if(typeof i.getMonth!="function")throw new Error("wrong date format");var l=new Intl.DateTimeFormat(a||r.getDefaultLang(),s);return l.format(i)},r})();return lt.LanguageTranslator=n,lt}var gn=ri(),ii=Mr('<div id="compocontainer" class="svelte-eh0hqt"><div id="list" class="svelte-eh0hqt"><hb-messages-list></hb-messages-list></div> <div id="prompt" class="svelte-eh0hqt"><hb-messages-send></hb-messages-send></div></div>',2);const si={hash:"svelte-eh0hqt",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
4
+ @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host {font-family:"Roboto", sans-serif;display:block;overflow:hidden;height:fit-content;min-height:100px;}#compocontainer.svelte-eh0hqt {display:grid;grid-template-areas:"messages" "prompt";overflow:hidden;grid-template-rows:1fr 180px;height:100%;min-height:200px;}#list.svelte-eh0hqt {overflow-y:auto;grid-area:messages;min-height:0;height:100%;}#list.svelte-eh0hqt hb-messages-list:where(.svelte-eh0hqt) {height:100%;display:block;}#prompt.svelte-eh0hqt {grid-area:prompt;width:90%;max-width:1600px;margin:0 auto;}.msglist.svelte-eh0hqt {width:90%;max-width:1400px;margin:0 auto;}`};function pn(t,e){Ne(e,!0),Fr(t,si);function n(d,H){e.$$host.dispatchEvent(new CustomEvent(d,{detail:H}))}let r=Nt(e,"id",7,""),i=Nt(e,"messages",7),s=Nt(e,"authors",7),a=Nt(e,"options",7),l=Nt(e,"message",23,()=>({text:""})),u=D(""),o=D("");it({});let f=sr(()=>{if(typeof l()=="string")try{l(JSON.parse(l()))}catch(d){console.error("error parsing message",d)}return l()?.text?l().text:""});function c(d){if(!d?.file&&!d?.text)return console.warn("no message to received",d);n("sendMessage",d),j(f,d.text),j(f,"")}gn.addComponent({repoName:"@htmlbricks/hb-messages-list",version:cn.version}),gn.addComponent({repoName:"@htmlbricks/hb-messages-send",version:cn.version});var v={get id(){return r()},set id(d=""){r(d),vt()},get messages(){return i()},set messages(d){i(d),vt()},get authors(){return s()},set authors(d){s(d),vt()},get options(){return a()},set options(d){a(d),vt()},get message(){return l()},set message(d={text:""}){l(d),vt()}},h=ii(),_=ae(h),g=ae(_);at(g,"id","message-list"),jt(()=>at(g,"messages",i())),jt(()=>at(g,"authors",s())),jt(()=>at(g,"options",a())),un(g,P(u)),Ur(g,1,"msglist svelte-eh0hqt"),at(g,"part","msglist"),Jt(_);var y=hr(_,2),b=ae(y);return jt(()=>at(b,"text",P(f))),at(b,"part","msgsend"),un(b,P(o)),Jt(y),Jt(h),Lr("sendMessage",b,d=>c(d.detail)),sn(t,h),xe(v)}customElements.define("hb-messages-box",Zr(pn,{id:{},messages:{},authors:{},options:{},message:{}},[],[],!0)),he.Component=pn,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})})(this["messages-box"]=this["messages-box"]||{});
5
5
  //# sourceMappingURL=main.iife.js.map