-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-QK2A4HPL.js
1 lines (1 loc) · 37.3 KB
/
chunk-QK2A4HPL.js
1
import{Xa as F,Ya as ee,Z as Q,a as w,aa as G,ac as K,b as _,bc as te,d as W,da as k,e as X,i as Z,xa as Y}from"./chunk-UVJMIVZR.js";var ae=W((Pe,se)=>{"use strict";se.exports=window.FormData});var pe=W((j,de)=>{"use strict";var ce=typeof self<"u"?self:j,C=function(){function s(){this.fetch=!1,this.DOMException=ce.DOMException}return s.prototype=ce,new s}();(function(s){var e=function(t){var n={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function i(o){return o&&DataView.prototype.isPrototypeOf(o)}if(n.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(o){return o&&r.indexOf(Object.prototype.toString.call(o))>-1};function p(o){if(typeof o!="string"&&(o=String(o)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))throw new TypeError("Invalid character in header field name");return o.toLowerCase()}function f(o){return typeof o!="string"&&(o=String(o)),o}function y(o){var c={next:function(){var h=o.shift();return{done:h===void 0,value:h}}};return n.iterable&&(c[Symbol.iterator]=function(){return c}),c}function l(o){this.map={},o instanceof l?o.forEach(function(c,h){this.append(h,c)},this):Array.isArray(o)?o.forEach(function(c){this.append(c[0],c[1])},this):o&&Object.getOwnPropertyNames(o).forEach(function(c){this.append(c,o[c])},this)}l.prototype.append=function(o,c){o=p(o),c=f(c);var h=this.map[o];this.map[o]=h?h+", "+c:c},l.prototype.delete=function(o){delete this.map[p(o)]},l.prototype.get=function(o){return o=p(o),this.has(o)?this.map[o]:null},l.prototype.has=function(o){return this.map.hasOwnProperty(p(o))},l.prototype.set=function(o,c){this.map[p(o)]=f(c)},l.prototype.forEach=function(o,c){for(var h in this.map)this.map.hasOwnProperty(h)&&o.call(c,this.map[h],h,this)},l.prototype.keys=function(){var o=[];return this.forEach(function(c,h){o.push(h)}),y(o)},l.prototype.values=function(){var o=[];return this.forEach(function(c){o.push(c)}),y(o)},l.prototype.entries=function(){var o=[];return this.forEach(function(c,h){o.push([h,c])}),y(o)},n.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);function v(o){if(o.bodyUsed)return Promise.reject(new TypeError("Already read"));o.bodyUsed=!0}function P(o){return new Promise(function(c,h){o.onload=function(){c(o.result)},o.onerror=function(){h(o.error)}})}function E(o){var c=new FileReader,h=P(c);return c.readAsArrayBuffer(o),h}function A(o){var c=new FileReader,h=P(c);return c.readAsText(o),h}function q(o){for(var c=new Uint8Array(o),h=new Array(c.length),b=0;b<c.length;b++)h[b]=String.fromCharCode(c[b]);return h.join("")}function x(o){if(o.slice)return o.slice(0);var c=new Uint8Array(o.byteLength);return c.set(new Uint8Array(o)),c.buffer}function V(){return this.bodyUsed=!1,this._initBody=function(o){this._bodyInit=o,o?typeof o=="string"?this._bodyText=o:n.blob&&Blob.prototype.isPrototypeOf(o)?this._bodyBlob=o:n.formData&&FormData.prototype.isPrototypeOf(o)?this._bodyFormData=o:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)?this._bodyText=o.toString():n.arrayBuffer&&n.blob&&i(o)?(this._bodyArrayBuffer=x(o.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(o)||a(o))?this._bodyArrayBuffer=x(o):this._bodyText=o=Object.prototype.toString.call(o):this._bodyText="",this.headers.get("content-type")||(typeof o=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var o=v(this);if(o)return o;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(E)}),this.text=function(){var o=v(this);if(o)return o;if(this._bodyBlob)return A(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(q(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(me)}),this.json=function(){return this.text().then(JSON.parse)},this}var he=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ye(o){var c=o.toUpperCase();return he.indexOf(c)>-1?c:o}function S(o,c){c=c||{};var h=c.body;if(o instanceof S){if(o.bodyUsed)throw new TypeError("Already read");this.url=o.url,this.credentials=o.credentials,c.headers||(this.headers=new l(o.headers)),this.method=o.method,this.mode=o.mode,this.signal=o.signal,!h&&o._bodyInit!=null&&(h=o._bodyInit,o.bodyUsed=!0)}else this.url=String(o);if(this.credentials=c.credentials||this.credentials||"same-origin",(c.headers||!this.headers)&&(this.headers=new l(c.headers)),this.method=ye(c.method||this.method||"GET"),this.mode=c.mode||this.mode||null,this.signal=c.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&h)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(h)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})};function me(o){var c=new FormData;return o.trim().split("&").forEach(function(h){if(h){var b=h.split("="),g=b.shift().replace(/\+/g," "),m=b.join("=").replace(/\+/g," ");c.append(decodeURIComponent(g),decodeURIComponent(m))}}),c}function we(o){var c=new l,h=o.replace(/\r?\n[\t ]+/g," ");return h.split(/\r?\n/).forEach(function(b){var g=b.split(":"),m=g.shift().trim();if(m){var D=g.join(":").trim();c.append(m,D)}}),c}V.call(S.prototype);function M(o,c){c||(c={}),this.type="default",this.status=c.status===void 0?200:c.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in c?c.statusText:"OK",this.headers=new l(c.headers),this.url=c.url||"",this._initBody(o)}V.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},M.error=function(){var o=new M(null,{status:0,statusText:""});return o.type="error",o};var ge=[301,302,303,307,308];M.redirect=function(o,c){if(ge.indexOf(c)===-1)throw new RangeError("Invalid status code");return new M(null,{status:c,headers:{location:o}})},t.DOMException=s.DOMException;try{new t.DOMException}catch{t.DOMException=function(c,h){this.message=c,this.name=h;var b=Error(c);this.stack=b.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function H(o,c){return new Promise(function(h,b){var g=new S(o,c);if(g.signal&&g.signal.aborted)return b(new t.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function D(){m.abort()}m.onload=function(){var U={status:m.status,statusText:m.statusText,headers:we(m.getAllResponseHeaders()||"")};U.url="responseURL"in m?m.responseURL:U.headers.get("X-Request-URL");var $="response"in m?m.response:m.responseText;h(new M($,U))},m.onerror=function(){b(new TypeError("Network request failed"))},m.ontimeout=function(){b(new TypeError("Network request failed"))},m.onabort=function(){b(new t.DOMException("Aborted","AbortError"))},m.open(g.method,g.url,!0),g.credentials==="include"?m.withCredentials=!0:g.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&n.blob&&(m.responseType="blob"),g.headers.forEach(function(U,$){m.setRequestHeader($,U)}),g.signal&&(g.signal.addEventListener("abort",D),m.onreadystatechange=function(){m.readyState===4&&g.signal.removeEventListener("abort",D)}),m.send(typeof g._bodyInit>"u"?null:g._bodyInit)})}return H.polyfill=!0,s.fetch||(s.fetch=H,s.Headers=l,s.Request=S,s.Response=M),t.Headers=l,t.Request=S,t.Response=M,t.fetch=H,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(C);C.fetch.ponyfill=!0;delete C.fetch.polyfill;var R=C;j=R.fetch;j.default=R.fetch;j.fetch=R.fetch;j.Headers=R.Headers;j.Request=R.Request;j.Response=R.Response;de.exports=j});var I=Symbol("STATE_SIGNAL");function J(s,...e){s[I].update(t=>e.reduce((n,i)=>w(w({},n),typeof i=="function"?i(n):i),t))}function ne(s){let e=te(()=>s());return be(e)?new Proxy(s,{get(t,n){return n in e?(F(t[n])||Object.defineProperty(t,n,{value:K(()=>t()[n]),configurable:!0}),ne(t[n])):t[n]}}):s}function be(s){return s?.constructor===Object}function ie(...s){let e=[...s],t="providedIn"in e[0]?e.shift():{},n=e;return(()=>{class r{constructor(){let p=n.reduce((q,x)=>x(q),ve()),{slices:f,signals:y,methods:l,hooks:v}=p,P=w(w(w({},f),y),l);this[I]=p[I];for(let q in P)this[q]=P[q];let{onInit:E,onDestroy:A}=v;E&&E(),A&&k(Y).onDestroy(A)}static \u0275fac=function(f){return new(f||r)};static \u0275prov=Q({token:r,factory:r.\u0275fac,providedIn:t.providedIn||null})}return r})()}function ve(){return{[I]:ee({}),slices:{},signals:{},methods:{},hooks:{}}}function B(s,e){return Object.keys(s).reduce((t,n)=>(e.includes(n)||(t[n]=s[n]),t),{})}function oe(s){return e=>{let t=s(w(w(w({[I]:e[I]},e.slices),e.signals),e.methods)),n=Object.keys(t),i=B(e.slices,n),r=B(e.signals,n);return _(w({},e),{slices:i,signals:r,methods:w(w({},e.methods),t)})}}function re(s){return e=>{let t=typeof s=="function"?s():s,n=Object.keys(t);e[I].update(p=>w(w({},p),t));let i=n.reduce((p,f)=>{let y=K(()=>e[I]()[f]);return _(w({},p),{[f]:ne(y)})},{}),r=B(e.signals,n),a=B(e.methods,n);return _(w({},e),{slices:w(w({},e.slices),i),signals:r,methods:a})}}var Ue=X(ae(),1),ue=X(pe(),1);function u(s,e,t,n){function i(r){return r instanceof t?r:new t(function(a){a(r)})}return new(t||(t=Promise))(function(r,a){function p(l){try{y(n.next(l))}catch(v){a(v)}}function f(l){try{y(n.throw(l))}catch(v){a(v)}}function y(l){l.done?r(l.value):i(l.value).then(p,f)}y((n=n.apply(s,e||[])).next())})}var L=(()=>{class s{constructor(t){this.client=t}static flatten(t,n=""){let i={};for(let[r,a]of Object.entries(t)){let p=n?n+"["+r+"]":r;Array.isArray(a)?i=Object.assign(Object.assign({},i),s.flatten(a,p)):i[p]=a}return i}}return s.CHUNK_SIZE=5*1024*1024,s})(),Le=(()=>{class s{constructor(t,n,i){this.method=t,this.attribute=n,i!==void 0&&(Array.isArray(i)?this.values=i:this.values=[i])}toString(){return JSON.stringify({method:this.method,attribute:this.attribute,values:this.values})}}return s.equal=(e,t)=>new s("equal",e,t).toString(),s.notEqual=(e,t)=>new s("notEqual",e,t).toString(),s.lessThan=(e,t)=>new s("lessThan",e,t).toString(),s.lessThanEqual=(e,t)=>new s("lessThanEqual",e,t).toString(),s.greaterThan=(e,t)=>new s("greaterThan",e,t).toString(),s.greaterThanEqual=(e,t)=>new s("greaterThanEqual",e,t).toString(),s.isNull=e=>new s("isNull",e).toString(),s.isNotNull=e=>new s("isNotNull",e).toString(),s.between=(e,t,n)=>new s("between",e,[t,n]).toString(),s.startsWith=(e,t)=>new s("startsWith",e,t).toString(),s.endsWith=(e,t)=>new s("endsWith",e,t).toString(),s.select=e=>new s("select",void 0,e).toString(),s.search=(e,t)=>new s("search",e,t).toString(),s.orderDesc=e=>new s("orderDesc",e).toString(),s.orderAsc=e=>new s("orderAsc",e).toString(),s.cursorAfter=e=>new s("cursorAfter",void 0,e).toString(),s.cursorBefore=e=>new s("cursorBefore",void 0,e).toString(),s.limit=e=>new s("limit",void 0,e).toString(),s.offset=e=>new s("offset",void 0,e).toString(),s.contains=(e,t)=>new s("contains",e,t).toString(),s.or=e=>new s("or",void 0,e.map(t=>JSON.parse(t))).toString(),s.and=e=>new s("and",void 0,e.map(t=>JSON.parse(t))).toString(),s})(),d=class extends Error{constructor(e,t=0,n="",i=""){super(e),this.name="AppwriteException",this.message=e,this.code=t,this.type=n,this.response=i}},N=class{constructor(){this.config={endpoint:"https://cloud.appwrite.io/v1",endpointRealtime:"",project:"",jwt:"",locale:"",session:""},this.headers={"x-sdk-name":"Web","x-sdk-platform":"client","x-sdk-language":"web","x-sdk-version":"14.0.0","X-Appwrite-Response-Format":"1.5.0"},this.realtime={socket:void 0,timeout:void 0,url:"",channels:new Set,subscriptions:new Map,subscriptionsCounter:0,reconnect:!0,reconnectAttempts:0,lastMessage:void 0,connect:()=>{clearTimeout(this.realtime.timeout),this.realtime.timeout=window?.setTimeout(()=>{this.realtime.createSocket()},50)},getTimeout:()=>{switch(!0){case this.realtime.reconnectAttempts<5:return 1e3;case this.realtime.reconnectAttempts<15:return 5e3;case this.realtime.reconnectAttempts<100:return 1e4;default:return 6e4}},createSocket:()=>{var e,t;if(this.realtime.channels.size<1)return;let n=new URLSearchParams;n.set("project",this.config.project),this.realtime.channels.forEach(r=>{n.append("channels[]",r)});let i=this.config.endpointRealtime+"/realtime?"+n.toString();(i!==this.realtime.url||!this.realtime.socket||((e=this.realtime.socket)===null||e===void 0?void 0:e.readyState)>WebSocket.OPEN)&&(this.realtime.socket&&((t=this.realtime.socket)===null||t===void 0?void 0:t.readyState)<WebSocket.CLOSING&&(this.realtime.reconnect=!1,this.realtime.socket.close()),this.realtime.url=i,this.realtime.socket=new WebSocket(i),this.realtime.socket.addEventListener("message",this.realtime.onMessage),this.realtime.socket.addEventListener("open",r=>{this.realtime.reconnectAttempts=0}),this.realtime.socket.addEventListener("close",r=>{var a,p,f;if(!this.realtime.reconnect||((p=(a=this.realtime)===null||a===void 0?void 0:a.lastMessage)===null||p===void 0?void 0:p.type)==="error"&&((f=this.realtime)===null||f===void 0?void 0:f.lastMessage.data).code===1008){this.realtime.reconnect=!0;return}let y=this.realtime.getTimeout();console.error(`Realtime got disconnected. Reconnect will be attempted in ${y/1e3} seconds.`,r.reason),setTimeout(()=>{this.realtime.reconnectAttempts++,this.realtime.createSocket()},y)}))},onMessage:e=>{var t,n;try{let i=JSON.parse(e.data);switch(this.realtime.lastMessage=i,i.type){case"connected":let r=JSON.parse((t=window.localStorage.getItem("cookieFallback"))!==null&&t!==void 0?t:"{}"),a=r?.[`a_session_${this.config.project}`],p=i.data;a&&!p.user&&((n=this.realtime.socket)===null||n===void 0||n.send(JSON.stringify({type:"authentication",data:{session:a}})));break;case"event":let f=i.data;if(f?.channels){if(!f.channels.some(l=>this.realtime.channels.has(l)))return;this.realtime.subscriptions.forEach(l=>{f.channels.some(v=>l.channels.includes(v))&&setTimeout(()=>l.callback(f))})}break;case"error":throw i.data;default:break}}catch(i){console.error(i)}},cleanUp:e=>{this.realtime.channels.forEach(t=>{e.includes(t)&&(Array.from(this.realtime.subscriptions).some(([i,r])=>r.channels.includes(t))||this.realtime.channels.delete(t))})}}}setEndpoint(e){return this.config.endpoint=e,this.config.endpointRealtime=this.config.endpointRealtime||this.config.endpoint.replace("https://","wss://").replace("http://","ws://"),this}setEndpointRealtime(e){return this.config.endpointRealtime=e,this}setProject(e){return this.headers["X-Appwrite-Project"]=e,this.config.project=e,this}setJWT(e){return this.headers["X-Appwrite-JWT"]=e,this.config.jwt=e,this}setLocale(e){return this.headers["X-Appwrite-Locale"]=e,this.config.locale=e,this}setSession(e){return this.headers["X-Appwrite-Session"]=e,this.config.session=e,this}subscribe(e,t){let n=typeof e=="string"?[e]:e;n.forEach(r=>this.realtime.channels.add(r));let i=this.realtime.subscriptionsCounter++;return this.realtime.subscriptions.set(i,{channels:n,callback:t}),this.realtime.connect(),()=>{this.realtime.subscriptions.delete(i),this.realtime.cleanUp(n),this.realtime.connect()}}call(e,t,n={},i={}){var r,a;return u(this,void 0,void 0,function*(){e=e.toUpperCase(),n=Object.assign({},this.headers,n);let p={method:e,headers:n,credentials:"include"};if(typeof window<"u"&&window.localStorage&&(n["X-Fallback-Cookies"]=(r=window.localStorage.getItem("cookieFallback"))!==null&&r!==void 0?r:""),e==="GET")for(let[f,y]of Object.entries(L.flatten(i)))t.searchParams.append(f,y);else switch(n["content-type"]){case"application/json":p.body=JSON.stringify(i);break;case"multipart/form-data":let f=new FormData;for(let y in i)Array.isArray(i[y])?i[y].forEach(l=>{f.append(y+"[]",l)}):f.append(y,i[y]);p.body=f,delete n["content-type"];break}try{let f=null,y=yield(0,ue.fetch)(t.toString(),p);if(!((a=y.headers.get("content-type"))===null||a===void 0)&&a.includes("application/json")?f=yield y.json():f={message:yield y.text()},400<=y.status)throw new d(f?.message,y.status,f?.type,f);let l=y.headers.get("X-Fallback-Cookies");return typeof window<"u"&&window.localStorage&&l&&(window.console.warn("Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint."),window.localStorage.setItem("cookieFallback",l)),f}catch(f){throw f instanceof d?f:new d(f.message)}})}},O=class extends L{constructor(e){super(e)}get(){return u(this,void 0,void 0,function*(){let e="/account",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("get",n,{"content-type":"application/json"},t)})}create(e,t,n,i){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "email"');if(typeof n>"u")throw new d('Missing required parameter: "password"');let r="/account",a={};typeof e<"u"&&(a.userId=e),typeof t<"u"&&(a.email=t),typeof n<"u"&&(a.password=n),typeof i<"u"&&(a.name=i);let p=new URL(this.client.config.endpoint+r);return yield this.client.call("post",p,{"content-type":"application/json"},a)})}updateEmail(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "email"');if(typeof t>"u")throw new d('Missing required parameter: "password"');let n="/account/email",i={};typeof e<"u"&&(i.email=e),typeof t<"u"&&(i.password=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("patch",r,{"content-type":"application/json"},i)})}listIdentities(e){return u(this,void 0,void 0,function*(){let t="/account/identities",n={};typeof e<"u"&&(n.queries=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("get",i,{"content-type":"application/json"},n)})}deleteIdentity(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "identityId"');let t="/account/identities/{identityId}".replace("{identityId}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("delete",i,{"content-type":"application/json"},n)})}createJWT(){return u(this,void 0,void 0,function*(){let e="/account/jwt",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("post",n,{"content-type":"application/json"},t)})}listLogs(e){return u(this,void 0,void 0,function*(){let t="/account/logs",n={};typeof e<"u"&&(n.queries=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("get",i,{"content-type":"application/json"},n)})}updateMFA(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "mfa"');let t="/account/mfa",n={};typeof e<"u"&&(n.mfa=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("patch",i,{"content-type":"application/json"},n)})}createMfaAuthenticator(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "type"');let t="/account/mfa/authenticators/{type}".replace("{type}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("post",i,{"content-type":"application/json"},n)})}updateMfaAuthenticator(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "type"');if(typeof t>"u")throw new d('Missing required parameter: "otp"');let n="/account/mfa/authenticators/{type}".replace("{type}",e),i={};typeof t<"u"&&(i.otp=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}deleteMfaAuthenticator(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "type"');if(typeof t>"u")throw new d('Missing required parameter: "otp"');let n="/account/mfa/authenticators/{type}".replace("{type}",e),i={};typeof t<"u"&&(i.otp=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("delete",r,{"content-type":"application/json"},i)})}createMfaChallenge(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "factor"');let t="/account/mfa/challenge",n={};typeof e<"u"&&(n.factor=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("post",i,{"content-type":"application/json"},n)})}updateMfaChallenge(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "challengeId"');if(typeof t>"u")throw new d('Missing required parameter: "otp"');let n="/account/mfa/challenge",i={};typeof e<"u"&&(i.challengeId=e),typeof t<"u"&&(i.otp=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}listMfaFactors(){return u(this,void 0,void 0,function*(){let e="/account/mfa/factors",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("get",n,{"content-type":"application/json"},t)})}getMfaRecoveryCodes(){return u(this,void 0,void 0,function*(){let e="/account/mfa/recovery-codes",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("get",n,{"content-type":"application/json"},t)})}createMfaRecoveryCodes(){return u(this,void 0,void 0,function*(){let e="/account/mfa/recovery-codes",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("post",n,{"content-type":"application/json"},t)})}updateMfaRecoveryCodes(){return u(this,void 0,void 0,function*(){let e="/account/mfa/recovery-codes",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("patch",n,{"content-type":"application/json"},t)})}updateName(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "name"');let t="/account/name",n={};typeof e<"u"&&(n.name=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("patch",i,{"content-type":"application/json"},n)})}updatePassword(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "password"');let n="/account/password",i={};typeof e<"u"&&(i.password=e),typeof t<"u"&&(i.oldPassword=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("patch",r,{"content-type":"application/json"},i)})}updatePhone(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "phone"');if(typeof t>"u")throw new d('Missing required parameter: "password"');let n="/account/phone",i={};typeof e<"u"&&(i.phone=e),typeof t<"u"&&(i.password=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("patch",r,{"content-type":"application/json"},i)})}getPrefs(){return u(this,void 0,void 0,function*(){let e="/account/prefs",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("get",n,{"content-type":"application/json"},t)})}updatePrefs(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "prefs"');let t="/account/prefs",n={};typeof e<"u"&&(n.prefs=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("patch",i,{"content-type":"application/json"},n)})}createRecovery(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "email"');if(typeof t>"u")throw new d('Missing required parameter: "url"');let n="/account/recovery",i={};typeof e<"u"&&(i.email=e),typeof t<"u"&&(i.url=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("post",r,{"content-type":"application/json"},i)})}updateRecovery(e,t,n){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');if(typeof n>"u")throw new d('Missing required parameter: "password"');let i="/account/recovery",r={};typeof e<"u"&&(r.userId=e),typeof t<"u"&&(r.secret=t),typeof n<"u"&&(r.password=n);let a=new URL(this.client.config.endpoint+i);return yield this.client.call("put",a,{"content-type":"application/json"},r)})}listSessions(){return u(this,void 0,void 0,function*(){let e="/account/sessions",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("get",n,{"content-type":"application/json"},t)})}deleteSessions(){return u(this,void 0,void 0,function*(){let e="/account/sessions",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("delete",n,{"content-type":"application/json"},t)})}createAnonymousSession(){return u(this,void 0,void 0,function*(){let e="/account/sessions/anonymous",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("post",n,{"content-type":"application/json"},t)})}createEmailPasswordSession(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "email"');if(typeof t>"u")throw new d('Missing required parameter: "password"');let n="/account/sessions/email",i={};typeof e<"u"&&(i.email=e),typeof t<"u"&&(i.password=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("post",r,{"content-type":"application/json"},i)})}updateMagicURLSession(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');let n="/account/sessions/magic-url",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.secret=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}createOAuth2Session(e,t,n,i){if(typeof e>"u")throw new d('Missing required parameter: "provider"');let r="/account/sessions/oauth2/{provider}".replace("{provider}",e),a={};typeof t<"u"&&(a.success=t),typeof n<"u"&&(a.failure=n),typeof i<"u"&&(a.scopes=i);let p=new URL(this.client.config.endpoint+r);a.project=this.client.config.project;for(let[f,y]of Object.entries(L.flatten(a)))p.searchParams.append(f,y);if(typeof window<"u"&&window?.location)window.location.href=p.toString();else return p}updatePhoneSession(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');let n="/account/sessions/phone",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.secret=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}createSession(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');let n="/account/sessions/token",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.secret=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("post",r,{"content-type":"application/json"},i)})}getSession(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "sessionId"');let t="/account/sessions/{sessionId}".replace("{sessionId}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("get",i,{"content-type":"application/json"},n)})}updateSession(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "sessionId"');let t="/account/sessions/{sessionId}".replace("{sessionId}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("patch",i,{"content-type":"application/json"},n)})}deleteSession(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "sessionId"');let t="/account/sessions/{sessionId}".replace("{sessionId}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("delete",i,{"content-type":"application/json"},n)})}updateStatus(){return u(this,void 0,void 0,function*(){let e="/account/status",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("patch",n,{"content-type":"application/json"},t)})}createPushTarget(e,t,n){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "targetId"');if(typeof t>"u")throw new d('Missing required parameter: "identifier"');let i="/account/targets/push",r={};typeof e<"u"&&(r.targetId=e),typeof t<"u"&&(r.identifier=t),typeof n<"u"&&(r.providerId=n);let a=new URL(this.client.config.endpoint+i);return yield this.client.call("post",a,{"content-type":"application/json"},r)})}updatePushTarget(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "targetId"');if(typeof t>"u")throw new d('Missing required parameter: "identifier"');let n="/account/targets/{targetId}/push".replace("{targetId}",e),i={};typeof t<"u"&&(i.identifier=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}deletePushTarget(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "targetId"');let t="/account/targets/{targetId}/push".replace("{targetId}",e),n={},i=new URL(this.client.config.endpoint+t);return yield this.client.call("delete",i,{"content-type":"application/json"},n)})}createEmailToken(e,t,n){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "email"');let i="/account/tokens/email",r={};typeof e<"u"&&(r.userId=e),typeof t<"u"&&(r.email=t),typeof n<"u"&&(r.phrase=n);let a=new URL(this.client.config.endpoint+i);return yield this.client.call("post",a,{"content-type":"application/json"},r)})}createMagicURLToken(e,t,n,i){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "email"');let r="/account/tokens/magic-url",a={};typeof e<"u"&&(a.userId=e),typeof t<"u"&&(a.email=t),typeof n<"u"&&(a.url=n),typeof i<"u"&&(a.phrase=i);let p=new URL(this.client.config.endpoint+r);return yield this.client.call("post",p,{"content-type":"application/json"},a)})}createOAuth2Token(e,t,n,i){if(typeof e>"u")throw new d('Missing required parameter: "provider"');let r="/account/tokens/oauth2/{provider}".replace("{provider}",e),a={};typeof t<"u"&&(a.success=t),typeof n<"u"&&(a.failure=n),typeof i<"u"&&(a.scopes=i);let p=new URL(this.client.config.endpoint+r);a.project=this.client.config.project;for(let[f,y]of Object.entries(L.flatten(a)))p.searchParams.append(f,y);if(typeof window<"u"&&window?.location)window.location.href=p.toString();else return p}createPhoneToken(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "phone"');let n="/account/tokens/phone",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.phone=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("post",r,{"content-type":"application/json"},i)})}createVerification(e){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "url"');let t="/account/verification",n={};typeof e<"u"&&(n.url=e);let i=new URL(this.client.config.endpoint+t);return yield this.client.call("post",i,{"content-type":"application/json"},n)})}updateVerification(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');let n="/account/verification",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.secret=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}createPhoneVerification(){return u(this,void 0,void 0,function*(){let e="/account/verification/phone",t={},n=new URL(this.client.config.endpoint+e);return yield this.client.call("post",n,{"content-type":"application/json"},t)})}updatePhoneVerification(e,t){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "userId"');if(typeof t>"u")throw new d('Missing required parameter: "secret"');let n="/account/verification/phone",i={};typeof e<"u"&&(i.userId=e),typeof t<"u"&&(i.secret=t);let r=new URL(this.client.config.endpoint+n);return yield this.client.call("put",r,{"content-type":"application/json"},i)})}};var z=class extends L{constructor(e){super(e)}listDocuments(e,t,n){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "databaseId"');if(typeof t>"u")throw new d('Missing required parameter: "collectionId"');let i="/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}",e).replace("{collectionId}",t),r={};typeof n<"u"&&(r.queries=n);let a=new URL(this.client.config.endpoint+i);return yield this.client.call("get",a,{"content-type":"application/json"},r)})}createDocument(e,t,n,i,r){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "databaseId"');if(typeof t>"u")throw new d('Missing required parameter: "collectionId"');if(typeof n>"u")throw new d('Missing required parameter: "documentId"');if(typeof i>"u")throw new d('Missing required parameter: "data"');let a="/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}",e).replace("{collectionId}",t),p={};typeof n<"u"&&(p.documentId=n),typeof i<"u"&&(p.data=i),typeof r<"u"&&(p.permissions=r);let f=new URL(this.client.config.endpoint+a);return yield this.client.call("post",f,{"content-type":"application/json"},p)})}getDocument(e,t,n,i){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "databaseId"');if(typeof t>"u")throw new d('Missing required parameter: "collectionId"');if(typeof n>"u")throw new d('Missing required parameter: "documentId"');let r="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",t).replace("{documentId}",n),a={};typeof i<"u"&&(a.queries=i);let p=new URL(this.client.config.endpoint+r);return yield this.client.call("get",p,{"content-type":"application/json"},a)})}updateDocument(e,t,n,i,r){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "databaseId"');if(typeof t>"u")throw new d('Missing required parameter: "collectionId"');if(typeof n>"u")throw new d('Missing required parameter: "documentId"');let a="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",t).replace("{documentId}",n),p={};typeof i<"u"&&(p.data=i),typeof r<"u"&&(p.permissions=r);let f=new URL(this.client.config.endpoint+a);return yield this.client.call("patch",f,{"content-type":"application/json"},p)})}deleteDocument(e,t,n){return u(this,void 0,void 0,function*(){if(typeof e>"u")throw new d('Missing required parameter: "databaseId"');if(typeof t>"u")throw new d('Missing required parameter: "collectionId"');if(typeof n>"u")throw new d('Missing required parameter: "documentId"');let i="/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}",e).replace("{collectionId}",t).replace("{documentId}",n),r={},a=new URL(this.client.config.endpoint+i);return yield this.client.call("delete",a,{"content-type":"application/json"},r)})}};var fe=class{static custom(e){return e}static unique(){return"unique()"}};var T={endpoint:"https://appwrite.athendat.site/v1",projectId:"66155cd90000d0ae0905",databaseId:"mtwdagbaovumldupdrqzxkmbztocdjyz",articleCollectionId:"661566cb002b572a3a34",commentsCollectionId:"6626d9be003cb2339a7f",galleryCollectionId:"6615668c000db3efd54d",productsCollectionId:"661565e4000bf58161b9",messagesCollectionId:"6622c4e5003d12032ba3",teamCollectionId:"6615657f0034c248b367",assistanceCollectionId:"services",settingsCollectionId:"6627e2c4000093edb1b4",production:!1,cloudName:"autochapt"};var Me=new G("Appwrite Config",{providedIn:"root",factory(){let{endpoint:s,projectId:e,databaseId:t,articleCollectionId:n,galleryCollectionId:i,productsCollectionId:r,teamCollectionId:a,assistanceCollectionId:p,messagesCollectionId:f}=T;return{endpoint:s,databaseId:t,projectId:e,articleCollectionId:n,galleryCollectionId:i,productsCollectionId:r,teamCollectionId:a,assistanceCollectionId:p,messagesCollectionId:f}}}),le=new G("Appwrite SDK",{providedIn:"root",factory(){let s=k(Me),e=new N;e.setEndpoint(s.endpoint),e.setProject(s.projectId);let t=new z(e),n=new O(e);return{database:t,account:n}}});var je={isLoading:!0,info:{$id:"",$createdAt:"",name:"",nit:"",emails:[],phones:[],schedules:[],address:"",country:"",province:"",city:"",zip:"",concept:"",mission:"",vision:"",social_object:[]}},ze=ie({providedIn:"root"},re(je),oe((s,e=k(le))=>({load(){return Z(this,null,function*(){J(s,{isLoading:!0});let n=yield e.database.listDocuments(T.databaseId,T.settingsCollectionId),r=JSON.parse(JSON.stringify(n.documents)).map(a=>({$id:a.$id,$createdAt:a.$createdAt,name:a.name,nit:a.nit,emails:a.emails,phones:a.phones,schedules:a.schedules,address:a.address,country:a.country,province:a.province,city:a.city,zip:a.zip,concept:a.concept,mission:a.mission,vision:a.vision,social_object:a.social_object}))[0];J(s,{info:r,isLoading:!1})})}})));export{J as a,ie as b,oe as c,re as d,Le as e,fe as f,T as g,le as h,ze as i};