PageSourceSearch

https://fundacionsegundaparte.org/assets/vendor/bloodhound-js/bloodhound-js.index-ZnyGqts.js

js fundacionsegundaparte.org collected 2026-10-04 19:58:39 UTC 12,859 bytes, 7 lines download raw bytes

1/**
2 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
3 * Original file: /npm/[email protected]/index.js
4 *
5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 */
7import t from"object-assign";import e from"es6-promise";import r from"storage2";import i from"superagent";var n=t,s={isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:Array.isArray,isFunction:function(t){return"function"==typeof t},isObject:function(t){return"object"==typeof t},isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof $},toStr:function(t){return s.isUndefined(t)||null===t?"":t+""},bind:function(t,e){return t.bind(e)},each:function(t,e){t.forEach(e)},map:function(t,e){return t.map(e)},filter:function(t,e){return t.filter(e)},every:function(t,e){var r=!0;if(!t)return r;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if(!(r=e.call(null,n,i,t)))return!1}return!!r},some:function(t,e){var r=!1;if(!t)return r;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if(r=e.call(null,n,i,t))return!1}return!!r},mixin:t,identity:function(t){return t},clone:function(t){return n({},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return s.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,r){var i,n;return function(){var s,o,u=this,a=arguments;return s=function(){i=null,r||(n=t.apply(u,a))},o=r&&!i,clearTimeout(i),i=setTimeout(s,e),o&&(n=t.apply(u,a)),n}},throttle:function(t,e){var r,i,n,s,o,u;return o=0,u=function(){o=new Date,n=null,s=t.apply(r,i)},function(){var a=new Date,c=e-(a-o);return r=this,i=arguments,c<=0?(clearTimeout(n),n=null,o=a,s=t.apply(r,i)):n||(n=setTimeout(u,c)),s}},stringify:function(t){return s.isString(t)?t:JSON.stringify(t)},noop:function(){},error:function(t){throw new Error(t)}},o=s,u=o;function a(t){this.maxSize=u.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=u.noop)}function c(){this.head=this.tail=null}function h(t,e){this.key=t,this.val=e,this.prev=this.next=null}u.mixin(a.prototype,{set:function(t,e){var r,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(r=this.hash[t])?(r.val=e,this.list.moveToFront(r)):(r=new h(t,e),this.list.add(r),this.hash[t]=r,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new c}}),u.mixin(c.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}});var f=a,l=o,p=0,m={},d=6,y=new f(10);function v(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new f(0):y}v.setMaxPendingRequests=function(t){d=t},v.resetCache=function(){y.reset()},l.mixin(v.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+JSON.stringify(t.data||{})},_get:function(t,e){var r,i,n=this;function s(t){e(null,t),n._cache.set(r,t)}function o(){e(!0)}function u(){p--,delete m[r],n.onDeckRequestArgs&&(n._get.apply(n,n.onDeckRequestArgs),n.onDeckRequestArgs=null)}r=this._fingerprint(t),this.cancelled||r!==this.lastReq||((i=m[r])?i.then(s,o):p<d?(p++,m[r]=this._send(t).then((function(t){s(t),u()}),(function(){o(),u()}))):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(t,e){var r,i;e=e||l.noop,t=l.isString(t)?{url:t}:t||{},i=this._fingerprint(t),this.cancelled=!1,this.lastReq=i,(r=this._cache.get(i))?e(null,r):this._get(t,e)},cancel:function(){this.cancelled=!0}});var g=v,_=g;function x(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new _({cache:t.cache,limiter:t.limiter,transport:t.transport})}o.mixin(x.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){var r,i=this;if(e)return t=t||"",r=this.prepare(t,this._settings()),this.transport.get(r,(function(t,r){e(t?[]:i.transform(r))}))},cancelLastRequest:function(){this.transport.cancel()}});var w,z=x,k=r,T=o;try{(w=k.localStorage).setItem("~~~","!"),w.removeItem("~~~")}catch(t){w=null}function b(t,e){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+T.escapeRegExChars(this.prefix)),this.ls=e||w,!this.ls&&this._noop()}function q(){return(new Date).getTime()}function S(t){return JSON.stringify(T.isUndefined(t)?null:t)}function A(t){return JSON.parse(t)}T.mixin(b.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=T.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),A(this.ls.getItem(this._prefix(t)))},set:function(t,e,r){return T.isNumber(r)?this._safeSet(this._ttlKey(t),S(q()+r)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),S(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=function(t){var e,r,i=[],n=w.length;for(e=0;e<n;e++)(r=w.key(e)).match(t)&&i.push(r.replace(t,""));return i}(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var e=A(this.ls.getItem(this._ttlKey(t)));return!!(T.isNumber(e)&&q()>e)}});var R=b,E=o,P="data",K="protocol",C="thumbprint",I=null;function N(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new R(t.cacheKey)}I="undefined"!=typeof window?window.location:{protocol:"https:"},E.mixin(N.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(P,t,this.ttl),this.storage.set(K,I.protocol,this.ttl),this.storage.set(C,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(P),e.protocol=this.storage.get(K),e.thumbprint=this.storage.get(C),t=e.thumbprint!==this.thumbprint||e.protocol!==I.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(t){var e,r=this;t&&(e=this.prepare(this._settings()),this.transport(e).then((function(e){t(null,r.transform(e))}),(function(){t(!0)})))},clear:function(){return this.storage.clear(),this}});var L=N,j=o;function D(t){return(t=j.toStr(t))?t.split(/\s+/):[]}function O(t){return(t=j.toStr(t))?t.split(/\W+/):[]}function F(t){return function(e){return e=j.isArray(e)?e:[].slice.call(arguments,0),function(r){var i=[];return j.each(e,(function(e){i=i.concat(t(j.toStr(r[e])))})),i}}}var J={nonword:O,whitespace:D,obj:{nonword:F(O),whitespace:F(D)}},B=e.Promise,M=i,U=o,W=function(t){return new B((function(e,r){M.get(t.url).end((function(t,i){if(t)return r(t);e(i.body)}))}))},G="1.0.0";var Q=o,H="c";function V(t){if(!(t=t||{}).datumTokenizer||!t.queryTokenizer)throw new Error("datumTokenizer and queryTokenizer are both required");this.identify=t.identify||Q.stringify,this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function X(t){return t=Q.filter(t,(function(t){return!!t})),t=Q.map(t,(function(t){return t.toLowerCase()}))}function Y(){var t={i:[]};return t[H]={},t}Q.mixin(V.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var e=this;t=Q.isArray(t)?t:[t],Q.each(t,(function(t){var r,i;e.datums[r=e.identify(t)]=t,i=X(e.datumTokenizer(t)),Q.each(i,(function(t){var i,n,s;for(i=e.trie,n=t.split("");s=n.shift();)(i=i[H][s]||(i[H][s]=Y())).i.push(r)}))}
7))},get:function(t){var e=this;return Q.map(t,(function(t){return e.datums[t]}))},search:function(t){var e,r,i=this;return e=X(this.queryTokenizer(t)),Q.each(e,(function(t){var e,n,s,o;if(r&&0===r.length)return!1;for(e=i.trie,n=t.split("");e&&(s=n.shift());)e=e[H][s];if(!e||0!==n.length)return r=[],!1;o=e.i.slice(0),r=r?function(t,e){var r=0,i=0,n=[];t=t.sort(),e=e.sort();var s=t.length,o=e.length;for(;r<s&&i<o;)t[r]<e[i]?r++:(t[r]>e[i]||(n.push(t[r]),r++),i++);return n}(r,o):o})),r?Q.map(function(t){for(var e={},r=[],i=0,n=t.length;i<n;i++)e[t[i]]||(e[t[i]]=!0,r.push(t[i]));return r}(r),(function(t){return i.datums[t]})):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=Y()},serialize:function(){return{datums:this.datums,trie:this.trie}}});var Z=V,tt=o,et=e.Promise,rt=z,it=L,nt=J,st=function(t){var e,r;return e={initialize:!0,identify:U.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(t=U.mixin(e,t||{})).datumTokenizer&&U.error("datumTokenizer is required"),!t.queryTokenizer&&U.error("queryTokenizer is required"),r=t.sorter,t.sorter=r?function(t){return t.sort(r)}:U.identity,t.local=U.isFunction(t.local)?t.local():t.local,t.prefetch=function(t){var e;if(!t)return null;return e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:U.identity,transform:U.identity,transport:null},t=U.isString(t)?{url:t}:t,t=U.mixin(e,t),!t.url&&U.error("prefetch requires url to be set"),t.transform=t.filter||t.transform,t.cacheKey=t.cacheKey||t.url,t.thumbprint=G+t.thumbprint,t.transport=t.transport?(t.transport,function(t){}):W,t}(t.prefetch),t.remote=function(t){var e;if(!t)return;return e={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:U.identity,transport:null},t=U.isString(t)?{url:t}:t,t=U.mixin(e,t),!t.url&&U.error("remote requires url to be set"),t.transform=t.filter||t.transform,t.prepare=function(t){var e,r,i;if(e=t.prepare,r=t.replace,i=t.wildcard,e)return e;e=r?n:t.wildcard?s:o;return e;function n(t,e){return e.url=r(e.url,t),e}function s(t,e){return e.url=e.url.replace(i,encodeURIComponent(t)),e}function o(t,e){return e}}(t),t.limiter=function(t){var e,r,i;e=t.limiter,r=t.rateLimitBy,i=t.rateLimitWait,e||(e=/^throttle$/i.test(r)?s(i):n(i));return e;function n(t){return function(e){return U.debounce(e,t)}}function s(t){return function(e){return U.throttle(e,t)}}}(t),t.transport=t.transport?(t.transport,function(t){}):W,delete t.replace,delete t.wildcard,delete t.rateLimitBy,delete t.rateLimitWait,t}(t.remote),t},ot=Z,ut=g;function at(t){t=st(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new rt(t.remote):null,this.prefetch=t.prefetch?new it(t.prefetch):null,this.index=new ot({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}
7at.tokenizers=nt,tt.mixin(at.prototype,{__ttAdapter:function(){var t=this;return this.remote?function(e,r,i){return t.search(e,r,i)}:function(e,r){return t.search(e,r)}},_loadPrefetch:function(){var t,e=this;return this.prefetch?(t=this.prefetch.fromCache())?(this.index.bootstrap(t),new et((function(t,e){t()}))):new et((function(t,r){e.prefetch.fromNetwork((function(i,n){if(i)return r(i);try{e.add(n),e.prefetch.store(e.index.serialize()),t()}catch(t){r(t)}}))})):new et((function(t,e){t()}))},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).then((function(){t.add(t.local)})),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=tt.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,e,r){var i,n=this;return i=this.sorter(this.index.search(t)),e(this.remote?i.slice():i),this.remote&&i.length<this.sufficient?this.remote.get(t,(function(t){var e=[];tt.each(t,(function(t){!tt.some(i,(function(e){return n.identify(t)===n.identify(e)}))&&e.push(t)})),r&&r(e)})):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return ut.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}});var ct=at,ht=ct.tokenizers;export{ct as default,ht as tokenizers};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.