@walker-di/fortalece-ai-sdk 0.1.11 → 0.2.0

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.
@@ -1,13 +1,48 @@
1
- var FortaleceAI=(function(ee){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const Bn=1,qn=2,Hn=16,Vn=1,Wn=2,yr="[",wt="[!",qt="]",Qe={},F=Symbol(),Kn="http://www.w3.org/1999/xhtml",Ht=!1;var $r=Array.isArray,Yn=Array.prototype.indexOf,yt=Array.from,$t=Object.keys,xt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,Zn=Object.getOwnPropertyDescriptors,Gn=Object.prototype,Jn=Array.prototype,xr=Object.getPrototypeOf,Sr=Object.isExtensible;function Xn(e){for(var t=0;t<e.length;t++)e[t]()}function Er(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const O=2,Vt=4,Wt=8,Qn=1<<24,xe=16,Se=32,Ie=64,St=128,de=512,U=1024,Z=2048,Ee=4096,te=8192,ke=16384,Et=32768,tt=65536,kr=1<<17,zr=1<<18,Ue=1<<19,es=1<<20,De=1<<25,je=32768,Kt=1<<21,Yt=1<<22,Le=1<<23,kt=Symbol("$state"),ts=Symbol("legacy props"),rs=Symbol(""),rt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Zt=3,nt=8;function ns(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ss(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function is(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function as(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function os(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ls(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function cs(){throw new Error("https://svelte.dev/e/hydration_failed")}function fs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function us(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ds(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function hs(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function zt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function vs(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let E=!1;function ze(e){E=e}let k;function re(e){if(e===null)throw zt(),Qe;return k=e}function Ct(){return re(ge(k))}function T(e){if(E){if(ge(k)!==null)throw zt(),Qe;k=e}}function Cr(e=1){if(E){for(var t=e,r=k;t--;)r=ge(r);k=r}}function At(e=!0){for(var t=0,r=k;;){if(r.nodeType===nt){var n=r.data;if(n===qt){if(t===0)return r;t-=1}else(n===yr||n===wt)&&(t+=1)}var i=ge(r);e&&r.remove(),r=i}}function Ar(e){if(!e||e.nodeType!==nt)throw zt(),Qe;return e.data}function Tr(e){return e===this.v}function ps(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Rr(e){return!ps(e,this.v)}let gs=!1,ne=null;function st(e){ne=e}function Gt(e,t=!1,r){ne={p:ne,i:!1,c:null,e:null,s:e,x:null,l:null}}function Jt(e){var t=ne,r=t.e;if(r!==null){t.e=null;for(var n of r)Jr(n)}return e!==void 0&&(t.x=e),t.i=!0,ne=t.p,e??{}}function Mr(){return!0}let Be=[];function Ir(){var e=Be;Be=[],Xn(e)}function Tt(e){if(Be.length===0&&!ct){var t=Be;queueMicrotask(()=>{t===Be&&Ir()})}Be.push(e)}function ms(){for(;Be.length>0;)Ir()}function Dr(e){var t=S;if(t===null)return x.f|=Le,e;if((t.f&Et)===0){if((t.f&St)===0)throw e;t.b.error(e)}else it(e,t)}function it(e,t){for(;t!==null;){if((t.f&St)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const Rt=new Set;let A=null,oe=null,le=[],Mt=null,Xt=!1,ct=!1;class he{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#r=0;#n=0;#l=null;#i=[];#s=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){le=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of t)this.#a(n,r);this.is_fork||this.#f(),this.is_deferred()?(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects)):(A=null,Or(r.render_effects),Or(r.effects),this.#l?.resolve()),oe=null}#a(t,r){t.f^=U;for(var n=t.first;n!==null;){var i=n.f,s=(i&(Se|Ie))!==0,a=s&&(i&U)!==0,o=a||(i&te)!==0||this.skipped_effects.has(n);if((n.f&St)!==0&&n.b?.is_pending()&&(r={parent:r,effect:n,effects:[],render_effects:[],block_effects:[]}),!o&&n.fn!==null){s?n.f^=U:(i&Vt)!==0?r.effects.push(n):ht(n)&&((n.f&xe)!==0&&r.block_effects.push(n),vt(n));var l=n.first;if(l!==null){n=l;continue}}var c=n.parent;for(n=n.next;n===null&&c!==null;)c===r.effect&&(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects),r=r.parent),n=c.next,c=c.parent}}#o(t){for(const r of t)((r.f&Z)!==0?this.#i:this.#s).push(r),this.#c(r.deps),j(r,U)}#c(t){if(t!==null)for(const r of t)(r.f&O)===0||(r.f&je)===0||(r.f^=je,this.#c(r.deps))}capture(t,r){this.previous.has(t)||this.previous.set(t,r),(t.f&Le)===0&&(this.current.set(t,t.v),oe?.set(t,t.v))}activate(){A=this,this.apply()}deactivate(){A===this&&(A=null,oe=null)}flush(){if(this.activate(),le.length>0){if(Lr(),A!==null&&A!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#f(){if(this.#n===0){for(const t of this.#t)t();this.#t.clear()}this.#r===0&&this.#u()}#u(){if(Rt.size>1){this.previous.clear();var t=oe,r=!0,n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const s of Rt){if(s===this){r=!1;continue}const a=[];for(const[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;const o=[...s.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var i=le;le=[];const l=new Set,c=new Map;for(const u of a)Nr(u,o,l,c);if(le.length>0){A=s,s.apply();for(const u of le)s.#a(u,n);s.deactivate()}le=i}}A=null,oe=t}this.committed=!0,Rt.delete(this)}increment(t){this.#r+=1,t&&(this.#n+=1)}decrement(t){this.#r-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#i)j(t,Z),qe(t);for(const t of this.#s)j(t,Ee),qe(t);this.#i=[],this.#s=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#l??=Er()).promise}static ensure(){if(A===null){const t=A=new he;Rt.add(A),ct||he.enqueue(()=>{A===t&&t.flush()})}return A}static enqueue(t){Tt(t)}apply(){}}function ve(e){var t=ct;ct=!0;try{for(var r;;){if(ms(),le.length===0&&(A?.flush(),le.length===0))return Mt=null,r;Lr()}}finally{ct=t}}function Lr(){var e=Ke;Xt=!0;var t=null;try{var r=0;for(Lt(!0);le.length>0;){var n=he.ensure();if(r++>1e3){var i,s;_s()}n.process(le),Ne.clear()}}finally{Xt=!1,Lt(e),Mt=null}}function _s(){try{ls()}catch(e){it(e,Mt)}}let Ce=null;function Or(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(ke|te))===0&&ht(n)&&(Ce=new Set,vt(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?tn(n):n.fn=null),Ce?.size>0)){Ne.clear();for(const i of Ce){if((i.f&(ke|te))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)Ce.has(a)&&(Ce.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const l=s[o];(l.f&(ke|te))===0&&vt(l)}}Ce.clear()}}Ce=null}}function Nr(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&O)!==0?Nr(i,t,r,n):(s&(Yt|xe))!==0&&(s&Z)===0&&Pr(i,t,n)&&(j(i,Z),qe(i))}}function Pr(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(t.includes(i))return!0;if((i.f&O)!==0&&Pr(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function qe(e){for(var t=Mt=e;t.parent!==null;){t=t.parent;var r=t.f;if(Xt&&t===S&&(r&xe)!==0&&(r&zr)===0)return;if((r&(Ie|Se))!==0){if((r&U)===0)return;t.f^=U}}le.push(t)}function bs(e){let t=0,r=He(0),n;return()=>{ut()&&(f(r),nr(()=>(t===0&&(n=ar(()=>e(()=>ft(r)))),t+=1,()=>{Tt(()=>{t-=1,t===0&&(n?.(),n=void 0,ft(r))})})))}}var ws=tt|Ue|St;function ys(e,t,r){new $s(e,t,r)}class $s{parent;#t=!1;#e;#r=E?k:null;#n;#l;#i;#s=null;#a=null;#o=null;#c=null;#f=null;#u=0;#d=0;#v=!1;#h=null;#b=bs(()=>(this.#h=He(this.#u),()=>{this.#h=null}));constructor(t,r,n){this.#e=t,this.#n=r,this.#l=n,this.parent=S.b,this.#t=!!this.#n.pending,this.#i=sr(()=>{if(S.b=this,E){const s=this.#r;Ct(),s.nodeType===nt&&s.data===wt?this.#y():this.#w()}else{var i=this.#m();try{this.#s=ce(()=>n(i))}catch(s){this.error(s)}this.#d>0?this.#g():this.#t=!1}return()=>{this.#f?.remove()}},ws),E&&(this.#e=k)}#w(){try{this.#s=ce(()=>this.#l(this.#e))}catch(t){this.error(t)}this.#t=!1}#y(){const t=this.#n.pending;t&&(this.#a=ce(()=>t(this.#e)),he.enqueue(()=>{var r=this.#m();this.#s=this.#p(()=>(he.ensure(),ce(()=>this.#l(r)))),this.#d>0?this.#g():(We(this.#a,()=>{this.#a=null}),this.#t=!1)}))}#m(){var t=this.#e;return this.#t&&(this.#f=pe(),this.#e.before(this.#f),t=this.#f),t}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#p(t){var r=S,n=x,i=ne;be(this.#i),G(this.#i),st(this.#i.ctx);try{return t()}catch(s){return Dr(s),null}finally{be(r),G(n),st(i)}}#g(){const t=this.#n.pending;this.#s!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#f),sn(this.#s,this.#c)),this.#a===null&&(this.#a=ce(()=>t(this.#e)))}#_(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#_(t);return}this.#d+=t,this.#d===0&&(this.#t=!1,this.#a&&We(this.#a,()=>{this.#a=null}),this.#c&&(this.#e.before(this.#c),this.#c=null))}update_pending_count(t){this.#_(t),this.#u+=t,this.#h&&at(this.#h,this.#u)}get_effect_pending(){return this.#b(),f(this.#h)}error(t){var r=this.#n.onerror;let n=this.#n.failed;if(this.#v||!r&&!n)throw t;this.#s&&(V(this.#s),this.#s=null),this.#a&&(V(this.#a),this.#a=null),this.#o&&(V(this.#o),this.#o=null),E&&(re(this.#r),Cr(),re(At()));var i=!1,s=!1;const a=()=>{if(i){vs();return}i=!0,s&&hs(),he.ensure(),this.#u=0,this.#o!==null&&We(this.#o,()=>{this.#o=null}),this.#t=this.has_pending_snippet(),this.#s=this.#p(()=>(this.#v=!1,ce(()=>this.#l(this.#e)))),this.#d>0?this.#g():this.#t=!1};var o=x;try{G(null),s=!0,r?.(t,a),s=!1}catch(l){it(l,this.#i&&this.#i.parent)}finally{G(o)}n&&Tt(()=>{this.#o=this.#p(()=>{he.ensure(),this.#v=!0;try{return ce(()=>{n(this.#e,()=>t,()=>a)})}catch(l){return it(l,this.#i.parent),null}finally{this.#v=!1}})})}}function xs(e,t,r,n){const i=Dt;if(r.length===0&&e.length===0){n(t.map(i));return}var s=A,a=S,o=Ss();function l(){Promise.all(r.map(c=>Es(c))).then(c=>{o();try{n([...t.map(i),...c])}catch(u){(a.f&ke)===0&&it(u,a)}s?.deactivate(),It()}).catch(c=>{it(c,a)})}e.length>0?Promise.all(e).then(()=>{o();try{return l()}finally{s?.deactivate(),It()}}):l()}function Ss(){var e=S,t=x,r=ne,n=A;return function(s=!0){be(e),G(t),st(r),s&&n?.activate()}}function It(){be(null),G(null),st(null)}function Dt(e){var t=O|Z,r=x!==null&&(x.f&O)!==0?x:null;return S!==null&&(S.f|=Ue),{ctx:ne,deps:null,effects:null,equals:Tr,f:t,fn:e,reactions:null,rv:0,v:F,wv:0,parent:r??S,ac:null}}function Es(e,t){let r=S;r===null&&ss();var n=r.b,i=void 0,s=He(F),a=!x,o=new Map;return Ls(()=>{var l=Er();i=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).then(()=>{c===A&&c.committed&&c.deactivate(),It()})}catch(h){l.reject(h),It()}var c=A;if(a){var u=!n.is_pending();n.update_pending_count(1),c.increment(u),o.get(c)?.reject(rt),o.delete(c),o.set(c,l)}const d=(h,g=void 0)=>{if(c.activate(),g)g!==rt&&(s.f|=Le,at(s,g));else{(s.f&Le)!==0&&(s.f^=Le),at(s,h);for(const[v,b]of o){if(o.delete(v),v===c)break;b.reject(rt)}}a&&(n.update_pending_count(-1),c.decrement(u))};l.promise.then(d,h=>d(null,h||"unknown"))}),Ms(()=>{for(const l of o.values())l.reject(rt)}),new Promise(l=>{function c(u){function d(){u===i?l(s):c(i)}u.then(d,d)}c(i)})}function Oe(e){const t=Dt(e);return on(t),t}function ks(e){const t=Dt(e);return t.equals=Rr,t}function Fr(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)V(t[r])}}function zs(e){for(var t=e.parent;t!==null;){if((t.f&O)===0)return(t.f&ke)===0?t:null;t=t.parent}return null}function Qt(e){var t,r=S;be(zs(e));try{e.f&=~je,Fr(e),t=dn(e)}finally{be(r)}return t}function Ur(e){var t=Qt(e);if(e.equals(t)||(A?.is_fork||(e.v=t),e.wv=fn()),!Ye)if(oe!==null)(ut()||A?.is_fork)&&oe.set(e,t);else{var r=(e.f&de)===0?Ee:U;j(e,r)}}let er=new Set;const Ne=new Map;let jr=!1;function He(e,t){var r={f:0,v:e,reactions:null,equals:Tr,rv:0,wv:0};return r}function D(e,t){const r=He(e);return on(r),r}function Br(e,t=!1,r=!0){const n=He(e);return t||(n.equals=Rr),n}function w(e,t,r=!1){x!==null&&(!_e||(x.f&kr)!==0)&&Mr()&&(x.f&(O|xe|Yt|kr))!==0&&!Ae?.includes(e)&&ds();let n=r?Ve(t):t;return at(e,n)}function at(e,t){if(!e.equals(t)){var r=e.v;Ye?Ne.set(e,t):Ne.set(e,r),e.v=t;var n=he.ensure();n.capture(e,r),(e.f&O)!==0&&((e.f&Z)!==0&&Qt(e),j(e,(e.f&de)!==0?U:Ee)),e.wv=fn(),qr(e,Z),S!==null&&(S.f&U)!==0&&(S.f&(Se|Ie))===0&&(fe===null?Ps([e]):fe.push(e)),!n.is_fork&&er.size>0&&!jr&&Cs()}return t}function Cs(){jr=!1;var e=Ke;Lt(!0);const t=Array.from(er);try{for(const r of t)(r.f&U)!==0&&j(r,Ee),ht(r)&&vt(r)}finally{Lt(e)}er.clear()}function ft(e){w(e,e.v+1)}function qr(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,o=(a&Z)===0;if(o&&j(s,t),(a&O)!==0){var l=s;oe?.delete(l),(a&je)===0&&(a&de&&(s.f|=je),qr(l,Ee))}else o&&((a&xe)!==0&&Ce!==null&&Ce.add(s),qe(s))}}function Ve(e){if(typeof e!="object"||e===null||kt in e)return e;const t=xr(e);if(t!==Gn&&t!==Jn)return e;var r=new Map,n=$r(e),i=D(0),s=Ze,a=o=>{if(Ze===s)return o();var l=x,c=Ze;G(null),cn(s);var u=o();return G(l),cn(c),u};return n&&r.set("length",D(e.length)),new Proxy(e,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&fs();var u=r.get(l);return u===void 0?u=a(()=>{var d=D(c.value);return r.set(l,d),d}):w(u,c.value,!0),!0},deleteProperty(o,l){var c=r.get(l);if(c===void 0){if(l in o){const u=a(()=>D(F));r.set(l,u),ft(i)}}else w(c,F),ft(i);return!0},get(o,l,c){if(l===kt)return e;var u=r.get(l),d=l in o;if(u===void 0&&(!d||et(o,l)?.writable)&&(u=a(()=>{var g=Ve(d?o[l]:F),v=D(g);return v}),r.set(l,u)),u!==void 0){var h=f(u);return h===F?void 0:h}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var u=r.get(l);u&&(c.value=f(u))}else if(c===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==F)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(o,l){if(l===kt)return!0;var c=r.get(l),u=c!==void 0&&c.v!==F||Reflect.has(o,l);if(c!==void 0||S!==null&&(!u||et(o,l)?.writable)){c===void 0&&(c=a(()=>{var h=u?Ve(o[l]):F,g=D(h);return g}),r.set(l,c));var d=f(c);if(d===F)return!1}return u},set(o,l,c,u){var d=r.get(l),h=l in o;if(n&&l==="length")for(var g=c;g<d.v;g+=1){var v=r.get(g+"");v!==void 0?w(v,F):g in o&&(v=a(()=>D(F)),r.set(g+"",v))}if(d===void 0)(!h||et(o,l)?.writable)&&(d=a(()=>D(void 0)),w(d,Ve(c)),r.set(l,d));else{h=d.v!==F;var b=a(()=>Ve(c));w(d,b)}var _=Reflect.getOwnPropertyDescriptor(o,l);if(_?.set&&_.set.call(u,c),!h){if(n&&typeof l=="string"){var z=r.get("length"),M=Number(l);Number.isInteger(M)&&M>=z.v&&w(z,M+1)}ft(i)}return!0},ownKeys(o){f(i);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==F});for(var[c,u]of r)u.v!==F&&!(c in o)&&l.push(c);return l},setPrototypeOf(){us()}})}var Hr,Vr,Wr,Kr;function tr(){if(Hr===void 0){Hr=window,Vr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Wr=et(t,"firstChild").get,Kr=et(t,"nextSibling").get,Sr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Sr(r)&&(r.__t=void 0)}}function pe(e=""){return document.createTextNode(e)}function Pe(e){return Wr.call(e)}function ge(e){return Kr.call(e)}function R(e,t){if(!E)return Pe(e);var r=Pe(k);if(r===null)r=k.appendChild(pe());else if(t&&r.nodeType!==Zt){var n=pe();return r?.before(n),re(n),n}return re(r),r}function As(e,t=!1){if(!E){var r=Pe(e);return r instanceof Comment&&r.data===""?ge(r):r}if(t&&k?.nodeType!==Zt){var n=pe();return k?.before(n),re(n),n}return k}function L(e,t=1,r=!1){let n=E?k:e;for(var i;t--;)i=n,n=ge(n);if(!E)return n;if(r&&n?.nodeType!==Zt){var s=pe();return n===null?i?.after(s):n.before(s),re(s),s}return re(n),n}function Yr(e){e.textContent=""}function Zr(){return!1}function Gr(e){var t=x,r=S;G(null),be(null);try{return e()}finally{G(t),be(r)}}function Ts(e){S===null&&(x===null&&os(),as()),Ye&&is()}function Rs(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function me(e,t,r){var n=S;n!==null&&(n.f&te)!==0&&(e|=te);var i={ctx:ne,deps:null,nodes:null,f:e|Z|de,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{vt(i),i.f|=Et}catch(o){throw V(i),o}else t!==null&&qe(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Ue)===0&&(s=s.first,(e&xe)!==0&&(e&tt)!==0&&s!==null&&(s.f|=tt)),s!==null&&(s.parent=n,n!==null&&Rs(s,n),x!==null&&(x.f&O)!==0&&(e&Ie)===0)){var a=x;(a.effects??=[]).push(s)}return i}function ut(){return x!==null&&!_e}function Ms(e){const t=me(Wt,null,!1);return j(t,U),t.teardown=e,t}function rr(e){Ts();var t=S.f,r=!x&&(t&Se)!==0&&(t&Et)===0;if(r){var n=ne;(n.e??=[]).push(e)}else return Jr(e)}function Jr(e){return me(Vt|es,e,!1)}function Is(e){he.ensure();const t=me(Ie|Ue,e,!0);return()=>{V(t)}}function Ds(e){he.ensure();const t=me(Ie|Ue,e,!0);return(r={})=>new Promise(n=>{r.outro?We(t,()=>{V(t),n(void 0)}):(V(t),n(void 0))})}function Xr(e){return me(Vt,e,!1)}function Ls(e){return me(Yt|Ue,e,!0)}function nr(e,t=0){return me(Wt|t,e,!0)}function se(e,t=[],r=[],n=[]){xs(n,t,r,i=>{me(Wt,()=>e(...i.map(f)),!0)})}function sr(e,t=0){var r=me(xe|t,e,!0);return r}function ce(e){return me(Se|Ue,e,!0)}function Qr(e){var t=e.teardown;if(t!==null){const r=Ye,n=x;an(!0),G(null);try{t.call(null)}finally{an(r),G(n)}}}function en(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&Gr(()=>{i.abort(rt)});var n=r.next;(r.f&Ie)!==0?r.parent=null:V(r,t),r=n}}function Os(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Se)===0&&V(t),t=r}}function V(e,t=!0){var r=!1;(t||(e.f&zr)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ns(e.nodes.start,e.nodes.end),r=!0),en(e,t&&!r),Ot(e,0),j(e,ke);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();Qr(e);var i=e.parent;i!==null&&i.first!==null&&tn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Ns(e,t){for(;e!==null;){var r=e===t?null:ge(e);e.remove(),e=r}}function tn(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function We(e,t,r=!0){var n=[];rn(e,n,!0);var i=()=>{r&&V(e),t&&t()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function rn(e,t,r){if((e.f&te)===0){e.f^=te;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&tt)!==0||(i.f&Se)!==0&&(e.f&xe)!==0;rn(i,t,a?r:!1),i=s}}}function ir(e){nn(e,!0)}function nn(e,t){if((e.f&te)!==0){e.f^=te,(e.f&U)===0&&(j(e,Z),qe(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&tt)!==0||(r.f&Se)!==0;nn(r,i?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function sn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:ge(r);t.append(r),r=i}}let Ke=!1;function Lt(e){Ke=e}let Ye=!1;function an(e){Ye=e}let x=null,_e=!1;function G(e){x=e}let S=null;function be(e){S=e}let Ae=null;function on(e){x!==null&&(Ae===null?Ae=[e]:Ae.push(e))}let W=null,ie=0,fe=null;function Ps(e){fe=e}let ln=1,dt=0,Ze=dt;function cn(e){Ze=e}function fn(){return++ln}function ht(e){var t=e.f;if((t&Z)!==0)return!0;if(t&O&&(e.f&=~je),(t&Ee)!==0){var r=e.deps;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i];if(ht(s)&&Ur(s),s.wv>e.wv)return!0}(t&de)!==0&&oe===null&&j(e,U)}return!1}function un(e,t,r=!0){var n=e.reactions;if(n!==null&&!Ae?.includes(e))for(var i=0;i<n.length;i++){var s=n[i];(s.f&O)!==0?un(s,t,!1):t===s&&(r?j(s,Z):(s.f&U)!==0&&j(s,Ee),qe(s))}}function dn(e){var t=W,r=ie,n=fe,i=x,s=Ae,a=ne,o=_e,l=Ze,c=e.f;W=null,ie=0,fe=null,x=(c&(Se|Ie))===0?e:null,Ae=null,st(e.ctx),_e=!1,Ze=++dt,e.ac!==null&&(Gr(()=>{e.ac.abort(rt)}),e.ac=null);try{e.f|=Kt;var u=e.fn,d=u(),h=e.deps;if(W!==null){var g;if(Ot(e,ie),h!==null&&ie>0)for(h.length=ie+W.length,g=0;g<W.length;g++)h[ie+g]=W[g];else e.deps=h=W;if(ut()&&(e.f&de)!==0)for(g=ie;g<h.length;g++)(h[g].reactions??=[]).push(e)}else h!==null&&ie<h.length&&(Ot(e,ie),h.length=ie);if(Mr()&&fe!==null&&!_e&&h!==null&&(e.f&(O|Ee|Z))===0)for(g=0;g<fe.length;g++)un(fe[g],e);return i!==null&&i!==e&&(dt++,fe!==null&&(n===null?n=fe:n.push(...fe))),(e.f&Le)!==0&&(e.f^=Le),d}catch(v){return Dr(v)}finally{e.f^=Kt,W=t,ie=r,fe=n,x=i,Ae=s,st(a),_e=o,Ze=l}}function Fs(e,t){let r=t.reactions;if(r!==null){var n=Yn.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(t.f&O)!==0&&(W===null||!W.includes(t))&&(j(t,Ee),(t.f&de)!==0&&(t.f^=de,t.f&=~je),Fr(t),Ot(t,0))}function Ot(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Fs(e,r[n])}function vt(e){var t=e.f;if((t&ke)===0){j(e,U);var r=S,n=Ke;S=e,Ke=!0;try{(t&(xe|Qn))!==0?Os(e):en(e),Qr(e);var i=dn(e);e.teardown=typeof i=="function"?i:null,e.wv=ln;var s;Ht&&gs&&(e.f&Z)!==0&&e.deps}finally{Ke=n,S=r}}}function f(e){var t=e.f,r=(t&O)!==0;if(x!==null&&!_e){var n=S!==null&&(S.f&ke)!==0;if(!n&&!Ae?.includes(e)){var i=x.deps;if((x.f&Kt)!==0)e.rv<dt&&(e.rv=dt,W===null&&i!==null&&i[ie]===e?ie++:W===null?W=[e]:W.includes(e)||W.push(e));else{(x.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[x]:s.includes(x)||s.push(x)}}}if(Ye){if(Ne.has(e))return Ne.get(e);if(r){var a=e,o=a.v;return((a.f&U)===0&&a.reactions!==null||vn(a))&&(o=Qt(a)),Ne.set(a,o),o}}else r&&(!oe?.has(e)||A?.is_fork&&!ut())&&(a=e,ht(a)&&Ur(a),Ke&&ut()&&(a.f&de)===0&&hn(a));if(oe?.has(e))return oe.get(e);if((e.f&Le)!==0)throw e.v;return e.v}function hn(e){if(e.deps!==null){e.f^=de;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&O)!==0&&(t.f&de)===0&&hn(t)}}function vn(e){if(e.v===F)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Ne.has(t)||(t.f&O)!==0&&vn(t))return!0;return!1}function ar(e){var t=_e;try{return _e=!0,e()}finally{_e=t}}const Us=-7169;function j(e,t){e.f=e.f&Us|t}const pn=new Set,or=new Set;function gn(e){for(var t=0;t<e.length;t++)pn.add(e[t]);for(var r of or)r(e)}let mn=null;function Nt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;mn=e;var a=0,o=mn===e&&e.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;l<=c&&(a=l)}if(s=i[a]||e.target,s!==t){xt(e,"currentTarget",{configurable:!0,get(){return s||r}});var u=x,d=S;G(null),be(null);try{for(var h,g=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var b=s["__"+n];b!=null&&(!s.disabled||e.target===s)&&b.call(s,e)}catch(_){h?g.push(_):h=_}if(e.cancelBubble||v===t||v===null)break;s=v}if(h){for(let _ of g)queueMicrotask(()=>{throw _});throw h}}finally{e.__root=t,delete e.currentTarget,G(u),be(d)}}}function _n(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function ot(e,t){var r=S;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function N(e,t){var r=(t&Vn)!==0,n=(t&Wn)!==0,i,s=!e.startsWith("<!>");return()=>{if(E)return ot(k,null),k;i===void 0&&(i=_n(s?e:"<!>"+e),r||(i=Pe(i)));var a=n||Vr?document.importNode(i,!0):i.cloneNode(!0);if(r){var o=Pe(a),l=a.lastChild;ot(o,l)}else ot(a,a);return a}}function js(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(E)return ot(k,null),k;if(!s){var a=_n(i),o=Pe(a);s=Pe(o)}var l=s.cloneNode(!0);return ot(l,l),l}}function Pt(e,t){return js(e,t,"svg")}function I(e,t){if(E){var r=S;((r.f&Et)===0||r.nodes.end===null)&&(r.nodes.end=k),Ct();return}e!==null&&e.before(t)}const Bs=["touchstart","touchmove"];function qs(e){return Bs.includes(e)}function Ge(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function bn(e,t){return wn(e,t)}function Hs(e,t){tr(),t.intro=t.intro??!1;const r=t.target,n=E,i=k;try{for(var s=Pe(r);s&&(s.nodeType!==nt||s.data!==yr);)s=ge(s);if(!s)throw Qe;ze(!0),re(s);const a=wn(e,{...t,anchor:s});return ze(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==Qe&&console.warn("Failed to hydrate: ",a),t.recover===!1&&cs(),tr(),Yr(r),ze(!1),bn(e,t)}finally{ze(n),re(i)}}const lt=new Map;function wn(e,{target:t,anchor:r,props:n={},events:i,context:s,intro:a=!0}){tr();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var g=d[h];if(!o.has(g)){o.add(g);var v=qs(g);t.addEventListener(g,Nt,{passive:v});var b=lt.get(g);b===void 0?(document.addEventListener(g,Nt,{passive:v}),lt.set(g,1)):lt.set(g,b+1)}}};l(yt(pn)),or.add(l);var c=void 0,u=Ds(()=>{var d=r??t.appendChild(pe());return ys(d,{pending:()=>{}},h=>{if(s){Gt({});var g=ne;g.c=s}if(i&&(n.$$events=i),E&&ot(h,null),c=e(h,n)||{},E&&(S.nodes.end=k,k===null||k.nodeType!==nt||k.data!==qt))throw zt(),Qe;s&&Jt()}),()=>{for(var h of o){t.removeEventListener(h,Nt);var g=lt.get(h);--g===0?(document.removeEventListener(h,Nt),lt.delete(h)):lt.set(h,g)}or.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return lr.set(c,u),c}let lr=new WeakMap;function Vs(e,t){const r=lr.get(e);return r?(lr.delete(e),r(t)):Promise.resolve()}class Ws{anchor;#t=new Map;#e=new Map;#r=new Map;#n=new Set;#l=!0;constructor(t,r=!0){this.anchor=t,this.#l=r}#i=()=>{var t=A;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#e.get(r);if(n)ir(n),this.#n.delete(r);else{var i=this.#r.get(r);i&&(this.#e.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,a]of this.#t){if(this.#t.delete(s),s===t)break;const o=this.#r.get(a);o&&(V(o.effect),this.#r.delete(a))}for(const[s,a]of this.#e){if(s===r||this.#n.has(s))continue;const o=()=>{if(Array.from(this.#t.values()).includes(s)){var c=document.createDocumentFragment();sn(a,c),c.append(pe()),this.#r.set(s,{effect:a,fragment:c})}else V(a);this.#n.delete(s),this.#e.delete(s)};this.#l||!n?(this.#n.add(s),We(a,o,!1)):o()}}};#s=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,i]of this.#r)r.includes(n)||(V(i.effect),this.#r.delete(n))};ensure(t,r){var n=A,i=Zr();if(r&&!this.#e.has(t)&&!this.#r.has(t))if(i){var s=document.createDocumentFragment(),a=pe();s.append(a),this.#r.set(t,{effect:ce(()=>r(a)),fragment:s})}else this.#e.set(t,ce(()=>r(this.anchor)));if(this.#t.set(n,t),i){for(const[o,l]of this.#e)o===t?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===t?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#i),n.ondiscard(this.#s)}else E&&(this.anchor=k),this.#i()}}function yn(e){ne===null&&ns(),rr(()=>{const t=ar(e);if(typeof t=="function")return t})}function B(e,t,r=!1){E&&Ct();var n=new Ws(e),i=r?tt:0;function s(a,o){if(E){const c=Ar(e)===wt;if(a===c){var l=At();re(l),n.anchor=l,ze(!1),n.ensure(a,o),ze(!0);return}}n.ensure(a,o)}sr(()=>{var a=!1;t((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},i)}function Ks(e,t,r){for(var n=[],i=t.length,s,a=t.length,o=0;o<i;o++){let d=t[o];We(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=e.outrogroups;cr(yt(s.done)),h.delete(s),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;Yr(u),u.append(c),e.items.clear()}cr(t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function cr(e,t=!0){for(var r=0;r<e.length;r++)V(e[r],t)}var $n;function Ys(e,t,r,n,i,s=null){var a=e,o=new Map;E&&Ct();var l=null,c=ks(()=>{var b=r();return $r(b)?b:b==null?[]:yt(b)}),u,d=!0;function h(){v.fallback=l,Zs(v,u,a,t,n),l!==null&&(u.length===0?(l.f&De)===0?ir(l):(l.f^=De,pt(l,null,a)):We(l,()=>{l=null}))}var g=sr(()=>{u=f(c);var b=u.length;let _=!1;if(E){var z=Ar(a)===wt;z!==(b===0)&&(a=At(),re(a),ze(!1),_=!0)}for(var M=new Set,q=A,ye=Zr(),K=0;K<b;K+=1){E&&k.nodeType===nt&&k.data===qt&&(a=k,_=!0,ze(!1));var J=u[K],y=n(J,K),$=d?null:o.get(y);$?($.v&&at($.v,J),$.i&&at($.i,K),ye&&q.skipped_effects.delete($.e)):($=Gs(o,d?a:$n??=pe(),J,y,K,i,t,r),d||($.e.f|=De),o.set(y,$)),M.add(y)}if(b===0&&s&&!l&&(d?l=ce(()=>s(a)):(l=ce(()=>s($n??=pe())),l.f|=De)),E&&b>0&&re(At()),!d)if(ye){for(const[ae,H]of o)M.has(ae)||q.skipped_effects.add(H.e);q.oncommit(h),q.ondiscard(()=>{})}else h();_&&ze(!0),f(c)}),v={effect:g,items:o,outrogroups:null,fallback:l};d=!1,E&&(a=k)}function Zs(e,t,r,n,i){var s=t.length,a=e.items,o=e.effect.first,l,c=null,u=[],d=[],h,g,v,b;for(b=0;b<s;b+=1){if(h=t[b],g=i(h,b),v=a.get(g).e,e.outrogroups!==null)for(const $ of e.outrogroups)$.pending.delete(v),$.done.delete(v);if((v.f&De)!==0)if(v.f^=De,v===o)pt(v,null,r);else{var _=c?c.next:o;v===e.effect.last&&(e.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),Fe(e,c,v),Fe(e,v,_),pt(v,_,r),c=v,u=[],d=[],o=c.next;continue}if((v.f&te)!==0&&ir(v),v!==o){if(l!==void 0&&l.has(v)){if(u.length<d.length){var z=d[0],M;c=z.prev;var q=u[0],ye=u[u.length-1];for(M=0;M<u.length;M+=1)pt(u[M],z,r);for(M=0;M<d.length;M+=1)l.delete(d[M]);Fe(e,q.prev,ye.next),Fe(e,c,q),Fe(e,ye,z),o=z,c=ye,b-=1,u=[],d=[]}else l.delete(v),pt(v,o,r),Fe(e,v.prev,v.next),Fe(e,v,c===null?e.effect.first:c.next),Fe(e,c,v),c=v;continue}for(u=[],d=[];o!==null&&o!==v;)(l??=new Set).add(o),d.push(o),o=o.next;if(o===null)continue}(v.f&De)===0&&u.push(v),c=v,o=v.next}if(e.outrogroups!==null){for(const $ of e.outrogroups)$.pending.size===0&&(cr(yt($.done)),e.outrogroups?.delete($));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var K=[];if(l!==void 0)for(v of l)(v.f&te)===0&&K.push(v);for(;o!==null;)(o.f&te)===0&&o!==e.fallback&&K.push(o),o=o.next;var J=K.length;if(J>0){var y=null;Ks(e,K,y)}}}function Gs(e,t,r,n,i,s,a,o){var l=(a&Bn)!==0?(a&Hn)===0?Br(r,!1,!1):He(r):null,c=(a&qn)!==0?He(i):null;return{v:l,i:c,e:ce(()=>(s(t,l??r,c??i,o),()=>{e.delete(n)}))}}function pt(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,s=t&&(t.f&De)===0?t.nodes.start:r;n!==null;){var a=ge(n);if(s.before(n),n===i)return;n=a}}function Fe(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function xn(e,t){Xr(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i)}})}const Sn=[...`
3
- \r\f \v\uFEFF`];function Js(e,t,r){var n=e==null?"":""+e;if(r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||Sn.includes(n[a-1]))&&(o===n.length||Sn.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function Xs(e,t){return e==null?null:String(e)}function gt(e,t,r,n,i,s){var a=e.__className;if(E||a!==r||a===void 0){var o=Js(r,n,s);(!E||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function En(e,t,r,n){var i=e.__style;if(E||i!==t){var s=Xs(t);(!E||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}return n}const Qs=Symbol("is custom element"),ei=Symbol("is html");function Ft(e,t,r,n){var i=ti(e);E&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[rs]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ri(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ti(e){return e.__attributes??={[Qs]:e.nodeName.includes("-"),[ei]:e.namespaceURI===Kn}}var kn=new Map;function ri(e){var t=e.getAttribute("is")||e.nodeName,r=kn.get(t);if(r)return r;kn.set(t,r=[]);for(var n,i=e,s=Element.prototype;s!==i;){n=Zn(i);for(var a in n)n[a].set&&r.push(a);i=xr(i)}return r}function zn(e,t){return e===t||e?.[kt]===t}function fr(e={},t,r,n){return Xr(()=>{var i,s;return nr(()=>{i=s,s=[],ar(()=>{e!==r(...s)&&(t(e,...s),i&&zn(r(...i),e)&&t(null,...i))})}),()=>{Tt(()=>{s&&zn(r(...s),e)&&t(null,...s)})}}),e}function we(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var c=!1,u=Dt(()=>(c=!1,l())),d=S;return(function(h,g){if(arguments.length>0){const v=g?f(u):h;return w(u,v),c=!0,i!==void 0&&(i=v),h}return Ye&&c||(d.f&ke)!==0?u.v:f(u)})}function ni(e){return new si(e)}class si{#t;#e;constructor(t){var r=new Map,n=(s,a)=>{var o=Br(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return f(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===ts?!0:(f(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return w(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#e=(t.hydrate?Hs:bn)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&ve(),this.#t=i.$$events;for(const s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||xt(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(i,s)},this.#e.$destroy=()=>{Vs(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];const n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}}let Cn;typeof HTMLElement=="function"&&(Cn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),I(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=ii(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Ut(i,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=ni({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Is(()=>{nr(()=>{this.$$r=!0;for(const n of $t(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Ut(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ut(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return $t(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ut(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function ii(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function An(e,t,r,n,i,s){let a=class extends Cn{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return $t(t).map(o=>(t[o].attribute||o).toLowerCase())}};return $t(t).forEach(o=>{xt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Ut(o,l,t),this.$$d[o]=l;var c=this.$$c;if(c){var u=et(c,o)?.get;u?c[o]=l:c.$set({[o]:l})}}})}),n.forEach(o=>{xt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}var ai=N('<span class="unread-badge svelte-1105cax"> </span>'),oi=Pt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),li=Pt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),ci=N('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),fi=N('<div class="chat-window svelte-1105cax"><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write"></iframe></div>'),ui=N('<div class="support-chat svelte-1105cax"><button class="toggle-btn svelte-1105cax"><!> <!></button> <!></div>');const di={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s, opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
1
+ var FortaleceAI=(function(se){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const cs=1,fs=2,us=16,ds=1,hs=2,Yr="[",Rt="[!",lr="]",ot={},j=Symbol(),vs="http://www.w3.org/1999/xhtml",cr=!1;var Zr=Array.isArray,ps=Array.prototype.indexOf,Mt=Array.from,It=Object.keys,Lt=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,gs=Object.getOwnPropertyDescriptors,ms=Object.prototype,_s=Array.prototype,Gr=Object.getPrototypeOf,Jr=Object.isExtensible;function bs(e){for(var t=0;t<e.length;t++)e[t]()}function Xr(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const P=2,fr=4,ur=8,ws=1<<24,Ae=16,ze=32,Ue=64,Dt=128,me=512,B=1024,J=2048,Te=4096,ie=8192,Re=16384,Ot=32768,ct=65536,Qr=1<<17,en=1<<18,Ze=1<<19,ys=1<<20,je=1<<25,Ge=32768,dr=1<<21,hr=1<<22,Be=1<<23,Nt=Symbol("$state"),xs=Symbol("legacy props"),$s=Symbol(""),ft=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},vr=3,ut=8;function Ss(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ks(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Es(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Cs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function As(e){throw new Error("https://svelte.dev/e/effect_orphan")}function zs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ts(){throw new Error("https://svelte.dev/e/hydration_failed")}function Rs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ms(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Is(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ls(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Pt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ds(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let k=!1;function Me(e){k=e}let S;function ae(e){if(e===null)throw Pt(),ot;return S=e}function Ft(){return ae(ye(S))}function R(e){if(k){if(ye(S)!==null)throw Pt(),ot;S=e}}function pr(e=1){if(k){for(var t=e,r=S;t--;)r=ye(r);S=r}}function Ut(e=!0){for(var t=0,r=S;;){if(r.nodeType===ut){var n=r.data;if(n===lr){if(t===0)return r;t-=1}else(n===Yr||n===Rt)&&(t+=1)}var i=ye(r);e&&r.remove(),r=i}}function tn(e){if(!e||e.nodeType!==ut)throw Pt(),ot;return e.data}function rn(e){return e===this.v}function Os(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function nn(e){return!Os(e,this.v)}let Ns=!1,oe=null;function dt(e){oe=e}function gr(e,t=!1,r){oe={p:oe,i:!1,c:null,e:null,s:e,x:null,l:null}}function mr(e){var t=oe,r=t.e;if(r!==null){t.e=null;for(var n of r)kn(n)}return e!==void 0&&(t.x=e),t.i=!0,oe=t.p,e??{}}function sn(){return!0}let Je=[];function an(){var e=Je;Je=[],bs(e)}function jt(e){if(Je.length===0&&!wt){var t=Je;queueMicrotask(()=>{t===Je&&an()})}Je.push(e)}function Ps(){for(;Je.length>0;)an()}function on(e){var t=E;if(t===null)return $.f|=Be,e;if((t.f&Ot)===0){if((t.f&Dt)===0)throw e;t.b.error(e)}else ht(e,t)}function ht(e,t){for(;t!==null;){if((t.f&Dt)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const Bt=new Set;let L=null,fe=null,ue=[],Ht=null,_r=!1,wt=!1;class _e{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#r=0;#n=0;#l=null;#i=[];#s=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){ue=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of t)this.#a(n,r);this.is_fork||this.#f(),this.is_deferred()?(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects)):(L=null,cn(r.render_effects),cn(r.effects),this.#l?.resolve()),fe=null}#a(t,r){t.f^=B;for(var n=t.first;n!==null;){var i=n.f,s=(i&(ze|Ue))!==0,a=s&&(i&B)!==0,o=a||(i&ie)!==0||this.skipped_effects.has(n);if((n.f&Dt)!==0&&n.b?.is_pending()&&(r={parent:r,effect:n,effects:[],render_effects:[],block_effects:[]}),!o&&n.fn!==null){s?n.f^=B:(i&fr)!==0?r.effects.push(n):St(n)&&((n.f&Ae)!==0&&r.block_effects.push(n),kt(n));var l=n.first;if(l!==null){n=l;continue}}var c=n.parent;for(n=n.next;n===null&&c!==null;)c===r.effect&&(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects),r=r.parent),n=c.next,c=c.parent}}#o(t){for(const r of t)((r.f&J)!==0?this.#i:this.#s).push(r),this.#c(r.deps),q(r,B)}#c(t){if(t!==null)for(const r of t)(r.f&P)===0||(r.f&Ge)===0||(r.f^=Ge,this.#c(r.deps))}capture(t,r){this.previous.has(t)||this.previous.set(t,r),(t.f&Be)===0&&(this.current.set(t,t.v),fe?.set(t,t.v))}activate(){L=this,this.apply()}deactivate(){L===this&&(L=null,fe=null)}flush(){if(this.activate(),ue.length>0){if(ln(),L!==null&&L!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#f(){if(this.#n===0){for(const t of this.#t)t();this.#t.clear()}this.#r===0&&this.#u()}#u(){if(Bt.size>1){this.previous.clear();var t=fe,r=!0,n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const s of Bt){if(s===this){r=!1;continue}const a=[];for(const[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;const o=[...s.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var i=ue;ue=[];const l=new Set,c=new Map;for(const u of a)fn(u,o,l,c);if(ue.length>0){L=s,s.apply();for(const u of ue)s.#a(u,n);s.deactivate()}ue=i}}L=null,fe=t}this.committed=!0,Bt.delete(this)}increment(t){this.#r+=1,t&&(this.#n+=1)}decrement(t){this.#r-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#i)q(t,J),Xe(t);for(const t of this.#s)q(t,Te),Xe(t);this.#i=[],this.#s=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#l??=Xr()).promise}static ensure(){if(L===null){const t=L=new _e;Bt.add(L),wt||_e.enqueue(()=>{L===t&&t.flush()})}return L}static enqueue(t){jt(t)}apply(){}}function H(e){var t=wt;wt=!0;try{for(var r;;){if(Ps(),ue.length===0&&(L?.flush(),ue.length===0))return Ht=null,r;ln()}}finally{wt=t}}function ln(){var e=tt;_r=!0;var t=null;try{var r=0;for(Kt(!0);ue.length>0;){var n=_e.ensure();if(r++>1e3){var i,s;Fs()}n.process(ue),He.clear()}}finally{_r=!1,Kt(e),Ht=null}}function Fs(){try{zs()}catch(e){ht(e,Ht)}}let Ie=null;function cn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Re|ie))===0&&St(n)&&(Ie=new Set,kt(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?zn(n):n.fn=null),Ie?.size>0)){He.clear();for(const i of Ie){if((i.f&(Re|ie))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)Ie.has(a)&&(Ie.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const l=s[o];(l.f&(Re|ie))===0&&kt(l)}}Ie.clear()}}Ie=null}}function fn(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&P)!==0?fn(i,t,r,n):(s&(hr|Ae))!==0&&(s&J)===0&&un(i,t,n)&&(q(i,J),Xe(i))}}function un(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(t.includes(i))return!0;if((i.f&P)!==0&&un(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Xe(e){for(var t=Ht=e;t.parent!==null;){t=t.parent;var r=t.f;if(_r&&t===E&&(r&Ae)!==0&&(r&en)===0)return;if((r&(Ue|ze))!==0){if((r&B)===0)return;t.f^=B}}ue.push(t)}function Us(e){let t=0,r=Qe(0),n;return()=>{xt()&&(f(r),xr(()=>(t===0&&(n=kr(()=>e(()=>yt(r)))),t+=1,()=>{jt(()=>{t-=1,t===0&&(n?.(),n=void 0,yt(r))})})))}}var js=ct|Ze|Dt;function Bs(e,t,r){new Hs(e,t,r)}class Hs{parent;#t=!1;#e;#r=k?S:null;#n;#l;#i;#s=null;#a=null;#o=null;#c=null;#f=null;#u=0;#d=0;#v=!1;#h=null;#b=Us(()=>(this.#h=Qe(this.#u),()=>{this.#h=null}));constructor(t,r,n){this.#e=t,this.#n=r,this.#l=n,this.parent=E.b,this.#t=!!this.#n.pending,this.#i=$r(()=>{if(E.b=this,k){const s=this.#r;Ft(),s.nodeType===ut&&s.data===Rt?this.#y():this.#w()}else{var i=this.#m();try{this.#s=de(()=>n(i))}catch(s){this.error(s)}this.#d>0?this.#g():this.#t=!1}return()=>{this.#f?.remove()}},js),k&&(this.#e=S)}#w(){try{this.#s=de(()=>this.#l(this.#e))}catch(t){this.error(t)}this.#t=!1}#y(){const t=this.#n.pending;t&&(this.#a=de(()=>t(this.#e)),_e.enqueue(()=>{var r=this.#m();this.#s=this.#p(()=>(_e.ensure(),de(()=>this.#l(r)))),this.#d>0?this.#g():(et(this.#a,()=>{this.#a=null}),this.#t=!1)}))}#m(){var t=this.#e;return this.#t&&(this.#f=we(),this.#e.before(this.#f),t=this.#f),t}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#p(t){var r=E,n=$,i=oe;Se(this.#i),Q(this.#i),dt(this.#i.ctx);try{return t()}catch(s){return on(s),null}finally{Se(r),Q(n),dt(i)}}#g(){const t=this.#n.pending;this.#s!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#f),Mn(this.#s,this.#c)),this.#a===null&&(this.#a=de(()=>t(this.#e)))}#_(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#_(t);return}this.#d+=t,this.#d===0&&(this.#t=!1,this.#a&&et(this.#a,()=>{this.#a=null}),this.#c&&(this.#e.before(this.#c),this.#c=null))}update_pending_count(t){this.#_(t),this.#u+=t,this.#h&&vt(this.#h,this.#u)}get_effect_pending(){return this.#b(),f(this.#h)}error(t){var r=this.#n.onerror;let n=this.#n.failed;if(this.#v||!r&&!n)throw t;this.#s&&(W(this.#s),this.#s=null),this.#a&&(W(this.#a),this.#a=null),this.#o&&(W(this.#o),this.#o=null),k&&(ae(this.#r),pr(),ae(Ut()));var i=!1,s=!1;const a=()=>{if(i){Ds();return}i=!0,s&&Ls(),_e.ensure(),this.#u=0,this.#o!==null&&et(this.#o,()=>{this.#o=null}),this.#t=this.has_pending_snippet(),this.#s=this.#p(()=>(this.#v=!1,de(()=>this.#l(this.#e)))),this.#d>0?this.#g():this.#t=!1};var o=$;try{Q(null),s=!0,r?.(t,a),s=!1}catch(l){ht(l,this.#i&&this.#i.parent)}finally{Q(o)}n&&jt(()=>{this.#o=this.#p(()=>{_e.ensure(),this.#v=!0;try{return de(()=>{n(this.#e,()=>t,()=>a)})}catch(l){return ht(l,this.#i.parent),null}finally{this.#v=!1}})})}}function qs(e,t,r,n){const i=Vt;if(r.length===0&&e.length===0){n(t.map(i));return}var s=L,a=E,o=Vs();function l(){Promise.all(r.map(c=>Ws(c))).then(c=>{o();try{n([...t.map(i),...c])}catch(u){(a.f&Re)===0&&ht(u,a)}s?.deactivate(),qt()}).catch(c=>{ht(c,a)})}e.length>0?Promise.all(e).then(()=>{o();try{return l()}finally{s?.deactivate(),qt()}}):l()}function Vs(){var e=E,t=$,r=oe,n=L;return function(s=!0){Se(e),Q(t),dt(r),s&&n?.activate()}}function qt(){Se(null),Q(null),dt(null)}function Vt(e){var t=P|J,r=$!==null&&($.f&P)!==0?$:null;return E!==null&&(E.f|=Ze),{ctx:oe,deps:null,effects:null,equals:rn,f:t,fn:e,reactions:null,rv:0,v:j,wv:0,parent:r??E,ac:null}}function Ws(e,t){let r=E;r===null&&ks();var n=r.b,i=void 0,s=Qe(j),a=!$,o=new Map;return ti(()=>{var l=Xr();i=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).then(()=>{c===L&&c.committed&&c.deactivate(),qt()})}catch(h){l.reject(h),qt()}var c=L;if(a){var u=!n.is_pending();n.update_pending_count(1),c.increment(u),o.get(c)?.reject(ft),o.delete(c),o.set(c,l)}const d=(h,g=void 0)=>{if(c.activate(),g)g!==ft&&(s.f|=Be,vt(s,g));else{(s.f&Be)!==0&&(s.f^=Be),vt(s,h);for(const[v,b]of o){if(o.delete(v),v===c)break;b.reject(ft)}}a&&(n.update_pending_count(-1),c.decrement(u))};l.promise.then(d,h=>d(null,h||"unknown"))}),Xs(()=>{for(const l of o.values())l.reject(ft)}),new Promise(l=>{function c(u){function d(){u===i?l(s):c(i)}u.then(d,d)}c(i)})}function be(e){const t=Vt(e);return Ln(t),t}function Ks(e){const t=Vt(e);return t.equals=nn,t}function dn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)W(t[r])}}function Ys(e){for(var t=e.parent;t!==null;){if((t.f&P)===0)return(t.f&Re)===0?t:null;t=t.parent}return null}function br(e){var t,r=E;Se(Ys(e));try{e.f&=~Ge,dn(e),t=Fn(e)}finally{Se(r)}return t}function hn(e){var t=br(e);if(e.equals(t)||(L?.is_fork||(e.v=t),e.wv=Nn()),!rt)if(fe!==null)(xt()||L?.is_fork)&&fe.set(e,t);else{var r=(e.f&me)===0?Te:B;q(e,r)}}let wr=new Set;const He=new Map;let vn=!1;function Qe(e,t){var r={f:0,v:e,reactions:null,equals:rn,rv:0,wv:0};return r}function z(e,t){const r=Qe(e);return Ln(r),r}function pn(e,t=!1,r=!0){const n=Qe(e);return t||(n.equals=nn),n}function m(e,t,r=!1){$!==null&&(!$e||($.f&Qr)!==0)&&sn()&&($.f&(P|Ae|hr|Qr))!==0&&!De?.includes(e)&&Is();let n=r?Le(t):t;return vt(e,n)}function vt(e,t){if(!e.equals(t)){var r=e.v;rt?He.set(e,t):He.set(e,r),e.v=t;var n=_e.ensure();n.capture(e,r),(e.f&P)!==0&&((e.f&J)!==0&&br(e),q(e,(e.f&me)!==0?B:Te)),e.wv=Nn(),gn(e,J),E!==null&&(E.f&B)!==0&&(E.f&(ze|Ue))===0&&(he===null?si([e]):he.push(e)),!n.is_fork&&wr.size>0&&!vn&&Zs()}return t}function Zs(){vn=!1;var e=tt;Kt(!0);const t=Array.from(wr);try{for(const r of t)(r.f&B)!==0&&q(r,Te),St(r)&&kt(r)}finally{Kt(e)}wr.clear()}function yt(e){m(e,e.v+1)}function gn(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,o=(a&J)===0;if(o&&q(s,t),(a&P)!==0){var l=s;fe?.delete(l),(a&Ge)===0&&(a&me&&(s.f|=Ge),gn(l,Te))}else o&&((a&Ae)!==0&&Ie!==null&&Ie.add(s),Xe(s))}}function Le(e){if(typeof e!="object"||e===null||Nt in e)return e;const t=Gr(e);if(t!==ms&&t!==_s)return e;var r=new Map,n=Zr(e),i=z(0),s=nt,a=o=>{if(nt===s)return o();var l=$,c=nt;Q(null),On(s);var u=o();return Q(l),On(c),u};return n&&r.set("length",z(e.length)),new Proxy(e,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Rs();var u=r.get(l);return u===void 0?u=a(()=>{var d=z(c.value);return r.set(l,d),d}):m(u,c.value,!0),!0},deleteProperty(o,l){var c=r.get(l);if(c===void 0){if(l in o){const u=a(()=>z(j));r.set(l,u),yt(i)}}else m(c,j),yt(i);return!0},get(o,l,c){if(l===Nt)return e;var u=r.get(l),d=l in o;if(u===void 0&&(!d||lt(o,l)?.writable)&&(u=a(()=>{var g=Le(d?o[l]:j),v=z(g);return v}),r.set(l,u)),u!==void 0){var h=f(u);return h===j?void 0:h}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var u=r.get(l);u&&(c.value=f(u))}else if(c===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==j)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(o,l){if(l===Nt)return!0;var c=r.get(l),u=c!==void 0&&c.v!==j||Reflect.has(o,l);if(c!==void 0||E!==null&&(!u||lt(o,l)?.writable)){c===void 0&&(c=a(()=>{var h=u?Le(o[l]):j,g=z(h);return g}),r.set(l,c));var d=f(c);if(d===j)return!1}return u},set(o,l,c,u){var d=r.get(l),h=l in o;if(n&&l==="length")for(var g=c;g<d.v;g+=1){var v=r.get(g+"");v!==void 0?m(v,j):g in o&&(v=a(()=>z(j)),r.set(g+"",v))}if(d===void 0)(!h||lt(o,l)?.writable)&&(d=a(()=>z(void 0)),m(d,Le(c)),r.set(l,d));else{h=d.v!==j;var b=a(()=>Le(c));m(d,b)}var C=Reflect.getOwnPropertyDescriptor(o,l);if(C?.set&&C.set.call(u,c),!h){if(n&&typeof l=="string"){var x=r.get("length"),y=Number(l);Number.isInteger(y)&&y>=x.v&&m(x,y+1)}yt(i)}return!0},ownKeys(o){f(i);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==j});for(var[c,u]of r)u.v!==j&&!(c in o)&&l.push(c);return l},setPrototypeOf(){Ms()}})}var mn,_n,bn,wn;function yr(){if(mn===void 0){mn=window,_n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;bn=lt(t,"firstChild").get,wn=lt(t,"nextSibling").get,Jr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Jr(r)&&(r.__t=void 0)}}function we(e=""){return document.createTextNode(e)}function qe(e){return bn.call(e)}function ye(e){return wn.call(e)}function M(e,t){if(!k)return qe(e);var r=qe(S);if(r===null)r=S.appendChild(we());else if(t&&r.nodeType!==vr){var n=we();return r?.before(n),ae(n),n}return ae(r),r}function yn(e,t=!1){if(!k){var r=qe(e);return r instanceof Comment&&r.data===""?ye(r):r}if(t&&S?.nodeType!==vr){var n=we();return S?.before(n),ae(n),n}return S}function O(e,t=1,r=!1){let n=k?S:e;for(var i;t--;)i=n,n=ye(n);if(!k)return n;if(r&&n?.nodeType!==vr){var s=we();return n===null?i?.after(s):n.before(s),ae(s),s}return ae(n),n}function xn(e){e.textContent=""}function $n(){return!1}function Sn(e){var t=$,r=E;Q(null),Se(null);try{return e()}finally{Q(t),Se(r)}}function Gs(e){E===null&&($===null&&As(),Cs()),rt&&Es()}function Js(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function xe(e,t,r){var n=E;n!==null&&(n.f&ie)!==0&&(e|=ie);var i={ctx:oe,deps:null,nodes:null,f:e|J|me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{kt(i),i.f|=Ot}catch(o){throw W(i),o}else t!==null&&Xe(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Ze)===0&&(s=s.first,(e&Ae)!==0&&(e&ct)!==0&&s!==null&&(s.f|=ct)),s!==null&&(s.parent=n,n!==null&&Js(s,n),$!==null&&($.f&P)!==0&&(e&Ue)===0)){var a=$;(a.effects??=[]).push(s)}return i}function xt(){return $!==null&&!$e}function Xs(e){const t=xe(ur,null,!1);return q(t,B),t.teardown=e,t}function Wt(e){Gs();var t=E.f,r=!$&&(t&ze)!==0&&(t&Ot)===0;if(r){var n=oe;(n.e??=[]).push(e)}else return kn(e)}function kn(e){return xe(fr|ys,e,!1)}function Qs(e){_e.ensure();const t=xe(Ue|Ze,e,!0);return()=>{W(t)}}function ei(e){_e.ensure();const t=xe(Ue|Ze,e,!0);return(r={})=>new Promise(n=>{r.outro?et(t,()=>{W(t),n(void 0)}):(W(t),n(void 0))})}function En(e){return xe(fr,e,!1)}function ti(e){return xe(hr|Ze,e,!0)}function xr(e,t=0){return xe(ur|t,e,!0)}function X(e,t=[],r=[],n=[]){qs(n,t,r,i=>{xe(ur,()=>e(...i.map(f)),!0)})}function $r(e,t=0){var r=xe(Ae|t,e,!0);return r}function de(e){return xe(ze|Ze,e,!0)}function Cn(e){var t=e.teardown;if(t!==null){const r=rt,n=$;In(!0),Q(null);try{t.call(null)}finally{In(r),Q(n)}}}function An(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&Sn(()=>{i.abort(ft)});var n=r.next;(r.f&Ue)!==0?r.parent=null:W(r,t),r=n}}function ri(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&ze)===0&&W(t),t=r}}function W(e,t=!0){var r=!1;(t||(e.f&en)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ni(e.nodes.start,e.nodes.end),r=!0),An(e,t&&!r),Yt(e,0),q(e,Re);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();Cn(e);var i=e.parent;i!==null&&i.first!==null&&zn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ni(e,t){for(;e!==null;){var r=e===t?null:ye(e);e.remove(),e=r}}function zn(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function et(e,t,r=!0){var n=[];Tn(e,n,!0);var i=()=>{r&&W(e),t&&t()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function Tn(e,t,r){if((e.f&ie)===0){e.f^=ie;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&ct)!==0||(i.f&ze)!==0&&(e.f&Ae)!==0;Tn(i,t,a?r:!1),i=s}}}function Sr(e){Rn(e,!0)}function Rn(e,t){if((e.f&ie)!==0){e.f^=ie,(e.f&B)===0&&(q(e,J),Xe(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&ct)!==0||(r.f&ze)!==0;Rn(r,i?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function Mn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:ye(r);t.append(r),r=i}}let tt=!1;function Kt(e){tt=e}let rt=!1;function In(e){rt=e}let $=null,$e=!1;function Q(e){$=e}let E=null;function Se(e){E=e}let De=null;function Ln(e){$!==null&&(De===null?De=[e]:De.push(e))}let K=null,le=0,he=null;function si(e){he=e}let Dn=1,$t=0,nt=$t;function On(e){nt=e}function Nn(){return++Dn}function St(e){var t=e.f;if((t&J)!==0)return!0;if(t&P&&(e.f&=~Ge),(t&Te)!==0){var r=e.deps;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i];if(St(s)&&hn(s),s.wv>e.wv)return!0}(t&me)!==0&&fe===null&&q(e,B)}return!1}function Pn(e,t,r=!0){var n=e.reactions;if(n!==null&&!De?.includes(e))for(var i=0;i<n.length;i++){var s=n[i];(s.f&P)!==0?Pn(s,t,!1):t===s&&(r?q(s,J):(s.f&B)!==0&&q(s,Te),Xe(s))}}function Fn(e){var t=K,r=le,n=he,i=$,s=De,a=oe,o=$e,l=nt,c=e.f;K=null,le=0,he=null,$=(c&(ze|Ue))===0?e:null,De=null,dt(e.ctx),$e=!1,nt=++$t,e.ac!==null&&(Sn(()=>{e.ac.abort(ft)}),e.ac=null);try{e.f|=dr;var u=e.fn,d=u(),h=e.deps;if(K!==null){var g;if(Yt(e,le),h!==null&&le>0)for(h.length=le+K.length,g=0;g<K.length;g++)h[le+g]=K[g];else e.deps=h=K;if(xt()&&(e.f&me)!==0)for(g=le;g<h.length;g++)(h[g].reactions??=[]).push(e)}else h!==null&&le<h.length&&(Yt(e,le),h.length=le);if(sn()&&he!==null&&!$e&&h!==null&&(e.f&(P|Te|J))===0)for(g=0;g<he.length;g++)Pn(he[g],e);return i!==null&&i!==e&&($t++,he!==null&&(n===null?n=he:n.push(...he))),(e.f&Be)!==0&&(e.f^=Be),d}catch(v){return on(v)}finally{e.f^=dr,K=t,le=r,he=n,$=i,De=s,dt(a),$e=o,nt=l}}function ii(e,t){let r=t.reactions;if(r!==null){var n=ps.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(t.f&P)!==0&&(K===null||!K.includes(t))&&(q(t,Te),(t.f&me)!==0&&(t.f^=me,t.f&=~Ge),dn(t),Yt(t,0))}function Yt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)ii(e,r[n])}function kt(e){var t=e.f;if((t&Re)===0){q(e,B);var r=E,n=tt;E=e,tt=!0;try{(t&(Ae|ws))!==0?ri(e):An(e),Cn(e);var i=Fn(e);e.teardown=typeof i=="function"?i:null,e.wv=Dn;var s;cr&&Ns&&(e.f&J)!==0&&e.deps}finally{tt=n,E=r}}}function f(e){var t=e.f,r=(t&P)!==0;if($!==null&&!$e){var n=E!==null&&(E.f&Re)!==0;if(!n&&!De?.includes(e)){var i=$.deps;if(($.f&dr)!==0)e.rv<$t&&(e.rv=$t,K===null&&i!==null&&i[le]===e?le++:K===null?K=[e]:K.includes(e)||K.push(e));else{($.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[$]:s.includes($)||s.push($)}}}if(rt){if(He.has(e))return He.get(e);if(r){var a=e,o=a.v;return((a.f&B)===0&&a.reactions!==null||jn(a))&&(o=br(a)),He.set(a,o),o}}else r&&(!fe?.has(e)||L?.is_fork&&!xt())&&(a=e,St(a)&&hn(a),tt&&xt()&&(a.f&me)===0&&Un(a));if(fe?.has(e))return fe.get(e);if((e.f&Be)!==0)throw e.v;return e.v}function Un(e){if(e.deps!==null){e.f^=me;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&P)!==0&&(t.f&me)===0&&Un(t)}}function jn(e){if(e.v===j)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(He.has(t)||(t.f&P)!==0&&jn(t))return!0;return!1}function kr(e){var t=$e;try{return $e=!0,e()}finally{$e=t}}const ai=-7169;function q(e,t){e.f=e.f&ai|t}const Bn=new Set,Er=new Set;function Hn(e){for(var t=0;t<e.length;t++)Bn.add(e[t]);for(var r of Er)r(e)}let qn=null;function Zt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;qn=e;var a=0,o=qn===e&&e.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;l<=c&&(a=l)}if(s=i[a]||e.target,s!==t){Lt(e,"currentTarget",{configurable:!0,get(){return s||r}});var u=$,d=E;Q(null),Se(null);try{for(var h,g=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var b=s["__"+n];b!=null&&(!s.disabled||e.target===s)&&b.call(s,e)}catch(C){h?g.push(C):h=C}if(e.cancelBubble||v===t||v===null)break;s=v}if(h){for(let C of g)queueMicrotask(()=>{throw C});throw h}}finally{e.__root=t,delete e.currentTarget,Q(u),Se(d)}}}function Vn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ve(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function N(e,t){var r=(t&ds)!==0,n=(t&hs)!==0,i,s=!e.startsWith("<!>");return()=>{if(k)return Ve(S,null),S;i===void 0&&(i=Vn(s?e:"<!>"+e),r||(i=qe(i)));var a=n||_n?document.importNode(i,!0):i.cloneNode(!0);if(r){var o=qe(a),l=a.lastChild;Ve(o,l)}else Ve(a,a);return a}}function oi(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(k)return Ve(S,null),S;if(!s){var a=Vn(i),o=qe(a);s=qe(o)}var l=s.cloneNode(!0);return Ve(l,l),l}}function Gt(e,t){return oi(e,t,"svg")}function li(){if(k)return Ve(S,null),S;var e=document.createDocumentFragment(),t=document.createComment(""),r=we();return e.append(t,r),Ve(t,r),e}function D(e,t){if(k){var r=E;((r.f&Ot)===0||r.nodes.end===null)&&(r.nodes.end=S),Ft();return}e!==null&&e.before(t)}const ci=["touchstart","touchmove"];function fi(e){return ci.includes(e)}function We(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Wn(e,t){return Kn(e,t)}function ui(e,t){yr(),t.intro=t.intro??!1;const r=t.target,n=k,i=S;try{for(var s=qe(r);s&&(s.nodeType!==ut||s.data!==Yr);)s=ye(s);if(!s)throw ot;Me(!0),ae(s);const a=Kn(e,{...t,anchor:s});return Me(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ot&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Ts(),yr(),xn(r),Me(!1),Wn(e,t)}finally{Me(n),ae(i)}}const pt=new Map;function Kn(e,{target:t,anchor:r,props:n={},events:i,context:s,intro:a=!0}){yr();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var g=d[h];if(!o.has(g)){o.add(g);var v=fi(g);t.addEventListener(g,Zt,{passive:v});var b=pt.get(g);b===void 0?(document.addEventListener(g,Zt,{passive:v}),pt.set(g,1)):pt.set(g,b+1)}}};l(Mt(Bn)),Er.add(l);var c=void 0,u=ei(()=>{var d=r??t.appendChild(we());return Bs(d,{pending:()=>{}},h=>{if(s){gr({});var g=oe;g.c=s}if(i&&(n.$$events=i),k&&Ve(h,null),c=e(h,n)||{},k&&(E.nodes.end=S,S===null||S.nodeType!==ut||S.data!==lr))throw Pt(),ot;s&&mr()}),()=>{for(var h of o){t.removeEventListener(h,Zt);var g=pt.get(h);--g===0?(document.removeEventListener(h,Zt),pt.delete(h)):pt.set(h,g)}Er.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return Cr.set(c,u),c}let Cr=new WeakMap;function di(e,t){const r=Cr.get(e);return r?(Cr.delete(e),r(t)):Promise.resolve()}class hi{anchor;#t=new Map;#e=new Map;#r=new Map;#n=new Set;#l=!0;constructor(t,r=!0){this.anchor=t,this.#l=r}#i=()=>{var t=L;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#e.get(r);if(n)Sr(n),this.#n.delete(r);else{var i=this.#r.get(r);i&&(this.#e.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,a]of this.#t){if(this.#t.delete(s),s===t)break;const o=this.#r.get(a);o&&(W(o.effect),this.#r.delete(a))}for(const[s,a]of this.#e){if(s===r||this.#n.has(s))continue;const o=()=>{if(Array.from(this.#t.values()).includes(s)){var c=document.createDocumentFragment();Mn(a,c),c.append(we()),this.#r.set(s,{effect:a,fragment:c})}else W(a);this.#n.delete(s),this.#e.delete(s)};this.#l||!n?(this.#n.add(s),et(a,o,!1)):o()}}};#s=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,i]of this.#r)r.includes(n)||(W(i.effect),this.#r.delete(n))};ensure(t,r){var n=L,i=$n();if(r&&!this.#e.has(t)&&!this.#r.has(t))if(i){var s=document.createDocumentFragment(),a=we();s.append(a),this.#r.set(t,{effect:de(()=>r(a)),fragment:s})}else this.#e.set(t,de(()=>r(this.anchor)));if(this.#t.set(n,t),i){for(const[o,l]of this.#e)o===t?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===t?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#i),n.ondiscard(this.#s)}else k&&(this.anchor=S),this.#i()}}function Yn(e){oe===null&&Ss(),Wt(()=>{const t=kr(e);if(typeof t=="function")return t})}function F(e,t,r=!1){k&&Ft();var n=new hi(e),i=r?ct:0;function s(a,o){if(k){const c=tn(e)===Rt;if(a===c){var l=Ut();ae(l),n.anchor=l,Me(!1),n.ensure(a,o),Me(!0);return}}n.ensure(a,o)}$r(()=>{var a=!1;t((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},i)}function vi(e,t,r){for(var n=[],i=t.length,s,a=t.length,o=0;o<i;o++){let d=t[o];et(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=e.outrogroups;Ar(Mt(s.done)),h.delete(s),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;xn(u),u.append(c),e.items.clear()}Ar(t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function Ar(e,t=!0){for(var r=0;r<e.length;r++)W(e[r],t)}var Zn;function pi(e,t,r,n,i,s=null){var a=e,o=new Map;k&&Ft();var l=null,c=Ks(()=>{var b=r();return Zr(b)?b:b==null?[]:Mt(b)}),u,d=!0;function h(){v.fallback=l,gi(v,u,a,t,n),l!==null&&(u.length===0?(l.f&je)===0?Sr(l):(l.f^=je,Et(l,null,a)):et(l,()=>{l=null}))}var g=$r(()=>{u=f(c);var b=u.length;let C=!1;if(k){var x=tn(a)===Rt;x!==(b===0)&&(a=Ut(),ae(a),Me(!1),C=!0)}for(var y=new Set,ee=L,V=$n(),Z=0;Z<b;Z+=1){k&&S.nodeType===ut&&S.data===lr&&(a=S,C=!0,Me(!1));var Oe=u[Z],ke=n(Oe,Z),I=d?null:o.get(ke);I?(I.v&&vt(I.v,Oe),I.i&&vt(I.i,Z),V&&ee.skipped_effects.delete(I.e)):(I=mi(o,d?a:Zn??=we(),Oe,ke,Z,i,t,r),d||(I.e.f|=je),o.set(ke,I)),y.add(ke)}if(b===0&&s&&!l&&(d?l=de(()=>s(a)):(l=de(()=>s(Zn??=we())),l.f|=je)),k&&b>0&&ae(Ut()),!d)if(V){for(const[ve,mt]of o)y.has(ve)||ee.skipped_effects.add(mt.e);ee.oncommit(h),ee.ondiscard(()=>{})}else h();C&&Me(!0),f(c)}),v={effect:g,items:o,outrogroups:null,fallback:l};d=!1,k&&(a=S)}function gi(e,t,r,n,i){var s=t.length,a=e.items,o=e.effect.first,l,c=null,u=[],d=[],h,g,v,b;for(b=0;b<s;b+=1){if(h=t[b],g=i(h,b),v=a.get(g).e,e.outrogroups!==null)for(const I of e.outrogroups)I.pending.delete(v),I.done.delete(v);if((v.f&je)!==0)if(v.f^=je,v===o)Et(v,null,r);else{var C=c?c.next:o;v===e.effect.last&&(e.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),Ke(e,c,v),Ke(e,v,C),Et(v,C,r),c=v,u=[],d=[],o=c.next;continue}if((v.f&ie)!==0&&Sr(v),v!==o){if(l!==void 0&&l.has(v)){if(u.length<d.length){var x=d[0],y;c=x.prev;var ee=u[0],V=u[u.length-1];for(y=0;y<u.length;y+=1)Et(u[y],x,r);for(y=0;y<d.length;y+=1)l.delete(d[y]);Ke(e,ee.prev,V.next),Ke(e,c,ee),Ke(e,V,x),o=x,c=V,b-=1,u=[],d=[]}else l.delete(v),Et(v,o,r),Ke(e,v.prev,v.next),Ke(e,v,c===null?e.effect.first:c.next),Ke(e,c,v),c=v;continue}for(u=[],d=[];o!==null&&o!==v;)(l??=new Set).add(o),d.push(o),o=o.next;if(o===null)continue}(v.f&je)===0&&u.push(v),c=v,o=v.next}if(e.outrogroups!==null){for(const I of e.outrogroups)I.pending.size===0&&(Ar(Mt(I.done)),e.outrogroups?.delete(I));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var Z=[];if(l!==void 0)for(v of l)(v.f&ie)===0&&Z.push(v);for(;o!==null;)(o.f&ie)===0&&o!==e.fallback&&Z.push(o),o=o.next;var Oe=Z.length;if(Oe>0){var ke=null;vi(e,Z,ke)}}}function mi(e,t,r,n,i,s,a,o){var l=(a&cs)!==0?(a&us)===0?pn(r,!1,!1):Qe(r):null,c=(a&fs)!==0?Qe(i):null;return{v:l,i:c,e:de(()=>(s(t,l??r,c??i,o),()=>{e.delete(n)}))}}function Et(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,s=t&&(t.f&je)===0?t.nodes.start:r;n!==null;){var a=ye(n);if(s.before(n),n===i)return;n=a}}function Ke(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Gn(e,t){En(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i)}})}const Jn=[...`
3
+ \r\f \v\uFEFF`];function _i(e,t,r){var n=e==null?"":""+e;if(r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||Jn.includes(n[a-1]))&&(o===n.length||Jn.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function Xn(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var s=e[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function zr(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function bi(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(zr)),i&&l.push(...Object.keys(i).map(zr));var c=0,u=-1;const b=e.length;for(var d=0;d<b;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===b-1){if(u!==-1){var g=zr(e.substring(c,u).trim());if(!l.includes(g)){h!==";"&&d++;var v=e.substring(c,d).trim();r+=" "+v+";"}}c=d+1,u=-1}}}}return n&&(r+=Xn(n)),i&&(r+=Xn(i,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function gt(e,t,r,n,i,s){var a=e.__className;if(k||a!==r||a===void 0){var o=_i(r,n,s);(!k||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function Tr(e,t={},r,n){for(var i in r){var s=r[i];t[i]!==s&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,s,n))}}function Rr(e,t,r,n){var i=e.__style;if(k||i!==t){var s=bi(t,n);(!k||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else n&&(Array.isArray(n)?(Tr(e,r?.[0],n[0]),Tr(e,r?.[1],n[1],"important")):Tr(e,r,n));return n}const wi=Symbol("is custom element"),yi=Symbol("is html");function Jt(e,t,r,n){var i=xi(e);k&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[$s]=r),r==null?e.removeAttribute(t):typeof r!="string"&&$i(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function xi(e){return e.__attributes??={[wi]:e.nodeName.includes("-"),[yi]:e.namespaceURI===vs}}var Qn=new Map;function $i(e){var t=e.getAttribute("is")||e.nodeName,r=Qn.get(t);if(r)return r;Qn.set(t,r=[]);for(var n,i=e,s=Element.prototype;s!==i;){n=gs(i);for(var a in n)n[a].set&&r.push(a);i=Gr(i)}return r}function es(e,t){return e===t||e?.[Nt]===t}function Mr(e={},t,r,n){return En(()=>{var i,s;return xr(()=>{i=s,s=[],kr(()=>{e!==r(...s)&&(t(e,...s),i&&es(r(...i),e)&&t(null,...i))})}),()=>{jt(()=>{s&&es(r(...s),e)&&t(null,...s)})}}),e}function Y(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var c=!1,u=Vt(()=>(c=!1,l())),d=E;return(function(h,g){if(arguments.length>0){const v=g?f(u):h;return m(u,v),c=!0,i!==void 0&&(i=v),h}return rt&&c||(d.f&Re)!==0?u.v:f(u)})}function Si(e){return new ki(e)}class ki{#t;#e;constructor(t){var r=new Map,n=(s,a)=>{var o=pn(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return f(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===xs?!0:(f(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#e=(t.hydrate?ui:Wn)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&H(),this.#t=i.$$events;for(const s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||Lt(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(i,s)},this.#e.$destroy=()=>{di(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];const n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}}let ts;typeof HTMLElement=="function"&&(ts=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),D(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Ei(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Xt(i,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=Si({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Qs(()=>{xr(()=>{this.$$r=!0;for(const n of It(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Xt(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Xt(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return It(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Xt(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ei(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function rs(e,t,r,n,i,s){let a=class extends ts{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return It(t).map(o=>(t[o].attribute||o).toLowerCase())}};return It(t).forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Xt(o,l,t),this.$$d[o]=l;var c=this.$$c;if(c){var u=lt(c,o)?.get;u?c[o]=l:c.$set({[o]:l})}}})}),n.forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Ci=50,Ct=5;class ns{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>Ci&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,i=n.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&n.createMediaStreamSource(new MediaStream([s])).connect(i),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const c=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of c)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,i=n._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=n._originalMicStream;if(s)for(const o of s.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(s=>{r.onloadedmetadata=s});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const i=n.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(r,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{n.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=Ct)return console.warn(`[SDK] Maximum ${Ct} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),i={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(i),i}async addBlobAttachment(t,r){if(this.attachments.length>=Ct)return console.warn(`[SDK] Maximum ${Ct} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:i};return this.attachments.push(s),s}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<Ct}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Ir=null;function Lr(){return Ir||(Ir=new ns),Ir}var Ai=N('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),zi=N('<span class="unread-badge svelte-1105cax"> </span>'),Ti=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Ri=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Mi=N('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Ii=N('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Li=N('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write"></iframe></div></div>');const Di={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
4
+ 0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
5
+ "Helvetica Neue", Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s,
6
+ opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
4
7
  animation: svelte-1105cax-spin 0.8s linear infinite;}
5
8
 
6
9
  @keyframes svelte-1105cax-spin {
7
10
  to {
8
11
  transform: rotate(360deg);
9
12
  }
10
- }`};function Tn(e,t){Gt(t,!0),xn(e,di);let r=we(t,"embedId"),n=we(t,"embedUrl",7,"https://app.fortalece.ai"),i=we(t,"position",7,"bottom-right"),s=D(!1),a=D(!1),o=D(0),l=D(void 0);const c=Oe(()=>`${n()}/embed/${r()}`),u=Oe(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");yn(()=>{function y($){try{const Te=new URL(n()).origin;if($.origin!==Te)return}catch{return}const{type:ae,payload:H}=$.data||{};switch(ae){case"fortalece:ready":w(a,!0);break;case"fortalece:close-request":w(s,!1);break;case"fortalece:resize":break;case"fortalece:unread":w(o,H?.count||0,!0);break}}return window.addEventListener("message",y),()=>window.removeEventListener("message",y)});function d(){w(s,!f(s)),f(s)&&w(o,0)}function h(y,$={}){if(f(l)?.contentWindow)try{const ae=new URL(n()).origin;f(l).contentWindow.postMessage({type:y,payload:$},ae)}catch{}}rr(()=>{f(s)&&f(a)&&h("fortalece:opened")});var g={get embedId(){return r()},set embedId(y){r(y),ve()},get embedUrl(){return n()},set embedUrl(y="https://app.fortalece.ai"){n(y),ve()},get position(){return i()},set position(y="bottom-right"){i(y),ve()}},v=ui(),b=R(v);b.__click=d;var _=R(b);{var z=y=>{var $=ai(),ae=R($,!0);T($),se(()=>Ge(ae,f(o)>9?"9+":f(o))),I(y,$)};B(_,y=>{f(o)>0&&!f(s)&&y(z)})}var M=L(_,2);{var q=y=>{var $=oi();I(y,$)},ye=y=>{var $=li();I(y,$)};B(M,y=>{f(s)?y(q):y(ye,!1)})}T(b);var K=L(b,2);{var J=y=>{var $=fi(),ae=R($);{var H=Je=>{var hr=ci();I(Je,hr)};B(ae,Je=>{f(a)||Je(H)})}var Te=L(ae,2);let _t;fr(Te,Je=>w(l,Je),()=>f(l)),T($),se(()=>{Ft(Te,"src",f(c)),_t=gt(Te,1,"svelte-1105cax",null,_t,{hidden:!f(a)})}),I(y,$)};B(K,y=>{f(s)&&y(J)})}return T(v),se(()=>{En(v,f(u)),Ft(b,"aria-label",f(s)?"Close chat":"Open chat")}),I(e,v),Jt(g)}gn(["click"]),customElements.define("support-chat",An(Tn,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0}},[],[],!0));const hi=50,mt=5;class Rn{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>hi&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,i=n.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&n.createMediaStreamSource(new MediaStream([s])).connect(i),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const c=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of c)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,i=n._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=n._originalMicStream;if(s)for(const o of s.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(s=>{r.onloadedmetadata=s});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const i=n.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(r,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{n.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=mt)return console.warn(`[SDK] Maximum ${mt} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),i={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(i),i}async addBlobAttachment(t,r){if(this.attachments.length>=mt)return console.warn(`[SDK] Maximum ${mt} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:i};return this.attachments.push(s),s}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<mt}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let ur=null;function Mn(){return ur||(ur=new Rn),ur}var vi=N('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),pi=N('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),gi=N('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),mi=N('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),_i=N('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),bi=N('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),wi=N('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),yi=Pt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),$i=Pt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),xi=N('<button class="toggle-btn svelte-p7nz7"><!></button>'),Si=N('<span class="badge svelte-p7nz7"> </span>'),Ei=N('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),ki=N('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),zi=N('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write"></iframe></div>'),Ci=N('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const Ai={hash:"svelte-p7nz7",code:`
13
+ }
14
+
15
+ /* Recording Button */.recording-btn.svelte-1105cax {position:absolute;bottom:0;right:0;display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1rem;background:#ef4444;color:white;border:none;border-radius:2rem;cursor:pointer;box-shadow:var(--shadow),
16
+ 0 0 20px rgba(239, 68, 68, 0.4);font-size:0.875rem;font-weight:600;transition:transform 0.15s,
17
+ box-shadow 0.15s;
18
+ animation: svelte-1105cax-pulse-glow 2s ease-in-out infinite;}.recording-btn.svelte-1105cax:hover {transform:scale(1.02);box-shadow:var(--shadow),
19
+ 0 0 30px rgba(239, 68, 68, 0.5);}.recording-dot.svelte-1105cax {width:0.5rem;height:0.5rem;background:white;border-radius:50%;
20
+ animation: svelte-1105cax-blink 1s infinite;}.recording-time.svelte-1105cax {font-family:"SF Mono", Monaco, "Inconsolata", "Fira Mono", monospace;font-size:0.75rem;}.stop-label.svelte-1105cax {padding-left:0.25rem;border-left:1px solid rgba(255, 255, 255, 0.3);}
21
+
22
+ @keyframes svelte-1105cax-blink {
23
+ 0%,
24
+ 50% {
25
+ opacity: 1;
26
+ }
27
+ 51%,
28
+ 100% {
29
+ opacity: 0.3;
30
+ }
31
+ }
32
+
33
+ @keyframes svelte-1105cax-pulse-glow {
34
+ 0%,
35
+ 100% {
36
+ box-shadow:
37
+ var(--shadow),
38
+ 0 0 20px rgba(239, 68, 68, 0.4);
39
+ }
40
+ 50% {
41
+ box-shadow:
42
+ var(--shadow),
43
+ 0 0 30px rgba(239, 68, 68, 0.6);
44
+ }
45
+ }`};function ss(e,t){gr(t,!0),Gn(e,Di);let r=Y(t,"embedId"),n=Y(t,"embedUrl",7,"https://app.fortalece.ai"),i=Y(t,"position",7,"bottom-right"),s=Y(t,"showHeader",7,"true"),a=Y(t,"allowAttachments",7,!0),o=Y(t,"allowScreenRecording",7,!0),l=Y(t,"captureConsoleLogs",7,!0),c=z(!1),u=z(!1),d=z(0),h=z(!1),g=z(null),v=z("00:00"),b=z(void 0),C=z(null),x=z(Le([])),y=z(Le([]));Wt(()=>{if(f(h)&&f(g)!==null){const w=setInterval(()=>{const T=Math.floor((Date.now()-f(g))/1e3),ce=Math.floor(T/60).toString().padStart(2,"0"),Ee=(T%60).toString().padStart(2,"0");m(v,`${ce}:${Ee}`)},1e3);return()=>clearInterval(w)}});const ee=be(()=>s()==="false"||s()===!1),V=be(()=>!f(c)||f(ee)||!f(u)),Z=be(()=>`${n()}/embed/${r()}${f(ee)?"?showHeader=false":""}`),Oe=be(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");Yn(()=>{m(C,Lr(),!0),l()&&f(C).startConsoleCapture();function w(T){try{const it=new URL(n()).origin;if(T.origin!==it)return}catch{return}const{type:ce,payload:Ee}=T.data||{};switch(ce){case"fortalece:ready":m(u,!0);break;case"fortalece:close-request":m(c,!1);break;case"fortalece:request-context":mt();break;case"fortalece:request-attachments":At();break;case"fortalece:clear-attachments":pe();break;case"fortalece:resize":break;case"fortalece:unread":m(d,Ee?.count||0,!0);break;case"fortalece:recording-started":m(h,!0),m(g,Date.now(),!0),m(v,"00:00"),m(c,!1);break;case"fortalece:recording-stopped":m(h,!1),m(g,null),m(v,"00:00"),m(c,!0);break}}return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),l()&&f(C)&&f(C).stopConsoleCapture()}});function ke(){m(c,!f(c)),f(c)&&m(d,0)}function I(){ve("fortalece:stop-recording"),m(h,!1),m(g,null),m(v,"00:00")}function ve(w,T={}){if(f(b)?.contentWindow)try{const ce=new URL(n()).origin;f(b).contentWindow.postMessage({type:w,payload:T},ce)}catch{}}function mt(){if(!f(C))return;const w=f(C).getPageContext();if(ve("fortalece:page-context",w),l()){const T=f(C).getConsoleErrors();m(y,T,!0),ve("fortalece:console-logs",{logs:T})}ve("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:f(x).length,maxAttachments:5})}function At(){f(x).forEach(w=>{ve("fortalece:attachment-added",w)})}function pe(){f(C)&&(f(C).clearAttachments(),f(C).clearConsoleErrors(),m(x,[],!0),m(y,[],!0),ve("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Wt(()=>{f(c)&&f(u)&&(ve("fortalece:opened"),mt(),At())});var zt={get embedId(){return r()},set embedId(w){r(w),H()},get embedUrl(){return n()},set embedUrl(w="https://app.fortalece.ai"){n(w),H()},get position(){return i()},set position(w="bottom-right"){i(w),H()},get showHeader(){return s()},set showHeader(w="true"){s(w),H()},get allowAttachments(){return a()},set allowAttachments(w=!0){a(w),H()},get allowScreenRecording(){return o()},set allowScreenRecording(w=!0){o(w),H()},get captureConsoleLogs(){return l()},set captureConsoleLogs(w=!0){l(w),H()}},st=Li(),_t=M(st);{var Or=w=>{var T=Ai();T.__click=I;var ce=O(M(T),2),Ee=M(ce,!0);R(ce),pr(2),R(T),X(()=>We(Ee,f(v))),D(w,T)},Nr=w=>{var T=li(),ce=yn(T);{var Ee=it=>{var Ye=Mi();Ye.__click=ke;var sr=M(Ye);{var ir=te=>{var Ne=zi(),jr=M(Ne,!0);R(Ne),X(()=>We(jr,f(d)>9?"9+":f(d))),D(te,Ne)};F(sr,te=>{f(d)>0&&!f(c)&&te(ir)})}var Fr=O(sr,2);{var ar=te=>{var Ne=Ti();D(te,Ne)},Ur=te=>{var Ne=Ri();D(te,Ne)};F(Fr,te=>{f(c)?te(ar):te(Ur,!1)})}R(Ye),X(()=>Jt(Ye,"aria-label",f(c)?"Close chat":"Open chat")),D(it,Ye)};F(ce,it=>{f(V)&&it(Ee)},!0)}D(w,T)};F(_t,w=>{f(h)?w(Or):w(Nr,!1)})}var bt=O(_t,2);let er,tr;var rr=M(bt);{var Pr=w=>{var T=Ii();D(w,T)};F(rr,w=>{f(u)||w(Pr)})}var Tt=O(rr,2);let nr;return Mr(Tt,w=>m(b,w),()=>f(b)),R(bt),R(st),X(()=>{Rr(st,f(Oe)),er=gt(bt,1,"chat-window svelte-1105cax",null,er,{"chat-window-hidden":!f(c)}),tr=Rr(bt,"",tr,{bottom:f(V)?"4.5rem":"0"}),Jt(Tt,"src",f(Z)),nr=gt(Tt,1,"svelte-1105cax",null,nr,{hidden:!f(u)})}),D(e,st),mr(zt)}Hn(["click"]),customElements.define("support-chat",rs(ss,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));var Oi=N('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),Ni=N('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),Pi=N('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),Fi=N('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Ui=N('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),ji=N('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Bi=N('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Hi=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),qi=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Vi=N('<button class="toggle-btn svelte-p7nz7"><!></button>'),Wi=N('<span class="badge svelte-p7nz7"> </span>'),Ki=N('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),Yi=N('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),Zi=N('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write"></iframe></div>'),Gi=N('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const Ji={hash:"svelte-p7nz7",code:`
11
46
  /* Host element styling for inline mode */:host {display:block;}:host([display="inline"]) {display:block;width:100%;height:100%;}.svelte-p7nz7 {box-sizing:border-box;margin:0;padding:0;}.feedback-panel.svelte-p7nz7 {--primary-color: #6366f1;--danger-color: #ef4444;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;}
12
47
 
13
48
  /* Inline mode - fills container instead of fixed positioning */.feedback-panel.inline.svelte-p7nz7 {position:relative;bottom:auto;left:auto;right:auto;width:100%;height:100%;z-index:auto;}
@@ -45,4 +80,4 @@ var FortaleceAI=(function(ee){"use strict";typeof window<"u"&&((window.__svelte?
45
80
  to {
46
81
  transform: rotate(360deg);
47
82
  }
48
- }`};function In(e,t){Gt(t,!0),xn(e,Ai);let r=we(t,"embedId"),n=we(t,"embedUrl",7,"https://app.fortalece.ai"),i=we(t,"position",7,"bottom-right"),s=we(t,"display",7,"floating"),a=we(t,"allowAttachments",7,!0),o=we(t,"allowScreenRecording",7,!0),l=we(t,"captureConsoleLogs",7,!0);const c=Oe(()=>s()==="inline");let u=D(!1),d=D(!1);const h=Oe(()=>f(c)?!0:f(u));let g=D(!1),v=D(void 0),b=D(void 0),_=D(null),z=D(Ve([])),M=D(Ve([])),q=D(!1);const ye=Oe(()=>`${n()}/embed/${r()}`),K=Oe(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;"),J=Oe(()=>f(z).length<5),y=Oe(()=>a()||o());yn(()=>{w(_,Mn(),!0),l()&&f(_).startConsoleCapture();function p(m){try{const X=new URL(n()).origin;if(m.origin!==X)return}catch{return}const{type:C}=m.data||{};switch(C){case"fortalece:ready":w(d,!0),Te();break;case"fortalece:close-request":w(u,!1);break;case"fortalece:request-context":Te();break;case"fortalece:request-attachments":_t();break;case"fortalece:submit-start":break;case"fortalece:submit-complete":m.data.payload?.success&&(Ui(),f(c)||w(u,!1));break}}return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),l()&&f(_)&&f(_).stopConsoleCapture()}});function $(){w(u,!f(u)),f(u)&&w(q,!1)}function ae(){w(q,!f(q))}function H(p,m={}){if(f(v)?.contentWindow)try{const C=new URL(n()).origin;f(v).contentWindow.postMessage({type:p,payload:m},C)}catch{}}function Te(){if(!f(_))return;const p=f(_).getPageContext();H("fortalece:page-context",p),l()&&(w(M,f(_).getConsoleErrors(),!0),H("fortalece:console-logs",{logs:f(M)})),H("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:f(z).length,maxAttachments:5})}function _t(){f(z).forEach(p=>{H("fortalece:attachment-added",p)})}rr(()=>{f(h)&&f(d)&&(H("fortalece:opened"),Te(),_t())});function Je(){f(b)?.click()}async function hr(p){const m=p.target;if(!(!m.files||!f(_))){for(const C of Array.from(m.files)){if(!f(J))break;const X=await f(_).addAttachment(C);X&&(w(z,[...f(z),X],!0),H("fortalece:attachment-added",X))}m.value=""}}function Oi(p){f(_)&&(f(_).removeAttachment(p),w(z,f(z).filter(m=>m.id!==p),!0),H("fortalece:attachment-removed",{id:p}))}async function Ni(){if(!(!f(_)||f(g)))try{await f(_).startScreenRecording(),w(g,!0),w(q,!1)}catch(p){console.error("[SDK] Failed to start recording:",p)}}async function Pi(){if(!f(_)||!f(g))return;w(g,!1);const p=await f(_).stopScreenRecording();if(p&&f(J)){const m=`recording-${Date.now()}.webm`,C=await f(_).addBlobAttachment(p,m);C&&(w(z,[...f(z),C],!0),H("fortalece:attachment-added",C),H("fortalece:recording-complete",{dataUrl:C.dataUrl,size:C.size}))}}async function Fi(){if(!f(_)||!f(J))return;w(q,!1),await new Promise(m=>setTimeout(m,100));const p=await f(_).captureScreenshot();if(p){const m=`screenshot-${Date.now()}.png`,C=await f(_).addBlobAttachment(p,m);C&&(w(z,[...f(z),C],!0),H("fortalece:attachment-added",C))}}function Ui(){f(_)&&(f(_).clearAttachments(),f(_).clearConsoleErrors(),w(z,[],!0),w(M,[],!0))}function ji(p){return p<1024?`${p} B`:p<1048576?`${(p/1024).toFixed(1)} KB`:`${(p/1048576).toFixed(1)} MB`}function Bi(p){switch(p){case"video":return"🎬";case"audio":return"🎵";case"image":default:return"🖼️"}}var qi={get embedId(){return r()},set embedId(p){r(p),ve()},get embedUrl(){return n()},set embedUrl(p="https://app.fortalece.ai"){n(p),ve()},get position(){return i()},set position(p="bottom-right"){i(p),ve()},get display(){return s()},set display(p="floating"){s(p),ve()},get allowAttachments(){return a()},set allowAttachments(p=!0){a(p),ve()},get allowScreenRecording(){return o()},set allowScreenRecording(p=!0){o(p),ve()},get captureConsoleLogs(){return l()},set captureConsoleLogs(p=!0){l(p),ve()}},bt=Ci();let Ln;var On=R(bt);{var Hi=p=>{var m=vi(),C=L(R(m),4);C.__click=Pi,T(m),I(p,m)};B(On,p=>{f(g)&&!f(c)&&p(Hi)})}var Nn=L(On,2);{var Vi=p=>{var m=wi(),C=R(m),X=L(R(C),2);X.__click=ae,T(C);var Re=L(C,2),P=R(Re);{var ue=Y=>{var Q=pi();Q.__click=Je,se(()=>Q.disabled=!f(J)),I(Y,Q)};B(P,Y=>{a()&&Y(ue)})}var Me=L(P,2);{var pr=Y=>{var Q=gi(),$e=As(Q);$e.__click=Fi;var Xe=L($e,2);Xe.__click=Ni,se(()=>{$e.disabled=!f(J),Xe.disabled=!f(J)}),I(Y,Q)};B(Me,Y=>{o()&&Y(pr)})}T(Re);var Un=L(Re,2);{var Gi=Y=>{var Q=_i(),$e=R(Q),Xe=R($e),Qi=R(Xe);T(Xe),T($e);var ea=L($e,2);Ys(ea,17,()=>f(z),gr=>gr.id,(gr,Bt)=>{var mr=mi(),_r=R(mr),ta=R(_r,!0);T(_r);var br=L(_r,2),wr=R(br),ra=R(wr,!0);T(wr);var jn=L(wr,2),na=R(jn,!0);T(jn),T(br);var sa=L(br,2);sa.__click=()=>Oi(f(Bt).id),T(mr),se((ia,aa)=>{Ge(ta,ia),Ge(ra,f(Bt).name),Ge(na,aa)},[()=>Bi(f(Bt).type),()=>ji(f(Bt).size)]),I(gr,mr)}),T(Q),se(()=>Ge(Qi,`Attachments (${f(z).length??""}/5)`)),I(Y,Q)};B(Un,Y=>{f(z).length>0&&Y(Gi)})}var Ji=L(Un,2);{var Xi=Y=>{var Q=bi(),$e=L(R(Q),2),Xe=R($e);T($e),T(Q),se(()=>Ge(Xe,`${f(M).length??""} console error(s) captured`)),I(Y,Q)};B(Ji,Y=>{l()&&f(M).length>0&&Y(Xi)})}T(m),I(p,m)};B(Nn,p=>{f(q)&&!f(g)&&f(y)&&!f(c)&&p(Vi)})}var Pn=L(Nn,2);{var Wi=p=>{var m=xi();m.__click=$;var C=R(m);{var X=P=>{var ue=yi();I(P,ue)},Re=P=>{var ue=$i();I(P,ue)};B(C,P=>{f(h)?P(X):P(Re,!1)})}T(m),se(()=>Ft(m,"aria-label",f(h)?"Close feedback":"Send feedback")),I(p,m)};B(Pn,p=>{f(c)||p(Wi)})}var Fn=L(Pn,2);{var Ki=p=>{var m=Ei();let C;m.__click=ae;var X=R(m);{var Re=P=>{var ue=Si(),Me=R(ue,!0);T(ue),se(()=>Ge(Me,f(z).length)),I(P,ue)};B(X,P=>{f(z).length>0&&P(Re)})}Cr(2),T(m),se(()=>C=gt(m,1,"capture-toggle-btn svelte-p7nz7",null,C,{"has-items":f(z).length>0})),I(p,m)};B(Fn,p=>{!f(c)&&f(h)&&f(y)&&!f(g)&&p(Ki)})}var vr=L(Fn,2);vr.__change=hr,fr(vr,p=>w(b,p),()=>f(b));var Yi=L(vr,2);{var Zi=p=>{var m=zi();let C;var X=R(m);{var Re=Me=>{var pr=ki();I(Me,pr)};B(X,Me=>{f(d)||Me(Re)})}var P=L(X,2);let ue;fr(P,Me=>w(v,Me),()=>f(v)),T(m),se(()=>{C=gt(m,1,"panel-window svelte-p7nz7",null,C,{inline:f(c)}),Ft(P,"src",f(ye)),ue=gt(P,1,"svelte-p7nz7",null,ue,{hidden:!f(d)})}),I(p,m)};B(Yi,p=>{f(h)&&p(Zi)})}return T(bt),se(()=>{Ln=gt(bt,1,"feedback-panel svelte-p7nz7",null,Ln,{inline:f(c)}),En(bt,f(c)?"":f(K))}),I(e,bt),Jt(qi)}gn(["click","change"]),customElements.define("feedback-panel",An(In,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},display:{attribute:"display",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));const jt="https://api.fortalece.ai";function dr(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Dn(e){const t={"Content-Type":"application/json"};return e.apiKey&&(t.Authorization=`Bearer ${e.apiKey}`),e.projectId&&(t["X-Project-ID"]=e.projectId),t}async function Ti(e,t,r){const n=e.apiUrl||jt,i={projectId:e.projectId,message:t,conversationId:r};try{const s=await fetch(`${n}/api/chat/message`,{method:"POST",headers:Dn(e),body:JSON.stringify(i)});if(!s.ok)return{success:!1,error:(await s.json().catch(()=>({}))).error||`Request failed with status ${s.status}`};const a=await s.json();return{success:!0,message:{id:a.id||dr(),role:"assistant",content:a.message||a.content||"",timestamp:new Date(a.timestamp||Date.now()),metadata:a.metadata},conversationId:a.conversationId}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error occurred"}}}function Ri(e){return{id:dr(),role:"user",content:e,timestamp:new Date}}function Mi(e){return{id:dr(),role:"system",content:e,timestamp:new Date}}async function Ii(e,t){const r=e.apiUrl||jt,n={...t,projectId:e.projectId};try{const i=await fetch(`${r}/api/feedback`,{method:"POST",headers:Dn(e),body:JSON.stringify(n)});if(!i.ok)return{success:!1,error:(await i.json().catch(()=>({}))).error||`Request failed with status ${i.status}`};const s=await i.json();return{success:!0,feedbackId:s.feedbackId||s.id}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}function Di(e,t){return{projectId:e,apiUrl:t?.apiUrl||jt,apiKey:t?.apiKey}}const Li="0.2.0";return ee.ContextCaptureService=Rn,ee.DEFAULT_API_URL=jt,ee.FeedbackPanel=In,ee.SupportChat=Tn,ee.VERSION=Li,ee.createApiConfig=Di,ee.createSystemMessage=Mi,ee.createUserMessage=Ri,ee.getContextCaptureService=Mn,ee.sendMessage=Ti,ee.submitFeedback=Ii,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}),ee})({});
83
+ }`};function is(e,t){gr(t,!0),Gn(e,Ji);let r=Y(t,"embedId"),n=Y(t,"embedUrl",7,"https://app.fortalece.ai"),i=Y(t,"position",7,"bottom-right"),s=Y(t,"display",7,"floating"),a=Y(t,"allowAttachments",7,!0),o=Y(t,"allowScreenRecording",7,!0),l=Y(t,"captureConsoleLogs",7,!0),c=Y(t,"showHeader",7,"true");const u=be(()=>s()==="inline");let d=z(!1),h=z(!1);const g=be(()=>f(u)?!0:f(d));let v=z(!1),b=z(void 0),C=z(void 0),x=z(null),y=z(Le([])),ee=z(Le([])),V=z(!1);const Z=be(()=>c()==="false"||c()===!1),Oe=be(()=>`${n()}/embed/${r()}?type=feedback-panel${f(Z)?"&showHeader=false":""}`),ke=be(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;"),I=be(()=>f(y).length<5),ve=be(()=>a()||o());Yn(()=>{m(x,Lr(),!0),l()&&f(x).startConsoleCapture();function p(_){try{const re=new URL(n()).origin;if(_.origin!==re)return}catch{return}const{type:A}=_.data||{};switch(A){case"fortalece:ready":m(h,!0),zt();break;case"fortalece:close-request":m(d,!1);break;case"fortalece:request-context":zt();break;case"fortalece:request-attachments":st();break;case"fortalece:submit-start":break;case"fortalece:submit-complete":_.data.payload?.success&&(Pr(),f(u)||m(d,!1));break}}return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),l()&&f(x)&&f(x).stopConsoleCapture()}});function mt(){m(d,!f(d)),f(d)&&m(V,!1)}function At(){m(V,!f(V))}function pe(p,_={}){if(f(b)?.contentWindow)try{const A=new URL(n()).origin;f(b).contentWindow.postMessage({type:p,payload:_},A)}catch{}}function zt(){if(!f(x))return;const p=f(x).getPageContext();if(pe("fortalece:page-context",p),l()){const _=f(x).getConsoleErrors();pe("fortalece:console-logs",{logs:_})}pe("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:f(y).length,maxAttachments:5})}function st(){f(y).forEach(p=>{pe("fortalece:attachment-added",p)})}let _t=!1;Wt(()=>{const p=f(g)&&f(h);p&&!_t?(_t=!0,pe("fortalece:opened"),zt(),st()):p||(_t=!1)});function Or(){f(C)?.click()}async function Nr(p){const _=p.target;if(!(!_.files||!f(x))){for(const A of Array.from(_.files)){if(!f(I))break;const re=await f(x).addAttachment(A);re&&(m(y,[...f(y),re],!0),pe("fortalece:attachment-added",re))}_.value=""}}function bt(p){f(x)&&(f(x).removeAttachment(p),m(y,f(y).filter(_=>_.id!==p),!0),pe("fortalece:attachment-removed",{id:p}))}async function er(){if(!(!f(x)||f(v)))try{await f(x).startScreenRecording(),m(v,!0),m(V,!1)}catch(p){console.error("[SDK] Failed to start recording:",p)}}async function tr(){if(!f(x)||!f(v))return;m(v,!1);const p=await f(x).stopScreenRecording();if(p&&f(I)){const _=`recording-${Date.now()}.webm`,A=await f(x).addBlobAttachment(p,_);A&&(m(y,[...f(y),A],!0),pe("fortalece:attachment-added",A),pe("fortalece:recording-complete",{dataUrl:A.dataUrl,size:A.size}))}}async function rr(){if(!f(x)||!f(I))return;m(V,!1),await new Promise(_=>setTimeout(_,100));const p=await f(x).captureScreenshot();if(p){const _=`screenshot-${Date.now()}.png`,A=await f(x).addBlobAttachment(p,_);A&&(m(y,[...f(y),A],!0),pe("fortalece:attachment-added",A))}}function Pr(){f(x)&&(f(x).clearAttachments(),f(x).clearConsoleErrors(),m(y,[],!0),m(ee,[],!0))}function Tt(p){return p<1024?`${p} B`:p<1048576?`${(p/1024).toFixed(1)} KB`:`${(p/1048576).toFixed(1)} MB`}function nr(p){switch(p){case"video":return"🎬";case"audio":return"🎵";case"image":default:return"🖼️"}}var w={get embedId(){return r()},set embedId(p){r(p),H()},get embedUrl(){return n()},set embedUrl(p="https://app.fortalece.ai"){n(p),H()},get position(){return i()},set position(p="bottom-right"){i(p),H()},get display(){return s()},set display(p="floating"){s(p),H()},get allowAttachments(){return a()},set allowAttachments(p=!0){a(p),H()},get allowScreenRecording(){return o()},set allowScreenRecording(p=!0){o(p),H()},get captureConsoleLogs(){return l()},set captureConsoleLogs(p=!0){l(p),H()},get showHeader(){return c()},set showHeader(p="true"){c(p),H()}},T=Gi();let ce;var Ee=M(T);{var it=p=>{var _=Oi(),A=O(M(_),4);A.__click=tr,R(_),D(p,_)};F(Ee,p=>{f(v)&&!f(u)&&p(it)})}var Ye=O(Ee,2);{var sr=p=>{var _=Bi(),A=M(_),re=O(M(A),2);re.__click=At,R(A);var Pe=O(A,2),U=M(Pe);{var ge=G=>{var ne=Ni();ne.__click=Or,X(()=>ne.disabled=!f(I)),D(G,ne)};F(U,G=>{a()&&G(ge)})}var Fe=O(U,2);{var Br=G=>{var ne=Pi(),Ce=yn(ne);Ce.__click=rr;var at=O(Ce,2);at.__click=er,X(()=>{Ce.disabled=!f(I),at.disabled=!f(I)}),D(G,ne)};F(Fe,G=>{o()&&G(Br)})}R(Pe);var os=O(Pe,2);{var sa=G=>{var ne=Ui(),Ce=M(ne),at=M(Ce),oa=M(at);R(at),R(Ce);var la=O(Ce,2);pi(la,17,()=>f(y),Hr=>Hr.id,(Hr,or)=>{var qr=Fi(),Vr=M(qr),ca=M(Vr,!0);R(Vr);var Wr=O(Vr,2),Kr=M(Wr),fa=M(Kr,!0);R(Kr);var ls=O(Kr,2),ua=M(ls,!0);R(ls),R(Wr);var da=O(Wr,2);da.__click=()=>bt(f(or).id),R(qr),X((ha,va)=>{We(ca,ha),We(fa,f(or).name),We(ua,va)},[()=>nr(f(or).type),()=>Tt(f(or).size)]),D(Hr,qr)}),R(ne),X(()=>We(oa,`Attachments (${f(y).length??""}/5)`)),D(G,ne)};F(os,G=>{f(y).length>0&&G(sa)})}var ia=O(os,2);{var aa=G=>{var ne=ji(),Ce=O(M(ne),2),at=M(Ce);R(Ce),R(ne),X(()=>We(at,`${f(ee).length??""} console error(s) captured`)),D(G,ne)};F(ia,G=>{l()&&f(ee).length>0&&G(aa)})}R(_),D(p,_)};F(Ye,p=>{f(V)&&!f(v)&&f(ve)&&!f(u)&&p(sr)})}var ir=O(Ye,2);{var Fr=p=>{var _=Vi();_.__click=mt;var A=M(_);{var re=U=>{var ge=Hi();D(U,ge)},Pe=U=>{var ge=qi();D(U,ge)};F(A,U=>{f(g)?U(re):U(Pe,!1)})}R(_),X(()=>Jt(_,"aria-label",f(g)?"Close feedback":"Send feedback")),D(p,_)};F(ir,p=>{f(u)||p(Fr)})}var ar=O(ir,2);{var Ur=p=>{var _=Ki();let A;_.__click=At;var re=M(_);{var Pe=U=>{var ge=Wi(),Fe=M(ge,!0);R(ge),X(()=>We(Fe,f(y).length)),D(U,ge)};F(re,U=>{f(y).length>0&&U(Pe)})}pr(2),R(_),X(()=>A=gt(_,1,"capture-toggle-btn svelte-p7nz7",null,A,{"has-items":f(y).length>0})),D(p,_)};F(ar,p=>{!f(u)&&f(g)&&f(ve)&&!f(v)&&p(Ur)})}var te=O(ar,2);te.__change=Nr,Mr(te,p=>m(C,p),()=>f(C));var Ne=O(te,2);{var jr=p=>{var _=Zi();let A;var re=M(_);{var Pe=Fe=>{var Br=Yi();D(Fe,Br)};F(re,Fe=>{f(h)||Fe(Pe)})}var U=O(re,2);let ge;Mr(U,Fe=>m(b,Fe),()=>f(b)),R(_),X(()=>{A=gt(_,1,"panel-window svelte-p7nz7",null,A,{inline:f(u)}),Jt(U,"src",f(Oe)),ge=gt(U,1,"svelte-p7nz7",null,ge,{hidden:!f(h)})}),D(p,_)};F(Ne,p=>{f(g)&&p(jr)})}return R(T),X(()=>{ce=gt(T,1,"feedback-panel svelte-p7nz7",null,ce,{inline:f(u)}),Rr(T,f(u)?"":f(ke))}),D(e,T),mr(w)}Hn(["click","change"]),customElements.define("feedback-panel",rs(is,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},display:{attribute:"display",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"},showHeader:{attribute:"show-header",reflect:!0}},[],[],!0));const Qt="https://api.fortalece.ai";function Dr(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function as(e){const t={"Content-Type":"application/json"};return e.apiKey&&(t.Authorization=`Bearer ${e.apiKey}`),e.projectId&&(t["X-Project-ID"]=e.projectId),t}async function Xi(e,t,r){const n=e.apiUrl||Qt,i={projectId:e.projectId,message:t,conversationId:r};try{const s=await fetch(`${n}/api/chat/message`,{method:"POST",headers:as(e),body:JSON.stringify(i)});if(!s.ok)return{success:!1,error:(await s.json().catch(()=>({}))).error||`Request failed with status ${s.status}`};const a=await s.json();return{success:!0,message:{id:a.id||Dr(),role:"assistant",content:a.message||a.content||"",timestamp:new Date(a.timestamp||Date.now()),metadata:a.metadata},conversationId:a.conversationId}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error occurred"}}}function Qi(e){return{id:Dr(),role:"user",content:e,timestamp:new Date}}function ea(e){return{id:Dr(),role:"system",content:e,timestamp:new Date}}async function ta(e,t){const r=e.apiUrl||Qt,n={...t,projectId:e.projectId};try{const i=await fetch(`${r}/api/feedback`,{method:"POST",headers:as(e),body:JSON.stringify(n)});if(!i.ok)return{success:!1,error:(await i.json().catch(()=>({}))).error||`Request failed with status ${i.status}`};const s=await i.json();return{success:!0,feedbackId:s.feedbackId||s.id}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}function ra(e,t){return{projectId:e,apiUrl:t?.apiUrl||Qt,apiKey:t?.apiKey}}const na="0.2.0";return se.ContextCaptureService=ns,se.DEFAULT_API_URL=Qt,se.FeedbackPanel=is,se.SupportChat=ss,se.VERSION=na,se.createApiConfig=ra,se.createSystemMessage=ea,se.createUserMessage=Qi,se.getContextCaptureService=Lr,se.sendMessage=Xi,se.submitFeedback=ta,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}),se})({});