1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4049],{73943:function(e,n,t){var r=t(85893),a=t(94184),s=t.n(a);n.Z=function(e){var n=e.id,t=e.label,a=e.checked,l=e.className,i=e.onClick,c=e.size,o=void 0===c?"md":c,d=e.disabled,u=void 0!==d&&d,m=e.readOnly,f=void 0!==m&&m;return(0,r.jsxs)("div",{className:s()("flex items-center gap-2",l,{"cursor-not-allowed":u,"cursor-pointer":!u}),onClick:i,children:[(0,r.jsx)("input",{type:"checkbox",checked:a,name:n,id:n,className:s()("focus:outline-none",{"w-6 h-6 rounded":"md"===o,"w-12 h-12 rounded-lg":"xl"===o,"cursor-not-allowed":u,"cursor-pointer":!u}),readOnly:f}),t&&(0,r.jsx)("label",{htmlFor:n,className:s()({"cursor-not-allowed":u,"cursor-pointer":!u}),children:t})]})}},83097:function(e,n,t){var r=t(85893),a=t(94184),s=t.n(a),l=t(67294);n.Z=function(e){var n=e.type,t=void 0===n?"text":n,a=e.value,i=e.min,c=e.max,o=e.step,d=e.placeholder,u=e.onChange,m=e.className,f=(0,l.useState)(Number.isNaN(a)?"":a),x=f[0],p=f[1];return(0,l.useEffect)((function(){p(Number.isNaN(a)?"":a)}),[a]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("input",{type:"text",placeholder:d,step:"number"===t?o||"any":void 0,min:i,max:c,value:x,onKeyPress:function(e){if("text"!==t){var n=e.target.value,r=n.includes(".")||n.includes(","),a="."===e.key||","===e.key;(!/^[\d,.]*$/.test(e.key)||a&&r)&&e.preventDefault(),e.target.value=n.replace(",",".")}},onChange:function(e){return p(e.target.value),"number"!==t||Number.isNaN(parseFloat(e.target.value))?u(e.target.value):u(parseFloat(e.target.value))},className:s()("border-2 border-gray-200 dark:border-secondary-dark dark:bg-secondary-dark rounded-lg outline-none placeholder:text-gray-400",m)})})}},15951:function(e,n,t){var r=t(85893),a=t(31190),s=t(42768);n.Z=function(e){var n=e.children,t=e.isOpen,l=e.onClose;return t?(0,r.jsx)(a.Z,{center:!0,open:t,onClose:l,closeIcon:(0,r.jsx)(s.Z,{width:20,className:"dark:fill-white"}),children:(0,r.jsx)("div",{className:"bg-white dark:bg-primary-dark rounded-lg max-w-[600px]",children:n})}):null}},14049:function(e,n,t){t.r(n);var r=t(47568),a=t(14924),s=t(26042),l=t(69396),i=t(34051),c=t.n(i),o=t(85893),d=t(9669),u=t.n(d),m=t(94184),f=t.n(m),x=t(25675),p=t.n(x),v=t(67294),h=t(64712),b=t(77058),j=t(84139),N=t(73943),k=t(83097),g=t(15951),y=t(71615),w=t(78056),C=t(44718),Z=t(26087),F=t(95827),S=t(90215);n.default=function(e){var n=e.nfts,t=e.customCta,i=e.ctaClassname,d=e.sellerFeeBasisPoints,m=void 0===d?500:d,x=(0,b.$)().t,_=(0,C.R)().connection,A=(0,y.Z)().listMultiple,O=(0,v.useState)(!1),L=O[0],P=O[1],E=(0,v.useState)(m/100),M=E[0],I=E[1],R=(0,v.useState)(.5),U=R[0],B=R[1],D=(0,v.useState)(!1),K=D[0],T=D[1],$=(0,v.useState)(!1),q=$[0],z=$[1],Y=(0,v.useState)([]),G=Y[0],H=Y[1],J=(0,v.useState)(0),Q=J[0],V=J[1],W=(0,v.useState)(n.reduce((function(e,n){return(0,l.Z)((0,s.Z)({},e),(0,a.Z)({},n.tokenAddress,void 0))}),{})),X=W[0],ee=W[1],ne=Object.keys(X).reduce((function(e,n){return e+X[n]}),0);function te(){return(te=(0,r.Z)(c().mark((function e(){var t,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_.getMultipleAccountsInfo(null===n||void 0===n?void 0:n.map((function(e){return(0,S.s)(new Z.PublicKey(e.tokenAddress))})));case 2:t=e.sent,r=null===t||void 0===t?void 0:t.some((function(e){if(null===e||void 0===e?void 0:e.data){var n=F.Metadata.fromAccountInfo(e)[0];return!!(null===n||void 0===n?void 0:n.programmableConfig)}})),z(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var re=m/100+2-(M+U),ae=function(){var e=(0,r.Z)(c().mark((function e(n){var t,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,w.jj)(n.map((function(e){return e.collectionUrl}))),e.next=3,u().get("".concat("https://api-v2.solanart.io","/collections/multiple"),{params:{urls:t}});case 3:r=e.sent,H(r.data);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),se=(0,v.useCallback)((function(e,n){var t=X;t[e]=n,ee((0,s.Z)({},t))}),[X]),le=(0,v.useCallback)((function(){var e=!0;return Object.keys(X).forEach((function(n){X[n]||(e=!1)})),e}),[X]),ie=function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(M>15)){e.next=2;break}return e.abrupt("return",h.A.error("Maximum creator fees is 15%"));case 2:if(!(U+M>
1100)){e.next=4;break}return e.abrupt("return",h.A.error("Fees are too high"));case 4:if(!le()){e.next=10;break}return e.next=7,A(n,X,{marketplaceFees:L?100*U:null,creatorFees:L?100*M:null},"solanart-v1");case 7:T(!1),e.next=11;break;case 10:h.A.error("Please fill all the prices");case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,v.useEffect)((function(){n.forEach((function(e){if(!Q){var n=X;delete n[e.tokenAddress],ee((0,s.Z)({},n))}se(e.tokenAddress,Q)}))}),[Q]),(0,v.useEffect)((function(){ae(n),function(){te.apply(this,arguments)}()}),[n]),(0,v.useEffect)((function(){q&&B(2)}),[q]),(0,o.jsxs)(o.Fragment,{children:[t?(0,o.jsx)("button",{className:i,onClick:function(){return T(!0)},children:t}):(0,o.jsx)(j.Z,{className:i,onClick:function(){return T(!0)},children:"List"}),(0,o.jsxs)(g.Z,{isOpen:K,onClose:function(){return T(!1)},children:[(0,o.jsxs)("div",{className:"p-6",children:[(0,o.jsx)("div",{className:"font-semibold text-2xl mb-10",children:"List items"}),(0,o.jsx)("div",{className:"mb-5",children:(0,o.jsx)("div",{className:f()("bg-blue-500 bg-opacity-10 px-4 py-2 rounded text-blue-500 mb-2 transition-all",{hidden:!q,block:q}),children:"Fees are not editable on programmable NFTs."})}),(0,o.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2",children:n.map((function(e,n){var t,r=X[e.tokenAddress],a=null===(t=null===G||void 0===G?void 0:G.find((function(n){return n.url===e.collectionUrl})))||void 0===t?void 0:t.floorPrice;return(0,o.jsxs)("div",{className:"mb-5",children:[(0,o.jsxs)("div",{className:"flex items-start gap-3 mb-2",children:[(0,o.jsx)("div",{className:"group-hover:scale-110 duration-500 transition-all relative w-[70px] rounded-md overflow-hidden",style:{aspectRatio:"1"},children:(0,o.jsx)(p(),{src:"https://api-v2.solanart.io/cdn/150/".concat(e.image),blurDataURL:"https://api-v2.solanart.io/cdn/40/".concat(e.image),alt:e.name,layout:"fill",objectFit:"cover",objectPosition:"center"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"font-semibold mb-1",children:e.name}),(0,o.jsx)(k.Z,{type:"number",placeholder:"Price (SOL)",min:0,value:r,onChange:function(n){return se(e.tokenAddress,parseFloat(n))},className:"w-40"})]})]}),!!(a&&r&&r<a)&&(0,o.jsxs)("div",{className:"text-yellow-500 text-sm",children:["Price is under floor of ",a," SOL"]})]},"list-nft-".concat(n))}))}),(0,o.jsxs)("div",{className:"mb-6",children:[(0,o.jsx)("div",{className:"mb-2",children:x("edit_bulk_price")}),(0,o.jsx)(k.Z,{type:"number",placeholder:"Price (SOL)",min:0,max:100,value:Q,onChange:function(e){return V(parseFloat(e))},className:"w-full"})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsx)(N.Z,{checked:L,onClick:function(){q||P(!L)},className:f()("mb-4",{"cursor-not-allowed opacity-30":q}),label:x("click_to_unlock_fees"),disabled:q,readOnly:!0}),(0,o.jsxs)("p",{className:"text-gray-400",children:[(0,o.jsxs)("b",{children:[(0,w.kC)(x("important")),":"]})," ",x("fees_disclaimer")]})]}),(0,o.jsx)("div",{className:f()("flex flex-wrap gap-2 p-5 bg-gray-100 dark:bg-secondary-dark rounded-lg w-1/2",{"cursor-not-allowed":!L}),children:(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsx)("div",{className:"mb-1",children:x("creator_fees")}),(0,o.jsx)(k.Z,{type:"number",min:0,max:100,value:M,onChange:function(e){return I(parseFloat(e))},className:f()("w-full mb-1 dark:bg-[#2d3034]",{"pointer-events-none opacity-40":!L})}),(0,o.jsxs)("div",{className:f()("flex gap-2 items-center text-sm",{"pointer-events-none opacity-40":!L}),children:[(0,o.jsx)("div",{className:"text-gray-500",children:"Suggested:"}),(0,o.jsxs)(j.Z,{variant:"text",className:"text-blue-500 hover:underline",onClick:function(){return I(m/100/4)},children:[m/100/4,"%"]}),(0,o.jsxs)(j.Z,{variant:"text",className:"text-blue-500 hover:underline",onClick:function(){return I(m/100/2)},children:[m/100/2,"%"]}),(0,o.jsxs)(j.Z,{variant:"text",className:"text-blue-500 hover:underline",onClick:function(){return I(m/100)},children:[m/100/1,"%"]})]})]})})]}),!q&&(0,o.jsxs)("div",{className:"mt-3",children:[re>=0?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)("span",{className:"text-red-500",children:["You will pay an additional fee equivalent to"," ",(0,o.jsxs)("span",{className:"text-red-500 font-bold",children:[-(0,w.ts)(re,2),"%"]})," ","or"," ",(0,o.jsxs)("span",{className:"text-red-500 font-bold",children:[-(0,w.ts)((ne||0)*re/100,2)," ","SOL"]})]}),(0,o.jsx)("br",{}),(0,o.jsxs)("div",{className:"text-sm text-gray-300",children:[x("marketplace_fees"),": 0.5%"]})]})]}),(0,o.jsxs)("div",{className:"w-full p-6",children:[(0,o.jsxs)("div",{className:"flex w-full gap-4 mb-2",children:[(0,o.jsx)("button",{className:"border p-5 flex-1 rounded-lg",onClick:function(){return T(!1)},children:"Cancel"}),(0,o.jsx)("button",{className:"p-5 flex-1 bg-black text-white rounded-lg",onClick:ie,children:"List"})]}),(0,o.jsxs)("div",{className:"text-sm opacity-80",children:['By clicking "List", you agree to '," ","our Terms of Service","."]})]})]})]})}}}]);
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.