1function polartie_REagent(conf){const mdr=this;const isMobile=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||!!(/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1);let mdrPrevClassName=null;let mdrPrevState=null;let dragEl;let dragHandleEl;const lastPosition={};let sizePreset=null;const mode=isMobile()?conf.hasOwnProperty("mobileMode")&&[0,1,2].includes(conf.mobileMode)?conf.mobileMode:1:conf.hasOwnProperty("desktopMode")&&[0,1,2].includes(conf.desktopMode)?conf.desktopMode:1;const clientWidth=conf.hasOwnProperty("width")?Math.max(conf.width,340):340;const clientHeight=conf.hasOwnProperty("height")?Math.max(conf.height,550):550;const btnBottom=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("bottom")?conf.callButton.bottom:"0px";const btnRight=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("right")?conf.callButton.right:"140px";const btnBgColor=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("bgcolor")?conf.callButton.bgcolor:"#3f9a59";const btnTextColor=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("color")?conf.callButton.color:"#ffffff";const btnType=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("type")?conf.callButton.type:"";const btnLabel=conf.hasOwnProperty("callButton")&&conf.callButton.hasOwnProperty("label")?conf.callButton.label:"Remote Expert";const mdrStyles=` 2html, body { 3 padding: 0; 4 margin: 0; 5 width: 100%; 6 height: 100%; 7} 8* { 9 box-sizing: border-box; 10} 11iframe.mdr-content-frame { 12 position: fixed; 13 top:0; 14 left:0; 15 width: 100vw; 16 height: 100dvh; 17 z-index: 1; 18 border: none; 19 20 transition: top 0.3s, bottom 0.3s, height 0.3s; 21} 22 23iframe.mdr-content-frame.mdr-initial, iframe.mdr-content-frame.mdr-halfscreen { 24 height: 55dvh; 25} 26iframe.mdr-content-frame.mdr-quarterscreen { 27 height: 100dvh; 28} 29iframe.mdr-content-frame.mdr-collapsed { 30 height: calc(100dvh - 36px); 31} 32 33.mdr-REagent-frame { 34 position: fixed; 35 top: 0; 36 left: 0; 37 right: auto; 38 bottom: auto; 39 z-index: 1002; 40 41 width: 100vw; 42 height: 100dvh; 43 resize: none; 44 overflow: hidden; 45 46 padding: 0; 47 48 //background-color: rgba(0,0,0,.5); 49 50 display: flex; 51 flex-direction: column; 52 justify-content: flex-end; 53 align-items: stretch; 54 55 border-radius: 12px 12px 0 0; 56 57 transition: top 0.3s, bottom 0.3s, left 0.3s, width 0.3s, height 0.3s; 58 59} 60 61.mdr-REagent-frame * { 62 -webkit-user-select: none; 63 -ms-user-select: none; 64 user-select: none; 65} 66 67.mdr-REagent-frame.mdr-initial, .mdr-REagent-frame.mdr-halfscreen { 68 height:45dvh; 69 top: 55dvh; 70 bottom:0; 71} 72.mdr-REagent-frame.mdr-quarterscreen { 73 left: 45vw; 74 height: 45dvh; 75 width: 55vw; 76 top: 55dvh; 77} 78 79 80.mdr-REagent-frame.mdr-collapsed { 81 bottom: auto; 82 top: calc(100dvh - 36px); 83 background-color: transparent; 84} 85 86 87.mdr-re-agent { 88 flex-grow: 1; 89 flex-shrink: 1; 90 width: 100%; 91 border: none; 92 background-color: black; 93} 94 95.mdr-REagent-header { 96 font-family: sans-serif; 97 display: flex; 98 flex-direction: row; 99 justify-content: flex-end; 100 align-items: center; 101 gap: 3px; 102 103 height: 36px; 104 105 padding: 0 10px; 106 107 flex-grow: 0; 108 flex-shrink: 0; 109 110 background-color: `+ 111btnBgColor+`; 112 color: `+ 113btnTextColor+`; 114 border-radius: inherit; 115 cursor: move; 116} 117.mdr-REagent-frame.mdr-on-call .mdr-REagent-header { 118 background-color: #F04400; 119 color: white; 120} 121 122.mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header { 123 background-color: #F04400; 124 color: white; 125 animation: mdrColorChange 0.66s linear infinite alternate; 126} 127.mdr-REagent-frame.mdr-placing-call .mdr-REagent-header { 128 background-color: #F09800; 129 color: white; 130} 131 132 133 134@keyframes mdrColorChange { 135 0% { 136 background-color: #F04400; 137 } 138 100% { 139 background-color: #8D2800; 140 } 141} 142 143.mdr-REagent-header > span { 144 display: inline-block; 145 flex-grow: 1; 146 flex-shrink: 1; 147 width: 100%; 148 overflow: hidden; 149 text-overflow: ellipsis; 150 white-space: nowrap; 151 padding-left: 10px; 152 font-size: 16px; 153 154} 155 156.mdr-btn-close, .mdr-btn-minimize, .mdr-btn-initial, .mdr-btn-quarterscreen, .mdr-btn-halfscreen, .mdr-btn-fullscreen { 157 width: 32px; 158 height: 32px; 159 flex-basis: 32px; 160 flex-grow: 0; 161 flex-shrink: 0; 162 border: none; 163 background-color: transparent; 164 background-repeat: no-repeat; 165 background-position: center center; 166 background-size: 24px 24px; 167 168 display: flex; 169 justify-content: center;
170 align-items: center; 171 172 opacity: 0.8; 173 border-radius: 3px; 174 padding: 0px 0px !important; 175 transition: background-color 0.2s; 176} 177.mdr-btn-close { 178 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M17.7071 16.2929C18.0976 16.6834 18.0976 17.3166 17.7071 17.7071C17.3166 18.0976 16.6834 18.0976 16.2929 17.7071L12 13.4142L7.70711 17.7071C7.31658 18.0976 6.68342 18.0976 6.29289 17.7071C5.90237 17.3166 5.90237 16.6834 6.29289 16.2929L10.5858 12L6.29289 7.70711C5.90237 7.31658 5.90237 6.68342 6.29289 6.29289C6.68342 5.90237 7.31658 5.90237 7.70711 6.29289L12 10.5858L16.2929 6.29289C16.6834 5.90237 17.3166 5.90237 17.7071 6.29289C18.0976 6.68342 18.0976 7.31658 17.7071 7.70711L13.4142 12L17.7071 16.2929Z' fill='`+ 179encodeURIComponent(btnTextColor)+`'/></svg>"); 180} 181.mdr-btn-minimize { 182 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 14C12.4477 14 12 14.4477 12 15C12 15.5523 12.4477 16 13 16H17C17.5523 16 18 15.5523 18 15C18 14.4477 17.5523 14 17 14H13Z' fill='`+ 183encodeURIComponent(btnTextColor)+`'/></svg>"); 184} 185.mdr-btn-initial { 186 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 11C12.4477 11 12 11.4477 12 12V15C12 15.5523 12.4477 16 13 16H16C16.5523 16 17 15.5523 17 15V12C17 11.4477 16.5523 11 16 11H13Z' fill='`+ 187encodeURIComponent(btnTextColor)+`'/></svg>"); 188} 189.mdr-btn-quarterscreen { 190 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM16 8C15.4477 8 15 8.44772 15 9V15C15 15.5523 15.4477 16 16 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H16Z' fill='`+ 191encodeURIComponent(btnTextColor)+`'/></svg>"); 192} 193.mdr-btn-halfscreen { 194 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 8C12.4477 8 12 8.44772 12 9V15C12 15.5523 12.4477 16 13 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H13Z' fill='`+ 195encodeURIComponent(btnTextColor)+`'/></svg>"); 196} 197.mdr-btn-fullscreen { 198 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM6 8C5.44772 8 5 8.44772 5 9V15C5 15.5523 5.44772 16 6 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H6Z' fill='`+ 199encodeURIComponent(btnTextColor)+`'/></svg>"); 200} 201 202.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-close, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-close, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-close { 203 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M17.7071 16.2929C18.0976 16.6834 18.0976 17.3166 17.7071 17.7071C17.3166 18.0976 16.6834 18.0976 16.2929 17.7071L12 13.4142L7.70711 17.7071C7.31658 18.0976 6.68342 18.0976 6.29289 17.7071C5.90237 17.3166 5.90237 16.6834 6.29289 16.2929L10.5858 12L6.29289 7.70711C5.90237 7.31658 5.90237 6.68342 6.29289 6.29289C6.68342 5.90237 7.31658 5.90237 7.70711 6.29289L12 10.5858L16.2929 6.29289C16.6834 5.90237 17.3166 5.90237 17.7071 6.29289C18.0976 6.68342 18.0976 7.31658 17.7071 7.70711L13.4142 12L17.7071 16.2929Z' fill='white'/></svg>") !important; 204} 205.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-btn-minimize, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-minimize, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-minimize { 206 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 14C12.4477 14 12 14.4477 12 15C12 15.5523 12.4477 16 13 16H17C17.5523 16 18 15.5523 18 15C18 14.4477 17.5523 14 17 14H13Z' fill='white'/></svg>") !important; 207} 208.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-initial, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-initial, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-initial { 209 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 11C12.4477 11 12 11.4477 12 12V15C12 15.5523 12.4477 16 13 16H16C16.5523 16 17 15.5523 17 15V12C17 11.4477 16.5523 11 16 11H13Z' fill='white'/></svg>") !important; 210} 211.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-quarterscreen, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-quarterscreen, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-quarterscreen { 212 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM16 8C15.4477 8 15 8.44772 15 9V15C15 15.5523 15.4477 16 16 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H16Z' fill='white'/></svg>") !important; 213} 214.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-halfscreen, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-halfscreen, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-halfscreen { 215 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM13 8C12.4477 8 12 8.44772 12 9V15C12 15.5523 12.4477 16 13 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H13Z' fill='white'/></svg>") !important; 216} 217.mdr-REagent-frame.mdr-on-call .mdr-REagent-header .mdr-fullscreen, .mdr-REagent-frame.mdr-on-call.mdr-collapsed .mdr-REagent-header .mdr-btn-fullscreen, .mdr-REagent-frame.mdr-placing-call .mdr-REagent-header .mdr-fullscreen { 218 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M6 7H18C19.1046 7 20 7.89543 20 9V15C20 16.1046 19.1046 17 18 17H6C4.89543 17 4 16.1046 4 15V9C4 7.89543 4.89543 7 6 7ZM3 9C3 7.34315 4.34315 6 6 6H18C19.6569 6 21 7.34315 21 9V15C21 16.6569 19.6569 18 18 18H6C4.34315 18 3 16.6569 3 15V9ZM6 8C5.44772 8 5 8.44772 5 9V15C5 15.5523 5.44772 16 6 16H18C18.5523 16 19 15.5523 19 15V9C19 8.44772 18.5523 8 18 8H6Z' fill='white'/></svg>") !important; 219} 220 221 222.mdr-btn-close:not(:disabled):hover, .mdr-btn-minimize:not(:disabled):hover, .mdr-btn-initial:not(:disabled):hover, .mdr-btn-quarterscreen:not(:disabled):hover, .mdr-btn-halfscreen:not(:disabled):hover, .mdr-btn-fullscreen:not(:disabled):hover { 223 opacity: 1; 224 background-color: rgba(0,0,0,.1); 225} 226.mdr-btn-close:not(:disabled):active, .mdr-btn-minimize:not(:disabled):active, .mdr-btn-initial:not(:disabled):active, .mdr-btn-quarterscreen:not(:disabled):active, .mdr-btn-halfscreen:not(:disabled):active, .mdr-btn-fullscreen:not(:disabled):active { 227 background-color: rgba(0,0,0,.5); 228} 229 230.mdr-btn-close:not(:disabled), .mdr-btn-minimize:not(:disabled), .mdr-btn-initial:not(:disabled), .mdr-btn-quarterscreen:not(:disabled), .mdr-btn-halfscreen:not(:disabled), .mdr-btn-fullscreen:not(:disabled) { 231 cursor: pointer; 232} 233 234 235.mdr-re-launcher-btn { 236 position: fixed; 237 bottom:`+
238btnBottom+`; 239 right: `+ 240btnRight+`; 241 display: flex; 242 justify-content: space-around; 243 align-items: center; 244 245 height: 46px; 246 min-width: 98px; 247 z-index: 1001; 248 249 250 border-radius: 12px 12px 0 0; 251 border: none; 252 253 background-color: `+ 254btnBgColor+`; 255 color: `+ 256btnTextColor+`; 257 box-shadow: 0 0 8px rgba(0,0,0,.5); 258 font-size: 14px; 259 padding: 0 14px; 260} 261 262 263.mdr-re-launcher-btn.pill { 264 border-radius: 19px; 265 height: 38px; 266} 267.mdr-re-launcher-btn.round { 268 border-radius: 22px; 269 height: 44px; 270 width: 44px; 271 overflow: hidden; 272 min-width: auto; 273 background-repeat: no-repeat; 274 background-position: center center; 275 background-image: url("data:image/svg+xml;utf8, <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2.18182 10.2546C2.18182 8.57443 2.18182 7.73435 2.49394 7.09262C2.76849 6.52813 3.20657 6.06919 3.7454 5.78157C4.35796 5.45459 5.15986 5.45459 6.76364 5.45459H13.4182C15.022 5.45459 15.8239 5.45459 16.4364 5.78157C16.9753 6.06919 17.4133 6.52813 17.6879 7.09262C17.9791 7.
27569127 17.9986 8.46253 17.9999 9.92736L20.4721 7.94966C21.4542 7.16395 22.9091 7.86321 22.9091 9.12097L22.9091 14.8791C22.9091 16.1369 21.4542 16.8361 20.4721 16.0504L17.9999 14.0727C17.9986 15.5375 17.9791 16.3088 17.6879 16.9075C17.4133 17.472 16.9753 17.9309 16.4364 18.2185C15.8239 18.5455 15.022 18.5455 13.4182 18.5455H6.76364C5.15985 18.5455 4.35796 18.5455 3.7454 18.2185C3.20657 17.9309 2.76849 17.472 2.49394 16.9075C2.18182 16.2657 2.18182 15.4257 2.18182 13.7455V10.2546Z' fill='`+ 276encodeURIComponent(btnTextColor)+`'/></svg>") 277} 278.mdr-re-launcher-btn.hidden { 279 display: none !important; 280} 281 282.mdr-re-launcher-btn:not(:disabled) { 283 cursor: pointer; 284} 285 286.mdr-grip { 287 display: inline-block; 288 width: 24px; 289 height: 24px; 290 position: absolute; 291 bottom: 0; 292 right: 0; 293 background-color: rgba(255,0,0,0); 294} 295.mdr-grip:hover { 296 background-color: rgba(255,0,0, .6); 297} 298 299@media only screen and (min-width: 660px) { 300 iframe.mdr-content-frame.mdr-initial, iframe.mdr-content-frame.mdr-halfscreen { 301 height: 100dvh; 302 } 303 .mdr-REagent-frame { 304 top: calc(100dvh - `+ 305clientHeight+`px); 306 left: calc(100vw - `+ 307clientWidth+`px - 128px - 10px); 308 width: `+ 309clientWidth+`px; 310 height: `+ 311clientHeight+`px; 312 313 right: auto; 314 bottom: auto; 315 box-shadow: 0 20px 50px rgba(0,0,0,.5); 316 min-width: 340px; 317 min-height: 550px; 318 resize: none; 319 overflow: hidden; 320 padding: 0; 321 background-color: black; 322 } 323 324 .mdr-REagent-frame.mdr-initial { 325 top: calc(100dvh - `+ 326clientHeight+`px); 327 left: calc(100vw - `+ 328clientWidth+`px - 128px - 10px); 329 width: `+ 330clientWidth+`px; 331 height: `+ 332clientHeight+`px; 333 } 334 .mdr-REagent-frame.mdr-collapsed { 335 bottom: auto; 336 top: calc(100dvh - 36px); 337 background-color: transparent; 338 } 339 340 .mdr-REagent-frame.mdr-fullscreen { 341 top: 10px; 342 left: 10px; 343 width: calc(100vw - 20px); 344 height: calc(100dvh - 20px); 345 } 346 .mdr-REagent-frame.mdr-halfscreen { 347 top:10px; 348 left: min(50vw, calc(100vw - 366px)); 349 width: max(calc(50vw - 10px), 356px); 350 height: calc(100dvh - 20px); 351 } 352 .mdr-REagent-frame.mdr-quarterscreen { 353 top:10px; 354 left: min(75vw, calc(100vw - 366px)); 355 width: max(calc(25vw - 10px), 356px); 356 height: calc(100dvh - 20px); 357 } 358 .mdr-REagent-frame.dragging { 359 transition: none; 360 } 361 362 363} 364 365 `;function dragStart(event){dragEl=getDraggableAncestor(event.target);lastPosition.left=event.target.clientX;lastPosition.top=event.target.clientY;dragHandleEl.classList.add("dragging");dragHandleEl.addEventListener("mousemove",dragMove);window.addEventListener("selectstart",function(event){event.preventDefault();});} 366function dragMove(event){const dragElRect=dragEl.getBoundingClientRect();const newLeft=dragElRect.left+event.clientX-lastPosition.left;const newTop=dragElRect.top+event.clientY-lastPosition.top;dragEl.style.setProperty("left",`${newLeft}px`);dragEl.style.setProperty("top",`${newTop}px`);lastPosition.left=event.clientX;lastPosition.top=event.clientY;window.getSelection().removeAllRanges();} 367function getDraggableAncestor(element){if(element.getAttribute("data-draggable"))return element;return getDraggableAncestor(element.parentElement);} 368function dragEnd(){dragHandleEl.classList.remove("dragging");dragHandleEl.removeEventListener("mousemove",dragMove);dragEl=null;window.removeEventListener("selectstart",function(event){event.preventDefault();});} 369this.getContentUrl=()=>{return window.location.href;};this.createREagent=function(){mdrPrevClassName=null;const iframe=document.createElement("iframe");const btn1=document.createElement("button");const btn2=document.createElement("button");const btn3=document.createElement("button");const btn4=document.createElement("button");const btn5=document.createElement("button");const btn6=document.createElement("button");const div=document.createElement("div");const divHeader=document.createElement("div");const span=document.createElement("span");iframe.id="mdr-re-agent";iframe.className="mdr-re-agent";iframe.setAttribute("allow","camera *; microphone *; display-capture *; geolocation *");
369iframe.setAttribute("src",`${conf.clientAppUrl}/#/?topic=${encodeURI(conf.topic)}`);div.id="mdr-REagent-frame";div.className="mdr-REagent-frame";div.setAttribute("data-draggable",true);dragHandleEl=div;divHeader.id="mdr-REagent-header";divHeader.className="mdr-REagent-header";divHeader.addEventListener("mousedown",dragStart);divHeader.addEventListener("mouseup",dragEnd);divHeader.addEventListener("mouseout",dragEnd);btn1.id="mdr-btn-close";btn1.className="mdr-btn-close";btn1.addEventListener("click",function(e){e.preventDefault();if(mdr.isOnCall()){if(confirm("Want to END the video call?")){mdr.removeREagent();}}else{mdr.removeREagent();}});btn2.id="mdr-btn-minimize";btn2.className="mdr-btn-minimize";btn2.addEventListener("click",function(e){e.preventDefault();mdr.setIframeSize("minimized");});btn3.id="mdr-btn-quarterscreen";btn3.className="mdr-btn-quarterscreen";btn3.addEventListener("click",function(e){e.preventDefault();mdr.setIframeSize("quarterscreen");});btn4.id="mdr-btn-halfscreen";btn4.className="mdr-btn-halfscreen";btn4.addEventListener("click",function(e){e.preventDefault();mdr.setIframeSize("halfscreen");});btn5.id="mdr-btn-fullscreen";btn5.className="mdr-btn-fullscreen";btn5.addEventListener("click",function(e){e.preventDefault();mdr.setIframeSize("fullscreen");});btn6.id="mdr-btn-initial";btn6.className="mdr-btn-initial";btn6.addEventListener("click",function(e){e.preventDefault();mdr.setIframeSize("initial");});span.textContent=btnLabel;document.body.appendChild(div);div.appendChild(divHeader);divHeader.appendChild(span);divHeader.appendChild(btn5);divHeader.appendChild(btn4);divHeader.appendChild(btn3);divHeader.appendChild(btn6);divHeader.appendChild(btn2);divHeader.appendChild(btn1);div.appendChild(iframe);const btn=document.getElementById("mdr-re-launcher-btn");if(btn){btn.disabled=true;btn.style.visibility="hidden";}};const getReIframe=()=>document.getElementById("mdr-REagent-frame");this.removeREagent=function(){const iframe=getReIframe();iframe.parentNode.removeChild(iframe);const btn=document.getElementById("mdr-re-launcher-btn");if(btn){btn.disabled=false;btn.style.visibility="visible";} 370mdrPrevClassName=null;};this.isOnCall=function(){return mdrPrevState=="mdr-on-call";};this.collapseREagent=function(col){const iframe=getReIframe();if(iframe){iframe.style.removeProperty("top");iframe.style.removeProperty("left");iframe.style.removeProperty("width");iframe.style.removeProperty("height");if(col===true){if(!iframe.classList.contains("mdr-collapsed")){iframe.classList.remove(mdrPrevClassName);iframe.classList.add("mdr-collapsed");}}else{iframe.classList.toggle("mdr-collapsed");if(!iframe.classList.contains("mdr-collapsed")){iframe.classList.add(mdrPrevClassName);}else{iframe.classList.remove(mdrPrevClassName);}}}};this.sendMessageToIframe=message=>{const iframe=document.getElementById("mdr-re-agent");
370if(iframe){iframe.contentWindow.postMessage(message,"*");}};this.setIframeSize=function(preset){sizePreset=preset;const iframe=getReIframe();if(iframe){iframe.style.removeProperty("top");iframe.style.removeProperty("left");iframe.style.removeProperty("width");iframe.style.removeProperty("height");if(preset==="minimized"){mdr.collapseREagent(true);}else{iframe.classList.remove("mdr-collapsed");iframe.classList.remove(mdrPrevClassName);mdrPrevClassName="mdr-"+preset;iframe.classList.add(mdrPrevClassName);} 371this.sendMessageToIframe({type:"windowResized",preset});}};this.changeContentURL=url=>{console.warn("changeContentURL called, but no content iframe to control.");};function mdrCreateReLauncherButton(m){const btn=document.createElement("button");btn.id="mdr-re-launcher-btn";btn.className="mdr-re-launcher-btn"+" "+btnType;btn.textContent=btnType==="round"?"":btnLabel;btn.addEventListener("click",function(){mdr.launchREclient();});document.body.appendChild(btn);} 372this.openPopupReWindow=function(){const params="width="+clientWidth+", height="+clientHeight;const popupwin=window.open(`${conf.clientAppUrl}/#/?topic_index=${encodeURI(conf.topic)}`,"REagentWindow",params);popupwin.closeREclientWindowAfterSession=true;popupwin.focus();};const mdrInjectCSS=css=>{const el=document.createElement("style");el.type="text/css";el.innerText=css;document.head.appendChild(el);return el;};this.launchREclient=function(){switch(mode){case 0:mdr.openPopupReWindow();break;case 1:mdr.createREagent();break;default:console.log("Embedded RE Client script error: specified mode = "+ 373mode+" is invalid.");break;}};mdrInjectCSS(mdrStyles);mdrCreateReLauncherButton(mode);window.addEventListener("resize",function(event){const iframe=getReIframe();if(iframe){iframe.style.removeProperty("top");iframe.style.removeProperty("left");iframe.style.removeProperty("width");iframe.style.removeProperty("height");}});window.addEventListener("message",function(event){if(event.data){switch(event.data.type){case"windowResize":mdr.setIframeSize(event.data.preset);break;case"statusChanged":const iframe=getReIframe();if(iframe){iframe.classList.remove(mdrPrevState);if(event.data.status==="placingCall"){mdrPrevState="mdr-placing-call";}else if(event.data.status==="onCall"){mdrPrevState="mdr-on-call";mdr.sendMessageToIframe({type:"windowUrlChanged",url:mdr.getContentUrl()});}else if(event.data.status==="callEnded"){mdrPrevState=null;} 374if(mdrPrevState!==null){iframe.classList.add(mdrPrevState);}} 375break;case"open":if(!getReIframe()){mdr.createREagent();} 376break;case"close":mdr.removeREagent();break;case"getWindowSize":mdr.sendMessageToIframe({type:"windowResized",preset:sizePreset});break;case"getWindowUrl":mdr.sendMessageToIframe({type:"windowUrlChanged",url:mdr.getContentUrl()});break;}}});mdr.setIframeSize("initial");}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.