PageSourceSearch

https://vigilantes-do-sono.netlify.app/component---src-pages-chatf…stricao-do-sono-tsx-ea797ff15c28d46f3de3.js

js vigilantes-do-sono.netlify.app collected 2026-10-03 11:37:35 UTC 34,354 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[7920],{3289:function(e,t,r){function n(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}r.d(t,{A:function(){return n}})},4517:function(e,t,r){function n(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}r.d(t,{A:function(){return n}})},12567:function(e,t,r){var n=r(60795),a=r(19937),i=r(33737),o=r(14041),s=r(30773);t.A=function(e){var t=e.children;return o.createElement(o.Fragment,null,n.i.isNative||o.createElement(s.m,null,o.createElement("script",{src:i.W,async:!0})),o.createElement(a.O,null),t)}},13359:function(e,t,r){r.d(t,{r:function(){return n}});var n=function(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}},14442:function(e,t,r){r.r(t),r.d(t,{SleepRestrictionEvaluation:function(){return q},default:function(){return V}});var n=r(86330),a=r(75799),i=r.n(a),o=r(92513),s=r(32303),u=r(21538),l=r(61981),c=r(53943),d=r(42807),p=r(39213),f=r(44530),m=r(60532),h=r(87384),g=r(54991),v=r(30530),y=r(61940),E=r(42066),_=r(62404),w=r(93865),b=r(87872),C=r(22502),A=r(3289),D=r(60162),T=r(54100);function x(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function S(e,t){(0,T.A)(2,arguments);var r=(0,C.A)(e),n=(0,C.A)(t),a=x(r,n),i=Math.abs(function(e,t){(0,T.A)(2,arguments);var r=(0,D.A)(e),n=(0,D.A)(t),a=r.getTime()-(0,A.A)(r),i=n.getTime()-(0,A.A)(n);return Math.round((a-i)/864e5)}(r,n));r.setDate(r.getDate()-a*i);var o=a*(i-Number(x(r,n)===-a));return 0===o?0:o}var I,M,N=r(71053),U=r(24755),k=r(14041),R=r(17378),F=r(12567),H=r(58285),P=r(14887),L=(0,P.Ay)(I||(I=(0,H.A)(["\n  query LastSleepRestrictionQueryLandingPage {\n    sleep_restriction(limit: 1, order_by: { start_date: desc }) {\n      before_eficiency\n      before_fill_count\n      before_time_in_bed\n      before_time_sleep\n      desired_wake_up\n      hour_to_sleep\n      new_time_in_bed\n      start_date\n      user_id\n    }\n  }\n"]))),O=(0,P.Ay)(M||(M=(0,H.A)(["\n  query SleepDiaryForSleepRestrictionQuery($date: date!) {\n    sleep_diary(order_by: { date: asc }, where: { date: { _gt: $date } }) {\n      id\n      date\n      get_up\n      go_sleep\n      timezone\n    }\n  }\n"]))),W=r(38446),B=r(18738),G=r(4517),Y=r(20704);function j(e,t){(0,T.A)(2,arguments);var r=(0,G.A)(t);return(0,Y.A)(e,6e4*r)}function z(e,t,r,n){var a=function(e,t){var r=j(e,-B.fY.beforeRecommendedTimeToSleep),n=j(e,B.fY.afterRecommendedTimeToSleep),a=r<=t&&t<=n?q.Right:q.Wrong;return a}(e,r),i=function(e,t){var r=j(e,-B.fY.beforeRecommendedTimeToGetUp),n=j(e,B.fY.afterRecommendedTimeToGetUp),a=r<=t&&t<=n?q.Right:q.Wrong;return a}(t,n);return{didSleepAtRightTime:a,didGetUpAtRightTime:i}}var X=function(e){var t=(0,U.useTranslation)("chatfuel").t,r=(0,E.P)(O,{variables:{date:e.data&&e.data.start_date}}),a=r.data,u=r.error,f=r.loading,m=(0,s.te)(e.data.start_date),g=S(new Date(a&&a.sleep_diary&&a.sleep_diary.length>0&&a.sleep_diary[a.sleep_diary.length-1].date),m),b=Array(g>0?g:0).fill(m).map(function(e,t){return(0,N.A)(m,t+1)}),C=e.data.hour_to_sleep.slice(0,5),A=e.data.desired_wake_up.slice(0,5),D=function(e,t){return{tooltipRecommendedSleepTime:"O horário recomendado para você dormir é entre "+(0,l.$)(-B.fY.beforeRecommendedTimeToSleep,e)+" e "+(0,l.$)(B.fY.afterRecommendedTimeToSleep,e),tooltipRecommendedGetUpTime:"O horário recomendado para você acordar é entre "+(0,l.$)(-B.fY.beforeRecommendedTimeToGetUp,t)+" e "+(0,l.$)(B.fY.afterRecommendedTimeToGetUp,t)}}(C,A),T=D.tooltipRecommendedSleepTime,x=D.tooltipRecommendedGetUpTime,I=b.map(function(e){return K(f,e,a,C,A,t)}),M=(0,v.p)(),R=M.close,F=M.loading,H=(0,y.t)({onSuccess:R,url:w.kP.RedirectUser}),P=H[0],L=H[1].loading,G=function(){var t=(0,n.A)(i().mark(function t(){var r,n,a,o,s,u,l;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=I.length,n=I.filter(function(e){return e.wake===q.Right}).length/r,a=I.filter(function(e){return e.sleep===q.Right}).length/r,o=(n+a)/2,s=.65,console.log("DIARY_DEBUG: relatorio-restricao-do-sono.tsx ~ line 131 ~ handleClose ~ userId"),t.next=1,_.c.getId();case 1:return u=t.sent,l=(0,W.$)(u,"sleep_restriction_other_s2",{"global-sleep_restriction_start":e.data.start_date,"global-sleep_restriction_grade":o>s,"global-sleep_restriction_morning_grade":n>s,"global-sleep_restriction_night_grade":a>s}),t.abrupt("return",P(l));case 2:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}();return I&&0!==I.length?u?k.createElement(p.O,{icon:k.createElement(c.hw.FlashAlert,{size:"9x"}),title:t("sleep_restriction_error_title"),description:t("sleep_restriction_error_description")}):k.createElement(k.Fragment,null,k.createElement(h.XI,null,k.createElement(h.D1,null,k.createElement(h.TR,null,k.createElement(h.TH,{textAlign:"left"},t("sleep_restriction_table_date")),k.createElement(h.TH,{className:"microtip",role:"tooltip","data-microtip-position":"bottom","aria-label":T,textAlign:"right"},t("sleep_restriction_table_slept_at",{time:C})," ",k.createElement(c.hw.Question,null)),k.createElement(h.TH,{className:"microtip",role:"tooltip","data-microtip-position":"bottom","aria-label":x,textAlign:"right"},t("sleep_restriction_table_woke_at",{time:A})," ",k.createElement(c.hw.Question,null)))),I.map(function(e){var t={className:"microtip",role:"tooltip","data-microtip-size":"small","aria-label":e.tip};return k.createElement(h.TR,{key:e.date},k.createElement(h.TD,Object.assign({},t,{"data-microtip-position":"right",textAlign:"left"}),e.date),k.createElement(h.TD,Object.assign({},t,{"data-microtip-position":"right",textAlign:"right"}),Q(e.sleep)),k.createElement(h.TD,Object.assign({},t,{"data-microtip-position":"left",textAlign:"right"}),Q(e.wake)))})),!f&&k.createElement(d.CT,null,k.createElement(o.B,{onClick:G,expanded:!0,loading:L||F},t("sleep_restriction_continue_button")))):k.createElement(p.O,{icon:k.createElement(c.hw.Table,{size:"9x"}),title:t("sleep_restriction_no_diary_title"),description:t("sleep_restriction_no_diary_description")},k.createElement(o.B,{onClick:R},t("sleep_restriction_continue_button")))},q=function(e){return e[e.Right=0]="Right",e[e.Wrong=1]="Wrong",e[e.Empty=2]="Empty",e[e.Loading=3]="Loading",e}({}),K=function(e,t,r,n,a,i){var o=(0,u.i_)(t);
1if(e)return{date:o,sleep:q.Loading,wake:q.Loading};var s=(0,u.FF)(t),c=r&&r.sleep_diary&&r.sleep_diary.find(function(e){return e.date===s});if(!c)return{date:o,sleep:q.Empty,wake:q.Empty,tip:i("sleep_restriction_day_not_filled")};var d=$(s,a,n),p=d[0],f=d[1],m=(0,l.$)(60*c.timezone,c.get_up),h=(0,l.$)(60*c.timezone,c.go_sleep),g=$(s,m,h),v=z(p,f,g[0],g[1]),y=v.didSleepAtRightTime,E=v.didGetUpAtRightTime;return{date:o,tip:i("sleep_restriction_tooltip_slept",{time:h})+"\n"+i("sleep_restriction_tooltip_woke",{time:m}),sleep:y,wake:E}},$=function(e,t,r){var n=e.replace(/-/g,"/"),a=(0,s.te)(n+" "+t),i=(0,s.te)(n+" "+r);return i>a&&(i=(0,N.A)(i,-1)),[i,a]},Q=function(e){switch(e){case q.Empty:return k.createElement(c.hw.Square,{key:"sleepEmpty"});case q.Loading:return k.createElement(f.Fw,{key:"sleepLoading",height:"15px",width:"30%"});case q.Right:return k.createElement(c.hw.Check,{style:{color:c.iZ.Success}});case q.Wrong:return k.createElement(c.hw.Close,{style:{color:c.iZ.Alert}});default:return null}},V=function(e){var t=(0,U.useTranslation)("chatfuel").t,r=(0,E.P)(L),n=r.data,a=r.error,i=r.loading,s=(0,v.p)(),u=s.close,l=s.loading;return k.createElement(F.A,null,k.createElement(R.k,{socialMedia:{canonicalUrl:(0,b.KQ)(e.data.site.siteMetadata.siteUrl,e.location.pathname),title:t("sleep_restriction_report_title"),description:t("sleep_restriction_report_description")}}),k.createElement(c.xA,null,k.createElement(c.fI,{mt:!0,mb:!0},k.createElement(c.fv,{xs:12},k.createElement(c.H1,null,t("sleep_restriction_report_title")),k.createElement(c.nB,null,t("sleep_restriction_report_intro")," ",k.createElement("br",null)," ",t("sleep_restriction_report_tip")))),k.createElement(g.G,{loading:i,error:!!a,data:n&&n.sleep_restriction&&n.sleep_restriction.length>0},k.createElement(g.G.Shimmer,null,k.createElement(k.Fragment,null,Array(3).fill(1).map(function(e,t){return k.createElement(c.fI,{mt:!0,mb:!0,key:t},k.createElement(c.fv,{xs:12,sm:12,md:7,lg:7},k.createElement(m.Oi,null),k.createElement(c.wv,null)))}))),k.createElement(g.G.NoData,null,k.createElement(p.O,{icon:k.createElement(c.hw.Table,{size:"9x"}),title:t("sleep_restriction_no_data_title"),description:t("sleep_restriction_no_data_description")},k.createElement(o.B,{onClick:u,loading:l},t("sleep_restriction_ok_button")))),k.createElement(g.G.Error,null,k.createElement(p.O,{icon:k.createElement(c.hw.FlashAlert,{size:"9x"}),title:t("sleep_restriction_error_title"),description:t("sleep_restriction_error_description")})),n&&n.sleep_restriction&&n.sleep_restriction[0]&&k.createElement(c.fI,{mt:!0,mb:!0},k.createElement(c.fv,{xs:12},k.createElement(X,{data:n.sleep_restriction[0]}))))))}},14887:function(e,t,r){var n=r(66613),a=r(81116),i=new Map,o=new Map,s=!0,u=!1;function l(e){return e.replace(/[\s,]+/g," ").trim()}function c(e){var t=new Set,r=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,a=l((u=e.loc).source.body.substring(u.start,u.end)),i=o.get(n);i&&!i.has(a)?s&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):i||o.set(n,i=new Set),i.add(a),t.has(a)||(t.add(a),r.push(e))}else r.push(e);var u}),(0,n.Cl)((0,n.Cl)({},e),{definitions:r})}function d(e){var t=l(e);if(!i.has(t)){var r=(0,a.qg)(e,{experimentalFragmentVariables:u});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");i.set(t,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(c(r)))}return i.get(t)}function p(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]}),d(n)}var f,m=p,h=function(){i.clear(),o.clear()},g=function(){s=!1},v=function(){u=!0},y=function(){u=!1};(f=p||(p={})).gql=m,f.resetCaches=h,f.disableFragmentWarnings=g,f.enableExperimentalFragmentVariables=v,f.disableExperimentalFragmentVariables=y,p.default=p,t.Ay=p},18738:function(e,t,r){r.d(t,{fY:function(){return o},dP:function(){return s},F6:function(){return u}});var n=r(75153);var a=r(32303),i=(r(71490),r(13359)),o=function(e){return e[e.beforeRecommendedTimeToSleep=30]="beforeRecommendedTimeToSleep",e[e.afterRecommendedTimeToSleep=60]="afterRecommendedTimeToSleep",e[e.beforeRecommendedTimeToGetUp=60]="beforeRecommendedTimeToGetUp",e[e.afterRecommendedTimeToGetUp=30]="afterRecommendedTimeToGetUp",e}({});function s(e,t){if(!t||!t.length)return[];var r=new Date(t[0].entryDate);r.setDate(r.getDate()-1);var o=e?e.map(function(e){return(0,a.te)(e.start_date)}):[],s=new Date,u=function(e,t){return e.reduce(function(r,n,a){var i,o=n,s=e[a+1];if(!o||!s)return r;var u=0===a?"Basal":a===e.length-2?"Atual":"Ciclo "+a,l=(null==t||null===(i=t[a-1])||void 0===i?void 0:i.new_time_in_bed)||null;return r.push({name:u,startDate:o,endDate:s,suggestedTTC:l,data:[]}),r},[])}([r].concat((0,n.A)(o),[s]),e);return u.length?(function(e,t){e.forEach(function(e){for(var r=!1,n=0;!r;){var a=t[n];if(!a)return void console.error("ERROR: sleep-restriction.ts ~ line 129 ~ reportDiaries.forEac
1h ~ null interval for",n,e);var o=a.endDate;e.entryDate<o||(0,i.r)(e.entryDate,o)?(a.data.push(e),r=!0):n+=1}})}(t,u),u):u}function u(e,t){void 0===t&&(t=!1);var r,n,a=e.name,i=e.suggestedTTC,o=e.startDate,s=e.endDate,u=(r=o,n=s,Math.floor((n.getTime()-r.getTime())/864e5)),l=e.data.reduce(function(r,n){var a=n.minutesInBed,i=n.minutesSleep,o=n.eficiency,s=n.usedMedication;return a&&(r.filledDaysCount+=1),a&&(a>1200&&!t&&console.log("sleep-restriction.ts ~ line 180: Invalid minutesInBed:",a,e,n),r.avgMinutesInBed+=a),n.totalTimeToSleep&&(r.avgLatency+=n.totalTimeToSleep),n.wake_up_duration&&(r.avgWaso+=n.wake_up_duration),i&&(i>960&&!t&&console.log("sleep-restriction.ts ~ line 186: Invalid minutesSleep:",i,e,n),r.avgMinutesSleep+=i),o&&((o<0||o>100)&&!t&&console.log("sleep-restriction.ts ~ line 192: Invalid eficiency:",o,e,n),r.avgEficiency+=o),s&&(r.daysWithMedicationCount+=1),n.wake_up_count&&(r.daysWithWakeCount+=1),n.totalTimeToSleep>30&&(r.daysWithHighLatency+=1),n.wake_up_duration>30&&(r.daysWithHighWaso+=1),r},{filledDaysCount:0,avgMinutesInBed:0,avgMinutesSleep:0,avgEficiency:0,avgLatency:0,avgWaso:0,daysWithMedicationCount:0,daysWithWakeCount:0,daysWithHighLatency:0,daysWithHighWaso:0});return e.data.length&&(l.avgMinutesInBed/=l.filledDaysCount,l.avgMinutesSleep/=l.filledDaysCount,l.avgEficiency/=l.filledDaysCount,l.avgLatency/=l.filledDaysCount,l.avgWaso/=l.filledDaysCount),Object.assign({name:a,suggestedTTC:i,start:o,end:s,daysCount:u},l)}},20704:function(e,t,r){r.d(t,{A:function(){return o}});var n=r(4517),a=r(22502),i=r(54100);function o(e,t){(0,i.A)(2,arguments);var r=(0,a.A)(e).getTime(),o=(0,n.A)(t);return new Date(r+o)}},21538:function(e,t,r){r.d(t,{Aw:function(){return a},FF:function(){return u},Rd:function(){return s},T9:function(){return o},i_:function(){return i}});var n=r(77794),a=function(e){if(!e)return"";var t=(0,n.a)(e.getDate()),r=(0,n.a)(e.getMonth()+1);return t+" de "+l(parseInt(r,10))+"  de "+e.getFullYear()},i=function(e){return(0,n.a)(e.getDate())+"/"+(0,n.a)(e.getMonth()+1)},o=function(e,t){return void 0===t&&(t="pt-BR"),new Intl.DateTimeFormat(t,{day:"2-digit",month:"2-digit"}).format(e)},s=function(e){return i(e)+"/"+e.getFullYear()},u=function(e){var t=(0,n.a)(e.getDate()),r=(0,n.a)(e.getMonth()+1);return e.getFullYear()+"-"+r+"-"+t},l=function(e){switch("string"==typeof e?parseInt(e,10):e){case 1:return"Janeiro";case 2:return"Fevereiro";case 3:return"Março";case 4:return"Abril";case 5:return"Maio";case 6:return"Junho";case 7:return"Julho";case 8:return"Agosto";case 9:return"Setembro";case 10:return"Outubro";case 11:return"Novembro";case 12:return"Dezembro";default:return"Mês Inválido"}}},22502:function(e,t,r){r.d(t,{A:function(){return i}});var n=r(17545),a=r(54100);function i(e){(0,a.A)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,n.A)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},30530:function(e,t,r){r.d(t,{p:function(){return o}});var n=r(27623),a=r(60795),i=r(14041),o=function(){var e=(0,i.useState)(!1),t=e[0],r=e[1];return{close:(0,i.useCallback)(function(){if(a.i.isNative){return r(!0),a.i.postMessage({type:"close"})}"undefined"==typeof MessengerExtensions||MessengerExtensions.requestCloseBrowser(function(e){console.log("MessengerExtensions.requestCloseBrowser -> success",e)},function(e){console.error("ERROR: MessengerExtensions.requestCloseBrowser -> error",e),window.location.replace("https://www.messenger.com/closeWindow/?image_url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmQpZtX0gKDESA%2Fgiphy.gif%0A&display_text=feche%20essa%20janela"),(0,n.v)(e)})},[]),loading:t}}},32303:function(e,t,r){r.d(t,{rw:function(){return i},te:function(){return a},vd:function(){return o}});var n=r(50594),a=function(e){var t,r=e;if((0,n.hX)(r)||0===r.length)return null;if(o(e))return e;var a=r.replace(new RegExp("-","g"),"/"),s=a.split("/");return s&&4!==s[0].length&&(t=i(r)),o(t)||(t=new Date(a)),o(t)||(t=new Date(r)),o(t)||(t=new Date(r+"00")),o(t)||console.error("ERROR: parseToDate",r),t},i=function(e){if((0,n.hX)(e)||0===e.length)return null;var t=e.replace(new RegExp("-","g"),"/").split("/");if(t.length<3||parseInt(t[0])>31||parseInt(t[1])>12)return console.log("parseDDMMYYYYDate::error: invalid dateComponents: ",t),null;if(2===t[2].length){var r=(new Date).getFullYear().toString().slice(0,2);t[2]=""+r+t[2]}return 4!==t[2].length?null:a(t[2]+"/"+t[1]+"/"+t[0])},o=function(e){return e instanceof Date&&!isNaN(e)}},38446:function(e,t,r){r.d(t,{$:function(){return n}});var n=function(e,t,r){return{blockName:t,userAttributes:r,user:e}}},42807:function(e,t,r){r.d(t,{CT:function(){return h},Db:function(){return l},Gn:function(){return o},Gt:function(){return g},Ox:function(){return c},Ri:function(){return E},Ss:function(){return m},UX:function(){return d},Y4:function(){return y},Z6:function(){return s},ZF:function(){return v},y5:function(){return p}});var n=r(53943),a=r(57901),i=r(6853),o=i.default.div.withConfig({displayName:"wrappercomponent__OverflowHiddenWrapper",componentId:"sc-1crutfa-0"})(["overflow:hidden;"]),s=i.default.div.withConfig({displayName:"wrappercomponent__FlexWrapper",componentId:"sc-1crutfa-1"})(["display:flex;flex-direction:column;align-items:stretch;height:100%;"]),u="6px",l=i.default.div.withConfig({displayName:"wrappercomponent__PaddingWrapper",componentId:"sc-1crutfa-2"})(["padding:",";"],n.Kz.Medium),c=i.default.div.withConfig({displayName:"wrappercomponent__CardWrapper",componentId:"sc-1crutfa-3"})(["overflow:hidden;height:",";padding:",";background:",";box-shadow:",";border-radius:",";margin-bottom:",";@media all and (max-width:64em){margin-bottom:",";}@media all and (max-width:48em){margin-bottom:",";}"],function(e){return e.height||"auto"},function(e){return e.noPadding?0:n.Kz.Medium},function(e){return(0,a.LN)(e.theme.color.background)},function(e){return"regular"===e.theme.name?"0 2px 6px 0 #cdcdcd":"none"},n.VH.Radius,u,function(e){return e.mdMb||u},function(e){return e.smMb||u}),d=i.default.div.withConfig({displayName:"wrappercomponent__BottomSeparatorWrapper",componentId:"sc-1crutfa-4"})(["padding:",";border-bottom:4px solid ",";"],n.Kz.Medium,n.Bs.GrayXXLight),p=i.default.div.withConfig({displayName:"wrappercomponent__FeaturedWrapper",componentId:"sc-1crutfa-5"})(["background:",";background:",";padding:",";border:1px solid ",";height:100%;"],n.Bs.GrayXXLight,f(),n.Kz.Medium,f);function f(){return function(e){return"regular"===e.theme.name?n.Bs.GrayXXLight:(0,a.LN)(e.theme.color.background)}}var m=i.default.div.withConfig({displayName:"wrappercomponent__MultipleCollumnWrapper",componentId:"sc-1crutfa-6"})(["column-count:",";@media all and (min-width:64em),print{column-count:",";column-gap:",";}"],function(e){return e.numberOfCollumnsMobile?""+e.numberOfCollumnsMobile:1},function(e){return""+e.numberOfCollumns},function(e){return e.collumnGap?""+e.collumnGap:""}),h=(i.default.div.withConfig({displayName:"wrappercomponent__BorderRoundWrapper",componentId:"sc-1crutfa-7"})(["overflow:hidden;border-radius:",";position:relative;"],n.VH.Radius),i.default.div.withConfig({displayName:"wrappercomponent__StickButtonWrapper",componentId:"sc-1crutfa-8"})(["position:sticky;z-index:3;bottom:0;margin:auto;padding-top:",";padding-bottom:",";width:90%;"],n.Kz.Large,n.Kz.Large)),g=i.default.div.withConfig({displayName:"wrappercomponent__TopStickyWrapper",componentId:"sc-1crutfa-9"})(["position:sticky;top:","px;@media all and (min-width:64em){top:","px;}overflow:auto;z-index:2;max-height:calc(100vh - ","px);padding-bottom:",";"],n.by.Mobile,n.by.Desk,n.by.Desk,n.Kz.XLarge),v=i.default.div.withConfig({displayName:"wrappercomponent__FieldsWrapper",componentId:"sc-1crutfa-10"})(["margin-right:",";"],n.Kz.Medium),y=i.default.div.withConfig({displayName:"wrappercomponent__CellStyled",componentId:"sc-1crutfa-11"})(["padding:"," ",";&:hover{background-color:",";}&:active{background-color:",";}"],n.Kz.Large,n.Kz.XSmall,(0,a.zX)(n.Bs.Gray,n.ry.L2),(0,a.zX)(n.Bs.Gray,n.ry.L3)),E=i.default.div.withConfig({displayName:"wrappercomponent__CollapsibleWrapperStyled",componentId:"sc-1crutfa-12"})(["max-height:",";transition:max-height 0.3s ease-in-out;overflow:hidden;"],function(e){return e.expanded?e.contentHeight+"px":e.minHeight+"px"})},46497:function(e,t,r){r.d(t,{Y:function(){return p}});
1var n=r(86330),a=r(75799),i=r.n(a),o=r(62072),s=r(27623),u=r(14041),l=r(50594),c=r(60795);function d(e,t){switch(t.type){case"loading":return Object.assign({},e,{loading:!0});case"error":return Object.assign({},e,{error:t.data,loading:!1});case"done":return Object.assign({},e,{data:t.data,loading:!1});default:throw new Error}}function p(e,t){var r=u.useReducer(d,{data:null,loading:!1,error:null}),a=r[0],p=r[1],f=u.useCallback(function(){var r=(0,n.A)(i().mark(function r(n,a){var u,d,f,m;return i().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,p({type:"loading"}),r.next=1,t.post(e.url,n);case 1:return u=r.sent,d=a&&a(u),f=(0,l.hX)(d)?u:d,p({type:"done",data:f}),e.onSuccess&&e.onSuccess(f),r.abrupt("return",f);case 2:throw r.prev=2,m=r.catch(0),c.i.postMessage({type:"error",data:{error:m}}),p({type:"error",data:m}),e.onError?e.onError(m):((0,s.v)(m),o.A.dispatchMessage("Ocorreu um erro. Por favor, tente novamente em 1 minuto.","alert")),m;case 3:case"end":return r.stop()}},r,null,[[0,2]])}));return function(e,t){return r.apply(this,arguments)}}(),[p,e.onError]);return[f,a]}},54100:function(e,t,r){function n(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}r.d(t,{A:function(){return n}})},54991:function(e,t,r){r.d(t,{G:function(){return p}});var n=r(79140),a=r(14041),i=r(6853),o=i.default.div.withConfig({displayName:"loading-statestyle__LoadingStateStyled",componentId:"sc-1y303nb-0"})(["position:relative;"]),s=i.default.div.withConfig({displayName:"loading-statestyle__LoadingStateBlockStyled",componentId:"sc-1y303nb-1"})(["display:",";"],function(e){return e.visible?"block":"none"}),u=i.default.div.withConfig({displayName:"loading-statestyle__LoadingStyled",componentId:"sc-1y303nb-2"})(["top:0;display:",";position:",";width:100%;height:100%;background-color:rgba(255,255,255,0.7);align-items:center;justify-content:center;"],function(e){return e.visible?"flex":"none"},function(e){return e.topMost?"fixed":"absolute"}),l=function(e){return a.createElement(a.Fragment,null,e.children)};l.displayName="StateShimmer";var c=function(e){return a.createElement(a.Fragment,null,e.children)};c.displayName="StateError";var d=function(e){return a.createElement(a.Fragment,null,e.children)};d.displayName="StateNoData";var p=function(e){function t(){return e.apply(this,arguments)||this}(0,n.A)(t,e);var r=t.prototype;return r.render=function(){var e=this.getTypedChildren(),t=e.shimmer,r=e.error,n=e.noData,i=e.data;return a.createElement(o,null,a.createElement(s,{visible:this.props.error&&!this.props.loading&&!this.props.data},r),a.createElement(s,{visible:!this.props.data&&this.props.loading},t),a.createElement(s,{visible:!this.props.error&&!this.props.data&&!this.props.loading},n),a.createElement(s,{visible:this.props.data},this.props.data&&i),a.createElement(u,{visible:this.props.data&&this.props.loading&&this.props.enableActivityIndicator,topMost:this.props.topMost}))},r.getTypedChildren=function(){var e,t,r,n=[];return a.Children.map(this.props.children,function(a){if(a&&a.type&&a.type.displayName)switch(a.type.displayName){case l.displayName:e=a;break;case c.displayName:t=a;break;case d.displayName:r=a;break;default:n.push(a)}else n.push(a)}),{shimmer:e,error:t,noData:r,data:n}},t}(a.Component);p.defaultProps={data:!1,enableActivityIndicator:!0,topMost:!1},p.Shimmer=l,p.Error=c,p.NoData=d},58397:function(e,t,r){r.d(t,{W:function(){return u}});var n=r(86330),a=r(75799),i=r.n(a),o=r(33737),s=function(e){return e.InvalidCredentialsError="Invalid Messenger Credentials",e}(s||{}),u=function(){this.getAuthHeader=(0,n.A)(i().mark(function e(){var t;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("DIARY_DEBUG: vigilantes.datasource.messenger-auth.ts ~ line 11 ~ MessengerAuthHeaders ~ getAuthHeader= ~ userInfo"),e.next=1,o.A.getUserInfo();case 1:if((t=e.sent).psid&&t.signedRequest){e.next=2;break}throw new Error(s.InvalidCredentialsError);case 2:return e.abrupt("return",{"x-psid":t.psid||"","x-signed-request":t.signedRequest||""});case 3:case"end":return e.stop()}},e)}))}},60162:function(e,t,r){r.d(t,{A:function(){return i}});var n=r(22502),a=r(54100);function i(e){(0,a.A)(1,arguments);var t=(0,n.A)(e);return t.setHours(0,0,0,0),t}},60532:function(e,t,r){r.d(t,{LB:function(){return c},NZ:function(){return l},Oi:function(){return u},e6:function(){return s}});var n=r(79140),a=r(14041),i=r(44530),o=r(39624),s=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.render=function(){return a.createElement(i.Fw,{height:o.u9,
1width:"100%"})},t}(a.PureComponent),u=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.render=function(){return a.createElement(a.Fragment,null,a.createElement(i.Fw,{height:"15px",width:"30%"}),a.createElement(i.Fw,{height:"1px",margin:"44px 0 0 0"}))},t}(a.PureComponent),l=function(e){var t=e.height,r=void 0===t?"15px":t,n=e.width,o=(0,a.useState)(""+n||"0"),s=o[0],u=o[1];return(0,a.useEffect)(function(){n||u(Math.floor(100*Math.random())+1+"%")},[]),a.createElement(i.Fw,{height:r,width:s})},c=function(e){return a.createElement(i.Fw,{height:e.height,width:e.width,margin:e.margin})}},61940:function(e,t,r){r.d(t,{t:function(){return u}});var n=r(60795),a=r(18913),i=r(46497),o=r(93865),s=r(58397);function u(e){var t=n.i.isNative?new a.O:new s.W;console.log("DIARY_DEBUG: use-post-using-messenger.hook.ts ~ line 1 ~ NativeHelper.isNative",n.i.isNative);var r=new o.Y1(t);return(0,i.Y)(e,r)}},61981:function(e,t,r){r.d(t,{$:function(){return i}});var n=r(50594),a=r(77794),i=function(e,t){if((0,n.hX)(t))return null;var r=t.split(":").map(function(e){return parseInt(e)}),i=r[0],o=r[1];if((0,n.hX)(i)||(0,n.hX)(o))return null;for(var s=Math.floor(o+parseInt(e,0)),u=0;s<0;)s+=60,u-=1;for(;s>=60;)s-=60,u+=1;var l=(i+u)%24;return(0,a.a)(l>=0?l:l+24)+":"+(0,a.a)(s)}},62404:function(e,t,r){r.d(t,{c:function(){return u}});var n=r(86330),a=r(75799),i=r.n(a),o=r(60795),s=r(33737),u=function(){};u.getId=(0,n.A)(i().mark(function e(){var t,r;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=o.i.userId)){e.next=1;break}return e.abrupt("return",t);case 1:return console.log("DIARY_DEBUG: user-id.datasource.ts ~ line 11 ~ UserIdDataSource ~ getId= ~ userInfo"),e.next=2,s.A.getUserInfo();case 2:return r=e.sent,e.abrupt("return",r.psid);case 3:case"end":return e.stop()}},e)}))},71053:function(e,t,r){r.d(t,{A:function(){return o}});var n=r(4517),a=r(22502),i=r(54100);function o(e,t){(0,i.A)(2,arguments);var r=(0,a.A)(e),o=(0,n.A)(t);return isNaN(o)?new Date(NaN):o?(r.setDate(r.getDate()+o),r):r}},73873:function(e,t,r){r.d(t,{U:function(){return n}});var n=function(e){return e.AlreadyUsedCouponError="AlreadyUsedCouponError",e.AppointmentLimitReachedError="AppointmentLimitReachedError",e.AppointmentAlreadyScheduled="AppointmentAlreadyScheduled",e.AppointmentNotAvailableNowError="AppointmentNotAvailableNowError",e.CannotRescheduleAppointmentError="CannotRescheduleAppointmentError",e.BadRequestError="BadRequestError",e.CantRedeemError="CantRedeemError",e.HealthCarerTimeAlreadyBusyError="HealthCarerTimeAlreadyBusyError",e.CreateHealthCarerUseCaseDuplicateEmailError="CreateHealthCarerUseCaseDuplicateEmailError",e.CreateHealthCarerUseCaseInvalidCRMError="CreateHealthCarerUseCaseInvalidCRMError",e.DuplicatedEmailError="DuplicatedEmailError",e.DuplicatedUserError="DuplicatedUserError",e.EmptyTransactionIdError="EmptyTransactionIdError",e.ExpiredCouponError="ExpiredCouponError",e.HealthCarerUseCaseInvalidDuplicatedProfessionIdError="HealthCarerUseCaseInvalidDuplicatedProfessionIdError",e.HealthCarerrDoesntExistError="HealthCarerrDoesntExistError",e.HttpError="HttpError",e.InactiveCouponError="InactiveCouponError",e.InvalidCouponError="InvalidCouponError",e.InvalidEmaillError="InvalidEmaillError",e.InvalidPackageName="InvalidPackageName",e.InvalidPhoneError="InvalidPhoneError",e.InvalidProductId="InvalidProductId",e.InvalidSetupPagarMeServiceError="InvalidSetupPagarMeServiceError",e.NotAuthorizedPagarMeServiceError="NotAuthorizedPagarMeServiceError",e.NotFoundCouponError="NotFoundCouponError",e.NotFoundError="NotFoundError",e.OperationAlreadyDonePerformHealthCarerMoneyAdditionForUserPaymentUseCaseError="OperationAlreadyDonePerformHealthCarerMoneyAdditionForUserPaymentUseCaseError",e.UsageLimitSurpassedCouponError="UsageLimitSurpassedCouponError",e.UserDoesntExistError="UserDoesntExistError",e.UserHasntPaidPerformHealthCarerMoneyAdditionForUserPaymentUseCaseError="UserHasntPaidPerformHealthCarerMoneyAdditionForUserPaymentUseCaseError",e.ValidationErrorPagarMeServiceError="ValidationErrorPagarMeServiceError",e.UserHasTwoDifferentsSubscriptionsError="UserHasTwoDifferentsSubscriptionsError",e.CantUpdateUserCheckout="CantUpdateUserCheckout",e.CantUpdateUserTelehealth="CantUpdateUserTelehealth",e}({})},87872:function(e,t,r){r.d(t,{KQ:function(){return a},WZ:function(){return i},l2:function(){return o}});var n=r(14707),a=function(e,t,r){if(void 0===r&&(r=""),!e)throw new Error("invalid siteUrl");return o(""+e+t+"/"+r)},i=function(e,t,r){return void 0===r&&(r=""),e&&t||console.error("getDetailPageUrl::error: Invalid input: ","typeSlug",e,"pageSlug",t,"subItemSlug",r),o("/"+e.trim()+"/"+(0,n.s)(t)+"/"+(0,n.s)(r))},o=function(e){if(!e)return e;var t=e.replace(/([^:]\/)\/+/g,"$1");
1return/^\/\//.test(t)&&(t=t.slice(1)),"/"!==t[t.length-1]?t+"/":t}},92513:function(e,t,r){r.d(t,{B:function(){return l}});var n=r(79140),a=r(14041),i=r(79561),o=r(39624),s=r(24755),u=(0,r(6853).default)(s.Link).withConfig({displayName:"buttoncomponentstyle__LinkButtonStyled",componentId:"sc-h0ws0s-0"})(["",""],o.KX),l=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.render=function(){return(0,i.V)(this.props.to?this.props.external?o.jx:u:o.Ak,this.props)},t}(a.Component);l.defaultProps={disabled:!1,expanded:!1,loading:!1,showActiveClass:!0,kind:"primary",type:"button"}},93865:function(e,t,r){r.d(t,{C4:function(){return m},kP:function(){return h},Y1:function(){return g}});var n=r(79140),a=r(63708),i=r(86330),o=r(75799),s=r.n(o),u=r(73873),l=function(){function e(){}var t=e.prototype;return t.setNext=function(e){return this.nextHandler=e,e},t.handle=function(e){return this.nextHandler?this.nextHandler.handle(e):null},e}();var c=r(60795),d=r(58951),p=r.n(d),f=r(17599),m=function(e){return e.config="/schedule-config",e.isUrlAvailable="/is-url-available",e}({}),h=function(e){return e.UpdateUser="/users",e.NotifyUser="/user/notify",e.SleepDiary="/sleep-diary",e.GamblerDiary="/gambler-diary",e.NutritionDiary="/nutrition-diary",e.EmotionDiary="/emotion-diary",e.HealthCarer="/health-carer",e.RedirectUser="/chatfuel/broadcast",e.UpdateHealthCarer="/update-health-carer",e}({}),g=(new Set([u.U.CreateHealthCarerUseCaseDuplicateEmailError,u.U.CreateHealthCarerUseCaseInvalidCRMError,u.U.HealthCarerUseCaseInvalidDuplicatedProfessionIdError]),function(){function e(e){var t=this;this.post=function(e,r){return t.fetch(e,{data:r,method:"post"})},this.get=function(e,r){return t.fetch(e,{method:"get",params:r})},this.handlerChain=new C,this.handlerChain.setNext(new b(e))}return e.prototype.fetch=function(e,t){return this.handlerChain.handle({path:e,input:t})},e}());function v(e){return e.status>=200&&e.status<300?Promise.resolve(e):Promise.reject(e)}function y(e){return e.json()}function E(e){return _.apply(this,arguments)}function _(){return _=(0,i.A)(s().mark(function e(t){var r;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.json();case 1:throw r=e.sent,console.log("error -> json",r),new w(t.statusText,t.status,r);case 2:case"end":return e.stop()}},e)})),_.apply(this,arguments)}var w=function(e){function t(r,n,a){var i;return(i=e.call(this,r)||this).name=u.U.HttpError,i.status=n,i.data=a,Object.setPrototypeOf(i,(this instanceof t?this.constructor:void 0).prototype),i}return(0,n.A)(t,e),t}((0,a.A)(Error)),b=function(e){function t(t){var r;return(r=e.call(this)||this).vigilantesDataSourceAuthHeader=t,r}return(0,n.A)(t,e),t.prototype.handle=function(){var e=(0,i.A)(s().mark(function e(t){var r,n,a,i,o,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.input,a=n.params?"?"+f.stringify(n.params):"",i=(r.startsWith("http")?"":"https://vigilantes-do-sono-api.herokuapp.com")+r+a,e.next=1,this.vigilantesDataSourceAuthHeader.getAuthHeader();case 1:return o=e.sent,u={method:n.method,headers:Object.assign({},o,{Accept:"application/json","Content-Type":"application/json"}),body:n.data?JSON.stringify(n.data):void 0},e.abrupt("return",p()(i,u).then(v).then(y).catch(E));case 2:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t}(l),C=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.handle=function(){var t=(0,i.A)(s().mark(function t(r){var n,a;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(n=r.path)&&n.includes(h.RedirectUser)&&c.i.isNative){t.next=1;break}return t.abrupt("return",e.prototype.handle.call(this,r));case 1:return a={type:"chatfuelBroadcast",data:r.input.data},t.abrupt("return",c.i.postMessage(a));case 2:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}(),t}(l)}}]);
2//# sourceMappingURL=component---src-pages-chatfuel-relatorio-restricao-do-sono-tsx-ea797ff15c28d46f3de3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.