File: /home/zeusxp5/tour.kamille.us/wp-content/plugins/surecart/dist/4498.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[4498],{4805:function(e,n,t){t.d(n,{a:function(){return f},b:function(){return c},g:function(){return d}});var r=t(4467),o=t(3453);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){(0,r.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return u(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function c(e){for(var n,t="",r=Object.entries(e);n=r.shift();){var i=n,a=(0,o.A)(i,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var l,d=s(Object.entries(c).reverse());try{for(d.s();!(l=d.n()).done;){var f=(0,o.A)(l.value,2),p=f[0],h=f[1];r.unshift(["".concat(u,"[").concat(p,"]"),h])}}catch(e){d.e(e)}finally{d.f()}}else void 0!==c&&(null===c&&(c=""),t+="&"+[u,c].map(encodeURIComponent).join("="))}return t.substr(1)}function l(e){try{return decodeURIComponent(e)}catch(n){return e}}function d(e){return(function(e){var n;try{n=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(n)return n}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,n){var t=n.split("=").filter(Boolean).map(l),r=(0,o.A)(t,2),i=r[0],s=r[1],u=void 0===s?"":s;return i&&function(e,n,t){for(var r=n.length,o=r-1,i=0;i<r;i++){var s=n[i];!s&&Array.isArray(e)&&(s=e.length.toString()),s=["__proto__","constructor","prototype"].includes(s)?s.toUpperCase():s;var u=!isNaN(Number(n[i+1]));e[s]=i===o?t:e[s]||(u?[]:{}),Array.isArray(e[s])&&!u&&(e[s]=a({},e[s])),e=e[s]}}(e,i.replace(/\]/g,"").split("["),u),e}),Object.create(null))}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;if(!n||!Object.keys(n).length)return e;var t=e,r=e.indexOf("?");return-1!==r&&(n=Object.assign(d(e),n),t=t.substr(0,r)),t+"?"+c(n)}},8803:function(e,n,t){t.d(n,{a:function(){return z},h:function(){return J}});var r=t(9394),o=t(467),i=t(45),a=t(3453),s=t(4467),u=t(9280),c=t.n(u),l=t(4805),d=t(3506),f=["rest_route"],p=["path","url"],h=["url","path","data","parse"];function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function w(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){(0,s.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(e,n){return void 0!==(0,d.g)(e,n)}function m(e){var n=e.split("?"),t=n[1],r=n[0];return t?r+"?"+t.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,n){return e[0].localeCompare(n[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):r}var y=function(e,n){var t,r,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(t=e.namespace.replace(/^\/|\/$/g,""),o=(r=e.endpoint.replace(/^\//,""))?t+"/"+r:t),delete e.namespace,delete e.endpoint,n(w(w({},e),{},{path:o}))};function b(e,n){return Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var _=function(e){return e.json?e.json():Promise.reject(e)},O=function(e){return function(e){if(!e)return{};var n=e.match(/<([^>]+)>; rel="next"/);return n?{next:n[1]}:{}}(e.headers.get("link")).next},j=function(e){var n=!!e.path&&-1!==e.path.indexOf("per_page=-1"),t=!!e.url&&-1!==e.url.indexOf("per_page=-1");return n||t},k=function(){var e=(0,o.A)(c().mark((function e(n,t){var r,o,a,s,u,d;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==n.parse){e.next=2;break}return e.abrupt("return",t(n));case 2:if(j(n)){e.next=4;break}return e.abrupt("return",t(n));case 4:return e.next=6,z(w(w({},(f={per_page:100},void 0,void 0,h=(c=n).path,v=c.url,w(w({},(0,i.A)(c,p)),{},{url:v&&(0,l.a)(v,f),path:h&&(0,l.a)(h,f)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_(r);case 9:if(o=e.sent,Array.isArray(o)){e.next=12;break}return e.abrupt("return",o);case 12:if(a=O(r)){e.next=15;break}return e.abrupt("return",o);case 15:s=[].concat(o);case 16:if(!a){e.next=27;break}return e.next=19,z(w(w({},n),{},{path:void 0,url:a,parse:!1}));case 19:return u=e.sent,e.next=22,_(u);case 22:d=e.sent,s=s.concat(d),a=O(u),e.next=16;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}var c,f,h,v}),e)})));return function(_x,n){return e.apply(this,arguments)}}(),x=new Set(["PATCH","PUT","DELETE"]),P=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?e:204===e.status?null:e.json?e.json():Promise.reject(e)}(e,n)).catch((function(e){return A(e,n)}))};function A(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var n={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw n;return e.json().catch((function(){throw n}))}(e).then((function(e){var n={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||n}))}var I,S,E,D,T,C,M,N={Accept:"application/json, */*;q=0.1"},R={credentials:"include"},U=[function(e,n){return"string"!=typeof e.url||g(e.url,"_locale")||(e.url=(0,l.a)(e.url,{_locale:"user"})),"string"!=typeof e.path||g(e.path,"_locale")||(e.path=(0,l.a)(e.path,{_locale:"user"})),n(e)},y,function(e,n){var t=e.method,r=void 0===t?"GET":t;return x.has(r.toUpperCase())&&(e=w(w({},e),{},{headers:w(w({},e.headers),{},{"X-HTTP-Method-Override":r,"Content-Type":"application/json"}),method:"POST"})),n(e)},k],L=function(e){if(e.status>=200&&e.status<300)return e;throw e},q=function(e){var n=e.url,t=e.path,r=e.data,o=e.parse,a=void 0===o||o,s=(0,i.A)(e,h),u=e.body,c=e.headers;return c=w(w({},N),c),r&&(u=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(n||t||window.location.href,w(w(w({},R),s),{},{body:u,headers:c})).then((function(e){return Promise.resolve(e).then(L).catch((function(e){return A(e,a)})).then((function(e){return P(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function z(e){return U.reduceRight((function(e,n){return function(t){return n(t,e)}}),q)(e).catch((function(n){return"rest_cookie_invalid_nonce"!==n.code?Promise.reject(n):window.fetch(z.nonceEndpoint).then(L).then((function(e){return e.text()})).then((function(n){return z.nonceMiddleware.nonce=n,z(e)}))}))}z.use=function(e){U.unshift(e)},z.setFetchHandler=function(e){q=e},z.createNonceMiddleware=function(e){var n=function e(n,t){var r=n.headers,o=void 0===r?{}:r;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return t(n);return t(w(w({},n),{},{headers:w(w({},o),{},{"X-WP-Nonce":e.nonce})}))};return n.nonce=e,n},z.createPreloadingMiddleware=function(e){var n=Object.fromEntries(Object.entries(e).map((function(e){var n=(0,a.A)(e,2),t=n[0],r=n[1];return[m(t),r]})));return function(e,t){var r=e.parse,o=void 0===r||r,a=e.path;if(!a&&e.url){var s=(0,l.g)(e.url),u=s.rest_route,c=(0,i.A)(s,f);"string"==typeof u&&(a=(0,l.a)(u,c))}if("string"!=typeof a)return t(e);var d=e.method||"GET",p=m(a);if("GET"===d&&n[p]){var h=n[p];return delete n[p],b(h,!!o)}if("OPTIONS"===d&&n[d]&&n[d][p]){var v=n[d][p];return delete n[d][p],b(v,!!o)}return t(e)}},z.createRootURLMiddleware=function(e){return function(n,t){return y(n,(function(n){var r,o=n.url,i=n.path;return"string"==typeof i&&(r=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(i=i.replace("?","&")),o=r+i),t(w(w({},n),{},{url:o}))}))}},z.fetchAllMiddleware=k,z.mediaUploadMiddleware=function(e,n){if(!function(e){var n=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&n}(e))return n(e);var t=0,r=function e(r){return t++,n({path:"/wp/v2/media/".concat(r,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return t<5?e(r):(n({path:"/wp/v2/media/".concat(r,"?force=true"),method:"DELETE"}),Promise.reject())}))};return n(w(w({},e),{},{parse:!1})).catch((function(n){var t=n.headers.get("x-wp-upload-attachment-id");return n.status>=500&&n.status<600&&t?r(t).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:wp.i18n.__("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(n)})):A(n,e.parse)})).then((function(n){return P(n,e.parse)}))},z.createThemePreviewMiddleware=function(e){return function(n,t){if("string"==typeof n.url){var r=(0,d.g)(n.url,"wp_theme_preview");void 0===r?n.url=(0,l.a)(n.url,{wp_theme_preview:e}):""===r&&(n.url=(0,d.r)(n.url,"wp_theme_preview"))}if("string"==typeof n.path){var o=(0,d.g)(n.path,"wp_theme_preview");void 0===o?n.path=(0,l.a)(n.path,{wp_theme_preview:e}):""===o&&(n.path=(0,d.r)(n.path,"wp_theme_preview"))}return t(n)}},z.fetchAllMiddleware=null,z.use(z.createRootURLMiddleware((null===(S=null===(I=null===window||void 0===window?void 0:window.parent)||void 0===I?void 0:I.scData)||void 0===S?void 0:S.root_url)||(null===(E=null===window||void 0===window?void 0:window.scData)||void 0===E?void 0:E.root_url))),(null===(D=null===window||void 0===window?void 0:window.scData)||void 0===D?void 0:D.nonce)&&(z.nonceMiddleware=z.createNonceMiddleware(null===(T=null===window||void 0===window?void 0:window.scData)||void 0===T?void 0:T.nonce),z.use(z.nonceMiddleware)),(null===(C=null===window||void 0===window?void 0:window.scData)||void 0===C?void 0:C.nonce_endpoint)&&(z.nonceEndpoint=null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce_endpoint),z.use((function(e,n){return e.path=(0,l.a)(e.path,{t:Date.now()}),n(e)})),z.use((function(e,n){return e.path=(0,l.a)(e.path,w({},!!(0,d.g)(window.location.href,"currency")&&{currency:(0,d.g)(window.location.href,"currency")})),n(e)})),z.use((function(e,n){var t=n(e);return t.catch((function(e){var n;return"invalid_json"===e.code&&(e.message=wp.i18n.__("The response is not a valid JSON response.","surecart"),e.additional_errors=[{code:"invalid_json",message:wp.i18n.sprintf(/* translators: %s: URL to debug settings page */
wp.i18n.__("Please ensure that your site is not in debug mode as this may interfere with API responses. %s","surecart"),'<a href="'.concat("https://surecart.com/docs/is-not-a-valid-json-response/",'" target="_blank" rel="noopener noreferrer">').concat(wp.i18n.__("More Information","surecart"),"</a>"))}]),"checkout.finalize_error"===e.code&&(e.additional_errors=[].concat((0,r.A)((null===(n=null==e?void 0:e.additional_errors)||void 0===n?void 0:n.length)?[]:[{code:"checkout.finalize_error",message:e.message}]),(0,r.A)(e.additional_errors||[])),e.message=wp.i18n.__("We were not able to process this order","surecart")),Promise.reject(e)})),t}));var F=function(e){var n={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.","surecart")};if((null==e?void 0:e.code)&&(null==e?void 0:e.message))throw e;if(!e||!e.json)throw n;return e.json().catch((function(){throw n}))},J=function(){var e=(0,o.A)(c().mark((function e(n){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(n);case 2:if("rest_cookie_invalid_nonce"===(t=e.sent).code){e.next=5;break}throw t;case 5:return e.abrupt("return",window.fetch(z.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){z.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()},2942:function(e,n,t){t.d(n,{o:function(){return r}});var r=function(e,n){new window.IntersectionObserver((function(e,t){e[0].intersectionRatio>0&&(n(),t.unobserve(e[0].target))})).observe(e)}},3506:function(e,n,t){t.d(n,{g:function(){return o},r:function(){return i}});var r=t(4805);function o(e,n){return(0,r.g)(e)[n]}function i(e){var n=e.indexOf("?");if(-1===n)return e;for(var t=(0,r.g)(e),o=e.substr(0,n),i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];a.forEach((function(e){return delete t[e]}));var u=(0,r.b)(t);return u?o+"?"+u:o}},4498:function(e,n,t){t.r(n),t.d(n,{sc_downloads_list:function(){return v}});var r=t(4467),o=t(467),i=t(3029),a=t(2901),s=t(9280),u=t.n(s),c=t(1346),l=t(8803),d=t(2942),f=t(4805);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,r.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var v=function(){return(0,a.A)((function e(n){(0,i.A)(this,e),(0,c.r)(this,n),this.renderFileExt=function(e){var n,t,r,o,i,a,s,u,l;if(null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.filename)return null===(i=null===(o=null===(r=(t=e.media.filename).split)||void 0===r?void 0:r.call(t,"."))||void 0===o?void 0:o.pop)||void 0===i?void 0:i.call(o);if(null==e?void 0:e.url)try{var d=new URL(e.url);if(d.pathname.includes("."))return null===(l=null===(u=null===(s=(a=d.pathname).split)||void 0===s?void 0:s.call(a,"."))||void 0===u?void 0:u.pop)||void 0===l?void 0:l.call(u)}catch(e){console.error(e)}return(0,c.h)("sc-icon",{name:"file"})},this.customerId=void 0,this.productId=void 0,this.heading=void 0,this.downloads=void 0,this.downloading=void 0,this.busy=void 0,this.error=void 0,this.pagination={total:0,total_pages:0},this.query={page:1,per_page:20}}),[{key:"componentWillLoad",value:function(){var e=this;(0,d.o)(this.el,(function(){e.fetchItems()}))}},{key:"fetchItems",value:(t=(0,o.A)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.productId&&this.customerId){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.busy=!0,e.next=6,this.getItems();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(this.error),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart");case 12:return e.prev=12,this.busy=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[2,8,12,15]])}))),function(){return t.apply(this,arguments)})},{key:"getItems",value:(n=(0,o.A)(u().mark((function e(){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.a)({path:(0,f.a)("surecart/v1/downloads/",h({product_ids:[this.productId],customer_ids:[this.customerId],downloadable:!0},this.query)),parse:!1});case 2:return n=e.sent,this.pagination={total:parseInt(n.headers.get("X-WP-Total")),total_pages:parseInt(n.headers.get("X-WP-TotalPages"))},e.next=6,n.json();case 6:return this.downloads=e.sent,e.abrupt("return",this.downloads);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"nextPage",value:function(){this.query.page=this.query.page+1,this.fetchItems()}},{key:"prevPage",value:function(){this.query.page=this.query.page-1,this.fetchItems()}},{key:"downloadItem",value:(e=(0,o.A)(u().mark((function e(n){var t,r,o,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==n?void 0:n.url)){e.next=3;break}return this.downloadFile(n.url,null!==(t=null==n?void 0:n.name)&&void 0!==t?t:"file"),e.abrupt("return");case 3:if(o=null===(r=null==n?void 0:n.media)||void 0===r?void 0:r.id){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,this.downloading=o,e.next=10,(0,l.a)({path:(0,f.a)("surecart/v1/customers/".concat(this.customerId,"/expose/").concat(o),{expose_for:60})});case 10:if(null==(i=e.sent)?void 0:i.url){e.next=13;break}throw{message:wp.i18n.__("Could not download the file.","surecart")};case 13:this.downloadFile(null==i?void 0:i.url,i.filename),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(6),console.error(e.t0),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart");case 20:return e.prev=20,this.downloading=null,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[6,16,20,23]])}))),function(_x){return e.apply(this,arguments)})},{key:"downloadFile",value:function(e,n){var t=document.createElement("a");t.href=e,t.download=n,document.body.appendChild(t),t.click(),setTimeout((function(){document.body.removeChild(t)}),0)}},{key:"renderList",value:function(){var e,n,t=this;if((null==this?void 0:this.busy)&&!(null===(e=null==this?void 0:this.downloads)||void 0===e?void 0:e.length))return this.renderLoading();if(!(null===(n=null==this?void 0:this.downloads)||void 0===n?void 0:n.length))return this.renderEmpty();var r=this.downloads||[];return(0,c.h)("sc-card",{"no-padding":!0},(0,c.h)("sc-stacked-list",null,r.map((function(e){var n,r,o,i,a=null==e?void 0:e.media;return(0,c.h)("sc-stacked-list-row",{style:{"--columns":"1"}},(0,c.h)("sc-flex",{class:"single-download",justifyContent:"flex-start",alignItems:"center"},(0,c.h)("div",{class:"single-download__preview"},t.renderFileExt(e)),(0,c.h)("div",null,(0,c.h)("div",null,(0,c.h)("strong",null,null!==(r=null!==(n=null==a?void 0:a.filename)&&void 0!==n?n:null==e?void 0:e.name)&&void 0!==r?r:"")),(0,c.h)("sc-flex",{justifyContent:"flex-start",alignItems:"center",style:{gap:"0.5em"}},(null==a?void 0:a.byte_size)&&(0,c.h)("sc-format-bytes",{value:a.byte_size}),!!(null===(o=null==a?void 0:a.release_json)||void 0===o?void 0:o.version)&&(0,c.h)("sc-tag",{type:"primary",size:"small",style:{"--sc-tag-primary-background-color":"#f3e8ff","--sc-tag-primary-color":"#6b21a8"}},"v",null===(i=null==a?void 0:a.release_json)||void 0===i?void 0:i.version)))),(0,c.h)("sc-button",{size:"small",slot:"suffix",onClick:function(){return t.downloadItem(e)},busy:!!(null==a?void 0:a.id)&&t.downloading==(null==a?void 0:a.id),disabled:!!(null==a?void 0:a.id)&&t.downloading==(null==a?void 0:a.id)},wp.i18n.__("Download","surecart")))}))))}},{key:"renderLoading",value:function(){return(0,c.h)("sc-card",{"no-padding":!0,style:{"--overflow":"hidden"}},(0,c.h)("sc-stacked-list",null,(0,c.h)("sc-stacked-list-row",{style:{"--columns":"2"},"mobile-size":0},(0,c.h)("div",{style:{padding:"0.5em"}},(0,c.h)("sc-skeleton",{style:{width:"30%",marginBottom:"0.75em"}}),(0,c.h)("sc-skeleton",{style:{width:"20%"}})))))}},{key:"renderEmpty",value:function(){return(0,c.h)("div",null,(0,c.h)("sc-divider",{style:{"--spacing":"0"}}),(0,c.h)("slot",{name:"empty"},(0,c.h)("sc-empty",{icon:"download"},wp.i18n.__("You don't have any downloads.","surecart"))))}},{key:"render",value:function(){var e,n=this;return(0,c.h)("sc-dashboard-module",{key:"65aeac85deaf63e1ff72ce800cc82cb4309021b4",class:"purchase",part:"base",heading:wp.i18n.__("Downloads","surecart")},(0,c.h)("span",{key:"b414cae876550abbbe37fdb73fd8f6c7ac4d9dce",slot:"heading"},(0,c.h)("slot",{key:"8cb776835f359a0961e674c85eff78f28af41d47",name:"heading"},this.heading||wp.i18n.__("Downloads","surecart"))),this.renderList(),(0,c.h)("sc-pagination",{key:"2ddad307c9df1310b553a7117155a417fcdf414d",page:this.query.page,perPage:this.query.per_page,total:this.pagination.total,totalPages:this.pagination.total_pages,totalShowing:null===(e=null==this?void 0:this.downloads)||void 0===e?void 0:e.length,onScNextPage:function(){return n.nextPage()},onScPrevPage:function(){return n.prevPage()}}),this.busy&&(0,c.h)("sc-block-ui",{key:"c69765404bc5dcf8e1f81705e9e0c0cbb52eab7d"}))}},{key:"el",get:function(){return(0,c.a)(this)}}]);var e,n,t}();v.style=":host{display:block}.purchase{display:flex;flex-direction:column;gap:var(--sc-spacing-large)}.single-download .single-download__preview{display:flex;align-items:center;justify-content:center;background:var(--sc-color-gray-200);border-radius:var(--sc-border-radius-small);height:4rem;min-width:4rem;width:4rem}"},45:function(e,n,t){t.d(n,{A:function(){return o}});var r=t(8587);function o(e,n){if(null==e)return{};var t,o,i=(0,r.A)(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}},8587:function(e,n,t){function r(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}t.d(n,{A:function(){return r}})}}]);