altair-static 4.4.0 → 4.5.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.
package/build/dist/100.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[100],{22100:(se,Q,S)=>{S.r(Q),S.d(Q,{GraphQLWsSubscriptionProvider:()=>_});var H=S(71251),J=S(82475),h=S(8239);const E=Object.prototype.hasOwnProperty;function C(e){return"object"==typeof e&&null!==e}function O(e,n){return E.call(e,n)}function A(e,n){return E.call(e,n)&&C(e[n])}function w(e,n){return E.call(e,n)&&"string"==typeof e[n]}const K="graphql-transport-ws";var s=(()=>{return(e=s||(s={})).ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",s;var e})();function G(e){if(C(e)){if(!w(e,"type"))return!1;switch(e.type){case s.ConnectionInit:return!O(e,"payload")||void 0===e.payload||C(e.payload);case s.ConnectionAck:case s.Ping:case s.Pong:return!O(e,"payload")||void 0===e.payload||C(e.payload);case s.Subscribe:return w(e,"id")&&A(e,"payload")&&(!O(e.payload,"operationName")||null==e.payload.operationName||"string"==typeof e.payload.operationName)&&w(e.payload,"query")&&(!O(e.payload,"variables")||null==e.payload.variables||A(e.payload,"variables"))&&(!O(e.payload,"extensions")||null==e.payload.extensions||A(e.payload,"extensions"));case s.Next:return w(e,"id")&&A(e,"payload");case s.Error:return w(e,"id")&&function(e){return Array.isArray(e)&&e.length>0&&e.every(n=>"message"in n)}(e.payload);case s.Complete:return w(e,"id");default:return!1}}return!1}function V(e,n){if(G(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const l=JSON.parse(e,n);if(!G(l))throw new Error("Invalid message");return l}function N(e,n){if(!G(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,n)}function v(e){return C(e)&&"code"in e&&"reason"in e}class _ extends H.q{createClient(){this.client=function(e){const{url:n,connectionParams:l,lazy:y=!0,onNonLazyError:R=console.error,lazyCloseTimeout:M=0,keepAlive:T=0,disablePong:ee,retryAttempts:q=5,retryWait:ne=function(){var t=(0,h.Z)(function*(c){let i=1e3;for(let o=0;o<c;o++)i*=2;yield new Promise(o=>setTimeout(o,i+Math.floor(2700*Math.random()+300)))});return function(c){return t.apply(this,arguments)}}(),isFatalConnectionProblem:te=(t=>!v(t)),on:r,webSocketImpl:Z,generateID:re=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,u=>{const c=16*Math.random()|0;return("x"==u?c:3&c|8).toString(16)})},jsonMessageReplacer:z,jsonMessageReviver:oe}=e;let b;if(Z){if(!function(e){return"function"==typeof e&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}(Z))throw new Error("Invalid WebSocket implementation provided");b=Z}else"undefined"!=typeof WebSocket?b=WebSocket:"undefined"!=typeof global?b=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing");const k=b,p=(()=>{const t=(()=>{const c={};return{on:(i,o)=>(c[i]=o,()=>{delete c[i]}),emit(i){var o;"id"in i&&(null===(o=c[i.id])||void 0===o||o.call(c,i))}}})(),u={connecting:(null==r?void 0:r.connecting)?[r.connecting]:[],connected:(null==r?void 0:r.connected)?[r.connected]:[],ping:(null==r?void 0:r.ping)?[r.ping]:[],pong:(null==r?void 0:r.pong)?[r.pong]:[],message:(null==r?void 0:r.message)?[t.emit,r.message]:[t.emit],closed:(null==r?void 0:r.closed)?[r.closed]:[],error:(null==r?void 0:r.error)?[r.error]:[]};return{onMessage:t.on,on(c,i){const o=u[c];return o.push(i),()=>{o.splice(o.indexOf(i),1)}},emit(c,...i){for(const o of u[c])o(...i)}}})();let m,g=0,F=!1,I=0,U=!1;function j(){return D.apply(this,arguments)}function D(){return(D=(0,h.Z)(function*(){const[t,u]=yield null!=m?m:m=new Promise((o,x)=>(0,h.Z)(function*(){if(F){if(yield ne(I),!g)return m=void 0,x({code:1e3,reason:"All Subscriptions Gone"});I++}p.emit("connecting");const a=new k("function"==typeof n?yield n():n,K);let P;function W(){isFinite(T)&&T>0&&(clearTimeout(P),P=setTimeout(()=>{a.readyState===k.OPEN&&(a.send(N({type:s.Ping})),p.emit("ping",!1,void 0))},T))}a.onerror=f=>{p.emit("error",f)},a.onclose=f=>{m=void 0,clearTimeout(P),p.emit("closed",f),x(f)},a.onopen=(0,h.Z)(function*(){try{a.send(N({type:s.ConnectionInit,payload:"function"==typeof l?yield l():l},z)),W()}catch(f){a.close(4400,f instanceof Error?f.message:new Error(f).message)}});let L=!1;a.onmessage=({data:f})=>{try{const d=V(f,oe);if(p.emit("message",d),"ping"===d.type||"pong"===d.type)return p.emit(d.type,!0,d.payload),void("pong"===d.type?W():ee||(a.send(N(d.payload?{type:s.Pong,payload:d.payload}:{type:s.Pong})),p.emit("pong",!1,d.payload)));if(L)return;if(d.type!==s.ConnectionAck)throw new Error(`First message cannot be of type ${d.type}`);L=!0,p.emit("connected",a,d.payload),F=!1,I=0,o([a,new Promise((le,ie)=>a.addEventListener("close",ie))])}catch(d){a.close(4400,d instanceof Error?d.message:new Error(d).message)}}})());t.readyState===k.CLOSING&&(yield u);let c=()=>{};const i=new Promise(o=>c=o);return[t,c,Promise.race([i.then(()=>{if(!g){const o=()=>t.close(1e3,"Normal Closure");isFinite(M)&&M>0?setTimeout(()=>{!g&&t.readyState===k.OPEN&&o()},M):o()}}),u])]})).apply(this,arguments)}function B(t){if(v(t)&&[1002,1011,4400,4401,4409,4429].includes(t.code))throw t;if(U)return!1;if(v(t)&&1e3===t.code)return g>0;if(!q||I>=q||te(t))throw t;return F=!0}return y||(0,h.Z)(function*(){for(g++;;)try{const[,,t]=yield j();yield t}catch(t){try{if(!B(t))return}catch(u){return null==R?void 0:R(u)}}})(),{on:p.on,subscribe(t,u){const c=re();let i=!1,o=!1,x=()=>{g--,i=!0};return(0,h.Z)(function*(){for(g++;;)try{const[a,P,W]=yield j();if(i)return P();const L=p.onMessage(c,f=>{switch(f.type){case s.Next:return void u.next(f.payload);case s.Error:return o=!0,i=!0,u.error(f.payload),void x();case s.Complete:return i=!0,void x()}});return a.send(N({id:c,type:s.Subscribe,payload:t},z)),x=()=>{!i&&a.readyState===k.OPEN&&a.send(N({id:c,type:s.Complete},z)),g--,i=!0,P()},void(yield W.finally(L))}catch(a){if(!B(a))return}})().catch(u.error).then(()=>{o||u.complete()}),()=>{i||x()}},dispose:()=>(0,h.Z)(function*(){if(U=!0,m){const[t]=yield m;t.close(1e3,"Normal Closure")}})()}}({url:this.subscriptionUrl,connectionParams:this.connectionParams,on:{connected:()=>{var n,l;null==(l=null==(n=this.extraOptions)?void 0:n.onConnected)||l.call(n,void 0,void 0)},error:n=>{var l,y;null==(y=null==(l=this.extraOptions)?void 0:l.onConnected)||y.call(l,n,void 0)}}})}execute(n){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new J.y(l=>this.client.subscribe({query:n.query,variables:n.variables,operationName:n.operationName},{next:(...y)=>l.next(...y),error:(...y)=>l.error(...y),complete:()=>l.complete()}))}close(){var n;null==(n=this.client)||n.dispose(),this.client=void 0}}}}]);
1
+ "use strict";(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[100],{22100:(pe,j,O)=>{O.r(j),O.d(j,{GraphQLWsSubscriptionProvider:()=>ae});var h=O(8239),Y=O(71251),_=O(82475);const W=Object.prototype.hasOwnProperty;function w(e){return"object"==typeof e&&null!==e}function N(e,n){return W.call(e,n)}function L(e,n){return W.call(e,n)&&w(e[n])}function S(e,n){return W.call(e,n)&&"string"==typeof e[n]}function H(e,n){return e.length<124?e:n}const ne="graphql-transport-ws";var y=(()=>{return(e=y||(y={}))[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",y;var e})(),l=(()=>{return(e=l||(l={})).ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",l;var e})();function z(e){if(w(e)){if(!S(e,"type"))return!1;switch(e.type){case l.ConnectionInit:return!N(e,"payload")||void 0===e.payload||w(e.payload);case l.ConnectionAck:case l.Ping:case l.Pong:return!N(e,"payload")||void 0===e.payload||w(e.payload);case l.Subscribe:return S(e,"id")&&L(e,"payload")&&(!N(e.payload,"operationName")||null==e.payload.operationName||"string"==typeof e.payload.operationName)&&S(e.payload,"query")&&(!N(e.payload,"variables")||null==e.payload.variables||L(e.payload,"variables"))&&(!N(e.payload,"extensions")||null==e.payload.extensions||L(e.payload,"extensions"));case l.Next:return S(e,"id")&&L(e,"payload");case l.Error:return S(e,"id")&&function(e){return Array.isArray(e)&&e.length>0&&e.every(n=>"message"in n)}(e.payload);case l.Complete:return S(e,"id");default:return!1}}return!1}function te(e,n){if(z(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const a=JSON.parse(e,n);if(!z(a))throw new Error("Invalid message");return a}function A(e,n){if(!z(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,n)}function G(e){return w(e)&&"code"in e&&"reason"in e}class ae extends Y.q{createClient(){this.client=function(e){const{url:n,connectionParams:a,lazy:m=!0,onNonLazyError:T=console.error,lazyCloseTimeout:B=0,keepAlive:M=0,disablePong:ce,connectionAckWaitTimeout:F=0,retryAttempts:J=5,retryWait:se=function(){var t=(0,h.Z)(function*(s){let o=1e3;for(let c=0;c<s;c++)o*=2;yield new Promise(c=>setTimeout(c,o+Math.floor(2700*Math.random()+300)))});return function(s){return t.apply(this,arguments)}}(),shouldRetry:le=G,isFatalConnectionProblem:Z,on:r,webSocketImpl:C,generateID:ue=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,u=>{const s=16*Math.random()|0;return("x"==u?s:3&s|8).toString(16)})},jsonMessageReplacer:D,jsonMessageReviver:de}=e;let P;if(C){if(!function(e){return"function"==typeof e&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}(C))throw new Error("Invalid WebSocket implementation provided");P=C}else"undefined"!=typeof WebSocket?P=WebSocket:"undefined"!=typeof global?P=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(P=window.WebSocket||window.MozWebSocket);if(!P)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const E=P,p=(()=>{const t=(()=>{const s={};return{on:(o,c)=>(s[o]=c,()=>{delete s[o]}),emit(o){var c;"id"in o&&(null===(c=s[o.id])||void 0===c||c.call(s,o))}}})(),u={connecting:(null==r?void 0:r.connecting)?[r.connecting]:[],opened:(null==r?void 0:r.opened)?[r.opened]:[],connected:(null==r?void 0:r.connected)?[r.connected]:[],ping:(null==r?void 0:r.ping)?[r.ping]:[],pong:(null==r?void 0:r.pong)?[r.pong]:[],message:(null==r?void 0:r.message)?[t.emit,r.message]:[t.emit],closed:(null==r?void 0:r.closed)?[r.closed]:[],error:(null==r?void 0:r.error)?[r.error]:[]};return{onMessage:t.on,on(s,o){const c=u[s];return c.push(o),()=>{c.splice(c.indexOf(o),1)}},emit(s,...o){for(const c of[...u[s]])c(...o)}}})();function $(t){const u=[p.on("error",s=>{u.forEach(o=>o()),t(s)}),p.on("closed",s=>{u.forEach(o=>o()),t(s)})]}let g,b=0,U=!1,q=0,K=!1;function V(){return Q.apply(this,arguments)}function Q(){return(Q=(0,h.Z)(function*(){const[t,u]=yield null!=g?g:g=new Promise((c,x)=>(0,h.Z)(function*(){if(U){if(yield se(q),!b)return g=void 0,x({code:1e3,reason:"All Subscriptions Gone"});q++}p.emit("connecting");const i=new E("function"==typeof n?yield n():n,ne);let k,R;function v(){isFinite(M)&&M>0&&(clearTimeout(R),R=setTimeout(()=>{i.readyState===E.OPEN&&(i.send(A({type:l.Ping})),p.emit("ping",!1,void 0))},M))}$(d=>{g=void 0,clearTimeout(k),clearTimeout(R),x(d),G(d)&&4499===d.code&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=d=>p.emit("error",d),i.onclose=d=>p.emit("closed",d),i.onopen=(0,h.Z)(function*(){try{p.emit("opened",i);const d="function"==typeof a?yield a():a;if(i.readyState!==E.OPEN)return;i.send(A(d?{type:l.ConnectionInit,payload:d}:{type:l.ConnectionInit},D)),isFinite(F)&&F>0&&(k=setTimeout(()=>{i.close(y.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},F)),v()}catch(d){p.emit("error",d),i.close(y.InternalClientError,H(d instanceof Error?d.message:new Error(d).message,"Internal client error"))}});let I=!1;i.onmessage=({data:d})=>{try{const f=te(d,de);if(p.emit("message",f),"ping"===f.type||"pong"===f.type)return p.emit(f.type,!0,f.payload),void("pong"===f.type?v():ce||(i.send(A(f.payload?{type:l.Pong,payload:f.payload}:{type:l.Pong})),p.emit("pong",!1,f.payload)));if(I)return;if(f.type!==l.ConnectionAck)throw new Error(`First message cannot be of type ${f.type}`);clearTimeout(k),I=!0,p.emit("connected",i,f.payload),U=!1,q=0,c([i,new Promise((be,fe)=>$(fe))])}catch(f){i.onmessage=null,p.emit("error",f),i.close(y.BadResponse,H(f instanceof Error?f.message:new Error(f).message,"Bad response"))}}})());t.readyState===E.CLOSING&&(yield u);let s=()=>{};const o=new Promise(c=>s=c);return[t,s,Promise.race([o.then(()=>{if(!b){const c=()=>t.close(1e3,"Normal Closure");isFinite(B)&&B>0?setTimeout(()=>{!b&&t.readyState===E.OPEN&&c()},B):c()}}),u])]})).apply(this,arguments)}function X(t){if(G(t)&&(function(e){return![1e3,1001,1006,1005,1012,1013,1013].includes(e)&&e>=1e3&&e<=1999}(t.code)||[y.InternalServerError,y.InternalClientError,y.BadRequest,y.BadResponse,y.Unauthorized,y.SubprotocolNotAcceptable,y.SubscriberAlreadyExists,y.TooManyInitialisationRequests].includes(t.code)))throw t;if(K)return!1;if(G(t)&&1e3===t.code)return b>0;if(!J||q>=J||!le(t)||(null==Z?void 0:Z(t)))throw t;return U=!0}return m||(0,h.Z)(function*(){for(b++;;)try{const[,,t]=yield V();yield t}catch(t){try{if(!X(t))return}catch(u){return null==T?void 0:T(u)}}})(),{on:p.on,subscribe(t,u){const s=ue();let o=!1,c=!1,x=()=>{b--,o=!0};return(0,h.Z)(function*(){for(b++;;)try{const[i,k,R]=yield V();if(o)return k();const v=p.onMessage(s,I=>{switch(I.type){case l.Next:return void u.next(I.payload);case l.Error:return c=!0,o=!0,u.error(I.payload),void x();case l.Complete:return o=!0,void x()}});return i.send(A({id:s,type:l.Subscribe,payload:t},D)),x=()=>{!o&&i.readyState===E.OPEN&&i.send(A({id:s,type:l.Complete},D)),b--,o=!0,k()},void(yield R.finally(v))}catch(i){if(!X(i))return}})().then(()=>{c||u.complete()}).catch(i=>{u.error(i)}),()=>{o||x()}},dispose:()=>(0,h.Z)(function*(){if(K=!0,g){const[t]=yield g;t.close(1e3,"Normal Closure")}})(),terminate(){g&&p.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}({url:this.subscriptionUrl,connectionParams:this.connectionParams,lazy:!1,onNonLazyError:n=>{var a,m;null==(m=null==(a=this.extraOptions)?void 0:a.onConnected)||m.call(a,n,void 0)},on:{connected:()=>{var n,a;null==(a=null==(n=this.extraOptions)?void 0:n.onConnected)||a.call(n,void 0,void 0)},error:n=>{var a,m;null==(m=null==(a=this.extraOptions)?void 0:a.onConnected)||m.call(a,n,void 0)}}})}execute(n){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new _.y(a=>{this.cleanup=this.client.subscribe({query:n.query,variables:n.variables,operationName:n.operationName},{next:(...m)=>a.next(...m),error:(...m)=>a.error(...m),complete:()=>a.complete()})})}close(){var n=this;return(0,h.Z)(function*(){var a,m;try{null==(a=n.cleanup)||a.call(n),n.cleanup=void 0,yield null==(m=n.client)?void 0:m.dispose(),n.client=void 0}catch(T){console.error(T)}})()}}}}]);