@rocket.chat/livechat 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +0 -4
- package/build/{0.chunk.85c58.js → 0.chunk.44660.js} +2 -2
- package/build/{0.chunk.85c58.js.map → 0.chunk.44660.js.map} +1 -1
- package/build/10.chunk.3443b.js +2 -0
- package/build/10.chunk.3443b.js.map +1 -0
- package/build/11.chunk.ccd77.js +2 -0
- package/build/11.chunk.ccd77.js.map +1 -0
- package/build/12.chunk.4f6f3.js +2 -0
- package/build/12.chunk.4f6f3.js.map +1 -0
- package/build/13.chunk.7f2df.js +2 -0
- package/build/13.chunk.7f2df.js.map +1 -0
- package/build/14.chunk.02269.js +2 -0
- package/build/14.chunk.02269.js.map +1 -0
- package/build/15.chunk.df585.js +2 -0
- package/build/15.chunk.df585.js.map +1 -0
- package/build/16.chunk.7e69f.js +2 -0
- package/build/16.chunk.7e69f.js.map +1 -0
- package/build/17.chunk.beee1.js +2 -0
- package/build/17.chunk.beee1.js.map +1 -0
- package/build/18.chunk.d1b79.js +2 -0
- package/build/18.chunk.d1b79.js.map +1 -0
- package/build/19.chunk.d25ee.js +2 -0
- package/build/19.chunk.d25ee.js.map +1 -0
- package/build/20.chunk.c2815.js +2 -0
- package/build/20.chunk.c2815.js.map +1 -0
- package/build/21.chunk.da88a.js +2 -0
- package/build/21.chunk.da88a.js.map +1 -0
- package/build/22.chunk.811ae.js +2 -0
- package/build/22.chunk.811ae.js.map +1 -0
- package/build/23.chunk.a26ea.js +2 -0
- package/build/23.chunk.a26ea.js.map +1 -0
- package/build/24.chunk.cc050.js +2 -0
- package/build/24.chunk.cc050.js.map +1 -0
- package/build/25.chunk.c5dc7.js +2 -0
- package/build/25.chunk.c5dc7.js.map +1 -0
- package/build/26.chunk.5cef7.js +2 -0
- package/build/26.chunk.5cef7.js.map +1 -0
- package/build/27.chunk.6c057.js +2 -0
- package/build/27.chunk.6c057.js.map +1 -0
- package/build/28.chunk.7e892.js +2 -0
- package/build/28.chunk.7e892.js.map +1 -0
- package/build/29.chunk.594c2.js +2 -0
- package/build/29.chunk.594c2.js.map +1 -0
- package/build/30.chunk.2d343.js +2 -0
- package/build/30.chunk.2d343.js.map +1 -0
- package/build/31.chunk.a7fe1.js +2 -0
- package/build/31.chunk.a7fe1.js.map +1 -0
- package/build/32.chunk.6b54e.js +2 -0
- package/build/32.chunk.6b54e.js.map +1 -0
- package/build/33.chunk.c2c0b.js +2 -0
- package/build/33.chunk.c2c0b.js.map +1 -0
- package/build/34.chunk.89340.js +2 -0
- package/build/34.chunk.89340.js.map +1 -0
- package/build/35.chunk.07076.js +2 -0
- package/build/35.chunk.07076.js.map +1 -0
- package/build/36.chunk.ed8df.js +2 -0
- package/build/36.chunk.ed8df.js.map +1 -0
- package/build/37.chunk.3bb4b.js +2 -0
- package/build/37.chunk.3bb4b.js.map +1 -0
- package/build/38.chunk.92513.js +2 -0
- package/build/38.chunk.92513.js.map +1 -0
- package/build/39.chunk.519ac.js +2 -0
- package/build/39.chunk.519ac.js.map +1 -0
- package/build/4.chunk.4eded.js +25 -0
- package/build/4.chunk.4eded.js.map +1 -0
- package/build/4.chunk.df723.css +3 -0
- package/build/4.chunk.df723.css.map +1 -0
- package/build/40.chunk.8b99d.js +2 -0
- package/build/40.chunk.8b99d.js.map +1 -0
- package/build/41.chunk.b760c.js +2 -0
- package/build/41.chunk.b760c.js.map +1 -0
- package/build/42.chunk.1f197.js +2 -0
- package/build/42.chunk.1f197.js.map +1 -0
- package/build/43.chunk.50b99.js +2 -0
- package/build/43.chunk.50b99.js.map +1 -0
- package/build/44.chunk.98ae5.js +2 -0
- package/build/44.chunk.98ae5.js.map +1 -0
- package/build/45.chunk.cd848.js +2 -0
- package/build/45.chunk.cd848.js.map +1 -0
- package/build/46.chunk.2a99c.js +2 -0
- package/build/46.chunk.2a99c.js.map +1 -0
- package/build/47.chunk.25d73.js +2 -0
- package/build/47.chunk.25d73.js.map +1 -0
- package/build/48.chunk.dab54.js +2 -0
- package/build/48.chunk.dab54.js.map +1 -0
- package/build/49.chunk.4fa9c.js +2 -0
- package/build/49.chunk.4fa9c.js.map +1 -0
- package/build/{63.chunk.6df1c.css → 5.chunk.64645.css} +4 -4
- package/build/5.chunk.64645.css.map +1 -0
- package/build/5.chunk.bf9f3.js +2 -0
- package/build/5.chunk.bf9f3.js.map +1 -0
- package/build/50.chunk.e7b89.js +2 -0
- package/build/50.chunk.e7b89.js.map +1 -0
- package/build/51.chunk.2ccf2.js +2 -0
- package/build/51.chunk.2ccf2.js.map +1 -0
- package/build/52.chunk.0f323.js +2 -0
- package/build/52.chunk.0f323.js.map +1 -0
- package/build/53.chunk.242c6.js +2 -0
- package/build/53.chunk.242c6.js.map +1 -0
- package/build/54.chunk.9b29d.js +2 -0
- package/build/54.chunk.9b29d.js.map +1 -0
- package/build/55.chunk.20aa8.js +2 -0
- package/build/55.chunk.20aa8.js.map +1 -0
- package/build/56.chunk.fba82.js +2 -0
- package/build/56.chunk.fba82.js.map +1 -0
- package/build/57.chunk.ab22c.js +2 -0
- package/build/57.chunk.ab22c.js.map +1 -0
- package/build/58.chunk.d7b58.js +2 -0
- package/build/58.chunk.d7b58.js.map +1 -0
- package/build/59.chunk.8f0e3.js +2 -0
- package/build/59.chunk.8f0e3.js.map +1 -0
- package/build/6.chunk.2cf25.js +2 -0
- package/build/6.chunk.2cf25.js.map +1 -0
- package/build/60.chunk.1dfcf.js +2 -0
- package/build/60.chunk.1dfcf.js.map +1 -0
- package/build/61.chunk.0bdb1.js +2 -0
- package/build/61.chunk.0bdb1.js.map +1 -0
- package/build/62.chunk.b2b78.js +2 -0
- package/build/62.chunk.b2b78.js.map +1 -0
- package/build/7.chunk.d256d.js +2 -0
- package/build/7.chunk.d256d.js.map +1 -0
- package/build/8.chunk.68b72.js +2 -0
- package/build/8.chunk.68b72.js.map +1 -0
- package/build/9.chunk.a1a7d.js +2 -0
- package/build/9.chunk.a1a7d.js.map +1 -0
- package/build/bundle.ce55a.js +2 -0
- package/build/bundle.ce55a.js.map +1 -0
- package/build/index.html +1 -1
- package/build/polyfills.b843f.js +2 -0
- package/build/polyfills.b843f.js.map +1 -0
- package/build/rocketchat-livechat.min.js +1 -1
- package/build/rocketchat-livechat.min.js.map +1 -1
- package/build/vendors~bundle.chunk.8a189.js +2 -0
- package/build/vendors~bundle.chunk.8a189.js.map +1 -0
- package/package.json +6 -10
- package/build/62.chunk.0e20e.js +0 -25
- package/build/62.chunk.0e20e.js.map +0 -1
- package/build/62.chunk.a8a84.css +0 -3
- package/build/62.chunk.a8a84.css.map +0 -1
- package/build/63.chunk.541a7.js +0 -2
- package/build/63.chunk.541a7.js.map +0 -1
- package/build/63.chunk.6df1c.css.map +0 -1
- package/build/bundle.f28df.js +0 -2
- package/build/bundle.f28df.js.map +0 -1
- package/build/i18n.af.chunk.aa09d.js +0 -2
- package/build/i18n.af.chunk.aa09d.js.map +0 -1
- package/build/i18n.ar.chunk.bd26e.js +0 -2
- package/build/i18n.ar.chunk.bd26e.js.map +0 -1
- package/build/i18n.az.chunk.f87f8.js +0 -2
- package/build/i18n.az.chunk.f87f8.js.map +0 -1
- package/build/i18n.be_BY.chunk.b0156.js +0 -2
- package/build/i18n.be_BY.chunk.b0156.js.map +0 -1
- package/build/i18n.bg.chunk.88e1a.js +0 -2
- package/build/i18n.bg.chunk.88e1a.js.map +0 -1
- package/build/i18n.bs.chunk.ef698.js +0 -2
- package/build/i18n.bs.chunk.ef698.js.map +0 -1
- package/build/i18n.ca.chunk.dd769.js +0 -2
- package/build/i18n.ca.chunk.dd769.js.map +0 -1
- package/build/i18n.cs.chunk.75c37.js +0 -2
- package/build/i18n.cs.chunk.75c37.js.map +0 -1
- package/build/i18n.cy.chunk.24ba1.js +0 -2
- package/build/i18n.cy.chunk.24ba1.js.map +0 -1
- package/build/i18n.da.chunk.e85c1.js +0 -2
- package/build/i18n.da.chunk.e85c1.js.map +0 -1
- package/build/i18n.de.chunk.59e3a.js +0 -2
- package/build/i18n.de.chunk.59e3a.js.map +0 -1
- package/build/i18n.de_AT.chunk.ee5a5.js +0 -2
- package/build/i18n.de_AT.chunk.ee5a5.js.map +0 -1
- package/build/i18n.de_IN.chunk.a6b69.js +0 -2
- package/build/i18n.de_IN.chunk.a6b69.js.map +0 -1
- package/build/i18n.default.chunk.95cdb.js +0 -2
- package/build/i18n.default.chunk.95cdb.js.map +0 -1
- package/build/i18n.el.chunk.a738e.js +0 -2
- package/build/i18n.el.chunk.a738e.js.map +0 -1
- package/build/i18n.en.chunk.c2c5d.js +0 -2
- package/build/i18n.en.chunk.c2c5d.js.map +0 -1
- package/build/i18n.eo.chunk.42f15.js +0 -2
- package/build/i18n.eo.chunk.42f15.js.map +0 -1
- package/build/i18n.es.chunk.bb686.js +0 -2
- package/build/i18n.es.chunk.bb686.js.map +0 -1
- package/build/i18n.et.chunk.81530.js +0 -2
- package/build/i18n.et.chunk.81530.js.map +0 -1
- package/build/i18n.eu.chunk.fbb17.js +0 -2
- package/build/i18n.eu.chunk.fbb17.js.map +0 -1
- package/build/i18n.fa.chunk.4ad50.js +0 -2
- package/build/i18n.fa.chunk.4ad50.js.map +0 -1
- package/build/i18n.fi.chunk.1e1d4.js +0 -2
- package/build/i18n.fi.chunk.1e1d4.js.map +0 -1
- package/build/i18n.fr.chunk.d3b99.js +0 -2
- package/build/i18n.fr.chunk.d3b99.js.map +0 -1
- package/build/i18n.he.chunk.b02b9.js +0 -2
- package/build/i18n.he.chunk.b02b9.js.map +0 -1
- package/build/i18n.hr.chunk.ec7c3.js +0 -2
- package/build/i18n.hr.chunk.ec7c3.js.map +0 -1
- package/build/i18n.hu.chunk.f61b3.js +0 -2
- package/build/i18n.hu.chunk.f61b3.js.map +0 -1
- package/build/i18n.id.chunk.08258.js +0 -2
- package/build/i18n.id.chunk.08258.js.map +0 -1
- package/build/i18n.it.chunk.28db4.js +0 -2
- package/build/i18n.it.chunk.28db4.js.map +0 -1
- package/build/i18n.ja.chunk.357b9.js +0 -2
- package/build/i18n.ja.chunk.357b9.js.map +0 -1
- package/build/i18n.km.chunk.ef6ac.js +0 -2
- package/build/i18n.km.chunk.ef6ac.js.map +0 -1
- package/build/i18n.ko.chunk.4b18b.js +0 -2
- package/build/i18n.ko.chunk.4b18b.js.map +0 -1
- package/build/i18n.ku.chunk.e1143.js +0 -2
- package/build/i18n.ku.chunk.e1143.js.map +0 -1
- package/build/i18n.lo.chunk.eef40.js +0 -2
- package/build/i18n.lo.chunk.eef40.js.map +0 -1
- package/build/i18n.lt.chunk.6d9e9.js +0 -2
- package/build/i18n.lt.chunk.6d9e9.js.map +0 -1
- package/build/i18n.lv.chunk.41de8.js +0 -2
- package/build/i18n.lv.chunk.41de8.js.map +0 -1
- package/build/i18n.mn.chunk.02189.js +0 -2
- package/build/i18n.mn.chunk.02189.js.map +0 -1
- package/build/i18n.ms_MY.chunk.529dd.js +0 -2
- package/build/i18n.ms_MY.chunk.529dd.js.map +0 -1
- package/build/i18n.nl.chunk.b4efd.js +0 -2
- package/build/i18n.nl.chunk.b4efd.js.map +0 -1
- package/build/i18n.no.chunk.f0677.js +0 -2
- package/build/i18n.no.chunk.f0677.js.map +0 -1
- package/build/i18n.pl.chunk.554b7.js +0 -2
- package/build/i18n.pl.chunk.554b7.js.map +0 -1
- package/build/i18n.pt.chunk.59e1e.js +0 -2
- package/build/i18n.pt.chunk.59e1e.js.map +0 -1
- package/build/i18n.pt_BR.chunk.d9303.js +0 -2
- package/build/i18n.pt_BR.chunk.d9303.js.map +0 -1
- package/build/i18n.ro.chunk.7ab22.js +0 -2
- package/build/i18n.ro.chunk.7ab22.js.map +0 -1
- package/build/i18n.ru.chunk.40164.js +0 -2
- package/build/i18n.ru.chunk.40164.js.map +0 -1
- package/build/i18n.sk_SK.chunk.a4455.js +0 -2
- package/build/i18n.sk_SK.chunk.a4455.js.map +0 -1
- package/build/i18n.sl_SI.chunk.6b729.js +0 -2
- package/build/i18n.sl_SI.chunk.6b729.js.map +0 -1
- package/build/i18n.sq.chunk.af4db.js +0 -2
- package/build/i18n.sq.chunk.af4db.js.map +0 -1
- package/build/i18n.sr.chunk.e5992.js +0 -2
- package/build/i18n.sr.chunk.e5992.js.map +0 -1
- package/build/i18n.sv.chunk.763a0.js +0 -2
- package/build/i18n.sv.chunk.763a0.js.map +0 -1
- package/build/i18n.ta_IN.chunk.4be8a.js +0 -2
- package/build/i18n.ta_IN.chunk.4be8a.js.map +0 -1
- package/build/i18n.th_TH.chunk.0ffb3.js +0 -2
- package/build/i18n.th_TH.chunk.0ffb3.js.map +0 -1
- package/build/i18n.tr.chunk.019b0.js +0 -2
- package/build/i18n.tr.chunk.019b0.js.map +0 -1
- package/build/i18n.ug.chunk.de9a2.js +0 -2
- package/build/i18n.ug.chunk.de9a2.js.map +0 -1
- package/build/i18n.uk.chunk.49ef5.js +0 -2
- package/build/i18n.uk.chunk.49ef5.js.map +0 -1
- package/build/i18n.vi_VN.chunk.79ec1.js +0 -2
- package/build/i18n.vi_VN.chunk.79ec1.js.map +0 -1
- package/build/i18n.zh.chunk.685a0.js +0 -2
- package/build/i18n.zh.chunk.685a0.js.map +0 -1
- package/build/i18n.zh_HK.chunk.c8047.js +0 -2
- package/build/i18n.zh_HK.chunk.c8047.js.map +0 -1
- package/build/i18n.zh_TW.chunk.f064c.js +0 -2
- package/build/i18n.zh_TW.chunk.f064c.js.map +0 -1
- package/build/polyfills.db442.js +0 -2
- package/build/polyfills.db442.js.map +0 -1
- package/build/vendors~bundle.chunk.d6e62.js +0 -2
- package/build/vendors~bundle.chunk.d6e62.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/widget.js","webpack:///../src/index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","log","window","RocketChat","_","widget","iframe","scrollPosition","widget_height","all","config","hookQueue","ready","smallScreen","validCallbacks","callbacks","Map","on","type","handler","handlers","push","set","off","splice","indexOf","emit","evt","slice","map","registerCallback","eventName","fn","emitCallback","data","callHook","action","params","src","args","contentWindow","postMessage","updateWidgetStyle","isOpened","document","documentElement","scrollTop","body","classList","add","remove","style","left","height","width","WIDGET_MARGIN","openWidget","dataset","state","focus","closeWidget","api","popup","length","forEach","hookParams","apply","this","minimizeWindow","restoreWindow","closed","close","openPopout","open","url","lastIndexOf","resizeWidget","removeWidget","removeChild","callback","showWidget","display","hideWidget","resetDocumentStyle","setFullScreenDocumentMobile","pageVisited","change","location","JSON","parse","stringify","title","setCustomField","overwrite","setTheme","theme","setDepartment","department","setBusinessUnit","businessUnit","setGuestToken","token","setGuestName","setGuestEmail","email","registerGuest","guest","setAgent","agent","setLanguage","language","currentPage","href","init","createElement","className","position","maxHeight","bottom","right","zIndex","container","id","allowTransparency","border","backgroundColor","appendChild","handleMediaQueryTest","matches","mediaQueryList","matchMedia","addListener","createWidget","addEventListener","msg","undefined","concat","setInterval","initRocket","console","warn","queue","livechat","initialize","method","Array","isArray","clearDepartment","maximizeWidget","minimizeWidget","clearBusinessUnit","onChatMaximized","onChatMinimized","onChatStarted","onChatEnded","onPrechatFormSubmit","onOfflineFormSubmit","onWidgetShown","onWidgetHidden","onAssignAgent","onAgentStatusChange","onQueuePositionChange","onServiceOffline"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,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AmD,gBAtJD,WACChH,EAAS,oBAsJTiE,gBACAE,eACAC,gBACAI,WACAF,gBACAI,cACA7B,WAjJD,WACC7C,EAAS,eAiJT+C,WA9ID,WACC/C,EAAS,eA8ITiH,eA3ID,WACCjH,EAAS,mBA2ITkH,eAxID,WACClH,EAAS,mBAwIT+D,kBACAoD,kBAtLD,WACCnH,EAAS,sBAwLToH,gBAtB4B,SAsBZvH,GAAMF,EAAiB,iBAAkBE,IACzDwH,gBAvB4B,SAuBZxH,GAAMF,EAAiB,iBAAkBE,IACzDyH,cAxB4B,SAwBdzH,GAAMF,EAAiB,eAAgBE,IACrD0H,YAzB4B,SAyBhB1H,GAAMF,EAAiB,aAAcE,IACjD2H,oBA1B4B,SA0BR3H,GAAMF,EAAiB,uBAAwBE,IACnE4H,oBA3B4B,SA2BR5H,GAAMF,EAAiB,sBAAuBE,IAClE6H,cA5B4B,SA4Bd7H,GAAMF,EAAiB,cAAeE,IACpD8H,eA7B4B,SA6Bb9H,GAAMF,EAAiB,cAAeE,IACrD+H,cA9B4B,SA8Bd/H,GAAMF,EAAiB,eAAgBE,IACrDgI,oBA/B4B,SA+BRhI,GAAMF,EAAiB,sBAAuBE,IAClEiI,sBAhC4B,SAgCNjI,GAAMF,EAAiB,wBAAyBE,IACtEkI,iBAjC4B,SAiCXlI,GAAMF,EAAiB,kBAAmBE,KAI5D6G,EAAM7E,SAAQ,SAAC1F,GACdA,EAAEF,KAAK8B,OAAOC,WAAW2I","file":"rocketchat-livechat.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"livechat/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import mitt from 'mitt';\n\n\nconst log = process.env.NODE_ENV === 'development'\n\t? (...args) => window.console.log('%cwidget%c', 'color: red', 'color: initial', ...args)\n\t: () => {};\n\n\nconst WIDGET_OPEN_WIDTH = 365;\nconst WIDGET_OPEN_HEIGHT = 525;\nconst WIDGET_MINIMIZED_WIDTH = 54;\nconst WIDGET_MINIMIZED_HEIGHT = 54;\nconst WIDGET_MARGIN = 16;\n\n\nwindow.RocketChat = window.RocketChat || { _: [] };\nconst config = {};\nlet widget;\nlet iframe;\nlet hookQueue = [];\nlet ready = false;\nlet smallScreen = false;\nlet scrollPosition;\nlet widget_height;\n\nexport const validCallbacks = [\n\t'chat-maximized',\n\t'chat-minimized',\n\t'chat-started',\n\t'chat-ended',\n\t'pre-chat-form-submit',\n\t'offline-form-submit',\n\t'show-widget',\n\t'hide-widget',\n\t'assign-agent',\n\t'agent-status-change',\n\t'queue-position-change',\n\t'no-agent-online',\n];\n\nconst callbacks = mitt();\n\nfunction registerCallback(eventName, fn) {\n\tif (validCallbacks.indexOf(eventName) === -1) {\n\t\treturn false;\n\t}\n\n\treturn callbacks.on(eventName, fn);\n}\n\nfunction emitCallback(eventName, data) {\n\tif (typeof data !== 'undefined') {\n\t\tcallbacks.emit(eventName, data);\n\t} else {\n\t\tcallbacks.emit(eventName);\n\t}\n}\n\n// hooks\nfunction callHook(action, params) {\n\tif (!ready) {\n\t\treturn hookQueue.push([action, params]);\n\t}\n\tconst data = {\n\t\tsrc: 'rocketchat',\n\t\tfn: action,\n\t\targs: params,\n\t};\n\tiframe.contentWindow.postMessage(data, '*');\n}\n\nconst updateWidgetStyle = (isOpened) => {\n\tif (smallScreen && isOpened) {\n\t\tscrollPosition = document.documentElement.scrollTop;\n\t\tdocument.body.classList.add('rc-livechat-mobile-full-screen');\n\t} else {\n\t\tdocument.body.classList.remove('rc-livechat-mobile-full-screen');\n\t\tif (smallScreen) {\n\t\t\tdocument.documentElement.scrollTop = scrollPosition;\n\t\t}\n\t}\n\n\tif (isOpened) {\n\t\twidget.style.left = smallScreen ? '0' : 'auto';\n\n\t\t/**\n\t\t * If we use widget.style.height = smallScreen ? '100vh' : ...\n\t\t * In above case some browser's viewport height is not rendered correctly\n\t\t * so, as 100vh will resolve to 100% of the current viewport height,\n\t\t * so fixed it to 100% avoiding problem for some browsers. Similar resolution\n\t\t * for widget.style.width\n\t\t */\n\n\t\twidget.style.height = smallScreen ? '100%' : `${ WIDGET_MARGIN + widget_height + WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT }px`;\n\t\twidget.style.width = smallScreen ? '100%' : `${ WIDGET_MARGIN + WIDGET_OPEN_WIDTH + WIDGET_MARGIN }px`;\n\t} else {\n\t\twidget.style.left = 'auto';\n\t\twidget.style.width = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_WIDTH + WIDGET_MARGIN }px`;\n\t\twidget.style.height = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT + WIDGET_MARGIN }px`;\n\t}\n};\n\nconst createWidget = (url) => {\n\twidget = document.createElement('div');\n\twidget.className = 'rocketchat-widget';\n\twidget.style.position = 'fixed';\n\twidget.style.width = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_WIDTH + WIDGET_MARGIN }px`;\n\twidget.style.height = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT + WIDGET_MARGIN }px`;\n\twidget.style.maxHeight = '100vh';\n\twidget.style.bottom = '0';\n\twidget.style.right = '0';\n\twidget.style.zIndex = '12345';\n\twidget.dataset.state = 'closed';\n\n\tconst container = document.createElement('div');\n\tcontainer.className = 'rocketchat-container';\n\tcontainer.style.width = '100%';\n\tcontainer.style.height = '100%';\n\n\tiframe = document.createElement('iframe');\n\tiframe.id = 'rocketchat-iframe';\n\tiframe.allowTransparency = 'true';\n\tiframe.src = url;\n\tiframe.style.width = '100%';\n\tiframe.style.height = '100%';\n\tiframe.style.border = 'none';\n\tiframe.style.backgroundColor = 'transparent';\n\n\tcontainer.appendChild(iframe);\n\twidget.appendChild(container);\n\tdocument.body.appendChild(widget);\n\n\tconst handleMediaQueryTest = ({ matches }) => {\n\t\tif (!widget) {\n\t\t\treturn;\n\t\t}\n\n\t\tsmallScreen = matches;\n\t\tupdateWidgetStyle(widget.dataset.state === 'opened');\n\t\tcallHook('setExpanded', smallScreen);\n\t};\n\n\tconst mediaQueryList = window.matchMedia('screen and (max-device-width: 480px)');\n\tmediaQueryList.addListener(handleMediaQueryTest);\n\thandleMediaQueryTest(mediaQueryList);\n};\n\nconst openWidget = () => {\n\tif (widget.dataset.state === 'opened') {\n\t\treturn;\n\t}\n\n\twidget_height = WIDGET_OPEN_HEIGHT;\n\tupdateWidgetStyle(true);\n\twidget.dataset.state = 'opened';\n\tiframe.focus();\n\temitCallback('chat-maximized');\n};\n\nconst resizeWidget = (height) => {\n\twidget_height = height;\n\tupdateWidgetStyle(true);\n\twidget.dataset.state = 'triggered';\n};\n\nfunction closeWidget() {\n\tif (widget.dataset.state === 'closed') {\n\t\treturn;\n\t}\n\n\tupdateWidgetStyle(false);\n\twidget.dataset.state = 'closed';\n\temitCallback('chat-minimized');\n}\n\nconst api = {\n\tpopup: null,\n\n\tready() {\n\t\tready = true;\n\t\tif (hookQueue.length > 0) {\n\t\t\thookQueue.forEach(function(hookParams) {\n\t\t\t\tcallHook.apply(this, hookParams);\n\t\t\t});\n\t\t\thookQueue = [];\n\t\t}\n\t},\n\n\tminimizeWindow() {\n\t\tcloseWidget();\n\t},\n\n\trestoreWindow() {\n\t\tif (api.popup && api.popup.closed !== true) {\n\t\t\tapi.popup.close();\n\t\t\tapi.popup = null;\n\t\t}\n\t\topenWidget();\n\t},\n\n\topenPopout() {\n\t\tcloseWidget();\n\t\tapi.popup = window.open(`${ config.url }${ config.url.lastIndexOf('?') > -1 ? '&' : '?' }mode=popout`,\n\t\t\t'livechat-popout', `width=${ WIDGET_OPEN_WIDTH }, height=${ widget_height }, toolbars=no`);\n\t\tapi.popup.focus();\n\t},\n\n\topenWidget() {\n\t\topenWidget();\n\t},\n\n\tresizeWidget(height) {\n\t\tresizeWidget(height);\n\t},\n\n\tremoveWidget() {\n\t\tdocument.body.removeChild(widget);\n\t},\n\n\tcallback(eventName, data) {\n\t\temitCallback(eventName, data);\n\t},\n\n\tshowWidget() {\n\t\tiframe.style.display = 'initial';\n\t\temitCallback('show-widget');\n\t},\n\n\thideWidget() {\n\t\tiframe.style.display = 'none';\n\t\temitCallback('hide-widget');\n\t},\n\n\tresetDocumentStyle() {\n\t\tdocument.body.classList.remove('rc-livechat-mobile-full-screen');\n\t},\n\n\tsetFullScreenDocumentMobile() {\n\t\tsmallScreen && document.body.classList.add('rc-livechat-mobile-full-screen');\n\t},\n};\n\nfunction pageVisited(change) {\n\tcallHook('pageVisited', {\n\t\tchange,\n\t\tlocation: JSON.parse(JSON.stringify(document.location)),\n\t\ttitle: document.title,\n\t});\n}\n\nfunction setCustomField(key, value, overwrite) {\n\tif (typeof overwrite === 'undefined') {\n\t\toverwrite = true;\n\t}\n\tcallHook('setCustomField', [key, value, overwrite]);\n}\n\nfunction setTheme(theme) {\n\tcallHook('setTheme', theme);\n}\n\nfunction setDepartment(department) {\n\tcallHook('setDepartment', department);\n}\n\nfunction setBusinessUnit(businessUnit) {\n\tcallHook('setBusinessUnit', businessUnit);\n}\n\nfunction clearBusinessUnit() {\n\tcallHook('clearBusinessUnit');\n}\n\nfunction setGuestToken(token) {\n\tcallHook('setGuestToken', token);\n}\n\nfunction setGuestName(name) {\n\tcallHook('setGuestName', name);\n}\n\nfunction setGuestEmail(email) {\n\tcallHook('setGuestEmail', email);\n}\n\nfunction registerGuest(guest) {\n\tcallHook('registerGuest', guest);\n}\n\nfunction clearDepartment() {\n\tcallHook('clearDepartment');\n}\n\nfunction setAgent(agent) {\n\tcallHook('setAgent', agent);\n}\n\nfunction setLanguage(language) {\n\tcallHook('setLanguage', language);\n}\n\nfunction showWidget() {\n\tcallHook('showWidget');\n}\n\nfunction hideWidget() {\n\tcallHook('hideWidget');\n}\n\nfunction maximizeWidget() {\n\tcallHook('maximizeWidget');\n}\n\nfunction minimizeWidget() {\n\tcallHook('minimizeWidget');\n}\n\nfunction initialize(params) {\n\tfor (const method in params) {\n\t\tif (!params.hasOwnProperty(method)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tswitch (method) {\n\t\t\tcase 'customField':\n\t\t\t\tconst { key, value, overwrite } = params[method];\n\t\t\t\tsetCustomField(key, value, overwrite);\n\t\t\t\tcontinue;\n\t\t\tcase 'setCustomFields':\n\t\t\t\tif (!Array.isArray(params[method])) {\n\t\t\t\t\tconsole.log('Error: Invalid parameters. Value must be an array of objects');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tparams[method].forEach((data) => {\n\t\t\t\t\tconst { key, value, overwrite } = data;\n\t\t\t\t\tsetCustomField(key, value, overwrite);\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\tcase 'theme':\n\t\t\t\tsetTheme(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'department':\n\t\t\t\tsetDepartment(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'businessUnit': {\n\t\t\t\tsetBusinessUnit(params[method]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcase 'guestToken':\n\t\t\t\tsetGuestToken(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'guestName':\n\t\t\t\tsetGuestName(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'guestEmail':\n\t\t\t\tsetGuestEmail(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'registerGuest':\n\t\t\t\tregisterGuest(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'language':\n\t\t\t\tsetLanguage(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'agent':\n\t\t\t\tsetAgent(params[method]);\n\t\t\t\tcontinue;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t}\n}\n\nconst currentPage = {\n\thref: null,\n\ttitle: null,\n};\n\nconst attachMessageListener = () => {\n\twindow.addEventListener('message', (msg) => {\n\t\tif (typeof msg.data === 'object' && msg.data.src !== undefined && msg.data.src === 'rocketchat') {\n\t\t\tif (api[msg.data.fn] !== undefined && typeof api[msg.data.fn] === 'function') {\n\t\t\t\tconst args = [].concat(msg.data.args || []);\n\t\t\t\tlog(`api.${ msg.data.fn }`, ...args);\n\t\t\t\tapi[msg.data.fn].apply(null, args);\n\t\t\t}\n\t\t}\n\t}, false);\n};\n\nconst trackNavigation = () => {\n\tsetInterval(() => {\n\t\tif (document.location.href !== currentPage.href) {\n\t\t\tpageVisited('url');\n\t\t\tcurrentPage.href = document.location.href;\n\t\t}\n\n\t\tif (document.title !== currentPage.title) {\n\t\t\tpageVisited('title');\n\t\t\tcurrentPage.title = document.title;\n\t\t}\n\t}, 800);\n};\n\nconst init = (url) => {\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tconfig.url = url;\n\n\tcreateWidget(url);\n\tattachMessageListener();\n\ttrackNavigation();\n};\n\nif (typeof window.initRocket !== 'undefined') {\n\tconsole.warn('initRocket is now deprecated. Please update the livechat code.');\n\tinit(window.initRocket[0]);\n}\n\nif (typeof window.RocketChat.url !== 'undefined') {\n\tinit(window.RocketChat.url);\n}\n\nconst queue = window.RocketChat._;\n\nwindow.RocketChat._.push = function(c) {\n\tc.call(window.RocketChat.livechat);\n};\nwindow.RocketChat = window.RocketChat._.push;\n\n// exports\nwindow.RocketChat.livechat = {\n\t// methods\n\tpageVisited,\n\tsetCustomField,\n\tinitialize,\n\tsetTheme,\n\tsetDepartment,\n\tclearDepartment,\n\tsetGuestToken,\n\tsetGuestName,\n\tsetGuestEmail,\n\tsetAgent,\n\tregisterGuest,\n\tsetLanguage,\n\tshowWidget,\n\thideWidget,\n\tmaximizeWidget,\n\tminimizeWidget,\n\tsetBusinessUnit,\n\tclearBusinessUnit,\n\n\t// callbacks\n\tonChatMaximized(fn) { registerCallback('chat-maximized', fn); },\n\tonChatMinimized(fn) { registerCallback('chat-minimized', fn); },\n\tonChatStarted(fn) { registerCallback('chat-started', fn); },\n\tonChatEnded(fn) { registerCallback('chat-ended', fn); },\n\tonPrechatFormSubmit(fn) { registerCallback('pre-chat-form-submit', fn); },\n\tonOfflineFormSubmit(fn) { registerCallback('offline-form-submit', fn); },\n\tonWidgetShown(fn) { registerCallback('show-widget', fn); },\n\tonWidgetHidden(fn) { registerCallback('hide-widget', fn); },\n\tonAssignAgent(fn) { registerCallback('assign-agent', fn); },\n\tonAgentStatusChange(fn) { registerCallback('agent-status-change', fn); },\n\tonQueuePositionChange(fn) { registerCallback('queue-position-change', fn); },\n\tonServiceOffline(fn) { registerCallback('no-agent-online', fn); },\n};\n\n// proccess queue\nqueue.forEach((c) => {\n\tc.call(window.RocketChat.livechat);\n});\n","export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = any> = (event?: T) => void;\nexport type WildcardHandler = (type: EventType, event?: any) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList = Array<Handler>;\nexport type WildCardEventHandlerList = Array<WildcardHandler>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;\n\nexport interface Emitter {\n\tall: EventHandlerMap;\n\n\ton<T = any>(type: EventType, handler: Handler<T>): void;\n\ton(type: '*', handler: WildcardHandler): void;\n\n\toff<T = any>(type: EventType, handler: Handler<T>): void;\n\toff(type: '*', handler: WildcardHandler): void;\n\n\temit<T = any>(type: EventType, event?: T): void;\n\temit(type: '*', event?: any): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt(all?: EventHandlerMap): Emitter {\n\tall = all || new Map();\n\n\treturn {\n\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `\"*\"` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tconst added = handlers && handlers.push(handler);\n\t\t\tif (!added) {\n\t\t\t\tall.set(type, [handler]);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from, or `\"*\"`\n\t\t * @param {Function} handler Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `\"*\"` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing \"*\" handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<T = any>(type: EventType, evt: T) {\n\t\t\t((all.get(type) || []) as EventHandlerList).slice().map((handler) => { handler(evt); });\n\t\t\t((all.get('*') || []) as WildCardEventHandlerList).slice().map((handler) => { handler(type, evt); });\n\t\t}\n\t};\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/widget.js","webpack:///../src/index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","log","window","RocketChat","_","widget","iframe","scrollPosition","widget_height","all","config","hookQueue","ready","smallScreen","validCallbacks","callbacks","Map","on","type","handler","handlers","push","set","off","splice","indexOf","emit","evt","slice","map","registerCallback","eventName","fn","emitCallback","data","callHook","action","params","src","args","contentWindow","postMessage","updateWidgetStyle","isOpened","document","documentElement","scrollTop","body","classList","add","remove","style","left","height","width","WIDGET_MARGIN","openWidget","dataset","state","focus","closeWidget","api","popup","length","forEach","hookParams","apply","this","minimizeWindow","restoreWindow","closed","close","openPopout","open","url","lastIndexOf","resizeWidget","removeWidget","removeChild","callback","showWidget","display","hideWidget","resetDocumentStyle","setFullScreenDocumentMobile","pageVisited","change","location","JSON","parse","stringify","title","setCustomField","overwrite","setTheme","theme","setDepartment","department","setBusinessUnit","businessUnit","setGuestToken","token","setGuestName","setGuestEmail","email","registerGuest","guest","setAgent","agent","setLanguage","language","currentPage","href","init","createElement","className","position","maxHeight","bottom","right","zIndex","container","id","allowTransparency","border","backgroundColor","appendChild","handleMediaQueryTest","matches","mediaQueryList","matchMedia","addListener","createWidget","addEventListener","msg","undefined","concat","setInterval","initRocket","console","warn","queue","livechat","initialize","method","Array","isArray","clearDepartment","maximizeWidget","minimizeWidget","clearBusinessUnit","onChatMaximized","onChatMinimized","onChatStarted","onChatEnded","onPrechatFormSubmit","onOfflineFormSubmit","onWidgetShown","onWidgetHidden","onAssignAgent","onAgentStatusChange","onQueuePositionChange","onServiceOffline"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAE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AF,gBACAI,cACA7B,WAjJD,WACC7C,EAAS,eAiJT+C,WA9ID,WACC/C,EAAS,eA8ITiH,eA3ID,WACCjH,EAAS,mBA2ITkH,eAxID,WACClH,EAAS,mBAwIT+D,kBACAoD,kBAtLD,WACCnH,EAAS,sBAwLToH,gBAtB4B,SAsBZvH,GAAMF,EAAiB,iBAAkBE,IACzDwH,gBAvB4B,SAuBZxH,GAAMF,EAAiB,iBAAkBE,IACzDyH,cAxB4B,SAwBdzH,GAAMF,EAAiB,eAAgBE,IACrD0H,YAzB4B,SAyBhB1H,GAAMF,EAAiB,aAAcE,IACjD2H,oBA1B4B,SA0BR3H,GAAMF,EAAiB,uBAAwBE,IACnE4H,oBA3B4B,SA2BR5H,GAAMF,EAAiB,sBAAuBE,IAClE6H,cA5B4B,SA4Bd7H,GAAMF,EAAiB,cAAeE,IACpD8H,eA7B4B,SA6Bb9H,GAAMF,EAAiB,cAAeE,IACrD+H,cA9B4B,SA8Bd/H,GAAMF,EAAiB,eAAgBE,IACrDgI,oBA/B4B,SA+BRhI,GAAMF,EAAiB,sBAAuBE,IAClEiI,sBAhC4B,SAgCNjI,GAAMF,EAAiB,wBAAyBE,IACtEkI,iBAjC4B,SAiCXlI,GAAMF,EAAiB,kBAAmBE,KAI5D6G,EAAM7E,SAAQ,SAAC1F,GACdA,EAAEF,KAAK8B,OAAOC,WAAW2I","file":"rocketchat-livechat.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"livechat/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import mitt from 'mitt';\n\n\nconst log = process.env.NODE_ENV === 'development'\n\t? (...args) => window.console.log('%cwidget%c', 'color: red', 'color: initial', ...args)\n\t: () => {};\n\n\nconst WIDGET_OPEN_WIDTH = 365;\nconst WIDGET_OPEN_HEIGHT = 525;\nconst WIDGET_MINIMIZED_WIDTH = 54;\nconst WIDGET_MINIMIZED_HEIGHT = 54;\nconst WIDGET_MARGIN = 16;\n\n\nwindow.RocketChat = window.RocketChat || { _: [] };\nconst config = {};\nlet widget;\nlet iframe;\nlet hookQueue = [];\nlet ready = false;\nlet smallScreen = false;\nlet scrollPosition;\nlet widget_height;\n\nexport const validCallbacks = [\n\t'chat-maximized',\n\t'chat-minimized',\n\t'chat-started',\n\t'chat-ended',\n\t'pre-chat-form-submit',\n\t'offline-form-submit',\n\t'show-widget',\n\t'hide-widget',\n\t'assign-agent',\n\t'agent-status-change',\n\t'queue-position-change',\n\t'no-agent-online',\n];\n\nconst callbacks = mitt();\n\nfunction registerCallback(eventName, fn) {\n\tif (validCallbacks.indexOf(eventName) === -1) {\n\t\treturn false;\n\t}\n\n\treturn callbacks.on(eventName, fn);\n}\n\nfunction emitCallback(eventName, data) {\n\tif (typeof data !== 'undefined') {\n\t\tcallbacks.emit(eventName, data);\n\t} else {\n\t\tcallbacks.emit(eventName);\n\t}\n}\n\n// hooks\nfunction callHook(action, params) {\n\tif (!ready) {\n\t\treturn hookQueue.push([action, params]);\n\t}\n\tconst data = {\n\t\tsrc: 'rocketchat',\n\t\tfn: action,\n\t\targs: params,\n\t};\n\tiframe.contentWindow.postMessage(data, '*');\n}\n\nconst updateWidgetStyle = (isOpened) => {\n\tif (smallScreen && isOpened) {\n\t\tscrollPosition = document.documentElement.scrollTop;\n\t\tdocument.body.classList.add('rc-livechat-mobile-full-screen');\n\t} else {\n\t\tdocument.body.classList.remove('rc-livechat-mobile-full-screen');\n\t\tif (smallScreen) {\n\t\t\tdocument.documentElement.scrollTop = scrollPosition;\n\t\t}\n\t}\n\n\tif (isOpened) {\n\t\twidget.style.left = smallScreen ? '0' : 'auto';\n\n\t\t/**\n\t\t * If we use widget.style.height = smallScreen ? '100vh' : ...\n\t\t * In above case some browser's viewport height is not rendered correctly\n\t\t * so, as 100vh will resolve to 100% of the current viewport height,\n\t\t * so fixed it to 100% avoiding problem for some browsers. Similar resolution\n\t\t * for widget.style.width\n\t\t */\n\n\t\twidget.style.height = smallScreen ? '100%' : `${ WIDGET_MARGIN + widget_height + WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT }px`;\n\t\twidget.style.width = smallScreen ? '100%' : `${ WIDGET_MARGIN + WIDGET_OPEN_WIDTH + WIDGET_MARGIN }px`;\n\t} else {\n\t\twidget.style.left = 'auto';\n\t\twidget.style.width = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_WIDTH + WIDGET_MARGIN }px`;\n\t\twidget.style.height = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT + WIDGET_MARGIN }px`;\n\t}\n};\n\nconst createWidget = (url) => {\n\twidget = document.createElement('div');\n\twidget.className = 'rocketchat-widget';\n\twidget.style.position = 'fixed';\n\twidget.style.width = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_WIDTH + WIDGET_MARGIN }px`;\n\twidget.style.height = `${ WIDGET_MARGIN + WIDGET_MINIMIZED_HEIGHT + WIDGET_MARGIN }px`;\n\twidget.style.maxHeight = '100vh';\n\twidget.style.bottom = '0';\n\twidget.style.right = '0';\n\twidget.style.zIndex = '12345';\n\twidget.dataset.state = 'closed';\n\n\tconst container = document.createElement('div');\n\tcontainer.className = 'rocketchat-container';\n\tcontainer.style.width = '100%';\n\tcontainer.style.height = '100%';\n\n\tiframe = document.createElement('iframe');\n\tiframe.id = 'rocketchat-iframe';\n\tiframe.allowTransparency = 'true';\n\tiframe.src = url;\n\tiframe.style.width = '100%';\n\tiframe.style.height = '100%';\n\tiframe.style.border = 'none';\n\tiframe.style.backgroundColor = 'transparent';\n\n\tcontainer.appendChild(iframe);\n\twidget.appendChild(container);\n\tdocument.body.appendChild(widget);\n\n\tconst handleMediaQueryTest = ({ matches }) => {\n\t\tif (!widget) {\n\t\t\treturn;\n\t\t}\n\n\t\tsmallScreen = matches;\n\t\tupdateWidgetStyle(widget.dataset.state === 'opened');\n\t\tcallHook('setExpanded', smallScreen);\n\t};\n\n\tconst mediaQueryList = window.matchMedia('screen and (max-device-width: 480px)');\n\tmediaQueryList.addListener(handleMediaQueryTest);\n\thandleMediaQueryTest(mediaQueryList);\n};\n\nconst openWidget = () => {\n\tif (widget.dataset.state === 'opened') {\n\t\treturn;\n\t}\n\n\twidget_height = WIDGET_OPEN_HEIGHT;\n\tupdateWidgetStyle(true);\n\twidget.dataset.state = 'opened';\n\tiframe.focus();\n\temitCallback('chat-maximized');\n};\n\nconst resizeWidget = (height) => {\n\twidget_height = height;\n\tupdateWidgetStyle(true);\n\twidget.dataset.state = 'triggered';\n};\n\nfunction closeWidget() {\n\tif (widget.dataset.state === 'closed') {\n\t\treturn;\n\t}\n\n\tupdateWidgetStyle(false);\n\twidget.dataset.state = 'closed';\n\temitCallback('chat-minimized');\n}\n\nconst api = {\n\tpopup: null,\n\n\tready() {\n\t\tready = true;\n\t\tif (hookQueue.length > 0) {\n\t\t\thookQueue.forEach(function(hookParams) {\n\t\t\t\tcallHook.apply(this, hookParams);\n\t\t\t});\n\t\t\thookQueue = [];\n\t\t}\n\t},\n\n\tminimizeWindow() {\n\t\tcloseWidget();\n\t},\n\n\trestoreWindow() {\n\t\tif (api.popup && api.popup.closed !== true) {\n\t\t\tapi.popup.close();\n\t\t\tapi.popup = null;\n\t\t}\n\t\topenWidget();\n\t},\n\n\topenPopout() {\n\t\tcloseWidget();\n\t\tapi.popup = window.open(`${ config.url }${ config.url.lastIndexOf('?') > -1 ? '&' : '?' }mode=popout`,\n\t\t\t'livechat-popout', `width=${ WIDGET_OPEN_WIDTH }, height=${ widget_height }, toolbars=no`);\n\t\tapi.popup.focus();\n\t},\n\n\topenWidget() {\n\t\topenWidget();\n\t},\n\n\tresizeWidget(height) {\n\t\tresizeWidget(height);\n\t},\n\n\tremoveWidget() {\n\t\tdocument.body.removeChild(widget);\n\t},\n\n\tcallback(eventName, data) {\n\t\temitCallback(eventName, data);\n\t},\n\n\tshowWidget() {\n\t\tiframe.style.display = 'initial';\n\t\temitCallback('show-widget');\n\t},\n\n\thideWidget() {\n\t\tiframe.style.display = 'none';\n\t\temitCallback('hide-widget');\n\t},\n\n\tresetDocumentStyle() {\n\t\tdocument.body.classList.remove('rc-livechat-mobile-full-screen');\n\t},\n\n\tsetFullScreenDocumentMobile() {\n\t\tsmallScreen && document.body.classList.add('rc-livechat-mobile-full-screen');\n\t},\n};\n\nfunction pageVisited(change) {\n\tcallHook('pageVisited', {\n\t\tchange,\n\t\tlocation: JSON.parse(JSON.stringify(document.location)),\n\t\ttitle: document.title,\n\t});\n}\n\nfunction setCustomField(key, value, overwrite) {\n\tif (typeof overwrite === 'undefined') {\n\t\toverwrite = true;\n\t}\n\tcallHook('setCustomField', [key, value, overwrite]);\n}\n\nfunction setTheme(theme) {\n\tcallHook('setTheme', theme);\n}\n\nfunction setDepartment(department) {\n\tcallHook('setDepartment', department);\n}\n\nfunction setBusinessUnit(businessUnit) {\n\tcallHook('setBusinessUnit', businessUnit);\n}\n\nfunction clearBusinessUnit() {\n\tcallHook('clearBusinessUnit');\n}\n\nfunction setGuestToken(token) {\n\tcallHook('setGuestToken', token);\n}\n\nfunction setGuestName(name) {\n\tcallHook('setGuestName', name);\n}\n\nfunction setGuestEmail(email) {\n\tcallHook('setGuestEmail', email);\n}\n\nfunction registerGuest(guest) {\n\tcallHook('registerGuest', guest);\n}\n\nfunction clearDepartment() {\n\tcallHook('clearDepartment');\n}\n\nfunction setAgent(agent) {\n\tcallHook('setAgent', agent);\n}\n\nfunction setLanguage(language) {\n\tcallHook('setLanguage', language);\n}\n\nfunction showWidget() {\n\tcallHook('showWidget');\n}\n\nfunction hideWidget() {\n\tcallHook('hideWidget');\n}\n\nfunction maximizeWidget() {\n\tcallHook('maximizeWidget');\n}\n\nfunction minimizeWidget() {\n\tcallHook('minimizeWidget');\n}\n\nfunction initialize(params) {\n\tfor (const method in params) {\n\t\tif (!params.hasOwnProperty(method)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tswitch (method) {\n\t\t\tcase 'customField':\n\t\t\t\tconst { key, value, overwrite } = params[method];\n\t\t\t\tsetCustomField(key, value, overwrite);\n\t\t\t\tcontinue;\n\t\t\tcase 'setCustomFields':\n\t\t\t\tif (!Array.isArray(params[method])) {\n\t\t\t\t\tconsole.log('Error: Invalid parameters. Value must be an array of objects');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tparams[method].forEach((data) => {\n\t\t\t\t\tconst { key, value, overwrite } = data;\n\t\t\t\t\tsetCustomField(key, value, overwrite);\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\tcase 'theme':\n\t\t\t\tsetTheme(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'department':\n\t\t\t\tsetDepartment(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'businessUnit': {\n\t\t\t\tsetBusinessUnit(params[method]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcase 'guestToken':\n\t\t\t\tsetGuestToken(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'guestName':\n\t\t\t\tsetGuestName(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'guestEmail':\n\t\t\t\tsetGuestEmail(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'registerGuest':\n\t\t\t\tregisterGuest(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'language':\n\t\t\t\tsetLanguage(params[method]);\n\t\t\t\tcontinue;\n\t\t\tcase 'agent':\n\t\t\t\tsetAgent(params[method]);\n\t\t\t\tcontinue;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t}\n}\n\nconst currentPage = {\n\thref: null,\n\ttitle: null,\n};\n\nconst attachMessageListener = () => {\n\twindow.addEventListener('message', (msg) => {\n\t\tif (typeof msg.data === 'object' && msg.data.src !== undefined && msg.data.src === 'rocketchat') {\n\t\t\tif (api[msg.data.fn] !== undefined && typeof api[msg.data.fn] === 'function') {\n\t\t\t\tconst args = [].concat(msg.data.args || []);\n\t\t\t\tlog(`api.${ msg.data.fn }`, ...args);\n\t\t\t\tapi[msg.data.fn].apply(null, args);\n\t\t\t}\n\t\t}\n\t}, false);\n};\n\nconst trackNavigation = () => {\n\tsetInterval(() => {\n\t\tif (document.location.href !== currentPage.href) {\n\t\t\tpageVisited('url');\n\t\t\tcurrentPage.href = document.location.href;\n\t\t}\n\n\t\tif (document.title !== currentPage.title) {\n\t\t\tpageVisited('title');\n\t\t\tcurrentPage.title = document.title;\n\t\t}\n\t}, 800);\n};\n\nconst init = (url) => {\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tconfig.url = url;\n\n\tcreateWidget(url);\n\tattachMessageListener();\n\ttrackNavigation();\n};\n\nif (typeof window.initRocket !== 'undefined') {\n\tconsole.warn('initRocket is now deprecated. Please update the livechat code.');\n\tinit(window.initRocket[0]);\n}\n\nif (typeof window.RocketChat.url !== 'undefined') {\n\tinit(window.RocketChat.url);\n}\n\nconst queue = window.RocketChat._;\n\nwindow.RocketChat._.push = function(c) {\n\tc.call(window.RocketChat.livechat);\n};\nwindow.RocketChat = window.RocketChat._.push;\n\n// exports\nwindow.RocketChat.livechat = {\n\t// methods\n\tpageVisited,\n\tsetCustomField,\n\tinitialize,\n\tsetTheme,\n\tsetDepartment,\n\tclearDepartment,\n\tsetGuestToken,\n\tsetGuestName,\n\tsetGuestEmail,\n\tsetAgent,\n\tregisterGuest,\n\tsetLanguage,\n\tshowWidget,\n\thideWidget,\n\tmaximizeWidget,\n\tminimizeWidget,\n\tsetBusinessUnit,\n\tclearBusinessUnit,\n\n\t// callbacks\n\tonChatMaximized(fn) { registerCallback('chat-maximized', fn); },\n\tonChatMinimized(fn) { registerCallback('chat-minimized', fn); },\n\tonChatStarted(fn) { registerCallback('chat-started', fn); },\n\tonChatEnded(fn) { registerCallback('chat-ended', fn); },\n\tonPrechatFormSubmit(fn) { registerCallback('pre-chat-form-submit', fn); },\n\tonOfflineFormSubmit(fn) { registerCallback('offline-form-submit', fn); },\n\tonWidgetShown(fn) { registerCallback('show-widget', fn); },\n\tonWidgetHidden(fn) { registerCallback('hide-widget', fn); },\n\tonAssignAgent(fn) { registerCallback('assign-agent', fn); },\n\tonAgentStatusChange(fn) { registerCallback('agent-status-change', fn); },\n\tonQueuePositionChange(fn) { registerCallback('queue-position-change', fn); },\n\tonServiceOffline(fn) { registerCallback('no-agent-online', fn); },\n};\n\n// proccess queue\nqueue.forEach((c) => {\n\tc.call(window.RocketChat.livechat);\n});\n","export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = any> = (event?: T) => void;\nexport type WildcardHandler = (type: EventType, event?: any) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList = Array<Handler>;\nexport type WildCardEventHandlerList = Array<WildcardHandler>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;\n\nexport interface Emitter {\n\tall: EventHandlerMap;\n\n\ton<T = any>(type: EventType, handler: Handler<T>): void;\n\ton(type: '*', handler: WildcardHandler): void;\n\n\toff<T = any>(type: EventType, handler: Handler<T>): void;\n\toff(type: '*', handler: WildcardHandler): void;\n\n\temit<T = any>(type: EventType, event?: T): void;\n\temit(type: '*', event?: any): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt(all?: EventHandlerMap): Emitter {\n\tall = all || new Map();\n\n\treturn {\n\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `\"*\"` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tconst added = handlers && handlers.push(handler);\n\t\t\tif (!added) {\n\t\t\t\tall.set(type, [handler]);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from, or `\"*\"`\n\t\t * @param {Function} handler Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<T = any>(type: EventType, handler: Handler<T>) {\n\t\t\tconst handlers = all.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `\"*\"` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing \"*\" handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<T = any>(type: EventType, evt: T) {\n\t\t\t((all.get(type) || []) as EventHandlerList).slice().map((handler) => { handler(evt); });\n\t\t\t((all.get('*') || []) as WildCardEventHandlerList).slice().map((handler) => { handler(type, evt); });\n\t\t}\n\t};\n}\n"],"sourceRoot":""}
|