@mochabug/adapt-sdk 0.4.12 → 0.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var Z=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var je=(t,e)=>{for(var s in e)Z(t,s,{get:e[s],enumerable:!0})},Pe=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Oe(e))!Te.call(t,n)&&n!==s&&Z(t,n,{get:()=>e[n],enumerable:!(i=Le(e,n))||i.enumerable});return t};var Ke=t=>Pe(Z({},"__esModule",{value:!0}),t);var Ft={};je(Ft,{FormatChip:()=>xe,FormatViewer:()=>_e,SignalGroupHeader:()=>ke,SignalOption:()=>$e,SignalSearch:()=>ge,SignalSelector:()=>vt,createSignalFilter:()=>yt,flattenSignals:()=>St,getFormatLabel:()=>be,getSchemaDescription:()=>Ne,isArraySchema:()=>Dt,isEmptySchema:()=>we,isPrimitiveSchema:()=>Q,signalReferenceKey:()=>Y});module.exports=Ke(Ft);var D=require("react");function R(t){return Array.isArray?Array.isArray(t):ve(t)==="[object Array]"}var He=1/0;function Ve(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-He?"-0":e}function ze(t){return t==null?"":Ve(t)}function $(t){return typeof t=="string"}function ye(t){return typeof t=="number"}function Je(t){return t===!0||t===!1||We(t)&&ve(t)=="[object Boolean]"}function Se(t){return typeof t=="object"}function We(t){return Se(t)&&t!==null}function M(t){return t!=null}function q(t){return!t.trim().length}function ve(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}var Ge="Incorrect 'index' type",Ue=t=>`Invalid value for key ${t}`,Ye=t=>`Pattern length exceeds max of ${t}.`,Qe=t=>`Missing ${t} property in key`,Xe=t=>`Property 'weight' in key '${t}' must be a positive integer`,me=Object.prototype.hasOwnProperty,ee=class{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(i=>{let n=Fe(i);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(i=>{i.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Fe(t){let e=null,s=null,i=null,n=1,r=null;if($(t)||R(t))i=t,e=Ae(t),s=te(t);else{if(!me.call(t,"name"))throw new Error(Qe("name"));let o=t.name;if(i=o,me.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(Xe(o));e=Ae(o),s=te(o),r=t.getFn}return{path:e,id:s,weight:n,src:i,getFn:r}}function Ae(t){return R(t)?t:t.split(".")}function te(t){return R(t)?t.join("."):t}function Ze(t,e){let s=[],i=!1,n=(r,o,a)=>{if(M(r))if(!o[a])s.push(r);else{let c=o[a],l=r[c];if(!M(l))return;if(a===o.length-1&&($(l)||ye(l)||Je(l)))s.push(ze(l));else if(R(l)){i=!0;for(let u=0,g=l.length;u<g;u+=1)n(l[u],o,a+1)}else o.length&&n(l,o,a+1)}};return n(t,$(e)?e.split("."):e,0),i?s:s[0]}var qe={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},et={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},tt={location:0,threshold:.6,distance:100},st={useExtendedSearch:!1,getFn:Ze,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},p={...et,...qe,...tt,...st},nt=/[^ ]+/g;function it(t=1,e=3){let s=new Map,i=Math.pow(10,e);return{get(n){let r=n.match(nt).length;if(s.has(r))return s.get(r);let o=1/Math.pow(r,.5*t),a=parseFloat(Math.round(o*i)/i);return s.set(r,a),a},clear(){s.clear()}}}var K=class{constructor({getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){this.norm=it(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,i)=>{this._keysMap[s.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,$(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){let s=this.size();$(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,i=this.size();s<i;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!M(e)||q(e))return;let i={v:e,i:s,n:this.norm.get(e)};this.records.push(i)}_addObject(e,s){let i={i:s,$:{}};this.keys.forEach((n,r)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(M(o)){if(R(o)){let a=[],c=[{nestedArrIndex:-1,value:o}];for(;c.length;){let{nestedArrIndex:l,value:u}=c.pop();if(M(u))if($(u)&&!q(u)){let g={v:u,i:l,n:this.norm.get(u)};a.push(g)}else R(u)&&u.forEach((g,f)=>{c.push({nestedArrIndex:f,value:g})})}i.$[r]=a}else if($(o)&&!q(o)){let a={v:o,n:this.norm.get(o)};i.$[r]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}};function Me(t,e,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){let n=new K({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(Fe)),n.setSources(e),n.create(),n}function rt(t,{getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){let{keys:i,records:n}=t,r=new K({getFn:e,fieldNormWeight:s});return r.setKeys(i),r.setIndexRecords(n),r}function V(t,{errors:e=0,currentLocation:s=0,expectedLocation:i=0,distance:n=p.distance,ignoreLocation:r=p.ignoreLocation}={}){let o=e/t.length;if(r)return o;let a=Math.abs(i-s);return n?o+a/n:a?1:o}function ot(t=[],e=p.minMatchCharLength){let s=[],i=-1,n=-1,r=0;for(let o=t.length;r<o;r+=1){let a=t[r];a&&i===-1?i=r:!a&&i!==-1&&(n=r-1,n-i+1>=e&&s.push([i,n]),i=-1)}return t[r-1]&&r-i>=e&&s.push([i,r-1]),s}var O=32;function at(t,e,s,{location:i=p.location,distance:n=p.distance,threshold:r=p.threshold,findAllMatches:o=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,includeMatches:c=p.includeMatches,ignoreLocation:l=p.ignoreLocation}={}){if(e.length>O)throw new Error(Ye(O));let u=e.length,g=t.length,f=Math.max(0,Math.min(i,g)),m=r,A=f,E=a>1||c,S=E?Array(g):[],v;for(;(v=t.indexOf(e,A))>-1;){let y=V(e,{currentLocation:v,expectedLocation:f,distance:n,ignoreLocation:l});if(m=Math.min(y,m),A=v+u,E){let b=0;for(;b<u;)S[v+b]=1,b+=1}}A=-1;let F=[],w=1,N=u+g,T=1<<u-1;for(let y=0;y<u;y+=1){let b=0,B=N;for(;b<B;)V(e,{errors:y,currentLocation:f+B,expectedLocation:f,distance:n,ignoreLocation:l})<=m?b=B:N=B,B=Math.floor((N-b)/2+b);N=B;let H=Math.max(1,f-B+1),j=o?g:Math.min(f+B,g)+u,k=Array(j+2);k[j+1]=(1<<y)-1;for(let h=j;h>=H;h-=1){let C=h-1,I=s[t.charAt(C)];if(E&&(S[C]=+!!I),k[h]=(k[h+1]<<1|1)&I,y&&(k[h]|=(F[h+1]|F[h])<<1|1|F[h+1]),k[h]&T&&(w=V(e,{errors:y,currentLocation:C,expectedLocation:f,distance:n,ignoreLocation:l}),w<=m)){if(m=w,A=C,A<=f)break;H=Math.max(1,2*f-A)}}if(V(e,{errors:y+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:l})>m)break;F=k}let _={isMatch:A>=0,score:Math.max(.001,w)};if(E){let y=ot(S,a);y.length?c&&(_.indices=y):_.isMatch=!1}return _}function ct(t){let e={};for(let s=0,i=t.length;s<i;s+=1){let n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}var z=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t),J=class{constructor(e,{location:s=p.location,threshold:i=p.threshold,distance:n=p.distance,includeMatches:r=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,isCaseSensitive:c=p.isCaseSensitive,ignoreDiacritics:l=p.ignoreDiacritics,ignoreLocation:u=p.ignoreLocation}={}){if(this.options={location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:l,ignoreLocation:u},e=c?e:e.toLowerCase(),e=l?z(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let g=(m,A)=>{this.chunks.push({pattern:m,alphabet:ct(m),startIndex:A})},f=this.pattern.length;if(f>O){let m=0,A=f%O,E=f-A;for(;m<E;)g(this.pattern.substr(m,O),m),m+=O;if(A){let S=f-O;g(this.pattern.substr(S),S)}}else g(this.pattern,0)}searchIn(e){let{isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=i?z(e):e,this.pattern===e){let E={isMatch:!0,score:0};return n&&(E.indices=[[0,e.length-1]]),E}let{location:r,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:l,ignoreLocation:u}=this.options,g=[],f=0,m=!1;this.chunks.forEach(({pattern:E,alphabet:S,startIndex:v})=>{let{isMatch:F,score:w,indices:N}=at(e,E,S,{location:r+v,distance:o,threshold:a,findAllMatches:c,minMatchCharLength:l,includeMatches:n,ignoreLocation:u});F&&(m=!0),f+=w,F&&N&&(g=[...g,...N])});let A={isMatch:m,score:m?f/this.chunks.length:1};return m&&n&&(A.indices=g),A}},x=class{constructor(e){this.pattern=e}static isMultiMatch(e){return Ee(e,this.multiRegex)}static isSingleMatch(e){return Ee(e,this.singleRegex)}search(){}};function Ee(t,e){let s=t.match(e);return s?s[1]:null}var se=class extends x{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},ne=class extends x{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}},ie=class extends x{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},re=class extends x{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},oe=class extends x{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},ae=class extends x{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},W=class extends x{constructor(e,{location:s=p.location,threshold:i=p.threshold,distance:n=p.distance,includeMatches:r=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,isCaseSensitive:c=p.isCaseSensitive,ignoreDiacritics:l=p.ignoreDiacritics,ignoreLocation:u=p.ignoreLocation}={}){super(e),this._bitapSearch=new J(e,{location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:l,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},G=class extends x{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,i,n=[],r=this.pattern.length;for(;(i=e.indexOf(this.pattern,s))>-1;)s=i+r,n.push([i,s-1]);let o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}},ce=[se,G,ie,re,ae,oe,ne,W],Ce=ce.length,lt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ut="|";function dt(t,e={}){return t.split(ut).map(s=>{let i=s.trim().split(lt).filter(r=>r&&!!r.trim()),n=[];for(let r=0,o=i.length;r<o;r+=1){let a=i[r],c=!1,l=-1;for(;!c&&++l<Ce;){let u=ce[l],g=u.isMultiMatch(a);g&&(n.push(new u(g,e)),c=!0)}if(!c)for(l=-1;++l<Ce;){let u=ce[l],g=u.isSingleMatch(a);if(g){n.push(new u(g,e));break}}}return n})}var ht=new Set([W.type,G.type]),le=class{constructor(e,{isCaseSensitive:s=p.isCaseSensitive,ignoreDiacritics:i=p.ignoreDiacritics,includeMatches:n=p.includeMatches,minMatchCharLength:r=p.minMatchCharLength,ignoreLocation:o=p.ignoreLocation,findAllMatches:a=p.findAllMatches,location:c=p.location,threshold:l=p.threshold,distance:u=p.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n,minMatchCharLength:r,findAllMatches:a,ignoreLocation:o,location:c,threshold:l,distance:u},e=s?e:e.toLowerCase(),e=i?z(e):e,this.pattern=e,this.query=dt(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){let s=this.query;if(!s)return{isMatch:!1,score:1};let{includeMatches:i,isCaseSensitive:n,ignoreDiacritics:r}=this.options;e=n?e:e.toLowerCase(),e=r?z(e):e;let o=0,a=[],c=0;for(let l=0,u=s.length;l<u;l+=1){let g=s[l];a.length=0,o=0;for(let f=0,m=g.length;f<m;f+=1){let A=g[f],{isMatch:E,indices:S,score:v}=A.search(e);if(E){if(o+=1,c+=v,i){let F=A.constructor.type;ht.has(F)?a=[...a,...S]:a.push(S)}}else{c=0,o=0,a.length=0;break}}if(o){let f={isMatch:!0,score:c/o};return i&&(f.indices=a),f}}return{isMatch:!1,score:1}}},ue=[];function pt(...t){ue.push(...t)}function de(t,e){for(let s=0,i=ue.length;s<i;s+=1){let n=ue[s];if(n.condition(t,e))return new n(t,e)}return new J(t,e)}var U={AND:"$and",OR:"$or"},he={PATH:"$path",PATTERN:"$val"},pe=t=>!!(t[U.AND]||t[U.OR]),gt=t=>!!t[he.PATH],ft=t=>!R(t)&&Se(t)&&!pe(t),De=t=>({[U.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Be(t,e,{auto:s=!0}={}){let i=n=>{let r=Object.keys(n),o=gt(n);if(!o&&r.length>1&&!pe(n))return i(De(n));if(ft(n)){let c=o?n[he.PATH]:r[0],l=o?n[he.PATTERN]:n[c];if(!$(l))throw new Error(Ue(c));let u={keyId:te(c),pattern:l};return s&&(u.searcher=de(l,e)),u}let a={children:[],operator:r[0]};return r.forEach(c=>{let l=n[c];R(l)&&l.forEach(u=>{a.children.push(i(u))})}),a};return pe(t)||(t=De(t)),i(t)}function mt(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){t.forEach(s=>{let i=1;s.matches.forEach(({key:n,norm:r,score:o})=>{let a=n?n.weight:null;i*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),s.score=i})}function At(t,e){let s=t.matches;e.matches=[],M(s)&&s.forEach(i=>{if(!M(i.indices)||!i.indices.length)return;let{indices:n,value:r}=i,o={indices:n,value:r};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function Et(t,e){e.score=t.score}function Ct(t,e,{includeMatches:s=p.includeMatches,includeScore:i=p.includeScore}={}){let n=[];return s&&n.push(At),i&&n.push(Et),t.map(r=>{let{idx:o}=r,a={item:e[o],refIndex:o};return n.length&&n.forEach(c=>{c(r,a)}),a})}var L=class{constructor(e,s={},i){this.options={...p,...s},this.options.useExtendedSearch,this._keyStore=new ee(this.options.keys),this.setCollection(e,i)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof K))throw new Error(Ge);this._myIndex=s||Me(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){M(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let s=[];for(let i=0,n=this._docs.length;i<n;i+=1){let r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,s.push(r))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){let{includeMatches:i,includeScore:n,shouldSort:r,sortFn:o,ignoreFieldNorm:a}=this.options,c=$(e)?$(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return mt(c,{ignoreFieldNorm:a}),r&&c.sort(o),ye(s)&&s>-1&&(c=c.slice(0,s)),Ct(c,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){let s=de(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:l,indices:u}=s.searchIn(r);c&&n.push({item:r,idx:o,matches:[{score:l,value:r,norm:a,indices:u}]})}),n}_searchLogical(e){let s=Be(e,this.options),i=(a,c,l)=>{if(!a.children){let{keyId:g,searcher:f}=a,m=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(c,g),searcher:f});return m&&m.length?[{idx:l,item:c,matches:m}]:[]}let u=[];for(let g=0,f=a.children.length;g<f;g+=1){let m=a.children[g],A=i(m,c,l);if(A.length)u.push(...A);else if(a.operator===U.AND)return[]}return u},n=this._myIndex.records,r={},o=[];return n.forEach(({$:a,i:c})=>{if(M(a)){let l=i(s,a,c);l.length&&(r[c]||(r[c]={idx:c,item:a,matches:[]},o.push(r[c])),l.forEach(({matches:u})=>{r[c].matches.push(...u)}))}}),o}_searchObjectList(e){let s=de(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach(({$:o,i:a})=>{if(!M(o))return;let c=[];i.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:s}))}),c.length&&r.push({idx:a,item:o,matches:c})}),r}_findMatches({key:e,value:s,searcher:i}){if(!M(s))return[];let n=[];if(R(s))s.forEach(({v:r,i:o,n:a})=>{if(!M(r))return;let{isMatch:c,score:l,indices:u}=i.searchIn(r);c&&n.push({score:l,key:e,value:r,idx:o,norm:a,indices:u})});else{let{v:r,n:o}=s,{isMatch:a,score:c,indices:l}=i.searchIn(r);a&&n.push({score:c,key:e,value:r,norm:o,indices:l})}return n}};L.version="7.1.0";L.createIndex=Me;L.parseIndex=rt;L.config=p;L.parseQuery=Be;pt(le);var d=require("react/jsx-runtime");function Q(t){return t.type?!(Array.isArray(t.enum)&&t.enum.length>0)&&!t.elements&&!(t.properties&&Object.keys(t.properties).length>0)&&!(t.optionalProperties&&Object.keys(t.optionalProperties).length>0)&&!t.values&&!t.discriminator&&!t.ref:!1}function we(t){return!t.type&&!t.enum&&!t.elements&&!t.properties&&!t.optionalProperties&&!t.values&&!t.discriminator&&!t.ref}function Dt(t){return t.elements!==void 0}function Ne(t){return Q(t)?t.type:t.enum?`enum (${t.enum.length} values)`:t.elements?"array":t.properties||t.optionalProperties?`object (${(t.properties?Object.keys(t.properties).length:0)+(t.optionalProperties?Object.keys(t.optionalProperties).length:0)} properties)`:t.values?"map":t.discriminator?"discriminated union":t.ref?`ref: ${t.ref}`:we(t)?"empty schema":"complex schema"}function be(t){return t.mimeType?t.mimeType:t.jtdSchema?Ne(t.jtdSchema):"unknown"}var ge=class{fuse;data;constructor(e){this.fuse=new L(e,{includeScore:!1,threshold:.3,ignoreLocation:!0,useExtendedSearch:!0,keys:[{name:"node",weight:5},{name:"nodeLabel",weight:5},{name:"nodeDescription",weight:2},{name:"transmitter",weight:5},{name:"transmitterDescription",weight:2},{name:"signal.name",weight:5},{name:"signal.label",weight:5},{name:"signal.description",weight:2}]}),this.data=e}search(e){if(!e||e.trim().length===0)return this.fuse.search("").map(n=>n.item);if(!e.includes("/"))return this.fuse.search(e).map(n=>n.item);let s=e.split("/"),i="";return s[0]==="constant"&&s.length===2?s[1]?i={$and:[{node:"=constant"},{$or:[{"signal.name":s[1]},{"signal.label":s[1]},{"signal.description":s[1]}]}]}:i={node:"=constant"}:s.length===2&&s[1]===""&&s[0]?i={$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]}:s.length===2&&s[0]&&s[1]?i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length===3&&s[2]===""&&s[0]&&s[1]?i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length>=3&&s[0]&&s[1]&&s[2]&&(i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]},{$or:[{"signal.name":s[2]},{"signal.label":s[2]},{"signal.description":s[2]}]}]}),this.fuse.search(i).map(n=>n.item)}allSignals(){return this.data}};function yt(t){return(e,s)=>!s||s.length<2?e:t.search(s).sort((n,r)=>{let o=`${n.node}/${n.transmitter}`,a=`${r.node}/${r.transmitter}`;return o.localeCompare(a)})}function St(t){let e=[];for(let s of t.vertices??[])for(let i of s.transmitters??[])for(let n of i.signals??[])e.push({node:s.id??"",nodeLabel:s.label??s.id??"",nodeDescription:s.description,nodeLogoId:s.logoId,transmitter:i.name??"",transmitterDescription:i.description,transmitterMode:i.mode,signal:n});for(let s of t.constants??[])e.push({node:"constant",nodeLabel:"Constants",transmitter:"",signal:s});return e}function Y(t){return t.node==="constant"?`constant/${t.signal.name}`:`${t.node}/${t.transmitter}/${t.signal.name}`}function fe(){return(0,d.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[(0,d.jsx)("path",{d:"M4,7v2c0,0.55-0.45,1-1,1H2v4h1c0.55,0,1,0.45,1,1v2c0,1.65,1.35,3,3,3h3v-2H7c-0.55,0-1-0.45-1-1v-2 c0-1.3-0.84-2.42-2-2.83v-0.34C5.16,11.42,6,10.3,6,9V7c0-0.55,0.45-1,1-1h3V4H7C5.35,4,4,5.35,4,7z"}),(0,d.jsx)("path",{d:"M21,10c-0.55,0-1-0.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c0.55,0,1,0.45,1,1v2c0,1.3,0.84,2.42,2,2.83v0.34 c-1.16,0.41-2,1.52-2,2.83v2c0,0.55-0.45,1-1,1h-3v2h3c1.65,0,3-1.35,3-3v-2c0-0.55,0.45-1,1-1h1v-4H21z"})]})}function ke(t){if(t.group==="constant")return(0,d.jsxs)("div",{className:`adapt-signal-group-header adapt-signal-group-header--constant ${t.className??""}`.trim(),children:[(0,d.jsx)("span",{className:"adapt-signal-group-icon adapt-signal-group-icon--constant",children:(0,d.jsx)(fe,{})}),(0,d.jsx)("span",{className:"adapt-signal-group-node-label adapt-signal-group-node-label--constant",children:"Constants"})]});let[s,i]=t.group.split("/"),n=t.references.find(a=>`${a.node}/${a.transmitter}`===t.group);if(!n)return null;let r=n.transmitterMode,o=r==="MODE_FAILURE"?"adapt-signal-group-transmitter--failure":r==="MODE_STREAM"?"adapt-signal-group-transmitter--stream":"adapt-signal-group-transmitter--standard";return(0,d.jsxs)("div",{className:`adapt-signal-group-header ${t.className??""}`.trim(),children:[n.nodeIcon&&(0,d.jsx)("span",{className:"adapt-signal-group-icon",children:n.nodeIcon}),(0,d.jsx)("span",{className:"adapt-signal-group-node-label",children:n.nodeLabel||s}),(0,d.jsxs)("span",{className:"adapt-signal-group-node-id",children:["(",s,")"]}),(0,d.jsx)("span",{className:"adapt-signal-group-separator"}),(0,d.jsx)("span",{className:`adapt-signal-group-transmitter ${o}`,children:i})]})}function $e(t){let{reference:e}=t;return(0,d.jsxs)("div",{className:`adapt-signal-option ${t.className??""}`.trim(),children:[(0,d.jsxs)("div",{className:"adapt-signal-option-label",children:[(0,d.jsx)("span",{className:"adapt-signal-option-name",children:e.signal.label||e.signal.name}),e.signal.label&&(0,d.jsxs)("span",{className:"adapt-signal-option-code",children:["(",e.signal.name,")"]}),e.signal.optional&&(0,d.jsx)("span",{className:"adapt-signal-option-optional",children:"Optional"})]}),e.signal.formats&&(0,d.jsx)(_e,{formats:e.signal.formats})]})}function xe(t){let{format:e,size:s="small",onDelete:i,onClick:n}=t,r=be(e),o="primitive";e.mimeType?o="mime":e.jtdSchema&&!Q(e.jtdSchema)&&(o="complex");let a=o==="mime"||o==="complex";return(0,d.jsxs)("span",{className:`adapt-signal-format-chip adapt-signal-format-chip--${o} ${s==="medium"?"adapt-signal-format-chip--medium":""} ${t.className??""}`.trim(),onClick:n&&a?l=>{l.stopPropagation(),n()}:void 0,children:[r,i&&(0,d.jsx)("span",{className:"adapt-signal-format-chip-delete",onClick:l=>{l.stopPropagation(),i()},children:"\xD7"})]})}function _e(t){let{formats:e,maxVisible:s=3,onViewSchema:i}=t;if(e.length===0)return(0,d.jsx)("span",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:"No formats defined"});let n=[],r=0;for(let a=0;a<e.length;a++){let c=e[a];c&&(!c.mimeType&&!c.jtdSchema||(r++,n.length<s&&n.push((0,d.jsx)(xe,{format:c,onClick:i&&c.jtdSchema&&!Q(c.jtdSchema)?()=>i(c.jtdSchema):void 0},`fmt-${a}`))))}let o=r-n.length;return(0,d.jsxs)("div",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:[n,o>0&&(0,d.jsxs)("span",{className:"adapt-signal-format-overflow",children:["+",o]})]})}function vt({currentReference:t,inputValue:e,availableReferences:s,filterOptions:i,disabled:n,hasError:r,errorMessage:o,placeholder:a="Search signals...",className:c,theme:l="auto",onInputChange:u,onReferenceChange:g}){let[f,m]=(0,D.useState)(!1),[A,E]=(0,D.useState)(-1),S=(0,D.useRef)(null),v=(0,D.useRef)(null),F=(0,D.useRef)(null),w=(0,D.useCallback)(()=>{g(null),u(""),m(!0),E(0),setTimeout(()=>v.current?.focus(),0)},[g,u]),N=(0,D.useMemo)(()=>{let h=[...s];return i(h,e)},[s,e,i]),T=(0,D.useMemo)(()=>{let h=new Map;for(let C of N){let I=C.node==="constant"?"constant":`${C.node}/${C.transmitter}`,P=h.get(I);P?P.push(C):h.set(I,[C])}return h},[N]),_=(0,D.useMemo)(()=>{let h=[];for(let C of T.values())h.push(...C);return h},[T]);(0,D.useEffect)(()=>{function h(C){S.current&&!S.current.contains(C.target)&&m(!1)}return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);let y=(0,D.useCallback)(h=>{g(Y(h)),u(Y(h)),m(!1)},[g,u]),b=(0,D.useCallback)(h=>{if(t){if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),w();return}if(h.key==="ArrowDown"||h.key==="ArrowUp"||h.key==="Enter"){h.preventDefault(),g(null),u(""),m(!0),E(0),setTimeout(()=>v.current?.focus(),0);return}if(h.key.length===1&&!h.ctrlKey&&!h.metaKey){h.preventDefault(),g(null),u(h.key),m(!0),E(0),setTimeout(()=>v.current?.focus(),0);return}return}h.key==="ArrowDown"?(h.preventDefault(),f?E(C=>Math.min(C+1,_.length-1)):(m(!0),E(0))):h.key==="ArrowUp"?(h.preventDefault(),E(C=>Math.max(C-1,0))):h.key==="Enter"?(h.preventDefault(),f&&A>=0&&_[A]&&y(_[A])):h.key==="Escape"&&m(!1)},[t,w,g,u,f,A,_,y]);(0,D.useEffect)(()=>{F.current&&A>=0&&F.current.querySelectorAll("[data-signal-option]")[A]?.scrollIntoView({block:"nearest"})},[A]);let B=[],H=0;for(let[h,C]of T){B.push((0,d.jsx)(ke,{group:h,references:N},`group-${h}`));for(let I of C){let P=H++,Ie=P===A;B.push((0,d.jsx)("div",{"data-signal-option":!0,className:`adapt-signal-selector-option ${Ie?"adapt-signal-selector-option--highlighted":""}`,onMouseDown:Re=>{Re.preventDefault(),y(I)},onMouseEnter:()=>E(P),children:(0,d.jsx)($e,{reference:I})},Y(I)))}}let j=["adapt-signal-selector",r&&"adapt-signal-selector--error",c].filter(Boolean).join(" "),k=t?.node==="constant",X=t?k?"adapt-signal-selector-selected-dot--constant":t.transmitterMode==="MODE_FAILURE"?"adapt-signal-selector-selected-dot--failure":t.transmitterMode==="MODE_STREAM"?"adapt-signal-selector-selected-dot--stream":"adapt-signal-selector-selected-dot--standard":"";return(0,d.jsxs)("div",{ref:S,className:j,"data-adapt-theme":l==="auto"?void 0:l,children:[t&&!n&&(0,d.jsxs)("div",{className:"adapt-signal-selector-selected",onClick:w,children:[k?(0,d.jsx)("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:(0,d.jsx)(fe,{})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:`adapt-signal-selector-selected-dot ${X}`}),t.nodeIcon&&(0,d.jsx)("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-clear",onClick:h=>{h.stopPropagation(),w()},children:"\xD7"})]}),t&&n&&(0,d.jsxs)("div",{className:"adapt-signal-selector-selected adapt-signal-selector-selected--disabled",children:[k?(0,d.jsx)("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:(0,d.jsx)(fe,{})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:`adapt-signal-selector-selected-dot ${X}`}),t.nodeIcon&&(0,d.jsx)("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),(0,d.jsx)("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name})]}),(0,d.jsx)("input",{ref:v,type:"text",className:`adapt-signal-selector-input${t?" adapt-signal-selector-input--hidden":""}`,value:e,placeholder:a,disabled:n,onChange:h=>{u(h.target.value),m(!0),E(0),h.target.value||g(null)},onFocus:()=>{t||m(!0)},onKeyDown:b}),o&&(0,d.jsx)("span",{className:"adapt-signal-selector-error",children:o}),f&&!n&&(0,d.jsx)("div",{ref:F,className:"adapt-signal-selector-dropdown",children:_.length>0?B:(0,d.jsx)("div",{className:"adapt-signal-selector-no-results",children:"No signals found"})})]})}0&&(module.exports={FormatChip,FormatViewer,SignalGroupHeader,SignalOption,SignalSearch,SignalSelector,createSignalFilter,flattenSignals,getFormatLabel,getSchemaDescription,isArraySchema,isEmptySchema,isPrimitiveSchema,signalReferenceKey});
1
+ "use strict";var Z=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var ze=(t,e)=>{for(var s in e)Z(t,s,{get:e[s],enumerable:!0})},He=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Pe(e))!Ke.call(t,n)&&n!==s&&Z(t,n,{get:()=>e[n],enumerable:!(i=je(e,n))||i.enumerable});return t};var Ve=t=>He(Z({},"__esModule",{value:!0}),t);var wt={};ze(wt,{FormatChip:()=>Le,FormatViewer:()=>Ie,SignalGroupHeader:()=>Re,SignalOption:()=>xe,SignalSearch:()=>fe,SignalSelector:()=>Mt,createSignalFilter:()=>yt,flattenSignals:()=>Ft,getFormatLabel:()=>$e,getSchemaDescription:()=>ke,isArraySchema:()=>vt,isEmptySchema:()=>Ne,isPrimitiveSchema:()=>X,signalReferenceKey:()=>Y});module.exports=Ve(wt);var D=require("react");function O(t){return Array.isArray?Array.isArray(t):Fe(t)==="[object Array]"}var Je=1/0;function We(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-Je?"-0":e}function Ae(t){return t==null?"":We(t)}function B(t){return typeof t=="string"}function q(t){return typeof t=="number"}function Ue(t){return t===!0||t===!1||Ge(t)&&Fe(t)=="[object Boolean]"}function ye(t){return typeof t=="object"}function Ge(t){return ye(t)&&t!==null}function w(t){return t!=null}function V(t){return!t.trim().length}function Fe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}var Qe="Incorrect 'index' type",Ye=t=>`Invalid value for key ${t}`,Xe=t=>`Pattern length exceeds max of ${t}.`,Ze=t=>`Missing ${t} property in key`,qe=t=>`Property 'weight' in key '${t}' must be a positive integer`,Ee=Object.prototype.hasOwnProperty,ee=class{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(i=>{let n=Me(i);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(i=>{i.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Me(t){let e=null,s=null,i=null,n=1,r=null;if(B(t)||O(t))i=t,e=Ce(t),s=te(t);else{if(!Ee.call(t,"name"))throw new Error(Ze("name"));let o=t.name;if(i=o,Ee.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(qe(o));e=Ce(o),s=te(o),r=t.getFn}return{path:e,id:s,weight:n,src:i,getFn:r}}function Ce(t){return O(t)?t:t.split(".")}function te(t){return O(t)?t.join("."):t}function et(t,e){let s=[],i=!1,n=(r,o,a,l)=>{if(w(r))if(!o[a])s.push(l!==void 0?{v:r,i:l}:r);else{let u=o[a],c=r[u];if(!w(c))return;if(a===o.length-1&&(B(c)||q(c)||Ue(c)))s.push(l!==void 0?{v:Ae(c),i:l}:Ae(c));else if(O(c)){i=!0;for(let d=0,m=c.length;d<m;d+=1)n(c[d],o,a+1,d)}else o.length&&n(c,o,a+1,l)}};return n(t,B(e)?e.split("."):e,0),i?s:s[0]}var tt={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},st={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},nt={location:0,threshold:.6,distance:100},it={useExtendedSearch:!1,getFn:et,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},g={...st,...tt,...nt,...it},rt=/[^ ]+/g;function ot(t=1,e=3){let s=new Map,i=Math.pow(10,e);return{get(n){let r=n.match(rt).length;if(s.has(r))return s.get(r);let o=1/Math.pow(r,.5*t),a=parseFloat(Math.round(o*i)/i);return s.set(r,a),a},clear(){s.clear()}}}var H=class{constructor({getFn:e=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){this.norm=ot(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,i)=>{this._keysMap[s.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,B(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){let s=this.size();B(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,i=this.size();s<i;s+=1)this.records[s].i-=1}removeAll(e){for(let s=e.length-1;s>=0;s-=1)this.records.splice(e[s],1);for(let s=0,i=this.records.length;s<i;s+=1)this.records[s].i=s}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!w(e)||V(e))return;let i={v:e,i:s,n:this.norm.get(e)};this.records.push(i)}_addObject(e,s){let i={i:s,$:{}};this.keys.forEach((n,r)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(w(o)){if(O(o)){let a=[];for(let l=0,u=o.length;l<u;l+=1){let c=o[l];if(w(c)){if(B(c)){if(!V(c)){let d={v:c,i:l,n:this.norm.get(c)};a.push(d)}}else if(B(c.v)&&!V(c.v)){let d={v:c.v,i:c.i,n:this.norm.get(c.v)};a.push(d)}}}i.$[r]=a}else if(B(o)&&!V(o)){let a={v:o,n:this.norm.get(o)};i.$[r]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}};function we(t,e,{getFn:s=g.getFn,fieldNormWeight:i=g.fieldNormWeight}={}){let n=new H({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(Me)),n.setSources(e),n.create(),n}function at(t,{getFn:e=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){let{keys:i,records:n}=t,r=new H({getFn:e,fieldNormWeight:s});return r.setKeys(i),r.setIndexRecords(n),r}function ct(t=[],e=g.minMatchCharLength){let s=[],i=-1,n=-1,r=0;for(let o=t.length;r<o;r+=1){let a=t[r];a&&i===-1?i=r:!a&&i!==-1&&(n=r-1,n-i+1>=e&&s.push([i,n]),i=-1)}return t[r-1]&&r-i>=e&&s.push([i,r-1]),s}var z=32;function lt(t,e,s,{location:i=g.location,distance:n=g.distance,threshold:r=g.threshold,findAllMatches:o=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,includeMatches:l=g.includeMatches,ignoreLocation:u=g.ignoreLocation}={}){if(e.length>z)throw new Error(Xe(z));let c=e.length,d=t.length,m=Math.max(0,Math.min(i,d)),f=r,A=m,C=(v,y)=>{let F=v/c;if(u)return F;let P=Math.abs(m-y);return n?F+P/n:P?1:F},S=a>1||l,_=S?Array(d):[],M;for(;(M=t.indexOf(e,A))>-1;){let v=C(0,M);if(f=Math.min(v,f),A=M+c,S){let y=0;for(;y<c;)_[M+y]=1,y+=1}}A=-1;let b=[],N=1,L=c+d,T=1<<c-1;for(let v=0;v<c;v+=1){let y=0,F=L;for(;y<F;)C(v,m+F)<=f?y=F:L=F,F=Math.floor((L-y)/2+y);L=F;let P=Math.max(1,m-F+1),K=o?d:Math.min(m+F,d)+c,x=Array(K+2);x[K+1]=(1<<v)-1;for(let E=K;E>=P;E-=1){let k=E-1,I=s[t[k]];if(S&&(_[k]=+!!I),x[E]=(x[E+1]<<1|1)&I,v&&(x[E]|=(b[E+1]|b[E])<<1|1|b[E+1]),x[E]&T&&(N=C(v,k),N<=f)){if(f=N,A=k,A<=m)break;P=Math.max(1,2*m-A)}}if(C(v+1,m)>f)break;b=x}let j={isMatch:A>=0,score:Math.max(.001,N)};if(S){let v=ct(_,a);v.length?l&&(j.indices=v):j.isMatch=!1}return j}function ut(t){let e={};for(let s=0,i=t.length;s<i;s+=1){let n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}var J=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);function ht(t){if(t.length<=1)return t;t.sort((s,i)=>s[0]-i[0]||s[1]-i[1]);let e=[t[0]];for(let s=1,i=t.length;s<i;s+=1){let n=e[e.length-1],r=t[s];r[0]<=n[1]+1?n[1]=Math.max(n[1],r[1]):e.push(r)}return e}var W=class{constructor(e,{location:s=g.location,threshold:i=g.threshold,distance:n=g.distance,includeMatches:r=g.includeMatches,findAllMatches:o=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:l=g.isCaseSensitive,ignoreDiacritics:u=g.ignoreDiacritics,ignoreLocation:c=g.ignoreLocation}={}){if(this.options={location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:u,ignoreLocation:c},e=l?e:e.toLowerCase(),e=u?J(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let d=(f,A)=>{this.chunks.push({pattern:f,alphabet:ut(f),startIndex:A})},m=this.pattern.length;if(m>z){let f=0,A=m%z,C=m-A;for(;f<C;)d(this.pattern.substr(f,z),f),f+=z;if(A){let S=m-z;d(this.pattern.substr(S),S)}}else d(this.pattern,0)}searchIn(e){let{isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=i?J(e):e,this.pattern===e){let C={isMatch:!0,score:0};return n&&(C.indices=[[0,e.length-1]]),C}let{location:r,distance:o,threshold:a,findAllMatches:l,minMatchCharLength:u,ignoreLocation:c}=this.options,d=[],m=0,f=!1;this.chunks.forEach(({pattern:C,alphabet:S,startIndex:_})=>{let{isMatch:M,score:b,indices:N}=lt(e,C,S,{location:r+_,distance:o,threshold:a,findAllMatches:l,minMatchCharLength:u,includeMatches:n,ignoreLocation:c});M&&(f=!0),m+=b,M&&N&&d.push(...N)});let A={isMatch:f,score:f?m/this.chunks.length:1};return f&&n&&(A.indices=ht(d)),A}},$=class{constructor(e){this.pattern=e}static isMultiMatch(e){return De(e,this.multiRegex)}static isSingleMatch(e){return De(e,this.singleRegex)}search(){}};function De(t,e){let s=t.match(e);return s?s[1]:null}var se=class extends ${constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},ne=class extends ${constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}},ie=class extends ${constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},re=class extends ${constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},oe=class extends ${constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},ae=class extends ${constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},U=class extends ${constructor(e,{location:s=g.location,threshold:i=g.threshold,distance:n=g.distance,includeMatches:r=g.includeMatches,findAllMatches:o=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:l=g.isCaseSensitive,ignoreDiacritics:u=g.ignoreDiacritics,ignoreLocation:c=g.ignoreLocation}={}){super(e),this._bitapSearch=new W(e,{location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:u,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},G=class extends ${constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,i,n=[],r=this.pattern.length;for(;(i=e.indexOf(this.pattern,s))>-1;)s=i+r,n.push([i,s-1]);let o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}},ce=[se,G,ie,re,ae,oe,ne,U],Se=ce.length,dt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,gt="|";function pt(t,e={}){return t.split(gt).map(s=>{let i=s.trim().split(dt).filter(r=>r&&!!r.trim()),n=[];for(let r=0,o=i.length;r<o;r+=1){let a=i[r],l=!1,u=-1;for(;!l&&++u<Se;){let c=ce[u],d=c.isMultiMatch(a);d&&(n.push(new c(d,e)),l=!0)}if(!l)for(u=-1;++u<Se;){let c=ce[u],d=c.isSingleMatch(a);if(d){n.push(new c(d,e));break}}}return n})}var ft=new Set([U.type,G.type]),le=class{constructor(e,{isCaseSensitive:s=g.isCaseSensitive,ignoreDiacritics:i=g.ignoreDiacritics,includeMatches:n=g.includeMatches,minMatchCharLength:r=g.minMatchCharLength,ignoreLocation:o=g.ignoreLocation,findAllMatches:a=g.findAllMatches,location:l=g.location,threshold:u=g.threshold,distance:c=g.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n,minMatchCharLength:r,findAllMatches:a,ignoreLocation:o,location:l,threshold:u,distance:c},e=s?e:e.toLowerCase(),e=i?J(e):e,this.pattern=e,this.query=pt(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){let s=this.query;if(!s)return{isMatch:!1,score:1};let{includeMatches:i,isCaseSensitive:n,ignoreDiacritics:r}=this.options;e=n?e:e.toLowerCase(),e=r?J(e):e;let o=0,a=[],l=0;for(let u=0,c=s.length;u<c;u+=1){let d=s[u];a.length=0,o=0;for(let m=0,f=d.length;m<f;m+=1){let A=d[m],{isMatch:C,indices:S,score:_}=A.search(e);if(C){if(o+=1,l+=_,i){let M=A.constructor.type;ft.has(M)?a.push(...S):a.push(S)}}else{l=0,o=0,a.length=0;break}}if(o){let m={isMatch:!0,score:l/o};return i&&(m.indices=a),m}}return{isMatch:!1,score:1}}},ue=[];function Be(...t){ue.push(...t)}function _e(t,e){for(let s=0,i=ue.length;s<i;s+=1){let n=ue[s];if(n.condition(t,e))return new n(t,e)}return new W(t,e)}var Q={AND:"$and",OR:"$or"},he={PATH:"$path",PATTERN:"$val"},de=t=>!!(t[Q.AND]||t[Q.OR]),mt=t=>!!t[he.PATH],At=t=>!O(t)&&ye(t)&&!de(t),ve=t=>({[Q.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function be(t,e,{auto:s=!0}={}){let i=n=>{let r=Object.keys(n),o=mt(n);if(!o&&r.length>1&&!de(n))return i(ve(n));if(At(n)){let l=o?n[he.PATH]:r[0],u=o?n[he.PATTERN]:n[l];if(!B(u))throw new Error(Ye(l));let c={keyId:te(l),pattern:u};return s&&(c.searcher=_e(u,e)),c}let a={children:[],operator:r[0]};return r.forEach(l=>{let u=n[l];O(u)&&u.forEach(c=>{a.children.push(i(c))})}),a};return de(t)||(t=ve(t)),i(t)}function ge(t,{ignoreFieldNorm:e=g.ignoreFieldNorm}){let s=1;t.matches.forEach(({key:i,norm:n,score:r})=>{let o=i?i.weight:null;s*=Math.pow(r===0&&o?Number.EPSILON:r,(o||1)*(e?1:n))}),t.score=s}function Et(t,{ignoreFieldNorm:e=g.ignoreFieldNorm}){t.forEach(s=>{ge(s,{ignoreFieldNorm:e})})}var pe=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let s=this.heap;for(;e>0;){let i=e-1>>1;if(s[e].score<=s[i].score)break;let n=s[e];s[e]=s[i],s[i]=n,e=i}}_sinkDown(e){let s=this.heap,i=s.length,n=e;do{e=n;let r=2*e+1,o=2*e+2;if(r<i&&s[r].score>s[n].score&&(n=r),o<i&&s[o].score>s[n].score&&(n=o),n!==e){let a=s[e];s[e]=s[n],s[n]=a}}while(n!==e)}};function Ct(t,e){let s=t.matches;e.matches=[],w(s)&&s.forEach(i=>{if(!w(i.indices)||!i.indices.length)return;let{indices:n,value:r}=i,o={indices:n,value:r};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function Dt(t,e){e.score=t.score}function St(t,e,{includeMatches:s=g.includeMatches,includeScore:i=g.includeScore}={}){let n=[];return s&&n.push(Ct),i&&n.push(Dt),t.map(r=>{let{idx:o}=r,a={item:e[o],refIndex:o};return n.length&&n.forEach(l=>{l(r,a)}),a})}var R=class{constructor(e,s={},i){this.options={...g,...s},this.options.useExtendedSearch,this._keyStore=new ee(this.options.keys),this.setCollection(e,i),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let s=_e(e,this.options);return this._lastQuery=e,this._lastSearcher=s,s}setCollection(e,s){if(this._docs=e,s&&!(s instanceof H))throw new Error(Qe);this._myIndex=s||we(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){w(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let s=[],i=[];for(let n=0,r=this._docs.length;n<r;n+=1)e(this._docs[n],n)&&(s.push(this._docs[n]),i.push(n));if(i.length){for(let n=i.length-1;n>=0;n-=1)this._docs.splice(i[n],1);this._myIndex.removeAll(i)}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){let{includeMatches:i,includeScore:n,shouldSort:r,sortFn:o,ignoreFieldNorm:a}=this.options,l=q(s)&&s>0&&B(e),u;if(l){let c=new pe(s);B(this._docs[0])?this._searchStringList(e,{heap:c,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:c,ignoreFieldNorm:a}),u=c.extractSorted(o)}else u=B(e)?B(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Et(u,{ignoreFieldNorm:a}),r&&u.sort(o),q(s)&&s>-1&&(u=u.slice(0,s));return St(u,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e,{heap:s,ignoreFieldNorm:i}={}){let n=this._getSearcher(e),{records:r}=this._myIndex,o=s?null:[];return r.forEach(({v:a,i:l,n:u})=>{if(!w(a))return;let{isMatch:c,score:d,indices:m}=n.searchIn(a);if(c){let f={item:a,idx:l,matches:[{score:d,value:a,norm:u,indices:m}]};s?(ge(f,{ignoreFieldNorm:i}),s.shouldInsert(f.score)&&s.insert(f)):o.push(f)}}),o}_searchLogical(e){let s=be(e,this.options),i=(a,l,u)=>{if(!a.children){let{keyId:d,searcher:m}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:m});return f&&f.length?[{idx:u,item:l,matches:f}]:[]}let c=[];for(let d=0,m=a.children.length;d<m;d+=1){let f=a.children[d],A=i(f,l,u);if(A.length)c.push(...A);else if(a.operator===Q.AND)return[]}return c},n=this._myIndex.records,r=new Map,o=[];return n.forEach(({$:a,i:l})=>{if(w(a)){let u=i(s,a,l);u.length&&(r.has(l)||(r.set(l,{idx:l,item:a,matches:[]}),o.push(r.get(l))),u.forEach(({matches:c})=>{r.get(l).matches.push(...c)}))}}),o}_searchObjectList(e,{heap:s,ignoreFieldNorm:i}={}){let n=this._getSearcher(e),{keys:r,records:o}=this._myIndex,a=s?null:[];return o.forEach(({$:l,i:u})=>{if(!w(l))return;let c=[];if(r.forEach((d,m)=>{c.push(...this._findMatches({key:d,value:l[m],searcher:n}))}),c.length){let d={idx:u,item:l,matches:c};s?(ge(d,{ignoreFieldNorm:i}),s.shouldInsert(d.score)&&s.insert(d)):a.push(d)}}),a}_findMatches({key:e,value:s,searcher:i}){if(!w(s))return[];let n=[];if(O(s))s.forEach(({v:r,i:o,n:a})=>{if(!w(r))return;let{isMatch:l,score:u,indices:c}=i.searchIn(r);l&&n.push({score:u,key:e,value:r,idx:o,norm:a,indices:c})});else{let{v:r,n:o}=s,{isMatch:a,score:l,indices:u}=i.searchIn(r);a&&n.push({score:l,key:e,value:r,norm:o,indices:u})}return n}};R.version="7.2.0";R.createIndex=we;R.parseIndex=at;R.config=g;R.parseQuery=be;Be(le);R.use=function(...t){t.forEach(e=>Be(e))};var h=require("react/jsx-runtime");function X(t){return t.type?!(Array.isArray(t.enum)&&t.enum.length>0)&&!t.elements&&!(t.properties&&Object.keys(t.properties).length>0)&&!(t.optionalProperties&&Object.keys(t.optionalProperties).length>0)&&!t.values&&!t.discriminator&&!t.ref:!1}function Ne(t){return!t.type&&!t.enum&&!t.elements&&!t.properties&&!t.optionalProperties&&!t.values&&!t.discriminator&&!t.ref}function vt(t){return t.elements!==void 0}function ke(t){return X(t)?t.type:t.enum?`enum (${t.enum.length} values)`:t.elements?"array":t.properties||t.optionalProperties?`object (${(t.properties?Object.keys(t.properties).length:0)+(t.optionalProperties?Object.keys(t.optionalProperties).length:0)} properties)`:t.values?"map":t.discriminator?"discriminated union":t.ref?`ref: ${t.ref}`:Ne(t)?"empty schema":"complex schema"}function $e(t){return t.mimeType?t.mimeType:t.jtdSchema?ke(t.jtdSchema):"unknown"}var fe=class{fuse;data;constructor(e){this.fuse=new R(e,{includeScore:!1,threshold:.3,ignoreLocation:!0,useExtendedSearch:!0,keys:[{name:"node",weight:5},{name:"nodeLabel",weight:5},{name:"nodeDescription",weight:2},{name:"transmitter",weight:5},{name:"transmitterDescription",weight:2},{name:"signal.name",weight:5},{name:"signal.label",weight:5},{name:"signal.description",weight:2}]}),this.data=e}search(e){if(!e||e.trim().length===0)return this.fuse.search("").map(n=>n.item);if(!e.includes("/"))return this.fuse.search(e).map(n=>n.item);let s=e.split("/"),i="";return s[0]==="constant"&&s.length===2?s[1]?i={$and:[{node:"=constant"},{$or:[{"signal.name":s[1]},{"signal.label":s[1]},{"signal.description":s[1]}]}]}:i={node:"=constant"}:s.length===2&&s[1]===""&&s[0]?i={$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]}:s.length===2&&s[0]&&s[1]?i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length===3&&s[2]===""&&s[0]&&s[1]?i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]}]}:s.length>=3&&s[0]&&s[1]&&s[2]&&(i={$and:[{$or:[{node:s[0]},{nodeLabel:s[0]},{nodeDescription:s[0]}]},{$or:[{transmitter:s[1]},{transmitterDescription:s[1]}]},{$or:[{"signal.name":s[2]},{"signal.label":s[2]},{"signal.description":s[2]}]}]}),this.fuse.search(i).map(n=>n.item)}allSignals(){return this.data}};function yt(t){return(e,s)=>!s||s.length<2?e:t.search(s).sort((n,r)=>{let o=`${n.node}/${n.transmitter}`,a=`${r.node}/${r.transmitter}`;return o.localeCompare(a)})}function Ft(t){let e=[];for(let s of t.vertices??[])for(let i of s.transmitters??[])for(let n of i.signals??[])e.push({node:s.id??"",nodeLabel:s.label??s.id??"",nodeDescription:s.description,nodeLogoId:s.logoId,transmitter:i.name??"",transmitterDescription:i.description,transmitterMode:i.mode,signal:n});for(let s of t.constants??[])e.push({node:"constant",nodeLabel:"Constants",transmitter:"",signal:s});return e}function Y(t){return t.node==="constant"?`constant/${t.signal.name}`:`${t.node}/${t.transmitter}/${t.signal.name}`}function me(){return(0,h.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[(0,h.jsx)("path",{d:"M4,7v2c0,0.55-0.45,1-1,1H2v4h1c0.55,0,1,0.45,1,1v2c0,1.65,1.35,3,3,3h3v-2H7c-0.55,0-1-0.45-1-1v-2 c0-1.3-0.84-2.42-2-2.83v-0.34C5.16,11.42,6,10.3,6,9V7c0-0.55,0.45-1,1-1h3V4H7C5.35,4,4,5.35,4,7z"}),(0,h.jsx)("path",{d:"M21,10c-0.55,0-1-0.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c0.55,0,1,0.45,1,1v2c0,1.3,0.84,2.42,2,2.83v0.34 c-1.16,0.41-2,1.52-2,2.83v2c0,0.55-0.45,1-1,1h-3v2h3c1.65,0,3-1.35,3-3v-2c0-0.55,0.45-1,1-1h1v-4H21z"})]})}function Re(t){if(t.group==="constant")return(0,h.jsxs)("div",{className:`adapt-signal-group-header adapt-signal-group-header--constant ${t.className??""}`.trim(),children:[(0,h.jsx)("span",{className:"adapt-signal-group-icon adapt-signal-group-icon--constant",children:(0,h.jsx)(me,{})}),(0,h.jsx)("span",{className:"adapt-signal-group-node-label adapt-signal-group-node-label--constant",children:"Constants"})]});let[s,i]=t.group.split("/"),n=t.references.find(a=>`${a.node}/${a.transmitter}`===t.group);if(!n)return null;let r=n.transmitterMode,o=r==="MODE_FAILURE"?"adapt-signal-group-transmitter--failure":r==="MODE_STREAM"?"adapt-signal-group-transmitter--stream":"adapt-signal-group-transmitter--standard";return(0,h.jsxs)("div",{className:`adapt-signal-group-header ${t.className??""}`.trim(),children:[n.nodeIcon&&(0,h.jsx)("span",{className:"adapt-signal-group-icon",children:n.nodeIcon}),(0,h.jsx)("span",{className:"adapt-signal-group-node-label",children:n.nodeLabel||s}),(0,h.jsxs)("span",{className:"adapt-signal-group-node-id",children:["(",s,")"]}),(0,h.jsx)("span",{className:"adapt-signal-group-separator"}),(0,h.jsx)("span",{className:`adapt-signal-group-transmitter ${o}`,children:i})]})}function xe(t){let{reference:e}=t;return(0,h.jsxs)("div",{className:`adapt-signal-option ${t.className??""}`.trim(),children:[(0,h.jsxs)("div",{className:"adapt-signal-option-label",children:[(0,h.jsx)("span",{className:"adapt-signal-option-name",children:e.signal.label||e.signal.name}),e.signal.label&&(0,h.jsxs)("span",{className:"adapt-signal-option-code",children:["(",e.signal.name,")"]}),e.signal.optional&&(0,h.jsx)("span",{className:"adapt-signal-option-optional",children:"Optional"})]}),e.signal.formats&&(0,h.jsx)(Ie,{formats:e.signal.formats})]})}function Le(t){let{format:e,size:s="small",onDelete:i,onClick:n}=t,r=$e(e),o="primitive";e.mimeType?o="mime":e.jtdSchema&&!X(e.jtdSchema)&&(o="complex");let a=o==="mime"||o==="complex";return(0,h.jsxs)("span",{className:`adapt-signal-format-chip adapt-signal-format-chip--${o} ${s==="medium"?"adapt-signal-format-chip--medium":""} ${t.className??""}`.trim(),onClick:n&&a?u=>{u.stopPropagation(),n()}:void 0,children:[r,i&&(0,h.jsx)("span",{className:"adapt-signal-format-chip-delete",onClick:u=>{u.stopPropagation(),i()},children:"\xD7"})]})}function Ie(t){let{formats:e,maxVisible:s=3,onViewSchema:i}=t;if(e.length===0)return(0,h.jsx)("span",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:"No formats defined"});let n=[],r=0;for(let a=0;a<e.length;a++){let l=e[a];l&&(!l.mimeType&&!l.jtdSchema||(r++,n.length<s&&n.push((0,h.jsx)(Le,{format:l,onClick:i&&l.jtdSchema&&!X(l.jtdSchema)?()=>i(l.jtdSchema):void 0},`fmt-${a}`))))}let o=r-n.length;return(0,h.jsxs)("div",{className:`adapt-signal-format-viewer ${t.className??""}`.trim(),children:[n,o>0&&(0,h.jsxs)("span",{className:"adapt-signal-format-overflow",children:["+",o]})]})}function Mt({currentReference:t,inputValue:e,availableReferences:s,filterOptions:i,disabled:n,hasError:r,errorMessage:o,placeholder:a="Search signals...",className:l,theme:u="auto",onInputChange:c,onReferenceChange:d}){let[m,f]=(0,D.useState)(!1),[A,C]=(0,D.useState)(-1),S=(0,D.useRef)(null),_=(0,D.useRef)(null),M=(0,D.useRef)(null),b=(0,D.useCallback)(()=>{d(null),c(""),f(!0),C(0),setTimeout(()=>_.current?.focus(),0)},[d,c]),N=(0,D.useMemo)(()=>{let p=[...s];return i(p,e)},[s,e,i]),L=(0,D.useMemo)(()=>{let p=new Map;for(let E of N){let k=E.node==="constant"?"constant":`${E.node}/${E.transmitter}`,I=p.get(k);I?I.push(E):p.set(k,[E])}return p},[N]),T=(0,D.useMemo)(()=>{let p=[];for(let E of L.values())p.push(...E);return p},[L]);(0,D.useEffect)(()=>{function p(E){S.current&&!S.current.contains(E.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);let j=(0,D.useCallback)(p=>{d(Y(p)),c(Y(p)),f(!1)},[d,c]),v=(0,D.useCallback)(p=>{if(t){if(p.key==="Backspace"||p.key==="Delete"){p.preventDefault(),b();return}if(p.key==="ArrowDown"||p.key==="ArrowUp"||p.key==="Enter"){p.preventDefault(),d(null),c(""),f(!0),C(0),setTimeout(()=>_.current?.focus(),0);return}if(p.key.length===1&&!p.ctrlKey&&!p.metaKey){p.preventDefault(),d(null),c(p.key),f(!0),C(0),setTimeout(()=>_.current?.focus(),0);return}return}p.key==="ArrowDown"?(p.preventDefault(),m?C(E=>Math.min(E+1,T.length-1)):(f(!0),C(0))):p.key==="ArrowUp"?(p.preventDefault(),C(E=>Math.max(E-1,0))):p.key==="Enter"?(p.preventDefault(),m&&A>=0&&T[A]&&j(T[A])):p.key==="Escape"&&f(!1)},[t,b,d,c,m,A,T,j]);(0,D.useEffect)(()=>{M.current&&A>=0&&M.current.querySelectorAll("[data-signal-option]")[A]?.scrollIntoView({block:"nearest"})},[A]);let y=[],F=0;for(let[p,E]of L){y.push((0,h.jsx)(Re,{group:p,references:N},`group-${p}`));for(let k of E){let I=F++,Oe=I===A;y.push((0,h.jsx)("div",{"data-signal-option":!0,className:`adapt-signal-selector-option ${Oe?"adapt-signal-selector-option--highlighted":""}`,onMouseDown:Te=>{Te.preventDefault(),j(k)},onMouseEnter:()=>C(I),children:(0,h.jsx)(xe,{reference:k})},Y(k)))}}let P=["adapt-signal-selector",r&&"adapt-signal-selector--error",l].filter(Boolean).join(" "),K=t?.node==="constant",x=t?K?"adapt-signal-selector-selected-dot--constant":t.transmitterMode==="MODE_FAILURE"?"adapt-signal-selector-selected-dot--failure":t.transmitterMode==="MODE_STREAM"?"adapt-signal-selector-selected-dot--stream":"adapt-signal-selector-selected-dot--standard":"";return(0,h.jsxs)("div",{ref:S,className:P,"data-adapt-theme":u==="auto"?void 0:u,children:[t&&!n&&(0,h.jsxs)("div",{className:"adapt-signal-selector-selected",onClick:b,children:[K?(0,h.jsx)("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:(0,h.jsx)(me,{})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{className:`adapt-signal-selector-selected-dot ${x}`}),t.nodeIcon&&(0,h.jsx)("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-clear",onClick:p=>{p.stopPropagation(),b()},children:"\xD7"})]}),t&&n&&(0,h.jsxs)("div",{className:"adapt-signal-selector-selected adapt-signal-selector-selected--disabled",children:[K?(0,h.jsx)("span",{className:"adapt-signal-selector-selected-icon adapt-signal-selector-selected-icon--constant",children:(0,h.jsx)(me,{})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{className:`adapt-signal-selector-selected-dot ${x}`}),t.nodeIcon&&(0,h.jsx)("span",{className:"adapt-signal-selector-selected-icon",children:t.nodeIcon})]}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-node",children:t.nodeLabel||t.node}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-sep",children:"\u203A"}),(0,h.jsx)("span",{className:"adapt-signal-selector-selected-signal",children:t.signal.label||t.signal.name})]}),(0,h.jsx)("input",{ref:_,type:"text",className:`adapt-signal-selector-input${t?" adapt-signal-selector-input--hidden":""}`,value:e,placeholder:a,disabled:n,onChange:p=>{c(p.target.value),f(!0),C(0),p.target.value||d(null)},onFocus:()=>{t||f(!0)},onKeyDown:v}),o&&(0,h.jsx)("span",{className:"adapt-signal-selector-error",children:o}),m&&!n&&(0,h.jsx)("div",{ref:M,className:"adapt-signal-selector-dropdown",children:T.length>0?y:(0,h.jsx)("div",{className:"adapt-signal-selector-no-results",children:"No signals found"})})]})}0&&(module.exports={FormatChip,FormatViewer,SignalGroupHeader,SignalOption,SignalSearch,SignalSelector,createSignalFilter,flattenSignals,getFormatLabel,getSchemaDescription,isArraySchema,isEmptySchema,isPrimitiveSchema,signalReferenceKey});
2
2
  //# sourceMappingURL=react.cjs.map