@flesh-and-blood/search 4.0.69 → 4.0.71

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- var dr=Object.create;var Y=Object.defineProperty;var ur=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty;var mr=(e,r)=>{for(var t in r)Y(e,t,{get:r[t],enumerable:!0})},Se=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of fr(r))!hr.call(e,i)&&i!==t&&Y(e,i,{get:()=>r[i],enumerable:!(a=ur(r,i))||a.enumerable});return e};var br=(e,r,t)=>(t=e!=null?dr(gr(e)):{},Se(r||!e||!e.__esModule?Y(t,"default",{value:e,enumerable:!0}):t,e)),yr=e=>Se(Y({},"__esModule",{value:!0}),e);var ut={};mr(ut,{FilterProperty:()=>Le,PUNCTUATION:()=>u,RARITY_VALUES_MAPPING:()=>Ae,abbreviations:()=>ce,availableExclusions:()=>ir,availableModifiers:()=>tr,default:()=>or,filterCard:()=>nr,filtersToCardPropertyMappings:()=>ae,getAbbreviation:()=>$,getAbbreviationByCard:()=>Cr,getCardByName:()=>me,getCleanText:()=>he,getExcludedMetaFilters:()=>de,getKeywordsAndAppliedFiltersFromText:()=>xe,getMetaFilters:()=>pe,getNormalizedText:()=>q,getRelatedCards:()=>be,getRelatedCardsByName:()=>ee,getTokensReferencedByCards:()=>Ir,multiWordShorthands:()=>fe,shorthands:()=>ue,singleWordShorthands:()=>ge});module.exports=yr(ut);var se=require("@flesh-and-blood/types"),Pe=br(require("fuse.js"),1);var u=/[!"#$%&'’(),./:;<=>?@[\]^_`|~]/g;var l=require("@flesh-and-blood/types");var $=e=>ce.find(({abbreviations:r})=>r.find(t=>t.toLowerCase()===e)),Cr=e=>ce.find(({card:r})=>r.toLowerCase()===e.name.toLowerCase()),ce=[{abbreviations:["10k"],card:"10,000 Year Reunion"},{abbreviations:["Pajamas","PJs"],card:"Alluvion Constellas"},{abbreviations:["Slippy","Arakni Slipped Through the Cracks","Arakni, Slipped Through the Cracks"],card:"Arakni, 5L!p3d 7hRu 7h3 cR4X"},{abbreviations:["Dullcap"],card:"Arcanite Skullcap"},{abbreviations:["ALS"],card:"Arc Light Sentinel"},{abbreviations:["AoW"],card:"Art of War"},{abbreviations:["BBD"],card:"Barraging Beatdown"},{abbreviations:["BBS"],card:"Big Blue Sky"},{abbreviations:["Starvo"],card:"Bravo, Star of the Show"},{abbreviations:["BEB"],card:"Bull's Eye Bracers"},{abbreviations:["BLW"],card:"Be Like Water"},{abbreviations:["BoJ"],card:"Balance of Justice"},{abbreviations:["BOHH"],card:"Blood on Her Hands"},{abbreviations:["BRB"],card:"Bloodrush Bellow"},{abbreviations:["Breezies"],card:"Breeze Rider Boots"},{abbreviations:["BTA"],card:"Burn Them All"},{abbreviations:["CStrike","C-Strike","C Strike"],card:"Celestial Cataclysm"},{abbreviations:["CBelly"],card:"Cerebellum Processor"},{abbreviations:["CLF"],card:"Channel Lake Frigid"},{abbreviations:["CLV"],card:"Channel Lightning Valley"},{abbreviations:["CMH"],card:"Channel Mount Heroic"},{abbreviations:["CMI"],card:"Channel Mount Isen"},{abbreviations:["CMT"],card:"Channel the Millennium Tree"},{abbreviations:["CnC","C&C"],card:"Command and Conquer"},{abbreviations:["Sea and Sea"],card:"Conqueror of the High Seas"},{abbreviations:["CYB"],card:"Count Your Blessings"},{abbreviations:["Cat","Kitty"],card:"Crouching Tiger"},{abbreviations:["CoD"],card:"Crown of Dominion"},{abbreviations:["CoP"],card:"Crown of Providence"},{abbreviations:["CtW"],card:"Crush the Weak"},{abbreviations:["DD"],card:"Death Dealer"},{abbreviations:["DnD"],card:"Devotion Never Dies"},{abbreviations:["DIO"],card:"Dash I/O"},{abbreviations:["EBTT"],card:"Even Bigger Than That!"},{abbreviations:["NewNigma"],card:"Enigma, New Moon"},{abbreviations:["EPot","E Pot"],card:"Energy Potion"},{abbreviations:["EStrike","E-Strike","E Strike"],card:"Enlightened Strike"},{abbreviations:["FFS"],card:"Fyendal's Fighting Spirit"},{abbreviations:["FoN"],card:"Force of Nature"},{abbreviations:["Frosty","\u{1F976}","\u{1F9CA}","\u2744\uFE0F"],card:"Frostbite"},{abbreviations:["Yum yum"],card:"Fruits of the Forest"},{abbreviations:["GnT"],card:"Give and Take"},{abbreviations:["Habibi"],card:"Hanabi Blaster"},{abbreviations:["HMH"],card:"Hope Merchant's Hood"},{abbreviations:["HoI"],card:"Heart of Ice"},{abbreviations:["Pumpkin"],card:"Jack-o'-lantern"},{abbreviations:["RKO","Cheato"],card:"Kayo, Underhanded Cheat"},{abbreviations:["KKBB"],card:"Knick Knack Bric-a-brac"},{abbreviations:["BStrike"],card:"Levels of Enlightenment"},{abbreviations:["LAG","Twominaris"],card:"Luminaris, Angel's Glow"},{abbreviations:["LCF","Newminaris"],card:"Luminaris, Celestial Fury"},{abbreviations:["LDE"],card:"Last Ditch Effort"},{abbreviations:["LtC"],card:"Lead the Charge"},{abbreviations:["LNW"],card:"Leave No Witnesses"},{abbreviations:["LFaL","L4aL"],card:"Life for a Life"},{abbreviations:["LiT"],card:"Lost in Thought"},{abbreviations:["MMB"],card:"Mage Master Boots"},{abbreviations:["MaxV"],card:"Maximum Velocity"},{abbreviations:["MoM"],card:"Mask of Momentum"},{abbreviations:["MoPL"],card:"Mask of the Pouncing Lynx"},{abbreviations:["MnG"],card:"Meat and Greet"},{abbreviations:["Cake","\u{1F382}"],card:"Ninth Blade of the Blood Oath"},{abbreviations:["PoM"],card:"Peace of Mind"},{abbreviations:["P-Bone"],card:"Performance Bonus"},{abbreviations:["PF","\u{1F525}"],card:"Phoenix Flame"},{abbreviations:["PtW"],card:"Poison the Well"},{abbreviations:["Thanos","Infinity Gauntlet"],card:"Polarity Reversal Script"},{abbreviations:["DPot","D Pot"],card:"Potion of D\xE9j\xE0 Vu"},{abbreviations:["Ponder Run"],card:"Premeditate"},{abbreviations:["Qi Unbound"],card:"Qi Unleashed"},{abbreviations:["RitL"],card:"Red in the Ledger"},{abbreviations:["Cats","Ghost cat","Ghost cats"],card:"Restless Coalescence"},{abbreviations:["Eugene"],card:"Rhinar, Reckless Rampage",isHidden:!0},{abbreviations:["SSGB"],card:"Sandscour Greatbow"},{abbreviations:["SSP"],card:"Sand Sketched Plan"},{abbreviations:["SFaS","S4aS"],card:"Scar for a Scar"},{abbreviations:["Tyler"],card:"Scurv, Stowaway",isHidden:!0},{abbreviations:["SWOMB"],card:"Shifting Winds of the Mystic Beast"},{abbreviations:["Snaps"],card:"Snapdragon Scalers"},{abbreviations:["SWK"],card:"Spinning Wheel Kick"},{abbreviations:["SFTL"],card:"Swing Fist, Think Later"},{abbreviations:["TTT"],card:"Take the Tempo"},{abbreviations:["Ultron"],card:"Teklovossen, the Mechropotent"},{abbreviations:["ToS"],card:"Test of Strength"},{abbreviations:["TAYG"],card:"That All You Got?"},{abbreviations:["TROM"],card:"This Round's on Me"},{abbreviations:["3oak"],card:"Three of a Kind"},{abbreviations:["Pox Malone","Post Malone"],card:"Virulent Touch"},{abbreviations:["Cast Homes"],card:"Visit Goldmane Estate"},{abbreviations:["Frosty Hammer"],card:"Winter's Wail"},{abbreviations:["Wreckless Wing"],card:"War Cry of Bellona"},{abbreviations:["ZTS"],card:"Zero to Sixty"}];var k=require("@flesh-and-blood/types");var Le=(a=>(a.BannedFormats="bannedFormats",a.LegalFormats="legalFormats",a.LegalHeroes="legalHeroes",a))(Le||{}),X=Array.from(Array(50).keys()).map(e=>`${e}`),Fr=[{format:k.Format.ClassicConstructed,nicknames:["cc","classic"]},{format:k.Format.LivingLegend,nicknames:["cc ll","classic constructed ll","ll cc","ll","living legend"]},{format:k.Format.SilverAge,nicknames:["sage"]},{format:k.Format.GoldenAge,nicknames:["gage"]},{format:k.Format.UltimatePitFight,nicknames:["upf"]}],Mr=Object.values(k.Format).map(e=>{let r=Fr.find(({format:a})=>a===e),t=e.toLowerCase().replaceAll(u,"");return r?{...r,format:t}:{format:t}}),vr=[{hero:k.Hero.DataDoll,nicknames:["data","datadoll"]},{hero:k.Hero.Dorinthea,nicknames:["dori"]},{hero:k.Hero.Genis,nicknames:["genis"]},{hero:k.Hero.GravyBones,nicknames:["gravy"]},{hero:k.Hero.Iyslander,nicknames:["islander"]}],Tr=Object.values(k.Hero).map(e=>{let r=vr.find(({hero:a})=>a===e),t=e.toLowerCase().replaceAll(u,"");return r?{...r,hero:t}:{hero:t}}),J=["common","rare","super rare","majestic","legendary","fabled"],Ar=(e,r,t,a)=>{let i=[];if(!r)i.push(...e);else for(let o of e)switch(r){case">=":{let n=!1;for(let s of J)n?i.push(s):s===o&&(n=!0,i.push(s));break}case">":{let n=!1;for(let s of J)n?i.push(s):s===o&&(n=!0);break}case"<=":{let n=!1;for(let s of J.slice().reverse())n?i.push(s):s===o&&(n=!0,i.push(s));break}case"<":{let n=!1;for(let s of J.slice().reverse())n?i.push(s):s===o&&(n=!0);break}default:break}return{filterToPropertyMapping:{nestedProperty:"rarity",property:"printings",isArray:!0},isExcluded:t,isOptional:a,isOr:!0,values:i}},Re=(e,r,t,a,i)=>{let o=a.map(p=>({hero:p.toLowerCase().replaceAll(u,"")})),n=[],s=[],c=[];for(let p of e){let T=Mr.find(({format:d,nicknames:y})=>d===p||!!y&&y.includes(p));if(T)s.push(T.format);else{let d=Tr.find(({hero:y,nicknames:C})=>y===p||!!C&&C.includes(p))||o.find(({hero:y})=>y===p);d&&c.push(d.hero)}}let f=i||"legalFormats";return s.length>0&&n.push({filterToPropertyMapping:{property:f,isArray:!0},values:s,isOr:!0,isExcluded:r,isOptional:t}),c.length>0&&n.push({filterToPropertyMapping:{property:"legalHeroes",isArray:!0},values:c,isOr:!0,isExcluded:r,isOptional:t}),n},xr=(e,r,t,a)=>Re(e,r,t,a,"bannedFormats"),pe=(e,r,t,a,i,o)=>{let n=[];return kr(t)?n.push(...Re(a,e,r,o)):Lr(t)?n.push(...xr(a,e,r,o)):Br(t)&&n.push(Ar(a,i,e,r)),n},K=[{filterToPropertyMapping:{property:"cost",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialCost",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]}],I=[{filterToPropertyMapping:{property:"defense",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialDefense",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["hero","placeholder","token","weapon"]}],Q=[{filterToPropertyMapping:{property:"pitch",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]},{filterToPropertyMapping:{property:"isCardBack",isBoolean:!0},isExcluded:!0,values:["true"]}],V=[{filterToPropertyMapping:{property:"power",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialPower",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token"]}],Z=[{filterToPropertyMapping:{property:"talents",isArray:!0},isExcluded:!0,values:Object.values(k.Talent).map(e=>e.toLowerCase())}],Pr={"!co":K,"-co":K,"!cost":K,"-cost":K,"!color":K,"-color":K,"!b":I,"-b":I,"!block":I,"-block":I,"!d":I,"-d":I,"!def":I,"-def":I,"!defense":I,"-defense":I,"!pitch":Q,"-pitch":Q,"!p":Q,"-p":Q,"!attack":V,"-attack":V,"!power":V,"-power":V,"!pwr":V,"-pwr":V,"!pow":V,"-pow":V,"!talents":Z,"-talents":Z,"!tal":Z,"-tal":Z},de=e=>{let r=[],t=Pr[e];return t&&r.push(...t),r},wr=["l","legal","hero"],kr=e=>wr.includes(e),Sr=["banned"],Lr=e=>Sr.includes(e),Rr=["r","rarity"],Br=e=>Rr.includes(e);var O=require("@flesh-and-blood/types"),ue=[{description:"Attack actions",expanded:["st:attack"],filters:{subtypes:[O.Subtype.Attack]},isCardProperty:!1,shorthands:["AA"]},{description:"Arcane barrier",expanded:['k:"arcane barrier"'],filters:{keywords:[O.Keyword.ArcaneBarrier]},isCardProperty:!1,shorthands:["AB"]},{description:"Attack reactions",expanded:['t:"attack reaction"'],filters:{types:[O.Type.AttackReaction]},isCardProperty:!1,shorthands:["AR"]},{description:"Defense reactions",expanded:['t:"defense reaction"'],filters:{types:[O.Type.DefenseReaction]},isCardProperty:!1,shorthands:["DR"]},{description:"Gain life",expanded:["gain {h}"],filters:{functionalText:"gain {h}"},isCardProperty:!1,shorthands:["Gain life","Gains life"]},{description:"Go again",expanded:['k:"go again"'],filters:{keywords:[O.Keyword.GoAgain]},isCardProperty:!1,shorthands:["GA"]},{description:"Non-attack actions",expanded:["t:action","st:non-attack"],filters:{subtypes:[O.Subtype.NonAttack],types:[O.Type.Action]},isCardProperty:!1,shorthands:["NAA"]},{description:"Plus defense",expanded:["+ {d}"],filters:{functionalText:"+ {d}"},isCardProperty:!1,shorthands:["Pump defense","Pumps defense","Buff defense","Buffs defense"]},{description:"Spellvoid",expanded:['k:"spellvoid"'],filters:{keywords:[O.Keyword.Spellvoid]},isCardProperty:!1,shorthands:["SV"]}],fe=ue.filter(({shorthands:e})=>e.some(r=>r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)})),ge=ue.filter(({shorthands:e})=>e.some(r=>!r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>!r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)}));var me=(e,r)=>{let t=r.find(a=>he(a.name)===e);return t||(t=r.find(a=>he(a.name).includes(e))),t},he=e=>q(e.toLowerCase().trim().replace(u,"")),q=e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"");var j=require("@flesh-and-blood/types");var z=require("@flesh-and-blood/types"),Nr={"Dawnblade, Resplendent":"Dawnblade"},Be=e=>Nr[e.name]||e.name,Ne=e=>e.functionalText?.replaceAll(e.name,""),ee=(e,r)=>{let t=r.find(a=>a.name.toLowerCase().replace(u,"")===e);return t||(t=r.find(a=>a.name.toLowerCase().replace(u,"").includes(e))),be(t,r)},be=(e,r,t)=>{let a={},i={},o={};if(e){let f=[],p=[],T=Be(e);for(let d of r){let y=Be(d),C=T===y,A=e.cardIdentifier!==d.cardIdentifier,v=e.pitch!==d.pitch;if(C&&A&&v)a[d.cardIdentifier]=d;else if(!C&&!t?.shouldSkipReferences){let S=e.name==="Seismic Surge",L=d.keywords?.includes(z.Keyword.Heave),b=S&&L,g=e.name==="Marked",P=d.keywords?.includes(z.Keyword.Mark),m=g&&P,h=Ne(d),B=h?.includes(T)||e.traits?.some(le=>h?.includes(le)),R=Ne(e);(B||b||m)&&f.push(d);let H=new RegExp(y,"g"),U=new RegExp(`\\*\\*${y}\\*\\*`,"g"),M=R?.match(H)||[],w=R?.match(U)||[],N=M.length===w.length,x=R?.includes(y)&&!N,G=(d.traits||[]).some(le=>R?.includes(le)),E=x||G,W=d.name==="Seismic Surge",ne=e.keywords?.includes(z.Keyword.Heave),lr=W&&ne,cr=d.name==="Marked",pr=e.keywords?.includes(z.Keyword.Mark);(E||lr||cr&&pr)&&p.push(d)}}for(let d of f)i[d.cardIdentifier]=d;for(let d of p){let y=d.name;T!==y&&!p.some(C=>{let A=C.name;return A!==y&&A?.includes(y)})&&(o[d.cardIdentifier]=d)}}let n=Object.values(a),s=Object.values(i),c=Object.values(o);return{otherPitches:n,referencedBy:s,references:c}},Er=["cash-in-yellow"],Or={[j.Hero.Crackni]:{traits:[j.Trait.AgentOfChaos]},[j.Hero.Maxx]:{tokens:["hyper-driver"]}},Ir=(e,r,t)=>{let a=new Set;for(let i of e.filter(({cardIdentifier:o})=>!Er.includes(o))){let{references:o}=be(i,r);for(let n of o.filter(s=>{let c=s.name==="Hyper Driver",f=t===j.Hero.Maxx;return!c||f}))a.add(n)}if(t){let i=Or[t];if(i){if(i.cards)for(let o of e)i.cards?.includes(o.cardIdentifier)&&a.add(o);if(i.tokens)for(let o of r)i.tokens?.includes(o.cardIdentifier)&&a.add(o)}}return Array.from(a)};var tr=[">=",">","<=","<"],ir=["!","-"],Hr={property:"arcane",specialProperty:"specialArcane",isNumber:!0,partialMatch:!0},ye={property:"artists",isArray:!0,partialMatch:!0},Ee={property:"n/a",isMeta:!0},Oe={property:"bonds",isArray:!0},Dr={property:"n/a"},Ie={property:"classes",isArray:!0,partialMatch:!0},He={property:"cost",specialProperty:"specialCost",isNumber:!0,partialMatch:!0},_={property:"defense",specialProperty:"specialDefense",isNumber:!0},De={property:"flows",isArray:!0},Ge={nestedProperty:"foiling",property:"printings",isArray:!0},Ve={property:"fusions",isArray:!0},We={property:"intellect",isNumber:!0},Ue={property:"keywords",isArray:!0},Ce={property:"n/a",isMeta:!0},Ke={property:"life",specialProperty:"specialLife",isNumber:!0},Te={property:"meta",isArray:!0},je={property:"name",isString:!0,partialMatch:!0},Fe={property:"pitch",isNumber:!0},re={property:"power",specialProperty:"specialPower",isNumber:!0},Gr={property:"setIdentifiers",isArray:!0,partialMatch:!0},qe={property:"n/a",isMeta:!0},Vr={property:"n/a"},Wr={property:"n/a"},ze={property:"sets",isArray:!0,partialMatch:!0},Me={property:"shorthands",isArray:!0,partialMatch:!0},te={property:"specializations",isArray:!0,partialMatch:!0},_e={property:"subtypes",isArray:!0},Ye={property:"types",isArray:!0},$e={property:"talents",isArray:!0},Ur={property:"functionalText",isString:!0,partialMatch:!0},Kr={property:"traits",isArray:!0,partialMatch:!0},jr={property:"typeText",isString:!0,partialMatch:!0},ie={nestedProperty:"treatments",property:"printings",isArray:!0,isNestedPropertyArray:!0},qr={property:"firstReleaseDate",isString:!0,partialMatch:!0},ae={arcane:Hr,a:ye,artist:ye,art:ye,attack:re,b:_,block:_,banned:Ee,bond:Oe,bonds:Oe,c:Ie,class:Ie,chain:Dr,co:He,cost:He,color:Fe,d:_,def:_,defense:_,flow:De,flows:De,f:Ve,fusion:Ve,foil:Ge,foiling:Ge,i:We,intellect:We,is:Te,k:Ue,keyword:Ue,l:Ce,legal:Ce,hero:Ce,li:Ke,life:Ke,meta:Te,n:je,name:je,p:Fe,pitch:Fe,pwr:re,pow:re,power:re,print:Gr,r:qe,rarity:qe,referencedby:Vr,references:Wr,rf:Ee,s:ze,set:ze,short:Me,shorthand:Me,shorthands:Me,sp:te,spec:te,specialization:te,specializations:te,st:_e,subtype:_e,t:Ye,type:Ye,tal:$e,talent:$e,text:Ur,trait:Kr,treat:ie,treatment:ie,var:ie,variation:ie,x:jr,year:qr},zr=[{text:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase(),override:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase().replaceAll(u,"")}],_r=e=>{let r=[],t=e.replaceAll("\u201D",'"');for(let{text:i,override:o}of zr)t.includes(i)&&(t=t.replace(i,o));if($(t)?.card)r.push(t);else{let i=t.split(/[ ]+/),o="",n=0;for(let s of i)n===2&&(r.push(o.trim().replaceAll('"',"")),o="",n=0),n<2&&s.split('"').length===2?(o+=" "+s,n++):n===0&&o===""?r.push(s):n===1&&(o+=" "+s);n===2&&(r.push(o.trim().replaceAll('"',"")),o="",n=0)}return r},xe=(e,r,t=[],a=[])=>{let i=e.trim().toLowerCase();for(let{expanded:v,shorthands:S}of fe)for(let L of S)if(i.includes(L)){i=i.replace(L,v.join(" "));break}for(let[v,S]of Object.entries(l.setToSetIdentifierMappings))i.includes(v.toLowerCase())&&(i=i.replace(v.toLowerCase(),S[0]));let o=_r(i),n=[];for(let v of o){let S=ge.find(({shorthands:L})=>L.includes(v));S&&!S.isCardProperty?n.push(...S.expanded):n.push(v)}let s=[],c=[],f=[],p=[],T=!1,d=[],y=[],C=[],A=[];for(let v of n)if(at(v)){let[S,L]=v.split(":"),{modifier:b,values:g,isAnd:P,isOr:m}=tt(L),{filterKey:h,isExcluded:B,isOptional:R,isMeta:H}=it(S),U=!1;if(H){if(["rarity","r"].includes(h)){let M=rt(g);B||(y=[...M]),g=M.map(w=>w.toLowerCase())}["legal","l","hero"].includes(h),s.push(...pe(B,R,h,g,b,t))}else{if(["chain"].includes(h)){let M=E=>E.name.toLowerCase().replaceAll(u,""),w=g.map(E=>me(E,r)).filter(E=>!!E).map(M),N=new Set(w);h="name",m=!0;let x=20,D=0,G=E=>{if(!E.types.includes(l.Type.Hero)){let W=M(E);N.add(W),w.includes(W)||w.push(W)}};for(let E of w){if(D>x)break;let{referencedBy:W,references:ne}=ee(E,r);ne.forEach(G),D===0&&W.forEach(G),D++}g=Array.from(N)}else if(["referencedby","references"].includes(h)){let M=h,w=[...g].filter(N=>!!N);g=[],h="name",m=!0;for(let N of w){let{referencedBy:x,references:D}=ee(N,r);["referencedby"].includes(M)?g.push(...D.map(({name:G})=>G.toLowerCase().replaceAll(u,""))):["references"].includes(M)&&g.push(...x.map(({name:G})=>G.toLowerCase().replaceAll(u,"")))}}else if(["art","artist"].includes(h))c=g;else if(["print","prints","printing","printings"].includes(h))d=g;else if(["is","meta"].includes(h)){let M=[],w=[];for(let x of g)Qr.includes(x)?M.push(x):w.push(x);M.length>0&&(s.push({filterToPropertyMapping:Te,values:[l.Meta.Reprint.toLowerCase().replaceAll(u,"")],isAnd:P,isOr:m,isExcluded:!B,isOptional:R}),U=w.length===0);let N=Zr(w);g=N.map(x=>x.toLowerCase().replaceAll(u,"")),N.includes(l.Meta.Expansion)&&!B&&(T=!0)}else["foiling","foil"].includes(h)?(p=Xr(g),g=p.map(M=>M.toLowerCase())):["treat","treatment","var","variation"].includes(h)?(A=et(g),g=A.map(M=>M.toLowerCase())):["set","s"].includes(h)?(C=Yr(g,a),g=C.map(M=>M.toLowerCase().replaceAll(u,""))):["pitch","p","color"].includes(h)&&(g=Jr(g));ae[h]&&!U&&s.push({filterToPropertyMapping:ae[h],values:g,isAnd:P,isOr:m,modifier:b,isExcluded:B,isOptional:R})}}else if(v){let S=$(v)?.card,L=de(v);S?f.push(`"${S.toLowerCase().replace(u,"")}"`):L&&L.length>0?s.push(...L):f.push(v.replace(u,""))}return{appliedFilters:s,attributes:{artists:c,foilings:p,isExpansionSlot:T,prints:d,rarities:y,releases:C,treatments:A},keywords:f}},Yr=(e,r=[])=>{let t=[];for(let a of e)t.push(...$r(a,r));return t},$r=(e,r=[])=>{let t=[],a=Object.values(l.Release).find(i=>i.toLowerCase().replaceAll(u,"")===e);if(a&&t.push(a),t.length===0){let i=l.setIdentifierToSetMappings[e];i&&t.push(i)}if(t.length===0){let i=Object.values(l.Release).filter(o=>o.toLowerCase().includes(e));i.length>0&&t.push(...i)}if(t.length===0){let i=r.find(o=>o.toLowerCase().replaceAll(u,"")===e);i&&t.push(i)}return t},ve={purple:4,blue:3,yellow:2,red:1,white:0},Jr=e=>{let r=[];for(let t of e)ve[t]||ve[t]===0?r.push(ve[t].toString()):r.push(t);return r},Qr=["unique"],Je={dual:l.Meta.DualClass,exp:l.Meta.Expansion,expansion:l.Meta.Expansion,expansionSlot:l.Meta.Expansion,rainbow:l.Meta.Rainbow,reprint:l.Meta.Reprint,reprints:l.Meta.Reprint},Zr=e=>{let r=[];for(let t of e)Je[t]?r.push(Je[t]):l.Meta[t]&&r.push(l.Meta[t]);if(e.length>0&&r.length===0){for(let t of Object.values(l.Meta))for(let a of e)if(t.toLowerCase().includes(a)){r.push(t);break}}return r},Qe={r:l.Foiling.Rainbow,rf:l.Foiling.Rainbow,rainbow:l.Foiling.Rainbow,c:l.Foiling.Cold,cf:l.Foiling.Cold,cold:l.Foiling.Cold,g:l.Foiling.Gold,gf:l.Foiling.Gold,gold:l.Foiling.Gold},Xr=e=>{let r=[];for(let t of e)Qe[t]&&r.push(Qe[t]);return r},Ze={...Object.values(l.Treatment).reduce((e,r)=>(e[r.toLowerCase()]=r,e),{}),aa:l.Treatment.AA,alt:l.Treatment.AA,"alt art":l.Treatment.AA,ab:l.Treatment.AB,"alt border":l.Treatment.AB,at:l.Treatment.AT,"alt text":l.Treatment.AT,ea:l.Treatment.EA,extended:l.Treatment.EA,"extended art":l.Treatment.EA,fa:l.Treatment.FA,full:l.Treatment.FA,"full art":l.Treatment.FA},et=e=>{let r=[];for(let t of e)Ze[t]?r.push(Ze[t]):l.Treatment[t.toUpperCase()]&&r.push(l.Treatment[t.toUpperCase()]);return r},Ae={b:l.Rarity.Basic,c:l.Rarity.Common,f:l.Rarity.Fabled,l:l.Rarity.Legendary,m:l.Rarity.Majestic,p:l.Rarity.Promo,r:l.Rarity.Rare,s:l.Rarity.SuperRare,t:l.Rarity.Token,v:l.Rarity.Marvel},rt=e=>{let r=[];for(let t of e)Ae[t]?r.push(Ae[t]):r.push(t);return r},tt=e=>{let r=[],t,a,i=tr.find(o=>e.includes(o));if(i){let[,o]=e.split(i);Xe(o)?(t=!0,r.push(...o.trim().split("+").map(n=>n.replace(u,"")))):er(o)?(a=!0,r.push(...o.trim().split(",").map(n=>n.replace(u,"")))):r.push(o.trim().replace(u,""))}else Xe(e)?(t=!0,r.push(...e.trim().split("+").map(o=>o.replace(u,"")))):er(e)?(a=!0,r.push(...e.trim().split(",").map(o=>o.replace(u,"")))):e.startsWith('"')&&e.endsWith('"')?r.push(e.trim().replaceAll('"',"").replace(u,"")):r.push(e.trim().replace(u,""));return{modifier:i,values:r,isAnd:t,isOr:a}},it=e=>{let r=st(e);if(r){let[,t]=e.split(r);return{filterKey:t,isExcluded:!0,isOptional:!1,isMeta:rr(t)}}else return{filterKey:e,isExcluded:!1,isOptional:!1,isMeta:rr(e)}},at=e=>e.indexOf(":")>=0,Xe=e=>e.indexOf("+")>=0,er=e=>e.indexOf(",")>=0,rr=e=>!!ae[e]?.isMeta,st=e=>ir.find(r=>e.includes(r))?.slice(0,1);var F=require("@flesh-and-blood/types"),ar={artists:["Hoodwill"],cardIdentifier:"fangs-a-lot-blue",classes:[F.Class.Generic],defaultImage:"FNG000",firstReleaseDate:"2022-06-02",functionalText:"If Fangs A Lot is put into your banished zone from your graveyard, instead put it into your hand.",legalFormats:[],legalHeroes:[F.Hero.Kayo,F.Hero.Levia,F.Hero.Rhinar],printings:[{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000",print:"FNG000",rarity:F.Rarity.Rare,set:F.Release.Promos},{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000_Marvel",print:`FNG000-${F.Treatment.FA}`,rarity:F.Rarity.Marvel,set:F.Release.Promos,treatment:F.Treatment.FA}],name:"Fangs A Lot",rarities:[F.Rarity.Rare,F.Rarity.Marvel],rarity:F.Rarity.Rare,sets:[F.Release.Promos],setIdentifiers:["FNG000"],specialImage:"FNG000_Marvel",subtypes:[F.Subtype.Attack],types:[F.Type.Action],typeText:"Generic Action - Attack"},sr=[{keyword:ar.name.toLowerCase(),card:ar}];var we=class{constructor(r,t=[],a=[],i=!1){this.log=(r,...t)=>{this.debug&&console.log(r,...t)};this.search=(r,t)=>{let a,{appliedFilters:i,attributes:o,keywords:n}=xe(r,this.cards,this.additionalHeroes,this.additionalSets),s=n.join(" "),c=t?sr.filter(b=>b.keyword===s):[];if(c.length>0?a=c.map(({card:b})=>b):n.length?a=this.fuse.search(s).map(b=>b.item):a=[...this.cards],i.length&&(a=a.filter(b=>b&&nr(b,i))),n.length===0){let b="";if(o.releases.length===1)try{let m=o.releases[0];b=se.setToSetIdentifierMappings[m][0].toUpperCase()}catch(m){console.error("Error getting set identifier from search",m)}if(!b&&o.prints.length===1)try{let m=o.prints[0];se.setIdentifierToSetMappings[m]&&(b=m.toUpperCase())}catch(m){console.error("Error getting set identifier from search",m)}b?a.sort((m,h)=>{let B=m.setIdentifiers.find(H=>H.includes(b))?.replace(b,""),R=h.setIdentifiers.find(H=>H.includes(b))?.replace(b,"");return B&&R?B.localeCompare(R):-1}):a.sort((m,h)=>m.name===h.name?`${m.pitch}`.localeCompare(`${h.pitch}`):m.name.localeCompare(h.name))}else{let b=[],g=[],P=n.map(m=>m.toLowerCase().replace(u,"")).join(" ");for(let m of a)m.name.toLowerCase().replace(u,"")===P?b.push(m):g.push(m);a=[...b,...g]}let f,{artists:p,isExpansionSlot:T,foilings:d,prints:y,rarities:C,releases:A,treatments:v}=o;(p.length>0||T||d.length>0||y.length>0||C.length>0||A.length>0||v.length>0)&&(f=a.map(b=>{let g=b.printings.filter(P=>{let m=!!P.image,h=p.length===0||p.some(x=>P.artists.find(D=>D.replace(u,"").toLowerCase().includes(x))),B=!T||T===P.isExpansionSlot,R=d.length===0||d.includes(P.foiling),H=y.length===0||y.some(x=>P.identifier.includes(x.toUpperCase())),U=C.length===0||C.includes(P.rarity),M=A.length===0||A.includes(P.set),w=v.length===0||P.treatments?.some(x=>v.includes(x));return m&&h&&B&&R&&H&&U&&M&&w});return{...b,matchingPrintings:g}}));let L=f?.length>0?f:a;return{appliedFilters:i,attributes:o,keywords:n,searchResults:L}};let o={getFn:(n,s)=>{let c=Pe.default.config.getFn(n,s);return c&&(Array.isArray(c)?c.map(f=>q(f.replace(u,""))):q(c).replace(u,""))},ignoreLocation:!0,includeScore:!0,keys:[{name:"name",weight:10},{name:"functionalText",weight:6},{name:"shorthands",weight:4},{name:"setIdentifiers",weight:2},{name:"traits",weight:4},{name:"typeText",weight:6}],threshold:.15,useExtendedSearch:!0};this.additionalHeroes=t,this.additionalSets=a,this.cards=[...r],this.debug=i,this.fuse=new Pe.default([...r],o)}},or=we,nr=(e,r)=>{let t=!0,a=!1;for(let i of r){let o=i.isOptional,{isNumber:n,isString:s,isArray:c,isBoolean:f}=i.filterToPropertyMapping;if(n){let p=ot(e,i);o?p&&(a=!0):t=t&&p}else if(s){let p=nt(e,i);o?p&&(a=!0):t=t&&p}else if(c){let p=lt(e,i,r);o?p&&(a=!0):t=t&&p}else if(f){let p=ct(e,i);o?p&&(a=!0):t=t&&p}}return t},ot=(e,r)=>{if(oe(r,e)){let{values:t,modifier:a,isExcluded:i,filterToPropertyMapping:{partialMatch:o}}=r,n=ke(e,r);if(n!=null&&!isNaN(n))if(n=parseInt(n),a)switch(a){case">=":{let s=t?.some(c=>n>=parseInt(c));return i?!s:s}case">":{let s=t?.some(c=>n>parseInt(c));return i?!s:s}case"<=":{let s=t?.some(c=>n<=parseInt(c));return i?!s:s}case"<":{let s=t?.some(c=>n<parseInt(c));return i?!s:s}default:return!1}else{let s=t?.some(c=>n===parseInt(c));return i?!s:s}else{let s=dt(e,r)?.toLowerCase(),c=o?t?.some(f=>s?.includes(f)):t?.some(f=>s===f);return i?!c:c}}else return!0},nt=(e,r)=>{if(oe(r,e)){let{values:t,isAnd:a,isExcluded:i,filterToPropertyMapping:{partialMatch:o}}=r,n=ke(e,r)?.replaceAll(u,"");if(o){let s=a?t?.every(c=>n?.toLowerCase().includes(c)):t?.some(c=>n?.toLowerCase().includes(c));return i?!s:s}else{let s=a?t?.every(c=>n?.toLowerCase()===c):t?.some(c=>n?.toLowerCase()===c);return i?!s:s}}else return!0},lt=(e,r,t)=>{if(oe(r,e)){let{values:a,isAnd:i,isExcluded:o,filterToPropertyMapping:{partialMatch:n}}=r,s=pt(e,r,t).map(c=>c?.replaceAll(u,""));if(n){let c=i?a.every(p=>s?.some(T=>T?.toLowerCase().includes(p))):a.some(p=>s?.some(T=>T?.toLowerCase().includes(p))),f=s.length===0;return o?!c||f:c}else{let c=i?a.every(f=>s?.some(p=>p?.toLowerCase()===f)):a.some(f=>s?.some(p=>p?.toLowerCase()===f));return o?!c:c}}else return!0},ct=(e,r)=>{if(oe(r,e)){let{isExcluded:t}=r,a=ke(e,r);return t?!a:a}else return!0},ke=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.property]},pt=(e,r,t)=>{let{filterToPropertyMapping:{isNestedPropertyArray:a,nestedProperty:i,property:o}}=r,n=e[o]||[],s=[],c=Object.keys(e.legalOverrides||{}).length>0,f=r.filterToPropertyMapping.property==="legalHeroes",p=t.find(({filterToPropertyMapping:d})=>d.property==="legalFormats");if(c&&f&&!!p){let d=new Set;for(let{format:y,heroes:C}of e.legalOverrides||[])if(p.values.includes(y.toLowerCase()))for(let A of C)d.add(A);s=Array.from(d)}if(s.length===0)if(i){let d=new Set;for(let y of n)if(a){let C=y[i]||[];for(let A of C)d.add(A)}else{let C=y[i];C&&d.add(C)}s=Array.from(d)}else s=n;return s},dt=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.specialProperty]},oe=({cardTypes:e},{types:r,subtypes:t})=>!e||e?.some(a=>r.map(i=>i.toLowerCase()).includes(a.toLowerCase())||t.map(i=>i.toLowerCase()).includes(a.toLowerCase()));0&&(module.exports={FilterProperty,PUNCTUATION,RARITY_VALUES_MAPPING,abbreviations,availableExclusions,availableModifiers,filterCard,filtersToCardPropertyMappings,getAbbreviation,getAbbreviationByCard,getCardByName,getCleanText,getExcludedMetaFilters,getKeywordsAndAppliedFiltersFromText,getMetaFilters,getNormalizedText,getRelatedCards,getRelatedCardsByName,getTokensReferencedByCards,multiWordShorthands,shorthands,singleWordShorthands});
1
+ var dr=Object.create;var Y=Object.defineProperty;var ur=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty;var mr=(e,r)=>{for(var t in r)Y(e,t,{get:r[t],enumerable:!0})},Se=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of fr(r))!hr.call(e,i)&&i!==t&&Y(e,i,{get:()=>r[i],enumerable:!(a=ur(r,i))||a.enumerable});return e};var br=(e,r,t)=>(t=e!=null?dr(gr(e)):{},Se(r||!e||!e.__esModule?Y(t,"default",{value:e,enumerable:!0}):t,e)),yr=e=>Se(Y({},"__esModule",{value:!0}),e);var ut={};mr(ut,{FilterProperty:()=>Le,PUNCTUATION:()=>u,RARITY_VALUES_MAPPING:()=>Ae,abbreviations:()=>ce,availableExclusions:()=>ir,availableModifiers:()=>tr,default:()=>or,filterCard:()=>nr,filtersToCardPropertyMappings:()=>ae,getAbbreviation:()=>$,getAbbreviationByCard:()=>Cr,getCardByName:()=>me,getCleanText:()=>he,getExcludedMetaFilters:()=>de,getKeywordsAndAppliedFiltersFromText:()=>xe,getMetaFilters:()=>pe,getNormalizedText:()=>q,getRelatedCards:()=>be,getRelatedCardsByName:()=>ee,getTokensReferencedByCards:()=>Ir,multiWordShorthands:()=>fe,shorthands:()=>ue,singleWordShorthands:()=>ge});module.exports=yr(ut);var se=require("@flesh-and-blood/types"),Pe=br(require("fuse.js"),1);var u=/[!"#$%&'’(),./:;<=>?@[\]^_`|~]/g;var l=require("@flesh-and-blood/types");var $=e=>ce.find(({abbreviations:r})=>r.find(t=>t.toLowerCase()===e)),Cr=e=>ce.find(({card:r})=>r.toLowerCase()===e.name.toLowerCase()),ce=[{abbreviations:["10k"],card:"10,000 Year Reunion"},{abbreviations:["Pajamas","PJs"],card:"Alluvion Constellas"},{abbreviations:["Slippy","Arakni Slipped Through the Cracks","Arakni, Slipped Through the Cracks"],card:"Arakni, 5L!p3d 7hRu 7h3 cR4X"},{abbreviations:["Dullcap"],card:"Arcanite Skullcap"},{abbreviations:["ALS"],card:"Arc Light Sentinel"},{abbreviations:["AoW"],card:"Art of War"},{abbreviations:["BBD"],card:"Barraging Beatdown"},{abbreviations:["BBS"],card:"Big Blue Sky"},{abbreviations:["Starvo"],card:"Bravo, Star of the Show"},{abbreviations:["BEB"],card:"Bull's Eye Bracers"},{abbreviations:["BLW"],card:"Be Like Water"},{abbreviations:["BoJ"],card:"Balance of Justice"},{abbreviations:["BOHH"],card:"Blood on Her Hands"},{abbreviations:["BRB"],card:"Bloodrush Bellow"},{abbreviations:["Breezies"],card:"Breeze Rider Boots"},{abbreviations:["BTA"],card:"Burn Them All"},{abbreviations:["CStrike","C-Strike","C Strike"],card:"Celestial Cataclysm"},{abbreviations:["CBelly"],card:"Cerebellum Processor"},{abbreviations:["CLF"],card:"Channel Lake Frigid"},{abbreviations:["CLV"],card:"Channel Lightning Valley"},{abbreviations:["CMH"],card:"Channel Mount Heroic"},{abbreviations:["CMI"],card:"Channel Mount Isen"},{abbreviations:["CMT"],card:"Channel the Millennium Tree"},{abbreviations:["CnC","C&C"],card:"Command and Conquer"},{abbreviations:["Sea and Sea"],card:"Conqueror of the High Seas"},{abbreviations:["CYB"],card:"Count Your Blessings"},{abbreviations:["Cat","Kitty"],card:"Crouching Tiger"},{abbreviations:["CoD"],card:"Crown of Dominion"},{abbreviations:["CoP"],card:"Crown of Providence"},{abbreviations:["CtW"],card:"Crush the Weak"},{abbreviations:["DD"],card:"Death Dealer"},{abbreviations:["DnD"],card:"Devotion Never Dies"},{abbreviations:["DIO"],card:"Dash I/O"},{abbreviations:["EBTT"],card:"Even Bigger Than That!"},{abbreviations:["NewNigma"],card:"Enigma, New Moon"},{abbreviations:["EPot","E Pot"],card:"Energy Potion"},{abbreviations:["EStrike","E-Strike","E Strike"],card:"Enlightened Strike"},{abbreviations:["FFS"],card:"Fyendal's Fighting Spirit"},{abbreviations:["FoN"],card:"Force of Nature"},{abbreviations:["Frosty","\u{1F976}","\u{1F9CA}","\u2744\uFE0F"],card:"Frostbite"},{abbreviations:["Yum yum"],card:"Fruits of the Forest"},{abbreviations:["GnT"],card:"Give and Take"},{abbreviations:["Habibi"],card:"Hanabi Blaster"},{abbreviations:["HMH"],card:"Hope Merchant's Hood"},{abbreviations:["HoI"],card:"Heart of Ice"},{abbreviations:["Pumpkin"],card:"Jack-o'-lantern"},{abbreviations:["RKO","Cheato"],card:"Kayo, Underhanded Cheat"},{abbreviations:["KKBB"],card:"Knick Knack Bric-a-brac"},{abbreviations:["BStrike"],card:"Levels of Enlightenment"},{abbreviations:["LAG","Twominaris"],card:"Luminaris, Angel's Glow"},{abbreviations:["LCF","Newminaris"],card:"Luminaris, Celestial Fury"},{abbreviations:["LDE"],card:"Last Ditch Effort"},{abbreviations:["LtC"],card:"Lead the Charge"},{abbreviations:["LNW"],card:"Leave No Witnesses"},{abbreviations:["LFaL","L4aL"],card:"Life for a Life"},{abbreviations:["LiT"],card:"Lost in Thought"},{abbreviations:["MMB"],card:"Mage Master Boots"},{abbreviations:["MaxV"],card:"Maximum Velocity"},{abbreviations:["MoM"],card:"Mask of Momentum"},{abbreviations:["MoPL"],card:"Mask of the Pouncing Lynx"},{abbreviations:["MnG"],card:"Meat and Greet"},{abbreviations:["Cake","\u{1F382}"],card:"Ninth Blade of the Blood Oath"},{abbreviations:["PoM"],card:"Peace of Mind"},{abbreviations:["P-Bone"],card:"Performance Bonus"},{abbreviations:["PF","\u{1F525}"],card:"Phoenix Flame"},{abbreviations:["PtW"],card:"Poison the Well"},{abbreviations:["Thanos","Infinity Gauntlet"],card:"Polarity Reversal Script"},{abbreviations:["DPot","D Pot"],card:"Potion of D\xE9j\xE0 Vu"},{abbreviations:["Ponder Run"],card:"Premeditate"},{abbreviations:["Qi Unbound"],card:"Qi Unleashed"},{abbreviations:["RitL"],card:"Red in the Ledger"},{abbreviations:["Cats","Ghost cat","Ghost cats"],card:"Restless Coalescence"},{abbreviations:["Eugene"],card:"Rhinar, Reckless Rampage",isHidden:!0},{abbreviations:["SSGB"],card:"Sandscour Greatbow"},{abbreviations:["SSP"],card:"Sand Sketched Plan"},{abbreviations:["SFaS","S4aS"],card:"Scar for a Scar"},{abbreviations:["Tyler"],card:"Scurv, Stowaway",isHidden:!0},{abbreviations:["SWOMB"],card:"Shifting Winds of the Mystic Beast"},{abbreviations:["Snaps"],card:"Snapdragon Scalers"},{abbreviations:["SWK"],card:"Spinning Wheel Kick"},{abbreviations:["SFTL"],card:"Swing Fist, Think Later"},{abbreviations:["TTT"],card:"Take the Tempo"},{abbreviations:["Ultron"],card:"Teklovossen, the Mechropotent"},{abbreviations:["ToS"],card:"Test of Strength"},{abbreviations:["TAYG"],card:"That All You Got?"},{abbreviations:["TROM"],card:"This Round's on Me"},{abbreviations:["3oak"],card:"Three of a Kind"},{abbreviations:["Pox Malone","Post Malone"],card:"Virulent Touch"},{abbreviations:["Cast Homes"],card:"Visit Goldmane Estate"},{abbreviations:["Frosty Hammer"],card:"Winter's Wail"},{abbreviations:["Wreckless Wing"],card:"War Cry of Bellona"},{abbreviations:["ZTS"],card:"Zero to Sixty"}];var k=require("@flesh-and-blood/types");var Le=(a=>(a.BannedFormats="bannedFormats",a.LegalFormats="legalFormats",a.LegalHeroes="legalHeroes",a))(Le||{}),X=Array.from(Array(50).keys()).map(e=>`${e}`),Fr=[{format:k.Format.ClassicConstructed,nicknames:["cc","classic"]},{format:k.Format.LivingLegend,nicknames:["cc ll","classic constructed ll","ll cc","ll","living legend"]},{format:k.Format.SilverAge,nicknames:["sage"]},{format:k.Format.GoldenAge,nicknames:["gage"]},{format:k.Format.UltimatePitFight,nicknames:["upf"]}],Mr=Object.values(k.Format).map(e=>{let r=Fr.find(({format:a})=>a===e),t=e.toLowerCase().replaceAll(u,"");return r?{...r,format:t}:{format:t}}),vr=[{hero:k.Hero.DataDoll,nicknames:["data","datadoll"]},{hero:k.Hero.Dorinthea,nicknames:["dori"]},{hero:k.Hero.Genis,nicknames:["genis"]},{hero:k.Hero.GravyBones,nicknames:["gravy"]},{hero:k.Hero.Iyslander,nicknames:["islander"]}],Tr=Object.values(k.Hero).map(e=>{let r=vr.find(({hero:a})=>a===e),t=e.toLowerCase().replaceAll(u,"");return r?{...r,hero:t}:{hero:t}}),J=["common","rare","super rare","majestic","legendary","fabled"],Ar=(e,r,t,a)=>{let i=[];if(!r)i.push(...e);else for(let o of e)switch(r){case">=":{let n=!1;for(let s of J)n?i.push(s):s===o&&(n=!0,i.push(s));break}case">":{let n=!1;for(let s of J)n?i.push(s):s===o&&(n=!0);break}case"<=":{let n=!1;for(let s of J.slice().reverse())n?i.push(s):s===o&&(n=!0,i.push(s));break}case"<":{let n=!1;for(let s of J.slice().reverse())n?i.push(s):s===o&&(n=!0);break}default:break}return{filterToPropertyMapping:{nestedProperty:"rarity",property:"printings",isArray:!0},isExcluded:t,isOptional:a,isOr:!0,values:i}},Re=(e,r,t,a,i)=>{let o=a.map(p=>({hero:p.toLowerCase().replaceAll(u,"")})),n=[],s=[],c=[];for(let p of e){let T=Mr.find(({format:d,nicknames:y})=>d===p||!!y&&y.includes(p));if(T)s.push(T.format);else{let d=Tr.find(({hero:y,nicknames:C})=>y===p||!!C&&C.includes(p))||o.find(({hero:y})=>y===p);d&&c.push(d.hero)}}let f=i||"legalFormats";return s.length>0&&n.push({filterToPropertyMapping:{property:f,isArray:!0},values:s,isOr:!0,isExcluded:r,isOptional:t}),c.length>0&&n.push({filterToPropertyMapping:{property:"legalHeroes",isArray:!0},values:c,isOr:!0,isExcluded:r,isOptional:t}),n},xr=(e,r,t,a)=>Re(e,r,t,a,"bannedFormats"),pe=(e,r,t,a,i,o)=>{let n=[];return kr(t)?n.push(...Re(a,e,r,o)):Lr(t)?n.push(...xr(a,e,r,o)):Br(t)&&n.push(Ar(a,i,e,r)),n},K=[{filterToPropertyMapping:{property:"cost",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialCost",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]}],I=[{filterToPropertyMapping:{property:"defense",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialDefense",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["hero","placeholder","token","weapon"]}],Q=[{filterToPropertyMapping:{property:"pitch",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]},{filterToPropertyMapping:{property:"isCardBack",isBoolean:!0},isExcluded:!0,values:["true"]}],V=[{filterToPropertyMapping:{property:"power",isNumber:!0},isExcluded:!0,values:X},{filterToPropertyMapping:{property:"specialPower",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token"]}],Z=[{filterToPropertyMapping:{property:"talents",isArray:!0},isExcluded:!0,values:Object.values(k.Talent).map(e=>e.toLowerCase())}],Pr={"!co":K,"-co":K,"!cost":K,"-cost":K,"!color":K,"-color":K,"!b":I,"-b":I,"!block":I,"-block":I,"!d":I,"-d":I,"!def":I,"-def":I,"!defense":I,"-defense":I,"!pitch":Q,"-pitch":Q,"!p":Q,"-p":Q,"!attack":V,"-attack":V,"!power":V,"-power":V,"!pwr":V,"-pwr":V,"!pow":V,"-pow":V,"!talents":Z,"-talents":Z,"!tal":Z,"-tal":Z},de=e=>{let r=[],t=Pr[e];return t&&r.push(...t),r},wr=["l","legal","hero"],kr=e=>wr.includes(e),Sr=["banned"],Lr=e=>Sr.includes(e),Rr=["r","rarity"],Br=e=>Rr.includes(e);var O=require("@flesh-and-blood/types"),ue=[{description:"Attack actions",expanded:["st:attack"],filters:{subtypes:[O.Subtype.Attack]},isCardProperty:!1,shorthands:["AA"]},{description:"Arcane barrier",expanded:['k:"arcane barrier"'],filters:{keywords:[O.Keyword.ArcaneBarrier]},isCardProperty:!1,shorthands:["AB"]},{description:"Attack reactions",expanded:['t:"attack reaction"'],filters:{types:[O.Type.AttackReaction]},isCardProperty:!1,shorthands:["AR"]},{description:"Defense reactions",expanded:['t:"defense reaction"'],filters:{types:[O.Type.DefenseReaction]},isCardProperty:!1,shorthands:["DR"]},{description:"Disease",expanded:['st:"disease"'],filters:{subtypes:[O.Subtype.Disease]},isCardProperty:!1,shorthands:["Disease"]},{description:"Gain life",expanded:["gain {h}"],filters:{functionalText:"gain {h}"},isCardProperty:!1,shorthands:["Gain life","Gains life"]},{description:"Go again",expanded:['k:"go again"'],filters:{keywords:[O.Keyword.GoAgain]},isCardProperty:!1,shorthands:["GA"]},{description:"Non-attack actions",expanded:["t:action","st:non-attack"],filters:{subtypes:[O.Subtype.NonAttack],types:[O.Type.Action]},isCardProperty:!1,shorthands:["NAA"]},{description:"Plus defense",expanded:["+ {d}"],filters:{functionalText:"+ {d}"},isCardProperty:!1,shorthands:["Pump defense","Pumps defense","Buff defense","Buffs defense"]},{description:"Spellvoid",expanded:['k:"spellvoid"'],filters:{keywords:[O.Keyword.Spellvoid]},isCardProperty:!1,shorthands:["SV"]}],fe=ue.filter(({shorthands:e})=>e.some(r=>r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)})),ge=ue.filter(({shorthands:e})=>e.some(r=>!r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>!r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)}));var me=(e,r)=>{let t=r.find(a=>he(a.name)===e);return t||(t=r.find(a=>he(a.name).includes(e))),t},he=e=>q(e.toLowerCase().trim().replace(u,"")),q=e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"");var j=require("@flesh-and-blood/types");var z=require("@flesh-and-blood/types"),Nr={"Dawnblade, Resplendent":"Dawnblade"},Be=e=>Nr[e.name]||e.name,Ne=e=>e.functionalText?.replaceAll(e.name,""),ee=(e,r)=>{let t=r.find(a=>a.name.toLowerCase().replace(u,"")===e);return t||(t=r.find(a=>a.name.toLowerCase().replace(u,"").includes(e))),be(t,r)},be=(e,r,t)=>{let a={},i={},o={};if(e){let f=[],p=[],T=Be(e);for(let d of r){let y=Be(d),C=T===y,A=e.cardIdentifier!==d.cardIdentifier,v=e.pitch!==d.pitch;if(C&&A&&v)a[d.cardIdentifier]=d;else if(!C&&!t?.shouldSkipReferences){let S=e.name==="Seismic Surge",L=d.keywords?.includes(z.Keyword.Heave),b=S&&L,g=e.name==="Marked",P=d.keywords?.includes(z.Keyword.Mark),m=g&&P,h=Ne(d),B=h?.includes(T)||e.traits?.some(le=>h?.includes(le)),R=Ne(e);(B||b||m)&&f.push(d);let H=new RegExp(y,"g"),U=new RegExp(`\\*\\*${y}\\*\\*`,"g"),M=R?.match(H)||[],w=R?.match(U)||[],N=M.length===w.length,x=R?.includes(y)&&!N,G=(d.traits||[]).some(le=>R?.includes(le)),E=x||G,W=d.name==="Seismic Surge",ne=e.keywords?.includes(z.Keyword.Heave),lr=W&&ne,cr=d.name==="Marked",pr=e.keywords?.includes(z.Keyword.Mark);(E||lr||cr&&pr)&&p.push(d)}}for(let d of f)i[d.cardIdentifier]=d;for(let d of p){let y=d.name;T!==y&&!p.some(C=>{let A=C.name;return A!==y&&A?.includes(y)})&&(o[d.cardIdentifier]=d)}}let n=Object.values(a),s=Object.values(i),c=Object.values(o);return{otherPitches:n,referencedBy:s,references:c}},Er=["cash-in-yellow"],Or={[j.Hero.Crackni]:{traits:[j.Trait.AgentOfChaos]},[j.Hero.Maxx]:{tokens:["hyper-driver"]}},Ir=(e,r,t)=>{let a=new Set;for(let i of e.filter(({cardIdentifier:o})=>!Er.includes(o))){let{references:o}=be(i,r);for(let n of o.filter(s=>{let c=s.name==="Hyper Driver",f=t===j.Hero.Maxx;return!c||f}))a.add(n)}if(t){let i=Or[t];if(i){if(i.cards)for(let o of e)i.cards?.includes(o.cardIdentifier)&&a.add(o);if(i.tokens)for(let o of r)i.tokens?.includes(o.cardIdentifier)&&a.add(o)}}return Array.from(a)};var tr=[">=",">","<=","<"],ir=["!","-"],Hr={property:"arcane",specialProperty:"specialArcane",isNumber:!0,partialMatch:!0},ye={property:"artists",isArray:!0,partialMatch:!0},Ee={property:"n/a",isMeta:!0},Oe={property:"bonds",isArray:!0},Dr={property:"n/a"},Ie={property:"classes",isArray:!0,partialMatch:!0},He={property:"cost",specialProperty:"specialCost",isNumber:!0,partialMatch:!0},_={property:"defense",specialProperty:"specialDefense",isNumber:!0},De={property:"flows",isArray:!0},Ge={nestedProperty:"foiling",property:"printings",isArray:!0},Ve={property:"fusions",isArray:!0},We={property:"intellect",isNumber:!0},Ue={property:"keywords",isArray:!0},Ce={property:"n/a",isMeta:!0},Ke={property:"life",specialProperty:"specialLife",isNumber:!0},Te={property:"meta",isArray:!0},je={property:"name",isString:!0,partialMatch:!0},Fe={property:"pitch",isNumber:!0},re={property:"power",specialProperty:"specialPower",isNumber:!0},Gr={property:"setIdentifiers",isArray:!0,partialMatch:!0},qe={property:"n/a",isMeta:!0},Vr={property:"n/a"},Wr={property:"n/a"},ze={property:"sets",isArray:!0,partialMatch:!0},Me={property:"shorthands",isArray:!0,partialMatch:!0},te={property:"specializations",isArray:!0,partialMatch:!0},_e={property:"subtypes",isArray:!0},Ye={property:"types",isArray:!0},$e={property:"talents",isArray:!0},Ur={property:"functionalText",isString:!0,partialMatch:!0},Kr={property:"traits",isArray:!0,partialMatch:!0},jr={property:"typeText",isString:!0,partialMatch:!0},ie={nestedProperty:"treatments",property:"printings",isArray:!0,isNestedPropertyArray:!0},qr={property:"firstReleaseDate",isString:!0,partialMatch:!0},ae={arcane:Hr,a:ye,artist:ye,art:ye,attack:re,b:_,block:_,banned:Ee,bond:Oe,bonds:Oe,c:Ie,class:Ie,chain:Dr,co:He,cost:He,color:Fe,d:_,def:_,defense:_,flow:De,flows:De,f:Ve,fusion:Ve,foil:Ge,foiling:Ge,i:We,intellect:We,is:Te,k:Ue,keyword:Ue,l:Ce,legal:Ce,hero:Ce,li:Ke,life:Ke,meta:Te,n:je,name:je,p:Fe,pitch:Fe,pwr:re,pow:re,power:re,print:Gr,r:qe,rarity:qe,referencedby:Vr,references:Wr,rf:Ee,s:ze,set:ze,short:Me,shorthand:Me,shorthands:Me,sp:te,spec:te,specialization:te,specializations:te,st:_e,subtype:_e,t:Ye,type:Ye,tal:$e,talent:$e,text:Ur,trait:Kr,treat:ie,treatment:ie,var:ie,variation:ie,x:jr,year:qr},zr=[{text:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase(),override:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase().replaceAll(u,"")}],_r=e=>{let r=[],t=e.replaceAll("\u201D",'"');for(let{text:i,override:o}of zr)t.includes(i)&&(t=t.replace(i,o));if($(t)?.card)r.push(t);else{let i=t.split(/[ ]+/),o="",n=0;for(let s of i)n===2&&(r.push(o.trim().replaceAll('"',"")),o="",n=0),n<2&&s.split('"').length===2?(o+=" "+s,n++):n===0&&o===""?r.push(s):n===1&&(o+=" "+s);n===2&&(r.push(o.trim().replaceAll('"',"")),o="",n=0)}return r},xe=(e,r,t=[],a=[])=>{let i=e.trim().toLowerCase();for(let{expanded:v,shorthands:S}of fe)for(let L of S)if(i.includes(L)){i=i.replace(L,v.join(" "));break}for(let[v,S]of Object.entries(l.setToSetIdentifierMappings))i.includes(v.toLowerCase())&&(i=i.replace(v.toLowerCase(),S[0]));let o=_r(i),n=[];for(let v of o){let S=ge.find(({shorthands:L})=>L.includes(v));S&&!S.isCardProperty?n.push(...S.expanded):n.push(v)}let s=[],c=[],f=[],p=[],T=!1,d=[],y=[],C=[],A=[];for(let v of n)if(at(v)){let[S,L]=v.split(":"),{modifier:b,values:g,isAnd:P,isOr:m}=tt(L),{filterKey:h,isExcluded:B,isOptional:R,isMeta:H}=it(S),U=!1;if(H){if(["rarity","r"].includes(h)){let M=rt(g);B||(y=[...M]),g=M.map(w=>w.toLowerCase())}["legal","l","hero"].includes(h),s.push(...pe(B,R,h,g,b,t))}else{if(["chain"].includes(h)){let M=E=>E.name.toLowerCase().replaceAll(u,""),w=g.map(E=>me(E,r)).filter(E=>!!E).map(M),N=new Set(w);h="name",m=!0;let x=20,D=0,G=E=>{if(!E.types.includes(l.Type.Hero)){let W=M(E);N.add(W),w.includes(W)||w.push(W)}};for(let E of w){if(D>x)break;let{referencedBy:W,references:ne}=ee(E,r);ne.forEach(G),D===0&&W.forEach(G),D++}g=Array.from(N)}else if(["referencedby","references"].includes(h)){let M=h,w=[...g].filter(N=>!!N);g=[],h="name",m=!0;for(let N of w){let{referencedBy:x,references:D}=ee(N,r);["referencedby"].includes(M)?g.push(...D.map(({name:G})=>G.toLowerCase().replaceAll(u,""))):["references"].includes(M)&&g.push(...x.map(({name:G})=>G.toLowerCase().replaceAll(u,"")))}}else if(["art","artist"].includes(h))c=g;else if(["print","prints","printing","printings"].includes(h))d=g;else if(["is","meta"].includes(h)){let M=[],w=[];for(let x of g)Qr.includes(x)?M.push(x):w.push(x);M.length>0&&(s.push({filterToPropertyMapping:Te,values:[l.Meta.Reprint.toLowerCase().replaceAll(u,"")],isAnd:P,isOr:m,isExcluded:!B,isOptional:R}),U=w.length===0);let N=Zr(w);g=N.map(x=>x.toLowerCase().replaceAll(u,"")),N.includes(l.Meta.Expansion)&&!B&&(T=!0)}else["foiling","foil"].includes(h)?(p=Xr(g),g=p.map(M=>M.toLowerCase())):["treat","treatment","var","variation"].includes(h)?(A=et(g),g=A.map(M=>M.toLowerCase())):["set","s"].includes(h)?(C=Yr(g,a),g=C.map(M=>M.toLowerCase().replaceAll(u,""))):["pitch","p","color"].includes(h)&&(g=Jr(g));ae[h]&&!U&&s.push({filterToPropertyMapping:ae[h],values:g,isAnd:P,isOr:m,modifier:b,isExcluded:B,isOptional:R})}}else if(v){let S=$(v)?.card,L=de(v);S?f.push(`"${S.toLowerCase().replace(u,"")}"`):L&&L.length>0?s.push(...L):f.push(v.replace(u,""))}return{appliedFilters:s,attributes:{artists:c,foilings:p,isExpansionSlot:T,prints:d,rarities:y,releases:C,treatments:A},keywords:f}},Yr=(e,r=[])=>{let t=[];for(let a of e)t.push(...$r(a,r));return t},$r=(e,r=[])=>{let t=[],a=Object.values(l.Release).find(i=>i.toLowerCase().replaceAll(u,"")===e);if(a&&t.push(a),t.length===0){let i=l.setIdentifierToSetMappings[e];i&&t.push(i)}if(t.length===0){let i=Object.values(l.Release).filter(o=>o.toLowerCase().includes(e));i.length>0&&t.push(...i)}if(t.length===0){let i=r.find(o=>o.toLowerCase().replaceAll(u,"")===e);i&&t.push(i)}return t},ve={purple:4,blue:3,yellow:2,red:1,white:0},Jr=e=>{let r=[];for(let t of e)ve[t]||ve[t]===0?r.push(ve[t].toString()):r.push(t);return r},Qr=["unique"],Je={dual:l.Meta.DualClass,exp:l.Meta.Expansion,expansion:l.Meta.Expansion,expansionSlot:l.Meta.Expansion,rainbow:l.Meta.Rainbow,reprint:l.Meta.Reprint,reprints:l.Meta.Reprint},Zr=e=>{let r=[];for(let t of e)Je[t]?r.push(Je[t]):l.Meta[t]&&r.push(l.Meta[t]);if(e.length>0&&r.length===0){for(let t of Object.values(l.Meta))for(let a of e)if(t.toLowerCase().includes(a)){r.push(t);break}}return r},Qe={r:l.Foiling.Rainbow,rf:l.Foiling.Rainbow,rainbow:l.Foiling.Rainbow,c:l.Foiling.Cold,cf:l.Foiling.Cold,cold:l.Foiling.Cold,g:l.Foiling.Gold,gf:l.Foiling.Gold,gold:l.Foiling.Gold},Xr=e=>{let r=[];for(let t of e)Qe[t]&&r.push(Qe[t]);return r},Ze={...Object.values(l.Treatment).reduce((e,r)=>(e[r.toLowerCase()]=r,e),{}),aa:l.Treatment.AA,alt:l.Treatment.AA,"alt art":l.Treatment.AA,ab:l.Treatment.AB,"alt border":l.Treatment.AB,at:l.Treatment.AT,"alt text":l.Treatment.AT,ea:l.Treatment.EA,extended:l.Treatment.EA,"extended art":l.Treatment.EA,fa:l.Treatment.FA,full:l.Treatment.FA,"full art":l.Treatment.FA},et=e=>{let r=[];for(let t of e)Ze[t]?r.push(Ze[t]):l.Treatment[t.toUpperCase()]&&r.push(l.Treatment[t.toUpperCase()]);return r},Ae={b:l.Rarity.Basic,c:l.Rarity.Common,f:l.Rarity.Fabled,l:l.Rarity.Legendary,m:l.Rarity.Majestic,p:l.Rarity.Promo,r:l.Rarity.Rare,s:l.Rarity.SuperRare,t:l.Rarity.Token,v:l.Rarity.Marvel},rt=e=>{let r=[];for(let t of e)Ae[t]?r.push(Ae[t]):r.push(t);return r},tt=e=>{let r=[],t,a,i=tr.find(o=>e.includes(o));if(i){let[,o]=e.split(i);Xe(o)?(t=!0,r.push(...o.trim().split("+").map(n=>n.replace(u,"")))):er(o)?(a=!0,r.push(...o.trim().split(",").map(n=>n.replace(u,"")))):r.push(o.trim().replace(u,""))}else Xe(e)?(t=!0,r.push(...e.trim().split("+").map(o=>o.replace(u,"")))):er(e)?(a=!0,r.push(...e.trim().split(",").map(o=>o.replace(u,"")))):e.startsWith('"')&&e.endsWith('"')?r.push(e.trim().replaceAll('"',"").replace(u,"")):r.push(e.trim().replace(u,""));return{modifier:i,values:r,isAnd:t,isOr:a}},it=e=>{let r=st(e);if(r){let[,t]=e.split(r);return{filterKey:t,isExcluded:!0,isOptional:!1,isMeta:rr(t)}}else return{filterKey:e,isExcluded:!1,isOptional:!1,isMeta:rr(e)}},at=e=>e.indexOf(":")>=0,Xe=e=>e.indexOf("+")>=0,er=e=>e.indexOf(",")>=0,rr=e=>!!ae[e]?.isMeta,st=e=>ir.find(r=>e.includes(r))?.slice(0,1);var F=require("@flesh-and-blood/types"),ar={artists:["Hoodwill"],cardIdentifier:"fangs-a-lot-blue",classes:[F.Class.Generic],defaultImage:"FNG000",firstReleaseDate:"2022-06-02",functionalText:"If Fangs A Lot is put into your banished zone from your graveyard, instead put it into your hand.",legalFormats:[],legalHeroes:[F.Hero.Kayo,F.Hero.Levia,F.Hero.Rhinar],printings:[{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000",print:"FNG000",rarity:F.Rarity.Rare,set:F.Release.Promos},{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000_Marvel",print:`FNG000-${F.Treatment.FA}`,rarity:F.Rarity.Marvel,set:F.Release.Promos,treatment:F.Treatment.FA}],name:"Fangs A Lot",rarities:[F.Rarity.Rare,F.Rarity.Marvel],rarity:F.Rarity.Rare,sets:[F.Release.Promos],setIdentifiers:["FNG000"],specialImage:"FNG000_Marvel",subtypes:[F.Subtype.Attack],types:[F.Type.Action],typeText:"Generic Action - Attack"},sr=[{keyword:ar.name.toLowerCase(),card:ar}];var we=class{constructor(r,t=[],a=[],i=!1){this.log=(r,...t)=>{this.debug&&console.log(r,...t)};this.search=(r,t)=>{let a,{appliedFilters:i,attributes:o,keywords:n}=xe(r,this.cards,this.additionalHeroes,this.additionalSets),s=n.join(" "),c=t?sr.filter(b=>b.keyword===s):[];if(c.length>0?a=c.map(({card:b})=>b):n.length?a=this.fuse.search(s).map(b=>b.item):a=[...this.cards],i.length&&(a=a.filter(b=>b&&nr(b,i))),n.length===0){let b="";if(o.releases.length===1)try{let m=o.releases[0];b=se.setToSetIdentifierMappings[m][0].toUpperCase()}catch(m){console.error("Error getting set identifier from search",m)}if(!b&&o.prints.length===1)try{let m=o.prints[0];se.setIdentifierToSetMappings[m]&&(b=m.toUpperCase())}catch(m){console.error("Error getting set identifier from search",m)}b?a.sort((m,h)=>{let B=m.setIdentifiers.find(H=>H.includes(b))?.replace(b,""),R=h.setIdentifiers.find(H=>H.includes(b))?.replace(b,"");return B&&R?B.localeCompare(R):-1}):a.sort((m,h)=>m.name===h.name?`${m.pitch}`.localeCompare(`${h.pitch}`):m.name.localeCompare(h.name))}else{let b=[],g=[],P=n.map(m=>m.toLowerCase().replace(u,"")).join(" ");for(let m of a)m.name.toLowerCase().replace(u,"")===P?b.push(m):g.push(m);a=[...b,...g]}let f,{artists:p,isExpansionSlot:T,foilings:d,prints:y,rarities:C,releases:A,treatments:v}=o;(p.length>0||T||d.length>0||y.length>0||C.length>0||A.length>0||v.length>0)&&(f=a.map(b=>{let g=b.printings.filter(P=>{let m=!!P.image,h=p.length===0||p.some(x=>P.artists.find(D=>D.replace(u,"").toLowerCase().includes(x))),B=!T||T===P.isExpansionSlot,R=d.length===0||d.includes(P.foiling),H=y.length===0||y.some(x=>P.identifier.includes(x.toUpperCase())),U=C.length===0||C.includes(P.rarity),M=A.length===0||A.includes(P.set),w=v.length===0||P.treatments?.some(x=>v.includes(x));return m&&h&&B&&R&&H&&U&&M&&w});return{...b,matchingPrintings:g}}));let L=f?.length>0?f:a;return{appliedFilters:i,attributes:o,keywords:n,searchResults:L}};let o={getFn:(n,s)=>{let c=Pe.default.config.getFn(n,s);return c&&(Array.isArray(c)?c.map(f=>q(f.replace(u,""))):q(c).replace(u,""))},ignoreLocation:!0,includeScore:!0,keys:[{name:"name",weight:10},{name:"functionalText",weight:6},{name:"shorthands",weight:4},{name:"setIdentifiers",weight:2},{name:"traits",weight:4},{name:"typeText",weight:6}],threshold:.15,useExtendedSearch:!0};this.additionalHeroes=t,this.additionalSets=a,this.cards=[...r],this.debug=i,this.fuse=new Pe.default([...r],o)}},or=we,nr=(e,r)=>{let t=!0,a=!1;for(let i of r){let o=i.isOptional,{isNumber:n,isString:s,isArray:c,isBoolean:f}=i.filterToPropertyMapping;if(n){let p=ot(e,i);o?p&&(a=!0):t=t&&p}else if(s){let p=nt(e,i);o?p&&(a=!0):t=t&&p}else if(c){let p=lt(e,i,r);o?p&&(a=!0):t=t&&p}else if(f){let p=ct(e,i);o?p&&(a=!0):t=t&&p}}return t},ot=(e,r)=>{if(oe(r,e)){let{values:t,modifier:a,isExcluded:i,filterToPropertyMapping:{partialMatch:o}}=r,n=ke(e,r);if(n!=null&&!isNaN(n))if(n=parseInt(n),a)switch(a){case">=":{let s=t?.some(c=>n>=parseInt(c));return i?!s:s}case">":{let s=t?.some(c=>n>parseInt(c));return i?!s:s}case"<=":{let s=t?.some(c=>n<=parseInt(c));return i?!s:s}case"<":{let s=t?.some(c=>n<parseInt(c));return i?!s:s}default:return!1}else{let s=t?.some(c=>n===parseInt(c));return i?!s:s}else{let s=dt(e,r)?.toLowerCase(),c=o?t?.some(f=>s?.includes(f)):t?.some(f=>s===f);return i?!c:c}}else return!0},nt=(e,r)=>{if(oe(r,e)){let{values:t,isAnd:a,isExcluded:i,filterToPropertyMapping:{partialMatch:o}}=r,n=ke(e,r)?.replaceAll(u,"");if(o){let s=a?t?.every(c=>n?.toLowerCase().includes(c)):t?.some(c=>n?.toLowerCase().includes(c));return i?!s:s}else{let s=a?t?.every(c=>n?.toLowerCase()===c):t?.some(c=>n?.toLowerCase()===c);return i?!s:s}}else return!0},lt=(e,r,t)=>{if(oe(r,e)){let{values:a,isAnd:i,isExcluded:o,filterToPropertyMapping:{partialMatch:n}}=r,s=pt(e,r,t).map(c=>c?.replaceAll(u,""));if(n){let c=i?a.every(p=>s?.some(T=>T?.toLowerCase().includes(p))):a.some(p=>s?.some(T=>T?.toLowerCase().includes(p))),f=s.length===0;return o?!c||f:c}else{let c=i?a.every(f=>s?.some(p=>p?.toLowerCase()===f)):a.some(f=>s?.some(p=>p?.toLowerCase()===f));return o?!c:c}}else return!0},ct=(e,r)=>{if(oe(r,e)){let{isExcluded:t}=r,a=ke(e,r);return t?!a:a}else return!0},ke=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.property]},pt=(e,r,t)=>{let{filterToPropertyMapping:{isNestedPropertyArray:a,nestedProperty:i,property:o}}=r,n=e[o]||[],s=[],c=Object.keys(e.legalOverrides||{}).length>0,f=r.filterToPropertyMapping.property==="legalHeroes",p=t.find(({filterToPropertyMapping:d})=>d.property==="legalFormats");if(c&&f&&!!p){let d=new Set;for(let{format:y,heroes:C}of e.legalOverrides||[])if(p.values.includes(y.toLowerCase()))for(let A of C)d.add(A);s=Array.from(d)}if(s.length===0)if(i){let d=new Set;for(let y of n)if(a){let C=y[i]||[];for(let A of C)d.add(A)}else{let C=y[i];C&&d.add(C)}s=Array.from(d)}else s=n;return s},dt=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.specialProperty]},oe=({cardTypes:e},{types:r,subtypes:t})=>!e||e?.some(a=>r.map(i=>i.toLowerCase()).includes(a.toLowerCase())||t.map(i=>i.toLowerCase()).includes(a.toLowerCase()));0&&(module.exports={FilterProperty,PUNCTUATION,RARITY_VALUES_MAPPING,abbreviations,availableExclusions,availableModifiers,filterCard,filtersToCardPropertyMappings,getAbbreviation,getAbbreviationByCard,getCardByName,getCleanText,getExcludedMetaFilters,getKeywordsAndAppliedFiltersFromText,getMetaFilters,getNormalizedText,getRelatedCards,getRelatedCardsByName,getTokensReferencedByCards,multiWordShorthands,shorthands,singleWordShorthands});
@@ -36,6 +36,15 @@ const shorthands = [
36
36
  isCardProperty: false,
37
37
  shorthands: ["DR"]
38
38
  },
39
+ {
40
+ description: "Disease",
41
+ expanded: ['st:"disease"'],
42
+ filters: {
43
+ subtypes: [Subtype.Disease]
44
+ },
45
+ isCardProperty: false,
46
+ shorthands: ["Disease"]
47
+ },
39
48
  // {
40
49
  // description: "Flick daggers",
41
50
  // expanded: ["dagger you control deal 1 damage"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flesh-and-blood/search",
3
3
  "description": "TypeScript search engine for Flesh and Blood cards",
4
- "version": "4.0.69",
4
+ "version": "4.0.71",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "dist/index.cjs",
@@ -46,7 +46,7 @@
46
46
  "@flesh-and-blood/types": "^4.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@flesh-and-blood/cards": "^4.0.69",
49
+ "@flesh-and-blood/cards": "^4.0.71",
50
50
  "@flesh-and-blood/types": "^4.0.66",
51
51
  "@types/jest": "^29.5.11",
52
52
  "@types/node": "^20.10.5",
@@ -77,5 +77,5 @@
77
77
  "FAB",
78
78
  "FABTCG"
79
79
  ],
80
- "gitHead": "de7b17cfe53abb63ea6eae610d7a990e1c7eb9a9"
80
+ "gitHead": "5c633b69eb86d0d87b064c765ee615da3891a2a8"
81
81
  }