Version Description
- 2021-07-13 =
- Tweak - Replace Calypso FormCheckbox with CheckboxControl.
Download this release
Release Info
Developer | woothemes |
Plugin | WooCommerce Services |
Version | 1.25.17 |
Comparing to | |
See all releases |
Code changes from version 1.25.16 to 1.25.17
- dist/chunks/{3d6f65e24d3962e9c11c.css → 07454ab660839c761209.css} +0 -0
- dist/chunks/{3d6f65e24d3962e9c11c.min.js → 07454ab660839c761209.min.js} +1 -1
- dist/chunks/{922491ee86553d15c65f.css → 099e744625fd2e20a515.css} +0 -0
- dist/chunks/099e744625fd2e20a515.min.js +1 -0
- dist/chunks/1209db5094dffd59872d.min.js +0 -1
- dist/chunks/{32acea31b1c95a860379.css → 175a99358c521f124e23.css} +0 -0
- dist/chunks/175a99358c521f124e23.min.js +1 -0
- dist/chunks/{330cd35f20d6afaae4c1.css → 22a59c0c632bd2d30080.css} +0 -0
- dist/chunks/{330cd35f20d6afaae4c1.min.js → 22a59c0c632bd2d30080.min.js} +1 -1
- dist/chunks/32acea31b1c95a860379.min.js +0 -1
- dist/chunks/{8dd9441fc50c76b0b0a8.css → 5a5c55a7c9bccfa8425c.css} +0 -0
- dist/chunks/{8dd9441fc50c76b0b0a8.min.js → 5a5c55a7c9bccfa8425c.min.js} +1 -1
- dist/chunks/{32d882822d58f49da0fb.css → 7566d5c5f55e31b018b9.css} +0 -0
- dist/chunks/{32d882822d58f49da0fb.min.js → 7566d5c5f55e31b018b9.min.js} +1 -1
- dist/chunks/{af4dd931a6236fa69676.min.js → 812e0ca7b4ca31cc54d9.min.js} +1 -1
- dist/chunks/922491ee86553d15c65f.min.js +0 -1
- dist/chunks/{f21fad998bd5b17c6379.min.js → 943063d0aa7c2c49678f.min.js} +1 -1
- dist/chunks/{8a47962d1574594e5623.css → 997e476a34f1d4a94b3f.css} +0 -0
- dist/chunks/{8a47962d1574594e5623.min.js → 997e476a34f1d4a94b3f.min.js} +1 -1
dist/chunks/{3d6f65e24d3962e9c11c.css → 07454ab660839c761209.css}
RENAMED
File without changes
|
dist/chunks/{3d6f65e24d3962e9c11c.min.js → 07454ab660839c761209.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[156],{819:function(e,a,t){},827:function(e,a,t){"use strict";t.r(a);var r=t(10),n=t.n(r),c=t(12),i=t.n(c),o=t(109),l=t(30),s=t(34),d=t(537),m=t.n(d),u=t(570),k=t(
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[156],{819:function(e,a,t){},827:function(e,a,t){"use strict";t.r(a);var r=t(10),n=t.n(r),c=t(12),i=t.n(c),o=t(109),l=t(30),s=t(34),d=t(537),m=t.n(d),u=t(570),k=t(555),g=t(547),b=t(582),w=t(540),p=t(716),_=(t(819),function(e){var a=e.loaded,t=e.translate;if(!a)return null;var r=function(){return e.exitTrackingFlow(e.orderId,e.siteId,!1)};return n.a.createElement(u.a,{additionalClassNames:"woocommerce tracking-modal wcc-root",isVisible:e.showTrackingDialog,onClose:r},n.a.createElement("div",{className:"tracking-modal__content"},n.a.createElement("div",{className:"tracking-modal__header"},n.a.createElement(k.a,null,t("Which package would you like to track?")),n.a.createElement(b.a,{className:"tracking-modal__close-button",onClick:r},n.a.createElement(m.a,{icon:"cross"}))),n.a.createElement("div",{className:"tracking-modal__body"},n.a.createElement("div",{className:"tracking-modal__main-section"},n.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},n.a.createElement(p.a,{orderId:e.orderId,siteId:e.siteId,isModal:!0}))))))});_.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};a.default=Object(o.b)(function(e,a){var t=a.orderId,r=a.siteId,n=Object(w.t)(e,t,r),c=Object(w.j)(e,t,r);return{loaded:n,form:n&&c.form,showTrackingDialog:c.showTrackingDialog,isCustomsFormRequired:Object(w.p)(e,t,r)}},function(e){return Object(l.b)({exitTrackingFlow:g.p},e)})(Object(s.localize)(_))}}]);
|
dist/chunks/{922491ee86553d15c65f.css → 099e744625fd2e20a515.css}
RENAMED
File without changes
|
dist/chunks/099e744625fd2e20a515.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{551:function(e,t,a){"use strict";var r=a(533),n=a.n(r),s=a(536),i=a.n(s),c=a(10),o=a.n(c),l=a(12),u=a.n(l),d=a(528),m=a.n(d),p=a(34),g=function(e){var t=e.children,a=e.required,r=e.optional,s=e.translate,c=e.className,l=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),u=i()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),d=l?null:o.a.createElement(o.a.Fragment,null,t,a&&o.a.createElement("small",{className:"form-label__required"},s("Required")),r&&o.a.createElement("small",{className:"form-label__optional"},s("Optional")));return o.a.createElement("label",n()({},u,{dangerouslySetInnerHTML:l,className:m()(c,"form-label")}),d)};g.propTypes={required:u.a.bool,optional:u.a.bool,children:u.a.node},t.a=Object(p.localize)(g)},556:function(e,t,a){"use strict";var r=a(107),n=a.n(r),s=a(108),i=a.n(s),c=a(530),o=a.n(c),l=a(529),u=a.n(l),d=a(534),m=a.n(d),p=a(531),g=a.n(p),f=a(35),b=a.n(f),h=a(12),v=a.n(h),_=a(10),y=a.n(_),k=a(528),E=a.n(k),O=a(1),j=a(34),I=a(537),N=a.n(I);a(568);function R(e){var t=e.children;return y.a.createElement("span",{className:"screen-reader-text"},t)}var C=function(e){function t(){var e,a;n()(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return a=o()(this,(e=u()(t)).call.apply(e,[this].concat(s))),b()(m()(a),"dismissTimeout",null),a}return g()(t,e),i()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,r=e.icon,n=e.isCompact,s=e.isLoading,i=e.onDismissClick,c=e.showDismiss,o=void 0===c?!n:c,l=e.status,u=e.text,d=e.translate,m=E()("notice",l,a,{"is-compact":n,"is-loading":s,"is-dismissable":o});return y.a.createElement("div",{className:m},y.a.createElement("span",{className:"notice__icon-wrapper"},y.a.createElement(N.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),y.a.createElement("span",{className:"notice__content"},y.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,o&&y.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:i},y.a.createElement(N.a,{icon:"cross",size:24}),y.a.createElement(R,null,d("Dismiss"))))}}]),t}(_.Component);b()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:O.noop,status:null,text:null}),b()(C,"propTypes",{className:v.a.string,duration:v.a.number,icon:v.a.string,isCompact:v.a.bool,isLoading:v.a.bool,onDismissClick:v.a.func,showDismiss:v.a.bool,status:v.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:v.a.oneOfType([v.a.arrayOf(v.a.oneOfType([v.a.string,v.a.node])),v.a.oneOfType([v.a.string,v.a.node])]),translate:v.a.func.isRequired});t.a=Object(j.localize)(C)},568:function(e,t,a){},580:function(e,t,a){"use strict";var r=a(10),n=a.n(r),s=a(12),i=a.n(s),c=a(528),o=a.n(c),l=a(697),u=a(548),d=a(552),m=a(557),p=function(e){var t=e.id,a=e.title,s=e.description,i=e.value,c=e.placeholder,p=e.updateValue,g=e.error,f=e.className,b=e.defaultValue,h=Object(r.useCallback)(function(e){return p(e,t)},[p]),v=o()("form-text-input",{"is-error":Boolean(g)});return n.a.createElement(u.a,{className:f},n.a.createElement(l.a,{label:a,name:t,placeholder:c,value:i,onChange:h,className:v,defaultValue:b}),g&&"string"===typeof g&&n.a.createElement(d.a,{text:g}),!g&&s&&n.a.createElement(m.a,null,s))};p.propTypes={id:i.a.string.isRequired,title:i.a.node,description:i.a.string,value:i.a.string,defaultValue:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string},t.a=p},583:function(e,t,a){"use strict";var r=a(533),n=a.n(r),s=a(536),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(530),m=a.n(d),p=a(529),g=a.n(p),f=a(534),b=a.n(f),h=a(531),v=a.n(h),_=a(35),y=a.n(_),k=a(528),E=a.n(k),O=a(34),j=a(1),I=a(10),N=a.n(I),R=a(582),C=function(e){function t(){var e,a;o()(this,t);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return a=m()(this,(e=g()(t)).call.apply(e,[this].concat(n))),y()(b()(a),"getDefaultButtonAction",function(){return a.props.isSubmitting?a.props.translate("Saving\u2026"):a.props.translate("Save Settings")}),a}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,r=e.isPrimary,s=i()(e,["children","className","isPrimary"]),c=E()(a,"form-button");return N.a.createElement(R.a,n()({},Object(j.omit)(s,["isSubmitting","moment","numberFormat","translate"]),{primary:r,className:c}),I.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(N.a.Component);y()(C,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(O.localize)(C)},600:function(e,t,a){"use strict";var r=a(533),n=a.n(r),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(528),u=a.n(l),d=a(537),m=a.n(d),p=a(1),g=function(e){var t=e.className,a=e.disabled,r=e.checked,s=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return i.a.createElement("span",{className:u()(t,"form-checkbox",{"is-disabled":a})},i.a.createElement("input",n()({},c,{type:"checkbox"})),r&&i.a.createElement(m.a,{icon:"checkmark",size:14}),!r&&s&&i.a.createElement(m.a,{icon:"minus-small",size:16}))};g.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=g},603:function(e,t,a){"use strict";var r=a(533),n=a.n(r),s=a(536),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(530),m=a.n(d),p=a(529),g=a.n(p),f=a(531),b=a.n(f),h=a(10),v=a.n(h),_=a(12),y=a.n(_),k=a(591),E=a(528),O=a.n(E),j=function(e){function t(e){var a;return o()(this,t),(a=m()(this,g()(t).call(this,e))).state={isFocused:!1},a}return b()(t,e),u()(t,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"===typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.props,a=t.label,r=t.value,s=t.help,c=t.className,o=t.instanceId,l=t.onChange,u=t.onClick,d=t.prefix,m=t.suffix,p=t.type,g=t.disabled,f=i()(t,["label","value","help","className","instanceId","onChange","onClick","prefix","suffix","type","disabled"]),b=this.state.isFocused,h="inspector-text-control-with-affixes-".concat(o),_=[];s&&_.push("".concat(h,"__help")),d&&_.push("".concat(h,"__prefix")),m&&_.push("".concat(h,"__suffix"));var y=O()(c,{"with-value":""!==r,empty:""===r,active:b&&!g}),E=O()("text-control-with-affixes",{"text-control-with-prefix":d,"text-control-with-suffix":m,disabled:g});return v.a.createElement(k.a,{label:a,id:h,help:s,className:y,onClick:function(t){return e.handleOnClick(t,u)}},v.a.createElement("div",{className:E},d&&v.a.createElement("span",{id:"".concat(h,"__prefix"),className:"text-control-with-affixes__prefix"},d),v.a.createElement("input",n()({className:"components-text-control__input",type:p,id:h,value:r,onChange:function(e){return l(e.target.value)},"aria-describedby":_.join(" "),disabled:g,onFocus:function(){return e.setState({isFocused:!0})}},f)),m&&v.a.createElement("span",{id:"".concat(h,"__suffix"),className:"text-control-with-affixes__suffix"},m)))}}]),t}(h.Component);j.defaultProps={type:"text"},j.propTypes={label:y.a.string,help:y.a.string,type:y.a.string,value:y.a.oneOfType([y.a.string,y.a.number]).isRequired,className:y.a.string,onChange:y.a.func.isRequired,prefix:y.a.node,suffix:y.a.node,disabled:y.a.bool},t.a=j},636:function(e,t,a){"use strict";var r=a(10),n=a.n(r),s=a(12),i=a.n(s),c=a(679),o=a.n(c),l=a(680),u=a.n(l),d=a(681),m=a.n(d),p={ups:o.a,usps:u.a,dhlexpress:m.a,dhlecommerce:m.a,dhlecommerceasia:m.a},g=function(e){var t=e.carrier,a=e.size;if(!t||!p[t.toLowerCase()])return n.a.createElement("span",null);var r="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(a),"px");return n.a.createElement("div",{style:{width:r},className:"carrier-icon"},n.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};g.propTypes={carrier:i.a.string.isRequired,size:i.a.number},t.a=g},644:function(e,t,a){"use strict";var r=a(533),n=a.n(r),s=a(536),i=a.n(s),c=a(10),o=a.n(c),l=a(528),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",n()({},a,{type:"radio",className:u()(t,"form-radio")}))}},648:function(e,t,a){"use strict";var r=a(10),n=a.n(r),s=a(12),i=a.n(s),c=a(34),o=a(1),l=a(537),u=a.n(l),d=a(528),m=a.n(d),p=function(e){var t=e.isPlaceholder,a=e.data,r=e.dimensionUnit,s=e.prefixActions,i=(e.hasError,e.children),c=e.translate;if(t)return n.a.createElement("div",{className:"packages__packages-row placeholder"},n.a.createElement("div",{className:"packages__packages-row-icon"},n.a.createElement(u.a,{icon:"product",size:18})),n.a.createElement("div",{className:"packages__packages-row-details"},n.a.createElement("div",{className:"packages__packages-row-details-name"},n.a.createElement("span",null))),n.a.createElement("div",{className:"packages__packages-row-dimensions"},n.a.createElement("span",null)),n.a.createElement("div",{className:"packages__packages-row-actions"},i));var l,d=function(){return n.a.createElement("div",{className:"packages__packages-row-actions"},i)};return n.a.createElement("div",{className:m()("packages__packages-row",{prefixed:s})},s?d():null,n.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return n.a.createElement(u.a,{icon:t,size:18})}(a.is_letter)),n.a.createElement("div",{className:"packages__packages-row-details"},n.a.createElement("div",{className:"packages__packages-row-details-name"},(l=a.name)&&""!==Object(o.trim)(l)?l:c("Untitled"))),n.a.createElement("div",{className:"packages__packages-row-dimensions"},a.inner_dimensions," ",r),s?null:d())};p.propTypes={siteId:i.a.number.isRequired,isPlaceholder:i.a.bool,data:i.a.shape({name:i.a.string,is_letter:i.a.bool,inner_dimensions:i.a.string}).isRequired,prefixActions:i.a.bool,dimensionUnit:i.a.string},t.a=Object(c.localize)(p)},649:function(e,t,a){"use strict";a.d(t,"a",function(){return n});var r=a(538);function n(e,t,a){return{type:r.L,successAction:e,failureAction:t,onlyPackages:a||!1}}},679:function(e,t,a){e.exports=a.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,a){e.exports=a.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,a){e.exports=a.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},682:function(e,t,a){"use strict";var r=a(36),n=a.n(r),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(109),u=a(34),d=a(1),m=a(537),p=a.n(m),g=a(35),f=a.n(g),b=a(697),h=a(107),v=a.n(h),_=a(108),y=a.n(_),k=a(530),E=a.n(k),O=a(529),j=a.n(O),I=a(531),N=a.n(I),R=a(30),C=a(528),q=a.n(C);function x(e){return Object(d.get)(e,["currentUser","id"])}function w(e){var t=x(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(a){var r=w(a);return Object(d.get)(r,e,t)}};S("localeSlug"),S("localeVariant"),S("user_ip_country_code");S("date"),S("username"),S("email");S("email_verified",!1);var P=a(535),T=a(565);function z(e){var t=Object(P.a)(e);return t||1!==function(e){var t=w(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=w(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(T.a)(e,t)}var D=a(542),A=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e);return Object(d.isArray)(A(e,t))},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e);return D.b===A(e,t)};function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e),a=A(e,t);return Object(d.find)(a,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var F=a(572),L=a(563),W=a(538),B=function(e){return function(t,a){if(!U(a(),e)&&!V(a(),e)){var r={type:W.N,siteId:e};return t(r),Object(F.a)(e).get("settings/products").then(function(a){t({type:W.O,siteId:e,data:a})}).catch(function(a){t(Object(L.a)(e,r,a))})}}},H=a(603),Y=function(e){function t(){return v()(this,t),E()(this,j()(t).apply(this,arguments))}return N()(t,e),y()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.noWrap,r=e.dimensions,n=e.onChange,s=e.translate,c=e.dimensionsUnit,o=q()("form-dimensions-input",t,{"no-wrap":a});return i.a.createElement("div",{className:o},i.a.createElement(b.a,{name:"length",placeholder:s("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:r&&r.length||"",onChange:function(e){return n(e,"length")},className:"form-dimensions-input__length"}),i.a.createElement(b.a,{name:"width",placeholder:s("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:r&&r.width||"",onChange:function(e){return n(e,"width")},className:"form-dimensions-input__width"}),i.a.createElement(H.a,{name:"height",placeholder:s("H",{comment:"Height placeholder for dimensions input"}),suffix:c,type:"number",value:r&&r.height||"",onChange:function(e){return n(e,"height")},className:"form-dimensions-input__height"}))}}]),t}(s.Component);f()(Y,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),f()(Y,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var $=Object(l.b)(function(e,t){var a=t.dimensionsUnit,r=z(e);if(!a){var n=r&&M(e,r.ID);a=n&&n.value||"in"}return{siteId:r&&r.ID,dimensionsUnit:a}},function(e){return Object(R.b)({fetchSettingsProducts:B},e)})(Object(u.localize)(Y)),G=a(548),K=a(551),J=a(569),Q=a(552),X=/^\.\d+$/,Z=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:Z.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ae=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,re=function(e){return isNaN(e)?"":0>e?"":e},ne=function(e){var t="",a="",r="",n=ae.exec(e);return n&&4===n.length&&(t=re(n[1]),a=re(n[2]),r=re(n[3])),{length:t,width:a,height:r}},se=function(e){return Object(d.trim)(e)},ie=ee,ce=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=ne,le=function(e){var t=ne(e),a=t.length,r=t.width,n=t.height;return 0<a&&0<r&&0<n},ue=function(e){var t=e.siteId,a=e.form,r=e.setModalErrors,n=e.updatePackagesField,s=e.translate,c=a.mode,o=a.modalErrors,l=a.dimensionUnit,u=a.weightUnit,m=a.packageData,p=m.name,g=m.inner_dimensions,h=m.box_weight,v=m.is_letter,_=function(e,a){r(t,Object(d.omit)(o,e)),n(t,f()({},e,a))},y=function(e,t){_(t,e)},k=function(e,t){var a=t||s("Invalid value."),r=""===Object(d.trim)(m[e])?s("This field is required."):a;return o[e]?i.a.createElement(Q.a,{text:r}):null},E=function(e){n(t,{is_letter:"envelope"===e.target.value})};return i.a.createElement("div",{className:"packages__properties-group"},"add-custom"===c?i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"package_type"},s("Type of package")),i.a.createElement(J.a,{id:"package_type",onChange:E,value:v?"envelope":"box"},i.a.createElement("option",{value:"box"},s("Box")),i.a.createElement("option",{value:"envelope"},s("Envelope")))):null,i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"name"},s("Package name")),i.a.createElement(b.a,{id:"name",name:"name",placeholder:s("Unique package name"),value:p||"",onChange:function(e){return y(e,"name")},className:o.name?"is-error":""}),k("name",s("This field must be unique"))),i.a.createElement(G.a,{className:"packages__add-package-weight-group"},i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,null,s("Dimensions (L x W x H)")),function(e,t,a,r){var n=oe(t),s=n.length,c=n.width,o=n.height;return i.a.createElement($,{dimensionsUnit:a,dimensions:{width:c,height:o,length:s},onChange:function(t,a){r(e,["length"===a?t:s,"width"===a?t:c,"height"===a?t:o].join(" x "))}})}("inner_dimensions",g,l,_),k("inner_dimensions")),i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,{htmlFor:"box_weight"},s("Weight of empty package")),i.a.createElement(H.a,{id:"box_weight",name:"box_weight",placeholder:s("0.0"),value:h||"",onChange:function(e){return y(e,"box_weight")},className:o.box_weight?"is-error":"",type:"number",suffix:u}),k("box_weight"))))};ue.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var de=Object(u.localize)(ue),me=a(115),pe=a.n(me),ge=Object(d.memoize)(function(e){return pe()(e,{greedy:!0})}),fe=function(e){return e&&""!==Object(d.trim)(e)?e:null},be=function(e,t){return e=fe(e),Object(d.some)(t,function(t){return t===e})?null:e},he=/^\d+(\.\d+)?$/,ve=function(e){return he.test(e)?Number.parseFloat(e):null},_e=function(e,t,a){var r,n=ge(a);return n(function(e,t){var a=ve(e.box_weight),r=ve(e.max_weight);a&&r&&r<=a&&(r=null);var n={name:be(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:fe(e.outer_dimensions),box_weight:a,max_weight:r};return Object(d.omitBy)(n,function(e){return null===e})}(e,t)),r=n.errors,Object(d.reduce)(r,function(e,t){if(t.field){var a,r=t.field.replace("data.","");Object.assign(e,(a={},f()(a,r,!0),f()(a,"any",!0),a))}return e},{})},ye=a(570),ke=a(555),Ee=a(583),Oe=a(821),je=function(e){var t=e.className,a=e.disabled,r=e.id,n=e.onToggle,s=e.readOnly,c=e.selectedElements,o=e.totalElements,l=c&&c===o,u=c&&c<o,d=q()("bulk-select__box",{"is-checked":l}),m=q()("bulk-select__some-checked-icon",{"is-disabled":a}),g=q()("bulk-select",t);return i.a.createElement("span",{className:g},i.a.createElement("span",{className:"bulk-select__container"},i.a.createElement("input",{id:r,type:"checkbox",className:d,onChange:function(e){s||n(!(u||l),e)},checked:l,disabled:a}),u?i.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};je.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var Ie=je,Ne=a(602),Re=a(648),Ce=a(544),qe=function(e){var t=e.siteId,a=e.form,r=e.toggleAll,n=e.togglePackage,s=e.currentlyEditingPredefinedPackages,c=e.translate,o=a.dimensionUnit,l=function(e){var a="group-".concat(e.serviceId,"-").concat(e.groupId);return i.a.createElement("div",{className:"packages__group-header"},i.a.createElement("label",{htmlFor:a,onClick:function(e){return e.stopPropagation()}},i.a.createElement(Ie,{id:a,totalElements:e.total,selectedElements:e.selected,onToggle:function(a,n){n.stopPropagation(),r(t,e.serviceId,e.groupId,n.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return i.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(s,function(a,r){var s,u,d=(s=a.selected,u=a.total,s===u?c("All packages selected"):c("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:s,args:{selectedCount:s}}));e.push(i.a.createElement(Ne.a,{className:"packages__predefined-packages",key:r,header:l(a),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:c("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,a){return i.a.createElement(Re.a,{key:a,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},i.a.createElement(Oe.a,{className:"form-checkbox packages__packages-row-actions",checked:e.selected,onChange:function(){return n(t,e.serviceId,e.id)}}))})}(a)))}),e}())};qe.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var xe=Object(l.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Ce.c)(e)}})(Object(u.localize)(qe)),we=a(534),Se=a.n(we),Pe=function(e){function t(){var e,a;v()(this,t);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return a=E()(this,(e=j()(t)).call.apply(e,[this].concat(n))),f()(Se()(a),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),a}return N()(t,e),y()(t,[{key:"render",value:function(){var e=q()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=q()("segmented-control__link",f()({},"item-index-".concat(this.props.index),null!=this.props.index));return i.a.createElement("li",{className:e},i.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},i.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(i.a.Component);f()(Pe,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),f()(Pe,"defaultProps",{selected:!1});var Te=Pe,ze=function(e){function t(){var e,a;v()(this,t);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return a=E()(this,(e=j()(t)).call.apply(e,[this].concat(n))),f()(Se()(a),"state",{selected:a.props.initialSelected||a.props.options[0].value}),a}return N()(t,e),y()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,a){return i.a.createElement(Te,{index:a,key:a,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return i.a.createElement("ul",{className:q()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(i.a.Component);f()(ze,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var De=a(649),Ae=a(550),Ue=a(562),Ve=function(e){var t,a=e.siteId,r=e.form,n=e.predefinedPackagesSummary,s=e.setModalErrors,c=e.savePackage,o=e.savePredefinedPackages,l=e.dismissModal,u=e.removePackage,m=e.setAddMode,g=e.updatePackagesField,f=e.translate,b=r.showModal,h=r.mode,v=r.packages,_=r.packageSchema,y=r.predefinedSchema,k=r.packageData,E=k.index,O=v.custom,j="edit"===h,I="add-custom"===h,N="add-predefined"===h,R=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in k&&e.onSaveSuccess(k.name),e.successNotice(f("Your shipping packages have been saved."),t)},function(){return e.errorNotice(f("Unable to save your shipping packages. Please try again."),t)},!0)},C=function(){l(a)},q=f(j?"Edit package":"Add a package"),x=I||N,w=I||j,S=N;t=I||N&&0===n.removed?f("Add package","Add packages",{count:I?1:n.added}):f("Done");var P=[i.a.createElement(Ee.a,{onClick:function(){if(N)return o(a),void(e.persistOnSave&&R());var t="number"===typeof k.index?O[k.index].name:null,r=Object(d.concat)(Object(d.difference)(O.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(y,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),n=Object.assign({},k,{name:se(k.name),inner_dimensions:ce(k.inner_dimensions),outer_dimensions:ce(k.outer_dimensions),box_weight:ie(k.box_weight),max_weight:0}),i=_e(n,r,_);if(le(n.inner_dimensions)||(i.any=!0,i.inner_dimensions=!0),i.any)return g(a,n),void s(a,i);c(a,n),e.persistOnSave&&R()}},t),i.a.createElement(Ee.a,{onClick:C,isPrimary:!1},f("Cancel"))];return j&&P.unshift({action:"delete",label:i.a.createElement("span",null,f("{{icon/}} Delete this package",{components:{icon:i.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return u(a,E)},additionalClassNames:"packages__delete is-scary is-borderless"}),i.a.createElement(ye.a,{isVisible:b,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:C,buttons:P},i.a.createElement(ke.a,{className:"packages__add-edit-title"},q),x&&i.a.createElement(ze,{primary:!0,className:"packages__mode-select",initialSelected:h,onSelect:function(e){m(a,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),w&&i.a.createElement(de,e),S&&i.a.createElement(xe,e))};Ve.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(l.b)(function(e){return{predefinedPackagesSummary:Object(Ce.f)(e)}},function(e){return Object(R.b)(n()({createWcsShippingSaveActionList:De.a,errorNotice:Ae.a,successNotice:Ae.d},Ue),e)})(Object(u.localize)(Ve))},817:function(e,t,a){},818:function(e,t,a){},829:function(e,t,a){"use strict";a.r(t);var r=a(10),n=a.n(r),s=a(12),i=a.n(s),c=a(109),o=a(30),l=a(34),u=a.n(l),d=a(835),m=a(36),p=a.n(m),g=a(533),f=a.n(g),b=a(1),h=a(35),v=a.n(h),_=a(580),y=a(556),k=a(583),E=a(604),O=a(559),j=a(528),I=a.n(j),N=a(551),R=a(644),C=function(e){var t=e.values,a=e.originalValues,r=e.countryNames,s=e.stateNames,i=e.expandStateName,c=void 0!==i&&i;a=a||{};var o=t.state,l=t.country,u="";o&&(u=(c&&s||{})[o]||o);var d=r[l]||l,m=function(e){var r=t[e];if(!r)return"";var s=a[e],i=s&&s.toLowerCase()!==r.toLowerCase(),c=r;switch(e){case"state":c=u;break;case"country":c=d}return n.a.createElement("span",{key:e,className:i?"highlight":""},c)},p=m("state"),g=Object(b.filter)([m("city"),p?", ":"",p," ",m("postcode")]);return n.a.createElement("div",{className:"address-step__summary"},n.a.createElement("p",null,m("name")),n.a.createElement("p",null,m("address")," ",m("address_2")),n.a.createElement("p",null,g),n.a.createElement("p",null,m("country")))},q=function(e){return n.a.createElement(N.a,{className:I()("address-step__suggestion",{"is-selected":e.checked})},n.a.createElement(R.a,Object(b.omit)(e,"children")),e.children)},x=function(e){var t=e.values,a=e.normalized,r=e.selectNormalized,s=e.selectNormalizedAddress,i=e.editAddress,c=e.confirmAddressSuggestion,o=e.countryNames,l=e.translate,u=function(e){return function(){return s(e)}};return n.a.createElement("div",null,n.a.createElement(y.a,{className:"error-notice",status:"is-info",showDismiss:!1},l("We have slightly modified the address entered. If correct, please use the suggested address to ensure accurate delivery.")),n.a.createElement("div",{className:"address-step__suggestion-container"},n.a.createElement(q,{checked:!r,onChange:u(!1)},n.a.createElement("span",{className:"address-step__suggestion-title"},l("Address entered")),n.a.createElement(C,{values:t,countryNames:o})),n.a.createElement(q,{checked:r,onChange:u(!0)},n.a.createElement("span",{className:"address-step__suggestion-title"},l("Suggested address")),n.a.createElement(C,{values:a,originalValues:t,countryNames:o}))),n.a.createElement("div",{className:"address-step__actions"},n.a.createElement(k.a,{type:"button",onClick:c},l("Use selected address")),n.a.createElement(k.a,{type:"button",onClick:i,borderless:!0},l("Edit address"))))};x.propTypes={values:i.a.object.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,selectNormalizedAddress:i.a.func.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var w=Object(l.localize)(x),S=a(811),P=a.n(S),T=a(837),z=a(578),D=function(e){var t=e.values,a=e.countryNames,r=e.editUnverifiableAddress,s=e.confirmAddressSuggestion,i=e.translate,c=e.fieldErrors,o=z.a.includes(t.country)?P.a.format({scheme:"https",hostname:"tools.usps.com",pathname:"/zip-code-lookup.htm",query:{mode:"byAddress",companyName:t.company,address1:t.address,address2:t.address_2,city:t.city,state:"US"===t.country?t.state:t.country,zip:t.postcode}}):null,l=Object(b.invokeMap)([t.address+" "+t.address_2,t.city,t.state+" "+t.postcode],"trim").join(", "),u={scheme:"https",hostname:"www.google.com",pathname:"/maps/place/"+encodeURIComponent(l)},d=P.a.format(u);return n.a.createElement("div",null,function(){var e=function(){if(c.general)return c.general;for(var e in c)return c[e];return!1}();return e?n.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address \u2014 %(error)s.",{args:{error:e}})):n.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address."))}(),n.a.createElement("div",{className:"address-step__unverifiable-container"},n.a.createElement("div",{className:"address-step__unverifiable-info"},n.a.createElement("span",{className:"address-step__unverifiable-title"},i("Address entered")),n.a.createElement(C,{values:t,countryNames:a})),n.a.createElement("div",{className:"address-step__unverifiable-info"},n.a.createElement("p",null,i("Automatic verification failed for this address. It may still be a valid address \u2014 use the tools below to manually verify.")),o&&n.a.createElement(T.a,{href:o},i("Verify with USPS")),n.a.createElement(T.a,{href:d},i("View on Google Maps")))),n.a.createElement("div",{className:"address-step__actions"},n.a.createElement(k.a,{type:"button",onClick:r},i("Edit address")),n.a.createElement(k.a,{type:"button",onClick:s,borderless:!0},i("Use address as entered"))))};D.propTypes={values:i.a.object.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editUnverifiableAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var A=Object(l.localize)(D),U=a(618),V=a(547),M=a(540),F=a(574),L=function(e){var t=e.siteId,a=e.orderId,r=e.values,s=e.isNormalized,i=e.normalized,c=e.selectNormalized,o=e.normalizationInProgress,l=e.allowChangeCountry,u=e.group,d=e.countryNames,m=e.stateNames,g=e.errors,f=e.isUsable,h=e.translate,v=Object(b.isObject)(g)?g:{},j=function(){return e.confirmAddressSuggestion(a,t,u)};if(s&&!v.phone){if(i&&!Object(b.isEqual)(i,r)){return n.a.createElement(w,{values:r,normalized:i,selectNormalized:c,selectNormalizedAddress:function(r){return e.selectNormalizedAddress(a,t,u,r)},confirmAddressSuggestion:j,editAddress:function(){return e.editAddress(a,t,u)},countryNames:d})}if(0<Object(b.size)(v)){return n.a.createElement(A,{values:r,confirmAddressSuggestion:j,editUnverifiableAddress:function(){return e.editUnverifiableAddress(a,t,u)},countryNames:d,fieldErrors:v})}}var I=v.general&&1===Object(b.size)(v),N=function(e){return u+"_"+e},R=function(e){return r[e]?Object(U.a)(r[e]):""},C=function(r){return function(n){return e.updateAddressValue(a,t,u,r,n)}};return n.a.createElement("div",null,n.a.createElement(_.a,{id:N("name"),title:h("Name"),value:R("name"),updateValue:C("name"),error:v.name}),n.a.createElement("div",{className:"address-step__company-phone"},n.a.createElement(_.a,{id:N("company"),title:h("Company"),value:R("company"),updateValue:C("company"),className:"address-step__company",error:v.company}),n.a.createElement(_.a,{id:N("phone"),title:h("Phone"),value:R("phone"),updateValue:C("phone"),className:"address-step__phone",error:v.phone})),I&&n.a.createElement(y.a,{status:"is-error",showDismiss:!1},h("%(message)s. Please modify the address and try again.",{args:{message:v.general}})),n.a.createElement(_.a,{id:N("address"),title:h("Address"),value:R("address"),updateValue:C("address"),className:"address-step__address-1",error:v.address||I}),n.a.createElement(_.a,{id:N("address_2"),value:R("address_2"),updateValue:C("address_2"),error:v.address_2||I}),n.a.createElement("div",{className:"address-step__city-state-postal-code"},n.a.createElement(_.a,{id:N("city"),title:h("City"),value:R("city"),updateValue:C("city"),className:"address-step__city",error:v.city||I}),m?n.a.createElement(E.a,{id:N("state"),title:h("State"),value:R("state"),valuesMap:p()({"":e.translate("Select one\u2026")},m),updateValue:C("state"),className:"address-step__state",error:v.state||I}):n.a.createElement(_.a,{id:N("state"),title:h("State"),value:R("state"),updateValue:C("state"),className:"address-step__state",error:v.state||I}),n.a.createElement(_.a,{id:N("postcode"),title:h("ZIP/Postal code"),value:R("postcode"),updateValue:C("postcode"),className:"address-step__postal-code",error:v.postcode||I})),n.a.createElement(E.a,{id:N("country"),title:h("Country"),value:R("country"),disabled:!l,valuesMap:d,updateValue:C("country"),error:v.country||I}),n.a.createElement("div",{className:"address-step__actions"},n.a.createElement(k.a,{type:"button",disabled:Object(O.a)(g)||o,onClick:function(){return e.submitAddressForNormalization(a,t,u)}},h("Verify address")),n.a.createElement(k.a,{type:"button",disabled:!f,onClick:j,borderless:!0},h("Use address as entered"))))};L.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,values:i.a.object.isRequired,isNormalized:i.a.bool.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,allowChangeCountry:i.a.bool.isRequired,errors:i.a.oneOfType([i.a.object,i.a.bool]).isRequired,group:i.a.string.isRequired,countryNames:i.a.object.isRequired,stateNames:i.a.object};var W=Object(c.b)(function(e,t){var a=t.group,r=t.orderId,n=t.siteId,s=Object(M.t)(e,r,n),i=Object(M.j)(e,r,n).form[a],c="origin"===a?Object(M.i)(e,n):Object(M.c)(e,n);return c[i.values.country]||(c=p()(v()({},i.values.country,Object(F.g)(e,i.values.country,n)),c)),p()({},i,{errors:s&&Object(M.f)(e,r,n)[a],isUsable:s&&Object(M.o)(e,r,a,n),countryNames:c,stateNames:Object(M.k)(e,i.values.country,n)})},function(e){return Object(o.b)({selectNormalizedAddress:V.C,confirmAddressSuggestion:V.g,editAddress:V.m,editUnverifiableAddress:V.n,updateAddressValue:V.V,submitAddressForNormalization:V.T},e)})(Object(l.localize)(L)),B=a(537),H=a.n(B),Y=a(107),$=a.n(Y),G=a(108),K=a.n(G),J=a(530),Q=a.n(J),X=a(529),Z=a.n(X),ee=a(531),te=a.n(ee),ae=(a(817),function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=I()("spinner",this.props.className),t={width:this.props.size,height:this.props.size,fontSize:this.props.size};return n.a.createElement("div",{className:e},n.a.createElement("div",{className:"spinner__outer",style:t},n.a.createElement("div",{className:"spinner__inner"})))}}]),t}(r.PureComponent));v()(ae,"propTypes",{className:i.a.string,size:i.a.number}),v()(ae,"defaultProps",{size:20});var re=a(602),ne=function(e){var t=e.isSuccess,a=e.isWarning,r=e.isError,s=e.isProgress,i=e.title,c=e.summary,o=e.children,l=e.expanded,u=e.toggleStep,d=e.translate,m=I()({"is-success":t,"is-warning":a,"is-error":r});c=n.a.createElement("span",{className:m},n.a.createElement("span",null,c),n.a.createElement("div",{className:"label-purchase-modal__step-status"},s?n.a.createElement(ae,{size:18}):n.a.createElement(H.a,{icon:t?"checkmark-circle":a?"notice-outline":r?"notice-outline":"",className:m,size:18})));var p=n.a.createElement("div",null,n.a.createElement("div",{className:"label-purchase-modal__step-title"},i));return n.a.createElement(re.a,{header:p,summary:c,expandedSummary:c,clickableHeader:!0,compact:!0,screenReaderText:d("Expand"),expanded:l,onClick:u},o)};ne.propTypes={isSuccess:i.a.bool,isWarning:i.a.bool,isError:i.a.bool,isProgress:i.a.bool,title:i.a.string.isRequired,summary:i.a.string,expanded:i.a.bool};var se=Object(l.localize)(ne),ie=a(573),ce=function(e,t,a,r,n,s){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=e.isNormalized,o=e.normalizationInProgress,l=e.normalized;if(o)return n("Validating address\u2026");if(Object(O.a)(r)||c&&!l)return r&&r.general||n("Invalid address");if(!c)return n("You've edited the address, please revalidate it for accurate rates");var u=Object(ie.a)(e),d=u.city,m=u.postcode,p=u.state,g=u.country,f=d+", ";p&&(f+=(i?Object(F.h)(t,g,p,a):p)+"\xa0 ");return f+="US"===g?m.split("-")[0]:m,s&&(f+=", "+Object(F.g)(t,g,a)),f},oe=function(e){var t=e.normalizationInProgress,a=e.errors,r=e.isNormalized,n=e.values,s=e.normalized;return t?{isProgress:!0}:Object(O.a)(a)||r&&!s||!r?{isError:!0}:r?Object(b.isEqual)(n,s)?{isSuccess:!0}:{isWarning:!0}:{}},le=function(e){return n.a.createElement(se,f()({title:e.title,summary:e.summary,expanded:e.expanded,toggleStep:function(){return e.toggleStep(e.orderId,e.siteId,e.type)}},e.normalizationStatus),n.a.createElement(W,{group:e.type,siteId:e.siteId,orderId:e.orderId}))};le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,type:i.a.string.isRequired,title:i.a.string.isRequired,summary:i.a.string.isRequired,expanded:i.a.bool,normalizationStatus:i.a.object.isRequired,toggleStep:i.a.func.isRequired};var ue=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=t.type,s=t.translate,i=Object(M.t)(e,a,r),c=Object(M.j)(e,a,r),o=c.form[n],l=i&&Object(M.f)(e,a,r)[n],u="destination"===n&&c.form.origin.values.country!==o.values.country;return{errors:l,form:o,expanded:o.expanded,normalizationStatus:oe(p()({},o,{errors:l})),summary:ce(o,e,r,l,s,u)}},function(e){return Object(o.b)({toggleStep:V.U},e)})(le)),de=a(719),me=function(e,t,a){var r=0;return Object(b.mapValues)(e,function(e){if("individual"===e.box_id)return e.items[0].name;r++;var n=t[e.box_id],s=n&&n.is_letter,i=!(!a||!n)&&n.name;return s?i?Object(l.translate)("Envelope %(packageNum)d: %(packageName)s",{args:{packageNum:r,packageName:i}}):Object(l.translate)("Envelope %(packageNum)d",{args:{packageNum:r}}):i?Object(l.translate)("Package %(packageNum)d: %(packageName)s",{args:{packageNum:r,packageName:i}}):Object(l.translate)("Package %(packageNum)d",{args:{packageNum:r}})})},pe=a(544),ge=function(e){var t,a,r=e.orderId,s=e.siteId,i=e.selected,c=e.all,o=e.errors,l=e.packageId,u=e.translate,d=function(t,a,i){var c=0<Object.keys(o[t]||{}).length;return n.a.createElement("div",{className:"packages-step__list-item",key:t},n.a.createElement(de.a,{className:I()("packages-step__list-package","is-borderless",{"is-selected":l===t}),onClick:function(){return e.openPackage(r,s,t)}},n.a.createElement("span",{className:"packages-step__list-package-name"},a),function(e,t){return e?n.a.createElement(H.a,{icon:"notice-outline",className:"is-error",size:18}):void 0===t?null:n.a.createElement("span",{className:"packages-step__list-package-count"},t)}(c,i)))},m=me(i,c,!1),p=[],g=[];return Object.keys(i).forEach(function(e){var t=i[e];"individual"===t.box_id?g.push(d(e,t.items[0].name)):p.push(d(e,m[e],t.items.length))}),(p.length||g.length)&&p.unshift((t="boxed-header",a=u("Packages to be Shipped"),n.a.createElement("div",{className:"packages-step__list-item packages-step__list-header",key:t},a))),n.a.createElement("div",{className:"packages-step__list"},p,g)};ge.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,openPackage:i.a.func.isRequired};var fe=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r);return{errors:n&&Object(M.f)(e,a,r).packages,packageId:s.openedPackageId,selected:s.form.packages.selected,all:Object(pe.a)(e,r)}},function(e){return Object(o.b)({openPackage:V.w},e)})(Object(l.localize)(ge)),be=a(552),he=a(554),ve=a(603),_e=a(565),ye=function(e){var t=e.orderId,a=e.siteId,r=e.item,s=e.itemIndex,i=e.translate,c=function(){return e.openItemMove(t,a,s)},o=r.url?n.a.createElement("a",{href:r.url,target:"_blank",rel:"noopener noreferrer"},r.name):r.name;return n.a.createElement("div",{key:s,className:"packages-step__item"},n.a.createElement("div",{className:"packages-step__item-name"},n.a.createElement("span",null,o),"attributes"in r?n.a.createElement("p",null,r.attributes):""),n.a.createElement("div",{className:"packages-step__item-weight"},"weight"in r?n.a.createElement("p",null,r.weight):""),n.a.createElement("div",{className:"packages-step__item-qty"},"quantity"in r?n.a.createElement("p",null,r.quantity):""),n.a.createElement("div",{className:"packages-step__item-move"},n.a.createElement("a",{href:"#",onClick:c},i("Move"))))};ye.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,item:i.a.object.isRequired,itemIndex:i.a.number.isRequired,openItemMove:i.a.func.isRequired};var ke=Object(c.b)(function(e,t){var a=t.siteId;return{site:Object(_e.a)(e,a)}},function(e){return Object(o.b)({openItemMove:V.v},e)})(Object(l.localize)(ye)),Ee=a(569),Oe=a(695),je=a(682),Ie=a(562),Ne=function(e,t){return[e.length,e.width,e.height].map(function(e){return"".concat(e," ").concat(t)}).join(" x ")},Re=function(e){var t=e.siteId,a=e.orderId,r=e.packageId,s=e.pckg,i=e.dimensionUnit,c=e.packageGroups,o=e.translate,l=e.pckgErrors,u=e.isIndividualPackage,d=function(e){var t=Object(Oe.a)(e),a=e.id||e.name;return n.a.createElement("option",{value:a,key:a},e.name," - ",Ne(t,i))};if(!r)return null;if(u){var m=I()({"is-error":l.dimensions});return n.a.createElement("div",null,n.a.createElement("div",{className:"packages-step__package-items-header"},n.a.createElement(he.a,null,o("Individually Shipped Item"))),n.a.createElement("span",{className:"packages-step__package-item-description"},o("Item Dimensions")," -"," "),n.a.createElement("span",{className:m},Ne(s,i)),l.dimensions&&n.a.createElement(be.a,{text:l.dimensions}))}var p=Object(b.reduce)(c,function(e,t){return e+t.definitions.length},0);return n.a.createElement("div",null,n.a.createElement("div",{className:"packages-step__package-items-header packages-step__package-details-header"},n.a.createElement(he.a,null,o("Package details")),0!==p?n.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Add package")):null),0===p?n.a.createElement("div",{className:"packages-step__no-packages"},n.a.createElement(H.a,{icon:"product",size:18}),n.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Select a package type"))):n.a.createElement("div",{className:"packages-step__with-packages"},n.a.createElement(Ee.a,{onChange:function(n){e.setPackageType(a,t,r,n.target.value)},value:s.box_id,isError:l.box_id||l.dimensions},n.a.createElement("option",{value:"not_selected",key:"not_selected"},o("Please select a package"))," ",Object(b.map)(c,function(e,t){return Object(b.isEmpty)(e.definitions)?null:n.a.createElement("optgroup",{label:e.title,key:t},Object(b.map)(e.definitions,d))}))),n.a.createElement(je.a,f()({persistOnSave:!0},e,{onSaveSuccess:function(n){e.setPackageType(a,t,r,n)}})))};Re.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,pckgErrors:i.a.object.isRequired,pckg:i.a.object.isRequired};var Ce=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=n?s.storeOptions:{},c=Object(pe.e)(e,r)||{};return{dimensionUnit:i.dimension_unit,packageGroups:Object(pe.d)(e,a,r),form:c}},function(e){return Object(o.b)({setPackageType:V.P,addPackage:Ie.addPackage},e)})(Object(l.localize)(Re)),qe=a(549),xe=function(e){var t=e.siteId,a=e.orderId,r=e.packageId,s=e.selected,i=e.weightUnit,c=e.errors,o=e.translate,l=e.userMeta,u=c[r]||{};if(!r)return null;var d=s[r],m="individual"===d.box_id,p=function(e,s){return n.a.createElement(ke,{siteId:t,orderId:a,key:s,item:e,itemIndex:s,packageId:r,showRemove:!0,isIndividualPackage:m})},g=function(){return e.openAddItem(a,t)},f=function(){return m?null:n.a.createElement(de.a,{className:I()("button","is-compact","packages-step__add-item-btn"),onClick:g},o("Add items"))},h=isNaN(d.weight)?"":d.weight;return n.a.createElement("div",{className:"packages-step__package"},n.a.createElement("div",null,n.a.createElement("div",{className:"packages-step__package-items-header-name"},n.a.createElement(he.a,null,o("Items to fulfill"))),n.a.createElement("div",{className:"packages-step__package-items-header-weight"},n.a.createElement(he.a,null,o("Weight"))),n.a.createElement("div",{className:"packages-step__package-items-header-qty"},n.a.createElement(he.a,null,o("QTY"))),n.a.createElement("div",{className:"packages-step__package-items-header-move"}),function(){var e=Object(b.some)(s,function(e,t){return r!==t&&e.items.length});if(!d.items.length)return n.a.createElement("div",{className:"packages-step__add-item-row"},n.a.createElement("div",{className:"packages-step__no-items-message"},o("There are no items in this package."),e?f():null));var t=d.items.map(p);return e&&t.push(n.a.createElement("div",{key:t.length,className:"packages-step__add-item-row"},f())),t}()),n.a.createElement(Ce,{siteId:t,orderId:a,isIndividualPackage:m,pckgErrors:u,pckg:d,packageId:r,lastBoxId:l.last_box_id}),n.a.createElement("div",{className:"packages-step__package-weight"},n.a.createElement(N.a,{htmlFor:"weight_".concat(r)},o("Total Weight (with package)")),n.a.createElement(ve.a,{id:"weight_".concat(r),placeholder:o("0"),value:h,onChange:function(n){e.updatePackageWeight(a,t,r,n)},className:Boolean(u.weight)?"is-error":"",type:"number",suffix:i}),u.weight&&n.a.createElement(be.a,{text:u.weight})))};xe.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,selected:i.a.object.isRequired,updatePackageWeight:i.a.func.isRequired,dimensionUnit:i.a.string.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,openAddItem:i.a.func.isRequired,userMeta:i.a.object.isRequired};var we=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=n?s.storeOptions:{},c=n&&Object(M.f)(e,a,r).packages,o=n?Object(qe.i)(e,r):{};return{siteId:r,errors:c,packageId:s.openedPackageId,selected:s.form.packages.selected,dimensionUnit:i.dimension_unit,weightUnit:i.weight_unit,userMeta:o}},function(e){return Object(o.b)(p()({updatePackageWeight:V.W,openAddItem:V.t,setPackageType:V.P},Ie),e)})(Object(l.localize)(xe)),Se=a(570),Pe=a(555),Te=function(e){e.site;var t=e.siteId,a=e.orderId,r=e.showItemMoveDialog,s=e.movedItemIndex,i=e.targetPackageId,c=e.openedPackageId,o=e.selected,l=e.all,u=e.translate;if(-1===s||!r)return null;var d,m,p=function(r,s){return n.a.createElement(N.a,{key:r,className:"packages-step__dialog-package-option"},n.a.createElement(R.a,{checked:r===i,onChange:function(){return e.setTargetPackage(a,t,r)}}),s)},g=o[c],f=g.items[s],b=(d=f.product_id,"post.php?post=".concat(d,"&action=edit")),h=n.a.createElement("a",{href:b,target:"_blank",rel:"noopener noreferrer"},f.name),v=me(o,l,!0);m=""===c?u("{{itemLink/}} is currently saved for a later shipment.",{components:{itemLink:h}}):"individual"===g.box_id?u("{{itemLink/}} is currently shipped in its original packaging.",{components:{itemLink:h}}):u("{{itemLink/}} is currently in {{pckg/}}.",{components:{itemLink:h,pckg:n.a.createElement("span",{className:"packages-step__dialog-package-name"},v[c])}});var _=function(){return e.closeItemMove(a,t)},y=[{action:"cancel",label:u("Cancel"),onClick:_},{action:"move",label:u("Submit"),isPrimary:!0,disabled:i===c,onClick:function(){return e.moveItem(a,t,c,s,i)}}];return n.a.createElement(Se.a,{isVisible:r,isFullScreen:!1,onClickOutside:_,onClose:_,buttons:y,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},n.a.createElement(Pe.a,null,u("Move item")),n.a.createElement("div",{className:"packages-step__dialog-body"},n.a.createElement("p",null,m),n.a.createElement("p",null,u("Where would you like to move it?")),function(){var e=[];return Object.keys(o).forEach(function(t){var a=o[t];t!==c&&"individual"!==a.box_id&&e.push(p(t,v[t]))}),e}(),p("new",u("Add to a New Package")),g&&"individual"===g.box_id?null:p("individual",u("Ship in original packaging"))))};Te.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showItemMoveDialog:i.a.bool.isRequired,movedItemIndex:i.a.number.isRequired,targetPackageId:i.a.string,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,moveItem:i.a.func.isRequired};var ze=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.j)(e,a,r);return{site:Object(_e.a)(e,r),showItemMoveDialog:n.showItemMoveDialog||!1,movedItemIndex:isNaN(n.movedItemIndex)?-1:n.movedItemIndex,targetPackageId:n.targetPackageId,openedPackageId:n.openedPackageId,selected:n.form.packages.selected,all:Object(pe.a)(e,r)}},function(e){return Object(o.b)({closeItemMove:V.d,setTargetPackage:V.S,moveItem:V.s},e)})(Object(l.localize)(Te)),De=a(821),Ae=function(e){var t=e.siteId,a=e.orderId,r=e.showAddItemDialog,s=e.addedItems,i=e.openedPackageId,c=e.selected,o=e.all,l=e.translate;if(!r)return null;var u=me(c,o,!0),d=function(e){return n.a.createElement("span",{className:"packages-step__dialog-package-name"},u[e])},m=[];Object.keys(c).forEach(function(r){if(r!==i){var o=0;c[r].items.forEach(function(i){m.push(function(r,i,c){var o=u[r]?l("%(item)s from {{pckg/}}",{args:{item:c.name},components:{pckg:d(r)}}):c;return n.a.createElement(N.a,{key:"".concat(r,"-").concat(i),className:"packages-step__dialog-package-option"},n.a.createElement(De.a,{label:o,className:"form-label packages-step__dialog-package-option",checked:Object(b.includes)(s[r],i),onChange:function(n){e.setAddedItem(a,t,r,i,n)}}))}(r,o,i)),o++})}});var p=function(){return e.closeAddItem(a,t)},g=[{action:"close",label:l("Close"),onClick:p},{action:"add",label:l("Add"),isPrimary:!0,disabled:!Object(b.some)(s,b.size),onClick:function(){return e.addItems(a,t,i)}}];return n.a.createElement(Se.a,{isVisible:r,isFullScreen:!1,onClickOutside:p,onClose:p,buttons:g,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},n.a.createElement(Pe.a,null,l("Add item")),n.a.createElement("div",{className:"packages-step__dialog-body"},n.a.createElement("p",null,l("Which items would you like to add to {{pckg/}}?",{components:{pckg:d(i)}})),m))};Ae.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showAddItemDialog:i.a.bool.isRequired,addedItems:i.a.object,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,closeAddItem:i.a.func.isRequired,setAddedItem:i.a.func.isRequired,addItems:i.a.func.isRequired};var Ue=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.j)(e,a,r);return{showAddItemDialog:Boolean(n.showAddItemDialog),addedItems:n.addedItems,openedPackageId:n.openedPackageId,selected:n.form.packages.selected,all:Object(pe.a)(e,r)}},function(e){return Object(o.b)({closeAddItem:V.b,setAddedItem:V.E,addItems:V.a},e)})(Object(l.localize)(Ae)),Ve=function(e){var t=e.disabled,a=e.onClick,r=e.children;return n.a.createElement("div",{className:"step-confirmation-button"},n.a.createElement(k.a,{type:"button",onClick:a,disabled:Boolean(t),isPrimary:!0},r))};Ve.propTypes={disabled:i.a.bool,onClick:i.a.func.isRequired};var Me=Ve,Fe={g:0,oz:1,lbs:3,kg:3},Le=function(e){var t=e.siteId,a=e.orderId,r=e.selected,s=e.weightUnit,i=e.errors,c=e.expanded,o=e.translate,u=Object.keys(r),d=u.reduce(function(e,t){return e+r[t].items.length},0),m=u.reduce(function(e,t){return e+r[t].weight},0),p=0<u.length;return n.a.createElement(se,f()({title:o("Packaging")},function(){if(!p)return{isError:!0,summary:o("No packages selected")};var e=Object(b.find)(i,function(e){return!Object(b.isEmpty)(e)});if(e)return{isError:!0,summary:e[Object.keys(e)[0]]};var t=Object(l.numberFormat)(m,{decimals:Fe[s]});return{isSuccess:!0,summary:1===u.length&&1===d?o("1 item in 1 package: %(weight)s %(unit)s total",{args:{weight:t,unit:s}}):1===u.length?o("%(itemsCount)d items in 1 package: %(weight)s %(unit)s total",{args:{itemsCount:d,weight:t,unit:s}}):o("%(itemsCount)d items in %(packageCount)d packages: %(weight)s %(unit)s total",{args:{itemsCount:d,packageCount:u.length,weight:t,unit:s}})}}(),{expanded:c,toggleStep:function(){return e.toggleStep(a,t,"packages")}}),n.a.createElement("div",{className:"packages-step__contents"},n.a.createElement(fe,{siteId:e.siteId,orderId:e.orderId}),n.a.createElement(we,{siteId:e.siteId,orderId:e.orderId})),n.a.createElement(Me,{disabled:Object(O.a)(i)||!u.length,onClick:function(){return e.confirmPackages(a,t)}},o("Use these packages")),n.a.createElement(ze,{siteId:e.siteId,orderId:e.orderId}),n.a.createElement(Ue,{siteId:e.siteId,orderId:e.orderId}))};Le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,expanded:i.a.bool};var We=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=n?s.storeOptions:{};return{errors:n&&Object(M.f)(e,a,r).packages,weightUnit:i.weight_unit,expanded:s.form.packages.expanded,selected:s.form.packages.selected}},function(e){return Object(o.b)({toggleStep:V.U,confirmPackages:V.i},e)})(Object(l.localize)(Le)),Be=a(548),He=function(e){var t=e.id,a=e.title,r=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className,l=e.weightUnit,u=I()({"is-error":Boolean(c)});return n.a.createElement(Be.a,{className:o},n.a.createElement(N.a,{htmlFor:t},a),n.a.createElement(ve.a,{suffix:l,id:t,name:t,type:"number",placeholder:s||"0.0",value:r,onChange:i,className:u}),c&&"string"===typeof c&&n.a.createElement(be.a,{text:c}))};He.propTypes={weightUnit:i.a.string.isRequired,id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var Ye=He,$e=a(536),Ge=a.n($e),Ke=a(534),Je=a.n(Ke),Qe=function(e){function t(){var e;return $()(this,t),(e=Q()(this,Z()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(Je()(e)),e}return te()(t,e),K()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(b.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),a=I()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return n.a.createElement("input",f()({type:"text"},t,{ref:e||"textField",className:a,onClick:this.selectOnFocus}))}}]),t}(r.PureComponent);v()(Qe,"propTypes",{isError:i.a.bool,isValid:i.a.bool,selectOnFocus:i.a.bool,className:i.a.string});var Xe=function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,a=e.prefix,r=e.suffix,s=Ge()(e,["noWrap","prefix","suffix"]);return n.a.createElement("div",{className:I()("form-text-input-with-affixes",{"no-wrap":t})},a&&n.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},a),n.a.createElement(Qe,s),r&&n.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},r))}}]),t}(n.a.Component);function Ze(e,t,a){if(!e)return null;if(!a)return e;var r=Object(b.get)(Object(b.find)(a,function(t){return t.code===e}),"label",e);return n.a.createElement("span",{className:"form-currency-input__affix"},r,n.a.createElement(H.a,{icon:"chevron-down",size:18,className:"form-currency-input__select-icon"}),n.a.createElement("select",{className:"form-currency-input__select",value:e,onChange:t},a.map(function(e){var t=e.code,a=e.label,r=void 0===a?t:a;return n.a.createElement("option",{key:t,value:t},r)})))}function et(e){var t=e.className,a=e.currencySymbolPrefix,r=e.currencySymbolSuffix,s=e.onCurrencyChange,i=e.currencyList,c=e.placeholder,o=void 0===c?"0.00":c,l=Ge()(e,["className","currencySymbolPrefix","currencySymbolSuffix","onCurrencyChange","currencyList","placeholder"]),u=I()("form-currency-input",t),d=Ze(a,s,i),m=Ze(r,s,i);return n.a.createElement(Xe,f()({},l,{type:"number",className:u,prefix:d,suffix:m,placeholder:o}))}v()(Xe,"displayName","FormTextInputWithAffixes"),v()(Xe,"propTypes",{noWrap:i.a.bool,prefix:i.a.node,suffix:i.a.node});var tt=i.a.shape({code:i.a.string.isRequired,label:i.a.string});et.propTypes={currencySymbolPrefix:i.a.oneOfType([i.a.string,i.a.object]),currencySymbolSuffix:i.a.oneOfType([i.a.string,i.a.object]),onCurrencyChange:i.a.func,currencyList:i.a.arrayOf(tt)};var at=et,rt=function(e){var t=e.id,a=e.title,r=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className;return n.a.createElement(Be.a,{className:o},n.a.createElement(N.a,{htmlFor:t},a),n.a.createElement(at,{id:t,name:t,currencySymbolPrefix:"$",placeholder:s||"0.00",value:r,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&n.a.createElement(be.a,{text:c}))};rt.propTypes={id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var nt=rt,st=a(820),it=Object(l.localize)(function(e){var t=e.translate;return n.a.createElement("span",null,t("HS Tariff number")," (",n.a.createElement(T.a,{href:"https://docs.woocommerce.com/document/woocommerce-shipping-and-tax/woocommerce-shipping/#section-29"},t("more info")),")")}),ct=Object(l.localize)(function(e){var t=e.translate;return n.a.createElement("span",null,t("Origin country"),n.a.createElement(st.a,{text:t("Country where the product was manufactured or assembled")},n.a.createElement("span",null,n.a.createElement(H.a,{icon:"info-outline",size:18}))))}),ot=function(e){var t=e.translate,a=e.weightUnit;return n.a.createElement("div",{className:"customs-step__item-rows-header"},n.a.createElement("span",{className:"customs-step__item-description-column"},t("Description")),n.a.createElement("span",{className:"customs-step__item-code-column"},n.a.createElement(it,null)),n.a.createElement("span",{className:"customs-step__item-weight-column"},t("Weight (%s per unit)",{args:[a]})),n.a.createElement("span",{className:"customs-step__item-value-column"},t("Value ($ per unit)")),n.a.createElement("span",{className:"customs-step__item-country-column"},n.a.createElement(ct,null)))};ot.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,weightUnit:i.a.string.isRequired};var lt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId;return{weightUnit:Object(M.j)(e,a,r).storeOptions.weight_unit}})(Object(l.localize)(ot)),ut=function(e){var t=e.errors,a=e.packageId,r=e.productId,s=e.translate,i=e.description,c=e.defaultDescription,o=e.weight,l=e.value,u=e.tariffNumber,d=e.originCountry,m=e.countryNames,p=e.weightUnit;return n.a.createElement("div",{className:"customs-step__item-row"},n.a.createElement(_.a,{id:a+"_"+r+"_description",className:"customs-step__item-description-column",title:s("Description"),value:i,placeholder:c,updateValue:e.setCustomsItemDescription,error:t.description}),n.a.createElement(_.a,{id:a+"_"+r+"_tariffNumber",className:"customs-step__item-code-column",title:n.a.createElement(it,null),placeholder:s("Optional"),value:u,updateValue:e.setCustomsItemTariffNumber,error:t.tariffNumber}),n.a.createElement(Ye,{weightUnit:p,id:a+"_"+r+"_weight",className:"customs-step__item-weight-column",title:s("Weight (per unit)"),value:o,updateValue:e.setCustomsItemWeight,error:t.weight}),n.a.createElement(nt,{id:a+"_"+r+"_value",className:"customs-step__item-value-column",title:s("Value (per unit)"),value:l,updateValue:e.setCustomsItemValue,error:t.value}),n.a.createElement(E.a,{id:a+"_"+r+"_originCountry",className:"customs-step__item-country-column",title:n.a.createElement(ct,null),value:d,updateValue:e.setCustomsItemOriginCountry,valuesMap:m}))};ut.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,productId:i.a.number.isRequired,description:i.a.string.isRequired,defaultDescription:i.a.string.isRequired,tariffNumber:i.a.string.isRequired,weight:i.a.oneOfType([i.a.string,i.a.number]).isRequired,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,originCountry:i.a.string.isRequired,errors:i.a.object,countryNames:i.a.object.isRequired,setCustomsItemDescription:i.a.func.isRequired,setCustomsItemTariffNumber:i.a.func.isRequired,setCustomsItemWeight:i.a.func.isRequired,setCustomsItemValue:i.a.func.isRequired,setCustomsItemOriginCountry:i.a.func.isRequired};var dt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=t.productId,s=Object(M.t)(e,a,r),i=Object(M.j)(e,a,r),c=i.form.customs.items[n];return{description:c.description,defaultDescription:c.defaultDescription,tariffNumber:c.tariffNumber||"",weight:c.weight,value:c.value,originCountry:c.originCountry,errors:s?Object(M.f)(e,a,r).customs.items[n]:{},countryNames:Object(F.d)(e,r),weightUnit:i.storeOptions.weight_unit}},function(e,t){var a=t.orderId,r=t.siteId,n=t.productId;return{setCustomsItemDescription:function(t){return e(Object(V.H)(a,r,n,t))},setCustomsItemTariffNumber:function(t){return e(Object(V.J)(a,r,n,t))},setCustomsItemWeight:function(t){return e(Object(V.L)(a,r,n,t))},setCustomsItemValue:function(t){return e(Object(V.K)(a,r,n,t))},setCustomsItemOriginCountry:function(t){return e(Object(V.I)(a,r,n,t))}}})(Object(l.localize)(ut)),mt=a(600),pt=function(e){var t=e.siteId,a=e.orderId,r=e.errors,s=e.packageId,i=e.translate,c=e.contentsType,o=e.contentsExplanation,l=e.restrictionType,u=e.restrictionComments,d=e.abandonOnNonDelivery,m=e.itn,p=e.items;return n.a.createElement("div",{className:"customs-step__package"},n.a.createElement(N.a,{htmlFor:s+"_abandonOnNonDelivery",className:"customs-step__abandon-on-non-delivery"},n.a.createElement(mt.a,{id:s+"_abandonOnNonDelivery",checked:!d,onChange:function(){return e.setAbandonOnNonDelivery(!d)}}),n.a.createElement("span",null,i("Return to sender if package is unable to be delivered"))),n.a.createElement("div",{className:"customs-step__restrictions-row"},n.a.createElement("div",{className:"customs-step__contents-type"},n.a.createElement(E.a,{id:s+"_contentsType",title:i("Contents type"),value:c||"merchandise",updateValue:e.setContentsType,valuesMap:{merchandise:i("Merchandise"),documents:i("Documents"),gift:i("Gift"),sample:i("Sample"),other:i("Other\u2026")}}),"other"===c&&n.a.createElement(_.a,{id:s+"_contentsExplanation",title:i("Details"),value:o||"",updateValue:e.setContentsExplanation,error:r.contentsExplanation})),n.a.createElement("div",{className:"customs-step__restriction-type"},n.a.createElement(E.a,{id:s+"_restrictionType",title:i("Restriction type"),value:l||"none",updateValue:e.setRestrictionType,valuesMap:{none:i("None"),quarantine:i("Quarantine"),sanitary_phytosanitary_inspection:i("Sanitary / Phytosanitary inspection"),other:i("Other\u2026")}}),"other"===l&&n.a.createElement(_.a,{id:s+"_restrictionComments",title:i("Details"),value:u||"",updateValue:e.setRestrictionExplanation,error:r.restrictionComments}))),n.a.createElement(_.a,{id:s+"_itn",title:n.a.createElement("span",null,i("ITN")," (",n.a.createElement(T.a,{href:"https://pe.usps.com/text/imm/immc5_010.htm"},i("more info")),")"),value:m||"",updateValue:e.setITN,error:r.itn}),n.a.createElement("div",{className:"customs-step__item-rows"},n.a.createElement(lt,{siteId:t,orderId:a}),Object(b.uniq)(Object(b.map)(p,"product_id")).map(function(e){return n.a.createElement(dt,{key:e,productId:e,packageId:s,siteId:t,orderId:a})})))};pt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,contentsType:i.a.oneOf(["merchandise","documents","gift","sample","other"]),contentsExplanation:i.a.string,restrictionType:i.a.oneOf(["none","quarantine","sanitary_phytosanitary_inspection","other"]),restrictionComments:i.a.string,abandonOnNonDelivery:i.a.bool,itn:i.a.string,items:i.a.arrayOf(i.a.shape({product_id:i.a.number.isRequired})).isRequired,setContentsType:i.a.func.isRequired,setContentsExplanation:i.a.func.isRequired,setRestrictionType:i.a.func.isRequired,setRestrictionExplanation:i.a.func.isRequired,setAbandonOnNonDelivery:i.a.func.isRequired,setITN:i.a.func.isRequired};var gt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=t.packageId,s=Object(M.t)(e,a,r),i=Object(M.j)(e,a,r).form.packages.selected[n];return{contentsType:i.contentsType,contentsExplanation:i.contentsExplanation,restrictionType:i.restrictionType,restrictionComments:i.restrictionComments,abandonOnNonDelivery:i.abandonOnNonDelivery,itn:i.itn,items:i.items,errors:s?Object(M.f)(e,a,r).customs.packages[n]:{}}},function(e,t){var a=t.orderId,r=t.siteId,n=t.packageId;return{setContentsType:function(t){return e(Object(V.G)(a,r,n,t))},setContentsExplanation:function(t){return e(Object(V.F)(a,r,n,t))},setRestrictionType:function(t){return e(Object(V.R)(a,r,n,t))},setRestrictionExplanation:function(t){return e(Object(V.Q)(a,r,n,t))},setAbandonOnNonDelivery:function(t){return e(Object(V.D)(a,r,n,t))},setITN:function(t){return e(Object(V.O)(a,r,n,t))}}})(Object(l.localize)(pt)),ft=function(e){var t=e.siteId,a=e.orderId,r=e.errors,s=e.expanded,i=e.translate,c=e.isSubmitted,o=e.packageDescriptions,l=Object(O.a)(r)?i("Customs information incomplete"):i("Customs information valid");return n.a.createElement(se,{title:i("Customs"),summary:c?l:"",expanded:s,toggleStep:e.toggleStep,isSuccess:c&&!Object(O.a)(r),isError:c&&Object(O.a)(r)},Object.keys(o).map(function(e,r){return n.a.createElement("div",{className:"customs-step__package-container",key:e},r?n.a.createElement("hr",null):null,n.a.createElement("p",{className:"customs-step__package-name"},o[e]),n.a.createElement(gt,{packageId:e,siteId:t,orderId:a}))}),n.a.createElement(Me,{disabled:Object(O.a)(r),onClick:e.confirmCustoms},i("Save customs form")))};ft.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageDescriptions:i.a.objectOf(i.a.string).isRequired,expanded:i.a.bool,isSubmitted:i.a.bool.isRequired,errors:i.a.object,toggleStep:i.a.func.isRequired,confirmCustoms:i.a.func.isRequired};var bt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=s.form.packages.selected;return{packageDescriptions:me(i,Object(pe.a)(e,r),!0),expanded:s.form.customs.expanded,isSubmitted:Object(M.q)(e,a,r),errors:n?Object(M.f)(e,a,r).customs:{}}},function(e,t){var a=t.orderId,r=t.siteId;return{toggleStep:function(){return e(Object(V.U)(a,r,"customs"))},confirmCustoms:function(){return e(Object(V.h)(a,r))}}})(Object(l.localize)(ft)),ht=a(608),vt=a.n(ht),_t=a(826),yt=a(636),kt=function(e){function t(){var e;return $()(this,t),e=Q()(this,Z()(t).call(this)),v()(Je()(e),"onSignatureChecked",function(t,a,r){var n=e.props,s=n.rateObject,i=s.service_id,c=s.carrier_id,o=n.updateValue,l=t?{id:a,value:r.value,netCost:r.netCost}:null;e.setState({selectedSignature:l}),o(i,c,t?r.value:0)}),e.state={signatureOption:!1},e}return te()(t,e),K()(t,[{key:"renderServices",value:function(e,t,a){var r=[];if(a.tracking)switch(e){case"usps":r.push(Object(l.translate)("Includes USPS tracking"));break;default:r.push(Object(l.translate)("Includes tracking"))}if(a.insurance){var n=Number(a.insurance);isNaN(n)?r.push(Object(l.translate)("Insurance (%s)",{args:[a.insurance]})):n>0&&r.push(Object(l.translate)("Insurance (up to %s)",{args:[vt()(n,"USD")]}))}return t.filter(function(e){return 0===e.netCost}).length>0&&r.push(Object(l.translate)("Signature required")),a.free_pickup&&r.push(Object(l.translate)("Eligible for free pickup")),r.join(", ")}},{key:"renderSignatureOptions",value:function(e){var t=this;return e.map(function(e,a){return n.a.createElement(De.a,{key:a,name:"signature_option_".concat(a),label:e.label,checked:!!t.state.selectedSignature&&t.state.selectedSignature.id===a,onChange:function(r){return t.onSignatureChecked(r,a,e)}})})}},{key:"render",value:function(){var e=this.props,t=e.rateObject,a=t.title,r=t.service_id,s=t.carrier_id,i=t.rate,c=t.delivery_days,o=t.delivery_date_guaranteed,u=t.delivery_date,d=t.tracking,m=t.insurance,p=t.free_pickup,g=e.isSelected,f=e.updateValue,h=e.signatureRates,v=this.state.selectedSignature,_=Object(b.values)(Object(b.mapValues)(h,function(e,t){var a=0===e.optionNetCost?Object(l.translate)("free"):Object(l.translate)("+%s",{args:[vt()(e.optionNetCost,"USD")]});return{label:Object(l.translate)("%(label)s (%(price)s)",{args:{label:e.label,price:a}}),value:t,netCost:e.optionNetCost}})),y="";o&&u?y=Object(l.moment)(u).format("LL").split(",")[0]:c&&(y=Object(l.translate)("%(delivery_days)s business day","%(delivery_days)s business days",{count:c,args:{delivery_days:c}}));var k=v?i+v.netCost:i;return n.a.createElement("div",{className:"rates-step__shipping-rate-container"},n.a.createElement(_t.a,{className:"rates-step__shipping-rate-radio-control",selected:g?r:null,options:[{label:"",value:r}],onChange:function(){f(r,s,!!v&&v.value)}}),n.a.createElement("div",{className:"rates-step__shipping-rate-information"},n.a.createElement(yt.a,{carrier:s,size:30}),n.a.createElement("div",{className:"rates-step__shipping-rate-description"},n.a.createElement("div",{className:"rates-step__shipping-rate-description-title"},a),n.a.createElement("div",{className:"rates-step__shipping-rate-description-details"},this.renderServices(s,_,{tracking:d,insurance:m,free_pickup:p}),g&&_.length>1?this.renderSignatureOptions(_):null)),n.a.createElement("div",{className:"rates-step__shipping-rate-details"},n.a.createElement("div",{className:"rates-step__shipping-rate-rate"},"ups"===s?n.a.createElement(st.a,{position:"top left",text:Object(l.translate)("This rate is provided by your connected UPS account")},n.a.createElement("div",{className:"rates-step__shipping-rate-rate-tooltip"},n.a.createElement(H.a,{icon:"help-outline",size:18}))):null,vt()(k,"USD")),n.a.createElement("div",{className:"rates-step__shipping-rate-delivery-date"},y))))}}]),t}(r.Component);kt.propTypes={rateObject:i.a.shape({rate_id:i.a.string.isRequired,title:i.a.string.isRequired,service_id:i.a.string.isRequired,carrier_id:i.a.string.isRequired,rate:i.a.number.isRequired,delivery_days:i.a.number,delivery_date_guaranteed:i.a.bool,delivery_date:i.a.string,tracking:i.a.bool,insurance:i.a.oneOfType([i.a.string,i.a.number]),free_pickup:i.a.bool}).isRequired,signatureRates:i.a.object.isRequired};var Et=kt,Ot={signature_required:u.a.translate("Signature required"),adult_signature_required:u.a.translate("Adult signature required")},jt=function(e,t,a){var r=function(e,t,a){var r=Object(b.find)(a[e].default.rates,function(e){return t===e.service_id});return"undefined"!==typeof r?r.rate:0}(e,t,a);return Object(b.pickBy)(Object(b.mapValues)(a[e],function(e,a){var n=function(e,t,a,r){var n=Object(b.find)(a,function(t){return e===t.service_id});return"undefined"===typeof n?null:t in Ot?n.rate===r&&"Express"!==e?null:n:null}(t,a,e.rates,r);return null!==n?{rate:n,label:Ot[a],optionNetCost:n.rate-r}:null}),function(e){return null!==e})},It=function(e){var t=e.id,a=e.selectedRates,r=e.availableRates,s=e.selectedPackages,i=e.allPackages,c=e.updateRate,o=e.errors,l=e.shouldShowRateNotice,u=e.translate,d=me(s,i,!0),m=1===Object.keys(s).length;return n.a.createElement("div",null,l&&function(e){return n.a.createElement(y.a,{className:"rates-step__notice",icon:"info-outline",showDismiss:!1,text:e("The service and rate chosen by the customer at checkout is not available. Please choose another.")})}(u),Object.values(Object(b.mapValues)(s,function(e,s){if(!(s in r))return null;var i=a[s]||"",l=r[s].default.rates,p=(o[s]||[]).filter(function(e,t){return o[s].indexOf(e)===t}),g=function(e,t,a){return c(s,e,t,a)};return n.a.createElement("div",{key:s,className:"rates-step__package-container"},m?null:n.a.createElement("div",{className:"rates-step__package-container-rates-header"},u("Choose rate: %(pckg)s",{args:{pckg:d[s]}})),Object.values(Object(b.mapValues)(l,function(e){var a=e.service_id;return n.a.createElement(Et,{id:t+"_"+s,key:t+"_"+s+"_"+a,rateObject:e,signatureRates:jt(s,a,r),updateValue:g,isSelected:a===i.serviceId})})),p.map(function(e,t){return n.a.createElement(be.a,{type:"server-error",key:t,text:e})}))})))};It.propTypes={id:i.a.string.isRequired,selectedRates:i.a.object.isRequired,availableRates:i.a.object.isRequired,selectedPackages:i.a.object.isRequired,allPackages:i.a.object.isRequired,updateRate:i.a.func.isRequired,errors:i.a.object.isRequired};var Nt=Object(l.localize)(It);function Rt(e){var t=Object(b.get)(e,"shipping_lines",[]);return Object(b.reduce)(t,function(e,t){return e+parseFloat(t.total)},0)}function Ct(e){return Object(b.get)(e,"shipping_lines[0].method_title",!1)}var qt=a(609),xt=function(e){var t=e.siteId,a=e.orderId,r=e.form,s=e.allPackages,i=e.values,c=e.available,o=e.errors,l=e.ratesTotal,u=e.translate,d=function(e,t,a,r,n){if(!r)return n("Unsaved changes made to packages");if(Object(b.some)(Object(b.mapValues)(t,function(e){return Object(b.isEmpty)(e.default.rates)})))return n("No rates found");if(!a)return"";var s=Object.keys(e);if(1===s.length){var i=s[0],c=e[i],o=t[i].default.rates,l=Object(b.find)(o,["service_id",c]);return l?n("%(serviceName)s: %(rate)s",{args:{serviceName:l.title,rate:vt()(l.rate,"USD")}}):""}return n("Total rate: %(total)s",{args:{total:vt()(a,"USD")}})}(i,c,l,r.packages.saved,u),m=function(r,n,s,i){return e.updateRate(a,t,r,n,s,i)};return Object(b.forEach)(r.packages.selected,function(e,t){if(""===i[t]&&!Object(b.isEmpty)(c)&&t in c&&1===c[t].default.rates.length){var a=c[t].default.rates[0].service_id;m(t,a,!1)}}),n.a.createElement(se,f()({title:u("Shipping rates"),summary:d,expanded:!Object(b.isEmpty)(c),toggleStep:function(){return e.toggleStep(a,t,"rates")}},function(e){var t=e.retrievalInProgress,a=e.errors,r=e.available,n=e.form;return t?{isProgress:!0}:Object(O.a)(a)?{isError:!0}:Object(b.isEmpty)(r)?{}:n.packages.saved?{isSuccess:!0}:{isWarning:!0}}(e)),!Object(b.isEmpty)(c)&&function(e){var t=e.shippingMethod,a=e.shippingCost,r=e.translate,s=document.createElement("div");s.innerHTML=t;var i,c=s.textContent;if(t)return i=0<a?r("Customer paid a {{shippingMethod/}} of {{shippingCost/}} for shipping",{components:{shippingMethod:n.a.createElement("span",null,c),shippingCost:n.a.createElement("span",{className:"rates-step__shipping-info-cost"},vt()(a,"USD"))}}):r("Your customer selected {{shippingMethod/}}",{components:{shippingMethod:n.a.createElement("span",{className:"rates-step__shipping-info-method"},c)}}),n.a.createElement("div",{className:"rates-step__shipping-info"},n.a.createElement(H.a,{icon:"info-outline"}),n.a.createElement("div",null,i))}(e),n.a.createElement(Nt,{id:"rates",orderId:a,siteId:t,showRateNotice:!1,selectedPackages:r.packages.selected,allPackages:s,selectedRates:i,availableRates:c,updateRate:m,errors:o}))};xt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,form:i.a.object.isRequired,values:i.a.object.isRequired,available:i.a.object.isRequired,errors:i.a.object.isRequired,toggleStep:i.a.func.isRequired,updateRate:i.a.func.isRequired};var wt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=Object(M.l)(e,a,r),c=Object(qt.a)(e,a,r);return p()({},s.form.rates,{form:s.form,errors:n&&Object(M.f)(e,a,r).rates,ratesTotal:i?i.total:0,allPackages:Object(pe.a)(e,r),shippingCost:Rt(c),shippingMethod:Ct(c)})},function(e){return Object(o.b)({toggleStep:V.U,updateRate:V.Y},e)})(Object(l.localize)(xt)),St=a(834),Pt=a(622),Tt=function(e){function t(){var e,a;$()(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(s))),v()(Je()(a),"renderDiscount",function(e){var t=a.props.translate,r=t("WooCommerce Shipping gives you access to USPS Commercial Pricing, which is discounted over Retail rates.");return n.a.createElement("div",{className:"label-purchase-modal__price-item-help"},n.a.createElement(st.a,{className:"label-purchase-modal__price-item-tooltip is-dialog-visible",position:"top center",text:r},n.a.createElement("div",{className:"label-purchase-modal__discount"},t("You save %s with WooCommerce Shipping",{args:[vt()(e,"USD")]}),n.a.createElement(H.a,{icon:"help-outline",size:18}))))}),v()(Je()(a),"renderRow",function(e,t,a,r){var s=I()("label-purchase-modal__price-item",{"label-purchase-modal__price-item-total":r});return n.a.createElement("div",{key:a,className:s},n.a.createElement("div",{className:"label-purchase-modal__price-item-name"},e),n.a.createElement("div",{className:"label-purchase-modal__price-item-amount"},vt()(t,"USD")))}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.priceBreakdown,s=t.translate;if(!a)return null;var i=a.prices,c=a.discount,o=a.total;return n.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},n.a.createElement("hr",null),i.map(function(t,a){var i=s("Package %(index)s \u2013 %(title)s",{args:{index:a+1,title:t.carrierTitle}});return n.a.createElement(r.Fragment,{key:a},e.renderRow(i,t.rateWithDiscount,a),"ups"===t.carrierId?n.a.createElement("div",{className:"label-purchase-modal__price-item-carrier-account-notice"}," ",s("Your UPS account will be charged")):n.a.createElement("div",null),t.addons.map(function(t,r){return n.a.createElement("div",{key:"addons-"+a,className:"label-purchase-modal__price-item-addons"},e.renderRow(t.title,t.rate,"addon-"+r))}))}),this.renderRow(s("Total"),o,"total",!0),0<c&&this.renderDiscount(c))}}]),t}(r.Component);Tt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var zt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId;return{priceBreakdown:Object(M.l)(e,a,r)}})(Object(l.localize)(Tt)),Dt=function(e){var t=e.translate,a=e.normalizationStatus,r=e.form,s=e.orderId,i=e.siteId,c=r.origin,o=r.rates,l=Object.keys(o.values).length;return n.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},n.a.createElement("div",{className:"label-purchase-modal__shipping-summary-info"},a.isSuccess?n.a.createElement("div",{className:"label-purchase-modal__shipping-summary-street"},n.a.createElement("div",null,t("Shipping from")),n.a.createElement("div",null,c.values.address,n.a.createElement("a",{href:"#",onClick:function(){return e.toggleStep(s,i,"origin",!0)}},t("Edit")))):null),n.a.createElement("div",{className:"label-purchase-modal__shipping-summarry-labels"},l+" "+t("shipping label ready","shipping labels ready",{count:l})))};Dt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var At=function(e){var t=e.normalizationInProgress,a=e.errors,r=e.isNormalized,n=e.values,s=e.normalized;return t?{isProgress:!0}:Object(O.a)(a)||r&&!s||!r?{isError:!0}:r?Object(b.isEqual)(n,s)?{isSuccess:!0}:{isWarning:!0}:{}},Ut=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=s.form.origin,c=n&&Object(M.f)(e,a,r).origin;return{orderId:a,siteId:r,errors:c,form:s.form,expanded:i.expanded,normalizationStatus:At(p()({},i,{errors:c}))}},function(e){return Object(o.b)({toggleStep:V.U},e)})(Dt)),Vt=function(e){var t=e.form,a=e.disabled,s=e.busy;return n.a.createElement(r.Fragment,null,n.a.createElement(de.a,{disabled:a,onClick:t.needsPrintConfirmation?e.confirmPrintLabel:e.purchaseLabel,isPrimary:!0,isBusy:s,className:I()("button")},function(e){var t=e.form,a=e.translate;return t.needsPrintConfirmation?a("Print"):t.isSubmitting?a("Purchasing\u2026"):a("Buy shipping label","Buy shipping labels",{count:Object.keys(t.packages.selected).length})}(e)))};Vt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,disabled:i.a.bool,busy:i.a.bool};var Mt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r);return{form:n&&s.form}},function(e,t){var a=t.orderId,r=t.siteId;return{confirmPrintLabel:function(){return e(Object(V.j)(a,r))},purchaseLabel:function(){return e(Object(V.B)(a,r))}}})(Object(l.localize)(Vt)),Ft=a(576),Lt=function(e){function t(){var e,a;$()(this,t);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(n))),v()(Je()(a),"onVisibilityChange",function(){document.hidden||a.refetchSettings(),a.creditCardWindow&&a.creditCardWindow.closed&&document.removeEventListener("visibilitychange",a.onVisibilityChange)}),v()(Je()(a),"refetchSettings",function(){a.props.fetchSettings(a.props.siteId)}),v()(Je()(a),"onChooseCard",function(){a.creditCardWindow=window.open(a.props.url),document.addEventListener("visibilitychange",a.onVisibilityChange)}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.disabled,a=e.buttonLabel,s=e.buttonDescription;return n.a.createElement(r.Fragment,null,n.a.createElement(de.a,{onClick:this.onChooseCard,disabled:t,isPrimary:!0,className:I()("button")},a," ",n.a.createElement(H.a,{icon:"external"})),n.a.createElement("div",{className:"purchase-section__explanation"},s(this.onChooseCard)))}}]),t}(r.Component),Wt=Object(c.b)(function(e){return e},function(e){return Object(o.b)({fetchSettings:Ft.a},e)})(Object(l.localize)(Lt)),Bt=a(647),Ht=(a(818),Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r),i=n&&Object(M.b)(e,a,r),c=n&&s.form;return{form:c,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,r)),paymentMethods:Object(qe.l)(e,r),disablePurchase:!c.needsPrintConfirmation&&(!i||c.isSubmitting)}})(Object(l.localize)(function(e){var t=e.orderId,a=e.siteId,r=e.hasLabelsPaymentMethod,s=e.paymentMethods,i=e.form,c=e.disablePurchase,o=e.translate,l=i.isSubmitting&&!i.needsPrintConfirmation,u=Object(M.n)(i.rates),d=u&&Object.values(i.rates.values).some(function(e){return"ups"!==e.carrierId}),m=r&&d||!d;return n.a.createElement("div",{className:"purchase-section"},m||!u?n.a.createElement(Mt,{siteId:a,orderId:t,disabled:c,busy:l}):s.length?n.a.createElement(Wt,{disabled:c,url:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings",buttonLabel:o("Choose credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}choose a credit card to add to your account{{/a}}.",{components:{a:n.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}):n.a.createElement(Wt,{disabled:c,url:Object(Bt.a)()+"/me/purchases/add-credit-card",buttonLabel:o("Add credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}add a credit card to your account{{/a}}.",{components:{a:n.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}))}))),Yt=a(690),$t=a(535),Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object($t.a)(e);return Object(b.get)(e,["extensions","woocommerce","ui","orders",t,"edits","currentlyEditingId"],null)},Kt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object($t.a)(e),a=Gt(e,t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object($t.a)(e);return Object(b.get)(e,["extensions","woocommerce","ui","orders",t,"edits","changes"],{})}(e,t);if(Object(b.isObject)(a)){var n=function(){var e=Object(Yt.b)(0,"USD");return{status:"pending",currency:"USD",discount_total:e,discount_tax:e,shipping_total:e,shipping_tax:e,cart_tax:e,total:e,total_tax:e,prices_include_tax:!1,billing:{},shipping:{},payment_method:"calypso_manual",payment_method_title:Object(l.translate)("Manual Payment"),line_items:[],tax_lines:[],shipping_lines:[],fee_lines:[],coupon_lines:[],refunds:[]}}();return p()({},n,r,{id:a})}var s=Object(qt.a)(e,a,t);return s?Object(b.merge)({},s,r):r},Jt=a(640),Qt=function(e){var t=e.orderId,a=e.siteId,r=e.form,s=e.errors,i=e.paperSize,c=e.translate,o=e.fulfillOrder,l=e.emailDetails,u=e.order,d=e.hasLabelsPaymentMethod,m=Object(M.n)(r.rates)&&Object.values(r.rates.values).some(function(e){return"ups"!==e.carrierId}),p=d&&m||!m;return n.a.createElement(St.a,{className:"label-purchase-modal__sidebar",title:c("Shipping summary")},n.a.createElement("div",{className:"label-purchase-modal__shipping-summary-header"},c("Shipping summary")),n.a.createElement(Ut,{siteId:a,orderId:t}),n.a.createElement(zt,{siteId:a,orderId:t}),n.a.createElement("hr",null),n.a.createElement("div",{className:"label-purchase-modal__purchase-container"},p?n.a.createElement(E.a,{id:"paper_size",valuesMap:Object(Pt.a)(r.origin.values.country),title:c("Paper size"),value:i,updateValue:function(r){return e.updatePaperSize(t,a,r)},error:s.paperSize}):null,n.a.createElement(Ht,{siteId:a,orderId:t})),n.a.createElement(De.a,{className:"label-purchase-modal__option-mark-order-fulfilled",label:Object(Jt.b)(u.status)?c("Notify the customer with shipment details"):c("Mark this order as complete and notify the customer"),checked:o||l,onChange:function(r){e.setFulfillOrderOption(t,a,r&&!Object(Jt.b)(u.status)),e.setEmailDetailsOption(t,a,r&&Object(Jt.b)(u.status))}}))};Qt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,paperSize:i.a.string.isRequired,errors:i.a.object.isRequired,form:i.a.object.isRequired,updatePaperSize:i.a.func.isRequired,fulfillOrder:i.a.bool.isRequired,emailDetails:i.a.bool.isRequired,order:i.a.object.isRequired,hasLabelsPaymentMethod:i.a.bool.isRequired,setFulfillOrderOption:i.a.func.isRequired};var Xt=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r);return{order:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object($t.a)(e);return!!Gt(e,t)}(e)?Kt(e):Object(qt.a)(e,a),paperSize:s.paperSize,form:s.form,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,r)),errors:n&&Object(M.f)(e,a,r).sidebar,fulfillOrder:n&&Object(M.v)(e,a,r),emailDetails:n&&Object(M.u)(e,a,r)}},function(e){return Object(o.b)({setEmailDetailsOption:V.M,setFulfillOrderOption:V.N,updatePaperSize:V.X},e)})(Object(l.localize)(Qt)),Zt=function(e){var t=e.loaded,a=e.translate,r=e.showPurchaseDialog;if(!t)return null;return r?n.a.createElement(d.a,{className:"woocommerce label-purchase-modal wcc-root",shouldCloseOnClickOutside:!1,onRequestClose:function(){return e.exitPrintingFlow(e.orderId,e.siteId,!1)},title:a("Create shipping label","Create shipping labels",{count:Object.keys(e.form.packages.selected).length})},n.a.createElement("div",{className:"label-purchase-modal__content"},n.a.createElement("div",{className:"label-purchase-modal__main-section"},n.a.createElement(ue,{type:"origin",title:a("Origin address"),siteId:e.siteId,orderId:e.orderId}),n.a.createElement(ue,{type:"destination",title:a("Destination address"),siteId:e.siteId,orderId:e.orderId}),n.a.createElement(We,{siteId:e.siteId,orderId:e.orderId}),e.isCustomsFormRequired&&n.a.createElement(bt,{siteId:e.siteId,orderId:e.orderId}),n.a.createElement(wt,{siteId:e.siteId,orderId:e.orderId})),n.a.createElement(Xt,{siteId:e.siteId,orderId:e.orderId}))):null};Zt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};t.default=Object(c.b)(function(e,t){var a=t.orderId,r=t.siteId,n=Object(M.t)(e,a,r),s=Object(M.j)(e,a,r);return{loaded:n,form:n&&s.form,showPurchaseDialog:s.showPurchaseDialog,isCustomsFormRequired:Object(M.p)(e,a,r)}},function(e){return Object(o.b)({exitPrintingFlow:V.o},e)})(Object(l.localize)(Zt))}}]);
|
dist/chunks/1209db5094dffd59872d.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[152],{604:function(e,t,n){"use strict";var a=n(10),r=n(528),o=n.n(r),s=n(620),c=n(618),i=n(1),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function h(e){return Object(i.get)(l,e,"")}var u=n(824),p=n(839),f=Object(c.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",h("default.fontFamily"),";font-size:",h("default.fontSize"),";"),m=Object(c.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",Object(u.a)(1),";.components-panel__row &{margin-bottom:inherit;}"),b=Object(c.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",Object(u.a)(1),";"),d=Object(c.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",Object(u.a)(1),";font-size:",h("helpText.fontSize"),";font-style:normal;color:",Object(p.a)("mediumGray.text"),";");function v(e){var t=e.id,n=e.label,r=e.hideLabelFromVision,c=e.help,i=e.className,l=e.children;return Object(a.createElement)(f,{className:o()("components-base-control",i)},Object(a.createElement)(m,{className:"components-base-control__field"},n&&t&&(r?Object(a.createElement)(s.a,{as:"label",htmlFor:t},n):Object(a.createElement)(b,{className:"components-base-control__label",htmlFor:t},n)),n&&!t&&(r?Object(a.createElement)(s.a,{as:"label"},n):Object(a.createElement)(v.VisualLabel,null,n)),l),!!c&&Object(a.createElement)(d,{id:t+"__help",className:"components-base-control__help"},c))}v.VisualLabel=function(e){var t=e.className,n=e.children;return t=o()("components-base-control__label",t),Object(a.createElement)("span",{className:t},n)};t.a=v},620:function(e,t,n){"use strict";var a=n(556),r=n(543),o=n(528),s=n.n(o),c=n(10);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}t.a=function(e){var t=e.as,n=void 0===t?"div":t,o=e.className,l=Object(r.a)(e,["as","className"]);return function(e){var t=e.as,n=void 0===t?"div":t,a=Object(r.a)(e,["as"]);return"function"===typeof a.children?a.children(a):Object(c.createElement)(n,a)}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){Object(a.a)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({as:n,className:s()("components-visually-hidden",o)},l))}},665:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var a=n(10),r=new WeakMap;function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(a.useMemo)(function(){if(n)return n;var a=function(e){var t=r.get(e)||0;return r.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(a):a},[e])}},698:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var a=n(37),r=n(543),o=n(10),s=n(665),c=n(604);function i(e){var t=e.label,n=e.hideLabelFromVision,l=e.value,h=e.help,u=e.className,p=e.onChange,f=e.type,m=void 0===f?"text":f,b=Object(r.a)(e,["label","hideLabelFromVision","value","help","className","onChange","type"]),d=Object(s.a)(i),v="inspector-text-control-".concat(d);return Object(o.createElement)(c.a,{label:t,hideLabelFromVision:n,id:v,help:h,className:u},Object(o.createElement)("input",Object(a.a)({className:"components-text-control__input",type:m,id:v,value:l,onChange:function(e){return p(e.target.value)},"aria-describedby":h?v+"__help":void 0},b)))}},811:function(e,t,n){"use strict";var a=n(812),r=n(813);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){r.isString(e)&&(e=y(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(l),u=["%","/","?",";","#"].concat(h),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=n(814);function y(e,t,n){if(e&&r.isObject(e)&&e instanceof o)return e;var a=new o;return a.parse(e,t,n),a}o.prototype.parse=function(e,t,n){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),c=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(c);l[0]=l[0].replace(/\\/g,"/");var y=e=l.join(c);if(y=y.trim(),!n&&1===e.split("#").length){var j=i.exec(y);if(j)return this.path=y,this.href=y,this.pathname=j[1],j[2]?(this.search=j[2],this.query=t?O.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var g=s.exec(y);if(g){var w=(g=g[0]).toLowerCase();this.protocol=w,y=y.substr(g.length)}if(n||g||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var C="//"===y.substr(0,2);!C||g&&d[g]||(y=y.substr(2),this.slashes=!0)}if(!d[g]&&(C||g&&!v[g])){for(var x,E,_=-1,N=0;N<p.length;N++){-1!==(k=y.indexOf(p[N]))&&(-1===_||k<_)&&(_=k)}-1!==(E=-1===_?y.lastIndexOf("@"):y.lastIndexOf("@",_))&&(x=y.slice(0,E),y=y.slice(E+1),this.auth=decodeURIComponent(x)),_=-1;for(N=0;N<u.length;N++){var k;-1!==(k=y.indexOf(u[N]))&&(-1===_||k<_)&&(_=k)}-1===_&&(_=y.length),this.host=y.slice(0,_),y=y.slice(_),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var D=this.hostname.split(/\./),I=(N=0,D.length);N<I;N++){var A=D[N];if(A&&!A.match(f)){for(var S="",q=0,P=A.length;q<P;q++)A.charCodeAt(q)>127?S+="x":S+=A[q];if(!S.match(f)){var F=D.slice(0,N),M=D.slice(N+1),L=A.match(m);L&&(F.push(L[1]),M.unshift(L[2])),M.length&&(y="/"+M.join(".")+y),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=a.toASCII(this.hostname));var U=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+U,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!b[w])for(N=0,I=h.length;N<I;N++){var V=h[N];if(-1!==y.indexOf(V)){var K=encodeURIComponent(V);K===V&&(K=escape(V)),y=y.split(V).join(K)}}var T=y.indexOf("#");-1!==T&&(this.hash=y.substr(T),y=y.slice(0,T));var H=y.indexOf("?");if(-1!==H?(this.search=y.substr(H),this.query=y.substr(H+1),t&&(this.query=O.parse(this.query)),y=y.slice(0,H)):t&&(this.search="",this.query={}),y&&(this.pathname=y),v[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var B=this.search||"";this.path=U+B}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",a=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&r.isObject(this.query)&&Object.keys(this.query).length&&(s=O.stringify(this.query));var c=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),a&&"#"!==a.charAt(0)&&(a="#"+a),c&&"?"!==c.charAt(0)&&(c="?"+c),t+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(c=c.replace("#","%23"))+a},o.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(r.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,a=Object.keys(this),s=0;s<a.length;s++){var c=a[s];n[c]=this[c]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),l=0;l<i.length;l++){var h=i[l];"protocol"!==h&&(n[h]=e[h])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var u=Object.keys(e),p=0;p<u.length;p++){var f=u[p];n[f]=e[f]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||d[e.protocol])n.pathname=e.pathname;else{for(var m=(e.pathname||"").split("/");m.length&&!(e.host=m.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==m[0]&&m.unshift(""),m.length<2&&m.unshift(""),n.pathname=m.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var b=n.pathname||"",O=n.search||"";n.path=b+O}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),j=e.host||e.pathname&&"/"===e.pathname.charAt(0),g=j||y||n.host&&e.pathname,w=g,C=n.pathname&&n.pathname.split("/")||[],x=(m=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(x&&(n.hostname="",n.port=null,n.host&&(""===C[0]?C[0]=n.host:C.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===m[0]?m[0]=e.host:m.unshift(e.host)),e.host=null),g=g&&(""===m[0]||""===C[0])),j)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,C=m;else if(m.length)C||(C=[]),C.pop(),C=C.concat(m),n.search=e.search,n.query=e.query;else if(!r.isNullOrUndefined(e.search)){if(x)n.hostname=n.host=C.shift(),(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=e.search,n.query=e.query,r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=C.slice(-1)[0],_=(n.host||e.host||C.length>1)&&("."===E||".."===E)||""===E,N=0,k=C.length;k>=0;k--)"."===(E=C[k])?C.splice(k,1):".."===E?(C.splice(k,1),N++):N&&(C.splice(k,1),N--);if(!g&&!w)for(;N--;N)C.unshift("..");!g||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),_&&"/"!==C.join("/").substr(-1)&&C.push("");var R,D=""===C[0]||C[0]&&"/"===C[0].charAt(0);x&&(n.hostname=n.host=D?"":C.length?C.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(g=g||n.host&&C.length)&&!D&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=c.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},812:function(e,t,n){(function(e){!function(n){var a=t&&!t.nodeType&&t,r=e&&!e.nodeType&&e,o=window;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var s,c,i=2147483647,l=36,h=1,u=26,p=38,f=700,m=72,b=128,d="-",v=/^xn--/,O=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=l-h,w=Math.floor,C=String.fromCharCode;function x(e){throw new RangeError(j[e])}function E(e,t){for(var n=e.length,a=[];n--;)a[n]=t(e[n]);return a}function _(e,t){var n=e.split("@"),a="";return n.length>1&&(a=n[0]+"@",e=n[1]),a+E((e=e.replace(y,".")).split("."),t).join(".")}function N(e){for(var t,n,a=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?a.push(((1023&t)<<10)+(1023&n)+65536):(a.push(t),r--):a.push(t);return a}function k(e){return E(e,function(e){var t="";return e>65535&&(t+=C((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=C(e)}).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function D(e,t,n){var a=0;for(e=n?w(e/f):e>>1,e+=w(e/t);e>g*u>>1;a+=l)e=w(e/g);return w(a+(g+1)*e/(e+p))}function I(e){var t,n,a,r,o,s,c,p,f,v,O,y=[],j=e.length,g=0,C=b,E=m;for((n=e.lastIndexOf(d))<0&&(n=0),a=0;a<n;++a)e.charCodeAt(a)>=128&&x("not-basic"),y.push(e.charCodeAt(a));for(r=n>0?n+1:0;r<j;){for(o=g,s=1,c=l;r>=j&&x("invalid-input"),((p=(O=e.charCodeAt(r++))-48<10?O-22:O-65<26?O-65:O-97<26?O-97:l)>=l||p>w((i-g)/s))&&x("overflow"),g+=p*s,!(p<(f=c<=E?h:c>=E+u?u:c-E));c+=l)s>w(i/(v=l-f))&&x("overflow"),s*=v;E=D(g-o,t=y.length+1,0==o),w(g/t)>i-C&&x("overflow"),C+=w(g/t),g%=t,y.splice(g++,0,C)}return k(y)}function A(e){var t,n,a,r,o,s,c,p,f,v,O,y,j,g,E,_=[];for(y=(e=N(e)).length,t=b,n=0,o=m,s=0;s<y;++s)(O=e[s])<128&&_.push(C(O));for(a=r=_.length,r&&_.push(d);a<y;){for(c=i,s=0;s<y;++s)(O=e[s])>=t&&O<c&&(c=O);for(c-t>w((i-n)/(j=a+1))&&x("overflow"),n+=(c-t)*j,t=c,s=0;s<y;++s)if((O=e[s])<t&&++n>i&&x("overflow"),O==t){for(p=n,f=l;!(p<(v=f<=o?h:f>=o+u?u:f-o));f+=l)E=p-v,g=l-v,_.push(C(R(v+E%g,0))),p=w(E/g);_.push(C(R(p,0))),o=D(n,j,a==r),n=0,++a}++n,++t}return _.join("")}if(s={version:"1.4.1",ucs2:{decode:N,encode:k},decode:I,encode:A,toASCII:function(e){return _(e,function(e){return O.test(e)?"xn--"+A(e):e})},toUnicode:function(e){return _(e,function(e){return v.test(e)?I(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return s});else if(a&&r)if(e.exports==a)r.exports=s;else for(c in s)s.hasOwnProperty(c)&&(a[c]=s[c]);else n.punycode=s}(this)}).call(this,n(118)(e))},813:function(e,t,n){"use strict";e.exports={isString:function(e){return"string"===typeof e},isObject:function(e){return"object"===typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},814:function(e,t,n){"use strict";t.decode=t.parse=n(815),t.encode=t.stringify=n(816)},815:function(e,t,n){"use strict";function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var s={};if("string"!==typeof e||0===e.length)return s;var c=/\+/g;e=e.split(t);var i=1e3;o&&"number"===typeof o.maxKeys&&(i=o.maxKeys);var l=e.length;i>0&&l>i&&(l=i);for(var h=0;h<l;++h){var u,p,f,m,b=e[h].replace(c,"%20"),d=b.indexOf(n);d>=0?(u=b.substr(0,d),p=b.substr(d+1)):(u=b,p=""),f=decodeURIComponent(u),m=decodeURIComponent(p),a(s,f)?r(s[f])?s[f].push(m):s[f]=[s[f],m]:s[f]=m}return s};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},816:function(e,t,n){"use strict";var a=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,c){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===typeof e?o(s(e),function(s){var c=encodeURIComponent(a(s))+n;return r(e[s])?o(e[s],function(e){return c+encodeURIComponent(a(e))}).join(t):c+encodeURIComponent(a(e[s]))}).join(t):c?encodeURIComponent(a(c))+n+encodeURIComponent(a(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],a=0;a<e.length;a++)n.push(t(e[a],a));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},825:function(e,t,n){"use strict";var a=n(556),r=n(543),o=n(10);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}t.a=function(e){var t=e.icon,n=e.size,c=void 0===n?24:n,i=Object(r.a)(e,["icon","size"]);return Object(o.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){Object(a.a)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({width:c,height:c},i))}},826:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var a=n(10),r=n(1),o=n(528),s=n.n(o),c=n(665),i=n(604);function l(e){var t=e.label,n=e.className,o=e.selected,h=e.help,u=e.onChange,p=e.options,f=void 0===p?[]:p,m=Object(c.a)(l),b="inspector-radio-control-".concat(m),d=function(e){return u(e.target.value)};return!Object(r.isEmpty)(f)&&Object(a.createElement)(i.a,{label:t,id:b,help:h,className:s()(n,"components-radio-control")},f.map(function(e,t){return Object(a.createElement)("div",{key:"".concat(b,"-").concat(t),className:"components-radio-control__option"},Object(a.createElement)("input",{id:"".concat(b,"-").concat(t),className:"components-radio-control__input",type:"radio",name:b,value:e.value,onChange:d,checked:e.value===o,"aria-describedby":h?"".concat(b,"__help"):void 0}),Object(a.createElement)("label",{htmlFor:"".concat(b,"-").concat(t)},e.label))}))}},834:function(e,t,n){"use strict";var a=n(37),r=n(543),o=n(561),s=n(566),c=n(571),i=n(567),l=n(559),h=n(10),u=n(78),p=n(731),f=n(665),m=Object(p.a)(function(e){return function(t){var n=Object(f.a)(e);return Object(h.createElement)(e,Object(a.a)({},t,{instanceId:n}))}},"withInstanceId"),b=n(654),d=n(79),v=n(528),O=n.n(v),y=n(688),j=n(1),g=j.flowRight,w=n(695),C=n(694),x=n(721),E=n(693);function _(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,a=Object(l.a)(e);if(t){var r=Object(l.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(i.a)(this,n)}}var N=function(e){Object(c.a)(n,e);var t=_(n);function n(){var e;return Object(o.a)(this,n),(e=t.apply(this,arguments)).containerRef=Object(h.createRef)(),e.handleKeyDown=e.handleKeyDown.bind(Object(d.a)(e)),e.handleFocusOutside=e.handleFocusOutside.bind(Object(d.a)(e)),e}return Object(s.a)(n,[{key:"componentDidMount",value:function(){this.props.focusOnMount&&this.containerRef.current.focus()}},{key:"handleFocusOutside",value:function(e){this.props.shouldCloseOnClickOutside&&this.onRequestClose(e)}},{key:"handleKeyDown",value:function(e){e.keyCode===y.a&&this.handleEscapeKeyDown(e)}},{key:"handleEscapeKeyDown",value:function(e){this.props.shouldCloseOnEsc&&(e.stopPropagation(),this.onRequestClose(e))}},{key:"onRequestClose",value:function(e){var t=this.props.onRequestClose;t&&t(e)}},{key:"render",value:function(){var e=this.props,t=e.overlayClassName,n=e.contentLabel,a=e.aria,r=a.describedby,o=a.labelledby,s=e.children,c=e.className,i=e.role,l=e.style;return Object(h.createElement)(w.a,{className:O()("components-modal__screen-overlay",t),onKeyDown:this.handleKeyDown},Object(h.createElement)("div",{className:O()("components-modal__frame",c),style:l,ref:this.containerRef,role:i,"aria-label":n,"aria-labelledby":n?null:o,"aria-describedby":r,tabIndex:"-1"},s))}}]),n}(h.Component),k=g([x.a,E.a,C.a])(N),R=n(684),D=n(823),I=n(720),A=function(e){var t=e.icon,n=e.title,a=e.onClose,r=e.closeLabel,o=e.headingId,s=e.isDismissible,c=r||Object(R.a)("Close dialog");return Object(h.createElement)("div",{className:"components-modal__header"},Object(h.createElement)("div",{className:"components-modal__header-heading-container"},t&&Object(h.createElement)("span",{className:"components-modal__icon-container","aria-hidden":!0},t),n&&Object(h.createElement)("h1",{id:o,className:"components-modal__header-heading"},n)),s&&Object(h.createElement)(I.a,{onClick:a,icon:D.a,label:c}))},S=new Set(["alert","status","log","marquee","timer"]),q=[],P=!1;function F(e){if(!P){var t=document.body.children;Object(j.forEach)(t,function(t){t!==e&&function(e){var t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||S.has(t))}(t)&&(t.setAttribute("aria-hidden","true"),q.push(t))}),P=!0}}function M(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,a=Object(l.a)(e);if(t){var r=Object(l.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(i.a)(this,n)}}var L,U=0,z=function(e){Object(c.a)(n,e);var t=M(n);function n(e){var a;return Object(o.a)(this,n),(a=t.call(this,e)).prepareDOM(),a}return Object(s.a)(n,[{key:"componentDidMount",value:function(){1===++U&&this.openFirstModal()}},{key:"componentWillUnmount",value:function(){0===--U&&this.closeLastModal(),this.cleanDOM()}},{key:"prepareDOM",value:function(){L||(L=document.createElement("div"),document.body.appendChild(L)),this.node=document.createElement("div"),L.appendChild(this.node)}},{key:"cleanDOM",value:function(){L.removeChild(this.node)}},{key:"openFirstModal",value:function(){F(L),document.body.classList.add(this.props.bodyOpenClassName)}},{key:"closeLastModal",value:function(){document.body.classList.remove(this.props.bodyOpenClassName),P&&(Object(j.forEach)(q,function(e){e.removeAttribute("aria-hidden")}),q=[],P=!1)}},{key:"render",value:function(){var e=this.props,t=e.onRequestClose,n=e.title,o=e.icon,s=e.closeButtonLabel,c=e.children,i=e.aria,l=e.instanceId,p=e.isDismissible,f=e.isDismissable,m=Object(r.a)(e,["onRequestClose","title","icon","closeButtonLabel","children","aria","instanceId","isDismissible","isDismissable"]),d=i.labelledby||"components-modal-header-".concat(l);return f&&Object(b.a)("isDismissable prop of the Modal component",{alternative:"isDismissible prop (renamed) of the Modal component"}),Object(u.createPortal)(Object(h.createElement)(k,Object(a.a)({onRequestClose:t,aria:{labelledby:n?d:null,describedby:i.describedby}},m),Object(h.createElement)("div",{className:"components-modal__content",role:"document"},Object(h.createElement)(A,{closeLabel:s,headingId:d,icon:o,isDismissible:p||f,onClose:t,title:n}),c)),this.node)}}]),n}(h.Component);z.defaultProps={bodyOpenClassName:"modal-open",role:"dialog",title:null,focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,isDismissible:!0,aria:{labelledby:null,describedby:null}};t.a=m(z)},836:function(e,t,n){"use strict";var a=n(37),r=n(606),o=n(543),s=n(10),c=n(528),i=n.n(c),l=n(1),h=n(684),u=n(822),p=Object(s.createElement)(u.b,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(u.a,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),f=n(620),m=n(618),b=n(825);var d=Object(m.a)(b.a,{target:"etxm6pv0",label:"StyledIcon"})({name:"i8uvf3",styles:"width:1.4em;height:1.4em;margin:-0.2em 0.1em 0;vertical-align:middle;fill:currentColor;"});t.a=Object(s.forwardRef)(function(e,t){var n=e.href,c=e.children,u=e.className,m=e.rel,b=void 0===m?"":m,v=Object(o.a)(e,["href","children","className","rel"]);b=Object(l.uniq)(Object(l.compact)([].concat(Object(r.a)(b.split(" ")),["external","noreferrer","noopener"]))).join(" ");var O=i()("components-external-link",u);return Object(s.createElement)("a",Object(a.a)({},v,{className:O,href:n,target:"_blank",rel:b,ref:t}),c,Object(s.createElement)(f.a,{as:"span"},Object(h.a)("(opens in a new tab)")),Object(s.createElement)(d,{icon:p,className:"components-external-link__icon"}))})},838:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var a=n(37),r=n(543),o=n(10),s=n(665),c=n(825),i=n(822),l=Object(o.createElement)(i.b,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.a,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),h=n(604);function u(e){var t=e.label,n=e.className,i=e.heading,p=e.checked,f=e.help,m=e.onChange,b=Object(r.a)(e,["label","className","heading","checked","help","onChange"]),d=Object(s.a)(u),v="inspector-checkbox-control-".concat(d);return Object(o.createElement)(h.a,{label:i,id:v,help:f,className:n},Object(o.createElement)("span",{className:"components-checkbox-control__input-container"},Object(o.createElement)("input",Object(a.a)({id:v,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return m(e.target.checked)},checked:p,"aria-describedby":f?v+"__help":void 0},b)),p?Object(o.createElement)(c.a,{icon:l,className:"components-checkbox-control__checked",role:"presentation"}):null),Object(o.createElement)("label",{className:"components-checkbox-control__label",htmlFor:v},t))}}}]);
|
|
dist/chunks/{32acea31b1c95a860379.css → 175a99358c521f124e23.css}
RENAMED
File without changes
|
dist/chunks/175a99358c521f124e23.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[145,139],{535:function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(1),n(565);function a(e){return e.ui.selectedSiteId}},538:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"p",function(){return E}),n.d(t,"q",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"s",function(){return b}),n.d(t,"t",function(){return h}),n.d(t,"u",function(){return g}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return C}),n.d(t,"A",function(){return S}),n.d(t,"v",function(){return N}),n.d(t,"w",function(){return y}),n.d(t,"x",function(){return j}),n.d(t,"C",function(){return I}),n.d(t,"E",function(){return R}),n.d(t,"D",function(){return P}),n.d(t,"B",function(){return k}),n.d(t,"F",function(){return M}),n.d(t,"G",function(){return T}),n.d(t,"H",function(){return A}),n.d(t,"I",function(){return L}),n.d(t,"J",function(){return w}),n.d(t,"K",function(){return x}),n.d(t,"m",function(){return D}),n.d(t,"n",function(){return W}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return V}),n.d(t,"M",function(){return G}),n.d(t,"N",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return K}),n.d(t,"Y",function(){return Q}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return $}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return J}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return ae}),n.d(t,"hb",function(){return re}),n.d(t,"ib",function(){return ie}),n.d(t,"jb",function(){return ce}),n.d(t,"kb",function(){return se}),n.d(t,"lb",function(){return oe}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return me}),n.d(t,"rb",function(){return pe}),n.d(t,"qb",function(){return fe}),n.d(t,"sb",function(){return Ee}),n.d(t,"tb",function(){return _e}),n.d(t,"ub",function(){return Oe}),n.d(t,"vb",function(){return be}),n.d(t,"wb",function(){return he}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ce}),n.d(t,"Ab",function(){return Se}),n.d(t,"Bb",function(){return Ne}),n.d(t,"Cb",function(){return ye}),n.d(t,"Db",function(){return je}),n.d(t,"Eb",function(){return Ie}),n.d(t,"Fb",function(){return Re}),n.d(t,"Gb",function(){return Pe}),n.d(t,"Hb",function(){return ke}),n.d(t,"Ib",function(){return Me}),n.d(t,"U",function(){return Te}),n.d(t,"V",function(){return Ae}),n.d(t,"S",function(){return Le}),n.d(t,"T",function(){return we});var a="WOOCOMMERCE_ACTION_LIST_ANNOTATE",r="WOOCOMMERCE_ACTION_LIST_CLEAR",i="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",c="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",s="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",o="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",m="WOOCOMMERCE_ERROR_CLEAR",p="WOOCOMMERCE_LOCATIONS_REQUEST",f="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",E="WOOCOMMERCE_ORDER_DELETE",_="WOOCOMMERCE_ORDER_DELETE_FAILURE",O="WOOCOMMERCE_ORDER_DELETE_SUCCESS",b="WOOCOMMERCE_ORDER_INVOICE_SEND",h="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",g="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",N="WOOCOMMERCE_ORDER_NOTES_REQUEST",y="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",j="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",I="WOOCOMMERCE_ORDER_REFUND_CREATE",R="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",k="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",M="WOOCOMMERCE_ORDER_REQUEST",T="WOOCOMMERCE_ORDER_REQUEST_FAILURE",A="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",L="WOOCOMMERCE_ORDER_UPDATE",w="WOOCOMMERCE_ORDER_UPDATE_FAILURE",x="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",D="WOOCOMMERCE_ORDERS_REQUEST",W="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",V="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",G="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",H="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",K="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",Q="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",$="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",J="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",ue="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",le="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",de="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",Ne="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Pe="WOOCOMMERCE_SHIPPING_ZONE_OPEN",ke="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Me="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Te="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Le="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",we="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},540:function(e,t,n){"use strict";n.d(t,"j",function(){return f}),n.d(t,"t",function(){return E}),n.d(t,"s",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"h",function(){return b}),n.d(t,"g",function(){return h}),n.d(t,"v",function(){return g}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return C}),n.d(t,"e",function(){return S}),n.d(t,"l",function(){return N}),n.d(t,"p",function(){return y}),n.d(t,"n",function(){return P}),n.d(t,"f",function(){return T}),n.d(t,"o",function(){return A}),n.d(t,"q",function(){return L}),n.d(t,"d",function(){return w}),n.d(t,"b",function(){return x}),n.d(t,"i",function(){return D}),n.d(t,"c",function(){return W}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return V});var a=n(1),r=n(34),i=n(546),c=n(535),s=n(559),o=n(549),u=n(544),l=n(573),d=n(578),m=n(574),p=n(575),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.loaded},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.isFetching},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.error},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.loaded?a.labels:[]},h=function(e,t,n,a){return b(e,t,n).find(function(e){return e.label_id===a})},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.emailDetails},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.refreshedLabelStatus},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.form},N=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),i=S(e,t,n);if(!i)return null;var s=i.rates,o=s.values,u=s.available,l=[],d=0,m=0,p=function(e){if(!(e in u))return"continue";var t=o[e],n=t.serviceId,i=t.signatureRequired,c=u[e].default.rates,s=null,p=null;i in u[e]&&(s=u[e][i].rates,p=Object(a.find)(s,function(e){return n===e.service_id})||null);var f=Object(a.find)(c,function(e){return n===e.service_id});if(f){var E=f.retail_rate-f.rate,_=f.rate,O={title:f.title,retailRate:f.retail_rate,rateWithDiscount:_,addons:[],carrierId:f.carrier_id,carrierTitle:f.title.split("-")[0].trim()};null!==p&&(O.addons=[{title:Object(r.translate)("Signature Required"),rate:p.rate-f.rate}],_=p.rate),l.push(O),d+=Object(a.round)(E,2),m+=_}};for(var f in o)p(f);return l.length?{prices:l,discount:d,total:m}:null},y=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(Object(a.isEmpty)(r))return!1;var i=Object(l.a)(r.origin);if("US"===i.country&&Object(a.includes)(d.d,i.state))return!0;var s=Object(l.a)(r.destination);return!("US"!==s.country||!Object(a.includes)(d.d,s.state))||i.country!==s.country},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[S(e,t,n)]}),j=function(e,t,n,i){var c=t.values,s=Object(l.a)(t),o=s.phone,u=s.postcode,p=s.state,f=s.country,E={};return["name","address","city","postcode","country"].forEach(function(e){c[e]||(E[e]=Object(r.translate)("This field is required"))}),Object(a.includes)(d.a,f)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(E.postcode=Object(r.translate)("Invalid ZIP/Postal code format")),!p&&Object(m.j)(e,f,n)&&(E.state=Object(r.translate)("This field is required")),i&&(o?10!==o.split(/\D+/g).join("").replace(/^1/,"").length&&(E.phone=Object(r.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):E.phone=Object(r.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),E},I=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.isNormalized,c=e.isUnverifiable,s=e.normalized,o=e.ignoreValidation,u=e.fieldErrors;if((i||c)&&!s&&u)return u;if(i&&!s)return{address:Object(r.translate)("This address is not recognized. Please try another.")};var l=j(t,e,n,a);return o&&Object.keys(l).forEach(function(e){o[e]&&delete l[e]}),l},R=function(e,t,n,i){var c=Object(a.uniq)(Object(a.flatten)(Object(a.map)(e,function(e){return Object(a.map)(e.items,"product_id")}))),s=Object(a.zipObject)(c,Object(a.fill)(Array(c.length),0));Object(a.forEach)(e,function(e){Object(a.forEach)(e.items,function(e){var n=e.quantity,a=e.product_id;return s[a]+=n*t.items[a].value})});var o={};return Object(a.forEach)(Object(a.pick)(t.items,c),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(o[e.tariffNumber]||(o[e.tariffNumber]=0),o[e.tariffNumber]+=s[t])}),{packages:Object(a.mapValues)(e,function(e){var c={};"other"!==e.contentsType||e.contentsExplanation||(c.contentsExplanation=Object(r.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(c.restrictionComments=Object(r.translate)("Please describe what kind of restrictions this package must have"));var s=new Set;return Object(a.forEach)(e.items,function(e){var n=e.product_id,a=t.items[n].tariffNumber;2500<o[a]&&s.add(a)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(c.itn=Object(r.translate)("Invalid format")):"CA"!==n&&(Object(a.isEmpty)(s)?Object(a.includes)(d.c,n)&&(c.itn=Object(r.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:i}})):c.itn=Object(r.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:s.values().next().value}})),c}),items:Object(a.mapValues)(Object(a.pick)(t.items,c),function(e,n){var i={};return e.description||(i.description=Object(r.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(a.isNil)(e.weight)||""===e.weight?i.weight=Object(r.translate)("This field is required"):parseFloat(e.weight)>0||(i.weight=Object(r.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(a.isNil)(e.value)||""===e.value?i.value=Object(r.translate)("This field is required"):parseFloat(e.value)>0||(i.value=Object(r.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(i.tariffNumber=Object(r.translate)("The tariff number must be 6 digits long")),i})}},P=function(e){var t=e.values,n=e.available,r=Object(a.map)(n,function(e,n){return t[n]});return!Object(a.isEmpty)(r)&&Object(a.every)(r)},k=function(e){var t=e.values,n=e.available;return Object(a.mapValues)(n,function(e,n){if(!Object(a.isEmpty)(e.default.errors)){var i=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return i.length?i:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(a.isEmpty)(e.default.rates)?[Object(r.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(r.translate)("Please choose a rate")]})},M=function(e){var t={};return e||(t.paperSize=Object(r.translate)("This field is required")),t},T=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!E(e,t,n))return{};var i=f(e,t,n),s=i.form,o=i.paperSize;if(Object(a.isEmpty)(s))return{};var u,l=s.destination.values.country,d=Object(m.g)(e,l,n),p=y(e,t,n);return{origin:I(s.origin,e,n,p),destination:I(s.destination,e,n),packages:(u=s.packages.selected,Object(a.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(r.translate)("Please select a package"));var n=function(e){return!Object(a.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(r.translate)("Invalid weight")),Object(a.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(r.translate)("Package dimensions must be greater than zero")),t})),customs:R(s.packages.selected,s.customs,l,d),rates:k(s.rates),sidebar:M(o)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[f(e,t,n)]}),A=Object(i.a)(function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e),r=f(e,t,a).form,i="origin"===n&&y(e,t,a),s=j(e,r[n],a,i);return 0===Object.keys(s).length},function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e);return[f(e,t,a).form[n]]}),L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(!r)return!1;var i=Object(a.uniq)(Object(a.flatten)(Object(a.map)(r.packages.selected,function(e){return Object(a.map)(e.items,"product_id")})));return!Object(a.some)(i.map(function(e){return Object(a.isNil)(r.customs.items[e].tariffNumber)||r.customs.ignoreWeightValidation[e]||r.customs.ignoreValueValidation[e]}))},w=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(!r)return null;var i=T(e,t,n);return r.origin.isNormalized&&Object(a.isEqual)(r.origin.values,r.origin.normalized)&&!Object(s.a)(i.origin)?r.destination.isNormalized&&Object(a.isEqual)(r.destination.values,r.destination.normalized)&&!Object(s.a)(i.destination)?Object(s.a)(i.packages)?"packages":!y(e,t,n)||!Object(s.a)(i.customs)&&L(e,t,n)?Object(s.a)(i.rates)?"rates":null:"customs":"destination":"origin"},x=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);return!Object(a.isEmpty)(r)&&!w(e,t,n)&&!r.origin.normalizationInProgress&&!r.destination.normalizationInProgress&&!r.rates.retrievalInProgress&&!Object(a.isEmpty)(r.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[S(e,t,n),w(e,t,n)]}),D=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?Object(a.pick)(n,d.a):Object(a.pick)(n,d.b)},[m.d,p.b]),W=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?n:Object(a.pick)(n,d.b)},[m.d,p.b]),U=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!Object(m.j)(e,t,n))return null;var r=Object(m.i)(e,t,n),i={};return r.forEach(function(e){var t=e.code,n=e.name;return i[t]=n}),"US"!==t||Object(p.b)(e,n)?i:Object(a.omit)(i,d.d)},[m.i,p.b]),V=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return E(e,t,n)&&Object(o.d)(e,n)&&Object(u.i)(e,n)&&Object(m.b)(e,n)}},541:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"d",function(){return r}),n.d(t,"e",function(){return i}),n.d(t,"f",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"j",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return E}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return O}),n.d(t,"q",function(){return b}),n.d(t,"p",function(){return h}),n.d(t,"r",function(){return g}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return C}),n.d(t,"u",function(){return S}),n.d(t,"v",function(){return N}),n.d(t,"w",function(){return y}),n.d(t,"B",function(){return j}),n.d(t,"x",function(){return I}),n.d(t,"C",function(){return R}),n.d(t,"z",function(){return P}),n.d(t,"A",function(){return k}),n.d(t,"D",function(){return M}),n.d(t,"E",function(){return T}),n.d(t,"F",function(){return A}),n.d(t,"G",function(){return L}),n.d(t,"H",function(){return w}),n.d(t,"I",function(){return x}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return W}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return G}),n.d(t,"y",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return K}),n.d(t,"U",function(){return Q}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return $}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return J}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return ae}),n.d(t,"cb",function(){return re}),n.d(t,"db",function(){return ie}),n.d(t,"eb",function(){return ce}),n.d(t,"fb",function(){return se}),n.d(t,"gb",function(){return oe}),n.d(t,"hb",function(){return ue}),n.d(t,"ib",function(){return le}),n.d(t,"jb",function(){return de}),n.d(t,"kb",function(){return me}),n.d(t,"lb",function(){return pe}),n.d(t,"nb",function(){return fe}),n.d(t,"mb",function(){return Ee}),n.d(t,"ob",function(){return _e}),n.d(t,"pb",function(){return Oe}),n.d(t,"qb",function(){return be}),n.d(t,"rb",function(){return he}),n.d(t,"sb",function(){return ge}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return Ce}),n.d(t,"vb",function(){return Se}),n.d(t,"wb",function(){return Ne}),n.d(t,"xb",function(){return ye}),n.d(t,"zb",function(){return je}),n.d(t,"Ab",function(){return Ie}),n.d(t,"Bb",function(){return Re}),n.d(t,"Cb",function(){return Pe}),n.d(t,"Db",function(){return ke}),n.d(t,"Eb",function(){return Me}),n.d(t,"Fb",function(){return Te}),n.d(t,"Gb",function(){return Ae}),n.d(t,"Hb",function(){return Le}),n.d(t,"Ib",function(){return we}),n.d(t,"Jb",function(){return xe}),n.d(t,"yb",function(){return De}),n.d(t,"Lb",function(){return We}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return Ve}),n.d(t,"Nb",function(){return Ge}),n.d(t,"Pb",function(){return He}),n.d(t,"Qb",function(){return Fe}),n.d(t,"Rb",function(){return Be});var a="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",r="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",i="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",c="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",s="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",o="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",p="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",f="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",E="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",_="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",O="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",h="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",N="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",y="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",j="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",I="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",H="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",He="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},542:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return r});var a="LOADING",r="ERROR"},544:function(e,t,n){"use strict";n.d(t,"e",function(){return f}),n.d(t,"b",function(){return _}),n.d(t,"d",function(){return O}),n.d(t,"a",function(){return b}),n.d(t,"c",function(){return h}),n.d(t,"f",function(){return g}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return C}),n.d(t,"g",function(){return S});var a=n(110),r=n.n(a),i=n(36),c=n.n(i),s=n(1),o=n(34),u=n(546),l=n(535),d=n(578),m=n(573),p=n(540),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(s.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},E=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},_=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var a=[];Object(s.forEach)(n.predefinedSchema,function(e,t){var r=(n.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e){var n=e.definitions;Object(s.forEach)(n,function(e){Object(s.includes)(r,e.id)&&a.push(c()({},e,{serviceId:t}))})})});var r=(n.packages.custom||[]).map(function(e,t){return c()({},e,{index:t})});return Object(s.orderBy)(a.concat(r),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var a=E(n);return[].concat(r()(n.packages.custom||[]),r()(a.map(function(e){return(n.packages.predefined||{})[e]})))}),O=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),a=f(e,n);if(!a||!a.predefinedSchema||!a.packages)return null;var r=Object(p.e)(e,t,n),i=Object(m.a)(r.origin).country,c=Object(m.a)(r.destination).country,u=d.a.includes(i)&&!d.a.includes(c),E={custom:{title:Object(o.translate)("Custom Packages"),definitions:a.packages.custom}};return Object(s.forEach)(a.predefinedSchema,function(e,t){var n=(a.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e,t){var a=e.definitions,r={title:e.title,definitions:[]};Object(s.forEach)(a,function(e){u&&!1===e.can_ship_international||Object(s.includes)(n,e.id)&&r.definitions.push(e)}),r.definitions.length&&(E[t]=r)})}),E},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),a=f(e,n);if(!a||!a.packages)return[];var i=E(a),c=Object(p.e)(e,t,n),s=Object(m.a)(c.origin).country,o=Object(m.a)(c.destination).country;return[].concat(r()(a.packages.custom||[]),r()(i.map(function(e){return(a.packages.predefined||{})[e]})),[s,o])}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var a={};return Object(s.forEach)(n.packages.custom,function(e){a[e.name]=e}),Object(s.forEach)(n.predefinedSchema,function(e){Object(s.forEach)(e,function(e){var t=e.definitions;Object(s.forEach)(t,function(e){a[e.id]=e})})}),a},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var a=E(n);return[].concat(r()(n.packages.custom||[]),r()(a.map(function(e){return(n.packages.predefined||{})[e]})))}),h=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var a={},r=n.predefinedSchema,i=n.currentlyEditingPredefinedPackages;return Object(s.forEach)(r,function(e,t){var n=i[t]||[];Object(s.forEach)(e,function(e,r){var i={groupId:r,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(s.forEach)(e.definitions,function(e){var a=Object(s.includes)(n,e.id);a&&i.selected++,i.packages.push(c()({},e,{selected:a,serviceId:t}))}),a["".concat(t,"-").concat(r)]=i})}),a},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var a=E(n);return r()(a.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,a=0,r=f(e,t);if(!r||!r.currentlyEditingPredefinedPackages)return{added:n,removed:a};var i=r.packages&&r.packages.predefined?r.packages.predefined:{},c=r.currentlyEditingPredefinedPackages;return Object.keys(c).forEach(function(e){var t=i[e],a=c[e];t?a.forEach(function(e){Object(s.includes)(t,e)||n++}):n+=a.length}),Object.keys(i).forEach(function(e){var t=i[e],n=c[e];n?t.forEach(function(e){Object(s.includes)(n,e)||a++}):a+=t.length}),{added:n,removed:a}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var a=E(n);return[].concat(r()(a.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),r()(a.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isLoaded},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetching},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetchError}},545:function(e,t,n){"use strict";n.d(t,"e",function(){return a}),n.d(t,"c",function(){return C}),n.d(t,"d",function(){return S}),n.d(t,"b",function(){return N}),n.d(t,"a",function(){return y});var a={};n.r(a),n.d(a,"accountSettings",function(){return i}),n.d(a,"packages",function(){return c}),n.d(a,"orderLabels",function(){return s}),n.d(a,"getLabelRates",function(){return o}),n.d(a,"labelsStatus",function(){return u}),n.d(a,"labelRefund",function(){return l}),n.d(a,"labelsPrint",function(){return d}),n.d(a,"labelTestPrint",function(){return m}),n.d(a,"addressNormalization",function(){return p}),n.d(a,"serviceSettings",function(){return f}),n.d(a,"shippingCarrier",function(){return E}),n.d(a,"shippingCarriers",function(){return _}),n.d(a,"subscriptions",function(){return O}),n.d(a,"subscriptionActivate",function(){return b}),n.d(a,"shippingCarrierDelete",function(){return h}),n.d(a,"shippingCarrierTypes",function(){return g});var r=n(572),i="connect/account/settings",c="connect/packages",s=function(e){return"connect/label/".concat(e)},o=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t.join())},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},m=function(){return"connect/label/preview"},p=function(){return"connect/normalize-address"},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},E=function(){return"connect/shipping/carrier"},_=function(){return"connect/shipping/carriers"},O=function(){return"connect/subscriptions"},b=function(e){return"connect/subscription/".concat(e,"/activate")},h=function(e){return"connect/shipping/carrier/".concat(e)},g=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},C=function(e,t,n){return Object(r.a)(e).post(t,n,"wc/v1").catch(v)},S=function(e,t,n){return Object(r.a)(e).put(t,n,"wc/v1").catch(v)},N=function(e,t){return Object(r.a)(e).get(t,"wc/v1").catch(v)},y=function(e,t){return Object(r.a)(e).del(t,"wc/v1").catch(v)}},546:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var a=n(1),r=n(625),i=n.n(r),c=(n(113),function(e){return e}),s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return n.join()},o=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return e.map(function(e){return e.apply(void 0,[t].concat(a))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,u=Object(a.memoize)(e,r);return Array.isArray(n)&&(n=o(n)),Object.assign(function(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),c=1;c<a;c++)r[c-1]=arguments[c];var s=n.apply(void 0,[e].concat(r));return Array.isArray(s)||(s=[s]),t&&!i()(s,t)&&u.cache.clear(),t=s,u.apply(void 0,[e].concat(r))},{memoizedSelector:u})}},548:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("fieldset",r()({},a,{className:l()(t,"form-fieldset")}),n)}},549:function(e,t,n){"use strict";n.d(t,"f",function(){return c}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return o}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return p}),n.d(t,"n",function(){return f}),n.d(t,"o",function(){return E}),n.d(t,"e",function(){return _}),n.d(t,"q",function(){return O}),n.d(t,"p",function(){return b}),n.d(t,"k",function(){return h}),n.d(t,"l",function(){return g}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return C});var a=n(1),r=n(535),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.data},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.meta},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isFetching},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isFetchError},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.enabled},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.selected_payment_method_id},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.pristine},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.email_receipts},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.can_manage_payments},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.can_edit_settings},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.paper_size},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.warnings&&n.warnings.payment_methods},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return m});var a=n(536),r=n.n(a),i=n(1),c={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},s=(n(46),c.uniqueId);function o(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.id,i=r()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:a||s(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),m=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},551:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(10),o=n.n(s),u=n(12),l=n.n(u),d=n(528),m=n.n(d),p=n(34),f=function(e){var t=e.children,n=e.required,a=e.optional,i=e.translate,s=e.className,u=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),l=c()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),d=u?null:o.a.createElement(o.a.Fragment,null,t,n&&o.a.createElement("small",{className:"form-label__required"},i("Required")),a&&o.a.createElement("small",{className:"form-label__optional"},i("Optional")));return o.a.createElement("label",r()({},l,{dangerouslySetInnerHTML:u,className:m()(s,"form-label")}),d)};f.propTypes={required:l.a.bool,optional:l.a.bool,children:l.a.node},t.a=Object(p.localize)(f)},552:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(528),o=n.n(s),u=n(537),l=n.n(u),d=function(e){var t=e.text,n=e.type,a=void 0===n?"input-validation":n;return r.a.createElement("div",{className:o()("field-error","field-error__".concat(a))},r.a.createElement(l.a,{size:24,icon:"notice-outline"})," ",r.a.createElement("span",null,t))};d.propTypes={text:c.a.string.isRequired,type:c.a.string},t.a=d},554:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("legend",r()({},a,{className:l()(t,"form-legend")}),n)}},555:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("h3",r()({},a,{className:l()(t,"form-section-heading")}),n)}},556:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(12),b=n.n(O),h=n(10),g=n.n(h),v=n(528),C=n.n(v),S=n(1),N=n(34),y=n(537),j=n.n(y);n(568);function I(e){var t=e.children;return g.a.createElement("span",{className:"screen-reader-text"},t)}var R=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"dismissTimeout",null),n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.icon,r=e.isCompact,i=e.isLoading,c=e.onDismissClick,s=e.showDismiss,o=void 0===s?!r:s,u=e.status,l=e.text,d=e.translate,m=C()("notice",u,n,{"is-compact":r,"is-loading":i,"is-dismissable":o});return g.a.createElement("div",{className:m},g.a.createElement("span",{className:"notice__icon-wrapper"},g.a.createElement(j.a,{className:"notice__icon",icon:a||this.getIcon(),size:24})),g.a.createElement("span",{className:"notice__content"},g.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,o&&g.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:c},g.a.createElement(j.a,{icon:"cross",size:24}),g.a.createElement(I,null,d("Dismiss"))))}}]),t}(h.Component);_()(R,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:S.noop,status:null,text:null}),_()(R,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired});t.a=Object(N.localize)(R)},557:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var a=n(533),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(10),b=n.n(O),h=n(12),g=n.n(h),v=n(528),C=n.n(v),S=n(1),N=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"render",value:function(){var e=C()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",r()({},Object(S.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);_()(N,"displayName","FormSettingExplanation"),_()(N,"propTypes",{noValidate:g.a.bool,isIndented:g.a.bool,className:g.a.string}),_()(N,"defaultProps",{noValidate:!1,isIndented:!1})},559:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(1),r=function e(t){return!!t&&(Object(a.isArray)(t)?Object(a.some)(t,e):!Object(a.isPlainObject)(t)||Object(a.some)(Object(a.values)(t),e))}},562:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return c}),n.d(t,"removePackage",function(){return s}),n.d(t,"editPackage",function(){return o}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return m}),n.d(t,"toggleAll",function(){return p}),n.d(t,"togglePackage",function(){return f}),n.d(t,"savePredefinedPackages",function(){return E}),n.d(t,"removePredefinedPackage",function(){return _}),n.d(t,"setModalErrors",function(){return O}),n.d(t,"setIsSaving",function(){return b}),n.d(t,"setIsFetching",function(){return h}),n.d(t,"setIsFetchError",function(){return g}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return C}),n.d(t,"submit",function(){return S});var a=n(545),r=n(541),i=n(544),c=function(e){return{type:r.g,siteId:e}},s=function(e,t){return{type:r.k,index:t,siteId:e}},o=function(e,t){return{type:r.i,package:t,siteId:e}},u=function(e){return{type:r.h,siteId:e}},l=function(e,t){return{type:r.m,packageData:t,siteId:e}},d=function(e,t){return{type:r.w,values:t,siteId:e}},m=function(e){return{type:r.u,siteId:e}},p=function(e,t,n,a){return{type:r.t,serviceId:t,groupId:n,checked:a,siteId:e}},f=function(e,t,n){return{type:r.v,serviceId:t,packageId:n,siteId:e}},E=function(e){return{type:r.n,siteId:e}},_=function(e,t,n){return{type:r.l,serviceId:t,packageId:n,siteId:e}},O=function(e,t){return{type:r.s,value:t,siteId:e}},b=function(e,t){return{type:r.r,isSaving:t,siteId:e}},h=function(e,t){return{type:r.p,isFetching:t,siteId:e}},g=function(e,t){return{type:r.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:r.o,siteId:e,mode:t}},C=function(e){return function(t,n){var c=Object(i.e)(n(),e);c&&(c.packages||c.isFetching)||(t(h(e,!0)),a.b(e,a.e.packages).then(function(n){var a=n.formData,i=n.formSchema,c=n.storeOptions;t({type:r.j,packages:a,dimensionUnit:c.dimension_unit,weightUnit:c.weight_unit,packageSchema:i.custom.items,predefinedSchema:i.predefined,siteId:e})}).catch(function(n){console.error(n),t(g(e,!0))}).then(function(){return t(h(e,!1))}))}},S=function(e,t,n){return function(r,c){var s=Object(i.e)(c(),e);r(b(e,!0)),a.d(e,a.e.packages,s.packages).then(t).catch(n).then(function(){return r(b(e,!1))})}}},563:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(538);function r(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:a.j,siteId:e,originalAction:t,data:n,time:r}}},564:function(e,t,n){"use strict";var a=n(47),r=n.n(a),i=n(1),c=n(114),s=r()("calypso:notices");s("initializing notices");var o,u={containerNames:{}};o=u,Object(i.assign)(o,c.EventEmitter.prototype),o.emitChange=function(){this.emit("change")},o.off=o.removeListener;var l=[],d={new:function(e,t,n){var a=t.overlay?"overlay-notices":"notices";u.containerNames[a]=a,s("creating notice",e,t,n),u[a]=[];var r={type:t.type||"message",status:n,text:e,duration:t.duration,container:a,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=d.removeNotice.bind(d,r);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(r):u[a].push(r),u.emit("change"),r},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){s("clearNoticesOnNavigation");var n=!1,a=function(e){return e.persistent};for(var r in u.containerNames){var i=u[r].length;u[r]=u[r].filter(a),i!==u[r].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=d},565:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"c",function(){return i});var a=function(){return{}},r=function(){return""},i=function(){return!0}},568:function(e,t,n){},569:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);n(601);t.a=function(e){var t=e.inputRef,n=e.className,a=e.isError,i=c()(e,["inputRef","className","isError"]);return o.a.createElement("select",r()({},i,{ref:t,className:l()(n,"form-select",{"is-error":a})}))}},570:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(12),g=n.n(h),v=n(10),C=n.n(v),S=n(1),N=n(615),y=n(117),j=n.n(y),I=n(528),R=n.n(I),P=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"_onButtonClick",function(e){e.onClick?e.onClick(n._close.bind(f()(n),e.action)):n._close(e.action)}),b()(f()(n),"_close",function(e){n.props.onDialogClose&&n.props.onDialogClose(e)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.additionalClassNames,n=e.isBackdropVisible,a=e.baseClassName,r=e.isFullScreen,i=e.shouldCloseOnEsc,c=a+"__content",s=R()(a,"card",t),o=R()(a+"__backdrop",{"is-full-screen":!!r,"is-hidden":!n});return C.a.createElement(j.a,{isOpen:this.props.isVisible,onRequestClose:this._close,closeTimeoutMS:this.props.leaveTimeout,contentLabel:this.props.label,appElement:document.getElementById("wpcom"),overlayClassName:o,className:s,htmlOpenClassName:"ReactModal__Html--open",role:"dialog",shouldCloseOnEsc:i},C.a.createElement("div",{className:R()(this.props.className,c),tabIndex:"-1"},this.props.children),this._renderButtonsBar())}},{key:"_renderButtonsBar",value:function(){var e=this.props.baseClassName+"__action-buttons";return this.props.buttons?C.a.createElement("div",{className:e},this.props.buttons.map(this._renderButton,this)):null}},{key:"_renderButton",value:function(e,t){if(C.a.isValidElement(e))return C.a.cloneElement(e,{key:"dialog-button-"+t});var n=this._getButtonClasses(e),a=this._onButtonClick.bind(this,e);return C.a.createElement("button",{key:e.action,className:n,"data-e2e-button":e.action,"data-tip-target":"dialog-base-action-".concat(e.action),onClick:a,disabled:!!e.disabled},C.a.createElement("span",{className:this.props.baseClassName+"__button-label"},e.label))}},{key:"_getButtonClasses",value:function(e){var t=e.className||"button";return(e.isPrimary||1===this.props.buttons.length)&&(t+=" is-primary"),e.additionalClassNames&&(t+=" "+e.additionalClassNames),t}}]),t}(v.Component);b()(P,"propTypes",{additionalClassNames:g.a.oneOfType([g.a.object,g.a.string]),autoFocus:g.a.bool,baseClassName:g.a.string,buttons:g.a.array,className:g.a.string,isBackdropVisible:g.a.bool,isFullScreen:g.a.bool,isVisible:g.a.bool,label:g.a.string,leaveTimeout:g.a.number,onDialogClose:g.a.func,shouldCloseOnEsc:g.a.bool}),b()(P,"defaultProps",{baseClassName:"dialog",isBackdropVisible:!0,isFullScreen:!0,autoFocus:!0,label:""});var k=P,M=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"checkOnClosed",function(e){null===e&&Object(S.defer)(n.props.onClosed)}),b()(f()(n),"onDialogClose",function(e){n.props.onClose&&n.props.onClose(e)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){return C.a.createElement(N.a,null,C.a.createElement(k,r()({},this.props,{ref:this.checkOnClosed,key:"dialog",onDialogClose:this.onDialogClose})))}}]),t}(v.Component);b()(M,"propTypes",{isVisible:g.a.bool,baseClassName:g.a.string,leaveTimeout:g.a.number,onClose:g.a.func,onClosed:g.a.func,shouldCloseOnEsc:g.a.bool}),b()(M,"defaultProps",{isVisible:!1,leaveTimeout:200,onClosed:S.noop});t.a=M},572:function(e,t,n){"use strict";var a=n(76);t.a=a.a},573:function(e,t,n){"use strict";var a=n(1);t.a=function(e){return Object(a.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},574:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return m}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return E}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return O}),n.d(t,"j",function(){return b}),n.d(t,"d",function(){return h});var a=n(1),r=n(546),i=n(535),c=n(542),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(a.isArray)(s(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.b===s(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.a===s(e,t)},d=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];var i=a[e],c=o(t,i);return[c,c&&s(t,i)]}},m=Object(r.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=s(e,t).map(function(e){return Object(a.omit)(e,"countries")});return Object(a.sortBy)(n,"name")},d(0)),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=Object(a.flatMap)(s(e,t),"countries");return Object(a.sortBy)(n,"name")},f=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var r=Object(a.find)(s(e,n),{code:t});if(!r)return[];var c=r.countries.map(function(e){return Object(a.omit)(e,"states")});return Object(a.sortBy)(c,"name")},d(1)),E=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return t;var r=Object(a.find)(Object(a.flatMap)(s(e,n),"countries"),{code:t});return r?r.name:t},d(1)),_=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var r=Object(a.find)(Object(a.flatMap)(s(e,n),"countries"),{code:t});return r?Object(a.sortBy)(r.states,"name"):[]},d(1)),O=Object(r.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(i.a)(e);if(!o(e,r))return n;var c=Object(a.find)(Object(a.flatMap)(s(e,r),"countries"),{code:t});if(!c)return n;var u=Object(a.find)(c.states,{code:n});return u?u.name:n},d(2)),b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!Object(a.isEmpty)(_(e,t,n))},h=Object(r.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=p(e,t),a={};return n.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),a},d(0))},575:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r});var a=function(){return!0},r=function(){return!0}},576:function(e,t,n){"use strict";n.d(t,"d",function(){return c}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var a=n(545),r=n(541),i=n(549),c=function(e,t,n){return{type:r.e,siteId:e,key:t,value:n}},s=function(e,t,n){return{type:r.f,siteId:e,key:t,value:n}},o=function(e){return function(t){t(s(e,"isFetching",!0)),a.b(e,a.e.accountSettings).then(function(n){var a=n.storeOptions,i=n.formMeta,c=n.formData,s=n.userMeta;t(function(e,t,n,a,i){return{type:r.b,siteId:e,storeOptions:t,formData:n,formMeta:a,userMeta:i}}(e,a,c,i,s))}).catch(function(n){t(s(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(s(e,"isFetching",!1))})}},u=function(e,t,n){return function(r,c){r(s(e,"isSaving",!0)),r(s(e,"pristine",!0)),a.c(e,a.e.accountSettings,Object(i.f)(c())).then(t).catch(function(t){return r(s(e,"pristine",!1)),n(t)}).then(function(){r(s(e,"isSaving",!1))})}},l=function(e){return{type:r.d,siteId:e}},d=function(e){return{type:r.c,siteId:e}}},577:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return u});var a=n(1),r=n(535),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return Object(a.isObject)(c(e,n)[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return s(e,t,n)?c(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return i.b===c(e,n)[t]}},578:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"c",function(){return c});var a=["US","PR","VI","GU","AS","UM","MH","FM","MP"],r=["US","PR","VI"],i=["AA","AE","AP"],c=["IR","SY","KP","CU","SD"]},579:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var a=n(1),r=n(535),i=n(586),c=n(542),s=n(575),o=n(587),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e));return Object(a.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),c=Object(i.b)(e,n);if(!Object(a.isArray)(c))return!1;var l=Object(a.find)(c,{id:t});if(!l||!Object(a.isArray)(l.methodIds))return!1;if(!Object(s.a)(e,n))return!0;var d=l.methodIds.map(function(t){var r=u(e,t,n);return r&&Object(a.startsWith)(r.methodType,"wc_services")?r:null}).filter(Boolean);return Object(a.every)(d,function(t){var a=t.id;return Object(o.a)(e,a,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),l=Object(i.b)(e,n);if(!Object(a.isArray)(l))return!1;var d=Object(a.find)(l,{id:t});if(!d)return!1;if(c.b===d.methodIds)return!0;if(!Object(s.a)(e,n)||!Object(a.isArray)(d.methodIds))return!1;var m=d.methodIds.map(function(t){var r=u(e,t,n);return r&&Object(a.startsWith)(r.methodType,"wc_services")?r:null}).filter(Boolean);return Object(a.some)(m,function(t){var a=t.id;return Object(o.b)(e,a,n)})}},580:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(528),o=n.n(s),u=n(697),l=n(548),d=n(552),m=n(557),p=function(e){var t=e.id,n=e.title,i=e.description,c=e.value,s=e.placeholder,p=e.updateValue,f=e.error,E=e.className,_=e.defaultValue,O=Object(a.useCallback)(function(e){return p(e,t)},[p]),b=o()("form-text-input",{"is-error":Boolean(f)});return r.a.createElement(l.a,{className:E},r.a.createElement(u.a,{label:n,name:t,placeholder:s,value:c,onChange:O,className:b,defaultValue:_}),f&&"string"===typeof f&&r.a.createElement(d.a,{text:f}),!f&&i&&r.a.createElement(m.a,null,i))};p.propTypes={id:c.a.string.isRequired,title:c.a.node,description:c.a.string,value:c.a.string,defaultValue:c.a.string,updateValue:c.a.func,error:c.a.oneOfType([c.a.string,c.a.bool]),className:c.a.string},t.a=p},582:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(10),g=n.n(h),v=n(12),C=n.n(v),S=n(528),N=n.n(S),y=function(e){function t(){return o()(this,t),m()(this,f()(t).apply(this,arguments))}return _()(t,e),l()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,c()(t,["compact","primary","scary","busy","borderless","type"])),a=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return g.a.createElement("a",r()({},n,{rel:a,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,c()(i,["compact","primary","scary","busy","borderless","target","rel"]));return g.a.createElement("button",r()({},s,{className:e}))}}]),t}(h.PureComponent);b()(y,"propTypes",{compact:C.a.bool,primary:C.a.bool,scary:C.a.bool,busy:C.a.bool,type:C.a.string,href:C.a.string,borderless:C.a.bool,target:C.a.string,rel:C.a.string}),b()(y,"defaultProps",{type:"button"})},583:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(534),_=n.n(E),O=n(531),b=n.n(O),h=n(35),g=n.n(h),v=n(528),C=n.n(v),S=n(34),N=n(1),y=n(10),j=n.n(y),I=n(582),R=function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=m()(this,(e=f()(t)).call.apply(e,[this].concat(r))),g()(_()(n),"getDefaultButtonAction",function(){return n.props.isSubmitting?n.props.translate("Saving\u2026"):n.props.translate("Save Settings")}),n}return b()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.isPrimary,i=c()(e,["children","className","isPrimary"]),s=C()(n,"form-button");return j.a.createElement(I.a,r()({},Object(N.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:a,className:s}),y.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(j.a.Component);g()(R,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(S.localize)(R)},586:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o});var a=n(1),r=n(535),i=(n(542),n(579)),c=n(612),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return Object(a.isArray)(n)&&Object(a.every)(n,function(n){return Object(i.a)(e,n.id,t)})&&Object(a.every)(n,function(n){return Object(c.a)(e,n.id,t)})}},587:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var a=n(1),r=n(535),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return!0===c(e,n)[t]},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return i.b===c(e,n)[t]}},588:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(35),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n.n(O),h=n(537),g=n.n(h),v=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(g.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(g.a,{icon:"external",size:24}))}}]),t}(b.a.Component);f()(v,"displayName","NoticeAction"),f()(v,"propTypes",{href:_.a.string,onClick:_.a.func,external:_.a.bool,icon:_.a.string}),f()(v,"defaultProps",{external:!1})},592:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),c=n(36),s=n.n(c),o=n(1),u=n(46),l=Object(u.b)({},(a={},i()(a,"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,n))}),i()(a,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(o.omit)(e,n):e}),i()(a,"ROUTE_SET",function(e){return Object(o.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var a=t;return a.displayOnNextPage&&(a=s()({},a,{displayOnNextPage:!1})),e[n]=a,e},{})}),a)),d=Object(u.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return c}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return o});var a=n(538);function r(e){return{type:a.d,actionList:e}}function i(){return{type:a.b}}function c(e){return{type:a.a,actionList:e}}function s(e){return{type:a.e,actionList:e}}function o(e,t){return{type:a.c,actionList:e,error:t}}},594:function(e,t,n){},600:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(528),l=n.n(u),d=n(537),m=n.n(d),p=n(1),f=function(e){var t=e.className,n=e.disabled,a=e.checked,i=e.partialChecked,s=Object(p.omit)(e,["className","partialChecked"]);return c.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},c.a.createElement("input",r()({},s,{type:"checkbox"})),a&&c.a.createElement(m.a,{icon:"checkmark",size:14}),!a&&i&&c.a.createElement(m.a,{icon:"minus-small",size:16}))};f.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=f},601:function(e,t,n){},602:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(12),b=n.n(O),h=n(10),g=n.n(h),v=n(528),C=n.n(v),S=n(34),N=n(1),y=n(619),j=n(834),I=n(537),R=n.n(I),P=(n(635),function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"state",{expanded:n.props.expanded}),_()(m()(n),"onClick",function(){n.props.children&&n.setState({expanded:!n.state.expanded}),n.props.onClick&&n.props.onClick(),n.state.expanded?n.props.onClose(n.props.cardKey):n.props.onOpen(n.props.cardKey)}),n}return f()(t,e),c()(t,[{key:"componentWillReceiveProps",value:function(e){e.expanded!==this.props.expanded&&this.setState({expanded:e.expanded})}},{key:"getClickAction",value:function(){if(!this.props.disabled)return this.onClick}},{key:"getActionButton",value:function(){return this.state.expanded&&this.props.actionButtonExpanded||this.props.actionButton}},{key:"renderActionButton",value:function(){var e=this.props.clickableHeader?null:this.getClickAction();if(this.props.actionButton)return g.a.createElement("div",{className:"foldable-card__action",role:"presentation",onClick:e},this.getActionButton());if(this.props.children){var t=this.props.screenReaderText||this.props.translate("More");return g.a.createElement("button",{disabled:this.props.disabled,type:"button",className:"foldable-card__action foldable-card__expand",onClick:e},g.a.createElement(y.a,null,t),g.a.createElement(R.a,{icon:this.props.icon,size:24}))}}},{key:"renderContent",value:function(){return g.a.createElement("div",{className:"foldable-card__content"},this.props.children)}},{key:"renderHeader",value:function(){var e=this.props.summary?g.a.createElement("span",{className:"foldable-card__summary"},this.props.summary," "):null,t=this.props.expandedSummary?g.a.createElement("span",{className:"foldable-card__summary-expanded"},this.props.expandedSummary," "):null,n=this.props.clickableHeader?this.getClickAction():null,a=C()("foldable-card__header",{"is-clickable":!!this.props.clickableHeader,"has-border":!!this.props.summary});return g.a.createElement("div",{className:a,role:"presentation",onClick:n},g.a.createElement("span",{className:"foldable-card__main"},this.props.header," "),g.a.createElement("span",{className:"foldable-card__secondary"},e,t,this.renderActionButton()))}},{key:"render",value:function(){var e=C()("foldable-card","card",this.props.className,{"is-disabled":!!this.props.disabled,"is-expanded":!!this.state.expanded,"has-expanded-summary":!!this.props.expandedSummary,"is-compact":!!this.props.compact});return g.a.createElement(j.a,{className:e},this.renderHeader(),this.state.expanded&&this.renderContent())}}]),t}(h.Component));_()(P,"displayName","FoldableCard"),_()(P,"propTypes",{actionButton:b.a.element,actionButtonExpanded:b.a.element,cardKey:b.a.string,compact:b.a.bool,disabled:b.a.bool,expandedSummary:b.a.oneOfType([b.a.string,b.a.element]),expanded:b.a.bool,icon:b.a.string,onClick:b.a.func,onClose:b.a.func,onOpen:b.a.func,screenReaderText:b.a.oneOfType([b.a.string,b.a.bool]),summary:b.a.oneOfType([b.a.string,b.a.element])}),_()(P,"defaultProps",{onOpen:N.noop,onClose:N.noop,cardKey:"",icon:"chevron-down",expanded:!1,screenReaderText:!1}),t.a=Object(S.localize)(P)},603:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(531),_=n.n(E),O=n(10),b=n.n(O),h=n(12),g=n.n(h),v=n(591),C=n(528),S=n.n(C),N=function(e){function t(e){var n;return o()(this,t),(n=m()(this,f()(t).call(this,e))).state={isFocused:!1},n}return _()(t,e),l()(t,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"===typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.label,a=t.value,i=t.help,s=t.className,o=t.instanceId,u=t.onChange,l=t.onClick,d=t.prefix,m=t.suffix,p=t.type,f=t.disabled,E=c()(t,["label","value","help","className","instanceId","onChange","onClick","prefix","suffix","type","disabled"]),_=this.state.isFocused,O="inspector-text-control-with-affixes-".concat(o),h=[];i&&h.push("".concat(O,"__help")),d&&h.push("".concat(O,"__prefix")),m&&h.push("".concat(O,"__suffix"));var g=S()(s,{"with-value":""!==a,empty:""===a,active:_&&!f}),C=S()("text-control-with-affixes",{"text-control-with-prefix":d,"text-control-with-suffix":m,disabled:f});return b.a.createElement(v.a,{label:n,id:O,help:i,className:g,onClick:function(t){return e.handleOnClick(t,l)}},b.a.createElement("div",{className:C},d&&b.a.createElement("span",{id:"".concat(O,"__prefix"),className:"text-control-with-affixes__prefix"},d),b.a.createElement("input",r()({className:"components-text-control__input",type:p,id:O,value:a,onChange:function(e){return u(e.target.value)},"aria-describedby":h.join(" "),disabled:f,onFocus:function(){return e.setState({isFocused:!0})}},E)),m&&b.a.createElement("span",{id:"".concat(O,"__suffix"),className:"text-control-with-affixes__suffix"},m)))}}]),t}(O.Component);N.defaultProps={type:"text"},N.propTypes={label:g.a.string,help:g.a.string,type:g.a.string,value:g.a.oneOfType([g.a.string,g.a.number]).isRequired,className:g.a.string,onChange:g.a.func.isRequired,prefix:g.a.node,suffix:g.a.node,disabled:g.a.bool},t.a=N},604:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(548),o=n(569),u=n(554),l=n(552),d=n(557),m=function(e){var t=e.id,n=e.valuesMap,i=e.title,c=e.description,m=e.value,p=e.updateValue,f=e.error,E=e.disabled,_=e.className,O=Object(a.useCallback)(function(e){return p(e.target.value,e)},[p]);return r.a.createElement(s.a,{className:_},r.a.createElement(u.a,null,i),r.a.createElement(o.a,{id:t,name:t,value:m,onChange:O,disabled:Boolean(E),isError:Boolean(f)},Object.keys(n).map(function(e){return r.a.createElement("option",{key:e,value:e},n[e])})),f&&"string"===typeof f&&r.a.createElement(l.a,{text:f}),!f&&c&&r.a.createElement(d.a,null,c))};m.propTypes={id:c.a.string.isRequired,valuesMap:c.a.object.isRequired,title:c.a.node,description:c.a.string,value:c.a.string.isRequired,updateValue:c.a.func.isRequired,error:c.a.oneOfType([c.a.string,c.a.bool]),disabled:c.a.bool,className:c.a.string},t.a=m},605:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),c=n.n(i),s=n(165),o=n.n(s),u=n(12),l=n.n(u),d=n(10),m=n.n(d),p=n(556),f=n(588),E=n(528),_=n.n(E);n(594);function O(e){var t=e.id,n=e.className,a=e.children;return m.a.createElement("div",{id:t,className:_()("global-notices",n)},a)}var b=n(564),h=n(47),g=n.n(h)()("calypso:data-observe"),v=n(109),C=n(1),S=n(546),N=Object(S.a)(function(e){return Object(C.values)(e.notices.items)},function(e){return e.notices.items}),y=(Object(S.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(550)),j=o()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):g(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){g("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&b.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(a){t&&t(a),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return m.a.createElement(p.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&m.a.createElement(f.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,a=e.noticeId,i=e.onClick,s=e.onDismissClick,o=c()(e,["button","href","noticeId","onClick","onDismissClick"]);return m.a.createElement(p.a,r()({},o,{key:"notice-".concat(a),onDismissClick:this.removeReduxNotice(a,s)}),t&&m.a.createElement(f.a,{href:n,onClick:i},t))},this))).length?m.a.createElement(O,{id:this.props.id},e):null}});t.a=Object(v.b)(function(e){return{storeNotices:N(e)}},{removeNotice:y.c})(j)},611:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var a=n(1),r=function(e,t){return Object(a.isArray)(e)?e.concat(t):void 0},i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?a.mergeWith.apply(void 0,[Object.create(null)].concat(t,[r])):t[0]}},612:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var a=n(1),r=n(535),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),i=c(e,n);return i&&Object(a.isObject)(i[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return c(e,n)&&i.b===c(e,n)[t]}},613:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var a=n(545),r=n(563),i=n(541),c=n(587),s=function(e,t,n){return function(s,o){if(!Object(c.a)(o(),n,e)&&!Object(c.b)(o(),n,e)){var u={type:i.Pb,instanceId:n,siteId:e};return s(u),a.b(e,a.e.serviceSettings(t,n)).then(function(t){return s(function(e,t,n){return{type:i.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return s(Object(r.a)(e,u,t))})}}}},614:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,a){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,a)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var r={};return Object.keys(n).forEach(function(i){var c=(t.properties||{})[i];r[i]=e(c,n[i],a)}),r;case"array":return n.map(function(n){return e(t.items,n,a)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},615:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(78),b=n.n(O),h=n(12),g=n.n(h),v=n(10),C=n.n(v),S=n(109),N=n(616),y=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"renderChildren",function(){var e;e=n.props&&(Object.keys(n.props).length>1||!n.props.children)?C.a.createElement("div",n.props,n.props.children):n.props.children,n.context.store&&(e=C.a.createElement(S.a,{store:n.context.store},C.a.createElement(N.b,null,e))),b.a.render(e,n.container)}),n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.renderChildren()}},{key:"componentDidUpdate",value:function(){this.renderChildren()}},{key:"componentWillUnmount",value:function(){this.container&&(b.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container),delete this.container)}},{key:"render",value:function(){return null}}]),t}(C.a.Component);_()(y,"contextTypes",{store:g.a.object})},616:function(e,t,n){"use strict";n.d(t,"b",function(){return T}),n.d(t,"a",function(){return k});var a=n(111),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(10),g=n.n(h),v=n(109),C=n(164),S=n.n(C),N=n(47),y=n.n(N),j=n(1),I=n(546),R=Object(I.a)(function(e){return Object(j.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),P=y()("calypso:localized-moment"),k=g.a.createContext(S.a),M=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"state",{moment:S.a,momentLocale:S.a.locale()}),n}return _()(t,e),o()(t,[{key:"checkAndLoad",value:function(){var e=r()(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((a=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==a){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return P("Loading moment locale for %s",a),e.prev=8,this.loadingLocalePromise=n(626)("./".concat(a)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),P("Failed to load moment locale for %s",a,e.t0),e.abrupt("return");case 18:P("Loaded moment locale for %s",a);case 19:a===this.props.currentLocale&&(S.a.locale()!==a&&S.a.locale(a),this.setState({momentLocale:a}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(S.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return g.a.createElement(k.Provider,{value:this.state},this.props.children)}}]),t}(g.a.Component),T=Object(v.b)(function(e){return{currentLocale:R(e)}})(M)},618:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});n(1);var a=n(663),r=n.n(a),i=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function c(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){i.innerHTML=e;var t=i.textContent;return i.innerHTML="",t}(e)}function s(e){return r()(e)}String.fromCharCode(160)},622:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return l});var a=n(34),r=n(607),i=n(1),c=n(545),s={a4:{name:Object(a.translate)("A4"),exclude:function(e){return Object(i.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(a.translate)('Label (4"x6")')},legal:{name:Object(a.translate)("Legal")},letter:{name:Object(a.translate)("Letter")}},o=function(e){return Object(i.reduce)(s,function(t,n,a){var r=n.name,i=n.exclude;return i&&i(e)||(t[a]=r),t},{})},u=function(e,t,n){if(!s[e])throw new Error("Invalid paper size: ".concat(e));var a={paper_size:e,label_id_csv:Object(i.filter)(Object(i.map)(t,"labelId")).join(","),caption_csv:Object(i.filter)(Object(i.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(r.stringify)(a)},l=function(e,t){return u(e,t,c.e.labelsPrint())}},626:function(e,t,n){var a={"./af":[392,2],"./af.js":[392,2],"./ar":[399,3],"./ar-dz":[393,4],"./ar-dz.js":[393,4],"./ar-kw":[394,5],"./ar-kw.js":[394,5],"./ar-ly":[395,6],"./ar-ly.js":[395,6],"./ar-ma":[396,7],"./ar-ma.js":[396,7],"./ar-sa":[397,8],"./ar-sa.js":[397,8],"./ar-tn":[398,9],"./ar-tn.js":[398,9],"./ar.js":[399,3],"./az":[400,10],"./az.js":[400,10],"./be":[401,11],"./be.js":[401,11],"./bg":[402,12],"./bg.js":[402,12],"./bm":[403,13],"./bm.js":[403,13],"./bn":[405,14],"./bn-bd":[404,15],"./bn-bd.js":[404,15],"./bn.js":[405,14],"./bo":[406,16],"./bo.js":[406,16],"./br":[407,17],"./br.js":[407,17],"./bs":[408,18],"./bs.js":[408,18],"./ca":[409,19],"./ca.js":[409,19],"./cs":[410,20],"./cs.js":[410,20],"./cv":[411,21],"./cv.js":[411,21],"./cy":[412,22],"./cy.js":[412,22],"./da":[413,23],"./da.js":[413,23],"./de":[416,24],"./de-at":[414,25],"./de-at.js":[414,25],"./de-ch":[415,26],"./de-ch.js":[415,26],"./de.js":[416,24],"./dv":[417,27],"./dv.js":[417,27],"./el":[418,28],"./el.js":[418,28],"./en-au":[419,29],"./en-au.js":[419,29],"./en-ca":[420,30],"./en-ca.js":[420,30],"./en-gb":[421,31],"./en-gb.js":[421,31],"./en-ie":[422,32],"./en-ie.js":[422,32],"./en-il":[423,33],"./en-il.js":[423,33],"./en-in":[424,34],"./en-in.js":[424,34],"./en-nz":[425,35],"./en-nz.js":[425,35],"./en-sg":[426,36],"./en-sg.js":[426,36],"./eo":[427,37],"./eo.js":[427,37],"./es":[431,38],"./es-do":[428,39],"./es-do.js":[428,39],"./es-mx":[429,40],"./es-mx.js":[429,40],"./es-us":[430,41],"./es-us.js":[430,41],"./es.js":[431,38],"./et":[432,42],"./et.js":[432,42],"./eu":[433,43],"./eu.js":[433,43],"./fa":[434,44],"./fa.js":[434,44],"./fi":[435,45],"./fi.js":[435,45],"./fil":[436,46],"./fil.js":[436,46],"./fo":[437,47],"./fo.js":[437,47],"./fr":[440,48],"./fr-ca":[438,49],"./fr-ca.js":[438,49],"./fr-ch":[439,50],"./fr-ch.js":[439,50],"./fr.js":[440,48],"./fy":[441,51],"./fy.js":[441,51],"./ga":[442,52],"./ga.js":[442,52],"./gd":[443,53],"./gd.js":[443,53],"./gl":[444,54],"./gl.js":[444,54],"./gom-deva":[445,55],"./gom-deva.js":[445,55],"./gom-latn":[446,56],"./gom-latn.js":[446,56],"./gu":[447,57],"./gu.js":[447,57],"./he":[448,58],"./he.js":[448,58],"./hi":[449,59],"./hi.js":[449,59],"./hr":[450,60],"./hr.js":[450,60],"./hu":[451,61],"./hu.js":[451,61],"./hy-am":[452,62],"./hy-am.js":[452,62],"./id":[453,63],"./id.js":[453,63],"./is":[454,64],"./is.js":[454,64],"./it":[456,65],"./it-ch":[455,66],"./it-ch.js":[455,66],"./it.js":[456,65],"./ja":[457,67],"./ja.js":[457,67],"./jv":[458,68],"./jv.js":[458,68],"./ka":[459,69],"./ka.js":[459,69],"./kk":[460,70],"./kk.js":[460,70],"./km":[461,71],"./km.js":[461,71],"./kn":[462,72],"./kn.js":[462,72],"./ko":[463,73],"./ko.js":[463,73],"./ku":[464,74],"./ku.js":[464,74],"./ky":[465,75],"./ky.js":[465,75],"./lb":[466,76],"./lb.js":[466,76],"./lo":[467,77],"./lo.js":[467,77],"./lt":[468,78],"./lt.js":[468,78],"./lv":[469,79],"./lv.js":[469,79],"./me":[470,80],"./me.js":[470,80],"./mi":[471,81],"./mi.js":[471,81],"./mk":[472,82],"./mk.js":[472,82],"./ml":[473,83],"./ml.js":[473,83],"./mn":[474,84],"./mn.js":[474,84],"./mr":[475,85],"./mr.js":[475,85],"./ms":[477,86],"./ms-my":[476,87],"./ms-my.js":[476,87],"./ms.js":[477,86],"./mt":[478,88],"./mt.js":[478,88],"./my":[479,89],"./my.js":[479,89],"./nb":[480,90],"./nb.js":[480,90],"./ne":[481,91],"./ne.js":[481,91],"./nl":[483,92],"./nl-be":[482,93],"./nl-be.js":[482,93],"./nl.js":[483,92],"./nn":[484,94],"./nn.js":[484,94],"./oc-lnc":[485,95],"./oc-lnc.js":[485,95],"./pa-in":[486,96],"./pa-in.js":[486,96],"./pl":[487,97],"./pl.js":[487,97],"./pt":[489,98],"./pt-br":[488,99],"./pt-br.js":[488,99],"./pt.js":[489,98],"./ro":[490,100],"./ro.js":[490,100],"./ru":[491,101],"./ru.js":[491,101],"./sd":[492,102],"./sd.js":[492,102],"./se":[493,103],"./se.js":[493,103],"./si":[494,104],"./si.js":[494,104],"./sk":[495,105],"./sk.js":[495,105],"./sl":[496,106],"./sl.js":[496,106],"./sq":[497,107],"./sq.js":[497,107],"./sr":[499,108],"./sr-cyrl":[498,109],"./sr-cyrl.js":[498,109],"./sr.js":[499,108],"./ss":[500,110],"./ss.js":[500,110],"./sv":[501,111],"./sv.js":[501,111],"./sw":[502,112],"./sw.js":[502,112],"./ta":[503,113],"./ta.js":[503,113],"./te":[504,114],"./te.js":[504,114],"./tet":[505,115],"./tet.js":[505,115],"./tg":[506,116],"./tg.js":[506,116],"./th":[507,117],"./th.js":[507,117],"./tk":[508,118],"./tk.js":[508,118],"./tl-ph":[509,119],"./tl-ph.js":[509,119],"./tlh":[510,120],"./tlh.js":[510,120],"./tr":[511,121],"./tr.js":[511,121],"./tzl":[512,122],"./tzl.js":[512,122],"./tzm":[514,123],"./tzm-latn":[513,124],"./tzm-latn.js":[513,124],"./tzm.js":[514,123],"./ug-cn":[515,125],"./ug-cn.js":[515,125],"./uk":[516,126],"./uk.js":[516,126],"./ur":[517,127],"./ur.js":[517,127],"./uz":[519,128],"./uz-latn":[518,129],"./uz-latn.js":[518,129],"./uz.js":[519,128],"./vi":[520,130],"./vi.js":[520,130],"./x-pseudo":[521,131],"./x-pseudo.js":[521,131],"./yo":[522,132],"./yo.js":[522,132],"./zh-cn":[523,133],"./zh-cn.js":[523,133],"./zh-hk":[524,134],"./zh-hk.js":[524,134],"./zh-mo":[525,135],"./zh-mo.js":[525,135],"./zh-tw":[526,136],"./zh-tw.js":[526,136]};function r(e){if(!n.o(a,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],r=t[0];return n.e(t[1]).then(function(){return n.t(r,7)})}r.keys=function(){return Object.keys(a)},r.id=626,e.exports=r},627:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},a=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};a.isEnabled=function(){return!0},t.a=a}).call(this,n(112))},635:function(e,t,n){},636:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(679),o=n.n(s),u=n(680),l=n.n(u),d=n(681),m=n.n(d),p={ups:o.a,usps:l.a,dhlexpress:m.a,dhlecommerce:m.a,dhlecommerceasia:m.a},f=function(e){var t=e.carrier,n=e.size;if(!t||!p[t.toLowerCase()])return r.a.createElement("span",null);var a="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(n),"px");return r.a.createElement("div",{style:{width:a},className:"carrier-icon"},r.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};f.propTypes={carrier:c.a.string.isRequired,size:c.a.number},t.a=f},637:function(e,t,n){"use strict";var a=n(35),r=n.n(a),i=n(110),c=n.n(i),s=n(1),o=n(34),u=n(538),l=n(593),d=n(549),m=n(544),p=n(576),f=n(562),E=n(535),_=n(541);n(572),n(563),n(579),n(613),n(627);var O=n(545),b=n(36),h=n.n(b);function g(e,t,n,a){Object(s.isFunction)(n)?g(e,t,n(e,t,a),a):Object(s.isObject)(n)&&e(h()({},n,a))}var v,C=n(577),S=n(614),N=function(e,t){var n=Object(m.e)(e,t);return!n||n.pristine?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(f.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},y=function(e,t){var n=Object(E.a)(e);return t?c()(N(e,n)):[].concat(c()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(p.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),c()(N(e,n)))};t.a=(v={},r()(v,u.L,[function(e,t){var n=t.successAction,a=t.failureAction,r=t.onlyPackages,i=function(e){e(n),e(Object(l.b)())},c=y(e.getState(),r);e.dispatch(Object(s.isEmpty)(c)?i:Object(l.d)({nextSteps:c,onSuccess:i,onFailure:function(e){e(a),e(Object(l.b)())}}))}]),r()(v,_.Rb,[function(e,t){var n=e.dispatch,a=e.getState,r=t.siteId,i=t.methodId,c=t.methodType,s=t.method,o=t.successAction,l=t.failureAction,d=Object(C.a)(a(),c,r).formSchema,m=Object(S.a)(d,s);O.c(r,O.e.serviceSettings(c,i),m).then(function(e){n(function(e,t,n){return{type:u.Fb,siteId:e,data:t,originatingAction:n}}(r,e,t)),g(n,a,o,{sentData:m,receivedData:e})}).catch(function(e){return g(n,a,l,{error:e})})}]),v)},647:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var a=function(){return"https://wordpress.com"}},648:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(34),o=n(1),u=n(537),l=n.n(u),d=n(528),m=n.n(d),p=function(e){var t=e.isPlaceholder,n=e.data,a=e.dimensionUnit,i=e.prefixActions,c=(e.hasError,e.children),s=e.translate;if(t)return r.a.createElement("div",{className:"packages__packages-row placeholder"},r.a.createElement("div",{className:"packages__packages-row-icon"},r.a.createElement(l.a,{icon:"product",size:18})),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},r.a.createElement("span",null))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},r.a.createElement("span",null)),r.a.createElement("div",{className:"packages__packages-row-actions"},c));var u,d=function(){return r.a.createElement("div",{className:"packages__packages-row-actions"},c)};return r.a.createElement("div",{className:m()("packages__packages-row",{prefixed:i})},i?d():null,r.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return r.a.createElement(l.a,{icon:t,size:18})}(n.is_letter)),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},(u=n.name)&&""!==Object(o.trim)(u)?u:s("Untitled"))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},n.inner_dimensions," ",a),i?null:d())};p.propTypes={siteId:c.a.number.isRequired,isPlaceholder:c.a.bool,data:c.a.shape({name:c.a.string,is_letter:c.a.bool,inner_dimensions:c.a.string}).isRequired,prefixActions:c.a.bool,dimensionUnit:c.a.string},t.a=Object(s.localize)(p)},649:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(538);function r(e,t,n){return{type:a.L,successAction:e,failureAction:t,onlyPackages:n||!1}}},655:function(e,t,n){"use strict";var a=n(110),r=n.n(a),i=n(36),c=n.n(i),s=n(1),o=n(541),u={modalErrors:{},pristine:!0},l=function(e){return null===e||""===Object(s.trim)(e)},d={};d[o.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=c()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(s.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},d[o.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},d[o.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},d[o.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},d[o.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),a=Object(s.omitBy)(n,l);return Object.assign({},e,{packageData:a,pristine:!1})},d[o.m]=function(e,t){var n=t.packageData,a=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?a[n.index]=Object(s.omit)(n,"index"):a.push(n);return e=d[o.h](e),c()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:c()({},e.packages,{custom:a}),pristine:!1})},d[o.u]=function(e){return c()({},e,{showOuterDimensions:!0})},d[o.k]=function(e,t){var n=r()(e.packages.custom);return n.splice(t.index,1),c()({},e,{packages:c()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},d[o.t]=function(e,t){var n=t.serviceId,a=t.groupId,r=t.checked,i=e.predefinedSchema[n][a].definitions.map(function(e){return e.id}),o=e.currentlyEditingPredefinedPackages[n],u=r?Object(s.uniq)(Object(s.concat)(o,i)):Object(s.difference)(o,i),l=c()({},e.currentlyEditingPredefinedPackages);return l[n]=u,c()({},e,{currentlyEditingPredefinedPackages:l,pristine:!1})},d[o.v]=function(e,t){var n=t.serviceId,a=t.packageId,i=c()({},e.currentlyEditingPredefinedPackages),s=r()(i[n]||[]),o=s.indexOf(a);return-1===o?s.push(a):s.splice(o,1),i[n]=s,c()({},e,{currentlyEditingPredefinedPackages:i,pristine:!1})},d[o.l]=function(e,t){var n=t.serviceId,a=t.packageId,i=c()({},e.packages.predefined),s=r()(i[n]||[]),o=s.indexOf(a);return-1!==o&&s.splice(o,1),i[n]=s,c()({},e,{packages:c()({},e.packages,{predefined:i}),pristine:!1})},d[o.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=d[o.h](e),c()({},e,{packages:c()({},e.packages,{predefined:t}),pristine:!1})},d[o.o]=function(e,t){var n=t.mode;return c()({},e,{mode:n})},d[o.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},d[o.p]=function(e,t){var n=t.isFetching;return c()({},e,{isFetching:n})},d[o.q]=function(e,t){var n=t.isFetchError;return c()({},e,{isFetchError:n})},d[o.j]=function(e,t){var n=t.packages,a=t.dimensionUnit,r=t.weightUnit,i=t.packageSchema,s=t.predefinedSchema;return c()({},e,{packages:n,dimensionUnit:a,weightUnit:r,packageSchema:i,predefinedSchema:s,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof d[t.type]?d[t.type](e,t):e}},656:function(e,t,n){"use strict";var a=n(35),r=n.n(a),i=n(36),c=n.n(i),s=n(541),o={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},u={};u[s.b]=function(e,t){var n=t.storeOptions,a=t.formData,r=t.formMeta,i=t.userMeta;return c()({},e,{storeOptions:n,meta:c()({},e.meta,r,{pristine:!0,isLoaded:!0,user:i}),data:c()({},e.data,a)})},u[s.e]=function(e,t){var n=t.key,a=t.value,i=e.meta.pristine?e.data:e.pristineData;return c()({},e,{meta:c()({},e.meta,{pristine:!1}),data:c()({},e.data,r()({},n,a)),pristineData:i})},u[s.f]=function(e,t){var n=t.key,a=t.value;return c()({},e,{meta:c()({},e.meta,r()({},n,a))})},u[s.d]=function(e){return e.meta.pristine?e:c()({},e,{meta:c()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},u[s.c]=function(e){return c()({},e,{addCardDialog:!0})},u[s.a]=function(e){return c()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e}},661:function(e,t,n){"use strict";var a,r=n(110),i=n.n(r),c=n(36),s=n.n(c),o=n(119),u=n.n(o),l=n(35),d=n.n(l),m=n(47),p=n.n(m),f=n(593),E=n(538),_=p()("woocommerce:action-list");t.a=(a={},d()(a,E.d,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,i=r.prevSteps,c=r.currentStep,o=r.nextSteps||[],l=u()(o),d=l[0],m=l.slice(1);if(c)return void _("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!d)return void _("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var p=s()({},r,{prevSteps:i,currentStep:s()({},d,{startTime:a}),nextSteps:m});n(Object(f.a)(p)),d.onStep(n,p)}]),d()(a,E.e,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,c=r.prevSteps,o=r.currentStep,u=r.nextSteps;if(!o)return void _("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var l=s()({},r,{prevSteps:[].concat(i()(c||[]),[s()({},o,{endTime:a})]),currentStep:null,nextSteps:u});n(Object(f.a)(l)),u&&u.length>0?n(Object(f.d)(l)):r.onSuccess&&r.onSuccess(n,l)}]),d()(a,E.c,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,c=t.error,o=r.prevSteps,u=r.currentStep,l=r.nextSteps;if(!u)return void _("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var d=s()({},r,{prevSteps:[].concat(i()(o||[]),[s()({},u,{endTime:a,error:c})]),currentStep:null,nextSteps:l});n(Object(f.a)(d)),r.onFailure&&r.onFailure(n,d)}]),a)},662:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),c=n(46),s=n(538),o=n(542),u=n(618);t.a=Object(c.b)(null,(a={},i()(a,s.k,function(){return o.b}),i()(a,s.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(u.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(u.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(u.a)(e.name)}})}})}})}),i()(a,s.j,function(e,t){var n=t.originalAction.type;return s.k===n?o.a:e}),a))},675:function(e,t,n){"use strict";n.d(t,"a",function(){return M});n(533);var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=(n(534),n(531)),m=n.n(d),p=n(35),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n(47),h=n.n(b),g=(n(676),n(34)),v=n.n(g),C=n(1),S=h()("calypso:protect-form"),N=[],y=0;function j(e){if(N.length){S("unsaved form changes detected");var t=v.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function I(){0===y&&window.addEventListener("beforeunload",j),y++}function R(){0===--y&&window.removeEventListener("beforeunload",j)}function P(e){Object(C.includes)(N,e)||N.push(e)}function k(e){N=Object(C.without)(N,e)}var M=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){I(),this.props.isChanged&&P(this)}},{key:"componentWillUnmount",value:function(){R(),k(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?P(this):k(this))}},{key:"render",value:function(){return null}}]),t}(O.Component);f()(M,"propTypes",{isChanged:_.a.bool.isRequired})},677:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(576),h=n(549),g=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,a=e.fetching,r=e.error;n||a||r||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);g.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(h.d)(e),fetching:Object(h.c)(e),error:Object(h.b)(e)}},function(e){return Object(O.b)({fetchSettings:b.a},e)})(g)},678:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(562),h=n(544),g=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,a=e.fetching,r=e.error;n||a||r||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);g.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(h.i)(e),fetching:Object(h.h)(e),error:Object(h.g)(e)}},function(e){return Object(O.b)({fetchSettings:b.fetchSettings},e)})(g)},679:function(e,t,n){e.exports=n.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,n){e.exports=n.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,n){e.exports=n.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},682:function(e,t,n){"use strict";var a=n(36),r=n.n(a),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(109),l=n(34),d=n(1),m=n(537),p=n.n(m),f=n(35),E=n.n(f),_=n(697),O=n(107),b=n.n(O),h=n(108),g=n.n(h),v=n(530),C=n.n(v),S=n(529),N=n.n(S),y=n(531),j=n.n(y),I=n(30),R=n(528),P=n.n(R);function k(e){return Object(d.get)(e,["currentUser","id"])}function M(e){var t=k(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){var a=M(n);return Object(d.get)(a,e,t)}};T("localeSlug"),T("localeVariant"),T("user_ip_country_code");T("date"),T("username"),T("email");T("email_verified",!1);var A=n(535),L=n(565);function w(e){var t=Object(A.a)(e);return t||1!==function(e){var t=M(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=M(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(L.a)(e,t)}var x=n(542),D=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e);return Object(d.isArray)(D(e,t))},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e);return x.b===D(e,t)};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e),n=D(e,t);return Object(d.find)(n,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var G=n(572),H=n(563),F=n(538),B=function(e){return function(t,n){if(!W(n(),e)&&!U(n(),e)){var a={type:F.N,siteId:e};return t(a),Object(G.a)(e).get("settings/products").then(function(n){t({type:F.O,siteId:e,data:n})}).catch(function(n){t(Object(H.a)(e,a,n))})}}},z=n(603),q=function(e){function t(){return b()(this,t),C()(this,N()(t).apply(this,arguments))}return j()(t,e),g()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.noWrap,a=e.dimensions,r=e.onChange,i=e.translate,s=e.dimensionsUnit,o=P()("form-dimensions-input",t,{"no-wrap":n});return c.a.createElement("div",{className:o},c.a.createElement(_.a,{name:"length",placeholder:i("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:a&&a.length||"",onChange:function(e){return r(e,"length")},className:"form-dimensions-input__length"}),c.a.createElement(_.a,{name:"width",placeholder:i("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:a&&a.width||"",onChange:function(e){return r(e,"width")},className:"form-dimensions-input__width"}),c.a.createElement(z.a,{name:"height",placeholder:i("H",{comment:"Height placeholder for dimensions input"}),suffix:s,type:"number",value:a&&a.height||"",onChange:function(e){return r(e,"height")},className:"form-dimensions-input__height"}))}}]),t}(i.Component);E()(q,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),E()(q,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var Z=Object(u.b)(function(e,t){var n=t.dimensionsUnit,a=w(e);if(!n){var r=a&&V(e,a.ID);n=r&&r.value||"in"}return{siteId:a&&a.ID,dimensionsUnit:n}},function(e){return Object(I.b)({fetchSettingsProducts:B},e)})(Object(l.localize)(q)),K=n(548),Q=n(551),Y=n(569),$=n(552),X=/^\.\d+$/,J=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:J.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ne=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,ae=function(e){return isNaN(e)?"":0>e?"":e},re=function(e){var t="",n="",a="",r=ne.exec(e);return r&&4===r.length&&(t=ae(r[1]),n=ae(r[2]),a=ae(r[3])),{length:t,width:n,height:a}},ie=function(e){return Object(d.trim)(e)},ce=ee,se=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=re,ue=function(e){var t=re(e),n=t.length,a=t.width,r=t.height;return 0<n&&0<a&&0<r},le=function(e){var t=e.siteId,n=e.form,a=e.setModalErrors,r=e.updatePackagesField,i=e.translate,s=n.mode,o=n.modalErrors,u=n.dimensionUnit,l=n.weightUnit,m=n.packageData,p=m.name,f=m.inner_dimensions,O=m.box_weight,b=m.is_letter,h=function(e,n){a(t,Object(d.omit)(o,e)),r(t,E()({},e,n))},g=function(e,t){h(t,e)},v=function(e,t){var n=t||i("Invalid value."),a=""===Object(d.trim)(m[e])?i("This field is required."):n;return o[e]?c.a.createElement($.a,{text:a}):null},C=function(e){r(t,{is_letter:"envelope"===e.target.value})};return c.a.createElement("div",{className:"packages__properties-group"},"add-custom"===s?c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"package_type"},i("Type of package")),c.a.createElement(Y.a,{id:"package_type",onChange:C,value:b?"envelope":"box"},c.a.createElement("option",{value:"box"},i("Box")),c.a.createElement("option",{value:"envelope"},i("Envelope")))):null,c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"name"},i("Package name")),c.a.createElement(_.a,{id:"name",name:"name",placeholder:i("Unique package name"),value:p||"",onChange:function(e){return g(e,"name")},className:o.name?"is-error":""}),v("name",i("This field must be unique"))),c.a.createElement(K.a,{className:"packages__add-package-weight-group"},c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,null,i("Dimensions (L x W x H)")),function(e,t,n,a){var r=oe(t),i=r.length,s=r.width,o=r.height;return c.a.createElement(Z,{dimensionsUnit:n,dimensions:{width:s,height:o,length:i},onChange:function(t,n){a(e,["length"===n?t:i,"width"===n?t:s,"height"===n?t:o].join(" x "))}})}("inner_dimensions",f,u,h),v("inner_dimensions")),c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,{htmlFor:"box_weight"},i("Weight of empty package")),c.a.createElement(z.a,{id:"box_weight",name:"box_weight",placeholder:i("0.0"),value:O||"",onChange:function(e){return g(e,"box_weight")},className:o.box_weight?"is-error":"",type:"number",suffix:l}),v("box_weight"))))};le.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var de=Object(l.localize)(le),me=n(115),pe=n.n(me),fe=Object(d.memoize)(function(e){return pe()(e,{greedy:!0})}),Ee=function(e){return e&&""!==Object(d.trim)(e)?e:null},_e=function(e,t){return e=Ee(e),Object(d.some)(t,function(t){return t===e})?null:e},Oe=/^\d+(\.\d+)?$/,be=function(e){return Oe.test(e)?Number.parseFloat(e):null},he=function(e,t,n){var a,r=fe(n);return r(function(e,t){var n=be(e.box_weight),a=be(e.max_weight);n&&a&&a<=n&&(a=null);var r={name:_e(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:Ee(e.outer_dimensions),box_weight:n,max_weight:a};return Object(d.omitBy)(r,function(e){return null===e})}(e,t)),a=r.errors,Object(d.reduce)(a,function(e,t){if(t.field){var n,a=t.field.replace("data.","");Object.assign(e,(n={},E()(n,a,!0),E()(n,"any",!0),n))}return e},{})},ge=n(570),ve=n(555),Ce=n(583),Se=n(821),Ne=function(e){var t=e.className,n=e.disabled,a=e.id,r=e.onToggle,i=e.readOnly,s=e.selectedElements,o=e.totalElements,u=s&&s===o,l=s&&s<o,d=P()("bulk-select__box",{"is-checked":u}),m=P()("bulk-select__some-checked-icon",{"is-disabled":n}),f=P()("bulk-select",t);return c.a.createElement("span",{className:f},c.a.createElement("span",{className:"bulk-select__container"},c.a.createElement("input",{id:a,type:"checkbox",className:d,onChange:function(e){i||r(!(l||u),e)},checked:u,disabled:n}),l?c.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};Ne.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var ye=Ne,je=n(602),Ie=n(648),Re=n(544),Pe=function(e){var t=e.siteId,n=e.form,a=e.toggleAll,r=e.togglePackage,i=e.currentlyEditingPredefinedPackages,s=e.translate,o=n.dimensionUnit,u=function(e){var n="group-".concat(e.serviceId,"-").concat(e.groupId);return c.a.createElement("div",{className:"packages__group-header"},c.a.createElement("label",{htmlFor:n,onClick:function(e){return e.stopPropagation()}},c.a.createElement(ye,{id:n,totalElements:e.total,selectedElements:e.selected,onToggle:function(n,r){r.stopPropagation(),a(t,e.serviceId,e.groupId,r.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return c.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(i,function(n,a){var i,l,d=(i=n.selected,l=n.total,i===l?s("All packages selected"):s("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:i,args:{selectedCount:i}}));e.push(c.a.createElement(je.a,{className:"packages__predefined-packages",key:a,header:u(n),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:s("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,n){return c.a.createElement(Ie.a,{key:n,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},c.a.createElement(Se.a,{className:"form-checkbox packages__packages-row-actions",checked:e.selected,onChange:function(){return r(t,e.serviceId,e.id)}}))})}(n)))}),e}())};Pe.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var ke=Object(u.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Re.c)(e)}})(Object(l.localize)(Pe)),Me=n(534),Te=n.n(Me),Ae=function(e){function t(){var e,n;b()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=C()(this,(e=N()(t)).call.apply(e,[this].concat(r))),E()(Te()(n),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),n}return j()(t,e),g()(t,[{key:"render",value:function(){var e=P()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=P()("segmented-control__link",E()({},"item-index-".concat(this.props.index),null!=this.props.index));return c.a.createElement("li",{className:e},c.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},c.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(c.a.Component);E()(Ae,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),E()(Ae,"defaultProps",{selected:!1});var Le=Ae,we=function(e){function t(){var e,n;b()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=C()(this,(e=N()(t)).call.apply(e,[this].concat(r))),E()(Te()(n),"state",{selected:n.props.initialSelected||n.props.options[0].value}),n}return j()(t,e),g()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,n){return c.a.createElement(Le,{index:n,key:n,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return c.a.createElement("ul",{className:P()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(c.a.Component);E()(we,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var xe=n(649),De=n(550),We=n(562),Ue=function(e){var t,n=e.siteId,a=e.form,r=e.predefinedPackagesSummary,i=e.setModalErrors,s=e.savePackage,o=e.savePredefinedPackages,u=e.dismissModal,l=e.removePackage,m=e.setAddMode,f=e.updatePackagesField,E=e.translate,_=a.showModal,O=a.mode,b=a.packages,h=a.packageSchema,g=a.predefinedSchema,v=a.packageData,C=v.index,S=b.custom,N="edit"===O,y="add-custom"===O,j="add-predefined"===O,I=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in v&&e.onSaveSuccess(v.name),e.successNotice(E("Your shipping packages have been saved."),t)},function(){return e.errorNotice(E("Unable to save your shipping packages. Please try again."),t)},!0)},R=function(){u(n)},P=E(N?"Edit package":"Add a package"),k=y||j,M=y||N,T=j;t=y||j&&0===r.removed?E("Add package","Add packages",{count:y?1:r.added}):E("Done");var A=[c.a.createElement(Ce.a,{onClick:function(){if(j)return o(n),void(e.persistOnSave&&I());var t="number"===typeof v.index?S[v.index].name:null,a=Object(d.concat)(Object(d.difference)(S.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(g,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),r=Object.assign({},v,{name:ie(v.name),inner_dimensions:se(v.inner_dimensions),outer_dimensions:se(v.outer_dimensions),box_weight:ce(v.box_weight),max_weight:0}),c=he(r,a,h);if(ue(r.inner_dimensions)||(c.any=!0,c.inner_dimensions=!0),c.any)return f(n,r),void i(n,c);s(n,r),e.persistOnSave&&I()}},t),c.a.createElement(Ce.a,{onClick:R,isPrimary:!1},E("Cancel"))];return N&&A.unshift({action:"delete",label:c.a.createElement("span",null,E("{{icon/}} Delete this package",{components:{icon:c.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return l(n,C)},additionalClassNames:"packages__delete is-scary is-borderless"}),c.a.createElement(ge.a,{isVisible:_,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:R,buttons:A},c.a.createElement(ve.a,{className:"packages__add-edit-title"},P),k&&c.a.createElement(we,{primary:!0,className:"packages__mode-select",initialSelected:O,onSelect:function(e){m(n,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),M&&c.a.createElement(de,e),T&&c.a.createElement(ke,e))};Ue.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(u.b)(function(e){return{predefinedPackagesSummary:Object(Re.f)(e)}},function(e){return Object(I.b)(r()({createWcsShippingSaveActionList:xe.a,errorNotice:De.a,successNotice:De.d},We),e)})(Object(l.localize)(Ue))},796:function(e,t,n){},797:function(e,t,n){},798:function(e,t,n){},799:function(e,t,n){e.exports=n.p+"images/87ed0f18f2fdcec3f7db334f21e5ca74.svg"},800:function(e,t,n){e.exports=n.p+"images/16ca93315c92bf5c0000d63300e5cd85.svg"},801:function(e,t,n){e.exports=n.p+"images/726f32c920aabc7c6ffd42b5b4eaaf2d.svg"},802:function(e,t,n){e.exports=n.p+"images/331d1b39baf9a992bfdbacc7412570f4.svg"},803:function(e,t,n){e.exports=n.p+"images/312631cb779f098879fc3522b42eefaf.svg"},804:function(e,t,n){e.exports=n.p+"images/bf0d855ed117f2f9bdae37cd43f09a95.svg"},805:function(e,t,n){e.exports=n.p+"images/30192ac2bb4b8bef75e1a666610914d7.svg"},830:function(e,t,n){"use strict";n.r(t);var a=n(10),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(109),g=n(30),v=n(34),C=n.n(v),S=n(719),N=n(528),y=n.n(N),j=n(605),I=n(12),R=n.n(I),P=n(1),k=n(795),M=n(834),T=n(533),A=n.n(T),L=n(536),w=n.n(L),x=n(537),D=n.n(x),W=function(e){var t=e.className,n=e.compact,a=e.displayAsLink,r=e.highlight,i=e.href,c=e.onClick;return y()("card",t,{"is-card-link":a||!!i,"is-clickable":!!c,"is-compact":n,"is-highlight":r},!!r&&"is-"+r)},U=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.compact,e.displayAsLink),a=(e.highlight,e.tagName),i=e.href,c=e.target,s=w()(e,["children","compact","displayAsLink","highlight","tagName","href","target"]);return i?r.a.createElement("a",A()({},s,{href:i,target:c,className:W(this.props)}),r.a.createElement(D.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t):r.a.createElement(a,A()({},s,{className:W(this.props)}),n&&r.a.createElement(D.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t)}}]),t}(a.PureComponent);b()(U,"propTypes",{className:R.a.string,displayAsLink:R.a.bool,href:R.a.string,tagName:R.a.oneOfType([R.a.func,R.a.string]).isRequired,target:R.a.string,compact:R.a.bool,highlight:R.a.oneOf([!1,"error","info","success","warning"])}),b()(U,"defaultProps",{tagName:"div",highlight:!1});var V=U;function G(e){return r.a.createElement(V,A()({},e,{className:y()(e.className,"is-compact")}),e.children)}var H={en:{symbol:"K",grouping:",",decimal:"."},es:{symbol:" mil",grouping:".",decimal:","},"pt-br":{symbol:" mil",grouping:".",decimal:","},de:{symbol:" Tsd.",grouping:".",decimal:","},fr:{symbol:" k",grouping:" ",decimal:","},he:{symbol:"K",grouping:",",decimal:"."},ja:{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},nl:{symbol:"K",grouping:".",decimal:","},tr:{symbol:" B",grouping:".",decimal:","},id:{symbol:" rb",grouping:".",decimal:","},"zh-cn":{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},"zh-tw":{symbol:"\u842c",unitValue:1e4,grouping:",",decimal:"."},ko:{symbol:"\ucc9c",grouping:",",decimal:"."},ar:{symbol:" \u0623\u0644\u0641",grouping:"\u066c",decimal:"\u066b"},sv:{symbol:" tn",grouping:" ",decimal:","}};n(796);var F=function(e){var t=e.count,n=e.compact,a=e.numberFormat,i=e.primary,c=w()(e,["count","compact","numberFormat","primary"]);return r.a.createElement("span",A()({className:y()("count",{"is-primary":i})},Object(P.omit)(c,["translate","moment"])),n&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.a.getLocaleSlug();if(isNaN(e)||!H[t])return null;var n=H[t],a=n.decimal,r=n.grouping,i=n.symbol,c=n.unitValue,s=void 0===c?1e3:c,o=e<0?"-":"",u=Math.abs(e);if(u<s)return"".concat(o).concat(u);var l=u<10*s?1:0,d=Object(v.numberFormat)(u/s,{decimals:l,thousandsSep:r,decPoint:a});return"".concat(o).concat(d).concat(i)}(t)||a(t))};F.propTypes={count:R.a.number.isRequired,numberFormat:R.a.func,primary:R.a.bool,compact:R.a.bool},F.defaultProps={primary:!1,compact:!1};var B=Object(v.localize)(F),z=(n(797),function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e="number"===typeof this.props.count,t=!(this.props.label||e||this.props.children),n=y()(this.props.className,"section-header",{"is-empty":t}),a={id:this.props.id};return r.a.createElement(G,A()({className:n,href:this.props.href},a),r.a.createElement("div",{className:"section-header__label"},r.a.createElement("span",{className:"section-header__label-text"},this.props.label),e&&r.a.createElement(B,{count:this.props.count})),r.a.createElement("div",{className:"section-header__actions"},this.props.children))}}]),t}(a.PureComponent));b()(z,"defaultProps",{label:"",href:null});var q=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.description,a=e.children,i=r.a.createElement("div",null,r.a.createElement("div",{className:"extended-header__header"},t),r.a.createElement("div",{className:"extended-header__header-description"},n));return r.a.createElement(z,{className:"extended-header",label:i},a)}}]),t}(a.Component),Z=n(36),K=n.n(Z),Q=n(821),Y=n(622),$=n(548),X=n(551),J=n(569),ee=n(556),te=n(588),ne=(n(798),n(799)),ae=n.n(ne),re=n(800),ie=n.n(re),ce=n(801),se=n.n(ce),oe=n(802),ue=n.n(oe),le=n(803),de=n.n(le),me=n(804),pe=n.n(me),fe=n(805),Ee=n.n(fe),_e={amex:ae.a,diners:ie.a,discover:se.a,jcb:ue.a,mastercard:de.a,unionpay:pe.a,visa:Ee.a},Oe={alipay:"Alipay",amex:"American Express","apple-pay":"Apple Pay",bancontact:"Bancontact","brazil-tef":"Transfer\xeancia banc\xe1ria",diners:"Diners Club",discover:"Discover",eps:"eps",giropay:"Giropay",id_wallet:"OVO",ideal:"iDEAL",jcb:"JCB",mastercard:"Mastercard",netbanking:"Net Banking",p24:"Przelewy24",paypal:"PayPal",placeholder:"Payment logo",unionpay:"UnionPay",visa:"Visa",wechat:C.a.translate("WeChat Pay",{comment:"Name for WeChat Pay - https://pay.weixin.qq.com/"}),sofort:"Sofort"},be=Object(P.keys)(Oe),he=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.altText,n=e.className,a=e.isCompact,i=e.type,c=e.disabled,s=y()("payment-logo","is-".concat(i),{"is-compact":a},{disabled:c},n),o=_e[i],u=o?{backgroundImage:"url(".concat(o,")")}:void 0;return r.a.createElement("div",{className:s,style:u,"aria-label":t||Oe[i]||""})}}]),t}(r.a.Component);b()(he,"propTypes",{className:R.a.string,type:R.a.oneOf(be),altText:R.a.string,isCompact:R.a.bool,disabled:R.a.bool});var ge=he,ve=function(e,t,n){var a={amex:e("American Express"),discover:e("Discover"),mastercard:e("MasterCard"),visa:e("VISA"),paypal:e("PayPal")};return a[t]?n?e("%(card)s ****%(digits)s",{args:{card:a[t],digits:n}}):a[t]:null},Ce=function(e){var t=e.translate,n=e.selected,a=e.isLoading,i=e.type,c=e.digits,s=e.name,o=e.expiry,u=e.onSelect;if(a)return r.a.createElement(M.a,{className:y()("label-settings__card","card","is-compact")},r.a.createElement(Q.a,{className:"label-settings__card-checkbox"}),r.a.createElement(ge,{className:"label-settings__card-logo",type:"placeholder",altText:""}),r.a.createElement("div",{className:"label-settings__card-details"},r.a.createElement("p",{className:"label-settings__card-number"}),r.a.createElement("p",{className:"label-settings__card-name"})),r.a.createElement("div",{className:"label-settings__card-date"},r.a.createElement("p",null)));var l=ve(t,i,c),d=l?i:"placeholder",m=l||i;return r.a.createElement(M.a,{className:y()("label-settings__card","card","is-compact"),onClick:u},r.a.createElement(Q.a,{className:"label-settings__card-checkbox",checked:n,onChange:u}),r.a.createElement(ge,{className:"label-settings__card-logo",type:d,altText:l}),r.a.createElement("div",{className:"label-settings__card-details"},r.a.createElement("p",{className:"label-settings__card-number"},m),r.a.createElement("p",{className:"label-settings__card-name"},s)),r.a.createElement("div",{className:"label-settings__card-date"},t("Expires %(date)s",{args:{date:o},context:"date is of the form MM/YY"})))};Ce.propTypes={selected:R.a.bool.isRequired,isLoading:R.a.bool,type:R.a.string,digits:R.a.string,name:R.a.string,expiry:R.a.string,onSelect:R.a.func};var Se=Object(v.localize)(Ce),Ne=n(647),ye=n(576),je=n(549),Ie=function(){return null},Re=function(){return null},Pe=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderPaymentPermissionNotice",function(){var e=n.props,t=e.canEditPayments,a=e.canEditSettings,i=e.masterUserName,c=e.masterUserLogin,s=e.translate;return!a||t?null:r.a.createElement(ee.a,{showDismiss:!1},s("Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.",{args:{ownerName:i,ownerLogin:c}}))}),b()(f()(n),"refetchSettings",function(){n.props.fetchSettings(n.props.siteId)}),b()(f()(n),"renderPaymentWarningNotice",function(){var e=n.props,t=e.paymentMethodsWarning,a=e.translate;if(t)return r.a.createElement(ee.a,{status:"is-warning",showDismiss:!1,text:t},r.a.createElement(te.a,{onClick:n.refetchSettings},a("Retry")))}),b()(f()(n),"renderSettingsPermissionNotice",function(){var e=n.props,t=e.canEditSettings,a=e.masterUserName,i=e.masterUserLogin,c=e.translate;return t?null:r.a.createElement(ee.a,{showDismiss:!1},c("Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.",{args:{ownerName:a,ownerLogin:i}}))}),b()(f()(n),"renderAddCardExternalInfo",function(){var e=n.props,t=e.masterUserWpcomLogin,a=e.masterUserEmail,i=e.translate;return t?r.a.createElement("p",null,i("Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>",{args:{wpcomLogin:t,wpcomEmail:a}})):null}),b()(f()(n),"onVisibilityChange",function(){document.hidden||n.refetchSettings(),n.addCreditCardWindow&&n.addCreditCardWindow.closed&&document.removeEventListener("visibilitychange",n.onVisibilityChange)}),b()(f()(n),"renderPaymentsSection",function(){var e=n.props,t=e.siteId,a=e.canEditPayments,i=e.paymentMethods,c=e.selectedPaymentMethod,s=e.isReloading,o=e.translate;if(!n.state.expanded){var u;if(c){var l=Object(P.find)(i,{payment_method_id:c}),d=l.card_type,m=l.card_digits;u=o("We'll charge the credit card on your account (%(card)s) to pay for the labels you print",{args:{card:ve(o,d,m)}})}else u=o("To purchase shipping labels, add a credit card.");return r.a.createElement("div",null,n.renderPaymentPermissionNotice(),r.a.createElement("p",{className:"label-settings__credit-card-description"},u),a&&r.a.createElement("p",{className:"label-settings__credit-card-description"},r.a.createElement(S.a,{onClick:function(e){e.preventDefault(),n.setState({expanded:!0})},className:y()("button","is-borderless")},o("Choose a different card"))))}var p,f;i.length?(p=o("To purchase shipping labels, choose a credit card you have on file or add a new card."),f=o("Add another credit card")):(p=o("To purchase shipping labels, add a credit card."),f=o("Add a credit card"));var E=y()("button","is-compact");return r.a.createElement("div",null,n.renderPaymentPermissionNotice(),r.a.createElement("p",{className:"label-settings__credit-card-description"},p),!s&&n.renderPaymentWarningNotice(),r.a.createElement(Ie,null),s?r.a.createElement("div",{className:y()(E,"label-settings__placeholder")},r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(Se,{selected:!1,isLoading:!0})):i.map(function(e,t){return r.a.createElement(Se,{key:t,selected:c===e.payment_method_id,type:e.card_type,name:e.name,digits:e.card_digits,expiry:e.expiry,onSelect:function(){return t=e.payment_method_id,n.props.setValue("selected_payment_method_id",t);var t}})}),r.a.createElement(Re,{siteId:t}),r.a.createElement(S.a,{className:y()(E,"label-settings__internal"),onClick:function(){n.props.openAddCardDialog(t)}},f),r.a.createElement("div",{className:"label-settings__credit-card-description label-settings__external"},n.renderAddCardExternalInfo(),r.a.createElement(S.a,{className:E,onClick:function(){n.addCreditCardWindow=window.open(Object(Ne.a)()+"/me/purchases/add-credit-card"),document.addEventListener("visibilitychange",n.onVisibilityChange)}},f," ",r.a.createElement(D.a,{icon:"external"}))))}),b()(f()(n),"renderEmailReceiptsSection",function(){var e=n.props,t=e.emailReceipts,a=e.translate,i=e.masterUserName,c=e.masterUserLogin,s=e.masterUserEmail,o=e.canEditSettings,u=e.canEditPayments;if(!Object(P.isBoolean)(t))return null;return r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},a("Email Receipts")),r.a.createElement(Q.a,{className:"form-label label-settings__credit-card-description",label:a("Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s",{args:{ownerName:i,ownerLogin:c,ownerEmail:s}}),checked:t,onChange:function(){return n.props.setValue("email_receipts",!t)},disabled:!u&&!o}))}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.canEditSettings,a=e.isLoading,i=e.paperSize,c=e.storeOptions,s=e.translate;if(a)return n.renderPlaceholder();var o=Object(Y.a)(c.origin_country);return r.a.createElement("div",null,r.a.createElement($.a,null,n.renderSettingsPermissionNotice(),r.a.createElement(X.a,{className:"label-settings__cards-label"},s("Paper size")),r.a.createElement(J.a,{onChange:function(e){return n.props.setValue("paper_size",e.target.value)},value:i,disabled:!t},Object.keys(o).map(function(e){return r.a.createElement("option",{value:e,key:e},o[e])}))),r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},s("Payment")),n.renderPaymentsSection()),n.renderEmailReceiptsSection())}),n}return _()(t,e),o()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({expanded:this.isExpanded(this.props)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectedPaymentMethod!==this.props.selectedPaymentMethod&&this.setState({expanded:this.isExpanded(e)})}},{key:"isExpanded",value:function(e){var t=e.canEditPayments,n=e.pristine,a=e.selectedPaymentMethod;return t&&(!a||!n)}},{key:"renderPlaceholder",value:function(){return r.a.createElement("div",{className:"label-settings__placeholder"},r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},r.a.createElement("span",null)),r.a.createElement(J.a,null)),r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},r.a.createElement("span",null)),r.a.createElement("p",{className:"label-settings__credit-card-description"}),r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(S.a,null)))}},{key:"render",value:function(){return r.a.createElement("div",{className:"label-settings__labels-container"},this.renderContent())}}]),t}(a.Component);Pe.propTypes={siteId:R.a.number.isRequired,setValue:R.a.func.isRequired};var ke=Object(h.b)(function(e,t){var n=t.siteId;return K()({isLoading:Object(je.c)(e,n)&&!Object(je.d)(e,n),isReloading:Object(je.c)(e,n)&&Object(je.d)(e,n),pristine:Object(je.o)(e,n),paymentMethods:Object(je.l)(e,n),paymentMethodsWarning:Object(je.m)(e,n),selectedPaymentMethod:Object(je.n)(e,n),paperSize:Object(je.k)(e,n),storeOptions:Object(je.h)(e,n),canEditPayments:Object(je.q)(e,n),canEditSettings:Object(je.q)(e,n)||Object(je.p)(e,n),emailReceipts:Object(je.e)(e,n)},Object(je.j)(e,n))},function(e){return Object(g.b)({openAddCardDialog:ye.b,fetchSettings:ye.a},e)})(Object(v.localize)(Pe)),Me=n(677),Te=n(535),Ae=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"setValue",function(e,t){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,e,t)}),b()(f()(n),"onEnabledToggle",function(){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,"enabled",!n.props.labelsEnabled)}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.isFetchError,a=e.siteId,i=e.translate;return t?r.a.createElement("p",null,i("Unable to get your settings. Please refresh the page to try again.")):r.a.createElement(ke,{siteId:a,setValue:n.setValue})}),n}return _()(t,e),o()(t,[{key:"componentWillUnmount",value:function(){this.props.restorePristineSettings(this.props.siteId)}},{key:"render",value:function(){var e=this.props,t=e.formMeta,n=e.canManagePayments,a=e.canEditSettings,i=e.labelsEnabled,c=e.siteId,s=e.translate;if(!t)return r.a.createElement(Me.a,{siteId:c});var o=Object(P.isBoolean)(i),u=Object(P.isBoolean)(i)&&!i;return r.a.createElement("div",null,r.a.createElement(Me.a,{siteId:c}),r.a.createElement(q,{label:s("Shipping Labels"),description:s("Print shipping labels yourself and save a trip to the post office")},o&&r.a.createElement(k.a,{checked:i,onChange:this.onEnabledToggle,disabled:Boolean(!n&&!a)})),r.a.createElement(M.a,{size:"small",className:y()("card","label-settings__labels-container",{hidden:u})},this.renderContent()))}}]),t}(a.Component);Ae.propTypes={onChange:R.a.func.isRequired,submit:R.a.func};var Le=Object(h.b)(function(e){return{siteId:Object(Te.a)(e),formMeta:Object(je.g)(e),labelsEnabled:Object(je.a)(e),isFetchError:Object(je.b)(e),canManagePayments:Object(je.q)(e),canEditSettings:Object(je.p)(e)}},function(e){return Object(g.b)({setFormDataValue:ye.d,restorePristineSettings:ye.c},e)})(Object(v.localize)(Ae)),we=n(564),xe=n(682),De=n(648),We=n(678),Ue=n(562),Ve=n(544),Ge=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderListHeader",function(e){var t=n.props.translate;return e&&e.length?r.a.createElement("div",{className:"packages__packages-row packages__packages-header"},r.a.createElement("div",{className:"packages__packages-row-icon"}),r.a.createElement("div",{className:"packages__packages-row-details"},t("Name")),r.a.createElement("div",{className:"packages__packages-row-dimensions"},t("Dimensions")),r.a.createElement("div",{className:"packages__packages-row-actions"})):null}),b()(f()(n),"renderListItem",function(e,t){var a=n.props,i=a.siteId,c=a.isFetching,s=a.form,o=a.translate,u=s.dimensionUnit,l=y()("button","is-compact"),d=null;if(e.is_user_defined){d=r.a.createElement(S.a,{className:l,onClick:function(){n.props.onChange(),n.props.editPackage(i,e)}},o("Edit"))}else{d=r.a.createElement(S.a,{className:l,onClick:function(){n.props.onChange(),n.props.removePredefinedPackage(i,e.serviceId,e.id)}},o("Remove"))}return r.a.createElement(De.a,{key:t,siteId:i,isPlaceholder:c,data:e,dimensionUnit:u},d)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.isFetching,a=t.fetchError,i=t.siteId,c=t.allSelectedPackages,s=t.translate;if(a)return null;var o=n?[{},{},{}]:c;return r.a.createElement("div",null,r.a.createElement(We.a,{siteId:i}),r.a.createElement(q,{label:s("Packaging"),description:s("Add boxes, envelopes, and other packages you use most frequently")},r.a.createElement(S.a,{className:y()("button"),onClick:function(){e.props.onChange(),e.props.addPackage(i)},disabled:n},s("Add package"))),r.a.createElement(M.a,{size:"small",className:y()("card","packages__packages")},this.renderListHeader(o),o.map(this.renderListItem),!n&&r.a.createElement(xe.a,this.props)))}}]),t}(a.Component);Ge.propTypes={addPackage:R.a.func.isRequired,removePackage:R.a.func.isRequired,editPackage:R.a.func.isRequired,dismissModal:R.a.func.isRequired,onChange:R.a.func.isRequired,savePackage:R.a.func.isRequired,updatePackagesField:R.a.func.isRequired,toggleOuterDimensions:R.a.func.isRequired,setModalErrors:R.a.func.isRequired,showModal:R.a.bool,form:R.a.shape({packages:R.a.object,dimensionUnit:R.a.string,weightUnit:R.a.string,packageSchema:R.a.object,predefinedSchema:R.a.oneOfType([R.a.object,R.a.array])}).isRequired};var He=Object(h.b)(function(e){var t=Object(Te.a)(e),n=Object(Ve.e)(e,t)||{};return{siteId:t,isFetching:!n.packages||n.isFetching,fetchError:Object(Ve.g)(e,t),form:n,allSelectedPackages:Object(Ve.b)(e,t)||[]}},function(e){return K()({},Object(g.b)(Ue,e))})(Object(v.localize)(Ge)),Fe=n(111),Be=n.n(Fe),ze=n(77),qe=n.n(ze),Ze=n(636),Ke=n(570),Qe=n(545),Ye=n(550),$e=function(e){var t=e.accountData,n=e.translate,a=e.errorNotice,i=e.successNotice,c=e.siteId,s=r.a.useState(!1),o=qe()(s,2),u=o[0],l=o[1],d=r.a.useState(!1),m=qe()(d,2),p=m[0],f=m[1],E=r.a.useState(t.id),_=qe()(E,2),O=_[0],b=_[1],h=r.a.useCallback(function(){l(!0)},[l]),g=r.a.useCallback(function(){l(!1)},[l]),v=r.a.useCallback(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,Qe.a(c,Qe.e.shippingCarrierDelete(O));case 4:l(!1),i(n("Your carrier account was disconnected succesfully.")),b(null),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),a(n("There was an error trying to disconnect your carrier account"));case 12:f(!1);case 13:case"end":return e.stop()}},e,null,[[1,9]])}));return function(){return e.apply(this,arguments)}})()()},[l,a,i,f,c,b,O]),C=y()("button","is-compact"),N=r.a.useMemo(function(){return[r.a.createElement(S.a,{disabled:p,className:C,onClick:g},n("Cancel")),r.a.createElement(S.a,{isPrimary:!0,disabled:p,isBusy:p,className:y()(C,"is-scary"),onClick:v},n("Disconnect"))]},[g,v,p]);return r.a.createElement("div",{className:"carrier-accounts__list-item"},r.a.createElement("div",{className:"carrier-accounts__list-item-carrier-icon"},r.a.createElement(Ze.a,{carrier:{DhlExpressAccount:"dhlexpress",DhlEcsAccount:"dhlecommerce",DhlEcommerceAsiaAccount:"dhlecommerceasia",UpsAccount:"ups"}[t.type],size:18})),r.a.createElement("div",{className:"carrier-accounts__list-item-name"},r.a.createElement("span",null,t.carrier)),r.a.createElement("div",{className:"carrier-accounts__list-item-credentials"},r.a.createElement("span",null,O?t.account:null)),r.a.createElement("div",{className:"carrier-accounts__list-item-actions"},O?r.a.createElement(S.a,{onClick:h,className:y()(C,"is-scary","is-borderless")},n("Disconnect")):r.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings&carrier=".concat(t.type),className:C},n("Connect"))),r.a.createElement(Ke.a,{isVisible:u,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:g,buttons:N},r.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},r.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},n("Disconnect your %(carrier_name)s account",{args:{carrier_name:t.carrier}})),r.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:g},r.a.createElement(D.a,{icon:"cross"}))),r.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},n("This will remove the connection with %(carrier_name)s. All of your %(carrier_name)s account information will be deleted and you won\u2019t see %(carrier_name)s rates.",{args:{carrier_name:t.carrier}}))))};$e.propTypes={errorNotice:R.a.func.isRequired,successNotice:R.a.func.isRequired,siteId:R.a.number.isRequired,accountData:R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string,type:R.a.string}).isRequired};var Xe={errorNotice:Ye.a,successNotice:Ye.d},Je=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},Xe),v.localize)($e),et=function(e){var t=e.translate,n=e.accounts,a=void 0===n?[]:n;return 0===a.length?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Carrier account"),description:t("Set up your own carrier account by adding your credentials here")}),r.a.createElement(M.a,{size:"small",className:y()("card","carrier-accounts__list")},r.a.createElement("div",{className:"carrier-accounts__header"},r.a.createElement("div",{className:"carrier-accounts__header-icon"}),r.a.createElement("div",{className:"carrier-accounts__header-name"},t("Name")),Object(P.some)(a,"account")&&r.a.createElement("div",{className:"carrier-accounts__header-credentials"},t("Credentials")),r.a.createElement("div",{className:"carrier-accounts__header-actions"})),a.map(function(e,t){return r.a.createElement(Je,{key:t,accountData:e})})))};et.propTypes={accounts:R.a.arrayOf(R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string,type:R.a.string}))};var tt=Object(v.localize)(et),nt=n(820),at=Object(v.localize)(function(e){var t=e.translate;return r.a.createElement(r.a.Fragment,null,r.a.createElement("a",{className:"button is-compact",href:"admin.php?page=wc-settings&tab=shipping§ion"},t("Add to shipping zones")),r.a.createElement(nt.a,{position:"top left",text:t("To be displayed at checkout, this carrier must be added as a shipping method to selected shipping zones")},r.a.createElement("div",null,r.a.createElement(D.a,{icon:"help-outline",size:18}))))}),rt=Object(v.localize)(function(e){return(0,e.translate)("Discounted %(carrierName)s shipping labels",{args:{carrierName:e.name}})}),it={wc_services_usps:function(e){var t=e.translate;return r.a.createElement("div",{className:"live-rates-carriers-list__element element-usps"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"},r.a.createElement(Ze.a,{carrier:"usps",size:18})),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("USPS")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},r.a.createElement("ul",null,r.a.createElement("li",null,t("Ship with the largest delivery network in the United States")),r.a.createElement("li",null,r.a.createElement(rt,{name:t("USPS")})),r.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("USPS")}})))),r.a.createElement("div",{className:"live-rates-carriers-list__actions"},r.a.createElement(at,null)))},wc_services_dhlexpress:function(e){var t=e.translate;return r.a.createElement("div",{className:"live-rates-carriers-list__element element-dhlexpress"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"},r.a.createElement(Ze.a,{carrier:"dhlexpress",size:18})),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("DHL Express")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},r.a.createElement("ul",null,r.a.createElement("li",null,t("Express delivery from the experts in international shipping")),r.a.createElement("li",null,r.a.createElement(rt,{name:t("DHL Express")})),r.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("DHL Express")}})))),r.a.createElement("div",{className:"live-rates-carriers-list__actions"},r.a.createElement(at,null)))}},ct=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return r.a.createElement(V,{className:"live-rates-carriers-list__wrapper"},r.a.createElement("div",{className:"live-rates-carriers-list__heading"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"}),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("Carrier")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},t("Features")),r.a.createElement("div",{className:"live-rates-carriers-list__actions"})),n.map(function(e){var n=it[e];return n?r.a.createElement(n,{key:e,translate:t}):null}))}),st=["wc_services_usps","wc_services_dhlexpress"],ot=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return!1===n.some(function(e){return st.includes(e)})?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Live rates at checkout"),description:t("Show live rates directly on your store - never under or overcharge for shipping again")}),r.a.createElement(ct,{carrierIds:n}))}),ut=function(e){var t=e.translate,n=e.data,a=e.errorNotice,i=e.successNotice,c=e.siteId,s=r.a.useState(n.is_active),o=qe()(s,2),u=o[0],l=o[1],d=r.a.useState(!1),m=qe()(d,2),p=m[0],f=m[1],E=[],_=!1;n.usage_data.forEach(function(e,t){E.push(r.a.createElement("div",{key:t},e.label,": ",e.count,"/",e.limit)),_=_||e.count>e.limit});var O=y()("button","is-compact");return r.a.createElement("div",{className:"subscriptions-usage__list-item"},r.a.createElement("div",{className:"subscriptions-usage__list-item-carrier-icon"},r.a.createElement(Ze.a,{carrier:function(e){var t=[[/^DHL/g,"dhlexpress"],[/^UPS/g,"ups"],[/^USPS/g,"usps"]],n=t.findIndex(function(t){return qe()(t,1)[0].test(e)});return n>-1?t[n][1]:""}(n.product_name),size:18})),r.a.createElement("div",{className:"subscriptions-usage__list-item-name"},r.a.createElement("span",null,n.product_name)),r.a.createElement("div",{className:y()("subscriptions-usage__list-item-usage",{"is-over-limit":_})},r.a.createElement("span",{className:"subscriptions-usage__list-item-usage-numbers"},E),r.a.createElement(nt.a,{text:t("Your store is over the limit for rate calls this month and your account will be charged for overages. To prevent future overage charges you can upgrade your plan.")},r.a.createElement("span",{className:"subscriptions-usage__list-item-usage-icon"},r.a.createElement(D.a,{icon:"info-outline",size:18})))),r.a.createElement("div",{className:"subscriptions-usage__list-item-actions"},u?r.a.createElement("a",{href:"https://woocommerce.com/my-account/my-subscriptions/",className:O},t("Manage")):r.a.createElement(S.a,{onClick:function(){!function(){var e=Be()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,Qe.c(c,Qe.e.subscriptionActivate(n.product_key));case 4:l(!0),i(t("Your subscription was succesfully activated.")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a(t("There was an error trying to activate your subscription."));case 11:f(!1);case 12:case"end":return e.stop()}},e,null,[[1,8]])}));return function(){return e.apply(this,arguments)}}()()},disabled:p,isBusy:p,className:O},t("Activate"))))};ut.propTypes={errorNotice:R.a.func.isRequired,successNotice:R.a.func.isRequired,siteId:R.a.number.isRequired,data:R.a.shape({product_name:R.a.string.isRequired,is_active:R.a.bool.isRequired,usage_data:R.a.arrayOf(R.a.shape({limit:R.a.number,count:R.a.number,label:R.a.string}))}).isRequired};var lt={errorNotice:Ye.a,successNotice:Ye.d},dt=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},lt),v.localize)(ut),mt=function(e){var t=e.translate,n=e.subscriptions,a=void 0===n?[]:n;return 0===a.length?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Shipping method"),description:t("View and manage your subscription usage")}),r.a.createElement(M.a,{size:"small",className:y()("card","subscriptions-usage__list")},r.a.createElement("div",{className:"subscriptions-usage__header"},r.a.createElement("div",{className:"subscriptions-usage__header-icon"}),r.a.createElement("div",{className:"subscriptions-usage__header-name"},t("Name")),r.a.createElement("div",{className:"subscriptions-usage__header-usage"},t("Usage")),r.a.createElement("div",{className:"subscriptions-usage__header-actions"})),a.map(function(e,t){return r.a.createElement(dt,{key:t,data:e})})))};mt.propTypes={subscriptions:R.a.arrayOf(R.a.shape({product_name:R.a.string.isRequired,usage_limit:R.a.number,usage_count:R.a.number}))};var pt=Object(v.localize)(mt),ft=n(604),Et=n(600),_t=n(580),Ot=n(540),bt=n(618),ht=/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,gt=/^\d{5}$/,vt=/^[a-zA-Z0-9]{6}$/,Ct=/^([a-zA-Z0-9]{9}|[a-zA-Z0-9]{13})$/,St=/^\d{10}$/,Nt=/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/,yt=/^(?:(?:(?:https?|ftp):)?\/\/)*(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i,jt=Object(v.localize)(function(e){var t=e.isVisible,n=e.onCancel,i=e.onConfirm,c=e.translate,s=y()("button","is-compact"),o=Object(a.useMemo)(function(){return[r.a.createElement(S.a,{className:s,onClick:n,key:"cancel"},c("Cancel")),r.a.createElement(S.a,{isPrimary:!0,className:y()(s,"is-scary"),onClick:i,key:"ok"},c("Ok"))]},[n,i,c]);return r.a.createElement(Ke.a,{isVisible:t,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:n,buttons:o},r.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},r.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},c("Cancel connection")),r.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:n},r.a.createElement(D.a,{icon:"cross"}))),r.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},c("This action will delete any information entered on the form.")))}),It=Object(g.d)(Object(h.b)(function(e,t){return{stateNames:Object(Ot.k)(e,t.countryValue)}}),v.localize)(function(e){var t=e.onDropdownUpdate,n=e.onTextFieldUpdate,i=e.error,c=e.stateNames,s=e.translate,o=e.value,u=Object(a.useMemo)(function(){return c?K()({"":s("Select one\u2026")},c):c},[c,s]);return u?r.a.createElement(ft.a,{id:"state",name:"state",title:s("State"),value:o,valuesMap:u,updateValue:t,error:i}):r.a.createElement(_t.a,{id:"state",name:"state",title:s("State"),updateValue:n,error:i})}),Rt=function(e){var t=e.translate,n=e.errorNotice,i=e.successNotice,c=e.countryNames,s=e.siteId,o=Object(a.useState)(!1),u=qe()(o,2),l=u[0],d=u[1],m=Object(a.useState)(!1),p=qe()(m,2),f=p[0],E=p[1],_=Object(a.useState)(!1),O=qe()(_,2),h=O[0],g=O[1],v=Object(a.useState)({country:"US"}),C=qe()(v,2),N=C[0],j=C[1],I=function(e,t,n){var a={},r=["account_number","name","street1","city","state","country","postal_code","phone","email","title","website",t&&"invoice_number",t&&"invoice_date"].filter(Boolean),i=!0,c=!1,s=void 0;try{for(var o,u=r[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var l=o.value,d=e[l];(!d||"string"===typeof d&&""===d.trim())&&(a[l]=n("This field is required"))}}catch(m){c=!0,s=m}finally{try{i||null==u.return||u.return()}finally{if(c)throw s}}return e.account_number&&!e.account_number.match(vt)&&(a.account_number=n("The UPS account number needs to be 6 letters and digits in length")),e.phone&&!e.phone.match(St)&&(a.phone=n("The phone number needs to be 10 digits in length")),"US"===e.country&&e.postal_code&&!e.postal_code.match(gt)&&(a.postal_code=n("The ZIP/Postal code needs to be 5 digits in length")),e.email&&!e.email.match(ht)&&(a.email=n("The email format is not valid")),e.website&&!e.website.match(yt)&&(a.website=n("The company website format is not valid")),t&&e.invoice_number&&!e.invoice_number.match(Ct)&&(a.invoice_number=n("The invoice number needs to be 9 or 13 letters and digits in length")),t&&e.invoice_date&&!e.invoice_date.match(Nt)&&(a.invoice_date=n("The date must be a valid date in the format YYYY-MM-DD")),a}(N,f,t),R=function(e){return N[e]?Object(bt.a)(N[e]):""},P=Object(a.useCallback)(function(e,t){var n=t.currentTarget.id;j(function(t){return K()({},t,b()({},n,e))})},[j]),k=Object(a.useCallback)(function(e,t){j(function(n){return K()({},n,b()({},t,e))})},[j]),T=Object(a.useCallback)(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.prev=1,a=K()({},N,{type:"UpsAccount"}),f||(delete a.invoice_number,delete a.invoice_date,delete a.invoice_amount,delete a.invoice_currency,delete a.invoice_control_id),e.next=6,Qe.c(s,Qe.e.shippingCarrier(),a);case 6:if(e.sent.success){e.next=9;break}throw new Error;case 9:i(t("Your carrier account was connected successfully.")),(r=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=r.href,e.next=20;break;case 16:e.prev=16,e.t0=e.catch(1),d(!1),n(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:"UPS"}}));case 20:case"end":return e.stop()}},e,null,[[1,16]])}));return function(){return e.apply(this,arguments)}})()()},[d,n,i,t,N,f]),A=Object(a.useCallback)(function(){E(function(e){return!e})},[E]),L=Object(a.useCallback)(function(){g(!1)},[g]),w=Object(a.useCallback)(function(){var e=new URL(window.location.href);e.searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=e.href},[]),x=Object(a.useCallback)(function(){g(!0)},[g]),D=y()("button","is-compact");return r.a.createElement("div",{className:"carrier-accounts__settings-container"},r.a.createElement("div",{className:"carrier-accounts__settings"},r.a.createElement("div",{className:"carrier-accounts__settings-info"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your UPS account")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:r.a.createElement("a",{href:"https://docs.woocommerce.com/document/productid-type-permalinks/using-your-own-ups-account-in-woocommerce-shipping/"})}})),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.",{components:{a:r.a.createElement("a",{href:"https://ups.com/"})}}))),r.a.createElement("div",{className:"carrier-accounts__settings-form"},r.a.createElement(M.a,{className:y()("card","is-compact")},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General information")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the account number and address from your UPS profile"))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-account-number","card","is-compact")},r.a.createElement(_t.a,{id:"account_number",title:t("Account number"),updateValue:k,error:"string"===typeof N.account_number?I.account_number:void 0})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-address","card","is-compact")},r.a.createElement(_t.a,{id:"name",title:t("Name"),updateValue:k,error:"string"===typeof N.name?I.name:void 0}),r.a.createElement(_t.a,{id:"street1",title:t("Address"),updateValue:k,error:"string"===typeof N.street1?I.street1:void 0}),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"street2",title:t("Address 2 (optional)"),updateValue:k,error:"string"===typeof N.street2?I.street2:void 0}),r.a.createElement(_t.a,{id:"city",title:t("City"),updateValue:k,error:"string"===typeof N.city?I.city:void 0})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(It,{countryValue:N.country,value:R("state"),onDropdownUpdate:P,onTextFieldUpdate:k,error:"string"===typeof N.state?I.state:void 0}),r.a.createElement(ft.a,{id:"country",title:t("Country"),value:R("country"),valuesMap:c,updateValue:P,error:"string"===typeof N.country?I.country:void 0})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"postal_code",title:t("ZIP/Postal code"),updateValue:k,error:"string"===typeof N.postal_code?I.postal_code:void 0}),r.a.createElement(_t.a,{id:"phone",title:t("Phone"),updateValue:k,error:"string"===typeof N.phone?I.phone:void 0})),r.a.createElement(_t.a,{id:"email",title:t("Email"),updateValue:k,error:"string"===typeof N.email?I.email:void 0})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-company-info","card","is-compact")},r.a.createElement("div",{className:"carrier-accounts__settings-header"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("Company information")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the company info you used to create your UPS account"))),r.a.createElement(_t.a,{id:"company",title:t("Company name"),updateValue:k,error:"string"===typeof N.company?I.company:void 0}),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"title",title:t("Job title"),updateValue:k,error:"string"===typeof N.title?I.title:void 0}),r.a.createElement(_t.a,{id:"website",title:t("Company website"),updateValue:k,error:"string"===typeof N.website?I.website:void 0}))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-ups-info","card","is-compact")},r.a.createElement("div",{className:"carrier-accounts__settings-header"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("UPS account information")),r.a.createElement(Et.a,{id:"enable_ups_invoice_fields",checked:f,onChange:A}),r.a.createElement("span",null,t("I have been issued an invoice from UPS within the past 90 days"))),f&&r.a.createElement("div",{className:"carrier-accounts__settings-ups-invoice"},r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"invoice_number",defaultValue:N.invoice_number,title:t("UPS invoice number"),updateValue:k,error:"string"===typeof N.invoice_number?I.invoice_number:void 0}),r.a.createElement(_t.a,{id:"invoice_date",defaultValue:N.invoice_date,title:t("UPS invoice date"),updateValue:k,error:"string"===typeof N.invoice_date?I.invoice_date:void 0,placeholder:"YYYY-MM-DD"})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"invoice_amount",defaultValue:N.invoice_amount,title:t("UPS invoice amount"),updateValue:k,error:"string"===typeof N.invoice_amount?I.invoice_amount:void 0}),r.a.createElement(_t.a,{id:"invoice_currency",defaultValue:N.invoice_currency,title:t("UPS invoice currency"),updateValue:k,error:"string"===typeof N.invoice_currency?I.invoice_currency:void 0})),r.a.createElement(_t.a,{id:"invoice_control_id",defaultValue:N.invoice_control_id,title:t("UPS invoice control id"),updateValue:k,error:"string"===typeof N.invoice_control_id?I.invoice_control_id:void 0}))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-actions","card","is-compact")},r.a.createElement(S.a,{isPrimary:!0,className:D,onClick:T,disabled:Object.keys(I).length>0||l,isBusy:l},t("Connect")),r.a.createElement(S.a,{className:D,onClick:x},t("Cancel")))),r.a.createElement(jt,{isVisible:h,onConfirm:w,onCancel:L})))};Rt.propTypes={siteId:R.a.number,countryNames:R.a.object,translate:R.a.func,errorNotice:R.a.func,successNotice:R.a.func};var Pt={errorNotice:Ye.a,successNotice:Ye.d},kt=Object(g.d)(Object(h.b)(function(e){return{countryNames:Object(Ot.c)(e),siteId:Object(Te.a)(e)}},Pt),v.localize)(Rt),Mt=function(e){var t=e.visibility,n=e.label,i=e.id,c=e.value,s=e.onChange,o=Object(a.useCallback)(function(){s(i,!c)},[i,c,s]),u=Object(a.useCallback)(function(e){s(i,e)},[i,c,s]);switch(t){case"select":case"checkbox":return r.a.createElement(r.a.Fragment,null,r.a.createElement(Et.a,{id:i,onChange:o,checked:c||!1}),r.a.createElement("label",{htmlFor:i},r.a.createElement("span",null,n)));case"invisible":case"masked":case"readonly":case"password":case"visible":default:return r.a.createElement(_t.a,{id:i,title:n,updateValue:u})}},Tt=function(e){var t=e.translate,n=e.siteId,i=e.carrierType,c=e.errorNotice,s=e.successNotice,o=e.carrierName,u=e.carrierDescription,l=e.registrationFields,d=Object(a.useState)({}),m=qe()(d,2),p=m[0],f=m[1],E=Object(a.useState)(!1),_=qe()(E,2),O=_[0],h=_[1],g=Object(a.useCallback)(function(e,t){f(function(n){return K()({},n,b()({},e,t))})},[f]),v=Object(a.useCallback)(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,Qe.c(n,Qe.e.shippingCarrier(),K()({},p,{type:i}));case 4:if(e.sent.success){e.next=7;break}throw new Error;case 7:s(t("Your carrier account was connected successfully.")),(a=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=a.href,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),c(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:o}}));case 17:h(!1);case 18:case"end":return e.stop()}},e,null,[[1,14]])}));return function(){return e.apply(this,arguments)}})()()},[O,h,n,i,o,p,c,t]),C=Object(a.useCallback)(function(){history.back()},[]),N=y()("button","is-compact");return r.a.createElement("div",{className:"carrier-accounts__settings-container"},r.a.createElement("div",{className:"carrier-accounts__settings"},r.a.createElement("div",{className:"carrier-accounts__settings-info"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your %(carrierName)s account",{args:{carrierName:o}})),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},u||t("Set up your own carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:r.a.createElement("a",{href:"https://docs.woocommerce.com/document/using-your-own-carrier-account-in-woocommerce-shipping"})}}))),r.a.createElement("div",{className:"carrier-accounts__settings-form"},r.a.createElement(M.a,{className:y()("card","is-compact")},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General Information"))),r.a.createElement(M.a,{className:y()("card","is-compact")},l&&Object.entries(l).map(function(e){var t=qe()(e,2),n=t[0],a=t[1];return r.a.createElement(Mt,{key:n,id:n,visibility:a.visibility,label:a.label,value:p[n],onChange:g})})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-actions","card","is-compact")},r.a.createElement(S.a,{isPrimary:!0,className:N,onClick:v,disabled:O},t("Connect")),r.a.createElement(S.a,{isSecondary:!0,className:N,onClick:C},t("Cancel"))))))},At={errorNotice:Ye.a,successNotice:Ye.d};Tt.propTypes={errorNotice:R.a.func,successNotice:R.a.func,carrierType:R.a.string,carrierName:R.a.string,carrierDescription:R.a.string,registrationFields:R.a.object,siteId:R.a.number,translate:R.a.func};var Lt=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},At),v.localize)(Tt),wt=function(e){var t=e.translate,n=Object(a.useState)([]),i=qe()(n,2),c=i[0],s=i[1];if(Object(a.useEffect)(function(){(function(){var t=Be()(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qe.b(e.siteId,Qe.e.shippingCarrierTypes());case 2:n=t.sent,s(n.carriers);case 4:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}})()()},[e.siteId,s]),!c||0===c.length)return r.a.createElement("div",null,t("Loading"),"...");var o=c.filter(function(t){return t.type===e.carrier}),u=qe()(o,1)[0];return u?r.a.createElement("div",null,r.a.createElement(Lt,{carrierType:u.type,carrierName:u.name,carrierDescription:u.description,registrationFields:u.fields})):r.a.createElement("div",null,t("%(carrierName)s not supported.",{args:{carrierName:e.carrier}}))};wt.propTypes={carrier:R.a.string.isRequired,siteId:R.a.number};var xt=Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}})(Object(v.localize)(wt)),Dt=n(675),Wt=n(649),Ut=function(e){function t(e){var n;return c()(this,t),n=l()(this,m()(t).call(this,e)),b()(f()(n),"onChange",function(){n.setState({pristine:!1})}),b()(f()(n),"onSaveSuccess",function(){var e=n.props,t=e.translate,a=e.orderId,r=e.orderHref,i=e.paymentMethodSelected,c=r&&i?{button:t("Return to Order #%(orderId)s",{args:{orderId:a}}),href:r}:{duration:5e3};return n.setState({pristine:!0}),n.props.successNotice(t("Your shipping settings have been saved."),c)}),b()(f()(n),"onSaveFailure",function(){var e=n.props.translate;return n.props.errorNotice(e("Unable to save your shipping settings. Please try again."))}),b()(f()(n),"onSaveChanges",function(){n.props.createWcsShippingSaveActionList(n.onSaveSuccess,n.onSaveFailure)}),n.state={pristine:!0},n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.carrier,n=e.carrierAccounts,a=e.liveRatesTypes,i=e.subscriptions,c=e.isSaving,s=e.translate;return t?"UpsAccount"===t?r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(kt,null)):r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(xt,{carrier:t})):r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(Le,{onChange:this.onChange}),r.a.createElement(He,{onChange:this.onChange}),r.a.createElement(ot,{carrierIds:a}),r.a.createElement(tt,{accounts:n}),r.a.createElement(pt,{subscriptions:i}),r.a.createElement(S.a,{isPrimary:!0,className:y()("button"),onClick:this.onSaveChanges,isBusy:c,disabled:c},s("Save changes")),r.a.createElement(Dt.a,{isChanged:!this.state.pristine}))}}]),t}(a.Component),Vt=Object(h.b)(function(e){var t=Object(je.g)(e),n=Object(Ve.e)(e);return{isSaving:t.isSaving||n.isSaving,paymentMethodSelected:Boolean(Object(je.n)(e))}},function(e){return Object(g.b)({createWcsShippingSaveActionList:Wt.a,errorNotice:Ye.a,successNotice:Ye.d},e)})(Object(v.localize)(Ut)),Gt=n(656),Ht=n(655),Ft=n(592),Bt=n(661),zt=n(637),qt=n(662),Zt=n(611),Kt=n(116),Qt=n(46);t.default=function(e){var t=e.order_id,n=e.order_href,a=e.carrier,i=e.continents,c=e.carrier_accounts,s=e.live_rates_types,o=e.subscriptions;return{getReducer:function(){return Object(Qt.a)({extensions:Object(Qt.a)({woocommerce:Object(Qt.a)({woocommerceServices:Object(Qt.a)({1:Object(Qt.a)({packages:Ht.a,labelSettings:Gt.a})}),sites:Object(Qt.a)({1:Object(Qt.a)({data:Object(Qt.a)({locations:qt.a})})})})}),notices:Ft.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{data:{locations:i}}}}}}},getStateForPersisting:function(e){return delete e.notices,e},getStateKey:function(){return"wcs-account-settings"},getMiddlewares:function(){return[Object(Kt.b)(Object(Zt.a)(zt.a,Bt.a))]},View:function(){return r.a.createElement(Vt,{orderId:t,orderHref:n,carrier:a,carrierAccounts:c,liveRatesTypes:s,subscriptions:o})}}}}}]);
|
dist/chunks/{330cd35f20d6afaae4c1.css → 22a59c0c632bd2d30080.css}
RENAMED
File without changes
|
dist/chunks/{330cd35f20d6afaae4c1.min.js → 22a59c0c632bd2d30080.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{536:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(565);function r(e){return e.ui.selectedSiteId}},538:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return s}),n.d(t,"g",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"i",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"p",function(){return b}),n.d(t,"q",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"s",function(){return _}),n.d(t,"t",function(){return g}),n.d(t,"u",function(){return I}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return S}),n.d(t,"A",function(){return h}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return P}),n.d(t,"E",function(){return y}),n.d(t,"D",function(){return M}),n.d(t,"B",function(){return N}),n.d(t,"F",function(){return T}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return L}),n.d(t,"I",function(){return k}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return w}),n.d(t,"m",function(){return W}),n.d(t,"n",function(){return G}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return H}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return Q}),n.d(t,"Y",function(){return K}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return J}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return $}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ie}),n.d(t,"ib",function(){return ae}),n.d(t,"jb",function(){return oe}),n.d(t,"kb",function(){return ce}),n.d(t,"lb",function(){return ue}),n.d(t,"mb",function(){return se}),n.d(t,"nb",function(){return de}),n.d(t,"ob",function(){return fe}),n.d(t,"pb",function(){return le}),n.d(t,"rb",function(){return Oe}),n.d(t,"qb",function(){return Ee}),n.d(t,"sb",function(){return be}),n.d(t,"tb",function(){return pe}),n.d(t,"ub",function(){return me}),n.d(t,"vb",function(){return _e}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return Ie}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Se}),n.d(t,"Ab",function(){return he}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Ce}),n.d(t,"Db",function(){return Re}),n.d(t,"Eb",function(){return Pe}),n.d(t,"Fb",function(){return ye}),n.d(t,"Gb",function(){return Me}),n.d(t,"Hb",function(){return Ne}),n.d(t,"Ib",function(){return Te}),n.d(t,"U",function(){return Ae}),n.d(t,"V",function(){return Le}),n.d(t,"S",function(){return ke}),n.d(t,"T",function(){return De});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",i="WOOCOMMERCE_ACTION_LIST_CLEAR",a="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",o="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",c="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",u="WOOCOMMERCE_COUNT_REQUEST",s="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",d="WOOCOMMERCE_COUNT_REQUEST_FAILURE",f="WOOCOMMERCE_ERROR_SET",l="WOOCOMMERCE_ERROR_CLEAR",O="WOOCOMMERCE_LOCATIONS_REQUEST",E="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",b="WOOCOMMERCE_ORDER_DELETE",p="WOOCOMMERCE_ORDER_DELETE_FAILURE",m="WOOCOMMERCE_ORDER_DELETE_SUCCESS",_="WOOCOMMERCE_ORDER_INVOICE_SEND",g="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",I="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",h="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",C="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",R="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE",y="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",M="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",N="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",T="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",L="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",k="WOOCOMMERCE_ORDER_UPDATE",D="WOOCOMMERCE_ORDER_UPDATE_FAILURE",w="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",W="WOOCOMMERCE_ORDERS_REQUEST",G="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",H="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",x="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",Q="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",K="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",J="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",$="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",ue="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",se="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",de="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",le="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Me="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Ne="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Te="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Le="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",ke="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",De="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},540:function(e,t,n){"use strict";n.d(t,"j",function(){return E}),n.d(t,"t",function(){return b}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"h",function(){return _}),n.d(t,"g",function(){return g}),n.d(t,"v",function(){return I}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return S}),n.d(t,"e",function(){return h}),n.d(t,"l",function(){return j}),n.d(t,"p",function(){return C}),n.d(t,"n",function(){return M}),n.d(t,"f",function(){return A}),n.d(t,"o",function(){return L}),n.d(t,"q",function(){return k}),n.d(t,"d",function(){return D}),n.d(t,"b",function(){return w}),n.d(t,"i",function(){return W}),n.d(t,"c",function(){return G}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return H});var r=n(1),i=n(34),a=n(546),o=n(536),c=n(558),u=n(549),s=n(544),d=n(573),f=n(578),l=n(574),O=n(575),E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.isFetching},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.error},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded?r.labels:[]},g=function(e,t,n,r){return _(e,t,n).find(function(e){return e.label_id===r})},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.emailDetails},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.refreshedLabelStatus},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),a=h(e,t,n);if(!a)return null;var c=a.rates,u=c.values,s=c.available,d=[],f=0,l=0,O=function(e){if(!(e in s))return"continue";var t=u[e],n=t.serviceId,a=t.signatureRequired,o=s[e].default.rates,c=null,O=null;a in s[e]&&(c=s[e][a].rates,O=Object(r.find)(c,function(e){return n===e.service_id})||null);var E=Object(r.find)(o,function(e){return n===e.service_id});if(E){var b=E.retail_rate-E.rate,p=E.rate,m={title:E.title,retailRate:E.retail_rate,rateWithDiscount:p,addons:[],carrierId:E.carrier_id,carrierTitle:E.title.split("-")[0].trim()};null!==O&&(m.addons=[{title:Object(i.translate)("Signature Required"),rate:O.rate-E.rate}],p=O.rate),d.push(m),f+=Object(r.round)(b,2),l+=p}};for(var E in u)O(E);return d.length?{prices:d,discount:f,total:l}:null},C=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(Object(r.isEmpty)(i))return!1;var a=Object(d.a)(i.origin);if("US"===a.country&&Object(r.includes)(f.d,a.state))return!0;var c=Object(d.a)(i.destination);return!("US"!==c.country||!Object(r.includes)(f.d,c.state))||a.country!==c.country},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n)]}),R=function(e,t,n,a){var o=t.values,c=Object(d.a)(t),u=c.phone,s=c.postcode,O=c.state,E=c.country,b={};return["name","address","city","postcode","country"].forEach(function(e){o[e]||(b[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(f.a,E)&&!/^\d{5}(?:-\d{4})?$/.test(s)&&(b.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!O&&Object(l.j)(e,E,n)&&(b.state=Object(i.translate)("This field is required")),a&&(u?10!==u.split(/\D+/g).join("").replace(/^1/,"").length&&(b.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):b.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),b},P=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.isNormalized,o=e.isUnverifiable,c=e.normalized,u=e.ignoreValidation,s=e.fieldErrors;if((a||o)&&!c&&s)return s;if(a&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var d=R(t,e,n,r);return u&&Object.keys(d).forEach(function(e){u[e]&&delete d[e]}),d},y=function(e,t,n,a){var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(o,Object(r.fill)(Array(o.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var u={};return Object(r.forEach)(Object(r.pick)(t.items,o),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(u[e.tariffNumber]||(u[e.tariffNumber]=0),u[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var o={};"other"!==e.contentsType||e.contentsExplanation||(o.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(o.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<u[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(o.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(f.c,n)&&(o.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:a}})):o.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),o}),items:Object(r.mapValues)(Object(r.pick)(t.items,o),function(e,n){var a={};return e.description||(a.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?a.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),a})}},M=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},N=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var a=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return a.length?a:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},T=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},A=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!b(e,t,n))return{};var a=E(e,t,n),c=a.form,u=a.paperSize;if(Object(r.isEmpty)(c))return{};var s,d=c.destination.values.country,f=Object(l.g)(e,d,n),O=C(e,t,n);return{origin:P(c.origin,e,n,O),destination:P(c.destination,e,n),packages:(s=c.packages.selected,Object(r.mapValues)(s,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:y(c.packages.selected,c.customs,d,f),rates:N(c.rates),sidebar:T(u)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[E(e,t,n)]}),L=Object(a.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e),i=E(e,t,r).form,a="origin"===n&&C(e,t,r),c=R(e,i[n],r,a);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);return[E(e,t,r).form[n]]}),k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return!1;var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(a.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},D=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return null;var a=A(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(a.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(a.destination)?Object(c.a)(a.packages)?"packages":!C(e,t,n)||!Object(c.a)(a.customs)&&k(e,t,n)?Object(c.a)(a.rates)?"rates":null:"customs":"destination":"origin"},w=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);return!Object(r.isEmpty)(i)&&!D(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n),D(e,t,n)]}),W=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?Object(r.pick)(n,f.a):Object(r.pick)(n,f.b)},[l.d,O.b]),G=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?n:Object(r.pick)(n,f.b)},[l.d,O.b]),U=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!Object(l.j)(e,t,n))return null;var i=Object(l.i)(e,t,n),a={};return i.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),"US"!==t||Object(O.b)(e,n)?a:Object(r.omit)(a,f.d)},[l.i,O.b]),H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return b(e,t,n)&&Object(u.d)(e,n)&&Object(s.i)(e,n)&&Object(l.b)(e,n)}},541:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"f",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"m",function(){return b}),n.d(t,"n",function(){return p}),n.d(t,"o",function(){return m}),n.d(t,"q",function(){return _}),n.d(t,"p",function(){return g}),n.d(t,"r",function(){return I}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return S}),n.d(t,"u",function(){return h}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"B",function(){return R}),n.d(t,"x",function(){return P}),n.d(t,"C",function(){return y}),n.d(t,"z",function(){return M}),n.d(t,"A",function(){return N}),n.d(t,"D",function(){return T}),n.d(t,"E",function(){return A}),n.d(t,"F",function(){return L}),n.d(t,"G",function(){return k}),n.d(t,"H",function(){return D}),n.d(t,"I",function(){return w}),n.d(t,"J",function(){return W}),n.d(t,"K",function(){return G}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return H}),n.d(t,"N",function(){return V}),n.d(t,"y",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return Q}),n.d(t,"U",function(){return K}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return J}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return $}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return re}),n.d(t,"cb",function(){return ie}),n.d(t,"db",function(){return ae}),n.d(t,"eb",function(){return oe}),n.d(t,"fb",function(){return ce}),n.d(t,"gb",function(){return ue}),n.d(t,"hb",function(){return se}),n.d(t,"ib",function(){return de}),n.d(t,"jb",function(){return fe}),n.d(t,"kb",function(){return le}),n.d(t,"lb",function(){return Oe}),n.d(t,"nb",function(){return Ee}),n.d(t,"mb",function(){return be}),n.d(t,"ob",function(){return pe}),n.d(t,"pb",function(){return me}),n.d(t,"qb",function(){return _e}),n.d(t,"rb",function(){return ge}),n.d(t,"sb",function(){return Ie}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return Se}),n.d(t,"vb",function(){return he}),n.d(t,"wb",function(){return je}),n.d(t,"xb",function(){return Ce}),n.d(t,"zb",function(){return Re}),n.d(t,"Ab",function(){return Pe}),n.d(t,"Bb",function(){return ye}),n.d(t,"Cb",function(){return Me}),n.d(t,"Db",function(){return Ne}),n.d(t,"Eb",function(){return Te}),n.d(t,"Fb",function(){return Ae}),n.d(t,"Gb",function(){return Le}),n.d(t,"Hb",function(){return ke}),n.d(t,"Ib",function(){return De}),n.d(t,"Jb",function(){return we}),n.d(t,"yb",function(){return We}),n.d(t,"Lb",function(){return Ge}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return He}),n.d(t,"Nb",function(){return Ve}),n.d(t,"Pb",function(){return Fe}),n.d(t,"Qb",function(){return xe}),n.d(t,"Rb",function(){return Be});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",d="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",f="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",O="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",E="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",b="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",m="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",I="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",h="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",P="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",He="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",xe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},542:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},544:function(e,t,n){"use strict";n.d(t,"e",function(){return E}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return _}),n.d(t,"c",function(){return g}),n.d(t,"f",function(){return I}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return S}),n.d(t,"g",function(){return h});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(34),s=n(546),d=n(536),f=n(578),l=n(573),O=n(540),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},b=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},p=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(o()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return o()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),m=Object(s.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(O.e)(e,t,n),a=Object(l.a)(i.origin).country,o=Object(l.a)(i.destination).country,s=f.a.includes(a)&&!f.a.includes(o),b={custom:{title:Object(u.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){s&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(b[t]=i)})}),b},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.packages)return[];var a=b(r),o=Object(O.e)(e,t,n),c=Object(l.a)(o.origin).country,u=Object(l.a)(o.destination).country;return[].concat(i()(r.packages.custom||[]),i()(a.map(function(e){return(r.packages.predefined||{})[e]})),[c,u])}),_=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,a=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=a[t]||[];Object(c.forEach)(e,function(e,i){var a={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&a.selected++,a.packages.push(o()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=a})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),I=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=0,r=0,i=E(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var a=i.packages&&i.packages.predefined?i.packages.predefined:{},o=i.currentlyEditingPredefinedPackages;return Object.keys(o).forEach(function(e){var t=a[e],r=o[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(a).forEach(function(e){var t=a[e],n=o[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isLoaded},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetching},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetchError}},545:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return S}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return C});var r={};n.r(r),n.d(r,"accountSettings",function(){return a}),n.d(r,"packages",function(){return o}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return u}),n.d(r,"labelsStatus",function(){return s}),n.d(r,"labelRefund",function(){return d}),n.d(r,"labelsPrint",function(){return f}),n.d(r,"labelTestPrint",function(){return l}),n.d(r,"addressNormalization",function(){return O}),n.d(r,"serviceSettings",function(){return E}),n.d(r,"shippingCarrier",function(){return b}),n.d(r,"shippingCarriers",function(){return p}),n.d(r,"subscriptions",function(){return m}),n.d(r,"subscriptionActivate",function(){return _}),n.d(r,"shippingCarrierDelete",function(){return g}),n.d(r,"shippingCarrierTypes",function(){return I});var i=n(572),a="connect/account/settings",o="connect/packages",c=function(e){return"connect/label/".concat(e)},u=function(e){return"connect/label/".concat(e,"/rates")},s=function(e,t){return"connect/label/".concat(e,"/").concat(t.join())},d=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},f=function(){return"connect/label/print"},l=function(){return"connect/label/preview"},O=function(){return"connect/normalize-address"},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},b=function(){return"connect/shipping/carrier"},p=function(){return"connect/shipping/carriers"},m=function(){return"connect/subscriptions"},_=function(e){return"connect/subscription/".concat(e,"/activate")},g=function(e){return"connect/shipping/carrier/".concat(e)},I=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},S=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(v)},h=function(e,t,n){return Object(i.a)(e).put(t,n,"wc/v1").catch(v)},j=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(v)},C=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(v)}},546:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n(624),a=n.n(i),o=(n(113),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},u=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,s=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=u(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!a()(c,t)&&s.cache.clear(),t=c,s.apply(void 0,[e].concat(i))},{memoizedSelector:s})}},547:function(e,t,n){"use strict";n.d(t,"q",function(){return P}),n.d(t,"U",function(){return y}),n.d(t,"P",function(){return L}),n.d(t,"x",function(){return k}),n.d(t,"A",function(){return D}),n.d(t,"o",function(){return w}),n.d(t,"p",function(){return W}),n.d(t,"V",function(){return G}),n.d(t,"C",function(){return U}),n.d(t,"m",function(){return H}),n.d(t,"n",function(){return V}),n.d(t,"g",function(){return F}),n.d(t,"T",function(){return x}),n.d(t,"W",function(){return B}),n.d(t,"w",function(){return z}),n.d(t,"v",function(){return q}),n.d(t,"s",function(){return Z}),n.d(t,"d",function(){return Q}),n.d(t,"S",function(){return K}),n.d(t,"t",function(){return Y}),n.d(t,"b",function(){return J}),n.d(t,"E",function(){return X}),n.d(t,"a",function(){return $}),n.d(t,"i",function(){return ee}),n.d(t,"G",function(){return te}),n.d(t,"F",function(){return ne}),n.d(t,"R",function(){return re}),n.d(t,"Q",function(){return ie}),n.d(t,"D",function(){return ae}),n.d(t,"O",function(){return oe}),n.d(t,"H",function(){return ce}),n.d(t,"J",function(){return ue}),n.d(t,"L",function(){return se}),n.d(t,"K",function(){return de}),n.d(t,"I",function(){return fe}),n.d(t,"h",function(){return le}),n.d(t,"Y",function(){return Oe}),n.d(t,"M",function(){return Ee}),n.d(t,"N",function(){return be}),n.d(t,"B",function(){return he}),n.d(t,"j",function(){return je}),n.d(t,"y",function(){return Ce}),n.d(t,"r",function(){return Re}),n.d(t,"e",function(){return Pe}),n.d(t,"k",function(){return ye}),n.d(t,"z",function(){return Me}),n.d(t,"f",function(){return Ne}),n.d(t,"l",function(){return Te}),n.d(t,"X",function(){return Ae}),n.d(t,"u",function(){return Le}),n.d(t,"c",function(){return ke});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(34),u=n(1),s=n(545),d=Object(u.memoize)(function(){if(Object(u.get)(window,"navigator.msSaveOrOpenBlob"))return"ie";if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(Object(u.includes)(navigator.userAgent,"Firefox"))return"addon";if(Object(u.includes)(navigator.userAgent,"Safari")&&!Object(u.includes)(navigator.userAgent,"Chrome"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),f=null,l=function(e){return new Promise(function(t,n){f&&document.body.removeChild(f),(f=document.createElement("iframe")).src=e,f.style.position="fixed",f.style.left="-999px",f.onload=function(){t()},f.onerror=function(e){n(e)},document.body.appendChild(f)})},O=function(e,t){var n=function(e,t){for(var n=atob(e),r=n.length,i=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++)i[a]=n.charCodeAt(a);return new Blob([i],{type:t})}(e.b64Content,e.mimeType),r="ie"!==d()?URL.createObjectURL(n):null;switch(d()){case"native":return l(r).then(function(){f.contentWindow.print(),URL.revokeObjectURL(r)});case"addon":var i=window.open(r);return setTimeout(function(){return URL.revokeObjectURL(r)},1e3),i?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));case"ie":return window.navigator.msSaveOrOpenBlob(n,t)?Promise.resolve():Promise.reject(new Error("Unable to download the PDF"));default:return l(r),setTimeout(function(){return URL.revokeObjectURL(r)},0),Promise.resolve()}},E=n(550),b=n(558),p=n(541),m=function(e,t,n,r,i){n({type:p.A,group:i,orderId:e,siteId:t});return s.c(t,s.e.addressNormalization(),{address:r,type:i}).then(function(r){n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!0,fieldErrors:r.field_errors,normalized:r.normalized,isTrivialNormalization:r.is_trivial_normalization})}).catch(function(r){throw n(E.a(Object(c.translate)("Error validating %(group)s address: %(error)s",{args:{group:i,error:r}}))),n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!1}),r})},_=n(621),g=n(540),I=n(690),v=n(642),S=n(544),h=n(549),j=n(573),C="label-image-download-failed",R="label-image-download-printing",P=function(e,t){return function(n){n({type:p.wb,orderId:e,siteId:t,isFetching:!0}),s.b(t,s.e.orderLabels(e)).then(function(r){n(o()({type:p.O,siteId:t,orderId:e},r))}).catch(function(r){n({type:p.ub,orderId:e,siteId:t,error:!0}),console.error(r)}).then(function(){return n({type:p.wb,orderId:e,siteId:t,isFetching:!1})})}},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:p.Hb,siteId:t,orderId:e,stepName:n,expanded:r}},M=function(e,t,n,r){var i=r(),a=Object(g.j)(i,e,t).form,o=Object(g.d)(i,e,t);o&&!a[o].expanded&&n(y(e,t,o))},N=function(e,t){var n=Object(u.pick)(e,["id","box_id","service_id","length","width","height","weight","signature","is_letter"]);return t&&(n.contents_type=e.contentsType||"merchandise","other"===e.contentsType&&(n.contents_explanation=e.contentsExplanation),n.restriction_type=e.restrictionType||"none","other"===e.restrictionType&&(n.restriction_comments=e.restrictionComments),n.non_delivery_option=e.abandonOnNonDelivery?"abandon":"return",n.itn=e.itn||"",n.items=Object(u.uniqBy)(e.items,"product_id").map(function(n){var r=n.product_id,i=Object(u.sumBy)(Object(u.filter)(e.items,{product_id:r}),"quantity");return{description:t[r].description,quantity:i,value:i*t[r].value,weight:i*t[r].weight,hs_tariff_number:t[r].tariffNumber||"",origin_country:t[r].originCountry,product_id:r}})),n},T=function(e,t){return{type:p.D,orderId:e,siteId:t}},A=function e(t,n,r,i){var a=i(),o=Object(g.d)(a,t,n);if(o&&"rates"!==o)M(t,n,r,i);else{var d=Object(g.j)(a,t,n).form,f=d.origin,l=d.destination,O=d.packages,b=d.customs;r(E.c("wcs-label-rates"));var m=Object(g.p)(i(),t,n)?b.items:null,_=Object(u.map)(O.selected,function(e){return N(e,m)});(function(e,t,n,r,i,a){var o={origin:r,destination:i,packages:a};return n({type:p.ab,requestData:o,siteId:t,orderId:e}),new Promise(function(r,i){var a=null,c=function(c){c||(n({type:p.Z,requestData:o,siteId:t,orderId:e}),a?setTimeout(function(){return i(a)},0):setTimeout(r,0))};c(!0),s.c(t,s.e.getLabelRates(e),o).then(function(r){n({type:p.Ab,rates:r.rates,requestData:o,siteId:t,orderId:e})}).catch(function(e){return a=e}).then(function(){return c(!1)})})})(t,n,r,f.values,l.values,_).then(function(){return M(t,n,r,i)}).catch(function(a){console.error(a),r(E.a(a.toString(),{id:"wcs-label-rates",button:Object(c.translate)("Retry"),onClick:function(){return e(t,n,r,i)}}))})}},L=function(e,t,n,r){return function(i,a){var o=Object(S.a)(a(),t)[r];i({type:p.zb,siteId:t,orderId:e,packageId:n,boxTypeId:r,box:o})}},k=function(e,t){return function(n,r){var i,a=Object(g.j)(r(),e,t).form,o=a.origin,c=a.destination,u=Object(g.f)(r(),e,t),s=[];o.ignoreValidation||Object(b.a)(u.origin)||o.isNormalized||o.normalizationInProgress||s.push(m(e,t,n,o.values,"origin")),(o.ignoreValidation||Object(b.a)(u.origin))&&n(y(e,t,"origin")),c.ignoreValidation||Object(b.a)(u.destination)||c.isNormalized||c.normalizationInProgress||s.push(m(e,t,n,c.values,"destination")),(c.ignoreValidation||Object(b.a)(u.destination))&&n(y(e,t,"destination")),(i=s,Promise.all(i.map(function(e){return e.catch(function(e){return e})}))).then(function(){return A(e,t,n,r)}).then(function(){var i=function(e,t,n){var r=n(),i=Object(h.i)(r,t),a=Object(g.j)(r,e,t),o=a.form.packages.selected,c=a.openedPackageId,u=o[c];if(u&&"not_selected"===u.box_id&&i.last_box_id)return{packageId:c,boxId:i.last_box_id}}(e,t,r)||{},a=i.packageId,o=i.boxId;void 0!==a&&void 0!==o&&n(L(e,t,a,o))}),n({type:p.U,orderId:e,siteId:t})}},D=function(e,t){return function(n){n({type:p.Ob,orderId:e,siteId:t})}},w=function(e,t,n){return function(r,i){r({type:p.N,orderId:e,siteId:t,force:n}),Object(g.j)(i(),e,t).form.needsPrintConfirmation&&r(T(e,t))}},W=function(e,t){return function(n){n({type:p.y,orderId:e,siteId:t})}},G=function(e,t,n,r,i){return{type:p.Ib,siteId:t,orderId:e,group:n,name:r,value:i}},U=function(e,t,n,r){return{type:p.jb,siteId:t,orderId:e,group:n,selectNormalized:r}},H=function(e,t,n){return{type:p.L,siteId:t,orderId:e,group:n}},V=function(e,t,n){return{type:p.M,siteId:t,orderId:e,group:n}},F=function(e,t,n){return function(r,i){r({type:p.J,siteId:t,orderId:e,group:n}),A(e,t,r,i)}},x=function(e,t,n){return function(r,i){var a=Object(g.j)(i(),e,t).form[n];if(a.ignoreValidation){r(function(e,t,n){return{type:p.db,siteId:t,orderId:e,group:n}}(e,t,n));var o=Object(g.f)(i(),e,t);if(Object(b.a)(o[n]))return;a=Object(g.j)(i(),e,t).form[n]}return m(e,t,r,Object(g.j)(i(),e,t).form[n].values,n).then(function(){var a=Object(g.j)(i(),e,t).form[n],o=a.values,c=a.normalized,s=a.expanded;Object(u.isEqual)(o,c)&&(s&&r(y(e,t,n)),A(e,t,r,i))})}},B=function(e,t,n,r){return{type:p.Jb,siteId:t,orderId:e,packageId:n,value:r}},z=function(e,t,n){return{type:p.T,siteId:t,orderId:e,openedPackageId:n}},q=function(e,t,n){return{type:p.S,siteId:t,orderId:e,movedItemIndex:n}},Z=function(e,t,n,r,i){return{type:p.P,siteId:t,orderId:e,originPackageId:n,movedItemIndex:r,targetPackageId:i}},Q=function(e,t){return{type:p.G,siteId:t,orderId:e}},K=function(e,t,n){return{type:p.Db,targetPackageId:n,siteId:t,orderId:e}},Y=function(e,t){return{type:p.Q,siteId:t,orderId:e}},J=function(e,t){return{type:p.E,siteId:t,orderId:e}},X=function(e,t,n,r,i){return{type:p.lb,siteId:t,orderId:e,sourcePackageId:n,movedItemIndex:r,added:i}},$=function(e,t,n){return{type:p.B,siteId:t,orderId:e,targetPackageId:n}},ee=function(e,t){return function(n,r){n(y(e,t,"packages")),n(function(e,t){return{type:p.ib,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},te=function(e,t,n,r){return{type:p.nb,siteId:t,orderId:e,packageId:n,contentsType:r}},ne=function(e,t,n,r){return{type:p.mb,siteId:t,orderId:e,packageId:n,contentsExplanation:r}},re=function(e,t,n,r){return{type:p.Cb,siteId:t,orderId:e,packageId:n,restrictionType:r}},ie=function(e,t,n,r){return{type:p.Bb,siteId:t,orderId:e,packageId:n,restrictionComments:r}},ae=function(e,t,n,r){return{type:p.kb,siteId:t,orderId:e,packageId:n,abandonOnNonDelivery:r}},oe=function(e,t,n,r){return{type:p.xb,siteId:t,orderId:e,packageId:n,itn:r}},ce=function(e,t,n,r){return{type:p.ob,siteId:t,orderId:e,productId:n,description:r}},ue=function(e,t,n,r){return{type:p.qb,siteId:t,orderId:e,productId:n,tariffNumber:r}},se=function(e,t,n,r){return{type:p.sb,siteId:t,orderId:e,productId:n,weight:r}},de=function(e,t,n,r){return{type:p.rb,siteId:t,orderId:e,productId:n,value:r}},fe=function(e,t,n,r){return{type:p.pb,siteId:t,orderId:e,productId:n,originCountry:r}},le=function(e,t){return function(n,r){n(y(e,t,"customs")),n(function(e,t){return{type:p.hb,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},Oe=function(e,t,n,r,i,a){return{type:p.Lb,siteId:t,carrierId:i,orderId:e,packageId:n,serviceId:r,signatureRequired:a}},Ee=function(e,t,n){return{type:p.tb,siteId:t,orderId:e,value:n}},be=function(e,t,n){return{type:p.vb,siteId:t,orderId:e,value:n}},pe=function(e,t,n,r){return{type:p.Y,orderId:e,siteId:t,response:n,error:r}},me=function(e,t,n,r,i){n(pe(e,t,null,!0));var a={button:Object(c.translate)("Go to Credit Cards settings."),onClick:function(){window.open("admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings")}};n(E.a(i.toString(),a)),n(T(e,t)),A(e,t,n,r,u.noop)},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"order-#".concat(e,"-label")+(t?"-reprint":"")+".pdf"},ge=function(e,t,n,r,i,a){n(w(e,t,!0)),n(T(e,t)),i||(Object(g.u)(r(),e,t)&&n(Object(I.a)(t,e,{note:Object(c.translate)("Your order has been shipped. The tracking number is %(trackingNumbers)s.","Your order consisting of %(packageCount)d packages has been shipped. The tracking numbers are %(trackingNumbers)s.",{args:{packageCount:a.length,trackingNumbers:a.map(function(e){var t=e.tracking,n={usps:"USPS",ups:"UPS"}[e.carrier_id||""];return n?"".concat(t," (").concat(n,")"):t}).join(", ")},count:a.length}),customer_note:!0})),Object(g.v)(r(),e,t)&&n(Object(v.f)(t,{id:e,status:"completed"})))},Ie=function(e){return E.d(Object(c.translate)("Your shipping label was purchased successfully","Your %(count)d shipping labels were purchased successfully",{count:e,args:{count:e}}))},ve=function(e,t){var n=Object(c.translate)('Your shipping label was purchased successfully, but could not be printed automatically. Click "Reprint" to try again.','Your shipping labels were purchased successfully, but some of them could not be printed automatically. Click "Reprint" to try again.',{count:e});return E.a(n,{id:C,button:Object(c.translate)("Reprint"),onClick:t})};var Se=function e(t,n,r,a,o){var f=Object(u.find)(o,{status:"PURCHASE_ERROR"});f?me(t,n,r,a,f.error):Object(u.every)(o,{status:"PURCHASED"})?(r(pe(t,n,o,!1)),function e(t,n,r,a,o){var u=arguments,f=1===o.length?[{labelId:o[0].label_id}]:o.map(function(e,t){return{caption:Object(c.translate)("PACKAGE %(num)d (OF %(total)d)",{args:{num:t+1,total:o.length}}),labelId:e.label_id}}),l=Object(g.j)(a(),t,n).paperSize,b=Object(_.b)(l,f),m=function(){r(Ie(f.length))},I=function(){r(E.c(C)),r(E.b(Object(c.translate)("Printing\u2026"),{id:R})),e.apply(void 0,i()(u))},v=!1,S=o.map(function(e){return e.commercial_invoice_url}).filter(function(e){return e});if(S&&0<S.length){r(E.b(Object(c.translate)("Note: A customs form will open in a new tab and must be printed and included on this international shipment."),{}));var h=!0,j=!1,P=void 0;try{for(var y,M=S[Symbol.iterator]();!(h=(y=M.next()).done);h=!0){var N=y.value;window.open(N)}}catch(A){j=!0,P=A}finally{try{h||null==M.return||M.return()}finally{if(j)throw P}}}s.b(n,b).then(function(e){r(E.c(R)),"addon"===d()?(m(),r({type:p.Eb,orderId:t,siteId:n,fileData:e,labels:o})):O(e,_e(t)).then(function(){m()}).catch(function(e){r(E.a(e.toString())),v=!0}).then(function(){ge(t,n,r,a,v,o)})}).catch(function(){r(w(t,n,!0)),r(T(t,n)),r(E.c(R)),r(ve(o.length,I))})}(t,n,r,a,o)):setTimeout(function(){var i=o.filter(function(e){return"PURCHASED"===e.status}),c=o.filter(function(e){return"PURCHASED"!==e.status}).map(function(e){return e.label_id});(function e(t,n,r,i){var a=1e3;return 0===i&&(a=2e3),s.b(n,s.e.labelsStatus(t,r)).then(function(e){return e.labels}).catch(function(o){if(!Object(u.includes)(o,"cURL error 28")||i>=3)throw o;return new Promise(function(o){setTimeout(function(){return o(e(t,n,r,i+1))},a)})})})(t,n,c,0).then(function(o){return e(t,n,r,a,o.concat(i))}).catch(function(e){return me(t,n,r,a,e)})},1e3)},he=function(e,t){return function(n,r){var i=null,a=null,c=function(e){return i=e},d=function(e){a=e.labels},f=function(o){o?n({type:p.X,orderId:e,siteId:t}):i?me(e,t,n,r,i):Se(e,t,n,r,a)},l=Object(g.j)(r(),e,t).form,O=[];if(!l.origin.isNormalized){var b=m(e,t,n,l.origin.values,"origin");O.push(b)}if(!l.destination.isNormalized){var _=m(e,t,n,l.destination.values,"destination");O.push(_)}Promise.all(O).then(function(n){if(Object(u.every)(n)){l=Object(g.j)(r(),e,t).form;var i=Object(g.p)(r(),e,t)?l.customs.items:null,a={async:!0,origin:Object(j.a)(l.origin),destination:Object(j.a)(l.destination),packages:Object(u.map)(l.packages.selected,function(e,t){var n=l.rates.values[t],r=n.serviceId,a=n.signatureRequired,c=a in l.rates.available[t]?a:"default",s=N(e,i),d=Object(u.find)(l.rates.available[t][c].rates,function(e){return r===e.service_id});return o()({},s,{shipment_id:d.shipment_id,rate_id:d.rate_id,service_id:r,carrier_id:d.carrier_id,service_name:d.title,products:Object(u.flatten)(e.items.map(function(e){return Object(u.fill)(new Array(e.quantity),e.product_id)}))})})},O=Object(h.e)(r(),t);Object(u.isBoolean)(O)&&(a.email_receipt=O),f(!0),s.c(t,s.e.orderLabels(e),a).then(d).catch(c).then(function(){return f(!1)})}}).catch(function(e){console.error(e),n(E.a(e.toString()))})}},je=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t);O(i.form.fileData,_e(e)).then(function(){n(w(e,t,!0)),n(T(e,t)),ge(e,t,n,r,!1,i.form.labelsToPrint)}).catch(function(e){return n(E.a(e.toString()))})}},Ce=function(e,t,n){return{type:p.V,labelId:n,siteId:t,orderId:e}},Re=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t);Object(u.every)(i.labels,{statusUpdated:!0})||i.statusRetrivalInProgress||(n({type:p.Gb,orderId:e}),s.b(t,s.e.labelsStatus(e,i.labels.map(function(e){return e.label_id}))).then(function(r){var i=r.labels;n({type:p.Fb,orderId:e,siteId:t,labelsData:i,error:null})}).catch(function(r){n({type:p.Fb,orderId:e,siteId:t,labelsData:null,error:r}),n(E.a("Failed to retrieve shipping label refund status: ".concat(r)))}))}},Pe=function(e,t){return{type:p.H,orderId:e,siteId:t}},ye=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t).refundDialog.labelId,a=null,o=null,u=function(r){r?n({type:p.bb,orderId:e,siteId:t}):(n({type:p.cb,response:o,error:a,orderId:e,siteId:t}),n(a?E.a(a.toString()):E.d(Object(c.translate)("The refund request has been sent successfully."),{duration:5e3})))};u(!0),s.c(t,s.e.labelRefund(e,i)).then(function(e){o=e.refund}).catch(function(e){a=e}).then(function(){return u(!1)})}},Me=function e(t,n,r){return function(i,a){i({type:p.W,labelId:r,orderId:t,siteId:n}),i(E.c("wcs-reprint-label"));var o=Object(g.j)(a(),t,n),u=Object(_.b)(o.paperSize,[{labelId:r}]);s.b(n,u).then(function(e){var c=Object(g.j)(a(),t,n);o.paperSize===c.paperSize&&i({type:p.gb,labelId:r,orderId:t,siteId:n,fileData:e})}).catch(function(a){i({type:p.fb,labelId:r,orderId:t,siteId:n}),i(E.a(a.toString(),{id:"wcs-reprint-label",button:Object(c.translate)("Retry"),onClick:function(){return i(e(t,n,r))}}))})}},Ne=function(e,t){return{type:p.I,orderId:e,siteId:t}},Te=function(e,t){return function(n,r){n({type:p.K,orderId:e,siteId:t});var i=Object(g.j)(r(),e,t);O(i.reprintDialog.fileData,_e(e,!0)).catch(function(e){console.error(e),n(E.a(e.toString()))}).then(function(){return n(Ne(e,t))})}},Ae=function(e,t,n){return function(r,i){r({type:p.Kb,siteId:t,orderId:e,value:n});var a=Object(g.j)(i(),e,t);null!=a.reprintDialog&&r(Me(e,t,a.reprintDialog.labelId))}},Le=function(e,t,n){return{type:p.R,labelId:n,siteId:t,orderId:e}},ke=function(e,t){return{type:p.F,orderId:e,siteId:t}}},549:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return O}),n.d(t,"n",function(){return E}),n.d(t,"o",function(){return b}),n.d(t,"e",function(){return p}),n.d(t,"q",function(){return m}),n.d(t,"p",function(){return _}),n.d(t,"k",function(){return g}),n.d(t,"l",function(){return I}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return S});var r=n(1),i=n(536),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.meta},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.storeOptions},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.enabled},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.selected_payment_method_id},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.email_receipts},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.paper_size},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return f}),n.d(t,"b",function(){return l});var r=n(535),i=n.n(r),a=n(1),o={debounce:a.debounce,isPlainObject:a.isPlainObject,uniqueId:a.uniqueId},c=(n(46),o.uniqueId);function u(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,a=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},a,{noticeId:r||c(),status:e,text:t})}}var d=s.bind(null,"is-success"),f=s.bind(null,"is-error"),l=s.bind(null,"is-info");s.bind(null,"is-warning"),s.bind(null,"is-plain")},558:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},562:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return o}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return u}),n.d(t,"dismissModal",function(){return s}),n.d(t,"savePackage",function(){return d}),n.d(t,"updatePackagesField",function(){return f}),n.d(t,"toggleOuterDimensions",function(){return l}),n.d(t,"toggleAll",function(){return O}),n.d(t,"togglePackage",function(){return E}),n.d(t,"savePredefinedPackages",function(){return b}),n.d(t,"removePredefinedPackage",function(){return p}),n.d(t,"setModalErrors",function(){return m}),n.d(t,"setIsSaving",function(){return _}),n.d(t,"setIsFetching",function(){return g}),n.d(t,"setIsFetchError",function(){return I}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return S}),n.d(t,"submit",function(){return h});var r=n(545),i=n(541),a=n(544),o=function(e){return{type:i.g,siteId:e}},c=function(e,t){return{type:i.k,index:t,siteId:e}},u=function(e,t){return{type:i.i,package:t,siteId:e}},s=function(e){return{type:i.h,siteId:e}},d=function(e,t){return{type:i.m,packageData:t,siteId:e}},f=function(e,t){return{type:i.w,values:t,siteId:e}},l=function(e){return{type:i.u,siteId:e}},O=function(e,t,n,r){return{type:i.t,serviceId:t,groupId:n,checked:r,siteId:e}},E=function(e,t,n){return{type:i.v,serviceId:t,packageId:n,siteId:e}},b=function(e){return{type:i.n,siteId:e}},p=function(e,t,n){return{type:i.l,serviceId:t,packageId:n,siteId:e}},m=function(e,t){return{type:i.s,value:t,siteId:e}},_=function(e,t){return{type:i.r,isSaving:t,siteId:e}},g=function(e,t){return{type:i.p,isFetching:t,siteId:e}},I=function(e,t){return{type:i.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:i.o,siteId:e,mode:t}},S=function(e){return function(t,n){var o=Object(a.e)(n(),e);o&&(o.packages||o.isFetching)||(t(g(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,a=n.formSchema,o=n.storeOptions;t({type:i.j,packages:r,dimensionUnit:o.dimension_unit,weightUnit:o.weight_unit,packageSchema:a.custom.items,predefinedSchema:a.predefined,siteId:e})}).catch(function(n){console.error(n),t(I(e,!0))}).then(function(){return t(g(e,!1))}))}},h=function(e,t,n){return function(i,o){var c=Object(a.e)(o(),e);i(_(e,!0)),r.d(e,r.e.packages,c.packages).then(t).catch(n).then(function(){return i(_(e,!1))})}}},563:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(538);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},565:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return a});var r=function(){return{}},i=function(){return""},a=function(){return!0}},572:function(e,t,n){"use strict";var r=n(76);t.a=r.a},573:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},574:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return E}),n.d(t,"g",function(){return b}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"j",function(){return _}),n.d(t,"d",function(){return g});var r=n(1),i=n(546),a=n(536),o=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.isArray)(c(e,t))},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.b===c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.a===c(e,t)},f=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=r[e],o=u(t,a);return[o,o&&c(t,a)]}},l=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},f(0)),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},E=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var o=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(o,"name")},f(1)),b=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},f(1)),p=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},f(1)),m=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);if(!u(e,i))return n;var o=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!o)return n;var s=Object(r.find)(o.states,{code:n});return s?s.name:n},f(2)),_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!Object(r.isEmpty)(p(e,t,n))},g=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=O(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},f(0))},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},576:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return u}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(545),i=n(541),a=n(549),o=function(e,t,n){return{type:i.e,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.f,siteId:e,key:t,value:n}},u=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,a=n.formMeta,o=n.formData,c=n.userMeta;t(function(e,t,n,r,a){return{type:i.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:a}}(e,r,o,a,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},s=function(e,t,n){return function(i,o){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(a.f)(o())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},d=function(e){return{type:i.d,siteId:e}},f=function(e){return{type:i.c,siteId:e}}},577:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return s});var r=n(1),i=n(536),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(o(e,n)[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?o(e,n)[t]:null},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},578:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],a=["AA","AE","AP"],o=["IR","SY","KP","CU","SD"]},579:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(536),a=n(586),o=n(542),c=n(575),u=n(587),s=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=Object(a.b)(e,n);if(!Object(r.isArray)(o))return!1;var d=Object(r.find)(o,{id:t});if(!d||!Object(r.isArray)(d.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var f=d.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(f,function(t){var r=t.id;return Object(u.a)(e,r,n)})},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(a.b)(e,n);if(!Object(r.isArray)(d))return!1;var f=Object(r.find)(d,{id:t});if(!f)return!1;if(o.b===f.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(f.methodIds))return!1;var l=f.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(l,function(t){var r=t.id;return Object(u.b)(e,r,n)})}},586:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u});var r=n(1),i=n(536),a=(n(542),n(579)),o=n(612),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})}},587:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(536),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===o(e,n)[t]},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},591:function(e,t,n){"use strict";var r,i=n(35),a=n.n(i),o=n(36),c=n.n(o),u=n(1),s=n(46),d=Object(s.b)({},(r={},a()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,n))}),a()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(u.omit)(e,n):e}),a()(r,"ROUTE_SET",function(e){return Object(u.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),f=Object(s.b)({},a()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,Date.now()))}));t.a=Object(s.a)({items:d,lastTimeShown:f})},592:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u});var r=n(538);function i(e){return{type:r.d,actionList:e}}function a(){return{type:r.b}}function o(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function u(e,t){return{type:r.c,actionList:e,error:t}}},609:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c});var r=n(1),i=n(536),a=(n(640),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])}),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","items",t],null)}},610:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r,i=n(36),a=n.n(i),o=n(535),c=n.n(o),u=n(658),s=n.n(u),d=n(1),f=n(46),l=n(113),O=function(e){return Object(d.get)(e,"meta.dataLayer.data",void 0)},E=function(e){return Object(d.get)(e,"meta.dataLayer.error",void 0)},b=function(e){return Object(d.get)(e,"meta.dataLayer.progress",void 0)},p=(Object(f.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,o=n.status;return Object.assign(a()({},e),{status:o},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(d.get)(n,"meta.dataLayer.trackRequest")||b(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(d.get)(t,"dataLayer.requestKey");return r||s()(n)}(n),i=function(e){return void 0!==E(e)?"failure":void 0!==O(e)?"success":"pending"}(n),o=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(a()({},t,{dispatch:function(e){return t.dispatch(Object(d.merge)(e,{meta:{dataLayer:o}}))}}),n)}},function(e){return e.fetch||Object(l.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(l.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(l.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?d.noop:n,i=e.onSuccess,a=void 0===i?d.noop:i,o=e.onError,c=void 0===o?d.noop:o,u=e.onProgress,s=void 0===u?d.noop:u,f=e.fromApi,l=void 0===f?d.identity:f,p=E(t);if(p)return c(t,p);var m=O(t);if(m)try{return a(t,l(m))}catch(g){return c(t,g)}var _=b(t);return _?s(t,_):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},611:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},612:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(536),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=o(e,n);return a&&Object(r.isObject)(a[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o(e,n)&&a.b===o(e,n)[t]}},613:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(545),i=n(563),a=n(541),o=n(587),c=function(e,t,n){return function(c,u){if(!Object(o.a)(u(),n,e)&&!Object(o.b)(u(),n,e)){var s={type:a.Pb,instanceId:n,siteId:e};return c(s),r.b(e,r.e.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:a.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,s,t))})}}}},614:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(a){var o=(t.properties||{})[a];i[a]=e(o,n[a],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},617:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return N});var r=n(111),i=n.n(r),a=n(107),o=n.n(a),c=n(108),u=n.n(c),s=n(530),d=n.n(s),f=n(529),l=n.n(f),O=n(534),E=n.n(O),b=n(531),p=n.n(b),m=n(35),_=n.n(m),g=n(10),I=n.n(g),v=n(109),S=n(164),h=n.n(S),j=n(47),C=n.n(j),R=n(1),P=n(546),y=Object(P.a)(function(e){return Object(R.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),M=C()("calypso:localized-moment"),N=I.a.createContext(h.a),T=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=d()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(E()(n),"state",{moment:h.a,momentLocale:h.a.locale()}),n}return p()(t,e),u()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return M("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(625)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),M("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:M("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(h.a.locale()!==r&&h.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(h.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return I.a.createElement(N.Provider,{value:this.state},this.props.children)}}]),t}(I.a.Component),A=Object(v.b)(function(e){return{currentLocale:y(e)}})(T)},619:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});n(1);var r=n(664),i=n.n(r),a=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function o(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){a.innerHTML=e;var t=a.textContent;return a.innerHTML="",t}(e)}function c(e){return i()(e)}String.fromCharCode(160)},621:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return d});var r=n(34),i=n(607),a=n(1),o=n(545),c={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(a.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},u=function(e){return Object(a.reduce)(c,function(t,n,r){var i=n.name,a=n.exclude;return a&&a(e)||(t[r]=i),t},{})},s=function(e,t,n){if(!c[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(a.filter)(Object(a.map)(t,"labelId")).join(","),caption_csv:Object(a.filter)(Object(a.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(i.stringify)(r)},d=function(e,t){return s(e,t,o.e.labelsPrint())}},625:function(e,t,n){var r={"./af":[392,2],"./af.js":[392,2],"./ar":[399,3],"./ar-dz":[393,4],"./ar-dz.js":[393,4],"./ar-kw":[394,5],"./ar-kw.js":[394,5],"./ar-ly":[395,6],"./ar-ly.js":[395,6],"./ar-ma":[396,7],"./ar-ma.js":[396,7],"./ar-sa":[397,8],"./ar-sa.js":[397,8],"./ar-tn":[398,9],"./ar-tn.js":[398,9],"./ar.js":[399,3],"./az":[400,10],"./az.js":[400,10],"./be":[401,11],"./be.js":[401,11],"./bg":[402,12],"./bg.js":[402,12],"./bm":[403,13],"./bm.js":[403,13],"./bn":[405,14],"./bn-bd":[404,15],"./bn-bd.js":[404,15],"./bn.js":[405,14],"./bo":[406,16],"./bo.js":[406,16],"./br":[407,17],"./br.js":[407,17],"./bs":[408,18],"./bs.js":[408,18],"./ca":[409,19],"./ca.js":[409,19],"./cs":[410,20],"./cs.js":[410,20],"./cv":[411,21],"./cv.js":[411,21],"./cy":[412,22],"./cy.js":[412,22],"./da":[413,23],"./da.js":[413,23],"./de":[416,24],"./de-at":[414,25],"./de-at.js":[414,25],"./de-ch":[415,26],"./de-ch.js":[415,26],"./de.js":[416,24],"./dv":[417,27],"./dv.js":[417,27],"./el":[418,28],"./el.js":[418,28],"./en-au":[419,29],"./en-au.js":[419,29],"./en-ca":[420,30],"./en-ca.js":[420,30],"./en-gb":[421,31],"./en-gb.js":[421,31],"./en-ie":[422,32],"./en-ie.js":[422,32],"./en-il":[423,33],"./en-il.js":[423,33],"./en-in":[424,34],"./en-in.js":[424,34],"./en-nz":[425,35],"./en-nz.js":[425,35],"./en-sg":[426,36],"./en-sg.js":[426,36],"./eo":[427,37],"./eo.js":[427,37],"./es":[431,38],"./es-do":[428,39],"./es-do.js":[428,39],"./es-mx":[429,40],"./es-mx.js":[429,40],"./es-us":[430,41],"./es-us.js":[430,41],"./es.js":[431,38],"./et":[432,42],"./et.js":[432,42],"./eu":[433,43],"./eu.js":[433,43],"./fa":[434,44],"./fa.js":[434,44],"./fi":[435,45],"./fi.js":[435,45],"./fil":[436,46],"./fil.js":[436,46],"./fo":[437,47],"./fo.js":[437,47],"./fr":[440,48],"./fr-ca":[438,49],"./fr-ca.js":[438,49],"./fr-ch":[439,50],"./fr-ch.js":[439,50],"./fr.js":[440,48],"./fy":[441,51],"./fy.js":[441,51],"./ga":[442,52],"./ga.js":[442,52],"./gd":[443,53],"./gd.js":[443,53],"./gl":[444,54],"./gl.js":[444,54],"./gom-deva":[445,55],"./gom-deva.js":[445,55],"./gom-latn":[446,56],"./gom-latn.js":[446,56],"./gu":[447,57],"./gu.js":[447,57],"./he":[448,58],"./he.js":[448,58],"./hi":[449,59],"./hi.js":[449,59],"./hr":[450,60],"./hr.js":[450,60],"./hu":[451,61],"./hu.js":[451,61],"./hy-am":[452,62],"./hy-am.js":[452,62],"./id":[453,63],"./id.js":[453,63],"./is":[454,64],"./is.js":[454,64],"./it":[456,65],"./it-ch":[455,66],"./it-ch.js":[455,66],"./it.js":[456,65],"./ja":[457,67],"./ja.js":[457,67],"./jv":[458,68],"./jv.js":[458,68],"./ka":[459,69],"./ka.js":[459,69],"./kk":[460,70],"./kk.js":[460,70],"./km":[461,71],"./km.js":[461,71],"./kn":[462,72],"./kn.js":[462,72],"./ko":[463,73],"./ko.js":[463,73],"./ku":[464,74],"./ku.js":[464,74],"./ky":[465,75],"./ky.js":[465,75],"./lb":[466,76],"./lb.js":[466,76],"./lo":[467,77],"./lo.js":[467,77],"./lt":[468,78],"./lt.js":[468,78],"./lv":[469,79],"./lv.js":[469,79],"./me":[470,80],"./me.js":[470,80],"./mi":[471,81],"./mi.js":[471,81],"./mk":[472,82],"./mk.js":[472,82],"./ml":[473,83],"./ml.js":[473,83],"./mn":[474,84],"./mn.js":[474,84],"./mr":[475,85],"./mr.js":[475,85],"./ms":[477,86],"./ms-my":[476,87],"./ms-my.js":[476,87],"./ms.js":[477,86],"./mt":[478,88],"./mt.js":[478,88],"./my":[479,89],"./my.js":[479,89],"./nb":[480,90],"./nb.js":[480,90],"./ne":[481,91],"./ne.js":[481,91],"./nl":[483,92],"./nl-be":[482,93],"./nl-be.js":[482,93],"./nl.js":[483,92],"./nn":[484,94],"./nn.js":[484,94],"./oc-lnc":[485,95],"./oc-lnc.js":[485,95],"./pa-in":[486,96],"./pa-in.js":[486,96],"./pl":[487,97],"./pl.js":[487,97],"./pt":[489,98],"./pt-br":[488,99],"./pt-br.js":[488,99],"./pt.js":[489,98],"./ro":[490,100],"./ro.js":[490,100],"./ru":[491,101],"./ru.js":[491,101],"./sd":[492,102],"./sd.js":[492,102],"./se":[493,103],"./se.js":[493,103],"./si":[494,104],"./si.js":[494,104],"./sk":[495,105],"./sk.js":[495,105],"./sl":[496,106],"./sl.js":[496,106],"./sq":[497,107],"./sq.js":[497,107],"./sr":[499,108],"./sr-cyrl":[498,109],"./sr-cyrl.js":[498,109],"./sr.js":[499,108],"./ss":[500,110],"./ss.js":[500,110],"./sv":[501,111],"./sv.js":[501,111],"./sw":[502,112],"./sw.js":[502,112],"./ta":[503,113],"./ta.js":[503,113],"./te":[504,114],"./te.js":[504,114],"./tet":[505,115],"./tet.js":[505,115],"./tg":[506,116],"./tg.js":[506,116],"./th":[507,117],"./th.js":[507,117],"./tk":[508,118],"./tk.js":[508,118],"./tl-ph":[509,119],"./tl-ph.js":[509,119],"./tlh":[510,120],"./tlh.js":[510,120],"./tr":[511,121],"./tr.js":[511,121],"./tzl":[512,122],"./tzl.js":[512,122],"./tzm":[514,123],"./tzm-latn":[513,124],"./tzm-latn.js":[513,124],"./tzm.js":[514,123],"./ug-cn":[515,125],"./ug-cn.js":[515,125],"./uk":[516,126],"./uk.js":[516,126],"./ur":[517,127],"./ur.js":[517,127],"./uz":[519,128],"./uz-latn":[518,129],"./uz-latn.js":[518,129],"./uz.js":[519,128],"./vi":[520,130],"./vi.js":[520,130],"./x-pseudo":[521,131],"./x-pseudo.js":[521,131],"./yo":[522,132],"./yo.js":[522,132],"./zh-cn":[523,133],"./zh-cn.js":[523,133],"./zh-hk":[524,134],"./zh-hk.js":[524,134],"./zh-mo":[525,135],"./zh-mo.js":[525,135],"./zh-tw":[526,136],"./zh-tw.js":[526,136]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=625,e.exports=i},626:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(112))},636:function(e,t,n){"use strict";var r=n(35),i=n.n(r),a=n(110),o=n.n(a),c=n(1),u=n(34),s=n(538),d=n(592),f=n(549),l=n(544),O=n(576),E=n(562),b=n(536),p=n(541);n(572),n(563),n(579),n(613),n(626);var m=n(545),_=n(36),g=n.n(_);function I(e,t,n,r){Object(c.isFunction)(n)?I(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(g()({},n,r))}var v,S=n(577),h=n(614),j=function(e,t){var n=Object(l.e)(e,t);return!n||n.pristine?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(E.submit)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]},C=function(e,t){var n=Object(b.a)(e);return t?o()(j(e,n)):[].concat(o()(function(e,t){var n=Object(f.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(O.e)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]}(e,n)),o()(j(e,n)))};t.a=(v={},i()(v,s.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,a=function(e){e(n),e(Object(d.b)())},o=C(e.getState(),i);e.dispatch(Object(c.isEmpty)(o)?a:Object(d.d)({nextSteps:o,onSuccess:a,onFailure:function(e){e(r),e(Object(d.b)())}}))}]),i()(v,p.Rb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,a=t.methodId,o=t.methodType,c=t.method,u=t.successAction,d=t.failureAction,f=Object(S.a)(r(),o,i).formSchema,l=Object(h.a)(f,c);m.c(i,m.e.serviceSettings(o,a),l).then(function(e){n(function(e,t,n){return{type:s.Fb,siteId:e,data:t,originatingAction:n}}(i,e,t)),I(n,r,u,{sentData:l,receivedData:e})}).catch(function(e){return I(n,r,d,{error:e})})}]),v)},637:function(e,t,n){"use strict";var r=n(535),i=n.n(r),a=n(76),o=n(46),c=function(e,t,n,r,c,u){var s=Object(a.b)();return u&&!u.endsWith("/")&&(u+="/"),u&&u.startsWith("/")&&(u=u.substr(1)),-1!==s.indexOf("?")&&(t=t.replace("?","&")),Object(o.c)(function(e){var t=e.url,n=e.method,r=e.headers,a=e.queryParams,o=e.body,c=e.withCredentials,u=e.onSuccess,s=e.onFailure,d=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:a,body:o,withCredentials:c,onSuccess:u||f,onFailure:s||f,options:d}}({url:s+u+t,method:e,headers:[["X-WP-Nonce",Object(a.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,a){return c(e,t+"&_envelope",0,r,i,a)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},640:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return O});var r=n(36),i=n.n(r),a=n(1),o=n(691),c=n(641),u={page:1,per_page:50,search:"",status:"any"};function s(e){return e.status&&(e.status=Object(c.a)(e.status)),Object(a.omitBy)(e,function(e,t){return u[t]===e})}function d(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return JSON.stringify(e)}function f(e){for(var t=i()({},e),n=0,r=["line_items","fee_lines","coupon_lines","shipping_lines"];n<r.length;n++){var o=r[n];e[o]&&(t[o]=e[o].map(function(e){return Object(a.isFinite)(e.id)?e:Object(a.omit)(e,"id")}))}return t}function l(e){Object(a.forEach)(["cart_tax","discount_total","discount_tax","shipping_total","shipping_tax","total","total_tax"],function(t){(Object(a.isFinite)(e[t])||e[t])&&(e[t]=Object(o.b)(e[t],e.currency))});var t=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return t.map(function(t){return Object(a.forEach)(n,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=t[e].toString())}),Object(a.forEach)(r,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.b)(t[n],e.currency))}),Object(a.forEach)(i,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=parseInt(t[e]))}),Object(a.forEach)(c,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.a)(t[n],e.currency))}),t})};return Object(a.isEmpty)(e.line_items)||(e.line_items=t(e.line_items,["name","tax_class"],["subtotal","subtotal_tax","total","total_tax"],["product_id","variation_id","quantity"],["price"])),Object(a.isEmpty)(e.shipping_lines)||(e.shipping_lines=t(e.shipping_lines,["method_title","method_id"],["total","total_tax"])),Object(a.isEmpty)(e.fee_lines)||(e.fee_lines=t(e.fee_lines,["name","tax_class","tax_status"],["total","total_tax"])),Object(a.isEmpty)(e.coupon_lines)||(e.coupon_lines=t(e.coupon_lines,["code"],["discount","discount_tax"])),Object(a.isEmpty)(e.refunds)||(e.refunds=t(e.refunds,["reason"],["total"])),e.billing&&""===e.billing.email&&delete e.billing.email,e}function O(e){var t=e.status,n=void 0===t?"":t;window.jQuery&&(n&&window.jQuery("#order_status").val("wc-"+n).trigger("change"),window.jQuery("#woocommerce-order-notes").length&&window.jQuery.get(window.location.href,function(e){var t=window.jQuery(e).find("#woocommerce-order-notes");window.jQuery("#woocommerce-order-notes").html(t.html())}))}},641:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return d});n(34),n(1);var r="unpaid",i="unfulfilled",a="finished",o=["on-hold","pending"],c=["processing"],u=["cancelled","completed","failed","refunded"];function s(e){return r===e?o.join(","):i===e?c.join(","):a===e?u.join(","):e}function d(e){return-1!==u.indexOf(e)}},642:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"c",function(){return O}),n.d(t,"i",function(){return E}),n.d(t,"f",function(){return b}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return m});var r=n(535),i=n.n(r),a=(n(36),n(1)),o=n(640),c=(n(641),n(538)),u=function(e,t,n){return{type:c.q,siteId:e,orderId:t,error:n}},s=function(e,t){return{type:c.r,siteId:e,orderId:t}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.n,siteId:e,query:Object(o.b)(t),error:n}},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.isArray)(n)?{type:c.o,siteId:e,query:Object(o.b)(t),total:r,orders:n}:d(e,t,n)},l=function(e,t){return{type:c.F,siteId:e,orderId:t}},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.G,siteId:e,orderId:t,error:n}},E=function(e,t,n){return"undefined"===typeof n.id?O(e,t,n):{type:c.H,siteId:e,orderId:t,order:n}},b=function(e,t){var n=t.id,r=i()(t,["id"]),u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.noop,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.noop;return r=Object(o.e)(Object(o.d)(r)),{type:c.I,siteId:e,orderId:n,order:r,onFailure:s,onSuccess:u}},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.J,siteId:e,orderId:t,error:n}},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"undefined"===typeof n.id?p(e,t,n):(Object(o.f)(n),{type:c.K,siteId:e,orderId:t,order:n})}},643:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},652:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(536),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","isLoading",t])},o=n(609),c=n(540),u=n(575),s={CUSTOMER_NOTE:"CUSTOMER_NOTE",INTERNAL_NOTE:"INTERNAL_NOTE",LABEL_PURCHASING:"LABEL_PURCHASING",LABEL_PURCHASED:"LABEL_PURCHASED",LABEL_REFUND_REQUESTED:"LABEL_REFUND_REQUESTED",LABEL_REFUND_COMPLETED:"LABEL_REFUND_COMPLETED",LABEL_REFUND_REJECTED:"LABEL_REFUND_REJECTED",REFUND_NOTE:"REFUND_NOTE"},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!!a(e,t,n)&&(!(u.a(e,n)&&!Object(c.r)(e,t,n))||Object(c.t)(e,t,n))},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(o.a)(e,t,n),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!a(e,t,n))return[];var o=Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","items"],{});return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","orders",t],[]).map(function(e){return o[e]})}(e,t,n).filter(function(e){return!1===e.customer_note}).map(function(e){return{key:e.id,type:s.INTERNAL_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),content:e.note}});if(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","refunds",t,"items"],[])}(e,t,n).forEach(function(e){f.push({key:e.id,type:s.REFUND_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),amount:e.amount,reason:e.reason,currency:d.currency})}),u.a(e,n)){var l=Object(c.h)(e,t,n);Object(r.filter)(l,function(e){return-1!==["PURCHASED","ANONYMIZED","PURCHASE_IN_PROGRESS"].indexOf(e.status)}).forEach(function(e,t,n){var r=n.length-1-t;if(e.refund)switch(e.refund.status){case"complete":f.push({key:e.label_id,type:s.LABEL_REFUND_COMPLETED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency});break;case"rejected":f.push({key:e.label_id,type:s.LABEL_REFUND_REJECTED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r});break;default:f.push({key:e.label_id,type:s.LABEL_REFUND_REQUESTED,timestamp:e.refund.request_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency})}if("PURCHASE_IN_PROGRESS"===e.status)return f.push({key:e.label_id,type:s.LABEL_PURCHASING,labelIndex:r,labelId:e.label_id,serviceName:e.service_name,carrierId:e.carrier_id});f.push({key:e.label_id,type:s.LABEL_PURCHASED,timestamp:e.created_date,createdDate:e.created_date,usedDate:e.used_date,expiryDate:e.expiry_date,labelIndex:r,labelId:e.label_id,productNames:e.product_names,packageName:e.package_name,isLetter:e.is_letter,receiptId:e.main_receipt_id,serviceName:e.service_name,tracking:e.tracking,carrierId:e.carrier_id,amount:e.rate,refundableAmount:e.refundable_amount,currency:e.currency,anonymized:"ANONYMIZED"===e.status,showDetails:!e.refund||"rejected"===e.refund.status||"unknown"===e.refund.status,commercialInvoiceUrl:e.commercial_invoice_url})})}return f}},656:function(e,t,n){"use strict";var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(541),s={modalErrors:{},pristine:!0},d=function(e){return null===e||""===Object(c.trim)(e)},f={};f[u.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=o()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(c.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},f[u.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},f[u.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},f[u.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},f[u.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(c.omitBy)(n,d);return Object.assign({},e,{packageData:r,pristine:!1})},f[u.m]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(c.omit)(n,"index"):r.push(n);return e=f[u.h](e),o()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:o()({},e.packages,{custom:r}),pristine:!1})},f[u.u]=function(e){return o()({},e,{showOuterDimensions:!0})},f[u.k]=function(e,t){var n=i()(e.packages.custom);return n.splice(t.index,1),o()({},e,{packages:o()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},f[u.t]=function(e,t){var n=t.serviceId,r=t.groupId,i=t.checked,a=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),u=e.currentlyEditingPredefinedPackages[n],s=i?Object(c.uniq)(Object(c.concat)(u,a)):Object(c.difference)(u,a),d=o()({},e.currentlyEditingPredefinedPackages);return d[n]=s,o()({},e,{currentlyEditingPredefinedPackages:d,pristine:!1})},f[u.v]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.currentlyEditingPredefinedPackages),c=i()(a[n]||[]),u=c.indexOf(r);return-1===u?c.push(r):c.splice(u,1),a[n]=c,o()({},e,{currentlyEditingPredefinedPackages:a,pristine:!1})},f[u.l]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.packages.predefined),c=i()(a[n]||[]),u=c.indexOf(r);return-1!==u&&c.splice(u,1),a[n]=c,o()({},e,{packages:o()({},e.packages,{predefined:a}),pristine:!1})},f[u.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=f[u.h](e),o()({},e,{packages:o()({},e.packages,{predefined:t}),pristine:!1})},f[u.o]=function(e,t){var n=t.mode;return o()({},e,{mode:n})},f[u.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},f[u.p]=function(e,t){var n=t.isFetching;return o()({},e,{isFetching:n})},f[u.q]=function(e,t){var n=t.isFetchError;return o()({},e,{isFetchError:n})},f[u.j]=function(e,t){var n=t.packages,r=t.dimensionUnit,i=t.weightUnit,a=t.packageSchema,c=t.predefinedSchema;return o()({},e,{packages:n,dimensionUnit:r,weightUnit:i,packageSchema:a,predefinedSchema:c,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof f[t.type]?f[t.type](e,t):e}},657:function(e,t,n){"use strict";var r=n(35),i=n.n(r),a=n(36),o=n.n(a),c=n(541),u={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},s={};s[c.b]=function(e,t){var n=t.storeOptions,r=t.formData,i=t.formMeta,a=t.userMeta;return o()({},e,{storeOptions:n,meta:o()({},e.meta,i,{pristine:!0,isLoaded:!0,user:a}),data:o()({},e.data,r)})},s[c.e]=function(e,t){var n=t.key,r=t.value,a=e.meta.pristine?e.data:e.pristineData;return o()({},e,{meta:o()({},e.meta,{pristine:!1}),data:o()({},e.data,i()({},n,r)),pristineData:a})},s[c.f]=function(e,t){var n=t.key,r=t.value;return o()({},e,{meta:o()({},e.meta,i()({},n,r))})},s[c.d]=function(e){return e.meta.pristine?e:o()({},e,{meta:o()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},s[c.c]=function(e){return o()({},e,{addCardDialog:!0})},s[c.a]=function(e){return o()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return s[t.type]?s[t.type](e,t):e}},662:function(e,t,n){"use strict";var r,i=n(110),a=n.n(i),o=n(36),c=n.n(o),u=n(119),s=n.n(u),d=n(35),f=n.n(d),l=n(47),O=n.n(l),E=n(592),b=n(538),p=O()("woocommerce:action-list");t.a=(r={},f()(r,b.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,a=i.prevSteps,o=i.currentStep,u=i.nextSteps||[],d=s()(u),f=d[0],l=d.slice(1);if(o)return void p("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!f)return void p("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var O=c()({},i,{prevSteps:a,currentStep:c()({},f,{startTime:r}),nextSteps:l});n(Object(E.a)(O)),f.onStep(n,O)}]),f()(r,b.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=i.prevSteps,u=i.currentStep,s=i.nextSteps;if(!u)return void p("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var d=c()({},i,{prevSteps:[].concat(a()(o||[]),[c()({},u,{endTime:r})]),currentStep:null,nextSteps:s});n(Object(E.a)(d)),s&&s.length>0?n(Object(E.d)(d)):i.onSuccess&&i.onSuccess(n,d)}]),f()(r,b.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=t.error,u=i.prevSteps,s=i.currentStep,d=i.nextSteps;if(!s)return void p("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var f=c()({},i,{prevSteps:[].concat(a()(u||[]),[c()({},s,{endTime:r,error:o})]),currentStep:null,nextSteps:d});n(Object(E.a)(f)),i.onFailure&&i.onFailure(n,f)}]),r)},663:function(e,t,n){"use strict";var r,i=n(35),a=n.n(i),o=n(46),c=n(538),u=n(542),s=n(619);t.a=Object(o.b)(null,(r={},a()(r,c.k,function(){return u.b}),a()(r,c.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(s.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(s.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(s.a)(e.name)}})}})}})}),a()(r,c.j,function(e,t){var n=t.originalAction.type;return c.k===n?u.a:e}),r))},690:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return s});var r=n(538),i=n(640),a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{type:r.y,siteId:e,orderId:t,note:n,onSuccess:i,onFailure:a}},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.z,siteId:e,orderId:t,error:n}},c=function(e,t,n){return Object(i.f)({}),{type:r.A,siteId:e,orderId:t,note:n}},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.w,siteId:e,orderId:t,error:n}},s=function(e,t,n){return{type:r.x,siteId:e,orderId:t,notes:n}}},691:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var r=n(608);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?0:Math.round(e*Math.pow(10,n))/Math.pow(10,n)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?"":e.toFixed(n)}},696:function(e,t,n){"use strict";var r=n(77),i=n.n(r);t.a=function(e){var t=(e.outer_dimensions?e.outer_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/):e.inner_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/)).slice(1).map(Number),n=i()(t,3);return{length:n[0],width:n[1],height:n[2]}}},697:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c});var r=n(563),i=n(538);function a(e){return{type:i.k,siteId:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(e);return Object(r.a)(e,n,t)}function c(e,t){return{type:i.l,siteId:e,data:t}}},742:function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","properties":{"data":{"items":{"properties":{"CTA":{"properties":{"hook":{"type":"string"},"message":{"type":"string"},"primary":{"type":"boolean"}},"type":"object"},"content":{"properties":{"classes":{"type":"string"},"description":{"type":"string"},"emblem":{"type":"null"},"icon":{"type":"string"},"message":{"type":"string"}},"type":"object"},"feature_class":{"type":"string"},"id":{"type":"string"},"jitm_stats_url":{"type":"string"},"template":{"type":"string"},"ttl":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}')},743:function(e,t,n){},831:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),a=n(35),o=n.n(a),c=n(10),u=n.n(c),s=n(107),d=n.n(s),f=n(108),l=n.n(f),O=n(530),E=n.n(O),b=n(529),p=n.n(b),m=n(534),_=n.n(m),g=n(531),I=n.n(g),v=n(12),S=n.n(v),h=n(30),j=n(109),C=n(34),R=n(528),P=n.n(R),y=n(537),M=n.n(y),N=n(1),T=n(720),A=n(547),L=n(536),k=n(540),D=n(549),w=n(652),W=n(642),G=n(609),U=n(533),H=n.n(U),V=n(731),F=n(617),x=Object(V.a)(function(e){return function(t){return u.a.createElement(F.a.Consumer,null,function(n){return u.a.createElement(e,H()({},t,n))})}},"WithLocalizedMoment"),B=u.a.lazy(function(){return Promise.all([n.e(0),n.e(152),n.e(139),n.e(149)]).then(n.bind(null,829))}),z=u.a.lazy(function(){return Promise.all([n.e(0),n.e(137),n.e(139),n.e(140),n.e(156)]).then(n.bind(null,827))}),q=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=E()(this,(e=p()(t)).call.apply(e,[this].concat(i))),o()(_()(n),"renderLabelButton",function(e,t){var r=n.props,i=r.loaded,a=r.translate,o=r.items,s=r.orderId,d=r.siteId,f=P()("button","shipping-label__new-label-button",{"is-placeholder":!i});return i?wcConnectData.wcs_server_connection?e.length?t<o?u.a.createElement("div",{className:"shipping-label__multiple-buttons-container"},u.a.createElement(T.a,{className:f,isPrimary:!0,isBusy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(T.a,{isSecondary:!0,className:f,onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement("span",{className:"shipping-label__redo-shipping-button"},u.a.createElement(T.a,{className:P()("button","is-borderless"),onClick:n.handleCreateLabelButtonClick},a("Create new label"))),u.a.createElement(T.a,{isSecondary:!0,className:P()("button"),onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement(T.a,{className:f,isPrimary:!0,isBusy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}))):u.a.createElement(T.a,null,a("Connection error: unable to create label at this time")):u.a.createElement(T.a,{className:"shipping-label__button-loading",isPrimary:!0,isBusy:!0,disabled:!0})}),o()(_()(n),"handleCreateLabelButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openPrintingFlow(t,r)}),o()(_()(n),"handleTrackPackagesButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openTrackingFlow(t,r)}),n}return I()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,r=e.orderLoading,i=e.orderLoaded;t&&n&&!r&&!i&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e,t=this.props,n=t.loaded,r=t.labelsEnabled,i=t.items,a=t.translate,o=t.events,c=t.moment,s=!n||r,d=Object(N.filter)(o,{type:"LABEL_PURCHASED"}),f=Object(N.filter)(o,{type:"LABEL_REFUND_REQUESTED"}),l=Object(N.differenceBy)(d,f,"labelIndex"),O=Object(N.sumBy)(l,function(e){return e.productNames.length}),E=!1;l.length>0&&i<=O&&(E=!0,e=c(Object(N.maxBy)(l,"createdDate").createdDate).format("ll"));return u.a.createElement("div",{className:"shipping-label__container"},u.a.createElement("div",{className:"shipping-label__banner-fulfilled-message"},u.a.createElement(M.a,{size:36,icon:"shipping"}),n&&(E?u.a.createElement("em",null,a("%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}",{count:i,args:{createdDate:e,itemCount:i},components:{span:u.a.createElement("span",{className:"shipping-label__banner-fulfilled-date"})}})):u.a.createElement("em",null,a("%(itemCount)d item is ready to be fulfilled","%(itemCount)d items are ready to be fulfilled",{count:i,args:{itemCount:i}})))),u.a.createElement("div",null,s&&this.renderLabelButton(l,O)))}}]),t}(c.Component);o()(q,"propTypes",{orderId:S.a.number.isRequired});var Z,Q=Object(j.b)(function(e,t){var n=t.orderId,r=Object(L.a)(e);return{siteId:r,loaded:Object(k.a)(e,n,r),events:Object(w.b)(e,n),orderLoading:Object(G.c)(e,n,r),orderLoaded:Object(G.b)(e,n,r),labelsEnabled:Object(D.a)(e,r)}},function(e){return i()({},Object(h.b)({openPrintingFlow:A.x,openTrackingFlow:A.A,setEmailDetailsOption:A.M,setFulfillOrderOption:A.N,fetchOrder:W.e},e))})(Object(C.localize)(x(q))),K=n(25),Y=n.n(K),J=n(541),X=(Z={},o()(Z,J.Y,function(e){e.error||window.wc_shipment_tracking_refresh&&window.wc_shipment_tracking_refresh()}),o()(Z,J.U,function(){var e=Y()("#woocommerce-order-label");e.pointer&&e.pointer().pointer("close")}),Z),$=function(){return function(e){return function(t){e(t);var n=X[t.type];n&&n(t)}}},ee=n(591),te=n(110),ne=n.n(te),re=n(46),ie=n(538),ae=n(696),oe=function(e){return Boolean(e&&e.name&&e.address&&e.city&&e.postcode&&e.country)},ce=function(e){if(!e)return{loaded:!1,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1};var t=e.formData,n=e.labelsData,r=e.paperSize,i=e.storeOptions,a=e.canChangeCountries,o=Boolean(t.origin_normalized||t.origin.phone),c=oe(t.origin),u=oe(t.destination),s={};return Object(N.forEach)(t.selected_packages,function(e){e.items.map(function(e){var n=e.product_id,r=e.weight,i=e.name,a=e.attributes,o=e.description,c=e.value,u=e.hs_tariff_number,d=e.origin_country,f=a?" ("+a+")":"",l=i.substring(i.indexOf("-")+1).trim()+f;s[n]={defaultDescription:l,description:o||l,weight:r,value:c,tariffNumber:u,originCountry:d||t.origin.country}})}),{loaded:!0,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1,refreshedLabelStatus:!1,labels:n||[],paperSize:r,storeOptions:i,form:{orderId:t.order_id,origin:{values:t.origin,isNormalized:o,normalized:o?t.origin:null,ignoreValidation:c?null:Object(N.mapValues)(t.origin,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},destination:{values:t.destination,isNormalized:Boolean(t.destination_normalized),normalized:t.destination_normalized?t.destination:null,ignoreValidation:u?null:Object(N.mapValues)(t.destination,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},packages:{all:t.all_packages,flatRateGroups:t.flat_rate_groups,selected:t.selected_packages,isPacked:t.is_packed,saved:!0},customs:{items:s,ignoreWeightValidation:Object(N.mapValues)(s,function(e){var t=e.weight;return!t||!parseFloat(t)}),ignoreValueValidation:Object(N.mapValues)(s,function(e){var t=e.value;return!t||!parseFloat(t)})},rates:{values:Object(N.isEmpty)(t.rates.selected)?Object(N.mapValues)(t.packages,function(){return{serviceId:"",signatureRequired:!1}}):t.rates.selected,available:{},retrievalInProgress:!1},rateOptions:{}},openedPackageId:Object.keys(t.selected_packages)[0]||""}},ue=n(641),se=function(e,t){for(var n=0;n<=t.length;n++)if(-1===t.indexOf(e+n))return e+n},de={};de[J.O]=function(e,t){return i()({},e,ce(Object(N.omit)(t,"type","siteId")))},de[J.wb]=function(e,t){var n=t.isFetching;return i()({},e,{isFetching:n})},de[J.ub]=function(e,t){var n=t.error;return i()({},e,{error:n})},de[J.U]=function(e){return i()({},e,{showPurchaseDialog:!0})},de[J.Ob]=function(e){return i()({},e,{showTrackingDialog:!0})},de[J.N]=function(e,t){return!t.force&&e.form.isSubmitting?e:i()({},e,{showPurchaseDialog:!1,form:i()({},e.form,{isSubmitting:!1})})},de[J.y]=function(e){return i()({},e,{showTrackingDialog:!1})},de[J.Hb]=function(e,t){var n=t.stepName,r=t.expanded,a=void 0===r?null:r;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{expanded:Object(N.isBoolean)(a)?a:!e.form[n].expanded})))})},de[J.Ib]=function(e,t){var n=t.group,r=t.name,a=t.value,c=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{values:i()({},e.form[n].values,o()({},r,a)),isNormalized:!1,isUnverifiable:!1,normalized:null})))});return"country"===r?de[J.Ib](c,{group:n,name:"state",value:""}):(e.form[n].ignoreValidation&&(c.form[n].ignoreValidation=i()({},e.form[n].ignoreValidation,o()({},r,!1))),c)},de[J.db]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{ignoreValidation:null})))})},de[J.A]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{normalizationInProgress:!0})))})},de[J.z]=function(e,t){var n=t.group,r=t.requestSuccess,a=t.fieldErrors,c=t.normalized,u=t.isTrivialNormalization,s=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{isNormalized:r,normalizationInProgress:!1,fieldErrors:a,selectNormalized:r&&!a,normalized:c})))});return u&&(s.form[n].values=c),s},de[J.jb]=function(e,t){var n=t.group,r=t.selectNormalized;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:r})))})},de[J.L]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!1})))})},de[J.M]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!0})))})},de[J.J]=function(e,t){var n=t.group,r=i()({},e.form[n],{expanded:!1,isNormalized:!0});return r.selectNormalized&&r.normalized?r.values=r.normalized:r.normalized=r.values,i()({},e,{form:i()({},e.form,o()({},n,r))})},de[J.Jb]=function(e,t){var n=t.packageId,r=t.value,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{weight:parseFloat(r),isUserSpecifiedWeight:!0}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.yb]=function(e,t){var n=t.packageId,r=t.signature,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{signature:r}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.T]=function(e,t){var n=t.openedPackageId;return i()({},e,{openedPackageId:n})},de[J.S]=function(e,t){var n=t.movedItemIndex;return i()({},e,{showItemMoveDialog:!0,targetPackageId:e.openedPackageId,movedItemIndex:n})},de[J.P]=function(e,t){var n=t.originPackageId,r=t.movedItemIndex,a=t.targetPackageId;if(-1===r||n===a||void 0===n)return e;var o=i()({},e.form.packages.selected),c=null,u=e.openedPackageId,s=ne()(o[n].items),d=s.splice(r,1)[0];if(o[n]=i()({},o[n],{items:s,weight:Object(N.round)(o[n].weight-d.weight,8)}),"individual"===a){var f=Object.keys(o);c=se("client_individual_",f);var l=d.height,O=d.length,E=d.width,b=d.weight;o[c]={height:l,length:O,width:E,weight:b,id:c,box_id:"individual",items:[d]}}else if("new"===a){var p=Object.keys(o);o[c=se("client_custom_",p)]={height:0,length:0,width:0,weight:d.weight,id:c,box_id:"not_selected",items:[d]}}else if(a){var m=ne()(o[a].items);m.push(d),o[a]=i()({},o[a],{items:m,weight:Object(N.round)(o[a].weight+d.weight,8)})}return 0===o[n].items.length&&(delete o[n],u=c||a),i()({},e,{openedPackageId:u,addedPackageId:c,movedItemIndex:-1,showItemMoveDialog:!1,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.G]=function(e){return i()({},e,{movedItemIndex:-1,showItemMoveDialog:!1})},de[J.Db]=function(e,t){var n=t.targetPackageId;return i()({},e,{targetPackageId:n})},de[J.Q]=function(e){return i()({},e,{showAddItemDialog:!0,addedItems:{}})},de[J.E]=function(e){return i()({},e,{showAddItemDialog:!1})},de[J.lb]=function(e,t){var n,r=t.sourcePackageId,a=t.movedItemIndex;if(t.added){var c=e.addedItems[r]||[];n=Object(N.includes)(c,a)?c:[].concat(ne()(c),[a])}else n=Object(N.without)(e.addedItems[r],a);return i()({},e,{addedItems:i()({},e.addedItems,o()({},r,n))})},de[J.B]=function(e,t){var n=t.targetPackageId;return Object(N.each)(e.addedItems,function(t,r){Object(N.sortBy)(t,function(e){return-e}).forEach(function(t){e=de[J.P](e,{originPackageId:r,movedItemIndex:t,targetPackageId:n})})}),i()({},e,{showAddItemDialog:!1})},de[J.C]=function(e){var t=i()({},e.form.packages.selected),n=Object.keys(t),r=se("client_custom_",n),a=r;return t[r]={height:0,length:0,width:0,id:r,weight:0,box_id:"not_selected",items:[]},i()({},e,{openedPackageId:a,addedPackageId:r,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:t,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(t,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.eb]=function(e,t){var n=t.packageId,r=i()({},e.form.packages.selected),a=r[n].items;delete r[n];var o=Object.keys(r)[0]||"",c=i()({},r[o]);return c.items=c.items.concat(a),r[o]=c,i()({},e,{openedPackageId:o,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:r,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(r,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.zb]=function(e,t){var n=t.box,r=t.packageId,a=t.boxTypeId,o=i()({},e.form.packages.selected),c=o[r],u=Object(N.round)(c.isUserSpecifiedWeight?c.weight:(n?n.box_weight:0)+Object(N.sumBy)(c.items,"weight"),8);if("not_selected"!==a&&n){var s=Object(ae.a)(n),d=s.length,f=s.width,l=s.height;o[r]=i()({},Object(N.omit)(c,"service_id"),{height:l,length:d,width:f,weight:u,box_id:a,is_letter:n.is_letter})}else o[r]=i()({},Object(N.omit)(c,"service_id"),{height:0,length:0,width:0,weight:u,box_id:a});return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.ib]=function(e){return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{saved:!0})})})},de[J.nb]=function(e,t){var n=t.packageId,r=t.contentsType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsType:r})))})})})},de[J.mb]=function(e,t){var n=t.packageId,r=t.contentsExplanation;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsExplanation:r})))})})})},de[J.Cb]=function(e,t){var n=t.packageId,r=t.restrictionType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionType:r})))})})})},de[J.Bb]=function(e,t){var n=t.packageId,r=t.restrictionComments;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionComments:r})))})})})},de[J.kb]=function(e,t){var n=t.packageId,r=t.abandonOnNonDelivery;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{abandonOnNonDelivery:Boolean(r)})))})})})},de[J.xb]=function(e,t){var n=t.packageId,r=t.itn;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{itn:r})))})})})},de[J.ob]=function(e,t){var n=t.productId,r=t.description;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{description:r})))})})})},de[J.qb]=function(e,t){var n=t.productId,r=t.tariffNumber;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{tariffNumber:r.replace(/\D/g,"").substr(0,6)})))})})})},de[J.sb]=function(e,t){var n=t.productId,r=t.weight;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{weight:r}))),ignoreWeightValidation:i()({},e.form.customs.ignoreWeightValidation,o()({},n,!1))})})})},de[J.rb]=function(e,t){var n=t.productId,r=t.value;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{value:r}))),ignoreValueValidation:i()({},e.form.customs.ignoreValueValidation,o()({},n,!1))})})})},de[J.pb]=function(e,t){var n=t.productId,r=t.originCountry;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{originCountry:r})))})})})},de[J.hb]=function(e){return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:Object(N.mapValues)(e.form.customs.items,function(e){return i()({},e,{tariffNumber:e.tariffNumber||""})}),ignoreWeightValidation:{},ignoreValueValidation:{}})})})},de[J.Lb]=function(e,t){var n=t.packageId,r=t.serviceId,a=t.carrierId,o=t.signatureRequired,c=i()({},e.form.rates.values);return c[n]={serviceId:r,carrierId:a,signatureRequired:o},i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{values:c})})})},de[J.Kb]=function(e,t){var n=t.value;return i()({},e,{paperSize:n})},de[J.tb]=function(e,t){var n=t.value;return i()({},e,{emailDetails:n})},de[J.vb]=function(e,t){var n=t.value;return i()({},e,{fulfillOrder:n})},de[J.X]=function(e){return i()({},e,{form:i()({},e.form,{isSubmitting:!0})})},de[J.Y]=function(e,t){var n=t.response;return t.error?i()({},e,{form:i()({},e.form,{isSubmitting:!1})}):i()({},e,{labels:[].concat(ne()(n.map(function(e){return i()({},e,{statusUpdated:!0})})),ne()(e.labels))})},de[J.Eb]=function(e,t){var n=t.fileData,r=t.labels;return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!0,fileData:n,labelsToPrint:r,isSubmitting:!1})})},de[J.ab]=function(e,t){var n=t.requestData;return i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:n})})})},de[J.Ab]=function(e,t){var n=t.rates,r=t.requestData;return Object(N.isEqual)(r,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:{values:Object(N.mapValues)(n,function(e){var t=Object(N.get)(e,"rates",[]),n=1===t.length?t[0]:Object(N.find)(t,function(e){return e.is_selected});return n?n.service_id:""}),available:n}})}):e},de[J.Z]=function(e,t){var n=t.requestData;return Object(N.isEqual)(n,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:null})})}):e},de[J.D]=function(e){return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,rates:i()({},e.form.rates,{available:{}})})})},de[J.V]=function(e,t){var n=t.labelId;return i()({},e,{refundDialog:{labelId:n}})},de[J.H]=function(e){return e.refundDialog.isSubmitting?e:i()({},e,{refundDialog:null})},de[J.Gb]=function(e){return i()({},e,{statusRetrivalInProgress:!0})},de[J.Fb]=function(e,t){var n=t.labelsData;return t.error&&(n={}),i()({},e,{labels:n,refreshedLabelStatus:!0,statusRetrivalInProgress:!1})},de[J.bb]=function(e){return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!0})})},de[J.cb]=function(e,t){var n=t.response;if(t.error)return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!1})});var r=Object(N.findIndex)(e.labels,{label_id:e.refundDialog.labelId}),a=i()({},e.labels[r],{refund:n}),o=i()({},e,{refundDialog:null,labels:ne()(e.labels)});return o.labels[r]=a,o},de[J.W]=function(e,t){var n=t.labelId;return i()({},e,{reprintDialog:{labelId:n,isFetching:!0}})},de[J.gb]=function(e,t){var n=t.labelId,r=t.fileData;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,fileData:r,isFetching:!1}})},de[J.fb]=function(e,t){var n=t.labelId;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,isFetching:!1}})},de[J.I]=function(e){return i()({},e,{reprintDialog:null})},de[J.K]=function(e){return i()({},e,{reprintDialog:i()({},e.reprintDialog,{isFetching:!0})})},de[J.R]=function(e,t){var n=t.labelId;return i()({},e,{detailsDialog:{labelId:n}})},de[J.F]=function(e){return i()({},e,{detailsDialog:null})},de[ie.H]=function(e,t){var n=t.order.status;return i()({},e,{fulfillOrder:!Object(ue.b)(n),emailDetails:Object(ue.b)(n)})};var fe=Object(re.d)("orderId",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce(),t=arguments.length>1?arguments[1]:void 0;return de[t.type]?de[t.type](e,t):e}),le=n(656),Oe=n(657),Ee=n(640);var be=Object(re.a)({isSending:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.orderId;switch(n){case ie.s:return i()({},e,o()({},r,!0));case ie.u:case ie.t:return i()({},e,o()({},r,!1));default:return e}}});var pe=Object(re.a)({isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.v:case ie.x:case ie.w:return Object.assign({},e,o()({},t.orderId,ie.v===t.type));default:return e}},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.y:case ie.z:case ie.A:return Object.assign({},e,o()({},t.orderId,ie.y===t.type));default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=Object(N.keyBy)(t.notes,"id");return Object.assign({},e,n);case ie.A:var r=t.note;return Object.assign({},e,o()({},r.id,r));default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=t.notes.map(function(e){return e.id});return Object.assign({},e,o()({},t.orderId,n));case ie.A:var r=t.note,i=t.orderId,a=[].concat(ne()(e[i]||[]),[r.id]);return Object.assign({},e,o()({},i,a));default:return e}}});var me=Object(re.d)("orderId",Object(re.a)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.C:case ie.E:case ie.D:return ie.C===t.type;default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.B:return t.refunds;case ie.E:return[].concat(ne()(e),[t.refund]);default:return e}}}));var _e=Object(re.a)({invoice:be,isDeleting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.p:case ie.q:case ie.r:return Object.assign({},e,o()({},t.orderId,ie.p===t.type));default:return e}},isQueryLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.m:case ie.o:case ie.n:var n=Object(Ee.c)(t.query);return Object.assign({},e,o()({},n,ie.m===t.type));default:return e}},isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.F:case ie.H:case ie.G:return Object.assign({},e,o()({},t.orderId,ie.F===t.type));default:return e}},isUpdating:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object(N.isFinite)(t.orderId)?t.orderId:JSON.stringify(t.orderId);switch(t.type){case ie.I:case ie.K:case ie.J:return Object.assign({},e,o()({},n,ie.I===t.type));default:return e}},items:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case ie.o:return e=Object(N.keyBy)(n.orders,"id"),Object.assign({},t,e);case ie.H:case ie.K:return e=o()({},n.order.id,n.order),Object.assign({},t,e);default:return t}},queries:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=t.orders.map(function(e){return e.id}),r=Object(Ee.c)(t.query);return Object.assign({},e,o()({},r,n));default:return e}},refunds:me,total:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=Object(Ee.c)(Object(N.omit)(t.query,"page"));return Object.assign({},e,o()({},n,t.total));default:return e}},notes:pe}),ge=n(47),Ie=n.n(ge),ve=n(607),Se=n(610),he=n(550);function je(e){return{type:ie.f,siteId:e}}var Ce=function(e){return Object(N.get)(e,"ui.route.path.current",null)},Re=n(739),Pe=n.n(Re),ye=n(115),Me=n.n(ye),Ne=function(e){function t(e){var n;return d()(this,t),(n=E()(this,p()(t).call(this,"Failed to validate with JSON schema"))).schemaErrors=e,n}return I()(t,e),t}(Pe()(Error)),Te=function(e){function t(e,n,r){var i;return d()(this,t),(i=E()(this,p()(t).call(this,e.message))).inputData=n,i.transformer=r,i}return I()(t,e),t}(Pe()(Error));var Ae,Le,ke,De=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.identity,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){return t||function(){var a=Object.assign({greedy:!0,verbose:!0},i),o=Me()(e,a),c=Me.a.filter(Object.assign({},e,e.type&&"object"===e.type&&{additionalProperties:!1}));n=function(e){if(!o(e))throw new Ne(o.errors);return c(e)},t=function(e){try{return r(e)}catch(t){throw new Te(t,e,r)}}}(),t(n(a))}},we=n(742),We=n(535),Ge=n.n(We),Ue=function(e){var t=e.apiVersion,n=e.apiNamespace,r=e.body,a=e.method,o=e.path,c=e.query,u=void 0===c?{}:c,s=e.formData,d=e.onSuccess,f=e.onFailure,l=e.onProgress,O=Ge()(e,["apiVersion","apiNamespace","body","method","path","query","formData","onSuccess","onFailure","onProgress"]),E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,b=n?{apiNamespace:n}:{apiVersion:t};return{type:"WPCOM_HTTP_REQUEST",body:r,method:a,path:o,query:i()({},u,b),formData:s,onSuccess:d||E,onFailure:f||E,onProgress:l||E,options:O}},He=n(565),Ve=n(611),Fe={},xe=new Set,Be={hasInitializedSites:!1,hasInitializedSection:!1,lastSection:null,lastSite:null},ze=["/jetpack/connect/user-type","/jetpack/connect/site-type","/jetpack/connect/site-topic"],qe=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},Ze=function(e){return e.data.map(function(e){return{message:qe(e.content.message),description:qe(e.content.description),featureClass:e.feature_class,callToAction:qe(e.CTA.message),id:e.id}})},Qe=function(e){return function(t,n){if(Be.hasInitializedSites&&Be.hasInitializedSection){var r=Be.lastSite;if(Object(He.c)(n(),r)){var a=Ce(n());Object(N.some)(ze,function(e){return Object(N.startsWith)(a,e)})||t(Ue({apiNamespace:"rest",method:"GET",path:"/v1.1/jetpack-blogs/".concat(r,"/rest-api/"),query:{path:"/jetpack/v4/jitm",query:JSON.stringify({message_path:"calypso:".concat(Be.lastSection,":admin_notices")}),http_envelope:1}},i()({},e,{messagePath:Be.lastSection})))}}}},Ke=function(e,t){return function(n,r){n(function(e,t,n){return{type:"JITM_SET",keyedPath:t+e,jitms:n.map(function(e){return i()({},e,{lastUpdated:Date.now()})})}}(e.siteId||e.site_id||Object(L.a)(r()),e.messagePath,t))}},Ye=function(e){return function(t,n){t(function(e,t){return{type:"JITM_SET",keyedPath:t+e,jitms:[]}}(e.siteId||e.site_id||Object(L.a)(n()),e.messagePath))}};Le="state/data-layer/wpcom/sites/jitm/index.js",Ae={},o()(Ae,"SECTION_SET",[Object(Se.a)({fetch:function(e){var t=Object(N.get)(e,["section","name"]);if(!Be.hasInitializedSection||!e.section||Be.lastSection!==t){switch(e.isLoading){case!1:return void(Be.hasInitializedSection=!0);case!0:return void(Be.hasInitializedSection=!1)}return Be.lastSection=t,Qe(e)}},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"SELECTED_SITE_SET",[Object(Se.a)({fetch:function(e){if(!Be.hasInitializedSites||Be.lastSite!==e.siteId)return Be.hasInitializedSites=!!e.siteId,Be.lastSite=e.siteId,Qe(e)},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"JITM_DISMISS",[Object(Se.a)({fetch:function(e){return Ue({apiNamespace:"rest",method:"POST",path:"/jetpack-blogs/".concat(e.siteId,"/rest-api/"),query:{path:"/jetpack/v4/jitm",body:JSON.stringify({feature_class:e.featureClass,id:e.id}),http_envelope:1,json:!1}},e)},onSuccess:N.noop,onError:N.noop})]),ke=Ae,xe.has(Le)||(xe.add(Le),Fe=Object(Ve.a)(Fe,ke));var Je,Xe=n(637),$e=n(643),et=Ie()("woocommerce:orders");function tt(e,t){if(et("API Error: ",t),e.failureAction)return i()({},e.failureAction,{error:t})}var nt,rt=(Je={},o()(Je,ie.p,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).del("orders/".concat(n))},onSuccess:function(e){return function(t){var n=e.siteId,r=e.siteSlug,i=e.orderId;t(Object(W.b)(n,i)),t(je(n)),t({type:"NAVIGATE",path:"/store/orders/".concat(r)}),t(Object(he.d)(Object(C.translate)("Order deleted."),{duration:8e3}))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(W.a)(r,i,t)),n(Object(he.a)(Object(C.translate)("Unable to delete order."),{duration:8e3}))}},fromApi:$e.a})]),o()(Je,ie.F,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return e.failureAction=Object(W.c)(t,n),Object(Xe.a)(t,e).get("orders/".concat(n))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.orderId;return Object(W.i)(r,i,n)},onError:tt})]),o()(Je,ie.I,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.order;return Object(N.isFinite)(n)?Object(Xe.a)(t,e).post("orders/".concat(n),r):Object(Xe.a)(t,e).post("orders",r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;"function"===typeof e.onSuccess&&"undefined"!==typeof n.id&&e.onSuccess(t,n.id),t(je(r)),t(Object(W.h)(r,i,n))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;"function"===typeof e.onFailure&&e.onFailure(n),et("API Error: ",t),n(Object(W.g)(r,i,t))}}})]),o()(Je,ie.m,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.query,r=Object(ve.stringify)(Object(N.omitBy)(n,function(e){return""===e}));return e.failureAction=Object(W.d)(t,n),Object(Xe.a)(t,e).getWithHeaders("orders?".concat(r))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.query,a=n.body,o=n.headers,c=Number(o["X-WP-Total"]);return Object(W.j)(r,i,a,c)},onError:tt})]),Je),it=n(690),at=(nt={},o()(nt,ie.v,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).get("orders/".concat(n,"/notes"))},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.e)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.d)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),o()(nt,ie.y,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.note;return Object(Xe.a)(t,e).post("orders/".concat(n,"/notes"),r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.c)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.b)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),nt),ot=n(662),ct=n(636),ut=n(116),st=n(697),dt=o()({},ie.k,[Object(Se.a)({fetch:function(e){var t=e.siteId;return Object(Xe.a)(t,e,"/wc/v3").get("data/continents")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return Object(st.c)(n,r)},onError:function(e,t){var n=e.siteId;return Object(st.b)(n,t)}})]),ft=n(663),lt=(n(743),u.a.lazy(function(){return Promise.all([n.e(0),n.e(137),n.e(139),n.e(140),n.e(154)]).then(n.bind(null,837))}));t.default=function(e){var t=e.order,n=e.accountSettings,r=e.packagesSettings,a=e.shippingLabelData,s=e.continents,d=e.context,f=e.items,l=t?t.id:null,O=void 0!==n;return{getReducer:function(){return Object(re.a)({extensions:Object(re.a)({woocommerce:Object(re.a)({woocommerceServices:Object(re.a)({1:Object(re.a)({shippingLabel:fe,packages:le.a,labelSettings:Oe.a})}),sites:Object(re.a)({1:Object(re.a)({orders:_e,data:Object(re.a)({locations:ft.a})})})})}),notices:ee.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){var e={extensions:{woocommerce:{sites:{1:{orders:{notes:{isLoading:o()({},l,!1)}}}}}}};return O?function(e){var c=n.storeOptions,u=n.formMeta,d=n.userMeta,f=n.formData,O=r.formData,E=r.storeOptions.dimension_unit,b=r.storeOptions.weight_unit,p=r.formSchema.custom?r.formSchema.custom.items:void 0,m=r.formSchema.predefined;return e.extensions.woocommerce.woocommerceServices={1:{shippingLabel:o()({},l,ce(a)),labelSettings:{storeOptions:c,meta:i()({},u,{pristine:!0,isLoaded:!0,user:d}),data:i()({},f)},packages:{modalErrors:{},pristine:!0,packages:O,dimensionUnit:E,weightUnit:b,packageSchema:p,predefinedSchema:m,packageData:{is_user_defined:!0},isLoaded:!0}}},e.extensions.woocommerce.sites[1].orders.isLoading=o()({},l,!1),e.extensions.woocommerce.sites[1].orders.items=o()({},l,t),e.extensions.woocommerce.sites[1].data={locations:s},e}(e):e},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-label-".concat(l)},getMiddlewares:function(){return[$,Object(ut.b)(Object(Ve.a)(ct.a,ot.a,rt,at,dt))]},View:function(){return"shipment_tracking"===d?u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(lt,{orderId:l})):u.a.createElement(Q,{orderId:l,items:f})}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{535:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(565);function r(e){return e.ui.selectedSiteId}},538:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return s}),n.d(t,"g",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"i",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"p",function(){return b}),n.d(t,"q",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"s",function(){return _}),n.d(t,"t",function(){return g}),n.d(t,"u",function(){return I}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return S}),n.d(t,"A",function(){return h}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return P}),n.d(t,"E",function(){return y}),n.d(t,"D",function(){return M}),n.d(t,"B",function(){return N}),n.d(t,"F",function(){return T}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return L}),n.d(t,"I",function(){return k}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return w}),n.d(t,"m",function(){return W}),n.d(t,"n",function(){return G}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return H}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return Q}),n.d(t,"Y",function(){return K}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return J}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return $}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ie}),n.d(t,"ib",function(){return ae}),n.d(t,"jb",function(){return oe}),n.d(t,"kb",function(){return ce}),n.d(t,"lb",function(){return ue}),n.d(t,"mb",function(){return se}),n.d(t,"nb",function(){return de}),n.d(t,"ob",function(){return fe}),n.d(t,"pb",function(){return le}),n.d(t,"rb",function(){return Oe}),n.d(t,"qb",function(){return Ee}),n.d(t,"sb",function(){return be}),n.d(t,"tb",function(){return pe}),n.d(t,"ub",function(){return me}),n.d(t,"vb",function(){return _e}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return Ie}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Se}),n.d(t,"Ab",function(){return he}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Ce}),n.d(t,"Db",function(){return Re}),n.d(t,"Eb",function(){return Pe}),n.d(t,"Fb",function(){return ye}),n.d(t,"Gb",function(){return Me}),n.d(t,"Hb",function(){return Ne}),n.d(t,"Ib",function(){return Te}),n.d(t,"U",function(){return Ae}),n.d(t,"V",function(){return Le}),n.d(t,"S",function(){return ke}),n.d(t,"T",function(){return De});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",i="WOOCOMMERCE_ACTION_LIST_CLEAR",a="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",o="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",c="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",u="WOOCOMMERCE_COUNT_REQUEST",s="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",d="WOOCOMMERCE_COUNT_REQUEST_FAILURE",f="WOOCOMMERCE_ERROR_SET",l="WOOCOMMERCE_ERROR_CLEAR",O="WOOCOMMERCE_LOCATIONS_REQUEST",E="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",b="WOOCOMMERCE_ORDER_DELETE",p="WOOCOMMERCE_ORDER_DELETE_FAILURE",m="WOOCOMMERCE_ORDER_DELETE_SUCCESS",_="WOOCOMMERCE_ORDER_INVOICE_SEND",g="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",I="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",h="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",C="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",R="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE",y="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",M="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",N="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",T="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",L="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",k="WOOCOMMERCE_ORDER_UPDATE",D="WOOCOMMERCE_ORDER_UPDATE_FAILURE",w="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",W="WOOCOMMERCE_ORDERS_REQUEST",G="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",H="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",x="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",Q="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",K="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",J="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",$="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",ue="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",se="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",de="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",le="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Me="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Ne="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Te="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Le="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",ke="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",De="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},540:function(e,t,n){"use strict";n.d(t,"j",function(){return E}),n.d(t,"t",function(){return b}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"h",function(){return _}),n.d(t,"g",function(){return g}),n.d(t,"v",function(){return I}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return S}),n.d(t,"e",function(){return h}),n.d(t,"l",function(){return j}),n.d(t,"p",function(){return C}),n.d(t,"n",function(){return M}),n.d(t,"f",function(){return A}),n.d(t,"o",function(){return L}),n.d(t,"q",function(){return k}),n.d(t,"d",function(){return D}),n.d(t,"b",function(){return w}),n.d(t,"i",function(){return W}),n.d(t,"c",function(){return G}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return H});var r=n(1),i=n(34),a=n(546),o=n(535),c=n(559),u=n(549),s=n(544),d=n(573),f=n(578),l=n(574),O=n(575),E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.isFetching},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.error},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded?r.labels:[]},g=function(e,t,n,r){return _(e,t,n).find(function(e){return e.label_id===r})},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.emailDetails},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.refreshedLabelStatus},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),a=h(e,t,n);if(!a)return null;var c=a.rates,u=c.values,s=c.available,d=[],f=0,l=0,O=function(e){if(!(e in s))return"continue";var t=u[e],n=t.serviceId,a=t.signatureRequired,o=s[e].default.rates,c=null,O=null;a in s[e]&&(c=s[e][a].rates,O=Object(r.find)(c,function(e){return n===e.service_id})||null);var E=Object(r.find)(o,function(e){return n===e.service_id});if(E){var b=E.retail_rate-E.rate,p=E.rate,m={title:E.title,retailRate:E.retail_rate,rateWithDiscount:p,addons:[],carrierId:E.carrier_id,carrierTitle:E.title.split("-")[0].trim()};null!==O&&(m.addons=[{title:Object(i.translate)("Signature Required"),rate:O.rate-E.rate}],p=O.rate),d.push(m),f+=Object(r.round)(b,2),l+=p}};for(var E in u)O(E);return d.length?{prices:d,discount:f,total:l}:null},C=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(Object(r.isEmpty)(i))return!1;var a=Object(d.a)(i.origin);if("US"===a.country&&Object(r.includes)(f.d,a.state))return!0;var c=Object(d.a)(i.destination);return!("US"!==c.country||!Object(r.includes)(f.d,c.state))||a.country!==c.country},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n)]}),R=function(e,t,n,a){var o=t.values,c=Object(d.a)(t),u=c.phone,s=c.postcode,O=c.state,E=c.country,b={};return["name","address","city","postcode","country"].forEach(function(e){o[e]||(b[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(f.a,E)&&!/^\d{5}(?:-\d{4})?$/.test(s)&&(b.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!O&&Object(l.j)(e,E,n)&&(b.state=Object(i.translate)("This field is required")),a&&(u?10!==u.split(/\D+/g).join("").replace(/^1/,"").length&&(b.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):b.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),b},P=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.isNormalized,o=e.isUnverifiable,c=e.normalized,u=e.ignoreValidation,s=e.fieldErrors;if((a||o)&&!c&&s)return s;if(a&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var d=R(t,e,n,r);return u&&Object.keys(d).forEach(function(e){u[e]&&delete d[e]}),d},y=function(e,t,n,a){var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(o,Object(r.fill)(Array(o.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var u={};return Object(r.forEach)(Object(r.pick)(t.items,o),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(u[e.tariffNumber]||(u[e.tariffNumber]=0),u[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var o={};"other"!==e.contentsType||e.contentsExplanation||(o.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(o.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<u[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(o.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(f.c,n)&&(o.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:a}})):o.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),o}),items:Object(r.mapValues)(Object(r.pick)(t.items,o),function(e,n){var a={};return e.description||(a.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?a.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),a})}},M=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},N=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var a=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return a.length?a:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},T=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},A=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!b(e,t,n))return{};var a=E(e,t,n),c=a.form,u=a.paperSize;if(Object(r.isEmpty)(c))return{};var s,d=c.destination.values.country,f=Object(l.g)(e,d,n),O=C(e,t,n);return{origin:P(c.origin,e,n,O),destination:P(c.destination,e,n),packages:(s=c.packages.selected,Object(r.mapValues)(s,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:y(c.packages.selected,c.customs,d,f),rates:N(c.rates),sidebar:T(u)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[E(e,t,n)]}),L=Object(a.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e),i=E(e,t,r).form,a="origin"===n&&C(e,t,r),c=R(e,i[n],r,a);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);return[E(e,t,r).form[n]]}),k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return!1;var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(a.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},D=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return null;var a=A(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(a.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(a.destination)?Object(c.a)(a.packages)?"packages":!C(e,t,n)||!Object(c.a)(a.customs)&&k(e,t,n)?Object(c.a)(a.rates)?"rates":null:"customs":"destination":"origin"},w=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);return!Object(r.isEmpty)(i)&&!D(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n),D(e,t,n)]}),W=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?Object(r.pick)(n,f.a):Object(r.pick)(n,f.b)},[l.d,O.b]),G=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?n:Object(r.pick)(n,f.b)},[l.d,O.b]),U=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!Object(l.j)(e,t,n))return null;var i=Object(l.i)(e,t,n),a={};return i.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),"US"!==t||Object(O.b)(e,n)?a:Object(r.omit)(a,f.d)},[l.i,O.b]),H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return b(e,t,n)&&Object(u.d)(e,n)&&Object(s.i)(e,n)&&Object(l.b)(e,n)}},541:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"f",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"m",function(){return b}),n.d(t,"n",function(){return p}),n.d(t,"o",function(){return m}),n.d(t,"q",function(){return _}),n.d(t,"p",function(){return g}),n.d(t,"r",function(){return I}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return S}),n.d(t,"u",function(){return h}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"B",function(){return R}),n.d(t,"x",function(){return P}),n.d(t,"C",function(){return y}),n.d(t,"z",function(){return M}),n.d(t,"A",function(){return N}),n.d(t,"D",function(){return T}),n.d(t,"E",function(){return A}),n.d(t,"F",function(){return L}),n.d(t,"G",function(){return k}),n.d(t,"H",function(){return D}),n.d(t,"I",function(){return w}),n.d(t,"J",function(){return W}),n.d(t,"K",function(){return G}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return H}),n.d(t,"N",function(){return V}),n.d(t,"y",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return Q}),n.d(t,"U",function(){return K}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return J}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return $}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return re}),n.d(t,"cb",function(){return ie}),n.d(t,"db",function(){return ae}),n.d(t,"eb",function(){return oe}),n.d(t,"fb",function(){return ce}),n.d(t,"gb",function(){return ue}),n.d(t,"hb",function(){return se}),n.d(t,"ib",function(){return de}),n.d(t,"jb",function(){return fe}),n.d(t,"kb",function(){return le}),n.d(t,"lb",function(){return Oe}),n.d(t,"nb",function(){return Ee}),n.d(t,"mb",function(){return be}),n.d(t,"ob",function(){return pe}),n.d(t,"pb",function(){return me}),n.d(t,"qb",function(){return _e}),n.d(t,"rb",function(){return ge}),n.d(t,"sb",function(){return Ie}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return Se}),n.d(t,"vb",function(){return he}),n.d(t,"wb",function(){return je}),n.d(t,"xb",function(){return Ce}),n.d(t,"zb",function(){return Re}),n.d(t,"Ab",function(){return Pe}),n.d(t,"Bb",function(){return ye}),n.d(t,"Cb",function(){return Me}),n.d(t,"Db",function(){return Ne}),n.d(t,"Eb",function(){return Te}),n.d(t,"Fb",function(){return Ae}),n.d(t,"Gb",function(){return Le}),n.d(t,"Hb",function(){return ke}),n.d(t,"Ib",function(){return De}),n.d(t,"Jb",function(){return we}),n.d(t,"yb",function(){return We}),n.d(t,"Lb",function(){return Ge}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return He}),n.d(t,"Nb",function(){return Ve}),n.d(t,"Pb",function(){return Fe}),n.d(t,"Qb",function(){return xe}),n.d(t,"Rb",function(){return Be});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",d="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",f="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",O="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",E="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",b="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",m="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",I="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",h="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",P="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",He="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",xe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},542:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},544:function(e,t,n){"use strict";n.d(t,"e",function(){return E}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return _}),n.d(t,"c",function(){return g}),n.d(t,"f",function(){return I}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return S}),n.d(t,"g",function(){return h});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(34),s=n(546),d=n(535),f=n(578),l=n(573),O=n(540),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},b=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},p=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(o()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return o()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),m=Object(s.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(O.e)(e,t,n),a=Object(l.a)(i.origin).country,o=Object(l.a)(i.destination).country,s=f.a.includes(a)&&!f.a.includes(o),b={custom:{title:Object(u.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){s&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(b[t]=i)})}),b},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.packages)return[];var a=b(r),o=Object(O.e)(e,t,n),c=Object(l.a)(o.origin).country,u=Object(l.a)(o.destination).country;return[].concat(i()(r.packages.custom||[]),i()(a.map(function(e){return(r.packages.predefined||{})[e]})),[c,u])}),_=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,a=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=a[t]||[];Object(c.forEach)(e,function(e,i){var a={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&a.selected++,a.packages.push(o()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=a})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),I=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=0,r=0,i=E(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var a=i.packages&&i.packages.predefined?i.packages.predefined:{},o=i.currentlyEditingPredefinedPackages;return Object.keys(o).forEach(function(e){var t=a[e],r=o[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(a).forEach(function(e){var t=a[e],n=o[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isLoaded},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetching},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetchError}},545:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return S}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return C});var r={};n.r(r),n.d(r,"accountSettings",function(){return a}),n.d(r,"packages",function(){return o}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return u}),n.d(r,"labelsStatus",function(){return s}),n.d(r,"labelRefund",function(){return d}),n.d(r,"labelsPrint",function(){return f}),n.d(r,"labelTestPrint",function(){return l}),n.d(r,"addressNormalization",function(){return O}),n.d(r,"serviceSettings",function(){return E}),n.d(r,"shippingCarrier",function(){return b}),n.d(r,"shippingCarriers",function(){return p}),n.d(r,"subscriptions",function(){return m}),n.d(r,"subscriptionActivate",function(){return _}),n.d(r,"shippingCarrierDelete",function(){return g}),n.d(r,"shippingCarrierTypes",function(){return I});var i=n(572),a="connect/account/settings",o="connect/packages",c=function(e){return"connect/label/".concat(e)},u=function(e){return"connect/label/".concat(e,"/rates")},s=function(e,t){return"connect/label/".concat(e,"/").concat(t.join())},d=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},f=function(){return"connect/label/print"},l=function(){return"connect/label/preview"},O=function(){return"connect/normalize-address"},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},b=function(){return"connect/shipping/carrier"},p=function(){return"connect/shipping/carriers"},m=function(){return"connect/subscriptions"},_=function(e){return"connect/subscription/".concat(e,"/activate")},g=function(e){return"connect/shipping/carrier/".concat(e)},I=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},S=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(v)},h=function(e,t,n){return Object(i.a)(e).put(t,n,"wc/v1").catch(v)},j=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(v)},C=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(v)}},546:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n(625),a=n.n(i),o=(n(113),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},u=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,s=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=u(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!a()(c,t)&&s.cache.clear(),t=c,s.apply(void 0,[e].concat(i))},{memoizedSelector:s})}},547:function(e,t,n){"use strict";n.d(t,"q",function(){return P}),n.d(t,"U",function(){return y}),n.d(t,"P",function(){return L}),n.d(t,"x",function(){return k}),n.d(t,"A",function(){return D}),n.d(t,"o",function(){return w}),n.d(t,"p",function(){return W}),n.d(t,"V",function(){return G}),n.d(t,"C",function(){return U}),n.d(t,"m",function(){return H}),n.d(t,"n",function(){return V}),n.d(t,"g",function(){return F}),n.d(t,"T",function(){return x}),n.d(t,"W",function(){return B}),n.d(t,"w",function(){return z}),n.d(t,"v",function(){return q}),n.d(t,"s",function(){return Z}),n.d(t,"d",function(){return Q}),n.d(t,"S",function(){return K}),n.d(t,"t",function(){return Y}),n.d(t,"b",function(){return J}),n.d(t,"E",function(){return X}),n.d(t,"a",function(){return $}),n.d(t,"i",function(){return ee}),n.d(t,"G",function(){return te}),n.d(t,"F",function(){return ne}),n.d(t,"R",function(){return re}),n.d(t,"Q",function(){return ie}),n.d(t,"D",function(){return ae}),n.d(t,"O",function(){return oe}),n.d(t,"H",function(){return ce}),n.d(t,"J",function(){return ue}),n.d(t,"L",function(){return se}),n.d(t,"K",function(){return de}),n.d(t,"I",function(){return fe}),n.d(t,"h",function(){return le}),n.d(t,"Y",function(){return Oe}),n.d(t,"M",function(){return Ee}),n.d(t,"N",function(){return be}),n.d(t,"B",function(){return he}),n.d(t,"j",function(){return je}),n.d(t,"y",function(){return Ce}),n.d(t,"r",function(){return Re}),n.d(t,"e",function(){return Pe}),n.d(t,"k",function(){return ye}),n.d(t,"z",function(){return Me}),n.d(t,"f",function(){return Ne}),n.d(t,"l",function(){return Te}),n.d(t,"X",function(){return Ae}),n.d(t,"u",function(){return Le}),n.d(t,"c",function(){return ke});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(34),u=n(1),s=n(545),d=Object(u.memoize)(function(){if(Object(u.get)(window,"navigator.msSaveOrOpenBlob"))return"ie";if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(Object(u.includes)(navigator.userAgent,"Firefox"))return"addon";if(Object(u.includes)(navigator.userAgent,"Safari")&&!Object(u.includes)(navigator.userAgent,"Chrome"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),f=null,l=function(e){return new Promise(function(t,n){f&&document.body.removeChild(f),(f=document.createElement("iframe")).src=e,f.style.position="fixed",f.style.left="-999px",f.onload=function(){t()},f.onerror=function(e){n(e)},document.body.appendChild(f)})},O=function(e,t){var n=function(e,t){for(var n=atob(e),r=n.length,i=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++)i[a]=n.charCodeAt(a);return new Blob([i],{type:t})}(e.b64Content,e.mimeType),r="ie"!==d()?URL.createObjectURL(n):null;switch(d()){case"native":return l(r).then(function(){f.contentWindow.print(),URL.revokeObjectURL(r)});case"addon":var i=window.open(r);return setTimeout(function(){return URL.revokeObjectURL(r)},1e3),i?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));case"ie":return window.navigator.msSaveOrOpenBlob(n,t)?Promise.resolve():Promise.reject(new Error("Unable to download the PDF"));default:return l(r),setTimeout(function(){return URL.revokeObjectURL(r)},0),Promise.resolve()}},E=n(550),b=n(559),p=n(541),m=function(e,t,n,r,i){n({type:p.A,group:i,orderId:e,siteId:t});return s.c(t,s.e.addressNormalization(),{address:r,type:i}).then(function(r){n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!0,fieldErrors:r.field_errors,normalized:r.normalized,isTrivialNormalization:r.is_trivial_normalization})}).catch(function(r){throw n(E.a(Object(c.translate)("Error validating %(group)s address: %(error)s",{args:{group:i,error:r}}))),n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!1}),r})},_=n(622),g=n(540),I=n(689),v=n(641),S=n(544),h=n(549),j=n(573),C="label-image-download-failed",R="label-image-download-printing",P=function(e,t){return function(n){n({type:p.wb,orderId:e,siteId:t,isFetching:!0}),s.b(t,s.e.orderLabels(e)).then(function(r){n(o()({type:p.O,siteId:t,orderId:e},r))}).catch(function(r){n({type:p.ub,orderId:e,siteId:t,error:!0}),console.error(r)}).then(function(){return n({type:p.wb,orderId:e,siteId:t,isFetching:!1})})}},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:p.Hb,siteId:t,orderId:e,stepName:n,expanded:r}},M=function(e,t,n,r){var i=r(),a=Object(g.j)(i,e,t).form,o=Object(g.d)(i,e,t);o&&!a[o].expanded&&n(y(e,t,o))},N=function(e,t){var n=Object(u.pick)(e,["id","box_id","service_id","length","width","height","weight","signature","is_letter"]);return t&&(n.contents_type=e.contentsType||"merchandise","other"===e.contentsType&&(n.contents_explanation=e.contentsExplanation),n.restriction_type=e.restrictionType||"none","other"===e.restrictionType&&(n.restriction_comments=e.restrictionComments),n.non_delivery_option=e.abandonOnNonDelivery?"abandon":"return",n.itn=e.itn||"",n.items=Object(u.uniqBy)(e.items,"product_id").map(function(n){var r=n.product_id,i=Object(u.sumBy)(Object(u.filter)(e.items,{product_id:r}),"quantity");return{description:t[r].description,quantity:i,value:i*t[r].value,weight:i*t[r].weight,hs_tariff_number:t[r].tariffNumber||"",origin_country:t[r].originCountry,product_id:r}})),n},T=function(e,t){return{type:p.D,orderId:e,siteId:t}},A=function e(t,n,r,i){var a=i(),o=Object(g.d)(a,t,n);if(o&&"rates"!==o)M(t,n,r,i);else{var d=Object(g.j)(a,t,n).form,f=d.origin,l=d.destination,O=d.packages,b=d.customs;r(E.c("wcs-label-rates"));var m=Object(g.p)(i(),t,n)?b.items:null,_=Object(u.map)(O.selected,function(e){return N(e,m)});(function(e,t,n,r,i,a){var o={origin:r,destination:i,packages:a};return n({type:p.ab,requestData:o,siteId:t,orderId:e}),new Promise(function(r,i){var a=null,c=function(c){c||(n({type:p.Z,requestData:o,siteId:t,orderId:e}),a?setTimeout(function(){return i(a)},0):setTimeout(r,0))};c(!0),s.c(t,s.e.getLabelRates(e),o).then(function(r){n({type:p.Ab,rates:r.rates,requestData:o,siteId:t,orderId:e})}).catch(function(e){return a=e}).then(function(){return c(!1)})})})(t,n,r,f.values,l.values,_).then(function(){return M(t,n,r,i)}).catch(function(a){console.error(a),r(E.a(a.toString(),{id:"wcs-label-rates",button:Object(c.translate)("Retry"),onClick:function(){return e(t,n,r,i)}}))})}},L=function(e,t,n,r){return function(i,a){var o=Object(S.a)(a(),t)[r];i({type:p.zb,siteId:t,orderId:e,packageId:n,boxTypeId:r,box:o})}},k=function(e,t){return function(n,r){var i,a=Object(g.j)(r(),e,t).form,o=a.origin,c=a.destination,u=Object(g.f)(r(),e,t),s=[];o.ignoreValidation||Object(b.a)(u.origin)||o.isNormalized||o.normalizationInProgress||s.push(m(e,t,n,o.values,"origin")),(o.ignoreValidation||Object(b.a)(u.origin))&&n(y(e,t,"origin")),c.ignoreValidation||Object(b.a)(u.destination)||c.isNormalized||c.normalizationInProgress||s.push(m(e,t,n,c.values,"destination")),(c.ignoreValidation||Object(b.a)(u.destination))&&n(y(e,t,"destination")),(i=s,Promise.all(i.map(function(e){return e.catch(function(e){return e})}))).then(function(){return A(e,t,n,r)}).then(function(){var i=function(e,t,n){var r=n(),i=Object(h.i)(r,t),a=Object(g.j)(r,e,t),o=a.form.packages.selected,c=a.openedPackageId,u=o[c];if(u&&"not_selected"===u.box_id&&i.last_box_id)return{packageId:c,boxId:i.last_box_id}}(e,t,r)||{},a=i.packageId,o=i.boxId;void 0!==a&&void 0!==o&&n(L(e,t,a,o))}),n({type:p.U,orderId:e,siteId:t})}},D=function(e,t){return function(n){n({type:p.Ob,orderId:e,siteId:t})}},w=function(e,t,n){return function(r,i){r({type:p.N,orderId:e,siteId:t,force:n}),Object(g.j)(i(),e,t).form.needsPrintConfirmation&&r(T(e,t))}},W=function(e,t){return function(n){n({type:p.y,orderId:e,siteId:t})}},G=function(e,t,n,r,i){return{type:p.Ib,siteId:t,orderId:e,group:n,name:r,value:i}},U=function(e,t,n,r){return{type:p.jb,siteId:t,orderId:e,group:n,selectNormalized:r}},H=function(e,t,n){return{type:p.L,siteId:t,orderId:e,group:n}},V=function(e,t,n){return{type:p.M,siteId:t,orderId:e,group:n}},F=function(e,t,n){return function(r,i){r({type:p.J,siteId:t,orderId:e,group:n}),A(e,t,r,i)}},x=function(e,t,n){return function(r,i){var a=Object(g.j)(i(),e,t).form[n];if(a.ignoreValidation){r(function(e,t,n){return{type:p.db,siteId:t,orderId:e,group:n}}(e,t,n));var o=Object(g.f)(i(),e,t);if(Object(b.a)(o[n]))return;a=Object(g.j)(i(),e,t).form[n]}return m(e,t,r,Object(g.j)(i(),e,t).form[n].values,n).then(function(){var a=Object(g.j)(i(),e,t).form[n],o=a.values,c=a.normalized,s=a.expanded;Object(u.isEqual)(o,c)&&(s&&r(y(e,t,n)),A(e,t,r,i))})}},B=function(e,t,n,r){return{type:p.Jb,siteId:t,orderId:e,packageId:n,value:r}},z=function(e,t,n){return{type:p.T,siteId:t,orderId:e,openedPackageId:n}},q=function(e,t,n){return{type:p.S,siteId:t,orderId:e,movedItemIndex:n}},Z=function(e,t,n,r,i){return{type:p.P,siteId:t,orderId:e,originPackageId:n,movedItemIndex:r,targetPackageId:i}},Q=function(e,t){return{type:p.G,siteId:t,orderId:e}},K=function(e,t,n){return{type:p.Db,targetPackageId:n,siteId:t,orderId:e}},Y=function(e,t){return{type:p.Q,siteId:t,orderId:e}},J=function(e,t){return{type:p.E,siteId:t,orderId:e}},X=function(e,t,n,r,i){return{type:p.lb,siteId:t,orderId:e,sourcePackageId:n,movedItemIndex:r,added:i}},$=function(e,t,n){return{type:p.B,siteId:t,orderId:e,targetPackageId:n}},ee=function(e,t){return function(n,r){n(y(e,t,"packages")),n(function(e,t){return{type:p.ib,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},te=function(e,t,n,r){return{type:p.nb,siteId:t,orderId:e,packageId:n,contentsType:r}},ne=function(e,t,n,r){return{type:p.mb,siteId:t,orderId:e,packageId:n,contentsExplanation:r}},re=function(e,t,n,r){return{type:p.Cb,siteId:t,orderId:e,packageId:n,restrictionType:r}},ie=function(e,t,n,r){return{type:p.Bb,siteId:t,orderId:e,packageId:n,restrictionComments:r}},ae=function(e,t,n,r){return{type:p.kb,siteId:t,orderId:e,packageId:n,abandonOnNonDelivery:r}},oe=function(e,t,n,r){return{type:p.xb,siteId:t,orderId:e,packageId:n,itn:r}},ce=function(e,t,n,r){return{type:p.ob,siteId:t,orderId:e,productId:n,description:r}},ue=function(e,t,n,r){return{type:p.qb,siteId:t,orderId:e,productId:n,tariffNumber:r}},se=function(e,t,n,r){return{type:p.sb,siteId:t,orderId:e,productId:n,weight:r}},de=function(e,t,n,r){return{type:p.rb,siteId:t,orderId:e,productId:n,value:r}},fe=function(e,t,n,r){return{type:p.pb,siteId:t,orderId:e,productId:n,originCountry:r}},le=function(e,t){return function(n,r){n(y(e,t,"customs")),n(function(e,t){return{type:p.hb,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},Oe=function(e,t,n,r,i,a){return{type:p.Lb,siteId:t,carrierId:i,orderId:e,packageId:n,serviceId:r,signatureRequired:a}},Ee=function(e,t,n){return{type:p.tb,siteId:t,orderId:e,value:n}},be=function(e,t,n){return{type:p.vb,siteId:t,orderId:e,value:n}},pe=function(e,t,n,r){return{type:p.Y,orderId:e,siteId:t,response:n,error:r}},me=function(e,t,n,r,i){n(pe(e,t,null,!0));var a={button:Object(c.translate)("Go to Credit Cards settings."),onClick:function(){window.open("admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings")}};n(E.a(i.toString(),a)),n(T(e,t)),A(e,t,n,r,u.noop)},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"order-#".concat(e,"-label")+(t?"-reprint":"")+".pdf"},ge=function(e,t,n,r,i,a){n(w(e,t,!0)),n(T(e,t)),i||(Object(g.u)(r(),e,t)&&n(Object(I.a)(t,e,{note:Object(c.translate)("Your order has been shipped. The tracking number is %(trackingNumbers)s.","Your order consisting of %(packageCount)d packages has been shipped. The tracking numbers are %(trackingNumbers)s.",{args:{packageCount:a.length,trackingNumbers:a.map(function(e){var t=e.tracking,n={usps:"USPS",ups:"UPS"}[e.carrier_id||""];return n?"".concat(t," (").concat(n,")"):t}).join(", ")},count:a.length}),customer_note:!0})),Object(g.v)(r(),e,t)&&n(Object(v.f)(t,{id:e,status:"completed"})))},Ie=function(e){return E.d(Object(c.translate)("Your shipping label was purchased successfully","Your %(count)d shipping labels were purchased successfully",{count:e,args:{count:e}}))},ve=function(e,t){var n=Object(c.translate)('Your shipping label was purchased successfully, but could not be printed automatically. Click "Reprint" to try again.','Your shipping labels were purchased successfully, but some of them could not be printed automatically. Click "Reprint" to try again.',{count:e});return E.a(n,{id:C,button:Object(c.translate)("Reprint"),onClick:t})};var Se=function e(t,n,r,a,o){var f=Object(u.find)(o,{status:"PURCHASE_ERROR"});f?me(t,n,r,a,f.error):Object(u.every)(o,{status:"PURCHASED"})?(r(pe(t,n,o,!1)),function e(t,n,r,a,o){var u=arguments,f=1===o.length?[{labelId:o[0].label_id}]:o.map(function(e,t){return{caption:Object(c.translate)("PACKAGE %(num)d (OF %(total)d)",{args:{num:t+1,total:o.length}}),labelId:e.label_id}}),l=Object(g.j)(a(),t,n).paperSize,b=Object(_.b)(l,f),m=function(){r(Ie(f.length))},I=function(){r(E.c(C)),r(E.b(Object(c.translate)("Printing\u2026"),{id:R})),e.apply(void 0,i()(u))},v=!1,S=o.map(function(e){return e.commercial_invoice_url}).filter(function(e){return e});if(S&&0<S.length){r(E.b(Object(c.translate)("Note: A customs form will open in a new tab and must be printed and included on this international shipment."),{}));var h=!0,j=!1,P=void 0;try{for(var y,M=S[Symbol.iterator]();!(h=(y=M.next()).done);h=!0){var N=y.value;window.open(N)}}catch(A){j=!0,P=A}finally{try{h||null==M.return||M.return()}finally{if(j)throw P}}}s.b(n,b).then(function(e){r(E.c(R)),"addon"===d()?(m(),r({type:p.Eb,orderId:t,siteId:n,fileData:e,labels:o})):O(e,_e(t)).then(function(){m()}).catch(function(e){r(E.a(e.toString())),v=!0}).then(function(){ge(t,n,r,a,v,o)})}).catch(function(){r(w(t,n,!0)),r(T(t,n)),r(E.c(R)),r(ve(o.length,I))})}(t,n,r,a,o)):setTimeout(function(){var i=o.filter(function(e){return"PURCHASED"===e.status}),c=o.filter(function(e){return"PURCHASED"!==e.status}).map(function(e){return e.label_id});(function e(t,n,r,i){var a=1e3;return 0===i&&(a=2e3),s.b(n,s.e.labelsStatus(t,r)).then(function(e){return e.labels}).catch(function(o){if(!Object(u.includes)(o,"cURL error 28")||i>=3)throw o;return new Promise(function(o){setTimeout(function(){return o(e(t,n,r,i+1))},a)})})})(t,n,c,0).then(function(o){return e(t,n,r,a,o.concat(i))}).catch(function(e){return me(t,n,r,a,e)})},1e3)},he=function(e,t){return function(n,r){var i=null,a=null,c=function(e){return i=e},d=function(e){a=e.labels},f=function(o){o?n({type:p.X,orderId:e,siteId:t}):i?me(e,t,n,r,i):Se(e,t,n,r,a)},l=Object(g.j)(r(),e,t).form,O=[];if(!l.origin.isNormalized){var b=m(e,t,n,l.origin.values,"origin");O.push(b)}if(!l.destination.isNormalized){var _=m(e,t,n,l.destination.values,"destination");O.push(_)}Promise.all(O).then(function(n){if(Object(u.every)(n)){l=Object(g.j)(r(),e,t).form;var i=Object(g.p)(r(),e,t)?l.customs.items:null,a={async:!0,origin:Object(j.a)(l.origin),destination:Object(j.a)(l.destination),packages:Object(u.map)(l.packages.selected,function(e,t){var n=l.rates.values[t],r=n.serviceId,a=n.signatureRequired,c=a in l.rates.available[t]?a:"default",s=N(e,i),d=Object(u.find)(l.rates.available[t][c].rates,function(e){return r===e.service_id});return o()({},s,{shipment_id:d.shipment_id,rate_id:d.rate_id,service_id:r,carrier_id:d.carrier_id,service_name:d.title,products:Object(u.flatten)(e.items.map(function(e){return Object(u.fill)(new Array(e.quantity),e.product_id)}))})})},O=Object(h.e)(r(),t);Object(u.isBoolean)(O)&&(a.email_receipt=O),f(!0),s.c(t,s.e.orderLabels(e),a).then(d).catch(c).then(function(){return f(!1)})}}).catch(function(e){console.error(e),n(E.a(e.toString()))})}},je=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t);O(i.form.fileData,_e(e)).then(function(){n(w(e,t,!0)),n(T(e,t)),ge(e,t,n,r,!1,i.form.labelsToPrint)}).catch(function(e){return n(E.a(e.toString()))})}},Ce=function(e,t,n){return{type:p.V,labelId:n,siteId:t,orderId:e}},Re=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t);Object(u.every)(i.labels,{statusUpdated:!0})||i.statusRetrivalInProgress||(n({type:p.Gb,orderId:e}),s.b(t,s.e.labelsStatus(e,i.labels.map(function(e){return e.label_id}))).then(function(r){var i=r.labels;n({type:p.Fb,orderId:e,siteId:t,labelsData:i,error:null})}).catch(function(r){n({type:p.Fb,orderId:e,siteId:t,labelsData:null,error:r}),n(E.a("Failed to retrieve shipping label refund status: ".concat(r)))}))}},Pe=function(e,t){return{type:p.H,orderId:e,siteId:t}},ye=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t).refundDialog.labelId,a=null,o=null,u=function(r){r?n({type:p.bb,orderId:e,siteId:t}):(n({type:p.cb,response:o,error:a,orderId:e,siteId:t}),n(a?E.a(a.toString()):E.d(Object(c.translate)("The refund request has been sent successfully."),{duration:5e3})))};u(!0),s.c(t,s.e.labelRefund(e,i)).then(function(e){o=e.refund}).catch(function(e){a=e}).then(function(){return u(!1)})}},Me=function e(t,n,r){return function(i,a){i({type:p.W,labelId:r,orderId:t,siteId:n}),i(E.c("wcs-reprint-label"));var o=Object(g.j)(a(),t,n),u=Object(_.b)(o.paperSize,[{labelId:r}]);s.b(n,u).then(function(e){var c=Object(g.j)(a(),t,n);o.paperSize===c.paperSize&&i({type:p.gb,labelId:r,orderId:t,siteId:n,fileData:e})}).catch(function(a){i({type:p.fb,labelId:r,orderId:t,siteId:n}),i(E.a(a.toString(),{id:"wcs-reprint-label",button:Object(c.translate)("Retry"),onClick:function(){return i(e(t,n,r))}}))})}},Ne=function(e,t){return{type:p.I,orderId:e,siteId:t}},Te=function(e,t){return function(n,r){n({type:p.K,orderId:e,siteId:t});var i=Object(g.j)(r(),e,t);O(i.reprintDialog.fileData,_e(e,!0)).catch(function(e){console.error(e),n(E.a(e.toString()))}).then(function(){return n(Ne(e,t))})}},Ae=function(e,t,n){return function(r,i){r({type:p.Kb,siteId:t,orderId:e,value:n});var a=Object(g.j)(i(),e,t);null!=a.reprintDialog&&r(Me(e,t,a.reprintDialog.labelId))}},Le=function(e,t,n){return{type:p.R,labelId:n,siteId:t,orderId:e}},ke=function(e,t){return{type:p.F,orderId:e,siteId:t}}},549:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return O}),n.d(t,"n",function(){return E}),n.d(t,"o",function(){return b}),n.d(t,"e",function(){return p}),n.d(t,"q",function(){return m}),n.d(t,"p",function(){return _}),n.d(t,"k",function(){return g}),n.d(t,"l",function(){return I}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return S});var r=n(1),i=n(535),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.meta},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.storeOptions},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.enabled},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.selected_payment_method_id},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.email_receipts},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.paper_size},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return f}),n.d(t,"b",function(){return l});var r=n(536),i=n.n(r),a=n(1),o={debounce:a.debounce,isPlainObject:a.isPlainObject,uniqueId:a.uniqueId},c=(n(46),o.uniqueId);function u(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,a=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},a,{noticeId:r||c(),status:e,text:t})}}var d=s.bind(null,"is-success"),f=s.bind(null,"is-error"),l=s.bind(null,"is-info");s.bind(null,"is-warning"),s.bind(null,"is-plain")},559:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},562:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return o}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return u}),n.d(t,"dismissModal",function(){return s}),n.d(t,"savePackage",function(){return d}),n.d(t,"updatePackagesField",function(){return f}),n.d(t,"toggleOuterDimensions",function(){return l}),n.d(t,"toggleAll",function(){return O}),n.d(t,"togglePackage",function(){return E}),n.d(t,"savePredefinedPackages",function(){return b}),n.d(t,"removePredefinedPackage",function(){return p}),n.d(t,"setModalErrors",function(){return m}),n.d(t,"setIsSaving",function(){return _}),n.d(t,"setIsFetching",function(){return g}),n.d(t,"setIsFetchError",function(){return I}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return S}),n.d(t,"submit",function(){return h});var r=n(545),i=n(541),a=n(544),o=function(e){return{type:i.g,siteId:e}},c=function(e,t){return{type:i.k,index:t,siteId:e}},u=function(e,t){return{type:i.i,package:t,siteId:e}},s=function(e){return{type:i.h,siteId:e}},d=function(e,t){return{type:i.m,packageData:t,siteId:e}},f=function(e,t){return{type:i.w,values:t,siteId:e}},l=function(e){return{type:i.u,siteId:e}},O=function(e,t,n,r){return{type:i.t,serviceId:t,groupId:n,checked:r,siteId:e}},E=function(e,t,n){return{type:i.v,serviceId:t,packageId:n,siteId:e}},b=function(e){return{type:i.n,siteId:e}},p=function(e,t,n){return{type:i.l,serviceId:t,packageId:n,siteId:e}},m=function(e,t){return{type:i.s,value:t,siteId:e}},_=function(e,t){return{type:i.r,isSaving:t,siteId:e}},g=function(e,t){return{type:i.p,isFetching:t,siteId:e}},I=function(e,t){return{type:i.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:i.o,siteId:e,mode:t}},S=function(e){return function(t,n){var o=Object(a.e)(n(),e);o&&(o.packages||o.isFetching)||(t(g(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,a=n.formSchema,o=n.storeOptions;t({type:i.j,packages:r,dimensionUnit:o.dimension_unit,weightUnit:o.weight_unit,packageSchema:a.custom.items,predefinedSchema:a.predefined,siteId:e})}).catch(function(n){console.error(n),t(I(e,!0))}).then(function(){return t(g(e,!1))}))}},h=function(e,t,n){return function(i,o){var c=Object(a.e)(o(),e);i(_(e,!0)),r.d(e,r.e.packages,c.packages).then(t).catch(n).then(function(){return i(_(e,!1))})}}},563:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(538);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},565:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return a});var r=function(){return{}},i=function(){return""},a=function(){return!0}},572:function(e,t,n){"use strict";var r=n(76);t.a=r.a},573:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},574:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return E}),n.d(t,"g",function(){return b}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"j",function(){return _}),n.d(t,"d",function(){return g});var r=n(1),i=n(546),a=n(535),o=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.isArray)(c(e,t))},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.b===c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.a===c(e,t)},f=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=r[e],o=u(t,a);return[o,o&&c(t,a)]}},l=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},f(0)),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},E=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var o=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(o,"name")},f(1)),b=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},f(1)),p=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},f(1)),m=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);if(!u(e,i))return n;var o=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!o)return n;var s=Object(r.find)(o.states,{code:n});return s?s.name:n},f(2)),_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!Object(r.isEmpty)(p(e,t,n))},g=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=O(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},f(0))},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},576:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return u}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(545),i=n(541),a=n(549),o=function(e,t,n){return{type:i.e,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.f,siteId:e,key:t,value:n}},u=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,a=n.formMeta,o=n.formData,c=n.userMeta;t(function(e,t,n,r,a){return{type:i.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:a}}(e,r,o,a,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},s=function(e,t,n){return function(i,o){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(a.f)(o())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},d=function(e){return{type:i.d,siteId:e}},f=function(e){return{type:i.c,siteId:e}}},577:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return s});var r=n(1),i=n(535),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(o(e,n)[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?o(e,n)[t]:null},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},578:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],a=["AA","AE","AP"],o=["IR","SY","KP","CU","SD"]},579:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(535),a=n(586),o=n(542),c=n(575),u=n(587),s=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=Object(a.b)(e,n);if(!Object(r.isArray)(o))return!1;var d=Object(r.find)(o,{id:t});if(!d||!Object(r.isArray)(d.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var f=d.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(f,function(t){var r=t.id;return Object(u.a)(e,r,n)})},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(a.b)(e,n);if(!Object(r.isArray)(d))return!1;var f=Object(r.find)(d,{id:t});if(!f)return!1;if(o.b===f.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(f.methodIds))return!1;var l=f.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(l,function(t){var r=t.id;return Object(u.b)(e,r,n)})}},586:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u});var r=n(1),i=n(535),a=(n(542),n(579)),o=n(612),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})}},587:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(535),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===o(e,n)[t]},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},592:function(e,t,n){"use strict";var r,i=n(35),a=n.n(i),o=n(36),c=n.n(o),u=n(1),s=n(46),d=Object(s.b)({},(r={},a()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,n))}),a()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(u.omit)(e,n):e}),a()(r,"ROUTE_SET",function(e){return Object(u.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),f=Object(s.b)({},a()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,Date.now()))}));t.a=Object(s.a)({items:d,lastTimeShown:f})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u});var r=n(538);function i(e){return{type:r.d,actionList:e}}function a(){return{type:r.b}}function o(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function u(e,t){return{type:r.c,actionList:e,error:t}}},609:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c});var r=n(1),i=n(535),a=(n(639),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])}),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","items",t],null)}},610:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r,i=n(36),a=n.n(i),o=n(536),c=n.n(o),u=n(657),s=n.n(u),d=n(1),f=n(46),l=n(113),O=function(e){return Object(d.get)(e,"meta.dataLayer.data",void 0)},E=function(e){return Object(d.get)(e,"meta.dataLayer.error",void 0)},b=function(e){return Object(d.get)(e,"meta.dataLayer.progress",void 0)},p=(Object(f.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,o=n.status;return Object.assign(a()({},e),{status:o},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(d.get)(n,"meta.dataLayer.trackRequest")||b(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(d.get)(t,"dataLayer.requestKey");return r||s()(n)}(n),i=function(e){return void 0!==E(e)?"failure":void 0!==O(e)?"success":"pending"}(n),o=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(a()({},t,{dispatch:function(e){return t.dispatch(Object(d.merge)(e,{meta:{dataLayer:o}}))}}),n)}},function(e){return e.fetch||Object(l.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(l.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(l.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?d.noop:n,i=e.onSuccess,a=void 0===i?d.noop:i,o=e.onError,c=void 0===o?d.noop:o,u=e.onProgress,s=void 0===u?d.noop:u,f=e.fromApi,l=void 0===f?d.identity:f,p=E(t);if(p)return c(t,p);var m=O(t);if(m)try{return a(t,l(m))}catch(g){return c(t,g)}var _=b(t);return _?s(t,_):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},611:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},612:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(535),a=n(542),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=o(e,n);return a&&Object(r.isObject)(a[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o(e,n)&&a.b===o(e,n)[t]}},613:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(545),i=n(563),a=n(541),o=n(587),c=function(e,t,n){return function(c,u){if(!Object(o.a)(u(),n,e)&&!Object(o.b)(u(),n,e)){var s={type:a.Pb,instanceId:n,siteId:e};return c(s),r.b(e,r.e.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:a.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,s,t))})}}}},614:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(a){var o=(t.properties||{})[a];i[a]=e(o,n[a],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},616:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return N});var r=n(111),i=n.n(r),a=n(107),o=n.n(a),c=n(108),u=n.n(c),s=n(530),d=n.n(s),f=n(529),l=n.n(f),O=n(534),E=n.n(O),b=n(531),p=n.n(b),m=n(35),_=n.n(m),g=n(10),I=n.n(g),v=n(109),S=n(164),h=n.n(S),j=n(47),C=n.n(j),R=n(1),P=n(546),y=Object(P.a)(function(e){return Object(R.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),M=C()("calypso:localized-moment"),N=I.a.createContext(h.a),T=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=d()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(E()(n),"state",{moment:h.a,momentLocale:h.a.locale()}),n}return p()(t,e),u()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return M("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(626)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),M("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:M("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(h.a.locale()!==r&&h.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(h.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return I.a.createElement(N.Provider,{value:this.state},this.props.children)}}]),t}(I.a.Component),A=Object(v.b)(function(e){return{currentLocale:y(e)}})(T)},618:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});n(1);var r=n(663),i=n.n(r),a=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function o(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){a.innerHTML=e;var t=a.textContent;return a.innerHTML="",t}(e)}function c(e){return i()(e)}String.fromCharCode(160)},622:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return d});var r=n(34),i=n(607),a=n(1),o=n(545),c={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(a.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},u=function(e){return Object(a.reduce)(c,function(t,n,r){var i=n.name,a=n.exclude;return a&&a(e)||(t[r]=i),t},{})},s=function(e,t,n){if(!c[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(a.filter)(Object(a.map)(t,"labelId")).join(","),caption_csv:Object(a.filter)(Object(a.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(i.stringify)(r)},d=function(e,t){return s(e,t,o.e.labelsPrint())}},626:function(e,t,n){var r={"./af":[392,2],"./af.js":[392,2],"./ar":[399,3],"./ar-dz":[393,4],"./ar-dz.js":[393,4],"./ar-kw":[394,5],"./ar-kw.js":[394,5],"./ar-ly":[395,6],"./ar-ly.js":[395,6],"./ar-ma":[396,7],"./ar-ma.js":[396,7],"./ar-sa":[397,8],"./ar-sa.js":[397,8],"./ar-tn":[398,9],"./ar-tn.js":[398,9],"./ar.js":[399,3],"./az":[400,10],"./az.js":[400,10],"./be":[401,11],"./be.js":[401,11],"./bg":[402,12],"./bg.js":[402,12],"./bm":[403,13],"./bm.js":[403,13],"./bn":[405,14],"./bn-bd":[404,15],"./bn-bd.js":[404,15],"./bn.js":[405,14],"./bo":[406,16],"./bo.js":[406,16],"./br":[407,17],"./br.js":[407,17],"./bs":[408,18],"./bs.js":[408,18],"./ca":[409,19],"./ca.js":[409,19],"./cs":[410,20],"./cs.js":[410,20],"./cv":[411,21],"./cv.js":[411,21],"./cy":[412,22],"./cy.js":[412,22],"./da":[413,23],"./da.js":[413,23],"./de":[416,24],"./de-at":[414,25],"./de-at.js":[414,25],"./de-ch":[415,26],"./de-ch.js":[415,26],"./de.js":[416,24],"./dv":[417,27],"./dv.js":[417,27],"./el":[418,28],"./el.js":[418,28],"./en-au":[419,29],"./en-au.js":[419,29],"./en-ca":[420,30],"./en-ca.js":[420,30],"./en-gb":[421,31],"./en-gb.js":[421,31],"./en-ie":[422,32],"./en-ie.js":[422,32],"./en-il":[423,33],"./en-il.js":[423,33],"./en-in":[424,34],"./en-in.js":[424,34],"./en-nz":[425,35],"./en-nz.js":[425,35],"./en-sg":[426,36],"./en-sg.js":[426,36],"./eo":[427,37],"./eo.js":[427,37],"./es":[431,38],"./es-do":[428,39],"./es-do.js":[428,39],"./es-mx":[429,40],"./es-mx.js":[429,40],"./es-us":[430,41],"./es-us.js":[430,41],"./es.js":[431,38],"./et":[432,42],"./et.js":[432,42],"./eu":[433,43],"./eu.js":[433,43],"./fa":[434,44],"./fa.js":[434,44],"./fi":[435,45],"./fi.js":[435,45],"./fil":[436,46],"./fil.js":[436,46],"./fo":[437,47],"./fo.js":[437,47],"./fr":[440,48],"./fr-ca":[438,49],"./fr-ca.js":[438,49],"./fr-ch":[439,50],"./fr-ch.js":[439,50],"./fr.js":[440,48],"./fy":[441,51],"./fy.js":[441,51],"./ga":[442,52],"./ga.js":[442,52],"./gd":[443,53],"./gd.js":[443,53],"./gl":[444,54],"./gl.js":[444,54],"./gom-deva":[445,55],"./gom-deva.js":[445,55],"./gom-latn":[446,56],"./gom-latn.js":[446,56],"./gu":[447,57],"./gu.js":[447,57],"./he":[448,58],"./he.js":[448,58],"./hi":[449,59],"./hi.js":[449,59],"./hr":[450,60],"./hr.js":[450,60],"./hu":[451,61],"./hu.js":[451,61],"./hy-am":[452,62],"./hy-am.js":[452,62],"./id":[453,63],"./id.js":[453,63],"./is":[454,64],"./is.js":[454,64],"./it":[456,65],"./it-ch":[455,66],"./it-ch.js":[455,66],"./it.js":[456,65],"./ja":[457,67],"./ja.js":[457,67],"./jv":[458,68],"./jv.js":[458,68],"./ka":[459,69],"./ka.js":[459,69],"./kk":[460,70],"./kk.js":[460,70],"./km":[461,71],"./km.js":[461,71],"./kn":[462,72],"./kn.js":[462,72],"./ko":[463,73],"./ko.js":[463,73],"./ku":[464,74],"./ku.js":[464,74],"./ky":[465,75],"./ky.js":[465,75],"./lb":[466,76],"./lb.js":[466,76],"./lo":[467,77],"./lo.js":[467,77],"./lt":[468,78],"./lt.js":[468,78],"./lv":[469,79],"./lv.js":[469,79],"./me":[470,80],"./me.js":[470,80],"./mi":[471,81],"./mi.js":[471,81],"./mk":[472,82],"./mk.js":[472,82],"./ml":[473,83],"./ml.js":[473,83],"./mn":[474,84],"./mn.js":[474,84],"./mr":[475,85],"./mr.js":[475,85],"./ms":[477,86],"./ms-my":[476,87],"./ms-my.js":[476,87],"./ms.js":[477,86],"./mt":[478,88],"./mt.js":[478,88],"./my":[479,89],"./my.js":[479,89],"./nb":[480,90],"./nb.js":[480,90],"./ne":[481,91],"./ne.js":[481,91],"./nl":[483,92],"./nl-be":[482,93],"./nl-be.js":[482,93],"./nl.js":[483,92],"./nn":[484,94],"./nn.js":[484,94],"./oc-lnc":[485,95],"./oc-lnc.js":[485,95],"./pa-in":[486,96],"./pa-in.js":[486,96],"./pl":[487,97],"./pl.js":[487,97],"./pt":[489,98],"./pt-br":[488,99],"./pt-br.js":[488,99],"./pt.js":[489,98],"./ro":[490,100],"./ro.js":[490,100],"./ru":[491,101],"./ru.js":[491,101],"./sd":[492,102],"./sd.js":[492,102],"./se":[493,103],"./se.js":[493,103],"./si":[494,104],"./si.js":[494,104],"./sk":[495,105],"./sk.js":[495,105],"./sl":[496,106],"./sl.js":[496,106],"./sq":[497,107],"./sq.js":[497,107],"./sr":[499,108],"./sr-cyrl":[498,109],"./sr-cyrl.js":[498,109],"./sr.js":[499,108],"./ss":[500,110],"./ss.js":[500,110],"./sv":[501,111],"./sv.js":[501,111],"./sw":[502,112],"./sw.js":[502,112],"./ta":[503,113],"./ta.js":[503,113],"./te":[504,114],"./te.js":[504,114],"./tet":[505,115],"./tet.js":[505,115],"./tg":[506,116],"./tg.js":[506,116],"./th":[507,117],"./th.js":[507,117],"./tk":[508,118],"./tk.js":[508,118],"./tl-ph":[509,119],"./tl-ph.js":[509,119],"./tlh":[510,120],"./tlh.js":[510,120],"./tr":[511,121],"./tr.js":[511,121],"./tzl":[512,122],"./tzl.js":[512,122],"./tzm":[514,123],"./tzm-latn":[513,124],"./tzm-latn.js":[513,124],"./tzm.js":[514,123],"./ug-cn":[515,125],"./ug-cn.js":[515,125],"./uk":[516,126],"./uk.js":[516,126],"./ur":[517,127],"./ur.js":[517,127],"./uz":[519,128],"./uz-latn":[518,129],"./uz-latn.js":[518,129],"./uz.js":[519,128],"./vi":[520,130],"./vi.js":[520,130],"./x-pseudo":[521,131],"./x-pseudo.js":[521,131],"./yo":[522,132],"./yo.js":[522,132],"./zh-cn":[523,133],"./zh-cn.js":[523,133],"./zh-hk":[524,134],"./zh-hk.js":[524,134],"./zh-mo":[525,135],"./zh-mo.js":[525,135],"./zh-tw":[526,136],"./zh-tw.js":[526,136]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=626,e.exports=i},627:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(112))},637:function(e,t,n){"use strict";var r=n(35),i=n.n(r),a=n(110),o=n.n(a),c=n(1),u=n(34),s=n(538),d=n(593),f=n(549),l=n(544),O=n(576),E=n(562),b=n(535),p=n(541);n(572),n(563),n(579),n(613),n(627);var m=n(545),_=n(36),g=n.n(_);function I(e,t,n,r){Object(c.isFunction)(n)?I(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(g()({},n,r))}var v,S=n(577),h=n(614),j=function(e,t){var n=Object(l.e)(e,t);return!n||n.pristine?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(E.submit)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]},C=function(e,t){var n=Object(b.a)(e);return t?o()(j(e,n)):[].concat(o()(function(e,t){var n=Object(f.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(O.e)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]}(e,n)),o()(j(e,n)))};t.a=(v={},i()(v,s.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,a=function(e){e(n),e(Object(d.b)())},o=C(e.getState(),i);e.dispatch(Object(c.isEmpty)(o)?a:Object(d.d)({nextSteps:o,onSuccess:a,onFailure:function(e){e(r),e(Object(d.b)())}}))}]),i()(v,p.Rb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,a=t.methodId,o=t.methodType,c=t.method,u=t.successAction,d=t.failureAction,f=Object(S.a)(r(),o,i).formSchema,l=Object(h.a)(f,c);m.c(i,m.e.serviceSettings(o,a),l).then(function(e){n(function(e,t,n){return{type:s.Fb,siteId:e,data:t,originatingAction:n}}(i,e,t)),I(n,r,u,{sentData:l,receivedData:e})}).catch(function(e){return I(n,r,d,{error:e})})}]),v)},638:function(e,t,n){"use strict";var r=n(536),i=n.n(r),a=n(76),o=n(46),c=function(e,t,n,r,c,u){var s=Object(a.b)();return u&&!u.endsWith("/")&&(u+="/"),u&&u.startsWith("/")&&(u=u.substr(1)),-1!==s.indexOf("?")&&(t=t.replace("?","&")),Object(o.c)(function(e){var t=e.url,n=e.method,r=e.headers,a=e.queryParams,o=e.body,c=e.withCredentials,u=e.onSuccess,s=e.onFailure,d=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:a,body:o,withCredentials:c,onSuccess:u||f,onFailure:s||f,options:d}}({url:s+u+t,method:e,headers:[["X-WP-Nonce",Object(a.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,a){return c(e,t+"&_envelope",0,r,i,a)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},639:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return O});var r=n(36),i=n.n(r),a=n(1),o=n(690),c=n(640),u={page:1,per_page:50,search:"",status:"any"};function s(e){return e.status&&(e.status=Object(c.a)(e.status)),Object(a.omitBy)(e,function(e,t){return u[t]===e})}function d(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return JSON.stringify(e)}function f(e){for(var t=i()({},e),n=0,r=["line_items","fee_lines","coupon_lines","shipping_lines"];n<r.length;n++){var o=r[n];e[o]&&(t[o]=e[o].map(function(e){return Object(a.isFinite)(e.id)?e:Object(a.omit)(e,"id")}))}return t}function l(e){Object(a.forEach)(["cart_tax","discount_total","discount_tax","shipping_total","shipping_tax","total","total_tax"],function(t){(Object(a.isFinite)(e[t])||e[t])&&(e[t]=Object(o.b)(e[t],e.currency))});var t=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return t.map(function(t){return Object(a.forEach)(n,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=t[e].toString())}),Object(a.forEach)(r,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.b)(t[n],e.currency))}),Object(a.forEach)(i,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=parseInt(t[e]))}),Object(a.forEach)(c,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.a)(t[n],e.currency))}),t})};return Object(a.isEmpty)(e.line_items)||(e.line_items=t(e.line_items,["name","tax_class"],["subtotal","subtotal_tax","total","total_tax"],["product_id","variation_id","quantity"],["price"])),Object(a.isEmpty)(e.shipping_lines)||(e.shipping_lines=t(e.shipping_lines,["method_title","method_id"],["total","total_tax"])),Object(a.isEmpty)(e.fee_lines)||(e.fee_lines=t(e.fee_lines,["name","tax_class","tax_status"],["total","total_tax"])),Object(a.isEmpty)(e.coupon_lines)||(e.coupon_lines=t(e.coupon_lines,["code"],["discount","discount_tax"])),Object(a.isEmpty)(e.refunds)||(e.refunds=t(e.refunds,["reason"],["total"])),e.billing&&""===e.billing.email&&delete e.billing.email,e}function O(e){var t=e.status,n=void 0===t?"":t;window.jQuery&&(n&&window.jQuery("#order_status").val("wc-"+n).trigger("change"),window.jQuery("#woocommerce-order-notes").length&&window.jQuery.get(window.location.href,function(e){var t=window.jQuery(e).find("#woocommerce-order-notes");window.jQuery("#woocommerce-order-notes").html(t.html())}))}},640:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return d});n(34),n(1);var r="unpaid",i="unfulfilled",a="finished",o=["on-hold","pending"],c=["processing"],u=["cancelled","completed","failed","refunded"];function s(e){return r===e?o.join(","):i===e?c.join(","):a===e?u.join(","):e}function d(e){return-1!==u.indexOf(e)}},641:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"c",function(){return O}),n.d(t,"i",function(){return E}),n.d(t,"f",function(){return b}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return m});var r=n(536),i=n.n(r),a=(n(36),n(1)),o=n(639),c=(n(640),n(538)),u=function(e,t,n){return{type:c.q,siteId:e,orderId:t,error:n}},s=function(e,t){return{type:c.r,siteId:e,orderId:t}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.n,siteId:e,query:Object(o.b)(t),error:n}},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.isArray)(n)?{type:c.o,siteId:e,query:Object(o.b)(t),total:r,orders:n}:d(e,t,n)},l=function(e,t){return{type:c.F,siteId:e,orderId:t}},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.G,siteId:e,orderId:t,error:n}},E=function(e,t,n){return"undefined"===typeof n.id?O(e,t,n):{type:c.H,siteId:e,orderId:t,order:n}},b=function(e,t){var n=t.id,r=i()(t,["id"]),u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.noop,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.noop;return r=Object(o.e)(Object(o.d)(r)),{type:c.I,siteId:e,orderId:n,order:r,onFailure:s,onSuccess:u}},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.J,siteId:e,orderId:t,error:n}},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"undefined"===typeof n.id?p(e,t,n):(Object(o.f)(n),{type:c.K,siteId:e,orderId:t,order:n})}},642:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},650:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(535),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","isLoading",t])},o=n(609),c=n(540),u=n(575),s={CUSTOMER_NOTE:"CUSTOMER_NOTE",INTERNAL_NOTE:"INTERNAL_NOTE",LABEL_PURCHASING:"LABEL_PURCHASING",LABEL_PURCHASED:"LABEL_PURCHASED",LABEL_REFUND_REQUESTED:"LABEL_REFUND_REQUESTED",LABEL_REFUND_COMPLETED:"LABEL_REFUND_COMPLETED",LABEL_REFUND_REJECTED:"LABEL_REFUND_REJECTED",REFUND_NOTE:"REFUND_NOTE"},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!!a(e,t,n)&&(!(u.a(e,n)&&!Object(c.r)(e,t,n))||Object(c.t)(e,t,n))},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(o.a)(e,t,n),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!a(e,t,n))return[];var o=Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","items"],{});return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","orders",t],[]).map(function(e){return o[e]})}(e,t,n).filter(function(e){return!1===e.customer_note}).map(function(e){return{key:e.id,type:s.INTERNAL_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),content:e.note}});if(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","refunds",t,"items"],[])}(e,t,n).forEach(function(e){f.push({key:e.id,type:s.REFUND_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),amount:e.amount,reason:e.reason,currency:d.currency})}),u.a(e,n)){var l=Object(c.h)(e,t,n);Object(r.filter)(l,function(e){return-1!==["PURCHASED","ANONYMIZED","PURCHASE_IN_PROGRESS"].indexOf(e.status)}).forEach(function(e,t,n){var r=n.length-1-t;if(e.refund)switch(e.refund.status){case"complete":f.push({key:e.label_id,type:s.LABEL_REFUND_COMPLETED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency});break;case"rejected":f.push({key:e.label_id,type:s.LABEL_REFUND_REJECTED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r});break;default:f.push({key:e.label_id,type:s.LABEL_REFUND_REQUESTED,timestamp:e.refund.request_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency})}if("PURCHASE_IN_PROGRESS"===e.status)return f.push({key:e.label_id,type:s.LABEL_PURCHASING,labelIndex:r,labelId:e.label_id,serviceName:e.service_name,carrierId:e.carrier_id});f.push({key:e.label_id,type:s.LABEL_PURCHASED,timestamp:e.created_date,createdDate:e.created_date,usedDate:e.used_date,expiryDate:e.expiry_date,labelIndex:r,labelId:e.label_id,productNames:e.product_names,packageName:e.package_name,isLetter:e.is_letter,receiptId:e.main_receipt_id,serviceName:e.service_name,tracking:e.tracking,carrierId:e.carrier_id,amount:e.rate,refundableAmount:e.refundable_amount,currency:e.currency,anonymized:"ANONYMIZED"===e.status,showDetails:!e.refund||"rejected"===e.refund.status||"unknown"===e.refund.status,commercialInvoiceUrl:e.commercial_invoice_url})})}return f}},655:function(e,t,n){"use strict";var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(541),s={modalErrors:{},pristine:!0},d=function(e){return null===e||""===Object(c.trim)(e)},f={};f[u.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=o()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(c.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},f[u.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},f[u.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},f[u.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},f[u.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(c.omitBy)(n,d);return Object.assign({},e,{packageData:r,pristine:!1})},f[u.m]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(c.omit)(n,"index"):r.push(n);return e=f[u.h](e),o()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:o()({},e.packages,{custom:r}),pristine:!1})},f[u.u]=function(e){return o()({},e,{showOuterDimensions:!0})},f[u.k]=function(e,t){var n=i()(e.packages.custom);return n.splice(t.index,1),o()({},e,{packages:o()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},f[u.t]=function(e,t){var n=t.serviceId,r=t.groupId,i=t.checked,a=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),u=e.currentlyEditingPredefinedPackages[n],s=i?Object(c.uniq)(Object(c.concat)(u,a)):Object(c.difference)(u,a),d=o()({},e.currentlyEditingPredefinedPackages);return d[n]=s,o()({},e,{currentlyEditingPredefinedPackages:d,pristine:!1})},f[u.v]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.currentlyEditingPredefinedPackages),c=i()(a[n]||[]),u=c.indexOf(r);return-1===u?c.push(r):c.splice(u,1),a[n]=c,o()({},e,{currentlyEditingPredefinedPackages:a,pristine:!1})},f[u.l]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.packages.predefined),c=i()(a[n]||[]),u=c.indexOf(r);return-1!==u&&c.splice(u,1),a[n]=c,o()({},e,{packages:o()({},e.packages,{predefined:a}),pristine:!1})},f[u.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=f[u.h](e),o()({},e,{packages:o()({},e.packages,{predefined:t}),pristine:!1})},f[u.o]=function(e,t){var n=t.mode;return o()({},e,{mode:n})},f[u.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},f[u.p]=function(e,t){var n=t.isFetching;return o()({},e,{isFetching:n})},f[u.q]=function(e,t){var n=t.isFetchError;return o()({},e,{isFetchError:n})},f[u.j]=function(e,t){var n=t.packages,r=t.dimensionUnit,i=t.weightUnit,a=t.packageSchema,c=t.predefinedSchema;return o()({},e,{packages:n,dimensionUnit:r,weightUnit:i,packageSchema:a,predefinedSchema:c,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof f[t.type]?f[t.type](e,t):e}},656:function(e,t,n){"use strict";var r=n(35),i=n.n(r),a=n(36),o=n.n(a),c=n(541),u={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},s={};s[c.b]=function(e,t){var n=t.storeOptions,r=t.formData,i=t.formMeta,a=t.userMeta;return o()({},e,{storeOptions:n,meta:o()({},e.meta,i,{pristine:!0,isLoaded:!0,user:a}),data:o()({},e.data,r)})},s[c.e]=function(e,t){var n=t.key,r=t.value,a=e.meta.pristine?e.data:e.pristineData;return o()({},e,{meta:o()({},e.meta,{pristine:!1}),data:o()({},e.data,i()({},n,r)),pristineData:a})},s[c.f]=function(e,t){var n=t.key,r=t.value;return o()({},e,{meta:o()({},e.meta,i()({},n,r))})},s[c.d]=function(e){return e.meta.pristine?e:o()({},e,{meta:o()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},s[c.c]=function(e){return o()({},e,{addCardDialog:!0})},s[c.a]=function(e){return o()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return s[t.type]?s[t.type](e,t):e}},661:function(e,t,n){"use strict";var r,i=n(110),a=n.n(i),o=n(36),c=n.n(o),u=n(119),s=n.n(u),d=n(35),f=n.n(d),l=n(47),O=n.n(l),E=n(593),b=n(538),p=O()("woocommerce:action-list");t.a=(r={},f()(r,b.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,a=i.prevSteps,o=i.currentStep,u=i.nextSteps||[],d=s()(u),f=d[0],l=d.slice(1);if(o)return void p("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!f)return void p("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var O=c()({},i,{prevSteps:a,currentStep:c()({},f,{startTime:r}),nextSteps:l});n(Object(E.a)(O)),f.onStep(n,O)}]),f()(r,b.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=i.prevSteps,u=i.currentStep,s=i.nextSteps;if(!u)return void p("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var d=c()({},i,{prevSteps:[].concat(a()(o||[]),[c()({},u,{endTime:r})]),currentStep:null,nextSteps:s});n(Object(E.a)(d)),s&&s.length>0?n(Object(E.d)(d)):i.onSuccess&&i.onSuccess(n,d)}]),f()(r,b.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=t.error,u=i.prevSteps,s=i.currentStep,d=i.nextSteps;if(!s)return void p("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var f=c()({},i,{prevSteps:[].concat(a()(u||[]),[c()({},s,{endTime:r,error:o})]),currentStep:null,nextSteps:d});n(Object(E.a)(f)),i.onFailure&&i.onFailure(n,f)}]),r)},662:function(e,t,n){"use strict";var r,i=n(35),a=n.n(i),o=n(46),c=n(538),u=n(542),s=n(618);t.a=Object(o.b)(null,(r={},a()(r,c.k,function(){return u.b}),a()(r,c.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(s.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(s.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(s.a)(e.name)}})}})}})}),a()(r,c.j,function(e,t){var n=t.originalAction.type;return c.k===n?u.a:e}),r))},689:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return s});var r=n(538),i=n(639),a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{type:r.y,siteId:e,orderId:t,note:n,onSuccess:i,onFailure:a}},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.z,siteId:e,orderId:t,error:n}},c=function(e,t,n){return Object(i.f)({}),{type:r.A,siteId:e,orderId:t,note:n}},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.w,siteId:e,orderId:t,error:n}},s=function(e,t,n){return{type:r.x,siteId:e,orderId:t,notes:n}}},690:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var r=n(608);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?0:Math.round(e*Math.pow(10,n))/Math.pow(10,n)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?"":e.toFixed(n)}},695:function(e,t,n){"use strict";var r=n(77),i=n.n(r);t.a=function(e){var t=(e.outer_dimensions?e.outer_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/):e.inner_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/)).slice(1).map(Number),n=i()(t,3);return{length:n[0],width:n[1],height:n[2]}}},696:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c});var r=n(563),i=n(538);function a(e){return{type:i.k,siteId:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(e);return Object(r.a)(e,n,t)}function c(e,t){return{type:i.l,siteId:e,data:t}}},741:function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","properties":{"data":{"items":{"properties":{"CTA":{"properties":{"hook":{"type":"string"},"message":{"type":"string"},"primary":{"type":"boolean"}},"type":"object"},"content":{"properties":{"classes":{"type":"string"},"description":{"type":"string"},"emblem":{"type":"null"},"icon":{"type":"string"},"message":{"type":"string"}},"type":"object"},"feature_class":{"type":"string"},"id":{"type":"string"},"jitm_stats_url":{"type":"string"},"template":{"type":"string"},"ttl":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}')},742:function(e,t,n){},831:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),a=n(35),o=n.n(a),c=n(10),u=n.n(c),s=n(107),d=n.n(s),f=n(108),l=n.n(f),O=n(530),E=n.n(O),b=n(529),p=n.n(b),m=n(534),_=n.n(m),g=n(531),I=n.n(g),v=n(12),S=n.n(v),h=n(30),j=n(109),C=n(34),R=n(528),P=n.n(R),y=n(537),M=n.n(y),N=n(1),T=n(719),A=n(547),L=n(535),k=n(540),D=n(549),w=n(650),W=n(641),G=n(609),U=n(533),H=n.n(U),V=n(730),F=n(616),x=Object(V.a)(function(e){return function(t){return u.a.createElement(F.a.Consumer,null,function(n){return u.a.createElement(e,H()({},t,n))})}},"WithLocalizedMoment"),B=u.a.lazy(function(){return Promise.all([n.e(0),n.e(152),n.e(139),n.e(149)]).then(n.bind(null,829))}),z=u.a.lazy(function(){return Promise.all([n.e(0),n.e(137),n.e(139),n.e(140),n.e(156)]).then(n.bind(null,827))}),q=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=E()(this,(e=p()(t)).call.apply(e,[this].concat(i))),o()(_()(n),"renderLabelButton",function(e,t){var r=n.props,i=r.loaded,a=r.translate,o=r.items,s=r.orderId,d=r.siteId,f=P()("button","shipping-label__new-label-button",{"is-placeholder":!i});return i?wcConnectData.wcs_server_connection?e.length?t<o?u.a.createElement("div",{className:"shipping-label__multiple-buttons-container"},u.a.createElement(T.a,{className:f,isPrimary:!0,isBusy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(T.a,{isSecondary:!0,className:f,onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement("span",{className:"shipping-label__redo-shipping-button"},u.a.createElement(T.a,{className:P()("button","is-borderless"),onClick:n.handleCreateLabelButtonClick},a("Create new label"))),u.a.createElement(T.a,{isSecondary:!0,className:P()("button"),onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement(T.a,{className:f,isPrimary:!0,isBusy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}))):u.a.createElement(T.a,null,a("Connection error: unable to create label at this time")):u.a.createElement(T.a,{className:"shipping-label__button-loading",isPrimary:!0,isBusy:!0,disabled:!0})}),o()(_()(n),"handleCreateLabelButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openPrintingFlow(t,r)}),o()(_()(n),"handleTrackPackagesButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openTrackingFlow(t,r)}),n}return I()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,r=e.orderLoading,i=e.orderLoaded;t&&n&&!r&&!i&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e,t=this.props,n=t.loaded,r=t.labelsEnabled,i=t.items,a=t.translate,o=t.events,c=t.moment,s=!n||r,d=Object(N.filter)(o,{type:"LABEL_PURCHASED"}),f=Object(N.filter)(o,{type:"LABEL_REFUND_REQUESTED"}),l=Object(N.differenceBy)(d,f,"labelIndex"),O=Object(N.sumBy)(l,function(e){return e.productNames.length}),E=!1;l.length>0&&i<=O&&(E=!0,e=c(Object(N.maxBy)(l,"createdDate").createdDate).format("ll"));return u.a.createElement("div",{className:"shipping-label__container"},u.a.createElement("div",{className:"shipping-label__banner-fulfilled-message"},u.a.createElement(M.a,{size:36,icon:"shipping"}),n&&(E?u.a.createElement("em",null,a("%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}",{count:i,args:{createdDate:e,itemCount:i},components:{span:u.a.createElement("span",{className:"shipping-label__banner-fulfilled-date"})}})):u.a.createElement("em",null,a("%(itemCount)d item is ready to be fulfilled","%(itemCount)d items are ready to be fulfilled",{count:i,args:{itemCount:i}})))),u.a.createElement("div",null,s&&this.renderLabelButton(l,O)))}}]),t}(c.Component);o()(q,"propTypes",{orderId:S.a.number.isRequired});var Z,Q=Object(j.b)(function(e,t){var n=t.orderId,r=Object(L.a)(e);return{siteId:r,loaded:Object(k.a)(e,n,r),events:Object(w.b)(e,n),orderLoading:Object(G.c)(e,n,r),orderLoaded:Object(G.b)(e,n,r),labelsEnabled:Object(D.a)(e,r)}},function(e){return i()({},Object(h.b)({openPrintingFlow:A.x,openTrackingFlow:A.A,setEmailDetailsOption:A.M,setFulfillOrderOption:A.N,fetchOrder:W.e},e))})(Object(C.localize)(x(q))),K=n(25),Y=n.n(K),J=n(541),X=(Z={},o()(Z,J.Y,function(e){e.error||window.wc_shipment_tracking_refresh&&window.wc_shipment_tracking_refresh()}),o()(Z,J.U,function(){var e=Y()("#woocommerce-order-label");e.pointer&&e.pointer().pointer("close")}),Z),$=function(){return function(e){return function(t){e(t);var n=X[t.type];n&&n(t)}}},ee=n(592),te=n(110),ne=n.n(te),re=n(46),ie=n(538),ae=n(695),oe=function(e){return Boolean(e&&e.name&&e.address&&e.city&&e.postcode&&e.country)},ce=function(e){if(!e)return{loaded:!1,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1};var t=e.formData,n=e.labelsData,r=e.paperSize,i=e.storeOptions,a=e.canChangeCountries,o=Boolean(t.origin_normalized||t.origin.phone),c=oe(t.origin),u=oe(t.destination),s={};return Object(N.forEach)(t.selected_packages,function(e){e.items.map(function(e){var n=e.product_id,r=e.weight,i=e.name,a=e.attributes,o=e.description,c=e.value,u=e.hs_tariff_number,d=e.origin_country,f=a?" ("+a+")":"",l=i.substring(i.indexOf("-")+1).trim()+f;s[n]={defaultDescription:l,description:o||l,weight:r,value:c,tariffNumber:u,originCountry:d||t.origin.country}})}),{loaded:!0,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1,refreshedLabelStatus:!1,labels:n||[],paperSize:r,storeOptions:i,form:{orderId:t.order_id,origin:{values:t.origin,isNormalized:o,normalized:o?t.origin:null,ignoreValidation:c?null:Object(N.mapValues)(t.origin,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},destination:{values:t.destination,isNormalized:Boolean(t.destination_normalized),normalized:t.destination_normalized?t.destination:null,ignoreValidation:u?null:Object(N.mapValues)(t.destination,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},packages:{all:t.all_packages,flatRateGroups:t.flat_rate_groups,selected:t.selected_packages,isPacked:t.is_packed,saved:!0},customs:{items:s,ignoreWeightValidation:Object(N.mapValues)(s,function(e){var t=e.weight;return!t||!parseFloat(t)}),ignoreValueValidation:Object(N.mapValues)(s,function(e){var t=e.value;return!t||!parseFloat(t)})},rates:{values:Object(N.isEmpty)(t.rates.selected)?Object(N.mapValues)(t.packages,function(){return{serviceId:"",signatureRequired:!1}}):t.rates.selected,available:{},retrievalInProgress:!1},rateOptions:{}},openedPackageId:Object.keys(t.selected_packages)[0]||""}},ue=n(640),se=function(e,t){for(var n=0;n<=t.length;n++)if(-1===t.indexOf(e+n))return e+n},de={};de[J.O]=function(e,t){return i()({},e,ce(Object(N.omit)(t,"type","siteId")))},de[J.wb]=function(e,t){var n=t.isFetching;return i()({},e,{isFetching:n})},de[J.ub]=function(e,t){var n=t.error;return i()({},e,{error:n})},de[J.U]=function(e){return i()({},e,{showPurchaseDialog:!0})},de[J.Ob]=function(e){return i()({},e,{showTrackingDialog:!0})},de[J.N]=function(e,t){return!t.force&&e.form.isSubmitting?e:i()({},e,{showPurchaseDialog:!1,form:i()({},e.form,{isSubmitting:!1})})},de[J.y]=function(e){return i()({},e,{showTrackingDialog:!1})},de[J.Hb]=function(e,t){var n=t.stepName,r=t.expanded,a=void 0===r?null:r;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{expanded:Object(N.isBoolean)(a)?a:!e.form[n].expanded})))})},de[J.Ib]=function(e,t){var n=t.group,r=t.name,a=t.value,c=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{values:i()({},e.form[n].values,o()({},r,a)),isNormalized:!1,isUnverifiable:!1,normalized:null})))});return"country"===r?de[J.Ib](c,{group:n,name:"state",value:""}):(e.form[n].ignoreValidation&&(c.form[n].ignoreValidation=i()({},e.form[n].ignoreValidation,o()({},r,!1))),c)},de[J.db]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{ignoreValidation:null})))})},de[J.A]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{normalizationInProgress:!0})))})},de[J.z]=function(e,t){var n=t.group,r=t.requestSuccess,a=t.fieldErrors,c=t.normalized,u=t.isTrivialNormalization,s=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{isNormalized:r,normalizationInProgress:!1,fieldErrors:a,selectNormalized:r&&!a,normalized:c})))});return u&&(s.form[n].values=c),s},de[J.jb]=function(e,t){var n=t.group,r=t.selectNormalized;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:r})))})},de[J.L]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!1})))})},de[J.M]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!0})))})},de[J.J]=function(e,t){var n=t.group,r=i()({},e.form[n],{expanded:!1,isNormalized:!0});return r.selectNormalized&&r.normalized?r.values=r.normalized:r.normalized=r.values,i()({},e,{form:i()({},e.form,o()({},n,r))})},de[J.Jb]=function(e,t){var n=t.packageId,r=t.value,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{weight:parseFloat(r),isUserSpecifiedWeight:!0}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.yb]=function(e,t){var n=t.packageId,r=t.signature,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{signature:r}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.T]=function(e,t){var n=t.openedPackageId;return i()({},e,{openedPackageId:n})},de[J.S]=function(e,t){var n=t.movedItemIndex;return i()({},e,{showItemMoveDialog:!0,targetPackageId:e.openedPackageId,movedItemIndex:n})},de[J.P]=function(e,t){var n=t.originPackageId,r=t.movedItemIndex,a=t.targetPackageId;if(-1===r||n===a||void 0===n)return e;var o=i()({},e.form.packages.selected),c=null,u=e.openedPackageId,s=ne()(o[n].items),d=s.splice(r,1)[0];if(o[n]=i()({},o[n],{items:s,weight:Object(N.round)(o[n].weight-d.weight,8)}),"individual"===a){var f=Object.keys(o);c=se("client_individual_",f);var l=d.height,O=d.length,E=d.width,b=d.weight;o[c]={height:l,length:O,width:E,weight:b,id:c,box_id:"individual",items:[d]}}else if("new"===a){var p=Object.keys(o);o[c=se("client_custom_",p)]={height:0,length:0,width:0,weight:d.weight,id:c,box_id:"not_selected",items:[d]}}else if(a){var m=ne()(o[a].items);m.push(d),o[a]=i()({},o[a],{items:m,weight:Object(N.round)(o[a].weight+d.weight,8)})}return 0===o[n].items.length&&(delete o[n],u=c||a),i()({},e,{openedPackageId:u,addedPackageId:c,movedItemIndex:-1,showItemMoveDialog:!1,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.G]=function(e){return i()({},e,{movedItemIndex:-1,showItemMoveDialog:!1})},de[J.Db]=function(e,t){var n=t.targetPackageId;return i()({},e,{targetPackageId:n})},de[J.Q]=function(e){return i()({},e,{showAddItemDialog:!0,addedItems:{}})},de[J.E]=function(e){return i()({},e,{showAddItemDialog:!1})},de[J.lb]=function(e,t){var n,r=t.sourcePackageId,a=t.movedItemIndex;if(t.added){var c=e.addedItems[r]||[];n=Object(N.includes)(c,a)?c:[].concat(ne()(c),[a])}else n=Object(N.without)(e.addedItems[r],a);return i()({},e,{addedItems:i()({},e.addedItems,o()({},r,n))})},de[J.B]=function(e,t){var n=t.targetPackageId;return Object(N.each)(e.addedItems,function(t,r){Object(N.sortBy)(t,function(e){return-e}).forEach(function(t){e=de[J.P](e,{originPackageId:r,movedItemIndex:t,targetPackageId:n})})}),i()({},e,{showAddItemDialog:!1})},de[J.C]=function(e){var t=i()({},e.form.packages.selected),n=Object.keys(t),r=se("client_custom_",n),a=r;return t[r]={height:0,length:0,width:0,id:r,weight:0,box_id:"not_selected",items:[]},i()({},e,{openedPackageId:a,addedPackageId:r,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:t,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(t,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.eb]=function(e,t){var n=t.packageId,r=i()({},e.form.packages.selected),a=r[n].items;delete r[n];var o=Object.keys(r)[0]||"",c=i()({},r[o]);return c.items=c.items.concat(a),r[o]=c,i()({},e,{openedPackageId:o,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:r,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(r,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.zb]=function(e,t){var n=t.box,r=t.packageId,a=t.boxTypeId,o=i()({},e.form.packages.selected),c=o[r],u=Object(N.round)(c.isUserSpecifiedWeight?c.weight:(n?n.box_weight:0)+Object(N.sumBy)(c.items,"weight"),8);if("not_selected"!==a&&n){var s=Object(ae.a)(n),d=s.length,f=s.width,l=s.height;o[r]=i()({},Object(N.omit)(c,"service_id"),{height:l,length:d,width:f,weight:u,box_id:a,is_letter:n.is_letter})}else o[r]=i()({},Object(N.omit)(c,"service_id"),{height:0,length:0,width:0,weight:u,box_id:a});return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.ib]=function(e){return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{saved:!0})})})},de[J.nb]=function(e,t){var n=t.packageId,r=t.contentsType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsType:r})))})})})},de[J.mb]=function(e,t){var n=t.packageId,r=t.contentsExplanation;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsExplanation:r})))})})})},de[J.Cb]=function(e,t){var n=t.packageId,r=t.restrictionType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionType:r})))})})})},de[J.Bb]=function(e,t){var n=t.packageId,r=t.restrictionComments;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionComments:r})))})})})},de[J.kb]=function(e,t){var n=t.packageId,r=t.abandonOnNonDelivery;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{abandonOnNonDelivery:Boolean(r)})))})})})},de[J.xb]=function(e,t){var n=t.packageId,r=t.itn;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{itn:r})))})})})},de[J.ob]=function(e,t){var n=t.productId,r=t.description;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{description:r})))})})})},de[J.qb]=function(e,t){var n=t.productId,r=t.tariffNumber;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{tariffNumber:r.replace(/\D/g,"").substr(0,6)})))})})})},de[J.sb]=function(e,t){var n=t.productId,r=t.weight;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{weight:r}))),ignoreWeightValidation:i()({},e.form.customs.ignoreWeightValidation,o()({},n,!1))})})})},de[J.rb]=function(e,t){var n=t.productId,r=t.value;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{value:r}))),ignoreValueValidation:i()({},e.form.customs.ignoreValueValidation,o()({},n,!1))})})})},de[J.pb]=function(e,t){var n=t.productId,r=t.originCountry;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{originCountry:r})))})})})},de[J.hb]=function(e){return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:Object(N.mapValues)(e.form.customs.items,function(e){return i()({},e,{tariffNumber:e.tariffNumber||""})}),ignoreWeightValidation:{},ignoreValueValidation:{}})})})},de[J.Lb]=function(e,t){var n=t.packageId,r=t.serviceId,a=t.carrierId,o=t.signatureRequired,c=i()({},e.form.rates.values);return c[n]={serviceId:r,carrierId:a,signatureRequired:o},i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{values:c})})})},de[J.Kb]=function(e,t){var n=t.value;return i()({},e,{paperSize:n})},de[J.tb]=function(e,t){var n=t.value;return i()({},e,{emailDetails:n})},de[J.vb]=function(e,t){var n=t.value;return i()({},e,{fulfillOrder:n})},de[J.X]=function(e){return i()({},e,{form:i()({},e.form,{isSubmitting:!0})})},de[J.Y]=function(e,t){var n=t.response;return t.error?i()({},e,{form:i()({},e.form,{isSubmitting:!1})}):i()({},e,{labels:[].concat(ne()(n.map(function(e){return i()({},e,{statusUpdated:!0})})),ne()(e.labels))})},de[J.Eb]=function(e,t){var n=t.fileData,r=t.labels;return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!0,fileData:n,labelsToPrint:r,isSubmitting:!1})})},de[J.ab]=function(e,t){var n=t.requestData;return i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:n})})})},de[J.Ab]=function(e,t){var n=t.rates,r=t.requestData;return Object(N.isEqual)(r,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:{values:Object(N.mapValues)(n,function(e){var t=Object(N.get)(e,"rates",[]),n=1===t.length?t[0]:Object(N.find)(t,function(e){return e.is_selected});return n?n.service_id:""}),available:n}})}):e},de[J.Z]=function(e,t){var n=t.requestData;return Object(N.isEqual)(n,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:null})})}):e},de[J.D]=function(e){return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,rates:i()({},e.form.rates,{available:{}})})})},de[J.V]=function(e,t){var n=t.labelId;return i()({},e,{refundDialog:{labelId:n}})},de[J.H]=function(e){return e.refundDialog.isSubmitting?e:i()({},e,{refundDialog:null})},de[J.Gb]=function(e){return i()({},e,{statusRetrivalInProgress:!0})},de[J.Fb]=function(e,t){var n=t.labelsData;return t.error&&(n={}),i()({},e,{labels:n,refreshedLabelStatus:!0,statusRetrivalInProgress:!1})},de[J.bb]=function(e){return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!0})})},de[J.cb]=function(e,t){var n=t.response;if(t.error)return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!1})});var r=Object(N.findIndex)(e.labels,{label_id:e.refundDialog.labelId}),a=i()({},e.labels[r],{refund:n}),o=i()({},e,{refundDialog:null,labels:ne()(e.labels)});return o.labels[r]=a,o},de[J.W]=function(e,t){var n=t.labelId;return i()({},e,{reprintDialog:{labelId:n,isFetching:!0}})},de[J.gb]=function(e,t){var n=t.labelId,r=t.fileData;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,fileData:r,isFetching:!1}})},de[J.fb]=function(e,t){var n=t.labelId;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,isFetching:!1}})},de[J.I]=function(e){return i()({},e,{reprintDialog:null})},de[J.K]=function(e){return i()({},e,{reprintDialog:i()({},e.reprintDialog,{isFetching:!0})})},de[J.R]=function(e,t){var n=t.labelId;return i()({},e,{detailsDialog:{labelId:n}})},de[J.F]=function(e){return i()({},e,{detailsDialog:null})},de[ie.H]=function(e,t){var n=t.order.status;return i()({},e,{fulfillOrder:!Object(ue.b)(n),emailDetails:Object(ue.b)(n)})};var fe=Object(re.d)("orderId",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce(),t=arguments.length>1?arguments[1]:void 0;return de[t.type]?de[t.type](e,t):e}),le=n(655),Oe=n(656),Ee=n(639);var be=Object(re.a)({isSending:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.orderId;switch(n){case ie.s:return i()({},e,o()({},r,!0));case ie.u:case ie.t:return i()({},e,o()({},r,!1));default:return e}}});var pe=Object(re.a)({isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.v:case ie.x:case ie.w:return Object.assign({},e,o()({},t.orderId,ie.v===t.type));default:return e}},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.y:case ie.z:case ie.A:return Object.assign({},e,o()({},t.orderId,ie.y===t.type));default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=Object(N.keyBy)(t.notes,"id");return Object.assign({},e,n);case ie.A:var r=t.note;return Object.assign({},e,o()({},r.id,r));default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=t.notes.map(function(e){return e.id});return Object.assign({},e,o()({},t.orderId,n));case ie.A:var r=t.note,i=t.orderId,a=[].concat(ne()(e[i]||[]),[r.id]);return Object.assign({},e,o()({},i,a));default:return e}}});var me=Object(re.d)("orderId",Object(re.a)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.C:case ie.E:case ie.D:return ie.C===t.type;default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.B:return t.refunds;case ie.E:return[].concat(ne()(e),[t.refund]);default:return e}}}));var _e=Object(re.a)({invoice:be,isDeleting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.p:case ie.q:case ie.r:return Object.assign({},e,o()({},t.orderId,ie.p===t.type));default:return e}},isQueryLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.m:case ie.o:case ie.n:var n=Object(Ee.c)(t.query);return Object.assign({},e,o()({},n,ie.m===t.type));default:return e}},isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.F:case ie.H:case ie.G:return Object.assign({},e,o()({},t.orderId,ie.F===t.type));default:return e}},isUpdating:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object(N.isFinite)(t.orderId)?t.orderId:JSON.stringify(t.orderId);switch(t.type){case ie.I:case ie.K:case ie.J:return Object.assign({},e,o()({},n,ie.I===t.type));default:return e}},items:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case ie.o:return e=Object(N.keyBy)(n.orders,"id"),Object.assign({},t,e);case ie.H:case ie.K:return e=o()({},n.order.id,n.order),Object.assign({},t,e);default:return t}},queries:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=t.orders.map(function(e){return e.id}),r=Object(Ee.c)(t.query);return Object.assign({},e,o()({},r,n));default:return e}},refunds:me,total:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=Object(Ee.c)(Object(N.omit)(t.query,"page"));return Object.assign({},e,o()({},n,t.total));default:return e}},notes:pe}),ge=n(47),Ie=n.n(ge),ve=n(607),Se=n(610),he=n(550);function je(e){return{type:ie.f,siteId:e}}var Ce=function(e){return Object(N.get)(e,"ui.route.path.current",null)},Re=n(738),Pe=n.n(Re),ye=n(115),Me=n.n(ye),Ne=function(e){function t(e){var n;return d()(this,t),(n=E()(this,p()(t).call(this,"Failed to validate with JSON schema"))).schemaErrors=e,n}return I()(t,e),t}(Pe()(Error)),Te=function(e){function t(e,n,r){var i;return d()(this,t),(i=E()(this,p()(t).call(this,e.message))).inputData=n,i.transformer=r,i}return I()(t,e),t}(Pe()(Error));var Ae,Le,ke,De=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.identity,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){return t||function(){var a=Object.assign({greedy:!0,verbose:!0},i),o=Me()(e,a),c=Me.a.filter(Object.assign({},e,e.type&&"object"===e.type&&{additionalProperties:!1}));n=function(e){if(!o(e))throw new Ne(o.errors);return c(e)},t=function(e){try{return r(e)}catch(t){throw new Te(t,e,r)}}}(),t(n(a))}},we=n(741),We=n(536),Ge=n.n(We),Ue=function(e){var t=e.apiVersion,n=e.apiNamespace,r=e.body,a=e.method,o=e.path,c=e.query,u=void 0===c?{}:c,s=e.formData,d=e.onSuccess,f=e.onFailure,l=e.onProgress,O=Ge()(e,["apiVersion","apiNamespace","body","method","path","query","formData","onSuccess","onFailure","onProgress"]),E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,b=n?{apiNamespace:n}:{apiVersion:t};return{type:"WPCOM_HTTP_REQUEST",body:r,method:a,path:o,query:i()({},u,b),formData:s,onSuccess:d||E,onFailure:f||E,onProgress:l||E,options:O}},He=n(565),Ve=n(611),Fe={},xe=new Set,Be={hasInitializedSites:!1,hasInitializedSection:!1,lastSection:null,lastSite:null},ze=["/jetpack/connect/user-type","/jetpack/connect/site-type","/jetpack/connect/site-topic"],qe=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},Ze=function(e){return e.data.map(function(e){return{message:qe(e.content.message),description:qe(e.content.description),featureClass:e.feature_class,callToAction:qe(e.CTA.message),id:e.id}})},Qe=function(e){return function(t,n){if(Be.hasInitializedSites&&Be.hasInitializedSection){var r=Be.lastSite;if(Object(He.c)(n(),r)){var a=Ce(n());Object(N.some)(ze,function(e){return Object(N.startsWith)(a,e)})||t(Ue({apiNamespace:"rest",method:"GET",path:"/v1.1/jetpack-blogs/".concat(r,"/rest-api/"),query:{path:"/jetpack/v4/jitm",query:JSON.stringify({message_path:"calypso:".concat(Be.lastSection,":admin_notices")}),http_envelope:1}},i()({},e,{messagePath:Be.lastSection})))}}}},Ke=function(e,t){return function(n,r){n(function(e,t,n){return{type:"JITM_SET",keyedPath:t+e,jitms:n.map(function(e){return i()({},e,{lastUpdated:Date.now()})})}}(e.siteId||e.site_id||Object(L.a)(r()),e.messagePath,t))}},Ye=function(e){return function(t,n){t(function(e,t){return{type:"JITM_SET",keyedPath:t+e,jitms:[]}}(e.siteId||e.site_id||Object(L.a)(n()),e.messagePath))}};Le="state/data-layer/wpcom/sites/jitm/index.js",Ae={},o()(Ae,"SECTION_SET",[Object(Se.a)({fetch:function(e){var t=Object(N.get)(e,["section","name"]);if(!Be.hasInitializedSection||!e.section||Be.lastSection!==t){switch(e.isLoading){case!1:return void(Be.hasInitializedSection=!0);case!0:return void(Be.hasInitializedSection=!1)}return Be.lastSection=t,Qe(e)}},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"SELECTED_SITE_SET",[Object(Se.a)({fetch:function(e){if(!Be.hasInitializedSites||Be.lastSite!==e.siteId)return Be.hasInitializedSites=!!e.siteId,Be.lastSite=e.siteId,Qe(e)},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"JITM_DISMISS",[Object(Se.a)({fetch:function(e){return Ue({apiNamespace:"rest",method:"POST",path:"/jetpack-blogs/".concat(e.siteId,"/rest-api/"),query:{path:"/jetpack/v4/jitm",body:JSON.stringify({feature_class:e.featureClass,id:e.id}),http_envelope:1,json:!1}},e)},onSuccess:N.noop,onError:N.noop})]),ke=Ae,xe.has(Le)||(xe.add(Le),Fe=Object(Ve.a)(Fe,ke));var Je,Xe=n(638),$e=n(642),et=Ie()("woocommerce:orders");function tt(e,t){if(et("API Error: ",t),e.failureAction)return i()({},e.failureAction,{error:t})}var nt,rt=(Je={},o()(Je,ie.p,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).del("orders/".concat(n))},onSuccess:function(e){return function(t){var n=e.siteId,r=e.siteSlug,i=e.orderId;t(Object(W.b)(n,i)),t(je(n)),t({type:"NAVIGATE",path:"/store/orders/".concat(r)}),t(Object(he.d)(Object(C.translate)("Order deleted."),{duration:8e3}))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(W.a)(r,i,t)),n(Object(he.a)(Object(C.translate)("Unable to delete order."),{duration:8e3}))}},fromApi:$e.a})]),o()(Je,ie.F,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return e.failureAction=Object(W.c)(t,n),Object(Xe.a)(t,e).get("orders/".concat(n))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.orderId;return Object(W.i)(r,i,n)},onError:tt})]),o()(Je,ie.I,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.order;return Object(N.isFinite)(n)?Object(Xe.a)(t,e).post("orders/".concat(n),r):Object(Xe.a)(t,e).post("orders",r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;"function"===typeof e.onSuccess&&"undefined"!==typeof n.id&&e.onSuccess(t,n.id),t(je(r)),t(Object(W.h)(r,i,n))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;"function"===typeof e.onFailure&&e.onFailure(n),et("API Error: ",t),n(Object(W.g)(r,i,t))}}})]),o()(Je,ie.m,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.query,r=Object(ve.stringify)(Object(N.omitBy)(n,function(e){return""===e}));return e.failureAction=Object(W.d)(t,n),Object(Xe.a)(t,e).getWithHeaders("orders?".concat(r))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.query,a=n.body,o=n.headers,c=Number(o["X-WP-Total"]);return Object(W.j)(r,i,a,c)},onError:tt})]),Je),it=n(689),at=(nt={},o()(nt,ie.v,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).get("orders/".concat(n,"/notes"))},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.e)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.d)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),o()(nt,ie.y,[Object(Se.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.note;return Object(Xe.a)(t,e).post("orders/".concat(n,"/notes"),r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.c)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.b)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),nt),ot=n(661),ct=n(637),ut=n(116),st=n(696),dt=o()({},ie.k,[Object(Se.a)({fetch:function(e){var t=e.siteId;return Object(Xe.a)(t,e,"/wc/v3").get("data/continents")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return Object(st.c)(n,r)},onError:function(e,t){var n=e.siteId;return Object(st.b)(n,t)}})]),ft=n(662),lt=(n(742),u.a.lazy(function(){return Promise.all([n.e(0),n.e(137),n.e(139),n.e(140),n.e(154)]).then(n.bind(null,836))}));t.default=function(e){var t=e.order,n=e.accountSettings,r=e.packagesSettings,a=e.shippingLabelData,s=e.continents,d=e.context,f=e.items,l=t?t.id:null,O=void 0!==n;return{getReducer:function(){return Object(re.a)({extensions:Object(re.a)({woocommerce:Object(re.a)({woocommerceServices:Object(re.a)({1:Object(re.a)({shippingLabel:fe,packages:le.a,labelSettings:Oe.a})}),sites:Object(re.a)({1:Object(re.a)({orders:_e,data:Object(re.a)({locations:ft.a})})})})}),notices:ee.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){var e={extensions:{woocommerce:{sites:{1:{orders:{notes:{isLoading:o()({},l,!1)}}}}}}};return O?function(e){var c=n.storeOptions,u=n.formMeta,d=n.userMeta,f=n.formData,O=r.formData,E=r.storeOptions.dimension_unit,b=r.storeOptions.weight_unit,p=r.formSchema.custom?r.formSchema.custom.items:void 0,m=r.formSchema.predefined;return e.extensions.woocommerce.woocommerceServices={1:{shippingLabel:o()({},l,ce(a)),labelSettings:{storeOptions:c,meta:i()({},u,{pristine:!0,isLoaded:!0,user:d}),data:i()({},f)},packages:{modalErrors:{},pristine:!0,packages:O,dimensionUnit:E,weightUnit:b,packageSchema:p,predefinedSchema:m,packageData:{is_user_defined:!0},isLoaded:!0}}},e.extensions.woocommerce.sites[1].orders.isLoading=o()({},l,!1),e.extensions.woocommerce.sites[1].orders.items=o()({},l,t),e.extensions.woocommerce.sites[1].data={locations:s},e}(e):e},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-label-".concat(l)},getMiddlewares:function(){return[$,Object(ut.b)(Object(Ve.a)(ct.a,ot.a,rt,at,dt))]},View:function(){return"shipment_tracking"===d?u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(lt,{orderId:l})):u.a.createElement(Q,{orderId:l,items:f})}}}}}]);
|
dist/chunks/32acea31b1c95a860379.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[145,139],{536:function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(1),n(565);function a(e){return e.ui.selectedSiteId}},538:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"p",function(){return E}),n.d(t,"q",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"s",function(){return b}),n.d(t,"t",function(){return h}),n.d(t,"u",function(){return g}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return C}),n.d(t,"A",function(){return S}),n.d(t,"v",function(){return N}),n.d(t,"w",function(){return y}),n.d(t,"x",function(){return j}),n.d(t,"C",function(){return I}),n.d(t,"E",function(){return R}),n.d(t,"D",function(){return P}),n.d(t,"B",function(){return k}),n.d(t,"F",function(){return M}),n.d(t,"G",function(){return T}),n.d(t,"H",function(){return A}),n.d(t,"I",function(){return L}),n.d(t,"J",function(){return w}),n.d(t,"K",function(){return x}),n.d(t,"m",function(){return D}),n.d(t,"n",function(){return W}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return V}),n.d(t,"M",function(){return G}),n.d(t,"N",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return K}),n.d(t,"Y",function(){return Q}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return $}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return J}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return ae}),n.d(t,"hb",function(){return re}),n.d(t,"ib",function(){return ie}),n.d(t,"jb",function(){return ce}),n.d(t,"kb",function(){return se}),n.d(t,"lb",function(){return oe}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return me}),n.d(t,"rb",function(){return pe}),n.d(t,"qb",function(){return fe}),n.d(t,"sb",function(){return Ee}),n.d(t,"tb",function(){return _e}),n.d(t,"ub",function(){return Oe}),n.d(t,"vb",function(){return be}),n.d(t,"wb",function(){return he}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ce}),n.d(t,"Ab",function(){return Se}),n.d(t,"Bb",function(){return Ne}),n.d(t,"Cb",function(){return ye}),n.d(t,"Db",function(){return je}),n.d(t,"Eb",function(){return Ie}),n.d(t,"Fb",function(){return Re}),n.d(t,"Gb",function(){return Pe}),n.d(t,"Hb",function(){return ke}),n.d(t,"Ib",function(){return Me}),n.d(t,"U",function(){return Te}),n.d(t,"V",function(){return Ae}),n.d(t,"S",function(){return Le}),n.d(t,"T",function(){return we});var a="WOOCOMMERCE_ACTION_LIST_ANNOTATE",r="WOOCOMMERCE_ACTION_LIST_CLEAR",i="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",c="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",s="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",o="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",m="WOOCOMMERCE_ERROR_CLEAR",p="WOOCOMMERCE_LOCATIONS_REQUEST",f="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",E="WOOCOMMERCE_ORDER_DELETE",_="WOOCOMMERCE_ORDER_DELETE_FAILURE",O="WOOCOMMERCE_ORDER_DELETE_SUCCESS",b="WOOCOMMERCE_ORDER_INVOICE_SEND",h="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",g="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",N="WOOCOMMERCE_ORDER_NOTES_REQUEST",y="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",j="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",I="WOOCOMMERCE_ORDER_REFUND_CREATE",R="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",k="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",M="WOOCOMMERCE_ORDER_REQUEST",T="WOOCOMMERCE_ORDER_REQUEST_FAILURE",A="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",L="WOOCOMMERCE_ORDER_UPDATE",w="WOOCOMMERCE_ORDER_UPDATE_FAILURE",x="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",D="WOOCOMMERCE_ORDERS_REQUEST",W="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",V="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",G="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",H="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",K="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",Q="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",$="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",J="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",ue="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",le="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",de="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",Ne="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Pe="WOOCOMMERCE_SHIPPING_ZONE_OPEN",ke="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Me="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Te="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Le="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",we="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},540:function(e,t,n){"use strict";n.d(t,"j",function(){return f}),n.d(t,"t",function(){return E}),n.d(t,"s",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"h",function(){return b}),n.d(t,"g",function(){return h}),n.d(t,"v",function(){return g}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return C}),n.d(t,"e",function(){return S}),n.d(t,"l",function(){return N}),n.d(t,"p",function(){return y}),n.d(t,"n",function(){return P}),n.d(t,"f",function(){return T}),n.d(t,"o",function(){return A}),n.d(t,"q",function(){return L}),n.d(t,"d",function(){return w}),n.d(t,"b",function(){return x}),n.d(t,"i",function(){return D}),n.d(t,"c",function(){return W}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return V});var a=n(1),r=n(34),i=n(546),c=n(536),s=n(558),o=n(549),u=n(544),l=n(573),d=n(578),m=n(574),p=n(575),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.loaded},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.isFetching},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.error},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.loaded?a.labels:[]},h=function(e,t,n,a){return b(e,t,n).find(function(e){return e.label_id===a})},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.emailDetails},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.refreshedLabelStatus},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=f(e,t,n);return a&&a.form},N=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),i=S(e,t,n);if(!i)return null;var s=i.rates,o=s.values,u=s.available,l=[],d=0,m=0,p=function(e){if(!(e in u))return"continue";var t=o[e],n=t.serviceId,i=t.signatureRequired,c=u[e].default.rates,s=null,p=null;i in u[e]&&(s=u[e][i].rates,p=Object(a.find)(s,function(e){return n===e.service_id})||null);var f=Object(a.find)(c,function(e){return n===e.service_id});if(f){var E=f.retail_rate-f.rate,_=f.rate,O={title:f.title,retailRate:f.retail_rate,rateWithDiscount:_,addons:[],carrierId:f.carrier_id,carrierTitle:f.title.split("-")[0].trim()};null!==p&&(O.addons=[{title:Object(r.translate)("Signature Required"),rate:p.rate-f.rate}],_=p.rate),l.push(O),d+=Object(a.round)(E,2),m+=_}};for(var f in o)p(f);return l.length?{prices:l,discount:d,total:m}:null},y=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(Object(a.isEmpty)(r))return!1;var i=Object(l.a)(r.origin);if("US"===i.country&&Object(a.includes)(d.d,i.state))return!0;var s=Object(l.a)(r.destination);return!("US"!==s.country||!Object(a.includes)(d.d,s.state))||i.country!==s.country},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[S(e,t,n)]}),j=function(e,t,n,i){var c=t.values,s=Object(l.a)(t),o=s.phone,u=s.postcode,p=s.state,f=s.country,E={};return["name","address","city","postcode","country"].forEach(function(e){c[e]||(E[e]=Object(r.translate)("This field is required"))}),Object(a.includes)(d.a,f)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(E.postcode=Object(r.translate)("Invalid ZIP/Postal code format")),!p&&Object(m.j)(e,f,n)&&(E.state=Object(r.translate)("This field is required")),i&&(o?10!==o.split(/\D+/g).join("").replace(/^1/,"").length&&(E.phone=Object(r.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):E.phone=Object(r.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),E},I=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.isNormalized,c=e.isUnverifiable,s=e.normalized,o=e.ignoreValidation,u=e.fieldErrors;if((i||c)&&!s&&u)return u;if(i&&!s)return{address:Object(r.translate)("This address is not recognized. Please try another.")};var l=j(t,e,n,a);return o&&Object.keys(l).forEach(function(e){o[e]&&delete l[e]}),l},R=function(e,t,n,i){var c=Object(a.uniq)(Object(a.flatten)(Object(a.map)(e,function(e){return Object(a.map)(e.items,"product_id")}))),s=Object(a.zipObject)(c,Object(a.fill)(Array(c.length),0));Object(a.forEach)(e,function(e){Object(a.forEach)(e.items,function(e){var n=e.quantity,a=e.product_id;return s[a]+=n*t.items[a].value})});var o={};return Object(a.forEach)(Object(a.pick)(t.items,c),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(o[e.tariffNumber]||(o[e.tariffNumber]=0),o[e.tariffNumber]+=s[t])}),{packages:Object(a.mapValues)(e,function(e){var c={};"other"!==e.contentsType||e.contentsExplanation||(c.contentsExplanation=Object(r.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(c.restrictionComments=Object(r.translate)("Please describe what kind of restrictions this package must have"));var s=new Set;return Object(a.forEach)(e.items,function(e){var n=e.product_id,a=t.items[n].tariffNumber;2500<o[a]&&s.add(a)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(c.itn=Object(r.translate)("Invalid format")):"CA"!==n&&(Object(a.isEmpty)(s)?Object(a.includes)(d.c,n)&&(c.itn=Object(r.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:i}})):c.itn=Object(r.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:s.values().next().value}})),c}),items:Object(a.mapValues)(Object(a.pick)(t.items,c),function(e,n){var i={};return e.description||(i.description=Object(r.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(a.isNil)(e.weight)||""===e.weight?i.weight=Object(r.translate)("This field is required"):parseFloat(e.weight)>0||(i.weight=Object(r.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(a.isNil)(e.value)||""===e.value?i.value=Object(r.translate)("This field is required"):parseFloat(e.value)>0||(i.value=Object(r.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(i.tariffNumber=Object(r.translate)("The tariff number must be 6 digits long")),i})}},P=function(e){var t=e.values,n=e.available,r=Object(a.map)(n,function(e,n){return t[n]});return!Object(a.isEmpty)(r)&&Object(a.every)(r)},k=function(e){var t=e.values,n=e.available;return Object(a.mapValues)(n,function(e,n){if(!Object(a.isEmpty)(e.default.errors)){var i=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return i.length?i:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(a.isEmpty)(e.default.rates)?[Object(r.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(r.translate)("Please choose a rate")]})},M=function(e){var t={};return e||(t.paperSize=Object(r.translate)("This field is required")),t},T=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!E(e,t,n))return{};var i=f(e,t,n),s=i.form,o=i.paperSize;if(Object(a.isEmpty)(s))return{};var u,l=s.destination.values.country,d=Object(m.g)(e,l,n),p=y(e,t,n);return{origin:I(s.origin,e,n,p),destination:I(s.destination,e,n),packages:(u=s.packages.selected,Object(a.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(r.translate)("Please select a package"));var n=function(e){return!Object(a.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(r.translate)("Invalid weight")),Object(a.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(r.translate)("Package dimensions must be greater than zero")),t})),customs:R(s.packages.selected,s.customs,l,d),rates:k(s.rates),sidebar:M(o)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[f(e,t,n)]}),A=Object(i.a)(function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e),r=f(e,t,a).form,i="origin"===n&&y(e,t,a),s=j(e,r[n],a,i);return 0===Object.keys(s).length},function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e);return[f(e,t,a).form[n]]}),L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(!r)return!1;var i=Object(a.uniq)(Object(a.flatten)(Object(a.map)(r.packages.selected,function(e){return Object(a.map)(e.items,"product_id")})));return!Object(a.some)(i.map(function(e){return Object(a.isNil)(r.customs.items[e].tariffNumber)||r.customs.ignoreWeightValidation[e]||r.customs.ignoreValueValidation[e]}))},w=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);if(!r)return null;var i=T(e,t,n);return r.origin.isNormalized&&Object(a.isEqual)(r.origin.values,r.origin.normalized)&&!Object(s.a)(i.origin)?r.destination.isNormalized&&Object(a.isEqual)(r.destination.values,r.destination.normalized)&&!Object(s.a)(i.destination)?Object(s.a)(i.packages)?"packages":!y(e,t,n)||!Object(s.a)(i.customs)&&L(e,t,n)?Object(s.a)(i.rates)?"rates":null:"customs":"destination":"origin"},x=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=S(e,t,n);return!Object(a.isEmpty)(r)&&!w(e,t,n)&&!r.origin.normalizationInProgress&&!r.destination.normalizationInProgress&&!r.rates.retrievalInProgress&&!Object(a.isEmpty)(r.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[S(e,t,n),w(e,t,n)]}),D=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?Object(a.pick)(n,d.a):Object(a.pick)(n,d.b)},[m.d,p.b]),W=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?n:Object(a.pick)(n,d.b)},[m.d,p.b]),U=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!Object(m.j)(e,t,n))return null;var r=Object(m.i)(e,t,n),i={};return r.forEach(function(e){var t=e.code,n=e.name;return i[t]=n}),"US"!==t||Object(p.b)(e,n)?i:Object(a.omit)(i,d.d)},[m.i,p.b]),V=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return E(e,t,n)&&Object(o.d)(e,n)&&Object(u.i)(e,n)&&Object(m.b)(e,n)}},541:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"d",function(){return r}),n.d(t,"e",function(){return i}),n.d(t,"f",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"j",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return E}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return O}),n.d(t,"q",function(){return b}),n.d(t,"p",function(){return h}),n.d(t,"r",function(){return g}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return C}),n.d(t,"u",function(){return S}),n.d(t,"v",function(){return N}),n.d(t,"w",function(){return y}),n.d(t,"B",function(){return j}),n.d(t,"x",function(){return I}),n.d(t,"C",function(){return R}),n.d(t,"z",function(){return P}),n.d(t,"A",function(){return k}),n.d(t,"D",function(){return M}),n.d(t,"E",function(){return T}),n.d(t,"F",function(){return A}),n.d(t,"G",function(){return L}),n.d(t,"H",function(){return w}),n.d(t,"I",function(){return x}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return W}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return G}),n.d(t,"y",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return K}),n.d(t,"U",function(){return Q}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return $}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return J}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return ae}),n.d(t,"cb",function(){return re}),n.d(t,"db",function(){return ie}),n.d(t,"eb",function(){return ce}),n.d(t,"fb",function(){return se}),n.d(t,"gb",function(){return oe}),n.d(t,"hb",function(){return ue}),n.d(t,"ib",function(){return le}),n.d(t,"jb",function(){return de}),n.d(t,"kb",function(){return me}),n.d(t,"lb",function(){return pe}),n.d(t,"nb",function(){return fe}),n.d(t,"mb",function(){return Ee}),n.d(t,"ob",function(){return _e}),n.d(t,"pb",function(){return Oe}),n.d(t,"qb",function(){return be}),n.d(t,"rb",function(){return he}),n.d(t,"sb",function(){return ge}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return Ce}),n.d(t,"vb",function(){return Se}),n.d(t,"wb",function(){return Ne}),n.d(t,"xb",function(){return ye}),n.d(t,"zb",function(){return je}),n.d(t,"Ab",function(){return Ie}),n.d(t,"Bb",function(){return Re}),n.d(t,"Cb",function(){return Pe}),n.d(t,"Db",function(){return ke}),n.d(t,"Eb",function(){return Me}),n.d(t,"Fb",function(){return Te}),n.d(t,"Gb",function(){return Ae}),n.d(t,"Hb",function(){return Le}),n.d(t,"Ib",function(){return we}),n.d(t,"Jb",function(){return xe}),n.d(t,"yb",function(){return De}),n.d(t,"Lb",function(){return We}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return Ve}),n.d(t,"Nb",function(){return Ge}),n.d(t,"Pb",function(){return He}),n.d(t,"Qb",function(){return Fe}),n.d(t,"Rb",function(){return Be});var a="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",r="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",i="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",c="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",s="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",o="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",p="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",f="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",E="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",_="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",O="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",h="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",N="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",y="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",j="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",I="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",H="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",He="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},542:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return r});var a="LOADING",r="ERROR"},544:function(e,t,n){"use strict";n.d(t,"e",function(){return f}),n.d(t,"b",function(){return _}),n.d(t,"d",function(){return O}),n.d(t,"a",function(){return b}),n.d(t,"c",function(){return h}),n.d(t,"f",function(){return g}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return C}),n.d(t,"g",function(){return S});var a=n(110),r=n.n(a),i=n(36),c=n.n(i),s=n(1),o=n(34),u=n(546),l=n(536),d=n(578),m=n(573),p=n(540),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(s.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},E=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},_=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var a=[];Object(s.forEach)(n.predefinedSchema,function(e,t){var r=(n.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e){var n=e.definitions;Object(s.forEach)(n,function(e){Object(s.includes)(r,e.id)&&a.push(c()({},e,{serviceId:t}))})})});var r=(n.packages.custom||[]).map(function(e,t){return c()({},e,{index:t})});return Object(s.orderBy)(a.concat(r),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var a=E(n);return[].concat(r()(n.packages.custom||[]),r()(a.map(function(e){return(n.packages.predefined||{})[e]})))}),O=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),a=f(e,n);if(!a||!a.predefinedSchema||!a.packages)return null;var r=Object(p.e)(e,t,n),i=Object(m.a)(r.origin).country,c=Object(m.a)(r.destination).country,u=d.a.includes(i)&&!d.a.includes(c),E={custom:{title:Object(o.translate)("Custom Packages"),definitions:a.packages.custom}};return Object(s.forEach)(a.predefinedSchema,function(e,t){var n=(a.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e,t){var a=e.definitions,r={title:e.title,definitions:[]};Object(s.forEach)(a,function(e){u&&!1===e.can_ship_international||Object(s.includes)(n,e.id)&&r.definitions.push(e)}),r.definitions.length&&(E[t]=r)})}),E},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),a=f(e,n);if(!a||!a.packages)return[];var i=E(a),c=Object(p.e)(e,t,n),s=Object(m.a)(c.origin).country,o=Object(m.a)(c.destination).country;return[].concat(r()(a.packages.custom||[]),r()(i.map(function(e){return(a.packages.predefined||{})[e]})),[s,o])}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var a={};return Object(s.forEach)(n.packages.custom,function(e){a[e.name]=e}),Object(s.forEach)(n.predefinedSchema,function(e){Object(s.forEach)(e,function(e){var t=e.definitions;Object(s.forEach)(t,function(e){a[e.id]=e})})}),a},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var a=E(n);return[].concat(r()(n.packages.custom||[]),r()(a.map(function(e){return(n.packages.predefined||{})[e]})))}),h=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var a={},r=n.predefinedSchema,i=n.currentlyEditingPredefinedPackages;return Object(s.forEach)(r,function(e,t){var n=i[t]||[];Object(s.forEach)(e,function(e,r){var i={groupId:r,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(s.forEach)(e.definitions,function(e){var a=Object(s.includes)(n,e.id);a&&i.selected++,i.packages.push(c()({},e,{selected:a,serviceId:t}))}),a["".concat(t,"-").concat(r)]=i})}),a},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var a=E(n);return r()(a.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,a=0,r=f(e,t);if(!r||!r.currentlyEditingPredefinedPackages)return{added:n,removed:a};var i=r.packages&&r.packages.predefined?r.packages.predefined:{},c=r.currentlyEditingPredefinedPackages;return Object.keys(c).forEach(function(e){var t=i[e],a=c[e];t?a.forEach(function(e){Object(s.includes)(t,e)||n++}):n+=a.length}),Object.keys(i).forEach(function(e){var t=i[e],n=c[e];n?t.forEach(function(e){Object(s.includes)(n,e)||a++}):a+=t.length}),{added:n,removed:a}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var a=E(n);return[].concat(r()(a.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),r()(a.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isLoaded},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetching},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetchError}},545:function(e,t,n){"use strict";n.d(t,"e",function(){return a}),n.d(t,"c",function(){return C}),n.d(t,"d",function(){return S}),n.d(t,"b",function(){return N}),n.d(t,"a",function(){return y});var a={};n.r(a),n.d(a,"accountSettings",function(){return i}),n.d(a,"packages",function(){return c}),n.d(a,"orderLabels",function(){return s}),n.d(a,"getLabelRates",function(){return o}),n.d(a,"labelsStatus",function(){return u}),n.d(a,"labelRefund",function(){return l}),n.d(a,"labelsPrint",function(){return d}),n.d(a,"labelTestPrint",function(){return m}),n.d(a,"addressNormalization",function(){return p}),n.d(a,"serviceSettings",function(){return f}),n.d(a,"shippingCarrier",function(){return E}),n.d(a,"shippingCarriers",function(){return _}),n.d(a,"subscriptions",function(){return O}),n.d(a,"subscriptionActivate",function(){return b}),n.d(a,"shippingCarrierDelete",function(){return h}),n.d(a,"shippingCarrierTypes",function(){return g});var r=n(572),i="connect/account/settings",c="connect/packages",s=function(e){return"connect/label/".concat(e)},o=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t.join())},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},m=function(){return"connect/label/preview"},p=function(){return"connect/normalize-address"},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},E=function(){return"connect/shipping/carrier"},_=function(){return"connect/shipping/carriers"},O=function(){return"connect/subscriptions"},b=function(e){return"connect/subscription/".concat(e,"/activate")},h=function(e){return"connect/shipping/carrier/".concat(e)},g=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},C=function(e,t,n){return Object(r.a)(e).post(t,n,"wc/v1").catch(v)},S=function(e,t,n){return Object(r.a)(e).put(t,n,"wc/v1").catch(v)},N=function(e,t){return Object(r.a)(e).get(t,"wc/v1").catch(v)},y=function(e,t){return Object(r.a)(e).del(t,"wc/v1").catch(v)}},546:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var a=n(1),r=n(624),i=n.n(r),c=(n(113),function(e){return e}),s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return n.join()},o=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return e.map(function(e){return e.apply(void 0,[t].concat(a))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,u=Object(a.memoize)(e,r);return Array.isArray(n)&&(n=o(n)),Object.assign(function(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),c=1;c<a;c++)r[c-1]=arguments[c];var s=n.apply(void 0,[e].concat(r));return Array.isArray(s)||(s=[s]),t&&!i()(s,t)&&u.cache.clear(),t=s,u.apply(void 0,[e].concat(r))},{memoizedSelector:u})}},548:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("fieldset",r()({},a,{className:l()(t,"form-fieldset")}),n)}},549:function(e,t,n){"use strict";n.d(t,"f",function(){return c}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return o}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return p}),n.d(t,"n",function(){return f}),n.d(t,"o",function(){return E}),n.d(t,"e",function(){return _}),n.d(t,"q",function(){return O}),n.d(t,"p",function(){return b}),n.d(t,"k",function(){return h}),n.d(t,"l",function(){return g}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return C});var a=n(1),r=n(536),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.data},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.meta},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=i(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isFetching},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.isFetchError},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.enabled},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.selected_payment_method_id},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.pristine},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.email_receipts},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.can_manage_payments},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.can_edit_settings},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=c(e,t);return n&&n.paper_size},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return n&&n.warnings&&n.warnings.payment_methods},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return m});var a=n(535),r=n.n(a),i=n(1),c={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},s=(n(46),c.uniqueId);function o(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.id,i=r()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:a||s(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),m=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},551:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(12),l=n.n(u),d=n(528),m=n.n(d),p=n(34),f=function(e){var t=e.children,n=e.required,a=e.optional,i=e.translate,s=e.className,u=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),l=c()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),d=u?null:o.a.createElement(o.a.Fragment,null,t,n&&o.a.createElement("small",{className:"form-label__required"},i("Required")),a&&o.a.createElement("small",{className:"form-label__optional"},i("Optional")));return o.a.createElement("label",r()({},l,{dangerouslySetInnerHTML:u,className:m()(s,"form-label")}),d)};f.propTypes={required:l.a.bool,optional:l.a.bool,children:l.a.node},t.a=Object(p.localize)(f)},552:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(528),o=n.n(s),u=n(537),l=n.n(u),d=function(e){var t=e.text,n=e.type,a=void 0===n?"input-validation":n;return r.a.createElement("div",{className:o()("field-error","field-error__".concat(a))},r.a.createElement(l.a,{size:24,icon:"notice-outline"})," ",r.a.createElement("span",null,t))};d.propTypes={text:c.a.string.isRequired,type:c.a.string},t.a=d},553:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("legend",r()({},a,{className:l()(t,"form-legend")}),n)}},554:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,a=c()(e,["className","children"]);return o.a.createElement("h3",r()({},a,{className:l()(t,"form-section-heading")}),n)}},555:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(12),b=n.n(O),h=n(10),g=n.n(h),v=n(528),C=n.n(v),S=n(1),N=n(34),y=n(537),j=n.n(y);n(568);function I(e){var t=e.children;return g.a.createElement("span",{className:"screen-reader-text"},t)}var R=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"dismissTimeout",null),n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.icon,r=e.isCompact,i=e.isLoading,c=e.onDismissClick,s=e.showDismiss,o=void 0===s?!r:s,u=e.status,l=e.text,d=e.translate,m=C()("notice",u,n,{"is-compact":r,"is-loading":i,"is-dismissable":o});return g.a.createElement("div",{className:m},g.a.createElement("span",{className:"notice__icon-wrapper"},g.a.createElement(j.a,{className:"notice__icon",icon:a||this.getIcon(),size:24})),g.a.createElement("span",{className:"notice__content"},g.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,o&&g.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:c},g.a.createElement(j.a,{icon:"cross",size:24}),g.a.createElement(I,null,d("Dismiss"))))}}]),t}(h.Component);_()(R,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:S.noop,status:null,text:null}),_()(R,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired});t.a=Object(N.localize)(R)},557:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var a=n(533),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(10),b=n.n(O),h=n(12),g=n.n(h),v=n(528),C=n.n(v),S=n(1),N=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"render",value:function(){var e=C()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",r()({},Object(S.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);_()(N,"displayName","FormSettingExplanation"),_()(N,"propTypes",{noValidate:g.a.bool,isIndented:g.a.bool,className:g.a.string}),_()(N,"defaultProps",{noValidate:!1,isIndented:!1})},558:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(1),r=function e(t){return!!t&&(Object(a.isArray)(t)?Object(a.some)(t,e):!Object(a.isPlainObject)(t)||Object(a.some)(Object(a.values)(t),e))}},562:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return c}),n.d(t,"removePackage",function(){return s}),n.d(t,"editPackage",function(){return o}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return m}),n.d(t,"toggleAll",function(){return p}),n.d(t,"togglePackage",function(){return f}),n.d(t,"savePredefinedPackages",function(){return E}),n.d(t,"removePredefinedPackage",function(){return _}),n.d(t,"setModalErrors",function(){return O}),n.d(t,"setIsSaving",function(){return b}),n.d(t,"setIsFetching",function(){return h}),n.d(t,"setIsFetchError",function(){return g}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return C}),n.d(t,"submit",function(){return S});var a=n(545),r=n(541),i=n(544),c=function(e){return{type:r.g,siteId:e}},s=function(e,t){return{type:r.k,index:t,siteId:e}},o=function(e,t){return{type:r.i,package:t,siteId:e}},u=function(e){return{type:r.h,siteId:e}},l=function(e,t){return{type:r.m,packageData:t,siteId:e}},d=function(e,t){return{type:r.w,values:t,siteId:e}},m=function(e){return{type:r.u,siteId:e}},p=function(e,t,n,a){return{type:r.t,serviceId:t,groupId:n,checked:a,siteId:e}},f=function(e,t,n){return{type:r.v,serviceId:t,packageId:n,siteId:e}},E=function(e){return{type:r.n,siteId:e}},_=function(e,t,n){return{type:r.l,serviceId:t,packageId:n,siteId:e}},O=function(e,t){return{type:r.s,value:t,siteId:e}},b=function(e,t){return{type:r.r,isSaving:t,siteId:e}},h=function(e,t){return{type:r.p,isFetching:t,siteId:e}},g=function(e,t){return{type:r.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:r.o,siteId:e,mode:t}},C=function(e){return function(t,n){var c=Object(i.e)(n(),e);c&&(c.packages||c.isFetching)||(t(h(e,!0)),a.b(e,a.e.packages).then(function(n){var a=n.formData,i=n.formSchema,c=n.storeOptions;t({type:r.j,packages:a,dimensionUnit:c.dimension_unit,weightUnit:c.weight_unit,packageSchema:i.custom.items,predefinedSchema:i.predefined,siteId:e})}).catch(function(n){console.error(n),t(g(e,!0))}).then(function(){return t(h(e,!1))}))}},S=function(e,t,n){return function(r,c){var s=Object(i.e)(c(),e);r(b(e,!0)),a.d(e,a.e.packages,s.packages).then(t).catch(n).then(function(){return r(b(e,!1))})}}},563:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(538);function r(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:a.j,siteId:e,originalAction:t,data:n,time:r}}},564:function(e,t,n){"use strict";var a=n(47),r=n.n(a),i=n(1),c=n(114),s=r()("calypso:notices");s("initializing notices");var o,u={containerNames:{}};o=u,Object(i.assign)(o,c.EventEmitter.prototype),o.emitChange=function(){this.emit("change")},o.off=o.removeListener;var l=[],d={new:function(e,t,n){var a=t.overlay?"overlay-notices":"notices";u.containerNames[a]=a,s("creating notice",e,t,n),u[a]=[];var r={type:t.type||"message",status:n,text:e,duration:t.duration,container:a,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=d.removeNotice.bind(d,r);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(r):u[a].push(r),u.emit("change"),r},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){s("clearNoticesOnNavigation");var n=!1,a=function(e){return e.persistent};for(var r in u.containerNames){var i=u[r].length;u[r]=u[r].filter(a),i!==u[r].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=d},565:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"c",function(){return i});var a=function(){return{}},r=function(){return""},i=function(){return!0}},568:function(e,t,n){},569:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);n(600);t.a=function(e){var t=e.inputRef,n=e.className,a=e.isError,i=c()(e,["inputRef","className","isError"]);return o.a.createElement("select",r()({},i,{ref:t,className:l()(n,"form-select",{"is-error":a})}))}},570:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(12),g=n.n(h),v=n(10),C=n.n(v),S=n(1),N=n(615),y=n(117),j=n.n(y),I=n(528),R=n.n(I),P=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"_onButtonClick",function(e){e.onClick?e.onClick(n._close.bind(f()(n),e.action)):n._close(e.action)}),b()(f()(n),"_close",function(e){n.props.onDialogClose&&n.props.onDialogClose(e)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.additionalClassNames,n=e.isBackdropVisible,a=e.baseClassName,r=e.isFullScreen,i=e.shouldCloseOnEsc,c=a+"__content",s=R()(a,"card",t),o=R()(a+"__backdrop",{"is-full-screen":!!r,"is-hidden":!n});return C.a.createElement(j.a,{isOpen:this.props.isVisible,onRequestClose:this._close,closeTimeoutMS:this.props.leaveTimeout,contentLabel:this.props.label,appElement:document.getElementById("wpcom"),overlayClassName:o,className:s,htmlOpenClassName:"ReactModal__Html--open",role:"dialog",shouldCloseOnEsc:i},C.a.createElement("div",{className:R()(this.props.className,c),tabIndex:"-1"},this.props.children),this._renderButtonsBar())}},{key:"_renderButtonsBar",value:function(){var e=this.props.baseClassName+"__action-buttons";return this.props.buttons?C.a.createElement("div",{className:e},this.props.buttons.map(this._renderButton,this)):null}},{key:"_renderButton",value:function(e,t){if(C.a.isValidElement(e))return C.a.cloneElement(e,{key:"dialog-button-"+t});var n=this._getButtonClasses(e),a=this._onButtonClick.bind(this,e);return C.a.createElement("button",{key:e.action,className:n,"data-e2e-button":e.action,"data-tip-target":"dialog-base-action-".concat(e.action),onClick:a,disabled:!!e.disabled},C.a.createElement("span",{className:this.props.baseClassName+"__button-label"},e.label))}},{key:"_getButtonClasses",value:function(e){var t=e.className||"button";return(e.isPrimary||1===this.props.buttons.length)&&(t+=" is-primary"),e.additionalClassNames&&(t+=" "+e.additionalClassNames),t}}]),t}(v.Component);b()(P,"propTypes",{additionalClassNames:g.a.oneOfType([g.a.object,g.a.string]),autoFocus:g.a.bool,baseClassName:g.a.string,buttons:g.a.array,className:g.a.string,isBackdropVisible:g.a.bool,isFullScreen:g.a.bool,isVisible:g.a.bool,label:g.a.string,leaveTimeout:g.a.number,onDialogClose:g.a.func,shouldCloseOnEsc:g.a.bool}),b()(P,"defaultProps",{baseClassName:"dialog",isBackdropVisible:!0,isFullScreen:!0,autoFocus:!0,label:""});var k=P,M=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"checkOnClosed",function(e){null===e&&Object(S.defer)(n.props.onClosed)}),b()(f()(n),"onDialogClose",function(e){n.props.onClose&&n.props.onClose(e)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){return C.a.createElement(N.a,null,C.a.createElement(k,r()({},this.props,{ref:this.checkOnClosed,key:"dialog",onDialogClose:this.onDialogClose})))}}]),t}(v.Component);b()(M,"propTypes",{isVisible:g.a.bool,baseClassName:g.a.string,leaveTimeout:g.a.number,onClose:g.a.func,onClosed:g.a.func,shouldCloseOnEsc:g.a.bool}),b()(M,"defaultProps",{isVisible:!1,leaveTimeout:200,onClosed:S.noop});t.a=M},572:function(e,t,n){"use strict";var a=n(76);t.a=a.a},573:function(e,t,n){"use strict";var a=n(1);t.a=function(e){return Object(a.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},574:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return m}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return E}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return O}),n.d(t,"j",function(){return b}),n.d(t,"d",function(){return h});var a=n(1),r=n(546),i=n(536),c=n(542),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(a.isArray)(s(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.b===s(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.a===s(e,t)},d=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];var i=a[e],c=o(t,i);return[c,c&&s(t,i)]}},m=Object(r.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=s(e,t).map(function(e){return Object(a.omit)(e,"countries")});return Object(a.sortBy)(n,"name")},d(0)),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=Object(a.flatMap)(s(e,t),"countries");return Object(a.sortBy)(n,"name")},f=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var r=Object(a.find)(s(e,n),{code:t});if(!r)return[];var c=r.countries.map(function(e){return Object(a.omit)(e,"states")});return Object(a.sortBy)(c,"name")},d(1)),E=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return t;var r=Object(a.find)(Object(a.flatMap)(s(e,n),"countries"),{code:t});return r?r.name:t},d(1)),_=Object(r.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var r=Object(a.find)(Object(a.flatMap)(s(e,n),"countries"),{code:t});return r?Object(a.sortBy)(r.states,"name"):[]},d(1)),O=Object(r.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(i.a)(e);if(!o(e,r))return n;var c=Object(a.find)(Object(a.flatMap)(s(e,r),"countries"),{code:t});if(!c)return n;var u=Object(a.find)(c.states,{code:n});return u?u.name:n},d(2)),b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!Object(a.isEmpty)(_(e,t,n))},h=Object(r.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=p(e,t),a={};return n.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),a},d(0))},575:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r});var a=function(){return!0},r=function(){return!0}},576:function(e,t,n){"use strict";n.d(t,"d",function(){return c}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var a=n(545),r=n(541),i=n(549),c=function(e,t,n){return{type:r.e,siteId:e,key:t,value:n}},s=function(e,t,n){return{type:r.f,siteId:e,key:t,value:n}},o=function(e){return function(t){t(s(e,"isFetching",!0)),a.b(e,a.e.accountSettings).then(function(n){var a=n.storeOptions,i=n.formMeta,c=n.formData,s=n.userMeta;t(function(e,t,n,a,i){return{type:r.b,siteId:e,storeOptions:t,formData:n,formMeta:a,userMeta:i}}(e,a,c,i,s))}).catch(function(n){t(s(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(s(e,"isFetching",!1))})}},u=function(e,t,n){return function(r,c){r(s(e,"isSaving",!0)),r(s(e,"pristine",!0)),a.c(e,a.e.accountSettings,Object(i.f)(c())).then(t).catch(function(t){return r(s(e,"pristine",!1)),n(t)}).then(function(){r(s(e,"isSaving",!1))})}},l=function(e){return{type:r.d,siteId:e}},d=function(e){return{type:r.c,siteId:e}}},577:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return u});var a=n(1),r=n(536),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return Object(a.isObject)(c(e,n)[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return s(e,t,n)?c(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return i.b===c(e,n)[t]}},578:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"c",function(){return c});var a=["US","PR","VI","GU","AS","UM","MH","FM","MP"],r=["US","PR","VI"],i=["AA","AE","AP"],c=["IR","SY","KP","CU","SD"]},579:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var a=n(1),r=n(536),i=n(586),c=n(542),s=n(575),o=n(587),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e));return Object(a.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),c=Object(i.b)(e,n);if(!Object(a.isArray)(c))return!1;var l=Object(a.find)(c,{id:t});if(!l||!Object(a.isArray)(l.methodIds))return!1;if(!Object(s.a)(e,n))return!0;var d=l.methodIds.map(function(t){var r=u(e,t,n);return r&&Object(a.startsWith)(r.methodType,"wc_services")?r:null}).filter(Boolean);return Object(a.every)(d,function(t){var a=t.id;return Object(o.a)(e,a,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),l=Object(i.b)(e,n);if(!Object(a.isArray)(l))return!1;var d=Object(a.find)(l,{id:t});if(!d)return!1;if(c.b===d.methodIds)return!0;if(!Object(s.a)(e,n)||!Object(a.isArray)(d.methodIds))return!1;var m=d.methodIds.map(function(t){var r=u(e,t,n);return r&&Object(a.startsWith)(r.methodType,"wc_services")?r:null}).filter(Boolean);return Object(a.some)(m,function(t){var a=t.id;return Object(o.b)(e,a,n)})}},580:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(528),o=n.n(s),u=n(698),l=n(548),d=n(552),m=n(557),p=function(e){var t=e.id,n=e.title,i=e.description,c=e.value,s=e.placeholder,p=e.updateValue,f=e.error,E=e.className,_=e.defaultValue,O=Object(a.useCallback)(function(e){return p(e,t)},[p]),b=o()("form-text-input",{"is-error":Boolean(f)});return r.a.createElement(l.a,{className:E},r.a.createElement(u.a,{label:n,name:t,placeholder:s,value:c,onChange:O,className:b,defaultValue:_}),f&&"string"===typeof f&&r.a.createElement(d.a,{text:f}),!f&&i&&r.a.createElement(m.a,null,i))};p.propTypes={id:c.a.string.isRequired,title:c.a.node,description:c.a.string,value:c.a.string,defaultValue:c.a.string,updateValue:c.a.func,error:c.a.oneOfType([c.a.string,c.a.bool]),className:c.a.string},t.a=p},582:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(10),g=n.n(h),v=n(12),C=n.n(v),S=n(528),N=n.n(S),y=function(e){function t(){return o()(this,t),m()(this,f()(t).apply(this,arguments))}return _()(t,e),l()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,c()(t,["compact","primary","scary","busy","borderless","type"])),a=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return g.a.createElement("a",r()({},n,{rel:a,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,c()(i,["compact","primary","scary","busy","borderless","target","rel"]));return g.a.createElement("button",r()({},s,{className:e}))}}]),t}(h.PureComponent);b()(y,"propTypes",{compact:C.a.bool,primary:C.a.bool,scary:C.a.bool,busy:C.a.bool,type:C.a.string,href:C.a.string,borderless:C.a.bool,target:C.a.string,rel:C.a.string}),b()(y,"defaultProps",{type:"button"})},583:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(534),_=n.n(E),O=n(531),b=n.n(O),h=n(35),g=n.n(h),v=n(528),C=n.n(v),S=n(34),N=n(1),y=n(10),j=n.n(y),I=n(582),R=function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=m()(this,(e=f()(t)).call.apply(e,[this].concat(r))),g()(_()(n),"getDefaultButtonAction",function(){return n.props.isSubmitting?n.props.translate("Saving\u2026"):n.props.translate("Save Settings")}),n}return b()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.isPrimary,i=c()(e,["children","className","isPrimary"]),s=C()(n,"form-button");return j.a.createElement(I.a,r()({},Object(N.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:a,className:s}),y.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(j.a.Component);g()(R,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(S.localize)(R)},586:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o});var a=n(1),r=n(536),i=(n(542),n(579)),c=n(612),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e),n=s(e,t);return Object(a.isArray)(n)&&Object(a.every)(n,function(n){return Object(i.a)(e,n.id,t)})&&Object(a.every)(n,function(n){return Object(c.a)(e,n.id,t)})}},587:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var a=n(1),r=n(536),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return!0===c(e,n)[t]},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return i.b===c(e,n)[t]}},588:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(35),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n.n(O),h=n(537),g=n.n(h),v=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(g.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(g.a,{icon:"external",size:24}))}}]),t}(b.a.Component);f()(v,"displayName","NoticeAction"),f()(v,"propTypes",{href:_.a.string,onClick:_.a.func,external:_.a.bool,icon:_.a.string}),f()(v,"defaultProps",{external:!1})},591:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),c=n(36),s=n.n(c),o=n(1),u=n(46),l=Object(u.b)({},(a={},i()(a,"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,n))}),i()(a,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(o.omit)(e,n):e}),i()(a,"ROUTE_SET",function(e){return Object(o.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var a=t;return a.displayOnNextPage&&(a=s()({},a,{displayOnNextPage:!1})),e[n]=a,e},{})}),a)),d=Object(u.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},592:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return c}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return o});var a=n(538);function r(e){return{type:a.d,actionList:e}}function i(){return{type:a.b}}function c(e){return{type:a.a,actionList:e}}function s(e){return{type:a.e,actionList:e}}function o(e,t){return{type:a.c,actionList:e,error:t}}},593:function(e,t,n){},599:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(528),l=n.n(u),d=n(537),m=n.n(d),p=n(1),f=function(e){var t=e.className,n=e.disabled,a=e.checked,i=e.partialChecked,s=Object(p.omit)(e,["className","partialChecked"]);return c.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},c.a.createElement("input",r()({},s,{type:"checkbox"})),a&&c.a.createElement(m.a,{icon:"checkmark",size:14}),!a&&i&&c.a.createElement(m.a,{icon:"minus-small",size:16}))};f.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=f},600:function(e,t,n){},601:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(12),b=n.n(O),h=n(10),g=n.n(h),v=n(528),C=n.n(v),S=n(34),N=n(1),y=n(620),j=n(835),I=n(537),R=n.n(I),P=(n(634),function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"state",{expanded:n.props.expanded}),_()(m()(n),"onClick",function(){n.props.children&&n.setState({expanded:!n.state.expanded}),n.props.onClick&&n.props.onClick(),n.state.expanded?n.props.onClose(n.props.cardKey):n.props.onOpen(n.props.cardKey)}),n}return f()(t,e),c()(t,[{key:"componentWillReceiveProps",value:function(e){e.expanded!==this.props.expanded&&this.setState({expanded:e.expanded})}},{key:"getClickAction",value:function(){if(!this.props.disabled)return this.onClick}},{key:"getActionButton",value:function(){return this.state.expanded&&this.props.actionButtonExpanded||this.props.actionButton}},{key:"renderActionButton",value:function(){var e=this.props.clickableHeader?null:this.getClickAction();if(this.props.actionButton)return g.a.createElement("div",{className:"foldable-card__action",role:"presentation",onClick:e},this.getActionButton());if(this.props.children){var t=this.props.screenReaderText||this.props.translate("More");return g.a.createElement("button",{disabled:this.props.disabled,type:"button",className:"foldable-card__action foldable-card__expand",onClick:e},g.a.createElement(y.a,null,t),g.a.createElement(R.a,{icon:this.props.icon,size:24}))}}},{key:"renderContent",value:function(){return g.a.createElement("div",{className:"foldable-card__content"},this.props.children)}},{key:"renderHeader",value:function(){var e=this.props.summary?g.a.createElement("span",{className:"foldable-card__summary"},this.props.summary," "):null,t=this.props.expandedSummary?g.a.createElement("span",{className:"foldable-card__summary-expanded"},this.props.expandedSummary," "):null,n=this.props.clickableHeader?this.getClickAction():null,a=C()("foldable-card__header",{"is-clickable":!!this.props.clickableHeader,"has-border":!!this.props.summary});return g.a.createElement("div",{className:a,role:"presentation",onClick:n},g.a.createElement("span",{className:"foldable-card__main"},this.props.header," "),g.a.createElement("span",{className:"foldable-card__secondary"},e,t,this.renderActionButton()))}},{key:"render",value:function(){var e=C()("foldable-card","card",this.props.className,{"is-disabled":!!this.props.disabled,"is-expanded":!!this.state.expanded,"has-expanded-summary":!!this.props.expandedSummary,"is-compact":!!this.props.compact});return g.a.createElement(j.a,{className:e},this.renderHeader(),this.state.expanded&&this.renderContent())}}]),t}(h.Component));_()(P,"displayName","FoldableCard"),_()(P,"propTypes",{actionButton:b.a.element,actionButtonExpanded:b.a.element,cardKey:b.a.string,compact:b.a.bool,disabled:b.a.bool,expandedSummary:b.a.oneOfType([b.a.string,b.a.element]),expanded:b.a.bool,icon:b.a.string,onClick:b.a.func,onClose:b.a.func,onOpen:b.a.func,screenReaderText:b.a.oneOfType([b.a.string,b.a.bool]),summary:b.a.oneOfType([b.a.string,b.a.element])}),_()(P,"defaultProps",{onOpen:N.noop,onClose:N.noop,cardKey:"",icon:"chevron-down",expanded:!1,screenReaderText:!1}),t.a=Object(S.localize)(P)},602:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(530),m=n.n(d),p=n(529),f=n.n(p),E=n(531),_=n.n(E),O=n(10),b=n.n(O),h=n(12),g=n.n(h),v=n(604),C=n(528),S=n.n(C),N=function(e){function t(e){var n;return o()(this,t),(n=m()(this,f()(t).call(this,e))).state={isFocused:!1},n}return _()(t,e),l()(t,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"===typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.label,a=t.value,i=t.help,s=t.className,o=t.instanceId,u=t.onChange,l=t.onClick,d=t.prefix,m=t.suffix,p=t.type,f=t.disabled,E=c()(t,["label","value","help","className","instanceId","onChange","onClick","prefix","suffix","type","disabled"]),_=this.state.isFocused,O="inspector-text-control-with-affixes-".concat(o),h=[];i&&h.push("".concat(O,"__help")),d&&h.push("".concat(O,"__prefix")),m&&h.push("".concat(O,"__suffix"));var g=S()(s,{"with-value":""!==a,empty:""===a,active:_&&!f}),C=S()("text-control-with-affixes",{"text-control-with-prefix":d,"text-control-with-suffix":m,disabled:f});return b.a.createElement(v.a,{label:n,id:O,help:i,className:g,onClick:function(t){return e.handleOnClick(t,l)}},b.a.createElement("div",{className:C},d&&b.a.createElement("span",{id:"".concat(O,"__prefix"),className:"text-control-with-affixes__prefix"},d),b.a.createElement("input",r()({className:"components-text-control__input",type:p,id:O,value:a,onChange:function(e){return u(e.target.value)},"aria-describedby":h.join(" "),disabled:f,onFocus:function(){return e.setState({isFocused:!0})}},E)),m&&b.a.createElement("span",{id:"".concat(O,"__suffix"),className:"text-control-with-affixes__suffix"},m)))}}]),t}(O.Component);N.defaultProps={type:"text"},N.propTypes={label:g.a.string,help:g.a.string,type:g.a.string,value:g.a.oneOfType([g.a.string,g.a.number]).isRequired,className:g.a.string,onChange:g.a.func.isRequired,prefix:g.a.node,suffix:g.a.node,disabled:g.a.bool},t.a=N},603:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(548),o=n(569),u=n(553),l=n(552),d=n(557),m=function(e){var t=e.id,n=e.valuesMap,i=e.title,c=e.description,m=e.value,p=e.updateValue,f=e.error,E=e.disabled,_=e.className,O=Object(a.useCallback)(function(e){return p(e.target.value,e)},[p]);return r.a.createElement(s.a,{className:_},r.a.createElement(u.a,null,i),r.a.createElement(o.a,{id:t,name:t,value:m,onChange:O,disabled:Boolean(E),isError:Boolean(f)},Object.keys(n).map(function(e){return r.a.createElement("option",{key:e,value:e},n[e])})),f&&"string"===typeof f&&r.a.createElement(l.a,{text:f}),!f&&c&&r.a.createElement(d.a,null,c))};m.propTypes={id:c.a.string.isRequired,valuesMap:c.a.object.isRequired,title:c.a.node,description:c.a.string,value:c.a.string.isRequired,updateValue:c.a.func.isRequired,error:c.a.oneOfType([c.a.string,c.a.bool]),disabled:c.a.bool,className:c.a.string},t.a=m},605:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(165),o=n.n(s),u=n(12),l=n.n(u),d=n(10),m=n.n(d),p=n(555),f=n(588),E=n(528),_=n.n(E);n(593);function O(e){var t=e.id,n=e.className,a=e.children;return m.a.createElement("div",{id:t,className:_()("global-notices",n)},a)}var b=n(564),h=n(47),g=n.n(h)()("calypso:data-observe"),v=n(109),C=n(1),S=n(546),N=Object(S.a)(function(e){return Object(C.values)(e.notices.items)},function(e){return e.notices.items}),y=(Object(S.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(550)),j=o()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):g(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){g("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&b.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(a){t&&t(a),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return m.a.createElement(p.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&m.a.createElement(f.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,a=e.noticeId,i=e.onClick,s=e.onDismissClick,o=c()(e,["button","href","noticeId","onClick","onDismissClick"]);return m.a.createElement(p.a,r()({},o,{key:"notice-".concat(a),onDismissClick:this.removeReduxNotice(a,s)}),t&&m.a.createElement(f.a,{href:n,onClick:i},t))},this))).length?m.a.createElement(O,{id:this.props.id},e):null}});t.a=Object(v.b)(function(e){return{storeNotices:N(e)}},{removeNotice:y.c})(j)},611:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var a=n(1),r=function(e,t){return Object(a.isArray)(e)?e.concat(t):void 0},i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?a.mergeWith.apply(void 0,[Object.create(null)].concat(t,[r])):t[0]}},612:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var a=n(1),r=n(536),i=n(542),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(r.a)(e);return Object(a.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e),i=c(e,n);return i&&Object(a.isObject)(i[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(r.a)(e);return c(e,n)&&i.b===c(e,n)[t]}},613:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var a=n(545),r=n(563),i=n(541),c=n(587),s=function(e,t,n){return function(s,o){if(!Object(c.a)(o(),n,e)&&!Object(c.b)(o(),n,e)){var u={type:i.Pb,instanceId:n,siteId:e};return s(u),a.b(e,a.e.serviceSettings(t,n)).then(function(t){return s(function(e,t,n){return{type:i.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return s(Object(r.a)(e,u,t))})}}}},614:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,a){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,a)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var r={};return Object.keys(n).forEach(function(i){var c=(t.properties||{})[i];r[i]=e(c,n[i],a)}),r;case"array":return n.map(function(n){return e(t.items,n,a)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},615:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(534),m=n.n(d),p=n(531),f=n.n(p),E=n(35),_=n.n(E),O=n(78),b=n.n(O),h=n(12),g=n.n(h),v=n(10),C=n.n(v),S=n(109),N=n(617),y=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"renderChildren",function(){var e;e=n.props&&(Object.keys(n.props).length>1||!n.props.children)?C.a.createElement("div",n.props,n.props.children):n.props.children,n.context.store&&(e=C.a.createElement(S.a,{store:n.context.store},C.a.createElement(N.b,null,e))),b.a.render(e,n.container)}),n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.renderChildren()}},{key:"componentDidUpdate",value:function(){this.renderChildren()}},{key:"componentWillUnmount",value:function(){this.container&&(b.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container),delete this.container)}},{key:"render",value:function(){return null}}]),t}(C.a.Component);_()(y,"contextTypes",{store:g.a.object})},616:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),c=n.n(i),s=n(10),o=n.n(s),u=n(528),l=n.n(u);t.a=function(e){var t=e.className,n=c()(e,["className"]);return o.a.createElement("input",r()({},n,{type:"checkbox",className:l()(t,"form-checkbox")}))}},617:function(e,t,n){"use strict";n.d(t,"b",function(){return T}),n.d(t,"a",function(){return k});var a=n(111),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(10),g=n.n(h),v=n(109),C=n(164),S=n.n(C),N=n(47),y=n.n(N),j=n(1),I=n(546),R=Object(I.a)(function(e){return Object(j.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),P=y()("calypso:localized-moment"),k=g.a.createContext(S.a),M=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(r))),b()(f()(n),"state",{moment:S.a,momentLocale:S.a.locale()}),n}return _()(t,e),o()(t,[{key:"checkAndLoad",value:function(){var e=r()(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((a=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==a){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return P("Loading moment locale for %s",a),e.prev=8,this.loadingLocalePromise=n(625)("./".concat(a)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),P("Failed to load moment locale for %s",a,e.t0),e.abrupt("return");case 18:P("Loaded moment locale for %s",a);case 19:a===this.props.currentLocale&&(S.a.locale()!==a&&S.a.locale(a),this.setState({momentLocale:a}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(S.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return g.a.createElement(k.Provider,{value:this.state},this.props.children)}}]),t}(g.a.Component),T=Object(v.b)(function(e){return{currentLocale:R(e)}})(M)},619:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});n(1);var a=n(664),r=n.n(a),i=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function c(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){i.innerHTML=e;var t=i.textContent;return i.innerHTML="",t}(e)}function s(e){return r()(e)}String.fromCharCode(160)},621:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return l});var a=n(34),r=n(607),i=n(1),c=n(545),s={a4:{name:Object(a.translate)("A4"),exclude:function(e){return Object(i.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(a.translate)('Label (4"x6")')},legal:{name:Object(a.translate)("Legal")},letter:{name:Object(a.translate)("Letter")}},o=function(e){return Object(i.reduce)(s,function(t,n,a){var r=n.name,i=n.exclude;return i&&i(e)||(t[a]=r),t},{})},u=function(e,t,n){if(!s[e])throw new Error("Invalid paper size: ".concat(e));var a={paper_size:e,label_id_csv:Object(i.filter)(Object(i.map)(t,"labelId")).join(","),caption_csv:Object(i.filter)(Object(i.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(r.stringify)(a)},l=function(e,t){return u(e,t,c.e.labelsPrint())}},625:function(e,t,n){var a={"./af":[392,2],"./af.js":[392,2],"./ar":[399,3],"./ar-dz":[393,4],"./ar-dz.js":[393,4],"./ar-kw":[394,5],"./ar-kw.js":[394,5],"./ar-ly":[395,6],"./ar-ly.js":[395,6],"./ar-ma":[396,7],"./ar-ma.js":[396,7],"./ar-sa":[397,8],"./ar-sa.js":[397,8],"./ar-tn":[398,9],"./ar-tn.js":[398,9],"./ar.js":[399,3],"./az":[400,10],"./az.js":[400,10],"./be":[401,11],"./be.js":[401,11],"./bg":[402,12],"./bg.js":[402,12],"./bm":[403,13],"./bm.js":[403,13],"./bn":[405,14],"./bn-bd":[404,15],"./bn-bd.js":[404,15],"./bn.js":[405,14],"./bo":[406,16],"./bo.js":[406,16],"./br":[407,17],"./br.js":[407,17],"./bs":[408,18],"./bs.js":[408,18],"./ca":[409,19],"./ca.js":[409,19],"./cs":[410,20],"./cs.js":[410,20],"./cv":[411,21],"./cv.js":[411,21],"./cy":[412,22],"./cy.js":[412,22],"./da":[413,23],"./da.js":[413,23],"./de":[416,24],"./de-at":[414,25],"./de-at.js":[414,25],"./de-ch":[415,26],"./de-ch.js":[415,26],"./de.js":[416,24],"./dv":[417,27],"./dv.js":[417,27],"./el":[418,28],"./el.js":[418,28],"./en-au":[419,29],"./en-au.js":[419,29],"./en-ca":[420,30],"./en-ca.js":[420,30],"./en-gb":[421,31],"./en-gb.js":[421,31],"./en-ie":[422,32],"./en-ie.js":[422,32],"./en-il":[423,33],"./en-il.js":[423,33],"./en-in":[424,34],"./en-in.js":[424,34],"./en-nz":[425,35],"./en-nz.js":[425,35],"./en-sg":[426,36],"./en-sg.js":[426,36],"./eo":[427,37],"./eo.js":[427,37],"./es":[431,38],"./es-do":[428,39],"./es-do.js":[428,39],"./es-mx":[429,40],"./es-mx.js":[429,40],"./es-us":[430,41],"./es-us.js":[430,41],"./es.js":[431,38],"./et":[432,42],"./et.js":[432,42],"./eu":[433,43],"./eu.js":[433,43],"./fa":[434,44],"./fa.js":[434,44],"./fi":[435,45],"./fi.js":[435,45],"./fil":[436,46],"./fil.js":[436,46],"./fo":[437,47],"./fo.js":[437,47],"./fr":[440,48],"./fr-ca":[438,49],"./fr-ca.js":[438,49],"./fr-ch":[439,50],"./fr-ch.js":[439,50],"./fr.js":[440,48],"./fy":[441,51],"./fy.js":[441,51],"./ga":[442,52],"./ga.js":[442,52],"./gd":[443,53],"./gd.js":[443,53],"./gl":[444,54],"./gl.js":[444,54],"./gom-deva":[445,55],"./gom-deva.js":[445,55],"./gom-latn":[446,56],"./gom-latn.js":[446,56],"./gu":[447,57],"./gu.js":[447,57],"./he":[448,58],"./he.js":[448,58],"./hi":[449,59],"./hi.js":[449,59],"./hr":[450,60],"./hr.js":[450,60],"./hu":[451,61],"./hu.js":[451,61],"./hy-am":[452,62],"./hy-am.js":[452,62],"./id":[453,63],"./id.js":[453,63],"./is":[454,64],"./is.js":[454,64],"./it":[456,65],"./it-ch":[455,66],"./it-ch.js":[455,66],"./it.js":[456,65],"./ja":[457,67],"./ja.js":[457,67],"./jv":[458,68],"./jv.js":[458,68],"./ka":[459,69],"./ka.js":[459,69],"./kk":[460,70],"./kk.js":[460,70],"./km":[461,71],"./km.js":[461,71],"./kn":[462,72],"./kn.js":[462,72],"./ko":[463,73],"./ko.js":[463,73],"./ku":[464,74],"./ku.js":[464,74],"./ky":[465,75],"./ky.js":[465,75],"./lb":[466,76],"./lb.js":[466,76],"./lo":[467,77],"./lo.js":[467,77],"./lt":[468,78],"./lt.js":[468,78],"./lv":[469,79],"./lv.js":[469,79],"./me":[470,80],"./me.js":[470,80],"./mi":[471,81],"./mi.js":[471,81],"./mk":[472,82],"./mk.js":[472,82],"./ml":[473,83],"./ml.js":[473,83],"./mn":[474,84],"./mn.js":[474,84],"./mr":[475,85],"./mr.js":[475,85],"./ms":[477,86],"./ms-my":[476,87],"./ms-my.js":[476,87],"./ms.js":[477,86],"./mt":[478,88],"./mt.js":[478,88],"./my":[479,89],"./my.js":[479,89],"./nb":[480,90],"./nb.js":[480,90],"./ne":[481,91],"./ne.js":[481,91],"./nl":[483,92],"./nl-be":[482,93],"./nl-be.js":[482,93],"./nl.js":[483,92],"./nn":[484,94],"./nn.js":[484,94],"./oc-lnc":[485,95],"./oc-lnc.js":[485,95],"./pa-in":[486,96],"./pa-in.js":[486,96],"./pl":[487,97],"./pl.js":[487,97],"./pt":[489,98],"./pt-br":[488,99],"./pt-br.js":[488,99],"./pt.js":[489,98],"./ro":[490,100],"./ro.js":[490,100],"./ru":[491,101],"./ru.js":[491,101],"./sd":[492,102],"./sd.js":[492,102],"./se":[493,103],"./se.js":[493,103],"./si":[494,104],"./si.js":[494,104],"./sk":[495,105],"./sk.js":[495,105],"./sl":[496,106],"./sl.js":[496,106],"./sq":[497,107],"./sq.js":[497,107],"./sr":[499,108],"./sr-cyrl":[498,109],"./sr-cyrl.js":[498,109],"./sr.js":[499,108],"./ss":[500,110],"./ss.js":[500,110],"./sv":[501,111],"./sv.js":[501,111],"./sw":[502,112],"./sw.js":[502,112],"./ta":[503,113],"./ta.js":[503,113],"./te":[504,114],"./te.js":[504,114],"./tet":[505,115],"./tet.js":[505,115],"./tg":[506,116],"./tg.js":[506,116],"./th":[507,117],"./th.js":[507,117],"./tk":[508,118],"./tk.js":[508,118],"./tl-ph":[509,119],"./tl-ph.js":[509,119],"./tlh":[510,120],"./tlh.js":[510,120],"./tr":[511,121],"./tr.js":[511,121],"./tzl":[512,122],"./tzl.js":[512,122],"./tzm":[514,123],"./tzm-latn":[513,124],"./tzm-latn.js":[513,124],"./tzm.js":[514,123],"./ug-cn":[515,125],"./ug-cn.js":[515,125],"./uk":[516,126],"./uk.js":[516,126],"./ur":[517,127],"./ur.js":[517,127],"./uz":[519,128],"./uz-latn":[518,129],"./uz-latn.js":[518,129],"./uz.js":[519,128],"./vi":[520,130],"./vi.js":[520,130],"./x-pseudo":[521,131],"./x-pseudo.js":[521,131],"./yo":[522,132],"./yo.js":[522,132],"./zh-cn":[523,133],"./zh-cn.js":[523,133],"./zh-hk":[524,134],"./zh-hk.js":[524,134],"./zh-mo":[525,135],"./zh-mo.js":[525,135],"./zh-tw":[526,136],"./zh-tw.js":[526,136]};function r(e){if(!n.o(a,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],r=t[0];return n.e(t[1]).then(function(){return n.t(r,7)})}r.keys=function(){return Object.keys(a)},r.id=625,e.exports=r},626:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},a=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};a.isEnabled=function(){return!0},t.a=a}).call(this,n(112))},634:function(e,t,n){},635:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(680),o=n.n(s),u=n(681),l=n.n(u),d=n(682),m=n.n(d),p={ups:o.a,usps:l.a,dhlexpress:m.a,dhlecommerce:m.a,dhlecommerceasia:m.a},f=function(e){var t=e.carrier,n=e.size;if(!t||!p[t.toLowerCase()])return r.a.createElement("span",null);var a="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(n),"px");return r.a.createElement("div",{style:{width:a},className:"carrier-icon"},r.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};f.propTypes={carrier:c.a.string.isRequired,size:c.a.number},t.a=f},636:function(e,t,n){"use strict";var a=n(35),r=n.n(a),i=n(110),c=n.n(i),s=n(1),o=n(34),u=n(538),l=n(592),d=n(549),m=n(544),p=n(576),f=n(562),E=n(536),_=n(541);n(572),n(563),n(579),n(613),n(626);var O=n(545),b=n(36),h=n.n(b);function g(e,t,n,a){Object(s.isFunction)(n)?g(e,t,n(e,t,a),a):Object(s.isObject)(n)&&e(h()({},n,a))}var v,C=n(577),S=n(614),N=function(e,t){var n=Object(m.e)(e,t);return!n||n.pristine?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(f.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},y=function(e,t){var n=Object(E.a)(e);return t?c()(N(e,n)):[].concat(c()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(p.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),c()(N(e,n)))};t.a=(v={},r()(v,u.L,[function(e,t){var n=t.successAction,a=t.failureAction,r=t.onlyPackages,i=function(e){e(n),e(Object(l.b)())},c=y(e.getState(),r);e.dispatch(Object(s.isEmpty)(c)?i:Object(l.d)({nextSteps:c,onSuccess:i,onFailure:function(e){e(a),e(Object(l.b)())}}))}]),r()(v,_.Rb,[function(e,t){var n=e.dispatch,a=e.getState,r=t.siteId,i=t.methodId,c=t.methodType,s=t.method,o=t.successAction,l=t.failureAction,d=Object(C.a)(a(),c,r).formSchema,m=Object(S.a)(d,s);O.c(r,O.e.serviceSettings(c,i),m).then(function(e){n(function(e,t,n){return{type:u.Fb,siteId:e,data:t,originatingAction:n}}(r,e,t)),g(n,a,o,{sentData:m,receivedData:e})}).catch(function(e){return g(n,a,l,{error:e})})}]),v)},648:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var a=function(){return"https://wordpress.com"}},649:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),c=n.n(i),s=n(34),o=n(1),u=n(537),l=n.n(u),d=n(528),m=n.n(d),p=function(e){var t=e.isPlaceholder,n=e.data,a=e.dimensionUnit,i=e.prefixActions,c=(e.hasError,e.children),s=e.translate;if(t)return r.a.createElement("div",{className:"packages__packages-row placeholder"},r.a.createElement("div",{className:"packages__packages-row-icon"},r.a.createElement(l.a,{icon:"product",size:18})),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},r.a.createElement("span",null))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},r.a.createElement("span",null)),r.a.createElement("div",{className:"packages__packages-row-actions"},c));var u,d=function(){return r.a.createElement("div",{className:"packages__packages-row-actions"},c)};return r.a.createElement("div",{className:m()("packages__packages-row",{prefixed:i})},i?d():null,r.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return r.a.createElement(l.a,{icon:t,size:18})}(n.is_letter)),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},(u=n.name)&&""!==Object(o.trim)(u)?u:s("Untitled"))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},n.inner_dimensions," ",a),i?null:d())};p.propTypes={siteId:c.a.number.isRequired,isPlaceholder:c.a.bool,data:c.a.shape({name:c.a.string,is_letter:c.a.bool,inner_dimensions:c.a.string}).isRequired,prefixActions:c.a.bool,dimensionUnit:c.a.string},t.a=Object(s.localize)(p)},650:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var a=n(538);function r(e,t,n){return{type:a.L,successAction:e,failureAction:t,onlyPackages:n||!1}}},656:function(e,t,n){"use strict";var a=n(110),r=n.n(a),i=n(36),c=n.n(i),s=n(1),o=n(541),u={modalErrors:{},pristine:!0},l=function(e){return null===e||""===Object(s.trim)(e)},d={};d[o.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=c()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(s.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},d[o.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},d[o.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},d[o.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},d[o.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),a=Object(s.omitBy)(n,l);return Object.assign({},e,{packageData:a,pristine:!1})},d[o.m]=function(e,t){var n=t.packageData,a=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?a[n.index]=Object(s.omit)(n,"index"):a.push(n);return e=d[o.h](e),c()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:c()({},e.packages,{custom:a}),pristine:!1})},d[o.u]=function(e){return c()({},e,{showOuterDimensions:!0})},d[o.k]=function(e,t){var n=r()(e.packages.custom);return n.splice(t.index,1),c()({},e,{packages:c()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},d[o.t]=function(e,t){var n=t.serviceId,a=t.groupId,r=t.checked,i=e.predefinedSchema[n][a].definitions.map(function(e){return e.id}),o=e.currentlyEditingPredefinedPackages[n],u=r?Object(s.uniq)(Object(s.concat)(o,i)):Object(s.difference)(o,i),l=c()({},e.currentlyEditingPredefinedPackages);return l[n]=u,c()({},e,{currentlyEditingPredefinedPackages:l,pristine:!1})},d[o.v]=function(e,t){var n=t.serviceId,a=t.packageId,i=c()({},e.currentlyEditingPredefinedPackages),s=r()(i[n]||[]),o=s.indexOf(a);return-1===o?s.push(a):s.splice(o,1),i[n]=s,c()({},e,{currentlyEditingPredefinedPackages:i,pristine:!1})},d[o.l]=function(e,t){var n=t.serviceId,a=t.packageId,i=c()({},e.packages.predefined),s=r()(i[n]||[]),o=s.indexOf(a);return-1!==o&&s.splice(o,1),i[n]=s,c()({},e,{packages:c()({},e.packages,{predefined:i}),pristine:!1})},d[o.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=d[o.h](e),c()({},e,{packages:c()({},e.packages,{predefined:t}),pristine:!1})},d[o.o]=function(e,t){var n=t.mode;return c()({},e,{mode:n})},d[o.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},d[o.p]=function(e,t){var n=t.isFetching;return c()({},e,{isFetching:n})},d[o.q]=function(e,t){var n=t.isFetchError;return c()({},e,{isFetchError:n})},d[o.j]=function(e,t){var n=t.packages,a=t.dimensionUnit,r=t.weightUnit,i=t.packageSchema,s=t.predefinedSchema;return c()({},e,{packages:n,dimensionUnit:a,weightUnit:r,packageSchema:i,predefinedSchema:s,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof d[t.type]?d[t.type](e,t):e}},657:function(e,t,n){"use strict";var a=n(35),r=n.n(a),i=n(36),c=n.n(i),s=n(541),o={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},u={};u[s.b]=function(e,t){var n=t.storeOptions,a=t.formData,r=t.formMeta,i=t.userMeta;return c()({},e,{storeOptions:n,meta:c()({},e.meta,r,{pristine:!0,isLoaded:!0,user:i}),data:c()({},e.data,a)})},u[s.e]=function(e,t){var n=t.key,a=t.value,i=e.meta.pristine?e.data:e.pristineData;return c()({},e,{meta:c()({},e.meta,{pristine:!1}),data:c()({},e.data,r()({},n,a)),pristineData:i})},u[s.f]=function(e,t){var n=t.key,a=t.value;return c()({},e,{meta:c()({},e.meta,r()({},n,a))})},u[s.d]=function(e){return e.meta.pristine?e:c()({},e,{meta:c()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},u[s.c]=function(e){return c()({},e,{addCardDialog:!0})},u[s.a]=function(e){return c()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e}},662:function(e,t,n){"use strict";var a,r=n(110),i=n.n(r),c=n(36),s=n.n(c),o=n(119),u=n.n(o),l=n(35),d=n.n(l),m=n(47),p=n.n(m),f=n(592),E=n(538),_=p()("woocommerce:action-list");t.a=(a={},d()(a,E.d,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,i=r.prevSteps,c=r.currentStep,o=r.nextSteps||[],l=u()(o),d=l[0],m=l.slice(1);if(c)return void _("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!d)return void _("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var p=s()({},r,{prevSteps:i,currentStep:s()({},d,{startTime:a}),nextSteps:m});n(Object(f.a)(p)),d.onStep(n,p)}]),d()(a,E.e,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,c=r.prevSteps,o=r.currentStep,u=r.nextSteps;if(!o)return void _("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var l=s()({},r,{prevSteps:[].concat(i()(c||[]),[s()({},o,{endTime:a})]),currentStep:null,nextSteps:u});n(Object(f.a)(l)),u&&u.length>0?n(Object(f.d)(l)):r.onSuccess&&r.onSuccess(n,l)}]),d()(a,E.c,[function(e,t){var n=e.dispatch,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=t.actionList,c=t.error,o=r.prevSteps,u=r.currentStep,l=r.nextSteps;if(!u)return void _("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var d=s()({},r,{prevSteps:[].concat(i()(o||[]),[s()({},u,{endTime:a,error:c})]),currentStep:null,nextSteps:l});n(Object(f.a)(d)),r.onFailure&&r.onFailure(n,d)}]),a)},663:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),c=n(46),s=n(538),o=n(542),u=n(619);t.a=Object(c.b)(null,(a={},i()(a,s.k,function(){return o.b}),i()(a,s.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(u.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(u.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(u.a)(e.name)}})}})}})}),i()(a,s.j,function(e,t){var n=t.originalAction.type;return s.k===n?o.a:e}),a))},676:function(e,t,n){"use strict";n.d(t,"a",function(){return M});n(533);var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=(n(534),n(531)),m=n.n(d),p=n(35),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n(47),h=n.n(b),g=(n(677),n(34)),v=n.n(g),C=n(1),S=h()("calypso:protect-form"),N=[],y=0;function j(e){if(N.length){S("unsaved form changes detected");var t=v.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function I(){0===y&&window.addEventListener("beforeunload",j),y++}function R(){0===--y&&window.removeEventListener("beforeunload",j)}function P(e){Object(C.includes)(N,e)||N.push(e)}function k(e){N=Object(C.without)(N,e)}var M=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){I(),this.props.isChanged&&P(this)}},{key:"componentWillUnmount",value:function(){R(),k(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?P(this):k(this))}},{key:"render",value:function(){return null}}]),t}(O.Component);f()(M,"propTypes",{isChanged:_.a.bool.isRequired})},678:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(576),h=n(549),g=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,a=e.fetching,r=e.error;n||a||r||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);g.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(h.d)(e),fetching:Object(h.c)(e),error:Object(h.b)(e)}},function(e){return Object(O.b)({fetchSettings:b.a},e)})(g)},679:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),c=n.n(i),s=n(530),o=n.n(s),u=n(529),l=n.n(u),d=n(531),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(562),h=n(544),g=function(e){function t(){return r()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,a=e.fetching,r=e.error;n||a||r||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);g.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(h.i)(e),fetching:Object(h.h)(e),error:Object(h.g)(e)}},function(e){return Object(O.b)({fetchSettings:b.fetchSettings},e)})(g)},680:function(e,t,n){e.exports=n.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},681:function(e,t,n){e.exports=n.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},682:function(e,t,n){e.exports=n.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},683:function(e,t,n){"use strict";var a=n(36),r=n.n(a),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(109),l=n(34),d=n(1),m=n(537),p=n.n(m),f=n(35),E=n.n(f),_=n(698),O=n(107),b=n.n(O),h=n(108),g=n.n(h),v=n(530),C=n.n(v),S=n(529),N=n.n(S),y=n(531),j=n.n(y),I=n(30),R=n(528),P=n.n(R);function k(e){return Object(d.get)(e,["currentUser","id"])}function M(e){var t=k(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){var a=M(n);return Object(d.get)(a,e,t)}};T("localeSlug"),T("localeVariant"),T("user_ip_country_code");T("date"),T("username"),T("email");T("email_verified",!1);var A=n(536),L=n(565);function w(e){var t=Object(A.a)(e);return t||1!==function(e){var t=M(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=M(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(L.a)(e,t)}var x=n(542),D=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e);return Object(d.isArray)(D(e,t))},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e);return x.b===D(e,t)};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(A.a)(e),n=D(e,t);return Object(d.find)(n,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var G=n(572),H=n(563),F=n(538),B=function(e){return function(t,n){if(!W(n(),e)&&!U(n(),e)){var a={type:F.N,siteId:e};return t(a),Object(G.a)(e).get("settings/products").then(function(n){t({type:F.O,siteId:e,data:n})}).catch(function(n){t(Object(H.a)(e,a,n))})}}},z=n(602),q=function(e){function t(){return b()(this,t),C()(this,N()(t).apply(this,arguments))}return j()(t,e),g()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.noWrap,a=e.dimensions,r=e.onChange,i=e.translate,s=e.dimensionsUnit,o=P()("form-dimensions-input",t,{"no-wrap":n});return c.a.createElement("div",{className:o},c.a.createElement(_.a,{name:"length",placeholder:i("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:a&&a.length||"",onChange:function(e){return r(e,"length")},className:"form-dimensions-input__length"}),c.a.createElement(_.a,{name:"width",placeholder:i("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:a&&a.width||"",onChange:function(e){return r(e,"width")},className:"form-dimensions-input__width"}),c.a.createElement(z.a,{name:"height",placeholder:i("H",{comment:"Height placeholder for dimensions input"}),suffix:s,type:"number",value:a&&a.height||"",onChange:function(e){return r(e,"height")},className:"form-dimensions-input__height"}))}}]),t}(i.Component);E()(q,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),E()(q,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var Z=Object(u.b)(function(e,t){var n=t.dimensionsUnit,a=w(e);if(!n){var r=a&&V(e,a.ID);n=r&&r.value||"in"}return{siteId:a&&a.ID,dimensionsUnit:n}},function(e){return Object(I.b)({fetchSettingsProducts:B},e)})(Object(l.localize)(q)),K=n(548),Q=n(551),Y=n(569),$=n(552),X=/^\.\d+$/,J=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:J.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ne=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,ae=function(e){return isNaN(e)?"":0>e?"":e},re=function(e){var t="",n="",a="",r=ne.exec(e);return r&&4===r.length&&(t=ae(r[1]),n=ae(r[2]),a=ae(r[3])),{length:t,width:n,height:a}},ie=function(e){return Object(d.trim)(e)},ce=ee,se=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=re,ue=function(e){var t=re(e),n=t.length,a=t.width,r=t.height;return 0<n&&0<a&&0<r},le=function(e){var t=e.siteId,n=e.form,a=e.setModalErrors,r=e.updatePackagesField,i=e.translate,s=n.mode,o=n.modalErrors,u=n.dimensionUnit,l=n.weightUnit,m=n.packageData,p=m.name,f=m.inner_dimensions,O=m.box_weight,b=m.is_letter,h=function(e,n){a(t,Object(d.omit)(o,e)),r(t,E()({},e,n))},g=function(e,t){h(t,e)},v=function(e,t){var n=t||i("Invalid value."),a=""===Object(d.trim)(m[e])?i("This field is required."):n;return o[e]?c.a.createElement($.a,{text:a}):null},C=function(e){r(t,{is_letter:"envelope"===e.target.value})};return c.a.createElement("div",{className:"packages__properties-group"},"add-custom"===s?c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"package_type"},i("Type of package")),c.a.createElement(Y.a,{id:"package_type",onChange:C,value:b?"envelope":"box"},c.a.createElement("option",{value:"box"},i("Box")),c.a.createElement("option",{value:"envelope"},i("Envelope")))):null,c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"name"},i("Package name")),c.a.createElement(_.a,{id:"name",name:"name",placeholder:i("Unique package name"),value:p||"",onChange:function(e){return g(e,"name")},className:o.name?"is-error":""}),v("name",i("This field must be unique"))),c.a.createElement(K.a,{className:"packages__add-package-weight-group"},c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,null,i("Dimensions (L x W x H)")),function(e,t,n,a){var r=oe(t),i=r.length,s=r.width,o=r.height;return c.a.createElement(Z,{dimensionsUnit:n,dimensions:{width:s,height:o,length:i},onChange:function(t,n){a(e,["length"===n?t:i,"width"===n?t:s,"height"===n?t:o].join(" x "))}})}("inner_dimensions",f,u,h),v("inner_dimensions")),c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,{htmlFor:"box_weight"},i("Weight of empty package")),c.a.createElement(z.a,{id:"box_weight",name:"box_weight",placeholder:i("0.0"),value:O||"",onChange:function(e){return g(e,"box_weight")},className:o.box_weight?"is-error":"",type:"number",suffix:l}),v("box_weight"))))};le.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var de=Object(l.localize)(le),me=n(115),pe=n.n(me),fe=Object(d.memoize)(function(e){return pe()(e,{greedy:!0})}),Ee=function(e){return e&&""!==Object(d.trim)(e)?e:null},_e=function(e,t){return e=Ee(e),Object(d.some)(t,function(t){return t===e})?null:e},Oe=/^\d+(\.\d+)?$/,be=function(e){return Oe.test(e)?Number.parseFloat(e):null},he=function(e,t,n){var a,r=fe(n);return r(function(e,t){var n=be(e.box_weight),a=be(e.max_weight);n&&a&&a<=n&&(a=null);var r={name:_e(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:Ee(e.outer_dimensions),box_weight:n,max_weight:a};return Object(d.omitBy)(r,function(e){return null===e})}(e,t)),a=r.errors,Object(d.reduce)(a,function(e,t){if(t.field){var n,a=t.field.replace("data.","");Object.assign(e,(n={},E()(n,a,!0),E()(n,"any",!0),n))}return e},{})},ge=n(570),ve=n(554),Ce=n(583),Se=function(e){var t=e.className,n=e.disabled,a=e.id,r=e.onToggle,i=e.readOnly,s=e.selectedElements,o=e.totalElements,u=s&&s===o,l=s&&s<o,d=P()("bulk-select__box",{"is-checked":u}),m=P()("bulk-select__some-checked-icon",{"is-disabled":n}),f=P()("bulk-select",t);return c.a.createElement("span",{className:f},c.a.createElement("span",{className:"bulk-select__container"},c.a.createElement("input",{id:a,type:"checkbox",className:d,onChange:function(e){i||r(!(l||u),e)},checked:u,disabled:n}),l?c.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};Se.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var Ne=Se,ye=n(601),je=n(616),Ie=n(649),Re=n(544),Pe=function(e){var t=e.siteId,n=e.form,a=e.toggleAll,r=e.togglePackage,i=e.currentlyEditingPredefinedPackages,s=e.translate,o=n.dimensionUnit,u=function(e){var n="group-".concat(e.serviceId,"-").concat(e.groupId);return c.a.createElement("div",{className:"packages__group-header"},c.a.createElement("label",{htmlFor:n,onClick:function(e){return e.stopPropagation()}},c.a.createElement(Ne,{id:n,totalElements:e.total,selectedElements:e.selected,onToggle:function(n,r){r.stopPropagation(),a(t,e.serviceId,e.groupId,r.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return c.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(i,function(n,a){var i,l,d=(i=n.selected,l=n.total,i===l?s("All packages selected"):s("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:i,args:{selectedCount:i}}));e.push(c.a.createElement(ye.a,{className:"packages__predefined-packages",key:a,header:u(n),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:s("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,n){return c.a.createElement(Ie.a,{key:n,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},c.a.createElement(je.a,{checked:e.selected,onChange:function(){return r(t,e.serviceId,e.id)}}))})}(n)))}),e}())};Pe.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var ke=Object(u.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Re.c)(e)}})(Object(l.localize)(Pe)),Me=n(534),Te=n.n(Me),Ae=function(e){function t(){var e,n;b()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=C()(this,(e=N()(t)).call.apply(e,[this].concat(r))),E()(Te()(n),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),n}return j()(t,e),g()(t,[{key:"render",value:function(){var e=P()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=P()("segmented-control__link",E()({},"item-index-".concat(this.props.index),null!=this.props.index));return c.a.createElement("li",{className:e},c.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},c.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(c.a.Component);E()(Ae,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),E()(Ae,"defaultProps",{selected:!1});var Le=Ae,we=function(e){function t(){var e,n;b()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=C()(this,(e=N()(t)).call.apply(e,[this].concat(r))),E()(Te()(n),"state",{selected:n.props.initialSelected||n.props.options[0].value}),n}return j()(t,e),g()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,n){return c.a.createElement(Le,{index:n,key:n,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return c.a.createElement("ul",{className:P()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(c.a.Component);E()(we,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var xe=n(650),De=n(550),We=n(562),Ue=function(e){var t,n=e.siteId,a=e.form,r=e.predefinedPackagesSummary,i=e.setModalErrors,s=e.savePackage,o=e.savePredefinedPackages,u=e.dismissModal,l=e.removePackage,m=e.setAddMode,f=e.updatePackagesField,E=e.translate,_=a.showModal,O=a.mode,b=a.packages,h=a.packageSchema,g=a.predefinedSchema,v=a.packageData,C=v.index,S=b.custom,N="edit"===O,y="add-custom"===O,j="add-predefined"===O,I=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in v&&e.onSaveSuccess(v.name),e.successNotice(E("Your shipping packages have been saved."),t)},function(){return e.errorNotice(E("Unable to save your shipping packages. Please try again."),t)},!0)},R=function(){u(n)},P=E(N?"Edit package":"Add a package"),k=y||j,M=y||N,T=j;t=y||j&&0===r.removed?E("Add package","Add packages",{count:y?1:r.added}):E("Done");var A=[c.a.createElement(Ce.a,{onClick:function(){if(j)return o(n),void(e.persistOnSave&&I());var t="number"===typeof v.index?S[v.index].name:null,a=Object(d.concat)(Object(d.difference)(S.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(g,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),r=Object.assign({},v,{name:ie(v.name),inner_dimensions:se(v.inner_dimensions),outer_dimensions:se(v.outer_dimensions),box_weight:ce(v.box_weight),max_weight:0}),c=he(r,a,h);if(ue(r.inner_dimensions)||(c.any=!0,c.inner_dimensions=!0),c.any)return f(n,r),void i(n,c);s(n,r),e.persistOnSave&&I()}},t),c.a.createElement(Ce.a,{onClick:R,isPrimary:!1},E("Cancel"))];return N&&A.unshift({action:"delete",label:c.a.createElement("span",null,E("{{icon/}} Delete this package",{components:{icon:c.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return l(n,C)},additionalClassNames:"packages__delete is-scary is-borderless"}),c.a.createElement(ge.a,{isVisible:_,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:R,buttons:A},c.a.createElement(ve.a,{className:"packages__add-edit-title"},P),k&&c.a.createElement(we,{primary:!0,className:"packages__mode-select",initialSelected:O,onSelect:function(e){m(n,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),M&&c.a.createElement(de,e),T&&c.a.createElement(ke,e))};Ue.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(u.b)(function(e){return{predefinedPackagesSummary:Object(Re.f)(e)}},function(e){return Object(I.b)(r()({createWcsShippingSaveActionList:xe.a,errorNotice:De.a,successNotice:De.d},We),e)})(Object(l.localize)(Ue))},797:function(e,t,n){},798:function(e,t,n){},799:function(e,t,n){},800:function(e,t,n){e.exports=n.p+"images/87ed0f18f2fdcec3f7db334f21e5ca74.svg"},801:function(e,t,n){e.exports=n.p+"images/16ca93315c92bf5c0000d63300e5cd85.svg"},802:function(e,t,n){e.exports=n.p+"images/726f32c920aabc7c6ffd42b5b4eaaf2d.svg"},803:function(e,t,n){e.exports=n.p+"images/331d1b39baf9a992bfdbacc7412570f4.svg"},804:function(e,t,n){e.exports=n.p+"images/312631cb779f098879fc3522b42eefaf.svg"},805:function(e,t,n){e.exports=n.p+"images/bf0d855ed117f2f9bdae37cd43f09a95.svg"},806:function(e,t,n){e.exports=n.p+"images/30192ac2bb4b8bef75e1a666610914d7.svg"},830:function(e,t,n){"use strict";n.r(t);var a=n(10),r=n.n(a),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(530),l=n.n(u),d=n(529),m=n.n(d),p=n(534),f=n.n(p),E=n(531),_=n.n(E),O=n(35),b=n.n(O),h=n(109),g=n(30),v=n(34),C=n.n(v),S=n(720),N=n(528),y=n.n(N),j=n(605),I=n(12),R=n.n(I),P=n(1),k=n(796),M=n(835),T=n(533),A=n.n(T),L=n(535),w=n.n(L),x=n(537),D=n.n(x),W=function(e){var t=e.className,n=e.compact,a=e.displayAsLink,r=e.highlight,i=e.href,c=e.onClick;return y()("card",t,{"is-card-link":a||!!i,"is-clickable":!!c,"is-compact":n,"is-highlight":r},!!r&&"is-"+r)},U=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.compact,e.displayAsLink),a=(e.highlight,e.tagName),i=e.href,c=e.target,s=w()(e,["children","compact","displayAsLink","highlight","tagName","href","target"]);return i?r.a.createElement("a",A()({},s,{href:i,target:c,className:W(this.props)}),r.a.createElement(D.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t):r.a.createElement(a,A()({},s,{className:W(this.props)}),n&&r.a.createElement(D.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t)}}]),t}(a.PureComponent);b()(U,"propTypes",{className:R.a.string,displayAsLink:R.a.bool,href:R.a.string,tagName:R.a.oneOfType([R.a.func,R.a.string]).isRequired,target:R.a.string,compact:R.a.bool,highlight:R.a.oneOf([!1,"error","info","success","warning"])}),b()(U,"defaultProps",{tagName:"div",highlight:!1});var V=U;function G(e){return r.a.createElement(V,A()({},e,{className:y()(e.className,"is-compact")}),e.children)}var H={en:{symbol:"K",grouping:",",decimal:"."},es:{symbol:" mil",grouping:".",decimal:","},"pt-br":{symbol:" mil",grouping:".",decimal:","},de:{symbol:" Tsd.",grouping:".",decimal:","},fr:{symbol:" k",grouping:" ",decimal:","},he:{symbol:"K",grouping:",",decimal:"."},ja:{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},nl:{symbol:"K",grouping:".",decimal:","},tr:{symbol:" B",grouping:".",decimal:","},id:{symbol:" rb",grouping:".",decimal:","},"zh-cn":{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},"zh-tw":{symbol:"\u842c",unitValue:1e4,grouping:",",decimal:"."},ko:{symbol:"\ucc9c",grouping:",",decimal:"."},ar:{symbol:" \u0623\u0644\u0641",grouping:"\u066c",decimal:"\u066b"},sv:{symbol:" tn",grouping:" ",decimal:","}};n(797);var F=function(e){var t=e.count,n=e.compact,a=e.numberFormat,i=e.primary,c=w()(e,["count","compact","numberFormat","primary"]);return r.a.createElement("span",A()({className:y()("count",{"is-primary":i})},Object(P.omit)(c,["translate","moment"])),n&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.a.getLocaleSlug();if(isNaN(e)||!H[t])return null;var n=H[t],a=n.decimal,r=n.grouping,i=n.symbol,c=n.unitValue,s=void 0===c?1e3:c,o=e<0?"-":"",u=Math.abs(e);if(u<s)return"".concat(o).concat(u);var l=u<10*s?1:0,d=Object(v.numberFormat)(u/s,{decimals:l,thousandsSep:r,decPoint:a});return"".concat(o).concat(d).concat(i)}(t)||a(t))};F.propTypes={count:R.a.number.isRequired,numberFormat:R.a.func,primary:R.a.bool,compact:R.a.bool},F.defaultProps={primary:!1,compact:!1};var B=Object(v.localize)(F),z=(n(798),function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e="number"===typeof this.props.count,t=!(this.props.label||e||this.props.children),n=y()(this.props.className,"section-header",{"is-empty":t}),a={id:this.props.id};return r.a.createElement(G,A()({className:n,href:this.props.href},a),r.a.createElement("div",{className:"section-header__label"},r.a.createElement("span",{className:"section-header__label-text"},this.props.label),e&&r.a.createElement(B,{count:this.props.count})),r.a.createElement("div",{className:"section-header__actions"},this.props.children))}}]),t}(a.PureComponent));b()(z,"defaultProps",{label:"",href:null});var q=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.description,a=e.children,i=r.a.createElement("div",null,r.a.createElement("div",{className:"extended-header__header"},t),r.a.createElement("div",{className:"extended-header__header-description"},n));return r.a.createElement(z,{className:"extended-header",label:i},a)}}]),t}(a.Component),Z=n(36),K=n.n(Z),Q=n(621),Y=n(616),$=n(548),X=n(551),J=n(569),ee=n(555),te=n(588),ne=(n(799),n(800)),ae=n.n(ne),re=n(801),ie=n.n(re),ce=n(802),se=n.n(ce),oe=n(803),ue=n.n(oe),le=n(804),de=n.n(le),me=n(805),pe=n.n(me),fe=n(806),Ee=n.n(fe),_e={amex:ae.a,diners:ie.a,discover:se.a,jcb:ue.a,mastercard:de.a,unionpay:pe.a,visa:Ee.a},Oe={alipay:"Alipay",amex:"American Express","apple-pay":"Apple Pay",bancontact:"Bancontact","brazil-tef":"Transfer\xeancia banc\xe1ria",diners:"Diners Club",discover:"Discover",eps:"eps",giropay:"Giropay",id_wallet:"OVO",ideal:"iDEAL",jcb:"JCB",mastercard:"Mastercard",netbanking:"Net Banking",p24:"Przelewy24",paypal:"PayPal",placeholder:"Payment logo",unionpay:"UnionPay",visa:"Visa",wechat:C.a.translate("WeChat Pay",{comment:"Name for WeChat Pay - https://pay.weixin.qq.com/"}),sofort:"Sofort"},be=Object(P.keys)(Oe),he=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.altText,n=e.className,a=e.isCompact,i=e.type,c=e.disabled,s=y()("payment-logo","is-".concat(i),{"is-compact":a},{disabled:c},n),o=_e[i],u=o?{backgroundImage:"url(".concat(o,")")}:void 0;return r.a.createElement("div",{className:s,style:u,"aria-label":t||Oe[i]||""})}}]),t}(r.a.Component);b()(he,"propTypes",{className:R.a.string,type:R.a.oneOf(be),altText:R.a.string,isCompact:R.a.bool,disabled:R.a.bool});var ge=he,ve=function(e,t,n){var a={amex:e("American Express"),discover:e("Discover"),mastercard:e("MasterCard"),visa:e("VISA"),paypal:e("PayPal")};return a[t]?n?e("%(card)s ****%(digits)s",{args:{card:a[t],digits:n}}):a[t]:null},Ce=function(e){var t=e.translate,n=e.selected,a=e.isLoading,i=e.type,c=e.digits,s=e.name,o=e.expiry,u=e.onSelect;if(a)return r.a.createElement(M.a,{className:y()("label-settings__card","card","is-compact")},r.a.createElement(Y.a,{className:"label-settings__card-checkbox"}),r.a.createElement(ge,{className:"label-settings__card-logo",type:"placeholder",altText:""}),r.a.createElement("div",{className:"label-settings__card-details"},r.a.createElement("p",{className:"label-settings__card-number"}),r.a.createElement("p",{className:"label-settings__card-name"})),r.a.createElement("div",{className:"label-settings__card-date"},r.a.createElement("p",null)));var l=ve(t,i,c),d=l?i:"placeholder",m=l||i;return r.a.createElement(M.a,{className:y()("label-settings__card","card","is-compact"),onClick:u},r.a.createElement(Y.a,{className:"label-settings__card-checkbox",checked:n,onChange:u}),r.a.createElement(ge,{className:"label-settings__card-logo",type:d,altText:l}),r.a.createElement("div",{className:"label-settings__card-details"},r.a.createElement("p",{className:"label-settings__card-number"},m),r.a.createElement("p",{className:"label-settings__card-name"},s)),r.a.createElement("div",{className:"label-settings__card-date"},t("Expires %(date)s",{args:{date:o},context:"date is of the form MM/YY"})))};Ce.propTypes={selected:R.a.bool.isRequired,isLoading:R.a.bool,type:R.a.string,digits:R.a.string,name:R.a.string,expiry:R.a.string,onSelect:R.a.func};var Se=Object(v.localize)(Ce),Ne=n(648),ye=n(576),je=n(549),Ie=function(){return null},Re=function(){return null},Pe=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderPaymentPermissionNotice",function(){var e=n.props,t=e.canEditPayments,a=e.canEditSettings,i=e.masterUserName,c=e.masterUserLogin,s=e.translate;return!a||t?null:r.a.createElement(ee.a,{showDismiss:!1},s("Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.",{args:{ownerName:i,ownerLogin:c}}))}),b()(f()(n),"refetchSettings",function(){n.props.fetchSettings(n.props.siteId)}),b()(f()(n),"renderPaymentWarningNotice",function(){var e=n.props,t=e.paymentMethodsWarning,a=e.translate;if(t)return r.a.createElement(ee.a,{status:"is-warning",showDismiss:!1,text:t},r.a.createElement(te.a,{onClick:n.refetchSettings},a("Retry")))}),b()(f()(n),"renderSettingsPermissionNotice",function(){var e=n.props,t=e.canEditSettings,a=e.masterUserName,i=e.masterUserLogin,c=e.translate;return t?null:r.a.createElement(ee.a,{showDismiss:!1},c("Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.",{args:{ownerName:a,ownerLogin:i}}))}),b()(f()(n),"renderAddCardExternalInfo",function(){var e=n.props,t=e.masterUserWpcomLogin,a=e.masterUserEmail,i=e.translate;return t?r.a.createElement("p",null,i("Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>",{args:{wpcomLogin:t,wpcomEmail:a}})):null}),b()(f()(n),"onVisibilityChange",function(){document.hidden||n.refetchSettings(),n.addCreditCardWindow&&n.addCreditCardWindow.closed&&document.removeEventListener("visibilitychange",n.onVisibilityChange)}),b()(f()(n),"renderPaymentsSection",function(){var e=n.props,t=e.siteId,a=e.canEditPayments,i=e.paymentMethods,c=e.selectedPaymentMethod,s=e.isReloading,o=e.translate;if(!n.state.expanded){var u;if(c){var l=Object(P.find)(i,{payment_method_id:c}),d=l.card_type,m=l.card_digits;u=o("We'll charge the credit card on your account (%(card)s) to pay for the labels you print",{args:{card:ve(o,d,m)}})}else u=o("To purchase shipping labels, add a credit card.");return r.a.createElement("div",null,n.renderPaymentPermissionNotice(),r.a.createElement("p",{className:"label-settings__credit-card-description"},u),a&&r.a.createElement("p",{className:"label-settings__credit-card-description"},r.a.createElement(S.a,{onClick:function(e){e.preventDefault(),n.setState({expanded:!0})},className:y()("button","is-borderless")},o("Choose a different card"))))}var p,f;i.length?(p=o("To purchase shipping labels, choose a credit card you have on file or add a new card."),f=o("Add another credit card")):(p=o("To purchase shipping labels, add a credit card."),f=o("Add a credit card"));var E=y()("button","is-compact");return r.a.createElement("div",null,n.renderPaymentPermissionNotice(),r.a.createElement("p",{className:"label-settings__credit-card-description"},p),!s&&n.renderPaymentWarningNotice(),r.a.createElement(Ie,null),s?r.a.createElement("div",{className:y()(E,"label-settings__placeholder")},r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(Se,{selected:!1,isLoading:!0})):i.map(function(e,t){return r.a.createElement(Se,{key:t,selected:c===e.payment_method_id,type:e.card_type,name:e.name,digits:e.card_digits,expiry:e.expiry,onSelect:function(){return t=e.payment_method_id,n.props.setValue("selected_payment_method_id",t);var t}})}),r.a.createElement(Re,{siteId:t}),r.a.createElement(S.a,{className:y()(E,"label-settings__internal"),onClick:function(){n.props.openAddCardDialog(t)}},f),r.a.createElement("div",{className:"label-settings__credit-card-description label-settings__external"},n.renderAddCardExternalInfo(),r.a.createElement(S.a,{className:E,onClick:function(){n.addCreditCardWindow=window.open(Object(Ne.a)()+"/me/purchases/add-credit-card"),document.addEventListener("visibilitychange",n.onVisibilityChange)}},f," ",r.a.createElement(D.a,{icon:"external"}))))}),b()(f()(n),"renderEmailReceiptsSection",function(){var e=n.props,t=e.emailReceipts,a=e.translate,i=e.masterUserName,c=e.masterUserLogin,s=e.masterUserEmail,o=e.canEditSettings,u=e.canEditPayments;if(!Object(P.isBoolean)(t))return null;return r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},a("Email Receipts")),r.a.createElement(X.a,null,r.a.createElement(Y.a,{checked:t,onChange:function(){return n.props.setValue("email_receipts",!t)},disabled:!u&&!o}),r.a.createElement("span",{className:"label-settings__credit-card-description"},a("Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s",{args:{ownerName:i,ownerLogin:c,ownerEmail:s}}))))}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.canEditSettings,a=e.isLoading,i=e.paperSize,c=e.storeOptions,s=e.translate;if(a)return n.renderPlaceholder();var o=Object(Q.a)(c.origin_country);return r.a.createElement("div",null,r.a.createElement($.a,null,n.renderSettingsPermissionNotice(),r.a.createElement(X.a,{className:"label-settings__cards-label"},s("Paper size")),r.a.createElement(J.a,{onChange:function(e){return n.props.setValue("paper_size",e.target.value)},value:i,disabled:!t},Object.keys(o).map(function(e){return r.a.createElement("option",{value:e,key:e},o[e])}))),r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},s("Payment")),n.renderPaymentsSection()),n.renderEmailReceiptsSection())}),n}return _()(t,e),o()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({expanded:this.isExpanded(this.props)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectedPaymentMethod!==this.props.selectedPaymentMethod&&this.setState({expanded:this.isExpanded(e)})}},{key:"isExpanded",value:function(e){var t=e.canEditPayments,n=e.pristine,a=e.selectedPaymentMethod;return t&&(!a||!n)}},{key:"renderPlaceholder",value:function(){return r.a.createElement("div",{className:"label-settings__placeholder"},r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},r.a.createElement("span",null)),r.a.createElement(J.a,null)),r.a.createElement($.a,null,r.a.createElement(X.a,{className:"label-settings__cards-label"},r.a.createElement("span",null)),r.a.createElement("p",{className:"label-settings__credit-card-description"}),r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(Se,{selected:!1,isLoading:!0}),r.a.createElement(S.a,null)))}},{key:"render",value:function(){return r.a.createElement("div",{className:"label-settings__labels-container"},this.renderContent())}}]),t}(a.Component);Pe.propTypes={siteId:R.a.number.isRequired,setValue:R.a.func.isRequired};var ke=Object(h.b)(function(e,t){var n=t.siteId;return K()({isLoading:Object(je.c)(e,n)&&!Object(je.d)(e,n),isReloading:Object(je.c)(e,n)&&Object(je.d)(e,n),pristine:Object(je.o)(e,n),paymentMethods:Object(je.l)(e,n),paymentMethodsWarning:Object(je.m)(e,n),selectedPaymentMethod:Object(je.n)(e,n),paperSize:Object(je.k)(e,n),storeOptions:Object(je.h)(e,n),canEditPayments:Object(je.q)(e,n),canEditSettings:Object(je.q)(e,n)||Object(je.p)(e,n),emailReceipts:Object(je.e)(e,n)},Object(je.j)(e,n))},function(e){return Object(g.b)({openAddCardDialog:ye.b,fetchSettings:ye.a},e)})(Object(v.localize)(Pe)),Me=n(678),Te=n(536),Ae=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"setValue",function(e,t){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,e,t)}),b()(f()(n),"onEnabledToggle",function(){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,"enabled",!n.props.labelsEnabled)}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.isFetchError,a=e.siteId,i=e.translate;return t?r.a.createElement("p",null,i("Unable to get your settings. Please refresh the page to try again.")):r.a.createElement(ke,{siteId:a,setValue:n.setValue})}),n}return _()(t,e),o()(t,[{key:"componentWillUnmount",value:function(){this.props.restorePristineSettings(this.props.siteId)}},{key:"render",value:function(){var e=this.props,t=e.formMeta,n=e.canManagePayments,a=e.canEditSettings,i=e.labelsEnabled,c=e.siteId,s=e.translate;if(!t)return r.a.createElement(Me.a,{siteId:c});var o=Object(P.isBoolean)(i),u=Object(P.isBoolean)(i)&&!i;return r.a.createElement("div",null,r.a.createElement(Me.a,{siteId:c}),r.a.createElement(q,{label:s("Shipping Labels"),description:s("Print shipping labels yourself and save a trip to the post office")},o&&r.a.createElement(k.a,{checked:i,onChange:this.onEnabledToggle,disabled:Boolean(!n&&!a)})),r.a.createElement(M.a,{size:"small",className:y()("card","label-settings__labels-container",{hidden:u})},this.renderContent()))}}]),t}(a.Component);Ae.propTypes={onChange:R.a.func.isRequired,submit:R.a.func};var Le=Object(h.b)(function(e){return{siteId:Object(Te.a)(e),formMeta:Object(je.g)(e),labelsEnabled:Object(je.a)(e),isFetchError:Object(je.b)(e),canManagePayments:Object(je.q)(e),canEditSettings:Object(je.p)(e)}},function(e){return Object(g.b)({setFormDataValue:ye.d,restorePristineSettings:ye.c},e)})(Object(v.localize)(Ae)),we=n(564),xe=n(683),De=n(649),We=n(679),Ue=n(562),Ve=n(544),Ge=function(e){function t(){var e,n;c()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderListHeader",function(e){var t=n.props.translate;return e&&e.length?r.a.createElement("div",{className:"packages__packages-row packages__packages-header"},r.a.createElement("div",{className:"packages__packages-row-icon"}),r.a.createElement("div",{className:"packages__packages-row-details"},t("Name")),r.a.createElement("div",{className:"packages__packages-row-dimensions"},t("Dimensions")),r.a.createElement("div",{className:"packages__packages-row-actions"})):null}),b()(f()(n),"renderListItem",function(e,t){var a=n.props,i=a.siteId,c=a.isFetching,s=a.form,o=a.translate,u=s.dimensionUnit,l=y()("button","is-compact"),d=null;if(e.is_user_defined){d=r.a.createElement(S.a,{className:l,onClick:function(){n.props.onChange(),n.props.editPackage(i,e)}},o("Edit"))}else{d=r.a.createElement(S.a,{className:l,onClick:function(){n.props.onChange(),n.props.removePredefinedPackage(i,e.serviceId,e.id)}},o("Remove"))}return r.a.createElement(De.a,{key:t,siteId:i,isPlaceholder:c,data:e,dimensionUnit:u},d)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.isFetching,a=t.fetchError,i=t.siteId,c=t.allSelectedPackages,s=t.translate;if(a)return null;var o=n?[{},{},{}]:c;return r.a.createElement("div",null,r.a.createElement(We.a,{siteId:i}),r.a.createElement(q,{label:s("Packaging"),description:s("Add boxes, envelopes, and other packages you use most frequently")},r.a.createElement(S.a,{className:y()("button"),onClick:function(){e.props.onChange(),e.props.addPackage(i)},disabled:n},s("Add package"))),r.a.createElement(M.a,{size:"small",className:y()("card","packages__packages")},this.renderListHeader(o),o.map(this.renderListItem),!n&&r.a.createElement(xe.a,this.props)))}}]),t}(a.Component);Ge.propTypes={addPackage:R.a.func.isRequired,removePackage:R.a.func.isRequired,editPackage:R.a.func.isRequired,dismissModal:R.a.func.isRequired,onChange:R.a.func.isRequired,savePackage:R.a.func.isRequired,updatePackagesField:R.a.func.isRequired,toggleOuterDimensions:R.a.func.isRequired,setModalErrors:R.a.func.isRequired,showModal:R.a.bool,form:R.a.shape({packages:R.a.object,dimensionUnit:R.a.string,weightUnit:R.a.string,packageSchema:R.a.object,predefinedSchema:R.a.oneOfType([R.a.object,R.a.array])}).isRequired};var He=Object(h.b)(function(e){var t=Object(Te.a)(e),n=Object(Ve.e)(e,t)||{};return{siteId:t,isFetching:!n.packages||n.isFetching,fetchError:Object(Ve.g)(e,t),form:n,allSelectedPackages:Object(Ve.b)(e,t)||[]}},function(e){return K()({},Object(g.b)(Ue,e))})(Object(v.localize)(Ge)),Fe=n(111),Be=n.n(Fe),ze=n(77),qe=n.n(ze),Ze=n(635),Ke=n(570),Qe=n(545),Ye=n(550),$e=function(e){var t=e.accountData,n=e.translate,a=e.errorNotice,i=e.successNotice,c=e.siteId,s=r.a.useState(!1),o=qe()(s,2),u=o[0],l=o[1],d=r.a.useState(!1),m=qe()(d,2),p=m[0],f=m[1],E=r.a.useState(t.id),_=qe()(E,2),O=_[0],b=_[1],h=r.a.useCallback(function(){l(!0)},[l]),g=r.a.useCallback(function(){l(!1)},[l]),v=r.a.useCallback(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,Qe.a(c,Qe.e.shippingCarrierDelete(O));case 4:l(!1),i(n("Your carrier account was disconnected succesfully.")),b(null),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),a(n("There was an error trying to disconnect your carrier account"));case 12:f(!1);case 13:case"end":return e.stop()}},e,null,[[1,9]])}));return function(){return e.apply(this,arguments)}})()()},[l,a,i,f,c,b,O]),C=y()("button","is-compact"),N=r.a.useMemo(function(){return[r.a.createElement(S.a,{disabled:p,className:C,onClick:g},n("Cancel")),r.a.createElement(S.a,{isPrimary:!0,disabled:p,isBusy:p,className:y()(C,"is-scary"),onClick:v},n("Disconnect"))]},[g,v,p]);return r.a.createElement("div",{className:"carrier-accounts__list-item"},r.a.createElement("div",{className:"carrier-accounts__list-item-carrier-icon"},r.a.createElement(Ze.a,{carrier:{DhlExpressAccount:"dhlexpress",DhlEcsAccount:"dhlecommerce",DhlEcommerceAsiaAccount:"dhlecommerceasia",UpsAccount:"ups"}[t.type],size:18})),r.a.createElement("div",{className:"carrier-accounts__list-item-name"},r.a.createElement("span",null,t.carrier)),r.a.createElement("div",{className:"carrier-accounts__list-item-credentials"},r.a.createElement("span",null,O?t.account:null)),r.a.createElement("div",{className:"carrier-accounts__list-item-actions"},O?r.a.createElement(S.a,{onClick:h,className:y()(C,"is-scary","is-borderless")},n("Disconnect")):r.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings&carrier=".concat(t.type),className:C},n("Connect"))),r.a.createElement(Ke.a,{isVisible:u,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:g,buttons:N},r.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},r.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},n("Disconnect your %(carrier_name)s account",{args:{carrier_name:t.carrier}})),r.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:g},r.a.createElement(D.a,{icon:"cross"}))),r.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},n("This will remove the connection with %(carrier_name)s. All of your %(carrier_name)s account information will be deleted and you won\u2019t see %(carrier_name)s rates.",{args:{carrier_name:t.carrier}}))))};$e.propTypes={errorNotice:R.a.func.isRequired,successNotice:R.a.func.isRequired,siteId:R.a.number.isRequired,accountData:R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string,type:R.a.string}).isRequired};var Xe={errorNotice:Ye.a,successNotice:Ye.d},Je=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},Xe),v.localize)($e),et=function(e){var t=e.translate,n=e.accounts,a=void 0===n?[]:n;return 0===a.length?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Carrier account"),description:t("Set up your own carrier account by adding your credentials here")}),r.a.createElement(M.a,{size:"small",className:y()("card","carrier-accounts__list")},r.a.createElement("div",{className:"carrier-accounts__header"},r.a.createElement("div",{className:"carrier-accounts__header-icon"}),r.a.createElement("div",{className:"carrier-accounts__header-name"},t("Name")),Object(P.some)(a,"account")&&r.a.createElement("div",{className:"carrier-accounts__header-credentials"},t("Credentials")),r.a.createElement("div",{className:"carrier-accounts__header-actions"})),a.map(function(e,t){return r.a.createElement(Je,{key:t,accountData:e})})))};et.propTypes={accounts:R.a.arrayOf(R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string,type:R.a.string}))};var tt=Object(v.localize)(et),nt=n(820),at=Object(v.localize)(function(e){var t=e.translate;return r.a.createElement(r.a.Fragment,null,r.a.createElement("a",{className:"button is-compact",href:"admin.php?page=wc-settings&tab=shipping§ion"},t("Add to shipping zones")),r.a.createElement(nt.a,{position:"top left",text:t("To be displayed at checkout, this carrier must be added as a shipping method to selected shipping zones")},r.a.createElement("div",null,r.a.createElement(D.a,{icon:"help-outline",size:18}))))}),rt=Object(v.localize)(function(e){return(0,e.translate)("Discounted %(carrierName)s shipping labels",{args:{carrierName:e.name}})}),it={wc_services_usps:function(e){var t=e.translate;return r.a.createElement("div",{className:"live-rates-carriers-list__element element-usps"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"},r.a.createElement(Ze.a,{carrier:"usps",size:18})),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("USPS")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},r.a.createElement("ul",null,r.a.createElement("li",null,t("Ship with the largest delivery network in the United States")),r.a.createElement("li",null,r.a.createElement(rt,{name:t("USPS")})),r.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("USPS")}})))),r.a.createElement("div",{className:"live-rates-carriers-list__actions"},r.a.createElement(at,null)))},wc_services_dhlexpress:function(e){var t=e.translate;return r.a.createElement("div",{className:"live-rates-carriers-list__element element-dhlexpress"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"},r.a.createElement(Ze.a,{carrier:"dhlexpress",size:18})),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("DHL Express")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},r.a.createElement("ul",null,r.a.createElement("li",null,t("Express delivery from the experts in international shipping")),r.a.createElement("li",null,r.a.createElement(rt,{name:t("DHL Express")})),r.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("DHL Express")}})))),r.a.createElement("div",{className:"live-rates-carriers-list__actions"},r.a.createElement(at,null)))}},ct=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return r.a.createElement(V,{className:"live-rates-carriers-list__wrapper"},r.a.createElement("div",{className:"live-rates-carriers-list__heading"},r.a.createElement("div",{className:"live-rates-carriers-list__icon"}),r.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("Carrier")),r.a.createElement("div",{className:"live-rates-carriers-list__features"},t("Features")),r.a.createElement("div",{className:"live-rates-carriers-list__actions"})),n.map(function(e){var n=it[e];return n?r.a.createElement(n,{key:e,translate:t}):null}))}),st=["wc_services_usps","wc_services_dhlexpress"],ot=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return!1===n.some(function(e){return st.includes(e)})?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Live rates at checkout"),description:t("Show live rates directly on your store - never under or overcharge for shipping again")}),r.a.createElement(ct,{carrierIds:n}))}),ut=function(e){var t=e.translate,n=e.data,a=e.errorNotice,i=e.successNotice,c=e.siteId,s=r.a.useState(n.is_active),o=qe()(s,2),u=o[0],l=o[1],d=r.a.useState(!1),m=qe()(d,2),p=m[0],f=m[1],E=[],_=!1;n.usage_data.forEach(function(e,t){E.push(r.a.createElement("div",{key:t},e.label,": ",e.count,"/",e.limit)),_=_||e.count>e.limit});var O=y()("button","is-compact");return r.a.createElement("div",{className:"subscriptions-usage__list-item"},r.a.createElement("div",{className:"subscriptions-usage__list-item-carrier-icon"},r.a.createElement(Ze.a,{carrier:function(e){var t=[[/^DHL/g,"dhlexpress"],[/^UPS/g,"ups"],[/^USPS/g,"usps"]],n=t.findIndex(function(t){return qe()(t,1)[0].test(e)});return n>-1?t[n][1]:""}(n.product_name),size:18})),r.a.createElement("div",{className:"subscriptions-usage__list-item-name"},r.a.createElement("span",null,n.product_name)),r.a.createElement("div",{className:y()("subscriptions-usage__list-item-usage",{"is-over-limit":_})},r.a.createElement("span",{className:"subscriptions-usage__list-item-usage-numbers"},E),r.a.createElement(nt.a,{text:t("Your store is over the limit for rate calls this month and your account will be charged for overages. To prevent future overage charges you can upgrade your plan.")},r.a.createElement("span",{className:"subscriptions-usage__list-item-usage-icon"},r.a.createElement(D.a,{icon:"info-outline",size:18})))),r.a.createElement("div",{className:"subscriptions-usage__list-item-actions"},u?r.a.createElement("a",{href:"https://woocommerce.com/my-account/my-subscriptions/",className:O},t("Manage")):r.a.createElement(S.a,{onClick:function(){!function(){var e=Be()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,Qe.c(c,Qe.e.subscriptionActivate(n.product_key));case 4:l(!0),i(t("Your subscription was succesfully activated.")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a(t("There was an error trying to activate your subscription."));case 11:f(!1);case 12:case"end":return e.stop()}},e,null,[[1,8]])}));return function(){return e.apply(this,arguments)}}()()},disabled:p,isBusy:p,className:O},t("Activate"))))};ut.propTypes={errorNotice:R.a.func.isRequired,successNotice:R.a.func.isRequired,siteId:R.a.number.isRequired,data:R.a.shape({product_name:R.a.string.isRequired,is_active:R.a.bool.isRequired,usage_data:R.a.arrayOf(R.a.shape({limit:R.a.number,count:R.a.number,label:R.a.string}))}).isRequired};var lt={errorNotice:Ye.a,successNotice:Ye.d},dt=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},lt),v.localize)(ut),mt=function(e){var t=e.translate,n=e.subscriptions,a=void 0===n?[]:n;return 0===a.length?null:r.a.createElement("div",null,r.a.createElement(q,{label:t("Shipping method"),description:t("View and manage your subscription usage")}),r.a.createElement(M.a,{size:"small",className:y()("card","subscriptions-usage__list")},r.a.createElement("div",{className:"subscriptions-usage__header"},r.a.createElement("div",{className:"subscriptions-usage__header-icon"}),r.a.createElement("div",{className:"subscriptions-usage__header-name"},t("Name")),r.a.createElement("div",{className:"subscriptions-usage__header-usage"},t("Usage")),r.a.createElement("div",{className:"subscriptions-usage__header-actions"})),a.map(function(e,t){return r.a.createElement(dt,{key:t,data:e})})))};mt.propTypes={subscriptions:R.a.arrayOf(R.a.shape({product_name:R.a.string.isRequired,usage_limit:R.a.number,usage_count:R.a.number}))};var pt=Object(v.localize)(mt),ft=n(603),Et=n(599),_t=n(580),Ot=n(540),bt=n(619),ht=/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,gt=/^\d{5}$/,vt=/^[a-zA-Z0-9]{6}$/,Ct=/^([a-zA-Z0-9]{9}|[a-zA-Z0-9]{13})$/,St=/^\d{10}$/,Nt=/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/,yt=/^(?:(?:(?:https?|ftp):)?\/\/)*(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i,jt=Object(v.localize)(function(e){var t=e.isVisible,n=e.onCancel,i=e.onConfirm,c=e.translate,s=y()("button","is-compact"),o=Object(a.useMemo)(function(){return[r.a.createElement(S.a,{className:s,onClick:n,key:"cancel"},c("Cancel")),r.a.createElement(S.a,{isPrimary:!0,className:y()(s,"is-scary"),onClick:i,key:"ok"},c("Ok"))]},[n,i,c]);return r.a.createElement(Ke.a,{isVisible:t,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:n,buttons:o},r.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},r.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},c("Cancel connection")),r.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:n},r.a.createElement(D.a,{icon:"cross"}))),r.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},c("This action will delete any information entered on the form.")))}),It=Object(g.d)(Object(h.b)(function(e,t){return{stateNames:Object(Ot.k)(e,t.countryValue)}}),v.localize)(function(e){var t=e.onDropdownUpdate,n=e.onTextFieldUpdate,i=e.error,c=e.stateNames,s=e.translate,o=e.value,u=Object(a.useMemo)(function(){return c?K()({"":s("Select one\u2026")},c):c},[c,s]);return u?r.a.createElement(ft.a,{id:"state",name:"state",title:s("State"),value:o,valuesMap:u,updateValue:t,error:i}):r.a.createElement(_t.a,{id:"state",name:"state",title:s("State"),updateValue:n,error:i})}),Rt=function(e){var t=e.translate,n=e.errorNotice,i=e.successNotice,c=e.countryNames,s=e.siteId,o=Object(a.useState)(!1),u=qe()(o,2),l=u[0],d=u[1],m=Object(a.useState)(!1),p=qe()(m,2),f=p[0],E=p[1],_=Object(a.useState)(!1),O=qe()(_,2),h=O[0],g=O[1],v=Object(a.useState)({country:"US"}),C=qe()(v,2),N=C[0],j=C[1],I=function(e,t,n){var a={},r=["account_number","name","street1","city","state","country","postal_code","phone","email","title","website",t&&"invoice_number",t&&"invoice_date"].filter(Boolean),i=!0,c=!1,s=void 0;try{for(var o,u=r[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var l=o.value,d=e[l];(!d||"string"===typeof d&&""===d.trim())&&(a[l]=n("This field is required"))}}catch(m){c=!0,s=m}finally{try{i||null==u.return||u.return()}finally{if(c)throw s}}return e.account_number&&!e.account_number.match(vt)&&(a.account_number=n("The UPS account number needs to be 6 letters and digits in length")),e.phone&&!e.phone.match(St)&&(a.phone=n("The phone number needs to be 10 digits in length")),"US"===e.country&&e.postal_code&&!e.postal_code.match(gt)&&(a.postal_code=n("The ZIP/Postal code needs to be 5 digits in length")),e.email&&!e.email.match(ht)&&(a.email=n("The email format is not valid")),e.website&&!e.website.match(yt)&&(a.website=n("The company website format is not valid")),t&&e.invoice_number&&!e.invoice_number.match(Ct)&&(a.invoice_number=n("The invoice number needs to be 9 or 13 letters and digits in length")),t&&e.invoice_date&&!e.invoice_date.match(Nt)&&(a.invoice_date=n("The date must be a valid date in the format YYYY-MM-DD")),a}(N,f,t),R=function(e){return N[e]?Object(bt.a)(N[e]):""},P=Object(a.useCallback)(function(e,t){var n=t.currentTarget.id;j(function(t){return K()({},t,b()({},n,e))})},[j]),k=Object(a.useCallback)(function(e,t){j(function(n){return K()({},n,b()({},t,e))})},[j]),T=Object(a.useCallback)(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.prev=1,a=K()({},N,{type:"UpsAccount"}),f||(delete a.invoice_number,delete a.invoice_date,delete a.invoice_amount,delete a.invoice_currency,delete a.invoice_control_id),e.next=6,Qe.c(s,Qe.e.shippingCarrier(),a);case 6:if(e.sent.success){e.next=9;break}throw new Error;case 9:i(t("Your carrier account was connected successfully.")),(r=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=r.href,e.next=20;break;case 16:e.prev=16,e.t0=e.catch(1),d(!1),n(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:"UPS"}}));case 20:case"end":return e.stop()}},e,null,[[1,16]])}));return function(){return e.apply(this,arguments)}})()()},[d,n,i,t,N,f]),A=Object(a.useCallback)(function(){E(function(e){return!e})},[E]),L=Object(a.useCallback)(function(){g(!1)},[g]),w=Object(a.useCallback)(function(){var e=new URL(window.location.href);e.searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=e.href},[]),x=Object(a.useCallback)(function(){g(!0)},[g]),D=y()("button","is-compact");return r.a.createElement("div",{className:"carrier-accounts__settings-container"},r.a.createElement("div",{className:"carrier-accounts__settings"},r.a.createElement("div",{className:"carrier-accounts__settings-info"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your UPS account")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:r.a.createElement("a",{href:"https://docs.woocommerce.com/document/productid-type-permalinks/using-your-own-ups-account-in-woocommerce-shipping/"})}})),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.",{components:{a:r.a.createElement("a",{href:"https://ups.com/"})}}))),r.a.createElement("div",{className:"carrier-accounts__settings-form"},r.a.createElement(M.a,{className:y()("card","is-compact")},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General information")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the account number and address from your UPS profile"))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-account-number","card","is-compact")},r.a.createElement(_t.a,{id:"account_number",title:t("Account number"),updateValue:k,error:"string"===typeof N.account_number?I.account_number:void 0})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-address","card","is-compact")},r.a.createElement(_t.a,{id:"name",title:t("Name"),updateValue:k,error:"string"===typeof N.name?I.name:void 0}),r.a.createElement(_t.a,{id:"street1",title:t("Address"),updateValue:k,error:"string"===typeof N.street1?I.street1:void 0}),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"street2",title:t("Address 2 (optional)"),updateValue:k,error:"string"===typeof N.street2?I.street2:void 0}),r.a.createElement(_t.a,{id:"city",title:t("City"),updateValue:k,error:"string"===typeof N.city?I.city:void 0})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(It,{countryValue:N.country,value:R("state"),onDropdownUpdate:P,onTextFieldUpdate:k,error:"string"===typeof N.state?I.state:void 0}),r.a.createElement(ft.a,{id:"country",title:t("Country"),value:R("country"),valuesMap:c,updateValue:P,error:"string"===typeof N.country?I.country:void 0})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"postal_code",title:t("ZIP/Postal code"),updateValue:k,error:"string"===typeof N.postal_code?I.postal_code:void 0}),r.a.createElement(_t.a,{id:"phone",title:t("Phone"),updateValue:k,error:"string"===typeof N.phone?I.phone:void 0})),r.a.createElement(_t.a,{id:"email",title:t("Email"),updateValue:k,error:"string"===typeof N.email?I.email:void 0})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-company-info","card","is-compact")},r.a.createElement("div",{className:"carrier-accounts__settings-header"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("Company information")),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the company info you used to create your UPS account"))),r.a.createElement(_t.a,{id:"company",title:t("Company name"),updateValue:k,error:"string"===typeof N.company?I.company:void 0}),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"title",title:t("Job title"),updateValue:k,error:"string"===typeof N.title?I.title:void 0}),r.a.createElement(_t.a,{id:"website",title:t("Company website"),updateValue:k,error:"string"===typeof N.website?I.website:void 0}))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-ups-info","card","is-compact")},r.a.createElement("div",{className:"carrier-accounts__settings-header"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("UPS account information")),r.a.createElement(Et.a,{id:"enable_ups_invoice_fields",checked:f,onChange:A}),r.a.createElement("span",null,t("I have been issued an invoice from UPS within the past 90 days"))),f&&r.a.createElement("div",{className:"carrier-accounts__settings-ups-invoice"},r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"invoice_number",defaultValue:N.invoice_number,title:t("UPS invoice number"),updateValue:k,error:"string"===typeof N.invoice_number?I.invoice_number:void 0}),r.a.createElement(_t.a,{id:"invoice_date",defaultValue:N.invoice_date,title:t("UPS invoice date"),updateValue:k,error:"string"===typeof N.invoice_date?I.invoice_date:void 0,placeholder:"YYYY-MM-DD"})),r.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},r.a.createElement(_t.a,{id:"invoice_amount",defaultValue:N.invoice_amount,title:t("UPS invoice amount"),updateValue:k,error:"string"===typeof N.invoice_amount?I.invoice_amount:void 0}),r.a.createElement(_t.a,{id:"invoice_currency",defaultValue:N.invoice_currency,title:t("UPS invoice currency"),updateValue:k,error:"string"===typeof N.invoice_currency?I.invoice_currency:void 0})),r.a.createElement(_t.a,{id:"invoice_control_id",defaultValue:N.invoice_control_id,title:t("UPS invoice control id"),updateValue:k,error:"string"===typeof N.invoice_control_id?I.invoice_control_id:void 0}))),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-actions","card","is-compact")},r.a.createElement(S.a,{isPrimary:!0,className:D,onClick:T,disabled:Object.keys(I).length>0||l,isBusy:l},t("Connect")),r.a.createElement(S.a,{className:D,onClick:x},t("Cancel")))),r.a.createElement(jt,{isVisible:h,onConfirm:w,onCancel:L})))};Rt.propTypes={siteId:R.a.number,countryNames:R.a.object,translate:R.a.func,errorNotice:R.a.func,successNotice:R.a.func};var Pt={errorNotice:Ye.a,successNotice:Ye.d},kt=Object(g.d)(Object(h.b)(function(e){return{countryNames:Object(Ot.c)(e),siteId:Object(Te.a)(e)}},Pt),v.localize)(Rt),Mt=function(e){var t=e.visibility,n=e.label,i=e.id,c=e.value,s=e.onChange,o=Object(a.useCallback)(function(){s(i,!c)},[i,c,s]),u=Object(a.useCallback)(function(e){s(i,e)},[i,c,s]);switch(t){case"select":case"checkbox":return r.a.createElement(r.a.Fragment,null,r.a.createElement(Et.a,{id:i,onChange:o,checked:c||!1}),r.a.createElement("label",{htmlFor:i},r.a.createElement("span",null,n)));case"invisible":case"masked":case"readonly":case"password":case"visible":default:return r.a.createElement(_t.a,{id:i,title:n,updateValue:u})}},Tt=function(e){var t=e.translate,n=e.siteId,i=e.carrierType,c=e.errorNotice,s=e.successNotice,o=e.carrierName,u=e.carrierDescription,l=e.registrationFields,d=Object(a.useState)({}),m=qe()(d,2),p=m[0],f=m[1],E=Object(a.useState)(!1),_=qe()(E,2),O=_[0],h=_[1],g=Object(a.useCallback)(function(e,t){f(function(n){return K()({},n,b()({},e,t))})},[f]),v=Object(a.useCallback)(function(){(function(){var e=Be()(regeneratorRuntime.mark(function e(){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,Qe.c(n,Qe.e.shippingCarrier(),K()({},p,{type:i}));case 4:if(e.sent.success){e.next=7;break}throw new Error;case 7:s(t("Your carrier account was connected successfully.")),(a=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=a.href,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),c(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:o}}));case 17:h(!1);case 18:case"end":return e.stop()}},e,null,[[1,14]])}));return function(){return e.apply(this,arguments)}})()()},[O,h,n,i,o,p,c,t]),C=Object(a.useCallback)(function(){history.back()},[]),N=y()("button","is-compact");return r.a.createElement("div",{className:"carrier-accounts__settings-container"},r.a.createElement("div",{className:"carrier-accounts__settings"},r.a.createElement("div",{className:"carrier-accounts__settings-info"},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your %(carrierName)s account",{args:{carrierName:o}})),r.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},u||t("Set up your own carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:r.a.createElement("a",{href:"https://docs.woocommerce.com/document/using-your-own-carrier-account-in-woocommerce-shipping"})}}))),r.a.createElement("div",{className:"carrier-accounts__settings-form"},r.a.createElement(M.a,{className:y()("card","is-compact")},r.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General Information"))),r.a.createElement(M.a,{className:y()("card","is-compact")},l&&Object.entries(l).map(function(e){var t=qe()(e,2),n=t[0],a=t[1];return r.a.createElement(Mt,{key:n,id:n,visibility:a.visibility,label:a.label,value:p[n],onChange:g})})),r.a.createElement(M.a,{className:y()("carrier-accounts__settings-actions","card","is-compact")},r.a.createElement(S.a,{isPrimary:!0,className:N,onClick:v,disabled:O},t("Connect")),r.a.createElement(S.a,{isSecondary:!0,className:N,onClick:C},t("Cancel"))))))},At={errorNotice:Ye.a,successNotice:Ye.d};Tt.propTypes={errorNotice:R.a.func,successNotice:R.a.func,carrierType:R.a.string,carrierName:R.a.string,carrierDescription:R.a.string,registrationFields:R.a.object,siteId:R.a.number,translate:R.a.func};var Lt=Object(g.d)(Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}},At),v.localize)(Tt),wt=function(e){var t=e.translate,n=Object(a.useState)([]),i=qe()(n,2),c=i[0],s=i[1];if(Object(a.useEffect)(function(){(function(){var t=Be()(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qe.b(e.siteId,Qe.e.shippingCarrierTypes());case 2:n=t.sent,s(n.carriers);case 4:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}})()()},[e.siteId,s]),!c||0===c.length)return r.a.createElement("div",null,t("Loading"),"...");var o=c.filter(function(t){return t.type===e.carrier}),u=qe()(o,1)[0];return u?r.a.createElement("div",null,r.a.createElement(Lt,{carrierType:u.type,carrierName:u.name,carrierDescription:u.description,registrationFields:u.fields})):r.a.createElement("div",null,t("%(carrierName)s not supported.",{args:{carrierName:e.carrier}}))};wt.propTypes={carrier:R.a.string.isRequired,siteId:R.a.number};var xt=Object(h.b)(function(e){return{siteId:Object(Te.a)(e)}})(Object(v.localize)(wt)),Dt=n(676),Wt=n(650),Ut=function(e){function t(e){var n;return c()(this,t),n=l()(this,m()(t).call(this,e)),b()(f()(n),"onChange",function(){n.setState({pristine:!1})}),b()(f()(n),"onSaveSuccess",function(){var e=n.props,t=e.translate,a=e.orderId,r=e.orderHref,i=e.paymentMethodSelected,c=r&&i?{button:t("Return to Order #%(orderId)s",{args:{orderId:a}}),href:r}:{duration:5e3};return n.setState({pristine:!0}),n.props.successNotice(t("Your shipping settings have been saved."),c)}),b()(f()(n),"onSaveFailure",function(){var e=n.props.translate;return n.props.errorNotice(e("Unable to save your shipping settings. Please try again."))}),b()(f()(n),"onSaveChanges",function(){n.props.createWcsShippingSaveActionList(n.onSaveSuccess,n.onSaveFailure)}),n.state={pristine:!0},n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.carrier,n=e.carrierAccounts,a=e.liveRatesTypes,i=e.subscriptions,c=e.isSaving,s=e.translate;return t?"UpsAccount"===t?r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(kt,null)):r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(xt,{carrier:t})):r.a.createElement("div",null,r.a.createElement(j.a,{id:"notices",notices:we.a.list}),r.a.createElement(Le,{onChange:this.onChange}),r.a.createElement(He,{onChange:this.onChange}),r.a.createElement(ot,{carrierIds:a}),r.a.createElement(tt,{accounts:n}),r.a.createElement(pt,{subscriptions:i}),r.a.createElement(S.a,{isPrimary:!0,className:y()("button"),onClick:this.onSaveChanges,isBusy:c,disabled:c},s("Save changes")),r.a.createElement(Dt.a,{isChanged:!this.state.pristine}))}}]),t}(a.Component),Vt=Object(h.b)(function(e){var t=Object(je.g)(e),n=Object(Ve.e)(e);return{isSaving:t.isSaving||n.isSaving,paymentMethodSelected:Boolean(Object(je.n)(e))}},function(e){return Object(g.b)({createWcsShippingSaveActionList:Wt.a,errorNotice:Ye.a,successNotice:Ye.d},e)})(Object(v.localize)(Ut)),Gt=n(657),Ht=n(656),Ft=n(591),Bt=n(662),zt=n(636),qt=n(663),Zt=n(611),Kt=n(116),Qt=n(46);t.default=function(e){var t=e.order_id,n=e.order_href,a=e.carrier,i=e.continents,c=e.carrier_accounts,s=e.live_rates_types,o=e.subscriptions;return{getReducer:function(){return Object(Qt.a)({extensions:Object(Qt.a)({woocommerce:Object(Qt.a)({woocommerceServices:Object(Qt.a)({1:Object(Qt.a)({packages:Ht.a,labelSettings:Gt.a})}),sites:Object(Qt.a)({1:Object(Qt.a)({data:Object(Qt.a)({locations:qt.a})})})})}),notices:Ft.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{data:{locations:i}}}}}}},getStateForPersisting:function(e){return delete e.notices,e},getStateKey:function(){return"wcs-account-settings"},getMiddlewares:function(){return[Object(Kt.b)(Object(Zt.a)(zt.a,Bt.a))]},View:function(){return r.a.createElement(Vt,{orderId:t,orderHref:n,carrier:a,carrierAccounts:c,liveRatesTypes:s,subscriptions:o})}}}}}]);
|
|
dist/chunks/{8dd9441fc50c76b0b0a8.css → 5a5c55a7c9bccfa8425c.css}
RENAMED
File without changes
|
dist/chunks/{8dd9441fc50c76b0b0a8.min.js → 5a5c55a7c9bccfa8425c.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{546:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var a=n(1),r=n(624),i=n.n(r),s=(n(113),function(e){return e}),o=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return n.join()},c=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return e.map(function(e){return e.apply(void 0,[t].concat(a))})}};function l(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,l=Object(a.memoize)(e,r);return Array.isArray(n)&&(n=c(n)),Object.assign(function(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];var o=n.apply(void 0,[e].concat(r));return Array.isArray(o)||(o=[o]),t&&!i()(o,t)&&l.cache.clear(),t=o,l.apply(void 0,[e].concat(r))},{memoizedSelector:l})}},548:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("fieldset",r()({},a,{className:u()(t,"form-fieldset")}),n)}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"a",function(){return m}),n.d(t,"b",function(){return p});var a=n(535),r=n.n(a),i=n(1),s={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},o=(n(46),s.uniqueId);function c(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.id,i=r()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:a||o(),status:e,text:t})}}var u=l.bind(null,"is-success"),m=l.bind(null,"is-error"),p=l.bind(null,"is-info");l.bind(null,"is-warning"),l.bind(null,"is-plain")},551:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(10),c=n.n(o),l=n(12),u=n.n(l),m=n(528),p=n.n(m),d=n(34),f=function(e){var t=e.children,n=e.required,a=e.optional,i=e.translate,o=e.className,l=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),u=s()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),m=l?null:c.a.createElement(c.a.Fragment,null,t,n&&c.a.createElement("small",{className:"form-label__required"},i("Required")),a&&c.a.createElement("small",{className:"form-label__optional"},i("Optional")));return c.a.createElement("label",r()({},u,{dangerouslySetInnerHTML:l,className:p()(o,"form-label")}),m)};f.propTypes={required:u.a.bool,optional:u.a.bool,children:u.a.node},t.a=Object(d.localize)(f)},553:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("legend",r()({},a,{className:u()(t,"form-legend")}),n)}},554:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("h3",r()({},a,{className:u()(t,"form-section-heading")}),n)}},555:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),s=n.n(i),o=n(530),c=n.n(o),l=n(529),u=n.n(l),m=n(534),p=n.n(m),d=n(531),f=n.n(d),h=n(35),g=n.n(h),v=n(12),b=n.n(v),E=n(10),y=n.n(E),N=n(528),_=n.n(N),T=n(1),O=n(34),w=n(537),k=n.n(w);n(568);function C(e){var t=e.children;return y.a.createElement("span",{className:"screen-reader-text"},t)}var x=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=c()(this,(e=u()(t)).call.apply(e,[this].concat(i))),g()(p()(n),"dismissTimeout",null),n}return f()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.icon,r=e.isCompact,i=e.isLoading,s=e.onDismissClick,o=e.showDismiss,c=void 0===o?!r:o,l=e.status,u=e.text,m=e.translate,p=_()("notice",l,n,{"is-compact":r,"is-loading":i,"is-dismissable":c});return y.a.createElement("div",{className:p},y.a.createElement("span",{className:"notice__icon-wrapper"},y.a.createElement(k.a,{className:"notice__icon",icon:a||this.getIcon(),size:24})),y.a.createElement("span",{className:"notice__content"},y.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,c&&y.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:s},y.a.createElement(k.a,{icon:"cross",size:24}),y.a.createElement(C,null,m("Dismiss"))))}}]),t}(E.Component);g()(x,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:T.noop,status:null,text:null}),g()(x,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired});t.a=Object(O.localize)(x)},557:function(e,t,n){"use strict";n.d(t,"a",function(){return O});var a=n(533),r=n.n(a),i=n(107),s=n.n(i),o=n(108),c=n.n(o),l=n(530),u=n.n(l),m=n(529),p=n.n(m),d=n(531),f=n.n(d),h=n(35),g=n.n(h),v=n(10),b=n.n(v),E=n(12),y=n.n(E),N=n(528),_=n.n(N),T=n(1),O=function(e){function t(){return s()(this,t),u()(this,p()(t).apply(this,arguments))}return f()(t,e),c()(t,[{key:"render",value:function(){var e=_()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",r()({},Object(T.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);g()(O,"displayName","FormSettingExplanation"),g()(O,"propTypes",{noValidate:y.a.bool,isIndented:y.a.bool,className:y.a.string}),g()(O,"defaultProps",{noValidate:!1,isIndented:!1})},564:function(e,t,n){"use strict";var a=n(47),r=n.n(a),i=n(1),s=n(114),o=r()("calypso:notices");o("initializing notices");var c,l={containerNames:{}};c=l,Object(i.assign)(c,s.EventEmitter.prototype),c.emitChange=function(){this.emit("change")},c.off=c.removeListener;var u=[],m={new:function(e,t,n){var a=t.overlay?"overlay-notices":"notices";l.containerNames[a]=a,o("creating notice",e,t,n),l[a]=[];var r={type:t.type||"message",status:n,text:e,duration:t.duration,container:a,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=m.removeNotice.bind(m,r);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?u.push(r):l[a].push(r),l.emit("change"),r},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:l,removeNotice:function(e){if(e.container){var t=l[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),l.emit("change"))}},clearNoticesOnNavigation:function(e,t){o("clearNoticesOnNavigation");var n=!1,a=function(e){return e.persistent};for(var r in l.containerNames){var i=l[r].length;l[r]=l[r].filter(a),i!==l[r].length&&(n=!0)}u.length&&(u.forEach(function(e){l[e.container]=[],l[e.container].push(e)}),u=[]),n&&l.emit("change"),t()},clearNotices:function(e){l[e]=[],l.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=m},568:function(e,t,n){},582:function(e,t,n){"use strict";n.d(t,"a",function(){return w});var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(107),c=n.n(o),l=n(108),u=n.n(l),m=n(530),p=n.n(m),d=n(529),f=n.n(d),h=n(531),g=n.n(h),v=n(35),b=n.n(v),E=n(10),y=n.n(E),N=n(12),_=n.n(N),T=n(528),O=n.n(T),w=function(e){function t(){return c()(this,t),p()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=O()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,s()(t,["compact","primary","scary","busy","borderless","type"])),a=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return y.a.createElement("a",r()({},n,{rel:a,className:e}))}var i=this.props,o=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,s()(i,["compact","primary","scary","busy","borderless","target","rel"]));return y.a.createElement("button",r()({},o,{className:e}))}}]),t}(E.PureComponent);b()(w,"propTypes",{compact:_.a.bool,primary:_.a.bool,scary:_.a.bool,busy:_.a.bool,type:_.a.string,href:_.a.string,borderless:_.a.bool,target:_.a.string,rel:_.a.string}),b()(w,"defaultProps",{type:"button"})},588:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var a=n(107),r=n.n(a),i=n(108),s=n.n(i),o=n(530),c=n.n(o),l=n(529),u=n.n(l),m=n(531),p=n.n(m),d=n(35),f=n.n(d),h=n(12),g=n.n(h),v=n(10),b=n.n(v),E=n(537),y=n.n(E),N=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return p()(t,e),s()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(y.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(y.a,{icon:"external",size:24}))}}]),t}(b.a.Component);f()(N,"displayName","NoticeAction"),f()(N,"propTypes",{href:g.a.string,onClick:g.a.func,external:g.a.bool,icon:g.a.string}),f()(N,"defaultProps",{external:!1})},590:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),s=n.n(i),o=n(528),c=n.n(o),l=n(835),u=n(554),m=function(e){var t=e.heading,n=e.children;return r.a.createElement(l.a,{className:c()("settings-group-card","card","is-compact")},t&&r.a.createElement(u.a,{className:"settings-group-card__heading"},t),r.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},n))};m.propTypes={heading:s.a.node},t.a=m},591:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),s=n(36),o=n.n(s),c=n(1),l=n(46),u=Object(l.b)({},(a={},i()(a,"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,n))}),i()(a,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(c.omit)(e,n):e}),i()(a,"ROUTE_SET",function(e){return Object(c.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var a=t;return a.displayOnNextPage&&(a=o()({},a,{displayOnNextPage:!1})),e[n]=a,e},{})}),a)),m=Object(l.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(l.a)({items:u,lastTimeShown:m})},593:function(e,t,n){},594:function(e,t,n){"use strict";var a=n(644),r=["a","strong","em","u","tt","s"],i=["target","href"];t.a=function(e){return{__html:Object(a.sanitize)(e,{ALLOWED_TAGS:r,ALLOWED_ATTR:i})}}},605:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(535),s=n.n(i),o=n(165),c=n.n(o),l=n(12),u=n.n(l),m=n(10),p=n.n(m),d=n(555),f=n(588),h=n(528),g=n.n(h);n(593);function v(e){var t=e.id,n=e.className,a=e.children;return p.a.createElement("div",{id:t,className:g()("global-notices",n)},a)}var b=n(564),E=n(47),y=n.n(E)()("calypso:data-observe"),N=n(109),_=n(1),T=n(546),O=Object(T.a)(function(e){return Object(_.values)(e.notices.items)},function(e){return e.notices.items}),w=(Object(T.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(550)),k=c()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):y(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){y("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:u.a.string,notices:u.a.oneOfType([u.a.object,u.a.array]),removeNotice:u.a.func.isRequired,storeNotices:u.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&b.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(a){t&&t(a),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return p.a.createElement(d.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&p.a.createElement(f.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,a=e.noticeId,i=e.onClick,o=e.onDismissClick,c=s()(e,["button","href","noticeId","onClick","onDismissClick"]);return p.a.createElement(d.a,r()({},c,{key:"notice-".concat(a),onDismissClick:this.removeReduxNotice(a,o)}),t&&p.a.createElement(f.a,{href:n,onClick:i},t))},this))).length?p.a.createElement(v,{id:this.props.id},e):null}});t.a=Object(N.b)(function(e){return{storeNotices:O(e)}},{removeNotice:w.c})(k)},627:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),s=n.n(i),o=n(557),c=n(594),l=function(e){var t=e.text;return t?r.a.createElement(o.a,{dangerouslySetInnerHTML:Object(c.a)(t)}):null};l.propTypes={text:s.a.string},t.a=l},687:function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return p});var a={};n.r(a),n.d(a,"labelsPrint",function(){return s}),n.d(a,"labelTestPrint",function(){return o}),n.d(a,"selfHelp",function(){return c}),n.d(a,"refreshServiceData",function(){return l});var r=n(76),i="wc/v1/connect/",s=function(){return"".concat(i,"label/print")},o=function(){return"".concat(i,"label/preview")},c=function(){return"".concat(i,"self-help")},l=function(){return"".concat(i,"service-data-refresh")},u=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},m=function(e,t){return Object(r.a)().post(e,t).catch(u)},p=function(e,t){return Object(r.a)().createGetUrlWithNonce(e,t)}},793:function(e,t,n){},795:function(e,t,n){},832:function(e,t,n){"use strict";n.r(t);var a,r=n(10),i=n.n(r),s=(n(793),n(35)),o=n.n(s),c=n(36),l=n.n(c),u=(a={},o()(a,"PLUGIN_STATUS_DEBUG_TOGGLE",function(e,t){var n=t.value;return l()({},e,{debug_enabled:n})}),o()(a,"PLUGIN_STATUS_LOGGING_TOGGLE",function(e,t){var n=t.value;return l()({},e,{logging_enabled:n})}),o()(a,"SERVICE_DATA_REFRESH",function(e,t){var n=t.value;return l()({},e,{health_items:l()({},e.health_items,{woocommerce_services:l()({},e.health_items.woocommerce_services,n)})})}),a),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e},p=n(109),d=n(34),f=n(548),h=n(553),g=n(605),v=n(12),b=n.n(v),E=n(537),y=n.n(E),N=n(528),_=n.n(N),T=function(e){var t,n,a=e.title,r=e.subtitle,s=e.state,o=e.message,c=e.children;switch(s){case"fetching":n="is-fetching",t="sync";break;case"success":n="is-success",t="checkmark-circle";break;case"warning":n="is-warning",t="notice";break;case"error":default:n="is-error",t="notice"}return i.a.createElement(f.a,null,i.a.createElement(h.a,null,i.a.createElement("span",null,a),r&&i.a.createElement("span",{className:"plugin-status__indicator-subtitle"},r)),i.a.createElement("div",{className:_()("plugin-status__indicator",n)},i.a.createElement("div",{className:"plugin-status__indicator-icon-and-message"},i.a.createElement("div",{className:"plugin-status__indicator-icon"},i.a.createElement(y.a,{icon:t})),i.a.createElement("div",{className:"plugin-status__indicator-message"},o)),c))};T.propTypes={title:b.a.string,subtitle:b.a.string,state:b.a.string,message:b.a.string,children:b.a.node};var O=T,w=n(77),k=n.n(w),C=n(557),x=n(535),j=n.n(x),S=n(1),D=n.n(S),L=n(687),A=n(550),I=function(){return function(e,t){var n=t().status,a={wcc_debug_on:n.debug_enabled,wcc_logging_on:n.logging_enabled};L.b(L.c.selfHelp(),a).then(function(){return e(Object(A.d)(Object(d.translate)("Your changes have been saved."),{duration:5e3}))}).catch(function(t){D.a.isString(t)&&e(Object(A.a)(t)),D.a.isObject(t)&&e(Object(A.a)(Object(d.translate)("There was a problem when saving your preferences. Please try again.")))})}},R={onRefreshClick:function(){return function(e){return L.b(L.c.refreshServiceData()).then(function(t){t.success;var n=j()(t,["success"]);e({type:"SERVICE_DATA_REFRESH",value:n}),e(Object(A.d)(Object(d.translate)("Service data refreshed.")))}).catch(function(){e(Object(A.a)(Object(d.translate)("An error occurred while refreshing service data.")))})}}},G=Object(p.b)(function(e){return{status:e.status.health_items.woocommerce_services}},R)(Object(d.localize)(function(e){var t,n,a=e.translate,s=e.moment,o=e.status,c=e.onRefreshClick,l=Object(r.useState)(!1),u=k()(l,2),m=u[0],p=u[1],d=Object(r.useCallback)(function(e){e.preventDefault(),p(!0),c().finally(function(){return p(!1)})},[c,p]),f=Date.now()/1e3;return o.has_service_schemas?o.timestamp?o.timestamp<f-o.error_threshold?(t="error",n=a("Service data was found, but is more than three days old")):o.timestamp<f-o.warning_threshold?(t="warning",n=a("Service data was found, but is more than one day old")):(t="success",n=a("Service data is up-to-date")):(t="warning",n=a("Service data found, but may be out of date")):(t="error",n=a("No service data available")),m&&(t="fetching"),i.a.createElement(O,{title:a("WooCommerce Shipping & Tax Data"),state:t,message:n},i.a.createElement(C.a,null,o.timestamp&&o.has_service_schemas?a("Last updated %s.",{args:s(1e3*o.timestamp).fromNow()}):null," ",i.a.createElement("a",{onClick:d,href:"#"},a("Refresh"))))})),P=n(590),U=Object(p.b)(function(e){return{healthItems:e.status.health_items}})(Object(d.localize)(function(e){var t=e.translate,n=e.healthItems;return i.a.createElement(P.a,{heading:t("Health",{context:"This section displays the overall health of WooCommerce Shipping & Tax and the things it depends on"})},i.a.createElement(O,{title:t("WooCommerce"),message:n.woocommerce.message,state:n.woocommerce.state}),i.a.createElement(O,{title:t("Jetpack"),state:n.jetpack.state,message:n.jetpack.message}),i.a.createElement(G,null))})),z=n(107),q=n.n(z),H=n(108),V=n.n(H),W=n(530),M=n.n(W),F=n(529),K=n.n(F),B=n(534),J=n.n(B),Y=n(531),Q=n.n(Y),X=n(533),Z=n.n(X),$=n(78),ee=n.n($),te=n(794),ne=n.n(te),ae=n(582);function re(e){var t=e.className,n=e.text,a=e.onCopy,r=void 0===a?S.noop:a,s=j()(e,["className","text","onCopy"]),o=i.a.useRef(),c=i.a.useRef(),l=i.a.useRef();return i.a.useEffect(function(){c.current=function(){return n},l.current=r},[n,r]),i.a.useEffect(function(){var e=ee.a.findDOMNode(o.current),t=new ne.a(e,{text:function(){return c.current()}});return t.on("success",function(){return l.current()}),function(){return t.destroy()}},[]),i.a.createElement(ae.a,Z()({},s,{ref:o,className:_()("clipboard-button",t)}))}re.propTypes={className:b.a.string,text:b.a.string,onCopy:b.a.func};var ie=re,se=n(551),oe=function(e){var t=e.className,n=e.isError,a=e.isValid,r=e.children,s=j()(e,["className","isError","isValid","children"]);return i.a.createElement("textarea",Z()({},s,{className:_()(t,"form-textarea",{"is-error":n,"is-valid":a})}),r)},ce=n(564),le=function(e){function t(){var e,n;q()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=M()(this,(e=K()(t)).call.apply(e,[this].concat(r))),o()(J()(n),"onCopy",function(){var e=n.props.translate;ce.a.success(e("Log tail copied to clipboard"),{duration:2e3})}),n}return Q()(t,e),V()(t,[{key:"render",value:function(){var e=this.props,t=e.key,n=e.title,a=e.tail,r=e.url,s=e.count,o=e.translate,c="wcs-log-".concat(t);return i.a.createElement(f.a,null,i.a.createElement(se.a,{htmlFor:c},n),i.a.createElement(oe,{id:c,name:c,readOnly:!0,value:a}),i.a.createElement(C.a,{className:"plugin-status__log-explanation"},i.a.createElement("span",{className:"plugin-status__log-explanation-span"},o("Last %s entry. {{a}}Show full log{{/a}}","Last %s entries. {{a}}Show full log{{/a}}",{args:[s],count:s,components:{a:i.a.createElement("a",{href:r})}})),i.a.createElement(ie,{text:a,onCopy:this.onCopy,compact:!0},o("Copy for support"))))}}]),t}(r.Component);le.propTypes={title:b.a.string,logKey:b.a.string};var ue=Object(p.b)(function(e,t){var n=t.logKey;return e.status.logs[n]})(Object(d.localize)(le)),me=Object(p.b)(function(e){return{services:e.status.services}})(Object(d.localize)(function(e){var t=e.translate,n=e.moment,a=e.services;if(!1===a)return null;var r=function(e,a){return i.a.createElement(O,{key:a,title:e.title,subtitle:e.subtitle,state:e.state,message:e.message},function(e){var a=e.timestamp,r=e.url;return a>0?i.a.createElement(C.a,null,t("Request was made %s - check logs below or {{a}}edit service settings{{/a}}",{args:n(1e3*a).fromNow(),components:{a:i.a.createElement("a",{href:r})}})):i.a.createElement(C.a,null,i.a.createElement("a",{href:r},t("Edit service settings")))}(e))};return i.a.createElement(P.a,{heading:t("Services")},a.length?a.map(r):i.a.createElement(C.a,null,t("No services configured. {{a}}Add a shipping service{{/a}}",{components:{a:i.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping"})}})))})),pe=n(796),de=(n(795),n(627)),fe=n(644),he=function(e){return{__html:Object(fe.sanitize)(e,{ALLOWED_TAGS:["a","strong","em","u","tt","s"],ALLOWED_ATTR:["target","href"]})}},ge=function(e){function t(){var e,n;q()(this,t);for(var a=arguments.length,r=new Array(a),s=0;s<a;s++)r[s]=arguments[s];return n=M()(this,(e=K()(t)).call.apply(e,[this].concat(r))),o()(J()(n),"renderToggleText",function(e){return e?i.a.createElement("span",{className:"toggle__text",dangerouslySetInnerHTML:he(e)}):null}),o()(J()(n),"handleChangeEvent",function(){var e=n.props;(0,e.onUpdate)(!e.checked)}),n}return Q()(t,e),V()(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,a=e.description,r=e.trueText,s=e.falseText,o=e.checked,c=e.placeholder,l=e.className;return i.a.createElement(f.a,{className:l},i.a.createElement(se.a,{htmlFor:t,dangerouslySetInnerHTML:he(n)}),i.a.createElement(pe.a,{id:t,name:t,placeholder:c,checked:o,onChange:this.handleChangeEvent}),this.renderToggleText(o?r:s),i.a.createElement(de.a,{text:a}))}}]),t}(r.Component);o()(ge,"propTypes",{id:b.a.string.isRequired,title:b.a.string,description:b.a.string,trueText:b.a.string.isRequired,falseText:b.a.string.isRequired,checked:b.a.bool,onUpdate:b.a.func,className:b.a.string}),o()(ge,"defaultProps",{checked:!1});var ve=ge,be={onLoggingToggle:function(e){return function(t){t({type:"PLUGIN_STATUS_LOGGING_TOGGLE",value:e}),t(I())}},onDebuggingToggle:function(e){return function(t){t({type:"PLUGIN_STATUS_DEBUG_TOGGLE",value:e}),t(I())}}},Ee=Object(p.b)(function(e){return{isLoggingEnabled:Boolean(e.status.logging_enabled),isDebuggingEnabled:Boolean(e.status.debug_enabled)}},be)(Object(d.localize)(function(e){var t=e.onLoggingToggle,n=e.onDebuggingToggle,a=e.isLoggingEnabled,r=e.isDebuggingEnabled,s=e.translate;return i.a.createElement("div",null,i.a.createElement(g.a,{id:"notices",notices:ce.a.list}),i.a.createElement(U,null),i.a.createElement(me,null),i.a.createElement(P.a,{heading:s("Debug")},i.a.createElement(ve,{id:"wcs-toggle-debug",checked:r,title:s("Debug"),description:s("Display troubleshooting information on the Cart and Checkout pages."),trueText:s("Enabled"),falseText:s("Disabled"),onUpdate:n}),i.a.createElement(ve,{id:"wcs-toggle-logging",checked:a,title:s("Logging"),description:s("Write diagnostic messages to log files. Helpful when contacting support."),trueText:s("Enabled"),falseText:s("Disabled"),onUpdate:t}),i.a.createElement(ue,{logKey:"shipping",title:s("Shipping Log")}),i.a.createElement(ue,{logKey:"taxes",title:s("Taxes Log")}),i.a.createElement(ue,{logKey:"other",title:s("Other Log")})),i.a.createElement(P.a,{heading:s("Support")},i.a.createElement(f.a,null,i.a.createElement(h.a,null,s("Need help?")),i.a.createElement("p",{className:"plugin-status__help-description"},s("Our team is here for you. View our {{docsA}}support docs{{/docsA}} or {{ticketA}}open a support ticket{{/ticketA}}.",{components:{docsA:i.a.createElement("a",{href:"https://docs.woocommerce.com/document/woocommerce-shipping-and-tax/",target:"_blank",rel:"noopener noreferrer"}),ticketA:i.a.createElement("a",{href:"https://woocommerce.com/my-account/create-a-ticket/",target:"_blank",rel:"noopener noreferrer"})}})))))})),ye=n(591),Ne=n(46);t.default=function(e){var t=e.formData;return{getReducer:function(){return Object(Ne.a)({status:m,notices:ye.a})},getInitialState:function(){return{status:t}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-admin-status"},View:function(){return i.a.createElement(Ee,null)}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{546:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var a=n(1),r=n(625),i=n.n(r),s=(n(113),function(e){return e}),o=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return n.join()},c=function(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return e.map(function(e){return e.apply(void 0,[t].concat(a))})}};function l(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,l=Object(a.memoize)(e,r);return Array.isArray(n)&&(n=c(n)),Object.assign(function(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];var o=n.apply(void 0,[e].concat(r));return Array.isArray(o)||(o=[o]),t&&!i()(o,t)&&l.cache.clear(),t=o,l.apply(void 0,[e].concat(r))},{memoizedSelector:l})}},548:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("fieldset",r()({},a,{className:u()(t,"form-fieldset")}),n)}},550:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"a",function(){return m}),n.d(t,"b",function(){return p});var a=n(536),r=n.n(a),i=n(1),s={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},o=(n(46),s.uniqueId);function c(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.id,i=r()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:a||o(),status:e,text:t})}}var u=l.bind(null,"is-success"),m=l.bind(null,"is-error"),p=l.bind(null,"is-info");l.bind(null,"is-warning"),l.bind(null,"is-plain")},551:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(10),c=n.n(o),l=n(12),u=n.n(l),m=n(528),p=n.n(m),d=n(34),f=function(e){var t=e.children,n=e.required,a=e.optional,i=e.translate,o=e.className,l=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),u=s()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),m=l?null:c.a.createElement(c.a.Fragment,null,t,n&&c.a.createElement("small",{className:"form-label__required"},i("Required")),a&&c.a.createElement("small",{className:"form-label__optional"},i("Optional")));return c.a.createElement("label",r()({},u,{dangerouslySetInnerHTML:l,className:p()(o,"form-label")}),m)};f.propTypes={required:u.a.bool,optional:u.a.bool,children:u.a.node},t.a=Object(d.localize)(f)},554:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("legend",r()({},a,{className:u()(t,"form-legend")}),n)}},555:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(10),c=n.n(o),l=n(528),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,a=s()(e,["className","children"]);return c.a.createElement("h3",r()({},a,{className:u()(t,"form-section-heading")}),n)}},556:function(e,t,n){"use strict";var a=n(107),r=n.n(a),i=n(108),s=n.n(i),o=n(530),c=n.n(o),l=n(529),u=n.n(l),m=n(534),p=n.n(m),d=n(531),f=n.n(d),h=n(35),g=n.n(h),v=n(12),b=n.n(v),E=n(10),y=n.n(E),N=n(528),_=n.n(N),T=n(1),O=n(34),w=n(537),k=n.n(w);n(568);function C(e){var t=e.children;return y.a.createElement("span",{className:"screen-reader-text"},t)}var x=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=c()(this,(e=u()(t)).call.apply(e,[this].concat(i))),g()(p()(n),"dismissTimeout",null),n}return f()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,a=e.icon,r=e.isCompact,i=e.isLoading,s=e.onDismissClick,o=e.showDismiss,c=void 0===o?!r:o,l=e.status,u=e.text,m=e.translate,p=_()("notice",l,n,{"is-compact":r,"is-loading":i,"is-dismissable":c});return y.a.createElement("div",{className:p},y.a.createElement("span",{className:"notice__icon-wrapper"},y.a.createElement(k.a,{className:"notice__icon",icon:a||this.getIcon(),size:24})),y.a.createElement("span",{className:"notice__content"},y.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,c&&y.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:s},y.a.createElement(k.a,{icon:"cross",size:24}),y.a.createElement(C,null,m("Dismiss"))))}}]),t}(E.Component);g()(x,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:T.noop,status:null,text:null}),g()(x,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired});t.a=Object(O.localize)(x)},557:function(e,t,n){"use strict";n.d(t,"a",function(){return O});var a=n(533),r=n.n(a),i=n(107),s=n.n(i),o=n(108),c=n.n(o),l=n(530),u=n.n(l),m=n(529),p=n.n(m),d=n(531),f=n.n(d),h=n(35),g=n.n(h),v=n(10),b=n.n(v),E=n(12),y=n.n(E),N=n(528),_=n.n(N),T=n(1),O=function(e){function t(){return s()(this,t),u()(this,p()(t).apply(this,arguments))}return f()(t,e),c()(t,[{key:"render",value:function(){var e=_()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",r()({},Object(T.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);g()(O,"displayName","FormSettingExplanation"),g()(O,"propTypes",{noValidate:y.a.bool,isIndented:y.a.bool,className:y.a.string}),g()(O,"defaultProps",{noValidate:!1,isIndented:!1})},564:function(e,t,n){"use strict";var a=n(47),r=n.n(a),i=n(1),s=n(114),o=r()("calypso:notices");o("initializing notices");var c,l={containerNames:{}};c=l,Object(i.assign)(c,s.EventEmitter.prototype),c.emitChange=function(){this.emit("change")},c.off=c.removeListener;var u=[],m={new:function(e,t,n){var a=t.overlay?"overlay-notices":"notices";l.containerNames[a]=a,o("creating notice",e,t,n),l[a]=[];var r={type:t.type||"message",status:n,text:e,duration:t.duration,container:a,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=m.removeNotice.bind(m,r);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?u.push(r):l[a].push(r),l.emit("change"),r},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:l,removeNotice:function(e){if(e.container){var t=l[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),l.emit("change"))}},clearNoticesOnNavigation:function(e,t){o("clearNoticesOnNavigation");var n=!1,a=function(e){return e.persistent};for(var r in l.containerNames){var i=l[r].length;l[r]=l[r].filter(a),i!==l[r].length&&(n=!0)}u.length&&(u.forEach(function(e){l[e.container]=[],l[e.container].push(e)}),u=[]),n&&l.emit("change"),t()},clearNotices:function(e){l[e]=[],l.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=m},568:function(e,t,n){},582:function(e,t,n){"use strict";n.d(t,"a",function(){return w});var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(107),c=n.n(o),l=n(108),u=n.n(l),m=n(530),p=n.n(m),d=n(529),f=n.n(d),h=n(531),g=n.n(h),v=n(35),b=n.n(v),E=n(10),y=n.n(E),N=n(12),_=n.n(N),T=n(528),O=n.n(T),w=function(e){function t(){return c()(this,t),p()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=O()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,s()(t,["compact","primary","scary","busy","borderless","type"])),a=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return y.a.createElement("a",r()({},n,{rel:a,className:e}))}var i=this.props,o=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,s()(i,["compact","primary","scary","busy","borderless","target","rel"]));return y.a.createElement("button",r()({},o,{className:e}))}}]),t}(E.PureComponent);b()(w,"propTypes",{compact:_.a.bool,primary:_.a.bool,scary:_.a.bool,busy:_.a.bool,type:_.a.string,href:_.a.string,borderless:_.a.bool,target:_.a.string,rel:_.a.string}),b()(w,"defaultProps",{type:"button"})},588:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var a=n(107),r=n.n(a),i=n(108),s=n.n(i),o=n(530),c=n.n(o),l=n(529),u=n.n(l),m=n(531),p=n.n(m),d=n(35),f=n.n(d),h=n(12),g=n.n(h),v=n(10),b=n.n(v),E=n(537),y=n.n(E),N=function(e){function t(){return r()(this,t),c()(this,u()(t).apply(this,arguments))}return p()(t,e),s()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(y.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(y.a,{icon:"external",size:24}))}}]),t}(b.a.Component);f()(N,"displayName","NoticeAction"),f()(N,"propTypes",{href:g.a.string,onClick:g.a.func,external:g.a.bool,icon:g.a.string}),f()(N,"defaultProps",{external:!1})},590:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),s=n.n(i),o=n(528),c=n.n(o),l=n(834),u=n(555),m=function(e){var t=e.heading,n=e.children;return r.a.createElement(l.a,{className:c()("settings-group-card","card","is-compact")},t&&r.a.createElement(u.a,{className:"settings-group-card__heading"},t),r.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},n))};m.propTypes={heading:s.a.node},t.a=m},592:function(e,t,n){"use strict";var a,r=n(35),i=n.n(r),s=n(36),o=n.n(s),c=n(1),l=n(46),u=Object(l.b)({},(a={},i()(a,"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,n))}),i()(a,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(c.omit)(e,n):e}),i()(a,"ROUTE_SET",function(e){return Object(c.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var a=t;return a.displayOnNextPage&&(a=o()({},a,{displayOnNextPage:!1})),e[n]=a,e},{})}),a)),m=Object(l.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(l.a)({items:u,lastTimeShown:m})},594:function(e,t,n){},595:function(e,t,n){"use strict";var a=n(643),r=["a","strong","em","u","tt","s"],i=["target","href"];t.a=function(e){return{__html:Object(a.sanitize)(e,{ALLOWED_TAGS:r,ALLOWED_ATTR:i})}}},605:function(e,t,n){"use strict";var a=n(533),r=n.n(a),i=n(536),s=n.n(i),o=n(165),c=n.n(o),l=n(12),u=n.n(l),m=n(10),p=n.n(m),d=n(556),f=n(588),h=n(528),g=n.n(h);n(594);function v(e){var t=e.id,n=e.className,a=e.children;return p.a.createElement("div",{id:t,className:g()("global-notices",n)},a)}var b=n(564),E=n(47),y=n.n(E)()("calypso:data-observe"),N=n(109),_=n(1),T=n(546),O=Object(T.a)(function(e){return Object(_.values)(e.notices.items)},function(e){return e.notices.items}),w=(Object(T.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(550)),k=c()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):y(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){y("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:u.a.string,notices:u.a.oneOfType([u.a.object,u.a.array]),removeNotice:u.a.func.isRequired,storeNotices:u.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&b.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(a){t&&t(a),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return p.a.createElement(d.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&p.a.createElement(f.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,a=e.noticeId,i=e.onClick,o=e.onDismissClick,c=s()(e,["button","href","noticeId","onClick","onDismissClick"]);return p.a.createElement(d.a,r()({},c,{key:"notice-".concat(a),onDismissClick:this.removeReduxNotice(a,o)}),t&&p.a.createElement(f.a,{href:n,onClick:i},t))},this))).length?p.a.createElement(v,{id:this.props.id},e):null}});t.a=Object(N.b)(function(e){return{storeNotices:O(e)}},{removeNotice:w.c})(k)},628:function(e,t,n){"use strict";var a=n(10),r=n.n(a),i=n(12),s=n.n(i),o=n(557),c=n(595),l=function(e){var t=e.text;return t?r.a.createElement(o.a,{dangerouslySetInnerHTML:Object(c.a)(t)}):null};l.propTypes={text:s.a.string},t.a=l},686:function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return p});var a={};n.r(a),n.d(a,"labelsPrint",function(){return s}),n.d(a,"labelTestPrint",function(){return o}),n.d(a,"selfHelp",function(){return c}),n.d(a,"refreshServiceData",function(){return l});var r=n(76),i="wc/v1/connect/",s=function(){return"".concat(i,"label/print")},o=function(){return"".concat(i,"label/preview")},c=function(){return"".concat(i,"self-help")},l=function(){return"".concat(i,"service-data-refresh")},u=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},m=function(e,t){return Object(r.a)().post(e,t).catch(u)},p=function(e,t){return Object(r.a)().createGetUrlWithNonce(e,t)}},792:function(e,t,n){},794:function(e,t,n){},832:function(e,t,n){"use strict";n.r(t);var a,r=n(10),i=n.n(r),s=(n(792),n(35)),o=n.n(s),c=n(36),l=n.n(c),u=(a={},o()(a,"PLUGIN_STATUS_DEBUG_TOGGLE",function(e,t){var n=t.value;return l()({},e,{debug_enabled:n})}),o()(a,"PLUGIN_STATUS_LOGGING_TOGGLE",function(e,t){var n=t.value;return l()({},e,{logging_enabled:n})}),o()(a,"SERVICE_DATA_REFRESH",function(e,t){var n=t.value;return l()({},e,{health_items:l()({},e.health_items,{woocommerce_services:l()({},e.health_items.woocommerce_services,n)})})}),a),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e},p=n(109),d=n(34),f=n(548),h=n(554),g=n(605),v=n(12),b=n.n(v),E=n(537),y=n.n(E),N=n(528),_=n.n(N),T=function(e){var t,n,a=e.title,r=e.subtitle,s=e.state,o=e.message,c=e.children;switch(s){case"fetching":n="is-fetching",t="sync";break;case"success":n="is-success",t="checkmark-circle";break;case"warning":n="is-warning",t="notice";break;case"error":default:n="is-error",t="notice"}return i.a.createElement(f.a,null,i.a.createElement(h.a,null,i.a.createElement("span",null,a),r&&i.a.createElement("span",{className:"plugin-status__indicator-subtitle"},r)),i.a.createElement("div",{className:_()("plugin-status__indicator",n)},i.a.createElement("div",{className:"plugin-status__indicator-icon-and-message"},i.a.createElement("div",{className:"plugin-status__indicator-icon"},i.a.createElement(y.a,{icon:t})),i.a.createElement("div",{className:"plugin-status__indicator-message"},o)),c))};T.propTypes={title:b.a.string,subtitle:b.a.string,state:b.a.string,message:b.a.string,children:b.a.node};var O=T,w=n(77),k=n.n(w),C=n(557),x=n(536),j=n.n(x),S=n(1),D=n.n(S),L=n(686),A=n(550),I=function(){return function(e,t){var n=t().status,a={wcc_debug_on:n.debug_enabled,wcc_logging_on:n.logging_enabled};L.b(L.c.selfHelp(),a).then(function(){return e(Object(A.d)(Object(d.translate)("Your changes have been saved."),{duration:5e3}))}).catch(function(t){D.a.isString(t)&&e(Object(A.a)(t)),D.a.isObject(t)&&e(Object(A.a)(Object(d.translate)("There was a problem when saving your preferences. Please try again.")))})}},R={onRefreshClick:function(){return function(e){return L.b(L.c.refreshServiceData()).then(function(t){t.success;var n=j()(t,["success"]);e({type:"SERVICE_DATA_REFRESH",value:n}),e(Object(A.d)(Object(d.translate)("Service data refreshed.")))}).catch(function(){e(Object(A.a)(Object(d.translate)("An error occurred while refreshing service data.")))})}}},G=Object(p.b)(function(e){return{status:e.status.health_items.woocommerce_services}},R)(Object(d.localize)(function(e){var t,n,a=e.translate,s=e.moment,o=e.status,c=e.onRefreshClick,l=Object(r.useState)(!1),u=k()(l,2),m=u[0],p=u[1],d=Object(r.useCallback)(function(e){e.preventDefault(),p(!0),c().finally(function(){return p(!1)})},[c,p]),f=Date.now()/1e3;return o.has_service_schemas?o.timestamp?o.timestamp<f-o.error_threshold?(t="error",n=a("Service data was found, but is more than three days old")):o.timestamp<f-o.warning_threshold?(t="warning",n=a("Service data was found, but is more than one day old")):(t="success",n=a("Service data is up-to-date")):(t="warning",n=a("Service data found, but may be out of date")):(t="error",n=a("No service data available")),m&&(t="fetching"),i.a.createElement(O,{title:a("WooCommerce Shipping & Tax Data"),state:t,message:n},i.a.createElement(C.a,null,o.timestamp&&o.has_service_schemas?a("Last updated %s.",{args:s(1e3*o.timestamp).fromNow()}):null," ",i.a.createElement("a",{onClick:d,href:"#"},a("Refresh"))))})),P=n(590),U=Object(p.b)(function(e){return{healthItems:e.status.health_items}})(Object(d.localize)(function(e){var t=e.translate,n=e.healthItems;return i.a.createElement(P.a,{heading:t("Health",{context:"This section displays the overall health of WooCommerce Shipping & Tax and the things it depends on"})},i.a.createElement(O,{title:t("WooCommerce"),message:n.woocommerce.message,state:n.woocommerce.state}),i.a.createElement(O,{title:t("Jetpack"),state:n.jetpack.state,message:n.jetpack.message}),i.a.createElement(G,null))})),z=n(107),q=n.n(z),H=n(108),V=n.n(H),W=n(530),M=n.n(W),F=n(529),K=n.n(F),B=n(534),J=n.n(B),Y=n(531),Q=n.n(Y),X=n(533),Z=n.n(X),$=n(78),ee=n.n($),te=n(793),ne=n.n(te),ae=n(582);function re(e){var t=e.className,n=e.text,a=e.onCopy,r=void 0===a?S.noop:a,s=j()(e,["className","text","onCopy"]),o=i.a.useRef(),c=i.a.useRef(),l=i.a.useRef();return i.a.useEffect(function(){c.current=function(){return n},l.current=r},[n,r]),i.a.useEffect(function(){var e=ee.a.findDOMNode(o.current),t=new ne.a(e,{text:function(){return c.current()}});return t.on("success",function(){return l.current()}),function(){return t.destroy()}},[]),i.a.createElement(ae.a,Z()({},s,{ref:o,className:_()("clipboard-button",t)}))}re.propTypes={className:b.a.string,text:b.a.string,onCopy:b.a.func};var ie=re,se=n(551),oe=function(e){var t=e.className,n=e.isError,a=e.isValid,r=e.children,s=j()(e,["className","isError","isValid","children"]);return i.a.createElement("textarea",Z()({},s,{className:_()(t,"form-textarea",{"is-error":n,"is-valid":a})}),r)},ce=n(564),le=function(e){function t(){var e,n;q()(this,t);for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return n=M()(this,(e=K()(t)).call.apply(e,[this].concat(r))),o()(J()(n),"onCopy",function(){var e=n.props.translate;ce.a.success(e("Log tail copied to clipboard"),{duration:2e3})}),n}return Q()(t,e),V()(t,[{key:"render",value:function(){var e=this.props,t=e.key,n=e.title,a=e.tail,r=e.url,s=e.count,o=e.translate,c="wcs-log-".concat(t);return i.a.createElement(f.a,null,i.a.createElement(se.a,{htmlFor:c},n),i.a.createElement(oe,{id:c,name:c,readOnly:!0,value:a}),i.a.createElement(C.a,{className:"plugin-status__log-explanation"},i.a.createElement("span",{className:"plugin-status__log-explanation-span"},o("Last %s entry. {{a}}Show full log{{/a}}","Last %s entries. {{a}}Show full log{{/a}}",{args:[s],count:s,components:{a:i.a.createElement("a",{href:r})}})),i.a.createElement(ie,{text:a,onCopy:this.onCopy,compact:!0},o("Copy for support"))))}}]),t}(r.Component);le.propTypes={title:b.a.string,logKey:b.a.string};var ue=Object(p.b)(function(e,t){var n=t.logKey;return e.status.logs[n]})(Object(d.localize)(le)),me=Object(p.b)(function(e){return{services:e.status.services}})(Object(d.localize)(function(e){var t=e.translate,n=e.moment,a=e.services;if(!1===a)return null;var r=function(e,a){return i.a.createElement(O,{key:a,title:e.title,subtitle:e.subtitle,state:e.state,message:e.message},function(e){var a=e.timestamp,r=e.url;return a>0?i.a.createElement(C.a,null,t("Request was made %s - check logs below or {{a}}edit service settings{{/a}}",{args:n(1e3*a).fromNow(),components:{a:i.a.createElement("a",{href:r})}})):i.a.createElement(C.a,null,i.a.createElement("a",{href:r},t("Edit service settings")))}(e))};return i.a.createElement(P.a,{heading:t("Services")},a.length?a.map(r):i.a.createElement(C.a,null,t("No services configured. {{a}}Add a shipping service{{/a}}",{components:{a:i.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping"})}})))})),pe=n(795),de=(n(794),n(628)),fe=n(643),he=function(e){return{__html:Object(fe.sanitize)(e,{ALLOWED_TAGS:["a","strong","em","u","tt","s"],ALLOWED_ATTR:["target","href"]})}},ge=function(e){function t(){var e,n;q()(this,t);for(var a=arguments.length,r=new Array(a),s=0;s<a;s++)r[s]=arguments[s];return n=M()(this,(e=K()(t)).call.apply(e,[this].concat(r))),o()(J()(n),"renderToggleText",function(e){return e?i.a.createElement("span",{className:"toggle__text",dangerouslySetInnerHTML:he(e)}):null}),o()(J()(n),"handleChangeEvent",function(){var e=n.props;(0,e.onUpdate)(!e.checked)}),n}return Q()(t,e),V()(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,a=e.description,r=e.trueText,s=e.falseText,o=e.checked,c=e.placeholder,l=e.className;return i.a.createElement(f.a,{className:l},i.a.createElement(se.a,{htmlFor:t,dangerouslySetInnerHTML:he(n)}),i.a.createElement(pe.a,{id:t,name:t,placeholder:c,checked:o,onChange:this.handleChangeEvent}),this.renderToggleText(o?r:s),i.a.createElement(de.a,{text:a}))}}]),t}(r.Component);o()(ge,"propTypes",{id:b.a.string.isRequired,title:b.a.string,description:b.a.string,trueText:b.a.string.isRequired,falseText:b.a.string.isRequired,checked:b.a.bool,onUpdate:b.a.func,className:b.a.string}),o()(ge,"defaultProps",{checked:!1});var ve=ge,be={onLoggingToggle:function(e){return function(t){t({type:"PLUGIN_STATUS_LOGGING_TOGGLE",value:e}),t(I())}},onDebuggingToggle:function(e){return function(t){t({type:"PLUGIN_STATUS_DEBUG_TOGGLE",value:e}),t(I())}}},Ee=Object(p.b)(function(e){return{isLoggingEnabled:Boolean(e.status.logging_enabled),isDebuggingEnabled:Boolean(e.status.debug_enabled)}},be)(Object(d.localize)(function(e){var t=e.onLoggingToggle,n=e.onDebuggingToggle,a=e.isLoggingEnabled,r=e.isDebuggingEnabled,s=e.translate;return i.a.createElement("div",null,i.a.createElement(g.a,{id:"notices",notices:ce.a.list}),i.a.createElement(U,null),i.a.createElement(me,null),i.a.createElement(P.a,{heading:s("Debug")},i.a.createElement(ve,{id:"wcs-toggle-debug",checked:r,title:s("Debug"),description:s("Display troubleshooting information on the Cart and Checkout pages."),trueText:s("Enabled"),falseText:s("Disabled"),onUpdate:n}),i.a.createElement(ve,{id:"wcs-toggle-logging",checked:a,title:s("Logging"),description:s("Write diagnostic messages to log files. Helpful when contacting support."),trueText:s("Enabled"),falseText:s("Disabled"),onUpdate:t}),i.a.createElement(ue,{logKey:"shipping",title:s("Shipping Log")}),i.a.createElement(ue,{logKey:"taxes",title:s("Taxes Log")}),i.a.createElement(ue,{logKey:"other",title:s("Other Log")})),i.a.createElement(P.a,{heading:s("Support")},i.a.createElement(f.a,null,i.a.createElement(h.a,null,s("Need help?")),i.a.createElement("p",{className:"plugin-status__help-description"},s("Our team is here for you. View our {{docsA}}support docs{{/docsA}} or {{ticketA}}open a support ticket{{/ticketA}}.",{components:{docsA:i.a.createElement("a",{href:"https://docs.woocommerce.com/document/woocommerce-shipping-and-tax/",target:"_blank",rel:"noopener noreferrer"}),ticketA:i.a.createElement("a",{href:"https://woocommerce.com/my-account/create-a-ticket/",target:"_blank",rel:"noopener noreferrer"})}})))))})),ye=n(592),Ne=n(46);t.default=function(e){var t=e.formData;return{getReducer:function(){return Object(Ne.a)({status:m,notices:ye.a})},getInitialState:function(){return{status:t}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-admin-status"},View:function(){return i.a.createElement(Ee,null)}}}}}]);
|
dist/chunks/{32d882822d58f49da0fb.css → 7566d5c5f55e31b018b9.css}
RENAMED
File without changes
|
dist/chunks/{32d882822d58f49da0fb.min.js → 7566d5c5f55e31b018b9.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[150],{548:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("fieldset",a()({},n,{className:u()(t,"form-fieldset")}),r)}},553:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("legend",a()({},n,{className:u()(t,"form-legend")}),r)}},554:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("h3",a()({},n,{className:u()(t,"form-section-heading")}),r)}},555:function(e,t,r){"use strict";var n=r(107),a=r.n(n),i=r(108),o=r.n(i),s=r(530),c=r.n(s),l=r(529),u=r.n(l),p=r(534),f=r.n(p),d=r(531),m=r.n(d),y=r(35),b=r.n(y),g=r(12),h=r.n(g),v=r(10),O=r.n(v),j=r(528),P=r.n(j),w=r(1),N=r(34),E=r(537),A=r.n(E);r(568);function S(e){var t=e.children;return O.a.createElement("span",{className:"screen-reader-text"},t)}var k=function(e){function t(){var e,r;a()(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=c()(this,(e=u()(t)).call.apply(e,[this].concat(i))),b()(f()(r),"dismissTimeout",null),r}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.icon,a=e.isCompact,i=e.isLoading,o=e.onDismissClick,s=e.showDismiss,c=void 0===s?!a:s,l=e.status,u=e.text,p=e.translate,f=P()("notice",l,r,{"is-compact":a,"is-loading":i,"is-dismissable":c});return O.a.createElement("div",{className:f},O.a.createElement("span",{className:"notice__icon-wrapper"},O.a.createElement(A.a,{className:"notice__icon",icon:n||this.getIcon(),size:24})),O.a.createElement("span",{className:"notice__content"},O.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,c&&O.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:o},O.a.createElement(A.a,{icon:"cross",size:24}),O.a.createElement(S,null,p("Dismiss"))))}}]),t}(v.Component);b()(k,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:w.noop,status:null,text:null}),b()(k,"propTypes",{className:h.a.string,duration:h.a.number,icon:h.a.string,isCompact:h.a.bool,isLoading:h.a.bool,onDismissClick:h.a.func,showDismiss:h.a.bool,status:h.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:h.a.oneOfType([h.a.arrayOf(h.a.oneOfType([h.a.string,h.a.node])),h.a.oneOfType([h.a.string,h.a.node])]),translate:h.a.func.isRequired});t.a=Object(N.localize)(k)},568:function(e,t,r){},569:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);r(600);t.a=function(e){var t=e.inputRef,r=e.className,n=e.isError,i=o()(e,["inputRef","className","isError"]);return c.a.createElement("select",a()({},i,{ref:t,className:u()(r,"form-select",{"is-error":n})}))}},582:function(e,t,r){"use strict";r.d(t,"a",function(){return E});var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(107),c=r.n(s),l=r(108),u=r.n(l),p=r(530),f=r.n(p),d=r(529),m=r.n(d),y=r(531),b=r.n(y),g=r(35),h=r.n(g),v=r(10),O=r.n(v),j=r(12),P=r.n(j),w=r(528),N=r.n(w),E=function(e){function t(){return c()(this,t),f()(this,m()(t).apply(this,arguments))}return b()(t,e),u()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,r=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,o()(t,["compact","primary","scary","busy","borderless","type"])),n=r.target?(r.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":r.rel;return O.a.createElement("a",a()({},r,{rel:n,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,o()(i,["compact","primary","scary","busy","borderless","target","rel"]));return O.a.createElement("button",a()({},s,{className:e}))}}]),t}(v.PureComponent);h()(E,"propTypes",{compact:P.a.bool,primary:P.a.bool,scary:P.a.bool,busy:P.a.bool,type:P.a.string,href:P.a.string,borderless:P.a.bool,target:P.a.string,rel:P.a.string}),h()(E,"defaultProps",{type:"button"})},583:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(535),o=r.n(i),s=r(107),c=r.n(s),l=r(108),u=r.n(l),p=r(530),f=r.n(p),d=r(529),m=r.n(d),y=r(534),b=r.n(y),g=r(531),h=r.n(g),v=r(35),O=r.n(v),j=r(528),P=r.n(j),w=r(34),N=r(1),E=r(10),A=r.n(E),S=r(582),k=function(e){function t(){var e,r;c()(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=f()(this,(e=m()(t)).call.apply(e,[this].concat(a))),O()(b()(r),"getDefaultButtonAction",function(){return r.props.isSubmitting?r.props.translate("Saving\u2026"):r.props.translate("Save Settings")}),r}return h()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.isPrimary,i=o()(e,["children","className","isPrimary"]),s=P()(r,"form-button");return A.a.createElement(S.a,a()({},Object(N.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:n,className:s}),E.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(A.a.Component);O()(k,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(w.localize)(k)},584:function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"undefined"!==typeof e[n]&&(r[n]=e[n]);return r},t.merge=function(e,r,a){if(!r)return e;if("object"!==typeof r){if(Array.isArray(e))e.push(r);else{if("object"!==typeof e)return[e,r];(a.plainObjects||a.allowPrototypes||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if("object"!==typeof e)return[e].concat(r);var i=e;return Array.isArray(e)&&!Array.isArray(r)&&(i=t.arrayToObject(e,a)),Array.isArray(e)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(e,i)?e[i]&&"object"===typeof e[i]?e[i]=t.merge(e[i],r,a):e.push(r):e[i]=r}),e):Object.keys(r).reduce(function(e,i){var o=r[i];return n.call(e,i)?e[i]=t.merge(e[i],o,a):e[i]=o,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"===typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=a[i]:i<2048?r+=a[192|i>>6]+a[128|63&i]:i<55296||i>=57344?r+=a[224|i>>12]+a[128|i>>6&63]+a[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=a[240|i>>18]+a[128|i>>12&63]+a[128|i>>6&63]+a[128|63&i])}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var a=t[n],i=a.obj[a.prop],o=Object.keys(i),s=0;s<o.length;++s){var c=o[s],l=i[c];"object"===typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:i,prop:c}),r.push(l))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],a=0;a<t.length;++a)"undefined"!==typeof t[a]&&n.push(t[a]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},585:function(e,t,r){"use strict";var n=String.prototype.replace,a=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,a,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},590:function(e,t,r){"use strict";var n=r(10),a=r.n(n),i=r(12),o=r.n(i),s=r(528),c=r.n(s),l=r(835),u=r(554),p=function(e){var t=e.heading,r=e.children;return a.a.createElement(l.a,{className:c()("settings-group-card","card","is-compact")},t&&a.a.createElement(u.a,{className:"settings-group-card__heading"},t),a.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},r))};p.propTypes={heading:o.a.node},t.a=p},600:function(e,t,r){},607:function(e,t,r){"use strict";var n=r(622),a=r(623),i=r(585);e.exports={formats:i,parse:a,stringify:n}},622:function(e,t,r){"use strict";var n=r(584),a=r(585),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return o.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,a,i,o,c,l,u,p,f,d,m){var y=t;if("function"===typeof l)y=l(r,y);else if(y instanceof Date)y=f(y);else if(null===y){if(i)return c&&!m?c(r,s.encoder):r;y=""}if("string"===typeof y||"number"===typeof y||"boolean"===typeof y||n.isBuffer(y))return c?[d(m?r:c(r,s.encoder))+"="+d(c(y,s.encoder))]:[d(r)+"="+d(String(y))];var b,g=[];if("undefined"===typeof y)return g;if(Array.isArray(l))b=l;else{var h=Object.keys(y);b=u?h.sort(u):h}for(var v=0;v<b.length;++v){var O=b[v];o&&null===y[O]||(g=Array.isArray(y)?g.concat(e(y[O],a(r,O),a,i,o,c,l,u,p,f,d,m)):g.concat(e(y[O],r+(p?"."+O:"["+O+"]"),a,i,o,c,l,u,p,f,d,m)))}return g};e.exports=function(e,t){var r=e,o=t?n.assign({},t):{};if(null!==o.encoder&&void 0!==o.encoder&&"function"!==typeof o.encoder)throw new TypeError("Encoder has to be a function.");var l="undefined"===typeof o.delimiter?s.delimiter:o.delimiter,u="boolean"===typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,p="boolean"===typeof o.skipNulls?o.skipNulls:s.skipNulls,f="boolean"===typeof o.encode?o.encode:s.encode,d="function"===typeof o.encoder?o.encoder:s.encoder,m="function"===typeof o.sort?o.sort:null,y="undefined"!==typeof o.allowDots&&o.allowDots,b="function"===typeof o.serializeDate?o.serializeDate:s.serializeDate,g="boolean"===typeof o.encodeValuesOnly?o.encodeValuesOnly:s.encodeValuesOnly;if("undefined"===typeof o.format)o.format=a.default;else if(!Object.prototype.hasOwnProperty.call(a.formatters,o.format))throw new TypeError("Unknown format option provided.");var h,v,O=a.formatters[o.format];"function"===typeof o.filter?r=(v=o.filter)("",r):Array.isArray(o.filter)&&(h=v=o.filter);var j,P=[];if("object"!==typeof r||null===r)return"";j=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var w=i[j];h||(h=Object.keys(r)),m&&h.sort(m);for(var N=0;N<h.length;++N){var E=h[N];p&&null===r[E]||(P=P.concat(c(r[E],E,w,u,p,f?d:null,v,m,y,b,O,g)))}var A=P.join(l),S=!0===o.addQueryPrefix?"?":"";return A.length>0?S+A:""}},623:function(e,t,r){"use strict";var n=r(584),a=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(n),s=o?n.slice(0,o.index):n,c=[];if(s){if(!r.plainObjects&&a.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var l=0;null!==(o=i.exec(n))&&l<r.depth;){if(l+=1,!r.plainObjects&&a.call(Object.prototype,o[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(o[1])}return o&&c.push("["+n.slice(o.index)+"]"),function(e,t,r){for(var n=t,a=e.length-1;a>=0;--a){var i,o=e[a];if("[]"===o)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,c=parseInt(s,10);!isNaN(c)&&o!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(i=[])[c]=n:i[s]=n}n=i}return n}(c,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!==typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"===typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"===typeof r.depth?r.depth:i.depth,r.arrayLimit="number"===typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"===typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"===typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"===typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"===typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"===typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"===typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"===typeof e)return r.plainObjects?Object.create(null):{};for(var s="string"===typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,o),c=0;c<s.length;++c){var l,u,p=s[c],f=p.indexOf("]="),d=-1===f?p.indexOf("="):f+1;-1===d?(l=t.decoder(p,i.decoder),u=t.strictNullHandling?null:""):(l=t.decoder(p.slice(0,d),i.decoder),u=t.decoder(p.slice(d+1),i.decoder)),a.call(r,l)?r[l]=[].concat(r[l]).concat(u):r[l]=u}return r}(e,r):e,c=r.plainObjects?Object.create(null):{},l=Object.keys(s),u=0;u<l.length;++u){var p=l[u],f=o(p,s[p],r);c=n.merge(c,f,r)}return n.compact(c)}},687:function(e,t,r){"use strict";r.d(t,"c",function(){return n}),r.d(t,"b",function(){return p}),r.d(t,"a",function(){return f});var n={};r.r(n),r.d(n,"labelsPrint",function(){return o}),r.d(n,"labelTestPrint",function(){return s}),r.d(n,"selfHelp",function(){return c}),r.d(n,"refreshServiceData",function(){return l});var a=r(76),i="wc/v1/connect/",o=function(){return"".concat(i,"label/print")},s=function(){return"".concat(i,"label/preview")},c=function(){return"".concat(i,"self-help")},l=function(){return"".concat(i,"service-data-refresh")},u=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},p=function(e,t){return Object(a.a)().post(e,t).catch(u)},f=function(e,t){return Object(a.a)().createGetUrlWithNonce(e,t)}},807:function(e,t,r){},833:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"UPDATE_PAPER_SIZE",function(){return x}),r.d(n,"PRINTING_IN_PROGRESS",function(){return z}),r.d(n,"PRINTING_ERROR",function(){return I}),r.d(n,"updatePaperSize",function(){return L}),r.d(n,"print",function(){return F});var a=r(10),i=r.n(a),o=(r(807),r(107)),s=r.n(o),c=r(108),l=r.n(c),u=r(530),p=r.n(u),f=r(529),d=r.n(f),m=r(534),y=r.n(m),b=r(531),g=r.n(b),h=r(35),v=r.n(h),O=r(12),j=r.n(O),P=r(34),w=r(30),N=r(109),E=r(607),A=r(1),S=r.n(A),k=r(687),D=S.a.memoize(function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(navigator.userAgent.includes("Firefox"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),R={a4:{name:Object(P.translate)("A4"),exclude:function(e){return["US","CA","MX","DO"].includes(e)}},label:{name:Object(P.translate)('Label (4"x6")')},legal:{name:Object(P.translate)("Legal")},letter:{name:Object(P.translate)("Letter")}},T=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!R[e])throw new Error("Invalid paper size: ".concat(e));var n={paper_size:e,label_id_csv:S.a.filter(S.a.map(t,"labelId")).join(","),caption_csv:S.a.filter(S.a.map(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(",")},a=r?k.c.labelTestPrint():k.c.labelsPrint();return k.a(a,Object(E.stringify)(n))},C=null,_=function(e){return new Promise(function(t,r){C&&document.body.removeChild(C),(C=document.createElement("iframe")).src=e,C.style.position="fixed",C.style.left="-999px",C.onload=function(){t()},C.onerror=function(e){r(e)},document.body.appendChild(C)})},x="UPDATE_PAPER_SIZE",z="PRINTING_IN_PROGRESS",I="PRINTING_ERROR",L=function(e){return{type:x,paperSize:e}},F=function(){return function(e,t){e({type:z,inProgress:!0});var r=t().paperSize,n=[{caption:Object(P.translate)("TEST LABEL 1")}];"label"!==r&&n.push({caption:Object(P.translate)("TEST LABEL 2")}),function(e){switch(D()){case"native":return _(e).then(function(){C.contentWindow.print()});case"addon":return window.open(e)?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));default:return _(e),Promise.resolve()}}(function(e,t){return D()?T(e,t,!0):null}(r,n)).then(function(){e({type:z,inProgress:!1})}).catch(function(t){e({type:I,error:t})})}},H=r(555),U=function(e){var t=e.children,r=e.isWarning;return i.a.createElement(H.a,{status:r?"is-warning":"is-error",showDismiss:!1},t)};U.propTypes={isWarning:j.a.bool};var B=U,G=r(583),q=r(548),V=r(569),W=r(553),Q=r(590),J=function(e){function t(){var e,r;s()(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=p()(this,(e=d()(t)).call.apply(e,[this].concat(a))),v()(y()(r),"onPaperSizeChange",function(e){return r.props.updatePaperSize(e.target.value)}),r}return g()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.paperSize,r=e.country,n=e.printingInProgress,a=e.error,o=e.print,s=function(e){return S.a.reduce(R,function(t,r,n){var a=r.name,i=r.exclude;return i&&i(e)||(t[n]=a),t},{})}(r);return i.a.createElement(Q.a,{heading:Object(P.translate)("Print")},a&&i.a.createElement(B,null,a),i.a.createElement(W.a,null,Object(P.translate)("Having trouble configuring your printer?")),i.a.createElement("p",null,Object(P.translate)("You can run a test print for shipping labels by selecting the paper size, then print.")),i.a.createElement(q.a,null,i.a.createElement(W.a,null,Object(P.translate)("Paper size")),i.a.createElement("div",{className:"print-test-label__form-container"},i.a.createElement(V.a,{className:"print-test-label__paper-size",value:t,onChange:this.onPaperSizeChange},Object.keys(s).map(function(e){return i.a.createElement("option",{key:e,value:e},s[e])})),i.a.createElement(G.a,{type:"button",disabled:Boolean(n),onClick:o,isPrimary:!1},Object(P.translate)("Print")))))}}]),t}(a.Component);v()(J,"propTypes",{paperSize:j.a.string.isRequired,country:j.a.string.isRequired,printingInProgress:j.a.bool,error:j.a.string,updatePaperSize:j.a.func.isRequired,print:j.a.func.isRequired});var M=Object(N.b)(function(e){return e},function(e){return Object(w.b)(n,e)})(J),X=r(36),Z=r.n(X),K={};K[x]=function(e,t){var r=t.paperSize;return Z()({},e,{paperSize:r})},K[z]=function(e,t){var r=t.inProgress,n=Z()({},e,{printingInProgress:r});return r&&delete n.error,n},K[I]=function(e,t){var r=t.error;return Z()({},e,{printingInProgress:!1,error:r.toString()})};var Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return K[t.type]?K[t.type](e,t):e};t.default=function(e){var t=e.paperSize,r=e.storeOptions;return{getReducer:function(){return Y},getInitialState:function(){return{paperSize:t,country:r.origin_country}},getStateKey:function(){return"wcs-print-test-label"},View:function(){return i.a.createElement(M,null)}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[150],{548:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("fieldset",a()({},n,{className:u()(t,"form-fieldset")}),r)}},554:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("legend",a()({},n,{className:u()(t,"form-legend")}),r)}},555:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);t.a=function(e){var t=e.className,r=e.children,n=o()(e,["className","children"]);return c.a.createElement("h3",a()({},n,{className:u()(t,"form-section-heading")}),r)}},556:function(e,t,r){"use strict";var n=r(107),a=r.n(n),i=r(108),o=r.n(i),s=r(530),c=r.n(s),l=r(529),u=r.n(l),p=r(534),f=r.n(p),d=r(531),m=r.n(d),y=r(35),b=r.n(y),g=r(12),h=r.n(g),v=r(10),O=r.n(v),j=r(528),P=r.n(j),w=r(1),N=r(34),E=r(537),A=r.n(E);r(568);function S(e){var t=e.children;return O.a.createElement("span",{className:"screen-reader-text"},t)}var k=function(e){function t(){var e,r;a()(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=c()(this,(e=u()(t)).call.apply(e,[this].concat(i))),b()(f()(r),"dismissTimeout",null),r}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.icon,a=e.isCompact,i=e.isLoading,o=e.onDismissClick,s=e.showDismiss,c=void 0===s?!a:s,l=e.status,u=e.text,p=e.translate,f=P()("notice",l,r,{"is-compact":a,"is-loading":i,"is-dismissable":c});return O.a.createElement("div",{className:f},O.a.createElement("span",{className:"notice__icon-wrapper"},O.a.createElement(A.a,{className:"notice__icon",icon:n||this.getIcon(),size:24})),O.a.createElement("span",{className:"notice__content"},O.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,c&&O.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:o},O.a.createElement(A.a,{icon:"cross",size:24}),O.a.createElement(S,null,p("Dismiss"))))}}]),t}(v.Component);b()(k,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:w.noop,status:null,text:null}),b()(k,"propTypes",{className:h.a.string,duration:h.a.number,icon:h.a.string,isCompact:h.a.bool,isLoading:h.a.bool,onDismissClick:h.a.func,showDismiss:h.a.bool,status:h.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:h.a.oneOfType([h.a.arrayOf(h.a.oneOfType([h.a.string,h.a.node])),h.a.oneOfType([h.a.string,h.a.node])]),translate:h.a.func.isRequired});t.a=Object(N.localize)(k)},568:function(e,t,r){},569:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(10),c=r.n(s),l=r(528),u=r.n(l);r(601);t.a=function(e){var t=e.inputRef,r=e.className,n=e.isError,i=o()(e,["inputRef","className","isError"]);return c.a.createElement("select",a()({},i,{ref:t,className:u()(r,"form-select",{"is-error":n})}))}},582:function(e,t,r){"use strict";r.d(t,"a",function(){return E});var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(107),c=r.n(s),l=r(108),u=r.n(l),p=r(530),f=r.n(p),d=r(529),m=r.n(d),y=r(531),b=r.n(y),g=r(35),h=r.n(g),v=r(10),O=r.n(v),j=r(12),P=r.n(j),w=r(528),N=r.n(w),E=function(e){function t(){return c()(this,t),f()(this,m()(t).apply(this,arguments))}return b()(t,e),u()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,r=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,o()(t,["compact","primary","scary","busy","borderless","type"])),n=r.target?(r.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":r.rel;return O.a.createElement("a",a()({},r,{rel:n,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,o()(i,["compact","primary","scary","busy","borderless","target","rel"]));return O.a.createElement("button",a()({},s,{className:e}))}}]),t}(v.PureComponent);h()(E,"propTypes",{compact:P.a.bool,primary:P.a.bool,scary:P.a.bool,busy:P.a.bool,type:P.a.string,href:P.a.string,borderless:P.a.bool,target:P.a.string,rel:P.a.string}),h()(E,"defaultProps",{type:"button"})},583:function(e,t,r){"use strict";var n=r(533),a=r.n(n),i=r(536),o=r.n(i),s=r(107),c=r.n(s),l=r(108),u=r.n(l),p=r(530),f=r.n(p),d=r(529),m=r.n(d),y=r(534),b=r.n(y),g=r(531),h=r.n(g),v=r(35),O=r.n(v),j=r(528),P=r.n(j),w=r(34),N=r(1),E=r(10),A=r.n(E),S=r(582),k=function(e){function t(){var e,r;c()(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=f()(this,(e=m()(t)).call.apply(e,[this].concat(a))),O()(b()(r),"getDefaultButtonAction",function(){return r.props.isSubmitting?r.props.translate("Saving\u2026"):r.props.translate("Save Settings")}),r}return h()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.isPrimary,i=o()(e,["children","className","isPrimary"]),s=P()(r,"form-button");return A.a.createElement(S.a,a()({},Object(N.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:n,className:s}),E.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(A.a.Component);O()(k,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(w.localize)(k)},584:function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"undefined"!==typeof e[n]&&(r[n]=e[n]);return r},t.merge=function(e,r,a){if(!r)return e;if("object"!==typeof r){if(Array.isArray(e))e.push(r);else{if("object"!==typeof e)return[e,r];(a.plainObjects||a.allowPrototypes||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if("object"!==typeof e)return[e].concat(r);var i=e;return Array.isArray(e)&&!Array.isArray(r)&&(i=t.arrayToObject(e,a)),Array.isArray(e)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(e,i)?e[i]&&"object"===typeof e[i]?e[i]=t.merge(e[i],r,a):e.push(r):e[i]=r}),e):Object.keys(r).reduce(function(e,i){var o=r[i];return n.call(e,i)?e[i]=t.merge(e[i],o,a):e[i]=o,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"===typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=a[i]:i<2048?r+=a[192|i>>6]+a[128|63&i]:i<55296||i>=57344?r+=a[224|i>>12]+a[128|i>>6&63]+a[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=a[240|i>>18]+a[128|i>>12&63]+a[128|i>>6&63]+a[128|63&i])}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var a=t[n],i=a.obj[a.prop],o=Object.keys(i),s=0;s<o.length;++s){var c=o[s],l=i[c];"object"===typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:i,prop:c}),r.push(l))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],a=0;a<t.length;++a)"undefined"!==typeof t[a]&&n.push(t[a]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},585:function(e,t,r){"use strict";var n=String.prototype.replace,a=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,a,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},590:function(e,t,r){"use strict";var n=r(10),a=r.n(n),i=r(12),o=r.n(i),s=r(528),c=r.n(s),l=r(834),u=r(555),p=function(e){var t=e.heading,r=e.children;return a.a.createElement(l.a,{className:c()("settings-group-card","card","is-compact")},t&&a.a.createElement(u.a,{className:"settings-group-card__heading"},t),a.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},r))};p.propTypes={heading:o.a.node},t.a=p},601:function(e,t,r){},607:function(e,t,r){"use strict";var n=r(623),a=r(624),i=r(585);e.exports={formats:i,parse:a,stringify:n}},623:function(e,t,r){"use strict";var n=r(584),a=r(585),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return o.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,a,i,o,c,l,u,p,f,d,m){var y=t;if("function"===typeof l)y=l(r,y);else if(y instanceof Date)y=f(y);else if(null===y){if(i)return c&&!m?c(r,s.encoder):r;y=""}if("string"===typeof y||"number"===typeof y||"boolean"===typeof y||n.isBuffer(y))return c?[d(m?r:c(r,s.encoder))+"="+d(c(y,s.encoder))]:[d(r)+"="+d(String(y))];var b,g=[];if("undefined"===typeof y)return g;if(Array.isArray(l))b=l;else{var h=Object.keys(y);b=u?h.sort(u):h}for(var v=0;v<b.length;++v){var O=b[v];o&&null===y[O]||(g=Array.isArray(y)?g.concat(e(y[O],a(r,O),a,i,o,c,l,u,p,f,d,m)):g.concat(e(y[O],r+(p?"."+O:"["+O+"]"),a,i,o,c,l,u,p,f,d,m)))}return g};e.exports=function(e,t){var r=e,o=t?n.assign({},t):{};if(null!==o.encoder&&void 0!==o.encoder&&"function"!==typeof o.encoder)throw new TypeError("Encoder has to be a function.");var l="undefined"===typeof o.delimiter?s.delimiter:o.delimiter,u="boolean"===typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,p="boolean"===typeof o.skipNulls?o.skipNulls:s.skipNulls,f="boolean"===typeof o.encode?o.encode:s.encode,d="function"===typeof o.encoder?o.encoder:s.encoder,m="function"===typeof o.sort?o.sort:null,y="undefined"!==typeof o.allowDots&&o.allowDots,b="function"===typeof o.serializeDate?o.serializeDate:s.serializeDate,g="boolean"===typeof o.encodeValuesOnly?o.encodeValuesOnly:s.encodeValuesOnly;if("undefined"===typeof o.format)o.format=a.default;else if(!Object.prototype.hasOwnProperty.call(a.formatters,o.format))throw new TypeError("Unknown format option provided.");var h,v,O=a.formatters[o.format];"function"===typeof o.filter?r=(v=o.filter)("",r):Array.isArray(o.filter)&&(h=v=o.filter);var j,P=[];if("object"!==typeof r||null===r)return"";j=o.arrayFormat in i?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var w=i[j];h||(h=Object.keys(r)),m&&h.sort(m);for(var N=0;N<h.length;++N){var E=h[N];p&&null===r[E]||(P=P.concat(c(r[E],E,w,u,p,f?d:null,v,m,y,b,O,g)))}var A=P.join(l),S=!0===o.addQueryPrefix?"?":"";return A.length>0?S+A:""}},624:function(e,t,r){"use strict";var n=r(584),a=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(n),s=o?n.slice(0,o.index):n,c=[];if(s){if(!r.plainObjects&&a.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var l=0;null!==(o=i.exec(n))&&l<r.depth;){if(l+=1,!r.plainObjects&&a.call(Object.prototype,o[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(o[1])}return o&&c.push("["+n.slice(o.index)+"]"),function(e,t,r){for(var n=t,a=e.length-1;a>=0;--a){var i,o=e[a];if("[]"===o)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,c=parseInt(s,10);!isNaN(c)&&o!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(i=[])[c]=n:i[s]=n}n=i}return n}(c,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!==typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"===typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"===typeof r.depth?r.depth:i.depth,r.arrayLimit="number"===typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"===typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"===typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"===typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"===typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"===typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"===typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"===typeof e)return r.plainObjects?Object.create(null):{};for(var s="string"===typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,o),c=0;c<s.length;++c){var l,u,p=s[c],f=p.indexOf("]="),d=-1===f?p.indexOf("="):f+1;-1===d?(l=t.decoder(p,i.decoder),u=t.strictNullHandling?null:""):(l=t.decoder(p.slice(0,d),i.decoder),u=t.decoder(p.slice(d+1),i.decoder)),a.call(r,l)?r[l]=[].concat(r[l]).concat(u):r[l]=u}return r}(e,r):e,c=r.plainObjects?Object.create(null):{},l=Object.keys(s),u=0;u<l.length;++u){var p=l[u],f=o(p,s[p],r);c=n.merge(c,f,r)}return n.compact(c)}},686:function(e,t,r){"use strict";r.d(t,"c",function(){return n}),r.d(t,"b",function(){return p}),r.d(t,"a",function(){return f});var n={};r.r(n),r.d(n,"labelsPrint",function(){return o}),r.d(n,"labelTestPrint",function(){return s}),r.d(n,"selfHelp",function(){return c}),r.d(n,"refreshServiceData",function(){return l});var a=r(76),i="wc/v1/connect/",o=function(){return"".concat(i,"label/print")},s=function(){return"".concat(i,"label/preview")},c=function(){return"".concat(i,"self-help")},l=function(){return"".concat(i,"service-data-refresh")},u=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},p=function(e,t){return Object(a.a)().post(e,t).catch(u)},f=function(e,t){return Object(a.a)().createGetUrlWithNonce(e,t)}},807:function(e,t,r){},833:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"UPDATE_PAPER_SIZE",function(){return x}),r.d(n,"PRINTING_IN_PROGRESS",function(){return z}),r.d(n,"PRINTING_ERROR",function(){return I}),r.d(n,"updatePaperSize",function(){return L}),r.d(n,"print",function(){return F});var a=r(10),i=r.n(a),o=(r(807),r(107)),s=r.n(o),c=r(108),l=r.n(c),u=r(530),p=r.n(u),f=r(529),d=r.n(f),m=r(534),y=r.n(m),b=r(531),g=r.n(b),h=r(35),v=r.n(h),O=r(12),j=r.n(O),P=r(34),w=r(30),N=r(109),E=r(607),A=r(1),S=r.n(A),k=r(686),D=S.a.memoize(function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(navigator.userAgent.includes("Firefox"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),R={a4:{name:Object(P.translate)("A4"),exclude:function(e){return["US","CA","MX","DO"].includes(e)}},label:{name:Object(P.translate)('Label (4"x6")')},legal:{name:Object(P.translate)("Legal")},letter:{name:Object(P.translate)("Letter")}},T=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!R[e])throw new Error("Invalid paper size: ".concat(e));var n={paper_size:e,label_id_csv:S.a.filter(S.a.map(t,"labelId")).join(","),caption_csv:S.a.filter(S.a.map(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(",")},a=r?k.c.labelTestPrint():k.c.labelsPrint();return k.a(a,Object(E.stringify)(n))},C=null,_=function(e){return new Promise(function(t,r){C&&document.body.removeChild(C),(C=document.createElement("iframe")).src=e,C.style.position="fixed",C.style.left="-999px",C.onload=function(){t()},C.onerror=function(e){r(e)},document.body.appendChild(C)})},x="UPDATE_PAPER_SIZE",z="PRINTING_IN_PROGRESS",I="PRINTING_ERROR",L=function(e){return{type:x,paperSize:e}},F=function(){return function(e,t){e({type:z,inProgress:!0});var r=t().paperSize,n=[{caption:Object(P.translate)("TEST LABEL 1")}];"label"!==r&&n.push({caption:Object(P.translate)("TEST LABEL 2")}),function(e){switch(D()){case"native":return _(e).then(function(){C.contentWindow.print()});case"addon":return window.open(e)?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));default:return _(e),Promise.resolve()}}(function(e,t){return D()?T(e,t,!0):null}(r,n)).then(function(){e({type:z,inProgress:!1})}).catch(function(t){e({type:I,error:t})})}},H=r(556),U=function(e){var t=e.children,r=e.isWarning;return i.a.createElement(H.a,{status:r?"is-warning":"is-error",showDismiss:!1},t)};U.propTypes={isWarning:j.a.bool};var B=U,G=r(583),q=r(548),V=r(569),W=r(554),Q=r(590),J=function(e){function t(){var e,r;s()(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=p()(this,(e=d()(t)).call.apply(e,[this].concat(a))),v()(y()(r),"onPaperSizeChange",function(e){return r.props.updatePaperSize(e.target.value)}),r}return g()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.paperSize,r=e.country,n=e.printingInProgress,a=e.error,o=e.print,s=function(e){return S.a.reduce(R,function(t,r,n){var a=r.name,i=r.exclude;return i&&i(e)||(t[n]=a),t},{})}(r);return i.a.createElement(Q.a,{heading:Object(P.translate)("Print")},a&&i.a.createElement(B,null,a),i.a.createElement(W.a,null,Object(P.translate)("Having trouble configuring your printer?")),i.a.createElement("p",null,Object(P.translate)("You can run a test print for shipping labels by selecting the paper size, then print.")),i.a.createElement(q.a,null,i.a.createElement(W.a,null,Object(P.translate)("Paper size")),i.a.createElement("div",{className:"print-test-label__form-container"},i.a.createElement(V.a,{className:"print-test-label__paper-size",value:t,onChange:this.onPaperSizeChange},Object.keys(s).map(function(e){return i.a.createElement("option",{key:e,value:e},s[e])})),i.a.createElement(G.a,{type:"button",disabled:Boolean(n),onClick:o,isPrimary:!1},Object(P.translate)("Print")))))}}]),t}(a.Component);v()(J,"propTypes",{paperSize:j.a.string.isRequired,country:j.a.string.isRequired,printingInProgress:j.a.bool,error:j.a.string,updatePaperSize:j.a.func.isRequired,print:j.a.func.isRequired});var M=Object(N.b)(function(e){return e},function(e){return Object(w.b)(n,e)})(J),X=r(36),Z=r.n(X),K={};K[x]=function(e,t){var r=t.paperSize;return Z()({},e,{paperSize:r})},K[z]=function(e,t){var r=t.inProgress,n=Z()({},e,{printingInProgress:r});return r&&delete n.error,n},K[I]=function(e,t){var r=t.error;return Z()({},e,{printingInProgress:!1,error:r.toString()})};var Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return K[t.type]?K[t.type](e,t):e};t.default=function(e){var t=e.paperSize,r=e.storeOptions;return{getReducer:function(){return Y},getInitialState:function(){return{paperSize:t,country:r.origin_country}},getStateKey:function(){return"wcs-print-test-label"},View:function(){return i.a.createElement(M,null)}}}}}]);
|
dist/chunks/{af4dd931a6236fa69676.min.js → 812e0ca7b4ca31cc54d9.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{584:function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)"undefined"!==typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,o){if(!n)return e;if("object"!==typeof n){if(Array.isArray(e))e.push(n);else{if("object"!==typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!==typeof e)return[e].concat(n);var i=e;return Array.isArray(e)&&!Array.isArray(n)&&(i=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,i){r.call(e,i)?e[i]&&"object"===typeof e[i]?e[i]=t.merge(e[i],n,o):e.push(n):e[i]=n}),e):Object.keys(n).reduce(function(e,i){var a=n[i];return r.call(e,i)?e[i]=t.merge(e[i],a,o):e[i]=a,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"===typeof e?e:String(e),n="",r=0;r<t.length;++r){var i=t.charCodeAt(r);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n+=t.charAt(r):i<128?n+=o[i]:i<2048?n+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?n+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(r+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],a=Object.keys(i),s=0;s<a.length;++s){var c=a[s],l=i[c];"object"===typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:i,prop:c}),n.push(l))}return function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],o=0;o<t.length;++o)"undefined"!==typeof t[o]&&r.push(t[o]);n.obj[n.prop]=r}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},585:function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},604:function(e,t,n){"use strict";var r=n(10),o=n(528),i=n.n(o),a=n(620),s=n(618),c=n(1),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function p(e){return Object(c.get)(l,e,"")}var u=n(824),f=n(839),h=Object(s.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",p("default.fontFamily"),";font-size:",p("default.fontSize"),";"),d=Object(s.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",Object(u.a)(1),";.components-panel__row &{margin-bottom:inherit;}"),b=Object(s.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",Object(u.a)(1),";"),m=Object(s.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",Object(u.a)(1),";font-size:",p("helpText.fontSize"),";font-style:normal;color:",Object(f.a)("mediumGray.text"),";");function y(e){var t=e.id,n=e.label,o=e.hideLabelFromVision,s=e.help,c=e.className,l=e.children;return Object(r.createElement)(h,{className:i()("components-base-control",c)},Object(r.createElement)(d,{className:"components-base-control__field"},n&&t&&(o?Object(r.createElement)(a.a,{as:"label",htmlFor:t},n):Object(r.createElement)(b,{className:"components-base-control__label",htmlFor:t},n)),n&&!t&&(o?Object(r.createElement)(a.a,{as:"label"},n):Object(r.createElement)(y.VisualLabel,null,n)),l),!!s&&Object(r.createElement)(m,{id:t+"__help",className:"components-base-control__help"},s))}y.VisualLabel=function(e){var t=e.className,n=e.children;return t=i()("components-base-control__label",t),Object(r.createElement)("span",{className:t},n)};t.a=y},607:function(e,t,n){"use strict";var r=n(622),o=n(623),i=n(585);e.exports={formats:i,parse:o,stringify:r}},620:function(e,t,n){"use strict";var r=n(556),o=n(543),i=n(528),a=n.n(i),s=n(10);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}t.a=function(e){var t=e.as,n=void 0===t?"div":t,i=e.className,l=Object(o.a)(e,["as","className"]);return function(e){var t=e.as,n=void 0===t?"div":t,r=Object(o.a)(e,["as"]);return"function"===typeof r.children?r.children(r):Object(s.createElement)(n,r)}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){Object(r.a)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({as:n,className:a()("components-visually-hidden",i)},l))}},622:function(e,t,n){"use strict";var r=n(584),o=n(585),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,n,o,i,a,c,l,p,u,f,h,d){var b=t;if("function"===typeof l)b=l(n,b);else if(b instanceof Date)b=f(b);else if(null===b){if(i)return c&&!d?c(n,s.encoder):n;b=""}if("string"===typeof b||"number"===typeof b||"boolean"===typeof b||r.isBuffer(b))return c?[h(d?n:c(n,s.encoder))+"="+h(c(b,s.encoder))]:[h(n)+"="+h(String(b))];var m,y=[];if("undefined"===typeof b)return y;if(Array.isArray(l))m=l;else{var g=Object.keys(b);m=p?g.sort(p):g}for(var v=0;v<m.length;++v){var w=m[v];a&&null===b[w]||(y=Array.isArray(b)?y.concat(e(b[w],o(n,w),o,i,a,c,l,p,u,f,h,d)):y.concat(e(b[w],n+(u?"."+w:"["+w+"]"),o,i,a,c,l,p,u,f,h,d)))}return y};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!==typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l="undefined"===typeof a.delimiter?s.delimiter:a.delimiter,p="boolean"===typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,u="boolean"===typeof a.skipNulls?a.skipNulls:s.skipNulls,f="boolean"===typeof a.encode?a.encode:s.encode,h="function"===typeof a.encoder?a.encoder:s.encoder,d="function"===typeof a.sort?a.sort:null,b="undefined"!==typeof a.allowDots&&a.allowDots,m="function"===typeof a.serializeDate?a.serializeDate:s.serializeDate,y="boolean"===typeof a.encodeValuesOnly?a.encodeValuesOnly:s.encodeValuesOnly;if("undefined"===typeof a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var g,v,w=o.formatters[a.format];"function"===typeof a.filter?n=(v=a.filter)("",n):Array.isArray(a.filter)&&(g=v=a.filter);var O,j=[];if("object"!==typeof n||null===n)return"";O=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var _=i[O];g||(g=Object.keys(n)),d&&g.sort(d);for(var x=0;x<g.length;++x){var k=g[x];u&&null===n[k]||(j=j.concat(c(n[k],k,_,p,u,f?h:null,v,d,b,m,w,y)))}var E=j.join(l),L=!0===a.addQueryPrefix?"?":"";return E.length>0?L+E:""}},623:function(e,t,n){"use strict";var r=n(584),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,c=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;c.push(s)}for(var l=0;null!==(a=i.exec(r))&&l<n.depth;){if(l+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(s,10);!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(i=[])[c]=r:i[s]=r}r=i}return r}(c,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!==typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"===typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:i.delimiter,n.depth="number"===typeof n.depth?n.depth:i.depth,n.arrayLimit="number"===typeof n.arrayLimit?n.arrayLimit:i.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"===typeof n.decoder?n.decoder:i.decoder,n.allowDots="boolean"===typeof n.allowDots?n.allowDots:i.allowDots,n.plainObjects="boolean"===typeof n.plainObjects?n.plainObjects:i.plainObjects,n.allowPrototypes="boolean"===typeof n.allowPrototypes?n.allowPrototypes:i.allowPrototypes,n.parameterLimit="number"===typeof n.parameterLimit?n.parameterLimit:i.parameterLimit,n.strictNullHandling="boolean"===typeof n.strictNullHandling?n.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var s="string"===typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),c=0;c<s.length;++c){var l,p,u=s[c],f=u.indexOf("]="),h=-1===f?u.indexOf("="):f+1;-1===h?(l=t.decoder(u,i.decoder),p=t.strictNullHandling?null:""):(l=t.decoder(u.slice(0,h),i.decoder),p=t.decoder(u.slice(h+1),i.decoder)),o.call(n,l)?n[l]=[].concat(n[l]).concat(p):n[l]=p}return n}(e,n):e,c=n.plainObjects?Object.create(null):{},l=Object.keys(s),p=0;p<l.length;++p){var u=l[p],f=a(u,s[u],n);c=r.merge(c,f,n)}return r.compact(c)}},664:function(e,t,n){"use strict";var r,o;r=this,o=function(){var e=0,t=1,n=2,r=3,o=/\s/,i=/<(\w*)>/g;return function(a,s,c){a=a||"";var l,p,u,f=e,h=0,d="",b="",m=!1;for("string"===typeof s?s=function(e){for(var t,n=[];null!==(t=i.exec(e));)n.push(t[1]);return 0!==n.length?n:null}(s):Array.isArray(s)||(s=null),l=0,p=a.length;l<p;l++)switch(u=a[l]){case"<":if(m)break;if(" "==a[l+1]){y(u);break}if(f==e){f=t,y(u);break}if(f==t){h++;break}y(u);break;case">":if(h){h--;break}if(m)break;if(f==t){m=f=0,s&&(b+=">",g());break}if(f==n){m=f=0,b="";break}if(f==r&&"-"==a[l-1]&&"-"==a[l-2]){m=f=0,b="";break}y(u);break;case'"':case"'":f==t&&(m==u?m=!1:m||(m=u)),y(u);break;case"!":if(f==t&&"<"==a[l-1]){f=n;break}y(u);break;case"-":if(f==n&&"-"==a[l-1]&&"!"==a[l-2]){f=r;break}y(u);break;case"E":case"e":if(f==n&&"doctype"==a.substr(l-6,7).toLowerCase()){f=t;break}y(u);break;default:y(u)}function y(n){f==e?d+=n:s&&f==t&&(b+=n)}function g(){var e,t,n,r="",i=!1;e:for(e=0,t=b.length;e<t;e++)switch(n=b[e].toLowerCase()){case"<":break;case">":break e;case"/":i=!0;break;default:if(n.match(o)){if(i)break e}else i=!0,r+=n}-1!==s.indexOf(r)?d+=b:c&&(d+=c),b=""}return d}},"function"===typeof define&&define.amd?define([],o):e.exports?e.exports=o():r.striptags=o()},665:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(10),o=new WeakMap;function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(r.useMemo)(function(){if(n)return n;var r=function(e){var t=o.get(e)||0;return o.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(r):r},[e])}},677:function(e,t,n){(function(t){e.exports=function(){"use strict";var e=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},n=b,r=c,o=function(e){return l(c(e))},i=l,a=d,s=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function c(e){for(var t,n=[],r=0,o=0,i="";null!=(t=s.exec(e));){var a=t[0],c=t[1],l=t.index;if(i+=e.slice(o,l),o=l+a.length,c)i+=c[1];else{i&&(n.push(i),i="");var p=t[2],f=t[3],h=t[4],d=t[5],b=t[6],m=t[7],y="+"===b||"*"===b,g="?"===b||"*"===b,v=p||"/",w=h||d||(m?".*":"[^"+v+"]+?");n.push({name:f||r++,prefix:p||"",delimiter:v,optional:g,repeat:y,pattern:u(w)})}}return o<e.length&&(i+=e.substr(o)),i&&n.push(i),n}function l(t){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"===typeof t[r]&&(n[r]=new RegExp("^"+t[r].pattern+"$"));return function(r){for(var o="",i=r||{},a=0;a<t.length;a++){var s=t[a];if("string"!==typeof s){var c,l=i[s.name];if(null==l){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to be defined')}if(e(l)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received "'+l+'"');if(0===l.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var p=0;p<l.length;p++){if(c=encodeURIComponent(l[p]),!n[a].test(c))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received "'+c+'"');o+=(0===p?s.prefix:s.delimiter)+c}}else{if(c=encodeURIComponent(l),!n[a].test(c))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+c+'"');o+=s.prefix+c}}else o+=s}return o}}function p(e){return e.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function h(e){return e.sensitive?"":"i"}function d(e,t){for(var n=(t=t||{}).strict,r=!1!==t.end,o="",i=e[e.length-1],a="string"===typeof i&&/\/$/.test(i),s=0;s<e.length;s++){var c=e[s];if("string"===typeof c)o+=p(c);else{var l=p(c.prefix),u=c.pattern;c.repeat&&(u+="(?:"+l+u+")*"),u=c.optional?l?"(?:"+l+"("+u+"))?":"("+u+")?":l+"("+u+")",o+=u}}return n||(o=(a?o.slice(0,-2):o)+"(?:\\/(?=$))?"),o+=r?"$":n&&a?"":"(?=\\/|$)",new RegExp("^"+o,h(t))}function b(t,n,r){return e(n=n||[])?r||(r={}):(r=n,n=[]),t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return f(e,t)}(t,n):e(t)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(b(e[o],t,n).source);return f(new RegExp("(?:"+r.join("|")+")",h(n)),t)}(t,n,r):function(e,t,n){for(var r=c(e),o=d(r,n),i=0;i<r.length;i++)"string"!==typeof r[i]&&t.push(r[i]);return f(o,t)}(t,n,r)}n.parse=r,n.compile=o,n.tokensToFunction=i,n.tokensToRegExp=a;var m="undefined"!==typeof document,y="undefined"!==typeof history,g="undefined"!==typeof t,v=m&&document.ontouchstart?"touchstart":"click",w=!(!window.history.location&&!window.location);function O(){this.callbacks=[],this.exits=[],this.current="",this.len=0,this._decodeURLComponents=!0,this._base="",this._strict=!1,this._running=!1,this._hashbang=!1,this.clickHandler=this.clickHandler.bind(this),this._onpopstate=this._onpopstate.bind(this)}function j(e,t){if("function"===typeof e)return j.call(this,"*",e);if("function"===typeof t)for(var n=new x(e,null,this),r=1;r<arguments.length;++r)this.callbacks.push(n.middleware(arguments[r]));else"string"===typeof e?this["string"===typeof t?"redirect":"show"](e,t):this.start(e)}function _(e,t,n){var r=this.page=n||j,o=r._window,i=r._hashbang,a=r._getBase();"/"===e[0]&&0!==e.indexOf(a)&&(e=a+(i?"#!":"")+e);var s=e.indexOf("?");this.canonicalPath=e;var c=new RegExp("^"+a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1"));if(this.path=e.replace(c,"")||"/",i&&(this.path=this.path.replace("#!","")||"/"),this.title=m&&o.document.title,this.state=t||{},this.state.path=e,this.querystring=~s?r._decodeURLEncodedURIComponent(e.slice(s+1)):"",this.pathname=r._decodeURLEncodedURIComponent(~s?e.slice(0,s):e),this.params={},this.hash="",!i){if(!~this.path.indexOf("#"))return;var l=this.path.split("#");this.path=this.pathname=l[0],this.hash=r._decodeURLEncodedURIComponent(l[1])||"",this.querystring=this.querystring.split("#")[0]}}function x(e,t,r){this.page=r||k;var o=t||{};o.strict=o.strict||r._strict,this.path="*"===e?"(.*)":e,this.method="GET",this.regexp=n(this.path,this.keys=[],o)}O.prototype.configure=function(e){var t=e||{};this._window=t.window||window,this._decodeURLComponents=!1!==t.decodeURLComponents,this._popstate=!1!==t.popstate&&!0,this._click=!1!==t.click&&m,this._hashbang=!!t.hashbang;var n=this._window;this._popstate?n.addEventListener("popstate",this._onpopstate,!1):n.removeEventListener("popstate",this._onpopstate,!1),this._click?n.document.addEventListener(v,this.clickHandler,!1):m&&n.document.removeEventListener(v,this.clickHandler,!1),this._hashbang&&!y?n.addEventListener("hashchange",this._onpopstate,!1):n.removeEventListener("hashchange",this._onpopstate,!1)},O.prototype.base=function(e){if(0===arguments.length)return this._base;this._base=e},O.prototype._getBase=function(){var e=this._base;if(e)return e;var t=this._window&&this._window.location;return this._hashbang&&t&&"file:"===t.protocol&&(e=t.pathname),e},O.prototype.strict=function(e){if(0===arguments.length)return this._strict;this._strict=e},O.prototype.start=function(e){var t=e||{};if(this.configure(t),!1!==t.dispatch){var n;if(this._running=!0,w){var r=this._window,o=r.location;n=this._hashbang&&~o.hash.indexOf("#!")?o.hash.substr(2)+o.search:this._hashbang?o.search+o.hash:o.pathname+o.search+o.hash}this.replace(n,null,!0,t.dispatch)}},O.prototype.stop=function(){if(this._running){this.current="",this.len=0,this._running=!1;var e=this._window;this._click&&e.document.removeEventListener(v,this.clickHandler,!1),e.removeEventListener("popstate",this._onpopstate,!1),e.removeEventListener("hashchange",this._onpopstate,!1)}},O.prototype.show=function(e,t,n,r){var o=new _(e,t,this),i=this.prevContext;return this.prevContext=o,this.current=o.path,!1!==n&&this.dispatch(o,i),!1!==o.handled&&!1!==r&&o.pushState(),o},O.prototype.back=function(e,t){var n=this;if(this.len>0){var r=this._window;y&&r.history.back(),this.len--}else e?setTimeout(function(){n.show(e,t)}):setTimeout(function(){n.show(n._getBase(),t)})},O.prototype.redirect=function(e,t){var n=this;"string"===typeof e&&"string"===typeof t&&j.call(this,e,function(e){setTimeout(function(){n.replace(t)},0)}),"string"===typeof e&&"undefined"===typeof t&&setTimeout(function(){n.replace(e)},0)},O.prototype.replace=function(e,t,n,r){var o=new _(e,t,this),i=this.prevContext;return this.prevContext=o,this.current=o.path,o.init=n,o.save(),!1!==r&&this.dispatch(o,i),o},O.prototype.dispatch=function(e,t){var n=0,r=0,o=this;function i(){var t=o.callbacks[n++];if(e.path===o.current)return t?void t(e,i):function(e){if(!e.handled){var t=this._window;(this._hashbang?w&&this._getBase()+t.location.hash.replace("#!",""):w&&t.location.pathname+t.location.search)!==e.canonicalPath&&(this.stop(),e.handled=!1,w&&(t.location.href=e.canonicalPath))}}.call(o,e);e.handled=!1}t?function e(){var n=o.exits[r++];if(!n)return i();n(t,e)}():i()},O.prototype.exit=function(e,t){if("function"===typeof e)return this.exit("*",e);for(var n=new x(e,null,this),r=1;r<arguments.length;++r)this.exits.push(n.middleware(arguments[r]))},O.prototype.clickHandler=function(e){if(1===this._which(e)&&!(e.metaKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented){var t=e.target,n=e.path||(e.composedPath?e.composedPath():null);if(n)for(var r=0;r<n.length;r++)if(n[r].nodeName&&"A"===n[r].nodeName.toUpperCase()&&n[r].href){t=n[r];break}for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;if(t&&"A"===t.nodeName.toUpperCase()){var o="object"===typeof t.href&&"SVGAnimatedString"===t.href.constructor.name;if(!t.hasAttribute("download")&&"external"!==t.getAttribute("rel")){var i=t.getAttribute("href");if((this._hashbang||!this._samePath(t)||!t.hash&&"#"!==i)&&!(i&&i.indexOf("mailto:")>-1)&&(o?!t.target.baseVal:!t.target)&&(o||this.sameOrigin(t.href))){var a=o?t.href.baseVal:t.pathname+t.search+(t.hash||"");a="/"!==a[0]?"/"+a:a,g&&a.match(/^\/[a-zA-Z]:\//)&&(a=a.replace(/^\/[a-zA-Z]:\//,"/"));var s=a,c=this._getBase();0===a.indexOf(c)&&(a=a.substr(c.length)),this._hashbang&&(a=a.replace("#!","")),(!c||s!==a||w&&"file:"===this._window.location.protocol)&&(e.preventDefault(),this.show(s))}}}}},O.prototype._onpopstate=function(){var e=!1;return m&&"complete"===document.readyState?e=!0:window.addEventListener("load",function(){setTimeout(function(){e=!0},0)}),function(t){if(e)if(t.state){var n=t.state.path;this.replace(n,t.state)}else if(w){var r=this._window.location;this.show(r.pathname+r.search+r.hash,void 0,void 0,!1)}}}(),O.prototype._which=function(e){return null==(e=e||this._window.event).which?e.button:e.which},O.prototype._toURL=function(e){var t=this._window;if("function"===typeof URL&&w)return new URL(e,t.location.toString());if(m){var n=t.document.createElement("a");return n.href=e,n}},O.prototype.sameOrigin=function(e){if(!e||!w)return!1;var t=this._toURL(e),n=this._window,r=n.location;return r.protocol===t.protocol&&r.hostname===t.hostname&&r.port===t.port},O.prototype._samePath=function(e){if(!w)return!1;var t=this._window,n=t.location;return e.pathname===n.pathname&&e.search===n.search},O.prototype._decodeURLEncodedURIComponent=function(e){return"string"!==typeof e?e:this._decodeURLComponents?decodeURIComponent(e.replace(/\+/g," ")):e},_.prototype.pushState=function(){var e=this.page,t=e._window,n=e._hashbang;e.len++,y&&t.history.pushState(this.state,this.title,n&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},_.prototype.save=function(){var e=this.page;y&&e._window.history.replaceState(this.state,this.title,e._hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},x.prototype.middleware=function(e){var t=this;return function(n,r){if(t.match(n.path,n.params))return e(n,r);r()}},x.prototype.match=function(e,t){var n=this.keys,r=e.indexOf("?"),o=~r?e.slice(0,r):e,i=this.regexp.exec(decodeURIComponent(o));if(!i)return!1;for(var a=1,s=i.length;a<s;++a){var c=n[a-1],l=this.page._decodeURLEncodedURIComponent(i[a]);void 0===l&&hasOwnProperty.call(t,c.name)||(t[c.name]=l)}return!0};var k=function e(){var t=new O;function n(){return j.apply(t,arguments)}return n.callbacks=t.callbacks,n.exits=t.exits,n.base=t.base.bind(t),n.strict=t.strict.bind(t),n.start=t.start.bind(t),n.stop=t.stop.bind(t),n.show=t.show.bind(t),n.back=t.back.bind(t),n.redirect=t.redirect.bind(t),n.replace=t.replace.bind(t),n.dispatch=t.dispatch.bind(t),n.exit=t.exit.bind(t),n.configure=t.configure.bind(t),n.sameOrigin=t.sameOrigin.bind(t),n.clickHandler=t.clickHandler.bind(t),n.create=e,Object.defineProperty(n,"len",{get:function(){return t.len},set:function(e){t.len=e}}),Object.defineProperty(n,"current",{get:function(){return t.current},set:function(e){t.current=e}}),n.Context=_,n.Route=x,n}(),E=k,L=k;return E.default=L,E}()}).call(this,n(112))},698:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(37),o=n(543),i=n(10),a=n(665),s=n(604);function c(e){var t=e.label,n=e.hideLabelFromVision,l=e.value,p=e.help,u=e.className,f=e.onChange,h=e.type,d=void 0===h?"text":h,b=Object(o.a)(e,["label","hideLabelFromVision","value","help","className","onChange","type"]),m=Object(a.a)(c),y="inspector-text-control-".concat(m);return Object(i.createElement)(s.a,{label:t,hideLabelFromVision:n,id:y,help:p,className:u},Object(i.createElement)("input",Object(r.a)({className:"components-text-control__input",type:d,id:y,value:l,onChange:function(e){return f(e.target.value)},"aria-describedby":p?y+"__help":void 0},b)))}},796:function(e,t,n){"use strict";var r=n(37),o=n(543),i=n(10),a=n(528),s=n.n(a),c=n(1);t.a=function(e){var t=e.className,n=e.checked,a=e.id,l=e.onChange,p=void 0===l?c.noop:l,u=Object(o.a)(e,["className","checked","id","onChange"]),f=s()("components-form-toggle",t,{"is-checked":n});return Object(i.createElement)("span",{className:f},Object(i.createElement)("input",Object(r.a)({className:"components-form-toggle__input",id:a,type:"checkbox",checked:n,onChange:p},u)),Object(i.createElement)("span",{className:"components-form-toggle__track"}),Object(i.createElement)("span",{className:"components-form-toggle__thumb"}))}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{584:function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)"undefined"!==typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,o){if(!n)return e;if("object"!==typeof n){if(Array.isArray(e))e.push(n);else{if("object"!==typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!==typeof e)return[e].concat(n);var i=e;return Array.isArray(e)&&!Array.isArray(n)&&(i=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,i){r.call(e,i)?e[i]&&"object"===typeof e[i]?e[i]=t.merge(e[i],n,o):e.push(n):e[i]=n}),e):Object.keys(n).reduce(function(e,i){var a=n[i];return r.call(e,i)?e[i]=t.merge(e[i],a,o):e[i]=a,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"===typeof e?e:String(e),n="",r=0;r<t.length;++r){var i=t.charCodeAt(r);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n+=t.charAt(r):i<128?n+=o[i]:i<2048?n+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?n+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(r+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var s=a[c],l=i[s];"object"===typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:i,prop:s}),n.push(l))}return function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],o=0;o<t.length;++o)"undefined"!==typeof t[o]&&r.push(t[o]);n.obj[n.prop]=r}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},585:function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},591:function(e,t,n){"use strict";var r=n(10),o=n(528),i=n.n(o),a=n(619),c=n(617),s=n(1),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function p(e){return Object(s.get)(l,e,"")}var u=n(825),h=n(838),f=Object(c.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",p("default.fontFamily"),";font-size:",p("default.fontSize"),";"),d=Object(c.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",Object(u.a)(1),";.components-panel__row &{margin-bottom:inherit;}"),b=Object(c.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",Object(u.a)(1),";"),m=Object(c.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",Object(u.a)(1),";font-size:",p("helpText.fontSize"),";font-style:normal;color:",Object(h.a)("mediumGray.text"),";");function y(e){var t=e.id,n=e.label,o=e.hideLabelFromVision,c=e.help,s=e.className,l=e.children;return Object(r.createElement)(f,{className:i()("components-base-control",s)},Object(r.createElement)(d,{className:"components-base-control__field"},n&&t&&(o?Object(r.createElement)(a.a,{as:"label",htmlFor:t},n):Object(r.createElement)(b,{className:"components-base-control__label",htmlFor:t},n)),n&&!t&&(o?Object(r.createElement)(a.a,{as:"label"},n):Object(r.createElement)(y.VisualLabel,null,n)),l),!!c&&Object(r.createElement)(m,{id:t+"__help",className:"components-base-control__help"},c))}y.VisualLabel=function(e){var t=e.className,n=e.children;return t=i()("components-base-control__label",t),Object(r.createElement)("span",{className:t},n)};t.a=y},607:function(e,t,n){"use strict";var r=n(623),o=n(624),i=n(585);e.exports={formats:i,parse:o,stringify:r}},619:function(e,t,n){"use strict";var r=n(553),o=n(543),i=n(528),a=n.n(i),c=n(10);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}t.a=function(e){var t=e.as,n=void 0===t?"div":t,i=e.className,l=Object(o.a)(e,["as","className"]);return function(e){var t=e.as,n=void 0===t?"div":t,r=Object(o.a)(e,["as"]);return"function"===typeof r.children?r.children(r):Object(c.createElement)(n,r)}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){Object(r.a)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({as:n,className:a()("components-visually-hidden",i)},l))}},623:function(e,t,n){"use strict";var r=n(584),o=n(585),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},s=function e(t,n,o,i,a,s,l,p,u,h,f,d){var b=t;if("function"===typeof l)b=l(n,b);else if(b instanceof Date)b=h(b);else if(null===b){if(i)return s&&!d?s(n,c.encoder):n;b=""}if("string"===typeof b||"number"===typeof b||"boolean"===typeof b||r.isBuffer(b))return s?[f(d?n:s(n,c.encoder))+"="+f(s(b,c.encoder))]:[f(n)+"="+f(String(b))];var m,y=[];if("undefined"===typeof b)return y;if(Array.isArray(l))m=l;else{var g=Object.keys(b);m=p?g.sort(p):g}for(var v=0;v<m.length;++v){var w=m[v];a&&null===b[w]||(y=Array.isArray(b)?y.concat(e(b[w],o(n,w),o,i,a,s,l,p,u,h,f,d)):y.concat(e(b[w],n+(u?"."+w:"["+w+"]"),o,i,a,s,l,p,u,h,f,d)))}return y};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!==typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l="undefined"===typeof a.delimiter?c.delimiter:a.delimiter,p="boolean"===typeof a.strictNullHandling?a.strictNullHandling:c.strictNullHandling,u="boolean"===typeof a.skipNulls?a.skipNulls:c.skipNulls,h="boolean"===typeof a.encode?a.encode:c.encode,f="function"===typeof a.encoder?a.encoder:c.encoder,d="function"===typeof a.sort?a.sort:null,b="undefined"!==typeof a.allowDots&&a.allowDots,m="function"===typeof a.serializeDate?a.serializeDate:c.serializeDate,y="boolean"===typeof a.encodeValuesOnly?a.encodeValuesOnly:c.encodeValuesOnly;if("undefined"===typeof a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var g,v,w=o.formatters[a.format];"function"===typeof a.filter?n=(v=a.filter)("",n):Array.isArray(a.filter)&&(g=v=a.filter);var O,j=[];if("object"!==typeof n||null===n)return"";O=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var _=i[O];g||(g=Object.keys(n)),d&&g.sort(d);for(var x=0;x<g.length;++x){var k=g[x];u&&null===n[k]||(j=j.concat(s(n[k],k,_,p,u,h?f:null,v,d,b,m,w,y)))}var E=j.join(l),N=!0===a.addQueryPrefix?"?":"";return E.length>0?N+E:""}},624:function(e,t,n){"use strict";var r=n(584),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),c=a?r.slice(0,a.index):r,s=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;s.push(c)}for(var l=0;null!==(a=i.exec(r))&&l<n.depth;){if(l+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(r);else{i=n.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,s=parseInt(c,10);!isNaN(s)&&a!==c&&String(s)===c&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(i=[])[s]=r:i[c]=r}r=i}return r}(s,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!==typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"===typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:i.delimiter,n.depth="number"===typeof n.depth?n.depth:i.depth,n.arrayLimit="number"===typeof n.arrayLimit?n.arrayLimit:i.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"===typeof n.decoder?n.decoder:i.decoder,n.allowDots="boolean"===typeof n.allowDots?n.allowDots:i.allowDots,n.plainObjects="boolean"===typeof n.plainObjects?n.plainObjects:i.plainObjects,n.allowPrototypes="boolean"===typeof n.allowPrototypes?n.allowPrototypes:i.allowPrototypes,n.parameterLimit="number"===typeof n.parameterLimit?n.parameterLimit:i.parameterLimit,n.strictNullHandling="boolean"===typeof n.strictNullHandling?n.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var c="string"===typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,c=r.split(t.delimiter,a),s=0;s<c.length;++s){var l,p,u=c[s],h=u.indexOf("]="),f=-1===h?u.indexOf("="):h+1;-1===f?(l=t.decoder(u,i.decoder),p=t.strictNullHandling?null:""):(l=t.decoder(u.slice(0,f),i.decoder),p=t.decoder(u.slice(f+1),i.decoder)),o.call(n,l)?n[l]=[].concat(n[l]).concat(p):n[l]=p}return n}(e,n):e,s=n.plainObjects?Object.create(null):{},l=Object.keys(c),p=0;p<l.length;++p){var u=l[p],h=a(u,c[u],n);s=r.merge(s,h,n)}return r.compact(s)}},663:function(e,t,n){"use strict";var r,o;r=this,o=function(){var e=0,t=1,n=2,r=3,o=/\s/,i=/<(\w*)>/g;return function(a,c,s){a=a||"";var l,p,u,h=e,f=0,d="",b="",m=!1;for("string"===typeof c?c=function(e){for(var t,n=[];null!==(t=i.exec(e));)n.push(t[1]);return 0!==n.length?n:null}(c):Array.isArray(c)||(c=null),l=0,p=a.length;l<p;l++)switch(u=a[l]){case"<":if(m)break;if(" "==a[l+1]){y(u);break}if(h==e){h=t,y(u);break}if(h==t){f++;break}y(u);break;case">":if(f){f--;break}if(m)break;if(h==t){m=h=0,c&&(b+=">",g());break}if(h==n){m=h=0,b="";break}if(h==r&&"-"==a[l-1]&&"-"==a[l-2]){m=h=0,b="";break}y(u);break;case'"':case"'":h==t&&(m==u?m=!1:m||(m=u)),y(u);break;case"!":if(h==t&&"<"==a[l-1]){h=n;break}y(u);break;case"-":if(h==n&&"-"==a[l-1]&&"!"==a[l-2]){h=r;break}y(u);break;case"E":case"e":if(h==n&&"doctype"==a.substr(l-6,7).toLowerCase()){h=t;break}y(u);break;default:y(u)}function y(n){h==e?d+=n:c&&h==t&&(b+=n)}function g(){var e,t,n,r="",i=!1;e:for(e=0,t=b.length;e<t;e++)switch(n=b[e].toLowerCase()){case"<":break;case">":break e;case"/":i=!0;break;default:if(n.match(o)){if(i)break e}else i=!0,r+=n}-1!==c.indexOf(r)?d+=b:s&&(d+=s),b=""}return d}},"function"===typeof define&&define.amd?define([],o):e.exports?e.exports=o():r.striptags=o()},664:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(10),o=new WeakMap;function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(r.useMemo)(function(){if(n)return n;var r=function(e){var t=o.get(e)||0;return o.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(r):r},[e])}},676:function(e,t,n){(function(t){e.exports=function(){"use strict";var e=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},n=b,r=s,o=function(e){return l(s(e))},i=l,a=d,c=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e){for(var t,n=[],r=0,o=0,i="";null!=(t=c.exec(e));){var a=t[0],s=t[1],l=t.index;if(i+=e.slice(o,l),o=l+a.length,s)i+=s[1];else{i&&(n.push(i),i="");var p=t[2],h=t[3],f=t[4],d=t[5],b=t[6],m=t[7],y="+"===b||"*"===b,g="?"===b||"*"===b,v=p||"/",w=f||d||(m?".*":"[^"+v+"]+?");n.push({name:h||r++,prefix:p||"",delimiter:v,optional:g,repeat:y,pattern:u(w)})}}return o<e.length&&(i+=e.substr(o)),i&&n.push(i),n}function l(t){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"===typeof t[r]&&(n[r]=new RegExp("^"+t[r].pattern+"$"));return function(r){for(var o="",i=r||{},a=0;a<t.length;a++){var c=t[a];if("string"!==typeof c){var s,l=i[c.name];if(null==l){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to be defined')}if(e(l)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received "'+l+'"');if(0===l.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<l.length;p++){if(s=encodeURIComponent(l[p]),!n[a].test(s))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received "'+s+'"');o+=(0===p?c.prefix:c.delimiter)+s}}else{if(s=encodeURIComponent(l),!n[a].test(s))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+s+'"');o+=c.prefix+s}}else o+=c}return o}}function p(e){return e.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function h(e,t){return e.keys=t,e}function f(e){return e.sensitive?"":"i"}function d(e,t){for(var n=(t=t||{}).strict,r=!1!==t.end,o="",i=e[e.length-1],a="string"===typeof i&&/\/$/.test(i),c=0;c<e.length;c++){var s=e[c];if("string"===typeof s)o+=p(s);else{var l=p(s.prefix),u=s.pattern;s.repeat&&(u+="(?:"+l+u+")*"),u=s.optional?l?"(?:"+l+"("+u+"))?":"("+u+")?":l+"("+u+")",o+=u}}return n||(o=(a?o.slice(0,-2):o)+"(?:\\/(?=$))?"),o+=r?"$":n&&a?"":"(?=\\/|$)",new RegExp("^"+o,f(t))}function b(t,n,r){return e(n=n||[])?r||(r={}):(r=n,n=[]),t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return h(e,t)}(t,n):e(t)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(b(e[o],t,n).source);return h(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(t,n,r):function(e,t,n){for(var r=s(e),o=d(r,n),i=0;i<r.length;i++)"string"!==typeof r[i]&&t.push(r[i]);return h(o,t)}(t,n,r)}n.parse=r,n.compile=o,n.tokensToFunction=i,n.tokensToRegExp=a;var m="undefined"!==typeof document,y="undefined"!==typeof history,g="undefined"!==typeof t,v=m&&document.ontouchstart?"touchstart":"click",w=!(!window.history.location&&!window.location);function O(){this.callbacks=[],this.exits=[],this.current="",this.len=0,this._decodeURLComponents=!0,this._base="",this._strict=!1,this._running=!1,this._hashbang=!1,this.clickHandler=this.clickHandler.bind(this),this._onpopstate=this._onpopstate.bind(this)}function j(e,t){if("function"===typeof e)return j.call(this,"*",e);if("function"===typeof t)for(var n=new x(e,null,this),r=1;r<arguments.length;++r)this.callbacks.push(n.middleware(arguments[r]));else"string"===typeof e?this["string"===typeof t?"redirect":"show"](e,t):this.start(e)}function _(e,t,n){var r=this.page=n||j,o=r._window,i=r._hashbang,a=r._getBase();"/"===e[0]&&0!==e.indexOf(a)&&(e=a+(i?"#!":"")+e);var c=e.indexOf("?");this.canonicalPath=e;var s=new RegExp("^"+a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1"));if(this.path=e.replace(s,"")||"/",i&&(this.path=this.path.replace("#!","")||"/"),this.title=m&&o.document.title,this.state=t||{},this.state.path=e,this.querystring=~c?r._decodeURLEncodedURIComponent(e.slice(c+1)):"",this.pathname=r._decodeURLEncodedURIComponent(~c?e.slice(0,c):e),this.params={},this.hash="",!i){if(!~this.path.indexOf("#"))return;var l=this.path.split("#");this.path=this.pathname=l[0],this.hash=r._decodeURLEncodedURIComponent(l[1])||"",this.querystring=this.querystring.split("#")[0]}}function x(e,t,r){this.page=r||k;var o=t||{};o.strict=o.strict||r._strict,this.path="*"===e?"(.*)":e,this.method="GET",this.regexp=n(this.path,this.keys=[],o)}O.prototype.configure=function(e){var t=e||{};this._window=t.window||window,this._decodeURLComponents=!1!==t.decodeURLComponents,this._popstate=!1!==t.popstate&&!0,this._click=!1!==t.click&&m,this._hashbang=!!t.hashbang;var n=this._window;this._popstate?n.addEventListener("popstate",this._onpopstate,!1):n.removeEventListener("popstate",this._onpopstate,!1),this._click?n.document.addEventListener(v,this.clickHandler,!1):m&&n.document.removeEventListener(v,this.clickHandler,!1),this._hashbang&&!y?n.addEventListener("hashchange",this._onpopstate,!1):n.removeEventListener("hashchange",this._onpopstate,!1)},O.prototype.base=function(e){if(0===arguments.length)return this._base;this._base=e},O.prototype._getBase=function(){var e=this._base;if(e)return e;var t=this._window&&this._window.location;return this._hashbang&&t&&"file:"===t.protocol&&(e=t.pathname),e},O.prototype.strict=function(e){if(0===arguments.length)return this._strict;this._strict=e},O.prototype.start=function(e){var t=e||{};if(this.configure(t),!1!==t.dispatch){var n;if(this._running=!0,w){var r=this._window,o=r.location;n=this._hashbang&&~o.hash.indexOf("#!")?o.hash.substr(2)+o.search:this._hashbang?o.search+o.hash:o.pathname+o.search+o.hash}this.replace(n,null,!0,t.dispatch)}},O.prototype.stop=function(){if(this._running){this.current="",this.len=0,this._running=!1;var e=this._window;this._click&&e.document.removeEventListener(v,this.clickHandler,!1),e.removeEventListener("popstate",this._onpopstate,!1),e.removeEventListener("hashchange",this._onpopstate,!1)}},O.prototype.show=function(e,t,n,r){var o=new _(e,t,this),i=this.prevContext;return this.prevContext=o,this.current=o.path,!1!==n&&this.dispatch(o,i),!1!==o.handled&&!1!==r&&o.pushState(),o},O.prototype.back=function(e,t){var n=this;if(this.len>0){var r=this._window;y&&r.history.back(),this.len--}else e?setTimeout(function(){n.show(e,t)}):setTimeout(function(){n.show(n._getBase(),t)})},O.prototype.redirect=function(e,t){var n=this;"string"===typeof e&&"string"===typeof t&&j.call(this,e,function(e){setTimeout(function(){n.replace(t)},0)}),"string"===typeof e&&"undefined"===typeof t&&setTimeout(function(){n.replace(e)},0)},O.prototype.replace=function(e,t,n,r){var o=new _(e,t,this),i=this.prevContext;return this.prevContext=o,this.current=o.path,o.init=n,o.save(),!1!==r&&this.dispatch(o,i),o},O.prototype.dispatch=function(e,t){var n=0,r=0,o=this;function i(){var t=o.callbacks[n++];if(e.path===o.current)return t?void t(e,i):function(e){if(!e.handled){var t=this._window;(this._hashbang?w&&this._getBase()+t.location.hash.replace("#!",""):w&&t.location.pathname+t.location.search)!==e.canonicalPath&&(this.stop(),e.handled=!1,w&&(t.location.href=e.canonicalPath))}}.call(o,e);e.handled=!1}t?function e(){var n=o.exits[r++];if(!n)return i();n(t,e)}():i()},O.prototype.exit=function(e,t){if("function"===typeof e)return this.exit("*",e);for(var n=new x(e,null,this),r=1;r<arguments.length;++r)this.exits.push(n.middleware(arguments[r]))},O.prototype.clickHandler=function(e){if(1===this._which(e)&&!(e.metaKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented){var t=e.target,n=e.path||(e.composedPath?e.composedPath():null);if(n)for(var r=0;r<n.length;r++)if(n[r].nodeName&&"A"===n[r].nodeName.toUpperCase()&&n[r].href){t=n[r];break}for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;if(t&&"A"===t.nodeName.toUpperCase()){var o="object"===typeof t.href&&"SVGAnimatedString"===t.href.constructor.name;if(!t.hasAttribute("download")&&"external"!==t.getAttribute("rel")){var i=t.getAttribute("href");if((this._hashbang||!this._samePath(t)||!t.hash&&"#"!==i)&&!(i&&i.indexOf("mailto:")>-1)&&(o?!t.target.baseVal:!t.target)&&(o||this.sameOrigin(t.href))){var a=o?t.href.baseVal:t.pathname+t.search+(t.hash||"");a="/"!==a[0]?"/"+a:a,g&&a.match(/^\/[a-zA-Z]:\//)&&(a=a.replace(/^\/[a-zA-Z]:\//,"/"));var c=a,s=this._getBase();0===a.indexOf(s)&&(a=a.substr(s.length)),this._hashbang&&(a=a.replace("#!","")),(!s||c!==a||w&&"file:"===this._window.location.protocol)&&(e.preventDefault(),this.show(c))}}}}},O.prototype._onpopstate=function(){var e=!1;return m&&"complete"===document.readyState?e=!0:window.addEventListener("load",function(){setTimeout(function(){e=!0},0)}),function(t){if(e)if(t.state){var n=t.state.path;this.replace(n,t.state)}else if(w){var r=this._window.location;this.show(r.pathname+r.search+r.hash,void 0,void 0,!1)}}}(),O.prototype._which=function(e){return null==(e=e||this._window.event).which?e.button:e.which},O.prototype._toURL=function(e){var t=this._window;if("function"===typeof URL&&w)return new URL(e,t.location.toString());if(m){var n=t.document.createElement("a");return n.href=e,n}},O.prototype.sameOrigin=function(e){if(!e||!w)return!1;var t=this._toURL(e),n=this._window,r=n.location;return r.protocol===t.protocol&&r.hostname===t.hostname&&r.port===t.port},O.prototype._samePath=function(e){if(!w)return!1;var t=this._window,n=t.location;return e.pathname===n.pathname&&e.search===n.search},O.prototype._decodeURLEncodedURIComponent=function(e){return"string"!==typeof e?e:this._decodeURLComponents?decodeURIComponent(e.replace(/\+/g," ")):e},_.prototype.pushState=function(){var e=this.page,t=e._window,n=e._hashbang;e.len++,y&&t.history.pushState(this.state,this.title,n&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},_.prototype.save=function(){var e=this.page;y&&e._window.history.replaceState(this.state,this.title,e._hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},x.prototype.middleware=function(e){var t=this;return function(n,r){if(t.match(n.path,n.params))return e(n,r);r()}},x.prototype.match=function(e,t){var n=this.keys,r=e.indexOf("?"),o=~r?e.slice(0,r):e,i=this.regexp.exec(decodeURIComponent(o));if(!i)return!1;for(var a=1,c=i.length;a<c;++a){var s=n[a-1],l=this.page._decodeURLEncodedURIComponent(i[a]);void 0===l&&hasOwnProperty.call(t,s.name)||(t[s.name]=l)}return!0};var k=function e(){var t=new O;function n(){return j.apply(t,arguments)}return n.callbacks=t.callbacks,n.exits=t.exits,n.base=t.base.bind(t),n.strict=t.strict.bind(t),n.start=t.start.bind(t),n.stop=t.stop.bind(t),n.show=t.show.bind(t),n.back=t.back.bind(t),n.redirect=t.redirect.bind(t),n.replace=t.replace.bind(t),n.dispatch=t.dispatch.bind(t),n.exit=t.exit.bind(t),n.configure=t.configure.bind(t),n.sameOrigin=t.sameOrigin.bind(t),n.clickHandler=t.clickHandler.bind(t),n.create=e,Object.defineProperty(n,"len",{get:function(){return t.len},set:function(e){t.len=e}}),Object.defineProperty(n,"current",{get:function(){return t.current},set:function(e){t.current=e}}),n.Context=_,n.Route=x,n}(),E=k,N=k;return E.default=N,E}()}).call(this,n(112))},697:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(37),o=n(543),i=n(10),a=n(664),c=n(591);function s(e){var t=e.label,n=e.hideLabelFromVision,l=e.value,p=e.help,u=e.className,h=e.onChange,f=e.type,d=void 0===f?"text":f,b=Object(o.a)(e,["label","hideLabelFromVision","value","help","className","onChange","type"]),m=Object(a.a)(s),y="inspector-text-control-".concat(m);return Object(i.createElement)(c.a,{label:t,hideLabelFromVision:n,id:y,help:p,className:u},Object(i.createElement)("input",Object(r.a)({className:"components-text-control__input",type:d,id:y,value:l,onChange:function(e){return h(e.target.value)},"aria-describedby":p?y+"__help":void 0},b)))}},795:function(e,t,n){"use strict";var r=n(37),o=n(543),i=n(10),a=n(528),c=n.n(a),s=n(1);t.a=function(e){var t=e.className,n=e.checked,a=e.id,l=e.onChange,p=void 0===l?s.noop:l,u=Object(o.a)(e,["className","checked","id","onChange"]),h=c()("components-form-toggle",t,{"is-checked":n});return Object(i.createElement)("span",{className:h},Object(i.createElement)("input",Object(r.a)({className:"components-form-toggle__input",id:a,type:"checkbox",checked:n,onChange:p},u)),Object(i.createElement)("span",{className:"components-form-toggle__track"}),Object(i.createElement)("span",{className:"components-form-toggle__thumb"}))}},806:function(e,t,n){"use strict";var r=n(553),o=n(543),i=n(10);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}t.a=function(e){var t=e.icon,n=e.size,c=void 0===n?24:n,s=Object(o.a)(e,["icon","size"]);return Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){Object(r.a)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({width:c,height:c},s))}},821:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(37),o=n(543),i=n(10),a=n(664),c=n(806),s=n(823),l=Object(i.createElement)(s.b,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(s.a,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),p=n(591);function u(e){var t=e.label,n=e.className,s=e.heading,h=e.checked,f=e.help,d=e.onChange,b=Object(o.a)(e,["label","className","heading","checked","help","onChange"]),m=Object(a.a)(u),y="inspector-checkbox-control-".concat(m);return Object(i.createElement)(p.a,{label:s,id:y,help:f,className:n},Object(i.createElement)("span",{className:"components-checkbox-control__input-container"},Object(i.createElement)("input",Object(r.a)({id:y,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return d(e.target.checked)},checked:h,"aria-describedby":f?y+"__help":void 0},b)),h?Object(i.createElement)(c.a,{icon:l,className:"components-checkbox-control__checked",role:"presentation"}):null),Object(i.createElement)("label",{className:"components-checkbox-control__label",htmlFor:y},t))}}}]);
|
dist/chunks/922491ee86553d15c65f.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{551:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(535),i=a.n(s),c=a(10),o=a.n(c),l=a(12),u=a.n(l),d=a(528),m=a.n(d),p=a(34),g=function(e){var t=e.children,a=e.required,n=e.optional,s=e.translate,c=e.className,l=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),u=i()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),d=l?null:o.a.createElement(o.a.Fragment,null,t,a&&o.a.createElement("small",{className:"form-label__required"},s("Required")),n&&o.a.createElement("small",{className:"form-label__optional"},s("Optional")));return o.a.createElement("label",r()({},u,{dangerouslySetInnerHTML:l,className:m()(c,"form-label")}),d)};g.propTypes={required:u.a.bool,optional:u.a.bool,children:u.a.node},t.a=Object(p.localize)(g)},555:function(e,t,a){"use strict";var n=a(107),r=a.n(n),s=a(108),i=a.n(s),c=a(530),o=a.n(c),l=a(529),u=a.n(l),d=a(534),m=a.n(d),p=a(531),g=a.n(p),f=a(35),b=a.n(f),h=a(12),v=a.n(h),_=a(10),y=a.n(_),k=a(528),E=a.n(k),O=a(1),j=a(34),I=a(537),N=a.n(I);a(568);function R(e){var t=e.children;return y.a.createElement("span",{className:"screen-reader-text"},t)}var C=function(e){function t(){var e,a;r()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=o()(this,(e=u()(t)).call.apply(e,[this].concat(s))),b()(m()(a),"dismissTimeout",null),a}return g()(t,e),i()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.icon,r=e.isCompact,s=e.isLoading,i=e.onDismissClick,c=e.showDismiss,o=void 0===c?!r:c,l=e.status,u=e.text,d=e.translate,m=E()("notice",l,a,{"is-compact":r,"is-loading":s,"is-dismissable":o});return y.a.createElement("div",{className:m},y.a.createElement("span",{className:"notice__icon-wrapper"},y.a.createElement(N.a,{className:"notice__icon",icon:n||this.getIcon(),size:24})),y.a.createElement("span",{className:"notice__content"},y.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,o&&y.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:i},y.a.createElement(N.a,{icon:"cross",size:24}),y.a.createElement(R,null,d("Dismiss"))))}}]),t}(_.Component);b()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:O.noop,status:null,text:null}),b()(C,"propTypes",{className:v.a.string,duration:v.a.number,icon:v.a.string,isCompact:v.a.bool,isLoading:v.a.bool,onDismissClick:v.a.func,showDismiss:v.a.bool,status:v.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:v.a.oneOfType([v.a.arrayOf(v.a.oneOfType([v.a.string,v.a.node])),v.a.oneOfType([v.a.string,v.a.node])]),translate:v.a.func.isRequired});t.a=Object(j.localize)(C)},568:function(e,t,a){},580:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(528),o=a.n(c),l=a(698),u=a(548),d=a(552),m=a(557),p=function(e){var t=e.id,a=e.title,s=e.description,i=e.value,c=e.placeholder,p=e.updateValue,g=e.error,f=e.className,b=e.defaultValue,h=Object(n.useCallback)(function(e){return p(e,t)},[p]),v=o()("form-text-input",{"is-error":Boolean(g)});return r.a.createElement(u.a,{className:f},r.a.createElement(l.a,{label:a,name:t,placeholder:c,value:i,onChange:h,className:v,defaultValue:b}),g&&"string"===typeof g&&r.a.createElement(d.a,{text:g}),!g&&s&&r.a.createElement(m.a,null,s))};p.propTypes={id:i.a.string.isRequired,title:i.a.node,description:i.a.string,value:i.a.string,defaultValue:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string},t.a=p},583:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(535),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(530),m=a.n(d),p=a(529),g=a.n(p),f=a(534),b=a.n(f),h=a(531),v=a.n(h),_=a(35),y=a.n(_),k=a(528),E=a.n(k),O=a(34),j=a(1),I=a(10),N=a.n(I),R=a(582),C=function(e){function t(){var e,a;o()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=m()(this,(e=g()(t)).call.apply(e,[this].concat(r))),y()(b()(a),"getDefaultButtonAction",function(){return a.props.isSubmitting?a.props.translate("Saving\u2026"):a.props.translate("Save Settings")}),a}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.isPrimary,s=i()(e,["children","className","isPrimary"]),c=E()(a,"form-button");return N.a.createElement(R.a,r()({},Object(j.omit)(s,["isSubmitting","moment","numberFormat","translate"]),{primary:n,className:c}),I.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(N.a.Component);y()(C,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(O.localize)(C)},599:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(528),u=a.n(l),d=a(537),m=a.n(d),p=a(1),g=function(e){var t=e.className,a=e.disabled,n=e.checked,s=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return i.a.createElement("span",{className:u()(t,"form-checkbox",{"is-disabled":a})},i.a.createElement("input",r()({},c,{type:"checkbox"})),n&&i.a.createElement(m.a,{icon:"checkmark",size:14}),!n&&s&&i.a.createElement(m.a,{icon:"minus-small",size:16}))};g.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=g},602:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(535),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(530),m=a.n(d),p=a(529),g=a.n(p),f=a(531),b=a.n(f),h=a(10),v=a.n(h),_=a(12),y=a.n(_),k=a(604),E=a(528),O=a.n(E),j=function(e){function t(e){var a;return o()(this,t),(a=m()(this,g()(t).call(this,e))).state={isFocused:!1},a}return b()(t,e),u()(t,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"===typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.props,a=t.label,n=t.value,s=t.help,c=t.className,o=t.instanceId,l=t.onChange,u=t.onClick,d=t.prefix,m=t.suffix,p=t.type,g=t.disabled,f=i()(t,["label","value","help","className","instanceId","onChange","onClick","prefix","suffix","type","disabled"]),b=this.state.isFocused,h="inspector-text-control-with-affixes-".concat(o),_=[];s&&_.push("".concat(h,"__help")),d&&_.push("".concat(h,"__prefix")),m&&_.push("".concat(h,"__suffix"));var y=O()(c,{"with-value":""!==n,empty:""===n,active:b&&!g}),E=O()("text-control-with-affixes",{"text-control-with-prefix":d,"text-control-with-suffix":m,disabled:g});return v.a.createElement(k.a,{label:a,id:h,help:s,className:y,onClick:function(t){return e.handleOnClick(t,u)}},v.a.createElement("div",{className:E},d&&v.a.createElement("span",{id:"".concat(h,"__prefix"),className:"text-control-with-affixes__prefix"},d),v.a.createElement("input",r()({className:"components-text-control__input",type:p,id:h,value:n,onChange:function(e){return l(e.target.value)},"aria-describedby":_.join(" "),disabled:g,onFocus:function(){return e.setState({isFocused:!0})}},f)),m&&v.a.createElement("span",{id:"".concat(h,"__suffix"),className:"text-control-with-affixes__suffix"},m)))}}]),t}(h.Component);j.defaultProps={type:"text"},j.propTypes={label:y.a.string,help:y.a.string,type:y.a.string,value:y.a.oneOfType([y.a.string,y.a.number]).isRequired,className:y.a.string,onChange:y.a.func.isRequired,prefix:y.a.node,suffix:y.a.node,disabled:y.a.bool},t.a=j},616:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(535),i=a.n(s),c=a(10),o=a.n(c),l=a(528),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"checkbox",className:u()(t,"form-checkbox")}))}},635:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(680),o=a.n(c),l=a(681),u=a.n(l),d=a(682),m=a.n(d),p={ups:o.a,usps:u.a,dhlexpress:m.a,dhlecommerce:m.a,dhlecommerceasia:m.a},g=function(e){var t=e.carrier,a=e.size;if(!t||!p[t.toLowerCase()])return r.a.createElement("span",null);var n="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(a),"px");return r.a.createElement("div",{style:{width:n},className:"carrier-icon"},r.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};g.propTypes={carrier:i.a.string.isRequired,size:i.a.number},t.a=g},645:function(e,t,a){"use strict";var n=a(533),r=a.n(n),s=a(535),i=a.n(s),c=a(10),o=a.n(c),l=a(528),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"radio",className:u()(t,"form-radio")}))}},649:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(34),o=a(1),l=a(537),u=a.n(l),d=a(528),m=a.n(d),p=function(e){var t=e.isPlaceholder,a=e.data,n=e.dimensionUnit,s=e.prefixActions,i=(e.hasError,e.children),c=e.translate;if(t)return r.a.createElement("div",{className:"packages__packages-row placeholder"},r.a.createElement("div",{className:"packages__packages-row-icon"},r.a.createElement(u.a,{icon:"product",size:18})),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},r.a.createElement("span",null))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},r.a.createElement("span",null)),r.a.createElement("div",{className:"packages__packages-row-actions"},i));var l,d=function(){return r.a.createElement("div",{className:"packages__packages-row-actions"},i)};return r.a.createElement("div",{className:m()("packages__packages-row",{prefixed:s})},s?d():null,r.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return r.a.createElement(u.a,{icon:t,size:18})}(a.is_letter)),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},(l=a.name)&&""!==Object(o.trim)(l)?l:c("Untitled"))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},a.inner_dimensions," ",n),s?null:d())};p.propTypes={siteId:i.a.number.isRequired,isPlaceholder:i.a.bool,data:i.a.shape({name:i.a.string,is_letter:i.a.bool,inner_dimensions:i.a.string}).isRequired,prefixActions:i.a.bool,dimensionUnit:i.a.string},t.a=Object(c.localize)(p)},650:function(e,t,a){"use strict";a.d(t,"a",function(){return r});var n=a(538);function r(e,t,a){return{type:n.L,successAction:e,failureAction:t,onlyPackages:a||!1}}},680:function(e,t,a){e.exports=a.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},681:function(e,t,a){e.exports=a.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},682:function(e,t,a){e.exports=a.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},683:function(e,t,a){"use strict";var n=a(36),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(109),u=a(34),d=a(1),m=a(537),p=a.n(m),g=a(35),f=a.n(g),b=a(698),h=a(107),v=a.n(h),_=a(108),y=a.n(_),k=a(530),E=a.n(k),O=a(529),j=a.n(O),I=a(531),N=a.n(I),R=a(30),C=a(528),q=a.n(C);function x(e){return Object(d.get)(e,["currentUser","id"])}function w(e){var t=x(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(a){var n=w(a);return Object(d.get)(n,e,t)}};S("localeSlug"),S("localeVariant"),S("user_ip_country_code");S("date"),S("username"),S("email");S("email_verified",!1);var P=a(536),T=a(565);function z(e){var t=Object(P.a)(e);return t||1!==function(e){var t=w(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=w(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(T.a)(e,t)}var D=a(542),A=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e);return Object(d.isArray)(A(e,t))},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e);return D.b===A(e,t)};function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(P.a)(e),a=A(e,t);return Object(d.find)(a,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var F=a(572),L=a(563),W=a(538),B=function(e){return function(t,a){if(!U(a(),e)&&!V(a(),e)){var n={type:W.N,siteId:e};return t(n),Object(F.a)(e).get("settings/products").then(function(a){t({type:W.O,siteId:e,data:a})}).catch(function(a){t(Object(L.a)(e,n,a))})}}},H=a(602),Y=function(e){function t(){return v()(this,t),E()(this,j()(t).apply(this,arguments))}return N()(t,e),y()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.noWrap,n=e.dimensions,r=e.onChange,s=e.translate,c=e.dimensionsUnit,o=q()("form-dimensions-input",t,{"no-wrap":a});return i.a.createElement("div",{className:o},i.a.createElement(b.a,{name:"length",placeholder:s("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:n&&n.length||"",onChange:function(e){return r(e,"length")},className:"form-dimensions-input__length"}),i.a.createElement(b.a,{name:"width",placeholder:s("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:n&&n.width||"",onChange:function(e){return r(e,"width")},className:"form-dimensions-input__width"}),i.a.createElement(H.a,{name:"height",placeholder:s("H",{comment:"Height placeholder for dimensions input"}),suffix:c,type:"number",value:n&&n.height||"",onChange:function(e){return r(e,"height")},className:"form-dimensions-input__height"}))}}]),t}(s.Component);f()(Y,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),f()(Y,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var $=Object(l.b)(function(e,t){var a=t.dimensionsUnit,n=z(e);if(!a){var r=n&&M(e,n.ID);a=r&&r.value||"in"}return{siteId:n&&n.ID,dimensionsUnit:a}},function(e){return Object(R.b)({fetchSettingsProducts:B},e)})(Object(u.localize)(Y)),G=a(548),K=a(551),J=a(569),Q=a(552),X=/^\.\d+$/,Z=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:Z.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ae=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,ne=function(e){return isNaN(e)?"":0>e?"":e},re=function(e){var t="",a="",n="",r=ae.exec(e);return r&&4===r.length&&(t=ne(r[1]),a=ne(r[2]),n=ne(r[3])),{length:t,width:a,height:n}},se=function(e){return Object(d.trim)(e)},ie=ee,ce=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=re,le=function(e){var t=re(e),a=t.length,n=t.width,r=t.height;return 0<a&&0<n&&0<r},ue=function(e){var t=e.siteId,a=e.form,n=e.setModalErrors,r=e.updatePackagesField,s=e.translate,c=a.mode,o=a.modalErrors,l=a.dimensionUnit,u=a.weightUnit,m=a.packageData,p=m.name,g=m.inner_dimensions,h=m.box_weight,v=m.is_letter,_=function(e,a){n(t,Object(d.omit)(o,e)),r(t,f()({},e,a))},y=function(e,t){_(t,e)},k=function(e,t){var a=t||s("Invalid value."),n=""===Object(d.trim)(m[e])?s("This field is required."):a;return o[e]?i.a.createElement(Q.a,{text:n}):null},E=function(e){r(t,{is_letter:"envelope"===e.target.value})};return i.a.createElement("div",{className:"packages__properties-group"},"add-custom"===c?i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"package_type"},s("Type of package")),i.a.createElement(J.a,{id:"package_type",onChange:E,value:v?"envelope":"box"},i.a.createElement("option",{value:"box"},s("Box")),i.a.createElement("option",{value:"envelope"},s("Envelope")))):null,i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"name"},s("Package name")),i.a.createElement(b.a,{id:"name",name:"name",placeholder:s("Unique package name"),value:p||"",onChange:function(e){return y(e,"name")},className:o.name?"is-error":""}),k("name",s("This field must be unique"))),i.a.createElement(G.a,{className:"packages__add-package-weight-group"},i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,null,s("Dimensions (L x W x H)")),function(e,t,a,n){var r=oe(t),s=r.length,c=r.width,o=r.height;return i.a.createElement($,{dimensionsUnit:a,dimensions:{width:c,height:o,length:s},onChange:function(t,a){n(e,["length"===a?t:s,"width"===a?t:c,"height"===a?t:o].join(" x "))}})}("inner_dimensions",g,l,_),k("inner_dimensions")),i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,{htmlFor:"box_weight"},s("Weight of empty package")),i.a.createElement(H.a,{id:"box_weight",name:"box_weight",placeholder:s("0.0"),value:h||"",onChange:function(e){return y(e,"box_weight")},className:o.box_weight?"is-error":"",type:"number",suffix:u}),k("box_weight"))))};ue.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var de=Object(u.localize)(ue),me=a(115),pe=a.n(me),ge=Object(d.memoize)(function(e){return pe()(e,{greedy:!0})}),fe=function(e){return e&&""!==Object(d.trim)(e)?e:null},be=function(e,t){return e=fe(e),Object(d.some)(t,function(t){return t===e})?null:e},he=/^\d+(\.\d+)?$/,ve=function(e){return he.test(e)?Number.parseFloat(e):null},_e=function(e,t,a){var n,r=ge(a);return r(function(e,t){var a=ve(e.box_weight),n=ve(e.max_weight);a&&n&&n<=a&&(n=null);var r={name:be(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:fe(e.outer_dimensions),box_weight:a,max_weight:n};return Object(d.omitBy)(r,function(e){return null===e})}(e,t)),n=r.errors,Object(d.reduce)(n,function(e,t){if(t.field){var a,n=t.field.replace("data.","");Object.assign(e,(a={},f()(a,n,!0),f()(a,"any",!0),a))}return e},{})},ye=a(570),ke=a(554),Ee=a(583),Oe=function(e){var t=e.className,a=e.disabled,n=e.id,r=e.onToggle,s=e.readOnly,c=e.selectedElements,o=e.totalElements,l=c&&c===o,u=c&&c<o,d=q()("bulk-select__box",{"is-checked":l}),m=q()("bulk-select__some-checked-icon",{"is-disabled":a}),g=q()("bulk-select",t);return i.a.createElement("span",{className:g},i.a.createElement("span",{className:"bulk-select__container"},i.a.createElement("input",{id:n,type:"checkbox",className:d,onChange:function(e){s||r(!(u||l),e)},checked:l,disabled:a}),u?i.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};Oe.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var je=Oe,Ie=a(601),Ne=a(616),Re=a(649),Ce=a(544),qe=function(e){var t=e.siteId,a=e.form,n=e.toggleAll,r=e.togglePackage,s=e.currentlyEditingPredefinedPackages,c=e.translate,o=a.dimensionUnit,l=function(e){var a="group-".concat(e.serviceId,"-").concat(e.groupId);return i.a.createElement("div",{className:"packages__group-header"},i.a.createElement("label",{htmlFor:a,onClick:function(e){return e.stopPropagation()}},i.a.createElement(je,{id:a,totalElements:e.total,selectedElements:e.selected,onToggle:function(a,r){r.stopPropagation(),n(t,e.serviceId,e.groupId,r.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return i.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(s,function(a,n){var s,u,d=(s=a.selected,u=a.total,s===u?c("All packages selected"):c("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:s,args:{selectedCount:s}}));e.push(i.a.createElement(Ie.a,{className:"packages__predefined-packages",key:n,header:l(a),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:c("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,a){return i.a.createElement(Re.a,{key:a,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},i.a.createElement(Ne.a,{checked:e.selected,onChange:function(){return r(t,e.serviceId,e.id)}}))})}(a)))}),e}())};qe.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var xe=Object(l.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Ce.c)(e)}})(Object(u.localize)(qe)),we=a(534),Se=a.n(we),Pe=function(e){function t(){var e,a;v()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=E()(this,(e=j()(t)).call.apply(e,[this].concat(r))),f()(Se()(a),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),a}return N()(t,e),y()(t,[{key:"render",value:function(){var e=q()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=q()("segmented-control__link",f()({},"item-index-".concat(this.props.index),null!=this.props.index));return i.a.createElement("li",{className:e},i.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},i.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(i.a.Component);f()(Pe,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),f()(Pe,"defaultProps",{selected:!1});var Te=Pe,ze=function(e){function t(){var e,a;v()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=E()(this,(e=j()(t)).call.apply(e,[this].concat(r))),f()(Se()(a),"state",{selected:a.props.initialSelected||a.props.options[0].value}),a}return N()(t,e),y()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,a){return i.a.createElement(Te,{index:a,key:a,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return i.a.createElement("ul",{className:q()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(i.a.Component);f()(ze,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var De=a(650),Ae=a(550),Ue=a(562),Ve=function(e){var t,a=e.siteId,n=e.form,r=e.predefinedPackagesSummary,s=e.setModalErrors,c=e.savePackage,o=e.savePredefinedPackages,l=e.dismissModal,u=e.removePackage,m=e.setAddMode,g=e.updatePackagesField,f=e.translate,b=n.showModal,h=n.mode,v=n.packages,_=n.packageSchema,y=n.predefinedSchema,k=n.packageData,E=k.index,O=v.custom,j="edit"===h,I="add-custom"===h,N="add-predefined"===h,R=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in k&&e.onSaveSuccess(k.name),e.successNotice(f("Your shipping packages have been saved."),t)},function(){return e.errorNotice(f("Unable to save your shipping packages. Please try again."),t)},!0)},C=function(){l(a)},q=f(j?"Edit package":"Add a package"),x=I||N,w=I||j,S=N;t=I||N&&0===r.removed?f("Add package","Add packages",{count:I?1:r.added}):f("Done");var P=[i.a.createElement(Ee.a,{onClick:function(){if(N)return o(a),void(e.persistOnSave&&R());var t="number"===typeof k.index?O[k.index].name:null,n=Object(d.concat)(Object(d.difference)(O.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(y,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),r=Object.assign({},k,{name:se(k.name),inner_dimensions:ce(k.inner_dimensions),outer_dimensions:ce(k.outer_dimensions),box_weight:ie(k.box_weight),max_weight:0}),i=_e(r,n,_);if(le(r.inner_dimensions)||(i.any=!0,i.inner_dimensions=!0),i.any)return g(a,r),void s(a,i);c(a,r),e.persistOnSave&&R()}},t),i.a.createElement(Ee.a,{onClick:C,isPrimary:!1},f("Cancel"))];return j&&P.unshift({action:"delete",label:i.a.createElement("span",null,f("{{icon/}} Delete this package",{components:{icon:i.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return u(a,E)},additionalClassNames:"packages__delete is-scary is-borderless"}),i.a.createElement(ye.a,{isVisible:b,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:C,buttons:P},i.a.createElement(ke.a,{className:"packages__add-edit-title"},q),x&&i.a.createElement(ze,{primary:!0,className:"packages__mode-select",initialSelected:h,onSelect:function(e){m(a,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),w&&i.a.createElement(de,e),S&&i.a.createElement(xe,e))};Ve.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(l.b)(function(e){return{predefinedPackagesSummary:Object(Ce.f)(e)}},function(e){return Object(R.b)(r()({createWcsShippingSaveActionList:De.a,errorNotice:Ae.a,successNotice:Ae.d},Ue),e)})(Object(u.localize)(Ve))},817:function(e,t,a){},818:function(e,t,a){},829:function(e,t,a){"use strict";a.r(t);var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(109),o=a(30),l=a(34),u=a.n(l),d=a(834),m=a(36),p=a.n(m),g=a(533),f=a.n(g),b=a(1),h=a(35),v=a.n(h),_=a(580),y=a(555),k=a(583),E=a(603),O=a(558),j=a(528),I=a.n(j),N=a(551),R=a(645),C=function(e){var t=e.values,a=e.originalValues,n=e.countryNames,s=e.stateNames,i=e.expandStateName,c=void 0!==i&&i;a=a||{};var o=t.state,l=t.country,u="";o&&(u=(c&&s||{})[o]||o);var d=n[l]||l,m=function(e){var n=t[e];if(!n)return"";var s=a[e],i=s&&s.toLowerCase()!==n.toLowerCase(),c=n;switch(e){case"state":c=u;break;case"country":c=d}return r.a.createElement("span",{key:e,className:i?"highlight":""},c)},p=m("state"),g=Object(b.filter)([m("city"),p?", ":"",p," ",m("postcode")]);return r.a.createElement("div",{className:"address-step__summary"},r.a.createElement("p",null,m("name")),r.a.createElement("p",null,m("address")," ",m("address_2")),r.a.createElement("p",null,g),r.a.createElement("p",null,m("country")))},q=function(e){return r.a.createElement(N.a,{className:I()("address-step__suggestion",{"is-selected":e.checked})},r.a.createElement(R.a,Object(b.omit)(e,"children")),e.children)},x=function(e){var t=e.values,a=e.normalized,n=e.selectNormalized,s=e.selectNormalizedAddress,i=e.editAddress,c=e.confirmAddressSuggestion,o=e.countryNames,l=e.translate,u=function(e){return function(){return s(e)}};return r.a.createElement("div",null,r.a.createElement(y.a,{className:"error-notice",status:"is-info",showDismiss:!1},l("We have slightly modified the address entered. If correct, please use the suggested address to ensure accurate delivery.")),r.a.createElement("div",{className:"address-step__suggestion-container"},r.a.createElement(q,{checked:!n,onChange:u(!1)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Address entered")),r.a.createElement(C,{values:t,countryNames:o})),r.a.createElement(q,{checked:n,onChange:u(!0)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Suggested address")),r.a.createElement(C,{values:a,originalValues:t,countryNames:o}))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(k.a,{type:"button",onClick:c},l("Use selected address")),r.a.createElement(k.a,{type:"button",onClick:i,borderless:!0},l("Edit address"))))};x.propTypes={values:i.a.object.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,selectNormalizedAddress:i.a.func.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var w=Object(l.localize)(x),S=a(811),P=a.n(S),T=a(836),z=a(578),D=function(e){var t=e.values,a=e.countryNames,n=e.editUnverifiableAddress,s=e.confirmAddressSuggestion,i=e.translate,c=e.fieldErrors,o=z.a.includes(t.country)?P.a.format({scheme:"https",hostname:"tools.usps.com",pathname:"/zip-code-lookup.htm",query:{mode:"byAddress",companyName:t.company,address1:t.address,address2:t.address_2,city:t.city,state:"US"===t.country?t.state:t.country,zip:t.postcode}}):null,l=Object(b.invokeMap)([t.address+" "+t.address_2,t.city,t.state+" "+t.postcode],"trim").join(", "),u={scheme:"https",hostname:"www.google.com",pathname:"/maps/place/"+encodeURIComponent(l)},d=P.a.format(u);return r.a.createElement("div",null,function(){var e=function(){if(c.general)return c.general;for(var e in c)return c[e];return!1}();return e?r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address \u2014 %(error)s.",{args:{error:e}})):r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address."))}(),r.a.createElement("div",{className:"address-step__unverifiable-container"},r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("span",{className:"address-step__unverifiable-title"},i("Address entered")),r.a.createElement(C,{values:t,countryNames:a})),r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("p",null,i("Automatic verification failed for this address. It may still be a valid address \u2014 use the tools below to manually verify.")),o&&r.a.createElement(T.a,{href:o},i("Verify with USPS")),r.a.createElement(T.a,{href:d},i("View on Google Maps")))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(k.a,{type:"button",onClick:n},i("Edit address")),r.a.createElement(k.a,{type:"button",onClick:s,borderless:!0},i("Use address as entered"))))};D.propTypes={values:i.a.object.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editUnverifiableAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var A=Object(l.localize)(D),U=a(619),V=a(547),M=a(540),F=a(574),L=function(e){var t=e.siteId,a=e.orderId,n=e.values,s=e.isNormalized,i=e.normalized,c=e.selectNormalized,o=e.normalizationInProgress,l=e.allowChangeCountry,u=e.group,d=e.countryNames,m=e.stateNames,g=e.errors,f=e.isUsable,h=e.translate,v=Object(b.isObject)(g)?g:{},j=function(){return e.confirmAddressSuggestion(a,t,u)};if(s&&!v.phone){if(i&&!Object(b.isEqual)(i,n)){return r.a.createElement(w,{values:n,normalized:i,selectNormalized:c,selectNormalizedAddress:function(n){return e.selectNormalizedAddress(a,t,u,n)},confirmAddressSuggestion:j,editAddress:function(){return e.editAddress(a,t,u)},countryNames:d})}if(0<Object(b.size)(v)){return r.a.createElement(A,{values:n,confirmAddressSuggestion:j,editUnverifiableAddress:function(){return e.editUnverifiableAddress(a,t,u)},countryNames:d,fieldErrors:v})}}var I=v.general&&1===Object(b.size)(v),N=function(e){return u+"_"+e},R=function(e){return n[e]?Object(U.a)(n[e]):""},C=function(n){return function(r){return e.updateAddressValue(a,t,u,n,r)}};return r.a.createElement("div",null,r.a.createElement(_.a,{id:N("name"),title:h("Name"),value:R("name"),updateValue:C("name"),error:v.name}),r.a.createElement("div",{className:"address-step__company-phone"},r.a.createElement(_.a,{id:N("company"),title:h("Company"),value:R("company"),updateValue:C("company"),className:"address-step__company",error:v.company}),r.a.createElement(_.a,{id:N("phone"),title:h("Phone"),value:R("phone"),updateValue:C("phone"),className:"address-step__phone",error:v.phone})),I&&r.a.createElement(y.a,{status:"is-error",showDismiss:!1},h("%(message)s. Please modify the address and try again.",{args:{message:v.general}})),r.a.createElement(_.a,{id:N("address"),title:h("Address"),value:R("address"),updateValue:C("address"),className:"address-step__address-1",error:v.address||I}),r.a.createElement(_.a,{id:N("address_2"),value:R("address_2"),updateValue:C("address_2"),error:v.address_2||I}),r.a.createElement("div",{className:"address-step__city-state-postal-code"},r.a.createElement(_.a,{id:N("city"),title:h("City"),value:R("city"),updateValue:C("city"),className:"address-step__city",error:v.city||I}),m?r.a.createElement(E.a,{id:N("state"),title:h("State"),value:R("state"),valuesMap:p()({"":e.translate("Select one\u2026")},m),updateValue:C("state"),className:"address-step__state",error:v.state||I}):r.a.createElement(_.a,{id:N("state"),title:h("State"),value:R("state"),updateValue:C("state"),className:"address-step__state",error:v.state||I}),r.a.createElement(_.a,{id:N("postcode"),title:h("ZIP/Postal code"),value:R("postcode"),updateValue:C("postcode"),className:"address-step__postal-code",error:v.postcode||I})),r.a.createElement(E.a,{id:N("country"),title:h("Country"),value:R("country"),disabled:!l,valuesMap:d,updateValue:C("country"),error:v.country||I}),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(k.a,{type:"button",disabled:Object(O.a)(g)||o,onClick:function(){return e.submitAddressForNormalization(a,t,u)}},h("Verify address")),r.a.createElement(k.a,{type:"button",disabled:!f,onClick:j,borderless:!0},h("Use address as entered"))))};L.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,values:i.a.object.isRequired,isNormalized:i.a.bool.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,allowChangeCountry:i.a.bool.isRequired,errors:i.a.oneOfType([i.a.object,i.a.bool]).isRequired,group:i.a.string.isRequired,countryNames:i.a.object.isRequired,stateNames:i.a.object};var W=Object(c.b)(function(e,t){var a=t.group,n=t.orderId,r=t.siteId,s=Object(M.t)(e,n,r),i=Object(M.j)(e,n,r).form[a],c="origin"===a?Object(M.i)(e,r):Object(M.c)(e,r);return c[i.values.country]||(c=p()(v()({},i.values.country,Object(F.g)(e,i.values.country,r)),c)),p()({},i,{errors:s&&Object(M.f)(e,n,r)[a],isUsable:s&&Object(M.o)(e,n,a,r),countryNames:c,stateNames:Object(M.k)(e,i.values.country,r)})},function(e){return Object(o.b)({selectNormalizedAddress:V.C,confirmAddressSuggestion:V.g,editAddress:V.m,editUnverifiableAddress:V.n,updateAddressValue:V.V,submitAddressForNormalization:V.T},e)})(Object(l.localize)(L)),B=a(537),H=a.n(B),Y=a(107),$=a.n(Y),G=a(108),K=a.n(G),J=a(530),Q=a.n(J),X=a(529),Z=a.n(X),ee=a(531),te=a.n(ee),ae=(a(817),function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=I()("spinner",this.props.className),t={width:this.props.size,height:this.props.size,fontSize:this.props.size};return r.a.createElement("div",{className:e},r.a.createElement("div",{className:"spinner__outer",style:t},r.a.createElement("div",{className:"spinner__inner"})))}}]),t}(n.PureComponent));v()(ae,"propTypes",{className:i.a.string,size:i.a.number}),v()(ae,"defaultProps",{size:20});var ne=a(601),re=function(e){var t=e.isSuccess,a=e.isWarning,n=e.isError,s=e.isProgress,i=e.title,c=e.summary,o=e.children,l=e.expanded,u=e.toggleStep,d=e.translate,m=I()({"is-success":t,"is-warning":a,"is-error":n});c=r.a.createElement("span",{className:m},r.a.createElement("span",null,c),r.a.createElement("div",{className:"label-purchase-modal__step-status"},s?r.a.createElement(ae,{size:18}):r.a.createElement(H.a,{icon:t?"checkmark-circle":a?"notice-outline":n?"notice-outline":"",className:m,size:18})));var p=r.a.createElement("div",null,r.a.createElement("div",{className:"label-purchase-modal__step-title"},i));return r.a.createElement(ne.a,{header:p,summary:c,expandedSummary:c,clickableHeader:!0,compact:!0,screenReaderText:d("Expand"),expanded:l,onClick:u},o)};re.propTypes={isSuccess:i.a.bool,isWarning:i.a.bool,isError:i.a.bool,isProgress:i.a.bool,title:i.a.string.isRequired,summary:i.a.string,expanded:i.a.bool};var se=Object(l.localize)(re),ie=a(573),ce=function(e,t,a,n,r,s){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=e.isNormalized,o=e.normalizationInProgress,l=e.normalized;if(o)return r("Validating address\u2026");if(Object(O.a)(n)||c&&!l)return n&&n.general||r("Invalid address");if(!c)return r("You've edited the address, please revalidate it for accurate rates");var u=Object(ie.a)(e),d=u.city,m=u.postcode,p=u.state,g=u.country,f=d+", ";p&&(f+=(i?Object(F.h)(t,g,p,a):p)+"\xa0 ");return f+="US"===g?m.split("-")[0]:m,s&&(f+=", "+Object(F.g)(t,g,a)),f},oe=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(O.a)(a)||n&&!s||!n?{isError:!0}:n?Object(b.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},le=function(e){return r.a.createElement(se,f()({title:e.title,summary:e.summary,expanded:e.expanded,toggleStep:function(){return e.toggleStep(e.orderId,e.siteId,e.type)}},e.normalizationStatus),r.a.createElement(W,{group:e.type,siteId:e.siteId,orderId:e.orderId}))};le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,type:i.a.string.isRequired,title:i.a.string.isRequired,summary:i.a.string.isRequired,expanded:i.a.bool,normalizationStatus:i.a.object.isRequired,toggleStep:i.a.func.isRequired};var ue=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.type,s=t.translate,i=Object(M.t)(e,a,n),c=Object(M.j)(e,a,n),o=c.form[r],l=i&&Object(M.f)(e,a,n)[r],u="destination"===r&&c.form.origin.values.country!==o.values.country;return{errors:l,form:o,expanded:o.expanded,normalizationStatus:oe(p()({},o,{errors:l})),summary:ce(o,e,n,l,s,u)}},function(e){return Object(o.b)({toggleStep:V.U},e)})(le)),de=a(720),me=function(e,t,a){var n=0;return Object(b.mapValues)(e,function(e){if("individual"===e.box_id)return e.items[0].name;n++;var r=t[e.box_id],s=r&&r.is_letter,i=!(!a||!r)&&r.name;return s?i?Object(l.translate)("Envelope %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Envelope %(packageNum)d",{args:{packageNum:n}}):i?Object(l.translate)("Package %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Package %(packageNum)d",{args:{packageNum:n}})})},pe=a(544),ge=function(e){var t,a,n=e.orderId,s=e.siteId,i=e.selected,c=e.all,o=e.errors,l=e.packageId,u=e.translate,d=function(t,a,i){var c=0<Object.keys(o[t]||{}).length;return r.a.createElement("div",{className:"packages-step__list-item",key:t},r.a.createElement(de.a,{className:I()("packages-step__list-package","is-borderless",{"is-selected":l===t}),onClick:function(){return e.openPackage(n,s,t)}},r.a.createElement("span",{className:"packages-step__list-package-name"},a),function(e,t){return e?r.a.createElement(H.a,{icon:"notice-outline",className:"is-error",size:18}):void 0===t?null:r.a.createElement("span",{className:"packages-step__list-package-count"},t)}(c,i)))},m=me(i,c,!1),p=[],g=[];return Object.keys(i).forEach(function(e){var t=i[e];"individual"===t.box_id?g.push(d(e,t.items[0].name)):p.push(d(e,m[e],t.items.length))}),(p.length||g.length)&&p.unshift((t="boxed-header",a=u("Packages to be Shipped"),r.a.createElement("div",{className:"packages-step__list-item packages-step__list-header",key:t},a))),r.a.createElement("div",{className:"packages-step__list"},p,g)};ge.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,openPackage:i.a.func.isRequired};var fe=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n);return{errors:r&&Object(M.f)(e,a,n).packages,packageId:s.openedPackageId,selected:s.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({openPackage:V.w},e)})(Object(l.localize)(ge)),be=a(552),he=a(553),ve=a(602),_e=a(565),ye=function(e){var t=e.orderId,a=e.siteId,n=e.item,s=e.itemIndex,i=e.translate,c=function(){return e.openItemMove(t,a,s)},o=n.url?r.a.createElement("a",{href:n.url,target:"_blank",rel:"noopener noreferrer"},n.name):n.name;return r.a.createElement("div",{key:s,className:"packages-step__item"},r.a.createElement("div",{className:"packages-step__item-name"},r.a.createElement("span",null,o),"attributes"in n?r.a.createElement("p",null,n.attributes):""),r.a.createElement("div",{className:"packages-step__item-weight"},"weight"in n?r.a.createElement("p",null,n.weight):""),r.a.createElement("div",{className:"packages-step__item-qty"},"quantity"in n?r.a.createElement("p",null,n.quantity):""),r.a.createElement("div",{className:"packages-step__item-move"},r.a.createElement("a",{href:"#",onClick:c},i("Move"))))};ye.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,item:i.a.object.isRequired,itemIndex:i.a.number.isRequired,openItemMove:i.a.func.isRequired};var ke=Object(c.b)(function(e,t){var a=t.siteId;return{site:Object(_e.a)(e,a)}},function(e){return Object(o.b)({openItemMove:V.v},e)})(Object(l.localize)(ye)),Ee=a(569),Oe=a(696),je=a(683),Ie=a(562),Ne=function(e,t){return[e.length,e.width,e.height].map(function(e){return"".concat(e," ").concat(t)}).join(" x ")},Re=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.pckg,i=e.dimensionUnit,c=e.packageGroups,o=e.translate,l=e.pckgErrors,u=e.isIndividualPackage,d=function(e){var t=Object(Oe.a)(e),a=e.id||e.name;return r.a.createElement("option",{value:a,key:a},e.name," - ",Ne(t,i))};if(!n)return null;if(u){var m=I()({"is-error":l.dimensions});return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header"},r.a.createElement(he.a,null,o("Individually Shipped Item"))),r.a.createElement("span",{className:"packages-step__package-item-description"},o("Item Dimensions")," -"," "),r.a.createElement("span",{className:m},Ne(s,i)),l.dimensions&&r.a.createElement(be.a,{text:l.dimensions}))}var p=Object(b.reduce)(c,function(e,t){return e+t.definitions.length},0);return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header packages-step__package-details-header"},r.a.createElement(he.a,null,o("Package details")),0!==p?r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Add package")):null),0===p?r.a.createElement("div",{className:"packages-step__no-packages"},r.a.createElement(H.a,{icon:"product",size:18}),r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Select a package type"))):r.a.createElement("div",{className:"packages-step__with-packages"},r.a.createElement(Ee.a,{onChange:function(r){e.setPackageType(a,t,n,r.target.value)},value:s.box_id,isError:l.box_id||l.dimensions},r.a.createElement("option",{value:"not_selected",key:"not_selected"},o("Please select a package"))," ",Object(b.map)(c,function(e,t){return Object(b.isEmpty)(e.definitions)?null:r.a.createElement("optgroup",{label:e.title,key:t},Object(b.map)(e.definitions,d))}))),r.a.createElement(je.a,f()({persistOnSave:!0},e,{onSaveSuccess:function(r){e.setPackageType(a,t,n,r)}})))};Re.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,pckgErrors:i.a.object.isRequired,pckg:i.a.object.isRequired};var Ce=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=r?s.storeOptions:{},c=Object(pe.e)(e,n)||{};return{dimensionUnit:i.dimension_unit,packageGroups:Object(pe.d)(e,a,n),form:c}},function(e){return Object(o.b)({setPackageType:V.P,addPackage:Ie.addPackage},e)})(Object(l.localize)(Re)),qe=a(549),xe=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.selected,i=e.weightUnit,c=e.errors,o=e.translate,l=e.userMeta,u=c[n]||{};if(!n)return null;var d=s[n],m="individual"===d.box_id,p=function(e,s){return r.a.createElement(ke,{siteId:t,orderId:a,key:s,item:e,itemIndex:s,packageId:n,showRemove:!0,isIndividualPackage:m})},g=function(){return e.openAddItem(a,t)},f=function(){return m?null:r.a.createElement(de.a,{className:I()("button","is-compact","packages-step__add-item-btn"),onClick:g},o("Add items"))},h=isNaN(d.weight)?"":d.weight;return r.a.createElement("div",{className:"packages-step__package"},r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header-name"},r.a.createElement(he.a,null,o("Items to fulfill"))),r.a.createElement("div",{className:"packages-step__package-items-header-weight"},r.a.createElement(he.a,null,o("Weight"))),r.a.createElement("div",{className:"packages-step__package-items-header-qty"},r.a.createElement(he.a,null,o("QTY"))),r.a.createElement("div",{className:"packages-step__package-items-header-move"}),function(){var e=Object(b.some)(s,function(e,t){return n!==t&&e.items.length});if(!d.items.length)return r.a.createElement("div",{className:"packages-step__add-item-row"},r.a.createElement("div",{className:"packages-step__no-items-message"},o("There are no items in this package."),e?f():null));var t=d.items.map(p);return e&&t.push(r.a.createElement("div",{key:t.length,className:"packages-step__add-item-row"},f())),t}()),r.a.createElement(Ce,{siteId:t,orderId:a,isIndividualPackage:m,pckgErrors:u,pckg:d,packageId:n,lastBoxId:l.last_box_id}),r.a.createElement("div",{className:"packages-step__package-weight"},r.a.createElement(N.a,{htmlFor:"weight_".concat(n)},o("Total Weight (with package)")),r.a.createElement(ve.a,{id:"weight_".concat(n),placeholder:o("0"),value:h,onChange:function(r){e.updatePackageWeight(a,t,n,r)},className:Boolean(u.weight)?"is-error":"",type:"number",suffix:i}),u.weight&&r.a.createElement(be.a,{text:u.weight})))};xe.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,selected:i.a.object.isRequired,updatePackageWeight:i.a.func.isRequired,dimensionUnit:i.a.string.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,openAddItem:i.a.func.isRequired,userMeta:i.a.object.isRequired};var we=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=r?s.storeOptions:{},c=r&&Object(M.f)(e,a,n).packages,o=r?Object(qe.i)(e,n):{};return{siteId:n,errors:c,packageId:s.openedPackageId,selected:s.form.packages.selected,dimensionUnit:i.dimension_unit,weightUnit:i.weight_unit,userMeta:o}},function(e){return Object(o.b)(p()({updatePackageWeight:V.W,openAddItem:V.t,setPackageType:V.P},Ie),e)})(Object(l.localize)(xe)),Se=a(570),Pe=a(554),Te=function(e){e.site;var t=e.siteId,a=e.orderId,n=e.showItemMoveDialog,s=e.movedItemIndex,i=e.targetPackageId,c=e.openedPackageId,o=e.selected,l=e.all,u=e.translate;if(-1===s||!n)return null;var d,m,p=function(n,s){return r.a.createElement(N.a,{key:n,className:"packages-step__dialog-package-option"},r.a.createElement(R.a,{checked:n===i,onChange:function(){return e.setTargetPackage(a,t,n)}}),s)},g=o[c],f=g.items[s],b=(d=f.product_id,"post.php?post=".concat(d,"&action=edit")),h=r.a.createElement("a",{href:b,target:"_blank",rel:"noopener noreferrer"},f.name),v=me(o,l,!0);m=""===c?u("{{itemLink/}} is currently saved for a later shipment.",{components:{itemLink:h}}):"individual"===g.box_id?u("{{itemLink/}} is currently shipped in its original packaging.",{components:{itemLink:h}}):u("{{itemLink/}} is currently in {{pckg/}}.",{components:{itemLink:h,pckg:r.a.createElement("span",{className:"packages-step__dialog-package-name"},v[c])}});var _=function(){return e.closeItemMove(a,t)},y=[{action:"cancel",label:u("Cancel"),onClick:_},{action:"move",label:u("Submit"),isPrimary:!0,disabled:i===c,onClick:function(){return e.moveItem(a,t,c,s,i)}}];return r.a.createElement(Se.a,{isVisible:n,isFullScreen:!1,onClickOutside:_,onClose:_,buttons:y,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Pe.a,null,u("Move item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,m),r.a.createElement("p",null,u("Where would you like to move it?")),function(){var e=[];return Object.keys(o).forEach(function(t){var a=o[t];t!==c&&"individual"!==a.box_id&&e.push(p(t,v[t]))}),e}(),p("new",u("Add to a New Package")),g&&"individual"===g.box_id?null:p("individual",u("Ship in original packaging"))))};Te.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showItemMoveDialog:i.a.bool.isRequired,movedItemIndex:i.a.number.isRequired,targetPackageId:i.a.string,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,moveItem:i.a.func.isRequired};var ze=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.j)(e,a,n);return{site:Object(_e.a)(e,n),showItemMoveDialog:r.showItemMoveDialog||!1,movedItemIndex:isNaN(r.movedItemIndex)?-1:r.movedItemIndex,targetPackageId:r.targetPackageId,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeItemMove:V.d,setTargetPackage:V.S,moveItem:V.s},e)})(Object(l.localize)(Te)),De=a(616),Ae=function(e){var t=e.siteId,a=e.orderId,n=e.showAddItemDialog,s=e.addedItems,i=e.openedPackageId,c=e.selected,o=e.all,l=e.translate;if(!n)return null;var u=me(c,o,!0),d=function(e){return r.a.createElement("span",{className:"packages-step__dialog-package-name"},u[e])},m=[];Object.keys(c).forEach(function(n){if(n!==i){var o=0;c[n].items.forEach(function(i){m.push(function(n,i,c){var o=u[n]?l("%(item)s from {{pckg/}}",{args:{item:c.name},components:{pckg:d(n)}}):c;return r.a.createElement(N.a,{key:"".concat(n,"-").concat(i),className:"packages-step__dialog-package-option"},r.a.createElement(De.a,{checked:Object(b.includes)(s[n],i),onChange:function(r){return e.setAddedItem(a,t,n,i,r.target.checked)}}),r.a.createElement("span",null,o))}(n,o,i)),o++})}});var p=function(){return e.closeAddItem(a,t)},g=[{action:"close",label:l("Close"),onClick:p},{action:"add",label:l("Add"),isPrimary:!0,disabled:!Object(b.some)(s,b.size),onClick:function(){return e.addItems(a,t,i)}}];return r.a.createElement(Se.a,{isVisible:n,isFullScreen:!1,onClickOutside:p,onClose:p,buttons:g,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Pe.a,null,l("Add item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,l("Which items would you like to add to {{pckg/}}?",{components:{pckg:d(i)}})),m))};Ae.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showAddItemDialog:i.a.bool.isRequired,addedItems:i.a.object,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,closeAddItem:i.a.func.isRequired,setAddedItem:i.a.func.isRequired,addItems:i.a.func.isRequired};var Ue=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.j)(e,a,n);return{showAddItemDialog:Boolean(r.showAddItemDialog),addedItems:r.addedItems,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeAddItem:V.b,setAddedItem:V.E,addItems:V.a},e)})(Object(l.localize)(Ae)),Ve=function(e){var t=e.disabled,a=e.onClick,n=e.children;return r.a.createElement("div",{className:"step-confirmation-button"},r.a.createElement(k.a,{type:"button",onClick:a,disabled:Boolean(t),isPrimary:!0},n))};Ve.propTypes={disabled:i.a.bool,onClick:i.a.func.isRequired};var Me=Ve,Fe={g:0,oz:1,lbs:3,kg:3},Le=function(e){var t=e.siteId,a=e.orderId,n=e.selected,s=e.weightUnit,i=e.errors,c=e.expanded,o=e.translate,u=Object.keys(n),d=u.reduce(function(e,t){return e+n[t].items.length},0),m=u.reduce(function(e,t){return e+n[t].weight},0),p=0<u.length;return r.a.createElement(se,f()({title:o("Packaging")},function(){if(!p)return{isError:!0,summary:o("No packages selected")};var e=Object(b.find)(i,function(e){return!Object(b.isEmpty)(e)});if(e)return{isError:!0,summary:e[Object.keys(e)[0]]};var t=Object(l.numberFormat)(m,{decimals:Fe[s]});return{isSuccess:!0,summary:1===u.length&&1===d?o("1 item in 1 package: %(weight)s %(unit)s total",{args:{weight:t,unit:s}}):1===u.length?o("%(itemsCount)d items in 1 package: %(weight)s %(unit)s total",{args:{itemsCount:d,weight:t,unit:s}}):o("%(itemsCount)d items in %(packageCount)d packages: %(weight)s %(unit)s total",{args:{itemsCount:d,packageCount:u.length,weight:t,unit:s}})}}(),{expanded:c,toggleStep:function(){return e.toggleStep(a,t,"packages")}}),r.a.createElement("div",{className:"packages-step__contents"},r.a.createElement(fe,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(we,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(Me,{disabled:Object(O.a)(i)||!u.length,onClick:function(){return e.confirmPackages(a,t)}},o("Use these packages")),r.a.createElement(ze,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(Ue,{siteId:e.siteId,orderId:e.orderId}))};Le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,expanded:i.a.bool};var We=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=r?s.storeOptions:{};return{errors:r&&Object(M.f)(e,a,n).packages,weightUnit:i.weight_unit,expanded:s.form.packages.expanded,selected:s.form.packages.selected}},function(e){return Object(o.b)({toggleStep:V.U,confirmPackages:V.i},e)})(Object(l.localize)(Le)),Be=a(548),He=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className,l=e.weightUnit,u=I()({"is-error":Boolean(c)});return r.a.createElement(Be.a,{className:o},r.a.createElement(N.a,{htmlFor:t},a),r.a.createElement(ve.a,{suffix:l,id:t,name:t,type:"number",placeholder:s||"0.0",value:n,onChange:i,className:u}),c&&"string"===typeof c&&r.a.createElement(be.a,{text:c}))};He.propTypes={weightUnit:i.a.string.isRequired,id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var Ye=He,$e=a(535),Ge=a.n($e),Ke=a(534),Je=a.n(Ke),Qe=function(e){function t(){var e;return $()(this,t),(e=Q()(this,Z()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(Je()(e)),e}return te()(t,e),K()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(b.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),a=I()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return r.a.createElement("input",f()({type:"text"},t,{ref:e||"textField",className:a,onClick:this.selectOnFocus}))}}]),t}(n.PureComponent);v()(Qe,"propTypes",{isError:i.a.bool,isValid:i.a.bool,selectOnFocus:i.a.bool,className:i.a.string});var Xe=function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,a=e.prefix,n=e.suffix,s=Ge()(e,["noWrap","prefix","suffix"]);return r.a.createElement("div",{className:I()("form-text-input-with-affixes",{"no-wrap":t})},a&&r.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},a),r.a.createElement(Qe,s),n&&r.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},n))}}]),t}(r.a.Component);function Ze(e,t,a){if(!e)return null;if(!a)return e;var n=Object(b.get)(Object(b.find)(a,function(t){return t.code===e}),"label",e);return r.a.createElement("span",{className:"form-currency-input__affix"},n,r.a.createElement(H.a,{icon:"chevron-down",size:18,className:"form-currency-input__select-icon"}),r.a.createElement("select",{className:"form-currency-input__select",value:e,onChange:t},a.map(function(e){var t=e.code,a=e.label,n=void 0===a?t:a;return r.a.createElement("option",{key:t,value:t},n)})))}function et(e){var t=e.className,a=e.currencySymbolPrefix,n=e.currencySymbolSuffix,s=e.onCurrencyChange,i=e.currencyList,c=e.placeholder,o=void 0===c?"0.00":c,l=Ge()(e,["className","currencySymbolPrefix","currencySymbolSuffix","onCurrencyChange","currencyList","placeholder"]),u=I()("form-currency-input",t),d=Ze(a,s,i),m=Ze(n,s,i);return r.a.createElement(Xe,f()({},l,{type:"number",className:u,prefix:d,suffix:m,placeholder:o}))}v()(Xe,"displayName","FormTextInputWithAffixes"),v()(Xe,"propTypes",{noWrap:i.a.bool,prefix:i.a.node,suffix:i.a.node});var tt=i.a.shape({code:i.a.string.isRequired,label:i.a.string});et.propTypes={currencySymbolPrefix:i.a.oneOfType([i.a.string,i.a.object]),currencySymbolSuffix:i.a.oneOfType([i.a.string,i.a.object]),onCurrencyChange:i.a.func,currencyList:i.a.arrayOf(tt)};var at=et,nt=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className;return r.a.createElement(Be.a,{className:o},r.a.createElement(N.a,{htmlFor:t},a),r.a.createElement(at,{id:t,name:t,currencySymbolPrefix:"$",placeholder:s||"0.00",value:n,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&r.a.createElement(be.a,{text:c}))};nt.propTypes={id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var rt=nt,st=a(820),it=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("HS Tariff number")," (",r.a.createElement(T.a,{href:"https://docs.woocommerce.com/document/woocommerce-shipping-and-tax/woocommerce-shipping/#section-29"},t("more info")),")")}),ct=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("Origin country"),r.a.createElement(st.a,{text:t("Country where the product was manufactured or assembled")},r.a.createElement("span",null,r.a.createElement(H.a,{icon:"info-outline",size:18}))))}),ot=function(e){var t=e.translate,a=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-rows-header"},r.a.createElement("span",{className:"customs-step__item-description-column"},t("Description")),r.a.createElement("span",{className:"customs-step__item-code-column"},r.a.createElement(it,null)),r.a.createElement("span",{className:"customs-step__item-weight-column"},t("Weight (%s per unit)",{args:[a]})),r.a.createElement("span",{className:"customs-step__item-value-column"},t("Value ($ per unit)")),r.a.createElement("span",{className:"customs-step__item-country-column"},r.a.createElement(ct,null)))};ot.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,weightUnit:i.a.string.isRequired};var lt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{weightUnit:Object(M.j)(e,a,n).storeOptions.weight_unit}})(Object(l.localize)(ot)),ut=function(e){var t=e.errors,a=e.packageId,n=e.productId,s=e.translate,i=e.description,c=e.defaultDescription,o=e.weight,l=e.value,u=e.tariffNumber,d=e.originCountry,m=e.countryNames,p=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-row"},r.a.createElement(_.a,{id:a+"_"+n+"_description",className:"customs-step__item-description-column",title:s("Description"),value:i,placeholder:c,updateValue:e.setCustomsItemDescription,error:t.description}),r.a.createElement(_.a,{id:a+"_"+n+"_tariffNumber",className:"customs-step__item-code-column",title:r.a.createElement(it,null),placeholder:s("Optional"),value:u,updateValue:e.setCustomsItemTariffNumber,error:t.tariffNumber}),r.a.createElement(Ye,{weightUnit:p,id:a+"_"+n+"_weight",className:"customs-step__item-weight-column",title:s("Weight (per unit)"),value:o,updateValue:e.setCustomsItemWeight,error:t.weight}),r.a.createElement(rt,{id:a+"_"+n+"_value",className:"customs-step__item-value-column",title:s("Value (per unit)"),value:l,updateValue:e.setCustomsItemValue,error:t.value}),r.a.createElement(E.a,{id:a+"_"+n+"_originCountry",className:"customs-step__item-country-column",title:r.a.createElement(ct,null),value:d,updateValue:e.setCustomsItemOriginCountry,valuesMap:m}))};ut.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,productId:i.a.number.isRequired,description:i.a.string.isRequired,defaultDescription:i.a.string.isRequired,tariffNumber:i.a.string.isRequired,weight:i.a.oneOfType([i.a.string,i.a.number]).isRequired,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,originCountry:i.a.string.isRequired,errors:i.a.object,countryNames:i.a.object.isRequired,setCustomsItemDescription:i.a.func.isRequired,setCustomsItemTariffNumber:i.a.func.isRequired,setCustomsItemWeight:i.a.func.isRequired,setCustomsItemValue:i.a.func.isRequired,setCustomsItemOriginCountry:i.a.func.isRequired};var dt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.productId,s=Object(M.t)(e,a,n),i=Object(M.j)(e,a,n),c=i.form.customs.items[r];return{description:c.description,defaultDescription:c.defaultDescription,tariffNumber:c.tariffNumber||"",weight:c.weight,value:c.value,originCountry:c.originCountry,errors:s?Object(M.f)(e,a,n).customs.items[r]:{},countryNames:Object(F.d)(e,n),weightUnit:i.storeOptions.weight_unit}},function(e,t){var a=t.orderId,n=t.siteId,r=t.productId;return{setCustomsItemDescription:function(t){return e(Object(V.H)(a,n,r,t))},setCustomsItemTariffNumber:function(t){return e(Object(V.J)(a,n,r,t))},setCustomsItemWeight:function(t){return e(Object(V.L)(a,n,r,t))},setCustomsItemValue:function(t){return e(Object(V.K)(a,n,r,t))},setCustomsItemOriginCountry:function(t){return e(Object(V.I)(a,n,r,t))}}})(Object(l.localize)(ut)),mt=a(599),pt=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.packageId,i=e.translate,c=e.contentsType,o=e.contentsExplanation,l=e.restrictionType,u=e.restrictionComments,d=e.abandonOnNonDelivery,m=e.itn,p=e.items;return r.a.createElement("div",{className:"customs-step__package"},r.a.createElement(N.a,{htmlFor:s+"_abandonOnNonDelivery",className:"customs-step__abandon-on-non-delivery"},r.a.createElement(mt.a,{id:s+"_abandonOnNonDelivery",checked:!d,onChange:function(){return e.setAbandonOnNonDelivery(!d)}}),r.a.createElement("span",null,i("Return to sender if package is unable to be delivered"))),r.a.createElement("div",{className:"customs-step__restrictions-row"},r.a.createElement("div",{className:"customs-step__contents-type"},r.a.createElement(E.a,{id:s+"_contentsType",title:i("Contents type"),value:c||"merchandise",updateValue:e.setContentsType,valuesMap:{merchandise:i("Merchandise"),documents:i("Documents"),gift:i("Gift"),sample:i("Sample"),other:i("Other\u2026")}}),"other"===c&&r.a.createElement(_.a,{id:s+"_contentsExplanation",title:i("Details"),value:o||"",updateValue:e.setContentsExplanation,error:n.contentsExplanation})),r.a.createElement("div",{className:"customs-step__restriction-type"},r.a.createElement(E.a,{id:s+"_restrictionType",title:i("Restriction type"),value:l||"none",updateValue:e.setRestrictionType,valuesMap:{none:i("None"),quarantine:i("Quarantine"),sanitary_phytosanitary_inspection:i("Sanitary / Phytosanitary inspection"),other:i("Other\u2026")}}),"other"===l&&r.a.createElement(_.a,{id:s+"_restrictionComments",title:i("Details"),value:u||"",updateValue:e.setRestrictionExplanation,error:n.restrictionComments}))),r.a.createElement(_.a,{id:s+"_itn",title:r.a.createElement("span",null,i("ITN")," (",r.a.createElement(T.a,{href:"https://pe.usps.com/text/imm/immc5_010.htm"},i("more info")),")"),value:m||"",updateValue:e.setITN,error:n.itn}),r.a.createElement("div",{className:"customs-step__item-rows"},r.a.createElement(lt,{siteId:t,orderId:a}),Object(b.uniq)(Object(b.map)(p,"product_id")).map(function(e){return r.a.createElement(dt,{key:e,productId:e,packageId:s,siteId:t,orderId:a})})))};pt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,contentsType:i.a.oneOf(["merchandise","documents","gift","sample","other"]),contentsExplanation:i.a.string,restrictionType:i.a.oneOf(["none","quarantine","sanitary_phytosanitary_inspection","other"]),restrictionComments:i.a.string,abandonOnNonDelivery:i.a.bool,itn:i.a.string,items:i.a.arrayOf(i.a.shape({product_id:i.a.number.isRequired})).isRequired,setContentsType:i.a.func.isRequired,setContentsExplanation:i.a.func.isRequired,setRestrictionType:i.a.func.isRequired,setRestrictionExplanation:i.a.func.isRequired,setAbandonOnNonDelivery:i.a.func.isRequired,setITN:i.a.func.isRequired};var gt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId,s=Object(M.t)(e,a,n),i=Object(M.j)(e,a,n).form.packages.selected[r];return{contentsType:i.contentsType,contentsExplanation:i.contentsExplanation,restrictionType:i.restrictionType,restrictionComments:i.restrictionComments,abandonOnNonDelivery:i.abandonOnNonDelivery,itn:i.itn,items:i.items,errors:s?Object(M.f)(e,a,n).customs.packages[r]:{}}},function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId;return{setContentsType:function(t){return e(Object(V.G)(a,n,r,t))},setContentsExplanation:function(t){return e(Object(V.F)(a,n,r,t))},setRestrictionType:function(t){return e(Object(V.R)(a,n,r,t))},setRestrictionExplanation:function(t){return e(Object(V.Q)(a,n,r,t))},setAbandonOnNonDelivery:function(t){return e(Object(V.D)(a,n,r,t))},setITN:function(t){return e(Object(V.O)(a,n,r,t))}}})(Object(l.localize)(pt)),ft=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.expanded,i=e.translate,c=e.isSubmitted,o=e.packageDescriptions,l=Object(O.a)(n)?i("Customs information incomplete"):i("Customs information valid");return r.a.createElement(se,{title:i("Customs"),summary:c?l:"",expanded:s,toggleStep:e.toggleStep,isSuccess:c&&!Object(O.a)(n),isError:c&&Object(O.a)(n)},Object.keys(o).map(function(e,n){return r.a.createElement("div",{className:"customs-step__package-container",key:e},n?r.a.createElement("hr",null):null,r.a.createElement("p",{className:"customs-step__package-name"},o[e]),r.a.createElement(gt,{packageId:e,siteId:t,orderId:a}))}),r.a.createElement(Me,{disabled:Object(O.a)(n),onClick:e.confirmCustoms},i("Save customs form")))};ft.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageDescriptions:i.a.objectOf(i.a.string).isRequired,expanded:i.a.bool,isSubmitted:i.a.bool.isRequired,errors:i.a.object,toggleStep:i.a.func.isRequired,confirmCustoms:i.a.func.isRequired};var bt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=s.form.packages.selected;return{packageDescriptions:me(i,Object(pe.a)(e,n),!0),expanded:s.form.customs.expanded,isSubmitted:Object(M.q)(e,a,n),errors:r?Object(M.f)(e,a,n).customs:{}}},function(e,t){var a=t.orderId,n=t.siteId;return{toggleStep:function(){return e(Object(V.U)(a,n,"customs"))},confirmCustoms:function(){return e(Object(V.h)(a,n))}}})(Object(l.localize)(ft)),ht=a(608),vt=a.n(ht),_t=a(838),yt=a(826),kt=a(635),Et=function(e){function t(){var e;return $()(this,t),e=Q()(this,Z()(t).call(this)),v()(Je()(e),"onSignatureChecked",function(t,a,n){var r=e.props,s=r.rateObject,i=s.service_id,c=s.carrier_id,o=r.updateValue,l=t?{id:a,value:n.value,netCost:n.netCost}:null;e.setState({selectedSignature:l}),o(i,c,t?n.value:0)}),e.state={signatureOption:!1},e}return te()(t,e),K()(t,[{key:"renderServices",value:function(e,t,a){var n=[];if(a.tracking)switch(e){case"usps":n.push(Object(l.translate)("Includes USPS tracking"));break;default:n.push(Object(l.translate)("Includes tracking"))}if(a.insurance){var r=Number(a.insurance);isNaN(r)?n.push(Object(l.translate)("Insurance (%s)",{args:[a.insurance]})):r>0&&n.push(Object(l.translate)("Insurance (up to %s)",{args:[vt()(r,"USD")]}))}return t.filter(function(e){return 0===e.netCost}).length>0&&n.push(Object(l.translate)("Signature required")),a.free_pickup&&n.push(Object(l.translate)("Eligible for free pickup")),n.join(", ")}},{key:"renderSignatureOptions",value:function(e){var t=this;return e.map(function(e,a){return r.a.createElement(_t.a,{key:a,name:"signature_option_".concat(a),label:e.label,checked:!!t.state.selectedSignature&&t.state.selectedSignature.id===a,onChange:function(n){return t.onSignatureChecked(n,a,e)}})})}},{key:"render",value:function(){var e=this.props,t=e.rateObject,a=t.title,n=t.service_id,s=t.carrier_id,i=t.rate,c=t.delivery_days,o=t.delivery_date_guaranteed,u=t.delivery_date,d=t.tracking,m=t.insurance,p=t.free_pickup,g=e.isSelected,f=e.updateValue,h=e.signatureRates,v=this.state.selectedSignature,_=Object(b.values)(Object(b.mapValues)(h,function(e,t){var a=0===e.optionNetCost?Object(l.translate)("free"):Object(l.translate)("+%s",{args:[vt()(e.optionNetCost,"USD")]});return{label:Object(l.translate)("%(label)s (%(price)s)",{args:{label:e.label,price:a}}),value:t,netCost:e.optionNetCost}})),y="";o&&u?y=Object(l.moment)(u).format("LL").split(",")[0]:c&&(y=Object(l.translate)("%(delivery_days)s business day","%(delivery_days)s business days",{count:c,args:{delivery_days:c}}));var k=v?i+v.netCost:i;return r.a.createElement("div",{className:"rates-step__shipping-rate-container"},r.a.createElement(yt.a,{className:"rates-step__shipping-rate-radio-control",selected:g?n:null,options:[{label:"",value:n}],onChange:function(){f(n,s,!!v&&v.value)}}),r.a.createElement("div",{className:"rates-step__shipping-rate-information"},r.a.createElement(kt.a,{carrier:s,size:30}),r.a.createElement("div",{className:"rates-step__shipping-rate-description"},r.a.createElement("div",{className:"rates-step__shipping-rate-description-title"},a),r.a.createElement("div",{className:"rates-step__shipping-rate-description-details"},this.renderServices(s,_,{tracking:d,insurance:m,free_pickup:p}),g&&_.length>1?this.renderSignatureOptions(_):null)),r.a.createElement("div",{className:"rates-step__shipping-rate-details"},r.a.createElement("div",{className:"rates-step__shipping-rate-rate"},"ups"===s?r.a.createElement(st.a,{position:"top left",text:Object(l.translate)("This rate is provided by your connected UPS account")},r.a.createElement("div",{className:"rates-step__shipping-rate-rate-tooltip"},r.a.createElement(H.a,{icon:"help-outline",size:18}))):null,vt()(k,"USD")),r.a.createElement("div",{className:"rates-step__shipping-rate-delivery-date"},y))))}}]),t}(n.Component);Et.propTypes={rateObject:i.a.shape({rate_id:i.a.string.isRequired,title:i.a.string.isRequired,service_id:i.a.string.isRequired,carrier_id:i.a.string.isRequired,rate:i.a.number.isRequired,delivery_days:i.a.number,delivery_date_guaranteed:i.a.bool,delivery_date:i.a.string,tracking:i.a.bool,insurance:i.a.oneOfType([i.a.string,i.a.number]),free_pickup:i.a.bool}).isRequired,signatureRates:i.a.object.isRequired};var Ot=Et,jt={signature_required:u.a.translate("Signature required"),adult_signature_required:u.a.translate("Adult signature required")},It=function(e,t,a){var n=function(e,t,a){var n=Object(b.find)(a[e].default.rates,function(e){return t===e.service_id});return"undefined"!==typeof n?n.rate:0}(e,t,a);return Object(b.pickBy)(Object(b.mapValues)(a[e],function(e,a){var r=function(e,t,a,n){var r=Object(b.find)(a,function(t){return e===t.service_id});return"undefined"===typeof r?null:t in jt?r.rate===n&&"Express"!==e?null:r:null}(t,a,e.rates,n);return null!==r?{rate:r,label:jt[a],optionNetCost:r.rate-n}:null}),function(e){return null!==e})},Nt=function(e){var t=e.id,a=e.selectedRates,n=e.availableRates,s=e.selectedPackages,i=e.allPackages,c=e.updateRate,o=e.errors,l=e.shouldShowRateNotice,u=e.translate,d=me(s,i,!0),m=1===Object.keys(s).length;return r.a.createElement("div",null,l&&function(e){return r.a.createElement(y.a,{className:"rates-step__notice",icon:"info-outline",showDismiss:!1,text:e("The service and rate chosen by the customer at checkout is not available. Please choose another.")})}(u),Object.values(Object(b.mapValues)(s,function(e,s){if(!(s in n))return null;var i=a[s]||"",l=n[s].default.rates,p=(o[s]||[]).filter(function(e,t){return o[s].indexOf(e)===t}),g=function(e,t,a){return c(s,e,t,a)};return r.a.createElement("div",{key:s,className:"rates-step__package-container"},m?null:r.a.createElement("div",{className:"rates-step__package-container-rates-header"},u("Choose rate: %(pckg)s",{args:{pckg:d[s]}})),Object.values(Object(b.mapValues)(l,function(e){var a=e.service_id;return r.a.createElement(Ot,{id:t+"_"+s,key:t+"_"+s+"_"+a,rateObject:e,signatureRates:It(s,a,n),updateValue:g,isSelected:a===i.serviceId})})),p.map(function(e,t){return r.a.createElement(be.a,{type:"server-error",key:t,text:e})}))})))};Nt.propTypes={id:i.a.string.isRequired,selectedRates:i.a.object.isRequired,availableRates:i.a.object.isRequired,selectedPackages:i.a.object.isRequired,allPackages:i.a.object.isRequired,updateRate:i.a.func.isRequired,errors:i.a.object.isRequired};var Rt=Object(l.localize)(Nt);function Ct(e){var t=Object(b.get)(e,"shipping_lines",[]);return Object(b.reduce)(t,function(e,t){return e+parseFloat(t.total)},0)}function qt(e){return Object(b.get)(e,"shipping_lines[0].method_title",!1)}var xt=a(609),wt=function(e){var t=e.siteId,a=e.orderId,n=e.form,s=e.allPackages,i=e.values,c=e.available,o=e.errors,l=e.ratesTotal,u=e.translate,d=function(e,t,a,n,r){if(!n)return r("Unsaved changes made to packages");if(Object(b.some)(Object(b.mapValues)(t,function(e){return Object(b.isEmpty)(e.default.rates)})))return r("No rates found");if(!a)return"";var s=Object.keys(e);if(1===s.length){var i=s[0],c=e[i],o=t[i].default.rates,l=Object(b.find)(o,["service_id",c]);return l?r("%(serviceName)s: %(rate)s",{args:{serviceName:l.title,rate:vt()(l.rate,"USD")}}):""}return r("Total rate: %(total)s",{args:{total:vt()(a,"USD")}})}(i,c,l,n.packages.saved,u),m=function(n,r,s,i){return e.updateRate(a,t,n,r,s,i)};return Object(b.forEach)(n.packages.selected,function(e,t){if(""===i[t]&&!Object(b.isEmpty)(c)&&t in c&&1===c[t].default.rates.length){var a=c[t].default.rates[0].service_id;m(t,a,!1)}}),r.a.createElement(se,f()({title:u("Shipping rates"),summary:d,expanded:!Object(b.isEmpty)(c),toggleStep:function(){return e.toggleStep(a,t,"rates")}},function(e){var t=e.retrievalInProgress,a=e.errors,n=e.available,r=e.form;return t?{isProgress:!0}:Object(O.a)(a)?{isError:!0}:Object(b.isEmpty)(n)?{}:r.packages.saved?{isSuccess:!0}:{isWarning:!0}}(e)),!Object(b.isEmpty)(c)&&function(e){var t=e.shippingMethod,a=e.shippingCost,n=e.translate,s=document.createElement("div");s.innerHTML=t;var i,c=s.textContent;if(t)return i=0<a?n("Customer paid a {{shippingMethod/}} of {{shippingCost/}} for shipping",{components:{shippingMethod:r.a.createElement("span",null,c),shippingCost:r.a.createElement("span",{className:"rates-step__shipping-info-cost"},vt()(a,"USD"))}}):n("Your customer selected {{shippingMethod/}}",{components:{shippingMethod:r.a.createElement("span",{className:"rates-step__shipping-info-method"},c)}}),r.a.createElement("div",{className:"rates-step__shipping-info"},r.a.createElement(H.a,{icon:"info-outline"}),r.a.createElement("div",null,i))}(e),r.a.createElement(Rt,{id:"rates",orderId:a,siteId:t,showRateNotice:!1,selectedPackages:n.packages.selected,allPackages:s,selectedRates:i,availableRates:c,updateRate:m,errors:o}))};wt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,form:i.a.object.isRequired,values:i.a.object.isRequired,available:i.a.object.isRequired,errors:i.a.object.isRequired,toggleStep:i.a.func.isRequired,updateRate:i.a.func.isRequired};var St=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=Object(M.l)(e,a,n),c=Object(xt.a)(e,a,n);return p()({},s.form.rates,{form:s.form,errors:r&&Object(M.f)(e,a,n).rates,ratesTotal:i?i.total:0,allPackages:Object(pe.a)(e,n),shippingCost:Ct(c),shippingMethod:qt(c)})},function(e){return Object(o.b)({toggleStep:V.U,updateRate:V.Y},e)})(Object(l.localize)(wt)),Pt=a(835),Tt=a(621),zt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(s))),v()(Je()(a),"renderDiscount",function(e){var t=a.props.translate,n=t("WooCommerce Shipping gives you access to USPS Commercial Pricing, which is discounted over Retail rates.");return r.a.createElement("div",{className:"label-purchase-modal__price-item-help"},r.a.createElement(st.a,{className:"label-purchase-modal__price-item-tooltip is-dialog-visible",position:"top center",text:n},r.a.createElement("div",{className:"label-purchase-modal__discount"},t("You save %s with WooCommerce Shipping",{args:[vt()(e,"USD")]}),r.a.createElement(H.a,{icon:"help-outline",size:18}))))}),v()(Je()(a),"renderRow",function(e,t,a,n){var s=I()("label-purchase-modal__price-item",{"label-purchase-modal__price-item-total":n});return r.a.createElement("div",{key:a,className:s},r.a.createElement("div",{className:"label-purchase-modal__price-item-name"},e),r.a.createElement("div",{className:"label-purchase-modal__price-item-amount"},vt()(t,"USD")))}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.priceBreakdown,s=t.translate;if(!a)return null;var i=a.prices,c=a.discount,o=a.total;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("hr",null),i.map(function(t,a){var i=s("Package %(index)s \u2013 %(title)s",{args:{index:a+1,title:t.carrierTitle}});return r.a.createElement(n.Fragment,{key:a},e.renderRow(i,t.rateWithDiscount,a),"ups"===t.carrierId?r.a.createElement("div",{className:"label-purchase-modal__price-item-carrier-account-notice"}," ",s("Your UPS account will be charged")):r.a.createElement("div",null),t.addons.map(function(t,n){return r.a.createElement("div",{key:"addons-"+a,className:"label-purchase-modal__price-item-addons"},e.renderRow(t.title,t.rate,"addon-"+n))}))}),this.renderRow(s("Total"),o,"total",!0),0<c&&this.renderDiscount(c))}}]),t}(n.Component);zt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Dt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{priceBreakdown:Object(M.l)(e,a,n)}})(Object(l.localize)(zt)),At=function(e){var t=e.translate,a=e.normalizationStatus,n=e.form,s=e.orderId,i=e.siteId,c=n.origin,o=n.rates,l=Object.keys(o.values).length;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-info"},a.isSuccess?r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-street"},r.a.createElement("div",null,t("Shipping from")),r.a.createElement("div",null,c.values.address,r.a.createElement("a",{href:"#",onClick:function(){return e.toggleStep(s,i,"origin",!0)}},t("Edit")))):null),r.a.createElement("div",{className:"label-purchase-modal__shipping-summarry-labels"},l+" "+t("shipping label ready","shipping labels ready",{count:l})))};At.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Ut=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(O.a)(a)||n&&!s||!n?{isError:!0}:n?Object(b.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},Vt=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=s.form.origin,c=r&&Object(M.f)(e,a,n).origin;return{orderId:a,siteId:n,errors:c,form:s.form,expanded:i.expanded,normalizationStatus:Ut(p()({},i,{errors:c}))}},function(e){return Object(o.b)({toggleStep:V.U},e)})(At)),Mt=function(e){var t=e.form,a=e.disabled,s=e.busy;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{disabled:a,onClick:t.needsPrintConfirmation?e.confirmPrintLabel:e.purchaseLabel,isPrimary:!0,isBusy:s,className:I()("button")},function(e){var t=e.form,a=e.translate;return t.needsPrintConfirmation?a("Print"):t.isSubmitting?a("Purchasing\u2026"):a("Buy shipping label","Buy shipping labels",{count:Object.keys(t.packages.selected).length})}(e)))};Mt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,disabled:i.a.bool,busy:i.a.bool};var Ft=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n);return{form:r&&s.form}},function(e,t){var a=t.orderId,n=t.siteId;return{confirmPrintLabel:function(){return e(Object(V.j)(a,n))},purchaseLabel:function(){return e(Object(V.B)(a,n))}}})(Object(l.localize)(Mt)),Lt=a(576),Wt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(r))),v()(Je()(a),"onVisibilityChange",function(){document.hidden||a.refetchSettings(),a.creditCardWindow&&a.creditCardWindow.closed&&document.removeEventListener("visibilitychange",a.onVisibilityChange)}),v()(Je()(a),"refetchSettings",function(){a.props.fetchSettings(a.props.siteId)}),v()(Je()(a),"onChooseCard",function(){a.creditCardWindow=window.open(a.props.url),document.addEventListener("visibilitychange",a.onVisibilityChange)}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.disabled,a=e.buttonLabel,s=e.buttonDescription;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{onClick:this.onChooseCard,disabled:t,isPrimary:!0,className:I()("button")},a," ",r.a.createElement(H.a,{icon:"external"})),r.a.createElement("div",{className:"purchase-section__explanation"},s(this.onChooseCard)))}}]),t}(n.Component),Bt=Object(c.b)(function(e){return e},function(e){return Object(o.b)({fetchSettings:Lt.a},e)})(Object(l.localize)(Wt)),Ht=a(648),Yt=(a(818),Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n),i=r&&Object(M.b)(e,a,n),c=r&&s.form;return{form:c,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),paymentMethods:Object(qe.l)(e,n),disablePurchase:!c.needsPrintConfirmation&&(!i||c.isSubmitting)}})(Object(l.localize)(function(e){var t=e.orderId,a=e.siteId,n=e.hasLabelsPaymentMethod,s=e.paymentMethods,i=e.form,c=e.disablePurchase,o=e.translate,l=i.isSubmitting&&!i.needsPrintConfirmation,u=Object(M.n)(i.rates),d=u&&Object.values(i.rates.values).some(function(e){return"ups"!==e.carrierId}),m=n&&d||!d;return r.a.createElement("div",{className:"purchase-section"},m||!u?r.a.createElement(Ft,{siteId:a,orderId:t,disabled:c,busy:l}):s.length?r.a.createElement(Bt,{disabled:c,url:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings",buttonLabel:o("Choose credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}choose a credit card to add to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}):r.a.createElement(Bt,{disabled:c,url:Object(Ht.a)()+"/me/purchases/add-credit-card",buttonLabel:o("Add credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}add a credit card to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}))}))),$t=a(691),Gt=a(536),Kt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(Gt.a)(e);return Object(b.get)(e,["extensions","woocommerce","ui","orders",t,"edits","currentlyEditingId"],null)},Jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(Gt.a)(e),a=Kt(e,t),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(Gt.a)(e);return Object(b.get)(e,["extensions","woocommerce","ui","orders",t,"edits","changes"],{})}(e,t);if(Object(b.isObject)(a)){var r=function(){var e=Object($t.b)(0,"USD");return{status:"pending",currency:"USD",discount_total:e,discount_tax:e,shipping_total:e,shipping_tax:e,cart_tax:e,total:e,total_tax:e,prices_include_tax:!1,billing:{},shipping:{},payment_method:"calypso_manual",payment_method_title:Object(l.translate)("Manual Payment"),line_items:[],tax_lines:[],shipping_lines:[],fee_lines:[],coupon_lines:[],refunds:[]}}();return p()({},r,n,{id:a})}var s=Object(xt.a)(e,a,t);return s?Object(b.merge)({},s,n):n},Qt=a(641),Xt=function(e){var t=e.orderId,a=e.siteId,n=e.form,s=e.errors,i=e.paperSize,c=e.translate,o=e.fulfillOrder,l=e.emailDetails,u=e.order,d=e.hasLabelsPaymentMethod,m=Object(M.n)(n.rates)&&Object.values(n.rates.values).some(function(e){return"ups"!==e.carrierId}),p=d&&m||!m;return r.a.createElement(Pt.a,{className:"label-purchase-modal__sidebar",title:c("Shipping summary")},r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-header"},c("Shipping summary")),r.a.createElement(Vt,{siteId:a,orderId:t}),r.a.createElement(Dt,{siteId:a,orderId:t}),r.a.createElement("hr",null),r.a.createElement("div",{className:"label-purchase-modal__purchase-container"},p?r.a.createElement(E.a,{id:"paper_size",valuesMap:Object(Tt.a)(n.origin.values.country),title:c("Paper size"),value:i,updateValue:function(n){return e.updatePaperSize(t,a,n)},error:s.paperSize}):null,r.a.createElement(Yt,{siteId:a,orderId:t})),r.a.createElement(_t.a,{className:"label-purchase-modal__option-mark-order-fulfilled",label:Object(Qt.b)(u.status)?c("Notify the customer with shipment details"):c("Mark this order as complete and notify the customer"),checked:o||l,onChange:function(n){e.setFulfillOrderOption(t,a,n&&!Object(Qt.b)(u.status)),e.setEmailDetailsOption(t,a,n&&Object(Qt.b)(u.status))}}))};Xt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,paperSize:i.a.string.isRequired,errors:i.a.object.isRequired,form:i.a.object.isRequired,updatePaperSize:i.a.func.isRequired,fulfillOrder:i.a.bool.isRequired,emailDetails:i.a.bool.isRequired,order:i.a.object.isRequired,hasLabelsPaymentMethod:i.a.bool.isRequired,setFulfillOrderOption:i.a.func.isRequired};var Zt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n);return{order:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(Gt.a)(e);return!!Kt(e,t)}(e)?Jt(e):Object(xt.a)(e,a),paperSize:s.paperSize,form:s.form,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),errors:r&&Object(M.f)(e,a,n).sidebar,fulfillOrder:r&&Object(M.v)(e,a,n),emailDetails:r&&Object(M.u)(e,a,n)}},function(e){return Object(o.b)({setEmailDetailsOption:V.M,setFulfillOrderOption:V.N,updatePaperSize:V.X},e)})(Object(l.localize)(Xt)),ea=function(e){var t=e.loaded,a=e.translate,n=e.showPurchaseDialog;if(!t)return null;return n?r.a.createElement(d.a,{className:"woocommerce label-purchase-modal wcc-root",shouldCloseOnClickOutside:!1,onRequestClose:function(){return e.exitPrintingFlow(e.orderId,e.siteId,!1)},title:a("Create shipping label","Create shipping labels",{count:Object.keys(e.form.packages.selected).length})},r.a.createElement("div",{className:"label-purchase-modal__content"},r.a.createElement("div",{className:"label-purchase-modal__main-section"},r.a.createElement(ue,{type:"origin",title:a("Origin address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(ue,{type:"destination",title:a("Destination address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(We,{siteId:e.siteId,orderId:e.orderId}),e.isCustomsFormRequired&&r.a.createElement(bt,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(St,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(Zt,{siteId:e.siteId,orderId:e.orderId}))):null};ea.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};t.default=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(M.t)(e,a,n),s=Object(M.j)(e,a,n);return{loaded:r,form:r&&s.form,showPurchaseDialog:s.showPurchaseDialog,isCustomsFormRequired:Object(M.p)(e,a,n)}},function(e){return Object(o.b)({exitPrintingFlow:V.o},e)})(Object(l.localize)(ea))}}]);
|
|
dist/chunks/{f21fad998bd5b17c6379.min.js → 943063d0aa7c2c49678f.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[155],{624:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),i=0;i<n.length;i++)if(!o(n[i])||e[n[i]]!==t[n[i]])return!1;return!0},e.exports=t.default},644:function(e,t,n){!function(t){"use strict";var n=window;"function"===typeof define&&define.amd?define(function(){return t(n)}):e.exports=t(n)}(function e(t){"use strict";var n=function(t){return e(t)};if(n.version="0.8.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=r,i=t.DocumentFragment,a=t.HTMLTemplateElement,c=t.Node,l=t.NodeFilter,s=t.NamedNodeMap||t.MozNamedAttrMap,u=t.Text,f=t.Comment,d=t.DOMParser,p=!1;if("function"===typeof a){var m=r.createElement("template");m.content&&m.content.ownerDocument&&(r=m.content.ownerDocument)}var h=r.implementation,y=r.createNodeIterator,g=r.getElementsByTagName,v=r.createDocumentFragment,b=o.importNode,k={};n.isSupported="undefined"!==typeof h.createHTMLDocument&&9!==r.documentMode;var T=function(e,t){for(var n=t.length;n--;)"string"===typeof t[n]&&(t[n]=t[n].toLowerCase()),e[t[n]]=!0;return e},x=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},E=null,w=T({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]),A=null,S=T({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),O=null,_=null,L=!0,N=!0,C=!1,M=!1,R=!1,D=/\{\{[\s\S]*|[\s\S]*\}\}/gm,j=/<%[\s\S]*|[\s\S]*%>/gm,F=!1,H=!1,z=!1,P=!1,I=!1,q=!0,W=!0,B=T({},["audio","head","math","script","style","template","svg","video"]),G=T({},["audio","video","img","source","image"]),U=T({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Y=null,J=r.createElement("form"),V=function(e){n.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},K=function(e,t){n.removed.push({attribute:t.getAttributeNode(e),from:t}),t.removeAttribute(e)},X=function(e){var t,n;if(H&&(e="<remove></remove>"+e),p)try{t=(new d).parseFromString(e,"text/html")}catch(r){}return t&&t.documentElement||((n=(t=h.createHTMLDocument("")).body).parentNode.removeChild(n.parentNode.firstElementChild),n.outerHTML=e),g.call(t,F?"html":"body")[0]};n.isSupported&&X('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">').querySelector("svg img")&&(p=!0);var $=function(e){return y.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,function(){return l.FILTER_ACCEPT},!1)},Q=function(e){return"object"===typeof c?e instanceof c:e&&"object"===typeof e&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Z=function(e){var t,r,o;if(ce("beforeSanitizeElements",e,null),!((o=e)instanceof u||o instanceof f)&&!("string"===typeof o.nodeName&&"string"===typeof o.textContent&&"function"===typeof o.removeChild&&o.attributes instanceof s&&"function"===typeof o.removeAttribute&&"function"===typeof o.setAttribute))return V(e),!0;if(t=e.nodeName.toLowerCase(),ce("uponSanitizeElement",e,{tagName:t,allowedTags:E}),!E[t]||O[t]){if(W&&!B[t]&&"function"===typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(i){}return V(e),!0}return!M||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(n.removed.push({element:e.cloneNode()}),e.innerHTML=e.textContent.replace(/</g,"<")),R&&3===e.nodeType&&(r=(r=(r=e.textContent).replace(D," ")).replace(j," "),e.textContent!==r&&(n.removed.push({element:e.cloneNode()}),e.textContent=r)),ce("afterSanitizeElements",e,null),!1},ee=/^data-[\-\w.\u00B7-\uFFFF]/,te=/^aria-[\-\w]+$/,ne=/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,re=/^(?:\w+script|data):/i,oe=/[\x00-\x20\xA0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ie=function(e){var o,i,a,c,l,s,u,f;if(ce("beforeSanitizeAttributes",e,null),s=e.attributes){for(u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A},f=s.length;f--;){if(i=(o=s[f]).name,a=o.value.trim(),c=i.toLowerCase(),u.attrName=c,u.attrValue=a,u.keepAttr=!0,ce("uponSanitizeAttribute",e,u),a=u.attrValue,"name"===c&&"IMG"===e.nodeName&&s.id)l=s.id,s=Array.prototype.slice.apply(s),K("id",e),K(i,e),s.indexOf(l)>f&&e.setAttribute("id",l.value);else{if("INPUT"===e.nodeName&&"type"===c&&"file"===a&&(A[c]||!_[c]))continue;"id"===i&&e.setAttribute(i,""),K(i,e)}if(u.keepAttr&&(!q||"id"!==c&&"name"!==c||!(a in t||a in r||a in J))){if(R&&(a=(a=a.replace(D," ")).replace(j," ")),N&&ee.test(c));else if(L&&te.test(c));else{if(!A[c]||_[c])continue;if(U[c]);else if(ne.test(a.replace(oe,"")));else if("src"!==c&&"xlink:href"!==c||0!==a.indexOf("data:")||!G[e.nodeName.toLowerCase()]){if(C&&!re.test(a.replace(oe,"")));else if(a)continue}else;}try{e.setAttribute(i,a),n.removed.pop()}catch(d){}}}ce("afterSanitizeAttributes",e,null)}},ae=function(e){var t,n=$(e);for(ce("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)ce("uponSanitizeShadowNode",t,null),Z(t)||(t.content instanceof i&&ae(t.content),ie(t));ce("afterSanitizeShadowDOM",e,null)},ce=function(e,t,r){k[e]&&k[e].forEach(function(e){e.call(n,t,r,Y)})};return n.sanitize=function(e,r){var a,l,s,u,f,d;if(e||(e="\x3c!--\x3e"),"string"!==typeof e&&!Q(e)){if("function"!==typeof e.toString)throw new TypeError("toString is not a function");e=e.toString()}if(!n.isSupported){if("object"===typeof t.toStaticHTML||"function"===typeof t.toStaticHTML){if("string"===typeof e)return t.toStaticHTML(e);if(Q(e))return t.toStaticHTML(e.outerHTML)}return e}if(function(e){"object"!==typeof e&&(e={}),E="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS):w,A="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR):S,O="FORBID_TAGS"in e?T({},e.FORBID_TAGS):{},_="FORBID_ATTR"in e?T({},e.FORBID_ATTR):{},L=!1!==e.ALLOW_ARIA_ATTR,N=!1!==e.ALLOW_DATA_ATTR,C=e.ALLOW_UNKNOWN_PROTOCOLS||!1,M=e.SAFE_FOR_JQUERY||!1,R=e.SAFE_FOR_TEMPLATES||!1,F=e.WHOLE_DOCUMENT||!1,z=e.RETURN_DOM||!1,P=e.RETURN_DOM_FRAGMENT||!1,I=e.RETURN_DOM_IMPORT||!1,H=e.FORCE_BODY||!1,q=!1!==e.SANITIZE_DOM,W=!1!==e.KEEP_CONTENT,R&&(N=!1),P&&(z=!0),e.ADD_TAGS&&(E===w&&(E=x(E)),T(E,e.ADD_TAGS)),e.ADD_ATTR&&(A===S&&(A=x(A)),T(A,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&T(U,e.ADD_URI_SAFE_ATTR),W&&(E["#text"]=!0),Object&&"freeze"in Object&&Object.freeze(e),Y=e}(r),n.removed=[],e instanceof c)1===(l=(a=X("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName?a=l:a.appendChild(l);else{if(!z&&!F&&-1===e.indexOf("<"))return e;if(!(a=X(e)))return z?null:""}for(H&&V(a.firstChild),f=$(a);s=f.nextNode();)3===s.nodeType&&s===u||Z(s)||(s.content instanceof i&&ae(s.content),ie(s),u=s);if(z){if(P)for(d=v.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return I&&(d=b.call(o,d,!0)),d}return F?a.outerHTML:a.innerHTML},n.addHook=function(e,t){"function"===typeof t&&(k[e]=k[e]||[],k[e].push(t))},n.removeHook=function(e){k[e]&&k[e].pop()},n.removeHooks=function(e){k[e]&&(k[e]=[])},n.removeAllHooks=function(){k={}},n})},794:function(e,t,n){var r;r=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return v}});var r=n(279),o=n.n(r),i=n(370),a=n.n(i),c=n(817),l=n.n(c);function s(e){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}var t,n,r;return t=e,(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=l()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=l()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==s(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}])&&u(t.prototype,n),r&&u(t,r),e}();function d(e){return(d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"===typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(c,o());var t,n,r,i=h(c);function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=i.call(this)).resolveOptions(t),n.listenClick(e),n}return t=c,r=[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}],(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new f({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}])&&p(t.prototype,n),r&&p(t,r),c}()},828:function(e){var t=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,n){for(;e&&e.nodeType!==t;){if("function"===typeof e.matches&&e.matches(n))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,o,i){var a=function(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}e.exports=function(e,t,n,r,i){return"function"===typeof e.addEventListener?o.apply(null,arguments):"function"===typeof n?o.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return o(e,t,n,r,i)}))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(134)}().default},e.exports=r()},796:function(e,t,n){"use strict";var r=n(37),o=n(543),i=n(10),a=n(528),c=n.n(a),l=n(1);t.a=function(e){var t=e.className,n=e.checked,a=e.id,s=e.onChange,u=void 0===s?l.noop:s,f=Object(o.a)(e,["className","checked","id","onChange"]),d=c()("components-form-toggle",t,{"is-checked":n});return Object(i.createElement)("span",{className:d},Object(i.createElement)("input",Object(r.a)({className:"components-form-toggle__input",id:a,type:"checkbox",checked:n,onChange:u},f)),Object(i.createElement)("span",{className:"components-form-toggle__track"}),Object(i.createElement)("span",{className:"components-form-toggle__thumb"}))}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[155],{625:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),i=0;i<n.length;i++)if(!o(n[i])||e[n[i]]!==t[n[i]])return!1;return!0},e.exports=t.default},643:function(e,t,n){!function(t){"use strict";var n=window;"function"===typeof define&&define.amd?define(function(){return t(n)}):e.exports=t(n)}(function e(t){"use strict";var n=function(t){return e(t)};if(n.version="0.8.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=r,i=t.DocumentFragment,a=t.HTMLTemplateElement,c=t.Node,l=t.NodeFilter,s=t.NamedNodeMap||t.MozNamedAttrMap,u=t.Text,f=t.Comment,d=t.DOMParser,p=!1;if("function"===typeof a){var m=r.createElement("template");m.content&&m.content.ownerDocument&&(r=m.content.ownerDocument)}var h=r.implementation,y=r.createNodeIterator,g=r.getElementsByTagName,v=r.createDocumentFragment,b=o.importNode,k={};n.isSupported="undefined"!==typeof h.createHTMLDocument&&9!==r.documentMode;var T=function(e,t){for(var n=t.length;n--;)"string"===typeof t[n]&&(t[n]=t[n].toLowerCase()),e[t[n]]=!0;return e},x=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},E=null,w=T({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]),A=null,S=T({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),O=null,_=null,L=!0,N=!0,C=!1,M=!1,R=!1,D=/\{\{[\s\S]*|[\s\S]*\}\}/gm,j=/<%[\s\S]*|[\s\S]*%>/gm,F=!1,H=!1,z=!1,P=!1,I=!1,q=!0,W=!0,B=T({},["audio","head","math","script","style","template","svg","video"]),G=T({},["audio","video","img","source","image"]),U=T({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Y=null,J=r.createElement("form"),V=function(e){n.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},K=function(e,t){n.removed.push({attribute:t.getAttributeNode(e),from:t}),t.removeAttribute(e)},X=function(e){var t,n;if(H&&(e="<remove></remove>"+e),p)try{t=(new d).parseFromString(e,"text/html")}catch(r){}return t&&t.documentElement||((n=(t=h.createHTMLDocument("")).body).parentNode.removeChild(n.parentNode.firstElementChild),n.outerHTML=e),g.call(t,F?"html":"body")[0]};n.isSupported&&X('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">').querySelector("svg img")&&(p=!0);var $=function(e){return y.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,function(){return l.FILTER_ACCEPT},!1)},Q=function(e){return"object"===typeof c?e instanceof c:e&&"object"===typeof e&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Z=function(e){var t,r,o;if(ce("beforeSanitizeElements",e,null),!((o=e)instanceof u||o instanceof f)&&!("string"===typeof o.nodeName&&"string"===typeof o.textContent&&"function"===typeof o.removeChild&&o.attributes instanceof s&&"function"===typeof o.removeAttribute&&"function"===typeof o.setAttribute))return V(e),!0;if(t=e.nodeName.toLowerCase(),ce("uponSanitizeElement",e,{tagName:t,allowedTags:E}),!E[t]||O[t]){if(W&&!B[t]&&"function"===typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(i){}return V(e),!0}return!M||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(n.removed.push({element:e.cloneNode()}),e.innerHTML=e.textContent.replace(/</g,"<")),R&&3===e.nodeType&&(r=(r=(r=e.textContent).replace(D," ")).replace(j," "),e.textContent!==r&&(n.removed.push({element:e.cloneNode()}),e.textContent=r)),ce("afterSanitizeElements",e,null),!1},ee=/^data-[\-\w.\u00B7-\uFFFF]/,te=/^aria-[\-\w]+$/,ne=/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,re=/^(?:\w+script|data):/i,oe=/[\x00-\x20\xA0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ie=function(e){var o,i,a,c,l,s,u,f;if(ce("beforeSanitizeAttributes",e,null),s=e.attributes){for(u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A},f=s.length;f--;){if(i=(o=s[f]).name,a=o.value.trim(),c=i.toLowerCase(),u.attrName=c,u.attrValue=a,u.keepAttr=!0,ce("uponSanitizeAttribute",e,u),a=u.attrValue,"name"===c&&"IMG"===e.nodeName&&s.id)l=s.id,s=Array.prototype.slice.apply(s),K("id",e),K(i,e),s.indexOf(l)>f&&e.setAttribute("id",l.value);else{if("INPUT"===e.nodeName&&"type"===c&&"file"===a&&(A[c]||!_[c]))continue;"id"===i&&e.setAttribute(i,""),K(i,e)}if(u.keepAttr&&(!q||"id"!==c&&"name"!==c||!(a in t||a in r||a in J))){if(R&&(a=(a=a.replace(D," ")).replace(j," ")),N&&ee.test(c));else if(L&&te.test(c));else{if(!A[c]||_[c])continue;if(U[c]);else if(ne.test(a.replace(oe,"")));else if("src"!==c&&"xlink:href"!==c||0!==a.indexOf("data:")||!G[e.nodeName.toLowerCase()]){if(C&&!re.test(a.replace(oe,"")));else if(a)continue}else;}try{e.setAttribute(i,a),n.removed.pop()}catch(d){}}}ce("afterSanitizeAttributes",e,null)}},ae=function(e){var t,n=$(e);for(ce("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)ce("uponSanitizeShadowNode",t,null),Z(t)||(t.content instanceof i&&ae(t.content),ie(t));ce("afterSanitizeShadowDOM",e,null)},ce=function(e,t,r){k[e]&&k[e].forEach(function(e){e.call(n,t,r,Y)})};return n.sanitize=function(e,r){var a,l,s,u,f,d;if(e||(e="\x3c!--\x3e"),"string"!==typeof e&&!Q(e)){if("function"!==typeof e.toString)throw new TypeError("toString is not a function");e=e.toString()}if(!n.isSupported){if("object"===typeof t.toStaticHTML||"function"===typeof t.toStaticHTML){if("string"===typeof e)return t.toStaticHTML(e);if(Q(e))return t.toStaticHTML(e.outerHTML)}return e}if(function(e){"object"!==typeof e&&(e={}),E="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS):w,A="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR):S,O="FORBID_TAGS"in e?T({},e.FORBID_TAGS):{},_="FORBID_ATTR"in e?T({},e.FORBID_ATTR):{},L=!1!==e.ALLOW_ARIA_ATTR,N=!1!==e.ALLOW_DATA_ATTR,C=e.ALLOW_UNKNOWN_PROTOCOLS||!1,M=e.SAFE_FOR_JQUERY||!1,R=e.SAFE_FOR_TEMPLATES||!1,F=e.WHOLE_DOCUMENT||!1,z=e.RETURN_DOM||!1,P=e.RETURN_DOM_FRAGMENT||!1,I=e.RETURN_DOM_IMPORT||!1,H=e.FORCE_BODY||!1,q=!1!==e.SANITIZE_DOM,W=!1!==e.KEEP_CONTENT,R&&(N=!1),P&&(z=!0),e.ADD_TAGS&&(E===w&&(E=x(E)),T(E,e.ADD_TAGS)),e.ADD_ATTR&&(A===S&&(A=x(A)),T(A,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&T(U,e.ADD_URI_SAFE_ATTR),W&&(E["#text"]=!0),Object&&"freeze"in Object&&Object.freeze(e),Y=e}(r),n.removed=[],e instanceof c)1===(l=(a=X("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName?a=l:a.appendChild(l);else{if(!z&&!F&&-1===e.indexOf("<"))return e;if(!(a=X(e)))return z?null:""}for(H&&V(a.firstChild),f=$(a);s=f.nextNode();)3===s.nodeType&&s===u||Z(s)||(s.content instanceof i&&ae(s.content),ie(s),u=s);if(z){if(P)for(d=v.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return I&&(d=b.call(o,d,!0)),d}return F?a.outerHTML:a.innerHTML},n.addHook=function(e,t){"function"===typeof t&&(k[e]=k[e]||[],k[e].push(t))},n.removeHook=function(e){k[e]&&k[e].pop()},n.removeHooks=function(e){k[e]&&(k[e]=[])},n.removeAllHooks=function(){k={}},n})},793:function(e,t,n){var r;r=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return v}});var r=n(279),o=n.n(r),i=n(370),a=n.n(i),c=n(817),l=n.n(c);function s(e){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}var t,n,r;return t=e,(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=l()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=l()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==s(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}])&&u(t.prototype,n),r&&u(t,r),e}();function d(e){return(d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"===typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(c,o());var t,n,r,i=h(c);function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=i.call(this)).resolveOptions(t),n.listenClick(e),n}return t=c,r=[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}],(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new f({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}])&&p(t.prototype,n),r&&p(t,r),c}()},828:function(e){var t=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,n){for(;e&&e.nodeType!==t;){if("function"===typeof e.matches&&e.matches(n))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,o,i){var a=function(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}e.exports=function(e,t,n,r,i){return"function"===typeof e.addEventListener?o.apply(null,arguments):"function"===typeof n?o.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return o(e,t,n,r,i)}))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(134)}().default},e.exports=r()},795:function(e,t,n){"use strict";var r=n(37),o=n(543),i=n(10),a=n(528),c=n.n(a),l=n(1);t.a=function(e){var t=e.className,n=e.checked,a=e.id,s=e.onChange,u=void 0===s?l.noop:s,f=Object(o.a)(e,["className","checked","id","onChange"]),d=c()("components-form-toggle",t,{"is-checked":n});return Object(i.createElement)("span",{className:d},Object(i.createElement)("input",Object(r.a)({className:"components-form-toggle__input",id:a,type:"checkbox",checked:n,onChange:u},f)),Object(i.createElement)("span",{className:"components-form-toggle__track"}),Object(i.createElement)("span",{className:"components-form-toggle__thumb"}))}}}]);
|
dist/chunks/{8a47962d1574594e5623.css → 997e476a34f1d4a94b3f.css}
RENAMED
File without changes
|
dist/chunks/{8a47962d1574594e5623.min.js → 997e476a34f1d4a94b3f.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[140],{685:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(530),l=n.n(s),c=n(529),u=n.n(c),p=n(534),d=n.n(p),m=n(531),h=n.n(m),f=n(35),b=n.n(f),g=n(12),v=n.n(g),y=n(10),w=n.n(y),k=n(78),E=n.n(k),C=n(109),R=n(47),I=n.n(R),N=n(528),D=n.n(N),_=n(700),O=n.n(_),P=n(1),x=n(615),j=n(77),q=n.n(j),T=n(716),L=n.n(T),S=I()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function U(){V=M()}var B=!1,F=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",U,!0),window.addEventListener("scroll",U,!0)},H=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",U,!0),window.removeEventListener("scroll",U,!0)},K=function(e,t,n){var i=L()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-r,right:V.width-i.right-r},s=e.split(/\s+/),l=q()(s,1)[0],c=q()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*r,p=0,d=l.length;p<d;p++){var m=l[p],h=W(m,n,i),f=h.left+o,b=h.top+r,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,r),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function W(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var p={};switch(e){case"top":p={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":p={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":p={top:u.top+c/2-a/2,left:u.left+l};break;case"left":p={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":p={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":p={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":p={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":p={top:u.top+c,left:u.left+l/2-15};break;case"left top":p={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":p={top:u.top+c/2,left:u.left-r};break;case"right top":p={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":p={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return p}var Y=function(){},J=I()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(d()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(d()(n)),n.setPosition=n.setPosition.bind(d()(n)),n.onClickout=n.onClickout.bind(d()(n)),n.onKeydown=n.onKeydown.bind(d()(n)),n.onWindowChange=n.onWindowChange.bind(d()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=E.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=E.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=E.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=K(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(W(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=D()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),w.a.createElement(x.a,{className:this.props.rootClassName},w.a.createElement("div",{style:this.getStylePosition(),className:e},w.a.createElement("div",{className:"popover__arrow"}),w.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},717:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(530),l=n.n(s),c=n(529),u=n.n(c),p=n(534),d=n.n(p),m=n(531),h=n.n(m),f=n(35),b=n.n(f),g=n(109),v=n(34),y=n(12),w=n.n(y),k=n(10),E=n.n(k),C=n(1),R=(n(808),n(652)),I=n(537),N=n.n(I),D=n(608),_=n.n(D),O=n(30),P=n(820),x=n(528),j=n.n(x),q=n(582),T=n(685),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"menu",E.a.createRef()),b()(d()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(d()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),E.a.cloneElement(e,{onClick:i})}),b()(d()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(d()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return L(a)?n._getClosestSibling(a,t):a}),b()(d()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(d()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return E.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},E.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},E.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(k.Component);b()(S,"propTypes",{autoPosition:w.a.bool,isVisible:w.a.bool.isRequired,onClose:w.a.func.isRequired,position:w.a.string,className:w.a.string,rootClassName:w.a.string,popoverComponent:w.a.func,popoverTitle:w.a.string,customPosition:w.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:T.a});var M=S,z=(n(809),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"state",{isMenuVisible:!1}),b()(d()(n),"popoverContext",E.a.createRef()),b()(d()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(d()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(d()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=j()("ellipsis-menu__menu","popover",s);return E.a.createElement("span",{className:c},E.a.createElement(q.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},E.a.createElement(N.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),E.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(k.Component));b()(z,"propTypes",{translate:w.a.func,toggleTitle:w.a.string,position:w.a.string,disabled:w.a.bool,onClick:w.a.func,onToggle:w.a.func,popoverClassName:w.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(533),U=n.n(V),B=(n(810),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=j()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(C.assign)({},Object(C.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=E.a.createElement(N.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return E.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(k.Component));b()(B,"defaultProps",{iconSize:18,showIconFirst:!1}),b()(B,"propTypes",{className:w.a.string,href:w.a.string,onClick:w.a.func,icon:w.a.bool,iconSize:w.a.number,target:w.a.string,showIconFirst:w.a.bool,iconClassName:w.a.string});var F=B,H=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=F,s.icon=!0):i&&(c="a"),E.a.createElement(c,U()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&E.a.createElement(N.a,{icon:o,size:18}),t)}}]),t}(k.Component);b()(H,"propTypes",{href:w.a.string,className:w.a.string,isSelected:w.a.bool,icon:w.a.string,focusOnHover:w.a.bool,onMouseOver:w.a.func,isExternalLink:w.a.bool,itemComponent:w.a.oneOfType([w.a.func,w.a.string])}),b()(H,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var K=n(570),W=n(554),Y=n(547),J=n(540),X=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=e.label,p=void 0===u?{}:u,d=function(){return _()(r,a)},m=function(){return e.closeRefundDialog(t,n)},h=[{action:"cancel",label:l("Cancel"),onClick:m},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:d()}})}];return E.a.createElement(K.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:m,buttons:h},E.a.createElement(W.a,null,l("Request a refund")),E.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least %(days)s days to process.",{args:{days:"dhlexpress"===p.carrier_id?"31":"14"}})),E.a.createElement("dl",null,E.a.createElement("dt",null,l("Purchase date")),E.a.createElement("dd",null,c(o).format("LLL")),E.a.createElement("dt",null,l("Amount eligible for refund")),E.a.createElement("dd",null,d())))};X.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,refundDialog:w.a.object,createdDate:w.a.number,refundableAmount:w.a.number,currency:w.a.string,labelId:w.a.number,closeRefundDialog:w.a.func.isRequired,confirmRefund:w.a.func.isRequired};var G=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(J.t)(e,n,i),a=Object(J.j)(e,n,i);return{refundDialog:r?a.refundDialog:{},label:Object(J.g)(e,n,i,o)}},function(e){return Object(O.b)({closeRefundDialog:Y.e,confirmRefund:Y.k},e)})(Object(v.localize)(X)),Q=n(603),Z=n(621),$=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return E.a.createElement(K.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},E.a.createElement(W.a,null,s("Reprint shipping label")),E.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),E.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),E.a.createElement(Q.a,{id:"paper_size",valuesMap:Object(Z.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};$.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,reprintDialog:w.a.object,paperSize:w.a.string.isRequired,storeOptions:w.a.object.isRequired,labelId:w.a.number,closeReprintDialog:w.a.func.isRequired,confirmReprint:w.a.func.isRequired};var ee=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(J.t)(e,n,i),r=Object(J.j)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:Y.f,confirmReprint:Y.l,updatePaperSize:Y.X},e)})(Object(v.localize)($)),te=n(648),ne=n(549),ie=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,p=function(){return e.closeDetailsDialog(t,n)},d=[{action:"close",label:u("Close"),onClick:p}];return E.a.createElement(K.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:p,buttons:d},E.a.createElement(W.a,{className:"shipping-label__label-details-modal-heading"},E.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?E.a.createElement("a",{href:"".concat(Object(te.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),E.a.createElement("dl",null,E.a.createElement("dt",null,u("Service")),E.a.createElement("dd",null,r),E.a.createElement("dt",null,u("Package")),E.a.createElement("dd",null,a),E.a.createElement("dt",null,u("Items")),E.a.createElement("dd",null,E.a.createElement("ul",null,s.map(function(e,t){return E.a.createElement("li",{key:t},e)})))))};ie.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,isVisible:w.a.bool,serviceName:w.a.string,packageName:w.a.string,productNames:w.a.array,closeDetailsDialog:w.a.func.isRequired,receiptId:w.a.number};var oe=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(J.t)(e,n,i),a=Object(J.j)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(ne.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:Y.c},e)})(Object(v.localize)(ie)),re={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},ae=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return E.a.createElement("span",null,i("N/A"));var o=re[n](t);return o?E.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",E.a.createElement(N.a,{icon:"external",size:12})):E.a.createElement("span",null,t)};ae.propTypes={tracking:w.a.string,carrierId:w.a.string};var se=Object(v.localize)(ae),le=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"renderRefund",function(e,t,i,o){var r=n.props,a=r.orderId,s=r.siteId,l=r.translate,c="",u=!1;if(t?(c=l("Labels older than 30 days cannot be refunded."),u=!0):"usps"!==i||o||(c=l("USPS labels without tracking are not eligible for refund."),u=!0),u)return E.a.createElement(P.a,{position:"top left",text:c},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"refund",size:18}),E.a.createElement("span",null," ",l("Request refund")," ")));return E.a.createElement(H,{onClick:function(){n.props.openRefundDialog(a,s,e)},icon:"refund"},l("Request refund"))}),b()(d()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return E.a.createElement(P.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"print",size:18}),E.a.createElement("span",null," ",a("Reprint")," ")));return E.a.createElement(H,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint shipping label"))}),b()(d()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return E.a.createElement(H,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(d()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request",dhlexpress:"https://mydhl.express.dhl/us/en/schedule-pickup.html#/schedule-pickup#label-reference"};if(!i.hasOwnProperty(e))return null;return E.a.createElement(H,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return E.a.createElement(H,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,p=t.showDetails,d=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=t.commercialInvoiceUrl,v=e.siteId,y=e.orderId,w=e.translate,k=e.isModal,C=(new Date).getTime(),R=!1,I=!1;(m||h||d&&d<C)&&(R=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(I=!0),E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},w("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),p&&E.a.createElement("span",null,!k&&E.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I,b,f),this.renderReprint(s,R),this.renderCommercialInvoiceLink(g)),E.a.createElement(oe,{siteId:v,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),E.a.createElement(G,{siteId:v,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),E.a.createElement(ee,{siteId:v,orderId:y,labelId:s}))),p&&E.a.createElement("p",{className:"shipping-label__item-tracking"},w("Tracking #: {{trackingLink/}}",{components:{trackingLink:E.a.createElement(se,{carrierId:b,tracking:f})}})))}}]),t}(k.Component);le.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,label:w.a.shape({serviceName:w.a.string.isRequired,labelIndex:w.a.number.isRequired,packageName:w.a.string.isRequired,productNames:w.a.string.isRequired,receiptId:w.a.number.isRequired,labelId:w.a.number.isRequired,createdDate:w.a.string.isRequired,refundableAmount:w.a.number.isRequired,currency:w.a.string.isRequired,showDetails:w.a.bool.isRequired,expiryDate:w.a.string.isRequired,anonymized:w.a.bool.isRequired,usedDate:w.a.string.isRequired,tracking:w.a.string.isRequired,carrierId:w.a.string.isRequired,commercialInvoiceUrl:w.a.string}).isRequired,isModal:w.a.bool.isRequired,openRefundDialog:w.a.func.isRequired,openReprintDialog:w.a.func.isRequired,openDetailsDialog:w.a.func.isRequired};var ce=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:Y.y,openReprintDialog:Y.z,openDetailsDialog:Y.u},e)})(Object(v.localize)(le)),ue=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),E.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(le);le.propTypes={label:w.a.object.isRequired};var pe=Object(v.localize)(ue),de=n(619),me=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(d()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:E.a.createElement(pe,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:E.a.createElement(ce,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:E.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),E.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(d()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return E.a.createElement("div",{className:"order-activity-log__note"},E.a.createElement("div",{className:"order-activity-log__note-meta"},E.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&E.a.createElement(N.a,{icon:o,size:24})),E.a.createElement("div",{className:"order-activity-log__note-body"},E.a.createElement("div",{className:"order-activity-log__note-type"},r),E.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(k.Component);b()(me,"propTypes",{customer_note:w.a.bool,date_created_gmt:w.a.string,note:w.a.string.isRequired}),b()(me,"propTypes",{event:w.a.object}),b()(me,"defaultProps",{event:{}});var he=Object(v.localize)(me),fe=n(601),be=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=E.a.createElement("div",null,E.a.createElement("h3",null,a),E.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return E.a.createElement("div",{className:"order-activity-log__day"},E.a.createElement(fe.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(k.Component);b()(be,"propTypes",{count:w.a.number.isRequired,date:w.a.string.isRequired,isOpen:w.a.bool.isRequired,onClick:w.a.func.isRequired});var ge=Object(v.localize)(be);var ve=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(d()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?E.a.createElement("div",null,t.map(function(e){var t=i[e];return E.a.createElement(ge,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return E.a.createElement(he,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):E.a.createElement("p",null,o("No activity yet"))}),b()(d()(n),"renderPlaceholder",function(){return E.a.createElement("div",{className:"is-placeholder"},E.a.createElement(ge,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},E.a.createElement(he,null)))}),n}return h()(t,e),a()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(k.Component);b()(ve,"propTypes",{orderId:w.a.number.isRequired,siteId:w.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(R.c)(e,n),o=Object(R.b)(e,n),r=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},a=r?Object(C.keys)(r):[];return a.sort().reverse(),{isLoaded:i,days:a,events:o,eventsByDay:r}})(Object(v.localize)(ve))},808:function(e,t,n){},809:function(e,t,n){},810:function(e,t,n){}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[140],{684:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(530),l=n.n(s),c=n(529),u=n.n(c),p=n(534),d=n.n(p),m=n(531),h=n.n(m),f=n(35),b=n.n(f),g=n(12),v=n.n(g),y=n(10),w=n.n(y),k=n(78),E=n.n(k),C=n(109),R=n(47),I=n.n(R),N=n(528),D=n.n(N),_=n(699),O=n.n(_),P=n(1),x=n(615),j=n(77),q=n.n(j),T=n(715),L=n.n(T),S=I()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function U(){V=M()}var B=!1,F=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",U,!0),window.addEventListener("scroll",U,!0)},H=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",U,!0),window.removeEventListener("scroll",U,!0)},K=function(e,t,n){var i=L()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-r,right:V.width-i.right-r},s=e.split(/\s+/),l=q()(s,1)[0],c=q()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*r,p=0,d=l.length;p<d;p++){var m=l[p],h=W(m,n,i),f=h.left+o,b=h.top+r,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,r),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function W(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var p={};switch(e){case"top":p={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":p={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":p={top:u.top+c/2-a/2,left:u.left+l};break;case"left":p={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":p={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":p={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":p={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":p={top:u.top+c,left:u.left+l/2-15};break;case"left top":p={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":p={top:u.top+c/2,left:u.left-r};break;case"right top":p={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":p={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return p}var Y=function(){},J=I()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(d()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(d()(n)),n.setPosition=n.setPosition.bind(d()(n)),n.onClickout=n.onClickout.bind(d()(n)),n.onKeydown=n.onKeydown.bind(d()(n)),n.onWindowChange=n.onWindowChange.bind(d()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=E.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=E.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=E.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=K(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(W(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=D()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),w.a.createElement(x.a,{className:this.props.rootClassName},w.a.createElement("div",{style:this.getStylePosition(),className:e},w.a.createElement("div",{className:"popover__arrow"}),w.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},716:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(530),l=n.n(s),c=n(529),u=n.n(c),p=n(534),d=n.n(p),m=n(531),h=n.n(m),f=n(35),b=n.n(f),g=n(109),v=n(34),y=n(12),w=n.n(y),k=n(10),E=n.n(k),C=n(1),R=(n(808),n(650)),I=n(537),N=n.n(I),D=n(608),_=n.n(D),O=n(30),P=n(820),x=n(528),j=n.n(x),q=n(582),T=n(684),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"menu",E.a.createRef()),b()(d()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(d()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),E.a.cloneElement(e,{onClick:i})}),b()(d()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(d()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return L(a)?n._getClosestSibling(a,t):a}),b()(d()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(d()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return E.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},E.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},E.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(k.Component);b()(S,"propTypes",{autoPosition:w.a.bool,isVisible:w.a.bool.isRequired,onClose:w.a.func.isRequired,position:w.a.string,className:w.a.string,rootClassName:w.a.string,popoverComponent:w.a.func,popoverTitle:w.a.string,customPosition:w.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:T.a});var M=S,z=(n(809),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"state",{isMenuVisible:!1}),b()(d()(n),"popoverContext",E.a.createRef()),b()(d()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(d()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(d()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=j()("ellipsis-menu__menu","popover",s);return E.a.createElement("span",{className:c},E.a.createElement(q.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},E.a.createElement(N.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),E.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(k.Component));b()(z,"propTypes",{translate:w.a.func,toggleTitle:w.a.string,position:w.a.string,disabled:w.a.bool,onClick:w.a.func,onToggle:w.a.func,popoverClassName:w.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(533),U=n.n(V),B=(n(810),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=j()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(C.assign)({},Object(C.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=E.a.createElement(N.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return E.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(k.Component));b()(B,"defaultProps",{iconSize:18,showIconFirst:!1}),b()(B,"propTypes",{className:w.a.string,href:w.a.string,onClick:w.a.func,icon:w.a.bool,iconSize:w.a.number,target:w.a.string,showIconFirst:w.a.bool,iconClassName:w.a.string});var F=B,H=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=F,s.icon=!0):i&&(c="a"),E.a.createElement(c,U()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&E.a.createElement(N.a,{icon:o,size:18}),t)}}]),t}(k.Component);b()(H,"propTypes",{href:w.a.string,className:w.a.string,isSelected:w.a.bool,icon:w.a.string,focusOnHover:w.a.bool,onMouseOver:w.a.func,isExternalLink:w.a.bool,itemComponent:w.a.oneOfType([w.a.func,w.a.string])}),b()(H,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var K=n(570),W=n(555),Y=n(547),J=n(540),X=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=e.label,p=void 0===u?{}:u,d=function(){return _()(r,a)},m=function(){return e.closeRefundDialog(t,n)},h=[{action:"cancel",label:l("Cancel"),onClick:m},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:d()}})}];return E.a.createElement(K.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:m,buttons:h},E.a.createElement(W.a,null,l("Request a refund")),E.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least %(days)s days to process.",{args:{days:"dhlexpress"===p.carrier_id?"31":"14"}})),E.a.createElement("dl",null,E.a.createElement("dt",null,l("Purchase date")),E.a.createElement("dd",null,c(o).format("LLL")),E.a.createElement("dt",null,l("Amount eligible for refund")),E.a.createElement("dd",null,d())))};X.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,refundDialog:w.a.object,createdDate:w.a.number,refundableAmount:w.a.number,currency:w.a.string,labelId:w.a.number,closeRefundDialog:w.a.func.isRequired,confirmRefund:w.a.func.isRequired};var G=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(J.t)(e,n,i),a=Object(J.j)(e,n,i);return{refundDialog:r?a.refundDialog:{},label:Object(J.g)(e,n,i,o)}},function(e){return Object(O.b)({closeRefundDialog:Y.e,confirmRefund:Y.k},e)})(Object(v.localize)(X)),Q=n(604),Z=n(622),$=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return E.a.createElement(K.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},E.a.createElement(W.a,null,s("Reprint shipping label")),E.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),E.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),E.a.createElement(Q.a,{id:"paper_size",valuesMap:Object(Z.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};$.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,reprintDialog:w.a.object,paperSize:w.a.string.isRequired,storeOptions:w.a.object.isRequired,labelId:w.a.number,closeReprintDialog:w.a.func.isRequired,confirmReprint:w.a.func.isRequired};var ee=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(J.t)(e,n,i),r=Object(J.j)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:Y.f,confirmReprint:Y.l,updatePaperSize:Y.X},e)})(Object(v.localize)($)),te=n(647),ne=n(549),ie=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,p=function(){return e.closeDetailsDialog(t,n)},d=[{action:"close",label:u("Close"),onClick:p}];return E.a.createElement(K.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:p,buttons:d},E.a.createElement(W.a,{className:"shipping-label__label-details-modal-heading"},E.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?E.a.createElement("a",{href:"".concat(Object(te.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),E.a.createElement("dl",null,E.a.createElement("dt",null,u("Service")),E.a.createElement("dd",null,r),E.a.createElement("dt",null,u("Package")),E.a.createElement("dd",null,a),E.a.createElement("dt",null,u("Items")),E.a.createElement("dd",null,E.a.createElement("ul",null,s.map(function(e,t){return E.a.createElement("li",{key:t},e)})))))};ie.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,isVisible:w.a.bool,serviceName:w.a.string,packageName:w.a.string,productNames:w.a.array,closeDetailsDialog:w.a.func.isRequired,receiptId:w.a.number};var oe=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(J.t)(e,n,i),a=Object(J.j)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(ne.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:Y.c},e)})(Object(v.localize)(ie)),re={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},ae=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return E.a.createElement("span",null,i("N/A"));var o=re[n](t);return o?E.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",E.a.createElement(N.a,{icon:"external",size:12})):E.a.createElement("span",null,t)};ae.propTypes={tracking:w.a.string,carrierId:w.a.string};var se=Object(v.localize)(ae),le=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"renderRefund",function(e,t,i,o){var r=n.props,a=r.orderId,s=r.siteId,l=r.translate,c="",u=!1;if(t?(c=l("Labels older than 30 days cannot be refunded."),u=!0):"usps"!==i||o||(c=l("USPS labels without tracking are not eligible for refund."),u=!0),u)return E.a.createElement(P.a,{position:"top left",text:c},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"refund",size:18}),E.a.createElement("span",null," ",l("Request refund")," ")));return E.a.createElement(H,{onClick:function(){n.props.openRefundDialog(a,s,e)},icon:"refund"},l("Request refund"))}),b()(d()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return E.a.createElement(P.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"print",size:18}),E.a.createElement("span",null," ",a("Reprint")," ")));return E.a.createElement(H,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint shipping label"))}),b()(d()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return E.a.createElement(H,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(d()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request",dhlexpress:"https://mydhl.express.dhl/us/en/schedule-pickup.html#/schedule-pickup#label-reference"};if(!i.hasOwnProperty(e))return null;return E.a.createElement(H,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return E.a.createElement(H,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,p=t.showDetails,d=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=t.commercialInvoiceUrl,v=e.siteId,y=e.orderId,w=e.translate,k=e.isModal,C=(new Date).getTime(),R=!1,I=!1;(m||h||d&&d<C)&&(R=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(I=!0),E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},w("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),p&&E.a.createElement("span",null,!k&&E.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I,b,f),this.renderReprint(s,R),this.renderCommercialInvoiceLink(g)),E.a.createElement(oe,{siteId:v,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),E.a.createElement(G,{siteId:v,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),E.a.createElement(ee,{siteId:v,orderId:y,labelId:s}))),p&&E.a.createElement("p",{className:"shipping-label__item-tracking"},w("Tracking #: {{trackingLink/}}",{components:{trackingLink:E.a.createElement(se,{carrierId:b,tracking:f})}})))}}]),t}(k.Component);le.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,label:w.a.shape({serviceName:w.a.string.isRequired,labelIndex:w.a.number.isRequired,packageName:w.a.string.isRequired,productNames:w.a.string.isRequired,receiptId:w.a.number.isRequired,labelId:w.a.number.isRequired,createdDate:w.a.string.isRequired,refundableAmount:w.a.number.isRequired,currency:w.a.string.isRequired,showDetails:w.a.bool.isRequired,expiryDate:w.a.string.isRequired,anonymized:w.a.bool.isRequired,usedDate:w.a.string.isRequired,tracking:w.a.string.isRequired,carrierId:w.a.string.isRequired,commercialInvoiceUrl:w.a.string}).isRequired,isModal:w.a.bool.isRequired,openRefundDialog:w.a.func.isRequired,openReprintDialog:w.a.func.isRequired,openDetailsDialog:w.a.func.isRequired};var ce=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:Y.y,openReprintDialog:Y.z,openDetailsDialog:Y.u},e)})(Object(v.localize)(le)),ue=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),E.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(le);le.propTypes={label:w.a.object.isRequired};var pe=Object(v.localize)(ue),de=n(618),me=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(d()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:E.a.createElement(pe,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:E.a.createElement(ce,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:E.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),E.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(d()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return E.a.createElement("div",{className:"order-activity-log__note"},E.a.createElement("div",{className:"order-activity-log__note-meta"},E.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&E.a.createElement(N.a,{icon:o,size:24})),E.a.createElement("div",{className:"order-activity-log__note-body"},E.a.createElement("div",{className:"order-activity-log__note-type"},r),E.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(k.Component);b()(me,"propTypes",{customer_note:w.a.bool,date_created_gmt:w.a.string,note:w.a.string.isRequired}),b()(me,"propTypes",{event:w.a.object}),b()(me,"defaultProps",{event:{}});var he=Object(v.localize)(me),fe=n(602),be=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=E.a.createElement("div",null,E.a.createElement("h3",null,a),E.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return E.a.createElement("div",{className:"order-activity-log__day"},E.a.createElement(fe.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(k.Component);b()(be,"propTypes",{count:w.a.number.isRequired,date:w.a.string.isRequired,isOpen:w.a.bool.isRequired,onClick:w.a.func.isRequired});var ge=Object(v.localize)(be);var ve=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(d()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?E.a.createElement("div",null,t.map(function(e){var t=i[e];return E.a.createElement(ge,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return E.a.createElement(he,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):E.a.createElement("p",null,o("No activity yet"))}),b()(d()(n),"renderPlaceholder",function
|