forked from webaverse/zesty-market-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzesty-web-sdk.js
1 lines (1 loc) · 24.5 KB
/
zesty-web-sdk.js
1
(()=>{var t={206:(t,e,r)=>{t.exports=r(57)},387:(t,e,r)=>{"use strict";var n=r(485),s=r(570),i=r(940),a=r(581),o=r(574),u=r(845),c=r(338),h=r(524);t.exports=function(t){return new Promise((function(e,r){var p=t.data,l=t.headers,d=t.responseType;n.isFormData(p)&&delete l["Content-Type"];var f=new XMLHttpRequest;if(t.auth){var m=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";l.Authorization="Basic "+btoa(m+":"+g)}var y=o(t.baseURL,t.url);function b(){if(f){var n="getAllResponseHeaders"in f?u(f.getAllResponseHeaders()):null,i={data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:t,request:f};s(e,r,i),f=null}}if(f.open(t.method.toUpperCase(),a(y,t.params,t.paramsSerializer),!0),f.timeout=t.timeout,"onloadend"in f?f.onloadend=b:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(b)},f.onabort=function(){f&&(r(h("Request aborted",t,"ECONNABORTED",f)),f=null)},f.onerror=function(){r(h("Network Error",t,null,f)),f=null},f.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(h(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var w=(t.withCredentials||c(y))&&t.xsrfCookieName?i.read(t.xsrfCookieName):void 0;w&&(l[t.xsrfHeaderName]=w)}"setRequestHeader"in f&&n.forEach(l,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete l[e]:f.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),d&&"json"!==d&&(f.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&f.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){f&&(f.abort(),r(t),f=null)})),p||(p=null),f.send(p)}))}},57:(t,e,r)=>{"use strict";var n=r(485),s=r(875),i=r(29),a=r(941);function o(t){var e=new i(t),r=s(i.prototype.request,e);return n.extend(r,i.prototype,e),n.extend(r,e),r}var u=o(r(141));u.Axios=i,u.create=function(t){return o(a(u.defaults,t))},u.Cancel=r(132),u.CancelToken=r(603),u.isCancel=r(475),u.all=function(t){return Promise.all(t)},u.spread=r(739),u.isAxiosError=r(835),t.exports=u,t.exports.default=u},132:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},603:(t,e,r)=>{"use strict";var n=r(132);function s(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var t;return{token:new s((function(e){t=e})),cancel:t}},t.exports=s},475:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},29:(t,e,r)=>{"use strict";var n=r(485),s=r(581),i=r(96),a=r(9),o=r(941),u=r(144),c=u.validators;function h(t){this.defaults=t,this.interceptors={request:new i,response:new i}}h.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=o(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&u.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var h=[a,void 0];for(Array.prototype.unshift.apply(h,r),h=h.concat(i),s=Promise.resolve(t);h.length;)s=s.then(h.shift(),h.shift());return s}for(var p=t;r.length;){var l=r.shift(),d=r.shift();try{p=l(p)}catch(t){d(t);break}}try{s=a(p)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},h.prototype.getUri=function(t){return t=o(this.defaults,t),s(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){h.prototype[t]=function(e,r){return this.request(o(r||{},{method:t,url:e,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){h.prototype[t]=function(e,r,n){return this.request(o(n||{},{method:t,url:e,data:r}))}})),t.exports=h},96:(t,e,r)=>{"use strict";var n=r(485);function s(){this.handlers=[]}s.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},s.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=s},574:(t,e,r)=>{"use strict";var n=r(642),s=r(288);t.exports=function(t,e){return t&&!n(e)?s(t,e):e}},524:(t,e,r)=>{"use strict";var n=r(953);t.exports=function(t,e,r,s,i){var a=new Error(t);return n(a,e,r,s,i)}},9:(t,e,r)=>{"use strict";var n=r(485),s=r(212),i=r(475),a=r(141);function o(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return o(t),t.headers=t.headers||{},t.data=s.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return o(t),e.data=s.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(o(t),e&&e.response&&(e.response.data=s.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},953:t=>{"use strict";t.exports=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},941:(t,e,r)=>{"use strict";var n=r(485);t.exports=function(t,e){e=e||{};var r={},s=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function u(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function c(s){n.isUndefined(e[s])?n.isUndefined(t[s])||(r[s]=u(void 0,t[s])):r[s]=u(t[s],e[s])}n.forEach(s,(function(t){n.isUndefined(e[t])||(r[t]=u(void 0,e[t]))})),n.forEach(i,c),n.forEach(a,(function(s){n.isUndefined(e[s])?n.isUndefined(t[s])||(r[s]=u(void 0,t[s])):r[s]=u(void 0,e[s])})),n.forEach(o,(function(n){n in e?r[n]=u(t[n],e[n]):n in t&&(r[n]=u(void 0,t[n]))}));var h=s.concat(i).concat(a).concat(o),p=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===h.indexOf(t)}));return n.forEach(p,c),r}},570:(t,e,r)=>{"use strict";var n=r(524);t.exports=function(t,e,r){var s=r.config.validateStatus;r.status&&s&&!s(r.status)?e(n("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},212:(t,e,r)=>{"use strict";var n=r(485),s=r(141);t.exports=function(t,e,r){var i=this||s;return n.forEach(r,(function(r){t=r.call(i,t,e)})),t}},141:(t,e,r)=>{"use strict";var n=r(485),s=r(446),i=r(953),a={"Content-Type":"application/x-www-form-urlencoded"};function o(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(387)),u),transformRequest:[function(t,e){return s(e,"Accept"),s(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(o(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)||e&&"application/json"===e["Content-Type"]?(o(e,"application/json"),function(t,e,r){if(n.isString(t))try{return(0,JSON.parse)(t),n.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,r=e&&e.silentJSONParsing,s=e&&e.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||s&&n.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(a){if("SyntaxError"===t.name)throw i(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){c.headers[t]=n.merge(a)})),t.exports=c},875:t=>{"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},581:(t,e,r)=>{"use strict";var n=r(485);function s(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else if(n.isURLSearchParams(e))i=e.toString();else{var a=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),a.push(s(e)+"="+s(t))})))})),i=a.join("&")}if(i){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},288:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},940:(t,e,r)=>{"use strict";var n=r(485);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,s,i,a){var o=[];o.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),n.isString(s)&&o.push("path="+s),n.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},642:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},835:t=>{"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},338:(t,e,r)=>{"use strict";var n=r(485);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=s(window.location.href),function(e){var r=n.isString(e)?s(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},446:(t,e,r)=>{"use strict";var n=r(485);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},845:(t,e,r)=>{"use strict";var n=r(485),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,i,a={};return t?(n.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=n.trim(t.substr(0,i)).toLowerCase(),r=n.trim(t.substr(i+1)),e){if(a[e]&&s.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r}})),a):a}},739:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},144:(t,e,r)=>{"use strict";var n=r(843),s={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){s[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var i={},a=n.version.split(".");function o(t,e){for(var r=e?e.split("."):a,n=t.split("."),s=0;s<3;s++){if(r[s]>n[s])return!0;if(r[s]<n[s])return!1}return!1}s.transitional=function(t,e,r){var s=e&&o(e);function a(t,e){return"[Axios v"+n.version+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,o){if(!1===t)throw new Error(a(n," has been removed in "+e));return s&&!i[n]&&(i[n]=!0,console.warn(a(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,o)}},t.exports={isOlderVersion:o,assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],a=e[i];if(a){var o=t[i],u=void 0===o||a(o,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:s}},485:(t,e,r)=>{"use strict";var n=r(875),s=Object.prototype.toString;function i(t){return"[object Array]"===s.call(t)}function a(t){return void 0===t}function o(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==s.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===s.call(t)}function h(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===s.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:o,isPlainObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===s.call(t)},isFile:function(t){return"[object File]"===s.call(t)},isBlob:function(t){return"[object Blob]"===s.call(t)},isFunction:c,isStream:function(t){return o(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:h,merge:function t(){var e={};function r(r,n){u(e[n])&&u(r)?e[n]=t(e[n],r):u(r)?e[n]=t({},r):i(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)h(arguments[n],r);return e},extend:function(t,e,r){return h(e,(function(e,s){t[s]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},20:(t,e,r)=>{"use strict";var n=r(206),s=r.n(n);const i=t=>"ipfs"===t.substring(0,4)?`https://ipfs.zesty.market/ipfs/${t.substring(7)}`:"http"===t.substring(0,4)||"https"===t.substring(0,5)?t:"ar"!==t.substring(0,2)?`https://ipfs.zesty.market/ipfs/${t}`:void s().get(`https://arweave.net/${t.substring(5)}`).then((t=>t.url)).catch((t=>{console.error(t)})),a=()=>{const t=[{gateway:"https://cloudflare-ipfs.com",weight:35},{gateway:"https://gateway.pinata.cloud",weight:35},{gateway:"https://dweb.link",weight:30}],e=[];let r;for(r=0;r<t.length;r++)e[r]=t[r].weight+(e[r-1]||0);const n=Math.random()*e[e.length-1];for(r=0;r<e.length&&!(e[r]>n);r++);return t[r].gateway},o={tall:{width:.75,height:1,style:{standard:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-tall.png`,minimal:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-tall-minimal.png`,transparent:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-tall-transparent.png`}},wide:{width:4,height:1,style:{standard:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-wide.png`,minimal:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-wide-minimal.png`,transparent:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-wide-transparent.png`}},square:{width:1,height:1,style:{standard:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-square.png`,minimal:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-square-minimal.png`,transparent:`${a()}/ipns/lib.zesty.market/assets/zesty-banner-square-transparent.png`}}},u="square",c="standard",h="https://beacon2.zesty.market/zgraphql",p={matic:"https://api.thegraph.com/subgraphs/name/zestymarket/zesty-market-graph-matic",polygon:"https://api.thegraph.com/subgraphs/name/zestymarket/zesty-market-graph-matic",rinkeby:"https://api.thegraph.com/subgraphs/name/zestymarket/zesty-market-graph-rinkeby"},l={uri:void 0},d={name:"Default banner",description:"This is the default banner that would be displayed ipsum",image:"https://ipfs.zesty.market/ipfs/QmWBNfP8roDrwz3XQo4qpu9fMxvUSTn8LB7d4JK7ybrfZ2/assets/zesty-ad-square.png",url:"https://www.zesty.market"};console.log("Zesty SDK Version: ","1.6.0");class f extends HTMLElement{constructor(){super(),this.space="",this.network="polygon",this.format=u,this.bannerstyle=c,this.width="100%",this.height="100%",this.shadow=this.attachShadow({mode:"open"}),this.beacon=!0,this.adjustHeightandWidth=this.adjustHeightandWidth.bind(this)}connectedCallback(){this.style.cursor="pointer",this.space=this.hasAttribute("space")?this.getAttribute("space"):this.hasAttribute("adspace")?this.getAttribute("adspace"):this.space,null!==this.getAttribute("creator")&&console.warn("'creator' is no longer a required property of the Zesty Banner and can be omitted."),this.network=this.hasAttribute("network")?this.getAttribute("network"):this.network,this.format=this.hasAttribute("format")?this.getAttribute("format"):this.hasAttribute("adformat")?this.getAttribute("adformat"):this.format,this.bannerstyle=this.hasAttribute("bannerstyle")?this.getAttribute("bannerstyle"):this.bannerstyle,this.height=this.hasAttribute("height")?this.getAttribute("height"):this.height,this.width=this.hasAttribute("width")?this.getAttribute("width"):this.width,this.beacon=this.hasAttribute("beacon")?this.getAttribute("beacon"):this.beacon,this.adjustHeightandWidth(),async function(t,e,r,n,a,f,m,g,y){const b=await(async(t,e="polygon")=>{const r=Math.floor(Date.now()/1e3);return s().post(p[e],{query:`\n query {\n tokenDatas (\n where: {\n id: "${t}"\n }\n )\n { \n sellerNFTSetting {\n sellerAuctions (\n first: 5\n where: {\n contractTimeStart_lte: ${r}\n contractTimeEnd_gte: ${r}\n cancelled: false\n }\n ) {\n id\n buyerCampaigns {\n id\n uri\n }\n buyerCampaignsApproved\n buyerCampaignsIdList\n }\n }\n id\n }\n }\n `}).then((t=>(t=>{if(200!=t.status)return l;let e=t.data.data.tokenDatas[0]?.sellerNFTSetting?.sellerAuctions,r=null;return e?.[0]?.buyerCampaignsApproved?.find(((t,n)=>{if(t){const t=e[0].buyerCampaignsIdList[n];r=e[0].buyerCampaigns.find((e=>e.id===t))}})),null==r?l:r})(t))).catch((t=>(console.log(t),l)))})(t,e),w=await(async(t,e,r,n,a)=>{if(!t){let t={uri:"DEFAULT_URI",data:d},n=e||u,s=r||c,i=a||o;return t.data.image=i[n].style[s],t}return s().get(i(t)).then((e=>{var r;return-1===(r=e.data.url).indexOf("utm_source=")&&-1===r.indexOf("utm_campaign=")&&-1===r.indexOf("utm_channel=")&&(e.data.url=((t,e)=>{let r=new URL(t);return r.searchParams.set("utm_source","ZestyMarket"),r.searchParams.set("utm_campaign","ZestyCampaign"),r.searchParams.set("utm_channel",`SpaceId_${e}`),r.href})(e.data.url,n)),200==e.status?{uri:t,data:e.data}:null}))})(b.uri,n,a,t);let v=w.data.url;v=v.match(/^http[s]?:\/\//)?v:"https://"+v,"https://www.zesty.market"===v&&(v=`https://app.zesty.market/space/${t}`);let x=w.data.image;x=x.match(/^.+\.(png|jpe?g)/i)?x:i(x);const k=document.createElement("img");f.appendChild(k),k.setAttribute("id",w.uri),k.style.width=m,k.style.height=g,k.setAttribute("crossorigin",""),k.setAttribute("data-url",v),k.addEventListener("click",(e=>{e.preventDefault(),(t=>{t&&(null!=window.XRHand&&null!=window.XRMediaBinding&&t.includes("https://www.oculus.com/experiences/quest/")?setTimeout((()=>{window.open(t,"_blank")}),1e3):window.open(t,"_blank"))})(v),y&&(async t=>{try{const e=`https://beacon.zesty.market/api/v1/space/click/${t}`;await s().put(e),await s().post(h,{query:`mutation { increment(eventType: clicks, spaceId: "${t}") { message } }`},{headers:{"Content-Type":"application/json"}})}catch(t){console.log("Failed to emit onclick event",t.message)}})(t)})),y&&(async t=>{try{const e=`https://beacon.zesty.market/api/v1/space/${t}`;await s().put(e),await s().post(h,{query:`mutation { increment(eventType: visits, spaceId: "${t}") { message } }`},{headers:{"Content-Type":"application/json"}})}catch(t){console.log("Failed to emit onload event",t.message)}})(t),w.data.image&&(k.setAttribute("src",x),new Promise(((t,e)=>{k.onload=()=>t({img:k,uri:w.uri,url:v}),k.onerror=()=>e(new Error("img load error"))})))}(this.space,this.creator,this.network,this.format,this.bannerstyle,this.shadow,this.width,this.height,this.beacon)}adjustHeightandWidth(){const t=/(\d+)/,e=this.height.split(t),r=this.width.split(t);this.height=this.hasAttribute("height")?this.height:this.hasAttribute("width")?`${r[1]/o[this.format].width}${r[2]}`:this.height,this.width=this.hasAttribute("height")?`${e[1]*o[this.format].width}${e[2]}`:(this.hasAttribute("width"),this.width)}}customElements.define("zesty-web",f)},843:t=>{"use strict";t.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},e={};function r(n){var s=e[n];if(void 0!==s)return s.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r(20)})();