text: import{a as S,b as k}from"./chunk-GJCFI7K5.js";import{a as R}from"./chunk-LXZHOT3M.js";import"./chunk-JOGHNHMO.js";import{a as L}from"./chunk-YZ2VIXA6.js";import"./chunk-C4L2DL62.js";import{a as h}from"./chunk-CAKCK4NI.js";import{a as _}from"./chunk-CQI4LTJC.js";import{a as H}from"./chunk-DREXNAOH.js";import"./chunk-S4JGXK5I.js";import{a as i}from"./chunk-YK3WCXGE.js";import{a as I}from"./chunk-GMERTW32.js";import{a as d}from"./chunk-H3CO5HSE.js";import"./chunk-R5QTS4JB.js";import{a as B}from"./chunk-LZ2L2TIX.js";import{a as g}from"./chunk-EUWXZKWZ.js";import"./chunk-DO7SCVXY.js";import{a as T}from"./chunk-HNI63WVA.js";import"./chunk-KE767BLN.js";import"./chunk-TUVTWIHM.js";import{a as z}from"./chunk-4ATHPVF4.js";import"./chunk-RTMHI3L7.js";import{a as N}from"./chunk-JZHGPOOI.js";import{a as A}from"./chunk-TUVTX7TQ.js";import"./chunk-IWE7LPGP.js";import{b as m}from"./chunk-SBFBOIF5.js";import{a as x}from"./chunk-M5RMVAY3.js";import{a as n}from"./chunk-VWFYI5BK.js";import"./chunk-QVWAWWED.js";import"./chunk-PYHGZC4L.js";import"./chunk-D76XH5RX.js";import"./chunk-MA3AC62H.js";import"./chunk-YJHKALOE.js";import"./chunk-ZMMQFEZR.js";import"./chunk-DTSXLBNB.js";import"./chunk-NCV3HP3S.js";import{a as u}from"./chunk-YG74QOJP.js";import"./chunk-STY5NEH4.js";import"./chunk-M7Q5FD7X.js";import{a as y}from"./chunk-K2U7JEMX.js";import"./chunk-PUAVFQTB.js";import"./chunk-OHKPSLFK.js";import"./chunk-EJREXK3Y.js";async function l(t,e){let a=await T({cmd:"potionbazaar",subcmd:"buyitem",item_id:t,quantity:e}),r=L(a);return r==="You purchased the item!"?{r:Array(e),s:!0}:{e:{message:r},s:!1}}function c(t,e){return H({cmd:"potionbazaar",subcmd:"buyitem",item_id:t,quantity:e})}function p(t,e){return _(c,l,t,e)}var o='<table class="fshBazaar"><tr><td colspan="5">Select an item to quick-buy:</td></tr><tr><td colspan="5">Select how many to quick-buy</td></tr><tr><td colspan="5"><input id="buy_amount" class="fshNumberInput" type="number" min="0" max="99" value="1"></td></tr><tr><td>@0@</td><td>@1@</td><td>@2@</td><td>@3@</td><td>@4@</td></tr><tr><td>@5@</td><td>@6@</td><td>@7@</td><td>@8@</td><td>@9@</td></tr><tr><td colspan="3">Selected item:</td><td id="selectedItem" colspan="2"></td></tr><tr><td colspan="5"><span class="fshBazaarWarning fshHide">Warning:<br>pressing [<span id="fshBuy" class="fshLink">This button</span>] now will buy the <span id="quantity">1</span> item(s) WITHOUT confirmation!</span></td></tr><tr><td colspan="5"><span id="buyResultLabel"></span><ol id="buy_result"></ol></td></tr></table>',$=`<span class="bazaarButton tip-dynamic" style="background-image: url('@src@');" itemid="@itemid@" data-tipped="@tipped@"></span>`,f,b,q,w,s,E,W;function v(){return R(b.value)}function C(t,e){i(e,s),f=t.getAttribute("itemid"),w.classList.remove("fshHide");let a=t.cloneNode(!1);a.className="bazaarSelected tip-dynamic";let r=q;x("",r),I(r,a)}function F(t){let{target:e}=t;if(!A("bazaarButton",e))return;let a=v();!a||C(e,a)}function Q(){let t=v();t&&i(t,s)}function V(t){let e=W;k(t,e)||t.s&&S(`You purchased ${t.r.length} item(s)!`,e)}async function j(){if(!f)return;let t=z(s);i(`Buying ${t} items`,E);let e=await p(f,t);V(e)}function Y(t,e){let a=t.children[0],{tipped:r}=a.dataset;o=o.replace(`@${e}@`,$).replace("@src@",a.getAttribute("src")).replace("@itemid@",r.match(/\?item_id=(\d+)/)[1]).replace("@tipped@",r)}function D(){b=n("buy_amount"),q=n("selectedItem"),w=d(".fshBazaarWarning"),s=n("quantity"),E=n("buyResultLabel"),W=n("buy_result")}function M(){D(),u(d(".fshBazaar"),F),y(b,"input",Q),u(n("fshBuy"),j)}function O(){if(N())return;let t=g("img",m)[0];t.className="fshFloatLeft",B("a",m).forEach(Y),o=o.replace(/@\d@/g,""),h(t.parentNode,o),M()}export{O as default};
  //# sourceMappingURL=bazaar-YN7VPW73.js.map
  