altair-static
Version:
Static package for altair graphql client
6 lines (5 loc) • 15.9 kB
JavaScript
function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="35e54168-cb64-549c-ab1b-7b6a4dabb875")}catch(e){}}();
(self.webpackChunkaltair=self.webpackChunkaltair||[]).push([[15],{49015:(Ut,ht,at)=>{function y(e){return Array.isArray?Array.isArray(e):"[object Array]"===V(e)}at.d(ht,{A:()=>Gt});function E(e){return"string"==typeof e}function Y(e){return"number"==typeof e}function G(e){return"object"==typeof e}function m(e){return null!=e}function T(e){return!e.trim().length}function V(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const _t=e=>`Missing ${e} property in key`,xt=e=>`Property 'weight' in key '${e}' must be a positive integer`,U=Object.prototype.hasOwnProperty;class yt{constructor(t){this._keys=[],this._keyMap={};let s=0;t.forEach(n=>{let r=Q(n);s+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,s+=r.weight}),this._keys.forEach(n=>{n.weight/=s})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Q(e){let t=null,s=null,n=null,r=1;if(E(e)||y(e))n=e,t=X(e),s=F(e);else{if(!U.call(e,"name"))throw new Error(_t("name"));const c=e.name;if(n=c,U.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(xt(c));t=X(c),s=F(c)}return{path:t,id:s,weight:r,src:n}}function X(e){return y(e)?e:e.split(".")}function F(e){return y(e)?e.join("."):e}var f={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function Et(e,t){let s=[],n=!1;const r=(c,i,h)=>{if(m(c))if(i[h]){const o=c[i[h]];if(!m(o))return;if(h===i.length-1&&(E(o)||Y(o)||function dt(e){return!0===e||!1===e||function gt(e){return G(e)&&null!==e}(e)&&"[object Boolean]"==V(e)}(o)))s.push(function ft(e){return null==e?"":function ut(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(y(o)){n=!0;for(let l=0,u=o.length;l<u;l+=1)r(o[l],i,h+1)}else i.length&&r(o,i,h+1)}else s.push(c)};return r(e,E(t)?t.split("."):t,0),n?s:s[0]},ignoreLocation:!1,ignoreFieldNorm:!1};const It=/[^ ]+/g;class P{constructor({getFn:t=f.getFn}={}){this.norm=function At(e=3){const t=new Map,s=Math.pow(10,e);return{get(n){const r=n.match(It).length;if(t.has(r))return t.get(r);const c=1/Math.sqrt(r),i=parseFloat(Math.round(c*s)/s);return t.set(r,i),i},clear(){t.clear()}}}(3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,E(this.docs[0])?this.docs.forEach((t,s)=>{this._addString(t,s)}):this.docs.forEach((t,s)=>{this._addObject(t,s)}),this.norm.clear())}add(t){const s=this.size();E(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let s=t,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(t,s){return t[this._keysMap[s]]}size(){return this.records.length}_addString(t,s){if(!m(t)||T(t))return;let n={v:t,i:s,n:this.norm.get(t)};this.records.push(n)}_addObject(t,s){let n={i:s,$:{}};this.keys.forEach((r,c)=>{let i=this.getFn(t,r.path);if(m(i))if(y(i)){let h=[];const a=[{nestedArrIndex:-1,value:i}];for(;a.length;){const{nestedArrIndex:o,value:l}=a.pop();if(m(l))if(E(l)&&!T(l)){let u={v:l,i:o,n:this.norm.get(l)};h.push(u)}else y(l)&&l.forEach((u,d)=>{a.push({nestedArrIndex:d,value:u})})}n.$[c]=h}else if(!T(i)){let h={v:i,n:this.norm.get(i)};n.$[c]=h}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function J(e,t,{getFn:s=f.getFn}={}){const n=new P({getFn:s});return n.setKeys(e.map(Q)),n.setSources(t),n.create(),n}function St(e,{getFn:t=f.getFn}={}){const{keys:s,records:n}=e,r=new P({getFn:t});return r.setKeys(s),r.setIndexRecords(n),r}function C(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:r=f.distance,ignoreLocation:c=f.ignoreLocation}={}){const i=t/e.length;if(c)return i;const h=Math.abs(n-s);return r?i+h/r:h?1:i}const L=32;function bt(e){let t={};for(let s=0,n=e.length;s<n;s+=1){const r=e.charAt(s);t[r]=(t[r]||0)|1<<n-s-1}return t}class Z{constructor(t,{location:s=f.location,threshold:n=f.threshold,distance:r=f.distance,includeMatches:c=f.includeMatches,findAllMatches:i=f.findAllMatches,minMatchCharLength:h=f.minMatchCharLength,isCaseSensitive:a=f.isCaseSensitive,ignoreLocation:o=f.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:r,includeMatches:c,findAllMatches:i,minMatchCharLength:h,isCaseSensitive:a,ignoreLocation:o},this.pattern=a?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(d,g)=>{this.chunks.push({pattern:d,alphabet:bt(d),startIndex:g})},u=this.pattern.length;if(u>L){let d=0;const g=u%L,p=u-g;for(;d<p;)l(this.pattern.substr(d,L),d),d+=L;if(g){const M=u-L;l(this.pattern.substr(M),M)}}else l(this.pattern,0)}searchIn(t){const{isCaseSensitive:s,includeMatches:n}=this.options;if(s||(t=t.toLowerCase()),this.pattern===t){let p={isMatch:!0,score:0};return n&&(p.indices=[[0,t.length-1]]),p}const{location:r,distance:c,threshold:i,findAllMatches:h,minMatchCharLength:a,ignoreLocation:o}=this.options;let l=[],u=0,d=!1;this.chunks.forEach(({pattern:p,alphabet:M,startIndex:b})=>{const{isMatch:I,score:R,indices:k}=function Lt(e,t,s,{location:n=f.location,distance:r=f.distance,threshold:c=f.threshold,findAllMatches:i=f.findAllMatches,minMatchCharLength:h=f.minMatchCharLength,includeMatches:a=f.includeMatches,ignoreLocation:o=f.ignoreLocation}={}){if(t.length>L)throw new Error("Pattern length exceeds max of 32.");const l=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let g=c,p=d;const M=h>1||a,b=M?Array(u):[];let I;for(;(I=e.indexOf(t,p))>-1;){let _=C(t,{currentLocation:I,expectedLocation:d,distance:r,ignoreLocation:o});if(g=Math.min(_,g),p=I+l,M){let S=0;for(;S<l;)b[I+S]=1,S+=1}}p=-1;let R=[],k=1,v=l+u;const Vt=1<<l-1;for(let _=0;_<l;_+=1){let S=0,w=v;for(;S<w;)C(t,{errors:_,currentLocation:d+w,expectedLocation:d,distance:r,ignoreLocation:o})<=g?S=w:v=w,w=Math.floor((v-S)/2+S);v=w;let ct=Math.max(1,d-w+1),W=i?u:Math.min(d+w,u)+l,O=Array(W+2);O[W+1]=(1<<_)-1;for(let x=W;x>=ct;x-=1){let N=x-1,ot=s[e.charAt(N)];if(M&&(b[N]=+!!ot),O[x]=(O[x+1]<<1|1)&ot,_&&(O[x]|=(R[x+1]|R[x])<<1|1|R[x+1]),O[x]&Vt&&(k=C(t,{errors:_,currentLocation:N,expectedLocation:d,distance:r,ignoreLocation:o}),k<=g)){if(g=k,p=N,p<=d)break;ct=Math.max(1,2*d-p)}}if(C(t,{errors:_+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:o})>g)break;R=O}const H={isMatch:p>=0,score:Math.max(.001,k)};if(M){const _=function wt(e=[],t=f.minMatchCharLength){let s=[],n=-1,r=-1,c=0;for(let i=e.length;c<i;c+=1){let h=e[c];h&&-1===n?n=c:!h&&-1!==n&&(r=c-1,r-n+1>=t&&s.push([n,r]),n=-1)}return e[c-1]&&c-n>=t&&s.push([n,c-1]),s}(b,h);_.length?a&&(H.indices=_):H.isMatch=!1}return H}(t,p,M,{location:r+b,distance:c,threshold:i,findAllMatches:h,minMatchCharLength:a,includeMatches:n,ignoreLocation:o});I&&(d=!0),u+=R,I&&k&&(l=[...l,...k])});let g={isMatch:d,score:d?u/this.chunks.length:1};return d&&n&&(g.indices=l),g}}class A{constructor(t){this.pattern=t}static isMultiMatch(t){return q(t,this.multiRegex)}static isSingleMatch(t){return q(t,this.singleRegex)}search(){}}function q(e,t){const s=e.match(t);return s?s[1]:null}class tt extends A{constructor(t,{location:s=f.location,threshold:n=f.threshold,distance:r=f.distance,includeMatches:c=f.includeMatches,findAllMatches:i=f.findAllMatches,minMatchCharLength:h=f.minMatchCharLength,isCaseSensitive:a=f.isCaseSensitive,ignoreLocation:o=f.ignoreLocation}={}){super(t),this._bitapSearch=new Z(t,{location:s,threshold:n,distance:r,includeMatches:c,findAllMatches:i,minMatchCharLength:h,isCaseSensitive:a,ignoreLocation:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class et extends A{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n,s=0;const r=[],c=this.pattern.length;for(;(n=t.indexOf(this.pattern,s))>-1;)s=n+c,r.push([n,s-1]);const i=!!r.length;return{isMatch:i,score:i?0:1,indices:r}}}const j=[class kt extends A{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const s=t===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},et,class Ot extends A{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const s=t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},class $t extends A{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const s=!t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}},class vt extends A{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const s=!t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}},class Ct extends A{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const s=t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class Rt extends A{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=-1===t.indexOf(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}},tt],st=j.length,Nt=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,Pt=new Set([tt.type,et.type]),K=[];function z(e,t){for(let s=0,n=K.length;s<n;s+=1){let r=K[s];if(r.condition(e,t))return new r(e,t)}return new Z(e,t)}const $_AND="$and",D=e=>!(!e.$and&&!e.$or),nt=e=>({[$_AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function rt(e,t,{auto:s=!0}={}){const n=r=>{let c=Object.keys(r);const i=(e=>!!e.$path)(r);if(!i&&c.length>1&&!D(r))return n(nt(r));if((e=>!y(e)&&G(e)&&!D(e))(r)){const a=i?r.$path:c[0],o=i?r.$val:r[a];if(!E(o))throw new Error((e=>`Invalid value for key ${e}`)(a));const l={keyId:F(a),pattern:o};return s&&(l.searcher=z(o,t)),l}let h={children:[],operator:c[0]};return c.forEach(a=>{const o=r[a];y(o)&&o.forEach(l=>{h.children.push(n(l))})}),h};return D(e)||(e=nt(e)),n(e)}function Ht(e,t){const s=e.matches;t.matches=[],m(s)&&s.forEach(n=>{if(!m(n.indices)||!n.indices.length)return;const{indices:r,value:c}=n;let i={indices:r,value:c};n.key&&(i.key=n.key.src),n.idx>-1&&(i.refIndex=n.idx),t.matches.push(i)})}function Wt(e,t){t.score=e.score}let it=(()=>{class e{constructor(s,n={},r){this.options={...f,...n},this._keyStore=new yt(this.options.keys),this.setCollection(s,r)}setCollection(s,n){if(this._docs=s,n&&!(n instanceof P))throw new Error("Incorrect 'index' type");this._myIndex=n||J(this.options.keys,this._docs,{getFn:this.options.getFn})}add(s){m(s)&&(this._docs.push(s),this._myIndex.add(s))}remove(s=()=>!1){const n=[];for(let r=0,c=this._docs.length;r<c;r+=1){const i=this._docs[r];s(i,r)&&(this.removeAt(r),r-=1,c-=1,n.push(i))}return n}removeAt(s){this._docs.splice(s,1),this._myIndex.removeAt(s)}getIndex(){return this._myIndex}search(s,{limit:n=-1}={}){const{includeMatches:r,includeScore:c,shouldSort:i,sortFn:h,ignoreFieldNorm:a}=this.options;let o=E(s)?E(this._docs[0])?this._searchStringList(s):this._searchObjectList(s):this._searchLogical(s);return function Dt(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(s=>{let n=1;s.matches.forEach(({key:r,norm:c,score:i})=>{const h=r?r.weight:null;n*=Math.pow(0===i&&h?Number.EPSILON:i,(h||1)*(t?1:c))}),s.score=n})}(o,{ignoreFieldNorm:a}),i&&o.sort(h),Y(n)&&n>-1&&(o=o.slice(0,n)),function Yt(e,t,{includeMatches:s=f.includeMatches,includeScore:n=f.includeScore}={}){const r=[];return s&&r.push(Ht),n&&r.push(Wt),e.map(c=>{const{idx:i}=c,h={item:t[i],refIndex:i};return r.length&&r.forEach(a=>{a(c,h)}),h})}(o,this._docs,{includeMatches:r,includeScore:c})}_searchStringList(s){const n=z(s,this.options),{records:r}=this._myIndex,c=[];return r.forEach(({v:i,i:h,n:a})=>{if(!m(i))return;const{isMatch:o,score:l,indices:u}=n.searchIn(i);o&&c.push({item:i,idx:h,matches:[{score:l,value:i,norm:a,indices:u}]})}),c}_searchLogical(s){const n=rt(s,this.options),r=(a,o,l)=>{if(!a.children){const{keyId:u,searcher:d}=a,g=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(o,u),searcher:d});return g&&g.length?[{idx:l,item:o,matches:g}]:[]}switch(a.operator){case"$and":{const u=[];for(let d=0,g=a.children.length;d<g;d+=1){const M=r(a.children[d],o,l);if(!M.length)return[];u.push(...M)}return u}case"$or":{const u=[];for(let d=0,g=a.children.length;d<g;d+=1){const M=r(a.children[d],o,l);if(M.length){u.push(...M);break}}return u}}},i={},h=[];return this._myIndex.records.forEach(({$:a,i:o})=>{if(m(a)){let l=r(n,a,o);l.length&&(i[o]||(i[o]={idx:o,item:a,matches:[]},h.push(i[o])),l.forEach(({matches:u})=>{i[o].matches.push(...u)}))}}),h}_searchObjectList(s){const n=z(s,this.options),{keys:r,records:c}=this._myIndex,i=[];return c.forEach(({$:h,i:a})=>{if(!m(h))return;let o=[];r.forEach((l,u)=>{o.push(...this._findMatches({key:l,value:h[u],searcher:n}))}),o.length&&i.push({idx:a,item:h,matches:o})}),i}_findMatches({key:s,value:n,searcher:r}){if(!m(n))return[];let c=[];if(y(n))n.forEach(({v:i,i:h,n:a})=>{if(!m(i))return;const{isMatch:o,score:l,indices:u}=r.searchIn(i);o&&c.push({score:l,key:s,value:i,idx:h,norm:a,indices:u})});else{const{v:i,n:h}=n,{isMatch:a,score:o,indices:l}=r.searchIn(i);a&&c.push({score:o,key:s,value:i,norm:h,indices:l})}return c}}return e.version="6.4.6",e.createIndex=J,e.parseIndex=St,e.config=f,e})();it.parseQuery=rt,function Kt(...e){K.push(...e)}(class jt{constructor(t,{isCaseSensitive:s=f.isCaseSensitive,includeMatches:n=f.includeMatches,minMatchCharLength:r=f.minMatchCharLength,ignoreLocation:c=f.ignoreLocation,findAllMatches:i=f.findAllMatches,location:h=f.location,threshold:a=f.threshold,distance:o=f.distance}={}){this.query=null,this.options={isCaseSensitive:s,includeMatches:n,minMatchCharLength:r,findAllMatches:i,ignoreLocation:c,location:h,threshold:a,distance:o},this.pattern=s?t:t.toLowerCase(),this.query=function Ft(e,t={}){return e.split("|").map(s=>{let n=s.trim().split(Nt).filter(c=>c&&!!c.trim()),r=[];for(let c=0,i=n.length;c<i;c+=1){const h=n[c];let a=!1,o=-1;for(;!a&&++o<st;){const l=j[o];let u=l.isMultiMatch(h);u&&(r.push(new l(u,t)),a=!0)}if(!a)for(o=-1;++o<st;){const l=j[o];let u=l.isSingleMatch(h);if(u){r.push(new l(u,t));break}}}return r})}(this.pattern,this.options)}static condition(t,s){return s.useExtendedSearch}searchIn(t){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r}=this.options;t=r?t:t.toLowerCase();let c=0,i=[],h=0;for(let a=0,o=s.length;a<o;a+=1){const l=s[a];i.length=0,c=0;for(let u=0,d=l.length;u<d;u+=1){const g=l[u],{isMatch:p,indices:M,score:b}=g.search(t);if(!p){h=0,c=0,i.length=0;break}c+=1,h+=b,n&&(Pt.has(g.constructor.type)?i=[...i,...M]:i.push(M))}if(c){let u={isMatch:!0,score:h/c};return n&&(u.indices=i),u}}return{isMatch:!1,score:1}}});const Gt=it}}]);
//# sourceMappingURL=15.js.map
//# debugId=35e54168-cb64-549c-ab1b-7b6a4dabb875
;
!