@cleartrip/ct-platform-book-zero-trip-widget 1.0.6-beta.0 → 1.0.6-beta.1

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.
@@ -1,4 +1,4 @@
1
1
  import { IBookZeroTripCardProps } from '@cleartrip/ct-platform-types';
2
- declare const BookZeroTripCard: ({ card, onPayNow, }: IBookZeroTripCardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const BookZeroTripCard: ({ card }: IBookZeroTripCardProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default BookZeroTripCard;
4
4
  //# sourceMappingURL=BookZeroTripCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookZeroTripCard.d.ts","sourceRoot":"","sources":["../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAWtE,QAAA,MAAM,gBAAgB,wBAGnB,sBAAsB,4CAuExB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"BookZeroTripCard.d.ts","sourceRoot":"","sources":["../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAWtE,QAAA,MAAM,gBAAgB,aAAc,sBAAsB,4CA+FzD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { IBookZeroTripWidgetProps } from '@cleartrip/ct-platform-types';
2
2
  import './index.scss';
3
- declare const BookZeroTripWidget: ({ title, cards, onPayNow, onImpression, }: IBookZeroTripWidgetProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ declare const BookZeroTripWidget: ({ title, cards, }: IBookZeroTripWidgetProps) => import("react/jsx-runtime").JSX.Element | null;
4
4
  export default BookZeroTripWidget;
5
5
  //# sourceMappingURL=BookZeroTripWidget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookZeroTripWidget.d.ts","sourceRoot":"","sources":["../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEH,wBAAwB,EAC3B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,cAAc,CAAC;AAUtB,QAAA,MAAM,kBAAkB,8CAKrB,wBAAwB,mDAiF1B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"BookZeroTripWidget.d.ts","sourceRoot":"","sources":["../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEH,wBAAwB,EAC3B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,cAAc,CAAC;AAUtB,QAAA,MAAM,kBAAkB,sBAGrB,wBAAwB,mDA+E1B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@cleartrip/ct-platform-io-hoc"),a=require("@cleartrip/ct-platform-merch-carousel"),d=require("classnames"),o=require("@cleartrip/ct-design-typography"),r=require("@cleartrip/ct-design-button"),l=require("@cleartrip/ct-platform-assets"),s=require("@cleartrip/ct-platform-utils");function _(e){return e&&e.__esModule?e:{default:e}}var u=_(d);var c="index-module_bztContainer__eDkV4",m="index-module_bztWrapper__ISRXL",x="index-module_bztTitle__Gghfq",p="index-module_bztContentWrapper__YjHdZ",g="index-module_bztCard__nDyiw",h="index-module_bztCardTop__NsU0I",b="index-module_bztThumb__s-7EQ",f="index-module_bztCardTitle__BINAl",y="index-module_bztCardTextCol__wheg1",w="index-module_bztDivider__M-QEW",v="index-module_bztCardBottom__Tjcmq",z="index-module_bztPriceBlock__9GkVf",C="index-module_bztTextEllipsis__d3TSs",j="index-module_bztDateMuted__kS6-O",T="index-module_bztAmountLabel__OD-eO",N="index-module_bztCountdownRow__8Vniy",D="index-module_bztCountdownIcon__BltvK",k="index-module_bztCountdownLabel__cfr0-";!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".index-module_bztContainer__eDkV4{height:100%;position:relative;width:100%}.index-module_bztWrapper__ISRXL{height:100%;padding:16px 0;width:100%}.index-module_bztTitle__Gghfq{color:#1a1a1a;font-size:16px;font-weight:600;line-height:22px;margin:0;padding-bottom:12px;padding-left:16px;width:100%}.index-module_bztContentWrapper__YjHdZ{position:relative;width:100%}.index-module_bztCard__nDyiw{background:#fff;border:1.17px solid rgba(26,26,26,.08);border-radius:16px;box-sizing:border-box;display:flex;flex-direction:column;height:157px;outline:none;overflow:hidden;padding:12px;width:295px}.index-module_bztCard__nDyiw:focus,.index-module_bztCard__nDyiw:focus-visible{outline:none}.index-module_bztCardTop__NsU0I{align-items:flex-start;display:flex;flex-direction:row;gap:8px;padding-bottom:12px}.index-module_bztCard__nDyiw .index-module_bztThumb__s-7EQ{background:#f2f2f2;border-radius:8px;flex-shrink:0;height:58px;max-height:58px;max-width:58px;object-fit:cover;width:58px}.index-module_bztCardTitle__BINAl{line-height:22px}.index-module_bztCardTextCol__wheg1{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}.index-module_bztDivider__M-QEW{border:0;border-top:1px dashed rgba(0,0,0,.1);margin:0 0 12px}.index-module_bztCardBottom__Tjcmq{align-items:flex-end;display:flex;flex-direction:row;gap:12px;justify-content:space-between}.index-module_bztPriceBlock__9GkVf{display:flex;flex-direction:column;gap:4px;min-width:0}.index-module_bztTextEllipsis__d3TSs{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.index-module_bztDateMuted__kS6-O{color:grey}.index-module_bztAmountLabel__OD-eO{line-height:24px}.index-module_bztCountdownRow__8Vniy{align-items:center;display:flex;flex-direction:row;gap:4px;margin-bottom:4px}.index-module_bztCountdownIcon__BltvK{flex-shrink:0}.index-module_bztCountdownLabel__cfr0-{color:#cd1719}");var B=function(n){var a,d=n.card,_=n.onPayNow,c=d.metaData,m=t.useMemo((function(){return s.formatBookZeroStayDateRange(c.stayStartDate,c.stayEndDate)}),[c.stayStartDate,c.stayEndDate]),x=t.useMemo((function(){return s.formatBookZeroPaymentDueLabel(c.paymentExpiryTime)}),[c.paymentExpiryTime]),p=s.formatRemainingMsAsHoursCountdown(c.paymentExpiryTime),B=null!==(a=c.bookZeroStatusLabel)&&void 0!==a?a:"Booked with ₹0 payment",S=_?function(){return _(d)}:void 0;return i.jsxs("div",e.__assign({className:g},{children:[i.jsxs("div",e.__assign({className:h},{children:[i.jsx("img",{className:b,src:d.imageUrl,loading:"lazy"}),i.jsxs("div",e.__assign({className:y},{children:[i.jsx(o.Typography,e.__assign({variant:"L3",color:"success"},{children:B})),i.jsx(o.Typography,e.__assign({variant:"HM3",className:u.default(C,f)},{children:d.title})),m?i.jsx(o.Typography,e.__assign({variant:"B3",className:u.default(C,j)},{children:m})):null]}))]})),i.jsx("hr",{className:w}),i.jsxs("div",e.__assign({className:v},{children:[i.jsxs("div",e.__assign({className:z},{children:[i.jsx(o.Typography,e.__assign({variant:"HM2",className:T},{children:c.amountDueLabel})),p?i.jsxs("div",e.__assign({className:N},{children:[i.jsx(l.HourGlass,{className:D,"aria-hidden":!0}),i.jsx(o.Typography,e.__assign({variant:"B4",className:k},{children:p}))]})):i.jsx(o.Typography,e.__assign({variant:"L3"},{children:x}))]})),i.jsx(r.Button,e.__assign({variant:"contained",size:"medium",color:"secondary",onClick:S},{children:"Pay now"}))]}))]}))};exports.BookZeroTripWidget=function(d){var o=d.title,r=void 0===o?"Complete your payment":o,l=d.cards,s=d.onPayNow,_=d.onImpression,u=t.useRef(!1),g=t.useCallback((function(){!u.current&&(null==l?void 0:l.length)&&(u.current=!0,null==_||_(l.length))}),[null==l?void 0:l.length,_]),h=t.useMemo((function(){return(null!=l?l:[]).map((function(i){return e.__assign(e.__assign({},i),{itemId:i.id,image:{url:i.imageUrl,alt:""}})}))}),[l]),b=!1,f=t.useCallback((function(){return{width:"auto",height:"auto"}}),[]),y=t.useCallback((function(e){var t=e.slideData;return i.jsx(B,{card:t,onPayNow:s})}),[s]);return(null==l?void 0:l.length)?i.jsx(n.IntersectionObserverHOC,e.__assign({onIntersection:g},{children:i.jsx("section",e.__assign({className:c,"aria-label":r},{children:i.jsxs("div",e.__assign({className:m},{children:[i.jsx("div",e.__assign({className:x},{children:r})),i.jsx("div",e.__assign({className:p},{children:i.jsx(a.MerchCarousel,{isFreeSwipe:!1,isCentered:!1,isInfinite:!1,isAutoplay:!1,lazyLoad:!0,lazyWidget:b,isLoopAdditionalSlides:!0,showNavigation:!1,showPagination:!1,startingSlide:0,spacingBetween:12,slidesToDisplay:"auto",slides:h,getSlideStyles:f,renderSlideItem:y,styleConfig:{swipperWrapper:{paddingLeft:"16px",paddingRight:"16px"}}})}))]}))}))})):null};
1
+ "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@cleartrip/ct-platform-io-hoc"),a=require("@cleartrip/ct-platform-merch-carousel"),d=require("classnames"),o=require("@cleartrip/ct-design-typography"),r=require("@cleartrip/ct-design-button"),l=require("@cleartrip/ct-platform-assets"),s=require("@cleartrip/ct-platform-utils");function _(e){return e&&e.__esModule?e:{default:e}}var u=_(d);var c="index-module_bztContainer__eDkV4",x="index-module_bztWrapper__ISRXL",m="index-module_bztTitle__Gghfq",p="index-module_bztContentWrapper__YjHdZ",g="index-module_bztCard__nDyiw",h="index-module_bztCardTop__NsU0I",b="index-module_bztThumb__s-7EQ",f="index-module_bztCardTitle__BINAl",y="index-module_bztCardTextCol__wheg1",w="index-module_bztDivider__M-QEW",z="index-module_bztCardBottom__Tjcmq",v="index-module_bztPriceBlock__9GkVf",C="index-module_bztTextEllipsis__d3TSs",j="index-module_bztDateMuted__kS6-O",T="index-module_bztAmountLabel__OD-eO",N="index-module_bztCountdownRow__8Vniy",D="index-module_bztCountdownIcon__BltvK",k="index-module_bztCountdownLabel__cfr0-";!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".index-module_bztContainer__eDkV4{height:100%;position:relative;width:100%}.index-module_bztWrapper__ISRXL{height:100%;padding:16px 0;width:100%}.index-module_bztTitle__Gghfq{color:#1a1a1a;font-size:16px;font-weight:600;line-height:22px;margin:0;padding-bottom:12px;padding-left:16px;width:100%}.index-module_bztContentWrapper__YjHdZ{position:relative;width:100%}.index-module_bztCard__nDyiw{background:#fff;border:1.17px solid rgba(26,26,26,.08);border-radius:16px;box-sizing:border-box;display:flex;flex-direction:column;height:157px;outline:none;overflow:hidden;padding:12px;width:295px}.index-module_bztCard__nDyiw:focus,.index-module_bztCard__nDyiw:focus-visible{outline:none}.index-module_bztCardTop__NsU0I{align-items:flex-start;display:flex;flex-direction:row;gap:8px;padding-bottom:12px}.index-module_bztCard__nDyiw .index-module_bztThumb__s-7EQ{background:#f2f2f2;border-radius:8px;flex-shrink:0;height:58px;max-height:58px;max-width:58px;object-fit:cover;width:58px}.index-module_bztCardTitle__BINAl{line-height:22px}.index-module_bztCardTextCol__wheg1{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}.index-module_bztDivider__M-QEW{border:0;border-top:1px dashed rgba(0,0,0,.1);margin:0 0 12px}.index-module_bztCardBottom__Tjcmq{align-items:flex-end;display:flex;flex-direction:row;gap:12px;justify-content:space-between}.index-module_bztPriceBlock__9GkVf{display:flex;flex-direction:column;gap:4px;min-width:0}.index-module_bztTextEllipsis__d3TSs{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.index-module_bztDateMuted__kS6-O{color:grey}.index-module_bztAmountLabel__OD-eO{line-height:24px}.index-module_bztCountdownRow__8Vniy{align-items:center;display:flex;flex-direction:row;gap:4px;margin-bottom:4px}.index-module_bztCountdownIcon__BltvK{flex-shrink:0}.index-module_bztCountdownLabel__cfr0-{color:#cd1719}");var B=function(n){var a,d=n.card,_=d.metaData,c=d.landingUrl,x=t.useMemo((function(){return s.formatBookZeroStayDateRange(_.stayStartDate,_.stayEndDate)}),[_.stayStartDate,_.stayEndDate]),m=t.useMemo((function(){return s.formatBookZeroPaymentDueLabel(_.paymentExpiryTime)}),[_.paymentExpiryTime]),p=s.formatRemainingMsAsHoursCountdown(_.paymentExpiryTime),B=null!==(a=_.bookZeroStatusLabel)&&void 0!==a?a:"Booked with ₹0 payment";return i.jsxs("div",e.__assign({className:g},{children:[i.jsxs("div",e.__assign({className:h},{children:[i.jsx("img",{className:b,src:d.imageUrl,loading:"lazy"}),i.jsxs("div",e.__assign({className:y},{children:[i.jsx(o.Typography,e.__assign({variant:"L3",color:"success"},{children:B})),i.jsx(o.Typography,e.__assign({variant:"HM3",className:u.default(C,f)},{children:d.title})),x?i.jsx(o.Typography,e.__assign({variant:"B3",className:u.default(C,j)},{children:x})):null]}))]})),i.jsx("hr",{className:w}),i.jsxs("div",e.__assign({className:z},{children:[i.jsxs("div",e.__assign({className:v},{children:[i.jsx(o.Typography,e.__assign({variant:"HM2",className:T},{children:_.amountDueLabel})),p?i.jsxs("div",e.__assign({className:N},{children:[i.jsx(l.HourGlass,{className:D,"aria-hidden":!0}),i.jsx(o.Typography,e.__assign({variant:"B4",className:k},{children:p}))]})):i.jsx(o.Typography,e.__assign({variant:"L3"},{children:m}))]})),i.jsx(r.Button,e.__assign({variant:"contained",size:"medium",color:"secondary",onClick:function(){window.location.href=c}},{children:"Pay now"}))]}))]}))};exports.BookZeroTripWidget=function(d){var o=d.title,r=void 0===o?"Complete your payment":o,l=d.cards,s=t.useRef(!1),_=t.useCallback((function(){!s.current&&(null==l?void 0:l.length)&&(s.current=!0)}),[null==l?void 0:l.length]),u=t.useMemo((function(){return(null!=l?l:[]).map((function(i){return e.__assign(e.__assign({},i),{itemId:i.id,image:{url:i.imageUrl,alt:""}})}))}),[l]),g=!1,h=t.useCallback((function(){return{width:"auto",height:"auto"}}),[]),b=t.useCallback((function(e){var t=e.slideData;return i.jsx(B,{card:t})}),[]);return(null==l?void 0:l.length)?i.jsx(n.IntersectionObserverHOC,e.__assign({onIntersection:_},{children:i.jsx("section",e.__assign({className:c,"aria-label":r},{children:i.jsxs("div",e.__assign({className:x},{children:[i.jsx("div",e.__assign({className:m},{children:r})),i.jsx("div",e.__assign({className:p},{children:i.jsx(a.MerchCarousel,{isFreeSwipe:!1,isCentered:!1,isInfinite:!1,isAutoplay:!1,lazyLoad:!0,lazyWidget:g,isLoopAdditionalSlides:!0,showNavigation:!1,showPagination:!1,startingSlide:0,spacingBetween:12,slidesToDisplay:"auto",slides:u,getSlideStyles:h,renderSlideItem:b,styleConfig:{swipperWrapper:{paddingLeft:"16px",paddingRight:"16px"}}})}))]}))}))})):null};
2
2
  //# sourceMappingURL=ct-platform-book-zero-trip-widget.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-book-zero-trip-widget.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx","../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","BookZeroTripCard","_a","card","onPayNow","metaData","stayDateLabel","useMemo","formatBookZeroStayDateRange","stayStartDate","stayEndDate","paymentDueLabel","formatBookZeroPaymentDueLabel","paymentExpiryTime","paymentCountdownText","formatRemainingMsAsHoursCountdown","statusLabel","_b","bookZeroStatusLabel","handlePayClick","undefined","_jsxs","__assign","className","styles","children","_jsx","src","imageUrl","loading","jsxs","jsx","Typography","variant","color","classNames","default","title","amountDueLabel","HourGlass","Button","size","onClick","cards","onImpression","hasImpressionFiredRef","useRef","handleIntersection","useCallback","current","length","slides","map","itemId","id","image","url","alt","lazyWidget","getSlideStyles","width","height","renderSlideItem","slideData","IntersectionObserverHOC","onIntersection","MerchCarousel","isFreeSwipe","isCentered","isInfinite","isAutoplay","lazyLoad","isLoopAdditionalSlides","showNavigation","showPagination","startingSlide","spacingBetween","slidesToDisplay","styleConfig","swipperWrapper","paddingLeft","paddingRight"],"mappings":"2lCAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,80DCVA,IAEMe,EAAmB,SAACC,SACtBC,EAAID,EAAAC,KACJC,EAAQF,EAAAE,SAGAC,EAAaF,EAAIE,SAEnBC,EAAgBC,EAAAA,SAClB,WAAM,OAAAC,EAA2BA,4BAACH,E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AK,IAAA,UAAAT,WAAA,CACIC,UAAWC,EACC,aAAAa,GAEZ,CAAAZ,SAAAJ,EAAAS,KAAA,MAAAR,WAAA,CAAKC,UAAWC,GACZ,CAAAC,SAAA,CAAAC,EAAAA,IAAA,MAAAJ,EAAAA,SAAA,CAAKC,UAAWC,GAAe,CAAAC,SAAGY,KAClCX,MAAK,MAAAJ,EAAAA,SAAA,CAAAC,UAAWC,GAAwB,CAAAC,SACpCC,EAAAA,IAACwC,EAAAA,cACG,CAAAC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,UACA,EAAAb,WAAYA,EACZc,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAe,EACfC,eAAgB,GAChBC,gBAAgB,OAChB1B,OAAQA,EACRQ,eAAgBA,EAChBG,gBAAiBA,EACjBgB,YAAa,CACTC,eAAgB,CACZC,YAAa,OACbC,aAAc,wBA/BnC,IAwCf","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-book-zero-trip-widget.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx","../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","BookZeroTripCard","_a","card","metaData","landingUrl","stayDateLabel","useMemo","formatBookZeroStayDateRange","stayStartDate","stayEndDate","paymentDueLabel","formatBookZeroPaymentDueLabel","paymentExpiryTime","paymentCountdownText","formatRemainingMsAsHoursCountdown","statusLabel","_b","bookZeroStatusLabel","_jsxs","__assign","className","styles","children","_jsx","src","imageUrl","loading","jsxs","jsx","Typography","variant","color","classNames","default","title","amountDueLabel","HourGlass","Button","size","onClick","window","location","href","cards","hasImpressionFiredRef","useRef","handleIntersection","useCallback","current","length","slides","map","itemId","id","image","url","alt","lazyWidget","getSlideStyles","width","height","renderSlideItem","slideData","IntersectionObserverHOC","onIntersection","MerchCarousel","isFreeSwipe","isCentered","isInfinite","isAutoplay","lazyLoad","isLoopAdditionalSlides","showNavigation","showPagination","startingSlide","spacingBetween","slidesToDisplay","styleConfig","swipperWrapper","paddingLeft","paddingRight"],"mappings":"2lCAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,80DCVA,IAEMe,EAAmB,SAACC,SAAEC,EAAID,EAAAC,KACpBC,EAAyBD,EAAIC,SAAnBC,EAAeF,EAAIE,WAE/BC,EAAgBC,EAAAA,SAClB,WACI,OAAAC,EAA2BA,4BACvBJ,EAASK,cACTL,EAASM,YACZ,GACL,CAACN,EAASK,cAAeL,EAASM,cAGhCC,EAAkBJ,EAAAA,SACpB,WAAM,OAAAK,EAAAA,8BAA8BR,EAASS,kBAAkB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,EAAAA,IAAC0C,EAAAA,cACG,CAAAC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,UACA,EAAAb,WAAYA,EACZc,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAe,EACfC,eAAgB,GAChBC,gBAAgB,OAChB1B,OAAQA,EACRQ,eAAgBA,EAChBG,gBAAiBA,EACjBgB,YAAa,CACTC,eAAgB,CACZC,YAAa,OACbC,aAAc,wBA/BnC,IAwCf","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useMemo as n,useRef as d,useCallback as o}from"react";import{IntersectionObserverHOC as l}from"@cleartrip/ct-platform-io-hoc";import{MerchCarousel as a}from"@cleartrip/ct-platform-merch-carousel";import r from"classnames";import{Typography as m}from"@cleartrip/ct-design-typography";import{Button as s}from"@cleartrip/ct-design-button";import{HourGlass as c}from"@cleartrip/ct-platform-assets";import{formatBookZeroStayDateRange as _,formatBookZeroPaymentDueLabel as p,formatRemainingMsAsHoursCountdown as u}from"@cleartrip/ct-platform-utils";var x="index-module_bztContainer__eDkV4",h="index-module_bztWrapper__ISRXL",f="index-module_bztTitle__Gghfq",b="index-module_bztContentWrapper__YjHdZ",g="index-module_bztCard__nDyiw",y="index-module_bztCardTop__NsU0I",w="index-module_bztThumb__s-7EQ",z="index-module_bztCardTitle__BINAl",v="index-module_bztCardTextCol__wheg1",C="index-module_bztDivider__M-QEW",N="index-module_bztCardBottom__Tjcmq",T="index-module_bztPriceBlock__9GkVf",D="index-module_bztTextEllipsis__d3TSs",S="index-module_bztDateMuted__kS6-O",k="index-module_bztAmountLabel__OD-eO",B="index-module_bztCountdownRow__8Vniy",E="index-module_bztCountdownIcon__BltvK",I="index-module_bztCountdownLabel__cfr0-";!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===t&&n.firstChild?n.insertBefore(d,n.firstChild):n.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_bztContainer__eDkV4{height:100%;position:relative;width:100%}.index-module_bztWrapper__ISRXL{height:100%;padding:16px 0;width:100%}.index-module_bztTitle__Gghfq{color:#1a1a1a;font-size:16px;font-weight:600;line-height:22px;margin:0;padding-bottom:12px;padding-left:16px;width:100%}.index-module_bztContentWrapper__YjHdZ{position:relative;width:100%}.index-module_bztCard__nDyiw{background:#fff;border:1.17px solid rgba(26,26,26,.08);border-radius:16px;box-sizing:border-box;display:flex;flex-direction:column;height:157px;outline:none;overflow:hidden;padding:12px;width:295px}.index-module_bztCard__nDyiw:focus,.index-module_bztCard__nDyiw:focus-visible{outline:none}.index-module_bztCardTop__NsU0I{align-items:flex-start;display:flex;flex-direction:row;gap:8px;padding-bottom:12px}.index-module_bztCard__nDyiw .index-module_bztThumb__s-7EQ{background:#f2f2f2;border-radius:8px;flex-shrink:0;height:58px;max-height:58px;max-width:58px;object-fit:cover;width:58px}.index-module_bztCardTitle__BINAl{line-height:22px}.index-module_bztCardTextCol__wheg1{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}.index-module_bztDivider__M-QEW{border:0;border-top:1px dashed rgba(0,0,0,.1);margin:0 0 12px}.index-module_bztCardBottom__Tjcmq{align-items:flex-end;display:flex;flex-direction:row;gap:12px;justify-content:space-between}.index-module_bztPriceBlock__9GkVf{display:flex;flex-direction:column;gap:4px;min-width:0}.index-module_bztTextEllipsis__d3TSs{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.index-module_bztDateMuted__kS6-O{color:grey}.index-module_bztAmountLabel__OD-eO{line-height:24px}.index-module_bztCountdownRow__8Vniy{align-items:center;display:flex;flex-direction:row;gap:4px;margin-bottom:4px}.index-module_bztCountdownIcon__BltvK{flex-shrink:0}.index-module_bztCountdownLabel__cfr0-{color:#cd1719}");var L=function(d){var o,l=d.card,a=d.onPayNow,x=l.metaData,h=n((function(){return _(x.stayStartDate,x.stayEndDate)}),[x.stayStartDate,x.stayEndDate]),f=n((function(){return p(x.paymentExpiryTime)}),[x.paymentExpiryTime]),b=u(x.paymentExpiryTime),L=null!==(o=x.bookZeroStatusLabel)&&void 0!==o?o:"Booked with ₹0 payment",W=a?function(){return a(l)}:void 0;return i("div",e({className:g},{children:[i("div",e({className:y},{children:[t("img",{className:w,src:l.imageUrl,loading:"lazy"}),i("div",e({className:v},{children:[t(m,e({variant:"L3",color:"success"},{children:L})),t(m,e({variant:"HM3",className:r(D,z)},{children:l.title})),h?t(m,e({variant:"B3",className:r(D,S)},{children:h})):null]}))]})),t("hr",{className:C}),i("div",e({className:N},{children:[i("div",e({className:T},{children:[t(m,e({variant:"HM2",className:k},{children:x.amountDueLabel})),b?i("div",e({className:B},{children:[t(c,{className:E,"aria-hidden":!0}),t(m,e({variant:"B4",className:I},{children:b}))]})):t(m,e({variant:"L3"},{children:f}))]})),t(s,e({variant:"contained",size:"medium",color:"secondary",onClick:W},{children:"Pay now"}))]}))]}))},W=function(r){var m=r.title,s=void 0===m?"Complete your payment":m,c=r.cards,_=r.onPayNow,p=r.onImpression,u=d(!1),g=o((function(){!u.current&&(null==c?void 0:c.length)&&(u.current=!0,null==p||p(c.length))}),[null==c?void 0:c.length,p]),y=n((function(){return(null!=c?c:[]).map((function(i){return e(e({},i),{itemId:i.id,image:{url:i.imageUrl,alt:""}})}))}),[c]),w=!1,z=o((function(){return{width:"auto",height:"auto"}}),[]),v=o((function(e){var i=e.slideData;return t(L,{card:i,onPayNow:_})}),[_]);return(null==c?void 0:c.length)?t(l,e({onIntersection:g},{children:t("section",e({className:x,"aria-label":s},{children:i("div",e({className:h},{children:[t("div",e({className:f},{children:s})),t("div",e({className:b},{children:t(a,{isFreeSwipe:!1,isCentered:!1,isInfinite:!1,isAutoplay:!1,lazyLoad:!0,lazyWidget:w,isLoopAdditionalSlides:!0,showNavigation:!1,showPagination:!1,startingSlide:0,spacingBetween:12,slidesToDisplay:"auto",slides:y,getSlideStyles:z,renderSlideItem:v,styleConfig:{swipperWrapper:{paddingLeft:"16px",paddingRight:"16px"}}})}))]}))}))})):null};export{W as BookZeroTripWidget};
1
+ import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useMemo as d,useRef as n,useCallback as o}from"react";import{IntersectionObserverHOC as l}from"@cleartrip/ct-platform-io-hoc";import{MerchCarousel as a}from"@cleartrip/ct-platform-merch-carousel";import r from"classnames";import{Typography as m}from"@cleartrip/ct-design-typography";import{Button as s}from"@cleartrip/ct-design-button";import{HourGlass as c}from"@cleartrip/ct-platform-assets";import{formatBookZeroStayDateRange as _,formatBookZeroPaymentDueLabel as p,formatRemainingMsAsHoursCountdown as u}from"@cleartrip/ct-platform-utils";var x="index-module_bztContainer__eDkV4",h="index-module_bztWrapper__ISRXL",f="index-module_bztTitle__Gghfq",b="index-module_bztContentWrapper__YjHdZ",g="index-module_bztCard__nDyiw",w="index-module_bztCardTop__NsU0I",y="index-module_bztThumb__s-7EQ",z="index-module_bztCardTitle__BINAl",v="index-module_bztCardTextCol__wheg1",C="index-module_bztDivider__M-QEW",N="index-module_bztCardBottom__Tjcmq",T="index-module_bztPriceBlock__9GkVf",D="index-module_bztTextEllipsis__d3TSs",S="index-module_bztDateMuted__kS6-O",k="index-module_bztAmountLabel__OD-eO",B="index-module_bztCountdownRow__8Vniy",E="index-module_bztCountdownIcon__BltvK",L="index-module_bztCountdownLabel__cfr0-";!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&d.firstChild?d.insertBefore(n,d.firstChild):d.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".index-module_bztContainer__eDkV4{height:100%;position:relative;width:100%}.index-module_bztWrapper__ISRXL{height:100%;padding:16px 0;width:100%}.index-module_bztTitle__Gghfq{color:#1a1a1a;font-size:16px;font-weight:600;line-height:22px;margin:0;padding-bottom:12px;padding-left:16px;width:100%}.index-module_bztContentWrapper__YjHdZ{position:relative;width:100%}.index-module_bztCard__nDyiw{background:#fff;border:1.17px solid rgba(26,26,26,.08);border-radius:16px;box-sizing:border-box;display:flex;flex-direction:column;height:157px;outline:none;overflow:hidden;padding:12px;width:295px}.index-module_bztCard__nDyiw:focus,.index-module_bztCard__nDyiw:focus-visible{outline:none}.index-module_bztCardTop__NsU0I{align-items:flex-start;display:flex;flex-direction:row;gap:8px;padding-bottom:12px}.index-module_bztCard__nDyiw .index-module_bztThumb__s-7EQ{background:#f2f2f2;border-radius:8px;flex-shrink:0;height:58px;max-height:58px;max-width:58px;object-fit:cover;width:58px}.index-module_bztCardTitle__BINAl{line-height:22px}.index-module_bztCardTextCol__wheg1{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}.index-module_bztDivider__M-QEW{border:0;border-top:1px dashed rgba(0,0,0,.1);margin:0 0 12px}.index-module_bztCardBottom__Tjcmq{align-items:flex-end;display:flex;flex-direction:row;gap:12px;justify-content:space-between}.index-module_bztPriceBlock__9GkVf{display:flex;flex-direction:column;gap:4px;min-width:0}.index-module_bztTextEllipsis__d3TSs{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.index-module_bztDateMuted__kS6-O{color:grey}.index-module_bztAmountLabel__OD-eO{line-height:24px}.index-module_bztCountdownRow__8Vniy{align-items:center;display:flex;flex-direction:row;gap:4px;margin-bottom:4px}.index-module_bztCountdownIcon__BltvK{flex-shrink:0}.index-module_bztCountdownLabel__cfr0-{color:#cd1719}");var I=function(n){var o,l=n.card,a=l.metaData,x=l.landingUrl,h=d((function(){return _(a.stayStartDate,a.stayEndDate)}),[a.stayStartDate,a.stayEndDate]),f=d((function(){return p(a.paymentExpiryTime)}),[a.paymentExpiryTime]),b=u(a.paymentExpiryTime),I=null!==(o=a.bookZeroStatusLabel)&&void 0!==o?o:"Booked with ₹0 payment";return i("div",e({className:g},{children:[i("div",e({className:w},{children:[t("img",{className:y,src:l.imageUrl,loading:"lazy"}),i("div",e({className:v},{children:[t(m,e({variant:"L3",color:"success"},{children:I})),t(m,e({variant:"HM3",className:r(D,z)},{children:l.title})),h?t(m,e({variant:"B3",className:r(D,S)},{children:h})):null]}))]})),t("hr",{className:C}),i("div",e({className:N},{children:[i("div",e({className:T},{children:[t(m,e({variant:"HM2",className:k},{children:a.amountDueLabel})),b?i("div",e({className:B},{children:[t(c,{className:E,"aria-hidden":!0}),t(m,e({variant:"B4",className:L},{children:b}))]})):t(m,e({variant:"L3"},{children:f}))]})),t(s,e({variant:"contained",size:"medium",color:"secondary",onClick:function(){window.location.href=x}},{children:"Pay now"}))]}))]}))},W=function(r){var m=r.title,s=void 0===m?"Complete your payment":m,c=r.cards,_=n(!1),p=o((function(){!_.current&&(null==c?void 0:c.length)&&(_.current=!0)}),[null==c?void 0:c.length]),u=d((function(){return(null!=c?c:[]).map((function(i){return e(e({},i),{itemId:i.id,image:{url:i.imageUrl,alt:""}})}))}),[c]),g=!1,w=o((function(){return{width:"auto",height:"auto"}}),[]),y=o((function(e){var i=e.slideData;return t(I,{card:i})}),[]);return(null==c?void 0:c.length)?t(l,e({onIntersection:p},{children:t("section",e({className:x,"aria-label":s},{children:i("div",e({className:h},{children:[t("div",e({className:f},{children:s})),t("div",e({className:b},{children:t(a,{isFreeSwipe:!1,isCentered:!1,isInfinite:!1,isAutoplay:!1,lazyLoad:!0,lazyWidget:g,isLoopAdditionalSlides:!0,showNavigation:!1,showPagination:!1,startingSlide:0,spacingBetween:12,slidesToDisplay:"auto",slides:u,getSlideStyles:w,renderSlideItem:y,styleConfig:{swipperWrapper:{paddingLeft:"16px",paddingRight:"16px"}}})}))]}))}))})):null};export{W as BookZeroTripWidget};
2
2
  //# sourceMappingURL=ct-platform-book-zero-trip-widget.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-book-zero-trip-widget.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx","../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","BookZeroTripCard","_a","card","onPayNow","metaData","stayDateLabel","useMemo","formatBookZeroStayDateRange","stayStartDate","stayEndDate","paymentDueLabel","formatBookZeroPaymentDueLabel","paymentExpiryTime","paymentCountdownText","formatRemainingMsAsHoursCountdown","statusLabel","_b","bookZeroStatusLabel","handlePayClick","undefined","_jsxs","__assign","className","styles","children","_jsx","src","imageUrl","loading","Typography","variant","color","classNames","title","amountDueLabel","HourGlass","Button","size","onClick","BookZeroTripWidget","cards","onImpression","hasImpressionFiredRef","useRef","handleIntersection","useCallback","current","length","slides","map","itemId","id","image","url","alt","lazyWidget","getSlideStyles","width","height","renderSlideItem","slideData","IntersectionObserverHOC","onIntersection","MerchCarousel","isFreeSwipe","isCentered","isInfinite","isAutoplay","lazyLoad","isLoopAdditionalSlides","showNavigation","showPagination","startingSlide","spacingBetween","slidesToDisplay","styleConfig","swipperWrapper","paddingLeft","paddingRight"],"mappings":"+xCAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAA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AA2D,UAAkD,OAC1DnC,EAACzB,EAAgB,CACbE,KAAM0D,EACNzD,SAAUA,GAH4C,GAM9D,CAACA,IAGL,OAAKqC,eAAAA,EAAOO,QAKRtB,EAACoC,EAAuBxC,EAAA,CAACyC,eAAgBlB,GACrC,CAAApB,SAAAC,EAAA,UAAAJ,EAAA,CACIC,UAAWC,EACC,aAAAU,GAEZ,CAAAT,SAAAJ,EAAA,MAAAC,EAAA,CAAKC,UAAWC,GACZ,CAAAC,SAAA,CAAAC,EAAA,MAAAJ,EAAA,CAAKC,UAAWC,GAAe,CAAAC,SAAGS,KAClCR,EAAK,MAAAJ,EAAA,CAAAC,UAAWC,GAAwB,CAAAC,SACpCC,EAACsC,EACG,CAAAC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,UACA,EAAAb,WAAYA,EACZc,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAe,EACfC,eAAgB,GAChBC,gBAAgB,OAChB1B,OAAQA,EACRQ,eAAgBA,EAChBG,gBAAiBA,EACjBgB,YAAa,CACTC,eAAgB,CACZC,YAAa,OACbC,aAAc,wBA/BnC,IAwCf","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-book-zero-trip-widget.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/BookZeroTripWidget/src/BookZeroTripCard.tsx","../packages/components/BookZeroTripWidget/src/BookZeroTripWidget.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","BookZeroTripCard","_a","card","metaData","landingUrl","stayDateLabel","useMemo","formatBookZeroStayDateRange","stayStartDate","stayEndDate","paymentDueLabel","formatBookZeroPaymentDueLabel","paymentExpiryTime","paymentCountdownText","formatRemainingMsAsHoursCountdown","statusLabel","_b","bookZeroStatusLabel","_jsxs","__assign","className","styles","children","_jsx","src","imageUrl","loading","Typography","variant","color","classNames","title","amountDueLabel","HourGlass","Button","size","onClick","window","location","href","BookZeroTripWidget","cards","hasImpressionFiredRef","useRef","handleIntersection","useCallback","current","length","slides","map","itemId","id","image","url","alt","lazyWidget","getSlideStyles","width","height","renderSlideItem","slideData","IntersectionObserverHOC","onIntersection","MerchCarousel","isFreeSwipe","isCentered","isInfinite","isAutoplay","lazyLoad","isLoopAdditionalSlides","showNavigation","showPagination","startingSlide","spacingBetween","slidesToDisplay","styleConfig","swipperWrapper","paddingLeft","paddingRight"],"mappings":"+xCAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,80DCVA,IAEMe,EAAmB,SAACC,SAAEC,EAAID,EAAAC,KACpBC,EAAyBD,EAAIC,SAAnBC,EAAeF,EAAIE,WAE/BC,EAAgBC,GAClB,WACI,OAAAC,EACIJ,EAASK,cACTL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,GAChBC,gBAAgB,OAChB1B,OAAQA,EACRQ,eAAgBA,EAChBG,gBAAiBA,EACjBgB,YAAa,CACTC,eAAgB,CACZC,YAAa,OACbC,aAAc,wBA/BnC,IAwCf","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-book-zero-trip-widget",
3
- "version": "1.0.6-beta.0",
3
+ "version": "1.0.6-beta.1",
4
4
  "description": "Book Zero Trip Widget Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-book-zero-trip-widget.cjs.js",
@@ -17,12 +17,12 @@
17
17
  "classnames": "^2.5.1",
18
18
  "swiper": "6.8.4",
19
19
  "uuid": "^9.0.1",
20
- "@cleartrip/ct-platform-assets": "4.2.0-beta.75",
21
- "@cleartrip/ct-platform-merch-carousel": "4.2.0-beta.75",
22
- "@cleartrip/ct-platform-types": "4.2.0-beta.75",
23
- "@cleartrip/ct-platform-io-hoc": "4.2.0-beta.75",
24
- "@cleartrip/ct-platform-utils": "4.2.0-beta.75",
25
- "@cleartrip/ct-platform-constants": "4.2.0-beta.75"
20
+ "@cleartrip/ct-platform-io-hoc": "4.2.0-beta.76",
21
+ "@cleartrip/ct-platform-assets": "4.2.0-beta.76",
22
+ "@cleartrip/ct-platform-utils": "4.2.0-beta.76",
23
+ "@cleartrip/ct-platform-merch-carousel": "4.2.0-beta.76",
24
+ "@cleartrip/ct-platform-types": "4.2.0-beta.76",
25
+ "@cleartrip/ct-platform-constants": "4.2.0-beta.76"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.8.0",