FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
packages
/
blocks-next
/
build
/
blocks
/
cart
Edit File: index.js
!function(){var t,e={1552:function(t,e,r){"use strict";var o=window.wp.blocks,n=window.wp.i18n,a=window.wp.blockEditor,l=window.wp.components,i=window.wp.element,c=window.wp.data;const p=[["core/group",{style:{spacing:{padding:{top:"1.5em",bottom:"0em",left:"2em",right:"2em"}}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between"}},[["surecart/cart-close-button",{style:{typography:{lineHeight:"1"}}}],["core/paragraph",{style:{typography:{fontSize:"16px",lineHeight:"1",fontStyle:"normal",fontWeight:"500"},spacing:{padding:{top:"0px",bottom:"0px",left:"0px",right:"0px"},margin:{top:"0px",bottom:"0px",left:"0px",right:"0px"}}},content:"Review My Order"}],["surecart/cart-count",{style:{layout:{selfStretch:"fit",flexSize:null},typography:{lineHeight:"1",fontWeight:"600",fontSize:"14px",fontStyle:"normal"},spacing:{padding:{top:"6px",bottom:"6px",left:"10px",right:"10px"}},border:{radius:"4px"}}}]]],["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"default"}},[["surecart/slide-out-cart-line-items",{border:!1,padding:{top:"0em",right:"0em",bottom:"0em",left:"0em"},metadata:{ignoredHookedBlocks:["surecart/cart-line-item-divider"]},style:{spacing:{padding:{top:"2em",bottom:"2em",left:"2em",right:"2em"},blockGap:"2em"}}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null},dimensions:{minHeight:""}},layout:{type:"default"}},[["core/group",{style:{layout:{selfStretch:"fit",flexSize:null}},layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"stretch"}},[["surecart/cart-line-item-image",{aspectRatio:"1",width:"",height:"",style:{layout:{selfStretch:"fixed",flexSize:"80px"},border:{width:"1px",radius:"4px"},color:{duotone:"unset"},spacing:{margin:{top:"0",bottom:"0"}}}}],["core/group",{style:{layout:{selfStretch:"fill",flexSize:null},spacing:{blockGap:"5px"}},layout:{type:"flex",orientation:"vertical",justifyContent:"stretch",flexWrap:"nowrap",verticalAlignment:"top"}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"stretch",justifyContent:"space-between"}},[["core/group",{style:{layout:{selfStretch:"fixed",flexSize:"50%"},spacing:{blockGap:"0px"}},layout:{type:"default"}},[["surecart/cart-line-item-title",{style:{typography:{fontStyle:"normal",fontWeight:"500",lineHeight:"1.4",textDecoration:"none"}}}],["core/group",{style:{spacing:{blockGap:"0px"}},layout:{type:"default"}},[["surecart/cart-line-item-price-name",{style:{typography:{fontSize:"14px",lineHeight:"1.4"}}}],["surecart/cart-line-item-variant",{style:{typography:{fontSize:"14px",lineHeight:"1.4"}}}],["surecart/cart-line-item-note",{style:{typography:{fontSize:"14px",lineHeight:"1.4"}}}]]],["surecart/cart-line-item-status",{style:{typography:{textAlign:"right"}}}]]],["core/group",{style:{layout:{selfStretch:"fit",flexSize:null},spacing:{blockGap:"0px"}},layout:{type:"default"}},[["core/group",{style:{spacing:{blockGap:"4px"},typography:{lineHeight:"1.4"}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"right"}},[["surecart/cart-line-item-scratch-amount",{}],["surecart/cart-line-item-amount",{style:{typography:{fontStyle:"normal",fontWeight:"500",textAlign:"right"}}}],["surecart/cart-line-item-interval",{style:{typography:{fontSize:"14px"}}}]]],["core/group",{style:{spacing:{blockGap:"0px"}},layout:{type:"default"}},[["surecart/cart-line-item-trial",{style:{typography:{fontSize:"14px",textAlign:"right"}}}],["surecart/cart-line-item-fees",{style:{typography:{fontSize:"14px",textAlign:"right"}}}]]]]]]],["core/group",{layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between",verticalAlignment:"center"}},[["core/group",{style:{layout:{selfStretch:"fill",flexSize:null}},layout:{type:"default"}},[["surecart/cart-line-item-quantity",{}]]],["core/group",{style:{layout:{selfStretch:"fit",flexSize:null},spacing:{blockGap:"0px"}},layout:{type:"flex",orientation:"vertical",justifyContent:"right"}},[["surecart/cart-line-item-remove",{style:{typography:{fontSize:"14px",fontStyle:"normal",fontWeight:"400"}}}]]]]]]]]]]]]],["core/group",{style:{spacing:{padding:{top:"0em",bottom:"0em",left:"0em",right:"0em"}},border:{top:{color:"#b0b0b069",width:"1px"}}},layout:{type:"default"}},[["surecart/cart-order-bumps",{style:{spacing:{padding:{top:"1.5em",bottom:"1.5em",left:"2em",right:"2em"}},border:{right:{},bottom:{color:"#b0b0b069",width:"1px"},left:{}}}},[["core/group",{style:{spacing:{margin:{bottom:"0.75em"}}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"space-between",verticalAlignment:"center"}},[["core/paragraph",{content:"Suggested for you",style:{typography:{fontStyle:"normal",fontWeight:"500"},spacing:{margin:{top:"0",bottom:"0"}}}}],["surecart/cart-order-bump-pagination",{style:{spacing:{blockGap:"0.25em"}}},[["surecart/cart-order-bump-pagination-previous",{}],["surecart/cart-order-bump-pagination-next",{}]]]]],["surecart/cart-order-bump-template",{style:{spacing:{blockGap:"0.75em"}},layout:{type:"flex"}},[["core/group",{style:{spacing:{padding:{top:"0.75em",bottom:"0.75em",left:"0.75em",right:"1em"}},layout:{selfStretch:"fill",flexSize:null}},layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"center"}},[["surecart/cart-order-bump-image",{width:"72px",style:{border:{radius:"8px"},layout:{selfStretch:"fixed",flexSize:"72px"}}}],["core/group",{style:{layout:{selfStretch:"fill",flexSize:null},spacing:{blockGap:"2px"}},layout:{type:"flex",orientation:"vertical"}},[["surecart/cart-order-bump-title",{style:{typography:{fontSize:"15px",fontStyle:"normal",fontWeight:"600",lineHeight:"1.3"}}}],["surecart/cart-order-bump-description",{style:{typography:{fontSize:"13px",lineHeight:"1.3"},color:{text:"#6b7280"}}}],["core/group",{style:{spacing:{blockGap:"4px"}},layout:{type:"flex",flexWrap:"nowrap"}},[["surecart/cart-order-bump-scratch-amount",{style:{typography:{fontSize:"14px"}}}],["surecart/cart-order-bump-amount",{style:{typography:{fontSize:"14px",fontWeight:"500"}}}]]]]],["surecart/cart-order-bump-add-button",{style:{typography:{fontSize:"18px",fontWeight:"400",fontStyle:"normal"},border:{radius:{topLeft:"74.6%",topRight:"74.6%",bottomLeft:"74.6%",bottomRight:"74.6%"},width:"1px",color:"#d1d5db"},spacing:{padding:{top:"0.5em",bottom:"0.5em",left:"0.5em",right:"0.5em"}}}}]]]]]]],["core/group",{style:{spacing:{padding:{top:"2em",bottom:"2em",left:"2em",right:"2em"},margin:{top:"0",bottom:"0"}}},layout:{type:"constrained"}},[["surecart/slide-out-cart-items-subtotal",{layout:{type:"flex",justifyContent:"space-between",flexWrap:"nowrap",verticalAlignment:"top"}},[["core/group",{style:{spacing:{blockGap:"0px"}},layout:{type:"default"}},[["core/paragraph",{content:"Subtotal",style:{typography:{fontStyle:"normal",fontWeight:"500",fontSize:"18px",lineHeight:"1.4"},spacing:{margin:{top:"0px",bottom:"0px"}}}}],["core/paragraph",{content:"Taxes & shipping calculated at checkout",style:{typography:{fontSize:"14px",lineHeight:"1.4"},color:{text:"var(--sc-input-help-text-color)"},elements:{link:{color:{text:"var(--sc-input-help-text-color)"}}}}}]]],["core/group",{style:{spacing:{blockGap:"4px"}},layout:{type:"flex",flexWrap:"nowrap",justifyContent:"right"}},[["surecart/cart-subtotal-scratch-amount",{style:{typography:{fontSize:"18px",lineHeight:"1.4"}}}],["surecart/cart-subtotal-amount",{style:{typography:{fontSize:"18px",fontStyle:"normal",fontWeight:"500",lineHeight:"1.4"}}}]]]]],["surecart/slide-out-cart-items-submit",{style:{border:{radius:"4px"}}}]]]]]]]];var s=r(3373),u=r.n(s),y=window.wp.compose;window.wp.coreData,window.wp.htmlEntities;const f=(t,e)=>(0,c.useSelect)((r=>{const{getBlockRootClientId:o,getPatternsByBlockTypes:n}=r(a.store),l=o(t);return n(e,l)}),[e,t]);function g(t){let{clientId:e,attributes:r,setIsPatternSelectionModalOpen:p,name:s}=t;const[u,g]=(0,i.useState)(""),{replaceBlock:m,selectBlock:h}=(0,c.useDispatch)(a.store),d=(0,i.useMemo)((()=>({previewPostType:"sc_product"})),["sc_product"]),x=function(t,e,r){const n=(0,c.useSelect)((t=>t(o.store).getActiveBlockVariation(r,e)?.name),[e]),l=`${r}/${n}`;return(0,c.useSelect)((e=>{if(!n)return!1;const{getBlockRootClientId:r,getPatternsByBlockTypes:o}=e(a.store),i=r(t);return o(l,i).length>0}),[t,n,l])?l:r}(e,r,s),b=f(e,x),S=(0,i.useMemo)((()=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;const r=t.map((t=>[t,getPatternSearchRank(t,e)])).filter((t=>{let[,e]=t;return e>0}));return r.sort(((t,e)=>{let[,r]=t,[,o]=e;return o-r})),r.map((t=>{let[e]=t;return e}))}(b,u)),[b,u]),w=(0,y.useAsyncList)(S);return React.createElement(l.Modal,{overlayClassName:"block-library-query-pattern__selection-modal",title:(0,n.__)("Choose a pattern","surecart"),onRequestClose:()=>p(!1),isFullScreen:!0},React.createElement("div",{className:"block-library-query-pattern__selection-content"},React.createElement("div",{className:"block-library-query-pattern__selection-search"},React.createElement(l.SearchControl,{__nextHasNoMarginBottom:!0,onChange:g,value:u,label:(0,n.__)("Search for patterns","surecart"),placeholder:(0,n.__)("Search","surecart")})),React.createElement(a.BlockContextProvider,{value:d},React.createElement(a.__experimentalBlockPatternsList,{blockPatterns:S,shownPatterns:w,onClickPattern:(t,n)=>{const{newBlocks:a,queryClientIds:l}=((t,e,r)=>{const{namespace:n}=e,a=t.map((t=>(0,o.cloneBlock)(t))),l=[],i=[...a];for(;i.length>0;){const t=i.shift();t.name===r&&(n&&(t.attributes.namespace=n),l.push(t.clientId)),t.innerBlocks?.forEach((t=>{i.push(t)}))}return{newBlocks:a,queryClientIds:l}})(n,r,s);a[0]&&(a[0].attributes={...a[0].attributes,...r}),m(e,a),l[0]&&h(l[0])}}))))}var m=t=>{let{openPatternSelectionModal:e,name:r,clientId:o}=t;const a=!!f(o,r).length;return React.createElement(React.Fragment,null,a&&React.createElement(l.ToolbarGroup,{className:"wp-block-template-part__block-control-group"},React.createElement(l.ToolbarButton,{onClick:e},(0,n.__)("Replace"))))},h=JSON.parse('{"UU":"surecart/slide-out-cart"}');(0,o.registerBlockType)(h.UU,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"16",height:"16",viewBox:"0 0 28 28",stroke:"currentColor",style:{fill:"none"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},React.createElement("circle",{cx:"9",cy:"21",r:"1"}),React.createElement("circle",{cx:"20",cy:"21",r:"1"}),React.createElement("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})),edit:t=>{let{attributes:e,name:r,attributes:{width:o},clientId:s,setAttributes:y,__unstableLayoutClassNames:f}=t;const h=window?.scBlockData?.theme||window?.scData?.theme||"light",[d,x]=(0,i.useState)(!1),b=(0,c.useSelect)((t=>!!t(a.store).getBlocksByName("surecart/slide-out-cart-submit").length)),S=(0,a.useBlockProps)({style:{fontSize:"16px",fontFamily:"var(--sc-font-sans)",maxWidth:`max(400px, ${o})`},className:u()("sc-cart__editor-container","surecart-theme-"+h,f)}),w=(0,a.useInnerBlocksProps)(S,{template:p,style:{maxWidth:`max(400px, ${o})`}},{renderAppender:a.InnerBlocks.ButtonBlockAppender}),v=(0,l.__experimentalUseCustomUnits)({availableUnits:(0,a.useSettings)("spacing.units")||["%","px","em","rem","vw"]});return d?React.createElement(g,{clientId:s,attributes:e,setIsPatternSelectionModalOpen:x,name:r}):React.createElement(React.Fragment,null,React.createElement(a.InspectorControls,null,React.createElement(l.PanelBody,null,React.createElement(a.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,n.__)("Width","surecart"),labelPosition:"top",__unstableInputWidth:"80px",value:o,onChange:t=>y({width:t}),units:v}))),React.createElement(a.BlockControls,null,React.createElement(m,{name:r,clientId:s,openPatternSelectionModal:x})),b&&React.createElement(l.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The current template for cart is outdated. Please upgrade to a newer version by clicking "),React.createElement(l.Button,{onClick:()=>{x(!0)},variant:"link"},(0,n.__)(" here.","surecart"))),React.createElement("div",w))},save:function(){return React.createElement(a.InnerBlocks.Content,null)}})},3373:function(t,e){var r;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=l(t,a(r)))}return t}function a(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)o.call(t,r)&&t[r]&&(e=l(e,r));return e}function l(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):void 0===(r=function(){return n}.apply(e,[]))||(t.exports=r)}()}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,o),a.exports}o.m=e,t=[],o.O=function(e,r,n,a){if(!r){var l=1/0;for(s=0;s<t.length;s++){r=t[s][0],n=t[s][1],a=t[s][2];for(var i=!0,c=0;c<r.length;c++)(!1&a||l>=a)&&Object.keys(o.O).every((function(t){return o.O[t](r[c])}))?r.splice(c--,1):(i=!1,a<l&&(l=a));if(i){t.splice(s--,1);var p=n();void 0!==p&&(e=p)}}return e}a=a||0;for(var s=t.length;s>0&&t[s-1][2]>a;s--)t[s]=t[s-1];t[s]=[r,n,a]},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={1071:0,7687:0};o.O.j=function(e){return 0===t[e]};var e=function(e,r){var n,a,l=r[0],i=r[1],c=r[2],p=0;if(l.some((function(e){return 0!==t[e]}))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(c)var s=c(o)}for(e&&e(r);p<l.length;p++)a=l[p],o.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return o.O(s)},r=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var n=o.O(void 0,[7687],(function(){return o(1552)}));n=o.O(n)}();
Save
Back