Best JavaScript code snippet using playwright-internal
Description2.jsx
Source:Description2.jsx  
1import Grid from '@mui/material/Grid';2import DescAccent from '../../../../components/ui/description/DescAccent';3import DescrBody from '../../../../components/ui/description/DescrBody';4import DescAccordion from '../../../../components/ui/description/DescAccordion';5import Example from '../../../../components/level7/Example';6function Description() {7  return (8    <Grid9      item10      sx={{11        width: '100%',12      }}13    >14      <DescAccordion title='Умножение на одиннадÑаÑÑ'>15        <DescrBody>16          ÐÑновнÑе пÑавила ÑÐ¼Ð½Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð½Ð° 11 заклÑÑаÑÑÑÑ Ð² ÑледÑÑÑем:17        </DescrBody>18        <DescAccent align='left'>19          1. ÐоÑледнÑÑ ÑиÑÑа множимого (ÑиÑло, коÑоÑое ÑмножаеÑÑÑ) запиÑÑваеÑÑÑ20          как ÑÐ°Ð¼Ð°Ñ Ð¿ÑÐ°Ð²Ð°Ñ ÑиÑÑа ÑезÑлÑÑаÑа,21        </DescAccent>22        <DescAccent align='left'>23          2. ÐÐ°Ð¶Ð´Ð°Ñ ÑледÑÑÑÐ°Ñ ÑиÑÑа множимого ÑкладÑваеÑÑÑ Ñо Ñвоим пÑавÑм24          ÑоÑедом и запиÑÑваеÑÑÑ Ð² ÑезÑлÑÑаÑ.25        </DescAccent>26        <DescAccent align='left'>27          3. ÐеÑÐ²Ð°Ñ ÑиÑÑа множимого ÑÑановиÑÑÑ Ñамой левой ÑиÑÂÑой ÑезÑлÑÑаÑа.28          ÐÑо поÑледний Ñаг.29        </DescAccent>30        <Example31          listNumbersLeft={[32            { digit: 6, isStar: false, isDot: false },33            { digit: 3, isStar: false, isDot: false },34            { digit: 3, isStar: false, isDot: false },35          ]}36          numberRight='11'37          listNumbersResult={[]}38          comment=''39        />40        <DescrBody>41          ÐÑÐ²ÐµÑ Ð¿Ð¸ÑеÑÑÑ Ð¿Ð¾Ð´ 633, по одной ÑиÑÑе ÑпÑава налево, как ÑкаÂзано в42          пÑавилаÑ
. ÐвездоÑки над множимÑм в наÑем пÑимеÑе покаÂзÑваÑÑ ÑиÑÑÑ,43          иÑполÑзÑемÑе в каждом Ñаге пÑи ÑеÑении пÑимеÂÑа. ÐÑиÑÑÑпим к ÑеÑениÑ44          пÑимеÑа.45        </DescrBody>46        <DescAccent>ÐеÑвое пÑавило:</DescAccent>47        <DescrBody>48          ÐапиÑиÑе поÑледнÑÑ ÑиÑÑÑ ÑиÑла 633 в каÑеÑÑве пÑавой ÑиÑÂÑÑ49          ÑезÑлÑÑаÑа;50        </DescrBody>51        <Example52          listNumbersLeft={[53            { digit: 6, isStar: false, isDot: false },54            { digit: 3, isStar: false, isDot: false },55            { digit: 3, isStar: true, isDot: false },56          ]}57          numberRight='11'58          listNumbersResult={[{ digit: 3, isStar: false, isDot: false }]}59          comment=''60        />61        <DescAccent>ÐÑоÑое пÑавило:</DescAccent>62        <DescrBody>63          ÐÐ°Ð¶Ð´Ð°Ñ Ð¿Ð¾ÑледÑÑÑÐ°Ñ ÑиÑÑа ÑиÑла 633 ÑкладÑваеÑÑÑ Ñо Ñвоим пÑавÑм64          ÑоÑедом и запиÑÑваеÑÑÑ Ð² ÑезÑлÑÑаÑ. 3 + 3, бÑÐ´ÐµÑ 6. ÐеÑед 3 запиÑÑваем65          в ÑезÑлÑÑаÑе 6:66        </DescrBody>67        <Example68          listNumbersLeft={[69            { digit: 6, isStar: false, isDot: false },70            { digit: 3, isStar: true, isDot: false },71            { digit: 3, isStar: true, isDot: false },72          ]}73          numberRight='11'74          listNumbersResult={[75            { digit: 6, isStar: false, isDot: false },76            { digit: 3, isStar: false, isDot: false },77          ]}78          comment=''79        />80        <DescrBody>81          ÐÑименим пÑавило еÑе Ñаз:6 + 3 бÑÐ´ÐµÑ 9. ÐапиÑÑваем и ÑÑÑ ÑиÑÑÑ Ð²82          ÑезÑлÑÑаÑе:83        </DescrBody>84        <Example85          listNumbersLeft={[86            { digit: 6, isStar: true, isDot: false },87            { digit: 3, isStar: true, isDot: false },88            { digit: 3, isStar: false, isDot: false },89          ]}90          numberRight='11'91          listNumbersResult={[92            { digit: 9, isStar: false, isDot: false },93            { digit: 6, isStar: false, isDot: false },94            { digit: 3, isStar: false, isDot: false },95          ]}96          comment=''97        />98        <DescAccent>ТÑеÑÑе пÑавило</DescAccent>99        <DescrBody>100          ÐеÑÐ²Ð°Ñ ÑиÑÑа ÑиÑла 633, Ñ. е. 6, ÑÑановиÑÑÑ Ð»ÐµÐ²Ð¾Ð¹ ÑиÑÑой ÑезÑлÑÑаÑа;101        </DescrBody>102        <Example103          listNumbersLeft={[104            { digit: 6, isStar: true, isDot: false },105            { digit: 3, isStar: false, isDot: false },106            { digit: 3, isStar: false, isDot: false },107          ]}108          numberRight='11'109          listNumbersResult={[110            { digit: 6, isStar: false, isDot: false },111            { digit: 9, isStar: false, isDot: false },112            { digit: 6, isStar: false, isDot: false },113            { digit: 3, isStar: false, isDot: false },114          ]}115          comment=''116        />117        <DescAccent align='left'>ÐÑвеÑ: 6963.</DescAccent>118        <DescrBody>119          ÐолÑÑие ÑиÑла обÑабаÑÑваÑÑÑÑ Ñаким же ÑпоÑобом. ÐÑоÑое пÑавило120          (Â«ÐºÐ°Ð¶Ð´Ð°Ñ Ð¿Ð¾ÑледÑÑÑÐ°Ñ ÑиÑÑа множимого ÑкладÑваеÑÑÑ Ñо Ñвоим пÑавÑм121          ÑоÑедом») в наÑем пÑимеÑе пÑименено дваждÑ; пÑи болÑÑиÑ
 ÑиÑлаÑ
 ÑÑо122          пÑавило Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ñименено многокÑаÑно.РаÑÑмоÑÑим Ñакой пÑимеÑ: 721123          324 ÑмножиÑÑ Ð½Ð° 11:124        </DescrBody>125        <Example126          listNumbersLeft={[127            { digit: 7, isStar: false, isDot: false },128            { digit: 2, isStar: false, isDot: false },129            { digit: 1, isStar: false, isDot: false },130            { digit: 3, isStar: false, isDot: false },131            { digit: 2, isStar: false, isDot: false },132            { digit: 4, isStar: false, isDot: false },133          ]}134          numberRight='11'135          listNumbersResult={[]}136          comment=''137        />138        <DescAccent align='center'>ÐеÑвое пÑавило:</DescAccent>139        <DescrBody>140          ÐоÑледнÑÑ ÑиÑÑа множимого 721 324 пиÑеÑÑÑ Ð² каÑеÑÑве пÑавой ÑиÑÑÑ141          ÑезÑлÑÑаÑа'142        </DescrBody>143        <Example144          listNumbersLeft={[145            { digit: 7, isStar: false, isDot: false },146            { digit: 2, isStar: false, isDot: false },147            { digit: 1, isStar: false, isDot: false },148            { digit: 3, isStar: false, isDot: false },149            { digit: 2, isStar: false, isDot: false },150            { digit: 4, isStar: true, isDot: false },151          ]}152          numberRight='11'153          listNumbersResult={[{ digit: 4, isStar: false, isDot: false }]}154          comment=''155        />156        <DescAccent align='center'>ÐÑоÑое пÑавило:</DescAccent>157        <DescrBody>158          ÐÐ°Ð¶Ð´Ð°Ñ Ð¿Ð¾ÑледÑÑÑÐ°Ñ ÑиÑÑа ÑиÑла 721 324 ÑкладÑваеÑÑÑ Ñо Ñвоим ÑоÑедом159          ÑпÑава и запиÑÑваеÑÑÑ Ð² ÑезÑлÑÑаÑ. ÐÑименим ÑÑо пÑавило пÑÑÑ Ñаз:160        </DescrBody>161        <Example162          listNumbersLeft={[163            { digit: 7, isStar: false, isDot: false },164            { digit: 2, isStar: false, isDot: false },165            { digit: 1, isStar: false, isDot: false },166            { digit: 3, isStar: false, isDot: false },167            { digit: 2, isStar: true, isDot: false },168            { digit: 4, isStar: true, isDot: false },169          ]}170          numberRight='11'171          listNumbersResult={[172            { digit: 6, isStar: false, isDot: false },173            { digit: 4, isStar: false, isDot: false },174          ]}175          comment='2 плÑÑ 4, бÑÐ´ÐµÑ 6.'176        />177        <Example178          listNumbersLeft={[179            { digit: 7, isStar: false, isDot: false },180            { digit: 2, isStar: false, isDot: false },181            { digit: 1, isStar: false, isDot: false },182            { digit: 3, isStar: true, isDot: false },183            { digit: 2, isStar: true, isDot: false },184            { digit: 4, isStar: false, isDot: false },185          ]}186          numberRight='11'187          listNumbersResult={[188            { digit: 5, isStar: false, isDot: false },189            { digit: 6, isStar: false, isDot: false },190            { digit: 4, isStar: false, isDot: false },191          ]}192          comment='3 плÑÑ 2, бÑÐ´ÐµÑ 5.'193        />194        <Example195          listNumbersLeft={[196            { digit: 7, isStar: false, isDot: false },197            { digit: 2, isStar: false, isDot: false },198            { digit: 1, isStar: true, isDot: false },199            { digit: 3, isStar: true, isDot: false },200            { digit: 2, isStar: false, isDot: false },201            { digit: 4, isStar: false, isDot: false },202          ]}203          numberRight='11'204          listNumbersResult={[205            { digit: 4, isStar: false, isDot: false },206            { digit: 5, isStar: false, isDot: false },207            { digit: 6, isStar: false, isDot: false },208            { digit: 4, isStar: false, isDot: false },209          ]}210          comment='1 плÑÑ 3, бÑÐ´ÐµÑ 4.'211        />212        <Example213          listNumbersLeft={[214            { digit: 7, isStar: false, isDot: false },215            { digit: 2, isStar: true, isDot: false },216            { digit: 1, isStar: true, isDot: false },217            { digit: 3, isStar: false, isDot: false },218            { digit: 2, isStar: false, isDot: false },219            { digit: 4, isStar: false, isDot: false },220          ]}221          numberRight='11'222          listNumbersResult={[223            { digit: 3, isStar: false, isDot: false },224            { digit: 4, isStar: false, isDot: false },225            { digit: 5, isStar: false, isDot: false },226            { digit: 6, isStar: false, isDot: false },227            { digit: 4, isStar: false, isDot: false },228          ]}229          comment='2 плÑÑ 1, бÑÐ´ÐµÑ 3.'230        />231        <Example232          listNumbersLeft={[233            { digit: 7, isStar: true, isDot: false },234            { digit: 2, isStar: true, isDot: false },235            { digit: 1, isStar: false, isDot: false },236            { digit: 3, isStar: false, isDot: false },237            { digit: 2, isStar: false, isDot: false },238            { digit: 4, isStar: false, isDot: false },239          ]}240          numberRight='11'241          listNumbersResult={[242            { digit: 9, isStar: false, isDot: false },243            { digit: 3, isStar: false, isDot: false },244            { digit: 4, isStar: false, isDot: false },245            { digit: 5, isStar: false, isDot: false },246            { digit: 6, isStar: false, isDot: false },247            { digit: 4, isStar: false, isDot: false },248          ]}249          comment='7 плÑÑ 2, бÑÐ´ÐµÑ 9.'250        />251        <DescAccent align='center'>ТÑеÑÑе пÑавило:</DescAccent>252        <DescrBody>253          ÐеÑÐ²Ð°Ñ ÑиÑÑа ÑиÑла 721 324 ÑÑановиÑÑÑ Ð»ÐµÐ²Ð¾Ð¹ ÑиÑÑой ÑезÑлÑÑаÑа:254        </DescrBody>255        <Example256          listNumbersLeft={[257            { digit: 7, isStar: true, isDot: false },258            { digit: 2, isStar: false, isDot: false },259            { digit: 1, isStar: false, isDot: false },260            { digit: 3, isStar: false, isDot: false },261            { digit: 2, isStar: false, isDot: false },262            { digit: 4, isStar: false, isDot: false },263          ]}264          numberRight='11'265          listNumbersResult={[266            { digit: 7, isStar: false, isDot: false },267            { digit: 9, isStar: false, isDot: false },268            { digit: 3, isStar: false, isDot: false },269            { digit: 4, isStar: false, isDot: false },270            { digit: 5, isStar: false, isDot: false },271            { digit: 6, isStar: false, isDot: false },272            { digit: 4, isStar: false, isDot: false },273          ]}274          comment=''275        />276        <DescAccent align='left'>ÐÑвеÑ: 7 934 564.</DescAccent>277        <DescrBody>278          Ðак видиÑе, ÐºÐ°Ð¶Ð´Ð°Ñ ÑиÑÑа данного ÑиÑла иÑполÑзована дваждÑ. ÐеÑвÑй Ñаз279          она иÑполÑзована как «ÑиÑÑа», а в ÑледÑÑÑем Ñаге как «ÑоÑед». Ð280          пÑиведенном вÑÑе пÑимеÑе ÑиÑÑа 1 (во множимом) бÑла «ÑиÑÑой*, когда281          она дала 4 в ÑезÑлÑÑаÑе, но когда пÑи ÑледÑÑÑем Ñаге она ÑÑаÑÑвовала в282          обÑазовании 3, она бÑла «ÑоÑедом»:283        </DescrBody>284        <Example285          listNumbersLeft={[286            { digit: 7, isStar: false, isDot: false },287            { digit: 2, isStar: false, isDot: false },288            { digit: 1, isStar: true, isDot: false },289            { digit: 3, isStar: true, isDot: false },290            { digit: 2, isStar: false, isDot: false },291            { digit: 4, isStar: false, isDot: false },292          ]}293          numberRight='11'294          listNumbersResult={[295            { digit: 4, isStar: false, isDot: false },296            { digit: '_', isStar: false, isDot: false },297            { digit: '_', isStar: false, isDot: false },298            { digit: '_', isStar: false, isDot: false },299          ]}300          comment=''301        />302        <Example303          listNumbersLeft={[304            { digit: 7, isStar: false, isDot: false },305            { digit: 2, isStar: true, isDot: false },306            { digit: 1, isStar: true, isDot: false },307            { digit: 3, isStar: false, isDot: false },308            { digit: 2, isStar: false, isDot: false },309            { digit: 4, isStar: false, isDot: false },310          ]}311          numberRight='11'312          listNumbersResult={[313            { digit: 3, isStar: false, isDot: false },314            { digit: '_', isStar: false, isDot: false },315            { digit: '_', isStar: false, isDot: false },316            { digit: '_', isStar: false, isDot: false },317            { digit: '_', isStar: false, isDot: false },318          ]}319          comment=''320        />321        <DescrBody>322          ÐÑ Ð¼Ð¾Ð¶ÐµÐ¼ вмеÑÑо ÑÑеÑ
 пÑавил полÑзоваÑÑÑÑ ÑолÑко одним, а именно вÑоÑÑм323          â пÑавилом «пÑибавÑÑе ÑоÑеда», еÑли бÑдем пÑименÑÑÑ ÐµÐ³Ð¾ ÑледÑÑÑим324          обÑазом. СнаÑала Ð¼Ñ Ð´Ð¾Ð»Ð¶Ð½Ñ Ð¿ÐµÑед даннÑм ÑиÑлом напиÑаÑÑ Ð½ÑÐ»Ñ Ð¸Ð»Ð¸ по325          кÑайней меÑе пÑедÑÑавиÑÑ Ñебе, ÑÑо Ñам наÑ
одиÑÑÑ Ð½ÑлÑ. ÐаÑем мÑ326          пÑименÑем Ð¸Ð´ÐµÑ Â«Ð¿ÑÐ¸Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ ÑоÑеда» пооÑеÑедно к каждой ÑиÑÑе данного327          ÑиÑла:328        </DescrBody>329        <Example330          listNumbersLeft={[331            { digit: 0, isStar: false, isDot: false },332            { digit: 6, isStar: false, isDot: false },333            { digit: 3, isStar: false, isDot: false },334            { digit: 3, isStar: true, isDot: false },335          ]}336          numberRight='11'337          listNumbersResult={[{ digit: 3, isStar: false, isDot: false }]}338          comment='«СоÑеда» неÑ, ÑледоваÑелÑно, Ð¼Ñ Ð½Ð¸Ñего не пÑибавлÑем.'339        />340        <Example341          listNumbersLeft={[342            { digit: 0, isStar: false, isDot: false },343            { digit: 6, isStar: false, isDot: false },344            { digit: 3, isStar: false, isDot: false },345            { digit: 3, isStar: false, isDot: false },346          ]}347          numberRight='11'348          listNumbersResult={[349            { digit: 9, isStar: false, isDot: false },350            { digit: 6, isStar: false, isDot: false },351            { digit: 3, isStar: false, isDot: false },352          ]}353          comment='Ðак Ñанее.'354        />355        <Example356          listNumbersLeft={[357            { digit: 0, isStar: true, isDot: false },358            { digit: 6, isStar: true, isDot: false },359            { digit: 3, isStar: false, isDot: false },360            { digit: 3, isStar: false, isDot: false },361          ]}362          numberRight='11'363          listNumbersResult={[364            { digit: 6, isStar: false, isDot: false },365            { digit: 9, isStar: false, isDot: false },366            { digit: 6, isStar: false, isDot: false },367            { digit: 3, isStar: false, isDot: false },368          ]}369          comment='ÐÑÐ»Ñ Ð¿Ð»ÑÑ 6, бÑÐ´ÐµÑ 6.'370        />371        <DescrBody>372          ÐÑÐ¾Ñ Ð¿ÑÐ¸Ð¼ÐµÑ Ð¿Ð¾ÐºÐ°Ð·ÑваеÑ, Ð´Ð»Ñ Ñего нам нÑжен нÑÐ»Ñ Ð¿ÐµÑед множимÑм. Ðн373          должен нам напоминаÑÑ Ð¾ Ñом, ÑÑо дейÑÑвие еÑе не законÑено. Ðез нÑÐ»Ñ Ð²374          наÑале ÑиÑла Ð¼Ñ Ð¼Ð¾Ð³Ð»Ð¸ Ð±Ñ Ð·Ð°Ð±ÑÑÑ Ð½Ð°Ð¿Ð¸ÑаÑÑ Ð¿Ð¾ÑледнÑÑ ÑиÑÑÑ Ð¸ дÑмаÑÑ, ÑÑо375          оÑÐ²ÐµÑ Ñавен ÑолÑко 963. ÐÑÐ²ÐµÑ Ð´Ð»Ð¸Ð½Ð½ÐµÐµ данного ÑиÑла на Ð¾Ð´Ð½Ñ ÑиÑÑÑ, и376          нÑÐ»Ñ Ð² наÑале ÑказÑÐ²Ð°ÐµÑ Ð½Ð° ÑÑо.377        </DescrBody>378        <DescrBody>379          Ðногда пÑи Ñложении ÑиÑла Ñ ÐµÐ³Ð¾ «ÑоÑедом» в оÑвеÑе полÑÑаеÑÑÑ ÑиÑло,380          ÑоÑÑоÑÑее из двÑÑ
 ÑиÑÑ, Ñак, 5 и 8 даÑÑ 13. Ð ÑÑом ÑлÑÑае Ð²Ñ Ð¿Ð¸ÑеÑе 3381          и, как обÑÑно, «пеÑеноÑиÑе» 1. Ðднако, пÑименÑÑ Ð¼ÐµÑод ТÑаÑ
ÑеÑбеÑга,382          вам никогда не пÑидеÑÑÑ Ð¿ÐµÑеноÑиÑÑ ÑиÑел, болÑÑиÑ
, Ñем 2. ÐÑо оÑенÑ383          облегÑÐ°ÐµÑ ÑеÑение ÑложнÑÑ
 задаÑ. (ÐÑи пеÑеноÑе единиÑÑ Ð´Ð¾ÑÑаÑоÑно384          поÑÑавиÑÑ ÑоÑкÑ, в ÑеÑ
 ÑедкиÑ
 ÑлÑÑаÑÑ
, когда пеÑеноÑиÑÑÑ Ð´Ð²Ð¾Ð¹ÐºÐ°, â две385          ÑоÑки.)386        </DescrBody>387        <Example388          listNumbersLeft={[389            { digit: 0, isStar: false, isDot: false },390            { digit: 1, isStar: false, isDot: false },391            { digit: 7, isStar: false, isDot: false },392            { digit: 5, isStar: false, isDot: false },393            { digit: 4, isStar: false, isDot: false },394          ]}395          numberRight='11'396          listNumbersResult={[397            { digit: 1, isStar: false, isDot: false },398            { digit: 9, isStar: false, isDot: false },399            { digit: 2, isStar: false, isDot: true },400            { digit: 9, isStar: false, isDot: false },401            { digit: 4, isStar: false, isDot: false },402          ]}403          comment='2âÑÑо 12 Ð¾Ñ ÑÐ»Ð¾Ð¶ÐµÐ½Ð¸Ñ 7 и 5.'404        />405        <DescrBody>406          Ð Ñом ÑлÑÑае, когда в длинном ÑиÑле, наÑинаÑÑемÑÑ Ñ ÑиÑÑÑ 9, ÑледÑÑÑаÑ407          ÑиÑÑа Ñакже велика, Ñкажем 8, как в ÑиÑле 98 834, Ð¼Ñ Ð¼Ð¾Ð¶ÐµÐ¼ пÑи408          поÑледнем Ñаге полÑÑиÑÑ 10. ÐапÑимеÑ:409        </DescrBody>410        <Example411          listNumbersLeft={[412            { digit: 9, isStar: false, isDot: false },413            { digit: 8, isStar: false, isDot: false },414            { digit: 8, isStar: false, isDot: false },415            { digit: 3, isStar: false, isDot: false },416            { digit: 4, isStar: false, isDot: false },417          ]}418          numberRight='11'419          listNumbersResult={[420            { digit: 1, isStar: false, isDot: false },421            { digit: 0, isStar: false, isDot: false },422            { digit: 8, isStar: false, isDot: true },423            { digit: 7, isStar: false, isDot: true },424            { digit: 1, isStar: false, isDot: true },425            { digit: 7, isStar: false, isDot: false },426            { digit: 4, isStar: false, isDot: false },427          ]}428          comment=''429        />430      </DescAccordion>431    </Grid>432  );433}...mail-service.js
Source:mail-service.js  
1import { utilService } from '../../../services/util-service.js';2import { storageService } from '../../../services/async-storage-service.js';3const MAILS_KEY = 'mails';4const gMails = [5    {6        id: 'e101',7        name: 'Yaron Biton',8        subject: 'Sprint3 review',9        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',10        isRead: true,11        sentAt: getDate(1622234930594),12        to: 'yaronB@ca.com',13        isStar: true,14        isSent: false,15        isDraft: false16    },17    {18        id: 'e102',19        name: 'Matan Crispel',20        subject: 'Dropbox!!!',21        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",22        isRead: true,23        sentAt: getDate(1620234930594),24        to: 'matanB@ca.com',25        isStar: false,26        isSent: false,27        isDraft: false28    },29    {30        id: 'e103',31        name: 'Adina Zwebner',32        subject: 'Sprint3 update',33        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",34        isRead: false,35        sentAt: getDate(1618234930594),36        to: 'adinaZ@ca.com',37        isStar: false,38        isSent: true,39        isDraft: false40    },41    {42        id: 'e104',43        name: 'Ori Shemla',44        subject: 'Data is a function that ',45        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',46        isRead: true,47        sentAt: getDate(1616234930594),48        to: 'oriSH@ca.com',49        isSent: false,50        isStar: false,51        isDraft: false52    },53    {54        id: 'e105',55        name: 'Yaron Biton',56        subject: 'Sprint3 review',57        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',58        isRead: false,59        sentAt: getDate(1614234930594),60        to: 'yaronB@ca.com',61        isSent: false,62        isStar: true,63        isDraft: false64    },65    {66        id: 'e106',67        name: 'Matan Crispel',68        subject: 'Dropbox!!!',69        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",70        isRead: true,71        sentAt: getDate(1612234930594),72        to: 'matanB@ca.com',73        isSent: false,74        isStar: false,75        isDraft: false76    },77    {78        id: 'e107',79        name: 'Adina Zwebner',80        subject: 'Sprint3 update',81        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",82        isRead: false,83        sentAt: getDate(1610234930594),84        to: 'adinaZ@ca.com',85        isSent: true,86        isStar: true,87        isDraft: false88    },89    {90        id: 'e108',91        name: 'Ori Shemla',92        subject: 'Data is a function that ',93        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',94        isRead: true,95        sentAt: getDate(1604133930594),96        to: 'oriSH@ca.com',97        isSent: false,98        isStar: true,99        isDraft: false100    },101    {102        id: 'e109',103        name: 'Yaron Biton',104        subject: 'Sprint3 review',105        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',106        isRead: false,107        sentAt: getDate(1598133930594),108        to: 'yaronB@ca.com',109        isSent: true,110        isStar: true,111        isDraft: false112    },113    {114        id: 'e110',115        name: 'Matan Crispel',116        subject: 'Dropbox!!!',117        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",118        isRead: true,119        sentAt: getDate(1594133930594),120        to: 'matanB@ca.com',121        isSent: false,122        isStar: false,123        isDraft: false124    },125    {126        id: 'e111',127        name: 'Adina Zwebner',128        subject: 'Sprint3 update',129        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",130        isRead: false,131        sentAt: getDate(1589133930594),132        to: 'adinaZ@ca.com',133        isSent: false,134        isStar: false,135        isDraft: false136    },137    {138        id: 'e112',139        name: 'Ori Shemla',140        subject: 'Data is a function that ',141        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',142        isRead: true,143        sentAt: getDate(1579133930594),144        to: 'oriSH@ca.com',145        isSent: false,146        isStar: true,147        isDraft: false148    },149    {150        id: 'e113',151        name: 'Yaron Biton',152        subject: 'Sprint3 review',153        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',154        isRead: false,155        sentAt: getDate(1569133930594),156        to: 'yaronB@ca.com',157        isSent: false,158        isStar: false,159        isDraft: false160    },161    {162        id: 'e114',163        name: 'Matan Crispel',164        subject: 'Dropbox!!!',165        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",166        isRead: true,167        sentAt: getDate(1559133930594),168        to: 'matanB@ca.com',169        isSent: false,170        isStar: false,171        isDraft: false172    },173    {174        id: 'e115',175        name: 'Adina Zwebner',176        subject: 'Sprint3 update',177        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",178        isRead: false,179        sentAt: getDate(1556133930594),180        to: 'adinaZ@ca.com',181        isSent: false,182        isStar: false,183        isDraft: false184    },185    {186        id: 'e116',187        name: 'Ori Shemla',188        subject: 'Data is a function that ',189        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',190        isRead: true,191        sentAt: getDate(1553133930594),192        to: 'oriSH@ca.com',193        isSent: false,194        isStar: false,195        isDraft: false196    },197        {198        id: 'e117',199        name: 'Yaron Biton',200        subject: 'Sprint3 review',201        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',202        isRead: true,203        sentAt: getDate(1553133930594),204        to: 'yaronB@ca.com',205        isSent: false,206        isStar: true,207        isDraft: false208    },209    {210        id: 'e118',211        name: 'Matan Crispel',212        subject: 'Dropbox!!!',213        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",214        isRead: true,215        sentAt: getDate(1553133930594),216        to: 'matanB@ca.com',217        isSent: false,218        isStar: false,219        isDraft: false220    },221    {222        id: 'e119',223        name: 'Adina Zwebner',224        subject: 'Sprint3 update',225        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",226        isRead: false,227        sentAt: getDate(1551133930594),228        to: 'adinaZ@ca.com',229        isSent: false,230        isStar: false,231        isDraft: false232    },233    {234        id: 'e120',235        name: 'Ori Shemla',236        subject: 'Data is a function that ',237        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',238        isRead: true,239        sentAt: getDate(1551133930594),240        to: 'oriSH@ca.com',241        isSent: false,242        isStar: false,243        isDraft: false244    },245    {246        id: 'e121',247        name: 'Yaron Biton',248        subject: 'Sprint3 review',249        body: 'Hi Revital and Yaniv, i have been review your sprint 3 and i hope that Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ',250        isRead: false,251        sentAt: getDate(1551133930594),252        to: 'yaronB@ca.com',253        isSent: false,254        isStar: false,255        isDraft: false256    },257    {258        id: 'e122',259        name: 'Matan Crispel',260        subject: 'Dropbox!!!',261        body: "Hi, don't forget DO NOT COPY YOUR GIT FOLDER TO THE DROPBOX Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius. ",262        isRead: true,263        sentAt: getDate(1551133930594),264        to: 'matanB@ca.com',265        isSent: false,266        isStar: false,267        isDraft: false268    },269    {270        id: 'e123',271        name: 'Adina Zwebner',272        subject: 'Sprint3 update',273        body: "Hi Revital and Yaniv, Please don't forget at 21:00 today a zoom meating and Lorem ipsum, dolor sit amet consectetur adipisicing elit.Quae quod, id fugit quibusdam doloremque maiores harum tempora ipsam consectetur eos nobis quos totam corrupti laborum eligendi! Voluptate praesentium iste eius.",274        isRead: false,275        sentAt: getDate(1551133930594),276        to: 'adinaZ@ca.com',277        isSent: false,278        isStar: false,279        isDraft: false280    },281    {282        id: 'e124',283        name: 'Ori Shemla',284        subject: 'Data is a function that ',285        body: 'Hi Did you know that Data is a function that return an object ? or that Data is a function that return an object ? and also that Data is a function that return an object ?',286        isRead: true,287        sentAt: getDate(1551133930594),288        to: 'oriSH@ca.com',289        isSent: false,290        isStar: false,291        isDraft: false292    },293];294const loggedinUser = { email: 'user@appsus.com', fullname: 'Mahatma Appsus' };295_createmails();296export const mailService = {297    query,298    remove,299    save,300    getEmptyMail,301    getById,302    read,303    star,304    unReadToRead,305    classObject,306};307function classObject() {308    return 'envelop-close'309}310function query() {311    return storageService.query(MAILS_KEY);312}313function remove(mailId) {314    return storageService.remove(MAILS_KEY, mailId);315}316function save(mail) {317    if (mail.id) return storageService.put(MAILS_KEY, mail);318    else return storageService.post(MAILS_KEY, mail);319}320function read(mail) {321    mail.isRead = !mail.isRead;322    return storageService.put(MAILS_KEY, mail);323}324function star(mail) {325    mail.isStar = !mail.isStar;326    return storageService.put(MAILS_KEY, mail);327}328function unReadToRead(mail) {329    if (!mail.isRead) mail.isRead = true;330    return storageService.put(MAILS_KEY, mail);331}332function getEmptyMail() {333    return {334        id: '',335        subject: '',336        body: '',337        isRead: false,338        name: 'Yaniv Richman',339        sentAt: getCurentDate(),340        isStar: false,341        isSent: true,342        isDraft: false343    };344}345function getById(mailId) {346    console.log('here getById');347    return storageService.get(MAILS_KEY, mailId);348}349function _createmails() {350    let mails = utilService.loadFromStorage(MAILS_KEY);351    if (!mails || !mails.length) {352        mails = gMails;353        utilService.saveToStorage(MAILS_KEY, mails);354    }355    return mails;356}357// function _createMail(subject, body) {358//     const mail = {359//         id: utilService.makeId(),360//         subject,361//         body,362//     };363//     return mail;364// }365function getDate(time) {366    const day = new Date(time).getDate();367    const month = parseInt(new Date(time).getMonth()) + 1;368    const year = new Date(time).getFullYear();369    if (year < 2021) {370        var fullDate = day + '/' + month + '/' + year;371    } else {372        const monthNames = [373            'Jan',374            'Feb',375            'Mar',376            'Apr',377            'May',378            'Jun',379            'Jul',380            'Aug',381            'Sep',382            'Oct',383            'Nov',384            'Dec',385        ];386        const monthStr = monthNames[month];387        var fullDate = monthStr + ',' + day;388    }389    return fullDate;390}391function getCurentDate() {392    const currTime = new Date().toLocaleString('en-US', {393        hour: 'numeric',394        minute: 'numeric',395        hour12: true,396    });397    return currTime;...Description1.jsx
Source:Description1.jsx  
1import DescAccent from '../../../../components/ui/description/DescAccent';2import DescrBody from '../../../../components/ui/description/DescrBody';3import DescAccordion from '../../../../components/ui/description/DescAccordion';4import Grid from '@mui/material/Grid';5import Example from '../../../../components/level7/Example';6function Description() {7  return (8    <Grid9      item10      sx={{11        width: '100%',12      }}13    >14      <DescAccordion title='Ðведение'>15        <DescAccent>Умножение на ÑеÑÑÑе</DescAccent>16        <DescrBody>17          ÐолÑÑинÑÑво лÑдей, обладаÑÑиÑ
 даже ÑамÑми ÑкÑомнÑми маÑемаÑиÑеÑкими18          знаниÑми, ÑовеÑÑенно ÑвеÑÐµÐ½Ñ Ð² Ñом, ÑÑо ÑмеÑÑ ÑмножаÑÑ Ð½Ð° 4. Ðо мÑ19          вÑе-Ñаки ÑейÑÐ°Ñ Ñокажем, как ÑÑо делаеÑÑÑ Ð¿Ñи помоÑи ÑпоÑоба,20          аналогиÑного Ñем, коÑоÑÑе ÐÑ ÑаÑÑмаÑÑивали вÑÑе.21        </DescrBody>22        <DescrBody>ÐолноÑÑÑÑ Ð¿Ñавила ÑаковÑ:</DescrBody>23        <DescAccent align='left'>24          1. ÐÑÑÑиÑе ÑамÑÑ Ð¿ÑавÑÑ ÑиÑÑÑ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ ÑиÑла из 10 и пÑибавÑÑе 5, еÑли25          ÑиÑÑа неÑеÑнаÑ.26        </DescAccent>27        <DescAccent align='left'>28          2. ÐÑÑÑиÑе пооÑеÑедно каждÑÑ ÑиÑÑÑ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ ÑиÑла из 9, пÑибавÑÑе 5,29          еÑли ÑиÑÑа неÑеÑнаÑ, и пÑибавÑÑе Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ñ ÑоÑеда.30        </DescAccent>31        <DescAccent align='left'>32          3. ÐапиÑиÑе под нÑлем пеÑед заданнÑм ÑиÑлом Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ñ ÑоÑеда ÑÑого нÑлÑ33          минÑÑ 1.34        </DescAccent>35        <DescrBody>ÐÑÐ¸Ð¼ÐµÑ 1. 20 684 ÑмножиÑÑ Ð½Ð° 4.</DescrBody>36        <DescAccent>ÐеÑвÑй Ñаг.</DescAccent>37        <Example38          listNumbersLeft={[39            { digit: 0, isStar: false, isDot: false },40            { digit: 2, isStar: false, isDot: false },41            { digit: 0, isStar: false, isDot: false },42            { digit: 6, isStar: false, isDot: false },43            { digit: 8, isStar: false, isDot: false },44            { digit: 4, isStar: true, isDot: false },45          ]}46          numberRight='4'47          listNumbersResult={[{ digit: 6, isStar: false, isDot: false }]}48          comment='ЦиÑÑÑ 4 вÑÑÑиÑе из 10:'49        />50        <DescAccent>ÐÑоÑой Ñаг.</DescAccent>51        <Example52          listNumbersLeft={[53            { digit: 0, isStar: false, isDot: false },54            { digit: 2, isStar: false, isDot: false },55            { digit: 0, isStar: false, isDot: false },56            { digit: 6, isStar: false, isDot: false },57            { digit: 8, isStar: true, isDot: false },58            { digit: 4, isStar: true, isDot: false },59          ]}60          numberRight='4'61          listNumbersResult={[62            { digit: 3, isStar: false, isDot: false },63            { digit: 6, isStar: false, isDot: false },64          ]}65          comment='3 â ÑÑо 9 минÑÑ 8 плÑÑ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¾Ñ 4.'66        />67        <DescAccent>ТÑеÑий Ñаг.</DescAccent>68        <Example69          listNumbersLeft={[70            { digit: 0, isStar: false, isDot: false },71            { digit: 2, isStar: false, isDot: false },72            { digit: 0, isStar: false, isDot: false },73            { digit: 6, isStar: true, isDot: false },74            { digit: 8, isStar: true, isDot: false },75            { digit: 4, isStar: false, isDot: false },76          ]}77          numberRight='4'78          listNumbersResult={[79            { digit: 7, isStar: false, isDot: false },80            { digit: 3, isStar: false, isDot: false },81            { digit: 6, isStar: false, isDot: false },82          ]}83          comment='7 â ÑÑо 9 минÑÑ 6 плÑÑ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¾Ñ 8.'84        />85        <DescAccent>ЧеÑвеÑÑÑй Ñаг.</DescAccent>86        <Example87          listNumbersLeft={[88            { digit: 0, isStar: false, isDot: false },89            { digit: 2, isStar: false, isDot: false },90            { digit: 0, isStar: true, isDot: false },91            { digit: 6, isStar: true, isDot: false },92            { digit: 8, isStar: false, isDot: false },93            { digit: 4, isStar: false, isDot: false },94          ]}95          numberRight='4'96          listNumbersResult={[97            { digit: 2, isStar: false, isDot: true },98            { digit: 7, isStar: false, isDot: false },99            { digit: 3, isStar: false, isDot: false },100            { digit: 6, isStar: false, isDot: false },101          ]}102          comment='2 â ÑÑо 9 минÑÑ Ð½ÑÐ»Ñ Ð¿Ð»ÑÑ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¾Ñ 6.'103        />104        <DescAccent>ÐÑÑÑй Ñаг.</DescAccent>105        <Example106          listNumbersLeft={[107            { digit: 0, isStar: false, isDot: false },108            { digit: 2, isStar: true, isDot: false },109            { digit: 0, isStar: true, isDot: false },110            { digit: 6, isStar: false, isDot: false },111            { digit: 8, isStar: false, isDot: false },112            { digit: 4, isStar: false, isDot: false },113          ]}114          numberRight='4'115          listNumbersResult={[116            { digit: 8, isStar: false, isDot: false },117            { digit: 2, isStar: false, isDot: true },118            { digit: 7, isStar: false, isDot: false },119            { digit: 3, isStar: false, isDot: false },120            { digit: 6, isStar: false, isDot: false },121          ]}122          comment='8 â ÑÑо 9 минÑÑ 2 плÑÑ ÑоÑка.'123        />124        <DescAccent>ÐоÑледний Ñаг.</DescAccent>125        <Example126          listNumbersLeft={[127            { digit: 0, isStar: true, isDot: false },128            { digit: 2, isStar: true, isDot: false },129            { digit: 0, isStar: false, isDot: false },130            { digit: 6, isStar: false, isDot: false },131            { digit: 8, isStar: false, isDot: false },132            { digit: 4, isStar: false, isDot: false },133          ]}134          numberRight='4'135          listNumbersResult={[136            { digit: 0, isStar: false, isDot: false },137            { digit: 8, isStar: false, isDot: false },138            { digit: 2, isStar: false, isDot: true },139            { digit: 7, isStar: false, isDot: false },140            { digit: 3, isStar: false, isDot: false },141            { digit: 6, isStar: false, isDot: false },142          ]}143          comment='ÐÑÐ»Ñ â ÑÑо половина Ð¾Ñ 2 минÑÑ 1'144        />145        <DescrBody>146          ÐÑÐ¸Ð¼ÐµÑ 2. РпÑимеÑе 1 не бÑло необÑ
одимоÑÑи пÑибавлÑÑÑ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸ÑелÑно147          5, Ñак как вÑе ÑиÑÑÑ ÑиÑла 20 684 ÑеÑнÑе. ÐÐ¾Ñ Ð¿ÑимеÑ, в коÑоÑом148          некоÑоÑÑе ÑиÑÑÑ Ð½ÐµÑеÑнÑе. УмножиÑÑ 365 187 на 4.149        </DescrBody>150        <DescAccent>ÐеÑвÑй Ñаг.</DescAccent>151        <Example152          listNumbersLeft={[153            { digit: 0, isStar: false, isDot: false },154            { digit: 3, isStar: false, isDot: false },155            { digit: 6, isStar: false, isDot: false },156            { digit: 5, isStar: false, isDot: false },157            { digit: 1, isStar: false, isDot: false },158            { digit: 8, isStar: false, isDot: false },159            { digit: 7, isStar: true, isDot: false },160          ]}161          numberRight='4'162          listNumbersResult={[{ digit: 8, isStar: false, isDot: false }]}163          comment='ÐÑ 10 оÑнÑÑÑ 7, бÑÐ´ÐµÑ 3, пÑибавим заÑем 5, Ñак как 7 неÑеÑно.'164        />165        <DescAccent>ÐÑоÑой Ñаг.</DescAccent>166        <Example167          listNumbersLeft={[168            { digit: 0, isStar: false, isDot: false },169            { digit: 3, isStar: false, isDot: false },170            { digit: 6, isStar: false, isDot: false },171            { digit: 5, isStar: false, isDot: false },172            { digit: 1, isStar: false, isDot: false },173            { digit: 8, isStar: true, isDot: false },174            { digit: 7, isStar: true, isDot: false },175          ]}176          numberRight='4'177          listNumbersResult={[178            { digit: 4, isStar: false, isDot: false },179            { digit: 8, isStar: false, isDot: false },180          ]}181          comment='ÐÑ 9 оÑнÑÑÑ 8 плÑÑ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¾Ñ 7.'182        />183        <DescAccent>ТÑеÑий Ñаг.</DescAccent>184        <Example185          listNumbersLeft={[186            { digit: 0, isStar: false, isDot: false },187            { digit: 3, isStar: false, isDot: false },188            { digit: 6, isStar: false, isDot: false },189            { digit: 5, isStar: false, isDot: false },190            { digit: 1, isStar: true, isDot: false },191            { digit: 8, isStar: true, isDot: false },192            { digit: 7, isStar: false, isDot: false },193          ]}194          numberRight='4'195          listNumbersResult={[196            { digit: 7, isStar: false, isDot: true },197            { digit: 4, isStar: false, isDot: false },198            { digit: 8, isStar: false, isDot: false },199          ]}200          comment='7 â ÑÑо 9 минÑÑ 1 плÑÑ 5 плÑÑ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¾Ñ 8.'201        />202        <DescrBody>203          <b>ЧеÑвеÑÑÑй, пÑÑÑй и ÑеÑÑой Ñаги</b>. ÐÑ Ð¿Ð¾Ð²ÑоÑÑем вÑоÑое пÑавило.204          ÐомниÑе о Ñом, ÑÑо ÑиÑÑÑ 3 и 5 неÑеÑнÑе и ÑÑебÑÑÑ Ð¿ÑÐ¸Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ 5:205        </DescrBody>206        <Example207          listNumbersLeft={[208            { digit: 0, isStar: false, isDot: false },209            { digit: 3, isStar: false, isDot: false },210            { digit: 6, isStar: false, isDot: false },211            { digit: 5, isStar: false, isDot: false },212            { digit: 1, isStar: false, isDot: false },213            { digit: 8, isStar: false, isDot: false },214            { digit: 7, isStar: false, isDot: false },215          ]}216          numberRight='4'217          listNumbersResult={[218            { digit: 4, isStar: false, isDot: true },219            { digit: 6, isStar: false, isDot: true },220            { digit: 0, isStar: false, isDot: true },221            { digit: 7, isStar: false, isDot: true },222            { digit: 4, isStar: false, isDot: false },223            { digit: 8, isStar: false, isDot: false },224          ]}225          comment=''226        />227        <DescAccent>ÐоÑледний Ñаг.</DescAccent>228        <Example229          listNumbersLeft={[230            { digit: 0, isStar: true, isDot: false },231            { digit: 3, isStar: true, isDot: false },232            { digit: 6, isStar: false, isDot: false },233            { digit: 5, isStar: false, isDot: false },234            { digit: 1, isStar: false, isDot: false },235            { digit: 8, isStar: false, isDot: false },236            { digit: 7, isStar: false, isDot: false },237          ]}238          numberRight='4'239          listNumbersResult={[240            { digit: 1, isStar: false, isDot: false },241            { digit: 4, isStar: false, isDot: true },242            { digit: 6, isStar: false, isDot: true },243            { digit: 0, isStar: false, isDot: true },244            { digit: 7, isStar: false, isDot: true },245            { digit: 4, isStar: false, isDot: false },246            { digit: 8, isStar: false, isDot: false },247          ]}248          comment='1 â ÑÑо «половина» Ð¾Ñ 3 минÑÑ 1 плÑÑ ÑоÑка.'249        />250        <DescrBody>251          ÐÐ»Ñ Ð·Ð°ÐºÑÐµÐ¿Ð»ÐµÐ½Ð¸Ñ ÑÑиÑ
 пÑавил ÑÑебÑеÑÑÑ ÐºÑда менÑÑе ÑпÑажнений, Ñем пÑи252          изÑÑении ÑаблиÑÑ ÑмножениÑ. СпÑÑÑÑ Ð½ÐµÑколÑко ÑаÑов вÑе опеÑаÑии253          кажÑÑÑÑ ÐµÑÑеÑÑвеннÑми и пÑоÑÑÑми.254        </DescrBody>255      </DescAccordion>256    </Grid>257  );258}...mailService.js
Source:mailService.js  
1import { utilService } from '/util-service.js'2import { storageService } from '/storage-service.js'3const _LOCAL_STORAGE_KEY = 'mails'4const time = new Date();5let mails = []6let mails2 = [7    { id: utilService.makeId(), sendBy: 'Itay Rosental', subject: 'Read It Now!', body: 'miss you so much', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },8    { id: utilService.makeId(), sendBy: 'Oren Yaniv', subject: 'Primary Messege', body: 'Please call me back ASAP!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: true },9    { id: utilService.makeId(), sendBy: 'Apple Servises', subject: 'IPhone 12', body: 'Iphone 12 Now on Sale! ', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },10    { id: utilService.makeId(), sendBy: 'Noa Cohen', subject: 'Working Instruction!', body: 'Please come on time at sunday morning! this is very importatnt for me!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },11    { id: utilService.makeId(), sendBy: 'Walla Shops', subject: 'New Products is on the Air!', body: 'Hey! alot of new products now at are web! lets Start!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },12    { id: utilService.makeId(), sendBy: 'Ebay', subject: 'Acount Noticed!', body: 'Your acount is gonna run out Please!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },13    { id: utilService.makeId(), sendBy: 'Facbook Costumer', subject: 'ShopieFY!', body: 'lets Shop! we waiting for you!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },14    { id: utilService.makeId(), sendBy: 'Youtube', subject: 'Youtube Priemiume is Ready!', body: 'Buy now! january discount is now ready for you!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },15    { id: utilService.makeId(), sendBy: 'Tel-Aviv-Streets', subject: 'Come Travel The City!', body: 'Tel Aviv City Is Now Waiting For You!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },16    { id: utilService.makeId(), sendBy: 'London Mails', subject: 'Oxford Streets Opened Again!', body: 'December Discount! Come To London Now!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },17    { id: utilService.makeId(), sendBy: 'Spotify', subject: 'New Music Are Now On Air', body: 'So many music are now open for you! lets dance!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },18    { id: utilService.makeId(), sendBy: 'Lex Traveller', subject: 'Januray SALE!', body: 'January sale! lets Do This!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },19    { id: utilService.makeId(), sendBy: 'Xiaomi', subject: 'REDMIE is now ON SALE!', body: 'Xiaoni redmy is on sale!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },20    { id: utilService.makeId(), sendBy: 'Samsung', subject: 'GALAXY S21', body: ' OUT OF STOCK!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },21    { id: utilService.makeId(), sendBy: 'Bose-Servcise', subject: 'NOSE NC 21', body: '2021 SALES are now !', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },22    { id: utilService.makeId(), sendBy: 'Jamaika-Lead', subject: 'Bob Marley Fans Party', body: 'Lets dance at friday Night!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },23    { id: utilService.makeId(), sendBy: 'Soda-Steam', subject: '2021 ON SALE!', body: 'Come and buy are new soda stream!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },24    { id: utilService.makeId(), sendBy: 'Coca-Cola', subject: 'StrawBerry Cola is now on SALE!', body: 'Try Are New Cola Taste! is amazing!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },25    { id: utilService.makeId(), sendBy: 'Wow-mails', subject: 'Are New Mail Box', body: 'New mail box is now on the air! come and try are servise!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false }, { id: utilService.makeId(), sendBy: 'Itay Rosental', subject: 'Read It Now!', body: 'miss you so much', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },26    { id: utilService.makeId(), sendBy: 'Oren Yaniv', subject: 'Primary Messege', body: 'Please call me back ASAP!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: true },27    { id: utilService.makeId(), sendBy: 'Apple Servises', subject: 'IPhone 12', body: 'Iphone 12 Now on Sale! ', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },28    { id: utilService.makeId(), sendBy: 'Noa Cohen', subject: 'Working Instruction!', body: 'Please come on time at sunday morning! this is very importatnt for me!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },29    { id: utilService.makeId(), sendBy: 'Walla Shops', subject: 'New Products is on the Air!', body: 'Hey! alot of new products now at are web! lets Start!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },30    { id: utilService.makeId(), sendBy: 'Ebay', subject: 'Acount Noticed!', body: 'Your acount is gonna run out Please!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },31    { id: utilService.makeId(), sendBy: 'Facbook Costumer', subject: 'ShopieFY!', body: 'lets Shop! we waiting for you!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },32    { id: utilService.makeId(), sendBy: 'Youtube', subject: 'Youtube Priemiume is Ready!', body: 'Buy now! january discount is now ready for you!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },33    { id: utilService.makeId(), sendBy: 'Tel-Aviv-Streets', subject: 'Come Travel The City!', body: 'Tel Aviv City Is Now Waiting For You!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: true },34    { id: utilService.makeId(), sendBy: 'London Mails', subject: 'Oxford Streets Opened Again!', body: 'December Discount! Come To London Now!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },35    { id: utilService.makeId(), sendBy: 'Spotify', subject: 'New Music Are Now On Air', body: 'So many music are now open for you! lets dance!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: false },36    { id: utilService.makeId(), sendBy: 'Lex Traveller', subject: 'Januray SALE!', body: 'January sale! lets Do This!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },37    { id: utilService.makeId(), sendBy: 'Xiaomi', subject: 'REDMIE is now ON SALE!', body: 'Xiaoni redmy is on sale!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: true },38    { id: utilService.makeId(), sendBy: 'Samsung', subject: 'GALAXY S21', body: ' OUT OF STOCK!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },39    { id: utilService.makeId(), sendBy: 'Bose-Servcise', subject: 'NOSE NC 21', body: '2021 SALES are now !', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },40    { id: utilService.makeId(), sendBy: 'Jamaika-Lead', subject: 'Bob Marley Fans Party', body: 'Lets dance at friday Night!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: true },41    { id: utilService.makeId(), sendBy: 'Soda-Steam', subject: '2021 ON SALE!', body: 'Come and buy are new soda stream!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },42    { id: utilService.makeId(), sendBy: 'Coca-Cola', subject: 'StrawBerry Cola is now on SALE!', body: 'Try Are New Cola Taste! is amazing!', isRead: true, sentAt: time.toLocaleString(), replays: [], isStar: true },43    { id: utilService.makeId(), sendBy: 'Wow-mails', subject: 'Are New Mail Box', body: 'New mail box is now on the air! come and try are servise!', isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false },44]45export const mailService = {46    mails,47    deleteEmail,48    isEmailRead,49    getMails,50    addMail,51    getMailById,52    addComment,53    addStar54}55// Load Mails If LocalSorage Is Clear56if (storageService.loadFromStorage(_LOCAL_STORAGE_KEY) === null) {57    storageService.saveToStorage(_LOCAL_STORAGE_KEY, mails2)58}59function getMails(filterBy) {60    if (filterBy) {61        var { text, readStatus } = filterBy62        const filteredMails = mails.filter(mail => {63            if (readStatus) {64                if (readStatus === 'read') {65                    return mail.isRead && mail.body.includes(text)66                } else if (readStatus === 'unread') {67                    return !mail.isRead && mail.body.includes(text)68                } else {69                    return mail && mail.body.includes(text)70                }71            }72        })73        return Promise.resolve(filteredMails)74    } else {75        mails = storageService.loadFromStorage(_LOCAL_STORAGE_KEY) || []76        return Promise.resolve(mails)77    }78}79function deleteEmail(emailId) {80    var emailIdx = mails.findIndex(function(mail) {81        return emailId === mail.id82    })83    mails.splice(emailIdx, 1)84    storageService.saveToStorage(_LOCAL_STORAGE_KEY, mails)85    return Promise.resolve()86}87function getMailById(emailId) {88    return mails.find(mail => mail.id === emailId)89}90function isEmailRead(emailId) {91    var emailIdx = mails.findIndex(function(mail) {92        return emailId === mail.id93    })94    mails[emailIdx].isRead = true95    storageService.saveToStorage(_LOCAL_STORAGE_KEY, mails)96    return Promise.resolve()97}98function addStar(emailId, star) {99    var mail = getMailById(emailId)100    mail.isStar = true101    storageService.saveToStorage(_LOCAL_STORAGE_KEY, mails)102}103function addComment(emailId, replay) {104    var mail = getMailById(emailId)105    mail.replays.push(replay)106    storageService.saveToStorage(_LOCAL_STORAGE_KEY, mails)107    return Promise.resolve()108}109function addMail(sendBy, subject, body) {110    getMails().then(mailsToSave => {111        mailsToSave.push({ id: utilService.makeId(), sendBy, subject, body, isRead: false, sentAt: time.toLocaleString(), replays: [], isStar: false })112        mails = mailsToSave113        storageService.saveToStorage(_LOCAL_STORAGE_KEY, mailsToSave)114    })115    return Promise.resolve()...email-service.js
Source:email-service.js  
1import {storage} from '../services/storage-service.js';2import {utils} from '../../../../js/services/util-service.js';3var gEmails = [4    {5        id:'em01',6        fromName:'google tech',7        from:'info@gmail.com',8        replies:['em02','em03'],9        subject: 'Security Wraning',10        body: 'Hey There, there was a suspicious activity in your linked google account',11        isRead: false,12        isNew:true,13        isSent: false,14        isDraft: false, 15        isStar:false,16        sentAt : 1604671749930,17    },18    {19        id:'em02',20        fromName:'goolge support',21        from:'info@gmail.com',22        replies:[],23        subject: 'Creadit card validation',24        body: 'Billing issue: please validate your cerdit card',25        isRead: false, 26        isNew:true,27        isSent: false, 28        isDraft: false,29        isStar:false,30        sentAt :1580821161 ,     31    },32    {33        id:'em03',34        fromName:'facebook',35        from:'info@facebook.com',36        replies:[],37        subject: 'Team Trump - voter suppression',38        body: 'Help stop voter suppression, irregularities and fraud!',39        isRead: false, 40        isNew:true,41        isSent: false, 42        isDraft: false,43        isStar:false,44        sentAt : 1604671749930,45    },46    {47        id:'em04',48        fromName:'twitter - Joe Rogan',49        from:'info@twitter.com',50        replies:[],51        subject: 'One of my absolute favorite guests and people, the great and powerful @stevenrinella.',52        body: 'Pick up!',53        isRead: false, 54        isNew:false,55        isSent: false, 56        isDraft: false,57        isStar:false,58        sentAt : 1572872361,59    },60    {61        id:'em05',62        fromName:'Steave Wazzniak',63        from:'thewaz@apple.com',64        replies:[],65        subject: 'Technical brilliance.',66        body: 'Technical brilliance. Creative passion. A shared dedication to the collaborative process.',67        isRead: false, 68        isNew:true,69        isSent: false, 70        isDraft:false,71        isStar:false,72        sentAt : 1572872361,73    },74    {75        id:'em06',76        fromName:'Tony Stark',77        from:'tony.stark@gmail.com',78        replies:[],79        subject: 'What everybody wants.',80        body: 'Everybody wants a happy ending, right? But it doesnât always roll that way.',81        isRead: false, 82        isNew:true,83        isSent: false, 84        isDraft:false,85        isStar:false,86        sentAt : 1572872361,87    },88    {89        id:'em07',90        fromName:'Thor God of Thunder',91        from:'thor@gmail.com',92        replies:[],93        subject: 'Im Still Worthy',94        body: 'Declaring Im still worthy after successfully summoning the hammer ',95        isRead: true, 96        isNew:true,97        isSent: false, 98        isDraft:false,99        isStar:false,100        sentAt : 1572872361,101    },102    {103        id:'em08',104        fromName:'Peter Quill aka Star-Lord:',105        from:'starlord@gmail.com',106        replies:[],107        subject: 'What`s next....?',108        body: 'What Should We Do Next? Something Good, Something Bad? Bit Of Both?',109        isRead: true, 110        isNew:true,111        isSent: false, 112        isDraft:false,113        isStar:false,114        sentAt : 1572872361,115    },116    {117        id:'em09',118        fromName:'Gal Gadot aka Wonder women:',119        from:'dal.gadot@gmail.com',120        replies:[],121        subject: 'The Belief In Justice',122        body: 'If Loss Makes You Doubt Your Belief In Justice, Then You Never Truly Believed In Justice At All.â',123        isRead: true, 124        isNew:true,125        isSent: false, 126        isDraft:false,127        isStar:false,128        sentAt : 1572872361,129    },130    {131        id:'em010',132        fromName:'God',133        from:'got@sky.com',134        replies:[],135        subject: 'Genesis ',136        body: 'Let there be light',137        isRead: true, 138        isNew:false,139        isSent: false, 140        isDraft:false,141        isStar:false,142        sentAt : 1572872361,143    },144    {145        id:'em011',146        fromName:'Instagram draft',147        from:'info@instagram.com',148        replies:[],149        subject: 'Your account as been locked ',150        body: 'Hey supprot , my account has been locked',151        isRead: false, 152        isNew:false,153        isSent: false, 154        isDraft: true,155        isStar:false,156        sentAt : 1572872361,157    },158    {159        id:'em012',160        fromName:'Steave Jobs',161        from:'steave.jobs@apple.com',162        replies:[],163        subject: 'Your inner Voice',164        body: 'Donât let the noise of othersâ opinions drown out your own inner voice.',165        isRead: false, 166        isNew:false,167        isSent: false, 168        isDraft:false,169        isStar:true,170        sentAt : 1572872361,171    },172    {173        id:'em013',174        fromName:'Twiiter',175        from:'info@twitter.com',176        replies:[],177        subject: 'Bibi like your recent tweet...',178        body: 'Bibi like your recent tweet...',179        isRead: false, 180        isNew:false,181        isSent: true, 182        isDraft: false,183        isStar:false,184        sentAt : 1572872361,185    },186    187]188export const emailService = {189    loadEmailsFromStorage,190    getEmails,191    getEmailsInbox,192    getSelectedEmail,193    getSelectedEmailReplies,194    getEmailsSent,195    getUnreadEamilsCount,196    setEmailAsRead,197    setEmailAsUnread,198    setEmailStar,199    updateEmailsSent,200    updateEmailsDraft,201    updateEmailsDraftSent,202    removeEmail,203}204var DATA_KEY_EMAILS ='emailsDB'205var DATA_KEY_EMAILS_SENT ='emailsSentDB'206loadEmailsFromStorage();  /// move to207function updateEmailsDraftSent(sentMeail,emailID){208    console.log('updateEmailsSent',sentMeail);209    //set email not draft210    var idx = getEmailInxByID(emailID)211    gEmails[idx].isDraft = false 212    // push new email 213    sentMeail.id = utils.makeId();214    sentMeail.sentAt =  utils.getDateTimestamp();215    216    sentMeail.isSent = true217    var sentMailCopy = JSON.parse(JSON.stringify(sentMeail))218    gEmails.push(sentMailCopy)219    console.log('gEmails',gEmails)220    saveEmailsToSorage(DATA_KEY_EMAILS_SENT, gEmails)221    return Promise.resolve('email sent');222}223function updateEmailsDraft(sentMeail){224    sentMeail.id = utils.makeId();225    sentMeail.sentAt =  utils.getDateTimestamp();226    sentMeail.isDraft = true227    var sentMailCopy = JSON.parse(JSON.stringify(sentMeail))228    console.log('sentMeail',sentMeail)229    console.log('gEmails',gEmails)230    gEmails.push(sentMailCopy)231    saveEmailsToSorage(DATA_KEY_EMAILS_SENT, gEmails)232    return Promise.resolve('email draft');233}234function updateEmailsSent(sentMeail,emailTo,emailToId){235    console.log('updateEmailsSent',sentMeail,emailTo,emailToId);236    // push new email 237    sentMeail.id = utils.makeId();238    sentMeail.sentAt =  utils.getDateTimestamp();239    sentMeail.isSent = true240    var sentMailCopy = JSON.parse(JSON.stringify(sentMeail))241    // push new email to replies242    if(emailToId){243        console.log('reply');244        var idx = getEmailInxByID(emailToId)245        gEmails[idx].replies.push(sentMeail.id)246        //console.log('updateEmailsSent reply  gEmails',idx, gEmails)247    }else{248       249        gEmails.push(sentMailCopy)250        console.log('normal',gEmails);251    }252    saveEmailsToSorage(DATA_KEY_EMAILS_SENT, gEmails)253    return Promise.resolve('email sent');254}255function setEmailStar(emailID){256    var idx = getEmailInxByID(emailID)257    gEmails[idx].isStar = !gEmails[idx].isStar258    return Promise.resolve('Email set as Stared');259}260function getUnreadEamilsCount(){261    var res = gEmails.filter(email => {262        return email.isRead === false 263        && email.isNew === true 264      })265    var unreadEmailCount = res.length266    return Promise.resolve(unreadEmailCount);267}268function setEmailAsUnread(emailID){269    var idx = getEmailInxByID(emailID)270    gEmails[idx].isRead = false271    return Promise.resolve('Email unread');272}273function setEmailAsRead(emailID){274    var idx = getEmailInxByID(emailID)275    gEmails[idx].isRead =true276    return Promise.resolve('Email read');277}278function removeEmail(emailID){279    console.log('emailId',emailID)280    var idx = getEmailInxByID(emailID)281    gEmails.splice(idx, 1);282    console.log('gEmails',gEmails)283    saveEmailsToSorage(DATA_KEY_EMAILS, gEmails)284    return Promise.resolve('Email deleted');285}286function getEmailInxByID(emailID){287    const idx = gEmails.findIndex(email => email.id === emailID);288    return idx289}290function getSelectedEmailReplies(replies){291    var res =[]292    for(var i = 0; i< replies.length ; i++){293        var idx = getEmailInxByID(replies[i]);294        res.push(gEmails[idx])295    }296    //console.log('getSelectedEmailReplies res',res)297    return res298    //return Promise.resolve(res);299}300function getSelectedEmail(emailID){301    console.log(emailID)302    var idx = getEmailInxByID(emailID);303    console.log('service',gEmails[idx])304    return Promise.resolve(gEmails[idx]);305}306function getEmailsSent(){307    var res = gEmails.filter(email => {308        return email.isSent === true;309    })310    console.log('getEmailsSent() gEmails',gEmails)311    console.log('getEmailsSent() res',res)312    gEmailsSent = res;313    return Promise.resolve(gEmailsSent);314}315function getEmailsInbox(){316    var res = gEmails.filter(email => {317        return email.isNew === true;318    })319    return Promise.resolve(res);320}321function getEmails(){322    return Promise.resolve(gEmails);323}324function saveEmailsToSorage(dataKey, arr){325    console.log('saving to storage')326    storage.saveToStorage( dataKey, arr)327}328function loadEmailsFromStorage(){329    let emailsFromStorage = storage.loadFromStorage(DATA_KEY_EMAILS)330    if(emailsFromStorage) gEmails = emailsFromStorage ...browser_scratchpad_unsaved.js
Source:browser_scratchpad_unsaved.js  
...24function testListeners() {25  openScratchpad(26    function(aWin, aScratchpad) {27      aScratchpad.setText("new text");28      ok(isStar(aWin), "show star if scratchpad text changes");29      aScratchpad.dirty = false;30      ok(!isStar(aWin), "no star before changing text");31      aScratchpad.setFilename("foo.js");32      aScratchpad.setText("new text2");33      ok(isStar(aWin), "shows star if scratchpad text changes");34      aScratchpad.dirty = false;35      ok(!isStar(aWin), "no star if scratchpad was just saved");36      aScratchpad.setText("new text3");37      ok(isStar(aWin), "shows star if scratchpad has more changes");38      aScratchpad.undo();39      ok(!isStar(aWin), "no star if scratchpad undo to save point");40      aScratchpad.undo();41      ok(isStar(aWin), "star if scratchpad undo past save point");42      aWin.close();43      done();44    },45    { noFocus: true }46  );47}48function testRestoreNotFromFile() {49  const session = [50    {51      text: "test1",52      executionContext: 1,53    },54  ];55  const [win] = ScratchpadManager.restoreSession(session);56  openScratchpad(57    function(aWin, aScratchpad) {58      aScratchpad.setText("new text");59      ok(isStar(win), "show star if restored scratchpad isn't from a file");60      win.close();61      done();62    },63    { window: win, noFocus: true }64  );65}66function testRestoreFromFileSaved() {67  const session = [68    {69      filename: "test.js",70      text: "test1",71      executionContext: 1,72      saved: true,73    },74  ];75  const [win] = ScratchpadManager.restoreSession(session);76  openScratchpad(77    function(aWin, aScratchpad) {78      ok(79        !isStar(win),80        "no star before changing text in scratchpad restored from file"81      );82      aScratchpad.setText("new text");83      ok(84        isStar(win),85        "star when text changed from scratchpad restored from file"86      );87      win.close();88      done();89    },90    { window: win, noFocus: true }91  );92}93function testRestoreFromFileUnsaved() {94  const session = [95    {96      filename: "test.js",97      text: "test1",98      executionContext: 1,99      saved: false,100    },101  ];102  const [win] = ScratchpadManager.restoreSession(session);103  openScratchpad(104    function() {105      ok(isStar(win), "star with scratchpad restored with unsaved text");106      win.close();107      done();108    },109    { window: win, noFocus: true }110  );111}112function isStar(win) {113  return win.document.title.match(/^\*[^\*]/);...browser_scratchpad_bug_669612_unsaved.js
Source:browser_scratchpad_bug_669612_unsaved.js  
...24function testListeners()25{26  openScratchpad(function(aWin, aScratchpad) {27    aScratchpad.setText("new text");28    ok(isStar(aWin), "show star if scratchpad text changes");29    aScratchpad.dirty = false;30    ok(!isStar(aWin), "no star before changing text");31    aScratchpad.setFilename("foo.js");32    aScratchpad.setText("new text2");33    ok(isStar(aWin), "shows star if scratchpad text changes");34    aScratchpad.dirty = false;35    ok(!isStar(aWin), "no star if scratchpad was just saved");36    aScratchpad.setText("new text3");37    ok(isStar(aWin), "shows star if scratchpad has more changes");38    aScratchpad.undo();39    ok(!isStar(aWin), "no star if scratchpad undo to save point");40    aScratchpad.undo();41    ok(isStar(aWin), "star if scratchpad undo past save point");42    aWin.close();43    done();44  }, {noFocus: true});45}46function testRestoreNotFromFile()47{48  let session = [{49    text: "test1",50    executionContext: 151  }];52  let [win] = ScratchpadManager.restoreSession(session);53  openScratchpad(function(aWin, aScratchpad) {54    aScratchpad.setText("new text");55    ok(isStar(win), "show star if restored scratchpad isn't from a file");56    win.close();57    done();58  }, {window: win, noFocus: true});59}60function testRestoreFromFileSaved()61{62  let session = [{63    filename: "test.js",64    text: "test1",65    executionContext: 1,66    saved: true67  }];68  let [win] = ScratchpadManager.restoreSession(session);69  openScratchpad(function(aWin, aScratchpad) {70    ok(!isStar(win), "no star before changing text in scratchpad restored from file");71    aScratchpad.setText("new text");72    ok(isStar(win), "star when text changed from scratchpad restored from file");73    win.close();74    done();75  }, {window: win, noFocus: true});76}77function testRestoreFromFileUnsaved()78{79  let session = [{80    filename: "test.js",81    text: "test1",82    executionContext: 1,83    saved: false84  }];85  let [win] = ScratchpadManager.restoreSession(session);86  openScratchpad(function() {87    ok(isStar(win), "star with scratchpad restored with unsaved text");88    win.close();89    done();90  }, {window: win, noFocus: true});91}92function isStar(win)93{94  return win.document.title.match(/^\*[^\*]/);...store.test.js
Source:store.test.js  
1import {updateTaskList} from "../src/store/store.js";2describe("store", () => {3	const income = {4		id: "123",5		num: 123,6		isStar: false,7	}8	test("origin is empty", () => {9		let origin = []10		expect( updateTaskList(origin, income) ).toEqual([{11			id: "123",12			num: 123,13			isStar: false,14		}]);15	})16	test("origin has same data id", () => {17		let origin = [{18			id: "123",19			num: 0,20			isStar: true,21		}]22		expect( updateTaskList(origin, income) ).toEqual([{23			id: "123",24			num: 123,25			isStar: false,26		}]);27	})28	test("origin has same data, but differance", () => {29		let origin = [{30			id: "123",31			num: 0,32			isStar: true,33		}]34		expect(35			updateTaskList(origin, income)	36		).toEqual([{37			id: "123",38			num: 123,39			isStar: false,40		}]);41	})42	test("origin has many differance data", () => {43		let origin = [44			{45				id: "000",46				num: 0,47				isStar: true,48			},49			{50				id: "111",51				num: 0,52				isStar: true,53			}54		]55		expect(56			updateTaskList(origin, income)	57		).toEqual(58			[59				{60					id: "000",61					num: 0,62					isStar: true,63				},64				{65					id: "111",66					num: 0,67					isStar: true,68				}, {69					id: "123",70					num: 123,71					isStar: false,72				}73			]);74	})...Using AI Code Generation
1const { isStar } = require('playwright/lib/utils/utils');2const { chromium } = require('playwright');3(async () => {4  const browser = await chromium.launch();5  const page = await browser.newPage();6  console.log(isStar);7  await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11  const browser = await chromium.launch();12  const page = await browser.newPage();13  const isStar = await page.evaluate(() => {14    return window.playwright.isStar;15  });16  console.log(isStar);17  await browser.close();18})();Using AI Code Generation
1const { isStar } = require('playwright/lib/server/chromium/crBrowser');2const { isStar } = require('playwright-chromium/lib/server/crBrowser');3const { isStar } = require('playwright/lib/server/chromium/crBrowser');4const { isStar } = require('playwright-chromium/lib/server/crBrowser');5const { isStar } = require('playwright/lib/server/chromium/crBrowser');6const { isStar } = require('playwright-chromium/lib/server/crBrowser');7const { isStar } = require('playwright/lib/server/chromium/crBrowser');8const { isStar } = require('playwright-chromium/lib/server/crBrowser');9const { isStar } = require('playwright/lib/server/chromium/crBrowser');10const { isStar } = require('playwright-chromium/lib/server/crBrowser');11const { isStar } = require('playwright/lib/server/chromium/crBrowser');12const { isStar } = require('playwright-chromium/lib/server/crBrowser');13const { isStar } = require('playwright/lib/server/chromium/crBrowser');14const { isStar } = require('playwright-chromium/lib/server/crBrowser');15const { isStar } = require('playwright/lib/server/chromium/crBrowser');16const { isStar } =Using AI Code Generation
1const { isStar } = require('playwright/lib/server/playwright');2console.log(isStar);3const { isStar } = require('playwright/lib/server/playwright');4console.log(isStar);5const { isStar } = require('playwright/lib/server/playwright');6console.log(isStar);7const { isStar } = require('playwright/lib/server/playwright');8console.log(isStar);9const { isStar } = require('playwright/lib/server/playwright');10console.log(isStar);11const { isStar } = require('playwright/lib/server/playwright');12console.log(isStar);13const { isStar } = require('playwright/lib/server/playwright');14console.log(isStar);15const { isStar } = require('playwright/lib/server/playwright');16console.log(isStar);17const { isStar } = require('playwright/lib/server/playwright');18console.log(isStar);19const { isStar } = require('playwright/lib/server/playwright');20console.log(isStar);21const { isStar } = require('playwright/lib/server/playwright');22console.log(isStar);23const { isStar } = require('playwright/lib/server/playwright');24console.log(isStar);25const { isStar } = require('playwright/lib/server/playwright');26console.log(isStar);Using AI Code Generation
1const { isStar } = require('@playwright/test/lib/test');2const { isStar } = require('@playwright/test');3const { isStar } = require('@playwright/test/lib/test');4const { isStar } = require('@playwright/test/lib/test');5import { isStar } from '@playwright/test/lib/test';6import { isStar } from '@playwright/test';7import { isStar } from '@playwright/test/lib/test';8import { isStar } from '@playwright/test/lib/test';9TypeError: (0 , _test.isStar) is not a function10TypeError: (0 , _test.isStar) is not a function11TypeError: (0 , _test.isStar) is not a functionUsing AI Code Generation
1const path = require('path');2const playwright = require('playwright');3const { isStar } = playwright._testType;4const path = require('path');5const playwright = require('playwright');6const { isStar } = playwright._testType;7const path = require('path');8const playwright = require('playwright');9const { isStar } = playwright._testType;10const path = require('path');11const playwright = require('playwright');12const { isStar } = playwright._testType;13const path = require('path');14const playwright = require('playwright');15const { isStar } = playwright._testType;16const path = require('path');17const playwright = require('playwright');18const { isStar } = playwright._testType;19const path = require('path');20const playwright = require('playwright');21const { isStar } = playwright._testType;22const path = require('path');23const playwright = require('playwright');24const { isStar } = playwright._testType;25const path = require('path');26const playwright = require('playwright');27const { isStar } = playwright._testType;28const path = require('path');29const playwright = require('playwright');30const { isStar } = playwright._testType;31const path = require('path');32const playwright = require('playwright');33const { isStar } = playwright._testType;34const path = require('path');35const playwright = require('playwright');36const { isStar } = playwright._testType;37const path = require('path');38const playwright = require('playwright');39const { isStar } = playwright._testType;LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!
