@dropins/storefront-pdp 0.2.2-alpha6 → 0.2.2-alpha7
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/713.js +1 -1
- package/package.json +1 -1
package/713.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 713.js.LICENSE.txt */
|
|
2
|
-
export const id=713;export const ids=[713];export const modules={7322:(t,n,r)=>{r.d(n,{XV:()=>u,gO:()=>o,gX:()=>c,iE:()=>l,mv:()=>i,yg:()=>a});var e=(new(r(9699).FetchGraphQL)).getMethods(),o=e.setEndpoint,i=e.setFetchGraphQlHeader,u=e.removeFetchGraphQlHeader,a=e.setFetchGraphQlHeaders,c=e.fetchGraphQl,l=e.getConfig},2675:(t,n,r)=>{r.d(n,{b:()=>f});var e=r(7322),o=r(3264),i=r(7140),u="\nquery GET_PRODUCT_DATA($skus: [String]) {\n products(skus: $skus) {\n ...ProductFragment\n }\n}\n\n".concat(i.K,"\n");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(){c=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,e=Object.defineProperty||function(t,n,r){t[n]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{f({},"")}catch(t){f=function(t,n,r){return t[n]=r}}function s(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,u=Object.create(i.prototype),a=new L(o||[]);return e(u,"_invoke",{value:P(t,r,a)}),u}function p(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var d={};function h(){}function v(){}function y(){}var m={};f(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==n&&r.call(b,i)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(n){f(t,n,(function(t){return this._invoke(n,t)}))}))}function x(t,n){function o(e,i,u,c){var l=p(t[e],t,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&r.call(s,"__await")?n.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):n.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(l.arg)}var i;e(this,"_invoke",{value:function(t,r){function e(){return new n((function(n,e){o(t,r,n,e)}))}return i=i?i.then(e,e):e()}})}function P(t,n,r){var e="suspendedStart";return function(o,i){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var a=E(u,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===e)throw e="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e="executing";var c=p(t,n,r);if("normal"===c.type){if(e=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(e="completed",r.method="throw",r.arg=c.arg)}}}function E(t,n){var r=n.method,e=t.iterator[r];if(void 0===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(e,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function S(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=y,e(w,"constructor",{value:y,configurable:!0}),e(y,"constructor",{value:v,configurable:!0}),v.displayName=f(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===v||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(x.prototype),f(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(n,r,e,o,i){void 0===i&&(i=Promise);var u=new x(s(n,r,e,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},O(w),f(w,l,"Generator"),f(w,i,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function e(r,e){return u.type="throw",u.arg=t,n.next=r,e&&(n.method="next",n.arg=void 0),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function l(t,n,r,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?n(c):Promise.resolve(c).then(e,o)}var f=function(){var t,n=(t=c().mark((function t(n){var r,i,a,l;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,e.gX)(u,{method:"GET",variables:{skus:[n]}});case 2:return i=t.sent,a=i.data,l=null==a||null===(r=a.products)||void 0===r?void 0:r[0],t.abrupt("return",(0,o.t)(l));case 6:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(e,o){var i=t.apply(n,r);function u(t){l(i,e,o,u,a,"next",t)}function a(t){l(i,e,o,u,a,"throw",t)}u(void 0)}))});return function(t){return n.apply(this,arguments)}}()},6052:(t,n,r)=>{r.d(n,{R:()=>m});var e=r(7322),o=r(3264),i=r(7140),u="\nquery REFINE_PRODUCT_QUERY(\n $optionIds: [String!]!\n $sku: String!\n) {\n # Refined Product\n refineProduct(\n optionIds: $optionIds \n sku: $sku\n ) {\n ...ProductFragment\n }\n\n # Parent Product\n products(skus: [$sku]) {\n ...ProductFragment\n }\n\n # %extendedPlaceholder%\n}\n\n".concat(i.K,"\n");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c=["products","refineProduct"];function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return f(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}function s(){s=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,e=Object.defineProperty||function(t,n,r){t[n]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,r){return t[n]=r}}function f(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,u=Object.create(i.prototype),a=new L(o||[]);return e(u,"_invoke",{value:P(t,r,a)}),u}function p(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d={};function h(){}function v(){}function y(){}var m={};l(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==n&&r.call(b,i)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function x(t,n){function o(e,i,u,c){var l=p(t[e],t,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&r.call(s,"__await")?n.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):n.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(l.arg)}var i;e(this,"_invoke",{value:function(t,r){function e(){return new n((function(n,e){o(t,r,n,e)}))}return i=i?i.then(e,e):e()}})}function P(t,n,r){var e="suspendedStart";return function(o,i){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var a=E(u,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===e)throw e="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e="executing";var c=p(t,n,r);if("normal"===c.type){if(e=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(e="completed",r.method="throw",r.arg=c.arg)}}}function E(t,n){var r=n.method,e=t.iterator[r];if(void 0===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(e,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function S(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=y,e(w,"constructor",{value:y,configurable:!0}),e(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===v||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(x.prototype),l(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(n,r,e,o,i){void 0===i&&(i=Promise);var u=new x(f(n,r,e,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},O(w),l(w,c,"Generator"),l(w,i,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function e(r,e){return u.type="throw",u.arg=t,n.next=r,e&&(n.method="next",n.arg=void 0),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function p(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function d(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){h(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function h(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,n||"default");if("object"!==a(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===a(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function v(t,n){if(null==t)return{};var r,e,o=function(t,n){if(null==t)return{};var r,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)r=i[e],n.indexOf(r)>=0||(o[r]=t[r]);return o}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)r=i[e],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,n,r,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?n(c):Promise.resolve(c).then(e,o)}var m=function(){var t,n=(t=s().mark((function t(n,r){var i,a,l,f,p,h,y,m,O,x;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=g(r),a=b(i,n),l=u.replace("# %extendedPlaceholder%",a),t.next=5,(0,e.gX)(l,{method:"GET",variables:{optionIds:r,sku:n}});case 5:if(f=t.sent,p=f.data){t.next=9;break}return t.abrupt("return",null);case 9:return h=p.products,y=p.refineProduct,m=v(p,c),O=null==h?void 0:h[0],x=w(Object.values(m),O.options),t.abrupt("return",(0,o.t)(d(d({},y||O),{},{sku:O.sku,name:O.name,options:x,optionUIDs:r})));case 13:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(e,o){var i=t.apply(n,r);function u(t){y(i,e,o,u,a,"next",t)}function a(t){y(i,e,o,u,a,"throw",t)}u(void 0)}))});return function(t,r){return n.apply(this,arguments)}}();function g(t){if(t.length<2)return[t];var n=[];return t.forEach((function(r){var e=[];t.forEach((function(t){r!==t&&e.push(t)})),n.push(e)})),n}function b(t,n){return t.map((function(t,r){return"\n ProductOption".concat(r,": refineProduct(\n optionIds: [\n ").concat(t.map((function(t){return'"'.concat(t,'"')})).join(", "),'\n ]\n sku: "').concat(n,'"\n ) {\n ... on ComplexProductView {\n options {\n ...ProductOptionFragment\n }\n }\n }\n ')})).join("")}function w(t,n){var r=Object.values(t).filter((function(t){return!!t})).reduce((function(t,n){return n.options?[].concat(l(t),l(n.options)):l(t)}),[]),e=new Map(n.map((function(t){return[t.id,t]})));return r.forEach((function(t){e.set(t.id,t)})),l(e.values())}},7140:(t,n,r)=>{r.d(n,{K:()=>e});var e="\nfragment ProductFragment on ProductView {\n __typename\n id\n sku\n name\n shortDescription\n description\n inStock\n addToCartAllowed\n url\n urlKey\n\n images(roles: []) {\n url\n label\n roles\n }\n\n attributes(roles: []) {\n name\n label\n value\n roles\n }\n\n... on SimpleProductView {\n price {\n roles\n\n regular {\n amount {\n value\n currency\n }\n }\n\n final {\n amount {\n value\n currency\n }\n }\n }\n}\n \n\n ... on ComplexProductView {\n options {\n ...ProductOptionFragment\n }\n \n priceRange {\n maximum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n minimum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n}\n\n".concat("\nfragment ProductOptionFragment on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n product {\n sku\n shortDescription\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n }\n","\n")},3264:(t,n,r)=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function i(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?o(Object(r),!0).forEach((function(n){u(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function u(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function a(t){return t?{name:t.name,sku:t.sku,addToCartAllowed:t.addToCartAllowed,inStock:t.inStock,shortDescription:t.shortDescription,description:t.description,images:c(t),prices:s(t),attributes:l(t),options:f(t),optionUIDs:t.optionUIDs}:null}function c(t){var n;return null===(n=t.images)||void 0===n?void 0:n.map((function(t){return t.url=t.url.replace(/^https?:/,""),t}))}function l(t){var n,r;return null===(n=t.attributes)||void 0===n||null===(r=n.filter((function(t){var n=t.roles;return-1!==(null==n?void 0:n.indexOf("visible_in_pdp"))})))||void 0===r?void 0:r.map((function(t){var n=t.label,r=t.value;return{id:t.name,label:n,value:r.toString().split(",").join(", ")}}))}function f(t){var n=t.options,r=t.optionUIDs;return null==n?void 0:n.map((function(t){var n,e,o=t.id,i=t.title,u=t.required,a=t.multi,c=t.values,l=null==c||null===(n=c[0])||void 0===n?void 0:n.__typename,f=c[0].type,s="ProductViewOptionValueProduct"===(null==c||null===(e=c[0])||void 0===e?void 0:e.__typename);return f=s?void 0:f?f.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):"dropdown","bp_size"===o&&(f="text"),{id:o,type:f,typename:l,label:i,required:u,multiple:a,items:null==c?void 0:c.map((function(t){var n,e=t.id,o=t.title,i=t.inStock,u=t.value;return"dropdown"===(null===(n=f)||void 0===n?void 0:n.toLowerCase())?{id:e,text:o,disabled:!i,value:u,selected:(null==r?void 0:r.indexOf(e))>-1}:{id:e,label:o,inStock:i,value:null==u?void 0:u.replace(/^https?:/,""),selected:(null==r?void 0:r.indexOf(e))>-1}}))}}))}function s(t){var n,r,e,o,u,a,c,l,f,s,p,d,h,v,y,m,g=t.price,b=t.priceRange,w=t.__typename,O="SimpleProductView"===w?{regular:{amount:g.regular.amount.value,currency:"NONE"===g.final.amount.currency?"USD":g.final.amount.currency,variant:g.regular.amount.value===g.final.amount.value?"default":"strikethrough"}}:{},x="SimpleProductView"===w?null==g||null===(n=g.roles)||void 0===n?void 0:n.includes("visible"):(null==b||null===(r=b.maximum)||void 0===r||null===(e=r.roles)||void 0===e?void 0:e.includes("visible"))&&(null==b||null===(o=b.minimum)||void 0===o||null===(u=o.roles)||void 0===u?void 0:u.includes("visible")),P="SimpleProductView"===w?{final:{amount:null==g||null===(a=g.final)||void 0===a?void 0:a.amount.value,currency:"NONE"===(null===(c=g.final)||void 0===c||null===(l=c.amount)||void 0===l?void 0:l.currency)?"USD":null==g||null===(f=g.final)||void 0===f||null===(s=f.amount)||void 0===s?void 0:s.currency,variant:"default"}}:{final:{currency:"NONE"===(null==b||null===(p=b.minimum)||void 0===p||null===(d=p.final)||void 0===d?void 0:d.amount.currency)?"USD":null==b||null===(h=b.minimum)||void 0===h||null===(v=h.final)||void 0===v?void 0:v.amount.currency,minimumAmount:null==b||null===(y=b.minimum)||void 0===y?void 0:y.final.amount.value,maximumAmount:null==b||null===(m=b.maximum)||void 0===m?void 0:m.final.amount.value}};return i(i(i({},O),P),{},{visible:x})}r.d(n,{t:()=>a})}};
|
|
2
|
+
export const id=713;export const ids=[713];export const modules={7322:(t,n,r)=>{r.d(n,{XV:()=>u,gO:()=>o,gX:()=>c,iE:()=>l,mv:()=>i,yg:()=>a});var e=(new(r(9699).FetchGraphQL)).getMethods(),o=e.setEndpoint,i=e.setFetchGraphQlHeader,u=e.removeFetchGraphQlHeader,a=e.setFetchGraphQlHeaders,c=e.fetchGraphQl,l=e.getConfig},2675:(t,n,r)=>{r.d(n,{b:()=>f});var e=r(7322),o=r(3264),i=r(7140),u="\nquery GET_PRODUCT_DATA($skus: [String]) {\n products(skus: $skus) {\n ...ProductFragment\n }\n}\n\n".concat(i.K,"\n");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(){c=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,e=Object.defineProperty||function(t,n,r){t[n]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{f({},"")}catch(t){f=function(t,n,r){return t[n]=r}}function s(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,u=Object.create(i.prototype),a=new L(o||[]);return e(u,"_invoke",{value:P(t,r,a)}),u}function p(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var d={};function h(){}function v(){}function y(){}var m={};f(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==n&&r.call(b,i)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(n){f(t,n,(function(t){return this._invoke(n,t)}))}))}function x(t,n){function o(e,i,u,c){var l=p(t[e],t,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&r.call(s,"__await")?n.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):n.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(l.arg)}var i;e(this,"_invoke",{value:function(t,r){function e(){return new n((function(n,e){o(t,r,n,e)}))}return i=i?i.then(e,e):e()}})}function P(t,n,r){var e="suspendedStart";return function(o,i){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var a=E(u,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===e)throw e="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e="executing";var c=p(t,n,r);if("normal"===c.type){if(e=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(e="completed",r.method="throw",r.arg=c.arg)}}}function E(t,n){var r=n.method,e=t.iterator[r];if(void 0===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(e,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function S(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=y,e(w,"constructor",{value:y,configurable:!0}),e(y,"constructor",{value:v,configurable:!0}),v.displayName=f(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===v||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(x.prototype),f(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(n,r,e,o,i){void 0===i&&(i=Promise);var u=new x(s(n,r,e,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},O(w),f(w,l,"Generator"),f(w,i,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function e(r,e){return u.type="throw",u.arg=t,n.next=r,e&&(n.method="next",n.arg=void 0),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function l(t,n,r,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?n(c):Promise.resolve(c).then(e,o)}var f=function(){var t,n=(t=c().mark((function t(n){var r,i,a,l;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,e.gX)(u,{method:"GET",variables:{skus:[n]}});case 2:return i=t.sent,a=i.data,l=null==a||null===(r=a.products)||void 0===r?void 0:r[0],t.abrupt("return",(0,o.t)(l));case 6:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(e,o){var i=t.apply(n,r);function u(t){l(i,e,o,u,a,"next",t)}function a(t){l(i,e,o,u,a,"throw",t)}u(void 0)}))});return function(t){return n.apply(this,arguments)}}()},6052:(t,n,r)=>{r.d(n,{R:()=>m});var e=r(7322),o=r(3264),i=r(7140),u="\nquery REFINE_PRODUCT_QUERY(\n $optionIds: [String!]!\n $sku: String!\n) {\n # Refined Product\n refineProduct(\n optionIds: $optionIds \n sku: $sku\n ) {\n ...ProductFragment\n }\n\n # Parent Product\n products(skus: [$sku]) {\n ...ProductFragment\n }\n\n # %extendedPlaceholder%\n}\n\n".concat(i.K,"\n");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c=["products","refineProduct"];function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return f(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}function s(){s=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,e=Object.defineProperty||function(t,n,r){t[n]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,r){return t[n]=r}}function f(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,u=Object.create(i.prototype),a=new L(o||[]);return e(u,"_invoke",{value:P(t,r,a)}),u}function p(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d={};function h(){}function v(){}function y(){}var m={};l(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==n&&r.call(b,i)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function x(t,n){function o(e,i,u,c){var l=p(t[e],t,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&r.call(s,"__await")?n.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):n.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(l.arg)}var i;e(this,"_invoke",{value:function(t,r){function e(){return new n((function(n,e){o(t,r,n,e)}))}return i=i?i.then(e,e):e()}})}function P(t,n,r){var e="suspendedStart";return function(o,i){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var a=E(u,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===e)throw e="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e="executing";var c=p(t,n,r);if("normal"===c.type){if(e=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(e="completed",r.method="throw",r.arg=c.arg)}}}function E(t,n){var r=n.method,e=t.iterator[r];if(void 0===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(e,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function S(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=y,e(w,"constructor",{value:y,configurable:!0}),e(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===v||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(x.prototype),l(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(n,r,e,o,i){void 0===i&&(i=Promise);var u=new x(f(n,r,e,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},O(w),l(w,c,"Generator"),l(w,i,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function e(r,e){return u.type="throw",u.arg=t,n.next=r,e&&(n.method="next",n.arg=void 0),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function p(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function d(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){h(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function h(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,n||"default");if("object"!==a(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===a(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function v(t,n){if(null==t)return{};var r,e,o=function(t,n){if(null==t)return{};var r,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)r=i[e],n.indexOf(r)>=0||(o[r]=t[r]);return o}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)r=i[e],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,n,r,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?n(c):Promise.resolve(c).then(e,o)}var m=function(){var t,n=(t=s().mark((function t(n,r){var i,a,l,f,p,h,y,m,O,x;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=g(r),a=b(i,n),l=u.replace("# %extendedPlaceholder%",a),t.next=5,(0,e.gX)(l,{method:"GET",variables:{optionIds:r,sku:n}});case 5:if(f=t.sent,p=f.data){t.next=9;break}return t.abrupt("return",null);case 9:return h=p.products,y=p.refineProduct,m=v(p,c),O=null==h?void 0:h[0],x=w(Object.values(m),O.options),t.abrupt("return",(0,o.t)(d(d({},y||O),{},{sku:O.sku,name:O.name,options:x,optionUIDs:r})));case 13:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(e,o){var i=t.apply(n,r);function u(t){y(i,e,o,u,a,"next",t)}function a(t){y(i,e,o,u,a,"throw",t)}u(void 0)}))});return function(t,r){return n.apply(this,arguments)}}();function g(t){if(t.length<2)return[t];var n=[];return t.forEach((function(r){var e=[];t.forEach((function(t){r!==t&&e.push(t)})),n.push(e)})),n}function b(t,n){return t.map((function(t,r){return"\n ProductOption".concat(r,": refineProduct(\n optionIds: [\n ").concat(t.map((function(t){return'"'.concat(t,'"')})).join(", "),'\n ]\n sku: "').concat(n,'"\n ) {\n ... on ComplexProductView {\n options {\n ...ProductOptionFragment\n }\n }\n }\n ')})).join("")}function w(t,n){var r=Object.values(t).filter((function(t){return!!t})).reduce((function(t,n){return n.options?[].concat(l(t),l(n.options)):l(t)}),[]),e=new Map(n.map((function(t){return[t.id,t]})));return r.forEach((function(t){e.set(t.id,t)})),l(e.values())}},7140:(t,n,r)=>{r.d(n,{K:()=>e});var e="\nfragment ProductFragment on ProductView {\n __typename\n id\n sku\n name\n shortDescription\n description\n inStock\n addToCartAllowed\n url\n urlKey\n\n images(roles: []) {\n url\n label\n roles\n }\n\n attributes(roles: []) {\n name\n label\n value\n roles\n }\n\n... on SimpleProductView {\n price {\n roles\n\n regular {\n amount {\n value\n currency\n }\n }\n\n final {\n amount {\n value\n currency\n }\n }\n }\n}\n \n\n ... on ComplexProductView {\n options {\n ...ProductOptionFragment\n }\n \n priceRange {\n maximum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n minimum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n}\n\n".concat("\nfragment ProductOptionFragment on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n product {\n sku\n shortDescription\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n }\n","\n")},3264:(t,n,r)=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function i(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?o(Object(r),!0).forEach((function(n){u(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function u(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function a(t){return t?{name:t.name,sku:t.sku,addToCartAllowed:t.addToCartAllowed,inStock:t.inStock,shortDescription:t.shortDescription,description:t.description,images:c(t),prices:s(t),attributes:l(t),options:f(t),optionUIDs:t.optionUIDs,url:t.url,urlKey:t.urlKey}:null}function c(t){var n;return null===(n=t.images)||void 0===n?void 0:n.map((function(t){return t.url=t.url.replace(/^https?:/,""),t}))}function l(t){var n,r;return null===(n=t.attributes)||void 0===n||null===(r=n.filter((function(t){var n=t.roles;return-1!==(null==n?void 0:n.indexOf("visible_in_pdp"))})))||void 0===r?void 0:r.map((function(t){var n=t.label,r=t.value;return{id:t.name,label:n,value:r.toString().split(",").join(", ")}}))}function f(t){var n=t.options,r=t.optionUIDs;return null==n?void 0:n.map((function(t){var n,e,o=t.id,i=t.title,u=t.required,a=t.multi,c=t.values,l=null==c||null===(n=c[0])||void 0===n?void 0:n.__typename,f=c[0].type,s="ProductViewOptionValueProduct"===(null==c||null===(e=c[0])||void 0===e?void 0:e.__typename);return f=s?void 0:f?f.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):"dropdown","bp_size"===o&&(f="text"),{id:o,type:f,typename:l,label:i,required:u,multiple:a,items:null==c?void 0:c.map((function(t){var n,e=t.id,o=t.title,i=t.inStock,u=t.value;return"dropdown"===(null===(n=f)||void 0===n?void 0:n.toLowerCase())?{id:e,text:o,disabled:!i,value:u,selected:(null==r?void 0:r.indexOf(e))>-1}:{id:e,label:o,inStock:i,value:null==u?void 0:u.replace(/^https?:/,""),selected:(null==r?void 0:r.indexOf(e))>-1}}))}}))}function s(t){var n,r,e,o,u,a,c,l,f,s,p,d,h,v,y,m,g=t.price,b=t.priceRange,w=t.__typename,O="SimpleProductView"===w?{regular:{amount:g.regular.amount.value,currency:"NONE"===g.final.amount.currency?"USD":g.final.amount.currency,variant:g.regular.amount.value===g.final.amount.value?"default":"strikethrough"}}:{},x="SimpleProductView"===w?null==g||null===(n=g.roles)||void 0===n?void 0:n.includes("visible"):(null==b||null===(r=b.maximum)||void 0===r||null===(e=r.roles)||void 0===e?void 0:e.includes("visible"))&&(null==b||null===(o=b.minimum)||void 0===o||null===(u=o.roles)||void 0===u?void 0:u.includes("visible")),P="SimpleProductView"===w?{final:{amount:null==g||null===(a=g.final)||void 0===a?void 0:a.amount.value,currency:"NONE"===(null===(c=g.final)||void 0===c||null===(l=c.amount)||void 0===l?void 0:l.currency)?"USD":null==g||null===(f=g.final)||void 0===f||null===(s=f.amount)||void 0===s?void 0:s.currency,variant:"default"}}:{final:{currency:"NONE"===(null==b||null===(p=b.minimum)||void 0===p||null===(d=p.final)||void 0===d?void 0:d.amount.currency)?"USD":null==b||null===(h=b.minimum)||void 0===h||null===(v=h.final)||void 0===v?void 0:v.amount.currency,minimumAmount:null==b||null===(y=b.minimum)||void 0===y?void 0:y.final.amount.value,maximumAmount:null==b||null===(m=b.maximum)||void 0===m?void 0:m.final.amount.value}};return i(i(i({},O),P),{},{visible:x})}r.d(n,{t:()=>a})}};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-pdp", "version": "0.2.2-
|
|
1
|
+
{"name": "@dropins/storefront-pdp", "version": "0.2.2-alpha7", "@dropins/elsie": "0.15.0"}
|