(function(ht,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],p):(ht=typeof globalThis<"u"?globalThis:ht||self,p(ht.IgniteSignalsWebComponents={},ht.Vue))})(this,function(ht,p){"use strict";function sm(e){return e}function lm(e){return e.length===0?sm:e.length===1?e[0]:function(t){return e.reduce((n,r)=>r(n),t)}}function ou(e){const t={subscribe(n){let r=null,o=!1,a=!1,i=!1;function s(){if(r===null){i=!0;return}a||(a=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var c;o||(c=n.next)==null||c.call(n,l)},error(l){var c;o||(o=!0,(c=n.error)==null||c.call(n,l),s())},complete(){var l;o||(o=!0,(l=n.complete)==null||l.call(n),s())}}),i&&s(),{unsubscribe:s}},pipe(...n){return lm(n)(t)}};return t}function cm(e){return t=>{let n=0,r=null;const o=[];function a(){r||(r=t.subscribe({next(s){var l;for(const c of o)(l=c.next)==null||l.call(c,s)},error(s){var l;for(const c of o)(l=c.error)==null||l.call(c,s)},complete(){var s;for(const l of o)(s=l.complete)==null||s.call(l)}}))}function i(){if(n===0&&r){const s=r;r=null,s.unsubscribe()}}return{subscribe(s){return n++,o.push(s),a(),{unsubscribe(){n--,i();const l=o.findIndex(c=>c===s);l>-1&&o.splice(l,1)}}}}}}let um=class im extends Error{constructor(t){super(t),this.name="ObservableAbortError",Object.setPrototypeOf(this,im.prototype)}};function dm(e){let t;return{promise:new Promise((n,r)=>{let o=!1;function a(){o||(o=!0,r(new um("This operation was aborted.")),i.unsubscribe())}const i=e.subscribe({next(s){o=!0,n(s),a()},error(s){o=!0,r(s),a()},complete(){o=!0,a()}});t=a}),abort:t}}function pm(e){return ou(t=>{function n(r=0,o=e.op){const a=e.links[r];if(!a)throw new Error("No more links to execute - did you forget to add an ending link?");return a({op:o,next(i){return n(r+1,i)}})}return n().subscribe(t)})}function au(e){const t=Object.create(null);for(const n in e){const r=e[n];t[r]=n}return t}const iu={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};au(iu),au(iu);const su=()=>{};function lu(e,t){return new Proxy(su,{get(n,r){if(!(typeof r!="string"||r==="then"))return lu(e,[...t,r])},apply(n,r,o){const a=t[t.length-1]==="apply";return e({args:a?o.length>=2?o[1]:[]:o,path:a?t.slice(0,-1):t})}})}const fm=e=>lu(e,[]),hm=e=>new Proxy(su,{get(t,n){if(!(typeof n!="string"||n==="then"))return e(n)}});function gm(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}let mm=class extends Error{};function vm(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(gm(e)){const n=new mm;for(const r in e)n[r]=e[r];return n}}}function Lo(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function bm(e,t){if("error"in e){const n=t.transformer.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.transformer.deserialize(e.result.data)}}}}let Ri=class extends Error{constructor(){super("Unable to transform response from server")}};function ym(e,t){let n;try{n=bm(e,t)}catch{throw new Ri}if(!n.ok&&(!Lo(n.error.error)||typeof n.error.error.code!="number"))throw new Ri;if(n.ok&&!Lo(n.result))throw new Ri;return n}function wm(e){return e instanceof kr||e instanceof Error&&e.name==="TRPCClientError"}function xm(e){return Lo(e)&&Lo(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}let kr=class Vo extends Error{static from(t,n={}){const r=t;return wm(r)?(n.meta&&(r.meta={...r.meta,...n.meta}),r):xm(r)?new Vo(r.error.message,{...n,result:r}):r instanceof Error?new Vo(r.message,{...n,cause:vm(r)}):new Vo("Unknown error",{...n,cause:r})}constructor(t,n){var r,o;const a=n==null?void 0:n.cause;super(t,{cause:a}),this.meta=n==null?void 0:n.meta,this.cause=a,this.shape=(r=n==null?void 0:n.result)==null?void 0:r.error,this.data=(o=n==null?void 0:n.result)==null?void 0:o.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Vo.prototype)}};const cu=e=>typeof e=="function";function $m(e){if(e)return e;if(typeof window<"u"&&cu(window.fetch))return window.fetch;if(typeof globalThis<"u"&&cu(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function _m(e){return e||(typeof window<"u"&&window.AbortController?window.AbortController:typeof globalThis<"u"&&globalThis.AbortController?globalThis.AbortController:null)}function km(e){return{url:e.url.toString().replace(/\/$/,""),fetch:e.fetch,AbortController:_m(e.AbortController)}}function Cm(e){const t={};for(let n=0;ne.runtime.transformer.serialize(t)))}const du=e=>{let t=e.url+"/"+e.path;const n=[];if("inputs"in e&&n.push("batch=1"),e.type==="query"){const r=uu(e);r!==void 0&&n.push(`input=${encodeURIComponent(JSON.stringify(r))}`)}return n.length&&(t+="?"+n.join("&")),t},Sm=e=>{if(e.type==="query")return;const t=uu(e);return t!==void 0?JSON.stringify(t):void 0},Em=e=>Tm({...e,contentTypeHeader:"application/json",getUrl:du,getBody:Sm});async function Dm(e,t){const n=e.getUrl(e),r=e.getBody(e),{type:o}=e,a=await e.headers();/* istanbul ignore if -- @preserve */if(o==="subscription")throw new Error("Subscriptions should use wsLink");const i={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.batchModeHeader?{"trpc-batch-mode":e.batchModeHeader}:{},...a};return $m(e.fetch)(n,{method:Mm[o],signal:t==null?void 0:t.signal,body:r,headers:i})}function Tm(e){const t=e.AbortController?new e.AbortController:null,n={};let r=!1;return{promise:new Promise((o,a)=>{Dm(e,t).then(i=>(n.response=i,r=!0,i.json())).then(i=>{n.responseJSON=i,o({json:i,meta:n})}).catch(i=>{r=!0,a(kr.from(i,{meta:n}))})}),cancel:()=>{r||t==null||t.abort()}}}const ji=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function zi(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function o(s){var l,c;const u=[[]];let d=0;for(;;){const f=s[d];if(!f)break;const h=u[u.length-1];if(f.aborted){(l=f.reject)==null||l.call(f,new Error("Aborted")),d++;continue}if(e.validate(h.concat(f).map(m=>m.key))){h.push(f),d++;continue}if(h.length===0){(c=f.reject)==null||c.call(f,new Error("Input is too big for a single dispatch")),d++;continue}u.push([])}return u}function a(){const s=o(t);r();for(const l of s){if(!l.length)continue;const c={items:l,cancel:ji};for(const h of l)h.batch=c;const u=(h,m)=>{var g;const v=c.items[h];(g=v.resolve)==null||g.call(v,m),v.batch=null,v.reject=null,v.resolve=null},{promise:d,cancel:f}=e.fetch(c.items.map(h=>h.key),u);c.cancel=f,d.then(h=>{var m;for(let g=0;g{var m;for(const g of c.items)(m=g.reject)==null||m.call(g,h),g.batch=null})}}function i(s){const l={aborted:!1,key:s,batch:null,resolve:ji,reject:ji},c=new Promise((u,d)=>{l.reject=d,l.resolve=u,t||(t=[]),t.push(l)});return n||(n=setTimeout(a)),{promise:c,cancel:()=>{var u;l.aborted=!0,(u=l.batch)!=null&&u.items.every(d=>d.aborted)&&(l.batch.cancel(),l.batch=null)}}}return{load:i}}function Am(e){return function(t){const n=km(t),r=t.maxURLLength??1/0;return o=>{const a=u=>{const d=h=>{if(r===1/0)return!0;const m=h.map(v=>v.path).join(","),g=h.map(v=>v.input);return du({...n,runtime:o,type:u,path:m,inputs:g}).length<=r},f=e({...n,runtime:o,type:u,opts:t});return{validate:d,fetch:f}},i=zi(a("query")),s=zi(a("mutation")),l=zi(a("subscription")),c={query:i,subscription:l,mutation:s};return({op:u})=>ou(d=>{const f=c[u.type],{promise:h,cancel:m}=f.load(u);let g;return h.then(v=>{g=v;const b=ym(v.json,o);if(!b.ok){d.error(kr.from(b.error,{meta:v.meta}));return}d.next({context:v.meta,result:b.result}),d.complete()}).catch(v=>{d.error(kr.from(v,{meta:g==null?void 0:g.meta}))}),()=>{m()}})}}}const Vm=e=>t=>{const n=t.map(i=>i.path).join(","),r=t.map(i=>i.input),{promise:o,cancel:a}=Em({...e,path:n,inputs:r,headers(){return e.opts.headers?typeof e.opts.headers=="function"?e.opts.headers({opList:t}):e.opts.headers:{}}});return{promise:o.then(i=>(Array.isArray(i.json)?i.json:t.map(()=>i.json)).map(s=>({meta:i.meta,json:s}))),cancel:a}},Lm=Am(Vm);let Om=class{$request({type:e,input:t,path:n,context:r={}}){return pm({links:this.links,op:{id:++this.requestId,type:e,path:n,input:t,context:r}}).pipe(cm())}requestAsPromise(e){const t=this.$request(e),{promise:n,abort:r}=dm(t);return new Promise((o,a)=>{var i;(i=e.signal)==null||i.addEventListener("abort",r),n.then(s=>{o(s.result.data)}).catch(s=>{a(kr.from(s))})})}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n==null?void 0:n.context}).subscribe({next(r){var o,a,i;r.result.type==="started"?(o=n.onStarted)==null||o.call(n):r.result.type==="stopped"?(a=n.onStopped)==null||a.call(n):(i=n.onData)==null||i.call(n,r.result.data)},error(r){var o;(o=n.onError)==null||o.call(n,r)},complete(){var r;(r=n.onComplete)==null||r.call(n)}})}constructor(e){this.requestId=0;const t=(()=>{const n=e.transformer;return n?"input"in n?e.transformer:{input:n,output:n}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}})();this.runtime={transformer:{serialize:n=>t.input.serialize(n),deserialize:n=>t.output.deserialize(n)},combinedTransformer:t},this.links=e.links.map(n=>n(this.runtime))}};const Nm={query:"query",mutate:"mutation",subscribe:"subscription"},Bm=e=>Nm[e];function Im(e){return hm(t=>e.hasOwnProperty(t)?e[t]:t==="__untypedClient"?e:fm(({path:n,args:r})=>{const o=[t,...n],a=Bm(o.pop()),i=o.join(".");return e[a](i,...r)}))}function Zm(e){const t=new Om(e);return Im(t)}let Pm=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},pu=class{constructor(e){this.generateIdentifier=e,this.kv=new Pm}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},Hm=class extends pu{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function Fm(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Rm(e,t){const n=Fm(e);if("find"in n)return n.find(t);const r=n;for(let o=0;ot(r,n))}function Oo(e,t){return e.indexOf(t)!==-1}function fu(e,t){for(let n=0;nt.isApplicable(e))}findByName(e){return this.transfomers[e]}};const zm=e=>Object.prototype.toString.call(e).slice(8,-1),hu=e=>typeof e>"u",Ym=e=>e===null,Cr=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Yi=e=>Cr(e)&&Object.keys(e).length===0,Ht=e=>Array.isArray(e),Wm=e=>typeof e=="string",Um=e=>typeof e=="number"&&!isNaN(e),Km=e=>typeof e=="boolean",qm=e=>e instanceof RegExp,Mr=e=>e instanceof Map,Sr=e=>e instanceof Set,gu=e=>zm(e)==="Symbol",Gm=e=>e instanceof Date&&!isNaN(e.valueOf()),Xm=e=>e instanceof Error,mu=e=>typeof e=="number"&&isNaN(e),Jm=e=>Km(e)||Ym(e)||hu(e)||Um(e)||Wm(e)||gu(e),Qm=e=>typeof e=="bigint",ev=e=>e===1/0||e===-1/0,tv=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),nv=e=>e instanceof URL,vu=e=>e.replace(/\./g,"\\."),Wi=e=>e.map(String).map(vu).join("."),Er=e=>{const t=[];let n="";for(let o=0;onull,()=>{}),ot(Qm,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ot(Gm,"Date",e=>e.toISOString(),e=>new Date(e)),ot(Xm,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),ot(qm,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ot(Sr,"set",e=>[...e.values()],e=>new Set(e)),ot(Mr,"map",e=>[...e.entries()],e=>new Map(e)),ot(e=>mu(e)||ev(e),"number",e=>mu(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ot(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ot(nv,"URL",e=>e.toString(),e=>new URL(e))];function No(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const yu=No((e,t)=>gu(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),rv=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),wu=No(tv,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=rv[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function xu(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const $u=No(xu,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(o=>{r[o]=e[o]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),_u=No((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),ov=[$u,yu,_u,wu],ku=(e,t)=>{const n=fu(ov,o=>o.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=fu(bu,o=>o.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},Cu={};bu.forEach(e=>{Cu[e.annotation]=e});const av=(e,t,n)=>{if(Ht(t))switch(t[0]){case"symbol":return yu.untransform(e,t,n);case"class":return $u.untransform(e,t,n);case"custom":return _u.untransform(e,t,n);case"typed-array":return wu.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=Cu[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},On=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Mu(e){if(Oo(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Oo(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Oo(e,"constructor"))throw new Error("constructor is not allowed as a property")}const iv=(e,t)=>{Mu(t);for(let n=0;n{if(Mu(t),t.length===0)return n(e);let r=e;for(let a=0;aKi(a,t,[...n,...Er(i)]));return}const[r,o]=e;o&&Ln(o,(a,i)=>{Ki(a,t,[...n,...Er(i)])}),t(r,n)}function sv(e,t,n){return Ki(t,(r,o)=>{e=Ui(e,o,a=>av(a,r,n))}),e}function lv(e,t){function n(r,o){const a=iv(e,Er(o));r.map(Er).forEach(i=>{e=Ui(e,i,()=>a)})}if(Ht(t)){const[r,o]=t;r.forEach(a=>{e=Ui(e,Er(a),()=>e)}),o&&Ln(o,n)}else Ln(t,n);return e}const cv=(e,t)=>Cr(e)||Ht(e)||Mr(e)||Sr(e)||xu(e,t);function uv(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function dv(e,t){const n={};let r;return e.forEach(o=>{if(o.length<=1)return;t||(o=o.map(s=>s.map(String)).sort((s,l)=>s.length-l.length));const[a,...i]=o;a.length===0?r=i.map(Wi):n[Wi(a)]=i.map(Wi)}),r?Yi(n)?[r]:[r,n]:Yi(n)?void 0:n}const Su=(e,t,n,r,o=[],a=[],i=new Map)=>{const s=Jm(e);if(!s){uv(e,o,t);const h=i.get(e);if(h)return r?{transformedValue:null}:h}if(!cv(e,n)){const h=ku(e,n),m=h?{transformedValue:h.value,annotations:[h.type]}:{transformedValue:e};return s||i.set(e,m),m}if(Oo(a,e))return{transformedValue:null};const l=ku(e,n),c=(l==null?void 0:l.value)??e,u=Ht(c)?[]:{},d={};Ln(c,(h,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const g=Su(h,t,n,r,[...o,m],[...a,e],i);u[m]=g.transformedValue,Ht(g.annotations)?d[m]=g.annotations:Cr(g.annotations)&&Ln(g.annotations,(v,b)=>{d[vu(m)+"."+b]=v})});const f=Yi(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return s||i.set(e,f),f};function Eu(e){return Object.prototype.toString.call(e).slice(8,-1)}function Du(e){return Eu(e)==="Array"}function pv(e){if(Eu(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function fv(e,t,n,r,o){const a={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";a==="enumerable"&&(e[t]=n),o&&a==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function qi(e,t={}){if(Du(e))return e.map(o=>qi(o,t));if(!pv(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,a)=>{if(Du(t.props)&&!t.props.includes(a))return o;const i=e[a],s=qi(i,t);return fv(o,a,s,e,t.nonenumerable),o},{})}let j=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Hm,this.symbolRegistry=new pu(t=>t.description??""),this.customTransformerRegistry=new jm,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=Su(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const o=dv(t,this.dedupe);return o&&(r.meta={...r.meta,referentialEqualities:o}),r}deserialize(e){const{json:t,meta:n}=e;let r=qi(t);return n!=null&&n.values&&(r=sv(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=lv(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};j.defaultInstance=new j,j.serialize=j.defaultInstance.serialize.bind(j.defaultInstance),j.deserialize=j.defaultInstance.deserialize.bind(j.defaultInstance),j.stringify=j.defaultInstance.stringify.bind(j.defaultInstance),j.parse=j.defaultInstance.parse.bind(j.defaultInstance),j.registerClass=j.defaultInstance.registerClass.bind(j.defaultInstance),j.registerSymbol=j.defaultInstance.registerSymbol.bind(j.defaultInstance),j.registerCustom=j.defaultInstance.registerCustom.bind(j.defaultInstance),j.allowErrorProps=j.defaultInstance.allowErrorProps.bind(j.defaultInstance),j.serialize,j.deserialize,j.stringify,j.parse,j.registerClass,j.registerCustom,j.registerSymbol,j.allowErrorProps;function Nn(e,t="https://signals.ignite.systems/api/trpc"){return Zm({transformer:j,links:[Lm({url:t,headers(){return e?{authorization:`Bearer ${e}`}:{}}})]})}function hv(e,t){return p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z","clip-rule":"evenodd"})])}function gv(e,t){return p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M.676 6.941A12.964 12.964 0 0 1 10 3c3.657 0 6.963 1.511 9.324 3.941a.75.75 0 0 1-.008 1.053l-.353.354a.75.75 0 0 1-1.069-.008C15.894 6.28 13.097 5 10 5 6.903 5 4.106 6.28 2.106 8.34a.75.75 0 0 1-1.069.008l-.353-.354a.75.75 0 0 1-.008-1.053Zm2.825 2.833A8.976 8.976 0 0 1 10 7a8.976 8.976 0 0 1 6.499 2.774.75.75 0 0 1-.011 1.049l-.354.354a.75.75 0 0 1-1.072-.012A6.978 6.978 0 0 0 10 9c-1.99 0-3.786.83-5.061 2.165a.75.75 0 0 1-1.073.012l-.354-.354a.75.75 0 0 1-.01-1.05Zm2.82 2.84A4.989 4.989 0 0 1 10 11c1.456 0 2.767.623 3.68 1.614a.75.75 0 0 1-.022 1.039l-.354.354a.75.75 0 0 1-1.085-.026A2.99 2.99 0 0 0 10 13c-.88 0-1.67.377-2.22.981a.75.75 0 0 1-1.084.026l-.354-.354a.75.75 0 0 1-.021-1.039Zm2.795 2.752a1.248 1.248 0 0 1 1.768 0 .75.75 0 0 1 0 1.06l-.354.354a.75.75 0 0 1-1.06 0l-.354-.353a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"})])}function mv(e,t){return p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M19 5.5a4.5 4.5 0 0 1-4.791 4.49c-.873-.055-1.808.128-2.368.8l-6.024 7.23a2.724 2.724 0 1 1-3.837-3.837L9.21 8.16c.672-.56.855-1.495.8-2.368a4.5 4.5 0 0 1 5.873-4.575c.324.105.39.51.15.752L13.34 4.66a.455.455 0 0 0-.11.494 3.01 3.01 0 0 0 1.617 1.617c.17.07.363.02.493-.111l2.692-2.692c.241-.241.647-.174.752.15.14.435.216.9.216 1.382ZM4 17a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z","clip-rule":"evenodd"})])}function vv(e,t){return p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[p.createElementVNode("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})])}const bv={class:"flex"},yv=["src"],wv={class:"my-5 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900"},xv={key:0},$v={class:"my-1 text-center text-sm leading-6 text-gray-600"},_v={class:"my-3 overflow-hidden rounded-full bg-gray-200"},kv={role:"list",class:"grid grid-cols-1 gap-6 mx-auto max-w-96"},Cv={class:"flex w-full items-center p-6"},Mv={class:"truncate text-lg font-medium text-gray-900"},Sv={key:0},Ev={class:"-mt-px flex divide-x divide-gray-200"},Dv={class:"flex w-0 flex-1"},Tv=["onClick"],Av=p.defineComponent({__name:"DeviceSelect",props:{headingText:{default:"Get your devices connected"},logoUrl:{default:"https://signals.ignite.systems/favicon.svg"},devices:{}},emits:["setup"],setup(e){const t=e,n=p.computed(()=>t.devices.filter(r=>r.status==="complete").length/t.devices.length*100);return(r,o)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",bv,[p.createElementVNode("img",{class:"m-auto h-10",src:r.logoUrl,alt:"Signals Company Logo"},null,8,yv)]),p.createElementVNode("h2",wv,p.toDisplayString(r.headingText),1),r.devices.length>1?(p.openBlock(),p.createElementBlock("div",xv,[p.createElementVNode("p",$v,p.toDisplayString(n.value>0?`You're doing great - ${n.value.toFixed(0)}% of devices connected`:"Select setup on one of the devices below to get started"),1),p.createElementVNode("div",_v,[p.createElementVNode("div",{class:"h-2 rounded-full bg-indigo-600",style:p.normalizeStyle(`width: ${n.value}%`)},null,4)])])):p.createCommentVNode("",!0),p.createElementVNode("ul",kv,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.devices,a=>(p.openBlock(),p.createElementBlock("li",{key:a.id,class:"col-span-1 divide-y divide-gray-200 rounded-lg bg-gray-200 shadow"},[p.createElementVNode("div",Cv,[p.createElementVNode("h3",Mv,p.toDisplayString(a.display),1),p.createElementVNode("div",{class:p.normalizeClass(["flex ml-auto h-10 w-10 rounded-full text-white",[a.status==="pending"?"bg-orange-400":"",a.status==="complete"?"bg-green-400":"",a.status==="error"?"bg-red-400":""]])},[a.status==="pending"?(p.openBlock(),p.createBlock(p.unref(gv),{key:0,class:"m-auto h-6 w-6"})):p.createCommentVNode("",!0),a.status==="complete"?(p.openBlock(),p.createBlock(p.unref(hv),{key:1,class:"m-auto h-6 w-6"})):p.createCommentVNode("",!0),a.status==="error"?(p.openBlock(),p.createBlock(p.unref(vv),{key:2,class:"m-auto h-6 w-6"})):p.createCommentVNode("",!0)],2)]),a.status==="pending"?(p.openBlock(),p.createElementBlock("div",Sv,[p.createElementVNode("div",Ev,[p.createElementVNode("div",Dv,[p.createElementVNode("button",{class:"relative -mr-px inline-flex w-0 flex-1 items-center justify-center gap-x-3 rounded-b-lg border border-transparent py-4 text-sm font-semibold text-white bg-indigo-500",onClick:i=>r.$emit("setup",a.id)},[p.createVNode(p.unref(mv),{class:"h-5 w-5 text-gray-200","aria-hidden":"true"}),p.createTextVNode(" Setup ")],8,Tv)])])])):p.createCommentVNode("",!0)]))),128))])],64))}});function Vv(e,t,n){let r=p.ref(n==null?void 0:n.value),o=p.computed(()=>e.value!==void 0);return[p.computed(()=>o.value?e.value:r.value),function(a){return o.value||(r.value=a),t==null?void 0:t(a)}]}let Lv=Symbol("headlessui.useid"),Ov=0;function Bn(){return p.inject(Lv,()=>`${++Ov}`)()}function Ce(e){var t;if(e==null||e.value==null)return null;let n=(t=e.value.$el)!=null?t:e.value;return n instanceof Node?n:null}function Bo(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Bo),r}var Nv=Object.defineProperty,Bv=(e,t,n)=>t in e?Nv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tu=(e,t,n)=>(Bv(e,typeof t!="symbol"?t+"":t,n),n);let Iv=class{constructor(){Tu(this,"current",this.detect()),Tu(this,"currentId",0)}set(e){this.current!==e&&(this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},Zv=new Iv;function Io(e){if(Zv.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=Ce(e);if(t)return t.ownerDocument}return document}let Pv=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Dr=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Dr||{}),Gi=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Gi||{}),Hv=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Hv||{});function Fv(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Pv)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Rv=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Rv||{}),jv=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(jv||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let zv=["textarea","input"].join(",");function Yv(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,zv))!=null?n:!1}function Au(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),a=t(r);if(o===null||a===null)return 0;let i=o.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Vu(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){var a;let i=(a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)!=null?a:document,s=Array.isArray(e)?n?Au(e):e:Fv(e);o.length>0&&s.length>1&&(s=s.filter(m=>!o.includes(m))),r=r??i.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=s.length,h;do{if(d>=f||d+f<=0)return 0;let m=c+d;if(t&16)m=(m+f)%f;else{if(m<0)return 3;if(m>=f)return 1}h=s[m],h==null||h.focus(u),d+=l}while(h!==i.activeElement);return t&6&&Yv(h)&&h.select(),2}function Lu(e,t){if(e)return e;let n=t??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Wv(e,t){let n=p.ref(Lu(e.value.type,e.value.as));return p.onMounted(()=>{n.value=Lu(e.value.type,e.value.as)}),p.watchEffect(()=>{var r;n.value||Ce(t)&&Ce(t)instanceof HTMLButtonElement&&!((r=Ce(t))!=null&&r.hasAttribute("type"))&&(n.value="button")}),n}function Uv({container:e,accept:t,walk:n,enabled:r}){p.watchEffect(()=>{let o=e.value;if(!o||r!==void 0&&!r.value)return;let a=Io(e);if(!a)return;let i=Object.assign(l=>t(l),{acceptNode:t}),s=a.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)n(s.currentNode)})}var Xi=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Xi||{}),Kv=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Kv||{});function Ft({visible:e=!0,features:t=0,ourProps:n,theirProps:r,...o}){var a;let i=Nu(r,n),s=Object.assign(o,{props:i});if(e||t&2&&i.static)return Ji(s);if(t&1){let l=(a=i.unmount)==null||a?0:1;return Bo(l,{0(){return null},1(){return Ji({...o,props:{...i,hidden:!0,style:{display:"none"}}})}})}return Ji(s)}function Ji({props:e,attrs:t,slots:n,slot:r,name:o}){var a,i;let{as:s,...l}=Bu(e,["unmount","static"]),c=(a=n.default)==null?void 0:a.call(n,r),u={};if(r){let d=!1,f=[];for(let[h,m]of Object.entries(r))typeof m=="boolean"&&(d=!0),m===!0&&f.push(h);d&&(u["data-headlessui-state"]=f.join(" "))}if(s==="template"){if(c=Ou(c??[]),Object.keys(l).length>0||Object.keys(t).length>0){let[d,...f]=c??[];if(!Gv(d)||f.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${o} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(l).concat(Object.keys(t)).map(g=>g.trim()).filter((g,v,b)=>b.indexOf(g)===v).sort((g,v)=>g.localeCompare(v)).map(g=>` - ${g}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(` `)].join(` `));let h=Nu((i=d.props)!=null?i:{},l,u),m=p.cloneVNode(d,h,!0);for(let g in h)g.startsWith("on")&&(m.props||(m.props={}),m.props[g]=h[g]);return m}return Array.isArray(c)&&c.length===1?c[0]:c}return p.h(s,Object.assign({},l,u),{default:()=>c})}function Ou(e){return e.flatMap(t=>t.type===p.Fragment?Ou(t.children):[t])}function Nu(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...a){let i=n[r];for(let s of i){if(o instanceof Event&&o.defaultPrevented)return;s(o,...a)}}});return t}function qv(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Bu(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Gv(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Iu=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Iu||{});let Xv=p.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:t,attrs:n}){return()=>{var r;let{features:o,...a}=e,i={"aria-hidden":(o&2)===2?!0:(r=a["aria-hidden"])!=null?r:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(o&4)===4&&(o&2)!==2&&{display:"none"}}};return Ft({ourProps:i,theirProps:a,slot:{},attrs:n,slots:t,name:"Hidden"})}}}),Zu=Symbol("Context");var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function Jv(){return p.inject(Zu,null)}function Qv(e){p.provide(Zu,e)}var Re=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Re||{});function Pu(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Fu(n,Hu(t,r),o);return n}function Hu(e,t){return e?e+"["+t+"]":t}function Fu(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Fu(e,Hu(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Pu(n,t,e)}function eb(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}let Ru=Symbol("DescriptionContext");function tb(){let e=p.inject(Ru,null);if(e===null)throw new Error("Missing parent");return e}function ju({slot:e=p.ref({}),name:t="Description",props:n={}}={}){let r=p.ref([]);function o(a){return r.value.push(a),()=>{let i=r.value.indexOf(a);i!==-1&&r.value.splice(i,1)}}return p.provide(Ru,{register:o,slot:e,name:t,props:n}),p.computed(()=>r.value.length>0?r.value.join(" "):void 0)}let nb=p.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"},id:{type:String,default:null}},setup(e,{attrs:t,slots:n}){var r;let o=(r=e.id)!=null?r:`headlessui-description-${Bn()}`,a=tb();return p.onMounted(()=>p.onUnmounted(a.register(o))),()=>{let{name:i="Description",slot:s=p.ref({}),props:l={}}=a,{...c}=e,u={...Object.entries(l).reduce((d,[f,h])=>Object.assign(d,{[f]:p.unref(h)}),{}),id:o};return Ft({ourProps:u,theirProps:c,slot:s.value,attrs:t,slots:n,name:i})}}});var rb=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(rb||{});let zu=Symbol("DisclosureContext");function Qi(e){let t=p.inject(zu,null);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qi),n}return t}let Yu=Symbol("DisclosurePanelContext");function ob(){return p.inject(Yu,null)}let ab=p.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"},defaultOpen:{type:[Boolean],default:!1}},setup(e,{slots:t,attrs:n}){let r=p.ref(e.defaultOpen?0:1),o=p.ref(null),a=p.ref(null),i={buttonId:p.ref(`headlessui-disclosure-button-${Bn()}`),panelId:p.ref(`headlessui-disclosure-panel-${Bn()}`),disclosureState:r,panel:o,button:a,toggleDisclosure(){r.value=Bo(r.value,{0:1,1:0})},closeDisclosure(){r.value!==1&&(r.value=1)},close(s){i.closeDisclosure();let l=s?s instanceof HTMLElement?s:s.value instanceof HTMLElement?Ce(s):Ce(i.button):Ce(i.button);l==null||l.focus()}};return p.provide(zu,i),Qv(p.computed(()=>Bo(r.value,{0:Tr.Open,1:Tr.Closed}))),()=>{let{defaultOpen:s,...l}=e,c={open:r.value===0,close:i.close};return Ft({theirProps:l,ourProps:{},slot:c,slots:t,attrs:n,name:"Disclosure"})}}}),ib=p.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:null}},setup(e,{attrs:t,slots:n,expose:r}){let o=Qi("DisclosureButton"),a=ob(),i=p.computed(()=>a===null?!1:a.value===o.panelId.value);p.onMounted(()=>{i.value||e.id!==null&&(o.buttonId.value=e.id)}),p.onUnmounted(()=>{i.value||(o.buttonId.value=null)});let s=p.ref(null);r({el:s,$el:s}),i.value||p.watchEffect(()=>{o.button.value=s.value});let l=Wv(p.computed(()=>({as:e.as,type:t.type})),s);function c(){var f;e.disabled||(i.value?(o.toggleDisclosure(),(f=Ce(o.button))==null||f.focus()):o.toggleDisclosure())}function u(f){var h;if(!e.disabled)if(i.value)switch(f.key){case Re.Space:case Re.Enter:f.preventDefault(),f.stopPropagation(),o.toggleDisclosure(),(h=Ce(o.button))==null||h.focus();break}else switch(f.key){case Re.Space:case Re.Enter:f.preventDefault(),f.stopPropagation(),o.toggleDisclosure();break}}function d(f){switch(f.key){case Re.Space:f.preventDefault();break}}return()=>{var f;let h={open:o.disclosureState.value===0},{id:m,...g}=e,v=i.value?{ref:s,type:l.value,onClick:c,onKeydown:u}:{id:(f=o.buttonId.value)!=null?f:m,ref:s,type:l.value,"aria-expanded":o.disclosureState.value===0,"aria-controls":o.disclosureState.value===0||Ce(o.panel)?o.panelId.value:void 0,disabled:e.disabled?!0:void 0,onClick:c,onKeydown:u,onKeyup:d};return Ft({ourProps:v,theirProps:g,slot:h,attrs:t,slots:n,name:"DisclosureButton"})}}}),sb=p.defineComponent({name:"DisclosurePanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:null}},setup(e,{attrs:t,slots:n,expose:r}){let o=Qi("DisclosurePanel");p.onMounted(()=>{e.id!==null&&(o.panelId.value=e.id)}),p.onUnmounted(()=>{o.panelId.value=null}),r({el:o.panel,$el:o.panel}),p.provide(Yu,o.panelId);let a=Jv(),i=p.computed(()=>a!==null?(a.value&Tr.Open)===Tr.Open:o.disclosureState.value===0);return()=>{var s;let l={open:o.disclosureState.value===0,close:o.close},{id:c,...u}=e,d={id:(s=o.panelId.value)!=null?s:c,ref:o.panel};return Ft({ourProps:d,theirProps:u,slot:l,attrs:t,slots:n,features:Xi.RenderStrategy|Xi.Static,visible:i.value,name:"DisclosurePanel"})}}}),Wu=Symbol("LabelContext");function Uu(){let e=p.inject(Wu,null);if(e===null){let t=new Error("You used a