@rokt/dcui-orchestrator 1.2.1-rc.54 → 1.2.1-rc.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -84,14 +84,17 @@
84
84
  ${Gs(t.dark)}
85
85
  }
86
86
  `:e`${Gs(t.light)}`}(u?si(p,d,u):o.css,t.color);return e.jsxs("button",{ref:c,type:"button",className:[f,i].filter(Boolean).join(" "),style:{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",minHeight:25,maxHeight:55,minWidth:150,padding:"0 16px",backgroundColor:"var(--paypal-button-background)",backgroundImage:"none",boxShadow:"none",border:"1px solid var(--paypal-button-border)",cursor:a?"not-allowed":"pointer",opacity:a?.5:void 0},onClick:e=>{if(a)return e.preventDefault(),void e.stopPropagation();null==r||r(e)},disabled:a,"aria-label":n,"aria-disabled":a,tabIndex:s,"data-testid":l,"data-e2e":"PayPalButton",children:[e.jsx(_s,{variant:"blue"}),e.jsx(_s,{variant:"white"})]})}));function zs(n){const i=n.schema.styles,a=Ma(),o="Backward"===n.schema.direction?"Previous":"Next",{tabIndex:r,styles:s,isDisabled:l}=C(a),c=l||!0===n.disabled;return e.jsx(Bo,{styles:i,children:({classnames:i})=>{var a;return e.jsx("button",{title:o,className:null==i?void 0:i.own,onClick:n.onClick,"data-testid":n.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${n.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(a=n.schema.a11yLabel)&&void 0!==a?a:o,tabIndex:n.disabled?-1:r,style:Object.assign({cursor:"pointer"},s),children:e.jsx(gi,{children:e=>t.Children.toArray(n.schema.children.map(((t,i)=>e(t,void 0,n.testId?`${n.testId}-child${i}`:void 0))))})})}})}const qs="ACTIVE/ADD",Ks="ACTIVE/DELETE",Ws="BREAKPOINT/UPDATE_ACTIVE",Ys="BREAKPOINT/INITIALISE",Js="BREAKPOINT/SET_BREAKPOINTS",Qs="ATTRIBUTES/SET",Xs="FONTS/SET",el="LAYOUT/UPDATE",tl="CONFIG/HANDLE",nl="PLUGIN/CLOSE_PLUGIN",il="SETTINGS/SET",al="SETTINGS/SET_BOTTOMSHEET_VISIBLE_HEIGHT",ol="CACHE/ADD_SERIALIZED_VALUE",rl="CACHE/UPDATE_SERIALIZED_VALUE",sl="CACHE/CLEAR_SERIALIZED_VALUE",ll="SIGNAL/QUEUE",cl="SIGNAL/PROCESSED",dl="SIGNAL/PROCESS",ul="rokt_minimize",pl="rokt_backdrop",fl="ERROR/REPORT",hl="LOG",vl="CUSTOM_STATES/SET",yl="DOMAIN_STATES/SET",ml="FORM_STATES/REGISTER_FIELD",Cl="FORM_STATES/UNREGISTER_FIELD",gl="FORM_STATES/SET_FIELD_VALUE",bl="FORM_STATES/SET_FIELD_TOUCHED",El="FORM_STATES/VALIDATE_FIELDS",Il={LAYOUT_UPDATE:el,UPDATE_ACTIVE_BREAKPOINT:Ws,INITIALISE_BREAKPOINT:Ys,ACTIVE_ADD:qs,ACTIVE_DELETE:Ks,SET_ATTRIBUTES:Qs,SET_FONTS:Xs,QUEUE_SIGNAL:ll,SIGNAL_PROCESSED:cl,CACHE_SERIALIZED_VALUE:ol,UPDATE_CACHED_SERIALIZED_VALUE:rl,CLEAR_SERIALIZED_VALUE_FROM_CACHE:sl,SET_SETTINGS:il,SET_BOTTOMSHEET_VISIBLE_HEIGHT:al,SET_CUSTOM_STATE:vl,SET_DOMAIN_STATE_REDUCER:yl,REGISTER_FORM_FIELD:ml,UNREGISTER_FORM_FIELD:Cl,SET_FORM_FIELD_VALUE:gl,SET_FORM_FIELD_TOUCHED:bl,VALIDATE_FORM_FIELDS:El},xl={HANDLE_CONFIG:tl,SET_BREAKPOINTS:Js,CLOSE_PLUGIN:nl,RAISE_METRIC:$e,PREPARE_SIGNAL:ct,DISMISS_OVERLAY:yt,REPORT_ERROR:fl,LOG:hl,OPEN_LINK:dt};function Ll(n){const{schema:a,testId:o}=n,r=t.useContext(Wa),s=mi(null,(e=>{var t;return void 0!==(null===(t=e.domainStates)||void 0===t?void 0:t.layoutMinimized)?e.domainStates.layoutMinimized:null})),l=!(null==s||!s),c=i.useDispatch(),d=Ma(),{tabIndex:u,styles:p,isDisabled:f}=C(d),h=t.useCallback((()=>{f||c({type:yl,payload:{key:K,value:l?0:1}})}),[c,l,f]);return r?e.jsx(Bo,{styles:a.styles,children:({classnames:n})=>{var i;return e.jsx("button",{title:l?"Maximize":"Minimize",className:null==n?void 0:n.own,onClick:h,"data-testid":o,"data-e2e":"MinimizeButton",disabled:f,tabIndex:u,"aria-disabled":f,"aria-expanded":!l,"aria-label":null!==(i=a.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},p),children:e.jsx(gi,{children:e=>t.Children.toArray(a.children.map(((t,n)=>e(t,void 0,o?`${o}-child${n}`:void 0))))})})}}):null}const Dl="plugin";function wl(e,t=0){var n;const i=null===(n=null==e?void 0:e.elements)||void 0===n?void 0:n.own;if(!Array.isArray(i))return!1;for(let e=i.length<=1?0:2===i.length?0===t?0:1:Math.min(t,i.length-1);e>=0;e-=1)if("object"==typeof(a=i[e])&&null!==a&&Object.values(a).some((e=>{var t;const n="object"==typeof e&&null!==e?null===(t=e.dimension)||void 0===t?void 0:t.height:void 0;return"fixed"===(null==n?void 0:n.type)||"percentage"===(null==n?void 0:n.type)||"fit"===(null==n?void 0:n.type)&&"fit-height"===(null==n?void 0:n.value)})))return!0;var a;return!1}function Sl(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const Al=a.sortBy(a.prop(1)),Ol=a.map(a.prop(0)),Tl=e=>a.compose(a.findIndex(a.equals(e)),Ol,Al,a.toPairs,a.pathOr({},["breakpoint","breakpoints"]));function Ml(e){return Tl(e.breakpoint.activeBreakpoint)(e)}function jl(e,t){return e.customStates[`module${t}`]||{}}function kl(e,t){return e.firedEvents[`module${t}`]||{}}const Rl={};function Vl(e,t){return e.formStates[`module${t}`]||Rl}function Pl(e){return`${e.name}:${e.parentGuid}`}const _l=Number.NaN,Hl=/^\d+(\.\d+)?$/;function Nl(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0}function Fl(e){if(Nl(e))return e;if("string"==typeof e&&Hl.test(e.trim())){const t=Number(e.trim());return Nl(t)?t:_l}return _l}function $l(e){return null===e||"object"!=typeof e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Fl(t)])))}function Zl(e){return null!=e?e:null}function Gl(){return new Set([mt])}function Bl(){return new Map}function Ul(e){return void 0!==e?`module${e}`:"root"}function zl(e,t=e.value){const n=J(t,e.validations);return Object.assign(Object.assign({},e),{value:t,validated:!0,error:n,valid:""===n})}const ql={layout:function(e=Zl(),t){return t.type===el?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Ws:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case Ys:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},$l(t.payload.breakpoints)),initialised:!0};default:return e}},active:function(e=Gl(),t){var n,i;switch(t.type){case qs:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case Ks:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},attributes:function(e={},t){return t.type===Qs?Object.assign(Object.assign({},e),t.payload):e},fonts:function(e=[],t){return t.type===Xs?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case ll:return a.evolve({queue:n=>Kl(e,t.payload.signal)?a.uniqBy(a.pipe(a.prop("signal"),Pl),n.concat(t.payload)):n},e);case cl:return a.evolve({queue:e=>a.reject(a.pipe(a.prop("signal"),a.whereEq({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:a.append(Pl(t.payload))},e);default:return e}},serializableCache:function(e=Bl(),t){switch(t.type){case ol:case rl:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case sl:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0,closeOnNegativeResponse:"NEVER",allowEscToClose:!1,minimizeOnComplete:!1,explicitCloseOnComplete:!1,bottomsheetVisibleHeight:null},t){switch(t.type){case il:{const n=a.mergeDeepWith(((e,t)=>a.isNil(t)?e:t),e,t.payload);return Object.assign(Object.assign({},n),{explicitCloseOnComplete:e.explicitCloseOnComplete||"closeOnComplete"in t.payload&&!0===t.payload.closeOnComplete})}case al:return Object.assign(Object.assign({},e),{bottomsheetVisibleHeight:t.payload.height});default:return e}},customStates:function(e={root:{}},t){if(t.type===vl){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return a.assocPath([n,t.payload.key],Number(t.payload.value),e)}return e}return e},firedEvents:function(e={root:{}},t){var n;if(t.type===lt){if(!(null===(n=t.payload)||void 0===n?void 0:n.event))return e;const i=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return a.assocPath([i,t.payload.event],!0,e)}return e},formStates:function(e={root:{}},t){var n,i;switch(t.type){case ml:{const{offerPositionIndex:i,formKey:o,fieldKey:r,defaultValue:s,validations:l}=t.payload,c=[Ul(i),o,r],d=null!==(n=a.path(c,e))&&void 0!==n?n:function(e={}){return Object.assign({value:"",defaultValue:"",error:"",touched:!1,validated:!1,valid:!1,errorVisible:!1,validations:[],registrationCount:1},e)}({value:s,defaultValue:s,registrationCount:0}),u=d.value!==d.defaultValue,p=Object.assign(Object.assign({},d),{value:u?d.value:s,defaultValue:s,validations:l.filter(be),registrationCount:d.registrationCount+1});return a.assocPath(c,zl(p),e)}case Cl:{const{offerPositionIndex:n,formKey:i,fieldKey:o}=t.payload,r=[Ul(n),i,o],s=a.path(r,e);return s?a.assocPath(r,Object.assign(Object.assign({},s),{registrationCount:Math.max(0,s.registrationCount-1)}),e):e}case gl:{const{offerPositionIndex:n,formKey:i,fieldKey:o,value:r,validate:s}=t.payload,l=[Ul(n),i,o],c=a.path(l,e);if(!c)return e;const d=Object.assign(Object.assign({},zl(c,r)),{errorVisible:c.errorVisible||s});return a.assocPath(l,d,e)}case bl:{const{offerPositionIndex:n,formKey:i,fieldKey:o}=t.payload,r=[Ul(n),i,o],s=a.path(r,e);return!s||s.touched?e:a.assocPath(r,Object.assign(Object.assign({},s),{touched:!0}),e)}case El:{const{offerPositionIndex:n,entries:o}=t.payload,r=Ul(n);return X(null!==(i=e[r])&&void 0!==i?i:{},o).reduce(((e,{formKey:t,fieldKey:n})=>{const i=[r,t,n],o=a.path(i,e);return o&&W(o)?a.assocPath(i,Object.assign(Object.assign({},zl(o)),{errorVisible:!0}),e):e}),e)}default:return e}}};function Kl(e,t){return!e.processed.includes(Pl(t))||(n=t.name,void 0!==Ie.find((e=>e===n)));var n}const Wl={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Yl;function Jl({isOpen:n,schema:o,testId:r,children:s}){const l=Kt(),c=i.useSelector((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=i.useSelector((e=>e.active.has(Dl))),u=i.useSelector(Ml),p=i.useDispatch(),f=()=>{p({type:xl.DISMISS_OVERLAY,payload:{id:mt,dismissalMethod:pl}})};t.useEffect((()=>{c&&p({type:Je,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),t.useEffect((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const h=Ma(),{tabIndex:v,isDisabled:y,styles:m}=C(h),g=o.styles?a.mergeRight(Wl,o.styles):Wl,b=wl(o.styles,u);if(!n)return null;const E=e.jsx(gi,{children:e=>t.Children.toArray(o.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e.jsx(Bo,{styles:g,children:({classnames:t})=>{var n;return e.jsxs("div",{className:null==t?void 0:t.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:b?"hidden":"auto"},m),"aria-label":null!==(n=o.a11yLabel)&&void 0!==n?n:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:v,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e.jsx("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:o.allowBackdropToClose?f:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(E,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Yl||(Yl={}));const Ql={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};function Xl({isOpen:n,schema:o,testId:r,children:s}){const l=Kt(),c=i.useSelector((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=i.useSelector((e=>e.active.has(Dl))),u=i.useSelector(Ml),p=i.useDispatch(),f=()=>{p({type:xl.DISMISS_OVERLAY,payload:{id:mt,dismissalMethod:pl}})};t.useEffect((()=>{c&&p({type:Je,payload:{name:"SignalActivation",parentGuid:c}})}),[c,p]),t.useEffect((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const h=Ma(),{tabIndex:v,isDisabled:y,styles:m}=C(h),g=o.styles?a.mergeRight(Ql,o.styles):Ql,b=wl(o.styles,u);if(!n)return null;const E=e.jsx(gi,{children:e=>{var n;return t.Children.toArray((null!==(n=o.children)&&void 0!==n?n:[]).map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))}});return e.jsx(Bo,{styles:g,children:({classnames:t})=>{var n;return e.jsxs("div",{className:null==t?void 0:t.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:b?"hidden":"auto"},m),"aria-label":null!==(n=o.a11yLabel)&&void 0!==n?n:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:v,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e.jsx("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:o.allowBackdropToClose?f:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(E,l)]})}})}const ec="undefined"!=typeof window;function tc(){const e=i.useDispatch(),n=i.useSelector((e=>{var t;return!0===(null===(t=null==e?void 0:e.settings)||void 0===t?void 0:t.allowEscToClose)}));t.useEffect((()=>{if(!ec||!n)return;const t=t=>{"Escape"===t.key&&e({type:xl.DISMISS_OVERLAY,payload:{id:mt,dismissalMethod:"escape_key"}})};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}}),[])}const nc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ic=t.forwardRef((function({schema:t,testId:n,children:o,isAttached:r},s){tc();const l=i.useSelector(Ml),c=wl(t.styles,l),d=t.styles?a.mergeRight(nc,t.styles):nc;return e.jsx(Bo,{styles:d,children:({classnames:t})=>e.jsx("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:r?"center":void 0,marginBlock:r?"auto":void 0,maxHeight:c?"100%":void 0,overflowY:c?"auto":void 0},ref:s,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:o})})}));const ac=i.connect((function(e){return{isOpen:e.active.has(mt)}}))((function(t){return e.jsx(Jl,Object.assign({},t,{children:(n,i)=>e.jsx(ic,Object.assign({},t,{ref:i,children:n}))}))}));const oc=i.connect((function(e){return{isOpen:e.active.has(mt)}}));function rc(e){const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return 0===i?0:(n.offsetPx-t.offsetPx)/i}const sc=1e5,lc="data-rokt-bottomsheet-no-drag";function cc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}function dc(e){return e?1:0}function uc(e){return{type:yl,payload:{key:K,value:e}}}function pc(e,t){var n,i,a,o;const r=null!==(i=null===(n=e.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0;return(null!==(o=null===(a=t.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r}function fc(e,t,n){const i=Math.round(n);t.current=i,e.current&&(e.current.style.transform=`translateY(${i}px)`)}function hc(e,t){e.current&&(e.current.style.visibility="visible")}function vc(e,t,n){fc(e,t,n),hc(e)}function yc(e,t,n=200){e.current&&(e.current.style.transition=t?`transform ${n}ms`:"")}function mc(e,t,n,i){const[a,o]=i?[t,e]:[e,t],r=n?{fadeIn:"opacity .5s",fadeOut:"opacity .2s"}:{fadeIn:"",fadeOut:""};o.current&&(o.current.style.transition=r.fadeIn),a.current&&(a.current.style.transition=r.fadeOut)}function Cc(e,t,n,i="auto"){const a=t.current;a&&(e.current&&(clearTimeout(e.current),e.current=null),a.style.opacity=n?"0":"1",n||"none"===i?a.style.pointerEvents="none":e.current=setTimeout((()=>{a.style.pointerEvents="auto",e.current=null}),400))}function gc(e,t){e.current&&(e.current.style.height=`${t}px`)}const bc=(e,n,a=!0)=>{const o=t.useRef(null),r=t.useRef(null),s=t.useRef(null),l=t.useRef(null),c=t.useRef(null),d=t.useRef(null),u=t.useRef(!e),p=t.useRef(!1),f=t.useRef(n),h=t.useRef(null),v=mi(null,(e=>{var t;return void 0!==(null===(t=e.domainStates)||void 0===t?void 0:t.layoutMinimized)?e.domainStates.layoutMinimized:null})),y=null!=v?v:dc(e),m=a&&!!y,g=t.useRef(m);g.current=m;const[b,E]=t.useState(!!e&&a),[I,x]=t.useState(!0),L=i.useDispatch();t.useEffect((()=>{L(uc(dc(e)))}),[]);const D=Ma(),w=t.useRef(0),S=t.useRef(!1),A=t.useRef(0),O=t.useRef([]),T=t.useRef(void 0),M=t.useRef(0),j=t.useRef(null),{isDisabled:k}=C(D),R=t.useCallback(((e=0)=>{const t=c.current;return!!(o.current&&r.current&&l.current&&t)&&(0===t.clientHeight?(e<1&&requestAnimationFrame((()=>{R(e+1)})),!1):(vc(r,w,t.clientHeight),requestAnimationFrame((()=>{yc(r,!0,800),vc(r,w,0),u.current=!1})),!0))}),[]),V=t.useCallback((e=>{e||gc(o,sc)}),[]),P=t.useCallback((e=>{if(u.current)return;p.current=!0,yc(r,!0),mc(l,c,!0,e),!e&&c.current&&(c.current.style.transition="opacity .3s .2s"),vc(r,w,e?pc(l,c):0),Cc(d,l,!e,"auto"),Cc(d,c,e),V(e);const t=r.current;t&&t.addEventListener("transitionend",(()=>{p.current=!1}),{once:!0})}),[V]),_=t.useCallback(((e,t)=>{p.current||S.current||(u.current?R():(yc(r,e),t?function(e,t,n,i,a){var o,r;if(0===(null!==(r=null===(o=i.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:0))return;const s=pc(n,i);fc(e,a,s+80),gc(t,sc),hc(e),requestAnimationFrame((()=>{yc(e,!0,200),fc(e,a,s)}))}(r,o,l,c,w):(vc(r,w,0),gc(o,sc))))}),[R]),H=t.useCallback((e=>{L(uc(dc(e)))}),[L]),N=t.useCallback((()=>function(e){const{velocityPxPerMs:t,currentOffsetPx:n}=e;return!(n<=0)&&(n>=48||t>=.2)}({velocityPxPerMs:rc(O.current),currentOffsetPx:w.current})),[]),F=t.useCallback((()=>{var e,t;S.current&&(e=O.current,t=w.current,e.push({offsetPx:t,timestamp:Date.now()}),e.length>20&&e.shift(),requestAnimationFrame(F))}),[]),$=t.useCallback((()=>{O.current=[],F()}),[F]),Z=t.useCallback((e=>{var t,n;if(!r.current)return;e.preventDefault();const i=(null!==(t=cc(e))&&void 0!==t?t:0)-(null!==(n=T.current)&&void 0!==n?n:0),a=M.current+i,o=a<0?Math.max(-80,.35*a):a;vc(r,w,o)}),[]),G=t.useCallback((function e(){document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",e),document.removeEventListener("touchmove",Z),document.removeEventListener("touchend",e),j.current=null,T.current=void 0,S.current=!1,yc(r,!0),mc(l,c,!0,!1);N()?H(!0):vc(r,w,0)}),[N,Z,H]),B=t.useCallback((()=>{j.current={onDrag:Z,onDragStop:G},document.addEventListener("touchmove",Z,{passive:!1}),document.addEventListener("touchend",G),document.addEventListener("mousemove",Z,{passive:!1}),document.addEventListener("mouseup",G)}),[Z,G]),U=t.useCallback((e=>{var t;if(!a)return;if(Date.now()-A.current<200)return;if(A.current=Date.now(),k)return;if(m)return;const n=e.target;if(!(null===(t=null==n?void 0:n.closest)||void 0===t?void 0:t.call(n,`[${lc}]`))&&!S.current){const t=cc(e);if(void 0===t)return;S.current=!0,M.current=w.current,$(),T.current=t,yc(r,!1),mc(l,c,!1,!1),B()}}),[a,m,k,$,B]);return t.useEffect((()=>{const e=r.current;if(e&&"default"===n)return e.addEventListener("mousedown",U),e.addEventListener("touchstart",U),()=>{e.removeEventListener("mousedown",U),e.removeEventListener("touchstart",U)}}),[r,U,n]),t.useLayoutEffect((()=>{if("default"!==n)return;const e=r.current;e&&(e.style.visibility="hidden",e.style.transform="translateY(1000px)")}),[n]),t.useEffect((()=>{if("default"!==n)return void(f.current=n);const e="default"!==f.current;if(f.current=n,!e)return;x(!0),c.current&&(c.current.style.transition="none",c.current.style.opacity="0",c.current.style.pointerEvents="none");const t=requestAnimationFrame((()=>requestAnimationFrame((()=>{_(u.current,m)}))));return()=>cancelAnimationFrame(t)}),[n,_,m]),t.useEffect((()=>{if(I)return Cc(d,l,!m,"auto"),Cc(d,c,m),void requestAnimationFrame((()=>{mc(l,c,!0,m),E(m),x(!1)}));b!==m&&(E(m),P(m),L(Ec(m)))}),[m,b,I,L,P]),t.useEffect((()=>{const e=()=>{const e=function(e,t){const n=t.current,i=e.current;if(!n||!i)return 0;const a=parseFloat(getComputedStyle(n).paddingBottom)||0;return Math.ceil(i.getBoundingClientRect().bottom-n.getBoundingClientRect().top+a)}(l,s);e>0&&e!==h.current&&(h.current=e,L({type:al,payload:{height:e}}))},t=function(e,t){let n;const i=()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)};return i.cancel=()=>{n&&(clearTimeout(n),n=void 0)},i}(100,(()=>{const t=g.current;e(),p.current||S.current||(u.current?_(u.current,t):t?function(e,t,n,i,a){var o,r;if(0===(null!==(r=null===(o=i.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:0))return;const s=pc(n,i);yc(e,!1),fc(e,a,s),gc(t,sc),hc(e)}(r,o,l,c,w):(yc(r,!1),vc(r,w,0),gc(o,sc)))})),n=l.current,i=c.current,a=new ResizeObserver(t);return n&&a.observe(n),i&&a.observe(i),()=>{a.disconnect(),t.cancel()}}),[_,n,L]),t.useEffect((()=>()=>{d.current&&clearTimeout(d.current),S.current=!1;const e=j.current;e&&(document.removeEventListener("touchmove",e.onDrag),document.removeEventListener("touchend",e.onDragStop),document.removeEventListener("mousemove",e.onDrag),document.removeEventListener("mouseup",e.onDragStop),j.current=null)}),[]),{wrapperRef:o,containerRef:r,sheetRef:s,minimizedChildRef:l,maximizedChildRef:c,isMinimized:m,setMinimized:H}},Ec=e=>({type:Je,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const Ic={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};function xc({schema:n,testId:o,minimized:r,onMinimize:s,onClose:l}){const c=Kt(),d=t.useRef(null),u=i.useSelector((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),p=i.useSelector((e=>e.active.has(Dl))),f=i.useDispatch(),[h,v]=t.useState(!1);t.useEffect((()=>{const e=window.setTimeout((()=>{v(!0)}),200);return()=>window.clearTimeout(e)}),[]);const y=h&&!r,m=null!=l?l:s,g=y&&!!m,b=!r;t.useEffect((()=>{const e=d.current;if(!e||!b)return;const t=e=>{e.preventDefault()};return e.addEventListener("touchmove",t,{passive:!1}),e.addEventListener("wheel",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t)}}),[b]),t.useEffect((()=>{u&&f({type:Je,payload:{name:"SignalActivation",parentGuid:u}})}),[u,f]),t.useEffect((()=>{p&&requestAnimationFrame((()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()}))}),[p,c]);const E=Ma(),{tabIndex:I,isDisabled:x,styles:L}=C(E),D=n.styles?a.mergeRight(Ic,n.styles):Ic;return e.jsx(Bo,{styles:D,children:({classnames:t})=>{var i;return e.jsx("div",{ref:c,className:null==t?void 0:t.wrapper,style:Object.assign(Object.assign(Object.assign({height:sc,top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex"},y?{}:{backgroundColor:"transparent"}),{opacity:y?"1":"0",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"}),L),"aria-label":null!==(i=n.a11yLabel)&&void 0!==i?i:void 0,"aria-hidden":x,role:"dialog","aria-modal":!0,tabIndex:I,"data-testid":o,"data-e2e":"Overlay-Wrapper",children:e.jsx("div",{ref:d,style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1",pointerEvents:b?"auto":"none",touchAction:b?"none":void 0},onClick:g?m:void 0,"data-testid":o&&`${o}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function Lc({className:n,style:i}){const a=Ua(),o=ia(),r=xi()||document.head,s=si(a,o,r),l=li(a,o,r),c=t.useMemo((()=>s`
87
+ display: flex;
88
+ justify-content: center;
89
+ `),[s]),d=t.useMemo((()=>s`
87
90
  position: relative;
88
91
  z-index: 10;
89
92
  width: 48px;
90
93
  height: 4px;
91
94
  background-color: #c6c6c8;
92
95
  border-radius: 2px;
93
- margin: 0 auto 6px;
94
- `),[s]);return e.jsx("div",{"data-testid":"drag-handle",className:l(c,n),style:i})}const Dc="#D5D7DA";function wc(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t}}function Sc(e){return e&&"object"==typeof e&&"light"in e?{light:e.light?wc(e.light):void 0,dark:e.dark?wc(e.dark):void 0}:{light:void 0,dark:void 0}}function Ac(e){if(null==e)return"0 0 0 0";const t=String(e).trim().split(/\s+/),n=Number(t[0])||0;return`${n} ${t.length>1?Number(t[1])||0:n} 0 0`}function Oc(e,t,n,i){var o,r,s,l,c,d,u,p,f,h,v,y,m,C,g,b;const E=null==t?void 0:t.elements,I=null==E?void 0:E.own,x=function(e){var t;if(!Array.isArray(e))return{};const n={},i={};for(const a of e){const e=null==a?void 0:a.default;e&&(e.border&&(null!=e.border.borderColor&&(n.borderColor=e.border.borderColor),null!=e.border.borderWidth&&(n.borderWidth=e.border.borderWidth),null!=e.border.borderRadius&&(n.borderRadius=e.border.borderRadius),null!=e.border.borderStyle&&(n.borderStyle=e.border.borderStyle)),null!=(null===(t=e.background)||void 0===t?void 0:t.backgroundColor)&&(i.backgroundColor=e.background.backgroundColor))}return Object.assign(Object.assign({},Object.keys(n).length>0&&{border:n}),Object.keys(i).length>0&&{background:i})}(null!=i?i:I),L=Sc(null===(o=x.border)||void 0===o?void 0:o.borderColor),D=null!==(r=L.light)&&void 0!==r?r:Dc,w=L.dark,S=null!==(l=function(e){if(null==e)return;const t=String(e).trim().split(/\s+/).map(Number);if(0===t.length)return;const[n,i=n,a=n,o=i]=t;return[n,i,a,o]}(null===(s=x.border)||void 0===s?void 0:s.borderWidth))&&void 0!==l?l:[1,1,1,1],[A,O,,T]=S,M=null!==(d=null===(c=x.border)||void 0===c?void 0:c.borderStyle)&&void 0!==d?d:"solid",j=Sc(null===(u=x.background)||void 0===u?void 0:u.backgroundColor),k=null!==(p=j.light)&&void 0!==p?p:"#FFFFFF",R=j.dark,V=null!==(h=null===(f=x.border)||void 0===f?void 0:f.borderColor)&&void 0!==h?h:{light:Dc},P=null!==(y=null===(v=x.background)||void 0===v?void 0:v.backgroundColor)&&void 0!==y?y:{light:"#FFF"},_={border:{borderRadius:Ac(null===(m=x.border)||void 0===m?void 0:m.borderRadius),borderColor:V,borderWidth:`${A} ${O} 0 ${T}`,borderStyle:M},background:{backgroundColor:P},dimension:{height:{type:"percentage",value:100}},container:{overflow:"hidden"}},H=null!==(g=null===(C=null==I?void 0:I[0])||void 0===C?void 0:C.default)&&void 0!==g?g:{},N=I&&I.length>0?[a.mergeRight(I[0],{default:a.mergeRight(H,Object.fromEntries(["border","background","dimension","container"].map((e=>{var t;return[e,a.mergeRight(null!==(t=H[e])&&void 0!==t?t:{},_[e])]}))))}),...I.slice(1)]:[{default:_}],F=a.mergeRight(null!=t?t:{},{elements:Object.assign(Object.assign({},E),{own:N,wrapper:null!==(b=null==E?void 0:E.wrapper)&&void 0!==b?b:[]})}),$=[w&&`border-left-color: ${w}; border-right-color: ${w};`,R&&`background-color: ${R};`].filter(Boolean).join(" ");return{mergedStyles:F,tailClass:e`
96
+ margin: 0 0 6px;
97
+ `),[s]);return e.jsx("div",{"data-testid":"drag-handle-container",className:c,style:i,children:e.jsx("div",{"data-testid":"drag-handle",className:l(d,n)})})}const Dc="#D5D7DA";function wc(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t}}function Sc(e){return e&&"object"==typeof e&&"light"in e?{light:e.light?wc(e.light):void 0,dark:e.dark?wc(e.dark):void 0}:{light:void 0,dark:void 0}}function Ac(e){if(null==e)return"0 0 0 0";const t=String(e).trim().split(/\s+/),n=Number(t[0])||0;return`${n} ${t.length>1?Number(t[1])||0:n} 0 0`}function Oc(e,t,n,i){var o,r,s,l,c,d,u,p,f,h,v,y,m,C,g,b;const E=null==t?void 0:t.elements,I=null==E?void 0:E.own,x=function(e){var t;if(!Array.isArray(e))return{};const n={},i={};for(const a of e){const e=null==a?void 0:a.default;e&&(e.border&&(null!=e.border.borderColor&&(n.borderColor=e.border.borderColor),null!=e.border.borderWidth&&(n.borderWidth=e.border.borderWidth),null!=e.border.borderRadius&&(n.borderRadius=e.border.borderRadius),null!=e.border.borderStyle&&(n.borderStyle=e.border.borderStyle)),null!=(null===(t=e.background)||void 0===t?void 0:t.backgroundColor)&&(i.backgroundColor=e.background.backgroundColor))}return Object.assign(Object.assign({},Object.keys(n).length>0&&{border:n}),Object.keys(i).length>0&&{background:i})}(null!=i?i:I),L=Sc(null===(o=x.border)||void 0===o?void 0:o.borderColor),D=null!==(r=L.light)&&void 0!==r?r:Dc,w=L.dark,S=null!==(l=function(e){if(null==e)return;const t=String(e).trim().split(/\s+/).map(Number);if(0===t.length)return;const[n,i=n,a=n,o=i]=t;return[n,i,a,o]}(null===(s=x.border)||void 0===s?void 0:s.borderWidth))&&void 0!==l?l:[1,1,1,1],[A,O,,T]=S,M=null!==(d=null===(c=x.border)||void 0===c?void 0:c.borderStyle)&&void 0!==d?d:"solid",j=Sc(null===(u=x.background)||void 0===u?void 0:u.backgroundColor),k=null!==(p=j.light)&&void 0!==p?p:"#FFFFFF",R=j.dark,V=null!==(h=null===(f=x.border)||void 0===f?void 0:f.borderColor)&&void 0!==h?h:{light:Dc},P=null!==(y=null===(v=x.background)||void 0===v?void 0:v.backgroundColor)&&void 0!==y?y:{light:"#FFF"},_={border:{borderRadius:Ac(null===(m=x.border)||void 0===m?void 0:m.borderRadius),borderColor:V,borderWidth:`${A} ${O} 0 ${T}`,borderStyle:M},background:{backgroundColor:P},dimension:{height:{type:"percentage",value:100}},container:{overflow:"hidden"}},H=null!==(g=null===(C=null==I?void 0:I[0])||void 0===C?void 0:C.default)&&void 0!==g?g:{},N=I&&I.length>0?[a.mergeRight(I[0],{default:a.mergeRight(H,Object.fromEntries(["border","background","dimension","container"].map((e=>{var t;return[e,a.mergeRight(null!==(t=H[e])&&void 0!==t?t:{},_[e])]}))))}),...I.slice(1)]:[{default:_}],F=a.mergeRight(null!=t?t:{},{elements:Object.assign(Object.assign({},E),{own:N,wrapper:null!==(b=null==E?void 0:E.wrapper)&&void 0!==b?b:[]})}),$=[w&&`border-left-color: ${w}; border-right-color: ${w};`,R&&`background-color: ${R};`].filter(Boolean).join(" ");return{mergedStyles:F,tailClass:e`
95
98
  width: 100%;
96
99
  height: ${n}vh;
97
100
  border-radius: 0;
package/dist/index.js CHANGED
@@ -84,14 +84,17 @@ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as i from
84
84
  ${tc(t.dark)}
85
85
  }
86
86
  `:e`${tc(t.light)}`}(u?bo(p,c,u):Ue,t.color);return n("button",{ref:d,type:"button",className:[f,a].filter(Boolean).join(" "),style:{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",minHeight:25,maxHeight:55,minWidth:150,padding:"0 16px",backgroundColor:"var(--paypal-button-background)",backgroundImage:"none",boxShadow:"none",border:"1px solid var(--paypal-button-border)",cursor:o?"not-allowed":"pointer",opacity:o?.5:void 0},onClick:e=>{if(o)return e.preventDefault(),void e.stopPropagation();null==r||r(e)},disabled:o,"aria-label":i,"aria-disabled":o,tabIndex:l,"data-testid":s,"data-e2e":"PayPalButton",children:[e(Wd,{variant:"blue"}),e(Wd,{variant:"white"})]})}));function ac(t){const n=t.schema.styles,i=Br(),o="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:r,styles:l,isDisabled:s}=Ot(i),d=s||!0===t.disabled;return e(ns,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:o,className:null==n?void 0:n.own,onClick:t.onClick,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:d,"aria-disabled":d,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:o,tabIndex:t.disabled?-1:r,style:Object.assign({cursor:"pointer"},l),children:e(ko,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const oc="ACTIVE/ADD",rc="ACTIVE/DELETE",lc="BREAKPOINT/UPDATE_ACTIVE",sc="BREAKPOINT/INITIALISE",dc="BREAKPOINT/SET_BREAKPOINTS",cc="ATTRIBUTES/SET",uc="FONTS/SET",pc="LAYOUT/UPDATE",fc="CONFIG/HANDLE",hc="PLUGIN/CLOSE_PLUGIN",vc="SETTINGS/SET",yc="SETTINGS/SET_BOTTOMSHEET_VISIBLE_HEIGHT",mc="CACHE/ADD_SERIALIZED_VALUE",gc="CACHE/UPDATE_SERIALIZED_VALUE",Cc="CACHE/CLEAR_SERIALIZED_VALUE",bc="SIGNAL/QUEUE",Ic="SIGNAL/PROCESSED",Ec="SIGNAL/PROCESS",Lc="rokt_minimize",Dc="rokt_backdrop",wc="ERROR/REPORT",Sc="LOG",Ac="CUSTOM_STATES/SET",xc="DOMAIN_STATES/SET",Tc="FORM_STATES/REGISTER_FIELD",Oc="FORM_STATES/UNREGISTER_FIELD",Mc="FORM_STATES/SET_FIELD_VALUE",kc="FORM_STATES/SET_FIELD_TOUCHED",Vc="FORM_STATES/VALIDATE_FIELDS",_c={LAYOUT_UPDATE:pc,UPDATE_ACTIVE_BREAKPOINT:lc,INITIALISE_BREAKPOINT:sc,ACTIVE_ADD:oc,ACTIVE_DELETE:rc,SET_ATTRIBUTES:cc,SET_FONTS:uc,QUEUE_SIGNAL:bc,SIGNAL_PROCESSED:Ic,CACHE_SERIALIZED_VALUE:mc,UPDATE_CACHED_SERIALIZED_VALUE:gc,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Cc,SET_SETTINGS:vc,SET_BOTTOMSHEET_VISIBLE_HEIGHT:yc,SET_CUSTOM_STATE:Ac,SET_DOMAIN_STATE_REDUCER:xc,REGISTER_FORM_FIELD:Tc,UNREGISTER_FORM_FIELD:Oc,SET_FORM_FIELD_VALUE:Mc,SET_FORM_FIELD_TOUCHED:kc,VALIDATE_FORM_FIELDS:Vc},Hc={HANDLE_CONFIG:fc,SET_BREAKPOINTS:dc,CLOSE_PLUGIN:hc,RAISE_METRIC:ei,PREPARE_SIGNAL:Ei,DISMISS_OVERLAY:Ti,REPORT_ERROR:wc,LOG:Sc,OPEN_LINK:Li};function Nc(t){const{schema:n,testId:i}=t,o=u(sl),r=Oo(null,(e=>{var t;return void 0!==(null===(t=e.domainStates)||void 0===t?void 0:t.layoutMinimized)?e.domainStates.layoutMinimized:null})),l=!(null==r||!r),d=m(),c=Br(),{tabIndex:p,styles:f,isDisabled:h}=Ot(c),v=s((()=>{h||d({type:xc,payload:{key:ln,value:l?0:1}})}),[d,l,h]);return o?e(ns,{styles:n.styles,children:({classnames:t})=>{var o;return e("button",{title:l?"Maximize":"Minimize",className:null==t?void 0:t.own,onClick:v,"data-testid":i,"data-e2e":"MinimizeButton",disabled:h,tabIndex:p,"aria-disabled":h,"aria-expanded":!l,"aria-label":null!==(o=n.a11yLabel)&&void 0!==o?o:void 0,style:Object.assign({cursor:"pointer"},f),children:e(ko,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))})})}}):null}const Pc="plugin";function Rc(e,t=0){var n;const i=null===(n=null==e?void 0:e.elements)||void 0===n?void 0:n.own;if(!Array.isArray(i))return!1;for(let e=i.length<=1?0:2===i.length?0===t?0:1:Math.min(t,i.length-1);e>=0;e-=1)if("object"==typeof(a=i[e])&&null!==a&&Object.values(a).some((e=>{var t;const n="object"==typeof e&&null!==e?null===(t=e.dimension)||void 0===t?void 0:t.height:void 0;return"fixed"===(null==n?void 0:n.type)||"percentage"===(null==n?void 0:n.type)||"fit"===(null==n?void 0:n.type)&&"fit-height"===(null==n?void 0:n.value)})))return!0;var a;return!1}function Fc(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const jc=G(z(1)),$c=Z(z(0)),Zc=e=>F(j($(e)),$c,jc,B,U({},["breakpoint","breakpoints"]));function Gc(e){return Zc(e.breakpoint.activeBreakpoint)(e)}function Bc(e,t){return e.customStates[`module${t}`]||{}}function Uc(e,t){return e.firedEvents[`module${t}`]||{}}const zc={};function qc(e,t){return e.formStates[`module${t}`]||zc}function Kc(e){return`${e.name}:${e.parentGuid}`}const Wc=Number.NaN,Yc=/^\d+(\.\d+)?$/;function Jc(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0}function Qc(e){if(Jc(e))return e;if("string"==typeof e&&Yc.test(e.trim())){const t=Number(e.trim());return Jc(t)?t:Wc}return Wc}function Xc(e){return null===e||"object"!=typeof e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Qc(t)])))}function eu(e){return null!=e?e:null}function tu(){return new Set([Oi])}function nu(){return new Map}function iu(e){return void 0!==e?`module${e}`:"root"}function au(e,t=e.value){const n=cn(t,e.validations);return Object.assign(Object.assign({},e),{value:t,validated:!0,error:n,valid:""===n})}const ou={layout:function(e=eu(),t){return t.type===pc?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case lc:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case sc:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},Xc(t.payload.breakpoints)),initialised:!0};default:return e}},active:function(e=tu(),t){var n,i;switch(t.type){case oc:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case rc:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},attributes:function(e={},t){return t.type===cc?Object.assign(Object.assign({},e),t.payload):e},fonts:function(e=[],t){return t.type===uc?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case bc:return be({queue:n=>ru(e,t.payload.signal)?Ve(ie(z("signal"),Kc),n.concat(t.payload)):n},e);case Ic:return be({queue:e=>Me(ie(z("signal"),ke({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:Ie(Kc(t.payload))},e);default:return e}},serializableCache:function(e=nu(),t){switch(t.type){case mc:case gc:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Cc:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0,closeOnNegativeResponse:"NEVER",allowEscToClose:!1,minimizeOnComplete:!1,explicitCloseOnComplete:!1,bottomsheetVisibleHeight:null},t){switch(t.type){case vc:{const n=O(((e,t)=>ye(t)?e:t),e,t.payload);return Object.assign(Object.assign({},n),{explicitCloseOnComplete:e.explicitCloseOnComplete||"closeOnComplete"in t.payload&&!0===t.payload.closeOnComplete})}case yc:return Object.assign(Object.assign({},e),{bottomsheetVisibleHeight:t.payload.height});default:return e}},customStates:function(e={root:{}},t){if(t.type===Ac){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return L([n,t.payload.key],Number(t.payload.value),e)}return e}return e},firedEvents:function(e={root:{}},t){var n;if(t.type===Ii){if(!(null===(n=t.payload)||void 0===n?void 0:n.event))return e;const i=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return L([i,t.payload.event],!0,e)}return e},formStates:function(e={root:{}},t){var n,i;switch(t.type){case Tc:{const{offerPositionIndex:i,formKey:a,fieldKey:o,defaultValue:r,validations:l}=t.payload,s=[iu(i),a,o],d=null!==(n=E(s,e))&&void 0!==n?n:function(e={}){return Object.assign({value:"",defaultValue:"",error:"",touched:!1,validated:!1,valid:!1,errorVisible:!1,validations:[],registrationCount:1},e)}({value:r,defaultValue:r,registrationCount:0}),c=d.value!==d.defaultValue,u=Object.assign(Object.assign({},d),{value:c?d.value:r,defaultValue:r,validations:l.filter(Vn),registrationCount:d.registrationCount+1});return L(s,au(u),e)}case Oc:{const{offerPositionIndex:n,formKey:i,fieldKey:a}=t.payload,o=[iu(n),i,a],r=E(o,e);return r?L(o,Object.assign(Object.assign({},r),{registrationCount:Math.max(0,r.registrationCount-1)}),e):e}case Mc:{const{offerPositionIndex:n,formKey:i,fieldKey:a,value:o,validate:r}=t.payload,l=[iu(n),i,a],s=E(l,e);if(!s)return e;const d=Object.assign(Object.assign({},au(s,o)),{errorVisible:s.errorVisible||r});return L(l,d,e)}case kc:{const{offerPositionIndex:n,formKey:i,fieldKey:a}=t.payload,o=[iu(n),i,a],r=E(o,e);return!r||r.touched?e:L(o,Object.assign(Object.assign({},r),{touched:!0}),e)}case Vc:{const{offerPositionIndex:n,entries:a}=t.payload,o=iu(n);return pn(null!==(i=e[o])&&void 0!==i?i:{},a).reduce(((e,{formKey:t,fieldKey:n})=>{const i=[o,t,n],a=E(i,e);return a&&sn(a)?L(i,Object.assign(Object.assign({},au(a)),{errorVisible:!0}),e):e}),e)}default:return e}}};function ru(e,t){return!e.processed.includes(Kc(t))||(n=t.name,void 0!==Hn.find((e=>e===n)));var n}const lu={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var su;function du({isOpen:t,schema:i,testId:r,children:l}){const s=la(),d=g((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=g((e=>e.active.has(Pc))),u=g(Gc),p=m(),f=()=>{p({type:Hc.DISMISS_OVERLAY,payload:{id:Oi,dismissalMethod:Dc}})};o((()=>{d&&p({type:ci,payload:{name:"SignalActivation",parentGuid:d}})}),[d]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const h=Br(),{tabIndex:v,isDisabled:y,styles:C}=Ot(h),b=i.styles?_e(lu,i.styles):lu,I=Rc(i.styles,u);if(!t)return null;const E=e(ko,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(ns,{styles:b,children:({classnames:t})=>{var a;return n("div",{className:null==t?void 0:t.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:I?"hidden":"auto"},C),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:v,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?f:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),l(E,s)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(su||(su={}));const cu={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};function uu({isOpen:t,schema:i,testId:r,children:l}){const s=la(),d=g((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=g((e=>e.active.has(Pc))),u=g(Gc),p=m(),f=()=>{p({type:Hc.DISMISS_OVERLAY,payload:{id:Oi,dismissalMethod:Dc}})};o((()=>{d&&p({type:ci,payload:{name:"SignalActivation",parentGuid:d}})}),[d,p]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const h=Br(),{tabIndex:v,isDisabled:y,styles:C}=Ot(h),b=i.styles?_e(cu,i.styles):cu,I=Rc(i.styles,u);if(!t)return null;const E=e(ko,{children:e=>{var t;return a.Children.toArray((null!==(t=i.children)&&void 0!==t?t:[]).map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))}});return e(ns,{styles:b,children:({classnames:t})=>{var a;return n("div",{className:null==t?void 0:t.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:I?"hidden":"auto"},C),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:v,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?f:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),l(E,s)]})}})}const pu="undefined"!=typeof window;function fu(){const e=m(),t=g((e=>{var t;return!0===(null===(t=null==e?void 0:e.settings)||void 0===t?void 0:t.allowEscToClose)}));o((()=>{if(!pu||!t)return;const n=t=>{"Escape"===t.key&&e({type:Hc.DISMISS_OVERLAY,payload:{id:Oi,dismissalMethod:"escape_key"}})};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}}),[])}const hu={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const vu=f((function({schema:t,testId:n,children:i,isAttached:a},o){fu();const r=g(Gc),l=Rc(t.styles,r),s=t.styles?_e(hu,t.styles):hu;return e(ns,{styles:s,children:({classnames:t})=>e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:a?"center":void 0,marginBlock:a?"auto":void 0,maxHeight:l?"100%":void 0,overflowY:l?"auto":void 0},ref:o,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:i})})}));const yu=C((function(e){return{isOpen:e.active.has(Oi)}}))((function(t){return e(du,Object.assign({},t,{children:(n,i)=>e(vu,Object.assign({},t,{ref:i,children:n}))}))}));const mu=C((function(e){return{isOpen:e.active.has(Oi)}}));function gu(e){const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return 0===i?0:(n.offsetPx-t.offsetPx)/i}const Cu=1e5,bu="data-rokt-bottomsheet-no-drag";function Iu(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}function Eu(e){return e?1:0}function Lu(e){return{type:xc,payload:{key:ln,value:e}}}function Du(e,t){var n,i,a,o;const r=null!==(i=null===(n=e.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0;return(null!==(o=null===(a=t.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r}function wu(e,t,n){const i=Math.round(n);t.current=i,e.current&&(e.current.style.transform=`translateY(${i}px)`)}function Su(e,t){e.current&&(e.current.style.visibility="visible")}function Au(e,t,n){wu(e,t,n),Su(e)}function xu(e,t,n=200){e.current&&(e.current.style.transition=t?`transform ${n}ms`:"")}function Tu(e,t,n,i){const[a,o]=i?[t,e]:[e,t],r=n?{fadeIn:"opacity .5s",fadeOut:"opacity .2s"}:{fadeIn:"",fadeOut:""};o.current&&(o.current.style.transition=r.fadeIn),a.current&&(a.current.style.transition=r.fadeOut)}function Ou(e,t,n,i="auto"){const a=t.current;a&&(e.current&&(clearTimeout(e.current),e.current=null),a.style.opacity=n?"0":"1",n||"none"===i?a.style.pointerEvents="none":e.current=setTimeout((()=>{a.style.pointerEvents="auto",e.current=null}),400))}function Mu(e,t){e.current&&(e.current.style.height=`${t}px`)}const ku=(e,t,n=!0)=>{const i=r(null),a=r(null),d=r(null),c=r(null),u=r(null),f=r(null),h=r(!e),v=r(!1),y=r(t),g=r(null),C=Oo(null,(e=>{var t;return void 0!==(null===(t=e.domainStates)||void 0===t?void 0:t.layoutMinimized)?e.domainStates.layoutMinimized:null})),b=null!=C?C:Eu(e),I=n&&!!b,E=r(I);E.current=I;const[L,D]=l(!!e&&n),[w,S]=l(!0),A=m();o((()=>{A(Lu(Eu(e)))}),[]);const x=Br(),T=r(0),O=r(!1),M=r(0),k=r([]),V=r(void 0),_=r(0),H=r(null),{isDisabled:N}=Ot(x),P=s(((e=0)=>{const t=u.current;return!!(i.current&&a.current&&c.current&&t)&&(0===t.clientHeight?(e<1&&requestAnimationFrame((()=>{P(e+1)})),!1):(Au(a,T,t.clientHeight),requestAnimationFrame((()=>{xu(a,!0,800),Au(a,T,0),h.current=!1})),!0))}),[]),R=s((e=>{e||Mu(i,Cu)}),[]),F=s((e=>{if(h.current)return;v.current=!0,xu(a,!0),Tu(c,u,!0,e),!e&&u.current&&(u.current.style.transition="opacity .3s .2s"),Au(a,T,e?Du(c,u):0),Ou(f,c,!e,"auto"),Ou(f,u,e),R(e);const t=a.current;t&&t.addEventListener("transitionend",(()=>{v.current=!1}),{once:!0})}),[R]),j=s(((e,t)=>{v.current||O.current||(h.current?P():(xu(a,e),t?function(e,t,n,i,a){var o,r;if(0===(null!==(r=null===(o=i.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:0))return;const l=Du(n,i);wu(e,a,l+80),Mu(t,Cu),Su(e),requestAnimationFrame((()=>{xu(e,!0,200),wu(e,a,l)}))}(a,i,c,u,T):(Au(a,T,0),Mu(i,Cu))))}),[P]),$=s((e=>{A(Lu(Eu(e)))}),[A]),Z=s((()=>function(e){const{velocityPxPerMs:t,currentOffsetPx:n}=e;return!(n<=0)&&(n>=48||t>=.2)}({velocityPxPerMs:gu(k.current),currentOffsetPx:T.current})),[]),G=s((()=>{var e,t;O.current&&(e=k.current,t=T.current,e.push({offsetPx:t,timestamp:Date.now()}),e.length>20&&e.shift(),requestAnimationFrame(G))}),[]),B=s((()=>{k.current=[],G()}),[G]),U=s((e=>{var t,n;if(!a.current)return;e.preventDefault();const i=(null!==(t=Iu(e))&&void 0!==t?t:0)-(null!==(n=V.current)&&void 0!==n?n:0),o=_.current+i,r=o<0?Math.max(-80,.35*o):o;Au(a,T,r)}),[]),z=s((function e(){document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",e),document.removeEventListener("touchmove",U),document.removeEventListener("touchend",e),H.current=null,V.current=void 0,O.current=!1,xu(a,!0),Tu(c,u,!0,!1);Z()?$(!0):Au(a,T,0)}),[Z,U,$]),q=s((()=>{H.current={onDrag:U,onDragStop:z},document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",z),document.addEventListener("mousemove",U,{passive:!1}),document.addEventListener("mouseup",z)}),[U,z]),K=s((e=>{var t;if(!n)return;if(Date.now()-M.current<200)return;if(M.current=Date.now(),N)return;if(I)return;const i=e.target;if(!(null===(t=null==i?void 0:i.closest)||void 0===t?void 0:t.call(i,`[${bu}]`))&&!O.current){const t=Iu(e);if(void 0===t)return;O.current=!0,_.current=T.current,B(),V.current=t,xu(a,!1),Tu(c,u,!1,!1),q()}}),[n,I,N,B,q]);return o((()=>{const e=a.current;if(e&&"default"===t)return e.addEventListener("mousedown",K),e.addEventListener("touchstart",K),()=>{e.removeEventListener("mousedown",K),e.removeEventListener("touchstart",K)}}),[a,K,t]),p((()=>{if("default"!==t)return;const e=a.current;e&&(e.style.visibility="hidden",e.style.transform="translateY(1000px)")}),[t]),o((()=>{if("default"!==t)return void(y.current=t);const e="default"!==y.current;if(y.current=t,!e)return;S(!0),u.current&&(u.current.style.transition="none",u.current.style.opacity="0",u.current.style.pointerEvents="none");const n=requestAnimationFrame((()=>requestAnimationFrame((()=>{j(h.current,I)}))));return()=>cancelAnimationFrame(n)}),[t,j,I]),o((()=>{if(w)return Ou(f,c,!I,"auto"),Ou(f,u,I),void requestAnimationFrame((()=>{Tu(c,u,!0,I),D(I),S(!1)}));L!==I&&(D(I),F(I),A(Vu(I)))}),[I,L,w,A,F]),o((()=>{const e=()=>{const e=function(e,t){const n=t.current,i=e.current;if(!n||!i)return 0;const a=parseFloat(getComputedStyle(n).paddingBottom)||0;return Math.ceil(i.getBoundingClientRect().bottom-n.getBoundingClientRect().top+a)}(c,d);e>0&&e!==g.current&&(g.current=e,A({type:yc,payload:{height:e}}))},t=function(e,t){let n;const i=()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)};return i.cancel=()=>{n&&(clearTimeout(n),n=void 0)},i}(100,(()=>{const t=E.current;e(),v.current||O.current||(h.current?j(h.current,t):t?function(e,t,n,i,a){var o,r;if(0===(null!==(r=null===(o=i.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:0))return;const l=Du(n,i);xu(e,!1),wu(e,a,l),Mu(t,Cu),Su(e)}(a,i,c,u,T):(xu(a,!1),Au(a,T,0),Mu(i,Cu)))})),n=c.current,o=u.current,r=new ResizeObserver(t);return n&&r.observe(n),o&&r.observe(o),()=>{r.disconnect(),t.cancel()}}),[j,t,A]),o((()=>()=>{f.current&&clearTimeout(f.current),O.current=!1;const e=H.current;e&&(document.removeEventListener("touchmove",e.onDrag),document.removeEventListener("touchend",e.onDragStop),document.removeEventListener("mousemove",e.onDrag),document.removeEventListener("mouseup",e.onDragStop),H.current=null)}),[]),{wrapperRef:i,containerRef:a,sheetRef:d,minimizedChildRef:c,maximizedChildRef:u,isMinimized:I,setMinimized:$}},Vu=e=>({type:ci,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const _u={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};function Hu({schema:t,testId:n,minimized:i,onMinimize:a,onClose:s}){const d=la(),c=r(null),u=g((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),p=g((e=>e.active.has(Pc))),f=m(),[h,v]=l(!1);o((()=>{const e=window.setTimeout((()=>{v(!0)}),200);return()=>window.clearTimeout(e)}),[]);const y=h&&!i,C=null!=s?s:a,b=y&&!!C,I=!i;o((()=>{const e=c.current;if(!e||!I)return;const t=e=>{e.preventDefault()};return e.addEventListener("touchmove",t,{passive:!1}),e.addEventListener("wheel",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t)}}),[I]),o((()=>{u&&f({type:ci,payload:{name:"SignalActivation",parentGuid:u}})}),[u,f]),o((()=>{p&&requestAnimationFrame((()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.focus()}))}),[p,d]);const E=Br(),{tabIndex:L,isDisabled:D,styles:w}=Ot(E),S=t.styles?_e(_u,t.styles):_u;return e(ns,{styles:S,children:({classnames:i})=>{var a;return e("div",{ref:d,className:null==i?void 0:i.wrapper,style:Object.assign(Object.assign(Object.assign({height:Cu,top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex"},y?{}:{backgroundColor:"transparent"}),{opacity:y?"1":"0",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"}),w),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":D,role:"dialog","aria-modal":!0,tabIndex:L,"data-testid":n,"data-e2e":"Overlay-Wrapper",children:e("div",{ref:c,style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1",pointerEvents:I?"auto":"none",touchAction:I?"none":void 0},onClick:b?C:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function Nu({className:t,style:n}){const i=al(),a=yr(),o=No()||document.head,r=bo(i,a,o),l=Io(i,a,o),s=d((()=>r`
87
+ display: flex;
88
+ justify-content: center;
89
+ `),[r]),c=d((()=>r`
87
90
  position: relative;
88
91
  z-index: 10;
89
92
  width: 48px;
90
93
  height: 4px;
91
94
  background-color: #c6c6c8;
92
95
  border-radius: 2px;
93
- margin: 0 auto 6px;
94
- `),[r]);return e("div",{"data-testid":"drag-handle",className:l(s,t),style:n})}const Pu="#D5D7DA";function Ru(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t}}function Fu(e){return e&&"object"==typeof e&&"light"in e?{light:e.light?Ru(e.light):void 0,dark:e.dark?Ru(e.dark):void 0}:{light:void 0,dark:void 0}}function ju(e){if(null==e)return"0 0 0 0";const t=String(e).trim().split(/\s+/),n=Number(t[0])||0;return`${n} ${t.length>1?Number(t[1])||0:n} 0 0`}function $u(e,t,n,i){var a,o,r,l,s,d,c,u,p,f,h,v,y,m,g,C;const b=null==t?void 0:t.elements,I=null==b?void 0:b.own,E=function(e){var t;if(!Array.isArray(e))return{};const n={},i={};for(const a of e){const e=null==a?void 0:a.default;e&&(e.border&&(null!=e.border.borderColor&&(n.borderColor=e.border.borderColor),null!=e.border.borderWidth&&(n.borderWidth=e.border.borderWidth),null!=e.border.borderRadius&&(n.borderRadius=e.border.borderRadius),null!=e.border.borderStyle&&(n.borderStyle=e.border.borderStyle)),null!=(null===(t=e.background)||void 0===t?void 0:t.backgroundColor)&&(i.backgroundColor=e.background.backgroundColor))}return Object.assign(Object.assign({},Object.keys(n).length>0&&{border:n}),Object.keys(i).length>0&&{background:i})}(null!=i?i:I),L=Fu(null===(a=E.border)||void 0===a?void 0:a.borderColor),D=null!==(o=L.light)&&void 0!==o?o:Pu,w=L.dark,S=null!==(l=function(e){if(null==e)return;const t=String(e).trim().split(/\s+/).map(Number);if(0===t.length)return;const[n,i=n,a=n,o=i]=t;return[n,i,a,o]}(null===(r=E.border)||void 0===r?void 0:r.borderWidth))&&void 0!==l?l:[1,1,1,1],[A,x,,T]=S,O=null!==(d=null===(s=E.border)||void 0===s?void 0:s.borderStyle)&&void 0!==d?d:"solid",M=Fu(null===(c=E.background)||void 0===c?void 0:c.backgroundColor),k=null!==(u=M.light)&&void 0!==u?u:"#FFFFFF",V=M.dark,_=null!==(f=null===(p=E.border)||void 0===p?void 0:p.borderColor)&&void 0!==f?f:{light:Pu},H=null!==(v=null===(h=E.background)||void 0===h?void 0:h.backgroundColor)&&void 0!==v?v:{light:"#FFF"},N={border:{borderRadius:ju(null===(y=E.border)||void 0===y?void 0:y.borderRadius),borderColor:_,borderWidth:`${A} ${x} 0 ${T}`,borderStyle:O},background:{backgroundColor:H},dimension:{height:{type:"percentage",value:100}},container:{overflow:"hidden"}},P=null!==(g=null===(m=null==I?void 0:I[0])||void 0===m?void 0:m.default)&&void 0!==g?g:{},R=I&&I.length>0?[_e(I[0],{default:_e(P,Object.fromEntries(["border","background","dimension","container"].map((e=>{var t;return[e,_e(null!==(t=P[e])&&void 0!==t?t:{},N[e])]}))))}),...I.slice(1)]:[{default:N}],F=_e(null!=t?t:{},{elements:Object.assign(Object.assign({},b),{own:R,wrapper:null!==(C=null==b?void 0:b.wrapper)&&void 0!==C?C:[]})}),j=[w&&`border-left-color: ${w}; border-right-color: ${w};`,V&&`background-color: ${V};`].filter(Boolean).join(" ");return{mergedStyles:F,tailClass:e`
96
+ margin: 0 0 6px;
97
+ `),[r]);return e("div",{"data-testid":"drag-handle-container",className:s,style:n,children:e("div",{"data-testid":"drag-handle",className:l(c,t)})})}const Pu="#D5D7DA";function Ru(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t}}function Fu(e){return e&&"object"==typeof e&&"light"in e?{light:e.light?Ru(e.light):void 0,dark:e.dark?Ru(e.dark):void 0}:{light:void 0,dark:void 0}}function ju(e){if(null==e)return"0 0 0 0";const t=String(e).trim().split(/\s+/),n=Number(t[0])||0;return`${n} ${t.length>1?Number(t[1])||0:n} 0 0`}function $u(e,t,n,i){var a,o,r,l,s,d,c,u,p,f,h,v,y,m,g,C;const b=null==t?void 0:t.elements,I=null==b?void 0:b.own,E=function(e){var t;if(!Array.isArray(e))return{};const n={},i={};for(const a of e){const e=null==a?void 0:a.default;e&&(e.border&&(null!=e.border.borderColor&&(n.borderColor=e.border.borderColor),null!=e.border.borderWidth&&(n.borderWidth=e.border.borderWidth),null!=e.border.borderRadius&&(n.borderRadius=e.border.borderRadius),null!=e.border.borderStyle&&(n.borderStyle=e.border.borderStyle)),null!=(null===(t=e.background)||void 0===t?void 0:t.backgroundColor)&&(i.backgroundColor=e.background.backgroundColor))}return Object.assign(Object.assign({},Object.keys(n).length>0&&{border:n}),Object.keys(i).length>0&&{background:i})}(null!=i?i:I),L=Fu(null===(a=E.border)||void 0===a?void 0:a.borderColor),D=null!==(o=L.light)&&void 0!==o?o:Pu,w=L.dark,S=null!==(l=function(e){if(null==e)return;const t=String(e).trim().split(/\s+/).map(Number);if(0===t.length)return;const[n,i=n,a=n,o=i]=t;return[n,i,a,o]}(null===(r=E.border)||void 0===r?void 0:r.borderWidth))&&void 0!==l?l:[1,1,1,1],[A,x,,T]=S,O=null!==(d=null===(s=E.border)||void 0===s?void 0:s.borderStyle)&&void 0!==d?d:"solid",M=Fu(null===(c=E.background)||void 0===c?void 0:c.backgroundColor),k=null!==(u=M.light)&&void 0!==u?u:"#FFFFFF",V=M.dark,_=null!==(f=null===(p=E.border)||void 0===p?void 0:p.borderColor)&&void 0!==f?f:{light:Pu},H=null!==(v=null===(h=E.background)||void 0===h?void 0:h.backgroundColor)&&void 0!==v?v:{light:"#FFF"},N={border:{borderRadius:ju(null===(y=E.border)||void 0===y?void 0:y.borderRadius),borderColor:_,borderWidth:`${A} ${x} 0 ${T}`,borderStyle:O},background:{backgroundColor:H},dimension:{height:{type:"percentage",value:100}},container:{overflow:"hidden"}},P=null!==(g=null===(m=null==I?void 0:I[0])||void 0===m?void 0:m.default)&&void 0!==g?g:{},R=I&&I.length>0?[_e(I[0],{default:_e(P,Object.fromEntries(["border","background","dimension","container"].map((e=>{var t;return[e,_e(null!==(t=P[e])&&void 0!==t?t:{},N[e])]}))))}),...I.slice(1)]:[{default:N}],F=_e(null!=t?t:{},{elements:Object.assign(Object.assign({},b),{own:R,wrapper:null!==(C=null==b?void 0:b.wrapper)&&void 0!==C?C:[]})}),j=[w&&`border-left-color: ${w}; border-right-color: ${w};`,V&&`background-color: ${V};`].filter(Boolean).join(" ");return{mergedStyles:F,tailClass:e`
95
98
  width: 100%;
96
99
  height: ${n}vh;
97
100
  border-radius: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "1.2.1-rc.54",
3
+ "version": "1.2.1-rc.56",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",