!function(){"use strict";var e,t={7005:function(e,t,n){var r=n(1609),a=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var r,c={},i=null,p=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(p=t.ref),t)o.call(t,r)&&!s.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:a,type:e,key:i,ref:p,props:c,_owner:l.current}}},9255:function(e,t,n){e.exports=n(7005)},5323:function(e,t,n){var r=window.wp.blocks,a=window.wp.primitives,o=n(9255),l=(0,o.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(a.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})}),s=window.wp.blockEditor,c=window.wp.components,i=window.wp.data,p=window.wp.element,u=window.wp.i18n;const d={style:{typography:{fontSize:"14px",lineHeight:"1.4"}}},f=["surecart/cart-line-item-variant"];var m=JSON.parse('{"UU":"surecart/cart-line-item-details"}');(0,r.registerBlockType)(m.UU,{edit:e=>{let{clientId:t,attributes:n,setAttributes:a}=e;const{expanded:o=!1,collapseAfter:l=2}=n,m=(0,s.useBlockProps)({className:"sc-cart-line-item-details"+(o?" sc-cart-line-item-details--is-expanded":"")}),h=(s.useInnerBlocksProps?s.useInnerBlocksProps:s.__experimentalUseInnerBlocksProps)({className:"sc-cart-line-item-details__content"},{templateLock:!1,allowedBlocks:f,renderAppender:!1}),_=(0,i.useSelect)((e=>e(s.store).getBlocks(t).length>0),[t]),{replaceInnerBlocks:w}=(0,i.useDispatch)(s.store);return(0,p.useEffect)((()=>{!_&&t&&w(t,[(0,r.createBlock)("surecart/cart-line-item-variant",d)],!1)}),[_,t]),React.createElement(React.Fragment,null,React.createElement(s.InspectorControls,null,React.createElement(c.PanelBody,{title:(0,u.__)("Details","surecart")},React.createElement(c.ToggleControl,{label:(0,u.__)("Expanded by default","surecart"),help:(0,u.__)("When on, the details (variant, bundle items) show expanded on load. When off, they stay collapsed until the shopper expands them.","surecart"),checked:o,onChange:e=>a({expanded:e})}),React.createElement(c.RangeControl,{label:(0,u.__)("Collapse after (lines)","surecart"),help:(0,u.__)("The expand toggle only shows when the details exceed this many lines.","surecart"),value:l,onChange:e=>a({collapseAfter:e||2}),min:1,max:6}))),React.createElement("div",m,React.createElement("div",h),React.createElement("span",{className:"sc-cart-line-item-details__toggle","aria-hidden":"true"},React.createElement("span",{className:"sc-cart-line-item-details__toggle-label"},o?(0,u.__)("Show less","surecart"):(0,u.__)("Show more","surecart")),React.createElement("span",{className:"sc-cart-line-item-details__toggle-icon"+(o?" sc-cart-line-item-details__toggle-icon--rotated":"")},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},React.createElement("polyline",{points:"6 9 12 15 18 9"}))))))},save:function(){return React.createElement(s.InnerBlocks.Content,null)},icon:l})},1609:function(e){e.exports=window.React}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,n,a,o){if(!n){var l=1/0;for(p=0;p<e.length;p++){n=e[p][0],a=e[p][1],o=e[p][2];for(var s=!0,c=0;c<n.length;c++)(!1&o||l>=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(s=!1,o<l&&(l=o));if(s){e.splice(p--,1);var i=a();void 0!==i&&(t=i)}}return t}o=o||0;for(var p=e.length;p>0&&e[p-1][2]>o;p--)e[p]=e[p-1];e[p]=[n,a,o]},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={6355:0,1803:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,o,l=n[0],s=n[1],c=n[2],i=0;if(l.some((function(t){return 0!==e[t]}))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(c)var p=c(r)}for(t&&t(n);i<l.length;i++)o=l[i],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(p)},n=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[1803],(function(){return r(5323)}));a=r.O(a)}();